diff --git a/AGENTS.md b/AGENTS.md index 53eefe76c..ba212dbdd 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -100,6 +100,8 @@ v2026.9.5 These are LabStack's shared API and MCP conventions. Product-specific resources and protocol-defined contracts keep their own semantics. +- API errors are `{code, message}` with stable snake_case codes; tool errors + are `error: {code, message}`. Protocol-defined error bodies keep their spelling. - Application HTTP routes use `/api`, lowercase words, meaningful slash-separated domains/resources/actions, and plural collections. Do not use hyphens in product-defined static path segments. Opaque resource IDs may contain hyphens. diff --git a/cmd/fanout-docgen/routes.go b/cmd/fanout-docgen/routes.go index 32386a2a1..c71121aaf 100644 --- a/cmd/fanout-docgen/routes.go +++ b/cmd/fanout-docgen/routes.go @@ -279,6 +279,8 @@ func renderRoutes(routes []api.RouteDoc) []byte { b.WriteString("(`/api/settings/ingest`). Neither has a browser page yet.\n") b.WriteString(":::\n\n") + b.WriteString("## Errors\n\nApplication API errors, including unknown routes and wrong methods, return exactly\n`{\"code\":\"bad_request\",\"message\":\"Safe explanation\"}`. Codes are stable\nsnake_case identifiers; clients branch on `code` rather than message text.\nInvalid dashboard or panel specs also include `problems` with field paths,\nmessages and optional hints. Every error response uses `Cache-Control: no-store`;\nHEAD errors have no body. Server failures return a short, safe message; the\nunderlying error is logged and never returned.\n\nDefault codes by HTTP status:\n\n| Status | Code |\n|---|---|\n| 400 | `bad_request` |\n| 401 | `unauthorized` |\n| 403 | `forbidden` |\n| 404 | `not_found` |\n| 405 | `method_not_allowed` |\n| 409 | `conflict` |\n| 413 | `payload_too_large` |\n| 415 | `unsupported_media_type` |\n| 422 | `unprocessable` |\n| 429 | `rate_limited` |\n| 500 | `internal` |\n| 502 | `bad_gateway` |\n| 503 | `unavailable` |\n| 504 | `timeout` |\n\nOther 4xx statuses use `bad_request`; other 5xx statuses use `internal`.\nSpecific conditions use `already_current`, `dashboard_version_not_found`,\n`dashboard_version_conflict`, `invalid_spec` and `last_active_administrator`.\nTool failures carry `error: {code, message}` inside the tool result.\nPanel execution results keep their own status and error fields.\nOAuth, OTLP/gRPC, MCP JSON-RPC and AG-UI run errors keep their protocol spelling.\nOperational responses at `/healthz`, `/readyz` and `/metrics` keep their bodies.\n\n") + b.WriteString("The **Requires** column is not a description of the rule. It is the answer the\n") b.WriteString("authorization middleware gives for that exact method and path, so a route\n") b.WriteString("cannot be documented as public while the server treats it otherwise.\n") diff --git a/cmd/fanout/main.go b/cmd/fanout/main.go index 8f7add0cb..ed769cbc1 100644 --- a/cmd/fanout/main.go +++ b/cmd/fanout/main.go @@ -199,6 +199,7 @@ func main() { // Start Echo HTTP API e := echo.New() + e.HTTPErrorHandler = api.HTTPErrorHandler if err := api.ConfigureClientIP(e, cfg.TrustedProxyCIDRs); err != nil { slog.Error("trusted proxy IP extraction configuration failed", "err", err) os.Exit(1) @@ -222,7 +223,7 @@ func main() { } attrs := []any{"method", v.Method, "uri", uri, "status", v.Status, "latency", v.Latency} if v.Error != nil { - attrs = append(attrs, "err", v.Error) + attrs = []any{"method", v.Method, "route", c.Path(), "status", v.Status, "latency", v.Latency, "err", v.Error} } if v.Status >= 500 { slog.Error("request", attrs...) diff --git a/docs/superpowers/plans/2026-10-04-agent-dashboards-m1.md b/docs/superpowers/plans/2026-10-04-agent-dashboards-m1.md index a6e68fdb3..d3b6bc715 100644 --- a/docs/superpowers/plans/2026-10-04-agent-dashboards-m1.md +++ b/docs/superpowers/plans/2026-10-04-agent-dashboards-m1.md @@ -4641,7 +4641,7 @@ func writeProblems(c *echo.Context, err error) (bool, error) { if !errors.As(err, &problems) { return false, nil } - return true, c.JSON(http.StatusBadRequest, map[string]any{"message": "The dashboard spec is invalid.", "problems": problems}) + return true, c.JSON(http.StatusBadRequest, map[string]any{"code": "invalid_spec", "message": "The dashboard spec is invalid.", "problems": problems}) } ``` diff --git a/internal/agent/committed_panic_test.go b/internal/agent/committed_panic_test.go index 2db432b0a..a3d7f8d12 100644 --- a/internal/agent/committed_panic_test.go +++ b/internal/agent/committed_panic_test.go @@ -73,11 +73,12 @@ func TestRuntimePanicDistinguishesCommittedSave(t *testing.T) { if json.Unmarshal([]byte(messageText(m.Content)), &p) != nil { t.Fatal(m) } - want := "tool execution failed" + failure, ok := p["error"].(map[string]any) + want := "tool_failed" if commit { want = "interrupted" } - if p["error"] != want || p["isError"] != true || commit && m.Error != "interrupted" || !commit && m.Error == "interrupted" { + if !ok || failure["code"] != want || failure["message"] == "" || p["isError"] != true || commit && m.Error != "interrupted" || !commit && m.Error == "interrupted" { t.Fatalf("commit=%v message=%+v", commit, m) } } diff --git a/internal/agent/fragment_content_test.go b/internal/agent/fragment_content_test.go index 4a7fd49ab..f28b14a86 100644 --- a/internal/agent/fragment_content_test.go +++ b/internal/agent/fragment_content_test.go @@ -156,8 +156,11 @@ func TestAppToolErrorHasNoActivity(t *testing.T) { } if message.Role == agtypes.RoleTool { found = true - var payload map[string]any - if json.Unmarshal([]byte(messageText(message.Content)), &payload) != nil || payload["error"] != "Invalid telemetry window" || payload["isError"] != true || message.Error == "" { + var payload struct { + Error struct{ Code, Message string } + IsError bool + } + if json.Unmarshal([]byte(messageText(message.Content)), &payload) != nil || payload.Error.Code != "tool_failed" || payload.Error.Message != "Invalid telemetry window" || !payload.IsError || message.Error == "" { t.Fatal("tool error lost") } } diff --git a/internal/agent/runtime.go b/internal/agent/runtime.go index ef804e30a..c91a1a05f 100644 --- a/internal/agent/runtime.go +++ b/internal/agent/runtime.go @@ -22,6 +22,7 @@ import ( "github.com/labstack/fanout/internal/api" "github.com/labstack/fanout/internal/dashboard" appid "github.com/labstack/fanout/internal/id" + "github.com/labstack/fanout/internal/toolerror" ) const systemPrompt = `You are Fanout's observability assistant. When a view is attached to your reply it is the picture: never draw diagrams, trees, or charts in text, never use code fences to draw boxes, arrows, or trees, and never add a table or list that restates what an attached view already shows; your prose adds only what the view omits. Use get_observability_overview first for broad health questions, get_intelligence_snapshot for the latest precomputed anomalies and recurring log patterns, get_service_topology for direct dependency edges, get_service_dependencies for bounded upstream or downstream reachability from a service, get_service_performance for activity/latency/endpoints/comparisons, inspect_trace for trace or root-cause inspection, and search_logs for log questions. Treat structured outputs as authoritative. You build and change the user's dashboards. Build one whenever the user asks for an overview, asks why something is slow, failing or changing, asks to compare, break down or track telemetry, or asks for anything they would want to look at again; answer a single factual question with a view instead. To build one, read get_telemetry_schema, draft a complete spec of panels that answer the request, run preview_panels, fix every invalid panel, replace or explain every empty one, and only then call create_dashboard. Cover every part of the request: when a part has no data, keep its panel and say why in the panel description instead of dropping it. Title each panel with exactly what it measures. Prefer a few precise panels over many vague ones: headline stats first, then the time series that explain them, then a table of the worst offenders. After saving, reply in two or three sentences with what the dashboard shows and what stands out. Use filter values exactly as the schema lists them. To change a dashboard, get_dashboard first and use edit_dashboard so unrelated panels stay as they are; replace only when the user asks for a redesign. State the time window you used, distinguish missing data from healthy behavior, and never invent services, metrics, or causal claims. Keep answers concise because attached views provide interactive details. Never expose implementation details to the user: do not mention protocol names, tool names, schemas, query IDs, data-source names, storage engines, providers, or internal execution steps. Refer to attached interactive content simply as a view.` + dashboardAnalysisGuidance @@ -463,18 +464,15 @@ func (r *Runtime) execute(ctx context.Context, threadID, runID string, messages // Relayed to the model as a tool error; log it so repeated // tool-transport failures are findable server-side. slog.Warn("agent tool execution failed", "thread_id", threadID, "run_id", runID, "tool", call.Name, "err", err) - execution = ToolExecution{Content: fmt.Sprintf(`{"error":%q}`, err.Error()), IsError: true} + execution = ToolExecution{Content: toolerror.JSON("tool_failed", "Tool execution failed. Please try again."), IsError: true} } messageError := errorString(execution.IsError) if execution.IsError { // AG-UI's live result event carries content, not Message.Error. // Keep the error structural on that path as well as on reload. - var payload map[string]any - if json.Unmarshal([]byte(execution.Content), &payload) != nil || payload == nil { - payload = map[string]any{"error": execution.Content} - } + payload := toolerror.Normalize(execution.Content) payload["isError"] = true - if payload["error"] == "interrupted" { + if failure, ok := payload["error"].(map[string]any); ok && failure["code"] == "interrupted" { messageError = "interrupted" } raw, marshalErr := json.Marshal(payload) @@ -533,7 +531,7 @@ func (r *Runtime) execute(ctx context.Context, threadID, runID string, messages func (r *Runtime) executeTool(ctx context.Context, call ToolCall) (execution ToolExecution, err error) { if answerOnly, _ := ctx.Value(answerOnlyKey{}).(bool); answerOnly { if !r.tools.ReadOnly(call.Name) { - return ToolExecution{Content: `{"code":"answer_only","error":"This explanation request is answer-only. Do not save changes; explain the observed evidence and suggest corrections in your answer."}`, IsError: true}, nil + return ToolExecution{Content: toolerror.JSON("answer_only", "This explanation request is answer-only. Do not save changes; explain the observed evidence and suggest corrections in your answer."), IsError: true}, nil } } ctx = dashboard.TrackSave(ctx) @@ -541,7 +539,7 @@ func (r *Runtime) executeTool(ctx context.Context, call ToolCall) (execution Too if value := recover(); value != nil { slog.Error("agent tool panicked", "tool", call.Name, "panic", value, "stack", string(debug.Stack())) if dashboard.SaveCommitted(ctx) { - execution = ToolExecution{Content: `{"error":"interrupted"}`, IsError: true} + execution = ToolExecution{Content: toolerror.JSON("interrupted", "Tool execution was interrupted. The save may have completed."), IsError: true} err = nil } else { execution = ToolExecution{} diff --git a/internal/agent/runtime_test.go b/internal/agent/runtime_test.go index 09603652c..20c54f24b 100644 --- a/internal/agent/runtime_test.go +++ b/internal/agent/runtime_test.go @@ -240,7 +240,7 @@ func TestRuntimeToolExecutionErrorFeedsModel(t *testing.T) { second := provider.got[1] var sawErrorResult bool for _, message := range second { - if message.Role == RoleTool && message.ToolResult != nil && message.ToolResult.IsError && strings.Contains(message.ToolResult.Content, "mcp session closed") { + if message.Role == RoleTool && message.ToolResult != nil && message.ToolResult.IsError && strings.Contains(message.ToolResult.Content, `"code":"tool_failed"`) && !strings.Contains(message.ToolResult.Content, "mcp session closed") { sawErrorResult = true } } diff --git a/internal/agent/store.go b/internal/agent/store.go index eb8c1dfec..8a888f034 100644 --- a/internal/agent/store.go +++ b/internal/agent/store.go @@ -367,7 +367,7 @@ func completeInterruptedToolCalls(messages []agtypes.Message) []agtypes.Message if answered[call.ID] { continue } - repaired = append(repaired, agtypes.Message{ID: message.ID + "-" + call.ID + "-interrupted", Role: agtypes.RoleTool, ToolCallID: call.ID, Content: `{"error":"interrupted"}`, Error: "interrupted"}) + repaired = append(repaired, agtypes.Message{ID: message.ID + "-" + call.ID + "-interrupted", Role: agtypes.RoleTool, ToolCallID: call.ID, Content: `{"error":{"code":"interrupted","message":"Tool execution was interrupted. The save may have completed."}}`, Error: "interrupted"}) answered[call.ID] = true } } diff --git a/internal/agent/store_test.go b/internal/agent/store_test.go index f92d94c0f..9d608c620 100644 --- a/internal/agent/store_test.go +++ b/internal/agent/store_test.go @@ -701,7 +701,7 @@ func TestStoreStartRunRepairsUnansweredToolCalls(t *testing.T) { if len(seed[1].ToolCalls) != 1 || seed[1].ToolCalls[0].ID != "call-1" { t.Fatal("interrupted call was erased") } - if seed[2].Role != agtypes.RoleTool || seed[2].ToolCallID != "call-1" || seed[2].Content != `{"error":"interrupted"}` { + if seed[2].Role != agtypes.RoleTool || seed[2].ToolCallID != "call-1" || seed[2].Content != `{"error":{"code":"interrupted","message":"Tool execution was interrupted. The save may have completed."}}` { t.Fatalf("missing interrupted result: %+v", seed) } if got := messageIDs(seed); strings.Join(got, ",") != "user-1,assistant-1,assistant-1-call-1-interrupted,run-1-outcome,user-2" { @@ -764,7 +764,7 @@ func TestInterruptedBuildEvidenceSurvivesReloadAndTheNextRun(t *testing.T) { if err != nil { t.Fatal(err) } - if len(before.Messages) < 3 || before.Messages[2].ToolCallID != "create" || before.Messages[2].Content != `{"error":"interrupted"}` { + if len(before.Messages) < 3 || before.Messages[2].ToolCallID != "create" || before.Messages[2].Content != `{"error":{"code":"interrupted","message":"Tool execution was interrupted. The save may have completed."}}` { t.Fatalf("reload=%+v", before.Messages) } next, err := store.StartRun(ctx, "owner", agtypes.RunAgentInput{ThreadID: "thread", RunID: "next", Messages: []agtypes.Message{{ID: "next-user", Role: agtypes.RoleUser, Content: "Again"}}}) diff --git a/internal/agent/tool_error_structure_test.go b/internal/agent/tool_error_structure_test.go index 6eac62bd4..7d2c153c3 100644 --- a/internal/agent/tool_error_structure_test.go +++ b/internal/agent/tool_error_structure_test.go @@ -106,7 +106,14 @@ func TestRuntimeToolErrorsAreStructuredLiveAndPersisted(t *testing.T) { if json.Unmarshal([]byte(messageText(message.Content)), &payload) != nil || payload["error"] == nil && payload["isError"] != true || message.Error == "" { t.Fatalf("unstructured error: %+v", message) } - if interrupted && (message.Error != "interrupted" || payload["error"] != "interrupted") { + failure, ok := payload["error"].(map[string]any) + if code, _ := failure["code"].(string); !ok || code == "" { + t.Fatalf("tool error has no code: %v", failure) + } + if message, _ := failure["message"].(string); message == "" { + t.Fatalf("missing error code or message: %+v", message) + } + if interrupted && (message.Error != "interrupted" || failure["code"] != "interrupted") { t.Fatalf("unknown outcome lost: %+v", message) } } @@ -130,6 +137,13 @@ func TestRuntimeToolErrorsAreStructuredLiveAndPersisted(t *testing.T) { if json.Unmarshal([]byte(event.Content), &payload) != nil || payload["error"] == nil && payload["isError"] != true { t.Fatalf("unstructured live error: %s", event.Content) } + failure, ok := payload["error"].(map[string]any) + if code, _ := failure["code"].(string); !ok || code == "" { + t.Fatalf("tool error has no code: %v", failure) + } + if message, _ := failure["message"].(string); message == "" { + t.Fatalf("missing live code or message: %s", event.Content) + } found = true } if !found { diff --git a/internal/agent/tools.go b/internal/agent/tools.go index 5febc81f9..413f624db 100644 --- a/internal/agent/tools.go +++ b/internal/agent/tools.go @@ -9,6 +9,7 @@ import ( "github.com/labstack/fanout/internal/dashboard" fanoutmcp "github.com/labstack/fanout/internal/mcp" + "github.com/labstack/fanout/internal/toolerror" "github.com/modelcontextprotocol/go-sdk/mcp" ) @@ -116,7 +117,7 @@ func (r *ToolRegistry) Execute(ctx context.Context, call ToolCall) (ToolExecutio } } if !allowed { - return ToolExecution{Content: "This tool is unavailable to the model: " + call.Name, IsError: true}, nil + return ToolExecution{Content: toolerror.JSON("tool_failed", "This tool is unavailable to the model: "+call.Name), IsError: true}, nil } arguments := json.RawMessage(call.Input) if len(arguments) == 0 { diff --git a/internal/api/auth_test.go b/internal/api/auth_test.go index 3c46d7a99..6403c17de 100644 --- a/internal/api/auth_test.go +++ b/internal/api/auth_test.go @@ -66,6 +66,7 @@ func newTestAuthServerWith(t *testing.T, cfg config.Config, smtp auth.SMTPConfig sessions := auth.NewBrowserSessions(sqlite.DB, cfg.SessionIdleTTL, cfg.SessionAbsoluteTTL, false) audit := auth.NewAuditStore(sqlite.DB) e := echo.New() + e.HTTPErrorHandler = HTTPErrorHandler RegisterAuthMiddleware(e, users, sessions, audit, cfg) RegisterAuthRoutes(e, users, codes, setup, settings.NewStore(sqlite.DB), sessions, audit, smtp, cfg) return &testAuthServer{e: e, db: sqlite, users: users, codes: codes, setup: setup, setupToken: setupToken, sessions: sessions, audit: audit, cfg: cfg} @@ -464,14 +465,14 @@ func TestStartDoesNotRevealAccountState(t *testing.T) { } } -func TestStartExplainsWhenSMTPIsNotConfigured(t *testing.T) { +func TestLoginWithoutSMTPReturnsUnavailable(t *testing.T) { s := newTestAuthServer(t) req := httptest.NewRequest(http.MethodPost, "/api/auth/code/send", strings.NewReader(`{"email":"active@example.com"}`)) req.Header.Set("Content-Type", "application/json") rec := httptest.NewRecorder() s.e.ServeHTTP(rec, req) - if rec.Code != http.StatusServiceUnavailable || !strings.Contains(rec.Body.String(), "login link") { - t.Fatalf("status = %d body=%s, want 503 with login-link guidance", rec.Code, rec.Body.String()) + if rec.Code != http.StatusServiceUnavailable || !strings.Contains(rec.Body.String(), `"code":"unavailable"`) { + t.Fatalf("status = %d body=%s, want 503 with unavailable code", rec.Code, rec.Body.String()) } } @@ -674,6 +675,7 @@ func TestSetupLifecycleAndIngestToken(t *testing.T) { func TestSetupExpiryAndExistingAdminRetry(t *testing.T) { t.Run("expired", func(t *testing.T) { e := echo.New() + e.HTTPErrorHandler = HTTPErrorHandler h := &AuthHandler{setup: expiredSetupCredential{}, setupLimiter: auth.NewKeyedLimiter(10, 15*time.Minute)} e.POST("/api/auth/setup", h.Setup) req := httptest.NewRequest(http.MethodPost, "/api/auth/setup", strings.NewReader(`{"email":"admin@example.com","setup_token":"expired"}`)) diff --git a/internal/api/dashboard.go b/internal/api/dashboard.go index 98b1fb58c..c4e8d8ca3 100644 --- a/internal/api/dashboard.go +++ b/internal/api/dashboard.go @@ -183,15 +183,15 @@ func dashboardError(c *echo.Context, err error) error { } switch { case errors.Is(err, dashboard.ErrAlreadyCurrent): - return c.JSON(http.StatusConflict, map[string]any{"message": err.Error(), "error_code": dashboard.AlreadyCurrentCode}) + return newAPIError(http.StatusConflict, dashboard.AlreadyCurrentCode, err.Error()) case errors.Is(err, dashboard.ErrVersionNotFound): - return c.JSON(http.StatusNotFound, map[string]any{"message": err.Error(), "error_code": dashboard.VersionNotFoundCode}) + return newAPIError(http.StatusNotFound, dashboard.VersionNotFoundCode, err.Error()) case errors.Is(err, dashboard.ErrNotFound): return echo.NewHTTPError(http.StatusNotFound, "dashboard not found") case errors.Is(err, dashboard.ErrConflict): return echo.NewHTTPError(http.StatusConflict, "a dashboard with that name already exists") case errors.Is(err, dashboard.ErrStale): - return echo.NewHTTPError(http.StatusConflict, "The dashboard changed since you opened it. Reload to see the latest version.") + return newAPIError(http.StatusConflict, "dashboard_version_conflict", "The dashboard changed since you opened it. Reload to see the latest version.") case errors.Is(err, context.DeadlineExceeded): return echo.NewHTTPError(http.StatusGatewayTimeout, "Checking the dashboard took too long. Try again, or narrow its panels.").Wrap(err) case errors.Is(err, context.Canceled): diff --git a/internal/api/dashboard_history_test.go b/internal/api/dashboard_history_test.go index f5c472458..3e83b13a0 100644 --- a/internal/api/dashboard_history_test.go +++ b/internal/api/dashboard_history_test.go @@ -78,14 +78,14 @@ func TestHistoricalDashboardHTTPReadRequiresOwnerAndReturnsSaveChanges(t *testin message, code string }{ {cookie, "version 99 of dashboard " + first.ID + " does not exist", "dashboard_version_not_found"}, - {s.login(t, other), "dashboard not found", ""}, + {s.login(t, other), "dashboard not found", "not_found"}, } { var wire map[string]any missing := call("99", tc.cookie) if err := json.Unmarshal(missing.Body.Bytes(), &wire); err != nil { t.Fatal(err) } - if missing.Code != 404 || wire["message"] != tc.message || (tc.code != "" && wire["error_code"] != tc.code) || (tc.code == "" && wire["error_code"] != nil) { + if missing.Code != 404 || wire["message"] != tc.message || (tc.code != "" && wire["code"] != tc.code) || (tc.code == "" && wire["code"] != nil) { t.Fatalf("missing = %s", missing.Body) } } @@ -107,7 +107,7 @@ func TestHistoricalDashboardHTTPReadRequiresOwnerAndReturnsSaveChanges(t *testin if err := json.Unmarshal(current.Body.Bytes(), &conflict); err != nil { t.Fatal(err) } - if current.Code != 409 || conflict["error_code"] != "already_current" { + if current.Code != 409 || conflict["code"] != "already_current" { t.Fatalf("current restore=%d %s", current.Code, current.Body) } versions, err := service.Versions(t.Context(), owner.ID, first.ID) diff --git a/internal/api/dashboard_test.go b/internal/api/dashboard_test.go index 9985c1559..6f18b2014 100644 --- a/internal/api/dashboard_test.go +++ b/internal/api/dashboard_test.go @@ -75,11 +75,11 @@ func TestDashboardLifecycleOverHTTP(t *testing.T) { t.Fatalf("patch %d %s", rec.Code, rec.Body) } rec = call(http.MethodPut, "/api/dashboards/"+created.ID, `{"spec":{"name":"Ops","panels":[{"id":"notes","title":"Notes","viz":"text","content":"x"}]},"base_version":1}`, ownerCookie) - if rec.Code != http.StatusConflict || !strings.Contains(rec.Body.String(), "changed since") { + if rec.Code != http.StatusConflict || !strings.Contains(rec.Body.String(), `"code":"dashboard_version_conflict"`) || !strings.Contains(rec.Body.String(), "changed since") { t.Fatalf("stale put %d %s", rec.Code, rec.Body) } rec = call(http.MethodPut, "/api/dashboards/"+created.ID, `{"spec":{"name":"Ops","panels":[{"id":"notes","title":"Notes","viz":"piechart"}]}}`, ownerCookie) - if rec.Code != http.StatusBadRequest || !strings.Contains(rec.Body.String(), `"problems"`) { + if rec.Code != http.StatusBadRequest || !strings.Contains(rec.Body.String(), `"code":"invalid_spec"`) || !strings.Contains(rec.Body.String(), `"problems"`) { t.Fatalf("invalid put %d %s", rec.Code, rec.Body) } rec = call(http.MethodGet, "/api/dashboards/"+created.ID+"/versions", "", ownerCookie) @@ -91,7 +91,7 @@ func TestDashboardLifecycleOverHTTP(t *testing.T) { t.Fatalf("restore %d %s", rec.Code, rec.Body) } rec = call(http.MethodPost, "/api/dashboards/"+created.ID+"/versions/9/restore", "", ownerCookie) - if rec.Code != http.StatusNotFound || !strings.Contains(rec.Body.String(), "version 9 of dashboard "+created.ID+" does not exist") || !strings.Contains(rec.Body.String(), `"error_code":"dashboard_version_not_found"`) { + if rec.Code != http.StatusNotFound || !strings.Contains(rec.Body.String(), "version 9 of dashboard "+created.ID+" does not exist") || !strings.Contains(rec.Body.String(), `"code":"dashboard_version_not_found"`) { t.Fatalf("missing version %d %s", rec.Code, rec.Body) } if rec := call(http.MethodDelete, "/api/dashboards/"+created.ID, "", ownerCookie); rec.Code != http.StatusPreconditionRequired { diff --git a/internal/api/errors.go b/internal/api/errors.go new file mode 100644 index 000000000..fe8ff191c --- /dev/null +++ b/internal/api/errors.go @@ -0,0 +1,104 @@ +package api + +import ( + "errors" + "log/slog" + "net/http" + + "github.com/labstack/echo/v5" + "github.com/labstack/fanout/internal/panel" +) + +type apiError struct { + status int + Code string `json:"code"` + Message string `json:"message"` + Problems panel.Problems `json:"problems,omitempty"` +} + +func (e *apiError) Error() string { return e.Message } +func (e *apiError) StatusCode() int { return e.status } + +func newAPIError(status int, code, message string) *apiError { + return &apiError{status: status, Code: code, Message: message} +} + +func defaultErrorCode(status int) string { + switch status { + case 400: + return "bad_request" + case 401: + return "unauthorized" + case 403: + return "forbidden" + case 404: + return "not_found" + case 405: + return "method_not_allowed" + case 409: + return "conflict" + case 413: + return "payload_too_large" + case 415: + return "unsupported_media_type" + case 422: + return "unprocessable" + case 429: + return "rate_limited" + case 502: + return "bad_gateway" + case 503: + return "unavailable" + case 504: + return "timeout" + default: + if status >= 400 && status < 500 { + return "bad_request" + } + return "internal" + } +} + +// HTTPErrorHandler is the product error boundary, including router failures. +// Protocol handlers and operational probes write their own responses. +func HTTPErrorHandler(c *echo.Context, err error) { + if response, _ := echo.UnwrapResponse(c.Response()); response != nil && response.Committed { + return + } + switch c.Path() { + case "/healthz", "/readyz", "/metrics": + c.Response().Header().Set("Cache-Control", "no-store") + echo.DefaultHTTPErrorHandler(false)(c, err) + return + } + status := http.StatusInternalServerError + var statusError echo.HTTPStatusCoder + if errors.As(err, &statusError) && statusError.StatusCode() >= 400 && statusError.StatusCode() <= 599 { + status = statusError.StatusCode() + } + // Handlers write client-safe messages and wrap the cause. Any other error + // is unexpected, so its text stays in the log. + body := newAPIError(status, defaultErrorCode(status), "The request could not be completed. Please try again.") + var specific *apiError + var httpError *echo.HTTPError + if errors.As(err, &specific) { + body.Code, body.Message, body.Problems = specific.Code, specific.Message, specific.Problems + } else if errors.As(err, &httpError) && httpError.Message != "" { + body.Message = httpError.Message + } else if status < 500 { + body.Message = http.StatusText(status) + } + if status >= 500 { + slog.Error("HTTP request failed", "route", c.Path(), "error", err) + } + c.Response().Header().Set("Cache-Control", "no-store") + var writeErr error + if c.Request().Method == http.MethodHead { + writeErr = c.NoContent(status) + } else { + writeErr = c.JSON(status, body) + } + if writeErr != nil { + slog.Error("HTTP error response failed", "route", c.Path(), "error", writeErr) + } +} diff --git a/internal/api/errors_test.go b/internal/api/errors_test.go new file mode 100644 index 000000000..0b99e3af1 --- /dev/null +++ b/internal/api/errors_test.go @@ -0,0 +1,151 @@ +package api + +import ( + "bytes" + "encoding/json" + "errors" + "fmt" + "log/slog" + "net/http" + "net/http/httptest" + "strings" + "testing" + + "github.com/labstack/echo/v5" + "github.com/labstack/fanout/internal/panel" +) + +func TestHTTPFailuresCarryStatusCodesAndSafeMessages(t *testing.T) { + for status, code := range map[int]string{400: "bad_request", 401: "unauthorized", 403: "forbidden", 404: "not_found", 405: "method_not_allowed", 409: "conflict", 413: "payload_too_large", 415: "unsupported_media_type", 422: "unprocessable", 429: "rate_limited", 500: "internal", 502: "bad_gateway", 503: "unavailable", 504: "timeout", 418: "bad_request", 501: "internal"} { + t.Run(fmt.Sprint(status), func(t *testing.T) { + e := echo.New() + e.HTTPErrorHandler = HTTPErrorHandler + e.GET("/api/test", func(*echo.Context) error { return echo.NewHTTPError(status, "client explanation") }) + rec := httptest.NewRecorder() + e.ServeHTTP(rec, httptest.NewRequest(http.MethodGet, "/api/test", nil)) + var body map[string]any + if err := json.Unmarshal(rec.Body.Bytes(), &body); err != nil { + t.Fatal(err) + } + message := "client explanation" + if rec.Code != status || len(body) != 2 || body["code"] != code || body["message"] != message || rec.Header().Get("Cache-Control") != "no-store" { + t.Fatalf("%d %s %v", rec.Code, rec.Body, rec.Header()) + } + }) + } +} + +func TestRouterFailuresCarryProductCodes(t *testing.T) { + e := echo.New() + e.HTTPErrorHandler = HTTPErrorHandler + e.GET("/api/known", func(c *echo.Context) error { return c.NoContent(200) }) + for _, tc := range []struct { + method, path, code string + status int + }{{"GET", "/api/missing", "not_found", 404}, {"POST", "/api/known", "method_not_allowed", 405}, {"HEAD", "/api/missing", "", 404}} { + rec := httptest.NewRecorder() + e.ServeHTTP(rec, httptest.NewRequest(tc.method, tc.path, nil)) + if rec.Code != tc.status || rec.Header().Get("Cache-Control") != "no-store" { + t.Fatal(rec.Code, rec.Header()) + } + if tc.method == "HEAD" { + if rec.Body.Len() != 0 { + t.Fatal(rec.Body) + } + continue + } + if !strings.Contains(rec.Body.String(), `"code":"`+tc.code+`"`) { + t.Fatal(rec.Body) + } + } +} + +func TestSpecificFailuresPreserveCodesAndSpecProblems(t *testing.T) { + e := echo.New() + e.HTTPErrorHandler = HTTPErrorHandler + e.GET("/api/specific", func(*echo.Context) error { return newAPIError(409, "already_current", "Already current.") }) + e.GET("/api/spec", func(c *echo.Context) error { + _, err := writeProblems(c, panel.Problems{{Path: "panels[0].viz", Message: "Unsupported."}}) + return err + }) + for _, path := range []string{"/api/specific", "/api/spec"} { + rec := httptest.NewRecorder() + e.ServeHTTP(rec, httptest.NewRequest("GET", path, nil)) + var body apiError + if err := json.Unmarshal(rec.Body.Bytes(), &body); err != nil { + t.Fatal(err) + } + if path == "/api/spec" { + if body.Code != "invalid_spec" || len(body.Problems) != 1 || body.Problems[0].Path != "panels[0].viz" { + t.Fatal(body) + } + } else if body.Code != "already_current" || body.Message != "Already current." { + t.Fatal(body) + } + if rec.Header().Get("Cache-Control") != "no-store" { + t.Fatal(rec.Header()) + } + } +} + +func TestInternalFailuresLogPrivateDetailsWithRouteTemplate(t *testing.T) { + var logs bytes.Buffer + old := slog.Default() + slog.SetDefault(slog.New(slog.NewTextHandler(&logs, nil))) + defer slog.SetDefault(old) + e := echo.New() + e.HTTPErrorHandler = HTTPErrorHandler + e.GET("/api/items/:id", func(*echo.Context) error { return errors.New("private database path") }) + rec := httptest.NewRecorder() + e.ServeHTTP(rec, httptest.NewRequest("GET", "/api/items/secret-id?token=secret", nil)) + if rec.Code != 500 || !strings.Contains(rec.Body.String(), `"code":"internal"`) || strings.Contains(rec.Body.String(), "private") { + t.Fatal(rec.Code, rec.Body) + } + if !strings.Contains(logs.String(), "private database path") || !strings.Contains(logs.String(), "/api/items/:id") || strings.Contains(logs.String(), "secret") { + t.Fatal(logs.String()) + } +} + +func TestCommittedResponsesRemainUntouchedByErrors(t *testing.T) { + e := echo.New() + e.HTTPErrorHandler = HTTPErrorHandler + e.GET("/api/committed", func(c *echo.Context) error { + if err := c.String(202, "accepted"); err != nil { + return err + } + return errors.New("late failure") + }) + rec := httptest.NewRecorder() + e.ServeHTTP(rec, httptest.NewRequest("GET", "/api/committed", nil)) + if rec.Code != 202 || rec.Body.String() != "accepted" || rec.Header().Get("Cache-Control") != "" { + t.Fatal(rec.Code, rec.Body, rec.Header()) + } +} + +func TestOAuthErrorsKeepProtocolFields(t *testing.T) { + e := echo.New() + e.HTTPErrorHandler = HTTPErrorHandler + e.POST("/oauth/token", func(c *echo.Context) error { return oauthJSONError(c, 400, "invalid_grant", "The grant is invalid.") }) + rec := httptest.NewRecorder() + e.ServeHTTP(rec, httptest.NewRequest("POST", "/oauth/token", nil)) + var body map[string]any + if err := json.Unmarshal(rec.Body.Bytes(), &body); err != nil { + t.Fatal(err) + } + if rec.Code != 400 || len(body) != 2 || body["error"] != "invalid_grant" || body["error_description"] != "The grant is invalid." { + t.Fatal(rec.Code, body) + } +} + +func TestOperationalFailuresKeepTheirExistingBodies(t *testing.T) { + for _, path := range []string{"/healthz", "/readyz", "/metrics"} { + e := echo.New() + e.HTTPErrorHandler = HTTPErrorHandler + e.GET(path, func(*echo.Context) error { return echo.NewHTTPError(401, "metrics authentication required") }) + rec := httptest.NewRecorder() + e.ServeHTTP(rec, httptest.NewRequest("GET", path, nil)) + if rec.Code != 401 || rec.Body.String() != "{\"message\":\"metrics authentication required\"}\n" { + t.Fatal(path, rec.Code, rec.Body) + } + } +} diff --git a/internal/api/oauth_test.go b/internal/api/oauth_test.go index 4a5efb6c1..141e823fb 100644 --- a/internal/api/oauth_test.go +++ b/internal/api/oauth_test.go @@ -45,6 +45,7 @@ func newOAuthTestServerWithConfig(t *testing.T, cfg config.Config) (*echo.Echo, t.Fatalf("NewMCPAuthorization: %v", err) } e := echo.New() + e.HTTPErrorHandler = HTTPErrorHandler RegisterAuthMiddleware(e, users, sessions, audit, cfg) // Test-only login hook: it still creates the cookie through the production // BrowserSessions API and middleware commit path. diff --git a/internal/api/panels.go b/internal/api/panels.go index b79377874..f65741398 100644 --- a/internal/api/panels.go +++ b/internal/api/panels.go @@ -114,7 +114,9 @@ func writeProblems(c *echo.Context, err error) (bool, error) { if !errors.As(err, &problems) { return false, nil } - return true, c.JSON(http.StatusBadRequest, map[string]any{"message": "The dashboard spec is invalid.", "problems": problems}) + failure := newAPIError(http.StatusBadRequest, "invalid_spec", "The dashboard spec is invalid.") + failure.Problems = problems + return true, failure } func (h *PanelHandler) exemplars(c *echo.Context) error { diff --git a/internal/api/panels_test.go b/internal/api/panels_test.go index 919006d07..d19b037c4 100644 --- a/internal/api/panels_test.go +++ b/internal/api/panels_test.go @@ -84,7 +84,7 @@ func TestPanelQueryRoute(t *testing.T) { func TestPanelQueryOperationalErrors(t *testing.T) { rec := servePanels(t, &fakePanels{err: context.DeadlineExceeded}, http.MethodPost, "/api/panels/query", `{"dashboard":{"name":"x","panels":[]}}`) - if rec.Code != http.StatusGatewayTimeout || !strings.Contains(rec.Body.String(), "20 seconds") { + if rec.Code != http.StatusGatewayTimeout || !strings.Contains(rec.Body.String(), `"code":"timeout"`) { t.Fatalf("deadline %d %s", rec.Code, rec.Body) } rec = servePanels(t, &fakePanels{err: context.Canceled}, http.MethodPost, "/api/panels/query", `{"dashboard":{"name":"x","panels":[]}}`) diff --git a/internal/api/users.go b/internal/api/users.go index 7f2a93182..5b56921d0 100644 --- a/internal/api/users.go +++ b/internal/api/users.go @@ -183,7 +183,7 @@ func (h *UserHandler) updateUser(c *echo.Context, email, displayName *string, ro return echo.NewHTTPError(http.StatusConflict, "user already exists") } if errors.Is(err, auth.ErrLastActiveAdmin) { - return echo.NewHTTPError(http.StatusConflict, err.Error()) + return newAPIError(http.StatusConflict, "last_active_administrator", err.Error()) } if errors.Is(err, auth.ErrUserNotFound) { return echo.NewHTTPError(http.StatusNotFound, "user not found") @@ -199,7 +199,7 @@ func (h *UserHandler) DeleteUser(c *echo.Context) error { id := c.Param("id") if err := h.users.DeleteWithAudit(id, userAuditEvent(c, "user.deleted")); err != nil { if err == auth.ErrLastActiveAdmin { - return echo.NewHTTPError(http.StatusConflict, err.Error()) + return newAPIError(http.StatusConflict, "last_active_administrator", err.Error()) } if errors.Is(err, auth.ErrUserNotFound) { return echo.NewHTTPError(http.StatusNotFound, "user not found") diff --git a/internal/api/users_test.go b/internal/api/users_test.go index a0cda625f..164aada32 100644 --- a/internal/api/users_test.go +++ b/internal/api/users_test.go @@ -44,7 +44,7 @@ func TestUserMutationsProtectLastActiveAdmin(t *testing.T) { } rec := httptest.NewRecorder() s.e.ServeHTTP(rec, req) - if rec.Code != http.StatusConflict { + if rec.Code != http.StatusConflict || !strings.Contains(rec.Body.String(), `"code":"last_active_administrator"`) { t.Fatalf("status = %d, want 409", rec.Code) } }) diff --git a/internal/mcp/dashboards.go b/internal/mcp/dashboards.go index 1f706ca9b..1902802ae 100644 --- a/internal/mcp/dashboards.go +++ b/internal/mcp/dashboards.go @@ -12,6 +12,7 @@ import ( "github.com/labstack/fanout/internal/dashboard" "github.com/labstack/fanout/internal/panel" + "github.com/labstack/fanout/internal/toolerror" "github.com/modelcontextprotocol/go-sdk/mcp" ) @@ -65,8 +66,7 @@ type dashboardOutput struct { Dashboard *dashboard.Record `json:"dashboard,omitempty"` Warnings []string `json:"warnings,omitempty"` Receipt *dashboardReceipt `json:"receipt,omitempty"` - Error string `json:"error,omitempty"` - ErrorCode string `json:"error_code,omitempty"` + Error *toolerror.Error `json:"error,omitempty"` } type savedPanelCheck struct { @@ -140,7 +140,7 @@ var dashboardTools = [...]mcp.Tool{ }, { Name: "restore_dashboard_version", Title: "Restore dashboard version", - Description: "Restore a saved historical version of the authenticated user's dashboard only on an explicit user request. The input version selects the historical spec; the result's version is the newly saved version. Every successful call appends another version, even when restoring the latest spec. A missing or pruned target returns error_code dashboard_version_not_found; list_dashboard_versions shows retained versions. " + saveReceiptGuide, + Description: "Restore a saved historical version of the authenticated user's dashboard only on an explicit user request. The input version selects the historical spec; the result's version is the newly saved version. Every successful call appends another version, even when restoring the latest spec. A missing or pruned target returns error.code dashboard_version_not_found; list_dashboard_versions shows retained versions. " + saveReceiptGuide, Annotations: &mcp.ToolAnnotations{DestructiveHint: boolPtr(true), OpenWorldHint: boolPtr(false)}, }, } @@ -284,7 +284,7 @@ func (s *Server) dashboardRestore(ctx context.Context, req *mcp.CallToolRequest, if code != "" { result := summary(err.Error()) result.IsError = true - return result, dashboardOutput{Error: err.Error(), ErrorCode: code}, nil + return result, dashboardOutput{Error: &toolerror.Error{Code: code, Message: err.Error()}}, nil } return nil, dashboardOutput{}, dashboardToolError(err) } diff --git a/internal/mcp/error_contract_test.go b/internal/mcp/error_contract_test.go new file mode 100644 index 000000000..c9cdbd4fe --- /dev/null +++ b/internal/mcp/error_contract_test.go @@ -0,0 +1,47 @@ +package mcp + +import ( + "context" + "encoding/json" + "errors" + "testing" + + "github.com/modelcontextprotocol/go-sdk/mcp" +) + +func TestToolFailuresCarryMatchingErrorObjectsInBothContentPaths(t *testing.T) { + s := newPanelServer(t) + mcp.AddTool(s.mcp, &mcp.Tool{Name: "fail_tool"}, func(context.Context, *mcp.CallToolRequest, struct{}) (*mcp.CallToolResult, struct{}, error) { + return nil, struct{}{}, errors.New("The tool could not complete.") + }) + client := connectTestClient(t, s, nil) + result, err := client.CallTool(t.Context(), &mcp.CallToolParams{Name: "fail_tool", Arguments: map[string]any{}}) + if err != nil || !result.IsError { + t.Fatal(result, err) + } + if result.StructuredContent != nil { + t.Fatalf("structured content would break the tool's output schema: %v", result.StructuredContent) + } + if len(result.Content) != 1 { + t.Fatal(result.Content) + } + raw := []byte(result.Content[0].(*mcp.TextContent).Text) + var body struct { + Error struct{ Code, Message string } + } + if err := json.Unmarshal(raw, &body); err != nil { + t.Fatal(err) + } + if body.Error.Code != "tool_failed" || body.Error.Message != "The tool could not complete." { + t.Fatal(string(raw)) + } +} + +func TestUnknownToolsKeepJSONRPCFailures(t *testing.T) { + s := newPanelServer(t) + client := connectTestClient(t, s, nil) + result, err := client.CallTool(t.Context(), &mcp.CallToolParams{Name: "missing_tool", Arguments: map[string]any{}}) + if err == nil || result != nil { + t.Fatal(result, err) + } +} diff --git a/internal/mcp/fragment_contract_test.go b/internal/mcp/fragment_contract_test.go index 893153caa..474652523 100644 --- a/internal/mcp/fragment_contract_test.go +++ b/internal/mcp/fragment_contract_test.go @@ -31,7 +31,15 @@ func TestOmittedArgumentsRawJSONRPC(t *testing.T) { recorder := httptest.NewRecorder() h.ServeHTTP(recorder, request) body := recorder.Body.String() - if strings.Contains(body, "unexpected end of JSON") || strings.Contains(body, `"error":{`) || recorder.Code != http.StatusOK { + var response struct{ Error json.RawMessage } + for _, line := range strings.Split(body, "\n") { + if strings.HasPrefix(line, "data: ") { + if err := json.Unmarshal([]byte(strings.TrimPrefix(line, "data: ")), &response); err != nil { + t.Fatal(err) + } + } + } + if strings.Contains(body, "unexpected end of JSON") || len(response.Error) != 0 || recorder.Code != http.StatusOK { t.Fatalf("status=%d body=%s", recorder.Code, body) } }) diff --git a/internal/mcp/history_test.go b/internal/mcp/history_test.go index a5b6a682f..9cfc9c2e4 100644 --- a/internal/mcp/history_test.go +++ b/internal/mcp/history_test.go @@ -171,7 +171,7 @@ func TestDashboardRestoreReceiptUsesLatestCommittedBase(t *testing.T) { // The current version is rejected. A historical version with identical // contents still appends a version on each successful restore. result, rejected, err := s.dashboardRestore(t.Context(), ownerRequest(), DashboardRestoreInput{ID: created.Dashboard.ID, Version: 3}) - if err != nil || !result.IsError || rejected.ErrorCode != "already_current" || rejected.Receipt != nil || rejected.Dashboard != nil { + if err != nil || !result.IsError || rejected.Error.Code != "already_current" || rejected.Receipt != nil || rejected.Dashboard != nil { t.Fatalf("current restore=%+v err=%v", rejected, err) } for range 2 { @@ -263,7 +263,7 @@ func TestDashboardHistoryRejectsInvalidMissingAndPrunedVersions(t *testing.T) { t.Fatalf("pruned version error=%v", err) } result, out, err := s.dashboardRestore(t.Context(), ownerRequest(), DashboardRestoreInput{ID: created.Dashboard.ID, Version: 1}) - if err != nil || !result.IsError || out.Error != fmt.Sprintf("version 1 of dashboard %s does not exist", created.Dashboard.ID) || out.ErrorCode != "dashboard_version_not_found" || out.Dashboard != nil || out.Receipt != nil { + if err != nil || !result.IsError || out.Error.Message != fmt.Sprintf("version 1 of dashboard %s does not exist", created.Dashboard.ID) || out.Error.Code != "dashboard_version_not_found" || out.Dashboard != nil || out.Receipt != nil { t.Fatalf("pruned version result=%+v output=%+v err=%v", result, out, err) } _, history, err := s.dashboardVersions(t.Context(), ownerRequest(), DashboardIDInput{ID: created.Dashboard.ID}) @@ -284,8 +284,11 @@ func TestMissingDashboardVersionHasDistinctErrorCode(t *testing.T) { t.Fatalf("result=%+v err=%v", result, err) } raw, _ := json.Marshal(result.StructuredContent) - var payload map[string]any - if json.Unmarshal(raw, &payload) != nil || payload["error"] != fmt.Sprintf("version 9 of dashboard %s does not exist", created.Dashboard.ID) || payload["error_code"] != "dashboard_version_not_found" || payload["receipt"] != nil || payload["dashboard"] != nil { + var payload struct { + Error struct{ Code, Message string } + Receipt, Dashboard any + } + if json.Unmarshal(raw, &payload) != nil || payload.Error.Message != fmt.Sprintf("version 9 of dashboard %s does not exist", created.Dashboard.ID) || payload.Error.Code != "dashboard_version_not_found" || payload.Receipt != nil || payload.Dashboard != nil { t.Fatalf("missing version payload=%s", raw) } } @@ -302,8 +305,11 @@ func TestCurrentDashboardVersionRestoreHasDistinctErrorCodeWithoutSave(t *testin t.Fatalf("result=%+v err=%v", result, err) } raw, _ := json.Marshal(result.StructuredContent) - var payload map[string]any - if json.Unmarshal(raw, &payload) != nil || payload["error_code"] != "already_current" || payload["error"] != dashboard.ErrAlreadyCurrent.Error() || payload["receipt"] != nil || payload["dashboard"] != nil { + var payload struct { + Error struct{ Code, Message string } + Receipt, Dashboard any + } + if json.Unmarshal(raw, &payload) != nil || payload.Error.Code != "already_current" || payload.Error.Message != dashboard.ErrAlreadyCurrent.Error() || payload.Receipt != nil || payload.Dashboard != nil { t.Fatalf("current version payload=%s", raw) } versions, err := s.dashboards.Versions(t.Context(), "owner", created.Dashboard.ID) diff --git a/internal/mcp/server.go b/internal/mcp/server.go index 2d28a721c..718e56286 100644 --- a/internal/mcp/server.go +++ b/internal/mcp/server.go @@ -17,6 +17,7 @@ import ( "github.com/labstack/fanout/internal/intelligence" "github.com/labstack/fanout/internal/observability" "github.com/labstack/fanout/internal/panel" + "github.com/labstack/fanout/internal/toolerror" "github.com/modelcontextprotocol/go-sdk/mcp" ) @@ -132,7 +133,7 @@ func newServer(queries Observability, dashboards *dashboard.Service, panels *pan s.registerPanelTools() s.registerDashboardTools() s.registerAppResources() - s.mcp.AddReceivingMiddleware(recoverToolPanic, addStaticCacheHints, filterMCPAppToolMetadata, s.validateToolArguments) + s.mcp.AddReceivingMiddleware(normalizeToolErrors, recoverToolPanic, addStaticCacheHints, filterMCPAppToolMetadata, s.validateToolArguments) return s } @@ -152,8 +153,8 @@ func recoverToolPanic(next mcp.MethodHandler) mcp.MethodHandler { failure := summary("tool execution failed") failure.IsError = true if dashboard.SaveCommitted(ctx) { - failure.Content = []mcp.Content{&mcp.TextContent{Text: `{"error":"interrupted"}`}} - failure.StructuredContent = map[string]any{"error": "interrupted"} + failure.Content = []mcp.Content{&mcp.TextContent{Text: toolerror.JSON("interrupted", "Tool execution was interrupted. The save may have completed.")}} + failure.StructuredContent = toolerror.New("interrupted", "Tool execution was interrupted. The save may have completed.") } result, err = failure, nil } @@ -163,6 +164,43 @@ func recoverToolPanic(next mcp.MethodHandler) mcp.MethodHandler { } } +// Normalize only product tool failures; JSON-RPC errors and panel frames keep +// their protocol contracts. Both content paths carry the same error object. +func normalizeToolErrors(next mcp.MethodHandler) mcp.MethodHandler { + return func(ctx context.Context, method string, req mcp.Request) (mcp.Result, error) { + result, err := next(ctx, method, req) + failure, ok := result.(*mcp.CallToolResult) + if err != nil || method != "tools/call" || !ok || !failure.IsError { + return result, err + } + // A tool's output schema rarely declares an error field, so a failure + // keeps structured content only when the tool supplied it. + structured := failure.StructuredContent != nil + content := "" + if structured { + if raw, marshalErr := json.Marshal(failure.StructuredContent); marshalErr == nil { + content = string(raw) + } + } else { + for _, block := range failure.Content { + if value, ok := block.(*mcp.TextContent); ok { + content += value.Text + } + } + } + payload := toolerror.Normalize(content) + raw, marshalErr := json.Marshal(payload) + if marshalErr != nil { + return nil, marshalErr + } + if structured { + failure.StructuredContent = payload + } + failure.Content = []mcp.Content{&mcp.TextContent{Text: string(raw)}} + return failure, nil + } +} + // addStaticCacheHints lets clients reuse catalogs and embedded MCP Apps between // reconnects. They are identical for every principal and cannot change until // the process is replaced, so a short public TTL is both safe and bounded by a diff --git a/internal/toolerror/error.go b/internal/toolerror/error.go new file mode 100644 index 000000000..48cf7547f --- /dev/null +++ b/internal/toolerror/error.go @@ -0,0 +1,50 @@ +// Package toolerror defines product errors inside MCP and agent tool results. +package toolerror + +import "encoding/json" + +type Error struct { + Code string `json:"code"` + Message string `json:"message"` +} + +type Result struct { + Error *Error `json:"error"` +} + +func New(code, message string) Result { return Result{Error: &Error{Code: code, Message: message}} } + +func JSON(code, message string) string { + raw, _ := json.Marshal(New(code, message)) + return string(raw) +} + +// Normalize preserves structured result fields and gives unstructured failures +// the default tool code. Callers use it only for failed tool executions. +func Normalize(content string) map[string]any { + var payload map[string]any + if json.Unmarshal([]byte(content), &payload) != nil || payload == nil { + payload = map[string]any{} + } + code, message := "tool_failed", "" + switch value := payload["error"].(type) { + case map[string]any: + if text, _ := value["code"].(string); text != "" { + code = text + } + message, _ = value["message"].(string) + if code == value["code"] && message != "" { + return payload + } + case string: + message = value + } + if _, has := payload["error"]; message == "" && !has { + message = content + } + if message == "" { + message = "Tool execution failed." + } + payload["error"] = &Error{Code: code, Message: message} + return payload +} diff --git a/internal/toolerror/error_test.go b/internal/toolerror/error_test.go new file mode 100644 index 000000000..0d8be9bd4 --- /dev/null +++ b/internal/toolerror/error_test.go @@ -0,0 +1,28 @@ +package toolerror + +import ( + "encoding/json" + "testing" +) + +func TestNormalizeKeepsPartialErrorObjectsUnwrapped(t *testing.T) { + for _, tc := range []struct{ name, content, code, message string }{ + {"complete", `{"error":{"code":"answer_only","message":"x"}}`, "answer_only", "x"}, + {"missing code", `{"error":{"message":"x"}}`, "tool_failed", "x"}, + {"missing message", `{"error":{"code":"interrupted"}}`, "interrupted", "Tool execution failed."}, + {"string error", `{"error":"x"}`, "tool_failed", "x"}, + {"plain text", "x", "tool_failed", "x"}, + {"empty", "", "tool_failed", "Tool execution failed."}, + } { + t.Run(tc.name, func(t *testing.T) { + raw, err := json.Marshal(Normalize(tc.content)) + if err != nil { + t.Fatal(err) + } + var got Result + if err := json.Unmarshal(raw, &got); err != nil || got.Error == nil || got.Error.Code != tc.code || got.Error.Message != tc.message { + t.Fatalf("%s %v", raw, err) + } + }) + } +} diff --git a/internal/ui/dist/assets/auth-BBLbNg3S.js b/internal/ui/dist/assets/auth-BBLbNg3S.js new file mode 100644 index 000000000..34d295e27 --- /dev/null +++ b/internal/ui/dist/assets/auth-BBLbNg3S.js @@ -0,0 +1 @@ +import{A as e,C as t,K as n,M as r,Q as i,St as a,T as o,X as s,_ as c,_t as l,a as u,c as d,ct as f,d as p,f as m,h,ht as g,i as ee,j as _,l as te,m as v,o as y,p as b,r as ne,t as x,tt as re,u as ie,x as ae,y as oe,yt as se}from"./brand-B8x2UvAx.js";var S=a(se(),1),C=S.use,w=S.useLayoutEffect;function ce(e){let t=g();return S.useCallback(n=>t.navigate({...n,from:n.from??e?.from}),[e?.from,t])}function T(e){let t=g(),n=ce(),r=S.useRef(null);return w(()=>{r.current!==e&&(n(e),r.current=e)},[t,e,n]),null}function E({value:e,defaultValue:t,finalValue:n,onChange:r=()=>{}}){let[i,a]=(0,S.useState)(t===void 0?n:t);return e===void 0?[i,(e,...t)=>{a(e),r?.(e,...t)},!1]:[e,r,!0]}var D={root:`m_b183c0a2`},O=l(),k=s((e,{color:t})=>({root:{"--code-bg":t?n(t,e):void 0}})),A=o(n=>{let i=r(`Code`,null,n),{classNames:a,className:o,style:s,styles:c,unstyled:l,vars:u,color:d,block:f,mod:p,attributes:m,...h}=i,g=e({name:`Code`,props:i,classes:D,className:o,style:s,classNames:a,styles:c,unstyled:l,attributes:m,vars:u,varsResolver:k});return(0,O.jsx)(t,{component:f?`pre`:`code`,mod:[{block:f},p],...g(`root`),...h,dir:`ltr`})});A.classes=D,A.varsResolver=k,A.displayName=`@mantine/core/Code`;function j(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":f(t??`sm`,`pin-input-size`)}})),N=o(t=>{let{name:n,form:a,className:o,value:s,defaultValue:l,variant:u,gap:d,style:f,size:p,classNames:m,styles:g,unstyled:ee,length:te,onChange:v,onComplete:y,manageFocus:b,autoFocus:ne,error:x,success:ie,radius:ae,disabled:oe,oneTimeCode:se,placeholder:C,type:w,mask:ce,readOnly:T,inputType:D,inputMode:k,ariaLabel:A,vars:N,id:P,hiddenInputProps:F,rootRef:I,getInputProps:L,attributes:R,ref:fe,...z}=r([`Input`,`PinInput`],de,t),B=re(P),V=e({name:`PinInput`,classes:le,props:t,className:o,style:f,classNames:m,styles:g,unstyled:ee,attributes:R,vars:N,varsResolver:M}),{resolvedClassNames:pe,resolvedStyles:H}=_({classNames:m,styles:g,props:t}),[me,he]=(0,S.useState)(-1),U=(0,S.useRef)([]),W=te??4,G=(0,S.useRef)(!1),[K,q]=E({value:s===void 0?void 0:j(W,s),defaultValue:l?.split(``).slice(0,W),finalValue:j(W,``),onChange:e=>{let t=e.join(``).trim();v?.(t),t.length===W&&!G.current?(G.current=!0,y?.(t)):t.length(w instanceof RegExp?w:w&&w in ue?ue[w]:null)?.test(e),X=(e,t)=>{if(b){if(e===`next`){let e=t+1;e=0&&U.current[e]?.focus()}}},Z=(e,t)=>{let n=[...J];return n[t]=e,q(n),n},Q=(e,t)=>{let n=e.target.value;if(n.length>1){if(n.length>2){if(Y(n)){q(j(W,n));let e=Math.min(n.length,W);e{let{ctrlKey:n,metaKey:r,key:i,shiftKey:a,target:o}=e,s=o.value;if(k===`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&&b&&(e.preventDefault(),X(`prev`,t));break;case` `:e.preventDefault(),X(`next`,t);break;case`Delete`:e.preventDefault(),Z(``,t);break;case`Backspace`:s===``?(e.preventDefault(),X(`prev`,t)):(Z(``,t),t0&&i===J[t]&&(e.preventDefault(),X(`next`,t))}},ve=(e,t)=>{e.target.select(),he(t)},$=()=>{he(-1)},ye=e=>{e.preventDefault();let t=e.clipboardData.getData(`text/plain`).replace(/[\n\r\s]+/g,``);if(Y(t.trim())){let e=j(W,t);q(e);let n=e.filter(e=>e!==``).length;n>=W?U.current[W-1]?.focus():U.current[n]?.focus()}};return(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)(c,{...z,...V(`root`),ref:I,role:`group`,id:B,gap:d,unstyled:ee,wrap:`nowrap`,variant:u,__size:p,dir:`ltr`,children:J.map((e,t)=>(0,S.createElement)(h,{component:`input`,...V(`pinInput`,{style:{"--input-padding":`0`,"--input-text-align":`center`}}),classNames:pe,styles:H,size:p,__staticSelector:`PinInput`,id:`${B}-${t+1}`,key:`${B}-${t}`,inputMode:k||(w===`number`?`numeric`:`text`),onChange:e=>Q(e,t),onKeyDown:e=>_e(e,t),onFocus:e=>ve(e,t),onBlur:$,onPaste:ye,type:D||(ce?`password`:w===`number`?`tel`:`text`),radius:ae,error:x,success:ie,variant:u,disabled:oe,ref:e=>{e&&(t===0&&i(fe,e),U.current[t]=e)},autoComplete:se?`one-time-code`:`off`,placeholder:me===t?``:C,value:e,autoFocus:ne&&t===0,unstyled:ee,"aria-label":A,readOnly:T,...L?.(t)}))}),(0,O.jsx)(`input`,{type:`hidden`,name:n,form:a,value:ge,...F})]})});N.classes={...le,...v.classes},N.varsResolver=M,N.displayName=`@mantine/core/PinInput`;var P=o(e=>{let t=r([`Input`,`InputWrapper`,`TextInput`],null,e);return(0,O.jsx)(v,{component:`input`,...t,__staticSelector:`TextInput`})});P.classes=v.classes,P.displayName=`@mantine/core/TextInput`;var F=new Map([[`bold`,S.createElement(S.Fragment,null,S.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`,S.createElement(S.Fragment,null,S.createElement(`path`,{d:`M112,56V200L40,128Z`,opacity:`0.2`}),S.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`,S.createElement(S.Fragment,null,S.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`,S.createElement(S.Fragment,null,S.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`,S.createElement(S.Fragment,null,S.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`,S.createElement(S.Fragment,null,S.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`}))]]),I=new Map([[`bold`,S.createElement(S.Fragment,null,S.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`,S.createElement(S.Fragment,null,S.createElement(`path`,{d:`M216,128l-72,72V56Z`,opacity:`0.2`}),S.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`,S.createElement(S.Fragment,null,S.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`,S.createElement(S.Fragment,null,S.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`,S.createElement(S.Fragment,null,S.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`,S.createElement(S.Fragment,null,S.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`}))]]),L=new Map([[`bold`,S.createElement(S.Fragment,null,S.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`,S.createElement(S.Fragment,null,S.createElement(`path`,{d:`M168,100a60,60,0,1,1-60-60A60,60,0,0,1,168,100Z`,opacity:`0.2`}),S.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`,S.createElement(S.Fragment,null,S.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`,S.createElement(S.Fragment,null,S.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`,S.createElement(S.Fragment,null,S.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`,S.createElement(S.Fragment,null,S.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`}))]]),R=S.forwardRef((e,t)=>S.createElement(u,{ref:t,...e,weights:F}));R.displayName=`ArrowLeftIcon`;var fe=R,z=S.forwardRef((e,t)=>S.createElement(u,{ref:t,...e,weights:I}));z.displayName=`ArrowRightIcon`;var B=z,V=S.forwardRef((e,t)=>S.createElement(u,{ref:t,...e,weights:L}));V.displayName=`UserPlusIcon`;var pe=V,H=class extends Error{status;problems;code;constructor(e,t,n=[],r=``){super(e),this.status=t,this.problems=n,this.code=r}},me=`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 U(e){return!e||typeof e!=`object`||!(`id`in e)||typeof e.id!=`string`||e.id===``?`none`:`user`}function W(){window.dispatchEvent(new Event(me))}async function G(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&&W(),r.status===403){let e=await r.clone().json().catch(()=>({}));throw new H(e.message??`You do not have permission to perform this action.`,r.status,[],e.code??``)}return r}async function K(){let e=await G(`/api/auth/logout`,{method:`POST`});if(!e.ok&&e.status!==401)throw Error(`Sign-out failed — your session is still active.`);e.status!==401&&W(),window.location.assign(`/`)}var q=(0,S.createContext)(null);function J(){let e=(0,S.useContext)(q);if(!e)throw Error(`Fanout runtime status is unavailable`);return e}var ge=(0,S.createContext)(null);function Y(){let e=(0,S.useContext)(ge);if(!e)throw Error(`Fanout viewer is unavailable`);return e}function X(e){if(!e||typeof e!=`object`)return null;let t=e;return typeof t.id!=`string`||t.id===``||t.status!==`active`&&t.status!==`suspended`?null:{id:t.id,email:typeof t.email==`string`?t.email:``,display_name:typeof t.display_name==`string`?t.display_name:``,status:t.status,role:typeof t.role==`string`?t.role:``}}async function Z(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??`Request failed (${n.status})`);return r}function Q({children:e,wide:n=!1}){return(0,O.jsx)(t,{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,O.jsx)(ie,{mih:`100dvh`,px:`md`,py:48,children:(0,O.jsx)(te,{size:n?680:480,w:`100%`,children:(0,O.jsx)(ae,{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 _e(){return typeof window>`u`?``:new URLSearchParams(window.location.search).get(`setup_token`)??``}function ve(){return typeof window>`u`?``:new URLSearchParams(window.location.search).get(`login_token`)??``}function $({children:e}){let n=ce(),[r,i]=(0,S.useState)(null),[a,o]=(0,S.useState)(!1),[s,l]=(0,S.useState)(`none`),[u,f]=(0,S.useState)(null),[h,g]=(0,S.useState)(!1),[_,te]=(0,S.useState)(``),[v,re]=(0,S.useState)(``),[ae,se]=(0,S.useState)(_e),[C,w]=(0,S.useState)(ve),[T,E]=(0,S.useState)(``),[D,k]=(0,S.useState)(!1),[j,le]=(0,S.useState)(0),[ue,de]=(0,S.useState)(()=>Date.now()),[M,F]=(0,S.useState)(!1),[I,L]=(0,S.useState)(``),[R,z]=(0,S.useState)(null),[V,H]=(0,S.useState)(!1),W=(0,S.useRef)(null),G=he(),K=s===`user`;async function J(){let e=await fetch(`/api/auth/me`,{credentials:`same-origin`});if(!e.ok){l(`none`),f(null);return}let t=await e.json().catch(()=>null);l(U(t)),f(X(t))}async function Y(){try{let e=await fetch(`/api/auth/me`,{credentials:`same-origin`});if(!e.ok)return;f(X(await e.json().catch(()=>null)))}catch{}}(0,S.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`),n({href:e.pathname+e.search+e.hash,replace:!0}))},[n]),(0,S.useEffect)(()=>{Z(`/api/auth/status`).then(i).catch(e=>L(String(e))).finally(()=>o(!0)),J().catch(()=>l(`none`)).finally(()=>g(!0));let e=()=>{l(`none`),f(null)};return window.addEventListener(me,e),()=>window.removeEventListener(me,e)},[]),(0,S.useEffect)(()=>{h&&s===`none`&&C&&(F(!0),L(``),Z(`/api/auth/link/verify`,{token:C}).then(()=>{l(`user`),Y()}).catch(e=>L(e instanceof Error?e.message:String(e))).finally(()=>{w(``),F(!1)}))},[C,h,s]),(0,S.useEffect)(()=>{K&&h&&G&&window.location.replace(G)},[K,G,h]),(0,S.useEffect)(()=>{if(j<=Date.now())return;let e=setInterval(()=>{de(Date.now()),Date.now()>=j&&clearInterval(e)},1e3);return()=>clearInterval(e)},[j]);let $=Math.max(0,Math.ceil((j-ue)/1e3));(0,S.useEffect)(()=>{D&&!M&&I&&W.current?.querySelector(`input`)?.focus()},[M,D,I]);async function ye(e){try{await navigator.clipboard.writeText(e),H(!0)}catch{L(`Clipboard access failed. Select and copy the token manually.`)}}if(R?.ingest_token)return(0,O.jsx)(Q,{wide:!0,children:(0,O.jsxs)(d,{gap:`lg`,children:[(0,O.jsx)(x,{}),(0,O.jsxs)(`div`,{children:[(0,O.jsx)(m,{c:`brand`,fw:700,size:`xs`,tt:`uppercase`,lts:`0.12em`,children:`Setup complete`}),(0,O.jsx)(y,{order:1,mt:`xs`,fz:{base:28,sm:32},lh:1.08,children:`Save your ingest token`})]}),(0,O.jsx)(m,{c:`dimmed`,children:`Fanout shows this token once. Store it with your collector secrets before continuing.`}),(0,O.jsxs)(d,{gap:`xs`,children:[(0,O.jsx)(m,{size:`sm`,fw:600,children:`OTLP endpoint`}),(0,O.jsx)(A,{block:!0,children:R.suggested_endpoint??window.location.origin})]}),(0,O.jsxs)(d,{gap:`xs`,children:[(0,O.jsx)(m,{size:`sm`,fw:600,children:`Header`}),(0,O.jsxs)(A,{block:!0,children:[R.ingest_header_name??`Authorization`,`: Bearer `,R.ingest_token]})]}),I&&(0,O.jsx)(b,{color:`bad`,radius:`md`,children:I}),(0,O.jsxs)(c,{grow:!0,align:`stretch`,children:[(0,O.jsx)(p,{variant:`light`,radius:`md`,leftSection:V?(0,O.jsx)(ee,{size:16,weight:`bold`}):(0,O.jsx)(ne,{size:16}),onClick:()=>void ye(`${R.ingest_header_name??`Authorization`}: Bearer ${R.ingest_token}`),children:V?`Copied`:`Copy header`}),(0,O.jsx)(p,{radius:`md`,rightSection:(0,O.jsx)(B,{size:16,weight:`bold`}),onClick:()=>{l(`user`),z(null),Y()},children:`Continue to Fanout`})]}),(0,O.jsx)(p,{variant:`subtle`,size:`compact-xs`,onClick:()=>void ye(R.ingest_token??``),children:`Copy token only`})]})});if(!h||!a||C)return(0,O.jsx)(ie,{mih:`100dvh`,children:(0,O.jsx)(oe,{size:`sm`})});if(!r)return(0,O.jsx)(Q,{children:(0,O.jsxs)(d,{gap:`lg`,children:[(0,O.jsx)(x,{}),(0,O.jsx)(y,{order:1,children:`Fanout is unavailable`}),(0,O.jsx)(b,{color:`bad`,radius:`md`,children:I||`Authentication status could not be loaded.`})]})});if(K&&G)return null;if(K)return(0,O.jsx)(q.Provider,{value:r,children:(0,O.jsx)(ge.Provider,{value:u??{id:``,email:_,display_name:v,status:`active`,role:``},children:e})});if(r&&!r.setup_required&&r.auth_mode===`oidc`){let e=G?`/api/auth/oidc/start?return_to=${encodeURIComponent(G)}`:`/api/auth/oidc/start`;return(0,O.jsx)(Q,{children:(0,O.jsxs)(d,{gap:28,children:[(0,O.jsx)(x,{}),(0,O.jsxs)(d,{gap:10,children:[(0,O.jsx)(m,{c:`brand`,fw:700,size:`xs`,tt:`uppercase`,lts:`0.12em`,children:`Secure workspace`}),(0,O.jsx)(y,{order:1,fz:{base:28,sm:32},lh:1.08,children:`Sign in`}),(0,O.jsx)(m,{c:`dimmed`,size:`md`,lh:1.6,children:`Use your organization's identity provider to continue.`})]}),I&&(0,O.jsx)(b,{color:`bad`,radius:`md`,children:I}),(0,O.jsx)(p,{component:`a`,href:e,size:`md`,radius:`md`,rightSection:(0,O.jsx)(B,{size:17,weight:`bold`}),children:`Continue with SSO`})]})})}async function be(){F(!0),L(``);try{await Z(`/api/auth/code/send`,{email:_}),k(!0),E(``),le(Date.now()+3e4),de(Date.now())}catch(e){L(e instanceof Error?e.message:String(e))}finally{F(!1)}}async function xe(e){F(!0),L(``);try{await Z(`/api/auth/code/verify`,{email:_,code:e}),l(`user`),k(!1),E(``),le(0),Y()}catch(e){E(``),L(e instanceof Error?e.message:String(e))}finally{F(!1)}}function Se(){k(!1),E(``),L(``)}async function Ce(e){e.preventDefault(),F(!0),L(``);try{if(r?.setup_required){let e=await Z(`/api/auth/setup`,{email:_,display_name:v,setup_token:ae});e.ingest_token?z(e):(l(`user`),Y())}else if(D){await xe(T);return}else{await be();return}}catch(e){L(e instanceof Error?e.message:String(e))}finally{F(!1)}}let we=D&&!r?.setup_required,Te=r?.setup_required?`Create the first admin`:we?`Check your email`:r?.self_signup?`Sign in or create an account`:`Sign in`,Ee=r?.setup_required?`Use the one-time token printed by the Fanout process.`:r?.smtp_configured?we?`We sent a code to ${_}.`:r?.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,O.jsx)(Q,{children:(0,O.jsxs)(d,{gap:28,children:[(0,O.jsx)(x,{}),(0,O.jsxs)(d,{gap:10,children:[(0,O.jsx)(m,{c:`brand`,fw:700,size:`xs`,tt:`uppercase`,lts:`0.12em`,children:r?.setup_required?`One-time setup`:`Secure workspace`}),(0,O.jsx)(y,{order:1,fz:{base:28,sm:32},lh:1.08,children:Te}),Ee&&(0,O.jsx)(m,{c:`dimmed`,size:`md`,lh:1.6,maw:390,children:Ee})]}),(0,O.jsx)(`form`,{onSubmit:Ce,children:(0,O.jsxs)(d,{gap:`md`,children:[(0,O.jsx)(P,{label:`Email`,placeholder:`you@company.com`,type:`email`,required:!0,value:_,onChange:e=>te(e.currentTarget.value),disabled:D,variant:`filled`,radius:`md`,size:`md`,autoFocus:!D}),r?.setup_required&&(0,O.jsx)(P,{label:`Display name`,placeholder:`Your display name`,value:v,onChange:e=>re(e.currentTarget.value),variant:`filled`,radius:`md`,size:`md`}),r?.setup_required&&(0,O.jsx)(P,{label:`Setup token`,placeholder:`from the setup URL printed at startup`,required:!0,value:ae,onChange:e=>se(e.currentTarget.value),autoComplete:`one-time-code`,variant:`filled`,radius:`md`,size:`md`}),we&&(0,O.jsxs)(d,{gap:`xs`,children:[(0,O.jsx)(m,{size:`sm`,fw:600,children:`Verification code`}),(0,O.jsx)(t,{ref:W,children:(0,O.jsx)(N,{length:6,type:`number`,oneTimeCode:!0,autoFocus:!0,value:T,onChange:E,onComplete:e=>void xe(e),disabled:M,error:!!I,size:`md`,radius:`md`,"aria-label":`Verification code`,getInputProps:e=>({"aria-label":`Digit ${e+1}`})})}),(0,O.jsxs)(c,{justify:`space-between`,gap:`xs`,children:[(0,O.jsxs)(m,{c:`dimmed`,size:`xs`,children:[`Sent to `,_]}),(0,O.jsx)(p,{variant:`subtle`,size:`compact-xs`,leftSection:(0,O.jsx)(fe,{size:12,weight:`bold`}),onClick:Se,disabled:M,children:`Change email`})]}),(0,O.jsxs)(c,{justify:`space-between`,gap:`xs`,children:[(0,O.jsx)(m,{c:`dimmed`,size:`xs`,children:`Codes expire in 5 minutes`}),(0,O.jsx)(p,{variant:`subtle`,size:`compact-xs`,onClick:()=>void be(),disabled:M||$>0,children:$>0?`Resend in ${$}s`:`Resend code`})]})]}),I&&(0,O.jsx)(b,{color:`bad`,radius:`md`,children:I}),we?(0,O.jsx)(p,{type:`submit`,size:`md`,radius:`md`,mt:4,loading:M,disabled:M||T.length<6,rightSection:(0,O.jsx)(B,{size:17,weight:`bold`}),children:`Verify code`}):(0,O.jsx)(p,{type:`submit`,size:`md`,radius:`md`,mt:4,loading:M,disabled:!r||!r.setup_required&&!r.smtp_configured,leftSection:r?.setup_required?(0,O.jsx)(pe,{size:17,weight:`bold`}):void 0,rightSection:r?.setup_required?void 0:(0,O.jsx)(B,{size:17,weight:`bold`}),children:r?.setup_required?`Create admin`:`Send code`})]})})]})})}export{K as a,A as c,ce as d,C as f,G as i,E as l,J as n,H as o,w as p,Y as r,P as s,$ as t,T as u}; \ No newline at end of file diff --git a/internal/ui/dist/assets/auth-DQIRmg9h.js b/internal/ui/dist/assets/auth-DQIRmg9h.js deleted file mode 100644 index 3f3c12ba1..000000000 --- a/internal/ui/dist/assets/auth-DQIRmg9h.js +++ /dev/null @@ -1 +0,0 @@ -import{A as e,C as t,K as n,M as r,Q as i,St as a,T as o,X as s,_ as c,_t as l,a as u,c as d,ct as f,d as p,f as m,h,ht as g,i as ee,j as _,l as te,m as v,o as y,p as b,r as ne,t as x,tt as re,u as ie,x as ae,y as oe,yt as se}from"./brand-B8x2UvAx.js";var S=a(se(),1),C=S.use,w=S.useLayoutEffect;function ce(e){let t=g();return S.useCallback(n=>t.navigate({...n,from:n.from??e?.from}),[e?.from,t])}function T(e){let t=g(),n=ce(),r=S.useRef(null);return w(()=>{r.current!==e&&(n(e),r.current=e)},[t,e,n]),null}function E({value:e,defaultValue:t,finalValue:n,onChange:r=()=>{}}){let[i,a]=(0,S.useState)(t===void 0?n:t);return e===void 0?[i,(e,...t)=>{a(e),r?.(e,...t)},!1]:[e,r,!0]}var D={root:`m_b183c0a2`},O=l(),k=s((e,{color:t})=>({root:{"--code-bg":t?n(t,e):void 0}})),A=o(n=>{let i=r(`Code`,null,n),{classNames:a,className:o,style:s,styles:c,unstyled:l,vars:u,color:d,block:f,mod:p,attributes:m,...h}=i,g=e({name:`Code`,props:i,classes:D,className:o,style:s,classNames:a,styles:c,unstyled:l,attributes:m,vars:u,varsResolver:k});return(0,O.jsx)(t,{component:f?`pre`:`code`,mod:[{block:f},p],...g(`root`),...h,dir:`ltr`})});A.classes=D,A.varsResolver=k,A.displayName=`@mantine/core/Code`;function j(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":f(t??`sm`,`pin-input-size`)}})),N=o(t=>{let{name:n,form:a,className:o,value:s,defaultValue:l,variant:u,gap:d,style:f,size:p,classNames:m,styles:g,unstyled:ee,length:te,onChange:v,onComplete:y,manageFocus:b,autoFocus:ne,error:x,success:ie,radius:ae,disabled:oe,oneTimeCode:se,placeholder:C,type:w,mask:ce,readOnly:T,inputType:D,inputMode:k,ariaLabel:A,vars:N,id:P,hiddenInputProps:F,rootRef:I,getInputProps:L,attributes:R,ref:fe,...z}=r([`Input`,`PinInput`],de,t),B=re(P),V=e({name:`PinInput`,classes:le,props:t,className:o,style:f,classNames:m,styles:g,unstyled:ee,attributes:R,vars:N,varsResolver:M}),{resolvedClassNames:pe,resolvedStyles:H}=_({classNames:m,styles:g,props:t}),[me,he]=(0,S.useState)(-1),U=(0,S.useRef)([]),W=te??4,G=(0,S.useRef)(!1),[K,q]=E({value:s===void 0?void 0:j(W,s),defaultValue:l?.split(``).slice(0,W),finalValue:j(W,``),onChange:e=>{let t=e.join(``).trim();v?.(t),t.length===W&&!G.current?(G.current=!0,y?.(t)):t.length(w instanceof RegExp?w:w&&w in ue?ue[w]:null)?.test(e),X=(e,t)=>{if(b){if(e===`next`){let e=t+1;e=0&&U.current[e]?.focus()}}},Z=(e,t)=>{let n=[...J];return n[t]=e,q(n),n},Q=(e,t)=>{let n=e.target.value;if(n.length>1){if(n.length>2){if(Y(n)){q(j(W,n));let e=Math.min(n.length,W);e{let{ctrlKey:n,metaKey:r,key:i,shiftKey:a,target:o}=e,s=o.value;if(k===`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&&b&&(e.preventDefault(),X(`prev`,t));break;case` `:e.preventDefault(),X(`next`,t);break;case`Delete`:e.preventDefault(),Z(``,t);break;case`Backspace`:s===``?(e.preventDefault(),X(`prev`,t)):(Z(``,t),t0&&i===J[t]&&(e.preventDefault(),X(`next`,t))}},ve=(e,t)=>{e.target.select(),he(t)},$=()=>{he(-1)},ye=e=>{e.preventDefault();let t=e.clipboardData.getData(`text/plain`).replace(/[\n\r\s]+/g,``);if(Y(t.trim())){let e=j(W,t);q(e);let n=e.filter(e=>e!==``).length;n>=W?U.current[W-1]?.focus():U.current[n]?.focus()}};return(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)(c,{...z,...V(`root`),ref:I,role:`group`,id:B,gap:d,unstyled:ee,wrap:`nowrap`,variant:u,__size:p,dir:`ltr`,children:J.map((e,t)=>(0,S.createElement)(h,{component:`input`,...V(`pinInput`,{style:{"--input-padding":`0`,"--input-text-align":`center`}}),classNames:pe,styles:H,size:p,__staticSelector:`PinInput`,id:`${B}-${t+1}`,key:`${B}-${t}`,inputMode:k||(w===`number`?`numeric`:`text`),onChange:e=>Q(e,t),onKeyDown:e=>_e(e,t),onFocus:e=>ve(e,t),onBlur:$,onPaste:ye,type:D||(ce?`password`:w===`number`?`tel`:`text`),radius:ae,error:x,success:ie,variant:u,disabled:oe,ref:e=>{e&&(t===0&&i(fe,e),U.current[t]=e)},autoComplete:se?`one-time-code`:`off`,placeholder:me===t?``:C,value:e,autoFocus:ne&&t===0,unstyled:ee,"aria-label":A,readOnly:T,...L?.(t)}))}),(0,O.jsx)(`input`,{type:`hidden`,name:n,form:a,value:ge,...F})]})});N.classes={...le,...v.classes},N.varsResolver=M,N.displayName=`@mantine/core/PinInput`;var P=o(e=>{let t=r([`Input`,`InputWrapper`,`TextInput`],null,e);return(0,O.jsx)(v,{component:`input`,...t,__staticSelector:`TextInput`})});P.classes=v.classes,P.displayName=`@mantine/core/TextInput`;var F=new Map([[`bold`,S.createElement(S.Fragment,null,S.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`,S.createElement(S.Fragment,null,S.createElement(`path`,{d:`M112,56V200L40,128Z`,opacity:`0.2`}),S.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`,S.createElement(S.Fragment,null,S.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`,S.createElement(S.Fragment,null,S.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`,S.createElement(S.Fragment,null,S.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`,S.createElement(S.Fragment,null,S.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`}))]]),I=new Map([[`bold`,S.createElement(S.Fragment,null,S.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`,S.createElement(S.Fragment,null,S.createElement(`path`,{d:`M216,128l-72,72V56Z`,opacity:`0.2`}),S.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`,S.createElement(S.Fragment,null,S.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`,S.createElement(S.Fragment,null,S.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`,S.createElement(S.Fragment,null,S.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`,S.createElement(S.Fragment,null,S.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`}))]]),L=new Map([[`bold`,S.createElement(S.Fragment,null,S.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`,S.createElement(S.Fragment,null,S.createElement(`path`,{d:`M168,100a60,60,0,1,1-60-60A60,60,0,0,1,168,100Z`,opacity:`0.2`}),S.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`,S.createElement(S.Fragment,null,S.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`,S.createElement(S.Fragment,null,S.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`,S.createElement(S.Fragment,null,S.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`,S.createElement(S.Fragment,null,S.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`}))]]),R=S.forwardRef((e,t)=>S.createElement(u,{ref:t,...e,weights:F}));R.displayName=`ArrowLeftIcon`;var fe=R,z=S.forwardRef((e,t)=>S.createElement(u,{ref:t,...e,weights:I}));z.displayName=`ArrowRightIcon`;var B=z,V=S.forwardRef((e,t)=>S.createElement(u,{ref:t,...e,weights:L}));V.displayName=`UserPlusIcon`;var pe=V,H=class extends Error{status;problems;constructor(e,t,n=[]){super(e),this.status=t,this.problems=n}},me=`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 U(e){return!e||typeof e!=`object`||!(`id`in e)||typeof e.id!=`string`||e.id===``?`none`:`user`}function W(){window.dispatchEvent(new Event(me))}async function G(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&&W(),r.status===403){let e=await r.clone().json().catch(()=>({}));throw new H(e.message??e.error??`You do not have permission to perform this action.`,r.status)}return r}async function K(){let e=await G(`/api/auth/logout`,{method:`POST`});if(!e.ok&&e.status!==401)throw Error(`Sign-out failed — your session is still active.`);e.status!==401&&W(),window.location.assign(`/`)}var q=(0,S.createContext)(null);function J(){let e=(0,S.useContext)(q);if(!e)throw Error(`Fanout runtime status is unavailable`);return e}var ge=(0,S.createContext)(null);function Y(){let e=(0,S.useContext)(ge);if(!e)throw Error(`Fanout viewer is unavailable`);return e}function X(e){if(!e||typeof e!=`object`)return null;let t=e;return typeof t.id!=`string`||t.id===``||t.status!==`active`&&t.status!==`suspended`?null:{id:t.id,email:typeof t.email==`string`?t.email:``,display_name:typeof t.display_name==`string`?t.display_name:``,status:t.status,role:typeof t.role==`string`?t.role:``}}async function Z(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 Q({children:e,wide:n=!1}){return(0,O.jsx)(t,{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,O.jsx)(ie,{mih:`100dvh`,px:`md`,py:48,children:(0,O.jsx)(te,{size:n?680:480,w:`100%`,children:(0,O.jsx)(ae,{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 _e(){return typeof window>`u`?``:new URLSearchParams(window.location.search).get(`setup_token`)??``}function ve(){return typeof window>`u`?``:new URLSearchParams(window.location.search).get(`login_token`)??``}function $({children:e}){let n=ce(),[r,i]=(0,S.useState)(null),[a,o]=(0,S.useState)(!1),[s,l]=(0,S.useState)(`none`),[u,f]=(0,S.useState)(null),[h,g]=(0,S.useState)(!1),[_,te]=(0,S.useState)(``),[v,re]=(0,S.useState)(``),[ae,se]=(0,S.useState)(_e),[C,w]=(0,S.useState)(ve),[T,E]=(0,S.useState)(``),[D,k]=(0,S.useState)(!1),[j,le]=(0,S.useState)(0),[ue,de]=(0,S.useState)(()=>Date.now()),[M,F]=(0,S.useState)(!1),[I,L]=(0,S.useState)(``),[R,z]=(0,S.useState)(null),[V,H]=(0,S.useState)(!1),W=(0,S.useRef)(null),G=he(),K=s===`user`;async function J(){let e=await fetch(`/api/auth/me`,{credentials:`same-origin`});if(!e.ok){l(`none`),f(null);return}let t=await e.json().catch(()=>null);l(U(t)),f(X(t))}async function Y(){try{let e=await fetch(`/api/auth/me`,{credentials:`same-origin`});if(!e.ok)return;f(X(await e.json().catch(()=>null)))}catch{}}(0,S.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`),n({href:e.pathname+e.search+e.hash,replace:!0}))},[n]),(0,S.useEffect)(()=>{Z(`/api/auth/status`).then(i).catch(e=>L(String(e))).finally(()=>o(!0)),J().catch(()=>l(`none`)).finally(()=>g(!0));let e=()=>{l(`none`),f(null)};return window.addEventListener(me,e),()=>window.removeEventListener(me,e)},[]),(0,S.useEffect)(()=>{h&&s===`none`&&C&&(F(!0),L(``),Z(`/api/auth/link/verify`,{token:C}).then(()=>{l(`user`),Y()}).catch(e=>L(e instanceof Error?e.message:String(e))).finally(()=>{w(``),F(!1)}))},[C,h,s]),(0,S.useEffect)(()=>{K&&h&&G&&window.location.replace(G)},[K,G,h]),(0,S.useEffect)(()=>{if(j<=Date.now())return;let e=setInterval(()=>{de(Date.now()),Date.now()>=j&&clearInterval(e)},1e3);return()=>clearInterval(e)},[j]);let $=Math.max(0,Math.ceil((j-ue)/1e3));(0,S.useEffect)(()=>{D&&!M&&I&&W.current?.querySelector(`input`)?.focus()},[M,D,I]);async function ye(e){try{await navigator.clipboard.writeText(e),H(!0)}catch{L(`Clipboard access failed. Select and copy the token manually.`)}}if(R?.ingest_token)return(0,O.jsx)(Q,{wide:!0,children:(0,O.jsxs)(d,{gap:`lg`,children:[(0,O.jsx)(x,{}),(0,O.jsxs)(`div`,{children:[(0,O.jsx)(m,{c:`brand`,fw:700,size:`xs`,tt:`uppercase`,lts:`0.12em`,children:`Setup complete`}),(0,O.jsx)(y,{order:1,mt:`xs`,fz:{base:28,sm:32},lh:1.08,children:`Save your ingest token`})]}),(0,O.jsx)(m,{c:`dimmed`,children:`Fanout shows this token once. Store it with your collector secrets before continuing.`}),(0,O.jsxs)(d,{gap:`xs`,children:[(0,O.jsx)(m,{size:`sm`,fw:600,children:`OTLP endpoint`}),(0,O.jsx)(A,{block:!0,children:R.suggested_endpoint??window.location.origin})]}),(0,O.jsxs)(d,{gap:`xs`,children:[(0,O.jsx)(m,{size:`sm`,fw:600,children:`Header`}),(0,O.jsxs)(A,{block:!0,children:[R.ingest_header_name??`Authorization`,`: Bearer `,R.ingest_token]})]}),I&&(0,O.jsx)(b,{color:`bad`,radius:`md`,children:I}),(0,O.jsxs)(c,{grow:!0,align:`stretch`,children:[(0,O.jsx)(p,{variant:`light`,radius:`md`,leftSection:V?(0,O.jsx)(ee,{size:16,weight:`bold`}):(0,O.jsx)(ne,{size:16}),onClick:()=>void ye(`${R.ingest_header_name??`Authorization`}: Bearer ${R.ingest_token}`),children:V?`Copied`:`Copy header`}),(0,O.jsx)(p,{radius:`md`,rightSection:(0,O.jsx)(B,{size:16,weight:`bold`}),onClick:()=>{l(`user`),z(null),Y()},children:`Continue to Fanout`})]}),(0,O.jsx)(p,{variant:`subtle`,size:`compact-xs`,onClick:()=>void ye(R.ingest_token??``),children:`Copy token only`})]})});if(!h||!a||C)return(0,O.jsx)(ie,{mih:`100dvh`,children:(0,O.jsx)(oe,{size:`sm`})});if(!r)return(0,O.jsx)(Q,{children:(0,O.jsxs)(d,{gap:`lg`,children:[(0,O.jsx)(x,{}),(0,O.jsx)(y,{order:1,children:`Fanout is unavailable`}),(0,O.jsx)(b,{color:`bad`,radius:`md`,children:I||`Authentication status could not be loaded.`})]})});if(K&&G)return null;if(K)return(0,O.jsx)(q.Provider,{value:r,children:(0,O.jsx)(ge.Provider,{value:u??{id:``,email:_,display_name:v,status:`active`,role:``},children:e})});if(r&&!r.setup_required&&r.auth_mode===`oidc`){let e=G?`/api/auth/oidc/start?return_to=${encodeURIComponent(G)}`:`/api/auth/oidc/start`;return(0,O.jsx)(Q,{children:(0,O.jsxs)(d,{gap:28,children:[(0,O.jsx)(x,{}),(0,O.jsxs)(d,{gap:10,children:[(0,O.jsx)(m,{c:`brand`,fw:700,size:`xs`,tt:`uppercase`,lts:`0.12em`,children:`Secure workspace`}),(0,O.jsx)(y,{order:1,fz:{base:28,sm:32},lh:1.08,children:`Sign in`}),(0,O.jsx)(m,{c:`dimmed`,size:`md`,lh:1.6,children:`Use your organization's identity provider to continue.`})]}),I&&(0,O.jsx)(b,{color:`bad`,radius:`md`,children:I}),(0,O.jsx)(p,{component:`a`,href:e,size:`md`,radius:`md`,rightSection:(0,O.jsx)(B,{size:17,weight:`bold`}),children:`Continue with SSO`})]})})}async function be(){F(!0),L(``);try{await Z(`/api/auth/code/send`,{email:_}),k(!0),E(``),le(Date.now()+3e4),de(Date.now())}catch(e){L(e instanceof Error?e.message:String(e))}finally{F(!1)}}async function xe(e){F(!0),L(``);try{await Z(`/api/auth/code/verify`,{email:_,code:e}),l(`user`),k(!1),E(``),le(0),Y()}catch(e){E(``),L(e instanceof Error?e.message:String(e))}finally{F(!1)}}function Se(){k(!1),E(``),L(``)}async function Ce(e){e.preventDefault(),F(!0),L(``);try{if(r?.setup_required){let e=await Z(`/api/auth/setup`,{email:_,display_name:v,setup_token:ae});e.ingest_token?z(e):(l(`user`),Y())}else if(D){await xe(T);return}else{await be();return}}catch(e){L(e instanceof Error?e.message:String(e))}finally{F(!1)}}let we=D&&!r?.setup_required,Te=r?.setup_required?`Create the first admin`:we?`Check your email`:r?.self_signup?`Sign in or create an account`:`Sign in`,Ee=r?.setup_required?`Use the one-time token printed by the Fanout process.`:r?.smtp_configured?we?`We sent a code to ${_}.`:r?.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,O.jsx)(Q,{children:(0,O.jsxs)(d,{gap:28,children:[(0,O.jsx)(x,{}),(0,O.jsxs)(d,{gap:10,children:[(0,O.jsx)(m,{c:`brand`,fw:700,size:`xs`,tt:`uppercase`,lts:`0.12em`,children:r?.setup_required?`One-time setup`:`Secure workspace`}),(0,O.jsx)(y,{order:1,fz:{base:28,sm:32},lh:1.08,children:Te}),Ee&&(0,O.jsx)(m,{c:`dimmed`,size:`md`,lh:1.6,maw:390,children:Ee})]}),(0,O.jsx)(`form`,{onSubmit:Ce,children:(0,O.jsxs)(d,{gap:`md`,children:[(0,O.jsx)(P,{label:`Email`,placeholder:`you@company.com`,type:`email`,required:!0,value:_,onChange:e=>te(e.currentTarget.value),disabled:D,variant:`filled`,radius:`md`,size:`md`,autoFocus:!D}),r?.setup_required&&(0,O.jsx)(P,{label:`Display name`,placeholder:`Your display name`,value:v,onChange:e=>re(e.currentTarget.value),variant:`filled`,radius:`md`,size:`md`}),r?.setup_required&&(0,O.jsx)(P,{label:`Setup token`,placeholder:`from the setup URL printed at startup`,required:!0,value:ae,onChange:e=>se(e.currentTarget.value),autoComplete:`one-time-code`,variant:`filled`,radius:`md`,size:`md`}),we&&(0,O.jsxs)(d,{gap:`xs`,children:[(0,O.jsx)(m,{size:`sm`,fw:600,children:`Verification code`}),(0,O.jsx)(t,{ref:W,children:(0,O.jsx)(N,{length:6,type:`number`,oneTimeCode:!0,autoFocus:!0,value:T,onChange:E,onComplete:e=>void xe(e),disabled:M,error:!!I,size:`md`,radius:`md`,"aria-label":`Verification code`,getInputProps:e=>({"aria-label":`Digit ${e+1}`})})}),(0,O.jsxs)(c,{justify:`space-between`,gap:`xs`,children:[(0,O.jsxs)(m,{c:`dimmed`,size:`xs`,children:[`Sent to `,_]}),(0,O.jsx)(p,{variant:`subtle`,size:`compact-xs`,leftSection:(0,O.jsx)(fe,{size:12,weight:`bold`}),onClick:Se,disabled:M,children:`Change email`})]}),(0,O.jsxs)(c,{justify:`space-between`,gap:`xs`,children:[(0,O.jsx)(m,{c:`dimmed`,size:`xs`,children:`Codes expire in 5 minutes`}),(0,O.jsx)(p,{variant:`subtle`,size:`compact-xs`,onClick:()=>void be(),disabled:M||$>0,children:$>0?`Resend in ${$}s`:`Resend code`})]})]}),I&&(0,O.jsx)(b,{color:`bad`,radius:`md`,children:I}),we?(0,O.jsx)(p,{type:`submit`,size:`md`,radius:`md`,mt:4,loading:M,disabled:M||T.length<6,rightSection:(0,O.jsx)(B,{size:17,weight:`bold`}),children:`Verify code`}):(0,O.jsx)(p,{type:`submit`,size:`md`,radius:`md`,mt:4,loading:M,disabled:!r||!r.setup_required&&!r.smtp_configured,leftSection:r?.setup_required?(0,O.jsx)(pe,{size:17,weight:`bold`}):void 0,rightSection:r?.setup_required?void 0:(0,O.jsx)(B,{size:17,weight:`bold`}),children:r?.setup_required?`Create admin`:`Send code`})]})})]})})}export{K as a,A as c,ce as d,C as f,G as i,E as l,J as n,H as o,w as p,Y as r,P as s,$ as t,T as u}; \ No newline at end of file diff --git a/internal/ui/dist/assets/chat-Bm-gn0Xj.js b/internal/ui/dist/assets/chat-Bm-gn0Xj.js new file mode 100644 index 000000000..b7e74db29 --- /dev/null +++ b/internal/ui/dist/assets/chat-Bm-gn0Xj.js @@ -0,0 +1,2 @@ +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/mcp-app-frame-DmplPDO9.js","assets/brand-B8x2UvAx.js","assets/auth-BBLbNg3S.js","assets/use-computed-color-scheme-DxHBJokx.js","assets/FocusTrap-yuoZ2xkr.js","assets/get-single-element-child-C3yy66_3.js","assets/index-CvasF-jN.js","assets/preload-helper-GZwLLn44.js","assets/theme-CNgJAwSb.js","assets/Tooltip-BP7AB724.js","assets/useQuery-CJpHjMkr.js","assets/index-B905rHdc.css"])))=>i.map(i=>d[i]); +import{A as e,C as t,M as n,S as r,St as i,T as a,_ as o,_t as s,a as c,c as l,d as u,et as d,f,i as p,l as m,m as h,n as g,o as ee,p as _,r as v,u as y,x as b,y as x,yt as S}from"./brand-B8x2UvAx.js";import{c as C,d as w,f as T,g as E,h as D,l as O,o as te,p as k,s as A,t as j}from"./preload-helper-GZwLLn44.js";import{t as M}from"./Tooltip-BP7AB724.js";import{c as N,d as P,l as F,o as I,r as ne,s as re,t as ie,u as ae}from"./dashboard-change-chips-DKUpHHI0.js";var L=i(S(),1),R=s(),oe=[`borderBottomWidth`,`borderLeftWidth`,`borderRightWidth`,`borderTopWidth`,`boxSizing`,`fontFamily`,`fontSize`,`fontStyle`,`fontWeight`,`letterSpacing`,`lineHeight`,`paddingBottom`,`paddingLeft`,`paddingRight`,`paddingTop`,`tabSize`,`textIndent`,`textRendering`,`textTransform`,`width`,`wordBreak`,`wordSpacing`,`scrollbarGutter`],z={"min-height":`0`,"max-height":`none`,height:`0`,visibility:`hidden`,overflow:`hidden`,position:`absolute`,"z-index":`-1000`,top:`0`,right:`0`,display:`block`};function B(e){Object.keys(z).forEach(t=>{e.style.setProperty(t,z[t],`important`)})}function se(e){let t=window.getComputedStyle(e);if(t===null)return null;let n={};for(let e of oe)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 V=null;function ce(e,t,n=1,r=1/0){V||(V=document.createElement(`textarea`),V.setAttribute(`tabindex`,`-1`),V.setAttribute(`aria-hidden`,`true`),V.setAttribute(`aria-label`,`autosize measurement`),B(V)),V.parentNode===null&&document.body.appendChild(V);let{paddingSize:i,borderSize:a,sizingStyle:o}=e,{boxSizing:s}=o;Object.keys(o).forEach(e=>{V.style[e]=o[e]}),B(V),V.value=t;let c=s===`border-box`?V.scrollHeight+a:V.scrollHeight-i;V.value=t,c=s===`border-box`?V.scrollHeight+a:V.scrollHeight-i,V.value=`x`;let l=V.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 le({maxRows:e,minRows:t,onChange:n,ref:r,...i}){let a=i.value!==void 0,o=(0,L.useRef)(null),s=d(o,r),c=(0,L.useRef)(0),l=(0,L.useRef)(0),u=()=>{let n=o.current;if(!n)return;let r=se(n);if(!r)return;let[i]=ce(r,n.value||n.placeholder||`x`,t,e);c.current!==i&&(c.current=i,n.style.setProperty(`height`,`${i}px`,`important`))},f=(0,L.useEffectEvent)(u),p=e=>{a||u(),n?.(e)};return(0,L.useLayoutEffect)(u),(0,L.useEffect)(()=>{let e=()=>u();return window.addEventListener(`resize`,e),()=>window.removeEventListener(`resize`,e)},[]),(0,L.useEffect)(()=>{let e=o.current;if(!e||typeof ResizeObserver>`u`)return;l.current=e.offsetWidth;let t=0,n=new ResizeObserver(()=>{o.current&&o.current.offsetWidth!==l.current&&(l.current=o.current.offsetWidth,cancelAnimationFrame(t),t=requestAnimationFrame(f))});return n.observe(e),()=>{cancelAnimationFrame(t),n.disconnect()}},[]),(0,L.useEffect)(()=>{let e=()=>u();return document.fonts.addEventListener(`loadingdone`,e),()=>document.fonts.removeEventListener(`loadingdone`,e)},[]),(0,L.useEffect)(()=>{let e=e=>{if(o.current?.form===e.target&&!a){let e=o.current.value;requestAnimationFrame(()=>{o.current&&e!==o.current.value&&u()})}};return document.body.addEventListener(`reset`,e),()=>document.body.removeEventListener(`reset`,e)},[a]),(0,R.jsx)(`textarea`,{rows:t,...i,onChange:p,ref:s})}var H=a(e=>{let{autosize:t,maxRows:r,minRows:i,__staticSelector:a,resize:o,bottomSection:s,bottomSectionProps:c,...l}=n([`Input`,`InputWrapper`,`Textarea`],null,e),u=t&&P()!==`test`,d=u?{maxRows:r,minRows:i}:{};return(0,R.jsx)(h,{component:u?le:`textarea`,...l,__staticSelector:a||`Textarea`,__bottomSection:s,__bottomSectionProps:c,multiline:!0,"data-no-overflow":t&&r===void 0||void 0,__vars:{"--input-resize":o},...d})});H.classes=h.classes,H.displayName=`@mantine/core/Textarea`;var U={root:`m_d08caa0`},W=a(r=>{let i=n(`Typography`,null,r),{classNames:a,className:o,style:s,styles:c,unstyled:l,attributes:u,...d}=i,f=e({name:`Typography`,classes:U,props:i,className:o,style:s,classNames:a,styles:c,unstyled:l,attributes:u});return(0,R.jsx)(t,{...f(`root`),...d})});W.classes=U,W.displayName=`@mantine/core/Typography`;var ue=new Map([[`bold`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M184.49,136.49l-80,80a12,12,0,0,1-17-17L159,128,87.51,56.49a12,12,0,1,1,17-17l80,80A12,12,0,0,1,184.49,136.49Z`}))],[`duotone`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M176,128,96,208V48Z`,opacity:`0.2`}),L.createElement(`path`,{d:`M181.66,122.34l-80-80A8,8,0,0,0,88,48V208a8,8,0,0,0,13.66,5.66l80-80A8,8,0,0,0,181.66,122.34ZM104,188.69V67.31L164.69,128Z`}))],[`fill`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M181.66,133.66l-80,80A8,8,0,0,1,88,208V48a8,8,0,0,1,13.66-5.66l80,80A8,8,0,0,1,181.66,133.66Z`}))],[`light`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M180.24,132.24l-80,80a6,6,0,0,1-8.48-8.48L167.51,128,91.76,52.24a6,6,0,0,1,8.48-8.48l80,80A6,6,0,0,1,180.24,132.24Z`}))],[`regular`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M181.66,133.66l-80,80a8,8,0,0,1-11.32-11.32L164.69,128,90.34,53.66a8,8,0,0,1,11.32-11.32l80,80A8,8,0,0,1,181.66,133.66Z`}))],[`thin`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M178.83,130.83l-80,80a4,4,0,0,1-5.66-5.66L170.34,128,93.17,50.83a4,4,0,0,1,5.66-5.66l80,80A4,4,0,0,1,178.83,130.83Z`}))]]),de=new Map([[`bold`,L.createElement(L.Fragment,null,L.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`,L.createElement(L.Fragment,null,L.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`}),L.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`,L.createElement(L.Fragment,null,L.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`,L.createElement(L.Fragment,null,L.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`,L.createElement(L.Fragment,null,L.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`,L.createElement(L.Fragment,null,L.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`}))]]),fe=new Map([[`bold`,L.createElement(L.Fragment,null,L.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`,L.createElement(L.Fragment,null,L.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`}),L.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`,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`}))],[`light`,L.createElement(L.Fragment,null,L.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`,L.createElement(L.Fragment,null,L.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`,L.createElement(L.Fragment,null,L.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`}))]]),G=L.forwardRef((e,t)=>L.createElement(c,{ref:t,...e,weights:ue}));G.displayName=`CaretRightIcon`;var K=G,q=L.forwardRef((e,t)=>L.createElement(c,{ref:t,...e,weights:de}));q.displayName=`PaperPlaneTiltIcon`;var pe=q,J=L.forwardRef((e,t)=>L.createElement(c,{ref:t,...e,weights:fe}));J.displayName=`StopIcon`;var me=J;function he(e){return e.dashboard.panels.length===1?e.dashboard.panels[0].title:e.dashboard.name}function ge(e){if(!e||typeof e!=`object`||Array.isArray(e))throw Error(`Missing panel view`);let t=e;if(!t.view||![`preset`,`query`].includes(t.view.kind)||!/^[a-f0-9]{64}$/.test(t.view.key))throw Error(`Invalid panel view identity`);if(t.dashboard?.version!==1||!Array.isArray(t.dashboard.panels)||!t.dashboard.panels.length||t.dashboard.panels.length>40||!Array.isArray(t.results)||t.dashboard.panels.some(e=>!e||typeof e.id!=`string`||!e.id)||t.results.some(e=>!e||typeof e.id!=`string`))throw Error(`Invalid panel view`);let n=new Set(t.dashboard.panels.map(e=>e.id));if(n.size!==t.dashboard.panels.length||t.results.length!==n.size||new Set(t.results.map(e=>e.id)).size!==n.size||t.results.some(e=>!n.has(e.id)||![`ok`,`empty`,`error`].includes(e.status)))throw Error(`Panel results do not match the view`);if(t.vars!==void 0&&(!t.vars||typeof t.vars!=`object`||Array.isArray(t.vars)||Object.values(t.vars).some(e=>typeof e!=`string`&&!(Array.isArray(e)&&e.every(e=>typeof e==`string`)))))throw Error(`Invalid panel variables`);if(t.trace!==void 0&&(!t.trace?.data||!Array.isArray(t.trace.data.spans)||!Array.isArray(t.trace.data.logs)||!Array.isArray(t.trace.data.services)))throw Error(`Invalid trace detail`);return t}var Y=new WeakSet;function X(e){if(!e||typeof e!=`object`||Array.isArray(e))return;if(Y.has(e))return e;let t=e;if(Object.keys(t).sort().join(`,`)===`is_error,resource_uri,tool_input,tool_name,tool_result`&&t.resource_uri===`ui://fanout/panels.html`&&typeof t.tool_name==`string`&&t.tool_name&&typeof t.is_error==`boolean`&&t.tool_input&&typeof t.tool_input==`object`&&!Array.isArray(t.tool_input)){try{ge(t.tool_result)}catch{return}return Y.add(t),t}}var _e=64,ve=300;function ye(){let e=(0,L.useRef)(null),t=(0,L.useRef)(!0),n=(0,L.useRef)(()=>{}),r=(0,L.useRef)(null),i=(0,L.useRef)(null),a=(0,L.useCallback)(()=>{let t=e.current;if(!t)return;let n=t.getBoundingClientRect().top,r=[...t.querySelectorAll(`[data-chat-anchor]`)].find(e=>e.getBoundingClientRect().bottom>n);i.current=r?{node:r,top:r.getBoundingClientRect().top}:null},[]),o=(0,L.useCallback)(()=>{let n=e.current;n&&t.current?n.scrollTop=n.scrollHeight:n&&i.current?.node.isConnected&&(n.scrollTop+=i.current.node.getBoundingClientRect().top-i.current.top),a()},[a]);return{scrollRef:(0,L.useCallback)(r=>{if(n.current(),e.current=r,!r)return;let o=0,s=!1,c=()=>{o=Date.now()},l=()=>{s=!0},u=()=>{s=!1},d=()=>{r.scrollHeight-r.clientHeight-r.scrollTop<=_e?t.current=!0:(s||Date.now()-o{r.removeEventListener(`scroll`,d),r.removeEventListener(`wheel`,c),r.removeEventListener(`touchmove`,c),r.removeEventListener(`keydown`,c),r.removeEventListener(`pointerdown`,l),window.removeEventListener(`pointerup`,u),n.current=()=>{}},t.current=!0,r.scrollTop=r.scrollHeight,i.current=null},[a]),contentRef:(0,L.useCallback)(e=>{r.current?.disconnect(),r.current=null,e&&(r.current=new ResizeObserver(o),r.current.observe(e))},[o]),toBottom:(0,L.useCallback)(()=>{t.current=!0,o()},[o])}}function be(e=1500){let[t,n]=(0,L.useState)(`idle`),r=(0,L.useRef)(null);(0,L.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}}var xe={schema:`Telemetry`,context:`Context`,draft:`Draft`,validation:`Validation`,preview:`Preview`,save:`Save`},Z=e=>`${(e/1e3).toFixed(1)} s`;function Se({receipt:e,running:t=!1,activity:n=``,awaitingAnswer:r=!1}){let[i,a]=(0,L.useState)(!1),s=(0,L.useId)(),c=e.saved,d=c?.receipt.save_check,p=Object.values(e.stages).filter(e=>e.state===`complete`).length,m=[e.stages.schema.state===`complete`?`Read telemetry`:void 0,e.panel_count===void 0?void 0:`${e.panel_count} ${e.panel_count===1?`panel`:`panels`}`,d?.checked?`Checked in ${Z(d.elapsed_ms)}`:void 0,c?`Saved v${c.version}`:void 0].filter(Boolean).join(` · `)||`Building dashboard`,h=[...c?C(c.receipt):[],...e.corrections.map(e=>`Fixed ${e.panel_id}.${e.path.replace(/^panels\[\d+\]\./,``)}`)];return(0,R.jsx)(b,{"data-build-receipt":e.turn_id,"data-dashboard-result":c?.id,"data-chat-anchor":!0,withBorder:!0,radius:`md`,p:`sm`,children:(0,R.jsxs)(l,{gap:6,children:[(0,R.jsxs)(o,{gap:`xs`,justify:`space-between`,children:[(0,R.jsxs)(f,{size:`sm`,role:`status`,"aria-live":`polite`,"aria-atomic":`true`,children:[m,(0,R.jsxs)(f,{span:!0,c:`dimmed`,size:`xs`,children:[` · `,p,` stages complete`]})]}),(0,R.jsxs)(u,{component:`button`,variant:`subtle`,color:`gray`,size:`compact-xs`,"aria-expanded":i,"aria-controls":s,onClick:()=>a(e=>!e),children:[`Details`,h.length>4?` (+${h.length-4})`:``]})]}),t&&r&&(0,R.jsxs)(o,{gap:`xs`,"data-build-running":!0,children:[(0,R.jsx)(x,{type:`dots`,size:`sm`}),(0,R.jsx)(f,{c:`dimmed`,size:`sm`,children:n||`Analyzing your system`})]}),(0,R.jsx)(ie,{labels:h.slice(0,4)}),e.explanations.map(e=>t?e.split(` · `).filter(e=>!e.endsWith(`: incomplete`)).join(` · `):e).filter(Boolean).map((e,t)=>(0,R.jsx)(f,{size:`xs`,c:`dimmed`,"data-receipt-attention":!0,children:e},t)),c&&(0,R.jsx)(u,{renderRoot:e=>(0,R.jsx)(E,{...e,to:`/dashboards/$dashboardId`,params:{dashboardId:c.id},search:{}}),variant:`subtle`,size:`compact-sm`,color:`gray`,style:{alignSelf:`flex-start`},children:`Open dashboard`}),(0,R.jsx)(ae,{expanded:i,id:s,children:(0,R.jsxs)(l,{gap:4,children:[c&&(0,R.jsxs)(f,{size:`xs`,children:[c.label,` `,c.name,` · opens the current dashboard`]}),Object.entries(e.stages).map(([e,n])=>(0,R.jsxs)(f,{size:`xs`,c:`dimmed`,children:[xe[e],`: `,t&&n.state===`incomplete`?`in progress`:n.state,n.elapsed_ms===void 0?``:` · ${Z(n.elapsed_ms)}`]},e)),e.save_attempts.map((e,t)=>e.state===`retried`&&(0,R.jsxs)(f,{size:`xs`,c:`dimmed`,children:[`Save attempt `,t+1,`: retried`]},e.call_id)),!!e.context_counts.deploys&&(0,R.jsxs)(f,{size:`xs`,children:[e.context_counts.deploys,` deploys observed`]}),!!e.context_counts.anomalies&&(0,R.jsxs)(f,{size:`xs`,children:[e.context_counts.anomalies,` anomalies observed`]}),e.panels.map(e=>(0,R.jsxs)(f,{size:`xs`,children:[`Preview · `,e.id,`: `,e.status,e.elapsed_ms===void 0?``:` · ${Z(e.elapsed_ms)}`]},e.id)),d&&(0,R.jsxs)(f,{size:`xs`,children:[`Save check: `,d.checked?`checked`:`incomplete`,` · `,Z(d.elapsed_ms)]}),d?.panels.map(e=>(0,R.jsxs)(f,{size:`xs`,children:[`Save · `,e.id,`: `,e.status,` · `,e.rows??0,` rows`,e.elapsed_ms===void 0?``:` · ${Z(e.elapsed_ms)}`]},e.id)),h.slice(4).map((e,t)=>(0,R.jsx)(f,{size:`xs`,children:e},t)),e.corrections.map((e,t)=>(0,R.jsxs)(f,{size:`xs`,children:[`Fixed `,e.panel_id,`.`,e.path,`: `,e.message]},t))]})})]})})}var Ce=(0,L.lazy)(()=>j(()=>import(`./mcp-app-frame-DmplPDO9.js`),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11]))),Q=e=>e.tool_result.view.kind===`preset`;function we(e){let t=new Map,n=new Set,r=[],i=()=>{let e=new Map;for(let t of r){let n=t.content.tool_result.view.key;e.set(n,t)}let i=new Set([...e.values()].map(e=>e.id)),a=[...e.values()].some(e=>Q(e.content)),o=r.filter(e=>i.has(e.id)).at(-1)?.id;for(let e of r)i.has(e.id)?t.set(e.id,{content:e.content,expanded:Q(e.content)||!a&&e.id===o}):n.add(e.id);r=[]};for(let t of e)if(t.role===`user`&&i(),t.role===`activity`&&t.activityType===`mcp-app`){let e=X(t.content);e&&r.push({id:t.id,content:e})}return i(),{views:t,duplicates:n}}function Te(e){let t=new Map,n=new Map,r=new Map,i=`unattributed`;for(let a of e){if(a.role===`user`&&(n.clear(),r.clear(),i=a.id),a.role===`assistant`){i=a.id;for(let e of a.toolCalls??[])n.set(e.id,{assistant:i,name:e.function.name})}if(a.role===`tool`){let e=w(a.content);if(!a.error&&!e?.error&&e?.isError!==!0)continue;let o=n.get(a.toolCallId);if(o&&T.has(o.name)&&O(a))continue;let s=o?.assistant??i,c=r.get(s)??a.id;r.set(s,c);let l=t.get(c)??[],u=k(e?.error)?e?.error:void 0,d=typeof u?.message==`string`?u.message:typeof a.error==`string`&&a.error?a.error:`Tool execution failed`;l.push({name:o?.name??`Tool`,message:d,readOnly:u?.code===`answer_only`}),t.set(c,l)}}return t}function Ee({failures:e}){let[n,i]=(0,L.useState)(!1),a=e.filter(e=>!e.readOnly);return(0,R.jsxs)(t,{"data-chat-anchor":!0,children:[e.some(e=>e.readOnly)&&(0,R.jsx)(f,{size:`sm`,c:`dimmed`,children:`Not saved: Explain is read-only`}),a.length>0&&(0,R.jsxs)(R.Fragment,{children:[(0,R.jsxs)(r,{className:`chat-app-toggle`,"aria-expanded":n,onClick:()=>i(e=>!e),style:{color:`var(--mantine-color-dimmed)`},children:[(0,R.jsx)(`span`,{className:`chat-app-chevron`,"aria-hidden":`true`,children:n?(0,R.jsx)(N,{size:14}):(0,R.jsx)(K,{size:14})}),(0,R.jsxs)(`span`,{className:`chat-app-summary`,children:[a.length,` tool `,a.length===1?`call`:`calls`,` failed`]})]}),n&&(0,R.jsx)(l,{gap:`xs`,pl:`md`,children:a.map((e,t)=>(0,R.jsxs)(f,{size:`sm`,c:`dimmed`,style:{whiteSpace:`pre-wrap`,overflowWrap:`anywhere`},children:[e.name,`: `,e.message]},t))})]})]})}function De({view:e}){let[t,n]=(0,L.useState)(e.expanded);(0,L.useEffect)(()=>n(e.expanded),[e.expanded]);let i=e.content.tool_result,a=he(i),o=[...new Set(i.dashboard.panels.map(e=>e.viz===`timeseries`?`time series`:e.viz.replaceAll(`_`,` `)))].join(`, `),s=i.results.reduce((e,t)=>e+(t.frame?.rows??0),0),c=new Map;for(let e of i.results)e.status!==`ok`&&c.set(e.status,(c.get(e.status)??0)+1);let l=i.dashboard.panels.length>1?[`${i.dashboard.panels.length} panels`,...Array.from(c,([e,t])=>`${t} ${e}`)].join(` · `):c.size?[...c.keys()].join(`, `):`${s} ${s===1?`row`:`rows`}`;return(0,R.jsxs)(b,{"data-chat-app":!0,"data-chat-anchor":!0,withBorder:!0,radius:`lg`,style:{overflow:`hidden`},children:[(0,R.jsxs)(r,{className:`chat-app-toggle`,"aria-expanded":t,onClick:()=>n(e=>!e),children:[(0,R.jsx)(`span`,{className:`chat-app-chevron`,"aria-hidden":`true`,children:t?(0,R.jsx)(N,{size:14}):(0,R.jsx)(K,{size:14})}),(0,R.jsxs)(`span`,{className:`chat-app-summary`,children:[a,` · `,o,` · `,l]})]}),t&&(0,R.jsx)(L.Suspense,{fallback:(0,R.jsx)(y,{mih:180,children:(0,R.jsx)(x,{size:`sm`})}),children:(0,R.jsx)(Ce,{content:e.content})})]})}var Oe=[`Summarize system health for the last hour`,`Find the source of elevated errors`,`Map the current service dependencies`,`Show the slowest endpoints`];function ke(){let{agentAvailable:e,messages:n,messageTimes:r,ready:i,running:a,activity:s,provisional:c,stopped:d,error:p,threadMissing:h,send:g,retry:v,reloadThread:S,newThread:C}=A(),{scrollRef:w,contentRef:T,toBottom:E}=ye(),D=te(n),O=n.filter(e=>e.role===`user`).at(-1)?.id;if((0,L.useEffect)(()=>{O&&E()},[O,E]),!e)return(0,R.jsx)(m,{size:`sm`,py:96,children:(0,R.jsx)(b,{withBorder:!0,radius:`lg`,p:{base:`xl`,sm:40},children:(0,R.jsxs)(l,{gap:`md`,children:[(0,R.jsx)(f,{c:`brand`,fw:700,size:`xs`,tt:`uppercase`,lts:`0.12em`,children:`Optional capability`}),(0,R.jsx)(ee,{order:1,fz:28,children:`Chat is not configured`}),(0,R.jsx)(f,{c:`dimmed`,children:`Add an AI provider key to enable chat. Telemetry ingest, dashboards, traces, logs, and metrics remain available without it.`}),(0,R.jsx)(u,{component:`a`,href:`/dashboards`,variant:`light`,mt:`sm`,children:`Open dashboards`})]})})});let k=we(n),j=Te(n),M=n.filter(e=>k.duplicates.has(e.id)?!1:e.role===`tool`?j.has(e.id):e.role===`assistant`?!e.toolCalls?.length&&typeof e.content==`string`&&e.content.trim().length>0:e.role===`activity`?e.activityType===`mcp-app`||e.activityType===`agent-outcome`:e.role===`user`),N=n.findIndex(e=>e.id===O),P=n.slice(N+1).some(e=>e.role===`assistant`&&!e.toolCalls?.length&&typeof e.content==`string`&&e.content.length>0),F=n.slice(N+1).filter(e=>e.role===`assistant`&&!e.toolCalls?.length&&typeof e.content==`string`&&e.content.trim().length>0).at(-1),I=a&&c&&!c.collapsed&&c.text&&!P;return(0,R.jsxs)(t,{className:`chat-pane`,children:[(0,R.jsx)(t,{className:`chat-scroll`,ref:w,tabIndex:0,role:`log`,"aria-label":`Conversation`,children:(0,R.jsxs)(m,{size:880,px:{base:`md`,sm:`xl`},py:`lg`,ref:T,children:[h&&(0,R.jsx)(_,{color:`warn`,radius:`lg`,title:`This chat no longer exists`,children:(0,R.jsxs)(o,{justify:`space-between`,children:[(0,R.jsx)(f,{size:`sm`,children:`It was deleted, or the link is wrong.`}),(0,R.jsx)(u,{size:`compact-sm`,variant:`light`,onClick:C,children:`New chat`})]})}),!h&&!i&&p&&(0,R.jsx)(Ae,{message:p,onRetry:S,onNewThread:C}),!h&&!i&&!p&&(0,R.jsxs)(y,{mih:`40vh`,children:[(0,R.jsx)(x,{size:`sm`}),(0,R.jsx)(f,{c:`dimmed`,size:`sm`,ml:`sm`,children:`Loading chat`})]}),!h&&i&&(0,R.jsxs)(R.Fragment,{children:[M.length===0&&(0,R.jsx)(Me,{onSelect:g}),(0,R.jsxs)(l,{gap:`lg`,children:[M.filter(e=>e.id!==F?.id).map(e=>j.has(e.id)?(0,R.jsx)(Ee,{failures:j.get(e.id)},e.id):(0,R.jsxs)(t,{children:[(0,R.jsx)(Ne,{message:e,time:r[e.id],appView:k.views.get(e.id)}),D.has(e.id)&&(0,R.jsx)(t,{mt:`sm`,children:(0,R.jsx)(Se,{receipt:D.get(e.id),running:a&&e.id===O,awaitingAnswer:!P&&!I,activity:s})})]},e.id)),(F||I)&&(0,R.jsx)(t,{"data-answer-position":!0,children:(0,R.jsx)(Ne,{message:I?{id:c.id,role:`assistant`,content:c.text}:F,provisional:!!I,time:I?void 0:r[F.id]})},`answer-${O??`draft`}`),a&&!P&&!I&&!D.has(O??``)&&(0,R.jsxs)(o,{gap:`xs`,role:`status`,children:[(0,R.jsx)(x,{type:`dots`,size:`sm`}),(0,R.jsx)(f,{c:`dimmed`,size:`sm`,children:s||`Analyzing your system`})]}),d&&(0,R.jsx)(f,{c:`dimmed`,size:`sm`,children:`Stopped`}),p&&(0,R.jsx)(Ae,{message:p,onRetry:v})]})]})]})}),!h&&(0,R.jsx)(je,{})]})}function Ae({message:e,onRetry:t,onNewThread:n}){return(0,R.jsx)(_,{color:`bad`,radius:`lg`,title:`Something went wrong`,children:(0,R.jsxs)(o,{justify:`space-between`,gap:`sm`,wrap:`nowrap`,children:[(0,R.jsx)(f,{size:`sm`,children:e}),(0,R.jsxs)(o,{gap:`xs`,wrap:`nowrap`,children:[n&&(0,R.jsx)(u,{size:`compact-sm`,variant:`subtle`,color:`bad`,onClick:n,children:`New chat`}),(0,R.jsx)(u,{size:`compact-sm`,variant:`light`,color:`bad`,onClick:t,children:`Retry`})]})]})})}function je(){let{input:e,setInput:n,inputRef:r,submit:i,send:a,stop:s,ready:c,running:l}=A();return(0,R.jsx)(t,{className:`chat-composer`,children:(0,R.jsxs)(m,{size:880,px:{base:`md`,sm:`xl`},children:[(0,R.jsx)(b,{component:`form`,onSubmit:i,className:`chat-composer-field`,withBorder:!0,radius:24,py:6,pl:`lg`,pr:6,children:(0,R.jsxs)(o,{align:`flex-end`,gap:`xs`,wrap:`nowrap`,children:[(0,R.jsx)(H,{ref:r,"aria-label":`Message Fanout`,value:e,onChange:e=>n(e.currentTarget.value),onKeyDown:t=>{t.key===`Enter`&&!t.shiftKey&&(t.preventDefault(),a(e))},placeholder:l?`Fanout is working…`:`Ask about health, errors, or latency…`,disabled:!c,autosize:!0,minRows:1,maxRows:8,variant:`unstyled`,flex:1}),l?(0,R.jsx)(M,{label:`Stop`,children:(0,R.jsx)(D,{type:`button`,variant:`default`,size:40,radius:`xl`,"aria-label":`Stop`,onClick:s,children:(0,R.jsx)(me,{size:16,weight:`fill`})})}):(0,R.jsx)(D,{type:`submit`,variant:`filled`,size:40,radius:`xl`,disabled:!e.trim()||!c,"aria-label":`Send message`,children:(0,R.jsx)(pe,{size:17,weight:`fill`})})]})}),(0,R.jsx)(f,{c:`dimmed`,size:`xs`,ta:`center`,mt:6,children:`Enter to send, Shift+Enter for a new line`})]})})}function Me({onSelect:e}){return(0,R.jsxs)(l,{align:`center`,gap:`md`,pt:{base:32,sm:88},pb:`xl`,ta:`center`,children:[(0,R.jsx)(g,{size:`large`}),(0,R.jsx)(ee,{order:1,fz:24,fw:500,lh:1.25,maw:560,children:`What do you want to know about your system?`}),(0,R.jsx)(o,{justify:`center`,gap:`xs`,mt:`xs`,maw:720,children:Oe.map(t=>(0,R.jsx)(u,{variant:`default`,size:`sm`,radius:`xl`,onClick:()=>void e(t),children:t},t))})]})}function Ne({message:e,time:n,appView:r,provisional:i=!1}){if(e.role===`activity`)return e.activityType===`agent-outcome`&&e.content&&typeof e.content==`object`&&`message`in e.content&&typeof e.content.message==`string`?`status`in e.content&&e.content.status===`stopped`?(0,R.jsx)(f,{c:`dimmed`,size:`sm`,"data-chat-anchor":!0,children:e.content.message}):(0,R.jsx)(_,{color:`bad`,title:`Something went wrong`,"data-chat-anchor":!0,children:e.content.message}):e.activityType===`mcp-app`?r?(0,R.jsx)(De,{view:r}):(0,R.jsx)(_,{color:`bad`,"data-chat-anchor":!0,children:`This view could not be loaded. Please try again.`}):null;if(e.role===`assistant`&&e.toolCalls?.length)return null;let a=typeof e.content==`string`?e.content:JSON.stringify(e.content);if(!a&&e.role===`assistant`)return null;let s=e.role===`user`,c=n?new Intl.DateTimeFormat(void 0,{hour:`numeric`,minute:`2-digit`}).format(new Date(n)):``;return(0,R.jsxs)(t,{className:`chat-message${i?` chat-message--provisional`:``}`,"data-chat-anchor":!0,"data-role":s?`user`:`assistant`,children:[s?(0,R.jsx)(b,{radius:`lg`,px:`md`,py:`sm`,bg:`var(--mantine-color-brand-light)`,maw:`70%`,ml:`auto`,w:`fit-content`,children:(0,R.jsx)(f,{style:{whiteSpace:`pre-wrap`},children:a})}):(0,R.jsx)(W,{className:`chat-markdown${i?` chat-markdown--provisional`:``}`,"data-provisional":i||void 0,children:(0,R.jsx)(re,{remarkPlugins:[I],components:Fe,children:a})}),(i||c||!s)&&(0,R.jsx)(o,{className:`chat-message-meta`,gap:6,justify:s?`flex-end`:`flex-start`,mt:4,h:24,children:i?(0,R.jsx)(x,{type:`dots`,size:20}):(0,R.jsxs)(R.Fragment,{children:[c&&n&&(0,R.jsx)(f,{c:`dimmed`,size:`xs`,title:ne(n),children:c}),!s&&(0,R.jsx)(Pe,{text:a,label:`Copy message`})]})})]})}function Pe({text:e,label:t}){let{state:n,copy:r}=be();return(0,R.jsx)(M,{label:n===`failed`?`Could not copy`:n===`copied`?`Copied`:t,children:(0,R.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,R.jsx)(p,{size:13,weight:`bold`}):(0,R.jsx)(v,{size:13})})})}var Fe={table:({children:e})=>(0,R.jsx)(t,{className:`chat-table`,children:(0,R.jsx)(F,{striped:!0,highlightOnHover:!0,withTableBorder:!0,verticalSpacing:`xs`,fz:`sm`,children:e})}),thead:({children:e})=>(0,R.jsx)(F.Thead,{children:e}),tbody:({children:e})=>(0,R.jsx)(F.Tbody,{children:e}),tr:({children:e})=>(0,R.jsx)(F.Tr,{children:e}),th:({children:e})=>(0,R.jsx)(F.Th,{children:e}),td:({children:e})=>(0,R.jsx)(F.Td,{children:e}),pre:({children:e})=>(0,R.jsx)(Ie,{children:e}),a:({href:e,children:t})=>(0,R.jsx)(`a`,{href:e,target:`_blank`,rel:`noopener noreferrer`,children:t})};function Ie({children:e}){let n=$(e);return(0,R.jsxs)(t,{className:`chat-code`,pos:`relative`,children:[(0,R.jsx)(t,{className:`chat-code-actions`,pos:`absolute`,top:6,right:6,children:(0,R.jsx)(Pe,{text:n,label:`Copy code`})}),(0,R.jsx)(`pre`,{children:e})]})}function $(e){return typeof e==`string`?e:Array.isArray(e)?e.map($).join(``):e&&typeof e==`object`&&`props`in e?$(e.props.children):``}export{X as n,ke as t}; \ No newline at end of file diff --git a/internal/ui/dist/assets/chat-C7NkH_Mg.js b/internal/ui/dist/assets/chat-C7NkH_Mg.js deleted file mode 100644 index 0e6d10e82..000000000 --- a/internal/ui/dist/assets/chat-C7NkH_Mg.js +++ /dev/null @@ -1,2 +0,0 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/mcp-app-frame-CtnQ8BLx.js","assets/brand-B8x2UvAx.js","assets/auth-DQIRmg9h.js","assets/use-computed-color-scheme-DxHBJokx.js","assets/FocusTrap-yuoZ2xkr.js","assets/get-single-element-child-C3yy66_3.js","assets/index-C23tbW7l.js","assets/preload-helper-DYCQ0CsM.js","assets/theme-DGoiBK3l.js","assets/Tooltip-BP7AB724.js","assets/useQuery-CJpHjMkr.js","assets/index-B905rHdc.css"])))=>i.map(i=>d[i]); -import{A as e,C as t,M as n,S as r,St as i,T as a,_ as o,_t as s,a as c,c as l,d as u,et as d,f,i as p,l as m,m as h,n as g,o as _,p as v,r as y,u as b,x,y as S,yt as C}from"./brand-B8x2UvAx.js";import{c as w,d as ee,f as T,h as E,l as D,m as O,o as te,s as k,t as A}from"./preload-helper-DYCQ0CsM.js";import{t as j}from"./Tooltip-BP7AB724.js";import{c as M,d as N,l as P,o as F,r as I,s as ne,t as re,u as ie}from"./dashboard-change-chips-DyBazwAN.js";var L=i(C(),1),R=s(),ae=[`borderBottomWidth`,`borderLeftWidth`,`borderRightWidth`,`borderTopWidth`,`boxSizing`,`fontFamily`,`fontSize`,`fontStyle`,`fontWeight`,`letterSpacing`,`lineHeight`,`paddingBottom`,`paddingLeft`,`paddingRight`,`paddingTop`,`tabSize`,`textIndent`,`textRendering`,`textTransform`,`width`,`wordBreak`,`wordSpacing`,`scrollbarGutter`],z={"min-height":`0`,"max-height":`none`,height:`0`,visibility:`hidden`,overflow:`hidden`,position:`absolute`,"z-index":`-1000`,top:`0`,right:`0`,display:`block`};function B(e){Object.keys(z).forEach(t=>{e.style.setProperty(t,z[t],`important`)})}function oe(e){let t=window.getComputedStyle(e);if(t===null)return null;let n={};for(let e of ae)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 V=null;function se(e,t,n=1,r=1/0){V||(V=document.createElement(`textarea`),V.setAttribute(`tabindex`,`-1`),V.setAttribute(`aria-hidden`,`true`),V.setAttribute(`aria-label`,`autosize measurement`),B(V)),V.parentNode===null&&document.body.appendChild(V);let{paddingSize:i,borderSize:a,sizingStyle:o}=e,{boxSizing:s}=o;Object.keys(o).forEach(e=>{V.style[e]=o[e]}),B(V),V.value=t;let c=s===`border-box`?V.scrollHeight+a:V.scrollHeight-i;V.value=t,c=s===`border-box`?V.scrollHeight+a:V.scrollHeight-i,V.value=`x`;let l=V.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 ce({maxRows:e,minRows:t,onChange:n,ref:r,...i}){let a=i.value!==void 0,o=(0,L.useRef)(null),s=d(o,r),c=(0,L.useRef)(0),l=(0,L.useRef)(0),u=()=>{let n=o.current;if(!n)return;let r=oe(n);if(!r)return;let[i]=se(r,n.value||n.placeholder||`x`,t,e);c.current!==i&&(c.current=i,n.style.setProperty(`height`,`${i}px`,`important`))},f=(0,L.useEffectEvent)(u),p=e=>{a||u(),n?.(e)};return(0,L.useLayoutEffect)(u),(0,L.useEffect)(()=>{let e=()=>u();return window.addEventListener(`resize`,e),()=>window.removeEventListener(`resize`,e)},[]),(0,L.useEffect)(()=>{let e=o.current;if(!e||typeof ResizeObserver>`u`)return;l.current=e.offsetWidth;let t=0,n=new ResizeObserver(()=>{o.current&&o.current.offsetWidth!==l.current&&(l.current=o.current.offsetWidth,cancelAnimationFrame(t),t=requestAnimationFrame(f))});return n.observe(e),()=>{cancelAnimationFrame(t),n.disconnect()}},[]),(0,L.useEffect)(()=>{let e=()=>u();return document.fonts.addEventListener(`loadingdone`,e),()=>document.fonts.removeEventListener(`loadingdone`,e)},[]),(0,L.useEffect)(()=>{let e=e=>{if(o.current?.form===e.target&&!a){let e=o.current.value;requestAnimationFrame(()=>{o.current&&e!==o.current.value&&u()})}};return document.body.addEventListener(`reset`,e),()=>document.body.removeEventListener(`reset`,e)},[a]),(0,R.jsx)(`textarea`,{rows:t,...i,onChange:p,ref:s})}var H=a(e=>{let{autosize:t,maxRows:r,minRows:i,__staticSelector:a,resize:o,bottomSection:s,bottomSectionProps:c,...l}=n([`Input`,`InputWrapper`,`Textarea`],null,e),u=t&&N()!==`test`,d=u?{maxRows:r,minRows:i}:{};return(0,R.jsx)(h,{component:u?ce:`textarea`,...l,__staticSelector:a||`Textarea`,__bottomSection:s,__bottomSectionProps:c,multiline:!0,"data-no-overflow":t&&r===void 0||void 0,__vars:{"--input-resize":o},...d})});H.classes=h.classes,H.displayName=`@mantine/core/Textarea`;var U={root:`m_d08caa0`},W=a(r=>{let i=n(`Typography`,null,r),{classNames:a,className:o,style:s,styles:c,unstyled:l,attributes:u,...d}=i,f=e({name:`Typography`,classes:U,props:i,className:o,style:s,classNames:a,styles:c,unstyled:l,attributes:u});return(0,R.jsx)(t,{...f(`root`),...d})});W.classes=U,W.displayName=`@mantine/core/Typography`;var le=new Map([[`bold`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M184.49,136.49l-80,80a12,12,0,0,1-17-17L159,128,87.51,56.49a12,12,0,1,1,17-17l80,80A12,12,0,0,1,184.49,136.49Z`}))],[`duotone`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M176,128,96,208V48Z`,opacity:`0.2`}),L.createElement(`path`,{d:`M181.66,122.34l-80-80A8,8,0,0,0,88,48V208a8,8,0,0,0,13.66,5.66l80-80A8,8,0,0,0,181.66,122.34ZM104,188.69V67.31L164.69,128Z`}))],[`fill`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M181.66,133.66l-80,80A8,8,0,0,1,88,208V48a8,8,0,0,1,13.66-5.66l80,80A8,8,0,0,1,181.66,133.66Z`}))],[`light`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M180.24,132.24l-80,80a6,6,0,0,1-8.48-8.48L167.51,128,91.76,52.24a6,6,0,0,1,8.48-8.48l80,80A6,6,0,0,1,180.24,132.24Z`}))],[`regular`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M181.66,133.66l-80,80a8,8,0,0,1-11.32-11.32L164.69,128,90.34,53.66a8,8,0,0,1,11.32-11.32l80,80A8,8,0,0,1,181.66,133.66Z`}))],[`thin`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M178.83,130.83l-80,80a4,4,0,0,1-5.66-5.66L170.34,128,93.17,50.83a4,4,0,0,1,5.66-5.66l80,80A4,4,0,0,1,178.83,130.83Z`}))]]),ue=new Map([[`bold`,L.createElement(L.Fragment,null,L.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`,L.createElement(L.Fragment,null,L.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`}),L.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`,L.createElement(L.Fragment,null,L.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`,L.createElement(L.Fragment,null,L.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`,L.createElement(L.Fragment,null,L.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`,L.createElement(L.Fragment,null,L.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`,L.createElement(L.Fragment,null,L.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`,L.createElement(L.Fragment,null,L.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`}),L.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`,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`}))],[`light`,L.createElement(L.Fragment,null,L.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`,L.createElement(L.Fragment,null,L.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`,L.createElement(L.Fragment,null,L.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`}))]]),G=L.forwardRef((e,t)=>L.createElement(c,{ref:t,...e,weights:le}));G.displayName=`CaretRightIcon`;var K=G,q=L.forwardRef((e,t)=>L.createElement(c,{ref:t,...e,weights:ue}));q.displayName=`PaperPlaneTiltIcon`;var fe=q,J=L.forwardRef((e,t)=>L.createElement(c,{ref:t,...e,weights:de}));J.displayName=`StopIcon`;var pe=J;function me(e){return e.dashboard.panels.length===1?e.dashboard.panels[0].title:e.dashboard.name}function he(e){if(!e||typeof e!=`object`||Array.isArray(e))throw Error(`Missing panel view`);let t=e;if(!t.view||![`preset`,`query`].includes(t.view.kind)||!/^[a-f0-9]{64}$/.test(t.view.key))throw Error(`Invalid panel view identity`);if(t.dashboard?.version!==1||!Array.isArray(t.dashboard.panels)||!t.dashboard.panels.length||t.dashboard.panels.length>40||!Array.isArray(t.results)||t.dashboard.panels.some(e=>!e||typeof e.id!=`string`||!e.id)||t.results.some(e=>!e||typeof e.id!=`string`))throw Error(`Invalid panel view`);let n=new Set(t.dashboard.panels.map(e=>e.id));if(n.size!==t.dashboard.panels.length||t.results.length!==n.size||new Set(t.results.map(e=>e.id)).size!==n.size||t.results.some(e=>!n.has(e.id)||![`ok`,`empty`,`error`].includes(e.status)))throw Error(`Panel results do not match the view`);if(t.vars!==void 0&&(!t.vars||typeof t.vars!=`object`||Array.isArray(t.vars)||Object.values(t.vars).some(e=>typeof e!=`string`&&!(Array.isArray(e)&&e.every(e=>typeof e==`string`)))))throw Error(`Invalid panel variables`);if(t.trace!==void 0&&(!t.trace?.data||!Array.isArray(t.trace.data.spans)||!Array.isArray(t.trace.data.logs)||!Array.isArray(t.trace.data.services)))throw Error(`Invalid trace detail`);return t}var Y=new WeakSet;function X(e){if(!e||typeof e!=`object`||Array.isArray(e))return;if(Y.has(e))return e;let t=e;if(Object.keys(t).sort().join(`,`)===`is_error,resource_uri,tool_input,tool_name,tool_result`&&t.resource_uri===`ui://fanout/panels.html`&&typeof t.tool_name==`string`&&t.tool_name&&typeof t.is_error==`boolean`&&t.tool_input&&typeof t.tool_input==`object`&&!Array.isArray(t.tool_input)){try{he(t.tool_result)}catch{return}return Y.add(t),t}}var ge=64,_e=300;function ve(){let e=(0,L.useRef)(null),t=(0,L.useRef)(!0),n=(0,L.useRef)(()=>{}),r=(0,L.useRef)(null),i=(0,L.useRef)(null),a=(0,L.useCallback)(()=>{let t=e.current;if(!t)return;let n=t.getBoundingClientRect().top,r=[...t.querySelectorAll(`[data-chat-anchor]`)].find(e=>e.getBoundingClientRect().bottom>n);i.current=r?{node:r,top:r.getBoundingClientRect().top}:null},[]),o=(0,L.useCallback)(()=>{let n=e.current;n&&t.current?n.scrollTop=n.scrollHeight:n&&i.current?.node.isConnected&&(n.scrollTop+=i.current.node.getBoundingClientRect().top-i.current.top),a()},[a]);return{scrollRef:(0,L.useCallback)(r=>{if(n.current(),e.current=r,!r)return;let o=0,s=!1,c=()=>{o=Date.now()},l=()=>{s=!0},u=()=>{s=!1},d=()=>{r.scrollHeight-r.clientHeight-r.scrollTop<=ge?t.current=!0:(s||Date.now()-o<_e)&&(t.current=!1),a()};r.addEventListener(`scroll`,d,{passive:!0}),r.addEventListener(`wheel`,c,{passive:!0}),r.addEventListener(`touchmove`,c,{passive:!0}),r.addEventListener(`keydown`,c),r.addEventListener(`pointerdown`,l),window.addEventListener(`pointerup`,u),n.current=()=>{r.removeEventListener(`scroll`,d),r.removeEventListener(`wheel`,c),r.removeEventListener(`touchmove`,c),r.removeEventListener(`keydown`,c),r.removeEventListener(`pointerdown`,l),window.removeEventListener(`pointerup`,u),n.current=()=>{}},t.current=!0,r.scrollTop=r.scrollHeight,i.current=null},[a]),contentRef:(0,L.useCallback)(e=>{r.current?.disconnect(),r.current=null,e&&(r.current=new ResizeObserver(o),r.current.observe(e))},[o]),toBottom:(0,L.useCallback)(()=>{t.current=!0,o()},[o])}}function ye(e=1500){let[t,n]=(0,L.useState)(`idle`),r=(0,L.useRef)(null);(0,L.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}}var be={schema:`Telemetry`,context:`Context`,draft:`Draft`,validation:`Validation`,preview:`Preview`,save:`Save`},Z=e=>`${(e/1e3).toFixed(1)} s`;function xe({receipt:e,running:t=!1,activity:n=``,awaitingAnswer:r=!1}){let[i,a]=(0,L.useState)(!1),s=(0,L.useId)(),c=e.saved,d=c?.receipt.save_check,p=Object.values(e.stages).filter(e=>e.state===`complete`).length,m=[e.stages.schema.state===`complete`?`Read telemetry`:void 0,e.panel_count===void 0?void 0:`${e.panel_count} ${e.panel_count===1?`panel`:`panels`}`,d?.checked?`Checked in ${Z(d.elapsed_ms)}`:void 0,c?`Saved v${c.version}`:void 0].filter(Boolean).join(` · `)||`Building dashboard`,h=[...c?w(c.receipt):[],...e.corrections.map(e=>`Fixed ${e.panel_id}.${e.path.replace(/^panels\[\d+\]\./,``)}`)];return(0,R.jsx)(x,{"data-build-receipt":e.turn_id,"data-dashboard-result":c?.id,"data-chat-anchor":!0,withBorder:!0,radius:`md`,p:`sm`,children:(0,R.jsxs)(l,{gap:6,children:[(0,R.jsxs)(o,{gap:`xs`,justify:`space-between`,children:[(0,R.jsxs)(f,{size:`sm`,role:`status`,"aria-live":`polite`,"aria-atomic":`true`,children:[m,(0,R.jsxs)(f,{span:!0,c:`dimmed`,size:`xs`,children:[` · `,p,` stages complete`]})]}),(0,R.jsxs)(u,{component:`button`,variant:`subtle`,color:`gray`,size:`compact-xs`,"aria-expanded":i,"aria-controls":s,onClick:()=>a(e=>!e),children:[`Details`,h.length>4?` (+${h.length-4})`:``]})]}),t&&r&&(0,R.jsxs)(o,{gap:`xs`,"data-build-running":!0,children:[(0,R.jsx)(S,{type:`dots`,size:`sm`}),(0,R.jsx)(f,{c:`dimmed`,size:`sm`,children:n||`Analyzing your system`})]}),(0,R.jsx)(re,{labels:h.slice(0,4)}),e.explanations.map(e=>t?e.split(` · `).filter(e=>!e.endsWith(`: incomplete`)).join(` · `):e).filter(Boolean).map((e,t)=>(0,R.jsx)(f,{size:`xs`,c:`dimmed`,"data-receipt-attention":!0,children:e},t)),c&&(0,R.jsx)(u,{renderRoot:e=>(0,R.jsx)(E,{...e,to:`/dashboards/$dashboardId`,params:{dashboardId:c.id},search:{}}),variant:`subtle`,size:`compact-sm`,color:`gray`,style:{alignSelf:`flex-start`},children:`Open dashboard`}),(0,R.jsx)(ie,{expanded:i,id:s,children:(0,R.jsxs)(l,{gap:4,children:[c&&(0,R.jsxs)(f,{size:`xs`,children:[c.label,` `,c.name,` · opens the current dashboard`]}),Object.entries(e.stages).map(([e,n])=>(0,R.jsxs)(f,{size:`xs`,c:`dimmed`,children:[be[e],`: `,t&&n.state===`incomplete`?`in progress`:n.state,n.elapsed_ms===void 0?``:` · ${Z(n.elapsed_ms)}`]},e)),e.save_attempts.map((e,t)=>e.state===`retried`&&(0,R.jsxs)(f,{size:`xs`,c:`dimmed`,children:[`Save attempt `,t+1,`: retried`]},e.call_id)),!!e.context_counts.deploys&&(0,R.jsxs)(f,{size:`xs`,children:[e.context_counts.deploys,` deploys observed`]}),!!e.context_counts.anomalies&&(0,R.jsxs)(f,{size:`xs`,children:[e.context_counts.anomalies,` anomalies observed`]}),e.panels.map(e=>(0,R.jsxs)(f,{size:`xs`,children:[`Preview · `,e.id,`: `,e.status,e.elapsed_ms===void 0?``:` · ${Z(e.elapsed_ms)}`]},e.id)),d&&(0,R.jsxs)(f,{size:`xs`,children:[`Save check: `,d.checked?`checked`:`incomplete`,` · `,Z(d.elapsed_ms)]}),d?.panels.map(e=>(0,R.jsxs)(f,{size:`xs`,children:[`Save · `,e.id,`: `,e.status,` · `,e.rows??0,` rows`,e.elapsed_ms===void 0?``:` · ${Z(e.elapsed_ms)}`]},e.id)),h.slice(4).map((e,t)=>(0,R.jsx)(f,{size:`xs`,children:e},t)),e.corrections.map((e,t)=>(0,R.jsxs)(f,{size:`xs`,children:[`Fixed `,e.panel_id,`.`,e.path,`: `,e.message]},t))]})})]})})}var Se=(0,L.lazy)(()=>A(()=>import(`./mcp-app-frame-CtnQ8BLx.js`),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11]))),Q=e=>e.tool_result.view.kind===`preset`;function Ce(e){let t=new Map,n=new Set,r=[],i=()=>{let e=new Map;for(let t of r){let n=t.content.tool_result.view.key;e.set(n,t)}let i=new Set([...e.values()].map(e=>e.id)),a=[...e.values()].some(e=>Q(e.content)),o=r.filter(e=>i.has(e.id)).at(-1)?.id;for(let e of r)i.has(e.id)?t.set(e.id,{content:e.content,expanded:Q(e.content)||!a&&e.id===o}):n.add(e.id);r=[]};for(let t of e)if(t.role===`user`&&i(),t.role===`activity`&&t.activityType===`mcp-app`){let e=X(t.content);e&&r.push({id:t.id,content:e})}return i(),{views:t,duplicates:n}}function we(e){let t=new Map,n=new Map,r=new Map,i=`unattributed`;for(let a of e){if(a.role===`user`&&(n.clear(),r.clear(),i=a.id),a.role===`assistant`){i=a.id;for(let e of a.toolCalls??[])n.set(e.id,{assistant:i,name:e.function.name})}if(a.role===`tool`){let e=ee(a.content);if(!a.error&&!e?.error&&e?.isError!==!0)continue;let o=n.get(a.toolCallId);if(o&&T.has(o.name)&&D(a))continue;let s=o?.assistant??i,c=r.get(s)??a.id;r.set(s,c);let l=t.get(c)??[],u=typeof e?.error==`string`?e.error:typeof a.error==`string`&&a.error?a.error:`Tool execution failed`;l.push({name:o?.name??`Tool`,message:u,readOnly:e?.code===`answer_only`}),t.set(c,l)}}return t}function Te({failures:e}){let[n,i]=(0,L.useState)(!1),a=e.filter(e=>!e.readOnly);return(0,R.jsxs)(t,{"data-chat-anchor":!0,children:[e.some(e=>e.readOnly)&&(0,R.jsx)(f,{size:`sm`,c:`dimmed`,children:`Not saved: Explain is read-only`}),a.length>0&&(0,R.jsxs)(R.Fragment,{children:[(0,R.jsxs)(r,{className:`chat-app-toggle`,"aria-expanded":n,onClick:()=>i(e=>!e),style:{color:`var(--mantine-color-dimmed)`},children:[(0,R.jsx)(`span`,{className:`chat-app-chevron`,"aria-hidden":`true`,children:n?(0,R.jsx)(M,{size:14}):(0,R.jsx)(K,{size:14})}),(0,R.jsxs)(`span`,{className:`chat-app-summary`,children:[a.length,` tool `,a.length===1?`call`:`calls`,` failed`]})]}),n&&(0,R.jsx)(l,{gap:`xs`,pl:`md`,children:a.map((e,t)=>(0,R.jsxs)(f,{size:`sm`,c:`dimmed`,style:{whiteSpace:`pre-wrap`,overflowWrap:`anywhere`},children:[e.name,`: `,e.message]},t))})]})]})}function Ee({view:e}){let[t,n]=(0,L.useState)(e.expanded);(0,L.useEffect)(()=>n(e.expanded),[e.expanded]);let i=e.content.tool_result,a=me(i),o=[...new Set(i.dashboard.panels.map(e=>e.viz===`timeseries`?`time series`:e.viz.replaceAll(`_`,` `)))].join(`, `),s=i.results.reduce((e,t)=>e+(t.frame?.rows??0),0),c=new Map;for(let e of i.results)e.status!==`ok`&&c.set(e.status,(c.get(e.status)??0)+1);let l=i.dashboard.panels.length>1?[`${i.dashboard.panels.length} panels`,...Array.from(c,([e,t])=>`${t} ${e}`)].join(` · `):c.size?[...c.keys()].join(`, `):`${s} ${s===1?`row`:`rows`}`;return(0,R.jsxs)(x,{"data-chat-app":!0,"data-chat-anchor":!0,withBorder:!0,radius:`lg`,style:{overflow:`hidden`},children:[(0,R.jsxs)(r,{className:`chat-app-toggle`,"aria-expanded":t,onClick:()=>n(e=>!e),children:[(0,R.jsx)(`span`,{className:`chat-app-chevron`,"aria-hidden":`true`,children:t?(0,R.jsx)(M,{size:14}):(0,R.jsx)(K,{size:14})}),(0,R.jsxs)(`span`,{className:`chat-app-summary`,children:[a,` · `,o,` · `,l]})]}),t&&(0,R.jsx)(L.Suspense,{fallback:(0,R.jsx)(b,{mih:180,children:(0,R.jsx)(S,{size:`sm`})}),children:(0,R.jsx)(Se,{content:e.content})})]})}var De=[`Summarize system health for the last hour`,`Find the source of elevated errors`,`Map the current service dependencies`,`Show the slowest endpoints`];function Oe(){let{agentAvailable:e,messages:n,messageTimes:r,ready:i,running:a,activity:s,provisional:c,stopped:d,error:p,threadMissing:h,send:g,retry:y,reloadThread:C,newThread:w}=k(),{scrollRef:ee,contentRef:T,toBottom:E}=ve(),D=te(n),O=n.filter(e=>e.role===`user`).at(-1)?.id;if((0,L.useEffect)(()=>{O&&E()},[O,E]),!e)return(0,R.jsx)(m,{size:`sm`,py:96,children:(0,R.jsx)(x,{withBorder:!0,radius:`lg`,p:{base:`xl`,sm:40},children:(0,R.jsxs)(l,{gap:`md`,children:[(0,R.jsx)(f,{c:`brand`,fw:700,size:`xs`,tt:`uppercase`,lts:`0.12em`,children:`Optional capability`}),(0,R.jsx)(_,{order:1,fz:28,children:`Chat is not configured`}),(0,R.jsx)(f,{c:`dimmed`,children:`Add an AI provider key to enable chat. Telemetry ingest, dashboards, traces, logs, and metrics remain available without it.`}),(0,R.jsx)(u,{component:`a`,href:`/dashboards`,variant:`light`,mt:`sm`,children:`Open dashboards`})]})})});let A=Ce(n),j=we(n),M=n.filter(e=>A.duplicates.has(e.id)?!1:e.role===`tool`?j.has(e.id):e.role===`assistant`?!e.toolCalls?.length&&typeof e.content==`string`&&e.content.trim().length>0:e.role===`activity`?e.activityType===`mcp-app`||e.activityType===`agent-outcome`:e.role===`user`),N=n.findIndex(e=>e.id===O),P=n.slice(N+1).some(e=>e.role===`assistant`&&!e.toolCalls?.length&&typeof e.content==`string`&&e.content.length>0),F=n.slice(N+1).filter(e=>e.role===`assistant`&&!e.toolCalls?.length&&typeof e.content==`string`&&e.content.trim().length>0).at(-1),I=a&&c&&!c.collapsed&&c.text&&!P;return(0,R.jsxs)(t,{className:`chat-pane`,children:[(0,R.jsx)(t,{className:`chat-scroll`,ref:ee,tabIndex:0,role:`log`,"aria-label":`Conversation`,children:(0,R.jsxs)(m,{size:880,px:{base:`md`,sm:`xl`},py:`lg`,ref:T,children:[h&&(0,R.jsx)(v,{color:`warn`,radius:`lg`,title:`This chat no longer exists`,children:(0,R.jsxs)(o,{justify:`space-between`,children:[(0,R.jsx)(f,{size:`sm`,children:`It was deleted, or the link is wrong.`}),(0,R.jsx)(u,{size:`compact-sm`,variant:`light`,onClick:w,children:`New chat`})]})}),!h&&!i&&p&&(0,R.jsx)(ke,{message:p,onRetry:C,onNewThread:w}),!h&&!i&&!p&&(0,R.jsxs)(b,{mih:`40vh`,children:[(0,R.jsx)(S,{size:`sm`}),(0,R.jsx)(f,{c:`dimmed`,size:`sm`,ml:`sm`,children:`Loading chat`})]}),!h&&i&&(0,R.jsxs)(R.Fragment,{children:[M.length===0&&(0,R.jsx)(je,{onSelect:g}),(0,R.jsxs)(l,{gap:`lg`,children:[M.filter(e=>e.id!==F?.id).map(e=>j.has(e.id)?(0,R.jsx)(Te,{failures:j.get(e.id)},e.id):(0,R.jsxs)(t,{children:[(0,R.jsx)(Me,{message:e,time:r[e.id],appView:A.views.get(e.id)}),D.has(e.id)&&(0,R.jsx)(t,{mt:`sm`,children:(0,R.jsx)(xe,{receipt:D.get(e.id),running:a&&e.id===O,awaitingAnswer:!P&&!I,activity:s})})]},e.id)),(F||I)&&(0,R.jsx)(t,{"data-answer-position":!0,children:(0,R.jsx)(Me,{message:I?{id:c.id,role:`assistant`,content:c.text}:F,provisional:!!I,time:I?void 0:r[F.id]})},`answer-${O??`draft`}`),a&&!P&&!I&&!D.has(O??``)&&(0,R.jsxs)(o,{gap:`xs`,role:`status`,children:[(0,R.jsx)(S,{type:`dots`,size:`sm`}),(0,R.jsx)(f,{c:`dimmed`,size:`sm`,children:s||`Analyzing your system`})]}),d&&(0,R.jsx)(f,{c:`dimmed`,size:`sm`,children:`Stopped`}),p&&(0,R.jsx)(ke,{message:p,onRetry:y})]})]})]})}),!h&&(0,R.jsx)(Ae,{})]})}function ke({message:e,onRetry:t,onNewThread:n}){return(0,R.jsx)(v,{color:`bad`,radius:`lg`,title:`Something went wrong`,children:(0,R.jsxs)(o,{justify:`space-between`,gap:`sm`,wrap:`nowrap`,children:[(0,R.jsx)(f,{size:`sm`,children:e}),(0,R.jsxs)(o,{gap:`xs`,wrap:`nowrap`,children:[n&&(0,R.jsx)(u,{size:`compact-sm`,variant:`subtle`,color:`bad`,onClick:n,children:`New chat`}),(0,R.jsx)(u,{size:`compact-sm`,variant:`light`,color:`bad`,onClick:t,children:`Retry`})]})]})})}function Ae(){let{input:e,setInput:n,inputRef:r,submit:i,send:a,stop:s,ready:c,running:l}=k();return(0,R.jsx)(t,{className:`chat-composer`,children:(0,R.jsxs)(m,{size:880,px:{base:`md`,sm:`xl`},children:[(0,R.jsx)(x,{component:`form`,onSubmit:i,className:`chat-composer-field`,withBorder:!0,radius:24,py:6,pl:`lg`,pr:6,children:(0,R.jsxs)(o,{align:`flex-end`,gap:`xs`,wrap:`nowrap`,children:[(0,R.jsx)(H,{ref:r,"aria-label":`Message Fanout`,value:e,onChange:e=>n(e.currentTarget.value),onKeyDown:t=>{t.key===`Enter`&&!t.shiftKey&&(t.preventDefault(),a(e))},placeholder:l?`Fanout is working…`:`Ask about health, errors, or latency…`,disabled:!c,autosize:!0,minRows:1,maxRows:8,variant:`unstyled`,flex:1}),l?(0,R.jsx)(j,{label:`Stop`,children:(0,R.jsx)(O,{type:`button`,variant:`default`,size:40,radius:`xl`,"aria-label":`Stop`,onClick:s,children:(0,R.jsx)(pe,{size:16,weight:`fill`})})}):(0,R.jsx)(O,{type:`submit`,variant:`filled`,size:40,radius:`xl`,disabled:!e.trim()||!c,"aria-label":`Send message`,children:(0,R.jsx)(fe,{size:17,weight:`fill`})})]})}),(0,R.jsx)(f,{c:`dimmed`,size:`xs`,ta:`center`,mt:6,children:`Enter to send, Shift+Enter for a new line`})]})})}function je({onSelect:e}){return(0,R.jsxs)(l,{align:`center`,gap:`md`,pt:{base:32,sm:88},pb:`xl`,ta:`center`,children:[(0,R.jsx)(g,{size:`large`}),(0,R.jsx)(_,{order:1,fz:24,fw:500,lh:1.25,maw:560,children:`What do you want to know about your system?`}),(0,R.jsx)(o,{justify:`center`,gap:`xs`,mt:`xs`,maw:720,children:De.map(t=>(0,R.jsx)(u,{variant:`default`,size:`sm`,radius:`xl`,onClick:()=>void e(t),children:t},t))})]})}function Me({message:e,time:n,appView:r,provisional:i=!1}){if(e.role===`activity`)return e.activityType===`agent-outcome`&&e.content&&typeof e.content==`object`&&`message`in e.content&&typeof e.content.message==`string`?`status`in e.content&&e.content.status===`stopped`?(0,R.jsx)(f,{c:`dimmed`,size:`sm`,"data-chat-anchor":!0,children:e.content.message}):(0,R.jsx)(v,{color:`bad`,title:`Something went wrong`,"data-chat-anchor":!0,children:e.content.message}):e.activityType===`mcp-app`?r?(0,R.jsx)(Ee,{view:r}):(0,R.jsx)(v,{color:`bad`,"data-chat-anchor":!0,children:`This view could not be loaded. Please try again.`}):null;if(e.role===`assistant`&&e.toolCalls?.length)return null;let a=typeof e.content==`string`?e.content:JSON.stringify(e.content);if(!a&&e.role===`assistant`)return null;let s=e.role===`user`,c=n?new Intl.DateTimeFormat(void 0,{hour:`numeric`,minute:`2-digit`}).format(new Date(n)):``;return(0,R.jsxs)(t,{className:`chat-message${i?` chat-message--provisional`:``}`,"data-chat-anchor":!0,"data-role":s?`user`:`assistant`,children:[s?(0,R.jsx)(x,{radius:`lg`,px:`md`,py:`sm`,bg:`var(--mantine-color-brand-light)`,maw:`70%`,ml:`auto`,w:`fit-content`,children:(0,R.jsx)(f,{style:{whiteSpace:`pre-wrap`},children:a})}):(0,R.jsx)(W,{className:`chat-markdown${i?` chat-markdown--provisional`:``}`,"data-provisional":i||void 0,children:(0,R.jsx)(ne,{remarkPlugins:[F],components:Pe,children:a})}),(i||c||!s)&&(0,R.jsx)(o,{className:`chat-message-meta`,gap:6,justify:s?`flex-end`:`flex-start`,mt:4,h:24,children:i?(0,R.jsx)(S,{type:`dots`,size:20}):(0,R.jsxs)(R.Fragment,{children:[c&&n&&(0,R.jsx)(f,{c:`dimmed`,size:`xs`,title:I(n),children:c}),!s&&(0,R.jsx)(Ne,{text:a,label:`Copy message`})]})})]})}function Ne({text:e,label:t}){let{state:n,copy:r}=ye();return(0,R.jsx)(j,{label:n===`failed`?`Could not copy`:n===`copied`?`Copied`:t,children:(0,R.jsx)(O,{variant:`subtle`,color:`gray`,size:`sm`,"aria-label":t,"data-state":n===`idle`?void 0:n,onClick:()=>r(e),children:n===`copied`?(0,R.jsx)(p,{size:13,weight:`bold`}):(0,R.jsx)(y,{size:13})})})}var Pe={table:({children:e})=>(0,R.jsx)(t,{className:`chat-table`,children:(0,R.jsx)(P,{striped:!0,highlightOnHover:!0,withTableBorder:!0,verticalSpacing:`xs`,fz:`sm`,children:e})}),thead:({children:e})=>(0,R.jsx)(P.Thead,{children:e}),tbody:({children:e})=>(0,R.jsx)(P.Tbody,{children:e}),tr:({children:e})=>(0,R.jsx)(P.Tr,{children:e}),th:({children:e})=>(0,R.jsx)(P.Th,{children:e}),td:({children:e})=>(0,R.jsx)(P.Td,{children:e}),pre:({children:e})=>(0,R.jsx)(Fe,{children:e}),a:({href:e,children:t})=>(0,R.jsx)(`a`,{href:e,target:`_blank`,rel:`noopener noreferrer`,children:t})};function Fe({children:e}){let n=$(e);return(0,R.jsxs)(t,{className:`chat-code`,pos:`relative`,children:[(0,R.jsx)(t,{className:`chat-code-actions`,pos:`absolute`,top:6,right:6,children:(0,R.jsx)(Ne,{text:n,label:`Copy code`})}),(0,R.jsx)(`pre`,{children:e})]})}function $(e){return typeof e==`string`?e:Array.isArray(e)?e.map($).join(``):e&&typeof e==`object`&&`props`in e?$(e.props.children):``}export{X as n,Oe as t}; \ No newline at end of file diff --git a/internal/ui/dist/assets/chat._threadId-C9Zt69Sm.js b/internal/ui/dist/assets/chat._threadId-C9Zt69Sm.js new file mode 100644 index 000000000..5f5b3a1f1 --- /dev/null +++ b/internal/ui/dist/assets/chat._threadId-C9Zt69Sm.js @@ -0,0 +1 @@ +import{t as e}from"./chat-Bm-gn0Xj.js";var t=e;export{t as component}; \ No newline at end of file diff --git a/internal/ui/dist/assets/chat._threadId-DBWfXIEO.js b/internal/ui/dist/assets/chat._threadId-DBWfXIEO.js deleted file mode 100644 index 04b9b7fae..000000000 --- a/internal/ui/dist/assets/chat._threadId-DBWfXIEO.js +++ /dev/null @@ -1 +0,0 @@ -import{t as e}from"./chat-C7NkH_Mg.js";var t=e;export{t as component}; \ No newline at end of file diff --git a/internal/ui/dist/assets/chat.index-C9Zt69Sm.js b/internal/ui/dist/assets/chat.index-C9Zt69Sm.js new file mode 100644 index 000000000..5f5b3a1f1 --- /dev/null +++ b/internal/ui/dist/assets/chat.index-C9Zt69Sm.js @@ -0,0 +1 @@ +import{t as e}from"./chat-Bm-gn0Xj.js";var t=e;export{t as component}; \ No newline at end of file diff --git a/internal/ui/dist/assets/chat.index-DBWfXIEO.js b/internal/ui/dist/assets/chat.index-DBWfXIEO.js deleted file mode 100644 index 04b9b7fae..000000000 --- a/internal/ui/dist/assets/chat.index-DBWfXIEO.js +++ /dev/null @@ -1 +0,0 @@ -import{t as e}from"./chat-C7NkH_Mg.js";var t=e;export{t as component}; \ No newline at end of file diff --git a/internal/ui/dist/assets/dashboard-change-chips-DyBazwAN.js b/internal/ui/dist/assets/dashboard-change-chips-DKUpHHI0.js similarity index 99% rename from internal/ui/dist/assets/dashboard-change-chips-DyBazwAN.js rename to internal/ui/dist/assets/dashboard-change-chips-DKUpHHI0.js index 8ade1a476..e4dd513bb 100644 --- a/internal/ui/dist/assets/dashboard-change-chips-DyBazwAN.js +++ b/internal/ui/dist/assets/dashboard-change-chips-DKUpHHI0.js @@ -1,4 +1,4 @@ -import{$ as e,A as t,C as n,K as r,M as i,P as a,St as o,T as s,X as c,Z as l,_ as u,_t as d,a as f,bt as p,ft as m,lt as h,nt as g,vt as _,xt as v,yt as y,z as b}from"./brand-B8x2UvAx.js";import{p as x}from"./preload-helper-DYCQ0CsM.js";import{E as S,S as C,o as w}from"./Tooltip-BP7AB724.js";var T=o(y(),1),E=o(_(),1);function D(e){if(!e||typeof e==`string`)return 0;let t=e/36;return Math.round((4+15*t**.25+t/5)*10)}function O(e){return e.current?e.current.scrollHeight:`auto`}function k(e){return typeof e==`number`&&e>0}function ee({transitionDuration:t,transitionTimingFunction:n=`ease`,onTransitionEnd:r,onTransitionStart:i,expanded:a,keepMounted:o}){let s={height:0,overflow:`hidden`,...o?{}:{display:`none`}},c=(0,T.useEffectEvent)(()=>i?.()),l=(0,T.useEffectEvent)(()=>r?.()),u=(0,T.useRef)(null),[d,f]=(0,T.useState)(a?{}:s),[p,m]=(0,T.useState)(a?`entered`:`exited`),h=e=>{(0,E.flushSync)(()=>f(e))},_=e=>{h(t=>({...t,...e}))},v=e=>{let r=t??D(e);return{transition:`height ${r}ms ${n}, opacity ${r}ms ${n}`}},y=(0,T.useRef)(0);g(()=>{y.current+=1;let e=y.current,n=()=>y.current===e;t!==0&&c(),a?window.requestAnimationFrame(()=>{n()&&u.current&&((0,E.flushSync)(()=>m(`entering`)),_({willChange:`height`,display:`block`,overflow:`hidden`}),window.requestAnimationFrame(()=>{if(!n()||!u.current)return;let e=O(u);if(!k(e)){h({}),m(`entered`),l();return}_({...v(e),height:e})}))}):window.requestAnimationFrame(()=>{if(!n()||!u.current)return;(0,E.flushSync)(()=>m(`exiting`));let e=O(u);if(!k(e)){h(s),m(`exited`),l();return}_({...v(e),willChange:`height`,height:e}),window.requestAnimationFrame(()=>{n()&&u.current&&_({height:0,overflow:`hidden`})})})},[a]);let b=e=>{if(e.target===u.current&&e.propertyName===`height`){if(a){let e=O(u);e===d.height?h({}):_({height:e}),m(`entered`),l()}else d.height===0&&(h(s),m(`exited`),l())}};return{state:p,getCollapseProps:t=>({"aria-hidden":!a,inert:!a,ref:e(u,t?.ref),onTransitionEnd:b,style:{boxSizing:`border-box`,...t?.style,...d}})}}function te(e){if(!e||typeof e==`string`)return 0;let t=e/36;return Math.round((4+15*t**.25+t/5)*10)}function A(e){return e.current?e.current.scrollWidth:`auto`}function j({transitionDuration:t,transitionTimingFunction:n=`ease`,onTransitionEnd:r,onTransitionStart:i,expanded:a,keepMounted:o}){let s={width:0,overflow:`hidden`,...o?{}:{display:`none`}},c=(0,T.useEffectEvent)(()=>i?.()),l=(0,T.useEffectEvent)(()=>r?.()),u=(0,T.useRef)(null),[d,f]=(0,T.useState)(a?{}:s),[p,m]=(0,T.useState)(a?`entered`:`exited`),h=e=>{(0,E.flushSync)(()=>f(e))},_=e=>{h(t=>({...t,...e}))},v=e=>{let r=t??te(e);return{transition:`width ${r}ms ${n}, opacity ${r}ms ${n}`}},y=(0,T.useRef)(0);g(()=>{y.current+=1;let e=y.current,n=()=>y.current===e;t!==0&&c(),a?window.requestAnimationFrame(()=>{n()&&u.current&&((0,E.flushSync)(()=>m(`entering`)),_({willChange:`width`,display:`block`,overflow:`hidden`}),window.requestAnimationFrame(()=>{if(!n()||!u.current)return;let e=A(u);if(!k(e)){h({}),m(`entered`),l();return}_({...v(e),width:e})}))}):window.requestAnimationFrame(()=>{if(!n()||!u.current)return;(0,E.flushSync)(()=>m(`exiting`));let e=A(u);if(!k(e)){h(s),m(`exited`),l();return}_({...v(e),willChange:`width`,width:e}),window.requestAnimationFrame(()=>{n()&&u.current&&_({width:0,overflow:`hidden`})})})},[a]);let b=e=>{if(e.target===u.current&&e.propertyName===`width`){if(a){let e=A(u);e===d.width?h({}):_({width:e}),m(`entered`),l()}else d.width===0&&(h(s),m(`exited`),l())}};return{state:p,getCollapseProps:t=>({"aria-hidden":!a,inert:!a,ref:e(u,t?.ref),onTransitionEnd:b,style:{boxSizing:`border-box`,...t?.style,...d}})}}function ne(){return`development`}var M=d(),N={transitionDuration:200,transitionTimingFunction:`ease`,animateOpacity:!0,orientation:`vertical`,keepMounted:!0,keepMountedMode:`activity`},re=s(e=>{let{children:t,expanded:r,transitionDuration:o,transitionTimingFunction:s,style:c,onTransitionEnd:u,onTransitionStart:d,animateOpacity:f,keepMounted:p,keepMountedMode:m,ref:h,orientation:g,..._}=i(`Collapse`,N,e),v=b(),y=a(),x=l(),S=y.respectReducedMotion&&x?0:o,w=(g===`horizontal`?j:ee)({expanded:r,transitionDuration:S,transitionTimingFunction:s,onTransitionEnd:u,onTransitionStart:d,keepMounted:!1});if(S===0)return p===!0&&(m===`display-none`||v!==`test`)?m===`display-none`?(0,M.jsx)(n,{..._,style:{...C(c,y),...r?{}:{display:`none`}},ref:h,children:t}):(0,M.jsx)(T.Activity,{mode:r?`visible`:`hidden`,children:(0,M.jsx)(n,{..._,style:c,ref:h,children:t})}):r?(0,M.jsx)(n,{..._,style:c,ref:h,children:t}):null;let E=w.state===`exited`,D;return D=p===!1?E?null:t:p===!0?m===`display-none`?t:(0,M.jsx)(T.Activity,{mode:E?`hidden`:`visible`,children:t}):t,(0,M.jsx)(n,{..._,...w.getCollapseProps({style:{opacity:r||!f?1:0,transition:f?`opacity ${S}ms ${s}`:`none`,...C(c,y),...p&&m===`display-none`&&E?{display:`none`}:{}},ref:h}),children:D})});re.displayName=`@mantine/core/Collapse`;var[ie,ae]=S(`Table component was not found in the tree`),oe={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`};function se(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 ce(e,t){let r=`Table${e.charAt(0).toUpperCase()}${e.slice(1)}`,a=s(a=>{let o=i(r,{},a),{classNames:s,className:c,style:l,styles:u,...d}=o,f=ae();return(0,M.jsx)(n,{component:e,...se(f,t),...f.getStyles(e,{className:c,classNames:s,style:l,styles:u,props:o}),...d})});return a.displayName=`@mantine/core/${r}`,a.classes=oe,a}var le=ce(`th`,{columnBorder:!0}),ue=ce(`td`,{columnBorder:!0}),de=ce(`tr`,{rowBorder:!0,striped:!0,highlightOnHover:!0}),fe=ce(`thead`,{stickyHeader:!0}),pe=ce(`tbody`),me=ce(`tfoot`),he=ce(`caption`,{captionSide:!0}),ge={type:`scrollarea`},_e=c((e,{minWidth:t,maxHeight:n,type:r})=>({scrollContainer:{"--table-min-width":m(t),"--table-max-height":m(n),"--table-overflow":r===`native`?`auto`:void 0}})),ve=s(e=>{let r=i(`TableScrollContainer`,ge,e),{classNames:a,className:o,style:s,styles:c,unstyled:l,vars:u,children:d,minWidth:f,maxHeight:p,type:m,scrollAreaProps:h,attributes:g,..._}=r,v=t({name:`TableScrollContainer`,classes:oe,props:r,className:o,style:s,classNames:a,styles:c,unstyled:l,attributes:g,vars:u,varsResolver:_e,rootSelector:`scrollContainer`});return(0,M.jsx)(n,{component:m===`scrollarea`?w:`div`,...m===`scrollarea`?p?{offsetScrollbars:`xy`,...h}:{offsetScrollbars:`x`,...h}:{},...v(`scrollContainer`),..._,children:(0,M.jsx)(`div`,{...v(`scrollContainerInner`),children:d})})});ve.classes=oe,ve.varsResolver=_e,ve.displayName=`@mantine/core/TableScrollContainer`;function ye({data:e}){return(0,M.jsxs)(M.Fragment,{children:[e.caption&&(0,M.jsx)(he,{children:e.caption}),e.head&&(0,M.jsx)(fe,{children:(0,M.jsx)(de,{children:e.head.map((e,t)=>(0,M.jsx)(le,{children:e},t))})}),e.body&&(0,M.jsx)(pe,{children:e.body.map((e,t)=>(0,M.jsx)(de,{children:e.map((e,t)=>(0,M.jsx)(ue,{children:e},t))},t))}),e.foot&&(0,M.jsx)(me,{children:(0,M.jsx)(de,{children:e.foot.map((e,t)=>(0,M.jsx)(le,{children:e},t))})})]})}ye.displayName=`@mantine/core/TableDataRenderer`;var be={withRowBorders:!0,verticalSpacing:7},xe=c((e,{layout:t,captionSide:n,horizontalSpacing:i,verticalSpacing:a,borderColor:o,stripedColor:s,highlightOnHoverColor:c,striped:l,highlightOnHover:u,stickyHeaderOffset:d,stickyHeader:f})=>({table:{"--table-layout":t,"--table-caption-side":n,"--table-horizontal-spacing":h(i),"--table-vertical-spacing":h(a),"--table-border-color":o?r(o,e):void 0,"--table-striped-color":l&&s?r(s,e):void 0,"--table-highlight-on-hover-color":u&&c?r(c,e):void 0,"--table-sticky-header-offset":f?m(d):void 0}})),P=s(e=>{let r=i(`Table`,be,e),{classNames:a,className:o,style:s,styles:c,unstyled:l,vars:u,horizontalSpacing:d,verticalSpacing:f,captionSide:p,stripedColor:m,highlightOnHoverColor:h,striped:g,highlightOnHover:_,withColumnBorders:v,withRowBorders:y,withTableBorder:b,borderColor:x,layout:S,data:C,children:w,stickyHeader:E,stickyHeaderOffset:D,mod:O,tabularNums:k,attributes:ee,...te}=r,A=t({name:`Table`,props:r,className:o,style:s,classes:oe,classNames:a,styles:c,unstyled:l,attributes:ee,rootSelector:`table`,vars:u,varsResolver:xe,stable:!0}),j=g===!0?`odd`:g||void 0,ne=p||`bottom`,N=(0,T.useMemo)(()=>({getStyles:A,stickyHeader:E,striped:j,highlightOnHover:_,withColumnBorders:v,withRowBorders:y,captionSide:ne}),[A,E,j,_,v,y,ne]);return(0,M.jsx)(ie,{value:N,children:(0,M.jsx)(n,{component:`table`,mod:[{withTableBorder:b,tabularNums:k},O],...A(`table`),...te,children:w||!!C&&(0,M.jsx)(ye,{data:C})})})});P.classes=oe,P.varsResolver=xe,P.displayName=`@mantine/core/Table`,P.Td=ue,P.Th=le,P.Tr=de,P.Thead=fe,P.Tbody=pe,P.Tfoot=me,P.Caption=he,P.ScrollContainer=ve,P.DataRenderer=ye;var Se=new Map([[`bold`,T.createElement(T.Fragment,null,T.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`,T.createElement(T.Fragment,null,T.createElement(`path`,{d:`M208,96l-80,80L48,96Z`,opacity:`0.2`}),T.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`,T.createElement(T.Fragment,null,T.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`,T.createElement(T.Fragment,null,T.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`,T.createElement(T.Fragment,null,T.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`,T.createElement(T.Fragment,null,T.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`}))]]),Ce=T.forwardRef((e,t)=>T.createElement(f,{ref:t,...e,weights:Se}));Ce.displayName=`CaretDownIcon`;var we=Ce;function Te(e,t){let n=t||{};return(e[e.length-1]===``?[...e,``]:e).join((n.padRight?` `:``)+`,`+(n.padLeft===!1?``:` `)).trim()}var Ee=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,De=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Oe={};function ke(e,t){return((t||Oe).jsx?De:Ee).test(e)}var Ae=/[ \t\n\f\r]/g;function je(e){return typeof e==`object`?e.type===`text`&&Me(e.value):Me(e)}function Me(e){return e.replace(Ae,``)===``}var Ne=class{constructor(e,t,n){this.normal=t,this.property=e,n&&(this.space=n)}};Ne.prototype.normal={},Ne.prototype.property={},Ne.prototype.space=void 0;function Pe(e,t){let n={},r={};for(let t of e)Object.assign(n,t.property),Object.assign(r,t.normal);return new Ne(n,r,t)}function Fe(e){return e.toLowerCase()}var F=class{constructor(e,t){this.attribute=t,this.property=e}};F.prototype.attribute=``,F.prototype.booleanish=!1,F.prototype.boolean=!1,F.prototype.commaOrSpaceSeparated=!1,F.prototype.commaSeparated=!1,F.prototype.defined=!1,F.prototype.mustUseProperty=!1,F.prototype.number=!1,F.prototype.overloadedBoolean=!1,F.prototype.property=``,F.prototype.spaceSeparated=!1,F.prototype.space=void 0;var Ie=v({boolean:()=>I,booleanish:()=>L,commaOrSpaceSeparated:()=>B,commaSeparated:()=>ze,number:()=>R,overloadedBoolean:()=>Re,spaceSeparated:()=>z}),Le=0,I=Be(),L=Be(),Re=Be(),R=Be(),z=Be(),ze=Be(),B=Be();function Be(){return 2**++Le}var Ve=Object.keys(Ie),He=class extends F{constructor(e,t,n,r){let i=-1;if(super(e,t),Ue(this,`space`,r),typeof n==`number`)for(;++i4&&n.slice(0,4)===`data`&&nt.test(t)){if(t.charAt(4)===`-`){let e=t.slice(5).replace(tt,at);r=`data`+e.charAt(0).toUpperCase()+e.slice(1)}else{let e=t.slice(4);if(!tt.test(e)){let n=e.replace(et,it);n.charAt(0)!==`-`&&(n=`-`+n),t=`data`+n}}i=He}return new i(r,t)}function it(e){return`-`+e.toLowerCase()}function at(e){return e.charAt(1).toUpperCase()}var ot=Pe([Ge,Je,Xe,Ze,Qe],`html`),st=Pe([Ge,Ye,Xe,Ze,Qe],`svg`);function ct(e){return e.join(` `).trim()}var lt=p(((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(` +import{$ as e,A as t,C as n,K as r,M as i,P as a,St as o,T as s,X as c,Z as l,_ as u,_t as d,a as f,bt as p,ft as m,lt as h,nt as g,vt as _,xt as v,yt as y,z as b}from"./brand-B8x2UvAx.js";import{m as x}from"./preload-helper-GZwLLn44.js";import{E as S,S as C,o as w}from"./Tooltip-BP7AB724.js";var T=o(y(),1),E=o(_(),1);function D(e){if(!e||typeof e==`string`)return 0;let t=e/36;return Math.round((4+15*t**.25+t/5)*10)}function O(e){return e.current?e.current.scrollHeight:`auto`}function k(e){return typeof e==`number`&&e>0}function ee({transitionDuration:t,transitionTimingFunction:n=`ease`,onTransitionEnd:r,onTransitionStart:i,expanded:a,keepMounted:o}){let s={height:0,overflow:`hidden`,...o?{}:{display:`none`}},c=(0,T.useEffectEvent)(()=>i?.()),l=(0,T.useEffectEvent)(()=>r?.()),u=(0,T.useRef)(null),[d,f]=(0,T.useState)(a?{}:s),[p,m]=(0,T.useState)(a?`entered`:`exited`),h=e=>{(0,E.flushSync)(()=>f(e))},_=e=>{h(t=>({...t,...e}))},v=e=>{let r=t??D(e);return{transition:`height ${r}ms ${n}, opacity ${r}ms ${n}`}},y=(0,T.useRef)(0);g(()=>{y.current+=1;let e=y.current,n=()=>y.current===e;t!==0&&c(),a?window.requestAnimationFrame(()=>{n()&&u.current&&((0,E.flushSync)(()=>m(`entering`)),_({willChange:`height`,display:`block`,overflow:`hidden`}),window.requestAnimationFrame(()=>{if(!n()||!u.current)return;let e=O(u);if(!k(e)){h({}),m(`entered`),l();return}_({...v(e),height:e})}))}):window.requestAnimationFrame(()=>{if(!n()||!u.current)return;(0,E.flushSync)(()=>m(`exiting`));let e=O(u);if(!k(e)){h(s),m(`exited`),l();return}_({...v(e),willChange:`height`,height:e}),window.requestAnimationFrame(()=>{n()&&u.current&&_({height:0,overflow:`hidden`})})})},[a]);let b=e=>{if(e.target===u.current&&e.propertyName===`height`){if(a){let e=O(u);e===d.height?h({}):_({height:e}),m(`entered`),l()}else d.height===0&&(h(s),m(`exited`),l())}};return{state:p,getCollapseProps:t=>({"aria-hidden":!a,inert:!a,ref:e(u,t?.ref),onTransitionEnd:b,style:{boxSizing:`border-box`,...t?.style,...d}})}}function te(e){if(!e||typeof e==`string`)return 0;let t=e/36;return Math.round((4+15*t**.25+t/5)*10)}function A(e){return e.current?e.current.scrollWidth:`auto`}function j({transitionDuration:t,transitionTimingFunction:n=`ease`,onTransitionEnd:r,onTransitionStart:i,expanded:a,keepMounted:o}){let s={width:0,overflow:`hidden`,...o?{}:{display:`none`}},c=(0,T.useEffectEvent)(()=>i?.()),l=(0,T.useEffectEvent)(()=>r?.()),u=(0,T.useRef)(null),[d,f]=(0,T.useState)(a?{}:s),[p,m]=(0,T.useState)(a?`entered`:`exited`),h=e=>{(0,E.flushSync)(()=>f(e))},_=e=>{h(t=>({...t,...e}))},v=e=>{let r=t??te(e);return{transition:`width ${r}ms ${n}, opacity ${r}ms ${n}`}},y=(0,T.useRef)(0);g(()=>{y.current+=1;let e=y.current,n=()=>y.current===e;t!==0&&c(),a?window.requestAnimationFrame(()=>{n()&&u.current&&((0,E.flushSync)(()=>m(`entering`)),_({willChange:`width`,display:`block`,overflow:`hidden`}),window.requestAnimationFrame(()=>{if(!n()||!u.current)return;let e=A(u);if(!k(e)){h({}),m(`entered`),l();return}_({...v(e),width:e})}))}):window.requestAnimationFrame(()=>{if(!n()||!u.current)return;(0,E.flushSync)(()=>m(`exiting`));let e=A(u);if(!k(e)){h(s),m(`exited`),l();return}_({...v(e),willChange:`width`,width:e}),window.requestAnimationFrame(()=>{n()&&u.current&&_({width:0,overflow:`hidden`})})})},[a]);let b=e=>{if(e.target===u.current&&e.propertyName===`width`){if(a){let e=A(u);e===d.width?h({}):_({width:e}),m(`entered`),l()}else d.width===0&&(h(s),m(`exited`),l())}};return{state:p,getCollapseProps:t=>({"aria-hidden":!a,inert:!a,ref:e(u,t?.ref),onTransitionEnd:b,style:{boxSizing:`border-box`,...t?.style,...d}})}}function ne(){return`development`}var M=d(),N={transitionDuration:200,transitionTimingFunction:`ease`,animateOpacity:!0,orientation:`vertical`,keepMounted:!0,keepMountedMode:`activity`},re=s(e=>{let{children:t,expanded:r,transitionDuration:o,transitionTimingFunction:s,style:c,onTransitionEnd:u,onTransitionStart:d,animateOpacity:f,keepMounted:p,keepMountedMode:m,ref:h,orientation:g,..._}=i(`Collapse`,N,e),v=b(),y=a(),x=l(),S=y.respectReducedMotion&&x?0:o,w=(g===`horizontal`?j:ee)({expanded:r,transitionDuration:S,transitionTimingFunction:s,onTransitionEnd:u,onTransitionStart:d,keepMounted:!1});if(S===0)return p===!0&&(m===`display-none`||v!==`test`)?m===`display-none`?(0,M.jsx)(n,{..._,style:{...C(c,y),...r?{}:{display:`none`}},ref:h,children:t}):(0,M.jsx)(T.Activity,{mode:r?`visible`:`hidden`,children:(0,M.jsx)(n,{..._,style:c,ref:h,children:t})}):r?(0,M.jsx)(n,{..._,style:c,ref:h,children:t}):null;let E=w.state===`exited`,D;return D=p===!1?E?null:t:p===!0?m===`display-none`?t:(0,M.jsx)(T.Activity,{mode:E?`hidden`:`visible`,children:t}):t,(0,M.jsx)(n,{..._,...w.getCollapseProps({style:{opacity:r||!f?1:0,transition:f?`opacity ${S}ms ${s}`:`none`,...C(c,y),...p&&m===`display-none`&&E?{display:`none`}:{}},ref:h}),children:D})});re.displayName=`@mantine/core/Collapse`;var[ie,ae]=S(`Table component was not found in the tree`),oe={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`};function se(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 ce(e,t){let r=`Table${e.charAt(0).toUpperCase()}${e.slice(1)}`,a=s(a=>{let o=i(r,{},a),{classNames:s,className:c,style:l,styles:u,...d}=o,f=ae();return(0,M.jsx)(n,{component:e,...se(f,t),...f.getStyles(e,{className:c,classNames:s,style:l,styles:u,props:o}),...d})});return a.displayName=`@mantine/core/${r}`,a.classes=oe,a}var le=ce(`th`,{columnBorder:!0}),ue=ce(`td`,{columnBorder:!0}),de=ce(`tr`,{rowBorder:!0,striped:!0,highlightOnHover:!0}),fe=ce(`thead`,{stickyHeader:!0}),pe=ce(`tbody`),me=ce(`tfoot`),he=ce(`caption`,{captionSide:!0}),ge={type:`scrollarea`},_e=c((e,{minWidth:t,maxHeight:n,type:r})=>({scrollContainer:{"--table-min-width":m(t),"--table-max-height":m(n),"--table-overflow":r===`native`?`auto`:void 0}})),ve=s(e=>{let r=i(`TableScrollContainer`,ge,e),{classNames:a,className:o,style:s,styles:c,unstyled:l,vars:u,children:d,minWidth:f,maxHeight:p,type:m,scrollAreaProps:h,attributes:g,..._}=r,v=t({name:`TableScrollContainer`,classes:oe,props:r,className:o,style:s,classNames:a,styles:c,unstyled:l,attributes:g,vars:u,varsResolver:_e,rootSelector:`scrollContainer`});return(0,M.jsx)(n,{component:m===`scrollarea`?w:`div`,...m===`scrollarea`?p?{offsetScrollbars:`xy`,...h}:{offsetScrollbars:`x`,...h}:{},...v(`scrollContainer`),..._,children:(0,M.jsx)(`div`,{...v(`scrollContainerInner`),children:d})})});ve.classes=oe,ve.varsResolver=_e,ve.displayName=`@mantine/core/TableScrollContainer`;function ye({data:e}){return(0,M.jsxs)(M.Fragment,{children:[e.caption&&(0,M.jsx)(he,{children:e.caption}),e.head&&(0,M.jsx)(fe,{children:(0,M.jsx)(de,{children:e.head.map((e,t)=>(0,M.jsx)(le,{children:e},t))})}),e.body&&(0,M.jsx)(pe,{children:e.body.map((e,t)=>(0,M.jsx)(de,{children:e.map((e,t)=>(0,M.jsx)(ue,{children:e},t))},t))}),e.foot&&(0,M.jsx)(me,{children:(0,M.jsx)(de,{children:e.foot.map((e,t)=>(0,M.jsx)(le,{children:e},t))})})]})}ye.displayName=`@mantine/core/TableDataRenderer`;var be={withRowBorders:!0,verticalSpacing:7},xe=c((e,{layout:t,captionSide:n,horizontalSpacing:i,verticalSpacing:a,borderColor:o,stripedColor:s,highlightOnHoverColor:c,striped:l,highlightOnHover:u,stickyHeaderOffset:d,stickyHeader:f})=>({table:{"--table-layout":t,"--table-caption-side":n,"--table-horizontal-spacing":h(i),"--table-vertical-spacing":h(a),"--table-border-color":o?r(o,e):void 0,"--table-striped-color":l&&s?r(s,e):void 0,"--table-highlight-on-hover-color":u&&c?r(c,e):void 0,"--table-sticky-header-offset":f?m(d):void 0}})),P=s(e=>{let r=i(`Table`,be,e),{classNames:a,className:o,style:s,styles:c,unstyled:l,vars:u,horizontalSpacing:d,verticalSpacing:f,captionSide:p,stripedColor:m,highlightOnHoverColor:h,striped:g,highlightOnHover:_,withColumnBorders:v,withRowBorders:y,withTableBorder:b,borderColor:x,layout:S,data:C,children:w,stickyHeader:E,stickyHeaderOffset:D,mod:O,tabularNums:k,attributes:ee,...te}=r,A=t({name:`Table`,props:r,className:o,style:s,classes:oe,classNames:a,styles:c,unstyled:l,attributes:ee,rootSelector:`table`,vars:u,varsResolver:xe,stable:!0}),j=g===!0?`odd`:g||void 0,ne=p||`bottom`,N=(0,T.useMemo)(()=>({getStyles:A,stickyHeader:E,striped:j,highlightOnHover:_,withColumnBorders:v,withRowBorders:y,captionSide:ne}),[A,E,j,_,v,y,ne]);return(0,M.jsx)(ie,{value:N,children:(0,M.jsx)(n,{component:`table`,mod:[{withTableBorder:b,tabularNums:k},O],...A(`table`),...te,children:w||!!C&&(0,M.jsx)(ye,{data:C})})})});P.classes=oe,P.varsResolver=xe,P.displayName=`@mantine/core/Table`,P.Td=ue,P.Th=le,P.Tr=de,P.Thead=fe,P.Tbody=pe,P.Tfoot=me,P.Caption=he,P.ScrollContainer=ve,P.DataRenderer=ye;var Se=new Map([[`bold`,T.createElement(T.Fragment,null,T.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`,T.createElement(T.Fragment,null,T.createElement(`path`,{d:`M208,96l-80,80L48,96Z`,opacity:`0.2`}),T.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`,T.createElement(T.Fragment,null,T.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`,T.createElement(T.Fragment,null,T.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`,T.createElement(T.Fragment,null,T.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`,T.createElement(T.Fragment,null,T.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`}))]]),Ce=T.forwardRef((e,t)=>T.createElement(f,{ref:t,...e,weights:Se}));Ce.displayName=`CaretDownIcon`;var we=Ce;function Te(e,t){let n=t||{};return(e[e.length-1]===``?[...e,``]:e).join((n.padRight?` `:``)+`,`+(n.padLeft===!1?``:` `)).trim()}var Ee=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,De=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Oe={};function ke(e,t){return((t||Oe).jsx?De:Ee).test(e)}var Ae=/[ \t\n\f\r]/g;function je(e){return typeof e==`object`?e.type===`text`&&Me(e.value):Me(e)}function Me(e){return e.replace(Ae,``)===``}var Ne=class{constructor(e,t,n){this.normal=t,this.property=e,n&&(this.space=n)}};Ne.prototype.normal={},Ne.prototype.property={},Ne.prototype.space=void 0;function Pe(e,t){let n={},r={};for(let t of e)Object.assign(n,t.property),Object.assign(r,t.normal);return new Ne(n,r,t)}function Fe(e){return e.toLowerCase()}var F=class{constructor(e,t){this.attribute=t,this.property=e}};F.prototype.attribute=``,F.prototype.booleanish=!1,F.prototype.boolean=!1,F.prototype.commaOrSpaceSeparated=!1,F.prototype.commaSeparated=!1,F.prototype.defined=!1,F.prototype.mustUseProperty=!1,F.prototype.number=!1,F.prototype.overloadedBoolean=!1,F.prototype.property=``,F.prototype.spaceSeparated=!1,F.prototype.space=void 0;var Ie=v({boolean:()=>I,booleanish:()=>L,commaOrSpaceSeparated:()=>B,commaSeparated:()=>ze,number:()=>R,overloadedBoolean:()=>Re,spaceSeparated:()=>z}),Le=0,I=Be(),L=Be(),Re=Be(),R=Be(),z=Be(),ze=Be(),B=Be();function Be(){return 2**++Le}var Ve=Object.keys(Ie),He=class extends F{constructor(e,t,n,r){let i=-1;if(super(e,t),Ue(this,`space`,r),typeof n==`number`)for(;++i4&&n.slice(0,4)===`data`&&nt.test(t)){if(t.charAt(4)===`-`){let e=t.slice(5).replace(tt,at);r=`data`+e.charAt(0).toUpperCase()+e.slice(1)}else{let e=t.slice(4);if(!tt.test(e)){let n=e.replace(et,it);n.charAt(0)!==`-`&&(n=`-`+n),t=`data`+n}}i=He}return new i(r,t)}function it(e){return`-`+e.toLowerCase()}function at(e){return e.charAt(1).toUpperCase()}var ot=Pe([Ge,Je,Xe,Ze,Qe],`html`),st=Pe([Ge,Ye,Xe,Ze,Qe],`svg`);function ct(e){return e.join(` `).trim()}var lt=p(((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})),ut=p((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(lt());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}})),dt=p((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))}})),ft=p(((e,t)=>{var n=(e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}})(ut()),r=dt();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})),pt=ht(`end`),mt=ht(`start`);function ht(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 gt(e){let t=mt(e),n=pt(e);if(t&&n)return{start:t,end:n}}function _t(e){return!e||typeof e!=`object`?``:`position`in e||`type`in e?yt(e.position):`start`in e||`end`in e?yt(e):`line`in e||`column`in e?vt(e):``}function vt(e){return bt(e&&e.line)+`:`+bt(e&&e.column)}function yt(e){return vt(e&&e.start)+`-`+vt(e&&e.end)}function bt(e){return e&&typeof e==`number`?e:1}var V=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=_t(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}};V.prototype.file=``,V.prototype.name=``,V.prototype.reason=``,V.prototype.message=``,V.prototype.stack=``,V.prototype.column=void 0,V.prototype.line=void 0,V.prototype.ancestors=void 0,V.prototype.cause=void 0,V.prototype.fatal=void 0,V.prototype.place=void 0,V.prototype.ruleId=void 0,V.prototype.source=void 0;var xt=o(ft(),1),St={}.hasOwnProperty,Ct=new Map,wt=/[A-Z]/g,Tt=new Set([`table`,`tbody`,`thead`,`tfoot`,`tr`]),Et=new Set([`td`,`th`]),Dt=`https://github.com/syntax-tree/hast-util-to-jsx-runtime`;function Ot(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=zt(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=Rt(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`?st:ot,stylePropertyNameCase:t.stylePropertyNameCase||`dom`,tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},a=kt(i,e,void 0);return a&&typeof a!=`string`?a:i.create(e,i.Fragment,{children:a||void 0},void 0)}function kt(e,t,n){if(t.type===`element`)return At(e,t,n);if(t.type===`mdxFlowExpression`||t.type===`mdxTextExpression`)return jt(e,t);if(t.type===`mdxJsxFlowElement`||t.type===`mdxJsxTextElement`)return Nt(e,t,n);if(t.type===`mdxjsEsm`)return Mt(e,t);if(t.type===`root`)return Pt(e,t,n);if(t.type===`text`)return Ft(e,t)}function At(e,t,n){let r=e.schema,i=r;t.tagName.toLowerCase()===`svg`&&r.space===`html`&&(i=st,e.schema=i),e.ancestors.push(t);let a=Gt(e,t.tagName,!1),o=Bt(e,t),s=Ht(e,t);return Tt.has(t.tagName)&&(s=s.filter(function(e){return typeof e!=`string`||!je(e)})),It(e,o,a,t),Lt(o,s),e.ancestors.pop(),e.schema=r,e.create(t,a,o,n)}function jt(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)}Kt(e,t.position)}function Mt(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);Kt(e,t.position)}function Nt(e,t,n){let r=e.schema,i=r;t.name===`svg`&&r.space===`html`&&(i=st,e.schema=i),e.ancestors.push(t);let a=t.name===null?e.Fragment:Gt(e,t.name,!0),o=Vt(e,t),s=Ht(e,t);return It(e,o,a,t),Lt(o,s),e.ancestors.pop(),e.schema=r,e.create(t,a,o,n)}function Pt(e,t,n){let r={};return Lt(r,Ht(e,t)),e.create(t,e.Fragment,r,n)}function Ft(e,t){return t.value}function It(e,t,n,r){typeof n!=`string`&&n!==e.Fragment&&e.passNode&&(t.node=r)}function Lt(e,t){if(t.length>0){let n=t.length>1?t:t[0];n&&(e.children=n)}}function Rt(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 zt(e,t){return n;function n(n,r,i,a){let o=Array.isArray(i.children),s=mt(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 Bt(e,t){let n={},r,i;for(i in t.properties)if(i!==`children`&&St.call(t.properties,i)){let a=Ut(e,i,t.properties[i]);if(a){let[i,o]=a;e.tableCellAlignToStyle&&i===`align`&&typeof o==`string`&&Et.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 Vt(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 Kt(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 Kt(e,t.position)}else a=r.value===null||r.value;n[i]=a}return n}function Ht(e,t){let n=[],r=-1,i=e.passKeys?new Map:Ct;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?(H(e,e.length,0,t),e):t}var an={}.hasOwnProperty;function on(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 W(e){return e.replace(/[\t\n\r ]+/g,` `).replace(/^ | $/g,``).toLowerCase().toUpperCase()}var G=_n(/[A-Za-z]/),K=_n(/[\dA-Za-z]/),un=_n(/[#-'*+\--9=?A-Z^-~]/);function dn(e){return e!==null&&(e<32||e===127)}var fn=_n(/\d/),pn=_n(/[\dA-Fa-f]/),mn=_n(/[!-/:-@[-`{-~]/);function q(e){return e!==null&&e<-2}function J(e){return e!==null&&(e<0||e===32)}function Y(e){return e===-2||e===-1||e===32}var hn=_n(/\p{P}|\p{S}/u),gn=_n(/\s/);function _n(e){return t;function t(t){return t!==null&&t>-1&&e.test(String.fromCharCode(t))}}function vn(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 X(e,t,n,r){let i=r?r-1:1/0,a=0;return o;function o(r){return Y(r)?(e.enter(n),s(r)):t(r)}function s(r){return Y(r)&&a++0&&Y(t)?(e.enter(r),c(t)):l(t)}function c(t){return Y(t)&&o=i?t(e):n(e)}}var bn={tokenize:xn};function xn(e){let t=e.attempt(this.parser.constructs.contentInitial,r,i),n;return t;function r(n){if(n===null){e.consume(n);return}return e.enter(`lineEnding`),e.consume(n),e.exit(`lineEnding`),X(e,t,`linePrefix`)}function i(t){return e.enter(`paragraph`),a(t)}function a(t){let r=e.enter(`chunkText`,{contentType:`text`,previous:n});return n&&(n.next=r),n=r,o(t)}function o(t){if(t===null){e.exit(`chunkText`),e.exit(`paragraph`),e.consume(t);return}return q(t)?(e.consume(t),e.exit(`chunkText`),a):(e.consume(t),o)}}var Sn=class{constructor(){this.index=new Map,this.map=[]}add(e,t,n){Cn(this,e,t,n,!1)}addBefore(e,t,n){Cn(this,e,t,n,!0)}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,this.index.clear()}};function Cn(e,t,n,r,i){if(n===0&&r.length===0)return;let a=e.index.get(t);if(a){a[1]+=n,i?(r.push(...a[2]),a[2]=r):a[2].push(...r);return}let o=[t,n,r];e.map.push(o),e.index.set(t,o)}var wn={tokenize:En},Tn={tokenize:Dn};function En(e){let t=this,n=[],r=0,i,a,o;return s;function s(i){if(ro))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 Dn(e,t,n){return X(e,e.attempt(this.parser.constructs.document,t,n),`linePrefix`,this.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)}function On(e){if(e===null||J(e)||gn(e))return 1;if(hn(e))return 2}function kn(e,t,n){let r=[],i=-1;for(;++i1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1,o={...e[i][1].end},s={...e[n][1].start};Nn(o,-a),Nn(s,a);let c={type:a>1?`strongSequence`:`emphasisSequence`,start:o,end:{...e[i][1].end}},l={type:a>1?`strongSequence`:`emphasisSequence`,start:{...e[n][1].start},end:s},u={type:a>1?`strongText`:`emphasisText`,start:{...e[i][1].end},end:{...e[n][1].start}},d={type:a>1?`strong`:`emphasis`,start:{...c.start},end:{...l.end}};e[i][1].end={...c.start},e[n][1].start={...l.end},r=[],e[i][1].end.offset-e[i][1].start.offset&&(r=U(r,[[`enter`,e[i][1],t],[`exit`,e[i][1],t]])),r=U(r,[[`enter`,d,t],[`enter`,c,t],[`exit`,c,t],[`enter`,u,t]]),r=U(r,kn(t.parser.constructs.insideSpan.null,e.slice(i+1,n),t)),r=U(r,[[`exit`,u,t],[`enter`,l,t],[`exit`,l,t],[`exit`,d,t]]);let f=0;e[n][1].end.offset-e[n][1].start.offset&&(f=2,r=U(r,[[`enter`,e[n][1],t],[`exit`,e[n][1],t]])),H(e,i-1,n-i+3,r),n=i+r.length-f-2;break}}for(n=-1;++n0&&Y(t)?X(e,v,`linePrefix`,a+1)(t):v(t)}function v(t){return t===null||q(t)?e.check(Kn,h,b)(t):(e.enter(`codeFlowValue`),y(t))}function y(t){return t===null||q(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`),Y(t)?X(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`),Y(t)?X(e,d,`whitespace`)(t):d(t)):n(t)}function d(r){return r===null||q(r)?(e.exit(`codeFencedFence`),t(r)):n(r)}}}var Xn={name:`codeIndented`,tokenize:Qn},Zn={partial:!0,tokenize:$n};function Qn(e,t,n){return r;function r(t){return e.enter(`codeIndented`),yn(e,i,n,`linePrefix`,4,4)(t)}function i(t){return t===null?o(t):q(t)?e.attempt(Zn,i,o)(t):(e.enter(`codeFlowValue`),a(t))}function a(t){return t===null||q(t)?(e.exit(`codeFlowValue`),i(t)):(e.consume(t),a)}function o(n){return e.exit(`codeIndented`),t(n)}}function $n(e,t,n){let r=this;return i;function i(o){return r.parser.lazy[r.now().line]?n(o):q(o)?(e.enter(`lineEnding`),e.consume(o),e.exit(`lineEnding`),i):yn(e,t,a,`linePrefix`,4,4)(o)}function a(e){return q(e)?i(e):n(e)}}var er={name:`codeText`,previous:nr,resolve:tr,tokenize:rr};function tr(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&&ar(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),ar(this.left,e)}unshift(e){this.setCursor(0),this.right.push(e)}unshiftMany(e){this.setCursor(0),ar(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 pr(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||dn(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||q(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||J(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):q(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||q(t)||s++>999?(e.exit(`chunkString`),u(t)):(e.consume(t),c||=!Y(t),t===92?f:d)}function f(t){return t===91||t===92||t===93?(e.consume(t),s++,d):d(t)}}function hr(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):q(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),X(e,l,`linePrefix`)):(e.enter(`chunkString`,{contentType:`string`}),u(t))}function u(t){return t===o||t===null||q(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 gr(e,t){let n;return r;function r(i){return q(i)?(e.enter(`lineEnding`),e.consume(i),e.exit(`lineEnding`),n=!0,r):Y(i)?X(e,r,n?`linePrefix`:`lineSuffix`)(i):t(i)}}var _r={name:`definition`,tokenize:yr},vr={partial:!0,tokenize:br};function yr(e,t,n){let r=this,i;return a;function a(t){return e.enter(`definition`),o(t)}function o(t){return mr.call(r,e,s,n,`definitionLabel`,`definitionLabelMarker`,`definitionLabelString`)(t)}function s(t){return i=W(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 J(t)?gr(e,l)(t):l(t)}function l(t){return pr(e,u,n,`definitionDestination`,`definitionDestinationLiteral`,`definitionDestinationLiteralMarker`,`definitionDestinationRaw`,`definitionDestinationString`)(t)}function u(t){return e.attempt(vr,d,d)(t)}function d(t){return Y(t)?X(e,f,`whitespace`)(t):f(t)}function f(a){return a===null||q(a)?(e.exit(`definition`),r.parser.defined.push(i),t(a)):n(a)}}function br(e,t,n){return r;function r(t){return J(t)?gr(e,i)(t):n(t)}function i(t){return hr(e,a,n,`definitionTitle`,`definitionTitleMarker`,`definitionTitleString`)(t)}function a(t){return Y(t)?X(e,o,`whitespace`)(t):o(t)}function o(e){return e===null||q(e)?t(e):n(e)}}var xr={name:`hardBreakEscape`,tokenize:Sr};function Sr(e,t,n){return r;function r(t){return e.enter(`hardBreakEscape`),e.consume(t),i}function i(r){return q(r)?(e.exit(`hardBreakEscape`),t(r)):n(r)}}var Cr={name:`headingAtx`,resolve:wr,tokenize:Tr};function wr(e,t){let n=e.length-2,r=3;if(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){let 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`};H(e,r,n-r+1,[[`enter`,i,t],[`enter`,a,t],[`exit`,a,t],[`exit`,i,t]])}return e}function Tr(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||J(t)?(e.exit(`atxHeadingSequence`),s(t)):n(t)}function s(n){return n===35?(e.enter(`atxHeadingSequence`),c(n)):n===null||q(n)?(e.exit(`atxHeading`),t(n)):Y(n)?X(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||J(t)?(e.exit(`atxHeadingText`),s(t)):(e.consume(t),l)}}var Er=`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(`.`),Dr=[`pre`,`script`,`style`,`textarea`],Or={concrete:!0,name:`htmlFlow`,resolveTo:Ar,tokenize:jr},kr={partial:!0,tokenize:Mr};function Ar(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 jr(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:N):G(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):G(a)?(e.consume(a),i=4,r.interrupt?t:N):n(a)}function p(i){return i===45?(e.consume(i),r.interrupt?t:N):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 G(t)?(e.consume(t),o=String.fromCharCode(t),g):n(t)}function g(s){if(s===null||s===47||s===62||J(s)){let c=s===47,l=o.toLowerCase();return!c&&!a&&Dr.includes(l)?(i=1,r.interrupt?t(s):O(s)):Er.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||K(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 Y(t)?(e.consume(t),v):E(t)}function y(t){return t===47?(e.consume(t),E):t===58||t===95||G(t)?(e.consume(t),b):Y(t)?(e.consume(t),y):E(t)}function b(t){return t===45||t===46||t===58||t===95||K(t)?(e.consume(t),b):x(t)}function x(t){return t===61?(e.consume(t),S):Y(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):Y(t)?(e.consume(t),S):w(t)}function C(t){return t===c?(e.consume(t),c=null,T):t===null||q(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||J(t)?x(t):(e.consume(t),w)}function T(e){return e===47||e===62||Y(e)?y(e):n(e)}function E(t){return t===62?(e.consume(t),D):n(t)}function D(t){return t===null||q(t)?O(t):Y(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),re):t===63&&i===3?(e.consume(t),N):t===93&&i===5?(e.consume(t),M):q(t)&&(i===6||i===7)?(e.exit(`htmlFlowData`),e.check(kr,ie,k)(t)):t===null||q(t)?(e.exit(`htmlFlowData`),k(t)):(e.consume(t),O)}function k(t){return e.check(Kn,ee,ie)(t)}function ee(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),te}function te(t){return t===null||q(t)?k(t):(e.enter(`htmlFlowData`),O(t))}function A(t){return t===45?(e.consume(t),N):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 Dr.includes(n)?(e.consume(t),re):O(t)}return G(t)&&o.length<8?(e.consume(t),o+=String.fromCharCode(t),ne):O(t)}function M(t){return t===93?(e.consume(t),N):O(t)}function N(t){return t===62?(e.consume(t),re):t===45&&i===2?(e.consume(t),N):O(t)}function re(t){return t===null||q(t)?(e.exit(`htmlFlowData`),ie(t)):(e.consume(t),re)}function ie(n){return e.exit(`htmlFlow`),t(n)}}function Mr(e,t,n){return r;function r(r){return e.enter(`lineEnding`),e.consume(r),e.exit(`lineEnding`),e.attempt(In,t,n)}}var Nr={name:`htmlText`,tokenize:Pr};function Pr(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):G(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):G(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):q(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):q(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):q(t)?(o=v,j(t)):(e.consume(t),v)}function y(t){return t===null?n(t):t===63?(e.consume(t),b):q(t)?(o=y,j(t)):(e.consume(t),y)}function b(e){return e===62?A(e):y(e)}function x(t){return G(t)?(e.consume(t),S):n(t)}function S(t){return t===45||K(t)?(e.consume(t),S):C(t)}function C(t){return q(t)?(o=C,j(t)):Y(t)?(e.consume(t),C):A(t)}function w(t){return t===45||K(t)?(e.consume(t),w):t===47||t===62||J(t)?T(t):n(t)}function T(t){return t===47?(e.consume(t),A):t===58||t===95||G(t)?(e.consume(t),E):q(t)?(o=T,j(t)):Y(t)?(e.consume(t),T):A(t)}function E(t){return t===45||t===46||t===58||t===95||K(t)?(e.consume(t),E):D(t)}function D(t){return t===61?(e.consume(t),O):q(t)?(o=D,j(t)):Y(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):q(t)?(o=O,j(t)):Y(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):q(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||J(t)?T(t):(e.consume(t),ee)}function te(e){return e===47||e===62||J(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 Y(t)?X(e,M,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):M(t)}function M(t){return e.enter(`htmlTextData`),o(t)}}var Fr={name:`labelEnd`,resolveAll:zr,resolveTo:Br,tokenize:Vr},Ir={tokenize:Hr},Lr={tokenize:Ur},Rr={tokenize:Wr};function zr(e){let t=-1,n=[];for(;++t0&&i[i.length-1]._balanced;)i.pop();a=i[i.length-1]}return s;function s(t){return a?a._inactive?d(t):(o=r.parser.defined.includes(W(r.sliceSerialize({start:a.end,end:r.now()}))),e.enter(`labelEnd`),e.enter(`labelMarker`),e.consume(t),e.exit(`labelMarker`),e.exit(`labelEnd`),c):n(t)}function c(t){return t===40?e.attempt(Ir,u,o?u:d)(t):t===91?e.attempt(Lr,u,o?l:d)(t):o?u(t):d(t)}function l(t){return e.attempt(Rr,u,d)(t)}function u(e){return i.pop(),t(e)}function d(e){return a._balanced=!0,n(e)}}function Hr(e,t,n){return r;function r(t){return e.enter(`resource`),e.enter(`resourceMarker`),e.consume(t),e.exit(`resourceMarker`),i}function i(t){return J(t)?gr(e,a)(t):a(t)}function a(t){return t===41?u(t):pr(e,o,s,`resourceDestination`,`resourceDestinationLiteral`,`resourceDestinationLiteralMarker`,`resourceDestinationRaw`,`resourceDestinationString`,32)(t)}function o(t){return J(t)?gr(e,c)(t):u(t)}function s(e){return n(e)}function c(t){return t===34||t===39||t===40?hr(e,l,n,`resourceTitle`,`resourceTitleMarker`,`resourceTitleString`)(t):u(t)}function l(t){return J(t)?gr(e,u)(t):u(t)}function u(r){return r===41?(e.enter(`resourceMarker`),e.consume(r),e.exit(`resourceMarker`),e.exit(`resource`),t):n(r)}}function Ur(e,t,n){let r=this;return i;function i(t){return mr.call(r,e,a,o,`reference`,`referenceMarker`,`referenceString`)(t)}function a(e){return r.parser.defined.includes(W(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(e):n(e)}function o(e){return n(e)}}function Wr(e,t,n){return r;function r(t){return e.enter(`reference`),e.enter(`referenceMarker`),e.consume(t),e.exit(`referenceMarker`),i}function i(r){return r===93?(e.enter(`referenceMarker`),e.consume(r),e.exit(`referenceMarker`),e.exit(`reference`),t):n(r)}}var Gr={name:`labelStartImage`,resolveAll:Fr.resolveAll,tokenize:Kr};function Kr(e,t,n){let r=this,i;return a;function a(t){return e.enter(`labelImage`),e.enter(`labelImageMarker`),e.consume(t),e.exit(`labelImageMarker`),o}function o(t){return t===91?(e.enter(`labelMarker`),e.consume(t),e.exit(`labelMarker`),i=e.exit(`labelImage`),s):n(t)}function s(e){return e===94&&`_hiddenFootnoteSupport`in r.parser.constructs?n(e):(r._labelStarts=r._labelStarts||[],r._labelStarts.push(i),t(e))}}var qr={name:`labelStartLink`,resolveAll:Fr.resolveAll,tokenize:Jr};function Jr(e,t,n){let r=this,i;return a;function a(t){return e.enter(`labelLink`),e.enter(`labelMarker`),e.consume(t),e.exit(`labelMarker`),i=e.exit(`labelLink`),o}function o(e){return e===94&&`_hiddenFootnoteSupport`in r.parser.constructs?n(e):(r._labelStarts=r._labelStarts||[],r._labelStarts.push(i),t(e))}}var Yr={name:`lineEnding`,tokenize:Xr};function Xr(e,t){return n;function n(n){return e.enter(`lineEnding`),e.consume(n),e.exit(`lineEnding`),X(e,t,`linePrefix`)}}var Zr={name:`thematicBreak`,tokenize:Qr};function Qr(e,t,n){let r=0,i;return a;function a(t){return e.enter(`thematicBreak`),o(t)}function o(e){return i=e,s(e)}function s(a){return a===i?(e.enter(`thematicBreakSequence`),c(a)):r>=3&&(a===null||q(a))?(e.exit(`thematicBreak`),t(a)):n(a)}function c(t){return t===i?(e.consume(t),r++,c):(e.exit(`thematicBreakSequence`),Y(t)?X(e,s,`whitespace`)(t):s(t))}}var Z={continuation:{tokenize:ni},exit:ii,name:`list`,tokenize:ti},$r={partial:!0,tokenize:ai},ei={partial:!0,tokenize:ri};function ti(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:fn(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(Zr,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 fn(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(In,r.interrupt?n:u,e.attempt($r,f,d))}function u(e){return r.containerState.initialBlankLine=!0,a++,f(e)}function d(t){return Y(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 ni(e,t,n){let r=this;return r.containerState._closeFlow=void 0,e.check(In,i,a);function i(n){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,X(e,t,`listItemIndent`,r.containerState.size+1)(n)}function a(n){return r.containerState.furtherBlankLines||!Y(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(ei,t,o)(n))}function o(i){return r.containerState._closeFlow=!0,r.interrupt=void 0,X(e,e.attempt(Z,t,n),`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(i)}}function ri(e,t,n){let r=this;return X(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 ii(e){e.exit(this.containerState.type)}function ai(e,t,n){let r=this;return X(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!Y(e)&&i&&i[1].type===`listItemPrefixWhitespace`?t(e):n(e)}}var oi={name:`setextUnderline`,resolveTo:si,tokenize:ci};function si(e,t){let n=new Sn,r=e.length,i,a,o;for(;r--;)if(e[r][0]===`enter`){if(e[r][1].type===`content`){i=r;break}e[r][1].type===`paragraph`&&(a=r)}else e[r][1].type===`content`&&n.add(r,1,[]),!o&&e[r][1].type===`definition`&&(o=r);let s={type:`setextHeading`,start:{...e[i][1].start},end:{...e[e.length-1][1].end}};return e[a][1].type=`setextHeadingText`,o?(n.add(a,0,[[`enter`,s,t]]),n.add(o+1,0,[[`exit`,e[i][1],t]]),e[i][1].end={...e[o][1].end}):e[i][1]=s,n.add(e.length,0,[[`exit`,s,t]]),n.consume(e),e}function ci(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`),Y(t)?X(e,c,`lineSuffix`)(t):c(t))}function c(r){return r===null||q(r)?(e.exit(`setextHeadingLine`),t(r)):n(r)}}var li={tokenize:ui};function ui(e){let t=this,n=e.attempt(In,r,e.attempt(this.parser.constructs.flowInitial,i,X(e,e.attempt(this.parser.constructs.flow,i,e.attempt(cr,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 di={resolveAll:hi()},fi=mi(`string`),pi=mi(`text`);function mi(e){return{resolveAll:hi(e===`text`?gi: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(;++iTi,contentInitial:()=>yi,disable:()=>Ei,document:()=>vi,flow:()=>xi,flowInitial:()=>bi,insideSpan:()=>wi,string:()=>Si,text:()=>Ci}),vi={42:Z,43:Z,45:Z,48:Z,49:Z,50:Z,51:Z,52:Z,53:Z,54:Z,55:Z,56:Z,57:Z,62:Rn},yi={91:_r},bi={[-2]:Xn,[-1]:Xn,32:Xn},xi={35:Cr,42:Zr,45:[oi,Zr],60:Or,61:oi,95:Zr,96:Jn,126:Jn},Si={38:Wn,92:Hn},Ci={[-5]:Yr,[-4]:Yr,[-3]:Yr,33:Gr,38:Wn,42:An,60:[Pn,Nr],91:qr,92:[xr,Hn],93:Fr,95:An,96:er},wi={null:[An,di]},Ti={null:[42,95]},Ei={null:[]};function Di(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=U(o,e),g(),o[o.length-1]===null?(w(t,0),l.events=kn(a,l.events,l),l.events):[]}function f(e,t){return ki(p(e),t)}function p(e){return Oi(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(){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 ki(e,t){let n=-1,r=[],i;for(;++n0){let e=a.tokenStack[a.tokenStack.length-1];(e[1]||Ui).call(a,void 0,e[0])}for(r.position={start:Bi(e.length>0?e[0][1].start:{line:1,column:1,offset:0}),end:Bi(e.length>0?e[e.length-2][1].end:{line:1,column:1,offset:0})},d=-1;++dvoid c({to:`/dashboards/$dashboardId`,params:{dashboardId:t},search:r(n),replace:i,resetScroll:t!==e});return(0,o.jsx)(i,{dashboardId:e,search:s,onSearch:(t,n)=>l(e,t,n),onOpen:(e,t)=>l(e,{},t)})}export{s as component}; \ No newline at end of file +import{_t as e}from"./brand-B8x2UvAx.js";import{d as t}from"./auth-BBLbNg3S.js";import{_ as n,b as r}from"./theme-CNgJAwSb.js";import{t as i}from"./page-DXpYvlEo.js";import{t as a}from"./index-CvasF-jN.js";var o=e();function s(){let{dashboardId:e}=a.useParams(),s=n(a.useSearch()),c=t(),l=(t,n,i)=>void c({to:`/dashboards/$dashboardId`,params:{dashboardId:t},search:r(n),replace:i,resetScroll:t!==e});return(0,o.jsx)(i,{dashboardId:e,search:s,onSearch:(t,n)=>l(e,t,n),onOpen:(e,t)=>l(e,{},t)})}export{s as component}; \ No newline at end of file diff --git a/internal/ui/dist/assets/dashboards.index-DSrwtH-W.js b/internal/ui/dist/assets/dashboards.index-AbQDHFtj.js similarity index 55% rename from internal/ui/dist/assets/dashboards.index-DSrwtH-W.js rename to internal/ui/dist/assets/dashboards.index-AbQDHFtj.js index 54fd5e5d5..a290deeec 100644 --- a/internal/ui/dist/assets/dashboards.index-DSrwtH-W.js +++ b/internal/ui/dist/assets/dashboards.index-AbQDHFtj.js @@ -1 +1 @@ -import{_t as e}from"./brand-B8x2UvAx.js";import{d as t}from"./auth-DQIRmg9h.js";import{_ as n,b as r}from"./theme-DGoiBK3l.js";import{t as i}from"./page-C2G9EzC7.js";import{n as a}from"./index-C23tbW7l.js";var o=e();function s(){let e=n(a.useSearch()),s=t();return(0,o.jsx)(i,{search:e,onSearch:()=>void 0,onOpen:(t,n)=>void s({to:`/dashboards/$dashboardId`,params:{dashboardId:t},search:r(e),replace:n})})}export{s as component}; \ No newline at end of file +import{_t as e}from"./brand-B8x2UvAx.js";import{d as t}from"./auth-BBLbNg3S.js";import{_ as n,b as r}from"./theme-CNgJAwSb.js";import{t as i}from"./page-DXpYvlEo.js";import{n as a}from"./index-CvasF-jN.js";var o=e();function s(){let e=n(a.useSearch()),s=t();return(0,o.jsx)(i,{search:e,onSearch:()=>void 0,onOpen:(t,n)=>void s({to:`/dashboards/$dashboardId`,params:{dashboardId:t},search:r(e),replace:n})})}export{s as component}; \ No newline at end of file diff --git a/internal/ui/dist/assets/index-C23tbW7l.js b/internal/ui/dist/assets/index-CvasF-jN.js similarity index 57% rename from internal/ui/dist/assets/index-C23tbW7l.js rename to internal/ui/dist/assets/index-CvasF-jN.js index ff65b6a2c..2158fad00 100644 --- a/internal/ui/dist/assets/index-C23tbW7l.js +++ b/internal/ui/dist/assets/index-CvasF-jN.js @@ -1,20 +1,20 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/routes-BG-WXnZu.js","assets/brand-B8x2UvAx.js","assets/auth-DQIRmg9h.js","assets/settings-B84LToTG.js","assets/Tooltip-BP7AB724.js","assets/get-single-element-child-C3yy66_3.js","assets/useQuery-CJpHjMkr.js","assets/FocusTrap-yuoZ2xkr.js","assets/WarningCircle.es-D3vbL2zn.js","assets/chat.index-DBWfXIEO.js","assets/chat-C7NkH_Mg.js","assets/preload-helper-DYCQ0CsM.js","assets/dashboard-change-chips-DyBazwAN.js","assets/chat._threadId-DBWfXIEO.js","assets/dashboards.index-DSrwtH-W.js","assets/theme-DGoiBK3l.js","assets/use-computed-color-scheme-DxHBJokx.js","assets/page-C2G9EzC7.js","assets/dashboards._dashboardId-DIT-HJy_.js"])))=>i.map(i=>d[i]); -import{A as e,B as t,C as n,F as r,G as i,H as a,I as o,J as s,K as c,L as l,M as u,N as d,P as f,R as p,S as m,St as h,T as g,V as _,W as v,X as y,Y as b,_ as ee,_t as x,a as S,bt as C,c as te,ct as ne,d as w,dt as re,et as ie,f as ae,ft as T,gt as oe,ht as se,it as ce,k as le,lt as ue,mt as de,ot as fe,p as pe,pt as me,rt as he,t as ge,tt as _e,u as ve,vt as ye,w as be,xt as xe,y as Se,yt as Ce}from"./brand-B8x2UvAx.js";import{a as E,d as we,i as Te,n as Ee,p as De,r as Oe,s as ke,t as Ae,u as je}from"./auth-DQIRmg9h.js";import{A as Me,B as Ne,D as Pe,E as Fe,F as Ie,L as Le,M as Re,N as ze,O as Be,P as Ve,R as He,S as Ue,T as We,_ as Ge,a as Ke,b as qe,g as Je,i as Ye,j as Xe,k as Ze,m as Qe,n as $e,p as et,r as tt,s as nt,t as rt,u as it,v as at,w as ot,x as st,y as ct,z as lt}from"./preload-helper-DYCQ0CsM.js";import{A as ut,B as dt,E as ft,H as pt,Q as mt,S as ht,T as gt,U as _t,V as vt,W as yt,X as bt,Y as xt,Z as St,_ as Ct,a as wt,at as Tt,b as Et,ct as Dt,dt as Ot,et as kt,it as At,lt as jt,n as Mt,nt as Nt,ot as Pt,rt as Ft,st as It,t as Lt,tt as Rt,ut as zt,x as Bt,z as Vt}from"./theme-DGoiBK3l.js";import{E as Ht,T as Ut,o as Wt,t as Gt,x as Kt}from"./Tooltip-BP7AB724.js";import{n as qt,t as Jt}from"./use-computed-color-scheme-DxHBJokx.js";import{C as Yt,E as Xt,F as Zt,L as Qt,T as $t,_ as en,a as tn,b as nn,c as rn,d as an,f as on,g as sn,h as cn,l as ln,m as un,n as dn,o as fn,p as pn,r as mn,s as hn,t as gn,u as _n,v as vn,w as yn,y as bn}from"./useQuery-CJpHjMkr.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 xn=C((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 ee(e){if(h=!1,b(e),!m){if(n(c)!==null)m=!0,x||(x=!0,re());else{var t=n(l);t!==null&&T(ee,t.startTime-e)}}}var x=!1,S=-1,C=5,te=-1;function ne(){return g?!0:!(e.unstable_now()-tet&&ne());){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&&T(ee,u.startTime-t),i=!1}}break a}finally{d=null,f=a,p=!1}i=void 0}}finally{i?re():x=!1}}}var re;if(typeof y==`function`)re=function(){y(w)};else if(typeof MessageChannel<`u`){var ie=new MessageChannel,ae=ie.port2;ie.port1.onmessage=w,re=function(){ae.postMessage(null)}}else re=function(){_(w,0)};function T(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,T(ee,a-o))):(r.sortIndex=s,t(c,r),m||p||(m=!0,x||(x=!0,re()))),r},e.unstable_shouldYield=ne,e.unstable_wrapCallback=function(e){var t=f;return function(){var n=f;f=t;try{return e.apply(this,arguments)}finally{f=n}}}})),Sn=C(((e,t)=>{t.exports=xn()})),Cn=C((e=>{var t=Sn(),n=Ce(),r=ye();function i(e){var t=`https://react.dev/errors/`+e;if(1De||(e.current=Ee[De],Ee[De]=null,De--)}function Ae(e,t){De++,Ee[De]=e.current,e.current=t}var je=Oe(null),Me=Oe(null),Ne=Oe(null),Pe=Oe(null);function Fe(e,t){switch(Ae(Ne,t),Ae(Me,e),Ae(je,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?Cp(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=Cp(t),e=wp(t,e);else switch(e){case`svg`:e=1;break;case`math`:e=2;break;default:e=0}}ke(je),Ae(je,e)}function Ie(){ke(je),ke(Me),ke(Ne)}function Le(e){var t=e.memoizedState;t!==null&&(bh._currentValue=t.memoizedState,Ae(Pe,e)),t=je.current;var n=wp(t,e.type);t!==n&&(Ae(Me,e),Ae(je,n))}function Re(e){Me.current===e&&(ke(je),ke(Me)),Pe.current===e&&(ke(Pe),bh._currentValue=Te)}var ze,Be;function Ve(e){if(ze===void 0)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);ze=t&&t[1]||``,Be=-1i.map(i=>d[i]); +import{A as e,B as t,C as n,F as r,G as i,H as a,I as o,J as s,K as c,L as l,M as u,N as d,P as f,R as p,S as m,St as h,T as g,V as _,W as v,X as y,Y as b,_ as ee,_t as x,a as S,bt as C,c as te,ct as ne,d as w,dt as re,et as ie,f as ae,ft as T,gt as oe,ht as se,it as ce,k as le,lt as ue,mt as de,ot as fe,p as pe,pt as me,rt as he,t as ge,tt as _e,u as ve,vt as ye,w as be,xt as xe,y as Se,yt as Ce}from"./brand-B8x2UvAx.js";import{a as E,d as we,i as Te,n as Ee,p as De,r as Oe,s as ke,t as Ae,u as je}from"./auth-BBLbNg3S.js";import{A as Me,B as Ne,C as Pe,D as Fe,E as Ie,F as Le,I as Re,M as ze,N as Be,O as Ve,P as He,R as Ue,S as We,T as Ge,V as Ke,_ as qe,a as Je,b as Ye,h as Xe,i as Ze,j as Qe,k as $e,m as et,n as tt,r as nt,s as rt,t as it,u as at,v as ot,x as st,y as ct,z as lt}from"./preload-helper-GZwLLn44.js";import{A as ut,B as dt,E as ft,H as pt,Q as mt,S as ht,T as gt,U as _t,V as vt,W as yt,X as bt,Y as xt,Z as St,_ as Ct,a as wt,at as Tt,b as Et,ct as Dt,dt as Ot,et as kt,it as At,lt as jt,n as Mt,nt as Nt,ot as Pt,rt as Ft,st as It,t as Lt,tt as Rt,ut as zt,x as Bt,z as Vt}from"./theme-CNgJAwSb.js";import{E as Ht,T as Ut,o as Wt,t as Gt,x as Kt}from"./Tooltip-BP7AB724.js";import{n as qt,t as Jt}from"./use-computed-color-scheme-DxHBJokx.js";import{C as Yt,E as Xt,F as Zt,L as Qt,T as $t,_ as en,a as tn,b as nn,c as rn,d as an,f as on,g as sn,h as cn,l as ln,m as un,n as dn,o as fn,p as pn,r as mn,s as hn,t as gn,u as _n,v as vn,w as yn,y as bn}from"./useQuery-CJpHjMkr.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 xn=C((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 ee(e){if(h=!1,b(e),!m){if(n(c)!==null)m=!0,x||(x=!0,re());else{var t=n(l);t!==null&&T(ee,t.startTime-e)}}}var x=!1,S=-1,C=5,te=-1;function ne(){return g?!0:!(e.unstable_now()-tet&&ne());){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&&T(ee,u.startTime-t),i=!1}}break a}finally{d=null,f=a,p=!1}i=void 0}}finally{i?re():x=!1}}}var re;if(typeof y==`function`)re=function(){y(w)};else if(typeof MessageChannel<`u`){var ie=new MessageChannel,ae=ie.port2;ie.port1.onmessage=w,re=function(){ae.postMessage(null)}}else re=function(){_(w,0)};function T(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,T(ee,a-o))):(r.sortIndex=s,t(c,r),m||p||(m=!0,x||(x=!0,re()))),r},e.unstable_shouldYield=ne,e.unstable_wrapCallback=function(e){var t=f;return function(){var n=f;f=t;try{return e.apply(this,arguments)}finally{f=n}}}})),Sn=C(((e,t)=>{t.exports=xn()})),Cn=C((e=>{var t=Sn(),n=Ce(),r=ye();function i(e){var t=`https://react.dev/errors/`+e;if(1De||(e.current=Ee[De],Ee[De]=null,De--)}function Ae(e,t){De++,Ee[De]=e.current,e.current=t}var je=Oe(null),Me=Oe(null),Ne=Oe(null),Pe=Oe(null);function Fe(e,t){switch(Ae(Ne,t),Ae(Me,e),Ae(je,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?wp(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=wp(t),e=Tp(t,e);else switch(e){case`svg`:e=1;break;case`math`:e=2;break;default:e=0}}ke(je),Ae(je,e)}function Ie(){ke(je),ke(Me),ke(Ne)}function Le(e){var t=e.memoizedState;t!==null&&(xh._currentValue=t.memoizedState,Ae(Pe,e)),t=je.current;var n=Tp(t,e.type);t!==n&&(Ae(Me,e),Ae(je,n))}function Re(e){Me.current===e&&(ke(je),ke(Me)),Pe.current===e&&(ke(Pe),xh._currentValue=Te)}var ze,Be;function Ve(e){if(ze===void 0)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);ze=t&&t[1]||``,Be=-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{He=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:``)?Ve(n):``}function We(e,t){switch(e.tag){case 26:case 27:case 5:return Ve(e.type);case 16:return Ve(`Lazy`);case 13:return e.child!==t&&t!==null?Ve(`Suspense Fallback`):Ve(`Suspense`);case 19:return Ve(`SuspenseList`);case 0:case 15:return Ue(e.type,!1);case 11:return Ue(e.type.render,!1);case 1:return Ue(e.type,!0);case 31:return Ve(`Activity`);case 30:return Ve(`ViewTransition`);default:return``}}function Ge(e){try{var t=``,n=null;do t+=We(e,n),n=e,e=e.return;while(e);return t}catch(e){return` Error generating stack: `+e.message+` -`+e.stack}}var Ke=Object.prototype.hasOwnProperty,qe=t.unstable_scheduleCallback,Je=t.unstable_cancelCallback,Ye=t.unstable_shouldYield,Xe=t.unstable_requestPaint,Ze=t.unstable_now,Qe=t.unstable_getCurrentPriorityLevel,$e=t.unstable_ImmediatePriority,et=t.unstable_UserBlockingPriority,tt=t.unstable_NormalPriority,nt=t.unstable_LowPriority,rt=t.unstable_IdlePriority,it=t.log,at=t.unstable_setDisableYieldValue,ot=null,st=null;function ct(e){if(typeof it==`function`&&at(e),st&&typeof st.setStrictMode==`function`)try{st.setStrictMode(ot,e)}catch{}}var lt=Math.clz32?Math.clz32:ft,ut=Math.log,dt=Math.LN2;function ft(e){return e>>>=0,e===0?32:31-(ut(e)/dt|0)|0}var pt=256,mt=262144,ht=4194304;function gt(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&-e;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 _t(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=gt(n))):i=gt(o):i=gt(s)):(r=s&~a,r===0?(o&=s,o===0?n||(n=s&~e,n!==0&&(i=gt(n))):i=gt(o)):i=gt(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 vt(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function yt(e,t){t&8&&(t|=t&32);var n=e.entangledLanes;if(n!==0)for(e=e.entanglements,n&=t;0n;n++)t.push(e);return t}function Ct(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function wt(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=Tr),Or=` `,kr=!1;function Ar(e,t){switch(e){case`keyup`:return Cr.indexOf(t.keyCode)!==-1;case`keydown`:return t.keyCode!==229;case`keypress`:case`mousedown`:case`focusout`:return!0;default:return!1}}function jr(e){return e=e.detail,typeof e==`object`&&`data`in e?e.data:null}var Mr=!1;function Nr(e,t){switch(e){case`compositionend`:return jr(t);case`keypress`:return t.which===32?(kr=!0,Or):null;case`textInput`:return e=t.data,e===Or&&kr?null:e;default:return null}}function Pr(e,t){if(Mr)return e===`compositionend`||!wr&&Ar(e,t)?(e=Kn(),Gn=Wn=Un=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=ri(n)}}function ai(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?ai(e,t.parentNode):`contains`in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function oi(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=ni(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=ni(e.document)}return t}function si(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 ci=Bn&&`documentMode`in document&&11>=document.documentMode,li=null,ui=null,di=null,fi=!1;function pi(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;fi||li==null||li!==ni(r)||(r=li,`selectionStart`in r&&si(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}),di&&ti(di,r)||(di=r,r=op(ui,`onSelect`),0>=o,i-=o,sa=1<<32-lt(t)+i|n<h?(g=d,d=null):g=d.sibling;var _=p(i,d,s[h],c);if(_===null){d===null&&(d=g);break}e&&d&&_.alternate===null&&t(i,d),a=o(_,a,h),u===null?l=_:u.sibling=_,u=_,d=g}if(h===s.length)return n(i,d),k&&la(i,h),l;if(d===null){for(;hg?(_=h,h=null):_=h.sibling;var y=p(a,h,v.value,l);if(y===null){h===null&&(h=_);break}e&&h&&y.alternate===null&&t(a,h),s=o(y,s,g),d===null?u=y:d.sibling=y,d=y,h=_}if(v.done)return n(a,h),k&&la(a,g),u;if(h===null){for(;!v.done;g++,v=c.next())v=f(a,v.value,l),v!==null&&(s=o(v,s,g),d===null?u=v:d.sibling=v,d=v);return k&&la(a,g),u}for(h=r(h);!v.done;g++,v=c.next())v=m(h,a,g,v.value,l),v!==null&&(e&&(_=v.alternate,_!==null&&h.delete(_.key===null?g:_.key)),s=o(v,s,g),d===null?u=v:d.sibling=v,d=v);return e&&h.forEach(function(e){return t(a,e)}),k&&la(a,g),u}function _(e,r,o,c){if(typeof o==`object`&&o&&o.type===re&&o.key===null&&o.props.ref===void 0&&(o=o.props.children),typeof o==`object`&&o){switch(o.$$typeof){case ne:a:{for(var l=o.key;r!==null;){if(r.key===l){if(l=o.type,l===re){if(r.tag===7){n(e,r.sibling),c=a(r,o.props.children),bo(c,o),c.return=e,e=c;break a}}else if(r.elementType===l||typeof l==`object`&&l&&l.$$typeof===de&&po(l)===r.type){n(e,r.sibling),c=a(r,o.props),bo(c,o),c.return=e,e=c;break a}n(e,r);break}t(e,r),r=r.sibling}o.type===re?(c=Ji(o.props.children,e.mode,c,o.key),bo(c,o),c.return=e,e=c):(c=qi(o.type,o.key,o.props,null,e.mode,c),bo(c,o),c.return=e,e=c)}return s(e);case w: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=Zi(o,e.mode,c),c.return=e,e=c}return s(e);case de:return o=po(o),_(e,r,o,c)}if(Se(o))return h(e,r,o,c);if(ve(o)){if(l=ve(o),typeof l!=`function`)throw Error(i(150));return o=l.call(o),g(e,r,o,c)}if(typeof o.then==`function`)return _(e,r,yo(o),c);if(o.$$typeof===oe)return _(e,r,La(e,o),c);xo(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=Yi(o,e.mode,c),c.return=e,e=c),s(e)):n(e,r)}return function(e,t,n,r){try{vo=0;var i=_(e,t,n,r);return _o=null,i}catch(t){if(t===oo||t===co)throw t;var a=Ui(29,t,null,e.mode);return a.lanes=r,a.return=e,a}}}var Co=So(!0),wo=So(!1),To=!1;function Eo(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Do(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 Oo(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function ko(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,cd&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,t=Bi(e),O(e,null,n),t}return Ri(e,r,t,n),Bi(e)}function Ao(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 jo(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 Mo=!1;function No(){if(Mo){var e=Za;if(e!==null)throw e}}function Po(e,t,n,r){Mo=!1;var i=e.updateQueue;To=!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 f=s.lane&-536870913,p=f!==s.lane;if(p?(z&f)===f:(r&f)===f){f!==0&&f===Xa&&(Mo=!0),u!==null&&(u=u.next={lane:0,tag:s.tag,payload:s.payload,callback:null,next:null});a:{var m=e,h=s;f=t;var g=n;switch(h.tag){case 1:if(m=h.payload,typeof m==`function`){d=m.call(g,d,f);break a}d=m;break a;case 3:m.flags=m.flags&-65537|128;case 0:if(m=h.payload,f=typeof m==`function`?m.call(g,d,f):m,f==null)break a;d=C({},d,f);break a;case 2:To=!0}}f=s.callback,f!==null&&(e.flags|=64,p&&(e.flags|=8192),p=i.callbacks,p===null?i.callbacks=[f]:p.push(f))}else p={lane:f,tag:s.tag,payload:s.payload,callback:s.callback,next:null},u===null?(l=u=p,c=d):u=u.next=p,o|=f;if(s=s.next,s===null){if(s=i.shared.pending,s===null)break;p=s,s=p.next,p.next=null,i.lastBaseUpdate=p,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),_d|=o,e.lanes=o,e.memoizedState=d}}function Fo(e,t){if(typeof e!=`function`)throw Error(i(191,e));e.call(t)}function A(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;ea?a:8;var o=E.T,s={};s.types=o===null?null:o.types,E.T=s,xc(e,!1,t,n);try{var c=i(),l=E.S;l!==null&&l(s,c),typeof c==`object`&&c&&typeof c.then==`function`?bc(e,t,eo(c,r),Hd(e)):bc(e,t,r,Hd(e))}catch(n){bc(e,t,{then:function(){},status:`rejected`,reason:n},Hd())}finally{we.p=a,o!==null&&s.types!==null&&(o.types=s.types),E.T=o}}function uc(){}function dc(e,t,n,r){if(e.tag!==5)throw Error(i(476));var a=fc(e).queue;lc(e,a,t,Te,n===null?uc:function(){return pc(e),n(r)})}function fc(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:Ss,lastRenderedState:Te},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ss,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function pc(e){var t=fc(e);t.next===null&&(t=e.alternate.memoizedState),bc(e,t.next.queue,{},Hd())}function mc(){return Ia(bh)}function hc(){return _s().memoizedState}function gc(){return _s().memoizedState}function _c(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=Hd();e=Oo(n);var r=ko(t,e,n);r!==null&&(Gd(r,t,n),Ao(r,t,n)),t={cache:Ua()},e.payload=t;return}t=t.return}}function vc(e,t,n){var r=Hd();n={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},Sc(e)?Cc(t,n):(n=zi(e,t,n,r),n!==null&&(Gd(n,e,r),wc(n,t,r)))}function yc(e,t,n){bc(e,t,n,Hd())}function bc(e,t,n,r){var i={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(Sc(e))Cc(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,ei(s,o))return Ri(e,t,i,0),ld===null&&Li(),!1}catch{}if(n=zi(e,t,i,r),n!==null)return Gd(n,e,r),wc(n,t,r),!0}return!1}function xc(e,t,n,r){if(r={lane:2,revertLane:Kf(),gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},Sc(e)){if(t)throw Error(i(479))}else t=zi(e,n,r,2),t!==null&&Gd(t,e,2)}function Sc(e){var t=e.alternate;return e===M||t!==null&&t===M}function Cc(e,t){ts=es=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function wc(e,t,n){if(n&4194048){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Et(e,n)}}var Tc={readContext:Ia,use:bs,useCallback:ss,useContext:ss,useEffect:ss,useImperativeHandle:ss,useLayoutEffect:ss,useInsertionEffect:ss,useMemo:ss,useReducer:ss,useRef:ss,useState:ss,useDebugValue:ss,useDeferredValue:ss,useTransition:ss,useSyncExternalStore:ss,useId:ss,useHostTransitionStatus:ss,useFormState:ss,useActionState:ss,useOptimistic:ss,useMemoCache:ss,useCacheRefresh:ss,useEffectEvent:ss},Ec={readContext:Ia,use:bs,useCallback:function(e,t){return gs().memoizedState=[e,t===void 0?null:t],e},useContext:Ia,useEffect:Xs,useImperativeHandle:function(e,t,n){n=n==null?null:n.concat([e]),Js(4194308,4,nc.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Js(4194308,4,e,t)},useInsertionEffect:function(e,t){Js(4,2,e,t)},useMemo:function(e,t){var n=gs();t=t===void 0?null:t;var r=e();if(ns){ct(!0);try{e()}finally{ct(!1)}}return n.memoizedState=[r,t],r},useReducer:function(e,t,n){var r=gs();if(n!==void 0){var i=n(t);if(ns){ct(!0);try{n(t)}finally{ct(!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=vc.bind(null,M,e),[r.memoizedState,e]},useRef:function(e){var t=gs();return e={current:e},t.memoizedState=e},useState:function(e){e=Ms(e);var t=e.queue,n=yc.bind(null,M,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:ic,useDeferredValue:function(e,t){return sc(gs(),e,t)},useTransition:function(){var e=Ms(!1);return e=lc.bind(null,M,e.queue,!0,!1),gs().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var r=M,a=gs();if(k){if(n===void 0)throw Error(i(407));n=n()}else{if(n=t(),ld===null)throw Error(i(349));z&127||Ds(r,t,n)}a.memoizedState=n;var o={value:n,getSnapshot:t};return a.queue=o,Xs(ks.bind(null,r,o,e),[e]),r.flags|=2048,Ks(9,{destroy:void 0},Os.bind(null,r,o,n,t),null),n},useId:function(){var e=gs(),t=ld.identifierPrefix;if(k){var n=ca,r=sa;n=(r&~(1<<32-lt(r)-1)).toString(32)+n,t=`_`+t+`R_`+n,n=rs++,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[Nt]=t,o[Pt]=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(hp(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&&Cl(t)}}return Ol(t),t.subtreeFlags&=-33554433,wl(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==r&&Cl(t);else{if(typeof r!=`string`&&t.stateNode===null)throw Error(i(166));if(e=Ne.current,Sa(t)){if(e=t.stateNode,n=t.memoizedProps,r=null,a=ma,a!==null)switch(a.tag){case 27:case 5:r=a.memoizedProps}e[Nt]=t,e=!!(e.nodeValue===n||r!==null&&!0===r.suppressHydrationWarning||fp(e.nodeValue,n)),e||ya(t,!0)}else e=Sp(e).createTextNode(r),e[Nt]=t,t.stateNode=e}return Ol(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(r=Sa(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[Nt]=t}else Ca(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Ol(t),e=!1}else n=wa(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(Ko(t),t):(Ko(t),null);if(t.flags&128)throw Error(i(558))}return Ol(t),null;case 13:if(r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(a=Sa(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[Nt]=t}else Ca(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Ol(t),a=!1}else a=wa(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=a),a=!0;if(!a)return t.flags&256?(Ko(t),t):(Ko(t),null)}return Ko(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),El(t,t.updateQueue),Ol(t),null);case 4:return Ie(),e===null&&np(t.stateNode.containerInfo),t.flags|=67108864,Ol(t),null;case 10:return Aa(t.type),Ol(t),null;case 19:if(Yo(t),r=t.memoizedState,r===null)return Ol(t),null;if(a=!!(t.flags&128),o=r.rendering,o===null){if(a)Dl(r,!1);else{if(gd!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(o=Xo(e),o!==null){for(t.flags|=128,Dl(r,!1),e=o.updateQueue,t.updateQueue=e,El(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)Ki(n,e),n=n.sibling;return Jo(t,qo.current&1|2),k&&la(t,r.treeForkCount),t.child}e=e.sibling}r.tail!==null&&Ze()>Dd&&(t.flags|=128,a=!0,Dl(r,!1),t.lanes=4194304)}}else{if(!a){if(e=Xo(o),e!==null){if(t.flags|=128,a=!0,e=e.updateQueue,t.updateQueue=e,El(t,e),Dl(r,!0),r.tail===null&&r.tailMode!==`collapsed`&&r.tailMode!==`visible`&&!o.alternate&&!k)return Ol(t),null}else 2*Ze()-r.renderingStartTime>Dd&&n!==536870912&&(t.flags|=128,a=!0,Dl(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)}if(r.tail!==null){e=r.tail;a:{for(n=e;n!==null;){if(n.alternate!==null){n=!1;break a}n=n.sibling}n=!0}return r.rendering=e,r.tail=e.sibling,r.renderingStartTime=Ze(),e.sibling=null,o=qo.current,o=a?o&1|2:o&1,r.tailMode===`visible`||r.tailMode===`collapsed`||!n||k?Jo(t,o):(n=o,Ae(Bo,t),Ae(qo,n),Vo===null&&(Vo=t)),k&&la(t,r.treeForkCount),e}return Ol(t),null;case 22:case 23:return Ko(t),zo(),r=t.memoizedState!==null,e===null?r&&(t.flags|=8192):e.memoizedState!==null!==r&&(t.flags|=8192),r?n&536870912&&!(t.flags&128)&&(Ol(t),t.subtreeFlags&6&&(t.flags|=8192)):Ol(t),n=t.updateQueue,n!==null&&El(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&&ke(no),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),Aa(Ha),Ol(t),null;case 25:return null;case 30:return t.flags|=33554432,Ol(t),null}throw Error(i(156,t.tag))}function Al(e,t){switch(fa(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Aa(Ha),Ie(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return Re(t),null;case 31:if(t.memoizedState!==null){if(Ko(t),t.alternate===null)throw Error(i(340));Ca()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(Ko(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(i(340));Ca()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Yo(t),e=t.flags,e&65536?(t.flags=e&-65537|128,e=t.memoizedState,e!==null&&(e.rendering=null,e.tail=null),t.flags|=4,t):null;case 4:return Ie(),null;case 10:return Aa(t.type),null;case 22:case 23:return Ko(t),zo(),e!==null&&ke(no),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return Aa(Ha),null;case 25:return null;default:return null}}function jl(e,t){switch(fa(t),t.tag){case 3:Aa(Ha),Ie();break;case 26:case 27:case 5:Re(t);break;case 4:Ie();break;case 31:t.memoizedState!==null&&Ko(t);break;case 13:Ko(t);break;case 19:Yo(t);break;case 10:Aa(t.type);break;case 22:case 23:Ko(t),zo(),e!==null&&ke(no);break;case 24:Aa(Ha)}}function Ml(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){Tf(t,t.return,e)}}function Nl(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){Tf(i,c,e)}}}r=r.next}while(r!==a)}}catch(e){Tf(t,t.return,e)}}function Pl(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{A(t,n)}catch(t){Tf(e,e.return,t)}}}function Fl(e,t,n){n.props=Nc(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(n){Tf(e,t,n)}}function Il(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:var i=e.stateNode,a=Ai(e.memoizedProps,i);(i.ref===null||i.ref.name!==a)&&(i.ref=qp(a)),r=i.ref;break;case 7:if(e.stateNode===null){var o=new Jp(e);f(e.child,!1,dm,o,void 0,void 0),e.stateNode=o}r=e.stateNode;break;default:r=e.stateNode}typeof n==`function`?e.refCleanup=n(r):n.current=r}}catch(n){Tf(e,t,n)}}function Ll(e,t){var n=e.ref,r=e.refCleanup;if(n!==null){if(typeof r==`function`)try{r()}catch(n){Tf(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){Tf(e,t,n)}else n.current=null}}function Rl(e,t){if((e.tag===5||e.tag===27||e.tag===6)&&e.alternate===null&&t!==null)for(var n=0;n title`))),hp(r,t,n),r[Nt]=e,qt(r),t=r;break a;case`link`:if(o=ih(`link`,`href`,a).get(t+(n.href||``))){for(s=0;sg&&(o=g,g=h,h=o);var _=ii(s,h),v=ii(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,E.T=null,n=Fd,Fd=null;var o=jd,s=Nd;if(Ad=0,Md=jd=null,Nd=0,cd&6)throw Error(i(331));var c=cd;if(cd|=4,rd(o.current),Yu(o,o.current,s,n),cd=c,zf(0,!1),st&&typeof st.onPostCommitFiberRoot==`function`)try{st.onPostCommitFiberRoot(ot,o)}catch{}return!0}finally{we.p=a,E.T=r,xf(e,t)}}function wf(e,t,n){t=$i(n,t),t=zc(e.stateNode,t,2),e=ko(e,t,2),e!==null&&(Ct(e,2),Rf(e))}function Tf(e,t,n){if(e.tag===3)wf(e,e,n);else for(;t!==null;){if(t.tag===3){wf(t,e,n);break}if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError==`function`||typeof r.componentDidCatch==`function`&&(kd===null||!kd.has(r))){e=$i(n,e),n=Bc(2),r=ko(t,n,2),r!==null&&(Vc(n,r,t,e),Ct(r,2),Rf(r));break}}t=t.return}}function Ef(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new sd;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)||(md=!0,i.add(n),e=Df.bind(null,e,t,n),t.then(e,e))}function Df(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,ld===e&&(z&n)===n&&(gd===4||gd===3&&(z&62914560)===z&&300>Ze()-Td?cd&2?yd|=n:Qd(e,0):yd|=n,xd===z&&(xd=0)),Rf(e)}function Of(e,t){t===0&&(t=xt()),e=D(e,t),e!==null&&(Ct(e,t),Rf(e))}function kf(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),Of(e,n)}function Af(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),Of(e,n)}function jf(e,t){return qe(e,t)}var Mf=null,Nf=null,Pf=!1,Ff=!1,If=!1,Lf=0;function Rf(e){e!==Nf&&e.next===null&&(Nf===null?Mf=Nf=e:Nf=Nf.next=e),Ff=!0,Pf||(Pf=!0,Gf())}function zf(e,t){if(!If&&Ff){If=!0;do for(var n=!1,r=Mf;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-lt(42|e)+1)-1,a&=i&~(o&~s),a=a&201326741?a&201326741|1:a?a|2:0}a!==0&&(n=!0,Wf(r,a))}else a=z,a=_t(r,r===ld?a:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),!(a&3)||vt(r,a)||(n=!0,Wf(r,a))}r=r.next}while(n);If=!1}}function Bf(){Vf()}function Vf(){Ff=Pf=!1;var e=0;Lf!==0&&Op()&&(e=Lf);for(var t=Ze(),n=null,r=Mf;r!==null;){var i=r.next,a=Hf(r,t);a===0?(r.next=null,n===null?Mf=i:n.next=i,i===null&&(Nf=n)):(n=r,(e!==0||a&3)&&(Ff=!0)),r=i}Ad!==0&&Ad!==5||zf(e,!1),Lf!==0&&(Lf=0)}function Hf(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&&vp(d)&&(c=c.responseEnd,o+=u*(cfh){s.length=o;break}f=new Promise(Wp.bind(f)),s.push(f)}}}if(0`u`?null:document;function Rm(e,t,n){var r=Lm;if(r&&typeof t==`string`&&t){var i=hn(t);i=`link[rel="`+e+`"][href="`+i+`"]`,typeof n==`string`&&(i+=`[crossorigin="`+n+`"]`),Mm.has(i)||(Mm.add(i),e={rel:e,crossOrigin:n,href:t},r.querySelector(i)===null&&(t=r.createElement(`link`),hp(t,`link`,e),qt(t),r.head.appendChild(t)))}}function zm(e){Pm.D(e),Rm(`dns-prefetch`,e,null)}function Bm(e,t){Pm.C(e,t),Rm(`preconnect`,e,t)}function Vm(e,t,n){Pm.L(e,t,n);var r=Lm;if(r&&e&&t){var i=`link[rel="preload"][as="`+hn(t)+`"]`;t===`image`&&n&&n.imageSrcSet?(i+=`[imagesrcset="`+hn(n.imageSrcSet)+`"]`,typeof n.imageSizes==`string`&&(i+=`[imagesizes="`+hn(n.imageSizes)+`"]`)):i+=`[href="`+hn(e)+`"]`;var a=i;switch(t){case`style`:a=qm(e);break;case`script`:a=Zm(e)}if(!(jm.has(a)||(e=C({rel:`preload`,href:t===`image`&&n&&n.imageSrcSet?void 0:e,as:t},n),jm.set(a,e),r.querySelector(i)!==null||t===`style`&&r.querySelector(Jm(a))||t===`script`&&r.querySelector(Qm(a))))){var o=r.createElement(`link`);hp(o,`link`,e),t===`style`&&(o[Vt]=!0,o.onload=o.onerror=function(){Jt(o)}),qt(o),r.head.appendChild(o)}}}function Hm(e,t){Pm.m(e,t);var n=Lm;if(n&&e){var r=t&&typeof t.as==`string`?t.as:`script`,i=`link[rel="modulepreload"][as="`+hn(r)+`"][href="`+hn(e)+`"]`,a=i;switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:a=Zm(e)}if(!jm.has(a)&&(e=C({rel:`modulepreload`,href:e},t),jm.set(a,e),n.querySelector(i)===null)){switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:if(n.querySelector(Qm(a)))return}r=n.createElement(`link`),hp(r,`link`,e),qt(r),n.head.appendChild(r)}}}function Um(e,t,n){Pm.S(e,t,n);var r=Lm;if(r&&e){var i=Kt(r).hoistableStyles,a=qm(e);t||=`default`;var o=i.get(a);if(!o){var s={loading:0,preload:null};if(o=r.querySelector(Jm(a)))s.loading=5;else{e=C({rel:`stylesheet`,href:e,"data-precedence":t},n),(n=jm.get(a))&&th(e,n);var c=o=r.createElement(`link`);qt(c),hp(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,eh(o,t,r)}o={type:`stylesheet`,instance:o,count:1,state:s},i.set(a,o)}}}function Wm(e,t){Pm.X(e,t);var n=Lm;if(n&&e){var r=Kt(n).hoistableScripts,i=Zm(e),a=r.get(i);a||(a=n.querySelector(Qm(i)),a||(e=C({src:e,async:!0},t),(t=jm.get(i))&&nh(e,t),a=n.createElement(`script`),qt(a),hp(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Gm(e,t){Pm.M(e,t);var n=Lm;if(n&&e){var r=Kt(n).hoistableScripts,i=Zm(e),a=r.get(i);a||(a=n.querySelector(Qm(i)),a||(e=C({src:e,async:!0,type:`module`},t),(t=jm.get(i))&&nh(e,t),a=n.createElement(`script`),qt(a),hp(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Km(e,t,n,r){var a=(a=Ne.current)?Nm(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`?(n=qm(n.href),t=Kt(a).hoistableStyles,r=t.get(n),r||(r={type:`style`,instance:null,count:0,state:null},t.set(n,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=qm(n.href);var o=Kt(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(Jm(e)))?o._p||(s.instance=o,s.state.loading=5):(o=jm.get(e),o||(o={rel:`preload`,as:`style`,href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},jm.set(e,o)),Xm(a,e,o,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`?(n=Zm(n),t=Kt(a).hoistableScripts,r=t.get(n),r||(r={type:`script`,instance:null,count:0,state:null},t.set(n,r)),r):{type:`void`,instance:null,count:0,state:null};default:throw Error(i(444,e))}}function qm(e){return`href="`+hn(e)+`"`}function Jm(e){return`link[rel="stylesheet"][`+e+`]`}function Ym(e){return C({},e,{"data-precedence":e.precedence,precedence:null})}function Xm(e,t,n,r){if(t=e.querySelector(`link[rel="preload"][as="style"][`+t+`]`)){if(!0!==t[Vt]){r.loading=1;return}}else t=e.createElement(`link`),t[Vt]=!0,t.onload=t.onerror=Jt.bind(null,t),hp(t,`link`,n),qt(t),e.head.appendChild(t);r.preload=t,t.addEventListener(`load`,function(){return r.loading|=1}),t.addEventListener(`error`,function(){return r.loading|=2})}function Zm(e){return`[src="`+hn(e)+`"]`}function Qm(e){return`script[async]`+e}function $m(e,t,n){if(t.count++,t.instance===null)switch(t.type){case`style`:var r=e.querySelector(`style[data-href~="`+hn(n.href)+`"]`);if(r)return t.instance=r,qt(r),r;var a=C({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return r=(e.ownerDocument||e).createElement(`style`),qt(r),hp(r,`style`,a),eh(r,n.precedence,e),t.instance=r;case`stylesheet`:a=qm(n.href);var o=e.querySelector(Jm(a));if(o)return t.state.loading|=4,t.instance=o,qt(o),o;r=Ym(n),(a=jm.get(a))&&th(r,a),o=(e.ownerDocument||e).createElement(`link`),qt(o);var s=o;return s._p=new Promise(function(e,t){s.onload=e,s.onerror=t}),hp(o,`link`,r),t.state.loading|=4,eh(o,n.precedence,e),t.instance=o;case`script`:return o=Zm(n.src),(a=e.querySelector(Qm(o)))?(t.instance=a,qt(a),a):(r=n,(a=jm.get(o))&&(r=C({},n),nh(r,a)),e=e.ownerDocument||e,a=e.createElement(`script`),qt(a),hp(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,eh(r,n.precedence,e));return t.instance}function eh(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 oh(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 sh(e,t){return e===`img`&&t.src!=null&&t.src!==``&&t.onLoad==null&&t.loading!==`lazy`}function ch(e){return!(e.type===`stylesheet`&&!(e.state.loading&3))}function lh(e){return(e.width||100)*(e.height||100)*(typeof devicePixelRatio==`number`?devicePixelRatio:1)*.25}function uh(e,t){typeof t.decode==`function`&&(e.imgCount++,t.complete||(e.imgBytes+=lh(t),e.suspenseyImages.push(t)),e=gh.bind(e),t.decode().then(e,e))}function dh(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=qm(r.href),a=t.querySelector(Jm(i));if(a){t=a._p,typeof t==`object`&&t&&typeof t.then==`function`&&(e.count++,e=hh.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=a,qt(a);return}a=t.ownerDocument||t,r=Ym(r),(i=jm.get(i))&&th(r,i),a=a.createElement(`link`),qt(a);var o=a;o._p=new Promise(function(e,t){o.onload=e,o.onerror=t}),hp(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=hh.bind(e),t.addEventListener(`load`,n),t.addEventListener(`error`,n))}}var fh=0;function ph(e,t){return e.stylesheets&&e.count===0&&vh(e,e.stylesheets),0fh?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(r),clearTimeout(i)}}:null}function mh(e){if(e.count===0&&(e.imgCount===0||!e.waitingForImages)){if(e.stylesheets)vh(e,e.stylesheets);else if(e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}}}function hh(){this.count--,mh(this)}function gh(){this.imgCount--,mh(this)}var _h=null;function vh(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,_h=new Map,t.forEach(yh,e),_h=null,hh.call(e))}function yh(e,t){if(!(t.state.loading&4)){var n=_h.get(e);if(n)var r=n.get(null);else{n=new Map,_h.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=Cn()}));function Tn(e){return e?.isNotFound===!0}function En(){try{return sessionStorage}catch{return}}var Dn=`tsr-scroll-restoration-v1_3`,On=En();function kn(){try{return JSON.parse(On?.getItem(`tsr-scroll-restoration-v1_3`)||`{}`)}catch{return{}}}var An=kn(),jn=`data-scroll-restoration-id`,Mn=e=>e.state.__TSR_key||e.href;function Nn(e){let t=e.getAttribute(jn);if(t)return`[${jn}="${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 Pn=!1,Fn=`window`;function In(e){try{return typeof e==`function`?e():document.querySelector(e)}catch{}}function Ln(e){let t=new Set;for(let n of e){if(n===Fn)continue;let e=In(n);e&&t.add(e)}return t}function Rn(e,t){let n=t??e.options.scrollRestoration,r=e._scroll;n&&(r.e=!0);let i=e.options.getScrollRestorationKey||Mn,a=new Set,o=e=>{let t=An[e]||={};for(let e of a)e===document?t[Fn]={scrollX,scrollY}:e.isConnected&&(t[Nn(e)]={scrollX:e.scrollLeft,scrollY:e.scrollTop})};n&&!r.s&&(r.s=!0,Pn=!1,history.scrollRestoration=`manual`,document.addEventListener(`scroll`,e=>{Pn||a.add(e.target)},!0),e.subscribe(`onBeforeLoad`,e=>{e.fromLocation&&o(i(e.fromLocation)),a.clear()}),addEventListener(`pagehide`,()=>{history.scrollRestoration=`auto`,o(i(e.stores.resolvedLocation.get()??e.stores.location.get()));try{On?.setItem(Dn,JSON.stringify(An))}catch{}}),addEventListener(`pageshow`,e=>{e.persisted&&(history.scrollRestoration=`manual`)})),!r.r&&(r.r=!0,e.subscribe(`onRendered`,t=>{let n=e.options.scrollRestorationBehavior,o=e.options.scrollToTopSelectors,s=r.n,c=r.h,l;if(a.clear(),r.n=!0,r.h=!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.e&&d&&d!==u){let e=An[d];if(e){let t=An[u];for(let n in e){if(n===Fn){if(s)continue}else{let e=In(n);if(!e||s&&o&&(l??=Ln(o),l.has(e)))continue}t||=An[u]={},t[n]??=e[n]}}}Pn=!0;try{let e=t.toLocation.hash,i=t.toLocation.state.__hashScrollIntoViewOptions??!0,a=!1;if(s){!e&&o&&(l??=Ln(o));let t=e&&i&&c,s=r.e?An[u]:void 0;if(s)for(let e in s){let{scrollX:r,scrollY:i}=s[e];if(e===Fn){if(t)continue;scrollTo({top:i,left:r,behavior:n}),a=!0}else{let t=In(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{Pn=!1}}))}function zn(e,t=String){let n;for(let r in e){let i=e[r];i!==void 0&&(n||=new URLSearchParams).set(r,t(i))}return n?n.toString():``}function Bn(e){return e?e===`false`?!1:e===`true`?!0:e*0==0&&+e+``===e?+e:e:``}function Vn(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]=Bn(r):Array.isArray(t)?t.push(Bn(r)):n[e]=[t,Bn(r)]}return n}var Hn=/^(?:\s|["[{\d-]|fa|nu|tr)/,Un=Gn(JSON.parse),Wn=Kn(JSON.stringify,JSON.parse);function Gn(e){let t=e===JSON.parse;return n=>{n[0]===`?`&&(n=n.substring(1));let r=Vn(n);for(let n in r){let i=r[n];if(typeof i==`string`){if(t&&!Hn.test(i))continue;try{r[n]=e(i)}catch{}}}return r}}function Kn(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&&!Hn.test(r))return r;try{return t(r),e(r)}catch{}}return r}return e=>{let t=zn(e,r);return t?`?${t}`:``}}function qn(e){let t=new Map,n,r;return{get(e){let n=t.get(e);if(n)return n.visited=!0,n.value},set(i,a){let o=t.get(i);if(o){o.value=a;return}if(t.size>=e){let e=n?.next().value;for(;!e||e.visited;)e?e.visited=!1:n=t.values(),e=n.next().value;e===r&&(n=void 0),t.delete(e.key)}let s={key:i,value:a,visited:!1};r=s,t.set(i,s)},clear(){t.clear(),n=void 0,r=void 0}}}var Jn=4,Yn=5;function Xn(e){let t=e.names;if(t)return t;let n=[];for(let t of e)typeof t!=`string`&&n.push(t[1]);return e.names=n}function Zn(e,t,n){let r=e.substring(t,n);if(r.charCodeAt(0)===36)return r.length===1?[2,`_splat`,``,void 0]:[1,r.substring(1),``,``];let i=r.indexOf(`{`);if(i>=0){let a=r.indexOf(`}`,i),o=r.charCodeAt(i+1)===45,s=i+(o?3:2);if(a>=0&&r.charCodeAt(s-1)===36&&(!o||s!e.parse&&e.caseSensitive===_&&e.prefix===h&&e.suffix===g);if(y)c=y;else{let e=er(r,t,_,h,g);c=e,v.push(e),v.length===2&&i?.push(v)}}r=c}p&&m=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===Jn)>(e.node.kind===Jn)||t.node.kind===Jn==(e.node.kind===Jn)&&t.node.depth>e.node.depth)))}function hr(e,t,n){let r=Ue(e),i=`/${r}`,a=t?i:i.toLowerCase(),o=`${a}/`,s={input:({url:e})=>{let n=t?e.pathname:e.pathname.toLowerCase();return n===a?e.pathname=`/`:n.startsWith(o)&&(e.pathname=e.pathname.slice(i.length)),e},output:({url:e})=>(e.pathname=at(`/${r}${e.pathname}`),e)};return n?{input:({url:e})=>gr(n,s.input({url:e})),output:({url:e})=>s.output({url:_r(n,e)})}:s}function gr(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 _r(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 vr(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(()=>{Fe(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 yr=`__TSR_index`,br=`popstate`,xr=`beforeunload`,Sr=/^[\x00-\x20]*(?:[\\/][\t\n\r]*){2,}/;function Cr(e){let t=Sr.exec(e);return t?`/`+e.slice(t[0].length):e}function wr(e){return/[\x00-\x1f\x7f]/.test(e)&&(e=e.replace(/[\x00-\x1f\x7f]/g,e=>` -\r`.includes(e)?``:encodeURIComponent(e))),Cr(e)}function Tr(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=Or(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[yr];i=Er(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[yr];i=Er(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,n?.ignoreBlocker??!1),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[yr]!==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,_getBlockers:()=>e.getBlockers?.()??[]}}function Er(e,t){let n=kr();return{...t,key:n,__TSR_key:n,[yr]:e}}function Dr(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=t=>wr(e?.createHref?e.createHref(t):t),c=e?.parseLocation??(()=>Or(`${t.location.pathname}${t.location.search}${t.location.hash}`,t.history.state));if(!t.history.state?.__TSR_key&&!t.history.state?.key){let e=kr();t.history.replaceState({[yr]:0,key:e,__TSR_key:e},``)}let l=c(),u,d=!1,f=!1,p=!1,m=!1,h=()=>l,g,_=()=>{g&&(x._ignoreSubscribers=!0,(g[2]?t.history.pushState:t.history.replaceState)(g[1],``,g[0]),x._ignoreSubscribers=!1,g=void 0,u=void 0)},v=(t,n,r)=>{let i=e?.createHref?s(n):void 0,a=!!g;a||(u=l),l=Or(n,r),g=[i??l.href,r,g?.[2]||t],a||queueMicrotask(()=>_())},y=e=>{l=c(),x.notify({type:e})},b=async()=>{if(m=!1,f){f=!1;return}let e=c(),n=e.state[yr]-l.state[yr],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 r=a();if(typeof document<`u`&&r.length){for(let i of r)if(await i.blockerFn({currentLocation:l,nextLocation:e,action:s})){f=!0,t.history.go(-n),x.notify(u);return}}}l=c(),x.notify(u)},ee=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=``},x=Tr({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,n)=>{d=!0,n&&(p=!0,m=!0),t.history.go(e)},createHref:e=>s(e),flush:_,destroy:()=>{t.history.pushState=n,t.history.replaceState=r,t.removeEventListener(xr,ee,{capture:!0}),t.removeEventListener(br,b)},onBlocked:()=>{u&&l!==u&&(l=u)},getBlockers:a,setBlockers:o,notifyOnIndexChange:!1});return x._ignoreNextBeforeUnload=e=>{m=!1;try{e=new URL(e,t.document.baseURI).href,m=/^https?:/.test(e)&&(!e.includes(`#`)||e.split(`#`)[0]!==t.location.href.split(`#`)[0])}catch{}},t.addEventListener(xr,ee,{capture:!0}),t.addEventListener(br,b),t.history.pushState=function(...e){let r=n.apply(t.history,e);return x._ignoreSubscribers||y(`PUSH`),r},t.history.replaceState=function(...e){let n=r.apply(t.history,e);return x._ignoreSubscribers||y(`REPLACE`),n},x}function Or(e,t){let n=wr(e),r=n.indexOf(`#`),i=n.indexOf(`?`);if(!t){let e=kr();t={[yr]:0,key:e,__TSR_key:e}}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}}function kr(){return(Math.random()+1).toString(36).substring(7)}function Ar(e,t){return e.protocol!==`http:`&&e.protocol!==`https:`||e.origin!==t||!!e.username||!!e.password}function jr(e){return e.pathname+e.search+e.hash}function Mr(e){return e.options.loader||e.options.beforeLoad||e.lazyFn||e.options.component?.preload||e.options.pendingComponent?.preload}function Nr(e,t){return{fromLocation:t,toLocation:e,pathChanged:t?.pathname!==e.pathname,hrefChanged:t?.href!==e.href,hashChanged:t?.hash!==e.hash}}function Pr({key:e,__TSR_key:t,__TSR_index:n,__hashScrollIntoViewOptions:r,...i}){return i}function Fr(e){return e.findIndex(e=>e.status===`error`||e.status===`notFound`||e._notFound)+1}function Ir(e,t,n,r,i,a){r&&(t=t.slice(0,r)),i&&(n=n.slice(0,i));for(let r of t){if(a&&e._tx!==a)return;n.some(e=>e.routeId===r.routeId)||e.routesById[r.routeId].options.onLeave?.(r)}for(let r of n){if(a&&e._tx!==a)return;e.routesById[r.routeId].options[t.some(e=>e.routeId===r.routeId)?`onStay`:`onEnter`]?.(r)}}var Lr=class{constructor(e,t){this.tempLocationKey=`${Math.round(Math.random()*1e7)}`,this._scroll={n:!0},this.subscribers=new Set,this._cache=new Map,this._committed=[],this.startTransition=async e=>(e(),!1),this.update=e=>{let t=this.options;this.options={...t,...e},this.isServer=this.options.isServer??!1??typeof document>`u`,this.staticLocations=new WeakMap,this.protocolAllowlist=new Set(this.options.protocolAllowlist),(!this.history||this.options.history&&this.options.history!==this.history)&&(this.history=this.options.history?this.options.history:Dr()),this.origin=this.options.origin,this.origin||=window?.origin&&window.origin!==`null`?window.origin:`http://localhost`;let n=this.options.basepath??`/`,r=this.options.rewrite,i=this.basepath!==n||t?.rewrite!==r||t?.caseSensitive!==this.options.caseSensitive;if(i&&(this.basepath=n,this.rewrite=n!==`/`&&Ue(n)?hr(n,this.options.caseSensitive,r):r),this.history&&this.updateLatestLocation(),this.options.routeTree!==this.routeTree){this.routeTree=this.options.routeTree;let e;e=this.buildRouteTree(),this.setRoutes(e)}if(this.stores)i&&this.stores.location.set(this.latestLocation);else if(this.latestLocation){let e=this.getStoreConfig(this);this.batch=e.batch,this.stores=vr(this.latestLocation,e),Rn(this)}},this.updateLatestLocation=()=>{this.latestLocation=this.parseLocation(this.history.location,this.latestLocation)},this.buildRouteTree=()=>{let e=ar(this.routeTree,this.options.caseSensitive);return this.options.routeMasks&&tr(this.options.routeMasks,e.processedTree),{...e,resolvePathCache:qn(1e3)}},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},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:Be(e),external:!1,searchStr:o,search:He(t?.search,i),hash:Be(r.slice(1)),state:Ne(t?.state,a)}}let o=gr(this.rewrite,new URL(i,this.origin)),s=this.options.parseSearch(o.search),c=this.options.stringifySearch(s);return o.search=c,{href:o.href.replace(o.origin,``),publicHref:i,pathname:Be(Cr(o.pathname)),external:!!this.rewrite&&Ar(o,this.origin),searchStr:c,search:He(t?.search,s),hash:Be(o.hash.slice(1)),state:Ne(t?.state,a)}},r=n(e,e.state),{__tempLocation:i,__tempKey:a}=r.state;if(i&&(!a||a===this.tempLocationKey)){let e=n(i,{...i.state,__tempLocation:void 0,key:r.state.key,__TSR_key:r.state.__TSR_key});return e.maskedLocation=r,e}return r},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=ir(ot(e),this.processedTree,!0);return n&&Object.assign(t,n.rawParams),[n?.branch||[this.routesById.__root__],t,n?.route]},this.buildLocation=e=>{{let t=this.staticLocations.get(e);if(t)return t}let t=!1,n=(n={})=>{if(n.href){let e=Or(n.href,{});n={...n,to:gr(this.rewrite,new URL(e.pathname,this.origin)).pathname,search:this.options.parseSearch(e.search),hash:e.hash.slice(1)}}let r=n._fromLocation||this._pendingLocation||this.latestLocation,i,a=()=>(t=!0,r),o=()=>(t=!0,i??=this.matchRoutesLightweight(r)),s=n.to?`${n.to}`:`.`,c=st(s[0]===`/`?``:n.unsafeRelative===`path`?a().pathname:n.from??o()[1],s,this.options.trailingSlash,this.resolvePathCache),l=this.routesByPath[ot(c)],u=c.includes(`$`),d;if(l)d=l._branch??=cr(l);else if(u)d=[];else{let[e,t,n]=this.getMatchedRoutes(c);d=e,this.options.notFoundRoute&&(!n||n.path!==`/`&&t[`**`])&&(d=[...d,this.options.notFoundRoute])}let f=u?l?._interpolation??Qn(!1,{fullPath:c},0):void 0,p;for(let e of d){let t=e.options.params?.stringify??e.options.stringifyParams;if(t){let e=o()[3];if(p??=Hr(n.params,e),!ze(p))break;p===e&&(p=Object.assign(Pe(),p));try{Object.assign(p,t(p))}catch{}}}p??=Hr(n.params,Ur(n.params,f)?o()[3]:Wr);let m=e.leaveParams?c:Cr(Be(f?qe(c,f,p,this.pathParamsDecoder):c)),h=Gr(d,e._includeValidateSearch),g=()=>{let t=o()[2];if(e._includeValidateSearch&&this.options.search?.strict){let e={};d.forEach(n=>{if(n.options.validateSearch)try{Object.assign(e,Vr(n.options.validateSearch,{...e,...t}))}catch{}}),t=e}return t},_=h.length?Kr(h,g(),n):n.search===!0?g():typeof n.search==`function`?n.search(g()):n.search||Wr,v=this.options.stringifySearch(_),y=n.hash===!0?a().hash:typeof n.hash==`function`?n.hash(a().hash):n.hash||void 0,b=y?`#${y}`:``,ee=n.state?n.state===!0?a().state:typeof n.state==`function`?n.state(a().state):n.state:Wr,x=`${m}${v}${b}`,S,C,te=!1;if(this.rewrite){let e=new URL(x,this.origin),t=e.origin,n=_r(this.rewrite,e);S=jr(e),Ar(n,t)?(C=n.href,te=!0):C=Cr(jr(n))}else S=Me(x),C=S;return{publicHref:C,href:S,pathname:m,search:_,searchStr:v,state:ee,hash:y??``,external:te,unmaskOnReload:n.unmaskOnReload}},r=n(e);if(e.mask)r.maskedLocation=n({from:e.from,...e.mask});else if(this.options.routeMasks){let t=nr(r.pathname,this.processedTree);if(t){let i=Object.assign(Pe(),t.rawParams),{from:a,params:o,...s}=t.route,c=Hr(o,i);r.maskedLocation=n({from:e.from,...s,params:c})}}return!t&&e._fromLocation&&!r.maskedLocation&&this.staticLocations.set(e,r),r},this.commitLocation=async({viewTransition:e,ignoreBlocker:t,...n})=>{let r=n.maskedLocation??n;if(r.external)return Rr(this,r.publicHref,{replace:n.replace,ignoreBlocker:t});let i,a=ot(this.latestLocation.href)===ot(n.href)&&Ze(Pr(n.state),Pr(this.latestLocation.state)),o=this._commitPromise,s,c=new Promise(e=>{s=e});if(c.resolve=()=>{s(),o?.resolve()},this._commitPromise=c,a)this.load();else{let{maskedLocation:r,hashScrollIntoView:a,...o}=n;r&&(o={...r,state:{...r.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={...o.state,__hashScrollIntoViewOptions:a??this.options.defaultHashScrollIntoView??!0},this.shouldViewTransition=e,i=n.replace?`REPLACE`:`PUSH`,this.history[i===`REPLACE`?`replace`:`push`](o.publicHref,o.state,{ignoreBlocker:t}),this.history.subscribers.size||this.load({action:{type:i}})}return this._scroll.n=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=n?Re(n):void 0;if(a||t){if(e!==void 0||!n){let t=this.buildLocation({to:e,...i}),a=t.maskedLocation??t;n??=a.publicHref,r??=a.publicHref}let t=!a&&r?r:n;return Rr(this,t,i)}return this.buildAndCommitLocation({...i,href:n,to:e,_isNavigate:!0})},this.load=async e=>{this.updateLatestLocation(),e?.action&&(this._scroll.h=e.action.type===`PUSH`||e.action.type===`REPLACE`),await Ri(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(Nr(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,a=e=>{(!n||n(e))&&i.add(e.id)};t.forEach(a),this._cache.forEach(a),r?.forEach(e=>e.forEach(a)),this._tx?.[3].forEach(a);let o=[];for(let[e,t]of r??[])t.some(e=>i.has(e.id))&&(r.delete(e),o.push(e));let s=t=>{if(i.has(t.id)){let n=this.routesById[t.routeId],r={...t,invalid:!0,...(e?.forcePending||t.status===`error`||t.status===`notFound`)&&Mr(n)?{status:`pending`,error:void 0}:void 0};return t._flight=void 0,r}return t};this._committed=t.map(s);for(let[t,n]of this._cache)i.has(t)&&(n.invalid=!0,e?.forcePending&&(n.status=`pending`));for(let e of i){let t=this._flights?.get(e);this._flights?.delete(e),t&&!t[2]&&o.push(t[1])}for(let e of o)e.abort();return this.shouldViewTransition=!1,this.load({sync:e?.sync})},this.resolveRedirect=e=>{let t=e.options,n=e.headers.get(`Location`)||t.href;if(!n){let e=this.buildLocation(t);n=(e.maskedLocation??e).publicHref||`/`}let r;if(lt.test(n)||(r=Re(n))&&!this.protocolAllowlist.has(r))throw Error(`Redirect blocked: unsafe protocol`);if(r===`http:`||r===`https:`){let e=new URL(n);e.pathname.startsWith(`//`)?n=e.href:Ar(e,this.origin)||(n=jr(e),r=void 0)}return r&&(t.reloadDocument=!0),t.href=n,e.headers.set(`Location`,n),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=Zr,this.preloadRoute=e=>zi(this,e),this.matchRoute=(e,t)=>{let n={...e,to:e.to?st(e.from||``,e.to,this.options.trailingSlash,this.resolvePathCache):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=rr(r.pathname,t?.caseSensitive??!1,t?.fuzzy??!1,a.pathname,this.processedTree);return!o||e.params&&!Ze(o.rawParams,e.params,!0)?!1:t?.includeSearch??!0?Ze(a.search,r.search,!0)?o.rawParams:!1:o.rawParams},this.getStoreConfig=t,e.pathParamsAllowedCharacters?.length&&(this.pathParamsDecoder=ct(e.pathParamsAllowedCharacters)),this.update({defaultPreloadDelay:50,defaultPendingMs:1e3,defaultPendingMinMs:500,context:void 0,...e,caseSensitive:e.caseSensitive??!1,notFoundMode:e.notFoundMode??`fuzzy`,stringifySearch:e.stringifySearch??Wn,parseSearch:e.parseSearch??Un,protocolAllowlist:e.protocolAllowlist??We}),self.__TSR_ROUTER__=this}isShell(){return!!this.options.isShell}get state(){return this.stores.__store.get()}setRoutes(e){Object.assign(this,e),this.lightweightCache=new WeakMap,this.staticLocations=new WeakMap;let t=this.options.notFoundRoute;t&&(t.init(99999999999),this.routesById[t.id]!==t&&(t._interpolation=Qn(!1,t,0)),this.routesById[t.id]=t)}matchRoutesInternal(e,t){let[n,r,i]=this.getMatchedRoutes(e.pathname),a=n,o=!1;(i?i.path!==`/`&&r[`**`]:ot(e.pathname))&&(this.options.notFoundRoute?a=[...a,this.options.notFoundRoute]:o=!0);let s=o?qr(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;ntypeof t!=`string`&&!Ve.call(e,t[1]))}var Wr=Object.freeze({});function Gr(e,t){let n=[];for(let r=0;r{let n=t(i.preSearchFilters?i.preSearchFilters.reduce((e,t)=>t(e),e):e);return i.postSearchFilters?i.postSearchFilters.reduce((e,t)=>t(e),n):n});let a=i.validateSearch;t&&a&&n.push(({search:e,next:t,meta:n})=>{let r=t(e);try{let e=Vr(a,r);if(n&&e)for(let t in e)t in r||(n.defaulted||=new Map).set(t,e[t]);return{...r,...e}}catch{}return r})}return n}function Kr(e,t,n){let r=(t,i,a)=>{if(t>=e.length){if(!n.search)return{};if(n.search===!0)return i;let e=Xe(n.search,i);return a&&(a.explicit=e),e}return e[t]({search:i,next:(e,n)=>{if(n){let n=a||{};return{search:r(t+1,e,n),meta:n}}return r(t+1,e,a)},meta:a})};return r(0,t)}function qr(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 zt}function Jr(e,t){let n=e.options.params?.parse??e.options.parseParams;n&&Object.assign(t,n(t))}function Yr(e,t){return e.options[t]?.preload?.()}function Xr(e,t){let n=Yr(e,`component`),r=Yr(e,`pendingComponent`);return t&&(r?r=r.then(t):t()),n&&r?Promise.all([n,r]).then(()=>{}):n??r}function Zr(e,t,n){let r=()=>t===!1?void 0:t?Yr(e,t):Xr(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 Qr(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).then(()=>t.removeEventListener(`abort`,i))})}function oi(e,t){return e.routesById[t.routeId]}function si(e,t,n){return jt(e)?[ni,e]:Tn(e)?(e.routeId||=n,[ti,e]):t?(typeof e?.then==`function`&&(e=Error(`A Promise was thrown`,{cause:e})),[ei,e]):[$r,e]}function ci(e,t){let n=si(t,!0,e.id);if(n[0]!==ei)return n;try{e.options.onError?.(n[1])}catch(t){n=si(t,!0,e.id)}return n}function li(e,t,n,r,i){return i[0].signal.aborted?ri:Ti(e,t,n,ci(n,r),i)}async function ui(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 fi(e,r),[i,li(e,t,u,a,n)]}if(c.aborted)return[i,ri];let p=r.paramsError??r.searchError;if(p!==void 0)return fi(e,r),[i,li(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{hi(e,r,`beforeLoad`,n[0]);let a=m({...f,search:r.search,context:r.context,...e.options.additionalContext}),o=await(typeof a?.then==`function`?ai(a,c):a);if(c.aborted)return[i,ri];let s=Ti(e,t,u,si(o,!1,u.id),n);if(s[0]!==$r)return fi(e,r),[i,s];r.context={...r.context,...o}}catch(a){return fi(e,r),[i,li(e,t,u,a,n)]}finally{r.status=h,hi(e,r,!1,n[0])}}i()}function di(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 fi(e,t){let n=t._flight;t._flight=void 0,di(e,t,n)?.abort()}function pi(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=di(e,a,t);n&&i.push(n)}}for(let e of i)e.abort()}function mi(e){for(let t of e){let e=t._flight;e&&e[2]++}}function hi(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 gi(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 _i(e,t,n,r,i,a,o){let s=o[0],c=s.signal;if(c.aborted)return ri;if(!i)return[$r,void 0];let l=n._flight;hi(e,n,`loader`,s);try{if(!l){let s=new AbortController;l=[Promise.resolve().then(()=>i(gi(e,t,n,r,s,a,!!o[3]))).then(e=>si(e,!1,r.id),e=>si(e,!0,r.id)).then(t=>(t[0]!==$r&&e._flights?.get(n.id)===l&&(e._flights.delete(n.id),l[2]||s.abort()),t[0]===ei&&l[2]?ci(r,t[1]):t)),s,1],(e._flights??=new Map).set(n.id,l)}return n._flight=l,n.abortController=l[1],Ti(e,t,r,await ai(l[0],c),o)}catch(t){if(t!==c||!c.aborted)throw t;return fi(e,n),ri}finally{hi(e,n,!1,s)}}function vi(e,t,n){t[0]!==ni&&(e.status=`success`,e.error=void 0,t[0]===$r?(e.loaderData=t[1],e.invalid=!1,e.updatedAt=Date.now(),e.preload=n):e.invalid=!0)}function yi(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&&fi(e,r)}function bi(e,t){return t[0]===ei||t[0]===ti?{...e,status:t[0]===ei?`error`:`notFound`,error:t[1],_flight:void 0}:e}function xi(e,t,n,r,i,a,o){let s=t[1][n],c=oi(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(gi(e,t,s,c,a[0],i,l))),a[0].signal.aborted&&(p=ri)),!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,fi(e,s),p=li(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&&_,ee=b&&!y&&(s.status!==`success`||!!m),x=n>=o?a[7]:void 0,S=c.lazyFn&&c._lazy!==!0?x:void 0;if(b&&!m&&(s.invalid=!1,s.updatedAt=Date.now()),v&&v[2]++,ee){let t=s._flight;s._flight=v,di(e,s,t)?.abort(),n>=o&&(s.status=`pending`),x?.()}b||(s.isFetching=!1);let C=!p&&ee?_i(e,t,s,c,g,i,a).then(t=>(vi(s,t,l),t[0]===$r&&(m&&!a[0].signal.aborted&&yi(e,s,u),n>=o&&(s.status=`pending`)),t)):Promise.resolve(p??[$r,s.loaderData]),te=(async()=>{try{let e=Zr(c,void 0,S);e&&await ai(e,a[0].signal)}catch(r){if(!t[1].some((e,t)=>t<=n&&(e.status===`error`||e.status===`notFound`||e._notFound)))return[n,li(e,t,c,r,a)]}let r=await C;ee&&r[0]===$r&&s.status===`pending`&&!a[0].signal.aborted&&(s.status=`success`,x?.())})();if(r.push([n,C,te]),!y)return C.then(e=>bi(s,e));let ne={...s,status:`pending`,preload:!1,_flight:v};s.invalid=!1,s.isFetching=`loader`;let w=_i(e,t,ne,c,g,i,a).then(e=>(s.isFetching=!1,vi(ne,e,!1),e));return(t[2]??=[]).push([n,w,te,ne]),w.then(e=>bi(ne,e))}async function Si(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=oi(e,t[n]);try{let e=Zr(i,!1);e&&await ai(e,r)}catch(e){if(e===r&&r.aborted)throw e}if(i.options.notFoundComponent)return n}return a?.routeId?o:i}function Ci(e,t){t[2]&&=(pi(e,t[2].map(e=>e[3])),void 0)}async function wi(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]>=ni)throw[a,t];!i&&t[0]!==$r&&(i=[a,t],await Promise.all((n??[]).map(e=>{if(!(e[0]<=a))return e[1].then(t=>{if(t[0]===ni)throw[e[0],t]})})))}})))}catch(e){return e}return t??i}function Ti(e,t,n,r,i,a){for(;r[0]===ni;){let o=r[1],s=o.options;try{if((s.href||o.headers.has(`Location`))&&(e.resolveRedirect(o),s.reloadDocument)||(s.reloadDocument?i[3]:i[1]>=20))return r;let n=e.buildLocation({...s,_fromLocation:t[0],_includeValidateSearch:!0}),a=n.maskedLocation??n;if(a.external){let t=o.clone();return t.options={...s},t.headers.set(`Location`,a.publicHref),e.resolveRedirect(t),i[3]?[ni,t]:[ni,t,a]}return[ni,o,n]}catch(e){r=a?[ei,e]:ci(n,e),a=!0}}return r}async function Ei(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]===ti?Si(e,o,t,r.signal):t[0],d=l<0?o.length:l;if((s?.[1][0]??0)>=ni)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]!==$r&&t[0]=d)break;let t=await e[2];if(t){s=t;break}}if((s?.[1][0]??0)>=ni){let n=s[1];if(n[0]!==ni||n[1].options.reloadDocument||n[2])return Ci(e,t),n;c=!0,s=[0,[ei,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===ei?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=oi(e,u);try{await ai(i?Promise.resolve().then(()=>Zr(m,l===ei?`errorComponent`:`notFoundComponent`)):Promise.all([Zr(m),Zr(m,`notFoundComponent`)]),r.signal)}catch(n){if(n===r.signal&&r.signal.aborted)return Ci(e,t),ri}i?c&&(r.abort(),await Promise.all([...n.map(e=>e[1]),...n.map(e=>e[2]),...(t[2]??[]).map(e=>e[1])]),Ci(e,t),pi(e,o),p()):u.status=`success`}return t}async function Di(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 Si(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=ni&&(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=Ei(e,i,u,r[0],wi(u,m,i[2]),r[7]);i[2]?.length&&(i[3]=wi(i[2],void 0,void 0,h.then(e=>ii(e)?0:Qr(n).length,()=>0))),o=await h}catch(t){if(Ci(e,i),t===a&&a.aborted)return ri;throw t}return ii(o)?o:Di(e,o,a,r[6]===n.length?r[6]:0)}function ki(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(()=>ki(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 Ai(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 ji(e,t){let n=e._pending;if(!n)return;clearTimeout(n[3]);let r=n[2]-Date.now();if(!n[4]||r<=0||!Qr(t[3]).some(e=>e.id===n[1]))return;let i;try{await ai(new Promise(e=>{i=setTimeout(e,r)}),t[0].signal)}catch{}clearTimeout(i)}function Mi(e,t){e._committed=t,e.stores.setMatches(t)}function Ni(e,t,n,r){let i=e._committed,a=e._lifecycleEnd,o=e._cache;for(let e of n)e.preload=!1,r&&(e._assetEnd=void 0);let s=Qr(n).length,c=new Map;{let t=Date.now(),r=new Set;for(let e=0;e=(n.preload?i.options.preloadGcTime??e.options.defaultPreloadGcTime??3e5:i.options.gcTime??e.options.defaultGcTime??3e5)||c.set(n.id,o.get(n.id)===n?n:{...n,_flight:void 0,isFetching:!1,context:{}})}}t[3]=[],e._cache=c;let l=e._lifecycleEnd=Fr(n);Mi(e,n),pi(e,[...o.values(),...i].filter(e=>e._flight&&c.get(e.id)!==e),n),Ir(e,i,n,a,l,t)}async function Pi(e,t){let n=e._tx;for(;n&&n!==t;)t=n,await n[5],n=e._tx}function Fi(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.maskedLocation??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 Ii(e,t,n,r,i){let a=n.map(e=>({...e}));mi(a);for(let t of r)fi(e,a[t[0]]),a[t[0]]=t[3];let o=[t[2],a],s;try{s=await Ei(e,o,r,t[0],i)}catch(t){throw pi(e,a),t}if(ii(s)){pi(e,a),s[0]===ni&&e._tx===t&&e._committed===n&&await Fi(e,t,s);return}if(await Di(e,s,t[0].signal),e._tx!==t||e._committed!==n){pi(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),fi(e,n))}Mi(e,a),pi(e,n,a)}async function Li(e,t,n,r,i,a){let o=await Oi(e,t[2],t[3],[t[0],t[1],e._committed,void 0,i,n,a,r]);if(ii(o)){let n=o[0]===ni&&e._tx===t;if((!n||o[1].options.reloadDocument)&&Ai(e,t),pi(e,t[3]),t[3]=[],!n)return;if(e._tx!==t){Ai(e,t);return}await Fi(e,t,o);return}let s=o[1];if(e._tx===t&&await ji(e,t),e._tx!==t){Ai(e,t),pi(e,s),Ci(e,o);return}let c=t[2],l=Nr(c,e.stores.resolvedLocation.get()),u=o[2];await e.startViewTransition(async()=>{if(e._tx===t&&await ji(e,t),e._tx!==t){Ai(e,t),pi(e,s),Ci(e,o);return}let n=await e.startTransition(()=>{Ai(e,t),Ni(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){Ci(e,o);return}u?.length&&Ii(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 Ri(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=Nr(a,r);e.emit({type:`onBeforeNavigate`,...t}),u.signal.aborted||e.emit({type:`onBeforeLoad`,...t})}if(u.signal.aborted){await Pi(e,n);return}let f=i.href===a.href,p=u,m=e.matchRoutes(a,{_controller:u});mi(m);let h=l?c[1](m):void 0;if(h?p=l:l?.abort(),u.signal.aborted){pi(e,m),await Pi(e,n);return}e._preflight=void 0;let g,_=()=>Li(e,y,f,()=>ki(e,y),t?.sync,h),v=t?.sync?new Promise(e=>g=e):Promise.resolve().then(_),y=[p,s,a,m,Date.now(),v.then(()=>Pi(e,y))];if(e._tx=y,n){for(let t of e.stores.matches.get()){if(e._tx!==y)break;t.isFetching&&hi(e,t,!1)}n[0].abort(),pi(e,n[3],y[3],!0)}if(e._tx!==y){pi(e,y[3]),y[3]=[],g?.(),await Pi(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))&&ki(e,y),g?.(_()),await y[5]}async function zi(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}),mi(a),o=(e._preloads??=new Map).set(i,a),s=await Oi(e,n,a,[i,t,r,!0])}finally{o&&(o=o.delete(i),pi(e,a)),i.abort()}if(!ii(s))return s[1];if(!o||s.length<3)return;n=s[2]}catch(e){Tn(e)||console.error(e);return}}}var D=h(Ce(),1),O=x(),Bi=class extends D.Component{constructor(...e){super(...e),this.state={error:0},this.reset=()=>{this.setState({error:0})}}static getDerivedStateFromProps(e,t){let n=e.getResetKey();return t.error&&t.resetKey!==n?{resetKey:n,error:0}:{resetKey:n}}static getDerivedStateFromError(e){return{error:[e]}}componentDidCatch(e,t){this.props.onCatch?.(e,t)}render(){let e=this.state.error;return e?D.createElement(this.props.errorComponent??Vi,{error:e[0],reset:this.reset}):this.props.children}};function Vi({error:e}){let[t,n]=D.useState(!1);return(0,O.jsxs)(`div`,{style:{padding:`.5rem`,maxWidth:`100%`},children:[(0,O.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:`.5rem`},children:[(0,O.jsx)(`strong`,{style:{fontSize:`1rem`},children:`Something went wrong!`}),(0,O.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,O.jsx)(`div`,{style:{height:`.25rem`}}),t?(0,O.jsx)(`div`,{children:(0,O.jsx)(`pre`,{style:{fontSize:`.7em`,border:`1px solid red`,borderRadius:`.25rem`,padding:`.3rem`,color:`red`,overflow:`auto`},children:e?.message?(0,O.jsx)(`code`,{children:e.message}):null})}):null]})}function Hi(e){let t=se(),n=`not-found-${Je(t.stores.location,e=>e.pathname)}-${Je(t.stores.status)}`;return(0,O.jsx)(Bi,{getResetKey:()=>n,onCatch:(t,n)=>{if(Tn(t))e.onCatch?.(t,n);else throw t},errorComponent:({error:t})=>{if(Tn(t))return e.fallback?.(t);throw t},children:e.children})}function Ui(){return(0,O.jsx)(`p`,{children:`Not Found`})}function Wi(e,t,n){return t.options.notFoundComponent?(0,O.jsx)(t.options.notFoundComponent,{...n}):e.options.defaultNotFoundComponent?(0,O.jsx)(e.options.defaultNotFoundComponent,{...n}):(0,O.jsx)(Ui,{})}function Gi(e,t){let n=t?.options.pendingComponent??e.options.defaultPendingComponent;return n?(0,O.jsx)(n,{}):null}var Ki=(e,t)=>e[0]===t[0]&&e[1]===t[1],qi=(e,t,n)=>!t.isRoot||t.options.shellComponent||t.options.wrapInSuspense||n===!1||n===`data-only`||!e.ssr,Ji=D.memo(function({routeId:e}){let t=se();return(0,O.jsx)(Yi,{router:t,match:Je(t.stores.getMatchStore(e))})});function Yi({router:e,match:t}){let n=e.routesById[t.routeId],r=Gi(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=qi(e,n,t.ssr)&&(n.options.wrapInSuspense??r??(n.options.errorComponent?.preload||s)),l=(0,O.jsx)(Xi,{match:t});s&&(l=(0,O.jsx)(Ge,{fallback:r,children:l})),o&&(l=(0,O.jsx)(Hi,{fallback:e=>{if(e.routeId??=t.routeId,e.routeId!==t.routeId)throw e;return D.createElement(o,e)},children:l})),i&&(l=(0,O.jsx)(Bi,{getResetKey:()=>t,errorComponent:i,onCatch:(e,n)=>{if(Tn(e))throw e.routeId??=t.routeId,e;a?.(e,n)},children:l})),c&&(l=(0,O.jsx)(D.Suspense,{fallback:r,children:l}));let u=n.isRoot?n.options.shellComponent:void 0;return(0,O.jsx)(Dt.Provider,{value:t.routeId,children:u?(0,O.jsxs)(u,{children:[l,null]}):(0,O.jsxs)(O.Fragment,{children:[l,null]})})}var Xi=D.memo(function({match:e}){let t=se(),n=e.routeId,r=t.routesById[n],i=D.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=D.useMemo(()=>{let e=r.options.component??t.options.defaultComponent;return e?(0,O.jsx)(e,{},i):(0,O.jsx)(Zi,{})},[i,r.options.component,t.options.defaultComponent]);if(e.status===`pending`){if(t.ssr&&!qi(t,r,e.ssr))return a;if(t._tx)throw t._tx[5];return Gi(t,r)}if(e.status===`notFound`)return Wi(t,r,e.error);if(e.status===`error`)throw e.error;return a}),Zi=D.memo(function(){let e=se(),t=D.useContext(Dt),n,r,i;{let a=e.stores.getMatchStore(t);[n,r]=Je(a,e=>[!!e._notFound,e.error],{compare:Ki}),i=Je(e.stores.ids,e=>e[e.indexOf(t)+1])}if(n)return Wi(e,e.routesById[t],r);if(!i)return null;let a=(0,O.jsx)(Ji,{routeId:i});return t===`__root__`?(0,O.jsx)(D.Suspense,{fallback:Gi(e),children:a}):a});function Qi(e,t){let n=e[1];e.length=0,n?.(t)}function $i({t:e}){let t=se(),n=t._rendered??=[];return t.startTransition=(r,i)=>new Promise(a=>{Qi(n,!1),n.push(i,a),e(t),D.startTransition(r)}),De(()=>{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(ot(r.publicHref)!==ot(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`,...Nr(a,a)})}):t._tx||t.load({sync:!0}).catch(console.error),e},[t,t.history]),null}function ea(){let e=se(),t=e.routesById[zt],n=Gi(e,t),r=(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)($i,{t:D.useState()[1]}),e.ssr?(0,O.jsx)(ta,{}):(0,O.jsx)(D.Suspense,{fallback:n,children:(0,O.jsx)(ta,{})})]});return e.options.InnerWrap?(0,O.jsx)(e.options.InnerWrap,{children:r}):r}function ta(){let e=se(),t=e._rendered,n=Je(e.stores.matches,e=>t[0]??e),r=n[0],i=r?.routeId;De(()=>{t[0]===n&&Qi(t,!0)},[t,n]);let a=i?(0,O.jsx)(Ji,{routeId:i}):null;return e.options.disableGlobalCatchBoundary?a:(0,O.jsx)(Bi,{getResetKey:()=>r,onCatch:void 0,children:a})}var na=e=>({createMutableStore:It,createReadonlyStore:It,batch:Pt}),ra=e=>new ia(e),ia=class extends Lr{constructor(e){super(e,na)}};function aa({router:e,children:t,...n}){ze(n)&&e.update({...e.options,...n,context:{...e.options.context,...n.context}});let r=(0,O.jsx)(oe.Provider,{value:e,children:t});return e.options.Wrap?(0,O.jsx)(e.options.Wrap,{children:r}):r}function oa({router:e,...t}){return(0,O.jsx)(aa,{router:e,...t,children:(0,O.jsx)(ea,{})})}function sa(e){let t=se({warn:e?.router===void 0}),n=e?.router||t;return Je(n.stores.__store,Tt(e,n))}function ca(e,t,n={leading:!1}){let[r,i]=(0,D.useState)(e),a=(0,D.useRef)(!1),o=(0,D.useRef)(null),s=(0,D.useRef)(!1),c=(0,D.useRef)(e);c.current=e;let l=(0,D.useCallback)(()=>{window.clearTimeout(o.current),o.current=null},[]),u=(0,D.useCallback)(()=>{l(),s.current=!1},[]),d=(0,D.useCallback)(()=>{o.current&&(u(),s.current=!1,i(c.current))},[]);return(0,D.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,D.useEffect)(()=>(a.current=!0,u),[]),[r,u,{cancel:u,flush:d}]}function la(e=!1,t={}){let[n,r]=(0,D.useState)(e),i=(0,D.useCallback)(()=>{r(e=>e||(t.onOpen?.(),!0))},[t.onOpen]),a=(0,D.useCallback)(()=>{r(e=>e&&(t.onClose?.(),!1))},[t.onClose]);return[n,{open:i,close:a,toggle:(0,D.useCallback)(()=>{n?a():i()},[a,i,n]),set:r}]}function ua(e){return e===`auto`||e===`dark`||e===`light`}function da({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 ua(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&&ua(t.newValue)&&n(t.newValue)},window.addEventListener(`storage`,t)},unsubscribe:()=>{window.removeEventListener(`storage`,t)},clear:()=>{window.localStorage.removeItem(e)}}}function fa(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 pa({manager:e,defaultColorScheme:t,getRootElement:n,forceColorScheme:r}){let i=(0,D.useRef)(null),[a,o]=(0,D.useState)(()=>e.get(t)),s=r||a,c=(0,D.useCallback)(t=>{r||(fa(t,n),o(t),e.set(t))},[e.set,s,r]),l=(0,D.useCallback)(()=>{o(t),fa(t,n),e.clear()},[e.clear,t]);return(0,D.useEffect)(()=>(e.subscribe(c),e.unsubscribe),[e.subscribe,e.unsubscribe]),he(()=>{fa(e.get(t),n)},[]),(0,D.useEffect)(()=>{if(r)return fa(r,n),()=>{};r===void 0&&fa(a,n),typeof window<`u`&&`matchMedia`in window&&(i.current=window.matchMedia(`(prefers-color-scheme: dark)`));let e=e=>{a===`auto`&&fa(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 ma(e){return Object.entries(e).map(([e,t])=>`${e}: ${t};`).join(``)}function ha(e,t){let n=t?[t]:[`:root`,`:host`],r=ma(e.variables),i=r?`${n.join(`, `)}{${r}}`:``,a=ma(e.dark),o=ma(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 k({theme:e,color:t,colorScheme:n,name:r=t,withColorValues:i=!0}){if(!e.colors[t])return{};if(n===`light`){let n=s(e,`light`),o={[`--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`]:a(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],...o}:o}let o=s(e,`dark`),c={[`--mantine-color-${r}-text`]:`var(--mantine-color-${r}-4)`,[`--mantine-color-${r}-filled`]:`var(--mantine-color-${r}-${o})`,[`--mantine-color-${r}-filled-hover`]:`var(--mantine-color-${r}-${o===9?8:o+1})`,[`--mantine-color-${r}-light`]:v(e.colors[t][9],.5),[`--mantine-color-${r}-light-hover`]:v(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(o-4,0)})`,[`--mantine-color-${r}-outline-hover`]:a(e.colors[t][Math.max(o-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],...c}:c}function ga(e,t,n){de(t).forEach(r=>Object.assign(e,{[`--mantine-${n}-${r}`]:t[r]}))}var _a=e=>{let t=s(e,`light`),n=e.defaultRadius in e.radius?e.radius[e.defaultRadius]:T(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":xt(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":xt(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)`}};ga(r.variables,e.breakpoints,`breakpoint`),ga(r.variables,e.spacing,`spacing`),ga(r.variables,e.fontSizes,`font-size`),ga(r.variables,e.lineHeights,`line-height`),ga(r.variables,e.shadows,`shadow`),ga(r.variables,e.radius,`radius`),ga(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})`}),de(e.colors).forEach(t=>{let n=e.colors[t];if(i(n)){Object.assign(r.light,k({theme:e,name:n.name,color:n.light,colorScheme:`light`,withColorValues:!0})),Object.assign(r.dark,k({theme:e,name:n.name,color:n.dark,colorScheme:`dark`,withColorValues:!0})),r.light[`--mantine-color-${n.name}-contrast`]=bt(n,e,`light`),r.dark[`--mantine-color-${n.name}-contrast`]=bt(n,e,`dark`);return}n.forEach((e,n)=>{r.variables[`--mantine-color-${t}-${n}`]=e}),Object.assign(r.light,k({theme:e,color:t,colorScheme:`light`,withColorValues:!1})),Object.assign(r.dark,k({theme:e,color:t,colorScheme:`dark`,withColorValues:!1}))});let a=e.headings.sizes;return de(a).forEach(t=>{r.variables[`--mantine-${t}-font-size`]=a[t].fontSize,r.variables[`--mantine-${t}-line-height`]=a[t].lineHeight,r.variables[`--mantine-${t}-font-weight`]=a[t].fontWeight||e.headings.fontWeight}),r};function va(){let e=f(),n=t(),r=de(e.breakpoints).reduce((t,n)=>{let r=e.breakpoints[n].includes(`px`),i=kt(e.breakpoints[n]);return`${t}@media (max-width: ${r?`${i-.1}px`:re(i-.1)}) {.mantine-visible-from-${n} {display: none !important;}}@media (min-width: ${r?`${i}px`:re(i)}) {.mantine-hidden-from-${n} {display: none !important;}}`},``);return(0,O.jsx)(`style`,{"data-mantine-styles":`classes`,nonce:n?.(),dangerouslySetInnerHTML:{__html:r}})}function ya({theme:e,generator:t}){let n=_a(e),r=t?.(e);return r?me(n,r):n}var ba=_a(r);function xa(e){let t={variables:{},light:{},dark:{}};return de(e.variables).forEach(n=>{ba.variables[n]!==e.variables[n]&&(t.variables[n]=e.variables[n])}),de(e.light).forEach(n=>{ba.light[n]!==e.light[n]&&(t.light[n]=e.light[n])}),de(e.dark).forEach(n=>{ba.dark[n]!==e.dark[n]&&(t.dark[n]=e.dark[n])}),t}function Sa(e){return ha({variables:{},dark:{"--mantine-color-scheme":`dark`},light:{"--mantine-color-scheme":`light`}},e)}function Ca({cssVariablesSelector:e,deduplicateCssVariables:n}){let r=f(),i=t(),a=ya({theme:r,generator:p()}),o=(e===void 0||e===`:root`||e===`:host`)&&n,s=ha(o?xa(a):a,e);return s?(0,O.jsx)(`style`,{"data-mantine-styles":!0,nonce:i?.(),dangerouslySetInnerHTML:{__html:`${s}${o?``:Sa(e)}`}}):null}Ca.displayName=`@mantine/CssVariables`;function wa({respectReducedMotion:e,getRootElement:t}){he(()=>{e&&t()?.setAttribute(`data-respect-reduced-motion`,`true`)},[e])}function Ta({theme:e,children:t,getStyleNonce:n,withStaticClasses:r=!0,withGlobalClasses:i=!0,deduplicateCssVariables:a=!0,withCssVariables:s=!0,cssVariablesSelector:c,classNamesPrefix:l=`mantine`,colorSchemeManager:u=da(),defaultColorScheme:f=`light`,getRootElement:p=()=>document.documentElement,cssVariablesResolver:m,forceColorScheme:h,stylesTransform:g,env:_,deduplicateInlineStyles:v=!1}){let{colorScheme:y,setColorScheme:b,clearColorScheme:ee}=pa({defaultColorScheme:f,forceColorScheme:h,manager:u,getRootElement:p});return wa({respectReducedMotion:e?.respectReducedMotion||!1,getRootElement:p}),(0,O.jsx)(o,{value:{colorScheme:y,setColorScheme:b,clearColorScheme:ee,getRootElement:p,classNamesPrefix:l,getStyleNonce:n,cssVariablesResolver:m,cssVariablesSelector:c??`:root`,withStaticClasses:r,stylesTransform:g,env:_,deduplicateInlineStyles:v},children:(0,O.jsxs)(d,{theme:e,children:[s&&(0,O.jsx)(Ca,{cssVariablesSelector:c,deduplicateCssVariables:a}),i&&(0,O.jsx)(va,{}),t]})})}Ta.displayName=`@mantine/core/MantineProvider`;function Ea(e){return e}var[Da,Oa]=Ht(`AppShell was not found in tree`);function ka({size:e,min:t,max:n,viewportMax:r}){let i=Math.min(n??1/0,r);return Math.max(Math.min(t??0,i),Math.min(e,i))}function Aa(e,t){return t!==void 0&&ep.axis===`horizontal`?window.innerWidth:window.innerHeight,[g,_]=(0,D.useState)(0),[v,y]=(0,D.useState)(void 0),b=()=>h()/d.scale,ee=e=>{let t=e.getBoundingClientRect();return((p.axis===`horizontal`?t.width:t.height)-Pa(e,p.safeAreaVariable))/d.scale},x=t=>{let n=r.rootRef.current;if(!n)return;let i=T(t);n.style.setProperty(p.sizeVariable,i),r.resizeOffsets[e]&&n.style.setProperty(p.offsetVariable,i),r.mode===`static`&&p.gridWidthVariable&&n.style.setProperty(p.gridWidthVariable,i)},S=()=>{let e=r.rootRef.current;e&&(e.style.removeProperty(p.sizeVariable),e.style.removeProperty(p.offsetVariable),p.gridWidthVariable&&e.style.removeProperty(p.gridWidthVariable))},C=()=>{c.current?.abort(),c.current=null,s.current=null;let e=l.current;l.current=null,e&&(za(`user-select`,e.userSelect),za(`-webkit-user-select`,e.webkitUserSelect),za(`cursor`,e.cursor))},te=()=>{i?.reportCollapse(e,Aa(o.current.startSize,m.collapseThreshold)),i?.endResize(e,null)},ne=t=>{if(t.pointerId!==s.current)return;o.current.moved=!0;let n=Na({section:e,deltaX:t.clientX-o.current.startX,deltaY:t.clientY-o.current.startY,dir:u})/d.scale,r=o.current.startSize+n,c=ka({size:r,min:m.min,max:m.max,viewportMax:b()});o.current.size=c,x(c),a.current?.setAttribute(`aria-valuenow`,String(Math.round(c))),i?.previewResize(e,c),i?.reportCollapse(e,Aa(r,m.collapseThreshold))},w=t=>{if(t.pointerId===s.current){if(C(),!o.current.moved){i?.endResize(e,null);return}i?.endResize(e,o.current.size)}},re=e=>{e.pointerId===s.current&&(C(),S(),te())},ie=e=>{e.key===`Escape`&&(e.preventDefault(),C(),S(),a.current?.setAttribute(`aria-valuenow`,String(Math.round(o.current.startSize))),te())},ae=()=>{let t=i?.[e].size;if(t!==void 0)return t;let n=a.current?.parentElement;return n?ee(n):0},oe=t=>{i?.initCollapse(e,Aa(ae(),m.collapseThreshold)),i?.reportCollapse(e,Aa(t,m.collapseThreshold)),i?.endResize(e,ka({size:t,min:m.min,max:m.max,viewportMax:b()}))},se=t=>{let n=t.shiftKey?La:Ia;if(t.key===`Home`){t.preventDefault(),oe(m.min??0);return}if(t.key===`End`){t.preventDefault(),oe(m.max??b());return}let r=Ra[t.key];if(!r)return;let i=Na({section:e,...r,dir:u});i!==0&&(t.preventDefault(),oe(ae()+i*n))},ce=()=>{S(),i?.[e].reset()},le=t=>{if(t.button!==0||c.current!==null)return;let n=a.current?.parentElement;if(!n)return;let r=ee(n);o.current={startSize:r,startX:t.clientX,startY:t.clientY,size:r,moved:!1},s.current=t.pointerId,i?.initCollapse(e,Aa(r,m.collapseThreshold));let u=new AbortController;c.current=u;let{signal:d}=u;l.current={userSelect:document.body.style.getPropertyValue(`user-select`),webkitUserSelect:document.body.style.getPropertyValue(`-webkit-user-select`),cursor:document.body.style.getPropertyValue(`cursor`)},document.body.style.setProperty(`user-select`,`none`),document.body.style.setProperty(`-webkit-user-select`,`none`),document.body.style.setProperty(`cursor`,p.axis===`horizontal`?`col-resize`:`row-resize`),i?.startResize(e),document.addEventListener(`pointermove`,ne,{signal:d}),document.addEventListener(`pointerup`,w,{signal:d}),document.addEventListener(`pointercancel`,re,{signal:d}),document.addEventListener(`keydown`,ie,{signal:d})};if(he(()=>{i&&i.activeSection!==e&&S()},[i?.activeSection,i?.[e].size]),he(()=>{_(h());let e=()=>_(h());return window.addEventListener(`resize`,e),()=>window.removeEventListener(`resize`,e)},[p.axis]),he(()=>{i?.[e].size===void 0&&y(ae())},[i?.[e].size,g]),he(()=>()=>{let e=c.current!==null;C(),S(),e&&te()},[]),!i?.[e].enabled)return null;let ue=g/d.scale,de=Math.min(m.max??ue,ue),fe=i[e].size,pe=fe!==void 0&&g>0?Math.min(fe,ue):fe??v;return(0,O.jsx)(n,{ref:a,role:`separator`,tabIndex:0,"aria-label":m.label??Fa[e],"aria-controls":t,"aria-orientation":p.orientation,"aria-valuemin":m.min??0,"aria-valuemax":Math.round(de),"aria-valuenow":pe===void 0?void 0:Math.round(pe),onPointerDown:le,onKeyDown:se,onDoubleClick:ce,mod:{section:e,orientation:p.orientation,active:i[e].active},...r.getStyles(`resizeHandle`)})}Ba.displayName=`@mantine/core/AppShellResizeHandle`;var Va={root:`m_89ab340`,navbar:`m_45252eee`,aside:`m_9cdde9a`,header:`m_3b16f56b`,main:`m_8983817`,footer:`m_3840c879`,section:`m_6dcfc7c7`,resizeHandle:`m_3b25945a`},Ha=g(e=>{let{classNames:t,className:r,style:i,styles:a,unstyled:o,vars:s,withBorder:c,zIndex:l,mod:d,...f}=u(`AppShellAside`,null,e),p=Oa(),m=_e(f.id);if(p.disabled)return null;let h=p.resize?.aside.enabled??!1,g=p.getStyles(`aside`,{className:b({[Zt.classNames.zeroRight]:p.offsetScrollbars},r),classNames:t,styles:a,style:i});if(!h)return(0,O.jsx)(n,{component:`aside`,mod:[{"with-border":c??p.withBorder},d],...g,...f,__vars:{"--app-shell-aside-z-index":`calc(${l??p.zIndex} + 1)`}});let{children:_,dangerouslySetInnerHTML:v,...y}=f;return(0,O.jsxs)(n,{component:`aside`,mod:[{"with-border":c??p.withBorder},d],...g,...y,__vars:{"--app-shell-aside-z-index":`calc(${l??p.zIndex} + 1)`},id:m,children:[v?(0,O.jsx)(`div`,{style:{display:`contents`},dangerouslySetInnerHTML:v}):_,(0,O.jsx)(Ba,{section:`aside`,sectionId:m})]})});Ha.classes=Va,Ha.displayName=`@mantine/core/AppShellAside`;var Ua=g(e=>{let{classNames:t,className:r,style:i,styles:a,unstyled:o,vars:s,withBorder:c,zIndex:l,mod:d,...f}=u(`AppShellFooter`,null,e),p=Oa(),m=_e(f.id);if(p.disabled)return null;let h=p.resize?.footer.enabled??!1,g=p.getStyles(`footer`,{className:b({[Zt.classNames.zeroRight]:p.offsetScrollbars},r),classNames:t,styles:a,style:i});if(!h)return(0,O.jsx)(n,{component:`footer`,mod:[{"with-border":c??p.withBorder},d],...g,...f,__vars:{"--app-shell-footer-z-index":(l??p.zIndex)?.toString()}});let{children:_,dangerouslySetInnerHTML:v,...y}=f;return(0,O.jsxs)(n,{component:`footer`,mod:[{"with-border":c??p.withBorder},d],...g,...y,__vars:{"--app-shell-footer-z-index":(l??p.zIndex)?.toString()},id:m,children:[v?(0,O.jsx)(`div`,{style:{display:`contents`},dangerouslySetInnerHTML:v}):_,(0,O.jsx)(Ba,{section:`footer`,sectionId:m})]})});Ua.classes=Va,Ua.displayName=`@mantine/core/AppShellFooter`;var Wa=g(e=>{let{classNames:t,className:r,style:i,styles:a,unstyled:o,vars:s,withBorder:c,zIndex:l,mod:d,...f}=u(`AppShellHeader`,null,e),p=Oa(),m=_e(f.id);if(p.disabled)return null;let h=p.resize?.header.enabled??!1,g=p.getStyles(`header`,{className:b({[Zt.classNames.zeroRight]:p.offsetScrollbars},r),classNames:t,styles:a,style:i});if(!h)return(0,O.jsx)(n,{component:`header`,mod:[{"with-border":c??p.withBorder},d],...g,...f,__vars:{"--app-shell-header-z-index":(l??p.zIndex)?.toString()}});let{children:_,dangerouslySetInnerHTML:v,...y}=f;return(0,O.jsxs)(n,{component:`header`,mod:[{"with-border":c??p.withBorder},d],...g,...y,__vars:{"--app-shell-header-z-index":(l??p.zIndex)?.toString()},id:m,children:[v?(0,O.jsx)(`div`,{style:{display:`contents`},dangerouslySetInnerHTML:v}):_,(0,O.jsx)(Ba,{section:`header`,sectionId:m})]})});Wa.classes=Va,Wa.displayName=`@mantine/core/AppShellHeader`;var Ga=g(e=>{let{classNames:t,className:r,style:i,styles:a,vars:o,...s}=u(`AppShellMain`,null,e),c=Oa();return(0,O.jsx)(n,{component:`main`,...c.getStyles(`main`,{className:r,style:i,classNames:t,styles:a}),...s})});Ga.classes=Va,Ga.displayName=`@mantine/core/AppShellMain`;var Ka=g(e=>{let{classNames:t,className:r,style:i,styles:a,unstyled:o,vars:s,withBorder:c,zIndex:l,mod:d,...f}=u(`AppShellNavbar`,null,e),p=Oa(),m=_e(f.id);if(p.disabled)return null;let h=p.resize?.navbar.enabled??!1,g=p.getStyles(`navbar`,{className:r,classNames:t,styles:a,style:i});if(!h)return(0,O.jsx)(n,{component:`nav`,mod:[{"with-border":c??p.withBorder},d],...g,...f,__vars:{"--app-shell-navbar-z-index":`calc(${l??p.zIndex} + 1)`}});let{children:_,dangerouslySetInnerHTML:v,...y}=f;return(0,O.jsxs)(n,{component:`nav`,mod:[{"with-border":c??p.withBorder},d],...g,...y,__vars:{"--app-shell-navbar-z-index":`calc(${l??p.zIndex} + 1)`},id:m,children:[v?(0,O.jsx)(`div`,{style:{display:`contents`},dangerouslySetInnerHTML:v}):_,(0,O.jsx)(Ba,{section:`navbar`,sectionId:m})]})});Ka.classes=Va,Ka.displayName=`@mantine/core/AppShellNavbar`;var qa=be(e=>{let{classNames:t,className:r,style:i,styles:a,vars:o,grow:s,mod:c,...l}=u(`AppShellSection`,null,e),d=Oa();return(0,O.jsx)(n,{mod:[{grow:s},c],...d.getStyles(`section`,{className:r,style:i,classNames:t,styles:a}),...l})});qa.classes=Va,qa.displayName=`@mantine/core/AppShellSection`;function Ja(e){return typeof e==`object`?e.base:e}function Ya(e,t){return`min(${T(e)}, ${t===`horizontal`?`100vw`:`100dvh`})`}function Xa(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 Za(e){return!(typeof e!=`object`||!e||Object.keys(e).length===1&&`base`in e)}function Qa({baseStyles:e,minMediaStyles:t,maxMediaStyles:n,aside:r,theme:i,mode:a,resizedSize:o,resizable:s}){let c=r?.width,l=`translateX(var(--app-shell-aside-width))`,u=`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`),s&&(n[r.breakpoint][`--app-shell-aside-resize-handle-display`]=`none`)),o!==void 0){let t=Ya(o,`horizontal`);e[`--app-shell-aside-width`]=t,e[`--app-shell-aside-offset`]=t,a===`static`&&(e[`--app-shell-aside-grid-width`]=t)}else{if(Xa(c)){let t=T(Ja(c));e[`--app-shell-aside-width`]=t,e[`--app-shell-aside-offset`]=t}Za(c)&&(c.base!==void 0&&(e[`--app-shell-aside-width`]=T(c.base),e[`--app-shell-aside-offset`]=T(c.base)),de(c).forEach(e=>{e!==`base`&&(t[e]=t[e]||{},t[e][`--app-shell-aside-width`]=T(c[e]),t[e][`--app-shell-aside-offset`]=T(c[e]))}))}if(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`]=l,t[e][`--app-shell-aside-transform-rtl`]=u,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`,s&&(t[e][`--app-shell-aside-resize-handle-display`]=`none`)}if(r?.collapsed?.mobile){let e=mt(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`]=l,n[e][`--app-shell-aside-transform-rtl`]=u,n[e][`--app-shell-aside-scroll-locked-visibility`]=`hidden`,s&&(n[e][`--app-shell-aside-resize-handle-display`]=`none`)}}function $a({baseStyles:e,minMediaStyles:t,footer:n,mode:r,resizedSize:i,resizable:a}){let o=n?.height,s=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`),i!==void 0){let t=Ya(i,`vertical`);e[`--app-shell-footer-height`]=t,s&&(e[`--app-shell-footer-offset`]=t)}else{if(Xa(o)){let t=T(Ja(o));e[`--app-shell-footer-height`]=t,s&&(e[`--app-shell-footer-offset`]=t)}Za(o)&&(o.base!==void 0&&(e[`--app-shell-footer-height`]=T(o.base),s&&(e[`--app-shell-footer-offset`]=T(o.base))),de(o).forEach(e=>{e!==`base`&&(t[e]=t[e]||{},t[e][`--app-shell-footer-height`]=T(o[e]),s&&(t[e][`--app-shell-footer-offset`]=T(o[e])))}))}n?.collapsed&&(e[`--app-shell-footer-transform`]=`translateY(var(--app-shell-footer-height))`,r===`fixed`&&(e[`--app-shell-footer-offset`]=`0px !important`),a&&(e[`--app-shell-footer-resize-handle-display`]=`none`))}function eo({baseStyles:e,minMediaStyles:t,header:n,mode:r,resizedSize:i,resizable:a}){let o=n?.height,s=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`),i!==void 0){let t=Ya(i,`vertical`);e[`--app-shell-header-height`]=t,s&&(e[`--app-shell-header-offset`]=t)}else{if(Xa(o)){let t=T(Ja(o));e[`--app-shell-header-height`]=t,s&&(e[`--app-shell-header-offset`]=t)}Za(o)&&(o.base!==void 0&&(e[`--app-shell-header-height`]=T(o.base),s&&(e[`--app-shell-header-offset`]=T(o.base))),de(o).forEach(e=>{e!==`base`&&(t[e]=t[e]||{},t[e][`--app-shell-header-height`]=T(o[e]),s&&(t[e][`--app-shell-header-offset`]=T(o[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`),a&&(e[`--app-shell-header-resize-handle-display`]=`none`))}function to({baseStyles:e,minMediaStyles:t,maxMediaStyles:n,navbar:r,theme:i,mode:a,resizedSize:o,resizable:s}){let c=r?.width,l=`translateX(calc(var(--app-shell-navbar-width) * -1))`,u=`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`),s&&(n[r.breakpoint][`--app-shell-navbar-resize-handle-display`]=`none`)),o!==void 0){let t=Ya(o,`horizontal`);e[`--app-shell-navbar-width`]=t,e[`--app-shell-navbar-offset`]=t,a===`static`&&(e[`--app-shell-navbar-grid-width`]=t)}else{if(Xa(c)){let t=T(Ja(c));e[`--app-shell-navbar-width`]=t,e[`--app-shell-navbar-offset`]=t,a===`static`&&(e[`--app-shell-navbar-grid-width`]=t)}Za(c)&&(c.base!==void 0&&(e[`--app-shell-navbar-width`]=T(c.base),e[`--app-shell-navbar-offset`]=T(c.base),a===`static`&&(e[`--app-shell-navbar-grid-width`]=T(c.base))),de(c).forEach(e=>{e!==`base`&&(t[e]=t[e]||{},t[e][`--app-shell-navbar-width`]=T(c[e]),t[e][`--app-shell-navbar-offset`]=T(c[e]),a===`static`&&(t[e][`--app-shell-navbar-grid-width`]=T(c[e])))}))}if(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`]=l,t[e][`--app-shell-navbar-transform-rtl`]=u,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`),s&&(t[e][`--app-shell-navbar-resize-handle-display`]=`none`)}if(r?.collapsed?.mobile){let e=mt(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`]=l,n[e][`--app-shell-navbar-transform-rtl`]=u,s&&(n[e][`--app-shell-navbar-resize-handle-display`]=`none`)}}function no(e){return Number(e)===0?`0px`:ue(e)}function ro({padding:e,baseStyles:t,minMediaStyles:n}){Xa(e)&&(t[`--app-shell-padding`]=no(Ja(e))),Za(e)&&(e.base&&(t[`--app-shell-padding`]=no(e.base)),de(e).forEach(t=>{t!==`base`&&(n[t]=n[t]||{},n[t][`--app-shell-padding`]=no(e[t]))}))}function io({navbar:e,header:t,footer:n,aside:r,padding:i,theme:a,mode:o,resize:s}){let c={},l={},u={};o===`static`&&(u[`--app-shell-main-grid-column`]=`1 / -1`,u[`--app-shell-main-grid-row`]=`2`),to({baseStyles:u,minMediaStyles:c,maxMediaStyles:l,navbar:e,theme:a,mode:o,resizedSize:s?.sizes.navbar,resizable:s?.enabled.navbar}),Qa({baseStyles:u,minMediaStyles:c,maxMediaStyles:l,aside:r,theme:a,mode:o,resizedSize:s?.sizes.aside,resizable:s?.enabled.aside}),eo({baseStyles:u,minMediaStyles:c,header:t,mode:o,resizedSize:s?.sizes.header,resizable:s?.enabled.header}),$a({baseStyles:u,minMediaStyles:c,footer:n,mode:o,resizedSize:s?.sizes.footer,resizable:s?.enabled.footer}),ro({baseStyles:u,minMediaStyles:c,padding:i});let d=St(de(c),a.breakpoints).map(e=>({query:`(min-width: ${re(e.px)})`,styles:c[e.value]})),f=St(de(l),a.breakpoints).map(e=>({query:`(max-width: ${re(e.px)})`,styles:l[e.value]}));return{baseStyles:u,media:[...d,...f]}}function ao({navbar:e,header:t,aside:n,footer:r,padding:i,mode:a,selector:o,resize:s}){let c=f(),u=l(),{media:d,baseStyles:p}=io({navbar:e,header:t,footer:r,aside:n,padding:i,theme:c,mode:a,resize:s});return(0,O.jsx)(le,{media:d,styles:p,selector:o||u.cssVariablesSelector})}function oo(e){return e>=128||e===45||e===95||e>=48&&e<=57||e>=65&&e<=90||e>=97&&e<=122}function so(e){return e>=48&&e<=57}function co(e){let t=``;for(let n=0;n=1&&r<=31||r===127||n===0&&so(r)||n===1&&so(r)&&e.charCodeAt(0)===45?t+=`\\${r.toString(16)} `:n===0&&e.length===1&&r===45?t+=`\\${i}`:oo(r)?t+=i:t+=`\\${i}`}return t}function lo({transitionDuration:e,disabled:t,resizeKey:n}){let[r,i]=(0,D.useState)(!0),[a,o]=(0,D.useState)({key:n,active:!1}),s=(0,D.useRef)(-1),c=(0,D.useRef)(-1);return a.key!==n&&o({key:n,active:!0}),(0,D.useEffect)(()=>{if(!a.active)return;let t=window.setTimeout(()=>(0,D.startTransition)(()=>{o(e=>({...e,active:!1}))}),e||0);return()=>window.clearTimeout(t)},[a,e]),Qt(`resize`,()=>{i(!0),clearTimeout(s.current),s.current=window.setTimeout(()=>(0,D.startTransition)(()=>{i(!1)}),200)}),he(()=>{i(!0),clearTimeout(c.current),c.current=window.setTimeout(()=>(0,D.startTransition)(()=>{i(!1)}),e||0)},[t,e]),r||a.active}var uo={withBorder:!0,padding:0,transitionDuration:200,transitionTimingFunction:`ease`,zIndex:Ut(`app`),mode:`fixed`},fo=y((e,{transitionDuration:t,transitionTimingFunction:n})=>({root:{"--app-shell-transition-duration":`${t}ms`,"--app-shell-transition-timing-function":n,"--app-shell-resize-handle-size":void 0}})),po=g(t=>{let r=u(`AppShell`,uo,t),{classNames:i,className:a,style:o,styles:s,unstyled:c,vars:l,navbar:d,withBorder:f,padding:p,transitionDuration:m,transitionTimingFunction:h,header:g,zIndex:_,layout:v,disabled:y,aside:b,footer:ee,offsetScrollbars:x=!0,mode:S,mod:C,attributes:te,id:ne,resize:w,ref:re,...ae}=r,T=e({name:`AppShell`,classes:Va,props:r,className:a,style:o,classNames:i,styles:s,unstyled:c,attributes:te,vars:l,varsResolver:fo}),oe=lo({disabled:y,transitionDuration:m,resizeKey:w?Ma.map(e=>w.sizes[e]).join(`|`):void 0}),se=_e(ne),ce=(0,D.useRef)(null),le=w?{sizes:w.sizes,enabled:{navbar:w.navbar.enabled,aside:w.aside.enabled,header:w.header.enabled,footer:w.footer.enabled}}:void 0,ue={navbar:!0,aside:!0,header:S===`static`?!0:g?.offset??!0,footer:S===`static`?!0:ee?.offset??!0};return(0,O.jsxs)(Da,{value:{getStyles:T,withBorder:f,zIndex:_,disabled:y,offsetScrollbars:x,mode:S,resize:w,rootRef:ce,resizeOffsets:ue},children:[(0,O.jsx)(ao,{navbar:d,header:g,aside:b,footer:ee,padding:p,mode:S,resize:le,selector:w||S===`static`?`#${co(se)}`:void 0}),(0,O.jsx)(n,{...T(`root`),id:se,ref:ie(re,ce),mod:[{resizing:oe||w?.activeSection!=null,layout:v,disabled:y,mode:S},C],...ae})]})});po.classes=Va,po.varsResolver=fo,po.displayName=`@mantine/core/AppShell`,po.Navbar=Ka,po.Header=Wa,po.Main=Ga,po.Aside=Ha,po.Footer=Ua,po.Section=qa;var mo={group:`m_11def92b`,root:`m_f85678b6`,image:`m_11f8ac07`,placeholder:`m_104cd71f`},ho=(0,D.createContext)({withinGroup:!1}),go=y((e,{spacing:t})=>({group:{"--ag-spacing":ue(t)}})),_o=g(t=>{let r=u(`AvatarGroup`,null,t),{classNames:i,className:a,style:o,styles:s,unstyled:c,vars:l,spacing:d,attributes:f,...p}=r,m=e({name:`AvatarGroup`,classes:mo,props:r,className:a,style:o,classNames:i,styles:s,unstyled:c,attributes:f,vars:l,varsResolver:go,rootSelector:`group`});return(0,O.jsx)(ho,{value:{withinGroup:!0},children:(0,O.jsx)(n,{...m(`group`),...p})})});_o.classes=mo,_o.varsResolver=go,_o.displayName=`@mantine/core/AvatarGroup`;function vo(e){return(0,O.jsx)(`svg`,{...e,"data-avatar-placeholder-icon":!0,viewBox:`0 0 15 15`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,children:(0,O.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 yo(e){let t=0;for(let n=0;ne[0]).slice(0,t).join(``).toUpperCase()}var Co=y((e,{size:t,radius:n,variant:r,gradient:i,color:a,autoContrast:o,name:s,allowedInitialsColors:c})=>{let l=a===`initials`&&typeof s==`string`?xo(s,c):a,u=e.variantColorResolver({color:l||`gray`,theme:e,gradient:i,variant:r||`light`,autoContrast:o});return{root:{"--avatar-size":ne(t,`avatar-size`),"--avatar-radius":n===void 0?void 0:fe(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}}}),wo=be(t=>{let r=u(`Avatar`,null,t),{classNames:i,className:a,style:o,styles:s,unstyled:c,vars:l,src:d,alt:f,radius:p,color:m,gradient:h,imageProps:g,children:_,autoContrast:v,mod:y,name:b,allowedInitialsColors:ee,attributes:x,...S}=r,C=(0,D.use)(ho),[te,ne]=(0,D.useState)(!d),w=e({name:`Avatar`,props:r,classes:mo,className:a,style:o,classNames:i,styles:s,unstyled:c,attributes:x,vars:l,varsResolver:Co});return(0,D.useEffect)(()=>ne(!d),[d]),(0,O.jsx)(n,{...w(`root`),mod:[{"within-group":C.withinGroup},y],...S,children:te||!d?(0,O.jsx)(`span`,{...w(`placeholder`),title:f,children:_||typeof b==`string`&&So(b)||(0,O.jsx)(vo,{})}):(0,O.jsx)(`img`,{...g,...w(`image`),src:d,alt:f,onError:e=>{ne(!0),g?.onError?.(e)}})})});wo.classes=mo,wo.varsResolver=Co,wo.displayName=`@mantine/core/Avatar`,wo.Group=_o;var To={root:`m_fea6bf1a`,burger:`m_d4fb9cad`},Eo=y((e,{color:t,size:n,lineSize:r,transitionDuration:i,transitionTimingFunction:a})=>({root:{"--burger-color":t?c(t,e):void 0,"--burger-size":ne(n,`burger-size`),"--burger-line-size":r?T(r):void 0,"--burger-transition-duration":i===void 0?void 0:`${i}ms`,"--burger-transition-timing-function":a}})),Do=g(t=>{let r=u(`Burger`,null,t),{classNames:i,className:a,style:o,styles:s,unstyled:c,vars:l,opened:d,children:f,transitionDuration:p,transitionTimingFunction:h,lineSize:g,attributes:_,...v}=r,y=e({name:`Burger`,classes:To,props:r,className:a,style:o,classNames:i,styles:s,unstyled:c,attributes:_,vars:l,varsResolver:Eo});return(0,O.jsxs)(m,{...y(`root`),...v,children:[(0,O.jsx)(n,{mod:[`reduce-motion`,{opened:d}],...y(`burger`)}),f]})});Do.classes=To,Do.varsResolver=Eo,Do.displayName=`@mantine/core/Burger`;var Oo=[];for(let e=0;e<256;++e)Oo.push((e+256).toString(16).slice(1));function ko(e,t=0){return(Oo[e[t+0]]+Oo[e[t+1]]+Oo[e[t+2]]+Oo[e[t+3]]+`-`+Oo[e[t+4]]+Oo[e[t+5]]+`-`+Oo[e[t+6]]+Oo[e[t+7]]+`-`+Oo[e[t+8]]+Oo[e[t+9]]+`-`+Oo[e[t+10]]+Oo[e[t+11]]+Oo[e[t+12]]+Oo[e[t+13]]+Oo[e[t+14]]+Oo[e[t+15]]).toLowerCase()}var Ao,jo=new Uint8Array(16);function Mo(){if(!Ao){if(typeof crypto>`u`||!crypto.getRandomValues)throw Error(`crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported`);Ao=crypto.getRandomValues.bind(crypto)}return Ao(jo)}var No={randomUUID:typeof crypto<`u`&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function Po(e,t,n){if(No.randomUUID&&!t&&!e)return No.randomUUID();e||={};let r=e.random??e.rng?.()??Mo();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 ko(r)}var Fo=wn(),A=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.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}({}),Io={TextMessageStartEvent:{optional:[`timestamp`,`rawEvent`,`metadata`,`subagentRunId`,`role`,`name`],fields:{}},TextMessageContentEvent:{optional:[`timestamp`,`rawEvent`,`metadata`,`subagentRunId`],fields:{}},TextMessageEndEvent:{optional:[`timestamp`,`rawEvent`,`metadata`,`subagentRunId`],fields:{}},TextMessageChunkEvent:{optional:[`timestamp`,`rawEvent`,`metadata`,`subagentRunId`,`messageId`,`role`,`delta`,`name`],fields:{}},ToolCallStartEvent:{optional:[`timestamp`,`rawEvent`,`metadata`,`subagentRunId`,`parentMessageId`],fields:{}},ToolCallArgsEvent:{optional:[`timestamp`,`rawEvent`,`metadata`,`subagentRunId`],fields:{}},ToolCallEndEvent:{optional:[`timestamp`,`rawEvent`,`metadata`,`subagentRunId`],fields:{}},ToolCallChunkEvent:{optional:[`timestamp`,`rawEvent`,`metadata`,`subagentRunId`,`toolCallId`,`toolCallName`,`parentMessageId`,`delta`],fields:{}},TextPart:{optional:[`id`,`metadata`],fields:{}},DataSource:{optional:[],fields:{}},UrlSource:{optional:[`mimeType`],fields:{}},FileSource:{optional:[`provider`,`mimeType`],fields:{}},PartSource:{discriminator:`type`,variants:{data:`DataSource`,url:`UrlSource`,file:`FileSource`}},ImagePart:{optional:[`id`,`metadata`],fields:{source:`PartSource`}},AudioPart:{optional:[`id`,`metadata`],fields:{source:`PartSource`}},VideoPart:{optional:[`id`,`metadata`],fields:{source:`PartSource`}},DocumentPart:{optional:[`id`,`metadata`],fields:{source:`PartSource`}},ContentPart:{discriminator:`type`,variants:{text:`TextPart`,image:`ImagePart`,audio:`AudioPart`,video:`VideoPart`,document:`DocumentPart`}},ToolCallResultEvent:{optional:[`timestamp`,`rawEvent`,`metadata`,`subagentRunId`,`role`],fields:{content:{array:`ContentPart`}}},StateSnapshotEvent:{optional:[`timestamp`,`rawEvent`,`metadata`,`subagentRunId`],fields:{}},AddOperation:{optional:[],fields:{}},RemoveOperation:{optional:[],fields:{}},ReplaceOperation:{optional:[],fields:{}},MoveOperation:{optional:[],fields:{}},CopyOperation:{optional:[],fields:{}},TestOperation:{optional:[],fields:{}},JsonPatchOperation:{discriminator:`op`,variants:{add:`AddOperation`,remove:`RemoveOperation`,replace:`ReplaceOperation`,move:`MoveOperation`,copy:`CopyOperation`,test:`TestOperation`}},StateDeltaEvent:{optional:[`timestamp`,`rawEvent`,`metadata`,`subagentRunId`],fields:{delta:{array:`JsonPatchOperation`}}},DeveloperMessage:{optional:[`subagentRunId`,`name`,`encryptedValue`,`metadata`],fields:{}},SystemMessage:{optional:[`subagentRunId`,`name`,`encryptedValue`,`metadata`],fields:{}},FunctionCall:{optional:[],fields:{}},ToolCall:{optional:[`encryptedValue`,`metadata`],fields:{function:`FunctionCall`}},AssistantMessage:{optional:[`subagentRunId`,`name`,`encryptedValue`,`metadata`,`content`,`toolCalls`],fields:{toolCalls:{array:`ToolCall`}}},UserMessage:{optional:[`subagentRunId`,`name`,`encryptedValue`,`metadata`],fields:{content:{array:`ContentPart`}}},ToolMessage:{optional:[`subagentRunId`,`error`,`encryptedValue`,`metadata`],fields:{content:{array:`ContentPart`}}},ActivityMessage:{optional:[`subagentRunId`,`metadata`],fields:{}},ReasoningMessage:{optional:[`subagentRunId`,`encryptedValue`,`metadata`],fields:{}},Message:{discriminator:`role`,variants:{developer:`DeveloperMessage`,system:`SystemMessage`,assistant:`AssistantMessage`,user:`UserMessage`,tool:`ToolMessage`,activity:`ActivityMessage`,reasoning:`ReasoningMessage`}},MessagesSnapshotEvent:{optional:[`timestamp`,`rawEvent`,`metadata`],fields:{messages:{array:`Message`}}},ActivitySnapshotEvent:{optional:[`timestamp`,`rawEvent`,`metadata`,`subagentRunId`,`replace`],fields:{}},ActivityDeltaEvent:{optional:[`timestamp`,`rawEvent`,`metadata`,`subagentRunId`],fields:{patch:{array:`JsonPatchOperation`}}},RawEvent:{optional:[`timestamp`,`rawEvent`,`metadata`,`subagentRunId`,`source`],fields:{}},CustomEvent:{optional:[`timestamp`,`rawEvent`,`metadata`,`subagentRunId`],fields:{}},Tool:{optional:[`parameters`,`metadata`],fields:{}},Context:{optional:[],fields:{}},ResumeEntry:{optional:[`payload`,`metadata`],fields:{}},RunAgentInput:{optional:[`protocolVersion`,`parentRunId`,`state`,`tools`,`context`,`forwardedProps`,`resume`],fields:{messages:{array:`Message`},tools:{array:`Tool`},context:{array:`Context`},resume:{array:`ResumeEntry`}}},RunStartedEvent:{optional:[`timestamp`,`rawEvent`,`metadata`,`protocolVersion`,`parentRunId`,`input`],fields:{input:`RunAgentInput`}},RunFinishedSuccessOutcome:{optional:[`pendingToolCallIds`],fields:{}},Interrupt:{optional:[`subagentRunId`,`message`,`toolCallId`,`responseSchema`,`expiresAt`,`metadata`],fields:{}},RunFinishedInterruptOutcome:{optional:[],fields:{interrupts:{array:`Interrupt`}}},RunFinishedCancelledOutcome:{optional:[],fields:{}},RunFinishedOutcome:{discriminator:`type`,variants:{success:`RunFinishedSuccessOutcome`,interrupt:`RunFinishedInterruptOutcome`,cancelled:`RunFinishedCancelledOutcome`}},TokenUsage:{optional:[`provider`,`model`,`inputTokens`,`outputTokens`,`totalTokens`,`reasoningTokens`,`cachedInputTokens`,`cacheWriteInputTokens`],fields:{}},RunFinishedEvent:{optional:[`timestamp`,`rawEvent`,`metadata`,`result`,`outcome`,`usage`],fields:{outcome:`RunFinishedOutcome`,usage:{array:`TokenUsage`}}},RunErrorEvent:{optional:[`timestamp`,`rawEvent`,`metadata`,`code`,`usage`],fields:{usage:{array:`TokenUsage`}}},StepStartedEvent:{optional:[`timestamp`,`rawEvent`,`metadata`,`subagentRunId`],fields:{}},StepFinishedEvent:{optional:[`timestamp`,`rawEvent`,`metadata`,`subagentRunId`],fields:{}},ReasoningStartEvent:{optional:[`timestamp`,`rawEvent`,`metadata`,`subagentRunId`],fields:{}},ReasoningMessageStartEvent:{optional:[`timestamp`,`rawEvent`,`metadata`,`subagentRunId`],fields:{}},ReasoningMessageContentEvent:{optional:[`timestamp`,`rawEvent`,`metadata`,`subagentRunId`],fields:{}},ReasoningMessageEndEvent:{optional:[`timestamp`,`rawEvent`,`metadata`,`subagentRunId`],fields:{}},ReasoningMessageChunkEvent:{optional:[`timestamp`,`rawEvent`,`metadata`,`subagentRunId`,`messageId`,`delta`],fields:{}},ReasoningEndEvent:{optional:[`timestamp`,`rawEvent`,`metadata`,`subagentRunId`],fields:{}},ReasoningEncryptedValueEvent:{optional:[`timestamp`,`rawEvent`,`metadata`,`subagentRunId`],fields:{}},SubagentStartedEvent:{optional:[`timestamp`,`rawEvent`,`metadata`,`description`,`parentSubagentRunId`,`parentToolCallId`,`parentMessageId`],fields:{}},SubagentFinishedSuccessOutcome:{optional:[],fields:{}},SubagentFinishedSuspendedOutcome:{optional:[`interruptIds`],fields:{}},SubagentFinishedOutcome:{discriminator:`type`,variants:{success:`SubagentFinishedSuccessOutcome`,suspended:`SubagentFinishedSuspendedOutcome`}},SubagentFinishedEvent:{optional:[`timestamp`,`rawEvent`,`metadata`,`result`,`outcome`],fields:{outcome:`SubagentFinishedOutcome`}},SubagentErrorEvent:{optional:[`timestamp`,`rawEvent`,`metadata`,`code`],fields:{}},Event:{discriminator:`type`,variants:{TEXT_MESSAGE_START:`TextMessageStartEvent`,TEXT_MESSAGE_CONTENT:`TextMessageContentEvent`,TEXT_MESSAGE_END:`TextMessageEndEvent`,TEXT_MESSAGE_CHUNK:`TextMessageChunkEvent`,TOOL_CALL_START:`ToolCallStartEvent`,TOOL_CALL_ARGS:`ToolCallArgsEvent`,TOOL_CALL_END:`ToolCallEndEvent`,TOOL_CALL_CHUNK:`ToolCallChunkEvent`,TOOL_CALL_RESULT:`ToolCallResultEvent`,STATE_SNAPSHOT:`StateSnapshotEvent`,STATE_DELTA:`StateDeltaEvent`,MESSAGES_SNAPSHOT:`MessagesSnapshotEvent`,ACTIVITY_SNAPSHOT:`ActivitySnapshotEvent`,ACTIVITY_DELTA:`ActivityDeltaEvent`,RAW:`RawEvent`,CUSTOM:`CustomEvent`,RUN_STARTED:`RunStartedEvent`,RUN_FINISHED:`RunFinishedEvent`,RUN_ERROR:`RunErrorEvent`,STEP_STARTED:`StepStartedEvent`,STEP_FINISHED:`StepFinishedEvent`,REASONING_START:`ReasoningStartEvent`,REASONING_MESSAGE_START:`ReasoningMessageStartEvent`,REASONING_MESSAGE_CONTENT:`ReasoningMessageContentEvent`,REASONING_MESSAGE_END:`ReasoningMessageEndEvent`,REASONING_MESSAGE_CHUNK:`ReasoningMessageChunkEvent`,REASONING_END:`ReasoningEndEvent`,REASONING_ENCRYPTED_VALUE:`ReasoningEncryptedValueEvent`,SUBAGENT_STARTED:`SubagentStartedEvent`,SUBAGENT_FINISHED:`SubagentFinishedEvent`,SUBAGENT_ERROR:`SubagentErrorEvent`}},SubagentInfo:{optional:[`description`],fields:{}},IdentityCapabilities:{optional:[`name`,`type`,`description`,`version`,`provider`,`documentationUrl`,`metadata`],fields:{}},TransportCapabilities:{optional:[`streaming`,`websocket`,`httpBinary`,`pushNotifications`,`resumable`],fields:{}},ToolsCapabilities:{optional:[`supported`,`items`,`parallelCalls`,`clientProvided`],fields:{items:{array:`Tool`}}},OutputCapabilities:{optional:[`structuredOutput`,`supportedMimeTypes`],fields:{}},StateCapabilities:{optional:[`snapshots`,`deltas`,`memory`,`persistentState`],fields:{}},MultiAgentCapabilities:{optional:[`supported`,`delegation`,`handoffs`,`subagents`],fields:{subagents:{array:`SubagentInfo`}}},ReasoningCapabilities:{optional:[`supported`,`streaming`,`encrypted`],fields:{}},MultimodalInputCapabilities:{optional:[`image`,`audio`,`video`,`pdf`,`file`],fields:{}},MultimodalOutputCapabilities:{optional:[`image`,`audio`],fields:{}},MultimodalCapabilities:{optional:[`input`,`output`],fields:{input:`MultimodalInputCapabilities`,output:`MultimodalOutputCapabilities`}},ExecutionCapabilities:{optional:[`codeExecution`,`sandboxed`,`maxIterations`,`maxExecutionTime`],fields:{}},HumanInTheLoopCapabilities:{optional:[`supported`,`approvals`,`interventions`,`feedback`,`interrupts`,`approveWithEdits`],fields:{}},AgentCapabilities:{optional:[`identity`,`transport`,`tools`,`output`,`state`,`multiAgent`,`reasoning`,`multimodal`,`execution`,`humanInTheLoop`,`custom`],fields:{identity:`IdentityCapabilities`,transport:`TransportCapabilities`,tools:`ToolsCapabilities`,output:`OutputCapabilities`,state:`StateCapabilities`,multiAgent:`MultiAgentCapabilities`,reasoning:`ReasoningCapabilities`,multimodal:`MultimodalCapabilities`,execution:`ExecutionCapabilities`,humanInTheLoop:`HumanInTheLoopCapabilities`}}};function Lo(e,t){if(typeof t==`string`)return Lo(e,Io[t]);if(`array`in t){if(!Array.isArray(e))return e;let n=e.map(e=>Lo(e,t.array));return n.every((t,n)=>t===e[n])?e:n}if(typeof e!=`object`||!e||Array.isArray(e))return e;let n=e;if(`discriminator`in t){let r=n[t.discriminator];return typeof r==`string`&&Object.prototype.hasOwnProperty.call(t.variants,r)?Lo(e,t.variants[r]):e}let r=n;for(let e of t.optional)Object.prototype.hasOwnProperty.call(n,e)&&n[e]===null&&(r===n&&(r={...n}),delete r[e]);for(let[e,i]of Object.entries(t.fields)){if(!Object.prototype.hasOwnProperty.call(r,e))continue;let t=Lo(r[e],i);t!==r[e]&&(r===n&&(r={...n}),r[e]=t)}return r}function Ro(e,t){return Lo(e,t)}var j=class extends Error{constructor(e){super(e)}},zo=class extends j{constructor(){super(`Connect not implemented. This method is not supported by the current agent.`)}};function Bo(e,t){return t===void 0?e:e===void 0?{...t}:{...e,...t}}function Vo(e){return e===void 0?``:typeof e==`string`?e:e.filter(e=>e.type===`text`).map(e=>e.text).join(``)}function Ho(e){return Array.isArray(e)&&e.some(e=>e.type!==`text`)}var Uo=(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)}})(),Wo=Object.prototype.hasOwnProperty;function Go(e,t){return Wo.call(e,t)}function Ko(e){if(Array.isArray(e)){for(var t=Array(e.length),n=0;n=48&&r<=57){t++;continue}return!1}return!0}function Yo(e){return e.indexOf(`/`)===-1&&e.indexOf(`~`)===-1?e:e.replace(/~/g,`~0`).replace(/\//g,`~1`)}function Xo(e){return e.replace(/~1/g,`/`).replace(/~0/g,`~`)}function Zo(e){if(e===void 0)return!0;if(e){if(Array.isArray(e)){for(var t=0,n=e.length;t>>=0,e===0?32:31-(ut(e)/dt|0)|0}var pt=256,mt=262144,ht=4194304;function gt(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&-e;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 _t(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=gt(n))):i=gt(o):i=gt(s)):(r=s&~a,r===0?(o&=s,o===0?n||(n=s&~e,n!==0&&(i=gt(n))):i=gt(o)):i=gt(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 vt(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function yt(e,t){t&8&&(t|=t&32);var n=e.entangledLanes;if(n!==0)for(e=e.entanglements,n&=t;0n;n++)t.push(e);return t}function Ct(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function wt(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=Tr),Or=` `,kr=!1;function Ar(e,t){switch(e){case`keyup`:return Cr.indexOf(t.keyCode)!==-1;case`keydown`:return t.keyCode!==229;case`keypress`:case`mousedown`:case`focusout`:return!0;default:return!1}}function jr(e){return e=e.detail,typeof e==`object`&&`data`in e?e.data:null}var Mr=!1;function Nr(e,t){switch(e){case`compositionend`:return jr(t);case`keypress`:return t.which===32?(kr=!0,Or):null;case`textInput`:return e=t.data,e===Or&&kr?null:e;default:return null}}function Pr(e,t){if(Mr)return e===`compositionend`||!wr&&Ar(e,t)?(e=Kn(),Gn=Wn=Un=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=ri(n)}}function ai(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?ai(e,t.parentNode):`contains`in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function oi(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=ni(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=ni(e.document)}return t}function si(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 ci=Bn&&`documentMode`in document&&11>=document.documentMode,li=null,ui=null,di=null,fi=!1;function pi(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;fi||li==null||li!==ni(r)||(r=li,`selectionStart`in r&&si(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}),di&&ti(di,r)||(di=r,r=sp(ui,`onSelect`),0>=o,i-=o,sa=1<<32-lt(t)+i|n<h?(g=d,d=null):g=d.sibling;var _=p(i,d,s[h],c);if(_===null){d===null&&(d=g);break}e&&d&&_.alternate===null&&t(i,d),a=o(_,a,h),u===null?l=_:u.sibling=_,u=_,d=g}if(h===s.length)return n(i,d),k&&la(i,h),l;if(d===null){for(;hg?(_=h,h=null):_=h.sibling;var y=p(a,h,v.value,l);if(y===null){h===null&&(h=_);break}e&&h&&y.alternate===null&&t(a,h),s=o(y,s,g),d===null?u=y:d.sibling=y,d=y,h=_}if(v.done)return n(a,h),k&&la(a,g),u;if(h===null){for(;!v.done;g++,v=c.next())v=f(a,v.value,l),v!==null&&(s=o(v,s,g),d===null?u=v:d.sibling=v,d=v);return k&&la(a,g),u}for(h=r(h);!v.done;g++,v=c.next())v=m(h,a,g,v.value,l),v!==null&&(e&&(_=v.alternate,_!==null&&h.delete(_.key===null?g:_.key)),s=o(v,s,g),d===null?u=v:d.sibling=v,d=v);return e&&h.forEach(function(e){return t(a,e)}),k&&la(a,g),u}function _(e,r,o,c){if(typeof o==`object`&&o&&o.type===re&&o.key===null&&o.props.ref===void 0&&(o=o.props.children),typeof o==`object`&&o){switch(o.$$typeof){case ne:a:{for(var l=o.key;r!==null;){if(r.key===l){if(l=o.type,l===re){if(r.tag===7){n(e,r.sibling),c=a(r,o.props.children),bo(c,o),c.return=e,e=c;break a}}else if(r.elementType===l||typeof l==`object`&&l&&l.$$typeof===de&&po(l)===r.type){n(e,r.sibling),c=a(r,o.props),bo(c,o),c.return=e,e=c;break a}n(e,r);break}t(e,r),r=r.sibling}o.type===re?(c=Ji(o.props.children,e.mode,c,o.key),bo(c,o),c.return=e,e=c):(c=qi(o.type,o.key,o.props,null,e.mode,c),bo(c,o),c.return=e,e=c)}return s(e);case w: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=Zi(o,e.mode,c),c.return=e,e=c}return s(e);case de:return o=po(o),_(e,r,o,c)}if(Se(o))return h(e,r,o,c);if(ve(o)){if(l=ve(o),typeof l!=`function`)throw Error(i(150));return o=l.call(o),g(e,r,o,c)}if(typeof o.then==`function`)return _(e,r,yo(o),c);if(o.$$typeof===oe)return _(e,r,La(e,o),c);xo(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=Yi(o,e.mode,c),c.return=e,e=c),s(e)):n(e,r)}return function(e,t,n,r){try{vo=0;var i=_(e,t,n,r);return _o=null,i}catch(t){if(t===oo||t===co)throw t;var a=Ui(29,t,null,e.mode);return a.lanes=r,a.return=e,a}}}var Co=So(!0),wo=So(!1),To=!1;function Eo(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Do(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 Oo(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function ko(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,ld&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,t=Bi(e),O(e,null,n),t}return Ri(e,r,t,n),Bi(e)}function Ao(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 jo(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 Mo=!1;function No(){if(Mo){var e=Za;if(e!==null)throw e}}function Po(e,t,n,r){Mo=!1;var i=e.updateQueue;To=!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 f=s.lane&-536870913,p=f!==s.lane;if(p?(R&f)===f:(r&f)===f){f!==0&&f===Xa&&(Mo=!0),u!==null&&(u=u.next={lane:0,tag:s.tag,payload:s.payload,callback:null,next:null});a:{var m=e,h=s;f=t;var g=n;switch(h.tag){case 1:if(m=h.payload,typeof m==`function`){d=m.call(g,d,f);break a}d=m;break a;case 3:m.flags=m.flags&-65537|128;case 0:if(m=h.payload,f=typeof m==`function`?m.call(g,d,f):m,f==null)break a;d=C({},d,f);break a;case 2:To=!0}}f=s.callback,f!==null&&(e.flags|=64,p&&(e.flags|=8192),p=i.callbacks,p===null?i.callbacks=[f]:p.push(f))}else p={lane:f,tag:s.tag,payload:s.payload,callback:s.callback,next:null},u===null?(l=u=p,c=d):u=u.next=p,o|=f;if(s=s.next,s===null){if(s=i.shared.pending,s===null)break;p=s,s=p.next,p.next=null,i.lastBaseUpdate=p,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),vd|=o,e.lanes=o,e.memoizedState=d}}function Fo(e,t){if(typeof e!=`function`)throw Error(i(191,e));e.call(t)}function A(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;ea?a:8;var o=E.T,s={};s.types=o===null?null:o.types,E.T=s,xc(e,!1,t,n);try{var c=i(),l=E.S;l!==null&&l(s,c),typeof c==`object`&&c&&typeof c.then==`function`?bc(e,t,eo(c,r),Ud(e)):bc(e,t,r,Ud(e))}catch(n){bc(e,t,{then:function(){},status:`rejected`,reason:n},Ud())}finally{we.p=a,o!==null&&s.types!==null&&(o.types=s.types),E.T=o}}function uc(){}function dc(e,t,n,r){if(e.tag!==5)throw Error(i(476));var a=fc(e).queue;lc(e,a,t,Te,n===null?uc:function(){return pc(e),n(r)})}function fc(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:Ss,lastRenderedState:Te},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ss,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function pc(e){var t=fc(e);t.next===null&&(t=e.alternate.memoizedState),bc(e,t.next.queue,{},Ud())}function mc(){return Ia(xh)}function hc(){return _s().memoizedState}function gc(){return _s().memoizedState}function _c(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=Ud();e=Oo(n);var r=ko(t,e,n);r!==null&&(Kd(r,t,n),Ao(r,t,n)),t={cache:Ua()},e.payload=t;return}t=t.return}}function vc(e,t,n){var r=Ud();n={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},Sc(e)?Cc(t,n):(n=zi(e,t,n,r),n!==null&&(Kd(n,e,r),wc(n,t,r)))}function yc(e,t,n){bc(e,t,n,Ud())}function bc(e,t,n,r){var i={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(Sc(e))Cc(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,ei(s,o))return Ri(e,t,i,0),ud===null&&Li(),!1}catch{}if(n=zi(e,t,i,r),n!==null)return Kd(n,e,r),wc(n,t,r),!0}return!1}function xc(e,t,n,r){if(r={lane:2,revertLane:qf(),gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},Sc(e)){if(t)throw Error(i(479))}else t=zi(e,n,r,2),t!==null&&Kd(t,e,2)}function Sc(e){var t=e.alternate;return e===M||t!==null&&t===M}function Cc(e,t){ts=es=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function wc(e,t,n){if(n&4194048){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Et(e,n)}}var Tc={readContext:Ia,use:bs,useCallback:ss,useContext:ss,useEffect:ss,useImperativeHandle:ss,useLayoutEffect:ss,useInsertionEffect:ss,useMemo:ss,useReducer:ss,useRef:ss,useState:ss,useDebugValue:ss,useDeferredValue:ss,useTransition:ss,useSyncExternalStore:ss,useId:ss,useHostTransitionStatus:ss,useFormState:ss,useActionState:ss,useOptimistic:ss,useMemoCache:ss,useCacheRefresh:ss,useEffectEvent:ss},Ec={readContext:Ia,use:bs,useCallback:function(e,t){return gs().memoizedState=[e,t===void 0?null:t],e},useContext:Ia,useEffect:Xs,useImperativeHandle:function(e,t,n){n=n==null?null:n.concat([e]),Js(4194308,4,nc.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Js(4194308,4,e,t)},useInsertionEffect:function(e,t){Js(4,2,e,t)},useMemo:function(e,t){var n=gs();t=t===void 0?null:t;var r=e();if(ns){ct(!0);try{e()}finally{ct(!1)}}return n.memoizedState=[r,t],r},useReducer:function(e,t,n){var r=gs();if(n!==void 0){var i=n(t);if(ns){ct(!0);try{n(t)}finally{ct(!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=vc.bind(null,M,e),[r.memoizedState,e]},useRef:function(e){var t=gs();return e={current:e},t.memoizedState=e},useState:function(e){e=Ms(e);var t=e.queue,n=yc.bind(null,M,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:ic,useDeferredValue:function(e,t){return sc(gs(),e,t)},useTransition:function(){var e=Ms(!1);return e=lc.bind(null,M,e.queue,!0,!1),gs().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var r=M,a=gs();if(k){if(n===void 0)throw Error(i(407));n=n()}else{if(n=t(),ud===null)throw Error(i(349));R&127||Ds(r,t,n)}a.memoizedState=n;var o={value:n,getSnapshot:t};return a.queue=o,Xs(ks.bind(null,r,o,e),[e]),r.flags|=2048,Ks(9,{destroy:void 0},Os.bind(null,r,o,n,t),null),n},useId:function(){var e=gs(),t=ud.identifierPrefix;if(k){var n=ca,r=sa;n=(r&~(1<<32-lt(r)-1)).toString(32)+n,t=`_`+t+`R_`+n,n=rs++,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[Nt]=t,o[Pt]=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(gp(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&&Cl(t)}}return Ol(t),t.subtreeFlags&=-33554433,wl(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==r&&Cl(t);else{if(typeof r!=`string`&&t.stateNode===null)throw Error(i(166));if(e=Ne.current,Sa(t)){if(e=t.stateNode,n=t.memoizedProps,r=null,a=ma,a!==null)switch(a.tag){case 27:case 5:r=a.memoizedProps}e[Nt]=t,e=!!(e.nodeValue===n||r!==null&&!0===r.suppressHydrationWarning||pp(e.nodeValue,n)),e||ya(t,!0)}else e=Cp(e).createTextNode(r),e[Nt]=t,t.stateNode=e}return Ol(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(r=Sa(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[Nt]=t}else Ca(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Ol(t),e=!1}else n=wa(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(Ko(t),t):(Ko(t),null);if(t.flags&128)throw Error(i(558))}return Ol(t),null;case 13:if(r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(a=Sa(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[Nt]=t}else Ca(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Ol(t),a=!1}else a=wa(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=a),a=!0;if(!a)return t.flags&256?(Ko(t),t):(Ko(t),null)}return Ko(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),El(t,t.updateQueue),Ol(t),null);case 4:return Ie(),e===null&&rp(t.stateNode.containerInfo),t.flags|=67108864,Ol(t),null;case 10:return Aa(t.type),Ol(t),null;case 19:if(Yo(t),r=t.memoizedState,r===null)return Ol(t),null;if(a=!!(t.flags&128),o=r.rendering,o===null){if(a)Dl(r,!1);else{if(_d!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(o=Xo(e),o!==null){for(t.flags|=128,Dl(r,!1),e=o.updateQueue,t.updateQueue=e,El(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)Ki(n,e),n=n.sibling;return Jo(t,qo.current&1|2),k&&la(t,r.treeForkCount),t.child}e=e.sibling}r.tail!==null&&Ze()>Od&&(t.flags|=128,a=!0,Dl(r,!1),t.lanes=4194304)}}else{if(!a){if(e=Xo(o),e!==null){if(t.flags|=128,a=!0,e=e.updateQueue,t.updateQueue=e,El(t,e),Dl(r,!0),r.tail===null&&r.tailMode!==`collapsed`&&r.tailMode!==`visible`&&!o.alternate&&!k)return Ol(t),null}else 2*Ze()-r.renderingStartTime>Od&&n!==536870912&&(t.flags|=128,a=!0,Dl(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)}if(r.tail!==null){e=r.tail;a:{for(n=e;n!==null;){if(n.alternate!==null){n=!1;break a}n=n.sibling}n=!0}return r.rendering=e,r.tail=e.sibling,r.renderingStartTime=Ze(),e.sibling=null,o=qo.current,o=a?o&1|2:o&1,r.tailMode===`visible`||r.tailMode===`collapsed`||!n||k?Jo(t,o):(n=o,Ae(Bo,t),Ae(qo,n),Vo===null&&(Vo=t)),k&&la(t,r.treeForkCount),e}return Ol(t),null;case 22:case 23:return Ko(t),zo(),r=t.memoizedState!==null,e===null?r&&(t.flags|=8192):e.memoizedState!==null!==r&&(t.flags|=8192),r?n&536870912&&!(t.flags&128)&&(Ol(t),t.subtreeFlags&6&&(t.flags|=8192)):Ol(t),n=t.updateQueue,n!==null&&El(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&&ke(no),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),Aa(Ha),Ol(t),null;case 25:return null;case 30:return t.flags|=33554432,Ol(t),null}throw Error(i(156,t.tag))}function Al(e,t){switch(fa(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Aa(Ha),Ie(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return Re(t),null;case 31:if(t.memoizedState!==null){if(Ko(t),t.alternate===null)throw Error(i(340));Ca()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(Ko(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(i(340));Ca()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Yo(t),e=t.flags,e&65536?(t.flags=e&-65537|128,e=t.memoizedState,e!==null&&(e.rendering=null,e.tail=null),t.flags|=4,t):null;case 4:return Ie(),null;case 10:return Aa(t.type),null;case 22:case 23:return Ko(t),zo(),e!==null&&ke(no),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return Aa(Ha),null;case 25:return null;default:return null}}function jl(e,t){switch(fa(t),t.tag){case 3:Aa(Ha),Ie();break;case 26:case 27:case 5:Re(t);break;case 4:Ie();break;case 31:t.memoizedState!==null&&Ko(t);break;case 13:Ko(t);break;case 19:Yo(t);break;case 10:Aa(t.type);break;case 22:case 23:Ko(t),zo(),e!==null&&ke(no);break;case 24:Aa(Ha)}}function Ml(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){Ef(t,t.return,e)}}function Nl(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){Ef(i,c,e)}}}r=r.next}while(r!==a)}}catch(e){Ef(t,t.return,e)}}function Pl(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{A(t,n)}catch(t){Ef(e,e.return,t)}}}function Fl(e,t,n){n.props=Nc(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(n){Ef(e,t,n)}}function Il(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:var i=e.stateNode,a=Ai(e.memoizedProps,i);(i.ref===null||i.ref.name!==a)&&(i.ref=Jp(a)),r=i.ref;break;case 7:if(e.stateNode===null){var o=new Yp(e);f(e.child,!1,fm,o,void 0,void 0),e.stateNode=o}r=e.stateNode;break;default:r=e.stateNode}typeof n==`function`?e.refCleanup=n(r):n.current=r}}catch(n){Ef(e,t,n)}}function Ll(e,t){var n=e.ref,r=e.refCleanup;if(n!==null){if(typeof r==`function`)try{r()}catch(n){Ef(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){Ef(e,t,n)}else n.current=null}}function Rl(e,t){if((e.tag===5||e.tag===27||e.tag===6)&&e.alternate===null&&t!==null)for(var n=0;n title`))),gp(r,t,n),r[Nt]=e,qt(r),t=r;break a;case`link`:if(o=ah(`link`,`href`,a).get(t+(n.href||``))){for(s=0;sg&&(o=g,g=h,h=o);var _=ii(s,h),v=ii(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,E.T=null,n=Id,Id=null;var o=Md,s=Pd;if(jd=0,Nd=Md=null,Pd=0,ld&6)throw Error(i(331));var c=ld;if(ld|=4,id(o.current),Xu(o,o.current,s,n),ld=c,Bf(0,!1),st&&typeof st.onPostCommitFiberRoot==`function`)try{st.onPostCommitFiberRoot(ot,o)}catch{}return!0}finally{we.p=a,E.T=r,Sf(e,t)}}function Tf(e,t,n){t=$i(n,t),t=zc(e.stateNode,t,2),e=ko(e,t,2),e!==null&&(Ct(e,2),zf(e))}function Ef(e,t,n){if(e.tag===3)Tf(e,e,n);else for(;t!==null;){if(t.tag===3){Tf(t,e,n);break}if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError==`function`||typeof r.componentDidCatch==`function`&&(Ad===null||!Ad.has(r))){e=$i(n,e),n=Bc(2),r=ko(t,n,2),r!==null&&(Vc(n,r,t,e),Ct(r,2),zf(r));break}}t=t.return}}function Df(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new cd;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)||(hd=!0,i.add(n),e=Of.bind(null,e,t,n),t.then(e,e))}function Of(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,ud===e&&(R&n)===n&&(_d===4||_d===3&&(R&62914560)===R&&300>Ze()-Ed?ld&2?bd|=n:$d(e,0):bd|=n,Sd===R&&(Sd=0)),zf(e)}function kf(e,t){t===0&&(t=xt()),e=D(e,t),e!==null&&(Ct(e,t),zf(e))}function Af(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),kf(e,n)}function jf(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),kf(e,n)}function Mf(e,t){return qe(e,t)}var Nf=null,Pf=null,Ff=!1,If=!1,Lf=!1,Rf=0;function zf(e){e!==Pf&&e.next===null&&(Pf===null?Nf=Pf=e:Pf=Pf.next=e),If=!0,Ff||(Ff=!0,Kf())}function Bf(e,t){if(!Lf&&If){Lf=!0;do for(var n=!1,r=Nf;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-lt(42|e)+1)-1,a&=i&~(o&~s),a=a&201326741?a&201326741|1:a?a|2:0}a!==0&&(n=!0,Gf(r,a))}else a=R,a=_t(r,r===ud?a:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),!(a&3)||vt(r,a)||(n=!0,Gf(r,a))}r=r.next}while(n);Lf=!1}}function Vf(){Hf()}function Hf(){If=Ff=!1;var e=0;Rf!==0&&kp()&&(e=Rf);for(var t=Ze(),n=null,r=Nf;r!==null;){var i=r.next,a=Uf(r,t);a===0?(r.next=null,n===null?Nf=i:n.next=i,i===null&&(Pf=n)):(n=r,(e!==0||a&3)&&(If=!0)),r=i}jd!==0&&jd!==5||Bf(e,!1),Rf!==0&&(Rf=0)}function Uf(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&&yp(d)&&(c=c.responseEnd,o+=u*(cph){s.length=o;break}f=new Promise(Gp.bind(f)),s.push(f)}}}if(0`u`?null:document;function zm(e,t,n){var r=Rm;if(r&&typeof t==`string`&&t){var i=hn(t);i=`link[rel="`+e+`"][href="`+i+`"]`,typeof n==`string`&&(i+=`[crossorigin="`+n+`"]`),Nm.has(i)||(Nm.add(i),e={rel:e,crossOrigin:n,href:t},r.querySelector(i)===null&&(t=r.createElement(`link`),gp(t,`link`,e),qt(t),r.head.appendChild(t)))}}function Bm(e){Fm.D(e),zm(`dns-prefetch`,e,null)}function Vm(e,t){Fm.C(e,t),zm(`preconnect`,e,t)}function Hm(e,t,n){Fm.L(e,t,n);var r=Rm;if(r&&e&&t){var i=`link[rel="preload"][as="`+hn(t)+`"]`;t===`image`&&n&&n.imageSrcSet?(i+=`[imagesrcset="`+hn(n.imageSrcSet)+`"]`,typeof n.imageSizes==`string`&&(i+=`[imagesizes="`+hn(n.imageSizes)+`"]`)):i+=`[href="`+hn(e)+`"]`;var a=i;switch(t){case`style`:a=Jm(e);break;case`script`:a=Qm(e)}if(!(Mm.has(a)||(e=C({rel:`preload`,href:t===`image`&&n&&n.imageSrcSet?void 0:e,as:t},n),Mm.set(a,e),r.querySelector(i)!==null||t===`style`&&r.querySelector(Ym(a))||t===`script`&&r.querySelector($m(a))))){var o=r.createElement(`link`);gp(o,`link`,e),t===`style`&&(o[Vt]=!0,o.onload=o.onerror=function(){Jt(o)}),qt(o),r.head.appendChild(o)}}}function Um(e,t){Fm.m(e,t);var n=Rm;if(n&&e){var r=t&&typeof t.as==`string`?t.as:`script`,i=`link[rel="modulepreload"][as="`+hn(r)+`"][href="`+hn(e)+`"]`,a=i;switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:a=Qm(e)}if(!Mm.has(a)&&(e=C({rel:`modulepreload`,href:e},t),Mm.set(a,e),n.querySelector(i)===null)){switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:if(n.querySelector($m(a)))return}r=n.createElement(`link`),gp(r,`link`,e),qt(r),n.head.appendChild(r)}}}function Wm(e,t,n){Fm.S(e,t,n);var r=Rm;if(r&&e){var i=Kt(r).hoistableStyles,a=Jm(e);t||=`default`;var o=i.get(a);if(!o){var s={loading:0,preload:null};if(o=r.querySelector(Ym(a)))s.loading=5;else{e=C({rel:`stylesheet`,href:e,"data-precedence":t},n),(n=Mm.get(a))&&nh(e,n);var c=o=r.createElement(`link`);qt(c),gp(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,th(o,t,r)}o={type:`stylesheet`,instance:o,count:1,state:s},i.set(a,o)}}}function Gm(e,t){Fm.X(e,t);var n=Rm;if(n&&e){var r=Kt(n).hoistableScripts,i=Qm(e),a=r.get(i);a||(a=n.querySelector($m(i)),a||(e=C({src:e,async:!0},t),(t=Mm.get(i))&&rh(e,t),a=n.createElement(`script`),qt(a),gp(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Km(e,t){Fm.M(e,t);var n=Rm;if(n&&e){var r=Kt(n).hoistableScripts,i=Qm(e),a=r.get(i);a||(a=n.querySelector($m(i)),a||(e=C({src:e,async:!0,type:`module`},t),(t=Mm.get(i))&&rh(e,t),a=n.createElement(`script`),qt(a),gp(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function qm(e,t,n,r){var a=(a=Ne.current)?Pm(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`?(n=Jm(n.href),t=Kt(a).hoistableStyles,r=t.get(n),r||(r={type:`style`,instance:null,count:0,state:null},t.set(n,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=Jm(n.href);var o=Kt(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(Ym(e)))?o._p||(s.instance=o,s.state.loading=5):(o=Mm.get(e),o||(o={rel:`preload`,as:`style`,href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},Mm.set(e,o)),Zm(a,e,o,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`?(n=Qm(n),t=Kt(a).hoistableScripts,r=t.get(n),r||(r={type:`script`,instance:null,count:0,state:null},t.set(n,r)),r):{type:`void`,instance:null,count:0,state:null};default:throw Error(i(444,e))}}function Jm(e){return`href="`+hn(e)+`"`}function Ym(e){return`link[rel="stylesheet"][`+e+`]`}function Xm(e){return C({},e,{"data-precedence":e.precedence,precedence:null})}function Zm(e,t,n,r){if(t=e.querySelector(`link[rel="preload"][as="style"][`+t+`]`)){if(!0!==t[Vt]){r.loading=1;return}}else t=e.createElement(`link`),t[Vt]=!0,t.onload=t.onerror=Jt.bind(null,t),gp(t,`link`,n),qt(t),e.head.appendChild(t);r.preload=t,t.addEventListener(`load`,function(){return r.loading|=1}),t.addEventListener(`error`,function(){return r.loading|=2})}function Qm(e){return`[src="`+hn(e)+`"]`}function $m(e){return`script[async]`+e}function eh(e,t,n){if(t.count++,t.instance===null)switch(t.type){case`style`:var r=e.querySelector(`style[data-href~="`+hn(n.href)+`"]`);if(r)return t.instance=r,qt(r),r;var a=C({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return r=(e.ownerDocument||e).createElement(`style`),qt(r),gp(r,`style`,a),th(r,n.precedence,e),t.instance=r;case`stylesheet`:a=Jm(n.href);var o=e.querySelector(Ym(a));if(o)return t.state.loading|=4,t.instance=o,qt(o),o;r=Xm(n),(a=Mm.get(a))&&nh(r,a),o=(e.ownerDocument||e).createElement(`link`),qt(o);var s=o;return s._p=new Promise(function(e,t){s.onload=e,s.onerror=t}),gp(o,`link`,r),t.state.loading|=4,th(o,n.precedence,e),t.instance=o;case`script`:return o=Qm(n.src),(a=e.querySelector($m(o)))?(t.instance=a,qt(a),a):(r=n,(a=Mm.get(o))&&(r=C({},n),rh(r,a)),e=e.ownerDocument||e,a=e.createElement(`script`),qt(a),gp(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,th(r,n.precedence,e));return t.instance}function th(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 sh(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 ch(e,t){return e===`img`&&t.src!=null&&t.src!==``&&t.onLoad==null&&t.loading!==`lazy`}function lh(e){return!(e.type===`stylesheet`&&!(e.state.loading&3))}function uh(e){return(e.width||100)*(e.height||100)*(typeof devicePixelRatio==`number`?devicePixelRatio:1)*.25}function dh(e,t){typeof t.decode==`function`&&(e.imgCount++,t.complete||(e.imgBytes+=uh(t),e.suspenseyImages.push(t)),e=_h.bind(e),t.decode().then(e,e))}function fh(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=Jm(r.href),a=t.querySelector(Ym(i));if(a){t=a._p,typeof t==`object`&&t&&typeof t.then==`function`&&(e.count++,e=gh.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=a,qt(a);return}a=t.ownerDocument||t,r=Xm(r),(i=Mm.get(i))&&nh(r,i),a=a.createElement(`link`),qt(a);var o=a;o._p=new Promise(function(e,t){o.onload=e,o.onerror=t}),gp(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=gh.bind(e),t.addEventListener(`load`,n),t.addEventListener(`error`,n))}}var ph=0;function mh(e,t){return e.stylesheets&&e.count===0&&yh(e,e.stylesheets),0ph?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(r),clearTimeout(i)}}:null}function hh(e){if(e.count===0&&(e.imgCount===0||!e.waitingForImages)){if(e.stylesheets)yh(e,e.stylesheets);else if(e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}}}function gh(){this.count--,hh(this)}function _h(){this.imgCount--,hh(this)}var vh=null;function yh(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,vh=new Map,t.forEach(bh,e),vh=null,gh.call(e))}function bh(e,t){if(!(t.state.loading&4)){var n=vh.get(e);if(n)var r=n.get(null);else{n=new Map,vh.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=Cn()}));function Tn(e){return e?.isNotFound===!0}function En(){try{return sessionStorage}catch{return}}var Dn=`tsr-scroll-restoration-v1_3`,On=En();function kn(){try{return JSON.parse(On?.getItem(`tsr-scroll-restoration-v1_3`)||`{}`)}catch{return{}}}var An=kn(),jn=`data-scroll-restoration-id`,Mn=e=>e.state.__TSR_key||e.href;function Nn(e){let t=e.getAttribute(jn);if(t)return`[${jn}="${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 Pn=!1,Fn=`window`;function In(e){try{return typeof e==`function`?e():document.querySelector(e)}catch{}}function Ln(e){let t=new Set;for(let n of e){if(n===Fn)continue;let e=In(n);e&&t.add(e)}return t}function Rn(e,t){let n=t??e.options.scrollRestoration,r=e._scroll;n&&(r.e=!0);let i=e.options.getScrollRestorationKey||Mn,a=new Set,o=e=>{let t=An[e]||={};for(let e of a)e===document?t[Fn]={scrollX,scrollY}:e.isConnected&&(t[Nn(e)]={scrollX:e.scrollLeft,scrollY:e.scrollTop})};n&&!r.s&&(r.s=!0,Pn=!1,history.scrollRestoration=`manual`,document.addEventListener(`scroll`,e=>{Pn||a.add(e.target)},!0),e.subscribe(`onBeforeLoad`,e=>{e.fromLocation&&o(i(e.fromLocation)),a.clear()}),addEventListener(`pagehide`,()=>{history.scrollRestoration=`auto`,o(i(e.stores.resolvedLocation.get()??e.stores.location.get()));try{On?.setItem(Dn,JSON.stringify(An))}catch{}}),addEventListener(`pageshow`,e=>{e.persisted&&(history.scrollRestoration=`manual`)})),!r.r&&(r.r=!0,e.subscribe(`onRendered`,t=>{let n=e.options.scrollRestorationBehavior,o=e.options.scrollToTopSelectors,s=r.n,c=r.h,l;if(a.clear(),r.n=!0,r.h=!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.e&&d&&d!==u){let e=An[d];if(e){let t=An[u];for(let n in e){if(n===Fn){if(s)continue}else{let e=In(n);if(!e||s&&o&&(l??=Ln(o),l.has(e)))continue}t||=An[u]={},t[n]??=e[n]}}}Pn=!0;try{let e=t.toLocation.hash,i=t.toLocation.state.__hashScrollIntoViewOptions??!0,a=!1;if(s){!e&&o&&(l??=Ln(o));let t=e&&i&&c,s=r.e?An[u]:void 0;if(s)for(let e in s){let{scrollX:r,scrollY:i}=s[e];if(e===Fn){if(t)continue;scrollTo({top:i,left:r,behavior:n}),a=!0}else{let t=In(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{Pn=!1}}))}function zn(e,t=String){let n;for(let r in e){let i=e[r];i!==void 0&&(n||=new URLSearchParams).set(r,t(i))}return n?n.toString():``}function Bn(e){return e?e===`false`?!1:e===`true`?!0:e*0==0&&+e+``===e?+e:e:``}function Vn(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]=Bn(r):Array.isArray(t)?t.push(Bn(r)):n[e]=[t,Bn(r)]}return n}var Hn=/^(?:\s|["[{\d-]|fa|nu|tr)/,Un=Gn(JSON.parse),Wn=Kn(JSON.stringify,JSON.parse);function Gn(e){let t=e===JSON.parse;return n=>{n[0]===`?`&&(n=n.substring(1));let r=Vn(n);for(let n in r){let i=r[n];if(typeof i==`string`){if(t&&!Hn.test(i))continue;try{r[n]=e(i)}catch{}}}return r}}function Kn(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&&!Hn.test(r))return r;try{return t(r),e(r)}catch{}}return r}return e=>{let t=zn(e,r);return t?`?${t}`:``}}function qn(e){let t=new Map,n,r;return{get(e){let n=t.get(e);if(n)return n.visited=!0,n.value},set(i,a){let o=t.get(i);if(o){o.value=a;return}if(t.size>=e){let e=n?.next().value;for(;!e||e.visited;)e?e.visited=!1:n=t.values(),e=n.next().value;e===r&&(n=void 0),t.delete(e.key)}let s={key:i,value:a,visited:!1};r=s,t.set(i,s)},clear(){t.clear(),n=void 0,r=void 0}}}var Jn=4,Yn=5;function Xn(e){let t=e.names;if(t)return t;let n=[];for(let t of e)typeof t!=`string`&&n.push(t[1]);return e.names=n}function Zn(e,t,n){let r=e.substring(t,n);if(r.charCodeAt(0)===36)return r.length===1?[2,`_splat`,``,void 0]:[1,r.substring(1),``,``];let i=r.indexOf(`{`);if(i>=0){let a=r.indexOf(`}`,i),o=r.charCodeAt(i+1)===45,s=i+(o?3:2);if(a>=0&&r.charCodeAt(s-1)===36&&(!o||s!e.parse&&e.caseSensitive===_&&e.prefix===h&&e.suffix===g);if(y)c=y;else{let e=er(r,t,_,h,g);c=e,v.push(e),v.length===2&&i?.push(v)}}r=c}p&&m=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===Jn)>(e.node.kind===Jn)||t.node.kind===Jn==(e.node.kind===Jn)&&t.node.depth>e.node.depth)))}function hr(e,t,n){let r=Pe(e),i=`/${r}`,a=t?i:i.toLowerCase(),o=`${a}/`,s={input:({url:e})=>{let n=t?e.pathname:e.pathname.toLowerCase();return n===a?e.pathname=`/`:n.startsWith(o)&&(e.pathname=e.pathname.slice(i.length)),e},output:({url:e})=>(e.pathname=ct(`/${r}${e.pathname}`),e)};return n?{input:({url:e})=>gr(n,s.input({url:e})),output:({url:e})=>s.output({url:_r(n,e)})}:s}function gr(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 _r(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 vr(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(()=>{Fe(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 yr=`__TSR_index`,br=`popstate`,xr=`beforeunload`,Sr=/^[\x00-\x20]*(?:[\\/][\t\n\r]*){2,}/;function Cr(e){let t=Sr.exec(e);return t?`/`+e.slice(t[0].length):e}function wr(e){return/[\x00-\x1f\x7f]/.test(e)&&(e=e.replace(/[\x00-\x1f\x7f]/g,e=>` +\r`.includes(e)?``:encodeURIComponent(e))),Cr(e)}function Tr(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=Or(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[yr];i=Er(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[yr];i=Er(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,n?.ignoreBlocker??!1),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[yr]!==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,_getBlockers:()=>e.getBlockers?.()??[]}}function Er(e,t){let n=kr();return{...t,key:n,__TSR_key:n,[yr]:e}}function Dr(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=t=>wr(e?.createHref?e.createHref(t):t),c=e?.parseLocation??(()=>Or(`${t.location.pathname}${t.location.search}${t.location.hash}`,t.history.state));if(!t.history.state?.__TSR_key&&!t.history.state?.key){let e=kr();t.history.replaceState({[yr]:0,key:e,__TSR_key:e},``)}let l=c(),u,d=!1,f=!1,p=!1,m=!1,h=()=>l,g,_=()=>{g&&(x._ignoreSubscribers=!0,(g[2]?t.history.pushState:t.history.replaceState)(g[1],``,g[0]),x._ignoreSubscribers=!1,g=void 0,u=void 0)},v=(t,n,r)=>{let i=e?.createHref?s(n):void 0,a=!!g;a||(u=l),l=Or(n,r),g=[i??l.href,r,g?.[2]||t],a||queueMicrotask(()=>_())},y=e=>{l=c(),x.notify({type:e})},b=async()=>{if(m=!1,f){f=!1;return}let e=c(),n=e.state[yr]-l.state[yr],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 r=a();if(typeof document<`u`&&r.length){for(let i of r)if(await i.blockerFn({currentLocation:l,nextLocation:e,action:s})){f=!0,t.history.go(-n),x.notify(u);return}}}l=c(),x.notify(u)},ee=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=``},x=Tr({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,n)=>{d=!0,n&&(p=!0,m=!0),t.history.go(e)},createHref:e=>s(e),flush:_,destroy:()=>{t.history.pushState=n,t.history.replaceState=r,t.removeEventListener(xr,ee,{capture:!0}),t.removeEventListener(br,b)},onBlocked:()=>{u&&l!==u&&(l=u)},getBlockers:a,setBlockers:o,notifyOnIndexChange:!1});return x._ignoreNextBeforeUnload=e=>{m=!1;try{e=new URL(e,t.document.baseURI).href,m=/^https?:/.test(e)&&(!e.includes(`#`)||e.split(`#`)[0]!==t.location.href.split(`#`)[0])}catch{}},t.addEventListener(xr,ee,{capture:!0}),t.addEventListener(br,b),t.history.pushState=function(...e){let r=n.apply(t.history,e);return x._ignoreSubscribers||y(`PUSH`),r},t.history.replaceState=function(...e){let n=r.apply(t.history,e);return x._ignoreSubscribers||y(`REPLACE`),n},x}function Or(e,t){let n=wr(e),r=n.indexOf(`#`),i=n.indexOf(`?`);if(!t){let e=kr();t={[yr]:0,key:e,__TSR_key:e}}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}}function kr(){return(Math.random()+1).toString(36).substring(7)}function Ar(e,t){return e.protocol!==`http:`&&e.protocol!==`https:`||e.origin!==t||!!e.username||!!e.password}function jr(e){return e.pathname+e.search+e.hash}function Mr(e){return e.options.loader||e.options.beforeLoad||e.lazyFn||e.options.component?.preload||e.options.pendingComponent?.preload}function Nr(e,t){return{fromLocation:t,toLocation:e,pathChanged:t?.pathname!==e.pathname,hrefChanged:t?.href!==e.href,hashChanged:t?.hash!==e.hash}}function Pr({key:e,__TSR_key:t,__TSR_index:n,__hashScrollIntoViewOptions:r,...i}){return i}function Fr(e){return e.findIndex(e=>e.status===`error`||e.status===`notFound`||e._notFound)+1}function Ir(e,t,n,r,i,a){r&&(t=t.slice(0,r)),i&&(n=n.slice(0,i));for(let r of t){if(a&&e._tx!==a)return;n.some(e=>e.routeId===r.routeId)||e.routesById[r.routeId].options.onLeave?.(r)}for(let r of n){if(a&&e._tx!==a)return;e.routesById[r.routeId].options[t.some(e=>e.routeId===r.routeId)?`onStay`:`onEnter`]?.(r)}}var Lr=class{constructor(e,t){this.tempLocationKey=`${Math.round(Math.random()*1e7)}`,this._scroll={n:!0},this.subscribers=new Set,this._cache=new Map,this._committed=[],this.startTransition=async e=>(e(),!1),this.update=e=>{let t=this.options;this.options={...t,...e},this.isServer=this.options.isServer??!1??typeof document>`u`,this.staticLocations=new WeakMap,this.protocolAllowlist=new Set(this.options.protocolAllowlist),(!this.history||this.options.history&&this.options.history!==this.history)&&(this.history=this.options.history?this.options.history:Dr()),this.origin=this.options.origin,this.origin||=window?.origin&&window.origin!==`null`?window.origin:`http://localhost`;let n=this.options.basepath??`/`,r=this.options.rewrite,i=this.basepath!==n||t?.rewrite!==r||t?.caseSensitive!==this.options.caseSensitive;if(i&&(this.basepath=n,this.rewrite=n!==`/`&&Pe(n)?hr(n,this.options.caseSensitive,r):r),this.history&&this.updateLatestLocation(),this.options.routeTree!==this.routeTree){this.routeTree=this.options.routeTree;let e;e=this.buildRouteTree(),this.setRoutes(e)}if(this.stores)i&&this.stores.location.set(this.latestLocation);else if(this.latestLocation){let e=this.getStoreConfig(this);this.batch=e.batch,this.stores=vr(this.latestLocation,e),Rn(this)}},this.updateLatestLocation=()=>{this.latestLocation=this.parseLocation(this.history.location,this.latestLocation)},this.buildRouteTree=()=>{let e=ar(this.routeTree,this.options.caseSensitive);return this.options.routeMasks&&tr(this.options.routeMasks,e.processedTree),{...e,resolvePathCache:qn(1e3)}},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},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:$e(e),external:!1,searchStr:o,search:lt(t?.search,i),hash:$e(r.slice(1)),state:Ke(t?.state,a)}}let o=gr(this.rewrite,new URL(i,this.origin)),s=this.options.parseSearch(o.search),c=this.options.stringifySearch(s);return o.search=c,{href:o.href.replace(o.origin,``),publicHref:i,pathname:$e(Cr(o.pathname)),external:!!this.rewrite&&Ar(o,this.origin),searchStr:c,search:lt(t?.search,s),hash:$e(o.hash.slice(1)),state:Ke(t?.state,a)}},r=n(e,e.state),{__tempLocation:i,__tempKey:a}=r.state;if(i&&(!a||a===this.tempLocationKey)){let e=n(i,{...i.state,__tempLocation:void 0,key:r.state.key,__TSR_key:r.state.__TSR_key});return e.maskedLocation=r,e}return r},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=ir(Ge(e),this.processedTree,!0);return n&&Object.assign(t,n.rawParams),[n?.branch||[this.routesById.__root__],t,n?.route]},this.buildLocation=e=>{{let t=this.staticLocations.get(e);if(t)return t}let t=!1,n=(n={})=>{if(n.href){let e=Or(n.href,{});n={...n,to:gr(this.rewrite,new URL(e.pathname,this.origin)).pathname,search:this.options.parseSearch(e.search),hash:e.hash.slice(1)}}let r=n._fromLocation||this._pendingLocation||this.latestLocation,i,a=()=>(t=!0,r),o=()=>(t=!0,i??=this.matchRoutesLightweight(r)),s=n.to?`${n.to}`:`.`,c=We(s[0]===`/`?``:n.unsafeRelative===`path`?a().pathname:n.from??o()[1],s,this.options.trailingSlash,this.resolvePathCache),l=this.routesByPath[Ge(c)],u=c.includes(`$`),d;if(l)d=l._branch??=cr(l);else if(u)d=[];else{let[e,t,n]=this.getMatchedRoutes(c);d=e,this.options.notFoundRoute&&(!n||n.path!==`/`&&t[`**`])&&(d=[...d,this.options.notFoundRoute])}let f=u?l?._interpolation??Qn(!1,{fullPath:c},0):void 0,p;for(let e of d){let t=e.options.params?.stringify??e.options.stringifyParams;if(t){let e=o()[3];if(p??=Hr(n.params,e),!He(p))break;p===e&&(p=Object.assign(Ve(),p));try{Object.assign(p,t(p))}catch{}}}p??=Hr(n.params,Ur(n.params,f)?o()[3]:Wr);let m=e.leaveParams?c:Cr($e(f?st(c,f,p,this.pathParamsDecoder):c)),h=Gr(d,e._includeValidateSearch),g=()=>{let t=o()[2];if(e._includeValidateSearch&&this.options.search?.strict){let e={};d.forEach(n=>{if(n.options.validateSearch)try{Object.assign(e,Vr(n.options.validateSearch,{...e,...t}))}catch{}}),t=e}return t},_=h.length?Kr(h,g(),n):n.search===!0?g():typeof n.search==`function`?n.search(g()):n.search||Wr,v=this.options.stringifySearch(_),y=n.hash===!0?a().hash:typeof n.hash==`function`?n.hash(a().hash):n.hash||void 0,b=y?`#${y}`:``,ee=n.state?n.state===!0?a().state:typeof n.state==`function`?n.state(a().state):n.state:Wr,x=`${m}${v}${b}`,S,C,te=!1;if(this.rewrite){let e=new URL(x,this.origin),t=e.origin,n=_r(this.rewrite,e);S=jr(e),Ar(n,t)?(C=n.href,te=!0):C=Cr(jr(n))}else S=Qe(x),C=S;return{publicHref:C,href:S,pathname:m,search:_,searchStr:v,state:ee,hash:y??``,external:te,unmaskOnReload:n.unmaskOnReload}},r=n(e);if(e.mask)r.maskedLocation=n({from:e.from,...e.mask});else if(this.options.routeMasks){let t=nr(r.pathname,this.processedTree);if(t){let i=Object.assign(Ve(),t.rawParams),{from:a,params:o,...s}=t.route,c=Hr(o,i);r.maskedLocation=n({from:e.from,...s,params:c})}}return!t&&e._fromLocation&&!r.maskedLocation&&this.staticLocations.set(e,r),r},this.commitLocation=async({viewTransition:e,ignoreBlocker:t,...n})=>{let r=n.maskedLocation??n;if(r.external)return Rr(this,r.publicHref,{replace:n.replace,ignoreBlocker:t});let i,a=Ge(this.latestLocation.href)===Ge(n.href)&&Me(Pr(n.state),Pr(this.latestLocation.state)),o=this._commitPromise,s,c=new Promise(e=>{s=e});if(c.resolve=()=>{s(),o?.resolve()},this._commitPromise=c,a)this.load();else{let{maskedLocation:r,hashScrollIntoView:a,...o}=n;r&&(o={...r,state:{...r.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={...o.state,__hashScrollIntoViewOptions:a??this.options.defaultHashScrollIntoView??!0},this.shouldViewTransition=e,i=n.replace?`REPLACE`:`PUSH`,this.history[i===`REPLACE`?`replace`:`push`](o.publicHref,o.state,{ignoreBlocker:t}),this.history.subscribers.size||this.load({action:{type:i}})}return this._scroll.n=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=n?Be(n):void 0;if(a||t){if(e!==void 0||!n){let t=this.buildLocation({to:e,...i}),a=t.maskedLocation??t;n??=a.publicHref,r??=a.publicHref}let t=!a&&r?r:n;return Rr(this,t,i)}return this.buildAndCommitLocation({...i,href:n,to:e,_isNavigate:!0})},this.load=async e=>{this.updateLatestLocation(),e?.action&&(this._scroll.h=e.action.type===`PUSH`||e.action.type===`REPLACE`),await Ri(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(Nr(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,a=e=>{(!n||n(e))&&i.add(e.id)};t.forEach(a),this._cache.forEach(a),r?.forEach(e=>e.forEach(a)),this._tx?.[3].forEach(a);let o=[];for(let[e,t]of r??[])t.some(e=>i.has(e.id))&&(r.delete(e),o.push(e));let s=t=>{if(i.has(t.id)){let n=this.routesById[t.routeId],r={...t,invalid:!0,...(e?.forcePending||t.status===`error`||t.status===`notFound`)&&Mr(n)?{status:`pending`,error:void 0}:void 0};return t._flight=void 0,r}return t};this._committed=t.map(s);for(let[t,n]of this._cache)i.has(t)&&(n.invalid=!0,e?.forcePending&&(n.status=`pending`));for(let e of i){let t=this._flights?.get(e);this._flights?.delete(e),t&&!t[2]&&o.push(t[1])}for(let e of o)e.abort();return this.shouldViewTransition=!1,this.load({sync:e?.sync})},this.resolveRedirect=e=>{let t=e.options,n=e.headers.get(`Location`)||t.href;if(!n){let e=this.buildLocation(t);n=(e.maskedLocation??e).publicHref||`/`}let r;if(Ne.test(n)||(r=Be(n))&&!this.protocolAllowlist.has(r))throw Error(`Redirect blocked: unsafe protocol`);if(r===`http:`||r===`https:`){let e=new URL(n);e.pathname.startsWith(`//`)?n=e.href:Ar(e,this.origin)||(n=jr(e),r=void 0)}return r&&(t.reloadDocument=!0),t.href=n,e.headers.set(`Location`,n),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=Zr,this.preloadRoute=e=>zi(this,e),this.matchRoute=(e,t)=>{let n={...e,to:e.to?We(e.from||``,e.to,this.options.trailingSlash,this.resolvePathCache):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=rr(r.pathname,t?.caseSensitive??!1,t?.fuzzy??!1,a.pathname,this.processedTree);return!o||e.params&&!Me(o.rawParams,e.params,!0)?!1:t?.includeSearch??!0?Me(a.search,r.search,!0)?o.rawParams:!1:o.rawParams},this.getStoreConfig=t,e.pathParamsAllowedCharacters?.length&&(this.pathParamsDecoder=Ye(e.pathParamsAllowedCharacters)),this.update({defaultPreloadDelay:50,defaultPendingMs:1e3,defaultPendingMinMs:500,context:void 0,...e,caseSensitive:e.caseSensitive??!1,notFoundMode:e.notFoundMode??`fuzzy`,stringifySearch:e.stringifySearch??Wn,parseSearch:e.parseSearch??Un,protocolAllowlist:e.protocolAllowlist??Ie}),self.__TSR_ROUTER__=this}isShell(){return!!this.options.isShell}get state(){return this.stores.__store.get()}setRoutes(e){Object.assign(this,e),this.lightweightCache=new WeakMap,this.staticLocations=new WeakMap;let t=this.options.notFoundRoute;t&&(t.init(99999999999),this.routesById[t.id]!==t&&(t._interpolation=Qn(!1,t,0)),this.routesById[t.id]=t)}matchRoutesInternal(e,t){let[n,r,i]=this.getMatchedRoutes(e.pathname),a=n,o=!1;(i?i.path!==`/`&&r[`**`]:Ge(e.pathname))&&(this.options.notFoundRoute?a=[...a,this.options.notFoundRoute]:o=!0);let s=o?qr(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;ntypeof t!=`string`&&!Le.call(e,t[1]))}var Wr=Object.freeze({});function Gr(e,t){let n=[];for(let r=0;r{let n=t(i.preSearchFilters?i.preSearchFilters.reduce((e,t)=>t(e),e):e);return i.postSearchFilters?i.postSearchFilters.reduce((e,t)=>t(e),n):n});let a=i.validateSearch;t&&a&&n.push(({search:e,next:t,meta:n})=>{let r=t(e);try{let e=Vr(a,r);if(n&&e)for(let t in e)t in r||(n.defaulted||=new Map).set(t,e[t]);return{...r,...e}}catch{}return r})}return n}function Kr(e,t,n){let r=(t,i,a)=>{if(t>=e.length){if(!n.search)return{};if(n.search===!0)return i;let e=ze(n.search,i);return a&&(a.explicit=e),e}return e[t]({search:i,next:(e,n)=>{if(n){let n=a||{};return{search:r(t+1,e,n),meta:n}}return r(t+1,e,a)},meta:a})};return r(0,t)}function qr(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 zt}function Jr(e,t){let n=e.options.params?.parse??e.options.parseParams;n&&Object.assign(t,n(t))}function Yr(e,t){return e.options[t]?.preload?.()}function Xr(e,t){let n=Yr(e,`component`),r=Yr(e,`pendingComponent`);return t&&(r?r=r.then(t):t()),n&&r?Promise.all([n,r]).then(()=>{}):n??r}function Zr(e,t,n){let r=()=>t===!1?void 0:t?Yr(e,t):Xr(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 Qr(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).then(()=>t.removeEventListener(`abort`,i))})}function oi(e,t){return e.routesById[t.routeId]}function si(e,t,n){return jt(e)?[ni,e]:Tn(e)?(e.routeId||=n,[ti,e]):t?(typeof e?.then==`function`&&(e=Error(`A Promise was thrown`,{cause:e})),[ei,e]):[$r,e]}function ci(e,t){let n=si(t,!0,e.id);if(n[0]!==ei)return n;try{e.options.onError?.(n[1])}catch(t){n=si(t,!0,e.id)}return n}function li(e,t,n,r,i){return i[0].signal.aborted?ri:Ti(e,t,n,ci(n,r),i)}async function ui(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 fi(e,r),[i,li(e,t,u,a,n)]}if(c.aborted)return[i,ri];let p=r.paramsError??r.searchError;if(p!==void 0)return fi(e,r),[i,li(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{hi(e,r,`beforeLoad`,n[0]);let a=m({...f,search:r.search,context:r.context,...e.options.additionalContext}),o=await(typeof a?.then==`function`?ai(a,c):a);if(c.aborted)return[i,ri];let s=Ti(e,t,u,si(o,!1,u.id),n);if(s[0]!==$r)return fi(e,r),[i,s];r.context={...r.context,...o}}catch(a){return fi(e,r),[i,li(e,t,u,a,n)]}finally{r.status=h,hi(e,r,!1,n[0])}}i()}function di(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 fi(e,t){let n=t._flight;t._flight=void 0,di(e,t,n)?.abort()}function pi(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=di(e,a,t);n&&i.push(n)}}for(let e of i)e.abort()}function mi(e){for(let t of e){let e=t._flight;e&&e[2]++}}function hi(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 gi(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 _i(e,t,n,r,i,a,o){let s=o[0],c=s.signal;if(c.aborted)return ri;if(!i)return[$r,void 0];let l=n._flight;hi(e,n,`loader`,s);try{if(!l){let s=new AbortController;l=[Promise.resolve().then(()=>i(gi(e,t,n,r,s,a,!!o[3]))).then(e=>si(e,!1,r.id),e=>si(e,!0,r.id)).then(t=>(t[0]!==$r&&e._flights?.get(n.id)===l&&(e._flights.delete(n.id),l[2]||s.abort()),t[0]===ei&&l[2]?ci(r,t[1]):t)),s,1],(e._flights??=new Map).set(n.id,l)}return n._flight=l,n.abortController=l[1],Ti(e,t,r,await ai(l[0],c),o)}catch(t){if(t!==c||!c.aborted)throw t;return fi(e,n),ri}finally{hi(e,n,!1,s)}}function vi(e,t,n){t[0]!==ni&&(e.status=`success`,e.error=void 0,t[0]===$r?(e.loaderData=t[1],e.invalid=!1,e.updatedAt=Date.now(),e.preload=n):e.invalid=!0)}function yi(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&&fi(e,r)}function bi(e,t){return t[0]===ei||t[0]===ti?{...e,status:t[0]===ei?`error`:`notFound`,error:t[1],_flight:void 0}:e}function xi(e,t,n,r,i,a,o){let s=t[1][n],c=oi(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(gi(e,t,s,c,a[0],i,l))),a[0].signal.aborted&&(p=ri)),!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,fi(e,s),p=li(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&&_,ee=b&&!y&&(s.status!==`success`||!!m),x=n>=o?a[7]:void 0,S=c.lazyFn&&c._lazy!==!0?x:void 0;if(b&&!m&&(s.invalid=!1,s.updatedAt=Date.now()),v&&v[2]++,ee){let t=s._flight;s._flight=v,di(e,s,t)?.abort(),n>=o&&(s.status=`pending`),x?.()}b||(s.isFetching=!1);let C=!p&&ee?_i(e,t,s,c,g,i,a).then(t=>(vi(s,t,l),t[0]===$r&&(m&&!a[0].signal.aborted&&yi(e,s,u),n>=o&&(s.status=`pending`)),t)):Promise.resolve(p??[$r,s.loaderData]),te=(async()=>{try{let e=Zr(c,void 0,S);e&&await ai(e,a[0].signal)}catch(r){if(!t[1].some((e,t)=>t<=n&&(e.status===`error`||e.status===`notFound`||e._notFound)))return[n,li(e,t,c,r,a)]}let r=await C;ee&&r[0]===$r&&s.status===`pending`&&!a[0].signal.aborted&&(s.status=`success`,x?.())})();if(r.push([n,C,te]),!y)return C.then(e=>bi(s,e));let ne={...s,status:`pending`,preload:!1,_flight:v};s.invalid=!1,s.isFetching=`loader`;let w=_i(e,t,ne,c,g,i,a).then(e=>(s.isFetching=!1,vi(ne,e,!1),e));return(t[2]??=[]).push([n,w,te,ne]),w.then(e=>bi(ne,e))}async function Si(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=oi(e,t[n]);try{let e=Zr(i,!1);e&&await ai(e,r)}catch(e){if(e===r&&r.aborted)throw e}if(i.options.notFoundComponent)return n}return a?.routeId?o:i}function Ci(e,t){t[2]&&=(pi(e,t[2].map(e=>e[3])),void 0)}async function wi(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]>=ni)throw[a,t];!i&&t[0]!==$r&&(i=[a,t],await Promise.all((n??[]).map(e=>{if(!(e[0]<=a))return e[1].then(t=>{if(t[0]===ni)throw[e[0],t]})})))}})))}catch(e){return e}return t??i}function Ti(e,t,n,r,i,a){for(;r[0]===ni;){let o=r[1],s=o.options;try{if((s.href||o.headers.has(`Location`))&&(e.resolveRedirect(o),s.reloadDocument)||(s.reloadDocument?i[3]:i[1]>=20))return r;let n=e.buildLocation({...s,_fromLocation:t[0],_includeValidateSearch:!0}),a=n.maskedLocation??n;if(a.external){let t=o.clone();return t.options={...s},t.headers.set(`Location`,a.publicHref),e.resolveRedirect(t),i[3]?[ni,t]:[ni,t,a]}return[ni,o,n]}catch(e){r=a?[ei,e]:ci(n,e),a=!0}}return r}async function Ei(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]===ti?Si(e,o,t,r.signal):t[0],d=l<0?o.length:l;if((s?.[1][0]??0)>=ni)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]!==$r&&t[0]=d)break;let t=await e[2];if(t){s=t;break}}if((s?.[1][0]??0)>=ni){let n=s[1];if(n[0]!==ni||n[1].options.reloadDocument||n[2])return Ci(e,t),n;c=!0,s=[0,[ei,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===ei?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=oi(e,u);try{await ai(i?Promise.resolve().then(()=>Zr(m,l===ei?`errorComponent`:`notFoundComponent`)):Promise.all([Zr(m),Zr(m,`notFoundComponent`)]),r.signal)}catch(n){if(n===r.signal&&r.signal.aborted)return Ci(e,t),ri}i?c&&(r.abort(),await Promise.all([...n.map(e=>e[1]),...n.map(e=>e[2]),...(t[2]??[]).map(e=>e[1])]),Ci(e,t),pi(e,o),p()):u.status=`success`}return t}async function Di(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 Si(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=ni&&(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=Ei(e,i,u,r[0],wi(u,m,i[2]),r[7]);i[2]?.length&&(i[3]=wi(i[2],void 0,void 0,h.then(e=>ii(e)?0:Qr(n).length,()=>0))),o=await h}catch(t){if(Ci(e,i),t===a&&a.aborted)return ri;throw t}return ii(o)?o:Di(e,o,a,r[6]===n.length?r[6]:0)}function ki(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(()=>ki(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 Ai(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 ji(e,t){let n=e._pending;if(!n)return;clearTimeout(n[3]);let r=n[2]-Date.now();if(!n[4]||r<=0||!Qr(t[3]).some(e=>e.id===n[1]))return;let i;try{await ai(new Promise(e=>{i=setTimeout(e,r)}),t[0].signal)}catch{}clearTimeout(i)}function Mi(e,t){e._committed=t,e.stores.setMatches(t)}function Ni(e,t,n,r){let i=e._committed,a=e._lifecycleEnd,o=e._cache;for(let e of n)e.preload=!1,r&&(e._assetEnd=void 0);let s=Qr(n).length,c=new Map;{let t=Date.now(),r=new Set;for(let e=0;e=(n.preload?i.options.preloadGcTime??e.options.defaultPreloadGcTime??3e5:i.options.gcTime??e.options.defaultGcTime??3e5)||c.set(n.id,o.get(n.id)===n?n:{...n,_flight:void 0,isFetching:!1,context:{}})}}t[3]=[],e._cache=c;let l=e._lifecycleEnd=Fr(n);Mi(e,n),pi(e,[...o.values(),...i].filter(e=>e._flight&&c.get(e.id)!==e),n),Ir(e,i,n,a,l,t)}async function Pi(e,t){let n=e._tx;for(;n&&n!==t;)t=n,await n[5],n=e._tx}function Fi(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.maskedLocation??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 Ii(e,t,n,r,i){let a=n.map(e=>({...e}));mi(a);for(let t of r)fi(e,a[t[0]]),a[t[0]]=t[3];let o=[t[2],a],s;try{s=await Ei(e,o,r,t[0],i)}catch(t){throw pi(e,a),t}if(ii(s)){pi(e,a),s[0]===ni&&e._tx===t&&e._committed===n&&await Fi(e,t,s);return}if(await Di(e,s,t[0].signal),e._tx!==t||e._committed!==n){pi(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),fi(e,n))}Mi(e,a),pi(e,n,a)}async function Li(e,t,n,r,i,a){let o=await Oi(e,t[2],t[3],[t[0],t[1],e._committed,void 0,i,n,a,r]);if(ii(o)){let n=o[0]===ni&&e._tx===t;if((!n||o[1].options.reloadDocument)&&Ai(e,t),pi(e,t[3]),t[3]=[],!n)return;if(e._tx!==t){Ai(e,t);return}await Fi(e,t,o);return}let s=o[1];if(e._tx===t&&await ji(e,t),e._tx!==t){Ai(e,t),pi(e,s),Ci(e,o);return}let c=t[2],l=Nr(c,e.stores.resolvedLocation.get()),u=o[2];await e.startViewTransition(async()=>{if(e._tx===t&&await ji(e,t),e._tx!==t){Ai(e,t),pi(e,s),Ci(e,o);return}let n=await e.startTransition(()=>{Ai(e,t),Ni(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){Ci(e,o);return}u?.length&&Ii(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 Ri(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=Nr(a,r);e.emit({type:`onBeforeNavigate`,...t}),u.signal.aborted||e.emit({type:`onBeforeLoad`,...t})}if(u.signal.aborted){await Pi(e,n);return}let f=i.href===a.href,p=u,m=e.matchRoutes(a,{_controller:u});mi(m);let h=l?c[1](m):void 0;if(h?p=l:l?.abort(),u.signal.aborted){pi(e,m),await Pi(e,n);return}e._preflight=void 0;let g,_=()=>Li(e,y,f,()=>ki(e,y),t?.sync,h),v=t?.sync?new Promise(e=>g=e):Promise.resolve().then(_),y=[p,s,a,m,Date.now(),v.then(()=>Pi(e,y))];if(e._tx=y,n){for(let t of e.stores.matches.get()){if(e._tx!==y)break;t.isFetching&&hi(e,t,!1)}n[0].abort(),pi(e,n[3],y[3],!0)}if(e._tx!==y){pi(e,y[3]),y[3]=[],g?.(),await Pi(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))&&ki(e,y),g?.(_()),await y[5]}async function zi(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}),mi(a),o=(e._preloads??=new Map).set(i,a),s=await Oi(e,n,a,[i,t,r,!0])}finally{o&&(o=o.delete(i),pi(e,a)),i.abort()}if(!ii(s))return s[1];if(!o||s.length<3)return;n=s[2]}catch(e){Tn(e)||console.error(e);return}}}var D=h(Ce(),1),O=x(),Bi=class extends D.Component{constructor(...e){super(...e),this.state={error:0},this.reset=()=>{this.setState({error:0})}}static getDerivedStateFromProps(e,t){let n=e.getResetKey();return t.error&&t.resetKey!==n?{resetKey:n,error:0}:{resetKey:n}}static getDerivedStateFromError(e){return{error:[e]}}componentDidCatch(e,t){this.props.onCatch?.(e,t)}render(){let e=this.state.error;return e?D.createElement(this.props.errorComponent??Vi,{error:e[0],reset:this.reset}):this.props.children}};function Vi({error:e}){let[t,n]=D.useState(!1);return(0,O.jsxs)(`div`,{style:{padding:`.5rem`,maxWidth:`100%`},children:[(0,O.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:`.5rem`},children:[(0,O.jsx)(`strong`,{style:{fontSize:`1rem`},children:`Something went wrong!`}),(0,O.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,O.jsx)(`div`,{style:{height:`.25rem`}}),t?(0,O.jsx)(`div`,{children:(0,O.jsx)(`pre`,{style:{fontSize:`.7em`,border:`1px solid red`,borderRadius:`.25rem`,padding:`.3rem`,color:`red`,overflow:`auto`},children:e?.message?(0,O.jsx)(`code`,{children:e.message}):null})}):null]})}function Hi(e){let t=se(),n=`not-found-${qe(t.stores.location,e=>e.pathname)}-${qe(t.stores.status)}`;return(0,O.jsx)(Bi,{getResetKey:()=>n,onCatch:(t,n)=>{if(Tn(t))e.onCatch?.(t,n);else throw t},errorComponent:({error:t})=>{if(Tn(t))return e.fallback?.(t);throw t},children:e.children})}function Ui(){return(0,O.jsx)(`p`,{children:`Not Found`})}function Wi(e,t,n){return t.options.notFoundComponent?(0,O.jsx)(t.options.notFoundComponent,{...n}):e.options.defaultNotFoundComponent?(0,O.jsx)(e.options.defaultNotFoundComponent,{...n}):(0,O.jsx)(Ui,{})}function Gi(e,t){let n=t?.options.pendingComponent??e.options.defaultPendingComponent;return n?(0,O.jsx)(n,{}):null}var Ki=(e,t)=>e[0]===t[0]&&e[1]===t[1],qi=(e,t,n)=>!t.isRoot||t.options.shellComponent||t.options.wrapInSuspense||n===!1||n===`data-only`||!e.ssr,Ji=D.memo(function({routeId:e}){let t=se();return(0,O.jsx)(Yi,{router:t,match:qe(t.stores.getMatchStore(e))})});function Yi({router:e,match:t}){let n=e.routesById[t.routeId],r=Gi(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=qi(e,n,t.ssr)&&(n.options.wrapInSuspense??r??(n.options.errorComponent?.preload||s)),l=(0,O.jsx)(Xi,{match:t});s&&(l=(0,O.jsx)(ot,{fallback:r,children:l})),o&&(l=(0,O.jsx)(Hi,{fallback:e=>{if(e.routeId??=t.routeId,e.routeId!==t.routeId)throw e;return D.createElement(o,e)},children:l})),i&&(l=(0,O.jsx)(Bi,{getResetKey:()=>t,errorComponent:i,onCatch:(e,n)=>{if(Tn(e))throw e.routeId??=t.routeId,e;a?.(e,n)},children:l})),c&&(l=(0,O.jsx)(D.Suspense,{fallback:r,children:l}));let u=n.isRoot?n.options.shellComponent:void 0;return(0,O.jsx)(Dt.Provider,{value:t.routeId,children:u?(0,O.jsxs)(u,{children:[l,null]}):(0,O.jsxs)(O.Fragment,{children:[l,null]})})}var Xi=D.memo(function({match:e}){let t=se(),n=e.routeId,r=t.routesById[n],i=D.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=D.useMemo(()=>{let e=r.options.component??t.options.defaultComponent;return e?(0,O.jsx)(e,{},i):(0,O.jsx)(Zi,{})},[i,r.options.component,t.options.defaultComponent]);if(e.status===`pending`){if(t.ssr&&!qi(t,r,e.ssr))return a;if(t._tx)throw t._tx[5];return Gi(t,r)}if(e.status===`notFound`)return Wi(t,r,e.error);if(e.status===`error`)throw e.error;return a}),Zi=D.memo(function(){let e=se(),t=D.useContext(Dt),n,r,i;{let a=e.stores.getMatchStore(t);[n,r]=qe(a,e=>[!!e._notFound,e.error],{compare:Ki}),i=qe(e.stores.ids,e=>e[e.indexOf(t)+1])}if(n)return Wi(e,e.routesById[t],r);if(!i)return null;let a=(0,O.jsx)(Ji,{routeId:i});return t===`__root__`?(0,O.jsx)(D.Suspense,{fallback:Gi(e),children:a}):a});function Qi(e,t){let n=e[1];e.length=0,n?.(t)}function $i({t:e}){let t=se(),n=t._rendered??=[];return t.startTransition=(r,i)=>new Promise(a=>{Qi(n,!1),n.push(i,a),e(t),D.startTransition(r)}),De(()=>{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(Ge(r.publicHref)!==Ge(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`,...Nr(a,a)})}):t._tx||t.load({sync:!0}).catch(console.error),e},[t,t.history]),null}function ea(){let e=se(),t=e.routesById[zt],n=Gi(e,t),r=(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)($i,{t:D.useState()[1]}),e.ssr?(0,O.jsx)(ta,{}):(0,O.jsx)(D.Suspense,{fallback:n,children:(0,O.jsx)(ta,{})})]});return e.options.InnerWrap?(0,O.jsx)(e.options.InnerWrap,{children:r}):r}function ta(){let e=se(),t=e._rendered,n=qe(e.stores.matches,e=>t[0]??e),r=n[0],i=r?.routeId;De(()=>{t[0]===n&&Qi(t,!0)},[t,n]);let a=i?(0,O.jsx)(Ji,{routeId:i}):null;return e.options.disableGlobalCatchBoundary?a:(0,O.jsx)(Bi,{getResetKey:()=>r,onCatch:void 0,children:a})}var na=e=>({createMutableStore:It,createReadonlyStore:It,batch:Pt}),ra=e=>new ia(e),ia=class extends Lr{constructor(e){super(e,na)}};function aa({router:e,children:t,...n}){He(n)&&e.update({...e.options,...n,context:{...e.options.context,...n.context}});let r=(0,O.jsx)(oe.Provider,{value:e,children:t});return e.options.Wrap?(0,O.jsx)(e.options.Wrap,{children:r}):r}function oa({router:e,...t}){return(0,O.jsx)(aa,{router:e,...t,children:(0,O.jsx)(ea,{})})}function sa(e){let t=se({warn:e?.router===void 0}),n=e?.router||t;return qe(n.stores.__store,Tt(e,n))}function ca(e,t,n={leading:!1}){let[r,i]=(0,D.useState)(e),a=(0,D.useRef)(!1),o=(0,D.useRef)(null),s=(0,D.useRef)(!1),c=(0,D.useRef)(e);c.current=e;let l=(0,D.useCallback)(()=>{window.clearTimeout(o.current),o.current=null},[]),u=(0,D.useCallback)(()=>{l(),s.current=!1},[]),d=(0,D.useCallback)(()=>{o.current&&(u(),s.current=!1,i(c.current))},[]);return(0,D.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,D.useEffect)(()=>(a.current=!0,u),[]),[r,u,{cancel:u,flush:d}]}function la(e=!1,t={}){let[n,r]=(0,D.useState)(e),i=(0,D.useCallback)(()=>{r(e=>e||(t.onOpen?.(),!0))},[t.onOpen]),a=(0,D.useCallback)(()=>{r(e=>e&&(t.onClose?.(),!1))},[t.onClose]);return[n,{open:i,close:a,toggle:(0,D.useCallback)(()=>{n?a():i()},[a,i,n]),set:r}]}function ua(e){return e===`auto`||e===`dark`||e===`light`}function da({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 ua(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&&ua(t.newValue)&&n(t.newValue)},window.addEventListener(`storage`,t)},unsubscribe:()=>{window.removeEventListener(`storage`,t)},clear:()=>{window.localStorage.removeItem(e)}}}function fa(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 pa({manager:e,defaultColorScheme:t,getRootElement:n,forceColorScheme:r}){let i=(0,D.useRef)(null),[a,o]=(0,D.useState)(()=>e.get(t)),s=r||a,c=(0,D.useCallback)(t=>{r||(fa(t,n),o(t),e.set(t))},[e.set,s,r]),l=(0,D.useCallback)(()=>{o(t),fa(t,n),e.clear()},[e.clear,t]);return(0,D.useEffect)(()=>(e.subscribe(c),e.unsubscribe),[e.subscribe,e.unsubscribe]),he(()=>{fa(e.get(t),n)},[]),(0,D.useEffect)(()=>{if(r)return fa(r,n),()=>{};r===void 0&&fa(a,n),typeof window<`u`&&`matchMedia`in window&&(i.current=window.matchMedia(`(prefers-color-scheme: dark)`));let e=e=>{a===`auto`&&fa(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 ma(e){return Object.entries(e).map(([e,t])=>`${e}: ${t};`).join(``)}function ha(e,t){let n=t?[t]:[`:root`,`:host`],r=ma(e.variables),i=r?`${n.join(`, `)}{${r}}`:``,a=ma(e.dark),o=ma(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 k({theme:e,color:t,colorScheme:n,name:r=t,withColorValues:i=!0}){if(!e.colors[t])return{};if(n===`light`){let n=s(e,`light`),o={[`--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`]:a(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],...o}:o}let o=s(e,`dark`),c={[`--mantine-color-${r}-text`]:`var(--mantine-color-${r}-4)`,[`--mantine-color-${r}-filled`]:`var(--mantine-color-${r}-${o})`,[`--mantine-color-${r}-filled-hover`]:`var(--mantine-color-${r}-${o===9?8:o+1})`,[`--mantine-color-${r}-light`]:v(e.colors[t][9],.5),[`--mantine-color-${r}-light-hover`]:v(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(o-4,0)})`,[`--mantine-color-${r}-outline-hover`]:a(e.colors[t][Math.max(o-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],...c}:c}function ga(e,t,n){de(t).forEach(r=>Object.assign(e,{[`--mantine-${n}-${r}`]:t[r]}))}var _a=e=>{let t=s(e,`light`),n=e.defaultRadius in e.radius?e.radius[e.defaultRadius]:T(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":xt(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":xt(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)`}};ga(r.variables,e.breakpoints,`breakpoint`),ga(r.variables,e.spacing,`spacing`),ga(r.variables,e.fontSizes,`font-size`),ga(r.variables,e.lineHeights,`line-height`),ga(r.variables,e.shadows,`shadow`),ga(r.variables,e.radius,`radius`),ga(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})`}),de(e.colors).forEach(t=>{let n=e.colors[t];if(i(n)){Object.assign(r.light,k({theme:e,name:n.name,color:n.light,colorScheme:`light`,withColorValues:!0})),Object.assign(r.dark,k({theme:e,name:n.name,color:n.dark,colorScheme:`dark`,withColorValues:!0})),r.light[`--mantine-color-${n.name}-contrast`]=bt(n,e,`light`),r.dark[`--mantine-color-${n.name}-contrast`]=bt(n,e,`dark`);return}n.forEach((e,n)=>{r.variables[`--mantine-color-${t}-${n}`]=e}),Object.assign(r.light,k({theme:e,color:t,colorScheme:`light`,withColorValues:!1})),Object.assign(r.dark,k({theme:e,color:t,colorScheme:`dark`,withColorValues:!1}))});let a=e.headings.sizes;return de(a).forEach(t=>{r.variables[`--mantine-${t}-font-size`]=a[t].fontSize,r.variables[`--mantine-${t}-line-height`]=a[t].lineHeight,r.variables[`--mantine-${t}-font-weight`]=a[t].fontWeight||e.headings.fontWeight}),r};function va(){let e=f(),n=t(),r=de(e.breakpoints).reduce((t,n)=>{let r=e.breakpoints[n].includes(`px`),i=kt(e.breakpoints[n]);return`${t}@media (max-width: ${r?`${i-.1}px`:re(i-.1)}) {.mantine-visible-from-${n} {display: none !important;}}@media (min-width: ${r?`${i}px`:re(i)}) {.mantine-hidden-from-${n} {display: none !important;}}`},``);return(0,O.jsx)(`style`,{"data-mantine-styles":`classes`,nonce:n?.(),dangerouslySetInnerHTML:{__html:r}})}function ya({theme:e,generator:t}){let n=_a(e),r=t?.(e);return r?me(n,r):n}var ba=_a(r);function xa(e){let t={variables:{},light:{},dark:{}};return de(e.variables).forEach(n=>{ba.variables[n]!==e.variables[n]&&(t.variables[n]=e.variables[n])}),de(e.light).forEach(n=>{ba.light[n]!==e.light[n]&&(t.light[n]=e.light[n])}),de(e.dark).forEach(n=>{ba.dark[n]!==e.dark[n]&&(t.dark[n]=e.dark[n])}),t}function Sa(e){return ha({variables:{},dark:{"--mantine-color-scheme":`dark`},light:{"--mantine-color-scheme":`light`}},e)}function Ca({cssVariablesSelector:e,deduplicateCssVariables:n}){let r=f(),i=t(),a=ya({theme:r,generator:p()}),o=(e===void 0||e===`:root`||e===`:host`)&&n,s=ha(o?xa(a):a,e);return s?(0,O.jsx)(`style`,{"data-mantine-styles":!0,nonce:i?.(),dangerouslySetInnerHTML:{__html:`${s}${o?``:Sa(e)}`}}):null}Ca.displayName=`@mantine/CssVariables`;function wa({respectReducedMotion:e,getRootElement:t}){he(()=>{e&&t()?.setAttribute(`data-respect-reduced-motion`,`true`)},[e])}function Ta({theme:e,children:t,getStyleNonce:n,withStaticClasses:r=!0,withGlobalClasses:i=!0,deduplicateCssVariables:a=!0,withCssVariables:s=!0,cssVariablesSelector:c,classNamesPrefix:l=`mantine`,colorSchemeManager:u=da(),defaultColorScheme:f=`light`,getRootElement:p=()=>document.documentElement,cssVariablesResolver:m,forceColorScheme:h,stylesTransform:g,env:_,deduplicateInlineStyles:v=!1}){let{colorScheme:y,setColorScheme:b,clearColorScheme:ee}=pa({defaultColorScheme:f,forceColorScheme:h,manager:u,getRootElement:p});return wa({respectReducedMotion:e?.respectReducedMotion||!1,getRootElement:p}),(0,O.jsx)(o,{value:{colorScheme:y,setColorScheme:b,clearColorScheme:ee,getRootElement:p,classNamesPrefix:l,getStyleNonce:n,cssVariablesResolver:m,cssVariablesSelector:c??`:root`,withStaticClasses:r,stylesTransform:g,env:_,deduplicateInlineStyles:v},children:(0,O.jsxs)(d,{theme:e,children:[s&&(0,O.jsx)(Ca,{cssVariablesSelector:c,deduplicateCssVariables:a}),i&&(0,O.jsx)(va,{}),t]})})}Ta.displayName=`@mantine/core/MantineProvider`;function Ea(e){return e}var[Da,Oa]=Ht(`AppShell was not found in tree`);function ka({size:e,min:t,max:n,viewportMax:r}){let i=Math.min(n??1/0,r);return Math.max(Math.min(t??0,i),Math.min(e,i))}function Aa(e,t){return t!==void 0&&ep.axis===`horizontal`?window.innerWidth:window.innerHeight,[g,_]=(0,D.useState)(0),[v,y]=(0,D.useState)(void 0),b=()=>h()/d.scale,ee=e=>{let t=e.getBoundingClientRect();return((p.axis===`horizontal`?t.width:t.height)-Pa(e,p.safeAreaVariable))/d.scale},x=t=>{let n=r.rootRef.current;if(!n)return;let i=T(t);n.style.setProperty(p.sizeVariable,i),r.resizeOffsets[e]&&n.style.setProperty(p.offsetVariable,i),r.mode===`static`&&p.gridWidthVariable&&n.style.setProperty(p.gridWidthVariable,i)},S=()=>{let e=r.rootRef.current;e&&(e.style.removeProperty(p.sizeVariable),e.style.removeProperty(p.offsetVariable),p.gridWidthVariable&&e.style.removeProperty(p.gridWidthVariable))},C=()=>{c.current?.abort(),c.current=null,s.current=null;let e=l.current;l.current=null,e&&(za(`user-select`,e.userSelect),za(`-webkit-user-select`,e.webkitUserSelect),za(`cursor`,e.cursor))},te=()=>{i?.reportCollapse(e,Aa(o.current.startSize,m.collapseThreshold)),i?.endResize(e,null)},ne=t=>{if(t.pointerId!==s.current)return;o.current.moved=!0;let n=Na({section:e,deltaX:t.clientX-o.current.startX,deltaY:t.clientY-o.current.startY,dir:u})/d.scale,r=o.current.startSize+n,c=ka({size:r,min:m.min,max:m.max,viewportMax:b()});o.current.size=c,x(c),a.current?.setAttribute(`aria-valuenow`,String(Math.round(c))),i?.previewResize(e,c),i?.reportCollapse(e,Aa(r,m.collapseThreshold))},w=t=>{if(t.pointerId===s.current){if(C(),!o.current.moved){i?.endResize(e,null);return}i?.endResize(e,o.current.size)}},re=e=>{e.pointerId===s.current&&(C(),S(),te())},ie=e=>{e.key===`Escape`&&(e.preventDefault(),C(),S(),a.current?.setAttribute(`aria-valuenow`,String(Math.round(o.current.startSize))),te())},ae=()=>{let t=i?.[e].size;if(t!==void 0)return t;let n=a.current?.parentElement;return n?ee(n):0},oe=t=>{i?.initCollapse(e,Aa(ae(),m.collapseThreshold)),i?.reportCollapse(e,Aa(t,m.collapseThreshold)),i?.endResize(e,ka({size:t,min:m.min,max:m.max,viewportMax:b()}))},se=t=>{let n=t.shiftKey?La:Ia;if(t.key===`Home`){t.preventDefault(),oe(m.min??0);return}if(t.key===`End`){t.preventDefault(),oe(m.max??b());return}let r=Ra[t.key];if(!r)return;let i=Na({section:e,...r,dir:u});i!==0&&(t.preventDefault(),oe(ae()+i*n))},ce=()=>{S(),i?.[e].reset()},le=t=>{if(t.button!==0||c.current!==null)return;let n=a.current?.parentElement;if(!n)return;let r=ee(n);o.current={startSize:r,startX:t.clientX,startY:t.clientY,size:r,moved:!1},s.current=t.pointerId,i?.initCollapse(e,Aa(r,m.collapseThreshold));let u=new AbortController;c.current=u;let{signal:d}=u;l.current={userSelect:document.body.style.getPropertyValue(`user-select`),webkitUserSelect:document.body.style.getPropertyValue(`-webkit-user-select`),cursor:document.body.style.getPropertyValue(`cursor`)},document.body.style.setProperty(`user-select`,`none`),document.body.style.setProperty(`-webkit-user-select`,`none`),document.body.style.setProperty(`cursor`,p.axis===`horizontal`?`col-resize`:`row-resize`),i?.startResize(e),document.addEventListener(`pointermove`,ne,{signal:d}),document.addEventListener(`pointerup`,w,{signal:d}),document.addEventListener(`pointercancel`,re,{signal:d}),document.addEventListener(`keydown`,ie,{signal:d})};if(he(()=>{i&&i.activeSection!==e&&S()},[i?.activeSection,i?.[e].size]),he(()=>{_(h());let e=()=>_(h());return window.addEventListener(`resize`,e),()=>window.removeEventListener(`resize`,e)},[p.axis]),he(()=>{i?.[e].size===void 0&&y(ae())},[i?.[e].size,g]),he(()=>()=>{let e=c.current!==null;C(),S(),e&&te()},[]),!i?.[e].enabled)return null;let ue=g/d.scale,de=Math.min(m.max??ue,ue),fe=i[e].size,pe=fe!==void 0&&g>0?Math.min(fe,ue):fe??v;return(0,O.jsx)(n,{ref:a,role:`separator`,tabIndex:0,"aria-label":m.label??Fa[e],"aria-controls":t,"aria-orientation":p.orientation,"aria-valuemin":m.min??0,"aria-valuemax":Math.round(de),"aria-valuenow":pe===void 0?void 0:Math.round(pe),onPointerDown:le,onKeyDown:se,onDoubleClick:ce,mod:{section:e,orientation:p.orientation,active:i[e].active},...r.getStyles(`resizeHandle`)})}Ba.displayName=`@mantine/core/AppShellResizeHandle`;var Va={root:`m_89ab340`,navbar:`m_45252eee`,aside:`m_9cdde9a`,header:`m_3b16f56b`,main:`m_8983817`,footer:`m_3840c879`,section:`m_6dcfc7c7`,resizeHandle:`m_3b25945a`},Ha=g(e=>{let{classNames:t,className:r,style:i,styles:a,unstyled:o,vars:s,withBorder:c,zIndex:l,mod:d,...f}=u(`AppShellAside`,null,e),p=Oa(),m=_e(f.id);if(p.disabled)return null;let h=p.resize?.aside.enabled??!1,g=p.getStyles(`aside`,{className:b({[Zt.classNames.zeroRight]:p.offsetScrollbars},r),classNames:t,styles:a,style:i});if(!h)return(0,O.jsx)(n,{component:`aside`,mod:[{"with-border":c??p.withBorder},d],...g,...f,__vars:{"--app-shell-aside-z-index":`calc(${l??p.zIndex} + 1)`}});let{children:_,dangerouslySetInnerHTML:v,...y}=f;return(0,O.jsxs)(n,{component:`aside`,mod:[{"with-border":c??p.withBorder},d],...g,...y,__vars:{"--app-shell-aside-z-index":`calc(${l??p.zIndex} + 1)`},id:m,children:[v?(0,O.jsx)(`div`,{style:{display:`contents`},dangerouslySetInnerHTML:v}):_,(0,O.jsx)(Ba,{section:`aside`,sectionId:m})]})});Ha.classes=Va,Ha.displayName=`@mantine/core/AppShellAside`;var Ua=g(e=>{let{classNames:t,className:r,style:i,styles:a,unstyled:o,vars:s,withBorder:c,zIndex:l,mod:d,...f}=u(`AppShellFooter`,null,e),p=Oa(),m=_e(f.id);if(p.disabled)return null;let h=p.resize?.footer.enabled??!1,g=p.getStyles(`footer`,{className:b({[Zt.classNames.zeroRight]:p.offsetScrollbars},r),classNames:t,styles:a,style:i});if(!h)return(0,O.jsx)(n,{component:`footer`,mod:[{"with-border":c??p.withBorder},d],...g,...f,__vars:{"--app-shell-footer-z-index":(l??p.zIndex)?.toString()}});let{children:_,dangerouslySetInnerHTML:v,...y}=f;return(0,O.jsxs)(n,{component:`footer`,mod:[{"with-border":c??p.withBorder},d],...g,...y,__vars:{"--app-shell-footer-z-index":(l??p.zIndex)?.toString()},id:m,children:[v?(0,O.jsx)(`div`,{style:{display:`contents`},dangerouslySetInnerHTML:v}):_,(0,O.jsx)(Ba,{section:`footer`,sectionId:m})]})});Ua.classes=Va,Ua.displayName=`@mantine/core/AppShellFooter`;var Wa=g(e=>{let{classNames:t,className:r,style:i,styles:a,unstyled:o,vars:s,withBorder:c,zIndex:l,mod:d,...f}=u(`AppShellHeader`,null,e),p=Oa(),m=_e(f.id);if(p.disabled)return null;let h=p.resize?.header.enabled??!1,g=p.getStyles(`header`,{className:b({[Zt.classNames.zeroRight]:p.offsetScrollbars},r),classNames:t,styles:a,style:i});if(!h)return(0,O.jsx)(n,{component:`header`,mod:[{"with-border":c??p.withBorder},d],...g,...f,__vars:{"--app-shell-header-z-index":(l??p.zIndex)?.toString()}});let{children:_,dangerouslySetInnerHTML:v,...y}=f;return(0,O.jsxs)(n,{component:`header`,mod:[{"with-border":c??p.withBorder},d],...g,...y,__vars:{"--app-shell-header-z-index":(l??p.zIndex)?.toString()},id:m,children:[v?(0,O.jsx)(`div`,{style:{display:`contents`},dangerouslySetInnerHTML:v}):_,(0,O.jsx)(Ba,{section:`header`,sectionId:m})]})});Wa.classes=Va,Wa.displayName=`@mantine/core/AppShellHeader`;var Ga=g(e=>{let{classNames:t,className:r,style:i,styles:a,vars:o,...s}=u(`AppShellMain`,null,e),c=Oa();return(0,O.jsx)(n,{component:`main`,...c.getStyles(`main`,{className:r,style:i,classNames:t,styles:a}),...s})});Ga.classes=Va,Ga.displayName=`@mantine/core/AppShellMain`;var Ka=g(e=>{let{classNames:t,className:r,style:i,styles:a,unstyled:o,vars:s,withBorder:c,zIndex:l,mod:d,...f}=u(`AppShellNavbar`,null,e),p=Oa(),m=_e(f.id);if(p.disabled)return null;let h=p.resize?.navbar.enabled??!1,g=p.getStyles(`navbar`,{className:r,classNames:t,styles:a,style:i});if(!h)return(0,O.jsx)(n,{component:`nav`,mod:[{"with-border":c??p.withBorder},d],...g,...f,__vars:{"--app-shell-navbar-z-index":`calc(${l??p.zIndex} + 1)`}});let{children:_,dangerouslySetInnerHTML:v,...y}=f;return(0,O.jsxs)(n,{component:`nav`,mod:[{"with-border":c??p.withBorder},d],...g,...y,__vars:{"--app-shell-navbar-z-index":`calc(${l??p.zIndex} + 1)`},id:m,children:[v?(0,O.jsx)(`div`,{style:{display:`contents`},dangerouslySetInnerHTML:v}):_,(0,O.jsx)(Ba,{section:`navbar`,sectionId:m})]})});Ka.classes=Va,Ka.displayName=`@mantine/core/AppShellNavbar`;var qa=be(e=>{let{classNames:t,className:r,style:i,styles:a,vars:o,grow:s,mod:c,...l}=u(`AppShellSection`,null,e),d=Oa();return(0,O.jsx)(n,{mod:[{grow:s},c],...d.getStyles(`section`,{className:r,style:i,classNames:t,styles:a}),...l})});qa.classes=Va,qa.displayName=`@mantine/core/AppShellSection`;function Ja(e){return typeof e==`object`?e.base:e}function Ya(e,t){return`min(${T(e)}, ${t===`horizontal`?`100vw`:`100dvh`})`}function Xa(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 Za(e){return!(typeof e!=`object`||!e||Object.keys(e).length===1&&`base`in e)}function Qa({baseStyles:e,minMediaStyles:t,maxMediaStyles:n,aside:r,theme:i,mode:a,resizedSize:o,resizable:s}){let c=r?.width,l=`translateX(var(--app-shell-aside-width))`,u=`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`),s&&(n[r.breakpoint][`--app-shell-aside-resize-handle-display`]=`none`)),o!==void 0){let t=Ya(o,`horizontal`);e[`--app-shell-aside-width`]=t,e[`--app-shell-aside-offset`]=t,a===`static`&&(e[`--app-shell-aside-grid-width`]=t)}else{if(Xa(c)){let t=T(Ja(c));e[`--app-shell-aside-width`]=t,e[`--app-shell-aside-offset`]=t}Za(c)&&(c.base!==void 0&&(e[`--app-shell-aside-width`]=T(c.base),e[`--app-shell-aside-offset`]=T(c.base)),de(c).forEach(e=>{e!==`base`&&(t[e]=t[e]||{},t[e][`--app-shell-aside-width`]=T(c[e]),t[e][`--app-shell-aside-offset`]=T(c[e]))}))}if(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`]=l,t[e][`--app-shell-aside-transform-rtl`]=u,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`,s&&(t[e][`--app-shell-aside-resize-handle-display`]=`none`)}if(r?.collapsed?.mobile){let e=mt(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`]=l,n[e][`--app-shell-aside-transform-rtl`]=u,n[e][`--app-shell-aside-scroll-locked-visibility`]=`hidden`,s&&(n[e][`--app-shell-aside-resize-handle-display`]=`none`)}}function $a({baseStyles:e,minMediaStyles:t,footer:n,mode:r,resizedSize:i,resizable:a}){let o=n?.height,s=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`),i!==void 0){let t=Ya(i,`vertical`);e[`--app-shell-footer-height`]=t,s&&(e[`--app-shell-footer-offset`]=t)}else{if(Xa(o)){let t=T(Ja(o));e[`--app-shell-footer-height`]=t,s&&(e[`--app-shell-footer-offset`]=t)}Za(o)&&(o.base!==void 0&&(e[`--app-shell-footer-height`]=T(o.base),s&&(e[`--app-shell-footer-offset`]=T(o.base))),de(o).forEach(e=>{e!==`base`&&(t[e]=t[e]||{},t[e][`--app-shell-footer-height`]=T(o[e]),s&&(t[e][`--app-shell-footer-offset`]=T(o[e])))}))}n?.collapsed&&(e[`--app-shell-footer-transform`]=`translateY(var(--app-shell-footer-height))`,r===`fixed`&&(e[`--app-shell-footer-offset`]=`0px !important`),a&&(e[`--app-shell-footer-resize-handle-display`]=`none`))}function eo({baseStyles:e,minMediaStyles:t,header:n,mode:r,resizedSize:i,resizable:a}){let o=n?.height,s=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`),i!==void 0){let t=Ya(i,`vertical`);e[`--app-shell-header-height`]=t,s&&(e[`--app-shell-header-offset`]=t)}else{if(Xa(o)){let t=T(Ja(o));e[`--app-shell-header-height`]=t,s&&(e[`--app-shell-header-offset`]=t)}Za(o)&&(o.base!==void 0&&(e[`--app-shell-header-height`]=T(o.base),s&&(e[`--app-shell-header-offset`]=T(o.base))),de(o).forEach(e=>{e!==`base`&&(t[e]=t[e]||{},t[e][`--app-shell-header-height`]=T(o[e]),s&&(t[e][`--app-shell-header-offset`]=T(o[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`),a&&(e[`--app-shell-header-resize-handle-display`]=`none`))}function to({baseStyles:e,minMediaStyles:t,maxMediaStyles:n,navbar:r,theme:i,mode:a,resizedSize:o,resizable:s}){let c=r?.width,l=`translateX(calc(var(--app-shell-navbar-width) * -1))`,u=`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`),s&&(n[r.breakpoint][`--app-shell-navbar-resize-handle-display`]=`none`)),o!==void 0){let t=Ya(o,`horizontal`);e[`--app-shell-navbar-width`]=t,e[`--app-shell-navbar-offset`]=t,a===`static`&&(e[`--app-shell-navbar-grid-width`]=t)}else{if(Xa(c)){let t=T(Ja(c));e[`--app-shell-navbar-width`]=t,e[`--app-shell-navbar-offset`]=t,a===`static`&&(e[`--app-shell-navbar-grid-width`]=t)}Za(c)&&(c.base!==void 0&&(e[`--app-shell-navbar-width`]=T(c.base),e[`--app-shell-navbar-offset`]=T(c.base),a===`static`&&(e[`--app-shell-navbar-grid-width`]=T(c.base))),de(c).forEach(e=>{e!==`base`&&(t[e]=t[e]||{},t[e][`--app-shell-navbar-width`]=T(c[e]),t[e][`--app-shell-navbar-offset`]=T(c[e]),a===`static`&&(t[e][`--app-shell-navbar-grid-width`]=T(c[e])))}))}if(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`]=l,t[e][`--app-shell-navbar-transform-rtl`]=u,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`),s&&(t[e][`--app-shell-navbar-resize-handle-display`]=`none`)}if(r?.collapsed?.mobile){let e=mt(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`]=l,n[e][`--app-shell-navbar-transform-rtl`]=u,s&&(n[e][`--app-shell-navbar-resize-handle-display`]=`none`)}}function no(e){return Number(e)===0?`0px`:ue(e)}function ro({padding:e,baseStyles:t,minMediaStyles:n}){Xa(e)&&(t[`--app-shell-padding`]=no(Ja(e))),Za(e)&&(e.base&&(t[`--app-shell-padding`]=no(e.base)),de(e).forEach(t=>{t!==`base`&&(n[t]=n[t]||{},n[t][`--app-shell-padding`]=no(e[t]))}))}function io({navbar:e,header:t,footer:n,aside:r,padding:i,theme:a,mode:o,resize:s}){let c={},l={},u={};o===`static`&&(u[`--app-shell-main-grid-column`]=`1 / -1`,u[`--app-shell-main-grid-row`]=`2`),to({baseStyles:u,minMediaStyles:c,maxMediaStyles:l,navbar:e,theme:a,mode:o,resizedSize:s?.sizes.navbar,resizable:s?.enabled.navbar}),Qa({baseStyles:u,minMediaStyles:c,maxMediaStyles:l,aside:r,theme:a,mode:o,resizedSize:s?.sizes.aside,resizable:s?.enabled.aside}),eo({baseStyles:u,minMediaStyles:c,header:t,mode:o,resizedSize:s?.sizes.header,resizable:s?.enabled.header}),$a({baseStyles:u,minMediaStyles:c,footer:n,mode:o,resizedSize:s?.sizes.footer,resizable:s?.enabled.footer}),ro({baseStyles:u,minMediaStyles:c,padding:i});let d=St(de(c),a.breakpoints).map(e=>({query:`(min-width: ${re(e.px)})`,styles:c[e.value]})),f=St(de(l),a.breakpoints).map(e=>({query:`(max-width: ${re(e.px)})`,styles:l[e.value]}));return{baseStyles:u,media:[...d,...f]}}function ao({navbar:e,header:t,aside:n,footer:r,padding:i,mode:a,selector:o,resize:s}){let c=f(),u=l(),{media:d,baseStyles:p}=io({navbar:e,header:t,footer:r,aside:n,padding:i,theme:c,mode:a,resize:s});return(0,O.jsx)(le,{media:d,styles:p,selector:o||u.cssVariablesSelector})}function oo(e){return e>=128||e===45||e===95||e>=48&&e<=57||e>=65&&e<=90||e>=97&&e<=122}function so(e){return e>=48&&e<=57}function co(e){let t=``;for(let n=0;n=1&&r<=31||r===127||n===0&&so(r)||n===1&&so(r)&&e.charCodeAt(0)===45?t+=`\\${r.toString(16)} `:n===0&&e.length===1&&r===45?t+=`\\${i}`:oo(r)?t+=i:t+=`\\${i}`}return t}function lo({transitionDuration:e,disabled:t,resizeKey:n}){let[r,i]=(0,D.useState)(!0),[a,o]=(0,D.useState)({key:n,active:!1}),s=(0,D.useRef)(-1),c=(0,D.useRef)(-1);return a.key!==n&&o({key:n,active:!0}),(0,D.useEffect)(()=>{if(!a.active)return;let t=window.setTimeout(()=>(0,D.startTransition)(()=>{o(e=>({...e,active:!1}))}),e||0);return()=>window.clearTimeout(t)},[a,e]),Qt(`resize`,()=>{i(!0),clearTimeout(s.current),s.current=window.setTimeout(()=>(0,D.startTransition)(()=>{i(!1)}),200)}),he(()=>{i(!0),clearTimeout(c.current),c.current=window.setTimeout(()=>(0,D.startTransition)(()=>{i(!1)}),e||0)},[t,e]),r||a.active}var uo={withBorder:!0,padding:0,transitionDuration:200,transitionTimingFunction:`ease`,zIndex:Ut(`app`),mode:`fixed`},fo=y((e,{transitionDuration:t,transitionTimingFunction:n})=>({root:{"--app-shell-transition-duration":`${t}ms`,"--app-shell-transition-timing-function":n,"--app-shell-resize-handle-size":void 0}})),po=g(t=>{let r=u(`AppShell`,uo,t),{classNames:i,className:a,style:o,styles:s,unstyled:c,vars:l,navbar:d,withBorder:f,padding:p,transitionDuration:m,transitionTimingFunction:h,header:g,zIndex:_,layout:v,disabled:y,aside:b,footer:ee,offsetScrollbars:x=!0,mode:S,mod:C,attributes:te,id:ne,resize:w,ref:re,...ae}=r,T=e({name:`AppShell`,classes:Va,props:r,className:a,style:o,classNames:i,styles:s,unstyled:c,attributes:te,vars:l,varsResolver:fo}),oe=lo({disabled:y,transitionDuration:m,resizeKey:w?Ma.map(e=>w.sizes[e]).join(`|`):void 0}),se=_e(ne),ce=(0,D.useRef)(null),le=w?{sizes:w.sizes,enabled:{navbar:w.navbar.enabled,aside:w.aside.enabled,header:w.header.enabled,footer:w.footer.enabled}}:void 0,ue={navbar:!0,aside:!0,header:S===`static`?!0:g?.offset??!0,footer:S===`static`?!0:ee?.offset??!0};return(0,O.jsxs)(Da,{value:{getStyles:T,withBorder:f,zIndex:_,disabled:y,offsetScrollbars:x,mode:S,resize:w,rootRef:ce,resizeOffsets:ue},children:[(0,O.jsx)(ao,{navbar:d,header:g,aside:b,footer:ee,padding:p,mode:S,resize:le,selector:w||S===`static`?`#${co(se)}`:void 0}),(0,O.jsx)(n,{...T(`root`),id:se,ref:ie(re,ce),mod:[{resizing:oe||w?.activeSection!=null,layout:v,disabled:y,mode:S},C],...ae})]})});po.classes=Va,po.varsResolver=fo,po.displayName=`@mantine/core/AppShell`,po.Navbar=Ka,po.Header=Wa,po.Main=Ga,po.Aside=Ha,po.Footer=Ua,po.Section=qa;var mo={group:`m_11def92b`,root:`m_f85678b6`,image:`m_11f8ac07`,placeholder:`m_104cd71f`},ho=(0,D.createContext)({withinGroup:!1}),go=y((e,{spacing:t})=>({group:{"--ag-spacing":ue(t)}})),_o=g(t=>{let r=u(`AvatarGroup`,null,t),{classNames:i,className:a,style:o,styles:s,unstyled:c,vars:l,spacing:d,attributes:f,...p}=r,m=e({name:`AvatarGroup`,classes:mo,props:r,className:a,style:o,classNames:i,styles:s,unstyled:c,attributes:f,vars:l,varsResolver:go,rootSelector:`group`});return(0,O.jsx)(ho,{value:{withinGroup:!0},children:(0,O.jsx)(n,{...m(`group`),...p})})});_o.classes=mo,_o.varsResolver=go,_o.displayName=`@mantine/core/AvatarGroup`;function vo(e){return(0,O.jsx)(`svg`,{...e,"data-avatar-placeholder-icon":!0,viewBox:`0 0 15 15`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,children:(0,O.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 yo(e){let t=0;for(let n=0;ne[0]).slice(0,t).join(``).toUpperCase()}var Co=y((e,{size:t,radius:n,variant:r,gradient:i,color:a,autoContrast:o,name:s,allowedInitialsColors:c})=>{let l=a===`initials`&&typeof s==`string`?xo(s,c):a,u=e.variantColorResolver({color:l||`gray`,theme:e,gradient:i,variant:r||`light`,autoContrast:o});return{root:{"--avatar-size":ne(t,`avatar-size`),"--avatar-radius":n===void 0?void 0:fe(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}}}),wo=be(t=>{let r=u(`Avatar`,null,t),{classNames:i,className:a,style:o,styles:s,unstyled:c,vars:l,src:d,alt:f,radius:p,color:m,gradient:h,imageProps:g,children:_,autoContrast:v,mod:y,name:b,allowedInitialsColors:ee,attributes:x,...S}=r,C=(0,D.use)(ho),[te,ne]=(0,D.useState)(!d),w=e({name:`Avatar`,props:r,classes:mo,className:a,style:o,classNames:i,styles:s,unstyled:c,attributes:x,vars:l,varsResolver:Co});return(0,D.useEffect)(()=>ne(!d),[d]),(0,O.jsx)(n,{...w(`root`),mod:[{"within-group":C.withinGroup},y],...S,children:te||!d?(0,O.jsx)(`span`,{...w(`placeholder`),title:f,children:_||typeof b==`string`&&So(b)||(0,O.jsx)(vo,{})}):(0,O.jsx)(`img`,{...g,...w(`image`),src:d,alt:f,onError:e=>{ne(!0),g?.onError?.(e)}})})});wo.classes=mo,wo.varsResolver=Co,wo.displayName=`@mantine/core/Avatar`,wo.Group=_o;var To={root:`m_fea6bf1a`,burger:`m_d4fb9cad`},Eo=y((e,{color:t,size:n,lineSize:r,transitionDuration:i,transitionTimingFunction:a})=>({root:{"--burger-color":t?c(t,e):void 0,"--burger-size":ne(n,`burger-size`),"--burger-line-size":r?T(r):void 0,"--burger-transition-duration":i===void 0?void 0:`${i}ms`,"--burger-transition-timing-function":a}})),Do=g(t=>{let r=u(`Burger`,null,t),{classNames:i,className:a,style:o,styles:s,unstyled:c,vars:l,opened:d,children:f,transitionDuration:p,transitionTimingFunction:h,lineSize:g,attributes:_,...v}=r,y=e({name:`Burger`,classes:To,props:r,className:a,style:o,classNames:i,styles:s,unstyled:c,attributes:_,vars:l,varsResolver:Eo});return(0,O.jsxs)(m,{...y(`root`),...v,children:[(0,O.jsx)(n,{mod:[`reduce-motion`,{opened:d}],...y(`burger`)}),f]})});Do.classes=To,Do.varsResolver=Eo,Do.displayName=`@mantine/core/Burger`;var Oo=[];for(let e=0;e<256;++e)Oo.push((e+256).toString(16).slice(1));function ko(e,t=0){return(Oo[e[t+0]]+Oo[e[t+1]]+Oo[e[t+2]]+Oo[e[t+3]]+`-`+Oo[e[t+4]]+Oo[e[t+5]]+`-`+Oo[e[t+6]]+Oo[e[t+7]]+`-`+Oo[e[t+8]]+Oo[e[t+9]]+`-`+Oo[e[t+10]]+Oo[e[t+11]]+Oo[e[t+12]]+Oo[e[t+13]]+Oo[e[t+14]]+Oo[e[t+15]]).toLowerCase()}var Ao,jo=new Uint8Array(16);function Mo(){if(!Ao){if(typeof crypto>`u`||!crypto.getRandomValues)throw Error(`crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported`);Ao=crypto.getRandomValues.bind(crypto)}return Ao(jo)}var No={randomUUID:typeof crypto<`u`&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function Po(e,t,n){if(No.randomUUID&&!t&&!e)return No.randomUUID();e||={};let r=e.random??e.rng?.()??Mo();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 ko(r)}var Fo=wn(),A=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.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}({}),Io={TextMessageStartEvent:{optional:[`timestamp`,`rawEvent`,`metadata`,`subagentRunId`,`role`,`name`],fields:{}},TextMessageContentEvent:{optional:[`timestamp`,`rawEvent`,`metadata`,`subagentRunId`],fields:{}},TextMessageEndEvent:{optional:[`timestamp`,`rawEvent`,`metadata`,`subagentRunId`],fields:{}},TextMessageChunkEvent:{optional:[`timestamp`,`rawEvent`,`metadata`,`subagentRunId`,`messageId`,`role`,`delta`,`name`],fields:{}},ToolCallStartEvent:{optional:[`timestamp`,`rawEvent`,`metadata`,`subagentRunId`,`parentMessageId`],fields:{}},ToolCallArgsEvent:{optional:[`timestamp`,`rawEvent`,`metadata`,`subagentRunId`],fields:{}},ToolCallEndEvent:{optional:[`timestamp`,`rawEvent`,`metadata`,`subagentRunId`],fields:{}},ToolCallChunkEvent:{optional:[`timestamp`,`rawEvent`,`metadata`,`subagentRunId`,`toolCallId`,`toolCallName`,`parentMessageId`,`delta`],fields:{}},TextPart:{optional:[`id`,`metadata`],fields:{}},DataSource:{optional:[],fields:{}},UrlSource:{optional:[`mimeType`],fields:{}},FileSource:{optional:[`provider`,`mimeType`],fields:{}},PartSource:{discriminator:`type`,variants:{data:`DataSource`,url:`UrlSource`,file:`FileSource`}},ImagePart:{optional:[`id`,`metadata`],fields:{source:`PartSource`}},AudioPart:{optional:[`id`,`metadata`],fields:{source:`PartSource`}},VideoPart:{optional:[`id`,`metadata`],fields:{source:`PartSource`}},DocumentPart:{optional:[`id`,`metadata`],fields:{source:`PartSource`}},ContentPart:{discriminator:`type`,variants:{text:`TextPart`,image:`ImagePart`,audio:`AudioPart`,video:`VideoPart`,document:`DocumentPart`}},ToolCallResultEvent:{optional:[`timestamp`,`rawEvent`,`metadata`,`subagentRunId`,`role`],fields:{content:{array:`ContentPart`}}},StateSnapshotEvent:{optional:[`timestamp`,`rawEvent`,`metadata`,`subagentRunId`],fields:{}},AddOperation:{optional:[],fields:{}},RemoveOperation:{optional:[],fields:{}},ReplaceOperation:{optional:[],fields:{}},MoveOperation:{optional:[],fields:{}},CopyOperation:{optional:[],fields:{}},TestOperation:{optional:[],fields:{}},JsonPatchOperation:{discriminator:`op`,variants:{add:`AddOperation`,remove:`RemoveOperation`,replace:`ReplaceOperation`,move:`MoveOperation`,copy:`CopyOperation`,test:`TestOperation`}},StateDeltaEvent:{optional:[`timestamp`,`rawEvent`,`metadata`,`subagentRunId`],fields:{delta:{array:`JsonPatchOperation`}}},DeveloperMessage:{optional:[`subagentRunId`,`name`,`encryptedValue`,`metadata`],fields:{}},SystemMessage:{optional:[`subagentRunId`,`name`,`encryptedValue`,`metadata`],fields:{}},FunctionCall:{optional:[],fields:{}},ToolCall:{optional:[`encryptedValue`,`metadata`],fields:{function:`FunctionCall`}},AssistantMessage:{optional:[`subagentRunId`,`name`,`encryptedValue`,`metadata`,`content`,`toolCalls`],fields:{toolCalls:{array:`ToolCall`}}},UserMessage:{optional:[`subagentRunId`,`name`,`encryptedValue`,`metadata`],fields:{content:{array:`ContentPart`}}},ToolMessage:{optional:[`subagentRunId`,`error`,`encryptedValue`,`metadata`],fields:{content:{array:`ContentPart`}}},ActivityMessage:{optional:[`subagentRunId`,`metadata`],fields:{}},ReasoningMessage:{optional:[`subagentRunId`,`encryptedValue`,`metadata`],fields:{}},Message:{discriminator:`role`,variants:{developer:`DeveloperMessage`,system:`SystemMessage`,assistant:`AssistantMessage`,user:`UserMessage`,tool:`ToolMessage`,activity:`ActivityMessage`,reasoning:`ReasoningMessage`}},MessagesSnapshotEvent:{optional:[`timestamp`,`rawEvent`,`metadata`],fields:{messages:{array:`Message`}}},ActivitySnapshotEvent:{optional:[`timestamp`,`rawEvent`,`metadata`,`subagentRunId`,`replace`],fields:{}},ActivityDeltaEvent:{optional:[`timestamp`,`rawEvent`,`metadata`,`subagentRunId`],fields:{patch:{array:`JsonPatchOperation`}}},RawEvent:{optional:[`timestamp`,`rawEvent`,`metadata`,`subagentRunId`,`source`],fields:{}},CustomEvent:{optional:[`timestamp`,`rawEvent`,`metadata`,`subagentRunId`],fields:{}},Tool:{optional:[`parameters`,`metadata`],fields:{}},Context:{optional:[],fields:{}},ResumeEntry:{optional:[`payload`,`metadata`],fields:{}},RunAgentInput:{optional:[`protocolVersion`,`parentRunId`,`state`,`tools`,`context`,`forwardedProps`,`resume`],fields:{messages:{array:`Message`},tools:{array:`Tool`},context:{array:`Context`},resume:{array:`ResumeEntry`}}},RunStartedEvent:{optional:[`timestamp`,`rawEvent`,`metadata`,`protocolVersion`,`parentRunId`,`input`],fields:{input:`RunAgentInput`}},RunFinishedSuccessOutcome:{optional:[`pendingToolCallIds`],fields:{}},Interrupt:{optional:[`subagentRunId`,`message`,`toolCallId`,`responseSchema`,`expiresAt`,`metadata`],fields:{}},RunFinishedInterruptOutcome:{optional:[],fields:{interrupts:{array:`Interrupt`}}},RunFinishedCancelledOutcome:{optional:[],fields:{}},RunFinishedOutcome:{discriminator:`type`,variants:{success:`RunFinishedSuccessOutcome`,interrupt:`RunFinishedInterruptOutcome`,cancelled:`RunFinishedCancelledOutcome`}},TokenUsage:{optional:[`provider`,`model`,`inputTokens`,`outputTokens`,`totalTokens`,`reasoningTokens`,`cachedInputTokens`,`cacheWriteInputTokens`],fields:{}},RunFinishedEvent:{optional:[`timestamp`,`rawEvent`,`metadata`,`result`,`outcome`,`usage`],fields:{outcome:`RunFinishedOutcome`,usage:{array:`TokenUsage`}}},RunErrorEvent:{optional:[`timestamp`,`rawEvent`,`metadata`,`code`,`usage`],fields:{usage:{array:`TokenUsage`}}},StepStartedEvent:{optional:[`timestamp`,`rawEvent`,`metadata`,`subagentRunId`],fields:{}},StepFinishedEvent:{optional:[`timestamp`,`rawEvent`,`metadata`,`subagentRunId`],fields:{}},ReasoningStartEvent:{optional:[`timestamp`,`rawEvent`,`metadata`,`subagentRunId`],fields:{}},ReasoningMessageStartEvent:{optional:[`timestamp`,`rawEvent`,`metadata`,`subagentRunId`],fields:{}},ReasoningMessageContentEvent:{optional:[`timestamp`,`rawEvent`,`metadata`,`subagentRunId`],fields:{}},ReasoningMessageEndEvent:{optional:[`timestamp`,`rawEvent`,`metadata`,`subagentRunId`],fields:{}},ReasoningMessageChunkEvent:{optional:[`timestamp`,`rawEvent`,`metadata`,`subagentRunId`,`messageId`,`delta`],fields:{}},ReasoningEndEvent:{optional:[`timestamp`,`rawEvent`,`metadata`,`subagentRunId`],fields:{}},ReasoningEncryptedValueEvent:{optional:[`timestamp`,`rawEvent`,`metadata`,`subagentRunId`],fields:{}},SubagentStartedEvent:{optional:[`timestamp`,`rawEvent`,`metadata`,`description`,`parentSubagentRunId`,`parentToolCallId`,`parentMessageId`],fields:{}},SubagentFinishedSuccessOutcome:{optional:[],fields:{}},SubagentFinishedSuspendedOutcome:{optional:[`interruptIds`],fields:{}},SubagentFinishedOutcome:{discriminator:`type`,variants:{success:`SubagentFinishedSuccessOutcome`,suspended:`SubagentFinishedSuspendedOutcome`}},SubagentFinishedEvent:{optional:[`timestamp`,`rawEvent`,`metadata`,`result`,`outcome`],fields:{outcome:`SubagentFinishedOutcome`}},SubagentErrorEvent:{optional:[`timestamp`,`rawEvent`,`metadata`,`code`],fields:{}},Event:{discriminator:`type`,variants:{TEXT_MESSAGE_START:`TextMessageStartEvent`,TEXT_MESSAGE_CONTENT:`TextMessageContentEvent`,TEXT_MESSAGE_END:`TextMessageEndEvent`,TEXT_MESSAGE_CHUNK:`TextMessageChunkEvent`,TOOL_CALL_START:`ToolCallStartEvent`,TOOL_CALL_ARGS:`ToolCallArgsEvent`,TOOL_CALL_END:`ToolCallEndEvent`,TOOL_CALL_CHUNK:`ToolCallChunkEvent`,TOOL_CALL_RESULT:`ToolCallResultEvent`,STATE_SNAPSHOT:`StateSnapshotEvent`,STATE_DELTA:`StateDeltaEvent`,MESSAGES_SNAPSHOT:`MessagesSnapshotEvent`,ACTIVITY_SNAPSHOT:`ActivitySnapshotEvent`,ACTIVITY_DELTA:`ActivityDeltaEvent`,RAW:`RawEvent`,CUSTOM:`CustomEvent`,RUN_STARTED:`RunStartedEvent`,RUN_FINISHED:`RunFinishedEvent`,RUN_ERROR:`RunErrorEvent`,STEP_STARTED:`StepStartedEvent`,STEP_FINISHED:`StepFinishedEvent`,REASONING_START:`ReasoningStartEvent`,REASONING_MESSAGE_START:`ReasoningMessageStartEvent`,REASONING_MESSAGE_CONTENT:`ReasoningMessageContentEvent`,REASONING_MESSAGE_END:`ReasoningMessageEndEvent`,REASONING_MESSAGE_CHUNK:`ReasoningMessageChunkEvent`,REASONING_END:`ReasoningEndEvent`,REASONING_ENCRYPTED_VALUE:`ReasoningEncryptedValueEvent`,SUBAGENT_STARTED:`SubagentStartedEvent`,SUBAGENT_FINISHED:`SubagentFinishedEvent`,SUBAGENT_ERROR:`SubagentErrorEvent`}},SubagentInfo:{optional:[`description`],fields:{}},IdentityCapabilities:{optional:[`name`,`type`,`description`,`version`,`provider`,`documentationUrl`,`metadata`],fields:{}},TransportCapabilities:{optional:[`streaming`,`websocket`,`httpBinary`,`pushNotifications`,`resumable`],fields:{}},ToolsCapabilities:{optional:[`supported`,`items`,`parallelCalls`,`clientProvided`],fields:{items:{array:`Tool`}}},OutputCapabilities:{optional:[`structuredOutput`,`supportedMimeTypes`],fields:{}},StateCapabilities:{optional:[`snapshots`,`deltas`,`memory`,`persistentState`],fields:{}},MultiAgentCapabilities:{optional:[`supported`,`delegation`,`handoffs`,`subagents`],fields:{subagents:{array:`SubagentInfo`}}},ReasoningCapabilities:{optional:[`supported`,`streaming`,`encrypted`],fields:{}},MultimodalInputCapabilities:{optional:[`image`,`audio`,`video`,`pdf`,`file`],fields:{}},MultimodalOutputCapabilities:{optional:[`image`,`audio`],fields:{}},MultimodalCapabilities:{optional:[`input`,`output`],fields:{input:`MultimodalInputCapabilities`,output:`MultimodalOutputCapabilities`}},ExecutionCapabilities:{optional:[`codeExecution`,`sandboxed`,`maxIterations`,`maxExecutionTime`],fields:{}},HumanInTheLoopCapabilities:{optional:[`supported`,`approvals`,`interventions`,`feedback`,`interrupts`,`approveWithEdits`],fields:{}},AgentCapabilities:{optional:[`identity`,`transport`,`tools`,`output`,`state`,`multiAgent`,`reasoning`,`multimodal`,`execution`,`humanInTheLoop`,`custom`],fields:{identity:`IdentityCapabilities`,transport:`TransportCapabilities`,tools:`ToolsCapabilities`,output:`OutputCapabilities`,state:`StateCapabilities`,multiAgent:`MultiAgentCapabilities`,reasoning:`ReasoningCapabilities`,multimodal:`MultimodalCapabilities`,execution:`ExecutionCapabilities`,humanInTheLoop:`HumanInTheLoopCapabilities`}}};function Lo(e,t){if(typeof t==`string`)return Lo(e,Io[t]);if(`array`in t){if(!Array.isArray(e))return e;let n=e.map(e=>Lo(e,t.array));return n.every((t,n)=>t===e[n])?e:n}if(typeof e!=`object`||!e||Array.isArray(e))return e;let n=e;if(`discriminator`in t){let r=n[t.discriminator];return typeof r==`string`&&Object.prototype.hasOwnProperty.call(t.variants,r)?Lo(e,t.variants[r]):e}let r=n;for(let e of t.optional)Object.prototype.hasOwnProperty.call(n,e)&&n[e]===null&&(r===n&&(r={...n}),delete r[e]);for(let[e,i]of Object.entries(t.fields)){if(!Object.prototype.hasOwnProperty.call(r,e))continue;let t=Lo(r[e],i);t!==r[e]&&(r===n&&(r={...n}),r[e]=t)}return r}function Ro(e,t){return Lo(e,t)}var j=class extends Error{constructor(e){super(e)}},zo=class extends j{constructor(){super(`Connect not implemented. This method is not supported by the current agent.`)}};function Bo(e,t){return t===void 0?e:e===void 0?{...t}:{...e,...t}}function Vo(e){return e===void 0?``:typeof e==`string`?e:e.filter(e=>e.type===`text`).map(e=>e.text).join(``)}function Ho(e){return Array.isArray(e)&&e.some(e=>e.type!==`text`)}var Uo=(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)}})(),Wo=Object.prototype.hasOwnProperty;function Go(e,t){return Wo.call(e,t)}function Ko(e){if(Array.isArray(e)){for(var t=Array(e.length),n=0;n=48&&r<=57){t++;continue}return!1}return!0}function Yo(e){return e.indexOf(`/`)===-1&&e.indexOf(`~`)===-1?e:e.replace(/~/g,`~0`).replace(/\//g,`~1`)}function Xo(e){return e.replace(/~1/g,`/`).replace(/~0/g,`~`)}function Zo(e){if(e===void 0)return!0;if(e){if(Array.isArray(e)){for(var t=0,n=e.length;tes,_areEquals:()=>us,applyOperation:()=>as,applyPatch:()=>os,applyReducer:()=>ss,deepClone:()=>ts,getValueByPointer:()=>is,validate:()=>ls,validator:()=>cs}),es=Qo,ts=qo,ns={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=is(n,this.path);r&&=qo(r);var i=as(n,{op:`remove`,path:this.from}).removed;return as(n,{op:`add`,path:this.path,value:i}),{newDocument:n,removed:r}},copy:function(e,t,n){var r=is(n,this.from);return as(n,{op:`add`,path:this.path,value:qo(r)}),{newDocument:n}},test:function(e,t,n){return{newDocument:n,test:us(e[t],this.value)}},_get:function(e,t,n){return this.value=e[t],{newDocument:n}}},rs={add:function(e,t,n){return Jo(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:ns.move,copy:ns.copy,test:ns.test,_get:ns._get};function is(e,t){if(t==``)return e;var n={op:`_get`,path:t};return as(e,n),n.value}function as(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):cs(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=is(e,t.from),t.op===`move`&&(o.removed=e),o;if(t.op===`test`){if(o.test=us(e,t.value),o.test===!1)throw new es(`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 es("Operation `op` property is not one of operations defined in RFC-6902",`OPERATION_OP_INVALID`,a,t,e);return o}r||(e=qo(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:cs;;){if(f=s[l],f&&f.indexOf(`~`)!=-1&&(f=Xo(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&&!Jo(f))throw new es(`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 Jo(f)&&(f=~~f);if(l>=u){if(n&&t.op===`add`&&f>c.length)throw new es(`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=rs[t.op].call(t,c,f,e);if(o.test===!1)throw new es(`Test operation failed`,`TEST_OPERATION_FAILED`,a,t,e);return o}}else if(l>=u){var o=ns[t.op].call(t,c,f,e);if(o.test===!1)throw new es(`Test operation failed`,`TEST_OPERATION_FAILED`,a,t,e);return o}if(c=c[f],n&&l0)throw new es('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 es("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 es("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`)&&Zo(e.value))throw new es("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 es("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 es(`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=ls([{op:`_get`,path:e.from,value:void 0}],n);if(o&&o.name===`OPERATION_PATH_UNRESOLVABLE`)throw new es(`Cannot perform the operation from a path that does not exist`,`OPERATION_FROM_UNRESOLVABLE`,t,e,n)}}}function ls(e,t,n){try{if(!Array.isArray(e))throw new es(`Patch sequence must be an array`,`SEQUENCE_NOT_AN_ARRAY`);if(t)os(qo(t),qo(e),n||!0);else{n||=cs;for(var r=0;rSs,generate:()=>bs,observe:()=>ys,unobserve:()=>vs}),fs=new WeakMap,ps=function(){function e(e){this.observers=new Map,this.obj=e}return e}(),ms=function(){function e(e,t){this.callback=e,this.observer=t}return e}();function hs(e){return fs.get(e)}function gs(e,t){return e.observers.get(t)}function _s(e,t){e.observers.delete(t.callback)}function vs(e,t){t.unobserve()}function ys(e,t){var n=[],r,i=hs(e);if(!i)i=new ps(e),fs.set(e,i);else{var a=gs(i,t);r=a&&a.observer}if(r)return r;if(r={},i.value=qo(e),t){r.callback=t,r.next=null;var o=function(){bs(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(){bs(r),clearTimeout(r.next),_s(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 ms(t,r)),r}function bs(e,t){t===void 0&&(t=!1);var n=fs.get(e.object);xs(n.value,e.object,e.patches,``,t),e.patches.length&&os(n.value,e.patches);var r=e.patches;return r.length>0&&(e.patches=[],e.callback&&e.callback(r)),r}function xs(e,t,n,r,i){if(t!==e){typeof t.toJSON==`function`&&(t=t.toJSON());for(var a=Ko(t),o=Ko(e),s=!1,c=o.length-1;c>=0;c--){var l=o[c],u=e[l];if(Go(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)?xs(u,d,n,r+`/`+Yo(l),i):u!==d&&(i&&n.push({op:`test`,path:r+`/`+Yo(l),value:qo(u)}),n.push({op:`replace`,path:r+`/`+Yo(l),value:qo(d)}))}else Array.isArray(e)===Array.isArray(t)?(i&&n.push({op:`test`,path:r+`/`+Yo(l),value:qo(u)}),n.push({op:`remove`,path:r+`/`+Yo(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 ks(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 As(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 js?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 Ns(e){if(!Symbol.asyncIterator)throw TypeError(`Symbol.asyncIterator is not defined.`);var t=e[Symbol.asyncIterator],n;return t?t.call(e):(e=typeof Os==`function`?Os(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 Ps(e){return typeof e==`function`}function Fs(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 Is=Fs(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 Ls(e,t){if(e){var n=e.indexOf(t);0<=n&&e.splice(n,1)}}var Rs=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=Os(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(Ps(c))try{c()}catch(e){i=e instanceof Is?e.errors:[e]}var l=this._finalizers;if(l){this._finalizers=null;try{for(var u=Os(l),d=u.next();!d.done;d=u.next()){var f=d.value;try{Vs(f)}catch(e){i??=[],e instanceof Is?i=As(As([],ks(i)),ks(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 Is(i)}},e.prototype.add=function(t){if(t&&t!==this){if(this.closed)Vs(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)&&Ls(t,e)},e.prototype.remove=function(t){var n=this._finalizers;n&&Ls(n,t),t instanceof e&&t._removeParent(this)},e.EMPTY=(function(){var t=new e;return t.closed=!0,t})(),e}(),zs=Rs.EMPTY;function Bs(e){return e instanceof Rs||e&&`closed`in e&&Ps(e.remove)&&Ps(e.add)&&Ps(e.unsubscribe)}function Vs(e){Ps(e)?e():e.unsubscribe()}var Hs={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1},Us={setTimeout:function(e,t){var n=[...arguments].slice(2),r=Us.delegate;return r?.setTimeout?r.setTimeout.apply(r,As([e,t],ks(n))):setTimeout.apply(void 0,As([e,t],ks(n)))},clearTimeout:function(e){return(Us.delegate?.clearTimeout||clearTimeout)(e)},delegate:void 0};function Ws(e){Us.setTimeout(function(){var t=Hs.onUnhandledError;if(t)t(e);else throw e})}function Gs(){}var Ks=(function(){return Ys(`C`,void 0,void 0)})();function qs(e){return Ys(`E`,void 0,e)}function Js(e){return Ys(`N`,e,void 0)}function Ys(e,t,n){return{kind:e,value:t,error:n}}var Xs=null;function Zs(e){if(Hs.useDeprecatedSynchronousErrorHandling){var t=!Xs;if(t&&(Xs={errorThrown:!1,error:null}),e(),t){var n=Xs,r=n.errorThrown,i=n.error;if(Xs=null,r)throw i}}else e()}function Qs(e){Hs.useDeprecatedSynchronousErrorHandling&&Xs&&(Xs.errorThrown=!0,Xs.error=e)}var $s=function(e){Ts(t,e);function t(t){var n=e.call(this)||this;return n.isStopped=!1,t?(n.destination=t,Bs(t)&&t.add(n)):n.destination=sc,n}return t.create=function(e,t,n){return new rc(e,t,n)},t.prototype.next=function(e){this.isStopped?oc(Js(e),this):this._next(e)},t.prototype.error=function(e){this.isStopped?oc(qs(e),this):(this.isStopped=!0,this._error(e))},t.prototype.complete=function(){this.isStopped?oc(Ks,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}(Rs),ec=Function.prototype.bind;function tc(e,t){return ec.call(e,t)}var nc=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){ic(e)}},e.prototype.error=function(e){var t=this.partialObserver;if(t.error)try{t.error(e)}catch(e){ic(e)}else ic(e)},e.prototype.complete=function(){var e=this.partialObserver;if(e.complete)try{e.complete()}catch(e){ic(e)}},e}(),rc=function(e){Ts(t,e);function t(t,n,r){var i=e.call(this)||this,a;if(Ps(t)||!t)a={next:t??void 0,error:n??void 0,complete:r??void 0};else{var o;i&&Hs.useDeprecatedNextContext?(o=Object.create(t),o.unsubscribe=function(){return i.unsubscribe()},a={next:t.next&&tc(t.next,o),error:t.error&&tc(t.error,o),complete:t.complete&&tc(t.complete,o)}):a=t}return i.destination=new nc(a),i}return t}($s);function ic(e){Hs.useDeprecatedSynchronousErrorHandling?Qs(e):Ws(e)}function ac(e){throw e}function oc(e,t){var n=Hs.onStoppedNotification;n&&Us.setTimeout(function(){return n(e,t)})}var sc={closed:!0,next:Gs,error:ac,complete:Gs},cc=(function(){return typeof Symbol==`function`&&Symbol.observable||`@@observable`})();function lc(e){return e}function uc(){return dc([...arguments])}function dc(e){return e.length===0?lc:e.length===1?e[0]:function(t){return e.reduce(function(e,t){return t(e)},t)}}var fc=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=hc(e)?e:new rc(e,t,n);return Zs(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=pc(t),new t(function(t,r){var i=new rc({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[cc]=function(){return this},e.prototype.pipe=function(){return dc([...arguments])(this)},e.prototype.toPromise=function(e){var t=this;return e=pc(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 pc(e){return e??Hs.Promise??Promise}function mc(e){return e&&Ps(e.next)&&Ps(e.error)&&Ps(e.complete)}function hc(e){return e&&e instanceof $s||mc(e)&&Bs(e)}function gc(e){return Ps(e?.lift)}function _c(e){return function(t){if(gc(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 vc(e,t,n,r,i){return new yc(e,t,n,r,i)}var yc=function(e){Ts(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}($s),bc=Fs(function(e){return function(){e(this),this.name=`ObjectUnsubscribedError`,this.message=`object unsubscribed`}}),xc=function(e){Ts(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 Sc(this,this);return t.operator=e,t},t.prototype._throwIfClosed=function(){if(this.closed)throw new bc},t.prototype.next=function(e){var t=this;Zs(function(){var n,r;if(t._throwIfClosed(),!t.isStopped){t.currentObservers||=Array.from(t.observers);try{for(var i=Os(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;Zs(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;Zs(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?zs:(this.currentObservers=null,a.push(e),new Rs(function(){t.currentObservers=null,Ls(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 fc;return e.source=this,e},t.create=function(e,t){return new Sc(e,t)},t}(fc),Sc=function(e){Ts(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)??zs},t}(xc),Cc={now:function(){return(Cc.delegate||Date).now()},delegate:void 0},wc=function(e){Ts(t,e);function t(t,n,r){t===void 0&&(t=1/0),n===void 0&&(n=1/0),r===void 0&&(r=Cc);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 wl(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():Cl(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`:Cl(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 Tl(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 El(e,t=`|`){return e.map(e=>$l(e)).join(t)}function Dl(e,t){return typeof t==`bigint`?t.toString():t}var Ol=class{constructor(e){this._getter=e,this._value=void 0}get value(){let e=this._getter;return e!==void 0&&(this._value=e(),this._getter=void 0),this._value}};function kl(e){return new Ol(e)}function Al(e){return e==null}function jl(e){let t=+!!e.startsWith(`^`),n=e.endsWith(`$`)?e.length-1:e.length;return e.slice(t,n)}function Ml(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){let e=t._zod.def.shape[a];return r?r(e,a):e}):zl(e,a,r?r(n.value,a):n.value))}}function Vl(e,t){for(let n of Reflect.ownKeys(t)){let r=Object.getOwnPropertyDescriptor(t,n);r.enumerable&&(r.get?Rl(e,n,()=>t[n]):zl(e,n,r.value))}}function Hl(...e){let t={};for(let n of e){let e=Object.getOwnPropertyDescriptors(n);Object.assign(t,e)}return Object.defineProperties({},t)}function Ul(e){return JSON.stringify(e)}function Wl(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,``).replace(/[\s_-]+/g,`-`).replace(/^-+|-+$/g,``)}var Gl=`captureStackTrace`in Error?Error.captureStackTrace:(...e)=>{};function Kl(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}var ql=kl(()=>{if(Vu.jitless||typeof navigator<`u`&&navigator?.userAgent?.includes(`Cloudflare`))return!1;try{return Function(``),!0}catch{return!1}});function Jl(e){if(Kl(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!=`function`)return!0;let n=t.prototype;return Kl(n)!==!1&&Object.prototype.hasOwnProperty.call(n,`isPrototypeOf`)!==!1}function Yl(e){return Jl(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}var Xl=new Set([`string`,`number`,`symbol`]);function Zl(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}function Ql(e,t,n){let r=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(r._zod.parent=e),r}function P(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 $l(e){return typeof e==`bigint`?e.toString()+`n`:typeof e==`string`?`"${e}"`:`${e}`}function eu(e){return Object.keys(e).filter(t=>e[t]._zod.optin!==void 0&&e[t]._zod.optout===`optional`)}var tu={safeint:[-(2**53-1),2**53-1],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},nu={int64:[BigInt(`-9223372036854775808`),BigInt(`9223372036854775807`)],uint64:[BigInt(0),BigInt(`18446744073709551615`)]};function ru(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`);let i={};return Bl(i,e,iu(e,t)),Ql(e,Hl(n,{shape:i,checks:[]}))}function iu(e,t){let n=Ll(e),r=[];for(let e of Reflect.ownKeys(t)){if(!Object.getOwnPropertyDescriptor(n,e)?.enumerable)throw Error(`Unrecognized key: "${String(e)}"`);t[e]&&r.push(e)}return r}function au(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`);let i=new Set(iu(e,t)),a={};return Bl(a,e,Reflect.ownKeys(Ll(e)).filter(e=>!i.has(e))),Ql(e,Hl(n,{shape:a,checks:[]}))}function ou(e,t){if(!Jl(t))throw Error(`Invalid input to extend: expected a plain object`);let n=e._zod.def.checks;if(n&&n.length>0){let n=Ll(e);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 Ql(e,Hl(e._zod.def,{shape:su(e,t)}))}function su(e,t){let n={};return Bl(n,e,Reflect.ownKeys(Ll(e))),Vl(n,t),n}function cu(e,t){if(!Jl(t))throw Error(`Invalid input to safeExtend: expected a plain object`);return Ql(e,Hl(e._zod.def,{shape:su(e,t)}))}function lu(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.`);let n={};return Bl(n,e,Reflect.ownKeys(Ll(e))),Bl(n,t,Reflect.ownKeys(Ll(t))),Ql(e,Hl(e._zod.def,{shape:n,get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]}))}function uu(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`);let a=n?new Set(iu(t,n)):void 0,o={};return Bl(o,t,Reflect.ownKeys(Ll(t)),e&&((t,n)=>a&&!a.has(n)?t:new e({type:`optional`,innerType:t}))),Ql(t,Hl(t._zod.def,{shape:o,checks:[]}))}function du(e,t,n){let r=n?new Set(iu(t,n)):void 0,i={};return Bl(i,t,Reflect.ownKeys(Ll(t)),(t,n)=>r&&!r.has(n)?t:new e({type:`nonoptional`,innerType:t})),Ql(t,Hl(t._zod.def,{shape:i}))}function fu(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 F(e){return typeof e==`string`?e:e?.message}function hu(e,t,n){var r;for(let i=t;ie;return t[Mu]=!0,t}var Pu,Fu=Object.freeze({status:`aborted`}),Iu={value:void 0,enumerable:!1},Lu=`captureStackTrace`in Error?Error:null;function Ru(e){let t=Lu;if(t){let n=t.stackTraceLimit;if(typeof n==`number`){try{t.stackTraceLimit=0}catch{return Lu=null,new e}try{return new e}finally{t.stackTraceLimit=n}}}return new e}function L(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){Iu.value=new a(r);try{Object.defineProperty(n,"_zod",Iu)}finally{Iu.value=void 0}}else 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),Su(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?Ru(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 zu=class extends Error{constructor(){super(`Encountered Promise during synchronous parse. Use .parseAsync() instead.`)}},Bu=class extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name=`ZodEncodeError`}};(Pu=globalThis).__zod_globalConfig??(Pu.__zod_globalConfig={});var Vu=globalThis.__zod_globalConfig;function Hu(e){return e&&Object.assign(Vu,e),Vu}function Uu(){let e=this._zod;return e.message??=JSON.stringify(e.def,Dl,2),e.message}function Wu(e){this._zod.message=e}var Gu={get:Uu,set:Wu,enumerable:!0,configurable:!0},Ku={value:void 0,enumerable:!1},qu=new WeakSet([Object.prototype,Error.prototype]),Ju=(e,t)=>{e.name=`$ZodError`,Ku.value=t,Object.defineProperty(e,"issues",Ku),Ku.value=void 0,Object.defineProperty(e,"message",Gu);let n=Object.getPrototypeOf(e);qu.has(n)||(qu.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})}}))},Yu=L(`$ZodError`,Ju);L(`$ZodError`,Ju,void 0,{Parent:Error});function Xu(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 Zu(e,t=e=>e.message){let n={},r=[];for(let i of e.issues)i.path.length>0?Xu(n,i.path[0],()=>[]).push(t(i)):r.push(t(i));return{formErrors:r,fieldErrors:n}}function Qu(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 zu;if(s.issues.length){let n=new((a?.Err)??e)(s.issues.map(e=>gu(e,o,Hu())));throw Gl(n,a?.callee??t),n}return s.value};return t},td=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=>gu(e,o,Hu())));throw Gl(n,a?.callee??t),n}return s.value};return t},nd=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 zu;return a.issues.length?rd(e,a.issues,i):{success:!0,data:a.value}};function rd(e,t,n){let r;return{success:!1,get error(){return r||(r=new e(t.map(e=>gu(e,n,Hu()))),t=void 0,n=void 0),r},set error(e){r=e,t=void 0,n=void 0}}}var id=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?rd(e,a.issues,i):{success:!0,data:a.value}},ad=Symbol.for(`zod.compile.invalid`),od=Symbol.for(`zod.compile.fallback`),sd=((e,t,n)=>{let r=e._zod.bag.validator;if(r!==void 0){if(r(t)!==ad)return!0;if(r.definite===!0&&n===void 0)return!1}return cd(e,t,n)});function cd(e,t,n){let r=n?{...n,async:!1,abortEarly:!0}:{async:!1,abortEarly:!0},i=e._zod.bag.fallbackRun,a;if(i?(r[od]=!0,a=i({value:t,issues:[]},r)):a=e._zod.run({value:t,issues:[]},r),a instanceof Promise)throw new zu;return a.issues.length===0}var ld=async(e,t,n)=>{let r=n?{...n,async:!0,abortEarly:!0}:{async:!0,abortEarly:!0},i=e._zod.run({value:t,issues:[]},r);return i instanceof Promise&&(i=await i),i.issues.length===0},R=e=>{let t=ed(e),n=(e,r,i,a)=>{let o=i?{...i,direction:`backward`}:{direction:`backward`};return t(e,r,o,$u(n,a))};return n},z=e=>{let t=ed(e),n=(e,r,i,a)=>t(e,r,i,$u(n,a));return n},ud=e=>{let t=td(e),n=async(e,r,i,a)=>{let o=i?{...i,direction:`backward`}:{direction:`backward`};return await t(e,r,o,$u(n,a))};return n},dd=e=>{let t=td(e),n=async(e,r,i,a)=>await t(e,r,i,$u(n,a));return n},fd=e=>(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return nd(e)(t,n,i)},pd=e=>(t,n,r)=>nd(e)(t,n,r),md=e=>async(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return id(e)(t,n,i)},hd=e=>async(t,n,r)=>id(e)(t,n,r),gd=/^[cC][0-9a-z]{6,}$/,_d=/^[0-9a-z]+$/,vd=/^[0-7][0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{25}$/,yd=/^[0-9a-vA-V]{20}$/,bd=/^[A-Za-z0-9]{27}$/,xd=/^[a-zA-Z0-9_-]{21}$/;function Sd(e){return RegExp(`^[a-zA-Z0-9_-]{${e}}$`)}var Cd=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,wd=/^([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})$/,Td=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)$/,Ed=/^(?:[A-Za-z0-9_'+\-]+\.)*[A-Za-z0-9_'+\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,Dd=`^(?=[\\s\\S]*[\\p{Extended_Pictographic}\\p{Regional_Indicator}\\u20E3])[\\p{Extended_Pictographic}\\p{Emoji_Component}]+$`;function Od(){return new RegExp(Dd,`u`)}var kd=/^(?:(?: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])$/,Ad=/^(([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}|:))$/,jd=/^((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])$/,Md=/^(([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])$/,Nd=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,Pd=/^(?:[A-Za-z0-9_-]{4})*(?:[A-Za-z0-9_-]{2,3})?$/,Fd=/^https?$/,Id=/^\+[1-9]\d{6,14}$/,Ld=`(?:(?:\\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 Rd(e){return RegExp(`^${e}$`)}var zd=Rd(Ld);function Bd(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 Vd(e){return RegExp(`^${Bd(e)}$`)}function Hd(e){let t=[`Z`];e.offset&&t.push(`([+-](?:[01]\\d|2[0-3]):[0-5]\\d)`);let n=`${Bd({precision:e.precision,seconds:!0})}(?:${t.join(`|`)})`,r=e.local?`${n}|${Bd({precision:e.precision})}`:n;return RegExp(`^${Ld}T(?:${r})$`)}var Ud=/^[\s\S]{0,}$/,Wd=/^-?\d+$/,Gd=/^-?\d+(?:\.\d+)?$/,Kd=/^(?:true|false)$/i,qd=/^null$/i,Jd=/^undefined$/i,Yd=/^[^A-Z]*$/,Xd=/^[^a-z]*$/,Zd=L(`$ZodCheck`,(e,t)=>{var n;e._zod??={},e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),Qd=e=>{let t=e.value;return!Al(t)&&t.length!==void 0},$d={number:`number`,bigint:`bigint`,object:`date`},ef=L(`$ZodCheckLessThan`,(e,t)=>{Zd.init(e,t);let n=$d[typeof t.value];e._zod.check=r=>{(t.inclusive?r.value<=t.value:r.value{Zd.init(e,t);let n=$d[typeof t.value];e._zod.check=r=>{(t.inclusive?r.value>=t.value:r.value>t.value)||r.issues.push({origin:$d[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})}}),nf=L(`$ZodCheckMultipleOf`,(e,t)=>{Zd.init(e,t),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):Ml(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})}}),rf=L(`$ZodCheckNumberFormat`,(e,t)=>{Zd.init(e,t),t.format=t.format||`float64`;let n=t.format?.includes(`int`),r=n?`int`:`number`,[i,a]=tu[t.format];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})}}),af=L(`$ZodCheckMaxLength`,(e,t)=>{var n;Zd.init(e,t),(n=e._zod.def).when??(n.when=Qd),e._zod.check=n=>{let r=n.value,i=r.length;if((typeof r==`string`&&i>t.maximum?vu(r):i)<=t.maximum)return;let a=yu(r);n.issues.push({origin:a,code:`too_big`,maximum:t.maximum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),of=L(`$ZodCheckMinLength`,(e,t)=>{var n;Zd.init(e,t),(n=e._zod.def).when??(n.when=Qd),e._zod.check=n=>{let r=n.value,i=r.length;if((typeof r==`string`&&i>=t.minimum&&i=t.minimum)return;let a=yu(r);n.issues.push({origin:a,code:`too_small`,minimum:t.minimum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),sf=L(`$ZodCheckLengthEquals`,(e,t)=>{var n;Zd.init(e,t),(n=e._zod.def).when??(n.when=Qd),e._zod.check=n=>{let r=n.value,i=r.length,a=typeof r==`string`&&i>=t.length&&i<=t.length*2?vu(r):i;if(a===t.length)return;let o=yu(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})}}),cf=L(`$ZodCheckStringFormat`,(e,t)=>{var n,r;Zd.init(e,t),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=()=>{})}),lf=L(`$ZodCheckRegex`,(e,t)=>{cf.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})}}),uf=L(`$ZodCheckLowerCase`,(e,t)=>{t.pattern??=Yd,cf.init(e,t)}),df=L(`$ZodCheckUpperCase`,(e,t)=>{t.pattern??=Xd,cf.init(e,t)}),ff=L(`$ZodCheckIncludes`,(e,t)=>{Zd.init(e,t);let n=Zl(t.includes);t.pattern=new RegExp(typeof t.position==`number`?`^.{${t.position},}${n}`:n),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})}}),pf=L(`$ZodCheckStartsWith`,(e,t)=>{Zd.init(e,t);let n=RegExp(`^${Zl(t.prefix)}.*`);t.pattern??=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})}}),mf=L(`$ZodCheckEndsWith`,(e,t)=>{Zd.init(e,t);let n=RegExp(`.*${Zl(t.suffix)}$`);t.pattern??=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})}}),hf=L(`$ZodCheckOverwrite`,(e,t)=>{Zd.init(e,t),e._zod.check=e=>{e.value=t.tx(e.value)}}),gf=class{constructor(e=[],t={}){this.content=[],this.indent=0,this.args=e,this.closed=t}indented(e){this.indent+=1;try{e(this)}finally{--this.indent}}write(e){if(typeof e==`function`){e(this,{execution:`sync`}),e(this,{execution:`async`});return}let t=e.split(` + `.indexOf(e)>=0}function wl(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():Cl(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`:Cl(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 Tl(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 El(e,t=`|`){return e.map(e=>$l(e)).join(t)}function Dl(e,t){return typeof t==`bigint`?t.toString():t}var Ol=class{constructor(e){this._getter=e,this._value=void 0}get value(){let e=this._getter;return e!==void 0&&(this._value=e(),this._getter=void 0),this._value}};function kl(e){return new Ol(e)}function Al(e){return e==null}function jl(e){let t=+!!e.startsWith(`^`),n=e.endsWith(`$`)?e.length-1:e.length;return e.slice(t,n)}function Ml(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){let e=t._zod.def.shape[a];return r?r(e,a):e}):zl(e,a,r?r(n.value,a):n.value))}}function Vl(e,t){for(let n of Reflect.ownKeys(t)){let r=Object.getOwnPropertyDescriptor(t,n);r.enumerable&&(r.get?Rl(e,n,()=>t[n]):zl(e,n,r.value))}}function Hl(...e){let t={};for(let n of e){let e=Object.getOwnPropertyDescriptors(n);Object.assign(t,e)}return Object.defineProperties({},t)}function Ul(e){return JSON.stringify(e)}function Wl(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,``).replace(/[\s_-]+/g,`-`).replace(/^-+|-+$/g,``)}var Gl=`captureStackTrace`in Error?Error.captureStackTrace:(...e)=>{};function Kl(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}var ql=kl(()=>{if(Hu.jitless||typeof navigator<`u`&&navigator?.userAgent?.includes(`Cloudflare`))return!1;try{return Function(``),!0}catch{return!1}});function Jl(e){if(Kl(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!=`function`)return!0;let n=t.prototype;return Kl(n)!==!1&&Object.prototype.hasOwnProperty.call(n,`isPrototypeOf`)!==!1}function Yl(e){return Jl(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}var Xl=new Set([`string`,`number`,`symbol`]);function Zl(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}function Ql(e,t,n){let r=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(r._zod.parent=e),r}function P(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 $l(e){return typeof e==`bigint`?e.toString()+`n`:typeof e==`string`?`"${e}"`:`${e}`}function eu(e){return Object.keys(e).filter(t=>e[t]._zod.optin!==void 0&&e[t]._zod.optout===`optional`)}var tu={safeint:[-(2**53-1),2**53-1],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},nu={int64:[BigInt(`-9223372036854775808`),BigInt(`9223372036854775807`)],uint64:[BigInt(0),BigInt(`18446744073709551615`)]};function ru(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`);let i={};return Bl(i,e,iu(e,t)),Ql(e,Hl(n,{shape:i,checks:[]}))}function iu(e,t){let n=Ll(e),r=[];for(let e of Reflect.ownKeys(t)){if(!Object.getOwnPropertyDescriptor(n,e)?.enumerable)throw Error(`Unrecognized key: "${String(e)}"`);t[e]&&r.push(e)}return r}function au(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`);let i=new Set(iu(e,t)),a={};return Bl(a,e,Reflect.ownKeys(Ll(e)).filter(e=>!i.has(e))),Ql(e,Hl(n,{shape:a,checks:[]}))}function ou(e,t){if(!Jl(t))throw Error(`Invalid input to extend: expected a plain object`);let n=e._zod.def.checks;if(n&&n.length>0){let n=Ll(e);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 Ql(e,Hl(e._zod.def,{shape:su(e,t)}))}function su(e,t){let n={};return Bl(n,e,Reflect.ownKeys(Ll(e))),Vl(n,t),n}function cu(e,t){if(!Jl(t))throw Error(`Invalid input to safeExtend: expected a plain object`);return Ql(e,Hl(e._zod.def,{shape:su(e,t)}))}function lu(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.`);let n={};return Bl(n,e,Reflect.ownKeys(Ll(e))),Bl(n,t,Reflect.ownKeys(Ll(t))),Ql(e,Hl(e._zod.def,{shape:n,get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]}))}function uu(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`);let a=n?new Set(iu(t,n)):void 0,o={};return Bl(o,t,Reflect.ownKeys(Ll(t)),e&&((t,n)=>a&&!a.has(n)?t:new e({type:`optional`,innerType:t}))),Ql(t,Hl(t._zod.def,{shape:o,checks:[]}))}function du(e,t,n){let r=n?new Set(iu(t,n)):void 0,i={};return Bl(i,t,Reflect.ownKeys(Ll(t)),(t,n)=>r&&!r.has(n)?t:new e({type:`nonoptional`,innerType:t})),Ql(t,Hl(t._zod.def,{shape:i}))}function fu(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 hu(e){return typeof e==`string`?e:e?.message}function gu(e,t,n){var r;for(let i=t;ie;return t[Nu]=!0,t}var Fu,Iu=Object.freeze({status:`aborted`}),Lu={value:void 0,enumerable:!1},Ru=`captureStackTrace`in Error?Error:null;function zu(e){let t=Ru;if(t){let n=t.stackTraceLimit;if(typeof n==`number`){try{t.stackTraceLimit=0}catch{return Ru=null,new e}try{return new e}finally{t.stackTraceLimit=n}}}return new e}function I(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){Lu.value=new a(r);try{Object.defineProperty(n,"_zod",Lu)}finally{Lu.value=void 0}}else 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),Cu(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?zu(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 Bu=class extends Error{constructor(){super(`Encountered Promise during synchronous parse. Use .parseAsync() instead.`)}},Vu=class extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name=`ZodEncodeError`}};(Fu=globalThis).__zod_globalConfig??(Fu.__zod_globalConfig={});var Hu=globalThis.__zod_globalConfig;function Uu(e){return e&&Object.assign(Hu,e),Hu}function Wu(){let e=this._zod;return e.message??=JSON.stringify(e.def,Dl,2),e.message}function Gu(e){this._zod.message=e}var Ku={get:Wu,set:Gu,enumerable:!0,configurable:!0},qu={value:void 0,enumerable:!1},Ju=new WeakSet([Object.prototype,Error.prototype]),Yu=(e,t)=>{e.name=`$ZodError`,qu.value=t,Object.defineProperty(e,"issues",qu),qu.value=void 0,Object.defineProperty(e,"message",Ku);let n=Object.getPrototypeOf(e);Ju.has(n)||(Ju.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})}}))},Xu=I(`$ZodError`,Yu);I(`$ZodError`,Yu,void 0,{Parent:Error});function Zu(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 Qu(e,t=e=>e.message){let n={},r=[];for(let i of e.issues)i.path.length>0?Zu(n,i.path[0],()=>[]).push(t(i)):r.push(t(i));return{formErrors:r,fieldErrors:n}}function $u(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 Bu;if(s.issues.length){let n=new((a?.Err)??e)(s.issues.map(e=>_u(e,o,Uu())));throw Gl(n,a?.callee??t),n}return s.value};return t},nd=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=>_u(e,o,Uu())));throw Gl(n,a?.callee??t),n}return s.value};return t},rd=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 Bu;return a.issues.length?id(e,a.issues,i):{success:!0,data:a.value}};function id(e,t,n){let r;return{success:!1,get error(){return r||(r=new e(t.map(e=>_u(e,n,Uu()))),t=void 0,n=void 0),r},set error(e){r=e,t=void 0,n=void 0}}}var ad=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?id(e,a.issues,i):{success:!0,data:a.value}},od=Symbol.for(`zod.compile.invalid`),sd=Symbol.for(`zod.compile.fallback`),cd=((e,t,n)=>{let r=e._zod.bag.validator;if(r!==void 0){if(r(t)!==od)return!0;if(r.definite===!0&&n===void 0)return!1}return ld(e,t,n)});function ld(e,t,n){let r=n?{...n,async:!1,abortEarly:!0}:{async:!1,abortEarly:!0},i=e._zod.bag.fallbackRun,a;if(i?(r[sd]=!0,a=i({value:t,issues:[]},r)):a=e._zod.run({value:t,issues:[]},r),a instanceof Promise)throw new Bu;return a.issues.length===0}var ud=async(e,t,n)=>{let r=n?{...n,async:!0,abortEarly:!0}:{async:!0,abortEarly:!0},i=e._zod.run({value:t,issues:[]},r);return i instanceof Promise&&(i=await i),i.issues.length===0},L=e=>{let t=td(e),n=(e,r,i,a)=>{let o=i?{...i,direction:`backward`}:{direction:`backward`};return t(e,r,o,ed(n,a))};return n},R=e=>{let t=td(e),n=(e,r,i,a)=>t(e,r,i,ed(n,a));return n},dd=e=>{let t=nd(e),n=async(e,r,i,a)=>{let o=i?{...i,direction:`backward`}:{direction:`backward`};return await t(e,r,o,ed(n,a))};return n},fd=e=>{let t=nd(e),n=async(e,r,i,a)=>await t(e,r,i,ed(n,a));return n},pd=e=>(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return rd(e)(t,n,i)},md=e=>(t,n,r)=>rd(e)(t,n,r),hd=e=>async(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return ad(e)(t,n,i)},gd=e=>async(t,n,r)=>ad(e)(t,n,r),_d=/^[cC][0-9a-z]{6,}$/,vd=/^[0-9a-z]+$/,yd=/^[0-7][0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{25}$/,bd=/^[0-9a-vA-V]{20}$/,xd=/^[A-Za-z0-9]{27}$/,Sd=/^[a-zA-Z0-9_-]{21}$/;function Cd(e){return RegExp(`^[a-zA-Z0-9_-]{${e}}$`)}var wd=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,Td=/^([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})$/,Ed=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)$/,Dd=/^(?:[A-Za-z0-9_'+\-]+\.)*[A-Za-z0-9_'+\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,Od=`^(?=[\\s\\S]*[\\p{Extended_Pictographic}\\p{Regional_Indicator}\\u20E3])[\\p{Extended_Pictographic}\\p{Emoji_Component}]+$`;function kd(){return new RegExp(Od,`u`)}var Ad=/^(?:(?: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])$/,jd=/^(([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}|:))$/,Md=/^((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])$/,Nd=/^(([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])$/,Pd=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,Fd=/^(?:[A-Za-z0-9_-]{4})*(?:[A-Za-z0-9_-]{2,3})?$/,Id=/^https?$/,Ld=/^\+[1-9]\d{6,14}$/,Rd=`(?:(?:\\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 zd(e){return RegExp(`^${e}$`)}var Bd=zd(Rd);function Vd(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 Hd(e){return RegExp(`^${Vd(e)}$`)}function Ud(e){let t=[`Z`];e.offset&&t.push(`([+-](?:[01]\\d|2[0-3]):[0-5]\\d)`);let n=`${Vd({precision:e.precision,seconds:!0})}(?:${t.join(`|`)})`,r=e.local?`${n}|${Vd({precision:e.precision})}`:n;return RegExp(`^${Rd}T(?:${r})$`)}var Wd=/^[\s\S]{0,}$/,Gd=/^-?\d+$/,Kd=/^-?\d+(?:\.\d+)?$/,qd=/^(?:true|false)$/i,Jd=/^null$/i,Yd=/^undefined$/i,Xd=/^[^A-Z]*$/,Zd=/^[^a-z]*$/,Qd=I(`$ZodCheck`,(e,t)=>{var n;e._zod??={},e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),$d=e=>{let t=e.value;return!Al(t)&&t.length!==void 0},ef={number:`number`,bigint:`bigint`,object:`date`},tf=I(`$ZodCheckLessThan`,(e,t)=>{Qd.init(e,t);let n=ef[typeof t.value];e._zod.check=r=>{(t.inclusive?r.value<=t.value:r.value{Qd.init(e,t);let n=ef[typeof t.value];e._zod.check=r=>{(t.inclusive?r.value>=t.value:r.value>t.value)||r.issues.push({origin:ef[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})}}),rf=I(`$ZodCheckMultipleOf`,(e,t)=>{Qd.init(e,t),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):Ml(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})}}),af=I(`$ZodCheckNumberFormat`,(e,t)=>{Qd.init(e,t),t.format=t.format||`float64`;let n=t.format?.includes(`int`),r=n?`int`:`number`,[i,a]=tu[t.format];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})}}),of=I(`$ZodCheckMaxLength`,(e,t)=>{var n;Qd.init(e,t),(n=e._zod.def).when??(n.when=$d),e._zod.check=n=>{let r=n.value,i=r.length;if((typeof r==`string`&&i>t.maximum?yu(r):i)<=t.maximum)return;let a=bu(r);n.issues.push({origin:a,code:`too_big`,maximum:t.maximum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),sf=I(`$ZodCheckMinLength`,(e,t)=>{var n;Qd.init(e,t),(n=e._zod.def).when??(n.when=$d),e._zod.check=n=>{let r=n.value,i=r.length;if((typeof r==`string`&&i>=t.minimum&&i=t.minimum)return;let a=bu(r);n.issues.push({origin:a,code:`too_small`,minimum:t.minimum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),cf=I(`$ZodCheckLengthEquals`,(e,t)=>{var n;Qd.init(e,t),(n=e._zod.def).when??(n.when=$d),e._zod.check=n=>{let r=n.value,i=r.length,a=typeof r==`string`&&i>=t.length&&i<=t.length*2?yu(r):i;if(a===t.length)return;let o=bu(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})}}),lf=I(`$ZodCheckStringFormat`,(e,t)=>{var n,r;Qd.init(e,t),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=()=>{})}),uf=I(`$ZodCheckRegex`,(e,t)=>{lf.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})}}),df=I(`$ZodCheckLowerCase`,(e,t)=>{t.pattern??=Xd,lf.init(e,t)}),ff=I(`$ZodCheckUpperCase`,(e,t)=>{t.pattern??=Zd,lf.init(e,t)}),pf=I(`$ZodCheckIncludes`,(e,t)=>{Qd.init(e,t);let n=Zl(t.includes);t.pattern=new RegExp(typeof t.position==`number`?`^.{${t.position},}${n}`:n),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})}}),mf=I(`$ZodCheckStartsWith`,(e,t)=>{Qd.init(e,t);let n=RegExp(`^${Zl(t.prefix)}.*`);t.pattern??=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})}}),hf=I(`$ZodCheckEndsWith`,(e,t)=>{Qd.init(e,t);let n=RegExp(`.*${Zl(t.suffix)}$`);t.pattern??=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})}}),gf=I(`$ZodCheckOverwrite`,(e,t)=>{Qd.init(e,t),e._zod.check=e=>{e.value=t.tx(e.value)}}),_f=class{constructor(e=[],t={}){this.content=[],this.indent=0,this.args=e,this.closed=t}indented(e){this.indent+=1;try{e(this)}finally{--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))}},_f={major:4,minor:6,patch:5},vf=L(`$ZodType`,(e,t)=>{var n;e??={},e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=_f;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=fu(t),a;for(let o of n){if(o._zod.def.when){if(pu(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 zu;if(a||s instanceof Promise)a=(a??Promise.resolve()).then(async()=>{await s,t.issues.length!==n&&(hu(t.issues,n,e),i||=fu(t,n))});else{if(t.issues.length===n)continue;hu(t.issues,n,e),i||=fu(t,n)}}return a?a.then(()=>t):t},n=(n,r,a)=>{if(fu(n))return n.aborted=!0,n;let o=t(r,i,a);if(o instanceof Promise){if(a.async===!1)throw new zu;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 zu;return o.then(e=>t(e,i,a))}return t(o,i,a)}}},{get"~standard"(){return wu(this,`~standard`,xf(this))},set"~standard"(e){Cu(this,`~standard`,e)}}),yf=(e,t)=>e.issues.length?{issues:e.issues.map(e=>gu(e,t,Hu()))}:{value:e.value};async function bf(e,t){let n={async:!0};return yf(await e._zod.run({value:t,issues:[]},n),n)}function xf(e){return{validate:t=>{let n={async:!1};try{let r=e._zod.run({value:t,issues:[]},n);if(!(r instanceof Promise))return yf(r,n)}catch{}return bf(e,t)},vendor:`zod`,version:1}}var Sf=L(`$ZodString`,(e,t)=>{vf.init(e,t),e._zod.pattern=t.pattern??Ud,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}}),Cf=L(`$ZodStringFormat`,(e,t)=>{cf.init(e,t),Sf.init(e,t)}),wf=L(`$ZodGUID`,(e,t)=>{t.pattern??=wd,Cf.init(e,t)}),Tf=L(`$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??=Td(e)}else t.pattern??=Td();Cf.init(e,t)}),Ef=L(`$ZodEmail`,(e,t)=>{t.pattern??=Ed,Cf.init(e,t)});function Df(e){try{return typeof URL<`u`&&typeof URL.canParse==`function`?URL.canParse(e):(new URL(e),!0)}catch{return!1}}function Of(e,t){return!(`normalize`in t)&&!(`hostname`in t)&&!(`protocol`in t)?Df(e)||2:kf(e,t)}function kf(e,t){if(!t.normalize&&t.protocol?.source===Fd.source&&!/^https?:\/\//i.test(e))return 1;try{if(typeof URL<`u`){let t=URL;if(typeof t.parse==`function`)return t.parse(e)??2}return new URL(e)}catch{return 2}}var Af=/[\t\n\r]/g;function jf(e){return e.replace(Af,``)}function Mf(e,t){return t.lastIndex=0,t.test(e.hostname)}function Nf(e,t){return t.lastIndex=0,t.test(e.protocol.endsWith(`:`)?e.protocol.slice(0,-1):e.protocol)}var Pf=L(`$ZodURL`,(e,t)=>{Cf.init(e,t),e._zod.check=n=>{try{let r=n.value.trim(),i=Of(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}if(i===!0){n.value=jf(r);return}t.hostname&&!Mf(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&&!Nf(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:jf(r);return}catch{n.issues.push({code:`invalid_format`,format:`url`,input:n.value,inst:e,continue:!t.abort})}}}),Ff=L(`$ZodEmoji`,(e,t)=>{t.pattern??=Od(),Cf.init(e,t)}),If=L(`$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?xd:Sd(t.length),Cf.init(e,t)}),Lf=L(`$ZodCUID`,(e,t)=>{t.pattern??=gd,Cf.init(e,t)}),Rf=L(`$ZodCUID2`,(e,t)=>{t.pattern??=_d,Cf.init(e,t)}),zf=L(`$ZodULID`,(e,t)=>{t.pattern??=vd,Cf.init(e,t)}),Bf=L(`$ZodXID`,(e,t)=>{t.pattern??=yd,Cf.init(e,t)}),Vf=L(`$ZodKSUID`,(e,t)=>{t.pattern??=bd,Cf.init(e,t)}),Hf=L(`$ZodISODateTime`,(e,t)=>{t.pattern??=Hd(t),Cf.init(e,t)}),Uf=L(`$ZodISODate`,(e,t)=>{t.pattern??=zd,Cf.init(e,t)}),Wf=L(`$ZodISOTime`,(e,t)=>{t.pattern??=Vd(t),Cf.init(e,t)}),Gf=L(`$ZodISODuration`,(e,t)=>{t.pattern??=Cd,Cf.init(e,t)}),Kf=L(`$ZodIPv4`,(e,t)=>{t.pattern??=kd,Cf.init(e,t)}),qf=/^[0-9a-fA-F:.]+$/;function Jf(e){return qf.test(e)?Df(`http://[${e}]`):!1}var Yf=L(`$ZodIPv6`,(e,t)=>{t.pattern??=Ad,Cf.init(e,t),e._zod.check=n=>{Jf(n.value)||n.issues.push({code:`invalid_format`,format:`ipv6`,input:n.value,inst:e,continue:!t.abort})}}),Xf=L(`$ZodCIDRv4`,(e,t)=>{t.pattern??=jd,Cf.init(e,t)});function Zf(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:Jf(n)}var Qf=L(`$ZodCIDRv6`,(e,t)=>{t.pattern??=Md,Cf.init(e,t),e._zod.check=n=>{Zf(n.value)||n.issues.push({code:`invalid_format`,format:`cidrv6`,input:n.value,inst:e,continue:!t.abort})}});function $f(e){if(e===``)return!0;if(/\s/.test(e)||e.length%4!=0)return!1;try{return atob(e),!0}catch{return!1}}var B=/^[0-9a-zA-Z+/]*={0,2}$/,ep=L(`$ZodBase64`,(e,t)=>{t.pattern??=B,Cf.init(e,t),e._zod.check=n=>{$f(n.value)||n.issues.push({code:`invalid_format`,format:`base64`,input:n.value,inst:e,continue:!t.abort})}}),tp=/^[A-Za-z0-9_-]*$/;function np(e){if(!tp.test(e))return!1;let t=e.replace(/[-_]/g,e=>e===`-`?`+`:`/`);return $f(t.padEnd(Math.ceil(t.length/4)*4,`=`))}var rp=L(`$ZodBase64URL`,(e,t)=>{t.pattern??=tp,Cf.init(e,t),e._zod.check=n=>{np(n.value)||n.issues.push({code:`invalid_format`,format:`base64url`,input:n.value,inst:e,continue:!t.abort})}}),ip=L(`$ZodE164`,(e,t)=>{t.pattern??=Id,Cf.init(e,t)});function ap(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 op=L(`$ZodJWT`,(e,t)=>{Cf.init(e,t),e._zod.check=n=>{ap(n.value,t.alg)||n.issues.push({code:`invalid_format`,format:`jwt`,input:n.value,inst:e,continue:!t.abort})}}),sp=L(`$ZodNumber`,(e,t)=>{vf.init(e,t),e._zod.pattern=Gd,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}}),cp=L(`$ZodNumberFormat`,(e,t)=>{rf.init(e,t),sp.init(e,t)}),lp=L(`$ZodBoolean`,(e,t)=>{vf.init(e,t),e._zod.pattern=Kd,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}}),up=L(`$ZodUndefined`,(e,t)=>{vf.init(e,t),e._zod.pattern=Jd,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}}),dp=L(`$ZodNull`,(e,t)=>{vf.init(e,t),e._zod.pattern=qd,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}}),fp=L(`$ZodAny`,(e,t)=>{vf.init(e,t),e._zod.parse=e=>e}),pp=L(`$ZodUnknown`,(e,t)=>{vf.init(e,t),e._zod.parse=e=>e}),mp=L(`$ZodNever`,(e,t)=>{vf.init(e,t),e._zod.parse=(t,n)=>(t.issues.push({expected:`never`,code:`invalid_type`,input:t.value,inst:e}),t)});function hp(e,t,n){e.issues.length&&t.issues.push(...mu(n,e.issues)),t.value[n]=e.value}var gp=L(`$ZodArray`,(e,t)=>{vf.init(e,t);let n=Vu.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=[],s=i?.abortEarly;for(let e=0;ehp(t,r,e)));else if(hp(c,r,e),s&&c.issues.length!==0&&fu(c))break}return o.length?Promise.all(o).then(()=>r):r}});function _p(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(...mu(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||i===`defaulted`&&!s)&&(t.value[n]=void 0):t.value[n]=e.value}}var vp=[];function yp(e){let t=Object.keys(e.shape),n=Object.getOwnPropertySymbols(e.shape),r=n.length?n:vp,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=eu(e.shape);return{...e,allKeys:i,symbolKeys:r,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(a)}}function bp(e,t,n,r,i,a,o){let s=[],c=i.keySet,l=i.catchall._zod,u=l.def.type,d=l.optin,f=l.optout,p=0;for(let i in t){if(o&&n.issues.length!==p){if(fu(n,p))break;p=n.issues.length}if(c.has(i))continue;if(i===`__proto__`){u===`never`&&s.push(i);continue}if(u===`never`){s.push(i);continue}let a=l.run({value:t[i],issues:[]},r);a instanceof Promise?e.push(a.then(e=>_p(e,n,i,t,d,f))):_p(a,n,i,t,d,f)}return s.length&&n.issues.push({code:`unrecognized_keys`,keys:s,input:t,inst:a,continue:!0}),e.length?Promise.all(e).then(()=>n):n}var xp=L(`$ZodObject`,(e,t)=>{vf.init(e,t);let n=Object.getOwnPropertyDescriptor(t,`shape`),r=n?.get?n.get.raw:t.shape??{};if(r){let e=()=>{let n={...r};return Object.defineProperty(t,"shape",{value:n}),e.raw=n,n};e.raw=r,Object.defineProperty(t,"shape",{get:e})}let i=kl(()=>yp(t));I(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)||Fl(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 a=Kl,o=t.catchall,s,c=Vu.memoizer;c?.attach(e),e._zod.parse=(t,n)=>{s??=i.value;let r=t.value;if(!a(r))return t.issues.push({expected:`object`,code:`invalid_type`,input:r,inst:e}),t;t.value=c?c.alloc(e,t,{},n):{};let l=[],u=s.shape,d=n?.abortEarly,f=t.issues.length;for(let e of s.allKeys){if(d&&t.issues.length!==f){if(fu(t,f))break;f=t.issues.length}if(e===`__proto__`)continue;let i=u[e],a=i._zod.optin,o=i._zod.optout,s=i._zod.run({value:r[e],issues:[]},n);s instanceof Promise?l.push(s.then(n=>_p(n,t,e,r,a,o))):_p(s,t,e,r,a,o)}return o?bp(l,r,t,n,i.value,e,d===!0):l.length?Promise.all(l).then(()=>t):t}}),Sp=L(`$ZodObjectJIT`,(e,t)=>{xp.init(e,t);let n=e._zod.parse,r=kl(()=>yp(t)),i=Vu.memoizer,a=t=>{let n=r.value,a=n.symbolKeys,o=new gf([`payload`,`ctx`],{shape:t,inst:e,memo:i,syms:a}),s=e=>`shape[${e}]._zod.run({ value: input[${e}], issues: [] }, ctx)`,c=(e,t)=>` +`)}\n};`)(...Object.values(this.closed))}},vf={major:4,minor:6,patch:5},yf=I(`$ZodType`,(e,t)=>{var n;e??={},e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=vf;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=fu(t),a;for(let o of n){if(o._zod.def.when){if(pu(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 Bu;if(a||s instanceof Promise)a=(a??Promise.resolve()).then(async()=>{await s,t.issues.length!==n&&(gu(t.issues,n,e),i||=fu(t,n))});else{if(t.issues.length===n)continue;gu(t.issues,n,e),i||=fu(t,n)}}return a?a.then(()=>t):t},n=(n,r,a)=>{if(fu(n))return n.aborted=!0,n;let o=t(r,i,a);if(o instanceof Promise){if(a.async===!1)throw new Bu;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 Bu;return o.then(e=>t(e,i,a))}return t(o,i,a)}}},{get"~standard"(){return Tu(this,`~standard`,Sf(this))},set"~standard"(e){wu(this,`~standard`,e)}}),bf=(e,t)=>e.issues.length?{issues:e.issues.map(e=>_u(e,t,Uu()))}:{value:e.value};async function xf(e,t){let n={async:!0};return bf(await e._zod.run({value:t,issues:[]},n),n)}function Sf(e){return{validate:t=>{let n={async:!1};try{let r=e._zod.run({value:t,issues:[]},n);if(!(r instanceof Promise))return bf(r,n)}catch{}return xf(e,t)},vendor:`zod`,version:1}}var Cf=I(`$ZodString`,(e,t)=>{yf.init(e,t),e._zod.pattern=t.pattern??Wd,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}}),wf=I(`$ZodStringFormat`,(e,t)=>{lf.init(e,t),Cf.init(e,t)}),Tf=I(`$ZodGUID`,(e,t)=>{t.pattern??=Td,wf.init(e,t)}),Ef=I(`$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??=Ed(e)}else t.pattern??=Ed();wf.init(e,t)}),Df=I(`$ZodEmail`,(e,t)=>{t.pattern??=Dd,wf.init(e,t)});function Of(e){try{return typeof URL<`u`&&typeof URL.canParse==`function`?URL.canParse(e):(new URL(e),!0)}catch{return!1}}function kf(e,t){return!(`normalize`in t)&&!(`hostname`in t)&&!(`protocol`in t)?Of(e)||2:Af(e,t)}function Af(e,t){if(!t.normalize&&t.protocol?.source===Id.source&&!/^https?:\/\//i.test(e))return 1;try{if(typeof URL<`u`){let t=URL;if(typeof t.parse==`function`)return t.parse(e)??2}return new URL(e)}catch{return 2}}var jf=/[\t\n\r]/g;function Mf(e){return e.replace(jf,``)}function Nf(e,t){return t.lastIndex=0,t.test(e.hostname)}function Pf(e,t){return t.lastIndex=0,t.test(e.protocol.endsWith(`:`)?e.protocol.slice(0,-1):e.protocol)}var Ff=I(`$ZodURL`,(e,t)=>{wf.init(e,t),e._zod.check=n=>{try{let r=n.value.trim(),i=kf(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}if(i===!0){n.value=Mf(r);return}t.hostname&&!Nf(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&&!Pf(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:Mf(r);return}catch{n.issues.push({code:`invalid_format`,format:`url`,input:n.value,inst:e,continue:!t.abort})}}}),If=I(`$ZodEmoji`,(e,t)=>{t.pattern??=kd(),wf.init(e,t)}),Lf=I(`$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?Sd:Cd(t.length),wf.init(e,t)}),Rf=I(`$ZodCUID`,(e,t)=>{t.pattern??=_d,wf.init(e,t)}),zf=I(`$ZodCUID2`,(e,t)=>{t.pattern??=vd,wf.init(e,t)}),Bf=I(`$ZodULID`,(e,t)=>{t.pattern??=yd,wf.init(e,t)}),Vf=I(`$ZodXID`,(e,t)=>{t.pattern??=bd,wf.init(e,t)}),Hf=I(`$ZodKSUID`,(e,t)=>{t.pattern??=xd,wf.init(e,t)}),Uf=I(`$ZodISODateTime`,(e,t)=>{t.pattern??=Ud(t),wf.init(e,t)}),Wf=I(`$ZodISODate`,(e,t)=>{t.pattern??=Bd,wf.init(e,t)}),Gf=I(`$ZodISOTime`,(e,t)=>{t.pattern??=Hd(t),wf.init(e,t)}),Kf=I(`$ZodISODuration`,(e,t)=>{t.pattern??=wd,wf.init(e,t)}),qf=I(`$ZodIPv4`,(e,t)=>{t.pattern??=Ad,wf.init(e,t)}),Jf=/^[0-9a-fA-F:.]+$/;function Yf(e){return Jf.test(e)?Of(`http://[${e}]`):!1}var Xf=I(`$ZodIPv6`,(e,t)=>{t.pattern??=jd,wf.init(e,t),e._zod.check=n=>{Yf(n.value)||n.issues.push({code:`invalid_format`,format:`ipv6`,input:n.value,inst:e,continue:!t.abort})}}),Zf=I(`$ZodCIDRv4`,(e,t)=>{t.pattern??=Md,wf.init(e,t)});function Qf(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:Yf(n)}var $f=I(`$ZodCIDRv6`,(e,t)=>{t.pattern??=Nd,wf.init(e,t),e._zod.check=n=>{Qf(n.value)||n.issues.push({code:`invalid_format`,format:`cidrv6`,input:n.value,inst:e,continue:!t.abort})}});function ep(e){if(e===``)return!0;if(/\s/.test(e)||e.length%4!=0)return!1;try{return atob(e),!0}catch{return!1}}var z=/^[0-9a-zA-Z+/]*={0,2}$/,tp=I(`$ZodBase64`,(e,t)=>{t.pattern??=z,wf.init(e,t),e._zod.check=n=>{ep(n.value)||n.issues.push({code:`invalid_format`,format:`base64`,input:n.value,inst:e,continue:!t.abort})}}),np=/^[A-Za-z0-9_-]*$/;function rp(e){if(!np.test(e))return!1;let t=e.replace(/[-_]/g,e=>e===`-`?`+`:`/`);return ep(t.padEnd(Math.ceil(t.length/4)*4,`=`))}var ip=I(`$ZodBase64URL`,(e,t)=>{t.pattern??=np,wf.init(e,t),e._zod.check=n=>{rp(n.value)||n.issues.push({code:`invalid_format`,format:`base64url`,input:n.value,inst:e,continue:!t.abort})}}),ap=I(`$ZodE164`,(e,t)=>{t.pattern??=Ld,wf.init(e,t)});function op(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 sp=I(`$ZodJWT`,(e,t)=>{wf.init(e,t),e._zod.check=n=>{op(n.value,t.alg)||n.issues.push({code:`invalid_format`,format:`jwt`,input:n.value,inst:e,continue:!t.abort})}}),cp=I(`$ZodNumber`,(e,t)=>{yf.init(e,t),e._zod.pattern=Kd,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}}),lp=I(`$ZodNumberFormat`,(e,t)=>{af.init(e,t),cp.init(e,t)}),up=I(`$ZodBoolean`,(e,t)=>{yf.init(e,t),e._zod.pattern=qd,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}}),dp=I(`$ZodUndefined`,(e,t)=>{yf.init(e,t),e._zod.pattern=Yd,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}}),fp=I(`$ZodNull`,(e,t)=>{yf.init(e,t),e._zod.pattern=Jd,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}}),pp=I(`$ZodAny`,(e,t)=>{yf.init(e,t),e._zod.parse=e=>e}),mp=I(`$ZodUnknown`,(e,t)=>{yf.init(e,t),e._zod.parse=e=>e}),hp=I(`$ZodNever`,(e,t)=>{yf.init(e,t),e._zod.parse=(t,n)=>(t.issues.push({expected:`never`,code:`invalid_type`,input:t.value,inst:e}),t)});function gp(e,t,n){e.issues.length&&t.issues.push(...mu(n,e.issues)),t.value[n]=e.value}var _p=I(`$ZodArray`,(e,t)=>{yf.init(e,t);let n=Hu.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=[],s=i?.abortEarly;for(let e=0;egp(t,r,e)));else if(gp(c,r,e),s&&c.issues.length!==0&&fu(c))break}return o.length?Promise.all(o).then(()=>r):r}});function vp(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(...mu(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||i===`defaulted`&&!s)&&(t.value[n]=void 0):t.value[n]=e.value}}var yp=[];function bp(e){let t=Object.keys(e.shape),n=Object.getOwnPropertySymbols(e.shape),r=n.length?n:yp,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=eu(e.shape);return{...e,allKeys:i,symbolKeys:r,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(a)}}function xp(e,t,n,r,i,a,o){let s=[],c=i.keySet,l=i.catchall._zod,u=l.def.type,d=l.optin,f=l.optout,p=0;for(let i in t){if(o&&n.issues.length!==p){if(fu(n,p))break;p=n.issues.length}if(c.has(i))continue;if(i===`__proto__`){u===`never`&&s.push(i);continue}if(u===`never`){s.push(i);continue}let a=l.run({value:t[i],issues:[]},r);a instanceof Promise?e.push(a.then(e=>vp(e,n,i,t,d,f))):vp(a,n,i,t,d,f)}return s.length&&n.issues.push({code:`unrecognized_keys`,keys:s,input:t,inst:a,continue:!0}),e.length?Promise.all(e).then(()=>n):n}var Sp=I(`$ZodObject`,(e,t)=>{yf.init(e,t);let n=Object.getOwnPropertyDescriptor(t,`shape`),r=n?.get?n.get.raw:t.shape??{};if(r){let e=()=>{let n={...r};return Object.defineProperty(t,"shape",{value:n}),e.raw=n,n};e.raw=r,Object.defineProperty(t,"shape",{get:e})}let i=kl(()=>bp(t));F(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)||Fl(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 a=Kl,o=t.catchall,s,c=Hu.memoizer;c?.attach(e),e._zod.parse=(t,n)=>{s??=i.value;let r=t.value;if(!a(r))return t.issues.push({expected:`object`,code:`invalid_type`,input:r,inst:e}),t;t.value=c?c.alloc(e,t,{},n):{};let l=[],u=s.shape,d=n?.abortEarly,f=t.issues.length;for(let e of s.allKeys){if(d&&t.issues.length!==f){if(fu(t,f))break;f=t.issues.length}if(e===`__proto__`)continue;let i=u[e],a=i._zod.optin,o=i._zod.optout,s=i._zod.run({value:r[e],issues:[]},n);s instanceof Promise?l.push(s.then(n=>vp(n,t,e,r,a,o))):vp(s,t,e,r,a,o)}return o?xp(l,r,t,n,i.value,e,d===!0):l.length?Promise.all(l).then(()=>t):t}}),Cp=I(`$ZodObjectJIT`,(e,t)=>{Sp.init(e,t);let n=e._zod.parse,r=kl(()=>bp(t)),i=Hu.memoizer,a=t=>{let n=r.value,a=n.symbolKeys,o=new _f([`payload`,`ctx`],{shape:t,inst:e,memo:i,syms:a}),s=e=>`shape[${e}]._zod.run({ value: input[${e}], issues: [] }, ctx)`,c=(e,t)=>` let ${e}_ab = false; for (let i = 0; i < ${e}.issues.length; i++) { const iss = ${e}.issues[i]; @@ -64,11 +64,11 @@ Error generating stack: `+e.message+` newResult[${r}] = ${n}.value; } - `)}return o.write(`payload.value = newResult;`),o.write(`return payload;`),o.compile()},o,s=Kl,c=!Vu.jitless,l=c&&ql.value,u=t.catchall,d;e._zod.parse=(i,f)=>{d??=r.value;let p=i.value;return s(p)?c&&l&&f?.async===!1&&f.jitless!==!0?(o||=a(t.shape),i=o(i,f),u?bp([],p,i,f,d,e,f?.abortEarly===!0):i):n(i,f):(i.issues.push({expected:`object`,code:`invalid_type`,input:p,inst:e}),i)}});function Cp(e,t,n,r){for(let n of e)if(n.issues.length===0)return t.value=n.value,t;let i=e.filter(e=>!fu(e));return i.length===1?(t.value=i[0].value,i[0]):(t.issues.push({code:`invalid_union`,input:t.value,inst:n,errors:e.map(e=>e.issues.map(e=>gu(e,r,Hu())))}),t)}var wp=L(`$ZodUnion`,(e,t)=>{vf.init(e,t),I(e,`optin`,e=>e.def.options.some(e=>e._zod.optin===`defaulted`)?`defaulted`:e.def.options.some(e=>e._zod.optin!==void 0)?`optional`:void 0),I(e,`optout`,e=>e.def.options.some(e=>e._zod.optout===`optional`)?`optional`:void 0),I(e,`values`,e=>{if(e.def.options.every(e=>e._zod.values))return new Set(e.def.options.flatMap(e=>Array.from(e._zod.values)))}),I(e,`pattern`,e=>{if(e.def.options.every(e=>e._zod.pattern)){let t=e.def.options.map(e=>e._zod.pattern);return RegExp(`^(${t.map(e=>jl(e.source)).join(`|`)})$`)}});let n=t.options.length===1?t.options[0]._zod.run:null;e._zod.parse=(r,i)=>{if(n)return n(r,i);let a=!1,o=[];for(let e of t.options){let t=e._zod.run({value:r.value,issues:[]},i);if(t instanceof Promise)o.push(t),a=!0;else{if(t.issues.length===0)return t;o.push(t)}}return a?Promise.all(o).then(t=>Cp(t,r,e,i)):Cp(o,r,e,i)}});function Tp(e){let t=new Map;for(let n of e.options){let r=n._zod.propValues?.[e.discriminator];if(!r||r.size===0)throw Error(`Invalid discriminated union option at index "${e.options.indexOf(n)}"`);for(let e of r)if(t.has(e)){if(e!==void 0)throw Error(`Duplicate discriminator value "${String(e)}"`);t.set(e,null)}else t.set(e,n)}return t}var Ep=L(`$ZodDiscriminatedUnion`,(e,t)=>{t.inclusive=!1,wp.init(e,t);let n=e._zod.parse;I(e,`propValues`,e=>{let t={},n=0;for(let r of e.def.options){let i=r._zod.propValues;if(!i||Object.keys(i).length===0)throw Error(`Invalid discriminated union option at index "${e.def.options.indexOf(r)}"`);i[e.def.discriminator]?.has(void 0)&&n++;for(let[e,n]of Object.entries(i)){Object.prototype.hasOwnProperty.call(t,e)||Fl(t,e,new Set);for(let r of n)t[e].add(r)}}return!e.def.unionFallback&&n>1&&t[e.def.discriminator]?.delete(void 0),t}),t.options.forEach((e,n)=>{let r=Il(e._zod.def);if(r&&!Object.prototype.hasOwnProperty.call(r,t.discriminator))throw Error(`Invalid discriminated union option at index "${n}"`)});let r=kl(()=>Tp(t));e._zod.parse=(i,a)=>{let o=i.value;if(!Kl(o))return i.issues.push({code:`invalid_type`,expected:`object`,input:o,inst:e}),i;let s=o?.[t.discriminator],c=r.value.get(s);return c&&(s!==void 0||a.direction!==`backward`)?c._zod.run(i,a):t.unionFallback||a.direction===`backward`?n(i,a):(i.issues.push({code:`invalid_union`,errors:[],note:`No matching discriminator`,discriminator:t.discriminator,options:Array.from(r.value.keys()).filter(e=>r.value.get(e)!==null),input:o,path:[t.discriminator],inst:e}),i)}}),Dp=L(`$ZodIntersection`,(e,t)=>{vf.init(e,t),e._zod.parse=(e,n)=>{let r=e.value,i=t.left._zod.run({value:r,issues:[]},n),a=t.right._zod.run({value:r,issues:[]},n);return i instanceof Promise||a instanceof Promise?Promise.all([i,a]).then(([t,n])=>kp(e,t,n)):kp(e,i,a)}});function Op(e,t){if(e===t||e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(Jl(e)&&Jl(t)){let n=Object.keys(t),r=Object.keys(e).filter(e=>n.indexOf(e)!==-1),i={...e,...t};Object.prototype.hasOwnProperty.call(i,`__proto__`)&&delete i.__proto__;for(let n of r){if(n===`__proto__`)continue;let r=Op(e[n],t[n]);if(!r.valid)return{valid:!1,mergeErrorPath:[n,...r.mergeErrorPath]};i[n]=r.data}return{valid:!0,data:i}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};let n=[];for(let r=0;r{let n;if(e.code===`unrecognized_keys`&&!e.path?.length)i??=e,n=e.keys;else if(e.code===`invalid_key`&&e.origin===`record`&&e.path?.length===1){let t=String(e.path[0]);a.has(t)||a.set(t,e),n=[t]}else return!1;for(let e of n)r.has(e)||r.set(e,{}),r.get(e)[t]=!0;return!0};for(let n of t.issues)o(n,`l`)||e.issues.push(n);for(let t of n.issues)o(t,`r`)||e.issues.push(t);let s=[...r].filter(([,e])=>e.l&&e.r).map(([e])=>e);if(s.length){let t=i?s.filter(e=>i.keys.includes(e)):[];t.length&&e.issues.push({...i,keys:t});for(let n of s)!t.includes(n)&&a.has(n)&&e.issues.push(a.get(n))}let c=Op(t.value,n.value);if(!c.valid){if(fu(e))return e;throw Error(`Unmergable intersection. Error path: ${JSON.stringify(c.mergeErrorPath)}`)}return e.value=c.data,e}var Ap=L(`$ZodRecord`,(e,t)=>{vf.init(e,t);let n=Vu.memoizer;n?.attach(e),e._zod.parse=(r,i)=>{let a=r.value;if(!Jl(a))return r.issues.push({expected:`record`,code:`invalid_type`,input:a,inst:e}),r;let o=[],s=t.keyType._zod.values;if(s&&!t.partial){r.value=n?n.alloc(e,r,{},i):{};let c=new Set;for(let n of s)if(typeof n==`string`||typeof n==`number`||typeof n==`symbol`){if(c.add(typeof n==`number`?n.toString():n),n===`__proto__`)continue;let s=t.keyType._zod.run({value:n,issues:[]},i);if(s instanceof Promise)throw Error(`Async schemas not supported in object keys currently`);if(s.issues.length){r.issues.push({code:`invalid_key`,origin:`record`,issues:s.issues.map(e=>gu(e,i,Hu())),input:n,path:[n],inst:e});continue}let l=s.value;if(l===`__proto__`)continue;let u=t.valueType._zod.run({value:a[n],issues:[]},i);u instanceof Promise?o.push(u.then(e=>{e.issues.length&&r.issues.push(...mu(n,e.issues)),r.value[l]=e.value})):(u.issues.length&&r.issues.push(...mu(n,u.issues)),r.value[l]=u.value)}let l;for(let e in a)if(!c.has(e)){if(t.mode===`loose`){if(e===`__proto__`)continue;r.value[e]=a[e]}else l??=[],l.push(e)}l&&l.length>0&&r.issues.push({code:`unrecognized_keys`,input:a,inst:e,keys:l,continue:!0})}else{r.value=n?n.alloc(e,r,{},i):{};let c;for(let n of Reflect.ownKeys(a)){if(n===`__proto__`||!Object.prototype.propertyIsEnumerable.call(a,n))continue;let l=t.keyType._zod.run({value:n,issues:[]},i);if(l instanceof Promise)throw Error(`Async schemas not supported in object keys currently`);if(typeof n==`string`&&Gd.test(n)&&l.issues.length){let e=t.keyType._zod.run({value:Number(n),issues:[]},i);if(e instanceof Promise)throw Error(`Async schemas not supported in object keys currently`);e.issues.length===0&&(l=e)}if(l.issues.length){t.mode===`loose`?r.value[n]=a[n]:s?(c??=[],c.push(n)):r.issues.push({code:`invalid_key`,origin:`record`,issues:l.issues.map(e=>gu(e,i,Hu())),input:n,path:[n],inst:e});continue}let u=l.value;if(u===`__proto__`)continue;let d=t.valueType._zod.run({value:a[n],issues:[]},i);d instanceof Promise?o.push(d.then(e=>{e.issues.length&&r.issues.push(...mu(n,e.issues)),r.value[u]=e.value})):(d.issues.length&&r.issues.push(...mu(n,d.issues)),r.value[u]=d.value)}c&&c.length>0&&r.issues.push({code:`unrecognized_keys`,input:a,inst:e,keys:c,continue:!0})}return o.length?Promise.all(o).then(()=>r):r}}),jp=L(`$ZodEnum`,(e,t)=>{vf.init(e,t);let n=Tl(t.entries),r=new Set(n);e._zod.values=r,I(e,`pattern`,e=>{let t=Tl(e.def.entries).filter(e=>Xl.has(typeof e));return RegExp(t.length?`^(${t.map(e=>Zl(e.toString())).join(`|`)})$`:`^[^\\s\\S]$`)}),e._zod.parse=(t,i)=>{let a=t.value;return r.has(a)||t.issues.push({code:`invalid_value`,values:n,input:a,inst:e}),t}}),Mp=L(`$ZodLiteral`,(e,t)=>{vf.init(e,t);let n=new Set(t.values);e._zod.values=n,I(e,`pattern`,e=>{let t=e.def.values;return RegExp(t.length?`^(${t.map(e=>typeof e==`string`?Zl(e):e?Zl(e.toString()):String(e)).join(`|`)})$`:`^[^\\s\\S]$`)}),e._zod.parse=(r,i)=>{let a=r.value;return n.has(a)||r.issues.push({code:`invalid_value`,values:t.values,input:a,inst:e}),r}}),Np=L(`$ZodTransform`,(e,t)=>{vf.init(e,t),e._zod.optin=`optional`,Vu.memoizer?.guard(e),e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new Bu(e.constructor.name);let i=t.transform(n.value,n);if(r.async)return(i instanceof Promise?i:Promise.resolve(i)).then(e=>(n.value=e,n));if(i instanceof Promise)throw new zu;return n.value=i,n}});function Pp(e,t){return e.value=t.issues.length?void 0:t.value,e}var Fp=L(`$ZodOptional`,(e,t)=>{vf.init(e,t),I(e,`optin`,e=>e.def.innerType._zod.optin===`defaulted`?`defaulted`:`optional`),e._zod.optout=`optional`,I(e,`values`,e=>{let t=e.def.innerType._zod.values;return t?new Set([...t,void 0]):void 0}),I(e,`pattern`,e=>{let t=e.def.innerType._zod.pattern;return t?RegExp(`^(${jl(t.source)})?$`):void 0}),e._zod.parse=(e,n)=>{if(e.value===void 0){if(t.innerType._zod.optin!==`defaulted`)return e;let r=t.innerType._zod.run({value:e.value,issues:[]},n);return r instanceof Promise?r.then(t=>Pp(e,t)):Pp(e,r)}return t.innerType._zod.run(e,n)}}),Ip=L(`$ZodExactOptional`,(e,t)=>{Fp.init(e,t),I(e,`values`,e=>e.def.innerType._zod.values),I(e,`pattern`,e=>e.def.innerType._zod.pattern),e._zod.parse=(e,n)=>t.innerType._zod.run(e,n)}),Lp=L(`$ZodNullable`,(e,t)=>{vf.init(e,t),I(e,`optin`,e=>e.def.innerType._zod.optin),I(e,`optout`,e=>e.def.innerType._zod.optout),I(e,`pattern`,e=>{let t=e.def.innerType._zod.pattern;return t?RegExp(`^(${jl(t.source)}|null)$`):void 0}),I(e,`values`,e=>e.def.innerType._zod.values?new Set([...e.def.innerType._zod.values,null]):void 0),e._zod.parse=(e,n)=>e.value===null?e:t.innerType._zod.run(e,n)}),Rp=L(`$ZodDefault`,(e,t)=>{vf.init(e,t),e._zod.optin=`defaulted`,I(e,`values`,e=>e.def.innerType._zod.values),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);if(e.value===void 0)return e.value=t.defaultValue,e;let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(e=>zp(e,t)):zp(r,t)}});function zp(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}var Bp=L(`$ZodPrefault`,(e,t)=>{vf.init(e,t),e._zod.optin=`defaulted`,I(e,`values`,e=>e.def.innerType._zod.values),e._zod.parse=(e,n)=>(n.direction===`backward`||e.value===void 0&&(e.value=t.defaultValue),t.innerType._zod.run(e,n))}),Vp=L(`$ZodNonOptional`,(e,t)=>{vf.init(e,t),I(e,`values`,e=>{let t=e.def.innerType._zod.values;return t?new Set([...t].filter(e=>e!==void 0)):void 0}),e._zod.parse=(n,r)=>{let i=t.innerType._zod.run(n,r);return i instanceof Promise?i.then(t=>Hp(t,e)):Hp(i,e)}});function Hp(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:`invalid_type`,expected:`nonoptional`,input:e.value,inst:t}),e}function Up(e,t,n,r){return t.issues.length?(e.value=n.catchValue({...t,value:e.value,error:{issues:t.issues.map(e=>gu(e,r,Hu()))},input:e.value}),e):(e.value=t.value,t.memo&&(e.memo=!0),e)}var Wp=L(`$ZodCatch`,(e,t)=>{vf.init(e,t),I(e,`optin`,e=>e.def.innerType._zod.optin===`defaulted`?`defaulted`:`optional`),I(e,`optout`,e=>e.def.innerType._zod.optout),I(e,`values`,e=>e.def.innerType._zod.values),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);let r=t.innerType._zod.run({value:e.value,issues:[]},n);return r instanceof Promise?r.then(r=>Up(e,r,t,n)):Up(e,r,t,n)}}),Gp=L(`$ZodPipe`,(e,t)=>{vf.init(e,t),I(e,`values`,e=>e.def.in._zod.values),I(e,`optin`,e=>e.def.in._zod.optin),I(e,`optout`,e=>e.def.out._zod.optout),I(e,`propValues`,e=>e.def.in._zod.propValues),e._zod.parse=(e,n)=>{if(n.direction===`backward`){let r=t.out._zod.run(e,n);return r instanceof Promise?r.then(e=>Kp(e,t.in,n)):Kp(r,t.in,n)}let r=t.in._zod.run(e,n);return r instanceof Promise?r.then(e=>Kp(e,t.out,n)):Kp(r,t.out,n)}});function Kp(e,t,n){return e.issues.some(e=>e.code!==`unrecognized_keys`)?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},n)}var qp=L(`$ZodPreprocess`,(e,t)=>{Gp.init(e,t)}),Jp=L(`$ZodReadonly`,(e,t)=>{vf.init(e,t),I(e,`propValues`,e=>e.def.innerType._zod.propValues),I(e,`values`,e=>e.def.innerType._zod.values),I(e,`optin`,e=>e.def.innerType?._zod?.optin),I(e,`optout`,e=>e.def.innerType?._zod?.optout),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(Yp):Yp(r)}});function Yp(e){return e.memo||(e.value=Object.freeze(e.value)),e}var Xp=L(`$ZodLazy`,(e,t)=>{vf.init(e,t),Pl(e._zod,`innerType`,()=>{let e=t;return e._cachedInner||=t.getter(),e._cachedInner}),I(e,`pattern`,e=>e.innerType?._zod?.pattern),I(e,`propValues`,e=>e.innerType?._zod?.propValues),I(e,`optin`,e=>e.innerType?._zod?.optin??void 0),I(e,`optout`,e=>e.innerType?._zod?.optout??void 0),e._zod.parse=(t,n)=>e._zod.innerType._zod.run(t,n)}),Zp=L(`$ZodCustom`,(e,t)=>{Zd.init(e,t),vf.init(e,t),e._zod.parse=(e,t)=>e,e._zod.check=n=>{let r=n.value,i=t.fn(r);if(i instanceof Promise)return i.then(t=>Qp(t,n,r,e));Qp(i,n,r,e)}});function Qp(e,t,n,r){if(!e){let e={code:`custom`,input:n,inst:r,path:[...r._zod.def.path??[]],continue:!r._zod.def.abort};r._zod.def.params&&(e.params=r._zod.def.params),t.issues.push(xu(e))}}var $p=class extends Error{constructor(){super(`Cannot parse a reference cycle that closes through a transform`),this.name=`ZodCyclicError`}},em=`~memo`,tm=[];function nm(e){return typeof e==`object`&&!!e}function rm(e){return e.map(e=>e.path?{...e,path:e.path.slice()}:{...e})}var im=new WeakMap,am=0,om=1,sm=2;function cm(e,t,n){let r=im.get(e);if(r!==void 0)return r?sm:am;if(t.has(e))return sm;t.add(e);let i=am,a=e=>{if(i!==sm&&e?._zod){let r=cm(e,t,n);r>i&&(i=r)}},o=(e,r)=>{let i=am;for(let a of Reflect.ownKeys(e)){let o=Object.getOwnPropertyDescriptor(e,a);if(r&&!o.enumerable)continue;let s=o.get?om:o.value?._zod?cm(o.value,t,n):am;s>i&&(i=s)}return i},s=e=>{e>i&&(i=e)},c=e._zod.def;switch(c.type){case`object`:{let e=Il(c);s(e?o(e,!0):om),a(c.catchall);break}case`array`:a(c.element);break;case`tuple`:for(let e of c.items)a(e);a(c.rest);break;case`record`:case`map`:a(c.keyType),a(c.valueType);break;case`set`:a(c.valueType);break;case`union`:for(let e of c.options)a(e);break;case`intersection`:a(c.left),a(c.right);break;case`optional`:case`nullable`:case`default`:case`prefault`:case`catch`:case`readonly`:case`nonoptional`:case`promise`:case`success`:a(c.innerType);break;case`pipe`:a(c.in),a(c.out);break;case`function`:a(c.input),a(c.output);break;case`lazy`:{let r=c._cachedInner??(n?e._zod.innerType:void 0);s(r?cm(r,t,!1):om);break}case`template_literal`:case`string`:case`number`:case`int`:case`boolean`:case`bigint`:case`symbol`:case`undefined`:case`null`:case`void`:case`never`:case`any`:case`unknown`:case`date`:case`nan`:case`enum`:case`literal`:case`file`:case`transform`:case`custom`:break;default:for(let e in c){let t=Object.getOwnPropertyDescriptor(c,e);if(!t||t.get)continue;let n=t.value;if(n&&typeof n==`object`){if(n._zod)a(n);else if(Array.isArray(n))for(let e of n)a(e)}}}return t.delete(e),lm(e,i)}function lm(e,t){return t!==om&&im.set(e,t===sm),t}function um(e,t){let n=e.buckets.get(t);return n||(n=new WeakMap,e.buckets.set(t,n)),n}var dm,fm=[],pm={alloc(e,t,n){let r=dm;if(!r)return n;dm=void 0;let i={value:n,issues:null};return r.set(t.value,i),fm.push(i),n},guard(e){var t;(t=e._zod).deferred??(t.deferred=[]),e._zod.deferred.push(()=>{let t=e._zod.parse,n=(e,n)=>{if(n.direction!==`backward`&&hm(n,e.value))throw new $p;return t(e,n)};e._zod.parse=n,e._zod.run===t&&(e._zod.run=n)})},attach(e){var t;let n,r=!1,i,a;(t=e._zod).deferred??(t.deferred=[]),e._zod.deferred.push(()=>{let t=e._zod.parse,o=(s,c)=>{if(n===void 0){let i=cm(e,new Set,!1);if(i===am)return e._zod.parse=t,e._zod.run===o&&(e._zod.run=t),t(s,c);i===sm||r?n=!0:r=!0}let l=s.value;if(!nm(l))return t(s,c);let u=c[em];u||(u={buckets:new WeakMap,backEdges:void 0},c[em]=u);let d;i===c?d=a:(d=um(u,e),i=c,a=d);let f=d.get(l);if(f)return s.value=f.value,f.issues?f.issues.length&&s.issues.push(...rm(f.issues)):(s.memo=!0,u.backEdges??(u.backEdges=new WeakSet),u.backEdges.add(f.value)),s;dm=d;let p=fm.length,m=t(s,c);dm=void 0;let h=fm.length>p?fm.pop():void 0;return m instanceof Promise?m.then(e=>(h&&(h.issues=e.issues.length?rm(e.issues):tm),e)):(h&&(h.issues=m.issues.length?rm(m.issues):tm),m)};e._zod.parse=o,e._zod.run===t&&(e._zod.run=o)})}};function mm(){return pm}function hm(e,t){let n=e[em]?.backEdges;return n!==void 0&&nm(t)&&n.has(t)}var gm=()=>{let e={string:{unit:`characters`,verb:`to have`},file:{unit:`bytes`,verb:`to have`},array:{unit:`items`,verb:`to have`},set:{unit:`items`,verb:`to have`},map:{unit:`entries`,verb:`to have`}};function t(t){return e[t]??null}let n={regex:`input`,email:`email address`,url:`URL`,emoji:`emoji`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`ISO datetime`,date:`ISO date`,time:`ISO time`,duration:`ISO duration`,ipv4:`IPv4 address`,ipv6:`IPv6 address`,mac:`MAC address`,cidrv4:`IPv4 range`,cidrv6:`IPv6 range`,base64:`base64-encoded string`,base64url:`base64url-encoded string`,json_string:`JSON string`,e164:`E.164 number`,currency_code:`currency code`,credit_card:`credit card number`,iban:`IBAN`,jwt:`JWT`,template_literal:`input`},r={nan:`NaN`};function i(e,t){return e===`number`&&typeof t==`number`&&!Number.isFinite(t)?String(t):r[e]??e}return e=>{switch(e.code){case`invalid_type`:return`Invalid input: expected ${i(e.expected)}, received ${i(bu(e.input),e.input)}`;case`invalid_value`:return e.values.length===1?`Invalid input: expected ${$l(e.values[0])}`:`Invalid option: expected one of ${El(e.values,`|`)}`;case`too_big`:{let n=e.exact?`exactly `:e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Too big: expected ${e.origin??`value`} to have ${n}${e.maximum.toString()} ${r.unit??`elements`}`:`Too big: expected ${e.origin??`value`} to be ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.exact?`exactly `:e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Too small: expected ${e.origin} to have ${n}${e.minimum.toString()} ${r.unit}`:`Too small: expected ${e.origin} to be ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Invalid string: must start with "${t.prefix}"`:t.format===`ends_with`?`Invalid string: must end with "${t.suffix}"`:t.format===`includes`?`Invalid string: must include "${t.includes}"`:t.format===`regex`?`Invalid string: must match pattern ${t.pattern}`:`Invalid ${n[t.format]??e.format}`}case`not_multiple_of`:return`Invalid number: must be a multiple of ${e.divisor}`;case`unrecognized_keys`:return`Unrecognized key${e.keys.length>1?`s`:``}: ${El(e.keys,`, `)}`;case`invalid_key`:return`Invalid key in ${e.origin}`;case`invalid_union`:return e.options&&Array.isArray(e.options)&&e.options.length>0?`Invalid discriminator value. Expected ${e.options.map(e=>`'${e}'`).join(` | `)}`:e.inclusive===!1?`Invalid input: more than one option matched`:`Invalid input`;case`invalid_element`:return`Invalid value in ${e.origin}`;default:return`Invalid input`}}};function _m(){return{localeError:gm()}}var vm,ym=class{constructor(){this._map=new WeakMap,this._idmap=new Map}add(e,...t){let n=t[0];return this._map.set(e,n),n&&typeof n==`object`&&`id`in n&&this._idmap.set(n.id,e),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(e){let t=this._map.get(e);return t&&typeof t==`object`&&`id`in t&&this._idmap.delete(t.id),this._map.delete(e),this}get(e){let t=e._zod.parent;if(t){let n={...this.get(t)??{}};delete n.id;let r={...n,...this._map.get(e)};return Object.keys(r).length?r:void 0}return this._map.get(e)}has(e){return this._map.has(e)}};function bm(){return new ym}(vm=globalThis).__zod_globalRegistry??(vm.__zod_globalRegistry=bm());var xm=globalThis.__zod_globalRegistry;function Sm(e){return e.checks&&=[...e.checks],e}function Cm(e,t){return new e(Sm({type:`string`,...P(t)}))}function wm(e,t){return new e({type:`string`,format:`email`,check:`string_format`,abort:!1,...P(t)})}function Tm(e,t){return new e({type:`string`,format:`guid`,check:`string_format`,abort:!1,...P(t)})}function Em(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,...P(t)})}function Dm(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v4`,...P(t)})}function Om(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v6`,...P(t)})}function km(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v7`,...P(t)})}function Am(e,t){return new e({type:`string`,format:`url`,check:`string_format`,abort:!1,...P(t)})}function jm(e,t){return new e({type:`string`,format:`emoji`,check:`string_format`,abort:!1,...P(t)})}function Mm(e,t){return new e({type:`string`,format:`nanoid`,check:`string_format`,abort:!1,...P(t)})}function Nm(e,t){return new e({type:`string`,format:`cuid`,check:`string_format`,abort:!1,...P(t)})}function Pm(e,t){return new e({type:`string`,format:`cuid2`,check:`string_format`,abort:!1,...P(t)})}function Fm(e,t){return new e({type:`string`,format:`ulid`,check:`string_format`,abort:!1,...P(t)})}function Im(e,t){return new e({type:`string`,format:`xid`,check:`string_format`,abort:!1,...P(t)})}function Lm(e,t){return new e({type:`string`,format:`ksuid`,check:`string_format`,abort:!1,...P(t)})}function Rm(e,t){return new e({type:`string`,format:`ipv4`,check:`string_format`,abort:!1,...P(t)})}function zm(e,t){return new e({type:`string`,format:`ipv6`,check:`string_format`,abort:!1,...P(t)})}function Bm(e,t){return new e({type:`string`,format:`cidrv4`,check:`string_format`,abort:!1,...P(t)})}function Vm(e,t){return new e({type:`string`,format:`cidrv6`,check:`string_format`,abort:!1,...P(t)})}function Hm(e,t){return new e({type:`string`,format:`base64`,check:`string_format`,abort:!1,...P(t)})}function Um(e,t){return new e({type:`string`,format:`base64url`,check:`string_format`,abort:!1,...P(t)})}function Wm(e,t){return new e({type:`string`,format:`e164`,check:`string_format`,abort:!1,...P(t)})}function Gm(e,t){return new e({type:`string`,format:`jwt`,check:`string_format`,abort:!1,...P(t)})}function Km(e,t){return new e({type:`string`,format:`datetime`,check:`string_format`,offset:!1,local:!1,precision:null,...P(t)})}function qm(e,t){return new e({type:`string`,format:`date`,check:`string_format`,...P(t)})}function Jm(e,t){return new e({type:`string`,format:`time`,check:`string_format`,precision:null,...P(t)})}function Ym(e,t){return new e({type:`string`,format:`duration`,check:`string_format`,...P(t)})}function Xm(e,t){return new e(Sm({type:`number`,checks:[],...P(t)}))}function Zm(e,t){return new e(Sm({type:`number`,coerce:!0,checks:[],...P(t)}))}function Qm(e,t){return new e({type:`number`,check:`number_format`,abort:!1,format:`safeint`,...P(t)})}function $m(e,t){return new e({type:`boolean`,...P(t)})}function eh(e,t){return new e({type:`undefined`,...P(t)})}function th(e,t){return new e({type:`null`,...P(t)})}function nh(e){return new e({type:`any`})}function rh(e){return new e({type:`unknown`})}function ih(e,t){return new e({type:`never`,...P(t)})}function ah(e,t){return new ef({check:`less_than`,...P(t),value:e,inclusive:!1})}function oh(e,t){return new ef({check:`less_than`,...P(t),value:e,inclusive:!0})}function sh(e,t){return new tf({check:`greater_than`,...P(t),value:e,inclusive:!1})}function ch(e,t){return new tf({check:`greater_than`,...P(t),value:e,inclusive:!0})}function lh(e,t){return new nf({check:`multiple_of`,...P(t),value:e})}function uh(e,t){return new af({check:`max_length`,...P(t),maximum:e})}function dh(e,t){return new of({check:`min_length`,...P(t),minimum:e})}function fh(e,t){return new sf({check:`length_equals`,...P(t),length:e})}function ph(e,t){return new lf({check:`string_format`,format:`regex`,...P(t),pattern:e})}function mh(e){return new uf({check:`string_format`,format:`lowercase`,...P(e)})}function hh(e){return new df({check:`string_format`,format:`uppercase`,...P(e)})}function gh(e,t){return new ff({check:`string_format`,format:`includes`,...P(t),includes:e})}function _h(e,t){return new pf({check:`string_format`,format:`starts_with`,...P(t),prefix:e})}function vh(e,t){return new mf({check:`string_format`,format:`ends_with`,...P(t),suffix:e})}function yh(e){return new hf({check:`overwrite`,tx:e})}function bh(e){return yh(t=>t.normalize(e))}function xh(){return yh(e=>e.trim())}function Sh(){return yh(e=>e.toLowerCase())}function Ch(){return yh(e=>e.toUpperCase())}function wh(){return yh(e=>Wl(e))}function Th(e,t,n){return new e({type:`array`,element:t,...P(n)})}function Eh(e,t,n){let r=P(n);return r.abort??=!0,new e({type:`custom`,check:`custom`,fn:t,...r})}function Dh(e,t,n){return new e({type:`custom`,check:`custom`,fn:t,...P(n)})}function Oh(e,t){let n=kh(t=>(t.addIssue=e=>{if(typeof e==`string`)t.issues.push(xu(e,t.value,n._zod.def));else{let r=e;r.fatal&&(r.continue=!1),r.code??=`custom`,`input`in r||(r.input=t.value),r.inst??=n,r.continue??=!n._zod.def.abort,t.issues.push(xu(r))}},e(t.value,t)),t);return n}function kh(e,t){let n=new Zd({check:`custom`,...P(t)});return n._zod.check=e,n}function Ah(e,...t){for(let n of t)for(let t of Reflect.ownKeys(n))Object.prototype.propertyIsEnumerable.call(n,t)&&Fl(e,t,n[t]);return e}function jh(e){let t=e?.target??`draft-2020-12`;return t===`draft-4`&&(t=`draft-04`),t===`draft-7`&&(t=`draft-07`),{processors:e.processors??{},metadataRegistry:e?.metadata??xm,target:t,unrepresentable:e?.unrepresentable??`throw`,override:e?.override??(()=>{}),io:e?.io??`output`,counter:0,seen:new Map,sharedDefsExtractedFor:void 0,sharedEmitDoneFor:void 0,cycles:e?.cycles??`ref`,reused:e?.reused??`inline`,intersections:[],deferred:[],external:e?.external??void 0}}function Mh(e,t,n,r,i){let a=typeof t.unrepresentable==`function`?t.unrepresentable({zodSchema:e,path:r.path,message:i}):t.unrepresentable;if(a===`any`)return!1;if(a===void 0||a===`throw`)throw Error(i);return Object.assign(n,a),!0}function Nh(e,t,n={path:[],schemaPath:[]}){var r;let i=e._zod.def,a=t.seen.get(e);if(a)return a.count++,n.schemaPath.includes(e)&&(a.cycle=n.path),a.schema;let o={schema:{},count:1,cycle:void 0,path:n.path};t.seen.set(e,o),t.sharedDefsExtractedFor=void 0,t.sharedEmitDoneFor=void 0;let s=e._zod.toJSONSchema?.();if(s)o.schema=s;else{let r={...n,schemaPath:[...n.schemaPath,e],path:n.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,o.schema,r);else{let n=o.schema,a=t.processors[i.type];if(!a)throw Error(`[toJSONSchema]: Non-representable type encountered: ${i.type}`);a(e,t,n,r)}let a=e._zod.parent;a&&(o.ref||=a,Nh(a,t,r),t.seen.get(a).isParent=!0)}let c=t.metadataRegistry.get(e);return c&&Ah(o.schema,c),t.io===`input`&&Uh(e)&&(delete o.schema.examples,delete o.schema.default),t.io===`input`&&`_prefault`in o.schema&&((r=o.schema).default??(r.default=o.schema._prefault)),delete o.schema._prefault,t.seen.get(e).schema}function Ph(e){return e.replace(/~/g,`~0`).replace(/\//g,`~1`)}function Fh(e,t){let n=e.seen.get(t);if(!n)throw Error(`Unprocessed schema. This is a bug in Zod.`);if(e.external&&e.sharedDefsExtractedFor===e.external)return;let r=new Map;for(let t of e.seen.entries()){let n=e.metadataRegistry.get(t[0])?.id;if(n){let e=r.get(n);if(e&&e!==t[0])throw Error(`Duplicate schema id "${n}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);r.set(n,t[0])}}let i=t=>{let r=e.target===`draft-2020-12`?`$defs`:`definitions`;if(e.external){let n=e.external.registry.get(t[0])?.id,i=e.external.uri??(e=>e);if(n)return{ref:i(n)};let a=t[1].defId??t[1].schema.id??`schema${e.counter++}`;return t[1].defId=a,{defId:a,ref:`${i(`__shared`)}#/${r}/${Ph(a)}`}}let i=`#/${r}/`;if(t[1]===n&&!t[1].schema.id)return{ref:`#`};let a=t[1].schema.id??`__schema${e.counter++}`;return{defId:a,ref:i+Ph(a)}},a=e=>{if(e[1].schema.$ref)return;let t=e[1],{ref:n,defId:r}=i(e);t.def={...t.schema},r&&(t.defId=r);let a=t.schema;for(let e in a)delete a[e];a.$ref=n};if(e.cycles===`throw`)for(let t of e.seen.entries()){let e=t[1];if(e.cycle)throw Error(`Cycle detected: #/${e.cycle?.join(`/`)}/ + `)}return o.write(`payload.value = newResult;`),o.write(`return payload;`),o.compile()},o,s=Kl,c=!Hu.jitless,l=c&&ql.value,u=t.catchall,d;e._zod.parse=(i,f)=>{d??=r.value;let p=i.value;return s(p)?c&&l&&f?.async===!1&&f.jitless!==!0?(o||=a(t.shape),i=o(i,f),u?xp([],p,i,f,d,e,f?.abortEarly===!0):i):n(i,f):(i.issues.push({expected:`object`,code:`invalid_type`,input:p,inst:e}),i)}});function wp(e,t,n,r){for(let n of e)if(n.issues.length===0)return t.value=n.value,t;let i=e.filter(e=>!fu(e));return i.length===1?(t.value=i[0].value,i[0]):(t.issues.push({code:`invalid_union`,input:t.value,inst:n,errors:e.map(e=>e.issues.map(e=>_u(e,r,Uu())))}),t)}var Tp=I(`$ZodUnion`,(e,t)=>{yf.init(e,t),F(e,`optin`,e=>e.def.options.some(e=>e._zod.optin===`defaulted`)?`defaulted`:e.def.options.some(e=>e._zod.optin!==void 0)?`optional`:void 0),F(e,`optout`,e=>e.def.options.some(e=>e._zod.optout===`optional`)?`optional`:void 0),F(e,`values`,e=>{if(e.def.options.every(e=>e._zod.values))return new Set(e.def.options.flatMap(e=>Array.from(e._zod.values)))}),F(e,`pattern`,e=>{if(e.def.options.every(e=>e._zod.pattern)){let t=e.def.options.map(e=>e._zod.pattern);return RegExp(`^(${t.map(e=>jl(e.source)).join(`|`)})$`)}});let n=t.options.length===1?t.options[0]._zod.run:null;e._zod.parse=(r,i)=>{if(n)return n(r,i);let a=!1,o=[];for(let e of t.options){let t=e._zod.run({value:r.value,issues:[]},i);if(t instanceof Promise)o.push(t),a=!0;else{if(t.issues.length===0)return t;o.push(t)}}return a?Promise.all(o).then(t=>wp(t,r,e,i)):wp(o,r,e,i)}});function Ep(e){let t=new Map;for(let n of e.options){let r=n._zod.propValues?.[e.discriminator];if(!r||r.size===0)throw Error(`Invalid discriminated union option at index "${e.options.indexOf(n)}"`);for(let e of r)if(t.has(e)){if(e!==void 0)throw Error(`Duplicate discriminator value "${String(e)}"`);t.set(e,null)}else t.set(e,n)}return t}var Dp=I(`$ZodDiscriminatedUnion`,(e,t)=>{t.inclusive=!1,Tp.init(e,t);let n=e._zod.parse;F(e,`propValues`,e=>{let t={},n=0;for(let r of e.def.options){let i=r._zod.propValues;if(!i||Object.keys(i).length===0)throw Error(`Invalid discriminated union option at index "${e.def.options.indexOf(r)}"`);i[e.def.discriminator]?.has(void 0)&&n++;for(let[e,n]of Object.entries(i)){Object.prototype.hasOwnProperty.call(t,e)||Fl(t,e,new Set);for(let r of n)t[e].add(r)}}return!e.def.unionFallback&&n>1&&t[e.def.discriminator]?.delete(void 0),t}),t.options.forEach((e,n)=>{let r=Il(e._zod.def);if(r&&!Object.prototype.hasOwnProperty.call(r,t.discriminator))throw Error(`Invalid discriminated union option at index "${n}"`)});let r=kl(()=>Ep(t));e._zod.parse=(i,a)=>{let o=i.value;if(!Kl(o))return i.issues.push({code:`invalid_type`,expected:`object`,input:o,inst:e}),i;let s=o?.[t.discriminator],c=r.value.get(s);return c&&(s!==void 0||a.direction!==`backward`)?c._zod.run(i,a):t.unionFallback||a.direction===`backward`?n(i,a):(i.issues.push({code:`invalid_union`,errors:[],note:`No matching discriminator`,discriminator:t.discriminator,options:Array.from(r.value.keys()).filter(e=>r.value.get(e)!==null),input:o,path:[t.discriminator],inst:e}),i)}}),Op=I(`$ZodIntersection`,(e,t)=>{yf.init(e,t),e._zod.parse=(e,n)=>{let r=e.value,i=t.left._zod.run({value:r,issues:[]},n),a=t.right._zod.run({value:r,issues:[]},n);return i instanceof Promise||a instanceof Promise?Promise.all([i,a]).then(([t,n])=>Ap(e,t,n)):Ap(e,i,a)}});function kp(e,t){if(e===t||e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(Jl(e)&&Jl(t)){let n=Object.keys(t),r=Object.keys(e).filter(e=>n.indexOf(e)!==-1),i={...e,...t};Object.prototype.hasOwnProperty.call(i,`__proto__`)&&delete i.__proto__;for(let n of r){if(n===`__proto__`)continue;let r=kp(e[n],t[n]);if(!r.valid)return{valid:!1,mergeErrorPath:[n,...r.mergeErrorPath]};i[n]=r.data}return{valid:!0,data:i}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};let n=[];for(let r=0;r{let n;if(e.code===`unrecognized_keys`&&!e.path?.length)i??=e,n=e.keys;else if(e.code===`invalid_key`&&e.origin===`record`&&e.path?.length===1){let t=String(e.path[0]);a.has(t)||a.set(t,e),n=[t]}else return!1;for(let e of n)r.has(e)||r.set(e,{}),r.get(e)[t]=!0;return!0};for(let n of t.issues)o(n,`l`)||e.issues.push(n);for(let t of n.issues)o(t,`r`)||e.issues.push(t);let s=[...r].filter(([,e])=>e.l&&e.r).map(([e])=>e);if(s.length){let t=i?s.filter(e=>i.keys.includes(e)):[];t.length&&e.issues.push({...i,keys:t});for(let n of s)!t.includes(n)&&a.has(n)&&e.issues.push(a.get(n))}let c=kp(t.value,n.value);if(!c.valid){if(fu(e))return e;throw Error(`Unmergable intersection. Error path: ${JSON.stringify(c.mergeErrorPath)}`)}return e.value=c.data,e}var jp=I(`$ZodRecord`,(e,t)=>{yf.init(e,t);let n=Hu.memoizer;n?.attach(e),e._zod.parse=(r,i)=>{let a=r.value;if(!Jl(a))return r.issues.push({expected:`record`,code:`invalid_type`,input:a,inst:e}),r;let o=[],s=t.keyType._zod.values;if(s&&!t.partial){r.value=n?n.alloc(e,r,{},i):{};let c=new Set;for(let n of s)if(typeof n==`string`||typeof n==`number`||typeof n==`symbol`){if(c.add(typeof n==`number`?n.toString():n),n===`__proto__`)continue;let s=t.keyType._zod.run({value:n,issues:[]},i);if(s instanceof Promise)throw Error(`Async schemas not supported in object keys currently`);if(s.issues.length){r.issues.push({code:`invalid_key`,origin:`record`,issues:s.issues.map(e=>_u(e,i,Uu())),input:n,path:[n],inst:e});continue}let l=s.value;if(l===`__proto__`)continue;let u=t.valueType._zod.run({value:a[n],issues:[]},i);u instanceof Promise?o.push(u.then(e=>{e.issues.length&&r.issues.push(...mu(n,e.issues)),r.value[l]=e.value})):(u.issues.length&&r.issues.push(...mu(n,u.issues)),r.value[l]=u.value)}let l;for(let e in a)if(!c.has(e)){if(t.mode===`loose`){if(e===`__proto__`)continue;r.value[e]=a[e]}else l??=[],l.push(e)}l&&l.length>0&&r.issues.push({code:`unrecognized_keys`,input:a,inst:e,keys:l,continue:!0})}else{r.value=n?n.alloc(e,r,{},i):{};let c;for(let n of Reflect.ownKeys(a)){if(n===`__proto__`||!Object.prototype.propertyIsEnumerable.call(a,n))continue;let l=t.keyType._zod.run({value:n,issues:[]},i);if(l instanceof Promise)throw Error(`Async schemas not supported in object keys currently`);if(typeof n==`string`&&Kd.test(n)&&l.issues.length){let e=t.keyType._zod.run({value:Number(n),issues:[]},i);if(e instanceof Promise)throw Error(`Async schemas not supported in object keys currently`);e.issues.length===0&&(l=e)}if(l.issues.length){t.mode===`loose`?r.value[n]=a[n]:s?(c??=[],c.push(n)):r.issues.push({code:`invalid_key`,origin:`record`,issues:l.issues.map(e=>_u(e,i,Uu())),input:n,path:[n],inst:e});continue}let u=l.value;if(u===`__proto__`)continue;let d=t.valueType._zod.run({value:a[n],issues:[]},i);d instanceof Promise?o.push(d.then(e=>{e.issues.length&&r.issues.push(...mu(n,e.issues)),r.value[u]=e.value})):(d.issues.length&&r.issues.push(...mu(n,d.issues)),r.value[u]=d.value)}c&&c.length>0&&r.issues.push({code:`unrecognized_keys`,input:a,inst:e,keys:c,continue:!0})}return o.length?Promise.all(o).then(()=>r):r}}),Mp=I(`$ZodEnum`,(e,t)=>{yf.init(e,t);let n=Tl(t.entries),r=new Set(n);e._zod.values=r,F(e,`pattern`,e=>{let t=Tl(e.def.entries).filter(e=>Xl.has(typeof e));return RegExp(t.length?`^(${t.map(e=>Zl(e.toString())).join(`|`)})$`:`^[^\\s\\S]$`)}),e._zod.parse=(t,i)=>{let a=t.value;return r.has(a)||t.issues.push({code:`invalid_value`,values:n,input:a,inst:e}),t}}),Np=I(`$ZodLiteral`,(e,t)=>{yf.init(e,t);let n=new Set(t.values);e._zod.values=n,F(e,`pattern`,e=>{let t=e.def.values;return RegExp(t.length?`^(${t.map(e=>typeof e==`string`?Zl(e):e?Zl(e.toString()):String(e)).join(`|`)})$`:`^[^\\s\\S]$`)}),e._zod.parse=(r,i)=>{let a=r.value;return n.has(a)||r.issues.push({code:`invalid_value`,values:t.values,input:a,inst:e}),r}}),Pp=I(`$ZodTransform`,(e,t)=>{yf.init(e,t),e._zod.optin=`optional`,Hu.memoizer?.guard(e),e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new Vu(e.constructor.name);let i=t.transform(n.value,n);if(r.async)return(i instanceof Promise?i:Promise.resolve(i)).then(e=>(n.value=e,n));if(i instanceof Promise)throw new Bu;return n.value=i,n}});function Fp(e,t){return e.value=t.issues.length?void 0:t.value,e}var Ip=I(`$ZodOptional`,(e,t)=>{yf.init(e,t),F(e,`optin`,e=>e.def.innerType._zod.optin===`defaulted`?`defaulted`:`optional`),e._zod.optout=`optional`,F(e,`values`,e=>{let t=e.def.innerType._zod.values;return t?new Set([...t,void 0]):void 0}),F(e,`pattern`,e=>{let t=e.def.innerType._zod.pattern;return t?RegExp(`^(${jl(t.source)})?$`):void 0}),e._zod.parse=(e,n)=>{if(e.value===void 0){if(t.innerType._zod.optin!==`defaulted`)return e;let r=t.innerType._zod.run({value:e.value,issues:[]},n);return r instanceof Promise?r.then(t=>Fp(e,t)):Fp(e,r)}return t.innerType._zod.run(e,n)}}),Lp=I(`$ZodExactOptional`,(e,t)=>{Ip.init(e,t),F(e,`values`,e=>e.def.innerType._zod.values),F(e,`pattern`,e=>e.def.innerType._zod.pattern),e._zod.parse=(e,n)=>t.innerType._zod.run(e,n)}),Rp=I(`$ZodNullable`,(e,t)=>{yf.init(e,t),F(e,`optin`,e=>e.def.innerType._zod.optin),F(e,`optout`,e=>e.def.innerType._zod.optout),F(e,`pattern`,e=>{let t=e.def.innerType._zod.pattern;return t?RegExp(`^(${jl(t.source)}|null)$`):void 0}),F(e,`values`,e=>e.def.innerType._zod.values?new Set([...e.def.innerType._zod.values,null]):void 0),e._zod.parse=(e,n)=>e.value===null?e:t.innerType._zod.run(e,n)}),zp=I(`$ZodDefault`,(e,t)=>{yf.init(e,t),e._zod.optin=`defaulted`,F(e,`values`,e=>e.def.innerType._zod.values),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);if(e.value===void 0)return e.value=t.defaultValue,e;let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(e=>Bp(e,t)):Bp(r,t)}});function Bp(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}var Vp=I(`$ZodPrefault`,(e,t)=>{yf.init(e,t),e._zod.optin=`defaulted`,F(e,`values`,e=>e.def.innerType._zod.values),e._zod.parse=(e,n)=>(n.direction===`backward`||e.value===void 0&&(e.value=t.defaultValue),t.innerType._zod.run(e,n))}),Hp=I(`$ZodNonOptional`,(e,t)=>{yf.init(e,t),F(e,`values`,e=>{let t=e.def.innerType._zod.values;return t?new Set([...t].filter(e=>e!==void 0)):void 0}),e._zod.parse=(n,r)=>{let i=t.innerType._zod.run(n,r);return i instanceof Promise?i.then(t=>Up(t,e)):Up(i,e)}});function Up(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:`invalid_type`,expected:`nonoptional`,input:e.value,inst:t}),e}function Wp(e,t,n,r){return t.issues.length?(e.value=n.catchValue({...t,value:e.value,error:{issues:t.issues.map(e=>_u(e,r,Uu()))},input:e.value}),e):(e.value=t.value,t.memo&&(e.memo=!0),e)}var Gp=I(`$ZodCatch`,(e,t)=>{yf.init(e,t),F(e,`optin`,e=>e.def.innerType._zod.optin===`defaulted`?`defaulted`:`optional`),F(e,`optout`,e=>e.def.innerType._zod.optout),F(e,`values`,e=>e.def.innerType._zod.values),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);let r=t.innerType._zod.run({value:e.value,issues:[]},n);return r instanceof Promise?r.then(r=>Wp(e,r,t,n)):Wp(e,r,t,n)}}),Kp=I(`$ZodPipe`,(e,t)=>{yf.init(e,t),F(e,`values`,e=>e.def.in._zod.values),F(e,`optin`,e=>e.def.in._zod.optin),F(e,`optout`,e=>e.def.out._zod.optout),F(e,`propValues`,e=>e.def.in._zod.propValues),e._zod.parse=(e,n)=>{if(n.direction===`backward`){let r=t.out._zod.run(e,n);return r instanceof Promise?r.then(e=>qp(e,t.in,n)):qp(r,t.in,n)}let r=t.in._zod.run(e,n);return r instanceof Promise?r.then(e=>qp(e,t.out,n)):qp(r,t.out,n)}});function qp(e,t,n){return e.issues.some(e=>e.code!==`unrecognized_keys`)?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},n)}var Jp=I(`$ZodPreprocess`,(e,t)=>{Kp.init(e,t)}),Yp=I(`$ZodReadonly`,(e,t)=>{yf.init(e,t),F(e,`propValues`,e=>e.def.innerType._zod.propValues),F(e,`values`,e=>e.def.innerType._zod.values),F(e,`optin`,e=>e.def.innerType?._zod?.optin),F(e,`optout`,e=>e.def.innerType?._zod?.optout),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(Xp):Xp(r)}});function Xp(e){return e.memo||(e.value=Object.freeze(e.value)),e}var Zp=I(`$ZodLazy`,(e,t)=>{yf.init(e,t),Pl(e._zod,`innerType`,()=>{let e=t;return e._cachedInner||=t.getter(),e._cachedInner}),F(e,`pattern`,e=>e.innerType?._zod?.pattern),F(e,`propValues`,e=>e.innerType?._zod?.propValues),F(e,`optin`,e=>e.innerType?._zod?.optin??void 0),F(e,`optout`,e=>e.innerType?._zod?.optout??void 0),e._zod.parse=(t,n)=>e._zod.innerType._zod.run(t,n)}),Qp=I(`$ZodCustom`,(e,t)=>{Qd.init(e,t),yf.init(e,t),e._zod.parse=(e,t)=>e,e._zod.check=n=>{let r=n.value,i=t.fn(r);if(i instanceof Promise)return i.then(t=>$p(t,n,r,e));$p(i,n,r,e)}});function $p(e,t,n,r){if(!e){let e={code:`custom`,input:n,inst:r,path:[...r._zod.def.path??[]],continue:!r._zod.def.abort};r._zod.def.params&&(e.params=r._zod.def.params),t.issues.push(Su(e))}}var em=class extends Error{constructor(){super(`Cannot parse a reference cycle that closes through a transform`),this.name=`ZodCyclicError`}},tm=`~memo`,nm=[];function rm(e){return typeof e==`object`&&!!e}function im(e){return e.map(e=>e.path?{...e,path:e.path.slice()}:{...e})}var am=new WeakMap,om=0,sm=1,cm=2;function lm(e,t,n){let r=am.get(e);if(r!==void 0)return r?cm:om;if(t.has(e))return cm;t.add(e);let i=om,a=e=>{if(i!==cm&&e?._zod){let r=lm(e,t,n);r>i&&(i=r)}},o=(e,r)=>{let i=om;for(let a of Reflect.ownKeys(e)){let o=Object.getOwnPropertyDescriptor(e,a);if(r&&!o.enumerable)continue;let s=o.get?sm:o.value?._zod?lm(o.value,t,n):om;s>i&&(i=s)}return i},s=e=>{e>i&&(i=e)},c=e._zod.def;switch(c.type){case`object`:{let e=Il(c);s(e?o(e,!0):sm),a(c.catchall);break}case`array`:a(c.element);break;case`tuple`:for(let e of c.items)a(e);a(c.rest);break;case`record`:case`map`:a(c.keyType),a(c.valueType);break;case`set`:a(c.valueType);break;case`union`:for(let e of c.options)a(e);break;case`intersection`:a(c.left),a(c.right);break;case`optional`:case`nullable`:case`default`:case`prefault`:case`catch`:case`readonly`:case`nonoptional`:case`promise`:case`success`:a(c.innerType);break;case`pipe`:a(c.in),a(c.out);break;case`function`:a(c.input),a(c.output);break;case`lazy`:{let r=c._cachedInner??(n?e._zod.innerType:void 0);s(r?lm(r,t,!1):sm);break}case`template_literal`:case`string`:case`number`:case`int`:case`boolean`:case`bigint`:case`symbol`:case`undefined`:case`null`:case`void`:case`never`:case`any`:case`unknown`:case`date`:case`nan`:case`enum`:case`literal`:case`file`:case`transform`:case`custom`:break;default:for(let e in c){let t=Object.getOwnPropertyDescriptor(c,e);if(!t||t.get)continue;let n=t.value;if(n&&typeof n==`object`){if(n._zod)a(n);else if(Array.isArray(n))for(let e of n)a(e)}}}return t.delete(e),um(e,i)}function um(e,t){return t!==sm&&am.set(e,t===cm),t}function dm(e,t){let n=e.buckets.get(t);return n||(n=new WeakMap,e.buckets.set(t,n)),n}var fm,pm=[],mm={alloc(e,t,n){let r=fm;if(!r)return n;fm=void 0;let i={value:n,issues:null};return r.set(t.value,i),pm.push(i),n},guard(e){var t;(t=e._zod).deferred??(t.deferred=[]),e._zod.deferred.push(()=>{let t=e._zod.parse,n=(e,n)=>{if(n.direction!==`backward`&&gm(n,e.value))throw new em;return t(e,n)};e._zod.parse=n,e._zod.run===t&&(e._zod.run=n)})},attach(e){var t;let n,r=!1,i,a;(t=e._zod).deferred??(t.deferred=[]),e._zod.deferred.push(()=>{let t=e._zod.parse,o=(s,c)=>{if(n===void 0){let i=lm(e,new Set,!1);if(i===om)return e._zod.parse=t,e._zod.run===o&&(e._zod.run=t),t(s,c);i===cm||r?n=!0:r=!0}let l=s.value;if(!rm(l))return t(s,c);let u=c[tm];u||(u={buckets:new WeakMap,backEdges:void 0},c[tm]=u);let d;i===c?d=a:(d=dm(u,e),i=c,a=d);let f=d.get(l);if(f)return s.value=f.value,f.issues?f.issues.length&&s.issues.push(...im(f.issues)):(s.memo=!0,u.backEdges??(u.backEdges=new WeakSet),u.backEdges.add(f.value)),s;fm=d;let p=pm.length,m=t(s,c);fm=void 0;let h=pm.length>p?pm.pop():void 0;return m instanceof Promise?m.then(e=>(h&&(h.issues=e.issues.length?im(e.issues):nm),e)):(h&&(h.issues=m.issues.length?im(m.issues):nm),m)};e._zod.parse=o,e._zod.run===t&&(e._zod.run=o)})}};function hm(){return mm}function gm(e,t){let n=e[tm]?.backEdges;return n!==void 0&&rm(t)&&n.has(t)}var _m=()=>{let e={string:{unit:`characters`,verb:`to have`},file:{unit:`bytes`,verb:`to have`},array:{unit:`items`,verb:`to have`},set:{unit:`items`,verb:`to have`},map:{unit:`entries`,verb:`to have`}};function t(t){return e[t]??null}let n={regex:`input`,email:`email address`,url:`URL`,emoji:`emoji`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`ISO datetime`,date:`ISO date`,time:`ISO time`,duration:`ISO duration`,ipv4:`IPv4 address`,ipv6:`IPv6 address`,mac:`MAC address`,cidrv4:`IPv4 range`,cidrv6:`IPv6 range`,base64:`base64-encoded string`,base64url:`base64url-encoded string`,json_string:`JSON string`,e164:`E.164 number`,currency_code:`currency code`,credit_card:`credit card number`,iban:`IBAN`,jwt:`JWT`,template_literal:`input`},r={nan:`NaN`};function i(e,t){return e===`number`&&typeof t==`number`&&!Number.isFinite(t)?String(t):r[e]??e}return e=>{switch(e.code){case`invalid_type`:return`Invalid input: expected ${i(e.expected)}, received ${i(xu(e.input),e.input)}`;case`invalid_value`:return e.values.length===1?`Invalid input: expected ${$l(e.values[0])}`:`Invalid option: expected one of ${El(e.values,`|`)}`;case`too_big`:{let n=e.exact?`exactly `:e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Too big: expected ${e.origin??`value`} to have ${n}${e.maximum.toString()} ${r.unit??`elements`}`:`Too big: expected ${e.origin??`value`} to be ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.exact?`exactly `:e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Too small: expected ${e.origin} to have ${n}${e.minimum.toString()} ${r.unit}`:`Too small: expected ${e.origin} to be ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Invalid string: must start with "${t.prefix}"`:t.format===`ends_with`?`Invalid string: must end with "${t.suffix}"`:t.format===`includes`?`Invalid string: must include "${t.includes}"`:t.format===`regex`?`Invalid string: must match pattern ${t.pattern}`:`Invalid ${n[t.format]??e.format}`}case`not_multiple_of`:return`Invalid number: must be a multiple of ${e.divisor}`;case`unrecognized_keys`:return`Unrecognized key${e.keys.length>1?`s`:``}: ${El(e.keys,`, `)}`;case`invalid_key`:return`Invalid key in ${e.origin}`;case`invalid_union`:return e.options&&Array.isArray(e.options)&&e.options.length>0?`Invalid discriminator value. Expected ${e.options.map(e=>`'${e}'`).join(` | `)}`:e.inclusive===!1?`Invalid input: more than one option matched`:`Invalid input`;case`invalid_element`:return`Invalid value in ${e.origin}`;default:return`Invalid input`}}};function vm(){return{localeError:_m()}}var ym,bm=class{constructor(){this._map=new WeakMap,this._idmap=new Map}add(e,...t){let n=t[0];return this._map.set(e,n),n&&typeof n==`object`&&`id`in n&&this._idmap.set(n.id,e),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(e){let t=this._map.get(e);return t&&typeof t==`object`&&`id`in t&&this._idmap.delete(t.id),this._map.delete(e),this}get(e){let t=e._zod.parent;if(t){let n={...this.get(t)??{}};delete n.id;let r={...n,...this._map.get(e)};return Object.keys(r).length?r:void 0}return this._map.get(e)}has(e){return this._map.has(e)}};function xm(){return new bm}(ym=globalThis).__zod_globalRegistry??(ym.__zod_globalRegistry=xm());var Sm=globalThis.__zod_globalRegistry;function Cm(e){return e.checks&&=[...e.checks],e}function wm(e,t){return new e(Cm({type:`string`,...P(t)}))}function Tm(e,t){return new e({type:`string`,format:`email`,check:`string_format`,abort:!1,...P(t)})}function Em(e,t){return new e({type:`string`,format:`guid`,check:`string_format`,abort:!1,...P(t)})}function Dm(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,...P(t)})}function Om(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v4`,...P(t)})}function km(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v6`,...P(t)})}function Am(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v7`,...P(t)})}function jm(e,t){return new e({type:`string`,format:`url`,check:`string_format`,abort:!1,...P(t)})}function Mm(e,t){return new e({type:`string`,format:`emoji`,check:`string_format`,abort:!1,...P(t)})}function Nm(e,t){return new e({type:`string`,format:`nanoid`,check:`string_format`,abort:!1,...P(t)})}function Pm(e,t){return new e({type:`string`,format:`cuid`,check:`string_format`,abort:!1,...P(t)})}function Fm(e,t){return new e({type:`string`,format:`cuid2`,check:`string_format`,abort:!1,...P(t)})}function Im(e,t){return new e({type:`string`,format:`ulid`,check:`string_format`,abort:!1,...P(t)})}function Lm(e,t){return new e({type:`string`,format:`xid`,check:`string_format`,abort:!1,...P(t)})}function Rm(e,t){return new e({type:`string`,format:`ksuid`,check:`string_format`,abort:!1,...P(t)})}function zm(e,t){return new e({type:`string`,format:`ipv4`,check:`string_format`,abort:!1,...P(t)})}function Bm(e,t){return new e({type:`string`,format:`ipv6`,check:`string_format`,abort:!1,...P(t)})}function Vm(e,t){return new e({type:`string`,format:`cidrv4`,check:`string_format`,abort:!1,...P(t)})}function Hm(e,t){return new e({type:`string`,format:`cidrv6`,check:`string_format`,abort:!1,...P(t)})}function Um(e,t){return new e({type:`string`,format:`base64`,check:`string_format`,abort:!1,...P(t)})}function Wm(e,t){return new e({type:`string`,format:`base64url`,check:`string_format`,abort:!1,...P(t)})}function Gm(e,t){return new e({type:`string`,format:`e164`,check:`string_format`,abort:!1,...P(t)})}function Km(e,t){return new e({type:`string`,format:`jwt`,check:`string_format`,abort:!1,...P(t)})}function qm(e,t){return new e({type:`string`,format:`datetime`,check:`string_format`,offset:!1,local:!1,precision:null,...P(t)})}function Jm(e,t){return new e({type:`string`,format:`date`,check:`string_format`,...P(t)})}function Ym(e,t){return new e({type:`string`,format:`time`,check:`string_format`,precision:null,...P(t)})}function Xm(e,t){return new e({type:`string`,format:`duration`,check:`string_format`,...P(t)})}function Zm(e,t){return new e(Cm({type:`number`,checks:[],...P(t)}))}function Qm(e,t){return new e(Cm({type:`number`,coerce:!0,checks:[],...P(t)}))}function $m(e,t){return new e({type:`number`,check:`number_format`,abort:!1,format:`safeint`,...P(t)})}function eh(e,t){return new e({type:`boolean`,...P(t)})}function th(e,t){return new e({type:`undefined`,...P(t)})}function nh(e,t){return new e({type:`null`,...P(t)})}function rh(e){return new e({type:`any`})}function ih(e){return new e({type:`unknown`})}function ah(e,t){return new e({type:`never`,...P(t)})}function oh(e,t){return new tf({check:`less_than`,...P(t),value:e,inclusive:!1})}function sh(e,t){return new tf({check:`less_than`,...P(t),value:e,inclusive:!0})}function ch(e,t){return new nf({check:`greater_than`,...P(t),value:e,inclusive:!1})}function lh(e,t){return new nf({check:`greater_than`,...P(t),value:e,inclusive:!0})}function uh(e,t){return new rf({check:`multiple_of`,...P(t),value:e})}function dh(e,t){return new of({check:`max_length`,...P(t),maximum:e})}function fh(e,t){return new sf({check:`min_length`,...P(t),minimum:e})}function ph(e,t){return new cf({check:`length_equals`,...P(t),length:e})}function mh(e,t){return new uf({check:`string_format`,format:`regex`,...P(t),pattern:e})}function hh(e){return new df({check:`string_format`,format:`lowercase`,...P(e)})}function gh(e){return new ff({check:`string_format`,format:`uppercase`,...P(e)})}function _h(e,t){return new pf({check:`string_format`,format:`includes`,...P(t),includes:e})}function vh(e,t){return new mf({check:`string_format`,format:`starts_with`,...P(t),prefix:e})}function yh(e,t){return new hf({check:`string_format`,format:`ends_with`,...P(t),suffix:e})}function bh(e){return new gf({check:`overwrite`,tx:e})}function xh(e){return bh(t=>t.normalize(e))}function Sh(){return bh(e=>e.trim())}function Ch(){return bh(e=>e.toLowerCase())}function wh(){return bh(e=>e.toUpperCase())}function Th(){return bh(e=>Wl(e))}function Eh(e,t,n){return new e({type:`array`,element:t,...P(n)})}function Dh(e,t,n){let r=P(n);return r.abort??=!0,new e({type:`custom`,check:`custom`,fn:t,...r})}function Oh(e,t,n){return new e({type:`custom`,check:`custom`,fn:t,...P(n)})}function kh(e,t){let n=Ah(t=>(t.addIssue=e=>{if(typeof e==`string`)t.issues.push(Su(e,t.value,n._zod.def));else{let r=e;r.fatal&&(r.continue=!1),r.code??=`custom`,`input`in r||(r.input=t.value),r.inst??=n,r.continue??=!n._zod.def.abort,t.issues.push(Su(r))}},e(t.value,t)),t);return n}function Ah(e,t){let n=new Qd({check:`custom`,...P(t)});return n._zod.check=e,n}function jh(e,...t){for(let n of t)for(let t of Reflect.ownKeys(n))Object.prototype.propertyIsEnumerable.call(n,t)&&Fl(e,t,n[t]);return e}function Mh(e){let t=e?.target??`draft-2020-12`;return t===`draft-4`&&(t=`draft-04`),t===`draft-7`&&(t=`draft-07`),{processors:e.processors??{},metadataRegistry:e?.metadata??Sm,target:t,unrepresentable:e?.unrepresentable??`throw`,override:e?.override??(()=>{}),io:e?.io??`output`,counter:0,seen:new Map,sharedDefsExtractedFor:void 0,sharedEmitDoneFor:void 0,cycles:e?.cycles??`ref`,reused:e?.reused??`inline`,intersections:[],deferred:[],external:e?.external??void 0}}function Nh(e,t,n,r,i){let a=typeof t.unrepresentable==`function`?t.unrepresentable({zodSchema:e,path:r.path,message:i}):t.unrepresentable;if(a===`any`)return!1;if(a===void 0||a===`throw`)throw Error(i);return Object.assign(n,a),!0}function Ph(e,t,n={path:[],schemaPath:[]}){var r;let i=e._zod.def,a=t.seen.get(e);if(a)return a.count++,n.schemaPath.includes(e)&&(a.cycle=n.path),a.schema;let o={schema:{},count:1,cycle:void 0,path:n.path};t.seen.set(e,o),t.sharedDefsExtractedFor=void 0,t.sharedEmitDoneFor=void 0;let s=e._zod.toJSONSchema?.();if(s)o.schema=s;else{let r={...n,schemaPath:[...n.schemaPath,e],path:n.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,o.schema,r);else{let n=o.schema,a=t.processors[i.type];if(!a)throw Error(`[toJSONSchema]: Non-representable type encountered: ${i.type}`);a(e,t,n,r)}let a=e._zod.parent;a&&(o.ref||=a,Ph(a,t,r),t.seen.get(a).isParent=!0)}let c=t.metadataRegistry.get(e);return c&&jh(o.schema,c),t.io===`input`&&Wh(e)&&(delete o.schema.examples,delete o.schema.default),t.io===`input`&&`_prefault`in o.schema&&((r=o.schema).default??(r.default=o.schema._prefault)),delete o.schema._prefault,t.seen.get(e).schema}function Fh(e){return e.replace(/~/g,`~0`).replace(/\//g,`~1`)}function Ih(e,t){let n=e.seen.get(t);if(!n)throw Error(`Unprocessed schema. This is a bug in Zod.`);if(e.external&&e.sharedDefsExtractedFor===e.external)return;let r=new Map;for(let t of e.seen.entries()){let n=e.metadataRegistry.get(t[0])?.id;if(n){let e=r.get(n);if(e&&e!==t[0])throw Error(`Duplicate schema id "${n}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);r.set(n,t[0])}}let i=t=>{let r=e.target===`draft-2020-12`?`$defs`:`definitions`;if(e.external){let n=e.external.registry.get(t[0])?.id,i=e.external.uri??(e=>e);if(n)return{ref:i(n)};let a=t[1].defId??t[1].schema.id??`schema${e.counter++}`;return t[1].defId=a,{defId:a,ref:`${i(`__shared`)}#/${r}/${Fh(a)}`}}let i=`#/${r}/`;if(t[1]===n&&!t[1].schema.id)return{ref:`#`};let a=t[1].schema.id??`__schema${e.counter++}`;return{defId:a,ref:i+Fh(a)}},a=e=>{if(e[1].schema.$ref)return;let t=e[1],{ref:n,defId:r}=i(e);t.def={...t.schema},r&&(t.defId=r);let a=t.schema;for(let e in a)delete a[e];a.$ref=n};if(e.cycles===`throw`)for(let t of e.seen.entries()){let e=t[1];if(e.cycle)throw Error(`Cycle detected: #/${e.cycle?.join(`/`)}/ -Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let n of e.seen.entries()){let r=n[1];if(t===n[0]){a(n);continue}if(e.external){let r=e.external.registry.get(n[0])?.id;if(t!==n[0]&&r){a(n);continue}}if(e.metadataRegistry.get(n[0])?.id){a(n);continue}if(r.cycle){a(n);continue}r.count>1&&e.reused===`ref`&&a(n)}e.external&&(e.sharedDefsExtractedFor=e.external)}function Ih(e){let t=e.anyOf;if(!Array.isArray(t)||t.length===0||e.type!==void 0)return;let n=[];for(let e of t){if(!e||typeof e!=`object`)return;Ih(e);let t=Object.keys(e);if(t.length!==1||t[0]!==`type`)return;let r=e.type;for(let e of Array.isArray(r)?r:[r]){if(typeof e!=`string`)return;n.includes(e)||n.push(e)}}delete e.anyOf,e.type=n.length===1?n[0]:n}var Lh=new Set([`type`,`properties`,`required`,`additionalProperties`]),Rh=[`oneOf`,`anyOf`];function zh(e){let t=e.additionalProperties;return t===void 0||t===!1||typeof t!=`object`||!t?null:Object.keys(t).length?t:null}function Bh(e){let t=[];for(let n of e){if(typeof n!=`object`||n.type!==`object`)return null;for(let e in n)if(!Lh.has(e))return null;t.push(n)}let n={},r=new Set;for(let e of t){for(let r in e.properties){if(Object.prototype.hasOwnProperty.call(n,r))continue;let e=[];for(let n of t){let t=n.properties?.[r]??zh(n);t!=null&&(e.some(e=>JSON.stringify(e)===JSON.stringify(t))||e.push(t))}Fl(n,r,e.length===1?e[0]:Bh(e)??{allOf:e})}for(let t of e.required??[])r.add(t)}let i={type:`object`,properties:n};if(r.size&&(i.required=[...r]),t.every(e=>e.additionalProperties===!1))i.additionalProperties=!1;else{let e=[];for(let n of t){let t=zh(n);t&&!e.some(e=>JSON.stringify(e)===JSON.stringify(t))&&e.push(t)}e.length===1?i.additionalProperties=e[0]:e.length>1&&(i.additionalProperties={allOf:e})}return i}function Vh(e){let t=e.allOf;if(!Array.isArray(t)||t.length<2)return;for(let t of Lh)if(t in e)return;let n=t.filter(e=>Rh.some(t=>Array.isArray(e[t]))),r=null;if(!n.length)r=Bh(t);else{let e=n[0],i=Rh.find(t=>Array.isArray(e[t]));if(Object.keys(e).length!==1)return;let a=t.filter(t=>t!==e),o=e[i].map(e=>Bh([...a,e]));if(o.some(e=>!e))return;r={[i]:o}}r&&(delete e.allOf,Ah(e,r))}function Hh(e,t){let n=e.seen.get(t);if(!n)throw Error(`Unprocessed schema. This is a bug in Zod.`);let r=t=>{let n=e.seen.get(t);if(n.ref===null)return;let i=n.def??n.schema,a={...i},o=n.ref;if(n.ref=null,o){r(o);let n=e.seen.get(o),s=n.schema;if(s.$ref&&(e.target===`draft-07`||e.target===`draft-04`||e.target===`openapi-3.0`)?(i.allOf=i.allOf??[],i.allOf.push(s)):Ah(i,s),Ah(i,a),t._zod.parent===o)for(let e in i)e!==`$ref`&&e!==`allOf`&&(e in a||delete i[e]);if(s.$ref&&n.def)for(let e in i)e!==`$ref`&&e!==`allOf`&&e in n.def&&JSON.stringify(i[e])===JSON.stringify(n.def[e])&&delete i[e]}let s=t._zod.parent;if(s&&s!==o){r(s);let t=e.seen.get(s);if(t?.schema.$ref&&(i.$ref=t.schema.$ref,t.def))for(let e in i)e!==`$ref`&&e!==`allOf`&&e in t.def&&JSON.stringify(i[e])===JSON.stringify(t.def[e])&&delete i[e]}e.override({zodSchema:t,jsonSchema:i,path:n.path??[]})};if(!e.external||e.sharedEmitDoneFor!==e.external){for(let t of[...e.seen.entries()].reverse())r(t[0]);if(e.target!==`openapi-3.0`)for(let t of e.seen.entries())Ih(t[1].def??t[1].schema);for(let t of e.deferred)t();if(e.intersections.length){let t=new Map;for(let n of e.seen.values())for(let e of[n.schema,n.def]){let n=e?.allOf;if(!Array.isArray(n))continue;let r=t.get(n);r?r.push(e):t.set(n,[e])}for(let n of e.intersections)for(let e of t.get(n)??[])Vh(e)}}let i={};if(e.target===`draft-2020-12`?i.$schema=`https://json-schema.org/draft/2020-12/schema`:e.target===`draft-07`?i.$schema=`http://json-schema.org/draft-07/schema#`:e.target===`draft-04`?i.$schema=`http://json-schema.org/draft-04/schema#`:e.target,e.external?.uri){let n=e.external.registry.get(t)?.id;if(!n)throw Error("Schema is missing an `id` property");i.$id=e.external.uri(n)}Ah(i,n.defId?n.schema:n.def??n.schema);let a=e.metadataRegistry.get(t)?.id;a!==void 0&&i.id===a&&delete i.id;let o=e.external?.defs??{};if(!e.external||e.sharedEmitDoneFor!==e.external)for(let t of e.seen.entries()){let e=t[1];e.def&&e.defId&&(e.def.id===e.defId&&delete e.def.id,Fl(o,e.defId,e.def))}e.external&&(e.sharedEmitDoneFor=e.external),e.external||Object.keys(o).length>0&&(e.target===`draft-2020-12`?i.$defs=o:i.definitions=o);try{let n=JSON.parse(JSON.stringify(i));return Object.defineProperty(n,"~standard",{value:{...t[`~standard`],jsonSchema:{input:Gh(t,`input`,e.processors),output:Gh(t,`output`,e.processors)}},enumerable:!1,writable:!1}),n}catch{throw Error(`Error converting schema to JSON.`)}}function Uh(e,t){let n=t??{seen:new Set};if(n.seen.has(e))return!1;n.seen.add(e);let r=e._zod.def;if(r.type===`transform`)return!0;if(r.type===`array`)return Uh(r.element,n);if(r.type===`set`)return Uh(r.valueType,n);if(r.type===`lazy`)return Uh(r.getter(),n);if(r.type===`promise`||r.type===`optional`||r.type===`nonoptional`||r.type===`nullable`||r.type===`readonly`||r.type==="default"||r.type===`prefault`||r.type===`catch`)return Uh(r.innerType,n);if(r.type===`intersection`)return Uh(r.left,n)||Uh(r.right,n);if(r.type===`record`||r.type===`map`)return Uh(r.keyType,n)||Uh(r.valueType,n);if(r.type===`pipe`)return e._zod.traits.has(`$ZodCodec`)?!0:Uh(r.in,n)||Uh(r.out,n);if(r.type===`object`){for(let e in r.shape)if(Uh(r.shape[e],n))return!0;return!1}if(r.type===`union`){for(let e of r.options)if(Uh(e,n))return!0;return!1}if(r.type===`tuple`){for(let e of r.items)if(Uh(e,n))return!0;return!!(r.rest&&Uh(r.rest,n))}return!1}var Wh=(e,t={})=>n=>{let r=jh({...n,processors:t});return Nh(e,r),Fh(r,e),Hh(r,e)},Gh=(e,t,n={})=>r=>{let{libraryOptions:i,target:a}=r??{},o=jh({...i??{},target:a,io:t,processors:n});return Nh(e,o),Fh(o,e),Hh(o,e)},Kh=(e,t,n)=>{(e[t]===void 0||n>e[t])&&(e[t]=n)},qh=(e,t,n)=>{(e[t]===void 0||n{Kh(e,`minimum`,t),qh(e,`maximum`,t)},Yh=(e,t)=>{e.multipleOf??=[],e.multipleOf.includes(t)||e.multipleOf.push(t)},Xh=(e,t)=>{e.patterns??=new Set,e.patterns.add(t)},Zh=(e,t)=>{e.mime=e.mime?e.mime.filter(e=>t.includes(e)):[...t]},Qh=(e,t)=>{e.format=t,t.includes(`int`)&&(e.isInt=!0)},$h=(e,t)=>Kh(e,`minimum`,t.minimum),eg=(e,t)=>qh(e,`maximum`,t.maximum),tg=e=>(t,n)=>{Qh(t,n.format);let[r,i]=e[n.format];Kh(t,`minimum`,r),qh(t,`maximum`,i)},ng={greater_than:(e,t)=>Kh(e,t.inclusive?`minimum`:`exclusiveMinimum`,t.value),less_than:(e,t)=>qh(e,t.inclusive?`maximum`:`exclusiveMaximum`,t.value),multiple_of:(e,t)=>Yh(e,t.value),number_format:tg(tu),bigint_format:tg(nu),min_length:$h,max_length:eg,length_equals:(e,t)=>Jh(e,t.length),min_size:$h,max_size:eg,size_equals:(e,t)=>Jh(e,t.size),string_format:(e,t)=>{Qh(e,t.format),t.pattern&&Xh(e,t.pattern),(t.format===`base64`||t.format===`base64url`)&&(e.contentEncoding=t.format),(t.local||t.precision===-1)&&(e.laxFormat=!0)},mime_type:(e,t)=>Zh(e,t.mime)};function rg(e){let t={},n=e._zod.def,r=e._zod.traits.has(`$ZodCheck`)?[e,...n.checks??[]]:n.checks??[];for(let e of r)ng[e._zod.def.check]?.(t,e._zod.def);let i=e._zod.bag;i.minimum!==void 0&&Kh(t,`minimum`,i.minimum),i.exclusiveMinimum!==void 0&&Kh(t,`exclusiveMinimum`,i.exclusiveMinimum),i.maximum!==void 0&&qh(t,`maximum`,i.maximum),i.exclusiveMaximum!==void 0&&qh(t,`exclusiveMaximum`,i.exclusiveMaximum),i.multipleOf!==void 0&&Yh(t,i.multipleOf),i.format!==void 0&&(t.format??=i.format,i.format.includes(`int`)&&(t.isInt=!0)),i.mime&&Zh(t,i.mime);for(let e of i.patterns??[])Xh(t,e);return t}var ig={guid:`uuid`,url:`uri`,datetime:`date-time`,json_string:`json-string`,regex:``},ag=new Map([[B,Nd],[tp,Pd]]),og=e=>ag.get(e)??e,sg=(e,t,n,r)=>{let i=n;i.type=`string`;let{minimum:a,maximum:o,format:s,patterns:c,contentEncoding:l,laxFormat:u}=rg(e);if(typeof a==`number`&&(i.minLength=a),typeof o==`number`&&(i.maxLength=o),s&&(i.format=ig[s]??s,i.format===``&&delete i.format,(s===`time`||u)&&delete i.format),l&&(i.contentEncoding=l),c&&c.size>0){let e=[...c].map(og);e.length===1?i.pattern=e[0].source:e.length>1&&(i.allOf=[...e.map(e=>({...t.target===`draft-07`||t.target===`draft-04`||t.target===`openapi-3.0`?{type:`string`}:{},pattern:e.source}))])}},cg=(e,t,n,r)=>{let i=n,{minimum:a,maximum:o,multipleOf:s,exclusiveMaximum:c,exclusiveMinimum:l,isInt:u}=rg(e);i.type=u?`integer`:`number`;let d=typeof l==`number`&&l>=(a??-1/0),f=typeof c==`number`&&c<=(o??1/0),p=t.target===`draft-04`||t.target===`openapi-3.0`;if(d?p?(i.minimum=l,i.exclusiveMinimum=!0):i.exclusiveMinimum=l:typeof a==`number`&&(i.minimum=a),f?p?(i.maximum=c,i.exclusiveMaximum=!0):i.exclusiveMaximum=c:typeof o==`number`&&(i.maximum=o),s){let n=new Set;for(let a of s)Number.isFinite(a)&&a!==0?n.add(Math.abs(a)):Mh(e,t,i,r,`A multipleOf divisor of ${a} cannot be represented in JSON Schema`);let[a,...o]=n;a!==void 0&&(i.multipleOf=a),o.length&&(i.allOf=[...i.allOf??[],...o.map(e=>({multipleOf:e}))])}},lg=(e,t,n,r)=>{n.type=`boolean`},ug=(e,t,n,r)=>{Mh(e,t,n,r,`BigInt cannot be represented in JSON Schema`)},dg=(e,t,n,r)=>{Mh(e,t,n,r,`Symbols cannot be represented in JSON Schema`)},fg=(e,t,n,r)=>{t.target===`openapi-3.0`?(n.type=`string`,n.nullable=!0,n.enum=[null]):n.type=`null`},pg=(e,t,n,r)=>{Mh(e,t,n,r,`Undefined cannot be represented in JSON Schema`)},mg=(e,t,n,r)=>{Mh(e,t,n,r,`Void cannot be represented in JSON Schema`)},hg=(e,t,n,r)=>{n.not={}},gg=(e,t,n,r)=>{},_g=(e,t,n,r)=>{},vg=(e,t,n,r)=>{Mh(e,t,n,r,`Date cannot be represented in JSON Schema`)},yg=(e,t,n,r)=>{let i=e._zod.def,a=Tl(i.entries);if(a.length===0){n.not={};return}a.every(e=>typeof e==`number`)&&(n.type=`number`),a.every(e=>typeof e==`string`)&&(n.type=`string`),n.enum=a},bg=(e,t,n,r)=>{let i=e._zod.def;if(i.values.length===0){n.not={};return}let a=[];for(let o of i.values)if(o===void 0){if(Mh(e,t,n,r,"Literal `undefined` cannot be represented in JSON Schema"))return}else if(typeof o==`bigint`){if(Mh(e,t,n,r,`BigInt literals cannot be represented in JSON Schema`))return;a.push(Number(o))}else a.push(o);if(a.length!==0){if(a.length===1){let e=a[0];n.type=e===null?`null`:typeof e,t.target===`draft-04`||t.target===`openapi-3.0`?n.enum=[e]:n.const=e}else a.every(e=>typeof e==`number`)&&(n.type=`number`),a.every(e=>typeof e==`string`)&&(n.type=`string`),a.every(e=>typeof e==`boolean`)&&(n.type=`boolean`),a.every(e=>e===null)&&(n.type=`null`),n.enum=a}},xg=(e,t,n,r)=>{Mh(e,t,n,r,`NaN cannot be represented in JSON Schema`)},Sg=(e,t,n,r)=>{let i=n,a=e._zod.pattern;if(!a)throw Error(`Pattern not found in template literal`);i.type=`string`,i.pattern=a.source},Cg=(e,t,n,r)=>{let i=n;i.type=`string`,i.format=`binary`,i.contentEncoding=`binary`;let{minimum:a,maximum:o,mime:s}=rg(e);a!==void 0&&(i.minLength=a),o!==void 0&&(i.maxLength=o),s&&(s.length===0?i.not={}:s.length===1?i.contentMediaType=s[0]:i.anyOf=s.map(e=>({contentMediaType:e})))},wg=(e,t,n,r)=>{n.type=`boolean`},Tg=(e,t,n,r)=>{Mh(e,t,n,r,`Custom types cannot be represented in JSON Schema`)},Eg=(e,t,n,r)=>{Mh(e,t,n,r,`Function types cannot be represented in JSON Schema`)},Dg=(e,t,n,r)=>{Mh(e,t,n,r,`Transforms cannot be represented in JSON Schema`)},Og=(e,t,n,r)=>{Mh(e,t,n,r,`Map cannot be represented in JSON Schema`)},kg=(e,t,n,r)=>{Mh(e,t,n,r,`Set cannot be represented in JSON Schema`)},Ag=(e,t,n,r)=>{let i=n,a=e._zod.def,{minimum:o,maximum:s}=rg(e);typeof o==`number`&&(i.minItems=o),typeof s==`number`&&(i.maxItems=s),i.type=`array`,i.items=Nh(a.element,t,{...r,path:[...r.path,`items`]})};function jg(e){let t=e._zod.def;return t.type===`pipe`&&t.in._zod.traits.has(`$ZodTransform`)?jg(t.out):t.type===`catch`?jg(t.innerType):e._zod.optin}var Mg=(e,t,n,r)=>{let i=n,a=e._zod.def,o=a.shape;if(Object.getOwnPropertySymbols(o).length&&Mh(e,t,i,r,`Symbol keys cannot be represented in JSON Schema`))return;i.type=`object`,i.properties={};for(let e in o)Fl(i.properties,e,Nh(o[e],t,{...r,path:[...r.path,`properties`,e]}));let s=[];for(let e of Object.keys(o)){let n=a.shape[e];(t.io===`input`?jg(n)===void 0:n._zod.optout===void 0)&&s.push(e)}s.length>0&&(i.required=s),a.catchall?._zod.def.type===`never`?i.additionalProperties=!1:a.catchall?a.catchall&&(i.additionalProperties=Nh(a.catchall,t,{...r,path:[...r.path,`additionalProperties`]})):t.io===`output`&&(i.additionalProperties=!1)},Ng=(e,t,n,r)=>{let i=e._zod.def,a=i.inclusive===!1,o=i.options.map((e,n)=>Nh(e,t,{...r,path:[...r.path,a?`oneOf`:`anyOf`,n]}));a?n.oneOf=o:n.anyOf=o},Pg=(e,t,n,r)=>{let i=e._zod.def,a=Nh(i.left,t,{...r,path:[...r.path,`allOf`,0]}),o=Nh(i.right,t,{...r,path:[...r.path,`allOf`,1]}),s=e=>`allOf`in e&&Object.keys(e).length===1,c=[...s(a)?a.allOf:[a],...s(o)?o.allOf:[o]];n.allOf=c,t.intersections.push(c)},Fg=(e,t,n,r)=>{let i=n,a=e._zod.def;i.type=`array`;let o=t.target===`draft-2020-12`?`prefixItems`:`items`,s=t.target===`draft-2020-12`||t.target===`openapi-3.0`?`items`:`additionalItems`,c=a.items.map((e,n)=>Nh(e,t,{...r,path:[...r.path,o,n]})),l=a.rest?Nh(a.rest,t,{...r,path:[...r.path,s,...t.target===`openapi-3.0`?[a.items.length]:[]]}):null,u=a.items.length;for(;u>0;){let e=a.items[u-1];if(!(t.io===`input`?jg(e)!==void 0:e._zod.optout===`optional`))break;u--}let d=a.items.length,f=!a.rest;t.target===`draft-2020-12`?(i.prefixItems=c,f?i.items=!1:l&&(i.items=l),u>0&&(i.minItems=u),f&&(i.maxItems=d)):t.target===`openapi-3.0`?(i.items={anyOf:c},l&&i.items.anyOf.push(l),u>0&&(i.minItems=u),f&&(i.maxItems=d)):(i.items=c,f?i.additionalItems=!1:l&&(i.additionalItems=l),u>0&&(i.minItems=u),f&&(i.maxItems=d));let{minimum:p,maximum:m}=rg(e);typeof p==`number`&&(i.minItems=p),typeof m==`number`&&(i.maxItems=m)};function Ig(e,t,n){if(t.$ref){if(n.has(t))return t;n.add(t);let r=e.get(t)?.def;if(!r)return t;let i=Ig(e,r,n);return i===r?t:i}for(let r of[`anyOf`,`oneOf`]){let i=t[r];if(!Array.isArray(i))continue;let a=i.map(t=>Ig(e,t,n));a.some((e,t)=>e!==i[t])&&(t={...t,[r]:a})}let r=Array.isArray(t.type)?t.type:[t.type],i=!r.includes(`string`)&&r.some(e=>e===`number`||e===`integer`),a=t.enum??(t.const===void 0?void 0:[t.const]);if(!i&&!a?.some(e=>typeof e==`number`))return t;let{minimum:o,maximum:s,exclusiveMinimum:c,exclusiveMaximum:l,multipleOf:u,format:d,id:f,...p}=t;return p.enum?p.enum=p.enum.map(e=>typeof e==`number`?String(e):e):typeof p.const==`number`&&(p.const=String(p.const)),i?(p.type=`string`,a||(p.pattern=(r.includes(`number`)?Gd:Wd).source),p):p}var Lg=new WeakMap;function Rg(e){let t=new Map;for(let n of e.seen.values())n.def&&!t.has(n.schema)&&t.set(n.schema,n);let n=new Map;for(let r of Lg.get(e)??[]){let i=e.seen.get(r),a=(i?.def??i?.schema)?.propertyNames;if(!a||a===!0||n.has(a))continue;let o=Ig(t,a,new Set);o!==a&&n.set(a,o)}if(n.size)for(let t of e.seen.values())for(let e of[t.schema,t.def]){let t=e&&n.get(e.propertyNames);t&&(e.propertyNames=t)}}var zg=(e,t,n,r)=>{let i=n,a=e._zod.def;i.type=`object`;let o=a.keyType,s=rg(o).patterns;if(a.mode===`loose`&&s&&s.size>0){let e=Nh(a.valueType,t,{...r,path:[...r.path,`patternProperties`,`*`]});i.patternProperties={};for(let t of s)Fl(i.patternProperties,og(t).source,e)}else{if(t.target===`draft-07`||t.target===`draft-2020-12`){i.propertyNames=Nh(a.keyType,t,{...r,path:[...r.path,`propertyNames`]});let n=Lg.get(t);n||(n=[],Lg.set(t,n),t.deferred.push(()=>Rg(t))),n.push(e)}i.additionalProperties=Nh(a.valueType,t,{...r,path:[...r.path,`additionalProperties`]})}let c=o._zod.values,l=t.io===`input`&&jg(a.valueType)!==void 0;if(c&&!a.partial&&!l){let e=[...c].filter(e=>typeof e==`string`||typeof e==`number`);e.length>0&&(i.required=e.map(String))}},Bg=(e,t,n,r)=>{let i=e._zod.def,a=Nh(i.innerType,t,r),o=t.seen.get(e);t.target===`openapi-3.0`?(o.ref=i.innerType,n.nullable=!0):n.anyOf=[a,{type:`null`}]},Vg=(e,t,n,r)=>{let i=e._zod.def;Nh(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},Hg=Symbol();function Ug(e,t,n,r,i){let a=!1,o=JSON.stringify(e,(e,t)=>typeof t==`bigint`?(a=!0,null):t);return a?(Mh(t,n,r,i,`BigInt defaults cannot be represented in JSON Schema`),Hg):JSON.parse(o)}var Wg=(e,t,n,r)=>{let i=e._zod.def;Nh(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType;let o=Ug(i.defaultValue,e,t,n,r);o!==Hg&&(n.default=o)},Gg=(e,t,n,r)=>{let i=e._zod.def;Nh(i.innerType,t,r);let a=t.seen.get(e);if(a.ref=i.innerType,t.io!==`input`)return;let o=Ug(i.defaultValue,e,t,n,r);o!==Hg&&(n._prefault=o)},Kg=(e,t,n,r)=>{let i=e._zod.def;Nh(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType;let o;try{o=i.catchValue(void 0)}catch{Mh(e,t,n,r,`Dynamic catch values are not supported in JSON Schema`);return}n.default=o},qg=(e,t,n,r)=>{let i=e._zod.def,a=i.in._zod.traits.has(`$ZodTransform`),o=t.io===`input`?a?i.out:i.in:i.out;Nh(o,t,r);let s=t.seen.get(e);s.ref=o},Jg=(e,t,n,r)=>{let i=e._zod.def;Nh(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,n.readOnly=!0},Yg=(e,t,n,r)=>{let i=e._zod.def;Nh(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},Xg=(e,t,n,r)=>{let i=e._zod.def;Nh(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},Zg=(e,t,n,r)=>{let i=e._zod.innerType;Nh(i,t,r);let a=t.seen.get(e);a.ref=i},Qg={string:sg,number:cg,boolean:lg,bigint:ug,symbol:dg,null:fg,undefined:pg,void:mg,never:hg,any:gg,unknown:_g,date:vg,enum:yg,literal:bg,nan:xg,template_literal:Sg,file:Cg,success:wg,custom:Tg,function:Eg,transform:Dg,map:Og,set:kg,array:Ag,object:Mg,union:Ng,intersection:Pg,tuple:Fg,record:zg,nullable:Bg,nonoptional:Vg,default:Wg,prefault:Gg,catch:Kg,pipe:qg,readonly:Jg,promise:Yg,optional:Xg,lazy:Zg};function $g(e,t){if(`_idmap`in e){let n=e,r=jh({...t,processors:Qg}),i={};for(let e of n._idmap.entries()){let[t,n]=e;Nh(n,r)}let a={};r.external={registry:n,uri:t?.uri,defs:i};for(let e of n._idmap.entries()){let[t,n]=e;Fh(r,n),Fl(a,t,Hh(r,n))}return Object.keys(i).length>0&&(a.__shared={[r.target===`draft-2020-12`?`$defs`:`definitions`]:i}),{schemas:a}}let n=jh({...t,processors:Qg});return Nh(e,n),Fh(n,e),Hh(n,e)}var e_=new WeakSet([Object.prototype,Error.prototype]);function t_(e,t,n){Object.defineProperty(e,t,{configurable:!0,enumerable:!1,get(){let e=n(this);return Object.defineProperty(this,t,{value:e,configurable:!0,writable:!0}),e},set(e){Object.defineProperty(this,t,{value:e,configurable:!0,writable:!0})}})}var n_=L(`ZodError`,(e,t)=>{Yu.init(e,t),e.name=`ZodError`;let n=Object.getPrototypeOf(e);e_.has(n)||(e_.add(n),t_(n,`format`,e=>t=>Qu(e,t)),t_(n,`flatten`,e=>t=>Zu(e,t)),t_(n,`addIssue`,e=>t=>{e.issues.push(t),e.message=JSON.stringify(e.issues,Dl,2)}),t_(n,`addIssues`,e=>t=>{e.issues.push(...t),e.message=JSON.stringify(e.issues,Dl,2)}),Object.defineProperty(n,"isEmpty",{configurable:!0,enumerable:!1,get(){return this.issues.length===0}}))},void 0,{Parent:Error}),r_=ed(n_),i_=td(n_),a_=nd(n_),o_=id(n_),s_=R(n_),c_=z(n_),l_=ud(n_),u_=dd(n_),d_=fd(n_),f_=pd(n_),p_=md(n_),m_=hd(n_);function h_(){Vu.localeError||Hu(_m())}function g_(){Vu.memoizer||Hu({memoizer:mm()})}var __=L(`ZodType`,(e,t)=>(h_(),vf.init(e,t),e.def=t,e.type=t.type,e),{check(...e){let t=this.def;return this.clone(Hl(t,{checks:[...t.checks??[],...e.map(e=>typeof e==`function`?{_zod:{check:e,def:{check:`custom`},onattach:[]}}:e)]}),{parent:!0})},with(...e){return this.check(...e)},clone(e,t){return Ql(this,e,t)},brand(){return this},register(e,t){return e.add(this,t),this},refine(e,t){return this.check(Gv(e,t))},superRefine(e,t){return this.check(Kv(e,t))},overwrite(e){return this.check(yh(e))},optional(){return Cv(this)},exactOptional(){return Tv(this)},nullable(){return Dv(this)},nullish(){return Cv(Dv(this))},nonoptional(e){return Nv(this,e)},array(){return ov(this)},or(e){return uv([this,e])},and(e){return mv(this,e)},transform(e){return Lv(this,xv(e))},default(e){return kv(this,e)},prefault(e){return jv(this,e)},catch(e){return Fv(this,e)},pipe(e){return Lv(this,e)},readonly(){return Bv(this)},describe(e){let t=this.clone();return xm.add(t,{description:e}),t},meta(...e){if(e.length===0)return xm.get(this);let t=this.clone();return xm.add(t,e[0]),t},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(e,...t){return t.length===0?e(this):e(this,...t)},get"~standard"(){return wu(this,`~standard`,{...xf(this),jsonSchema:{input:Gh(this,`input`),output:Gh(this,`output`)}})},set"~standard"(e){Cu(this,`~standard`,e)},parse:function e(t,n){return r_(this,t,n,{callee:e})},parseAsync:async function e(t,n){return await i_(this,t,n,{callee:e})},safeParse(e,t){return a_(this,e,t)},async safeParseAsync(e,t){return o_(this,e,t)},get spa(){return this?.safeParseAsync},set spa(e){Cu(this,`spa`,e)},validate(e,t){return sd(this,e,t)},validateAsync(e,t){return ld(this,e,t)},encode:function e(t,n){return s_(this,t,n,{callee:e})},decode:function e(t,n){return c_(this,t,n,{callee:e})},encodeAsync:async function e(t,n){return await l_(this,t,n,{callee:e})},decodeAsync:async function e(t,n){return await u_(this,t,n,{callee:e})},safeEncode(e,t){return d_(this,e,t)},safeDecode(e,t){return f_(this,e,t)},async safeEncodeAsync(e,t){return p_(this,e,t)},async safeDecodeAsync(e,t){return m_(this,e,t)},toJSONSchema(e){return Wh(this,{})(e)},get description(){return xm.get(this)?.description},get _def(){return this._zod.def}}),v_=L(`_ZodString`,(e,t)=>{Sf.init(e,t),__.init(e,t),e._zod.processJSONSchema=(t,n,r)=>sg(e,t,n,r)},Tu({format:e=>rg(e).format??null,minLength:e=>rg(e).minimum??null,maxLength:e=>rg(e).maximum??null},{regex(...e){return this.check(ph(...e))},includes(...e){return this.check(gh(...e))},startsWith(...e){return this.check(_h(...e))},endsWith(...e){return this.check(vh(...e))},min(...e){return this.check(dh(...e))},max(...e){return this.check(uh(...e))},length(...e){return this.check(fh(...e))},nonempty(...e){return this.check(dh(1,...e))},lowercase(e){return this.check(mh(e))},uppercase(e){return this.check(hh(e))},trim(){return this.check(xh())},normalize(...e){return this.check(bh(...e))},toLowerCase(){return this.check(Sh())},toUpperCase(){return this.check(Ch())},slugify(){return this.check(wh())}})),y_=L(`ZodString`,(e,t)=>{Sf.init(e,t),v_.init(e,t)},{email(e){return this.check(wm(T_,e))},url(e){return this.check(Am(k_,e))},jwt(e){return this.check(Gm(G_,e))},emoji(e){return this.check(jm(j_,e))},guid(e){return this.check(Tm(D_,e))},uuid(e){return this.check(Em(O_,e))},uuidv4(e){return this.check(Dm(O_,e))},uuidv6(e){return this.check(Om(O_,e))},uuidv7(e){return this.check(km(O_,e))},nanoid(e){return this.check(Mm(M_,e))},cuid(e){return this.check(Nm(N_,e))},cuid2(e){return this.check(Pm(P_,e))},ulid(e){return this.check(Fm(F_,e))},base64(e){return this.check(Hm(H_,e))},base64url(e){return this.check(Um(U_,e))},xid(e){return this.check(Im(I_,e))},ksuid(e){return this.check(Lm(L_,e))},ipv4(e){return this.check(Rm(R_,e))},ipv6(e){return this.check(zm(z_,e))},cidrv4(e){return this.check(Bm(B_,e))},cidrv6(e){return this.check(Vm(V_,e))},e164(e){return this.check(Wm(W_,e))},datetime(e){return this.check(Km(x_,e))},date(e){return this.check(qm(S_,e))},time(e){return this.check(Jm(C_,e))},duration(e){return this.check(Ym(w_,e))}});function V(e){return Cm(y_,e)}var b_=L(`ZodStringFormat`,(e,t)=>{Cf.init(e,t),v_.init(e,t)}),x_=L(`ZodISODateTime`,(e,t)=>{Hf.init(e,t),b_.init(e,t)}),S_=L(`ZodISODate`,(e,t)=>{Uf.init(e,t),b_.init(e,t)}),C_=L(`ZodISOTime`,(e,t)=>{Wf.init(e,t),b_.init(e,t)}),w_=L(`ZodISODuration`,(e,t)=>{Gf.init(e,t),b_.init(e,t)}),T_=L(`ZodEmail`,(e,t)=>{Ef.init(e,t),b_.init(e,t)});function E_(e){return wm(T_,e)}var D_=L(`ZodGUID`,(e,t)=>{wf.init(e,t),b_.init(e,t)}),O_=L(`ZodUUID`,(e,t)=>{Tf.init(e,t),b_.init(e,t)}),k_=L(`ZodURL`,(e,t)=>{Pf.init(e,t),b_.init(e,t)});function A_(e){return Am(k_,e)}var j_=L(`ZodEmoji`,(e,t)=>{Ff.init(e,t),b_.init(e,t)}),M_=L(`ZodNanoID`,(e,t)=>{If.init(e,t),b_.init(e,t)}),N_=L(`ZodCUID`,(e,t)=>{Lf.init(e,t),b_.init(e,t)}),P_=L(`ZodCUID2`,(e,t)=>{Rf.init(e,t),b_.init(e,t)}),F_=L(`ZodULID`,(e,t)=>{zf.init(e,t),b_.init(e,t)}),I_=L(`ZodXID`,(e,t)=>{Bf.init(e,t),b_.init(e,t)}),L_=L(`ZodKSUID`,(e,t)=>{Vf.init(e,t),b_.init(e,t)}),R_=L(`ZodIPv4`,(e,t)=>{Kf.init(e,t),b_.init(e,t)}),z_=L(`ZodIPv6`,(e,t)=>{Yf.init(e,t),b_.init(e,t)}),B_=L(`ZodCIDRv4`,(e,t)=>{Xf.init(e,t),b_.init(e,t)}),V_=L(`ZodCIDRv6`,(e,t)=>{Qf.init(e,t),b_.init(e,t)}),H_=L(`ZodBase64`,(e,t)=>{ep.init(e,t),b_.init(e,t)}),U_=L(`ZodBase64URL`,(e,t)=>{rp.init(e,t),b_.init(e,t)}),W_=L(`ZodE164`,(e,t)=>{ip.init(e,t),b_.init(e,t)}),G_=L(`ZodJWT`,(e,t)=>{op.init(e,t),b_.init(e,t)}),K_=L(`ZodNumber`,(e,t)=>{sp.init(e,t),__.init(e,t),e._zod.processJSONSchema=(t,n,r)=>cg(e,t,n,r),e.isFinite=!0},Tu({minValue:e=>{let{minimum:t,exclusiveMinimum:n}=rg(e);return Math.max(t??-1/0,n??-1/0)},maxValue:e=>{let{maximum:t,exclusiveMaximum:n}=rg(e);return Math.min(t??1/0,n??1/0)},isInt:e=>{let{isInt:t,multipleOf:n}=rg(e);return!!t||!!n?.some(Number.isSafeInteger)},format:e=>rg(e).format??null},{gt(e,t){return this.check(sh(e,t))},gte(e,t){return this.check(ch(e,t))},min(e,t){return this.check(ch(e,t))},lt(e,t){return this.check(ah(e,t))},lte(e,t){return this.check(oh(e,t))},max(e,t){return this.check(oh(e,t))},int(e){return this.check(H(e))},safe(e){return this.check(H(e))},positive(e){return this.check(sh(0,e))},nonnegative(e){return this.check(ch(0,e))},negative(e){return this.check(ah(0,e))},nonpositive(e){return this.check(oh(0,e))},multipleOf(e,t){return this.check(lh(e,t))},step(e,t){return this.check(lh(e,t))},finite(){return this}}));function q_(e){return Xm(K_,e)}var J_=L(`ZodNumberFormat`,(e,t)=>{cp.init(e,t),K_.init(e,t)});function H(e){return Qm(J_,e)}var Y_=L(`ZodBoolean`,(e,t)=>{lp.init(e,t),__.init(e,t),e._zod.processJSONSchema=(t,n,r)=>lg(e,t,n,r)});function U(e){return $m(Y_,e)}var X_=L(`ZodUndefined`,(e,t)=>{up.init(e,t),__.init(e,t),e._zod.processJSONSchema=(t,n,r)=>pg(e,t,n,r)});function Z_(e){return eh(X_,e)}var Q_=L(`ZodNull`,(e,t)=>{dp.init(e,t),__.init(e,t),e._zod.processJSONSchema=(t,n,r)=>fg(e,t,n,r)});function $_(e){return th(Q_,e)}var ev=L(`ZodAny`,(e,t)=>{fp.init(e,t),__.init(e,t),e._zod.processJSONSchema=(e,t,n)=>void 0});function W(){return nh(ev)}var tv=L(`ZodUnknown`,(e,t)=>{pp.init(e,t),__.init(e,t),e._zod.processJSONSchema=(e,t,n)=>void 0});function nv(){return rh(tv)}var rv=L(`ZodNever`,(e,t)=>{mp.init(e,t),__.init(e,t),e._zod.processJSONSchema=(t,n,r)=>hg(e,t,n,r)});function iv(e){return ih(rv,e)}var av=L(`ZodArray`,(e,t)=>{g_(),gp.init(e,t),__.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ag(e,t,n,r),e.element=t.element},{min(e,t){return this.check(dh(e,t))},nonempty(e){return this.check(dh(1,e))},max(e,t){return this.check(uh(e,t))},length(e,t){return this.check(fh(e,t))},unwrap(){return this.element}});function ov(e,t){return Th(av,e,t)}var sv=L(`ZodObject`,(e,t)=>{g_(),Sp.init(e,t),__.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Mg(e,t,n,r),ju(e,`shape`,e=>e._zod.def.shape,!1)},{keyof(){return vv(Object.keys(this._zod.def.shape))},catchall(e){return this.clone(Hl(this._zod.def,{catchall:e}))},passthrough(){return this.clone(Hl(this._zod.def,{catchall:nv()}))},loose(){return this.clone(Hl(this._zod.def,{catchall:nv()}))},strict(){return this.clone(Hl(this._zod.def,{catchall:iv()}))},strip(){return this.clone(Hl(this._zod.def,{catchall:void 0}))},extend(e){return ou(this,e)},safeExtend(e){return cu(this,e)},merge(e){return lu(this,e)},pick(e){return ru(this,e)},omit(e){return au(this,e)},partial(...e){return uu(Sv,this,e[0])},exactPartial(...e){return uu(wv,this,e[0],`exactPartial`)},required(...e){return du(Mv,this,e[0])}});function cv(e,t){return new sv({type:`object`,shape:e??{},...P(t)})}function G(e,t){return new sv({type:`object`,shape:e,catchall:nv(),...P(t)})}var lv=L(`ZodUnion`,(e,t)=>{wp.init(e,t),__.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ng(e,t,n,r),e.options=t.options});function uv(e,t){return new lv({type:`union`,options:e,...P(t)})}var dv=L(`ZodDiscriminatedUnion`,(e,t)=>{lv.init(e,t),Ep.init(e,t)});function fv(e,t,n){return new dv({type:`union`,options:t,discriminator:e,...P(n)})}var pv=L(`ZodIntersection`,(e,t)=>{Dp.init(e,t),__.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Pg(e,t,n,r)});function mv(e,t){return new pv({type:`intersection`,left:e,right:t})}var hv=L(`ZodRecord`,(e,t)=>{g_(),Ap.init(e,t),__.init(e,t),e._zod.processJSONSchema=(t,n,r)=>zg(e,t,n,r),e.keyType=t.keyType,e.valueType=t.valueType});function gv(e,t,n){return!t||!t._zod?new hv({type:`record`,keyType:V(),valueType:e,...P(t)}):new hv({type:`record`,keyType:e,valueType:t,...P(n)})}var _v=L(`ZodEnum`,(e,t)=>{jp.init(e,t),__.init(e,t),e._zod.processJSONSchema=(t,n,r)=>yg(e,t,n,r),e.enum=t.entries,e.options=[...e._zod.values];let n=new Set(Object.keys(t.entries));e.extract=(e,r)=>{let i={};for(let r of e)if(n.has(r))i[r]=t.entries[r];else throw Error(`Key ${r} not found in enum`);return new _v({...t,checks:[],...P(r),entries:i})},e.exclude=(e,r)=>{let i={...t.entries};for(let t of e)if(n.has(t))delete i[t];else throw Error(`Key ${t} not found in enum`);return new _v({...t,checks:[],...P(r),entries:i})}});function vv(e,t){return new _v({type:`enum`,entries:Array.isArray(e)?Object.fromEntries(e.map(e=>[e,e])):e,...P(t)})}var yv=L(`ZodLiteral`,(e,t)=>{Mp.init(e,t),__.init(e,t),e._zod.processJSONSchema=(t,n,r)=>bg(e,t,n,r),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});function K(e,t){return new yv({type:`literal`,values:Array.isArray(e)?e:[e],...P(t)})}var bv=L(`ZodTransform`,(e,t)=>{g_(),Np.init(e,t),__.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Dg(e,t,n,r),e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new Bu(e.constructor.name);n.addIssue=r=>{if(typeof r==`string`)n.issues.push(xu(r,n.value,t));else{let t=r;t.fatal&&(t.continue=!1),t.code??=`custom`,`input`in t||(t.input=n.value),t.inst??=e,n.issues.push(xu(t))}};let i=t.transform(n.value,n);return i instanceof Promise?i.then(e=>(n.value=e,n)):(n.value=i,n)}});function xv(e){return new bv({type:`transform`,transform:e})}var Sv=L(`ZodOptional`,(e,t)=>{Fp.init(e,t),__.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Xg(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Cv(e){return new Sv({type:`optional`,innerType:e})}var wv=L(`ZodExactOptional`,(e,t)=>{Ip.init(e,t),__.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Xg(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Tv(e){return new wv({type:`optional`,innerType:e})}var Ev=L(`ZodNullable`,(e,t)=>{Lp.init(e,t),__.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Bg(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Dv(e){return new Ev({type:`nullable`,innerType:e})}var Ov=L(`ZodDefault`,(e,t)=>{Rp.init(e,t),__.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Wg(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function kv(e,t){return new Ov({type:`default`,innerType:e,get defaultValue(){return typeof t==`function`?t():Yl(t)}})}var Av=L(`ZodPrefault`,(e,t)=>{Bp.init(e,t),__.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Gg(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function jv(e,t){return new Av({type:`prefault`,innerType:e,get defaultValue(){return typeof t==`function`?t():Yl(t)}})}var Mv=L(`ZodNonOptional`,(e,t)=>{Vp.init(e,t),__.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Vg(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Nv(e,t){return new Mv({type:`nonoptional`,innerType:e,...P(t)})}var Pv=L(`ZodCatch`,(e,t)=>{Wp.init(e,t),__.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Kg(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function Fv(e,t){return new Pv({type:`catch`,innerType:e,catchValue:typeof t==`function`?t:Nu(t)})}var Iv=L(`ZodPipe`,(e,t)=>{Gp.init(e,t),__.init(e,t),e._zod.processJSONSchema=(t,n,r)=>qg(e,t,n,r),e.in=t.in,e.out=t.out});function Lv(e,t){return new Iv({type:`pipe`,in:e,out:t})}var Rv=L(`ZodPreprocess`,(e,t)=>{Iv.init(e,t),qp.init(e,t)}),zv=L(`ZodReadonly`,(e,t)=>{Jp.init(e,t),__.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Jg(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Bv(e){return new zv({type:`readonly`,innerType:e})}var Vv=L(`ZodLazy`,(e,t)=>{Xp.init(e,t),__.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Zg(e,t,n,r),e.unwrap=()=>e._zod.def.getter()});function Hv(e){return new Vv({type:`lazy`,getter:e})}var Uv=L(`ZodCustom`,(e,t)=>{Zp.init(e,t),__.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Tg(e,t,n,r)});function Wv(e,t){return Eh(Uv,e??(()=>!0),t)}function Gv(e,t={}){return Dh(Uv,e,t)}function Kv(e,t){return Oh(e,t)}function qv(e,t){return new Rv({type:`pipe`,in:xv(e),out:t})}var Jv=vv(A),q=Wv(e=>typeof e==`object`&&!!e&&!Array.isArray(e)),J=V(),Yv=vv([`developer`,`system`,`assistant`,`user`]),Xv=G({type:K(A.TEXT_MESSAGE_START),timestamp:H().min(-9007199254740991).max(9007199254740991).optional(),rawEvent:W().refine(e=>e!==null).optional(),metadata:q.optional(),subagentRunId:J.optional(),messageId:V(),role:Yv.optional(),name:V().optional()}),Zv=G({type:K(A.TEXT_MESSAGE_CONTENT),timestamp:H().min(-9007199254740991).max(9007199254740991).optional(),rawEvent:W().refine(e=>e!==null).optional(),metadata:q.optional(),subagentRunId:J.optional(),messageId:V(),delta:V()}),Qv=G({type:K(A.TEXT_MESSAGE_END),timestamp:H().min(-9007199254740991).max(9007199254740991).optional(),rawEvent:W().refine(e=>e!==null).optional(),metadata:q.optional(),subagentRunId:J.optional(),messageId:V()}),$v=G({type:K(A.TEXT_MESSAGE_CHUNK),timestamp:H().min(-9007199254740991).max(9007199254740991).optional(),rawEvent:W().refine(e=>e!==null).optional(),metadata:q.optional(),subagentRunId:J.optional(),messageId:V().optional(),role:Yv.optional(),delta:V().optional(),name:V().optional()}),ey=G({type:K(A.TOOL_CALL_START),timestamp:H().min(-9007199254740991).max(9007199254740991).optional(),rawEvent:W().refine(e=>e!==null).optional(),metadata:q.optional(),subagentRunId:J.optional(),toolCallId:V(),toolCallName:V(),parentMessageId:V().optional()}),ty=G({type:K(A.TOOL_CALL_ARGS),timestamp:H().min(-9007199254740991).max(9007199254740991).optional(),rawEvent:W().refine(e=>e!==null).optional(),metadata:q.optional(),subagentRunId:J.optional(),toolCallId:V(),delta:V()}),ny=G({type:K(A.TOOL_CALL_END),timestamp:H().min(-9007199254740991).max(9007199254740991).optional(),rawEvent:W().refine(e=>e!==null).optional(),metadata:q.optional(),subagentRunId:J.optional(),toolCallId:V()}),ry=G({type:K(A.TOOL_CALL_CHUNK),timestamp:H().min(-9007199254740991).max(9007199254740991).optional(),rawEvent:W().refine(e=>e!==null).optional(),metadata:q.optional(),subagentRunId:J.optional(),toolCallId:V().optional(),toolCallName:V().optional(),parentMessageId:V().optional(),delta:V().optional()}),iy=G({type:K(`text`),id:V().optional(),text:V(),metadata:W().refine(e=>e!==null).optional()}),ay=fv(`type`,[G({type:K(`data`),value:V(),mimeType:V()}),G({type:K(`url`),value:V(),mimeType:V().optional()}),G({type:K(`file`),value:V(),provider:V().optional(),mimeType:V().optional()})]),oy=fv(`type`,[iy,G({type:K(`image`),id:V().optional(),source:ay,metadata:W().refine(e=>e!==null).optional()}),G({type:K(`audio`),id:V().optional(),source:ay,metadata:W().refine(e=>e!==null).optional()}),G({type:K(`video`),id:V().optional(),source:ay,metadata:W().refine(e=>e!==null).optional()}),G({type:K(`document`),id:V().optional(),source:ay,metadata:W().refine(e=>e!==null).optional()})]),sy=G({type:K(A.TOOL_CALL_RESULT),timestamp:H().min(-9007199254740991).max(9007199254740991).optional(),rawEvent:W().refine(e=>e!==null).optional(),metadata:q.optional(),subagentRunId:J.optional(),messageId:V(),toolCallId:V(),content:uv([V(),ov(oy)]),role:K(`tool`).optional()}),cy=W(),ly=G({type:K(A.STATE_SNAPSHOT),timestamp:H().min(-9007199254740991).max(9007199254740991).optional(),rawEvent:W().refine(e=>e!==null).optional(),metadata:q.optional(),subagentRunId:J.optional(),snapshot:cy.refine(e=>e!==void 0)}),uy=V().regex(RegExp(`^(/([^/~]|~[01])*)*$`)),dy=ov(fv(`op`,[G({op:K(`add`),path:uy,value:W().refine(e=>e!==void 0)}).meta({specOpen:!0}),G({op:K(`remove`),path:uy}).meta({specOpen:!0}),G({op:K(`replace`),path:uy,value:W().refine(e=>e!==void 0)}).meta({specOpen:!0}),G({op:K(`move`),from:uy,path:uy}).meta({specOpen:!0}),G({op:K(`copy`),from:uy,path:uy}).meta({specOpen:!0}),G({op:K(`test`),path:uy,value:W().refine(e=>e!==void 0)}).meta({specOpen:!0})])),fy=G({type:K(A.STATE_DELTA),timestamp:H().min(-9007199254740991).max(9007199254740991).optional(),rawEvent:W().refine(e=>e!==null).optional(),metadata:q.optional(),subagentRunId:J.optional(),delta:dy}),py=G({subagentRunId:J.optional(),id:V(),role:K(`developer`),name:V().optional(),encryptedValue:V().optional(),metadata:q.optional(),content:V()}),my=G({subagentRunId:J.optional(),id:V(),role:K(`system`),name:V().optional(),encryptedValue:V().optional(),metadata:q.optional(),content:V()}),hy=G({name:V(),arguments:V()}),gy=G({id:V(),type:K(`function`),function:hy,encryptedValue:V().optional(),metadata:q.optional()}),_y=fv(`role`,[py,my,G({subagentRunId:J.optional(),id:V(),role:K(`assistant`),name:V().optional(),encryptedValue:V().optional(),metadata:q.optional(),content:V().optional(),toolCalls:ov(gy).optional()}),G({subagentRunId:J.optional(),id:V(),role:K(`user`),name:V().optional(),encryptedValue:V().optional(),metadata:q.optional(),content:uv([V(),ov(oy)])}),G({subagentRunId:J.optional(),id:V(),role:K(`tool`),content:uv([V(),ov(oy)]),toolCallId:V(),error:V().optional(),encryptedValue:V().optional(),metadata:q.optional()}),G({subagentRunId:J.optional(),id:V(),role:K(`activity`),activityType:V(),content:Wv(e=>typeof e==`object`&&!!e&&!Array.isArray(e)),metadata:q.optional()}),G({subagentRunId:J.optional(),id:V(),role:K(`reasoning`),content:V(),encryptedValue:V().optional(),metadata:q.optional()})]),vy=G({type:K(A.MESSAGES_SNAPSHOT),timestamp:H().min(-9007199254740991).max(9007199254740991).optional(),rawEvent:W().refine(e=>e!==null).optional(),metadata:q.optional(),messages:ov(_y)}),yy=G({type:K(A.ACTIVITY_SNAPSHOT),timestamp:H().min(-9007199254740991).max(9007199254740991).optional(),rawEvent:W().refine(e=>e!==null).optional(),metadata:q.optional(),subagentRunId:J.optional(),messageId:V(),activityType:V(),content:Wv(e=>typeof e==`object`&&!!e&&!Array.isArray(e)),replace:U().optional()}),by=G({type:K(A.ACTIVITY_DELTA),timestamp:H().min(-9007199254740991).max(9007199254740991).optional(),rawEvent:W().refine(e=>e!==null).optional(),metadata:q.optional(),subagentRunId:J.optional(),messageId:V(),activityType:V(),patch:dy}),xy=G({type:K(A.RAW),timestamp:H().min(-9007199254740991).max(9007199254740991).optional(),rawEvent:W().refine(e=>e!==null).optional(),metadata:q.optional(),subagentRunId:J.optional(),event:W().refine(e=>e!==void 0),source:V().optional()}),Sy=G({type:K(A.CUSTOM),timestamp:H().min(-9007199254740991).max(9007199254740991).optional(),rawEvent:W().refine(e=>e!==null).optional(),metadata:q.optional(),subagentRunId:J.optional(),name:V(),value:W().refine(e=>e!==void 0)}),Cy=G({name:V(),description:V(),parameters:W().refine(e=>e!==null).optional(),metadata:q.optional()}),wy=G({description:V(),value:V()}),Ty=G({interruptId:V(),status:vv([`resolved`,`cancelled`]),payload:W().refine(e=>e!==null).optional(),metadata:q.optional()}),Ey=G({threadId:V(),runId:V(),protocolVersion:V().optional(),parentRunId:V().optional(),state:cy.refine(e=>e!==null).nullable().transform(e=>e??void 0).optional(),messages:ov(_y),tools:ov(Cy).default(()=>[]),context:ov(wy).default(()=>[]),forwardedProps:W().refine(e=>e!==null).optional(),resume:ov(Ty).optional()}),Dy=G({type:K(A.RUN_STARTED),timestamp:H().min(-9007199254740991).max(9007199254740991).optional(),rawEvent:W().refine(e=>e!==null).optional(),metadata:q.optional(),threadId:V(),runId:V(),protocolVersion:V().optional(),parentRunId:V().optional(),input:Ey.optional()}),Oy=G({type:K(`success`),pendingToolCallIds:ov(V()).optional()}),ky=G({subagentRunId:J.optional(),id:V(),reason:V(),message:V().optional(),toolCallId:V().optional(),responseSchema:Wv(e=>typeof e==`object`&&!!e&&!Array.isArray(e)).optional(),expiresAt:V().optional(),metadata:q.optional()}),Ay=fv(`type`,[Oy,G({type:K(`interrupt`),interrupts:ov(ky).min(1)}),G({type:K(`cancelled`)})]),jy=G({provider:V().optional(),model:V().optional(),inputTokens:H().min(0).max(9007199254740991).optional(),outputTokens:H().min(0).max(9007199254740991).optional(),totalTokens:H().min(0).max(9007199254740991).optional(),reasoningTokens:H().min(0).max(9007199254740991).optional(),cachedInputTokens:H().min(0).max(9007199254740991).optional(),cacheWriteInputTokens:H().min(0).max(9007199254740991).optional()}),My=G({type:K(A.RUN_FINISHED),timestamp:H().min(-9007199254740991).max(9007199254740991).optional(),rawEvent:W().refine(e=>e!==null).optional(),metadata:q.optional(),threadId:V(),runId:V(),result:W().refine(e=>e!==null).optional(),outcome:Ay.optional(),usage:ov(jy).optional()}),Ny=G({type:K(A.RUN_ERROR),timestamp:H().min(-9007199254740991).max(9007199254740991).optional(),rawEvent:W().refine(e=>e!==null).optional(),metadata:q.optional(),message:V(),code:V().optional(),usage:ov(jy).optional()}),Py=G({type:K(A.STEP_STARTED),timestamp:H().min(-9007199254740991).max(9007199254740991).optional(),rawEvent:W().refine(e=>e!==null).optional(),metadata:q.optional(),subagentRunId:J.optional(),stepName:V()}),Fy=G({type:K(A.STEP_FINISHED),timestamp:H().min(-9007199254740991).max(9007199254740991).optional(),rawEvent:W().refine(e=>e!==null).optional(),metadata:q.optional(),subagentRunId:J.optional(),stepName:V()}),Iy=G({type:K(A.REASONING_START),timestamp:H().min(-9007199254740991).max(9007199254740991).optional(),rawEvent:W().refine(e=>e!==null).optional(),metadata:q.optional(),subagentRunId:J.optional(),messageId:V()}),Ly=G({type:K(A.REASONING_MESSAGE_START),timestamp:H().min(-9007199254740991).max(9007199254740991).optional(),rawEvent:W().refine(e=>e!==null).optional(),metadata:q.optional(),subagentRunId:J.optional(),messageId:V(),role:K(`reasoning`)}),Ry=G({type:K(A.REASONING_MESSAGE_CONTENT),timestamp:H().min(-9007199254740991).max(9007199254740991).optional(),rawEvent:W().refine(e=>e!==null).optional(),metadata:q.optional(),subagentRunId:J.optional(),messageId:V(),delta:V()}),zy=G({type:K(A.REASONING_MESSAGE_END),timestamp:H().min(-9007199254740991).max(9007199254740991).optional(),rawEvent:W().refine(e=>e!==null).optional(),metadata:q.optional(),subagentRunId:J.optional(),messageId:V()}),By=G({type:K(A.REASONING_MESSAGE_CHUNK),timestamp:H().min(-9007199254740991).max(9007199254740991).optional(),rawEvent:W().refine(e=>e!==null).optional(),metadata:q.optional(),subagentRunId:J.optional(),messageId:V().optional(),delta:V().optional()}),Vy=G({type:K(A.REASONING_END),timestamp:H().min(-9007199254740991).max(9007199254740991).optional(),rawEvent:W().refine(e=>e!==null).optional(),metadata:q.optional(),subagentRunId:J.optional(),messageId:V()}),Hy=vv([`tool-call`,`message`]),Uy=G({type:K(A.REASONING_ENCRYPTED_VALUE),timestamp:H().min(-9007199254740991).max(9007199254740991).optional(),rawEvent:W().refine(e=>e!==null).optional(),metadata:q.optional(),subagentRunId:J.optional(),subtype:Hy,entityId:V(),encryptedValue:V()}),Wy=G({type:K(A.SUBAGENT_STARTED),timestamp:H().min(-9007199254740991).max(9007199254740991).optional(),rawEvent:W().refine(e=>e!==null).optional(),metadata:q.optional(),subagentRunId:J,name:V(),description:V().optional(),parentSubagentRunId:J.optional(),parentToolCallId:V().optional(),parentMessageId:V().optional()}),Gy=fv(`type`,[G({type:K(`success`)}),G({type:K(`suspended`),interruptIds:ov(V()).optional()})]),Ky=fv(`type`,[Xv,Zv,Qv,$v,ey,ty,ny,ry,sy,ly,fy,vy,yy,by,xy,Sy,Dy,My,Ny,Py,Fy,Iy,Ly,Ry,zy,By,Vy,Uy,Wy,G({type:K(A.SUBAGENT_FINISHED),timestamp:H().min(-9007199254740991).max(9007199254740991).optional(),rawEvent:W().refine(e=>e!==null).optional(),metadata:q.optional(),subagentRunId:J,result:W().refine(e=>e!==null).optional(),outcome:Gy.optional()}),G({type:K(A.SUBAGENT_ERROR),timestamp:H().min(-9007199254740991).max(9007199254740991).optional(),rawEvent:W().refine(e=>e!==null).optional(),metadata:q.optional(),subagentRunId:J,message:V(),code:V().optional()})]);vv([`developer`,`system`,`assistant`,`user`,`tool`,`activity`,`reasoning`]);var qy=G({name:V(),description:V().optional()}),Jy=G({name:V().optional(),type:V().optional(),description:V().optional(),version:V().optional(),provider:V().optional(),documentationUrl:V().optional(),metadata:q.optional()}),Yy=G({streaming:U().optional(),websocket:U().optional(),httpBinary:U().optional(),pushNotifications:U().optional(),resumable:U().optional()}),Xy=G({supported:U().optional(),items:ov(Cy).optional(),parallelCalls:U().optional(),clientProvided:U().optional()}),Zy=G({structuredOutput:U().optional(),supportedMimeTypes:ov(V()).optional()}),Qy=G({snapshots:U().optional(),deltas:U().optional(),memory:U().optional(),persistentState:U().optional()}),$y=G({supported:U().optional(),delegation:U().optional(),handoffs:U().optional(),subagents:ov(qy).optional()}),eb=G({supported:U().optional(),streaming:U().optional(),encrypted:U().optional()}),tb=G({image:U().optional(),audio:U().optional(),video:U().optional(),pdf:U().optional(),file:U().optional()}),nb=G({image:U().optional(),audio:U().optional()}),rb=G({input:tb.optional(),output:nb.optional()}),ib=G({codeExecution:U().optional(),sandboxed:U().optional(),maxIterations:H().min(0).max(9007199254740991).optional(),maxExecutionTime:H().min(0).max(9007199254740991).optional()}),ab=G({supported:U().optional(),approvals:U().optional(),interventions:U().optional(),feedback:U().optional(),interrupts:U().optional(),approveWithEdits:U().optional()});G({identity:Jy.optional(),transport:Yy.optional(),tools:Xy.optional(),output:Zy.optional(),state:Qy.optional(),multiAgent:$y.optional(),reasoning:eb.optional(),multimodal:rb.optional(),execution:ib.optional(),humanInTheLoop:ab.optional(),custom:Wv(e=>typeof e==`object`&&!!e&&!Array.isArray(e)).optional()}),G({subagentRunId:J.optional()}),G({type:Jv,timestamp:H().min(-9007199254740991).max(9007199254740991).optional(),rawEvent:W().refine(e=>e!==null).optional(),metadata:q.optional()}),G({subagentRunId:J.optional(),id:V(),role:V(),name:V().optional(),encryptedValue:V().optional(),metadata:q.optional()}),q.optional();function ob(){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)<=sb&&(i+=r/sb|0,r%=sb)}return a(-24,-18),a(-18,-12),a(-12,-6),a(-6),t?pb(r,i):fb(r,i)}function lb(e,t){let n=fb(e,t),r=n.hi&2147483648;r&&(n=pb(n.lo,n.hi));let i=ub(n.lo,n.hi);return r?`-`+i:i}function ub(e,t){if({lo:e,hi:t}=db(e,t),t<=2097151)return String(sb*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()+mb(o)+mb(a)}function db(e,t){return{lo:e>>>0,hi:t>>>0}}function fb(e,t){return{lo:e|0,hi:t|0}}function pb(e,t){return t=~t,e?e=~e+1:t+=1,fb(e,t)}var mb=e=>{let t=String(e);return`0000000`.slice(t.length)+t};function hb(){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 gb=_b();function _b(){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)),xb(i)}return bb}function Cb(e){return(t,n)=>{let r=e(t);return n.set(r),{written:r.byteLength}}}var wb;(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`})(wb||={});var Y=class{constructor(e){this.stackPos=[],this.encodeUtf8Into=e?Cb(e):Sb().encodeUtf8Into,this.buffer=Db,this.viewCache=Ob,this.pos=0}ensureCapacity(e){let t=this.pos+e;if(t>this.buffer.length){let e=this.buffer.length||Tb;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(Eb),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-Eb,n=Ab(t);return n>Eb&&(this.ensureCapacity(n-Eb),this.buffer.copyWithin(e+n,e+Eb,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(Mb(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(jb(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<=kb){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=Ab(t),r=this.buffer,i=this.pos,{written:a}=this.encodeUtf8Into(e,r.subarray(i+n)),o=Ab(a);return o!=n&&r.copyWithin(i+o,i+n,i+n+a),this.uint32(a),this.pos+=a,this}float(e){return Nb(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 Mb(e),this.ensureCapacity(4),this.view().setUint32(this.pos,e,!0),this.pos+=4,this}sfixed32(e){return jb(e),this.ensureCapacity(4),this.view().setInt32(this.pos,e,!0),this.pos+=4,this}sint32(e){return jb(e),this.uint32((e<<1^e>>31)>>>0)}sfixed64(e){let t=gb.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=gb.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=gb.enc(e);return this.writeVarint64(t.lo,t.hi)}sint64(e){let t=gb.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=gb.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}},Tb=128,Eb=1,Db=new Uint8Array,Ob=new DataView(Db.buffer),kb=32;function Ab(e){return e<128?1:e<16384?2:e<2097152?3:e<268435456?4:5}var X=class{constructor(e,t=Sb().decodeUtf8){this.decodeUtf8=t,this.varint64Lo=0,this.varint64Hi=0,this.varint64=ob,this.uint32=hb,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 wb.Varint:for(;this.buf[this.pos++]&128;);break;case wb.Bit64:this.pos+=4;case wb.Bit32:this.pos+=4;break;case wb.LengthDelimited:let r=this.uint32();this.pos+=r;break;case wb.StartGroup:if(n<=0)throw Error(`maximum recursion depth reached`);for(;;){let[e,r]=this.tag();if(r===wb.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(),gb.dec(this.varint64Lo,this.varint64Hi)}uint64(){return this.varint64(),gb.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,gb.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 gb.uDec(this.sfixed32(),this.sfixed32())}sfixed64(){return gb.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<=kb){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 jb(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 Mb(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 Nb(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(Math.fround(e))&&Number.isFinite(e))throw Error(`invalid float32: `+e)}var Pb=function(e){return e[e.NULL_VALUE=0]=`NULL_VALUE`,e[e.UNRECOGNIZED=-1]=`UNRECOGNIZED`,e}({});function Fb(){return{fields:{}}}var Ib={encode(e,t=new Y){return Object.entries(e.fields).forEach(([e,n])=>{n!==void 0&&Rb.encode({key:e,value:n},t.uint32(10).fork()).join()}),t},decode(e,t){let n=e instanceof X?e:new X(e),r=t===void 0?n.len:n.pos+t,i=Fb();for(;n.pos>>3){case 1:{if(e!==10)break;let t=Rb.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 Ib.fromPartial(e??{})},fromPartial(e){let t=Fb();return t.fields=Object.entries(e.fields??{}).reduce((e,[t,n])=>(n!==void 0&&(e[t]=n),e),{}),t},wrap(e){let t=Fb();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 Lb(){return{key:``,value:void 0}}var Rb={encode(e,t=new Y){return e.key!==``&&t.uint32(10).string(e.key),e.value!==void 0&&Z.encode(Z.wrap(e.value),t.uint32(18).fork()).join(),t},decode(e,t){let n=e instanceof X?e:new X(e),r=t===void 0?n.len:n.pos+t,i=Lb();for(;n.pos>>3){case 1:if(e!==10)break;i.key=n.string();continue;case 2:if(e!==18)break;i.value=Z.unwrap(Z.decode(n,n.uint32()));continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return Rb.fromPartial(e??{})},fromPartial(e){let t=Lb();return t.key=e.key??``,t.value=e.value??void 0,t}};function zb(){return{nullValue:void 0,numberValue:void 0,stringValue:void 0,boolValue:void 0,structValue:void 0,listValue:void 0}}var Z={encode(e,t=new Y){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&&Ib.encode(Ib.wrap(e.structValue),t.uint32(42).fork()).join(),e.listValue!==void 0&&Vb.encode(Vb.wrap(e.listValue),t.uint32(50).fork()).join(),t},decode(e,t){let n=e instanceof X?e:new X(e),r=t===void 0?n.len:n.pos+t,i=zb();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=Ib.unwrap(Ib.decode(n,n.uint32()));continue;case 6:if(e!==50)break;i.listValue=Vb.unwrap(Vb.decode(n,n.uint32()));continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return Z.fromPartial(e??{})},fromPartial(e){let t=zb();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=zb();if(e===null)t.nullValue=Pb.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 Bb(){return{values:[]}}var Vb={encode(e,t=new Y){for(let n of e.values)Z.encode(Z.wrap(n),t.uint32(10).fork()).join();return t},decode(e,t){let n=e instanceof X?e:new X(e),r=t===void 0?n.len:n.pos+t,i=Bb();for(;n.pos>>3){case 1:if(e!==10)break;i.values.push(Z.unwrap(Z.decode(n,n.uint32())));continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return Vb.fromPartial(e??{})},fromPartial(e){let t=Bb();return t.values=e.values?.map(e=>e)||[],t},wrap(e){let t=Bb();return t.values=e??[],t},unwrap(e){return e?.hasOwnProperty(`values`)&&globalThis.Array.isArray(e.values)?e.values:e}},Hb=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 Ub(){return{op:0,path:``,from:void 0,value:void 0}}var Wb={encode(e,t=new Y){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&&Z.encode(Z.wrap(e.value),t.uint32(34).fork()).join(),t},decode(e,t){let n=e instanceof X?e:new X(e),r=t===void 0?n.len:n.pos+t,i=Ub();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=Z.unwrap(Z.decode(n,n.uint32()));continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return Wb.fromPartial(e??{})},fromPartial(e){let t=Ub();return t.op=e.op??0,t.path=e.path??``,t.from=e.from??void 0,t.value=e.value??void 0,t}};function Gb(){return{text:``,id:void 0,metadata:void 0}}var Kb={encode(e,t=new Y){return e.text!==``&&t.uint32(10).string(e.text),e.id!==void 0&&t.uint32(18).string(e.id),e.metadata!==void 0&&Z.encode(Z.wrap(e.metadata),t.uint32(26).fork()).join(),t},decode(e,t){let n=e instanceof X?e:new X(e),r=t===void 0?n.len:n.pos+t,i=Gb();for(;n.pos>>3){case 1:if(e!==10)break;i.text=n.string();continue;case 2:if(e!==18)break;i.id=n.string();continue;case 3:if(e!==26)break;i.metadata=Z.unwrap(Z.decode(n,n.uint32()));continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return Kb.fromPartial(e??{})},fromPartial(e){let t=Gb();return t.text=e.text??``,t.id=e.id??void 0,t.metadata=e.metadata??void 0,t}};function qb(){return{source:void 0,metadata:void 0,id:void 0}}var Jb={encode(e,t=new Y){return e.source!==void 0&&nx.encode(e.source,t.uint32(10).fork()).join(),e.metadata!==void 0&&Z.encode(Z.wrap(e.metadata),t.uint32(18).fork()).join(),e.id!==void 0&&t.uint32(26).string(e.id),t},decode(e,t){let n=e instanceof X?e:new X(e),r=t===void 0?n.len:n.pos+t,i=qb();for(;n.pos>>3){case 1:if(e!==10)break;i.source=nx.decode(n,n.uint32());continue;case 2:if(e!==18)break;i.metadata=Z.unwrap(Z.decode(n,n.uint32()));continue;case 3:if(e!==26)break;i.id=n.string();continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return Jb.fromPartial(e??{})},fromPartial(e){let t=qb();return t.source=e.source!==void 0&&e.source!==null?nx.fromPartial(e.source):void 0,t.metadata=e.metadata??void 0,t.id=e.id??void 0,t}};function Yb(){return{value:``,mimeType:``}}var Xb={encode(e,t=new Y){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 X?e:new X(e),r=t===void 0?n.len:n.pos+t,i=Yb();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 Xb.fromPartial(e??{})},fromPartial(e){let t=Yb();return t.value=e.value??``,t.mimeType=e.mimeType??``,t}};function Zb(){return{value:``,mimeType:void 0}}var Qb={encode(e,t=new Y){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 X?e:new X(e),r=t===void 0?n.len:n.pos+t,i=Zb();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 Qb.fromPartial(e??{})},fromPartial(e){let t=Zb();return t.value=e.value??``,t.mimeType=e.mimeType??void 0,t}};function $b(){return{value:``,provider:void 0,mimeType:void 0}}var ex={encode(e,t=new Y){return e.value!==``&&t.uint32(10).string(e.value),e.provider!==void 0&&t.uint32(18).string(e.provider),e.mimeType!==void 0&&t.uint32(26).string(e.mimeType),t},decode(e,t){let n=e instanceof X?e:new X(e),r=t===void 0?n.len:n.pos+t,i=$b();for(;n.pos>>3){case 1:if(e!==10)break;i.value=n.string();continue;case 2:if(e!==18)break;i.provider=n.string();continue;case 3:if(e!==26)break;i.mimeType=n.string();continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return ex.fromPartial(e??{})},fromPartial(e){let t=$b();return t.value=e.value??``,t.provider=e.provider??void 0,t.mimeType=e.mimeType??void 0,t}};function tx(){return{data:void 0,url:void 0,file:void 0}}var nx={encode(e,t=new Y){return e.data!==void 0&&Xb.encode(e.data,t.uint32(10).fork()).join(),e.url!==void 0&&Qb.encode(e.url,t.uint32(18).fork()).join(),e.file!==void 0&&ex.encode(e.file,t.uint32(26).fork()).join(),t},decode(e,t){let n=e instanceof X?e:new X(e),r=t===void 0?n.len:n.pos+t,i=tx();for(;n.pos>>3){case 1:if(e!==10)break;i.data=Xb.decode(n,n.uint32());continue;case 2:if(e!==18)break;i.url=Qb.decode(n,n.uint32());continue;case 3:if(e!==26)break;i.file=ex.decode(n,n.uint32());continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return nx.fromPartial(e??{})},fromPartial(e){let t=tx();return t.data=e.data!==void 0&&e.data!==null?Xb.fromPartial(e.data):void 0,t.url=e.url!==void 0&&e.url!==null?Qb.fromPartial(e.url):void 0,t.file=e.file!==void 0&&e.file!==null?ex.fromPartial(e.file):void 0,t}};function rx(){return{source:void 0,metadata:void 0,id:void 0}}var ix={encode(e,t=new Y){return e.source!==void 0&&nx.encode(e.source,t.uint32(10).fork()).join(),e.metadata!==void 0&&Z.encode(Z.wrap(e.metadata),t.uint32(18).fork()).join(),e.id!==void 0&&t.uint32(26).string(e.id),t},decode(e,t){let n=e instanceof X?e:new X(e),r=t===void 0?n.len:n.pos+t,i=rx();for(;n.pos>>3){case 1:if(e!==10)break;i.source=nx.decode(n,n.uint32());continue;case 2:if(e!==18)break;i.metadata=Z.unwrap(Z.decode(n,n.uint32()));continue;case 3:if(e!==26)break;i.id=n.string();continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return ix.fromPartial(e??{})},fromPartial(e){let t=rx();return t.source=e.source!==void 0&&e.source!==null?nx.fromPartial(e.source):void 0,t.metadata=e.metadata??void 0,t.id=e.id??void 0,t}};function ax(){return{source:void 0,metadata:void 0,id:void 0}}var ox={encode(e,t=new Y){return e.source!==void 0&&nx.encode(e.source,t.uint32(10).fork()).join(),e.metadata!==void 0&&Z.encode(Z.wrap(e.metadata),t.uint32(18).fork()).join(),e.id!==void 0&&t.uint32(26).string(e.id),t},decode(e,t){let n=e instanceof X?e:new X(e),r=t===void 0?n.len:n.pos+t,i=ax();for(;n.pos>>3){case 1:if(e!==10)break;i.source=nx.decode(n,n.uint32());continue;case 2:if(e!==18)break;i.metadata=Z.unwrap(Z.decode(n,n.uint32()));continue;case 3:if(e!==26)break;i.id=n.string();continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return ox.fromPartial(e??{})},fromPartial(e){let t=ax();return t.source=e.source!==void 0&&e.source!==null?nx.fromPartial(e.source):void 0,t.metadata=e.metadata??void 0,t.id=e.id??void 0,t}};function sx(){return{source:void 0,metadata:void 0,id:void 0}}var cx={encode(e,t=new Y){return e.source!==void 0&&nx.encode(e.source,t.uint32(10).fork()).join(),e.metadata!==void 0&&Z.encode(Z.wrap(e.metadata),t.uint32(18).fork()).join(),e.id!==void 0&&t.uint32(26).string(e.id),t},decode(e,t){let n=e instanceof X?e:new X(e),r=t===void 0?n.len:n.pos+t,i=sx();for(;n.pos>>3){case 1:if(e!==10)break;i.source=nx.decode(n,n.uint32());continue;case 2:if(e!==18)break;i.metadata=Z.unwrap(Z.decode(n,n.uint32()));continue;case 3:if(e!==26)break;i.id=n.string();continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return cx.fromPartial(e??{})},fromPartial(e){let t=sx();return t.source=e.source!==void 0&&e.source!==null?nx.fromPartial(e.source):void 0,t.metadata=e.metadata??void 0,t.id=e.id??void 0,t}};function lx(){return{text:void 0,image:void 0,audio:void 0,video:void 0,document:void 0}}var ux={encode(e,t=new Y){return e.text!==void 0&&Kb.encode(e.text,t.uint32(10).fork()).join(),e.image!==void 0&&Jb.encode(e.image,t.uint32(18).fork()).join(),e.audio!==void 0&&ix.encode(e.audio,t.uint32(26).fork()).join(),e.video!==void 0&&ox.encode(e.video,t.uint32(34).fork()).join(),e.document!==void 0&&cx.encode(e.document,t.uint32(42).fork()).join(),t},decode(e,t){let n=e instanceof X?e:new X(e),r=t===void 0?n.len:n.pos+t,i=lx();for(;n.pos>>3){case 1:if(e!==10)break;i.text=Kb.decode(n,n.uint32());continue;case 2:if(e!==18)break;i.image=Jb.decode(n,n.uint32());continue;case 3:if(e!==26)break;i.audio=ix.decode(n,n.uint32());continue;case 4:if(e!==34)break;i.video=ox.decode(n,n.uint32());continue;case 5:if(e!==42)break;i.document=cx.decode(n,n.uint32());continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return ux.fromPartial(e??{})},fromPartial(e){let t=lx();return t.text=e.text!==void 0&&e.text!==null?Kb.fromPartial(e.text):void 0,t.image=e.image!==void 0&&e.image!==null?Jb.fromPartial(e.image):void 0,t.audio=e.audio!==void 0&&e.audio!==null?ix.fromPartial(e.audio):void 0,t.video=e.video!==void 0&&e.video!==null?ox.fromPartial(e.video):void 0,t.document=e.document!==void 0&&e.document!==null?cx.fromPartial(e.document):void 0,t}};function dx(){return{id:``,type:``,function:void 0,metadata:void 0,encryptedValue:void 0}}var fx={encode(e,t=new Y){return e.id!==``&&t.uint32(10).string(e.id),e.type!==``&&t.uint32(18).string(e.type),e.function!==void 0&&mx.encode(e.function,t.uint32(26).fork()).join(),e.metadata!==void 0&&Ib.encode(Ib.wrap(e.metadata),t.uint32(34).fork()).join(),e.encryptedValue!==void 0&&t.uint32(42).string(e.encryptedValue),t},decode(e,t){let n=e instanceof X?e:new X(e),r=t===void 0?n.len:n.pos+t,i=dx();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=mx.decode(n,n.uint32());continue;case 4:if(e!==34)break;i.metadata=Ib.unwrap(Ib.decode(n,n.uint32()));continue;case 5:if(e!==42)break;i.encryptedValue=n.string();continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return fx.fromPartial(e??{})},fromPartial(e){let t=dx();return t.id=e.id??``,t.type=e.type??``,t.function=e.function!==void 0&&e.function!==null?mx.fromPartial(e.function):void 0,t.metadata=e.metadata??void 0,t.encryptedValue=e.encryptedValue??void 0,t}};function px(){return{name:``,arguments:``}}var mx={encode(e,t=new Y){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 X?e:new X(e),r=t===void 0?n.len:n.pos+t,i=px();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 mx.fromPartial(e??{})},fromPartial(e){let t=px();return t.name=e.name??``,t.arguments=e.arguments??``,t}};function hx(){return{id:``,role:``,content:void 0,name:void 0,toolCalls:[],toolCallId:void 0,error:void 0,contentParts:[],metadata:void 0,subagentRunId:void 0,encryptedValue:void 0,activityType:void 0,activityContent:void 0}}var gx={encode(e,t=new Y){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)fx.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)ux.encode(n,t.uint32(66).fork()).join();return e.metadata!==void 0&&Ib.encode(Ib.wrap(e.metadata),t.uint32(74).fork()).join(),e.subagentRunId!==void 0&&t.uint32(82).string(e.subagentRunId),e.encryptedValue!==void 0&&t.uint32(90).string(e.encryptedValue),e.activityType!==void 0&&t.uint32(98).string(e.activityType),e.activityContent!==void 0&&Ib.encode(Ib.wrap(e.activityContent),t.uint32(106).fork()).join(),t},decode(e,t){let n=e instanceof X?e:new X(e),r=t===void 0?n.len:n.pos+t,i=hx();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(fx.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(ux.decode(n,n.uint32()));continue;case 9:if(e!==74)break;i.metadata=Ib.unwrap(Ib.decode(n,n.uint32()));continue;case 10:if(e!==82)break;i.subagentRunId=n.string();continue;case 11:if(e!==90)break;i.encryptedValue=n.string();continue;case 12:if(e!==98)break;i.activityType=n.string();continue;case 13:if(e!==106)break;i.activityContent=Ib.unwrap(Ib.decode(n,n.uint32()));continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return gx.fromPartial(e??{})},fromPartial(e){let t=hx();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=>fx.fromPartial(e))||[],t.toolCallId=e.toolCallId??void 0,t.error=e.error??void 0,t.contentParts=e.contentParts?.map(e=>ux.fromPartial(e))||[],t.metadata=e.metadata??void 0,t.subagentRunId=e.subagentRunId??void 0,t.encryptedValue=e.encryptedValue??void 0,t.activityType=e.activityType??void 0,t.activityContent=e.activityContent??void 0,t}};function _x(){return{name:``,description:``,parameters:void 0,metadata:void 0}}var vx={encode(e,t=new Y){return e.name!==``&&t.uint32(10).string(e.name),e.description!==``&&t.uint32(18).string(e.description),e.parameters!==void 0&&Z.encode(Z.wrap(e.parameters),t.uint32(26).fork()).join(),e.metadata!==void 0&&Ib.encode(Ib.wrap(e.metadata),t.uint32(34).fork()).join(),t},decode(e,t){let n=e instanceof X?e:new X(e),r=t===void 0?n.len:n.pos+t,i=_x();for(;n.pos>>3){case 1:if(e!==10)break;i.name=n.string();continue;case 2:if(e!==18)break;i.description=n.string();continue;case 3:if(e!==26)break;i.parameters=Z.unwrap(Z.decode(n,n.uint32()));continue;case 4:if(e!==34)break;i.metadata=Ib.unwrap(Ib.decode(n,n.uint32()));continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return vx.fromPartial(e??{})},fromPartial(e){let t=_x();return t.name=e.name??``,t.description=e.description??``,t.parameters=e.parameters??void 0,t.metadata=e.metadata??void 0,t}};function yx(){return{description:``,value:``}}var bx={encode(e,t=new Y){return e.description!==``&&t.uint32(10).string(e.description),e.value!==``&&t.uint32(18).string(e.value),t},decode(e,t){let n=e instanceof X?e:new X(e),r=t===void 0?n.len:n.pos+t,i=yx();for(;n.pos>>3){case 1:if(e!==10)break;i.description=n.string();continue;case 2:if(e!==18)break;i.value=n.string();continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return bx.fromPartial(e??{})},fromPartial(e){let t=yx();return t.description=e.description??``,t.value=e.value??``,t}};function xx(){return{interruptId:``,status:``,payload:void 0,metadata:void 0}}var Sx={encode(e,t=new Y){return e.interruptId!==``&&t.uint32(10).string(e.interruptId),e.status!==``&&t.uint32(18).string(e.status),e.payload!==void 0&&Z.encode(Z.wrap(e.payload),t.uint32(26).fork()).join(),e.metadata!==void 0&&Ib.encode(Ib.wrap(e.metadata),t.uint32(34).fork()).join(),t},decode(e,t){let n=e instanceof X?e:new X(e),r=t===void 0?n.len:n.pos+t,i=xx();for(;n.pos>>3){case 1:if(e!==10)break;i.interruptId=n.string();continue;case 2:if(e!==18)break;i.status=n.string();continue;case 3:if(e!==26)break;i.payload=Z.unwrap(Z.decode(n,n.uint32()));continue;case 4:if(e!==34)break;i.metadata=Ib.unwrap(Ib.decode(n,n.uint32()));continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return Sx.fromPartial(e??{})},fromPartial(e){let t=xx();return t.interruptId=e.interruptId??``,t.status=e.status??``,t.payload=e.payload??void 0,t.metadata=e.metadata??void 0,t}};function Cx(){return{threadId:``,runId:``,parentRunId:void 0,state:void 0,messages:[],tools:[],context:[],forwardedProps:void 0,resume:[],protocolVersion:void 0}}var wx={encode(e,t=new Y){e.threadId!==``&&t.uint32(10).string(e.threadId),e.runId!==``&&t.uint32(18).string(e.runId),e.parentRunId!==void 0&&t.uint32(26).string(e.parentRunId),e.state!==void 0&&Z.encode(Z.wrap(e.state),t.uint32(34).fork()).join();for(let n of e.messages)gx.encode(n,t.uint32(42).fork()).join();for(let n of e.tools)vx.encode(n,t.uint32(50).fork()).join();for(let n of e.context)bx.encode(n,t.uint32(58).fork()).join();e.forwardedProps!==void 0&&Z.encode(Z.wrap(e.forwardedProps),t.uint32(66).fork()).join();for(let n of e.resume)Sx.encode(n,t.uint32(74).fork()).join();return e.protocolVersion!==void 0&&t.uint32(82).string(e.protocolVersion),t},decode(e,t){let n=e instanceof X?e:new X(e),r=t===void 0?n.len:n.pos+t,i=Cx();for(;n.pos>>3){case 1:if(e!==10)break;i.threadId=n.string();continue;case 2:if(e!==18)break;i.runId=n.string();continue;case 3:if(e!==26)break;i.parentRunId=n.string();continue;case 4:if(e!==34)break;i.state=Z.unwrap(Z.decode(n,n.uint32()));continue;case 5:if(e!==42)break;i.messages.push(gx.decode(n,n.uint32()));continue;case 6:if(e!==50)break;i.tools.push(vx.decode(n,n.uint32()));continue;case 7:if(e!==58)break;i.context.push(bx.decode(n,n.uint32()));continue;case 8:if(e!==66)break;i.forwardedProps=Z.unwrap(Z.decode(n,n.uint32()));continue;case 9:if(e!==74)break;i.resume.push(Sx.decode(n,n.uint32()));continue;case 10:if(e!==82)break;i.protocolVersion=n.string();continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return wx.fromPartial(e??{})},fromPartial(e){let t=Cx();return t.threadId=e.threadId??``,t.runId=e.runId??``,t.parentRunId=e.parentRunId??void 0,t.state=e.state??void 0,t.messages=e.messages?.map(e=>gx.fromPartial(e))||[],t.tools=e.tools?.map(e=>vx.fromPartial(e))||[],t.context=e.context?.map(e=>bx.fromPartial(e))||[],t.forwardedProps=e.forwardedProps??void 0,t.resume=e.resume?.map(e=>Sx.fromPartial(e))||[],t.protocolVersion=e.protocolVersion??void 0,t}};function Tx(){return{id:``,reason:``,message:void 0,toolCallId:void 0,responseSchema:void 0,expiresAt:void 0,metadata:void 0,subagentRunId:void 0}}var Ex={encode(e,t=new Y){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&&Z.encode(Z.wrap(e.responseSchema),t.uint32(42).fork()).join(),e.expiresAt!==void 0&&t.uint32(50).string(e.expiresAt),e.metadata!==void 0&&Z.encode(Z.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 X?e:new X(e),r=t===void 0?n.len:n.pos+t,i=Tx();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=Z.unwrap(Z.decode(n,n.uint32()));continue;case 6:if(e!==50)break;i.expiresAt=n.string();continue;case 7:if(e!==58)break;i.metadata=Z.unwrap(Z.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 Ex.fromPartial(e??{})},fromPartial(e){let t=Tx();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}},Dx=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.TEXT_MESSAGE_CHUNK=19]=`TEXT_MESSAGE_CHUNK`,e[e.TOOL_CALL_CHUNK=20]=`TOOL_CALL_CHUNK`,e[e.TOOL_CALL_RESULT=21]=`TOOL_CALL_RESULT`,e[e.ACTIVITY_SNAPSHOT=22]=`ACTIVITY_SNAPSHOT`,e[e.ACTIVITY_DELTA=23]=`ACTIVITY_DELTA`,e[e.REASONING_START=24]=`REASONING_START`,e[e.REASONING_MESSAGE_START=25]=`REASONING_MESSAGE_START`,e[e.REASONING_MESSAGE_CONTENT=26]=`REASONING_MESSAGE_CONTENT`,e[e.REASONING_MESSAGE_END=27]=`REASONING_MESSAGE_END`,e[e.REASONING_MESSAGE_CHUNK=28]=`REASONING_MESSAGE_CHUNK`,e[e.REASONING_END=29]=`REASONING_END`,e[e.REASONING_ENCRYPTED_VALUE=30]=`REASONING_ENCRYPTED_VALUE`,e[e.UNRECOGNIZED=-1]=`UNRECOGNIZED`,e}({});function Ox(){return{type:0,timestamp:void 0,rawEvent:void 0,metadata:void 0}}var Q={encode(e,t=new Y){return e.type!==0&&t.uint32(8).int32(e.type),e.timestamp!==void 0&&t.uint32(16).int64(e.timestamp),e.rawEvent!==void 0&&Z.encode(Z.wrap(e.rawEvent),t.uint32(26).fork()).join(),e.metadata!==void 0&&Ib.encode(Ib.wrap(e.metadata),t.uint32(34).fork()).join(),t},decode(e,t){let n=e instanceof X?e:new X(e),r=t===void 0?n.len:n.pos+t,i=Ox();for(;n.pos>>3){case 1:if(e!==8)break;i.type=n.int32();continue;case 2:if(e!==16)break;i.timestamp=VS(n.int64());continue;case 3:if(e!==26)break;i.rawEvent=Z.unwrap(Z.decode(n,n.uint32()));continue;case 4:if(e!==34)break;i.metadata=Ib.unwrap(Ib.decode(n,n.uint32()));continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return Q.fromPartial(e??{})},fromPartial(e){let t=Ox();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 kx(){return{baseEvent:void 0,messageId:``,role:void 0,name:void 0,subagentRunId:void 0}}var Ax={encode(e,t=new Y){return e.baseEvent!==void 0&&Q.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 X?e:new X(e),r=t===void 0?n.len:n.pos+t,i=kx();for(;n.pos>>3){case 1:if(e!==10)break;i.baseEvent=Q.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 Ax.fromPartial(e??{})},fromPartial(e){let t=kx();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?Q.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 jx(){return{baseEvent:void 0,messageId:``,delta:``,subagentRunId:void 0}}var Mx={encode(e,t=new Y){return e.baseEvent!==void 0&&Q.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 X?e:new X(e),r=t===void 0?n.len:n.pos+t,i=jx();for(;n.pos>>3){case 1:if(e!==10)break;i.baseEvent=Q.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 Mx.fromPartial(e??{})},fromPartial(e){let t=jx();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?Q.fromPartial(e.baseEvent):void 0,t.messageId=e.messageId??``,t.delta=e.delta??``,t.subagentRunId=e.subagentRunId??void 0,t}};function Nx(){return{baseEvent:void 0,messageId:``,subagentRunId:void 0}}var Px={encode(e,t=new Y){return e.baseEvent!==void 0&&Q.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 X?e:new X(e),r=t===void 0?n.len:n.pos+t,i=Nx();for(;n.pos>>3){case 1:if(e!==10)break;i.baseEvent=Q.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 Px.fromPartial(e??{})},fromPartial(e){let t=Nx();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?Q.fromPartial(e.baseEvent):void 0,t.messageId=e.messageId??``,t.subagentRunId=e.subagentRunId??void 0,t}};function Fx(){return{baseEvent:void 0,messageId:void 0,role:void 0,delta:void 0,name:void 0,subagentRunId:void 0}}var Ix={encode(e,t=new Y){return e.baseEvent!==void 0&&Q.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 X?e:new X(e),r=t===void 0?n.len:n.pos+t,i=Fx();for(;n.pos>>3){case 1:if(e!==10)break;i.baseEvent=Q.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 Ix.fromPartial(e??{})},fromPartial(e){let t=Fx();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?Q.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 Lx(){return{baseEvent:void 0,toolCallId:``,toolCallName:``,parentMessageId:void 0,subagentRunId:void 0}}var Rx={encode(e,t=new Y){return e.baseEvent!==void 0&&Q.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 X?e:new X(e),r=t===void 0?n.len:n.pos+t,i=Lx();for(;n.pos>>3){case 1:if(e!==10)break;i.baseEvent=Q.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 Rx.fromPartial(e??{})},fromPartial(e){let t=Lx();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?Q.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 zx(){return{baseEvent:void 0,toolCallId:``,delta:``,subagentRunId:void 0}}var Bx={encode(e,t=new Y){return e.baseEvent!==void 0&&Q.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 X?e:new X(e),r=t===void 0?n.len:n.pos+t,i=zx();for(;n.pos>>3){case 1:if(e!==10)break;i.baseEvent=Q.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 Bx.fromPartial(e??{})},fromPartial(e){let t=zx();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?Q.fromPartial(e.baseEvent):void 0,t.toolCallId=e.toolCallId??``,t.delta=e.delta??``,t.subagentRunId=e.subagentRunId??void 0,t}};function Vx(){return{baseEvent:void 0,toolCallId:``,subagentRunId:void 0}}var Hx={encode(e,t=new Y){return e.baseEvent!==void 0&&Q.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 X?e:new X(e),r=t===void 0?n.len:n.pos+t,i=Vx();for(;n.pos>>3){case 1:if(e!==10)break;i.baseEvent=Q.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 Hx.fromPartial(e??{})},fromPartial(e){let t=Vx();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?Q.fromPartial(e.baseEvent):void 0,t.toolCallId=e.toolCallId??``,t.subagentRunId=e.subagentRunId??void 0,t}};function Ux(){return{baseEvent:void 0,toolCallId:void 0,toolCallName:void 0,parentMessageId:void 0,delta:void 0,subagentRunId:void 0}}var Wx={encode(e,t=new Y){return e.baseEvent!==void 0&&Q.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 X?e:new X(e),r=t===void 0?n.len:n.pos+t,i=Ux();for(;n.pos>>3){case 1:if(e!==10)break;i.baseEvent=Q.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 Wx.fromPartial(e??{})},fromPartial(e){let t=Ux();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?Q.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 Gx(){return{baseEvent:void 0,subagentRunId:void 0,messageId:``,toolCallId:``,content:void 0,role:void 0,contentParts:[]}}var Kx={encode(e,t=new Y){e.baseEvent!==void 0&&Q.encode(e.baseEvent,t.uint32(10).fork()).join(),e.subagentRunId!==void 0&&t.uint32(18).string(e.subagentRunId),e.messageId!==``&&t.uint32(26).string(e.messageId),e.toolCallId!==``&&t.uint32(34).string(e.toolCallId),e.content!==void 0&&t.uint32(42).string(e.content),e.role!==void 0&&t.uint32(50).string(e.role);for(let n of e.contentParts)ux.encode(n,t.uint32(58).fork()).join();return t},decode(e,t){let n=e instanceof X?e:new X(e),r=t===void 0?n.len:n.pos+t,i=Gx();for(;n.pos>>3){case 1:if(e!==10)break;i.baseEvent=Q.decode(n,n.uint32());continue;case 2:if(e!==18)break;i.subagentRunId=n.string();continue;case 3:if(e!==26)break;i.messageId=n.string();continue;case 4:if(e!==34)break;i.toolCallId=n.string();continue;case 5:if(e!==42)break;i.content=n.string();continue;case 6:if(e!==50)break;i.role=n.string();continue;case 7:if(e!==58)break;i.contentParts.push(ux.decode(n,n.uint32()));continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return Kx.fromPartial(e??{})},fromPartial(e){let t=Gx();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?Q.fromPartial(e.baseEvent):void 0,t.subagentRunId=e.subagentRunId??void 0,t.messageId=e.messageId??``,t.toolCallId=e.toolCallId??``,t.content=e.content??void 0,t.role=e.role??void 0,t.contentParts=e.contentParts?.map(e=>ux.fromPartial(e))||[],t}};function qx(){return{baseEvent:void 0,snapshot:void 0,subagentRunId:void 0}}var Jx={encode(e,t=new Y){return e.baseEvent!==void 0&&Q.encode(e.baseEvent,t.uint32(10).fork()).join(),e.snapshot!==void 0&&Z.encode(Z.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 X?e:new X(e),r=t===void 0?n.len:n.pos+t,i=qx();for(;n.pos>>3){case 1:if(e!==10)break;i.baseEvent=Q.decode(n,n.uint32());continue;case 2:if(e!==18)break;i.snapshot=Z.unwrap(Z.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 Jx.fromPartial(e??{})},fromPartial(e){let t=qx();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?Q.fromPartial(e.baseEvent):void 0,t.snapshot=e.snapshot??void 0,t.subagentRunId=e.subagentRunId??void 0,t}};function Yx(){return{baseEvent:void 0,delta:[],subagentRunId:void 0}}var Xx={encode(e,t=new Y){e.baseEvent!==void 0&&Q.encode(e.baseEvent,t.uint32(10).fork()).join();for(let n of e.delta)Wb.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 X?e:new X(e),r=t===void 0?n.len:n.pos+t,i=Yx();for(;n.pos>>3){case 1:if(e!==10)break;i.baseEvent=Q.decode(n,n.uint32());continue;case 2:if(e!==18)break;i.delta.push(Wb.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 Xx.fromPartial(e??{})},fromPartial(e){let t=Yx();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?Q.fromPartial(e.baseEvent):void 0,t.delta=e.delta?.map(e=>Wb.fromPartial(e))||[],t.subagentRunId=e.subagentRunId??void 0,t}};function Zx(){return{baseEvent:void 0,messages:[]}}var Qx={encode(e,t=new Y){e.baseEvent!==void 0&&Q.encode(e.baseEvent,t.uint32(10).fork()).join();for(let n of e.messages)gx.encode(n,t.uint32(18).fork()).join();return t},decode(e,t){let n=e instanceof X?e:new X(e),r=t===void 0?n.len:n.pos+t,i=Zx();for(;n.pos>>3){case 1:if(e!==10)break;i.baseEvent=Q.decode(n,n.uint32());continue;case 2:if(e!==18)break;i.messages.push(gx.decode(n,n.uint32()));continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return Qx.fromPartial(e??{})},fromPartial(e){let t=Zx();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?Q.fromPartial(e.baseEvent):void 0,t.messages=e.messages?.map(e=>gx.fromPartial(e))||[],t}};function $x(){return{baseEvent:void 0,subagentRunId:void 0,messageId:``,activityType:``,content:void 0,replace:void 0}}var eS={encode(e,t=new Y){return e.baseEvent!==void 0&&Q.encode(e.baseEvent,t.uint32(10).fork()).join(),e.subagentRunId!==void 0&&t.uint32(18).string(e.subagentRunId),e.messageId!==``&&t.uint32(26).string(e.messageId),e.activityType!==``&&t.uint32(34).string(e.activityType),e.content!==void 0&&Ib.encode(Ib.wrap(e.content),t.uint32(42).fork()).join(),e.replace!==void 0&&t.uint32(48).bool(e.replace),t},decode(e,t){let n=e instanceof X?e:new X(e),r=t===void 0?n.len:n.pos+t,i=$x();for(;n.pos>>3){case 1:if(e!==10)break;i.baseEvent=Q.decode(n,n.uint32());continue;case 2:if(e!==18)break;i.subagentRunId=n.string();continue;case 3:if(e!==26)break;i.messageId=n.string();continue;case 4:if(e!==34)break;i.activityType=n.string();continue;case 5:if(e!==42)break;i.content=Ib.unwrap(Ib.decode(n,n.uint32()));continue;case 6:if(e!==48)break;i.replace=n.bool();continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return eS.fromPartial(e??{})},fromPartial(e){let t=$x();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?Q.fromPartial(e.baseEvent):void 0,t.subagentRunId=e.subagentRunId??void 0,t.messageId=e.messageId??``,t.activityType=e.activityType??``,t.content=e.content??void 0,t.replace=e.replace??void 0,t}};function tS(){return{baseEvent:void 0,subagentRunId:void 0,messageId:``,activityType:``,patch:[]}}var nS={encode(e,t=new Y){e.baseEvent!==void 0&&Q.encode(e.baseEvent,t.uint32(10).fork()).join(),e.subagentRunId!==void 0&&t.uint32(18).string(e.subagentRunId),e.messageId!==``&&t.uint32(26).string(e.messageId),e.activityType!==``&&t.uint32(34).string(e.activityType);for(let n of e.patch)Wb.encode(n,t.uint32(42).fork()).join();return t},decode(e,t){let n=e instanceof X?e:new X(e),r=t===void 0?n.len:n.pos+t,i=tS();for(;n.pos>>3){case 1:if(e!==10)break;i.baseEvent=Q.decode(n,n.uint32());continue;case 2:if(e!==18)break;i.subagentRunId=n.string();continue;case 3:if(e!==26)break;i.messageId=n.string();continue;case 4:if(e!==34)break;i.activityType=n.string();continue;case 5:if(e!==42)break;i.patch.push(Wb.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=tS();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?Q.fromPartial(e.baseEvent):void 0,t.subagentRunId=e.subagentRunId??void 0,t.messageId=e.messageId??``,t.activityType=e.activityType??``,t.patch=e.patch?.map(e=>Wb.fromPartial(e))||[],t}};function rS(){return{baseEvent:void 0,event:void 0,source:void 0,subagentRunId:void 0}}var iS={encode(e,t=new Y){return e.baseEvent!==void 0&&Q.encode(e.baseEvent,t.uint32(10).fork()).join(),e.event!==void 0&&Z.encode(Z.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 X?e:new X(e),r=t===void 0?n.len:n.pos+t,i=rS();for(;n.pos>>3){case 1:if(e!==10)break;i.baseEvent=Q.decode(n,n.uint32());continue;case 2:if(e!==18)break;i.event=Z.unwrap(Z.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 iS.fromPartial(e??{})},fromPartial(e){let t=rS();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?Q.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 aS(){return{baseEvent:void 0,name:``,value:void 0,subagentRunId:void 0}}var oS={encode(e,t=new Y){return e.baseEvent!==void 0&&Q.encode(e.baseEvent,t.uint32(10).fork()).join(),e.name!==``&&t.uint32(18).string(e.name),e.value!==void 0&&Z.encode(Z.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 X?e:new X(e),r=t===void 0?n.len:n.pos+t,i=aS();for(;n.pos>>3){case 1:if(e!==10)break;i.baseEvent=Q.decode(n,n.uint32());continue;case 2:if(e!==18)break;i.name=n.string();continue;case 3:if(e!==26)break;i.value=Z.unwrap(Z.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 oS.fromPartial(e??{})},fromPartial(e){let t=aS();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?Q.fromPartial(e.baseEvent):void 0,t.name=e.name??``,t.value=e.value??void 0,t.subagentRunId=e.subagentRunId??void 0,t}};function sS(){return{baseEvent:void 0,threadId:``,runId:``,parentRunId:void 0,input:void 0,protocolVersion:void 0}}var cS={encode(e,t=new Y){return e.baseEvent!==void 0&&Q.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.parentRunId!==void 0&&t.uint32(34).string(e.parentRunId),e.input!==void 0&&wx.encode(e.input,t.uint32(42).fork()).join(),e.protocolVersion!==void 0&&t.uint32(50).string(e.protocolVersion),t},decode(e,t){let n=e instanceof X?e:new X(e),r=t===void 0?n.len:n.pos+t,i=sS();for(;n.pos>>3){case 1:if(e!==10)break;i.baseEvent=Q.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.parentRunId=n.string();continue;case 5:if(e!==42)break;i.input=wx.decode(n,n.uint32());continue;case 6:if(e!==50)break;i.protocolVersion=n.string();continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return cS.fromPartial(e??{})},fromPartial(e){let t=sS();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?Q.fromPartial(e.baseEvent):void 0,t.threadId=e.threadId??``,t.runId=e.runId??``,t.parentRunId=e.parentRunId??void 0,t.input=e.input!==void 0&&e.input!==null?wx.fromPartial(e.input):void 0,t.protocolVersion=e.protocolVersion??void 0,t}};function lS(){return{baseEvent:void 0,threadId:``,runId:``,result:void 0,outcome:``,interrupts:[],usage:[],pendingToolCallIds:[]}}var uS={encode(e,t=new Y){e.baseEvent!==void 0&&Q.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&&Z.encode(Z.wrap(e.result),t.uint32(34).fork()).join(),e.outcome!==``&&t.uint32(42).string(e.outcome);for(let n of e.interrupts)Ex.encode(n,t.uint32(50).fork()).join();for(let n of e.usage)BS.encode(n,t.uint32(58).fork()).join();for(let n of e.pendingToolCallIds)t.uint32(66).string(n);return t},decode(e,t){let n=e instanceof X?e:new X(e),r=t===void 0?n.len:n.pos+t,i=lS();for(;n.pos>>3){case 1:if(e!==10)break;i.baseEvent=Q.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=Z.unwrap(Z.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(Ex.decode(n,n.uint32()));continue;case 7:if(e!==58)break;i.usage.push(BS.decode(n,n.uint32()));continue;case 8:if(e!==66)break;i.pendingToolCallIds.push(n.string());continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return uS.fromPartial(e??{})},fromPartial(e){let t=lS();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?Q.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=>Ex.fromPartial(e))||[],t.usage=e.usage?.map(e=>BS.fromPartial(e))||[],t.pendingToolCallIds=e.pendingToolCallIds?.map(e=>e)||[],t}};function dS(){return{baseEvent:void 0,code:void 0,message:``,usage:[]}}var fS={encode(e,t=new Y){e.baseEvent!==void 0&&Q.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)BS.encode(n,t.uint32(34).fork()).join();return t},decode(e,t){let n=e instanceof X?e:new X(e),r=t===void 0?n.len:n.pos+t,i=dS();for(;n.pos>>3){case 1:if(e!==10)break;i.baseEvent=Q.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(BS.decode(n,n.uint32()));continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return fS.fromPartial(e??{})},fromPartial(e){let t=dS();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?Q.fromPartial(e.baseEvent):void 0,t.code=e.code??void 0,t.message=e.message??``,t.usage=e.usage?.map(e=>BS.fromPartial(e))||[],t}};function pS(){return{baseEvent:void 0,stepName:``,subagentRunId:void 0}}var mS={encode(e,t=new Y){return e.baseEvent!==void 0&&Q.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 X?e:new X(e),r=t===void 0?n.len:n.pos+t,i=pS();for(;n.pos>>3){case 1:if(e!==10)break;i.baseEvent=Q.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 mS.fromPartial(e??{})},fromPartial(e){let t=pS();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?Q.fromPartial(e.baseEvent):void 0,t.stepName=e.stepName??``,t.subagentRunId=e.subagentRunId??void 0,t}};function hS(){return{baseEvent:void 0,stepName:``,subagentRunId:void 0}}var gS={encode(e,t=new Y){return e.baseEvent!==void 0&&Q.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 X?e:new X(e),r=t===void 0?n.len:n.pos+t,i=hS();for(;n.pos>>3){case 1:if(e!==10)break;i.baseEvent=Q.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 gS.fromPartial(e??{})},fromPartial(e){let t=hS();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?Q.fromPartial(e.baseEvent):void 0,t.stepName=e.stepName??``,t.subagentRunId=e.subagentRunId??void 0,t}};function _S(){return{baseEvent:void 0,subagentRunId:void 0,messageId:``}}var vS={encode(e,t=new Y){return e.baseEvent!==void 0&&Q.encode(e.baseEvent,t.uint32(10).fork()).join(),e.subagentRunId!==void 0&&t.uint32(18).string(e.subagentRunId),e.messageId!==``&&t.uint32(26).string(e.messageId),t},decode(e,t){let n=e instanceof X?e:new X(e),r=t===void 0?n.len:n.pos+t,i=_S();for(;n.pos>>3){case 1:if(e!==10)break;i.baseEvent=Q.decode(n,n.uint32());continue;case 2:if(e!==18)break;i.subagentRunId=n.string();continue;case 3:if(e!==26)break;i.messageId=n.string();continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return vS.fromPartial(e??{})},fromPartial(e){let t=_S();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?Q.fromPartial(e.baseEvent):void 0,t.subagentRunId=e.subagentRunId??void 0,t.messageId=e.messageId??``,t}};function yS(){return{baseEvent:void 0,subagentRunId:void 0,messageId:``,role:``}}var bS={encode(e,t=new Y){return e.baseEvent!==void 0&&Q.encode(e.baseEvent,t.uint32(10).fork()).join(),e.subagentRunId!==void 0&&t.uint32(18).string(e.subagentRunId),e.messageId!==``&&t.uint32(26).string(e.messageId),e.role!==``&&t.uint32(34).string(e.role),t},decode(e,t){let n=e instanceof X?e:new X(e),r=t===void 0?n.len:n.pos+t,i=yS();for(;n.pos>>3){case 1:if(e!==10)break;i.baseEvent=Q.decode(n,n.uint32());continue;case 2:if(e!==18)break;i.subagentRunId=n.string();continue;case 3:if(e!==26)break;i.messageId=n.string();continue;case 4:if(e!==34)break;i.role=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=yS();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?Q.fromPartial(e.baseEvent):void 0,t.subagentRunId=e.subagentRunId??void 0,t.messageId=e.messageId??``,t.role=e.role??``,t}};function xS(){return{baseEvent:void 0,subagentRunId:void 0,messageId:``,delta:``}}var SS={encode(e,t=new Y){return e.baseEvent!==void 0&&Q.encode(e.baseEvent,t.uint32(10).fork()).join(),e.subagentRunId!==void 0&&t.uint32(18).string(e.subagentRunId),e.messageId!==``&&t.uint32(26).string(e.messageId),e.delta!==``&&t.uint32(34).string(e.delta),t},decode(e,t){let n=e instanceof X?e:new X(e),r=t===void 0?n.len:n.pos+t,i=xS();for(;n.pos>>3){case 1:if(e!==10)break;i.baseEvent=Q.decode(n,n.uint32());continue;case 2:if(e!==18)break;i.subagentRunId=n.string();continue;case 3:if(e!==26)break;i.messageId=n.string();continue;case 4:if(e!==34)break;i.delta=n.string();continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return SS.fromPartial(e??{})},fromPartial(e){let t=xS();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?Q.fromPartial(e.baseEvent):void 0,t.subagentRunId=e.subagentRunId??void 0,t.messageId=e.messageId??``,t.delta=e.delta??``,t}};function CS(){return{baseEvent:void 0,subagentRunId:void 0,messageId:``}}var wS={encode(e,t=new Y){return e.baseEvent!==void 0&&Q.encode(e.baseEvent,t.uint32(10).fork()).join(),e.subagentRunId!==void 0&&t.uint32(18).string(e.subagentRunId),e.messageId!==``&&t.uint32(26).string(e.messageId),t},decode(e,t){let n=e instanceof X?e:new X(e),r=t===void 0?n.len:n.pos+t,i=CS();for(;n.pos>>3){case 1:if(e!==10)break;i.baseEvent=Q.decode(n,n.uint32());continue;case 2:if(e!==18)break;i.subagentRunId=n.string();continue;case 3:if(e!==26)break;i.messageId=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=CS();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?Q.fromPartial(e.baseEvent):void 0,t.subagentRunId=e.subagentRunId??void 0,t.messageId=e.messageId??``,t}};function TS(){return{baseEvent:void 0,subagentRunId:void 0,messageId:void 0,delta:void 0}}var ES={encode(e,t=new Y){return e.baseEvent!==void 0&&Q.encode(e.baseEvent,t.uint32(10).fork()).join(),e.subagentRunId!==void 0&&t.uint32(18).string(e.subagentRunId),e.messageId!==void 0&&t.uint32(26).string(e.messageId),e.delta!==void 0&&t.uint32(34).string(e.delta),t},decode(e,t){let n=e instanceof X?e:new X(e),r=t===void 0?n.len:n.pos+t,i=TS();for(;n.pos>>3){case 1:if(e!==10)break;i.baseEvent=Q.decode(n,n.uint32());continue;case 2:if(e!==18)break;i.subagentRunId=n.string();continue;case 3:if(e!==26)break;i.messageId=n.string();continue;case 4:if(e!==34)break;i.delta=n.string();continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return ES.fromPartial(e??{})},fromPartial(e){let t=TS();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?Q.fromPartial(e.baseEvent):void 0,t.subagentRunId=e.subagentRunId??void 0,t.messageId=e.messageId??void 0,t.delta=e.delta??void 0,t}};function DS(){return{baseEvent:void 0,subagentRunId:void 0,messageId:``}}var OS={encode(e,t=new Y){return e.baseEvent!==void 0&&Q.encode(e.baseEvent,t.uint32(10).fork()).join(),e.subagentRunId!==void 0&&t.uint32(18).string(e.subagentRunId),e.messageId!==``&&t.uint32(26).string(e.messageId),t},decode(e,t){let n=e instanceof X?e:new X(e),r=t===void 0?n.len:n.pos+t,i=DS();for(;n.pos>>3){case 1:if(e!==10)break;i.baseEvent=Q.decode(n,n.uint32());continue;case 2:if(e!==18)break;i.subagentRunId=n.string();continue;case 3:if(e!==26)break;i.messageId=n.string();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.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?Q.fromPartial(e.baseEvent):void 0,t.subagentRunId=e.subagentRunId??void 0,t.messageId=e.messageId??``,t}};function kS(){return{baseEvent:void 0,subagentRunId:void 0,subtype:``,entityId:``,encryptedValue:``}}var AS={encode(e,t=new Y){return e.baseEvent!==void 0&&Q.encode(e.baseEvent,t.uint32(10).fork()).join(),e.subagentRunId!==void 0&&t.uint32(18).string(e.subagentRunId),e.subtype!==``&&t.uint32(26).string(e.subtype),e.entityId!==``&&t.uint32(34).string(e.entityId),e.encryptedValue!==``&&t.uint32(42).string(e.encryptedValue),t},decode(e,t){let n=e instanceof X?e:new X(e),r=t===void 0?n.len:n.pos+t,i=kS();for(;n.pos>>3){case 1:if(e!==10)break;i.baseEvent=Q.decode(n,n.uint32());continue;case 2:if(e!==18)break;i.subagentRunId=n.string();continue;case 3:if(e!==26)break;i.subtype=n.string();continue;case 4:if(e!==34)break;i.entityId=n.string();continue;case 5:if(e!==42)break;i.encryptedValue=n.string();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.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?Q.fromPartial(e.baseEvent):void 0,t.subagentRunId=e.subagentRunId??void 0,t.subtype=e.subtype??``,t.entityId=e.entityId??``,t.encryptedValue=e.encryptedValue??``,t}};function jS(){return{baseEvent:void 0,subagentRunId:``,name:``,description:void 0,parentSubagentRunId:void 0,parentToolCallId:void 0,parentMessageId:void 0}}var MS={encode(e,t=new Y){return e.baseEvent!==void 0&&Q.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 X?e:new X(e),r=t===void 0?n.len:n.pos+t,i=jS();for(;n.pos>>3){case 1:if(e!==10)break;i.baseEvent=Q.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 MS.fromPartial(e??{})},fromPartial(e){let t=jS();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?Q.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 NS(){return{baseEvent:void 0,subagentRunId:``,result:void 0,outcome:``,interruptIds:[]}}var PS={encode(e,t=new Y){e.baseEvent!==void 0&&Q.encode(e.baseEvent,t.uint32(10).fork()).join(),e.subagentRunId!==``&&t.uint32(18).string(e.subagentRunId),e.result!==void 0&&Z.encode(Z.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 X?e:new X(e),r=t===void 0?n.len:n.pos+t,i=NS();for(;n.pos>>3){case 1:if(e!==10)break;i.baseEvent=Q.decode(n,n.uint32());continue;case 2:if(e!==18)break;i.subagentRunId=n.string();continue;case 3:if(e!==26)break;i.result=Z.unwrap(Z.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 PS.fromPartial(e??{})},fromPartial(e){let t=NS();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?Q.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 FS(){return{baseEvent:void 0,subagentRunId:``,message:``,code:void 0}}var IS={encode(e,t=new Y){return e.baseEvent!==void 0&&Q.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 X?e:new X(e),r=t===void 0?n.len:n.pos+t,i=FS();for(;n.pos>>3){case 1:if(e!==10)break;i.baseEvent=Q.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 IS.fromPartial(e??{})},fromPartial(e){let t=FS();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?Q.fromPartial(e.baseEvent):void 0,t.subagentRunId=e.subagentRunId??``,t.message=e.message??``,t.code=e.code??void 0,t}};function LS(){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,toolCallResult:void 0,activitySnapshot:void 0,activityDelta:void 0,reasoningStart:void 0,reasoningMessageStart:void 0,reasoningMessageContent:void 0,reasoningMessageEnd:void 0,reasoningMessageChunk:void 0,reasoningEnd:void 0,reasoningEncryptedValue:void 0}}var RS={encode(e,t=new Y){return e.textMessageStart!==void 0&&Ax.encode(e.textMessageStart,t.uint32(10).fork()).join(),e.textMessageContent!==void 0&&Mx.encode(e.textMessageContent,t.uint32(18).fork()).join(),e.textMessageEnd!==void 0&&Px.encode(e.textMessageEnd,t.uint32(26).fork()).join(),e.toolCallStart!==void 0&&Rx.encode(e.toolCallStart,t.uint32(34).fork()).join(),e.toolCallArgs!==void 0&&Bx.encode(e.toolCallArgs,t.uint32(42).fork()).join(),e.toolCallEnd!==void 0&&Hx.encode(e.toolCallEnd,t.uint32(50).fork()).join(),e.stateSnapshot!==void 0&&Jx.encode(e.stateSnapshot,t.uint32(58).fork()).join(),e.stateDelta!==void 0&&Xx.encode(e.stateDelta,t.uint32(66).fork()).join(),e.messagesSnapshot!==void 0&&Qx.encode(e.messagesSnapshot,t.uint32(74).fork()).join(),e.raw!==void 0&&iS.encode(e.raw,t.uint32(82).fork()).join(),e.custom!==void 0&&oS.encode(e.custom,t.uint32(90).fork()).join(),e.runStarted!==void 0&&cS.encode(e.runStarted,t.uint32(98).fork()).join(),e.runFinished!==void 0&&uS.encode(e.runFinished,t.uint32(106).fork()).join(),e.runError!==void 0&&fS.encode(e.runError,t.uint32(114).fork()).join(),e.stepStarted!==void 0&&mS.encode(e.stepStarted,t.uint32(122).fork()).join(),e.stepFinished!==void 0&&gS.encode(e.stepFinished,t.uint32(130).fork()).join(),e.textMessageChunk!==void 0&&Ix.encode(e.textMessageChunk,t.uint32(138).fork()).join(),e.toolCallChunk!==void 0&&Wx.encode(e.toolCallChunk,t.uint32(146).fork()).join(),e.subagentStarted!==void 0&&MS.encode(e.subagentStarted,t.uint32(154).fork()).join(),e.subagentFinished!==void 0&&PS.encode(e.subagentFinished,t.uint32(162).fork()).join(),e.subagentError!==void 0&&IS.encode(e.subagentError,t.uint32(170).fork()).join(),e.toolCallResult!==void 0&&Kx.encode(e.toolCallResult,t.uint32(178).fork()).join(),e.activitySnapshot!==void 0&&eS.encode(e.activitySnapshot,t.uint32(186).fork()).join(),e.activityDelta!==void 0&&nS.encode(e.activityDelta,t.uint32(194).fork()).join(),e.reasoningStart!==void 0&&vS.encode(e.reasoningStart,t.uint32(202).fork()).join(),e.reasoningMessageStart!==void 0&&bS.encode(e.reasoningMessageStart,t.uint32(210).fork()).join(),e.reasoningMessageContent!==void 0&&SS.encode(e.reasoningMessageContent,t.uint32(218).fork()).join(),e.reasoningMessageEnd!==void 0&&wS.encode(e.reasoningMessageEnd,t.uint32(226).fork()).join(),e.reasoningMessageChunk!==void 0&&ES.encode(e.reasoningMessageChunk,t.uint32(234).fork()).join(),e.reasoningEnd!==void 0&&OS.encode(e.reasoningEnd,t.uint32(242).fork()).join(),e.reasoningEncryptedValue!==void 0&&AS.encode(e.reasoningEncryptedValue,t.uint32(250).fork()).join(),t},decode(e,t){let n=e instanceof X?e:new X(e),r=t===void 0?n.len:n.pos+t,i=LS();for(;n.pos>>3){case 1:if(e!==10)break;i.textMessageStart=Ax.decode(n,n.uint32());continue;case 2:if(e!==18)break;i.textMessageContent=Mx.decode(n,n.uint32());continue;case 3:if(e!==26)break;i.textMessageEnd=Px.decode(n,n.uint32());continue;case 4:if(e!==34)break;i.toolCallStart=Rx.decode(n,n.uint32());continue;case 5:if(e!==42)break;i.toolCallArgs=Bx.decode(n,n.uint32());continue;case 6:if(e!==50)break;i.toolCallEnd=Hx.decode(n,n.uint32());continue;case 7:if(e!==58)break;i.stateSnapshot=Jx.decode(n,n.uint32());continue;case 8:if(e!==66)break;i.stateDelta=Xx.decode(n,n.uint32());continue;case 9:if(e!==74)break;i.messagesSnapshot=Qx.decode(n,n.uint32());continue;case 10:if(e!==82)break;i.raw=iS.decode(n,n.uint32());continue;case 11:if(e!==90)break;i.custom=oS.decode(n,n.uint32());continue;case 12:if(e!==98)break;i.runStarted=cS.decode(n,n.uint32());continue;case 13:if(e!==106)break;i.runFinished=uS.decode(n,n.uint32());continue;case 14:if(e!==114)break;i.runError=fS.decode(n,n.uint32());continue;case 15:if(e!==122)break;i.stepStarted=mS.decode(n,n.uint32());continue;case 16:if(e!==130)break;i.stepFinished=gS.decode(n,n.uint32());continue;case 17:if(e!==138)break;i.textMessageChunk=Ix.decode(n,n.uint32());continue;case 18:if(e!==146)break;i.toolCallChunk=Wx.decode(n,n.uint32());continue;case 19:if(e!==154)break;i.subagentStarted=MS.decode(n,n.uint32());continue;case 20:if(e!==162)break;i.subagentFinished=PS.decode(n,n.uint32());continue;case 21:if(e!==170)break;i.subagentError=IS.decode(n,n.uint32());continue;case 22:if(e!==178)break;i.toolCallResult=Kx.decode(n,n.uint32());continue;case 23:if(e!==186)break;i.activitySnapshot=eS.decode(n,n.uint32());continue;case 24:if(e!==194)break;i.activityDelta=nS.decode(n,n.uint32());continue;case 25:if(e!==202)break;i.reasoningStart=vS.decode(n,n.uint32());continue;case 26:if(e!==210)break;i.reasoningMessageStart=bS.decode(n,n.uint32());continue;case 27:if(e!==218)break;i.reasoningMessageContent=SS.decode(n,n.uint32());continue;case 28:if(e!==226)break;i.reasoningMessageEnd=wS.decode(n,n.uint32());continue;case 29:if(e!==234)break;i.reasoningMessageChunk=ES.decode(n,n.uint32());continue;case 30:if(e!==242)break;i.reasoningEnd=OS.decode(n,n.uint32());continue;case 31:if(e!==250)break;i.reasoningEncryptedValue=AS.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.textMessageStart=e.textMessageStart!==void 0&&e.textMessageStart!==null?Ax.fromPartial(e.textMessageStart):void 0,t.textMessageContent=e.textMessageContent!==void 0&&e.textMessageContent!==null?Mx.fromPartial(e.textMessageContent):void 0,t.textMessageEnd=e.textMessageEnd!==void 0&&e.textMessageEnd!==null?Px.fromPartial(e.textMessageEnd):void 0,t.toolCallStart=e.toolCallStart!==void 0&&e.toolCallStart!==null?Rx.fromPartial(e.toolCallStart):void 0,t.toolCallArgs=e.toolCallArgs!==void 0&&e.toolCallArgs!==null?Bx.fromPartial(e.toolCallArgs):void 0,t.toolCallEnd=e.toolCallEnd!==void 0&&e.toolCallEnd!==null?Hx.fromPartial(e.toolCallEnd):void 0,t.stateSnapshot=e.stateSnapshot!==void 0&&e.stateSnapshot!==null?Jx.fromPartial(e.stateSnapshot):void 0,t.stateDelta=e.stateDelta!==void 0&&e.stateDelta!==null?Xx.fromPartial(e.stateDelta):void 0,t.messagesSnapshot=e.messagesSnapshot!==void 0&&e.messagesSnapshot!==null?Qx.fromPartial(e.messagesSnapshot):void 0,t.raw=e.raw!==void 0&&e.raw!==null?iS.fromPartial(e.raw):void 0,t.custom=e.custom!==void 0&&e.custom!==null?oS.fromPartial(e.custom):void 0,t.runStarted=e.runStarted!==void 0&&e.runStarted!==null?cS.fromPartial(e.runStarted):void 0,t.runFinished=e.runFinished!==void 0&&e.runFinished!==null?uS.fromPartial(e.runFinished):void 0,t.runError=e.runError!==void 0&&e.runError!==null?fS.fromPartial(e.runError):void 0,t.stepStarted=e.stepStarted!==void 0&&e.stepStarted!==null?mS.fromPartial(e.stepStarted):void 0,t.stepFinished=e.stepFinished!==void 0&&e.stepFinished!==null?gS.fromPartial(e.stepFinished):void 0,t.textMessageChunk=e.textMessageChunk!==void 0&&e.textMessageChunk!==null?Ix.fromPartial(e.textMessageChunk):void 0,t.toolCallChunk=e.toolCallChunk!==void 0&&e.toolCallChunk!==null?Wx.fromPartial(e.toolCallChunk):void 0,t.subagentStarted=e.subagentStarted!==void 0&&e.subagentStarted!==null?MS.fromPartial(e.subagentStarted):void 0,t.subagentFinished=e.subagentFinished!==void 0&&e.subagentFinished!==null?PS.fromPartial(e.subagentFinished):void 0,t.subagentError=e.subagentError!==void 0&&e.subagentError!==null?IS.fromPartial(e.subagentError):void 0,t.toolCallResult=e.toolCallResult!==void 0&&e.toolCallResult!==null?Kx.fromPartial(e.toolCallResult):void 0,t.activitySnapshot=e.activitySnapshot!==void 0&&e.activitySnapshot!==null?eS.fromPartial(e.activitySnapshot):void 0,t.activityDelta=e.activityDelta!==void 0&&e.activityDelta!==null?nS.fromPartial(e.activityDelta):void 0,t.reasoningStart=e.reasoningStart!==void 0&&e.reasoningStart!==null?vS.fromPartial(e.reasoningStart):void 0,t.reasoningMessageStart=e.reasoningMessageStart!==void 0&&e.reasoningMessageStart!==null?bS.fromPartial(e.reasoningMessageStart):void 0,t.reasoningMessageContent=e.reasoningMessageContent!==void 0&&e.reasoningMessageContent!==null?SS.fromPartial(e.reasoningMessageContent):void 0,t.reasoningMessageEnd=e.reasoningMessageEnd!==void 0&&e.reasoningMessageEnd!==null?wS.fromPartial(e.reasoningMessageEnd):void 0,t.reasoningMessageChunk=e.reasoningMessageChunk!==void 0&&e.reasoningMessageChunk!==null?ES.fromPartial(e.reasoningMessageChunk):void 0,t.reasoningEnd=e.reasoningEnd!==void 0&&e.reasoningEnd!==null?OS.fromPartial(e.reasoningEnd):void 0,t.reasoningEncryptedValue=e.reasoningEncryptedValue!==void 0&&e.reasoningEncryptedValue!==null?AS.fromPartial(e.reasoningEncryptedValue):void 0,t}};function zS(){return{provider:void 0,model:void 0,inputTokens:void 0,outputTokens:void 0,totalTokens:void 0,reasoningTokens:void 0,cachedInputTokens:void 0,cacheWriteInputTokens:void 0}}var BS={encode(e,t=new Y){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),e.cacheWriteInputTokens!==void 0&&t.uint32(64).int64(e.cacheWriteInputTokens),t},decode(e,t){let n=e instanceof X?e:new X(e),r=t===void 0?n.len:n.pos+t,i=zS();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=VS(n.int64());continue;case 4:if(e!==32)break;i.outputTokens=VS(n.int64());continue;case 5:if(e!==40)break;i.totalTokens=VS(n.int64());continue;case 6:if(e!==48)break;i.reasoningTokens=VS(n.int64());continue;case 7:if(e!==56)break;i.cachedInputTokens=VS(n.int64());continue;case 8:if(e!==64)break;i.cacheWriteInputTokens=VS(n.int64());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.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.cacheWriteInputTokens=e.cacheWriteInputTokens??void 0,t}};function VS(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,US=e=>Array.isArray(e)?e:[],WS=()=>typeof process<`u`&&!!{}.SUPPRESS_TRANSFORMATION_WARNINGS,GS=()=>{WS()||console.warn(`[ag-ui][proto] Dropped a content part this build does not know: the protocol has a variant this SDK predates.`)};new Set(Object.values(A));var KS={textMessageStart:`TEXT_MESSAGE_START`,textMessageContent:`TEXT_MESSAGE_CONTENT`,textMessageEnd:`TEXT_MESSAGE_END`,textMessageChunk:`TEXT_MESSAGE_CHUNK`,toolCallStart:`TOOL_CALL_START`,toolCallArgs:`TOOL_CALL_ARGS`,toolCallEnd:`TOOL_CALL_END`,toolCallChunk:`TOOL_CALL_CHUNK`,toolCallResult:`TOOL_CALL_RESULT`,stateSnapshot:`STATE_SNAPSHOT`,stateDelta:`STATE_DELTA`,messagesSnapshot:`MESSAGES_SNAPSHOT`,activitySnapshot:`ACTIVITY_SNAPSHOT`,activityDelta:`ACTIVITY_DELTA`,raw:`RAW`,custom:`CUSTOM`,runStarted:`RUN_STARTED`,runFinished:`RUN_FINISHED`,runError:`RUN_ERROR`,stepStarted:`STEP_STARTED`,stepFinished:`STEP_FINISHED`,reasoningStart:`REASONING_START`,reasoningMessageStart:`REASONING_MESSAGE_START`,reasoningMessageContent:`REASONING_MESSAGE_CONTENT`,reasoningMessageEnd:`REASONING_MESSAGE_END`,reasoningMessageChunk:`REASONING_MESSAGE_CHUNK`,reasoningEnd:`REASONING_END`,reasoningEncryptedValue:`REASONING_ENCRYPTED_VALUE`,subagentStarted:`SUBAGENT_STARTED`,subagentFinished:`SUBAGENT_FINISHED`,subagentError:`SUBAGENT_ERROR`},qS=new Set([1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31]),JS=e=>{let t=HS(e);if(t){if([t.data,t.url,t.file].filter(Boolean).length>1)throw Error(`Invalid event: source carries more than one arm`);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}}if(t.file){let e=t.file;return{type:`file`,value:e.value,provider:e.provider,mimeType:e.mimeType}}}},YS=e=>{let t=HS(e);if(t){if([t.text,t.image,t.audio,t.video,t.document].filter(Boolean).length>1)throw Error(`Invalid event: content part carries more than one arm`);if(t.text){let e=t.text;return{type:`text`,id:e.id,text:e.text,metadata:e.metadata}}if(t.image){let e=t.image;return e.source!==void 0&&JS(e.source)===void 0?void 0:{type:`image`,id:e.id,source:JS(e.source),metadata:e.metadata}}if(t.audio){let e=t.audio;return e.source!==void 0&&JS(e.source)===void 0?void 0:{type:`audio`,id:e.id,source:JS(e.source),metadata:e.metadata}}if(t.video){let e=t.video;return e.source!==void 0&&JS(e.source)===void 0?void 0:{type:`video`,id:e.id,source:JS(e.source),metadata:e.metadata}}if(t.document){let e=t.document;return e.source!==void 0&&JS(e.source)===void 0?void 0:{type:`document`,id:e.id,source:JS(e.source),metadata:e.metadata}}}},XS=new Set([`activity`]),ZS=new Set([`user`,`tool`]),QS=new Set([`developer`,`system`,`assistant`,`user`,`tool`,`activity`,`reasoning`]),$S=e=>{let t=HS(e)??{},n={...t},r=typeof t.role==`string`?t.role:``,i=QS.has(r),a=i?ZS.has(r):US(t.contentParts).length>0,o=i?XS.has(r):!a&&t.activityContent!==void 0;if(!i&&(t.content===void 0?0:1)+ +(US(t.contentParts).length>0)+(t.activityContent===void 0?0:1)>1)throw Error(`Invalid event: message carries more than one content form`);if(i){if(!a&&US(t.contentParts).length>0)throw Error(`Invalid event: message carries content parts for a role that has none`);if(t.activityContent!==void 0&&!o)throw Error(`Invalid event: message carries activity content for a non-activity role`);if(o&&t.content!==void 0)throw Error(`Invalid event: activity content cannot ride with other content forms`);if(a&&t.content!==void 0&&US(t.contentParts).length>0)throw Error(`Invalid event: message carries both string content and content parts`)}return a&&t.content===void 0&&(n.content=US(t.contentParts).map(e=>{let t=YS(e);return t===void 0&&GS(),t}).filter(e=>e!==void 0)),o&&t.activityContent!==void 0&&(n.content=t.activityContent),delete n.activityContent,delete n.contentParts,US(t.toolCalls).length===0&&delete n.toolCalls,Object.keys(n).forEach(e=>{n[e]===void 0&&delete n[e]}),n},eC=e=>{if(Array.isArray(e)){for(let t of e)eC(t);return}let t=HS(e);if(t)for(let e of Object.keys(t))t[e]===void 0?delete t[e]:eC(t[e])},tC=e=>{let t=HS(e);if(!t)return;let n={};return t.threadId!==void 0&&(n.threadId=t.threadId),t.runId!==void 0&&(n.runId=t.runId),t.protocolVersion!==void 0&&(n.protocolVersion=t.protocolVersion),t.parentRunId!==void 0&&(n.parentRunId=t.parentRunId),t.state!==void 0&&(n.state=t.state),n.messages=US(t.messages).map($S).filter(e=>e!==void 0),n.tools=US(t.tools),n.context=US(t.context),t.forwardedProps!==void 0&&(n.forwardedProps=t.forwardedProps),n.resume=US(t.resume),n},nC={TextMessageStartEvent:{singular:new Set([1]),descend:{1:`BaseEvent`}},BaseEvent:{singular:new Set([3,4]),descend:{},google:{3:`google.protobuf.Value`,4:`google.protobuf.Struct`}},TextMessageContentEvent:{singular:new Set([1]),descend:{1:`BaseEvent`}},TextMessageEndEvent:{singular:new Set([1]),descend:{1:`BaseEvent`}},ToolCallStartEvent:{singular:new Set([1]),descend:{1:`BaseEvent`}},ToolCallArgsEvent:{singular:new Set([1]),descend:{1:`BaseEvent`}},ToolCallEndEvent:{singular:new Set([1]),descend:{1:`BaseEvent`}},StateSnapshotEvent:{singular:new Set([1,2]),descend:{1:`BaseEvent`},google:{2:`google.protobuf.Value`}},StateDeltaEvent:{singular:new Set([1]),descend:{1:`BaseEvent`,2:`JsonPatchOperation`}},JsonPatchOperation:{singular:new Set([4]),descend:{},google:{4:`google.protobuf.Value`}},MessagesSnapshotEvent:{singular:new Set([1]),descend:{1:`BaseEvent`,2:`Message`}},Message:{singular:new Set([9,13]),descend:{5:`ToolCall`,8:`InputContent`},google:{9:`google.protobuf.Struct`,13:`google.protobuf.Struct`}},ToolCall:{singular:new Set([3,4]),descend:{},google:{4:`google.protobuf.Struct`}},InputContent:{singular:new Set([1,2,3,4,5]),descend:{1:`TextInputPart`,2:`ImageInputPart`,3:`AudioInputPart`,4:`VideoInputPart`,5:`DocumentInputPart`},arms:new Set([1,2,3,4,5])},TextInputPart:{singular:new Set([3]),descend:{},google:{3:`google.protobuf.Value`}},ImageInputPart:{singular:new Set([1,2]),descend:{1:`InputContentSource`},google:{2:`google.protobuf.Value`}},InputContentSource:{singular:new Set([1,2,3]),descend:{},arms:new Set([1,2,3])},AudioInputPart:{singular:new Set([1,2]),descend:{1:`InputContentSource`},google:{2:`google.protobuf.Value`}},VideoInputPart:{singular:new Set([1,2]),descend:{1:`InputContentSource`},google:{2:`google.protobuf.Value`}},DocumentInputPart:{singular:new Set([1,2]),descend:{1:`InputContentSource`},google:{2:`google.protobuf.Value`}},RawEvent:{singular:new Set([1,2]),descend:{1:`BaseEvent`},google:{2:`google.protobuf.Value`}},CustomEvent:{singular:new Set([1,3]),descend:{1:`BaseEvent`},google:{3:`google.protobuf.Value`}},RunStartedEvent:{singular:new Set([1,5]),descend:{1:`BaseEvent`,5:`RunAgentInput`}},RunAgentInput:{singular:new Set([4,8]),descend:{5:`Message`,6:`Tool`,9:`ResumeEntry`},google:{4:`google.protobuf.Value`,8:`google.protobuf.Value`}},Tool:{singular:new Set([3,4]),descend:{},google:{3:`google.protobuf.Value`,4:`google.protobuf.Struct`}},ResumeEntry:{singular:new Set([3,4]),descend:{},google:{3:`google.protobuf.Value`,4:`google.protobuf.Struct`}},RunFinishedEvent:{singular:new Set([1,4]),descend:{1:`BaseEvent`,6:`Interrupt`},google:{4:`google.protobuf.Value`}},Interrupt:{singular:new Set([5,7]),descend:{},google:{5:`google.protobuf.Value`,7:`google.protobuf.Value`}},RunErrorEvent:{singular:new Set([1]),descend:{1:`BaseEvent`}},StepStartedEvent:{singular:new Set([1]),descend:{1:`BaseEvent`}},StepFinishedEvent:{singular:new Set([1]),descend:{1:`BaseEvent`}},TextMessageChunkEvent:{singular:new Set([1]),descend:{1:`BaseEvent`}},ToolCallChunkEvent:{singular:new Set([1]),descend:{1:`BaseEvent`}},SubagentStartedEvent:{singular:new Set([1]),descend:{1:`BaseEvent`}},SubagentFinishedEvent:{singular:new Set([1,3]),descend:{1:`BaseEvent`},google:{3:`google.protobuf.Value`}},SubagentErrorEvent:{singular:new Set([1]),descend:{1:`BaseEvent`}},ToolCallResultEvent:{singular:new Set([1]),descend:{1:`BaseEvent`,7:`InputContent`}},ActivitySnapshotEvent:{singular:new Set([1,5]),descend:{1:`BaseEvent`},google:{5:`google.protobuf.Struct`}},ActivityDeltaEvent:{singular:new Set([1]),descend:{1:`BaseEvent`,5:`JsonPatchOperation`}},ReasoningStartEvent:{singular:new Set([1]),descend:{1:`BaseEvent`}},ReasoningMessageStartEvent:{singular:new Set([1]),descend:{1:`BaseEvent`}},ReasoningMessageContentEvent:{singular:new Set([1]),descend:{1:`BaseEvent`}},ReasoningMessageEndEvent:{singular:new Set([1]),descend:{1:`BaseEvent`}},ReasoningMessageChunkEvent:{singular:new Set([1]),descend:{1:`BaseEvent`}},ReasoningEndEvent:{singular:new Set([1]),descend:{1:`BaseEvent`}},ReasoningEncryptedValueEvent:{singular:new Set([1]),descend:{1:`BaseEvent`}},"google.protobuf.Struct":{singular:new Set,descend:{1:`google.protobuf.Struct.FieldsEntry`}},"google.protobuf.Struct.FieldsEntry":{singular:new Set([2]),descend:{2:`google.protobuf.Value`}},"google.protobuf.Value":{singular:new Set([5,6]),descend:{5:`google.protobuf.Struct`,6:`google.protobuf.ListValue`},arms:new Set([1,2,3,4,5,6]),armWireTypes:{1:0,2:1,3:2,4:0,5:2,6:2}},"google.protobuf.ListValue":{singular:new Set,descend:{1:`google.protobuf.Value`}}},rC={1:`TextMessageStartEvent`,2:`TextMessageContentEvent`,3:`TextMessageEndEvent`,4:`ToolCallStartEvent`,5:`ToolCallArgsEvent`,6:`ToolCallEndEvent`,7:`StateSnapshotEvent`,8:`StateDeltaEvent`,9:`MessagesSnapshotEvent`,10:`RawEvent`,11:`CustomEvent`,12:`RunStartedEvent`,13:`RunFinishedEvent`,14:`RunErrorEvent`,15:`StepStartedEvent`,16:`StepFinishedEvent`,17:`TextMessageChunkEvent`,18:`ToolCallChunkEvent`,19:`SubagentStartedEvent`,20:`SubagentFinishedEvent`,21:`SubagentErrorEvent`,22:`ToolCallResultEvent`,23:`ActivitySnapshotEvent`,24:`ActivityDeltaEvent`,25:`ReasoningStartEvent`,26:`ReasoningMessageStartEvent`,27:`ReasoningMessageContentEvent`,28:`ReasoningMessageEndEvent`,29:`ReasoningMessageChunkEvent`,30:`ReasoningEndEvent`,31:`ReasoningEncryptedValueEvent`};function iC(e,t){let n=0,r=0;for(;;){if(t.offset>=e.length)throw Error(`Invalid event`);let i=e[t.offset++];if(r<28?n+=(i&127)*2**r:r===28&&(n+=(i&15)*2**28),r+=7,!(i&128))return n}}function aC(e,t){let n={offset:0},r=0,i=0;for(;n.offsete.length)throw Error(`Invalid event`);if(r===0){if(t.arms?.has(o)){if(i!==0&&i!==o)throw Error(`Invalid event`);i=o}let r=t.descend[o];if(r!==void 0){let t=nC[r];t!==void 0&&aC(e.subarray(n.offset,n.offset+a),t)}}n.offset+=a}else if(s===5)n.offset+=4;else throw Error(`Invalid event`);if(n.offset>e.length)throw Error(`Invalid event`)}if(r!==0)throw Error(`Invalid event`)}function oC(e){let t=new Set,n={offset:0},r=0;for(;n.offset0&&!t.has(a))throw Error(`Invalid event`);t.add(a)}if(o===0)iC(e,n);else if(o===1)n.offset+=8;else if(o===2){let t=iC(e,n);if(n.offset+t>e.length)throw Error(`Invalid event`);if(r===0){let r=rC[a];if(r!==void 0){let i=nC[r];i!==void 0&&aC(e.subarray(n.offset,n.offset+t),i)}}n.offset+=t}else if(o===5)n.offset+=4;else throw Error(`Invalid event`);if(n.offset>e.length)throw Error(`Invalid event`)}if(r!==0)throw Error(`Invalid event`)}function sC(e){if(e.length===1)return e[0];let t=new Uint8Array(e.reduce((e,t)=>e+t.length,0)),n=0;for(let r of e)t.set(r,n),n+=r.length;return t}function cC(e,t){let n=new X(e),r=[],i=new Map,a,o=!1;for(;n.pos1||n!==t){s.push(new Y().uint32(e.number*8+2).bytes(n).finish()),o=!0;continue}}s.push(e.raw)}return o?sC(s):e}var lC=class extends Error{constructor(e=`Unknown event type`){super(e),this.name=`AGUIUnknownEventTypeError`}};function uC(e,t,n,r){let i=0,a=0,o=0;for(;;){if(t.offset>=e.length||o>=n)return-1;let s=e[t.offset++];if(o+=1,o===n&&s>r)return-1;if(i+=(s&127)*2**a,a+=7,!(s&128))return i}}var dC=(e,t)=>uC(e,t,5,15),fC=(e,t)=>uC(e,t,10,1);function pC(e){let t={offset:0},n=[];for(;t.offsete.length)return!1;t.offset+=n}else return!1;if(t.offset>e.length)return!1}return n.length===0}function mC(e){let t={offset:0},n=[],r=0;for(;t.offsete.length)return!1;if(s){if(qS.has(a)||!pC(e.subarray(t.offset,t.offset+n)))return!1;r+=1}t.offset+=n}else return!1;if(t.offset>e.length)return!1}return n.length===0&&r>0}function hC(e){oC(e);let t=RS.decode(cC(e,{singular:qS,descend:rC})),n=Object.entries(t).filter(([,e])=>e!==void 0);if(n.length!==1)throw n.length===0&&mC(e)?new lC:Error(`Invalid event`);let r=n[0],i=KS[r[0]];if(i===void 0)throw Error(`Invalid event`);let a=r[1],o=HS(a.baseEvent);if(!o)throw Error(`Invalid event`);let s=Dx[o.type];if(s!==i)throw Error(`Invalid event: envelope carries `+i+` but the base event declares `+String(s));if(a.type=i,a.timestamp=o.timestamp,a.rawEvent=o.rawEvent,o.metadata!==void 0&&(a.metadata=o.metadata),delete a.baseEvent,a.type===`MESSAGES_SNAPSHOT`&&Array.isArray(a.messages)&&(a.messages=a.messages.map($S).filter(e=>e!==void 0)),a.type===`RUN_FINISHED`){let e=a,t=typeof e.outcome==`string`&&e.outcome!==``?e.outcome:void 0,n={};n.pendingToolCallIds=e.pendingToolCallIds,delete e.pendingToolCallIds,n.interrupts=e.interrupts,delete e.interrupts,delete e.outcome,t===void 0&&(US(n.pendingToolCallIds).length>0&&(e.pendingToolCallIds=n.pendingToolCallIds),US(n.interrupts).length>0&&(e.interrupts=n.interrupts)),t===`success`&&(e.outcome={type:`success`,...US(n.pendingToolCallIds).length>0?{pendingToolCallIds:n.pendingToolCallIds}:{},...US(n.interrupts).length>0?{interrupts:n.interrupts}:{}}),t===`interrupt`&&(e.outcome={type:`interrupt`,interrupts:US(n.interrupts),...US(n.pendingToolCallIds).length>0?{pendingToolCallIds:n.pendingToolCallIds}:{}}),t===`cancelled`&&(e.outcome={type:`cancelled`,...US(n.pendingToolCallIds).length>0?{pendingToolCallIds:n.pendingToolCallIds}:{},...US(n.interrupts).length>0?{interrupts:n.interrupts}:{}}),t!==void 0&&![`success`,`interrupt`,`cancelled`].includes(t)&&(e.outcome={type:t,...US(n.pendingToolCallIds).length>0?{pendingToolCallIds:n.pendingToolCallIds}:{},...US(n.interrupts).length>0?{interrupts:n.interrupts}:{}})}if(a.type===`SUBAGENT_FINISHED`){let e=a,t=typeof e.outcome==`string`&&e.outcome!==``?e.outcome:void 0,n={};n.interruptIds=e.interruptIds,delete e.interruptIds,delete e.outcome,t===void 0&&US(n.interruptIds).length>0&&(e.interruptIds=n.interruptIds),t===`success`&&(e.outcome={type:`success`,...US(n.interruptIds).length>0?{interruptIds:n.interruptIds}:{}}),t===`suspended`&&(e.outcome={type:`suspended`,...US(n.interruptIds).length>0?{interruptIds:n.interruptIds}:{}}),t!==void 0&&![`success`,`suspended`].includes(t)&&(e.outcome={type:t,...US(n.interruptIds).length>0?{interruptIds:n.interruptIds}:{}})}if(a.type===`STATE_DELTA`&&Array.isArray(a.delta)&&(a.delta=a.delta.map(e=>{let t=Hb[e.op];return e.op=typeof t==`string`&&t!==`UNRECOGNIZED`?t.toLowerCase():String(e.op),Object.keys(e).forEach(t=>{e[t]===void 0&&delete e[t]}),e})),a.type===`ACTIVITY_DELTA`&&Array.isArray(a.patch)&&(a.patch=a.patch.map(e=>{let t=Hb[e.op];return e.op=typeof t==`string`&&t!==`UNRECOGNIZED`?t.toLowerCase():String(e.op),Object.keys(e).forEach(t=>{e[t]===void 0&&delete e[t]}),e})),a.type===`RUN_FINISHED`&&Array.isArray(a.usage)&&a.usage.length===0&&delete a.usage,a.type===`RUN_ERROR`&&Array.isArray(a.usage)&&a.usage.length===0&&delete a.usage,a.type===`TOOL_CALL_RESULT`){let e=a;if(e.content!==void 0&&US(e.contentParts).length>0)throw Error(`Invalid event: content carries both string content and content parts`);e.content===void 0&&(e.content=US(e.contentParts).map(e=>{let t=YS(e);return t===void 0&&GS(),t}).filter(e=>e!==void 0)),delete e.contentParts}return a.type===`RUN_STARTED`&&a.input!==void 0&&(a.input=tC(a.input)),eC(a),a}var gC=/^[v^~<>=]*?(\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+))?(?:-([\da-z\-]+(?:\.[\da-z\-]+)*))?(?:\+[\da-z\-]+(?:\.[\da-z\-]+)*)?)?)?$/i,_C=e=>{if(typeof e!=`string`)throw TypeError(`Invalid argument expected string`);let t=e.match(gC);if(!t)throw Error(`Invalid argument not valid semver ('${e}' received)`);return t.shift(),t},vC=e=>e===`*`||e===`x`||e===`X`,yC=e=>{let t=parseInt(e,10);return isNaN(t)?e:t},bC=(e,t)=>typeof e==typeof t?[e,t]:[String(e),String(t)],xC=(e,t)=>{if(vC(e)||vC(t))return 0;let[n,r]=bC(yC(e),yC(t));return n>r?1:n{for(let n=0;n{let n=_C(e),r=_C(t),i=n.pop(),a=r.pop(),o=SC(n,r);return o===0?i&&a?SC(i.split(`.`),a.split(`.`)):i||a?i?-1:1:0:o},wC=e=>typeof e==`string`&&/^[v\d]/.test(e)&&gC.test(e);Object.freeze({status:`aborted`});function $(e,t,n){function r(n,r){var i;Object.defineProperty(n,"_zod",{value:n._zod??{},enumerable:!1}),(i=n._zod).traits??(i.traits=new Set),n._zod.traits.add(e),t(n,r);for(let e in o.prototype)e in n||Object.defineProperty(n,e,{value:o.prototype[e].bind(n)});n._zod.constr=o,n._zod.def=r}let i=n?.Parent??Object;class a extends i{}Object.defineProperty(a,"name",{value:e});function o(e){var t;let i=n?.Parent?new a:this;r(i,e),(t=i._zod).deferred??(t.deferred=[]);for(let e of i._zod.deferred)e();return i}return Object.defineProperty(o,"init",{value:r}),Object.defineProperty(o,Symbol.hasInstance,{value:t=>n?.Parent&&t instanceof n.Parent?!0:t?._zod?.traits?.has(e)}),Object.defineProperty(o,"name",{value:e}),o}var TC=class extends Error{constructor(){super(`Encountered Promise during synchronous parse. Use .parseAsync() instead.`)}},EC={};function DC(e){return e&&Object.assign(EC,e),EC}function OC(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 kC(e,t){return typeof t==`bigint`?t.toString():t}function AC(e){return{get value(){{let t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function jC(e){return e==null}function MC(e){let t=+!!e.startsWith(`^`),n=e.endsWith(`$`)?e.length-1:e.length;return e.slice(t,n)}function NC(e,t,n){Object.defineProperty(e,t,{get(){{let r=n();return e[t]=r,r}},set(n){Object.defineProperty(e,t,{value:n})},configurable:!0})}function PC(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function FC(e){return JSON.stringify(e)}var IC=Error.captureStackTrace?Error.captureStackTrace:(...e)=>{};function LC(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}var RC=AC(()=>{if(typeof navigator<`u`&&navigator?.userAgent?.includes(`Cloudflare`))return!1;try{return Function(``),!0}catch{return!1}});function zC(e){if(LC(e)===!1)return!1;let t=e.constructor;if(t===void 0)return!0;let n=t.prototype;return LC(n)!==!1&&Object.prototype.hasOwnProperty.call(n,`isPrototypeOf`)!==!1}var BC=new Set([`string`,`number`,`symbol`]);function VC(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}function HC(e,t,n){let r=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(r._zod.parent=e),r}function UC(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 WC(e){return Object.keys(e).filter(t=>e[t]._zod.optin===`optional`&&e[t]._zod.optout===`optional`)}function GC(e,t){let n={},r=e._zod.def;for(let e in t){if(!(e in r.shape))throw Error(`Unrecognized key: "${e}"`);t[e]&&(n[e]=r.shape[e])}return HC(e,{...e._zod.def,shape:n,checks:[]})}function KC(e,t){let n={...e._zod.def.shape},r=e._zod.def;for(let e in t){if(!(e in r.shape))throw Error(`Unrecognized key: "${e}"`);t[e]&&delete n[e]}return HC(e,{...e._zod.def,shape:n,checks:[]})}function qC(e,t){if(!zC(t))throw Error(`Invalid input to extend: expected a plain object`);return HC(e,{...e._zod.def,get shape(){let n={...e._zod.def.shape,...t};return PC(this,`shape`,n),n},checks:[]})}function JC(e,t){return HC(e,{...e._zod.def,get shape(){let n={...e._zod.def.shape,...t._zod.def.shape};return PC(this,`shape`,n),n},catchall:t._zod.def.catchall,checks:[]})}function YC(e,t,n){let r=t._zod.def.shape,i={...r};if(n)for(let t in n){if(!(t in r))throw Error(`Unrecognized key: "${t}"`);n[t]&&(i[t]=e?new e({type:`optional`,innerType:r[t]}):r[t])}else for(let t in r)i[t]=e?new e({type:`optional`,innerType:r[t]}):r[t];return HC(t,{...t._zod.def,shape:i,checks:[]})}function XC(e,t,n){let r=t._zod.def.shape,i={...r};if(n)for(let t in n){if(!(t in i))throw Error(`Unrecognized key: "${t}"`);n[t]&&(i[t]=new e({type:`nonoptional`,innerType:r[t]}))}else for(let t in r)i[t]=new e({type:`nonoptional`,innerType:r[t]});return HC(t,{...t._zod.def,shape:i,checks:[]})}function ZC(e,t=0){for(let n=t;n{var n;return(n=t).path??(n.path=[]),t.path.unshift(e),t})}function $C(e){return typeof e==`string`?e:e?.message}function ew(e,t,n){let r={...e,path:e.path??[]};return e.message||(r.message=$C(e.inst?._zod.def?.error?.(e))??$C(t?.error?.(e))??$C(n.customError?.(e))??$C(n.localeError?.(e))??`Invalid input`),delete r.inst,delete r.continue,t?.reportInput||delete r.input,r}function tw(e){return Array.isArray(e)?`array`:typeof e==`string`?`string`:`unknown`}function nw(...e){let[t,n,r]=e;return typeof t==`string`?{message:t,code:`custom`,input:n,inst:r}:{...t}}var rw=(e,t)=>{e.name=`$ZodError`,Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),Object.defineProperty(e,"message",{get(){return JSON.stringify(t,kC,2)},enumerable:!0}),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},iw=$(`$ZodError`,rw),aw=$(`$ZodError`,rw,{Parent:Error});function ow(e,t=e=>e.message){let n={},r=[];for(let i of e.issues)i.path.length>0?(n[i.path[0]]=n[i.path[0]]||[],n[i.path[0]].push(t(i))):r.push(t(i));return{formErrors:r,fieldErrors:n}}function sw(e,t){let n=t||function(e){return e.message},r={_errors:[]},i=e=>{for(let t of e.issues)if(t.code===`invalid_union`&&t.errors.length)t.errors.map(e=>i({issues:e}));else if(t.code===`invalid_key`)i({issues:t.issues});else if(t.code===`invalid_element`)i({issues:t.issues});else if(t.path.length===0)r._errors.push(n(t));else{let e=r,i=0;for(;i(t,n,r,i)=>{let a=r?Object.assign(r,{async:!1}):{async:!1},o=t._zod.run({value:n,issues:[]},a);if(o instanceof Promise)throw new TC;if(o.issues.length){let t=new((i?.Err)??e)(o.issues.map(e=>ew(e,a,DC())));throw IC(t,i?.callee),t}return o.value},lw=e=>async(t,n,r,i)=>{let a=r?Object.assign(r,{async:!0}):{async:!0},o=t._zod.run({value:n,issues:[]},a);if(o instanceof Promise&&(o=await o),o.issues.length){let t=new((i?.Err)??e)(o.issues.map(e=>ew(e,a,DC())));throw IC(t,i?.callee),t}return o.value},uw=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 TC;return a.issues.length?{success:!1,error:new(e??iw)(a.issues.map(e=>ew(e,i,DC())))}:{success:!0,data:a.value}},dw=uw(aw),fw=e=>async(t,n,r)=>{let i=r?Object.assign(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=>ew(e,i,DC())))}:{success:!0,data:a.value}},pw=fw(aw),mw=$(`$ZodCheck`,(e,t)=>{var n;e._zod??={},e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),hw=$(`$ZodCheckMaxLength`,(e,t)=>{var n;mw.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return!jC(t)&&t.length!==void 0}),e._zod.onattach.push(e=>{let n=e._zod.bag.maximum??1/0;t.maximum{let r=n.value;if(r.length<=t.maximum)return;let i=tw(r);n.issues.push({origin:i,code:`too_big`,maximum:t.maximum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),gw=$(`$ZodCheckMinLength`,(e,t)=>{var n;mw.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return!jC(t)&&t.length!==void 0}),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;if(r.length>=t.minimum)return;let i=tw(r);n.issues.push({origin:i,code:`too_small`,minimum:t.minimum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),_w=$(`$ZodCheckLengthEquals`,(e,t)=>{var n;mw.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return!jC(t)&&t.length!==void 0}),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;if(i===t.length)return;let a=tw(r),o=i>t.length;n.issues.push({origin:a,...o?{code:`too_big`,maximum:t.length}:{code:`too_small`,minimum:t.length},inclusive:!0,exact:!0,input:n.value,inst:e,continue:!t.abort})}}),vw=$(`$ZodCheckOverwrite`,(e,t)=>{mw.init(e,t),e._zod.check=e=>{e.value=t.tx(e.value)}}),yw=class{constructor(e=[]){this.content=[],this.indent=0,this&&(this.args=e)}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(` +Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let n of e.seen.entries()){let r=n[1];if(t===n[0]){a(n);continue}if(e.external){let r=e.external.registry.get(n[0])?.id;if(t!==n[0]&&r){a(n);continue}}if(e.metadataRegistry.get(n[0])?.id){a(n);continue}if(r.cycle){a(n);continue}r.count>1&&e.reused===`ref`&&a(n)}e.external&&(e.sharedDefsExtractedFor=e.external)}function Lh(e){let t=e.anyOf;if(!Array.isArray(t)||t.length===0||e.type!==void 0)return;let n=[];for(let e of t){if(!e||typeof e!=`object`)return;Lh(e);let t=Object.keys(e);if(t.length!==1||t[0]!==`type`)return;let r=e.type;for(let e of Array.isArray(r)?r:[r]){if(typeof e!=`string`)return;n.includes(e)||n.push(e)}}delete e.anyOf,e.type=n.length===1?n[0]:n}var Rh=new Set([`type`,`properties`,`required`,`additionalProperties`]),zh=[`oneOf`,`anyOf`];function Bh(e){let t=e.additionalProperties;return t===void 0||t===!1||typeof t!=`object`||!t?null:Object.keys(t).length?t:null}function Vh(e){let t=[];for(let n of e){if(typeof n!=`object`||n.type!==`object`)return null;for(let e in n)if(!Rh.has(e))return null;t.push(n)}let n={},r=new Set;for(let e of t){for(let r in e.properties){if(Object.prototype.hasOwnProperty.call(n,r))continue;let e=[];for(let n of t){let t=n.properties?.[r]??Bh(n);t!=null&&(e.some(e=>JSON.stringify(e)===JSON.stringify(t))||e.push(t))}Fl(n,r,e.length===1?e[0]:Vh(e)??{allOf:e})}for(let t of e.required??[])r.add(t)}let i={type:`object`,properties:n};if(r.size&&(i.required=[...r]),t.every(e=>e.additionalProperties===!1))i.additionalProperties=!1;else{let e=[];for(let n of t){let t=Bh(n);t&&!e.some(e=>JSON.stringify(e)===JSON.stringify(t))&&e.push(t)}e.length===1?i.additionalProperties=e[0]:e.length>1&&(i.additionalProperties={allOf:e})}return i}function Hh(e){let t=e.allOf;if(!Array.isArray(t)||t.length<2)return;for(let t of Rh)if(t in e)return;let n=t.filter(e=>zh.some(t=>Array.isArray(e[t]))),r=null;if(!n.length)r=Vh(t);else{let e=n[0],i=zh.find(t=>Array.isArray(e[t]));if(Object.keys(e).length!==1)return;let a=t.filter(t=>t!==e),o=e[i].map(e=>Vh([...a,e]));if(o.some(e=>!e))return;r={[i]:o}}r&&(delete e.allOf,jh(e,r))}function Uh(e,t){let n=e.seen.get(t);if(!n)throw Error(`Unprocessed schema. This is a bug in Zod.`);let r=t=>{let n=e.seen.get(t);if(n.ref===null)return;let i=n.def??n.schema,a={...i},o=n.ref;if(n.ref=null,o){r(o);let n=e.seen.get(o),s=n.schema;if(s.$ref&&(e.target===`draft-07`||e.target===`draft-04`||e.target===`openapi-3.0`)?(i.allOf=i.allOf??[],i.allOf.push(s)):jh(i,s),jh(i,a),t._zod.parent===o)for(let e in i)e!==`$ref`&&e!==`allOf`&&(e in a||delete i[e]);if(s.$ref&&n.def)for(let e in i)e!==`$ref`&&e!==`allOf`&&e in n.def&&JSON.stringify(i[e])===JSON.stringify(n.def[e])&&delete i[e]}let s=t._zod.parent;if(s&&s!==o){r(s);let t=e.seen.get(s);if(t?.schema.$ref&&(i.$ref=t.schema.$ref,t.def))for(let e in i)e!==`$ref`&&e!==`allOf`&&e in t.def&&JSON.stringify(i[e])===JSON.stringify(t.def[e])&&delete i[e]}e.override({zodSchema:t,jsonSchema:i,path:n.path??[]})};if(!e.external||e.sharedEmitDoneFor!==e.external){for(let t of[...e.seen.entries()].reverse())r(t[0]);if(e.target!==`openapi-3.0`)for(let t of e.seen.entries())Lh(t[1].def??t[1].schema);for(let t of e.deferred)t();if(e.intersections.length){let t=new Map;for(let n of e.seen.values())for(let e of[n.schema,n.def]){let n=e?.allOf;if(!Array.isArray(n))continue;let r=t.get(n);r?r.push(e):t.set(n,[e])}for(let n of e.intersections)for(let e of t.get(n)??[])Hh(e)}}let i={};if(e.target===`draft-2020-12`?i.$schema=`https://json-schema.org/draft/2020-12/schema`:e.target===`draft-07`?i.$schema=`http://json-schema.org/draft-07/schema#`:e.target===`draft-04`?i.$schema=`http://json-schema.org/draft-04/schema#`:e.target,e.external?.uri){let n=e.external.registry.get(t)?.id;if(!n)throw Error("Schema is missing an `id` property");i.$id=e.external.uri(n)}jh(i,n.defId?n.schema:n.def??n.schema);let a=e.metadataRegistry.get(t)?.id;a!==void 0&&i.id===a&&delete i.id;let o=e.external?.defs??{};if(!e.external||e.sharedEmitDoneFor!==e.external)for(let t of e.seen.entries()){let e=t[1];e.def&&e.defId&&(e.def.id===e.defId&&delete e.def.id,Fl(o,e.defId,e.def))}e.external&&(e.sharedEmitDoneFor=e.external),e.external||Object.keys(o).length>0&&(e.target===`draft-2020-12`?i.$defs=o:i.definitions=o);try{let n=JSON.parse(JSON.stringify(i));return Object.defineProperty(n,"~standard",{value:{...t[`~standard`],jsonSchema:{input:Kh(t,`input`,e.processors),output:Kh(t,`output`,e.processors)}},enumerable:!1,writable:!1}),n}catch{throw Error(`Error converting schema to JSON.`)}}function Wh(e,t){let n=t??{seen:new Set};if(n.seen.has(e))return!1;n.seen.add(e);let r=e._zod.def;if(r.type===`transform`)return!0;if(r.type===`array`)return Wh(r.element,n);if(r.type===`set`)return Wh(r.valueType,n);if(r.type===`lazy`)return Wh(r.getter(),n);if(r.type===`promise`||r.type===`optional`||r.type===`nonoptional`||r.type===`nullable`||r.type===`readonly`||r.type==="default"||r.type===`prefault`||r.type===`catch`)return Wh(r.innerType,n);if(r.type===`intersection`)return Wh(r.left,n)||Wh(r.right,n);if(r.type===`record`||r.type===`map`)return Wh(r.keyType,n)||Wh(r.valueType,n);if(r.type===`pipe`)return e._zod.traits.has(`$ZodCodec`)?!0:Wh(r.in,n)||Wh(r.out,n);if(r.type===`object`){for(let e in r.shape)if(Wh(r.shape[e],n))return!0;return!1}if(r.type===`union`){for(let e of r.options)if(Wh(e,n))return!0;return!1}if(r.type===`tuple`){for(let e of r.items)if(Wh(e,n))return!0;return!!(r.rest&&Wh(r.rest,n))}return!1}var Gh=(e,t={})=>n=>{let r=Mh({...n,processors:t});return Ph(e,r),Ih(r,e),Uh(r,e)},Kh=(e,t,n={})=>r=>{let{libraryOptions:i,target:a}=r??{},o=Mh({...i??{},target:a,io:t,processors:n});return Ph(e,o),Ih(o,e),Uh(o,e)},qh=(e,t,n)=>{(e[t]===void 0||n>e[t])&&(e[t]=n)},Jh=(e,t,n)=>{(e[t]===void 0||n{qh(e,`minimum`,t),Jh(e,`maximum`,t)},Xh=(e,t)=>{e.multipleOf??=[],e.multipleOf.includes(t)||e.multipleOf.push(t)},Zh=(e,t)=>{e.patterns??=new Set,e.patterns.add(t)},Qh=(e,t)=>{e.mime=e.mime?e.mime.filter(e=>t.includes(e)):[...t]},$h=(e,t)=>{e.format=t,t.includes(`int`)&&(e.isInt=!0)},eg=(e,t)=>qh(e,`minimum`,t.minimum),tg=(e,t)=>Jh(e,`maximum`,t.maximum),ng=e=>(t,n)=>{$h(t,n.format);let[r,i]=e[n.format];qh(t,`minimum`,r),Jh(t,`maximum`,i)},rg={greater_than:(e,t)=>qh(e,t.inclusive?`minimum`:`exclusiveMinimum`,t.value),less_than:(e,t)=>Jh(e,t.inclusive?`maximum`:`exclusiveMaximum`,t.value),multiple_of:(e,t)=>Xh(e,t.value),number_format:ng(tu),bigint_format:ng(nu),min_length:eg,max_length:tg,length_equals:(e,t)=>Yh(e,t.length),min_size:eg,max_size:tg,size_equals:(e,t)=>Yh(e,t.size),string_format:(e,t)=>{$h(e,t.format),t.pattern&&Zh(e,t.pattern),(t.format===`base64`||t.format===`base64url`)&&(e.contentEncoding=t.format),(t.local||t.precision===-1)&&(e.laxFormat=!0)},mime_type:(e,t)=>Qh(e,t.mime)};function ig(e){let t={},n=e._zod.def,r=e._zod.traits.has(`$ZodCheck`)?[e,...n.checks??[]]:n.checks??[];for(let e of r)rg[e._zod.def.check]?.(t,e._zod.def);let i=e._zod.bag;i.minimum!==void 0&&qh(t,`minimum`,i.minimum),i.exclusiveMinimum!==void 0&&qh(t,`exclusiveMinimum`,i.exclusiveMinimum),i.maximum!==void 0&&Jh(t,`maximum`,i.maximum),i.exclusiveMaximum!==void 0&&Jh(t,`exclusiveMaximum`,i.exclusiveMaximum),i.multipleOf!==void 0&&Xh(t,i.multipleOf),i.format!==void 0&&(t.format??=i.format,i.format.includes(`int`)&&(t.isInt=!0)),i.mime&&Qh(t,i.mime);for(let e of i.patterns??[])Zh(t,e);return t}var ag={guid:`uuid`,url:`uri`,datetime:`date-time`,json_string:`json-string`,regex:``},og=new Map([[z,Pd],[np,Fd]]),sg=e=>og.get(e)??e,cg=(e,t,n,r)=>{let i=n;i.type=`string`;let{minimum:a,maximum:o,format:s,patterns:c,contentEncoding:l,laxFormat:u}=ig(e);if(typeof a==`number`&&(i.minLength=a),typeof o==`number`&&(i.maxLength=o),s&&(i.format=ag[s]??s,i.format===``&&delete i.format,(s===`time`||u)&&delete i.format),l&&(i.contentEncoding=l),c&&c.size>0){let e=[...c].map(sg);e.length===1?i.pattern=e[0].source:e.length>1&&(i.allOf=[...e.map(e=>({...t.target===`draft-07`||t.target===`draft-04`||t.target===`openapi-3.0`?{type:`string`}:{},pattern:e.source}))])}},lg=(e,t,n,r)=>{let i=n,{minimum:a,maximum:o,multipleOf:s,exclusiveMaximum:c,exclusiveMinimum:l,isInt:u}=ig(e);i.type=u?`integer`:`number`;let d=typeof l==`number`&&l>=(a??-1/0),f=typeof c==`number`&&c<=(o??1/0),p=t.target===`draft-04`||t.target===`openapi-3.0`;if(d?p?(i.minimum=l,i.exclusiveMinimum=!0):i.exclusiveMinimum=l:typeof a==`number`&&(i.minimum=a),f?p?(i.maximum=c,i.exclusiveMaximum=!0):i.exclusiveMaximum=c:typeof o==`number`&&(i.maximum=o),s){let n=new Set;for(let a of s)Number.isFinite(a)&&a!==0?n.add(Math.abs(a)):Nh(e,t,i,r,`A multipleOf divisor of ${a} cannot be represented in JSON Schema`);let[a,...o]=n;a!==void 0&&(i.multipleOf=a),o.length&&(i.allOf=[...i.allOf??[],...o.map(e=>({multipleOf:e}))])}},ug=(e,t,n,r)=>{n.type=`boolean`},dg=(e,t,n,r)=>{Nh(e,t,n,r,`BigInt cannot be represented in JSON Schema`)},fg=(e,t,n,r)=>{Nh(e,t,n,r,`Symbols cannot be represented in JSON Schema`)},pg=(e,t,n,r)=>{t.target===`openapi-3.0`?(n.type=`string`,n.nullable=!0,n.enum=[null]):n.type=`null`},mg=(e,t,n,r)=>{Nh(e,t,n,r,`Undefined cannot be represented in JSON Schema`)},hg=(e,t,n,r)=>{Nh(e,t,n,r,`Void cannot be represented in JSON Schema`)},gg=(e,t,n,r)=>{n.not={}},_g=(e,t,n,r)=>{},vg=(e,t,n,r)=>{},yg=(e,t,n,r)=>{Nh(e,t,n,r,`Date cannot be represented in JSON Schema`)},bg=(e,t,n,r)=>{let i=e._zod.def,a=Tl(i.entries);if(a.length===0){n.not={};return}a.every(e=>typeof e==`number`)&&(n.type=`number`),a.every(e=>typeof e==`string`)&&(n.type=`string`),n.enum=a},xg=(e,t,n,r)=>{let i=e._zod.def;if(i.values.length===0){n.not={};return}let a=[];for(let o of i.values)if(o===void 0){if(Nh(e,t,n,r,"Literal `undefined` cannot be represented in JSON Schema"))return}else if(typeof o==`bigint`){if(Nh(e,t,n,r,`BigInt literals cannot be represented in JSON Schema`))return;a.push(Number(o))}else a.push(o);if(a.length!==0){if(a.length===1){let e=a[0];n.type=e===null?`null`:typeof e,t.target===`draft-04`||t.target===`openapi-3.0`?n.enum=[e]:n.const=e}else a.every(e=>typeof e==`number`)&&(n.type=`number`),a.every(e=>typeof e==`string`)&&(n.type=`string`),a.every(e=>typeof e==`boolean`)&&(n.type=`boolean`),a.every(e=>e===null)&&(n.type=`null`),n.enum=a}},Sg=(e,t,n,r)=>{Nh(e,t,n,r,`NaN cannot be represented in JSON Schema`)},Cg=(e,t,n,r)=>{let i=n,a=e._zod.pattern;if(!a)throw Error(`Pattern not found in template literal`);i.type=`string`,i.pattern=a.source},wg=(e,t,n,r)=>{let i=n;i.type=`string`,i.format=`binary`,i.contentEncoding=`binary`;let{minimum:a,maximum:o,mime:s}=ig(e);a!==void 0&&(i.minLength=a),o!==void 0&&(i.maxLength=o),s&&(s.length===0?i.not={}:s.length===1?i.contentMediaType=s[0]:i.anyOf=s.map(e=>({contentMediaType:e})))},Tg=(e,t,n,r)=>{n.type=`boolean`},Eg=(e,t,n,r)=>{Nh(e,t,n,r,`Custom types cannot be represented in JSON Schema`)},Dg=(e,t,n,r)=>{Nh(e,t,n,r,`Function types cannot be represented in JSON Schema`)},Og=(e,t,n,r)=>{Nh(e,t,n,r,`Transforms cannot be represented in JSON Schema`)},kg=(e,t,n,r)=>{Nh(e,t,n,r,`Map cannot be represented in JSON Schema`)},Ag=(e,t,n,r)=>{Nh(e,t,n,r,`Set cannot be represented in JSON Schema`)},jg=(e,t,n,r)=>{let i=n,a=e._zod.def,{minimum:o,maximum:s}=ig(e);typeof o==`number`&&(i.minItems=o),typeof s==`number`&&(i.maxItems=s),i.type=`array`,i.items=Ph(a.element,t,{...r,path:[...r.path,`items`]})};function Mg(e){let t=e._zod.def;return t.type===`pipe`&&t.in._zod.traits.has(`$ZodTransform`)?Mg(t.out):t.type===`catch`?Mg(t.innerType):e._zod.optin}var Ng=(e,t,n,r)=>{let i=n,a=e._zod.def,o=a.shape;if(Object.getOwnPropertySymbols(o).length&&Nh(e,t,i,r,`Symbol keys cannot be represented in JSON Schema`))return;i.type=`object`,i.properties={};for(let e in o)Fl(i.properties,e,Ph(o[e],t,{...r,path:[...r.path,`properties`,e]}));let s=[];for(let e of Object.keys(o)){let n=a.shape[e];(t.io===`input`?Mg(n)===void 0:n._zod.optout===void 0)&&s.push(e)}s.length>0&&(i.required=s),a.catchall?._zod.def.type===`never`?i.additionalProperties=!1:a.catchall?a.catchall&&(i.additionalProperties=Ph(a.catchall,t,{...r,path:[...r.path,`additionalProperties`]})):t.io===`output`&&(i.additionalProperties=!1)},Pg=(e,t,n,r)=>{let i=e._zod.def,a=i.inclusive===!1,o=i.options.map((e,n)=>Ph(e,t,{...r,path:[...r.path,a?`oneOf`:`anyOf`,n]}));a?n.oneOf=o:n.anyOf=o},Fg=(e,t,n,r)=>{let i=e._zod.def,a=Ph(i.left,t,{...r,path:[...r.path,`allOf`,0]}),o=Ph(i.right,t,{...r,path:[...r.path,`allOf`,1]}),s=e=>`allOf`in e&&Object.keys(e).length===1,c=[...s(a)?a.allOf:[a],...s(o)?o.allOf:[o]];n.allOf=c,t.intersections.push(c)},Ig=(e,t,n,r)=>{let i=n,a=e._zod.def;i.type=`array`;let o=t.target===`draft-2020-12`?`prefixItems`:`items`,s=t.target===`draft-2020-12`||t.target===`openapi-3.0`?`items`:`additionalItems`,c=a.items.map((e,n)=>Ph(e,t,{...r,path:[...r.path,o,n]})),l=a.rest?Ph(a.rest,t,{...r,path:[...r.path,s,...t.target===`openapi-3.0`?[a.items.length]:[]]}):null,u=a.items.length;for(;u>0;){let e=a.items[u-1];if(!(t.io===`input`?Mg(e)!==void 0:e._zod.optout===`optional`))break;u--}let d=a.items.length,f=!a.rest;t.target===`draft-2020-12`?(i.prefixItems=c,f?i.items=!1:l&&(i.items=l),u>0&&(i.minItems=u),f&&(i.maxItems=d)):t.target===`openapi-3.0`?(i.items={anyOf:c},l&&i.items.anyOf.push(l),u>0&&(i.minItems=u),f&&(i.maxItems=d)):(i.items=c,f?i.additionalItems=!1:l&&(i.additionalItems=l),u>0&&(i.minItems=u),f&&(i.maxItems=d));let{minimum:p,maximum:m}=ig(e);typeof p==`number`&&(i.minItems=p),typeof m==`number`&&(i.maxItems=m)};function Lg(e,t,n){if(t.$ref){if(n.has(t))return t;n.add(t);let r=e.get(t)?.def;if(!r)return t;let i=Lg(e,r,n);return i===r?t:i}for(let r of[`anyOf`,`oneOf`]){let i=t[r];if(!Array.isArray(i))continue;let a=i.map(t=>Lg(e,t,n));a.some((e,t)=>e!==i[t])&&(t={...t,[r]:a})}let r=Array.isArray(t.type)?t.type:[t.type],i=!r.includes(`string`)&&r.some(e=>e===`number`||e===`integer`),a=t.enum??(t.const===void 0?void 0:[t.const]);if(!i&&!a?.some(e=>typeof e==`number`))return t;let{minimum:o,maximum:s,exclusiveMinimum:c,exclusiveMaximum:l,multipleOf:u,format:d,id:f,...p}=t;return p.enum?p.enum=p.enum.map(e=>typeof e==`number`?String(e):e):typeof p.const==`number`&&(p.const=String(p.const)),i?(p.type=`string`,a||(p.pattern=(r.includes(`number`)?Kd:Gd).source),p):p}var Rg=new WeakMap;function zg(e){let t=new Map;for(let n of e.seen.values())n.def&&!t.has(n.schema)&&t.set(n.schema,n);let n=new Map;for(let r of Rg.get(e)??[]){let i=e.seen.get(r),a=(i?.def??i?.schema)?.propertyNames;if(!a||a===!0||n.has(a))continue;let o=Lg(t,a,new Set);o!==a&&n.set(a,o)}if(n.size)for(let t of e.seen.values())for(let e of[t.schema,t.def]){let t=e&&n.get(e.propertyNames);t&&(e.propertyNames=t)}}var Bg=(e,t,n,r)=>{let i=n,a=e._zod.def;i.type=`object`;let o=a.keyType,s=ig(o).patterns;if(a.mode===`loose`&&s&&s.size>0){let e=Ph(a.valueType,t,{...r,path:[...r.path,`patternProperties`,`*`]});i.patternProperties={};for(let t of s)Fl(i.patternProperties,sg(t).source,e)}else{if(t.target===`draft-07`||t.target===`draft-2020-12`){i.propertyNames=Ph(a.keyType,t,{...r,path:[...r.path,`propertyNames`]});let n=Rg.get(t);n||(n=[],Rg.set(t,n),t.deferred.push(()=>zg(t))),n.push(e)}i.additionalProperties=Ph(a.valueType,t,{...r,path:[...r.path,`additionalProperties`]})}let c=o._zod.values,l=t.io===`input`&&Mg(a.valueType)!==void 0;if(c&&!a.partial&&!l){let e=[...c].filter(e=>typeof e==`string`||typeof e==`number`);e.length>0&&(i.required=e.map(String))}},Vg=(e,t,n,r)=>{let i=e._zod.def,a=Ph(i.innerType,t,r),o=t.seen.get(e);t.target===`openapi-3.0`?(o.ref=i.innerType,n.nullable=!0):n.anyOf=[a,{type:`null`}]},Hg=(e,t,n,r)=>{let i=e._zod.def;Ph(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},Ug=Symbol();function Wg(e,t,n,r,i){let a=!1,o=JSON.stringify(e,(e,t)=>typeof t==`bigint`?(a=!0,null):t);return a?(Nh(t,n,r,i,`BigInt defaults cannot be represented in JSON Schema`),Ug):JSON.parse(o)}var Gg=(e,t,n,r)=>{let i=e._zod.def;Ph(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType;let o=Wg(i.defaultValue,e,t,n,r);o!==Ug&&(n.default=o)},Kg=(e,t,n,r)=>{let i=e._zod.def;Ph(i.innerType,t,r);let a=t.seen.get(e);if(a.ref=i.innerType,t.io!==`input`)return;let o=Wg(i.defaultValue,e,t,n,r);o!==Ug&&(n._prefault=o)},qg=(e,t,n,r)=>{let i=e._zod.def;Ph(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType;let o;try{o=i.catchValue(void 0)}catch{Nh(e,t,n,r,`Dynamic catch values are not supported in JSON Schema`);return}n.default=o},Jg=(e,t,n,r)=>{let i=e._zod.def,a=i.in._zod.traits.has(`$ZodTransform`),o=t.io===`input`?a?i.out:i.in:i.out;Ph(o,t,r);let s=t.seen.get(e);s.ref=o},Yg=(e,t,n,r)=>{let i=e._zod.def;Ph(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,n.readOnly=!0},Xg=(e,t,n,r)=>{let i=e._zod.def;Ph(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},Zg=(e,t,n,r)=>{let i=e._zod.def;Ph(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},Qg=(e,t,n,r)=>{let i=e._zod.innerType;Ph(i,t,r);let a=t.seen.get(e);a.ref=i},$g={string:cg,number:lg,boolean:ug,bigint:dg,symbol:fg,null:pg,undefined:mg,void:hg,never:gg,any:_g,unknown:vg,date:yg,enum:bg,literal:xg,nan:Sg,template_literal:Cg,file:wg,success:Tg,custom:Eg,function:Dg,transform:Og,map:kg,set:Ag,array:jg,object:Ng,union:Pg,intersection:Fg,tuple:Ig,record:Bg,nullable:Vg,nonoptional:Hg,default:Gg,prefault:Kg,catch:qg,pipe:Jg,readonly:Yg,promise:Xg,optional:Zg,lazy:Qg};function e_(e,t){if(`_idmap`in e){let n=e,r=Mh({...t,processors:$g}),i={};for(let e of n._idmap.entries()){let[t,n]=e;Ph(n,r)}let a={};r.external={registry:n,uri:t?.uri,defs:i};for(let e of n._idmap.entries()){let[t,n]=e;Ih(r,n),Fl(a,t,Uh(r,n))}return Object.keys(i).length>0&&(a.__shared={[r.target===`draft-2020-12`?`$defs`:`definitions`]:i}),{schemas:a}}let n=Mh({...t,processors:$g});return Ph(e,n),Ih(n,e),Uh(n,e)}var t_=new WeakSet([Object.prototype,Error.prototype]);function n_(e,t,n){Object.defineProperty(e,t,{configurable:!0,enumerable:!1,get(){let e=n(this);return Object.defineProperty(this,t,{value:e,configurable:!0,writable:!0}),e},set(e){Object.defineProperty(this,t,{value:e,configurable:!0,writable:!0})}})}var r_=I(`ZodError`,(e,t)=>{Xu.init(e,t),e.name=`ZodError`;let n=Object.getPrototypeOf(e);t_.has(n)||(t_.add(n),n_(n,`format`,e=>t=>$u(e,t)),n_(n,`flatten`,e=>t=>Qu(e,t)),n_(n,`addIssue`,e=>t=>{e.issues.push(t),e.message=JSON.stringify(e.issues,Dl,2)}),n_(n,`addIssues`,e=>t=>{e.issues.push(...t),e.message=JSON.stringify(e.issues,Dl,2)}),Object.defineProperty(n,"isEmpty",{configurable:!0,enumerable:!1,get(){return this.issues.length===0}}))},void 0,{Parent:Error}),i_=td(r_),a_=nd(r_),o_=rd(r_),s_=ad(r_),c_=L(r_),l_=R(r_),u_=dd(r_),d_=fd(r_),f_=pd(r_),p_=md(r_),m_=hd(r_),h_=gd(r_);function g_(){Hu.localeError||Uu(vm())}function __(){Hu.memoizer||Uu({memoizer:hm()})}var v_=I(`ZodType`,(e,t)=>(g_(),yf.init(e,t),e.def=t,e.type=t.type,e),{check(...e){let t=this.def;return this.clone(Hl(t,{checks:[...t.checks??[],...e.map(e=>typeof e==`function`?{_zod:{check:e,def:{check:`custom`},onattach:[]}}:e)]}),{parent:!0})},with(...e){return this.check(...e)},clone(e,t){return Ql(this,e,t)},brand(){return this},register(e,t){return e.add(this,t),this},refine(e,t){return this.check(Kv(e,t))},superRefine(e,t){return this.check(qv(e,t))},overwrite(e){return this.check(bh(e))},optional(){return wv(this)},exactOptional(){return Ev(this)},nullable(){return Ov(this)},nullish(){return wv(Ov(this))},nonoptional(e){return Pv(this,e)},array(){return sv(this)},or(e){return dv([this,e])},and(e){return hv(this,e)},transform(e){return Rv(this,Sv(e))},default(e){return Av(this,e)},prefault(e){return Mv(this,e)},catch(e){return Iv(this,e)},pipe(e){return Rv(this,e)},readonly(){return Vv(this)},describe(e){let t=this.clone();return Sm.add(t,{description:e}),t},meta(...e){if(e.length===0)return Sm.get(this);let t=this.clone();return Sm.add(t,e[0]),t},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(e,...t){return t.length===0?e(this):e(this,...t)},get"~standard"(){return Tu(this,`~standard`,{...Sf(this),jsonSchema:{input:Kh(this,`input`),output:Kh(this,`output`)}})},set"~standard"(e){wu(this,`~standard`,e)},parse:function e(t,n){return i_(this,t,n,{callee:e})},parseAsync:async function e(t,n){return await a_(this,t,n,{callee:e})},safeParse(e,t){return o_(this,e,t)},async safeParseAsync(e,t){return s_(this,e,t)},get spa(){return this?.safeParseAsync},set spa(e){wu(this,`spa`,e)},validate(e,t){return cd(this,e,t)},validateAsync(e,t){return ud(this,e,t)},encode:function e(t,n){return c_(this,t,n,{callee:e})},decode:function e(t,n){return l_(this,t,n,{callee:e})},encodeAsync:async function e(t,n){return await u_(this,t,n,{callee:e})},decodeAsync:async function e(t,n){return await d_(this,t,n,{callee:e})},safeEncode(e,t){return f_(this,e,t)},safeDecode(e,t){return p_(this,e,t)},async safeEncodeAsync(e,t){return m_(this,e,t)},async safeDecodeAsync(e,t){return h_(this,e,t)},toJSONSchema(e){return Gh(this,{})(e)},get description(){return Sm.get(this)?.description},get _def(){return this._zod.def}}),y_=I(`_ZodString`,(e,t)=>{Cf.init(e,t),v_.init(e,t),e._zod.processJSONSchema=(t,n,r)=>cg(e,t,n,r)},Eu({format:e=>ig(e).format??null,minLength:e=>ig(e).minimum??null,maxLength:e=>ig(e).maximum??null},{regex(...e){return this.check(mh(...e))},includes(...e){return this.check(_h(...e))},startsWith(...e){return this.check(vh(...e))},endsWith(...e){return this.check(yh(...e))},min(...e){return this.check(fh(...e))},max(...e){return this.check(dh(...e))},length(...e){return this.check(ph(...e))},nonempty(...e){return this.check(fh(1,...e))},lowercase(e){return this.check(hh(e))},uppercase(e){return this.check(gh(e))},trim(){return this.check(Sh())},normalize(...e){return this.check(xh(...e))},toLowerCase(){return this.check(Ch())},toUpperCase(){return this.check(wh())},slugify(){return this.check(Th())}})),b_=I(`ZodString`,(e,t)=>{Cf.init(e,t),y_.init(e,t)},{email(e){return this.check(Tm(E_,e))},url(e){return this.check(jm(A_,e))},jwt(e){return this.check(Km(K_,e))},emoji(e){return this.check(Mm(M_,e))},guid(e){return this.check(Em(O_,e))},uuid(e){return this.check(Dm(k_,e))},uuidv4(e){return this.check(Om(k_,e))},uuidv6(e){return this.check(km(k_,e))},uuidv7(e){return this.check(Am(k_,e))},nanoid(e){return this.check(Nm(N_,e))},cuid(e){return this.check(Pm(P_,e))},cuid2(e){return this.check(Fm(F_,e))},ulid(e){return this.check(Im(I_,e))},base64(e){return this.check(Um(U_,e))},base64url(e){return this.check(Wm(W_,e))},xid(e){return this.check(Lm(L_,e))},ksuid(e){return this.check(Rm(R_,e))},ipv4(e){return this.check(zm(z_,e))},ipv6(e){return this.check(Bm(B_,e))},cidrv4(e){return this.check(Vm(V_,e))},cidrv6(e){return this.check(Hm(H_,e))},e164(e){return this.check(Gm(G_,e))},datetime(e){return this.check(qm(S_,e))},date(e){return this.check(Jm(C_,e))},time(e){return this.check(Ym(w_,e))},duration(e){return this.check(Xm(T_,e))}});function B(e){return wm(b_,e)}var x_=I(`ZodStringFormat`,(e,t)=>{wf.init(e,t),y_.init(e,t)}),S_=I(`ZodISODateTime`,(e,t)=>{Uf.init(e,t),x_.init(e,t)}),C_=I(`ZodISODate`,(e,t)=>{Wf.init(e,t),x_.init(e,t)}),w_=I(`ZodISOTime`,(e,t)=>{Gf.init(e,t),x_.init(e,t)}),T_=I(`ZodISODuration`,(e,t)=>{Kf.init(e,t),x_.init(e,t)}),E_=I(`ZodEmail`,(e,t)=>{Df.init(e,t),x_.init(e,t)});function D_(e){return Tm(E_,e)}var O_=I(`ZodGUID`,(e,t)=>{Tf.init(e,t),x_.init(e,t)}),k_=I(`ZodUUID`,(e,t)=>{Ef.init(e,t),x_.init(e,t)}),A_=I(`ZodURL`,(e,t)=>{Ff.init(e,t),x_.init(e,t)});function j_(e){return jm(A_,e)}var M_=I(`ZodEmoji`,(e,t)=>{If.init(e,t),x_.init(e,t)}),N_=I(`ZodNanoID`,(e,t)=>{Lf.init(e,t),x_.init(e,t)}),P_=I(`ZodCUID`,(e,t)=>{Rf.init(e,t),x_.init(e,t)}),F_=I(`ZodCUID2`,(e,t)=>{zf.init(e,t),x_.init(e,t)}),I_=I(`ZodULID`,(e,t)=>{Bf.init(e,t),x_.init(e,t)}),L_=I(`ZodXID`,(e,t)=>{Vf.init(e,t),x_.init(e,t)}),R_=I(`ZodKSUID`,(e,t)=>{Hf.init(e,t),x_.init(e,t)}),z_=I(`ZodIPv4`,(e,t)=>{qf.init(e,t),x_.init(e,t)}),B_=I(`ZodIPv6`,(e,t)=>{Xf.init(e,t),x_.init(e,t)}),V_=I(`ZodCIDRv4`,(e,t)=>{Zf.init(e,t),x_.init(e,t)}),H_=I(`ZodCIDRv6`,(e,t)=>{$f.init(e,t),x_.init(e,t)}),U_=I(`ZodBase64`,(e,t)=>{tp.init(e,t),x_.init(e,t)}),W_=I(`ZodBase64URL`,(e,t)=>{ip.init(e,t),x_.init(e,t)}),G_=I(`ZodE164`,(e,t)=>{ap.init(e,t),x_.init(e,t)}),K_=I(`ZodJWT`,(e,t)=>{sp.init(e,t),x_.init(e,t)}),q_=I(`ZodNumber`,(e,t)=>{cp.init(e,t),v_.init(e,t),e._zod.processJSONSchema=(t,n,r)=>lg(e,t,n,r),e.isFinite=!0},Eu({minValue:e=>{let{minimum:t,exclusiveMinimum:n}=ig(e);return Math.max(t??-1/0,n??-1/0)},maxValue:e=>{let{maximum:t,exclusiveMaximum:n}=ig(e);return Math.min(t??1/0,n??1/0)},isInt:e=>{let{isInt:t,multipleOf:n}=ig(e);return!!t||!!n?.some(Number.isSafeInteger)},format:e=>ig(e).format??null},{gt(e,t){return this.check(ch(e,t))},gte(e,t){return this.check(lh(e,t))},min(e,t){return this.check(lh(e,t))},lt(e,t){return this.check(oh(e,t))},lte(e,t){return this.check(sh(e,t))},max(e,t){return this.check(sh(e,t))},int(e){return this.check(V(e))},safe(e){return this.check(V(e))},positive(e){return this.check(ch(0,e))},nonnegative(e){return this.check(lh(0,e))},negative(e){return this.check(oh(0,e))},nonpositive(e){return this.check(sh(0,e))},multipleOf(e,t){return this.check(uh(e,t))},step(e,t){return this.check(uh(e,t))},finite(){return this}}));function J_(e){return Zm(q_,e)}var Y_=I(`ZodNumberFormat`,(e,t)=>{lp.init(e,t),q_.init(e,t)});function V(e){return $m(Y_,e)}var X_=I(`ZodBoolean`,(e,t)=>{up.init(e,t),v_.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ug(e,t,n,r)});function H(e){return eh(X_,e)}var Z_=I(`ZodUndefined`,(e,t)=>{dp.init(e,t),v_.init(e,t),e._zod.processJSONSchema=(t,n,r)=>mg(e,t,n,r)});function Q_(e){return th(Z_,e)}var $_=I(`ZodNull`,(e,t)=>{fp.init(e,t),v_.init(e,t),e._zod.processJSONSchema=(t,n,r)=>pg(e,t,n,r)});function ev(e){return nh($_,e)}var tv=I(`ZodAny`,(e,t)=>{pp.init(e,t),v_.init(e,t),e._zod.processJSONSchema=(e,t,n)=>void 0});function U(){return rh(tv)}var nv=I(`ZodUnknown`,(e,t)=>{mp.init(e,t),v_.init(e,t),e._zod.processJSONSchema=(e,t,n)=>void 0});function rv(){return ih(nv)}var iv=I(`ZodNever`,(e,t)=>{hp.init(e,t),v_.init(e,t),e._zod.processJSONSchema=(t,n,r)=>gg(e,t,n,r)});function av(e){return ah(iv,e)}var ov=I(`ZodArray`,(e,t)=>{__(),_p.init(e,t),v_.init(e,t),e._zod.processJSONSchema=(t,n,r)=>jg(e,t,n,r),e.element=t.element},{min(e,t){return this.check(fh(e,t))},nonempty(e){return this.check(fh(1,e))},max(e,t){return this.check(dh(e,t))},length(e,t){return this.check(ph(e,t))},unwrap(){return this.element}});function sv(e,t){return Eh(ov,e,t)}var cv=I(`ZodObject`,(e,t)=>{__(),Cp.init(e,t),v_.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ng(e,t,n,r),Mu(e,`shape`,e=>e._zod.def.shape,!1)},{keyof(){return yv(Object.keys(this._zod.def.shape))},catchall(e){return this.clone(Hl(this._zod.def,{catchall:e}))},passthrough(){return this.clone(Hl(this._zod.def,{catchall:rv()}))},loose(){return this.clone(Hl(this._zod.def,{catchall:rv()}))},strict(){return this.clone(Hl(this._zod.def,{catchall:av()}))},strip(){return this.clone(Hl(this._zod.def,{catchall:void 0}))},extend(e){return ou(this,e)},safeExtend(e){return cu(this,e)},merge(e){return lu(this,e)},pick(e){return ru(this,e)},omit(e){return au(this,e)},partial(...e){return uu(Cv,this,e[0])},exactPartial(...e){return uu(Tv,this,e[0],`exactPartial`)},required(...e){return du(Nv,this,e[0])}});function lv(e,t){return new cv({type:`object`,shape:e??{},...P(t)})}function W(e,t){return new cv({type:`object`,shape:e,catchall:rv(),...P(t)})}var uv=I(`ZodUnion`,(e,t)=>{Tp.init(e,t),v_.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Pg(e,t,n,r),e.options=t.options});function dv(e,t){return new uv({type:`union`,options:e,...P(t)})}var fv=I(`ZodDiscriminatedUnion`,(e,t)=>{uv.init(e,t),Dp.init(e,t)});function pv(e,t,n){return new fv({type:`union`,options:t,discriminator:e,...P(n)})}var mv=I(`ZodIntersection`,(e,t)=>{Op.init(e,t),v_.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Fg(e,t,n,r)});function hv(e,t){return new mv({type:`intersection`,left:e,right:t})}var gv=I(`ZodRecord`,(e,t)=>{__(),jp.init(e,t),v_.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Bg(e,t,n,r),e.keyType=t.keyType,e.valueType=t.valueType});function _v(e,t,n){return!t||!t._zod?new gv({type:`record`,keyType:B(),valueType:e,...P(t)}):new gv({type:`record`,keyType:e,valueType:t,...P(n)})}var vv=I(`ZodEnum`,(e,t)=>{Mp.init(e,t),v_.init(e,t),e._zod.processJSONSchema=(t,n,r)=>bg(e,t,n,r),e.enum=t.entries,e.options=[...e._zod.values];let n=new Set(Object.keys(t.entries));e.extract=(e,r)=>{let i={};for(let r of e)if(n.has(r))i[r]=t.entries[r];else throw Error(`Key ${r} not found in enum`);return new vv({...t,checks:[],...P(r),entries:i})},e.exclude=(e,r)=>{let i={...t.entries};for(let t of e)if(n.has(t))delete i[t];else throw Error(`Key ${t} not found in enum`);return new vv({...t,checks:[],...P(r),entries:i})}});function yv(e,t){return new vv({type:`enum`,entries:Array.isArray(e)?Object.fromEntries(e.map(e=>[e,e])):e,...P(t)})}var bv=I(`ZodLiteral`,(e,t)=>{Np.init(e,t),v_.init(e,t),e._zod.processJSONSchema=(t,n,r)=>xg(e,t,n,r),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});function G(e,t){return new bv({type:`literal`,values:Array.isArray(e)?e:[e],...P(t)})}var xv=I(`ZodTransform`,(e,t)=>{__(),Pp.init(e,t),v_.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Og(e,t,n,r),e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new Vu(e.constructor.name);n.addIssue=r=>{if(typeof r==`string`)n.issues.push(Su(r,n.value,t));else{let t=r;t.fatal&&(t.continue=!1),t.code??=`custom`,`input`in t||(t.input=n.value),t.inst??=e,n.issues.push(Su(t))}};let i=t.transform(n.value,n);return i instanceof Promise?i.then(e=>(n.value=e,n)):(n.value=i,n)}});function Sv(e){return new xv({type:`transform`,transform:e})}var Cv=I(`ZodOptional`,(e,t)=>{Ip.init(e,t),v_.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Zg(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function wv(e){return new Cv({type:`optional`,innerType:e})}var Tv=I(`ZodExactOptional`,(e,t)=>{Lp.init(e,t),v_.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Zg(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Ev(e){return new Tv({type:`optional`,innerType:e})}var Dv=I(`ZodNullable`,(e,t)=>{Rp.init(e,t),v_.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Vg(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Ov(e){return new Dv({type:`nullable`,innerType:e})}var kv=I(`ZodDefault`,(e,t)=>{zp.init(e,t),v_.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Gg(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function Av(e,t){return new kv({type:`default`,innerType:e,get defaultValue(){return typeof t==`function`?t():Yl(t)}})}var jv=I(`ZodPrefault`,(e,t)=>{Vp.init(e,t),v_.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Kg(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Mv(e,t){return new jv({type:`prefault`,innerType:e,get defaultValue(){return typeof t==`function`?t():Yl(t)}})}var Nv=I(`ZodNonOptional`,(e,t)=>{Hp.init(e,t),v_.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Hg(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Pv(e,t){return new Nv({type:`nonoptional`,innerType:e,...P(t)})}var Fv=I(`ZodCatch`,(e,t)=>{Gp.init(e,t),v_.init(e,t),e._zod.processJSONSchema=(t,n,r)=>qg(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function Iv(e,t){return new Fv({type:`catch`,innerType:e,catchValue:typeof t==`function`?t:Pu(t)})}var Lv=I(`ZodPipe`,(e,t)=>{Kp.init(e,t),v_.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Jg(e,t,n,r),e.in=t.in,e.out=t.out});function Rv(e,t){return new Lv({type:`pipe`,in:e,out:t})}var zv=I(`ZodPreprocess`,(e,t)=>{Lv.init(e,t),Jp.init(e,t)}),Bv=I(`ZodReadonly`,(e,t)=>{Yp.init(e,t),v_.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Yg(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Vv(e){return new Bv({type:`readonly`,innerType:e})}var Hv=I(`ZodLazy`,(e,t)=>{Zp.init(e,t),v_.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Qg(e,t,n,r),e.unwrap=()=>e._zod.def.getter()});function Uv(e){return new Hv({type:`lazy`,getter:e})}var Wv=I(`ZodCustom`,(e,t)=>{Qp.init(e,t),v_.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Eg(e,t,n,r)});function Gv(e,t){return Dh(Wv,e??(()=>!0),t)}function Kv(e,t={}){return Oh(Wv,e,t)}function qv(e,t){return kh(e,t)}function Jv(e,t){return new zv({type:`pipe`,in:Sv(e),out:t})}var Yv=yv(A),K=Gv(e=>typeof e==`object`&&!!e&&!Array.isArray(e)),q=B(),Xv=yv([`developer`,`system`,`assistant`,`user`]),Zv=W({type:G(A.TEXT_MESSAGE_START),timestamp:V().min(-9007199254740991).max(9007199254740991).optional(),rawEvent:U().refine(e=>e!==null).optional(),metadata:K.optional(),subagentRunId:q.optional(),messageId:B(),role:Xv.optional(),name:B().optional()}),Qv=W({type:G(A.TEXT_MESSAGE_CONTENT),timestamp:V().min(-9007199254740991).max(9007199254740991).optional(),rawEvent:U().refine(e=>e!==null).optional(),metadata:K.optional(),subagentRunId:q.optional(),messageId:B(),delta:B()}),$v=W({type:G(A.TEXT_MESSAGE_END),timestamp:V().min(-9007199254740991).max(9007199254740991).optional(),rawEvent:U().refine(e=>e!==null).optional(),metadata:K.optional(),subagentRunId:q.optional(),messageId:B()}),ey=W({type:G(A.TEXT_MESSAGE_CHUNK),timestamp:V().min(-9007199254740991).max(9007199254740991).optional(),rawEvent:U().refine(e=>e!==null).optional(),metadata:K.optional(),subagentRunId:q.optional(),messageId:B().optional(),role:Xv.optional(),delta:B().optional(),name:B().optional()}),ty=W({type:G(A.TOOL_CALL_START),timestamp:V().min(-9007199254740991).max(9007199254740991).optional(),rawEvent:U().refine(e=>e!==null).optional(),metadata:K.optional(),subagentRunId:q.optional(),toolCallId:B(),toolCallName:B(),parentMessageId:B().optional()}),ny=W({type:G(A.TOOL_CALL_ARGS),timestamp:V().min(-9007199254740991).max(9007199254740991).optional(),rawEvent:U().refine(e=>e!==null).optional(),metadata:K.optional(),subagentRunId:q.optional(),toolCallId:B(),delta:B()}),ry=W({type:G(A.TOOL_CALL_END),timestamp:V().min(-9007199254740991).max(9007199254740991).optional(),rawEvent:U().refine(e=>e!==null).optional(),metadata:K.optional(),subagentRunId:q.optional(),toolCallId:B()}),iy=W({type:G(A.TOOL_CALL_CHUNK),timestamp:V().min(-9007199254740991).max(9007199254740991).optional(),rawEvent:U().refine(e=>e!==null).optional(),metadata:K.optional(),subagentRunId:q.optional(),toolCallId:B().optional(),toolCallName:B().optional(),parentMessageId:B().optional(),delta:B().optional()}),ay=W({type:G(`text`),id:B().optional(),text:B(),metadata:U().refine(e=>e!==null).optional()}),oy=pv(`type`,[W({type:G(`data`),value:B(),mimeType:B()}),W({type:G(`url`),value:B(),mimeType:B().optional()}),W({type:G(`file`),value:B(),provider:B().optional(),mimeType:B().optional()})]),sy=pv(`type`,[ay,W({type:G(`image`),id:B().optional(),source:oy,metadata:U().refine(e=>e!==null).optional()}),W({type:G(`audio`),id:B().optional(),source:oy,metadata:U().refine(e=>e!==null).optional()}),W({type:G(`video`),id:B().optional(),source:oy,metadata:U().refine(e=>e!==null).optional()}),W({type:G(`document`),id:B().optional(),source:oy,metadata:U().refine(e=>e!==null).optional()})]),cy=W({type:G(A.TOOL_CALL_RESULT),timestamp:V().min(-9007199254740991).max(9007199254740991).optional(),rawEvent:U().refine(e=>e!==null).optional(),metadata:K.optional(),subagentRunId:q.optional(),messageId:B(),toolCallId:B(),content:dv([B(),sv(sy)]),role:G(`tool`).optional()}),ly=U(),uy=W({type:G(A.STATE_SNAPSHOT),timestamp:V().min(-9007199254740991).max(9007199254740991).optional(),rawEvent:U().refine(e=>e!==null).optional(),metadata:K.optional(),subagentRunId:q.optional(),snapshot:ly.refine(e=>e!==void 0)}),dy=B().regex(RegExp(`^(/([^/~]|~[01])*)*$`)),fy=sv(pv(`op`,[W({op:G(`add`),path:dy,value:U().refine(e=>e!==void 0)}).meta({specOpen:!0}),W({op:G(`remove`),path:dy}).meta({specOpen:!0}),W({op:G(`replace`),path:dy,value:U().refine(e=>e!==void 0)}).meta({specOpen:!0}),W({op:G(`move`),from:dy,path:dy}).meta({specOpen:!0}),W({op:G(`copy`),from:dy,path:dy}).meta({specOpen:!0}),W({op:G(`test`),path:dy,value:U().refine(e=>e!==void 0)}).meta({specOpen:!0})])),py=W({type:G(A.STATE_DELTA),timestamp:V().min(-9007199254740991).max(9007199254740991).optional(),rawEvent:U().refine(e=>e!==null).optional(),metadata:K.optional(),subagentRunId:q.optional(),delta:fy}),my=W({subagentRunId:q.optional(),id:B(),role:G(`developer`),name:B().optional(),encryptedValue:B().optional(),metadata:K.optional(),content:B()}),hy=W({subagentRunId:q.optional(),id:B(),role:G(`system`),name:B().optional(),encryptedValue:B().optional(),metadata:K.optional(),content:B()}),gy=W({name:B(),arguments:B()}),_y=W({id:B(),type:G(`function`),function:gy,encryptedValue:B().optional(),metadata:K.optional()}),vy=pv(`role`,[my,hy,W({subagentRunId:q.optional(),id:B(),role:G(`assistant`),name:B().optional(),encryptedValue:B().optional(),metadata:K.optional(),content:B().optional(),toolCalls:sv(_y).optional()}),W({subagentRunId:q.optional(),id:B(),role:G(`user`),name:B().optional(),encryptedValue:B().optional(),metadata:K.optional(),content:dv([B(),sv(sy)])}),W({subagentRunId:q.optional(),id:B(),role:G(`tool`),content:dv([B(),sv(sy)]),toolCallId:B(),error:B().optional(),encryptedValue:B().optional(),metadata:K.optional()}),W({subagentRunId:q.optional(),id:B(),role:G(`activity`),activityType:B(),content:Gv(e=>typeof e==`object`&&!!e&&!Array.isArray(e)),metadata:K.optional()}),W({subagentRunId:q.optional(),id:B(),role:G(`reasoning`),content:B(),encryptedValue:B().optional(),metadata:K.optional()})]),yy=W({type:G(A.MESSAGES_SNAPSHOT),timestamp:V().min(-9007199254740991).max(9007199254740991).optional(),rawEvent:U().refine(e=>e!==null).optional(),metadata:K.optional(),messages:sv(vy)}),by=W({type:G(A.ACTIVITY_SNAPSHOT),timestamp:V().min(-9007199254740991).max(9007199254740991).optional(),rawEvent:U().refine(e=>e!==null).optional(),metadata:K.optional(),subagentRunId:q.optional(),messageId:B(),activityType:B(),content:Gv(e=>typeof e==`object`&&!!e&&!Array.isArray(e)),replace:H().optional()}),xy=W({type:G(A.ACTIVITY_DELTA),timestamp:V().min(-9007199254740991).max(9007199254740991).optional(),rawEvent:U().refine(e=>e!==null).optional(),metadata:K.optional(),subagentRunId:q.optional(),messageId:B(),activityType:B(),patch:fy}),Sy=W({type:G(A.RAW),timestamp:V().min(-9007199254740991).max(9007199254740991).optional(),rawEvent:U().refine(e=>e!==null).optional(),metadata:K.optional(),subagentRunId:q.optional(),event:U().refine(e=>e!==void 0),source:B().optional()}),Cy=W({type:G(A.CUSTOM),timestamp:V().min(-9007199254740991).max(9007199254740991).optional(),rawEvent:U().refine(e=>e!==null).optional(),metadata:K.optional(),subagentRunId:q.optional(),name:B(),value:U().refine(e=>e!==void 0)}),wy=W({name:B(),description:B(),parameters:U().refine(e=>e!==null).optional(),metadata:K.optional()}),Ty=W({description:B(),value:B()}),Ey=W({interruptId:B(),status:yv([`resolved`,`cancelled`]),payload:U().refine(e=>e!==null).optional(),metadata:K.optional()}),Dy=W({threadId:B(),runId:B(),protocolVersion:B().optional(),parentRunId:B().optional(),state:ly.refine(e=>e!==null).nullable().transform(e=>e??void 0).optional(),messages:sv(vy),tools:sv(wy).default(()=>[]),context:sv(Ty).default(()=>[]),forwardedProps:U().refine(e=>e!==null).optional(),resume:sv(Ey).optional()}),Oy=W({type:G(A.RUN_STARTED),timestamp:V().min(-9007199254740991).max(9007199254740991).optional(),rawEvent:U().refine(e=>e!==null).optional(),metadata:K.optional(),threadId:B(),runId:B(),protocolVersion:B().optional(),parentRunId:B().optional(),input:Dy.optional()}),ky=W({type:G(`success`),pendingToolCallIds:sv(B()).optional()}),Ay=W({subagentRunId:q.optional(),id:B(),reason:B(),message:B().optional(),toolCallId:B().optional(),responseSchema:Gv(e=>typeof e==`object`&&!!e&&!Array.isArray(e)).optional(),expiresAt:B().optional(),metadata:K.optional()}),jy=pv(`type`,[ky,W({type:G(`interrupt`),interrupts:sv(Ay).min(1)}),W({type:G(`cancelled`)})]),My=W({provider:B().optional(),model:B().optional(),inputTokens:V().min(0).max(9007199254740991).optional(),outputTokens:V().min(0).max(9007199254740991).optional(),totalTokens:V().min(0).max(9007199254740991).optional(),reasoningTokens:V().min(0).max(9007199254740991).optional(),cachedInputTokens:V().min(0).max(9007199254740991).optional(),cacheWriteInputTokens:V().min(0).max(9007199254740991).optional()}),Ny=W({type:G(A.RUN_FINISHED),timestamp:V().min(-9007199254740991).max(9007199254740991).optional(),rawEvent:U().refine(e=>e!==null).optional(),metadata:K.optional(),threadId:B(),runId:B(),result:U().refine(e=>e!==null).optional(),outcome:jy.optional(),usage:sv(My).optional()}),Py=W({type:G(A.RUN_ERROR),timestamp:V().min(-9007199254740991).max(9007199254740991).optional(),rawEvent:U().refine(e=>e!==null).optional(),metadata:K.optional(),message:B(),code:B().optional(),usage:sv(My).optional()}),Fy=W({type:G(A.STEP_STARTED),timestamp:V().min(-9007199254740991).max(9007199254740991).optional(),rawEvent:U().refine(e=>e!==null).optional(),metadata:K.optional(),subagentRunId:q.optional(),stepName:B()}),Iy=W({type:G(A.STEP_FINISHED),timestamp:V().min(-9007199254740991).max(9007199254740991).optional(),rawEvent:U().refine(e=>e!==null).optional(),metadata:K.optional(),subagentRunId:q.optional(),stepName:B()}),Ly=W({type:G(A.REASONING_START),timestamp:V().min(-9007199254740991).max(9007199254740991).optional(),rawEvent:U().refine(e=>e!==null).optional(),metadata:K.optional(),subagentRunId:q.optional(),messageId:B()}),Ry=W({type:G(A.REASONING_MESSAGE_START),timestamp:V().min(-9007199254740991).max(9007199254740991).optional(),rawEvent:U().refine(e=>e!==null).optional(),metadata:K.optional(),subagentRunId:q.optional(),messageId:B(),role:G(`reasoning`)}),zy=W({type:G(A.REASONING_MESSAGE_CONTENT),timestamp:V().min(-9007199254740991).max(9007199254740991).optional(),rawEvent:U().refine(e=>e!==null).optional(),metadata:K.optional(),subagentRunId:q.optional(),messageId:B(),delta:B()}),By=W({type:G(A.REASONING_MESSAGE_END),timestamp:V().min(-9007199254740991).max(9007199254740991).optional(),rawEvent:U().refine(e=>e!==null).optional(),metadata:K.optional(),subagentRunId:q.optional(),messageId:B()}),Vy=W({type:G(A.REASONING_MESSAGE_CHUNK),timestamp:V().min(-9007199254740991).max(9007199254740991).optional(),rawEvent:U().refine(e=>e!==null).optional(),metadata:K.optional(),subagentRunId:q.optional(),messageId:B().optional(),delta:B().optional()}),Hy=W({type:G(A.REASONING_END),timestamp:V().min(-9007199254740991).max(9007199254740991).optional(),rawEvent:U().refine(e=>e!==null).optional(),metadata:K.optional(),subagentRunId:q.optional(),messageId:B()}),Uy=yv([`tool-call`,`message`]),Wy=W({type:G(A.REASONING_ENCRYPTED_VALUE),timestamp:V().min(-9007199254740991).max(9007199254740991).optional(),rawEvent:U().refine(e=>e!==null).optional(),metadata:K.optional(),subagentRunId:q.optional(),subtype:Uy,entityId:B(),encryptedValue:B()}),Gy=W({type:G(A.SUBAGENT_STARTED),timestamp:V().min(-9007199254740991).max(9007199254740991).optional(),rawEvent:U().refine(e=>e!==null).optional(),metadata:K.optional(),subagentRunId:q,name:B(),description:B().optional(),parentSubagentRunId:q.optional(),parentToolCallId:B().optional(),parentMessageId:B().optional()}),Ky=pv(`type`,[W({type:G(`success`)}),W({type:G(`suspended`),interruptIds:sv(B()).optional()})]),qy=pv(`type`,[Zv,Qv,$v,ey,ty,ny,ry,iy,cy,uy,py,yy,by,xy,Sy,Cy,Oy,Ny,Py,Fy,Iy,Ly,Ry,zy,By,Vy,Hy,Wy,Gy,W({type:G(A.SUBAGENT_FINISHED),timestamp:V().min(-9007199254740991).max(9007199254740991).optional(),rawEvent:U().refine(e=>e!==null).optional(),metadata:K.optional(),subagentRunId:q,result:U().refine(e=>e!==null).optional(),outcome:Ky.optional()}),W({type:G(A.SUBAGENT_ERROR),timestamp:V().min(-9007199254740991).max(9007199254740991).optional(),rawEvent:U().refine(e=>e!==null).optional(),metadata:K.optional(),subagentRunId:q,message:B(),code:B().optional()})]);yv([`developer`,`system`,`assistant`,`user`,`tool`,`activity`,`reasoning`]);var Jy=W({name:B(),description:B().optional()}),Yy=W({name:B().optional(),type:B().optional(),description:B().optional(),version:B().optional(),provider:B().optional(),documentationUrl:B().optional(),metadata:K.optional()}),Xy=W({streaming:H().optional(),websocket:H().optional(),httpBinary:H().optional(),pushNotifications:H().optional(),resumable:H().optional()}),Zy=W({supported:H().optional(),items:sv(wy).optional(),parallelCalls:H().optional(),clientProvided:H().optional()}),Qy=W({structuredOutput:H().optional(),supportedMimeTypes:sv(B()).optional()}),$y=W({snapshots:H().optional(),deltas:H().optional(),memory:H().optional(),persistentState:H().optional()}),eb=W({supported:H().optional(),delegation:H().optional(),handoffs:H().optional(),subagents:sv(Jy).optional()}),tb=W({supported:H().optional(),streaming:H().optional(),encrypted:H().optional()}),nb=W({image:H().optional(),audio:H().optional(),video:H().optional(),pdf:H().optional(),file:H().optional()}),rb=W({image:H().optional(),audio:H().optional()}),ib=W({input:nb.optional(),output:rb.optional()}),ab=W({codeExecution:H().optional(),sandboxed:H().optional(),maxIterations:V().min(0).max(9007199254740991).optional(),maxExecutionTime:V().min(0).max(9007199254740991).optional()}),ob=W({supported:H().optional(),approvals:H().optional(),interventions:H().optional(),feedback:H().optional(),interrupts:H().optional(),approveWithEdits:H().optional()});W({identity:Yy.optional(),transport:Xy.optional(),tools:Zy.optional(),output:Qy.optional(),state:$y.optional(),multiAgent:eb.optional(),reasoning:tb.optional(),multimodal:ib.optional(),execution:ab.optional(),humanInTheLoop:ob.optional(),custom:Gv(e=>typeof e==`object`&&!!e&&!Array.isArray(e)).optional()}),W({subagentRunId:q.optional()}),W({type:Yv,timestamp:V().min(-9007199254740991).max(9007199254740991).optional(),rawEvent:U().refine(e=>e!==null).optional(),metadata:K.optional()}),W({subagentRunId:q.optional(),id:B(),role:B(),name:B().optional(),encryptedValue:B().optional(),metadata:K.optional()}),K.optional();function sb(){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)<=cb&&(i+=r/cb|0,r%=cb)}return a(-24,-18),a(-18,-12),a(-12,-6),a(-6),t?mb(r,i):pb(r,i)}function ub(e,t){let n=pb(e,t),r=n.hi&2147483648;r&&(n=mb(n.lo,n.hi));let i=db(n.lo,n.hi);return r?`-`+i:i}function db(e,t){if({lo:e,hi:t}=fb(e,t),t<=2097151)return String(cb*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()+hb(o)+hb(a)}function fb(e,t){return{lo:e>>>0,hi:t>>>0}}function pb(e,t){return{lo:e|0,hi:t|0}}function mb(e,t){return t=~t,e?e=~e+1:t+=1,pb(e,t)}var hb=e=>{let t=String(e);return`0000000`.slice(t.length)+t};function gb(){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 _b=vb();function vb(){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)),Sb(i)}return xb}function wb(e){return(t,n)=>{let r=e(t);return n.set(r),{written:r.byteLength}}}var Tb;(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`})(Tb||={});var J=class{constructor(e){this.stackPos=[],this.encodeUtf8Into=e?wb(e):Cb().encodeUtf8Into,this.buffer=Ob,this.viewCache=kb,this.pos=0}ensureCapacity(e){let t=this.pos+e;if(t>this.buffer.length){let e=this.buffer.length||Eb;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(Db),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-Db,n=jb(t);return n>Db&&(this.ensureCapacity(n-Db),this.buffer.copyWithin(e+n,e+Db,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(Nb(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(Mb(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<=Ab){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=jb(t),r=this.buffer,i=this.pos,{written:a}=this.encodeUtf8Into(e,r.subarray(i+n)),o=jb(a);return o!=n&&r.copyWithin(i+o,i+n,i+n+a),this.uint32(a),this.pos+=a,this}float(e){return Pb(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 Nb(e),this.ensureCapacity(4),this.view().setUint32(this.pos,e,!0),this.pos+=4,this}sfixed32(e){return Mb(e),this.ensureCapacity(4),this.view().setInt32(this.pos,e,!0),this.pos+=4,this}sint32(e){return Mb(e),this.uint32((e<<1^e>>31)>>>0)}sfixed64(e){let t=_b.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=_b.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=_b.enc(e);return this.writeVarint64(t.lo,t.hi)}sint64(e){let t=_b.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=_b.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}},Eb=128,Db=1,Ob=new Uint8Array,kb=new DataView(Ob.buffer),Ab=32;function jb(e){return e<128?1:e<16384?2:e<2097152?3:e<268435456?4:5}var Y=class{constructor(e,t=Cb().decodeUtf8){this.decodeUtf8=t,this.varint64Lo=0,this.varint64Hi=0,this.varint64=sb,this.uint32=gb,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 Tb.Varint:for(;this.buf[this.pos++]&128;);break;case Tb.Bit64:this.pos+=4;case Tb.Bit32:this.pos+=4;break;case Tb.LengthDelimited:let r=this.uint32();this.pos+=r;break;case Tb.StartGroup:if(n<=0)throw Error(`maximum recursion depth reached`);for(;;){let[e,r]=this.tag();if(r===Tb.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(),_b.dec(this.varint64Lo,this.varint64Hi)}uint64(){return this.varint64(),_b.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,_b.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 _b.uDec(this.sfixed32(),this.sfixed32())}sfixed64(){return _b.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<=Ab){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 Mb(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 Nb(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 Pb(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(Math.fround(e))&&Number.isFinite(e))throw Error(`invalid float32: `+e)}var Fb=function(e){return e[e.NULL_VALUE=0]=`NULL_VALUE`,e[e.UNRECOGNIZED=-1]=`UNRECOGNIZED`,e}({});function Ib(){return{fields:{}}}var Lb={encode(e,t=new J){return Object.entries(e.fields).forEach(([e,n])=>{n!==void 0&&zb.encode({key:e,value:n},t.uint32(10).fork()).join()}),t},decode(e,t){let n=e instanceof Y?e:new Y(e),r=t===void 0?n.len:n.pos+t,i=Ib();for(;n.pos>>3){case 1:{if(e!==10)break;let t=zb.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 Lb.fromPartial(e??{})},fromPartial(e){let t=Ib();return t.fields=Object.entries(e.fields??{}).reduce((e,[t,n])=>(n!==void 0&&(e[t]=n),e),{}),t},wrap(e){let t=Ib();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 Rb(){return{key:``,value:void 0}}var zb={encode(e,t=new J){return e.key!==``&&t.uint32(10).string(e.key),e.value!==void 0&&X.encode(X.wrap(e.value),t.uint32(18).fork()).join(),t},decode(e,t){let n=e instanceof Y?e:new Y(e),r=t===void 0?n.len:n.pos+t,i=Rb();for(;n.pos>>3){case 1:if(e!==10)break;i.key=n.string();continue;case 2:if(e!==18)break;i.value=X.unwrap(X.decode(n,n.uint32()));continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return zb.fromPartial(e??{})},fromPartial(e){let t=Rb();return t.key=e.key??``,t.value=e.value??void 0,t}};function Bb(){return{nullValue:void 0,numberValue:void 0,stringValue:void 0,boolValue:void 0,structValue:void 0,listValue:void 0}}var X={encode(e,t=new J){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&&Lb.encode(Lb.wrap(e.structValue),t.uint32(42).fork()).join(),e.listValue!==void 0&&Hb.encode(Hb.wrap(e.listValue),t.uint32(50).fork()).join(),t},decode(e,t){let n=e instanceof Y?e:new Y(e),r=t===void 0?n.len:n.pos+t,i=Bb();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=Lb.unwrap(Lb.decode(n,n.uint32()));continue;case 6:if(e!==50)break;i.listValue=Hb.unwrap(Hb.decode(n,n.uint32()));continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return X.fromPartial(e??{})},fromPartial(e){let t=Bb();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=Bb();if(e===null)t.nullValue=Fb.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 Vb(){return{values:[]}}var Hb={encode(e,t=new J){for(let n of e.values)X.encode(X.wrap(n),t.uint32(10).fork()).join();return t},decode(e,t){let n=e instanceof Y?e:new Y(e),r=t===void 0?n.len:n.pos+t,i=Vb();for(;n.pos>>3){case 1:if(e!==10)break;i.values.push(X.unwrap(X.decode(n,n.uint32())));continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return Hb.fromPartial(e??{})},fromPartial(e){let t=Vb();return t.values=e.values?.map(e=>e)||[],t},wrap(e){let t=Vb();return t.values=e??[],t},unwrap(e){return e?.hasOwnProperty(`values`)&&globalThis.Array.isArray(e.values)?e.values:e}},Ub=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 Wb(){return{op:0,path:``,from:void 0,value:void 0}}var Gb={encode(e,t=new J){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&&X.encode(X.wrap(e.value),t.uint32(34).fork()).join(),t},decode(e,t){let n=e instanceof Y?e:new Y(e),r=t===void 0?n.len:n.pos+t,i=Wb();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=X.unwrap(X.decode(n,n.uint32()));continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return Gb.fromPartial(e??{})},fromPartial(e){let t=Wb();return t.op=e.op??0,t.path=e.path??``,t.from=e.from??void 0,t.value=e.value??void 0,t}};function Kb(){return{text:``,id:void 0,metadata:void 0}}var qb={encode(e,t=new J){return e.text!==``&&t.uint32(10).string(e.text),e.id!==void 0&&t.uint32(18).string(e.id),e.metadata!==void 0&&X.encode(X.wrap(e.metadata),t.uint32(26).fork()).join(),t},decode(e,t){let n=e instanceof Y?e:new Y(e),r=t===void 0?n.len:n.pos+t,i=Kb();for(;n.pos>>3){case 1:if(e!==10)break;i.text=n.string();continue;case 2:if(e!==18)break;i.id=n.string();continue;case 3:if(e!==26)break;i.metadata=X.unwrap(X.decode(n,n.uint32()));continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return qb.fromPartial(e??{})},fromPartial(e){let t=Kb();return t.text=e.text??``,t.id=e.id??void 0,t.metadata=e.metadata??void 0,t}};function Jb(){return{source:void 0,metadata:void 0,id:void 0}}var Yb={encode(e,t=new J){return e.source!==void 0&&rx.encode(e.source,t.uint32(10).fork()).join(),e.metadata!==void 0&&X.encode(X.wrap(e.metadata),t.uint32(18).fork()).join(),e.id!==void 0&&t.uint32(26).string(e.id),t},decode(e,t){let n=e instanceof Y?e:new Y(e),r=t===void 0?n.len:n.pos+t,i=Jb();for(;n.pos>>3){case 1:if(e!==10)break;i.source=rx.decode(n,n.uint32());continue;case 2:if(e!==18)break;i.metadata=X.unwrap(X.decode(n,n.uint32()));continue;case 3:if(e!==26)break;i.id=n.string();continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return Yb.fromPartial(e??{})},fromPartial(e){let t=Jb();return t.source=e.source!==void 0&&e.source!==null?rx.fromPartial(e.source):void 0,t.metadata=e.metadata??void 0,t.id=e.id??void 0,t}};function Xb(){return{value:``,mimeType:``}}var Zb={encode(e,t=new J){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 Y?e:new Y(e),r=t===void 0?n.len:n.pos+t,i=Xb();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 Zb.fromPartial(e??{})},fromPartial(e){let t=Xb();return t.value=e.value??``,t.mimeType=e.mimeType??``,t}};function Qb(){return{value:``,mimeType:void 0}}var $b={encode(e,t=new J){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 Y?e:new Y(e),r=t===void 0?n.len:n.pos+t,i=Qb();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 $b.fromPartial(e??{})},fromPartial(e){let t=Qb();return t.value=e.value??``,t.mimeType=e.mimeType??void 0,t}};function ex(){return{value:``,provider:void 0,mimeType:void 0}}var tx={encode(e,t=new J){return e.value!==``&&t.uint32(10).string(e.value),e.provider!==void 0&&t.uint32(18).string(e.provider),e.mimeType!==void 0&&t.uint32(26).string(e.mimeType),t},decode(e,t){let n=e instanceof Y?e:new Y(e),r=t===void 0?n.len:n.pos+t,i=ex();for(;n.pos>>3){case 1:if(e!==10)break;i.value=n.string();continue;case 2:if(e!==18)break;i.provider=n.string();continue;case 3:if(e!==26)break;i.mimeType=n.string();continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return tx.fromPartial(e??{})},fromPartial(e){let t=ex();return t.value=e.value??``,t.provider=e.provider??void 0,t.mimeType=e.mimeType??void 0,t}};function nx(){return{data:void 0,url:void 0,file:void 0}}var rx={encode(e,t=new J){return e.data!==void 0&&Zb.encode(e.data,t.uint32(10).fork()).join(),e.url!==void 0&&$b.encode(e.url,t.uint32(18).fork()).join(),e.file!==void 0&&tx.encode(e.file,t.uint32(26).fork()).join(),t},decode(e,t){let n=e instanceof Y?e:new Y(e),r=t===void 0?n.len:n.pos+t,i=nx();for(;n.pos>>3){case 1:if(e!==10)break;i.data=Zb.decode(n,n.uint32());continue;case 2:if(e!==18)break;i.url=$b.decode(n,n.uint32());continue;case 3:if(e!==26)break;i.file=tx.decode(n,n.uint32());continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return rx.fromPartial(e??{})},fromPartial(e){let t=nx();return t.data=e.data!==void 0&&e.data!==null?Zb.fromPartial(e.data):void 0,t.url=e.url!==void 0&&e.url!==null?$b.fromPartial(e.url):void 0,t.file=e.file!==void 0&&e.file!==null?tx.fromPartial(e.file):void 0,t}};function ix(){return{source:void 0,metadata:void 0,id:void 0}}var ax={encode(e,t=new J){return e.source!==void 0&&rx.encode(e.source,t.uint32(10).fork()).join(),e.metadata!==void 0&&X.encode(X.wrap(e.metadata),t.uint32(18).fork()).join(),e.id!==void 0&&t.uint32(26).string(e.id),t},decode(e,t){let n=e instanceof Y?e:new Y(e),r=t===void 0?n.len:n.pos+t,i=ix();for(;n.pos>>3){case 1:if(e!==10)break;i.source=rx.decode(n,n.uint32());continue;case 2:if(e!==18)break;i.metadata=X.unwrap(X.decode(n,n.uint32()));continue;case 3:if(e!==26)break;i.id=n.string();continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return ax.fromPartial(e??{})},fromPartial(e){let t=ix();return t.source=e.source!==void 0&&e.source!==null?rx.fromPartial(e.source):void 0,t.metadata=e.metadata??void 0,t.id=e.id??void 0,t}};function ox(){return{source:void 0,metadata:void 0,id:void 0}}var sx={encode(e,t=new J){return e.source!==void 0&&rx.encode(e.source,t.uint32(10).fork()).join(),e.metadata!==void 0&&X.encode(X.wrap(e.metadata),t.uint32(18).fork()).join(),e.id!==void 0&&t.uint32(26).string(e.id),t},decode(e,t){let n=e instanceof Y?e:new Y(e),r=t===void 0?n.len:n.pos+t,i=ox();for(;n.pos>>3){case 1:if(e!==10)break;i.source=rx.decode(n,n.uint32());continue;case 2:if(e!==18)break;i.metadata=X.unwrap(X.decode(n,n.uint32()));continue;case 3:if(e!==26)break;i.id=n.string();continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return sx.fromPartial(e??{})},fromPartial(e){let t=ox();return t.source=e.source!==void 0&&e.source!==null?rx.fromPartial(e.source):void 0,t.metadata=e.metadata??void 0,t.id=e.id??void 0,t}};function cx(){return{source:void 0,metadata:void 0,id:void 0}}var lx={encode(e,t=new J){return e.source!==void 0&&rx.encode(e.source,t.uint32(10).fork()).join(),e.metadata!==void 0&&X.encode(X.wrap(e.metadata),t.uint32(18).fork()).join(),e.id!==void 0&&t.uint32(26).string(e.id),t},decode(e,t){let n=e instanceof Y?e:new Y(e),r=t===void 0?n.len:n.pos+t,i=cx();for(;n.pos>>3){case 1:if(e!==10)break;i.source=rx.decode(n,n.uint32());continue;case 2:if(e!==18)break;i.metadata=X.unwrap(X.decode(n,n.uint32()));continue;case 3:if(e!==26)break;i.id=n.string();continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return lx.fromPartial(e??{})},fromPartial(e){let t=cx();return t.source=e.source!==void 0&&e.source!==null?rx.fromPartial(e.source):void 0,t.metadata=e.metadata??void 0,t.id=e.id??void 0,t}};function ux(){return{text:void 0,image:void 0,audio:void 0,video:void 0,document:void 0}}var dx={encode(e,t=new J){return e.text!==void 0&&qb.encode(e.text,t.uint32(10).fork()).join(),e.image!==void 0&&Yb.encode(e.image,t.uint32(18).fork()).join(),e.audio!==void 0&&ax.encode(e.audio,t.uint32(26).fork()).join(),e.video!==void 0&&sx.encode(e.video,t.uint32(34).fork()).join(),e.document!==void 0&&lx.encode(e.document,t.uint32(42).fork()).join(),t},decode(e,t){let n=e instanceof Y?e:new Y(e),r=t===void 0?n.len:n.pos+t,i=ux();for(;n.pos>>3){case 1:if(e!==10)break;i.text=qb.decode(n,n.uint32());continue;case 2:if(e!==18)break;i.image=Yb.decode(n,n.uint32());continue;case 3:if(e!==26)break;i.audio=ax.decode(n,n.uint32());continue;case 4:if(e!==34)break;i.video=sx.decode(n,n.uint32());continue;case 5:if(e!==42)break;i.document=lx.decode(n,n.uint32());continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return dx.fromPartial(e??{})},fromPartial(e){let t=ux();return t.text=e.text!==void 0&&e.text!==null?qb.fromPartial(e.text):void 0,t.image=e.image!==void 0&&e.image!==null?Yb.fromPartial(e.image):void 0,t.audio=e.audio!==void 0&&e.audio!==null?ax.fromPartial(e.audio):void 0,t.video=e.video!==void 0&&e.video!==null?sx.fromPartial(e.video):void 0,t.document=e.document!==void 0&&e.document!==null?lx.fromPartial(e.document):void 0,t}};function fx(){return{id:``,type:``,function:void 0,metadata:void 0,encryptedValue:void 0}}var px={encode(e,t=new J){return e.id!==``&&t.uint32(10).string(e.id),e.type!==``&&t.uint32(18).string(e.type),e.function!==void 0&&hx.encode(e.function,t.uint32(26).fork()).join(),e.metadata!==void 0&&Lb.encode(Lb.wrap(e.metadata),t.uint32(34).fork()).join(),e.encryptedValue!==void 0&&t.uint32(42).string(e.encryptedValue),t},decode(e,t){let n=e instanceof Y?e:new Y(e),r=t===void 0?n.len:n.pos+t,i=fx();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=hx.decode(n,n.uint32());continue;case 4:if(e!==34)break;i.metadata=Lb.unwrap(Lb.decode(n,n.uint32()));continue;case 5:if(e!==42)break;i.encryptedValue=n.string();continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return px.fromPartial(e??{})},fromPartial(e){let t=fx();return t.id=e.id??``,t.type=e.type??``,t.function=e.function!==void 0&&e.function!==null?hx.fromPartial(e.function):void 0,t.metadata=e.metadata??void 0,t.encryptedValue=e.encryptedValue??void 0,t}};function mx(){return{name:``,arguments:``}}var hx={encode(e,t=new J){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 Y?e:new Y(e),r=t===void 0?n.len:n.pos+t,i=mx();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 hx.fromPartial(e??{})},fromPartial(e){let t=mx();return t.name=e.name??``,t.arguments=e.arguments??``,t}};function gx(){return{id:``,role:``,content:void 0,name:void 0,toolCalls:[],toolCallId:void 0,error:void 0,contentParts:[],metadata:void 0,subagentRunId:void 0,encryptedValue:void 0,activityType:void 0,activityContent:void 0}}var _x={encode(e,t=new J){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)px.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)dx.encode(n,t.uint32(66).fork()).join();return e.metadata!==void 0&&Lb.encode(Lb.wrap(e.metadata),t.uint32(74).fork()).join(),e.subagentRunId!==void 0&&t.uint32(82).string(e.subagentRunId),e.encryptedValue!==void 0&&t.uint32(90).string(e.encryptedValue),e.activityType!==void 0&&t.uint32(98).string(e.activityType),e.activityContent!==void 0&&Lb.encode(Lb.wrap(e.activityContent),t.uint32(106).fork()).join(),t},decode(e,t){let n=e instanceof Y?e:new Y(e),r=t===void 0?n.len:n.pos+t,i=gx();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(px.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(dx.decode(n,n.uint32()));continue;case 9:if(e!==74)break;i.metadata=Lb.unwrap(Lb.decode(n,n.uint32()));continue;case 10:if(e!==82)break;i.subagentRunId=n.string();continue;case 11:if(e!==90)break;i.encryptedValue=n.string();continue;case 12:if(e!==98)break;i.activityType=n.string();continue;case 13:if(e!==106)break;i.activityContent=Lb.unwrap(Lb.decode(n,n.uint32()));continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return _x.fromPartial(e??{})},fromPartial(e){let t=gx();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=>px.fromPartial(e))||[],t.toolCallId=e.toolCallId??void 0,t.error=e.error??void 0,t.contentParts=e.contentParts?.map(e=>dx.fromPartial(e))||[],t.metadata=e.metadata??void 0,t.subagentRunId=e.subagentRunId??void 0,t.encryptedValue=e.encryptedValue??void 0,t.activityType=e.activityType??void 0,t.activityContent=e.activityContent??void 0,t}};function vx(){return{name:``,description:``,parameters:void 0,metadata:void 0}}var yx={encode(e,t=new J){return e.name!==``&&t.uint32(10).string(e.name),e.description!==``&&t.uint32(18).string(e.description),e.parameters!==void 0&&X.encode(X.wrap(e.parameters),t.uint32(26).fork()).join(),e.metadata!==void 0&&Lb.encode(Lb.wrap(e.metadata),t.uint32(34).fork()).join(),t},decode(e,t){let n=e instanceof Y?e:new Y(e),r=t===void 0?n.len:n.pos+t,i=vx();for(;n.pos>>3){case 1:if(e!==10)break;i.name=n.string();continue;case 2:if(e!==18)break;i.description=n.string();continue;case 3:if(e!==26)break;i.parameters=X.unwrap(X.decode(n,n.uint32()));continue;case 4:if(e!==34)break;i.metadata=Lb.unwrap(Lb.decode(n,n.uint32()));continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return yx.fromPartial(e??{})},fromPartial(e){let t=vx();return t.name=e.name??``,t.description=e.description??``,t.parameters=e.parameters??void 0,t.metadata=e.metadata??void 0,t}};function bx(){return{description:``,value:``}}var xx={encode(e,t=new J){return e.description!==``&&t.uint32(10).string(e.description),e.value!==``&&t.uint32(18).string(e.value),t},decode(e,t){let n=e instanceof Y?e:new Y(e),r=t===void 0?n.len:n.pos+t,i=bx();for(;n.pos>>3){case 1:if(e!==10)break;i.description=n.string();continue;case 2:if(e!==18)break;i.value=n.string();continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return xx.fromPartial(e??{})},fromPartial(e){let t=bx();return t.description=e.description??``,t.value=e.value??``,t}};function Sx(){return{interruptId:``,status:``,payload:void 0,metadata:void 0}}var Cx={encode(e,t=new J){return e.interruptId!==``&&t.uint32(10).string(e.interruptId),e.status!==``&&t.uint32(18).string(e.status),e.payload!==void 0&&X.encode(X.wrap(e.payload),t.uint32(26).fork()).join(),e.metadata!==void 0&&Lb.encode(Lb.wrap(e.metadata),t.uint32(34).fork()).join(),t},decode(e,t){let n=e instanceof Y?e:new Y(e),r=t===void 0?n.len:n.pos+t,i=Sx();for(;n.pos>>3){case 1:if(e!==10)break;i.interruptId=n.string();continue;case 2:if(e!==18)break;i.status=n.string();continue;case 3:if(e!==26)break;i.payload=X.unwrap(X.decode(n,n.uint32()));continue;case 4:if(e!==34)break;i.metadata=Lb.unwrap(Lb.decode(n,n.uint32()));continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return Cx.fromPartial(e??{})},fromPartial(e){let t=Sx();return t.interruptId=e.interruptId??``,t.status=e.status??``,t.payload=e.payload??void 0,t.metadata=e.metadata??void 0,t}};function wx(){return{threadId:``,runId:``,parentRunId:void 0,state:void 0,messages:[],tools:[],context:[],forwardedProps:void 0,resume:[],protocolVersion:void 0}}var Tx={encode(e,t=new J){e.threadId!==``&&t.uint32(10).string(e.threadId),e.runId!==``&&t.uint32(18).string(e.runId),e.parentRunId!==void 0&&t.uint32(26).string(e.parentRunId),e.state!==void 0&&X.encode(X.wrap(e.state),t.uint32(34).fork()).join();for(let n of e.messages)_x.encode(n,t.uint32(42).fork()).join();for(let n of e.tools)yx.encode(n,t.uint32(50).fork()).join();for(let n of e.context)xx.encode(n,t.uint32(58).fork()).join();e.forwardedProps!==void 0&&X.encode(X.wrap(e.forwardedProps),t.uint32(66).fork()).join();for(let n of e.resume)Cx.encode(n,t.uint32(74).fork()).join();return e.protocolVersion!==void 0&&t.uint32(82).string(e.protocolVersion),t},decode(e,t){let n=e instanceof Y?e:new Y(e),r=t===void 0?n.len:n.pos+t,i=wx();for(;n.pos>>3){case 1:if(e!==10)break;i.threadId=n.string();continue;case 2:if(e!==18)break;i.runId=n.string();continue;case 3:if(e!==26)break;i.parentRunId=n.string();continue;case 4:if(e!==34)break;i.state=X.unwrap(X.decode(n,n.uint32()));continue;case 5:if(e!==42)break;i.messages.push(_x.decode(n,n.uint32()));continue;case 6:if(e!==50)break;i.tools.push(yx.decode(n,n.uint32()));continue;case 7:if(e!==58)break;i.context.push(xx.decode(n,n.uint32()));continue;case 8:if(e!==66)break;i.forwardedProps=X.unwrap(X.decode(n,n.uint32()));continue;case 9:if(e!==74)break;i.resume.push(Cx.decode(n,n.uint32()));continue;case 10:if(e!==82)break;i.protocolVersion=n.string();continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return Tx.fromPartial(e??{})},fromPartial(e){let t=wx();return t.threadId=e.threadId??``,t.runId=e.runId??``,t.parentRunId=e.parentRunId??void 0,t.state=e.state??void 0,t.messages=e.messages?.map(e=>_x.fromPartial(e))||[],t.tools=e.tools?.map(e=>yx.fromPartial(e))||[],t.context=e.context?.map(e=>xx.fromPartial(e))||[],t.forwardedProps=e.forwardedProps??void 0,t.resume=e.resume?.map(e=>Cx.fromPartial(e))||[],t.protocolVersion=e.protocolVersion??void 0,t}};function Ex(){return{id:``,reason:``,message:void 0,toolCallId:void 0,responseSchema:void 0,expiresAt:void 0,metadata:void 0,subagentRunId:void 0}}var Dx={encode(e,t=new J){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&&X.encode(X.wrap(e.responseSchema),t.uint32(42).fork()).join(),e.expiresAt!==void 0&&t.uint32(50).string(e.expiresAt),e.metadata!==void 0&&X.encode(X.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 Y?e:new Y(e),r=t===void 0?n.len:n.pos+t,i=Ex();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=X.unwrap(X.decode(n,n.uint32()));continue;case 6:if(e!==50)break;i.expiresAt=n.string();continue;case 7:if(e!==58)break;i.metadata=X.unwrap(X.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 Dx.fromPartial(e??{})},fromPartial(e){let t=Ex();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}},Ox=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.TEXT_MESSAGE_CHUNK=19]=`TEXT_MESSAGE_CHUNK`,e[e.TOOL_CALL_CHUNK=20]=`TOOL_CALL_CHUNK`,e[e.TOOL_CALL_RESULT=21]=`TOOL_CALL_RESULT`,e[e.ACTIVITY_SNAPSHOT=22]=`ACTIVITY_SNAPSHOT`,e[e.ACTIVITY_DELTA=23]=`ACTIVITY_DELTA`,e[e.REASONING_START=24]=`REASONING_START`,e[e.REASONING_MESSAGE_START=25]=`REASONING_MESSAGE_START`,e[e.REASONING_MESSAGE_CONTENT=26]=`REASONING_MESSAGE_CONTENT`,e[e.REASONING_MESSAGE_END=27]=`REASONING_MESSAGE_END`,e[e.REASONING_MESSAGE_CHUNK=28]=`REASONING_MESSAGE_CHUNK`,e[e.REASONING_END=29]=`REASONING_END`,e[e.REASONING_ENCRYPTED_VALUE=30]=`REASONING_ENCRYPTED_VALUE`,e[e.UNRECOGNIZED=-1]=`UNRECOGNIZED`,e}({});function kx(){return{type:0,timestamp:void 0,rawEvent:void 0,metadata:void 0}}var Z={encode(e,t=new J){return e.type!==0&&t.uint32(8).int32(e.type),e.timestamp!==void 0&&t.uint32(16).int64(e.timestamp),e.rawEvent!==void 0&&X.encode(X.wrap(e.rawEvent),t.uint32(26).fork()).join(),e.metadata!==void 0&&Lb.encode(Lb.wrap(e.metadata),t.uint32(34).fork()).join(),t},decode(e,t){let n=e instanceof Y?e:new Y(e),r=t===void 0?n.len:n.pos+t,i=kx();for(;n.pos>>3){case 1:if(e!==8)break;i.type=n.int32();continue;case 2:if(e!==16)break;i.timestamp=HS(n.int64());continue;case 3:if(e!==26)break;i.rawEvent=X.unwrap(X.decode(n,n.uint32()));continue;case 4:if(e!==34)break;i.metadata=Lb.unwrap(Lb.decode(n,n.uint32()));continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return Z.fromPartial(e??{})},fromPartial(e){let t=kx();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 Ax(){return{baseEvent:void 0,messageId:``,role:void 0,name:void 0,subagentRunId:void 0}}var jx={encode(e,t=new J){return e.baseEvent!==void 0&&Z.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 Y?e:new Y(e),r=t===void 0?n.len:n.pos+t,i=Ax();for(;n.pos>>3){case 1:if(e!==10)break;i.baseEvent=Z.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 jx.fromPartial(e??{})},fromPartial(e){let t=Ax();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?Z.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 Mx(){return{baseEvent:void 0,messageId:``,delta:``,subagentRunId:void 0}}var Nx={encode(e,t=new J){return e.baseEvent!==void 0&&Z.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 Y?e:new Y(e),r=t===void 0?n.len:n.pos+t,i=Mx();for(;n.pos>>3){case 1:if(e!==10)break;i.baseEvent=Z.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 Nx.fromPartial(e??{})},fromPartial(e){let t=Mx();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?Z.fromPartial(e.baseEvent):void 0,t.messageId=e.messageId??``,t.delta=e.delta??``,t.subagentRunId=e.subagentRunId??void 0,t}};function Px(){return{baseEvent:void 0,messageId:``,subagentRunId:void 0}}var Fx={encode(e,t=new J){return e.baseEvent!==void 0&&Z.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 Y?e:new Y(e),r=t===void 0?n.len:n.pos+t,i=Px();for(;n.pos>>3){case 1:if(e!==10)break;i.baseEvent=Z.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 Fx.fromPartial(e??{})},fromPartial(e){let t=Px();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?Z.fromPartial(e.baseEvent):void 0,t.messageId=e.messageId??``,t.subagentRunId=e.subagentRunId??void 0,t}};function Ix(){return{baseEvent:void 0,messageId:void 0,role:void 0,delta:void 0,name:void 0,subagentRunId:void 0}}var Lx={encode(e,t=new J){return e.baseEvent!==void 0&&Z.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 Y?e:new Y(e),r=t===void 0?n.len:n.pos+t,i=Ix();for(;n.pos>>3){case 1:if(e!==10)break;i.baseEvent=Z.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 Lx.fromPartial(e??{})},fromPartial(e){let t=Ix();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?Z.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 Rx(){return{baseEvent:void 0,toolCallId:``,toolCallName:``,parentMessageId:void 0,subagentRunId:void 0}}var zx={encode(e,t=new J){return e.baseEvent!==void 0&&Z.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 Y?e:new Y(e),r=t===void 0?n.len:n.pos+t,i=Rx();for(;n.pos>>3){case 1:if(e!==10)break;i.baseEvent=Z.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 zx.fromPartial(e??{})},fromPartial(e){let t=Rx();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?Z.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 Bx(){return{baseEvent:void 0,toolCallId:``,delta:``,subagentRunId:void 0}}var Vx={encode(e,t=new J){return e.baseEvent!==void 0&&Z.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 Y?e:new Y(e),r=t===void 0?n.len:n.pos+t,i=Bx();for(;n.pos>>3){case 1:if(e!==10)break;i.baseEvent=Z.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 Vx.fromPartial(e??{})},fromPartial(e){let t=Bx();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?Z.fromPartial(e.baseEvent):void 0,t.toolCallId=e.toolCallId??``,t.delta=e.delta??``,t.subagentRunId=e.subagentRunId??void 0,t}};function Hx(){return{baseEvent:void 0,toolCallId:``,subagentRunId:void 0}}var Ux={encode(e,t=new J){return e.baseEvent!==void 0&&Z.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 Y?e:new Y(e),r=t===void 0?n.len:n.pos+t,i=Hx();for(;n.pos>>3){case 1:if(e!==10)break;i.baseEvent=Z.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 Ux.fromPartial(e??{})},fromPartial(e){let t=Hx();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?Z.fromPartial(e.baseEvent):void 0,t.toolCallId=e.toolCallId??``,t.subagentRunId=e.subagentRunId??void 0,t}};function Wx(){return{baseEvent:void 0,toolCallId:void 0,toolCallName:void 0,parentMessageId:void 0,delta:void 0,subagentRunId:void 0}}var Gx={encode(e,t=new J){return e.baseEvent!==void 0&&Z.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 Y?e:new Y(e),r=t===void 0?n.len:n.pos+t,i=Wx();for(;n.pos>>3){case 1:if(e!==10)break;i.baseEvent=Z.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 Gx.fromPartial(e??{})},fromPartial(e){let t=Wx();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?Z.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 Kx(){return{baseEvent:void 0,subagentRunId:void 0,messageId:``,toolCallId:``,content:void 0,role:void 0,contentParts:[]}}var qx={encode(e,t=new J){e.baseEvent!==void 0&&Z.encode(e.baseEvent,t.uint32(10).fork()).join(),e.subagentRunId!==void 0&&t.uint32(18).string(e.subagentRunId),e.messageId!==``&&t.uint32(26).string(e.messageId),e.toolCallId!==``&&t.uint32(34).string(e.toolCallId),e.content!==void 0&&t.uint32(42).string(e.content),e.role!==void 0&&t.uint32(50).string(e.role);for(let n of e.contentParts)dx.encode(n,t.uint32(58).fork()).join();return t},decode(e,t){let n=e instanceof Y?e:new Y(e),r=t===void 0?n.len:n.pos+t,i=Kx();for(;n.pos>>3){case 1:if(e!==10)break;i.baseEvent=Z.decode(n,n.uint32());continue;case 2:if(e!==18)break;i.subagentRunId=n.string();continue;case 3:if(e!==26)break;i.messageId=n.string();continue;case 4:if(e!==34)break;i.toolCallId=n.string();continue;case 5:if(e!==42)break;i.content=n.string();continue;case 6:if(e!==50)break;i.role=n.string();continue;case 7:if(e!==58)break;i.contentParts.push(dx.decode(n,n.uint32()));continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return qx.fromPartial(e??{})},fromPartial(e){let t=Kx();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?Z.fromPartial(e.baseEvent):void 0,t.subagentRunId=e.subagentRunId??void 0,t.messageId=e.messageId??``,t.toolCallId=e.toolCallId??``,t.content=e.content??void 0,t.role=e.role??void 0,t.contentParts=e.contentParts?.map(e=>dx.fromPartial(e))||[],t}};function Jx(){return{baseEvent:void 0,snapshot:void 0,subagentRunId:void 0}}var Yx={encode(e,t=new J){return e.baseEvent!==void 0&&Z.encode(e.baseEvent,t.uint32(10).fork()).join(),e.snapshot!==void 0&&X.encode(X.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 Y?e:new Y(e),r=t===void 0?n.len:n.pos+t,i=Jx();for(;n.pos>>3){case 1:if(e!==10)break;i.baseEvent=Z.decode(n,n.uint32());continue;case 2:if(e!==18)break;i.snapshot=X.unwrap(X.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 Yx.fromPartial(e??{})},fromPartial(e){let t=Jx();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?Z.fromPartial(e.baseEvent):void 0,t.snapshot=e.snapshot??void 0,t.subagentRunId=e.subagentRunId??void 0,t}};function Xx(){return{baseEvent:void 0,delta:[],subagentRunId:void 0}}var Zx={encode(e,t=new J){e.baseEvent!==void 0&&Z.encode(e.baseEvent,t.uint32(10).fork()).join();for(let n of e.delta)Gb.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 Y?e:new Y(e),r=t===void 0?n.len:n.pos+t,i=Xx();for(;n.pos>>3){case 1:if(e!==10)break;i.baseEvent=Z.decode(n,n.uint32());continue;case 2:if(e!==18)break;i.delta.push(Gb.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 Zx.fromPartial(e??{})},fromPartial(e){let t=Xx();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?Z.fromPartial(e.baseEvent):void 0,t.delta=e.delta?.map(e=>Gb.fromPartial(e))||[],t.subagentRunId=e.subagentRunId??void 0,t}};function Qx(){return{baseEvent:void 0,messages:[]}}var $x={encode(e,t=new J){e.baseEvent!==void 0&&Z.encode(e.baseEvent,t.uint32(10).fork()).join();for(let n of e.messages)_x.encode(n,t.uint32(18).fork()).join();return t},decode(e,t){let n=e instanceof Y?e:new Y(e),r=t===void 0?n.len:n.pos+t,i=Qx();for(;n.pos>>3){case 1:if(e!==10)break;i.baseEvent=Z.decode(n,n.uint32());continue;case 2:if(e!==18)break;i.messages.push(_x.decode(n,n.uint32()));continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return $x.fromPartial(e??{})},fromPartial(e){let t=Qx();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?Z.fromPartial(e.baseEvent):void 0,t.messages=e.messages?.map(e=>_x.fromPartial(e))||[],t}};function eS(){return{baseEvent:void 0,subagentRunId:void 0,messageId:``,activityType:``,content:void 0,replace:void 0}}var tS={encode(e,t=new J){return e.baseEvent!==void 0&&Z.encode(e.baseEvent,t.uint32(10).fork()).join(),e.subagentRunId!==void 0&&t.uint32(18).string(e.subagentRunId),e.messageId!==``&&t.uint32(26).string(e.messageId),e.activityType!==``&&t.uint32(34).string(e.activityType),e.content!==void 0&&Lb.encode(Lb.wrap(e.content),t.uint32(42).fork()).join(),e.replace!==void 0&&t.uint32(48).bool(e.replace),t},decode(e,t){let n=e instanceof Y?e:new Y(e),r=t===void 0?n.len:n.pos+t,i=eS();for(;n.pos>>3){case 1:if(e!==10)break;i.baseEvent=Z.decode(n,n.uint32());continue;case 2:if(e!==18)break;i.subagentRunId=n.string();continue;case 3:if(e!==26)break;i.messageId=n.string();continue;case 4:if(e!==34)break;i.activityType=n.string();continue;case 5:if(e!==42)break;i.content=Lb.unwrap(Lb.decode(n,n.uint32()));continue;case 6:if(e!==48)break;i.replace=n.bool();continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return tS.fromPartial(e??{})},fromPartial(e){let t=eS();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?Z.fromPartial(e.baseEvent):void 0,t.subagentRunId=e.subagentRunId??void 0,t.messageId=e.messageId??``,t.activityType=e.activityType??``,t.content=e.content??void 0,t.replace=e.replace??void 0,t}};function nS(){return{baseEvent:void 0,subagentRunId:void 0,messageId:``,activityType:``,patch:[]}}var rS={encode(e,t=new J){e.baseEvent!==void 0&&Z.encode(e.baseEvent,t.uint32(10).fork()).join(),e.subagentRunId!==void 0&&t.uint32(18).string(e.subagentRunId),e.messageId!==``&&t.uint32(26).string(e.messageId),e.activityType!==``&&t.uint32(34).string(e.activityType);for(let n of e.patch)Gb.encode(n,t.uint32(42).fork()).join();return t},decode(e,t){let n=e instanceof Y?e:new Y(e),r=t===void 0?n.len:n.pos+t,i=nS();for(;n.pos>>3){case 1:if(e!==10)break;i.baseEvent=Z.decode(n,n.uint32());continue;case 2:if(e!==18)break;i.subagentRunId=n.string();continue;case 3:if(e!==26)break;i.messageId=n.string();continue;case 4:if(e!==34)break;i.activityType=n.string();continue;case 5:if(e!==42)break;i.patch.push(Gb.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=nS();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?Z.fromPartial(e.baseEvent):void 0,t.subagentRunId=e.subagentRunId??void 0,t.messageId=e.messageId??``,t.activityType=e.activityType??``,t.patch=e.patch?.map(e=>Gb.fromPartial(e))||[],t}};function iS(){return{baseEvent:void 0,event:void 0,source:void 0,subagentRunId:void 0}}var aS={encode(e,t=new J){return e.baseEvent!==void 0&&Z.encode(e.baseEvent,t.uint32(10).fork()).join(),e.event!==void 0&&X.encode(X.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 Y?e:new Y(e),r=t===void 0?n.len:n.pos+t,i=iS();for(;n.pos>>3){case 1:if(e!==10)break;i.baseEvent=Z.decode(n,n.uint32());continue;case 2:if(e!==18)break;i.event=X.unwrap(X.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 aS.fromPartial(e??{})},fromPartial(e){let t=iS();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?Z.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 oS(){return{baseEvent:void 0,name:``,value:void 0,subagentRunId:void 0}}var sS={encode(e,t=new J){return e.baseEvent!==void 0&&Z.encode(e.baseEvent,t.uint32(10).fork()).join(),e.name!==``&&t.uint32(18).string(e.name),e.value!==void 0&&X.encode(X.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 Y?e:new Y(e),r=t===void 0?n.len:n.pos+t,i=oS();for(;n.pos>>3){case 1:if(e!==10)break;i.baseEvent=Z.decode(n,n.uint32());continue;case 2:if(e!==18)break;i.name=n.string();continue;case 3:if(e!==26)break;i.value=X.unwrap(X.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 sS.fromPartial(e??{})},fromPartial(e){let t=oS();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?Z.fromPartial(e.baseEvent):void 0,t.name=e.name??``,t.value=e.value??void 0,t.subagentRunId=e.subagentRunId??void 0,t}};function cS(){return{baseEvent:void 0,threadId:``,runId:``,parentRunId:void 0,input:void 0,protocolVersion:void 0}}var lS={encode(e,t=new J){return e.baseEvent!==void 0&&Z.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.parentRunId!==void 0&&t.uint32(34).string(e.parentRunId),e.input!==void 0&&Tx.encode(e.input,t.uint32(42).fork()).join(),e.protocolVersion!==void 0&&t.uint32(50).string(e.protocolVersion),t},decode(e,t){let n=e instanceof Y?e:new Y(e),r=t===void 0?n.len:n.pos+t,i=cS();for(;n.pos>>3){case 1:if(e!==10)break;i.baseEvent=Z.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.parentRunId=n.string();continue;case 5:if(e!==42)break;i.input=Tx.decode(n,n.uint32());continue;case 6:if(e!==50)break;i.protocolVersion=n.string();continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return lS.fromPartial(e??{})},fromPartial(e){let t=cS();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?Z.fromPartial(e.baseEvent):void 0,t.threadId=e.threadId??``,t.runId=e.runId??``,t.parentRunId=e.parentRunId??void 0,t.input=e.input!==void 0&&e.input!==null?Tx.fromPartial(e.input):void 0,t.protocolVersion=e.protocolVersion??void 0,t}};function uS(){return{baseEvent:void 0,threadId:``,runId:``,result:void 0,outcome:``,interrupts:[],usage:[],pendingToolCallIds:[]}}var dS={encode(e,t=new J){e.baseEvent!==void 0&&Z.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&&X.encode(X.wrap(e.result),t.uint32(34).fork()).join(),e.outcome!==``&&t.uint32(42).string(e.outcome);for(let n of e.interrupts)Dx.encode(n,t.uint32(50).fork()).join();for(let n of e.usage)VS.encode(n,t.uint32(58).fork()).join();for(let n of e.pendingToolCallIds)t.uint32(66).string(n);return t},decode(e,t){let n=e instanceof Y?e:new Y(e),r=t===void 0?n.len:n.pos+t,i=uS();for(;n.pos>>3){case 1:if(e!==10)break;i.baseEvent=Z.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=X.unwrap(X.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(Dx.decode(n,n.uint32()));continue;case 7:if(e!==58)break;i.usage.push(VS.decode(n,n.uint32()));continue;case 8:if(e!==66)break;i.pendingToolCallIds.push(n.string());continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return dS.fromPartial(e??{})},fromPartial(e){let t=uS();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?Z.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=>Dx.fromPartial(e))||[],t.usage=e.usage?.map(e=>VS.fromPartial(e))||[],t.pendingToolCallIds=e.pendingToolCallIds?.map(e=>e)||[],t}};function fS(){return{baseEvent:void 0,code:void 0,message:``,usage:[]}}var pS={encode(e,t=new J){e.baseEvent!==void 0&&Z.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)VS.encode(n,t.uint32(34).fork()).join();return t},decode(e,t){let n=e instanceof Y?e:new Y(e),r=t===void 0?n.len:n.pos+t,i=fS();for(;n.pos>>3){case 1:if(e!==10)break;i.baseEvent=Z.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(VS.decode(n,n.uint32()));continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return pS.fromPartial(e??{})},fromPartial(e){let t=fS();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?Z.fromPartial(e.baseEvent):void 0,t.code=e.code??void 0,t.message=e.message??``,t.usage=e.usage?.map(e=>VS.fromPartial(e))||[],t}};function mS(){return{baseEvent:void 0,stepName:``,subagentRunId:void 0}}var hS={encode(e,t=new J){return e.baseEvent!==void 0&&Z.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 Y?e:new Y(e),r=t===void 0?n.len:n.pos+t,i=mS();for(;n.pos>>3){case 1:if(e!==10)break;i.baseEvent=Z.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 hS.fromPartial(e??{})},fromPartial(e){let t=mS();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?Z.fromPartial(e.baseEvent):void 0,t.stepName=e.stepName??``,t.subagentRunId=e.subagentRunId??void 0,t}};function gS(){return{baseEvent:void 0,stepName:``,subagentRunId:void 0}}var _S={encode(e,t=new J){return e.baseEvent!==void 0&&Z.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 Y?e:new Y(e),r=t===void 0?n.len:n.pos+t,i=gS();for(;n.pos>>3){case 1:if(e!==10)break;i.baseEvent=Z.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 _S.fromPartial(e??{})},fromPartial(e){let t=gS();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?Z.fromPartial(e.baseEvent):void 0,t.stepName=e.stepName??``,t.subagentRunId=e.subagentRunId??void 0,t}};function vS(){return{baseEvent:void 0,subagentRunId:void 0,messageId:``}}var yS={encode(e,t=new J){return e.baseEvent!==void 0&&Z.encode(e.baseEvent,t.uint32(10).fork()).join(),e.subagentRunId!==void 0&&t.uint32(18).string(e.subagentRunId),e.messageId!==``&&t.uint32(26).string(e.messageId),t},decode(e,t){let n=e instanceof Y?e:new Y(e),r=t===void 0?n.len:n.pos+t,i=vS();for(;n.pos>>3){case 1:if(e!==10)break;i.baseEvent=Z.decode(n,n.uint32());continue;case 2:if(e!==18)break;i.subagentRunId=n.string();continue;case 3:if(e!==26)break;i.messageId=n.string();continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return yS.fromPartial(e??{})},fromPartial(e){let t=vS();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?Z.fromPartial(e.baseEvent):void 0,t.subagentRunId=e.subagentRunId??void 0,t.messageId=e.messageId??``,t}};function bS(){return{baseEvent:void 0,subagentRunId:void 0,messageId:``,role:``}}var xS={encode(e,t=new J){return e.baseEvent!==void 0&&Z.encode(e.baseEvent,t.uint32(10).fork()).join(),e.subagentRunId!==void 0&&t.uint32(18).string(e.subagentRunId),e.messageId!==``&&t.uint32(26).string(e.messageId),e.role!==``&&t.uint32(34).string(e.role),t},decode(e,t){let n=e instanceof Y?e:new Y(e),r=t===void 0?n.len:n.pos+t,i=bS();for(;n.pos>>3){case 1:if(e!==10)break;i.baseEvent=Z.decode(n,n.uint32());continue;case 2:if(e!==18)break;i.subagentRunId=n.string();continue;case 3:if(e!==26)break;i.messageId=n.string();continue;case 4:if(e!==34)break;i.role=n.string();continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return xS.fromPartial(e??{})},fromPartial(e){let t=bS();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?Z.fromPartial(e.baseEvent):void 0,t.subagentRunId=e.subagentRunId??void 0,t.messageId=e.messageId??``,t.role=e.role??``,t}};function SS(){return{baseEvent:void 0,subagentRunId:void 0,messageId:``,delta:``}}var CS={encode(e,t=new J){return e.baseEvent!==void 0&&Z.encode(e.baseEvent,t.uint32(10).fork()).join(),e.subagentRunId!==void 0&&t.uint32(18).string(e.subagentRunId),e.messageId!==``&&t.uint32(26).string(e.messageId),e.delta!==``&&t.uint32(34).string(e.delta),t},decode(e,t){let n=e instanceof Y?e:new Y(e),r=t===void 0?n.len:n.pos+t,i=SS();for(;n.pos>>3){case 1:if(e!==10)break;i.baseEvent=Z.decode(n,n.uint32());continue;case 2:if(e!==18)break;i.subagentRunId=n.string();continue;case 3:if(e!==26)break;i.messageId=n.string();continue;case 4:if(e!==34)break;i.delta=n.string();continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return CS.fromPartial(e??{})},fromPartial(e){let t=SS();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?Z.fromPartial(e.baseEvent):void 0,t.subagentRunId=e.subagentRunId??void 0,t.messageId=e.messageId??``,t.delta=e.delta??``,t}};function wS(){return{baseEvent:void 0,subagentRunId:void 0,messageId:``}}var TS={encode(e,t=new J){return e.baseEvent!==void 0&&Z.encode(e.baseEvent,t.uint32(10).fork()).join(),e.subagentRunId!==void 0&&t.uint32(18).string(e.subagentRunId),e.messageId!==``&&t.uint32(26).string(e.messageId),t},decode(e,t){let n=e instanceof Y?e:new Y(e),r=t===void 0?n.len:n.pos+t,i=wS();for(;n.pos>>3){case 1:if(e!==10)break;i.baseEvent=Z.decode(n,n.uint32());continue;case 2:if(e!==18)break;i.subagentRunId=n.string();continue;case 3:if(e!==26)break;i.messageId=n.string();continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return TS.fromPartial(e??{})},fromPartial(e){let t=wS();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?Z.fromPartial(e.baseEvent):void 0,t.subagentRunId=e.subagentRunId??void 0,t.messageId=e.messageId??``,t}};function ES(){return{baseEvent:void 0,subagentRunId:void 0,messageId:void 0,delta:void 0}}var DS={encode(e,t=new J){return e.baseEvent!==void 0&&Z.encode(e.baseEvent,t.uint32(10).fork()).join(),e.subagentRunId!==void 0&&t.uint32(18).string(e.subagentRunId),e.messageId!==void 0&&t.uint32(26).string(e.messageId),e.delta!==void 0&&t.uint32(34).string(e.delta),t},decode(e,t){let n=e instanceof Y?e:new Y(e),r=t===void 0?n.len:n.pos+t,i=ES();for(;n.pos>>3){case 1:if(e!==10)break;i.baseEvent=Z.decode(n,n.uint32());continue;case 2:if(e!==18)break;i.subagentRunId=n.string();continue;case 3:if(e!==26)break;i.messageId=n.string();continue;case 4:if(e!==34)break;i.delta=n.string();continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return DS.fromPartial(e??{})},fromPartial(e){let t=ES();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?Z.fromPartial(e.baseEvent):void 0,t.subagentRunId=e.subagentRunId??void 0,t.messageId=e.messageId??void 0,t.delta=e.delta??void 0,t}};function OS(){return{baseEvent:void 0,subagentRunId:void 0,messageId:``}}var kS={encode(e,t=new J){return e.baseEvent!==void 0&&Z.encode(e.baseEvent,t.uint32(10).fork()).join(),e.subagentRunId!==void 0&&t.uint32(18).string(e.subagentRunId),e.messageId!==``&&t.uint32(26).string(e.messageId),t},decode(e,t){let n=e instanceof Y?e:new Y(e),r=t===void 0?n.len:n.pos+t,i=OS();for(;n.pos>>3){case 1:if(e!==10)break;i.baseEvent=Z.decode(n,n.uint32());continue;case 2:if(e!==18)break;i.subagentRunId=n.string();continue;case 3:if(e!==26)break;i.messageId=n.string();continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return kS.fromPartial(e??{})},fromPartial(e){let t=OS();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?Z.fromPartial(e.baseEvent):void 0,t.subagentRunId=e.subagentRunId??void 0,t.messageId=e.messageId??``,t}};function AS(){return{baseEvent:void 0,subagentRunId:void 0,subtype:``,entityId:``,encryptedValue:``}}var jS={encode(e,t=new J){return e.baseEvent!==void 0&&Z.encode(e.baseEvent,t.uint32(10).fork()).join(),e.subagentRunId!==void 0&&t.uint32(18).string(e.subagentRunId),e.subtype!==``&&t.uint32(26).string(e.subtype),e.entityId!==``&&t.uint32(34).string(e.entityId),e.encryptedValue!==``&&t.uint32(42).string(e.encryptedValue),t},decode(e,t){let n=e instanceof Y?e:new Y(e),r=t===void 0?n.len:n.pos+t,i=AS();for(;n.pos>>3){case 1:if(e!==10)break;i.baseEvent=Z.decode(n,n.uint32());continue;case 2:if(e!==18)break;i.subagentRunId=n.string();continue;case 3:if(e!==26)break;i.subtype=n.string();continue;case 4:if(e!==34)break;i.entityId=n.string();continue;case 5:if(e!==42)break;i.encryptedValue=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=AS();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?Z.fromPartial(e.baseEvent):void 0,t.subagentRunId=e.subagentRunId??void 0,t.subtype=e.subtype??``,t.entityId=e.entityId??``,t.encryptedValue=e.encryptedValue??``,t}};function MS(){return{baseEvent:void 0,subagentRunId:``,name:``,description:void 0,parentSubagentRunId:void 0,parentToolCallId:void 0,parentMessageId:void 0}}var NS={encode(e,t=new J){return e.baseEvent!==void 0&&Z.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 Y?e:new Y(e),r=t===void 0?n.len:n.pos+t,i=MS();for(;n.pos>>3){case 1:if(e!==10)break;i.baseEvent=Z.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 NS.fromPartial(e??{})},fromPartial(e){let t=MS();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?Z.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 PS(){return{baseEvent:void 0,subagentRunId:``,result:void 0,outcome:``,interruptIds:[]}}var FS={encode(e,t=new J){e.baseEvent!==void 0&&Z.encode(e.baseEvent,t.uint32(10).fork()).join(),e.subagentRunId!==``&&t.uint32(18).string(e.subagentRunId),e.result!==void 0&&X.encode(X.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 Y?e:new Y(e),r=t===void 0?n.len:n.pos+t,i=PS();for(;n.pos>>3){case 1:if(e!==10)break;i.baseEvent=Z.decode(n,n.uint32());continue;case 2:if(e!==18)break;i.subagentRunId=n.string();continue;case 3:if(e!==26)break;i.result=X.unwrap(X.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 FS.fromPartial(e??{})},fromPartial(e){let t=PS();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?Z.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 IS(){return{baseEvent:void 0,subagentRunId:``,message:``,code:void 0}}var LS={encode(e,t=new J){return e.baseEvent!==void 0&&Z.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 Y?e:new Y(e),r=t===void 0?n.len:n.pos+t,i=IS();for(;n.pos>>3){case 1:if(e!==10)break;i.baseEvent=Z.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 LS.fromPartial(e??{})},fromPartial(e){let t=IS();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?Z.fromPartial(e.baseEvent):void 0,t.subagentRunId=e.subagentRunId??``,t.message=e.message??``,t.code=e.code??void 0,t}};function RS(){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,toolCallResult:void 0,activitySnapshot:void 0,activityDelta:void 0,reasoningStart:void 0,reasoningMessageStart:void 0,reasoningMessageContent:void 0,reasoningMessageEnd:void 0,reasoningMessageChunk:void 0,reasoningEnd:void 0,reasoningEncryptedValue:void 0}}var zS={encode(e,t=new J){return e.textMessageStart!==void 0&&jx.encode(e.textMessageStart,t.uint32(10).fork()).join(),e.textMessageContent!==void 0&&Nx.encode(e.textMessageContent,t.uint32(18).fork()).join(),e.textMessageEnd!==void 0&&Fx.encode(e.textMessageEnd,t.uint32(26).fork()).join(),e.toolCallStart!==void 0&&zx.encode(e.toolCallStart,t.uint32(34).fork()).join(),e.toolCallArgs!==void 0&&Vx.encode(e.toolCallArgs,t.uint32(42).fork()).join(),e.toolCallEnd!==void 0&&Ux.encode(e.toolCallEnd,t.uint32(50).fork()).join(),e.stateSnapshot!==void 0&&Yx.encode(e.stateSnapshot,t.uint32(58).fork()).join(),e.stateDelta!==void 0&&Zx.encode(e.stateDelta,t.uint32(66).fork()).join(),e.messagesSnapshot!==void 0&&$x.encode(e.messagesSnapshot,t.uint32(74).fork()).join(),e.raw!==void 0&&aS.encode(e.raw,t.uint32(82).fork()).join(),e.custom!==void 0&&sS.encode(e.custom,t.uint32(90).fork()).join(),e.runStarted!==void 0&&lS.encode(e.runStarted,t.uint32(98).fork()).join(),e.runFinished!==void 0&&dS.encode(e.runFinished,t.uint32(106).fork()).join(),e.runError!==void 0&&pS.encode(e.runError,t.uint32(114).fork()).join(),e.stepStarted!==void 0&&hS.encode(e.stepStarted,t.uint32(122).fork()).join(),e.stepFinished!==void 0&&_S.encode(e.stepFinished,t.uint32(130).fork()).join(),e.textMessageChunk!==void 0&&Lx.encode(e.textMessageChunk,t.uint32(138).fork()).join(),e.toolCallChunk!==void 0&&Gx.encode(e.toolCallChunk,t.uint32(146).fork()).join(),e.subagentStarted!==void 0&&NS.encode(e.subagentStarted,t.uint32(154).fork()).join(),e.subagentFinished!==void 0&&FS.encode(e.subagentFinished,t.uint32(162).fork()).join(),e.subagentError!==void 0&&LS.encode(e.subagentError,t.uint32(170).fork()).join(),e.toolCallResult!==void 0&&qx.encode(e.toolCallResult,t.uint32(178).fork()).join(),e.activitySnapshot!==void 0&&tS.encode(e.activitySnapshot,t.uint32(186).fork()).join(),e.activityDelta!==void 0&&rS.encode(e.activityDelta,t.uint32(194).fork()).join(),e.reasoningStart!==void 0&&yS.encode(e.reasoningStart,t.uint32(202).fork()).join(),e.reasoningMessageStart!==void 0&&xS.encode(e.reasoningMessageStart,t.uint32(210).fork()).join(),e.reasoningMessageContent!==void 0&&CS.encode(e.reasoningMessageContent,t.uint32(218).fork()).join(),e.reasoningMessageEnd!==void 0&&TS.encode(e.reasoningMessageEnd,t.uint32(226).fork()).join(),e.reasoningMessageChunk!==void 0&&DS.encode(e.reasoningMessageChunk,t.uint32(234).fork()).join(),e.reasoningEnd!==void 0&&kS.encode(e.reasoningEnd,t.uint32(242).fork()).join(),e.reasoningEncryptedValue!==void 0&&jS.encode(e.reasoningEncryptedValue,t.uint32(250).fork()).join(),t},decode(e,t){let n=e instanceof Y?e:new Y(e),r=t===void 0?n.len:n.pos+t,i=RS();for(;n.pos>>3){case 1:if(e!==10)break;i.textMessageStart=jx.decode(n,n.uint32());continue;case 2:if(e!==18)break;i.textMessageContent=Nx.decode(n,n.uint32());continue;case 3:if(e!==26)break;i.textMessageEnd=Fx.decode(n,n.uint32());continue;case 4:if(e!==34)break;i.toolCallStart=zx.decode(n,n.uint32());continue;case 5:if(e!==42)break;i.toolCallArgs=Vx.decode(n,n.uint32());continue;case 6:if(e!==50)break;i.toolCallEnd=Ux.decode(n,n.uint32());continue;case 7:if(e!==58)break;i.stateSnapshot=Yx.decode(n,n.uint32());continue;case 8:if(e!==66)break;i.stateDelta=Zx.decode(n,n.uint32());continue;case 9:if(e!==74)break;i.messagesSnapshot=$x.decode(n,n.uint32());continue;case 10:if(e!==82)break;i.raw=aS.decode(n,n.uint32());continue;case 11:if(e!==90)break;i.custom=sS.decode(n,n.uint32());continue;case 12:if(e!==98)break;i.runStarted=lS.decode(n,n.uint32());continue;case 13:if(e!==106)break;i.runFinished=dS.decode(n,n.uint32());continue;case 14:if(e!==114)break;i.runError=pS.decode(n,n.uint32());continue;case 15:if(e!==122)break;i.stepStarted=hS.decode(n,n.uint32());continue;case 16:if(e!==130)break;i.stepFinished=_S.decode(n,n.uint32());continue;case 17:if(e!==138)break;i.textMessageChunk=Lx.decode(n,n.uint32());continue;case 18:if(e!==146)break;i.toolCallChunk=Gx.decode(n,n.uint32());continue;case 19:if(e!==154)break;i.subagentStarted=NS.decode(n,n.uint32());continue;case 20:if(e!==162)break;i.subagentFinished=FS.decode(n,n.uint32());continue;case 21:if(e!==170)break;i.subagentError=LS.decode(n,n.uint32());continue;case 22:if(e!==178)break;i.toolCallResult=qx.decode(n,n.uint32());continue;case 23:if(e!==186)break;i.activitySnapshot=tS.decode(n,n.uint32());continue;case 24:if(e!==194)break;i.activityDelta=rS.decode(n,n.uint32());continue;case 25:if(e!==202)break;i.reasoningStart=yS.decode(n,n.uint32());continue;case 26:if(e!==210)break;i.reasoningMessageStart=xS.decode(n,n.uint32());continue;case 27:if(e!==218)break;i.reasoningMessageContent=CS.decode(n,n.uint32());continue;case 28:if(e!==226)break;i.reasoningMessageEnd=TS.decode(n,n.uint32());continue;case 29:if(e!==234)break;i.reasoningMessageChunk=DS.decode(n,n.uint32());continue;case 30:if(e!==242)break;i.reasoningEnd=kS.decode(n,n.uint32());continue;case 31:if(e!==250)break;i.reasoningEncryptedValue=jS.decode(n,n.uint32());continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return zS.fromPartial(e??{})},fromPartial(e){let t=RS();return t.textMessageStart=e.textMessageStart!==void 0&&e.textMessageStart!==null?jx.fromPartial(e.textMessageStart):void 0,t.textMessageContent=e.textMessageContent!==void 0&&e.textMessageContent!==null?Nx.fromPartial(e.textMessageContent):void 0,t.textMessageEnd=e.textMessageEnd!==void 0&&e.textMessageEnd!==null?Fx.fromPartial(e.textMessageEnd):void 0,t.toolCallStart=e.toolCallStart!==void 0&&e.toolCallStart!==null?zx.fromPartial(e.toolCallStart):void 0,t.toolCallArgs=e.toolCallArgs!==void 0&&e.toolCallArgs!==null?Vx.fromPartial(e.toolCallArgs):void 0,t.toolCallEnd=e.toolCallEnd!==void 0&&e.toolCallEnd!==null?Ux.fromPartial(e.toolCallEnd):void 0,t.stateSnapshot=e.stateSnapshot!==void 0&&e.stateSnapshot!==null?Yx.fromPartial(e.stateSnapshot):void 0,t.stateDelta=e.stateDelta!==void 0&&e.stateDelta!==null?Zx.fromPartial(e.stateDelta):void 0,t.messagesSnapshot=e.messagesSnapshot!==void 0&&e.messagesSnapshot!==null?$x.fromPartial(e.messagesSnapshot):void 0,t.raw=e.raw!==void 0&&e.raw!==null?aS.fromPartial(e.raw):void 0,t.custom=e.custom!==void 0&&e.custom!==null?sS.fromPartial(e.custom):void 0,t.runStarted=e.runStarted!==void 0&&e.runStarted!==null?lS.fromPartial(e.runStarted):void 0,t.runFinished=e.runFinished!==void 0&&e.runFinished!==null?dS.fromPartial(e.runFinished):void 0,t.runError=e.runError!==void 0&&e.runError!==null?pS.fromPartial(e.runError):void 0,t.stepStarted=e.stepStarted!==void 0&&e.stepStarted!==null?hS.fromPartial(e.stepStarted):void 0,t.stepFinished=e.stepFinished!==void 0&&e.stepFinished!==null?_S.fromPartial(e.stepFinished):void 0,t.textMessageChunk=e.textMessageChunk!==void 0&&e.textMessageChunk!==null?Lx.fromPartial(e.textMessageChunk):void 0,t.toolCallChunk=e.toolCallChunk!==void 0&&e.toolCallChunk!==null?Gx.fromPartial(e.toolCallChunk):void 0,t.subagentStarted=e.subagentStarted!==void 0&&e.subagentStarted!==null?NS.fromPartial(e.subagentStarted):void 0,t.subagentFinished=e.subagentFinished!==void 0&&e.subagentFinished!==null?FS.fromPartial(e.subagentFinished):void 0,t.subagentError=e.subagentError!==void 0&&e.subagentError!==null?LS.fromPartial(e.subagentError):void 0,t.toolCallResult=e.toolCallResult!==void 0&&e.toolCallResult!==null?qx.fromPartial(e.toolCallResult):void 0,t.activitySnapshot=e.activitySnapshot!==void 0&&e.activitySnapshot!==null?tS.fromPartial(e.activitySnapshot):void 0,t.activityDelta=e.activityDelta!==void 0&&e.activityDelta!==null?rS.fromPartial(e.activityDelta):void 0,t.reasoningStart=e.reasoningStart!==void 0&&e.reasoningStart!==null?yS.fromPartial(e.reasoningStart):void 0,t.reasoningMessageStart=e.reasoningMessageStart!==void 0&&e.reasoningMessageStart!==null?xS.fromPartial(e.reasoningMessageStart):void 0,t.reasoningMessageContent=e.reasoningMessageContent!==void 0&&e.reasoningMessageContent!==null?CS.fromPartial(e.reasoningMessageContent):void 0,t.reasoningMessageEnd=e.reasoningMessageEnd!==void 0&&e.reasoningMessageEnd!==null?TS.fromPartial(e.reasoningMessageEnd):void 0,t.reasoningMessageChunk=e.reasoningMessageChunk!==void 0&&e.reasoningMessageChunk!==null?DS.fromPartial(e.reasoningMessageChunk):void 0,t.reasoningEnd=e.reasoningEnd!==void 0&&e.reasoningEnd!==null?kS.fromPartial(e.reasoningEnd):void 0,t.reasoningEncryptedValue=e.reasoningEncryptedValue!==void 0&&e.reasoningEncryptedValue!==null?jS.fromPartial(e.reasoningEncryptedValue):void 0,t}};function BS(){return{provider:void 0,model:void 0,inputTokens:void 0,outputTokens:void 0,totalTokens:void 0,reasoningTokens:void 0,cachedInputTokens:void 0,cacheWriteInputTokens:void 0}}var VS={encode(e,t=new J){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),e.cacheWriteInputTokens!==void 0&&t.uint32(64).int64(e.cacheWriteInputTokens),t},decode(e,t){let n=e instanceof Y?e:new Y(e),r=t===void 0?n.len:n.pos+t,i=BS();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=HS(n.int64());continue;case 4:if(e!==32)break;i.outputTokens=HS(n.int64());continue;case 5:if(e!==40)break;i.totalTokens=HS(n.int64());continue;case 6:if(e!==48)break;i.reasoningTokens=HS(n.int64());continue;case 7:if(e!==56)break;i.cachedInputTokens=HS(n.int64());continue;case 8:if(e!==64)break;i.cacheWriteInputTokens=HS(n.int64());continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return VS.fromPartial(e??{})},fromPartial(e){let t=BS();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.cacheWriteInputTokens=e.cacheWriteInputTokens??void 0,t}};function HS(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,WS=e=>Array.isArray(e)?e:[],GS=()=>typeof process<`u`&&!!{}.SUPPRESS_TRANSFORMATION_WARNINGS,KS=()=>{GS()||console.warn(`[ag-ui][proto] Dropped a content part this build does not know: the protocol has a variant this SDK predates.`)};new Set(Object.values(A));var qS={textMessageStart:`TEXT_MESSAGE_START`,textMessageContent:`TEXT_MESSAGE_CONTENT`,textMessageEnd:`TEXT_MESSAGE_END`,textMessageChunk:`TEXT_MESSAGE_CHUNK`,toolCallStart:`TOOL_CALL_START`,toolCallArgs:`TOOL_CALL_ARGS`,toolCallEnd:`TOOL_CALL_END`,toolCallChunk:`TOOL_CALL_CHUNK`,toolCallResult:`TOOL_CALL_RESULT`,stateSnapshot:`STATE_SNAPSHOT`,stateDelta:`STATE_DELTA`,messagesSnapshot:`MESSAGES_SNAPSHOT`,activitySnapshot:`ACTIVITY_SNAPSHOT`,activityDelta:`ACTIVITY_DELTA`,raw:`RAW`,custom:`CUSTOM`,runStarted:`RUN_STARTED`,runFinished:`RUN_FINISHED`,runError:`RUN_ERROR`,stepStarted:`STEP_STARTED`,stepFinished:`STEP_FINISHED`,reasoningStart:`REASONING_START`,reasoningMessageStart:`REASONING_MESSAGE_START`,reasoningMessageContent:`REASONING_MESSAGE_CONTENT`,reasoningMessageEnd:`REASONING_MESSAGE_END`,reasoningMessageChunk:`REASONING_MESSAGE_CHUNK`,reasoningEnd:`REASONING_END`,reasoningEncryptedValue:`REASONING_ENCRYPTED_VALUE`,subagentStarted:`SUBAGENT_STARTED`,subagentFinished:`SUBAGENT_FINISHED`,subagentError:`SUBAGENT_ERROR`},JS=new Set([1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31]),YS=e=>{let t=US(e);if(t){if([t.data,t.url,t.file].filter(Boolean).length>1)throw Error(`Invalid event: source carries more than one arm`);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}}if(t.file){let e=t.file;return{type:`file`,value:e.value,provider:e.provider,mimeType:e.mimeType}}}},XS=e=>{let t=US(e);if(t){if([t.text,t.image,t.audio,t.video,t.document].filter(Boolean).length>1)throw Error(`Invalid event: content part carries more than one arm`);if(t.text){let e=t.text;return{type:`text`,id:e.id,text:e.text,metadata:e.metadata}}if(t.image){let e=t.image;return e.source!==void 0&&YS(e.source)===void 0?void 0:{type:`image`,id:e.id,source:YS(e.source),metadata:e.metadata}}if(t.audio){let e=t.audio;return e.source!==void 0&&YS(e.source)===void 0?void 0:{type:`audio`,id:e.id,source:YS(e.source),metadata:e.metadata}}if(t.video){let e=t.video;return e.source!==void 0&&YS(e.source)===void 0?void 0:{type:`video`,id:e.id,source:YS(e.source),metadata:e.metadata}}if(t.document){let e=t.document;return e.source!==void 0&&YS(e.source)===void 0?void 0:{type:`document`,id:e.id,source:YS(e.source),metadata:e.metadata}}}},ZS=new Set([`activity`]),QS=new Set([`user`,`tool`]),$S=new Set([`developer`,`system`,`assistant`,`user`,`tool`,`activity`,`reasoning`]),eC=e=>{let t=US(e)??{},n={...t},r=typeof t.role==`string`?t.role:``,i=$S.has(r),a=i?QS.has(r):WS(t.contentParts).length>0,o=i?ZS.has(r):!a&&t.activityContent!==void 0;if(!i&&(t.content===void 0?0:1)+ +(WS(t.contentParts).length>0)+(t.activityContent===void 0?0:1)>1)throw Error(`Invalid event: message carries more than one content form`);if(i){if(!a&&WS(t.contentParts).length>0)throw Error(`Invalid event: message carries content parts for a role that has none`);if(t.activityContent!==void 0&&!o)throw Error(`Invalid event: message carries activity content for a non-activity role`);if(o&&t.content!==void 0)throw Error(`Invalid event: activity content cannot ride with other content forms`);if(a&&t.content!==void 0&&WS(t.contentParts).length>0)throw Error(`Invalid event: message carries both string content and content parts`)}return a&&t.content===void 0&&(n.content=WS(t.contentParts).map(e=>{let t=XS(e);return t===void 0&&KS(),t}).filter(e=>e!==void 0)),o&&t.activityContent!==void 0&&(n.content=t.activityContent),delete n.activityContent,delete n.contentParts,WS(t.toolCalls).length===0&&delete n.toolCalls,Object.keys(n).forEach(e=>{n[e]===void 0&&delete n[e]}),n},tC=e=>{if(Array.isArray(e)){for(let t of e)tC(t);return}let t=US(e);if(t)for(let e of Object.keys(t))t[e]===void 0?delete t[e]:tC(t[e])},nC=e=>{let t=US(e);if(!t)return;let n={};return t.threadId!==void 0&&(n.threadId=t.threadId),t.runId!==void 0&&(n.runId=t.runId),t.protocolVersion!==void 0&&(n.protocolVersion=t.protocolVersion),t.parentRunId!==void 0&&(n.parentRunId=t.parentRunId),t.state!==void 0&&(n.state=t.state),n.messages=WS(t.messages).map(eC).filter(e=>e!==void 0),n.tools=WS(t.tools),n.context=WS(t.context),t.forwardedProps!==void 0&&(n.forwardedProps=t.forwardedProps),n.resume=WS(t.resume),n},rC={TextMessageStartEvent:{singular:new Set([1]),descend:{1:`BaseEvent`}},BaseEvent:{singular:new Set([3,4]),descend:{},google:{3:`google.protobuf.Value`,4:`google.protobuf.Struct`}},TextMessageContentEvent:{singular:new Set([1]),descend:{1:`BaseEvent`}},TextMessageEndEvent:{singular:new Set([1]),descend:{1:`BaseEvent`}},ToolCallStartEvent:{singular:new Set([1]),descend:{1:`BaseEvent`}},ToolCallArgsEvent:{singular:new Set([1]),descend:{1:`BaseEvent`}},ToolCallEndEvent:{singular:new Set([1]),descend:{1:`BaseEvent`}},StateSnapshotEvent:{singular:new Set([1,2]),descend:{1:`BaseEvent`},google:{2:`google.protobuf.Value`}},StateDeltaEvent:{singular:new Set([1]),descend:{1:`BaseEvent`,2:`JsonPatchOperation`}},JsonPatchOperation:{singular:new Set([4]),descend:{},google:{4:`google.protobuf.Value`}},MessagesSnapshotEvent:{singular:new Set([1]),descend:{1:`BaseEvent`,2:`Message`}},Message:{singular:new Set([9,13]),descend:{5:`ToolCall`,8:`InputContent`},google:{9:`google.protobuf.Struct`,13:`google.protobuf.Struct`}},ToolCall:{singular:new Set([3,4]),descend:{},google:{4:`google.protobuf.Struct`}},InputContent:{singular:new Set([1,2,3,4,5]),descend:{1:`TextInputPart`,2:`ImageInputPart`,3:`AudioInputPart`,4:`VideoInputPart`,5:`DocumentInputPart`},arms:new Set([1,2,3,4,5])},TextInputPart:{singular:new Set([3]),descend:{},google:{3:`google.protobuf.Value`}},ImageInputPart:{singular:new Set([1,2]),descend:{1:`InputContentSource`},google:{2:`google.protobuf.Value`}},InputContentSource:{singular:new Set([1,2,3]),descend:{},arms:new Set([1,2,3])},AudioInputPart:{singular:new Set([1,2]),descend:{1:`InputContentSource`},google:{2:`google.protobuf.Value`}},VideoInputPart:{singular:new Set([1,2]),descend:{1:`InputContentSource`},google:{2:`google.protobuf.Value`}},DocumentInputPart:{singular:new Set([1,2]),descend:{1:`InputContentSource`},google:{2:`google.protobuf.Value`}},RawEvent:{singular:new Set([1,2]),descend:{1:`BaseEvent`},google:{2:`google.protobuf.Value`}},CustomEvent:{singular:new Set([1,3]),descend:{1:`BaseEvent`},google:{3:`google.protobuf.Value`}},RunStartedEvent:{singular:new Set([1,5]),descend:{1:`BaseEvent`,5:`RunAgentInput`}},RunAgentInput:{singular:new Set([4,8]),descend:{5:`Message`,6:`Tool`,9:`ResumeEntry`},google:{4:`google.protobuf.Value`,8:`google.protobuf.Value`}},Tool:{singular:new Set([3,4]),descend:{},google:{3:`google.protobuf.Value`,4:`google.protobuf.Struct`}},ResumeEntry:{singular:new Set([3,4]),descend:{},google:{3:`google.protobuf.Value`,4:`google.protobuf.Struct`}},RunFinishedEvent:{singular:new Set([1,4]),descend:{1:`BaseEvent`,6:`Interrupt`},google:{4:`google.protobuf.Value`}},Interrupt:{singular:new Set([5,7]),descend:{},google:{5:`google.protobuf.Value`,7:`google.protobuf.Value`}},RunErrorEvent:{singular:new Set([1]),descend:{1:`BaseEvent`}},StepStartedEvent:{singular:new Set([1]),descend:{1:`BaseEvent`}},StepFinishedEvent:{singular:new Set([1]),descend:{1:`BaseEvent`}},TextMessageChunkEvent:{singular:new Set([1]),descend:{1:`BaseEvent`}},ToolCallChunkEvent:{singular:new Set([1]),descend:{1:`BaseEvent`}},SubagentStartedEvent:{singular:new Set([1]),descend:{1:`BaseEvent`}},SubagentFinishedEvent:{singular:new Set([1,3]),descend:{1:`BaseEvent`},google:{3:`google.protobuf.Value`}},SubagentErrorEvent:{singular:new Set([1]),descend:{1:`BaseEvent`}},ToolCallResultEvent:{singular:new Set([1]),descend:{1:`BaseEvent`,7:`InputContent`}},ActivitySnapshotEvent:{singular:new Set([1,5]),descend:{1:`BaseEvent`},google:{5:`google.protobuf.Struct`}},ActivityDeltaEvent:{singular:new Set([1]),descend:{1:`BaseEvent`,5:`JsonPatchOperation`}},ReasoningStartEvent:{singular:new Set([1]),descend:{1:`BaseEvent`}},ReasoningMessageStartEvent:{singular:new Set([1]),descend:{1:`BaseEvent`}},ReasoningMessageContentEvent:{singular:new Set([1]),descend:{1:`BaseEvent`}},ReasoningMessageEndEvent:{singular:new Set([1]),descend:{1:`BaseEvent`}},ReasoningMessageChunkEvent:{singular:new Set([1]),descend:{1:`BaseEvent`}},ReasoningEndEvent:{singular:new Set([1]),descend:{1:`BaseEvent`}},ReasoningEncryptedValueEvent:{singular:new Set([1]),descend:{1:`BaseEvent`}},"google.protobuf.Struct":{singular:new Set,descend:{1:`google.protobuf.Struct.FieldsEntry`}},"google.protobuf.Struct.FieldsEntry":{singular:new Set([2]),descend:{2:`google.protobuf.Value`}},"google.protobuf.Value":{singular:new Set([5,6]),descend:{5:`google.protobuf.Struct`,6:`google.protobuf.ListValue`},arms:new Set([1,2,3,4,5,6]),armWireTypes:{1:0,2:1,3:2,4:0,5:2,6:2}},"google.protobuf.ListValue":{singular:new Set,descend:{1:`google.protobuf.Value`}}},iC={1:`TextMessageStartEvent`,2:`TextMessageContentEvent`,3:`TextMessageEndEvent`,4:`ToolCallStartEvent`,5:`ToolCallArgsEvent`,6:`ToolCallEndEvent`,7:`StateSnapshotEvent`,8:`StateDeltaEvent`,9:`MessagesSnapshotEvent`,10:`RawEvent`,11:`CustomEvent`,12:`RunStartedEvent`,13:`RunFinishedEvent`,14:`RunErrorEvent`,15:`StepStartedEvent`,16:`StepFinishedEvent`,17:`TextMessageChunkEvent`,18:`ToolCallChunkEvent`,19:`SubagentStartedEvent`,20:`SubagentFinishedEvent`,21:`SubagentErrorEvent`,22:`ToolCallResultEvent`,23:`ActivitySnapshotEvent`,24:`ActivityDeltaEvent`,25:`ReasoningStartEvent`,26:`ReasoningMessageStartEvent`,27:`ReasoningMessageContentEvent`,28:`ReasoningMessageEndEvent`,29:`ReasoningMessageChunkEvent`,30:`ReasoningEndEvent`,31:`ReasoningEncryptedValueEvent`};function aC(e,t){let n=0,r=0;for(;;){if(t.offset>=e.length)throw Error(`Invalid event`);let i=e[t.offset++];if(r<28?n+=(i&127)*2**r:r===28&&(n+=(i&15)*2**28),r+=7,!(i&128))return n}}function oC(e,t){let n={offset:0},r=0,i=0;for(;n.offsete.length)throw Error(`Invalid event`);if(r===0){if(t.arms?.has(o)){if(i!==0&&i!==o)throw Error(`Invalid event`);i=o}let r=t.descend[o];if(r!==void 0){let t=rC[r];t!==void 0&&oC(e.subarray(n.offset,n.offset+a),t)}}n.offset+=a}else if(s===5)n.offset+=4;else throw Error(`Invalid event`);if(n.offset>e.length)throw Error(`Invalid event`)}if(r!==0)throw Error(`Invalid event`)}function sC(e){let t=new Set,n={offset:0},r=0;for(;n.offset0&&!t.has(a))throw Error(`Invalid event`);t.add(a)}if(o===0)aC(e,n);else if(o===1)n.offset+=8;else if(o===2){let t=aC(e,n);if(n.offset+t>e.length)throw Error(`Invalid event`);if(r===0){let r=iC[a];if(r!==void 0){let i=rC[r];i!==void 0&&oC(e.subarray(n.offset,n.offset+t),i)}}n.offset+=t}else if(o===5)n.offset+=4;else throw Error(`Invalid event`);if(n.offset>e.length)throw Error(`Invalid event`)}if(r!==0)throw Error(`Invalid event`)}function cC(e){if(e.length===1)return e[0];let t=new Uint8Array(e.reduce((e,t)=>e+t.length,0)),n=0;for(let r of e)t.set(r,n),n+=r.length;return t}function lC(e,t){let n=new Y(e),r=[],i=new Map,a,o=!1;for(;n.pos1||n!==t){s.push(new J().uint32(e.number*8+2).bytes(n).finish()),o=!0;continue}}s.push(e.raw)}return o?cC(s):e}var uC=class extends Error{constructor(e=`Unknown event type`){super(e),this.name=`AGUIUnknownEventTypeError`}};function dC(e,t,n,r){let i=0,a=0,o=0;for(;;){if(t.offset>=e.length||o>=n)return-1;let s=e[t.offset++];if(o+=1,o===n&&s>r)return-1;if(i+=(s&127)*2**a,a+=7,!(s&128))return i}}var fC=(e,t)=>dC(e,t,5,15),pC=(e,t)=>dC(e,t,10,1);function mC(e){let t={offset:0},n=[];for(;t.offsete.length)return!1;t.offset+=n}else return!1;if(t.offset>e.length)return!1}return n.length===0}function hC(e){let t={offset:0},n=[],r=0;for(;t.offsete.length)return!1;if(s){if(JS.has(a)||!mC(e.subarray(t.offset,t.offset+n)))return!1;r+=1}t.offset+=n}else return!1;if(t.offset>e.length)return!1}return n.length===0&&r>0}function gC(e){sC(e);let t=zS.decode(lC(e,{singular:JS,descend:iC})),n=Object.entries(t).filter(([,e])=>e!==void 0);if(n.length!==1)throw n.length===0&&hC(e)?new uC:Error(`Invalid event`);let r=n[0],i=qS[r[0]];if(i===void 0)throw Error(`Invalid event`);let a=r[1],o=US(a.baseEvent);if(!o)throw Error(`Invalid event`);let s=Ox[o.type];if(s!==i)throw Error(`Invalid event: envelope carries `+i+` but the base event declares `+String(s));if(a.type=i,a.timestamp=o.timestamp,a.rawEvent=o.rawEvent,o.metadata!==void 0&&(a.metadata=o.metadata),delete a.baseEvent,a.type===`MESSAGES_SNAPSHOT`&&Array.isArray(a.messages)&&(a.messages=a.messages.map(eC).filter(e=>e!==void 0)),a.type===`RUN_FINISHED`){let e=a,t=typeof e.outcome==`string`&&e.outcome!==``?e.outcome:void 0,n={};n.pendingToolCallIds=e.pendingToolCallIds,delete e.pendingToolCallIds,n.interrupts=e.interrupts,delete e.interrupts,delete e.outcome,t===void 0&&(WS(n.pendingToolCallIds).length>0&&(e.pendingToolCallIds=n.pendingToolCallIds),WS(n.interrupts).length>0&&(e.interrupts=n.interrupts)),t===`success`&&(e.outcome={type:`success`,...WS(n.pendingToolCallIds).length>0?{pendingToolCallIds:n.pendingToolCallIds}:{},...WS(n.interrupts).length>0?{interrupts:n.interrupts}:{}}),t===`interrupt`&&(e.outcome={type:`interrupt`,interrupts:WS(n.interrupts),...WS(n.pendingToolCallIds).length>0?{pendingToolCallIds:n.pendingToolCallIds}:{}}),t===`cancelled`&&(e.outcome={type:`cancelled`,...WS(n.pendingToolCallIds).length>0?{pendingToolCallIds:n.pendingToolCallIds}:{},...WS(n.interrupts).length>0?{interrupts:n.interrupts}:{}}),t!==void 0&&![`success`,`interrupt`,`cancelled`].includes(t)&&(e.outcome={type:t,...WS(n.pendingToolCallIds).length>0?{pendingToolCallIds:n.pendingToolCallIds}:{},...WS(n.interrupts).length>0?{interrupts:n.interrupts}:{}})}if(a.type===`SUBAGENT_FINISHED`){let e=a,t=typeof e.outcome==`string`&&e.outcome!==``?e.outcome:void 0,n={};n.interruptIds=e.interruptIds,delete e.interruptIds,delete e.outcome,t===void 0&&WS(n.interruptIds).length>0&&(e.interruptIds=n.interruptIds),t===`success`&&(e.outcome={type:`success`,...WS(n.interruptIds).length>0?{interruptIds:n.interruptIds}:{}}),t===`suspended`&&(e.outcome={type:`suspended`,...WS(n.interruptIds).length>0?{interruptIds:n.interruptIds}:{}}),t!==void 0&&![`success`,`suspended`].includes(t)&&(e.outcome={type:t,...WS(n.interruptIds).length>0?{interruptIds:n.interruptIds}:{}})}if(a.type===`STATE_DELTA`&&Array.isArray(a.delta)&&(a.delta=a.delta.map(e=>{let t=Ub[e.op];return e.op=typeof t==`string`&&t!==`UNRECOGNIZED`?t.toLowerCase():String(e.op),Object.keys(e).forEach(t=>{e[t]===void 0&&delete e[t]}),e})),a.type===`ACTIVITY_DELTA`&&Array.isArray(a.patch)&&(a.patch=a.patch.map(e=>{let t=Ub[e.op];return e.op=typeof t==`string`&&t!==`UNRECOGNIZED`?t.toLowerCase():String(e.op),Object.keys(e).forEach(t=>{e[t]===void 0&&delete e[t]}),e})),a.type===`RUN_FINISHED`&&Array.isArray(a.usage)&&a.usage.length===0&&delete a.usage,a.type===`RUN_ERROR`&&Array.isArray(a.usage)&&a.usage.length===0&&delete a.usage,a.type===`TOOL_CALL_RESULT`){let e=a;if(e.content!==void 0&&WS(e.contentParts).length>0)throw Error(`Invalid event: content carries both string content and content parts`);e.content===void 0&&(e.content=WS(e.contentParts).map(e=>{let t=XS(e);return t===void 0&&KS(),t}).filter(e=>e!==void 0)),delete e.contentParts}return a.type===`RUN_STARTED`&&a.input!==void 0&&(a.input=nC(a.input)),tC(a),a}var _C=/^[v^~<>=]*?(\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+))?(?:-([\da-z\-]+(?:\.[\da-z\-]+)*))?(?:\+[\da-z\-]+(?:\.[\da-z\-]+)*)?)?)?$/i,vC=e=>{if(typeof e!=`string`)throw TypeError(`Invalid argument expected string`);let t=e.match(_C);if(!t)throw Error(`Invalid argument not valid semver ('${e}' received)`);return t.shift(),t},yC=e=>e===`*`||e===`x`||e===`X`,bC=e=>{let t=parseInt(e,10);return isNaN(t)?e:t},xC=(e,t)=>typeof e==typeof t?[e,t]:[String(e),String(t)],SC=(e,t)=>{if(yC(e)||yC(t))return 0;let[n,r]=xC(bC(e),bC(t));return n>r?1:n{for(let n=0;n{let n=vC(e),r=vC(t),i=n.pop(),a=r.pop(),o=CC(n,r);return o===0?i&&a?CC(i.split(`.`),a.split(`.`)):i||a?i?-1:1:0:o},TC=e=>typeof e==`string`&&/^[v\d]/.test(e)&&_C.test(e);Object.freeze({status:`aborted`});function Q(e,t,n){function r(n,r){var i;Object.defineProperty(n,"_zod",{value:n._zod??{},enumerable:!1}),(i=n._zod).traits??(i.traits=new Set),n._zod.traits.add(e),t(n,r);for(let e in o.prototype)e in n||Object.defineProperty(n,e,{value:o.prototype[e].bind(n)});n._zod.constr=o,n._zod.def=r}let i=n?.Parent??Object;class a extends i{}Object.defineProperty(a,"name",{value:e});function o(e){var t;let i=n?.Parent?new a:this;r(i,e),(t=i._zod).deferred??(t.deferred=[]);for(let e of i._zod.deferred)e();return i}return Object.defineProperty(o,"init",{value:r}),Object.defineProperty(o,Symbol.hasInstance,{value:t=>n?.Parent&&t instanceof n.Parent?!0:t?._zod?.traits?.has(e)}),Object.defineProperty(o,"name",{value:e}),o}var EC=class extends Error{constructor(){super(`Encountered Promise during synchronous parse. Use .parseAsync() instead.`)}},DC={};function OC(e){return e&&Object.assign(DC,e),DC}function kC(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 AC(e,t){return typeof t==`bigint`?t.toString():t}function jC(e){return{get value(){{let t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function MC(e){return e==null}function NC(e){let t=+!!e.startsWith(`^`),n=e.endsWith(`$`)?e.length-1:e.length;return e.slice(t,n)}function PC(e,t,n){Object.defineProperty(e,t,{get(){{let r=n();return e[t]=r,r}},set(n){Object.defineProperty(e,t,{value:n})},configurable:!0})}function FC(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function IC(e){return JSON.stringify(e)}var LC=Error.captureStackTrace?Error.captureStackTrace:(...e)=>{};function RC(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}var zC=jC(()=>{if(typeof navigator<`u`&&navigator?.userAgent?.includes(`Cloudflare`))return!1;try{return Function(``),!0}catch{return!1}});function BC(e){if(RC(e)===!1)return!1;let t=e.constructor;if(t===void 0)return!0;let n=t.prototype;return RC(n)!==!1&&Object.prototype.hasOwnProperty.call(n,`isPrototypeOf`)!==!1}var VC=new Set([`string`,`number`,`symbol`]);function HC(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}function UC(e,t,n){let r=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(r._zod.parent=e),r}function WC(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 GC(e){return Object.keys(e).filter(t=>e[t]._zod.optin===`optional`&&e[t]._zod.optout===`optional`)}function KC(e,t){let n={},r=e._zod.def;for(let e in t){if(!(e in r.shape))throw Error(`Unrecognized key: "${e}"`);t[e]&&(n[e]=r.shape[e])}return UC(e,{...e._zod.def,shape:n,checks:[]})}function qC(e,t){let n={...e._zod.def.shape},r=e._zod.def;for(let e in t){if(!(e in r.shape))throw Error(`Unrecognized key: "${e}"`);t[e]&&delete n[e]}return UC(e,{...e._zod.def,shape:n,checks:[]})}function JC(e,t){if(!BC(t))throw Error(`Invalid input to extend: expected a plain object`);return UC(e,{...e._zod.def,get shape(){let n={...e._zod.def.shape,...t};return FC(this,`shape`,n),n},checks:[]})}function YC(e,t){return UC(e,{...e._zod.def,get shape(){let n={...e._zod.def.shape,...t._zod.def.shape};return FC(this,`shape`,n),n},catchall:t._zod.def.catchall,checks:[]})}function XC(e,t,n){let r=t._zod.def.shape,i={...r};if(n)for(let t in n){if(!(t in r))throw Error(`Unrecognized key: "${t}"`);n[t]&&(i[t]=e?new e({type:`optional`,innerType:r[t]}):r[t])}else for(let t in r)i[t]=e?new e({type:`optional`,innerType:r[t]}):r[t];return UC(t,{...t._zod.def,shape:i,checks:[]})}function ZC(e,t,n){let r=t._zod.def.shape,i={...r};if(n)for(let t in n){if(!(t in i))throw Error(`Unrecognized key: "${t}"`);n[t]&&(i[t]=new e({type:`nonoptional`,innerType:r[t]}))}else for(let t in r)i[t]=new e({type:`nonoptional`,innerType:r[t]});return UC(t,{...t._zod.def,shape:i,checks:[]})}function QC(e,t=0){for(let n=t;n{var n;return(n=t).path??(n.path=[]),t.path.unshift(e),t})}function ew(e){return typeof e==`string`?e:e?.message}function tw(e,t,n){let r={...e,path:e.path??[]};return e.message||(r.message=ew(e.inst?._zod.def?.error?.(e))??ew(t?.error?.(e))??ew(n.customError?.(e))??ew(n.localeError?.(e))??`Invalid input`),delete r.inst,delete r.continue,t?.reportInput||delete r.input,r}function nw(e){return Array.isArray(e)?`array`:typeof e==`string`?`string`:`unknown`}function rw(...e){let[t,n,r]=e;return typeof t==`string`?{message:t,code:`custom`,input:n,inst:r}:{...t}}var iw=(e,t)=>{e.name=`$ZodError`,Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),Object.defineProperty(e,"message",{get(){return JSON.stringify(t,AC,2)},enumerable:!0}),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},aw=Q(`$ZodError`,iw),ow=Q(`$ZodError`,iw,{Parent:Error});function sw(e,t=e=>e.message){let n={},r=[];for(let i of e.issues)i.path.length>0?(n[i.path[0]]=n[i.path[0]]||[],n[i.path[0]].push(t(i))):r.push(t(i));return{formErrors:r,fieldErrors:n}}function cw(e,t){let n=t||function(e){return e.message},r={_errors:[]},i=e=>{for(let t of e.issues)if(t.code===`invalid_union`&&t.errors.length)t.errors.map(e=>i({issues:e}));else if(t.code===`invalid_key`)i({issues:t.issues});else if(t.code===`invalid_element`)i({issues:t.issues});else if(t.path.length===0)r._errors.push(n(t));else{let e=r,i=0;for(;i(t,n,r,i)=>{let a=r?Object.assign(r,{async:!1}):{async:!1},o=t._zod.run({value:n,issues:[]},a);if(o instanceof Promise)throw new EC;if(o.issues.length){let t=new((i?.Err)??e)(o.issues.map(e=>tw(e,a,OC())));throw LC(t,i?.callee),t}return o.value},uw=e=>async(t,n,r,i)=>{let a=r?Object.assign(r,{async:!0}):{async:!0},o=t._zod.run({value:n,issues:[]},a);if(o instanceof Promise&&(o=await o),o.issues.length){let t=new((i?.Err)??e)(o.issues.map(e=>tw(e,a,OC())));throw LC(t,i?.callee),t}return o.value},dw=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 EC;return a.issues.length?{success:!1,error:new(e??aw)(a.issues.map(e=>tw(e,i,OC())))}:{success:!0,data:a.value}},fw=dw(ow),pw=e=>async(t,n,r)=>{let i=r?Object.assign(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=>tw(e,i,OC())))}:{success:!0,data:a.value}},mw=pw(ow),hw=Q(`$ZodCheck`,(e,t)=>{var n;e._zod??={},e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),gw=Q(`$ZodCheckMaxLength`,(e,t)=>{var n;hw.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return!MC(t)&&t.length!==void 0}),e._zod.onattach.push(e=>{let n=e._zod.bag.maximum??1/0;t.maximum{let r=n.value;if(r.length<=t.maximum)return;let i=nw(r);n.issues.push({origin:i,code:`too_big`,maximum:t.maximum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),_w=Q(`$ZodCheckMinLength`,(e,t)=>{var n;hw.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return!MC(t)&&t.length!==void 0}),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;if(r.length>=t.minimum)return;let i=nw(r);n.issues.push({origin:i,code:`too_small`,minimum:t.minimum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),vw=Q(`$ZodCheckLengthEquals`,(e,t)=>{var n;hw.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return!MC(t)&&t.length!==void 0}),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;if(i===t.length)return;let a=nw(r),o=i>t.length;n.issues.push({origin:a,...o?{code:`too_big`,maximum:t.length}:{code:`too_small`,minimum:t.length},inclusive:!0,exact:!0,input:n.value,inst:e,continue:!t.abort})}}),yw=Q(`$ZodCheckOverwrite`,(e,t)=>{hw.init(e,t),e._zod.check=e=>{e.value=t.tx(e.value)}}),bw=class{constructor(e=[]){this.content=[],this.indent=0,this&&(this.args=e)}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?.args,n=[...(this?.content??[``]).map(e=>` ${e}`)];return new e(...t,n.join(` -`))}},bw={major:4,minor:0,patch:0},xw=$(`$ZodType`,(e,t)=>{var n;e??={},e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=bw;let r=[...e._zod.def.checks??[]];e._zod.traits.has(`$ZodCheck`)&&r.unshift(e);for(let t of r)for(let n of t._zod.onattach)n(e);if(r.length===0)(n=e._zod).deferred??(n.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let t=(e,t,n)=>{let r=ZC(e),i;for(let a of t){if(a._zod.def.when){if(!a._zod.def.when(e))continue}else if(r)continue;let t=e.issues.length,o=a._zod.check(e);if(o instanceof Promise&&n?.async===!1)throw new TC;if(i||o instanceof Promise)i=(i??Promise.resolve()).then(async()=>{await o,e.issues.length!==t&&(r||=ZC(e,t))});else{if(e.issues.length===t)continue;r||=ZC(e,t)}}return i?i.then(()=>e):e};e._zod.run=(n,i)=>{let a=e._zod.parse(n,i);if(a instanceof Promise){if(i.async===!1)throw new TC;return a.then(e=>t(e,r,i))}return t(a,r,i)}}e[`~standard`]={validate:t=>{try{let n=dw(e,t);return n.success?{value:n.data}:{issues:n.error?.issues}}catch{return pw(e,t).then(e=>e.success?{value:e.data}:{issues:e.error?.issues})}},vendor:`zod`,version:1}}),Sw=$(`$ZodUnknown`,(e,t)=>{xw.init(e,t),e._zod.parse=e=>e}),Cw=$(`$ZodNever`,(e,t)=>{xw.init(e,t),e._zod.parse=(t,n)=>(t.issues.push({expected:`never`,code:`invalid_type`,input:t.value,inst:e}),t)});function ww(e,t,n){e.issues.length&&t.issues.push(...QC(n,e.issues)),t.value[n]=e.value}var Tw=$(`$ZodArray`,(e,t)=>{xw.init(e,t),e._zod.parse=(n,r)=>{let i=n.value;if(!Array.isArray(i))return n.issues.push({expected:`array`,code:`invalid_type`,input:i,inst:e}),n;n.value=Array(i.length);let a=[];for(let e=0;eww(t,n,e))):ww(s,n,e)}return a.length?Promise.all(a).then(()=>n):n}});function Ew(e,t,n){e.issues.length&&t.issues.push(...QC(n,e.issues)),t.value[n]=e.value}function Dw(e,t,n,r){e.issues.length?r[n]===void 0?n in r?t.value[n]=void 0:t.value[n]=e.value:t.issues.push(...QC(n,e.issues)):e.value===void 0?n in r&&(t.value[n]=void 0):t.value[n]=e.value}var Ow=$(`$ZodObject`,(e,t)=>{xw.init(e,t);let n=AC(()=>{let e=Object.keys(t.shape);for(let n of e)if(!(t.shape[n]instanceof xw))throw Error(`Invalid element at key "${n}": expected a Zod schema`);let n=WC(t.shape);return{shape:t.shape,keys:e,keySet:new Set(e),numKeys:e.length,optionalKeys:new Set(n)}});NC(e._zod,`propValues`,()=>{let e=t.shape,n={};for(let t in e){let r=e[t]._zod;if(r.values){n[t]??(n[t]=new Set);for(let e of r.values)n[t].add(e)}}return n});let r=e=>{let t=new yw([`shape`,`payload`,`ctx`]),r=n.value,i=e=>{let t=FC(e);return`shape[${t}]._zod.run({ value: input[${t}], issues: [] }, ctx)`};t.write(`const input = payload.value;`);let a=Object.create(null),o=0;for(let e of r.keys)a[e]=`key_${o++}`;t.write(`const newResult = {}`);for(let e of r.keys)if(r.optionalKeys.has(e)){let n=a[e];t.write(`const ${n} = ${i(e)};`);let r=FC(e);t.write(` +`))}},xw={major:4,minor:0,patch:0},Sw=Q(`$ZodType`,(e,t)=>{var n;e??={},e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=xw;let r=[...e._zod.def.checks??[]];e._zod.traits.has(`$ZodCheck`)&&r.unshift(e);for(let t of r)for(let n of t._zod.onattach)n(e);if(r.length===0)(n=e._zod).deferred??(n.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let t=(e,t,n)=>{let r=QC(e),i;for(let a of t){if(a._zod.def.when){if(!a._zod.def.when(e))continue}else if(r)continue;let t=e.issues.length,o=a._zod.check(e);if(o instanceof Promise&&n?.async===!1)throw new EC;if(i||o instanceof Promise)i=(i??Promise.resolve()).then(async()=>{await o,e.issues.length!==t&&(r||=QC(e,t))});else{if(e.issues.length===t)continue;r||=QC(e,t)}}return i?i.then(()=>e):e};e._zod.run=(n,i)=>{let a=e._zod.parse(n,i);if(a instanceof Promise){if(i.async===!1)throw new EC;return a.then(e=>t(e,r,i))}return t(a,r,i)}}e[`~standard`]={validate:t=>{try{let n=fw(e,t);return n.success?{value:n.data}:{issues:n.error?.issues}}catch{return mw(e,t).then(e=>e.success?{value:e.data}:{issues:e.error?.issues})}},vendor:`zod`,version:1}}),Cw=Q(`$ZodUnknown`,(e,t)=>{Sw.init(e,t),e._zod.parse=e=>e}),ww=Q(`$ZodNever`,(e,t)=>{Sw.init(e,t),e._zod.parse=(t,n)=>(t.issues.push({expected:`never`,code:`invalid_type`,input:t.value,inst:e}),t)});function Tw(e,t,n){e.issues.length&&t.issues.push(...$C(n,e.issues)),t.value[n]=e.value}var Ew=Q(`$ZodArray`,(e,t)=>{Sw.init(e,t),e._zod.parse=(n,r)=>{let i=n.value;if(!Array.isArray(i))return n.issues.push({expected:`array`,code:`invalid_type`,input:i,inst:e}),n;n.value=Array(i.length);let a=[];for(let e=0;eTw(t,n,e))):Tw(s,n,e)}return a.length?Promise.all(a).then(()=>n):n}});function Dw(e,t,n){e.issues.length&&t.issues.push(...$C(n,e.issues)),t.value[n]=e.value}function Ow(e,t,n,r){e.issues.length?r[n]===void 0?n in r?t.value[n]=void 0:t.value[n]=e.value:t.issues.push(...$C(n,e.issues)):e.value===void 0?n in r&&(t.value[n]=void 0):t.value[n]=e.value}var kw=Q(`$ZodObject`,(e,t)=>{Sw.init(e,t);let n=jC(()=>{let e=Object.keys(t.shape);for(let n of e)if(!(t.shape[n]instanceof Sw))throw Error(`Invalid element at key "${n}": expected a Zod schema`);let n=GC(t.shape);return{shape:t.shape,keys:e,keySet:new Set(e),numKeys:e.length,optionalKeys:new Set(n)}});PC(e._zod,`propValues`,()=>{let e=t.shape,n={};for(let t in e){let r=e[t]._zod;if(r.values){n[t]??(n[t]=new Set);for(let e of r.values)n[t].add(e)}}return n});let r=e=>{let t=new bw([`shape`,`payload`,`ctx`]),r=n.value,i=e=>{let t=IC(e);return`shape[${t}]._zod.run({ value: input[${t}], issues: [] }, ctx)`};t.write(`const input = payload.value;`);let a=Object.create(null),o=0;for(let e of r.keys)a[e]=`key_${o++}`;t.write(`const newResult = {}`);for(let e of r.keys)if(r.optionalKeys.has(e)){let n=a[e];t.write(`const ${n} = ${i(e)};`);let r=IC(e);t.write(` if (${n}.issues.length) { if (input[${r}] === undefined) { if (${r} in input) { @@ -90,8 +90,8 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs. `)}else{let n=a[e];t.write(`const ${n} = ${i(e)};`),t.write(` if (${n}.issues.length) payload.issues = payload.issues.concat(${n}.issues.map(iss => ({ ...iss, - path: iss.path ? [${FC(e)}, ...iss.path] : [${FC(e)}] - })));`),t.write(`newResult[${FC(e)}] = ${n}.value`)}t.write(`payload.value = newResult;`),t.write(`return payload;`);let s=t.compile();return(t,n)=>s(e,t,n)},i,a=LC,o=!EC.jitless,s=o&&RC.value,c=t.catchall,l;e._zod.parse=(u,d)=>{l??=n.value;let f=u.value;if(!a(f))return u.issues.push({expected:`object`,code:`invalid_type`,input:f,inst:e}),u;let p=[];if(o&&s&&d?.async===!1&&d.jitless!==!0)i||=r(t.shape),u=i(u,d);else{u.value={};let e=l.shape;for(let t of l.keys){let n=e[t],r=n._zod.run({value:f[t],issues:[]},d),i=n._zod.optin===`optional`&&n._zod.optout===`optional`;r instanceof Promise?p.push(r.then(e=>i?Dw(e,u,t,f):Ew(e,u,t))):i?Dw(r,u,t,f):Ew(r,u,t)}}if(!c)return p.length?Promise.all(p).then(()=>u):u;let m=[],h=l.keySet,g=c._zod,_=g.def.type;for(let e of Object.keys(f)){if(h.has(e))continue;if(_===`never`){m.push(e);continue}let t=g.run({value:f[e],issues:[]},d);t instanceof Promise?p.push(t.then(t=>Ew(t,u,e))):Ew(t,u,e)}return m.length&&u.issues.push({code:`unrecognized_keys`,keys:m,input:f,inst:e}),p.length?Promise.all(p).then(()=>u):u}});function kw(e,t,n,r){for(let n of e)if(n.issues.length===0)return t.value=n.value,t;return t.issues.push({code:`invalid_union`,input:t.value,inst:n,errors:e.map(e=>e.issues.map(e=>ew(e,r,DC())))}),t}var Aw=$(`$ZodUnion`,(e,t)=>{xw.init(e,t),NC(e._zod,`optin`,()=>t.options.some(e=>e._zod.optin===`optional`)?`optional`:void 0),NC(e._zod,`optout`,()=>t.options.some(e=>e._zod.optout===`optional`)?`optional`:void 0),NC(e._zod,`values`,()=>{if(t.options.every(e=>e._zod.values))return new Set(t.options.flatMap(e=>Array.from(e._zod.values)))}),NC(e._zod,`pattern`,()=>{if(t.options.every(e=>e._zod.pattern)){let e=t.options.map(e=>e._zod.pattern);return RegExp(`^(${e.map(e=>MC(e.source)).join(`|`)})$`)}}),e._zod.parse=(n,r)=>{let i=!1,a=[];for(let e of t.options){let t=e._zod.run({value:n.value,issues:[]},r);if(t instanceof Promise)a.push(t),i=!0;else{if(t.issues.length===0)return t;a.push(t)}}return i?Promise.all(a).then(t=>kw(t,n,e,r)):kw(a,n,e,r)}}),jw=$(`$ZodIntersection`,(e,t)=>{xw.init(e,t),e._zod.parse=(e,n)=>{let r=e.value,i=t.left._zod.run({value:r,issues:[]},n),a=t.right._zod.run({value:r,issues:[]},n);return i instanceof Promise||a instanceof Promise?Promise.all([i,a]).then(([t,n])=>Nw(e,t,n)):Nw(e,i,a)}});function Mw(e,t){if(e===t||e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(zC(e)&&zC(t)){let n=Object.keys(t),r=Object.keys(e).filter(e=>n.indexOf(e)!==-1),i={...e,...t};for(let n of r){let r=Mw(e[n],t[n]);if(!r.valid)return{valid:!1,mergeErrorPath:[n,...r.mergeErrorPath]};i[n]=r.data}return{valid:!0,data:i}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};let n=[];for(let r=0;r{xw.init(e,t),e._zod.parse=(n,r)=>{let i=n.value;if(!zC(i))return n.issues.push({expected:`record`,code:`invalid_type`,input:i,inst:e}),n;let a=[];if(t.keyType._zod.values){let o=t.keyType._zod.values;n.value={};for(let e of o)if(typeof e==`string`||typeof e==`number`||typeof e==`symbol`){let o=t.valueType._zod.run({value:i[e],issues:[]},r);o instanceof Promise?a.push(o.then(t=>{t.issues.length&&n.issues.push(...QC(e,t.issues)),n.value[e]=t.value})):(o.issues.length&&n.issues.push(...QC(e,o.issues)),n.value[e]=o.value)}let s;for(let e in i)o.has(e)||(s??=[],s.push(e));s&&s.length>0&&n.issues.push({code:`unrecognized_keys`,input:i,inst:e,keys:s})}else{n.value={};for(let o of Reflect.ownKeys(i)){if(o===`__proto__`)continue;let s=t.keyType._zod.run({value:o,issues:[]},r);if(s instanceof Promise)throw Error(`Async schemas not supported in object keys currently`);if(s.issues.length){n.issues.push({origin:`record`,code:`invalid_key`,issues:s.issues.map(e=>ew(e,r,DC())),input:o,path:[o],inst:e}),n.value[s.value]=s.value;continue}let c=t.valueType._zod.run({value:i[o],issues:[]},r);c instanceof Promise?a.push(c.then(e=>{e.issues.length&&n.issues.push(...QC(o,e.issues)),n.value[s.value]=e.value})):(c.issues.length&&n.issues.push(...QC(o,c.issues)),n.value[s.value]=c.value)}}return a.length?Promise.all(a).then(()=>n):n}}),Fw=$(`$ZodEnum`,(e,t)=>{xw.init(e,t);let n=OC(t.entries);e._zod.values=new Set(n),e._zod.pattern=RegExp(`^(${n.filter(e=>BC.has(typeof e)).map(e=>typeof e==`string`?VC(e):e.toString()).join(`|`)})$`),e._zod.parse=(t,r)=>{let i=t.value;return e._zod.values.has(i)||t.issues.push({code:`invalid_value`,values:n,input:i,inst:e}),t}}),Iw=$(`$ZodLiteral`,(e,t)=>{xw.init(e,t),e._zod.values=new Set(t.values),e._zod.pattern=RegExp(`^(${t.values.map(e=>typeof e==`string`?VC(e):e?e.toString():String(e)).join(`|`)})$`),e._zod.parse=(n,r)=>{let i=n.value;return e._zod.values.has(i)||n.issues.push({code:`invalid_value`,values:t.values,input:i,inst:e}),n}}),Lw=$(`$ZodTransform`,(e,t)=>{xw.init(e,t),e._zod.parse=(e,n)=>{let r=t.transform(e.value,e);if(n.async)return(r instanceof Promise?r:Promise.resolve(r)).then(t=>(e.value=t,e));if(r instanceof Promise)throw new TC;return e.value=r,e}}),Rw=$(`$ZodOptional`,(e,t)=>{xw.init(e,t),e._zod.optin=`optional`,e._zod.optout=`optional`,NC(e._zod,`values`,()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),NC(e._zod,`pattern`,()=>{let e=t.innerType._zod.pattern;return e?RegExp(`^(${MC(e.source)})?$`):void 0}),e._zod.parse=(e,n)=>t.innerType._zod.optin===`optional`?t.innerType._zod.run(e,n):e.value===void 0?e:t.innerType._zod.run(e,n)}),zw=$(`$ZodNullable`,(e,t)=>{xw.init(e,t),NC(e._zod,`optin`,()=>t.innerType._zod.optin),NC(e._zod,`optout`,()=>t.innerType._zod.optout),NC(e._zod,`pattern`,()=>{let e=t.innerType._zod.pattern;return e?RegExp(`^(${MC(e.source)}|null)$`):void 0}),NC(e._zod,`values`,()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(e,n)=>e.value===null?e:t.innerType._zod.run(e,n)}),Bw=$(`$ZodDefault`,(e,t)=>{xw.init(e,t),e._zod.optin=`optional`,NC(e._zod,`values`,()=>t.innerType._zod.values),e._zod.parse=(e,n)=>{if(e.value===void 0)return e.value=t.defaultValue,e;let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(e=>Vw(e,t)):Vw(r,t)}});function Vw(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}var Hw=$(`$ZodPrefault`,(e,t)=>{xw.init(e,t),e._zod.optin=`optional`,NC(e._zod,`values`,()=>t.innerType._zod.values),e._zod.parse=(e,n)=>(e.value===void 0&&(e.value=t.defaultValue),t.innerType._zod.run(e,n))}),Uw=$(`$ZodNonOptional`,(e,t)=>{xw.init(e,t),NC(e._zod,`values`,()=>{let e=t.innerType._zod.values;return e?new Set([...e].filter(e=>e!==void 0)):void 0}),e._zod.parse=(n,r)=>{let i=t.innerType._zod.run(n,r);return i instanceof Promise?i.then(t=>Ww(t,e)):Ww(i,e)}});function Ww(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:`invalid_type`,expected:`nonoptional`,input:e.value,inst:t}),e}var Gw=$(`$ZodCatch`,(e,t)=>{xw.init(e,t),e._zod.optin=`optional`,NC(e._zod,`optout`,()=>t.innerType._zod.optout),NC(e._zod,`values`,()=>t.innerType._zod.values),e._zod.parse=(e,n)=>{let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(r=>(e.value=r.value,r.issues.length&&(e.value=t.catchValue({...e,error:{issues:r.issues.map(e=>ew(e,n,DC()))},input:e.value}),e.issues=[]),e)):(e.value=r.value,r.issues.length&&(e.value=t.catchValue({...e,error:{issues:r.issues.map(e=>ew(e,n,DC()))},input:e.value}),e.issues=[]),e)}}),Kw=$(`$ZodPipe`,(e,t)=>{xw.init(e,t),NC(e._zod,`values`,()=>t.in._zod.values),NC(e._zod,`optin`,()=>t.in._zod.optin),NC(e._zod,`optout`,()=>t.out._zod.optout),e._zod.parse=(e,n)=>{let r=t.in._zod.run(e,n);return r instanceof Promise?r.then(e=>qw(e,t,n)):qw(r,t,n)}});function qw(e,t,n){return ZC(e)?e:t.out._zod.run({value:e.value,issues:e.issues},n)}var Jw=$(`$ZodReadonly`,(e,t)=>{xw.init(e,t),NC(e._zod,`propValues`,()=>t.innerType._zod.propValues),NC(e._zod,`values`,()=>t.innerType._zod.values),NC(e._zod,`optin`,()=>t.innerType._zod.optin),NC(e._zod,`optout`,()=>t.innerType._zod.optout),e._zod.parse=(e,n)=>{let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(Yw):Yw(r)}});function Yw(e){return e.value=Object.freeze(e.value),e}var Xw=$(`$ZodLazy`,(e,t)=>{xw.init(e,t),NC(e._zod,`innerType`,()=>t.getter()),NC(e._zod,`pattern`,()=>e._zod.innerType._zod.pattern),NC(e._zod,`propValues`,()=>e._zod.innerType._zod.propValues),NC(e._zod,`optin`,()=>e._zod.innerType._zod.optin),NC(e._zod,`optout`,()=>e._zod.innerType._zod.optout),e._zod.parse=(t,n)=>e._zod.innerType._zod.run(t,n)}),Zw=$(`$ZodCustom`,(e,t)=>{mw.init(e,t),xw.init(e,t),e._zod.parse=(e,t)=>e,e._zod.check=n=>{let r=n.value,i=t.fn(r);if(i instanceof Promise)return i.then(t=>Qw(t,n,r,e));Qw(i,n,r,e)}});function Qw(e,t,n,r){if(!e){let e={code:`custom`,input:n,inst:r,path:[...r._zod.def.path??[]],continue:!r._zod.def.abort};r._zod.def.params&&(e.params=r._zod.def.params),t.issues.push(nw(e))}}var $w=class{constructor(){this._map=new Map,this._idmap=new Map}add(e,...t){let n=t[0];if(this._map.set(e,n),n&&typeof n==`object`&&`id`in n){if(this._idmap.has(n.id))throw Error(`ID ${n.id} already exists in the registry`);this._idmap.set(n.id,e)}return this}clear(){return this._map=new Map,this._idmap=new Map,this}remove(e){let t=this._map.get(e);return t&&typeof t==`object`&&`id`in t&&this._idmap.delete(t.id),this._map.delete(e),this}get(e){let t=e._zod.parent;if(t){let n={...this.get(t)??{}};return delete n.id,{...n,...this._map.get(e)}}return this._map.get(e)}has(e){return this._map.has(e)}};function eT(){return new $w}var tT=eT();function nT(e){return new e({type:`unknown`})}function rT(e,t){return new e({type:`never`,...UC(t)})}function iT(e,t){return new hw({check:`max_length`,...UC(t),maximum:e})}function aT(e,t){return new gw({check:`min_length`,...UC(t),minimum:e})}function oT(e,t){return new _w({check:`length_equals`,...UC(t),length:e})}function sT(e){return new vw({check:`overwrite`,tx:e})}function cT(e,t,n){return new e({type:`array`,element:t,...UC(n)})}function lT(e,t,n){return new e({type:`custom`,check:`custom`,fn:t,...UC(n)})}var uT=(e,t)=>{iw.init(e,t),e.name=`ZodError`,Object.defineProperties(e,{format:{value:t=>sw(e,t)},flatten:{value:t=>ow(e,t)},addIssue:{value:t=>e.issues.push(t)},addIssues:{value:t=>e.issues.push(...t)},isEmpty:{get(){return e.issues.length===0}}})};$(`ZodError`,uT);var dT=$(`ZodError`,uT,{Parent:Error}),fT=cw(dT),pT=lw(dT),mT=uw(dT),hT=fw(dT),gT=$(`ZodType`,(e,t)=>(xw.init(e,t),e.def=t,Object.defineProperty(e,"_def",{value:t}),e.check=(...n)=>e.clone({...t,checks:[...t.checks??[],...n.map(e=>typeof e==`function`?{_zod:{check:e,def:{check:`custom`},onattach:[]}}:e)]}),e.clone=(t,n)=>HC(e,t,n),e.brand=()=>e,e.register=((t,n)=>(t.add(e,n),e)),e.parse=(t,n)=>fT(e,t,n,{callee:e.parse}),e.safeParse=(t,n)=>mT(e,t,n),e.parseAsync=async(t,n)=>pT(e,t,n,{callee:e.parseAsync}),e.safeParseAsync=async(t,n)=>hT(e,t,n),e.spa=e.safeParseAsync,e.refine=(t,n)=>e.check($T(t,n)),e.superRefine=t=>e.check(eE(t)),e.overwrite=t=>e.check(sT(t)),e.optional=()=>FT(e),e.nullable=()=>LT(e),e.nullish=()=>FT(LT(e)),e.nonoptional=t=>UT(e,t),e.array=()=>ST(e),e.or=t=>TT([e,t]),e.and=t=>DT(e,t),e.transform=t=>qT(e,NT(t)),e.default=t=>zT(e,t),e.prefault=t=>VT(e,t),e.catch=t=>GT(e,t),e.pipe=t=>qT(e,t),e.readonly=()=>YT(e),e.describe=t=>{let n=e.clone();return tT.add(n,{description:t}),n},Object.defineProperty(e,"description",{get(){return tT.get(e)?.description},configurable:!0}),e.meta=(...t)=>{if(t.length===0)return tT.get(e);let n=e.clone();return tT.add(n,t[0]),n},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e)),_T=$(`ZodUnknown`,(e,t)=>{Sw.init(e,t),gT.init(e,t)});function vT(){return nT(_T)}var yT=$(`ZodNever`,(e,t)=>{Cw.init(e,t),gT.init(e,t)});function bT(e){return rT(yT,e)}var xT=$(`ZodArray`,(e,t)=>{Tw.init(e,t),gT.init(e,t),e.element=t.element,e.min=(t,n)=>e.check(aT(t,n)),e.nonempty=t=>e.check(aT(1,t)),e.max=(t,n)=>e.check(iT(t,n)),e.length=(t,n)=>e.check(oT(t,n)),e.unwrap=()=>e.element});function ST(e,t){return cT(xT,e,t)}var CT=$(`ZodObject`,(e,t)=>{Ow.init(e,t),gT.init(e,t),NC(e,`shape`,()=>t.shape),e.keyof=()=>AT(Object.keys(e._zod.def.shape)),e.catchall=t=>e.clone({...e._zod.def,catchall:t}),e.passthrough=()=>e.clone({...e._zod.def,catchall:vT()}),e.loose=()=>e.clone({...e._zod.def,catchall:vT()}),e.strict=()=>e.clone({...e._zod.def,catchall:bT()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=t=>qC(e,t),e.merge=t=>JC(e,t),e.pick=t=>GC(e,t),e.omit=t=>KC(e,t),e.partial=(...t)=>YC(PT,e,t[0]),e.required=(...t)=>XC(HT,e,t[0])}),wT=$(`ZodUnion`,(e,t)=>{Aw.init(e,t),gT.init(e,t),e.options=t.options});function TT(e,t){return new wT({type:`union`,options:e,...UC(t)})}var ET=$(`ZodIntersection`,(e,t)=>{jw.init(e,t),gT.init(e,t)});function DT(e,t){return new ET({type:`intersection`,left:e,right:t})}var OT=$(`ZodRecord`,(e,t)=>{Pw.init(e,t),gT.init(e,t),e.keyType=t.keyType,e.valueType=t.valueType}),kT=$(`ZodEnum`,(e,t)=>{Fw.init(e,t),gT.init(e,t),e.enum=t.entries,e.options=Object.values(t.entries);let n=new Set(Object.keys(t.entries));e.extract=(e,r)=>{let i={};for(let r of e)if(n.has(r))i[r]=t.entries[r];else throw Error(`Key ${r} not found in enum`);return new kT({...t,checks:[],...UC(r),entries:i})},e.exclude=(e,r)=>{let i={...t.entries};for(let t of e)if(n.has(t))delete i[t];else throw Error(`Key ${t} not found in enum`);return new kT({...t,checks:[],...UC(r),entries:i})}});function AT(e,t){return new kT({type:`enum`,entries:Array.isArray(e)?Object.fromEntries(e.map(e=>[e,e])):e,...UC(t)})}var jT=$(`ZodLiteral`,(e,t)=>{Iw.init(e,t),gT.init(e,t),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})}),MT=$(`ZodTransform`,(e,t)=>{Lw.init(e,t),gT.init(e,t),e._zod.parse=(n,r)=>{n.addIssue=r=>{if(typeof r==`string`)n.issues.push(nw(r,n.value,t));else{let t=r;t.fatal&&(t.continue=!1),t.code??=`custom`,t.input??=n.value,t.inst??=e,t.continue??=!0,n.issues.push(nw(t))}};let i=t.transform(n.value,n);return i instanceof Promise?i.then(e=>(n.value=e,n)):(n.value=i,n)}});function NT(e){return new MT({type:`transform`,transform:e})}var PT=$(`ZodOptional`,(e,t)=>{Rw.init(e,t),gT.init(e,t),e.unwrap=()=>e._zod.def.innerType});function FT(e){return new PT({type:`optional`,innerType:e})}var IT=$(`ZodNullable`,(e,t)=>{zw.init(e,t),gT.init(e,t),e.unwrap=()=>e._zod.def.innerType});function LT(e){return new IT({type:`nullable`,innerType:e})}var RT=$(`ZodDefault`,(e,t)=>{Bw.init(e,t),gT.init(e,t),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function zT(e,t){return new RT({type:`default`,innerType:e,get defaultValue(){return typeof t==`function`?t():t}})}var BT=$(`ZodPrefault`,(e,t)=>{Hw.init(e,t),gT.init(e,t),e.unwrap=()=>e._zod.def.innerType});function VT(e,t){return new BT({type:`prefault`,innerType:e,get defaultValue(){return typeof t==`function`?t():t}})}var HT=$(`ZodNonOptional`,(e,t)=>{Uw.init(e,t),gT.init(e,t),e.unwrap=()=>e._zod.def.innerType});function UT(e,t){return new HT({type:`nonoptional`,innerType:e,...UC(t)})}var WT=$(`ZodCatch`,(e,t)=>{Gw.init(e,t),gT.init(e,t),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function GT(e,t){return new WT({type:`catch`,innerType:e,catchValue:typeof t==`function`?t:()=>t})}var KT=$(`ZodPipe`,(e,t)=>{Kw.init(e,t),gT.init(e,t),e.in=t.in,e.out=t.out});function qT(e,t){return new KT({type:`pipe`,in:e,out:t})}var JT=$(`ZodReadonly`,(e,t)=>{Jw.init(e,t),gT.init(e,t)});function YT(e){return new JT({type:`readonly`,innerType:e})}var XT=$(`ZodLazy`,(e,t)=>{Xw.init(e,t),gT.init(e,t),e.unwrap=()=>e._zod.def.getter()}),ZT=$(`ZodCustom`,(e,t)=>{Zw.init(e,t),gT.init(e,t)});function QT(e){let t=new mw({check:`custom`});return t._zod.check=e,t}function $T(e,t={}){return lT(ZT,e,t)}function eE(e){let t=QT(n=>(n.addIssue=e=>{if(typeof e==`string`)n.issues.push(nw(e,n.value,t._zod.def));else{let r=e;r.fatal&&(r.continue=!1),r.code??=`custom`,r.input??=n.value,r.inst??=t,r.continue??=!t._zod.def.abort,n.issues.push(nw(r))}},e(n.value,n)));return t}var tE=`@ag-ui/client`;function nE(e){if(!e.metadata||!Object.prototype.hasOwnProperty.call(e.metadata,tE))return;let t=e.metadata?.[tE];if(!t||typeof t!=`object`||Array.isArray(t))return[];if(!Object.prototype.hasOwnProperty.call(t,`authoritativeActivityTypes`))return;let n=t.authoritativeActivityTypes;return n===null?null:Array.isArray(n)&&n.every(e=>typeof e==`string`)?n:[]}var rE=e=>{if(typeof structuredClone==`function`)return structuredClone(e);try{return JSON.parse(JSON.stringify(e))}catch{return Array.isArray(e)?[...e]:{...e}}};function iE(){return Po()}function aE(e){return e instanceof TypeError&&/read[- ]?only|not extensible|cannot add property|cannot delete property|can't be deleted|unable to delete property|object is frozen|is not writable/i.test(e.message)}function oE(e){if(Object.freeze(e),typeof e==`object`&&e)for(let t of Object.values(e))typeof t==`object`&&t&&!Object.isFrozen(t)&&oE(t);return e}var sE=524288;function cE(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 lE(e,t,n,r){let i=typeof process<`u`&&!0,a=i&&!!{}.VITEST_WORKER_ID,o=i&&!!{}.VITEST_WORKER_ID,s=o&&!cE(t,n,sE),c=s?rE(t):t,l=s?rE(n):n,u=!1,d=!1,f;for(let t of e)try{s&&(oE(c),oE(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=rE(e.messages),u=!0,n=!0),e.state!==void 0&&e.state!==l&&(l=rE(e.state),d=!0,n=!0),s&&n&&cE(c,l,sE)&&(s=!1),f=e.stopPropagation,f===!0)break}catch(e){if(a&&e instanceof TypeError)throw e;s&&o&&aE(e)?console.error(`AG-UI: Subscriber attempted to mutate frozen inputs in-place. Return mutations via AgentStateMutation instead of mutating directly.`,e):console.error(`Subscriber error:`,e);continue}return{...u?{messages:Object.isFrozen(c)?rE(c):c}:{},...d?{state:Object.isFrozen(l)?rE(l):l}:{},...f===void 0?{}:{stopPropagation:f}}}function uE(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 dE(e){if(e instanceof fE)return e;if(e===!0)return new fE(uE(!0))}var fE=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 pE(e){return e.enabled?new fE(e):void 0}function mE(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 hE(e,t){return!e||t.metadata===void 0?!1:(e.metadata=Bo(e.metadata,rE(t.metadata)),!0)}var gE=(e,t,n,r,i)=>{let a=dE(i),o=rE(n.messages),s=rE(e.state),c={},l=[],u=new Set,d=e=>{let t=e.outcome?.type===`success`?e.outcome.pendingToolCallIds:void 0;return t!==void 0&&t.length>0?[...t]:l.filter(e=>!u.has(e))},f=e=>{e.messages!==void 0&&(o=e.messages,c.messages=e.messages),e.state!==void 0&&(s=e.state,c.state=e.state)},p=()=>{let e=rE(c);return c={},e.messages!==void 0||e.state!==void 0?il(e):Tc};return t.pipe(hl(async t=>{let i=await lE(r,o,s,(r,i,a)=>r.onEvent?.({event:t,agent:n,input:e,messages:i,state:a}));if(f(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 p();switch(t.type){case A.TEXT_MESSAGE_START:{let i=await lE(r,o,s,(r,i,a)=>r.onTextMessageStartEvent?.({event:t,messages:i,state:a,agent:n,input:e}));if(f(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`),p();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=hE(s,t);(!a||c)&&f({messages:o})}return p()}case A.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}'`),p();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`),p();let l=await lE(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 f(l),l.stopPropagation!==!0&&(c.content=`${typeof c.content==`string`?c.content:``}${a}`,hE(c,t),f({messages:o})),p()}case A.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}'`),p();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`),p();let c=await lE(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 f(c),c.stopPropagation!==!0&&hE(a,t)&&f({messages:o}),await Promise.all(r.map(t=>{t.onNewMessage?.({message:a,messages:o,state:s,agent:n,input:e})})),p()}case A.TOOL_CALL_START:{let i=await lE(r,o,s,(r,i,a)=>r.onToolCallStartEvent?.({event:t,messages:i,state:a,agent:n,input:e}));if(f(i),i.stopPropagation!==!0){let{toolCallId:e,toolCallName:n,parentMessageId:r,subagentRunId:i}=t;l.includes(e)||l.push(e);let 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),(hE(a,t)||r)&&f({messages:o}),p()}let s=new Set(o.map(e=>e.id)),c=mE(o,r,e);!s.has(c.id)&&i!=null&&c.subagentRunId===void 0&&(c.subagentRunId=i),c.toolCalls??=[];let u={id:e,type:`function`,function:{name:n,arguments:``}};c.toolCalls.push(u),hE(u,t),f({messages:o})}return p()}case A.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}'`),p();let l=c.toolCalls?.find(e=>e.id===i);if(!l)return console.warn(`TOOL_CALL_ARGS: No tool call found with ID '${i}'`),p();let u=await lE(r,o,s,(r,i,a)=>{let o=l.function.arguments,s=l.function.name,c={};try{c=wl(o)}catch{}return r.onToolCallArgsEvent?.({event:t,messages:i,state:a,agent:n,input:e,toolCallBuffer:o,toolCallName:s,partialToolCallArgs:c})});return f(u),u.stopPropagation!==!0&&(l.function.arguments+=a,hE(l,t),f({messages:o})),p()}case A.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}'`),p();let c=a.toolCalls?.find(e=>e.id===i);if(!c)return console.warn(`TOOL_CALL_END: No tool call found with ID '${i}'`),p();let l=await lE(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 f(l),l.stopPropagation!==!0&&hE(c,t)&&f({messages:o}),await Promise.all(r.map(t=>{t.onNewToolCall?.({toolCall:c,messages:o,state:s,agent:n,input:e})})),p()}case A.TOOL_CALL_RESULT:{let i=await lE(r,o,s,(r,i,a)=>r.onToolCallResultEvent?.({event:t,messages:i,state:a,agent:n,input:e}));if(f(i),i.stopPropagation!==!0){let{messageId:i,toolCallId:a,content:c,role:l,subagentRunId:d}=t;u.add(a);let p={id:i,toolCallId:a,role:l||`tool`,content:c,...d!=null&&{subagentRunId:d}};hE(p,t);let m=o.findIndex(e=>e.role===`assistant`&&e.toolCalls?.some(e=>e.id===a));if(m===-1)o.push(p);else{let e=m+1;for(;e{t.onNewMessage?.({message:p,messages:o,state:s,agent:n,input:e})})),f({messages:o})}return p()}case A.STATE_SNAPSHOT:{let i=await lE(r,o,s,(r,i,a)=>r.onStateSnapshotEvent?.({event:t,messages:i,state:a,agent:n,input:e}));if(f(i),i.stopPropagation!==!0){let{snapshot:e}=t;s=e,f({state:s})}return p()}case A.STATE_DELTA:{let i=await lE(r,o,s,(r,i,a)=>r.onStateDeltaEvent?.({event:t,messages:i,state:a,agent:n,input:e}));if(f(i),i.stopPropagation!==!0){let{delta:e}=t;try{s=Cs.applyPatch(s,e,!0,!1).newDocument,f({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 p()}case A.MESSAGES_SNAPSHOT:{let i=await lE(r,o,s,(r,i,a)=>r.onMessagesSnapshotEvent?.({event:t,messages:i,state:a,agent:n,input:e}));if(f(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=nE(t),a=n.some(e=>e.role===`activity`),s=n.some(e=>e.role===`reasoning`),c=e=>e.role===`activity`&&(i?!i.includes(e.activityType):i!==null&&!a)||e.role===`reasoning`&&!s;o=o.filter(e=>r.has(e.id)||c(e)).map(e=>r.get(e.id)??e);let l=new Set(o.map(e=>e.id));for(let e of n)l.has(e.id)||o.push(e);f({messages:o})}return p()}case A.ACTIVITY_SNAPSHOT:{let i=t,a=o.findIndex(e=>e.id===i.messageId),c=a>=0?o[a]:void 0,l=c?.role===`activity`?c:void 0,u=i.replace??!0,d=await lE(r,o,s,(t,r,a)=>t.onActivitySnapshotEvent?.({event:i,messages:r,state:a,agent:n,input:e,activityMessage:l,existingMessage:c}));if(f(d),d.stopPropagation!==!0){let t={id:i.messageId,role:`activity`,activityType:i.activityType,content:rE(i.content),...i.subagentRunId!=null&&{subagentRunId:i.subagentRunId}},c,d;a===-1?(o.push(t),c=t,d=t):l?(u&&(o[a]={...l,activityType:i.activityType,content:rE(i.content),subagentRunId:i.subagentRunId},i.subagentRunId??delete o[a].subagentRunId),d=o[a]):u&&(o[a]=t,c=t,d=t),hE(d,i),f({messages:o}),c&&await Promise.all(r.map(t=>t.onNewMessage?.({message:c,messages:o,state:s,agent:n,input:e})))}return p()}case A.ACTIVITY_DELTA:{let i=t,a=o.findIndex(e=>e.id===i.messageId);if(a===-1)return p();let c=o[a];if(c.role!==`activity`)return console.warn(`ACTIVITY_DELTA: Message '${i.messageId}' is not an activity message`),p();let l=c,u=await lE(r,o,s,(t,r,a)=>t.onActivityDeltaEvent?.({event:i,messages:r,state:a,agent:n,input:e,activityMessage:l}));if(f(u),u.stopPropagation!==!0)try{hE(l,i)&&f({messages:o});let e=rE(l.content??{}),t=Cs.applyPatch(e,i.patch??[],!0,!1).newDocument;o[a]={...l,content:rE(t),activityType:i.activityType},f({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 p()}case A.RAW:return f(await lE(r,o,s,(r,i,a)=>r.onRawEvent?.({event:t,messages:i,state:a,agent:n,input:e}))),p();case A.CUSTOM:return f(await lE(r,o,s,(r,i,a)=>r.onCustomEvent?.({event:t,messages:i,state:a,agent:n,input:e}))),p();case A.RUN_STARTED:{let i=await lE(r,o,s,(r,i,a)=>r.onRunStartedEvent?.({event:t,messages:i,state:a,agent:n,input:e}));if(f(i),l=[],u=new Set,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)}f({messages:o})}}return p()}case A.RUN_FINISHED:{let i=t,a=i.outcome?.type===`interrupt`?{event:i,outcome:`interrupt`,interrupts:i.outcome.interrupts}:i.outcome?.type===`cancelled`?{event:i,outcome:`cancelled`}:{event:i,outcome:`success`,result:i.result,pendingToolCallIds:d(i)},c=await lE(r,o,s,(t,r,i)=>t.onRunFinishedEvent?.({...a,messages:r,state:i,agent:n,input:e}));return f(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}):[]),p()}case A.RUN_ERROR:return f(await lE(r,o,s,(r,i,a)=>r.onRunErrorEvent?.({event:t,messages:i,state:a,agent:n,input:e}))),p();case A.STEP_STARTED:return f(await lE(r,o,s,(r,i,a)=>r.onStepStartedEvent?.({event:t,messages:i,state:a,agent:n,input:e}))),p();case A.STEP_FINISHED:return f(await lE(r,o,s,(r,i,a)=>r.onStepFinishedEvent?.({event:t,messages:i,state:a,agent:n,input:e}))),p();case A.TEXT_MESSAGE_CHUNK:throw Error(`TEXT_MESSAGE_CHUNK must be transformed before being applied`);case A.TOOL_CALL_CHUNK:throw Error(`TOOL_CALL_CHUNK must be transformed before being applied`);case A.REASONING_START:return f(await lE(r,o,s,(r,i,a)=>r.onReasoningStartEvent?.({event:t,messages:i,state:a,agent:n,input:e}))),p();case A.REASONING_MESSAGE_START:{let i=await lE(r,o,s,(r,i,a)=>r.onReasoningMessageStartEvent?.({event:t,messages:i,state:a,agent:n,input:e}));if(f(i),i.stopPropagation!==!0){let{messageId:e,subagentRunId:n}=t,r=o.find(t=>t.id===e);if(r?.role===`activity`)return console.warn(`REASONING_MESSAGE_START: Message '${e}' is an activity message — message ids must be unique across activity and reasoning messages`),p();let i=r;if(!i){let t={id:e,role:`reasoning`,content:``,...n!=null&&{subagentRunId:n}};o.push(t),i=t}let a=hE(i,t);(!r||a)&&f({messages:o})}return p()}case A.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}'`),p();if(c.role===`activity`)return console.warn(`REASONING_MESSAGE_CONTENT: Message '${i}' is an activity message — message ids must be unique across activity and reasoning messages`),p();let l=await lE(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 f(l),l.stopPropagation!==!0&&(c.content=`${typeof c.content==`string`?c.content:``}${a}`,hE(c,t),f({messages:o})),p()}case A.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}'`),p();if(a.role===`activity`)return console.warn(`REASONING_MESSAGE_END: Message '${i}' is an activity message — message ids must be unique across activity and reasoning messages`),p();let c=await lE(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 f(c),c.stopPropagation!==!0&&hE(a,t)&&f({messages:o}),await Promise.all(r.map(t=>{t.onNewMessage?.({message:a,messages:o,state:s,agent:n,input:e})})),p()}case A.REASONING_MESSAGE_CHUNK:throw Error(`REASONING_MESSAGE_CHUNK must be transformed before being applied`);case A.REASONING_END:return f(await lE(r,o,s,(r,i,a)=>r.onReasoningEndEvent?.({event:t,messages:i,state:a,agent:n,input:e}))),p();case A.REASONING_ENCRYPTED_VALUE:{let{subtype:i,entityId:a,encryptedValue:l}=t,u=await lE(r,o,s,(r,i,a)=>r.onReasoningEncryptedValueEvent?.({event:t,messages:i,state:a,agent:n,input:e}));if(f(u),u.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=l,e=!0;break}}}else{let t=o.find(e=>e.id===a);t?.role!==`activity`&&t&&(t.encryptedValue=l,e=!0)}e&&(c.messages=o)}return p()}case A.SUBAGENT_STARTED:return f(await lE(r,o,s,(r,i,a)=>r.onSubagentStartedEvent?.({event:t,messages:i,state:a,agent:n,input:e}))),p();case A.SUBAGENT_FINISHED:return f(await lE(r,o,s,(r,i,a)=>r.onSubagentFinishedEvent?.({event:t,messages:i,state:a,agent:n,input:e}))),p();case A.SUBAGENT_ERROR:return f(await lE(r,o,s,(r,i,a)=>r.onSubagentErrorEvent?.({event:t,messages:i,state:a,agent:n,input:e}))),p()}return t.type,p()}),ul(),r.length>0?vl({}):e=>e)};function _E(e,t){typeof process<`u`&&{}.SUPPRESS_TRANSFORMATION_WARNINGS||console.warn(`[ag-ui][compat] Converting deprecated ${e} to ${t}. The old shape leaves the protocol after its shim window — see the repo-root DEPRECATIONS.md. Set SUPPRESS_TRANSFORMATION_WARNINGS=true to silence.`)}var vE=e=>t=>{let n=dE(e),r=new Set,i=new Set,a=new Set,o=new Set,s={message:new Map,toolCall:new Map,activity:new Map,reasoning:new Map},c=!1,l=!1,u=!1,d=new Map,f=e=>{let t=d.get(e);return t||(t=new Map,d.set(e,t)),t},p=()=>{for(let e of d.values())if(e.size>0)return!0;return!1},m=new Map,h=new Set,g=!1,_=!1,v=()=>{_=!1,r.clear(),i.clear(),a.clear(),o.clear(),s.message.clear(),s.toolCall.clear(),s.activity.clear(),s.reasoning.clear(),d.clear(),m.clear(),h.clear(),c=!1,l=!1,g=!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 j(`Cannot send a message (id '${e.id}') with 'subagentRunId: null'. The field is optional — omit it entirely.`);let n=e.role===`reasoning`?s.reasoning:e.role===`activity`?s.activity:s.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||!s.toolCall.has(n.id))&&s.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 j(`Cannot send '${e}': subagentRunId '${t}' does not match the ${r} '${i}' opener's subagent '${n.subagentRunId??`(the parent agent)`}'.`)};return t.pipe(ll(e=>{let t=e.type;if(n?.event(`VERIFY`,`Event:`,e,{type:e.type}),l&&t!==A.RUN_STARTED)return N(()=>new j(`Cannot send event type '${t}': The run has already errored with 'RUN_ERROR'. No further events can be sent.`));if(c&&t!==A.RUN_ERROR&&t!==A.RUN_STARTED)return N(()=>new j(`Cannot send event type '${t}': The run has already finished with 'RUN_FINISHED'. Start a new run with 'RUN_STARTED'.`));if(!u){if(u=!0,t!==A.RUN_STARTED&&t!==A.RUN_ERROR)return N(()=>new j(`First event must be 'RUN_STARTED'`))}else if(t===A.RUN_STARTED){if(g&&!c&&!l)return N(()=>new j(`Cannot send 'RUN_STARTED' while a run is still active. The previous run must be finished with 'RUN_FINISHED' before starting a new run.`));(c||l)&&v()}if(e.subagentRunId===null){_||(_=!0,_E(`subagentRunId: null`,`an absent field`));let{subagentRunId:t,...n}=e;e=n}if(t===A.SUBAGENT_STARTED||t===A.SUBAGENT_FINISHED||t===A.SUBAGENT_ERROR){let n=t===A.SUBAGENT_STARTED?[`description`,`parentSubagentRunId`,`parentToolCallId`,`parentMessageId`]:t===A.SUBAGENT_FINISHED?[`outcome`]:[`code`];for(let r of n)if(e[r]===null)return N(()=>new j(`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 N(()=>new j(`Cannot send '${t}' with outcome type '${String(r.type)}'. The outcome is either { type: "success" } or { type: "suspended" }.`));if(r&&r.interruptIds===null)return N(()=>new j(`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 N(()=>new j(`Cannot send '${t}' with a non-string entry in 'outcome.interruptIds'. Interrupt ids are strings.`))}if(t===A.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 N(()=>new j(`Cannot send 'RUN_FINISHED' with an interrupt (id '${e.id}') carrying 'subagentRunId: null'. The field is optional — omit it entirely.`))}}switch(t){case A.TEXT_MESSAGE_START:{let n=e.messageId;if(r.has(n))return N(()=>new j(`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=s.message.get(n);if(i){let r=b(t,e.subagentRunId,i,`message`,n);if(r)return N(()=>r)}return r.add(n),i||s.message.set(n,{subagentRunId:e.subagentRunId}),il(e)}case A.TEXT_MESSAGE_CONTENT:{let n=e.messageId;if(!r.has(n))return N(()=>new j(`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,s.message.get(n),`message`,n);return i?N(()=>i):il(e)}case A.TEXT_MESSAGE_END:{let n=e.messageId;if(!r.has(n))return N(()=>new j(`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,s.message.get(n),`message`,n);return i?N(()=>i):(r.delete(n),il(e))}case A.TOOL_CALL_START:{let n=e.toolCallId;if(i.has(n))return N(()=>new j(`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,o;if(r!==void 0){let e=s.message.get(r);if(e){if(a!==void 0&&a!==e.subagentRunId)return N(()=>new j(`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.`));o=e}}let c=s.toolCall.get(n);if(c){let e=b(t,a,c,`tool call`,n);if(e)return N(()=>e);if(a===void 0&&o&&o.subagentRunId!==c.subagentRunId)return N(()=>new j(`Cannot send 'TOOL_CALL_START': tool call '${n}' is owned by '${c.subagentRunId??`(the parent agent)`}' but its parent message '${r}' is owned by '${o.subagentRunId??`(the parent agent)`}'. A tool call belongs to the message that carries it.`))}return i.add(n),c||s.toolCall.set(n,a===void 0?o??{subagentRunId:void 0}:{subagentRunId:a}),il(e)}case A.TOOL_CALL_ARGS:{let n=e.toolCallId;if(!i.has(n))return N(()=>new j(`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,s.toolCall.get(n),`tool call`,n);return r?N(()=>r):il(e)}case A.TOOL_CALL_END:{let n=e.toolCallId;if(!i.has(n))return N(()=>new j(`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,s.toolCall.get(n),`tool call`,n);return r?N(()=>r):(i.delete(n),il(e))}case A.STEP_STARTED:{let t=e.stepName,n=e.subagentRunId;return f(n).has(t)?N(()=>new j(`Step "${t}" is already active for 'STEP_STARTED'${n===void 0?``:` in subagent '${n}'`}`)):(f(n).set(t,!0),il(e))}case A.STEP_FINISHED:{let t=e.stepName,n=e.subagentRunId;if(!f(n).has(t)){let e,r=!1;for(let[i,a]of d)if(i!==n&&a.has(t)){e=i,r=!0;break}return N(r?()=>new j(`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 j(`Cannot send 'STEP_FINISHED' for step "${t}" that was not started`))}return f(n).delete(t),il(e)}case A.ACTIVITY_SNAPSHOT:{let t=e.messageId;return(!s.activity.has(t)||e.replace!==!1)&&s.activity.set(t,{subagentRunId:e.subagentRunId}),il(e)}case A.TOOL_CALL_RESULT:{let t=e.messageId;return typeof t==`string`&&s.message.set(t,{subagentRunId:e.subagentRunId}),il(e)}case A.REASONING_START:case A.REASONING_MESSAGE_START:{let n=e.messageId,r=t===A.REASONING_START,i=r?a:o;if(i.has(n))return N(()=>new j(r?`Cannot send 'REASONING_START' event: A reasoning span with ID '${n}' is already in progress. Complete it with 'REASONING_END' first.`:`Cannot send 'REASONING_MESSAGE_START' event: A reasoning message with ID '${n}' is already in progress. Complete it with 'REASONING_MESSAGE_END' first.`));let c=s.reasoning.get(n);if(c){let r=b(t,e.subagentRunId,c,`reasoning message`,n);if(r)return N(()=>r)}return i.add(n),c||s.reasoning.set(n,{subagentRunId:e.subagentRunId}),il(e)}case A.REASONING_MESSAGE_CONTENT:case A.REASONING_MESSAGE_END:case A.REASONING_END:{let n=e.messageId,r=t===A.REASONING_END,i=r?a:o;if(!i.has(n))return N(()=>new j(r?`Cannot send 'REASONING_END' event: No active reasoning span found with ID '${n}'. A 'REASONING_START' event must be sent first.`:`Cannot send '${t}' event: No active reasoning message found with ID '${n}'. Start a reasoning message with 'REASONING_MESSAGE_START' first.`));let c=b(t,e.subagentRunId,s.reasoning.get(n),`reasoning message`,n);return c?N(()=>c):((t===A.REASONING_END||t===A.REASONING_MESSAGE_END)&&i.delete(n),il(e))}case A.REASONING_ENCRYPTED_VALUE:{let n=e.entityId,r=e.subtype,i=r===`tool-call`?s.toolCall.get(n):r===`message`?s.message.get(n)??s.reasoning.get(n):s.reasoning.get(n),a=r===`tool-call`?`tool call`:r===`message`?`message`:`reasoning message`,o=b(t,e.subagentRunId,i,a,n);return o?N(()=>o):il(e)}case A.ACTIVITY_DELTA:{let n=e.messageId,r=b(t,e.subagentRunId,s.activity.get(n),`activity`,n);return r?N(()=>r):il(e)}case A.SUBAGENT_STARTED:{if(typeof e.subagentRunId!=`string`)return N(()=>new j(`Cannot send 'SUBAGENT_STARTED' without a 'subagentRunId'.`));if(typeof e.name!=`string`)return N(()=>new j(`Cannot send 'SUBAGENT_STARTED' without a 'name'.`));let t=e.subagentRunId,n=e.parentSubagentRunId;return m.has(t)?N(()=>new j(`Cannot send 'SUBAGENT_STARTED': subagent '${t}' is already active. Finish it with 'SUBAGENT_FINISHED' first.`)):h.has(t)?N(()=>new j(`Cannot send 'SUBAGENT_STARTED': subagent '${t}' has already finished in this run. Subagent IDs are per-invocation and cannot be reused.`)):n!==void 0&&!m.has(n)&&!h.has(n)?N(()=>new j(`Cannot send 'SUBAGENT_STARTED': parentSubagentRunId '${n}' has not been started in this run.`)):(m.set(t,!0),il(e))}case A.SUBAGENT_FINISHED:case A.SUBAGENT_ERROR:{if(typeof e.subagentRunId!=`string`)return N(()=>new j(`Cannot send '${t}' without a 'subagentRunId'.`));if(t===A.SUBAGENT_ERROR&&typeof e.message!=`string`)return N(()=>new j(`Cannot send 'SUBAGENT_ERROR' without a 'message'.`));let n=e.subagentRunId;return m.has(n)?(m.delete(n),h.add(n),il(e)):N(()=>new j(`Cannot send '${t}': no active subagent found with ID '${n}'. A 'SUBAGENT_STARTED' event must be sent first.`))}case A.MESSAGES_SNAPSHOT:{let t=y(e.messages,!0);if(t)return N(()=>t)}return il(e);case A.RUN_STARTED:g=!0;{let t=y((e.input??{}).messages,!1);if(t)return N(()=>t)}return il(e);case A.RUN_FINISHED:if(p()){let e=[];for(let[t,n]of d)for(let r of n.keys())e.push(t===void 0?r:`${r} (subagent '${t}')`);let t=e.join(`, `);return N(()=>new j(`Cannot send 'RUN_FINISHED' while steps are still active: ${t}`))}if(r.size>0){let e=Array.from(r.keys()).join(`, `);return N(()=>new j(`Cannot send 'RUN_FINISHED' while text messages are still active: ${e}`))}if(o.size>0){let e=Array.from(o.keys()).join(`, `);return N(()=>new j(`Cannot send 'RUN_FINISHED' while reasoning messages are still active: ${e}`))}if(a.size>0){let e=Array.from(a.keys()).join(`, `);return N(()=>new j(`Cannot send 'RUN_FINISHED' while reasoning spans are still active: ${e}`))}if(i.size>0){let e=Array.from(i.keys()).join(`, `);return N(()=>new j(`Cannot send 'RUN_FINISHED' while tool calls are still active: ${e}`))}if(m.size>0){let e=Array.from(m.keys()).join(`, `);return N(()=>new j(`Cannot send 'RUN_FINISHED' while subagents are still active: ${e}`))}return c=!0,il(e);case A.RUN_ERROR:return l=!0,il(e);case A.CUSTOM:return il(e);default:return il(e)}}))},yE=function(e){return e.HEADERS=`headers`,e.DATA=`data`,e}({}),bE=e=>fl(()=>rl(e())).pipe(bl(e=>{if(!e.ok){let t=e.headers.get(`content-type`)||``;return rl(e.text()).pipe(ll(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,N(()=>i)}))}let t={type:yE.HEADERS,status:e.status,headers:e.headers},n=e.body?.getReader();return n?new fc(e=>{let r=!1;return e.next(t),(async()=>{try{for(;!e.closed;){let{done:t,value:i}=await n.read();if(t){r=!0;break}let a={type:yE.DATA,data:i};e.next(a)}e.complete()}catch(t){r=!0,e.error(t)}})(),()=>{r||n.cancel().catch(e=>{e?.name!==`AbortError`&&console.warn(`Failed to cancel HTTP response stream:`,e)})}}):N(()=>Error(`Failed to getReader() from response`))})),xE=10485760,SE=(e,t)=>{let n=dE(t),r=new xc,i=new TextDecoder(`utf-8`,{fatal:!1}),a=``;e.subscribe({next:e=>{if(e.type!==yE.HEADERS&&e.type===yE.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);if(a.length>xE){r.error(Error(`SSE buffer size exceeded maximum limit of ${xE/1048576} MB`));return}}},error:e=>r.error(e),complete:()=>{a&&(a+=i.decode(),o(a)),r.complete()}});function o(e){let t=e.split(` + path: iss.path ? [${IC(e)}, ...iss.path] : [${IC(e)}] + })));`),t.write(`newResult[${IC(e)}] = ${n}.value`)}t.write(`payload.value = newResult;`),t.write(`return payload;`);let s=t.compile();return(t,n)=>s(e,t,n)},i,a=RC,o=!DC.jitless,s=o&&zC.value,c=t.catchall,l;e._zod.parse=(u,d)=>{l??=n.value;let f=u.value;if(!a(f))return u.issues.push({expected:`object`,code:`invalid_type`,input:f,inst:e}),u;let p=[];if(o&&s&&d?.async===!1&&d.jitless!==!0)i||=r(t.shape),u=i(u,d);else{u.value={};let e=l.shape;for(let t of l.keys){let n=e[t],r=n._zod.run({value:f[t],issues:[]},d),i=n._zod.optin===`optional`&&n._zod.optout===`optional`;r instanceof Promise?p.push(r.then(e=>i?Ow(e,u,t,f):Dw(e,u,t))):i?Ow(r,u,t,f):Dw(r,u,t)}}if(!c)return p.length?Promise.all(p).then(()=>u):u;let m=[],h=l.keySet,g=c._zod,_=g.def.type;for(let e of Object.keys(f)){if(h.has(e))continue;if(_===`never`){m.push(e);continue}let t=g.run({value:f[e],issues:[]},d);t instanceof Promise?p.push(t.then(t=>Dw(t,u,e))):Dw(t,u,e)}return m.length&&u.issues.push({code:`unrecognized_keys`,keys:m,input:f,inst:e}),p.length?Promise.all(p).then(()=>u):u}});function Aw(e,t,n,r){for(let n of e)if(n.issues.length===0)return t.value=n.value,t;return t.issues.push({code:`invalid_union`,input:t.value,inst:n,errors:e.map(e=>e.issues.map(e=>tw(e,r,OC())))}),t}var jw=Q(`$ZodUnion`,(e,t)=>{Sw.init(e,t),PC(e._zod,`optin`,()=>t.options.some(e=>e._zod.optin===`optional`)?`optional`:void 0),PC(e._zod,`optout`,()=>t.options.some(e=>e._zod.optout===`optional`)?`optional`:void 0),PC(e._zod,`values`,()=>{if(t.options.every(e=>e._zod.values))return new Set(t.options.flatMap(e=>Array.from(e._zod.values)))}),PC(e._zod,`pattern`,()=>{if(t.options.every(e=>e._zod.pattern)){let e=t.options.map(e=>e._zod.pattern);return RegExp(`^(${e.map(e=>NC(e.source)).join(`|`)})$`)}}),e._zod.parse=(n,r)=>{let i=!1,a=[];for(let e of t.options){let t=e._zod.run({value:n.value,issues:[]},r);if(t instanceof Promise)a.push(t),i=!0;else{if(t.issues.length===0)return t;a.push(t)}}return i?Promise.all(a).then(t=>Aw(t,n,e,r)):Aw(a,n,e,r)}}),Mw=Q(`$ZodIntersection`,(e,t)=>{Sw.init(e,t),e._zod.parse=(e,n)=>{let r=e.value,i=t.left._zod.run({value:r,issues:[]},n),a=t.right._zod.run({value:r,issues:[]},n);return i instanceof Promise||a instanceof Promise?Promise.all([i,a]).then(([t,n])=>Pw(e,t,n)):Pw(e,i,a)}});function Nw(e,t){if(e===t||e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(BC(e)&&BC(t)){let n=Object.keys(t),r=Object.keys(e).filter(e=>n.indexOf(e)!==-1),i={...e,...t};for(let n of r){let r=Nw(e[n],t[n]);if(!r.valid)return{valid:!1,mergeErrorPath:[n,...r.mergeErrorPath]};i[n]=r.data}return{valid:!0,data:i}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};let n=[];for(let r=0;r{Sw.init(e,t),e._zod.parse=(n,r)=>{let i=n.value;if(!BC(i))return n.issues.push({expected:`record`,code:`invalid_type`,input:i,inst:e}),n;let a=[];if(t.keyType._zod.values){let o=t.keyType._zod.values;n.value={};for(let e of o)if(typeof e==`string`||typeof e==`number`||typeof e==`symbol`){let o=t.valueType._zod.run({value:i[e],issues:[]},r);o instanceof Promise?a.push(o.then(t=>{t.issues.length&&n.issues.push(...$C(e,t.issues)),n.value[e]=t.value})):(o.issues.length&&n.issues.push(...$C(e,o.issues)),n.value[e]=o.value)}let s;for(let e in i)o.has(e)||(s??=[],s.push(e));s&&s.length>0&&n.issues.push({code:`unrecognized_keys`,input:i,inst:e,keys:s})}else{n.value={};for(let o of Reflect.ownKeys(i)){if(o===`__proto__`)continue;let s=t.keyType._zod.run({value:o,issues:[]},r);if(s instanceof Promise)throw Error(`Async schemas not supported in object keys currently`);if(s.issues.length){n.issues.push({origin:`record`,code:`invalid_key`,issues:s.issues.map(e=>tw(e,r,OC())),input:o,path:[o],inst:e}),n.value[s.value]=s.value;continue}let c=t.valueType._zod.run({value:i[o],issues:[]},r);c instanceof Promise?a.push(c.then(e=>{e.issues.length&&n.issues.push(...$C(o,e.issues)),n.value[s.value]=e.value})):(c.issues.length&&n.issues.push(...$C(o,c.issues)),n.value[s.value]=c.value)}}return a.length?Promise.all(a).then(()=>n):n}}),Iw=Q(`$ZodEnum`,(e,t)=>{Sw.init(e,t);let n=kC(t.entries);e._zod.values=new Set(n),e._zod.pattern=RegExp(`^(${n.filter(e=>VC.has(typeof e)).map(e=>typeof e==`string`?HC(e):e.toString()).join(`|`)})$`),e._zod.parse=(t,r)=>{let i=t.value;return e._zod.values.has(i)||t.issues.push({code:`invalid_value`,values:n,input:i,inst:e}),t}}),Lw=Q(`$ZodLiteral`,(e,t)=>{Sw.init(e,t),e._zod.values=new Set(t.values),e._zod.pattern=RegExp(`^(${t.values.map(e=>typeof e==`string`?HC(e):e?e.toString():String(e)).join(`|`)})$`),e._zod.parse=(n,r)=>{let i=n.value;return e._zod.values.has(i)||n.issues.push({code:`invalid_value`,values:t.values,input:i,inst:e}),n}}),Rw=Q(`$ZodTransform`,(e,t)=>{Sw.init(e,t),e._zod.parse=(e,n)=>{let r=t.transform(e.value,e);if(n.async)return(r instanceof Promise?r:Promise.resolve(r)).then(t=>(e.value=t,e));if(r instanceof Promise)throw new EC;return e.value=r,e}}),zw=Q(`$ZodOptional`,(e,t)=>{Sw.init(e,t),e._zod.optin=`optional`,e._zod.optout=`optional`,PC(e._zod,`values`,()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),PC(e._zod,`pattern`,()=>{let e=t.innerType._zod.pattern;return e?RegExp(`^(${NC(e.source)})?$`):void 0}),e._zod.parse=(e,n)=>t.innerType._zod.optin===`optional`?t.innerType._zod.run(e,n):e.value===void 0?e:t.innerType._zod.run(e,n)}),Bw=Q(`$ZodNullable`,(e,t)=>{Sw.init(e,t),PC(e._zod,`optin`,()=>t.innerType._zod.optin),PC(e._zod,`optout`,()=>t.innerType._zod.optout),PC(e._zod,`pattern`,()=>{let e=t.innerType._zod.pattern;return e?RegExp(`^(${NC(e.source)}|null)$`):void 0}),PC(e._zod,`values`,()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(e,n)=>e.value===null?e:t.innerType._zod.run(e,n)}),Vw=Q(`$ZodDefault`,(e,t)=>{Sw.init(e,t),e._zod.optin=`optional`,PC(e._zod,`values`,()=>t.innerType._zod.values),e._zod.parse=(e,n)=>{if(e.value===void 0)return e.value=t.defaultValue,e;let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(e=>Hw(e,t)):Hw(r,t)}});function Hw(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}var Uw=Q(`$ZodPrefault`,(e,t)=>{Sw.init(e,t),e._zod.optin=`optional`,PC(e._zod,`values`,()=>t.innerType._zod.values),e._zod.parse=(e,n)=>(e.value===void 0&&(e.value=t.defaultValue),t.innerType._zod.run(e,n))}),Ww=Q(`$ZodNonOptional`,(e,t)=>{Sw.init(e,t),PC(e._zod,`values`,()=>{let e=t.innerType._zod.values;return e?new Set([...e].filter(e=>e!==void 0)):void 0}),e._zod.parse=(n,r)=>{let i=t.innerType._zod.run(n,r);return i instanceof Promise?i.then(t=>Gw(t,e)):Gw(i,e)}});function Gw(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:`invalid_type`,expected:`nonoptional`,input:e.value,inst:t}),e}var Kw=Q(`$ZodCatch`,(e,t)=>{Sw.init(e,t),e._zod.optin=`optional`,PC(e._zod,`optout`,()=>t.innerType._zod.optout),PC(e._zod,`values`,()=>t.innerType._zod.values),e._zod.parse=(e,n)=>{let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(r=>(e.value=r.value,r.issues.length&&(e.value=t.catchValue({...e,error:{issues:r.issues.map(e=>tw(e,n,OC()))},input:e.value}),e.issues=[]),e)):(e.value=r.value,r.issues.length&&(e.value=t.catchValue({...e,error:{issues:r.issues.map(e=>tw(e,n,OC()))},input:e.value}),e.issues=[]),e)}}),qw=Q(`$ZodPipe`,(e,t)=>{Sw.init(e,t),PC(e._zod,`values`,()=>t.in._zod.values),PC(e._zod,`optin`,()=>t.in._zod.optin),PC(e._zod,`optout`,()=>t.out._zod.optout),e._zod.parse=(e,n)=>{let r=t.in._zod.run(e,n);return r instanceof Promise?r.then(e=>Jw(e,t,n)):Jw(r,t,n)}});function Jw(e,t,n){return QC(e)?e:t.out._zod.run({value:e.value,issues:e.issues},n)}var Yw=Q(`$ZodReadonly`,(e,t)=>{Sw.init(e,t),PC(e._zod,`propValues`,()=>t.innerType._zod.propValues),PC(e._zod,`values`,()=>t.innerType._zod.values),PC(e._zod,`optin`,()=>t.innerType._zod.optin),PC(e._zod,`optout`,()=>t.innerType._zod.optout),e._zod.parse=(e,n)=>{let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(Xw):Xw(r)}});function Xw(e){return e.value=Object.freeze(e.value),e}var Zw=Q(`$ZodLazy`,(e,t)=>{Sw.init(e,t),PC(e._zod,`innerType`,()=>t.getter()),PC(e._zod,`pattern`,()=>e._zod.innerType._zod.pattern),PC(e._zod,`propValues`,()=>e._zod.innerType._zod.propValues),PC(e._zod,`optin`,()=>e._zod.innerType._zod.optin),PC(e._zod,`optout`,()=>e._zod.innerType._zod.optout),e._zod.parse=(t,n)=>e._zod.innerType._zod.run(t,n)}),Qw=Q(`$ZodCustom`,(e,t)=>{hw.init(e,t),Sw.init(e,t),e._zod.parse=(e,t)=>e,e._zod.check=n=>{let r=n.value,i=t.fn(r);if(i instanceof Promise)return i.then(t=>$w(t,n,r,e));$w(i,n,r,e)}});function $w(e,t,n,r){if(!e){let e={code:`custom`,input:n,inst:r,path:[...r._zod.def.path??[]],continue:!r._zod.def.abort};r._zod.def.params&&(e.params=r._zod.def.params),t.issues.push(rw(e))}}var eT=class{constructor(){this._map=new Map,this._idmap=new Map}add(e,...t){let n=t[0];if(this._map.set(e,n),n&&typeof n==`object`&&`id`in n){if(this._idmap.has(n.id))throw Error(`ID ${n.id} already exists in the registry`);this._idmap.set(n.id,e)}return this}clear(){return this._map=new Map,this._idmap=new Map,this}remove(e){let t=this._map.get(e);return t&&typeof t==`object`&&`id`in t&&this._idmap.delete(t.id),this._map.delete(e),this}get(e){let t=e._zod.parent;if(t){let n={...this.get(t)??{}};return delete n.id,{...n,...this._map.get(e)}}return this._map.get(e)}has(e){return this._map.has(e)}};function tT(){return new eT}var nT=tT();function rT(e){return new e({type:`unknown`})}function iT(e,t){return new e({type:`never`,...WC(t)})}function aT(e,t){return new gw({check:`max_length`,...WC(t),maximum:e})}function oT(e,t){return new _w({check:`min_length`,...WC(t),minimum:e})}function sT(e,t){return new vw({check:`length_equals`,...WC(t),length:e})}function cT(e){return new yw({check:`overwrite`,tx:e})}function lT(e,t,n){return new e({type:`array`,element:t,...WC(n)})}function uT(e,t,n){return new e({type:`custom`,check:`custom`,fn:t,...WC(n)})}var dT=(e,t)=>{aw.init(e,t),e.name=`ZodError`,Object.defineProperties(e,{format:{value:t=>cw(e,t)},flatten:{value:t=>sw(e,t)},addIssue:{value:t=>e.issues.push(t)},addIssues:{value:t=>e.issues.push(...t)},isEmpty:{get(){return e.issues.length===0}}})};Q(`ZodError`,dT);var fT=Q(`ZodError`,dT,{Parent:Error}),pT=lw(fT),mT=uw(fT),hT=dw(fT),gT=pw(fT),_T=Q(`ZodType`,(e,t)=>(Sw.init(e,t),e.def=t,Object.defineProperty(e,"_def",{value:t}),e.check=(...n)=>e.clone({...t,checks:[...t.checks??[],...n.map(e=>typeof e==`function`?{_zod:{check:e,def:{check:`custom`},onattach:[]}}:e)]}),e.clone=(t,n)=>UC(e,t,n),e.brand=()=>e,e.register=((t,n)=>(t.add(e,n),e)),e.parse=(t,n)=>pT(e,t,n,{callee:e.parse}),e.safeParse=(t,n)=>hT(e,t,n),e.parseAsync=async(t,n)=>mT(e,t,n,{callee:e.parseAsync}),e.safeParseAsync=async(t,n)=>gT(e,t,n),e.spa=e.safeParseAsync,e.refine=(t,n)=>e.check(eE(t,n)),e.superRefine=t=>e.check(tE(t)),e.overwrite=t=>e.check(cT(t)),e.optional=()=>IT(e),e.nullable=()=>RT(e),e.nullish=()=>IT(RT(e)),e.nonoptional=t=>WT(e,t),e.array=()=>CT(e),e.or=t=>ET([e,t]),e.and=t=>OT(e,t),e.transform=t=>JT(e,PT(t)),e.default=t=>BT(e,t),e.prefault=t=>HT(e,t),e.catch=t=>KT(e,t),e.pipe=t=>JT(e,t),e.readonly=()=>XT(e),e.describe=t=>{let n=e.clone();return nT.add(n,{description:t}),n},Object.defineProperty(e,"description",{get(){return nT.get(e)?.description},configurable:!0}),e.meta=(...t)=>{if(t.length===0)return nT.get(e);let n=e.clone();return nT.add(n,t[0]),n},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e)),vT=Q(`ZodUnknown`,(e,t)=>{Cw.init(e,t),_T.init(e,t)});function yT(){return rT(vT)}var bT=Q(`ZodNever`,(e,t)=>{ww.init(e,t),_T.init(e,t)});function xT(e){return iT(bT,e)}var ST=Q(`ZodArray`,(e,t)=>{Ew.init(e,t),_T.init(e,t),e.element=t.element,e.min=(t,n)=>e.check(oT(t,n)),e.nonempty=t=>e.check(oT(1,t)),e.max=(t,n)=>e.check(aT(t,n)),e.length=(t,n)=>e.check(sT(t,n)),e.unwrap=()=>e.element});function CT(e,t){return lT(ST,e,t)}var wT=Q(`ZodObject`,(e,t)=>{kw.init(e,t),_T.init(e,t),PC(e,`shape`,()=>t.shape),e.keyof=()=>jT(Object.keys(e._zod.def.shape)),e.catchall=t=>e.clone({...e._zod.def,catchall:t}),e.passthrough=()=>e.clone({...e._zod.def,catchall:yT()}),e.loose=()=>e.clone({...e._zod.def,catchall:yT()}),e.strict=()=>e.clone({...e._zod.def,catchall:xT()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=t=>JC(e,t),e.merge=t=>YC(e,t),e.pick=t=>KC(e,t),e.omit=t=>qC(e,t),e.partial=(...t)=>XC(FT,e,t[0]),e.required=(...t)=>ZC(UT,e,t[0])}),TT=Q(`ZodUnion`,(e,t)=>{jw.init(e,t),_T.init(e,t),e.options=t.options});function ET(e,t){return new TT({type:`union`,options:e,...WC(t)})}var DT=Q(`ZodIntersection`,(e,t)=>{Mw.init(e,t),_T.init(e,t)});function OT(e,t){return new DT({type:`intersection`,left:e,right:t})}var kT=Q(`ZodRecord`,(e,t)=>{Fw.init(e,t),_T.init(e,t),e.keyType=t.keyType,e.valueType=t.valueType}),AT=Q(`ZodEnum`,(e,t)=>{Iw.init(e,t),_T.init(e,t),e.enum=t.entries,e.options=Object.values(t.entries);let n=new Set(Object.keys(t.entries));e.extract=(e,r)=>{let i={};for(let r of e)if(n.has(r))i[r]=t.entries[r];else throw Error(`Key ${r} not found in enum`);return new AT({...t,checks:[],...WC(r),entries:i})},e.exclude=(e,r)=>{let i={...t.entries};for(let t of e)if(n.has(t))delete i[t];else throw Error(`Key ${t} not found in enum`);return new AT({...t,checks:[],...WC(r),entries:i})}});function jT(e,t){return new AT({type:`enum`,entries:Array.isArray(e)?Object.fromEntries(e.map(e=>[e,e])):e,...WC(t)})}var MT=Q(`ZodLiteral`,(e,t)=>{Lw.init(e,t),_T.init(e,t),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})}),NT=Q(`ZodTransform`,(e,t)=>{Rw.init(e,t),_T.init(e,t),e._zod.parse=(n,r)=>{n.addIssue=r=>{if(typeof r==`string`)n.issues.push(rw(r,n.value,t));else{let t=r;t.fatal&&(t.continue=!1),t.code??=`custom`,t.input??=n.value,t.inst??=e,t.continue??=!0,n.issues.push(rw(t))}};let i=t.transform(n.value,n);return i instanceof Promise?i.then(e=>(n.value=e,n)):(n.value=i,n)}});function PT(e){return new NT({type:`transform`,transform:e})}var FT=Q(`ZodOptional`,(e,t)=>{zw.init(e,t),_T.init(e,t),e.unwrap=()=>e._zod.def.innerType});function IT(e){return new FT({type:`optional`,innerType:e})}var LT=Q(`ZodNullable`,(e,t)=>{Bw.init(e,t),_T.init(e,t),e.unwrap=()=>e._zod.def.innerType});function RT(e){return new LT({type:`nullable`,innerType:e})}var zT=Q(`ZodDefault`,(e,t)=>{Vw.init(e,t),_T.init(e,t),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function BT(e,t){return new zT({type:`default`,innerType:e,get defaultValue(){return typeof t==`function`?t():t}})}var VT=Q(`ZodPrefault`,(e,t)=>{Uw.init(e,t),_T.init(e,t),e.unwrap=()=>e._zod.def.innerType});function HT(e,t){return new VT({type:`prefault`,innerType:e,get defaultValue(){return typeof t==`function`?t():t}})}var UT=Q(`ZodNonOptional`,(e,t)=>{Ww.init(e,t),_T.init(e,t),e.unwrap=()=>e._zod.def.innerType});function WT(e,t){return new UT({type:`nonoptional`,innerType:e,...WC(t)})}var GT=Q(`ZodCatch`,(e,t)=>{Kw.init(e,t),_T.init(e,t),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function KT(e,t){return new GT({type:`catch`,innerType:e,catchValue:typeof t==`function`?t:()=>t})}var qT=Q(`ZodPipe`,(e,t)=>{qw.init(e,t),_T.init(e,t),e.in=t.in,e.out=t.out});function JT(e,t){return new qT({type:`pipe`,in:e,out:t})}var YT=Q(`ZodReadonly`,(e,t)=>{Yw.init(e,t),_T.init(e,t)});function XT(e){return new YT({type:`readonly`,innerType:e})}var ZT=Q(`ZodLazy`,(e,t)=>{Zw.init(e,t),_T.init(e,t),e.unwrap=()=>e._zod.def.getter()}),QT=Q(`ZodCustom`,(e,t)=>{Qw.init(e,t),_T.init(e,t)});function $T(e){let t=new hw({check:`custom`});return t._zod.check=e,t}function eE(e,t={}){return uT(QT,e,t)}function tE(e){let t=$T(n=>(n.addIssue=e=>{if(typeof e==`string`)n.issues.push(rw(e,n.value,t._zod.def));else{let r=e;r.fatal&&(r.continue=!1),r.code??=`custom`,r.input??=n.value,r.inst??=t,r.continue??=!t._zod.def.abort,n.issues.push(rw(r))}},e(n.value,n)));return t}var nE=`@ag-ui/client`;function rE(e){if(!e.metadata||!Object.prototype.hasOwnProperty.call(e.metadata,nE))return;let t=e.metadata?.[nE];if(!t||typeof t!=`object`||Array.isArray(t))return[];if(!Object.prototype.hasOwnProperty.call(t,`authoritativeActivityTypes`))return;let n=t.authoritativeActivityTypes;return n===null?null:Array.isArray(n)&&n.every(e=>typeof e==`string`)?n:[]}var $=e=>{if(typeof structuredClone==`function`)return structuredClone(e);try{return JSON.parse(JSON.stringify(e))}catch{return Array.isArray(e)?[...e]:{...e}}};function iE(){return Po()}function aE(e){return e instanceof TypeError&&/read[- ]?only|not extensible|cannot add property|cannot delete property|can't be deleted|unable to delete property|object is frozen|is not writable/i.test(e.message)}function oE(e){if(Object.freeze(e),typeof e==`object`&&e)for(let t of Object.values(e))typeof t==`object`&&t&&!Object.isFrozen(t)&&oE(t);return e}var sE=524288;function cE(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 lE(e,t,n,r){let i=typeof process<`u`&&!0,a=i&&!!{}.VITEST_WORKER_ID,o=i&&!!{}.VITEST_WORKER_ID,s=o&&!cE(t,n,sE),c=s?$(t):t,l=s?$(n):n,u=!1,d=!1,f;for(let t of e)try{s&&(oE(c),oE(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=$(e.messages),u=!0,n=!0),e.state!==void 0&&e.state!==l&&(l=$(e.state),d=!0,n=!0),s&&n&&cE(c,l,sE)&&(s=!1),f=e.stopPropagation,f===!0)break}catch(e){if(a&&e instanceof TypeError)throw e;s&&o&&aE(e)?console.error(`AG-UI: Subscriber attempted to mutate frozen inputs in-place. Return mutations via AgentStateMutation instead of mutating directly.`,e):console.error(`Subscriber error:`,e);continue}return{...u?{messages:Object.isFrozen(c)?$(c):c}:{},...d?{state:Object.isFrozen(l)?$(l):l}:{},...f===void 0?{}:{stopPropagation:f}}}function uE(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 dE(e){if(e instanceof fE)return e;if(e===!0)return new fE(uE(!0))}var fE=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 pE(e){return e.enabled?new fE(e):void 0}function mE(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 hE(e,t){return!e||t.metadata===void 0?!1:(e.metadata=Bo(e.metadata,$(t.metadata)),!0)}var gE=(e,t,n,r,i)=>{let a=dE(i),o=$(n.messages),s=$(e.state),c={},l=[],u=new Set,d=e=>{let t=e.outcome?.type===`success`?e.outcome.pendingToolCallIds:void 0;return t!==void 0&&t.length>0?[...t]:l.filter(e=>!u.has(e))},f=e=>{e.messages!==void 0&&(o=e.messages,c.messages=e.messages),e.state!==void 0&&(s=e.state,c.state=e.state)},p=()=>{let e=$(c);return c={},e.messages!==void 0||e.state!==void 0?il(e):Tc};return t.pipe(hl(async t=>{let i=await lE(r,o,s,(r,i,a)=>r.onEvent?.({event:t,agent:n,input:e,messages:i,state:a}));if(f(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 p();switch(t.type){case A.TEXT_MESSAGE_START:{let i=await lE(r,o,s,(r,i,a)=>r.onTextMessageStartEvent?.({event:t,messages:i,state:a,agent:n,input:e}));if(f(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`),p();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=hE(s,t);(!a||c)&&f({messages:o})}return p()}case A.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}'`),p();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`),p();let l=await lE(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 f(l),l.stopPropagation!==!0&&(c.content=`${typeof c.content==`string`?c.content:``}${a}`,hE(c,t),f({messages:o})),p()}case A.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}'`),p();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`),p();let c=await lE(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 f(c),c.stopPropagation!==!0&&hE(a,t)&&f({messages:o}),await Promise.all(r.map(t=>{t.onNewMessage?.({message:a,messages:o,state:s,agent:n,input:e})})),p()}case A.TOOL_CALL_START:{let i=await lE(r,o,s,(r,i,a)=>r.onToolCallStartEvent?.({event:t,messages:i,state:a,agent:n,input:e}));if(f(i),i.stopPropagation!==!0){let{toolCallId:e,toolCallName:n,parentMessageId:r,subagentRunId:i}=t;l.includes(e)||l.push(e);let 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),(hE(a,t)||r)&&f({messages:o}),p()}let s=new Set(o.map(e=>e.id)),c=mE(o,r,e);!s.has(c.id)&&i!=null&&c.subagentRunId===void 0&&(c.subagentRunId=i),c.toolCalls??=[];let u={id:e,type:`function`,function:{name:n,arguments:``}};c.toolCalls.push(u),hE(u,t),f({messages:o})}return p()}case A.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}'`),p();let l=c.toolCalls?.find(e=>e.id===i);if(!l)return console.warn(`TOOL_CALL_ARGS: No tool call found with ID '${i}'`),p();let u=await lE(r,o,s,(r,i,a)=>{let o=l.function.arguments,s=l.function.name,c={};try{c=wl(o)}catch{}return r.onToolCallArgsEvent?.({event:t,messages:i,state:a,agent:n,input:e,toolCallBuffer:o,toolCallName:s,partialToolCallArgs:c})});return f(u),u.stopPropagation!==!0&&(l.function.arguments+=a,hE(l,t),f({messages:o})),p()}case A.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}'`),p();let c=a.toolCalls?.find(e=>e.id===i);if(!c)return console.warn(`TOOL_CALL_END: No tool call found with ID '${i}'`),p();let l=await lE(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 f(l),l.stopPropagation!==!0&&hE(c,t)&&f({messages:o}),await Promise.all(r.map(t=>{t.onNewToolCall?.({toolCall:c,messages:o,state:s,agent:n,input:e})})),p()}case A.TOOL_CALL_RESULT:{let i=await lE(r,o,s,(r,i,a)=>r.onToolCallResultEvent?.({event:t,messages:i,state:a,agent:n,input:e}));if(f(i),i.stopPropagation!==!0){let{messageId:i,toolCallId:a,content:c,role:l,subagentRunId:d}=t;u.add(a);let p={id:i,toolCallId:a,role:l||`tool`,content:c,...d!=null&&{subagentRunId:d}};hE(p,t);let m=o.findIndex(e=>e.role===`assistant`&&e.toolCalls?.some(e=>e.id===a));if(m===-1)o.push(p);else{let e=m+1;for(;e{t.onNewMessage?.({message:p,messages:o,state:s,agent:n,input:e})})),f({messages:o})}return p()}case A.STATE_SNAPSHOT:{let i=await lE(r,o,s,(r,i,a)=>r.onStateSnapshotEvent?.({event:t,messages:i,state:a,agent:n,input:e}));if(f(i),i.stopPropagation!==!0){let{snapshot:e}=t;s=e,f({state:s})}return p()}case A.STATE_DELTA:{let i=await lE(r,o,s,(r,i,a)=>r.onStateDeltaEvent?.({event:t,messages:i,state:a,agent:n,input:e}));if(f(i),i.stopPropagation!==!0){let{delta:e}=t;try{s=Cs.applyPatch(s,e,!0,!1).newDocument,f({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 p()}case A.MESSAGES_SNAPSHOT:{let i=await lE(r,o,s,(r,i,a)=>r.onMessagesSnapshotEvent?.({event:t,messages:i,state:a,agent:n,input:e}));if(f(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=rE(t),a=n.some(e=>e.role===`activity`),s=n.some(e=>e.role===`reasoning`),c=e=>e.role===`activity`&&(i?!i.includes(e.activityType):i!==null&&!a)||e.role===`reasoning`&&!s;o=o.filter(e=>r.has(e.id)||c(e)).map(e=>r.get(e.id)??e);let l=new Set(o.map(e=>e.id));for(let e of n)l.has(e.id)||o.push(e);f({messages:o})}return p()}case A.ACTIVITY_SNAPSHOT:{let i=t,a=o.findIndex(e=>e.id===i.messageId),c=a>=0?o[a]:void 0,l=c?.role===`activity`?c:void 0,u=i.replace??!0,d=await lE(r,o,s,(t,r,a)=>t.onActivitySnapshotEvent?.({event:i,messages:r,state:a,agent:n,input:e,activityMessage:l,existingMessage:c}));if(f(d),d.stopPropagation!==!0){let t={id:i.messageId,role:`activity`,activityType:i.activityType,content:$(i.content),...i.subagentRunId!=null&&{subagentRunId:i.subagentRunId}},c,d;a===-1?(o.push(t),c=t,d=t):l?(u&&(o[a]={...l,activityType:i.activityType,content:$(i.content),subagentRunId:i.subagentRunId},i.subagentRunId??delete o[a].subagentRunId),d=o[a]):u&&(o[a]=t,c=t,d=t),hE(d,i),f({messages:o}),c&&await Promise.all(r.map(t=>t.onNewMessage?.({message:c,messages:o,state:s,agent:n,input:e})))}return p()}case A.ACTIVITY_DELTA:{let i=t,a=o.findIndex(e=>e.id===i.messageId);if(a===-1)return p();let c=o[a];if(c.role!==`activity`)return console.warn(`ACTIVITY_DELTA: Message '${i.messageId}' is not an activity message`),p();let l=c,u=await lE(r,o,s,(t,r,a)=>t.onActivityDeltaEvent?.({event:i,messages:r,state:a,agent:n,input:e,activityMessage:l}));if(f(u),u.stopPropagation!==!0)try{hE(l,i)&&f({messages:o});let e=$(l.content??{}),t=Cs.applyPatch(e,i.patch??[],!0,!1).newDocument;o[a]={...l,content:$(t),activityType:i.activityType},f({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 p()}case A.RAW:return f(await lE(r,o,s,(r,i,a)=>r.onRawEvent?.({event:t,messages:i,state:a,agent:n,input:e}))),p();case A.CUSTOM:return f(await lE(r,o,s,(r,i,a)=>r.onCustomEvent?.({event:t,messages:i,state:a,agent:n,input:e}))),p();case A.RUN_STARTED:{let i=await lE(r,o,s,(r,i,a)=>r.onRunStartedEvent?.({event:t,messages:i,state:a,agent:n,input:e}));if(f(i),l=[],u=new Set,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)}f({messages:o})}}return p()}case A.RUN_FINISHED:{let i=t,a=i.outcome?.type===`interrupt`?{event:i,outcome:`interrupt`,interrupts:i.outcome.interrupts}:i.outcome?.type===`cancelled`?{event:i,outcome:`cancelled`}:{event:i,outcome:`success`,result:i.result,pendingToolCallIds:d(i)},c=await lE(r,o,s,(t,r,i)=>t.onRunFinishedEvent?.({...a,messages:r,state:i,agent:n,input:e}));return f(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}):[]),p()}case A.RUN_ERROR:return f(await lE(r,o,s,(r,i,a)=>r.onRunErrorEvent?.({event:t,messages:i,state:a,agent:n,input:e}))),p();case A.STEP_STARTED:return f(await lE(r,o,s,(r,i,a)=>r.onStepStartedEvent?.({event:t,messages:i,state:a,agent:n,input:e}))),p();case A.STEP_FINISHED:return f(await lE(r,o,s,(r,i,a)=>r.onStepFinishedEvent?.({event:t,messages:i,state:a,agent:n,input:e}))),p();case A.TEXT_MESSAGE_CHUNK:throw Error(`TEXT_MESSAGE_CHUNK must be transformed before being applied`);case A.TOOL_CALL_CHUNK:throw Error(`TOOL_CALL_CHUNK must be transformed before being applied`);case A.REASONING_START:return f(await lE(r,o,s,(r,i,a)=>r.onReasoningStartEvent?.({event:t,messages:i,state:a,agent:n,input:e}))),p();case A.REASONING_MESSAGE_START:{let i=await lE(r,o,s,(r,i,a)=>r.onReasoningMessageStartEvent?.({event:t,messages:i,state:a,agent:n,input:e}));if(f(i),i.stopPropagation!==!0){let{messageId:e,subagentRunId:n}=t,r=o.find(t=>t.id===e);if(r?.role===`activity`)return console.warn(`REASONING_MESSAGE_START: Message '${e}' is an activity message — message ids must be unique across activity and reasoning messages`),p();let i=r;if(!i){let t={id:e,role:`reasoning`,content:``,...n!=null&&{subagentRunId:n}};o.push(t),i=t}let a=hE(i,t);(!r||a)&&f({messages:o})}return p()}case A.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}'`),p();if(c.role===`activity`)return console.warn(`REASONING_MESSAGE_CONTENT: Message '${i}' is an activity message — message ids must be unique across activity and reasoning messages`),p();let l=await lE(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 f(l),l.stopPropagation!==!0&&(c.content=`${typeof c.content==`string`?c.content:``}${a}`,hE(c,t),f({messages:o})),p()}case A.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}'`),p();if(a.role===`activity`)return console.warn(`REASONING_MESSAGE_END: Message '${i}' is an activity message — message ids must be unique across activity and reasoning messages`),p();let c=await lE(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 f(c),c.stopPropagation!==!0&&hE(a,t)&&f({messages:o}),await Promise.all(r.map(t=>{t.onNewMessage?.({message:a,messages:o,state:s,agent:n,input:e})})),p()}case A.REASONING_MESSAGE_CHUNK:throw Error(`REASONING_MESSAGE_CHUNK must be transformed before being applied`);case A.REASONING_END:return f(await lE(r,o,s,(r,i,a)=>r.onReasoningEndEvent?.({event:t,messages:i,state:a,agent:n,input:e}))),p();case A.REASONING_ENCRYPTED_VALUE:{let{subtype:i,entityId:a,encryptedValue:l}=t,u=await lE(r,o,s,(r,i,a)=>r.onReasoningEncryptedValueEvent?.({event:t,messages:i,state:a,agent:n,input:e}));if(f(u),u.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=l,e=!0;break}}}else{let t=o.find(e=>e.id===a);t?.role!==`activity`&&t&&(t.encryptedValue=l,e=!0)}e&&(c.messages=o)}return p()}case A.SUBAGENT_STARTED:return f(await lE(r,o,s,(r,i,a)=>r.onSubagentStartedEvent?.({event:t,messages:i,state:a,agent:n,input:e}))),p();case A.SUBAGENT_FINISHED:return f(await lE(r,o,s,(r,i,a)=>r.onSubagentFinishedEvent?.({event:t,messages:i,state:a,agent:n,input:e}))),p();case A.SUBAGENT_ERROR:return f(await lE(r,o,s,(r,i,a)=>r.onSubagentErrorEvent?.({event:t,messages:i,state:a,agent:n,input:e}))),p()}return t.type,p()}),ul(),r.length>0?vl({}):e=>e)};function _E(e,t){typeof process<`u`&&{}.SUPPRESS_TRANSFORMATION_WARNINGS||console.warn(`[ag-ui][compat] Converting deprecated ${e} to ${t}. The old shape leaves the protocol after its shim window — see the repo-root DEPRECATIONS.md. Set SUPPRESS_TRANSFORMATION_WARNINGS=true to silence.`)}var vE=e=>t=>{let n=dE(e),r=new Set,i=new Set,a=new Set,o=new Set,s={message:new Map,toolCall:new Map,activity:new Map,reasoning:new Map},c=!1,l=!1,u=!1,d=new Map,f=e=>{let t=d.get(e);return t||(t=new Map,d.set(e,t)),t},p=()=>{for(let e of d.values())if(e.size>0)return!0;return!1},m=new Map,h=new Set,g=!1,_=!1,v=()=>{_=!1,r.clear(),i.clear(),a.clear(),o.clear(),s.message.clear(),s.toolCall.clear(),s.activity.clear(),s.reasoning.clear(),d.clear(),m.clear(),h.clear(),c=!1,l=!1,g=!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 j(`Cannot send a message (id '${e.id}') with 'subagentRunId: null'. The field is optional — omit it entirely.`);let n=e.role===`reasoning`?s.reasoning:e.role===`activity`?s.activity:s.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||!s.toolCall.has(n.id))&&s.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 j(`Cannot send '${e}': subagentRunId '${t}' does not match the ${r} '${i}' opener's subagent '${n.subagentRunId??`(the parent agent)`}'.`)};return t.pipe(ll(e=>{let t=e.type;if(n?.event(`VERIFY`,`Event:`,e,{type:e.type}),l&&t!==A.RUN_STARTED)return N(()=>new j(`Cannot send event type '${t}': The run has already errored with 'RUN_ERROR'. No further events can be sent.`));if(c&&t!==A.RUN_ERROR&&t!==A.RUN_STARTED)return N(()=>new j(`Cannot send event type '${t}': The run has already finished with 'RUN_FINISHED'. Start a new run with 'RUN_STARTED'.`));if(!u){if(u=!0,t!==A.RUN_STARTED&&t!==A.RUN_ERROR)return N(()=>new j(`First event must be 'RUN_STARTED'`))}else if(t===A.RUN_STARTED){if(g&&!c&&!l)return N(()=>new j(`Cannot send 'RUN_STARTED' while a run is still active. The previous run must be finished with 'RUN_FINISHED' before starting a new run.`));(c||l)&&v()}if(e.subagentRunId===null){_||(_=!0,_E(`subagentRunId: null`,`an absent field`));let{subagentRunId:t,...n}=e;e=n}if(t===A.SUBAGENT_STARTED||t===A.SUBAGENT_FINISHED||t===A.SUBAGENT_ERROR){let n=t===A.SUBAGENT_STARTED?[`description`,`parentSubagentRunId`,`parentToolCallId`,`parentMessageId`]:t===A.SUBAGENT_FINISHED?[`outcome`]:[`code`];for(let r of n)if(e[r]===null)return N(()=>new j(`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 N(()=>new j(`Cannot send '${t}' with outcome type '${String(r.type)}'. The outcome is either { type: "success" } or { type: "suspended" }.`));if(r&&r.interruptIds===null)return N(()=>new j(`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 N(()=>new j(`Cannot send '${t}' with a non-string entry in 'outcome.interruptIds'. Interrupt ids are strings.`))}if(t===A.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 N(()=>new j(`Cannot send 'RUN_FINISHED' with an interrupt (id '${e.id}') carrying 'subagentRunId: null'. The field is optional — omit it entirely.`))}}switch(t){case A.TEXT_MESSAGE_START:{let n=e.messageId;if(r.has(n))return N(()=>new j(`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=s.message.get(n);if(i){let r=b(t,e.subagentRunId,i,`message`,n);if(r)return N(()=>r)}return r.add(n),i||s.message.set(n,{subagentRunId:e.subagentRunId}),il(e)}case A.TEXT_MESSAGE_CONTENT:{let n=e.messageId;if(!r.has(n))return N(()=>new j(`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,s.message.get(n),`message`,n);return i?N(()=>i):il(e)}case A.TEXT_MESSAGE_END:{let n=e.messageId;if(!r.has(n))return N(()=>new j(`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,s.message.get(n),`message`,n);return i?N(()=>i):(r.delete(n),il(e))}case A.TOOL_CALL_START:{let n=e.toolCallId;if(i.has(n))return N(()=>new j(`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,o;if(r!==void 0){let e=s.message.get(r);if(e){if(a!==void 0&&a!==e.subagentRunId)return N(()=>new j(`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.`));o=e}}let c=s.toolCall.get(n);if(c){let e=b(t,a,c,`tool call`,n);if(e)return N(()=>e);if(a===void 0&&o&&o.subagentRunId!==c.subagentRunId)return N(()=>new j(`Cannot send 'TOOL_CALL_START': tool call '${n}' is owned by '${c.subagentRunId??`(the parent agent)`}' but its parent message '${r}' is owned by '${o.subagentRunId??`(the parent agent)`}'. A tool call belongs to the message that carries it.`))}return i.add(n),c||s.toolCall.set(n,a===void 0?o??{subagentRunId:void 0}:{subagentRunId:a}),il(e)}case A.TOOL_CALL_ARGS:{let n=e.toolCallId;if(!i.has(n))return N(()=>new j(`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,s.toolCall.get(n),`tool call`,n);return r?N(()=>r):il(e)}case A.TOOL_CALL_END:{let n=e.toolCallId;if(!i.has(n))return N(()=>new j(`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,s.toolCall.get(n),`tool call`,n);return r?N(()=>r):(i.delete(n),il(e))}case A.STEP_STARTED:{let t=e.stepName,n=e.subagentRunId;return f(n).has(t)?N(()=>new j(`Step "${t}" is already active for 'STEP_STARTED'${n===void 0?``:` in subagent '${n}'`}`)):(f(n).set(t,!0),il(e))}case A.STEP_FINISHED:{let t=e.stepName,n=e.subagentRunId;if(!f(n).has(t)){let e,r=!1;for(let[i,a]of d)if(i!==n&&a.has(t)){e=i,r=!0;break}return N(r?()=>new j(`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 j(`Cannot send 'STEP_FINISHED' for step "${t}" that was not started`))}return f(n).delete(t),il(e)}case A.ACTIVITY_SNAPSHOT:{let t=e.messageId;return(!s.activity.has(t)||e.replace!==!1)&&s.activity.set(t,{subagentRunId:e.subagentRunId}),il(e)}case A.TOOL_CALL_RESULT:{let t=e.messageId;return typeof t==`string`&&s.message.set(t,{subagentRunId:e.subagentRunId}),il(e)}case A.REASONING_START:case A.REASONING_MESSAGE_START:{let n=e.messageId,r=t===A.REASONING_START,i=r?a:o;if(i.has(n))return N(()=>new j(r?`Cannot send 'REASONING_START' event: A reasoning span with ID '${n}' is already in progress. Complete it with 'REASONING_END' first.`:`Cannot send 'REASONING_MESSAGE_START' event: A reasoning message with ID '${n}' is already in progress. Complete it with 'REASONING_MESSAGE_END' first.`));let c=s.reasoning.get(n);if(c){let r=b(t,e.subagentRunId,c,`reasoning message`,n);if(r)return N(()=>r)}return i.add(n),c||s.reasoning.set(n,{subagentRunId:e.subagentRunId}),il(e)}case A.REASONING_MESSAGE_CONTENT:case A.REASONING_MESSAGE_END:case A.REASONING_END:{let n=e.messageId,r=t===A.REASONING_END,i=r?a:o;if(!i.has(n))return N(()=>new j(r?`Cannot send 'REASONING_END' event: No active reasoning span found with ID '${n}'. A 'REASONING_START' event must be sent first.`:`Cannot send '${t}' event: No active reasoning message found with ID '${n}'. Start a reasoning message with 'REASONING_MESSAGE_START' first.`));let c=b(t,e.subagentRunId,s.reasoning.get(n),`reasoning message`,n);return c?N(()=>c):((t===A.REASONING_END||t===A.REASONING_MESSAGE_END)&&i.delete(n),il(e))}case A.REASONING_ENCRYPTED_VALUE:{let n=e.entityId,r=e.subtype,i=r===`tool-call`?s.toolCall.get(n):r===`message`?s.message.get(n)??s.reasoning.get(n):s.reasoning.get(n),a=r===`tool-call`?`tool call`:r===`message`?`message`:`reasoning message`,o=b(t,e.subagentRunId,i,a,n);return o?N(()=>o):il(e)}case A.ACTIVITY_DELTA:{let n=e.messageId,r=b(t,e.subagentRunId,s.activity.get(n),`activity`,n);return r?N(()=>r):il(e)}case A.SUBAGENT_STARTED:{if(typeof e.subagentRunId!=`string`)return N(()=>new j(`Cannot send 'SUBAGENT_STARTED' without a 'subagentRunId'.`));if(typeof e.name!=`string`)return N(()=>new j(`Cannot send 'SUBAGENT_STARTED' without a 'name'.`));let t=e.subagentRunId,n=e.parentSubagentRunId;return m.has(t)?N(()=>new j(`Cannot send 'SUBAGENT_STARTED': subagent '${t}' is already active. Finish it with 'SUBAGENT_FINISHED' first.`)):h.has(t)?N(()=>new j(`Cannot send 'SUBAGENT_STARTED': subagent '${t}' has already finished in this run. Subagent IDs are per-invocation and cannot be reused.`)):n!==void 0&&!m.has(n)&&!h.has(n)?N(()=>new j(`Cannot send 'SUBAGENT_STARTED': parentSubagentRunId '${n}' has not been started in this run.`)):(m.set(t,!0),il(e))}case A.SUBAGENT_FINISHED:case A.SUBAGENT_ERROR:{if(typeof e.subagentRunId!=`string`)return N(()=>new j(`Cannot send '${t}' without a 'subagentRunId'.`));if(t===A.SUBAGENT_ERROR&&typeof e.message!=`string`)return N(()=>new j(`Cannot send 'SUBAGENT_ERROR' without a 'message'.`));let n=e.subagentRunId;return m.has(n)?(m.delete(n),h.add(n),il(e)):N(()=>new j(`Cannot send '${t}': no active subagent found with ID '${n}'. A 'SUBAGENT_STARTED' event must be sent first.`))}case A.MESSAGES_SNAPSHOT:{let t=y(e.messages,!0);if(t)return N(()=>t)}return il(e);case A.RUN_STARTED:g=!0;{let t=y((e.input??{}).messages,!1);if(t)return N(()=>t)}return il(e);case A.RUN_FINISHED:if(p()){let e=[];for(let[t,n]of d)for(let r of n.keys())e.push(t===void 0?r:`${r} (subagent '${t}')`);let t=e.join(`, `);return N(()=>new j(`Cannot send 'RUN_FINISHED' while steps are still active: ${t}`))}if(r.size>0){let e=Array.from(r.keys()).join(`, `);return N(()=>new j(`Cannot send 'RUN_FINISHED' while text messages are still active: ${e}`))}if(o.size>0){let e=Array.from(o.keys()).join(`, `);return N(()=>new j(`Cannot send 'RUN_FINISHED' while reasoning messages are still active: ${e}`))}if(a.size>0){let e=Array.from(a.keys()).join(`, `);return N(()=>new j(`Cannot send 'RUN_FINISHED' while reasoning spans are still active: ${e}`))}if(i.size>0){let e=Array.from(i.keys()).join(`, `);return N(()=>new j(`Cannot send 'RUN_FINISHED' while tool calls are still active: ${e}`))}if(m.size>0){let e=Array.from(m.keys()).join(`, `);return N(()=>new j(`Cannot send 'RUN_FINISHED' while subagents are still active: ${e}`))}return c=!0,il(e);case A.RUN_ERROR:return l=!0,il(e);case A.CUSTOM:return il(e);default:return il(e)}}))},yE=function(e){return e.HEADERS=`headers`,e.DATA=`data`,e}({}),bE=e=>fl(()=>rl(e())).pipe(bl(e=>{if(!e.ok){let t=e.headers.get(`content-type`)||``;return rl(e.text()).pipe(ll(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,N(()=>i)}))}let t={type:yE.HEADERS,status:e.status,headers:e.headers},n=e.body?.getReader();return n?new fc(e=>{let r=!1;return e.next(t),(async()=>{try{for(;!e.closed;){let{done:t,value:i}=await n.read();if(t){r=!0;break}let a={type:yE.DATA,data:i};e.next(a)}e.complete()}catch(t){r=!0,e.error(t)}})(),()=>{r||n.cancel().catch(e=>{e?.name!==`AbortError`&&console.warn(`Failed to cancel HTTP response stream:`,e)})}}):N(()=>Error(`Failed to getReader() from response`))})),xE=10485760,SE=(e,t)=>{let n=dE(t),r=new xc,i=new TextDecoder(`utf-8`,{fatal:!1}),a=``;e.subscribe({next:e=>{if(e.type!==yE.HEADERS&&e.type===yE.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);if(a.length>xE){r.error(Error(`SSE buffer size exceeded maximum limit of ${xE/1048576} MB`));return}}},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()},CE=10485760,wE=()=>typeof process<`u`&&!!{}.SUPPRESS_TRANSFORMATION_WARNINGS,TE=(e,t)=>{let n=dE(t),r=new xc,i=new Uint8Array,a=!1;e.subscribe({next:e=>{if(e.type!==yE.HEADERS&&e.type===yE.DATA&&e.data){let t=new Uint8Array(i.length+e.data.length);t.set(i,0),t.set(e.data,i.length),i=t,o()}},error:e=>r.error(e),complete:()=>{if(o(),!a){if(i.length>0){r.error(Error(`The binary stream ended mid-frame: ${i.length} trailing bytes could not be read as a complete message.`));return}r.complete()}}});function o(){if(!a)for(;i.length>=4;){let e=4+new DataView(i.buffer,i.byteOffset,4).getUint32(0,!1);if(e>CE){r.error(Error(`Protobuf message size exceeded maximum limit of ${CE/1048576} MB`));return}if(i.length{let n=dE(t),r=new xc,i=new wc(1),a=!1,o,s=!1,c=()=>{s=!0,o?.unsubscribe()},l=e=>{c(),r.error(e)},u=()=>{c(),r.complete()};return o=e.subscribe({next:e=>{if(i.next(e),e.type===yE.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`?TE(i,n).subscribe({next:e=>r.next(e),error:e=>l(e),complete:()=>u()}):SE(i,n).subscribe({next:e=>{if(typeof e!=`object`||!e||Array.isArray(e)){let t=Error(`Invalid event: the frame is not a JSON object.`);n?.event(`HTTP`,`Event invalid:`,{json:e,error:String(t)}),l(t);return}let t=e;if(typeof t.type!=`string`||t.type.length===0){let t=Error(`Invalid event: the frame carries no event type.`);n?.event(`HTTP`,`Event invalid:`,{json:e,error:String(t)}),l(t);return}n?.event(`HTTP`,`Event received:`,e,{type:t.type}),r.next(e)},error:e=>{if(e?.name===`AbortError`){r.next({type:A.RUN_ERROR,message:e.message||`Request aborted`,code:`abort`,rawEvent:e}),u();return}return l(e)},complete:()=>u()})}else a||l(Error(`No headers event received before data events`))},error:e=>{i.error(e),l(e)},complete:()=>{i.complete()}}),s&&o.unsubscribe(),r.asObservable()},DE={TextMessageStart:`TextMessageStart`,TextMessageContent:`TextMessageContent`,TextMessageEnd:`TextMessageEnd`,ActionExecutionStart:`ActionExecutionStart`,ActionExecutionArgs:`ActionExecutionArgs`,ActionExecutionEnd:`ActionExecutionEnd`,ActionExecutionResult:`ActionExecutionResult`,AgentStateMessage:`AgentStateMessage`,MetaEvent:`MetaEvent`,RunStarted:`RunStarted`,RunFinished:`RunFinished`,RunError:`RunError`,NodeStarted:`NodeStarted`,NodeFinished:`NodeFinished`},OE=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(` -`)};function kE(e,t){return Ho(t)&&AE(`[ag-ui][legacy] The result of tool call '${e}' carries content parts the legacy protocol cannot represent; only its text parts are bridged and the rest is dropped.`),Vo(t)}var AE=e=>{typeof process<`u`&&{}.SUPPRESS_TRANSFORMATION_WARNINGS||console.warn(e)},jE=(e,t,n)=>r=>{let i={},a=!0,o=!0,s=``,c=null,l=null,u=[],d={},f=!1,p=e=>{typeof e==`object`&&e&&(`messages`in e&&delete e.messages,i=e)};return r.pipe(ll(r=>{switch(r.type){case A.TEXT_MESSAGE_START:{let e=r;return[{type:DE.TextMessageStart,messageId:e.messageId,role:e.role}]}case A.TEXT_MESSAGE_CONTENT:{let e=r;return[{type:DE.TextMessageContent,messageId:e.messageId,content:e.delta}]}case A.TEXT_MESSAGE_END:{let e=r;return[{type:DE.TextMessageEnd,messageId:e.messageId}]}case A.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:DE.ActionExecutionStart,actionExecutionId:e.toolCallId,actionName:e.toolCallName,parentMessageId:e.parentMessageId}]}case A.TOOL_CALL_ARGS:{let c=r,d=u.find(e=>e.id===c.toolCallId);if(!d)return AE(`[ag-ui][legacy] TOOL_CALL_ARGS: No tool call found with ID '${c.toolCallId}'`),[];d.function.arguments+=c.delta;let f=!1;if(l){let e=l.find(e=>e.tool==d.function.name);if(e)try{let t=JSON.parse(wl(d.function.arguments));e.tool_argument&&e.tool_argument in t?(p({...i,[e.state_key]:t[e.tool_argument]}),f=!0):e.tool_argument||(p({...i,[e.state_key]:t}),f=!0)}catch{}}return[{type:DE.ActionExecutionArgs,actionExecutionId:c.toolCallId,args:c.delta},...f?[{type:DE.AgentStateMessage,threadId:e,agentName:n,nodeName:s,runId:t,running:a,role:`assistant`,state:JSON.stringify(i),active:o}]:[]]}case A.TOOL_CALL_END:{let e=r;return[{type:DE.ActionExecutionEnd,actionExecutionId:e.toolCallId}]}case A.TOOL_CALL_RESULT:{let e=r,t=d[e.toolCallId];return(t===void 0||t===``)&&AE(`[ag-ui][legacy] No usable tool name was seen for tool call '${e.toolCallId}' (${t===void 0?`no TOOL_CALL_START reached this bridge`:`its TOOL_CALL_START carried an empty toolCallName`}), so its result is being bridged with the fabricated action name "unknown". Downstream consumers route on that name.`),[{type:DE.ActionExecutionResult,actionExecutionId:e.toolCallId,result:kE(e.toolCallId,e.content),actionName:t||`unknown`}]}case A.RAW:return f||(f=!0,AE(`[ag-ui][legacy] Dropping RAW events: the legacy runtime protocol has no equivalent, so the provider payloads they carry do not reach the legacy stream. Reported once per stream.`)),[];case A.CUSTOM:{let e=r;switch(e.name){case`Exit`:a=!1;break;case`PredictState`:l=e.value}return[{type:DE.MetaEvent,name:e.name,value:e.value}]}case A.STATE_SNAPSHOT:return p(r.snapshot),[{type:DE.AgentStateMessage,threadId:e,agentName:n,nodeName:s,runId:t,running:a,role:`assistant`,state:JSON.stringify(i),active:o}];case A.STATE_DELTA:{let c=r,l;try{l=Cs.applyPatch(i,c.delta,!0,!1).newDocument}catch(e){let t=e instanceof Error?e.message:String(e);return AE(`[ag-ui][legacy] Failed to apply state patch:\nCurrent state: ${JSON.stringify(i,null,2)}\nPatch operations: ${JSON.stringify(c.delta,null,2)}\nError: ${t}`),[]}return p(l),[{type:DE.AgentStateMessage,threadId:e,agentName:n,nodeName:s,runId:t,running:a,role:`assistant`,state:JSON.stringify(i),active:o}]}case A.MESSAGES_SNAPSHOT:return c=r.messages,[{type:DE.AgentStateMessage,threadId:e,agentName:n,nodeName:s,runId:t,running:a,role:`assistant`,state:JSON.stringify({...i,...c?{messages:c}:{}}),active:!0}];case A.RUN_STARTED:return[];case A.RUN_FINISHED:{if(c&&(i.messages=c),Object.keys(i).length===0)return[];let r=null;if(c)try{r=ME(c)}catch(e){return[{type:DE.RunError,message:e.message}]}return[{type:DE.AgentStateMessage,threadId:e,agentName:n,nodeName:s,runId:t,running:a,role:`assistant`,state:JSON.stringify({...i,...r?{messages:r}:{}}),active:!1}]}case A.RUN_ERROR:{let e=r;return[{type:DE.RunError,message:e.message,code:e.code}]}case A.STEP_STARTED:return s=r.stepName,u=[],l=null,[{type:DE.AgentStateMessage,threadId:e,agentName:n,nodeName:s,runId:t,running:a,role:`assistant`,state:JSON.stringify(i),active:!0}];case A.STEP_FINISHED:return u=[],l=null,[{type:DE.AgentStateMessage,threadId:e,agentName:n,nodeName:s,runId:t,running:a,role:`assistant`,state:JSON.stringify(i),active:!1}];default:return[]}}))};function ME(e){let t=[];for(let n of e)if(n.role===`assistant`||n.role===`user`||n.role===`system`){let e=OE(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;try{r=JSON.parse(e.function.arguments)}catch(t){throw Error(`Failed to parse arguments for tool call '${e.id}' (${e.function.name}): ${t.message}`)}let i={id:e.id,name:e.function.name,arguments:r,parentMessageId:n.id};t.push(i)}}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:kE(n.toolCallId,n.content),actionExecutionId:n.toolCallId,actionName:r};t.push(i)}return t}var NE=e=>e.kind===`tool`?e.fields.toolCallId:e.fields.messageId,PE=e=>e===`tool`?`toolCallId`:`messageId`,FE=(e,t,n,r,i)=>{if(r!==void 0&&r!==i)throw Error(`Cannot continue ${e} '${t}': chunk ${n} '${r}' does not match the open stream's ${n} ${i===void 0?`(absent)`:`'${i}'`}.`)},IE=(e,t)=>t.metadata===void 0?e:{...e,metadata:t.metadata},LE=(e,t)=>{let n=IE(e,t);return t.rawEvent===void 0?n:{...n,rawEvent:t.rawEvent}},RE=e=>new Set(Object.keys(e.shape)),zE=RE($v),BE=RE(ry),VE=RE(By),HE=(e,t)=>{let n;for(let r of Object.keys(e))t.has(r)||((n??={})[r]=e[r]);return n},UE=e=>{typeof process<`u`&&{}.SUPPRESS_TRANSFORMATION_WARNINGS||console.warn(`[ag-ui][transform] ${e} Set SUPPRESS_TRANSFORMATION_WARNINGS=true to silence.`)},WE=(e,t,n,r)=>{if(t===void 0||n||e.length===0)return;let i=e[e.length-1],a=Object.keys(t).filter(e=>Object.prototype.hasOwnProperty.call(i,e));a.length>0&&UE(`A ${r} carried ${a.map(e=>`'${e}'`).join(`, `)}, which the synthesized ${String(i.type)} already describes. The synthesized value is kept and the chunk's is dropped — this stage does not judge a described field, so the producer's value cannot be substituted for its own.`),e[e.length-1]={...t,...i}},GE=e=>t=>{let n=dE(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:A.TEXT_MESSAGE_END,messageId:t.fields.messageId,...t.fields.subagentRunId!==void 0&&{subagentRunId:t.fields.subagentRunId}};return n?.event(`TRANSFORM`,`TEXT_MESSAGE_END`,e,{messageId:e.messageId}),[e]}case`tool`:{let e={type:A.TOOL_CALL_END,toolCallId:t.fields.toolCallId,...t.fields.subagentRunId!==void 0&&{subagentRunId:t.fields.subagentRunId}};return n?.event(`TRANSFORM`,`TOOL_CALL_END`,e,{toolCallId:e.toolCallId}),[e]}case`reasoning`:{let e={type:A.REASONING_MESSAGE_END,messageId:t.fields.messageId,...t.fields.subagentRunId!==void 0&&{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&&NE(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 ${PE(e)} nor a subagentRunId, but ${s.length} lanes have an open ${a}. Attribute the chunk to the subagent it belongs to.`)};return t.pipe(ll(e=>{switch(e.type){case A.TEXT_MESSAGE_START:case A.TEXT_MESSAGE_CONTENT:case A.TEXT_MESSAGE_END:case A.TOOL_CALL_START:case A.TOOL_CALL_ARGS:case A.TOOL_CALL_END:case A.TOOL_CALL_RESULT:case A.STATE_SNAPSHOT:case A.STATE_DELTA:case A.CUSTOM:case A.STEP_STARTED:case A.STEP_FINISHED:case A.REASONING_START:case A.REASONING_MESSAGE_START:case A.REASONING_MESSAGE_CONTENT:case A.REASONING_MESSAGE_END:case A.REASONING_END:return[...i(e.subagentRunId??void 0),e];case A.RUN_STARTED:case A.RUN_FINISHED:case A.RUN_ERROR:case A.MESSAGES_SNAPSHOT:return[...a(),e];case A.RAW:case A.ACTIVITY_SNAPSHOT:case A.ACTIVITY_DELTA:case A.REASONING_ENCRYPTED_VALUE:case A.SUBAGENT_STARTED:return[e];case A.SUBAGENT_FINISHED:case A.SUBAGENT_ERROR:{let t=e.subagentRunId;return t==null?[e]:[...i(t),e]}case A.TEXT_MESSAGE_CHUNK:{let t=e,a=HE(e,zE),o=s(`text`,t.messageId,t.subagentRunId??void 0,`TEXT_MESSAGE_CHUNK`,`text message`),c=r.get(o),l=[],u=!1,d;if(c?.kind===`text`&&(t.messageId===void 0||t.messageId===c.fields.messageId))FE(`text message`,c.fields.messageId,`role`,t.role,c.fields.role),FE(`text message`,c.fields.messageId,`name`,t.name,c.fields.name),d=c.fields;else{if(l.push(...i(o)),t.messageId===void 0)throw Error(`First TEXT_MESSAGE_CHUNK must have a messageId`);d={messageId:t.messageId,role:t.role===void 0?`assistant`:t.role,name:t.name,subagentRunId:t.subagentRunId},r.set(o,{kind:`text`,fields:d});let e=IE({type:A.TEXT_MESSAGE_START,messageId:t.messageId,role:d.role,...t.name!==void 0&&{name:t.name},...t.subagentRunId!==void 0&&{subagentRunId:t.subagentRunId}},t);l.push(e),n?.event(`TRANSFORM`,`TEXT_MESSAGE_START`,e,{messageId:t.messageId})}if(t.delta!==void 0||t.rawEvent!==void 0){let e=t.subagentRunId===void 0?d.subagentRunId:t.subagentRunId,r=LE({...a,type:A.TEXT_MESSAGE_CONTENT,messageId:d.messageId,delta:t.delta===void 0?``:t.delta,...e!==void 0&&{subagentRunId:e}},t);l.push(r),u=!0,n?.event(`TRANSFORM`,`TEXT_MESSAGE_CONTENT`,r,{messageId:d.messageId})}if(l.length===0&&(t.metadata!==void 0||t.rawEvent!==void 0||t.subagentRunId===null||a!==void 0)){let e=t.subagentRunId===void 0?d.subagentRunId:t.subagentRunId;l.push({...a,type:A.TEXT_MESSAGE_CONTENT,messageId:d.messageId,delta:``,...t.metadata!==void 0&&{metadata:t.metadata},...t.rawEvent!==void 0&&{rawEvent:t.rawEvent},...e!==void 0&&{subagentRunId:e}}),u=!0}return WE(l,a,u,`TEXT_MESSAGE_CHUNK`),l}case A.TOOL_CALL_CHUNK:{let t=e,a=HE(e,BE),o=s(`tool`,t.toolCallId,t.subagentRunId??void 0,`TOOL_CALL_CHUNK`,`tool call`),c=r.get(o),l=[],u=!1,d;if(c?.kind===`tool`&&(t.toolCallId===void 0||t.toolCallId===c.fields.toolCallId))FE(`tool call`,c.fields.toolCallId,`toolCallName`,t.toolCallName,c.fields.toolCallName),FE(`tool call`,c.fields.toolCallId,`parentMessageId`,t.parentMessageId,c.fields.parentMessageId),d=c.fields;else{if(l.push(...i(o)),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`);d={toolCallId:t.toolCallId,toolCallName:t.toolCallName,parentMessageId:t.parentMessageId,subagentRunId:t.subagentRunId},r.set(o,{kind:`tool`,fields:d});let e=IE({type:A.TOOL_CALL_START,toolCallId:t.toolCallId,toolCallName:t.toolCallName,...t.parentMessageId!==void 0&&{parentMessageId:t.parentMessageId},...t.subagentRunId!==void 0&&{subagentRunId:t.subagentRunId}},t);l.push(e),n?.event(`TRANSFORM`,`TOOL_CALL_START`,e,{toolCallId:t.toolCallId,toolCallName:t.toolCallName})}if(t.delta!==void 0||t.rawEvent!==void 0){let e=t.subagentRunId===void 0?d.subagentRunId:t.subagentRunId,r=LE({...a,type:A.TOOL_CALL_ARGS,toolCallId:d.toolCallId,delta:t.delta===void 0?``:t.delta,...e!==void 0&&{subagentRunId:e}},t);l.push(r),u=!0,n?.event(`TRANSFORM`,`TOOL_CALL_ARGS`,r,{toolCallId:d.toolCallId})}if(l.length===0&&(t.metadata!==void 0||t.rawEvent!==void 0||t.subagentRunId===null||a!==void 0)){let e=t.subagentRunId===void 0?d.subagentRunId:t.subagentRunId;l.push({...a,type:A.TOOL_CALL_ARGS,toolCallId:d.toolCallId,delta:``,...t.metadata!==void 0&&{metadata:t.metadata},...t.rawEvent!==void 0&&{rawEvent:t.rawEvent},...e!==void 0&&{subagentRunId:e}}),u=!0}return WE(l,a,u,`TOOL_CALL_CHUNK`),l}case A.REASONING_MESSAGE_CHUNK:{let t=e,a=HE(e,VE),o=s(`reasoning`,t.messageId,t.subagentRunId??void 0,`REASONING_MESSAGE_CHUNK`,`reasoning message`),c=r.get(o),l=[],u=!1,d;if(c?.kind===`reasoning`&&(t.messageId===void 0||t.messageId===c.fields.messageId))d=c.fields;else{if(l.push(...i(o)),t.messageId===void 0)throw Error(`First REASONING_MESSAGE_CHUNK must have a messageId`);d={messageId:t.messageId,subagentRunId:t.subagentRunId},r.set(o,{kind:`reasoning`,fields:d});let e=IE({type:A.REASONING_MESSAGE_START,messageId:t.messageId,role:`reasoning`,...t.subagentRunId!==void 0&&{subagentRunId:t.subagentRunId}},t);l.push(e),n?.event(`TRANSFORM`,`REASONING_MESSAGE_START`,e,{messageId:t.messageId})}if(t.delta!==void 0||t.rawEvent!==void 0){let e=t.subagentRunId===void 0?d.subagentRunId:t.subagentRunId,r=LE({...a,type:A.REASONING_MESSAGE_CONTENT,messageId:d.messageId,delta:t.delta===void 0?``:t.delta,...e!==void 0&&{subagentRunId:e}},t);l.push(r),u=!0,n?.event(`TRANSFORM`,`REASONING_MESSAGE_CONTENT`,r,{messageId:d.messageId})}if(l.length===0&&(t.metadata!==void 0||t.rawEvent!==void 0||t.subagentRunId===null||a!==void 0)){let e=t.subagentRunId===void 0?d.subagentRunId:t.subagentRunId;l.push({...a,type:A.REASONING_MESSAGE_CONTENT,messageId:d.messageId,delta:``,...t.metadata!==void 0&&{metadata:t.metadata},...t.rawEvent!==void 0&&{rawEvent:t.rawEvent},...e!==void 0&&{subagentRunId:e}}),u=!0}return WE(l,a,u,`REASONING_MESSAGE_CHUNK`),l}}return e.type,[e]}),yl(()=>{a()}))},KE=Symbol(`agui.strip.drop`);function qE(e){let t=e;for(;;){if(t instanceof PT||t instanceof IT||t instanceof RT||t instanceof JT||t instanceof WT){t=t.unwrap();continue}if(t instanceof KT){t=t.def.in;continue}if(t instanceof XT){t=t.def.getter();continue}return t}}function JE(e){let t=e.def;return typeof t?.discriminator==`string`?t.discriminator:void 0}function YE(e){let t=e,n=Array.isArray(t.def?.values)?t.def.values:t.values?Array.from(t.values):void 0;return n&&n.length===1?n[0]:t.value}function XE(e){let t=qE(e);return t instanceof jT?YE(t):void 0}function ZE(e,t,n,r){let i=qE(t);if(i instanceof CT){if(typeof e!=`object`||!e||Array.isArray(e))return e;let t=i.shape,a=e,o={},s=i.meta()?.specOpen===!0;for(let e of Object.keys(a)){let i=Object.prototype.hasOwnProperty.call(t,e)?t[e]:void 0;if(i===void 0){if(s){o[e]=a[e];continue}r.push(`${n}/${e}`);continue}let c=r.length,l=ZE(a[e],i,`${n}/${e}`,r);if(l===KE){if(r.length=c,i.safeParse(void 0).success){r.push(`${n}/${e}`);continue}return KE}o[e]=l}return o}if(i instanceof xT){if(!Array.isArray(e))return e;let t=i.element,a=[];return e.forEach((e,i)=>{let o=r.length,s=ZE(e,t,`${n}/${i}`,r);if(s===KE){r.length=o,r.push(`${n}/${i}`);return}a.push(s)}),a}if(i instanceof OT){if(typeof e!=`object`||!e||Array.isArray(e))return e;let t=i.def.valueType,a=e,o={};for(let e of Object.keys(a)){let i=r.length,s=ZE(a[e],t,`${n}/${e}`,r);if(s===KE){r.length=i,r.push(`${n}/${e}`);continue}o[e]=s}return o}if(i instanceof wT){let t=i.options,a=JE(i);if(a!==void 0){if(typeof e!=`object`||!e||Array.isArray(e))return e;let i=e[a];for(let o of t){let t=qE(o);if(!(t instanceof CT))continue;let s=t.shape;if(XE(s[a])===i)return ZE(e,o,n,r)}return KE}let o=t.filter(e=>qE(e)instanceof CT),s=typeof e==`object`&&!!e&&!Array.isArray(e);if(o.length>1&&s)return e;for(let i of t){let t=qE(i);if(t instanceof xT&&Array.isArray(e)||t instanceof CT&&s)return ZE(e,i,n,r)}return e}return e}function QE(e,t){let n=[],r=ZE(e,t,``,n);if(r===KE)throw Error(`Internal error: the stripper found the whole value unrecognisable, which the schemas are not supposed to allow — schema/stripper mismatch.`);return{value:r,stripped:n}}var $E=new Set(Object.values(A));function eD(e){return $E.has(e.type)}var tD=new Map(Ky.options.map(e=>{let t=e.shape;return[String(YE(t.type)),e]})),nD=()=>typeof process<`u`&&!!{}.SUPPRESS_TRANSFORMATION_WARNINGS;function rD(e){nD()||console.warn(`[ag-ui][enforce] ${e}`)}var iD=e=>t=>{let n=dE(e);return t.pipe(ll(e=>{if(!eD(e))return rD(`Dropping unrecognised event '${String(e.type)}': no middleware translated it and the protocol does not describe it.`),n?.event(`ENFORCE`,`Unrecognised event dropped:`,e,{type:e.type}),Tc;let t=tD.get(e.type);if(t===void 0)throw Error(`No validator for recognised event type '${String(e.type)}'`);let{value:r,stripped:i}=QE(e,t);for(let t of i)rD(`Removed unrecognised material at '${t}' on ${String(e.type)}. Nothing handled it; see the repo-root DEPRECATIONS.md if it is a retired shape.`);return il(t.parse(r))}))};function aD(e){let{value:t,stripped:n}=QE(Ro(e,`RunAgentInput`),Ey);for(let e of n)rD(`Removed unrecognised material at '${e}' from the outgoing input.`);return Ey.parse(t)}var oD=class{runNext(e,t){return t.run(e).pipe(GE(!1))}runNextWithState(e,t){let n=rE(e.messages||[]),r=rE(e.state===void 0?{}:e.state),i=new wc;return gE(e,i,t,[]).subscribe({next:e=>{e.messages!==void 0&&(n=e.messages),e.state!==void 0&&(r=e.state)},error:()=>{}}),this.runNext(e,t).pipe(hl(async e=>(i.next(e),await new Promise(e=>setTimeout(e,0)),{event:e,messages:rE(n),state:rE(r)})))}},sD=class extends oD{constructor(e){super(),this.fn=e}run(e,t){return this.fn(e,t)}};function cD(e){return e.startsWith(`image/`)?`image`:e.startsWith(`audio/`)?`audio`:e.startsWith(`video/`)?`video`:`document`}function lD(e){return typeof e==`object`&&!!e&&`type`in e&&e.type===`binary`&&`mimeType`in e&&typeof e.mimeType==`string`}function uD(e){let t=cD(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}}:{}}:((typeof process>`u`||!{}.SUPPRESS_TRANSFORMATION_WARNINGS)&&console.warn(`[ag-ui][compat] A binary content part carries only an id ('${e.id??``}') and cannot be converted to a modern media part; a 1.0 peer will not accept it. Provide data or a url. See the repo-root DEPRECATIONS.md.`),e)}function dD(e,t,n){if(typeof e!=`object`||!e||!(`type`in e)||e.type!==t.type||!(`source`in e))return!1;let r=e.source;return typeof r!=`object`||!r||!(`type`in r)||r.type!==t.source.type||!(`value`in r)||r.value!==t.source.value||!(`mimeType`in r)||r.mimeType!==t.source.mimeType?!1:!n||`metadata`in e&&typeof e.metadata==`object`&&e.metadata!==null&&`filename`in e.metadata&&e.metadata.filename===n}function fD(e){let t=e.content;if(!Array.isArray(t))return e;let n=t.flatMap(e=>{if(lD(e)){let n=uD(e);return n.type!==`binary`&&t.some(t=>dD(t,n,e.filename))?[]:[n]}return[e]});return{...e,content:n}}var pD=`THINKING_START`,mD=`THINKING_END`,hD=`THINKING_TEXT_MESSAGE_START`,gD=`THINKING_TEXT_MESSAGE_CONTENT`,_D=`THINKING_TEXT_MESSAGE_END`;function vD(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}var yD={event:[`rawEvent`,`subagentRunId`],[A.RUN_STARTED]:[`parentRunId`,`input`],[A.RUN_FINISHED]:[`result`,`outcome`],[A.RUN_ERROR]:[`usage`],[A.SUBAGENT_FINISHED]:[`result`],[A.TOOL_CALL_START]:[`parentMessageId`],[A.TOOL_CALL_CHUNK]:[`parentMessageId`],[A.TOOL_CALL_RESULT]:[`role`],"RUN_FINISHED.outcome":[`pendingToolCallIds`],"RUN_FINISHED.usage[]":[`provider`,`reasoningTokens`,`cachedInputTokens`,`cacheWriteInputTokens`],RunAgentInput:[`forwardedProps`],Tool:[`parameters`],ResumeEntry:[`payload`],"input content":[`metadata`]},bD=new Map(Object.entries(yD).filter(([e])=>Object.values(A).includes(e))),xD=e=>_E(e,`an absent field`);function SD(e,t,n,r){if(!vD(e))return e;let i;for(let a of t)e[a]===null&&(r(n===void 0?`${a}: null`:`${n}.${a}: null`),i??={...e},delete i[a]);return i??e}function CD(e,t,n){if(!vD(e)||!Array.isArray(e[t]))return e;let r=e[t],i=r.map(n);return i.some((e,t)=>e!==r[t])?{...e,[t]:i}:e}function wD(e,t){return CD(e,`content`,e=>{if(!vD(e))return e;switch(e.type){case`image`:case`audio`:case`video`:case`document`:return SD(e,yD[`input content`],`${e.type} input content`,t);default:return e}})}function TD(e,t=xD){let n=SD(e,yD.RunAgentInput,`RunAgentInput`,t);return n=CD(n,`tools`,e=>SD(e,yD.Tool,`Tool`,t)),n=CD(n,`resume`,e=>SD(e,yD.ResumeEntry,`ResumeEntry`,t)),CD(n,`messages`,e=>wD(e,t))}var ED=class extends oD{constructor(...e){super(...e),this.currentReasoningId=null,this.currentMessageId=null,this.nullsNoticedThisRun=new Set,this.noticeNullOncePerRun=e=>{this.nullsNoticedThisRun.has(e)||(this.nullsNoticedThisRun.add(e),_E(e,`an absent field`))}}warn(e,t){_E(e,t)}mintedContinuationId(e,t){if(t!==null)return t;let n=iE();return this.warnAside(`Minting a messageId ('${n}') for ${e}: no THINKING opener preceded it, so there was no id to continue. The id is this client's invention, not the producer's, and verification will reject the translated event for naming something nothing opened.`),n}warnAside(e){typeof process<`u`&&{}.SUPPRESS_TRANSFORMATION_WARNINGS||console.warn(`[ag-ui][compat] ${e} Set SUPPRESS_TRANSFORMATION_WARNINGS=true to silence.`)}run(e,t){return this.currentReasoningId=null,this.currentMessageId=null,this.nullsNoticedThisRun.clear(),e.messages=e.messages.map(fD),t.run(e).pipe(sl(e=>this.transformEvent(e)))}transformEvent(e){let t=this.noticeNullOncePerRun;e.type===A.RUN_STARTED&&this.nullsNoticedThisRun.clear(),e=SD(e,yD.event,void 0,t);let n=bD.get(e.type);switch(n&&(e=SD(e,n,e.type,t)),e.type){case pD:{this.currentReasoningId=iE();let{title:t,...n}=e;return this.warn(pD,A.REASONING_START),t!==void 0&&this.warnAside(`Dropping ${pD}.title ${JSON.stringify(t)}: ${A.REASONING_START} has no title field, so the span's label cannot be carried and nothing downstream can recover it.`),{...n,type:A.REASONING_START,messageId:this.currentReasoningId}}case hD:return this.currentMessageId=iE(),this.warn(hD,A.REASONING_MESSAGE_START),{...e,type:A.REASONING_MESSAGE_START,messageId:this.currentMessageId,role:`reasoning`};case gD:{let{delta:t,...n}=e;return this.warn(gD,A.REASONING_MESSAGE_CONTENT),{...n,type:A.REASONING_MESSAGE_CONTENT,messageId:this.mintedContinuationId(gD,this.currentMessageId),delta:t}}case _D:{let t=this.mintedContinuationId(_D,this.currentMessageId);return this.currentMessageId=null,this.warn(_D,A.REASONING_MESSAGE_END),{...e,type:A.REASONING_MESSAGE_END,messageId:t}}case mD:{let t=this.mintedContinuationId(mD,this.currentReasoningId);return this.currentReasoningId=null,this.warn(mD,A.REASONING_END),{...e,type:A.REASONING_END,messageId:t}}case A.RUN_FINISHED:{let n=e,r=SD(n.outcome,yD[`RUN_FINISHED.outcome`],`RUN_FINISHED.outcome`,t);return CD(r===n.outcome?n:{...n,outcome:r},`usage`,e=>SD(e,yD[`RUN_FINISHED.usage[]`],`RUN_FINISHED.usage[]`,t))}case A.MESSAGES_SNAPSHOT:{let t=e;return Array.isArray(t.messages)?{...t,messages:t.messages.map(e=>this.upgradeInboundMessage(e))}:e}case A.RUN_STARTED:{let n=TD(e.input,t),r=n===e.input?e:{...e,input:n},i=r;return!i.input||!Array.isArray(i.input.messages)?r:{...i,input:{...i.input,messages:i.input.messages.map(e=>this.upgradeInboundMessage(e))}}}default:return e}}upgradeInboundMessage(e){e=wD(e,this.noticeNullOncePerRun);let t=e.content;return!Array.isArray(t)||!t.some(e=>typeof e==`object`&&!!e&&e.type===`binary`)?e:(this.warn(`binary input content`,`the modern media content parts`),fD(e))}},DD=()=>e=>fl(()=>{let t=new ED;return e.pipe(sl(e=>t.transformEvent(e)))});function OD(e,t=new Date){return e.expiresAt!==void 0&&new Date(e.expiresAt)<=t}function kD(){return typeof process<`u`&&!!{}.SUPPRESS_TRANSFORMATION_WARNINGS}function AD(e){kD()||console.warn(`[ag-ui][compat] Flattening message content for a <=0.0.39 peer DROPS non-text parts (${e.join(`, `)}). The peer cannot receive them; upgrade it to keep media content. See the repo-root DEPRECATIONS.md.`)}function jD(e){kD()||console.warn(`[ag-ui][compat] Not flattening message content for a <=0.0.39 peer: ${e} content part(s) claim type "text" but carry a malformed 'text' value. That is a defect in the message, not media the peer cannot represent, and a downgrade must not repair it — the content is passed on unchanged so the outgoing enforcement boundary reports it. See the repo-root DEPRECATIONS.md.`)}function MD(e){let t=e.content;if(Array.isArray(t)){let n=e=>typeof e==`object`&&!!e&&`type`in e&&e.type===`text`,r=e=>n(e)&&typeof e.text==`string`,i=t.filter(e=>n(e)&&!r(e));if(i.length>0)return jD(i.length),e;let a=t.filter(e=>!r(e)).map(e=>typeof e==`object`&&e&&`type`in e?String(e.type):typeof e);a.length>0&&AD(a);let o=t.filter(r).map(e=>e.text).join(``);return{...e,content:o}}return typeof t==`string`?e:t===void 0?{...e,content:``}:e}var ND=class extends oD{run(e,t){let{parentRunId:n,...r}=e,i={...r,messages:r.messages.map(MD)};return this.runNext(i,t)}},PD=`THINKING_START`,FD=`THINKING_END`,ID=`THINKING_TEXT_MESSAGE_START`,LD=`THINKING_TEXT_MESSAGE_CONTENT`,RD=`THINKING_TEXT_MESSAGE_END`,zD=class extends oD{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(sl(e=>this.transformEvent(e)))}transformEvent(e){switch(e.type){case PD:{this.currentReasoningId=iE();let{title:t,...n}=e;return this.warnAboutTransformation(PD,A.REASONING_START),{...n,type:A.REASONING_START,messageId:this.currentReasoningId}}case ID:return this.currentMessageId=iE(),this.warnAboutTransformation(ID,A.REASONING_MESSAGE_START),{...e,type:A.REASONING_MESSAGE_START,messageId:this.currentMessageId,role:`reasoning`};case LD:{let{delta:t,...n}=e;return this.warnAboutTransformation(LD,A.REASONING_MESSAGE_CONTENT),{...n,type:A.REASONING_MESSAGE_CONTENT,messageId:this.currentMessageId??iE(),delta:t}}case RD:{let t=this.currentMessageId??iE();return this.warnAboutTransformation(RD,A.REASONING_MESSAGE_END),{...e,type:A.REASONING_MESSAGE_END,messageId:t}}case FD:{let t=this.currentReasoningId??iE();return this.warnAboutTransformation(FD,A.REASONING_END),{...e,type:A.REASONING_END,messageId:t}}default:return e}}},BD=`SUBAGENT_STARTED`,VD=`SUBAGENT_FINISHED`,HD=`SUBAGENT_ERROR`;function UD(e){if(e&&typeof e==`object`&&`subagentRunId`in e){let{subagentRunId:t,...n}=e;return n}return e}function WD(e){return e.map(e=>UD(e))}var GD=class extends oD{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=>UD(e))};return this.runNext(n,t).pipe(Sl(e=>{let t=e.type;(t===BD||t===VD||t===HD)&&this.warnDroppedLifecycleEvent(t)}),pl(e=>{let t=e.type;return t!==BD&&t!==VD&&t!==HD}),sl(e=>{let t=UD(e);if(t.type===A.MESSAGES_SNAPSHOT){let e=t;if(Array.isArray(e.messages))return{...e,messages:WD(e.messages)}}if(t.type===A.RUN_FINISHED){let e=t;if(e.outcome&&Array.isArray(e.outcome.interrupts))return{...e,outcome:{...e.outcome,interrupts:e.outcome.interrupts.map(e=>UD(e))}}}if(t.type===A.RUN_STARTED){let e=t;if(e.input&&Array.isArray(e.input.messages))return{...e,input:{...e.input,messages:WD(e.input.messages)}}}return t}))}},KD=`1.0.2`,qD=!1,JD=new WeakSet,YD=(e,t)=>/^\d+\.\d+$/.test(e)?CC(e,t)>0?`newer`:`not-newer`:`uninterpretable`,XD=e=>{let t=e.protocolVersion;if(t!==void 0&&t!==`1.0`)switch(YD(t,`1.0`)){case`uninterpretable`:console.warn(`[ag-ui] The producer declared protocol version '${t}', which this client cannot interpret.`);return;case`newer`:console.warn(`[ag-ui] The producer speaks protocol ${t}; this client speaks 1.0. Unrecognised material will be stripped with warnings.`);return;case`not-newer`:return}},ZD=class e{resolvePeerCeiling(t){if(this.resolvingPeerCeiling)return KD;let n=Object.getOwnPropertyDescriptor(this,`maxVersion`),r=Object.getOwnPropertyDescriptor(this,`maxProtocolVersion`),i=Object.getPrototypeOf(this);for(;i&&i!==e.prototype;)n??=Object.getOwnPropertyDescriptor(i,`maxVersion`),r??=Object.getOwnPropertyDescriptor(i,`maxProtocolVersion`),i=Object.getPrototypeOf(i);if(t===`maxVersion`&&n)return KD;let a=t===`maxProtocolVersion`?n:r;if(!a)return KD;this.resolvingPeerCeiling=!0;try{return a.get?a.get.call(this):a.value}finally{this.resolvingPeerCeiling=!1}}get maxProtocolVersion(){return this.resolvePeerCeiling(`maxProtocolVersion`)}get maxVersion(){return!this.resolvingPeerCeiling&&!qD&&(qD=!0,console.warn(`[ag-ui] AbstractAgent.maxVersion is deprecated — use maxProtocolVersion. Same value; the new name says whose version it is and that it is a ceiling.`)),this.resolvePeerCeiling(`maxVersion`)}get debug(){return this._debug}set debug(e){this._debug=uE(e),this._debugLogger=pE(this._debug)}get debugLogger(){return this._debugLogger}set debugLogger(e){this._debugLogger=typeof e==`boolean`?e?pE(uE(!0)):void 0:e}resolvedCeilingDuringConstruction(){let e=this.maxProtocolVersion;if(typeof e!=`string`||!wC(e))throw new j(`maxProtocolVersion resolved to ${JSON.stringify(e)} during construction, which is not a version this client can compare. A ceiling read from an instance field is not available yet — return a literal from the getter.`);return e}constructor({agentId:e,description:t,threadId:n,initialMessages:r,initialState:i,debug:a}={}){this.subscribers=[],this.isRunning=!1,this.pendingInterrupts=[],this.middlewares=[],this.resolvingPeerCeiling=!1,this.agentId=e,this.description=t??``,this.threadId=n??Po(),this.messages=rE(r??[]),this.state=rE(i??{}),this._debug=uE(a),this._debugLogger=pE(this._debug);let o=this.resolvedCeilingDuringConstruction();CC(o,`0.0.39`)<=0&&this.middlewares.unshift(new ND),CC(o,`0.0.45`)<=0&&this.middlewares.unshift(new zD),CC(o,`0.0.57`)<=0&&this.middlewares.unshift(new GD)}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 sD(e):e);return this.middlewares.push(...t),this}async runAgent(e,t){try{this.isRunning=!0,this.agentId=this.agentId??Po();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=[{onRunStartedEvent:({event:e})=>XD(e),onRunFinishedEvent:e=>{e.outcome===`success`&&(r=e.result)}},...this.subscribers,t??{}];JD.add(n),await this.onInitialize(n,a),this.activeRunDetach$=new xc;let o;this.activeRunCompletionPromise=new Promise(e=>{o=e}),await ol(uc(()=>[...this.middlewares,new ED].reduceRight((e,t)=>({run:n=>t.run(n,e),get messages(){return e.messages},get state(){return e.state}}),this).run(n),iD(this.debugLogger),GE(this.debugLogger),vE(this.debugLogger),e=>e.pipe(xl(this.activeRunDetach$)),e=>this.applyBeforeSourceError(n,e,a),ml(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))),yl(()=>{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}))(il(null)));let s=rE(this.messages).filter(e=>!i.has(e.id));return{result:r,newMessages:s}}finally{this.isRunning=!1}}connect(e){throw new zo}async connectAgent(e,t){try{this.isRunning=!0,this.agentId=this.agentId??Po();let n=this.prepareRunAgentInput(e),r,i=new Set(this.messages.map(e=>e.id)),a=[{onRunStartedEvent:({event:e})=>XD(e),onRunFinishedEvent:e=>{e.outcome===`success`&&(r=e.result)}},...this.subscribers,t??{}];await this.onInitialize(n,a),this.activeRunDetach$=new xc;let o;this.activeRunCompletionPromise=new Promise(e=>{o=e}),await ol(uc(()=>fl(()=>this.connect(n)),e=>iD(this.debugLogger)(DD()(e)),GE(this.debugLogger),vE(this.debugLogger),e=>e.pipe(xl(this.activeRunDetach$)),e=>this.applyBeforeSourceError(n,e,a),ml(e=>(this.isRunning=!1,e instanceof zo?Tc:this.onError(n,e,a))),yl(()=>{this.isRunning=!1,this.onFinalize(n,a),o?.(),o=void 0,this.activeRunCompletionPromise=void 0,this.activeRunDetach$=void 0}))(il(null)),{defaultValue:void 0});let s=rE(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}applyBeforeSourceError(e,t,n){return fl(()=>{let r,i=t.pipe(ml(e=>(r={error:e},Tc)));return this.processApplyEvents(e,this.apply(e,i,n),n).pipe(_l(fl(()=>{let e=r;return e?N(()=>e.error):Tc})))})}apply(e,t,n){return gE(e,t,this,n,this.debugLogger)}processApplyEvents(e,t,n){return t.pipe(Sl(t=>{t.messages&&(this.messages=t.messages,n.forEach(t=>{t.onMessagesChanged?.({messages:this.messages,state:this.state,agent:this,input:e})})),t.state!==void 0&&(this.state=t.state,n.forEach(t=>{t.onStateChanged?.({state:this.state,messages:this.messages,agent:this,input:e})}))}))}prepareRunAgentInput(e){let t=rE(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||Po(),...CC(this.maxProtocolVersion,KD)>=0&&{protocolVersion:`1.0`},tools:rE(e?.tools??[]),context:rE(e?.context??[]),forwardedProps:rE(e?.forwardedProps??{}),state:rE(this.state),messages:n,...e?.resume===void 0?{}:{resume:rE(e.resume)}}}async onInitialize(e,t){if(JD.has(e)&&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 j(`Thread has ${n.length} pending interrupt(s) not addressed by resume: ${n.join(`, `)}`);for(let t of this.pendingInterrupts)if(OD(t)&&(e.resume??[]).find(e=>e.interruptId===t.id)?.status!==`cancelled`)throw new j(`Interrupt ${t.id} expired at ${t.expiresAt} and can no longer be answered. Cancel it to continue the thread.`)}let n=await lE(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.filter(e=>e.role!==`activity`),t.forEach(t=>{t.onMessagesChanged?.({messages:this.messages,state:this.state,agent:this,input:e})})}n.state!==void 0&&(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 rl(lE(n,this.messages,this.state,(n,r,i)=>n.onRunFailed?.({error:t,messages:r,state:i,agent:this,input:e}))).pipe(sl(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 lE(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=rE(this.messages),e.state=rE(this.state),e._debug=this._debug,e._debugLogger=this._debugLogger,e.isRunning=this.isRunning,e.subscribers=[...this.subscribers],e.middlewares=[...this.middlewares],e.pendingInterrupts=rE(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=rE(e),(async()=>{for(let e of this.subscribers)await e.onMessagesChanged?.({messages:this.messages,state:this.state,agent:this})})()}setState(e){this.state=rE(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??Po();let t=this.prepareRunAgentInput(e);return[...this.middlewares,new ED].reduceRight((e,t)=>({run:n=>t.run(n,e),get messages(){return e.messages},get state(){return e.state}}),this).run(t).pipe(iD(this.debugLogger),GE(this.debugLogger),vE(this.debugLogger),jE(this.threadId,t.runId,this.agentId),e=>e.pipe(sl(e=>(this.debugLogger?.event(`LEGACY`,`Event:`,e,{type:e.type}),e))))}};function QD(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 $D=class extends ZD{requestInit(e){return{method:`POST`,headers:{...this.headers,"Content-Type":`application/json`,Accept:`text/event-stream`},body:JSON.stringify(QD(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=rE(e.headers??{}),this.fetch=e.fetch??((e,t)=>fetch(e,t))}run(e){return EE(bE(()=>this.fetch(this.url,this.requestInit(aD(e)))),this.debugLogger)}clone(){let e=super.clone();e.url=this.url,e.headers=rE(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}},eO=class extends tn{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:hn(t,n.data),hasPreviousPage:rn(t,n.data),isFetchNextPageError:l,isFetchingNextPage:u,isFetchPreviousPageError:d,isFetchingPreviousPage:f,isRefetchError:s&&!l&&!d,isRefetching:a&&!u&&!f}}},tO=class extends on{#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 mn({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=nO(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=nO(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=nO(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=nO(e);return typeof t==`string`?(this.#t.get(t)?.find(t=>t!==e&&t.state.isPaused))?.continue()??Promise.resolve():Promise.resolve()}clear(){_n.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=>sn(t,e))}findAll(e={}){return this.getAll().filter(t=>sn(e,t))}notify(e){_n.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){let e=this.getAll().filter(e=>e.state.isPaused);return _n.batch(()=>Promise.all(e.map(e=>e.continue().catch(vn))))}};function nO(e){return e.options.scope?.id}var rO=class extends on{#e;constructor(e={}){super(),this.config=e,this.#e=new Map}build(e,t,n){let r=t.queryKey,i=t.queryHash??cn(r,t),a=this.get(i);return a||(a=new fn({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){this.#e.get(e.queryHash)===e&&(e.destroy(),this.#e.delete(e.queryHash),this.notify({type:`removed`,query:e}))}clear(){_n.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=>en(t,e))}findAll(e={}){let t=this.getAll();return Object.keys(e).length>0?t.filter(t=>en(e,t)):t}notify(e){_n.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){_n.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){_n.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},iO=class{#e;#t;#n;#r;#i;#a;#o;#s;constructor(e={}){this.#e=e.queryCache||new rO,this.#t=e.mutationCache||new tO,this.#n=e.defaultOptions||{},this.#r=new Map,this.#i=new Map,this.#a=0}mount(){this.#a++,this.#a===1&&(this.#o=an.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#s=ln.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(nn(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=pn(t,i);if(a!==void 0)return this.#e.build(this,r).setData(a,{...n,manual:!0})}setQueriesData(e,t,n){return _n.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;_n.batch(()=>{t.findAll(e).forEach(e=>{t.remove(e)})})}resetQueries(e,t){let n=this.#e;return _n.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=_n.batch(()=>this.#e.findAll(e).map(e=>e.cancel(n)));return Promise.all(r).then(vn).catch(vn)}invalidateQueries(e,t={}){return _n.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=_n.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(vn)),e.state.fetchStatus===`paused`?Promise.resolve():t}));return Promise.all(r).then(vn)}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(nn(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(nn(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(vn).catch(vn)}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(vn).catch(vn)}ensureInfiniteQueryData(e){return e._type=`infinite`,this.ensureQueryData(e)}resumePausedMutations(){return ln.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(un(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){let t=[...this.#r.values()],n={};return t.forEach(t=>{bn(e,t.queryKey)&&Object.assign(n,t.defaultOptions)}),n}setMutationDefaults(e,t){this.#i.set(un(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){let t=[...this.#i.values()],n={};return t.forEach(t=>{bn(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||=cn(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===Yt&&(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 aO(e,t){return dn(e,eO,t)}var oO=new Map([[`bold`,D.createElement(D.Fragment,null,D.createElement(`path`,{d:`M232,44H160a43.86,43.86,0,0,0-32,13.85A43.86,43.86,0,0,0,96,44H24A12,12,0,0,0,12,56V200a12,12,0,0,0,12,12H96a20,20,0,0,1,20,20,12,12,0,0,0,24,0,20,20,0,0,1,20-20h72a12,12,0,0,0,12-12V56A12,12,0,0,0,232,44ZM96,188H36V68H96a20,20,0,0,1,20,20V192.81A43.79,43.79,0,0,0,96,188Zm124,0H160a43.71,43.71,0,0,0-20,4.83V88a20,20,0,0,1,20-20h60Z`}))],[`duotone`,D.createElement(D.Fragment,null,D.createElement(`path`,{d:`M232,56V200H160a32,32,0,0,0-32,32,32,32,0,0,0-32-32H24V56H96a32,32,0,0,1,32,32,32,32,0,0,1,32-32Z`,opacity:`0.2`}),D.createElement(`path`,{d:`M232,48H160a40,40,0,0,0-32,16A40,40,0,0,0,96,48H24a8,8,0,0,0-8,8V200a8,8,0,0,0,8,8H96a24,24,0,0,1,24,24,8,8,0,0,0,16,0,24,24,0,0,1,24-24h72a8,8,0,0,0,8-8V56A8,8,0,0,0,232,48ZM96,192H32V64H96a24,24,0,0,1,24,24V200A39.81,39.81,0,0,0,96,192Zm128,0H160a39.81,39.81,0,0,0-24,8V88a24,24,0,0,1,24-24h64Z`}))],[`fill`,D.createElement(D.Fragment,null,D.createElement(`path`,{d:`M240,56V200a8,8,0,0,1-8,8H160a24,24,0,0,0-24,23.94,7.9,7.9,0,0,1-5.12,7.55A8,8,0,0,1,120,232a24,24,0,0,0-24-24H24a8,8,0,0,1-8-8V56a8,8,0,0,1,8-8H88a32,32,0,0,1,32,32v87.73a8.17,8.17,0,0,0,7.47,8.25,8,8,0,0,0,8.53-8V80a32,32,0,0,1,32-32h64A8,8,0,0,1,240,56Z`}))],[`light`,D.createElement(D.Fragment,null,D.createElement(`path`,{d:`M232,50H160a38,38,0,0,0-32,17.55A38,38,0,0,0,96,50H24a6,6,0,0,0-6,6V200a6,6,0,0,0,6,6H96a26,26,0,0,1,26,26,6,6,0,0,0,12,0,26,26,0,0,1,26-26h72a6,6,0,0,0,6-6V56A6,6,0,0,0,232,50ZM96,194H30V62H96a26,26,0,0,1,26,26V204.31A37.86,37.86,0,0,0,96,194Zm130,0H160a37.87,37.87,0,0,0-26,10.32V88a26,26,0,0,1,26-26h66Z`}))],[`regular`,D.createElement(D.Fragment,null,D.createElement(`path`,{d:`M232,48H160a40,40,0,0,0-32,16A40,40,0,0,0,96,48H24a8,8,0,0,0-8,8V200a8,8,0,0,0,8,8H96a24,24,0,0,1,24,24,8,8,0,0,0,16,0,24,24,0,0,1,24-24h72a8,8,0,0,0,8-8V56A8,8,0,0,0,232,48ZM96,192H32V64H96a24,24,0,0,1,24,24V200A39.81,39.81,0,0,0,96,192Zm128,0H160a39.81,39.81,0,0,0-24,8V88a24,24,0,0,1,24-24h64Z`}))],[`thin`,D.createElement(D.Fragment,null,D.createElement(`path`,{d:`M232,52H160a36,36,0,0,0-32,19.54A36,36,0,0,0,96,52H24a4,4,0,0,0-4,4V200a4,4,0,0,0,4,4H96a28,28,0,0,1,28,28,4,4,0,0,0,8,0,28,28,0,0,1,28-28h72a4,4,0,0,0,4-4V56A4,4,0,0,0,232,52ZM96,196H28V60H96a28,28,0,0,1,28,28V209.4A35.93,35.93,0,0,0,96,196Zm132,0H160a35.94,35.94,0,0,0-28,13.41V88a28,28,0,0,1,28-28h68Z`}))]]),sO=new Map([[`bold`,D.createElement(D.Fragment,null,D.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`,D.createElement(D.Fragment,null,D.createElement(`path`,{d:`M192,112a80,80,0,1,1-80-80A80,80,0,0,1,192,112Z`,opacity:`0.2`}),D.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`,D.createElement(D.Fragment,null,D.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`,D.createElement(D.Fragment,null,D.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`,D.createElement(D.Fragment,null,D.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`,D.createElement(D.Fragment,null,D.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`}))]]),cO=new Map([[`bold`,D.createElement(D.Fragment,null,D.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`,D.createElement(D.Fragment,null,D.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`}),D.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`,D.createElement(D.Fragment,null,D.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`,D.createElement(D.Fragment,null,D.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`,D.createElement(D.Fragment,null,D.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`,D.createElement(D.Fragment,null,D.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`}))]]),lO=new Map([[`bold`,D.createElement(D.Fragment,null,D.createElement(`path`,{d:`M240.49,15.51a12,12,0,0,0-17,0L173.94,65.09l-2.54-2.55a36.05,36.05,0,0,0-50.91,0L100,83l-3.51-3.52a12,12,0,0,0-17,17L83,100,62.54,120.49a36,36,0,0,0,0,50.91l2.55,2.54L15.51,223.51a12,12,0,0,0,17,17l49.57-49.58,2.54,2.55a36.06,36.06,0,0,0,50.91,0L156,173l3.51,3.52a12,12,0,0,0,17-17L173,156l20.49-20.49a36,36,0,0,0,0-50.91l-2.55-2.54,49.58-49.57A12,12,0,0,0,240.49,15.51Zm-121.95,161a12,12,0,0,1-17,0L79.51,154.43a12,12,0,0,1,0-17L100,117l39,39Zm58-57.95h0L156,139l-39-39,20.49-20.49a12,12,0,0,1,17,0l22.06,22.06a12,12,0,0,1,0,17ZM85.27,33.37a12,12,0,0,1,21.46-10.74l8,16A12,12,0,1,1,93.27,49.37Zm-68,57.26a12,12,0,0,1,16.1-5.36l16,8a12,12,0,1,1-10.74,21.46l-16-8A12,12,0,0,1,17.27,90.63Zm221.46,74.74a12,12,0,0,1-16.1,5.36l-16-8a12,12,0,0,1,10.74-21.46l16,8A12,12,0,0,1,238.73,165.37Zm-68,57.26a12,12,0,1,1-21.46,10.74l-8-16a12,12,0,0,1,21.46-10.74Z`}))],[`duotone`,D.createElement(D.Fragment,null,D.createElement(`path`,{d:`M185,127,127,185a24,24,0,0,1-33.94,0L71,162.91A24,24,0,0,1,71,129L129,71a24,24,0,0,1,33.94,0L185,93.09A24,24,0,0,1,185,127Z`,opacity:`0.2`}),D.createElement(`path`,{d:`M237.66,18.34a8,8,0,0,0-11.32,0l-52.4,52.41-5.37-5.38a32.05,32.05,0,0,0-45.26,0L100,88.69l-6.34-6.35A8,8,0,0,0,82.34,93.66L88.69,100,65.37,123.31a32,32,0,0,0,0,45.26l5.38,5.37-52.41,52.4a8,8,0,0,0,11.32,11.32l52.4-52.41,5.37,5.38a32.06,32.06,0,0,0,45.26,0L156,167.31l6.34,6.35a8,8,0,0,0,11.32-11.32L167.31,156l23.32-23.31a32,32,0,0,0,0-45.26l-5.38-5.37,52.41-52.4A8,8,0,0,0,237.66,18.34Zm-116.29,161a16,16,0,0,1-22.62,0L76.69,157.25a16,16,0,0,1,0-22.62L100,111.31,144.69,156Zm57.94-57.94h0L156,144.69,111.31,100l23.32-23.31a16,16,0,0,1,22.62,0l22.06,22a16,16,0,0,1,0,22.63ZM88.57,35A8,8,0,0,1,103.43,29l8,20A8,8,0,0,1,96.57,55ZM24.57,93A8,8,0,0,1,35,88.57l20,8A8,8,0,0,1,49,111.43l-20-8A8,8,0,0,1,24.57,93ZM231.43,163a8,8,0,0,1-10.4,4.46l-20-8A8,8,0,1,1,207,144.57l20,8A8,8,0,0,1,231.43,163Zm-64,58.06A8,8,0,0,1,152.57,227l-8-20A8,8,0,0,1,159.43,201Z`}))],[`fill`,D.createElement(D.Fragment,null,D.createElement(`path`,{d:`M88.57,35A8,8,0,0,1,103.43,29l8,20A8,8,0,0,1,96.57,55ZM29,103.43l20,8A8,8,0,1,0,55,96.57l-20-8A8,8,0,0,0,29,103.43ZM227,152.57l-20-8A8,8,0,1,0,201,159.43l20,8A8,8,0,0,0,227,152.57ZM159.43,201A8,8,0,0,0,144.57,207l8,20A8,8,0,1,0,167.43,221ZM237.91,18.52a8,8,0,0,0-11.5-.18L174,70.75l-5.38-5.38a32,32,0,0,0-45.28,0L106.14,82.54a4,4,0,0,0,0,5.66l61.7,61.66a4,4,0,0,0,5.66,0l16.74-16.74a32.76,32.76,0,0,0,9.81-22.52,31.82,31.82,0,0,0-9.37-23.17l-5.38-5.37,52.2-52.17A8.22,8.22,0,0,0,237.91,18.52ZM85.64,90.34a8,8,0,0,0-11.49.18,8.22,8.22,0,0,0,.41,11.37L80.67,108,65.34,123.31A31.82,31.82,0,0,0,56,146.47,32.75,32.75,0,0,0,65.77,169l5,4.94L18.49,226.13a8.21,8.21,0,0,0-.61,11.1,8,8,0,0,0,11.72.43L82,185.25l5.37,5.38a32.1,32.1,0,0,0,45.29,0L148,175.31l6.34,6.35a8,8,0,0,0,11.32-11.32Z`}))],[`light`,D.createElement(D.Fragment,null,D.createElement(`path`,{d:`M236.24,19.76a6,6,0,0,0-8.48,0L173.94,73.57l-6.79-6.78a30,30,0,0,0-42.42,0L100,91.51l-7.76-7.75a6,6,0,0,0-8.48,8.48L91.51,100,66.79,124.73a30,30,0,0,0,0,42.42l6.78,6.79L19.76,227.76a6,6,0,1,0,8.48,8.48l53.82-53.81,6.79,6.78a30,30,0,0,0,42.42,0L156,164.49l7.76,7.75a6,6,0,0,0,8.48-8.48L164.49,156l24.72-24.73a30,30,0,0,0,0-42.42l-6.78-6.79,53.81-53.82A6,6,0,0,0,236.24,19.76Zm-113.45,161a18,18,0,0,1-25.46,0L75.27,158.67a18,18,0,0,1,0-25.46L100,108.49,147.51,156Zm57.94-57.94L156,147.51,108.49,100l24.72-24.73a18,18,0,0,1,25.46,0l22.06,22.06a18,18,0,0,1,0,25.46ZM90.43,34.23a6,6,0,0,1,11.14-4.46l8,20a6,6,0,1,1-11.14,4.46Zm-64,59.54a6,6,0,0,1,7.8-3.34l20,8a6,6,0,1,1-4.46,11.14l-20-8A6,6,0,0,1,26.43,93.77Zm203.14,68.46a6,6,0,0,1-7.8,3.34l-20-8a6,6,0,0,1,4.46-11.14l20,8A6,6,0,0,1,229.57,162.23Zm-64,59.54a6,6,0,1,1-11.14,4.46l-8-20a6,6,0,0,1,11.14-4.46Z`}))],[`regular`,D.createElement(D.Fragment,null,D.createElement(`path`,{d:`M237.66,18.34a8,8,0,0,0-11.32,0l-52.4,52.41-5.37-5.38a32.05,32.05,0,0,0-45.26,0L100,88.69l-6.34-6.35A8,8,0,0,0,82.34,93.66L88.69,100,65.37,123.31a32,32,0,0,0,0,45.26l5.38,5.37-52.41,52.4a8,8,0,0,0,11.32,11.32l52.4-52.41,5.37,5.38a32,32,0,0,0,45.26,0L156,167.31l6.34,6.35a8,8,0,0,0,11.32-11.32L167.31,156l23.32-23.31a32,32,0,0,0,0-45.26l-5.38-5.37,52.41-52.4A8,8,0,0,0,237.66,18.34Zm-116.29,161a16,16,0,0,1-22.62,0L76.69,157.25a16,16,0,0,1,0-22.62L100,111.31,144.69,156Zm57.94-57.94L156,144.69,111.31,100l23.32-23.31a16,16,0,0,1,22.62,0l22.06,22A16,16,0,0,1,179.31,121.37ZM88.57,35A8,8,0,0,1,103.43,29l8,20A8,8,0,0,1,96.57,55ZM24.57,93A8,8,0,0,1,35,88.57l20,8A8,8,0,0,1,49,111.43l-20-8A8,8,0,0,1,24.57,93ZM231.43,163a8,8,0,0,1-10.4,4.46l-20-8A8,8,0,1,1,207,144.57l20,8A8,8,0,0,1,231.43,163Zm-64,58.06A8,8,0,0,1,152.57,227l-8-20A8,8,0,0,1,159.43,201Z`}))],[`thin`,D.createElement(D.Fragment,null,D.createElement(`path`,{d:`M234.83,21.17a4,4,0,0,0-5.66,0L173.94,76.4l-8.2-8.2a28,28,0,0,0-39.6,0L100,94.34l-9.17-9.17a4,4,0,0,0-5.66,5.66L94.34,100,68.2,126.14a28,28,0,0,0,0,39.6l8.2,8.2L21.17,229.17a4,4,0,0,0,5.66,5.66L82.06,179.6l8.2,8.2a28,28,0,0,0,39.6,0L156,161.66l9.17,9.17a4,4,0,0,0,5.66-5.66L161.66,156l26.14-26.14a28,28,0,0,0,0-39.6l-8.2-8.2,55.23-55.23A4,4,0,0,0,234.83,21.17Zm-110.63,161a20,20,0,0,1-28.28,0L73.86,160.08a20,20,0,0,1,0-28.28L100,105.66,150.34,156Zm57.94-57.94L156,150.34,105.66,100,131.8,73.86a20,20,0,0,1,28.28,0l22.06,22.06A20,20,0,0,1,182.14,124.2ZM92.29,33.49a4,4,0,1,1,7.42-3l8,20a4,4,0,0,1-2.22,5.2A3.91,3.91,0,0,1,104,56a4,4,0,0,1-3.71-2.51Zm-64,61a4,4,0,0,1,5.2-2.22l20,8A4,4,0,0,1,52,108a3.91,3.91,0,0,1-1.49-.29l-20-8A4,4,0,0,1,28.29,94.51Zm199.42,67A4,4,0,0,1,224,164a3.91,3.91,0,0,1-1.49-.29l-20-8a4,4,0,1,1,3-7.42l20,8A4,4,0,0,1,227.71,161.49Zm-64,61a4,4,0,0,1-2.22,5.2A3.91,3.91,0,0,1,160,228a4,4,0,0,1-3.71-2.51l-8-20a4,4,0,0,1,7.42-3Z`}))]]),uO=new Map([[`bold`,D.createElement(D.Fragment,null,D.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`,D.createElement(D.Fragment,null,D.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`}),D.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`,D.createElement(D.Fragment,null,D.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`,D.createElement(D.Fragment,null,D.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`,D.createElement(D.Fragment,null,D.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`,D.createElement(D.Fragment,null,D.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`}))]]),dO=new Map([[`bold`,D.createElement(D.Fragment,null,D.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`,D.createElement(D.Fragment,null,D.createElement(`path`,{d:`M224,56V200a16,16,0,0,1-16,16H48V40H208A16,16,0,0,1,224,56Z`,opacity:`0.2`}),D.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`,D.createElement(D.Fragment,null,D.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`,D.createElement(D.Fragment,null,D.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`,D.createElement(D.Fragment,null,D.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`,D.createElement(D.Fragment,null,D.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`}))]]),fO=new Map([[`bold`,D.createElement(D.Fragment,null,D.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`,D.createElement(D.Fragment,null,D.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`}),D.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`,D.createElement(D.Fragment,null,D.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`,D.createElement(D.Fragment,null,D.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`,D.createElement(D.Fragment,null,D.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`,D.createElement(D.Fragment,null,D.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`}))]]),pO=new Map([[`bold`,D.createElement(D.Fragment,null,D.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`,D.createElement(D.Fragment,null,D.createElement(`path`,{d:`M184,128a56,56,0,1,1-56-56A56,56,0,0,1,184,128Z`,opacity:`0.2`}),D.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`,D.createElement(D.Fragment,null,D.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`,D.createElement(D.Fragment,null,D.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`,D.createElement(D.Fragment,null,D.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`,D.createElement(D.Fragment,null,D.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`}))]]),mO=D.forwardRef((e,t)=>D.createElement(S,{ref:t,...e,weights:oO}));mO.displayName=`BookOpenIcon`;var hO=mO,gO=D.forwardRef((e,t)=>D.createElement(S,{ref:t,...e,weights:sO}));gO.displayName=`MagnifyingGlassIcon`;var _O=gO,vO=D.forwardRef((e,t)=>D.createElement(S,{ref:t,...e,weights:cO}));vO.displayName=`MoonIcon`;var yO=vO,bO=D.forwardRef((e,t)=>D.createElement(S,{ref:t,...e,weights:lO}));bO.displayName=`PlugsConnectedIcon`;var xO=bO,SO=D.forwardRef((e,t)=>D.createElement(S,{ref:t,...e,weights:uO}));SO.displayName=`PlusIcon`;var CO=SO,wO=D.forwardRef((e,t)=>D.createElement(S,{ref:t,...e,weights:dO}));wO.displayName=`SignOutIcon`;var TO=wO,EO=D.forwardRef((e,t)=>D.createElement(S,{ref:t,...e,weights:fO}));EO.displayName=`SparkleIcon`;var DO=EO,OO=D.forwardRef((e,t)=>D.createElement(S,{ref:t,...e,weights:pO}));OO.displayName=`SunIcon`;var kO=OO,AO=[`agent-threads`];async function jO(e){let t=await Te(e);if(!t.ok)throw Error(`Request failed (${t.status})`);return t.json()}var MO=[];for(let e=0;e<256;++e)MO.push((e+256).toString(16).slice(1));function NO(e,t=0){return(MO[e[t+0]]+MO[e[t+1]]+MO[e[t+2]]+MO[e[t+3]]+`-`+MO[e[t+4]]+MO[e[t+5]]+`-`+MO[e[t+6]]+MO[e[t+7]]+`-`+MO[e[t+8]]+MO[e[t+9]]+`-`+MO[e[t+10]]+MO[e[t+11]]+MO[e[t+12]]+MO[e[t+13]]+MO[e[t+14]]+MO[e[t+15]]).toLowerCase()}var PO=new Uint8Array(16);function FO(){return crypto.getRandomValues(PO)}var IO={};function LO(e,t,n){let r;if(e)r=zO(e.random??e.rng?.()??FO(),e.msecs,e.seq,t,n);else{let e=Date.now(),i=FO();RO(IO,e,i),r=zO(i,IO.msecs,IO.seq,t,n)}return t??NO(r)}function RO(e,t,n){return e.msecs??=-1/0,e.seq??=0,t>e.msecs?(e.seq=BO(n),e.msecs=t):(e.seq=e.seq+1|0,e.seq===0&&e.msecs++),e}function zO(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??=BO(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 BO(e){return(e[6]&127)<<24|e[7]<<16|e[8]<<8|e[9]}function VO(){return LO()}function HO(){let{setColorScheme:e}=qt(),t=Jt(`light`,{getInitialValueInEffect:!0}),n=t===`dark`?`light`:`dark`,[r,i]=(0,D.useState)(!1);return(0,O.jsx)(Gt,{label:`Switch to ${n} theme`,opened:r,children:(0,O.jsx)(Qe,{variant:`subtle`,color:`gray`,"aria-label":`Switch to ${n} theme`,onMouseEnter:()=>i(!0),onMouseLeave:()=>i(!1),onFocus:()=>i(!0),onBlur:()=>i(!1),onClick:()=>{i(!1),e(n)},children:t===`dark`?(0,O.jsx)(kO,{size:17,weight:`bold`}):(0,O.jsx)(yO,{size:17,weight:`bold`})})})}var UO={home:`https://fanout.run/start/what-fanout-is`,ingest:`https://fanout.run/start/send-telemetry`};async function WO(e,t){let n=new URLSearchParams({page_size:`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 GO({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=$t(),[f,p]=(0,D.useState)(``),[h]=ca(f.trim(),250),[g,_]=(0,D.useState)(null),[v,y]=(0,D.useState)(null),[b,x]=(0,D.useState)(``),[S,C]=(0,D.useState)(``),[ne,re]=(0,D.useState)(!1),ie=(0,D.useRef)(null);(0,D.useImperativeHandle)(u,()=>({focusSearch:()=>ie.current?.focus()}),[]),(0,D.useEffect)(()=>{r&&requestAnimationFrame(()=>ie.current?.focus())},[r]);let T=aO({queryKey:[...AO,h],queryFn:({pageParam:e})=>WO(h,e),initialPageParam:``,getNextPageParam:e=>e.next_cursor??void 0,enabled:e}),oe=gn({queryKey:gt,queryFn:ut,refetchInterval:3e4,staleTime:ft}),se=(0,D.useMemo)(()=>T.data?.pages.flatMap(e=>e.items)??[],[T.data]),ce=(0,D.useMemo)(()=>ZO(se),[se]),le=gn({queryKey:[`telemetry-schema`,`1h`],queryFn:()=>jO(`/api/telemetry/schema?window=1h`),enabled:!!h&&!!l,staleTime:6e4}),ue=(0,D.useMemo)(()=>{if(!h)return[];let e=h.toLowerCase();return(le.data?.services??[]).map(e=>e.value).filter(t=>t.toLowerCase().includes(e)).slice(0,6)},[le.data,h]),de=(0,D.useMemo)(()=>{let e=oe.data??[],t=h.toLowerCase();return t?e.filter(e=>e.name.toLowerCase().includes(t)):e},[oe.data,h]);function fe(e){C(``),x(e.title),_(e)}async function me(){if(g&&b.trim()){re(!0),C(``);try{let e=await Te(`/api/agent/threads/${encodeURIComponent(g.id)}`,{method:`PATCH`,headers:{"Content-Type":`application/json`},body:JSON.stringify({title:b.trim()})});if(!e.ok)throw Error(`Unable to rename chat (${e.status})`);await d.invalidateQueries({queryKey:AO}),_(null)}catch(e){C(e instanceof Error?e.message:`Unable to rename this chat.`)}finally{re(!1)}}}async function he(){if(v){re(!0),C(``);try{let e=await Te(`/api/agent/threads/${encodeURIComponent(v.id)}`,{method:`DELETE`});if(!e.ok)throw Error(`Unable to delete chat (${e.status})`);let t=v.id;y(null),await d.invalidateQueries({queryKey:AO}),await d.invalidateQueries({queryKey:gt}),o(t)}catch(e){C(e instanceof Error?e.message:`Unable to delete this chat.`)}finally{re(!1)}}}return(0,O.jsxs)(te,{gap:`sm`,h:`100%`,component:`nav`,"aria-label":`Navigation`,children:[e&&(0,O.jsx)(w,{leftSection:(0,O.jsx)(CO,{size:16,weight:`bold`}),onClick:i,children:`New chat`}),(0,O.jsx)(Wt,{type:`auto`,offsetScrollbars:!0,flex:1,mx:-4,px:4,children:(0,O.jsxs)(te,{gap:`lg`,pb:`sm`,children:[e&&(0,O.jsxs)(te,{gap:4,children:[(0,O.jsx)(KO,{children:`Chats`}),T.isLoading&&(0,O.jsx)(ve,{py:`md`,children:(0,O.jsx)(Se,{size:`xs`})}),T.isError&&(0,O.jsx)(pe,{color:`bad`,radius:`md`,p:`xs`,children:`Chats could not be loaded.`}),!T.isLoading&&!T.isError&&se.length===0&&(0,O.jsx)(ae,{c:`dimmed`,size:`sm`,px:`sm`,py:`xs`,children:h?`No matching chats`:`No chats yet`}),ce.map(e=>(0,O.jsxs)(te,{gap:2,children:[ce.length>1&&(0,O.jsx)(ae,{c:`dimmed`,size:`xs`,px:`sm`,pt:4,children:e.label}),e.threads.map(e=>(0,O.jsx)(qO,{thread:e,active:e.id===t,onSelect:()=>a(e.id),onRename:()=>fe(e),onDelete:()=>{C(``),y(e)}},e.id))]},e.label)),T.hasNextPage&&(0,O.jsx)(w,{variant:`subtle`,color:`gray`,size:`compact-sm`,loading:T.isFetchingNextPage,onClick:()=>void T.fetchNextPage(),children:`See all`})]}),h&&l&&le.isLoading&&(0,O.jsx)(ve,{py:`md`,children:(0,O.jsx)(Se,{size:`xs`})}),h&&l&&(le.isSuccess||le.isError)&&(0,O.jsxs)(te,{gap:4,children:[(0,O.jsx)(KO,{children:`Services`}),le.isError&&(0,O.jsx)(ae,{c:`dimmed`,size:`sm`,px:`sm`,children:`Services could not be searched`}),le.isSuccess&&ue.length===0&&(0,O.jsx)(ae,{c:`dimmed`,size:`sm`,px:`sm`,children:`No matching services`}),ue.map(e=>(0,O.jsx)(m,{className:`rail-row`,p:`sm`,onClick:()=>l(e),children:(0,O.jsx)(ae,{size:`sm`,fw:500,truncate:!0,children:e})},e))]}),(0,O.jsxs)(te,{gap:4,children:[(0,O.jsx)(KO,{children:`Dashboards`}),oe.isLoading&&(0,O.jsx)(ve,{py:`md`,children:(0,O.jsx)(Se,{size:`xs`})}),oe.isError&&(0,O.jsx)(pe,{color:`bad`,radius:`md`,p:`xs`,children:`Dashboards could not be loaded.`}),!oe.isLoading&&!oe.isError&&h&&de.length===0&&(0,O.jsx)(ae,{c:`dimmed`,size:`sm`,px:`sm`,py:`xs`,children:`No matching dashboards`}),de.map(e=>{let t=e.id===n;return(0,O.jsxs)(te,{gap:0,children:[(0,O.jsx)(m,{component:`a`,href:`/dashboards/${encodeURIComponent(e.id)}`,className:`rail-row`,"data-active":t||void 0,"aria-current":t?`page`:void 0,p:`sm`,onClick:t=>{t.button!==0||t.metaKey||t.ctrlKey||t.shiftKey||t.altKey||(t.preventDefault(),s(e.id))},children:(0,O.jsxs)(ee,{justify:`space-between`,gap:`sm`,wrap:`nowrap`,children:[(0,O.jsx)(ae,{size:`sm`,fw:t?600:500,truncate:!0,children:e.name}),e.is_default&&(0,O.jsx)(et,{size:`xs`,variant:`light`,color:`gray`,children:`Default`})]})}),e.origin&&(0,O.jsx)(m,{component:`a`,href:`/chat/${encodeURIComponent(e.origin.thread_id)}`,"data-request-provenance":!0,px:`sm`,pb:`xs`,onClick:t=>{t.button!==0||t.metaKey||t.ctrlKey||t.shiftKey||t.altKey||(t.preventDefault(),a(e.origin.thread_id))},children:(0,O.jsxs)(ae,{size:`xs`,c:`dimmed`,lineClamp:2,children:[`Built from: `,e.origin.request_excerpt]})})]},e.id)}),e&&(0,O.jsx)(w,{variant:`subtle`,color:`gray`,size:`compact-sm`,justify:`flex-start`,leftSection:(0,O.jsx)(DO,{size:14,weight:`fill`}),onClick:c,children:oe.data?.length===0?`New dashboard`:`Create with AI`})]})]})}),(0,O.jsx)(ke,{ref:ie,value:f,onChange:e=>p(e.currentTarget.value),leftSection:(0,O.jsx)(_O,{size:15}),rightSection:(0,O.jsx)(_t,{size:`xs`,children:`⌘K`}),rightSectionWidth:44,placeholder:`Search`,"aria-label":`Search chats, dashboards and services`,size:`sm`}),(0,O.jsx)(Xt,{opened:g!==null,onClose:()=>!ne&&_(null),title:`Rename chat`,centered:!0,children:(0,O.jsx)(`form`,{onSubmit:e=>{e.preventDefault(),me()},children:(0,O.jsxs)(te,{children:[(0,O.jsx)(ke,{label:`Name`,value:b,onChange:e=>x(e.currentTarget.value),maxLength:120,autoFocus:!0}),S&&(0,O.jsx)(pe,{color:`bad`,children:S}),(0,O.jsxs)(ee,{justify:`flex-end`,children:[(0,O.jsx)(w,{variant:`default`,onClick:()=>_(null),disabled:ne,children:`Cancel`}),(0,O.jsx)(w,{type:`submit`,loading:ne,disabled:!b.trim(),children:`Save`})]})]})})}),(0,O.jsx)(Xt,{opened:v!==null,onClose:()=>!ne&&y(null),title:`Delete chat?`,centered:!0,children:(0,O.jsxs)(te,{children:[(0,O.jsxs)(ae,{size:`sm`,children:[`This permanently removes `,(0,O.jsx)(ae,{span:!0,fw:650,children:v?.title}),` and its saved messages.`]}),S&&(0,O.jsx)(pe,{color:`bad`,children:S}),(0,O.jsxs)(ee,{justify:`flex-end`,children:[(0,O.jsx)(w,{variant:`default`,onClick:()=>y(null),disabled:ne,children:`Cancel`}),(0,O.jsx)(w,{color:`bad`,loading:ne,onClick:()=>void he(),children:`Delete`})]})]})})]})}function KO({children:e}){return(0,O.jsx)(ae,{c:`dimmed`,size:`xs`,fw:700,tt:`uppercase`,lts:`0.08em`,px:`sm`,children:e})}function qO({thread:e,active:t,onSelect:r,onRename:i,onDelete:a}){return(0,O.jsx)(n,{"data-active":t||void 0,className:`rail-row`,children:(0,O.jsxs)(ee,{gap:2,wrap:`nowrap`,children:[(0,O.jsx)(m,{onClick:r,"aria-current":t?`page`:void 0,p:`sm`,flex:1,style:{minWidth:0},children:(0,O.jsxs)(te,{gap:0,children:[(0,O.jsx)(ae,{size:`sm`,fw:t?600:500,truncate:!0,children:e.title}),(0,O.jsx)(ae,{c:`dimmed`,size:`xs`,children:QO(e.updated_at)})]})}),(0,O.jsxs)(pt,{position:`bottom-end`,withinPortal:!0,children:[(0,O.jsx)(pt.Target,{children:(0,O.jsx)(Qe,{className:`rail-row-actions`,variant:`subtle`,color:`gray`,size:`sm`,mr:4,"aria-label":`Actions for ${e.title}`,children:(0,O.jsx)(vt,{size:18,weight:`bold`})})}),(0,O.jsxs)(pt.Dropdown,{children:[(0,O.jsx)(pt.Item,{leftSection:(0,O.jsx)(dt,{size:15}),onClick:i,children:`Rename`}),(0,O.jsx)(pt.Item,{color:`bad`,leftSection:(0,O.jsx)(Vt,{size:15}),onClick:a,children:`Delete`})]})]})]})})}function JO(e){return e.includes(`T`)?new Date(e):new Date(`${e.replace(` `,`T`)}Z`)}function YO(e){return new Date(e.getFullYear(),e.getMonth(),e.getDate()).getTime()}var XO=[`Today`,`Yesterday`,`Previous 7 days`,`Older`];function ZO(e){let t=YO(new Date),n=new Map;for(let r of e){let e=Math.floor((t-YO(JO(r.updated_at)))/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 XO.filter(e=>n.has(e)).map(e=>({label:e,threads:n.get(e)}))}function QO(e){let t=JO(e),n=YO(new Date);return Math.floor((n-YO(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 $O({children:e}){let{agentAvailable:t,threadID:n,threadMissing:r,newThread:i,selectThread:a,openChat:o}=nt(),s=we(),c=sa({select:e=>e.location.pathname}),{dashboardId:l}=At({strict:!1}),u=c===`/chat`||c.startsWith(`/chat/`),[d,f]=la(!1),[p,m]=(0,D.useState)(!1),[h,g]=(0,D.useState)(``),_=(0,D.useRef)(null),v=ce(`(max-width: 62em)`),y=(0,D.useRef)(v);y.current=v,(0,D.useEffect)(()=>{f.close()},[c]),(0,D.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},search:{}}),onCreateDashboard:()=>o(Ye),onInvestigateService:e=>o(`Investigate the ${e} service. Explain its errors and latency.`)};return(0,O.jsxs)(po,{header:{height:52},navbar:{width:256,breakpoint:`md`,collapsed:{mobile:!0}},padding:0,children:[(0,O.jsx)(po.Header,{children:(0,O.jsxs)(ee,{h:`100%`,px:{base:`sm`,sm:`md`},justify:`space-between`,wrap:`nowrap`,children:[(0,O.jsxs)(ee,{gap:`sm`,wrap:`nowrap`,children:[(0,O.jsx)(Do,{hiddenFrom:`md`,opened:d,onClick:()=>{m(!1),f.toggle()},size:`sm`,"aria-label":d?`Close navigation`:`Open navigation`}),(0,O.jsx)(ge,{size:`small`})]}),(0,O.jsxs)(ee,{gap:`xs`,wrap:`nowrap`,children:[(0,O.jsx)(Gt,{label:`Documentation`,children:(0,O.jsx)(Qe,{component:`a`,href:UO.home,target:`_blank`,rel:`noopener noreferrer`,variant:`subtle`,color:`gray`,"aria-label":`Documentation`,children:(0,O.jsx)(hO,{size:17,weight:`bold`})})}),(0,O.jsx)(HO,{}),(0,O.jsx)(ek,{onError:g})]})]})}),(0,O.jsx)(po.Navbar,{p:`sm`,children:(0,O.jsx)(GO,{ref:_,...b})}),(0,O.jsx)(yt,{opened:d,onClose:f.close,hiddenFrom:`md`,size:288,padding:`sm`,title:(0,O.jsx)(ge,{size:`small`}),overlayProps:{backgroundOpacity:.24,blur:1},children:(0,O.jsx)(GO,{...b,autoFocusSearch:d&&p})}),(0,O.jsxs)(po.Main,{children:[h&&(0,O.jsx)(pe,{color:`bad`,m:`md`,withCloseButton:!0,onClose:()=>g(``),children:h}),e]})]})}function ek({onError:e}){let t=we(),n=Oe(),r=(n.display_name.trim()||n.email.trim()||`?`).charAt(0).toUpperCase();return(0,O.jsxs)(pt,{position:`bottom-end`,withinPortal:!0,shadow:`md`,children:[(0,O.jsx)(pt.Target,{children:(0,O.jsx)(Qe,{variant:`subtle`,color:`gray`,size:`lg`,radius:`xl`,"aria-label":`Account menu`,children:(0,O.jsx)(wo,{size:26,radius:`xl`,color:`brand`,children:r})})}),(0,O.jsxs)(pt.Dropdown,{children:[(0,O.jsx)(pt.Label,{children:n.email||`Signed in`}),(0,O.jsx)(pt.Item,{leftSection:(0,O.jsx)(xO,{size:15}),onClick:()=>void t({to:`/settings`}),children:`Connect telemetry`}),(0,O.jsx)(pt.Divider,{}),(0,O.jsx)(pt.Item,{leftSection:(0,O.jsx)(TO,{size:15}),onClick:()=>void E().catch(t=>e(t instanceof Error?t.message:`Sign-out failed — your session is still active.`)),children:`Sign out`})]})]})}function tk(){let{agent_available:e}=Ee(),t=we(),n=$t(),{threadId:r}=At({strict:!1}),[i,a]=(0,D.useState)(VO),o=(0,D.useRef)(new Set),s=r??i,[c,l]=(0,D.useState)([]),[u,d]=(0,D.useState)({}),[f,p]=(0,D.useState)(``),[m,h]=(0,D.useState)(!1),[g,_]=(0,D.useState)(!1),[v,y]=(0,D.useState)(``),[b,ee]=(0,D.useState)(null),x=(0,D.useRef)(null),[S,C]=(0,D.useState)(!1),te=(0,D.useRef)(!1),[ne,w]=(0,D.useState)(``),[re,ie]=(0,D.useState)(``),[ae,T]=(0,D.useState)(0),oe=(0,D.useRef)(null),se=(0,D.useRef)({}),ce=(0,D.useRef)(null),le=(0,D.useRef)(new Map),ue=(0,D.useMemo)(()=>new $D({url:`/api/agent/runs`,threadId:s,fetch:(e,t)=>Te(e,t)}),[s]),de=!e||f===s;function fe(){le.current.clear(),y(``),x.current=null,ee(null)}let pe=e=>e.filter(e=>e.role!==`reasoning`);function me(){let e=x.current?.text.split(/(?<=[.!?])\s/)[0]?.trim().replace(/[.!?]+$/,``);return e?e+`…`:``}function he(e){return te.current||e instanceof Error&&e.name===`AbortError`}(0,D.useEffect)(()=>{let t=!0;if(l([]),se.current={},d({}),p(``),h(!1),_(!1),te.current=!1,C(!1),fe(),ie(``),!e){p(s);return}!r||o.current.has(s)?(ue.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}ue.setMessages(pe(e.messages??[])),l(pe(e.messages??[])),p(s)}}).catch(()=>{t&&(oe.current=null,ie(`This chat could not be restored. Start a new chat or try again.`))});let i=ue.subscribe({onEvent:({event:e,messages:t})=>{switch(e.type){case`REASONING_MESSAGE_START`:return x.current={id:e.messageId,text:``,collapsed:!1},ee(x.current),y(``),{stopPropagation:!0};case`REASONING_MESSAGE_CONTENT`:{let t=e,n={id:t.messageId,text:(x.current?.text??``)+t.delta,collapsed:!1};return x.current=n,ee(n),{stopPropagation:!0}}case`REASONING_START`:case`REASONING_MESSAGE_END`:case`REASONING_END`:return{stopPropagation:!0};default:l(pe(t))}},onMessagesChanged:({messages:e})=>l(pe(e)),onRunInitialized:()=>{te.current=!1,C(!1),_(!0),ie(``)},onTextMessageContentEvent:({event:e})=>{e.delta&&(x.current=null,ee(null),y(``))},onToolCallStartEvent:({event:e})=>{le.current.set(e.toolCallId,tt(e.toolCallName)),y(tt(e.toolCallName)),x.current&&(x.current={...x.current,collapsed:!0},ee(x.current))},onToolCallResultEvent:({event:e,messages:t})=>{le.current.delete(e.toolCallId),y([...le.current.values()].at(-1)??me());let r=it(e.toolCallId,e.content,t);r&&(n.invalidateQueries({queryKey:gt}),n.invalidateQueries({queryKey:[`dashboard`,r.id]}),n.invalidateQueries({queryKey:[`dashboard-versions`,r.id]}))},onRunErrorEvent:({event:e})=>{e.code===`abort`||te.current?(ie(``),C(!0)):(console.warn(`Agent run error`,e.code),ie(Ke(e.code))),_(!1),fe()},onRunFinalized:({messages:e})=>{let t=pe(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),fe(),o.current.delete(s),n.invalidateQueries({queryKey:AO})},onRunFailed:e=>{he(e.error)?(ie(``),C(!0)):(console.error(`Agent run failed`,e),ie(Ke())),_(!1),fe(),o.current.delete(s),n.invalidateQueries({queryKey:AO})}});return()=>{t=!1,i.unsubscribe(),ue.abortRun()}},[ue,e,n,ae,s]),(0,D.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(()=>ce.current?.focus()):t({to:`/chat`}).then(()=>requestAnimationFrame(()=>ce.current?.focus()))),e.key===`Escape`&&n===ce.current&&(w(``),ce.current?.blur())};return window.addEventListener(`keydown`,n),()=>window.removeEventListener(`keydown`,n)},[e,t,r]);async function ge(){_(!0),ie(``);try{await ue.runAgent({forwardedProps:{...se.current}})}catch(e){he(e)?(ie(``),C(!0)):(console.error(`Agent run failed`,e),ie(Ke())),_(!1),fe(),o.current.delete(s)}}async function _e(n,i){let a=n.trim();if(!e||!a||g||!de||m)return;se.current={...i},r||(o.current.add(s),t({to:`/chat/$threadId`,params:{threadId:s},replace:!0}));let c={id:VO(),role:`user`,content:a};ue.addMessage(c),l([...ue.messages]),d(e=>({...e,[c.id]:Date.now()})),w(``),await ge()}(0,D.useEffect)(()=>{let e=oe.current;de&&r&&e&&(oe.current=null,_e(e.text,e.options))},[de,r,s]);function ve(e){e.preventDefault(),_e(ne)}function ye(){te.current=!0,ie(``),C(!0),ue.abortRun(),_(!1),fe(),o.current.delete(s)}function be(){!g&&ue.messages.some(e=>e.role===`user`)&&ge()}function xe(n,r){if(!e)return;let i=VO();o.current.add(i),oe.current=n?{text:n,options:{...r}}:null,t({to:`/chat/$threadId`,params:{threadId:i}})}function Se(){ue.abortRun(),oe.current=null,se.current={},a(VO()),t({to:`/chat`})}function Ce(e){oe.current=null,se.current={},t({to:`/chat/$threadId`,params:{threadId:e}})}function E(){T(e=>e+1)}return(0,O.jsx)($e.Provider,{value:{agentAvailable:e,threadID:s,threadMissing:m,messages:c,messageTimes:u,ready:de,running:g,activity:v,provisional:b,stopped:S,input:ne,setInput:w,error:re,inputRef:ce,send:_e,submit:ve,stop:ye,retry:be,reloadThread:E,openChat:xe,newThread:Se,selectThread:Ce},children:(0,O.jsx)($O,{children:(0,O.jsx)(Zi,{})})})}function nk(){let e=(0,D.useMemo)(()=>new iO,[]);return(0,O.jsx)(yn,{client:e,children:(0,O.jsx)(Ae,{children:(0,O.jsx)(tk,{})})})}var rk=Ft({component:nk,notFoundComponent:()=>(0,O.jsx)(je,{to:`/`,replace:!0})}),ik=Nt(`/`)({component:Rt(()=>rt(()=>import(`./routes-BG-WXnZu.js`),__vite__mapDeps([0,1,2])),`component`)}),ak=Nt(`/settings`)({component:Rt(()=>rt(()=>import(`./settings-B84LToTG.js`),__vite__mapDeps([3,1,2,4,5,6,7,8])),`component`)}),ok=Nt(`/chat/`)({component:Rt(()=>rt(()=>import(`./chat.index-DBWfXIEO.js`),__vite__mapDeps([9,10,1,11,4,5,12])),`component`)}),sk=Nt(`/chat/$threadId`)({component:Rt(()=>rt(()=>import(`./chat._threadId-DBWfXIEO.js`),__vite__mapDeps([13,10,1,11,4,5,12])),`component`)}),ck=Nt(`/dashboards/`)({component:Rt(()=>rt(()=>import(`./dashboards.index-DSrwtH-W.js`),__vite__mapDeps([14,1,2,15,11,5,4,16,6,7,17,12,8])),`component`),validateSearch:e=>Et(Ct(e))}),lk=Nt(`/dashboards/$dashboardId`)({component:Rt(()=>rt(()=>import(`./dashboards._dashboardId-DIT-HJy_.js`),__vite__mapDeps([18,1,2,15,11,5,4,16,6,7,17,12,8])),`component`),validateSearch:e=>Et(Ct(e))}),uk=ik.update({id:`/`,path:`/`,getParentRoute:()=>rk}),dk=ak.update({id:`/settings`,path:`/settings`,getParentRoute:()=>rk}),fk=ok.update({id:`/chat/`,path:`/chat/`,getParentRoute:()=>rk}),pk=sk.update({id:`/chat/$threadId`,path:`/chat/$threadId`,getParentRoute:()=>rk}),mk=ck.update({id:`/dashboards/`,path:`/dashboards/`,getParentRoute:()=>rk}),hk={IndexRoute:uk,SettingsRoute:dk,ChatThreadIdRoute:pk,DashboardsDashboardIdRoute:lk.update({id:`/dashboards/$dashboardId`,path:`/dashboards/$dashboardId`,getParentRoute:()=>rk}),ChatIndexRoute:fk,DashboardsIndexRoute:mk},gk=ra({routeTree:rk._addFileChildren(hk)._addFileTypes(),parseSearch:Bt,stringifySearch:ht,defaultPreload:`intent`,scrollRestoration:!0}),_k=wt(_),vk=Ea({...Mt,variantColorResolver:_k});(0,Fo.createRoot)(document.getElementById(`root`)).render((0,O.jsx)(D.StrictMode,{children:(0,O.jsx)(Ta,{theme:vk,defaultColorScheme:`auto`,cssVariablesResolver:Lt,children:(0,O.jsx)(oa,{router:gk})})}));export{a_ as A,Cv as C,uv as D,V as E,Fu as F,Zm as M,qm as N,nv as O,Km as P,cv as S,gv as T,Hv as _,S_ as a,iv as b,vv as c,W as d,ov as f,mv as g,E_ as h,jO as i,$g as j,A_ as k,$_ as l,fv as m,ck as n,x_ as o,U as p,UO as r,K_ as s,lk as t,Z_ as u,K as v,qv as w,q_ as x,G as y}; \ No newline at end of file +`),t=JSON.parse(e);n?.event(`SSE`,`Event received:`,t,{type:t?.type}),r.next(t)}catch(e){r.error(e)}}return r.asObservable()},CE=10485760,wE=()=>typeof process<`u`&&!!{}.SUPPRESS_TRANSFORMATION_WARNINGS,TE=(e,t)=>{let n=dE(t),r=new xc,i=new Uint8Array,a=!1;e.subscribe({next:e=>{if(e.type!==yE.HEADERS&&e.type===yE.DATA&&e.data){let t=new Uint8Array(i.length+e.data.length);t.set(i,0),t.set(e.data,i.length),i=t,o()}},error:e=>r.error(e),complete:()=>{if(o(),!a){if(i.length>0){r.error(Error(`The binary stream ended mid-frame: ${i.length} trailing bytes could not be read as a complete message.`));return}r.complete()}}});function o(){if(!a)for(;i.length>=4;){let e=4+new DataView(i.buffer,i.byteOffset,4).getUint32(0,!1);if(e>CE){r.error(Error(`Protobuf message size exceeded maximum limit of ${CE/1048576} MB`));return}if(i.length{let n=dE(t),r=new xc,i=new wc(1),a=!1,o,s=!1,c=()=>{s=!0,o?.unsubscribe()},l=e=>{c(),r.error(e)},u=()=>{c(),r.complete()};return o=e.subscribe({next:e=>{if(i.next(e),e.type===yE.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`?TE(i,n).subscribe({next:e=>r.next(e),error:e=>l(e),complete:()=>u()}):SE(i,n).subscribe({next:e=>{if(typeof e!=`object`||!e||Array.isArray(e)){let t=Error(`Invalid event: the frame is not a JSON object.`);n?.event(`HTTP`,`Event invalid:`,{json:e,error:String(t)}),l(t);return}let t=e;if(typeof t.type!=`string`||t.type.length===0){let t=Error(`Invalid event: the frame carries no event type.`);n?.event(`HTTP`,`Event invalid:`,{json:e,error:String(t)}),l(t);return}n?.event(`HTTP`,`Event received:`,e,{type:t.type}),r.next(e)},error:e=>{if(e?.name===`AbortError`){r.next({type:A.RUN_ERROR,message:e.message||`Request aborted`,code:`abort`,rawEvent:e}),u();return}return l(e)},complete:()=>u()})}else a||l(Error(`No headers event received before data events`))},error:e=>{i.error(e),l(e)},complete:()=>{i.complete()}}),s&&o.unsubscribe(),r.asObservable()},DE={TextMessageStart:`TextMessageStart`,TextMessageContent:`TextMessageContent`,TextMessageEnd:`TextMessageEnd`,ActionExecutionStart:`ActionExecutionStart`,ActionExecutionArgs:`ActionExecutionArgs`,ActionExecutionEnd:`ActionExecutionEnd`,ActionExecutionResult:`ActionExecutionResult`,AgentStateMessage:`AgentStateMessage`,MetaEvent:`MetaEvent`,RunStarted:`RunStarted`,RunFinished:`RunFinished`,RunError:`RunError`,NodeStarted:`NodeStarted`,NodeFinished:`NodeFinished`},OE=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(` +`)};function kE(e,t){return Ho(t)&&AE(`[ag-ui][legacy] The result of tool call '${e}' carries content parts the legacy protocol cannot represent; only its text parts are bridged and the rest is dropped.`),Vo(t)}var AE=e=>{typeof process<`u`&&{}.SUPPRESS_TRANSFORMATION_WARNINGS||console.warn(e)},jE=(e,t,n)=>r=>{let i={},a=!0,o=!0,s=``,c=null,l=null,u=[],d={},f=!1,p=e=>{typeof e==`object`&&e&&(`messages`in e&&delete e.messages,i=e)};return r.pipe(ll(r=>{switch(r.type){case A.TEXT_MESSAGE_START:{let e=r;return[{type:DE.TextMessageStart,messageId:e.messageId,role:e.role}]}case A.TEXT_MESSAGE_CONTENT:{let e=r;return[{type:DE.TextMessageContent,messageId:e.messageId,content:e.delta}]}case A.TEXT_MESSAGE_END:{let e=r;return[{type:DE.TextMessageEnd,messageId:e.messageId}]}case A.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:DE.ActionExecutionStart,actionExecutionId:e.toolCallId,actionName:e.toolCallName,parentMessageId:e.parentMessageId}]}case A.TOOL_CALL_ARGS:{let c=r,d=u.find(e=>e.id===c.toolCallId);if(!d)return AE(`[ag-ui][legacy] TOOL_CALL_ARGS: No tool call found with ID '${c.toolCallId}'`),[];d.function.arguments+=c.delta;let f=!1;if(l){let e=l.find(e=>e.tool==d.function.name);if(e)try{let t=JSON.parse(wl(d.function.arguments));e.tool_argument&&e.tool_argument in t?(p({...i,[e.state_key]:t[e.tool_argument]}),f=!0):e.tool_argument||(p({...i,[e.state_key]:t}),f=!0)}catch{}}return[{type:DE.ActionExecutionArgs,actionExecutionId:c.toolCallId,args:c.delta},...f?[{type:DE.AgentStateMessage,threadId:e,agentName:n,nodeName:s,runId:t,running:a,role:`assistant`,state:JSON.stringify(i),active:o}]:[]]}case A.TOOL_CALL_END:{let e=r;return[{type:DE.ActionExecutionEnd,actionExecutionId:e.toolCallId}]}case A.TOOL_CALL_RESULT:{let e=r,t=d[e.toolCallId];return(t===void 0||t===``)&&AE(`[ag-ui][legacy] No usable tool name was seen for tool call '${e.toolCallId}' (${t===void 0?`no TOOL_CALL_START reached this bridge`:`its TOOL_CALL_START carried an empty toolCallName`}), so its result is being bridged with the fabricated action name "unknown". Downstream consumers route on that name.`),[{type:DE.ActionExecutionResult,actionExecutionId:e.toolCallId,result:kE(e.toolCallId,e.content),actionName:t||`unknown`}]}case A.RAW:return f||(f=!0,AE(`[ag-ui][legacy] Dropping RAW events: the legacy runtime protocol has no equivalent, so the provider payloads they carry do not reach the legacy stream. Reported once per stream.`)),[];case A.CUSTOM:{let e=r;switch(e.name){case`Exit`:a=!1;break;case`PredictState`:l=e.value}return[{type:DE.MetaEvent,name:e.name,value:e.value}]}case A.STATE_SNAPSHOT:return p(r.snapshot),[{type:DE.AgentStateMessage,threadId:e,agentName:n,nodeName:s,runId:t,running:a,role:`assistant`,state:JSON.stringify(i),active:o}];case A.STATE_DELTA:{let c=r,l;try{l=Cs.applyPatch(i,c.delta,!0,!1).newDocument}catch(e){let t=e instanceof Error?e.message:String(e);return AE(`[ag-ui][legacy] Failed to apply state patch:\nCurrent state: ${JSON.stringify(i,null,2)}\nPatch operations: ${JSON.stringify(c.delta,null,2)}\nError: ${t}`),[]}return p(l),[{type:DE.AgentStateMessage,threadId:e,agentName:n,nodeName:s,runId:t,running:a,role:`assistant`,state:JSON.stringify(i),active:o}]}case A.MESSAGES_SNAPSHOT:return c=r.messages,[{type:DE.AgentStateMessage,threadId:e,agentName:n,nodeName:s,runId:t,running:a,role:`assistant`,state:JSON.stringify({...i,...c?{messages:c}:{}}),active:!0}];case A.RUN_STARTED:return[];case A.RUN_FINISHED:{if(c&&(i.messages=c),Object.keys(i).length===0)return[];let r=null;if(c)try{r=ME(c)}catch(e){return[{type:DE.RunError,message:e.message}]}return[{type:DE.AgentStateMessage,threadId:e,agentName:n,nodeName:s,runId:t,running:a,role:`assistant`,state:JSON.stringify({...i,...r?{messages:r}:{}}),active:!1}]}case A.RUN_ERROR:{let e=r;return[{type:DE.RunError,message:e.message,code:e.code}]}case A.STEP_STARTED:return s=r.stepName,u=[],l=null,[{type:DE.AgentStateMessage,threadId:e,agentName:n,nodeName:s,runId:t,running:a,role:`assistant`,state:JSON.stringify(i),active:!0}];case A.STEP_FINISHED:return u=[],l=null,[{type:DE.AgentStateMessage,threadId:e,agentName:n,nodeName:s,runId:t,running:a,role:`assistant`,state:JSON.stringify(i),active:!1}];default:return[]}}))};function ME(e){let t=[];for(let n of e)if(n.role===`assistant`||n.role===`user`||n.role===`system`){let e=OE(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;try{r=JSON.parse(e.function.arguments)}catch(t){throw Error(`Failed to parse arguments for tool call '${e.id}' (${e.function.name}): ${t.message}`)}let i={id:e.id,name:e.function.name,arguments:r,parentMessageId:n.id};t.push(i)}}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:kE(n.toolCallId,n.content),actionExecutionId:n.toolCallId,actionName:r};t.push(i)}return t}var NE=e=>e.kind===`tool`?e.fields.toolCallId:e.fields.messageId,PE=e=>e===`tool`?`toolCallId`:`messageId`,FE=(e,t,n,r,i)=>{if(r!==void 0&&r!==i)throw Error(`Cannot continue ${e} '${t}': chunk ${n} '${r}' does not match the open stream's ${n} ${i===void 0?`(absent)`:`'${i}'`}.`)},IE=(e,t)=>t.metadata===void 0?e:{...e,metadata:t.metadata},LE=(e,t)=>{let n=IE(e,t);return t.rawEvent===void 0?n:{...n,rawEvent:t.rawEvent}},RE=e=>new Set(Object.keys(e.shape)),zE=RE(ey),BE=RE(iy),VE=RE(Vy),HE=(e,t)=>{let n;for(let r of Object.keys(e))t.has(r)||((n??={})[r]=e[r]);return n},UE=e=>{typeof process<`u`&&{}.SUPPRESS_TRANSFORMATION_WARNINGS||console.warn(`[ag-ui][transform] ${e} Set SUPPRESS_TRANSFORMATION_WARNINGS=true to silence.`)},WE=(e,t,n,r)=>{if(t===void 0||n||e.length===0)return;let i=e[e.length-1],a=Object.keys(t).filter(e=>Object.prototype.hasOwnProperty.call(i,e));a.length>0&&UE(`A ${r} carried ${a.map(e=>`'${e}'`).join(`, `)}, which the synthesized ${String(i.type)} already describes. The synthesized value is kept and the chunk's is dropped — this stage does not judge a described field, so the producer's value cannot be substituted for its own.`),e[e.length-1]={...t,...i}},GE=e=>t=>{let n=dE(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:A.TEXT_MESSAGE_END,messageId:t.fields.messageId,...t.fields.subagentRunId!==void 0&&{subagentRunId:t.fields.subagentRunId}};return n?.event(`TRANSFORM`,`TEXT_MESSAGE_END`,e,{messageId:e.messageId}),[e]}case`tool`:{let e={type:A.TOOL_CALL_END,toolCallId:t.fields.toolCallId,...t.fields.subagentRunId!==void 0&&{subagentRunId:t.fields.subagentRunId}};return n?.event(`TRANSFORM`,`TOOL_CALL_END`,e,{toolCallId:e.toolCallId}),[e]}case`reasoning`:{let e={type:A.REASONING_MESSAGE_END,messageId:t.fields.messageId,...t.fields.subagentRunId!==void 0&&{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&&NE(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 ${PE(e)} nor a subagentRunId, but ${s.length} lanes have an open ${a}. Attribute the chunk to the subagent it belongs to.`)};return t.pipe(ll(e=>{switch(e.type){case A.TEXT_MESSAGE_START:case A.TEXT_MESSAGE_CONTENT:case A.TEXT_MESSAGE_END:case A.TOOL_CALL_START:case A.TOOL_CALL_ARGS:case A.TOOL_CALL_END:case A.TOOL_CALL_RESULT:case A.STATE_SNAPSHOT:case A.STATE_DELTA:case A.CUSTOM:case A.STEP_STARTED:case A.STEP_FINISHED:case A.REASONING_START:case A.REASONING_MESSAGE_START:case A.REASONING_MESSAGE_CONTENT:case A.REASONING_MESSAGE_END:case A.REASONING_END:return[...i(e.subagentRunId??void 0),e];case A.RUN_STARTED:case A.RUN_FINISHED:case A.RUN_ERROR:case A.MESSAGES_SNAPSHOT:return[...a(),e];case A.RAW:case A.ACTIVITY_SNAPSHOT:case A.ACTIVITY_DELTA:case A.REASONING_ENCRYPTED_VALUE:case A.SUBAGENT_STARTED:return[e];case A.SUBAGENT_FINISHED:case A.SUBAGENT_ERROR:{let t=e.subagentRunId;return t==null?[e]:[...i(t),e]}case A.TEXT_MESSAGE_CHUNK:{let t=e,a=HE(e,zE),o=s(`text`,t.messageId,t.subagentRunId??void 0,`TEXT_MESSAGE_CHUNK`,`text message`),c=r.get(o),l=[],u=!1,d;if(c?.kind===`text`&&(t.messageId===void 0||t.messageId===c.fields.messageId))FE(`text message`,c.fields.messageId,`role`,t.role,c.fields.role),FE(`text message`,c.fields.messageId,`name`,t.name,c.fields.name),d=c.fields;else{if(l.push(...i(o)),t.messageId===void 0)throw Error(`First TEXT_MESSAGE_CHUNK must have a messageId`);d={messageId:t.messageId,role:t.role===void 0?`assistant`:t.role,name:t.name,subagentRunId:t.subagentRunId},r.set(o,{kind:`text`,fields:d});let e=IE({type:A.TEXT_MESSAGE_START,messageId:t.messageId,role:d.role,...t.name!==void 0&&{name:t.name},...t.subagentRunId!==void 0&&{subagentRunId:t.subagentRunId}},t);l.push(e),n?.event(`TRANSFORM`,`TEXT_MESSAGE_START`,e,{messageId:t.messageId})}if(t.delta!==void 0||t.rawEvent!==void 0){let e=t.subagentRunId===void 0?d.subagentRunId:t.subagentRunId,r=LE({...a,type:A.TEXT_MESSAGE_CONTENT,messageId:d.messageId,delta:t.delta===void 0?``:t.delta,...e!==void 0&&{subagentRunId:e}},t);l.push(r),u=!0,n?.event(`TRANSFORM`,`TEXT_MESSAGE_CONTENT`,r,{messageId:d.messageId})}if(l.length===0&&(t.metadata!==void 0||t.rawEvent!==void 0||t.subagentRunId===null||a!==void 0)){let e=t.subagentRunId===void 0?d.subagentRunId:t.subagentRunId;l.push({...a,type:A.TEXT_MESSAGE_CONTENT,messageId:d.messageId,delta:``,...t.metadata!==void 0&&{metadata:t.metadata},...t.rawEvent!==void 0&&{rawEvent:t.rawEvent},...e!==void 0&&{subagentRunId:e}}),u=!0}return WE(l,a,u,`TEXT_MESSAGE_CHUNK`),l}case A.TOOL_CALL_CHUNK:{let t=e,a=HE(e,BE),o=s(`tool`,t.toolCallId,t.subagentRunId??void 0,`TOOL_CALL_CHUNK`,`tool call`),c=r.get(o),l=[],u=!1,d;if(c?.kind===`tool`&&(t.toolCallId===void 0||t.toolCallId===c.fields.toolCallId))FE(`tool call`,c.fields.toolCallId,`toolCallName`,t.toolCallName,c.fields.toolCallName),FE(`tool call`,c.fields.toolCallId,`parentMessageId`,t.parentMessageId,c.fields.parentMessageId),d=c.fields;else{if(l.push(...i(o)),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`);d={toolCallId:t.toolCallId,toolCallName:t.toolCallName,parentMessageId:t.parentMessageId,subagentRunId:t.subagentRunId},r.set(o,{kind:`tool`,fields:d});let e=IE({type:A.TOOL_CALL_START,toolCallId:t.toolCallId,toolCallName:t.toolCallName,...t.parentMessageId!==void 0&&{parentMessageId:t.parentMessageId},...t.subagentRunId!==void 0&&{subagentRunId:t.subagentRunId}},t);l.push(e),n?.event(`TRANSFORM`,`TOOL_CALL_START`,e,{toolCallId:t.toolCallId,toolCallName:t.toolCallName})}if(t.delta!==void 0||t.rawEvent!==void 0){let e=t.subagentRunId===void 0?d.subagentRunId:t.subagentRunId,r=LE({...a,type:A.TOOL_CALL_ARGS,toolCallId:d.toolCallId,delta:t.delta===void 0?``:t.delta,...e!==void 0&&{subagentRunId:e}},t);l.push(r),u=!0,n?.event(`TRANSFORM`,`TOOL_CALL_ARGS`,r,{toolCallId:d.toolCallId})}if(l.length===0&&(t.metadata!==void 0||t.rawEvent!==void 0||t.subagentRunId===null||a!==void 0)){let e=t.subagentRunId===void 0?d.subagentRunId:t.subagentRunId;l.push({...a,type:A.TOOL_CALL_ARGS,toolCallId:d.toolCallId,delta:``,...t.metadata!==void 0&&{metadata:t.metadata},...t.rawEvent!==void 0&&{rawEvent:t.rawEvent},...e!==void 0&&{subagentRunId:e}}),u=!0}return WE(l,a,u,`TOOL_CALL_CHUNK`),l}case A.REASONING_MESSAGE_CHUNK:{let t=e,a=HE(e,VE),o=s(`reasoning`,t.messageId,t.subagentRunId??void 0,`REASONING_MESSAGE_CHUNK`,`reasoning message`),c=r.get(o),l=[],u=!1,d;if(c?.kind===`reasoning`&&(t.messageId===void 0||t.messageId===c.fields.messageId))d=c.fields;else{if(l.push(...i(o)),t.messageId===void 0)throw Error(`First REASONING_MESSAGE_CHUNK must have a messageId`);d={messageId:t.messageId,subagentRunId:t.subagentRunId},r.set(o,{kind:`reasoning`,fields:d});let e=IE({type:A.REASONING_MESSAGE_START,messageId:t.messageId,role:`reasoning`,...t.subagentRunId!==void 0&&{subagentRunId:t.subagentRunId}},t);l.push(e),n?.event(`TRANSFORM`,`REASONING_MESSAGE_START`,e,{messageId:t.messageId})}if(t.delta!==void 0||t.rawEvent!==void 0){let e=t.subagentRunId===void 0?d.subagentRunId:t.subagentRunId,r=LE({...a,type:A.REASONING_MESSAGE_CONTENT,messageId:d.messageId,delta:t.delta===void 0?``:t.delta,...e!==void 0&&{subagentRunId:e}},t);l.push(r),u=!0,n?.event(`TRANSFORM`,`REASONING_MESSAGE_CONTENT`,r,{messageId:d.messageId})}if(l.length===0&&(t.metadata!==void 0||t.rawEvent!==void 0||t.subagentRunId===null||a!==void 0)){let e=t.subagentRunId===void 0?d.subagentRunId:t.subagentRunId;l.push({...a,type:A.REASONING_MESSAGE_CONTENT,messageId:d.messageId,delta:``,...t.metadata!==void 0&&{metadata:t.metadata},...t.rawEvent!==void 0&&{rawEvent:t.rawEvent},...e!==void 0&&{subagentRunId:e}}),u=!0}return WE(l,a,u,`REASONING_MESSAGE_CHUNK`),l}}return e.type,[e]}),yl(()=>{a()}))},KE=Symbol(`agui.strip.drop`);function qE(e){let t=e;for(;;){if(t instanceof FT||t instanceof LT||t instanceof zT||t instanceof YT||t instanceof GT){t=t.unwrap();continue}if(t instanceof qT){t=t.def.in;continue}if(t instanceof ZT){t=t.def.getter();continue}return t}}function JE(e){let t=e.def;return typeof t?.discriminator==`string`?t.discriminator:void 0}function YE(e){let t=e,n=Array.isArray(t.def?.values)?t.def.values:t.values?Array.from(t.values):void 0;return n&&n.length===1?n[0]:t.value}function XE(e){let t=qE(e);return t instanceof MT?YE(t):void 0}function ZE(e,t,n,r){let i=qE(t);if(i instanceof wT){if(typeof e!=`object`||!e||Array.isArray(e))return e;let t=i.shape,a=e,o={},s=i.meta()?.specOpen===!0;for(let e of Object.keys(a)){let i=Object.prototype.hasOwnProperty.call(t,e)?t[e]:void 0;if(i===void 0){if(s){o[e]=a[e];continue}r.push(`${n}/${e}`);continue}let c=r.length,l=ZE(a[e],i,`${n}/${e}`,r);if(l===KE){if(r.length=c,i.safeParse(void 0).success){r.push(`${n}/${e}`);continue}return KE}o[e]=l}return o}if(i instanceof ST){if(!Array.isArray(e))return e;let t=i.element,a=[];return e.forEach((e,i)=>{let o=r.length,s=ZE(e,t,`${n}/${i}`,r);if(s===KE){r.length=o,r.push(`${n}/${i}`);return}a.push(s)}),a}if(i instanceof kT){if(typeof e!=`object`||!e||Array.isArray(e))return e;let t=i.def.valueType,a=e,o={};for(let e of Object.keys(a)){let i=r.length,s=ZE(a[e],t,`${n}/${e}`,r);if(s===KE){r.length=i,r.push(`${n}/${e}`);continue}o[e]=s}return o}if(i instanceof TT){let t=i.options,a=JE(i);if(a!==void 0){if(typeof e!=`object`||!e||Array.isArray(e))return e;let i=e[a];for(let o of t){let t=qE(o);if(!(t instanceof wT))continue;let s=t.shape;if(XE(s[a])===i)return ZE(e,o,n,r)}return KE}let o=t.filter(e=>qE(e)instanceof wT),s=typeof e==`object`&&!!e&&!Array.isArray(e);if(o.length>1&&s)return e;for(let i of t){let t=qE(i);if(t instanceof ST&&Array.isArray(e)||t instanceof wT&&s)return ZE(e,i,n,r)}return e}return e}function QE(e,t){let n=[],r=ZE(e,t,``,n);if(r===KE)throw Error(`Internal error: the stripper found the whole value unrecognisable, which the schemas are not supposed to allow — schema/stripper mismatch.`);return{value:r,stripped:n}}var $E=new Set(Object.values(A));function eD(e){return $E.has(e.type)}var tD=new Map(qy.options.map(e=>{let t=e.shape;return[String(YE(t.type)),e]})),nD=()=>typeof process<`u`&&!!{}.SUPPRESS_TRANSFORMATION_WARNINGS;function rD(e){nD()||console.warn(`[ag-ui][enforce] ${e}`)}var iD=e=>t=>{let n=dE(e);return t.pipe(ll(e=>{if(!eD(e))return rD(`Dropping unrecognised event '${String(e.type)}': no middleware translated it and the protocol does not describe it.`),n?.event(`ENFORCE`,`Unrecognised event dropped:`,e,{type:e.type}),Tc;let t=tD.get(e.type);if(t===void 0)throw Error(`No validator for recognised event type '${String(e.type)}'`);let{value:r,stripped:i}=QE(e,t);for(let t of i)rD(`Removed unrecognised material at '${t}' on ${String(e.type)}. Nothing handled it; see the repo-root DEPRECATIONS.md if it is a retired shape.`);return il(t.parse(r))}))};function aD(e){let{value:t,stripped:n}=QE(Ro(e,`RunAgentInput`),Dy);for(let e of n)rD(`Removed unrecognised material at '${e}' from the outgoing input.`);return Dy.parse(t)}var oD=class{runNext(e,t){return t.run(e).pipe(GE(!1))}runNextWithState(e,t){let n=$(e.messages||[]),r=$(e.state===void 0?{}:e.state),i=new wc;return gE(e,i,t,[]).subscribe({next:e=>{e.messages!==void 0&&(n=e.messages),e.state!==void 0&&(r=e.state)},error:()=>{}}),this.runNext(e,t).pipe(hl(async e=>(i.next(e),await new Promise(e=>setTimeout(e,0)),{event:e,messages:$(n),state:$(r)})))}},sD=class extends oD{constructor(e){super(),this.fn=e}run(e,t){return this.fn(e,t)}};function cD(e){return e.startsWith(`image/`)?`image`:e.startsWith(`audio/`)?`audio`:e.startsWith(`video/`)?`video`:`document`}function lD(e){return typeof e==`object`&&!!e&&`type`in e&&e.type===`binary`&&`mimeType`in e&&typeof e.mimeType==`string`}function uD(e){let t=cD(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}}:{}}:((typeof process>`u`||!{}.SUPPRESS_TRANSFORMATION_WARNINGS)&&console.warn(`[ag-ui][compat] A binary content part carries only an id ('${e.id??``}') and cannot be converted to a modern media part; a 1.0 peer will not accept it. Provide data or a url. See the repo-root DEPRECATIONS.md.`),e)}function dD(e,t,n){if(typeof e!=`object`||!e||!(`type`in e)||e.type!==t.type||!(`source`in e))return!1;let r=e.source;return typeof r!=`object`||!r||!(`type`in r)||r.type!==t.source.type||!(`value`in r)||r.value!==t.source.value||!(`mimeType`in r)||r.mimeType!==t.source.mimeType?!1:!n||`metadata`in e&&typeof e.metadata==`object`&&e.metadata!==null&&`filename`in e.metadata&&e.metadata.filename===n}function fD(e){let t=e.content;if(!Array.isArray(t))return e;let n=t.flatMap(e=>{if(lD(e)){let n=uD(e);return n.type!==`binary`&&t.some(t=>dD(t,n,e.filename))?[]:[n]}return[e]});return{...e,content:n}}var pD=`THINKING_START`,mD=`THINKING_END`,hD=`THINKING_TEXT_MESSAGE_START`,gD=`THINKING_TEXT_MESSAGE_CONTENT`,_D=`THINKING_TEXT_MESSAGE_END`;function vD(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}var yD={event:[`rawEvent`,`subagentRunId`],[A.RUN_STARTED]:[`parentRunId`,`input`],[A.RUN_FINISHED]:[`result`,`outcome`],[A.RUN_ERROR]:[`usage`],[A.SUBAGENT_FINISHED]:[`result`],[A.TOOL_CALL_START]:[`parentMessageId`],[A.TOOL_CALL_CHUNK]:[`parentMessageId`],[A.TOOL_CALL_RESULT]:[`role`],"RUN_FINISHED.outcome":[`pendingToolCallIds`],"RUN_FINISHED.usage[]":[`provider`,`reasoningTokens`,`cachedInputTokens`,`cacheWriteInputTokens`],RunAgentInput:[`forwardedProps`],Tool:[`parameters`],ResumeEntry:[`payload`],"input content":[`metadata`]},bD=new Map(Object.entries(yD).filter(([e])=>Object.values(A).includes(e))),xD=e=>_E(e,`an absent field`);function SD(e,t,n,r){if(!vD(e))return e;let i;for(let a of t)e[a]===null&&(r(n===void 0?`${a}: null`:`${n}.${a}: null`),i??={...e},delete i[a]);return i??e}function CD(e,t,n){if(!vD(e)||!Array.isArray(e[t]))return e;let r=e[t],i=r.map(n);return i.some((e,t)=>e!==r[t])?{...e,[t]:i}:e}function wD(e,t){return CD(e,`content`,e=>{if(!vD(e))return e;switch(e.type){case`image`:case`audio`:case`video`:case`document`:return SD(e,yD[`input content`],`${e.type} input content`,t);default:return e}})}function TD(e,t=xD){let n=SD(e,yD.RunAgentInput,`RunAgentInput`,t);return n=CD(n,`tools`,e=>SD(e,yD.Tool,`Tool`,t)),n=CD(n,`resume`,e=>SD(e,yD.ResumeEntry,`ResumeEntry`,t)),CD(n,`messages`,e=>wD(e,t))}var ED=class extends oD{constructor(...e){super(...e),this.currentReasoningId=null,this.currentMessageId=null,this.nullsNoticedThisRun=new Set,this.noticeNullOncePerRun=e=>{this.nullsNoticedThisRun.has(e)||(this.nullsNoticedThisRun.add(e),_E(e,`an absent field`))}}warn(e,t){_E(e,t)}mintedContinuationId(e,t){if(t!==null)return t;let n=iE();return this.warnAside(`Minting a messageId ('${n}') for ${e}: no THINKING opener preceded it, so there was no id to continue. The id is this client's invention, not the producer's, and verification will reject the translated event for naming something nothing opened.`),n}warnAside(e){typeof process<`u`&&{}.SUPPRESS_TRANSFORMATION_WARNINGS||console.warn(`[ag-ui][compat] ${e} Set SUPPRESS_TRANSFORMATION_WARNINGS=true to silence.`)}run(e,t){return this.currentReasoningId=null,this.currentMessageId=null,this.nullsNoticedThisRun.clear(),e.messages=e.messages.map(fD),t.run(e).pipe(sl(e=>this.transformEvent(e)))}transformEvent(e){let t=this.noticeNullOncePerRun;e.type===A.RUN_STARTED&&this.nullsNoticedThisRun.clear(),e=SD(e,yD.event,void 0,t);let n=bD.get(e.type);switch(n&&(e=SD(e,n,e.type,t)),e.type){case pD:{this.currentReasoningId=iE();let{title:t,...n}=e;return this.warn(pD,A.REASONING_START),t!==void 0&&this.warnAside(`Dropping ${pD}.title ${JSON.stringify(t)}: ${A.REASONING_START} has no title field, so the span's label cannot be carried and nothing downstream can recover it.`),{...n,type:A.REASONING_START,messageId:this.currentReasoningId}}case hD:return this.currentMessageId=iE(),this.warn(hD,A.REASONING_MESSAGE_START),{...e,type:A.REASONING_MESSAGE_START,messageId:this.currentMessageId,role:`reasoning`};case gD:{let{delta:t,...n}=e;return this.warn(gD,A.REASONING_MESSAGE_CONTENT),{...n,type:A.REASONING_MESSAGE_CONTENT,messageId:this.mintedContinuationId(gD,this.currentMessageId),delta:t}}case _D:{let t=this.mintedContinuationId(_D,this.currentMessageId);return this.currentMessageId=null,this.warn(_D,A.REASONING_MESSAGE_END),{...e,type:A.REASONING_MESSAGE_END,messageId:t}}case mD:{let t=this.mintedContinuationId(mD,this.currentReasoningId);return this.currentReasoningId=null,this.warn(mD,A.REASONING_END),{...e,type:A.REASONING_END,messageId:t}}case A.RUN_FINISHED:{let n=e,r=SD(n.outcome,yD[`RUN_FINISHED.outcome`],`RUN_FINISHED.outcome`,t);return CD(r===n.outcome?n:{...n,outcome:r},`usage`,e=>SD(e,yD[`RUN_FINISHED.usage[]`],`RUN_FINISHED.usage[]`,t))}case A.MESSAGES_SNAPSHOT:{let t=e;return Array.isArray(t.messages)?{...t,messages:t.messages.map(e=>this.upgradeInboundMessage(e))}:e}case A.RUN_STARTED:{let n=TD(e.input,t),r=n===e.input?e:{...e,input:n},i=r;return!i.input||!Array.isArray(i.input.messages)?r:{...i,input:{...i.input,messages:i.input.messages.map(e=>this.upgradeInboundMessage(e))}}}default:return e}}upgradeInboundMessage(e){e=wD(e,this.noticeNullOncePerRun);let t=e.content;return!Array.isArray(t)||!t.some(e=>typeof e==`object`&&!!e&&e.type===`binary`)?e:(this.warn(`binary input content`,`the modern media content parts`),fD(e))}},DD=()=>e=>fl(()=>{let t=new ED;return e.pipe(sl(e=>t.transformEvent(e)))});function OD(e,t=new Date){return e.expiresAt!==void 0&&new Date(e.expiresAt)<=t}function kD(){return typeof process<`u`&&!!{}.SUPPRESS_TRANSFORMATION_WARNINGS}function AD(e){kD()||console.warn(`[ag-ui][compat] Flattening message content for a <=0.0.39 peer DROPS non-text parts (${e.join(`, `)}). The peer cannot receive them; upgrade it to keep media content. See the repo-root DEPRECATIONS.md.`)}function jD(e){kD()||console.warn(`[ag-ui][compat] Not flattening message content for a <=0.0.39 peer: ${e} content part(s) claim type "text" but carry a malformed 'text' value. That is a defect in the message, not media the peer cannot represent, and a downgrade must not repair it — the content is passed on unchanged so the outgoing enforcement boundary reports it. See the repo-root DEPRECATIONS.md.`)}function MD(e){let t=e.content;if(Array.isArray(t)){let n=e=>typeof e==`object`&&!!e&&`type`in e&&e.type===`text`,r=e=>n(e)&&typeof e.text==`string`,i=t.filter(e=>n(e)&&!r(e));if(i.length>0)return jD(i.length),e;let a=t.filter(e=>!r(e)).map(e=>typeof e==`object`&&e&&`type`in e?String(e.type):typeof e);a.length>0&&AD(a);let o=t.filter(r).map(e=>e.text).join(``);return{...e,content:o}}return typeof t==`string`?e:t===void 0?{...e,content:``}:e}var ND=class extends oD{run(e,t){let{parentRunId:n,...r}=e,i={...r,messages:r.messages.map(MD)};return this.runNext(i,t)}},PD=`THINKING_START`,FD=`THINKING_END`,ID=`THINKING_TEXT_MESSAGE_START`,LD=`THINKING_TEXT_MESSAGE_CONTENT`,RD=`THINKING_TEXT_MESSAGE_END`,zD=class extends oD{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(sl(e=>this.transformEvent(e)))}transformEvent(e){switch(e.type){case PD:{this.currentReasoningId=iE();let{title:t,...n}=e;return this.warnAboutTransformation(PD,A.REASONING_START),{...n,type:A.REASONING_START,messageId:this.currentReasoningId}}case ID:return this.currentMessageId=iE(),this.warnAboutTransformation(ID,A.REASONING_MESSAGE_START),{...e,type:A.REASONING_MESSAGE_START,messageId:this.currentMessageId,role:`reasoning`};case LD:{let{delta:t,...n}=e;return this.warnAboutTransformation(LD,A.REASONING_MESSAGE_CONTENT),{...n,type:A.REASONING_MESSAGE_CONTENT,messageId:this.currentMessageId??iE(),delta:t}}case RD:{let t=this.currentMessageId??iE();return this.warnAboutTransformation(RD,A.REASONING_MESSAGE_END),{...e,type:A.REASONING_MESSAGE_END,messageId:t}}case FD:{let t=this.currentReasoningId??iE();return this.warnAboutTransformation(FD,A.REASONING_END),{...e,type:A.REASONING_END,messageId:t}}default:return e}}},BD=`SUBAGENT_STARTED`,VD=`SUBAGENT_FINISHED`,HD=`SUBAGENT_ERROR`;function UD(e){if(e&&typeof e==`object`&&`subagentRunId`in e){let{subagentRunId:t,...n}=e;return n}return e}function WD(e){return e.map(e=>UD(e))}var GD=class extends oD{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=>UD(e))};return this.runNext(n,t).pipe(Sl(e=>{let t=e.type;(t===BD||t===VD||t===HD)&&this.warnDroppedLifecycleEvent(t)}),pl(e=>{let t=e.type;return t!==BD&&t!==VD&&t!==HD}),sl(e=>{let t=UD(e);if(t.type===A.MESSAGES_SNAPSHOT){let e=t;if(Array.isArray(e.messages))return{...e,messages:WD(e.messages)}}if(t.type===A.RUN_FINISHED){let e=t;if(e.outcome&&Array.isArray(e.outcome.interrupts))return{...e,outcome:{...e.outcome,interrupts:e.outcome.interrupts.map(e=>UD(e))}}}if(t.type===A.RUN_STARTED){let e=t;if(e.input&&Array.isArray(e.input.messages))return{...e,input:{...e.input,messages:WD(e.input.messages)}}}return t}))}},KD=`1.0.2`,qD=!1,JD=new WeakSet,YD=(e,t)=>/^\d+\.\d+$/.test(e)?wC(e,t)>0?`newer`:`not-newer`:`uninterpretable`,XD=e=>{let t=e.protocolVersion;if(t!==void 0&&t!==`1.0`)switch(YD(t,`1.0`)){case`uninterpretable`:console.warn(`[ag-ui] The producer declared protocol version '${t}', which this client cannot interpret.`);return;case`newer`:console.warn(`[ag-ui] The producer speaks protocol ${t}; this client speaks 1.0. Unrecognised material will be stripped with warnings.`);return;case`not-newer`:return}},ZD=class e{resolvePeerCeiling(t){if(this.resolvingPeerCeiling)return KD;let n=Object.getOwnPropertyDescriptor(this,`maxVersion`),r=Object.getOwnPropertyDescriptor(this,`maxProtocolVersion`),i=Object.getPrototypeOf(this);for(;i&&i!==e.prototype;)n??=Object.getOwnPropertyDescriptor(i,`maxVersion`),r??=Object.getOwnPropertyDescriptor(i,`maxProtocolVersion`),i=Object.getPrototypeOf(i);if(t===`maxVersion`&&n)return KD;let a=t===`maxProtocolVersion`?n:r;if(!a)return KD;this.resolvingPeerCeiling=!0;try{return a.get?a.get.call(this):a.value}finally{this.resolvingPeerCeiling=!1}}get maxProtocolVersion(){return this.resolvePeerCeiling(`maxProtocolVersion`)}get maxVersion(){return!this.resolvingPeerCeiling&&!qD&&(qD=!0,console.warn(`[ag-ui] AbstractAgent.maxVersion is deprecated — use maxProtocolVersion. Same value; the new name says whose version it is and that it is a ceiling.`)),this.resolvePeerCeiling(`maxVersion`)}get debug(){return this._debug}set debug(e){this._debug=uE(e),this._debugLogger=pE(this._debug)}get debugLogger(){return this._debugLogger}set debugLogger(e){this._debugLogger=typeof e==`boolean`?e?pE(uE(!0)):void 0:e}resolvedCeilingDuringConstruction(){let e=this.maxProtocolVersion;if(typeof e!=`string`||!TC(e))throw new j(`maxProtocolVersion resolved to ${JSON.stringify(e)} during construction, which is not a version this client can compare. A ceiling read from an instance field is not available yet — return a literal from the getter.`);return e}constructor({agentId:e,description:t,threadId:n,initialMessages:r,initialState:i,debug:a}={}){this.subscribers=[],this.isRunning=!1,this.pendingInterrupts=[],this.middlewares=[],this.resolvingPeerCeiling=!1,this.agentId=e,this.description=t??``,this.threadId=n??Po(),this.messages=$(r??[]),this.state=$(i??{}),this._debug=uE(a),this._debugLogger=pE(this._debug);let o=this.resolvedCeilingDuringConstruction();wC(o,`0.0.39`)<=0&&this.middlewares.unshift(new ND),wC(o,`0.0.45`)<=0&&this.middlewares.unshift(new zD),wC(o,`0.0.57`)<=0&&this.middlewares.unshift(new GD)}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 sD(e):e);return this.middlewares.push(...t),this}async runAgent(e,t){try{this.isRunning=!0,this.agentId=this.agentId??Po();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=[{onRunStartedEvent:({event:e})=>XD(e),onRunFinishedEvent:e=>{e.outcome===`success`&&(r=e.result)}},...this.subscribers,t??{}];JD.add(n),await this.onInitialize(n,a),this.activeRunDetach$=new xc;let o;this.activeRunCompletionPromise=new Promise(e=>{o=e}),await ol(uc(()=>[...this.middlewares,new ED].reduceRight((e,t)=>({run:n=>t.run(n,e),get messages(){return e.messages},get state(){return e.state}}),this).run(n),iD(this.debugLogger),GE(this.debugLogger),vE(this.debugLogger),e=>e.pipe(xl(this.activeRunDetach$)),e=>this.applyBeforeSourceError(n,e,a),ml(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))),yl(()=>{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}))(il(null)));let s=$(this.messages).filter(e=>!i.has(e.id));return{result:r,newMessages:s}}finally{this.isRunning=!1}}connect(e){throw new zo}async connectAgent(e,t){try{this.isRunning=!0,this.agentId=this.agentId??Po();let n=this.prepareRunAgentInput(e),r,i=new Set(this.messages.map(e=>e.id)),a=[{onRunStartedEvent:({event:e})=>XD(e),onRunFinishedEvent:e=>{e.outcome===`success`&&(r=e.result)}},...this.subscribers,t??{}];await this.onInitialize(n,a),this.activeRunDetach$=new xc;let o;this.activeRunCompletionPromise=new Promise(e=>{o=e}),await ol(uc(()=>fl(()=>this.connect(n)),e=>iD(this.debugLogger)(DD()(e)),GE(this.debugLogger),vE(this.debugLogger),e=>e.pipe(xl(this.activeRunDetach$)),e=>this.applyBeforeSourceError(n,e,a),ml(e=>(this.isRunning=!1,e instanceof zo?Tc:this.onError(n,e,a))),yl(()=>{this.isRunning=!1,this.onFinalize(n,a),o?.(),o=void 0,this.activeRunCompletionPromise=void 0,this.activeRunDetach$=void 0}))(il(null)),{defaultValue:void 0});let s=$(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}applyBeforeSourceError(e,t,n){return fl(()=>{let r,i=t.pipe(ml(e=>(r={error:e},Tc)));return this.processApplyEvents(e,this.apply(e,i,n),n).pipe(_l(fl(()=>{let e=r;return e?N(()=>e.error):Tc})))})}apply(e,t,n){return gE(e,t,this,n,this.debugLogger)}processApplyEvents(e,t,n){return t.pipe(Sl(t=>{t.messages&&(this.messages=t.messages,n.forEach(t=>{t.onMessagesChanged?.({messages:this.messages,state:this.state,agent:this,input:e})})),t.state!==void 0&&(this.state=t.state,n.forEach(t=>{t.onStateChanged?.({state:this.state,messages:this.messages,agent:this,input:e})}))}))}prepareRunAgentInput(e){let t=$(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||Po(),...wC(this.maxProtocolVersion,KD)>=0&&{protocolVersion:`1.0`},tools:$(e?.tools??[]),context:$(e?.context??[]),forwardedProps:$(e?.forwardedProps??{}),state:$(this.state),messages:n,...e?.resume===void 0?{}:{resume:$(e.resume)}}}async onInitialize(e,t){if(JD.has(e)&&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 j(`Thread has ${n.length} pending interrupt(s) not addressed by resume: ${n.join(`, `)}`);for(let t of this.pendingInterrupts)if(OD(t)&&(e.resume??[]).find(e=>e.interruptId===t.id)?.status!==`cancelled`)throw new j(`Interrupt ${t.id} expired at ${t.expiresAt} and can no longer be answered. Cancel it to continue the thread.`)}let n=await lE(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.filter(e=>e.role!==`activity`),t.forEach(t=>{t.onMessagesChanged?.({messages:this.messages,state:this.state,agent:this,input:e})})}n.state!==void 0&&(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 rl(lE(n,this.messages,this.state,(n,r,i)=>n.onRunFailed?.({error:t,messages:r,state:i,agent:this,input:e}))).pipe(sl(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 lE(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=$(this.messages),e.state=$(this.state),e._debug=this._debug,e._debugLogger=this._debugLogger,e.isRunning=this.isRunning,e.subscribers=[...this.subscribers],e.middlewares=[...this.middlewares],e.pendingInterrupts=$(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=$(e),(async()=>{for(let e of this.subscribers)await e.onMessagesChanged?.({messages:this.messages,state:this.state,agent:this})})()}setState(e){this.state=$(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??Po();let t=this.prepareRunAgentInput(e);return[...this.middlewares,new ED].reduceRight((e,t)=>({run:n=>t.run(n,e),get messages(){return e.messages},get state(){return e.state}}),this).run(t).pipe(iD(this.debugLogger),GE(this.debugLogger),vE(this.debugLogger),jE(this.threadId,t.runId,this.agentId),e=>e.pipe(sl(e=>(this.debugLogger?.event(`LEGACY`,`Event:`,e,{type:e.type}),e))))}};function QD(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 $D=class extends ZD{requestInit(e){return{method:`POST`,headers:{...this.headers,"Content-Type":`application/json`,Accept:`text/event-stream`},body:JSON.stringify(QD(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=$(e.headers??{}),this.fetch=e.fetch??((e,t)=>fetch(e,t))}run(e){return EE(bE(()=>this.fetch(this.url,this.requestInit(aD(e)))),this.debugLogger)}clone(){let e=super.clone();e.url=this.url,e.headers=$(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}},eO=class extends tn{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:hn(t,n.data),hasPreviousPage:rn(t,n.data),isFetchNextPageError:l,isFetchingNextPage:u,isFetchPreviousPageError:d,isFetchingPreviousPage:f,isRefetchError:s&&!l&&!d,isRefetching:a&&!u&&!f}}},tO=class extends on{#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 mn({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=nO(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=nO(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=nO(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=nO(e);return typeof t==`string`?(this.#t.get(t)?.find(t=>t!==e&&t.state.isPaused))?.continue()??Promise.resolve():Promise.resolve()}clear(){_n.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=>sn(t,e))}findAll(e={}){return this.getAll().filter(t=>sn(e,t))}notify(e){_n.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){let e=this.getAll().filter(e=>e.state.isPaused);return _n.batch(()=>Promise.all(e.map(e=>e.continue().catch(vn))))}};function nO(e){return e.options.scope?.id}var rO=class extends on{#e;constructor(e={}){super(),this.config=e,this.#e=new Map}build(e,t,n){let r=t.queryKey,i=t.queryHash??cn(r,t),a=this.get(i);return a||(a=new fn({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){this.#e.get(e.queryHash)===e&&(e.destroy(),this.#e.delete(e.queryHash),this.notify({type:`removed`,query:e}))}clear(){_n.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=>en(t,e))}findAll(e={}){let t=this.getAll();return Object.keys(e).length>0?t.filter(t=>en(e,t)):t}notify(e){_n.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){_n.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){_n.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},iO=class{#e;#t;#n;#r;#i;#a;#o;#s;constructor(e={}){this.#e=e.queryCache||new rO,this.#t=e.mutationCache||new tO,this.#n=e.defaultOptions||{},this.#r=new Map,this.#i=new Map,this.#a=0}mount(){this.#a++,this.#a===1&&(this.#o=an.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#s=ln.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(nn(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=pn(t,i);if(a!==void 0)return this.#e.build(this,r).setData(a,{...n,manual:!0})}setQueriesData(e,t,n){return _n.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;_n.batch(()=>{t.findAll(e).forEach(e=>{t.remove(e)})})}resetQueries(e,t){let n=this.#e;return _n.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=_n.batch(()=>this.#e.findAll(e).map(e=>e.cancel(n)));return Promise.all(r).then(vn).catch(vn)}invalidateQueries(e,t={}){return _n.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=_n.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(vn)),e.state.fetchStatus===`paused`?Promise.resolve():t}));return Promise.all(r).then(vn)}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(nn(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(nn(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(vn).catch(vn)}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(vn).catch(vn)}ensureInfiniteQueryData(e){return e._type=`infinite`,this.ensureQueryData(e)}resumePausedMutations(){return ln.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(un(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){let t=[...this.#r.values()],n={};return t.forEach(t=>{bn(e,t.queryKey)&&Object.assign(n,t.defaultOptions)}),n}setMutationDefaults(e,t){this.#i.set(un(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){let t=[...this.#i.values()],n={};return t.forEach(t=>{bn(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||=cn(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===Yt&&(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 aO(e,t){return dn(e,eO,t)}var oO=new Map([[`bold`,D.createElement(D.Fragment,null,D.createElement(`path`,{d:`M232,44H160a43.86,43.86,0,0,0-32,13.85A43.86,43.86,0,0,0,96,44H24A12,12,0,0,0,12,56V200a12,12,0,0,0,12,12H96a20,20,0,0,1,20,20,12,12,0,0,0,24,0,20,20,0,0,1,20-20h72a12,12,0,0,0,12-12V56A12,12,0,0,0,232,44ZM96,188H36V68H96a20,20,0,0,1,20,20V192.81A43.79,43.79,0,0,0,96,188Zm124,0H160a43.71,43.71,0,0,0-20,4.83V88a20,20,0,0,1,20-20h60Z`}))],[`duotone`,D.createElement(D.Fragment,null,D.createElement(`path`,{d:`M232,56V200H160a32,32,0,0,0-32,32,32,32,0,0,0-32-32H24V56H96a32,32,0,0,1,32,32,32,32,0,0,1,32-32Z`,opacity:`0.2`}),D.createElement(`path`,{d:`M232,48H160a40,40,0,0,0-32,16A40,40,0,0,0,96,48H24a8,8,0,0,0-8,8V200a8,8,0,0,0,8,8H96a24,24,0,0,1,24,24,8,8,0,0,0,16,0,24,24,0,0,1,24-24h72a8,8,0,0,0,8-8V56A8,8,0,0,0,232,48ZM96,192H32V64H96a24,24,0,0,1,24,24V200A39.81,39.81,0,0,0,96,192Zm128,0H160a39.81,39.81,0,0,0-24,8V88a24,24,0,0,1,24-24h64Z`}))],[`fill`,D.createElement(D.Fragment,null,D.createElement(`path`,{d:`M240,56V200a8,8,0,0,1-8,8H160a24,24,0,0,0-24,23.94,7.9,7.9,0,0,1-5.12,7.55A8,8,0,0,1,120,232a24,24,0,0,0-24-24H24a8,8,0,0,1-8-8V56a8,8,0,0,1,8-8H88a32,32,0,0,1,32,32v87.73a8.17,8.17,0,0,0,7.47,8.25,8,8,0,0,0,8.53-8V80a32,32,0,0,1,32-32h64A8,8,0,0,1,240,56Z`}))],[`light`,D.createElement(D.Fragment,null,D.createElement(`path`,{d:`M232,50H160a38,38,0,0,0-32,17.55A38,38,0,0,0,96,50H24a6,6,0,0,0-6,6V200a6,6,0,0,0,6,6H96a26,26,0,0,1,26,26,6,6,0,0,0,12,0,26,26,0,0,1,26-26h72a6,6,0,0,0,6-6V56A6,6,0,0,0,232,50ZM96,194H30V62H96a26,26,0,0,1,26,26V204.31A37.86,37.86,0,0,0,96,194Zm130,0H160a37.87,37.87,0,0,0-26,10.32V88a26,26,0,0,1,26-26h66Z`}))],[`regular`,D.createElement(D.Fragment,null,D.createElement(`path`,{d:`M232,48H160a40,40,0,0,0-32,16A40,40,0,0,0,96,48H24a8,8,0,0,0-8,8V200a8,8,0,0,0,8,8H96a24,24,0,0,1,24,24,8,8,0,0,0,16,0,24,24,0,0,1,24-24h72a8,8,0,0,0,8-8V56A8,8,0,0,0,232,48ZM96,192H32V64H96a24,24,0,0,1,24,24V200A39.81,39.81,0,0,0,96,192Zm128,0H160a39.81,39.81,0,0,0-24,8V88a24,24,0,0,1,24-24h64Z`}))],[`thin`,D.createElement(D.Fragment,null,D.createElement(`path`,{d:`M232,52H160a36,36,0,0,0-32,19.54A36,36,0,0,0,96,52H24a4,4,0,0,0-4,4V200a4,4,0,0,0,4,4H96a28,28,0,0,1,28,28,4,4,0,0,0,8,0,28,28,0,0,1,28-28h72a4,4,0,0,0,4-4V56A4,4,0,0,0,232,52ZM96,196H28V60H96a28,28,0,0,1,28,28V209.4A35.93,35.93,0,0,0,96,196Zm132,0H160a35.94,35.94,0,0,0-28,13.41V88a28,28,0,0,1,28-28h68Z`}))]]),sO=new Map([[`bold`,D.createElement(D.Fragment,null,D.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`,D.createElement(D.Fragment,null,D.createElement(`path`,{d:`M192,112a80,80,0,1,1-80-80A80,80,0,0,1,192,112Z`,opacity:`0.2`}),D.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`,D.createElement(D.Fragment,null,D.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`,D.createElement(D.Fragment,null,D.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`,D.createElement(D.Fragment,null,D.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`,D.createElement(D.Fragment,null,D.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`}))]]),cO=new Map([[`bold`,D.createElement(D.Fragment,null,D.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`,D.createElement(D.Fragment,null,D.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`}),D.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`,D.createElement(D.Fragment,null,D.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`,D.createElement(D.Fragment,null,D.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`,D.createElement(D.Fragment,null,D.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`,D.createElement(D.Fragment,null,D.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`}))]]),lO=new Map([[`bold`,D.createElement(D.Fragment,null,D.createElement(`path`,{d:`M240.49,15.51a12,12,0,0,0-17,0L173.94,65.09l-2.54-2.55a36.05,36.05,0,0,0-50.91,0L100,83l-3.51-3.52a12,12,0,0,0-17,17L83,100,62.54,120.49a36,36,0,0,0,0,50.91l2.55,2.54L15.51,223.51a12,12,0,0,0,17,17l49.57-49.58,2.54,2.55a36.06,36.06,0,0,0,50.91,0L156,173l3.51,3.52a12,12,0,0,0,17-17L173,156l20.49-20.49a36,36,0,0,0,0-50.91l-2.55-2.54,49.58-49.57A12,12,0,0,0,240.49,15.51Zm-121.95,161a12,12,0,0,1-17,0L79.51,154.43a12,12,0,0,1,0-17L100,117l39,39Zm58-57.95h0L156,139l-39-39,20.49-20.49a12,12,0,0,1,17,0l22.06,22.06a12,12,0,0,1,0,17ZM85.27,33.37a12,12,0,0,1,21.46-10.74l8,16A12,12,0,1,1,93.27,49.37Zm-68,57.26a12,12,0,0,1,16.1-5.36l16,8a12,12,0,1,1-10.74,21.46l-16-8A12,12,0,0,1,17.27,90.63Zm221.46,74.74a12,12,0,0,1-16.1,5.36l-16-8a12,12,0,0,1,10.74-21.46l16,8A12,12,0,0,1,238.73,165.37Zm-68,57.26a12,12,0,1,1-21.46,10.74l-8-16a12,12,0,0,1,21.46-10.74Z`}))],[`duotone`,D.createElement(D.Fragment,null,D.createElement(`path`,{d:`M185,127,127,185a24,24,0,0,1-33.94,0L71,162.91A24,24,0,0,1,71,129L129,71a24,24,0,0,1,33.94,0L185,93.09A24,24,0,0,1,185,127Z`,opacity:`0.2`}),D.createElement(`path`,{d:`M237.66,18.34a8,8,0,0,0-11.32,0l-52.4,52.41-5.37-5.38a32.05,32.05,0,0,0-45.26,0L100,88.69l-6.34-6.35A8,8,0,0,0,82.34,93.66L88.69,100,65.37,123.31a32,32,0,0,0,0,45.26l5.38,5.37-52.41,52.4a8,8,0,0,0,11.32,11.32l52.4-52.41,5.37,5.38a32.06,32.06,0,0,0,45.26,0L156,167.31l6.34,6.35a8,8,0,0,0,11.32-11.32L167.31,156l23.32-23.31a32,32,0,0,0,0-45.26l-5.38-5.37,52.41-52.4A8,8,0,0,0,237.66,18.34Zm-116.29,161a16,16,0,0,1-22.62,0L76.69,157.25a16,16,0,0,1,0-22.62L100,111.31,144.69,156Zm57.94-57.94h0L156,144.69,111.31,100l23.32-23.31a16,16,0,0,1,22.62,0l22.06,22a16,16,0,0,1,0,22.63ZM88.57,35A8,8,0,0,1,103.43,29l8,20A8,8,0,0,1,96.57,55ZM24.57,93A8,8,0,0,1,35,88.57l20,8A8,8,0,0,1,49,111.43l-20-8A8,8,0,0,1,24.57,93ZM231.43,163a8,8,0,0,1-10.4,4.46l-20-8A8,8,0,1,1,207,144.57l20,8A8,8,0,0,1,231.43,163Zm-64,58.06A8,8,0,0,1,152.57,227l-8-20A8,8,0,0,1,159.43,201Z`}))],[`fill`,D.createElement(D.Fragment,null,D.createElement(`path`,{d:`M88.57,35A8,8,0,0,1,103.43,29l8,20A8,8,0,0,1,96.57,55ZM29,103.43l20,8A8,8,0,1,0,55,96.57l-20-8A8,8,0,0,0,29,103.43ZM227,152.57l-20-8A8,8,0,1,0,201,159.43l20,8A8,8,0,0,0,227,152.57ZM159.43,201A8,8,0,0,0,144.57,207l8,20A8,8,0,1,0,167.43,221ZM237.91,18.52a8,8,0,0,0-11.5-.18L174,70.75l-5.38-5.38a32,32,0,0,0-45.28,0L106.14,82.54a4,4,0,0,0,0,5.66l61.7,61.66a4,4,0,0,0,5.66,0l16.74-16.74a32.76,32.76,0,0,0,9.81-22.52,31.82,31.82,0,0,0-9.37-23.17l-5.38-5.37,52.2-52.17A8.22,8.22,0,0,0,237.91,18.52ZM85.64,90.34a8,8,0,0,0-11.49.18,8.22,8.22,0,0,0,.41,11.37L80.67,108,65.34,123.31A31.82,31.82,0,0,0,56,146.47,32.75,32.75,0,0,0,65.77,169l5,4.94L18.49,226.13a8.21,8.21,0,0,0-.61,11.1,8,8,0,0,0,11.72.43L82,185.25l5.37,5.38a32.1,32.1,0,0,0,45.29,0L148,175.31l6.34,6.35a8,8,0,0,0,11.32-11.32Z`}))],[`light`,D.createElement(D.Fragment,null,D.createElement(`path`,{d:`M236.24,19.76a6,6,0,0,0-8.48,0L173.94,73.57l-6.79-6.78a30,30,0,0,0-42.42,0L100,91.51l-7.76-7.75a6,6,0,0,0-8.48,8.48L91.51,100,66.79,124.73a30,30,0,0,0,0,42.42l6.78,6.79L19.76,227.76a6,6,0,1,0,8.48,8.48l53.82-53.81,6.79,6.78a30,30,0,0,0,42.42,0L156,164.49l7.76,7.75a6,6,0,0,0,8.48-8.48L164.49,156l24.72-24.73a30,30,0,0,0,0-42.42l-6.78-6.79,53.81-53.82A6,6,0,0,0,236.24,19.76Zm-113.45,161a18,18,0,0,1-25.46,0L75.27,158.67a18,18,0,0,1,0-25.46L100,108.49,147.51,156Zm57.94-57.94L156,147.51,108.49,100l24.72-24.73a18,18,0,0,1,25.46,0l22.06,22.06a18,18,0,0,1,0,25.46ZM90.43,34.23a6,6,0,0,1,11.14-4.46l8,20a6,6,0,1,1-11.14,4.46Zm-64,59.54a6,6,0,0,1,7.8-3.34l20,8a6,6,0,1,1-4.46,11.14l-20-8A6,6,0,0,1,26.43,93.77Zm203.14,68.46a6,6,0,0,1-7.8,3.34l-20-8a6,6,0,0,1,4.46-11.14l20,8A6,6,0,0,1,229.57,162.23Zm-64,59.54a6,6,0,1,1-11.14,4.46l-8-20a6,6,0,0,1,11.14-4.46Z`}))],[`regular`,D.createElement(D.Fragment,null,D.createElement(`path`,{d:`M237.66,18.34a8,8,0,0,0-11.32,0l-52.4,52.41-5.37-5.38a32.05,32.05,0,0,0-45.26,0L100,88.69l-6.34-6.35A8,8,0,0,0,82.34,93.66L88.69,100,65.37,123.31a32,32,0,0,0,0,45.26l5.38,5.37-52.41,52.4a8,8,0,0,0,11.32,11.32l52.4-52.41,5.37,5.38a32,32,0,0,0,45.26,0L156,167.31l6.34,6.35a8,8,0,0,0,11.32-11.32L167.31,156l23.32-23.31a32,32,0,0,0,0-45.26l-5.38-5.37,52.41-52.4A8,8,0,0,0,237.66,18.34Zm-116.29,161a16,16,0,0,1-22.62,0L76.69,157.25a16,16,0,0,1,0-22.62L100,111.31,144.69,156Zm57.94-57.94L156,144.69,111.31,100l23.32-23.31a16,16,0,0,1,22.62,0l22.06,22A16,16,0,0,1,179.31,121.37ZM88.57,35A8,8,0,0,1,103.43,29l8,20A8,8,0,0,1,96.57,55ZM24.57,93A8,8,0,0,1,35,88.57l20,8A8,8,0,0,1,49,111.43l-20-8A8,8,0,0,1,24.57,93ZM231.43,163a8,8,0,0,1-10.4,4.46l-20-8A8,8,0,1,1,207,144.57l20,8A8,8,0,0,1,231.43,163Zm-64,58.06A8,8,0,0,1,152.57,227l-8-20A8,8,0,0,1,159.43,201Z`}))],[`thin`,D.createElement(D.Fragment,null,D.createElement(`path`,{d:`M234.83,21.17a4,4,0,0,0-5.66,0L173.94,76.4l-8.2-8.2a28,28,0,0,0-39.6,0L100,94.34l-9.17-9.17a4,4,0,0,0-5.66,5.66L94.34,100,68.2,126.14a28,28,0,0,0,0,39.6l8.2,8.2L21.17,229.17a4,4,0,0,0,5.66,5.66L82.06,179.6l8.2,8.2a28,28,0,0,0,39.6,0L156,161.66l9.17,9.17a4,4,0,0,0,5.66-5.66L161.66,156l26.14-26.14a28,28,0,0,0,0-39.6l-8.2-8.2,55.23-55.23A4,4,0,0,0,234.83,21.17Zm-110.63,161a20,20,0,0,1-28.28,0L73.86,160.08a20,20,0,0,1,0-28.28L100,105.66,150.34,156Zm57.94-57.94L156,150.34,105.66,100,131.8,73.86a20,20,0,0,1,28.28,0l22.06,22.06A20,20,0,0,1,182.14,124.2ZM92.29,33.49a4,4,0,1,1,7.42-3l8,20a4,4,0,0,1-2.22,5.2A3.91,3.91,0,0,1,104,56a4,4,0,0,1-3.71-2.51Zm-64,61a4,4,0,0,1,5.2-2.22l20,8A4,4,0,0,1,52,108a3.91,3.91,0,0,1-1.49-.29l-20-8A4,4,0,0,1,28.29,94.51Zm199.42,67A4,4,0,0,1,224,164a3.91,3.91,0,0,1-1.49-.29l-20-8a4,4,0,1,1,3-7.42l20,8A4,4,0,0,1,227.71,161.49Zm-64,61a4,4,0,0,1-2.22,5.2A3.91,3.91,0,0,1,160,228a4,4,0,0,1-3.71-2.51l-8-20a4,4,0,0,1,7.42-3Z`}))]]),uO=new Map([[`bold`,D.createElement(D.Fragment,null,D.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`,D.createElement(D.Fragment,null,D.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`}),D.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`,D.createElement(D.Fragment,null,D.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`,D.createElement(D.Fragment,null,D.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`,D.createElement(D.Fragment,null,D.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`,D.createElement(D.Fragment,null,D.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`}))]]),dO=new Map([[`bold`,D.createElement(D.Fragment,null,D.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`,D.createElement(D.Fragment,null,D.createElement(`path`,{d:`M224,56V200a16,16,0,0,1-16,16H48V40H208A16,16,0,0,1,224,56Z`,opacity:`0.2`}),D.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`,D.createElement(D.Fragment,null,D.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`,D.createElement(D.Fragment,null,D.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`,D.createElement(D.Fragment,null,D.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`,D.createElement(D.Fragment,null,D.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`}))]]),fO=new Map([[`bold`,D.createElement(D.Fragment,null,D.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`,D.createElement(D.Fragment,null,D.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`}),D.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`,D.createElement(D.Fragment,null,D.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`,D.createElement(D.Fragment,null,D.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`,D.createElement(D.Fragment,null,D.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`,D.createElement(D.Fragment,null,D.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`}))]]),pO=new Map([[`bold`,D.createElement(D.Fragment,null,D.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`,D.createElement(D.Fragment,null,D.createElement(`path`,{d:`M184,128a56,56,0,1,1-56-56A56,56,0,0,1,184,128Z`,opacity:`0.2`}),D.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`,D.createElement(D.Fragment,null,D.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`,D.createElement(D.Fragment,null,D.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`,D.createElement(D.Fragment,null,D.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`,D.createElement(D.Fragment,null,D.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`}))]]),mO=D.forwardRef((e,t)=>D.createElement(S,{ref:t,...e,weights:oO}));mO.displayName=`BookOpenIcon`;var hO=mO,gO=D.forwardRef((e,t)=>D.createElement(S,{ref:t,...e,weights:sO}));gO.displayName=`MagnifyingGlassIcon`;var _O=gO,vO=D.forwardRef((e,t)=>D.createElement(S,{ref:t,...e,weights:cO}));vO.displayName=`MoonIcon`;var yO=vO,bO=D.forwardRef((e,t)=>D.createElement(S,{ref:t,...e,weights:lO}));bO.displayName=`PlugsConnectedIcon`;var xO=bO,SO=D.forwardRef((e,t)=>D.createElement(S,{ref:t,...e,weights:uO}));SO.displayName=`PlusIcon`;var CO=SO,wO=D.forwardRef((e,t)=>D.createElement(S,{ref:t,...e,weights:dO}));wO.displayName=`SignOutIcon`;var TO=wO,EO=D.forwardRef((e,t)=>D.createElement(S,{ref:t,...e,weights:fO}));EO.displayName=`SparkleIcon`;var DO=EO,OO=D.forwardRef((e,t)=>D.createElement(S,{ref:t,...e,weights:pO}));OO.displayName=`SunIcon`;var kO=OO,AO=[`agent-threads`];async function jO(e){let t=await Te(e);if(!t.ok)throw Error(`Request failed (${t.status})`);return t.json()}var MO=[];for(let e=0;e<256;++e)MO.push((e+256).toString(16).slice(1));function NO(e,t=0){return(MO[e[t+0]]+MO[e[t+1]]+MO[e[t+2]]+MO[e[t+3]]+`-`+MO[e[t+4]]+MO[e[t+5]]+`-`+MO[e[t+6]]+MO[e[t+7]]+`-`+MO[e[t+8]]+MO[e[t+9]]+`-`+MO[e[t+10]]+MO[e[t+11]]+MO[e[t+12]]+MO[e[t+13]]+MO[e[t+14]]+MO[e[t+15]]).toLowerCase()}var PO=new Uint8Array(16);function FO(){return crypto.getRandomValues(PO)}var IO={};function LO(e,t,n){let r;if(e)r=zO(e.random??e.rng?.()??FO(),e.msecs,e.seq,t,n);else{let e=Date.now(),i=FO();RO(IO,e,i),r=zO(i,IO.msecs,IO.seq,t,n)}return t??NO(r)}function RO(e,t,n){return e.msecs??=-1/0,e.seq??=0,t>e.msecs?(e.seq=BO(n),e.msecs=t):(e.seq=e.seq+1|0,e.seq===0&&e.msecs++),e}function zO(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??=BO(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 BO(e){return(e[6]&127)<<24|e[7]<<16|e[8]<<8|e[9]}function VO(){return LO()}function HO(){let{setColorScheme:e}=qt(),t=Jt(`light`,{getInitialValueInEffect:!0}),n=t===`dark`?`light`:`dark`,[r,i]=(0,D.useState)(!1);return(0,O.jsx)(Gt,{label:`Switch to ${n} theme`,opened:r,children:(0,O.jsx)(Xe,{variant:`subtle`,color:`gray`,"aria-label":`Switch to ${n} theme`,onMouseEnter:()=>i(!0),onMouseLeave:()=>i(!1),onFocus:()=>i(!0),onBlur:()=>i(!1),onClick:()=>{i(!1),e(n)},children:t===`dark`?(0,O.jsx)(kO,{size:17,weight:`bold`}):(0,O.jsx)(yO,{size:17,weight:`bold`})})})}var UO={home:`https://fanout.run/start/what-fanout-is`,ingest:`https://fanout.run/start/send-telemetry`};async function WO(e,t){let n=new URLSearchParams({page_size:`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 GO({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=$t(),[f,p]=(0,D.useState)(``),[h]=ca(f.trim(),250),[g,_]=(0,D.useState)(null),[v,y]=(0,D.useState)(null),[b,x]=(0,D.useState)(``),[S,C]=(0,D.useState)(``),[ne,re]=(0,D.useState)(!1),ie=(0,D.useRef)(null);(0,D.useImperativeHandle)(u,()=>({focusSearch:()=>ie.current?.focus()}),[]),(0,D.useEffect)(()=>{r&&requestAnimationFrame(()=>ie.current?.focus())},[r]);let T=aO({queryKey:[...AO,h],queryFn:({pageParam:e})=>WO(h,e),initialPageParam:``,getNextPageParam:e=>e.next_cursor??void 0,enabled:e}),oe=gn({queryKey:gt,queryFn:ut,refetchInterval:3e4,staleTime:ft}),se=(0,D.useMemo)(()=>T.data?.pages.flatMap(e=>e.items)??[],[T.data]),ce=(0,D.useMemo)(()=>ZO(se),[se]),le=gn({queryKey:[`telemetry-schema`,`1h`],queryFn:()=>jO(`/api/telemetry/schema?window=1h`),enabled:!!h&&!!l,staleTime:6e4}),ue=(0,D.useMemo)(()=>{if(!h)return[];let e=h.toLowerCase();return(le.data?.services??[]).map(e=>e.value).filter(t=>t.toLowerCase().includes(e)).slice(0,6)},[le.data,h]),de=(0,D.useMemo)(()=>{let e=oe.data??[],t=h.toLowerCase();return t?e.filter(e=>e.name.toLowerCase().includes(t)):e},[oe.data,h]);function fe(e){C(``),x(e.title),_(e)}async function me(){if(g&&b.trim()){re(!0),C(``);try{let e=await Te(`/api/agent/threads/${encodeURIComponent(g.id)}`,{method:`PATCH`,headers:{"Content-Type":`application/json`},body:JSON.stringify({title:b.trim()})});if(!e.ok)throw Error(`Unable to rename chat (${e.status})`);await d.invalidateQueries({queryKey:AO}),_(null)}catch(e){C(e instanceof Error?e.message:`Unable to rename this chat.`)}finally{re(!1)}}}async function he(){if(v){re(!0),C(``);try{let e=await Te(`/api/agent/threads/${encodeURIComponent(v.id)}`,{method:`DELETE`});if(!e.ok)throw Error(`Unable to delete chat (${e.status})`);let t=v.id;y(null),await d.invalidateQueries({queryKey:AO}),await d.invalidateQueries({queryKey:gt}),o(t)}catch(e){C(e instanceof Error?e.message:`Unable to delete this chat.`)}finally{re(!1)}}}return(0,O.jsxs)(te,{gap:`sm`,h:`100%`,component:`nav`,"aria-label":`Navigation`,children:[e&&(0,O.jsx)(w,{leftSection:(0,O.jsx)(CO,{size:16,weight:`bold`}),onClick:i,children:`New chat`}),(0,O.jsx)(Wt,{type:`auto`,offsetScrollbars:!0,flex:1,mx:-4,px:4,children:(0,O.jsxs)(te,{gap:`lg`,pb:`sm`,children:[e&&(0,O.jsxs)(te,{gap:4,children:[(0,O.jsx)(KO,{children:`Chats`}),T.isLoading&&(0,O.jsx)(ve,{py:`md`,children:(0,O.jsx)(Se,{size:`xs`})}),T.isError&&(0,O.jsx)(pe,{color:`bad`,radius:`md`,p:`xs`,children:`Chats could not be loaded.`}),!T.isLoading&&!T.isError&&se.length===0&&(0,O.jsx)(ae,{c:`dimmed`,size:`sm`,px:`sm`,py:`xs`,children:h?`No matching chats`:`No chats yet`}),ce.map(e=>(0,O.jsxs)(te,{gap:2,children:[ce.length>1&&(0,O.jsx)(ae,{c:`dimmed`,size:`xs`,px:`sm`,pt:4,children:e.label}),e.threads.map(e=>(0,O.jsx)(qO,{thread:e,active:e.id===t,onSelect:()=>a(e.id),onRename:()=>fe(e),onDelete:()=>{C(``),y(e)}},e.id))]},e.label)),T.hasNextPage&&(0,O.jsx)(w,{variant:`subtle`,color:`gray`,size:`compact-sm`,loading:T.isFetchingNextPage,onClick:()=>void T.fetchNextPage(),children:`See all`})]}),h&&l&&le.isLoading&&(0,O.jsx)(ve,{py:`md`,children:(0,O.jsx)(Se,{size:`xs`})}),h&&l&&(le.isSuccess||le.isError)&&(0,O.jsxs)(te,{gap:4,children:[(0,O.jsx)(KO,{children:`Services`}),le.isError&&(0,O.jsx)(ae,{c:`dimmed`,size:`sm`,px:`sm`,children:`Services could not be searched`}),le.isSuccess&&ue.length===0&&(0,O.jsx)(ae,{c:`dimmed`,size:`sm`,px:`sm`,children:`No matching services`}),ue.map(e=>(0,O.jsx)(m,{className:`rail-row`,p:`sm`,onClick:()=>l(e),children:(0,O.jsx)(ae,{size:`sm`,fw:500,truncate:!0,children:e})},e))]}),(0,O.jsxs)(te,{gap:4,children:[(0,O.jsx)(KO,{children:`Dashboards`}),oe.isLoading&&(0,O.jsx)(ve,{py:`md`,children:(0,O.jsx)(Se,{size:`xs`})}),oe.isError&&(0,O.jsx)(pe,{color:`bad`,radius:`md`,p:`xs`,children:`Dashboards could not be loaded.`}),!oe.isLoading&&!oe.isError&&h&&de.length===0&&(0,O.jsx)(ae,{c:`dimmed`,size:`sm`,px:`sm`,py:`xs`,children:`No matching dashboards`}),de.map(e=>{let t=e.id===n;return(0,O.jsxs)(te,{gap:0,children:[(0,O.jsx)(m,{component:`a`,href:`/dashboards/${encodeURIComponent(e.id)}`,className:`rail-row`,"data-active":t||void 0,"aria-current":t?`page`:void 0,p:`sm`,onClick:t=>{t.button!==0||t.metaKey||t.ctrlKey||t.shiftKey||t.altKey||(t.preventDefault(),s(e.id))},children:(0,O.jsxs)(ee,{justify:`space-between`,gap:`sm`,wrap:`nowrap`,children:[(0,O.jsx)(ae,{size:`sm`,fw:t?600:500,truncate:!0,children:e.name}),e.is_default&&(0,O.jsx)(et,{size:`xs`,variant:`light`,color:`gray`,children:`Default`})]})}),e.origin&&(0,O.jsx)(m,{component:`a`,href:`/chat/${encodeURIComponent(e.origin.thread_id)}`,"data-request-provenance":!0,px:`sm`,pb:`xs`,onClick:t=>{t.button!==0||t.metaKey||t.ctrlKey||t.shiftKey||t.altKey||(t.preventDefault(),a(e.origin.thread_id))},children:(0,O.jsxs)(ae,{size:`xs`,c:`dimmed`,lineClamp:2,children:[`Built from: `,e.origin.request_excerpt]})})]},e.id)}),e&&(0,O.jsx)(w,{variant:`subtle`,color:`gray`,size:`compact-sm`,justify:`flex-start`,leftSection:(0,O.jsx)(DO,{size:14,weight:`fill`}),onClick:c,children:oe.data?.length===0?`New dashboard`:`Create with AI`})]})]})}),(0,O.jsx)(ke,{ref:ie,value:f,onChange:e=>p(e.currentTarget.value),leftSection:(0,O.jsx)(_O,{size:15}),rightSection:(0,O.jsx)(_t,{size:`xs`,children:`⌘K`}),rightSectionWidth:44,placeholder:`Search`,"aria-label":`Search chats, dashboards and services`,size:`sm`}),(0,O.jsx)(Xt,{opened:g!==null,onClose:()=>!ne&&_(null),title:`Rename chat`,centered:!0,children:(0,O.jsx)(`form`,{onSubmit:e=>{e.preventDefault(),me()},children:(0,O.jsxs)(te,{children:[(0,O.jsx)(ke,{label:`Name`,value:b,onChange:e=>x(e.currentTarget.value),maxLength:120,autoFocus:!0}),S&&(0,O.jsx)(pe,{color:`bad`,children:S}),(0,O.jsxs)(ee,{justify:`flex-end`,children:[(0,O.jsx)(w,{variant:`default`,onClick:()=>_(null),disabled:ne,children:`Cancel`}),(0,O.jsx)(w,{type:`submit`,loading:ne,disabled:!b.trim(),children:`Save`})]})]})})}),(0,O.jsx)(Xt,{opened:v!==null,onClose:()=>!ne&&y(null),title:`Delete chat?`,centered:!0,children:(0,O.jsxs)(te,{children:[(0,O.jsxs)(ae,{size:`sm`,children:[`This permanently removes `,(0,O.jsx)(ae,{span:!0,fw:650,children:v?.title}),` and its saved messages.`]}),S&&(0,O.jsx)(pe,{color:`bad`,children:S}),(0,O.jsxs)(ee,{justify:`flex-end`,children:[(0,O.jsx)(w,{variant:`default`,onClick:()=>y(null),disabled:ne,children:`Cancel`}),(0,O.jsx)(w,{color:`bad`,loading:ne,onClick:()=>void he(),children:`Delete`})]})]})})]})}function KO({children:e}){return(0,O.jsx)(ae,{c:`dimmed`,size:`xs`,fw:700,tt:`uppercase`,lts:`0.08em`,px:`sm`,children:e})}function qO({thread:e,active:t,onSelect:r,onRename:i,onDelete:a}){return(0,O.jsx)(n,{"data-active":t||void 0,className:`rail-row`,children:(0,O.jsxs)(ee,{gap:2,wrap:`nowrap`,children:[(0,O.jsx)(m,{onClick:r,"aria-current":t?`page`:void 0,p:`sm`,flex:1,style:{minWidth:0},children:(0,O.jsxs)(te,{gap:0,children:[(0,O.jsx)(ae,{size:`sm`,fw:t?600:500,truncate:!0,children:e.title}),(0,O.jsx)(ae,{c:`dimmed`,size:`xs`,children:QO(e.updated_at)})]})}),(0,O.jsxs)(pt,{position:`bottom-end`,withinPortal:!0,children:[(0,O.jsx)(pt.Target,{children:(0,O.jsx)(Xe,{className:`rail-row-actions`,variant:`subtle`,color:`gray`,size:`sm`,mr:4,"aria-label":`Actions for ${e.title}`,children:(0,O.jsx)(vt,{size:18,weight:`bold`})})}),(0,O.jsxs)(pt.Dropdown,{children:[(0,O.jsx)(pt.Item,{leftSection:(0,O.jsx)(dt,{size:15}),onClick:i,children:`Rename`}),(0,O.jsx)(pt.Item,{color:`bad`,leftSection:(0,O.jsx)(Vt,{size:15}),onClick:a,children:`Delete`})]})]})]})})}function JO(e){return e.includes(`T`)?new Date(e):new Date(`${e.replace(` `,`T`)}Z`)}function YO(e){return new Date(e.getFullYear(),e.getMonth(),e.getDate()).getTime()}var XO=[`Today`,`Yesterday`,`Previous 7 days`,`Older`];function ZO(e){let t=YO(new Date),n=new Map;for(let r of e){let e=Math.floor((t-YO(JO(r.updated_at)))/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 XO.filter(e=>n.has(e)).map(e=>({label:e,threads:n.get(e)}))}function QO(e){let t=JO(e),n=YO(new Date);return Math.floor((n-YO(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 $O({children:e}){let{agentAvailable:t,threadID:n,threadMissing:r,newThread:i,selectThread:a,openChat:o}=rt(),s=we(),c=sa({select:e=>e.location.pathname}),{dashboardId:l}=At({strict:!1}),u=c===`/chat`||c.startsWith(`/chat/`),[d,f]=la(!1),[p,m]=(0,D.useState)(!1),[h,g]=(0,D.useState)(``),_=(0,D.useRef)(null),v=ce(`(max-width: 62em)`),y=(0,D.useRef)(v);y.current=v,(0,D.useEffect)(()=>{f.close()},[c]),(0,D.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},search:{}}),onCreateDashboard:()=>o(Ze),onInvestigateService:e=>o(`Investigate the ${e} service. Explain its errors and latency.`)};return(0,O.jsxs)(po,{header:{height:52},navbar:{width:256,breakpoint:`md`,collapsed:{mobile:!0}},padding:0,children:[(0,O.jsx)(po.Header,{children:(0,O.jsxs)(ee,{h:`100%`,px:{base:`sm`,sm:`md`},justify:`space-between`,wrap:`nowrap`,children:[(0,O.jsxs)(ee,{gap:`sm`,wrap:`nowrap`,children:[(0,O.jsx)(Do,{hiddenFrom:`md`,opened:d,onClick:()=>{m(!1),f.toggle()},size:`sm`,"aria-label":d?`Close navigation`:`Open navigation`}),(0,O.jsx)(ge,{size:`small`})]}),(0,O.jsxs)(ee,{gap:`xs`,wrap:`nowrap`,children:[(0,O.jsx)(Gt,{label:`Documentation`,children:(0,O.jsx)(Xe,{component:`a`,href:UO.home,target:`_blank`,rel:`noopener noreferrer`,variant:`subtle`,color:`gray`,"aria-label":`Documentation`,children:(0,O.jsx)(hO,{size:17,weight:`bold`})})}),(0,O.jsx)(HO,{}),(0,O.jsx)(ek,{onError:g})]})]})}),(0,O.jsx)(po.Navbar,{p:`sm`,children:(0,O.jsx)(GO,{ref:_,...b})}),(0,O.jsx)(yt,{opened:d,onClose:f.close,hiddenFrom:`md`,size:288,padding:`sm`,title:(0,O.jsx)(ge,{size:`small`}),overlayProps:{backgroundOpacity:.24,blur:1},children:(0,O.jsx)(GO,{...b,autoFocusSearch:d&&p})}),(0,O.jsxs)(po.Main,{children:[h&&(0,O.jsx)(pe,{color:`bad`,m:`md`,withCloseButton:!0,onClose:()=>g(``),children:h}),e]})]})}function ek({onError:e}){let t=we(),n=Oe(),r=(n.display_name.trim()||n.email.trim()||`?`).charAt(0).toUpperCase();return(0,O.jsxs)(pt,{position:`bottom-end`,withinPortal:!0,shadow:`md`,children:[(0,O.jsx)(pt.Target,{children:(0,O.jsx)(Xe,{variant:`subtle`,color:`gray`,size:`lg`,radius:`xl`,"aria-label":`Account menu`,children:(0,O.jsx)(wo,{size:26,radius:`xl`,color:`brand`,children:r})})}),(0,O.jsxs)(pt.Dropdown,{children:[(0,O.jsx)(pt.Label,{children:n.email||`Signed in`}),(0,O.jsx)(pt.Item,{leftSection:(0,O.jsx)(xO,{size:15}),onClick:()=>void t({to:`/settings`}),children:`Connect telemetry`}),(0,O.jsx)(pt.Divider,{}),(0,O.jsx)(pt.Item,{leftSection:(0,O.jsx)(TO,{size:15}),onClick:()=>void E().catch(t=>e(t instanceof Error?t.message:`Sign-out failed — your session is still active.`)),children:`Sign out`})]})]})}function tk(){let{agent_available:e}=Ee(),t=we(),n=$t(),{threadId:r}=At({strict:!1}),[i,a]=(0,D.useState)(VO),o=(0,D.useRef)(new Set),s=r??i,[c,l]=(0,D.useState)([]),[u,d]=(0,D.useState)({}),[f,p]=(0,D.useState)(``),[m,h]=(0,D.useState)(!1),[g,_]=(0,D.useState)(!1),[v,y]=(0,D.useState)(``),[b,ee]=(0,D.useState)(null),x=(0,D.useRef)(null),[S,C]=(0,D.useState)(!1),te=(0,D.useRef)(!1),[ne,w]=(0,D.useState)(``),[re,ie]=(0,D.useState)(``),[ae,T]=(0,D.useState)(0),oe=(0,D.useRef)(null),se=(0,D.useRef)({}),ce=(0,D.useRef)(null),le=(0,D.useRef)(new Map),ue=(0,D.useMemo)(()=>new $D({url:`/api/agent/runs`,threadId:s,fetch:(e,t)=>Te(e,t)}),[s]),de=!e||f===s;function fe(){le.current.clear(),y(``),x.current=null,ee(null)}let pe=e=>e.filter(e=>e.role!==`reasoning`);function me(){let e=x.current?.text.split(/(?<=[.!?])\s/)[0]?.trim().replace(/[.!?]+$/,``);return e?e+`…`:``}function he(e){return te.current||e instanceof Error&&e.name===`AbortError`}(0,D.useEffect)(()=>{let t=!0;if(l([]),se.current={},d({}),p(``),h(!1),_(!1),te.current=!1,C(!1),fe(),ie(``),!e){p(s);return}!r||o.current.has(s)?(ue.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}ue.setMessages(pe(e.messages??[])),l(pe(e.messages??[])),p(s)}}).catch(()=>{t&&(oe.current=null,ie(`This chat could not be restored. Start a new chat or try again.`))});let i=ue.subscribe({onEvent:({event:e,messages:t})=>{switch(e.type){case`REASONING_MESSAGE_START`:return x.current={id:e.messageId,text:``,collapsed:!1},ee(x.current),y(``),{stopPropagation:!0};case`REASONING_MESSAGE_CONTENT`:{let t=e,n={id:t.messageId,text:(x.current?.text??``)+t.delta,collapsed:!1};return x.current=n,ee(n),{stopPropagation:!0}}case`REASONING_START`:case`REASONING_MESSAGE_END`:case`REASONING_END`:return{stopPropagation:!0};default:l(pe(t))}},onMessagesChanged:({messages:e})=>l(pe(e)),onRunInitialized:()=>{te.current=!1,C(!1),_(!0),ie(``)},onTextMessageContentEvent:({event:e})=>{e.delta&&(x.current=null,ee(null),y(``))},onToolCallStartEvent:({event:e})=>{le.current.set(e.toolCallId,nt(e.toolCallName)),y(nt(e.toolCallName)),x.current&&(x.current={...x.current,collapsed:!0},ee(x.current))},onToolCallResultEvent:({event:e,messages:t})=>{le.current.delete(e.toolCallId),y([...le.current.values()].at(-1)??me());let r=at(e.toolCallId,e.content,t);r&&(n.invalidateQueries({queryKey:gt}),n.invalidateQueries({queryKey:[`dashboard`,r.id]}),n.invalidateQueries({queryKey:[`dashboard-versions`,r.id]}))},onRunErrorEvent:({event:e})=>{e.code===`abort`||te.current?(ie(``),C(!0)):(console.warn(`Agent run error`,e.code),ie(Je(e.code))),_(!1),fe()},onRunFinalized:({messages:e})=>{let t=pe(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),fe(),o.current.delete(s),n.invalidateQueries({queryKey:AO})},onRunFailed:e=>{he(e.error)?(ie(``),C(!0)):(console.error(`Agent run failed`,e),ie(Je())),_(!1),fe(),o.current.delete(s),n.invalidateQueries({queryKey:AO})}});return()=>{t=!1,i.unsubscribe(),ue.abortRun()}},[ue,e,n,ae,s]),(0,D.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(()=>ce.current?.focus()):t({to:`/chat`}).then(()=>requestAnimationFrame(()=>ce.current?.focus()))),e.key===`Escape`&&n===ce.current&&(w(``),ce.current?.blur())};return window.addEventListener(`keydown`,n),()=>window.removeEventListener(`keydown`,n)},[e,t,r]);async function ge(){_(!0),ie(``);try{await ue.runAgent({forwardedProps:{...se.current}})}catch(e){he(e)?(ie(``),C(!0)):(console.error(`Agent run failed`,e),ie(Je())),_(!1),fe(),o.current.delete(s)}}async function _e(n,i){let a=n.trim();if(!e||!a||g||!de||m)return;se.current={...i},r||(o.current.add(s),t({to:`/chat/$threadId`,params:{threadId:s},replace:!0}));let c={id:VO(),role:`user`,content:a};ue.addMessage(c),l([...ue.messages]),d(e=>({...e,[c.id]:Date.now()})),w(``),await ge()}(0,D.useEffect)(()=>{let e=oe.current;de&&r&&e&&(oe.current=null,_e(e.text,e.options))},[de,r,s]);function ve(e){e.preventDefault(),_e(ne)}function ye(){te.current=!0,ie(``),C(!0),ue.abortRun(),_(!1),fe(),o.current.delete(s)}function be(){!g&&ue.messages.some(e=>e.role===`user`)&&ge()}function xe(n,r){if(!e)return;let i=VO();o.current.add(i),oe.current=n?{text:n,options:{...r}}:null,t({to:`/chat/$threadId`,params:{threadId:i}})}function Se(){ue.abortRun(),oe.current=null,se.current={},a(VO()),t({to:`/chat`})}function Ce(e){oe.current=null,se.current={},t({to:`/chat/$threadId`,params:{threadId:e}})}function E(){T(e=>e+1)}return(0,O.jsx)(tt.Provider,{value:{agentAvailable:e,threadID:s,threadMissing:m,messages:c,messageTimes:u,ready:de,running:g,activity:v,provisional:b,stopped:S,input:ne,setInput:w,error:re,inputRef:ce,send:_e,submit:ve,stop:ye,retry:be,reloadThread:E,openChat:xe,newThread:Se,selectThread:Ce},children:(0,O.jsx)($O,{children:(0,O.jsx)(Zi,{})})})}function nk(){let e=(0,D.useMemo)(()=>new iO,[]);return(0,O.jsx)(yn,{client:e,children:(0,O.jsx)(Ae,{children:(0,O.jsx)(tk,{})})})}var rk=Ft({component:nk,notFoundComponent:()=>(0,O.jsx)(je,{to:`/`,replace:!0})}),ik=Nt(`/`)({component:Rt(()=>it(()=>import(`./routes-DacnUMnD.js`),__vite__mapDeps([0,1,2])),`component`)}),ak=Nt(`/settings`)({component:Rt(()=>it(()=>import(`./settings-C3gN9Qyk.js`),__vite__mapDeps([3,1,2,4,5,6,7,8])),`component`)}),ok=Nt(`/chat/`)({component:Rt(()=>it(()=>import(`./chat.index-C9Zt69Sm.js`),__vite__mapDeps([9,10,1,11,4,5,12])),`component`)}),sk=Nt(`/chat/$threadId`)({component:Rt(()=>it(()=>import(`./chat._threadId-C9Zt69Sm.js`),__vite__mapDeps([13,10,1,11,4,5,12])),`component`)}),ck=Nt(`/dashboards/`)({component:Rt(()=>it(()=>import(`./dashboards.index-AbQDHFtj.js`),__vite__mapDeps([14,1,2,15,11,5,4,16,6,7,17,12,8])),`component`),validateSearch:e=>Et(Ct(e))}),lk=Nt(`/dashboards/$dashboardId`)({component:Rt(()=>it(()=>import(`./dashboards._dashboardId-pWSoK2cx.js`),__vite__mapDeps([18,1,2,15,11,5,4,16,6,7,17,12,8])),`component`),validateSearch:e=>Et(Ct(e))}),uk=ik.update({id:`/`,path:`/`,getParentRoute:()=>rk}),dk=ak.update({id:`/settings`,path:`/settings`,getParentRoute:()=>rk}),fk=ok.update({id:`/chat/`,path:`/chat/`,getParentRoute:()=>rk}),pk=sk.update({id:`/chat/$threadId`,path:`/chat/$threadId`,getParentRoute:()=>rk}),mk=ck.update({id:`/dashboards/`,path:`/dashboards/`,getParentRoute:()=>rk}),hk={IndexRoute:uk,SettingsRoute:dk,ChatThreadIdRoute:pk,DashboardsDashboardIdRoute:lk.update({id:`/dashboards/$dashboardId`,path:`/dashboards/$dashboardId`,getParentRoute:()=>rk}),ChatIndexRoute:fk,DashboardsIndexRoute:mk},gk=ra({routeTree:rk._addFileChildren(hk)._addFileTypes(),parseSearch:Bt,stringifySearch:ht,defaultPreload:`intent`,scrollRestoration:!0}),_k=wt(_),vk=Ea({...Mt,variantColorResolver:_k});(0,Fo.createRoot)(document.getElementById(`root`)).render((0,O.jsx)(D.StrictMode,{children:(0,O.jsx)(Ta,{theme:vk,defaultColorScheme:`auto`,cssVariablesResolver:Lt,children:(0,O.jsx)(oa,{router:gk})})}));export{o_ as A,wv as C,dv as D,B as E,Iu as F,Qm as M,Jm as N,rv as O,qm as P,lv as S,_v as T,Uv as _,C_ as a,av as b,yv as c,U as d,sv as f,hv as g,D_ as h,jO as i,e_ as j,j_ as k,ev as l,pv as m,ck as n,S_ as o,H as p,UO as r,q_ as s,lk as t,Q_ as u,G as v,Jv as w,J_ as x,W as y}; \ No newline at end of file diff --git a/internal/ui/dist/assets/mcp-app-frame-CtnQ8BLx.js b/internal/ui/dist/assets/mcp-app-frame-DmplPDO9.js similarity index 99% rename from internal/ui/dist/assets/mcp-app-frame-CtnQ8BLx.js rename to internal/ui/dist/assets/mcp-app-frame-DmplPDO9.js index 943d15d26..32148336e 100644 --- a/internal/ui/dist/assets/mcp-app-frame-CtnQ8BLx.js +++ b/internal/ui/dist/assets/mcp-app-frame-DmplPDO9.js @@ -1,4 +1,4 @@ -import{C as e,St as t,_t as n,d as r,f as i,p as a,u as o,y as s,yt as c}from"./brand-B8x2UvAx.js";import{i as l}from"./auth-DQIRmg9h.js";import{t as u}from"./use-computed-color-scheme-DxHBJokx.js";import{t as d}from"./FocusTrap-yuoZ2xkr.js";import{n as f}from"./chat-C7NkH_Mg.js";import{A as p,C as m,D as h,E as g,F as _,M as v,N as y,O as b,P as x,S,T as C,_ as ee,a as w,b as T,c as E,d as te,f as D,g as ne,h as re,j as ie,k as ae,l as oe,m as se,o as ce,p as O,s as le,u as ue,v as k,w as A,x as j,y as M}from"./index-C23tbW7l.js";var de={invalid_type:`invalid_type`,too_big:`too_big`,too_small:`too_small`,invalid_format:`invalid_format`,not_multiple_of:`not_multiple_of`,unrecognized_keys:`unrecognized_keys`,invalid_union:`invalid_union`,invalid_key:`invalid_key`,invalid_element:`invalid_element`,invalid_value:`invalid_value`,custom:`custom`},fe;fe||={};function pe(e){return x(ce,e)}function me(e){return y(w,e)}function he(e){return v(le,e)}function N(e){return typeof e==`object`&&e&&!Array.isArray(e)?e:void 0}function P(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 ge(e){let t=N(N(N(e)?.ui)?.csp),n=P(t?.connectDomains,[`http`,`https`,`ws`,`wss`]),r=P(t?.resourceDomains,[`http`,`https`]),i=P(t?.frameDomains,[`http`,`https`]),a=P(t?.baseUriDomains,[`http`,`https`]),o=r.length?` ${r.join(` `)}`:``,s=[`default-src 'none'`,`worker-src blob:`,`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(`; `)};`}var _e=Object.create,ve=Object.defineProperty,ye=Object.getOwnPropertyDescriptor,be=Object.getOwnPropertyNames,F=Object.getPrototypeOf,xe=Object.prototype.hasOwnProperty,Se=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),Ce=(e,t)=>{let n={};for(var r in e)ve(n,r,{get:e[r],enumerable:!0});return t&&ve(n,Symbol.toStringTag,{value:`Module`}),n},we=(e,t,n,r)=>{if(t&&typeof t==`object`||typeof t==`function`)for(var i=be(t),a=0,o=i.length,s;at[e]).bind(null,s),enumerable:!(r=ye(t,s))||r.enumerable});return e},Te=(e,t,n)=>(n=e==null?{}:_e(F(e)),we(t||!e||!e.__esModule?ve(n,`default`,{value:e,enumerable:!0}):n,e)),Ee=new Set([`https://json-schema.org/draft/2020-12/schema`,`http://json-schema.org/draft/2020-12/schema`]),De=new Set([`https://json-schema.org/draft/2019-09/schema`,`http://json-schema.org/draft/2019-09/schema`]),Oe=new Set([`https://json-schema.org/draft-07/schema`,`http://json-schema.org/draft-07/schema`]),ke=new Set([`https://json-schema.org/draft-06/schema`,`http://json-schema.org/draft-06/schema`]);function Ae(e){return typeof e==`string`&&De.has(e.replace(/#$/,``))}function je(e,t){if(!(`$schema`in e)||typeof e.$schema!=`string`)return`2020-12`;let n=e.$schema.replace(/#$/,``);if(Ee.has(n))return`2020-12`;if(De.has(n))return`2019-09`;if(Oe.has(n)||ke.has(n))return`draft-7`;throw Error(`JSON Schema declares an unsupported dialect ("$schema": "${e.$schema.slice(0,200)}"). The default validator supports JSON Schema 2020-12, 2019-09, draft-07, and draft-06; ${t}`)}var Me=`2025-11-25`,Ne=[Me,`2025-06-18`,`2025-03-26`,`2024-11-05`,`2024-10-07`],Pe=`io.modelcontextprotocol/related-task`,Fe=`io.modelcontextprotocol/protocolVersion`,Ie=`io.modelcontextprotocol/clientInfo`,Le=`io.modelcontextprotocol/serverInfo`,Re=`io.modelcontextprotocol/clientCapabilities`,ze=`io.modelcontextprotocol/subscriptionId`,Be=`io.modelcontextprotocol/logLevel`,Ve=ee(()=>h([g(),j(),O(),oe(),C(g(),Ve),D(Ve)])),I=C(g(),Ve),He=D(Ve),Ue=h([g(),j().int()]),We=g(),Ge=S({ttl:j().optional()}),Ke=S({taskId:g()}),qe=M({progressToken:Ue.optional(),[Pe]:Ke.optional()}),L=S({_meta:qe.optional()}),Je=L.extend({task:Ge.optional()}),R=S({method:g(),params:L.loose().optional()}),z=S({_meta:qe.optional()}),B=S({method:g(),params:z.loose().optional()}),Ye=M({get[Le](){return H.optional().catch(void 0)}}),V=M({_meta:Ye.optional()}),Xe=h([g(),j().int()]),Ze=S({jsonrpc:k(`2.0`),id:Xe,...R.shape}).strict(),Qe=S({jsonrpc:k(`2.0`),...B.shape}).strict(),$e=S({jsonrpc:k(`2.0`),id:Xe,result:V}).strict(),et=S({jsonrpc:k(`2.0`),id:Xe.optional(),error:S({code:j().int(),message:g(),data:b().optional()})}).strict(),tt=h([Ze,Qe,$e,et]),nt=h([$e,et]),rt=V.strict(),it=z.extend({requestId:Xe.optional(),reason:g().optional()}),at=B.extend({method:k(`notifications/cancelled`),params:it}),ot=S({src:g(),mimeType:g().optional(),sizes:D(g()).optional(),theme:E([`light`,`dark`]).optional()}),st=S({icons:D(ot).optional()}),ct=S({name:g(),title:g().optional()}),H=ct.extend({...ct.shape,...st.shape,version:g(),websiteUrl:g().optional(),description:g().optional()}),lt=ne(S({applyDefaults:O().optional()}),I),ut=A(e=>e&&typeof e==`object`&&!Array.isArray(e)&&Object.keys(e).length===0?{form:{}}:e,ne(S({form:lt.optional(),url:I.optional()}),I.optional())),dt=M({list:I.optional(),cancel:I.optional(),requests:M({sampling:M({createMessage:I.optional()}).optional(),elicitation:M({create:I.optional()}).optional()}).optional()}),ft=M({list:I.optional(),cancel:I.optional(),requests:M({tools:M({call:I.optional()}).optional()}).optional()}),pt=S({experimental:C(g(),I).optional(),sampling:S({context:I.optional(),tools:I.optional()}).optional(),elicitation:ut.optional(),roots:S({listChanged:O().optional()}).optional(),tasks:dt.optional(),extensions:C(g(),I).optional()}),mt=L.extend({protocolVersion:g(),capabilities:pt,clientInfo:H}),ht=R.extend({method:k(`initialize`),params:mt}),gt=S({experimental:C(g(),I).optional(),logging:I.optional(),completions:I.optional(),prompts:S({listChanged:O().optional()}).optional(),resources:S({subscribe:O().optional(),listChanged:O().optional()}).optional(),tools:S({listChanged:O().optional()}).optional(),tasks:ft.optional(),extensions:C(g(),I).optional()}),_t=V.extend({protocolVersion:g(),capabilities:gt,serverInfo:H,instructions:g().optional()}),vt=B.extend({method:k(`notifications/initialized`),params:z.optional()}),yt=R.extend({method:k(`server/discover`),params:L.optional()}),bt=V.extend({supportedVersions:D(g()),capabilities:gt,instructions:g().optional()}),xt=R.extend({method:k(`ping`),params:L.optional()}),St=S({progress:j(),total:m(j()),message:m(g())}),Ct=S({...z.shape,...St.shape,progressToken:Ue}),wt=B.extend({method:k(`notifications/progress`),params:Ct}),Tt=L.extend({cursor:We.optional()}),Et=R.extend({params:Tt.optional()}),Dt=V.extend({nextCursor:We.optional()}),Ot=S({uri:g(),mimeType:m(g()),_meta:C(g(),b()).optional()}),kt=Ot.extend({text:g()}),At=g().refine(e=>{try{return atob(e),!0}catch{return!1}},{message:`Invalid Base64 string`}),jt=Ot.extend({blob:At}),Mt=E([`user`,`assistant`]),Nt=S({audience:D(Mt).optional(),priority:j().min(0).max(1).optional(),lastModified:pe({offset:!0}).optional()}),Pt=S({...ct.shape,...st.shape,uri:g(),description:m(g()),mimeType:m(g()),size:m(j()),annotations:Nt.optional(),_meta:m(M({}))}),Ft=S({...ct.shape,...st.shape,uriTemplate:g(),description:m(g()),mimeType:m(g()),annotations:Nt.optional(),_meta:m(M({}))}),It=Et.extend({method:k(`resources/list`)}),Lt=Dt.extend({resources:D(Pt)}),U=Et.extend({method:k(`resources/templates/list`)}),W=Dt.extend({resourceTemplates:D(Ft)}),Rt=L.extend({uri:g()}),zt=Rt,Bt=R.extend({method:k(`resources/read`),params:zt}),Vt=V.extend({contents:D(h([kt,jt]))}),Ht=B.extend({method:k(`notifications/resources/list_changed`),params:z.optional()}),Ut=Rt,Wt=R.extend({method:k(`resources/subscribe`),params:Ut}),Gt=Rt,Kt=R.extend({method:k(`resources/unsubscribe`),params:Gt}),qt=S({toolsListChanged:O().optional(),promptsListChanged:O().optional(),resourcesListChanged:O().optional(),resourceSubscriptions:D(g()).optional()}),Jt=L.extend({notifications:qt}),Yt=R.extend({method:k(`subscriptions/listen`),params:Jt}),Xt=z.extend({notifications:qt}),Zt=B.extend({method:k(`notifications/subscriptions/acknowledged`),params:Xt}),Qt=Ye.extend({[ze]:Xe}),$t=V.extend({_meta:Qt}),en=z.extend({uri:g()}),tn=B.extend({method:k(`notifications/resources/updated`),params:en}),G=S({name:g(),description:m(g()),required:m(O())}),nn=S({...ct.shape,...st.shape,description:m(g()),arguments:m(D(G)),_meta:m(M({}))}),rn=Et.extend({method:k(`prompts/list`)}),an=Dt.extend({prompts:D(nn)}),on=L.extend({name:g(),arguments:C(g(),g()).optional()}),sn=R.extend({method:k(`prompts/get`),params:on}),cn=S({type:k(`text`),text:g(),annotations:Nt.optional(),_meta:C(g(),b()).optional()}),K=S({type:k(`image`),data:At,mimeType:g(),annotations:Nt.optional(),_meta:C(g(),b()).optional()}),ln=S({type:k(`audio`),data:At,mimeType:g(),annotations:Nt.optional(),_meta:C(g(),b()).optional()}),un=S({type:k(`tool_use`),name:g(),id:g(),input:C(g(),b()),_meta:C(g(),b()).optional()}),dn=S({type:k(`resource`),resource:h([kt,jt]),annotations:Nt.optional(),_meta:C(g(),b()).optional()}),fn=Pt.extend({type:k(`resource_link`)}),pn=h([cn,K,ln,fn,dn]),mn=S({role:Mt,content:pn}),hn=V.extend({description:g().optional(),messages:D(mn)}),gn=B.extend({method:k(`notifications/prompts/list_changed`),params:z.optional()}),_n=S({title:g().optional(),readOnlyHint:O().optional(),destructiveHint:O().optional(),idempotentHint:O().optional(),openWorldHint:O().optional()}),vn=S({taskSupport:E([`required`,`optional`,`forbidden`]).optional()}),yn=S({...ct.shape,...st.shape,description:g().optional(),inputSchema:S({type:k(`object`),properties:C(g(),Ve).optional(),required:D(g()).optional()}).catchall(b()),outputSchema:M({$schema:g().optional()}).optional(),annotations:_n.optional(),execution:vn.optional(),_meta:C(g(),b()).optional()}),bn=Et.extend({method:k(`tools/list`)}),xn=Dt.extend({tools:D(yn)}),Sn=V.extend({content:D(pn).default([]),structuredContent:b().optional(),isError:O().optional()}),Cn=Sn.or(V.extend({toolResult:b()})),wn=Je.extend({name:g(),arguments:C(g(),b()).optional()}),Tn=R.extend({method:k(`tools/call`),params:wn}),En=B.extend({method:k(`notifications/tools/list_changed`),params:z.optional()}),Dn=S({autoRefresh:O().default(!0),debounceMs:j().int().nonnegative().default(300)}),On=E([`debug`,`info`,`notice`,`warning`,`error`,`critical`,`alert`,`emergency`]),kn=L.extend({level:On}),An=R.extend({method:k(`logging/setLevel`),params:kn}),jn=z.extend({level:On,logger:g().optional(),data:b()}),Mn=B.extend({method:k(`notifications/message`),params:jn}),Nn=S({name:g().optional()}),Pn=S({hints:D(Nn).optional(),costPriority:j().min(0).max(1).optional(),speedPriority:j().min(0).max(1).optional(),intelligencePriority:j().min(0).max(1).optional()}),Fn=S({mode:E([`auto`,`required`,`none`]).optional()}),In=S({type:k(`tool_result`),toolUseId:g().describe(`The unique identifier for the corresponding tool call.`),content:D(pn),structuredContent:b().optional(),isError:O().optional(),_meta:C(g(),b()).optional()}),Ln=se(`type`,[cn,K,ln]),Rn=se(`type`,[cn,K,ln,un,In]),zn=S({role:Mt,content:h([Rn,D(Rn)]),_meta:C(g(),b()).optional()}),Bn=Je.extend({messages:D(zn),modelPreferences:Pn.optional(),systemPrompt:g().optional(),includeContext:E([`none`,`thisServer`,`allServers`]).optional(),temperature:j().optional(),maxTokens:j().int(),stopSequences:D(g()).optional(),metadata:I.optional(),tools:D(yn).optional(),toolChoice:Fn.optional()}),Vn=R.extend({method:k(`sampling/createMessage`),params:Bn}),Hn=V.extend({model:g(),stopReason:m(E([`endTurn`,`stopSequence`,`maxTokens`]).or(g())),role:Mt,content:Ln}),Un=V.extend({model:g(),stopReason:m(E([`endTurn`,`stopSequence`,`maxTokens`,`toolUse`]).or(g())),role:Mt,content:h([Rn,D(Rn)])}),Wn=S({type:k(`boolean`),title:g().optional(),description:g().optional(),default:O().optional()}),Gn=S({type:k(`string`),title:g().optional(),description:g().optional(),minLength:j().optional(),maxLength:j().optional(),format:E([`email`,`uri`,`date`,`date-time`]).optional(),default:g().optional()}),Kn=S({type:E([`number`,`integer`]),title:g().optional(),description:g().optional(),minimum:j().optional(),maximum:j().optional(),default:j().optional()}),qn=S({type:k(`string`),title:g().optional(),description:g().optional(),enum:D(g()),default:g().optional()}),Jn=S({type:k(`string`),title:g().optional(),description:g().optional(),oneOf:D(S({const:g(),title:g()})),default:g().optional()}),Yn=S({type:k(`string`),title:g().optional(),description:g().optional(),enum:D(g()),enumNames:D(g()).optional(),default:g().optional()}),Xn=h([qn,Jn]),Zn=S({type:k(`array`),title:g().optional(),description:g().optional(),minItems:j().optional(),maxItems:j().optional(),items:S({type:k(`string`),enum:D(g())}),default:D(g()).optional()}),Qn=S({type:k(`array`),title:g().optional(),description:g().optional(),minItems:j().optional(),maxItems:j().optional(),items:S({anyOf:D(S({const:g(),title:g()}))}),default:D(g()).optional()}),$n=h([Zn,Qn]),er=h([Yn,Xn,$n]),tr=h([er,Wn,Gn,Kn]),nr=Je.extend({mode:k(`form`).optional(),message:g(),requestedSchema:S({type:k(`object`),properties:C(g(),tr),required:D(g()).optional()}).catchall(b())}),rr=Je.extend({mode:k(`url`),message:g(),elicitationId:g(),url:g().url()}),ir=h([nr,rr]),ar=R.extend({method:k(`elicitation/create`),params:ir}),or=z.extend({elicitationId:g()}),sr=B.extend({method:k(`notifications/elicitation/complete`),params:or}),cr=V.extend({action:E([`accept`,`decline`,`cancel`]),content:A(e=>e===null?void 0:e,C(g(),h([g(),j(),O(),D(g())])).optional())}),lr=S({type:k(`ref/resource`),uri:g()}),ur=S({type:k(`ref/prompt`),name:g()}),dr=L.extend({ref:h([ur,lr]),argument:S({name:g(),value:g()}),context:S({arguments:C(g(),g()).optional()}).optional()}),fr=R.extend({method:k(`completion/complete`),params:dr}),pr=V.extend({completion:M({values:D(g()).max(100),total:m(j().int()),hasMore:m(O())})}),mr=S({uri:g().startsWith(`file://`),name:g().optional(),_meta:C(g(),b()).optional()}),hr=R.extend({method:k(`roots/list`),params:L.optional()}),gr=V.extend({roots:D(mr)}),_r=B.extend({method:k(`notifications/roots/list_changed`),params:z.optional()}),vr=M({ttl:j().optional(),pollInterval:j().optional()}),yr=E([`working`,`input_required`,`completed`,`failed`,`cancelled`]),br=S({taskId:g(),status:yr,ttl:h([j(),oe()]),createdAt:g(),lastUpdatedAt:g(),pollInterval:m(j()),statusMessage:m(g())}),xr=V.extend({task:br}),Sr=z.merge(br),Cr=B.extend({method:k(`notifications/tasks/status`),params:Sr}),wr=R.extend({method:k(`tasks/get`),params:L.extend({taskId:g()})}),Tr=V.merge(br),Er=R.extend({method:k(`tasks/result`),params:L.extend({taskId:g()})}),Dr=V.loose(),Or=Et.extend({method:k(`tasks/list`)}),kr=Dt.extend({tasks:D(br)}),Ar=R.extend({method:k(`tasks/cancel`),params:L.extend({taskId:g()})}),jr=V.merge(br),Mr=h([xt,ht,yt,fr,An,sn,rn,It,U,Bt,Wt,Kt,Yt,Tn,bn]),Nr=h([at,wt,vt,_r]),Pr=h([rt,Hn,Un,cr,gr]),Fr=h([xt,Vn,ar,hr]),Ir=h([at,wt,Mn,tn,Ht,En,gn,Zt,sr]),Lr=h([rt,_t,bt,pr,hn,an,Lt,W,Vt,Sn,xn,$t]),q=ae().superRefine((e,t)=>{if(!URL.canParse(e))return t.addIssue({code:de.custom,message:`URL must be parseable`,fatal:!0}),_}).refine(e=>{let t=new URL(e);return t.protocol!==`javascript:`&&t.protocol!==`data:`&&t.protocol!==`vbscript:`},{message:`URL cannot use javascript:, data:, or vbscript: scheme`}),Rr=M({resource:g().url(),authorization_servers:D(q).optional(),jwks_uri:g().url().optional(),scopes_supported:D(g()).optional(),bearer_methods_supported:D(g()).optional(),resource_signing_alg_values_supported:D(g()).optional(),resource_name:g().optional(),resource_documentation:g().optional(),resource_policy_uri:g().url().optional(),resource_tos_uri:g().url().optional(),tls_client_certificate_bound_access_tokens:O().optional(),authorization_details_types_supported:D(g()).optional(),dpop_signing_alg_values_supported:D(g()).optional(),dpop_bound_access_tokens_required:O().optional()}),zr=M({issuer:g(),authorization_endpoint:q,token_endpoint:q,registration_endpoint:q.optional(),scopes_supported:D(g()).optional(),response_types_supported:D(g()),response_modes_supported:D(g()).optional(),grant_types_supported:D(g()).optional(),token_endpoint_auth_methods_supported:D(g()).optional(),token_endpoint_auth_signing_alg_values_supported:D(g()).optional(),service_documentation:q.optional(),revocation_endpoint:q.optional(),revocation_endpoint_auth_methods_supported:D(g()).optional(),revocation_endpoint_auth_signing_alg_values_supported:D(g()).optional(),introspection_endpoint:g().optional(),introspection_endpoint_auth_methods_supported:D(g()).optional(),introspection_endpoint_auth_signing_alg_values_supported:D(g()).optional(),code_challenge_methods_supported:D(g()).optional(),client_id_metadata_document_supported:O().optional(),authorization_response_iss_parameter_supported:O().optional().catch(void 0),dpop_signing_alg_values_supported:D(g()).optional()}),Br=M({issuer:g(),authorization_endpoint:q,token_endpoint:q,userinfo_endpoint:q.optional(),jwks_uri:q,registration_endpoint:q.optional(),scopes_supported:D(g()).optional(),response_types_supported:D(g()),response_modes_supported:D(g()).optional(),grant_types_supported:D(g()).optional(),acr_values_supported:D(g()).optional(),subject_types_supported:D(g()),id_token_signing_alg_values_supported:D(g()),id_token_encryption_alg_values_supported:D(g()).optional(),id_token_encryption_enc_values_supported:D(g()).optional(),userinfo_signing_alg_values_supported:D(g()).optional(),userinfo_encryption_alg_values_supported:D(g()).optional(),userinfo_encryption_enc_values_supported:D(g()).optional(),request_object_signing_alg_values_supported:D(g()).optional(),request_object_encryption_alg_values_supported:D(g()).optional(),request_object_encryption_enc_values_supported:D(g()).optional(),token_endpoint_auth_methods_supported:D(g()).optional(),token_endpoint_auth_signing_alg_values_supported:D(g()).optional(),display_values_supported:D(g()).optional(),claim_types_supported:D(g()).optional(),claims_supported:D(g()).optional(),service_documentation:g().optional(),claims_locales_supported:D(g()).optional(),ui_locales_supported:D(g()).optional(),claims_parameter_supported:O().optional(),request_parameter_supported:O().optional(),request_uri_parameter_supported:O().optional(),require_request_uri_registration:O().optional(),op_policy_uri:q.optional(),op_tos_uri:q.optional(),client_id_metadata_document_supported:O().optional(),authorization_response_iss_parameter_supported:O().optional().catch(void 0)}),Vr=S({...Br.shape,...zr.pick({code_challenge_methods_supported:!0}).shape}),Hr=S({access_token:g(),id_token:g().optional(),token_type:g(),expires_in:he().optional(),scope:g().optional(),refresh_token:g().optional(),issuer:g().optional().catch(void 0)}).strip(),Ur=S({issued_token_type:k(`urn:ietf:params:oauth:token-type:id-jag`),access_token:g(),token_type:g().optional(),expires_in:j().optional(),scope:g().optional()}).strip(),Wr=S({error:g(),error_description:g().optional(),error_uri:g().optional()}),Gr=q.optional().or(k(``).transform(()=>void 0)),Kr=S({redirect_uris:D(q),token_endpoint_auth_method:g().optional(),grant_types:D(g()).optional(),response_types:D(g()).optional(),application_type:g().optional(),client_name:g().optional(),client_uri:q.optional(),logo_uri:Gr,scope:g().optional(),contacts:D(g()).optional(),tos_uri:Gr,policy_uri:g().optional(),jwks_uri:q.optional(),jwks:te().optional(),software_id:g().optional(),software_version:g().optional(),software_statement:g().optional()}).strip(),qr=S({client_id:g(),client_secret:g().optional(),client_id_issued_at:j().optional(),client_secret_expires_at:j().optional(),issuer:g().optional().catch(void 0)}).strip(),Jr=Kr.merge(qr),Yr=S({error:g(),error_description:g().optional()}).strip(),Xr=S({token:g(),token_type_hint:g().optional()}).strip(),Zr=Symbol.for(`mcp.sdk.errorBrands`);function Qr(e,t){let n=new Set,r=t;for(;typeof r==`function`;){let e=r.mcpBrand;Object.prototype.hasOwnProperty.call(r,`mcpBrand`)&&typeof e==`string`&&n.add(e),r=Object.getPrototypeOf(r)}n.size!==0&&Object.defineProperty(e,Zr,{value:n,enumerable:!1,configurable:!0})}function $r(e,t){try{if(typeof t==`object`&&t&&Object.prototype.hasOwnProperty.call(e,`mcpBrand`)&&typeof e.mcpBrand==`string`&&Object.prototype.hasOwnProperty.call(t,Zr)){let n=t[Zr];if(n&&typeof n.has==`function`&&n.has(e.mcpBrand))return!0}}catch{}return Function.prototype[Symbol.hasInstance].call(e,t)}var ei=function(e){return e.InvalidRequest=`invalid_request`,e.InvalidClient=`invalid_client`,e.InvalidGrant=`invalid_grant`,e.UnauthorizedClient=`unauthorized_client`,e.UnsupportedGrantType=`unsupported_grant_type`,e.InvalidScope=`invalid_scope`,e.AccessDenied=`access_denied`,e.ServerError=`server_error`,e.TemporarilyUnavailable=`temporarily_unavailable`,e.UnsupportedResponseType=`unsupported_response_type`,e.UnsupportedTokenType=`unsupported_token_type`,e.InvalidToken=`invalid_token`,e.MethodNotAllowed=`method_not_allowed`,e.TooManyRequests=`too_many_requests`,e.InvalidClientMetadata=`invalid_client_metadata`,e.InvalidRedirectUri=`invalid_redirect_uri`,e.InsufficientScope=`insufficient_scope`,e.InvalidTarget=`invalid_target`,e.InvalidDpopProof=`invalid_dpop_proof`,e.UseDpopNonce=`use_dpop_nonce`,e}({}),ti=class e extends Error{static{Object.defineProperty(this,"mcpBrand",{value:`mcp.OAuthError`})}static[Symbol.hasInstance](e){return $r(this,e)}static isInstance(e){if(typeof this!=`function`)throw TypeError("isInstance must be called on the class (e.g. `SdkError.isInstance(value)`); for callbacks use `v => SdkError.isInstance(v)`");return $r(this,e)}constructor(e,t,n){super(t),this.code=e,this.errorUri=n,this.name=`OAuthError`,Qr(this,new.target)}toResponseObject(){let e={error:this.code,error_description:this.message};return this.errorUri&&(e.error_uri=this.errorUri),e}static fromResponse(t){return new e(t.error,t.error_description??t.error,t.error_uri)}},J=function(e){return e.NotConnected=`NOT_CONNECTED`,e.AlreadyConnected=`ALREADY_CONNECTED`,e.NotInitialized=`NOT_INITIALIZED`,e.CapabilityNotSupported=`CAPABILITY_NOT_SUPPORTED`,e.RequestTimeout=`REQUEST_TIMEOUT`,e.ConnectionClosed=`CONNECTION_CLOSED`,e.SendFailed=`SEND_FAILED`,e.InvalidResult=`INVALID_RESULT`,e.UnsupportedResultType=`UNSUPPORTED_RESULT_TYPE`,e.InputRequiredRoundsExceeded=`INPUT_REQUIRED_ROUNDS_EXCEEDED`,e.ListPaginationExceeded=`LIST_PAGINATION_EXCEEDED`,e.MethodNotSupportedByProtocolVersion=`METHOD_NOT_SUPPORTED_BY_PROTOCOL_VERSION`,e.EraNegotiationFailed=`ERA_NEGOTIATION_FAILED`,e.ClientHttpNotImplemented=`CLIENT_HTTP_NOT_IMPLEMENTED`,e.ClientHttpAuthentication=`CLIENT_HTTP_AUTHENTICATION`,e.ClientHttpForbidden=`CLIENT_HTTP_FORBIDDEN`,e.ClientHttpUnexpectedContent=`CLIENT_HTTP_UNEXPECTED_CONTENT`,e.ClientHttpFailedToOpenStream=`CLIENT_HTTP_FAILED_TO_OPEN_STREAM`,e.ClientHttpFailedToTerminateSession=`CLIENT_HTTP_FAILED_TO_TERMINATE_SESSION`,e}({}),Y=class extends Error{static{Object.defineProperty(this,"mcpBrand",{value:`mcp.SdkError`})}static[Symbol.hasInstance](e){return $r(this,e)}static isInstance(e){if(typeof this!=`function`)throw TypeError("isInstance must be called on the class (e.g. `SdkError.isInstance(value)`); for callbacks use `v => SdkError.isInstance(v)`");return $r(this,e)}constructor(e,t,n,r){super(t,r),this.code=e,this.data=n,this.name=`SdkError`,Qr(this,new.target)}},ni=class extends Y{static{Object.defineProperty(this,"mcpBrand",{value:`mcp.SdkHttpError`})}constructor(e,t,n,r){super(e,t,n,r),this.name=`SdkHttpError`}get status(){return this.data.status}get statusText(){return this.data.statusText}};function ri(e){let t=typeof e==`string`?new URL(e):new URL(e.href);return t.hash=``,t}function ii(e){if(typeof e!=`object`||!e||Array.isArray(e))return e;let t={...e};return delete t.issuer,t}function ai({requestedResource:e,configuredResource:t}){let n=typeof e==`string`?new URL(e):new URL(e.href),r=typeof t==`string`?new URL(t):new URL(t.href);if(n.origin!==r.origin||n.pathname.length=oi}function li(e){return e.filter(e=>!ci(e))}function ui(e){return e.filter(e=>ci(e))}function di(e){let t=e.structuredContent;return t===void 0||typeof t==`object`&&t&&!Array.isArray(t)||(e.content?.some(e=>e.type===`text`)??!1)?e:{...e,content:[...e.content??[],{type:`text`,text:JSON.stringify(t)}]}}var fi=[`task`,`inputRequests`,`requestState`];function pi(e){return typeof e!=`object`||!e||Array.isArray(e)||e.content!==void 0||fi.some(t=>t in e)?e:{...e,content:[]}}function mi(){let e=ee(()=>h([g(),j(),O(),oe(),C(g(),e),D(e)])),t=C(g(),e),n=h([g(),j().int()]),r=g(),i=S({ttl:j().optional()}),a=S({taskId:g()}),o=M({progressToken:n.optional(),"io.modelcontextprotocol/related-task":a.optional()}),s=S({_meta:o.optional()}),c=s.extend({task:i.optional()}),l=S({method:g(),params:s.loose().optional()}),u=S({_meta:o.optional()}),d=S({method:g(),params:u.loose().optional()}),f=M({_meta:o.optional()}),p=h([g(),j().int()]),_=f.strict(),v=u.extend({requestId:p.optional(),reason:g().optional()}),y=d.extend({method:k(`notifications/cancelled`),params:v}),x=S({src:g(),mimeType:g().optional(),sizes:D(g()).optional(),theme:E([`light`,`dark`]).optional()}),w=S({icons:D(x).optional()}),T=S({name:g(),title:g().optional()}),te=T.extend({...T.shape,...w.shape,version:g(),websiteUrl:g().optional(),description:g().optional()}),re=ne(S({applyDefaults:O().optional()}),t),ie=A(e=>e&&typeof e==`object`&&!Array.isArray(e)&&Object.keys(e).length===0?{form:{}}:e,ne(S({form:re.optional(),url:t.optional()}),t.optional())),ae=M({list:t.optional(),cancel:t.optional(),requests:M({sampling:M({createMessage:t.optional()}).optional(),elicitation:M({create:t.optional()}).optional()}).optional()}),ce=M({list:t.optional(),cancel:t.optional(),requests:M({tools:M({call:t.optional()}).optional()}).optional()}),le=S({experimental:C(g(),t).optional(),sampling:S({context:t.optional(),tools:t.optional()}).optional(),elicitation:ie.optional(),roots:S({listChanged:O().optional()}).optional(),tasks:ae.optional(),extensions:C(g(),t).optional()}),ue=s.extend({protocolVersion:g(),capabilities:le,clientInfo:te}),de=l.extend({method:k(`initialize`),params:ue}),fe=S({experimental:C(g(),t).optional(),logging:t.optional(),completions:t.optional(),prompts:S({listChanged:O().optional()}).optional(),resources:S({subscribe:O().optional(),listChanged:O().optional()}).optional(),tools:S({listChanged:O().optional()}).optional(),tasks:ce.optional(),extensions:C(g(),t).optional()}),me=f.extend({protocolVersion:g(),capabilities:fe,serverInfo:te,instructions:g().optional()}),he=d.extend({method:k(`notifications/initialized`),params:u.optional()}),N=l.extend({method:k(`ping`),params:s.optional()}),P=S({progress:j(),total:m(j()),message:m(g())}),ge=S({...u.shape,...P.shape,progressToken:n}),_e=d.extend({method:k(`notifications/progress`),params:ge}),ve=s.extend({cursor:r.optional()}),ye=l.extend({params:ve.optional()}),be=f.extend({nextCursor:r.optional()}),F=S({uri:g(),mimeType:m(g()),_meta:C(g(),b()).optional()}),xe=F.extend({text:g()}),Se=g().refine(e=>{try{return atob(e),!0}catch{return!1}},{message:`Invalid Base64 string`}),Ce=F.extend({blob:Se}),we=E([`user`,`assistant`]),Te=S({audience:D(we).optional(),priority:j().min(0).max(1).optional(),lastModified:pe({offset:!0}).optional()}),Ee=S({...T.shape,...w.shape,uri:g(),description:m(g()),mimeType:m(g()),size:m(j()),annotations:Te.optional(),_meta:m(M({}))}),De=S({...T.shape,...w.shape,uriTemplate:g(),description:m(g()),mimeType:m(g()),annotations:Te.optional(),_meta:m(M({}))}),Oe=ye.extend({method:k(`resources/list`)}),ke=be.extend({resources:D(Ee)}),Ae=ye.extend({method:k(`resources/templates/list`)}),je=be.extend({resourceTemplates:D(De)}),Me=s.extend({uri:g()}),Ne=Me,Pe=l.extend({method:k(`resources/read`),params:Ne}),Fe=f.extend({contents:D(h([xe,Ce]))}),Ie=d.extend({method:k(`notifications/resources/list_changed`),params:u.optional()}),Le=Me,Re=l.extend({method:k(`resources/subscribe`),params:Le}),ze=Me,Be=l.extend({method:k(`resources/unsubscribe`),params:ze}),Ve=u.extend({uri:g()}),I=d.extend({method:k(`notifications/resources/updated`),params:Ve}),He=S({name:g(),description:m(g()),required:m(O())}),Ue=S({...T.shape,...w.shape,description:m(g()),arguments:m(D(He)),_meta:m(M({}))}),We=ye.extend({method:k(`prompts/list`)}),Ge=be.extend({prompts:D(Ue)}),Ke=s.extend({name:g(),arguments:C(g(),g()).optional()}),qe=l.extend({method:k(`prompts/get`),params:Ke}),L=S({type:k(`text`),text:g(),annotations:Te.optional(),_meta:C(g(),b()).optional()}),Je=S({type:k(`image`),data:Se,mimeType:g(),annotations:Te.optional(),_meta:C(g(),b()).optional()}),R=S({type:k(`audio`),data:Se,mimeType:g(),annotations:Te.optional(),_meta:C(g(),b()).optional()}),z=S({type:k(`tool_use`),name:g(),id:g(),input:C(g(),b()),_meta:C(g(),b()).optional()}),B=S({type:k(`resource`),resource:h([xe,Ce]),annotations:Te.optional(),_meta:C(g(),b()).optional()}),Ye=Ee.extend({type:k(`resource_link`)}),V=h([L,Je,R,Ye,B]),Xe=S({role:we,content:V}),Ze=f.extend({description:g().optional(),messages:D(Xe)}),Qe=d.extend({method:k(`notifications/prompts/list_changed`),params:u.optional()}),$e=S({title:g().optional(),readOnlyHint:O().optional(),destructiveHint:O().optional(),idempotentHint:O().optional(),openWorldHint:O().optional()}),et=S({taskSupport:E([`required`,`optional`,`forbidden`]).optional()}),tt=S({...T.shape,...w.shape,description:g().optional(),inputSchema:S({type:k(`object`),properties:C(g(),e).optional(),required:D(g()).optional()}).catchall(b()),outputSchema:S({type:k(`object`),properties:C(g(),e).optional(),required:D(g()).optional()}).catchall(b()).optional(),annotations:$e.optional(),execution:et.optional(),_meta:C(g(),b()).optional()}),nt=ye.extend({method:k(`tools/list`)}),rt=be.extend({tools:D(tt)}),it=f.extend({content:D(V),structuredContent:C(g(),b()).optional(),isError:O().optional()}),at=c.extend({name:g(),arguments:C(g(),b()).optional()}),ot=l.extend({method:k(`tools/call`),params:at}),st=d.extend({method:k(`notifications/tools/list_changed`),params:u.optional()}),ct=E([`debug`,`info`,`notice`,`warning`,`error`,`critical`,`alert`,`emergency`]),H=s.extend({level:ct}),lt=l.extend({method:k(`logging/setLevel`),params:H}),ut=u.extend({level:ct,logger:g().optional(),data:b()}),dt=d.extend({method:k(`notifications/message`),params:ut}),ft=S({name:g().optional()}),pt=S({hints:D(ft).optional(),costPriority:j().min(0).max(1).optional(),speedPriority:j().min(0).max(1).optional(),intelligencePriority:j().min(0).max(1).optional()}),mt=S({mode:E([`auto`,`required`,`none`]).optional()}),ht=S({type:k(`tool_result`),toolUseId:g().describe(`The unique identifier for the corresponding tool call.`),content:D(V),structuredContent:S({}).loose().optional(),isError:O().optional(),_meta:C(g(),b()).optional()}),gt=se(`type`,[L,Je,R]),_t=se(`type`,[L,Je,R,z,ht]),vt=S({role:we,content:h([_t,D(_t)]),_meta:C(g(),b()).optional()}),yt=c.extend({messages:D(vt),modelPreferences:pt.optional(),systemPrompt:g().optional(),includeContext:E([`none`,`thisServer`,`allServers`]).optional(),temperature:j().optional(),maxTokens:j().int(),stopSequences:D(g()).optional(),metadata:t.optional(),tools:D(tt).optional(),toolChoice:mt.optional()}),bt=l.extend({method:k(`sampling/createMessage`),params:yt}),xt=f.extend({model:g(),stopReason:m(E([`endTurn`,`stopSequence`,`maxTokens`]).or(g())),role:we,content:gt}),St=f.extend({model:g(),stopReason:m(E([`endTurn`,`stopSequence`,`maxTokens`,`toolUse`]).or(g())),role:we,content:h([_t,D(_t)])}),Ct=S({type:k(`boolean`),title:g().optional(),description:g().optional(),default:O().optional()}),wt=S({type:k(`string`),title:g().optional(),description:g().optional(),minLength:j().optional(),maxLength:j().optional(),format:E([`email`,`uri`,`date`,`date-time`]).optional(),default:g().optional()}),Tt=S({type:E([`number`,`integer`]),title:g().optional(),description:g().optional(),minimum:j().optional(),maximum:j().optional(),default:j().optional()}),Et=S({type:k(`string`),title:g().optional(),description:g().optional(),enum:D(g()),default:g().optional()}),Dt=S({type:k(`string`),title:g().optional(),description:g().optional(),oneOf:D(S({const:g(),title:g()})),default:g().optional()}),Ot=S({type:k(`string`),title:g().optional(),description:g().optional(),enum:D(g()),enumNames:D(g()).optional(),default:g().optional()}),kt=h([Et,Dt]),At=S({type:k(`array`),title:g().optional(),description:g().optional(),minItems:j().optional(),maxItems:j().optional(),items:S({type:k(`string`),enum:D(g())}),default:D(g()).optional()}),jt=S({type:k(`array`),title:g().optional(),description:g().optional(),minItems:j().optional(),maxItems:j().optional(),items:S({anyOf:D(S({const:g(),title:g()}))}),default:D(g()).optional()}),Mt=h([At,jt]),Nt=h([Ot,kt,Mt]),Pt=h([Nt,Ct,wt,Tt]),Ft=c.extend({mode:k(`form`).optional(),message:g(),requestedSchema:S({type:k(`object`),properties:C(g(),Pt),required:D(g()).optional()}).catchall(b())}),It=c.extend({mode:k(`url`),message:g(),elicitationId:g(),url:g().url()}),Lt=h([Ft,It]),U=l.extend({method:k(`elicitation/create`),params:Lt}),W=u.extend({elicitationId:g()}),Rt=d.extend({method:k(`notifications/elicitation/complete`),params:W}),zt=f.extend({action:E([`accept`,`decline`,`cancel`]),content:A(e=>e===null?void 0:e,C(g(),h([g(),j(),O(),D(g())])).optional())}),Bt=S({type:k(`ref/resource`),uri:g()}),Vt=S({type:k(`ref/prompt`),name:g()}),Ht=s.extend({ref:h([Vt,Bt]),argument:S({name:g(),value:g()}),context:S({arguments:C(g(),g()).optional()}).optional()}),Ut=l.extend({method:k(`completion/complete`),params:Ht}),Wt=f.extend({completion:M({values:D(g()).max(100),total:m(j().int()),hasMore:m(O())})}),Gt=S({uri:g().startsWith(`file://`),name:g().optional(),_meta:C(g(),b()).optional()}),Kt=l.extend({method:k(`roots/list`),params:s.optional()}),qt=f.extend({roots:D(Gt)}),Jt=d.extend({method:k(`notifications/roots/list_changed`),params:u.optional()}),Yt=M({ttl:j().optional(),pollInterval:j().optional()}),Xt=E([`working`,`input_required`,`completed`,`failed`,`cancelled`]),Zt=S({taskId:g(),status:Xt,ttl:h([j(),oe()]),createdAt:g(),lastUpdatedAt:g(),pollInterval:m(j()),statusMessage:m(g())}),Qt=f.extend({task:Zt}),$t=u.merge(Zt),en=d.extend({method:k(`notifications/tasks/status`),params:$t}),tn=l.extend({method:k(`tasks/get`),params:s.extend({taskId:g()})}),G=f.merge(Zt),nn=l.extend({method:k(`tasks/result`),params:s.extend({taskId:g()})}),rn=f.loose(),an=ye.extend({method:k(`tasks/list`)}),on=be.extend({tasks:D(Zt)}),sn=l.extend({method:k(`tasks/cancel`),params:s.extend({taskId:g()})});return{JSONValueSchema:e,JSONObjectSchema:t,ProgressTokenSchema:n,CursorSchema:r,TaskMetadataSchema:i,RelatedTaskMetadataSchema:a,RequestMetaSchema:o,BaseRequestParamsSchema:s,TaskAugmentedRequestParamsSchema:c,RequestSchema:l,NotificationsParamsSchema:u,NotificationSchema:d,ResultSchema:f,RequestIdSchema:p,EmptyResultSchema:_,CancelledNotificationParamsSchema:v,CancelledNotificationSchema:y,IconSchema:x,IconsSchema:w,BaseMetadataSchema:T,ImplementationSchema:te,ClientTasksCapabilitySchema:ae,ServerTasksCapabilitySchema:ce,ClientCapabilitiesSchema:le,InitializeRequestParamsSchema:ue,InitializeRequestSchema:de,ServerCapabilitiesSchema:fe,InitializeResultSchema:me,InitializedNotificationSchema:he,PingRequestSchema:N,ProgressSchema:P,ProgressNotificationParamsSchema:ge,ProgressNotificationSchema:_e,PaginatedRequestParamsSchema:ve,PaginatedRequestSchema:ye,PaginatedResultSchema:be,ResourceContentsSchema:F,TextResourceContentsSchema:xe,BlobResourceContentsSchema:Ce,RoleSchema:we,AnnotationsSchema:Te,ResourceSchema:Ee,ResourceTemplateSchema:De,ListResourcesRequestSchema:Oe,ListResourcesResultSchema:ke,ListResourceTemplatesRequestSchema:Ae,ListResourceTemplatesResultSchema:je,ResourceRequestParamsSchema:Me,ReadResourceRequestParamsSchema:Ne,ReadResourceRequestSchema:Pe,ReadResourceResultSchema:Fe,ResourceListChangedNotificationSchema:Ie,SubscribeRequestParamsSchema:Le,SubscribeRequestSchema:Re,UnsubscribeRequestParamsSchema:ze,UnsubscribeRequestSchema:Be,ResourceUpdatedNotificationParamsSchema:Ve,ResourceUpdatedNotificationSchema:I,PromptArgumentSchema:He,PromptSchema:Ue,ListPromptsRequestSchema:We,ListPromptsResultSchema:Ge,GetPromptRequestParamsSchema:Ke,GetPromptRequestSchema:qe,TextContentSchema:L,ImageContentSchema:Je,AudioContentSchema:R,ToolUseContentSchema:z,EmbeddedResourceSchema:B,ResourceLinkSchema:Ye,ContentBlockSchema:V,PromptMessageSchema:Xe,GetPromptResultSchema:Ze,PromptListChangedNotificationSchema:Qe,ToolAnnotationsSchema:$e,ToolExecutionSchema:et,ToolSchema:tt,ListToolsRequestSchema:nt,ListToolsResultSchema:rt,CallToolResultSchema:it,CallToolRequestParamsSchema:at,CallToolRequestSchema:ot,ToolListChangedNotificationSchema:st,LoggingLevelSchema:ct,SetLevelRequestParamsSchema:H,SetLevelRequestSchema:lt,LoggingMessageNotificationParamsSchema:ut,LoggingMessageNotificationSchema:dt,ModelHintSchema:ft,ModelPreferencesSchema:pt,ToolChoiceSchema:mt,ToolResultContentSchema:ht,SamplingContentSchema:gt,SamplingMessageContentBlockSchema:_t,SamplingMessageSchema:vt,CreateMessageRequestParamsSchema:yt,CreateMessageRequestSchema:bt,CreateMessageResultSchema:xt,CreateMessageResultWithToolsSchema:St,BooleanSchemaSchema:Ct,StringSchemaSchema:wt,NumberSchemaSchema:Tt,UntitledSingleSelectEnumSchemaSchema:Et,TitledSingleSelectEnumSchemaSchema:Dt,LegacyTitledEnumSchemaSchema:Ot,SingleSelectEnumSchemaSchema:kt,UntitledMultiSelectEnumSchemaSchema:At,TitledMultiSelectEnumSchemaSchema:jt,MultiSelectEnumSchemaSchema:Mt,EnumSchemaSchema:Nt,PrimitiveSchemaDefinitionSchema:Pt,ElicitRequestFormParamsSchema:Ft,ElicitRequestURLParamsSchema:It,ElicitRequestParamsSchema:Lt,ElicitRequestSchema:U,ElicitationCompleteNotificationParamsSchema:W,ElicitationCompleteNotificationSchema:Rt,ElicitResultSchema:zt,ResourceTemplateReferenceSchema:Bt,PromptReferenceSchema:Vt,CompleteRequestParamsSchema:Ht,CompleteRequestSchema:Ut,CompleteResultSchema:Wt,RootSchema:Gt,ListRootsRequestSchema:Kt,ListRootsResultSchema:qt,RootsListChangedNotificationSchema:Jt,TaskCreationParamsSchema:Yt,TaskStatusSchema:Xt,TaskSchema:Zt,CreateTaskResultSchema:Qt,TaskStatusNotificationParamsSchema:$t,TaskStatusNotificationSchema:en,GetTaskRequestSchema:tn,GetTaskResultSchema:G,GetTaskPayloadRequestSchema:nn,GetTaskPayloadResultSchema:rn,ListTasksRequestSchema:an,ListTasksResultSchema:on,CancelTaskRequestSchema:sn,CancelTaskResultSchema:f.merge(Zt),ClientRequestSchema:h([N,de,Ut,lt,qe,We,Oe,Ae,Pe,Re,Be,ot,nt,tn,nn,an,sn]),ClientNotificationSchema:h([y,_e,he,Jt,en]),ClientResultSchema:h([_,xt,St,zt,qt,G,on,Qt]),ServerRequestSchema:h([N,bt,U,Kt,tn,nn,an,sn]),ServerNotificationSchema:h([y,_e,dt,I,Ie,st,Qe,en,Rt]),ServerResultSchema:h([_,me,Wt,Ze,Ge,ke,je,Fe,it,rt,G,on,Qt]),CallToolResultWireSchema:b().superRefine((e,t)=>{if(typeof e==`object`&&e&&!Array.isArray(e)&&e.content===void 0){for(let n of fi)if(n in e){t.addIssue({code:`custom`,message:`content is required when the body carries '${n}' — another result family cannot default into an empty tools/call success`});return}}}).transform(pi).pipe(it)}}var hi;function gi(){return hi??=mi()}function _i(e){return e.type!==`object`}var vi=new Set([`const`,`enum`,`default`,`examples`]),yi=new Set([`properties`,`patternProperties`,`$defs`,`definitions`,`dependentSchemas`,`dependencies`]);function bi(e){return e!==void 0&&!(typeof e==`string`&&e.startsWith(`#`))}function xi(e){let t=typeof e.$schema==`string`?e.$schema:void 0;if(bi(e.$id))return{...t!==void 0&&{$schema:t},type:`object`,properties:{result:e},required:[`result`]};let n=Ae(e.$schema)&&e.$recursiveAnchor!==!0,r=(e,t)=>{if(Array.isArray(e))return e.map(e=>r(e,!1));if(typeof e!=`object`||!e||!t&&bi(e.$id))return e;let i={},a=!1;for(let[o,s]of Object.entries(e))t?i[o]=r(s,!1):(o===`$ref`||o===`$dynamicRef`)&&typeof s==`string`?i[o]=s===`#`?`#/properties/result`:s.startsWith(`#/`)?`#/properties/result${s.slice(1)}`:s:o===`$recursiveRef`&&s===`#`&&n?a=!0:i[o]=vi.has(o)?s:yi.has(o)?r(s,!0):r(s,!1);return a&&(`$ref`in i?i.allOf=[...Array.isArray(i.allOf)?i.allOf:[],{$ref:`#/properties/result`}]:i.$ref=`#/properties/result`),i};return{...t!==void 0&&{$schema:t},type:`object`,properties:{result:r(e,!1)},required:[`result`]}}var Si={ping:null,initialize:null,"completion/complete":null,"logging/setLevel":null,"prompts/get":null,"prompts/list":null,"resources/list":null,"resources/templates/list":null,"resources/read":null,"resources/subscribe":null,"resources/unsubscribe":null,"tools/call":null,"tools/list":null,"tasks/get":null,"tasks/result":null,"tasks/list":null,"tasks/cancel":null,"sampling/createMessage":null,"elicitation/create":null,"roots/list":null},Ci={"notifications/cancelled":null,"notifications/progress":null,"notifications/initialized":null,"notifications/roots/list_changed":null,"notifications/tasks/status":null,"notifications/message":null,"notifications/resources/updated":null,"notifications/resources/list_changed":null,"notifications/tools/list_changed":null,"notifications/prompts/list_changed":null,"notifications/elicitation/complete":null},wi={ping:null,initialize:null,"completion/complete":null,"logging/setLevel":null,"prompts/get":null,"prompts/list":null,"resources/list":null,"resources/templates/list":null,"resources/read":null,"resources/subscribe":null,"resources/unsubscribe":null,"tools/call":null,"tools/list":null,"sampling/createMessage":null,"elicitation/create":null,"roots/list":null},Ti;function Ei(){if(Ti)return Ti;let e=gi();return Ti={requestSchemas:{ping:e.PingRequestSchema,initialize:e.InitializeRequestSchema,"completion/complete":e.CompleteRequestSchema,"logging/setLevel":e.SetLevelRequestSchema,"prompts/get":e.GetPromptRequestSchema,"prompts/list":e.ListPromptsRequestSchema,"resources/list":e.ListResourcesRequestSchema,"resources/templates/list":e.ListResourceTemplatesRequestSchema,"resources/read":e.ReadResourceRequestSchema,"resources/subscribe":e.SubscribeRequestSchema,"resources/unsubscribe":e.UnsubscribeRequestSchema,"tools/call":e.CallToolRequestSchema,"tools/list":e.ListToolsRequestSchema,"tasks/get":e.GetTaskRequestSchema,"tasks/result":e.GetTaskPayloadRequestSchema,"tasks/list":e.ListTasksRequestSchema,"tasks/cancel":e.CancelTaskRequestSchema,"sampling/createMessage":e.CreateMessageRequestSchema,"elicitation/create":e.ElicitRequestSchema,"roots/list":e.ListRootsRequestSchema},notificationSchemas:{"notifications/cancelled":e.CancelledNotificationSchema,"notifications/progress":e.ProgressNotificationSchema,"notifications/initialized":e.InitializedNotificationSchema,"notifications/roots/list_changed":e.RootsListChangedNotificationSchema,"notifications/tasks/status":e.TaskStatusNotificationSchema,"notifications/message":e.LoggingMessageNotificationSchema,"notifications/resources/updated":e.ResourceUpdatedNotificationSchema,"notifications/resources/list_changed":e.ResourceListChangedNotificationSchema,"notifications/tools/list_changed":e.ToolListChangedNotificationSchema,"notifications/prompts/list_changed":e.PromptListChangedNotificationSchema,"notifications/elicitation/complete":e.ElicitationCompleteNotificationSchema},resultSchemas:{ping:e.EmptyResultSchema,initialize:e.InitializeResultSchema,"completion/complete":e.CompleteResultSchema,"logging/setLevel":e.EmptyResultSchema,"prompts/get":e.GetPromptResultSchema,"prompts/list":e.ListPromptsResultSchema,"resources/list":e.ListResourcesResultSchema,"resources/templates/list":e.ListResourceTemplatesResultSchema,"resources/read":e.ReadResourceResultSchema,"resources/subscribe":e.EmptyResultSchema,"resources/unsubscribe":e.EmptyResultSchema,"tools/call":e.CallToolResultWireSchema,"tools/list":e.ListToolsResultSchema,"sampling/createMessage":e.CreateMessageResultWithToolsSchema,"elicitation/create":e.ElicitResultSchema,"roots/list":e.ListRootsResultSchema}},Ti}function Di(e){return Object.prototype.hasOwnProperty.call(Si,e)}function Oi(e){return Object.prototype.hasOwnProperty.call(Ci,e)}function ki(e){return Object.prototype.hasOwnProperty.call(wi,e)}function Ai(e){return ki(e)?Ei().resultSchemas[e]:void 0}function ji(e){return Di(e)?Ei().requestSchemas[e]:void 0}function Mi(e){return Oi(e)?Ei().notificationSchemas[e]:void 0}Object.keys(Si),Object.keys(Ci);function Ni(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function Pi(e,t){if(e===void 0)return{ok:!1,reason:`not-in-era`};let n=e.safeParse(t);return n.success?{ok:!0,value:n.data}:{ok:!1,reason:`invalid`,message:String(n.error)}}var Fi={ok:!1,reason:`not-in-era`};function Ii(e){return Ni(e)&&Ni(e.outputSchema)&&_i(e.outputSchema)}function Li(e){return e}var Ri={era:`2025-11-25`,hasRequestMethod:Di,hasNotificationMethod:Oi,validateRequest:(e,t)=>Pi(ji(e),t),validateResult:(e,t)=>Pi(Ai(e),t),validateNotification:(e,t)=>Pi(Mi(e),t),hasInputRequestMethod:()=>!1,validateInputRequest:()=>Fi,validateInputResponse:()=>Fi,samplingResultVariant:((e,t)=>{let n=gi();return Pi(e?n.CreateMessageResultWithToolsSchema:n.CreateMessageResultSchema,t)}),outboundEnvelope:e=>void 0,validateEnvelopeMeta:e=>[],projectCallToolResult(e,t){let n=di(e),r=n.structuredContent;if(r===void 0)return n;let i=typeof r!=`object`||!r||Array.isArray(r),a=t!==void 0&&_i(t);return!i&&!a?n:{...n,structuredContent:{result:r}}},decodeResult(e,t){if(Ni(t)&&`resultType`in t){let e={...t};return delete e.resultType,{kind:`complete`,result:Li(e)}}return{kind:`complete`,result:Li(t)}},encodeResult(e,t){if(e!==`tools/list`)return t;let n=t.tools;return!Array.isArray(n)||!n.some(e=>Ii(e))?t:{...t,tools:n.map(e=>Ii(e)?{...e,outputSchema:xi(e.outputSchema)}:e)}},encodeErrorCode:e=>e===-32002?-32602:e,checkInboundEnvelope:e=>void 0};function zi(){let e=ee(()=>h([g(),j(),O(),oe(),C(g(),e),D(e)])),t=C(g(),e),n=h([g(),j().int()]),r=g(),i=h([g(),j().int()]),a=E([`user`,`assistant`]),o=E([`debug`,`info`,`notice`,`warning`,`error`,`critical`,`alert`,`emergency`]),s=g().refine(e=>{try{return atob(e),!0}catch{return!1}},{message:`Invalid Base64 string`}),c=S({ttl:j().optional()}),l=S({taskId:g()}),u=M({progressToken:n.optional(),"io.modelcontextprotocol/related-task":l.optional()}),d=S({_meta:u.optional()}),f=d.extend({task:c.optional()}),p=S({_meta:u.optional()}),_=S({method:g(),params:p.loose().optional()}),v=S({src:g(),mimeType:g().optional(),sizes:D(g()).optional(),theme:E([`light`,`dark`]).optional()}),y=S({icons:D(v).optional()}),x=S({name:g(),title:g().optional()}),w=x.extend({...x.shape,...y.shape,version:g(),websiteUrl:g().optional(),description:g().optional()}),T=ne(S({applyDefaults:O().optional()}),t),te=A(e=>e&&typeof e==`object`&&!Array.isArray(e)&&Object.keys(e).length===0?{form:{}}:e,ne(S({form:T.optional(),url:t.optional()}),t.optional())),re=M({list:t.optional(),cancel:t.optional(),requests:M({sampling:M({createMessage:t.optional()}).optional(),elicitation:M({create:t.optional()}).optional()}).optional()}),ie=M({list:t.optional(),cancel:t.optional(),requests:M({tools:M({call:t.optional()}).optional()}).optional()}),ae=S({experimental:C(g(),t).optional(),sampling:S({context:t.optional(),tools:t.optional()}).optional(),elicitation:te.optional(),roots:S({listChanged:O().optional()}).optional(),tasks:re.optional(),extensions:C(g(),t).optional()}),se=S({experimental:C(g(),t).optional(),logging:t.optional(),completions:t.optional(),prompts:S({listChanged:O().optional()}).optional(),resources:S({subscribe:O().optional(),listChanged:O().optional()}).optional(),tools:S({listChanged:O().optional()}).optional(),tasks:ie.optional(),extensions:C(g(),t).optional()}),ce=S({progress:j(),total:m(j()),message:m(g())}),le=S({...p.shape,...ce.shape,progressToken:n}),ue=_.extend({method:k(`notifications/progress`),params:le}),de=p.extend({level:o,logger:g().optional(),data:b()}),fe=_.extend({method:k(`notifications/message`),params:de}),me=S({uri:g(),mimeType:m(g()),_meta:C(g(),b()).optional()}),he=me.extend({text:g()}),N=me.extend({blob:s}),P=S({audience:D(a).optional(),priority:j().min(0).max(1).optional(),lastModified:pe({offset:!0}).optional()}),ge=S({...x.shape,...y.shape,uri:g(),description:m(g()),mimeType:m(g()),size:m(j()),annotations:P.optional(),_meta:m(M({}))}),_e=S({...x.shape,...y.shape,uriTemplate:g(),description:m(g()),mimeType:m(g()),annotations:P.optional(),_meta:m(M({}))}),ve=_.extend({method:k(`notifications/resources/list_changed`),params:p.optional()}),ye=p.extend({uri:g()}),be=_.extend({method:k(`notifications/resources/updated`),params:ye}),F=S({name:g(),description:m(g()),required:m(O())}),xe=S({...x.shape,...y.shape,description:m(g()),arguments:m(D(F)),_meta:m(M({}))}),Se=_.extend({method:k(`notifications/prompts/list_changed`),params:p.optional()}),Ce=S({type:k(`text`),text:g(),annotations:P.optional(),_meta:C(g(),b()).optional()}),we=S({type:k(`image`),data:s,mimeType:g(),annotations:P.optional(),_meta:C(g(),b()).optional()}),Te=S({type:k(`audio`),data:s,mimeType:g(),annotations:P.optional(),_meta:C(g(),b()).optional()}),Ee=S({type:k(`tool_use`),name:g(),id:g(),input:C(g(),b()),_meta:C(g(),b()).optional()}),De=S({type:k(`resource`),resource:h([he,N]),annotations:P.optional(),_meta:C(g(),b()).optional()}),Oe=ge.extend({type:k(`resource_link`)}),ke=h([Ce,we,Te,Oe,De]),Ae=S({role:a,content:ke}),je=S({title:g().optional(),readOnlyHint:O().optional(),destructiveHint:O().optional(),idempotentHint:O().optional(),openWorldHint:O().optional()}),Me=_.extend({method:k(`notifications/tools/list_changed`),params:p.optional()}),Ne=S({name:g().optional()}),Pe=S({hints:D(Ne).optional(),costPriority:j().min(0).max(1).optional(),speedPriority:j().min(0).max(1).optional(),intelligencePriority:j().min(0).max(1).optional()}),ze=S({mode:E([`auto`,`required`,`none`]).optional()}),Ve=S({type:k(`boolean`),title:g().optional(),description:g().optional(),default:O().optional()}),I=S({type:k(`string`),title:g().optional(),description:g().optional(),minLength:j().optional(),maxLength:j().optional(),format:E([`email`,`uri`,`date`,`date-time`]).optional(),default:g().optional()}),He=S({type:E([`number`,`integer`]),title:g().optional(),description:g().optional(),minimum:j().optional(),maximum:j().optional(),default:j().optional()}),Ue=S({type:k(`string`),title:g().optional(),description:g().optional(),enum:D(g()),default:g().optional()}),We=S({type:k(`string`),title:g().optional(),description:g().optional(),oneOf:D(S({const:g(),title:g()})),default:g().optional()}),Ge=S({type:k(`string`),title:g().optional(),description:g().optional(),enum:D(g()),enumNames:D(g()).optional(),default:g().optional()}),Ke=h([Ue,We]),qe=S({type:k(`array`),title:g().optional(),description:g().optional(),minItems:j().optional(),maxItems:j().optional(),items:S({type:k(`string`),enum:D(g())}),default:D(g()).optional()}),L=S({type:k(`array`),title:g().optional(),description:g().optional(),minItems:j().optional(),maxItems:j().optional(),items:S({anyOf:D(S({const:g(),title:g()}))}),default:D(g()).optional()}),Je=h([qe,L]),R=h([Ge,Ke,Je]),z=h([R,Ve,I,He]),B=f.extend({mode:k(`form`).optional(),message:g(),requestedSchema:S({type:k(`object`),properties:C(g(),z),required:D(g()).optional()}).catchall(b())}),Ye=S({type:k(`ref/resource`),uri:g()}),V=S({type:k(`ref/prompt`),name:g()}),Xe=S({uri:g().startsWith(`file://`),name:g().optional(),_meta:C(g(),b()).optional()}),Ze=ae.shape,Qe=S({experimental:Ze.experimental,sampling:Ze.sampling,elicitation:Ze.elicitation,roots:Ze.roots,extensions:Ze.extensions}),$e=se.shape,et=S({experimental:$e.experimental,logging:$e.logging,completions:$e.completions,prompts:$e.prompts,resources:$e.resources,tools:$e.tools,extensions:$e.extensions}),tt=M({progressToken:n.optional(),[Fe]:g(),[Ie]:w.optional(),[Re]:Qe,[Be]:o.optional()}),nt=S({...x.shape,...y.shape,description:g().optional(),inputSchema:M({$schema:g().optional(),type:k(`object`)}),outputSchema:M({$schema:g().optional()}).optional(),annotations:je.optional(),_meta:C(g(),b()).optional()}),rt=S({type:k(`tool_result`),toolUseId:g(),content:D(ke),structuredContent:b().optional(),isError:O().optional(),_meta:C(g(),b()).optional()}),it=h([Ce,we,Te,Ee,rt]),at=S({role:a,content:h([it,D(it)]),_meta:C(g(),b()).optional()}),ot=g(),st=M({[Le]:w.optional().catch(void 0)}),ct=st.optional();function H(e){return M({_meta:ct,resultType:ot.default(`complete`),...e})}let lt=H({}),ut=H({nextCursor:r.optional()}),dt=H({content:D(ke),structuredContent:b().optional(),isError:O().optional()}),ft=H({ttlMs:j().int().min(0),cacheScope:E([`public`,`private`]),tools:D(nt),nextCursor:r.optional()}),pt=H({ttlMs:j().int().min(0),cacheScope:E([`public`,`private`]),prompts:D(xe),nextCursor:r.optional()}),mt=H({description:g().optional(),messages:D(Ae)}),ht=H({ttlMs:j().int().min(0),cacheScope:E([`public`,`private`]),resources:D(ge),nextCursor:r.optional()}),gt=H({ttlMs:j().int().min(0),cacheScope:E([`public`,`private`]),resourceTemplates:D(_e),nextCursor:r.optional()}),_t=H({ttlMs:j().int().min(0),cacheScope:E([`public`,`private`]),contents:D(h([he,N]))}),vt=H({completion:S({values:D(g()).max(100),total:j().int().optional(),hasMore:O().optional()}).loose()}),yt=H({ttlMs:j().int().min(0),cacheScope:E([`public`,`private`])}),bt=H({ttlMs:j().int().min(0).catch(0),cacheScope:E([`public`,`private`]).catch(`private`),supportedVersions:D(g()),capabilities:et,instructions:g().optional()}),xt=S({messages:D(at),modelPreferences:Pe.optional(),systemPrompt:g().optional(),includeContext:E([`none`,`thisServer`,`allServers`]).optional(),temperature:j().optional(),maxTokens:j().int(),stopSequences:D(g()).optional(),metadata:t.optional(),tools:D(nt).optional(),toolChoice:ze.optional()}),St=S({method:k(`sampling/createMessage`),params:xt}),Ct=S({method:k(`roots/list`),params:S({_meta:C(g(),b()).optional()}).optional()}),wt=S({...at.shape,model:g(),stopReason:g().optional()}),Tt=S({roots:D(Xe)}),Et=S({action:E([`accept`,`decline`,`cancel`]),content:C(g(),h([g(),j(),O(),D(g())])).optional()}),Dt=S({mode:k(`url`),message:g(),url:g().url()}),Ot=h([B,Dt]),kt=S({method:k(`elicitation/create`),params:Ot}),At=h([St,Ct,kt]),jt=h([wt,Tt,Et]),Mt=C(g(),At),Nt=C(g(),jt),Pt=H({inputRequests:Mt.optional(),requestState:g().optional()}),Ft={inputResponses:Nt.optional(),requestState:g().optional()},It=S({_meta:tt,...Ft}),Lt=M({progressToken:n.optional()});function U(e,t){return S({method:k(e),params:S({_meta:tt,...t})})}function W(e,t){return S({method:k(e),params:S({_meta:Lt.optional(),...t}).optional()})}let Rt={name:g(),arguments:C(g(),b()).optional(),...Ft},zt={cursor:r.optional()},Bt=U(`tools/call`,Rt),Vt=U(`tools/list`,zt),Ht=U(`prompts/list`,zt),Ut=U(`prompts/get`,{name:g(),arguments:C(g(),g()).optional(),...Ft}),Wt=U(`resources/list`,zt),Gt=U(`resources/templates/list`,zt),Kt=U(`resources/read`,{uri:g(),...Ft}),qt={ref:h([V,Ye]),argument:S({name:g(),value:g()}),context:S({arguments:C(g(),g()).optional()}).optional()},Jt=U(`completion/complete`,qt),Yt=U(`server/discover`,{}),Xt=S({toolsListChanged:O().optional(),promptsListChanged:O().optional(),resourcesListChanged:O().optional(),resourceSubscriptions:D(g()).optional()}),Zt={notifications:Xt},Qt=U(`subscriptions/listen`,Zt),$t=st.extend({"io.modelcontextprotocol/subscriptionId":i}),en=M({_meta:$t,resultType:ot.default(`complete`)}),tn={"tools/call":W(`tools/call`,Rt),"tools/list":W(`tools/list`,zt),"prompts/get":W(`prompts/get`,{name:g(),arguments:C(g(),g()).optional()}),"prompts/list":W(`prompts/list`,zt),"resources/list":W(`resources/list`,zt),"resources/templates/list":W(`resources/templates/list`,zt),"resources/read":W(`resources/read`,{uri:g()}),"completion/complete":W(`completion/complete`,qt),"server/discover":W(`server/discover`,{}),"subscriptions/listen":W(`subscriptions/listen`,Zt)};function G(e){return M({_meta:ct,...e})}let nn={"tools/call":G({content:D(ke),structuredContent:b().optional(),isError:O().optional()}),"tools/list":G({ttlMs:j().int().min(0),cacheScope:E([`public`,`private`]),tools:D(nt),nextCursor:r.optional()}),"prompts/get":G({description:g().optional(),messages:D(Ae)}),"prompts/list":G({ttlMs:j().int().min(0),cacheScope:E([`public`,`private`]),prompts:D(xe),nextCursor:r.optional()}),"resources/list":G({ttlMs:j().int().min(0),cacheScope:E([`public`,`private`]),resources:D(ge),nextCursor:r.optional()}),"resources/templates/list":G({ttlMs:j().int().min(0),cacheScope:E([`public`,`private`]),resourceTemplates:D(_e),nextCursor:r.optional()}),"resources/read":G({ttlMs:j().int().min(0),cacheScope:E([`public`,`private`]),contents:D(h([he,N]))}),"completion/complete":G({completion:S({values:D(g()).max(100),total:j().int().optional(),hasMore:O().optional()}).loose()}),"server/discover":G({ttlMs:j().int().min(0).catch(0),cacheScope:E([`public`,`private`]).catch(`private`),supportedVersions:D(g()),capabilities:et,instructions:g().optional()}),"subscriptions/listen":G({})},rn=M({"io.modelcontextprotocol/subscriptionId":i.optional()}),an=S({method:k(`notifications/subscriptions/acknowledged`),params:S({_meta:rn.optional(),notifications:Xt})}),on=S({_meta:rn.optional(),requestId:i,reason:g().optional()}),sn=S({method:k(`notifications/cancelled`),params:on}),cn={"notifications/cancelled":sn,"notifications/progress":ue,"notifications/message":fe,"notifications/resources/updated":be,"notifications/resources/list_changed":ve,"notifications/tools/list_changed":Me,"notifications/prompts/list_changed":Se,"notifications/subscriptions/acknowledged":an},K=e=>S({jsonrpc:k(`2.0`),id:h([g(),j().int()]),result:e}).strict();return{JSONValueSchema:e,JSONObjectSchema:t,ProgressTokenSchema:n,CursorSchema:r,RequestIdSchema:i,RoleSchema:a,LoggingLevelSchema:o,TaskMetadataSchema:c,RelatedTaskMetadataSchema:l,RequestMetaSchema:u,BaseRequestParamsSchema:d,TaskAugmentedRequestParamsSchema:f,NotificationsParamsSchema:p,NotificationSchema:_,IconSchema:v,IconsSchema:y,BaseMetadataSchema:x,ImplementationSchema:w,ClientTasksCapabilitySchema:re,ServerTasksCapabilitySchema:ie,ClientCapabilitiesSchema:ae,ServerCapabilitiesSchema:se,ProgressSchema:ce,ProgressNotificationParamsSchema:le,ProgressNotificationSchema:ue,LoggingMessageNotificationParamsSchema:de,LoggingMessageNotificationSchema:fe,ResourceContentsSchema:me,TextResourceContentsSchema:he,BlobResourceContentsSchema:N,AnnotationsSchema:P,ResourceSchema:ge,ResourceTemplateSchema:_e,ResourceListChangedNotificationSchema:ve,ResourceUpdatedNotificationParamsSchema:ye,ResourceUpdatedNotificationSchema:be,PromptArgumentSchema:F,PromptSchema:xe,PromptListChangedNotificationSchema:Se,TextContentSchema:Ce,ImageContentSchema:we,AudioContentSchema:Te,ToolUseContentSchema:Ee,EmbeddedResourceSchema:De,ResourceLinkSchema:Oe,ContentBlockSchema:ke,PromptMessageSchema:Ae,ToolAnnotationsSchema:je,ToolListChangedNotificationSchema:Me,ModelHintSchema:Ne,ModelPreferencesSchema:Pe,ToolChoiceSchema:ze,BooleanSchemaSchema:Ve,StringSchemaSchema:I,NumberSchemaSchema:He,UntitledSingleSelectEnumSchemaSchema:Ue,TitledSingleSelectEnumSchemaSchema:We,LegacyTitledEnumSchemaSchema:Ge,SingleSelectEnumSchemaSchema:Ke,UntitledMultiSelectEnumSchemaSchema:qe,TitledMultiSelectEnumSchemaSchema:L,MultiSelectEnumSchemaSchema:Je,EnumSchemaSchema:R,PrimitiveSchemaDefinitionSchema:z,ElicitRequestFormParamsSchema:B,ResourceTemplateReferenceSchema:Ye,PromptReferenceSchema:V,RootSchema:Xe,ClientCapabilities2026Schema:Qe,ServerCapabilities2026Schema:et,RequestMetaEnvelopeSchema:tt,ToolSchema:nt,ToolResultContentSchema:rt,SamplingMessageContentBlockSchema:it,SamplingMessageSchema:at,ResultTypeSchema:ot,ResultMetaSchema:st,ResultSchema:lt,PaginatedResultSchema:ut,CallToolResultSchema:dt,ListToolsResultSchema:ft,ListPromptsResultSchema:pt,GetPromptResultSchema:mt,ListResourcesResultSchema:ht,ListResourceTemplatesResultSchema:gt,ReadResourceResultSchema:_t,CompleteResultSchema:vt,CacheableResultSchema:yt,DiscoverResultSchema:bt,CreateMessageRequestParamsSchema:xt,CreateMessageRequestSchema:St,ListRootsRequestSchema:Ct,CreateMessageResultSchema:wt,ListRootsResultSchema:Tt,ElicitResultSchema:Et,ElicitRequestURLParamsSchema:Dt,ElicitRequestParamsSchema:Ot,ElicitRequestSchema:kt,InputRequestSchema:At,InputResponseSchema:jt,InputRequestsSchema:Mt,InputResponsesSchema:Nt,InputRequiredResultSchema:Pt,InputResponseRequestParamsSchema:It,CallToolRequestSchema:Bt,ListToolsRequestSchema:Vt,ListPromptsRequestSchema:Ht,GetPromptRequestSchema:Ut,ListResourcesRequestSchema:Wt,ListResourceTemplatesRequestSchema:Gt,ReadResourceRequestSchema:Kt,CompleteRequestSchema:Jt,DiscoverRequestSchema:Yt,SubscriptionFilterSchema:Xt,SubscriptionsListenRequestSchema:Qt,SubscriptionsListenResultMetaSchema:$t,SubscriptionsListenResultSchema:en,dispatchRequestSchemas:tn,dispatchResultSchemas:nn,NotificationMetaSchema:rn,SubscriptionsAcknowledgedNotificationSchema:an,CancelledNotificationParamsSchema:on,CancelledNotificationSchema:sn,notificationSchemas2026:cn,JSONRPCResultResponseSchema:K(lt),CallToolResultResponseSchema:K(h([dt,Pt])),ListToolsResultResponseSchema:K(ft),ListPromptsResultResponseSchema:K(pt),GetPromptResultResponseSchema:K(h([mt,Pt])),ListResourcesResultResponseSchema:K(ht),ListResourceTemplatesResultResponseSchema:K(gt),ReadResourceResultResponseSchema:K(h([_t,Pt])),CompleteResultResponseSchema:K(vt),DiscoverResultResponseSchema:K(bt),SubscriptionsListenResultResponseSchema:K(en)}}var Bi;function Vi(){return Bi??=zi()}var Hi=[`tools/list`,`prompts/list`,`resources/list`,`resources/templates/list`,`resources/read`,`server/discover`];function Ui(e){return Hi.includes(e)}var Wi=Symbol(`modelcontextprotocol.resultCacheHintFallback`);function Gi(e){return e[Wi]}function Ki(e){return typeof e==`number`&&Number.isSafeInteger(e)&&e>=0}function qi(e){return e===`public`||e===`private`}var X=function(e){return e[e.ParseError=-32700]=`ParseError`,e[e.InvalidRequest=-32600]=`InvalidRequest`,e[e.MethodNotFound=-32601]=`MethodNotFound`,e[e.InvalidParams=-32602]=`InvalidParams`,e[e.InternalError=-32603]=`InternalError`,e[e.ResourceNotFound=-32002]=`ResourceNotFound`,e[e.MissingRequiredClientCapability=-32021]=`MissingRequiredClientCapability`,e[e.UnsupportedProtocolVersion=-32022]=`UnsupportedProtocolVersion`,e[e.UrlElicitationRequired=-32042]=`UrlElicitationRequired`,e}({}),Z=class e extends Error{static{Object.defineProperty(this,"mcpBrand",{value:`mcp.ProtocolError`})}static[Symbol.hasInstance](e){return $r(this,e)}static isInstance(e){if(typeof this!=`function`)throw TypeError("isInstance must be called on the class (e.g. `SdkError.isInstance(value)`); for callbacks use `v => SdkError.isInstance(v)`");return $r(this,e)}constructor(e,t,n){super(t),this.code=e,this.data=n,this.name=`ProtocolError`,Qr(this,new.target)}static fromError(t,n,r){if(t===X.UrlElicitationRequired&&r){let e=r;if(e.elicitations)return new Yi(e.elicitations,n)}if(t===X.UnsupportedProtocolVersion&&r){let e=r;if(Array.isArray(e.supported)&&typeof e.requested==`string`)return new Xi({supported:e.supported,requested:e.requested},n)}if(t===X.InvalidParams||t===X.ResourceNotFound){let e=r;if(typeof e?.uri==`string`&&(t===X.ResourceNotFound||Object.keys(e).length===1))return new Ji(e.uri,n)}if(t===X.MissingRequiredClientCapability&&r){let e=r;if(e.requiredCapabilities!==null&&typeof e.requiredCapabilities==`object`&&!Array.isArray(e.requiredCapabilities))return new Zi({requiredCapabilities:e.requiredCapabilities},n)}return new e(t,n,r)}},Ji=class extends Z{static{Object.defineProperty(this,"mcpBrand",{value:`mcp.ResourceNotFoundError`})}constructor(e,t=`Resource not found: ${e}`){super(X.InvalidParams,t,{uri:e})}get uri(){return this.data.uri}},Yi=class extends Z{static{Object.defineProperty(this,"mcpBrand",{value:`mcp.UrlElicitationRequiredError`})}constructor(e,t=`URL elicitation${e.length>1?`s`:``} required`){super(X.UrlElicitationRequired,t,{elicitations:e})}get elicitations(){return this.data?.elicitations??[]}},Xi=class extends Z{static{Object.defineProperty(this,"mcpBrand",{value:`mcp.UnsupportedProtocolVersionError`})}constructor(e,t=`Unsupported protocol version: ${e.requested}`){super(X.UnsupportedProtocolVersion,t,e)}get supported(){return this.data.supported}get requested(){return this.data.requested}},Zi=class extends Z{static{Object.defineProperty(this,"mcpBrand",{value:`mcp.MissingRequiredClientCapabilityError`})}constructor(e,t=`Missing required client capabilities: ${Object.keys(e.requiredCapabilities).join(`, `)}`){super(X.MissingRequiredClientCapability,t,e)}get requiredCapabilities(){return this.data.requiredCapabilities}},Qi=0,$i=`private`,ea=[`tools/call`,`prompts/get`,`resources/read`];function ta(e,t){let n=t.resultType;if(n===void 0)return{...t,resultType:`complete`};if(n===`complete`||ea.includes(e))return t;throw new Z(X.InternalError,`Handler for ${e} returned resultType '${String(n)}', but results of ${e} only support 'complete' on protocol revision 2026-07-28`)}function na(e,t){let n=Gi(t);if(t.resultType!==`complete`||!Ui(e))return n===void 0?t:sa(t);let r=t,i=Ki(r.ttlMs)?r.ttlMs:aa(n),a=qi(r.cacheScope)?r.cacheScope:oa(n),o={...r,ttlMs:i,cacheScope:a};return delete o[Wi],o}function ra(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function ia(e,t){if(t===void 0)return e;let n=e._meta;return n===void 0?{...e,_meta:{[Le]:t}}:!ra(n)||n[`io.modelcontextprotocol/serverInfo`]!==void 0?e:{...e,_meta:{...n,[Le]:t}}}function aa(e){return e!==void 0&&Ki(e.ttlMs)?e.ttlMs:Qi}function oa(e){return e!==void 0&&qi(e.cacheScope)?e.cacheScope:$i}function sa(e){let t={...e};return delete t[Wi],t}var ca=[`elicitation/create`,`sampling/createMessage`,`roots/list`],la;function ua(){if(la)return la;let e=Vi();return la={request:{"elicitation/create":S({method:k(`elicitation/create`),params:e.ElicitRequestParamsSchema}),"sampling/createMessage":S({method:k(`sampling/createMessage`),params:e.CreateMessageRequestParamsSchema}),"roots/list":S({method:k(`roots/list`),params:M({}).optional()})},response:{"elicitation/create":e.ElicitResultSchema,"sampling/createMessage":e.CreateMessageResultSchema,"roots/list":e.ListRootsResultSchema}},la}function da(e){return ca.includes(e)}function fa(e){return da(e)?ua().request[e]:void 0}function pa(e){return da(e)?ua().response[e]:void 0}var ma={"tools/call":null,"tools/list":null,"prompts/get":null,"prompts/list":null,"resources/list":null,"resources/templates/list":null,"resources/read":null,"completion/complete":null,"server/discover":null,"subscriptions/listen":null},ha={"notifications/cancelled":null,"notifications/progress":null,"notifications/message":null,"notifications/resources/updated":null,"notifications/resources/list_changed":null,"notifications/tools/list_changed":null,"notifications/prompts/list_changed":null,"notifications/subscriptions/acknowledged":null};function ga(e){return Object.prototype.hasOwnProperty.call(ma,e)}function _a(e){return Object.prototype.hasOwnProperty.call(ha,e)}function va(e){return Object.prototype.hasOwnProperty.call(ma,e)}function ya(e){return ga(e)?Vi().dispatchRequestSchemas[e]:void 0}function ba(e){return va(e)?Vi().dispatchResultSchemas[e]:void 0}function xa(e){return _a(e)?Vi().notificationSchemas2026[e]:void 0}Object.keys(ma),Object.keys(ha);function Sa(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function Ca(e,t){if(e===void 0)return{ok:!1,reason:`not-in-era`};let n=e.safeParse(t);return n.success?{ok:!0,value:n.data}:{ok:!1,reason:`invalid`,message:String(n.error)}}var wa={ok:!1,reason:`not-in-era`},Ta=[Fe,Re];function Ea(e,t){let n=t,r=!1,i=()=>(r||=(n={...n},!0),n),a=t.tools;e===`tools/list`&&Array.isArray(a)&&a.some(e=>Sa(e)&&`execution`in e)&&(i().tools=a.map(e=>{if(!Sa(e)||!(`execution`in e))return e;let t={...e};return delete t.execution,t}));let o=t.capabilities;if(Sa(o)&&`tasks`in o){let e={...o};delete e.tasks,i().capabilities=e}return n}var Da={era:`2026-07-28`,hasRequestMethod:ga,hasNotificationMethod:_a,hasInputRequestMethod:e=>fa(e)!==void 0,validateRequest:(e,t)=>Ca(ya(e),t),validateResult:(e,t)=>Ca(ba(e),t),validateNotification:(e,t)=>Ca(xa(e),t),validateInputRequest:(e,t)=>Ca(fa(e),t),validateInputResponse:(e,t)=>Ca(pa(e),t),samplingResultVariant:()=>wa,outboundEnvelope(e){return{[Fe]:e.protocolVersion,[Ie]:e.clientInfo,[Re]:e.clientCapabilities,...e.logLevel!==void 0&&{"io.modelcontextprotocol/logLevel":e.logLevel}}},validateEnvelopeMeta(e){let t=[];for(let n of Ta)n in e||t.push({key:n,problem:`missing`});let n=Vi().RequestMetaEnvelopeSchema.safeParse(e);if(!n.success)for(let e of n.error.issues){let n=e.path.map(String),r=n.length>0?n.join(`.`):`_meta`;n.length===1&&t.some(e=>e.key===r&&e.problem===`missing`)||t.push({key:r,problem:e.message})}return t},projectCallToolResult:e=>di(e),inputRequestSchema:fa,decodeResult(e,t){if(!Sa(t))return{kind:`invalid`,error:new Y(J.InvalidResult,`Invalid result for ${e}: not an object`,{method:e})};let n=t.resultType;if(n===void 0)return{kind:`invalid`,error:new Y(J.InvalidResult,`Invalid result for ${e}: missing required resultType — servers implementing protocol revision 2026-07-28 MUST include it (the absent-means-complete bridge applies only to earlier-revision servers)`,{method:e,violation:`missing-resultType`})};if(typeof n!=`string`)return{kind:`invalid`,error:new Y(J.InvalidResult,`Invalid result for ${e}: non-string resultType`,{method:e,resultType:n})};if(n===`input_required`){let n=t.inputRequests,r=Sa(n)?n:{},i=t.requestState,a=t._meta===void 0?void 0:Vi().ResultMetaSchema.safeParse(t._meta),o=a?.success?a.data:void 0;return Object.keys(r).length===0&&typeof i!=`string`?{kind:`invalid`,error:new Y(J.InvalidResult,`Invalid result for ${e}: input_required carries neither inputRequests nor requestState (every input_required result must include at least one of the two)`,{method:e,violation:`input-required-missing-both`})}:{kind:`input_required`,inputRequests:r,...typeof i==`string`&&{requestState:i},...o!==void 0&&{_meta:o}}}if(n!==`complete`)return{kind:`invalid`,error:new Y(J.UnsupportedResultType,`Unsupported result type '${n}' for ${e}`,{resultType:n,method:e})};let r=ka(),i=Object.hasOwn(r,e)?r[e]:void 0;if(i!==void 0){let n=i.safeParse(t);if(!n.success)return{kind:`invalid`,error:new Y(J.InvalidResult,`Invalid result for ${e}: ${n.error}`,{method:e})}}let a={...t};return delete a.resultType,{kind:`complete`,result:a}},encodeResult(e,t,n){return ia(na(e,ta(e,Ea(e,t))),n)},encodeErrorCode:e=>e===-32002?-32602:e,checkInboundEnvelope(e){if(e.envelope===void 0)return`Request is missing the required _meta envelope for protocol revision 2026-07-28 (io.modelcontextprotocol/protocolVersion, io.modelcontextprotocol/clientCapabilities)`;let t=Vi().RequestMetaEnvelopeSchema.safeParse(e.envelope);if(!t.success)return`Invalid _meta envelope for protocol revision 2026-07-28: ${t.error.issues.map(e=>e.message).join(`; `)}`}},Oa;function ka(){if(Oa)return Oa;let e=Vi();return Oa={"tools/call":e.CallToolResultSchema,"tools/list":e.ListToolsResultSchema,"prompts/get":e.GetPromptResultSchema,"prompts/list":e.ListPromptsResultSchema,"resources/list":e.ListResourcesResultSchema,"resources/templates/list":e.ListResourceTemplatesResultSchema,"resources/read":e.ReadResourceResultSchema,"completion/complete":e.CompleteResultSchema,"server/discover":e.DiscoverResultSchema},Oa}var Aa=`2026-07-28`;function ja(e){return e!==void 0&&ci(e)?Da:Ri}function Ma(e){return e.revision===void 0?e.era===`modern`?Da.era:Ri.era:ja(e.revision).era}function Na(e){return Ia.some(t=>t.hasRequestMethod(e))}function Pa(e){return Ia.some(t=>t.hasNotificationMethod(e))}function Fa(e){return e===`tasks/get`||e===`tasks/cancel`}var Ia=[Ri,Da],La=Ce({AnnotationsSchema:()=>Nt,AudioContentSchema:()=>ln,BaseMetadataSchema:()=>ct,BaseRequestParamsSchema:()=>L,BlobResourceContentsSchema:()=>jt,BooleanSchemaSchema:()=>Wn,CallToolRequestParamsSchema:()=>wn,CallToolRequestSchema:()=>Tn,CallToolResultSchema:()=>Sn,CancelTaskRequestSchema:()=>Ar,CancelTaskResultSchema:()=>jr,CancelledNotificationParamsSchema:()=>it,CancelledNotificationSchema:()=>at,ClientCapabilitiesSchema:()=>pt,ClientNotificationSchema:()=>Nr,ClientRequestSchema:()=>Mr,ClientResultSchema:()=>Pr,ClientTasksCapabilitySchema:()=>dt,CompatibilityCallToolResultSchema:()=>Cn,CompleteRequestParamsSchema:()=>dr,CompleteRequestSchema:()=>fr,CompleteResultSchema:()=>pr,ContentBlockSchema:()=>pn,CreateMessageRequestParamsSchema:()=>Bn,CreateMessageRequestSchema:()=>Vn,CreateMessageResultSchema:()=>Hn,CreateMessageResultWithToolsSchema:()=>Un,CreateTaskResultSchema:()=>xr,CursorSchema:()=>We,DiscoverRequestSchema:()=>yt,DiscoverResultSchema:()=>bt,ElicitRequestFormParamsSchema:()=>nr,ElicitRequestParamsSchema:()=>ir,ElicitRequestSchema:()=>ar,ElicitRequestURLParamsSchema:()=>rr,ElicitResultSchema:()=>cr,ElicitationCompleteNotificationParamsSchema:()=>or,ElicitationCompleteNotificationSchema:()=>sr,EmbeddedResourceSchema:()=>dn,EmptyResultSchema:()=>rt,EnumSchemaSchema:()=>er,GetPromptRequestParamsSchema:()=>on,GetPromptRequestSchema:()=>sn,GetPromptResultSchema:()=>hn,GetTaskPayloadRequestSchema:()=>Er,GetTaskPayloadResultSchema:()=>Dr,GetTaskRequestSchema:()=>wr,GetTaskResultSchema:()=>Tr,IconSchema:()=>ot,IconsSchema:()=>st,ImageContentSchema:()=>K,ImplementationSchema:()=>H,InitializeRequestParamsSchema:()=>mt,InitializeRequestSchema:()=>ht,InitializeResultSchema:()=>_t,InitializedNotificationSchema:()=>vt,JSONArraySchema:()=>He,JSONObjectSchema:()=>I,JSONRPCErrorResponseSchema:()=>et,JSONRPCMessageSchema:()=>tt,JSONRPCNotificationSchema:()=>Qe,JSONRPCRequestSchema:()=>Ze,JSONRPCResponseSchema:()=>nt,JSONRPCResultResponseSchema:()=>$e,JSONValueSchema:()=>Ve,LegacyTitledEnumSchemaSchema:()=>Yn,ListChangedOptionsBaseSchema:()=>Dn,ListPromptsRequestSchema:()=>rn,ListPromptsResultSchema:()=>an,ListResourceTemplatesRequestSchema:()=>U,ListResourceTemplatesResultSchema:()=>W,ListResourcesRequestSchema:()=>It,ListResourcesResultSchema:()=>Lt,ListRootsRequestSchema:()=>hr,ListRootsResultSchema:()=>gr,ListTasksRequestSchema:()=>Or,ListTasksResultSchema:()=>kr,ListToolsRequestSchema:()=>bn,ListToolsResultSchema:()=>xn,LoggingLevelSchema:()=>On,LoggingMessageNotificationParamsSchema:()=>jn,LoggingMessageNotificationSchema:()=>Mn,ModelHintSchema:()=>Nn,ModelPreferencesSchema:()=>Pn,MultiSelectEnumSchemaSchema:()=>$n,NotificationSchema:()=>B,NotificationsParamsSchema:()=>z,NumberSchemaSchema:()=>Kn,PaginatedRequestParamsSchema:()=>Tt,PaginatedRequestSchema:()=>Et,PaginatedResultSchema:()=>Dt,PingRequestSchema:()=>xt,PrimitiveSchemaDefinitionSchema:()=>tr,ProgressNotificationParamsSchema:()=>Ct,ProgressNotificationSchema:()=>wt,ProgressSchema:()=>St,ProgressTokenSchema:()=>Ue,PromptArgumentSchema:()=>G,PromptListChangedNotificationSchema:()=>gn,PromptMessageSchema:()=>mn,PromptReferenceSchema:()=>ur,PromptSchema:()=>nn,ReadResourceRequestParamsSchema:()=>zt,ReadResourceRequestSchema:()=>Bt,ReadResourceResultSchema:()=>Vt,RelatedTaskMetadataSchema:()=>Ke,RequestIdSchema:()=>Xe,RequestMetaSchema:()=>qe,RequestSchema:()=>R,ResourceContentsSchema:()=>Ot,ResourceLinkSchema:()=>fn,ResourceListChangedNotificationSchema:()=>Ht,ResourceRequestParamsSchema:()=>Rt,ResourceSchema:()=>Pt,ResourceTemplateReferenceSchema:()=>lr,ResourceTemplateSchema:()=>Ft,ResourceUpdatedNotificationParamsSchema:()=>en,ResourceUpdatedNotificationSchema:()=>tn,ResultMetaObjectSchema:()=>Ye,ResultSchema:()=>V,RoleSchema:()=>Mt,RootSchema:()=>mr,RootsListChangedNotificationSchema:()=>_r,SamplingContentSchema:()=>Ln,SamplingMessageContentBlockSchema:()=>Rn,SamplingMessageSchema:()=>zn,ServerCapabilitiesSchema:()=>gt,ServerNotificationSchema:()=>Ir,ServerRequestSchema:()=>Fr,ServerResultSchema:()=>Lr,ServerTasksCapabilitySchema:()=>ft,SetLevelRequestParamsSchema:()=>kn,SetLevelRequestSchema:()=>An,SingleSelectEnumSchemaSchema:()=>Xn,StringSchemaSchema:()=>Gn,SubscribeRequestParamsSchema:()=>Ut,SubscribeRequestSchema:()=>Wt,SubscriptionFilterSchema:()=>qt,SubscriptionsAcknowledgedNotificationParamsSchema:()=>Xt,SubscriptionsAcknowledgedNotificationSchema:()=>Zt,SubscriptionsListenRequestParamsSchema:()=>Jt,SubscriptionsListenRequestSchema:()=>Yt,SubscriptionsListenResultMetaSchema:()=>Qt,SubscriptionsListenResultSchema:()=>$t,TaskAugmentedRequestParamsSchema:()=>Je,TaskCreationParamsSchema:()=>vr,TaskMetadataSchema:()=>Ge,TaskSchema:()=>br,TaskStatusNotificationParamsSchema:()=>Sr,TaskStatusNotificationSchema:()=>Cr,TaskStatusSchema:()=>yr,TextContentSchema:()=>cn,TextResourceContentsSchema:()=>kt,TitledMultiSelectEnumSchemaSchema:()=>Qn,TitledSingleSelectEnumSchemaSchema:()=>Jn,ToolAnnotationsSchema:()=>_n,ToolChoiceSchema:()=>Fn,ToolExecutionSchema:()=>vn,ToolListChangedNotificationSchema:()=>En,ToolResultContentSchema:()=>In,ToolSchema:()=>yn,ToolUseContentSchema:()=>un,UnsubscribeRequestParamsSchema:()=>Gt,UnsubscribeRequestSchema:()=>Kt,UntitledMultiSelectEnumSchemaSchema:()=>Zn,UntitledSingleSelectEnumSchemaSchema:()=>qn}),Ra=e=>Ze.safeParse(e).success,za=e=>Qe.safeParse(e).success,Ba=e=>$e.safeParse(e).success,Va=e=>et.safeParse(e).success,Ha=e=>typeof e==`object`&&!!e&&!Array.isArray(e)&&e.resultType===`input_required`,Ua=e=>ht.safeParse(e).success,Wa=e=>vt.safeParse(e).success,Ga=`Mcp-Param-`,Ka=`x-mcp-header`,qa=/^[!#$%&'*+\-.^_`|~0-9A-Za-z]+$/,Ja=new Set([`string`,`integer`,`boolean`,`number`]);function Ya(e){let t=[],n=new Map,r=(e,i,a)=>{if(typeof e!=`object`||!e)return;let o=e;if(Ka in o){if(!a||i.length===0)return`${Qa(i)}: x-mcp-header is only permitted on properties statically reachable via a chain of 'properties' keys (not under items, additionalProperties, oneOf/anyOf/allOf/not, if/then/else, or $ref)`;let e=o[Ka];if(typeof e!=`string`||e.length===0)return`${Qa(i)}: x-mcp-header MUST be a non-empty string`;if(!qa.test(e))return`${Qa(i)}: x-mcp-header '${e}' is not a valid RFC 9110 token (no spaces, control characters or HTTP delimiters)`;let r=typeof o.type==`string`?o.type:void 0;if(r===void 0||!Ja.has(r))return`${Qa(i)}: x-mcp-header is only permitted on primitive-typed properties (string, integer, boolean); got ${r??``}`;let s=e.toLowerCase(),c=n.get(s);if(c!==void 0)return`x-mcp-header '${e}' is not case-insensitively unique (also declared as '${c}')`;n.set(s,e),t.push({path:i,headerName:e,type:r})}let s=o.properties;if(typeof s==`object`&&s)for(let[e,t]of Object.entries(s)){let n=r(t,[...i,e],a);if(n!==void 0)return n}for(let e of Xa){let t=o[e];if(t===void 0)continue;let n=Array.isArray(t)?t:typeof t==`object`&&t&&Za.has(e)?Object.values(t):[t];for(let t of n){let n=r(t,[...i,`<${e}>`],!1);if(n!==void 0)return n}}},i=r(e,[],!0);return i===void 0?{valid:!0,declarations:t}:{valid:!1,reason:i}}var Xa=[`items`,`prefixItems`,`contains`,`additionalProperties`,`unevaluatedProperties`,`unevaluatedItems`,`propertyNames`,`patternProperties`,`dependentSchemas`,`oneOf`,`anyOf`,`allOf`,`not`,`if`,`then`,`else`,`$defs`,`definitions`],Za=new Set([`patternProperties`,`dependentSchemas`,`$defs`,`definitions`]);function Qa(e){return e.length===0?``:e.join(`.`)}var $a=`=?base64?`,eo=`?=`;function to(e){if(typeof e==`string`)return e;if(typeof e==`boolean`)return e?`true`:`false`;if(typeof e==`number`)return!Number.isFinite(e)||Number.isInteger(e)&&!Number.isSafeInteger(e)?void 0:String(e)}function no(e){if(e.length===0||e.startsWith($a)&&e.endsWith(eo)||e!==e.trim())return!0;for(let t=0;t=32&&n<=126))return!0}return!1}function ro(e){let t=new TextEncoder().encode(e),n=``;for(let e of t)n+=String.fromCodePoint(e);return btoa(n)}function io(e){return no(e)?`${$a}${ro(e)}${eo}`:e}function ao(e,t){let n=e;for(let e of t){if(typeof n!=`object`||!n)return;n=n[e]}return n}function oo(e,t){let n={};for(let r of e){let e=ao(t,r.path);if(e==null)continue;let i=to(e);i!==void 0&&(n[`${Ga}${r.headerName}`]=io(i))}return n}X.InvalidRequest,X.UnsupportedProtocolVersion,X.InvalidParams,X.MethodNotFound,X.InvalidParams,X.MissingRequiredClientCapability,X.ParseError,X.InvalidRequest,X.MethodNotFound,X.UnsupportedProtocolVersion,X.MissingRequiredClientCapability;var so={"tools/call":`name`,"prompts/get":`name`,"resources/read":`uri`,"tasks/get":`taskId`,"tasks/update":`taskId`,"tasks/cancel":`taskId`};function co(e,t){let n=Object.hasOwn(so,e)?so[e]:void 0;if(n===void 0)return;let r=lo(t)?t[n]:void 0;return{field:n,value:typeof r==`string`?r:void 0}}function lo(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function uo(e,t){return p(e,t)}function fo(e){return new Set(e.flatMap(e=>Object.keys(e.shape)))}function po(e){if(e==null)return!1;let t=typeof e;return t!==`object`&&t!==`function`||!(`~standard`in e)?!1:typeof e[`~standard`]?.validate==`function`}var mo=!1,ho=`draft-2020-12`;function go(e,t=`input`){let n=e[`~standard`],r;if(n.jsonSchema)r=n.jsonSchema[t]({target:ho});else if(n.vendor===`zod`){if(!(`_zod`in e))throw Error(`Schema appears to be from zod 3, which the SDK cannot convert to JSON Schema. Upgrade to zod >=4.2.0, or wrap your JSON Schema with fromJsonSchema().`);mo||(mo=!0,console.warn("[mcp-sdk] Your zod version does not implement `~standard.jsonSchema` (added in zod 4.2.0). Falling back to z.toJSONSchema(). Upgrade to zod >=4.2.0 to silence this warning.")),r=ie(e,{target:ho,io:t})}else throw Error(`Schema library "${n.vendor}" does not implement StandardJSONSchemaV1 (\`~standard.jsonSchema\`). Upgrade to a version that does, or wrap your JSON Schema with fromJsonSchema().`);if(t===`output`)return r.type===void 0&&_o(r)?{type:`object`,...r}:r;if(r.type!==void 0&&r.type!==`object`)throw Error(`MCP tool and prompt schemas must describe objects (got type: ${JSON.stringify(r.type)}). Wrap your schema in z.object({...}) or equivalent.`);return{type:`object`,...r}}function _o(e){if(`properties`in e||`patternProperties`in e||`additionalProperties`in e||`required`in e)return!0;for(let t of[`oneOf`,`anyOf`,`allOf`]){let n=e[t];if(Array.isArray(n)&&n.length>0)return n.every(e=>typeof e==`object`&&!!e&&(e.type===`object`||_o(e)))}return!1}function vo(e){return e.path?.length?`${e.path.map(e=>String(typeof e==`object`?e.key:e)).join(`.`)}: ${e.message}`:e.message}async function yo(e,t){let n=await e[`~standard`].validate(t);return n.issues&&n.issues.length>0?{success:!1,error:n.issues.map(e=>vo(e)).join(`, `)}:{success:!0,data:n.value}}function bo(e){let t=ie(e,{target:ho,io:`input`});return typeof t.pattern==`string`?t.pattern:void 0}var xo=/\\\.\\d\{(\d+)\}/;function So(e){let t=xo.exec(e),n=[void 0,-1,0];return t&&n.push(Number(t[1])),[!1,!0].flatMap(e=>[!1,!0].flatMap(t=>n.map(n=>pe({local:e,offset:t,precision:n}))))}function Co(e,t){let n;switch(e){case`email`:n=[re()];break;case`uri`:n=[ae()];break;case`date`:n=[me()];break;case`date-time`:n=So(t)}return new Set(n.map(e=>bo(e)).filter(e=>e!==void 0))}function wo(e,t,n){return n!==`zod`||Co(e,t).has(t)}function To(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function Eo(e){try{return go(e,`input`)}catch(e){let t=e instanceof Error?e.message:String(e);throw new Z(X.InvalidParams,`Elicitation requestedSchema must describe an object with flat primitive properties: ${t}`)}}var Do=new Set([`$comment`,`deprecated`,`description`,`examples`,`readOnly`,`title`,`writeOnly`]);function Oo(e){return Do.has(e)||e.startsWith(`x-`)}var ko=new Set([`$schema`,...Object.keys(nr.shape.requestedSchema.shape)]),Ao={string:fo([Gn,qn,Jn,Yn]),number:fo([Kn]),integer:fo([Kn]),boolean:fo([Wn]),array:fo([Zn,Qn])},jo=new Set(Gn.shape.format.unwrap().options);function Mo(e,t,n,r){if(!To(e))return e;let i=typeof e.type==`string`&&Object.hasOwn(Ao,e.type)?Ao[e.type]:void 0;if(i===void 0)return e;let a={};for(let[o,s]of Object.entries(e))i.has(o)||Oo(o)?a[o]=s:o===`pattern`&&e.type===`string`&&typeof e.format==`string`?jo.has(e.format)?(typeof s!=`string`||!wo(e.format,s,n))&&r.push(`${t}.${o}`):a[o]=s:r.push(`${t}.${o}`);return a}function No(e,t){let n={},r=[];for(let[i,a]of Object.entries(e))i===`properties`&&To(a)?n[i]=Object.fromEntries(Object.entries(a).map(([e,n])=>[e,Mo(n,`properties.${e}`,t,r)])):ko.has(i)?n[i]=a:Oo(i)||r.push(i);if(r.length>0)throw new Z(X.InvalidParams,`Elicitation requestedSchema contains unsupported JSON Schema constraint(s) after Standard Schema conversion: ${r.join(`, `)}`);return n}function Po(e,t){if(!To(e.properties))return t;let n=Object.entries(e.properties).filter(([,e])=>!uo(tr,e).success).map(([e])=>`properties.${e}`);return n.length>0?n.join(`, `):t}function Fo(e,t,n=``){return Array.isArray(e)&&Array.isArray(t)?e.flatMap((e,r)=>Fo(e,t[r],`${n}[${r}]`)):!To(e)||!To(t)?[]:Object.entries(e).flatMap(([e,r])=>{let i=n?`${n}.${e}`:e;return Object.prototype.hasOwnProperty.call(t,e)?Fo(r,t[e],i):Oo(e)?[]:[i]})}function Io(e){if(!po(e.requestedSchema))return{...e,mode:`form`,requestedSchema:e.requestedSchema};let t=e.requestedSchema[`~standard`].vendor,n=No(Eo(e.requestedSchema),t),r=uo(nr.shape.requestedSchema,n);if(!r.success)throw new Z(X.InvalidParams,`Elicitation requestedSchema only supports flat primitive properties (string, number, integer, boolean, and string enums): ${Po(n,r.error.message)}`);let i=Fo(n,r.data);if(i.length>0)throw new Z(X.InvalidParams,`Elicitation requestedSchema contains unsupported JSON Schema constraint(s) after Standard Schema conversion: ${i.join(`, `)}`);let a=(r.data.required??[]).filter(e=>!Object.prototype.hasOwnProperty.call(r.data.properties,e));if(a.length>0)throw new Z(X.InvalidParams,`Elicitation requestedSchema lists required properties that are not defined in properties: ${a.join(`, `)}`);return{...e,mode:`form`,requestedSchema:r.data}}function Lo(e){let t=e.inputRequests!==void 0&&Object.keys(e.inputRequests).length>0,n=typeof e.requestState==`string`;if(!t&&!n)throw TypeError(`inputRequired() requires at least one of inputRequests (with at least one entry) or requestState (spec: every InputRequiredResult MUST include at least one of the two)`);return{resultType:`input_required`,...e.inputRequests!==void 0&&{inputRequests:e.inputRequests},...e.requestState!==void 0&&{requestState:e.requestState}}}Object.assign(Lo,{elicit(e){try{return{method:`elicitation/create`,params:Io(e)}}catch(e){throw e instanceof Z?TypeError(e.message,{cause:e}):e}},elicitUrl(e){return{method:`elicitation/create`,params:{...e,mode:`url`}}},createMessage(e){return{method:`sampling/createMessage`,params:e}},listRoots(){return{method:`roots/list`}}});var Ro=!0,zo=10,Bo=250;function Vo(e){return{autoFulfill:e?.autoFulfill??Ro,maxRounds:e?.maxRounds??zo}}function Ho(e,t,n){let r=t!==void 0&&Object.keys(t).length>0;return!r&&n===void 0?e:{...e,...r&&{inputResponses:t},...n!==void 0&&{requestState:n}}}function Uo(e,t){return`Multi-round-trip request '${e}' still required input after ${t} rounds (inputRequired.maxRounds)`}function Wo(e,t){return new Promise((n,r)=>{if(t?.aborted){r(t.reason instanceof Y?t.reason:new Y(J.RequestTimeout,String(t.reason)));return}let i=setTimeout(()=>{t?.removeEventListener(`abort`,a),n()},e),a=()=>{clearTimeout(i),r(t?.reason instanceof Y?t.reason:new Y(J.RequestTimeout,String(t?.reason)))};t?.addEventListener(`abort`,a,{once:!0})})}function Go(e){let t=new AbortController,n=()=>t.abort(e?.reason);return e?.addEventListener(`abort`,n,{once:!0}),e?.aborted&&t.abort(e.reason),{signal:t.signal,abort:e=>t.abort(e),dispose:()=>e?.removeEventListener(`abort`,n)}}async function Ko(e){let{config:t,method:n,originalParams:r,requestOptions:i,hooks:a,signal:o}=e,s=e.flowStartedAt??Date.now(),c=e.firstPayload,l=0;for(;;){if(l+=1,l>t.maxRounds)throw new Y(J.InputRequiredRoundsExceeded,Uo(n,t.maxRounds),{rounds:t.maxRounds,lastResult:{inputRequests:c.inputRequests,...c.requestState!==void 0&&{requestState:c.requestState}}});i.onprogress?.({progress:l,message:`Fulfilling input required by '${n}' (round ${l})`});let e=Object.entries(c.inputRequests??{}),u;if(e.length>0){let t=Go(o);try{let n=await Promise.all(e.map(async([e,n])=>{try{return[e,await a.dispatchInputRequest(e,n,t.signal)]}catch(e){throw t.abort(e),e}}));u=Object.fromEntries(n)}finally{t.dispose()}}else await Wo(Bo,o);let d={...i.timeout!==void 0&&{timeout:i.timeout}};if(i.maxTotalTimeout!==void 0){let e=Date.now()-s,t=i.maxTotalTimeout-e;if(t<=0)throw new Y(J.RequestTimeout,`Maximum total timeout exceeded`,{maxTotalTimeout:i.maxTotalTimeout,totalElapsed:e});d.maxTotalTimeout=t}let f=await a.retry(Ho(r,u,c.requestState),d);if(Ha(f)){c={inputRequests:f.inputRequests??{},...f.requestState!==void 0&&{requestState:f.requestState}};continue}return f}}var qo=`AnnotationsSchema.AudioContentSchema.BaseMetadataSchema.BlobResourceContentsSchema.BooleanSchemaSchema.CallToolRequestSchema.CallToolRequestParamsSchema.CallToolResultSchema.CancelledNotificationSchema.CancelledNotificationParamsSchema.CancelTaskRequestSchema.CancelTaskResultSchema.ClientCapabilitiesSchema.ClientNotificationSchema.ClientRequestSchema.ClientResultSchema.CompatibilityCallToolResultSchema.CompleteRequestSchema.CompleteRequestParamsSchema.CompleteResultSchema.ContentBlockSchema.CreateMessageRequestSchema.CreateMessageRequestParamsSchema.CreateMessageResultSchema.CreateMessageResultWithToolsSchema.CreateTaskResultSchema.CursorSchema.DiscoverRequestSchema.DiscoverResultSchema.ElicitationCompleteNotificationSchema.ElicitationCompleteNotificationParamsSchema.ElicitRequestSchema.ElicitRequestFormParamsSchema.ElicitRequestParamsSchema.ElicitRequestURLParamsSchema.ElicitResultSchema.EmbeddedResourceSchema.EmptyResultSchema.EnumSchemaSchema.GetPromptRequestSchema.GetPromptRequestParamsSchema.GetPromptResultSchema.GetTaskPayloadRequestSchema.GetTaskPayloadResultSchema.GetTaskRequestSchema.GetTaskResultSchema.IconSchema.IconsSchema.ImageContentSchema.ImplementationSchema.InitializedNotificationSchema.InitializeRequestSchema.InitializeRequestParamsSchema.InitializeResultSchema.JSONArraySchema.JSONObjectSchema.JSONRPCErrorResponseSchema.JSONRPCMessageSchema.JSONRPCNotificationSchema.JSONRPCRequestSchema.JSONRPCResponseSchema.JSONRPCResultResponseSchema.JSONValueSchema.LegacyTitledEnumSchemaSchema.ListPromptsRequestSchema.ListPromptsResultSchema.ListResourcesRequestSchema.ListResourcesResultSchema.ListResourceTemplatesRequestSchema.ListResourceTemplatesResultSchema.ListRootsRequestSchema.ListRootsResultSchema.ListTasksRequestSchema.ListTasksResultSchema.ListToolsRequestSchema.ListToolsResultSchema.LoggingLevelSchema.LoggingMessageNotificationSchema.LoggingMessageNotificationParamsSchema.ModelHintSchema.ModelPreferencesSchema.MultiSelectEnumSchemaSchema.NotificationSchema.NumberSchemaSchema.PaginatedRequestSchema.PaginatedRequestParamsSchema.PaginatedResultSchema.PingRequestSchema.PrimitiveSchemaDefinitionSchema.ProgressSchema.ProgressNotificationSchema.ProgressNotificationParamsSchema.ProgressTokenSchema.PromptSchema.PromptArgumentSchema.PromptListChangedNotificationSchema.PromptMessageSchema.PromptReferenceSchema.ReadResourceRequestSchema.ReadResourceRequestParamsSchema.ReadResourceResultSchema.RelatedTaskMetadataSchema.RequestSchema.RequestIdSchema.RequestMetaSchema.ResourceSchema.ResourceContentsSchema.ResourceLinkSchema.ResourceListChangedNotificationSchema.ResourceRequestParamsSchema.ResourceTemplateSchema.ResourceTemplateReferenceSchema.ResourceUpdatedNotificationSchema.ResourceUpdatedNotificationParamsSchema.ResultMetaObjectSchema.ResultSchema.RoleSchema.RootSchema.RootsListChangedNotificationSchema.SamplingContentSchema.SamplingMessageSchema.SamplingMessageContentBlockSchema.ServerCapabilitiesSchema.ServerNotificationSchema.ServerRequestSchema.ServerResultSchema.SetLevelRequestSchema.SetLevelRequestParamsSchema.SingleSelectEnumSchemaSchema.StringSchemaSchema.SubscribeRequestSchema.SubscribeRequestParamsSchema.SubscriptionFilterSchema.SubscriptionsAcknowledgedNotificationSchema.SubscriptionsAcknowledgedNotificationParamsSchema.SubscriptionsListenRequestSchema.SubscriptionsListenRequestParamsSchema.SubscriptionsListenResultSchema.SubscriptionsListenResultMetaSchema.TaskAugmentedRequestParamsSchema.TaskCreationParamsSchema.TaskMetadataSchema.TaskSchema.TaskStatusSchema.TaskStatusNotificationSchema.TaskStatusNotificationParamsSchema.TextContentSchema.TextResourceContentsSchema.TitledMultiSelectEnumSchemaSchema.TitledSingleSelectEnumSchemaSchema.ToolSchema.ToolAnnotationsSchema.ToolChoiceSchema.ToolExecutionSchema.ToolListChangedNotificationSchema.ToolResultContentSchema.ToolUseContentSchema.UnsubscribeRequestSchema.UnsubscribeRequestParamsSchema.UntitledMultiSelectEnumSchemaSchema.UntitledSingleSelectEnumSchemaSchema`.split(`.`),Jo={IdJagTokenExchangeResponseSchema:Ur,OAuthClientInformationFullSchema:Jr,OAuthClientInformationSchema:qr,OAuthClientMetadataSchema:Kr,OAuthClientRegistrationErrorSchema:Yr,OAuthErrorResponseSchema:Wr,OAuthMetadataSchema:zr,OAuthProtectedResourceMetadataSchema:Rr,OAuthTokenRevocationRequestSchema:Xr,OAuthTokensSchema:Hr,OpenIdProviderDiscoveryMetadataSchema:Vr,OpenIdProviderMetadataSchema:Br},Yo={},Xo={};function Zo(e,t){let n=e.slice(0,-6);Yo[n]=t,Xo[n]=e=>t.safeParse(e).success}for(let e of qo)Zo(e,La[e]);for(let[e,t]of Object.entries(Jo))Zo(e,t);Object.freeze(Yo);var Qo=Object.freeze(Xo);function $o(e){switch(e){case`initialize`:case`notifications/initialized`:return ja(void 0);case`server/discover`:return ja(Aa);default:return}}var es=[Fe,Ie,Re,Be],ts=[`inputResponses`,`requestState`];function ns(e,t){let n=e.params;if(!ss(n))return{message:e,lifted:{}};let r=n._meta,i=ss(r)?es.filter(e=>e in r):[],a=t===`request`?ts.filter(e=>e in n):[];if(i.length===0&&a.length===0)return{message:e,lifted:{}};let o={},s={...n};if(i.length>0&&ss(r)){let e={},t={...r};for(let n of i)e[n]=r[n],delete t[n];o.envelope=e,Object.keys(t).length>0?s._meta=t:delete s._meta}for(let e of a)e===`inputResponses`&&(o.inputResponses=s[e]),e===`requestState`&&(o.requestState=s[e]),delete s[e];return{message:{...e,params:s},lifted:o}}function rs(e,t){let n=e.validateResult(t,void 0);if(n.ok||n.reason!==`not-in-era`)return{"~standard":{version:1,vendor:`mcp-wire-codec`,validate(n){let r=e.validateResult(t,n);return r.ok?{value:r.value}:{issues:[{message:r.reason===`invalid`?r.message:`not-in-era: ${t}`}]}}}}}function is(e){return()=>e}var as=is(void 0),os=class{_transport;_requestMessageId=0;_requestHandlers=new Map;_customSchemaRequestMethods=new Set;_requestHandlerAbortControllers=new Map;_notificationHandlers=new Map;_responseHandlers=new Map;_progressHandlers=new Map;_timeoutInfo=new Map;_pendingDebouncedNotifications=new Set;_negotiatedProtocolVersion;_supportedProtocolVersions;onclose;onerror;fallbackRequestHandler;fallbackNotificationHandler;constructor(e){this._options=e,this._supportedProtocolVersions=e?.supportedProtocolVersions??Ne,this.setNotificationHandler(`notifications/cancelled`,e=>{this._oncancel(e)}),this.setNotificationHandler(`notifications/progress`,e=>{this._onprogress(e)}),this.setRequestHandler(`ping`,e=>({}))}_shouldDropInbound(e){}_outboundMetaEnvelope(){}_envelopeOutbound(e){let t=this._outboundMetaEnvelope();if(t===void 0)return e;let n=e.params??{};return{...e,params:{...n,_meta:{...t,...n._meta}}}}_resolveNonCompleteResult(e,t){return Promise.reject(new Y(J.UnsupportedResultType,`Unsupported result type '${e.kind}' for ${t.request.method}`,{resultType:e.kind,method:t.request.method}))}_getRequestHandler(e){return this._requestHandlers.get(e)}async _oncancel(e){e.params.requestId!==void 0&&this._requestHandlerAbortControllers.get(e.params.requestId)?.abort(e.params.reason)}_setupTimeout(e,t,n,r,i=!1){this._timeoutInfo.set(e,{timeoutId:setTimeout(r,t),startTime:Date.now(),timeout:t,maxTotalTimeout:n,resetTimeoutOnProgress:i,onTimeout:r})}_resetTimeout(e){let t=this._timeoutInfo.get(e);if(!t)return!1;let n=Date.now()-t.startTime;if(t.maxTotalTimeout&&n>=t.maxTotalTimeout)throw this._timeoutInfo.delete(e),new Y(J.RequestTimeout,`Maximum total timeout exceeded`,{maxTotalTimeout:t.maxTotalTimeout,totalElapsed:n});return clearTimeout(t.timeoutId),t.timeoutId=setTimeout(t.onTimeout,t.timeout),!0}_cleanupTimeout(e){let t=this._timeoutInfo.get(e);t&&(clearTimeout(t.timeoutId),this._timeoutInfo.delete(e))}async connect(e){this._transport=e;let t=this.transport?.onclose;this._transport.onclose=()=>{try{t?.()}finally{this._onclose()}};let n=this.transport?.onerror;this._transport.onerror=e=>{n?.(e),this._onerror(e)};let r=this._transport?.onmessage;this._transport.onmessage=(e,t)=>{r?.(e,t),Ba(e)||Va(e)?this._onresponse(e):Ra(e)?this._onrequest(e,t):za(e)?this._onnotification(e,t):this._onerror(Error(`Unknown message type: ${JSON.stringify(e)}`))},e.setSupportedProtocolVersions?.(this._supportedProtocolVersions),await this._transport.start()}_onclose(){let e=this._responseHandlers;this._responseHandlers=new Map,this._progressHandlers.clear(),this._pendingDebouncedNotifications.clear();for(let e of this._timeoutInfo.values())clearTimeout(e.timeoutId);this._timeoutInfo.clear();let t=this._requestHandlerAbortControllers;this._requestHandlerAbortControllers=new Map;let n=new Y(J.ConnectionClosed,`Connection closed`);this._transport=void 0;try{this.onclose?.()}finally{for(let t of e.values())t(n);for(let e of t.values())e.abort(n)}}_onerror(e){this.onerror?.(e)}_onnotification(e,t){let{message:n}=ns(e,`notification`),r=this._negotiatedWireCodec();if(t?.classification===void 0&&this._shouldDropInbound(e)===`drop`)return;if(t?.classification!==void 0){let e=Ma(t.classification);if(e!==r.era){this._onerror(Error(`Era mismatch on inbound notification '${n.method}': classified as ${e} but this instance serves ${r.era}`));return}}if(Pa(n.method)&&!r.hasNotificationMethod(n.method))return;let i=this._notificationHandlers.get(n.method),a=this.fallbackNotificationHandler;(i!==void 0||a!==void 0)&&Promise.resolve().then(()=>i===void 0?a(n):i(n,r)).catch(e=>this._onerror(Error(`Uncaught error in notification handler: ${e}`)))}_onrequest(e,t){let{message:n,lifted:r}=ns(e,`request`),i=this._negotiatedWireCodec();if(t?.classification===void 0&&this._shouldDropInbound(e)===`drop`){this._onerror(Error(`Dropped inbound request '${e.method}': not servable on this connection's protocol era`));return}let a=this._transport,o=(e,t,r)=>{let i={jsonrpc:`2.0`,id:n.id,error:{code:e,message:t,...r!==void 0&&{data:r}}};a?.send(i).catch(e=>this._onerror(Error(`Failed to send an error response: ${e}`)))};if(t?.classification!==void 0){let e=Ma(t.classification);if(e!==i.era){this._onerror(Error(`Era mismatch on inbound request '${n.method}': classified as ${e} but this instance serves ${i.era}`));let r=t.classification.revision??e;o(X.UnsupportedProtocolVersion,`Unsupported protocol version: ${r}`,{supported:this._supportedProtocolVersions,requested:r});return}}if(Na(n.method)&&!i.hasRequestMethod(n.method)&&!(Fa(n.method)&&this._customSchemaRequestMethods.has(n.method))){o(X.MethodNotFound,`Method not found`);return}let s=this._requestHandlers.get(n.method)??this.fallbackRequestHandler;if(s===void 0){o(X.MethodNotFound,`Method not found`);return}let c=i.checkInboundEnvelope(r);if(c!==void 0){o(X.InvalidParams,c);return}let l=(e,t)=>this._notificationViaCodec(this._resolveOutboundCodec(e.method),e,{...t,relatedRequestId:n.id}),u=(e,t,r)=>this._requestWithSchemaViaCodec(this._resolveOutboundCodec(e.method),e,t,{...r,relatedRequestId:n.id}),d=new AbortController;this._requestHandlerAbortControllers.set(n.id,d);let f=r.inputResponses===void 0?void 0:us(r.inputResponses),p={sessionId:a?.sessionId,mcpReq:{id:n.id,method:n.method,_meta:n.params?._meta,...r.envelope!==void 0&&{envelope:r.envelope},...f!==void 0&&{inputResponses:f.accepted},...f!==void 0&&f.droppedKeys.length>0&&{droppedInputResponseKeys:f.droppedKeys},requestState:r.requestState===void 0?as:is(r.requestState),signal:d.signal,send:((e,t,n)=>{let r=this._resolveOutboundCodec(e.method);if(this._assertOutboundRequestInEra(r,e.method),po(t))return u(e,t,n);let i=rs(r,e.method);if(i===void 0)throw TypeError(`'${e.method}' is not a spec method; pass a result schema as the second argument to ctx.mcpReq.send().`);return u(e,i,t)}),notify:l},http:t?.authInfo?{authInfo:t.authInfo}:void 0},m=this.buildContext(p,t);Promise.resolve().then(()=>s(n,m)).then(async e=>{if(d.signal.aborted)return;let t;try{t=i.encodeResult(n.method,e,this._outboundServerInfo())}catch(e){this._onerror(Error(`Failed to encode result for ${n.method}: ${e}`)),o(X.InternalError,`Internal error`);return}let r={result:t,jsonrpc:`2.0`,id:n.id};await a?.send(r)},async e=>{if(d.signal.aborted)return;let t=Number.isSafeInteger(e.code)?e.code:X.InternalError,r={jsonrpc:`2.0`,id:n.id,error:{code:i.encodeErrorCode(t),message:e.message??`Internal error`,...e.data!==void 0&&{data:e.data}}};await a?.send(r)}).catch(e=>this._onerror(Error(`Failed to send response: ${e}`))).finally(()=>{this._requestHandlerAbortControllers.get(n.id)===d&&this._requestHandlerAbortControllers.delete(n.id)})}_onprogress(e){let{progressToken:t,...n}=e.params,r=Number(t),i=this._progressHandlers.get(r);if(!i){this._onerror(Error(`Received a progress notification for an unknown token: ${JSON.stringify(e)}`));return}let a=this._responseHandlers.get(r),o=this._timeoutInfo.get(r);if(o&&a&&o.resetTimeoutOnProgress)try{this._resetTimeout(r)}catch(e){this._responseHandlers.delete(r),this._progressHandlers.delete(r),this._cleanupTimeout(r),a(e);return}i(n)}_onresponse(e){let t=Number(e.id),n=this._responseHandlers.get(t);if(n===void 0){this._onerror(Error(`Received a response for an unknown message ID: ${JSON.stringify(e)}`));return}this._responseHandlers.delete(t),this._cleanupTimeout(t),this._progressHandlers.delete(t),Ba(e)?n(e):n(Z.fromError(e.error.code,e.error.message,e.error.data))}get transport(){return this._transport}async close(){await this._transport?.close()}request(e,t,n){let r=this._resolveOutboundCodec(e.method);if(po(t))return Fa(e.method)||this._assertOutboundRequestInEra(r,e.method),this._requestWithSchemaViaCodec(r,e,t,n);this._assertOutboundRequestInEra(r,e.method);let i=rs(r,e.method);if(i===void 0)throw TypeError(`'${e.method}' is not a spec method; pass a result schema as the second argument to request().`);return this._requestWithSchemaViaCodec(r,e,i,t)}_negotiatedWireCodec(){return ja(this._negotiatedProtocolVersion)}_wireCodec(){return this._negotiatedWireCodec()}_resolveOutboundCodec(e){if(this._negotiatedProtocolVersion===void 0){let t=$o(e);if(t)return t}return this._negotiatedWireCodec()}_assertOutboundRequestInEra(e,t){if(Na(t)&&!e.hasRequestMethod(t))throw new Y(J.MethodNotSupportedByProtocolVersion,`Method '${t}' is not supported by the negotiated protocol version (wire era ${e.era})`,{method:t,era:e.era})}_requestWithSchema(e,t,n){let r=this._resolveOutboundCodec(e.method);return this._assertOutboundRequestInEra(r,e.method),this._requestWithSchemaViaCodec(r,e,t,n)}_requestWithSchemaViaCodec(e,t,n,r){let{relatedRequestId:i,resumptionToken:a,onresumptiontoken:o,headers:s}=r??{},c=Date.now(),l,u;return new Promise((d,f)=>{let p=e=>{f(e)};if(!this._transport){p(Error(`Not connected`));return}if(this._options?.enforceStrictCapabilities===!0)try{this.assertCapabilityForMethod(t.method)}catch(e){p(e);return}if(r?.signal?.aborted){let e=r.signal.reason;throw e instanceof Y?e:new Y(J.RequestTimeout,String(e))}let m=e.era===`2026-07-28`&&this._transport.hasPerRequestStream===!0?new AbortController:void 0,h=this._requestMessageId++;u=h;let g={...t,jsonrpc:`2.0`,id:h};r?.onprogress&&(this._progressHandlers.set(h,r.onprogress),g.params={...t.params,_meta:{...t.params?._meta,progressToken:h}});let _=this._envelopeOutbound(g),v=!1,y=e=>{v||(this._progressHandlers.delete(h),m===void 0?t.method!==`initialize`&&this._transport?.send(this._envelopeOutbound({jsonrpc:`2.0`,method:`notifications/cancelled`,params:{requestId:h,reason:String(e)}}),{relatedRequestId:i,resumptionToken:a,onresumptiontoken:o}).catch(e=>this._onerror(Error(`Failed to send cancellation: ${e}`))):m.abort(),f(e instanceof Y?e:new Y(J.RequestTimeout,String(e))))};this._responseHandlers.set(h,i=>{if(r?.signal?.aborted)return;if(v=!0,i instanceof Error)return f(i);let a;try{a=e.decodeResult(t.method,i.result)}catch(e){return f(e instanceof Error?e:Error(String(e)))}if(a.kind===`invalid`)return f(a.error);if(a.kind===`input_required`){if(r?.allowInputRequired===!0)return d(gs(a));let i={codec:e,request:t,resultSchema:n,options:r,flowStartedAt:c,retry:(r,i)=>this._requestWithSchemaViaCodec(e,r===void 0?{method:t.method}:{method:t.method,params:r},n,i)};return d(this._resolveNonCompleteResult(a,i))}let o=a.result;yo(n,o).then(e=>{e.success?d(e.data):f(new Y(J.InvalidResult,`Invalid result for ${t.method}: ${e.error}`))},f)}),l=()=>y(r?.signal?.reason),r?.signal?.addEventListener(`abort`,l,{once:!0});let b=r?.timeout??6e4;this._setupTimeout(h,b,r?.maxTotalTimeout,()=>y(new Y(J.RequestTimeout,`Request timed out`,{timeout:b})),r?.resetTimeoutOnProgress??!1),this._transport.send(_,{relatedRequestId:i,resumptionToken:a,onresumptiontoken:o,headers:s,requestSignal:m?.signal}).catch(e=>{this._progressHandlers.delete(h),f(e)})}).finally(()=>{l&&r?.signal?.removeEventListener(`abort`,l),u!==void 0&&(this._responseHandlers.delete(u),this._cleanupTimeout(u))})}async notification(e,t){return await this._notificationViaCodec(this._resolveOutboundCodec(e.method),e,t)}async _notificationViaCodec(e,t,n){if(!this._transport)throw new Y(J.NotConnected,`Not connected`);if(Pa(t.method)&&!e.hasNotificationMethod(t.method))throw new Y(J.MethodNotSupportedByProtocolVersion,`Notification '${t.method}' is not supported by the negotiated protocol version (wire era ${e.era})`,{method:t.method,era:e.era});this.assertNotificationCapability(t.method);let r=this._envelopeOutbound({jsonrpc:`2.0`,...t});if((this._options?.debouncedNotificationMethods??[]).includes(t.method)&&!t.params&&n?.relatedRequestId===void 0){if(this._pendingDebouncedNotifications.has(t.method))return;this._pendingDebouncedNotifications.add(t.method),Promise.resolve().then(()=>{this._pendingDebouncedNotifications.delete(t.method),this._transport&&this._transport?.send(r,n).catch(e=>this._onerror(e))});return}await this._transport.send(r,n)}setRequestHandler(e,t,n){this.assertRequestHandlerCapability(e);let r;if(typeof t==`function`){if(!Na(e))throw TypeError(`'${e}' is not a spec request method; pass schemas as the second argument to setRequestHandler().`);r=(n,r)=>{let i=this._negotiatedWireCodec(),a=i.validateRequest(e,n);if(!a.ok&&a.reason===`not-in-era`&&(a=i.validateInputRequest(e,n)),!a.ok)throw a.reason===`not-in-era`?new Z(X.InternalError,`No wire schema for ${e} in the resolved era`):Error(a.message);return Promise.resolve(t(a.value,r))}}else if(n)r=async(r,i)=>{let a=await yo(t.params,{...r.params});if(!a.success)throw new Z(X.InvalidParams,`Invalid params for ${e}: ${a.error}`);return n(a.data,i)};else throw TypeError(`setRequestHandler: handler is required`);typeof t==`function`?this._customSchemaRequestMethods.delete(e):this._customSchemaRequestMethods.add(e),this._requestHandlers.set(e,this._wrapHandler(e,r))}_wrapHandler(e,t){return t}_outboundServerInfo(){}removeRequestHandler(e){this._requestHandlers.delete(e),this._customSchemaRequestMethods.delete(e)}assertCanSetRequestHandler(e){if(this._requestHandlers.has(e))throw Error(`A request handler for ${e} already exists, which would be overridden`)}setNotificationHandler(e,t,n){if(typeof t==`function`){if(!Pa(e))throw TypeError(`'${e}' is not a spec notification method; pass schemas as the second argument to setNotificationHandler().`);this._notificationHandlers.set(e,(n,r)=>{let i=r.validateNotification(e,n);if(!i.ok)throw i.reason===`not-in-era`?new Z(X.InternalError,`No wire schema for ${e} in the resolved era`):Error(i.message);return Promise.resolve(t(i.value))});return}if(!n)throw TypeError(`setNotificationHandler: handler is required`);this._notificationHandlers.set(e,async r=>{let i=await yo(t.params,{...r.params});if(!i.success)throw new Z(X.InvalidParams,`Invalid params for notification ${e}: ${i.error}`);await n(i.data,r)})}removeNotificationHandler(e){this._notificationHandlers.delete(e)}};function ss(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function cs(e,t){let n={...e};for(let e in t){let r=e,i=t[r];if(i===void 0)continue;let a=n[r];n[r]=ss(a)&&ss(i)?{...a,...i}:i}return n}function ls(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function us(e){let t={},n=[];if(!ls(e))return{accepted:t,droppedKeys:n};for(let[r,i]of Object.entries(e)){if(!ls(i)||`method`in i||`result`in i){n.push(r);continue}t[r]=i}return{accepted:t,droppedKeys:n}}function ds(e){throw new Y(J.SendFailed,`ctx.mcpReq.${e} is not available while fulfilling an embedded input request: the request is fulfilled locally and has no related peer request`)}function fs(e,t,n,r,i){return{sessionId:i,mcpReq:{id:e,method:t,_meta:n?._meta,requestState:is(void 0),signal:r,send:(()=>ds(`send`)),notify:()=>ds(`notify`)}}}async function ps(e,t,n,r,i){if(!ls(r)||typeof r.method!=`string`)throw new Y(J.InvalidResult,`Invalid input request '${n}': each inputRequests entry must be an embedded request object with a method`,{key:n});let a=r.method;if(!t.hasInputRequestMethod(a))throw new Y(J.InvalidResult,`Invalid input request '${n}': '${a}' is not an embedded request the ${t.era} revision defines (expected elicitation/create, sampling/createMessage, or roots/list)`,{key:n,method:a});let o=e.getRequestHandler(a);if(o===void 0)throw new Y(J.CapabilityNotSupported,`Cannot fulfil input request '${n}': no handler is registered for '${a}' on this client. Declare the corresponding capability and register a handler, or handle input_required results manually.`,{key:n,method:a});let s=ls(r.params)?r.params:void 0;return await o({jsonrpc:`2.0`,id:n,method:a,...s!==void 0&&{params:s}},e.buildContext(fs(n,a,s,i,e.sessionId)))}function ms(e,t){return{...e?.signal!==void 0&&{signal:e.signal},...e?.onprogress!==void 0&&{onprogress:e.onprogress},...e?.resetTimeoutOnProgress!==void 0&&{resetTimeoutOnProgress:e.resetTimeoutOnProgress},...e?.headers!==void 0&&{headers:e.headers},...t.timeout!==void 0&&{timeout:t.timeout},...t.maxTotalTimeout!==void 0&&{maxTotalTimeout:t.maxTotalTimeout},allowInputRequired:!0}}function hs(e,t,n,r){let{codec:i,request:a,options:o,flowStartedAt:s}=r,c={inputRequests:n.inputRequests,...n.requestState!==void 0&&{requestState:n.requestState}},l={dispatchInputRequest:(t,n,r)=>ps(e,i,t,n,r),retry:(e,t)=>r.retry(e,ms(o,t))};return Ko({config:t,method:a.method,originalParams:a.params,firstPayload:c,flowStartedAt:s,signal:o?.signal,requestOptions:{...o?.timeout!==void 0&&{timeout:o.timeout},...o?.maxTotalTimeout!==void 0&&{maxTotalTimeout:o.maxTotalTimeout},...o?.onprogress!==void 0&&{onprogress:o.onprogress}},hooks:l})}function gs(e){return{resultType:`input_required`,inputRequests:e.inputRequests,...e.requestState!==void 0&&{requestState:e.requestState},...e._meta!==void 0&&{_meta:e._meta}}}var _s=Te(Se((e=>{var t=/; *([!#$%&'*+.^_`|~0-9A-Za-z-]+) *= *("(?:[\u000b\u0020\u0021\u0023-\u005b\u005d-\u007e\u0080-\u00ff]|\\[\u000b\u0020-\u00ff])*"|[!#$%&'*+.^_`|~0-9A-Za-z-]+) */g,n=/\\([\u000b\u0020-\u00ff])/g,r=/^[!#$%&'*+.^_`|~0-9A-Za-z-]+\/[!#$%&'*+.^_`|~0-9A-Za-z-]+$/;e.parse=i;function i(e){if(!e)throw TypeError(`argument string is required`);var i=typeof e==`object`?a(e):e;if(typeof i!=`string`)throw TypeError(`argument string is required to be a string`);var s=i.indexOf(`;`),c=s===-1?i.trim():i.slice(0,s).trim();if(!r.test(c))throw TypeError(`invalid media type`);var l=new o(c.toLowerCase());if(s!==-1){var u,d,f;for(t.lastIndex=s;d=t.exec(i);){if(d.index!==s)throw TypeError(`invalid parameter format`);s+=d[0].length,u=d[1].toLowerCase(),f=d[2],f.charCodeAt(0)===34&&(f=f.slice(1,-1),f.indexOf(`\\`)!==-1&&(f=f.replace(n,`$1`))),l.parameters[u]=f}if(s!==i.length)throw TypeError(`invalid parameter format`)}return l}function a(e){var t;if(typeof e.getHeader==`function`?t=e.getHeader(`content-type`):typeof e.headers==`object`&&(t=e.headers&&e.headers[`content-type`]),typeof t!=`string`)throw TypeError(`content-type header is missing from object`);return t}function o(e){this.parameters=Object.create(null),this.type=e}}))(),1);function vs(e){if(e)try{return _s.parse(e).type}catch{let t=(e.split(`;`,1)[0]??``).trim().toLowerCase();return t===``||e.slice(t.length).includes(`,`)?void 0:t}}function ys(e){return e?e instanceof Headers?Object.fromEntries(e.entries()):Array.isArray(e)?Object.fromEntries(e):{...e}:{}}function bs(e=fetch,t){return t?async(n,r)=>e(n,{...t,...r,headers:r?.headers?{...ys(t.headers),...ys(r.headers)}:t.headers}):e}var xs=new Set([301,302,303,307,308]),Ss=5;function Cs(e,t){return e.protocol===t.protocol&&e.host===t.host||e.protocol===`http:`&&t.protocol===`https:`&&e.hostname===t.hostname&&!e.port&&!t.port}function ws(e,t){let n=xs.has(t.status)?t.headers?.get(`location`):void 0;if(n)try{return new URL(n,e)}catch{return}}var Ts=new WeakSet;function Es(e){let t=(t,n)=>e(t,n);return Ts.add(t),t}function Ds(e){return Ts.has(e)?e:async(t,n)=>{if(n?.redirect===`error`||n?.redirect===`manual`)return e(t,n);let r=(n?.method??`GET`).toUpperCase(),i=t;for(let t=0;;t++){let a=await e(i,{...n,redirect:`manual`}),o=ws(i,a);if(!o||t===Ss)return a;let s=new URL(i),c=r===`GET`||a.status===307||a.status===308,l=!(o.username||o.password)||o.username===s.username&&o.password===s.password;if(!c||!l||!Cs(s,o))return a;await a.text?.().catch(()=>{}),i=o}}}function Os(e,t){if(t.type===`opaqueredirect`)return`Redirect not followed: this runtime does not expose where it points`;let n=ws(t.url||e,t);if(n)return n.username=n.password=n.search=n.hash=``,n.protocol===`http:`&&new URL(t.url||e).protocol===`https:`?(n.protocol=`https:`,`Redirect from https to plain http not followed; try ${n.href} as the endpoint`):`Redirect to ${n.href} not followed; use that URL as the endpoint if it is the intended server`}function ks(e,t){let n=typeof e;if(n!==typeof t)return!1;if(Array.isArray(e)){if(!Array.isArray(t))return!1;let n=e.length;if(n!==t.length)return!1;for(let r=0;r1?t[a.href]=e:(a.hash=``,r===``?n=a:Is(e,t,n))}}else if(e!==!0&&e!==!1)return t;let i=n.href+(r?`#`+r:``);if(t[i]!==void 0)throw Error(`Duplicate schema URI "${i}".`);if(t[i]=e,e===!0||e===!1)return t;if(e.__absolute_uri__===void 0&&Object.defineProperty(e,"__absolute_uri__",{enumerable:!1,value:i}),e.$ref&&e.__absolute_ref__===void 0){let t=new URL(e.$ref,n.href);t.hash=t.hash,Object.defineProperty(e,"__absolute_ref__",{enumerable:!1,value:t.href})}if(e.$recursiveRef&&e.__absolute_recursive_ref__===void 0){let t=new URL(e.$recursiveRef,n.href);t.hash=t.hash,Object.defineProperty(e,"__absolute_recursive_ref__",{enumerable:!1,value:t.href})}if(e.$anchor){let r=new URL(`#`+e.$anchor,n.href);t[r.href]=e}for(let i in e){if(Ps[i])continue;let a=`${r}/${As(i)}`,o=e[i];if(Array.isArray(o)){if(Ms[i]){let e=o.length;for(let r=0;r%\\^`{|}]|%[0-9a-f]{2})|\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?)*\})*$/i,Us=/^(?:(?:https?|ftp):\/\/)(?:\S+(?::\S*)?@)?(?:(?!10(?:\.\d{1,3}){3})(?!127(?:\.\d{1,3}){3})(?!169\.254(?:\.\d{1,3}){2})(?!192\.168(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z\u{00a1}-\u{ffff}0-9]+-?)*[a-z\u{00a1}-\u{ffff}0-9]+)(?:\.(?:[a-z\u{00a1}-\u{ffff}0-9]+-?)*[a-z\u{00a1}-\u{ffff}0-9]+)*(?:\.(?:[a-z\u{00a1}-\u{ffff}]{2,})))(?::\d{2,5})?(?:\/[^\s]*)?$/iu,Ws=/^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i,Gs=/^(?:\/(?:[^~/]|~0|~1)*)*$/,Ks=/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i,qs=/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/,Js=e=>{if(e[0]===`"`)return!1;let[t,n,...r]=e.split(`@`);return!t||!n||r.length!==0||t.length>64||n.length>253||t[0]===`.`||t.endsWith(`.`)||t.includes(`..`)||!/^[a-z0-9.-]+$/i.test(n)||!/^[a-z0-9.!#$%&'*+/=?^_`{|}~-]+$/i.test(t)?!1:n.split(`.`).every(e=>/^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$/i.test(e))},Ys=/^(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)$/,Xs=/^((([0-9a-f]{1,4}:){7}([0-9a-f]{1,4}|:))|(([0-9a-f]{1,4}:){6}(:[0-9a-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){5}(((:[0-9a-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){4}(((:[0-9a-f]{1,4}){1,3})|((:[0-9a-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){3}(((:[0-9a-f]{1,4}){1,4})|((:[0-9a-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){2}(((:[0-9a-f]{1,4}){1,5})|((:[0-9a-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){1}(((:[0-9a-f]{1,4}){1,6})|((:[0-9a-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9a-f]{1,4}){1,7})|((:[0-9a-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))$/i,Zs=e=>e.length>1&&e.length<80&&(/^P\d+([.,]\d+)?W$/.test(e)||/^P[\dYMDTHS]*(\d[.,]\d+)?[YMDHS]$/.test(e)&&/^P([.,\d]+Y)?([.,\d]+M)?([.,\d]+D)?(T([.,\d]+H)?([.,\d]+M)?([.,\d]+S)?)?$/.test(e));function Qs(e){return e.test.bind(e)}var $s={date:tc,time:nc.bind(void 0,!1),"date-time":ic,duration:Zs,uri:sc,"uri-reference":Qs(Vs),"uri-template":Qs(Hs),url:Qs(Us),email:Js,hostname:Qs(Bs),ipv4:Qs(Ys),ipv6:Qs(Xs),regex:lc,uuid:Qs(Ws),"json-pointer":Qs(Gs),"json-pointer-uri-fragment":Qs(Ks),"relative-json-pointer":Qs(qs)};function ec(e){return e%4==0&&(e%100!=0||e%400==0)}function tc(e){let t=e.match(Ls);if(!t)return!1;let n=+t[1],r=+t[2],i=+t[3];return r>=1&&r<=12&&i>=1&&i<=(r==2&&ec(n)?29:Rs[r])}function nc(e,t){let n=t.match(zs);if(!n)return!1;let r=+n[1],i=+n[2],a=+n[3],o=!!n[5];return(r<=23&&i<=59&&a<=59||r==23&&i==59&&a==60)&&(!e||o)}var rc=/t|\s/i;function ic(e){let t=e.split(rc);return t.length==2&&tc(t[0])&&nc(!0,t[1])}var ac=/\/|:/,oc=/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)(?:\?(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i;function sc(e){return ac.test(e)&&oc.test(e)}var cc=/[^\\]\\Z/;function lc(e){if(cc.test(e))return!1;try{return new RegExp(e,`u`),!0}catch{return!1}}function uc(e){let t=0,n=e.length,r=0,i;for(;r=55296&&i<=56319&&r{if(typeof e!=`string`||/[\s;'\"]/.test(e))return!1;let t=e.match(/^([a-z]+):\/\/([^/]+)$/i);return!!(t&&n.has(t[1].toLowerCase()))})}function ge(e){let t=N(N(N(e)?.ui)?.csp),n=P(t?.connectDomains,[`http`,`https`,`ws`,`wss`]),r=P(t?.resourceDomains,[`http`,`https`]),i=P(t?.frameDomains,[`http`,`https`]),a=P(t?.baseUriDomains,[`http`,`https`]),o=r.length?` ${r.join(` `)}`:``,s=[`default-src 'none'`,`worker-src blob:`,`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(`; `)};`}var _e=Object.create,ve=Object.defineProperty,ye=Object.getOwnPropertyDescriptor,be=Object.getOwnPropertyNames,F=Object.getPrototypeOf,xe=Object.prototype.hasOwnProperty,Se=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),Ce=(e,t)=>{let n={};for(var r in e)ve(n,r,{get:e[r],enumerable:!0});return t&&ve(n,Symbol.toStringTag,{value:`Module`}),n},we=(e,t,n,r)=>{if(t&&typeof t==`object`||typeof t==`function`)for(var i=be(t),a=0,o=i.length,s;at[e]).bind(null,s),enumerable:!(r=ye(t,s))||r.enumerable});return e},Te=(e,t,n)=>(n=e==null?{}:_e(F(e)),we(t||!e||!e.__esModule?ve(n,`default`,{value:e,enumerable:!0}):n,e)),Ee=new Set([`https://json-schema.org/draft/2020-12/schema`,`http://json-schema.org/draft/2020-12/schema`]),De=new Set([`https://json-schema.org/draft/2019-09/schema`,`http://json-schema.org/draft/2019-09/schema`]),Oe=new Set([`https://json-schema.org/draft-07/schema`,`http://json-schema.org/draft-07/schema`]),ke=new Set([`https://json-schema.org/draft-06/schema`,`http://json-schema.org/draft-06/schema`]);function Ae(e){return typeof e==`string`&&De.has(e.replace(/#$/,``))}function je(e,t){if(!(`$schema`in e)||typeof e.$schema!=`string`)return`2020-12`;let n=e.$schema.replace(/#$/,``);if(Ee.has(n))return`2020-12`;if(De.has(n))return`2019-09`;if(Oe.has(n)||ke.has(n))return`draft-7`;throw Error(`JSON Schema declares an unsupported dialect ("$schema": "${e.$schema.slice(0,200)}"). The default validator supports JSON Schema 2020-12, 2019-09, draft-07, and draft-06; ${t}`)}var Me=`2025-11-25`,Ne=[Me,`2025-06-18`,`2025-03-26`,`2024-11-05`,`2024-10-07`],Pe=`io.modelcontextprotocol/related-task`,Fe=`io.modelcontextprotocol/protocolVersion`,Ie=`io.modelcontextprotocol/clientInfo`,Le=`io.modelcontextprotocol/serverInfo`,Re=`io.modelcontextprotocol/clientCapabilities`,ze=`io.modelcontextprotocol/subscriptionId`,Be=`io.modelcontextprotocol/logLevel`,Ve=ee(()=>h([g(),j(),O(),oe(),C(g(),Ve),D(Ve)])),I=C(g(),Ve),He=D(Ve),Ue=h([g(),j().int()]),We=g(),Ge=S({ttl:j().optional()}),Ke=S({taskId:g()}),qe=M({progressToken:Ue.optional(),[Pe]:Ke.optional()}),L=S({_meta:qe.optional()}),Je=L.extend({task:Ge.optional()}),R=S({method:g(),params:L.loose().optional()}),z=S({_meta:qe.optional()}),B=S({method:g(),params:z.loose().optional()}),Ye=M({get[Le](){return H.optional().catch(void 0)}}),V=M({_meta:Ye.optional()}),Xe=h([g(),j().int()]),Ze=S({jsonrpc:k(`2.0`),id:Xe,...R.shape}).strict(),Qe=S({jsonrpc:k(`2.0`),...B.shape}).strict(),$e=S({jsonrpc:k(`2.0`),id:Xe,result:V}).strict(),et=S({jsonrpc:k(`2.0`),id:Xe.optional(),error:S({code:j().int(),message:g(),data:b().optional()})}).strict(),tt=h([Ze,Qe,$e,et]),nt=h([$e,et]),rt=V.strict(),it=z.extend({requestId:Xe.optional(),reason:g().optional()}),at=B.extend({method:k(`notifications/cancelled`),params:it}),ot=S({src:g(),mimeType:g().optional(),sizes:D(g()).optional(),theme:E([`light`,`dark`]).optional()}),st=S({icons:D(ot).optional()}),ct=S({name:g(),title:g().optional()}),H=ct.extend({...ct.shape,...st.shape,version:g(),websiteUrl:g().optional(),description:g().optional()}),lt=ne(S({applyDefaults:O().optional()}),I),ut=A(e=>e&&typeof e==`object`&&!Array.isArray(e)&&Object.keys(e).length===0?{form:{}}:e,ne(S({form:lt.optional(),url:I.optional()}),I.optional())),dt=M({list:I.optional(),cancel:I.optional(),requests:M({sampling:M({createMessage:I.optional()}).optional(),elicitation:M({create:I.optional()}).optional()}).optional()}),ft=M({list:I.optional(),cancel:I.optional(),requests:M({tools:M({call:I.optional()}).optional()}).optional()}),pt=S({experimental:C(g(),I).optional(),sampling:S({context:I.optional(),tools:I.optional()}).optional(),elicitation:ut.optional(),roots:S({listChanged:O().optional()}).optional(),tasks:dt.optional(),extensions:C(g(),I).optional()}),mt=L.extend({protocolVersion:g(),capabilities:pt,clientInfo:H}),ht=R.extend({method:k(`initialize`),params:mt}),gt=S({experimental:C(g(),I).optional(),logging:I.optional(),completions:I.optional(),prompts:S({listChanged:O().optional()}).optional(),resources:S({subscribe:O().optional(),listChanged:O().optional()}).optional(),tools:S({listChanged:O().optional()}).optional(),tasks:ft.optional(),extensions:C(g(),I).optional()}),_t=V.extend({protocolVersion:g(),capabilities:gt,serverInfo:H,instructions:g().optional()}),vt=B.extend({method:k(`notifications/initialized`),params:z.optional()}),yt=R.extend({method:k(`server/discover`),params:L.optional()}),bt=V.extend({supportedVersions:D(g()),capabilities:gt,instructions:g().optional()}),xt=R.extend({method:k(`ping`),params:L.optional()}),St=S({progress:j(),total:m(j()),message:m(g())}),Ct=S({...z.shape,...St.shape,progressToken:Ue}),wt=B.extend({method:k(`notifications/progress`),params:Ct}),Tt=L.extend({cursor:We.optional()}),Et=R.extend({params:Tt.optional()}),Dt=V.extend({nextCursor:We.optional()}),Ot=S({uri:g(),mimeType:m(g()),_meta:C(g(),b()).optional()}),kt=Ot.extend({text:g()}),At=g().refine(e=>{try{return atob(e),!0}catch{return!1}},{message:`Invalid Base64 string`}),jt=Ot.extend({blob:At}),Mt=E([`user`,`assistant`]),Nt=S({audience:D(Mt).optional(),priority:j().min(0).max(1).optional(),lastModified:pe({offset:!0}).optional()}),Pt=S({...ct.shape,...st.shape,uri:g(),description:m(g()),mimeType:m(g()),size:m(j()),annotations:Nt.optional(),_meta:m(M({}))}),Ft=S({...ct.shape,...st.shape,uriTemplate:g(),description:m(g()),mimeType:m(g()),annotations:Nt.optional(),_meta:m(M({}))}),It=Et.extend({method:k(`resources/list`)}),Lt=Dt.extend({resources:D(Pt)}),U=Et.extend({method:k(`resources/templates/list`)}),W=Dt.extend({resourceTemplates:D(Ft)}),Rt=L.extend({uri:g()}),zt=Rt,Bt=R.extend({method:k(`resources/read`),params:zt}),Vt=V.extend({contents:D(h([kt,jt]))}),Ht=B.extend({method:k(`notifications/resources/list_changed`),params:z.optional()}),Ut=Rt,Wt=R.extend({method:k(`resources/subscribe`),params:Ut}),Gt=Rt,Kt=R.extend({method:k(`resources/unsubscribe`),params:Gt}),qt=S({toolsListChanged:O().optional(),promptsListChanged:O().optional(),resourcesListChanged:O().optional(),resourceSubscriptions:D(g()).optional()}),Jt=L.extend({notifications:qt}),Yt=R.extend({method:k(`subscriptions/listen`),params:Jt}),Xt=z.extend({notifications:qt}),Zt=B.extend({method:k(`notifications/subscriptions/acknowledged`),params:Xt}),Qt=Ye.extend({[ze]:Xe}),$t=V.extend({_meta:Qt}),en=z.extend({uri:g()}),tn=B.extend({method:k(`notifications/resources/updated`),params:en}),G=S({name:g(),description:m(g()),required:m(O())}),nn=S({...ct.shape,...st.shape,description:m(g()),arguments:m(D(G)),_meta:m(M({}))}),rn=Et.extend({method:k(`prompts/list`)}),an=Dt.extend({prompts:D(nn)}),on=L.extend({name:g(),arguments:C(g(),g()).optional()}),sn=R.extend({method:k(`prompts/get`),params:on}),cn=S({type:k(`text`),text:g(),annotations:Nt.optional(),_meta:C(g(),b()).optional()}),K=S({type:k(`image`),data:At,mimeType:g(),annotations:Nt.optional(),_meta:C(g(),b()).optional()}),ln=S({type:k(`audio`),data:At,mimeType:g(),annotations:Nt.optional(),_meta:C(g(),b()).optional()}),un=S({type:k(`tool_use`),name:g(),id:g(),input:C(g(),b()),_meta:C(g(),b()).optional()}),dn=S({type:k(`resource`),resource:h([kt,jt]),annotations:Nt.optional(),_meta:C(g(),b()).optional()}),fn=Pt.extend({type:k(`resource_link`)}),pn=h([cn,K,ln,fn,dn]),mn=S({role:Mt,content:pn}),hn=V.extend({description:g().optional(),messages:D(mn)}),gn=B.extend({method:k(`notifications/prompts/list_changed`),params:z.optional()}),_n=S({title:g().optional(),readOnlyHint:O().optional(),destructiveHint:O().optional(),idempotentHint:O().optional(),openWorldHint:O().optional()}),vn=S({taskSupport:E([`required`,`optional`,`forbidden`]).optional()}),yn=S({...ct.shape,...st.shape,description:g().optional(),inputSchema:S({type:k(`object`),properties:C(g(),Ve).optional(),required:D(g()).optional()}).catchall(b()),outputSchema:M({$schema:g().optional()}).optional(),annotations:_n.optional(),execution:vn.optional(),_meta:C(g(),b()).optional()}),bn=Et.extend({method:k(`tools/list`)}),xn=Dt.extend({tools:D(yn)}),Sn=V.extend({content:D(pn).default([]),structuredContent:b().optional(),isError:O().optional()}),Cn=Sn.or(V.extend({toolResult:b()})),wn=Je.extend({name:g(),arguments:C(g(),b()).optional()}),Tn=R.extend({method:k(`tools/call`),params:wn}),En=B.extend({method:k(`notifications/tools/list_changed`),params:z.optional()}),Dn=S({autoRefresh:O().default(!0),debounceMs:j().int().nonnegative().default(300)}),On=E([`debug`,`info`,`notice`,`warning`,`error`,`critical`,`alert`,`emergency`]),kn=L.extend({level:On}),An=R.extend({method:k(`logging/setLevel`),params:kn}),jn=z.extend({level:On,logger:g().optional(),data:b()}),Mn=B.extend({method:k(`notifications/message`),params:jn}),Nn=S({name:g().optional()}),Pn=S({hints:D(Nn).optional(),costPriority:j().min(0).max(1).optional(),speedPriority:j().min(0).max(1).optional(),intelligencePriority:j().min(0).max(1).optional()}),Fn=S({mode:E([`auto`,`required`,`none`]).optional()}),In=S({type:k(`tool_result`),toolUseId:g().describe(`The unique identifier for the corresponding tool call.`),content:D(pn),structuredContent:b().optional(),isError:O().optional(),_meta:C(g(),b()).optional()}),Ln=se(`type`,[cn,K,ln]),Rn=se(`type`,[cn,K,ln,un,In]),zn=S({role:Mt,content:h([Rn,D(Rn)]),_meta:C(g(),b()).optional()}),Bn=Je.extend({messages:D(zn),modelPreferences:Pn.optional(),systemPrompt:g().optional(),includeContext:E([`none`,`thisServer`,`allServers`]).optional(),temperature:j().optional(),maxTokens:j().int(),stopSequences:D(g()).optional(),metadata:I.optional(),tools:D(yn).optional(),toolChoice:Fn.optional()}),Vn=R.extend({method:k(`sampling/createMessage`),params:Bn}),Hn=V.extend({model:g(),stopReason:m(E([`endTurn`,`stopSequence`,`maxTokens`]).or(g())),role:Mt,content:Ln}),Un=V.extend({model:g(),stopReason:m(E([`endTurn`,`stopSequence`,`maxTokens`,`toolUse`]).or(g())),role:Mt,content:h([Rn,D(Rn)])}),Wn=S({type:k(`boolean`),title:g().optional(),description:g().optional(),default:O().optional()}),Gn=S({type:k(`string`),title:g().optional(),description:g().optional(),minLength:j().optional(),maxLength:j().optional(),format:E([`email`,`uri`,`date`,`date-time`]).optional(),default:g().optional()}),Kn=S({type:E([`number`,`integer`]),title:g().optional(),description:g().optional(),minimum:j().optional(),maximum:j().optional(),default:j().optional()}),qn=S({type:k(`string`),title:g().optional(),description:g().optional(),enum:D(g()),default:g().optional()}),Jn=S({type:k(`string`),title:g().optional(),description:g().optional(),oneOf:D(S({const:g(),title:g()})),default:g().optional()}),Yn=S({type:k(`string`),title:g().optional(),description:g().optional(),enum:D(g()),enumNames:D(g()).optional(),default:g().optional()}),Xn=h([qn,Jn]),Zn=S({type:k(`array`),title:g().optional(),description:g().optional(),minItems:j().optional(),maxItems:j().optional(),items:S({type:k(`string`),enum:D(g())}),default:D(g()).optional()}),Qn=S({type:k(`array`),title:g().optional(),description:g().optional(),minItems:j().optional(),maxItems:j().optional(),items:S({anyOf:D(S({const:g(),title:g()}))}),default:D(g()).optional()}),$n=h([Zn,Qn]),er=h([Yn,Xn,$n]),tr=h([er,Wn,Gn,Kn]),nr=Je.extend({mode:k(`form`).optional(),message:g(),requestedSchema:S({type:k(`object`),properties:C(g(),tr),required:D(g()).optional()}).catchall(b())}),rr=Je.extend({mode:k(`url`),message:g(),elicitationId:g(),url:g().url()}),ir=h([nr,rr]),ar=R.extend({method:k(`elicitation/create`),params:ir}),or=z.extend({elicitationId:g()}),sr=B.extend({method:k(`notifications/elicitation/complete`),params:or}),cr=V.extend({action:E([`accept`,`decline`,`cancel`]),content:A(e=>e===null?void 0:e,C(g(),h([g(),j(),O(),D(g())])).optional())}),lr=S({type:k(`ref/resource`),uri:g()}),ur=S({type:k(`ref/prompt`),name:g()}),dr=L.extend({ref:h([ur,lr]),argument:S({name:g(),value:g()}),context:S({arguments:C(g(),g()).optional()}).optional()}),fr=R.extend({method:k(`completion/complete`),params:dr}),pr=V.extend({completion:M({values:D(g()).max(100),total:m(j().int()),hasMore:m(O())})}),mr=S({uri:g().startsWith(`file://`),name:g().optional(),_meta:C(g(),b()).optional()}),hr=R.extend({method:k(`roots/list`),params:L.optional()}),gr=V.extend({roots:D(mr)}),_r=B.extend({method:k(`notifications/roots/list_changed`),params:z.optional()}),vr=M({ttl:j().optional(),pollInterval:j().optional()}),yr=E([`working`,`input_required`,`completed`,`failed`,`cancelled`]),br=S({taskId:g(),status:yr,ttl:h([j(),oe()]),createdAt:g(),lastUpdatedAt:g(),pollInterval:m(j()),statusMessage:m(g())}),xr=V.extend({task:br}),Sr=z.merge(br),Cr=B.extend({method:k(`notifications/tasks/status`),params:Sr}),wr=R.extend({method:k(`tasks/get`),params:L.extend({taskId:g()})}),Tr=V.merge(br),Er=R.extend({method:k(`tasks/result`),params:L.extend({taskId:g()})}),Dr=V.loose(),Or=Et.extend({method:k(`tasks/list`)}),kr=Dt.extend({tasks:D(br)}),Ar=R.extend({method:k(`tasks/cancel`),params:L.extend({taskId:g()})}),jr=V.merge(br),Mr=h([xt,ht,yt,fr,An,sn,rn,It,U,Bt,Wt,Kt,Yt,Tn,bn]),Nr=h([at,wt,vt,_r]),Pr=h([rt,Hn,Un,cr,gr]),Fr=h([xt,Vn,ar,hr]),Ir=h([at,wt,Mn,tn,Ht,En,gn,Zt,sr]),Lr=h([rt,_t,bt,pr,hn,an,Lt,W,Vt,Sn,xn,$t]),q=ae().superRefine((e,t)=>{if(!URL.canParse(e))return t.addIssue({code:de.custom,message:`URL must be parseable`,fatal:!0}),_}).refine(e=>{let t=new URL(e);return t.protocol!==`javascript:`&&t.protocol!==`data:`&&t.protocol!==`vbscript:`},{message:`URL cannot use javascript:, data:, or vbscript: scheme`}),Rr=M({resource:g().url(),authorization_servers:D(q).optional(),jwks_uri:g().url().optional(),scopes_supported:D(g()).optional(),bearer_methods_supported:D(g()).optional(),resource_signing_alg_values_supported:D(g()).optional(),resource_name:g().optional(),resource_documentation:g().optional(),resource_policy_uri:g().url().optional(),resource_tos_uri:g().url().optional(),tls_client_certificate_bound_access_tokens:O().optional(),authorization_details_types_supported:D(g()).optional(),dpop_signing_alg_values_supported:D(g()).optional(),dpop_bound_access_tokens_required:O().optional()}),zr=M({issuer:g(),authorization_endpoint:q,token_endpoint:q,registration_endpoint:q.optional(),scopes_supported:D(g()).optional(),response_types_supported:D(g()),response_modes_supported:D(g()).optional(),grant_types_supported:D(g()).optional(),token_endpoint_auth_methods_supported:D(g()).optional(),token_endpoint_auth_signing_alg_values_supported:D(g()).optional(),service_documentation:q.optional(),revocation_endpoint:q.optional(),revocation_endpoint_auth_methods_supported:D(g()).optional(),revocation_endpoint_auth_signing_alg_values_supported:D(g()).optional(),introspection_endpoint:g().optional(),introspection_endpoint_auth_methods_supported:D(g()).optional(),introspection_endpoint_auth_signing_alg_values_supported:D(g()).optional(),code_challenge_methods_supported:D(g()).optional(),client_id_metadata_document_supported:O().optional(),authorization_response_iss_parameter_supported:O().optional().catch(void 0),dpop_signing_alg_values_supported:D(g()).optional()}),Br=M({issuer:g(),authorization_endpoint:q,token_endpoint:q,userinfo_endpoint:q.optional(),jwks_uri:q,registration_endpoint:q.optional(),scopes_supported:D(g()).optional(),response_types_supported:D(g()),response_modes_supported:D(g()).optional(),grant_types_supported:D(g()).optional(),acr_values_supported:D(g()).optional(),subject_types_supported:D(g()),id_token_signing_alg_values_supported:D(g()),id_token_encryption_alg_values_supported:D(g()).optional(),id_token_encryption_enc_values_supported:D(g()).optional(),userinfo_signing_alg_values_supported:D(g()).optional(),userinfo_encryption_alg_values_supported:D(g()).optional(),userinfo_encryption_enc_values_supported:D(g()).optional(),request_object_signing_alg_values_supported:D(g()).optional(),request_object_encryption_alg_values_supported:D(g()).optional(),request_object_encryption_enc_values_supported:D(g()).optional(),token_endpoint_auth_methods_supported:D(g()).optional(),token_endpoint_auth_signing_alg_values_supported:D(g()).optional(),display_values_supported:D(g()).optional(),claim_types_supported:D(g()).optional(),claims_supported:D(g()).optional(),service_documentation:g().optional(),claims_locales_supported:D(g()).optional(),ui_locales_supported:D(g()).optional(),claims_parameter_supported:O().optional(),request_parameter_supported:O().optional(),request_uri_parameter_supported:O().optional(),require_request_uri_registration:O().optional(),op_policy_uri:q.optional(),op_tos_uri:q.optional(),client_id_metadata_document_supported:O().optional(),authorization_response_iss_parameter_supported:O().optional().catch(void 0)}),Vr=S({...Br.shape,...zr.pick({code_challenge_methods_supported:!0}).shape}),Hr=S({access_token:g(),id_token:g().optional(),token_type:g(),expires_in:he().optional(),scope:g().optional(),refresh_token:g().optional(),issuer:g().optional().catch(void 0)}).strip(),Ur=S({issued_token_type:k(`urn:ietf:params:oauth:token-type:id-jag`),access_token:g(),token_type:g().optional(),expires_in:j().optional(),scope:g().optional()}).strip(),Wr=S({error:g(),error_description:g().optional(),error_uri:g().optional()}),Gr=q.optional().or(k(``).transform(()=>void 0)),Kr=S({redirect_uris:D(q),token_endpoint_auth_method:g().optional(),grant_types:D(g()).optional(),response_types:D(g()).optional(),application_type:g().optional(),client_name:g().optional(),client_uri:q.optional(),logo_uri:Gr,scope:g().optional(),contacts:D(g()).optional(),tos_uri:Gr,policy_uri:g().optional(),jwks_uri:q.optional(),jwks:te().optional(),software_id:g().optional(),software_version:g().optional(),software_statement:g().optional()}).strip(),qr=S({client_id:g(),client_secret:g().optional(),client_id_issued_at:j().optional(),client_secret_expires_at:j().optional(),issuer:g().optional().catch(void 0)}).strip(),Jr=Kr.merge(qr),Yr=S({error:g(),error_description:g().optional()}).strip(),Xr=S({token:g(),token_type_hint:g().optional()}).strip(),Zr=Symbol.for(`mcp.sdk.errorBrands`);function Qr(e,t){let n=new Set,r=t;for(;typeof r==`function`;){let e=r.mcpBrand;Object.prototype.hasOwnProperty.call(r,`mcpBrand`)&&typeof e==`string`&&n.add(e),r=Object.getPrototypeOf(r)}n.size!==0&&Object.defineProperty(e,Zr,{value:n,enumerable:!1,configurable:!0})}function $r(e,t){try{if(typeof t==`object`&&t&&Object.prototype.hasOwnProperty.call(e,`mcpBrand`)&&typeof e.mcpBrand==`string`&&Object.prototype.hasOwnProperty.call(t,Zr)){let n=t[Zr];if(n&&typeof n.has==`function`&&n.has(e.mcpBrand))return!0}}catch{}return Function.prototype[Symbol.hasInstance].call(e,t)}var ei=function(e){return e.InvalidRequest=`invalid_request`,e.InvalidClient=`invalid_client`,e.InvalidGrant=`invalid_grant`,e.UnauthorizedClient=`unauthorized_client`,e.UnsupportedGrantType=`unsupported_grant_type`,e.InvalidScope=`invalid_scope`,e.AccessDenied=`access_denied`,e.ServerError=`server_error`,e.TemporarilyUnavailable=`temporarily_unavailable`,e.UnsupportedResponseType=`unsupported_response_type`,e.UnsupportedTokenType=`unsupported_token_type`,e.InvalidToken=`invalid_token`,e.MethodNotAllowed=`method_not_allowed`,e.TooManyRequests=`too_many_requests`,e.InvalidClientMetadata=`invalid_client_metadata`,e.InvalidRedirectUri=`invalid_redirect_uri`,e.InsufficientScope=`insufficient_scope`,e.InvalidTarget=`invalid_target`,e.InvalidDpopProof=`invalid_dpop_proof`,e.UseDpopNonce=`use_dpop_nonce`,e}({}),ti=class e extends Error{static{Object.defineProperty(this,"mcpBrand",{value:`mcp.OAuthError`})}static[Symbol.hasInstance](e){return $r(this,e)}static isInstance(e){if(typeof this!=`function`)throw TypeError("isInstance must be called on the class (e.g. `SdkError.isInstance(value)`); for callbacks use `v => SdkError.isInstance(v)`");return $r(this,e)}constructor(e,t,n){super(t),this.code=e,this.errorUri=n,this.name=`OAuthError`,Qr(this,new.target)}toResponseObject(){let e={error:this.code,error_description:this.message};return this.errorUri&&(e.error_uri=this.errorUri),e}static fromResponse(t){return new e(t.error,t.error_description??t.error,t.error_uri)}},J=function(e){return e.NotConnected=`NOT_CONNECTED`,e.AlreadyConnected=`ALREADY_CONNECTED`,e.NotInitialized=`NOT_INITIALIZED`,e.CapabilityNotSupported=`CAPABILITY_NOT_SUPPORTED`,e.RequestTimeout=`REQUEST_TIMEOUT`,e.ConnectionClosed=`CONNECTION_CLOSED`,e.SendFailed=`SEND_FAILED`,e.InvalidResult=`INVALID_RESULT`,e.UnsupportedResultType=`UNSUPPORTED_RESULT_TYPE`,e.InputRequiredRoundsExceeded=`INPUT_REQUIRED_ROUNDS_EXCEEDED`,e.ListPaginationExceeded=`LIST_PAGINATION_EXCEEDED`,e.MethodNotSupportedByProtocolVersion=`METHOD_NOT_SUPPORTED_BY_PROTOCOL_VERSION`,e.EraNegotiationFailed=`ERA_NEGOTIATION_FAILED`,e.ClientHttpNotImplemented=`CLIENT_HTTP_NOT_IMPLEMENTED`,e.ClientHttpAuthentication=`CLIENT_HTTP_AUTHENTICATION`,e.ClientHttpForbidden=`CLIENT_HTTP_FORBIDDEN`,e.ClientHttpUnexpectedContent=`CLIENT_HTTP_UNEXPECTED_CONTENT`,e.ClientHttpFailedToOpenStream=`CLIENT_HTTP_FAILED_TO_OPEN_STREAM`,e.ClientHttpFailedToTerminateSession=`CLIENT_HTTP_FAILED_TO_TERMINATE_SESSION`,e}({}),Y=class extends Error{static{Object.defineProperty(this,"mcpBrand",{value:`mcp.SdkError`})}static[Symbol.hasInstance](e){return $r(this,e)}static isInstance(e){if(typeof this!=`function`)throw TypeError("isInstance must be called on the class (e.g. `SdkError.isInstance(value)`); for callbacks use `v => SdkError.isInstance(v)`");return $r(this,e)}constructor(e,t,n,r){super(t,r),this.code=e,this.data=n,this.name=`SdkError`,Qr(this,new.target)}},ni=class extends Y{static{Object.defineProperty(this,"mcpBrand",{value:`mcp.SdkHttpError`})}constructor(e,t,n,r){super(e,t,n,r),this.name=`SdkHttpError`}get status(){return this.data.status}get statusText(){return this.data.statusText}};function ri(e){let t=typeof e==`string`?new URL(e):new URL(e.href);return t.hash=``,t}function ii(e){if(typeof e!=`object`||!e||Array.isArray(e))return e;let t={...e};return delete t.issuer,t}function ai({requestedResource:e,configuredResource:t}){let n=typeof e==`string`?new URL(e):new URL(e.href),r=typeof t==`string`?new URL(t):new URL(t.href);if(n.origin!==r.origin||n.pathname.length=oi}function li(e){return e.filter(e=>!ci(e))}function ui(e){return e.filter(e=>ci(e))}function di(e){let t=e.structuredContent;return t===void 0||typeof t==`object`&&t&&!Array.isArray(t)||(e.content?.some(e=>e.type===`text`)??!1)?e:{...e,content:[...e.content??[],{type:`text`,text:JSON.stringify(t)}]}}var fi=[`task`,`inputRequests`,`requestState`];function pi(e){return typeof e!=`object`||!e||Array.isArray(e)||e.content!==void 0||fi.some(t=>t in e)?e:{...e,content:[]}}function mi(){let e=ee(()=>h([g(),j(),O(),oe(),C(g(),e),D(e)])),t=C(g(),e),n=h([g(),j().int()]),r=g(),i=S({ttl:j().optional()}),a=S({taskId:g()}),o=M({progressToken:n.optional(),"io.modelcontextprotocol/related-task":a.optional()}),s=S({_meta:o.optional()}),c=s.extend({task:i.optional()}),l=S({method:g(),params:s.loose().optional()}),u=S({_meta:o.optional()}),d=S({method:g(),params:u.loose().optional()}),f=M({_meta:o.optional()}),p=h([g(),j().int()]),_=f.strict(),v=u.extend({requestId:p.optional(),reason:g().optional()}),y=d.extend({method:k(`notifications/cancelled`),params:v}),x=S({src:g(),mimeType:g().optional(),sizes:D(g()).optional(),theme:E([`light`,`dark`]).optional()}),w=S({icons:D(x).optional()}),T=S({name:g(),title:g().optional()}),te=T.extend({...T.shape,...w.shape,version:g(),websiteUrl:g().optional(),description:g().optional()}),re=ne(S({applyDefaults:O().optional()}),t),ie=A(e=>e&&typeof e==`object`&&!Array.isArray(e)&&Object.keys(e).length===0?{form:{}}:e,ne(S({form:re.optional(),url:t.optional()}),t.optional())),ae=M({list:t.optional(),cancel:t.optional(),requests:M({sampling:M({createMessage:t.optional()}).optional(),elicitation:M({create:t.optional()}).optional()}).optional()}),ce=M({list:t.optional(),cancel:t.optional(),requests:M({tools:M({call:t.optional()}).optional()}).optional()}),le=S({experimental:C(g(),t).optional(),sampling:S({context:t.optional(),tools:t.optional()}).optional(),elicitation:ie.optional(),roots:S({listChanged:O().optional()}).optional(),tasks:ae.optional(),extensions:C(g(),t).optional()}),ue=s.extend({protocolVersion:g(),capabilities:le,clientInfo:te}),de=l.extend({method:k(`initialize`),params:ue}),fe=S({experimental:C(g(),t).optional(),logging:t.optional(),completions:t.optional(),prompts:S({listChanged:O().optional()}).optional(),resources:S({subscribe:O().optional(),listChanged:O().optional()}).optional(),tools:S({listChanged:O().optional()}).optional(),tasks:ce.optional(),extensions:C(g(),t).optional()}),me=f.extend({protocolVersion:g(),capabilities:fe,serverInfo:te,instructions:g().optional()}),he=d.extend({method:k(`notifications/initialized`),params:u.optional()}),N=l.extend({method:k(`ping`),params:s.optional()}),P=S({progress:j(),total:m(j()),message:m(g())}),ge=S({...u.shape,...P.shape,progressToken:n}),_e=d.extend({method:k(`notifications/progress`),params:ge}),ve=s.extend({cursor:r.optional()}),ye=l.extend({params:ve.optional()}),be=f.extend({nextCursor:r.optional()}),F=S({uri:g(),mimeType:m(g()),_meta:C(g(),b()).optional()}),xe=F.extend({text:g()}),Se=g().refine(e=>{try{return atob(e),!0}catch{return!1}},{message:`Invalid Base64 string`}),Ce=F.extend({blob:Se}),we=E([`user`,`assistant`]),Te=S({audience:D(we).optional(),priority:j().min(0).max(1).optional(),lastModified:pe({offset:!0}).optional()}),Ee=S({...T.shape,...w.shape,uri:g(),description:m(g()),mimeType:m(g()),size:m(j()),annotations:Te.optional(),_meta:m(M({}))}),De=S({...T.shape,...w.shape,uriTemplate:g(),description:m(g()),mimeType:m(g()),annotations:Te.optional(),_meta:m(M({}))}),Oe=ye.extend({method:k(`resources/list`)}),ke=be.extend({resources:D(Ee)}),Ae=ye.extend({method:k(`resources/templates/list`)}),je=be.extend({resourceTemplates:D(De)}),Me=s.extend({uri:g()}),Ne=Me,Pe=l.extend({method:k(`resources/read`),params:Ne}),Fe=f.extend({contents:D(h([xe,Ce]))}),Ie=d.extend({method:k(`notifications/resources/list_changed`),params:u.optional()}),Le=Me,Re=l.extend({method:k(`resources/subscribe`),params:Le}),ze=Me,Be=l.extend({method:k(`resources/unsubscribe`),params:ze}),Ve=u.extend({uri:g()}),I=d.extend({method:k(`notifications/resources/updated`),params:Ve}),He=S({name:g(),description:m(g()),required:m(O())}),Ue=S({...T.shape,...w.shape,description:m(g()),arguments:m(D(He)),_meta:m(M({}))}),We=ye.extend({method:k(`prompts/list`)}),Ge=be.extend({prompts:D(Ue)}),Ke=s.extend({name:g(),arguments:C(g(),g()).optional()}),qe=l.extend({method:k(`prompts/get`),params:Ke}),L=S({type:k(`text`),text:g(),annotations:Te.optional(),_meta:C(g(),b()).optional()}),Je=S({type:k(`image`),data:Se,mimeType:g(),annotations:Te.optional(),_meta:C(g(),b()).optional()}),R=S({type:k(`audio`),data:Se,mimeType:g(),annotations:Te.optional(),_meta:C(g(),b()).optional()}),z=S({type:k(`tool_use`),name:g(),id:g(),input:C(g(),b()),_meta:C(g(),b()).optional()}),B=S({type:k(`resource`),resource:h([xe,Ce]),annotations:Te.optional(),_meta:C(g(),b()).optional()}),Ye=Ee.extend({type:k(`resource_link`)}),V=h([L,Je,R,Ye,B]),Xe=S({role:we,content:V}),Ze=f.extend({description:g().optional(),messages:D(Xe)}),Qe=d.extend({method:k(`notifications/prompts/list_changed`),params:u.optional()}),$e=S({title:g().optional(),readOnlyHint:O().optional(),destructiveHint:O().optional(),idempotentHint:O().optional(),openWorldHint:O().optional()}),et=S({taskSupport:E([`required`,`optional`,`forbidden`]).optional()}),tt=S({...T.shape,...w.shape,description:g().optional(),inputSchema:S({type:k(`object`),properties:C(g(),e).optional(),required:D(g()).optional()}).catchall(b()),outputSchema:S({type:k(`object`),properties:C(g(),e).optional(),required:D(g()).optional()}).catchall(b()).optional(),annotations:$e.optional(),execution:et.optional(),_meta:C(g(),b()).optional()}),nt=ye.extend({method:k(`tools/list`)}),rt=be.extend({tools:D(tt)}),it=f.extend({content:D(V),structuredContent:C(g(),b()).optional(),isError:O().optional()}),at=c.extend({name:g(),arguments:C(g(),b()).optional()}),ot=l.extend({method:k(`tools/call`),params:at}),st=d.extend({method:k(`notifications/tools/list_changed`),params:u.optional()}),ct=E([`debug`,`info`,`notice`,`warning`,`error`,`critical`,`alert`,`emergency`]),H=s.extend({level:ct}),lt=l.extend({method:k(`logging/setLevel`),params:H}),ut=u.extend({level:ct,logger:g().optional(),data:b()}),dt=d.extend({method:k(`notifications/message`),params:ut}),ft=S({name:g().optional()}),pt=S({hints:D(ft).optional(),costPriority:j().min(0).max(1).optional(),speedPriority:j().min(0).max(1).optional(),intelligencePriority:j().min(0).max(1).optional()}),mt=S({mode:E([`auto`,`required`,`none`]).optional()}),ht=S({type:k(`tool_result`),toolUseId:g().describe(`The unique identifier for the corresponding tool call.`),content:D(V),structuredContent:S({}).loose().optional(),isError:O().optional(),_meta:C(g(),b()).optional()}),gt=se(`type`,[L,Je,R]),_t=se(`type`,[L,Je,R,z,ht]),vt=S({role:we,content:h([_t,D(_t)]),_meta:C(g(),b()).optional()}),yt=c.extend({messages:D(vt),modelPreferences:pt.optional(),systemPrompt:g().optional(),includeContext:E([`none`,`thisServer`,`allServers`]).optional(),temperature:j().optional(),maxTokens:j().int(),stopSequences:D(g()).optional(),metadata:t.optional(),tools:D(tt).optional(),toolChoice:mt.optional()}),bt=l.extend({method:k(`sampling/createMessage`),params:yt}),xt=f.extend({model:g(),stopReason:m(E([`endTurn`,`stopSequence`,`maxTokens`]).or(g())),role:we,content:gt}),St=f.extend({model:g(),stopReason:m(E([`endTurn`,`stopSequence`,`maxTokens`,`toolUse`]).or(g())),role:we,content:h([_t,D(_t)])}),Ct=S({type:k(`boolean`),title:g().optional(),description:g().optional(),default:O().optional()}),wt=S({type:k(`string`),title:g().optional(),description:g().optional(),minLength:j().optional(),maxLength:j().optional(),format:E([`email`,`uri`,`date`,`date-time`]).optional(),default:g().optional()}),Tt=S({type:E([`number`,`integer`]),title:g().optional(),description:g().optional(),minimum:j().optional(),maximum:j().optional(),default:j().optional()}),Et=S({type:k(`string`),title:g().optional(),description:g().optional(),enum:D(g()),default:g().optional()}),Dt=S({type:k(`string`),title:g().optional(),description:g().optional(),oneOf:D(S({const:g(),title:g()})),default:g().optional()}),Ot=S({type:k(`string`),title:g().optional(),description:g().optional(),enum:D(g()),enumNames:D(g()).optional(),default:g().optional()}),kt=h([Et,Dt]),At=S({type:k(`array`),title:g().optional(),description:g().optional(),minItems:j().optional(),maxItems:j().optional(),items:S({type:k(`string`),enum:D(g())}),default:D(g()).optional()}),jt=S({type:k(`array`),title:g().optional(),description:g().optional(),minItems:j().optional(),maxItems:j().optional(),items:S({anyOf:D(S({const:g(),title:g()}))}),default:D(g()).optional()}),Mt=h([At,jt]),Nt=h([Ot,kt,Mt]),Pt=h([Nt,Ct,wt,Tt]),Ft=c.extend({mode:k(`form`).optional(),message:g(),requestedSchema:S({type:k(`object`),properties:C(g(),Pt),required:D(g()).optional()}).catchall(b())}),It=c.extend({mode:k(`url`),message:g(),elicitationId:g(),url:g().url()}),Lt=h([Ft,It]),U=l.extend({method:k(`elicitation/create`),params:Lt}),W=u.extend({elicitationId:g()}),Rt=d.extend({method:k(`notifications/elicitation/complete`),params:W}),zt=f.extend({action:E([`accept`,`decline`,`cancel`]),content:A(e=>e===null?void 0:e,C(g(),h([g(),j(),O(),D(g())])).optional())}),Bt=S({type:k(`ref/resource`),uri:g()}),Vt=S({type:k(`ref/prompt`),name:g()}),Ht=s.extend({ref:h([Vt,Bt]),argument:S({name:g(),value:g()}),context:S({arguments:C(g(),g()).optional()}).optional()}),Ut=l.extend({method:k(`completion/complete`),params:Ht}),Wt=f.extend({completion:M({values:D(g()).max(100),total:m(j().int()),hasMore:m(O())})}),Gt=S({uri:g().startsWith(`file://`),name:g().optional(),_meta:C(g(),b()).optional()}),Kt=l.extend({method:k(`roots/list`),params:s.optional()}),qt=f.extend({roots:D(Gt)}),Jt=d.extend({method:k(`notifications/roots/list_changed`),params:u.optional()}),Yt=M({ttl:j().optional(),pollInterval:j().optional()}),Xt=E([`working`,`input_required`,`completed`,`failed`,`cancelled`]),Zt=S({taskId:g(),status:Xt,ttl:h([j(),oe()]),createdAt:g(),lastUpdatedAt:g(),pollInterval:m(j()),statusMessage:m(g())}),Qt=f.extend({task:Zt}),$t=u.merge(Zt),en=d.extend({method:k(`notifications/tasks/status`),params:$t}),tn=l.extend({method:k(`tasks/get`),params:s.extend({taskId:g()})}),G=f.merge(Zt),nn=l.extend({method:k(`tasks/result`),params:s.extend({taskId:g()})}),rn=f.loose(),an=ye.extend({method:k(`tasks/list`)}),on=be.extend({tasks:D(Zt)}),sn=l.extend({method:k(`tasks/cancel`),params:s.extend({taskId:g()})});return{JSONValueSchema:e,JSONObjectSchema:t,ProgressTokenSchema:n,CursorSchema:r,TaskMetadataSchema:i,RelatedTaskMetadataSchema:a,RequestMetaSchema:o,BaseRequestParamsSchema:s,TaskAugmentedRequestParamsSchema:c,RequestSchema:l,NotificationsParamsSchema:u,NotificationSchema:d,ResultSchema:f,RequestIdSchema:p,EmptyResultSchema:_,CancelledNotificationParamsSchema:v,CancelledNotificationSchema:y,IconSchema:x,IconsSchema:w,BaseMetadataSchema:T,ImplementationSchema:te,ClientTasksCapabilitySchema:ae,ServerTasksCapabilitySchema:ce,ClientCapabilitiesSchema:le,InitializeRequestParamsSchema:ue,InitializeRequestSchema:de,ServerCapabilitiesSchema:fe,InitializeResultSchema:me,InitializedNotificationSchema:he,PingRequestSchema:N,ProgressSchema:P,ProgressNotificationParamsSchema:ge,ProgressNotificationSchema:_e,PaginatedRequestParamsSchema:ve,PaginatedRequestSchema:ye,PaginatedResultSchema:be,ResourceContentsSchema:F,TextResourceContentsSchema:xe,BlobResourceContentsSchema:Ce,RoleSchema:we,AnnotationsSchema:Te,ResourceSchema:Ee,ResourceTemplateSchema:De,ListResourcesRequestSchema:Oe,ListResourcesResultSchema:ke,ListResourceTemplatesRequestSchema:Ae,ListResourceTemplatesResultSchema:je,ResourceRequestParamsSchema:Me,ReadResourceRequestParamsSchema:Ne,ReadResourceRequestSchema:Pe,ReadResourceResultSchema:Fe,ResourceListChangedNotificationSchema:Ie,SubscribeRequestParamsSchema:Le,SubscribeRequestSchema:Re,UnsubscribeRequestParamsSchema:ze,UnsubscribeRequestSchema:Be,ResourceUpdatedNotificationParamsSchema:Ve,ResourceUpdatedNotificationSchema:I,PromptArgumentSchema:He,PromptSchema:Ue,ListPromptsRequestSchema:We,ListPromptsResultSchema:Ge,GetPromptRequestParamsSchema:Ke,GetPromptRequestSchema:qe,TextContentSchema:L,ImageContentSchema:Je,AudioContentSchema:R,ToolUseContentSchema:z,EmbeddedResourceSchema:B,ResourceLinkSchema:Ye,ContentBlockSchema:V,PromptMessageSchema:Xe,GetPromptResultSchema:Ze,PromptListChangedNotificationSchema:Qe,ToolAnnotationsSchema:$e,ToolExecutionSchema:et,ToolSchema:tt,ListToolsRequestSchema:nt,ListToolsResultSchema:rt,CallToolResultSchema:it,CallToolRequestParamsSchema:at,CallToolRequestSchema:ot,ToolListChangedNotificationSchema:st,LoggingLevelSchema:ct,SetLevelRequestParamsSchema:H,SetLevelRequestSchema:lt,LoggingMessageNotificationParamsSchema:ut,LoggingMessageNotificationSchema:dt,ModelHintSchema:ft,ModelPreferencesSchema:pt,ToolChoiceSchema:mt,ToolResultContentSchema:ht,SamplingContentSchema:gt,SamplingMessageContentBlockSchema:_t,SamplingMessageSchema:vt,CreateMessageRequestParamsSchema:yt,CreateMessageRequestSchema:bt,CreateMessageResultSchema:xt,CreateMessageResultWithToolsSchema:St,BooleanSchemaSchema:Ct,StringSchemaSchema:wt,NumberSchemaSchema:Tt,UntitledSingleSelectEnumSchemaSchema:Et,TitledSingleSelectEnumSchemaSchema:Dt,LegacyTitledEnumSchemaSchema:Ot,SingleSelectEnumSchemaSchema:kt,UntitledMultiSelectEnumSchemaSchema:At,TitledMultiSelectEnumSchemaSchema:jt,MultiSelectEnumSchemaSchema:Mt,EnumSchemaSchema:Nt,PrimitiveSchemaDefinitionSchema:Pt,ElicitRequestFormParamsSchema:Ft,ElicitRequestURLParamsSchema:It,ElicitRequestParamsSchema:Lt,ElicitRequestSchema:U,ElicitationCompleteNotificationParamsSchema:W,ElicitationCompleteNotificationSchema:Rt,ElicitResultSchema:zt,ResourceTemplateReferenceSchema:Bt,PromptReferenceSchema:Vt,CompleteRequestParamsSchema:Ht,CompleteRequestSchema:Ut,CompleteResultSchema:Wt,RootSchema:Gt,ListRootsRequestSchema:Kt,ListRootsResultSchema:qt,RootsListChangedNotificationSchema:Jt,TaskCreationParamsSchema:Yt,TaskStatusSchema:Xt,TaskSchema:Zt,CreateTaskResultSchema:Qt,TaskStatusNotificationParamsSchema:$t,TaskStatusNotificationSchema:en,GetTaskRequestSchema:tn,GetTaskResultSchema:G,GetTaskPayloadRequestSchema:nn,GetTaskPayloadResultSchema:rn,ListTasksRequestSchema:an,ListTasksResultSchema:on,CancelTaskRequestSchema:sn,CancelTaskResultSchema:f.merge(Zt),ClientRequestSchema:h([N,de,Ut,lt,qe,We,Oe,Ae,Pe,Re,Be,ot,nt,tn,nn,an,sn]),ClientNotificationSchema:h([y,_e,he,Jt,en]),ClientResultSchema:h([_,xt,St,zt,qt,G,on,Qt]),ServerRequestSchema:h([N,bt,U,Kt,tn,nn,an,sn]),ServerNotificationSchema:h([y,_e,dt,I,Ie,st,Qe,en,Rt]),ServerResultSchema:h([_,me,Wt,Ze,Ge,ke,je,Fe,it,rt,G,on,Qt]),CallToolResultWireSchema:b().superRefine((e,t)=>{if(typeof e==`object`&&e&&!Array.isArray(e)&&e.content===void 0){for(let n of fi)if(n in e){t.addIssue({code:`custom`,message:`content is required when the body carries '${n}' — another result family cannot default into an empty tools/call success`});return}}}).transform(pi).pipe(it)}}var hi;function gi(){return hi??=mi()}function _i(e){return e.type!==`object`}var vi=new Set([`const`,`enum`,`default`,`examples`]),yi=new Set([`properties`,`patternProperties`,`$defs`,`definitions`,`dependentSchemas`,`dependencies`]);function bi(e){return e!==void 0&&!(typeof e==`string`&&e.startsWith(`#`))}function xi(e){let t=typeof e.$schema==`string`?e.$schema:void 0;if(bi(e.$id))return{...t!==void 0&&{$schema:t},type:`object`,properties:{result:e},required:[`result`]};let n=Ae(e.$schema)&&e.$recursiveAnchor!==!0,r=(e,t)=>{if(Array.isArray(e))return e.map(e=>r(e,!1));if(typeof e!=`object`||!e||!t&&bi(e.$id))return e;let i={},a=!1;for(let[o,s]of Object.entries(e))t?i[o]=r(s,!1):(o===`$ref`||o===`$dynamicRef`)&&typeof s==`string`?i[o]=s===`#`?`#/properties/result`:s.startsWith(`#/`)?`#/properties/result${s.slice(1)}`:s:o===`$recursiveRef`&&s===`#`&&n?a=!0:i[o]=vi.has(o)?s:yi.has(o)?r(s,!0):r(s,!1);return a&&(`$ref`in i?i.allOf=[...Array.isArray(i.allOf)?i.allOf:[],{$ref:`#/properties/result`}]:i.$ref=`#/properties/result`),i};return{...t!==void 0&&{$schema:t},type:`object`,properties:{result:r(e,!1)},required:[`result`]}}var Si={ping:null,initialize:null,"completion/complete":null,"logging/setLevel":null,"prompts/get":null,"prompts/list":null,"resources/list":null,"resources/templates/list":null,"resources/read":null,"resources/subscribe":null,"resources/unsubscribe":null,"tools/call":null,"tools/list":null,"tasks/get":null,"tasks/result":null,"tasks/list":null,"tasks/cancel":null,"sampling/createMessage":null,"elicitation/create":null,"roots/list":null},Ci={"notifications/cancelled":null,"notifications/progress":null,"notifications/initialized":null,"notifications/roots/list_changed":null,"notifications/tasks/status":null,"notifications/message":null,"notifications/resources/updated":null,"notifications/resources/list_changed":null,"notifications/tools/list_changed":null,"notifications/prompts/list_changed":null,"notifications/elicitation/complete":null},wi={ping:null,initialize:null,"completion/complete":null,"logging/setLevel":null,"prompts/get":null,"prompts/list":null,"resources/list":null,"resources/templates/list":null,"resources/read":null,"resources/subscribe":null,"resources/unsubscribe":null,"tools/call":null,"tools/list":null,"sampling/createMessage":null,"elicitation/create":null,"roots/list":null},Ti;function Ei(){if(Ti)return Ti;let e=gi();return Ti={requestSchemas:{ping:e.PingRequestSchema,initialize:e.InitializeRequestSchema,"completion/complete":e.CompleteRequestSchema,"logging/setLevel":e.SetLevelRequestSchema,"prompts/get":e.GetPromptRequestSchema,"prompts/list":e.ListPromptsRequestSchema,"resources/list":e.ListResourcesRequestSchema,"resources/templates/list":e.ListResourceTemplatesRequestSchema,"resources/read":e.ReadResourceRequestSchema,"resources/subscribe":e.SubscribeRequestSchema,"resources/unsubscribe":e.UnsubscribeRequestSchema,"tools/call":e.CallToolRequestSchema,"tools/list":e.ListToolsRequestSchema,"tasks/get":e.GetTaskRequestSchema,"tasks/result":e.GetTaskPayloadRequestSchema,"tasks/list":e.ListTasksRequestSchema,"tasks/cancel":e.CancelTaskRequestSchema,"sampling/createMessage":e.CreateMessageRequestSchema,"elicitation/create":e.ElicitRequestSchema,"roots/list":e.ListRootsRequestSchema},notificationSchemas:{"notifications/cancelled":e.CancelledNotificationSchema,"notifications/progress":e.ProgressNotificationSchema,"notifications/initialized":e.InitializedNotificationSchema,"notifications/roots/list_changed":e.RootsListChangedNotificationSchema,"notifications/tasks/status":e.TaskStatusNotificationSchema,"notifications/message":e.LoggingMessageNotificationSchema,"notifications/resources/updated":e.ResourceUpdatedNotificationSchema,"notifications/resources/list_changed":e.ResourceListChangedNotificationSchema,"notifications/tools/list_changed":e.ToolListChangedNotificationSchema,"notifications/prompts/list_changed":e.PromptListChangedNotificationSchema,"notifications/elicitation/complete":e.ElicitationCompleteNotificationSchema},resultSchemas:{ping:e.EmptyResultSchema,initialize:e.InitializeResultSchema,"completion/complete":e.CompleteResultSchema,"logging/setLevel":e.EmptyResultSchema,"prompts/get":e.GetPromptResultSchema,"prompts/list":e.ListPromptsResultSchema,"resources/list":e.ListResourcesResultSchema,"resources/templates/list":e.ListResourceTemplatesResultSchema,"resources/read":e.ReadResourceResultSchema,"resources/subscribe":e.EmptyResultSchema,"resources/unsubscribe":e.EmptyResultSchema,"tools/call":e.CallToolResultWireSchema,"tools/list":e.ListToolsResultSchema,"sampling/createMessage":e.CreateMessageResultWithToolsSchema,"elicitation/create":e.ElicitResultSchema,"roots/list":e.ListRootsResultSchema}},Ti}function Di(e){return Object.prototype.hasOwnProperty.call(Si,e)}function Oi(e){return Object.prototype.hasOwnProperty.call(Ci,e)}function ki(e){return Object.prototype.hasOwnProperty.call(wi,e)}function Ai(e){return ki(e)?Ei().resultSchemas[e]:void 0}function ji(e){return Di(e)?Ei().requestSchemas[e]:void 0}function Mi(e){return Oi(e)?Ei().notificationSchemas[e]:void 0}Object.keys(Si),Object.keys(Ci);function Ni(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function Pi(e,t){if(e===void 0)return{ok:!1,reason:`not-in-era`};let n=e.safeParse(t);return n.success?{ok:!0,value:n.data}:{ok:!1,reason:`invalid`,message:String(n.error)}}var Fi={ok:!1,reason:`not-in-era`};function Ii(e){return Ni(e)&&Ni(e.outputSchema)&&_i(e.outputSchema)}function Li(e){return e}var Ri={era:`2025-11-25`,hasRequestMethod:Di,hasNotificationMethod:Oi,validateRequest:(e,t)=>Pi(ji(e),t),validateResult:(e,t)=>Pi(Ai(e),t),validateNotification:(e,t)=>Pi(Mi(e),t),hasInputRequestMethod:()=>!1,validateInputRequest:()=>Fi,validateInputResponse:()=>Fi,samplingResultVariant:((e,t)=>{let n=gi();return Pi(e?n.CreateMessageResultWithToolsSchema:n.CreateMessageResultSchema,t)}),outboundEnvelope:e=>void 0,validateEnvelopeMeta:e=>[],projectCallToolResult(e,t){let n=di(e),r=n.structuredContent;if(r===void 0)return n;let i=typeof r!=`object`||!r||Array.isArray(r),a=t!==void 0&&_i(t);return!i&&!a?n:{...n,structuredContent:{result:r}}},decodeResult(e,t){if(Ni(t)&&`resultType`in t){let e={...t};return delete e.resultType,{kind:`complete`,result:Li(e)}}return{kind:`complete`,result:Li(t)}},encodeResult(e,t){if(e!==`tools/list`)return t;let n=t.tools;return!Array.isArray(n)||!n.some(e=>Ii(e))?t:{...t,tools:n.map(e=>Ii(e)?{...e,outputSchema:xi(e.outputSchema)}:e)}},encodeErrorCode:e=>e===-32002?-32602:e,checkInboundEnvelope:e=>void 0};function zi(){let e=ee(()=>h([g(),j(),O(),oe(),C(g(),e),D(e)])),t=C(g(),e),n=h([g(),j().int()]),r=g(),i=h([g(),j().int()]),a=E([`user`,`assistant`]),o=E([`debug`,`info`,`notice`,`warning`,`error`,`critical`,`alert`,`emergency`]),s=g().refine(e=>{try{return atob(e),!0}catch{return!1}},{message:`Invalid Base64 string`}),c=S({ttl:j().optional()}),l=S({taskId:g()}),u=M({progressToken:n.optional(),"io.modelcontextprotocol/related-task":l.optional()}),d=S({_meta:u.optional()}),f=d.extend({task:c.optional()}),p=S({_meta:u.optional()}),_=S({method:g(),params:p.loose().optional()}),v=S({src:g(),mimeType:g().optional(),sizes:D(g()).optional(),theme:E([`light`,`dark`]).optional()}),y=S({icons:D(v).optional()}),x=S({name:g(),title:g().optional()}),w=x.extend({...x.shape,...y.shape,version:g(),websiteUrl:g().optional(),description:g().optional()}),T=ne(S({applyDefaults:O().optional()}),t),te=A(e=>e&&typeof e==`object`&&!Array.isArray(e)&&Object.keys(e).length===0?{form:{}}:e,ne(S({form:T.optional(),url:t.optional()}),t.optional())),re=M({list:t.optional(),cancel:t.optional(),requests:M({sampling:M({createMessage:t.optional()}).optional(),elicitation:M({create:t.optional()}).optional()}).optional()}),ie=M({list:t.optional(),cancel:t.optional(),requests:M({tools:M({call:t.optional()}).optional()}).optional()}),ae=S({experimental:C(g(),t).optional(),sampling:S({context:t.optional(),tools:t.optional()}).optional(),elicitation:te.optional(),roots:S({listChanged:O().optional()}).optional(),tasks:re.optional(),extensions:C(g(),t).optional()}),se=S({experimental:C(g(),t).optional(),logging:t.optional(),completions:t.optional(),prompts:S({listChanged:O().optional()}).optional(),resources:S({subscribe:O().optional(),listChanged:O().optional()}).optional(),tools:S({listChanged:O().optional()}).optional(),tasks:ie.optional(),extensions:C(g(),t).optional()}),ce=S({progress:j(),total:m(j()),message:m(g())}),le=S({...p.shape,...ce.shape,progressToken:n}),ue=_.extend({method:k(`notifications/progress`),params:le}),de=p.extend({level:o,logger:g().optional(),data:b()}),fe=_.extend({method:k(`notifications/message`),params:de}),me=S({uri:g(),mimeType:m(g()),_meta:C(g(),b()).optional()}),he=me.extend({text:g()}),N=me.extend({blob:s}),P=S({audience:D(a).optional(),priority:j().min(0).max(1).optional(),lastModified:pe({offset:!0}).optional()}),ge=S({...x.shape,...y.shape,uri:g(),description:m(g()),mimeType:m(g()),size:m(j()),annotations:P.optional(),_meta:m(M({}))}),_e=S({...x.shape,...y.shape,uriTemplate:g(),description:m(g()),mimeType:m(g()),annotations:P.optional(),_meta:m(M({}))}),ve=_.extend({method:k(`notifications/resources/list_changed`),params:p.optional()}),ye=p.extend({uri:g()}),be=_.extend({method:k(`notifications/resources/updated`),params:ye}),F=S({name:g(),description:m(g()),required:m(O())}),xe=S({...x.shape,...y.shape,description:m(g()),arguments:m(D(F)),_meta:m(M({}))}),Se=_.extend({method:k(`notifications/prompts/list_changed`),params:p.optional()}),Ce=S({type:k(`text`),text:g(),annotations:P.optional(),_meta:C(g(),b()).optional()}),we=S({type:k(`image`),data:s,mimeType:g(),annotations:P.optional(),_meta:C(g(),b()).optional()}),Te=S({type:k(`audio`),data:s,mimeType:g(),annotations:P.optional(),_meta:C(g(),b()).optional()}),Ee=S({type:k(`tool_use`),name:g(),id:g(),input:C(g(),b()),_meta:C(g(),b()).optional()}),De=S({type:k(`resource`),resource:h([he,N]),annotations:P.optional(),_meta:C(g(),b()).optional()}),Oe=ge.extend({type:k(`resource_link`)}),ke=h([Ce,we,Te,Oe,De]),Ae=S({role:a,content:ke}),je=S({title:g().optional(),readOnlyHint:O().optional(),destructiveHint:O().optional(),idempotentHint:O().optional(),openWorldHint:O().optional()}),Me=_.extend({method:k(`notifications/tools/list_changed`),params:p.optional()}),Ne=S({name:g().optional()}),Pe=S({hints:D(Ne).optional(),costPriority:j().min(0).max(1).optional(),speedPriority:j().min(0).max(1).optional(),intelligencePriority:j().min(0).max(1).optional()}),ze=S({mode:E([`auto`,`required`,`none`]).optional()}),Ve=S({type:k(`boolean`),title:g().optional(),description:g().optional(),default:O().optional()}),I=S({type:k(`string`),title:g().optional(),description:g().optional(),minLength:j().optional(),maxLength:j().optional(),format:E([`email`,`uri`,`date`,`date-time`]).optional(),default:g().optional()}),He=S({type:E([`number`,`integer`]),title:g().optional(),description:g().optional(),minimum:j().optional(),maximum:j().optional(),default:j().optional()}),Ue=S({type:k(`string`),title:g().optional(),description:g().optional(),enum:D(g()),default:g().optional()}),We=S({type:k(`string`),title:g().optional(),description:g().optional(),oneOf:D(S({const:g(),title:g()})),default:g().optional()}),Ge=S({type:k(`string`),title:g().optional(),description:g().optional(),enum:D(g()),enumNames:D(g()).optional(),default:g().optional()}),Ke=h([Ue,We]),qe=S({type:k(`array`),title:g().optional(),description:g().optional(),minItems:j().optional(),maxItems:j().optional(),items:S({type:k(`string`),enum:D(g())}),default:D(g()).optional()}),L=S({type:k(`array`),title:g().optional(),description:g().optional(),minItems:j().optional(),maxItems:j().optional(),items:S({anyOf:D(S({const:g(),title:g()}))}),default:D(g()).optional()}),Je=h([qe,L]),R=h([Ge,Ke,Je]),z=h([R,Ve,I,He]),B=f.extend({mode:k(`form`).optional(),message:g(),requestedSchema:S({type:k(`object`),properties:C(g(),z),required:D(g()).optional()}).catchall(b())}),Ye=S({type:k(`ref/resource`),uri:g()}),V=S({type:k(`ref/prompt`),name:g()}),Xe=S({uri:g().startsWith(`file://`),name:g().optional(),_meta:C(g(),b()).optional()}),Ze=ae.shape,Qe=S({experimental:Ze.experimental,sampling:Ze.sampling,elicitation:Ze.elicitation,roots:Ze.roots,extensions:Ze.extensions}),$e=se.shape,et=S({experimental:$e.experimental,logging:$e.logging,completions:$e.completions,prompts:$e.prompts,resources:$e.resources,tools:$e.tools,extensions:$e.extensions}),tt=M({progressToken:n.optional(),[Fe]:g(),[Ie]:w.optional(),[Re]:Qe,[Be]:o.optional()}),nt=S({...x.shape,...y.shape,description:g().optional(),inputSchema:M({$schema:g().optional(),type:k(`object`)}),outputSchema:M({$schema:g().optional()}).optional(),annotations:je.optional(),_meta:C(g(),b()).optional()}),rt=S({type:k(`tool_result`),toolUseId:g(),content:D(ke),structuredContent:b().optional(),isError:O().optional(),_meta:C(g(),b()).optional()}),it=h([Ce,we,Te,Ee,rt]),at=S({role:a,content:h([it,D(it)]),_meta:C(g(),b()).optional()}),ot=g(),st=M({[Le]:w.optional().catch(void 0)}),ct=st.optional();function H(e){return M({_meta:ct,resultType:ot.default(`complete`),...e})}let lt=H({}),ut=H({nextCursor:r.optional()}),dt=H({content:D(ke),structuredContent:b().optional(),isError:O().optional()}),ft=H({ttlMs:j().int().min(0),cacheScope:E([`public`,`private`]),tools:D(nt),nextCursor:r.optional()}),pt=H({ttlMs:j().int().min(0),cacheScope:E([`public`,`private`]),prompts:D(xe),nextCursor:r.optional()}),mt=H({description:g().optional(),messages:D(Ae)}),ht=H({ttlMs:j().int().min(0),cacheScope:E([`public`,`private`]),resources:D(ge),nextCursor:r.optional()}),gt=H({ttlMs:j().int().min(0),cacheScope:E([`public`,`private`]),resourceTemplates:D(_e),nextCursor:r.optional()}),_t=H({ttlMs:j().int().min(0),cacheScope:E([`public`,`private`]),contents:D(h([he,N]))}),vt=H({completion:S({values:D(g()).max(100),total:j().int().optional(),hasMore:O().optional()}).loose()}),yt=H({ttlMs:j().int().min(0),cacheScope:E([`public`,`private`])}),bt=H({ttlMs:j().int().min(0).catch(0),cacheScope:E([`public`,`private`]).catch(`private`),supportedVersions:D(g()),capabilities:et,instructions:g().optional()}),xt=S({messages:D(at),modelPreferences:Pe.optional(),systemPrompt:g().optional(),includeContext:E([`none`,`thisServer`,`allServers`]).optional(),temperature:j().optional(),maxTokens:j().int(),stopSequences:D(g()).optional(),metadata:t.optional(),tools:D(nt).optional(),toolChoice:ze.optional()}),St=S({method:k(`sampling/createMessage`),params:xt}),Ct=S({method:k(`roots/list`),params:S({_meta:C(g(),b()).optional()}).optional()}),wt=S({...at.shape,model:g(),stopReason:g().optional()}),Tt=S({roots:D(Xe)}),Et=S({action:E([`accept`,`decline`,`cancel`]),content:C(g(),h([g(),j(),O(),D(g())])).optional()}),Dt=S({mode:k(`url`),message:g(),url:g().url()}),Ot=h([B,Dt]),kt=S({method:k(`elicitation/create`),params:Ot}),At=h([St,Ct,kt]),jt=h([wt,Tt,Et]),Mt=C(g(),At),Nt=C(g(),jt),Pt=H({inputRequests:Mt.optional(),requestState:g().optional()}),Ft={inputResponses:Nt.optional(),requestState:g().optional()},It=S({_meta:tt,...Ft}),Lt=M({progressToken:n.optional()});function U(e,t){return S({method:k(e),params:S({_meta:tt,...t})})}function W(e,t){return S({method:k(e),params:S({_meta:Lt.optional(),...t}).optional()})}let Rt={name:g(),arguments:C(g(),b()).optional(),...Ft},zt={cursor:r.optional()},Bt=U(`tools/call`,Rt),Vt=U(`tools/list`,zt),Ht=U(`prompts/list`,zt),Ut=U(`prompts/get`,{name:g(),arguments:C(g(),g()).optional(),...Ft}),Wt=U(`resources/list`,zt),Gt=U(`resources/templates/list`,zt),Kt=U(`resources/read`,{uri:g(),...Ft}),qt={ref:h([V,Ye]),argument:S({name:g(),value:g()}),context:S({arguments:C(g(),g()).optional()}).optional()},Jt=U(`completion/complete`,qt),Yt=U(`server/discover`,{}),Xt=S({toolsListChanged:O().optional(),promptsListChanged:O().optional(),resourcesListChanged:O().optional(),resourceSubscriptions:D(g()).optional()}),Zt={notifications:Xt},Qt=U(`subscriptions/listen`,Zt),$t=st.extend({"io.modelcontextprotocol/subscriptionId":i}),en=M({_meta:$t,resultType:ot.default(`complete`)}),tn={"tools/call":W(`tools/call`,Rt),"tools/list":W(`tools/list`,zt),"prompts/get":W(`prompts/get`,{name:g(),arguments:C(g(),g()).optional()}),"prompts/list":W(`prompts/list`,zt),"resources/list":W(`resources/list`,zt),"resources/templates/list":W(`resources/templates/list`,zt),"resources/read":W(`resources/read`,{uri:g()}),"completion/complete":W(`completion/complete`,qt),"server/discover":W(`server/discover`,{}),"subscriptions/listen":W(`subscriptions/listen`,Zt)};function G(e){return M({_meta:ct,...e})}let nn={"tools/call":G({content:D(ke),structuredContent:b().optional(),isError:O().optional()}),"tools/list":G({ttlMs:j().int().min(0),cacheScope:E([`public`,`private`]),tools:D(nt),nextCursor:r.optional()}),"prompts/get":G({description:g().optional(),messages:D(Ae)}),"prompts/list":G({ttlMs:j().int().min(0),cacheScope:E([`public`,`private`]),prompts:D(xe),nextCursor:r.optional()}),"resources/list":G({ttlMs:j().int().min(0),cacheScope:E([`public`,`private`]),resources:D(ge),nextCursor:r.optional()}),"resources/templates/list":G({ttlMs:j().int().min(0),cacheScope:E([`public`,`private`]),resourceTemplates:D(_e),nextCursor:r.optional()}),"resources/read":G({ttlMs:j().int().min(0),cacheScope:E([`public`,`private`]),contents:D(h([he,N]))}),"completion/complete":G({completion:S({values:D(g()).max(100),total:j().int().optional(),hasMore:O().optional()}).loose()}),"server/discover":G({ttlMs:j().int().min(0).catch(0),cacheScope:E([`public`,`private`]).catch(`private`),supportedVersions:D(g()),capabilities:et,instructions:g().optional()}),"subscriptions/listen":G({})},rn=M({"io.modelcontextprotocol/subscriptionId":i.optional()}),an=S({method:k(`notifications/subscriptions/acknowledged`),params:S({_meta:rn.optional(),notifications:Xt})}),on=S({_meta:rn.optional(),requestId:i,reason:g().optional()}),sn=S({method:k(`notifications/cancelled`),params:on}),cn={"notifications/cancelled":sn,"notifications/progress":ue,"notifications/message":fe,"notifications/resources/updated":be,"notifications/resources/list_changed":ve,"notifications/tools/list_changed":Me,"notifications/prompts/list_changed":Se,"notifications/subscriptions/acknowledged":an},K=e=>S({jsonrpc:k(`2.0`),id:h([g(),j().int()]),result:e}).strict();return{JSONValueSchema:e,JSONObjectSchema:t,ProgressTokenSchema:n,CursorSchema:r,RequestIdSchema:i,RoleSchema:a,LoggingLevelSchema:o,TaskMetadataSchema:c,RelatedTaskMetadataSchema:l,RequestMetaSchema:u,BaseRequestParamsSchema:d,TaskAugmentedRequestParamsSchema:f,NotificationsParamsSchema:p,NotificationSchema:_,IconSchema:v,IconsSchema:y,BaseMetadataSchema:x,ImplementationSchema:w,ClientTasksCapabilitySchema:re,ServerTasksCapabilitySchema:ie,ClientCapabilitiesSchema:ae,ServerCapabilitiesSchema:se,ProgressSchema:ce,ProgressNotificationParamsSchema:le,ProgressNotificationSchema:ue,LoggingMessageNotificationParamsSchema:de,LoggingMessageNotificationSchema:fe,ResourceContentsSchema:me,TextResourceContentsSchema:he,BlobResourceContentsSchema:N,AnnotationsSchema:P,ResourceSchema:ge,ResourceTemplateSchema:_e,ResourceListChangedNotificationSchema:ve,ResourceUpdatedNotificationParamsSchema:ye,ResourceUpdatedNotificationSchema:be,PromptArgumentSchema:F,PromptSchema:xe,PromptListChangedNotificationSchema:Se,TextContentSchema:Ce,ImageContentSchema:we,AudioContentSchema:Te,ToolUseContentSchema:Ee,EmbeddedResourceSchema:De,ResourceLinkSchema:Oe,ContentBlockSchema:ke,PromptMessageSchema:Ae,ToolAnnotationsSchema:je,ToolListChangedNotificationSchema:Me,ModelHintSchema:Ne,ModelPreferencesSchema:Pe,ToolChoiceSchema:ze,BooleanSchemaSchema:Ve,StringSchemaSchema:I,NumberSchemaSchema:He,UntitledSingleSelectEnumSchemaSchema:Ue,TitledSingleSelectEnumSchemaSchema:We,LegacyTitledEnumSchemaSchema:Ge,SingleSelectEnumSchemaSchema:Ke,UntitledMultiSelectEnumSchemaSchema:qe,TitledMultiSelectEnumSchemaSchema:L,MultiSelectEnumSchemaSchema:Je,EnumSchemaSchema:R,PrimitiveSchemaDefinitionSchema:z,ElicitRequestFormParamsSchema:B,ResourceTemplateReferenceSchema:Ye,PromptReferenceSchema:V,RootSchema:Xe,ClientCapabilities2026Schema:Qe,ServerCapabilities2026Schema:et,RequestMetaEnvelopeSchema:tt,ToolSchema:nt,ToolResultContentSchema:rt,SamplingMessageContentBlockSchema:it,SamplingMessageSchema:at,ResultTypeSchema:ot,ResultMetaSchema:st,ResultSchema:lt,PaginatedResultSchema:ut,CallToolResultSchema:dt,ListToolsResultSchema:ft,ListPromptsResultSchema:pt,GetPromptResultSchema:mt,ListResourcesResultSchema:ht,ListResourceTemplatesResultSchema:gt,ReadResourceResultSchema:_t,CompleteResultSchema:vt,CacheableResultSchema:yt,DiscoverResultSchema:bt,CreateMessageRequestParamsSchema:xt,CreateMessageRequestSchema:St,ListRootsRequestSchema:Ct,CreateMessageResultSchema:wt,ListRootsResultSchema:Tt,ElicitResultSchema:Et,ElicitRequestURLParamsSchema:Dt,ElicitRequestParamsSchema:Ot,ElicitRequestSchema:kt,InputRequestSchema:At,InputResponseSchema:jt,InputRequestsSchema:Mt,InputResponsesSchema:Nt,InputRequiredResultSchema:Pt,InputResponseRequestParamsSchema:It,CallToolRequestSchema:Bt,ListToolsRequestSchema:Vt,ListPromptsRequestSchema:Ht,GetPromptRequestSchema:Ut,ListResourcesRequestSchema:Wt,ListResourceTemplatesRequestSchema:Gt,ReadResourceRequestSchema:Kt,CompleteRequestSchema:Jt,DiscoverRequestSchema:Yt,SubscriptionFilterSchema:Xt,SubscriptionsListenRequestSchema:Qt,SubscriptionsListenResultMetaSchema:$t,SubscriptionsListenResultSchema:en,dispatchRequestSchemas:tn,dispatchResultSchemas:nn,NotificationMetaSchema:rn,SubscriptionsAcknowledgedNotificationSchema:an,CancelledNotificationParamsSchema:on,CancelledNotificationSchema:sn,notificationSchemas2026:cn,JSONRPCResultResponseSchema:K(lt),CallToolResultResponseSchema:K(h([dt,Pt])),ListToolsResultResponseSchema:K(ft),ListPromptsResultResponseSchema:K(pt),GetPromptResultResponseSchema:K(h([mt,Pt])),ListResourcesResultResponseSchema:K(ht),ListResourceTemplatesResultResponseSchema:K(gt),ReadResourceResultResponseSchema:K(h([_t,Pt])),CompleteResultResponseSchema:K(vt),DiscoverResultResponseSchema:K(bt),SubscriptionsListenResultResponseSchema:K(en)}}var Bi;function Vi(){return Bi??=zi()}var Hi=[`tools/list`,`prompts/list`,`resources/list`,`resources/templates/list`,`resources/read`,`server/discover`];function Ui(e){return Hi.includes(e)}var Wi=Symbol(`modelcontextprotocol.resultCacheHintFallback`);function Gi(e){return e[Wi]}function Ki(e){return typeof e==`number`&&Number.isSafeInteger(e)&&e>=0}function qi(e){return e===`public`||e===`private`}var X=function(e){return e[e.ParseError=-32700]=`ParseError`,e[e.InvalidRequest=-32600]=`InvalidRequest`,e[e.MethodNotFound=-32601]=`MethodNotFound`,e[e.InvalidParams=-32602]=`InvalidParams`,e[e.InternalError=-32603]=`InternalError`,e[e.ResourceNotFound=-32002]=`ResourceNotFound`,e[e.MissingRequiredClientCapability=-32021]=`MissingRequiredClientCapability`,e[e.UnsupportedProtocolVersion=-32022]=`UnsupportedProtocolVersion`,e[e.UrlElicitationRequired=-32042]=`UrlElicitationRequired`,e}({}),Z=class e extends Error{static{Object.defineProperty(this,"mcpBrand",{value:`mcp.ProtocolError`})}static[Symbol.hasInstance](e){return $r(this,e)}static isInstance(e){if(typeof this!=`function`)throw TypeError("isInstance must be called on the class (e.g. `SdkError.isInstance(value)`); for callbacks use `v => SdkError.isInstance(v)`");return $r(this,e)}constructor(e,t,n){super(t),this.code=e,this.data=n,this.name=`ProtocolError`,Qr(this,new.target)}static fromError(t,n,r){if(t===X.UrlElicitationRequired&&r){let e=r;if(e.elicitations)return new Yi(e.elicitations,n)}if(t===X.UnsupportedProtocolVersion&&r){let e=r;if(Array.isArray(e.supported)&&typeof e.requested==`string`)return new Xi({supported:e.supported,requested:e.requested},n)}if(t===X.InvalidParams||t===X.ResourceNotFound){let e=r;if(typeof e?.uri==`string`&&(t===X.ResourceNotFound||Object.keys(e).length===1))return new Ji(e.uri,n)}if(t===X.MissingRequiredClientCapability&&r){let e=r;if(e.requiredCapabilities!==null&&typeof e.requiredCapabilities==`object`&&!Array.isArray(e.requiredCapabilities))return new Zi({requiredCapabilities:e.requiredCapabilities},n)}return new e(t,n,r)}},Ji=class extends Z{static{Object.defineProperty(this,"mcpBrand",{value:`mcp.ResourceNotFoundError`})}constructor(e,t=`Resource not found: ${e}`){super(X.InvalidParams,t,{uri:e})}get uri(){return this.data.uri}},Yi=class extends Z{static{Object.defineProperty(this,"mcpBrand",{value:`mcp.UrlElicitationRequiredError`})}constructor(e,t=`URL elicitation${e.length>1?`s`:``} required`){super(X.UrlElicitationRequired,t,{elicitations:e})}get elicitations(){return this.data?.elicitations??[]}},Xi=class extends Z{static{Object.defineProperty(this,"mcpBrand",{value:`mcp.UnsupportedProtocolVersionError`})}constructor(e,t=`Unsupported protocol version: ${e.requested}`){super(X.UnsupportedProtocolVersion,t,e)}get supported(){return this.data.supported}get requested(){return this.data.requested}},Zi=class extends Z{static{Object.defineProperty(this,"mcpBrand",{value:`mcp.MissingRequiredClientCapabilityError`})}constructor(e,t=`Missing required client capabilities: ${Object.keys(e.requiredCapabilities).join(`, `)}`){super(X.MissingRequiredClientCapability,t,e)}get requiredCapabilities(){return this.data.requiredCapabilities}},Qi=0,$i=`private`,ea=[`tools/call`,`prompts/get`,`resources/read`];function ta(e,t){let n=t.resultType;if(n===void 0)return{...t,resultType:`complete`};if(n===`complete`||ea.includes(e))return t;throw new Z(X.InternalError,`Handler for ${e} returned resultType '${String(n)}', but results of ${e} only support 'complete' on protocol revision 2026-07-28`)}function na(e,t){let n=Gi(t);if(t.resultType!==`complete`||!Ui(e))return n===void 0?t:sa(t);let r=t,i=Ki(r.ttlMs)?r.ttlMs:aa(n),a=qi(r.cacheScope)?r.cacheScope:oa(n),o={...r,ttlMs:i,cacheScope:a};return delete o[Wi],o}function ra(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function ia(e,t){if(t===void 0)return e;let n=e._meta;return n===void 0?{...e,_meta:{[Le]:t}}:!ra(n)||n[`io.modelcontextprotocol/serverInfo`]!==void 0?e:{...e,_meta:{...n,[Le]:t}}}function aa(e){return e!==void 0&&Ki(e.ttlMs)?e.ttlMs:Qi}function oa(e){return e!==void 0&&qi(e.cacheScope)?e.cacheScope:$i}function sa(e){let t={...e};return delete t[Wi],t}var ca=[`elicitation/create`,`sampling/createMessage`,`roots/list`],la;function ua(){if(la)return la;let e=Vi();return la={request:{"elicitation/create":S({method:k(`elicitation/create`),params:e.ElicitRequestParamsSchema}),"sampling/createMessage":S({method:k(`sampling/createMessage`),params:e.CreateMessageRequestParamsSchema}),"roots/list":S({method:k(`roots/list`),params:M({}).optional()})},response:{"elicitation/create":e.ElicitResultSchema,"sampling/createMessage":e.CreateMessageResultSchema,"roots/list":e.ListRootsResultSchema}},la}function da(e){return ca.includes(e)}function fa(e){return da(e)?ua().request[e]:void 0}function pa(e){return da(e)?ua().response[e]:void 0}var ma={"tools/call":null,"tools/list":null,"prompts/get":null,"prompts/list":null,"resources/list":null,"resources/templates/list":null,"resources/read":null,"completion/complete":null,"server/discover":null,"subscriptions/listen":null},ha={"notifications/cancelled":null,"notifications/progress":null,"notifications/message":null,"notifications/resources/updated":null,"notifications/resources/list_changed":null,"notifications/tools/list_changed":null,"notifications/prompts/list_changed":null,"notifications/subscriptions/acknowledged":null};function ga(e){return Object.prototype.hasOwnProperty.call(ma,e)}function _a(e){return Object.prototype.hasOwnProperty.call(ha,e)}function va(e){return Object.prototype.hasOwnProperty.call(ma,e)}function ya(e){return ga(e)?Vi().dispatchRequestSchemas[e]:void 0}function ba(e){return va(e)?Vi().dispatchResultSchemas[e]:void 0}function xa(e){return _a(e)?Vi().notificationSchemas2026[e]:void 0}Object.keys(ma),Object.keys(ha);function Sa(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function Ca(e,t){if(e===void 0)return{ok:!1,reason:`not-in-era`};let n=e.safeParse(t);return n.success?{ok:!0,value:n.data}:{ok:!1,reason:`invalid`,message:String(n.error)}}var wa={ok:!1,reason:`not-in-era`},Ta=[Fe,Re];function Ea(e,t){let n=t,r=!1,i=()=>(r||=(n={...n},!0),n),a=t.tools;e===`tools/list`&&Array.isArray(a)&&a.some(e=>Sa(e)&&`execution`in e)&&(i().tools=a.map(e=>{if(!Sa(e)||!(`execution`in e))return e;let t={...e};return delete t.execution,t}));let o=t.capabilities;if(Sa(o)&&`tasks`in o){let e={...o};delete e.tasks,i().capabilities=e}return n}var Da={era:`2026-07-28`,hasRequestMethod:ga,hasNotificationMethod:_a,hasInputRequestMethod:e=>fa(e)!==void 0,validateRequest:(e,t)=>Ca(ya(e),t),validateResult:(e,t)=>Ca(ba(e),t),validateNotification:(e,t)=>Ca(xa(e),t),validateInputRequest:(e,t)=>Ca(fa(e),t),validateInputResponse:(e,t)=>Ca(pa(e),t),samplingResultVariant:()=>wa,outboundEnvelope(e){return{[Fe]:e.protocolVersion,[Ie]:e.clientInfo,[Re]:e.clientCapabilities,...e.logLevel!==void 0&&{"io.modelcontextprotocol/logLevel":e.logLevel}}},validateEnvelopeMeta(e){let t=[];for(let n of Ta)n in e||t.push({key:n,problem:`missing`});let n=Vi().RequestMetaEnvelopeSchema.safeParse(e);if(!n.success)for(let e of n.error.issues){let n=e.path.map(String),r=n.length>0?n.join(`.`):`_meta`;n.length===1&&t.some(e=>e.key===r&&e.problem===`missing`)||t.push({key:r,problem:e.message})}return t},projectCallToolResult:e=>di(e),inputRequestSchema:fa,decodeResult(e,t){if(!Sa(t))return{kind:`invalid`,error:new Y(J.InvalidResult,`Invalid result for ${e}: not an object`,{method:e})};let n=t.resultType;if(n===void 0)return{kind:`invalid`,error:new Y(J.InvalidResult,`Invalid result for ${e}: missing required resultType — servers implementing protocol revision 2026-07-28 MUST include it (the absent-means-complete bridge applies only to earlier-revision servers)`,{method:e,violation:`missing-resultType`})};if(typeof n!=`string`)return{kind:`invalid`,error:new Y(J.InvalidResult,`Invalid result for ${e}: non-string resultType`,{method:e,resultType:n})};if(n===`input_required`){let n=t.inputRequests,r=Sa(n)?n:{},i=t.requestState,a=t._meta===void 0?void 0:Vi().ResultMetaSchema.safeParse(t._meta),o=a?.success?a.data:void 0;return Object.keys(r).length===0&&typeof i!=`string`?{kind:`invalid`,error:new Y(J.InvalidResult,`Invalid result for ${e}: input_required carries neither inputRequests nor requestState (every input_required result must include at least one of the two)`,{method:e,violation:`input-required-missing-both`})}:{kind:`input_required`,inputRequests:r,...typeof i==`string`&&{requestState:i},...o!==void 0&&{_meta:o}}}if(n!==`complete`)return{kind:`invalid`,error:new Y(J.UnsupportedResultType,`Unsupported result type '${n}' for ${e}`,{resultType:n,method:e})};let r=ka(),i=Object.hasOwn(r,e)?r[e]:void 0;if(i!==void 0){let n=i.safeParse(t);if(!n.success)return{kind:`invalid`,error:new Y(J.InvalidResult,`Invalid result for ${e}: ${n.error}`,{method:e})}}let a={...t};return delete a.resultType,{kind:`complete`,result:a}},encodeResult(e,t,n){return ia(na(e,ta(e,Ea(e,t))),n)},encodeErrorCode:e=>e===-32002?-32602:e,checkInboundEnvelope(e){if(e.envelope===void 0)return`Request is missing the required _meta envelope for protocol revision 2026-07-28 (io.modelcontextprotocol/protocolVersion, io.modelcontextprotocol/clientCapabilities)`;let t=Vi().RequestMetaEnvelopeSchema.safeParse(e.envelope);if(!t.success)return`Invalid _meta envelope for protocol revision 2026-07-28: ${t.error.issues.map(e=>e.message).join(`; `)}`}},Oa;function ka(){if(Oa)return Oa;let e=Vi();return Oa={"tools/call":e.CallToolResultSchema,"tools/list":e.ListToolsResultSchema,"prompts/get":e.GetPromptResultSchema,"prompts/list":e.ListPromptsResultSchema,"resources/list":e.ListResourcesResultSchema,"resources/templates/list":e.ListResourceTemplatesResultSchema,"resources/read":e.ReadResourceResultSchema,"completion/complete":e.CompleteResultSchema,"server/discover":e.DiscoverResultSchema},Oa}var Aa=`2026-07-28`;function ja(e){return e!==void 0&&ci(e)?Da:Ri}function Ma(e){return e.revision===void 0?e.era===`modern`?Da.era:Ri.era:ja(e.revision).era}function Na(e){return Ia.some(t=>t.hasRequestMethod(e))}function Pa(e){return Ia.some(t=>t.hasNotificationMethod(e))}function Fa(e){return e===`tasks/get`||e===`tasks/cancel`}var Ia=[Ri,Da],La=Ce({AnnotationsSchema:()=>Nt,AudioContentSchema:()=>ln,BaseMetadataSchema:()=>ct,BaseRequestParamsSchema:()=>L,BlobResourceContentsSchema:()=>jt,BooleanSchemaSchema:()=>Wn,CallToolRequestParamsSchema:()=>wn,CallToolRequestSchema:()=>Tn,CallToolResultSchema:()=>Sn,CancelTaskRequestSchema:()=>Ar,CancelTaskResultSchema:()=>jr,CancelledNotificationParamsSchema:()=>it,CancelledNotificationSchema:()=>at,ClientCapabilitiesSchema:()=>pt,ClientNotificationSchema:()=>Nr,ClientRequestSchema:()=>Mr,ClientResultSchema:()=>Pr,ClientTasksCapabilitySchema:()=>dt,CompatibilityCallToolResultSchema:()=>Cn,CompleteRequestParamsSchema:()=>dr,CompleteRequestSchema:()=>fr,CompleteResultSchema:()=>pr,ContentBlockSchema:()=>pn,CreateMessageRequestParamsSchema:()=>Bn,CreateMessageRequestSchema:()=>Vn,CreateMessageResultSchema:()=>Hn,CreateMessageResultWithToolsSchema:()=>Un,CreateTaskResultSchema:()=>xr,CursorSchema:()=>We,DiscoverRequestSchema:()=>yt,DiscoverResultSchema:()=>bt,ElicitRequestFormParamsSchema:()=>nr,ElicitRequestParamsSchema:()=>ir,ElicitRequestSchema:()=>ar,ElicitRequestURLParamsSchema:()=>rr,ElicitResultSchema:()=>cr,ElicitationCompleteNotificationParamsSchema:()=>or,ElicitationCompleteNotificationSchema:()=>sr,EmbeddedResourceSchema:()=>dn,EmptyResultSchema:()=>rt,EnumSchemaSchema:()=>er,GetPromptRequestParamsSchema:()=>on,GetPromptRequestSchema:()=>sn,GetPromptResultSchema:()=>hn,GetTaskPayloadRequestSchema:()=>Er,GetTaskPayloadResultSchema:()=>Dr,GetTaskRequestSchema:()=>wr,GetTaskResultSchema:()=>Tr,IconSchema:()=>ot,IconsSchema:()=>st,ImageContentSchema:()=>K,ImplementationSchema:()=>H,InitializeRequestParamsSchema:()=>mt,InitializeRequestSchema:()=>ht,InitializeResultSchema:()=>_t,InitializedNotificationSchema:()=>vt,JSONArraySchema:()=>He,JSONObjectSchema:()=>I,JSONRPCErrorResponseSchema:()=>et,JSONRPCMessageSchema:()=>tt,JSONRPCNotificationSchema:()=>Qe,JSONRPCRequestSchema:()=>Ze,JSONRPCResponseSchema:()=>nt,JSONRPCResultResponseSchema:()=>$e,JSONValueSchema:()=>Ve,LegacyTitledEnumSchemaSchema:()=>Yn,ListChangedOptionsBaseSchema:()=>Dn,ListPromptsRequestSchema:()=>rn,ListPromptsResultSchema:()=>an,ListResourceTemplatesRequestSchema:()=>U,ListResourceTemplatesResultSchema:()=>W,ListResourcesRequestSchema:()=>It,ListResourcesResultSchema:()=>Lt,ListRootsRequestSchema:()=>hr,ListRootsResultSchema:()=>gr,ListTasksRequestSchema:()=>Or,ListTasksResultSchema:()=>kr,ListToolsRequestSchema:()=>bn,ListToolsResultSchema:()=>xn,LoggingLevelSchema:()=>On,LoggingMessageNotificationParamsSchema:()=>jn,LoggingMessageNotificationSchema:()=>Mn,ModelHintSchema:()=>Nn,ModelPreferencesSchema:()=>Pn,MultiSelectEnumSchemaSchema:()=>$n,NotificationSchema:()=>B,NotificationsParamsSchema:()=>z,NumberSchemaSchema:()=>Kn,PaginatedRequestParamsSchema:()=>Tt,PaginatedRequestSchema:()=>Et,PaginatedResultSchema:()=>Dt,PingRequestSchema:()=>xt,PrimitiveSchemaDefinitionSchema:()=>tr,ProgressNotificationParamsSchema:()=>Ct,ProgressNotificationSchema:()=>wt,ProgressSchema:()=>St,ProgressTokenSchema:()=>Ue,PromptArgumentSchema:()=>G,PromptListChangedNotificationSchema:()=>gn,PromptMessageSchema:()=>mn,PromptReferenceSchema:()=>ur,PromptSchema:()=>nn,ReadResourceRequestParamsSchema:()=>zt,ReadResourceRequestSchema:()=>Bt,ReadResourceResultSchema:()=>Vt,RelatedTaskMetadataSchema:()=>Ke,RequestIdSchema:()=>Xe,RequestMetaSchema:()=>qe,RequestSchema:()=>R,ResourceContentsSchema:()=>Ot,ResourceLinkSchema:()=>fn,ResourceListChangedNotificationSchema:()=>Ht,ResourceRequestParamsSchema:()=>Rt,ResourceSchema:()=>Pt,ResourceTemplateReferenceSchema:()=>lr,ResourceTemplateSchema:()=>Ft,ResourceUpdatedNotificationParamsSchema:()=>en,ResourceUpdatedNotificationSchema:()=>tn,ResultMetaObjectSchema:()=>Ye,ResultSchema:()=>V,RoleSchema:()=>Mt,RootSchema:()=>mr,RootsListChangedNotificationSchema:()=>_r,SamplingContentSchema:()=>Ln,SamplingMessageContentBlockSchema:()=>Rn,SamplingMessageSchema:()=>zn,ServerCapabilitiesSchema:()=>gt,ServerNotificationSchema:()=>Ir,ServerRequestSchema:()=>Fr,ServerResultSchema:()=>Lr,ServerTasksCapabilitySchema:()=>ft,SetLevelRequestParamsSchema:()=>kn,SetLevelRequestSchema:()=>An,SingleSelectEnumSchemaSchema:()=>Xn,StringSchemaSchema:()=>Gn,SubscribeRequestParamsSchema:()=>Ut,SubscribeRequestSchema:()=>Wt,SubscriptionFilterSchema:()=>qt,SubscriptionsAcknowledgedNotificationParamsSchema:()=>Xt,SubscriptionsAcknowledgedNotificationSchema:()=>Zt,SubscriptionsListenRequestParamsSchema:()=>Jt,SubscriptionsListenRequestSchema:()=>Yt,SubscriptionsListenResultMetaSchema:()=>Qt,SubscriptionsListenResultSchema:()=>$t,TaskAugmentedRequestParamsSchema:()=>Je,TaskCreationParamsSchema:()=>vr,TaskMetadataSchema:()=>Ge,TaskSchema:()=>br,TaskStatusNotificationParamsSchema:()=>Sr,TaskStatusNotificationSchema:()=>Cr,TaskStatusSchema:()=>yr,TextContentSchema:()=>cn,TextResourceContentsSchema:()=>kt,TitledMultiSelectEnumSchemaSchema:()=>Qn,TitledSingleSelectEnumSchemaSchema:()=>Jn,ToolAnnotationsSchema:()=>_n,ToolChoiceSchema:()=>Fn,ToolExecutionSchema:()=>vn,ToolListChangedNotificationSchema:()=>En,ToolResultContentSchema:()=>In,ToolSchema:()=>yn,ToolUseContentSchema:()=>un,UnsubscribeRequestParamsSchema:()=>Gt,UnsubscribeRequestSchema:()=>Kt,UntitledMultiSelectEnumSchemaSchema:()=>Zn,UntitledSingleSelectEnumSchemaSchema:()=>qn}),Ra=e=>Ze.safeParse(e).success,za=e=>Qe.safeParse(e).success,Ba=e=>$e.safeParse(e).success,Va=e=>et.safeParse(e).success,Ha=e=>typeof e==`object`&&!!e&&!Array.isArray(e)&&e.resultType===`input_required`,Ua=e=>ht.safeParse(e).success,Wa=e=>vt.safeParse(e).success,Ga=`Mcp-Param-`,Ka=`x-mcp-header`,qa=/^[!#$%&'*+\-.^_`|~0-9A-Za-z]+$/,Ja=new Set([`string`,`integer`,`boolean`,`number`]);function Ya(e){let t=[],n=new Map,r=(e,i,a)=>{if(typeof e!=`object`||!e)return;let o=e;if(Ka in o){if(!a||i.length===0)return`${Qa(i)}: x-mcp-header is only permitted on properties statically reachable via a chain of 'properties' keys (not under items, additionalProperties, oneOf/anyOf/allOf/not, if/then/else, or $ref)`;let e=o[Ka];if(typeof e!=`string`||e.length===0)return`${Qa(i)}: x-mcp-header MUST be a non-empty string`;if(!qa.test(e))return`${Qa(i)}: x-mcp-header '${e}' is not a valid RFC 9110 token (no spaces, control characters or HTTP delimiters)`;let r=typeof o.type==`string`?o.type:void 0;if(r===void 0||!Ja.has(r))return`${Qa(i)}: x-mcp-header is only permitted on primitive-typed properties (string, integer, boolean); got ${r??``}`;let s=e.toLowerCase(),c=n.get(s);if(c!==void 0)return`x-mcp-header '${e}' is not case-insensitively unique (also declared as '${c}')`;n.set(s,e),t.push({path:i,headerName:e,type:r})}let s=o.properties;if(typeof s==`object`&&s)for(let[e,t]of Object.entries(s)){let n=r(t,[...i,e],a);if(n!==void 0)return n}for(let e of Xa){let t=o[e];if(t===void 0)continue;let n=Array.isArray(t)?t:typeof t==`object`&&t&&Za.has(e)?Object.values(t):[t];for(let t of n){let n=r(t,[...i,`<${e}>`],!1);if(n!==void 0)return n}}},i=r(e,[],!0);return i===void 0?{valid:!0,declarations:t}:{valid:!1,reason:i}}var Xa=[`items`,`prefixItems`,`contains`,`additionalProperties`,`unevaluatedProperties`,`unevaluatedItems`,`propertyNames`,`patternProperties`,`dependentSchemas`,`oneOf`,`anyOf`,`allOf`,`not`,`if`,`then`,`else`,`$defs`,`definitions`],Za=new Set([`patternProperties`,`dependentSchemas`,`$defs`,`definitions`]);function Qa(e){return e.length===0?``:e.join(`.`)}var $a=`=?base64?`,eo=`?=`;function to(e){if(typeof e==`string`)return e;if(typeof e==`boolean`)return e?`true`:`false`;if(typeof e==`number`)return!Number.isFinite(e)||Number.isInteger(e)&&!Number.isSafeInteger(e)?void 0:String(e)}function no(e){if(e.length===0||e.startsWith($a)&&e.endsWith(eo)||e!==e.trim())return!0;for(let t=0;t=32&&n<=126))return!0}return!1}function ro(e){let t=new TextEncoder().encode(e),n=``;for(let e of t)n+=String.fromCodePoint(e);return btoa(n)}function io(e){return no(e)?`${$a}${ro(e)}${eo}`:e}function ao(e,t){let n=e;for(let e of t){if(typeof n!=`object`||!n)return;n=n[e]}return n}function oo(e,t){let n={};for(let r of e){let e=ao(t,r.path);if(e==null)continue;let i=to(e);i!==void 0&&(n[`${Ga}${r.headerName}`]=io(i))}return n}X.InvalidRequest,X.UnsupportedProtocolVersion,X.InvalidParams,X.MethodNotFound,X.InvalidParams,X.MissingRequiredClientCapability,X.ParseError,X.InvalidRequest,X.MethodNotFound,X.UnsupportedProtocolVersion,X.MissingRequiredClientCapability;var so={"tools/call":`name`,"prompts/get":`name`,"resources/read":`uri`,"tasks/get":`taskId`,"tasks/update":`taskId`,"tasks/cancel":`taskId`};function co(e,t){let n=Object.hasOwn(so,e)?so[e]:void 0;if(n===void 0)return;let r=lo(t)?t[n]:void 0;return{field:n,value:typeof r==`string`?r:void 0}}function lo(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function uo(e,t){return p(e,t)}function fo(e){return new Set(e.flatMap(e=>Object.keys(e.shape)))}function po(e){if(e==null)return!1;let t=typeof e;return t!==`object`&&t!==`function`||!(`~standard`in e)?!1:typeof e[`~standard`]?.validate==`function`}var mo=!1,ho=`draft-2020-12`;function go(e,t=`input`){let n=e[`~standard`],r;if(n.jsonSchema)r=n.jsonSchema[t]({target:ho});else if(n.vendor===`zod`){if(!(`_zod`in e))throw Error(`Schema appears to be from zod 3, which the SDK cannot convert to JSON Schema. Upgrade to zod >=4.2.0, or wrap your JSON Schema with fromJsonSchema().`);mo||(mo=!0,console.warn("[mcp-sdk] Your zod version does not implement `~standard.jsonSchema` (added in zod 4.2.0). Falling back to z.toJSONSchema(). Upgrade to zod >=4.2.0 to silence this warning.")),r=ie(e,{target:ho,io:t})}else throw Error(`Schema library "${n.vendor}" does not implement StandardJSONSchemaV1 (\`~standard.jsonSchema\`). Upgrade to a version that does, or wrap your JSON Schema with fromJsonSchema().`);if(t===`output`)return r.type===void 0&&_o(r)?{type:`object`,...r}:r;if(r.type!==void 0&&r.type!==`object`)throw Error(`MCP tool and prompt schemas must describe objects (got type: ${JSON.stringify(r.type)}). Wrap your schema in z.object({...}) or equivalent.`);return{type:`object`,...r}}function _o(e){if(`properties`in e||`patternProperties`in e||`additionalProperties`in e||`required`in e)return!0;for(let t of[`oneOf`,`anyOf`,`allOf`]){let n=e[t];if(Array.isArray(n)&&n.length>0)return n.every(e=>typeof e==`object`&&!!e&&(e.type===`object`||_o(e)))}return!1}function vo(e){return e.path?.length?`${e.path.map(e=>String(typeof e==`object`?e.key:e)).join(`.`)}: ${e.message}`:e.message}async function yo(e,t){let n=await e[`~standard`].validate(t);return n.issues&&n.issues.length>0?{success:!1,error:n.issues.map(e=>vo(e)).join(`, `)}:{success:!0,data:n.value}}function bo(e){let t=ie(e,{target:ho,io:`input`});return typeof t.pattern==`string`?t.pattern:void 0}var xo=/\\\.\\d\{(\d+)\}/;function So(e){let t=xo.exec(e),n=[void 0,-1,0];return t&&n.push(Number(t[1])),[!1,!0].flatMap(e=>[!1,!0].flatMap(t=>n.map(n=>pe({local:e,offset:t,precision:n}))))}function Co(e,t){let n;switch(e){case`email`:n=[re()];break;case`uri`:n=[ae()];break;case`date`:n=[me()];break;case`date-time`:n=So(t)}return new Set(n.map(e=>bo(e)).filter(e=>e!==void 0))}function wo(e,t,n){return n!==`zod`||Co(e,t).has(t)}function To(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function Eo(e){try{return go(e,`input`)}catch(e){let t=e instanceof Error?e.message:String(e);throw new Z(X.InvalidParams,`Elicitation requestedSchema must describe an object with flat primitive properties: ${t}`)}}var Do=new Set([`$comment`,`deprecated`,`description`,`examples`,`readOnly`,`title`,`writeOnly`]);function Oo(e){return Do.has(e)||e.startsWith(`x-`)}var ko=new Set([`$schema`,...Object.keys(nr.shape.requestedSchema.shape)]),Ao={string:fo([Gn,qn,Jn,Yn]),number:fo([Kn]),integer:fo([Kn]),boolean:fo([Wn]),array:fo([Zn,Qn])},jo=new Set(Gn.shape.format.unwrap().options);function Mo(e,t,n,r){if(!To(e))return e;let i=typeof e.type==`string`&&Object.hasOwn(Ao,e.type)?Ao[e.type]:void 0;if(i===void 0)return e;let a={};for(let[o,s]of Object.entries(e))i.has(o)||Oo(o)?a[o]=s:o===`pattern`&&e.type===`string`&&typeof e.format==`string`?jo.has(e.format)?(typeof s!=`string`||!wo(e.format,s,n))&&r.push(`${t}.${o}`):a[o]=s:r.push(`${t}.${o}`);return a}function No(e,t){let n={},r=[];for(let[i,a]of Object.entries(e))i===`properties`&&To(a)?n[i]=Object.fromEntries(Object.entries(a).map(([e,n])=>[e,Mo(n,`properties.${e}`,t,r)])):ko.has(i)?n[i]=a:Oo(i)||r.push(i);if(r.length>0)throw new Z(X.InvalidParams,`Elicitation requestedSchema contains unsupported JSON Schema constraint(s) after Standard Schema conversion: ${r.join(`, `)}`);return n}function Po(e,t){if(!To(e.properties))return t;let n=Object.entries(e.properties).filter(([,e])=>!uo(tr,e).success).map(([e])=>`properties.${e}`);return n.length>0?n.join(`, `):t}function Fo(e,t,n=``){return Array.isArray(e)&&Array.isArray(t)?e.flatMap((e,r)=>Fo(e,t[r],`${n}[${r}]`)):!To(e)||!To(t)?[]:Object.entries(e).flatMap(([e,r])=>{let i=n?`${n}.${e}`:e;return Object.prototype.hasOwnProperty.call(t,e)?Fo(r,t[e],i):Oo(e)?[]:[i]})}function Io(e){if(!po(e.requestedSchema))return{...e,mode:`form`,requestedSchema:e.requestedSchema};let t=e.requestedSchema[`~standard`].vendor,n=No(Eo(e.requestedSchema),t),r=uo(nr.shape.requestedSchema,n);if(!r.success)throw new Z(X.InvalidParams,`Elicitation requestedSchema only supports flat primitive properties (string, number, integer, boolean, and string enums): ${Po(n,r.error.message)}`);let i=Fo(n,r.data);if(i.length>0)throw new Z(X.InvalidParams,`Elicitation requestedSchema contains unsupported JSON Schema constraint(s) after Standard Schema conversion: ${i.join(`, `)}`);let a=(r.data.required??[]).filter(e=>!Object.prototype.hasOwnProperty.call(r.data.properties,e));if(a.length>0)throw new Z(X.InvalidParams,`Elicitation requestedSchema lists required properties that are not defined in properties: ${a.join(`, `)}`);return{...e,mode:`form`,requestedSchema:r.data}}function Lo(e){let t=e.inputRequests!==void 0&&Object.keys(e.inputRequests).length>0,n=typeof e.requestState==`string`;if(!t&&!n)throw TypeError(`inputRequired() requires at least one of inputRequests (with at least one entry) or requestState (spec: every InputRequiredResult MUST include at least one of the two)`);return{resultType:`input_required`,...e.inputRequests!==void 0&&{inputRequests:e.inputRequests},...e.requestState!==void 0&&{requestState:e.requestState}}}Object.assign(Lo,{elicit(e){try{return{method:`elicitation/create`,params:Io(e)}}catch(e){throw e instanceof Z?TypeError(e.message,{cause:e}):e}},elicitUrl(e){return{method:`elicitation/create`,params:{...e,mode:`url`}}},createMessage(e){return{method:`sampling/createMessage`,params:e}},listRoots(){return{method:`roots/list`}}});var Ro=!0,zo=10,Bo=250;function Vo(e){return{autoFulfill:e?.autoFulfill??Ro,maxRounds:e?.maxRounds??zo}}function Ho(e,t,n){let r=t!==void 0&&Object.keys(t).length>0;return!r&&n===void 0?e:{...e,...r&&{inputResponses:t},...n!==void 0&&{requestState:n}}}function Uo(e,t){return`Multi-round-trip request '${e}' still required input after ${t} rounds (inputRequired.maxRounds)`}function Wo(e,t){return new Promise((n,r)=>{if(t?.aborted){r(t.reason instanceof Y?t.reason:new Y(J.RequestTimeout,String(t.reason)));return}let i=setTimeout(()=>{t?.removeEventListener(`abort`,a),n()},e),a=()=>{clearTimeout(i),r(t?.reason instanceof Y?t.reason:new Y(J.RequestTimeout,String(t?.reason)))};t?.addEventListener(`abort`,a,{once:!0})})}function Go(e){let t=new AbortController,n=()=>t.abort(e?.reason);return e?.addEventListener(`abort`,n,{once:!0}),e?.aborted&&t.abort(e.reason),{signal:t.signal,abort:e=>t.abort(e),dispose:()=>e?.removeEventListener(`abort`,n)}}async function Ko(e){let{config:t,method:n,originalParams:r,requestOptions:i,hooks:a,signal:o}=e,s=e.flowStartedAt??Date.now(),c=e.firstPayload,l=0;for(;;){if(l+=1,l>t.maxRounds)throw new Y(J.InputRequiredRoundsExceeded,Uo(n,t.maxRounds),{rounds:t.maxRounds,lastResult:{inputRequests:c.inputRequests,...c.requestState!==void 0&&{requestState:c.requestState}}});i.onprogress?.({progress:l,message:`Fulfilling input required by '${n}' (round ${l})`});let e=Object.entries(c.inputRequests??{}),u;if(e.length>0){let t=Go(o);try{let n=await Promise.all(e.map(async([e,n])=>{try{return[e,await a.dispatchInputRequest(e,n,t.signal)]}catch(e){throw t.abort(e),e}}));u=Object.fromEntries(n)}finally{t.dispose()}}else await Wo(Bo,o);let d={...i.timeout!==void 0&&{timeout:i.timeout}};if(i.maxTotalTimeout!==void 0){let e=Date.now()-s,t=i.maxTotalTimeout-e;if(t<=0)throw new Y(J.RequestTimeout,`Maximum total timeout exceeded`,{maxTotalTimeout:i.maxTotalTimeout,totalElapsed:e});d.maxTotalTimeout=t}let f=await a.retry(Ho(r,u,c.requestState),d);if(Ha(f)){c={inputRequests:f.inputRequests??{},...f.requestState!==void 0&&{requestState:f.requestState}};continue}return f}}var qo=`AnnotationsSchema.AudioContentSchema.BaseMetadataSchema.BlobResourceContentsSchema.BooleanSchemaSchema.CallToolRequestSchema.CallToolRequestParamsSchema.CallToolResultSchema.CancelledNotificationSchema.CancelledNotificationParamsSchema.CancelTaskRequestSchema.CancelTaskResultSchema.ClientCapabilitiesSchema.ClientNotificationSchema.ClientRequestSchema.ClientResultSchema.CompatibilityCallToolResultSchema.CompleteRequestSchema.CompleteRequestParamsSchema.CompleteResultSchema.ContentBlockSchema.CreateMessageRequestSchema.CreateMessageRequestParamsSchema.CreateMessageResultSchema.CreateMessageResultWithToolsSchema.CreateTaskResultSchema.CursorSchema.DiscoverRequestSchema.DiscoverResultSchema.ElicitationCompleteNotificationSchema.ElicitationCompleteNotificationParamsSchema.ElicitRequestSchema.ElicitRequestFormParamsSchema.ElicitRequestParamsSchema.ElicitRequestURLParamsSchema.ElicitResultSchema.EmbeddedResourceSchema.EmptyResultSchema.EnumSchemaSchema.GetPromptRequestSchema.GetPromptRequestParamsSchema.GetPromptResultSchema.GetTaskPayloadRequestSchema.GetTaskPayloadResultSchema.GetTaskRequestSchema.GetTaskResultSchema.IconSchema.IconsSchema.ImageContentSchema.ImplementationSchema.InitializedNotificationSchema.InitializeRequestSchema.InitializeRequestParamsSchema.InitializeResultSchema.JSONArraySchema.JSONObjectSchema.JSONRPCErrorResponseSchema.JSONRPCMessageSchema.JSONRPCNotificationSchema.JSONRPCRequestSchema.JSONRPCResponseSchema.JSONRPCResultResponseSchema.JSONValueSchema.LegacyTitledEnumSchemaSchema.ListPromptsRequestSchema.ListPromptsResultSchema.ListResourcesRequestSchema.ListResourcesResultSchema.ListResourceTemplatesRequestSchema.ListResourceTemplatesResultSchema.ListRootsRequestSchema.ListRootsResultSchema.ListTasksRequestSchema.ListTasksResultSchema.ListToolsRequestSchema.ListToolsResultSchema.LoggingLevelSchema.LoggingMessageNotificationSchema.LoggingMessageNotificationParamsSchema.ModelHintSchema.ModelPreferencesSchema.MultiSelectEnumSchemaSchema.NotificationSchema.NumberSchemaSchema.PaginatedRequestSchema.PaginatedRequestParamsSchema.PaginatedResultSchema.PingRequestSchema.PrimitiveSchemaDefinitionSchema.ProgressSchema.ProgressNotificationSchema.ProgressNotificationParamsSchema.ProgressTokenSchema.PromptSchema.PromptArgumentSchema.PromptListChangedNotificationSchema.PromptMessageSchema.PromptReferenceSchema.ReadResourceRequestSchema.ReadResourceRequestParamsSchema.ReadResourceResultSchema.RelatedTaskMetadataSchema.RequestSchema.RequestIdSchema.RequestMetaSchema.ResourceSchema.ResourceContentsSchema.ResourceLinkSchema.ResourceListChangedNotificationSchema.ResourceRequestParamsSchema.ResourceTemplateSchema.ResourceTemplateReferenceSchema.ResourceUpdatedNotificationSchema.ResourceUpdatedNotificationParamsSchema.ResultMetaObjectSchema.ResultSchema.RoleSchema.RootSchema.RootsListChangedNotificationSchema.SamplingContentSchema.SamplingMessageSchema.SamplingMessageContentBlockSchema.ServerCapabilitiesSchema.ServerNotificationSchema.ServerRequestSchema.ServerResultSchema.SetLevelRequestSchema.SetLevelRequestParamsSchema.SingleSelectEnumSchemaSchema.StringSchemaSchema.SubscribeRequestSchema.SubscribeRequestParamsSchema.SubscriptionFilterSchema.SubscriptionsAcknowledgedNotificationSchema.SubscriptionsAcknowledgedNotificationParamsSchema.SubscriptionsListenRequestSchema.SubscriptionsListenRequestParamsSchema.SubscriptionsListenResultSchema.SubscriptionsListenResultMetaSchema.TaskAugmentedRequestParamsSchema.TaskCreationParamsSchema.TaskMetadataSchema.TaskSchema.TaskStatusSchema.TaskStatusNotificationSchema.TaskStatusNotificationParamsSchema.TextContentSchema.TextResourceContentsSchema.TitledMultiSelectEnumSchemaSchema.TitledSingleSelectEnumSchemaSchema.ToolSchema.ToolAnnotationsSchema.ToolChoiceSchema.ToolExecutionSchema.ToolListChangedNotificationSchema.ToolResultContentSchema.ToolUseContentSchema.UnsubscribeRequestSchema.UnsubscribeRequestParamsSchema.UntitledMultiSelectEnumSchemaSchema.UntitledSingleSelectEnumSchemaSchema`.split(`.`),Jo={IdJagTokenExchangeResponseSchema:Ur,OAuthClientInformationFullSchema:Jr,OAuthClientInformationSchema:qr,OAuthClientMetadataSchema:Kr,OAuthClientRegistrationErrorSchema:Yr,OAuthErrorResponseSchema:Wr,OAuthMetadataSchema:zr,OAuthProtectedResourceMetadataSchema:Rr,OAuthTokenRevocationRequestSchema:Xr,OAuthTokensSchema:Hr,OpenIdProviderDiscoveryMetadataSchema:Vr,OpenIdProviderMetadataSchema:Br},Yo={},Xo={};function Zo(e,t){let n=e.slice(0,-6);Yo[n]=t,Xo[n]=e=>t.safeParse(e).success}for(let e of qo)Zo(e,La[e]);for(let[e,t]of Object.entries(Jo))Zo(e,t);Object.freeze(Yo);var Qo=Object.freeze(Xo);function $o(e){switch(e){case`initialize`:case`notifications/initialized`:return ja(void 0);case`server/discover`:return ja(Aa);default:return}}var es=[Fe,Ie,Re,Be],ts=[`inputResponses`,`requestState`];function ns(e,t){let n=e.params;if(!ss(n))return{message:e,lifted:{}};let r=n._meta,i=ss(r)?es.filter(e=>e in r):[],a=t===`request`?ts.filter(e=>e in n):[];if(i.length===0&&a.length===0)return{message:e,lifted:{}};let o={},s={...n};if(i.length>0&&ss(r)){let e={},t={...r};for(let n of i)e[n]=r[n],delete t[n];o.envelope=e,Object.keys(t).length>0?s._meta=t:delete s._meta}for(let e of a)e===`inputResponses`&&(o.inputResponses=s[e]),e===`requestState`&&(o.requestState=s[e]),delete s[e];return{message:{...e,params:s},lifted:o}}function rs(e,t){let n=e.validateResult(t,void 0);if(n.ok||n.reason!==`not-in-era`)return{"~standard":{version:1,vendor:`mcp-wire-codec`,validate(n){let r=e.validateResult(t,n);return r.ok?{value:r.value}:{issues:[{message:r.reason===`invalid`?r.message:`not-in-era: ${t}`}]}}}}}function is(e){return()=>e}var as=is(void 0),os=class{_transport;_requestMessageId=0;_requestHandlers=new Map;_customSchemaRequestMethods=new Set;_requestHandlerAbortControllers=new Map;_notificationHandlers=new Map;_responseHandlers=new Map;_progressHandlers=new Map;_timeoutInfo=new Map;_pendingDebouncedNotifications=new Set;_negotiatedProtocolVersion;_supportedProtocolVersions;onclose;onerror;fallbackRequestHandler;fallbackNotificationHandler;constructor(e){this._options=e,this._supportedProtocolVersions=e?.supportedProtocolVersions??Ne,this.setNotificationHandler(`notifications/cancelled`,e=>{this._oncancel(e)}),this.setNotificationHandler(`notifications/progress`,e=>{this._onprogress(e)}),this.setRequestHandler(`ping`,e=>({}))}_shouldDropInbound(e){}_outboundMetaEnvelope(){}_envelopeOutbound(e){let t=this._outboundMetaEnvelope();if(t===void 0)return e;let n=e.params??{};return{...e,params:{...n,_meta:{...t,...n._meta}}}}_resolveNonCompleteResult(e,t){return Promise.reject(new Y(J.UnsupportedResultType,`Unsupported result type '${e.kind}' for ${t.request.method}`,{resultType:e.kind,method:t.request.method}))}_getRequestHandler(e){return this._requestHandlers.get(e)}async _oncancel(e){e.params.requestId!==void 0&&this._requestHandlerAbortControllers.get(e.params.requestId)?.abort(e.params.reason)}_setupTimeout(e,t,n,r,i=!1){this._timeoutInfo.set(e,{timeoutId:setTimeout(r,t),startTime:Date.now(),timeout:t,maxTotalTimeout:n,resetTimeoutOnProgress:i,onTimeout:r})}_resetTimeout(e){let t=this._timeoutInfo.get(e);if(!t)return!1;let n=Date.now()-t.startTime;if(t.maxTotalTimeout&&n>=t.maxTotalTimeout)throw this._timeoutInfo.delete(e),new Y(J.RequestTimeout,`Maximum total timeout exceeded`,{maxTotalTimeout:t.maxTotalTimeout,totalElapsed:n});return clearTimeout(t.timeoutId),t.timeoutId=setTimeout(t.onTimeout,t.timeout),!0}_cleanupTimeout(e){let t=this._timeoutInfo.get(e);t&&(clearTimeout(t.timeoutId),this._timeoutInfo.delete(e))}async connect(e){this._transport=e;let t=this.transport?.onclose;this._transport.onclose=()=>{try{t?.()}finally{this._onclose()}};let n=this.transport?.onerror;this._transport.onerror=e=>{n?.(e),this._onerror(e)};let r=this._transport?.onmessage;this._transport.onmessage=(e,t)=>{r?.(e,t),Ba(e)||Va(e)?this._onresponse(e):Ra(e)?this._onrequest(e,t):za(e)?this._onnotification(e,t):this._onerror(Error(`Unknown message type: ${JSON.stringify(e)}`))},e.setSupportedProtocolVersions?.(this._supportedProtocolVersions),await this._transport.start()}_onclose(){let e=this._responseHandlers;this._responseHandlers=new Map,this._progressHandlers.clear(),this._pendingDebouncedNotifications.clear();for(let e of this._timeoutInfo.values())clearTimeout(e.timeoutId);this._timeoutInfo.clear();let t=this._requestHandlerAbortControllers;this._requestHandlerAbortControllers=new Map;let n=new Y(J.ConnectionClosed,`Connection closed`);this._transport=void 0;try{this.onclose?.()}finally{for(let t of e.values())t(n);for(let e of t.values())e.abort(n)}}_onerror(e){this.onerror?.(e)}_onnotification(e,t){let{message:n}=ns(e,`notification`),r=this._negotiatedWireCodec();if(t?.classification===void 0&&this._shouldDropInbound(e)===`drop`)return;if(t?.classification!==void 0){let e=Ma(t.classification);if(e!==r.era){this._onerror(Error(`Era mismatch on inbound notification '${n.method}': classified as ${e} but this instance serves ${r.era}`));return}}if(Pa(n.method)&&!r.hasNotificationMethod(n.method))return;let i=this._notificationHandlers.get(n.method),a=this.fallbackNotificationHandler;(i!==void 0||a!==void 0)&&Promise.resolve().then(()=>i===void 0?a(n):i(n,r)).catch(e=>this._onerror(Error(`Uncaught error in notification handler: ${e}`)))}_onrequest(e,t){let{message:n,lifted:r}=ns(e,`request`),i=this._negotiatedWireCodec();if(t?.classification===void 0&&this._shouldDropInbound(e)===`drop`){this._onerror(Error(`Dropped inbound request '${e.method}': not servable on this connection's protocol era`));return}let a=this._transport,o=(e,t,r)=>{let i={jsonrpc:`2.0`,id:n.id,error:{code:e,message:t,...r!==void 0&&{data:r}}};a?.send(i).catch(e=>this._onerror(Error(`Failed to send an error response: ${e}`)))};if(t?.classification!==void 0){let e=Ma(t.classification);if(e!==i.era){this._onerror(Error(`Era mismatch on inbound request '${n.method}': classified as ${e} but this instance serves ${i.era}`));let r=t.classification.revision??e;o(X.UnsupportedProtocolVersion,`Unsupported protocol version: ${r}`,{supported:this._supportedProtocolVersions,requested:r});return}}if(Na(n.method)&&!i.hasRequestMethod(n.method)&&!(Fa(n.method)&&this._customSchemaRequestMethods.has(n.method))){o(X.MethodNotFound,`Method not found`);return}let s=this._requestHandlers.get(n.method)??this.fallbackRequestHandler;if(s===void 0){o(X.MethodNotFound,`Method not found`);return}let c=i.checkInboundEnvelope(r);if(c!==void 0){o(X.InvalidParams,c);return}let l=(e,t)=>this._notificationViaCodec(this._resolveOutboundCodec(e.method),e,{...t,relatedRequestId:n.id}),u=(e,t,r)=>this._requestWithSchemaViaCodec(this._resolveOutboundCodec(e.method),e,t,{...r,relatedRequestId:n.id}),d=new AbortController;this._requestHandlerAbortControllers.set(n.id,d);let f=r.inputResponses===void 0?void 0:us(r.inputResponses),p={sessionId:a?.sessionId,mcpReq:{id:n.id,method:n.method,_meta:n.params?._meta,...r.envelope!==void 0&&{envelope:r.envelope},...f!==void 0&&{inputResponses:f.accepted},...f!==void 0&&f.droppedKeys.length>0&&{droppedInputResponseKeys:f.droppedKeys},requestState:r.requestState===void 0?as:is(r.requestState),signal:d.signal,send:((e,t,n)=>{let r=this._resolveOutboundCodec(e.method);if(this._assertOutboundRequestInEra(r,e.method),po(t))return u(e,t,n);let i=rs(r,e.method);if(i===void 0)throw TypeError(`'${e.method}' is not a spec method; pass a result schema as the second argument to ctx.mcpReq.send().`);return u(e,i,t)}),notify:l},http:t?.authInfo?{authInfo:t.authInfo}:void 0},m=this.buildContext(p,t);Promise.resolve().then(()=>s(n,m)).then(async e=>{if(d.signal.aborted)return;let t;try{t=i.encodeResult(n.method,e,this._outboundServerInfo())}catch(e){this._onerror(Error(`Failed to encode result for ${n.method}: ${e}`)),o(X.InternalError,`Internal error`);return}let r={result:t,jsonrpc:`2.0`,id:n.id};await a?.send(r)},async e=>{if(d.signal.aborted)return;let t=Number.isSafeInteger(e.code)?e.code:X.InternalError,r={jsonrpc:`2.0`,id:n.id,error:{code:i.encodeErrorCode(t),message:e.message??`Internal error`,...e.data!==void 0&&{data:e.data}}};await a?.send(r)}).catch(e=>this._onerror(Error(`Failed to send response: ${e}`))).finally(()=>{this._requestHandlerAbortControllers.get(n.id)===d&&this._requestHandlerAbortControllers.delete(n.id)})}_onprogress(e){let{progressToken:t,...n}=e.params,r=Number(t),i=this._progressHandlers.get(r);if(!i){this._onerror(Error(`Received a progress notification for an unknown token: ${JSON.stringify(e)}`));return}let a=this._responseHandlers.get(r),o=this._timeoutInfo.get(r);if(o&&a&&o.resetTimeoutOnProgress)try{this._resetTimeout(r)}catch(e){this._responseHandlers.delete(r),this._progressHandlers.delete(r),this._cleanupTimeout(r),a(e);return}i(n)}_onresponse(e){let t=Number(e.id),n=this._responseHandlers.get(t);if(n===void 0){this._onerror(Error(`Received a response for an unknown message ID: ${JSON.stringify(e)}`));return}this._responseHandlers.delete(t),this._cleanupTimeout(t),this._progressHandlers.delete(t),Ba(e)?n(e):n(Z.fromError(e.error.code,e.error.message,e.error.data))}get transport(){return this._transport}async close(){await this._transport?.close()}request(e,t,n){let r=this._resolveOutboundCodec(e.method);if(po(t))return Fa(e.method)||this._assertOutboundRequestInEra(r,e.method),this._requestWithSchemaViaCodec(r,e,t,n);this._assertOutboundRequestInEra(r,e.method);let i=rs(r,e.method);if(i===void 0)throw TypeError(`'${e.method}' is not a spec method; pass a result schema as the second argument to request().`);return this._requestWithSchemaViaCodec(r,e,i,t)}_negotiatedWireCodec(){return ja(this._negotiatedProtocolVersion)}_wireCodec(){return this._negotiatedWireCodec()}_resolveOutboundCodec(e){if(this._negotiatedProtocolVersion===void 0){let t=$o(e);if(t)return t}return this._negotiatedWireCodec()}_assertOutboundRequestInEra(e,t){if(Na(t)&&!e.hasRequestMethod(t))throw new Y(J.MethodNotSupportedByProtocolVersion,`Method '${t}' is not supported by the negotiated protocol version (wire era ${e.era})`,{method:t,era:e.era})}_requestWithSchema(e,t,n){let r=this._resolveOutboundCodec(e.method);return this._assertOutboundRequestInEra(r,e.method),this._requestWithSchemaViaCodec(r,e,t,n)}_requestWithSchemaViaCodec(e,t,n,r){let{relatedRequestId:i,resumptionToken:a,onresumptiontoken:o,headers:s}=r??{},c=Date.now(),l,u;return new Promise((d,f)=>{let p=e=>{f(e)};if(!this._transport){p(Error(`Not connected`));return}if(this._options?.enforceStrictCapabilities===!0)try{this.assertCapabilityForMethod(t.method)}catch(e){p(e);return}if(r?.signal?.aborted){let e=r.signal.reason;throw e instanceof Y?e:new Y(J.RequestTimeout,String(e))}let m=e.era===`2026-07-28`&&this._transport.hasPerRequestStream===!0?new AbortController:void 0,h=this._requestMessageId++;u=h;let g={...t,jsonrpc:`2.0`,id:h};r?.onprogress&&(this._progressHandlers.set(h,r.onprogress),g.params={...t.params,_meta:{...t.params?._meta,progressToken:h}});let _=this._envelopeOutbound(g),v=!1,y=e=>{v||(this._progressHandlers.delete(h),m===void 0?t.method!==`initialize`&&this._transport?.send(this._envelopeOutbound({jsonrpc:`2.0`,method:`notifications/cancelled`,params:{requestId:h,reason:String(e)}}),{relatedRequestId:i,resumptionToken:a,onresumptiontoken:o}).catch(e=>this._onerror(Error(`Failed to send cancellation: ${e}`))):m.abort(),f(e instanceof Y?e:new Y(J.RequestTimeout,String(e))))};this._responseHandlers.set(h,i=>{if(r?.signal?.aborted)return;if(v=!0,i instanceof Error)return f(i);let a;try{a=e.decodeResult(t.method,i.result)}catch(e){return f(e instanceof Error?e:Error(String(e)))}if(a.kind===`invalid`)return f(a.error);if(a.kind===`input_required`){if(r?.allowInputRequired===!0)return d(gs(a));let i={codec:e,request:t,resultSchema:n,options:r,flowStartedAt:c,retry:(r,i)=>this._requestWithSchemaViaCodec(e,r===void 0?{method:t.method}:{method:t.method,params:r},n,i)};return d(this._resolveNonCompleteResult(a,i))}let o=a.result;yo(n,o).then(e=>{e.success?d(e.data):f(new Y(J.InvalidResult,`Invalid result for ${t.method}: ${e.error}`))},f)}),l=()=>y(r?.signal?.reason),r?.signal?.addEventListener(`abort`,l,{once:!0});let b=r?.timeout??6e4;this._setupTimeout(h,b,r?.maxTotalTimeout,()=>y(new Y(J.RequestTimeout,`Request timed out`,{timeout:b})),r?.resetTimeoutOnProgress??!1),this._transport.send(_,{relatedRequestId:i,resumptionToken:a,onresumptiontoken:o,headers:s,requestSignal:m?.signal}).catch(e=>{this._progressHandlers.delete(h),f(e)})}).finally(()=>{l&&r?.signal?.removeEventListener(`abort`,l),u!==void 0&&(this._responseHandlers.delete(u),this._cleanupTimeout(u))})}async notification(e,t){return await this._notificationViaCodec(this._resolveOutboundCodec(e.method),e,t)}async _notificationViaCodec(e,t,n){if(!this._transport)throw new Y(J.NotConnected,`Not connected`);if(Pa(t.method)&&!e.hasNotificationMethod(t.method))throw new Y(J.MethodNotSupportedByProtocolVersion,`Notification '${t.method}' is not supported by the negotiated protocol version (wire era ${e.era})`,{method:t.method,era:e.era});this.assertNotificationCapability(t.method);let r=this._envelopeOutbound({jsonrpc:`2.0`,...t});if((this._options?.debouncedNotificationMethods??[]).includes(t.method)&&!t.params&&n?.relatedRequestId===void 0){if(this._pendingDebouncedNotifications.has(t.method))return;this._pendingDebouncedNotifications.add(t.method),Promise.resolve().then(()=>{this._pendingDebouncedNotifications.delete(t.method),this._transport&&this._transport?.send(r,n).catch(e=>this._onerror(e))});return}await this._transport.send(r,n)}setRequestHandler(e,t,n){this.assertRequestHandlerCapability(e);let r;if(typeof t==`function`){if(!Na(e))throw TypeError(`'${e}' is not a spec request method; pass schemas as the second argument to setRequestHandler().`);r=(n,r)=>{let i=this._negotiatedWireCodec(),a=i.validateRequest(e,n);if(!a.ok&&a.reason===`not-in-era`&&(a=i.validateInputRequest(e,n)),!a.ok)throw a.reason===`not-in-era`?new Z(X.InternalError,`No wire schema for ${e} in the resolved era`):Error(a.message);return Promise.resolve(t(a.value,r))}}else if(n)r=async(r,i)=>{let a=await yo(t.params,{...r.params});if(!a.success)throw new Z(X.InvalidParams,`Invalid params for ${e}: ${a.error}`);return n(a.data,i)};else throw TypeError(`setRequestHandler: handler is required`);typeof t==`function`?this._customSchemaRequestMethods.delete(e):this._customSchemaRequestMethods.add(e),this._requestHandlers.set(e,this._wrapHandler(e,r))}_wrapHandler(e,t){return t}_outboundServerInfo(){}removeRequestHandler(e){this._requestHandlers.delete(e),this._customSchemaRequestMethods.delete(e)}assertCanSetRequestHandler(e){if(this._requestHandlers.has(e))throw Error(`A request handler for ${e} already exists, which would be overridden`)}setNotificationHandler(e,t,n){if(typeof t==`function`){if(!Pa(e))throw TypeError(`'${e}' is not a spec notification method; pass schemas as the second argument to setNotificationHandler().`);this._notificationHandlers.set(e,(n,r)=>{let i=r.validateNotification(e,n);if(!i.ok)throw i.reason===`not-in-era`?new Z(X.InternalError,`No wire schema for ${e} in the resolved era`):Error(i.message);return Promise.resolve(t(i.value))});return}if(!n)throw TypeError(`setNotificationHandler: handler is required`);this._notificationHandlers.set(e,async r=>{let i=await yo(t.params,{...r.params});if(!i.success)throw new Z(X.InvalidParams,`Invalid params for notification ${e}: ${i.error}`);await n(i.data,r)})}removeNotificationHandler(e){this._notificationHandlers.delete(e)}};function ss(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function cs(e,t){let n={...e};for(let e in t){let r=e,i=t[r];if(i===void 0)continue;let a=n[r];n[r]=ss(a)&&ss(i)?{...a,...i}:i}return n}function ls(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function us(e){let t={},n=[];if(!ls(e))return{accepted:t,droppedKeys:n};for(let[r,i]of Object.entries(e)){if(!ls(i)||`method`in i||`result`in i){n.push(r);continue}t[r]=i}return{accepted:t,droppedKeys:n}}function ds(e){throw new Y(J.SendFailed,`ctx.mcpReq.${e} is not available while fulfilling an embedded input request: the request is fulfilled locally and has no related peer request`)}function fs(e,t,n,r,i){return{sessionId:i,mcpReq:{id:e,method:t,_meta:n?._meta,requestState:is(void 0),signal:r,send:(()=>ds(`send`)),notify:()=>ds(`notify`)}}}async function ps(e,t,n,r,i){if(!ls(r)||typeof r.method!=`string`)throw new Y(J.InvalidResult,`Invalid input request '${n}': each inputRequests entry must be an embedded request object with a method`,{key:n});let a=r.method;if(!t.hasInputRequestMethod(a))throw new Y(J.InvalidResult,`Invalid input request '${n}': '${a}' is not an embedded request the ${t.era} revision defines (expected elicitation/create, sampling/createMessage, or roots/list)`,{key:n,method:a});let o=e.getRequestHandler(a);if(o===void 0)throw new Y(J.CapabilityNotSupported,`Cannot fulfil input request '${n}': no handler is registered for '${a}' on this client. Declare the corresponding capability and register a handler, or handle input_required results manually.`,{key:n,method:a});let s=ls(r.params)?r.params:void 0;return await o({jsonrpc:`2.0`,id:n,method:a,...s!==void 0&&{params:s}},e.buildContext(fs(n,a,s,i,e.sessionId)))}function ms(e,t){return{...e?.signal!==void 0&&{signal:e.signal},...e?.onprogress!==void 0&&{onprogress:e.onprogress},...e?.resetTimeoutOnProgress!==void 0&&{resetTimeoutOnProgress:e.resetTimeoutOnProgress},...e?.headers!==void 0&&{headers:e.headers},...t.timeout!==void 0&&{timeout:t.timeout},...t.maxTotalTimeout!==void 0&&{maxTotalTimeout:t.maxTotalTimeout},allowInputRequired:!0}}function hs(e,t,n,r){let{codec:i,request:a,options:o,flowStartedAt:s}=r,c={inputRequests:n.inputRequests,...n.requestState!==void 0&&{requestState:n.requestState}},l={dispatchInputRequest:(t,n,r)=>ps(e,i,t,n,r),retry:(e,t)=>r.retry(e,ms(o,t))};return Ko({config:t,method:a.method,originalParams:a.params,firstPayload:c,flowStartedAt:s,signal:o?.signal,requestOptions:{...o?.timeout!==void 0&&{timeout:o.timeout},...o?.maxTotalTimeout!==void 0&&{maxTotalTimeout:o.maxTotalTimeout},...o?.onprogress!==void 0&&{onprogress:o.onprogress}},hooks:l})}function gs(e){return{resultType:`input_required`,inputRequests:e.inputRequests,...e.requestState!==void 0&&{requestState:e.requestState},...e._meta!==void 0&&{_meta:e._meta}}}var _s=Te(Se((e=>{var t=/; *([!#$%&'*+.^_`|~0-9A-Za-z-]+) *= *("(?:[\u000b\u0020\u0021\u0023-\u005b\u005d-\u007e\u0080-\u00ff]|\\[\u000b\u0020-\u00ff])*"|[!#$%&'*+.^_`|~0-9A-Za-z-]+) */g,n=/\\([\u000b\u0020-\u00ff])/g,r=/^[!#$%&'*+.^_`|~0-9A-Za-z-]+\/[!#$%&'*+.^_`|~0-9A-Za-z-]+$/;e.parse=i;function i(e){if(!e)throw TypeError(`argument string is required`);var i=typeof e==`object`?a(e):e;if(typeof i!=`string`)throw TypeError(`argument string is required to be a string`);var s=i.indexOf(`;`),c=s===-1?i.trim():i.slice(0,s).trim();if(!r.test(c))throw TypeError(`invalid media type`);var l=new o(c.toLowerCase());if(s!==-1){var u,d,f;for(t.lastIndex=s;d=t.exec(i);){if(d.index!==s)throw TypeError(`invalid parameter format`);s+=d[0].length,u=d[1].toLowerCase(),f=d[2],f.charCodeAt(0)===34&&(f=f.slice(1,-1),f.indexOf(`\\`)!==-1&&(f=f.replace(n,`$1`))),l.parameters[u]=f}if(s!==i.length)throw TypeError(`invalid parameter format`)}return l}function a(e){var t;if(typeof e.getHeader==`function`?t=e.getHeader(`content-type`):typeof e.headers==`object`&&(t=e.headers&&e.headers[`content-type`]),typeof t!=`string`)throw TypeError(`content-type header is missing from object`);return t}function o(e){this.parameters=Object.create(null),this.type=e}}))(),1);function vs(e){if(e)try{return _s.parse(e).type}catch{let t=(e.split(`;`,1)[0]??``).trim().toLowerCase();return t===``||e.slice(t.length).includes(`,`)?void 0:t}}function ys(e){return e?e instanceof Headers?Object.fromEntries(e.entries()):Array.isArray(e)?Object.fromEntries(e):{...e}:{}}function bs(e=fetch,t){return t?async(n,r)=>e(n,{...t,...r,headers:r?.headers?{...ys(t.headers),...ys(r.headers)}:t.headers}):e}var xs=new Set([301,302,303,307,308]),Ss=5;function Cs(e,t){return e.protocol===t.protocol&&e.host===t.host||e.protocol===`http:`&&t.protocol===`https:`&&e.hostname===t.hostname&&!e.port&&!t.port}function ws(e,t){let n=xs.has(t.status)?t.headers?.get(`location`):void 0;if(n)try{return new URL(n,e)}catch{return}}var Ts=new WeakSet;function Es(e){let t=(t,n)=>e(t,n);return Ts.add(t),t}function Ds(e){return Ts.has(e)?e:async(t,n)=>{if(n?.redirect===`error`||n?.redirect===`manual`)return e(t,n);let r=(n?.method??`GET`).toUpperCase(),i=t;for(let t=0;;t++){let a=await e(i,{...n,redirect:`manual`}),o=ws(i,a);if(!o||t===Ss)return a;let s=new URL(i),c=r===`GET`||a.status===307||a.status===308,l=!(o.username||o.password)||o.username===s.username&&o.password===s.password;if(!c||!l||!Cs(s,o))return a;await a.text?.().catch(()=>{}),i=o}}}function Os(e,t){if(t.type===`opaqueredirect`)return`Redirect not followed: this runtime does not expose where it points`;let n=ws(t.url||e,t);if(n)return n.username=n.password=n.search=n.hash=``,n.protocol===`http:`&&new URL(t.url||e).protocol===`https:`?(n.protocol=`https:`,`Redirect from https to plain http not followed; try ${n.href} as the endpoint`):`Redirect to ${n.href} not followed; use that URL as the endpoint if it is the intended server`}function ks(e,t){let n=typeof e;if(n!==typeof t)return!1;if(Array.isArray(e)){if(!Array.isArray(t))return!1;let n=e.length;if(n!==t.length)return!1;for(let r=0;r1?t[a.href]=e:(a.hash=``,r===``?n=a:Is(e,t,n))}}else if(e!==!0&&e!==!1)return t;let i=n.href+(r?`#`+r:``);if(t[i]!==void 0)throw Error(`Duplicate schema URI "${i}".`);if(t[i]=e,e===!0||e===!1)return t;if(e.__absolute_uri__===void 0&&Object.defineProperty(e,"__absolute_uri__",{enumerable:!1,value:i}),e.$ref&&e.__absolute_ref__===void 0){let t=new URL(e.$ref,n.href);t.hash=t.hash,Object.defineProperty(e,"__absolute_ref__",{enumerable:!1,value:t.href})}if(e.$recursiveRef&&e.__absolute_recursive_ref__===void 0){let t=new URL(e.$recursiveRef,n.href);t.hash=t.hash,Object.defineProperty(e,"__absolute_recursive_ref__",{enumerable:!1,value:t.href})}if(e.$anchor){let r=new URL(`#`+e.$anchor,n.href);t[r.href]=e}for(let i in e){if(Ps[i])continue;let a=`${r}/${As(i)}`,o=e[i];if(Array.isArray(o)){if(Ms[i]){let e=o.length;for(let r=0;r%\\^`{|}]|%[0-9a-f]{2})|\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?)*\})*$/i,Us=/^(?:(?:https?|ftp):\/\/)(?:\S+(?::\S*)?@)?(?:(?!10(?:\.\d{1,3}){3})(?!127(?:\.\d{1,3}){3})(?!169\.254(?:\.\d{1,3}){2})(?!192\.168(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z\u{00a1}-\u{ffff}0-9]+-?)*[a-z\u{00a1}-\u{ffff}0-9]+)(?:\.(?:[a-z\u{00a1}-\u{ffff}0-9]+-?)*[a-z\u{00a1}-\u{ffff}0-9]+)*(?:\.(?:[a-z\u{00a1}-\u{ffff}]{2,})))(?::\d{2,5})?(?:\/[^\s]*)?$/iu,Ws=/^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i,Gs=/^(?:\/(?:[^~/]|~0|~1)*)*$/,Ks=/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i,qs=/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/,Js=e=>{if(e[0]===`"`)return!1;let[t,n,...r]=e.split(`@`);return!t||!n||r.length!==0||t.length>64||n.length>253||t[0]===`.`||t.endsWith(`.`)||t.includes(`..`)||!/^[a-z0-9.-]+$/i.test(n)||!/^[a-z0-9.!#$%&'*+/=?^_`{|}~-]+$/i.test(t)?!1:n.split(`.`).every(e=>/^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$/i.test(e))},Ys=/^(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)$/,Xs=/^((([0-9a-f]{1,4}:){7}([0-9a-f]{1,4}|:))|(([0-9a-f]{1,4}:){6}(:[0-9a-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){5}(((:[0-9a-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){4}(((:[0-9a-f]{1,4}){1,3})|((:[0-9a-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){3}(((:[0-9a-f]{1,4}){1,4})|((:[0-9a-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){2}(((:[0-9a-f]{1,4}){1,5})|((:[0-9a-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){1}(((:[0-9a-f]{1,4}){1,6})|((:[0-9a-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9a-f]{1,4}){1,7})|((:[0-9a-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))$/i,Zs=e=>e.length>1&&e.length<80&&(/^P\d+([.,]\d+)?W$/.test(e)||/^P[\dYMDTHS]*(\d[.,]\d+)?[YMDHS]$/.test(e)&&/^P([.,\d]+Y)?([.,\d]+M)?([.,\d]+D)?(T([.,\d]+H)?([.,\d]+M)?([.,\d]+S)?)?$/.test(e));function Qs(e){return e.test.bind(e)}var $s={date:tc,time:nc.bind(void 0,!1),"date-time":ic,duration:Zs,uri:sc,"uri-reference":Qs(Vs),"uri-template":Qs(Hs),url:Qs(Us),email:Js,hostname:Qs(Bs),ipv4:Qs(Ys),ipv6:Qs(Xs),regex:lc,uuid:Qs(Ws),"json-pointer":Qs(Gs),"json-pointer-uri-fragment":Qs(Ks),"relative-json-pointer":Qs(qs)};function ec(e){return e%4==0&&(e%100!=0||e%400==0)}function tc(e){let t=e.match(Ls);if(!t)return!1;let n=+t[1],r=+t[2],i=+t[3];return r>=1&&r<=12&&i>=1&&i<=(r==2&&ec(n)?29:Rs[r])}function nc(e,t){let n=t.match(zs);if(!n)return!1;let r=+n[1],i=+n[2],a=+n[3],o=!!n[5];return(r<=23&&i<=59&&a<=59||r==23&&i==59&&a==60)&&(!e||o)}var rc=/t|\s/i;function ic(e){let t=e.split(rc);return t.length==2&&tc(t[0])&&nc(!0,t[1])}var ac=/\/|:/,oc=/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)(?:\?(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i;function sc(e){return ac.test(e)&&oc.test(e)}var cc=/[^\\]\\Z/;function lc(e){if(cc.test(e))return!1;try{return new RegExp(e,`u`),!0}catch{return!1}}function uc(e){let t=0,n=e.length,r=0,i;for(;r=55296&&i<=56319&&rks(e,t))||F.push({instanceLocation:o,keyword:`enum`,keywordLocation:`${s}/enum`,error:`Instance does not match any of ${JSON.stringify(g)}.`}):g.some(t=>e===t)||F.push({instanceLocation:o,keyword:`enum`,keywordLocation:`${s}/enum`,error:`Instance does not match any of ${JSON.stringify(g)}.`})),v!==void 0){let t=`${s}/not`;Q(e,v,n,r,i,a,o,t).valid&&F.push({instanceLocation:o,keyword:`not`,keywordLocation:t,error:`Instance matched "not" schema.`})}let xe=[];if(y!==void 0){let t=`${s}/anyOf`,l=F.length,u=!1;for(let s=0;s{let u=Object.create(c),d=Q(e,s,n,r,i,p===!0?a:null,o,`${t}/${l}`,u);return F.push(...d.errors),d.valid&&xe.push(u),d.valid}).length;u===1?F.length=l:F.splice(l,0,{instanceLocation:o,keyword:`oneOf`,keywordLocation:t,error:`Instance does not match exactly one subschema (${u} matches).`})}if((u===`object`||u===`array`)&&Object.assign(c,...xe),S!==void 0){let t=`${s}/if`;if(Q(e,S,n,r,i,a,o,t,c).valid){if(C!==void 0){let l=Q(e,C,n,r,i,a,o,`${s}/then`,c);l.valid||F.push({instanceLocation:o,keyword:`if`,keywordLocation:t,error:`Instance does not match "then" schema.`},...l.errors)}}else if(ee!==void 0){let l=Q(e,ee,n,r,i,a,o,`${s}/else`,c);l.valid||F.push({instanceLocation:o,keyword:`if`,keywordLocation:t,error:`Instance does not match "else" schema.`},...l.errors)}}if(u===`object`){if(_!==void 0)for(let t of _)t in e||F.push({instanceLocation:o,keyword:`required`,keywordLocation:`${s}/required`,error:`Instance does not have required property "${t}".`});let t=Object.keys(e);if(ne!==void 0&&t.lengthre&&F.push({instanceLocation:o,keyword:`maxProperties`,keywordLocation:`${s}/maxProperties`,error:`Instance does not have at least ${re} properties.`}),ie!==void 0){let t=`${s}/propertyNames`;for(let s in e){let e=`${o}/${As(s)}`,c=Q(s,ie,n,r,i,a,e,t);c.valid||F.push({instanceLocation:o,keyword:`propertyNames`,keywordLocation:t,error:`Property name "${s}" does not match schema.`},...c.errors)}}if(ae!==void 0){let t=`${s}/dependantRequired`;for(let n in ae)if(n in e){let r=ae[n];for(let i of r)i in e||F.push({instanceLocation:o,keyword:`dependentRequired`,keywordLocation:t,error:`Instance has "${n}" but does not have "${i}".`})}}if(oe!==void 0)for(let t in oe){let l=`${s}/dependentSchemas`;if(t in e){let s=Q(e,oe[t],n,r,i,a,o,`${l}/${As(t)}`,c);s.valid||F.push({instanceLocation:o,keyword:`dependentSchemas`,keywordLocation:l,error:`Instance has "${t}" but does not match dependant schema.`},...s.errors)}}if(se!==void 0){let t=`${s}/dependencies`;for(let s in se)if(s in e){let c=se[s];if(Array.isArray(c))for(let n of c)n in e||F.push({instanceLocation:o,keyword:`dependencies`,keywordLocation:t,error:`Instance has "${s}" but does not have "${n}".`});else{let l=Q(e,c,n,r,i,a,o,`${t}/${As(s)}`);l.valid||F.push({instanceLocation:o,keyword:`dependencies`,keywordLocation:t,error:`Instance has "${s}" but does not match dependant schema.`},...l.errors)}}}let l=Object.create(null),u=!1;if(T!==void 0){let t=`${s}/properties`;for(let s in T){if(!(s in e))continue;let d=`${o}/${As(s)}`,f=Q(e[s],T[s],n,r,i,a,d,`${t}/${As(s)}`);if(f.valid)c[s]=l[s]=!0;else if(u=i,F.push({instanceLocation:o,keyword:`properties`,keywordLocation:t,error:`Property "${s}" does not match schema.`},...f.errors),u)break}}if(!u&&E!==void 0){let t=`${s}/patternProperties`;for(let s in E){let d=new RegExp(s,`u`),f=E[s];for(let p in e){if(!d.test(p))continue;let m=`${o}/${As(p)}`,h=Q(e[p],f,n,r,i,a,m,`${t}/${As(s)}`);h.valid?c[p]=l[p]=!0:(u=i,F.push({instanceLocation:o,keyword:`patternProperties`,keywordLocation:t,error:`Property "${p}" matches pattern "${s}" but does not match associated schema.`},...h.errors))}}}if(!u&&te!==void 0){let t=`${s}/additionalProperties`;for(let s in e){if(l[s])continue;let d=`${o}/${As(s)}`,f=Q(e[s],te,n,r,i,a,d,t);f.valid?c[s]=!0:(u=i,F.push({instanceLocation:o,keyword:`additionalProperties`,keywordLocation:t,error:`Property "${s}" does not match additional properties schema.`},...f.errors))}}else if(!u&&D!==void 0){let t=`${s}/unevaluatedProperties`;for(let s in e)if(!c[s]){let l=`${o}/${As(s)}`,u=Q(e[s],D,n,r,i,a,l,t);u.valid?c[s]=!0:F.push({instanceLocation:o,keyword:`unevaluatedProperties`,keywordLocation:t,error:`Property "${s}" does not match unevaluated properties schema.`},...u.errors)}}}else if(u===`array`){de!==void 0&&e.length>de&&F.push({instanceLocation:o,keyword:`maxItems`,keywordLocation:`${s}/maxItems`,error:`Array has too many items (${e.length} > ${de}).`}),M!==void 0&&e.length=(A||0)&&(F.length=u),A===void 0&&j===void 0&&d===0?F.splice(u,0,{instanceLocation:o,keyword:`contains`,keywordLocation:l,error:`Array does not contain item matching schema.`}):A!==void 0&&dj&&F.push({instanceLocation:o,keyword:`maxContains`,keywordLocation:`${s}/maxContains`,error:`Array may contain at most ${j} items matching schema. ${d} items were found.`})}}if(!u&&ue!==void 0){let u=`${s}/unevaluatedItems`;for(;l=me||e>me)&&F.push({instanceLocation:o,keyword:`maximum`,keywordLocation:`${s}/maximum`,error:`${e} is greater than ${N?`or equal to `:``} ${me}.`})):(pe!==void 0&&eme&&F.push({instanceLocation:o,keyword:`maximum`,keywordLocation:`${s}/maximum`,error:`${e} is greater than ${me}.`}),he!==void 0&&e<=he&&F.push({instanceLocation:o,keyword:`exclusiveMinimum`,keywordLocation:`${s}/exclusiveMinimum`,error:`${e} is less than ${he}.`}),N!==void 0&&e>=N&&F.push({instanceLocation:o,keyword:`exclusiveMaximum`,keywordLocation:`${s}/exclusiveMaximum`,error:`${e} is greater than or equal to ${N}.`})),P!==void 0){let t=e%P;Math.abs(0-t)>=1.1920929e-7&&Math.abs(P-t)>=1.1920929e-7&&F.push({instanceLocation:o,keyword:`multipleOf`,keywordLocation:`${s}/multipleOf`,error:`${e} is not a multiple of ${P}.`})}}else if(u===`string`){let t=ge===void 0&&_e===void 0?0:uc(e);ge!==void 0&&t_e&&F.push({instanceLocation:o,keyword:`maxLength`,keywordLocation:`${s}/maxLength`,error:`String is too long (${t} > ${_e}).`}),ve!==void 0&&!new RegExp(ve,`u`).test(e)&&F.push({instanceLocation:o,keyword:`pattern`,keywordLocation:`${s}/pattern`,error:`String does not match pattern.`}),w!==void 0&&$s[w]&&!$s[w](e)&&F.push({instanceLocation:o,keyword:`format`,keywordLocation:`${s}/format`,error:`String does not match format "${w}".`})}return{valid:F.length===0,errors:F}}var dc=class{schema;draft;shortCircuit;lookup;constructor(e,t=`2019-09`,n=!0){this.schema=e,this.draft=t,this.shortCircuit=n,this.lookup=Is(e)}validate(e){return Q(e,this.schema,this.draft,this.lookup,this.shortCircuit)}addSchema(e,t){t&&(e={...e,$id:t}),Is(e,this.lookup)}},fc=class{shortcircuit;draft;constructor(e){this.shortcircuit=e?.shortcircuit??!0,this.draft=e?.draft}_draftFor(e){let t=je(e,`pass an explicit { draft } to CfWorkerJsonSchemaValidator to validate other dialects.`);return t===`draft-7`?`7`:t}getValidator(e){let t=new dc(e,this.draft??this._draftFor(e),this.shortcircuit);return e=>{let n=t.validate(e);return n.valid?{valid:!0,data:e,errorMessage:void 0}:{valid:!1,data:void 0,errorMessage:n.errors.map(e=>`${e.instanceLocation}: ${e.error}`).join(`; `)}}}},pc=globalThis.crypto;async function mc(e){return(await pc).getRandomValues(new Uint8Array(e))}async function hc(e){let t=``;for(;t.length128)throw`Expected a length between 43 and 128. Received ${e}.`;let t=await gc(e);return{code_verifier:t,code_challenge:await _c(t)}}var yc=class extends Error{constructor(e,t){super(e),this.name=`ParseError`,this.type=t.type,this.field=t.field,this.value=t.value,this.line=t.line}},bc=10,xc=13,Sc=32;function Cc(e){}function wc(e){if(typeof e==`function`)throw TypeError("`config` must be an object, got a function instead. Did you mean `createParser({onEvent: fn})`?");let{onEvent:t=Cc,onError:n=Cc,onRetry:r=Cc,onComment:i,maxBufferSize:a}=e,o=[],s=0,c=!0,l,u=``,d=0,f,p=!1;function m(e){if(p)throw Error("Cannot feed parser: it was terminated after exceeding the configured max buffer size. Call `reset()` to resume parsing.");if(c&&(c=!1,e.charCodeAt(0)===239&&e.charCodeAt(1)===187&&e.charCodeAt(2)===191&&(e=e.slice(3))),o.length===0){let t=g(e);t!==``&&(o.push(t),s=t.length),h();return}if(e.indexOf(` `)===-1&&e.indexOf(`\r`)===-1){o.push(e),s+=e.length,h();return}o.push(e);let t=o.join(``);o.length=0,s=0;let n=g(t);n!==``&&(o.push(n),s=n.length),h()}function h(){a!==void 0&&(s+u.length<=a||(p=!0,o.length=0,s=0,l=void 0,u=``,d=0,f=void 0,n(new yc(`Buffered data exceeded max buffer size of ${a} characters`,{type:`max-buffer-size-exceeded`}))))}function g(e){let n=0;if(e.indexOf(`\r`)===-1){let r=e.indexOf(` `,n);for(;r!==-1;){if(n===r){d>0&&t({id:l,event:f,data:u}),l=void 0,u=``,d=0,f=void 0,n=r+1,r=e.indexOf(` diff --git a/internal/ui/dist/assets/page-C2G9EzC7.js b/internal/ui/dist/assets/page-DXpYvlEo.js similarity index 96% rename from internal/ui/dist/assets/page-C2G9EzC7.js rename to internal/ui/dist/assets/page-DXpYvlEo.js index 6fb6e9396..6068811a9 100644 --- a/internal/ui/dist/assets/page-C2G9EzC7.js +++ b/internal/ui/dist/assets/page-DXpYvlEo.js @@ -1,4 +1,4 @@ -import{A as e,C as t,D as n,E as r,K as i,M as a,O as o,P as s,S as c,St as l,T as u,X as d,Y as f,Z as p,_ as m,_t as h,a as g,at as _,bt as v,c as y,ct as b,d as x,et as S,f as C,ft as w,g as T,h as E,j as D,k as O,lt as k,m as A,mt as j,o as M,ot as N,p as P,r as F,s as I,tt as L,u as ee,ut as te,v as ne,vt as re,x as ie,xt as ae,y as R,yt as oe}from"./brand-B8x2UvAx.js";import{c as z,l as se,o as ce,r as le,s as ue}from"./auth-DQIRmg9h.js";import{c as de,g as fe,m as pe,p as me,s as he}from"./preload-helper-DYCQ0CsM.js";import{$ as ge,A as _e,B as ve,C as ye,D as be,F as xe,G as Se,H as Ce,I as we,J as Te,K as Ee,L as De,M as Oe,N as ke,O as Ae,P as je,R as Me,T as Ne,U as Pe,V as Fe,W as Ie,Z as Le,c as Re,d as ze,et as Be,f as Ve,g as He,h as Ue,i as We,j as Ge,k as Ke,l as qe,m as Je,o as Ye,ot as Xe,p as Ze,q as Qe,r as $e,s as et,st as tt,u as nt,v as rt,w as it,y as at,z as ot}from"./theme-DGoiBK3l.js";import{n as st,t as ct}from"./get-single-element-child-C3yy66_3.js";import{C as lt,E as ut,b as dt,o as ft,t as pt,w as mt}from"./Tooltip-BP7AB724.js";import{t as ht}from"./use-computed-color-scheme-DxHBJokx.js";import{E as gt,T as _t,t as vt}from"./useQuery-CJpHjMkr.js";import{n as yt}from"./FocusTrap-yuoZ2xkr.js";import{a as bt,c as xt,d as St,i as Ct,l as wt,n as Tt,o as Et,r as Dt,s as Ot,t as kt,u as At}from"./dashboard-change-chips-DyBazwAN.js";import{n as jt,r as Mt,t as Nt}from"./WarningCircle.es-D3vbL2zn.js";function Pt(e,t){if(Object.is(e,t))return!0;if(typeof e!=`object`||!e||typeof t!=`object`||!t)return!1;if(e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(let[n,r]of e)if(!t.has(n)||!Object.is(r,t.get(n)))return!1;return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(let n of e)if(!t.has(n))return!1;return!0}if(e instanceof Date&&t instanceof Date)return e.getTime()===t.getTime();let n=Ft(e);if(n.length!==Ft(t).length)return!1;for(let r=0;r{if(typeof n!=`string`||n.trim().length===0)throw Error(t);return`${e}-${n}`}}var V=h();function Lt(e){return typeof e==`object`&&e?`base`in e?e.base:void 0:e}function Rt(e,t){if(e===t||Number.isNaN(e)&&Number.isNaN(t))return!0;if(!(e instanceof Object)||!(t instanceof Object))return!1;let n=Object.keys(e),{length:r}=n;if(r!==Object.keys(t).length)return!1;for(let i=0;i{r.current||=window.setTimeout(()=>{i(...e),r.current=null},t)},[t]),o=(0,B.useCallback)(()=>{r.current&&=(window.clearTimeout(r.current),null)},[]);return(0,B.useEffect)(()=>(n.autoInvoke&&a(),o),[o,a]),{start:a,clear:o}}function Ut(e){let t=(0,B.useRef)(void 0);return(0,B.useEffect)(()=>{t.current=e},[e]),t.current}function Wt(e,t,n){let r=(0,B.useRef)(null);(0,B.useEffect)(()=>{r.current&&=(r.current.disconnect(),null);let i=typeof n==`function`?n():n;return i&&(r.current=new MutationObserver(e),r.current.observe(i,t)),()=>{r.current&&=(r.current.disconnect(),null)}},[e,t,n])}function Gt(){let[e,t]=(0,B.useState)(!1);return(0,B.useEffect)(()=>t(!0),[]),e}function Kt(e){return typeof e==`string`||typeof e==`number`||typeof e==`boolean`||typeof e==`bigint`}function qt(e,t=document){let n=t.querySelector(e);if(n)return n;let r=t.querySelectorAll(`*`);for(let t=0;t{if(!e||!t||!n.current)return;let r=e.getBoundingClientRect(),i=t.getBoundingClientRect(),a=t.offsetWidth===0?1:i.width/t.offsetWidth,o=t.offsetHeight===0?1:i.height/t.offsetHeight,s=window.getComputedStyle(e),c=window.getComputedStyle(t),l=dt(s.borderTopWidth)+dt(c.borderTopWidth),u=dt(s.borderLeftWidth)+dt(c.borderLeftWidth),d={top:(r.top-i.top)/o-l,left:(r.left-i.left)/a-u,width:r.width/a,height:r.height/o};n.current.style.transform=`translateY(${d.top}px) translateX(${d.left}px)`,n.current.style.width=`${d.width}px`,n.current.style.height=`${d.height}px`},p=()=>{window.clearTimeout(o.current),n.current&&(n.current.style.transitionDuration=`0ms`),f(),o.current=window.setTimeout(()=>{n.current&&(n.current.style.transitionDuration=``)},30)},m=(0,B.useRef)(null),h=(0,B.useRef)(null);return(0,B.useEffect)(()=>{if(c&&s.current!==e&&i&&i(),s.current=e,f(),e)return m.current=new ResizeObserver(p),m.current.observe(e),t&&(h.current=new ResizeObserver(p),h.current.observe(t)),()=>{m.current?.disconnect(),h.current?.disconnect()}},[t,e]),(0,B.useEffect)(()=>{if(t){let e=e=>{Zt(e.target,t)&&(p(),d(!1))};return t.addEventListener(`transitionend`,e),()=>{t.removeEventListener(`transitionend`,e)}}},[t]),(0,B.useEffect)(()=>{if(n.current&&a){let e=e=>{e.propertyName===`transform`&&a()};return n.current.addEventListener(`transitionend`,e),()=>{n.current?.removeEventListener(`transitionend`,e)}}},[a]),Ht(()=>{St()!==`test`&&l(!0)},20,{autoInvoke:!0}),Wt(e=>{e.forEach(e=>{e.type===`attributes`&&e.attributeName===`dir`&&p()})},{attributes:!0,attributeFilter:[`dir`]},()=>document.documentElement),{initialized:c,hidden:u}}var $t={root:`m_96b553a6`},en=d((e,{transitionDuration:t},{shouldReduceMotion:n})=>({root:{"--transition-duration":e.respectReducedMotion&&n?`0ms`:typeof t==`number`?`${t}ms`:t||`150ms`}})),tn=u(n=>{let r=a(`FloatingIndicator`,null,n),{classNames:i,className:o,style:s,styles:c,unstyled:l,vars:u,target:d,parent:f,transitionDuration:m,mod:h,displayAfterTransitionEnd:g,onTransitionStart:_,onTransitionEnd:v,attributes:y,ref:b,...x}=r,C=p(),w=e({name:`FloatingIndicator`,classes:$t,props:r,className:o,style:s,classNames:i,styles:c,unstyled:l,attributes:y,vars:u,varsResolver:en,stylesCtx:{shouldReduceMotion:C}}),T=(0,B.useRef)(null),{initialized:E,hidden:D}=Qt({target:d,parent:f,ref:T,displayAfterTransitionEnd:g,onTransitionStart:_,onTransitionEnd:v}),O=S(b,T);return!d||!f?null:(0,V.jsx)(t,{ref:O,mod:[{initialized:E,hidden:D},h],...w(`root`),...x})});tn.displayName=`@mantine/core/FloatingIndicator`,tn.classes=$t,tn.varsResolver=en;var[nn,rn]=ut(`Accordion component was not found in the tree`),[an,on]=ut(`Accordion.Item component was not found in the tree`),sn={root:`m_9bdbb667`,panel:`m_df78851f`,content:`m_4ba554d4`,itemTitle:`m_8fa820a0`,control:`m_4ba585b8`,"control--default":`m_6939a5e9`,"control--contained":`m_4271d21b`,label:`m_df3ffa0f`,chevron:`m_3f35ae96`,icon:`m_9bd771fe`,item:`m_9bd7b098`,"item--default":`m_fe19b709`,"item--contained":`m_1f921b3b`,"item--filled":`m_2cdf939a`,"item--separated":`m_9f59b069`},cn=u(e=>{let{classNames:n,className:r,style:i,styles:o,vars:s,chevron:l,icon:u,onClick:d,onKeyDown:f,children:p,disabled:m,mod:h,...g}=a(`AccordionControl`,null,e),{value:_}=on(),v=rn(),y=v.isItemActive(_),b=typeof v.order==`number`,x=`h${v.order}`,S=(0,V.jsxs)(c,{...v.getStyles(`control`,{className:r,classNames:n,style:i,styles:o,variant:v.variant}),unstyled:v.unstyled,mod:[`accordion-control`,{active:y,"chevron-position":v.chevronPosition,disabled:m},h],onClick:e=>{d?.(e),v.onChange(_)},type:`button`,disabled:m,"aria-expanded":y,"aria-controls":v.getRegionId(_),id:v.getControlId(_),onKeyDown:ge({siblingSelector:`[data-accordion-control]`,parentSelector:`[data-accordion]`,activateOnFocus:!1,loop:v.loop,orientation:`vertical`,onKeyDown:f}),...g,children:[(0,V.jsx)(t,{component:`span`,mod:{rotate:!v.disableChevronRotation&&y,position:v.chevronPosition},...v.getStyles(`chevron`,{classNames:n,styles:o}),children:l||v.chevron}),(0,V.jsx)(`span`,{...v.getStyles(`label`,{classNames:n,styles:o}),children:p}),u&&(0,V.jsx)(t,{component:`span`,mod:{"chevron-position":v.chevronPosition},...v.getStyles(`icon`,{classNames:n,styles:o}),children:u})]});return b?(0,V.jsx)(x,{...v.getStyles(`itemTitle`,{classNames:n,styles:o}),children:S}):S});cn.displayName=`@mantine/core/AccordionControl`,cn.classes=sn;var ln=u(e=>{let{classNames:n,className:r,style:i,styles:o,vars:s,value:c,mod:l,...u}=a(`AccordionItem`,null,e),d=rn();return(0,V.jsx)(an,{value:{value:c},children:(0,V.jsx)(t,{mod:[{active:d.isItemActive(c)},l],...d.getStyles(`item`,{className:r,classNames:n,styles:o,style:i,variant:d.variant}),...u})})});ln.displayName=`@mantine/core/AccordionItem`,ln.classes=sn;var un=u(e=>{let{classNames:t,className:n,style:r,styles:i,vars:o,children:s,keepMounted:c,keepMountedMode:l,...u}=a(`AccordionPanel`,null,e),{value:d}=on(),f=rn();return(0,V.jsx)(At,{...f.getStyles(`panel`,{className:n,classNames:t,style:r,styles:i}),expanded:f.isItemActive(d),transitionDuration:f.transitionDuration??200,role:`region`,id:f.getRegionId(d),"aria-labelledby":f.getControlId(d),keepMounted:c??f.keepMounted,keepMountedMode:l??f.keepMountedMode,...u,children:(0,V.jsx)(`div`,{...f.getStyles(`content`,{classNames:t,styles:i}),children:s})})});un.displayName=`@mantine/core/AccordionPanel`,un.classes=sn;var dn={multiple:!1,loop:!0,disableChevronRotation:!1,disableCollapse:!1,chevronPosition:`right`,variant:`default`,chevronSize:`auto`,chevronIconSize:16,keepMountedMode:`activity`},fn=d((e,{transitionDuration:t,chevronSize:n,radius:r})=>({root:{"--accordion-transition-duration":t===void 0?void 0:`${t}ms`,"--accordion-chevron-size":n===void 0?void 0:w(n),"--accordion-radius":r===void 0?void 0:N(r)}})),pn=r(n=>{let r=a(`Accordion`,dn,n),{classNames:i,className:o,style:s,styles:c,unstyled:l,vars:u,children:d,multiple:f,value:p,defaultValue:m,onChange:h,id:g,loop:_,transitionDuration:v,disableChevronRotation:y,disableCollapse:b,chevronPosition:x,chevronSize:S,order:C,chevron:w,variant:T,radius:E,chevronIconSize:D,attributes:O,keepMounted:k,keepMountedMode:A,...j}=r,M=L(g),[N,P]=se({value:p,defaultValue:m,finalValue:f?[]:null,onChange:h}),F=e=>Array.isArray(N)?N.includes(e):e===N,I=e=>{if(!Array.isArray(N)&&b&&e===N)return;let t=Array.isArray(N)?N.includes(e)?N.filter(t=>t!==e):[...N,e]:e===N?null:e;P(t)},ee=e({name:`Accordion`,classes:sn,props:r,className:o,style:s,classNames:i,styles:c,unstyled:l,attributes:O,vars:u,varsResolver:fn});return(0,V.jsx)(nn,{value:{isItemActive:F,onChange:I,getControlId:It(`${M}-control`,`Accordion.Item component was rendered with invalid value or without value`),getRegionId:It(`${M}-panel`,`Accordion.Item component was rendered with invalid value or without value`),chevron:w===null?null:w||(0,V.jsx)(Ee,{size:D}),transitionDuration:v,disableChevronRotation:y,chevronPosition:x,order:C,loop:_,getStyles:ee,variant:T,unstyled:l,keepMounted:k,keepMountedMode:A},children:(0,V.jsx)(t,{...ee(`root`),id:M,...j,variant:T,"data-accordion":!0,children:d})})});pn.classes=sn,pn.varsResolver=fn,pn.displayName=`@mantine/core/Accordion`,pn.Item=ln,pn.Panel=un,pn.Control=cn,pn.Chevron=Ee;function mn(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=>mn(e))}:typeof e==`number`||typeof e==`bigint`||typeof e==`boolean`?{value:e,label:`${e}`}:e}function hn(e){return e?e.map(e=>mn(e)):[]}function gn(e){return e.reduce((e,t)=>`group`in t?{...e,...gn(t.items)}:(e[`${t.value}`]=t,e),{})}var _n={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`},vn={error:null},yn=d((e,{size:t,color:n})=>({chevron:{"--combobox-chevron-size":b(t,`combobox-chevron-size`),"--combobox-chevron-color":n?i(n,e):void 0}})),bn=u(n=>{let r=a(`ComboboxChevron`,vn,n),{size:i,error:o,style:s,className:c,classNames:l,styles:u,unstyled:d,vars:f,attributes:p,mod:m,...h}=r,g=e({name:`ComboboxChevron`,classes:_n,props:r,style:s,className:c,classNames:l,styles:u,unstyled:d,vars:f,varsResolver:yn,attributes:p,rootSelector:`chevron`});return(0,V.jsx)(t,{component:`svg`,...h,...g(`chevron`),size:i,viewBox:`0 0 15 15`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,mod:[`combobox-chevron`,{error:o},m],children:(0,V.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`})})});bn.classes=_n,bn.varsResolver=yn,bn.displayName=`@mantine/core/ComboboxChevron`;var[xn,Sn]=ut(`Combobox component was not found in tree`);function Cn({onMouseDown:e,onClick:t,onClear:n,...r}){return(0,V.jsx)(E.ClearButton,{tabIndex:-1,"aria-hidden":!0,...r,onMouseDown:t=>{t.preventDefault(),e?.(t)},onClick:e=>{n(),t?.(e)}})}Cn.displayName=`@mantine/core/ComboboxClearButton`;var wn=u(e=>{let{classNames:t,styles:n,className:r,style:i,hidden:o,...s}=a(`ComboboxDropdown`,null,e),c=Sn();return(0,V.jsx)(Qe.Dropdown,{...s,role:`presentation`,"data-hidden":o||void 0,"data-floating-height":c.floatingHeight||void 0,...c.getStyles(`dropdown`,{className:r,style:i,classNames:t,styles:n})})});wn.classes=_n,wn.displayName=`@mantine/core/ComboboxDropdown`;var Tn={refProp:`ref`},En=u(e=>{let{children:t,refProp:n,ref:r}=a(`ComboboxDropdownTarget`,Tn,e);if(Sn(),!st(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,V.jsx)(Qe.Target,{ref:r,refProp:n,children:t})});En.displayName=`@mantine/core/ComboboxDropdownTarget`;var Dn=u(e=>{let{classNames:n,className:r,style:i,styles:o,vars:s,...c}=a(`ComboboxEmpty`,null,e),l=Sn();return(0,V.jsx)(t,{...l.getStyles(`empty`,{className:r,classNames:n,styles:o,style:i}),...c})});Dn.classes=_n,Dn.displayName=`@mantine/core/ComboboxEmpty`;function On({onKeyDown:e,onClick:t,withKeyboardNavigation:n,withAriaAttributes:r,withExpandedAttribute:i,targetType:a,autoComplete:o}){let s=Sn(),[c,l]=(0,B.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 kn={refProp:`ref`,targetType:`input`,withKeyboardNavigation:!0,withAriaAttributes:!0,withExpandedAttribute:!1,autoComplete:`off`},An=u(e=>{let{children:t,refProp:n,withKeyboardNavigation:r,withAriaAttributes:i,withExpandedAttribute:o,targetType:s,autoComplete:c,ref:l,...u}=a(`ComboboxEventsTarget`,kn,e),d=ct(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=Sn(),p=On({targetType:s,withAriaAttributes:i,withKeyboardNavigation:r,withExpandedAttribute:o,onKeyDown:d.props.onKeyDown,onClick:d.props.onClick,autoComplete:c});return(0,B.cloneElement)(d,{...p,...u,[n]:S(l,f.store.targetRef,lt(d))})});An.displayName=`@mantine/core/ComboboxEventsTarget`;var jn=u(e=>{let{classNames:n,className:r,style:i,styles:o,vars:s,...c}=a(`ComboboxFooter`,null,e),l=Sn();return(0,V.jsx)(t,{...l.getStyles(`footer`,{className:r,classNames:n,style:i,styles:o}),...c,onMouseDown:e=>{e.preventDefault()}})});jn.classes=_n,jn.displayName=`@mantine/core/ComboboxFooter`;var Mn=u(e=>{let{classNames:n,className:r,style:i,styles:o,vars:s,children:c,label:l,id:u,...d}=a(`ComboboxGroup`,null,e),f=Sn(),p=L(u),m=l!=null&&l!==!1&&l!==``;return(0,V.jsxs)(t,{role:`group`,"aria-labelledby":m?p:void 0,...f.getStyles(`group`,{className:r,classNames:n,style:i,styles:o}),...d,children:[m&&(0,V.jsx)(`div`,{id:p,...f.getStyles(`groupLabel`,{classNames:n,styles:o}),children:l}),c]})});Mn.classes=_n,Mn.displayName=`@mantine/core/ComboboxGroup`;var Nn=u(e=>{let{classNames:n,className:r,style:i,styles:o,vars:s,...c}=a(`ComboboxHeader`,null,e),l=Sn();return(0,V.jsx)(t,{...l.getStyles(`header`,{className:r,classNames:n,style:i,styles:o}),...c,onMouseDown:e=>{e.preventDefault()}})});Nn.classes=_n,Nn.displayName=`@mantine/core/ComboboxHeader`;function Pn({value:e,valuesDivider:t=`,`,...n}){return(0,V.jsx)(`input`,{type:`hidden`,value:Array.isArray(e)?e.join(t):e?`${e}`:``,...n})}Pn.displayName=`@mantine/core/ComboboxHiddenInput`;var Fn=u(e=>{let n=a(`ComboboxOption`,null,e),{classNames:r,className:i,style:o,styles:s,vars:c,onClick:l,id:u,active:d,onMouseDown:f,onMouseOver:p,disabled:m,selected:h,mod:g,..._}=n,v=Sn(),y=(0,B.useId)(),b=u||y;return(0,V.jsx)(t,{...v.getStyles(`option`,{className:i,classNames:r,styles:s,style:o}),"aria-disabled":m||void 0,..._,id:b,mod:[`combobox-option`,{"combobox-active":d,"combobox-disabled":m,"combobox-selected":h},g],role:`option`,onClick:e=>{m?e.preventDefault():(v.onOptionSubmit?.(n.value,n),l?.(e))},onMouseDown:e=>{e.preventDefault(),f?.(e)},onMouseOver:e=>{v.resetSelectionOnOptionHover&&v.store.resetSelectedOption(),p?.(e)}})});Fn.classes=_n,Fn.displayName=`@mantine/core/ComboboxOption`;var In=u(e=>{let{classNames:n,className:r,style:i,styles:o,id:s,onMouseDown:c,labelledBy:l,...u}=a(`ComboboxOptions`,null,e),d=Sn(),f=L(s);return(0,B.useEffect)(()=>{d.store.setListId(f)},[f]),(0,V.jsx)(t,{...d.getStyles(`options`,{className:r,style:i,classNames:n,styles:o}),...u,id:f,role:`listbox`,"aria-labelledby":l,onMouseDown:e=>{e.preventDefault(),c?.(e)}})});In.classes=_n,In.displayName=`@mantine/core/ComboboxOptions`;var Ln={withAriaAttributes:!0,withKeyboardNavigation:!0},Rn=u(e=>{let{classNames:t,styles:n,unstyled:r,vars:i,withAriaAttributes:o,onKeyDown:s,onClick:c,withKeyboardNavigation:l,size:u,ref:d,...f}=a(`ComboboxSearch`,Ln,e),p=Sn(),m=p.getStyles(`search`),h=On({targetType:`input`,withAriaAttributes:o,withKeyboardNavigation:l,withExpandedAttribute:!1,onKeyDown:s,onClick:c,autoComplete:`off`});return(0,V.jsx)(E,{ref:S(d,p.store.searchRef),classNames:[{input:m.className},t],styles:[{input:m.style},n],size:u||p.size,...h,...f,__staticSelector:`Combobox`})});Rn.classes=_n,Rn.displayName=`@mantine/core/ComboboxSearch`;var zn={refProp:`ref`,targetType:`input`,withKeyboardNavigation:!0,withAriaAttributes:!0,withExpandedAttribute:!1,autoComplete:`off`},Bn=u(e=>{let{children:t,refProp:n,withKeyboardNavigation:r,withAriaAttributes:i,withExpandedAttribute:o,targetType:s,autoComplete:c,ref:l,...u}=a(`ComboboxTarget`,zn,e),d=ct(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=Sn(),p=On({targetType:s,withAriaAttributes:i,withKeyboardNavigation:r,withExpandedAttribute:o,onKeyDown:d.props.onKeyDown,onClick:d.props.onClick,autoComplete:c}),m=(0,B.cloneElement)(d,{...p,...u});return(0,V.jsx)(Qe.Target,{refProp:n,ref:S(l,f.store.targetRef),children:m})});Bn.displayName=`@mantine/core/ComboboxTarget`;function Vn(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 Hn(e,t,n){for(let n=e+1;n{s||(c(!0),i?.(e))},[c,i,s]),_=(0,B.useCallback)((e=`unknown`)=>{s&&(c(!1),r?.(e))},[c,r,s]),v=(0,B.useCallback)((e=`unknown`)=>{s?_(e):g(e)},[_,g,s]),y=(0,B.useCallback)(()=>{let e=Yt(f.current);qt(`#${l.current} [data-combobox-selected]`,e)?.removeAttribute(`data-combobox-selected`)},[]),b=(0,B.useCallback)(e=>{let t=Yt(f.current),n=qt(`#${l.current}`,t),r=n?Jt(`[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].scrollIntoView({block:`nearest`,behavior:o}),r[i].id):null},[o,y]),x=(0,B.useCallback)(()=>{let e=Yt(f.current),t=qt(`#${l.current} [data-combobox-active]`,e);if(t){let n=Jt(`#${l.current} [data-combobox-option]`,e).findIndex(e=>e===t);return b(n)}return b(0)},[b]),S=(0,B.useCallback)(()=>{let e=Yt(f.current),t=Jt(`#${l.current} [data-combobox-option]`,e);return b(Hn(u.current,t,a))},[b,a]),C=(0,B.useCallback)(()=>{let e=Yt(f.current),t=Jt(`#${l.current} [data-combobox-option]`,e);return b(Vn(u.current,t,a))},[b,a]),w=(0,B.useCallback)(()=>{let e=Yt(f.current),t=Jt(`#${l.current} [data-combobox-option]`,e);return b(Un(t))},[b]),T=(0,B.useCallback)((e=`selected`,t)=>{if(typeof e==`number`){u.current=e;let n=Yt(f.current),r=Jt(`#${l.current} [data-combobox-option]`,n);t?.scrollIntoView&&r[e]?.scrollIntoView({block:`nearest`,behavior:o});return}h.current=window.setTimeout(()=>{let n=Yt(f.current),r=Jt(`#${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,B.useCallback)(()=>{u.current=-1,y()},[y]),D=(0,B.useCallback)(()=>{let e=Yt(f.current);(Jt(`#${l.current} [data-combobox-option]`,e)?.[u.current])?.click()},[]),O=(0,B.useCallback)(e=>{l.current=e},[]),k=(0,B.useCallback)(()=>{p.current=window.setTimeout(()=>d.current?.focus(),0)},[]),A=(0,B.useCallback)(()=>{m.current=window.setTimeout(()=>f.current?.focus(),0)},[]),j=(0,B.useCallback)(()=>u.current,[]);return(0,B.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 Gn={keepMounted:!0,keepMountedMode:`display-none`,withinPortal:!0,resetSelectionOnOptionHover:!1,width:`target`,transitionProps:{transition:`fade`,duration:0},size:`sm`},Kn=d((e,{size:t,dropdownPadding:n})=>({options:{"--combobox-option-fz":_(t),"--combobox-option-padding":b(t,`combobox-option-padding`)},dropdown:{"--combobox-padding":n===void 0?void 0:w(n),"--combobox-option-fz":_(t),"--combobox-option-padding":b(t,`combobox-option-padding`)}})),qn=t=>{let n=a(`Combobox`,Gn,t),{classNames:r,styles:i,unstyled:o,children:s,store:c,vars:l,onOptionSubmit:u,onClose:d,size:f,dropdownPadding:p,resetSelectionOnOptionHover:m,__staticSelector:h,readOnly:g,attributes:_,floatingHeight:v,middlewares:y,...b}=n,x=v===`viewport`?{...y,flip:!1,size:{...typeof y?.size==`object`?y.size:{},padding:typeof y?.size==`object`&&y.size.padding!==void 0?y.size.padding:10,apply:({availableHeight:e,availableWidth:t,elements:n,...r})=>{n.floating.style.setProperty(`--combobox-floating-max-height`,`${e}px`);let i=y?.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`})}}}:y,S=Wn(),C=c||S,w=e({name:h||`Combobox`,classes:_n,props:n,classNames:r,styles:i,unstyled:o,attributes:_,vars:l,varsResolver:Kn}),T=()=>{d?.(),C.closeDropdown()};return(0,V.jsx)(xn,{value:{getStyles:w,store:C,onOptionSubmit:u,size:f,resetSelectionOnOptionHover:m,readOnly:g,floatingHeight:v},children:(0,V.jsx)(Qe,{opened:C.dropdownOpened,...b,middlewares:x,onChange:e=>!e&&T(),withRoles:!1,unstyled:o,children:s})})};qn.extend=e=>e,qn.classes=_n,qn.varsResolver=Kn,qn.displayName=`@mantine/core/Combobox`,qn.Target=Bn,qn.Dropdown=wn,qn.Options=In,qn.Option=Fn,qn.Search=Rn,qn.Empty=Dn,qn.Chevron=bn,qn.Footer=jn,qn.Header=Nn,qn.EventsTarget=An,qn.DropdownTarget=En,qn.Group=Mn,qn.ClearButton=Cn,qn.HiddenInput=Pn;function Jn({children:e,role:t}){let n=(0,B.use)(T);return n?(0,V.jsx)(`div`,{role:t,"aria-labelledby":n.labelId,"aria-describedby":n.describedBy,children:e}):(0,V.jsx)(V.Fragment,{children:e})}var Yn={root:`m_5f75b09e`,body:`m_5f6e695e`,labelWrapper:`m_d3ea56bb`,label:`m_8ee546b8`,description:`m_328f68c0`,error:`m_8e8a99cc`},Xn=Yn;function Zn({__staticSelector:n,__stylesApiProps:r,className:i,classNames:a,styles:o,unstyled:s,children:c,label:l,description:u,id:d,disabled:f,error:p,size:m,labelPosition:h=`left`,bodyElement:g=`div`,labelElement:v=`label`,variant:y,style:x,vars:S,mod:C,attributes:w,...T}){let D=e({name:n,props:r,className:i,style:x,classes:Yn,classNames:a,styles:o,unstyled:s,attributes:w}),O=u?`${d}-description`:void 0,k=p&&typeof p!=`boolean`?`${d}-error`:void 0;return(0,V.jsx)(t,{...D(`root`),__vars:{"--label-fz":_(m),"--label-lh":b(m,`label-lh`)},mod:[{"label-position":h},C],variant:y,size:m,...T,children:(0,V.jsxs)(t,{component:g,htmlFor:g===`label`?d:void 0,...D(`body`),children:[c,(0,V.jsxs)(`div`,{...D(`labelWrapper`),"data-disabled":f||void 0,children:[l&&(0,V.jsx)(t,{component:v,htmlFor:v===`label`?d:void 0,...D(`label`),"data-disabled":f||void 0,children:l}),u&&(0,V.jsx)(E.Description,{id:O,size:m,__inheritStyles:!1,...D(`description`),children:u}),p&&typeof p!=`boolean`&&(0,V.jsx)(E.Error,{id:k,size:m,__inheritStyles:!1,...D(`error`),children:p})]})]})})}Zn.displayName=`@mantine/core/InlineInput`;function Qn(e){return`group`in e}function $n({options:e,search:t,limit:n}){let r=t.trim().toLowerCase(),i=[];for(let a=0;a0)return!1;return!0}function tr(e,t=new Set){if(Array.isArray(e))for(let n of e)if(Qn(n))tr(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 nr(e,t){return Array.isArray(e)?e.includes(t):e===t}function rr({data:e,withCheckIcon:t,withAlignedLabels:n,value:r,checkIconPosition:i,unstyled:a,renderOption:o}){if(!Qn(e)){let s=nr(r,e.value),c=t&&(s?(0,V.jsx)(Se,{className:_n.optionsDropdownCheckIcon}):n?(0,V.jsx)(`div`,{className:_n.optionsDropdownCheckPlaceholder}):null),l=(0,V.jsxs)(V.Fragment,{children:[i===`left`&&c,(0,V.jsx)(`span`,{children:e.label}),i===`right`&&c]});return(0,V.jsx)(qn.Option,{value:e.value,disabled:e.disabled,className:f({[_n.optionsDropdownOption]:!a}),"data-reverse":i===`right`||void 0,"data-checked":s||void 0,"aria-selected":s,active:s,children:typeof o==`function`?o({option:e,checked:s}):l})}let s=e.items.map(e=>(0,V.jsx)(rr,{data:e,value:r,unstyled:a,withCheckIcon:t,withAlignedLabels:n,checkIconPosition:i,renderOption:o},`${e.value}`));return(0,V.jsx)(qn.Group,{label:e.group,children:s})}function ir({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=Sn();tr(e);let x=typeof i==`string`?(r||$n)({options:e,search:l?i:``,limit:a??1/0}):e,S=er(x),C=x.map((e,t)=>(0,V.jsx)(rr,{data:e,withCheckIcon:u,withAlignedLabels:d,value:f,checkIconPosition:p,unstyled:h,renderOption:_},Qn(e)?`group-${typeof e.group==`string`?e.group:t}`:`${e.value}`));return(0,V.jsx)(qn.Dropdown,{hidden:t||n&&S,"data-composed":!0,children:(0,V.jsxs)(qn.Options,{labelledBy:g,"aria-label":y,children:[c?(0,V.jsx)(ft.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,V.jsx)(qn.Empty,{children:m})]})})}function ar(e,t,n,r){if(t===n||r===`before`&&n===t+1||r===`after`&&n===t-1)return e;let i=e.slice(),[a]=i.splice(t,1),o=t{let t=e.lastElementChild;return t?t instanceof HTMLInputElement?t:t.querySelector(`input`):null},sr=(e,t)=>{if(e===t)return!0;if(e.length!==t.length)return!1;for(let n=0;n{let e=i.current;e&&(i.current=null,sr(o.current,e.expectedValue)&&e.container?.querySelector(`[data-mantine-pill-index="${e.index}"]`)?.focus())});let s=(0,B.useCallback)(e=>{a.current=e},[]);return{getPillProps:e=>{if(n)return{draggable:!0,tabIndex:-1,"data-mantine-pill-index":e,"aria-keyshortcuts":`Alt+ArrowLeft Alt+ArrowRight`,onMouseDown:e=>{e.button===0&&e.stopPropagation()},onDragStart:t=>{t.stopPropagation(),t.dataTransfer.effectAllowed=`move`,t.dataTransfer.setData(`text/plain`,String(e)),r.current.draggedIndex=e;let n=t.currentTarget,i=n.getBoundingClientRect(),a=n.cloneNode(!0);a.removeAttribute(`data-dragging`),a.removeAttribute(`data-drag-over`),a.style.position=`fixed`,a.style.top=`-9999px`,a.style.left=`-9999px`,a.style.width=`${i.width}px`,a.style.height=`${i.height}px`,a.style.pointerEvents=`none`,document.body.appendChild(a),t.dataTransfer.setDragImage(a,t.clientX-i.left,t.clientY-i.top),setTimeout(()=>a.parentNode?.removeChild(a),0),requestAnimationFrame(()=>{n.setAttribute(`data-dragging`,`true`)})},onDragOver:t=>{let{draggedIndex:n}=r.current;if(n===null||n===e)return;let i=t.currentTarget,a=i.getBoundingClientRect(),o=t.clientX-a.left,s=(getComputedStyle(i).direction===`rtl`?o>a.width/2:o{let t=e.currentTarget,n=e.relatedTarget;n&&t.contains(n)||(t.removeAttribute(`data-drag-over`),r.current.currentDropTarget===t&&(r.current.currentDropTarget=null))},onDrop:n=>{n.preventDefault(),n.stopPropagation();let i=n.currentTarget,a=i.getAttribute(`data-drag-over`);i.removeAttribute(`data-drag-over`);let{draggedIndex:s}=r.current;if(s!==null&&a&&s!==e){let n=ar(o.current,s,e,a);n!==o.current&&t(n)}r.current.draggedIndex=null,r.current.currentDropTarget=null},onDragEnd:e=>{e.currentTarget.removeAttribute(`data-dragging`);let t=r.current.currentDropTarget;t&&t.removeAttribute(`data-drag-over`),r.current.draggedIndex=null,r.current.currentDropTarget=null},onKeyDown:n=>{if(n.key!==`ArrowLeft`&&n.key!==`ArrowRight`)return;let r=n.currentTarget,a=getComputedStyle(r).direction===`rtl`?n.key===`ArrowLeft`:n.key===`ArrowRight`,s=a?e+1:e-1;if(n.altKey){if(s<0||s>=o.current.length)return;n.preventDefault(),n.stopPropagation();let c=a?`after`:`before`,l=ar(o.current,e,s,c);if(l===o.current)return;i.current={container:r.parentElement,index:s,expectedValue:l},t(l);return}if(s<0)return;let c=r.parentElement;if(c){if(n.preventDefault(),n.stopPropagation(),s>=o.current.length){or(c)?.focus();return}c.querySelector(`[data-mantine-pill-index="${s}"]`)?.focus()}}}},getListProps:()=>n?{ref:s}:{},handleInputKeyDown:e=>{if(!n||e.key!==`ArrowLeft`)return;let t=e.currentTarget;if(!(t.value.length===0||t.selectionStart===0&&t.selectionEnd===0))return;let r=a.current;if(!r)return;let i=r.querySelectorAll(`[data-mantine-pill-index]`);i.length!==0&&(e.preventDefault(),i[i.length-1].focus())}}}function lr({id:e,label:t,labelProps:n,inputWrapperOrder:r}){if(t&&(!r||r.includes(`label`)))return n?.id||`${e}-label`}function ur(e){let t=e.currentTarget;return Yt(t).activeElement!==t}var dr=(0,B.createContext)(null),fr={root:`m_7cda1cd6`,"root--default":`m_44da308b`,"root--contrast":`m_e3a01f8`,label:`m_1e0e6180`,remove:`m_ae386778`,group:`m_1dcfd90b`},pr=(0,B.createContext)(null),mr=d((e,{gap:t},{size:n})=>({group:{"--pg-gap":t===void 0?b(n,`pg-gap`):b(t)}})),hr=u(n=>{let r=a(`PillGroup`,null,n),{classNames:i,className:o,style:s,styles:c,unstyled:l,vars:u,size:d,disabled:f,attributes:p,...m}=r,h=(0,B.use)(dr)?.size||d||void 0,g=e({name:`PillGroup`,classes:fr,props:r,className:o,style:s,classNames:i,styles:c,unstyled:l,attributes:p,vars:u,varsResolver:mr,stylesCtx:{size:h},rootSelector:`group`});return(0,V.jsx)(pr,{value:{size:h,disabled:f},children:(0,V.jsx)(t,{size:h,...g(`group`),...m})})});hr.classes=fr,hr.varsResolver=mr,hr.displayName=`@mantine/core/PillGroup`;var gr={variant:`default`},_r=d((e,{radius:t},{size:n})=>({root:{"--pill-fz":b(n,`pill-fz`),"--pill-height":b(n,`pill-height`),"--pill-radius":t===void 0?void 0:N(t)}})),vr=u(n=>{let r=a(`Pill`,gr,n),{classNames:i,className:o,style:s,styles:c,unstyled:l,vars:u,variant:d,children:f,withRemoveButton:p,onRemove:m,removeButtonProps:h,radius:g,size:_,disabled:v,mod:y,attributes:b,...x}=r,S=(0,B.use)(pr),C=(0,B.use)(dr),w=_||S?.size||void 0,T=C?.variant===`filled`?`contrast`:d||`default`,E=e({name:`Pill`,classes:fr,props:r,className:o,style:s,classNames:i,styles:c,unstyled:l,attributes:b,vars:u,varsResolver:_r,stylesCtx:{size:w}});return(0,V.jsxs)(t,{component:`span`,variant:T,size:w,...E(`root`,{variant:T}),mod:[{"with-remove":p&&!v,disabled:v||S?.disabled},y],...x,children:[(0,V.jsx)(`span`,{...E(`label`),children:f}),p&&(0,V.jsx)(ne,{variant:`transparent`,radius:g,tabIndex:-1,"aria-hidden":!0,unstyled:l,...h,...E(`remove`,{className:h?.className,style:h?.style}),onMouseDown:e=>{e.preventDefault(),e.stopPropagation(),h?.onMouseDown?.(e)},onClick:e=>{e.stopPropagation(),m?.(),h?.onClick?.(e)}})]})});vr.classes=fr,vr.varsResolver=_r,vr.displayName=`@mantine/core/Pill`,vr.Group=hr;var yr={field:`m_45c4369d`},br={type:`visible`},xr=u(n=>{let r=a(`PillsInputField`,br,n),{classNames:i,className:o,style:s,styles:c,unstyled:l,vars:u,type:d,disabled:f,id:p,pointer:m,mod:h,attributes:g,ref:_,...v}=r,y=(0,B.use)(dr),b=(0,B.use)(T),x=e({name:`PillsInputField`,classes:yr,props:r,className:o,style:s,classNames:i,styles:c,unstyled:l,attributes:g,rootSelector:`field`}),C=f||y?.disabled;return(0,V.jsx)(t,{component:`input`,ref:S(_,y?.fieldRef),"data-type":d,disabled:C,mod:[{disabled:C,pointer:m},h],...x(`field`),...v,id:b?.inputId||p,"aria-invalid":y?.hasError,"aria-describedby":b?.describedBy,type:`text`,onMouseDown:e=>!m&&e.stopPropagation()})});xr.classes=yr,xr.displayName=`@mantine/core/PillsInputField`;var Sr={size:`sm`},Cr=u(e=>{let{children:t,onMouseDown:n,onClick:r,size:i,disabled:o,__staticSelector:s,error:c,variant:l,...u}=a([`Input`,`InputWrapper`,`PillsInput`],Sr,e),d=(0,B.useRef)(null);return(0,V.jsx)(dr,{value:{fieldRef:d,size:i,disabled:o,hasError:!!c,variant:l},children:(0,V.jsx)(A,{size:i,error:c,variant:l,component:`div`,"data-no-overflow":!0,onMouseDown:e=>{e.preventDefault(),n?.(e),d.current?.focus()},onClick:e=>{e.preventDefault(),e.currentTarget.closest(`fieldset`)?.disabled||(d.current?.focus(),r?.(e))},...u,multiline:!0,disabled:o,__staticSelector:s||`PillsInput`,withAria:!1,children:t})})});Cr.displayName=`@mantine/core/PillsInput`,Cr.classes=A.classes,Cr.Field=xr;function wr(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}function Tr(e){return typeof e==`string`?e.trim().toLowerCase():e}function Er({data:e,value:t}){let n=t.map(Tr);return e.reduce((e,t)=>(Qn(t)?e.push({group:t.group,items:t.items.filter(e=>n.indexOf(Tr(e.value))===-1)}):n.indexOf(Tr(t.value))===-1&&e.push(t),e),[])}var Dr={xs:41,sm:50,md:60,lg:72,xl:89},Or={maxValues:1/0,withCheckIcon:!0,checkIconPosition:`left`,hiddenInputValuesDivider:`,`,clearSearchOnChange:!0,openOnFocus:!0,size:`sm`},kr=r(t=>{let n=a([`Input`,`InputWrapper`,`MultiSelect`],Or,t),{classNames:r,className:i,style:s,styles:c,unstyled:l,vars:u,size:d,value:f,defaultValue:p,onChange:m,onKeyDown:h,variant:g,data:_,dropdownOpened:v,defaultDropdownOpened:y,onDropdownOpen:b,onDropdownClose:x,selectFirstOptionOnChange:S,selectFirstOptionOnDropdownOpen:C,onOptionSubmit:w,comboboxProps:T,filter:E,limit:O,withScrollArea:k,maxDropdownHeight:A,floatingHeight:j,searchValue:M,defaultSearchValue:N,onSearchChange:P,readOnly:F,disabled:I,onFocus:ee,onBlur:te,radius:ne,rightSection:re,rightSectionWidth:ie,rightSectionPointerEvents:ae,rightSectionProps:R,leftSection:oe,leftSectionWidth:z,leftSectionPointerEvents:ce,leftSectionProps:le,inputContainer:ue,inputWrapperOrder:de,withAsterisk:fe,labelProps:pe,descriptionProps:me,errorProps:he,successProps:ge,wrapperProps:_e,description:ve,label:ye,error:be,success:xe,maxValues:Se,searchable:Ce,nothingFoundMessage:we,withCheckIcon:Te,withAlignedLabels:Ee,checkIconPosition:De,hidePickedOptions:Oe,withErrorStyles:ke,withSuccessStyles:Ae,name:je,form:Me,id:Ne,clearable:Pe,clearSectionMode:Fe,clearButtonProps:Ie,hiddenInputProps:Le,placeholder:Re,hiddenInputValuesDivider:ze,required:Be,mod:Ve,renderOption:He,renderPill:Ue,onRemove:We,onClear:Ge,onMaxValues:Ke,scrollAreaProps:qe,chevronColor:Je,attributes:Ye,clearSearchOnChange:Xe,openOnFocus:Ze,loading:Qe,loadingPosition:$e,withPillsReorder:et,...tt}=n,nt=L(Ne),rt=lr({id:nt,label:ye,labelProps:pe,inputWrapperOrder:de}),it=hn(_),at=gn(it),ot=(0,B.useRef)({}),st=Wn({opened:v,defaultOpened:y,onDropdownOpen:()=>{b?.(),C&&st.selectFirstOption()},onDropdownClose:()=>{x?.(),st.resetSelectedOption()}}),{styleProps:ct,rest:{type:lt,autoComplete:ut,...dt}}=o(tt),[ft,pt]=se({value:f,defaultValue:p,finalValue:[],onChange:m}),{getPillProps:mt,getListProps:ht,handleInputKeyDown:gt}=cr({value:ft,onChange:pt,enabled:et&&!I&&!F}),[_t,vt]=se({value:M,defaultValue:N,finalValue:``,onChange:P}),yt=e=>{vt(e),st.resetSelectedOption()},bt=e({name:`MultiSelect`,classes:{},props:n,classNames:r,styles:c,unstyled:l,attributes:Ye}),{resolvedClassNames:xt,resolvedStyles:St}=D({props:n,styles:c,classNames:r}),Ct=e=>{h?.(e),!e.defaultPrevented&&(e.key===` `&&!Ce&&(e.preventDefault(),st.toggleDropdown()),e.key===`Backspace`&&_t.length===0&&ft.length>0&&(We?.(ft[ft.length-1]),pt(ft.slice(0,ft.length-1))),gt(e))},wt=ft.map((e,t)=>{let n=at[`${e}`]||ot.current[`${e}`],r=mt(t);return Ue?(0,V.jsx)(B.Fragment,{children:Ue({option:n,value:e,onRemove:()=>{pt(ft.filter(t=>e!==t)),We?.(e)},disabled:I,reorderProps:r})},`${e}-${t}`):(0,V.jsx)(vr,{withRemoveButton:!F&&!at[`${e}`]?.disabled,onRemove:()=>{pt(ft.filter(t=>e!==t)),We?.(e)},unstyled:l,disabled:I,...bt(`pill`),...r,children:n?.label||e},`${e}-${t}`)});(0,B.useEffect)(()=>{S&&st.selectFirstOption()},[S,_t]),(0,B.useEffect)(()=>{ft.forEach(e=>{`${e}`in at&&(ot.current[`${e}`]=at[`${e}`])})},[at,ft]);let Tt=(0,V.jsx)(qn.ClearButton,{...Ie,onClear:()=>{Ge?.(),pt([]),yt(``)}}),Et=Er({data:it,value:ft}),Dt=Pe&&ft.length>0&&!I&&!F,Ot=Dt?{paddingInlineEnd:Dr[d]??Dr.sm}:void 0;return(0,V.jsxs)(V.Fragment,{children:[(0,V.jsxs)(qn,{store:st,classNames:xt,styles:St,unstyled:l,size:d,readOnly:F,__staticSelector:`MultiSelect`,attributes:Ye,floatingHeight:j,onOptionSubmit:e=>{w?.(e),Xe&&yt(``),st.updateSelectedOptionIndex(`selected`),ft.includes(at[`${e}`].value)?(pt(ft.filter(t=>t!==at[`${e}`].value)),We?.(at[`${e}`].value)):ft.lengthCe?st.openDropdown():st.toggleDropdown(),"data-expanded":st.dropdownOpened||void 0,id:nt,required:Be,mod:Ve,attributes:Ye,children:(0,V.jsxs)(vr.Group,{attributes:Ye,disabled:I,unstyled:l,...bt(`pillsList`,{style:Ot}),...ht(),children:[wt,(0,V.jsx)(qn.EventsTarget,{autoComplete:ut,withExpandedAttribute:!0,children:(0,V.jsx)(Cr.Field,{...dt,id:nt,placeholder:Re,type:!Ce&&!Re?`hidden`:`visible`,...bt(`inputField`),unstyled:l,onFocus:e=>{ee?.(e),Ze&&Ce&&st.openDropdown()},onBlur:e=>{te?.(e),st.closeDropdown(),yt(``)},onKeyDown:Ct,value:_t,onChange:e=>{if(ur(e)){if(!F){let t=wr(at,e.currentTarget.value);t&&!ft.includes(t.value)&&ft.length{let{classNames:n,className:r,style:i,styles:o,vars:s,...c}=a(`ProgressLabel`,null,e),l=jr();return(0,V.jsx)(t,{...l.getStyles(`label`,{className:r,style:i,classNames:n,styles:o}),...c})});Nr.classes=Mr,Nr.displayName=`@mantine/core/ProgressLabel`;var Pr=d((e,{size:t,radius:n,transitionDuration:r})=>({root:{"--progress-size":b(t,`progress-size`),"--progress-radius":n===void 0?void 0:N(n),"--progress-transition-duration":typeof r==`number`?`${r}ms`:void 0}})),Fr=u(n=>{let r=a(`ProgressRoot`,null,n),{classNames:i,className:o,style:s,styles:c,unstyled:l,vars:u,autoContrast:d,transitionDuration:f,orientation:p,attributes:m,mod:h,...g}=r,_=e({name:`Progress`,classes:Mr,props:r,className:o,style:s,classNames:i,styles:c,unstyled:l,attributes:m,vars:u,varsResolver:Pr});return(0,V.jsx)(Ar,{value:{getStyles:_,autoContrast:d},children:(0,V.jsx)(t,{mod:[{orientation:p},h],..._(`root`),...g})})});Fr.classes=Mr,Fr.varsResolver=Pr,Fr.displayName=`@mantine/core/ProgressRoot`;var Ir={withAria:!0},Lr=u(e=>{let{classNames:n,className:r,style:o,styles:c,vars:l,value:u,withAria:d,color:f,striped:p,animated:m,mod:h,...g}=a(`ProgressSection`,Ir,e),_=jr(),v=s(),y=d?{role:`progressbar`,"aria-valuemax":100,"aria-valuemin":0,"aria-valuenow":u,"aria-valuetext":`${u}%`}:{};return(0,V.jsx)(t,{..._.getStyles(`section`,{className:r,classNames:n,styles:c,style:o}),...g,...y,mod:[{striped:p||m,animated:m},h],__vars:{"--progress-section-size":`${u}%`,"--progress-section-color":i(f,v),"--progress-label-color":Xt(_.autoContrast,v)?Te({color:f,theme:v,autoContrast:_.autoContrast}):void 0}})});Lr.classes=Mr,Lr.displayName=`@mantine/core/ProgressSection`;var Rr=u(e=>{let t=a(`Progress`,null,e),{value:n,classNames:r,styles:i,vars:o,color:s,striped:c,animated:l,"aria-label":u,...d}=t,{resolvedClassNames:f,resolvedStyles:p}=D({classNames:r,styles:i,props:t});return(0,V.jsx)(Fr,{classNames:f,styles:p,vars:o,...d,children:(0,V.jsx)(Lr,{value:n,color:s,striped:c,animated:l,"aria-label":u})})});Rr.classes=Mr,Rr.displayName=`@mantine/core/Progress`,Rr.Section=Lr,Rr.Root=Fr,Rr.Label=Nr;var zr={root:`m_cf365364`,indicator:`m_9e182ccd`,label:`m_1738fcb2`,input:`m_1714d588`,control:`m_69686b9b`,innerLabel:`m_78882f40`},Br={withItemsBorders:!0},Vr=d((e,{radius:t,color:n,transitionDuration:r,size:a,transitionTimingFunction:o})=>({root:{"--sc-radius":t===void 0?void 0:N(t),"--sc-color":n?i(n,e):void 0,"--sc-shadow":n?void 0:`var(--mantine-shadow-xs)`,"--sc-transition-duration":r===void 0?void 0:`${r}ms`,"--sc-transition-timing-function":o,"--sc-padding":b(a,`sc-padding`),"--sc-font-size":_(a)}})),Hr=r(n=>{let r=a(`SegmentedControl`,Br,n),{classNames:i,className:o,style:c,styles:l,unstyled:u,vars:d,data:f,value:p,defaultValue:m,onChange:h,size:g,name:_,disabled:v,readOnly:y,fullWidth:b,orientation:x,radius:C,color:w,transitionDuration:T,transitionTimingFunction:E,variant:D,autoContrast:O,withItemsBorders:k,mod:A,attributes:j,ref:M,...N}=r,P=e({name:`SegmentedControl`,props:r,classes:zr,className:o,style:c,classNames:i,styles:l,unstyled:u,attributes:j,vars:d,varsResolver:Vr}),F=s(),I=f.map(e=>Kt(e)?{label:`${e}`,value:e}:e),ee=Gt(),[te,ne]=(0,B.useState)(0),[re,ie]=(0,B.useState)(null),[ae,R]=(0,B.useState)({}),oe=(e,t)=>{e!==null&&ae[t]!==e&&(ae[t]=e,R({...ae}))},[z,ce]=se({value:p,defaultValue:m,finalValue:Array.isArray(f)?I.find(e=>!e.disabled)?.value??f[0]?.value??null:null,onChange:h}),le=L(_),ue=I.map(e=>`${e.value}`),de=I.map(e=>(0,B.createElement)(t,{...P(`control`),mod:{active:z===e.value,orientation:x},key:`${e.value}`},(0,B.createElement)(`input`,{...P(`input`),disabled:v||e.disabled,type:`radio`,name:le,value:`${e.value}`,id:`${le}-${e.value}`,checked:z===e.value,onChange:()=>!y&&ce(e.value),"data-focus-ring":F.focusRing,key:`${e.value}-input`}),(0,B.createElement)(t,{component:`label`,...P(`label`),mod:{active:z===e.value&&!(v||e.disabled),disabled:v||e.disabled,"read-only":y},htmlFor:`${le}-${e.value}`,ref:t=>oe(t,`${e.value}`),__vars:{"--sc-label-color":w===void 0?void 0:Te({color:w,theme:F,autoContrast:O})},key:`${e.value}-label`},(0,V.jsx)(`span`,{...P(`innerLabel`),children:e.label})))),fe=S(M,ie);return Vt(()=>{ne(e=>e+1)},[f.length]),Vt(()=>{R(e=>{let t={};return ue.forEach(n=>{n in e&&(t[n]=e[n])}),Object.keys(t).length===Object.keys(e).length?e:t})},[ue]),f.length===0?null:(0,V.jsxs)(t,{...P(`root`),variant:D,size:g,ref:fe,mod:[{"full-width":b,orientation:x,initialized:ee,"with-items-borders":k},A],...N,role:`radiogroup`,"data-disabled":v,children:[z!==void 0&&(0,V.jsx)(tn,{target:ae[`${z}`],parent:re,component:`span`,transitionDuration:`var(--sc-transition-duration)`,...P(`indicator`)},te),de]})});Hr.classes=zr,Hr.varsResolver=Vr,Hr.displayName=`@mantine/core/SegmentedControl`;var Ur={size:`sm`,withCheckIcon:!0,allowDeselect:!0,checkIconPosition:`left`,openOnFocus:!0},Wr=r(e=>{let t=a([`Input`,`InputWrapper`,`Select`],Ur,e),{classNames:n,styles:r,unstyled:i,vars:o,dropdownOpened:s,defaultDropdownOpened:c,onDropdownClose:l,onDropdownOpen:u,onFocus:d,onBlur:f,onClick:p,onChange:m,data:h,value:g,defaultValue:_,selectFirstOptionOnChange:v,selectFirstOptionOnDropdownOpen:y,onOptionSubmit:b,comboboxProps:x,readOnly:S,disabled:C,filter:w,limit:T,withScrollArea:E,maxDropdownHeight:O,floatingHeight:k,size:j,searchable:M,rightSection:N,checkIconPosition:P,withCheckIcon:F,withAlignedLabels:I,nothingFoundMessage:ee,name:te,form:ne,searchValue:re,defaultSearchValue:ie,onSearchChange:ae,allowDeselect:R,error:oe,rightSectionPointerEvents:z,id:ce,clearable:le,clearSectionMode:ue,clearButtonProps:de,hiddenInputProps:fe,renderOption:pe,onClear:me,autoComplete:he,scrollAreaProps:ge,__defaultRightSection:_e,__clearSection:ve,__clearable:ye,chevronColor:be,autoSelectOnBlur:xe,openOnFocus:Se,attributes:Ce,...we}=t,Te=(0,B.useMemo)(()=>hn(h),[h]),Ee=(0,B.useRef)({}),De=(0,B.useMemo)(()=>gn(Te),[Te]),Oe=L(ce),ke=lr({id:Oe,label:we.label,labelProps:we.labelProps,inputWrapperOrder:we.inputWrapperOrder}),[Ae,je,Me]=se({value:g,defaultValue:_,finalValue:null,onChange:m}),Ne=Ae==null?void 0:`${Ae}`in De?De[`${Ae}`]:Ee.current[`${Ae}`],Pe=Ut(Ne),[Fe,Ie,Le]=se({value:re,defaultValue:ie,finalValue:Ne?Ne.label:``,onChange:ae}),Re=Wn({opened:s,defaultOpened:c,onDropdownOpen:()=>{u?.(),y?Re.selectFirstOption():Re.updateSelectedOptionIndex(`active`,{scrollIntoView:!0})},onDropdownClose:()=>{l?.(),setTimeout(Re.resetSelectedOption,0)}}),ze=e=>{Ie(e),Re.resetSelectedOption()},{resolvedClassNames:Be,resolvedStyles:Ve}=D({props:t,styles:r,classNames:n});(0,B.useEffect)(()=>{v&&Re.selectFirstOption()},[v,Fe]),(0,B.useEffect)(()=>{g===null&&ze(``),g!=null&&Ne&&(Pe?.value!==Ne.value||Pe?.label!==Ne.label)&&ze(Ne.label)},[g,Ne]),(0,B.useEffect)(()=>{!Me&&!Le&&ze(Ae==null?``:`${Ae}`in De?De[`${Ae}`]?.label:Ee.current[`${Ae}`]?.label||``)},[De,Ae]),(0,B.useEffect)(()=>{Ae&&`${Ae}`in De&&(Ee.current[`${Ae}`]=De[`${Ae}`])},[De,Ae]);let He=(0,V.jsx)(qn.ClearButton,{...de,onClear:()=>{je(null,null),ze(``),me?.()}}),Ue=le&&Ae!=null&&!C&&!S;return(0,V.jsxs)(V.Fragment,{children:[(0,V.jsxs)(qn,{store:Re,__staticSelector:`Select`,classNames:Be,styles:Ve,unstyled:i,readOnly:S,size:j,attributes:Ce,floatingHeight:k,keepMounted:xe,onOptionSubmit:e=>{b?.(e);let t=R&&`${De[e].value}`==`${Ae}`?null:De[e],n=t?t.value:null;n!==Ae&&je(n,t),!Me&&ze(n==null?``:t?.label||``),Re.closeDropdown()},...x,children:[(0,V.jsx)(qn.Target,{targetType:M?`input`:`button`,autoComplete:he,withExpandedAttribute:!0,children:(0,V.jsx)(A,{id:Oe,__defaultRightSection:(0,V.jsx)(qn.Chevron,{size:j,error:oe,unstyled:i,color:be}),__clearSection:He,__clearable:Ue,__clearSectionMode:ue,rightSection:N,rightSectionPointerEvents:z||`none`,...we,size:j,__staticSelector:`Select`,disabled:C,readOnly:S||!M,value:Fe,onChange:e=>{if(ur(e)){if(!S){let t=wr(De,e.currentTarget.value);t&&`${t.value}`!=`${Ae}`&&(je(t.value,t),!Me&&ze(t.label))}return}ze(e.currentTarget.value),Re.openDropdown(),v&&Re.selectFirstOption()},onFocus:e=>{Se&&M&&Re.openDropdown(),d?.(e)},onBlur:e=>{xe&&Re.clickSelectedOption(),Re.closeDropdown();let t=Ae!=null&&(`${Ae}`in De?De[`${Ae}`]:Ee.current[`${Ae}`]);ze(t&&t.label||``),f?.(e)},onClick:e=>{M?Re.openDropdown():Re.toggleDropdown(),p?.(e)},classNames:Be,styles:Ve,unstyled:i,pointer:!M,error:oe,attributes:Ce})}),(0,V.jsx)(ir,{data:Te,hidden:S||C,filter:w,search:Fe,limit:T,hiddenWhenEmpty:!ee,withScrollArea:E,maxDropdownHeight:O,filterOptions:!!M&&Ne?.label!==Fe,value:Ae,checkIconPosition:P,withCheckIcon:F,withAlignedLabels:I,nothingFoundMessage:ee,unstyled:i,labelId:ke,"aria-label":ke?void 0:we[`aria-label`],renderOption:pe,scrollAreaProps:ge})]}),(0,V.jsx)(qn.HiddenInput,{value:Ae,name:te,form:ne,disabled:C,...fe})]})});Wr.classes={...A.classes,...qn.classes},Wr.displayName=`@mantine/core/Select`;function Gr(e){if(e!==void 0)return typeof e==`number`?w(e):e}function Kr({spacing:e,verticalSpacing:t,cols:n,minColWidth:r,autoRows:i,selector:a}){let o=s(),c=t===void 0?e:t,l=r!==void 0,u=te({"--sg-spacing-x":k(Lt(e)),"--sg-spacing-y":k(Lt(c)),"--sg-auto-rows":i,...l?{"--sg-min-col-width":Gr(r)}:{"--sg-cols":Lt(n)?.toString()}}),d=j(o.breakpoints).reduce((t,r)=>(t[r]||(t[r]={}),typeof e==`object`&&e[r]!==void 0&&(t[r][`--sg-spacing-x`]=k(e[r])),typeof c==`object`&&c[r]!==void 0&&(t[r][`--sg-spacing-y`]=k(c[r])),!l&&typeof n==`object`&&n[r]!==void 0&&(t[r][`--sg-cols`]=n[r]),t),{}),f=Le(j(d),o.breakpoints).filter(e=>j(d[e.value]).length>0).map(e=>({query:`(min-width: ${o.breakpoints[e.value]})`,styles:d[e.value]}));return(0,V.jsx)(O,{styles:u,media:f,selector:a})}function qr(e){return typeof e==`object`&&e?j(e):[]}function Jr(e){return e.sort((e,t)=>Be(e)-Be(t))}function Yr({spacing:e,verticalSpacing:t,cols:n,minColWidth:r}){return Jr(Array.from(new Set([...qr(e),...qr(t),...r===void 0?qr(n):[]])))}function Xr({spacing:e,verticalSpacing:t,cols:n,minColWidth:r,autoRows:i,selector:a}){let o=t===void 0?e:t,s=r!==void 0,c=te({"--sg-spacing-x":k(Lt(e)),"--sg-spacing-y":k(Lt(o)),"--sg-auto-rows":i,...s?{"--sg-min-col-width":Gr(r)}:{"--sg-cols":Lt(n)?.toString()}}),l=Yr({spacing:e,verticalSpacing:t,cols:n,minColWidth:r}),u=l.reduce((t,r)=>(t[r]||(t[r]={}),typeof e==`object`&&e[r]!==void 0&&(t[r][`--sg-spacing-x`]=k(e[r])),typeof o==`object`&&o[r]!==void 0&&(t[r][`--sg-spacing-y`]=k(o[r])),!s&&typeof n==`object`&&n[r]!==void 0&&(t[r][`--sg-cols`]=n[r]),t),{}),d=l.map(e=>({query:`simple-grid (min-width: ${e})`,styles:u[e]}));return(0,V.jsx)(O,{styles:c,container:d,selector:a})}var Zr={container:`m_925c2d2c`,root:`m_2415a157`},Qr={cols:1,spacing:`md`,type:`media`},$r=u(r=>{let i=a(`SimpleGrid`,Qr,r),{classNames:o,className:s,style:c,styles:l,unstyled:u,vars:d,cols:f,verticalSpacing:p,spacing:m,type:h,minColWidth:g,autoFlow:_,autoRows:v,attributes:y,...b}=i,x=e({name:`SimpleGrid`,classes:Zr,props:i,className:s,style:c,classNames:o,styles:l,unstyled:u,attributes:y,vars:d}),S=n(),C=g===void 0?void 0:_||`auto-fill`;return h===`container`?(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(Xr,{...i,selector:`.${S}`}),(0,V.jsx)(`div`,{...x(`container`),children:(0,V.jsx)(t,{...x(`root`,{className:S}),...b,"data-auto-cols":C})})]}):(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(Kr,{...i,selector:`.${S}`}),(0,V.jsx)(t,{...x(`root`,{className:S}),...b,"data-auto-cols":C})]})});$r.classes=Zr,$r.displayName=`@mantine/core/SimpleGrid`;var ei=(0,B.createContext)(null),ti={hiddenInputValuesSeparator:`,`},ni=r((e=>{let{value:t,defaultValue:n,onChange:r,size:i,wrapperProps:o,children:s,readOnly:c,name:l,hiddenInputValuesSeparator:u,hiddenInputProps:d,maxSelectedValues:f,disabled:p,...m}=a(`SwitchGroup`,ti,e),[h,g]=se({value:t,defaultValue:n,finalValue:[],onChange:r}),_=e=>{let t=e.currentTarget.value;if(c)return;let n=h.includes(t);!n&&f&&h.length>=f||g(n?h.filter(e=>e!==t):[...h,t])},v=e=>{if(p)return!0;if(!f)return!1;let t=h.includes(e),n=h.length>=f;return!t&&n},y=h.join(u);return(0,V.jsx)(ei,{value:{value:h,onChange:_,size:i,isDisabled:v},children:(0,V.jsxs)(E.Wrapper,{size:i,...o,...m,labelElement:`div`,__staticSelector:`SwitchGroup`,children:[(0,V.jsx)(Jn,{role:`group`,children:s}),(0,V.jsx)(`input`,{type:`hidden`,name:l,value:y,...d})]})})}));ni.classes=E.Wrapper.classes,ni.displayName=`@mantine/core/SwitchGroup`;var ri={root:`m_5f93f3bb`,input:`m_926b4011`,track:`m_9307d992`,thumb:`m_93039a1d`,trackLabel:`m_8277e082`},ii={labelPosition:`right`,withThumbIndicator:!0},ai=d((e,{radius:t,color:n,size:r})=>({root:{"--switch-radius":t===void 0?void 0:N(t),"--switch-height":b(r,`switch-height`),"--switch-width":b(r,`switch-width`),"--switch-thumb-size":b(r,`switch-thumb-size`),"--switch-label-font-size":b(r,`switch-label-font-size`),"--switch-track-label-padding":b(r,`switch-track-label-padding`),"--switch-color":n?i(n,e):void 0}})),oi=u(n=>{let r=a(`Switch`,ii,n),{classNames:i,className:s,style:c,styles:l,unstyled:u,vars:d,color:f,label:p,offLabel:m,onLabel:h,id:g,size:_,radius:v,wrapperProps:y,thumbIcon:b,checked:x,defaultChecked:S,onChange:C,labelPosition:w,description:T,error:E,disabled:D,variant:O,rootRef:k,mod:A,withThumbIndicator:j,attributes:M,...N}=r,P=(0,B.use)(ei),F=_||P?.size,I=e({name:`Switch`,props:r,classes:ri,className:s,style:c,classNames:i,styles:l,unstyled:u,attributes:M,vars:d,varsResolver:ai}),{styleProps:ee,rest:te}=o(N),ne=L(g),re=[T?`${ne}-description`:void 0,E&&typeof E!=`boolean`?`${ne}-error`:void 0,te[`aria-describedby`]].filter(Boolean).join(` `)||void 0,ie={checked:P?.value.includes(te.value)??x,onChange:e=>{P?.onChange(e),C?.(e)}},ae=D||P?.isDisabled?.(te.value),[R,oe]=se({value:ie.checked??x,defaultValue:S,finalValue:!1});return(0,V.jsxs)(Zn,{...I(`root`),__staticSelector:`Switch`,__stylesApiProps:r,id:ne,size:F,labelPosition:w,label:p,description:T,error:E,disabled:ae,bodyElement:`label`,labelElement:`span`,classNames:i,styles:l,unstyled:u,"data-checked":ie.checked,variant:O,ref:k,mod:A,attributes:M,inert:te.inert,...ee,...y,children:[(0,V.jsx)(`input`,{...te,...ie,disabled:ae,checked:R,"data-checked":ie.checked,onChange:e=>{ie.onChange?.(e),oe(e.currentTarget.checked)},id:ne,type:`checkbox`,role:`switch`,inert:te.inert,"aria-describedby":re,...I(`input`)}),(0,V.jsxs)(t,{"aria-hidden":`true`,component:`span`,mod:{error:E,"label-position":w,"without-labels":!h&&!m},...I(`track`),children:[(0,V.jsx)(t,{component:`span`,mod:{"reduce-motion":!0,"with-thumb-indicator":j&&!b},...I(`thumb`),children:b}),(0,V.jsx)(`span`,{...I(`trackLabel`),children:R?h:m})]})]})});oi.classes={...ri,...Xn},oi.varsResolver=ai,oi.displayName=`@mantine/core/Switch`,oi.Group=ni;var si=new Map([[`bold`,B.createElement(B.Fragment,null,B.createElement(`path`,{d:`M244,56v48a12,12,0,0,1-12,12H184a12,12,0,1,1,0-24H201.1l-19-17.38c-.13-.12-.26-.24-.38-.37A76,76,0,1,0,127,204h1a75.53,75.53,0,0,0,52.15-20.72,12,12,0,0,1,16.49,17.45A99.45,99.45,0,0,1,128,228h-1.37A100,100,0,1,1,198.51,57.06L220,76.72V56a12,12,0,0,1,24,0Z`}))],[`duotone`,B.createElement(B.Fragment,null,B.createElement(`path`,{d:`M216,128a88,88,0,1,1-88-88A88,88,0,0,1,216,128Z`,opacity:`0.2`}),B.createElement(`path`,{d:`M240,56v48a8,8,0,0,1-8,8H184a8,8,0,0,1,0-16H211.4L184.81,71.64l-.25-.24a80,80,0,1,0-1.67,114.78,8,8,0,0,1,11,11.63A95.44,95.44,0,0,1,128,224h-1.32A96,96,0,1,1,195.75,60L224,85.8V56a8,8,0,1,1,16,0Z`}))],[`fill`,B.createElement(B.Fragment,null,B.createElement(`path`,{d:`M240,56v48a8,8,0,0,1-8,8H184a8,8,0,0,1-5.66-13.66l17-17-10.55-9.65-.25-.24a80,80,0,1,0-1.67,114.78,8,8,0,1,1,11,11.63A95.44,95.44,0,0,1,128,224h-1.32A96,96,0,1,1,195.75,60l10.93,10L226.34,50.3A8,8,0,0,1,240,56Z`}))],[`light`,B.createElement(B.Fragment,null,B.createElement(`path`,{d:`M238,56v48a6,6,0,0,1-6,6H184a6,6,0,0,1,0-12h32.55l-30.38-27.8c-.06-.06-.12-.13-.19-.19a82,82,0,1,0-1.7,117.65,6,6,0,0,1,8.24,8.73A93.46,93.46,0,0,1,128,222h-1.28A94,94,0,1,1,194.37,61.4L226,90.35V56a6,6,0,1,1,12,0Z`}))],[`regular`,B.createElement(B.Fragment,null,B.createElement(`path`,{d:`M240,56v48a8,8,0,0,1-8,8H184a8,8,0,0,1,0-16H211.4L184.81,71.64l-.25-.24a80,80,0,1,0-1.67,114.78,8,8,0,0,1,11,11.63A95.44,95.44,0,0,1,128,224h-1.32A96,96,0,1,1,195.75,60L224,85.8V56a8,8,0,1,1,16,0Z`}))],[`thin`,B.createElement(B.Fragment,null,B.createElement(`path`,{d:`M236,56v48a4,4,0,0,1-4,4H184a4,4,0,0,1,0-8h37.7L187.53,68.69l-.13-.12a84,84,0,1,0-1.75,120.51,4,4,0,0,1,5.5,5.82A91.43,91.43,0,0,1,128,220h-1.26A92,92,0,1,1,193,62.84l35,32.05V56a4,4,0,1,1,8,0Z`}))]]),ci=new Map([[`bold`,B.createElement(B.Fragment,null,B.createElement(`path`,{d:`M228,128a100,100,0,0,1-98.66,100H128a99.39,99.39,0,0,1-68.62-27.29,12,12,0,0,1,16.48-17.45,76,76,0,1,0-1.57-109c-.13.13-.25.25-.39.37L54.89,92H72a12,12,0,0,1,0,24H24a12,12,0,0,1-12-12V56a12,12,0,0,1,24,0V76.72L57.48,57.06A100,100,0,0,1,228,128Z`}))],[`duotone`,B.createElement(B.Fragment,null,B.createElement(`path`,{d:`M216,128a88,88,0,1,1-88-88A88,88,0,0,1,216,128Z`,opacity:`0.2`}),B.createElement(`path`,{d:`M224,128a96,96,0,0,1-94.71,96H128A95.38,95.38,0,0,1,62.1,197.8a8,8,0,0,1,11-11.63A80,80,0,1,0,71.43,71.39a3.07,3.07,0,0,1-.26.25L44.59,96H72a8,8,0,0,1,0,16H24a8,8,0,0,1-8-8V56a8,8,0,0,1,16,0V85.8L60.25,60A96,96,0,0,1,224,128Z`}))],[`fill`,B.createElement(B.Fragment,null,B.createElement(`path`,{d:`M224,128a96,96,0,0,1-94.71,96H128A95.38,95.38,0,0,1,62.1,197.8a8,8,0,0,1,11-11.63A80,80,0,1,0,71.43,71.39a3.07,3.07,0,0,1-.26.25L60.63,81.29l17,17A8,8,0,0,1,72,112H24a8,8,0,0,1-8-8V56A8,8,0,0,1,29.66,50.3L49.31,70,60.25,60A96,96,0,0,1,224,128Z`}))],[`light`,B.createElement(B.Fragment,null,B.createElement(`path`,{d:`M222,128a94,94,0,0,1-92.74,94H128a93.43,93.43,0,0,1-64.5-25.65,6,6,0,1,1,8.24-8.72A82,82,0,1,0,70,70l-.19.19L39.44,98H72a6,6,0,0,1,0,12H24a6,6,0,0,1-6-6V56a6,6,0,0,1,12,0V90.34L61.63,61.4A94,94,0,0,1,222,128Z`}))],[`regular`,B.createElement(B.Fragment,null,B.createElement(`path`,{d:`M224,128a96,96,0,0,1-94.71,96H128A95.38,95.38,0,0,1,62.1,197.8a8,8,0,0,1,11-11.63A80,80,0,1,0,71.43,71.39a3.07,3.07,0,0,1-.26.25L44.59,96H72a8,8,0,0,1,0,16H24a8,8,0,0,1-8-8V56a8,8,0,0,1,16,0V85.8L60.25,60A96,96,0,0,1,224,128Z`}))],[`thin`,B.createElement(B.Fragment,null,B.createElement(`path`,{d:`M220,128a92,92,0,0,1-90.77,92H128a91.47,91.47,0,0,1-63.13-25.1,4,4,0,1,1,5.5-5.82A84,84,0,1,0,68.6,68.57l-.13.12L34.3,100H72a4,4,0,0,1,0,8H24a4,4,0,0,1-4-4V56a4,4,0,0,1,8,0V94.89l35-32A92,92,0,0,1,220,128Z`}))]]),li=new Map([[`bold`,B.createElement(B.Fragment,null,B.createElement(`path`,{d:`M220,48V96a12,12,0,0,1-24,0V77l-35.51,35.52a12,12,0,0,1-17-17L179,60H160a12,12,0,0,1,0-24h48A12,12,0,0,1,220,48ZM95.51,143.51,60,179V160a12,12,0,0,0-24,0v48a12,12,0,0,0,12,12H96a12,12,0,0,0,0-24H77l35.52-35.51a12,12,0,0,0-17-17ZM208,148a12,12,0,0,0-12,12v19l-35.51-35.52a12,12,0,0,0-17,17L179,196H160a12,12,0,0,0,0,24h48a12,12,0,0,0,12-12V160A12,12,0,0,0,208,148ZM77,60H96a12,12,0,0,0,0-24H48A12,12,0,0,0,36,48V96a12,12,0,0,0,24,0V77l35.51,35.52a12,12,0,0,0,17-17Z`}))],[`duotone`,B.createElement(B.Fragment,null,B.createElement(`path`,{d:`M208,48V208H48V48Z`,opacity:`0.2`}),B.createElement(`path`,{d:`M216,48V96a8,8,0,0,1-16,0V67.31l-42.34,42.35a8,8,0,0,1-11.32-11.32L188.69,56H160a8,8,0,0,1,0-16h48A8,8,0,0,1,216,48ZM98.34,146.34,56,188.69V160a8,8,0,0,0-16,0v48a8,8,0,0,0,8,8H96a8,8,0,0,0,0-16H67.31l42.35-42.34a8,8,0,0,0-11.32-11.32ZM208,152a8,8,0,0,0-8,8v28.69l-42.34-42.35a8,8,0,0,0-11.32,11.32L188.69,200H160a8,8,0,0,0,0,16h48a8,8,0,0,0,8-8V160A8,8,0,0,0,208,152ZM67.31,56H96a8,8,0,0,0,0-16H48a8,8,0,0,0-8,8V96a8,8,0,0,0,16,0V67.31l42.34,42.35a8,8,0,0,0,11.32-11.32Z`}))],[`fill`,B.createElement(B.Fragment,null,B.createElement(`path`,{d:`M109.66,146.34a8,8,0,0,1,0,11.32L83.31,184l18.35,18.34A8,8,0,0,1,96,216H48a8,8,0,0,1-8-8V160a8,8,0,0,1,13.66-5.66L72,172.69l26.34-26.35A8,8,0,0,1,109.66,146.34ZM83.31,72l18.35-18.34A8,8,0,0,0,96,40H48a8,8,0,0,0-8,8V96a8,8,0,0,0,13.66,5.66L72,83.31l26.34,26.35a8,8,0,0,0,11.32-11.32ZM208,40H160a8,8,0,0,0-5.66,13.66L172.69,72,146.34,98.34a8,8,0,0,0,11.32,11.32L184,83.31l18.34,18.35A8,8,0,0,0,216,96V48A8,8,0,0,0,208,40Zm3.06,112.61a8,8,0,0,0-8.72,1.73L184,172.69l-26.34-26.35a8,8,0,0,0-11.32,11.32L172.69,184l-18.35,18.34A8,8,0,0,0,160,216h48a8,8,0,0,0,8-8V160A8,8,0,0,0,211.06,152.61Z`}))],[`light`,B.createElement(B.Fragment,null,B.createElement(`path`,{d:`M214,48V96a6,6,0,0,1-12,0V62.48l-45.76,45.76a6,6,0,0,1-8.48-8.48L193.52,54H160a6,6,0,0,1,0-12h48A6,6,0,0,1,214,48ZM99.76,147.76,54,193.52V160a6,6,0,0,0-12,0v48a6,6,0,0,0,6,6H96a6,6,0,0,0,0-12H62.48l45.76-45.76a6,6,0,0,0-8.48-8.48ZM208,154a6,6,0,0,0-6,6v33.52l-45.76-45.76a6,6,0,0,0-8.48,8.48L193.52,202H160a6,6,0,0,0,0,12h48a6,6,0,0,0,6-6V160A6,6,0,0,0,208,154ZM62.48,54H96a6,6,0,0,0,0-12H48a6,6,0,0,0-6,6V96a6,6,0,0,0,12,0V62.48l45.76,45.76a6,6,0,0,0,8.48-8.48Z`}))],[`regular`,B.createElement(B.Fragment,null,B.createElement(`path`,{d:`M216,48V96a8,8,0,0,1-16,0V67.31l-42.34,42.35a8,8,0,0,1-11.32-11.32L188.69,56H160a8,8,0,0,1,0-16h48A8,8,0,0,1,216,48ZM98.34,146.34,56,188.69V160a8,8,0,0,0-16,0v48a8,8,0,0,0,8,8H96a8,8,0,0,0,0-16H67.31l42.35-42.34a8,8,0,0,0-11.32-11.32ZM208,152a8,8,0,0,0-8,8v28.69l-42.34-42.35a8,8,0,0,0-11.32,11.32L188.69,200H160a8,8,0,0,0,0,16h48a8,8,0,0,0,8-8V160A8,8,0,0,0,208,152ZM67.31,56H96a8,8,0,0,0,0-16H48a8,8,0,0,0-8,8V96a8,8,0,0,0,16,0V67.31l42.34,42.35a8,8,0,0,0,11.32-11.32Z`}))],[`thin`,B.createElement(B.Fragment,null,B.createElement(`path`,{d:`M212,48V96a4,4,0,0,1-8,0V57.66l-49.17,49.17a4,4,0,0,1-5.66-5.66L198.34,52H160a4,4,0,0,1,0-8h48A4,4,0,0,1,212,48ZM101.17,149.17,52,198.34V160a4,4,0,0,0-8,0v48a4,4,0,0,0,4,4H96a4,4,0,0,0,0-8H57.66l49.17-49.17a4,4,0,0,0-5.66-5.66ZM208,156a4,4,0,0,0-4,4v38.34l-49.17-49.17a4,4,0,0,0-5.66,5.66L198.34,204H160a4,4,0,0,0,0,8h48a4,4,0,0,0,4-4V160A4,4,0,0,0,208,156ZM57.66,52H96a4,4,0,0,0,0-8H48a4,4,0,0,0-4,4V96a4,4,0,0,0,8,0V57.66l49.17,49.17a4,4,0,0,0,5.66-5.66Z`}))]]),ui=new Map([[`bold`,B.createElement(B.Fragment,null,B.createElement(`path`,{d:`M216.49,168.49a12,12,0,0,1-17,0L128,97,56.49,168.49a12,12,0,0,1-17-17l80-80a12,12,0,0,1,17,0l80,80A12,12,0,0,1,216.49,168.49Z`}))],[`duotone`,B.createElement(B.Fragment,null,B.createElement(`path`,{d:`M208,160H48l80-80Z`,opacity:`0.2`}),B.createElement(`path`,{d:`M213.66,154.34l-80-80a8,8,0,0,0-11.32,0l-80,80A8,8,0,0,0,48,168H208a8,8,0,0,0,5.66-13.66ZM67.31,152,128,91.31,188.69,152Z`}))],[`fill`,B.createElement(B.Fragment,null,B.createElement(`path`,{d:`M215.39,163.06A8,8,0,0,1,208,168H48a8,8,0,0,1-5.66-13.66l80-80a8,8,0,0,1,11.32,0l80,80A8,8,0,0,1,215.39,163.06Z`}))],[`light`,B.createElement(B.Fragment,null,B.createElement(`path`,{d:`M212.24,164.24a6,6,0,0,1-8.48,0L128,88.49,52.24,164.24a6,6,0,0,1-8.48-8.48l80-80a6,6,0,0,1,8.48,0l80,80A6,6,0,0,1,212.24,164.24Z`}))],[`regular`,B.createElement(B.Fragment,null,B.createElement(`path`,{d:`M213.66,165.66a8,8,0,0,1-11.32,0L128,91.31,53.66,165.66a8,8,0,0,1-11.32-11.32l80-80a8,8,0,0,1,11.32,0l80,80A8,8,0,0,1,213.66,165.66Z`}))],[`thin`,B.createElement(B.Fragment,null,B.createElement(`path`,{d:`M210.83,162.83a4,4,0,0,1-5.66,0L128,85.66,50.83,162.83a4,4,0,0,1-5.66-5.66l80-80a4,4,0,0,1,5.66,0l80,80A4,4,0,0,1,210.83,162.83Z`}))]]),di=new Map([[`bold`,B.createElement(B.Fragment,null,B.createElement(`path`,{d:`M172,108a12,12,0,0,1-12,12H96a12,12,0,0,1,0-24h64A12,12,0,0,1,172,108Zm-12,28H96a12,12,0,0,0,0,24h64a12,12,0,0,0,0-24Zm76-8A108,108,0,0,1,78.77,224.15L46.34,235A20,20,0,0,1,21,209.66l10.81-32.43A108,108,0,1,1,236,128Zm-24,0A84,84,0,1,0,55.27,170.06a12,12,0,0,1,1,9.81l-9.93,29.79,29.79-9.93a12.1,12.1,0,0,1,3.8-.62,12,12,0,0,1,6,1.62A84,84,0,0,0,212,128Z`}))],[`duotone`,B.createElement(B.Fragment,null,B.createElement(`path`,{d:`M224,128A96,96,0,0,1,79.93,211.11h0L42.54,223.58a8,8,0,0,1-10.12-10.12l12.47-37.39h0A96,96,0,1,1,224,128Z`,opacity:`0.2`}),B.createElement(`path`,{d:`M128,24A104,104,0,0,0,36.18,176.88L24.83,210.93a16,16,0,0,0,20.24,20.24l34.05-11.35A104,104,0,1,0,128,24Zm0,192a87.87,87.87,0,0,1-44.06-11.81,8,8,0,0,0-4-1.08,7.85,7.85,0,0,0-2.53.42L40,216,52.47,178.6a8,8,0,0,0-.66-6.54A88,88,0,1,1,128,216Zm40-104a8,8,0,0,1-8,8H96a8,8,0,0,1,0-16h64A8,8,0,0,1,168,112Zm0,32a8,8,0,0,1-8,8H96a8,8,0,0,1,0-16h64A8,8,0,0,1,168,144Z`}))],[`fill`,B.createElement(B.Fragment,null,B.createElement(`path`,{d:`M128,24A104,104,0,0,0,36.18,176.88L24.83,210.93a16,16,0,0,0,20.24,20.24l34.05-11.35A104,104,0,1,0,128,24Zm32,128H96a8,8,0,0,1,0-16h64a8,8,0,0,1,0,16Zm0-32H96a8,8,0,0,1,0-16h64a8,8,0,0,1,0,16Z`}))],[`light`,B.createElement(B.Fragment,null,B.createElement(`path`,{d:`M166,112a6,6,0,0,1-6,6H96a6,6,0,0,1,0-12h64A6,6,0,0,1,166,112Zm-6,26H96a6,6,0,0,0,0,12h64a6,6,0,0,0,0-12Zm70-10A102,102,0,0,1,79.31,217.65L44.44,229.27a14,14,0,0,1-17.71-17.71l11.62-34.87A102,102,0,1,1,230,128Zm-12,0A90,90,0,1,0,50.08,173.06a6,6,0,0,1,.5,4.91L38.12,215.35a2,2,0,0,0,2.53,2.53L78,205.42a6.2,6.2,0,0,1,1.9-.31,6.09,6.09,0,0,1,3,.81A90,90,0,0,0,218,128Z`}))],[`regular`,B.createElement(B.Fragment,null,B.createElement(`path`,{d:`M168,112a8,8,0,0,1-8,8H96a8,8,0,0,1,0-16h64A8,8,0,0,1,168,112Zm-8,24H96a8,8,0,0,0,0,16h64a8,8,0,0,0,0-16Zm72-8A104,104,0,0,1,79.12,219.82L45.07,231.17a16,16,0,0,1-20.24-20.24l11.35-34.05A104,104,0,1,1,232,128Zm-16,0A88,88,0,1,0,51.81,172.06a8,8,0,0,1,.66,6.54L40,216,77.4,203.53a7.85,7.85,0,0,1,2.53-.42,8,8,0,0,1,4,1.08A88,88,0,0,0,216,128Z`}))],[`thin`,B.createElement(B.Fragment,null,B.createElement(`path`,{d:`M164,112a4,4,0,0,1-4,4H96a4,4,0,0,1,0-8h64A4,4,0,0,1,164,112Zm-4,28H96a4,4,0,0,0,0,8h64a4,4,0,0,0,0-8Zm68-12A100,100,0,0,1,79.5,215.47l-35.69,11.9a12,12,0,0,1-15.18-15.18l11.9-35.69A100,100,0,1,1,228,128Zm-8,0A92,92,0,1,0,48.35,174.07a4,4,0,0,1,.33,3.27L36.22,214.72a4,4,0,0,0,5.06,5.06l37.38-12.46a3.93,3.93,0,0,1,1.27-.21,4.05,4.05,0,0,1,2,.54A92,92,0,0,0,220,128Z`}))]]),fi=new Map([[`bold`,B.createElement(B.Fragment,null,B.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,212Zm68-84a12,12,0,0,1-12,12H128a12,12,0,0,1-12-12V72a12,12,0,0,1,24,0v44h44A12,12,0,0,1,196,128Z`}))],[`duotone`,B.createElement(B.Fragment,null,B.createElement(`path`,{d:`M224,128a96,96,0,1,1-96-96A96,96,0,0,1,224,128Z`,opacity:`0.2`}),B.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,216Zm64-88a8,8,0,0,1-8,8H128a8,8,0,0,1-8-8V72a8,8,0,0,1,16,0v48h48A8,8,0,0,1,192,128Z`}))],[`fill`,B.createElement(B.Fragment,null,B.createElement(`path`,{d:`M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm56,112H128a8,8,0,0,1-8-8V72a8,8,0,0,1,16,0v48h48a8,8,0,0,1,0,16Z`}))],[`light`,B.createElement(B.Fragment,null,B.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,218Zm62-90a6,6,0,0,1-6,6H128a6,6,0,0,1-6-6V72a6,6,0,0,1,12,0v50h50A6,6,0,0,1,190,128Z`}))],[`regular`,B.createElement(B.Fragment,null,B.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,216Zm64-88a8,8,0,0,1-8,8H128a8,8,0,0,1-8-8V72a8,8,0,0,1,16,0v48h48A8,8,0,0,1,192,128Z`}))],[`thin`,B.createElement(B.Fragment,null,B.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,220Zm60-92a4,4,0,0,1-4,4H128a4,4,0,0,1-4-4V72a4,4,0,0,1,8,0v52h52A4,4,0,0,1,188,128Z`}))]]),pi=new Map([[`bold`,B.createElement(B.Fragment,null,B.createElement(`path`,{d:`M140,80v41.21l34.17,20.5a12,12,0,1,1-12.34,20.58l-40-24A12,12,0,0,1,116,128V80a12,12,0,0,1,24,0ZM128,28A99.38,99.38,0,0,0,57.24,57.34c-4.69,4.74-9,9.37-13.24,14V64a12,12,0,0,0-24,0v40a12,12,0,0,0,12,12H72a12,12,0,0,0,0-24H57.77C63,86,68.37,80.22,74.26,74.26a76,76,0,1,1,1.58,109,12,12,0,0,0-16.48,17.46A100,100,0,1,0,128,28Z`}))],[`duotone`,B.createElement(B.Fragment,null,B.createElement(`path`,{d:`M216,128a88,88,0,1,1-88-88A88,88,0,0,1,216,128Z`,opacity:`0.2`}),B.createElement(`path`,{d:`M136,80v43.47l36.12,21.67a8,8,0,0,1-8.24,13.72l-40-24A8,8,0,0,1,120,128V80a8,8,0,0,1,16,0Zm-8-48A95.44,95.44,0,0,0,60.08,60.15C52.81,67.51,46.35,74.59,40,82V64a8,8,0,0,0-16,0v40a8,8,0,0,0,8,8H72a8,8,0,0,0,0-16H49c7.15-8.42,14.27-16.35,22.39-24.57a80,80,0,1,1,1.66,114.75,8,8,0,1,0-11,11.64A96,96,0,1,0,128,32Z`}))],[`fill`,B.createElement(B.Fragment,null,B.createElement(`path`,{d:`M224,128A96,96,0,0,1,62.11,197.82a8,8,0,1,1,11-11.64A80,80,0,1,0,71.43,71.43C67.9,75,64.58,78.51,61.35,82L77.66,98.34A8,8,0,0,1,72,112H32a8,8,0,0,1-8-8V64a8,8,0,0,1,13.66-5.66L50,70.7c3.22-3.49,6.54-7,10.06-10.55A96,96,0,0,1,224,128ZM128,72a8,8,0,0,0-8,8v48a8,8,0,0,0,3.88,6.86l40,24a8,8,0,1,0,8.24-13.72L136,123.47V80A8,8,0,0,0,128,72Z`}))],[`light`,B.createElement(B.Fragment,null,B.createElement(`path`,{d:`M134,80v44.6l37.09,22.25a6,6,0,0,1-6.18,10.3l-40-24A6,6,0,0,1,122,128V80a6,6,0,0,1,12,0Zm-6-46A93.4,93.4,0,0,0,61.51,61.56c-8.58,8.68-16,17-23.51,25.8V64a6,6,0,0,0-12,0v40a6,6,0,0,0,6,6H72a6,6,0,0,0,0-12H44.73C52.86,88.29,60.79,79.35,70,70a82,82,0,1,1,1.7,117.62,6,6,0,1,0-8.24,8.72A94,94,0,1,0,128,34Z`}))],[`regular`,B.createElement(B.Fragment,null,B.createElement(`path`,{d:`M136,80v43.47l36.12,21.67a8,8,0,0,1-8.24,13.72l-40-24A8,8,0,0,1,120,128V80a8,8,0,0,1,16,0Zm-8-48A95.44,95.44,0,0,0,60.08,60.15C52.81,67.51,46.35,74.59,40,82V64a8,8,0,0,0-16,0v40a8,8,0,0,0,8,8H72a8,8,0,0,0,0-16H49c7.15-8.42,14.27-16.35,22.39-24.57a80,80,0,1,1,1.66,114.75,8,8,0,1,0-11,11.64A96,96,0,1,0,128,32Z`}))],[`thin`,B.createElement(B.Fragment,null,B.createElement(`path`,{d:`M132,80v45.74l38.06,22.83a4,4,0,0,1-4.12,6.86l-40-24A4,4,0,0,1,124,128V80a4,4,0,0,1,8,0Zm-4-44A91.42,91.42,0,0,0,62.93,63C53.05,73,44.66,82.47,36,92.86V64a4,4,0,0,0-8,0v40a4,4,0,0,0,4,4H72a4,4,0,0,0,0-8H40.47C49.61,89,58.3,79,68.6,68.6a84,84,0,1,1,1.75,120.49,4,4,0,1,0-5.5,5.82A92,92,0,1,0,128,36Z`}))]]),mi=new Map([[`bold`,B.createElement(B.Fragment,null,B.createElement(`path`,{d:`M108,84a16,16,0,1,1,16,16A16,16,0,0,1,108,84Zm128,44A108,108,0,1,1,128,20,108.12,108.12,0,0,1,236,128Zm-24,0a84,84,0,1,0-84,84A84.09,84.09,0,0,0,212,128Zm-72,36.68V132a20,20,0,0,0-20-20,12,12,0,0,0-4,23.32V168a20,20,0,0,0,20,20,12,12,0,0,0,4-23.32Z`}))],[`duotone`,B.createElement(B.Fragment,null,B.createElement(`path`,{d:`M224,128a96,96,0,1,1-96-96A96,96,0,0,1,224,128Z`,opacity:`0.2`}),B.createElement(`path`,{d:`M144,176a8,8,0,0,1-8,8,16,16,0,0,1-16-16V128a8,8,0,0,1,0-16,16,16,0,0,1,16,16v40A8,8,0,0,1,144,176Zm88-48A104,104,0,1,1,128,24,104.11,104.11,0,0,1,232,128Zm-16,0a88,88,0,1,0-88,88A88.1,88.1,0,0,0,216,128ZM124,96a12,12,0,1,0-12-12A12,12,0,0,0,124,96Z`}))],[`fill`,B.createElement(B.Fragment,null,B.createElement(`path`,{d:`M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm-4,48a12,12,0,1,1-12,12A12,12,0,0,1,124,72Zm12,112a16,16,0,0,1-16-16V128a8,8,0,0,1,0-16,16,16,0,0,1,16,16v40a8,8,0,0,1,0,16Z`}))],[`light`,B.createElement(B.Fragment,null,B.createElement(`path`,{d:`M142,176a6,6,0,0,1-6,6,14,14,0,0,1-14-14V128a2,2,0,0,0-2-2,6,6,0,0,1,0-12,14,14,0,0,1,14,14v40a2,2,0,0,0,2,2A6,6,0,0,1,142,176ZM124,94a10,10,0,1,0-10-10A10,10,0,0,0,124,94Zm106,34A102,102,0,1,1,128,26,102.12,102.12,0,0,1,230,128Zm-12,0a90,90,0,1,0-90,90A90.1,90.1,0,0,0,218,128Z`}))],[`regular`,B.createElement(B.Fragment,null,B.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,216Zm16-40a8,8,0,0,1-8,8,16,16,0,0,1-16-16V128a8,8,0,0,1,0-16,16,16,0,0,1,16,16v40A8,8,0,0,1,144,176ZM112,84a12,12,0,1,1,12,12A12,12,0,0,1,112,84Z`}))],[`thin`,B.createElement(B.Fragment,null,B.createElement(`path`,{d:`M140,176a4,4,0,0,1-4,4,12,12,0,0,1-12-12V128a4,4,0,0,0-4-4,4,4,0,0,1,0-8,12,12,0,0,1,12,12v40a4,4,0,0,0,4,4A4,4,0,0,1,140,176ZM124,92a8,8,0,1,0-8-8A8,8,0,0,0,124,92Zm104,36A100,100,0,1,1,128,28,100.11,100.11,0,0,1,228,128Zm-8,0a92,92,0,1,0-92,92A92.1,92.1,0,0,0,220,128Z`}))]]),hi=new Map([[`bold`,B.createElement(B.Fragment,null,B.createElement(`path`,{d:`M224,44H32A20,20,0,0,0,12,64V192a20,20,0,0,0,20,20H224a20,20,0,0,0,20-20V64A20,20,0,0,0,224,44Zm-4,144H36V68H220ZM52,128a12,12,0,0,1,12-12H192a12,12,0,0,1,0,24H64A12,12,0,0,1,52,128Zm0-36A12,12,0,0,1,64,80H192a12,12,0,0,1,0,24H64A12,12,0,0,1,52,92Zm0,72a12,12,0,0,1,12-12h8a12,12,0,0,1,0,24H64A12,12,0,0,1,52,164Zm108,0a12,12,0,0,1-12,12H108a12,12,0,0,1,0-24h40A12,12,0,0,1,160,164Zm44,0a12,12,0,0,1-12,12h-8a12,12,0,0,1,0-24h8A12,12,0,0,1,204,164Z`}))],[`duotone`,B.createElement(B.Fragment,null,B.createElement(`path`,{d:`M232,64V192a8,8,0,0,1-8,8H32a8,8,0,0,1-8-8V64a8,8,0,0,1,8-8H224A8,8,0,0,1,232,64Z`,opacity:`0.2`}),B.createElement(`path`,{d:`M224,48H32A16,16,0,0,0,16,64V192a16,16,0,0,0,16,16H224a16,16,0,0,0,16-16V64A16,16,0,0,0,224,48Zm0,144H32V64H224V192Zm-16-64a8,8,0,0,1-8,8H56a8,8,0,0,1,0-16H200A8,8,0,0,1,208,128Zm0-32a8,8,0,0,1-8,8H56a8,8,0,0,1,0-16H200A8,8,0,0,1,208,96ZM72,160a8,8,0,0,1-8,8H56a8,8,0,0,1,0-16h8A8,8,0,0,1,72,160Zm96,0a8,8,0,0,1-8,8H96a8,8,0,0,1,0-16h64A8,8,0,0,1,168,160Zm40,0a8,8,0,0,1-8,8h-8a8,8,0,0,1,0-16h8A8,8,0,0,1,208,160Z`}))],[`fill`,B.createElement(B.Fragment,null,B.createElement(`path`,{d:`M224,48H32A16,16,0,0,0,16,64V192a16,16,0,0,0,16,16H224a16,16,0,0,0,16-16V64A16,16,0,0,0,224,48ZM64,168H48a8,8,0,0,1,0-16H64a8,8,0,0,1,0,16Zm96,0H96a8,8,0,0,1,0-16h64a8,8,0,0,1,0,16Zm48,0H192a8,8,0,0,1,0-16h16a8,8,0,0,1,0,16Zm0-32H48a8,8,0,0,1,0-16H208a8,8,0,0,1,0,16Zm0-32H48a8,8,0,0,1,0-16H208a8,8,0,0,1,0,16Z`}))],[`light`,B.createElement(B.Fragment,null,B.createElement(`path`,{d:`M224,50H32A14,14,0,0,0,18,64V192a14,14,0,0,0,14,14H224a14,14,0,0,0,14-14V64A14,14,0,0,0,224,50Zm2,142a2,2,0,0,1-2,2H32a2,2,0,0,1-2-2V64a2,2,0,0,1,2-2H224a2,2,0,0,1,2,2Zm-20-64a6,6,0,0,1-6,6H56a6,6,0,0,1,0-12H200A6,6,0,0,1,206,128Zm0-32a6,6,0,0,1-6,6H56a6,6,0,0,1,0-12H200A6,6,0,0,1,206,96ZM70,160a6,6,0,0,1-6,6H56a6,6,0,0,1,0-12h8A6,6,0,0,1,70,160Zm96,0a6,6,0,0,1-6,6H96a6,6,0,0,1,0-12h64A6,6,0,0,1,166,160Zm40,0a6,6,0,0,1-6,6h-8a6,6,0,0,1,0-12h8A6,6,0,0,1,206,160Z`}))],[`regular`,B.createElement(B.Fragment,null,B.createElement(`path`,{d:`M224,48H32A16,16,0,0,0,16,64V192a16,16,0,0,0,16,16H224a16,16,0,0,0,16-16V64A16,16,0,0,0,224,48Zm0,144H32V64H224V192Zm-16-64a8,8,0,0,1-8,8H56a8,8,0,0,1,0-16H200A8,8,0,0,1,208,128Zm0-32a8,8,0,0,1-8,8H56a8,8,0,0,1,0-16H200A8,8,0,0,1,208,96ZM72,160a8,8,0,0,1-8,8H56a8,8,0,0,1,0-16h8A8,8,0,0,1,72,160Zm96,0a8,8,0,0,1-8,8H96a8,8,0,0,1,0-16h64A8,8,0,0,1,168,160Zm40,0a8,8,0,0,1-8,8h-8a8,8,0,0,1,0-16h8A8,8,0,0,1,208,160Z`}))],[`thin`,B.createElement(B.Fragment,null,B.createElement(`path`,{d:`M224,52H32A12,12,0,0,0,20,64V192a12,12,0,0,0,12,12H224a12,12,0,0,0,12-12V64A12,12,0,0,0,224,52Zm4,140a4,4,0,0,1-4,4H32a4,4,0,0,1-4-4V64a4,4,0,0,1,4-4H224a4,4,0,0,1,4,4Zm-24-64a4,4,0,0,1-4,4H56a4,4,0,0,1,0-8H200A4,4,0,0,1,204,128Zm0-32a4,4,0,0,1-4,4H56a4,4,0,0,1,0-8H200A4,4,0,0,1,204,96ZM68,160a4,4,0,0,1-4,4H56a4,4,0,0,1,0-8h8A4,4,0,0,1,68,160Zm96,0a4,4,0,0,1-4,4H96a4,4,0,0,1,0-8h64A4,4,0,0,1,164,160Zm40,0a4,4,0,0,1-4,4h-8a4,4,0,0,1,0-8h8A4,4,0,0,1,204,160Z`}))]]),gi=new Map([[`bold`,B.createElement(B.Fragment,null,B.createElement(`path`,{d:`M76,64A12,12,0,0,1,88,52H216a12,12,0,0,1,0,24H88A12,12,0,0,1,76,64Zm140,52H88a12,12,0,0,0,0,24H216a12,12,0,0,0,0-24Zm0,64H88a12,12,0,0,0,0,24H216a12,12,0,0,0,0-24ZM44,112a16,16,0,1,0,16,16A16,16,0,0,0,44,112Zm0-64A16,16,0,1,0,60,64,16,16,0,0,0,44,48Zm0,128a16,16,0,1,0,16,16A16,16,0,0,0,44,176Z`}))],[`duotone`,B.createElement(B.Fragment,null,B.createElement(`path`,{d:`M216,64V192H88V64Z`,opacity:`0.2`}),B.createElement(`path`,{d:`M80,64a8,8,0,0,1,8-8H216a8,8,0,0,1,0,16H88A8,8,0,0,1,80,64Zm136,56H88a8,8,0,1,0,0,16H216a8,8,0,0,0,0-16Zm0,64H88a8,8,0,1,0,0,16H216a8,8,0,0,0,0-16ZM44,52A12,12,0,1,0,56,64,12,12,0,0,0,44,52Zm0,64a12,12,0,1,0,12,12A12,12,0,0,0,44,116Zm0,64a12,12,0,1,0,12,12A12,12,0,0,0,44,180Z`}))],[`fill`,B.createElement(B.Fragment,null,B.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,32ZM68,188a12,12,0,1,1,12-12A12,12,0,0,1,68,188Zm0-48a12,12,0,1,1,12-12A12,12,0,0,1,68,140Zm0-48A12,12,0,1,1,80,80,12,12,0,0,1,68,92Zm124,92H104a8,8,0,0,1,0-16h88a8,8,0,0,1,0,16Zm0-48H104a8,8,0,0,1,0-16h88a8,8,0,0,1,0,16Zm0-48H104a8,8,0,0,1,0-16h88a8,8,0,0,1,0,16Z`}))],[`light`,B.createElement(B.Fragment,null,B.createElement(`path`,{d:`M82,64a6,6,0,0,1,6-6H216a6,6,0,0,1,0,12H88A6,6,0,0,1,82,64Zm134,58H88a6,6,0,0,0,0,12H216a6,6,0,0,0,0-12Zm0,64H88a6,6,0,0,0,0,12H216a6,6,0,0,0,0-12ZM44,54A10,10,0,1,0,54,64,10,10,0,0,0,44,54Zm0,128a10,10,0,1,0,10,10A10,10,0,0,0,44,182Zm0-64a10,10,0,1,0,10,10A10,10,0,0,0,44,118Z`}))],[`regular`,B.createElement(B.Fragment,null,B.createElement(`path`,{d:`M80,64a8,8,0,0,1,8-8H216a8,8,0,0,1,0,16H88A8,8,0,0,1,80,64Zm136,56H88a8,8,0,0,0,0,16H216a8,8,0,0,0,0-16Zm0,64H88a8,8,0,0,0,0,16H216a8,8,0,0,0,0-16ZM44,52A12,12,0,1,0,56,64,12,12,0,0,0,44,52Zm0,64a12,12,0,1,0,12,12A12,12,0,0,0,44,116Zm0,64a12,12,0,1,0,12,12A12,12,0,0,0,44,180Z`}))],[`thin`,B.createElement(B.Fragment,null,B.createElement(`path`,{d:`M84,64a4,4,0,0,1,4-4H216a4,4,0,0,1,0,8H88A4,4,0,0,1,84,64Zm132,60H88a4,4,0,0,0,0,8H216a4,4,0,0,0,0-8Zm0,64H88a4,4,0,0,0,0,8H216a4,4,0,0,0,0-8ZM44,120a8,8,0,1,0,8,8A8,8,0,0,0,44,120Zm0-64a8,8,0,1,0,8,8A8,8,0,0,0,44,56Zm0,128a8,8,0,1,0,8,8A8,8,0,0,0,44,184Z`}))]]),_i=new Map([[`bold`,B.createElement(B.Fragment,null,B.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`,B.createElement(B.Fragment,null,B.createElement(`path`,{d:`M216,144a32,32,0,1,1-32-32A32,32,0,0,1,216,144Z`,opacity:`0.2`}),B.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`,B.createElement(B.Fragment,null,B.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`,B.createElement(B.Fragment,null,B.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`,B.createElement(B.Fragment,null,B.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`,B.createElement(B.Fragment,null,B.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`}))]]),vi=new Map([[`bold`,B.createElement(B.Fragment,null,B.createElement(`path`,{d:`M156,112a12,12,0,0,1-12,12H80a12,12,0,0,1,0-24h64A12,12,0,0,1,156,112Zm76.49,120.49a12,12,0,0,1-17,0L168,185a92.12,92.12,0,1,1,17-17l47.54,47.53A12,12,0,0,1,232.49,232.49ZM112,180a68,68,0,1,0-68-68A68.08,68.08,0,0,0,112,180Z`}))],[`duotone`,B.createElement(B.Fragment,null,B.createElement(`path`,{d:`M192,112a80,80,0,1,1-80-80A80,80,0,0,1,192,112Z`,opacity:`0.2`}),B.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,112Zm112,0a8,8,0,0,1-8,8H80a8,8,0,0,1,0-16h64A8,8,0,0,1,152,112Z`}))],[`fill`,B.createElement(B.Fragment,null,B.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.32ZM144,120H80a8,8,0,0,1,0-16h64a8,8,0,0,1,0,16Z`}))],[`light`,B.createElement(B.Fragment,null,B.createElement(`path`,{d:`M150,112a6,6,0,0,1-6,6H80a6,6,0,0,1,0-12h64A6,6,0,0,1,150,112Zm78.24,116.24a6,6,0,0,1-8.48,0l-51.38-51.38a86.15,86.15,0,1,1,8.48-8.48l51.38,51.38A6,6,0,0,1,228.24,228.24ZM112,186a74,74,0,1,0-74-74A74.09,74.09,0,0,0,112,186Z`}))],[`regular`,B.createElement(B.Fragment,null,B.createElement(`path`,{d:`M152,112a8,8,0,0,1-8,8H80a8,8,0,0,1,0-16h64A8,8,0,0,1,152,112Zm77.66,117.66a8,8,0,0,1-11.32,0l-50.06-50.07a88.11,88.11,0,1,1,11.31-11.31l50.07,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`}))],[`thin`,B.createElement(B.Fragment,null,B.createElement(`path`,{d:`M148,112a4,4,0,0,1-4,4H80a4,4,0,0,1,0-8h64A4,4,0,0,1,148,112Zm78.83,114.83a4,4,0,0,1-5.66,0l-52.7-52.7a84.1,84.1,0,1,1,5.66-5.66l52.7,52.7A4,4,0,0,1,226.83,226.83ZM112,188a76,76,0,1,0-76-76A76.08,76.08,0,0,0,112,188Z`}))]]),yi=new Map([[`bold`,B.createElement(B.Fragment,null,B.createElement(`path`,{d:`M230.47,67.5a12,12,0,0,0-19.26-4.32L172.43,99l-12.68-2.72L157,83.57l35.79-38.78a12,12,0,0,0-4.32-19.26A76.07,76.07,0,0,0,88.41,121.64L30.92,174.18a4.68,4.68,0,0,0-.39.38,36,36,0,0,0,50.91,50.91l.38-.39,52.54-57.49A76.05,76.05,0,0,0,230.47,67.5ZM160,148a51.5,51.5,0,0,1-23.35-5.52,12,12,0,0,0-14.26,2.62L64.31,208.66a12,12,0,0,1-17-17l63.55-58.07a12,12,0,0,0,2.62-14.26A51.5,51.5,0,0,1,108,96a52.06,52.06,0,0,1,52-52h.89L135.17,71.87a12,12,0,0,0-2.91,10.65l5.66,26.35a12,12,0,0,0,9.21,9.21l26.35,5.66a12,12,0,0,0,10.65-2.91L212,95.12c0,.3,0,.59,0,.89A52.06,52.06,0,0,1,160,148Z`}))],[`duotone`,B.createElement(B.Fragment,null,B.createElement(`path`,{d:`M224,96a64,64,0,0,1-94.94,56L73,217A24,24,0,0,1,39,183L104,126.94a64,64,0,0,1,80-90.29L144,80l5.66,26.34L176,112l43.35-40A63.8,63.8,0,0,1,224,96Z`,opacity:`0.2`}),B.createElement(`path`,{d:`M226.76,69a8,8,0,0,0-12.84-2.88l-40.3,37.19-17.23-3.7-3.7-17.23,37.19-40.3A8,8,0,0,0,187,29.24,72,72,0,0,0,88,96,72.34,72.34,0,0,0,94,124.94L33.79,177c-.15.12-.29.26-.43.39a32,32,0,0,0,45.26,45.26c.13-.13.27-.28.39-.42L131.06,162A72,72,0,0,0,232,96,71.56,71.56,0,0,0,226.76,69ZM160,152a56.14,56.14,0,0,1-27.07-7,8,8,0,0,0-9.92,1.77L67.11,211.51a16,16,0,0,1-22.62-22.62L109.18,133a8,8,0,0,0,1.77-9.93,56,56,0,0,1,58.36-82.31l-31.2,33.81a8,8,0,0,0-1.94,7.1L141.83,108a8,8,0,0,0,6.14,6.14l26.35,5.66a8,8,0,0,0,7.1-1.94l33.81-31.2A56.06,56.06,0,0,1,160,152Z`}))],[`fill`,B.createElement(B.Fragment,null,B.createElement(`path`,{d:`M232,96a72,72,0,0,1-100.94,66L79,222.22c-.12.14-.26.29-.39.42a32,32,0,0,1-45.26-45.26c.14-.13.28-.27.43-.39L94,124.94a72.07,72.07,0,0,1,83.54-98.78,8,8,0,0,1,3.93,13.19L144,80l5.66,26.35L176,112l40.65-37.52a8,8,0,0,1,13.19,3.93A72.6,72.6,0,0,1,232,96Z`}))],[`light`,B.createElement(B.Fragment,null,B.createElement(`path`,{d:`M224.91,69.75a6,6,0,0,0-9.63-2.16l-41.07,37.9L154.7,101.3l-4.19-19.51,37.9-41.07a6,6,0,0,0-2.16-9.63,70,70,0,0,0-89.77,94.39l-61.39,53c-.11.09-.21.19-.32.3A30,30,0,0,0,77.2,221.23c.11-.11.21-.21.3-.32l53-61.39a70,70,0,0,0,94.39-89.77ZM160,154a58,58,0,0,1-28-7.22,6,6,0,0,0-7.45,1.33L68.57,212.88a18,18,0,0,1-25.45-25.45l64.76-55.94A6,6,0,0,0,109.2,124a58,58,0,0,1,64-84.53L139.58,75.93a6,6,0,0,0-1.45,5.33l5.65,26.35a6,6,0,0,0,4.61,4.61l26.35,5.65a6,6,0,0,0,5.33-1.45L216.49,82.8A58.06,58.06,0,0,1,160,154Z`}))],[`regular`,B.createElement(B.Fragment,null,B.createElement(`path`,{d:`M226.76,69a8,8,0,0,0-12.84-2.88l-40.3,37.19-17.23-3.7-3.7-17.23,37.19-40.3A8,8,0,0,0,187,29.24,72,72,0,0,0,88,96,72.34,72.34,0,0,0,94,124.94L33.79,177c-.15.12-.29.26-.43.39a32,32,0,0,0,45.26,45.26c.13-.13.27-.28.39-.42L131.06,162A72,72,0,0,0,232,96,71.56,71.56,0,0,0,226.76,69ZM160,152a56.14,56.14,0,0,1-27.07-7,8,8,0,0,0-9.92,1.77L67.11,211.51a16,16,0,0,1-22.62-22.62L109.18,133a8,8,0,0,0,1.77-9.93,56,56,0,0,1,58.36-82.31l-31.2,33.81a8,8,0,0,0-1.94,7.1L141.83,108a8,8,0,0,0,6.14,6.14l26.35,5.66a8,8,0,0,0,7.1-1.94l33.81-31.2A56.06,56.06,0,0,1,160,152Z`}))],[`thin`,B.createElement(B.Fragment,null,B.createElement(`path`,{d:`M223.05,70.5a4,4,0,0,0-6.42-1.44l-41.82,38.6L153,103l-4.68-21.79,38.6-41.82a4,4,0,0,0-1.44-6.43A68,68,0,0,0,98.94,126L36.4,180l-.21.2a28,28,0,0,0,39.6,39.6l.2-.21,54-62.54A68,68,0,0,0,228,96,67.51,67.51,0,0,0,223.05,70.5ZM160,156a60,60,0,0,1-29-7.47,4,4,0,0,0-5,.89L70,214.25A20,20,0,0,1,41.75,186l64.82-56a4,4,0,0,0,.89-5,60,60,0,0,1,69.46-86.59L141.05,77.29a4,4,0,0,0-1,3.55l5.66,26.35a4,4,0,0,0,3.07,3.07l26.35,5.66a4,4,0,0,0,3.55-1l38.87-35.87A60.05,60.05,0,0,1,160,156Z`}))]]),bi=B.forwardRef((e,t)=>B.createElement(g,{ref:t,...e,weights:si}));bi.displayName=`ArrowClockwiseIcon`;var xi=bi,Si=B.forwardRef((e,t)=>B.createElement(g,{ref:t,...e,weights:ci}));Si.displayName=`ArrowCounterClockwiseIcon`;var Ci=Si,wi=B.forwardRef((e,t)=>B.createElement(g,{ref:t,...e,weights:li}));wi.displayName=`ArrowsOutIcon`;var Ti=wi,Ei=B.forwardRef((e,t)=>B.createElement(g,{ref:t,...e,weights:ui}));Ei.displayName=`CaretUpIcon`;var Di=Ei,Oi=B.forwardRef((e,t)=>B.createElement(g,{ref:t,...e,weights:di}));Oi.displayName=`ChatCircleTextIcon`;var ki=Oi,Ai=B.forwardRef((e,t)=>B.createElement(g,{ref:t,...e,weights:fi}));Ai.displayName=`ClockIcon`;var ji=Ai,Mi=B.forwardRef((e,t)=>B.createElement(g,{ref:t,...e,weights:pi}));Mi.displayName=`ClockCounterClockwiseIcon`;var Ni=Mi,Pi=B.forwardRef((e,t)=>B.createElement(g,{ref:t,...e,weights:mi}));Pi.displayName=`InfoIcon`;var Fi=Pi,Ii=B.forwardRef((e,t)=>B.createElement(g,{ref:t,...e,weights:hi}));Ii.displayName=`KeyboardIcon`;var Li=Ii,Ri=B.forwardRef((e,t)=>B.createElement(g,{ref:t,...e,weights:gi}));Ri.displayName=`ListBulletsIcon`;var zi=Ri,Bi=B.forwardRef((e,t)=>B.createElement(g,{ref:t,...e,weights:_i}));Bi.displayName=`ListMagnifyingGlassIcon`;var Vi=Bi,Hi=B.forwardRef((e,t)=>B.createElement(g,{ref:t,...e,weights:vi}));Hi.displayName=`MagnifyingGlassMinusIcon`;var Ui=Hi,Wi=B.forwardRef((e,t)=>B.createElement(g,{ref:t,...e,weights:yi}));Wi.displayName=`WrenchIcon`;var Gi=Wi,Ki=l(re(),1),qi=`$__all`;function Ji(e){let{margin:t,containerPadding:n,containerWidth:r,cols:i}=e;return(r-t[0]*(i-1)-n[0]*2)/i}function Yi(e,t,n){return Number.isFinite(e)?Math.round(t*e+Math.max(0,e-1)*n):e}function Xi(e,t,n,r,i,a,o){let{margin:s,containerPadding:c,rowHeight:l}=e,u=Ji(e),d,f,p,m;if(o?(d=Math.round(o.width),f=Math.round(o.height)):(d=Yi(r,u,s[0]),f=Yi(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 Zi(e,t,n,r,i){let{margin:a,containerPadding:o,cols:s,rowHeight:c,maxRows:l}=e,u=Ji(e),d=Math.round((n-o[0])/(u+a[0])),f=Math.round((t-o[1])/(c+a[1]));return d=ea(d,0,s-r),f=ea(f,0,l-i),{x:d,y:f}}function Qi(e,t,n){let{margin:r,containerPadding:i,rowHeight:a}=e,o=Ji(e);return{x:Math.round((n-i[0])/(o+r[0])),y:Math.round((t-i[1])/(a+r[1]))}}function $i(e,t,n){let{margin:r,rowHeight:i}=e,a=Ji(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 ea(e,t,n){return Math.max(Math.min(e,n),t)}function ta(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 na(e,t){for(let n=0;nta(e,t))}function ia(e,t){return t===`horizontal`?oa(e):t===`vertical`||t===`wrap`?aa(e):[...e]}function aa(e){return[...e].sort((e,t)=>e.y===t.y?e.x-t.x:e.y-t.y)}function oa(e){return[...e].sort((e,t)=>e.x===t.x?e.y-t.y:e.x-t.x)}function sa(e){let t=0;for(let n=0;nt&&(t=e)}}return t}function ca(e,t){for(let n=0;ne.static===!0)}function ua(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 da(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.y===1/0&&(i.y=sa(n)),!i.static)n.push(i);else for(;na(n,i);)i.y++}}return e}function ha(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=ia(e,o);(o===`vertical`&&typeof r==`number`?u>=r:o===`horizontal`&&typeof n==`number`&&l>=n)&&(d=d.reverse());let f=ra(d,t),p=f.length>0;if(p&&c)return da(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 ha(e,n,o?a.x:void 0,s?a.y:void 0,r,c,i);if(u&&s)return ha(e,n,void 0,n.y+1,r,c,i);if(u&&i===null){let r=n.y;return t.y=r,n.y=r+t.h,[...e]}if(d&&o)return ha(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]:ha(e,n,l,u,r,c,i)}function _a(e,t,n){return Math.max(t,Math.min(n,e))}var va=[{name:`gridBounds`,constrainPosition(e,t,n,{cols:r,maxRows:i}){return{x:_a(t,0,Math.max(0,r-e.w)),y:_a(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:_a(t,1,Math.max(1,o)),h:_a(n,1,Math.max(1,s))}}},{name:`minMaxSize`,constrainSize(e,t,n){return{w:_a(t,e.minW??1,e.maxW??1/0),h:_a(n,e.minH??1,e.maxH??1/0)}}}];function ya(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 ba(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 xa({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 Sa({top:e,left:t,width:n,height:r}){return{top:`${e}px`,left:`${t}px`,width:`${n}px`,height:`${r}px`,position:`absolute`}}function Ca(e){return e*100+`%`}function wa(e,t,n,r){return e+n>r?t:n}function Ta(e,t,n){return e<0?t:n}function Ea(e){return Math.max(0,e)}function Da(e){return Math.max(0,e)}var Oa=(e,t,n)=>{let{left:r,height:i,width:a}=t,o=e.top-(i-e.height);return{left:r,width:a,height:Ta(o,e.height,i),top:Da(o)}},ka=(e,t,n)=>{let{top:r,left:i,height:a,width:o}=t;return{top:r,height:a,width:wa(e.left,e.width,o,n),left:Ea(i)}},Aa=(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:Da(r),left:0}:{height:i,width:a,top:Da(r),left:o}},ja=(e,t,n)=>{let{top:r,left:i,height:a,width:o}=t;return{width:o,left:i,height:Ta(r,e.height,a),top:Da(r)}},Ma={n:Oa,ne:(e,t,n)=>Oa(e,ka(e,t,n)),e:ka,se:(e,t,n)=>ja(e,ka(e,t,n)),s:ja,sw:(e,t,n)=>ja(e,Aa(e,t)),w:Aa,nw:(e,t,n)=>Oa(e,Aa(e,t))};function Na(e,t,n,r){let i=Ma[e];return i?i(t,{...t,...n},r):n}var Pa={type:`transform`,scale:1,calcStyle(e){return xa(e)}},Fa={cols:12,rowHeight:150,margin:[10,10],containerPadding:null,maxRows:1/0},Ia={enabled:!0,bounded:!1,threshold:3},La={enabled:!0,handles:[`se`]},Ra={enabled:!1,defaultItem:{w:1,h:1},touchEnabled:!0,touchDragSource:`[data-rgl-draggable]`};function za(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??la(e).length>0;for(let i=o+1;it.y+t.h)break;ta(t,o)&&za(e,o,n+t[a],r,s)}}t[r]=n}function Ba(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&&!na(e,t);)t.y--;let i;for(;(i=na(e,t))!==void 0;)za(n,t,i.y+i.h,`y`);return t.y=Math.max(t.y,0),t}function Va(e,t,n,r){for(t.x=Math.max(t.x,0),t.y=Math.max(t.y,0);t.x>0&&!na(e,t);)t.x--;let i;for(;(i=na(e,t))!==void 0;)if(za(r,t,i.x+i.w,`x`),t.x+t.w>n)for(t.x=n-t.w,t.y++;t.x>0&&!na(e,t);)t.x--;return t.x=Math.max(t.x,0),t}var Ha={type:`vertical`,allowOverlap:!1,compact(e,t){let n=la(e),r=sa(n),i=aa(e),a=Array(e.length);for(let t=0;te[t]-e[n])}function Xa(e,t){let n=Ya(e),r=n[0];if(r===void 0)throw Error(`No breakpoints defined`);for(let i=1;ie[a]&&(r=a)}return r}function Za(e,t){let n=t[e];if(n===void 0)throw Error(`ResponsiveReactGridLayout: \`cols\` entry for breakpoint ${String(e)} is missing!`);return n}function Qa(e,t,n,r,i,a){let o=e[n];if(o)return da(o);let s=e[r],c=Ya(t),l=c.slice(c.indexOf(n));for(let t=0;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 M(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=M,e.createCustomEqual=j,e.deepEqual=w,e.sameValueZeroEqual=o,e.shallowEqual=E,Object.defineProperty(e,"__esModule",{value:!0})}))})),to=v(((e,t)=>{t.exports=`SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED`})),no=v(((e,t)=>{var n=to();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}})),ro=v(((e,t)=>{t.exports=no()()})),io=l(ro(),1);function ao(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&&ao(e.changedTouches,e=>t===e.identifier)}function Ao(e){if(e.targetTouches&&e.targetTouches[0])return e.targetTouches[0].identifier;if(e.changedTouches&&e.changedTouches[0])return e.changedTouches[0].identifier}function jo(){return typeof __webpack_nonce__<`u`?__webpack_nonce__:void 0}function Mo(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??jo();r&&n.setAttribute(`nonce`,r),n.innerHTML=`.react-draggable-transparent-selection *::-moz-selection {all: inherit;} +import{A as e,C as t,D as n,E as r,K as i,M as a,O as o,P as s,S as c,St as l,T as u,X as d,Y as f,Z as p,_ as m,_t as h,a as g,at as _,bt as v,c as y,ct as b,d as x,et as S,f as C,ft as w,g as T,h as E,j as D,k as O,lt as k,m as A,mt as j,o as M,ot as N,p as P,r as F,s as I,tt as L,u as ee,ut as te,v as ne,vt as re,x as ie,xt as ae,y as R,yt as oe}from"./brand-B8x2UvAx.js";import{c as z,l as se,o as ce,r as le,s as ue}from"./auth-BBLbNg3S.js";import{_ as de,c as fe,h as pe,m as me,s as he}from"./preload-helper-GZwLLn44.js";import{$ as ge,A as _e,B as ve,C as ye,D as be,F as xe,G as Se,H as Ce,I as we,J as Te,K as Ee,L as De,M as Oe,N as ke,O as Ae,P as je,R as Me,T as Ne,U as Pe,V as Fe,W as Ie,Z as Le,c as Re,d as ze,et as Be,f as Ve,g as He,h as Ue,i as We,j as Ge,k as Ke,l as qe,m as Je,o as Ye,ot as Xe,p as Ze,q as Qe,r as $e,s as et,st as tt,u as nt,v as rt,w as it,y as at,z as ot}from"./theme-CNgJAwSb.js";import{n as st,t as ct}from"./get-single-element-child-C3yy66_3.js";import{C as lt,E as ut,b as dt,o as ft,t as pt,w as mt}from"./Tooltip-BP7AB724.js";import{t as ht}from"./use-computed-color-scheme-DxHBJokx.js";import{E as gt,T as _t,t as vt}from"./useQuery-CJpHjMkr.js";import{n as yt}from"./FocusTrap-yuoZ2xkr.js";import{a as bt,c as xt,d as St,i as Ct,l as wt,n as Tt,o as Et,r as Dt,s as Ot,t as kt,u as At}from"./dashboard-change-chips-DKUpHHI0.js";import{n as jt,r as Mt,t as Nt}from"./WarningCircle.es-D3vbL2zn.js";function Pt(e,t){if(Object.is(e,t))return!0;if(typeof e!=`object`||!e||typeof t!=`object`||!t)return!1;if(e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(let[n,r]of e)if(!t.has(n)||!Object.is(r,t.get(n)))return!1;return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(let n of e)if(!t.has(n))return!1;return!0}if(e instanceof Date&&t instanceof Date)return e.getTime()===t.getTime();let n=Ft(e);if(n.length!==Ft(t).length)return!1;for(let r=0;r{if(typeof n!=`string`||n.trim().length===0)throw Error(t);return`${e}-${n}`}}var V=h();function Lt(e){return typeof e==`object`&&e?`base`in e?e.base:void 0:e}function Rt(e,t){if(e===t||Number.isNaN(e)&&Number.isNaN(t))return!0;if(!(e instanceof Object)||!(t instanceof Object))return!1;let n=Object.keys(e),{length:r}=n;if(r!==Object.keys(t).length)return!1;for(let i=0;i{r.current||=window.setTimeout(()=>{i(...e),r.current=null},t)},[t]),o=(0,B.useCallback)(()=>{r.current&&=(window.clearTimeout(r.current),null)},[]);return(0,B.useEffect)(()=>(n.autoInvoke&&a(),o),[o,a]),{start:a,clear:o}}function Ut(e){let t=(0,B.useRef)(void 0);return(0,B.useEffect)(()=>{t.current=e},[e]),t.current}function Wt(e,t,n){let r=(0,B.useRef)(null);(0,B.useEffect)(()=>{r.current&&=(r.current.disconnect(),null);let i=typeof n==`function`?n():n;return i&&(r.current=new MutationObserver(e),r.current.observe(i,t)),()=>{r.current&&=(r.current.disconnect(),null)}},[e,t,n])}function Gt(){let[e,t]=(0,B.useState)(!1);return(0,B.useEffect)(()=>t(!0),[]),e}function Kt(e){return typeof e==`string`||typeof e==`number`||typeof e==`boolean`||typeof e==`bigint`}function qt(e,t=document){let n=t.querySelector(e);if(n)return n;let r=t.querySelectorAll(`*`);for(let t=0;t{if(!e||!t||!n.current)return;let r=e.getBoundingClientRect(),i=t.getBoundingClientRect(),a=t.offsetWidth===0?1:i.width/t.offsetWidth,o=t.offsetHeight===0?1:i.height/t.offsetHeight,s=window.getComputedStyle(e),c=window.getComputedStyle(t),l=dt(s.borderTopWidth)+dt(c.borderTopWidth),u=dt(s.borderLeftWidth)+dt(c.borderLeftWidth),d={top:(r.top-i.top)/o-l,left:(r.left-i.left)/a-u,width:r.width/a,height:r.height/o};n.current.style.transform=`translateY(${d.top}px) translateX(${d.left}px)`,n.current.style.width=`${d.width}px`,n.current.style.height=`${d.height}px`},p=()=>{window.clearTimeout(o.current),n.current&&(n.current.style.transitionDuration=`0ms`),f(),o.current=window.setTimeout(()=>{n.current&&(n.current.style.transitionDuration=``)},30)},m=(0,B.useRef)(null),h=(0,B.useRef)(null);return(0,B.useEffect)(()=>{if(c&&s.current!==e&&i&&i(),s.current=e,f(),e)return m.current=new ResizeObserver(p),m.current.observe(e),t&&(h.current=new ResizeObserver(p),h.current.observe(t)),()=>{m.current?.disconnect(),h.current?.disconnect()}},[t,e]),(0,B.useEffect)(()=>{if(t){let e=e=>{Zt(e.target,t)&&(p(),d(!1))};return t.addEventListener(`transitionend`,e),()=>{t.removeEventListener(`transitionend`,e)}}},[t]),(0,B.useEffect)(()=>{if(n.current&&a){let e=e=>{e.propertyName===`transform`&&a()};return n.current.addEventListener(`transitionend`,e),()=>{n.current?.removeEventListener(`transitionend`,e)}}},[a]),Ht(()=>{St()!==`test`&&l(!0)},20,{autoInvoke:!0}),Wt(e=>{e.forEach(e=>{e.type===`attributes`&&e.attributeName===`dir`&&p()})},{attributes:!0,attributeFilter:[`dir`]},()=>document.documentElement),{initialized:c,hidden:u}}var $t={root:`m_96b553a6`},en=d((e,{transitionDuration:t},{shouldReduceMotion:n})=>({root:{"--transition-duration":e.respectReducedMotion&&n?`0ms`:typeof t==`number`?`${t}ms`:t||`150ms`}})),tn=u(n=>{let r=a(`FloatingIndicator`,null,n),{classNames:i,className:o,style:s,styles:c,unstyled:l,vars:u,target:d,parent:f,transitionDuration:m,mod:h,displayAfterTransitionEnd:g,onTransitionStart:_,onTransitionEnd:v,attributes:y,ref:b,...x}=r,C=p(),w=e({name:`FloatingIndicator`,classes:$t,props:r,className:o,style:s,classNames:i,styles:c,unstyled:l,attributes:y,vars:u,varsResolver:en,stylesCtx:{shouldReduceMotion:C}}),T=(0,B.useRef)(null),{initialized:E,hidden:D}=Qt({target:d,parent:f,ref:T,displayAfterTransitionEnd:g,onTransitionStart:_,onTransitionEnd:v}),O=S(b,T);return!d||!f?null:(0,V.jsx)(t,{ref:O,mod:[{initialized:E,hidden:D},h],...w(`root`),...x})});tn.displayName=`@mantine/core/FloatingIndicator`,tn.classes=$t,tn.varsResolver=en;var[nn,rn]=ut(`Accordion component was not found in the tree`),[an,on]=ut(`Accordion.Item component was not found in the tree`),sn={root:`m_9bdbb667`,panel:`m_df78851f`,content:`m_4ba554d4`,itemTitle:`m_8fa820a0`,control:`m_4ba585b8`,"control--default":`m_6939a5e9`,"control--contained":`m_4271d21b`,label:`m_df3ffa0f`,chevron:`m_3f35ae96`,icon:`m_9bd771fe`,item:`m_9bd7b098`,"item--default":`m_fe19b709`,"item--contained":`m_1f921b3b`,"item--filled":`m_2cdf939a`,"item--separated":`m_9f59b069`},cn=u(e=>{let{classNames:n,className:r,style:i,styles:o,vars:s,chevron:l,icon:u,onClick:d,onKeyDown:f,children:p,disabled:m,mod:h,...g}=a(`AccordionControl`,null,e),{value:_}=on(),v=rn(),y=v.isItemActive(_),b=typeof v.order==`number`,x=`h${v.order}`,S=(0,V.jsxs)(c,{...v.getStyles(`control`,{className:r,classNames:n,style:i,styles:o,variant:v.variant}),unstyled:v.unstyled,mod:[`accordion-control`,{active:y,"chevron-position":v.chevronPosition,disabled:m},h],onClick:e=>{d?.(e),v.onChange(_)},type:`button`,disabled:m,"aria-expanded":y,"aria-controls":v.getRegionId(_),id:v.getControlId(_),onKeyDown:ge({siblingSelector:`[data-accordion-control]`,parentSelector:`[data-accordion]`,activateOnFocus:!1,loop:v.loop,orientation:`vertical`,onKeyDown:f}),...g,children:[(0,V.jsx)(t,{component:`span`,mod:{rotate:!v.disableChevronRotation&&y,position:v.chevronPosition},...v.getStyles(`chevron`,{classNames:n,styles:o}),children:l||v.chevron}),(0,V.jsx)(`span`,{...v.getStyles(`label`,{classNames:n,styles:o}),children:p}),u&&(0,V.jsx)(t,{component:`span`,mod:{"chevron-position":v.chevronPosition},...v.getStyles(`icon`,{classNames:n,styles:o}),children:u})]});return b?(0,V.jsx)(x,{...v.getStyles(`itemTitle`,{classNames:n,styles:o}),children:S}):S});cn.displayName=`@mantine/core/AccordionControl`,cn.classes=sn;var ln=u(e=>{let{classNames:n,className:r,style:i,styles:o,vars:s,value:c,mod:l,...u}=a(`AccordionItem`,null,e),d=rn();return(0,V.jsx)(an,{value:{value:c},children:(0,V.jsx)(t,{mod:[{active:d.isItemActive(c)},l],...d.getStyles(`item`,{className:r,classNames:n,styles:o,style:i,variant:d.variant}),...u})})});ln.displayName=`@mantine/core/AccordionItem`,ln.classes=sn;var un=u(e=>{let{classNames:t,className:n,style:r,styles:i,vars:o,children:s,keepMounted:c,keepMountedMode:l,...u}=a(`AccordionPanel`,null,e),{value:d}=on(),f=rn();return(0,V.jsx)(At,{...f.getStyles(`panel`,{className:n,classNames:t,style:r,styles:i}),expanded:f.isItemActive(d),transitionDuration:f.transitionDuration??200,role:`region`,id:f.getRegionId(d),"aria-labelledby":f.getControlId(d),keepMounted:c??f.keepMounted,keepMountedMode:l??f.keepMountedMode,...u,children:(0,V.jsx)(`div`,{...f.getStyles(`content`,{classNames:t,styles:i}),children:s})})});un.displayName=`@mantine/core/AccordionPanel`,un.classes=sn;var dn={multiple:!1,loop:!0,disableChevronRotation:!1,disableCollapse:!1,chevronPosition:`right`,variant:`default`,chevronSize:`auto`,chevronIconSize:16,keepMountedMode:`activity`},fn=d((e,{transitionDuration:t,chevronSize:n,radius:r})=>({root:{"--accordion-transition-duration":t===void 0?void 0:`${t}ms`,"--accordion-chevron-size":n===void 0?void 0:w(n),"--accordion-radius":r===void 0?void 0:N(r)}})),pn=r(n=>{let r=a(`Accordion`,dn,n),{classNames:i,className:o,style:s,styles:c,unstyled:l,vars:u,children:d,multiple:f,value:p,defaultValue:m,onChange:h,id:g,loop:_,transitionDuration:v,disableChevronRotation:y,disableCollapse:b,chevronPosition:x,chevronSize:S,order:C,chevron:w,variant:T,radius:E,chevronIconSize:D,attributes:O,keepMounted:k,keepMountedMode:A,...j}=r,M=L(g),[N,P]=se({value:p,defaultValue:m,finalValue:f?[]:null,onChange:h}),F=e=>Array.isArray(N)?N.includes(e):e===N,I=e=>{if(!Array.isArray(N)&&b&&e===N)return;let t=Array.isArray(N)?N.includes(e)?N.filter(t=>t!==e):[...N,e]:e===N?null:e;P(t)},ee=e({name:`Accordion`,classes:sn,props:r,className:o,style:s,classNames:i,styles:c,unstyled:l,attributes:O,vars:u,varsResolver:fn});return(0,V.jsx)(nn,{value:{isItemActive:F,onChange:I,getControlId:It(`${M}-control`,`Accordion.Item component was rendered with invalid value or without value`),getRegionId:It(`${M}-panel`,`Accordion.Item component was rendered with invalid value or without value`),chevron:w===null?null:w||(0,V.jsx)(Ee,{size:D}),transitionDuration:v,disableChevronRotation:y,chevronPosition:x,order:C,loop:_,getStyles:ee,variant:T,unstyled:l,keepMounted:k,keepMountedMode:A},children:(0,V.jsx)(t,{...ee(`root`),id:M,...j,variant:T,"data-accordion":!0,children:d})})});pn.classes=sn,pn.varsResolver=fn,pn.displayName=`@mantine/core/Accordion`,pn.Item=ln,pn.Panel=un,pn.Control=cn,pn.Chevron=Ee;function mn(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=>mn(e))}:typeof e==`number`||typeof e==`bigint`||typeof e==`boolean`?{value:e,label:`${e}`}:e}function hn(e){return e?e.map(e=>mn(e)):[]}function gn(e){return e.reduce((e,t)=>`group`in t?{...e,...gn(t.items)}:(e[`${t.value}`]=t,e),{})}var _n={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`},vn={error:null},yn=d((e,{size:t,color:n})=>({chevron:{"--combobox-chevron-size":b(t,`combobox-chevron-size`),"--combobox-chevron-color":n?i(n,e):void 0}})),bn=u(n=>{let r=a(`ComboboxChevron`,vn,n),{size:i,error:o,style:s,className:c,classNames:l,styles:u,unstyled:d,vars:f,attributes:p,mod:m,...h}=r,g=e({name:`ComboboxChevron`,classes:_n,props:r,style:s,className:c,classNames:l,styles:u,unstyled:d,vars:f,varsResolver:yn,attributes:p,rootSelector:`chevron`});return(0,V.jsx)(t,{component:`svg`,...h,...g(`chevron`),size:i,viewBox:`0 0 15 15`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,mod:[`combobox-chevron`,{error:o},m],children:(0,V.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`})})});bn.classes=_n,bn.varsResolver=yn,bn.displayName=`@mantine/core/ComboboxChevron`;var[xn,Sn]=ut(`Combobox component was not found in tree`);function Cn({onMouseDown:e,onClick:t,onClear:n,...r}){return(0,V.jsx)(E.ClearButton,{tabIndex:-1,"aria-hidden":!0,...r,onMouseDown:t=>{t.preventDefault(),e?.(t)},onClick:e=>{n(),t?.(e)}})}Cn.displayName=`@mantine/core/ComboboxClearButton`;var wn=u(e=>{let{classNames:t,styles:n,className:r,style:i,hidden:o,...s}=a(`ComboboxDropdown`,null,e),c=Sn();return(0,V.jsx)(Qe.Dropdown,{...s,role:`presentation`,"data-hidden":o||void 0,"data-floating-height":c.floatingHeight||void 0,...c.getStyles(`dropdown`,{className:r,style:i,classNames:t,styles:n})})});wn.classes=_n,wn.displayName=`@mantine/core/ComboboxDropdown`;var Tn={refProp:`ref`},En=u(e=>{let{children:t,refProp:n,ref:r}=a(`ComboboxDropdownTarget`,Tn,e);if(Sn(),!st(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,V.jsx)(Qe.Target,{ref:r,refProp:n,children:t})});En.displayName=`@mantine/core/ComboboxDropdownTarget`;var Dn=u(e=>{let{classNames:n,className:r,style:i,styles:o,vars:s,...c}=a(`ComboboxEmpty`,null,e),l=Sn();return(0,V.jsx)(t,{...l.getStyles(`empty`,{className:r,classNames:n,styles:o,style:i}),...c})});Dn.classes=_n,Dn.displayName=`@mantine/core/ComboboxEmpty`;function On({onKeyDown:e,onClick:t,withKeyboardNavigation:n,withAriaAttributes:r,withExpandedAttribute:i,targetType:a,autoComplete:o}){let s=Sn(),[c,l]=(0,B.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 kn={refProp:`ref`,targetType:`input`,withKeyboardNavigation:!0,withAriaAttributes:!0,withExpandedAttribute:!1,autoComplete:`off`},An=u(e=>{let{children:t,refProp:n,withKeyboardNavigation:r,withAriaAttributes:i,withExpandedAttribute:o,targetType:s,autoComplete:c,ref:l,...u}=a(`ComboboxEventsTarget`,kn,e),d=ct(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=Sn(),p=On({targetType:s,withAriaAttributes:i,withKeyboardNavigation:r,withExpandedAttribute:o,onKeyDown:d.props.onKeyDown,onClick:d.props.onClick,autoComplete:c});return(0,B.cloneElement)(d,{...p,...u,[n]:S(l,f.store.targetRef,lt(d))})});An.displayName=`@mantine/core/ComboboxEventsTarget`;var jn=u(e=>{let{classNames:n,className:r,style:i,styles:o,vars:s,...c}=a(`ComboboxFooter`,null,e),l=Sn();return(0,V.jsx)(t,{...l.getStyles(`footer`,{className:r,classNames:n,style:i,styles:o}),...c,onMouseDown:e=>{e.preventDefault()}})});jn.classes=_n,jn.displayName=`@mantine/core/ComboboxFooter`;var Mn=u(e=>{let{classNames:n,className:r,style:i,styles:o,vars:s,children:c,label:l,id:u,...d}=a(`ComboboxGroup`,null,e),f=Sn(),p=L(u),m=l!=null&&l!==!1&&l!==``;return(0,V.jsxs)(t,{role:`group`,"aria-labelledby":m?p:void 0,...f.getStyles(`group`,{className:r,classNames:n,style:i,styles:o}),...d,children:[m&&(0,V.jsx)(`div`,{id:p,...f.getStyles(`groupLabel`,{classNames:n,styles:o}),children:l}),c]})});Mn.classes=_n,Mn.displayName=`@mantine/core/ComboboxGroup`;var Nn=u(e=>{let{classNames:n,className:r,style:i,styles:o,vars:s,...c}=a(`ComboboxHeader`,null,e),l=Sn();return(0,V.jsx)(t,{...l.getStyles(`header`,{className:r,classNames:n,style:i,styles:o}),...c,onMouseDown:e=>{e.preventDefault()}})});Nn.classes=_n,Nn.displayName=`@mantine/core/ComboboxHeader`;function Pn({value:e,valuesDivider:t=`,`,...n}){return(0,V.jsx)(`input`,{type:`hidden`,value:Array.isArray(e)?e.join(t):e?`${e}`:``,...n})}Pn.displayName=`@mantine/core/ComboboxHiddenInput`;var Fn=u(e=>{let n=a(`ComboboxOption`,null,e),{classNames:r,className:i,style:o,styles:s,vars:c,onClick:l,id:u,active:d,onMouseDown:f,onMouseOver:p,disabled:m,selected:h,mod:g,..._}=n,v=Sn(),y=(0,B.useId)(),b=u||y;return(0,V.jsx)(t,{...v.getStyles(`option`,{className:i,classNames:r,styles:s,style:o}),"aria-disabled":m||void 0,..._,id:b,mod:[`combobox-option`,{"combobox-active":d,"combobox-disabled":m,"combobox-selected":h},g],role:`option`,onClick:e=>{m?e.preventDefault():(v.onOptionSubmit?.(n.value,n),l?.(e))},onMouseDown:e=>{e.preventDefault(),f?.(e)},onMouseOver:e=>{v.resetSelectionOnOptionHover&&v.store.resetSelectedOption(),p?.(e)}})});Fn.classes=_n,Fn.displayName=`@mantine/core/ComboboxOption`;var In=u(e=>{let{classNames:n,className:r,style:i,styles:o,id:s,onMouseDown:c,labelledBy:l,...u}=a(`ComboboxOptions`,null,e),d=Sn(),f=L(s);return(0,B.useEffect)(()=>{d.store.setListId(f)},[f]),(0,V.jsx)(t,{...d.getStyles(`options`,{className:r,style:i,classNames:n,styles:o}),...u,id:f,role:`listbox`,"aria-labelledby":l,onMouseDown:e=>{e.preventDefault(),c?.(e)}})});In.classes=_n,In.displayName=`@mantine/core/ComboboxOptions`;var Ln={withAriaAttributes:!0,withKeyboardNavigation:!0},Rn=u(e=>{let{classNames:t,styles:n,unstyled:r,vars:i,withAriaAttributes:o,onKeyDown:s,onClick:c,withKeyboardNavigation:l,size:u,ref:d,...f}=a(`ComboboxSearch`,Ln,e),p=Sn(),m=p.getStyles(`search`),h=On({targetType:`input`,withAriaAttributes:o,withKeyboardNavigation:l,withExpandedAttribute:!1,onKeyDown:s,onClick:c,autoComplete:`off`});return(0,V.jsx)(E,{ref:S(d,p.store.searchRef),classNames:[{input:m.className},t],styles:[{input:m.style},n],size:u||p.size,...h,...f,__staticSelector:`Combobox`})});Rn.classes=_n,Rn.displayName=`@mantine/core/ComboboxSearch`;var zn={refProp:`ref`,targetType:`input`,withKeyboardNavigation:!0,withAriaAttributes:!0,withExpandedAttribute:!1,autoComplete:`off`},Bn=u(e=>{let{children:t,refProp:n,withKeyboardNavigation:r,withAriaAttributes:i,withExpandedAttribute:o,targetType:s,autoComplete:c,ref:l,...u}=a(`ComboboxTarget`,zn,e),d=ct(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=Sn(),p=On({targetType:s,withAriaAttributes:i,withKeyboardNavigation:r,withExpandedAttribute:o,onKeyDown:d.props.onKeyDown,onClick:d.props.onClick,autoComplete:c}),m=(0,B.cloneElement)(d,{...p,...u});return(0,V.jsx)(Qe.Target,{refProp:n,ref:S(l,f.store.targetRef),children:m})});Bn.displayName=`@mantine/core/ComboboxTarget`;function Vn(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 Hn(e,t,n){for(let n=e+1;n{s||(c(!0),i?.(e))},[c,i,s]),_=(0,B.useCallback)((e=`unknown`)=>{s&&(c(!1),r?.(e))},[c,r,s]),v=(0,B.useCallback)((e=`unknown`)=>{s?_(e):g(e)},[_,g,s]),y=(0,B.useCallback)(()=>{let e=Yt(f.current);qt(`#${l.current} [data-combobox-selected]`,e)?.removeAttribute(`data-combobox-selected`)},[]),b=(0,B.useCallback)(e=>{let t=Yt(f.current),n=qt(`#${l.current}`,t),r=n?Jt(`[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].scrollIntoView({block:`nearest`,behavior:o}),r[i].id):null},[o,y]),x=(0,B.useCallback)(()=>{let e=Yt(f.current),t=qt(`#${l.current} [data-combobox-active]`,e);if(t){let n=Jt(`#${l.current} [data-combobox-option]`,e).findIndex(e=>e===t);return b(n)}return b(0)},[b]),S=(0,B.useCallback)(()=>{let e=Yt(f.current),t=Jt(`#${l.current} [data-combobox-option]`,e);return b(Hn(u.current,t,a))},[b,a]),C=(0,B.useCallback)(()=>{let e=Yt(f.current),t=Jt(`#${l.current} [data-combobox-option]`,e);return b(Vn(u.current,t,a))},[b,a]),w=(0,B.useCallback)(()=>{let e=Yt(f.current),t=Jt(`#${l.current} [data-combobox-option]`,e);return b(Un(t))},[b]),T=(0,B.useCallback)((e=`selected`,t)=>{if(typeof e==`number`){u.current=e;let n=Yt(f.current),r=Jt(`#${l.current} [data-combobox-option]`,n);t?.scrollIntoView&&r[e]?.scrollIntoView({block:`nearest`,behavior:o});return}h.current=window.setTimeout(()=>{let n=Yt(f.current),r=Jt(`#${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,B.useCallback)(()=>{u.current=-1,y()},[y]),D=(0,B.useCallback)(()=>{let e=Yt(f.current);(Jt(`#${l.current} [data-combobox-option]`,e)?.[u.current])?.click()},[]),O=(0,B.useCallback)(e=>{l.current=e},[]),k=(0,B.useCallback)(()=>{p.current=window.setTimeout(()=>d.current?.focus(),0)},[]),A=(0,B.useCallback)(()=>{m.current=window.setTimeout(()=>f.current?.focus(),0)},[]),j=(0,B.useCallback)(()=>u.current,[]);return(0,B.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 Gn={keepMounted:!0,keepMountedMode:`display-none`,withinPortal:!0,resetSelectionOnOptionHover:!1,width:`target`,transitionProps:{transition:`fade`,duration:0},size:`sm`},Kn=d((e,{size:t,dropdownPadding:n})=>({options:{"--combobox-option-fz":_(t),"--combobox-option-padding":b(t,`combobox-option-padding`)},dropdown:{"--combobox-padding":n===void 0?void 0:w(n),"--combobox-option-fz":_(t),"--combobox-option-padding":b(t,`combobox-option-padding`)}})),qn=t=>{let n=a(`Combobox`,Gn,t),{classNames:r,styles:i,unstyled:o,children:s,store:c,vars:l,onOptionSubmit:u,onClose:d,size:f,dropdownPadding:p,resetSelectionOnOptionHover:m,__staticSelector:h,readOnly:g,attributes:_,floatingHeight:v,middlewares:y,...b}=n,x=v===`viewport`?{...y,flip:!1,size:{...typeof y?.size==`object`?y.size:{},padding:typeof y?.size==`object`&&y.size.padding!==void 0?y.size.padding:10,apply:({availableHeight:e,availableWidth:t,elements:n,...r})=>{n.floating.style.setProperty(`--combobox-floating-max-height`,`${e}px`);let i=y?.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`})}}}:y,S=Wn(),C=c||S,w=e({name:h||`Combobox`,classes:_n,props:n,classNames:r,styles:i,unstyled:o,attributes:_,vars:l,varsResolver:Kn}),T=()=>{d?.(),C.closeDropdown()};return(0,V.jsx)(xn,{value:{getStyles:w,store:C,onOptionSubmit:u,size:f,resetSelectionOnOptionHover:m,readOnly:g,floatingHeight:v},children:(0,V.jsx)(Qe,{opened:C.dropdownOpened,...b,middlewares:x,onChange:e=>!e&&T(),withRoles:!1,unstyled:o,children:s})})};qn.extend=e=>e,qn.classes=_n,qn.varsResolver=Kn,qn.displayName=`@mantine/core/Combobox`,qn.Target=Bn,qn.Dropdown=wn,qn.Options=In,qn.Option=Fn,qn.Search=Rn,qn.Empty=Dn,qn.Chevron=bn,qn.Footer=jn,qn.Header=Nn,qn.EventsTarget=An,qn.DropdownTarget=En,qn.Group=Mn,qn.ClearButton=Cn,qn.HiddenInput=Pn;function Jn({children:e,role:t}){let n=(0,B.use)(T);return n?(0,V.jsx)(`div`,{role:t,"aria-labelledby":n.labelId,"aria-describedby":n.describedBy,children:e}):(0,V.jsx)(V.Fragment,{children:e})}var Yn={root:`m_5f75b09e`,body:`m_5f6e695e`,labelWrapper:`m_d3ea56bb`,label:`m_8ee546b8`,description:`m_328f68c0`,error:`m_8e8a99cc`},Xn=Yn;function Zn({__staticSelector:n,__stylesApiProps:r,className:i,classNames:a,styles:o,unstyled:s,children:c,label:l,description:u,id:d,disabled:f,error:p,size:m,labelPosition:h=`left`,bodyElement:g=`div`,labelElement:v=`label`,variant:y,style:x,vars:S,mod:C,attributes:w,...T}){let D=e({name:n,props:r,className:i,style:x,classes:Yn,classNames:a,styles:o,unstyled:s,attributes:w}),O=u?`${d}-description`:void 0,k=p&&typeof p!=`boolean`?`${d}-error`:void 0;return(0,V.jsx)(t,{...D(`root`),__vars:{"--label-fz":_(m),"--label-lh":b(m,`label-lh`)},mod:[{"label-position":h},C],variant:y,size:m,...T,children:(0,V.jsxs)(t,{component:g,htmlFor:g===`label`?d:void 0,...D(`body`),children:[c,(0,V.jsxs)(`div`,{...D(`labelWrapper`),"data-disabled":f||void 0,children:[l&&(0,V.jsx)(t,{component:v,htmlFor:v===`label`?d:void 0,...D(`label`),"data-disabled":f||void 0,children:l}),u&&(0,V.jsx)(E.Description,{id:O,size:m,__inheritStyles:!1,...D(`description`),children:u}),p&&typeof p!=`boolean`&&(0,V.jsx)(E.Error,{id:k,size:m,__inheritStyles:!1,...D(`error`),children:p})]})]})})}Zn.displayName=`@mantine/core/InlineInput`;function Qn(e){return`group`in e}function $n({options:e,search:t,limit:n}){let r=t.trim().toLowerCase(),i=[];for(let a=0;a0)return!1;return!0}function tr(e,t=new Set){if(Array.isArray(e))for(let n of e)if(Qn(n))tr(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 nr(e,t){return Array.isArray(e)?e.includes(t):e===t}function rr({data:e,withCheckIcon:t,withAlignedLabels:n,value:r,checkIconPosition:i,unstyled:a,renderOption:o}){if(!Qn(e)){let s=nr(r,e.value),c=t&&(s?(0,V.jsx)(Se,{className:_n.optionsDropdownCheckIcon}):n?(0,V.jsx)(`div`,{className:_n.optionsDropdownCheckPlaceholder}):null),l=(0,V.jsxs)(V.Fragment,{children:[i===`left`&&c,(0,V.jsx)(`span`,{children:e.label}),i===`right`&&c]});return(0,V.jsx)(qn.Option,{value:e.value,disabled:e.disabled,className:f({[_n.optionsDropdownOption]:!a}),"data-reverse":i===`right`||void 0,"data-checked":s||void 0,"aria-selected":s,active:s,children:typeof o==`function`?o({option:e,checked:s}):l})}let s=e.items.map(e=>(0,V.jsx)(rr,{data:e,value:r,unstyled:a,withCheckIcon:t,withAlignedLabels:n,checkIconPosition:i,renderOption:o},`${e.value}`));return(0,V.jsx)(qn.Group,{label:e.group,children:s})}function ir({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=Sn();tr(e);let x=typeof i==`string`?(r||$n)({options:e,search:l?i:``,limit:a??1/0}):e,S=er(x),C=x.map((e,t)=>(0,V.jsx)(rr,{data:e,withCheckIcon:u,withAlignedLabels:d,value:f,checkIconPosition:p,unstyled:h,renderOption:_},Qn(e)?`group-${typeof e.group==`string`?e.group:t}`:`${e.value}`));return(0,V.jsx)(qn.Dropdown,{hidden:t||n&&S,"data-composed":!0,children:(0,V.jsxs)(qn.Options,{labelledBy:g,"aria-label":y,children:[c?(0,V.jsx)(ft.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,V.jsx)(qn.Empty,{children:m})]})})}function ar(e,t,n,r){if(t===n||r===`before`&&n===t+1||r===`after`&&n===t-1)return e;let i=e.slice(),[a]=i.splice(t,1),o=t{let t=e.lastElementChild;return t?t instanceof HTMLInputElement?t:t.querySelector(`input`):null},sr=(e,t)=>{if(e===t)return!0;if(e.length!==t.length)return!1;for(let n=0;n{let e=i.current;e&&(i.current=null,sr(o.current,e.expectedValue)&&e.container?.querySelector(`[data-mantine-pill-index="${e.index}"]`)?.focus())});let s=(0,B.useCallback)(e=>{a.current=e},[]);return{getPillProps:e=>{if(n)return{draggable:!0,tabIndex:-1,"data-mantine-pill-index":e,"aria-keyshortcuts":`Alt+ArrowLeft Alt+ArrowRight`,onMouseDown:e=>{e.button===0&&e.stopPropagation()},onDragStart:t=>{t.stopPropagation(),t.dataTransfer.effectAllowed=`move`,t.dataTransfer.setData(`text/plain`,String(e)),r.current.draggedIndex=e;let n=t.currentTarget,i=n.getBoundingClientRect(),a=n.cloneNode(!0);a.removeAttribute(`data-dragging`),a.removeAttribute(`data-drag-over`),a.style.position=`fixed`,a.style.top=`-9999px`,a.style.left=`-9999px`,a.style.width=`${i.width}px`,a.style.height=`${i.height}px`,a.style.pointerEvents=`none`,document.body.appendChild(a),t.dataTransfer.setDragImage(a,t.clientX-i.left,t.clientY-i.top),setTimeout(()=>a.parentNode?.removeChild(a),0),requestAnimationFrame(()=>{n.setAttribute(`data-dragging`,`true`)})},onDragOver:t=>{let{draggedIndex:n}=r.current;if(n===null||n===e)return;let i=t.currentTarget,a=i.getBoundingClientRect(),o=t.clientX-a.left,s=(getComputedStyle(i).direction===`rtl`?o>a.width/2:o{let t=e.currentTarget,n=e.relatedTarget;n&&t.contains(n)||(t.removeAttribute(`data-drag-over`),r.current.currentDropTarget===t&&(r.current.currentDropTarget=null))},onDrop:n=>{n.preventDefault(),n.stopPropagation();let i=n.currentTarget,a=i.getAttribute(`data-drag-over`);i.removeAttribute(`data-drag-over`);let{draggedIndex:s}=r.current;if(s!==null&&a&&s!==e){let n=ar(o.current,s,e,a);n!==o.current&&t(n)}r.current.draggedIndex=null,r.current.currentDropTarget=null},onDragEnd:e=>{e.currentTarget.removeAttribute(`data-dragging`);let t=r.current.currentDropTarget;t&&t.removeAttribute(`data-drag-over`),r.current.draggedIndex=null,r.current.currentDropTarget=null},onKeyDown:n=>{if(n.key!==`ArrowLeft`&&n.key!==`ArrowRight`)return;let r=n.currentTarget,a=getComputedStyle(r).direction===`rtl`?n.key===`ArrowLeft`:n.key===`ArrowRight`,s=a?e+1:e-1;if(n.altKey){if(s<0||s>=o.current.length)return;n.preventDefault(),n.stopPropagation();let c=a?`after`:`before`,l=ar(o.current,e,s,c);if(l===o.current)return;i.current={container:r.parentElement,index:s,expectedValue:l},t(l);return}if(s<0)return;let c=r.parentElement;if(c){if(n.preventDefault(),n.stopPropagation(),s>=o.current.length){or(c)?.focus();return}c.querySelector(`[data-mantine-pill-index="${s}"]`)?.focus()}}}},getListProps:()=>n?{ref:s}:{},handleInputKeyDown:e=>{if(!n||e.key!==`ArrowLeft`)return;let t=e.currentTarget;if(!(t.value.length===0||t.selectionStart===0&&t.selectionEnd===0))return;let r=a.current;if(!r)return;let i=r.querySelectorAll(`[data-mantine-pill-index]`);i.length!==0&&(e.preventDefault(),i[i.length-1].focus())}}}function lr({id:e,label:t,labelProps:n,inputWrapperOrder:r}){if(t&&(!r||r.includes(`label`)))return n?.id||`${e}-label`}function ur(e){let t=e.currentTarget;return Yt(t).activeElement!==t}var dr=(0,B.createContext)(null),fr={root:`m_7cda1cd6`,"root--default":`m_44da308b`,"root--contrast":`m_e3a01f8`,label:`m_1e0e6180`,remove:`m_ae386778`,group:`m_1dcfd90b`},pr=(0,B.createContext)(null),mr=d((e,{gap:t},{size:n})=>({group:{"--pg-gap":t===void 0?b(n,`pg-gap`):b(t)}})),hr=u(n=>{let r=a(`PillGroup`,null,n),{classNames:i,className:o,style:s,styles:c,unstyled:l,vars:u,size:d,disabled:f,attributes:p,...m}=r,h=(0,B.use)(dr)?.size||d||void 0,g=e({name:`PillGroup`,classes:fr,props:r,className:o,style:s,classNames:i,styles:c,unstyled:l,attributes:p,vars:u,varsResolver:mr,stylesCtx:{size:h},rootSelector:`group`});return(0,V.jsx)(pr,{value:{size:h,disabled:f},children:(0,V.jsx)(t,{size:h,...g(`group`),...m})})});hr.classes=fr,hr.varsResolver=mr,hr.displayName=`@mantine/core/PillGroup`;var gr={variant:`default`},_r=d((e,{radius:t},{size:n})=>({root:{"--pill-fz":b(n,`pill-fz`),"--pill-height":b(n,`pill-height`),"--pill-radius":t===void 0?void 0:N(t)}})),vr=u(n=>{let r=a(`Pill`,gr,n),{classNames:i,className:o,style:s,styles:c,unstyled:l,vars:u,variant:d,children:f,withRemoveButton:p,onRemove:m,removeButtonProps:h,radius:g,size:_,disabled:v,mod:y,attributes:b,...x}=r,S=(0,B.use)(pr),C=(0,B.use)(dr),w=_||S?.size||void 0,T=C?.variant===`filled`?`contrast`:d||`default`,E=e({name:`Pill`,classes:fr,props:r,className:o,style:s,classNames:i,styles:c,unstyled:l,attributes:b,vars:u,varsResolver:_r,stylesCtx:{size:w}});return(0,V.jsxs)(t,{component:`span`,variant:T,size:w,...E(`root`,{variant:T}),mod:[{"with-remove":p&&!v,disabled:v||S?.disabled},y],...x,children:[(0,V.jsx)(`span`,{...E(`label`),children:f}),p&&(0,V.jsx)(ne,{variant:`transparent`,radius:g,tabIndex:-1,"aria-hidden":!0,unstyled:l,...h,...E(`remove`,{className:h?.className,style:h?.style}),onMouseDown:e=>{e.preventDefault(),e.stopPropagation(),h?.onMouseDown?.(e)},onClick:e=>{e.stopPropagation(),m?.(),h?.onClick?.(e)}})]})});vr.classes=fr,vr.varsResolver=_r,vr.displayName=`@mantine/core/Pill`,vr.Group=hr;var yr={field:`m_45c4369d`},br={type:`visible`},xr=u(n=>{let r=a(`PillsInputField`,br,n),{classNames:i,className:o,style:s,styles:c,unstyled:l,vars:u,type:d,disabled:f,id:p,pointer:m,mod:h,attributes:g,ref:_,...v}=r,y=(0,B.use)(dr),b=(0,B.use)(T),x=e({name:`PillsInputField`,classes:yr,props:r,className:o,style:s,classNames:i,styles:c,unstyled:l,attributes:g,rootSelector:`field`}),C=f||y?.disabled;return(0,V.jsx)(t,{component:`input`,ref:S(_,y?.fieldRef),"data-type":d,disabled:C,mod:[{disabled:C,pointer:m},h],...x(`field`),...v,id:b?.inputId||p,"aria-invalid":y?.hasError,"aria-describedby":b?.describedBy,type:`text`,onMouseDown:e=>!m&&e.stopPropagation()})});xr.classes=yr,xr.displayName=`@mantine/core/PillsInputField`;var Sr={size:`sm`},Cr=u(e=>{let{children:t,onMouseDown:n,onClick:r,size:i,disabled:o,__staticSelector:s,error:c,variant:l,...u}=a([`Input`,`InputWrapper`,`PillsInput`],Sr,e),d=(0,B.useRef)(null);return(0,V.jsx)(dr,{value:{fieldRef:d,size:i,disabled:o,hasError:!!c,variant:l},children:(0,V.jsx)(A,{size:i,error:c,variant:l,component:`div`,"data-no-overflow":!0,onMouseDown:e=>{e.preventDefault(),n?.(e),d.current?.focus()},onClick:e=>{e.preventDefault(),e.currentTarget.closest(`fieldset`)?.disabled||(d.current?.focus(),r?.(e))},...u,multiline:!0,disabled:o,__staticSelector:s||`PillsInput`,withAria:!1,children:t})})});Cr.displayName=`@mantine/core/PillsInput`,Cr.classes=A.classes,Cr.Field=xr;function wr(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}function Tr(e){return typeof e==`string`?e.trim().toLowerCase():e}function Er({data:e,value:t}){let n=t.map(Tr);return e.reduce((e,t)=>(Qn(t)?e.push({group:t.group,items:t.items.filter(e=>n.indexOf(Tr(e.value))===-1)}):n.indexOf(Tr(t.value))===-1&&e.push(t),e),[])}var Dr={xs:41,sm:50,md:60,lg:72,xl:89},Or={maxValues:1/0,withCheckIcon:!0,checkIconPosition:`left`,hiddenInputValuesDivider:`,`,clearSearchOnChange:!0,openOnFocus:!0,size:`sm`},kr=r(t=>{let n=a([`Input`,`InputWrapper`,`MultiSelect`],Or,t),{classNames:r,className:i,style:s,styles:c,unstyled:l,vars:u,size:d,value:f,defaultValue:p,onChange:m,onKeyDown:h,variant:g,data:_,dropdownOpened:v,defaultDropdownOpened:y,onDropdownOpen:b,onDropdownClose:x,selectFirstOptionOnChange:S,selectFirstOptionOnDropdownOpen:C,onOptionSubmit:w,comboboxProps:T,filter:E,limit:O,withScrollArea:k,maxDropdownHeight:A,floatingHeight:j,searchValue:M,defaultSearchValue:N,onSearchChange:P,readOnly:F,disabled:I,onFocus:ee,onBlur:te,radius:ne,rightSection:re,rightSectionWidth:ie,rightSectionPointerEvents:ae,rightSectionProps:R,leftSection:oe,leftSectionWidth:z,leftSectionPointerEvents:ce,leftSectionProps:le,inputContainer:ue,inputWrapperOrder:de,withAsterisk:fe,labelProps:pe,descriptionProps:me,errorProps:he,successProps:ge,wrapperProps:_e,description:ve,label:ye,error:be,success:xe,maxValues:Se,searchable:Ce,nothingFoundMessage:we,withCheckIcon:Te,withAlignedLabels:Ee,checkIconPosition:De,hidePickedOptions:Oe,withErrorStyles:ke,withSuccessStyles:Ae,name:je,form:Me,id:Ne,clearable:Pe,clearSectionMode:Fe,clearButtonProps:Ie,hiddenInputProps:Le,placeholder:Re,hiddenInputValuesDivider:ze,required:Be,mod:Ve,renderOption:He,renderPill:Ue,onRemove:We,onClear:Ge,onMaxValues:Ke,scrollAreaProps:qe,chevronColor:Je,attributes:Ye,clearSearchOnChange:Xe,openOnFocus:Ze,loading:Qe,loadingPosition:$e,withPillsReorder:et,...tt}=n,nt=L(Ne),rt=lr({id:nt,label:ye,labelProps:pe,inputWrapperOrder:de}),it=hn(_),at=gn(it),ot=(0,B.useRef)({}),st=Wn({opened:v,defaultOpened:y,onDropdownOpen:()=>{b?.(),C&&st.selectFirstOption()},onDropdownClose:()=>{x?.(),st.resetSelectedOption()}}),{styleProps:ct,rest:{type:lt,autoComplete:ut,...dt}}=o(tt),[ft,pt]=se({value:f,defaultValue:p,finalValue:[],onChange:m}),{getPillProps:mt,getListProps:ht,handleInputKeyDown:gt}=cr({value:ft,onChange:pt,enabled:et&&!I&&!F}),[_t,vt]=se({value:M,defaultValue:N,finalValue:``,onChange:P}),yt=e=>{vt(e),st.resetSelectedOption()},bt=e({name:`MultiSelect`,classes:{},props:n,classNames:r,styles:c,unstyled:l,attributes:Ye}),{resolvedClassNames:xt,resolvedStyles:St}=D({props:n,styles:c,classNames:r}),Ct=e=>{h?.(e),!e.defaultPrevented&&(e.key===` `&&!Ce&&(e.preventDefault(),st.toggleDropdown()),e.key===`Backspace`&&_t.length===0&&ft.length>0&&(We?.(ft[ft.length-1]),pt(ft.slice(0,ft.length-1))),gt(e))},wt=ft.map((e,t)=>{let n=at[`${e}`]||ot.current[`${e}`],r=mt(t);return Ue?(0,V.jsx)(B.Fragment,{children:Ue({option:n,value:e,onRemove:()=>{pt(ft.filter(t=>e!==t)),We?.(e)},disabled:I,reorderProps:r})},`${e}-${t}`):(0,V.jsx)(vr,{withRemoveButton:!F&&!at[`${e}`]?.disabled,onRemove:()=>{pt(ft.filter(t=>e!==t)),We?.(e)},unstyled:l,disabled:I,...bt(`pill`),...r,children:n?.label||e},`${e}-${t}`)});(0,B.useEffect)(()=>{S&&st.selectFirstOption()},[S,_t]),(0,B.useEffect)(()=>{ft.forEach(e=>{`${e}`in at&&(ot.current[`${e}`]=at[`${e}`])})},[at,ft]);let Tt=(0,V.jsx)(qn.ClearButton,{...Ie,onClear:()=>{Ge?.(),pt([]),yt(``)}}),Et=Er({data:it,value:ft}),Dt=Pe&&ft.length>0&&!I&&!F,Ot=Dt?{paddingInlineEnd:Dr[d]??Dr.sm}:void 0;return(0,V.jsxs)(V.Fragment,{children:[(0,V.jsxs)(qn,{store:st,classNames:xt,styles:St,unstyled:l,size:d,readOnly:F,__staticSelector:`MultiSelect`,attributes:Ye,floatingHeight:j,onOptionSubmit:e=>{w?.(e),Xe&&yt(``),st.updateSelectedOptionIndex(`selected`),ft.includes(at[`${e}`].value)?(pt(ft.filter(t=>t!==at[`${e}`].value)),We?.(at[`${e}`].value)):ft.lengthCe?st.openDropdown():st.toggleDropdown(),"data-expanded":st.dropdownOpened||void 0,id:nt,required:Be,mod:Ve,attributes:Ye,children:(0,V.jsxs)(vr.Group,{attributes:Ye,disabled:I,unstyled:l,...bt(`pillsList`,{style:Ot}),...ht(),children:[wt,(0,V.jsx)(qn.EventsTarget,{autoComplete:ut,withExpandedAttribute:!0,children:(0,V.jsx)(Cr.Field,{...dt,id:nt,placeholder:Re,type:!Ce&&!Re?`hidden`:`visible`,...bt(`inputField`),unstyled:l,onFocus:e=>{ee?.(e),Ze&&Ce&&st.openDropdown()},onBlur:e=>{te?.(e),st.closeDropdown(),yt(``)},onKeyDown:Ct,value:_t,onChange:e=>{if(ur(e)){if(!F){let t=wr(at,e.currentTarget.value);t&&!ft.includes(t.value)&&ft.length{let{classNames:n,className:r,style:i,styles:o,vars:s,...c}=a(`ProgressLabel`,null,e),l=jr();return(0,V.jsx)(t,{...l.getStyles(`label`,{className:r,style:i,classNames:n,styles:o}),...c})});Nr.classes=Mr,Nr.displayName=`@mantine/core/ProgressLabel`;var Pr=d((e,{size:t,radius:n,transitionDuration:r})=>({root:{"--progress-size":b(t,`progress-size`),"--progress-radius":n===void 0?void 0:N(n),"--progress-transition-duration":typeof r==`number`?`${r}ms`:void 0}})),Fr=u(n=>{let r=a(`ProgressRoot`,null,n),{classNames:i,className:o,style:s,styles:c,unstyled:l,vars:u,autoContrast:d,transitionDuration:f,orientation:p,attributes:m,mod:h,...g}=r,_=e({name:`Progress`,classes:Mr,props:r,className:o,style:s,classNames:i,styles:c,unstyled:l,attributes:m,vars:u,varsResolver:Pr});return(0,V.jsx)(Ar,{value:{getStyles:_,autoContrast:d},children:(0,V.jsx)(t,{mod:[{orientation:p},h],..._(`root`),...g})})});Fr.classes=Mr,Fr.varsResolver=Pr,Fr.displayName=`@mantine/core/ProgressRoot`;var Ir={withAria:!0},Lr=u(e=>{let{classNames:n,className:r,style:o,styles:c,vars:l,value:u,withAria:d,color:f,striped:p,animated:m,mod:h,...g}=a(`ProgressSection`,Ir,e),_=jr(),v=s(),y=d?{role:`progressbar`,"aria-valuemax":100,"aria-valuemin":0,"aria-valuenow":u,"aria-valuetext":`${u}%`}:{};return(0,V.jsx)(t,{..._.getStyles(`section`,{className:r,classNames:n,styles:c,style:o}),...g,...y,mod:[{striped:p||m,animated:m},h],__vars:{"--progress-section-size":`${u}%`,"--progress-section-color":i(f,v),"--progress-label-color":Xt(_.autoContrast,v)?Te({color:f,theme:v,autoContrast:_.autoContrast}):void 0}})});Lr.classes=Mr,Lr.displayName=`@mantine/core/ProgressSection`;var Rr=u(e=>{let t=a(`Progress`,null,e),{value:n,classNames:r,styles:i,vars:o,color:s,striped:c,animated:l,"aria-label":u,...d}=t,{resolvedClassNames:f,resolvedStyles:p}=D({classNames:r,styles:i,props:t});return(0,V.jsx)(Fr,{classNames:f,styles:p,vars:o,...d,children:(0,V.jsx)(Lr,{value:n,color:s,striped:c,animated:l,"aria-label":u})})});Rr.classes=Mr,Rr.displayName=`@mantine/core/Progress`,Rr.Section=Lr,Rr.Root=Fr,Rr.Label=Nr;var zr={root:`m_cf365364`,indicator:`m_9e182ccd`,label:`m_1738fcb2`,input:`m_1714d588`,control:`m_69686b9b`,innerLabel:`m_78882f40`},Br={withItemsBorders:!0},Vr=d((e,{radius:t,color:n,transitionDuration:r,size:a,transitionTimingFunction:o})=>({root:{"--sc-radius":t===void 0?void 0:N(t),"--sc-color":n?i(n,e):void 0,"--sc-shadow":n?void 0:`var(--mantine-shadow-xs)`,"--sc-transition-duration":r===void 0?void 0:`${r}ms`,"--sc-transition-timing-function":o,"--sc-padding":b(a,`sc-padding`),"--sc-font-size":_(a)}})),Hr=r(n=>{let r=a(`SegmentedControl`,Br,n),{classNames:i,className:o,style:c,styles:l,unstyled:u,vars:d,data:f,value:p,defaultValue:m,onChange:h,size:g,name:_,disabled:v,readOnly:y,fullWidth:b,orientation:x,radius:C,color:w,transitionDuration:T,transitionTimingFunction:E,variant:D,autoContrast:O,withItemsBorders:k,mod:A,attributes:j,ref:M,...N}=r,P=e({name:`SegmentedControl`,props:r,classes:zr,className:o,style:c,classNames:i,styles:l,unstyled:u,attributes:j,vars:d,varsResolver:Vr}),F=s(),I=f.map(e=>Kt(e)?{label:`${e}`,value:e}:e),ee=Gt(),[te,ne]=(0,B.useState)(0),[re,ie]=(0,B.useState)(null),[ae,R]=(0,B.useState)({}),oe=(e,t)=>{e!==null&&ae[t]!==e&&(ae[t]=e,R({...ae}))},[z,ce]=se({value:p,defaultValue:m,finalValue:Array.isArray(f)?I.find(e=>!e.disabled)?.value??f[0]?.value??null:null,onChange:h}),le=L(_),ue=I.map(e=>`${e.value}`),de=I.map(e=>(0,B.createElement)(t,{...P(`control`),mod:{active:z===e.value,orientation:x},key:`${e.value}`},(0,B.createElement)(`input`,{...P(`input`),disabled:v||e.disabled,type:`radio`,name:le,value:`${e.value}`,id:`${le}-${e.value}`,checked:z===e.value,onChange:()=>!y&&ce(e.value),"data-focus-ring":F.focusRing,key:`${e.value}-input`}),(0,B.createElement)(t,{component:`label`,...P(`label`),mod:{active:z===e.value&&!(v||e.disabled),disabled:v||e.disabled,"read-only":y},htmlFor:`${le}-${e.value}`,ref:t=>oe(t,`${e.value}`),__vars:{"--sc-label-color":w===void 0?void 0:Te({color:w,theme:F,autoContrast:O})},key:`${e.value}-label`},(0,V.jsx)(`span`,{...P(`innerLabel`),children:e.label})))),fe=S(M,ie);return Vt(()=>{ne(e=>e+1)},[f.length]),Vt(()=>{R(e=>{let t={};return ue.forEach(n=>{n in e&&(t[n]=e[n])}),Object.keys(t).length===Object.keys(e).length?e:t})},[ue]),f.length===0?null:(0,V.jsxs)(t,{...P(`root`),variant:D,size:g,ref:fe,mod:[{"full-width":b,orientation:x,initialized:ee,"with-items-borders":k},A],...N,role:`radiogroup`,"data-disabled":v,children:[z!==void 0&&(0,V.jsx)(tn,{target:ae[`${z}`],parent:re,component:`span`,transitionDuration:`var(--sc-transition-duration)`,...P(`indicator`)},te),de]})});Hr.classes=zr,Hr.varsResolver=Vr,Hr.displayName=`@mantine/core/SegmentedControl`;var Ur={size:`sm`,withCheckIcon:!0,allowDeselect:!0,checkIconPosition:`left`,openOnFocus:!0},Wr=r(e=>{let t=a([`Input`,`InputWrapper`,`Select`],Ur,e),{classNames:n,styles:r,unstyled:i,vars:o,dropdownOpened:s,defaultDropdownOpened:c,onDropdownClose:l,onDropdownOpen:u,onFocus:d,onBlur:f,onClick:p,onChange:m,data:h,value:g,defaultValue:_,selectFirstOptionOnChange:v,selectFirstOptionOnDropdownOpen:y,onOptionSubmit:b,comboboxProps:x,readOnly:S,disabled:C,filter:w,limit:T,withScrollArea:E,maxDropdownHeight:O,floatingHeight:k,size:j,searchable:M,rightSection:N,checkIconPosition:P,withCheckIcon:F,withAlignedLabels:I,nothingFoundMessage:ee,name:te,form:ne,searchValue:re,defaultSearchValue:ie,onSearchChange:ae,allowDeselect:R,error:oe,rightSectionPointerEvents:z,id:ce,clearable:le,clearSectionMode:ue,clearButtonProps:de,hiddenInputProps:fe,renderOption:pe,onClear:me,autoComplete:he,scrollAreaProps:ge,__defaultRightSection:_e,__clearSection:ve,__clearable:ye,chevronColor:be,autoSelectOnBlur:xe,openOnFocus:Se,attributes:Ce,...we}=t,Te=(0,B.useMemo)(()=>hn(h),[h]),Ee=(0,B.useRef)({}),De=(0,B.useMemo)(()=>gn(Te),[Te]),Oe=L(ce),ke=lr({id:Oe,label:we.label,labelProps:we.labelProps,inputWrapperOrder:we.inputWrapperOrder}),[Ae,je,Me]=se({value:g,defaultValue:_,finalValue:null,onChange:m}),Ne=Ae==null?void 0:`${Ae}`in De?De[`${Ae}`]:Ee.current[`${Ae}`],Pe=Ut(Ne),[Fe,Ie,Le]=se({value:re,defaultValue:ie,finalValue:Ne?Ne.label:``,onChange:ae}),Re=Wn({opened:s,defaultOpened:c,onDropdownOpen:()=>{u?.(),y?Re.selectFirstOption():Re.updateSelectedOptionIndex(`active`,{scrollIntoView:!0})},onDropdownClose:()=>{l?.(),setTimeout(Re.resetSelectedOption,0)}}),ze=e=>{Ie(e),Re.resetSelectedOption()},{resolvedClassNames:Be,resolvedStyles:Ve}=D({props:t,styles:r,classNames:n});(0,B.useEffect)(()=>{v&&Re.selectFirstOption()},[v,Fe]),(0,B.useEffect)(()=>{g===null&&ze(``),g!=null&&Ne&&(Pe?.value!==Ne.value||Pe?.label!==Ne.label)&&ze(Ne.label)},[g,Ne]),(0,B.useEffect)(()=>{!Me&&!Le&&ze(Ae==null?``:`${Ae}`in De?De[`${Ae}`]?.label:Ee.current[`${Ae}`]?.label||``)},[De,Ae]),(0,B.useEffect)(()=>{Ae&&`${Ae}`in De&&(Ee.current[`${Ae}`]=De[`${Ae}`])},[De,Ae]);let He=(0,V.jsx)(qn.ClearButton,{...de,onClear:()=>{je(null,null),ze(``),me?.()}}),Ue=le&&Ae!=null&&!C&&!S;return(0,V.jsxs)(V.Fragment,{children:[(0,V.jsxs)(qn,{store:Re,__staticSelector:`Select`,classNames:Be,styles:Ve,unstyled:i,readOnly:S,size:j,attributes:Ce,floatingHeight:k,keepMounted:xe,onOptionSubmit:e=>{b?.(e);let t=R&&`${De[e].value}`==`${Ae}`?null:De[e],n=t?t.value:null;n!==Ae&&je(n,t),!Me&&ze(n==null?``:t?.label||``),Re.closeDropdown()},...x,children:[(0,V.jsx)(qn.Target,{targetType:M?`input`:`button`,autoComplete:he,withExpandedAttribute:!0,children:(0,V.jsx)(A,{id:Oe,__defaultRightSection:(0,V.jsx)(qn.Chevron,{size:j,error:oe,unstyled:i,color:be}),__clearSection:He,__clearable:Ue,__clearSectionMode:ue,rightSection:N,rightSectionPointerEvents:z||`none`,...we,size:j,__staticSelector:`Select`,disabled:C,readOnly:S||!M,value:Fe,onChange:e=>{if(ur(e)){if(!S){let t=wr(De,e.currentTarget.value);t&&`${t.value}`!=`${Ae}`&&(je(t.value,t),!Me&&ze(t.label))}return}ze(e.currentTarget.value),Re.openDropdown(),v&&Re.selectFirstOption()},onFocus:e=>{Se&&M&&Re.openDropdown(),d?.(e)},onBlur:e=>{xe&&Re.clickSelectedOption(),Re.closeDropdown();let t=Ae!=null&&(`${Ae}`in De?De[`${Ae}`]:Ee.current[`${Ae}`]);ze(t&&t.label||``),f?.(e)},onClick:e=>{M?Re.openDropdown():Re.toggleDropdown(),p?.(e)},classNames:Be,styles:Ve,unstyled:i,pointer:!M,error:oe,attributes:Ce})}),(0,V.jsx)(ir,{data:Te,hidden:S||C,filter:w,search:Fe,limit:T,hiddenWhenEmpty:!ee,withScrollArea:E,maxDropdownHeight:O,filterOptions:!!M&&Ne?.label!==Fe,value:Ae,checkIconPosition:P,withCheckIcon:F,withAlignedLabels:I,nothingFoundMessage:ee,unstyled:i,labelId:ke,"aria-label":ke?void 0:we[`aria-label`],renderOption:pe,scrollAreaProps:ge})]}),(0,V.jsx)(qn.HiddenInput,{value:Ae,name:te,form:ne,disabled:C,...fe})]})});Wr.classes={...A.classes,...qn.classes},Wr.displayName=`@mantine/core/Select`;function Gr(e){if(e!==void 0)return typeof e==`number`?w(e):e}function Kr({spacing:e,verticalSpacing:t,cols:n,minColWidth:r,autoRows:i,selector:a}){let o=s(),c=t===void 0?e:t,l=r!==void 0,u=te({"--sg-spacing-x":k(Lt(e)),"--sg-spacing-y":k(Lt(c)),"--sg-auto-rows":i,...l?{"--sg-min-col-width":Gr(r)}:{"--sg-cols":Lt(n)?.toString()}}),d=j(o.breakpoints).reduce((t,r)=>(t[r]||(t[r]={}),typeof e==`object`&&e[r]!==void 0&&(t[r][`--sg-spacing-x`]=k(e[r])),typeof c==`object`&&c[r]!==void 0&&(t[r][`--sg-spacing-y`]=k(c[r])),!l&&typeof n==`object`&&n[r]!==void 0&&(t[r][`--sg-cols`]=n[r]),t),{}),f=Le(j(d),o.breakpoints).filter(e=>j(d[e.value]).length>0).map(e=>({query:`(min-width: ${o.breakpoints[e.value]})`,styles:d[e.value]}));return(0,V.jsx)(O,{styles:u,media:f,selector:a})}function qr(e){return typeof e==`object`&&e?j(e):[]}function Jr(e){return e.sort((e,t)=>Be(e)-Be(t))}function Yr({spacing:e,verticalSpacing:t,cols:n,minColWidth:r}){return Jr(Array.from(new Set([...qr(e),...qr(t),...r===void 0?qr(n):[]])))}function Xr({spacing:e,verticalSpacing:t,cols:n,minColWidth:r,autoRows:i,selector:a}){let o=t===void 0?e:t,s=r!==void 0,c=te({"--sg-spacing-x":k(Lt(e)),"--sg-spacing-y":k(Lt(o)),"--sg-auto-rows":i,...s?{"--sg-min-col-width":Gr(r)}:{"--sg-cols":Lt(n)?.toString()}}),l=Yr({spacing:e,verticalSpacing:t,cols:n,minColWidth:r}),u=l.reduce((t,r)=>(t[r]||(t[r]={}),typeof e==`object`&&e[r]!==void 0&&(t[r][`--sg-spacing-x`]=k(e[r])),typeof o==`object`&&o[r]!==void 0&&(t[r][`--sg-spacing-y`]=k(o[r])),!s&&typeof n==`object`&&n[r]!==void 0&&(t[r][`--sg-cols`]=n[r]),t),{}),d=l.map(e=>({query:`simple-grid (min-width: ${e})`,styles:u[e]}));return(0,V.jsx)(O,{styles:c,container:d,selector:a})}var Zr={container:`m_925c2d2c`,root:`m_2415a157`},Qr={cols:1,spacing:`md`,type:`media`},$r=u(r=>{let i=a(`SimpleGrid`,Qr,r),{classNames:o,className:s,style:c,styles:l,unstyled:u,vars:d,cols:f,verticalSpacing:p,spacing:m,type:h,minColWidth:g,autoFlow:_,autoRows:v,attributes:y,...b}=i,x=e({name:`SimpleGrid`,classes:Zr,props:i,className:s,style:c,classNames:o,styles:l,unstyled:u,attributes:y,vars:d}),S=n(),C=g===void 0?void 0:_||`auto-fill`;return h===`container`?(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(Xr,{...i,selector:`.${S}`}),(0,V.jsx)(`div`,{...x(`container`),children:(0,V.jsx)(t,{...x(`root`,{className:S}),...b,"data-auto-cols":C})})]}):(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(Kr,{...i,selector:`.${S}`}),(0,V.jsx)(t,{...x(`root`,{className:S}),...b,"data-auto-cols":C})]})});$r.classes=Zr,$r.displayName=`@mantine/core/SimpleGrid`;var ei=(0,B.createContext)(null),ti={hiddenInputValuesSeparator:`,`},ni=r((e=>{let{value:t,defaultValue:n,onChange:r,size:i,wrapperProps:o,children:s,readOnly:c,name:l,hiddenInputValuesSeparator:u,hiddenInputProps:d,maxSelectedValues:f,disabled:p,...m}=a(`SwitchGroup`,ti,e),[h,g]=se({value:t,defaultValue:n,finalValue:[],onChange:r}),_=e=>{let t=e.currentTarget.value;if(c)return;let n=h.includes(t);!n&&f&&h.length>=f||g(n?h.filter(e=>e!==t):[...h,t])},v=e=>{if(p)return!0;if(!f)return!1;let t=h.includes(e),n=h.length>=f;return!t&&n},y=h.join(u);return(0,V.jsx)(ei,{value:{value:h,onChange:_,size:i,isDisabled:v},children:(0,V.jsxs)(E.Wrapper,{size:i,...o,...m,labelElement:`div`,__staticSelector:`SwitchGroup`,children:[(0,V.jsx)(Jn,{role:`group`,children:s}),(0,V.jsx)(`input`,{type:`hidden`,name:l,value:y,...d})]})})}));ni.classes=E.Wrapper.classes,ni.displayName=`@mantine/core/SwitchGroup`;var ri={root:`m_5f93f3bb`,input:`m_926b4011`,track:`m_9307d992`,thumb:`m_93039a1d`,trackLabel:`m_8277e082`},ii={labelPosition:`right`,withThumbIndicator:!0},ai=d((e,{radius:t,color:n,size:r})=>({root:{"--switch-radius":t===void 0?void 0:N(t),"--switch-height":b(r,`switch-height`),"--switch-width":b(r,`switch-width`),"--switch-thumb-size":b(r,`switch-thumb-size`),"--switch-label-font-size":b(r,`switch-label-font-size`),"--switch-track-label-padding":b(r,`switch-track-label-padding`),"--switch-color":n?i(n,e):void 0}})),oi=u(n=>{let r=a(`Switch`,ii,n),{classNames:i,className:s,style:c,styles:l,unstyled:u,vars:d,color:f,label:p,offLabel:m,onLabel:h,id:g,size:_,radius:v,wrapperProps:y,thumbIcon:b,checked:x,defaultChecked:S,onChange:C,labelPosition:w,description:T,error:E,disabled:D,variant:O,rootRef:k,mod:A,withThumbIndicator:j,attributes:M,...N}=r,P=(0,B.use)(ei),F=_||P?.size,I=e({name:`Switch`,props:r,classes:ri,className:s,style:c,classNames:i,styles:l,unstyled:u,attributes:M,vars:d,varsResolver:ai}),{styleProps:ee,rest:te}=o(N),ne=L(g),re=[T?`${ne}-description`:void 0,E&&typeof E!=`boolean`?`${ne}-error`:void 0,te[`aria-describedby`]].filter(Boolean).join(` `)||void 0,ie={checked:P?.value.includes(te.value)??x,onChange:e=>{P?.onChange(e),C?.(e)}},ae=D||P?.isDisabled?.(te.value),[R,oe]=se({value:ie.checked??x,defaultValue:S,finalValue:!1});return(0,V.jsxs)(Zn,{...I(`root`),__staticSelector:`Switch`,__stylesApiProps:r,id:ne,size:F,labelPosition:w,label:p,description:T,error:E,disabled:ae,bodyElement:`label`,labelElement:`span`,classNames:i,styles:l,unstyled:u,"data-checked":ie.checked,variant:O,ref:k,mod:A,attributes:M,inert:te.inert,...ee,...y,children:[(0,V.jsx)(`input`,{...te,...ie,disabled:ae,checked:R,"data-checked":ie.checked,onChange:e=>{ie.onChange?.(e),oe(e.currentTarget.checked)},id:ne,type:`checkbox`,role:`switch`,inert:te.inert,"aria-describedby":re,...I(`input`)}),(0,V.jsxs)(t,{"aria-hidden":`true`,component:`span`,mod:{error:E,"label-position":w,"without-labels":!h&&!m},...I(`track`),children:[(0,V.jsx)(t,{component:`span`,mod:{"reduce-motion":!0,"with-thumb-indicator":j&&!b},...I(`thumb`),children:b}),(0,V.jsx)(`span`,{...I(`trackLabel`),children:R?h:m})]})]})});oi.classes={...ri,...Xn},oi.varsResolver=ai,oi.displayName=`@mantine/core/Switch`,oi.Group=ni;var si=new Map([[`bold`,B.createElement(B.Fragment,null,B.createElement(`path`,{d:`M244,56v48a12,12,0,0,1-12,12H184a12,12,0,1,1,0-24H201.1l-19-17.38c-.13-.12-.26-.24-.38-.37A76,76,0,1,0,127,204h1a75.53,75.53,0,0,0,52.15-20.72,12,12,0,0,1,16.49,17.45A99.45,99.45,0,0,1,128,228h-1.37A100,100,0,1,1,198.51,57.06L220,76.72V56a12,12,0,0,1,24,0Z`}))],[`duotone`,B.createElement(B.Fragment,null,B.createElement(`path`,{d:`M216,128a88,88,0,1,1-88-88A88,88,0,0,1,216,128Z`,opacity:`0.2`}),B.createElement(`path`,{d:`M240,56v48a8,8,0,0,1-8,8H184a8,8,0,0,1,0-16H211.4L184.81,71.64l-.25-.24a80,80,0,1,0-1.67,114.78,8,8,0,0,1,11,11.63A95.44,95.44,0,0,1,128,224h-1.32A96,96,0,1,1,195.75,60L224,85.8V56a8,8,0,1,1,16,0Z`}))],[`fill`,B.createElement(B.Fragment,null,B.createElement(`path`,{d:`M240,56v48a8,8,0,0,1-8,8H184a8,8,0,0,1-5.66-13.66l17-17-10.55-9.65-.25-.24a80,80,0,1,0-1.67,114.78,8,8,0,1,1,11,11.63A95.44,95.44,0,0,1,128,224h-1.32A96,96,0,1,1,195.75,60l10.93,10L226.34,50.3A8,8,0,0,1,240,56Z`}))],[`light`,B.createElement(B.Fragment,null,B.createElement(`path`,{d:`M238,56v48a6,6,0,0,1-6,6H184a6,6,0,0,1,0-12h32.55l-30.38-27.8c-.06-.06-.12-.13-.19-.19a82,82,0,1,0-1.7,117.65,6,6,0,0,1,8.24,8.73A93.46,93.46,0,0,1,128,222h-1.28A94,94,0,1,1,194.37,61.4L226,90.35V56a6,6,0,1,1,12,0Z`}))],[`regular`,B.createElement(B.Fragment,null,B.createElement(`path`,{d:`M240,56v48a8,8,0,0,1-8,8H184a8,8,0,0,1,0-16H211.4L184.81,71.64l-.25-.24a80,80,0,1,0-1.67,114.78,8,8,0,0,1,11,11.63A95.44,95.44,0,0,1,128,224h-1.32A96,96,0,1,1,195.75,60L224,85.8V56a8,8,0,1,1,16,0Z`}))],[`thin`,B.createElement(B.Fragment,null,B.createElement(`path`,{d:`M236,56v48a4,4,0,0,1-4,4H184a4,4,0,0,1,0-8h37.7L187.53,68.69l-.13-.12a84,84,0,1,0-1.75,120.51,4,4,0,0,1,5.5,5.82A91.43,91.43,0,0,1,128,220h-1.26A92,92,0,1,1,193,62.84l35,32.05V56a4,4,0,1,1,8,0Z`}))]]),ci=new Map([[`bold`,B.createElement(B.Fragment,null,B.createElement(`path`,{d:`M228,128a100,100,0,0,1-98.66,100H128a99.39,99.39,0,0,1-68.62-27.29,12,12,0,0,1,16.48-17.45,76,76,0,1,0-1.57-109c-.13.13-.25.25-.39.37L54.89,92H72a12,12,0,0,1,0,24H24a12,12,0,0,1-12-12V56a12,12,0,0,1,24,0V76.72L57.48,57.06A100,100,0,0,1,228,128Z`}))],[`duotone`,B.createElement(B.Fragment,null,B.createElement(`path`,{d:`M216,128a88,88,0,1,1-88-88A88,88,0,0,1,216,128Z`,opacity:`0.2`}),B.createElement(`path`,{d:`M224,128a96,96,0,0,1-94.71,96H128A95.38,95.38,0,0,1,62.1,197.8a8,8,0,0,1,11-11.63A80,80,0,1,0,71.43,71.39a3.07,3.07,0,0,1-.26.25L44.59,96H72a8,8,0,0,1,0,16H24a8,8,0,0,1-8-8V56a8,8,0,0,1,16,0V85.8L60.25,60A96,96,0,0,1,224,128Z`}))],[`fill`,B.createElement(B.Fragment,null,B.createElement(`path`,{d:`M224,128a96,96,0,0,1-94.71,96H128A95.38,95.38,0,0,1,62.1,197.8a8,8,0,0,1,11-11.63A80,80,0,1,0,71.43,71.39a3.07,3.07,0,0,1-.26.25L60.63,81.29l17,17A8,8,0,0,1,72,112H24a8,8,0,0,1-8-8V56A8,8,0,0,1,29.66,50.3L49.31,70,60.25,60A96,96,0,0,1,224,128Z`}))],[`light`,B.createElement(B.Fragment,null,B.createElement(`path`,{d:`M222,128a94,94,0,0,1-92.74,94H128a93.43,93.43,0,0,1-64.5-25.65,6,6,0,1,1,8.24-8.72A82,82,0,1,0,70,70l-.19.19L39.44,98H72a6,6,0,0,1,0,12H24a6,6,0,0,1-6-6V56a6,6,0,0,1,12,0V90.34L61.63,61.4A94,94,0,0,1,222,128Z`}))],[`regular`,B.createElement(B.Fragment,null,B.createElement(`path`,{d:`M224,128a96,96,0,0,1-94.71,96H128A95.38,95.38,0,0,1,62.1,197.8a8,8,0,0,1,11-11.63A80,80,0,1,0,71.43,71.39a3.07,3.07,0,0,1-.26.25L44.59,96H72a8,8,0,0,1,0,16H24a8,8,0,0,1-8-8V56a8,8,0,0,1,16,0V85.8L60.25,60A96,96,0,0,1,224,128Z`}))],[`thin`,B.createElement(B.Fragment,null,B.createElement(`path`,{d:`M220,128a92,92,0,0,1-90.77,92H128a91.47,91.47,0,0,1-63.13-25.1,4,4,0,1,1,5.5-5.82A84,84,0,1,0,68.6,68.57l-.13.12L34.3,100H72a4,4,0,0,1,0,8H24a4,4,0,0,1-4-4V56a4,4,0,0,1,8,0V94.89l35-32A92,92,0,0,1,220,128Z`}))]]),li=new Map([[`bold`,B.createElement(B.Fragment,null,B.createElement(`path`,{d:`M220,48V96a12,12,0,0,1-24,0V77l-35.51,35.52a12,12,0,0,1-17-17L179,60H160a12,12,0,0,1,0-24h48A12,12,0,0,1,220,48ZM95.51,143.51,60,179V160a12,12,0,0,0-24,0v48a12,12,0,0,0,12,12H96a12,12,0,0,0,0-24H77l35.52-35.51a12,12,0,0,0-17-17ZM208,148a12,12,0,0,0-12,12v19l-35.51-35.52a12,12,0,0,0-17,17L179,196H160a12,12,0,0,0,0,24h48a12,12,0,0,0,12-12V160A12,12,0,0,0,208,148ZM77,60H96a12,12,0,0,0,0-24H48A12,12,0,0,0,36,48V96a12,12,0,0,0,24,0V77l35.51,35.52a12,12,0,0,0,17-17Z`}))],[`duotone`,B.createElement(B.Fragment,null,B.createElement(`path`,{d:`M208,48V208H48V48Z`,opacity:`0.2`}),B.createElement(`path`,{d:`M216,48V96a8,8,0,0,1-16,0V67.31l-42.34,42.35a8,8,0,0,1-11.32-11.32L188.69,56H160a8,8,0,0,1,0-16h48A8,8,0,0,1,216,48ZM98.34,146.34,56,188.69V160a8,8,0,0,0-16,0v48a8,8,0,0,0,8,8H96a8,8,0,0,0,0-16H67.31l42.35-42.34a8,8,0,0,0-11.32-11.32ZM208,152a8,8,0,0,0-8,8v28.69l-42.34-42.35a8,8,0,0,0-11.32,11.32L188.69,200H160a8,8,0,0,0,0,16h48a8,8,0,0,0,8-8V160A8,8,0,0,0,208,152ZM67.31,56H96a8,8,0,0,0,0-16H48a8,8,0,0,0-8,8V96a8,8,0,0,0,16,0V67.31l42.34,42.35a8,8,0,0,0,11.32-11.32Z`}))],[`fill`,B.createElement(B.Fragment,null,B.createElement(`path`,{d:`M109.66,146.34a8,8,0,0,1,0,11.32L83.31,184l18.35,18.34A8,8,0,0,1,96,216H48a8,8,0,0,1-8-8V160a8,8,0,0,1,13.66-5.66L72,172.69l26.34-26.35A8,8,0,0,1,109.66,146.34ZM83.31,72l18.35-18.34A8,8,0,0,0,96,40H48a8,8,0,0,0-8,8V96a8,8,0,0,0,13.66,5.66L72,83.31l26.34,26.35a8,8,0,0,0,11.32-11.32ZM208,40H160a8,8,0,0,0-5.66,13.66L172.69,72,146.34,98.34a8,8,0,0,0,11.32,11.32L184,83.31l18.34,18.35A8,8,0,0,0,216,96V48A8,8,0,0,0,208,40Zm3.06,112.61a8,8,0,0,0-8.72,1.73L184,172.69l-26.34-26.35a8,8,0,0,0-11.32,11.32L172.69,184l-18.35,18.34A8,8,0,0,0,160,216h48a8,8,0,0,0,8-8V160A8,8,0,0,0,211.06,152.61Z`}))],[`light`,B.createElement(B.Fragment,null,B.createElement(`path`,{d:`M214,48V96a6,6,0,0,1-12,0V62.48l-45.76,45.76a6,6,0,0,1-8.48-8.48L193.52,54H160a6,6,0,0,1,0-12h48A6,6,0,0,1,214,48ZM99.76,147.76,54,193.52V160a6,6,0,0,0-12,0v48a6,6,0,0,0,6,6H96a6,6,0,0,0,0-12H62.48l45.76-45.76a6,6,0,0,0-8.48-8.48ZM208,154a6,6,0,0,0-6,6v33.52l-45.76-45.76a6,6,0,0,0-8.48,8.48L193.52,202H160a6,6,0,0,0,0,12h48a6,6,0,0,0,6-6V160A6,6,0,0,0,208,154ZM62.48,54H96a6,6,0,0,0,0-12H48a6,6,0,0,0-6,6V96a6,6,0,0,0,12,0V62.48l45.76,45.76a6,6,0,0,0,8.48-8.48Z`}))],[`regular`,B.createElement(B.Fragment,null,B.createElement(`path`,{d:`M216,48V96a8,8,0,0,1-16,0V67.31l-42.34,42.35a8,8,0,0,1-11.32-11.32L188.69,56H160a8,8,0,0,1,0-16h48A8,8,0,0,1,216,48ZM98.34,146.34,56,188.69V160a8,8,0,0,0-16,0v48a8,8,0,0,0,8,8H96a8,8,0,0,0,0-16H67.31l42.35-42.34a8,8,0,0,0-11.32-11.32ZM208,152a8,8,0,0,0-8,8v28.69l-42.34-42.35a8,8,0,0,0-11.32,11.32L188.69,200H160a8,8,0,0,0,0,16h48a8,8,0,0,0,8-8V160A8,8,0,0,0,208,152ZM67.31,56H96a8,8,0,0,0,0-16H48a8,8,0,0,0-8,8V96a8,8,0,0,0,16,0V67.31l42.34,42.35a8,8,0,0,0,11.32-11.32Z`}))],[`thin`,B.createElement(B.Fragment,null,B.createElement(`path`,{d:`M212,48V96a4,4,0,0,1-8,0V57.66l-49.17,49.17a4,4,0,0,1-5.66-5.66L198.34,52H160a4,4,0,0,1,0-8h48A4,4,0,0,1,212,48ZM101.17,149.17,52,198.34V160a4,4,0,0,0-8,0v48a4,4,0,0,0,4,4H96a4,4,0,0,0,0-8H57.66l49.17-49.17a4,4,0,0,0-5.66-5.66ZM208,156a4,4,0,0,0-4,4v38.34l-49.17-49.17a4,4,0,0,0-5.66,5.66L198.34,204H160a4,4,0,0,0,0,8h48a4,4,0,0,0,4-4V160A4,4,0,0,0,208,156ZM57.66,52H96a4,4,0,0,0,0-8H48a4,4,0,0,0-4,4V96a4,4,0,0,0,8,0V57.66l49.17,49.17a4,4,0,0,0,5.66-5.66Z`}))]]),ui=new Map([[`bold`,B.createElement(B.Fragment,null,B.createElement(`path`,{d:`M216.49,168.49a12,12,0,0,1-17,0L128,97,56.49,168.49a12,12,0,0,1-17-17l80-80a12,12,0,0,1,17,0l80,80A12,12,0,0,1,216.49,168.49Z`}))],[`duotone`,B.createElement(B.Fragment,null,B.createElement(`path`,{d:`M208,160H48l80-80Z`,opacity:`0.2`}),B.createElement(`path`,{d:`M213.66,154.34l-80-80a8,8,0,0,0-11.32,0l-80,80A8,8,0,0,0,48,168H208a8,8,0,0,0,5.66-13.66ZM67.31,152,128,91.31,188.69,152Z`}))],[`fill`,B.createElement(B.Fragment,null,B.createElement(`path`,{d:`M215.39,163.06A8,8,0,0,1,208,168H48a8,8,0,0,1-5.66-13.66l80-80a8,8,0,0,1,11.32,0l80,80A8,8,0,0,1,215.39,163.06Z`}))],[`light`,B.createElement(B.Fragment,null,B.createElement(`path`,{d:`M212.24,164.24a6,6,0,0,1-8.48,0L128,88.49,52.24,164.24a6,6,0,0,1-8.48-8.48l80-80a6,6,0,0,1,8.48,0l80,80A6,6,0,0,1,212.24,164.24Z`}))],[`regular`,B.createElement(B.Fragment,null,B.createElement(`path`,{d:`M213.66,165.66a8,8,0,0,1-11.32,0L128,91.31,53.66,165.66a8,8,0,0,1-11.32-11.32l80-80a8,8,0,0,1,11.32,0l80,80A8,8,0,0,1,213.66,165.66Z`}))],[`thin`,B.createElement(B.Fragment,null,B.createElement(`path`,{d:`M210.83,162.83a4,4,0,0,1-5.66,0L128,85.66,50.83,162.83a4,4,0,0,1-5.66-5.66l80-80a4,4,0,0,1,5.66,0l80,80A4,4,0,0,1,210.83,162.83Z`}))]]),di=new Map([[`bold`,B.createElement(B.Fragment,null,B.createElement(`path`,{d:`M172,108a12,12,0,0,1-12,12H96a12,12,0,0,1,0-24h64A12,12,0,0,1,172,108Zm-12,28H96a12,12,0,0,0,0,24h64a12,12,0,0,0,0-24Zm76-8A108,108,0,0,1,78.77,224.15L46.34,235A20,20,0,0,1,21,209.66l10.81-32.43A108,108,0,1,1,236,128Zm-24,0A84,84,0,1,0,55.27,170.06a12,12,0,0,1,1,9.81l-9.93,29.79,29.79-9.93a12.1,12.1,0,0,1,3.8-.62,12,12,0,0,1,6,1.62A84,84,0,0,0,212,128Z`}))],[`duotone`,B.createElement(B.Fragment,null,B.createElement(`path`,{d:`M224,128A96,96,0,0,1,79.93,211.11h0L42.54,223.58a8,8,0,0,1-10.12-10.12l12.47-37.39h0A96,96,0,1,1,224,128Z`,opacity:`0.2`}),B.createElement(`path`,{d:`M128,24A104,104,0,0,0,36.18,176.88L24.83,210.93a16,16,0,0,0,20.24,20.24l34.05-11.35A104,104,0,1,0,128,24Zm0,192a87.87,87.87,0,0,1-44.06-11.81,8,8,0,0,0-4-1.08,7.85,7.85,0,0,0-2.53.42L40,216,52.47,178.6a8,8,0,0,0-.66-6.54A88,88,0,1,1,128,216Zm40-104a8,8,0,0,1-8,8H96a8,8,0,0,1,0-16h64A8,8,0,0,1,168,112Zm0,32a8,8,0,0,1-8,8H96a8,8,0,0,1,0-16h64A8,8,0,0,1,168,144Z`}))],[`fill`,B.createElement(B.Fragment,null,B.createElement(`path`,{d:`M128,24A104,104,0,0,0,36.18,176.88L24.83,210.93a16,16,0,0,0,20.24,20.24l34.05-11.35A104,104,0,1,0,128,24Zm32,128H96a8,8,0,0,1,0-16h64a8,8,0,0,1,0,16Zm0-32H96a8,8,0,0,1,0-16h64a8,8,0,0,1,0,16Z`}))],[`light`,B.createElement(B.Fragment,null,B.createElement(`path`,{d:`M166,112a6,6,0,0,1-6,6H96a6,6,0,0,1,0-12h64A6,6,0,0,1,166,112Zm-6,26H96a6,6,0,0,0,0,12h64a6,6,0,0,0,0-12Zm70-10A102,102,0,0,1,79.31,217.65L44.44,229.27a14,14,0,0,1-17.71-17.71l11.62-34.87A102,102,0,1,1,230,128Zm-12,0A90,90,0,1,0,50.08,173.06a6,6,0,0,1,.5,4.91L38.12,215.35a2,2,0,0,0,2.53,2.53L78,205.42a6.2,6.2,0,0,1,1.9-.31,6.09,6.09,0,0,1,3,.81A90,90,0,0,0,218,128Z`}))],[`regular`,B.createElement(B.Fragment,null,B.createElement(`path`,{d:`M168,112a8,8,0,0,1-8,8H96a8,8,0,0,1,0-16h64A8,8,0,0,1,168,112Zm-8,24H96a8,8,0,0,0,0,16h64a8,8,0,0,0,0-16Zm72-8A104,104,0,0,1,79.12,219.82L45.07,231.17a16,16,0,0,1-20.24-20.24l11.35-34.05A104,104,0,1,1,232,128Zm-16,0A88,88,0,1,0,51.81,172.06a8,8,0,0,1,.66,6.54L40,216,77.4,203.53a7.85,7.85,0,0,1,2.53-.42,8,8,0,0,1,4,1.08A88,88,0,0,0,216,128Z`}))],[`thin`,B.createElement(B.Fragment,null,B.createElement(`path`,{d:`M164,112a4,4,0,0,1-4,4H96a4,4,0,0,1,0-8h64A4,4,0,0,1,164,112Zm-4,28H96a4,4,0,0,0,0,8h64a4,4,0,0,0,0-8Zm68-12A100,100,0,0,1,79.5,215.47l-35.69,11.9a12,12,0,0,1-15.18-15.18l11.9-35.69A100,100,0,1,1,228,128Zm-8,0A92,92,0,1,0,48.35,174.07a4,4,0,0,1,.33,3.27L36.22,214.72a4,4,0,0,0,5.06,5.06l37.38-12.46a3.93,3.93,0,0,1,1.27-.21,4.05,4.05,0,0,1,2,.54A92,92,0,0,0,220,128Z`}))]]),fi=new Map([[`bold`,B.createElement(B.Fragment,null,B.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,212Zm68-84a12,12,0,0,1-12,12H128a12,12,0,0,1-12-12V72a12,12,0,0,1,24,0v44h44A12,12,0,0,1,196,128Z`}))],[`duotone`,B.createElement(B.Fragment,null,B.createElement(`path`,{d:`M224,128a96,96,0,1,1-96-96A96,96,0,0,1,224,128Z`,opacity:`0.2`}),B.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,216Zm64-88a8,8,0,0,1-8,8H128a8,8,0,0,1-8-8V72a8,8,0,0,1,16,0v48h48A8,8,0,0,1,192,128Z`}))],[`fill`,B.createElement(B.Fragment,null,B.createElement(`path`,{d:`M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm56,112H128a8,8,0,0,1-8-8V72a8,8,0,0,1,16,0v48h48a8,8,0,0,1,0,16Z`}))],[`light`,B.createElement(B.Fragment,null,B.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,218Zm62-90a6,6,0,0,1-6,6H128a6,6,0,0,1-6-6V72a6,6,0,0,1,12,0v50h50A6,6,0,0,1,190,128Z`}))],[`regular`,B.createElement(B.Fragment,null,B.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,216Zm64-88a8,8,0,0,1-8,8H128a8,8,0,0,1-8-8V72a8,8,0,0,1,16,0v48h48A8,8,0,0,1,192,128Z`}))],[`thin`,B.createElement(B.Fragment,null,B.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,220Zm60-92a4,4,0,0,1-4,4H128a4,4,0,0,1-4-4V72a4,4,0,0,1,8,0v52h52A4,4,0,0,1,188,128Z`}))]]),pi=new Map([[`bold`,B.createElement(B.Fragment,null,B.createElement(`path`,{d:`M140,80v41.21l34.17,20.5a12,12,0,1,1-12.34,20.58l-40-24A12,12,0,0,1,116,128V80a12,12,0,0,1,24,0ZM128,28A99.38,99.38,0,0,0,57.24,57.34c-4.69,4.74-9,9.37-13.24,14V64a12,12,0,0,0-24,0v40a12,12,0,0,0,12,12H72a12,12,0,0,0,0-24H57.77C63,86,68.37,80.22,74.26,74.26a76,76,0,1,1,1.58,109,12,12,0,0,0-16.48,17.46A100,100,0,1,0,128,28Z`}))],[`duotone`,B.createElement(B.Fragment,null,B.createElement(`path`,{d:`M216,128a88,88,0,1,1-88-88A88,88,0,0,1,216,128Z`,opacity:`0.2`}),B.createElement(`path`,{d:`M136,80v43.47l36.12,21.67a8,8,0,0,1-8.24,13.72l-40-24A8,8,0,0,1,120,128V80a8,8,0,0,1,16,0Zm-8-48A95.44,95.44,0,0,0,60.08,60.15C52.81,67.51,46.35,74.59,40,82V64a8,8,0,0,0-16,0v40a8,8,0,0,0,8,8H72a8,8,0,0,0,0-16H49c7.15-8.42,14.27-16.35,22.39-24.57a80,80,0,1,1,1.66,114.75,8,8,0,1,0-11,11.64A96,96,0,1,0,128,32Z`}))],[`fill`,B.createElement(B.Fragment,null,B.createElement(`path`,{d:`M224,128A96,96,0,0,1,62.11,197.82a8,8,0,1,1,11-11.64A80,80,0,1,0,71.43,71.43C67.9,75,64.58,78.51,61.35,82L77.66,98.34A8,8,0,0,1,72,112H32a8,8,0,0,1-8-8V64a8,8,0,0,1,13.66-5.66L50,70.7c3.22-3.49,6.54-7,10.06-10.55A96,96,0,0,1,224,128ZM128,72a8,8,0,0,0-8,8v48a8,8,0,0,0,3.88,6.86l40,24a8,8,0,1,0,8.24-13.72L136,123.47V80A8,8,0,0,0,128,72Z`}))],[`light`,B.createElement(B.Fragment,null,B.createElement(`path`,{d:`M134,80v44.6l37.09,22.25a6,6,0,0,1-6.18,10.3l-40-24A6,6,0,0,1,122,128V80a6,6,0,0,1,12,0Zm-6-46A93.4,93.4,0,0,0,61.51,61.56c-8.58,8.68-16,17-23.51,25.8V64a6,6,0,0,0-12,0v40a6,6,0,0,0,6,6H72a6,6,0,0,0,0-12H44.73C52.86,88.29,60.79,79.35,70,70a82,82,0,1,1,1.7,117.62,6,6,0,1,0-8.24,8.72A94,94,0,1,0,128,34Z`}))],[`regular`,B.createElement(B.Fragment,null,B.createElement(`path`,{d:`M136,80v43.47l36.12,21.67a8,8,0,0,1-8.24,13.72l-40-24A8,8,0,0,1,120,128V80a8,8,0,0,1,16,0Zm-8-48A95.44,95.44,0,0,0,60.08,60.15C52.81,67.51,46.35,74.59,40,82V64a8,8,0,0,0-16,0v40a8,8,0,0,0,8,8H72a8,8,0,0,0,0-16H49c7.15-8.42,14.27-16.35,22.39-24.57a80,80,0,1,1,1.66,114.75,8,8,0,1,0-11,11.64A96,96,0,1,0,128,32Z`}))],[`thin`,B.createElement(B.Fragment,null,B.createElement(`path`,{d:`M132,80v45.74l38.06,22.83a4,4,0,0,1-4.12,6.86l-40-24A4,4,0,0,1,124,128V80a4,4,0,0,1,8,0Zm-4-44A91.42,91.42,0,0,0,62.93,63C53.05,73,44.66,82.47,36,92.86V64a4,4,0,0,0-8,0v40a4,4,0,0,0,4,4H72a4,4,0,0,0,0-8H40.47C49.61,89,58.3,79,68.6,68.6a84,84,0,1,1,1.75,120.49,4,4,0,1,0-5.5,5.82A92,92,0,1,0,128,36Z`}))]]),mi=new Map([[`bold`,B.createElement(B.Fragment,null,B.createElement(`path`,{d:`M108,84a16,16,0,1,1,16,16A16,16,0,0,1,108,84Zm128,44A108,108,0,1,1,128,20,108.12,108.12,0,0,1,236,128Zm-24,0a84,84,0,1,0-84,84A84.09,84.09,0,0,0,212,128Zm-72,36.68V132a20,20,0,0,0-20-20,12,12,0,0,0-4,23.32V168a20,20,0,0,0,20,20,12,12,0,0,0,4-23.32Z`}))],[`duotone`,B.createElement(B.Fragment,null,B.createElement(`path`,{d:`M224,128a96,96,0,1,1-96-96A96,96,0,0,1,224,128Z`,opacity:`0.2`}),B.createElement(`path`,{d:`M144,176a8,8,0,0,1-8,8,16,16,0,0,1-16-16V128a8,8,0,0,1,0-16,16,16,0,0,1,16,16v40A8,8,0,0,1,144,176Zm88-48A104,104,0,1,1,128,24,104.11,104.11,0,0,1,232,128Zm-16,0a88,88,0,1,0-88,88A88.1,88.1,0,0,0,216,128ZM124,96a12,12,0,1,0-12-12A12,12,0,0,0,124,96Z`}))],[`fill`,B.createElement(B.Fragment,null,B.createElement(`path`,{d:`M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm-4,48a12,12,0,1,1-12,12A12,12,0,0,1,124,72Zm12,112a16,16,0,0,1-16-16V128a8,8,0,0,1,0-16,16,16,0,0,1,16,16v40a8,8,0,0,1,0,16Z`}))],[`light`,B.createElement(B.Fragment,null,B.createElement(`path`,{d:`M142,176a6,6,0,0,1-6,6,14,14,0,0,1-14-14V128a2,2,0,0,0-2-2,6,6,0,0,1,0-12,14,14,0,0,1,14,14v40a2,2,0,0,0,2,2A6,6,0,0,1,142,176ZM124,94a10,10,0,1,0-10-10A10,10,0,0,0,124,94Zm106,34A102,102,0,1,1,128,26,102.12,102.12,0,0,1,230,128Zm-12,0a90,90,0,1,0-90,90A90.1,90.1,0,0,0,218,128Z`}))],[`regular`,B.createElement(B.Fragment,null,B.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,216Zm16-40a8,8,0,0,1-8,8,16,16,0,0,1-16-16V128a8,8,0,0,1,0-16,16,16,0,0,1,16,16v40A8,8,0,0,1,144,176ZM112,84a12,12,0,1,1,12,12A12,12,0,0,1,112,84Z`}))],[`thin`,B.createElement(B.Fragment,null,B.createElement(`path`,{d:`M140,176a4,4,0,0,1-4,4,12,12,0,0,1-12-12V128a4,4,0,0,0-4-4,4,4,0,0,1,0-8,12,12,0,0,1,12,12v40a4,4,0,0,0,4,4A4,4,0,0,1,140,176ZM124,92a8,8,0,1,0-8-8A8,8,0,0,0,124,92Zm104,36A100,100,0,1,1,128,28,100.11,100.11,0,0,1,228,128Zm-8,0a92,92,0,1,0-92,92A92.1,92.1,0,0,0,220,128Z`}))]]),hi=new Map([[`bold`,B.createElement(B.Fragment,null,B.createElement(`path`,{d:`M224,44H32A20,20,0,0,0,12,64V192a20,20,0,0,0,20,20H224a20,20,0,0,0,20-20V64A20,20,0,0,0,224,44Zm-4,144H36V68H220ZM52,128a12,12,0,0,1,12-12H192a12,12,0,0,1,0,24H64A12,12,0,0,1,52,128Zm0-36A12,12,0,0,1,64,80H192a12,12,0,0,1,0,24H64A12,12,0,0,1,52,92Zm0,72a12,12,0,0,1,12-12h8a12,12,0,0,1,0,24H64A12,12,0,0,1,52,164Zm108,0a12,12,0,0,1-12,12H108a12,12,0,0,1,0-24h40A12,12,0,0,1,160,164Zm44,0a12,12,0,0,1-12,12h-8a12,12,0,0,1,0-24h8A12,12,0,0,1,204,164Z`}))],[`duotone`,B.createElement(B.Fragment,null,B.createElement(`path`,{d:`M232,64V192a8,8,0,0,1-8,8H32a8,8,0,0,1-8-8V64a8,8,0,0,1,8-8H224A8,8,0,0,1,232,64Z`,opacity:`0.2`}),B.createElement(`path`,{d:`M224,48H32A16,16,0,0,0,16,64V192a16,16,0,0,0,16,16H224a16,16,0,0,0,16-16V64A16,16,0,0,0,224,48Zm0,144H32V64H224V192Zm-16-64a8,8,0,0,1-8,8H56a8,8,0,0,1,0-16H200A8,8,0,0,1,208,128Zm0-32a8,8,0,0,1-8,8H56a8,8,0,0,1,0-16H200A8,8,0,0,1,208,96ZM72,160a8,8,0,0,1-8,8H56a8,8,0,0,1,0-16h8A8,8,0,0,1,72,160Zm96,0a8,8,0,0,1-8,8H96a8,8,0,0,1,0-16h64A8,8,0,0,1,168,160Zm40,0a8,8,0,0,1-8,8h-8a8,8,0,0,1,0-16h8A8,8,0,0,1,208,160Z`}))],[`fill`,B.createElement(B.Fragment,null,B.createElement(`path`,{d:`M224,48H32A16,16,0,0,0,16,64V192a16,16,0,0,0,16,16H224a16,16,0,0,0,16-16V64A16,16,0,0,0,224,48ZM64,168H48a8,8,0,0,1,0-16H64a8,8,0,0,1,0,16Zm96,0H96a8,8,0,0,1,0-16h64a8,8,0,0,1,0,16Zm48,0H192a8,8,0,0,1,0-16h16a8,8,0,0,1,0,16Zm0-32H48a8,8,0,0,1,0-16H208a8,8,0,0,1,0,16Zm0-32H48a8,8,0,0,1,0-16H208a8,8,0,0,1,0,16Z`}))],[`light`,B.createElement(B.Fragment,null,B.createElement(`path`,{d:`M224,50H32A14,14,0,0,0,18,64V192a14,14,0,0,0,14,14H224a14,14,0,0,0,14-14V64A14,14,0,0,0,224,50Zm2,142a2,2,0,0,1-2,2H32a2,2,0,0,1-2-2V64a2,2,0,0,1,2-2H224a2,2,0,0,1,2,2Zm-20-64a6,6,0,0,1-6,6H56a6,6,0,0,1,0-12H200A6,6,0,0,1,206,128Zm0-32a6,6,0,0,1-6,6H56a6,6,0,0,1,0-12H200A6,6,0,0,1,206,96ZM70,160a6,6,0,0,1-6,6H56a6,6,0,0,1,0-12h8A6,6,0,0,1,70,160Zm96,0a6,6,0,0,1-6,6H96a6,6,0,0,1,0-12h64A6,6,0,0,1,166,160Zm40,0a6,6,0,0,1-6,6h-8a6,6,0,0,1,0-12h8A6,6,0,0,1,206,160Z`}))],[`regular`,B.createElement(B.Fragment,null,B.createElement(`path`,{d:`M224,48H32A16,16,0,0,0,16,64V192a16,16,0,0,0,16,16H224a16,16,0,0,0,16-16V64A16,16,0,0,0,224,48Zm0,144H32V64H224V192Zm-16-64a8,8,0,0,1-8,8H56a8,8,0,0,1,0-16H200A8,8,0,0,1,208,128Zm0-32a8,8,0,0,1-8,8H56a8,8,0,0,1,0-16H200A8,8,0,0,1,208,96ZM72,160a8,8,0,0,1-8,8H56a8,8,0,0,1,0-16h8A8,8,0,0,1,72,160Zm96,0a8,8,0,0,1-8,8H96a8,8,0,0,1,0-16h64A8,8,0,0,1,168,160Zm40,0a8,8,0,0,1-8,8h-8a8,8,0,0,1,0-16h8A8,8,0,0,1,208,160Z`}))],[`thin`,B.createElement(B.Fragment,null,B.createElement(`path`,{d:`M224,52H32A12,12,0,0,0,20,64V192a12,12,0,0,0,12,12H224a12,12,0,0,0,12-12V64A12,12,0,0,0,224,52Zm4,140a4,4,0,0,1-4,4H32a4,4,0,0,1-4-4V64a4,4,0,0,1,4-4H224a4,4,0,0,1,4,4Zm-24-64a4,4,0,0,1-4,4H56a4,4,0,0,1,0-8H200A4,4,0,0,1,204,128Zm0-32a4,4,0,0,1-4,4H56a4,4,0,0,1,0-8H200A4,4,0,0,1,204,96ZM68,160a4,4,0,0,1-4,4H56a4,4,0,0,1,0-8h8A4,4,0,0,1,68,160Zm96,0a4,4,0,0,1-4,4H96a4,4,0,0,1,0-8h64A4,4,0,0,1,164,160Zm40,0a4,4,0,0,1-4,4h-8a4,4,0,0,1,0-8h8A4,4,0,0,1,204,160Z`}))]]),gi=new Map([[`bold`,B.createElement(B.Fragment,null,B.createElement(`path`,{d:`M76,64A12,12,0,0,1,88,52H216a12,12,0,0,1,0,24H88A12,12,0,0,1,76,64Zm140,52H88a12,12,0,0,0,0,24H216a12,12,0,0,0,0-24Zm0,64H88a12,12,0,0,0,0,24H216a12,12,0,0,0,0-24ZM44,112a16,16,0,1,0,16,16A16,16,0,0,0,44,112Zm0-64A16,16,0,1,0,60,64,16,16,0,0,0,44,48Zm0,128a16,16,0,1,0,16,16A16,16,0,0,0,44,176Z`}))],[`duotone`,B.createElement(B.Fragment,null,B.createElement(`path`,{d:`M216,64V192H88V64Z`,opacity:`0.2`}),B.createElement(`path`,{d:`M80,64a8,8,0,0,1,8-8H216a8,8,0,0,1,0,16H88A8,8,0,0,1,80,64Zm136,56H88a8,8,0,1,0,0,16H216a8,8,0,0,0,0-16Zm0,64H88a8,8,0,1,0,0,16H216a8,8,0,0,0,0-16ZM44,52A12,12,0,1,0,56,64,12,12,0,0,0,44,52Zm0,64a12,12,0,1,0,12,12A12,12,0,0,0,44,116Zm0,64a12,12,0,1,0,12,12A12,12,0,0,0,44,180Z`}))],[`fill`,B.createElement(B.Fragment,null,B.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,32ZM68,188a12,12,0,1,1,12-12A12,12,0,0,1,68,188Zm0-48a12,12,0,1,1,12-12A12,12,0,0,1,68,140Zm0-48A12,12,0,1,1,80,80,12,12,0,0,1,68,92Zm124,92H104a8,8,0,0,1,0-16h88a8,8,0,0,1,0,16Zm0-48H104a8,8,0,0,1,0-16h88a8,8,0,0,1,0,16Zm0-48H104a8,8,0,0,1,0-16h88a8,8,0,0,1,0,16Z`}))],[`light`,B.createElement(B.Fragment,null,B.createElement(`path`,{d:`M82,64a6,6,0,0,1,6-6H216a6,6,0,0,1,0,12H88A6,6,0,0,1,82,64Zm134,58H88a6,6,0,0,0,0,12H216a6,6,0,0,0,0-12Zm0,64H88a6,6,0,0,0,0,12H216a6,6,0,0,0,0-12ZM44,54A10,10,0,1,0,54,64,10,10,0,0,0,44,54Zm0,128a10,10,0,1,0,10,10A10,10,0,0,0,44,182Zm0-64a10,10,0,1,0,10,10A10,10,0,0,0,44,118Z`}))],[`regular`,B.createElement(B.Fragment,null,B.createElement(`path`,{d:`M80,64a8,8,0,0,1,8-8H216a8,8,0,0,1,0,16H88A8,8,0,0,1,80,64Zm136,56H88a8,8,0,0,0,0,16H216a8,8,0,0,0,0-16Zm0,64H88a8,8,0,0,0,0,16H216a8,8,0,0,0,0-16ZM44,52A12,12,0,1,0,56,64,12,12,0,0,0,44,52Zm0,64a12,12,0,1,0,12,12A12,12,0,0,0,44,116Zm0,64a12,12,0,1,0,12,12A12,12,0,0,0,44,180Z`}))],[`thin`,B.createElement(B.Fragment,null,B.createElement(`path`,{d:`M84,64a4,4,0,0,1,4-4H216a4,4,0,0,1,0,8H88A4,4,0,0,1,84,64Zm132,60H88a4,4,0,0,0,0,8H216a4,4,0,0,0,0-8Zm0,64H88a4,4,0,0,0,0,8H216a4,4,0,0,0,0-8ZM44,120a8,8,0,1,0,8,8A8,8,0,0,0,44,120Zm0-64a8,8,0,1,0,8,8A8,8,0,0,0,44,56Zm0,128a8,8,0,1,0,8,8A8,8,0,0,0,44,184Z`}))]]),_i=new Map([[`bold`,B.createElement(B.Fragment,null,B.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`,B.createElement(B.Fragment,null,B.createElement(`path`,{d:`M216,144a32,32,0,1,1-32-32A32,32,0,0,1,216,144Z`,opacity:`0.2`}),B.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`,B.createElement(B.Fragment,null,B.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`,B.createElement(B.Fragment,null,B.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`,B.createElement(B.Fragment,null,B.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`,B.createElement(B.Fragment,null,B.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`}))]]),vi=new Map([[`bold`,B.createElement(B.Fragment,null,B.createElement(`path`,{d:`M156,112a12,12,0,0,1-12,12H80a12,12,0,0,1,0-24h64A12,12,0,0,1,156,112Zm76.49,120.49a12,12,0,0,1-17,0L168,185a92.12,92.12,0,1,1,17-17l47.54,47.53A12,12,0,0,1,232.49,232.49ZM112,180a68,68,0,1,0-68-68A68.08,68.08,0,0,0,112,180Z`}))],[`duotone`,B.createElement(B.Fragment,null,B.createElement(`path`,{d:`M192,112a80,80,0,1,1-80-80A80,80,0,0,1,192,112Z`,opacity:`0.2`}),B.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,112Zm112,0a8,8,0,0,1-8,8H80a8,8,0,0,1,0-16h64A8,8,0,0,1,152,112Z`}))],[`fill`,B.createElement(B.Fragment,null,B.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.32ZM144,120H80a8,8,0,0,1,0-16h64a8,8,0,0,1,0,16Z`}))],[`light`,B.createElement(B.Fragment,null,B.createElement(`path`,{d:`M150,112a6,6,0,0,1-6,6H80a6,6,0,0,1,0-12h64A6,6,0,0,1,150,112Zm78.24,116.24a6,6,0,0,1-8.48,0l-51.38-51.38a86.15,86.15,0,1,1,8.48-8.48l51.38,51.38A6,6,0,0,1,228.24,228.24ZM112,186a74,74,0,1,0-74-74A74.09,74.09,0,0,0,112,186Z`}))],[`regular`,B.createElement(B.Fragment,null,B.createElement(`path`,{d:`M152,112a8,8,0,0,1-8,8H80a8,8,0,0,1,0-16h64A8,8,0,0,1,152,112Zm77.66,117.66a8,8,0,0,1-11.32,0l-50.06-50.07a88.11,88.11,0,1,1,11.31-11.31l50.07,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`}))],[`thin`,B.createElement(B.Fragment,null,B.createElement(`path`,{d:`M148,112a4,4,0,0,1-4,4H80a4,4,0,0,1,0-8h64A4,4,0,0,1,148,112Zm78.83,114.83a4,4,0,0,1-5.66,0l-52.7-52.7a84.1,84.1,0,1,1,5.66-5.66l52.7,52.7A4,4,0,0,1,226.83,226.83ZM112,188a76,76,0,1,0-76-76A76.08,76.08,0,0,0,112,188Z`}))]]),yi=new Map([[`bold`,B.createElement(B.Fragment,null,B.createElement(`path`,{d:`M230.47,67.5a12,12,0,0,0-19.26-4.32L172.43,99l-12.68-2.72L157,83.57l35.79-38.78a12,12,0,0,0-4.32-19.26A76.07,76.07,0,0,0,88.41,121.64L30.92,174.18a4.68,4.68,0,0,0-.39.38,36,36,0,0,0,50.91,50.91l.38-.39,52.54-57.49A76.05,76.05,0,0,0,230.47,67.5ZM160,148a51.5,51.5,0,0,1-23.35-5.52,12,12,0,0,0-14.26,2.62L64.31,208.66a12,12,0,0,1-17-17l63.55-58.07a12,12,0,0,0,2.62-14.26A51.5,51.5,0,0,1,108,96a52.06,52.06,0,0,1,52-52h.89L135.17,71.87a12,12,0,0,0-2.91,10.65l5.66,26.35a12,12,0,0,0,9.21,9.21l26.35,5.66a12,12,0,0,0,10.65-2.91L212,95.12c0,.3,0,.59,0,.89A52.06,52.06,0,0,1,160,148Z`}))],[`duotone`,B.createElement(B.Fragment,null,B.createElement(`path`,{d:`M224,96a64,64,0,0,1-94.94,56L73,217A24,24,0,0,1,39,183L104,126.94a64,64,0,0,1,80-90.29L144,80l5.66,26.34L176,112l43.35-40A63.8,63.8,0,0,1,224,96Z`,opacity:`0.2`}),B.createElement(`path`,{d:`M226.76,69a8,8,0,0,0-12.84-2.88l-40.3,37.19-17.23-3.7-3.7-17.23,37.19-40.3A8,8,0,0,0,187,29.24,72,72,0,0,0,88,96,72.34,72.34,0,0,0,94,124.94L33.79,177c-.15.12-.29.26-.43.39a32,32,0,0,0,45.26,45.26c.13-.13.27-.28.39-.42L131.06,162A72,72,0,0,0,232,96,71.56,71.56,0,0,0,226.76,69ZM160,152a56.14,56.14,0,0,1-27.07-7,8,8,0,0,0-9.92,1.77L67.11,211.51a16,16,0,0,1-22.62-22.62L109.18,133a8,8,0,0,0,1.77-9.93,56,56,0,0,1,58.36-82.31l-31.2,33.81a8,8,0,0,0-1.94,7.1L141.83,108a8,8,0,0,0,6.14,6.14l26.35,5.66a8,8,0,0,0,7.1-1.94l33.81-31.2A56.06,56.06,0,0,1,160,152Z`}))],[`fill`,B.createElement(B.Fragment,null,B.createElement(`path`,{d:`M232,96a72,72,0,0,1-100.94,66L79,222.22c-.12.14-.26.29-.39.42a32,32,0,0,1-45.26-45.26c.14-.13.28-.27.43-.39L94,124.94a72.07,72.07,0,0,1,83.54-98.78,8,8,0,0,1,3.93,13.19L144,80l5.66,26.35L176,112l40.65-37.52a8,8,0,0,1,13.19,3.93A72.6,72.6,0,0,1,232,96Z`}))],[`light`,B.createElement(B.Fragment,null,B.createElement(`path`,{d:`M224.91,69.75a6,6,0,0,0-9.63-2.16l-41.07,37.9L154.7,101.3l-4.19-19.51,37.9-41.07a6,6,0,0,0-2.16-9.63,70,70,0,0,0-89.77,94.39l-61.39,53c-.11.09-.21.19-.32.3A30,30,0,0,0,77.2,221.23c.11-.11.21-.21.3-.32l53-61.39a70,70,0,0,0,94.39-89.77ZM160,154a58,58,0,0,1-28-7.22,6,6,0,0,0-7.45,1.33L68.57,212.88a18,18,0,0,1-25.45-25.45l64.76-55.94A6,6,0,0,0,109.2,124a58,58,0,0,1,64-84.53L139.58,75.93a6,6,0,0,0-1.45,5.33l5.65,26.35a6,6,0,0,0,4.61,4.61l26.35,5.65a6,6,0,0,0,5.33-1.45L216.49,82.8A58.06,58.06,0,0,1,160,154Z`}))],[`regular`,B.createElement(B.Fragment,null,B.createElement(`path`,{d:`M226.76,69a8,8,0,0,0-12.84-2.88l-40.3,37.19-17.23-3.7-3.7-17.23,37.19-40.3A8,8,0,0,0,187,29.24,72,72,0,0,0,88,96,72.34,72.34,0,0,0,94,124.94L33.79,177c-.15.12-.29.26-.43.39a32,32,0,0,0,45.26,45.26c.13-.13.27-.28.39-.42L131.06,162A72,72,0,0,0,232,96,71.56,71.56,0,0,0,226.76,69ZM160,152a56.14,56.14,0,0,1-27.07-7,8,8,0,0,0-9.92,1.77L67.11,211.51a16,16,0,0,1-22.62-22.62L109.18,133a8,8,0,0,0,1.77-9.93,56,56,0,0,1,58.36-82.31l-31.2,33.81a8,8,0,0,0-1.94,7.1L141.83,108a8,8,0,0,0,6.14,6.14l26.35,5.66a8,8,0,0,0,7.1-1.94l33.81-31.2A56.06,56.06,0,0,1,160,152Z`}))],[`thin`,B.createElement(B.Fragment,null,B.createElement(`path`,{d:`M223.05,70.5a4,4,0,0,0-6.42-1.44l-41.82,38.6L153,103l-4.68-21.79,38.6-41.82a4,4,0,0,0-1.44-6.43A68,68,0,0,0,98.94,126L36.4,180l-.21.2a28,28,0,0,0,39.6,39.6l.2-.21,54-62.54A68,68,0,0,0,228,96,67.51,67.51,0,0,0,223.05,70.5ZM160,156a60,60,0,0,1-29-7.47,4,4,0,0,0-5,.89L70,214.25A20,20,0,0,1,41.75,186l64.82-56a4,4,0,0,0,.89-5,60,60,0,0,1,69.46-86.59L141.05,77.29a4,4,0,0,0-1,3.55l5.66,26.35a4,4,0,0,0,3.07,3.07l26.35,5.66a4,4,0,0,0,3.55-1l38.87-35.87A60.05,60.05,0,0,1,160,156Z`}))]]),bi=B.forwardRef((e,t)=>B.createElement(g,{ref:t,...e,weights:si}));bi.displayName=`ArrowClockwiseIcon`;var xi=bi,Si=B.forwardRef((e,t)=>B.createElement(g,{ref:t,...e,weights:ci}));Si.displayName=`ArrowCounterClockwiseIcon`;var Ci=Si,wi=B.forwardRef((e,t)=>B.createElement(g,{ref:t,...e,weights:li}));wi.displayName=`ArrowsOutIcon`;var Ti=wi,Ei=B.forwardRef((e,t)=>B.createElement(g,{ref:t,...e,weights:ui}));Ei.displayName=`CaretUpIcon`;var Di=Ei,Oi=B.forwardRef((e,t)=>B.createElement(g,{ref:t,...e,weights:di}));Oi.displayName=`ChatCircleTextIcon`;var ki=Oi,Ai=B.forwardRef((e,t)=>B.createElement(g,{ref:t,...e,weights:fi}));Ai.displayName=`ClockIcon`;var ji=Ai,Mi=B.forwardRef((e,t)=>B.createElement(g,{ref:t,...e,weights:pi}));Mi.displayName=`ClockCounterClockwiseIcon`;var Ni=Mi,Pi=B.forwardRef((e,t)=>B.createElement(g,{ref:t,...e,weights:mi}));Pi.displayName=`InfoIcon`;var Fi=Pi,Ii=B.forwardRef((e,t)=>B.createElement(g,{ref:t,...e,weights:hi}));Ii.displayName=`KeyboardIcon`;var Li=Ii,Ri=B.forwardRef((e,t)=>B.createElement(g,{ref:t,...e,weights:gi}));Ri.displayName=`ListBulletsIcon`;var zi=Ri,Bi=B.forwardRef((e,t)=>B.createElement(g,{ref:t,...e,weights:_i}));Bi.displayName=`ListMagnifyingGlassIcon`;var Vi=Bi,Hi=B.forwardRef((e,t)=>B.createElement(g,{ref:t,...e,weights:vi}));Hi.displayName=`MagnifyingGlassMinusIcon`;var Ui=Hi,Wi=B.forwardRef((e,t)=>B.createElement(g,{ref:t,...e,weights:yi}));Wi.displayName=`WrenchIcon`;var Gi=Wi,Ki=l(re(),1),qi=`$__all`;function Ji(e){let{margin:t,containerPadding:n,containerWidth:r,cols:i}=e;return(r-t[0]*(i-1)-n[0]*2)/i}function Yi(e,t,n){return Number.isFinite(e)?Math.round(t*e+Math.max(0,e-1)*n):e}function Xi(e,t,n,r,i,a,o){let{margin:s,containerPadding:c,rowHeight:l}=e,u=Ji(e),d,f,p,m;if(o?(d=Math.round(o.width),f=Math.round(o.height)):(d=Yi(r,u,s[0]),f=Yi(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 Zi(e,t,n,r,i){let{margin:a,containerPadding:o,cols:s,rowHeight:c,maxRows:l}=e,u=Ji(e),d=Math.round((n-o[0])/(u+a[0])),f=Math.round((t-o[1])/(c+a[1]));return d=ea(d,0,s-r),f=ea(f,0,l-i),{x:d,y:f}}function Qi(e,t,n){let{margin:r,containerPadding:i,rowHeight:a}=e,o=Ji(e);return{x:Math.round((n-i[0])/(o+r[0])),y:Math.round((t-i[1])/(a+r[1]))}}function $i(e,t,n){let{margin:r,rowHeight:i}=e,a=Ji(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 ea(e,t,n){return Math.max(Math.min(e,n),t)}function ta(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 na(e,t){for(let n=0;nta(e,t))}function ia(e,t){return t===`horizontal`?oa(e):t===`vertical`||t===`wrap`?aa(e):[...e]}function aa(e){return[...e].sort((e,t)=>e.y===t.y?e.x-t.x:e.y-t.y)}function oa(e){return[...e].sort((e,t)=>e.x===t.x?e.y-t.y:e.x-t.x)}function sa(e){let t=0;for(let n=0;nt&&(t=e)}}return t}function ca(e,t){for(let n=0;ne.static===!0)}function ua(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 da(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.y===1/0&&(i.y=sa(n)),!i.static)n.push(i);else for(;na(n,i);)i.y++}}return e}function ha(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=ia(e,o);(o===`vertical`&&typeof r==`number`?u>=r:o===`horizontal`&&typeof n==`number`&&l>=n)&&(d=d.reverse());let f=ra(d,t),p=f.length>0;if(p&&c)return da(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 ha(e,n,o?a.x:void 0,s?a.y:void 0,r,c,i);if(u&&s)return ha(e,n,void 0,n.y+1,r,c,i);if(u&&i===null){let r=n.y;return t.y=r,n.y=r+t.h,[...e]}if(d&&o)return ha(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]:ha(e,n,l,u,r,c,i)}function _a(e,t,n){return Math.max(t,Math.min(n,e))}var va=[{name:`gridBounds`,constrainPosition(e,t,n,{cols:r,maxRows:i}){return{x:_a(t,0,Math.max(0,r-e.w)),y:_a(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:_a(t,1,Math.max(1,o)),h:_a(n,1,Math.max(1,s))}}},{name:`minMaxSize`,constrainSize(e,t,n){return{w:_a(t,e.minW??1,e.maxW??1/0),h:_a(n,e.minH??1,e.maxH??1/0)}}}];function ya(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 ba(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 xa({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 Sa({top:e,left:t,width:n,height:r}){return{top:`${e}px`,left:`${t}px`,width:`${n}px`,height:`${r}px`,position:`absolute`}}function Ca(e){return e*100+`%`}function wa(e,t,n,r){return e+n>r?t:n}function Ta(e,t,n){return e<0?t:n}function Ea(e){return Math.max(0,e)}function Da(e){return Math.max(0,e)}var Oa=(e,t,n)=>{let{left:r,height:i,width:a}=t,o=e.top-(i-e.height);return{left:r,width:a,height:Ta(o,e.height,i),top:Da(o)}},ka=(e,t,n)=>{let{top:r,left:i,height:a,width:o}=t;return{top:r,height:a,width:wa(e.left,e.width,o,n),left:Ea(i)}},Aa=(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:Da(r),left:0}:{height:i,width:a,top:Da(r),left:o}},ja=(e,t,n)=>{let{top:r,left:i,height:a,width:o}=t;return{width:o,left:i,height:Ta(r,e.height,a),top:Da(r)}},Ma={n:Oa,ne:(e,t,n)=>Oa(e,ka(e,t,n)),e:ka,se:(e,t,n)=>ja(e,ka(e,t,n)),s:ja,sw:(e,t,n)=>ja(e,Aa(e,t)),w:Aa,nw:(e,t,n)=>Oa(e,Aa(e,t))};function Na(e,t,n,r){let i=Ma[e];return i?i(t,{...t,...n},r):n}var Pa={type:`transform`,scale:1,calcStyle(e){return xa(e)}},Fa={cols:12,rowHeight:150,margin:[10,10],containerPadding:null,maxRows:1/0},Ia={enabled:!0,bounded:!1,threshold:3},La={enabled:!0,handles:[`se`]},Ra={enabled:!1,defaultItem:{w:1,h:1},touchEnabled:!0,touchDragSource:`[data-rgl-draggable]`};function za(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??la(e).length>0;for(let i=o+1;it.y+t.h)break;ta(t,o)&&za(e,o,n+t[a],r,s)}}t[r]=n}function Ba(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&&!na(e,t);)t.y--;let i;for(;(i=na(e,t))!==void 0;)za(n,t,i.y+i.h,`y`);return t.y=Math.max(t.y,0),t}function Va(e,t,n,r){for(t.x=Math.max(t.x,0),t.y=Math.max(t.y,0);t.x>0&&!na(e,t);)t.x--;let i;for(;(i=na(e,t))!==void 0;)if(za(r,t,i.x+i.w,`x`),t.x+t.w>n)for(t.x=n-t.w,t.y++;t.x>0&&!na(e,t);)t.x--;return t.x=Math.max(t.x,0),t}var Ha={type:`vertical`,allowOverlap:!1,compact(e,t){let n=la(e),r=sa(n),i=aa(e),a=Array(e.length);for(let t=0;te[t]-e[n])}function Xa(e,t){let n=Ya(e),r=n[0];if(r===void 0)throw Error(`No breakpoints defined`);for(let i=1;ie[a]&&(r=a)}return r}function Za(e,t){let n=t[e];if(n===void 0)throw Error(`ResponsiveReactGridLayout: \`cols\` entry for breakpoint ${String(e)} is missing!`);return n}function Qa(e,t,n,r,i,a){let o=e[n];if(o)return da(o);let s=e[r],c=Ya(t),l=c.slice(c.indexOf(n));for(let t=0;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 M(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=M,e.createCustomEqual=j,e.deepEqual=w,e.sameValueZeroEqual=o,e.shallowEqual=E,Object.defineProperty(e,"__esModule",{value:!0})}))})),to=v(((e,t)=>{t.exports=`SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED`})),no=v(((e,t)=>{var n=to();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}})),ro=v(((e,t)=>{t.exports=no()()})),io=l(ro(),1);function ao(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&&ao(e.changedTouches,e=>t===e.identifier)}function Ao(e){if(e.targetTouches&&e.targetTouches[0])return e.targetTouches[0].identifier;if(e.changedTouches&&e.changedTouches[0])return e.changedTouches[0].identifier}function jo(){return typeof __webpack_nonce__<`u`?__webpack_nonce__:void 0}function Mo(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??jo();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&&Fo(e.body,`react-draggable-transparent-selection`)}function No(e){window.requestAnimationFrame?window.requestAnimationFrame(()=>{Po(e)}):Po(e)}function Po(e){if(e)try{e.body&&Io(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 Fo(e,t){e.classList?e.classList.add(t):e.className.match(RegExp(`(?:^|\\s)${t}(?!\\S)`))||(e.className+=` ${t}`)}function Io(e,t){e.classList?e.classList.remove(t):e.className=e.className.replace(RegExp(`(?:^|\\s)${t}(?!\\S)`,`g`),``)}function Lo(e,t,n){if(!e.props.bounds)return[t,n];let{bounds:r}=e.props;r=typeof r==`string`?r:Wo(r);let i=Go(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+co(s.paddingLeft)+co(o.marginLeft),top:-i.offsetTop+co(s.paddingTop)+co(o.marginTop),right:wo(a)-So(i)-i.offsetLeft+co(s.paddingRight)-co(o.marginRight),bottom:Co(a)-xo(i)-i.offsetTop+co(s.paddingBottom)-co(o.marginBottom)}}return so(r.right)&&(t=Math.min(t,r.right)),so(r.bottom)&&(n=Math.min(n,r.bottom)),so(r.left)&&(t=Math.max(t,r.left)),so(r.top)&&(n=Math.max(n,r.top)),[t,n]}function Ro(e,t,n){return[Math.round(t/e[0])*e[0],Math.round(n/e[1])*e[1]]}function zo(e){return e.props.axis===`both`||e.props.axis===`x`}function Bo(e){return e.props.axis===`both`||e.props.axis===`y`}function Vo(e,t,n){let r=typeof t==`number`?ko(e,t):null;if(typeof t==`number`&&!r)return null;let i=Go(n),a=n.props.offsetParent||i.offsetParent||i.ownerDocument.body;return To(r||e,a,n.props.scale)}function Ho(e,t,n){let r=!so(e.lastX),i=Go(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 Uo(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 Wo(e){return{left:e.left,top:e.top,right:e.right,bottom:e.bottom}}function Go(e){let t=e.findDOMNode();if(!t)throw Error(`: Unmounted during event!`);return t}var Ko=typeof process<`u`&&{}.DRAGGABLE_DEBUG?console.log.bind(console):function(){},qo={touch:{start:`touchstart`,move:`touchmove`,stop:`touchend`},mouse:{start:`mousedown`,move:`mousemove`,stop:`mouseup`}},Jo=qo.mouse,Yo=class extends B.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&&!vo(e.target,this.props.handle,t)||this.props.cancel&&vo(e.target,this.props.cancel,t))return;e.type===`touchstart`&&!this.props.allowMobileScroll&&e.preventDefault();let r=Ao(e);this.touchIdentifier=r;let i=Vo(e,r,this);if(i==null)return;let{x:a,y:o}=i,s=Ho(this,a,o);Ko(`DraggableCore: handleDragStart: %j`,s),Ko(`calling`,this.props.onStart),this.props.onStart(e,s)!==!1&&this.mounted!==!1&&(this.props.enableUserSelectHack&&Mo(n,this.props.nonce),this.dragging=!0,this.lastX=a,this.lastY=o,yo(n,Jo.move,this.handleDrag),yo(n,Jo.stop,this.handleDragStop))},this.handleDrag=e=>{let t=Vo(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]=Ro(this.props.grid,e,t),!e&&!t)return;n=this.lastX+e,r=this.lastY+t}let i=Ho(this,n,r);if(Ko(`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=Vo(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]=Ro(this.props.grid,e,t),n=this.lastX+e,r=this.lastY+t}let i=Ho(this,n,r);if(this.props.onStop(e,i)===!1||this.mounted===!1)return!1;let a=this.findDOMNode();a&&this.props.enableUserSelectHack&&No(a.ownerDocument),Ko(`DraggableCore: handleDragStop: %j`,i),this.dragging=!1,this.lastX=NaN,this.lastY=NaN,a&&(Ko(`DraggableCore: Removing handlers`),bo(a.ownerDocument,Jo.move,this.handleDrag),bo(a.ownerDocument,Jo.stop,this.handleDragStop))},this.onMouseDown=e=>(Jo=qo.mouse,this.handleDragStart(e)),this.onMouseUp=e=>(Jo=qo.mouse,this.handleDragStop(e)),this.onTouchStart=e=>(Jo=qo.touch,this.handleDragStart(e)),this.onTouchEnd=e=>(Jo=qo.touch,this.handleDragStop(e))}componentDidMount(){this.mounted=!0;let e=this.findDOMNode();e&&yo(e,qo.touch.start,this.onTouchStart,{passive:!1})}componentWillUnmount(){this.mounted=!1;let e=this.findDOMNode();if(e){let{ownerDocument:t}=e;bo(t,qo.mouse.move,this.handleDrag),bo(t,qo.touch.move,this.handleDrag),bo(t,qo.mouse.stop,this.handleDragStop),bo(t,qo.touch.stop,this.handleDragStop),bo(e,qo.touch.start,this.onTouchStart,{passive:!1}),this.props.enableUserSelectHack&&No(t)}}findDOMNode(){if(this.props?.nodeRef)return this.props.nodeRef.current;let e=Ki.default;return typeof e.findDOMNode==`function`?e.findDOMNode(this):(Ko(`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 B.cloneElement(B.Children.only(this.props.children),{onMouseDown:this.onMouseDown,onMouseUp:this.onMouseUp,onTouchEnd:this.onTouchEnd})}};Yo.displayName=`DraggableCore`,Yo.propTypes={allowAnyClick:io.default.bool,allowMobileScroll:io.default.bool,children:io.default.node.isRequired,disabled:io.default.bool,enableUserSelectHack:io.default.bool,offsetParent:function(e,t){if(e[t]&&e[t].nodeType!==1)throw Error(`Draggable's offsetParent must be a DOM Node.`)},grid:io.default.arrayOf(io.default.number),handle:io.default.string,cancel:io.default.string,nodeRef:io.default.object,nonce:io.default.string,onStart:io.default.func,onDrag:io.default.func,onStop:io.default.func,onMouseDown:io.default.func,scale:io.default.number,className:lo,style:lo,transform:lo},Yo.defaultProps={allowAnyClick:!1,allowMobileScroll:!1,disabled:!1,enableUserSelectHack:!0,onStart:function(){},onDrag:function(){},onStop:function(){},onMouseDown:function(){},scale:1};var Xo=class extends B.Component{constructor(e){super(e),this.onDragStart=(e,t)=>{if(Ko(`Draggable: onDragStart: %j`,t),this.props.onStart(e,Uo(this,t))===!1)return!1;this.setState({dragging:!0,dragged:!0})},this.onDrag=(e,t)=>{if(!this.state.dragging)return!1;Ko(`Draggable: onDrag: %j`,t);let n=Uo(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]=Lo(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,Uo(this,t))===!1)return!1;Ko(`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)?(Ko(`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=Ki.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={},p=null,m=!s||this.state.dragging,h=s||r,g={x:zo(this)&&m?this.state.x:h.x,y:Bo(this)&&m?this.state.y:h.y};this.state.isElementSVG?p=Do(g,c):d=Eo(g,c);let _=B.Children.only(n),v=f(_.props.className||``,i,{[a]:this.state.dragging,[o]:this.state.dragged});return B.createElement(Yo,{...u,onStart:this.onDragStart,onDrag:this.onDrag,onStop:this.onDragStop},B.cloneElement(_,{className:v,style:{..._.props.style,...d},transform:p}))}};Xo.displayName=`Draggable`,Xo.propTypes={...Yo.propTypes,axis:io.default.oneOf([`both`,`x`,`y`,`none`]),bounds:io.default.oneOfType([io.default.shape({left:io.default.number,right:io.default.number,top:io.default.number,bottom:io.default.number}),io.default.string,io.default.oneOf([!1])]),defaultClassName:io.default.string,defaultClassNameDragging:io.default.string,defaultClassNameDragged:io.default.string,defaultPosition:io.default.shape({x:io.default.number,y:io.default.number}),positionOffset:io.default.shape({x:io.default.oneOfType([io.default.number,io.default.string]),y:io.default.oneOfType([io.default.number,io.default.string])}),position:io.default.shape({x:io.default.number,y:io.default.number}),className:lo,style:lo,transform:lo},Xo.defaultProps={...Yo.defaultProps,axis:`both`,bounds:!1,defaultClassName:`react-draggable`,defaultClassNameDragging:`react-draggable-dragging`,defaultClassNameDragged:`react-draggable-dragged`,defaultPosition:{x:0,y:0},scale:1};var Zo=v(((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:()=>Te,default:()=>Ee}),t.exports=d(f);var p=u(oe()),m=u(ro()),h=u(re()),g=Zo();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 ie(e){if(e.targetTouches&&e.targetTouches[0])return e.targetTouches[0].identifier;if(e.changedTouches&&e.changedTouches[0])return e.changedTouches[0].identifier}function ae(){return typeof __webpack_nonce__<`u`?__webpack_nonce__:void 0}function R(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??ae();r&&n.setAttribute(`nonce`,r),n.innerHTML=`.react-draggable-transparent-selection *::-moz-selection {all: inherit;} `,n.innerHTML+=`.react-draggable-transparent-selection *::selection {all: inherit;} @@ -36,5 +36,5 @@ import{A as e,C as t,D as n,E as r,K as i,M as a,O as o,P as s,S as c,St as l,T `:`
`,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=iv(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=OJ([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 yE;h.marker=g.makeTooltipMarker(`item`,QC(h.color),d);var _=_T(s.formatTooltip(c,!1,l)),v=p.get(`order`),y=p.get(`valueFormatter`),b=_.frag,x=b?uE(y?U({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=iv(t),a=i.tooltipConfig.option||{},o=a.encodeHTMLContent;if(J(a)){var s=a;a={content:s,formatter:s},o=!0}o&&r&&a.content&&(a=gl(a),a.content=WS(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=OJ(c,this._tooltipModel,u?{position:u}:null),f=d.get(`content`),p=Math.random()+``,m=new yE;this._showOrMove(d,function(){var n=gl(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(J(u)){var p=e.ecModel.get(`useUTC`),m=q(n)?n[0]:n,h=m&&m.axisType&&m.axisType.indexOf(`time`)>=0;d=u,h&&(d=EC(m.axisValue,d,p)),d=XC(d,n,!0)}else if(jl(u)){var g=K(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`||q(t))return{color:r||i};if(!q(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),jl(t)&&(t=t([n,r],a,i.el,f,{viewSize:[s,c],contentSize:l.slice()})),q(t))n=Cu(t[0],s),r=Cu(t[1],c);else if(Pl(t)){var p=t;p.width=l[0],p.height=l[1];var m=pw(p,{width:s,height:c});n=m.x,r=m.y,u=null,d=null}else if(J(t)&&o){var h=MJ(t,f,l,e.get(`borderWidth`));n=h[0],r=h[1]}else{var h=AJ(n,r,i,s,c,u?null:20,d?null:20);n=h[0],r=h[1]}if(u&&(n-=NJ(u)?l[0]/2:u===`right`?l[0]:0),d&&(r-=NJ(d)?l[1]/2:d===`bottom`?l[1]:0),aJ(e)){var h=jJ(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&&W(n,function(n,a){var o=n.dataByAxis||[],s=(e[a]||{}).dataByAxis||[];i&&=o.length===s.length,i&&W(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&&W(o,function(e,t){var n=c[t];i=i&&e.seriesIndex===n.seriesIndex&&e.dataIndex===n.dataIndex}),r&&W(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){!ou.node&&t.getDom()&&(MP(this,`_updatePosition`),this._tooltipContent.dispose(),XG(`itemTooltip`,t),this._tooltipContent=null,this._tooltipModel=null,this._lastDataByCoordSys=null,this._cbParamsList=null)},t.type=`tooltip`,t}(_P);function OJ(e,t,n){var r=t.ecModel,i;n?(i=new TS(n,r,r),i=new TS(t.option,i,r)):i=t;for(var a=e.length-1;a>=0;a--){var o=e[a];o&&(o instanceof TS&&(o=o.get(`tooltip`,!0)),J(o)&&(o={formatter:o}),o&&(i=new TS(o,i,r)))}return i}function kJ(e,t){return e.dispatchAction||K(t.dispatchAction,t)}function AJ(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 jJ(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 MJ(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 NJ(e){return e===`center`||e===`middle`}function PJ(e,t,n){var r=Od(e).queryOptionMap,i=r.keys()[0];if(i&&i!==`series`){var a=jd(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=iv(t).tooltipConfig;if(n&&n.name===e.name)return s=t,!0}),s)return{componentMainType:i,componentIndex:a.componentIndex,el:s}}}}function FJ(e){aR(dK),e.registerComponentModel(iJ),e.registerComponentView(DJ),e.registerAction({type:`showTip`,event:`showTip`,update:`tooltip:manuallyShowTip`},ru),e.registerAction({type:`hideTip`,event:`hideTip`,update:`tooltip:manuallyHideTip`},ru)}var IJ=[`rect`,`polygon`,`keep`,`clear`];function LJ(e,t){var n=rd(e?e.brush:[]);if(n.length){var r=[];W(n,function(e){var t=e.hasOwnProperty(`toolbox`)?e.toolbox:[];t instanceof Array&&(r=r.concat(t))});var i=e&&e.toolbox;q(i)&&(i=i[0]),i||(i={feature:{}},e.toolbox=[i]);var a=i.feature||(i.feature={}),o=a.brush||={},s=o.type||=[];s.push.apply(s,r),Jd(s,function(e){return e+``},null),t&&!s.length&&s.push.apply(s,IJ)}}var RJ=W;function zJ(e){if(e){for(var t in e)if(e.hasOwnProperty(t))return!0}}function BJ(e,t,n){var r={};return RJ(t,function(t){var a=r[t]=i();RJ(e[t],function(e,r){if(cH.isValidType(r)){var i={type:r,visual:e};n&&n(i,t),a[r]=new cH(i),r===`opacity`&&(i=gl(i),i.type=`colorAlpha`,a.__hidden.__alphaForOpacity=new cH(i))}})}),r;function i(){var e=function(){};return e.prototype.__hidden=e.prototype,new e}}function VJ(e,t,n){var r;W(n,function(e){t.hasOwnProperty(e)&&zJ(t[e])&&(r=!0)}),r&&W(n,function(n){t.hasOwnProperty(n)&&zJ(t[n])?e[n]=gl(t[n]):delete e[n]})}function HJ(e,t,n,r,i,a){var o={};W(e,function(e){o[e]=cH.prepareVisualTypes(t[e])});var s;function c(e){return mF(n,s,e)}function l(e,t){gF(n,s,e,t)}a==null?n.each(u):n.each([a],u);function u(e,u){s=a==null?e:u;var d=n.getRawDataItem(s);if(!(d&&d.visualMap===!1))for(var f=r.call(i,e),p=t[f],m=o[f],h=0,g=m.length;ht[0][1]&&(t[0][1]=a[0]),a[1]t[1][1]&&(t[1][1]=a[1])}return t&&aY(t)}};function aY(e){return new fp(e[0][0],e[1][0],e[0][1]-e[0][0],e[1][1]-e[1][0])}var oY=function(e){H(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type=t.type,n}return t.prototype.init=function(e,t){this.ecModel=e,this.api=t,this.model,(this._brushController=new eU(t.getZr())).on(`brush`,K(this._onBrush,this)).mount()},t.prototype.render=function(e,t,n,r){this.model=e,this._updateController(e,t,n,r)},t.prototype.updateTransform=function(e,t,n,r){ZJ(t),this._updateController(e,t,n,r)},t.prototype.updateVisual=function(e,t,n,r){this.updateTransform(e,t,n,r)},t.prototype.updateView=function(e,t,n,r){this._updateController(e,t,n,r)},t.prototype._updateController=function(e,t,n,r){(!r||r.$from!==e.id)&&this._brushController.setPanels(e.brushTargetManager.makePanelOpts(n)).enableBrush(e.brushOption).updateCovers(e.areas.slice())},t.prototype.dispose=function(){this._brushController.dispose()},t.prototype._onBrush=function(e){var t=this.model.id,n=this.model.brushTargetManager.setOutputRanges(e.areas,this.ecModel);(!e.isEnd||e.removeOnClick)&&this.api.dispatchAction({type:`brush`,brushId:t,areas:gl(n),$from:t}),e.isEnd&&this.api.dispatchAction({type:`brushEnd`,brushId:t,areas:gl(n),$from:t})},t.type=`brush`,t}(_P),sY=function(e){H(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type=t.type,n.areas=[],n.brushOption={},n}return t.prototype.optionUpdated=function(e,t){var n=this.option;!t&&VJ(n,e,[`inBrush`,`outOfBrush`]);var r=n.inBrush=n.inBrush||{};n.outOfBrush=n.outOfBrush||{color:this.option.defaultOutOfBrushColor},r.hasOwnProperty(`liftZ`)||(r.liftZ=5)},t.prototype.setAreas=function(e){e&&(this.areas=G(e,function(e){return cY(this.option,e)},this))},t.prototype.setBrushOption=function(e){this.brushOption=cY(this.option,e),this.brushType=this.brushOption.brushType},t.type=`brush`,t.dependencies=[`geo`,`grid`,`xAxis`,`yAxis`,`parallel`,`series`],t.defaultOption={seriesIndex:`all`,brushType:`rect`,brushMode:`single`,transformable:!0,brushStyle:{borderWidth:1,color:Q.color.backgroundTint,borderColor:Q.color.borderTint},throttleType:`fixRate`,throttleDelay:0,removeOnClick:!0,z:1e4,defaultOutOfBrushColor:Q.color.disabled},t}(Sw);function cY(e,t){return _l({brushType:e.brushType,brushMode:e.brushMode,transformable:e.transformable,brushStyle:new TS(e.brushStyle).getItemStyle(),removeOnClick:e.removeOnClick,z:e.z},t,!0)}var lY=[`rect`,`polygon`,`lineX`,`lineY`,`keep`,`clear`],uY=function(e){H(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype.render=function(e,t,n){var r,i,a;t.eachComponent({mainType:`brush`},function(e){r=e.brushType,i=e.brushOption.brushMode||`single`,a||=!!e.areas.length}),this._brushType=r,this._brushMode=i,W(e.get(`type`,!0),function(t){e.setIconStatus(t,(t===`keep`?i===`multiple`:t===`clear`?a:t===r)?`emphasis`:`normal`)})},t.prototype.updateView=function(e,t,n){this.render(e,t,n)},t.prototype.getIcons=function(){var e=this.model,t=e.get(`icon`,!0),n={};return W(e.get(`type`,!0),function(e){t[e]&&(n[e]=t[e])}),n},t.prototype.onclick=function(e,t,n){var r=this._brushType,i=this._brushMode;n===`clear`?(t.dispatchAction({type:`axisAreaSelect`,intervals:[]}),t.dispatchAction({type:`brush`,command:`clear`,areas:[]})):t.dispatchAction({type:`takeGlobalCursor`,key:`brush`,brushOption:{brushType:n===`keep`?r:r!==n&&n,brushMode:n===`keep`?i===`multiple`?`single`:`multiple`:i}})},t.getDefaultOption=function(e){return{show:!0,type:lY.slice(),icon:{rect:`M7.3,34.7 M0.4,10V-0.2h9.8 M89.6,10V-0.2h-9.8 M0.4,60v10.2h9.8 M89.6,60v10.2h-9.8 M12.3,22.4V10.5h13.1 M33.6,10.5h7.8 M49.1,10.5h7.8 M77.5,22.4V10.5h-13 M12.3,31.1v8.2 M77.7,31.1v8.2 M12.3,47.6v11.9h13.1 M33.6,59.5h7.6 M49.1,59.5 h7.7 M77.5,47.6v11.9h-13`,polygon:`M55.2,34.9c1.7,0,3.1,1.4,3.1,3.1s-1.4,3.1-3.1,3.1 s-3.1-1.4-3.1-3.1S53.5,34.9,55.2,34.9z M50.4,51c1.7,0,3.1,1.4,3.1,3.1c0,1.7-1.4,3.1-3.1,3.1c-1.7,0-3.1-1.4-3.1-3.1 C47.3,52.4,48.7,51,50.4,51z M55.6,37.1l1.5-7.8 M60.1,13.5l1.6-8.7l-7.8,4 M59,19l-1,5.3 M24,16.1l6.4,4.9l6.4-3.3 M48.5,11.6 l-5.9,3.1 M19.1,12.8L9.7,5.1l1.1,7.7 M13.4,29.8l1,7.3l6.6,1.6 M11.6,18.4l1,6.1 M32.8,41.9 M26.6,40.4 M27.3,40.2l6.1,1.6 M49.9,52.1l-5.6-7.6l-4.9-1.2`,lineX:`M15.2,30 M19.7,15.6V1.9H29 M34.8,1.9H40.4 M55.3,15.6V1.9H45.9 M19.7,44.4V58.1H29 M34.8,58.1H40.4 M55.3,44.4 V58.1H45.9 M12.5,20.3l-9.4,9.6l9.6,9.8 M3.1,29.9h16.5 M62.5,20.3l9.4,9.6L62.3,39.7 M71.9,29.9H55.4`,lineY:`M38.8,7.7 M52.7,12h13.2v9 M65.9,26.6V32 M52.7,46.3h13.2v-9 M24.9,12H11.8v9 M11.8,26.6V32 M24.9,46.3H11.8v-9 M48.2,5.1l-9.3-9l-9.4,9.2 M38.9-3.9V12 M48.2,53.3l-9.3,9l-9.4-9.2 M38.9,62.3V46.4`,keep:`M4,10.5V1h10.3 M20.7,1h6.1 M33,1h6.1 M55.4,10.5V1H45.2 M4,17.3v6.6 M55.6,17.3v6.6 M4,30.5V40h10.3 M20.7,40 h6.1 M33,40h6.1 M55.4,30.5V40H45.2 M21,18.9h62.9v48.6H21V18.9z`,clear:`M22,14.7l30.9,31 M52.9,14.7L22,45.7 M4.7,16.8V4.2h13.1 M26,4.2h7.8 M41.6,4.2h7.8 M70.3,16.8V4.2H57.2 M4.7,25.9v8.6 M70.3,25.9v8.6 M4.7,43.2v12.6h13.1 M26,55.8h7.8 M41.6,55.8h7.8 M70.3,43.2v12.6H57.2`},title:e.getLocaleModel().get([`toolbox`,`brush`,`title`])}},t}(eq);function dY(e){e.registerComponentView(oY),e.registerComponentModel(sY),e.registerPreprocessor(LJ),e.registerVisual(e.PRIORITY.VISUAL.BRUSH,QJ),e.registerAction({type:`brush`,event:`brush`,update:`updateVisual`},function(e,t){t.eachComponent({mainType:`brush`,query:e},function(t){t.setAreas(e.areas)})}),e.registerAction({type:`brushSelect`,event:`brushSelected`,update:`none`},ru),e.registerAction({type:`brushEnd`,event:`brushEnd`,update:`none`},ru),nq(`brush`,uY)}function fY(e,t){if(!e)return!1;for(var n=q(e)?e:[e],r=0;r=0&&(s[o]=+s[o].toFixed(f)),[s,d]}var yY={min:Al(vY,`min`),max:Al(vY,`max`),average:Al(vY,`average`),median:Al(vY,`median`)};function bY(e,t){if(t){var n=e.getData(),r=e.coordinateSystem,i=r&&r.dimensions;if(!_Y(t)&&!q(t.coord)&&q(i)){var a=xY(t,n,r,e);if(t=gl(t),t.type&&yY[t.type]&&a.baseAxis&&a.valueAxis){var o=xl(i,a.baseAxis.dim),s=xl(i,a.valueAxis.dim),c=yY[t.type](n,a.valueAxis.dim,a.baseDataDim,a.valueDataDim,o,s);t.coord=c[0],t.value=c[1]}else t.coord=[t.xAxis==null?t.radiusAxis:t.xAxis,t.yAxis==null?t.angleAxis:t.yAxis]}if(t.coord==null||!q(i)){t.coord=[];var l=e.getBaseAxis();if(l&&t.type&&yY[t.type]){var u=r.getOtherAxis(l);u&&(t.value=EY(n,n.mapDimension(u.dim),t.type))}}else for(var d=t.coord,f=0;f<2;f++)yY[d[f]]&&(d[f]=EY(n,n.mapDimension(i[f]),d[f]));return t}}function xY(e,t,n,r){var i={};return e.valueIndex!=null||e.valueDim!=null?(i.valueDataDim=e.valueIndex==null?e.valueDim:t.getDimension(e.valueIndex),i.valueAxis=n.getAxis(SY(r,i.valueDataDim)),i.baseAxis=n.getOtherAxis(i.valueAxis),i.baseDataDim=t.mapDimension(i.baseAxis.dim)):(i.baseAxis=r.getBaseAxis(),i.valueAxis=n.getOtherAxis(i.baseAxis),i.baseDataDim=t.mapDimension(i.baseAxis.dim),i.valueDataDim=t.mapDimension(i.valueAxis.dim)),i}function SY(e,t){var n=e.getData().getDimensionInfo(t);return n&&n.coordDim}function CY(e,t){return e&&e.containData&&t.coord&&!gY(t)?e.containData(t.coord):!0}function wY(e,t,n){return e&&e.containZone&&t.coord&&n.coord&&!gY(t)&&!gY(n)?e.containZone(t.coord,n.coord):!0}function TY(e,t){return e?function(e,n,r,i){return xT(i<2?e.coord&&e.coord[i]:e.value,t[i])}:function(e,n,r,i){return xT(e.value,t[i])}}function EY(e,t,n){if(n===`average`){var r=0,i=0;return e.each(t,function(e,t){isNaN(e)||(r+=e,i++)}),r/i}return n===`median`?e.getMedian(t):e.getDataExtent(t)[+(n===`max`)]}var DY=Td(),OY=function(e){H(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type=t.type,n}return t.prototype.init=function(){this.markerGroupMap=X()},t.prototype.render=function(e,t,n){var r=this,i=this.markerGroupMap;i.each(function(e){DY(e).keep=!1}),t.eachSeries(function(e){var i=hY.getMarkerModelFromSeries(e,r.type);i&&r.renderSeries(e,i,t,n)}),i.each(function(e){!DY(e).keep&&r.group.remove(e.group)}),kY(t,i,this.type)},t.prototype.markKeep=function(e){DY(e).keep=!0},t.prototype.toggleBlurSeries=function(e,t){var n=this;W(e,function(e){var r=hY.getMarkerModelFromSeries(e,n.type);r&&r.getData().eachItemGraphicEl(function(e){e&&(t?Xv(e):Zv(e))})})},t.type=`marker`,t}(_P);function kY(e,t,n){e.eachSeries(function(e){var r=hY.getMarkerModelFromSeries(e,n),i=t.get(e.id);if(r&&i&&i.group){var a=Ux(r),o=a.z,s=a.zlevel;Gx(i.group,o,s)}})}var AY=function(e){H(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type=t.type,n}return t.prototype.createMarkerModelFromSeries=function(e,n,r){return new t(e,n,r)},t.type=`markLine`,t.defaultOption={z:5,symbol:[`circle`,`arrow`],symbolSize:[8,16],symbolOffset:0,precision:2,tooltip:{trigger:`item`},label:{show:!0,position:`end`,distance:5},lineStyle:{type:`dashed`},emphasis:{label:{show:!0},lineStyle:{width:3}},animationEasing:`linear`},t}(hY),jY=Td(),MY=function(e,t,n,r){var i=e.getData(),a;if(q(r))a=r;else{var o=r.type;if(o===`min`||o===`max`||o===`average`||o===`median`||r.xAxis!=null||r.yAxis!=null){var s=void 0,c=void 0;if(r.yAxis!=null||r.xAxis!=null)s=t.getAxis(r.yAxis==null?`x`:`y`),c=Vl(r.yAxis,r.xAxis);else{var l=xY(r,i,t,e);s=l.valueAxis,c=EY(i,WO(i,l.valueDataDim),o)}var u=s.dim===`x`?0:1,d=1-u,f=gl(r),p={coord:[]};f.type=null,f.coord=[],f.coord[d]=-1/0,p.coord[d]=1/0;var m=n.get(`precision`);m>=0&&Nl(c)&&(c=+c.toFixed(Math.min(m,20))),f.coord[u]=p.coord[u]=c,a=[f,p,{type:o,valueIndex:r.valueIndex,value:c}]}else a=[]}var h=[bY(e,a[0]),bY(e,a[1]),U({},a[2])];return h[2].type=h[2].type||null,_l(h[2],h[0]),_l(h[2],h[1]),h};function NY(e){return!isNaN(e)&&!isFinite(e)}function PY(e,t,n,r){var i=1-e,a=r.dimensions[e];return NY(t[i])&&NY(n[i])&&t[e]===n[e]&&r.getAxis(a).containData(t[e])}function FY(e,t){if(e.type===`cartesian2d`){var n=t[0].coord,r=t[1].coord;if(n&&r&&(PY(1,n,r,e)||PY(0,n,r,e)))return!0}return CY(e,t[0])&&CY(e,t[1])}function IY(e,t,n,r,i){var a=r.coordinateSystem,o=e.getItemModel(t),s,c=Cu(o.get(`x`),i.getWidth()),l=Cu(o.get(`y`),i.getHeight());if(!isNaN(c)&&!isNaN(l))s=[c,l];else{if(r.getMarkerPosition)s=r.getMarkerPosition(e.getValues(e.dimensions,t));else{var u=a.dimensions,d=e.get(u[0],t),f=e.get(u[1],t);s=a.dataToPoint([d,f])}if(rB(a,`cartesian2d`)){var p=a.getAxis(`x`),m=a.getAxis(`y`),u=a.dimensions;NY(e.get(u[0],t))?s[0]=p.toGlobalCoord(p.getExtent()[+!n]):NY(e.get(u[1],t))&&(s[1]=m.toGlobalCoord(m.getExtent()[+!n]))}isNaN(c)||(s[0]=c),isNaN(l)||(s[1]=l)}e.setItemLayout(t,s)}var LY=function(e){H(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type=t.type,n}return t.prototype.updateTransform=function(e,t,n){t.eachSeries(function(e){var t=hY.getMarkerModelFromSeries(e,`markLine`);if(t){var r=t.getData(),i=jY(t).from,a=jY(t).to;i.each(function(t){IY(i,t,!0,e,n),IY(a,t,!1,e,n)}),r.each(function(e){r.setItemLayout(e,[i.getItemLayout(e),a.getItemLayout(e)])}),this.markerGroupMap.get(e.id).updateLayout()}},this)},t.prototype.renderSeries=function(e,t,n,r){var i=e.coordinateSystem,a=e.id,o=e.getData(),s=this.markerGroupMap,c=s.get(a)||s.set(a,new PH);this.group.add(c.group);var l=RY(i,e,t),u=l.from,d=l.to,f=l.line;jY(t).from=u,jY(t).to=d,t.setData(f);var p=t.get(`symbol`),m=t.get(`symbolSize`),h=t.get(`symbolRotate`),g=t.get(`symbolOffset`);q(p)||(p=[p,p]),q(m)||(m=[m,m]),q(h)||(h=[h,h]),q(g)||(g=[g,g]),l.from.each(function(e){_(u,e,!0),_(d,e,!1)}),f.each(function(e){var t=f.getItemModel(e),n=t.getModel(`lineStyle`).getLineStyle();f.setItemLayout(e,[u.getItemLayout(e),d.getItemLayout(e)]);var r=t.get(`z2`);n.stroke??=u.getItemVisual(e,`style`).fill,f.setItemVisual(e,{z2:Y(r,0),fromSymbolKeepAspect:u.getItemVisual(e,`symbolKeepAspect`),fromSymbolOffset:u.getItemVisual(e,`symbolOffset`),fromSymbolRotate:u.getItemVisual(e,`symbolRotate`),fromSymbolSize:u.getItemVisual(e,`symbolSize`),fromSymbol:u.getItemVisual(e,`symbol`),toSymbolKeepAspect:d.getItemVisual(e,`symbolKeepAspect`),toSymbolOffset:d.getItemVisual(e,`symbolOffset`),toSymbolRotate:d.getItemVisual(e,`symbolRotate`),toSymbolSize:d.getItemVisual(e,`symbolSize`),toSymbol:d.getItemVisual(e,`symbol`),style:n})}),c.updateData(f),l.line.eachItemGraphicEl(function(e){iv(e).dataModel=t,e.traverse(function(e){iv(e).dataModel=t})});function _(t,n,i){var a=t.getItemModel(n);IY(t,n,i,e,r);var s=a.getModel(`itemStyle`).getItemStyle();s.fill??=hF(o,`color`),t.setItemVisual(n,{symbolKeepAspect:a.get(`symbolKeepAspect`),symbolOffset:Y(a.get(`symbolOffset`,!0),g[+!i]),symbolRotate:Y(a.get(`symbolRotate`,!0),h[+!i]),symbolSize:Y(a.get(`symbolSize`),m[+!i]),symbol:Y(a.get(`symbol`,!0),p[+!i]),style:s})}this.markKeep(c),c.group.silent=t.get(`silent`)||e.get(`silent`)},t.type=`markLine`,t}(OY);function RY(e,t,n){var r=e?G(e&&e.dimensions,function(e){var n=t.getData();return U(U({},n.getDimensionInfo(n.mapDimension(e))||{}),{name:e,ordinalMeta:null})}):[{name:`value`,type:`float`}],i=new ER(r,n),a=new ER(r,n),o=new ER([],n),s=G(n.get(`data`),Al(MY,t,e,n));e&&(s=El(s,Al(FY,e)));var c=TY(!!e,r);return i.initData(G(s,function(e){return e[0]}),null,c),a.initData(G(s,function(e){return e[1]}),null,c),o.initData(G(s,function(e){return e[2]})),o.hasItemOption=!0,{from:i,to:a,line:o}}function zY(e){e.registerComponentModel(AY),e.registerComponentView(LY),e.registerPreprocessor(function(e){fY(e.series,`markLine`)&&(e.markLine=e.markLine||{})})}var BY=function(e){H(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type=t.type,n}return t.prototype.createMarkerModelFromSeries=function(e,n,r){return new t(e,n,r)},t.type=`markArea`,t.defaultOption={z:1,tooltip:{trigger:`item`},animation:!1,label:{show:!0,position:`top`},itemStyle:{borderWidth:0},emphasis:{label:{show:!0,position:`top`}}},t}(hY),VY=Td(),HY=function(e,t,n,r){var i=r[0],a=r[1];if(i&&a){var o=bY(e,i),s=bY(e,a),c=o.coord,l=s.coord;c[0]=Vl(c[0],-1/0),c[1]=Vl(c[1],-1/0),l[0]=Vl(l[0],1/0),l[1]=Vl(l[1],1/0);var u=vl([{},o,s]);return u.coord=[o.coord,s.coord],u.x0=o.x,u.y0=o.y,u.x1=s.x,u.y1=s.y,u}};function UY(e){return!isNaN(e)&&!isFinite(e)}function WY(e,t,n,r){var i=1-e;return UY(t[i])&&UY(n[i])}function GY(e,t){var n=t.coord[0],r=t.coord[1],i={coord:n,x:t.x0,y:t.y0},a={coord:r,x:t.x1,y:t.y1};return rB(e,`cartesian2d`)?n&&r&&(WY(1,n,r,e)||WY(0,n,r,e))?!0:wY(e,i,a):CY(e,i)||CY(e,a)}function KY(e,t,n,r,i){var a=r.coordinateSystem,o=e.getItemModel(t),s,c=Cu(o.get(n[0]),i.getWidth()),l=Cu(o.get(n[1]),i.getHeight());if(!isNaN(c)&&!isNaN(l))s=[c,l];else{if(r.getMarkerPosition){var u=e.getValues([`x0`,`y0`],t),d=e.getValues([`x1`,`y1`],t),f=a.clampData(u),p=a.clampData(d),m=[];m[0]=n[0]===`x0`?f[0]>p[0]?d[0]:u[0]:f[0]>p[0]?u[0]:d[0],m[1]=n[1]===`y0`?f[1]>p[1]?d[1]:u[1]:f[1]>p[1]?u[1]:d[1],s=r.getMarkerPosition(m,n,!0)}else{var h=e.get(n[0],t),g=e.get(n[1],t),_=[h,g];a.clampData&&a.clampData(_,_),s=a.dataToPoint(_,!0)}if(rB(a,`cartesian2d`)){var v=a.getAxis(`x`),y=a.getAxis(`y`),h=e.get(n[0],t),g=e.get(n[1],t);UY(h)?s[0]=v.toGlobalCoord(v.getExtent()[n[0]===`x0`?0:1]):UY(g)&&(s[1]=y.toGlobalCoord(y.getExtent()[n[1]===`y0`?0:1]))}isNaN(c)||(s[0]=c),isNaN(l)||(s[1]=l)}return s}var qY=[[`x0`,`y0`],[`x1`,`y0`],[`x1`,`y1`],[`x0`,`y1`]],JY=function(e){H(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type=t.type,n}return t.prototype.updateTransform=function(e,t,n){t.eachSeries(function(e){var t=hY.getMarkerModelFromSeries(e,`markArea`);if(t){var r=t.getData();r.each(function(t){var i=G(qY,function(i){return KY(r,t,i,e,n)});r.setItemLayout(t,i),r.getItemGraphicEl(t).setShape(`points`,i)})}},this)},t.prototype.renderSeries=function(e,t,n,r){var i=e.coordinateSystem,a=e.id,o=e.getData(),s=this.markerGroupMap,c=s.get(a)||s.set(a,{group:new Ky});this.group.add(c.group),this.markKeep(c);var l=YY(i,e,t);t.setData(l),l.each(function(t){var n=G(qY,function(n){return KY(l,t,n,e,r)}),a=i.getAxis(`x`).scale,s=i.getAxis(`y`).scale,c=a.getExtent(),u=s.getExtent(),d=[a.parse(l.get(`x0`,t)),a.parse(l.get(`x1`,t))],f=[s.parse(l.get(`y0`,t)),s.parse(l.get(`y1`,t))];Ou(d),Ou(f);var p=c[0]>d[1]||c[1]f[1]||u[1]=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}(Sw),$Y=Al,eX=W,tX=Ky,nX=function(e){H(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 tX),this.group.add(this._selectorGroup=new tX),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=hw(e,n).refContainer,l=e.getBoxLayoutParams(),u=e.get(`padding`),d=pw(l,c,u),f=this.layoutInner(e,i,d,r,o,s),p=pw(bl({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=aq(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)}),eX(t.getData(),function(i,a){var o=this,f=i.get(`name`);if(!this.newlineDisabled&&(f===``||f===` `)){var p=new tX;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`,$Y(aX,f,null,r,d)).on(`mouseover`,$Y(oX,m.name,null,r,d)).on(`mouseout`,$Y(sX,m.name,null,r,d)),n.ssr&&y.eachChild(function(e){var t=iv(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`),_=oh(h.fill);_&&_[3]===0&&(_[3]=.2,h=U(U({},h),{fill:mh(_,`rgba`)}));var v=this._createItem(o,f,a,i,t,e,{},h,g,l,r);v.on(`click`,$Y(aX,null,f,r,d)).on(`mouseover`,$Y(oX,null,f,r,d)).on(`mouseout`,$Y(sX,null,f,r,d)),n.ssr&&v.eachChild(function(e){var t=iv(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};iv(e).eventData=a},t.prototype._createSelector=function(e,t,n,r,i){var a=this.getSelectorGroup();eX(e,function(e){var r=e.type,i=new W_({style:{x:0,y:0,align:`center`,verticalAlign:`middle`},onclick:function(){n.dispatchAction({type:r===`all`?`legendAllSelect`:`legendInverseSelect`,legendId:t.id})}});a.add(i),eS(i,{normal:t.getModel(`selectorLabel`),emphasis:t.getModel([`emphasis`,`selectorLabel`])},{defaultText:e.title}),dy(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=rX(c,r,o,s,d,m,u),y=new tX,b=r.getModel(`textStyle`);if(jl(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(iX({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;J(w)&&w?T=w.replace(`{name}`,t??``):jl(w)&&(T=w(t));var E=m?b.getTextColor():r.get(`inactiveColor`);y.add(new W_({style:nS(b,{text:T,x:S,y:p/2,fill:E,align:C,verticalAlign:`middle`},{inheritColor:E})}));var D=new z_({shape:y.getBoundingRect(),style:{fill:`transparent`}}),O=r.getModel(`tooltip`);return O.get(`show`)&&Ix({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),dy(y),y.__legendDataIndex=n,y},t.prototype.layoutInner=function(e,t,n,r,i,a){var o=this.getContentGroup(),s=this.getSelectorGroup();dw(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){dw(`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}(_P);function rX(e,t,n,r,i,a,o){function s(e,t){e.lineWidth===`auto`&&(e.lineWidth=t.lineWidth>0?2:0),eX(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:gI(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 iX(e){var t=e.icon||`roundRect`,n=TA(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 aX(e,t,n,r){sX(e,t,n,r),n.dispatchAction({type:`legendToggleSelect`,name:e??t}),oX(e,t,n,r)}function oX(e,t,n,r){n.usingTHL()||n.dispatchAction({type:`highlight`,seriesName:e,name:t,excludeSeriesId:r})}function sX(e,t,n,r){n.usingTHL()||n.dispatchAction({type:`downplay`,seriesName:e,name:t,excludeSeriesId:r})}function cX(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),lX(n,i),a.push(n.componentIndex)});var o={};return n.eachComponent(`legend`,function(e){W(i,function(t,n){e[t?`select`:`unSelect`](n)}),lX(e,o)}),r?{selected:o,legendIndex:a}:{name:t.name,selected:o}}function lX(e,t){var n=t||{};return W(e.getData(),function(t){var r=t.get(`name`);if(r!==` -`&&r!==``){var i=e.isSelected(r);n[r]=Z(n,r)?n[r]&&i:i}}),n}function uX(e){e.registerAction(`legendToggleSelect`,`legendselectchanged`,Al(cX,`toggleSelected`)),e.registerAction(`legendAllSelect`,`legendselectall`,Al(cX,`allSelect`)),e.registerAction(`legendInverseSelect`,`legendinverseselect`,Al(cX,`inverseSelect`)),e.registerAction(`legendSelect`,`legendselected`,Al(cX,`select`)),e.registerAction(`legendUnSelect`,`legendunselected`,Al(cX,`unSelect`))}var dX=$d(fX);function fX(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 z_({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&&Yb(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;W([`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`,J(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=_X[i],o=vX[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}(nX);function bX(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 xX(e){aR(pX),e.registerComponentModel(mX),e.registerComponentView(yX),bX(e)}function SX(e){aR(pX),aR(xX)}var CX=function(e){H(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type=t.type,n}return t.type=`dataZoom.inside`,t.defaultOption=AS(UK.defaultOption,{disabled:!1,zoomLock:!1,zoomOnMouseWheel:!0,moveOnMouseMove:!0,moveOnMouseWheel:!1,preventDefaultMouseMove:!0}),t}(UK),wX=Td();function TX(e,t,n){wX(e).coordSysRecordMap.each(function(e){var r=e.dataZoomInfoMap.get(t.uid);r&&(r.getRange=n)})}function EX(e,t){for(var n=wX(e).coordSysRecordMap,r=n.keys(),i=0;ia[i+r]&&(r=n),o&&=t.get(`preventDefaultMouseMove`,!0),s=Y(t.get(`cursorGrab`,!0),s),c=Y(t.get(`cursorGrabbing`,!0),c)}),{controlType:r,opt:{zoomOnMouseWheel:!0,moveOnMouseMove:!0,moveOnMouseWheel:!0,preventDefaultMouseMove:!!o,api:n,zInfo:{component:t.model},triggerInfo:{roamTrigger:null,isInSelf:t.containsPoint},cursorGrab:s,cursorGrabbing:c}}}function MX(e){e.registerUpdateLifecycle(`coordsys:aftercreate`,function(e,t){var n=wX(t),r=n.coordSysRecordMap||=X();r.each(function(e){e.dataZoomInfoMap=null}),e.eachComponent({mainType:`dataZoom`,subType:`inside`},function(e){W(LK(e).infoList,function(n){var i=n.model.uid,a=r.get(i)||r.set(i,OX(t,n.model));(a.dataZoomInfoMap||=X()).set(e.uid,{dzReferCoordSysInfo:n,model:e,getRange:null})})}),r.each(function(e){var n=e.controller,i,a=e.dataZoomInfoMap;if(a){var o=a.keys()[0];o!=null&&(i=a.get(o))}if(!i){DX(r,e);return}var s=jX(a,e,t);n.enable(s.controlType,s.opt),jP(e,`dispatchAction`,i.model.get(`throttle`,!0),`fixRate`)})})}var NX=function(e){H(t,e);function t(){var t=e!==null&&e.apply(this,arguments)||this;return t.type=`dataZoom.inside`,t}return t.prototype.render=function(t,n,r){if(e.prototype.render.apply(this,arguments),t.noTarget()){this._clear();return}this.range=t.getPercentRange(),TX(r,t,{pan:K(PX.pan,this),zoom:K(PX.zoom,this),scrollMove:K(PX.scrollMove,this)})},t.prototype.dispose=function(){this._clear(),e.prototype.dispose.apply(this,arguments)},t.prototype._clear=function(){EX(this.api,this.dataZoomModel),this.range=null},t.type=`dataZoom.inside`,t}(KK),PX={zoom:function(e,t,n,r){var i=this.range,a=i.slice(),o=e.axisModels[0];if(o){var s=IX[t](null,[r.originX,r.originY],o,n,e),c=(s.signal>0?s.pixelStart+s.pixelLength-s.pixel:s.pixel-s.pixelStart)/s.pixelLength*(a[1]-a[0])+a[0],l=Math.max(1/r.scale,0);a[0]=(a[0]-c)*l+c,a[1]=(a[1]-c)*l+c;var u=this.dataZoomModel.findRepresentativeAxisProxy().getMinMaxSpan();if(zH(0,a,[0,100],0,u.minSpan,u.maxSpan),this.range=a,i[0]!==a[0]||i[1]!==a[1])return a}},pan:FX(function(e,t,n,r,i,a){var o=IX[r]([a.oldX,a.oldY],[a.newX,a.newY],t,i,n);return o.signal*(e[1]-e[0])*o.pixel/o.pixelLength}),scrollMove:FX(function(e,t,n,r,i,a){return IX[r]([0,0],[a.scrollDelta,a.scrollDelta],t,i,n).signal*(e[1]-e[0])*a.scrollDelta})};function FX(e){return function(t,n,r,i){var a=this.range,o=a.slice(),s=t.axisModels[0];if(s&&(zH(e(o,s,t,n,r,i),o,[0,100],`all`),this.range=o,a[0]!==o[0]||a[1]!==o[1]))return o}}var IX={grid:function(e,t,n,r,i){var a=n.axis,o={},s=i.model.coordinateSystem.getRect();return e||=[0,0],a.dim===`x`?(o.pixel=t[0]-e[0],o.pixelLength=s.width,o.pixelStart=s.x,o.signal=a.inverse?1:-1):(o.pixel=t[1]-e[1],o.pixelLength=s.height,o.pixelStart=s.y,o.signal=a.inverse?-1:1),o},polar:function(e,t,n,r,i){var a=n.axis,o={},s=i.model.coordinateSystem,c=s.getRadiusAxis().getExtent(),l=s.getAngleAxis().getExtent();return e=e?s.pointToCoord(e):[0,0],t=s.pointToCoord(t),n.mainType===`radiusAxis`?(o.pixel=t[0]-e[0],o.pixelLength=c[1]-c[0],o.pixelStart=c[0],o.signal=a.inverse?1:-1):(o.pixel=t[1]-e[1],o.pixelLength=l[1]-l[0],o.pixelStart=l[0],o.signal=a.inverse?-1:1),o},singleAxis:function(e,t,n,r,i){var a=n.axis,o=i.model.coordinateSystem.getRect(),s={};return e||=[0,0],a.orient===`horizontal`?(s.pixel=t[0]-e[0],s.pixelLength=o.width,s.pixelStart=o.x,s.signal=a.inverse?1:-1):(s.pixel=t[1]-e[1],s.pixelLength=o.height,s.pixelStart=o.y,s.signal=a.inverse?-1:1),s}};function LX(e){QK(e),e.registerComponentModel(CX),e.registerComponentView(NX),MX(e)}var RX=function(e){H(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type=t.type,n}return t.type=`dataZoom.slider`,t.layoutMode=`box`,t.defaultOption=AS(UK.defaultOption,{show:!0,right:`ph`,top:`ph`,width:`ph`,height:`ph`,left:null,bottom:null,borderColor:Q.color.accent10,borderRadius:0,backgroundColor:Q.color.transparent,dataBackground:{lineStyle:{color:Q.color.accent30,width:.5},areaStyle:{color:Q.color.accent20,opacity:.2}},selectedDataBackground:{lineStyle:{color:Q.color.accent40,width:.5},areaStyle:{color:Q.color.accent20,opacity:.3}},fillerColor:`rgba(135,175,274,0.2)`,handleIcon:`path://M-9.35,34.56V42m0-40V9.5m-2,0h4a2,2,0,0,1,2,2v21a2,2,0,0,1-2,2h-4a2,2,0,0,1-2-2v-21A2,2,0,0,1-11.35,9.5Z`,handleSize:`100%`,handleStyle:{color:Q.color.neutral00,borderColor:Q.color.accent20},moveHandleSize:7,moveHandleIcon:`path://M-320.9-50L-320.9-50c18.1,0,27.1,9,27.1,27.1V85.7c0,18.1-9,27.1-27.1,27.1l0,0c-18.1,0-27.1-9-27.1-27.1V-22.9C-348-41-339-50-320.9-50z M-212.3-50L-212.3-50c18.1,0,27.1,9,27.1,27.1V85.7c0,18.1-9,27.1-27.1,27.1l0,0c-18.1,0-27.1-9-27.1-27.1V-22.9C-239.4-41-230.4-50-212.3-50z M-103.7-50L-103.7-50c18.1,0,27.1,9,27.1,27.1V85.7c0,18.1-9,27.1-27.1,27.1l0,0c-18.1,0-27.1-9-27.1-27.1V-22.9C-130.9-41-121.8-50-103.7-50z`,moveHandleStyle:{color:Q.color.accent40,opacity:.5},showDetail:!0,showDataShadow:`auto`,realtime:!0,zoomLock:!1,textStyle:{color:Q.color.tertiary},brushSelect:!0,brushStyle:{color:Q.color.accent30,opacity:.3},emphasis:{handleLabel:{show:!0},handleStyle:{borderColor:Q.color.accent40},moveHandleStyle:{opacity:.8}},defaultLocationEdgeGap:15}),t}(UK),zX=z_,BX=1,VX=30,HX=7,UX=`horizontal`,WX=`vertical`,GX=5,KX=[`line`,`bar`,`candlestick`,`scatter`],qX={easing:`cubicOut`,duration:100,delay:0},JX=function(e){H(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type=t.type,n._displayables={},n}return t.prototype.init=function(e,t){this.api=t,this._onBrush=K(this._onBrush,this),this._onBrushEnd=K(this._onBrushEnd,this)},t.prototype.render=function(t,n,r,i){if(e.prototype.render.apply(this,arguments),jP(this,`_dispatchZoomAction`,t.get(`throttle`),`fixRate`),this._orient=t.getOrient(),t.get(`show`)===!1){this.group.removeAll();return}if(t.noTarget()){this._clear(),this.group.removeAll();return}(!i||i.type!==`dataZoom`||i.from!==this.uid)&&this._buildView(),this._updateView()},t.prototype.dispose=function(){this._clear(),e.prototype.dispose.apply(this,arguments)},t.prototype._clear=function(){MP(this,`_dispatchZoomAction`);var e=this.api.getZr();e.off(`mousemove`,this._onBrush),e.off(`mouseup`,this._onBrushEnd)},t.prototype._buildView=function(){var e=this.group;e.removeAll(),this._brushing=!1,this._displayables.brushRect=null,this._resetLocation(),this._resetInterval();var t=this._displayables.sliderGroup=new Ky;this._renderBackground(),this._renderHandle(),this._renderDataShadow(),e.add(t),this._positionGroup()},t.prototype._resetLocation=function(){var e=this.dataZoomModel,t=this.api,n=e.get(`brushSelect`)?HX:0,r=hw(e,t).refContainer,i=this._findCoordRect(),a=e.get(`defaultLocationEdgeGap`,!0)||0,o=this._orient===UX?{right:r.width-i.x-i.width,top:r.height-VX-a-n,width:i.width,height:VX}:{right:a,top:i.y,width:VX,height:i.height},s=yw(e.option);W([`right`,`top`,`width`,`height`],function(e){s[e]===`ph`&&(s[e]=o[e])});var c=pw(s,r);this._location={x:c.x,y:c.y},this._size=[c.width,c.height],this._orient===WX&&this._size.reverse()},t.prototype._positionGroup=function(){var e=this.group,t=this._location,n=this._orient,r=this.dataZoomModel.getFirstTargetAxisModel(),i=r&&r.get(`inverse`),a=this._displayables.sliderGroup,o=(this._dataShadowInfo||{}).otherAxisInverse;a.attr(n===UX&&!i?{scaleY:o?1:-1,scaleX:1}:n===UX&&i?{scaleY:o?1:-1,scaleX:-1}:n===WX&&!i?{scaleY:o?-1:1,scaleX:1,rotation:Math.PI/2}:{scaleY:o?-1:1,scaleX:-1,rotation:Math.PI/2});var s=e.getBoundingRect([a]),c=isNaN(s.x)?0:s.x,l=isNaN(s.y)?0:s.y;e.x=t.x-c,e.y=t.y-l,e.markRedraw()},t.prototype._getViewExtent=function(){return[0,this._size[0]]},t.prototype._renderBackground=function(){var e=this.dataZoomModel,t=this._size,n=this._displayables.sliderGroup,r=e.get(`brushSelect`);n.add(new zX({silent:!0,shape:{x:0,y:0,width:t[0],height:t[1]},style:{fill:e.get(`backgroundColor`)},z2:-40}));var i=new zX({shape:{x:0,y:0,width:t[0],height:t[1]},style:{fill:`transparent`},z2:0,onclick:K(this._onClickPanel,this)}),a=this.api.getZr();r?(i.on(`mousedown`,this._onBrushStart,this),i.cursor=`crosshair`,a.on(`mousemove`,this._onBrush),a.on(`mouseup`,this._onBrushEnd)):(a.off(`mousemove`,this._onBrush),a.off(`mouseup`,this._onBrushEnd)),n.add(i)},t.prototype._renderDataShadow=function(){var e=this._dataShadowInfo=this._prepareDataShadowInfo();if(this._displayables.dataShadowSegs=[],!e)return;var t=this._size,n=this._shadowSize||[],r=e.series,i=r.getRawData(),a=r.getShadowDim&&r.getShadowDim(),o=a&&i.getDimensionInfo(a)?r.getShadowDim():e.otherDim;if(o==null)return;var s=this._shadowPolygonPts,c=this._shadowPolylinePts;if(i!==this._shadowData||o!==this._shadowDim||t[0]!==n[0]||t[1]!==n[1]){var l=i.getDataExtent(e.thisDim),u=i.getDataExtent(o),d=(u[1]-u[0])*.3;u=[u[0]-d,u[1]+d];var f=[0,t[1]],p=[0,t[0]],m=[[t[0],0],[0,0]],h=[],g=p[1]/Math.max(1,i.count()-1),_=t[0]/(l[1]-l[0]),v=e.thisAxis.type===`time`,y=-g,b=Math.round(i.count()/t[0]),x;i.each([e.thisDim,o],function(e,t,n){if(b>0&&n%b){v||(y+=g);return}y=v?(+e-l[0])*_:y+g;var r=t==null||isNaN(t)||t===``,i=r?0:Su(t,u,f,!0);r&&!x&&n?(m.push([m[m.length-1][0],0]),h.push([h[h.length-1][0],0])):!r&&x&&(m.push([y,0]),h.push([y,0])),r||(m.push([y,i]),h.push([y,i])),x=r}),s=this._shadowPolygonPts=m,c=this._shadowPolylinePts=h}this._shadowData=i,this._shadowDim=o,this._shadowSize=[t[0],t[1]];var S=this.dataZoomModel;function C(e){var t=S.getModel(e?`selectedDataBackground`:`dataBackground`),n=new Ky,r=new yb({shape:{points:s},segmentIgnoreThreshold:1,style:t.getModel(`areaStyle`).getAreaStyle(),silent:!0,z2:-20}),i=new xb({shape:{points:c},segmentIgnoreThreshold:1,style:t.getModel(`lineStyle`).getLineStyle(),silent:!0,z2:-19});return n.add(r),n.add(i),n}for(var w=0;w<3;w++){var T=C(w===1);this._displayables.sliderGroup.add(T),this._displayables.dataShadowSegs.push(T)}},t.prototype._prepareDataShadowInfo=function(){var e=this.dataZoomModel,t=e.get(`showDataShadow`);if(t!==!1){var n,r=this.ecModel;return e.eachTargetAxis(function(i,a){W(e.getAxisProxy(i,a).getTargetSeriesModels(),function(e){if(!n&&!(t!==!0&&xl(KX,e.get(`type`))<0)){var o=r.getComponent(FK(i),a).axis,s=XX(i),c,l=e.coordinateSystem;s!=null&&l.getOtherAxis&&(c=l.getOtherAxis(o).inverse),s=e.getData().mapDimension(s),n={thisAxis:o,series:e,thisDim:e.getData().mapDimension(i),otherDim:s,otherAxisInverse:c}}},this)},this),n}},t.prototype._renderHandle=function(){var e=this.group,t=this._displayables,n=t.handles=[null,null],r=t.handleLabels=[null,null],i=this._displayables.sliderGroup,a=this._size,o=this.dataZoomModel,s=this.api,c=o.get(`borderRadius`)||0,l=o.get(`brushSelect`),u=t.filler=new zX({silent:l,style:{fill:o.get(`fillerColor`)},textConfig:{position:`inside`}});i.add(u),i.add(new zX({silent:!0,subPixelOptimize:!0,shape:{x:0,y:0,width:a[0],height:a[1],r:c},style:{stroke:o.get(`dataBackgroundColor`)||o.get(`borderColor`),lineWidth:BX,fill:Q.color.transparent}})),W([0,1],function(t){var a=o.get(`handleIcon`);!SA[a]&&a.indexOf(`path://`)<0&&a.indexOf(`image://`)<0&&(a=`path://`+a);var s=TA(a,-1,0,2,2,null,!0);s.attr({cursor:ZX(this._orient),draggable:!0,drift:K(this._onDragMove,this,t),ondragend:K(this._onDragEnd,this),onmouseover:K(this._onOverDataInfoTriggerArea,this,!0),onmouseout:K(this._onOverDataInfoTriggerArea,this,!1),z2:5});var c=s.getBoundingRect(),l=o.get(`handleSize`);this._handleHeight=Cu(l,this._size[1]),this._handleWidth=c.width/c.height*this._handleHeight,s.setStyle(o.getModel(`handleStyle`).getItemStyle()),s.style.strokeNoScale=!0,s.rectHover=!0,s.ensureState(`emphasis`).style=o.getModel([`emphasis`,`handleStyle`]).getItemStyle(),dy(s);var u=o.get(`handleColor`);u!=null&&(s.style.fill=u),i.add(n[t]=s);var d=o.getModel(`textStyle`),f=(o.get(`handleLabel`)||{}).show||!1;e.add(r[t]=new W_({silent:!0,invisible:!f,style:nS(d,{x:0,y:0,text:``,verticalAlign:`middle`,align:`center`,fill:d.getTextColor(),font:d.getFont()}),z2:10}))},this);var d=u;if(l){var f=Cu(o.get(`moveHandleSize`),a[1]),p=t.moveHandle=new z_({style:o.getModel(`moveHandleStyle`).getItemStyle(),silent:!0,shape:{r:[0,0,2,2],y:a[1]-.5,height:f}}),m=f*.8,h=t.moveHandleIcon=TA(o.get(`moveHandleIcon`),-m/2,-m/2,m,m,Q.color.neutral00,!0);h.silent=!0,h.y=a[1]+f/2-.5,p.ensureState(`emphasis`).style=o.getModel([`emphasis`,`moveHandleStyle`]).getItemStyle();var g=Math.min(a[1]/2,Math.max(f,10));d=t.moveZone=new z_({invisible:!0,shape:{y:a[1]-g,height:f+g}}),d.on(`mouseover`,function(){s.enterEmphasis(p)}).on(`mouseout`,function(){s.leaveEmphasis(p)}),i.add(p),i.add(h),i.add(d)}d.attr({draggable:!0,cursor:`grab`,drift:K(this._onActualMoveZoneDrift,this),ondragstart:K(this._onActualMoveZoneDragStart,this),ondragend:K(this._onActualMoveZoneDragEnd,this),onmouseover:K(this._onOverDataInfoTriggerArea,this,!0),onmouseout:K(this._onOverDataInfoTriggerArea,this,!1)})},t.prototype._resetInterval=function(){var e=this._range=this.dataZoomModel.getPercentRange(),t=this._getViewExtent();this._handleEnds=[Su(e[0],[0,100],t,!0),Su(e[1],[0,100],t,!0)]},t.prototype._updateInterval=function(e,t){var n=this.dataZoomModel,r=this._handleEnds,i=this._getViewExtent(),a=n.findRepresentativeAxisProxy().getMinMaxSpan(),o=[0,100];zH(t,r,i,n.get(`zoomLock`)?`all`:e,a.minSpan==null?null:Su(a.minSpan,o,i,!0),a.maxSpan==null?null:Su(a.maxSpan,o,i,!0));var s=this._range,c=this._range=Ou([Su(r[0],i,o,!0),Su(r[1],i,o,!0)]);return!s||s[0]!==c[0]||s[1]!==c[1]},t.prototype._updateView=function(e){var t=this._displayables,n=this._handleEnds,r=Ou(n.slice()),i=this._size;W([0,1],function(e){var r=t.handles[e],a=this._handleHeight;r.attr({scaleX:a/2,scaleY:a/2,x:n[e]+(e?-1:1),y:i[1]/2-a/2})},this),t.filler.setShape({x:r[0],y:0,width:r[1]-r[0],height:i[1]});var a={x:r[0],width:r[1]-r[0]};t.moveHandle&&(t.moveHandle.setShape(a),t.moveZone.setShape(a),t.moveZone.getBoundingRect(),t.moveHandleIcon&&t.moveHandleIcon.attr(`x`,a.x+a.width/2));for(var o=t.dataShadowSegs,s=[0,r[0],r[1],i[0]],c=0;ct[0]||n[1]<0||n[1]>t[1])){var r=this._handleEnds,i=(r[0]+r[1])/2,a=this._updateInterval(`all`,n[0]-i);this._updateView(),a&&this._dispatchZoomAction(!1)}},t.prototype._onBrushStart=function(e){var t=e.offsetX,n=e.offsetY;this._brushStart=new Qf(t,n),this._brushing=!0,this._brushStartTime=+new Date},t.prototype._onBrushEnd=function(e){if(this._brushing){var t=this._displayables.brushRect;if(this._brushing=!1,t){t.attr(`ignore`,!0);var n=t.shape;if(!(+new Date-this._brushStartTime<200&&Math.abs(n.width)<5)){var r=this._getViewExtent(),i=[0,100],a=this._handleEnds=[n.x,n.x+n.width],o=this.dataZoomModel.findRepresentativeAxisProxy().getMinMaxSpan();zH(0,a,r,0,o.minSpan==null?null:Su(o.minSpan,i,r,!0),o.maxSpan==null?null:Su(o.maxSpan,i,r,!0)),this._range=Ou([Su(a[0],r,i,!0),Su(a[1],r,i,!0)]),this._updateView(),this._dispatchZoomAction(!1)}}}},t.prototype._onBrush=function(e){this._brushing&&(pM(e.event),this._updateBrushRect(e.offsetX,e.offsetY))},t.prototype._updateBrushRect=function(e,t){var n=this._displayables,r=this.dataZoomModel,i=n.brushRect;i||(i=n.brushRect=new zX({silent:!0,style:r.getModel(`brushStyle`).getItemStyle()}),n.sliderGroup.add(i)),i.attr(`ignore`,!1);var a=this._brushStart,o=this._displayables.sliderGroup,s=o.transformCoordToLocal(e,t),c=o.transformCoordToLocal(a.x,a.y),l=this._size;s[0]=Math.max(Math.min(l[0],s[0]),0),i.setShape({x:c[0],y:0,width:s[0]-c[0],height:l[1]})},t.prototype._dispatchZoomAction=function(e){var t=this._range;this.api.dispatchAction({type:`dataZoom`,from:this.uid,dataZoomId:this.dataZoomModel.id,animation:e?qX:null,start:t[0],end:t[1]})},t.prototype._findCoordRect=function(){var e,t=LK(this.dataZoomModel).infoList;if(!e&&t.length){var n=t[0].model.coordinateSystem;e=n.getRect&&n.getRect()}if(!e){var r=this.api.getWidth(),i=this.api.getHeight();e={x:r*.2,y:i*.2,width:r*.6,height:i*.6}}return e},t.type=`dataZoom.slider`,t}(KK);function YX(e,t,n,r){var i=e.get(`labelFormatter`),a=e.get(`labelPrecision`);(a==null||a===`auto`)&&(a=n.valuePrecision);var o=n.value[t],s=o==null||isNaN(o)?``:tO(r)||$D(r)?r.getLabel({value:Math.round(o)}):isFinite(a)?Du(o,a,!0):o+``;return jl(i)?i(o,s):J(i)?i.replace(`{value}`,s):s}function XX(e){return{x:`y`,y:`x`,radius:`angle`,angle:`radius`}[e]}function ZX(e){return e===`vertical`?`ns-resize`:`ew-resize`}function QX(e){e.registerComponentModel(RX),e.registerComponentView(JX),QK(e)}function $X(e){aR(LX),aR(QX)}var eZ={get:function(e,t,n){var r=gl((tZ[e]||{})[t]);return n&&q(r)?r[r.length-1]:r}},tZ={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]}},nZ=cH.mapVisual,rZ=cH.eachVisual,iZ=q,aZ=W,oZ=Ou,sZ=Su,cZ=function(e){H(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&&VJ(n,e,this.replacableOptionKeys),this.textStyleModel=this.getModel(`textStyle`),this.resetItemSize(),this.completeVisualOption()},t.prototype.resetVisual=function(e){var t=this.stateList;e=K(e,this),this.controllerVisuals=BJ(this.option.controller,t,e),this.targetVisuals=BJ(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 aZ(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=jd(this.ecModel,`series`,{index:i,id:r},{useDefault:!1,enableAll:!0,enableNone:!1}).models;return G(a,function(e){return e.componentIndex})},t.prototype.eachTargetSeries=function(e,t){W(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||=[`<`,`>`],q(e)&&(e=e.slice(),s=!0);var c=t?e:s?[l(e[0]),l(e[1])]:l(e);return J(o)?o.replace(`{value}`,s?c[0]:c).replace(`{value2}`,s?c[1]:c):jl(o)?s?o(e[0],e[1]):o(e):s?e[0]===a[0]?n[0]+` `+c[1]:e[1]===a[1]?n[1]+` `+c[0]:c[0]+` - `+c[1]: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=oZ([e.min,e.max]);this._dataExtent=t},t.prototype.getDimension=function(e){var t=this,n=this.option.seriesTargets;if(n){var r=Dl(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||={};_l(r,n),_l(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){iZ(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]={},aZ(r,function(e,t){if(cH.isValidType(t)){var n=eZ.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`;aZ(this.stateList,function(o){var s=this.itemSize,c=e[o];c||=e[o]={color:a?r:[r]},c.symbol??(c.symbol=t&&gl(t)||(a?i:[i])),c.symbolSize??(c.symbolSize=n&&gl(n)||(a?s[0]:[s[0],s[0]])),c.symbol=nZ(c.symbol,function(e){return e===`none`?i:e});var l=c.symbolSize;if(l!=null){var u=-1/0;rZ(l,function(e){e>u&&(u=e)}),c.symbolSize=nZ(l,function(e){return sZ(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}(Sw),lZ=[20,140],uZ=function(e){H(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]=lZ[0]),(t[1]==null||isNaN(t[1]))&&(t[1]=lZ[1])},t.prototype._resetRange=function(){var e=this.getExtent(),t=this.option.range;!t||t.auto?(e.auto=1,this.option.range=e):q(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),W(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=Ou((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=dZ(this,`outOfRange`,this.getExtent()),n=dZ(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 Ky(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);_Z([0,1],function(l){var u=i[l];u.setStyle(`fill`,t.handlesColor[l]),u.y=e[l];var d=gZ(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=bx(n.handleLabelPoints[l],yx(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=gZ(e,a,s,!0),p=o[0]-d/2,m={x:l.x,y:l.y};l.y=f,l.x=p;var h=bx(c.indicatorLabelPoint,yx(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||TZ(n))&&(d=this._hoverLinkDataIndices=n.findTargetDataIndices(l));var f=Cd(u,d);this._dispatchHighDown(`downplay`,hZ(f[0],n)),this._dispatchHighDown(`highlight`,hZ(f[1],n))}},t.prototype._hoverLinkFromSeriesMouseOver=function(e){var t;if(yF(e.target,function(e){var n=iv(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 AZ(e,t,n,r){for(var i=t.targetVisuals[r],a=cH.prepareVisualTypes(i),o={color:hF(e.getData(),`color`)},s=0,c=a.length;s0:e.splitNumber>0)||e.calculable)?`continuous`:`piecewise`}),e.registerAction(DZ,OZ),W(kZ,function(t){e.registerVisual(e.PRIORITY.VISUAL.COMPONENT,t)}),e.registerPreprocessor(MZ))}function IZ(e){e.registerComponentModel(uZ),e.registerComponentView(SZ),FZ(e)}var LZ=function(e){H(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=[],RZ[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=gl(i)):(e.dataExtent=this.getExtent(),e.mappingMethod=`piecewise`,e.pieceList=G(this._pieceList,function(e){return e=gl(e),t!==`inRange`&&(e.visual=null),e}))})},t.prototype.completeVisualOption=function(){var t=this.option,n={},r=cH.listVisualTypes(),i=this.isCategory();W(t.pieces,function(e){W(r,function(t){e.hasOwnProperty(t)&&(n[t]=1)})}),W(n,function(e,n){var r=!1;W(this.stateList,function(e){r=r||a(t,e,n)||a(t.target,e,n)},this),!r&&W(this.stateList,function(e){(t[e]||(t[e]={}))[n]=eZ.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,W(r,function(e,t){var n=this.getSelectedMapKey(e);i.hasOwnProperty(n)||(i[n]=!0)},this),n.selectedMode===`single`){var a=!1;W(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=gl(e)},t.prototype.getValueState=function(e){var t=cH.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){cH.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 W(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=AS(cZ.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}(cZ),RZ={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 zZ(e,t){var n=e.inverse;(e.orient===`vertical`?!n:n)&&t.reverse()}var BZ=function(e){H(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=Vl(t.get(`showLabel`,!0),!s),l=!t.get(`selectedMode`);s&&this._renderEndsText(e,s[0],a,c,i),W(o.viewPieceList,function(o){var s=o.piece,u=new Ky;u.onclick=K(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 W_({style:nS(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),dw(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:hZ(r.findTargetDataIndices(t),r)})}},t.prototype._getItemAlign=function(){var e=this.visualMapModel,t=e.option;if(t.orient===`vertical`)return mZ(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 Ky,o=this.visualMapModel.textStyleModel;a.add(new W_({style:nS(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=G(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=TA(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=gl(n.selected),a=t.getSelectedMapKey(e);r===`single`||r===!0?(i[a]=!0,W(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}(fZ);function VZ(e){e.registerComponentModel(LZ),e.registerComponentView(BZ),FZ(e)}function HZ(e){aR(IZ),aR(VZ)}var UZ={label:{enabled:!0},decal:{show:!1}},WZ=Td(),GZ=Td(),KZ=$d(qZ);function qZ(e,t){var n=e.getModel(`aria`);if(!n.get(`enabled`))return;var r=GZ(e).scope||(GZ(e).scope={}),i=gl(UZ);_l(i.label,e.getLocaleModel().get(`aria`),!1),_l(n.option,i,!1),a(),o();function a(){if(n.getModel(`decal`).get(`show`)){var t=X();e.eachSeries(function(e){e.isColorBySeries()||(WZ(e).scope=t.get(e.type)||t.set(e.type,{}))}),e.eachSeries(function(t){if(jl(t.enableAriaDecal)){t.enableAriaDecal();return}var n=t.getData();if(t.isColorBySeries()){var i=Dw(t.ecModel,t.name,r,e.getSeriesCount()),a=n.getVisual(`decal`);n.setVisual(`decal`,u(a,i))}else{var o=t.getRawData(),s={},c=WZ(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=Dw(t.ecModel,i,c,l),d=n.getItemVisual(r,`decal`);n.setItemVisual(r,`decal`,u(d,a))})}function u(e,t){var n=e?U(U({},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=bl(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;_=a}}}for(var l=QZ(this),u=l.startIdx;u=0)&&(a=!0)}),a||i.__dirty){var o=n._opts.useDirtyRect&&!ZZ(i)?i.createRepaintRects(e,t,n._width,n._height):null,s=n._i.layerStack[0],c=!0;if(i.__dirty){c=!1,i.__dirty=!1;var l=i.zlevel===s.zl&&i.zlevel2===s.zl2?n._backgroundColor:null;i.clear(!1,l,o)}dQ(i,function(t){var a=n._paintPerCursor(i,t,e,o,c);r&&=a})}},_Q),ou.wxa&&pQ(this._i,function(e){e&&e.ctx&&e.ctx.draw&&e.ctx.draw()}),r},e.prototype._paintPerCursor=function(e,t,n,r,i){var a=e.ctx;if(r){if(!r.length)t.drawIdx=t.endIdx;else for(var o=this.dpr,s=0;s=t.endIdx},e.prototype._paintPerCursorInRect=function(e,t,n,r,i){for(var a={inHover:!1,allClipped:!1,prevEl:null,viewWidth:this._width,viewHeight:this._height,beforeBrushParam:{contentRetained:i}},o=e.ctx,s=ZZ(e),c=s&&el.getTime(),l=t.drawIdx,u=t.notClearIdx,d=u>=0?Math.min(u,l):l;d15){d++;break}}}dI(o,a),t.drawIdx=Math.max(d,l)},e.prototype.getLayer=function(e,t){return this._ensureLayer(e,0,t)},e.prototype._ensureLayer=function(e,t,n){t||=0;var r=this._singleCanvas;r&&!this._needsManuallyCompositing&&(e=tQ,t=0);var i=fQ(this._i,e)[t];return i||(i=sQ(`zr_`+e+`.`+t,this,e,t),this._layerConfig[e]&&_l(i,this._layerConfig[e],!0),(n||r&&e!==tQ)&&(i.virtual=!0),this._insertLayer(i,e,t,!1),i.initContext()),i},e.prototype.insertLayer=function(e,t){this._insertLayer(t,e,0,!1)},e.prototype._insertLayer=function(e,t,n,r){var i=this._i,a=i.layers,o=i.layerStack,s=this._domRoot,c=null;if(!(a[t]&&a[t][n])&&aQ(e)){for(var l=o.length,u=0;u0&&(c=fQ(i,o[u-1].zl)[o[u-1].zl2]),o.splice(u,0,{zl:t,zl2:n}),fQ(i,t)[n]=e,!r&&!e.virtual){if(c){var d=c.dom;d.nextSibling?s.insertBefore(e.dom,d.nextSibling):s.appendChild(e.dom)}else s.firstChild?s.insertBefore(e.dom,s.firstChild):s.appendChild(e.dom)}e.painter||=this}},e.prototype.eachLayer=function(e,t){return pQ(this._i,function(n,r){e.call(t,n,r)})},e.prototype.eachBuiltinLayer=function(e,t){return pQ(this._i,function(n,r){e.call(t,n,r)},mQ)},e.prototype.eachOtherLayer=function(e,t){return pQ(this._i,function(n,r){e.call(t,n,r)},hQ)},e.prototype.getLayers=function(){var e={};return pQ(this._i,function(t,n,r){e[t.id]=t}),e},e.prototype._updateLayerStatus=function(e,t){var n=this;if(n._singleCanvas)for(var r=1;r=0;a--){var o=i.get(r[a]);if(!o.used)t.__dirty=!0,i.removeKey(r[a]),r.splice(a,1);else{var s=o.endIdxNew;(ZZ(t)?s=0;r--){var i=t[r];if(i.zl===e){var a=n[e][i.zl2];if(a.__builtin__)continue;if(t.splice(r,1),n[e][i.zl2]=void 0,!a.virtual){var o=a.dom.parentNode;o&&o.removeChild(a.dom)}}}},e.prototype.resize=function(e,t){if(this._domRoot.style){var n=this._domRoot;n.style.display=`none`;var r=this._opts,i=this.root;e!=null&&(r.width=e),t!=null&&(r.height=t),e=IF(i,0,r),t=IF(i,1,r),n.style.display=``,(this._width!==e||t!==this._height)&&(n.style.width=e+`px`,n.style.height=t+`px`,pQ(this._i,function(n){n.resize(e,t)}),this.refresh({paintAll:!0})),this._width=e,this._height=t}else{if(e==null||t==null)return;this._width=e,this._height=t,this._ensureLayer(tQ).resize(e,t)}return this},e.prototype.clearLayer=function(e){W(this._i.layers[e],function(e){e&&!e.__builtin__&&e.clear()})},e.prototype.dispose=function(){this.root.innerHTML=``,this.root=this.storage=this._domRoot=this._i=null},e.prototype.getRenderedCanvas=function(e){if(e||={},this._singleCanvas&&!this._compositeManually)return this._i.layers[tQ][0].dom;var t=new $Z(`image`,this,e.pixelRatio||this.dpr);t.initContext(),t.clear(!1,e.backgroundColor||this._backgroundColor);var n=t.ctx;if(e.pixelRatio<=this.dpr){this.refresh();var r=t.dom.width,i=t.dom.height;pQ(this._i,function(e){e.__builtin__?n.drawImage(e.dom,0,0,r,i):e.renderToCanvas&&(n.save(),e.renderToCanvas(n),n.restore())})}else{for(var a={inHover:!1,viewWidth:this._width,viewHeight:this._height,beforeBrushParam:{}},o=this.storage.getDisplayList(!0),s=0,c=o.length;s{e.data&&e.interactive!==!1&&e.data.forEach((r,i)=>{let a=typeof r==`object`&&r&&!Array.isArray(r)?r:void 0,o=a?.value??r;o!=null&&t.push({series_index:n,data_index:i,label:`${e.name??`Series`} · point ${i+1}`,event:{seriesName:e.name,name:a?.name,value:o,data:r,interactive:e.interactive}})})}),t}aR([MD,yQ,AB,jV,_G,qU,Hz,fK,AK,SX,FJ,XY,zY,HZ,YZ,dY,$X,rJ]);var xQ=new Map;function SQ({option:e,optionForSize:t,height:n,label:r,onClick:i,onZoom:a,group:o,keyboard:s}){let c=(0,B.useRef)(null),l=(0,B.useRef)(null),[u,d]=(0,B.useState)(e),[f,p]=(0,B.useState)(!1),m=(0,B.useRef)(!1),h=(0,B.useRef)(e),g=(0,B.useRef)(s);g.current=s;let _=(0,B.useRef)(void 0),v=(0,B.useCallback)(e=>{_.current&&l.current?.dispatchAction({type:`downplay`,seriesIndex:_.current.series_index,dataIndex:_.current.data_index}),l.current?.dispatchAction({type:`hideTip`}),_.current=e,e&&(l.current?.dispatchAction({type:`highlight`,seriesIndex:e.series_index,dataIndex:e.data_index}),l.current?.dispatchAction({type:`showTip`,seriesIndex:e.series_index,dataIndex:e.data_index}))},[]),y=Array.isArray(u.series)?u.series:u.series?[u.series]:[],b=Array.isArray(u.xAxis)?u.xAxis[0]:u.xAxis,x=Array.isArray(u.yAxis)?u.yAxis[0]:u.yAxis,S=(0,B.useMemo)(()=>{if(!s||!f)return[];let e=Array.isArray(u.series)?u.series:u.series?[u.series]:[],t=x?.type===`category`&&e[0]?.type!==`custom`?x:b?.type===`category`?b:void 0;return bQ(e.map(e=>({...e,interactive:void 0}))).map(n=>{let r=Array.isArray(n.event.value)?n.event.value:[];return{...n,event:{...n.event,interactive:e[n.series_index]?.interactive,name:n.event.name??(e[n.series_index]?.type===`custom`?x?.data?.[Number(r[1])]:t?.data?.[n.data_index])}}}).filter(e=>e.event.value!=null&&(!Array.isArray(e.event.value)||e.event.value.at(-1)!=null))},[u,f]),C=e=>{let t=e.event.data?.selection,n=Array.isArray(e.event.value)?e.event.value:[],r=t?.from?Date.parse(t.from):t?.time??(b?.type===`time`?Number(n[0]):NaN),i=/^(\d+)(ms|s|m|h|d)$/.exec(s?.interval??``),a=i?Number(i[1])*{ms:1,s:1e3,m:6e4,h:36e5,d:864e5}[i[2]]:void 0,o=y[e.series_index]?.data?.[e.data_index+1],c=Array.isArray(o)?o:o?.value,l=typeof c?.[0]==`number`&&c[0]>r?c[0]:void 0,u=a?r+a:l??s?.bounds?.to??r,d=t?.to?Date.parse(t.to):y[e.series_index]?.type===`custom`?Number(n[3]):Math.min(u,s?.bounds?.to??u);return Number.isFinite(r)&&Number.isFinite(d)?{from:r,to:d}:void 0},w=e=>{let t=y[e.series_index],n=Array.isArray(e.event.value)?e.event.value:[e.event.value],r=t?.type===`custom`,i=C(e),a=r?x?.data?.[Number(n[1])]:e.event.name,o=r?n[2]:n.at(-1),s=typeof o==`number`?t?.tooltip?.valueFormatter?.(o)??Zs(t?.keyboard_unit,o):String(o??`No value`),c=t?.type===`scatter`?`x: ${Zs(t.keyboard_x_unit,Number(n[0]))} · y: `:``;return[e.event.seriesName??`Series`,a,i?new Date(i.from).toISOString()+(i.to===i.from?``:` – ${new Date(i.to).toISOString()}`):void 0,c+s].filter(Boolean).join(` · `)},T=(0,B.useRef)({}),E=(0,B.useRef)(i);E.current=i;let D=(0,B.useRef)(a);D.current=a;let O=!!a,k=(0,B.useRef)(void 0),A=(0,B.useRef)(0),[j,M]=(0,B.useState)(0),N=(0,B.useCallback)(()=>{let e=k.current;l.current?.dispatchAction({type:`brush`,areas:e?[{brushType:`lineX`,xAxisIndex:0,coordRange:[e.from,e.to]}]:[]},{silent:!0})},[]),P=(0,B.useCallback)(e=>{(k.current?.from!==e?.from||k.current?.to!==e?.to)&&(k.current=e,N())},[N]),F=O?`${r} Brush across the chart to zoom to that range.`:r,I=(0,B.useRef)(()=>void 0),L=(0,B.useCallback)(e=>{e!==A.current&&(A.current=e,I.current())},[]);(0,B.useRef)(null);let ee=(0,B.useRef)(void 0),te=(0,B.useRef)(!1);te.current=!!t,I.current=()=>{ee.current===void 0&&(ee.current=document.createElement(`canvas`).getContext(`2d`));let n=ee.current,r={measureText:n?(e,t)=>(n.font=t,n.measureText(e).width):void 0,width:c.current?.clientWidth??0,height:c.current?.clientHeight??0},i=t&&r.width>0&&r.height>0?t(r):e;if(A.current&&i.grid&&!Array.isArray(i.grid)){let e=i.grid;i={...i,grid:{...e,bottom:(typeof e.bottom==`number`?e.bottom:8)+A.current}}}let a=i.series??[],o=new Set(a.map(e=>e.name)),s=Object.fromEntries(Object.entries(T.current).filter(([e])=>o.has(e)));T.current=s;let u=i.legend;l.current?.setOption({...i,...u?{legend:{...u,selected:{...u.selected,...s}}}:{},...D.current?{toolbox:{show:!1},brush:{xAxisIndex:0,brushMode:`single`,removeOnClick:!0}}:{},aria:{...i.aria,enabled:!0,description:F}},{notMerge:!0});let f=l.current?.getModel?.().getComponent(`grid`)?.coordinateSystem?.getRect(),p=f?.height;if(p&&i.yAxis){let e=Array.isArray(i.yAxis)?i.yAxis:[i.yAxis],t=e.map(e=>rc(e,p));t.some((t,n)=>t.splitNumber!==e[n].splitNumber||t.interval!==e[n].interval)&&(i={...i,yAxis:Array.isArray(i.yAxis)?t:t[0]},l.current?.setOption({yAxis:i.yAxis}))}f&&i.series?.some(e=>e.endLabel?.show)&&(i=Lc(i,f,(e,t)=>{let n=l.current?.convertToPixel({seriesIndex:e},t);return Array.isArray(n)?n[1]:NaN}),l.current?.setOption({series:i.series})),_.current&&v(_.current),D.current&&l.current?.dispatchAction({type:`takeGlobalCursor`,key:`brush`,brushOption:{brushType:`lineX`,brushMode:`single`}}),D.current&&k.current&&N(),h.current=i,g.current&&m.current&&d(i)},(0,B.useEffect)(()=>{if(!c.current)return;let e=LL(c.current,void 0,{renderer:`canvas`});l.current=e,e.on(`click`,e=>{let t=e,n=h.current.series??[],r=t.seriesIndex===void 0?t.interactive:t.componentType&&t.componentType!==`series`?!1:n[t.seriesIndex]?.interactive;E.current?.({...t,...r===void 0?{}:{interactive:r}})}),e.on(`brushEnd`,t=>{let n=t.areas?.[0]?.coordRange;n?.length===2&&Number.isFinite(n[0])&&Number.isFinite(n[1])&&n[0]e+1)),e.dispatchAction({type:`brush`,areas:[]},{silent:!0}),D.current&&e.dispatchAction({type:`takeGlobalCursor`,key:`brush`,brushOption:{brushType:`lineX`,brushMode:`single`}}))}),e.on(`legendselectchanged`,e=>{T.current={...e.selected}});let t=new ResizeObserver(()=>{e.resize(),te.current&&I.current()});return t.observe(c.current),()=>{t.disconnect(),_.current&&v(void 0),e.dispose(),l.current=null}},[]),(0,B.useEffect)(()=>{I.current()},[e,t,F,O]),(0,B.useEffect)(()=>{let e=l.current;if(e&&o)return e.group=o,xQ.set(o,(xQ.get(o)??0)+1),RL(o),()=>{e.group=``;let t=(xQ.get(o)??1)-1;if(t>0){xQ.set(o,t);return}xQ.delete(o),zL(o)}},[o]);let ne=(0,V.jsx)(`div`,{ref:c,role:`img`,"aria-label":F,"aria-hidden":s?!0:void 0,style:{height:s?`100%`:n,position:s?`absolute`:void 0,inset:s?0:void 0,zIndex:s?0:void 0,flex:`1 1 auto`,minHeight:0,width:`100%`,minWidth:0,cursor:i?`pointer`:void 0}}),re=Array.isArray(e.series)?e.series:e.series?[e.series]:[],ie=r+`: `+re.length+` series`+(s?.bounds?`; `+new Date(s.bounds.from).toISOString()+` – `+new Date(s.bounds.to).toISOString():``);return s?(0,V.jsx)(mc,{height:n,rangeReset:j,onRangeChange:P,onRangeBarHeight:L,points:S,label:ie,summary:w,onClick:i,canSelect:s.canSelect,onHighlight:v,onZoom:a,bounds:s.bounds,pointWindow:C,onRangePending:s.onRangePending,onActiveChange:e=>{m.current=e,p(e),e&&d(h.current)},children:ne}):ne}function CQ({panel:e,title:t=e.title,result:n,dark:r,height:i,onSelect:a,onPoint:o}){let s=(0,B.useMemo)(()=>t=>Wc(e,n.frame,Ic(r),t),[e,n.frame,r]),c=(0,B.useMemo)(()=>s({width:500,height:i}),[s,i]),l=(0,B.useCallback)(t=>!!Vs(e,n,t),[e,n]);return(0,V.jsx)(SQ,{keyboard:{canSelect:l},option:c,optionForSize:s,height:i,label:`${t}: bar chart`,onClick:o||a?t=>{let r=Vs(e,n,t);if(!r)return;o?.(r);let i=Object.values(r.dimensions)[0];i!==void 0&&a?.(i)}:void 0})}function wQ({panel:e,title:t=e.title,result:n,dark:r,height:i}){let a=Ec(e,n.frame),o=n.frame.columns.find(e=>e.role===`measure`)?.unit??e.unit,s=e.better??n.better,c=(0,B.useMemo)(()=>t=>Gc({...e,better:s},a,Ic(r),o,t),[e,s,a,r,o]),l=(0,B.useMemo)(()=>c({width:270,height:i}),[c,i]);return(0,V.jsx)(SQ,{option:l,optionForSize:c,height:i,label:`${t}: gauge`})}function TQ(e,t){return!t.previous||(e.reduce??`window`)===`window`&&!t.previous.totals?null:Ec(e,t.previous)}function EQ({panel:e,result:n,dark:r=!1,compare:i=!0,range:a}){let o=n.frame,s=Ec(e,o),c=o.columns.find(e=>e.role===`measure`)?.unit??e.unit,l=e.better??n.better??kc(e.thresholds),u=Ac(s,e.thresholds,l)??(o.health?.health===`healthy`?`ok`:o.health?.health===`degraded`?`warn`:o.health?.health===`unhealthy`?`bad`:null),d=TQ(e,n),f=Dc(o),p=e.thresholds?.find(e=>e.status===u&&s!==null&&(l===`higher`?s<=e.value:s>=e.value))?.label,h=Ic(r);return(0,V.jsxs)(t,{h:`100%`,style:{display:`flex`,flexDirection:`column`,justifyContent:`space-between`,gap:4},children:[(0,V.jsxs)(m,{justify:`space-between`,align:`flex-start`,wrap:`nowrap`,gap:`xs`,children:[(0,V.jsx)(C,{"data-stat-value":!0,fz:32,fw:700,lh:1.1,lts:`-0.02em`,ff:`var(--mantine-font-family-monospace)`,children:Zs(c,s)}),u&&(0,V.jsxs)(C,{"data-stat-status":!0,fz:12,fw:500,style:{borderRadius:999,padding:`1px 8px`,whiteSpace:`nowrap`,background:`${h.status[u]}22`,color:h.text},children:[(0,V.jsx)(`span`,{style:{color:h.status[u]},children:u===`bad`?`◆`:u===`warn`?`■`:`●`}),` `,p??(u===`bad`?`Unhealthy`:u===`warn`?`Degraded`:`Healthy`)]})]}),i&&d!==null&&s!==null&&(0,V.jsx)(DQ,{dark:r,value:s,previous:d,better:l,unit:c,period:OQ(a,n)}),(0,V.jsx)(kQ,{points:f,area:!0,dark:r,height:40})]})}function DQ({value:e,previous:t,better:n,unit:r,period:i,dark:a}){let o=r===`percent`,s=o?e-t:t===0?e===0?0:1/0:(e-t)/Math.abs(t)*100,c=s>=0,l=s===0||!n?null:c?n===`higher`:n===`lower`,u=Number.isFinite(s)?o?`${c?`+`:`−`}${Math.abs(s).toFixed(1)} pts`:`${c?`+`:`−`}${Math.abs(s).toFixed(0)}%`:`new`;return(0,V.jsxs)(m,{gap:6,children:[(0,V.jsxs)(C,{"data-stat-delta":!0,fz:12,fw:600,style:{color:l===null?`var(--mantine-color-dimmed)`:Fc(l?`ok`:`bad`,a)},children:[c?`▲`:`▼`,` `,u]}),(0,V.jsxs)(C,{fz:12,c:`dimmed`,children:[`vs previous `,i]})]})}function OQ(e,t){let n=t.from_ms!==void 0&&t.to_ms!==void 0?t.to_ms-t.from_ms:t.shift_ms,r=/^(\d+)(s|m|h|d|w)$/.exec(e??``),i=r?Number(r[1])*{s:1e3,m:6e4,h:36e5,d:864e5,w:6048e5}[r[2]]:n;if(!i)return`period`;let a=i>=6048e5?`week`:i>=864e5?`day`:i>=36e5?`hour`:i>=6e4?`minute`:`second`,o=i/{week:6048e5,day:864e5,hour:36e5,minute:6e4,second:1e3}[a];return o===1?a:`${Number(o.toFixed(2))} ${a}s`}function kQ({points:e,area:t=!1,dark:n=!1,height:r=32}){let i=e.filter(e=>e!==null&&Number.isFinite(e));if(i.length<2)return null;let a=Math.min(...i),o=Math.max(...i),s=r,c=t=>t/(e.length-1)*200,l=e=>s-2-(e-a)/(o-a||1)*(s-4),u=e.map((t,n)=>t===null||!Number.isFinite(t)?``:`${n===0||e[n-1]===null||!Number.isFinite(e[n-1])?`M`:`L`}${c(n).toFixed(1)},${l(t).toFixed(1)}`).join(``),d=[];return e.forEach((t,n)=>{if(t!==null&&Number.isFinite(t)){if(!n||e[n-1]===null||!Number.isFinite(e[n-1]))d.push({start:n,end:n,path:`M${c(n).toFixed(1)},${l(t).toFixed(1)}`});else{let e=d.at(-1);e.end=n,e.path+=`L${c(n).toFixed(1)},${l(t).toFixed(1)}`}}}),(0,V.jsxs)(`svg`,{viewBox:`0 0 200 ${s}`,preserveAspectRatio:`none`,width:`100%`,height:s,role:`img`,"aria-label":`Value over this panel's time range`,children:[t&&d.filter(e=>e.end>e.start).map(e=>(0,V.jsx)(`path`,{"data-sparkline-area":!0,d:`${e.path}L${c(e.end)},${s}L${c(e.start)},${s}Z`,fill:vc(0,n),opacity:.18},e.start)),(0,V.jsx)(`path`,{"data-sparkline-line":!0,d:u,fill:`none`,stroke:t?vc(0,n):`var(--mantine-primary-color-filled)`,strokeWidth:1.5,vectorEffect:`non-scaling-stroke`})]})}function AQ(e){return jQ(e)||typeof e==`function`||MQ(e)}function jQ(e){return typeof e==`function`&&(()=>{let t=Object.getPrototypeOf(e);return t.prototype&&t.prototype.isReactComponent})()}function MQ(e){return typeof e==`object`&&typeof e.$$typeof==`symbol`&&[`react.memo`,`react.forward_ref`].includes(e.$$typeof.description)}function NQ(e,t){return e==null?null:AQ(e)?B.createElement(e,t):e}function PQ(e){if(`cell`in e&&e.cell){let t=e.cell,n=t.column.columnDef,r=t,i=n;return r.getIsAggregated?.()?NQ(i.aggregatedCell??n.cell,t.getContext()):r.getIsPlaceholder?.()?null:NQ(n.cell,t.getContext())}return`header`in e&&e.header?NQ(e.header.column.columnDef.header,e.header.getContext()):`footer`in e&&e.footer?NQ(e.footer.column.columnDef.footer,e.footer.getContext()):null}function FQ(e){let t=fe(e.source,e.selector,{compare:Pt});return typeof e.children==`function`?e.children(t):e.children}function IQ(e){let t=e;return Object.defineProperty(e,"state",{get(){return e.get()}}),`set`in e&&(t.setState=e.set.bind(e)),t}function LQ(e){let{createAtom:t,batch:n}=e,r=t(0);return{createOptionsStore:!1,wrapExternalAtoms:!1,addSubscription:()=>{throw Error(`Feature not supported in current reactivity implementation`)},unmount:()=>{throw Error(`Feature not supported in current reactivity implementation`)},schedule:e.schedule??(e=>queueMicrotask(e)),batch:n,untrack:e=>e(),createReadonlyAtom:(e,n)=>{let i=n?.compare??Object.is,a=!1,o,s=()=>{let t=e();return(!a||!i(o,t))&&(o=t,a=!0),o},c=t(()=>(r.get(),s()),{compare:i});return{get:s,subscribe:c.subscribe.bind(c)}},createWritableAtom:(e,n)=>t(e,{compare:n?.compare}),commit:()=>{r.set(e=>e+1)}}}function RQ(e,t=Object.is){let n=!1,r;return{get:e.get,markCommitted:e=>{r=e,n=!0},subscribe:i=>e.subscribe(e=>{(!n||!t(r,e))&&i(e)})}}function zQ(){return LQ({createAtom:tt,batch:Xe})}function BQ(e,t){return typeof e==`function`?e(t):e}function VQ(e){if(Array.isArray(e))return e.map(VQ);if(e&&typeof e==`object`){let t=Object.getPrototypeOf(e);if(t!==Object.prototype&&t!==null)return e;let n=t===null?UQ():{},r=Object.keys(e);for(let t=0;t{(t.options.atoms?.[e]??t.baseAtoms[e]).set(e=>BQ(n,e))}}function KQ(e){if(typeof e!=`object`||!e)return!1;if(Array.isArray(e))return!0;let t=Object.getPrototypeOf(e);return t===Object.prototype||t===null}function qQ(e){return Reflect.ownKeys(e).filter(t=>Object.prototype.propertyIsEnumerable.call(e,t))}var JQ=3;function YQ(e,t){return XQ(e,t,JQ)}function XQ(e,t,n){if(Object.is(e,t))return!0;if(n<=0||!KQ(e)||!KQ(t)||(Array.isArray(e)||Array.isArray(t))&&(!Array.isArray(e)||!Array.isArray(t)||e.length!==t.length))return!1;let r=qQ(e),i=qQ(t);if(r.length!==i.length)return!1;let a=e,o=t;for(let e=0;e{let t=BQ(n,e);return r(e,t)?e:t})}function QQ(e){return e instanceof Function}function $Q(e,t){let n=[],r=e=>{e.forEach(e=>{n.push(e);let i=t(e);i.length&&r(i)})};return r(e),n}var e$=({fn:e,memoDeps:t,onAfterCompare:n,onAfterUpdate:r,onBeforeCompare:i,onBeforeUpdate:a})=>{let o=[],s;return c=>{i?.();let l=t?.(c),u=!l||l.length!==o?.length;if(!u&&l){for(let e=0;e{if(!t){t=!0;return}e()}}function n$({feature:e,fnName:t,objectId:n,onAfterUpdate:r,table:i,...a}){let o=()=>{if(!r)return;let{schedule:e,untrack:t}=i._reactivity;e(()=>t(()=>r()))},s={onAfterUpdate:()=>{o()}};return e$({...a,...s})}function r$(e,t=`_`){let[n,r]=e.split(t);return{fnKey:r,fnName:`${n}.${r}`,parentName:n}}function i$(e,t,n){for(let[r,{fn:i,memoDeps:a}]of Object.entries(n)){let{fnKey:n,fnName:o}=r$(r);t[n]=a?n$({memoDeps:a,fn:i,fnName:o,table:t,feature:e}):i}}function a$(e,t,n,r){for(let[i,{fn:a,memoDeps:o}]of Object.entries(r)){let{fnKey:r,fnName:s}=r$(i);if(o){let i=`_memo_${r}`;t[r]=function(...t){if(!this[i]){let t=this;this[i]=n$({memoDeps:e=>o(t,e),fn:(...e)=>a(t,...e),fnName:s,objectId:t.id,table:n,feature:e})}return this[i](...t)}}else t[r]=function(...e){return a(this,...e)}}}function o$(e,t,n,...r){return e[t]?.(...r)??n(e,...r)}function s$(e){return e.row.getValue(e.column.id)}function c$(e){return e.getValue()??e.table.options.renderFallbackValue}function l$(e){return{table:e.table,column:e.column,row:e.row,cell:e,getValue:()=>e.getValue(),renderValue:()=>e.renderValue()}}var u$={assignCellPrototype:(e,t)=>{a$(`coreCellsFeature`,e,t,{cell_getValue:{fn:e=>s$(e)},cell_renderValue:{fn:e=>c$(e)},cell_getContext:{fn:e=>l$(e),memoDeps:e=>[e]}})}};function d$(e){if(!e._headerPrototype){e._headerPrototype={table:e};let t=Object.values(e._features);for(let n=0;no$(e,`getIsVisible`,m$)):(WQ(t,e.id)?t[e.id]:void 0)??!0}function h$(e){return e.getAllLeafColumns().filter(e=>o$(e,`getIsVisible`,m$))}function g$(e,t=1){let n=t;for(let r=0;r0&&b$(s,t-1,n,r,i,a)}function x$(e){for(let t=0;t{let n=t;for(let t=0;te[i.accessorKey]}if(!s)throw Error();let l=C$(e),u=Object.create(l);u.accessorFn=c,u.columnDef=i,u.columns=[],u.depth=n,u.id=`${String(s)}`,u.parent=r;let d=e._columnInstanceInitFns;for(let e=0;e{let r=[];if(!t?.length)r=n;else{let e=new Map;for(let t=0;t!n.includes(e.id));if(r===`remove`)return i;let a=new Map;for(let e=0;ee.getFlatColumns())]}function O$(e){if(e.columns.length){let t=e.columns.flatMap(e=>e.getLeafColumns());return o$(e.table,`getOrderColumns`,T$)(t)}return[e]}function k$(e){return{header:e=>{let t=e.header.column.columnDef;return t.accessorKey?t.accessorKey:t.accessorFn?t.id:null},cell:e=>e.renderValue()?.toString?.()??null,...Object.values(e._features).reduce((e,t)=>Object.assign(e,t.getDefaultColumnDef?.()),{}),...e.options.defaultColumn}}function A$(e,t,n,r=0){let i=Array(t.length);for(let a=0;ae.getFlatColumns())}function N$(e){let t=UQ(),n=e.getAllFlatColumns();for(let e=0;ee.getLeafColumns());return o$(e,`getOrderColumns`,T$)(t)}function F$(e){let t=UQ(),n=e.getAllLeafColumns();for(let e=0;e{a$(`coreColumnsFeature`,e,t,{column_getFlatColumns:{fn:e=>D$(e),memoDeps:e=>[e.table.options.columns]},column_getLeafColumns:{fn:e=>O$(e),memoDeps:e=>[e.table.atoms.columnOrder?.get(),e.table.atoms.grouping?.get(),e.table.options.columns,e.table.options.groupedColumnMode]}})},constructTableAPIs:e=>{i$(`coreColumnsFeature`,e,{table_getDefaultColumnDef:{fn:()=>k$(e),memoDeps:()=>[e.options.defaultColumn]},table_getAllColumns:{fn:()=>j$(e),memoDeps:()=>[e.options.columns]},table_getAllFlatColumns:{fn:()=>M$(e),memoDeps:()=>[e.options.columns]},table_getAllFlatColumnsById:{fn:()=>N$(e),memoDeps:()=>[e.options.columns]},table_getAllLeafColumns:{fn:()=>P$(e),memoDeps:()=>[e.atoms.columnOrder?.get(),e.atoms.grouping?.get(),e.options.columns,e.options.groupedColumnMode]},table_getAllLeafColumnsById:{fn:()=>F$(e),memoDeps:()=>[e.getAllLeafColumns()]},table_getColumn:{fn:t=>I$(e,t)}})}};function R$(e,t){for(let n=0;n!t.includes(e.id)&&!n.includes(e.id));return S$(r,[...o,...c,...s],e)}function H$(e){return[...e.getHeaderGroups()].reverse()}function U$(e){let t=e.getHeaderGroups(),n=[];for(let e=0;e{a$(`coreHeadersFeature`,e,t,{header_getLeafHeaders:{fn:e=>z$(e),memoDeps:e=>[e.column.table.options.columns]},header_getContext:{fn:e=>B$(e),memoDeps:e=>[e.column.table.options.columns]}})},constructTableAPIs:e=>{i$(`coreHeadersFeature`,e,{table_getHeaderGroups:{fn:()=>V$(e),memoDeps:()=>[e.options.columns,e.atoms.columnOrder?.get(),e.atoms.grouping?.get(),e.atoms.columnPinning?.get(),e.atoms.columnVisibility?.get(),e.options.groupedColumnMode]},table_getFooterGroups:{fn:()=>H$(e),memoDeps:()=>[e.getHeaderGroups()]},table_getFlatHeaders:{fn:()=>U$(e),memoDeps:()=>[e.getHeaderGroups()]},table_getLeafHeaders:{fn:()=>W$(e),memoDeps:()=>[e.getHeaderGroups()]}})}};function K$(e){if(!e._rowPrototype){e._rowPrototype={table:e};let t=Object.values(e._features);for(let n=0;n{let s=K$(e),c=Object.create(s);c._displayIndexCache=-1,c._uniqueValuesCache=UQ(),c._valuesCache=UQ(),c.depth=i,c.id=t,c.index=r,c.original=n,c.parentId=o,c.subRows=a??[];let l=e._rowInstanceInitFns;for(let e=0;e{let i=e.getValue(r),a=n.getValue(r),o=t.resolveDataValue;return o&&(i=o(i),a=o(a)),t.sort(i,a,e,n,r)},e);return t}var X$=Y$({resolveDataValue:e=>e1(e).toLowerCase(),sort:(e,t)=>t1(e,t)});Y$({resolveDataValue:e=>e1(e),sort:(e,t)=>t1(e,t)}),Y$({resolveDataValue:e=>e1(e).toLowerCase(),sort:(e,t)=>Q$(e,t)}),Y$({resolveDataValue:e=>e1(e),sort:(e,t)=>Q$(e,t)}),Y$({resolveDataValue:e=>$$(e),sort:(e,t)=>e>t?1:eQ$(e,t)});function Q$(e,t){return e===t?0:e>t?1:-1}function $$(e){return e instanceof Date?e.getTime():e}function e1(e){return typeof e==`number`?isNaN(e)||e===1/0||e===-1/0?``:String(e):typeof e==`string`?e:``}function t1(e,t){let n=0,r=0,i=e.length,a=t.length;for(;n=48&&e<=57}function r1(e,t,n){let r=t+1;for(;ro)return 1;if(o>a)return-1}return o>s?1:s>o?-1:0}function a1(e,t,n,r,i,a){let o=t;for(;oi?1:i>t?-1:0}let u=parseInt(e.slice(t,n),10),d=parseInt(r.slice(i,a),10);return u>d?1:d>u?-1:0}function o1(e,t,n){let r=0;for(let i=t;il1(e))}function d1(e){e.atoms.expanded&&(e.options.autoResetAll??e.options.autoResetExpanded??!e.options.manualExpanding)&&e._reactivity.schedule(()=>f1(e))}function f1(e,t){let n=e.initialState.expanded;ZQ(e,`expanded`,t?UQ():n===!0||Object.assign(UQ(),VQ(n??{})))}var p1=0;function m1(e){if(e.options.autoResetAll??e.options.autoResetPageIndex??!e.options.manualPagination){if((e.atoms.pagination?.get()?.pageIndex??p1)===p1)return;_1(e,!0)}}function h1(e,t){ZQ(e,`pagination`,t)}function g1(e,t){h1(e,n=>{let r=BQ(t,n.pageIndex),i=e.options.pageCount===void 0||e.options.pageCount===-1?2**53-1:e.options.pageCount-1;return r=Math.max(0,Math.min(r,i)),{...n,pageIndex:r}})}function _1(e,t){g1(e,t?p1:e.initialState.pagination?.pageIndex??p1)}function v1(){return[]}function y1(e,t){ZQ(e,`sorting`,t)}function b1(e,t){y1(e,t?[]:VQ(e.initialState.sorting??[]))}function x1(e){e.atoms.sorting&&(e.options.autoResetAll??e.options.autoResetSorting??!1)&&b1(e)}function S1(e){let t=e.table._rowModelFns.sortFns,n=e.table.getFilteredRowModel().flatRows.slice(0,10),r,i=!1;for(let t=0;t1)){r=`alphanumeric`;break}}if(!r&&i&&(r=`text`),r){let e=t?.[r];if(e||r===`alphanumeric`&&(e=t?.text),e)return e}return Z$}function C1(e){let t=e.table.getFilteredRowModel().flatRows.slice(0,10);for(let n=0;n{let o=a.findIndex(t=>t.id===e.id),s=o===-1?void 0:a[o],c=[],l,u=i?t:r===`desc`,d=!!(a.length&&k1(e)&&n);return l=d?s?`toggle`:`add`:s?`toggle`:`replace`,l===`toggle`&&(i||r||(l=`remove`)),l===`add`?(c=[...a,{id:e.id,desc:u}],c.splice(0,c.length-(e.table.options.maxMultiSortColCount??2**53-1))):c=l===`toggle`?d?a.map(t=>t.id===e.id?{...t,desc:u}:t):[{id:e.id,desc:u}]:l===`remove`?d?a.filter(t=>t.id!==e.id):[]:[{id:e.id,desc:u}],c})}function E1(e){return e.columnDef.sortDescFirst??e.table.options.sortDescFirst??C1(e)===`desc`?`desc`:`asc`}function D1(e,t){let n=E1(e),r=A1(e);return r?r!==n&&(e.table.options.enableSortingRemoval??!0)&&(!t||(e.table.options.enableMultiRemove??!0))?!1:r===`desc`?`asc`:`desc`:n}function O1(e){return(e.columnDef.enableSorting??!0)&&(e.table.options.enableSorting??!0)&&!!e.accessorFn}function k1(e){return e.columnDef.enableMultiSort??e.table.options.enableMultiSort??!!e.accessorFn}function A1(e){let t=e.table.atoms.sorting?.get()?.find(t=>t.id===e.id);return t?t.desc?`desc`:`asc`:!1}function j1(e){return e.table.atoms.sorting?.get()?.findIndex(t=>t.id===e.id)??-1}function M1(e){y1(e.table,t=>t.length?t.filter(t=>t.id!==e.id):[])}function N1(e){let t=O1(e);return n=>{t&&T1(e,void 0,k1(e)?e.table.options.isMultiSortEvent?.(n):!1)}}function P1(){return e=>n$({feature:`coreRowModelsFeature`,table:e,fnName:`table.getCoreRowModel`,memoDeps:()=>[e.options.data],fn:()=>I1(e,e.options.data),onAfterUpdate:t$(()=>{d1(e),m1(e),x1(e),u1(e)})})}function F1(e,t,n,r=0,i){let a=[];for(let o=0;o{i$(`coreRowModelsFeature`,e,{table_getCoreRowModel:{fn:()=>L1(e)},table_getPreFilteredRowModel:{fn:()=>R1(e)},table_getFilteredRowModel:{fn:()=>z1(e)},table_getPreGroupedRowModel:{fn:()=>B1(e)},table_getGroupedRowModel:{fn:()=>V1(e)},table_getPreSortedRowModel:{fn:()=>H1(e)},table_getSortedRowModel:{fn:()=>U1(e)},table_getPreExpandedRowModel:{fn:()=>W1(e)},table_getExpandedRowModel:{fn:()=>G1(e)},table_getPrePaginatedRowModel:{fn:()=>K1(e)},table_getPaginatedRowModel:{fn:()=>q1(e)},table_getRowModel:{fn:()=>J1(e)}})}};function X1(e){if(!e._cellPrototype){e._cellPrototype={table:e};let t=Object.values(e._features);for(let n=0;n{t._displayIndexCache=e.length,e.push(t),t.subRows.length&&t.getIsExpanded?.()&&t.subRows.forEach(n)};return t.forEach(n),e}for(let e=0;ee.subRows)}function i0(e){let t=e.getCoreRowModel().flatRows,n=0;for(let e=0;e{a$(`coreRowsFeature`,e,t,{row_getDisplayIndex:{fn:e=>Q1(e)},row_getAllCellsByColumnId:{fn:e=>c0(e),memoDeps:e=>[e.getAllCells()]},row_getAllCells:{fn:e=>s0(e),memoDeps:e=>[e.table.getAllLeafColumns()]},row_getLeafRows:{fn:e=>r0(e),memoDeps:e=>[e.subRows]},row_getParentRow:{fn:e=>a0(e)},row_getParentRows:{fn:e=>o0(e)},row_getUniqueValues:{fn:(e,t)=>t0(e,t)},row_getValue:{fn:(e,t)=>e0(e,t)},row_renderValue:{fn:(e,t)=>n0(e,t)}})},constructTableAPIs:e=>{i$(`coreRowsFeature`,e,{table_getRowsInDisplayOrder:{fn:()=>$1(e),memoDeps:()=>[e.getPrePaginatedRowModel().rows,e.options.paginateExpandedRows,e.options.paginateExpandedRows===!1?e.atoms.expanded?.get():void 0]},table_getRowId:{fn:(t,n,r)=>l0(t,e,n,r)},table_getRow:{fn:(t,n)=>u0(e,t,n)},table_getMaxSubRowDepth:{fn:()=>i0(e),memoDeps:()=>[e.getCoreRowModel()]}})}};function f0(e,t,n=(e,t)=>e===t){let r=t===void 0?e.options.state:t;e._reactivity.batch(()=>{if(r)for(let t in r){let i=e.baseAtoms[t];if(!i)continue;let a=r[t],o=a===void 0?e.initialState[t]:a;n(e._reactivity.untrack(()=>i.get()),o)||i.set(()=>o)}})}function p0(e,t,n=(e,t)=>e===t){e._reactivity.batch(()=>{f0(e,t,n),e._reactivity.commit?.()})}function m0(e){let t=VQ(e.initialState);e._reactivity.batch(()=>{let n=Object.keys(t);for(let r=0;rr):e.options=r,n?.syncExternalState!==!1&&p0(e,r.state??null)}var _0={coreCellsFeature:u$,coreColumnsFeature:L$,coreHeadersFeature:G$,coreRowModelsFeature:Y1,coreRowsFeature:d0,coreTablesFeature:{constructTableAPIs:e=>{i$(`coreTablesFeature`,e,{table_reset:{fn:()=>m0(e)},table_setOptions:{fn:t=>g0(e,t)}})}}};function v0(e){return e}function y0(e,t={}){return Object.values(e).forEach(e=>{t=e.getInitialState?.(t)??t}),VQ(t)}function b0(e){let t=e.features.coreReactivityFeature,{aggregationFns:n,columnMeta:r,coreRowModel:i,expandedRowModel:a,facetedMinMaxValues:o,facetedRowModel:s,facetedUniqueValues:c,filterFns:l,filterMeta:u,filteredRowModel:d,groupedRowModel:f,paginatedRowModel:p,sortFns:m,sortedRowModel:h,tableMeta:g,..._}=e.features,v={_cellInstanceInitFns:[],_columnInstanceInitFns:[],_features:{..._0,..._},_headerGroupInstanceInitFns:[],_headerInstanceInitFns:[],_reactivity:t,_rowInstanceInitFns:[],_rowModelFns:{aggregationFns:n,filterFns:l,sortFns:m},_rowModels:{},atoms:{},baseAtoms:{}},y=Object.values(v._features),b={...y.reduce((e,t)=>Object.assign(e,t.getDefaultTableOptions?.(v)),{}),...e};if(t.wrapExternalAtoms&&b.atoms)for(let[e,n]of Object.entries(b.atoms)){let r=n,i=t.createWritableAtom(r.get(),{debugName:`externalAtom/${e}`});b.atoms[e]=i;let a=!1,o=r.subscribe(e=>{a||i.set(e)}),s=i.subscribe(e=>{a=!0,r.set(e),a=!1});t.addSubscription(o),t.addSubscription(s)}t.createOptionsStore?(v.optionsStore=t.createWritableAtom(b,{debugName:`table/optionsStore`}),Object.defineProperty(v,"options",{configurable:!0,enumerable:!0,get(){return v.optionsStore.get()},set(e){v.optionsStore.set(()=>e)}})):v.options=b,v.initialState=y0(v._features,v.options.initialState);let x=Object.keys(v.initialState);for(let e=0;e{let e=v.options,t=e.atoms?.[n],r=t?t.get():v.baseAtoms[n].get();if(t)return r;let i=e.state;if(i&&WQ(i,n)){let e=i[n];return e===void 0?v.initialState[n]:e}return r},{debugName:`table/atoms/${n}`})}f0(v),v.store=IQ(t.createReadonlyAtom(()=>{let e={};for(let t=0;te.shiftKey}},assignColumnPrototype(e,t){a$(`rowSortingFeature`,e,t,{column_getAutoSortFn:{fn:e=>S1(e)},column_getAutoSortDir:{fn:e=>C1(e)},column_getSortFn:{fn:e=>w1(e)},column_toggleSorting:{fn:(e,t,n)=>T1(e,t,n)},column_getFirstSortDir:{fn:e=>E1(e)},column_getNextSortingOrder:{fn:(e,t)=>D1(e,t)},column_getCanSort:{fn:e=>O1(e)},column_getCanMultiSort:{fn:e=>k1(e)},column_getIsSorted:{fn:e=>A1(e)},column_getSortIndex:{fn:e=>j1(e)},column_clearSorting:{fn:e=>M1(e)},column_getToggleSortingHandler:{fn:e=>N1(e)}})},constructTableAPIs(e){i$(`rowSortingFeature`,e,{table_setSorting:{fn:t=>y1(e,t)},table_resetSorting:{fn:t=>b1(e,t)}})}};function S0(){return e=>{let t=e;return n$({feature:`rowSortingFeature`,table:t,fnName:`table.getSortedRowModel`,memoDeps:()=>[t.atoms.sorting?.get(),t.getPreSortedRowModel()],fn:()=>C0(t),onAfterUpdate:t$(()=>m1(t))})}}function C0(e){let t=e.getPreSortedRowModel(),n=e.atoms.sorting?.get();if(!t.rows.length||!n?.length)return t;let r=[],i=n.filter(t=>{let n=e.getColumn(t.id);return n?O1(n):!1});if(!i.length)return t;let a=[];for(let t=0;t{for(let n=0;n{let t=e.slice();t.sort(o);let n=!1;for(let i=0;i`u`?B.useEffect:B.useLayoutEffect;function T0(e,t){let[{table:n,rootSource:r}]=(0,B.useState)(()=>{let t=b0({...e,features:{coreReactivityFeature:zQ(),...e.features}});return t.Subscribe=(e=>FQ({...e,source:e.source??t.store})),t.FlexRender=PQ,{table:t,rootSource:RQ(t.store,Pt)}}),i=n;g0(i,t=>({...t,...e}),{syncExternalState:!1});let a=i.options.state,o=r.get(),s=fe(r,t,{compare:Pt});return w0(()=>{r.markCommitted(o),p0(i,a??null,Pt)}),(0,B.useMemo)(()=>({...n,options:e,state:s}),[n,e,s])}function E0(e,t,n,r,i,a){e.format===`status`&&e.unit&&typeof t==`string`&&t.trim()!==``&&Number.isFinite(Number(t))&&(t=Number(t));let o=t===null?`—`:String(t),s={kind:e.format,text:o};if([`unit`,`bar`,`status`,`sparkline`].includes(e.format)&&(s.text=typeof t==`number`?Zs(e.unit,t):o),e.format===`bar`&&(s.fraction=typeof t==`number`&&n>0?Math.max(0,Math.min(1,t/n)):0),e.format===`status`&&typeof t==`number`&&(s.status=Ac(Number.isFinite(t)?t:null,r?.thresholds,r?.better??i)),e.format===`service_link`&&(s.variable=e.variable),e.format===`sparkline`&&a)return s.points=a.slice(0,240),s;if(e.format===`sparkline`)try{let e=JSON.parse(o);Array.isArray(e)?s.points=e.slice(0,240).map(e=>typeof e==`number`&&Number.isFinite(e)?e:null):s.unsupported=`Sparkline requires an array column`}catch{s.unsupported=`Sparkline requires an array column`}return s}function D0({text:e,template:t=!1,highlight:n=``}){let r=ht(`light`)===`dark`,i=et[r?5:7],a=[1,3,5].map(e=>parseInt(i.slice(e,e+2),16)).join(`, `),o=[];if(n){let t=e.toLowerCase(),r=n.toLowerCase();for(let e=t.indexOf(r);e!==-1;e=t.indexOf(r,e+r.length))o.push(e)}let s=(t,i)=>{let s=[],c=t;for(let l of o){let o=Math.max(t,l),u=Math.min(i,l+n.length);o>=u||(s.push(e.slice(c,o),(0,V.jsx)(`mark`,{"data-highlight-match":!0,style:{background:`rgba(${a}, ${r?.22:.3})`,color:`inherit`,borderRadius:3,padding:`0 2px`},children:e.slice(o,u)},o)),c=u)}return s.push(e.slice(c,i)),s},c=[],l=0;if(t)for(let t of e.matchAll(/<\*>||||