diff --git a/README.md b/README.md index f3d8d02..2376a27 100644 --- a/README.md +++ b/README.md @@ -1590,7 +1590,10 @@ it again. Enter still submits rather than inserting a newline. This is a text editor, with the catalogue-backed slash-command subset described below. Secret answers retain a single-line masked password field. -**Live slash commands (shared app-server):** type `/` in the ordinary composer +**Slash commands:** local `/usage`, `/copy`, `/theme`, `/exit`/`quit` and +`/statusline` work without a shared Codex daemon. Read-only browser full detail +offers these through **/ COMMANDS**. Live session-setting commands require the +shared app-server and writable browser control. Type `/` in the ordinary composer to see a vertical popup with supplied help. Typing `/mo` filters to matching commands; the popup shrinks as candidates drop out without moving the composer. Longer lists scroll within the available space (arrows or mouse wheel in the terminal). @@ -1599,10 +1602,19 @@ dismisses suggestions while retaining the draft and typing focus. Suggestions are fetched asynchronously and filtered locally. They also work in a selected wide terminal session row when space permits. Outside the full-detail composer, press `/` to open the full command browser. Use arrows and Enter to browse, **C** to confirm a -setting change, Left to go back and Escape to return to the session. Speed menus +setting change. **Back** (Left) returns to the previous visited command screen; +it appears only when there is a previous screen or a provisional review to undo. +Opening `/fast` directly starts at its options, so it has no Back action until +reviewing. **Cancel** (Escape) closes the entire menu and returns typing focus +to the composer with the slash-command draft intact. Back from a rename or +directory review restores the edited input. Speed menus keep all options visible: Up/Down highlights a choice, **Enter REVIEW** stages it, and **C CONFIRM** applies it. The separate **CURRENT** marker identifies the -existing speed. Model, reasoning and speed changes are provisional until C; +existing speed; the highlighted choice uses bright text without a reversed background. +The action line shows only the current next step, Enter Review or C Confirm, +without a second confirmation hint. Settings blocked during an active turn show +**WAITING FOR IDLE**, with **F REFRESH** to read their availability again; +**HELP** identifies genuine browse-only entries. Model, reasoning and speed changes are provisional until C; reviewing or changing the highlight sends no settings update. Buttons are clickable. Writable web mode exposes the same catalogue through **/ COMMANDS**, with the same composer suggestion shortcuts. @@ -1618,6 +1630,10 @@ are clickable. Writable web mode exposes the same catalogue through | `/permissions` | Named profiles allowed for the session's directory, with supplied descriptions. Review carefully: this changes future permission behaviour. | | `/skills`, `/apps`, `/mcp`, `/hooks`, `/experimental` | **Browse-only** live inventories and supplied help, including MCP tool descriptions. Invoke/configure these through Codex. | | `/help` | Available command families. Unsupported or empty catalogues are omitted. | +| `/usage` | **Local:** open Codexometer’s existing usage history. Quota/reset views retain their existing controls and confirmation. | +| `/copy` | **Local:** reuse the selected session’s Copy action, copying the full observed reply/activity text. Ineligible or missing text gives feedback. | +| `/theme` | **Local:** choose and save a Codexometer display theme; terminal picker or existing browser theme selector. | +| `/exit`, `/quit` | **Local:** quit the Codexometer terminal interface; in the browser, leave session detail for Sessions. Codex sessions and the browser server continue running. | | `/statusline` | **Local Codexometer multi-select:** choose and reorder detail-footer fields with a live preview. Works without the shared daemon. | The detail footer uses theme-highlighted text in the bottom border in terminal mode, and diff --git a/docs/slash-command-support.md b/docs/slash-command-support.md index f7f7b74..8b93fad 100644 --- a/docs/slash-command-support.md +++ b/docs/slash-command-support.md @@ -29,6 +29,8 @@ These are proposed priorities for Codexometer's session-monitoring/control role, Aliases on one row share the rating and implementation. Lifecycle commands share a thread-handoff foundation, so their costs should not be added as independent projects. P1 is a value/need ranking, not a claim that every P1 is a quick win. Work blocked on a foundation comes after that foundation even if it has the same priority. +Local Codexometer support below was updated on **2026-10-11**; the upstream registry snapshot remains 0.162.1. + ## Implemented and partial support | Command | Support | Priority | Complexity | Implementation and limits | @@ -44,10 +46,16 @@ Aliases on one row share the rating and implementation. Lifecycle commands share | `/mcp` | Browse only | P2 | High | `mcpServerStatus/list` and tool help. No `/mcp login`, resource browser or arbitrary tool invocation. Related APIs exist but need dedicated authentication/execution UI. Proposed next increment: server-specific login/status and verbose inspection. Arbitrary tool execution remains a separate reviewed workflow. | | `/hooks` | Browse only | P3 | High | `hooks/list`. No editor/review for lifecycle-hook configuration or its command execution scope. Proposed next increment: a scope-aware hook configuration editor with preview and reload handling. | | `/experimental` | Browse only | P3 | Medium | `experimentalFeature/list`. Enablement changes process/configuration scope, rather than a single session; no mutation UI. Proposed next increment: review an advertised enablement change with its process/configuration scope and refresh/restart effects made clear. | +| `/usage` | Local equivalent | Done | — | Opens the existing Codexometer usage-history view. Existing quota/reset views and their confirmation flows are retained. No account mutation is sent by the alias. | +| `/copy` | Local equivalent | Done | — | Reuses the selected session’s Copy action and complete observed reply/activity payload. Missing or ineligible text gives feedback. Historical-fragment selection remains outside this increment. | +| `/theme` | Local equivalent | Done | — | Terminal theme picker and browser’s existing theme selector; persists Codexometer display preferences. Native syntax-theme configuration is outside this scope. | +| `/exit`, `/quit` | Local equivalents | Done | — | Terminal aliases reuse local Quit. Browser aliases leave full session detail for Sessions; the web server and Codex sessions remain running. | | `/statusline` | Local equivalent | Done | — | Codexometer's own footer picker; also available in read-only web mode. Does not edit the native CLI's status line. | | `/help` | Local catalogue | Done | — | Codexometer catalogue entry; absent from the upstream registry. | | Advertised speed aliases, e.g. `/fast` | Session adapter | Done | — | Show all live model-advertised speeds plus the default in one picker; Up/Down selects, Enter Review stages the choice, and C Confirm commits a verified session override. Global defaults remain out of scope. | +The local `/usage`, `/copy`, `/theme`, `/exit`, `/quit` and `/statusline` entries are merged into the interface catalogue and do not become server RPCs. They work without a shared Codex daemon; browser full detail offers the local catalogue in read-only mode. Slash names are reserved against model-advertised speed aliases. + `/help` is Codexometer's catalogue entry, absent from this upstream registry. Speed aliases such as `/fast` appear only when the current model advertises that tier; IDs are not guessed. They change session overrides rather than native persistent defaults. ### Directory-change semantics @@ -77,7 +85,6 @@ These are adapter/workflow gaps. Where an API exists it is listed; this PR only | `/approve` | P1 | High | `thread/approveGuardianDeniedAction` exists; needs exact targeting of a recent automatic-review denial. Ordinary approval buttons are a different action. Proposed next increment: identify the exact retained denied action, review its original scope, confirm the retry and track the result. A generic approval shortcut is insufficient. | | `/ps` | P1 | Medium | `thread/backgroundTerminals/list` exists; no list/detail adapter. Telemetry process/session views do not reproduce it. Proposed next increment: a read-only, session-scoped terminal list with command/state detail and refresh; foundation for /stop. | | `/stop`, `/clean` | P1 | Medium | `thread/backgroundTerminals/clean` exists; no session-scoped stop-all review and verification. Turn interruption is a different action. Proposed next increment: confirm and verify stop-all for the selected session, using the /ps inventory and leaving other sessions alone. | -| `/usage` | P1 | Low | `account/usage/read`, rate-limit/reset-credit APIs exist. Usage/reset-token UI already exists; no slash alias opens it. Account reset credits are different from Sessions Zero. Proposed next increment: open the existing usage/reset views through a slash alias; reuse their current confirmation flow rather than adding new account mutations. | | `/status` | P1 | Medium | Settings/usage reads exist; detail/footer show related data, but no consolidated status slash view. Proposed next increment: a consolidated read-only view of running configuration, permission scope, directory and usage; live configuration adds work beyond a navigation alias. | | `/debug-config` | P2 | Medium | `config/read` with layers and `configRequirements/read` exist; no directory-aware configuration-source/requirements inspector. Proposed next increment: a read-only effective-layer/requirements inspector with bounded display and sensitive-value handling. | | `/daybreak` | P3 | Medium | `thread/metadata/update` can save Daybreak choice; no dedicated feature-aware toggle/state adapter. Do not invent an experimental flag ID. Proposed next increment: show availability/current choice and confirm the per-thread metadata update; it must not imply access is granted. | @@ -99,7 +106,6 @@ These require Codexometer UX, not forwarding the command name to a server. | --- | --- | --- | --- | | `/agents` | P2 | High | Native agent command center has no adapter; linked-session grouping is not a matching management center. Proposed next increment: a dedicated agent state/management view with capability-aware controls and exact child/root routing. | | `/subagents` | P1 | Medium | Linked agents are visible in grouping; no slash picker switches their native CLI views. Proposed next increment: a linked-agent picker with separate child detail and preserved root/draft state; native-client switching is not implied. | -| `/copy` | P1 | Low | Copy controls exist; no slash alias/picker for the last response or selected transcript parts. Proposed next increment: open the existing session-copy action from a slash alias; selection of arbitrary historical fragments can follow separately. | | `/export` | P2 | High | No Markdown export; needs complete paginated history plus a file/download destination. Proposed next increment: complete paginated transcript retrieval and Markdown export with bounded streaming/file/download handling; existing excerpts are insufficient. | | `/diff` | P2 | High | No repository diff browser with tracked/untracked handling and explicit repository context. Proposed next increment: a directory-aware tracked/untracked diff view with large/binary-file handling and no inferred repository scope. | | `/mention` | P2 | High | No structured file-mention picker or associated attachment/input metadata routing. Proposed next increment: file search/selection plus structured input metadata through review, send/steer and draft handling. | @@ -109,11 +115,9 @@ These require Codexometer UX, not forwarding the command name to a server. | `/raw` | P3 | High | Native raw-scrollback toggle cannot control Codexometer's separate rendering; no equivalent local switch. Proposed next increment: a Codexometer-owned scrollback/copy-friendly rendering mode that preserves live input and state; it is not a server toggle. | | `/tui` | P3 | Medium | Chooses native CLI mode for its next launch; no corresponding Codexometer launch-mode picker. Proposed next increment: local next-launch mode preferences with explicit precedence over flags and terminal capability checks. | | `/title` | P3 | Medium | No local title-field picker or native title configuration editor. Proposed next increment: a local title-field picker with persistence and safe terminal/browser title updates, reusing statusline field selection. | -| `/theme` | P2 | Low | Codexometer theme preferences exist; no slash entry reproduces the native syntax-highlighting picker. Proposed next increment: open Codexometer’s existing theme preferences; native syntax-theme parity is a separate, larger feature. | | `/pets`, `/pet` | Defer | High | Native terminal-pet picker has no counterpart here. Proposed scope if demanded: terminal/browser pet assets, animation/state and preference UI; cosmetic expansion outside core monitoring. | | `/keymap` | P3 | High | No shortcut-remapping editor; native keybindings belong to another interface. Proposed next increment: local remapping with composer/modal precedence, conflict checks and accurate help across all views. | | `/vim` | P3 | High | No Vim-mode composer. Proposed next increment: composer modes/editing with Unicode, paste, shortcuts, focus and review-modal interactions verified in both interfaces. | -| `/exit`, `/quit` | P2 | Low | Existing local Quit controls exit Codexometer, without slash aliases. Native CLI exit/server shutdown has different scope. Proposed next increment: aliases for local Codexometer exit/leave behavior, clearly labelled; never treat them as shared-daemon shutdown or native CLI exit. | ## Debug entries and older documented names @@ -128,12 +132,12 @@ These require Codexometer UX, not forwarding the command name to a server. ## Recommended delivery order -1. **Small P1 additions:** `/usage` and `/copy` aliases, then `/status`, `/warnings` and `/ps` read-only views. They build on existing controls and improve visibility before adding more mutations. +1. **P1 read-only additions:** `/ps`, `/status` and `/warnings` views. The Low-complexity `/usage` and `/copy` aliases are implemented. They build on existing controls and improve visibility before adding more mutations. 2. **P1 session controls:** `/compact`, the linked-agent `/subagents` picker, and reviewed `/stop`/`clean` built on `/ps`. Add `/approve` as its own High-complexity workflow with exact denied-action targeting. 3. **P1 lifecycle foundation:** `/new`, `/resume` and `/fork`, sharing subscription, selection, draft and history-handoff handling. Then pursue full `/cd` project-context parity; it depends on this foundation and remains Very high complexity. -4. **P2 extensions:** inexpensive local `/theme` and `/exit`/`quit` aliases; `/plan` inline prompts, `/goal`, `/archive`, `/debug-config`, daemon diagnostics and reviewed `/init`; then `/review`, `/export`, `/diff`, `/mention`, skill invocation and MCP login/inspection. Put `/clear` after `/new`, agent management after linked-agent navigation, and `/worktree` after lifecycle/project-context support. +4. **P2 extensions:** `/plan` inline prompts, `/goal`, `/archive`, `/debug-config`, daemon diagnostics and reviewed `/init`; then `/review`, `/export`, `/diff`, `/mention`, skill invocation and MCP login/inspection. Put `/clear` after `/new`, agent management after linked-agent navigation, and `/worktree` after lifecycle/project-context support. 5. **P3/Defer:** optional global/account, import, installation, sandbox, daemon lifecycle, keymap and composer-mode work require explicit scope and demand. Treat daemon diagnostics as the smaller first step to its P2 workflow. Voice, IDE integration and pets should not displace core monitoring/control work. Exclude internal debug and retired/unregistered names. -The next small PR should cover **`/usage`, `/copy`, `/status`, `/warnings` and `/ps`**. Subsequent PRs can add compaction and background-terminal stopping using those views. Full directory-context transitions need a separate design and PR covering project configuration/trust loading, conversation handoff and attached-client behavior. +The next PR should cover **`/ps`**, a Medium-complexity read-only background-terminal inventory. Add **`/status`** and **`/warnings`** as separate read-only increments. The four Low-complexity families (`/usage`, `/copy`, `/theme`, `/exit`/`quit`) are now implemented. Subsequent PRs can add compaction and background-terminal stopping using those views. Full directory-context transitions need a separate design and PR covering project configuration/trust loading, conversation handoff and attached-client behavior. For future updates, compare both the next installed version's registry and generated protocol. Omission from the published list is not evidence that a command is unsupported. diff --git a/internal/codex/session_commands.go b/internal/codex/session_commands.go index 2dd8bab..1856c3d 100644 --- a/internal/codex/session_commands.go +++ b/internal/codex/session_commands.go @@ -58,8 +58,10 @@ type SessionCommandChoice struct { Next string `json:"next,omitempty"` Action bool `json:"action,omitempty"` Selected bool `json:"selected,omitempty"` - method string - params map[string]any + // Unavailable explains a blocked action; an empty reason with no Action is genuine browse-only help. + Unavailable string `json:"unavailable,omitempty"` + method string + params map[string]any } type SessionCommandMenu struct { @@ -77,6 +79,28 @@ type SessionCommandMenu struct { Choices []SessionCommandChoice `json:"choices"` } +// LocalSessionCommands are owned by the interface and never become app-server RPCs. +func LocalSessionCommands() []SessionCommandChoice { + return []SessionCommandChoice{ + {ID: "local-statusline", Label: "/statusline", Help: "Choose fields for Codexometer’s detail footer. Saved display preferences only.", Next: "statusline"}, + {ID: "local-usage", Label: "/usage", Help: "Open Codexometer’s usage history. Existing quota and reset views remain available.", Next: "usage"}, + {ID: "local-copy", Label: "/copy", Help: "Copy the selected session’s observed reply or activity using Codexometer’s copy control.", Next: "copy"}, + {ID: "local-theme", Label: "/theme", Help: "Choose a Codexometer display theme. Saved local display preferences only.", Next: "theme"}, + {ID: "local-exit", Label: "/exit", Help: "Leave this Codexometer interface. Codex sessions continue running.", Next: "exit"}, + {ID: "local-quit", Label: "/quit", Help: "Alias for /exit. Codex sessions continue running.", Next: "quit"}, + } +} + +func IsLocalSessionCommand(path string) bool { + path = strings.TrimPrefix(strings.TrimSpace(path), "/") + for _, choice := range LocalSessionCommands() { + if choice.Next == path { + return true + } + } + return false +} + type SessionCommandsClient interface { SessionCommands(context.Context, string, string) (SessionCommandMenu, error) ExecuteSessionCommand(context.Context, string, string, string, string) error diff --git a/internal/codex/session_commands_unix.go b/internal/codex/session_commands_unix.go index 3653d89..775fe33 100644 --- a/internal/codex/session_commands_unix.go +++ b/internal/codex/session_commands_unix.go @@ -147,9 +147,11 @@ func normalizeCommandMenu(menu SessionCommandMenu) SessionCommandMenu { o.method = "" o.params = nil o.Help = "Complete safe help unavailable. Use Codex for this option." + o.Unavailable = o.Help } o.Label, o.Help = commandLabel(o.Label), commandText(o.Help) - o.ID = commandDigest([]any{o.Label, o.Help, o.Next, o.method, o.params}) + o.Unavailable = commandText(o.Unavailable) + o.ID = commandDigest([]any{o.Label, o.Help, o.Next, o.Unavailable, o.method, o.params}) o.Action = o.method != "" if !seen[o.ID] { unique = append(unique, *o) @@ -245,8 +247,7 @@ func (p *daemonStatusProvider) commandMenu(ctx context.Context, t commandThread, setting := func(label, help string, params map[string]any) { params["threadId"] = t.ID if t.Status.Type != "idle" { - help += " — available when the session is idle" - m.Choices = append(m.Choices, SessionCommandChoice{Label: label, Help: help}) + m.Choices = append(m.Choices, SessionCommandChoice{Label: label, Help: help, Unavailable: "Waiting for idle. Refresh options when this turn finishes."}) return } m.Choices = append(m.Choices, SessionCommandChoice{Label: label, Help: help, method: "thread/settings/update", params: params}) @@ -363,6 +364,9 @@ func (p *daemonStatusProvider) commandMenu(ctx context.Context, t commandThread, } func commandReserved(s string) bool { + if IsLocalSessionCommand(s) { + return true + } for _, name := range []string{"help", "rename", "cd", "cwd", "pwd", "model", "tier", "plan", "permissions", "skills", "apps", "mcp", "hooks", "experimental"} { if s == name { return true diff --git a/internal/codex/session_commands_unix_test.go b/internal/codex/session_commands_unix_test.go index 24c486d..30c8aff 100644 --- a/internal/codex/session_commands_unix_test.go +++ b/internal/codex/session_commands_unix_test.go @@ -282,3 +282,32 @@ func TestSessionSpeedPickerDoesNotTreatQueuedWriteAsApplied(t *testing.T) { t.Fatal("unconfirmed write was retried or changed running speed") } } + +func TestSessionCommandAvailabilityDistinguishesBlockedSettingsFromHelp(t *testing.T) { + p, f := newQuotaDaemon(t) + f.mu.Lock() + f.commandStatus = "active" + f.sessions["one"] = QuotaSession{ID: "one", Model: "small", Effort: "medium"} + f.mu.Unlock() + for _, path := range []string{"fast", "model/small"} { + menu, err := p.SessionCommands(context.Background(), "one", path) + if err != nil || len(menu.Choices) == 0 { + t.Fatal(menu, err) + } + for _, choice := range menu.Choices { + if choice.Action || !strings.HasPrefix(choice.Unavailable, "Waiting for idle.") { + t.Fatalf("blocked setting lacks reason: %+v", choice) + } + if err := p.ExecuteSessionCommand(context.Background(), "one", menu.Path, menu.Revision, choice.ID); err == nil { + t.Fatal("executed unavailable option") + } + } + } + f.mu.Lock() + f.commandStatus = "idle" + f.mu.Unlock() + menu, err := p.SessionCommands(context.Background(), "one", "fast") + if err != nil || !menu.Choices[0].Action || menu.Choices[0].Unavailable != "" { + t.Fatal("refreshed idle setting remains blocked", menu, err) + } +} diff --git a/internal/codex/session_directory_unix.go b/internal/codex/session_directory_unix.go index 813a665..977f902 100644 --- a/internal/codex/session_directory_unix.go +++ b/internal/codex/session_directory_unix.go @@ -105,7 +105,7 @@ func (p *daemonStatusProvider) commandDirectoryMenu(ctx context.Context, t comma if t.Status.Type == "idle" { choice.method, choice.params = "thread/settings/update", map[string]any{"threadId": t.ID, "cwd": target} } else { - choice.Help += "\nAvailable when this session is idle." + choice.Unavailable = "Waiting for idle. Refresh options when this turn finishes." } m.Choices = append(m.Choices, choice) return m, nil diff --git a/internal/i18n/locales/da.json b/internal/i18n/locales/da.json index ee37b84..954eb5b 100644 --- a/internal/i18n/locales/da.json +++ b/internal/i18n/locales/da.json @@ -515,5 +515,18 @@ "sending": "sender", "uncertain": "uklart", "sent": "sendt", - "Could not open web link.": "Kunne ikke åbne weblinket." + "Could not open web link.": "Kunne ikke åbne weblinket.", + "UNAVAILABLE": "UTILGÆNGELIG", + "WAITING FOR IDLE": "VENTER PÅ TOMGANG", + "Waiting for idle. Refresh options when this turn finishes.": "Venter på tomgang. Opdater valgmulighederne, når denne tur er færdig.", + "Refresh when this turn finishes.": "Opdater, når denne tur er færdig.", + "[ ENTER REVIEW ]": "[ ENTER GENNEMGÅ ]", + "[ C APPLY ]": "[ C ANVEND ]", + "[ C CONFIRM ]": "[ C BEKRÆFT ]", + "[ ENTER OPEN ]": "[ ENTER ÅBN ]", + "[ ENTER APPLY ]": "[ ENTER ANVEND ]", + "[ ENTER HELP ]": "[ ENTER HJÆLP ]", + "[ ← BACK ]": "[ ← TILBAGE ]", + "[ F REFRESH ]": "[ F OPDATER ]", + "[ ESC CANCEL ]": "[ ESC ANNULLER ]" } diff --git a/internal/i18n/locales/de.json b/internal/i18n/locales/de.json index 559500f..56ad2c6 100644 --- a/internal/i18n/locales/de.json +++ b/internal/i18n/locales/de.json @@ -515,5 +515,18 @@ "sending": "wird gesendet", "uncertain": "unklar", "sent": "gesendet", - "Could not open web link.": "Weblink konnte nicht geöffnet werden." + "Could not open web link.": "Weblink konnte nicht geöffnet werden.", + "UNAVAILABLE": "NICHT VERFÜGBAR", + "WAITING FOR IDLE": "WARTE AUF LEERLAUF", + "Waiting for idle. Refresh options when this turn finishes.": "Warte auf Leerlauf. Aktualisiere die Optionen, wenn dieser Durchgang beendet ist.", + "Refresh when this turn finishes.": "Aktualisiere nach Ende dieses Durchgangs.", + "[ ENTER REVIEW ]": "[ ENTER PRÜFEN ]", + "[ C APPLY ]": "[ C ANWENDEN ]", + "[ C CONFIRM ]": "[ C BESTÄTIGEN ]", + "[ ENTER OPEN ]": "[ ENTER ÖFFNEN ]", + "[ ENTER APPLY ]": "[ ENTER ANWENDEN ]", + "[ ENTER HELP ]": "[ ENTER HILFE ]", + "[ ← BACK ]": "[ ← ZURÜCK ]", + "[ F REFRESH ]": "[ F AKTUALISIEREN ]", + "[ ESC CANCEL ]": "[ ESC ABBRECHEN ]" } diff --git a/internal/i18n/locales/en-GB.json b/internal/i18n/locales/en-GB.json index e695afd..dfadddc 100644 --- a/internal/i18n/locales/en-GB.json +++ b/internal/i18n/locales/en-GB.json @@ -515,5 +515,18 @@ "sending": "sending", "uncertain": "uncertain", "sent": "sent", - "Could not open web link.": "Could not open web link." + "Could not open web link.": "Could not open web link.", + "UNAVAILABLE": "UNAVAILABLE", + "WAITING FOR IDLE": "WAITING FOR IDLE", + "Waiting for idle. Refresh options when this turn finishes.": "Waiting for idle. Refresh options when this turn finishes.", + "Refresh when this turn finishes.": "Refresh when this turn finishes.", + "[ ENTER REVIEW ]": "[ ENTER REVIEW ]", + "[ C APPLY ]": "[ C APPLY ]", + "[ C CONFIRM ]": "[ C CONFIRM ]", + "[ ENTER OPEN ]": "[ ENTER OPEN ]", + "[ ENTER APPLY ]": "[ ENTER APPLY ]", + "[ ENTER HELP ]": "[ ENTER HELP ]", + "[ ← BACK ]": "[ ← BACK ]", + "[ F REFRESH ]": "[ F REFRESH ]", + "[ ESC CANCEL ]": "[ ESC CANCEL ]" } diff --git a/internal/i18n/locales/es.json b/internal/i18n/locales/es.json index 085a0b9..79207e1 100644 --- a/internal/i18n/locales/es.json +++ b/internal/i18n/locales/es.json @@ -515,5 +515,18 @@ "sending": "enviando", "uncertain": "incierto", "sent": "enviado", - "Could not open web link.": "No se pudo abrir el enlace web." + "Could not open web link.": "No se pudo abrir el enlace web.", + "UNAVAILABLE": "NO DISPONIBLE", + "WAITING FOR IDLE": "ESPERANDO INACTIVIDAD", + "Waiting for idle. Refresh options when this turn finishes.": "Esperando inactividad. Actualiza las opciones cuando termine este turno.", + "Refresh when this turn finishes.": "Actualiza cuando termine este turno.", + "[ ENTER REVIEW ]": "[ ENTER REVISAR ]", + "[ C APPLY ]": "[ C APLICAR ]", + "[ C CONFIRM ]": "[ C CONFIRMAR ]", + "[ ENTER OPEN ]": "[ ENTER ABRIR ]", + "[ ENTER APPLY ]": "[ ENTER APLICAR ]", + "[ ENTER HELP ]": "[ ENTER AYUDA ]", + "[ ← BACK ]": "[ ← ATRÁS ]", + "[ F REFRESH ]": "[ F ACTUALIZAR ]", + "[ ESC CANCEL ]": "[ ESC CANCELAR ]" } diff --git a/internal/i18n/locales/et.json b/internal/i18n/locales/et.json index e592991..2389719 100644 --- a/internal/i18n/locales/et.json +++ b/internal/i18n/locales/et.json @@ -515,5 +515,18 @@ "sending": "saatmisel", "uncertain": "ebakindel", "sent": "saadetud", - "Could not open web link.": "Veebilinki ei saanud avada." + "Could not open web link.": "Veebilinki ei saanud avada.", + "UNAVAILABLE": "POLE SAADAVAL", + "WAITING FOR IDLE": "OOTAB JÕUDEOLEKUT", + "Waiting for idle. Refresh options when this turn finishes.": "Ootab jõudeolekut. Värskenda valikuid pärast selle vooru lõppu.", + "Refresh when this turn finishes.": "Värskenda pärast selle vooru lõppu.", + "[ ENTER REVIEW ]": "[ ENTER VAATA ÜLE ]", + "[ C APPLY ]": "[ C RAKENDA ]", + "[ C CONFIRM ]": "[ C KINNITA ]", + "[ ENTER OPEN ]": "[ ENTER AVA ]", + "[ ENTER APPLY ]": "[ ENTER RAKENDA ]", + "[ ENTER HELP ]": "[ ENTER ABI ]", + "[ ← BACK ]": "[ ← TAGASI ]", + "[ F REFRESH ]": "[ F VÄRSKENDA ]", + "[ ESC CANCEL ]": "[ ESC TÜHISTA ]" } diff --git a/internal/i18n/locales/fi.json b/internal/i18n/locales/fi.json index de2d8c8..3d708e3 100644 --- a/internal/i18n/locales/fi.json +++ b/internal/i18n/locales/fi.json @@ -515,5 +515,18 @@ "sending": "lähetetään", "uncertain": "epäselvä", "sent": "lähetetty", - "Could not open web link.": "Verkkolinkkiä ei voitu avata." + "Could not open web link.": "Verkkolinkkiä ei voitu avata.", + "UNAVAILABLE": "EI SAATAVILLA", + "WAITING FOR IDLE": "ODOTTAA JOUTOTILAA", + "Waiting for idle. Refresh options when this turn finishes.": "Odottaa joutotilaa. Päivitä vaihtoehdot tämän vuoron päätyttyä.", + "Refresh when this turn finishes.": "Päivitä tämän vuoron päätyttyä.", + "[ ENTER REVIEW ]": "[ ENTER TARKISTA ]", + "[ C APPLY ]": "[ C KÄYTÄ ]", + "[ C CONFIRM ]": "[ C VAHVISTA ]", + "[ ENTER OPEN ]": "[ ENTER AVAA ]", + "[ ENTER APPLY ]": "[ ENTER KÄYTÄ ]", + "[ ENTER HELP ]": "[ ENTER OHJE ]", + "[ ← BACK ]": "[ ← TAKAISIN ]", + "[ F REFRESH ]": "[ F PÄIVITÄ ]", + "[ ESC CANCEL ]": "[ ESC PERUUTA ]" } diff --git a/internal/i18n/locales/fr.json b/internal/i18n/locales/fr.json index 5919b19..e07b9db 100644 --- a/internal/i18n/locales/fr.json +++ b/internal/i18n/locales/fr.json @@ -515,5 +515,18 @@ "sending": "envoi", "uncertain": "incertain", "sent": "envoyé", - "Could not open web link.": "Impossible d’ouvrir le lien web." + "Could not open web link.": "Impossible d’ouvrir le lien web.", + "UNAVAILABLE": "INDISPONIBLE", + "WAITING FOR IDLE": "EN ATTENTE DE REPOS", + "Waiting for idle. Refresh options when this turn finishes.": "En attente de repos. Actualisez les options à la fin de ce tour.", + "Refresh when this turn finishes.": "Actualisez à la fin de ce tour.", + "[ ENTER REVIEW ]": "[ ENTER VÉRIFIER ]", + "[ C APPLY ]": "[ C APPLIQUER ]", + "[ C CONFIRM ]": "[ C CONFIRMER ]", + "[ ENTER OPEN ]": "[ ENTER OUVRIR ]", + "[ ENTER APPLY ]": "[ ENTER APPLIQUER ]", + "[ ENTER HELP ]": "[ ENTER AIDE ]", + "[ ← BACK ]": "[ ← RETOUR ]", + "[ F REFRESH ]": "[ F ACTUALISER ]", + "[ ESC CANCEL ]": "[ ESC ANNULER ]" } diff --git a/internal/i18n/locales/it.json b/internal/i18n/locales/it.json index e056ff8..9947c53 100644 --- a/internal/i18n/locales/it.json +++ b/internal/i18n/locales/it.json @@ -515,5 +515,18 @@ "sending": "invio", "uncertain": "incerto", "sent": "inviato", - "Could not open web link.": "Impossibile aprire il collegamento web." + "Could not open web link.": "Impossibile aprire il collegamento web.", + "UNAVAILABLE": "NON DISPONIBILE", + "WAITING FOR IDLE": "ATTESA DI INATTIVITÀ", + "Waiting for idle. Refresh options when this turn finishes.": "In attesa di inattività. Aggiorna le opzioni al termine di questo turno.", + "Refresh when this turn finishes.": "Aggiorna al termine di questo turno.", + "[ ENTER REVIEW ]": "[ ENTER VERIFICA ]", + "[ C APPLY ]": "[ C APPLICA ]", + "[ C CONFIRM ]": "[ C CONFERMA ]", + "[ ENTER OPEN ]": "[ ENTER APRI ]", + "[ ENTER APPLY ]": "[ ENTER APPLICA ]", + "[ ENTER HELP ]": "[ ENTER AIUTO ]", + "[ ← BACK ]": "[ ← INDIETRO ]", + "[ F REFRESH ]": "[ F AGGIORNA ]", + "[ ESC CANCEL ]": "[ ESC ANNULLA ]" } diff --git a/internal/i18n/locales/ja.json b/internal/i18n/locales/ja.json index ff79ff5..b4bc022 100644 --- a/internal/i18n/locales/ja.json +++ b/internal/i18n/locales/ja.json @@ -515,5 +515,18 @@ "sending": "送信中", "uncertain": "不明", "sent": "送信済み", - "Could not open web link.": "ウェブリンクを開けませんでした。" + "Could not open web link.": "ウェブリンクを開けませんでした。", + "UNAVAILABLE": "利用不可", + "WAITING FOR IDLE": "待機状態を待っています", + "Waiting for idle. Refresh options when this turn finishes.": "待機状態を待っています。このターンが終了したら選択肢を更新してください。", + "Refresh when this turn finishes.": "このターンが終了したら更新してください。", + "[ ENTER REVIEW ]": "[ ENTER 確認 ]", + "[ C APPLY ]": "[ C 適用 ]", + "[ C CONFIRM ]": "[ C 確定 ]", + "[ ENTER OPEN ]": "[ ENTER 開く ]", + "[ ENTER APPLY ]": "[ ENTER 適用 ]", + "[ ENTER HELP ]": "[ ENTER ヘルプ ]", + "[ ← BACK ]": "[ ← 戻る ]", + "[ F REFRESH ]": "[ F 更新 ]", + "[ ESC CANCEL ]": "[ ESC キャンセル ]" } diff --git a/internal/i18n/locales/nb.json b/internal/i18n/locales/nb.json index 5343630..707b97d 100644 --- a/internal/i18n/locales/nb.json +++ b/internal/i18n/locales/nb.json @@ -515,5 +515,18 @@ "sending": "sender", "uncertain": "uklart", "sent": "sendt", - "Could not open web link.": "Kunne ikke åpne nettlenken." + "Could not open web link.": "Kunne ikke åpne nettlenken.", + "UNAVAILABLE": "UTILGJENGELIG", + "WAITING FOR IDLE": "VENTER PÅ HVILEMODUS", + "Waiting for idle. Refresh options when this turn finishes.": "Venter på hvilemodus. Oppdater alternativene når denne turen er ferdig.", + "Refresh when this turn finishes.": "Oppdater når denne turen er ferdig.", + "[ ENTER REVIEW ]": "[ ENTER GJENNOMGÅ ]", + "[ C APPLY ]": "[ C BRUK ]", + "[ C CONFIRM ]": "[ C BEKREFT ]", + "[ ENTER OPEN ]": "[ ENTER ÅPNE ]", + "[ ENTER APPLY ]": "[ ENTER BRUK ]", + "[ ENTER HELP ]": "[ ENTER HJELP ]", + "[ ← BACK ]": "[ ← TILBAKE ]", + "[ F REFRESH ]": "[ F OPPDATER ]", + "[ ESC CANCEL ]": "[ ESC AVBRYT ]" } diff --git a/internal/i18n/locales/nl.json b/internal/i18n/locales/nl.json index c58dc83..2abdc2b 100644 --- a/internal/i18n/locales/nl.json +++ b/internal/i18n/locales/nl.json @@ -515,5 +515,18 @@ "sending": "verzenden", "uncertain": "onzeker", "sent": "verzonden", - "Could not open web link.": "Kan de weblink niet openen." + "Could not open web link.": "Kan de weblink niet openen.", + "UNAVAILABLE": "NIET BESCHIKBAAR", + "WAITING FOR IDLE": "WACHT OP INACTIVITEIT", + "Waiting for idle. Refresh options when this turn finishes.": "Wacht tot de sessie inactief is. Vernieuw de opties wanneer deze beurt klaar is.", + "Refresh when this turn finishes.": "Vernieuw wanneer deze beurt klaar is.", + "[ ENTER REVIEW ]": "[ ENTER BEOORDELEN ]", + "[ C APPLY ]": "[ C TOEPASSEN ]", + "[ C CONFIRM ]": "[ C BEVESTIGEN ]", + "[ ENTER OPEN ]": "[ ENTER OPENEN ]", + "[ ENTER APPLY ]": "[ ENTER TOEPASSEN ]", + "[ ENTER HELP ]": "[ ENTER HELP ]", + "[ ← BACK ]": "[ ← TERUG ]", + "[ F REFRESH ]": "[ F VERNIEUWEN ]", + "[ ESC CANCEL ]": "[ ESC ANNULEREN ]" } diff --git a/internal/i18n/locales/pt-BR.json b/internal/i18n/locales/pt-BR.json index f904a26..406c2e9 100644 --- a/internal/i18n/locales/pt-BR.json +++ b/internal/i18n/locales/pt-BR.json @@ -515,5 +515,18 @@ "sending": "enviando", "uncertain": "incerto", "sent": "enviado", - "Could not open web link.": "Não foi possível abrir o link da web." + "Could not open web link.": "Não foi possível abrir o link da web.", + "UNAVAILABLE": "INDISPONÍVEL", + "WAITING FOR IDLE": "AGUARDANDO INATIVIDADE", + "Waiting for idle. Refresh options when this turn finishes.": "Aguardando inatividade. Atualize as opções quando este turno terminar.", + "Refresh when this turn finishes.": "Atualize quando este turno terminar.", + "[ ENTER REVIEW ]": "[ ENTER REVISAR ]", + "[ C APPLY ]": "[ C APLICAR ]", + "[ C CONFIRM ]": "[ C CONFIRMAR ]", + "[ ENTER OPEN ]": "[ ENTER ABRIR ]", + "[ ENTER APPLY ]": "[ ENTER APLICAR ]", + "[ ENTER HELP ]": "[ ENTER AJUDA ]", + "[ ← BACK ]": "[ ← VOLTAR ]", + "[ F REFRESH ]": "[ F ATUALIZAR ]", + "[ ESC CANCEL ]": "[ ESC CANCELAR ]" } diff --git a/internal/i18n/locales/pt-PT.json b/internal/i18n/locales/pt-PT.json index 4f9439b..cec3fda 100644 --- a/internal/i18n/locales/pt-PT.json +++ b/internal/i18n/locales/pt-PT.json @@ -515,5 +515,18 @@ "sending": "a enviar", "uncertain": "incerto", "sent": "enviado", - "Could not open web link.": "Não foi possível abrir a ligação Web." + "Could not open web link.": "Não foi possível abrir a ligação Web.", + "UNAVAILABLE": "INDISPONÍVEL", + "WAITING FOR IDLE": "A AGUARDAR INATIVIDADE", + "Waiting for idle. Refresh options when this turn finishes.": "A aguardar inatividade. Atualize as opções quando este turno terminar.", + "Refresh when this turn finishes.": "Atualize quando este turno terminar.", + "[ ENTER REVIEW ]": "[ ENTER REVER ]", + "[ C APPLY ]": "[ C APLICAR ]", + "[ C CONFIRM ]": "[ C CONFIRMAR ]", + "[ ENTER OPEN ]": "[ ENTER ABRIR ]", + "[ ENTER APPLY ]": "[ ENTER APLICAR ]", + "[ ENTER HELP ]": "[ ENTER AJUDA ]", + "[ ← BACK ]": "[ ← VOLTAR ]", + "[ F REFRESH ]": "[ F ATUALIZAR ]", + "[ ESC CANCEL ]": "[ ESC CANCELAR ]" } diff --git a/internal/i18n/locales/ru.json b/internal/i18n/locales/ru.json index a765c7b..a6b5049 100644 --- a/internal/i18n/locales/ru.json +++ b/internal/i18n/locales/ru.json @@ -515,5 +515,18 @@ "sending": "отправка", "uncertain": "неизвестно", "sent": "отправлено", - "Could not open web link.": "Не удалось открыть веб-ссылку." + "Could not open web link.": "Не удалось открыть веб-ссылку.", + "UNAVAILABLE": "НЕДОСТУПНО", + "WAITING FOR IDLE": "ОЖИДАНИЕ ПРОСТОЯ", + "Waiting for idle. Refresh options when this turn finishes.": "Ожидание простоя. Обновите варианты после завершения этого хода.", + "Refresh when this turn finishes.": "Обновите после завершения этого хода.", + "[ ENTER REVIEW ]": "[ ENTER ПРОВЕРИТЬ ]", + "[ C APPLY ]": "[ C ПРИМЕНИТЬ ]", + "[ C CONFIRM ]": "[ C ПОДТВЕРДИТЬ ]", + "[ ENTER OPEN ]": "[ ENTER ОТКРЫТЬ ]", + "[ ENTER APPLY ]": "[ ENTER ПРИМЕНИТЬ ]", + "[ ENTER HELP ]": "[ ENTER СПРАВКА ]", + "[ ← BACK ]": "[ ← НАЗАД ]", + "[ F REFRESH ]": "[ F ОБНОВИТЬ ]", + "[ ESC CANCEL ]": "[ ESC ОТМЕНА ]" } diff --git a/internal/i18n/locales/sv.json b/internal/i18n/locales/sv.json index 2356d17..842c672 100644 --- a/internal/i18n/locales/sv.json +++ b/internal/i18n/locales/sv.json @@ -515,5 +515,18 @@ "sending": "skickar", "uncertain": "oklart", "sent": "skickat", - "Could not open web link.": "Kunde inte öppna webblänken." + "Could not open web link.": "Kunde inte öppna webblänken.", + "UNAVAILABLE": "INTE TILLGÄNGLIG", + "WAITING FOR IDLE": "VÄNTAR PÅ VILOLÄGE", + "Waiting for idle. Refresh options when this turn finishes.": "Väntar på viloläge. Uppdatera alternativen när denna tur är klar.", + "Refresh when this turn finishes.": "Uppdatera när denna tur är klar.", + "[ ENTER REVIEW ]": "[ ENTER GRANSKA ]", + "[ C APPLY ]": "[ C TILLÄMPA ]", + "[ C CONFIRM ]": "[ C BEKRÄFTA ]", + "[ ENTER OPEN ]": "[ ENTER ÖPPNA ]", + "[ ENTER APPLY ]": "[ ENTER TILLÄMPA ]", + "[ ENTER HELP ]": "[ ENTER HJÄLP ]", + "[ ← BACK ]": "[ ← TILLBAKA ]", + "[ F REFRESH ]": "[ F UPPDATERA ]", + "[ ESC CANCEL ]": "[ ESC AVBRYT ]" } diff --git a/internal/i18n/locales/tr.json b/internal/i18n/locales/tr.json index a6a3698..650b532 100644 --- a/internal/i18n/locales/tr.json +++ b/internal/i18n/locales/tr.json @@ -515,5 +515,18 @@ "sending": "gönderiliyor", "uncertain": "belirsiz", "sent": "gönderildi", - "Could not open web link.": "Web bağlantısı açılamadı." + "Could not open web link.": "Web bağlantısı açılamadı.", + "UNAVAILABLE": "KULLANILAMIYOR", + "WAITING FOR IDLE": "BOŞTA KALMASI BEKLENİYOR", + "Waiting for idle. Refresh options when this turn finishes.": "Boşta kalması bekleniyor. Bu tur bittiğinde seçenekleri yenileyin.", + "Refresh when this turn finishes.": "Bu tur bittiğinde yenileyin.", + "[ ENTER REVIEW ]": "[ ENTER İNCELE ]", + "[ C APPLY ]": "[ C UYGULA ]", + "[ C CONFIRM ]": "[ C ONAYLA ]", + "[ ENTER OPEN ]": "[ ENTER AÇ ]", + "[ ENTER APPLY ]": "[ ENTER UYGULA ]", + "[ ENTER HELP ]": "[ ENTER YARDIM ]", + "[ ← BACK ]": "[ ← GERİ ]", + "[ F REFRESH ]": "[ F YENİLE ]", + "[ ESC CANCEL ]": "[ ESC İPTAL ]" } diff --git a/internal/i18n/locales/zh-Hans.json b/internal/i18n/locales/zh-Hans.json index ad97d37..5bb5e94 100644 --- a/internal/i18n/locales/zh-Hans.json +++ b/internal/i18n/locales/zh-Hans.json @@ -515,5 +515,18 @@ "sending": "发送中", "uncertain": "不确定", "sent": "已发送", - "Could not open web link.": "无法打开网页链接。" + "Could not open web link.": "无法打开网页链接。", + "UNAVAILABLE": "不可用", + "WAITING FOR IDLE": "等待空闲", + "Waiting for idle. Refresh options when this turn finishes.": "等待空闲。此轮结束后请刷新选项。", + "Refresh when this turn finishes.": "此轮结束后请刷新。", + "[ ENTER REVIEW ]": "[ ENTER 检查 ]", + "[ C APPLY ]": "[ C 应用 ]", + "[ C CONFIRM ]": "[ C 确认 ]", + "[ ENTER OPEN ]": "[ ENTER 打开 ]", + "[ ENTER APPLY ]": "[ ENTER 应用 ]", + "[ ENTER HELP ]": "[ ENTER 帮助 ]", + "[ ← BACK ]": "[ ← 返回 ]", + "[ F REFRESH ]": "[ F 刷新 ]", + "[ ESC CANCEL ]": "[ ESC 取消 ]" } diff --git a/internal/ui/monitor_commands.go b/internal/ui/monitor_commands.go index 29b782e..555f080 100644 --- a/internal/ui/monitor_commands.go +++ b/internal/ui/monitor_commands.go @@ -11,9 +11,16 @@ import ( tea "charm.land/bubbletea/v2" "github.com/charmbracelet/x/ansi" "github.com/merefield/codexometer/internal/codex" + "github.com/merefield/codexometer/internal/i18n" "github.com/merefield/codexometer/internal/statusline" ) +type monitorCommandLevel struct { + path string + selected int + input string +} + type monitorCommandsState struct { open, busy, detail bool session string @@ -25,6 +32,8 @@ type monitorCommandsState struct { until time.Time footerHover string input textinput.Model + history []monitorCommandLevel + restore *monitorCommandLevel } type monitorCommandsResult struct { session string @@ -40,20 +49,35 @@ func (m *Model) loadMonitorCommands(path string) tea.Cmd { p.reviewedChoice = "" p.until = time.Time{} path = strings.TrimPrefix(strings.TrimSpace(path), "/") - if strings.TrimPrefix(strings.TrimSpace(path), "/") == "statusline" { + p.menu.Path = path + if menu, local := m.localMonitorMenu(path); local { + p.input.Blur() p.busy = false p.detail = false p.notice = "" p.selected = 0 p.scroll = 0 p.request++ - p.menu = m.statusLineMenu() + p.menu = menu + if path == "theme" { + p.selected = int(m.theme) + } + if p.restore != nil { + p.selected = min(p.restore.selected, max(len(menu.Choices)-1, 0)) + p.restore = nil + } return nil } c, ok := m.fetcher.(codex.SessionCommandsClient) if !ok { if path == "" || path == "help" { - p.menu = localCommandsMenu() + p.menu = m.localCommandsMenu() + p.detail = false + p.scroll = 0 + if p.restore != nil { + p.selected = min(p.restore.selected, len(p.menu.Choices)-1) + p.restore = nil + } p.busy = false p.notice = "" return nil @@ -78,9 +102,62 @@ func (m *Model) loadMonitorCommands(path string) tea.Cmd { } } +// History records visited screens, not RPC path segments (tier/flex is one screen). +func (m *Model) navigateMonitorCommands(path string) tea.Cmd { + p := &m.monitorCommands + p.history = append(append([]monitorCommandLevel(nil), p.history...), monitorCommandLevel{path: p.menu.Path, selected: p.selected, input: p.input.Value()}) + return m.loadMonitorCommands(path) +} + +func (m Model) monitorCommandsCanBack() bool { + p := m.monitorCommands + inputReview := strings.HasPrefix(p.menu.Path, "rename/") || strings.HasPrefix(p.menu.Path, "cd/") + return (p.detail && !inputReview) || p.reviewedChoice != "" || len(p.history) > 0 +} + +func (m *Model) backMonitorCommands() tea.Cmd { + p := &m.monitorCommands + if p.reviewedChoice != "" { + p.reviewedChoice = "" + p.until = time.Time{} + p.notice = "" + return nil + } + inputReview := strings.HasPrefix(p.menu.Path, "rename/") || strings.HasPrefix(p.menu.Path, "cd/") + if p.detail && !inputReview { + p.detail = false + p.scroll = 0 + p.notice = "" + p.until = time.Time{} + p.request++ + p.busy = false + return nil + } + if len(p.history) == 0 { + return nil + } + level := p.history[len(p.history)-1] + p.history = append([]monitorCommandLevel(nil), p.history[:len(p.history)-1]...) + p.restore = &level + return m.loadMonitorCommands(level.path) +} + +func (m *Model) cancelMonitorCommands() tea.Cmd { + m.closeMonitorCommands() + // Preserve the composer verbatim and suppress re-opening its slash suggestions. + m.monitorSuggestions = monitorSuggestionState{request: m.monitorSuggestions.request + 1, dismissed: m.monitorPrompt.input.Value()} + if !m.monitorPrompt.input.ready || m.monitorPrompt.session != m.monitorCommands.session { + return nil // Completed sessions can have display settings but no composer. + } + return m.monitorPrompt.input.Focus() +} + func (m Model) openMonitorCommands(path string) (Model, tea.Cmd, bool) { path = strings.TrimPrefix(strings.TrimSpace(path), "/") - if _, ok := m.fetcher.(codex.SessionCommandsClient); !ok && path != "statusline" && path != "" && path != "help" { + if updated, cmd, local := m.runLocalMonitorCommand(path); local { + return updated, cmd, true + } + if _, ok := m.fetcher.(codex.SessionCommandsClient); !ok && !codex.IsLocalSessionCommand(path) && path != "" && path != "help" { m.monitorPrompt.notice = "Slash commands require the shared app-server." return m, nil, true } @@ -112,16 +189,19 @@ func (m Model) commandChoice() (codex.SessionCommandChoice, bool) { func (m Model) chooseMonitorCommand() (Model, tea.Cmd, bool) { o, ok := m.commandChoice() - if !ok || m.monitorCommands.busy { + if !ok || m.monitorCommands.busy || o.Unavailable != "" || m.monitorCommands.notice != "" { return m, nil, true } if o.Next != "" { - cmd := m.loadMonitorCommands(o.Next) + if updated, cmd, local := m.runLocalMonitorCommand(o.Next); local { + return updated, cmd, true + } + cmd := m.navigateMonitorCommands(o.Next) return m, cmd, true } if m.monitorCommands.menu.Picker { p := &m.monitorCommands - if o.Action && p.notice == "" { + if o.Action && p.notice == "" && (p.reviewedChoice != o.ID || time.Now().After(p.until)) { p.reviewedChoice = o.ID p.until = time.Now().Add(30 * time.Second) } @@ -160,7 +240,7 @@ func (m Model) confirmMonitorCommand() (Model, tea.Cmd, bool) { p.reviewedChoice = "" return m, nil, true } - p.notice = "Confirmation expired; reopen the option." + // Keep Enter Review available so expiration uses the same recovery path. return m, nil, true } c, ok := m.fetcher.(codex.SessionCommandsClient) @@ -230,10 +310,13 @@ func (m Model) monitorCommandRows(width, height int) []commandDisplayRow { } else if strings.HasPrefix(p.menu.Path, "cd/") { text += "\nOnly this session’s directory changes; project configuration is not reloaded. Confirm after reviewing both paths." } else { - text += "\nNo change sent yet. C confirms the selected setting. Model, reasoning and speed settings can change token usage and cost." + text += "\nNo change sent yet. Model, reasoning and speed settings can change token usage and cost." text += "\nChanges apply to subsequent turns of this session. They are not global defaults. Confirm only after reviewing the option. Automatic quota thresholds may later supersede model settings." } } + if o.Action && time.Now().After(p.until) { + text += "\n\nReview expired. Press Enter to review again." + } lines := strings.Split(ansi.Hardwrap(text, w, true), "\n") start := min(p.scroll, max(len(lines)-capacity, 0)) for _, line := range lines[start:min(start+capacity, len(lines))] { @@ -241,11 +324,27 @@ func (m Model) monitorCommandRows(width, height int) []commandDisplayRow { } return rows } - start := max(p.selected-capacity+1, 0) - for i := start; i < min(start+capacity, len(p.menu.Choices)); i++ { + // Keep the selected choice and its recovery instructions visible, even + // when the option list would otherwise use every available row. + var reasonRows []string + if o, ok := m.commandChoice(); ok && o.Unavailable != "" { + reason := o.Unavailable + if reason == "Waiting for idle. Refresh options when this turn finishes." { + reason = i18n.Text("Waiting for idle. Refresh options when this turn finishes.") + } + reasonRows = strings.Split(ansi.Hardwrap(reason, w, true), "\n") + limit := max(capacity-1, 1) + if len(reasonRows) > limit && o.Unavailable == "Waiting for idle. Refresh options when this turn finishes." { + reasonRows = strings.Split(ansi.Hardwrap(i18n.Text("Refresh when this turn finishes."), w, true), "\n") + } + reasonRows = reasonRows[:min(len(reasonRows), limit)] + } + choiceCapacity := capacity - len(reasonRows) + start := max(p.selected-choiceCapacity+1, 0) + for i := start; i < min(start+choiceCapacity, len(p.menu.Choices)); i++ { o := p.menu.Choices[i] label := o.Label - if p.menu.Picker && o.Selected { + if (p.menu.Picker || p.menu.Path == "theme") && o.Selected { label += " // CURRENT" } if p.menu.Multiple { @@ -254,19 +353,28 @@ func (m Model) monitorCommandRows(width, height int) []commandDisplayRow { mark = "[x] " } label = mark + label + " // " + o.Help - } else if o.Next != "" { + } else if o.Next != "" && o.Unavailable == "" && p.menu.Path != "theme" { label += " →" - } else if !o.Action { + } else if o.Unavailable != "" { + if strings.HasPrefix(o.Unavailable, "Waiting for idle.") { + label += " // " + i18n.Text("WAITING FOR IDLE") + } else { + label += " // " + i18n.Text("UNAVAILABLE") + } + } else if !o.Action && o.Next == "" { label += " // HELP" } rows = append(rows, commandDisplayRow{text: ansi.Truncate(label, w, "…"), choice: i, action: "choose"}) } - if len(rows) == 0 { + if len(rows) == 0 && len(reasonRows) == 0 { rows = append(rows, commandDisplayRow{text: "No available options. Use Codex for unsupported commands.", choice: -1}) } + for _, line := range reasonRows { + rows = append(rows, commandDisplayRow{text: line, choice: -1}) + } if p.menu.Picker { if o, ok := m.commandChoice(); ok && p.reviewedChoice == o.ID { - message := "REVIEW // " + o.Label + " — no change yet; C confirms." + message := "REVIEW // " + o.Label + " — no change sent." if time.Now().After(p.until) { message = "Review expired. Press Enter to review again." } @@ -275,7 +383,8 @@ func (m Model) monitorCommandRows(width, height int) []commandDisplayRow { } } } - if p.menu.Picker && len(rows) < capacity { + + if (p.menu.Picker || p.menu.Path == "" || p.menu.Path == "help") && len(rows) < capacity { if o, ok := m.commandChoice(); ok { rows = append(rows, commandDisplayRow{choice: -1}) for _, line := range strings.Split(ansi.Hardwrap(o.Help, w, true), "\n") { @@ -299,18 +408,35 @@ func (m Model) monitorCommandRows(width, height int) []commandDisplayRow { func (m Model) commandFooter(width int) []commandDisplayRow { p := m.monitorCommands var buttons []commandDisplayRow - if p.menu.Input && !p.busy { - buttons = append(buttons, commandDisplayRow{text: "[ ENTER REVIEW ]", action: "review"}) + if p.menu.Input && !p.busy && p.notice == "" && strings.TrimSpace(p.input.Value()) != "" { + buttons = append(buttons, commandDisplayRow{text: i18n.Text("[ ENTER REVIEW ]"), action: "review"}) } else if p.menu.Multiple { - buttons = append(buttons, commandDisplayRow{text: "[ C APPLY ]", action: "confirm"}) + buttons = append(buttons, commandDisplayRow{text: i18n.Text("[ C APPLY ]"), action: "confirm"}) } else if o, ok := m.commandChoice(); ok && o.Action && !p.busy && p.notice == "" { - if p.detail || (p.menu.Picker && p.reviewedChoice == o.ID && time.Now().Before(p.until)) { - buttons = append(buttons, commandDisplayRow{text: "[ C CONFIRM ]", action: "confirm"}) + if (p.detail || (p.menu.Picker && p.reviewedChoice == o.ID)) && time.Now().Before(p.until) { + buttons = append(buttons, commandDisplayRow{text: i18n.Text("[ C CONFIRM ]"), action: "confirm"}) } else { - buttons = append(buttons, commandDisplayRow{text: "[ ENTER REVIEW ]", action: "stage"}) + buttons = append(buttons, commandDisplayRow{text: i18n.Text("[ ENTER REVIEW ]"), action: "stage"}) } } - buttons = append(buttons, commandDisplayRow{text: "[ ← BACK ]", action: "back"}, commandDisplayRow{text: "[ ESC CLOSE ]", action: "close"}) + if o, ok := m.commandChoice(); ok && !p.detail && !p.menu.Multiple && !p.busy && p.notice == "" && o.Unavailable == "" && !o.Action { + if o.Next != "" { + label := i18n.Text("[ ENTER OPEN ]") + if p.menu.Path == "theme" { + label = i18n.Text("[ ENTER APPLY ]") + } + buttons = append(buttons, commandDisplayRow{text: label, action: "stage"}) + } else { + buttons = append(buttons, commandDisplayRow{text: i18n.Text("[ ENTER HELP ]"), action: "stage"}) + } + } + if m.monitorCommandsCanBack() { + buttons = append(buttons, commandDisplayRow{text: i18n.Text("[ ← BACK ]"), action: "back"}) + } + if o, ok := m.commandChoice(); !p.busy && (p.notice != "" || (ok && o.Unavailable != "")) { + buttons = append(buttons, commandDisplayRow{text: i18n.Text("[ F REFRESH ]"), action: "refresh"}) + } + buttons = append(buttons, commandDisplayRow{text: i18n.Text("[ ESC CANCEL ]"), action: "close"}) used := 0 for i, b := range buttons { if used+ansi.StringWidth(b.text) > max(width-4, 0) { @@ -334,7 +460,7 @@ func (m Model) renderMonitorCommands(width, height int, colors palette) string { if r.action != "" { style = colors.dimmed() if r.choice == p.selected { - style = style.Foreground(colors.background).Background(colors.primary).Bold(true) + style = style.Foreground(colors.accent).Bold(true) text = "> " + text } else { text = " " + text @@ -354,17 +480,15 @@ func (m Model) renderMonitorCommands(width, height int, colors palette) string { footer = append(footer, style.Render(b.text)) } if len(body) > 1 { - hint := "↑/↓ select or scroll • Enter open • / root" + hint := "↑/↓ select" if p.menu.Input { - hint = "Enter review • Escape cancel" - } else if p.menu.Picker { - hint = "↑/↓ select • Enter review • C confirm • Esc cancel" + hint = "" } else if p.detail { - hint = "↑/↓ scroll • C confirm • ← back • Escape cancel" + hint = "↑/↓ scroll" } else if p.menu.Multiple { - hint = "↑/↓ select • Space toggle • ←/→ order • C apply" + hint = "↑/↓ select • Space toggle • ←/→ order" } - body[len(body)-2] = colors.dimmed().Render(ansi.Truncate(hint, max(width-4, 1), "")) + body[len(body)-2] = colors.label().Render(ansi.Truncate(hint, max(width-4, 1), "")) body[len(body)-1] = strings.Join(footer, " ") } identity := shortSessionID(p.session) @@ -387,7 +511,11 @@ func (m Model) updateMonitorCommands(msg tea.Msg) (Model, tea.Cmd, bool) { p.notice = "" if r.err != nil { if !r.applied && (r.path == "" || r.path == "help") { - p.menu = localCommandsMenu() + p.menu = m.localCommandsMenu() + if p.restore != nil { + p.selected = min(p.restore.selected, len(p.menu.Choices)-1) + p.restore = nil + } } else { p.notice = "Command unavailable or unconfirmed. Check Codex before retrying." } @@ -418,7 +546,15 @@ func (m Model) updateMonitorCommands(msg tea.Msg) (Model, tea.Cmd, bool) { return m, cmd, true } else { p.menu = r.menu - if p.menu.Picker { + if p.menu.Path == "" || p.menu.Path == "help" { + p.menu = m.withLocalCommands(p.menu) + } + restore := p.restore + p.restore = nil + if restore != nil { + p.selected = min(restore.selected, max(len(p.menu.Choices)-1, 0)) + } + if p.menu.Picker && restore == nil { for i, o := range p.menu.Choices { if o.Selected { p.selected = i @@ -434,6 +570,9 @@ func (m Model) updateMonitorCommands(msg tea.Msg) (Model, tea.Cmd, bool) { } p.input.SetWidth(max(m.monitorDashboardLayout().contentWidth-6, 1)) p.input.SetValue(p.menu.Value) + if restore != nil { + p.input.SetValue(restore.input) + } cmd := p.input.Focus() return m, cmd, true } @@ -441,9 +580,6 @@ func (m Model) updateMonitorCommands(msg tea.Msg) (Model, tea.Cmd, bool) { p.detail = true p.until = time.Now().Add(30 * time.Second) } - if p.menu.Path == "" || p.menu.Path == "help" { - p.menu.Choices = append(p.menu.Choices, localStatusLineChoice()) - } } } return m, nil, true @@ -458,27 +594,13 @@ func (m Model) updateMonitorCommands(msg tea.Msg) (Model, tea.Cmd, bool) { m.closeMonitorCommands() return m, nil, false } - back := func() tea.Cmd { - if p.detail { - p.detail = false - p.scroll = 0 - p.notice = "" - return nil - } - path := p.menu.Path - if i := strings.LastIndex(path, "/"); i >= 0 { - path = path[:i] - } else { - path = "" - } - return m.loadMonitorCommands(path) - } + if p.menu.Input && !p.busy { if key, ok := msg.(tea.KeyPressMsg); ok { switch key.String() { case "esc": - m.closeMonitorCommands() - return m, nil, true + cmd := m.cancelMonitorCommands() + return m, cmd, true case "enter": return m.reviewMonitorCommandInput() case "ctrl+c": @@ -523,21 +645,31 @@ func (m Model) updateMonitorCommands(msg tea.Msg) (Model, tea.Cmd, bool) { } switch key.String() { case "esc": - m.closeMonitorCommands() + cmd := m.cancelMonitorCommands() + return m, cmd, true case "q", "ctrl+c", "tab", "shift+tab": m.closeMonitorCommands() return m, nil, false case "t", "r": return m, nil, false case "left", "backspace": - return m, back(), true + cmd := m.backMonitorCommands() + return m, cmd, true + case "f": + if !p.busy { + cmd := m.loadMonitorCommands(p.menu.Path) + return m, cmd, true + } case "/": - cmd := m.loadMonitorCommands("") + cmd := m.navigateMonitorCommands("") return m, cmd, true case "enter", "right": if p.menu.Picker && key.String() == "right" { return m, nil, true } + if p.detail && p.notice == "" && time.Now().After(p.until) { + p.detail = false + } if !p.detail { return m.chooseMonitorCommand() } @@ -618,9 +750,14 @@ func (m Model) updateMonitorCommands(msg tea.Msg) (Model, tea.Cmd, bool) { case "confirm": return m.confirmMonitorCommand() case "back": - return m, back(), true + cmd := m.backMonitorCommands() + return m, cmd, true + case "refresh": + cmd := m.loadMonitorCommands(p.menu.Path) + return m, cmd, true case "close": - m.closeMonitorCommands() + cmd := m.cancelMonitorCommands() + return m, cmd, true } } break @@ -642,6 +779,6 @@ func (m Model) reviewMonitorCommandInput() (Model, tea.Cmd, bool) { if name == "" { return m, nil, true } - cmd := m.loadMonitorCommands(p.menu.Path + "/" + url.PathEscape(name)) + cmd := m.navigateMonitorCommands(p.menu.Path + "/" + url.PathEscape(name)) return m, cmd, true } diff --git a/internal/ui/monitor_commands_test.go b/internal/ui/monitor_commands_test.go index 79defff..1d37983 100644 --- a/internal/ui/monitor_commands_test.go +++ b/internal/ui/monitor_commands_test.go @@ -5,6 +5,8 @@ import ( "errors" "image" "net/url" + "os" + "os/exec" "reflect" "strconv" "strings" @@ -15,6 +17,7 @@ import ( uv "github.com/charmbracelet/ultraviolet" "github.com/charmbracelet/x/ansi" "github.com/merefield/codexometer/internal/codex" + "github.com/merefield/codexometer/internal/i18n" ) type commandTestClient struct { @@ -412,7 +415,7 @@ func TestMonitorSpeedPickerEnterReviewThenCConfirm(t *testing.T) { m, f := speedCommandTestModel(t) m.monitorPrompt.input.SetValue("/fast") view := ansi.Strip(m.render()) - for _, text := range []string{"Standard (default)", "Fast", "> Slow // CURRENT", "[ ENTER REVIEW ]", "Enter review", "C confirm"} { + for _, text := range []string{"Standard (default)", "Fast", "> Slow // CURRENT", "[ ENTER REVIEW ]"} { if !strings.Contains(view, text) { t.Fatalf("missing %q in %s", text, view) } @@ -509,7 +512,7 @@ func TestMonitorSlashSelectionUsesHighlightColors(t *testing.T) { uv.NewStyledString(view).Draw(&cells, image.Rect(0, 0, m.width, m.height)) expected := uv.NewScreenBuffer(2, 1) colors := paletteFor(m.theme) - uv.NewStyledString(colors.label().Foreground(colors.background).Background(colors.primary).Render("x")+colors.dimmed().Render("x")).Draw(&expected, image.Rect(0, 0, 2, 1)) + uv.NewStyledString(colors.label().Foreground(colors.accent).Bold(true).Render("x")+colors.dimmed().Render("x")).Draw(&expected, image.Rect(0, 0, 2, 1)) for index, label := range []string{"Medium", "High"} { x, y := renderedTextStart(t, m, label) got := cells.CellAt(x, y).Style @@ -517,10 +520,15 @@ func TestMonitorSlashSelectionUsesHighlightColors(t *testing.T) { if index == selected { want = expected.CellAt(0, 0).Style } - if !reflect.DeepEqual(got.Fg, want.Fg) || (index == selected && !reflect.DeepEqual(got.Bg, want.Bg)) { + if !reflect.DeepEqual(got.Fg, want.Fg) { t.Fatalf("%s did not use the appropriate selected/subdued colours", label) } } + mx, my := renderedTextStart(t, m, "Medium") + hx, hy := renderedTextStart(t, m, "High") + if !reflect.DeepEqual(cells.CellAt(mx, my).Style.Bg, cells.CellAt(hx, hy).Style.Bg) { + t.Fatal("selection added a background highlight") + } } } @@ -584,3 +592,179 @@ func TestMonitorModelReasoningEnterReviewBeforeC(t *testing.T) { t.Fatal("incorrect mutation count") } } + +func TestMonitorSpeedBackOnlyAfterReviewAndCancelRestoresComposer(t *testing.T) { + m, f := speedCommandTestModel(t) + m.monitorPrompt.session = m.monitorCommands.session + m.monitorPrompt.input.SetValue("/fast") + view := ansi.Strip(m.render()) + if strings.Contains(view, "BACK") || strings.Contains(view, "C CONFIRM") || strings.Contains(view, "C confirm") { + t.Fatal("direct picker advertises unavailable actions", view) + } + next, cmd := m.Update(tea.KeyPressMsg{Code: tea.KeyLeft}) + m = next.(Model) + if cmd != nil || m.monitorCommands.menu.Path != "tier/flex" { + t.Fatal("Back invented an unvisited parent") + } + next, _ = m.Update(tea.KeyPressMsg{Code: tea.KeyEnter}) + m = next.(Model) + if !strings.Contains(ansi.Strip(m.render()), "[ ← BACK ]") { + t.Fatal("review has no Back action") + } + next, _ = m.Update(tea.KeyPressMsg{Code: tea.KeyLeft}) + m = next.(Model) + if m.monitorCommands.reviewedChoice != "" || strings.Contains(ansi.Strip(m.render()), "BACK") { + t.Fatal("Back did not clear review") + } + _, cmd = m.Update(key('c')) + if cmd != nil || f.calls != 0 { + t.Fatal("Back retained confirmation") + } + x, y := renderedTextStart(t, m, "[ ESC CANCEL ]") + next, _ = m.Update(tea.MouseClickMsg{X: x, Y: y, Button: tea.MouseLeft}) + m = next.(Model) + if m.monitorCommands.open || m.monitorPrompt.input.Value() != "/fast" || !m.monitorPrompt.input.Focused() { + t.Fatal("Cancel lost composer draft or focus") + } +} + +func TestMonitorUnavailableChoicesHaveReasonAndRefresh(t *testing.T) { + m, f := speedCommandTestModel(t) + for i := range m.monitorCommands.menu.Choices { + m.monitorCommands.menu.Choices[i].Action = false + m.monitorCommands.menu.Choices[i].Unavailable = "Waiting for idle. Refresh options when this turn finishes." + } + view := ansi.Strip(m.render()) + for _, bad := range []string{"// HELP", "ENTER REVIEW", "C CONFIRM"} { + if strings.Contains(view, bad) { + t.Fatal("unavailable option advertises", bad, view) + } + } + if !strings.Contains(view, "WAITING FOR IDLE") || !strings.Contains(view, "[ F REFRESH ]") { + t.Fatal("missing availability feedback", view) + } + _, cmd := m.Update(tea.KeyPressMsg{Code: tea.KeyEnter}) + if cmd != nil || f.calls != 0 { + t.Fatal("blocked option was reviewed") + } + next, cmd := m.Update(key('f')) + m = next.(Model) + if cmd == nil { + t.Fatal("refresh unavailable") + } + next, _ = m.Update(cmd()) + m = next.(Model) + if !strings.Contains(ansi.Strip(m.render()), "[ ENTER REVIEW ]") { + t.Fatal("fresh available options retained blocked state") + } +} + +func TestMonitorRenameBackPreservesEditedInput(t *testing.T) { + m, base := commandTestModel(t) + f := &renameTestClient{commandTestClient: base} + m.fetcher = f + m, cmd, _ := m.openMonitorCommands("rename") + next, _ := m.Update(cmd()) + m = next.(Model) + m.monitorCommands.input.SetValue("Edited / name 界") + m, cmd, _ = m.reviewMonitorCommandInput() + next, _ = m.Update(cmd()) + m = next.(Model) + next, cmd = m.Update(tea.KeyPressMsg{Code: tea.KeyLeft}) + m = next.(Model) + if cmd == nil { + t.Fatal("Back did not request the editor") + } + next, _ = m.Update(cmd()) + m = next.(Model) + if !m.monitorCommands.menu.Input || m.monitorCommands.input.Value() != "Edited / name 界" || !m.monitorCommands.input.Focused() || strings.Contains(ansi.Strip(m.render()), "BACK") { + t.Fatal("Back lost input or invented a parent") + } +} + +func TestMonitorBackUsesVisitedMenus(t *testing.T) { + m, _ := commandTestModel(t) + m.monitorCommands.menu.Path = "model" + m.monitorCommands.menu.Choices = []codex.SessionCommandChoice{{ID: "model", Label: "test", Next: "model/test"}} + m, cmd, _ := m.chooseMonitorCommand() + next, _ := m.Update(cmd()) + m = next.(Model) + if !strings.Contains(ansi.Strip(m.render()), "[ ← BACK ]") { + t.Fatal("nested choices lost Back") + } + m, _, _ = m.chooseMonitorCommand() + next, _ = m.Update(tea.KeyPressMsg{Code: tea.KeyLeft}) + m = next.(Model) + if m.monitorCommands.detail || len(m.monitorCommands.history) != 1 { + t.Fatal("review Back skipped choices") + } + cmd = m.backMonitorCommands() + if cmd == nil || m.monitorCommands.restore.path != "model" || len(m.monitorCommands.history) != 0 { + t.Fatal("Back did not return to visited model menu") + } +} + +func TestMonitorBlockedReasonVisibleInShortPanels(t *testing.T) { + for _, size := range [][2]int{{80, 8}, {40, 8}, {24, 8}, {40, 6}} { + m, _ := speedCommandTestModel(t) + for i := range m.monitorCommands.menu.Choices { + m.monitorCommands.menu.Choices[i].Action = false + m.monitorCommands.menu.Choices[i].Unavailable = "Waiting for idle. Refresh options when this turn finishes." + } + rows := m.monitorCommandRows(size[0], size[1]) + if len(rows) > size[1]-5 { + t.Fatal("rows exceed panel capacity", size, rows) + } + selected, recovery := false, false + for _, row := range rows { + selected = selected || row.choice == m.monitorCommands.selected + recovery = recovery || strings.Contains(row.text, "Refresh") + } + if !recovery || (size[1] > 6 && !selected) { + t.Fatal("selected option or recovery instruction hidden", size, rows) + } + view := ansi.Strip(m.renderMonitorCommands(size[0], size[1], paletteFor(m.theme))) + if !strings.Contains(view, "Refresh") { + t.Fatal("reserved reason clipped by renderer", size, view) + } + } +} + +func TestMonitorCommandLocaleFeedback(t *testing.T) { + if os.Getenv("CODEXOMETER_COMMAND_LOCALE_HELPER") != "1" { + exe, err := os.Executable() + if err != nil { + t.Fatal(err) + } + for _, locale := range []string{"de", "ja", "fi"} { + cmd := exec.Command(exe, "-test.run=^TestMonitorCommandLocaleFeedback$", "-test.timeout=30s") + for _, env := range os.Environ() { + if !strings.HasPrefix(env, i18n.EnvironmentVariable+"=") && !strings.HasPrefix(env, "CODEXOMETER_COMMAND_LOCALE_HELPER=") { + cmd.Env = append(cmd.Env, env) + } + } + cmd.Env = append(cmd.Env, i18n.EnvironmentVariable+"="+locale, "CODEXOMETER_COMMAND_LOCALE_HELPER=1") + if output, err := cmd.CombinedOutput(); err != nil { + t.Fatalf("%s: %v\n%s", locale, err, output) + } + } + return + } + m, _ := speedCommandTestModel(t) + for i := range m.monitorCommands.menu.Choices { + m.monitorCommands.menu.Choices[i].Action = false + m.monitorCommands.menu.Choices[i].Unavailable = "Waiting for idle. Refresh options when this turn finishes." + } + view := ansi.Strip(m.renderMonitorCommands(300, 16, paletteFor(m.theme))) + for _, key := range []string{"WAITING FOR IDLE", "Waiting for idle. Refresh options when this turn finishes.", "[ F REFRESH ]", "[ ESC CANCEL ]"} { + if !strings.Contains(view, i18n.Text(key)) || strings.Contains(view, key) { + t.Fatal("fixed command feedback was not translated", key, view) + } + } + custom := "Unadvertised model. Consult the server-specific documentation." + m.monitorCommands.menu.Choices[m.monitorCommands.selected].Unavailable = custom + view = ansi.Strip(m.renderMonitorCommands(300, 16, paletteFor(m.theme))) + if !strings.Contains(view, custom) || !strings.Contains(view, i18n.Text("UNAVAILABLE")) { + t.Fatal("server-provided reason was altered or label untranslated", view) + } +} diff --git a/internal/ui/monitor_local_commands.go b/internal/ui/monitor_local_commands.go new file mode 100644 index 0000000..6db45c7 --- /dev/null +++ b/internal/ui/monitor_local_commands.go @@ -0,0 +1,96 @@ +package ui + +import ( + "strconv" + "strings" + + tea "charm.land/bubbletea/v2" + "github.com/merefield/codexometer/internal/codex" +) + +func (m Model) withLocalCommands(menu codex.SessionCommandMenu) codex.SessionCommandMenu { + choices := make([]codex.SessionCommandChoice, 0, len(menu.Choices)+6) + for _, choice := range menu.Choices { + if !codex.IsLocalSessionCommand(choice.Label) { + choices = append(choices, choice) + } + } + choices = append(choices, codex.LocalSessionCommands()...) + for i := range choices { + if choices[i].Next == "exit" || choices[i].Next == "quit" { + choices[i].Help = "Exit this Codexometer terminal interface. Codex sessions continue running." + } + } + menu.Choices = choices + return menu +} + +func (m Model) localCommandsMenu() codex.SessionCommandMenu { + return m.withLocalCommands(codex.SessionCommandMenu{Title: "/ COMMANDS", Help: "Local Codexometer commands. Shared Codex commands are available when the app-server is connected."}) +} + +func (m Model) localMonitorMenu(path string) (codex.SessionCommandMenu, bool) { + switch path { + case "statusline": + return m.statusLineMenu(), true + case "theme": + menu := codex.SessionCommandMenu{Title: "/theme", Path: "theme", Help: "Choose a Codexometer display theme. Enter applies it and saves your local display preferences."} + for theme := themeID(0); theme < themeCount; theme++ { + menu.Choices = append(menu.Choices, codex.SessionCommandChoice{ID: "theme-" + strconv.Itoa(int(theme)), Label: paletteFor(theme).name, Next: "theme/" + strconv.Itoa(int(theme)), Selected: theme == m.theme}) + } + return menu, true + case "copy": + choice := codex.SessionCommandChoice{ID: "copy-reply", Label: "Copy observed text", Next: "copy"} + if m.monitorCopyText(m.monitorContextTarget()) == "" { + choice.Unavailable = "No reply or activity text is available to copy for this session." + } + return codex.SessionCommandMenu{Title: "/copy", Path: "copy", Help: "Uses the same observed text and clipboard action as the session Copy button.", Choices: []codex.SessionCommandChoice{choice}}, true + } + return codex.SessionCommandMenu{}, false +} + +// Consume a slash command, while preserving an ordinary unsent draft. +func (m *Model) finishLocalMonitorCommand() tea.Cmd { + m.closeMonitorCommands() + if m.monitorPrompt.session == m.monitorContextTarget() && len(m.monitorPrompt.offer.Questions) == 0 && codex.IsSessionCommand(m.monitorPrompt.input.Value()) { + m.monitorPrompt.input.Reset() + } + m.monitorSuggestions = monitorSuggestionState{request: m.monitorSuggestions.request + 1} + if m.monitorPrompt.input.ready && m.monitorPrompt.session == m.monitorContextTarget() { + return m.monitorPrompt.input.Focus() + } + return nil +} + +func (m Model) runLocalMonitorCommand(path string) (Model, tea.Cmd, bool) { + switch path { + case "usage": + m.finishLocalMonitorCommand() + updated, cmd := m.pressViewTab(viewUsage) + return updated.(Model), cmd, true + case "copy": + id := m.monitorContextTarget() + if m.monitorCopyText(id) == "" { + return m, nil, false + } + focus := m.finishLocalMonitorCommand() + m, cmd := m.activateMonitorCopy(id) + return m, tea.Batch(cmd, focus), true + case "exit", "quit": + m.finishLocalMonitorCommand() + updated, cmd := m.pressFooterButton(footerButtonQuit) + return updated.(Model), cmd, true + } + if value, ok := strings.CutPrefix(path, "theme/"); ok { + theme, err := strconv.Atoi(value) + if err != nil || theme < 0 || theme >= int(themeCount) { + return m, nil, false + } + m.theme = themeID(theme) + m.prepareBenchmarkDetailTranscript() + m.persistPreferences() + cmd := m.finishLocalMonitorCommand() + return m, cmd, true + } + return m, nil, false +} diff --git a/internal/ui/monitor_local_commands_test.go b/internal/ui/monitor_local_commands_test.go new file mode 100644 index 0000000..0edd824 --- /dev/null +++ b/internal/ui/monitor_local_commands_test.go @@ -0,0 +1,207 @@ +package ui + +import ( + "context" + "errors" + "reflect" + "strings" + "testing" + + tea "charm.land/bubbletea/v2" + "github.com/charmbracelet/x/ansi" + "github.com/merefield/codexometer/internal/codex" +) + +type localCommandSpy struct { + *commandTestClient + reads int + available bool +} + +func (f *localCommandSpy) SessionCommands(context.Context, string, string) (codex.SessionCommandMenu, error) { + f.reads++ + if f.available { + return codex.SessionCommandMenu{Title: "/ COMMANDS", Choices: []codex.SessionCommandChoice{{ID: "model", Label: "/model", Next: "model"}}}, nil + } + return codex.SessionCommandMenu{}, errors.New("daemon unavailable") +} + +func localCommandModel() Model { + m := completedCopyModel() + m.setRowContext("root-one", contextFull) + m.monitorPrompt.session = "root-one" + m.monitorPrompt.input = newMonitorEditor() + return m +} + +func TestLocalSlashCatalogueWithoutDaemon(t *testing.T) { + m := localCommandModel() + m, cmd, _ := m.openMonitorCommands("") + if cmd != nil { + t.Fatal("local catalogue requested the daemon") + } + for _, path := range []string{"usage", "copy", "theme", "exit", "quit", "statusline"} { + found := false + for _, choice := range m.monitorCommands.menu.Choices { + if choice.Next == path { + found = true + if choice.Action { + t.Fatal("local command became a server action") + } + } + } + if !found { + t.Fatal("local command missing", path) + } + } +} + +func TestLocalSlashUsageConsumesCommandAndPreservesOrdinaryDraft(t *testing.T) { + for _, draft := range []string{"/usage", "keep ordinary draft"} { + m := localCommandModel() + m.monitorPrompt.input.SetValue(draft) + m, cmd, _ := m.openMonitorCommands("/usage") + if m.meterView != viewUsage || m.monitorCommands.open || cmd == nil { + t.Fatal("usage did not use the existing view") + } + expected := draft + if draft == "/usage" { + expected = "" + } + if m.monitorDrafts["root-one"] != expected { + t.Fatal("wrong retained draft", m.monitorDrafts) + } + } +} + +func commandCopiesText(cmd tea.Cmd, text string) bool { + if cmd == nil { + return false + } + msg := cmd() + if reflect.DeepEqual(msg, tea.SetClipboard(text)()) { + return true + } + if batch, ok := msg.(tea.BatchMsg); ok { + for _, child := range batch { + if commandCopiesText(child, text) { + return true + } + } + } + return false +} + +func TestLocalSlashCopyUsesSelectedObservedTextAndNoRPC(t *testing.T) { + m := localCommandModel() + _, base := commandTestModel(t) + spy := &localCommandSpy{commandTestClient: base} + m.fetcher = spy + m.monitorPrompt.input.SetValue("/copy") + want := m.monitorCopyText("root-one") + m, cmd, _ := m.openMonitorCommands("/copy") + if !commandCopiesText(cmd, want) || m.monitorCommands.open || m.monitorPrompt.input.Value() != "" || spy.reads != 0 || spy.calls != 0 || m.monitorCopyFlash != "root-one" { + t.Fatal("copy did not reuse the exact local action") + } + m.monitorSessionData[0].preview.Kind = codex.SessionContextApproval + m, cmd, _ = m.openMonitorCommands("copy") + if cmd != nil || !strings.Contains(ansi.Strip(m.render()), "No reply or activity text") || strings.Contains(ansi.Strip(m.render()), "ENTER OPEN") { + t.Fatal("unavailable copy was offered or silently failed") + } +} + +func TestLocalSlashThemeSelectApplyCancelAndPersistence(t *testing.T) { + m := localCommandModel() + m.monitorPrompt.input.SetValue("/theme") + store := &memoryPreferenceStore{} + m.preferenceStore = store + original := m.theme + m, cmd, _ := m.openMonitorCommands("theme") + if cmd != nil || len(m.monitorCommands.menu.Choices) != int(themeCount) || m.monitorCommands.selected != int(original) || !strings.Contains(ansi.Strip(m.render()), "[ ENTER APPLY ]") { + t.Fatal("theme picker did not open locally") + } + next, _ := m.Update(tea.KeyPressMsg{Code: tea.KeyDown}) + m = next.(Model) + if m.theme != original || len(store.saves) != 0 { + t.Fatal("highlight changed theme") + } + next, _ = m.Update(tea.KeyPressMsg{Code: tea.KeyEscape}) + m = next.(Model) + if m.theme != original || m.monitorPrompt.input.Value() != "/theme" { + t.Fatal("Cancel changed theme or lost slash draft") + } + m, _, _ = m.openMonitorCommands("theme") + next, _ = m.Update(tea.KeyPressMsg{Code: tea.KeyDown}) + m = next.(Model) + next, _ = m.Update(tea.KeyPressMsg{Code: tea.KeyEnter}) + m = next.(Model) + if m.theme != original.next() || len(store.saves) != 1 || m.monitorCommands.open || m.monitorPrompt.input.Value() != "" { + t.Fatal("Enter did not apply and persist local theme") + } +} + +func TestLocalSlashExitAliasesUseLocalQuit(t *testing.T) { + for _, path := range []string{"exit", "quit"} { + m := localCommandModel() + _, base := commandTestModel(t) + spy := &localCommandSpy{commandTestClient: base} + m.fetcher = spy + m, cmd, _ := m.openMonitorCommands(path) + if cmd == nil || m.flashedButton != footerButtonQuit || spy.reads != 0 || spy.calls != 0 { + t.Fatal("exit did not use local Quit", path) + } + if _, ok := cmd().(tea.QuitMsg); !ok { + t.Fatal("exit did not quit the interface", path) + } + } +} + +func TestLocalSlashFallbackAndThemeBackUseVisitedCatalogue(t *testing.T) { + m := localCommandModel() + _, base := commandTestModel(t) + spy := &localCommandSpy{commandTestClient: base} + m.fetcher = spy + m, cmd, _ := m.openMonitorCommands("") + next, _ := m.Update(cmd()) + m = next.(Model) + if spy.reads != 1 || len(m.monitorCommands.menu.Choices) != 6 { + t.Fatal("failed remote discovery hid local commands") + } + for i, choice := range m.monitorCommands.menu.Choices { + if choice.Next == "theme" { + m.monitorCommands.selected = i + } + } + m, _, _ = m.chooseMonitorCommand() + if len(m.monitorCommands.history) != 1 { + t.Fatal("theme lost its visited parent") + } + m.fetcher = nil + cmd = m.backMonitorCommands() + if cmd != nil || m.monitorCommands.menu.Path != "" || m.monitorCommands.menu.Choices[m.monitorCommands.selected].Next != "theme" { + t.Fatal("Back did not restore local catalogue selection") + } +} + +func TestLocalSlashThemeBackRestoresSelectionAfterRemoteRead(t *testing.T) { + for _, fails := range []bool{false, true} { + m := localCommandModel() + _, base := commandTestModel(t) + m.fetcher = &localCommandSpy{commandTestClient: base, available: !fails} + m, cmd, _ := m.openMonitorCommands("") + next, _ := m.Update(cmd()) + m = next.(Model) + for i, choice := range m.monitorCommands.menu.Choices { + if choice.Next == "theme" { + m.monitorCommands.selected = i + } + } + m, _, _ = m.chooseMonitorCommand() + cmd = m.backMonitorCommands() + next, _ = m.Update(cmd()) + m = next.(Model) + if m.monitorCommands.menu.Choices[m.monitorCommands.selected].Next != "theme" || m.monitorCommands.restore != nil { + t.Fatal("Back lost local selection after remote catalogue read", fails) + } + } +} diff --git a/internal/ui/monitor_statusline.go b/internal/ui/monitor_statusline.go index b7a14cd..836245f 100644 --- a/internal/ui/monitor_statusline.go +++ b/internal/ui/monitor_statusline.go @@ -8,14 +8,6 @@ import ( "github.com/merefield/codexometer/internal/statusline" ) -func localStatusLineChoice() codex.SessionCommandChoice { - return codex.SessionCommandChoice{ID: "local-statusline", Label: "/statusline", Help: "Choose multiple fields for Codexometer's detail footer. Saved display preferences only.", Next: "statusline"} -} - -func localCommandsMenu() codex.SessionCommandMenu { - return codex.SessionCommandMenu{Title: "/ COMMANDS", Help: "Codex catalogue unavailable. Local display settings remain available.", Choices: []codex.SessionCommandChoice{localStatusLineChoice()}} -} - func (m Model) statusLineMenu() codex.SessionCommandMenu { menu := codex.SessionCommandMenu{Title: "/statusline", Path: "statusline", Multiple: true, Help: "Choose fields for Codexometer's detail footer. Space/Enter toggles; C applies; Escape cancels. Left/Right reorders. This does not change Codex CLI configuration. Missing telemetry is omitted."} selected := statusline.Normalize(m.monitorStatusLine) diff --git a/internal/ui/monitor_suggestions.go b/internal/ui/monitor_suggestions.go index 9504f99..77bdf2d 100644 --- a/internal/ui/monitor_suggestions.go +++ b/internal/ui/monitor_suggestions.go @@ -46,7 +46,7 @@ func (m *Model) syncMonitorSuggestions() tea.Cmd { } c, ok := m.fetcher.(codex.SessionCommandsClient) if !ok { - *s = monitorSuggestionState{active: true, session: m.monitorPrompt.session, request: s.request + 1, menu: localCommandsMenu()} + *s = monitorSuggestionState{active: true, session: m.monitorPrompt.session, request: s.request + 1, menu: m.localCommandsMenu()} return nil } *s = monitorSuggestionState{active: true, busy: true, session: m.monitorPrompt.session, request: s.request + 1} @@ -96,7 +96,7 @@ func (m Model) withMonitorSuggestions(view string, colors palette) string { label := ansi.Truncate(o.Label, popup.width-4, "…") style := colors.dimmed().Background(colors.background) if i == selected { - style = style.Foreground(colors.background).Background(colors.primary).Bold(true) + style = style.Foreground(colors.accent).Bold(true) } help := ansi.Truncate(" // "+strings.Join(strings.Fields(o.Help), " "), max(popup.width-4-ansi.StringWidth(label), 0), "…") row := " " + style.Render(label) + colors.dimmed().Background(colors.background).Render(help) + " " @@ -114,7 +114,11 @@ func (m Model) updateMonitorSuggestions(msg tea.Msg) (Model, tea.Cmd, bool) { if s.active && s.session == r.session && s.request == r.request { s.busy = false s.menu = r.menu - s.menu.Choices = append(s.menu.Choices, localStatusLineChoice()) + if r.err != nil { + s.menu = m.localCommandsMenu() + } else { + s.menu = m.withLocalCommands(s.menu) + } s.err = r.err != nil } return m, nil, true diff --git a/internal/ui/monitor_suggestions_test.go b/internal/ui/monitor_suggestions_test.go index a4adc40..24a0515 100644 --- a/internal/ui/monitor_suggestions_test.go +++ b/internal/ui/monitor_suggestions_test.go @@ -121,7 +121,7 @@ func TestMonitorSuggestionPopupShrinksWithoutMovingComposer(t *testing.T) { w, h := m.monitorPromptSize() composerRows := m.monitorPromptRows(w, h) initial, _ := m.monitorSuggestionPopup() - if initial.height != 5 { // three commands and a two-line border + if initial.height != len(m.suggestionChoices())+2 { // all commands and a two-line border t.Fatalf("mode %d: popup height %d", mode, initial.height) } for _, step := range []struct { @@ -190,8 +190,8 @@ func TestMonitorSuggestionHelpIsSubduedAndSingleLine(t *testing.T) { uv.NewStyledString(view).Draw(&cells, image.Rect(0, 0, m.width, m.height)) command := cells.CellAt(popup.x+2, popup.y+1) help := cells.CellAt(popup.x+2+len("/model // "), popup.y+1) - if reflect.DeepEqual(command.Style.Bg, help.Style.Bg) { - t.Fatal("help inherited the command highlight") + if !reflect.DeepEqual(command.Style.Bg, help.Style.Bg) || reflect.DeepEqual(command.Style.Fg, help.Style.Fg) { + t.Fatal("selection should change text brightness without reversing the background") } want := uv.NewScreenBuffer(1, 1) uv.NewStyledString(colors.dimmed().Render("x")).Draw(&want, image.Rect(0, 0, 1, 1)) diff --git a/internal/web/dist/assets/index-BHlnMEGS.js b/internal/web/dist/assets/index-BHlnMEGS.js deleted file mode 100644 index a8bb917..0000000 --- a/internal/web/dist/assets/index-BHlnMEGS.js +++ /dev/null @@ -1,46 +0,0 @@ -(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 e=Array.isArray,t=Array.prototype.indexOf,n=Array.prototype.includes,r=Array.from,i=Object.defineProperty,a=Object.getOwnPropertyDescriptor,o=Object.getOwnPropertyDescriptors,s=Object.prototype,c=Array.prototype,l=Object.getPrototypeOf,u=Object.isExtensible;function d(e){return typeof e==`function`}var f=()=>{};function p(e){return e()}function m(e){for(var t=0;t{e=n,t=r}),resolve:e,reject:t}}function g(e,t,n=!1){return e===void 0?n?t():t:e}function _(e,t){if(Array.isArray(e))return e;if(t===void 0||!(Symbol.iterator in e))return Array.from(e);let n=[];for(let r of e)if(n.push(r),n.length===t)break;return n}var v=1024,y=2048,b=4096,x=8192,S=16384,C=32768,w=1<<25,ee=65536,T=1<<19,te=1<<20,E=1<<25,D=1<<21,O=1<<22,ne=1<<23,k=Symbol(`$state`),re=Symbol(`component`),ie=Symbol(`legacy props`),ae=Symbol(``),oe=Symbol(`attributes`),se=Symbol(`class`),ce=Symbol(`style`),le=Symbol(`text`),ue=Symbol(`form reset`),de=new class extends Error{name=`StaleReactionError`;message="The reaction that called `getAbortSignal()` was re-run or destroyed"},fe=!!globalThis.document?.contentType&&globalThis.document.contentType.includes(`xml`),pe={},me=Symbol(`uninitialized`),he=`http://www.w3.org/1999/xhtml`;function ge(){console.warn(`https://svelte.dev/e/derived_inert`)}function _e(e){console.warn(`https://svelte.dev/e/hydration_mismatch`)}function ve(){console.warn(`https://svelte.dev/e/select_multiple_invalid_value`)}function ye(){console.warn(`https://svelte.dev/e/svelte_boundary_reset_noop`)}var A=!1;function be(e){A=e}var j;function xe(e){if(e===null)throw _e(),pe;return j=e}function Se(){return xe(cn(j))}function M(e){if(A){if(cn(j)!==null)throw _e(),pe;j=e}}function Ce(e=1){if(A){for(var t=e,n=j;t--;)n=cn(n);j=n}}function we(e=!0){for(var t=0,n=j;;){if(n.nodeType===8){var r=n.data;if(r===`]`){if(t===0)return n;--t}else(r===`[`||r===`[!`||r[0]===`[`&&!isNaN(Number(r.slice(1))))&&(t+=1)}var i=cn(n);e&&n.remove(),n=i}}function Te(e){if(!e||e.nodeType!==8)throw _e(),pe;return e.data}function Ee(e){return e===this.v}function De(e,t){return e==e?e!==t||typeof e==`object`&&!!e||typeof e==`function`:t==t}function Oe(e){return!De(e,this.v)}function ke(e){throw Error(`https://svelte.dev/e/lifecycle_outside_component`)}function Ae(){throw Error(`https://svelte.dev/e/async_derived_orphan`)}function je(e,t,n){throw Error(`https://svelte.dev/e/each_key_duplicate`)}function Me(e){throw Error(`https://svelte.dev/e/effect_in_teardown`)}function Ne(){throw Error(`https://svelte.dev/e/effect_in_unowned_derived`)}function Pe(e){throw Error(`https://svelte.dev/e/effect_orphan`)}function Fe(){throw Error(`https://svelte.dev/e/effect_update_depth_exceeded`)}function Ie(e){throw Error(`https://svelte.dev/e/props_invalid_value`)}function Le(){throw Error(`https://svelte.dev/e/state_descriptors_fixed`)}function Re(){throw Error(`https://svelte.dev/e/state_prototype_fixed`)}function ze(){throw Error(`https://svelte.dev/e/state_unsafe_mutation`)}function Be(){throw Error(`https://svelte.dev/e/svelte_boundary_reset_onerror`)}var Ve=!1;function He(){Ve=!0}var Ue=null;function We(e){Ue=e}function Ge(e,t=!1,n){Ue={p:Ue,i:!1,c:null,e:null,s:e,x:null,r:U,l:Ve&&!t?{s:null,u:null,$:[]}:null}}function Ke(e){var t=Ue,n=t.e;if(n!==null){t.e=null;for(var r of n)xn(r)}return e!==void 0&&(t.x=e),t.i=!0,Ue=t.p,qe(e)}function qe(e={}){return i(e,re,{value:!0}),e}function Je(){return!Ve||Ue!==null&&Ue.l===null}var Ye=[];function Xe(){var e=Ye;Ye=[],m(e)}function Ze(e){if(Ye.length===0&&!Tt){var t=Ye;queueMicrotask(()=>{t===Ye&&Xe()})}Ye.push(e)}function Qe(){for(;Ye.length>0;)Xe()}var $e=~(y|b|v);function et(e,t){e.f=e.f&$e|t}function tt(e){e.f&512||e.deps===null?et(e,v):et(e,b)}function nt(e,t,n){e.f&2048?t.add(e):e.f&4096&&n.add(e),et(e,v)}function rt(e){A&&sn(e)!==null&&ln(e)}var it=!1;function at(){it||(it=!0,document.addEventListener(`reset`,e=>{Promise.resolve().then(()=>{if(!e.defaultPrevented)for(let t of e.target.elements)t[ue]?.()})},{capture:!0}))}function ot(e){var t=H,n=U;Gn(null),Kn(null);try{return e()}finally{Gn(t),Kn(n)}}function st(e,t,n,r=n){e.addEventListener(t,()=>ot(n));let i=e[ue];e[ue]=i?()=>{i(),r(!0)}:()=>r(!0),at()}function ct(e,t,n,r){let i=Je()?ft:ht;var a=e.filter(e=>!e.settled),o=t.map(i);if(n.length===0&&a.length===0){r(o);return}var s=U,c=lt(),l=a.length===1?a[0].promise:a.length>1?Promise.all(a.map(e=>e.promise)):null;function u(e){if(!(s.f&16384)){c();try{r([...o,...e])}catch(e){mn(e,s)}ut()}}var d=dt();if(n.length===0){l.then(()=>u([])).finally(d);return}function f(){Promise.all(n.map(e=>mt(e))).then(u).catch(e=>mn(e,s)).finally(d)}l?l.then(()=>{c(),f(),ut()}):f()}function lt(){var e=U,t=H,n=Ue,r=P;return function(i=!0){Kn(e),Gn(t),We(n),i&&!(e.f&16384)&&(r?.activate(),r?.apply())}}function ut(e=!0){Kn(null),Gn(null),We(null),e&&P?.deactivate()}function dt(){var e=U,t=e.b,n=P,r=!!t?.is_rendered();return t?.update_pending_count(1,n),n.increment(r,e),()=>{t?.update_pending_count(-1,n),n.decrement(r,e)}}function ft(e){var t=2|y;return U!==null&&(U.f|=T),{ctx:Ue,deps:null,effects:null,equals:Ee,f:t,fn:e,reactions:null,rv:0,v:me,wv:0,parent:U,ac:null}}var pt=Symbol(`obsolete`);function mt(e,t,n){let r=U;r===null&&Ae();var i=void 0,a=Ht(me),o=!H,s=new Set;return Tn(()=>{var t=U,n=h();i=n.promise;try{Promise.resolve(e()).then(n.resolve,e=>{e!==de&&n.reject(e)}).finally(ut)}catch(e){n.reject(e),ut()}var c=P;if(o){if(t.f&32768)var l=dt();if(r.b?.is_rendered())c.async_deriveds.get(t)?.reject(pt);else for(let e of s.values())e.reject(pt);s.add(n),c.async_deriveds.set(t,n)}let u=(e,t=void 0)=>{l?.(),s.delete(n),t!==pt&&(c.activate(),t?(a.f|=ne,Kt(a,t)):(a.f&8388608&&(a.f^=ne),Kt(a,e)),c.deactivate())};n.promise.then(u,e=>u(null,e||`unknown`))}),yn(()=>{for(let e of s)e.reject(pt)}),new Promise(e=>{function t(n){function r(){n===i?e(a):t(i)}n.then(r,r)}t(i)})}function N(e){let t=ft(e);return Jn(t),t}function ht(e){let t=ft(e);return t.equals=Oe,t}function gt(e){var t=e.effects;if(t!==null){e.effects=null;for(var n=0;n{t.ac.abort(de),t.ac=null}),t.fn!==null&&(t.teardown=f),lr(t,0),An(t))}function bt(e){if(e.effects!==null)for(let t of e.effects)t.teardown&&t.fn!==null&&ur(t)}var xt=null,P=null,St=null,Ct=null,wt=null,Tt=!1,Et=!1,Dt=null,Ot=null,kt=0,At=1,jt=class e{id=At++;#e=!1;linked=!0;#t=null;#n=null;async_deriveds=new Map;current=new Map;previous=new Map;#r=new Set;#i=new Set;#a=0;#o=new Map;#s=null;#c=[];#l=[];#u=new Set;#d=new Set;#f=new Map;#p=new Set;is_fork=!1;#m=!1;constructor(){xt===null?xt=this:(xt.#n=this,this.#t=xt),xt=this}#h(){if(this.is_fork)return!0;for(let n of this.#o.keys()){for(var e=n,t=!1;e.parent!==null;){if(this.#f.has(e)){t=!0;break}e=e.parent}if(!t)return!0}return!1}skip_effect(e){this.#f.has(e)||this.#f.set(e,{d:[],m:[]}),this.#p.delete(e)}unskip_effect(e,t=e=>this.schedule(e)){var n=this.#f.get(e);if(n){this.#f.delete(e);for(var r of n.d)et(r,y),t(r);for(r of n.m)et(r,b),t(r)}this.#p.add(e)}#g(){var e=[];for(let i of this.#c)if(!(i.f&16384||!(i.f&6144))){for(var t=i,n=!1;t.parent!==null;){t=t.parent;var r=t.f;if(r&96){if(!(r&1024)){n=!0;break}t.f^=v}}n||e.push(t)}return this.#c=[],e}#_(){this.#e=!0;for(let e of this.#u)this.#d.delete(e),et(e,y),this.schedule(e);for(let e of this.#d)et(e,b),this.schedule(e);this.apply();for(var t=Dt=[],n=[],r=Ot=[];this.#c.length>0;){kt++>1e3&&(this.#S(),Nt());for(let e of this.#g())try{this.#v(e,t,n)}catch(t){throw Rt(e),this.#h()||this.discard(),t}}if(P=null,r.length>0){var i=e.ensure();for(let e of r)i.schedule(e)}if(Dt=null,Ot=null,this.#h()){this.#x(n),this.#x(t);for(let[e,t]of this.#f)Lt(e,t);r.length>0&&P.#_();return}let a=this.#y();if(a){this.#x(n),this.#x(t),a.#b(this);return}this.#u.clear(),this.#d.clear();for(let e of this.#r)e(this);this.#r.clear(),St=this,Ft(n),Ft(t),St=null,this.#s?.resolve();var o=P;if(this.#a===0&&(this.#c.length===0||o!==null)&&this.#S(),this.#c.length>0){if(o!==null){for(let e of this.#c)o.#c.push(e);this.#c=[]}else o=this}o!==null&&(Bt.clear(),o.#_())}#v(e,t,n){e.f^=v;for(var r=e.first;r!==null;){var i=r.f,a=!!(i&96);if(!(a&&i&1024||i&8192||this.#f.has(r))&&r.fn!==null){a?r.f^=v:i&4?t.push(r):ir(r)&&(i&16&&this.#d.add(r),ur(r));var o=r.first;if(o!==null){r=o;continue}}for(;r!==null;){var s=r.next;if(s!==null){r=s;break}r=r.parent}}}#y(){for(var e=this.#t;e!==null;){if(!e.is_fork){for(let[t,[,n]]of this.current)if(e.current.has(t)&&!n)return e}e=e.#t}return null}#b(e){for(let[t,n]of e.current)!this.previous.has(t)&&e.previous.has(t)&&this.previous.set(t,e.previous.get(t)),this.current.set(t,n);for(let[t,n]of e.async_deriveds){let e=this.async_deriveds.get(t);e&&n.promise.then(e.resolve).catch(e.reject)}e.async_deriveds.clear(),this.transfer_effects(e.#u,e.#d);let t=e=>{var n=e.reactions;if(n!==null&&!(e.f&2&&!(e.f&6144)))for(let e of n){var r=e.f;if(r&2)t(e);else{var i=e;r&4194320&&!this.async_deriveds.has(i)&&(this.#d.delete(i),et(i,y),this.schedule(i))}}};for(let e of this.current.keys())t(e);this.oncommit(()=>e.discard()),e.#S(),P=this,this.#_()}#x(e){for(var t=0;t{this.#m=!1,this.linked&&this.flush()}))}transfer_effects(e,t){for(let t of e)this.#u.add(t);for(let e of t)this.#d.add(e);e.clear(),t.clear()}oncommit(e){this.#r.add(e)}ondiscard(e){this.#i.add(e)}settled(){return(this.#s??=h()).promise}static ensure(){if(P===null){let t=P=new e;!Et&&!Tt&&Ze(()=>{t.#e||t.flush()})}return P}apply(){Ct=null}schedule(e){if(wt=e,e.b?.is_pending&&e.f&16777228&&!(e.f&32768)){e.b.defer_effect(e);return}this.#c.push(e)}#S(){if(this.linked){var e=this.#t,t=this.#n;e===null||(e.#n=t),t===null?xt=e:t.#t=e,this.linked=!1}}};function Mt(e){var t=Tt;Tt=!0;try{var n;for(e&&(P!==null&&!P.is_fork&&P.flush(),n=e());;){if(Qe(),P===null)return n;P.flush()}}finally{Tt=t}}function Nt(){try{Fe()}catch(e){mn(e,wt)}}var Pt=null;function Ft(e){var t=e.length;if(t!==0){for(var n=0;n0)){Bt.clear();for(let e of Pt){if(e.f&24576)continue;let t=[e],n=e.parent;for(;n!==null;)Pt.has(n)&&(Pt.delete(n),t.push(n)),n=n.parent;for(let e=t.length-1;e>=0;e--){let n=t[e];n.f&24576||ur(n)}}Pt.clear()}}Pt=null}}function It(e){P.schedule(e)}function Lt(e,t){if(!(e.f&32&&e.f&1024)){e.f&2048?t.d.push(e):e.f&4096&&t.m.push(e),et(e,v);for(var n=e.first;n!==null;)Lt(n,t),n=n.next}}function Rt(e){et(e,v);for(var t=e.first;t!==null;)Rt(t),t=t.next}var zt=new Set,Bt=new Map,Vt=!1;function Ht(e,t){return{f:0,v:e,reactions:null,equals:Ee,rv:0,wv:0}}function F(e,t){let n=Ht(e,t);return Jn(n),n}function Ut(e,t=!1,n=!0){let r=Ht(e);return t||(r.equals=Oe),Ve&&n&&Ue!==null&&Ue.l!==null&&(Ue.l.s??=[]).push(r),r}function I(e,t,n=!1){return H!==null&&(!Wn||H.f&131072)&&Je()&&H.f&4325394&&(qn===null||!qn.has(e))&&ze(),Kt(e,n?Zt(t):t,Ot)}var Wt=null,Gt=0;function Kt(e,t,n=null){if(!e.equals(t)){Hn?Bt.set(e,t):Bt.has(e)||Bt.set(e,e.v);var r=jt.ensure();if(r.capture(e,t),e.f&2){let t=e;e.f&2048&&_t(t),Ct===null&&tt(t)}e.wv=rr(),Wt=null,Gt=0,Xt(e,y,n),Wt=null,Je()&&U!==null&&U.f&1024&&!(U.f&96)&&(Zn===null?Qn([e]):Zn.push(e)),!r.is_fork&&zt.size>0&&!Vt&&qt()}return t}function qt(){Vt=!1;for(let e of zt){e.f&1024&&et(e,b);let t;try{t=ir(e)}catch{t=!0}t&&ur(e)}zt.clear()}function Jt(e,t=1){var n=W(e),r=t===1?n++:n--;return I(e,n),r}function Yt(e){I(e,e.v+1)}function Xt(e,t,n){var r=e.reactions;if(r!==null){var i=Je(),a=r.length;if(Gt+=a,Gt>1e5&&Wt===null&&(Wt=new Set),Wt!==null){if(Wt.has(e))return;Wt.add(e)}for(var o=0;o{if(tr===d)return e();var t=H,n=tr;Gn(null),nr(d);var r=e();return Gn(t),nr(n),r};return i&&r.set(`length`,F(t.length,u)),new Proxy(t,{defineProperty(e,t,n){(!(`value`in n)||n.configurable===!1||n.enumerable===!1||n.writable===!1)&&Le();var i=r.get(t);return i===void 0?f(()=>{var e=F(n.value,u);return r.set(t,e),e}):I(i,n.value,!0),!0},deleteProperty(e,t){var n=r.get(t);if(n===void 0){if(t in e){let e=f(()=>F(me,u));r.set(t,e),Yt(o)}}else I(n,me),Yt(o);return!0},get(e,n,i){if(n===k)return t;var o=r.get(n),s=n in e;if(o===void 0&&(!s||a(e,n)?.writable)&&(o=f(()=>F(Zt(s?e[n]:me),u)),r.set(n,o)),o!==void 0){var c=W(o);return c===me?void 0:c}return Reflect.get(e,n,i)},getOwnPropertyDescriptor(e,t){this.has?.(e,t);var n=Reflect.getOwnPropertyDescriptor(e,t),i=r.get(t);if(i!==void 0){var a=W(i);if(a===me)return;if(n&&`value`in n)n.value=a;else return{enumerable:!0,configurable:!0,value:a,writable:!0}}return n},has(e,t){if(t===k)return!0;var n=r.get(t),i=n!==void 0&&n.v!==me||Reflect.has(e,t);return(n!==void 0||U!==null&&(!i||a(e,t)?.writable))&&(n===void 0&&(n=f(()=>F(i?Zt(e[t]):me,u)),r.set(t,n)),W(n)===me)?!1:i},set(e,t,n,s){var c=r.get(t),l=t in e;if(i&&t===`length`)for(var d=n;dF(me,u)),r.set(d+``,p)):I(p,me)}if(c===void 0)(!l||a(e,t)?.writable)&&(c=f(()=>F(void 0,u)),I(c,Zt(n)),r.set(t,c));else{l=c.v!==me;var m=f(()=>Zt(n));I(c,m)}var h=Reflect.getOwnPropertyDescriptor(e,t);if(h?.set&&h.set.call(s,n),!l){if(i&&typeof t==`string`){var g=r.get(`length`),_=Number(t);Number.isInteger(_)&&_>=g.v&&I(g,_+1)}Yt(o)}return!0},ownKeys(e){W(o);var t=Reflect.ownKeys(e).filter(e=>{var t=r.get(e);return t===void 0||t.v!==me});for(var[n,i]of r)i.v!==me&&!(n in e)&&t.push(n);return t},setPrototypeOf(){Re()}})}function Qt(e){try{if(typeof e==`object`&&e&&k in e)return e[k]}catch{}return e}function $t(e,t){return Object.is(Qt(e),Qt(t))}var en,tn,nn,rn;function an(){if(en===void 0){en=window,tn=/Firefox/.test(navigator.userAgent);var e=Element.prototype,t=Node.prototype,n=Text.prototype;nn=a(t,`firstChild`).get,rn=a(t,`nextSibling`).get,u(e)&&(e[se]=void 0,e[oe]=null,e[ce]=void 0,e.__e=void 0),u(n)&&(n[le]=void 0)}}function on(e=``){return document.createTextNode(e)}function sn(e){return nn.call(e)}function cn(e){return rn.call(e)}function L(e,t){if(!A)return sn(e);var n=sn(j);if(n===null)n=j.appendChild(on());else if(t&&n.nodeType!==3){var r=on();return n?.before(r),xe(r),r}return t&&fn(n),xe(n),n}function R(e,t=!1){if(!A){var n=sn(e);return n instanceof Comment&&n.data===``?cn(n):n}if(t){if(j?.nodeType!==3){var r=on();return j?.before(r),xe(r),r}fn(j)}return j}function z(e,t=!1){if(!A)return sn(e);var n=L(e,t);return M(e),n}function B(e,t=1,n=!1){let r=A?j:e;for(var i;t--;)i=r,r=cn(r);if(!A)return r;if(n){if(r?.nodeType!==3){var a=on();return r===null?i?.after(a):r.before(a),xe(a),a}fn(r)}return xe(r),r}function ln(e){e.textContent=``}function un(){return!1}function dn(e,t,n){return t==null||t===`http://www.w3.org/1999/xhtml`?n?document.createElement(e,{is:n}):document.createElement(e):n?document.createElementNS(t,e,{is:n}):document.createElementNS(t,e)}function fn(e){if(e.nodeValue.length<65536)return;let t=e.nextSibling;for(;t!==null&&t.nodeType===3;)t.remove(),e.nodeValue+=t.nodeValue,t=e.nextSibling}function pn(e){var t=U;if(t===null)return H.f|=ne,e;if(!(t.f&32768)&&!(t.f&4))throw e;mn(e,t)}function mn(e,t){if(!(t!==null&&t.f&16384)){for(;t!==null;){if(t.f&128&&!(t.f&33570816)){if(!(t.f&32768))throw e;try{t.b.error(e);return}catch(t){e=t}}t=t.parent}throw e}}function hn(e){U===null&&(H===null&&Pe(e),Ne()),Hn&&Me(e)}function gn(e,t){var n=t.last;n===null?t.last=t.first=e:(n.next=e,e.prev=n,t.last=e)}function _n(e,t){var n=U;n!==null&&n.f&8192&&(e|=x);var r={ctx:Ue,deps:null,nodes:null,f:e|y|512,first:null,fn:t,last:null,next:null,parent:n,b:n&&n.b,prev:null,teardown:null,wv:0,ac:null};P?.register_created_effect(r);var i=r;if(e&4)Dt===null?jt.ensure().schedule(r):Dt.push(r);else if(t!==null){try{ur(r)}catch(e){throw Mn(r),e}i.deps===null&&i.teardown===null&&i.nodes===null&&i.first===i.last&&!(i.f&524288)&&(i=i.first,e&16&&e&65536&&i!==null&&(i.f|=ee))}if(i!==null&&(i.parent=n,n!==null&&gn(i,n),H!==null&&H.f&2&&!(e&64))){var a=H;(a.effects??=[]).push(i)}return r}function vn(){return H!==null&&!Wn}function yn(e){let t=_n(8,null);return et(t,v),t.teardown=e,t}function bn(e){hn(`$effect`);var t=U.f;if(!H&&t&32&&Ue!==null&&!Ue.i){var n=Ue;(n.e??=[]).push(e)}else return xn(e)}function xn(e){return _n(4|te,e)}function Sn(e){return hn(`$effect.pre`),_n(8|te,e)}function Cn(e){jt.ensure();let t=_n(64|T,e);return(e={})=>new Promise(n=>{e.outro?Fn(t,()=>{Mn(t),n(void 0)}):(Mn(t),n(void 0))})}function wn(e){return _n(4,e)}function Tn(e){return _n(O|T,e)}function En(e,t=0){return _n(8|t,e)}function V(e,t=[],n=[],r=[]){ct(r,t,n,t=>{_n(8,()=>{e(...t.map(W))})})}function Dn(e,t=0){return _n(16|t,e)}function On(e){return _n(32|T,e)}function kn(e){var t=e.teardown;if(t!==null){let n=Hn,r=H;Un(!0),Gn(null);try{t.call(null)}catch(t){mn(t,e.parent)}finally{Un(n),Gn(r)}}}function An(e,t=!1){var n=e.first;for(e.first=e.last=null;n!==null;){let e=n.ac;e!==null&&ot(()=>{e.abort(de)});var r=n.next;n.f&64?n.parent=null:Mn(n,t),n=r}}function jn(e){for(var t=e.first;t!==null;){var n=t.next;t.f&32||Mn(t),t=n}}function Mn(e,t=!0){var n=!1;(t||e.f&262144)&&e.nodes!==null&&e.nodes.end!==null&&(Nn(e.nodes.start,e.nodes.end),n=!0),e.f|=w,An(e,t&&!n),lr(e,0);var r=e.nodes&&e.nodes.t;if(r!==null)for(let e of r)e.stop();kn(e),e.f^=w,e.f|=S;var i=e.parent;i!==null&&i.first!==null&&Pn(e),e.next=e.prev=e.teardown=e.ctx=e.deps=e.fn=e.nodes=e.ac=e.b=null}function Nn(e,t){for(;e!==null;){var n=e===t?null:cn(e);e.remove(),e=n}}function Pn(e){var t=e.parent,n=e.prev,r=e.next;n!==null&&(n.next=r),r!==null&&(r.prev=n),t!==null&&(t.first===e&&(t.first=r),t.last===e&&(t.last=n))}function Fn(e,t,n=!0){var r=[];e.f|=256,In(e,r,!0);var i=()=>{n&&Mn(e),t&&t()},a=r.length;if(a>0){var o=()=>--a||i();for(var s of r)s.out(o)}else i()}function In(e,t,n){if(!(e.f&8192)){e.f^=x;var r=e.nodes&&e.nodes.t;if(r!==null)for(let e of r)(e.is_global||n)&&t.push(e);for(var i=e.first;i!==null;){var a=i.next;if(!(i.f&64)){var o=!!(i.f&65536)||!!(i.f&32)&&!!(e.f&16);In(i,t,o?n:!1)}i=a}}}function Ln(e){e.f&=-257,Rn(e,!0)}function Rn(e,t){if(!(e.f&256)&&e.f&8192){e.f^=x,e.f&1024||(et(e,y),jt.ensure().schedule(e));for(var n=e.first;n!==null;){var r=n.next,i=!!(n.f&65536)||!!(n.f&32);Rn(n,i?t:!1),n=r}var a=e.nodes&&e.nodes.t;if(a!==null)for(let e of a)(e.is_global||t)&&e.in()}}function zn(e,t){if(e.nodes)for(var n=e.nodes.start,r=e.nodes.end;n!==null;){var i=n===r?null:cn(n);t.append(n),n=i}}var Bn=null,Vn=!1,Hn=!1;function Un(e){Hn=e}var H=null,Wn=!1;function Gn(e){H=e}var U=null;function Kn(e){U=e}var qn=null;function Jn(e){H!==null&&(H.f&2097152||H.f&2)&&(qn??=new Set).add(e)}var Yn=null,Xn=0,Zn=null;function Qn(e){Zn=e}var $n=1,er=0,tr=er;function nr(e){tr=e}function rr(){return++$n}function ir(e){var t=e.f;if(t&2048)return!0;if(t&4096){for(var n=e.deps,r=n.length,i=0;ie.wv)return!0}t&512&&Ct===null&&et(e,v)}return!1}function ar(e,t,n=!0){var r=e.reactions;if(r!==null&&!(qn!==null&&qn.has(e)))for(var i=0;i{e.ac.abort(de)}),e.ac=null);try{e.f|=D;var u=e.fn,d=u();e.f|=C;var f=sr(e);if(Je()&&Zn!==null&&!Wn&&f!==null&&!(e.f&6146))for(var p=0;p0)for(t.length=Xn+Yn.length,r=0;r{s.ac.abort(de),s.ac=null,et(s,y)}),yt(s),lr(s,0)}}function lr(e,t){var n=e.deps;if(n!==null)for(var r=t;rn?.call(this,e))}return e.startsWith(`pointer`)||e.startsWith(`touch`)||e===`wheel`?(i.__removed=!1,Ze(()=>{i.__removed||t.addEventListener(e,i,r)})):t.addEventListener(e,i,r),i}function Cr(e,t,n,r,i){var a={capture:r,passive:i},o=Sr(e,t,n,a);(t===document.body||t===window||t===document||t instanceof HTMLMediaElement)&&yn(()=>{o.__removed=!0,t.removeEventListener(e,o,a)})}function G(e,t,n){(t[yr]??={})[e]=n}function wr(e){for(var t=0;t{Er=!1,Tr=null}));var s=0,c=Tr===e&&e[yr];if(c){var l=a.indexOf(c);if(l!==-1&&(t===document||t===window)){e[yr]=t;return}var u=a.indexOf(t);if(u===-1)return;l<=u&&(s=l)}if(o=a[s]||e.target,o!==t){i(e,`currentTarget`,{configurable:!0,get(){return o||n}});var d=H,f=U;Gn(null),Kn(null);try{for(var p,m=[];o!==null&&o!==t;){try{var h=o[yr]?.[r];h!=null&&(!o.disabled||e.target===o)&&h.call(o,e)}catch(e){p?m.push(e):p=e}if(e.cancelBubble)break;s++,o=s{throw e});throw p}}finally{e[yr]=t,delete e.currentTarget,Gn(d),Kn(f)}}}var Or=globalThis?.window?.trustedTypes&&globalThis.window.trustedTypes.createPolicy(`svelte-trusted-html`,{createHTML:e=>e});function kr(e){return Or?.createHTML(e)??e}function Ar(e){var t=dn(`template`);return t.innerHTML=kr(e.replaceAll(``,``)),t.content}function jr(e,t){var n=U;n.nodes===null&&(n.nodes={start:e,end:t,a:null,t:null})}function K(e,t){var n=!!(t&1),r=!!(t&2),i,a=!e.startsWith(``);return()=>{if(A)return jr(j,null),j;i===void 0&&(i=Ar(a?e:``+e),n||(i=sn(i)));var t=r||tn?document.importNode(i,!0):i.cloneNode(!0);if(n){var o=sn(t),s=t.lastChild;jr(o,s)}else jr(t,t);return t}}function Mr(e,t,n=`svg`){var r=!e.startsWith(``),i=!!(t&1),a=`<${n}>${r?e:``+e}`,o;return()=>{if(A)return jr(j,null),j;if(!o){var e=sn(Ar(a));if(i)for(o=document.createDocumentFragment();sn(e);)o.appendChild(sn(e));else o=sn(e)}var t=o.cloneNode(!0);if(i){var n=sn(t),r=t.lastChild;jr(n,r)}else jr(t,t);return t}}function Nr(e,t){return Mr(e,t,`svg`)}function Pr(e=``){if(!A){var t=on(e+``);return jr(t,t),t}var n=j;return n.nodeType===3?fn(n):(n.before(n=on()),xe(n)),jr(n,n),n}function Fr(){if(A)return jr(j,null),j;var e=document.createDocumentFragment(),t=document.createComment(``),n=on();return e.append(t,n),jr(t,n),e}function q(e,t){if(A){var n=U;(!(n.f&32768)||n.nodes.end===null)&&(n.nodes.end=j),Se();return}e!==null&&e.before(t)}function Ir(){if(A&&j&&j.nodeType===8&&j.textContent?.startsWith(`$`)){let e=j.textContent.substring(1);return Se(),e}return(window.__svelte??={}).uid??=1,`c${window.__svelte.uid++}`}function Lr(e){let t=0,n=Ht(0),r;return()=>{vn()&&(W(n),En(()=>(t===0&&(r=mr(()=>e(()=>Yt(n)))),t+=1,()=>{Ze(()=>{--t,t===0&&(r?.(),r=void 0,Yt(n))})})))}}var Rr=ee|T;function zr(e,t,n,r){new Br(e,t,n,r)}var Br=class{parent;is_pending=!1;transform_error;#e;#t=A?j:null;#n;#r;#i;#a=null;#o=null;#s=null;#c=null;#l=0;#u=0;#d=!1;#f=new Set;#p=new Set;#m=null;#h=Lr(()=>(this.#m=Ht(this.#l),()=>{this.#m=null}));constructor(e,t,n,r){this.#e=e,this.#n=t,this.#r=e=>{var t=U;t.b=this,t.f|=128,n(e)},this.parent=U.b,this.transform_error=r??this.parent?.transform_error??(e=>e),this.#i=Dn(()=>{if(A){let e=this.#t;Se();let t=e.data===`[!`;if(e.data.startsWith(`[?`)){let t=JSON.parse(e.data.slice(2));this.#_(t)}else t?this.#y():this.#g()}else this.#b()},Rr),A&&(this.#e=j)}#g(){try{this.#a=On(()=>this.#r(this.#e))}catch(e){this.error(e)}}#_(e){let t=this.#n.failed,{reset:n,invoke_onerror:r}=this.#v(e);Ze(r),t&&(this.#s=On(()=>{t(this.#e,()=>e,()=>n)}))}#v(e){var t=!1,n=!1;let r=()=>{if(t){ye();return}t=!0,n&&Be(),this.#s!==null&&Fn(this.#s,()=>{this.#s=null}),this.#S(()=>{this.#b()})};return{reset:r,invoke_onerror:()=>{try{n=!0,this.#n.onerror?.(e,r),n=!1}catch(e){mn(e,this.#i&&this.#i.parent)}}}}#y(){let e=this.#n.pending;e&&(this.is_pending=!0,this.#o=On(()=>e(this.#e)),Ze(()=>{var e=this.#c=document.createDocumentFragment(),t=on(),n=!1;if(e.append(t),this.#a=this.#S(()=>{try{return On(()=>this.#r(t))}catch(e){try{this.error(e),n=!0}catch(e){mn(e,this.#i.parent)}return null}}),this.#a===null){this.#c=null,n&&this.#x(P);return}this.#u===0&&(this.#e.before(e),this.#c=null,Fn(this.#o,()=>{this.#o=null}),this.#x(P))}))}#b(){try{if(this.is_pending=this.has_pending_snippet(),this.#u=0,this.#l=0,this.#a=On(()=>{this.#r(this.#e)}),this.#u>0){var e=this.#c=document.createDocumentFragment();zn(this.#a,e);let t=this.#n.pending;this.#o=On(()=>t(this.#e))}else this.#x(P)}catch(e){this.error(e)}}#x(e){this.is_pending=!1,e.transfer_effects(this.#f,this.#p)}defer_effect(e){nt(e,this.#f,this.#p)}is_rendered(){return!this.is_pending&&(!this.parent||this.parent.is_rendered())}has_pending_snippet(){return!!this.#n.pending}#S(e){var t=U,n=H,r=Ue;Kn(this.#i),Gn(this.#i),We(this.#i.ctx);try{return jt.ensure(),e()}finally{Kn(t),Gn(n),We(r)}}#C(e,t){if(!this.has_pending_snippet()){this.parent&&this.parent.#C(e,t);return}this.#u+=e,this.#u===0&&(this.#x(t),this.#o&&Fn(this.#o,()=>{this.#o=null}),this.#c&&=(this.#e.before(this.#c),null))}update_pending_count(e,t){this.#C(e,t),this.#l+=e,!(!this.#m||this.#d)&&(this.#d=!0,Ze(()=>{this.#d=!1,this.#m&&Kt(this.#m,this.#l)}))}get_effect_pending(){return this.#h(),W(this.#m)}error(e){if(!this.#n.onerror&&!this.#n.failed)throw e;P?.is_fork?(this.#a&&P.skip_effect(this.#a),this.#o&&P.skip_effect(this.#o),this.#s&&P.skip_effect(this.#s),P.oncommit(()=>{this.#w(e)})):this.#w(e)}#w(e){this.#a&&=(Mn(this.#a),null),this.#o&&=(Mn(this.#o),null),this.#s&&=(Mn(this.#s),null),A&&(xe(this.#t),Ce(),xe(we()));let t=this.#n.failed,n=e=>{let{reset:n,invoke_onerror:r}=this.#v(e);r(),t&&(this.#s=this.#S(()=>{try{return On(()=>{var r=U;r.b=this,r.f|=128,t(this.#e,()=>e,()=>n)})}catch(e){return mn(e,this.#i.parent),null}}))};Ze(()=>{var t;try{t=this.transform_error(e)}catch(e){mn(e,this.#i&&this.#i.parent);return}typeof t==`object`&&t&&typeof t.then==`function`?t.then(n,e=>mn(e,this.#i&&this.#i.parent)):n(t)})}};function J(e,t){var n=t==null?``:typeof t==`object`?`${t}`:t;n!==(e[le]??=e.nodeValue)&&(e[le]=n,e.nodeValue=`${n}`)}function Vr(e,t){return Ur(e,t)}var Hr=new Map;function Ur(e,{target:t,anchor:n,props:i={},events:a,context:o,intro:s=!0,transformError:c}){an();var l=void 0,u=Cn(()=>{var s=n??t.appendChild(on());zr(s,{pending:()=>{}},t=>{Ge({});var n=Ue;if(o&&(n.c=o),a&&(i.$$events=a),A&&jr(t,null),l=e(t,i)||qe(),A&&(U.nodes.end=j,j===null||j.nodeType!==8||j.data!==`]`))throw _e(),pe;Ke()},c);var u=new Set,d=e=>{for(var n=0;n{for(var e of u)for(let n of[t,document]){var r=Hr.get(n),i=r.get(e);--i==0?(n.removeEventListener(e,Dr),r.delete(e),r.size===0&&Hr.delete(n)):r.set(e,i)}xr.delete(d),s!==n&&s.parentNode?.removeChild(s)}});return Wr.set(l,u),l}var Wr=new WeakMap,Gr=class{anchor;#e=new Map;#t=new Map;#n=new Map;#r=new Set;#i=!0;constructor(e,t=!0){this.anchor=e,this.#i=t}#a=e=>{if(this.#e.has(e)){var t=this.#e.get(e),n=this.#t.get(t);if(n)Ln(n),this.#r.delete(t);else{var r=this.#n.get(t);r&&(Ln(r.effect),this.#t.set(t,r.effect),this.#n.delete(t),r.fragment.lastChild.remove(),this.anchor.before(r.fragment),n=r.effect)}for(let[t,n]of this.#e){if(this.#e.delete(t),t===e)break;let r=this.#n.get(n);r&&(Mn(r.effect),this.#n.delete(n))}for(let[e,r]of this.#t){if(e===t||this.#r.has(e))continue;let i=()=>{if(Array.from(this.#e.values()).includes(e)){var t=document.createDocumentFragment();zn(r,t),t.append(on()),this.#n.set(e,{effect:r,fragment:t})}else Mn(r);this.#r.delete(e),this.#t.delete(e)};this.#i||!n?(this.#r.add(e),Fn(r,i,!1)):i()}}};#o=e=>{this.#e.delete(e);let t=Array.from(this.#e.values());for(let[e,n]of this.#n)t.includes(e)||(Mn(n.effect),this.#n.delete(e))};ensure(e,t){var n=P,r=un();if(t&&!this.#t.has(e)&&!this.#n.has(e)){if(r){var i=document.createDocumentFragment(),a=on();i.append(a),this.#n.set(e,{effect:On(()=>t(a)),fragment:i})}else this.#t.set(e,On(()=>t(this.anchor)))}if(this.#e.set(n,e),r){for(let[t,r]of this.#t)t===e?n.unskip_effect(r):n.skip_effect(r);for(let[t,r]of this.#n)t===e?n.unskip_effect(r.effect):n.skip_effect(r.effect);n.oncommit(this.#a),n.ondiscard(this.#o)}else A&&(this.anchor=j),this.#a(n)}};function Y(e,t,n=!1){var r;A&&(r=j,Se());var i=new Gr(e),a=n?ee:0;function o(e,t){if(A){var n=Te(r);if(e!==parseInt(n.substring(1))){var a=we();xe(a),i.anchor=a,be(!1),i.ensure(e,t),be(!0);return}}i.ensure(e,t)}Dn(()=>{var e=!1;t((t,n=0)=>{e=!0,o(n,t)}),e||o(-1,null)},a)}var Kr=Symbol(`NaN`);function qr(e,t,n){A&&Se();var r=new Gr(e),i=!Je();Dn(()=>{var e=t();e!==e&&(e=Kr),i&&typeof e==`object`&&e&&(e={}),r.ensure(e,n)})}function Jr(e,t){return t}function Yr(e,t,n){for(var i=[],a=t.length,o,s=t.length,c=0;c{if(o){if(o.pending.delete(n),o.done.add(n),o.pending.size===0){var t=e.outrogroups;Xr(e,r(o.done)),t.delete(o),t.size===0&&(e.outrogroups=null)}}else--s},!1)}if(s===0){var l=i.length===0&&n!==null&&e.pending.size===0;if(l){var u=n,d=u.parentNode;ln(d),d.append(u),e.items.clear()}Xr(e,t,!l)}else o={pending:new Set(t),done:new Set},(e.outrogroups??=new Set).add(o)}function Xr(e,t,n=!0){var r;if(e.pending.size>0){r=new Set;for(let t of e.pending.values())for(let n of t)r.add(e.items.get(n).e)}for(var i=0;i{var t=i();return e(t)?t:t==null?[]:r(t)}),p,m=new Map,h=!0;function g(e){v.effect.f&16384||(v.pending.delete(e),v.fallback=d,$r(v,p,c,n,a),d!==null&&(p.length===0?d.f&33554432?(d.f^=E,ti(d,null,c)):Ln(d):Fn(d,()=>{d=null})))}function _(e){v.pending.delete(e)}var v={effect:Dn(()=>{p=W(f);var e=p.length;let t=!1;A&&Te(c)===`[!`!=(e===0)&&(c=we(),xe(c),be(!1),t=!0);for(var r=new Set,u=P,v=un(),y=0;ys(c)):(d=On(()=>s(Zr??=on())),d.f|=E)),e>r.size&&je(``,``,``),A&&e>0&&xe(we()),!h){if(m.set(u,r),v){for(let[e,t]of l)r.has(e)||u.skip_effect(t.e);u.oncommit(g),u.ondiscard(_)}else g(u)}t&&be(!0),W(f)}),flags:n,items:l,pending:m,outrogroups:null,fallback:d};h=!1,A&&(c=j)}function Qr(e){for(;e!==null&&!(e.f&32);)e=e.next;return e}function $r(e,t,n,i,a){var o=!!(i&8),s=t.length,c=e.items,l=Qr(e.effect.first),u,d=null,f,p=[],m=[],h,g,_,v;if(o)for(v=0;v0){var T=i&4&&s===0?n:null;if(o){for(v=0;v{if(f!==void 0)for(_ of f)_.nodes?.a?.apply()})}function ei(e,t,n,r,i,a,o,s){var c=o&1?o&16?Ht(n):Ut(n,!1,!1):null,l=o&2?Ht(i):null;return{v:c,i:l,e:On(()=>(a(t,c??n,l??i,s),()=>{e.delete(r)}))}}function ti(e,t,n){if(e.nodes)for(var r=e.nodes.start,i=e.nodes.end,a=t&&!(t.f&33554432)?t.nodes.start:n;r!==null;){var o=cn(r);if(a.before(r),r===i)return;r=o}}function ni(e,t,n){t===null?e.effect.first=n:t.next=n,n===null?e.effect.last=t:n.prev=t}function ri(e,t,n){var r;A&&(r=j,Se());var i=new Gr(e);Dn(()=>{var e=t()??null;if(A&&Te(r)===`[`!=(e!==null)){var a=we();xe(a),i.anchor=a,be(!1),i.ensure(e,e&&(t=>n(t,e))),be(!0);return}i.ensure(e,e&&(t=>n(t,e)))},ee)}var ii=[...` -\r\f\xA0\v`];function ai(e,t,n){var r=e==null?``:``+e;if(t&&(r=r?r+` `+t:t),n){for(var i of Object.keys(n))if(n[i])r=r?r+` `+i:i;else if(r.length)for(var a=i.length,o=0;(o=r.indexOf(i,o))>=0;){var s=o+a;(o===0||ii.includes(r[o-1]))&&(s===r.length||ii.includes(r[s]))?r=(o===0?``:r.substring(0,o))+r.substring(s+1):o=s}}return r===``?null:r}function oi(e,t=!1){var n=t?` !important;`:`;`,r=``;for(var i of Object.keys(e)){var a=e[i];a!=null&&a!==``&&(r+=` `+i+`: `+a+n)}return r}function si(e){return e[0]!==`-`||e[1]!==`-`?e.toLowerCase():e}function ci(e,t){if(t){var n=``,r,i;if(Array.isArray(t)?(r=t[0],i=t[1]):r=t,e){e=String(e).replaceAll(/\/\*.*?\*\//g,``).trim();var a=!1,o=0,s=!1,c=[];r&&c.push(...Object.keys(r).map(si)),i&&c.push(...Object.keys(i).map(si));var l=0,u=-1;let t=e.length;for(var d=0;d{t.every(vi)||(`__defaultValue`in e&&pi(e,!1),`__value`in e&&mi(e,e.__value))});t.observe(e,{childList:!0,subtree:!0,attributes:!0,attributeFilter:[`value`]}),yn(()=>{t.disconnect()})}function gi(e,t,n=t){var r=new WeakSet,i=!0;st(e,`change`,t=>{var i=t?`[selected]`:`:checked`,a;if(e.multiple)a=[].map.call(e.querySelectorAll(i),_i);else{var o=e.querySelector(i)??e.querySelector(`option:not([disabled])`);a=o&&_i(o)}n(a),e.__value=a,P!==null&&r.add(P)}),wn(()=>{var a=t();if(e===document.activeElement){var o=P;if(r.has(o))return}if(mi(e,a,i),i&&a===void 0){var s=e.querySelector(`:checked`);s!==null&&(a=_i(s),n(a))}e.__value=a,i=!1})}function _i(e){return`__value`in e?e.__value:e.value}function vi(e){if(e.target.closest(`selectedcontent`)!==null)return!0;if(e.type===`childList`){var t=[...e.addedNodes,...e.removedNodes];return t.length>0&&t.every(e=>e.nodeName===`SELECTEDCONTENT`)}return!1}var yi=Symbol(`is custom element`),bi=Symbol(`is html`),xi=fe?`link`:`LINK`;function Si(e){if(A){var t=!1,n=()=>{if(!t){if(t=!0,e.hasAttribute(`value`)){var n=e.value;Z(e,`value`,null),e.value=n}if(e.hasAttribute(`checked`)){var r=e.checked;Z(e,`checked`,null),e.checked=r}}};e[ue]=n,Ze(n),at()}}function Ci(e,t){var n=wi(e);n.checked!==(n.checked=t??void 0)&&(e.checked=t)}function Z(e,t,n,r){var i=wi(e);A&&(i[t]=e.getAttribute(t),t===`src`||t===`srcset`||t===`href`&&e.nodeName===xi)||i[t]!==(i[t]=n)&&(t===`loading`&&(e[ae]=n),n==null?e.removeAttribute(t):typeof n!=`string`&&Ei(e).has(t)?e[t]=n:e.setAttribute(t,n))}function wi(e){return e[oe]??={[yi]:e.nodeName.includes(`-`),[bi]:e.namespaceURI===he}}var Ti=new Map;function Ei(e){var t=e.getAttribute(`is`)||e.nodeName,n=Ti.get(t);if(n)return n;Ti.set(t,n=new Set);for(var r,i=e,a=Element.prototype;a!==i;){for(var s in r=o(i),r)r[s].set&&s!==`innerHTML`&&s!==`textContent`&&s!==`innerText`&&n.add(s);i=l(i)}return n}function Di(e,t,n=t){var r=new WeakSet;st(e,`input`,async i=>{var a=i?e.defaultValue:e.value;if(a=Mi(e)?Ni(a):a,n(a),P!==null&&r.add(P),await dr(),a!==(a=t())){var o=e.selectionStart,s=e.selectionEnd,c=e.value.length;if(e.value=a??``,s!==null){var l=e.value.length;o===s&&s===c&&l>c?(e.selectionStart=l,e.selectionEnd=l):(e.selectionStart=o,e.selectionEnd=Math.min(s,l))}}}),(A&&e.defaultValue!==e.value||mr(t)==null&&e.value)&&(n(Mi(e)?Ni(e.value):e.value),P!==null&&r.add(P)),En(()=>{var n=t();if(e===document.activeElement){var i=P;if(r.has(i))return}Mi(e)&&n===Ni(e.value)||(e.type!==`date`||n||e.value)&&n!==e.value&&(e.value=n??``)})}var Oi=new Set;function ki(e,t,n,r,i=r){var a=n.getAttribute(`type`)===`checkbox`,o=e;let s=!1;if(t!==null)for(var c of t)o=o[c]??=[];o.push(n),st(n,`change`,()=>{var e=n.__value;a&&(e=ji(o,e,n.checked)),i(e)},()=>i(a?[]:null)),En(()=>{var e=r();if(A&&n.defaultChecked!==n.checked){s=!0;return}a?(e||=[],n.checked=e.includes(n.__value)):n.checked=$t(n.__value,e)}),yn(()=>{var e=o.indexOf(n);e!==-1&&o.splice(e,1)}),Oi.has(o)||(Oi.add(o),Ze(()=>{o.sort((e,t)=>e.compareDocumentPosition(t)===4?-1:1),Oi.delete(o)})),Ze(()=>{if(s){var e=a?ji(o,e,n.checked):o.find(e=>e.checked)?.__value;i(e)}})}function Ai(e,t,n=t){st(e,`change`,t=>{n(t?e.defaultChecked:e.checked)}),(A&&e.defaultChecked!==e.checked||mr(t)==null)&&n(e.checked),En(()=>{e.checked=!!t()})}function ji(e,t,n){for(var r=new Set,i=0;i{var n=this.#e.get(e);n.delete(t),n.size===0&&(this.#e.delete(e),this.#t.unobserve(e))}}#r(){return this.#t??=new ResizeObserver(t=>{for(var n of t){e.entries.set(n.target,n);for(var r of this.#e.get(n.target)||[])r(n)}})}}({box:`border-box`});function Fi(e,t,n){var r=Pi.observe(e,()=>n(e[t]));wn(()=>(mr(()=>n(e[t])),r))}function Ii(e,t){return e===t||e?.[k]===t}function Li(e=qe(),t,n,r){var i=Ue.r,a=U;return wn(()=>{var o,s;return En(()=>{o=s,s=r?.()||[],mr(()=>{Ii(n(...s),e)||(t(e,...s),o&&Ii(n(...o),e)&&t(null,...o))})}),()=>{let r=a;for(;r!==i&&r.parent!==null&&r.parent.f&33554432;)r=r.parent;let o=()=>{s&&Ii(n(...s),e)&&t(null,...s)},c=r.teardown;r.teardown=()=>{o(),c?.()}}}),e}function Ri(e,t,n,r,i){var a=()=>{r(n[e])};n.addEventListener(t,a),i?En(()=>{n[e]=i()}):a(),(n===document.body||n===window||n===document)&&yn(()=>{n.removeEventListener(t,a)})}function zi(e=!1){let t=Ue,n=t.l.u;if(!n)return;let r=()=>hr(t.s);if(e){let e=0,n={},i=ft(()=>{let r=!1,i=t.s;for(let e in i)i[e]!==n[e]&&(n[e]=i[e],r=!0);return r&&e++,e});r=()=>W(i)}n.b.length&&Sn(()=>{Bi(t,r),m(n.b)}),bn(()=>{let e=mr(()=>n.m.map(p));return()=>{for(let t of e)typeof t==`function`&&t()}}),n.a.length&&bn(()=>{Bi(t,r),m(n.a)})}function Bi(e,t){if(e.l.s)for(let t of e.l.s)W(t);t()}var Vi=!1;function Hi(e){var t=Vi;try{return Vi=!1,[e(),Vi]}finally{Vi=t}}var Ui={get(e,t){let n=e.props.length;for(;n--;){let r=e.props[n];if(d(r)&&(r=r()),typeof r==`object`&&r&&t in r)return r[t]}},set(e,t,n){let r=e.props.length;for(;r--;){let i=e.props[r];d(i)&&(i=i());let o=a(i,t);if(o&&o.set)return o.set(n),!0}return!1},getOwnPropertyDescriptor(e,t){let n=e.props.length;for(;n--;){let r=e.props[n];if(d(r)&&(r=r()),typeof r==`object`&&r&&t in r){let e=a(r,t);return e&&!e.configurable&&(e.configurable=!0),e}}},has(e,t){if(t===k||t===ie)return!1;for(let n of e.props)if(d(n)&&(n=n()),n!=null&&t in n)return!0;return!1},ownKeys(e){let t=[];for(let n of e.props)if(d(n)&&(n=n()),n){for(let e in n)t.includes(e)||t.push(e);for(let e of Object.getOwnPropertySymbols(n))t.includes(e)||t.push(e)}return t}};function Wi(...e){return new Proxy({props:e},Ui)}function Q(e,t,n,r){var i=!Ve||!!(n&2),o=!!(n&8),s=!!(n&16),c=r,l=!0,u=void 0,d=()=>s&&i?(u??=ft(r),W(u)):(l&&(l=!1,c=s?mr(r):r),c);let f;if(o){var p=k in e||ie in e;f=a(e,t)?.set??(p&&t in e?n=>e[t]=n:void 0)}var m,h=!1;o?[m,h]=Hi(()=>e[t]):m=e[t],m===void 0&&r!==void 0&&(m=d(),f&&(i&&Ie(t),f(m)));var g=i?()=>{var n=e[t];return n===void 0?d():(l=!0,n)}:()=>{var n=e[t];return n!==void 0&&(c=void 0),n===void 0?c:n};if(i&&!(n&4))return g;if(f){var _=e.$$legacy;return(function(e,t){return arguments.length>0?((!i||!t||_||h)&&f(t?g():e),e):g()})}var v=!1,y=(n&1?ft:ht)(()=>(v=!1,g()));o&&W(y);var b=U;return(function(e,t){if(arguments.length>0){let n=t?W(y):i&&o?Zt(e):e;return I(y,n),v=!0,c!==void 0&&(c=n),e}return Hn&&v||b.f&16384?y.v:W(y)})}function Gi(e){Ue===null&&ke(`onMount`),Ve&&Ue.l!==null?qi(Ue).m.push(e):bn(()=>{let t=mr(e);if(typeof t==`function`)return t})}function Ki(e){Ue===null&&ke(`onDestroy`),Gi(()=>()=>mr(e))}function qi(e){var t=e.l;return t.u??={a:[],b:[],m:[]}}typeof window<`u`&&((window.__svelte??={}).v??=new Set).add(`5`);function Ji(e,t){if(e instanceof RegExp)return{keys:!1,pattern:e};var n,r,i,a,o=[],s=``,c=e.split(`/`);for(c[0]||c.shift();i=c.shift();)n=i[0],n===`*`?(o.push(`wild`),s+=`/(.*)`):n===`:`?(r=i.indexOf(`?`,1),a=i.indexOf(`.`,1),o.push(i.substring(1,~r?r:~a?a:i.length)),s+=~r&&!~a?`(?:/([^/]+?))?`:`/([^/]+?)`,~a&&(s+=(~r?`?`:``)+`\\`+i.substring(a))):s+=`/`+i;return{keys:o,pattern:RegExp(`^`+s+(t?`(?=$|/)`:`/?$`),`i`)}}var Yi=new class{#e=F(Xi());get _loc(){return W(this.#e)}set _loc(e){I(this.#e,e)}#t=N(()=>this._loc.location);get _location(){return W(this.#t)}set _location(e){I(this.#t,e)}#n=N(()=>this._loc.querystring);get _querystring(){return W(this.#n)}set _querystring(e){I(this.#n,e)}#r=F(void 0);get _params(){return W(this.#r)}set _params(e){I(this.#r,e)}get loc(){return this._loc}get location(){return this._location}get querystring(){return this._querystring}get params(){return this._params}constructor(){typeof window<`u`?window.addEventListener(`hashchange`,()=>{this._loc=Xi()}):console.warn(`[svelte-spa-router] window 'window' is not defined, skipping initiation`)}};function Xi(){let e=typeof window<`u`?window.location.href:``,t=e.indexOf(`#/`),n=t>-1?e.substr(t+1):`/`,r=n.indexOf(`?`),i=``;return r>-1&&(i=n.substr(r+1),n=n.substr(0,r)),{location:n,querystring:i}}async function Zi(e){if(!e||e.length<1||e.charAt(0)!=`/`&&e.indexOf(`#/`)!==0)throw Error(`Invalid parameter location`);await dr();let t=(e.charAt(0)==`#`?``:`#`)+e;try{let e={...history.state};delete e.__svelte_spa_router_scrollX,delete e.__svelte_spa_router_scrollY,window.history.replaceState(e,``,t)}catch{console.warn("Caught exception while replacing the current page. If you're running this in the Svelte REPL, please note that the `replace` method might not work in this environment.")}window.dispatchEvent(new Event(`hashchange`))}function Qi(e){e?window.scrollTo(e.__svelte_spa_router_scrollX||0,e.__svelte_spa_router_scrollY||0):window.scrollTo(0,0)}function $i(e,t){Ge(t,!0);let n=Q(t,`routes`,19,()=>({})),r=Q(t,`prefix`,3,``),i=Q(t,`restoreScrollState`,3,!1),a=Q(t,`onConditionsFailed`,3,()=>{}),o=Q(t,`onRouteLoaded`,3,()=>{}),s=Q(t,`onRouteLoading`,3,()=>{}),c=Q(t,`onRouteEvent`,3,()=>{});class l{path;component;conditions;userData;props;_pattern;_keys;constructor(e,t){let n=e=>typeof e==`object`&&!!e&&e._sveltesparouter===!0;if(!t||typeof t!=`function`&&!n(t))throw Error(`Invalid component object`);if(!e||typeof e==`string`&&(e.length<1||e.charAt(0)!=`/`&&e.charAt(0)!=`*`)||typeof e==`object`&&!(e instanceof RegExp))throw Error(`Invalid value for "path" argument - strings must start with / or *`);let r=Ji(e);if(this.path=e,n(t)){let e=t;this.component=e.component,this.conditions=e.conditions||[],this.userData=e.userData,this.props=e.props||{}}else{let e=t;this.component=()=>Promise.resolve(e),this.conditions=[],this.props={}}this._pattern=r.pattern,this._keys=r.keys}match(e){if(r()){if(typeof r()==`string`){if(e.startsWith(r()))e=e.substr(r().length)||`/`;else return null}else if(r()instanceof RegExp){let t=e.match(r());if(t&&t[0])e=e.substr(t[0].length)||`/`;else return null}}let t=this._pattern.exec(e);if(t===null)return null;if(this._keys===!1)return t;let n={},i=0;for(;i{u.push(new l(t,e))}):Object.keys(n()).forEach(e=>{let t=n();u.push(new l(e,t[e]))});let d=F(null),f=F(null),p=F({}),m=null,h=null;bn(()=>{history.scrollRestoration=i()?`manual`:`auto`}),bn(()=>{if(!i())return;let e=e=>{m=e.state&&(e.state.__svelte_spa_router_scrollY||e.state.__svelte_spa_router_scrollX)?e.state:null};return window.addEventListener(`popstate`,e),()=>window.removeEventListener(`popstate`,e)});async function g(e,t){await dr(),e(t)}bn(()=>{let e=Yi.loc,t=!1;return mr(async()=>{let n=0;for(;n{t=!0}});function _(e){return e&&typeof e==`object`&&Object.keys(e).length?e:null}var v=Fr(),y=R(v),b=e=>{let t=N(()=>W(d));var n=Fr(),r=R(n),i=e=>{var n=Fr();ri(R(n),()=>W(t),(e,t)=>{t(e,Wi({get params(){return W(f)},get onRouteEvent(){return c()}},()=>W(p)))}),q(e,n)},a=e=>{var n=Fr();ri(R(n),()=>W(t),(e,t)=>{t(e,Wi({get onRouteEvent(){return c()}},()=>W(p)))}),q(e,n)};Y(r,e=>{W(f)?e(i):e(a,-1)}),q(e,n)};Y(y,e=>{W(d)&&e(b)}),q(e,v),Ke()}var ea=[`bars`,`pace`,`pie`,`fuel`,`resets`,`thresholds`];function ta(e){return e===`zone`||e===`consumption-pace`?`pace`:typeof e==`string`&&ea.includes(e)?e:`bars`}var na=`codexometer.web.preferences.v1`,ra={statusLine:null,tab:`quota`,view:`bars`,selected:``,defaultDetail:0,layouts:[]};function ia(){try{let e=JSON.parse(localStorage.getItem(na)||`null`);return!e||typeof e!=`object`?ra:{statusLine:Array.isArray(e.statusLine)?[...new Set(e.statusLine.filter(e=>typeof e==`string`&&e.length<64))].slice(0,32):null,tab:[`quota`,`sessions`,`usage`].includes(e.tab)?e.tab:`quota`,view:ta(e.view),selected:typeof e.selected==`string`?e.selected.slice(0,256):``,defaultDetail:+(e.defaultDetail===1),layouts:Array.isArray(e.layouts)?e.layouts.filter(e=>{if(!e||typeof e!=`object`)return!1;let t=e;return typeof t.id==`string`&&t.id.length<=256&&[0,1,2].includes(t.level)}).slice(-100):[]}}catch{return ra}}var aa=Zt(ia()),oa=Zt({open:!1});function sa(){let e=JSON.stringify(aa);try{localStorage.setItem(na,e)}catch{}}function ca(){return aa.tab===`quota`?`/quota/`+aa.view:`/`+aa.tab}function la(e){return aa.layouts.find(t=>t.id===e)?.level??aa.defaultDetail}function ua(e){aa.defaultDetail=e,aa.layouts=[]}function da(e,t){aa.layouts=[...aa.layouts.filter(t=>t.id!==e),{id:e,level:Math.max(0,Math.min(2,t))}].slice(-100)}var $=Zt({data:null,connected:!1,error:``}),fa=e=>e==null?`Unavailable`:e.toLocaleString(`en-GB`),pa=e=>!e||String(e).startsWith(`0001-`)?`Not yet available`:new Date(typeof e==`number`?e*1e3:e).toLocaleString(`en-GB`),ma=`codexometer.web.session`,ha=class extends Error{},ga;async function _a(e,t,n){if(!ga||!$.connected||!$.data?.control||$.data.sessionsError)throw Error(`Session controls unavailable. Check the live connection.`);return await ga(e,t,n)}function va(){let e=new AbortController,t,n=``;ga=async(t,r,i)=>{let a=await fetch(`/api/control/`+t,{method:`POST`,headers:{Authorization:`Bearer ${n}`,"Content-Type":`application/json`},body:JSON.stringify(r),signal:AbortSignal.any([e.signal,AbortSignal.timeout(8e3),...i?[i]:[]]),cache:`no-store`});if(!a.ok)throw a.status===502?Error(`Outcome uncertain. Check Codex before taking another action; nothing was retried.`):new ha(`Action rejected, expired or changed. Refresh and check Codex; nothing was retried.`);return a.json()};try{n=sessionStorage.getItem(ma)||``}catch{}let r=location.hash,i=r.startsWith(`#pair=`)?r.slice(6):``;(i||!r||r===`#`)&&(history.replaceState(null,``,`/#`+ca()),window.dispatchEvent(new HashChangeEvent(`hashchange`)));async function a(){if(i)try{let t=await fetch(`/api/pair`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({secret:i}),signal:e.signal});if(!t.ok)throw Error(`Pairing link expired or already used. Restart --web for a fresh link.`);n=(await t.json()).token;try{sessionStorage.setItem(ma,n)}catch{}}catch(t){e.signal.aborted||($.error=t instanceof Error?t.message:`Pairing failed`);return}if(!n){$.error=`Open the private pairing link printed by codexometer --web in your terminal.`;return}await o()}async function o(){try{let t=await fetch(`/api/events`,{headers:{Authorization:`Bearer ${n}`},signal:e.signal,cache:`no-store`});if(t.status===401){try{sessionStorage.removeItem(ma)}catch{}$.error=`Browser session expired. Restart --web and open its new pairing link.`;return}if(!t.ok||!t.body)throw Error(`Live connection unavailable`);let r=t.body.getReader(),i=new TextDecoder,a=``;for(;!e.signal.aborted;){let{done:e,value:t}=await r.read();if(e)break;a+=i.decode(t,{stream:!0});let n;for(;(n=a.indexOf(` - -`))>=0;){let e=a.slice(0,n);a=a.slice(n+2),e.startsWith(`data: `)&&($.data=JSON.parse(e.slice(6)),$.connected=!0,$.error=``)}}}catch{}finally{$.connected=!1}e.signal.aborted||($.error=`Connection lost — showing last observation. Reconnecting…`,t=setTimeout(o,2500))}return a(),()=>{ga=void 0,e.abort(),clearTimeout(t),$.connected=!1}}He();var ya=K(`

Quota refresh failed. Policy state is based on the last successful - observation.

`),ba=K(`

`),xa=K(`

The longest Codex quota window selects one active model profile. ASK - creates a per-session review; AUTO applies the profile on the next - eligible check.

`,1),Sa=K(`

No threshold-based model steps were configured at launch.

`);function Ca(e,t){Ge(t,!1),zi();var n=Fr(),r=R(n),i=e=>{var t=xa(),n=R(t),r=z(n),i=B(n,2),a=e=>{q(e,ya())};Y(i,e=>{$.data.quotaError&&e(a)});var o=B(i,2),s=L(o),c=z(s),l=B(s,4);X(l,5,()=>$.data.thresholds,Jr,(e,t)=>{var n=ba();let r;var i=L(n),a=z(i),o=B(i,2),s=L(o),c=z(s,!0),l=z(B(s,2));M(o);var u=B(o,2),d=z(u,!0),f=z(B(u,2));M(n),V((e,i)=>{r=li(n,1,``,null,r,{active:W(t).state===`ACTIVE`,next:W(t).state===`NEXT`}),J(a,`${W(t).threshold??``}%`),J(c,W(t).model),J(l,`${e??``} REASONING // ${i??``} - SPEED`),J(d,W(t).mode),J(f,`${W(t).state??``}${W(t).state===`NEXT`?` // ${W(t).remaining||0} PP TO GO`:``}`)},[()=>W(t).effort.toUpperCase(),()=>W(t).speed.toUpperCase()]),q(e,n)}),M(l),M(o),V(e=>{J(r,`MODEL STEP POLICY // OBSERVED ${e??``}`),J(c,`THRESHOLDS // ${$.data.thresholds.length??``} CONFIGURED`)},[()=>pa($.data.quotaAt)]),q(e,t)},a=e=>{q(e,Sa())};Y(r,e=>{$.data?.thresholds?.length?e(i):e(a,-1)}),q(e,n),Ke()}var wa=Nr(` `,1),Ta=Nr(` `,1),Ea=Nr(` `,1),Da=Nr(` `,1),Oa=K(`
`,1),ka=K(` `),Aa=K(`
Quota observations
Observed atPeriod elapsedConsumedTrail segment
`),ja=K(`
OBSERVATION DATA
`),Ma=K(`
CONSUMPTIONQUOTA PERIOD ELAPSED
`,1);function Na(e,t){let n=Ir();Ge(t,!0);let r=Q(t,`trail`,19,()=>[]),i=F(!1),a=F(!0),o=F(`window`),s=[0,25,50,75,100],c={off:0,halfHour:30,hour:60,day:1440,window:0},l=F(400),u=F(240),d=N(()=>W(l)-24),f=N(()=>W(u)-48),p=N(()=>Math.max(1,W(d)-48)),m=N(()=>Math.max(1,W(f)-20)),h=N(()=>48+Math.max(0,Math.min(100,t.elapsed))/100*W(p));function g(e){return W(f)-(e-0)/100*W(m)}let _=N(()=>g(t.used)),v=N(()=>t.used-t.elapsed),y=N(()=>r().map((e,t)=>`${t===0||e.break?`M`:`L`}${48+e.elapsed/100*W(p)} ${g(e.used)}`).join(` `)),b=N(()=>{let e=0;for(let t=r().length-1;t>0;t--)if(r()[t].break){e=t;break}return r().slice(e)}),x=N(()=>W(b).length<2?0:Math.max(0,Date.parse(W(b).at(-1).at)-Date.parse(W(b)[0].at)));function S(e){if(W(x)Date.parse(e.at)>=t).length>=2}let C=N(()=>({off:!0,halfHour:S(18e5),hour:S(36e5),day:S(864e5),window:Number.isFinite(t.elapsed)&&t.elapsed>0&&Number.isFinite(t.used)}));bn(()=>{W(o)!==`window`&&!W(C)[W(o)]&&I(o,`window`)});function w(e){if(e===`off`||!W(C)[e])return[];let t=c[e]*6e4,n=Date.parse(W(b).at(-1).at)-t,r=W(b).findIndex(e=>Date.parse(e.at)>=n);return r<0?[]:W(b).slice(r)}function ee(e){if(e.length<2)return null;let t=e.reduce((e,t)=>e+t.elapsed,0)/e.length,n=e.reduce((e,t)=>e+t.used,0)/e.length,r=0,i=0;for(let a of e)r+=(a.elapsed-t)*(a.used-n),i+=(a.elapsed-t)**2;return i>0?Math.max(0,r/i):null}let T=N(()=>{let e=W(o)===`window`&&W(C).window?t.used/t.elapsed:ee(w(W(o)));if(e===null||!t.duration)return null;let n=t.used+e*(100-t.elapsed),r=W(o)===`window`?0:t.used-e*t.elapsed,i=e,a=Math.max(0,t.elapsed-c[W(o)]/t.duration*100);W(o)===`window`&&(a=0);let s=100;if(i!==0){let e=(0-r)/i,t=(100-r)/i;a=Math.max(a,Math.min(e,t)),s=Math.min(100,Math.max(e,t))}if(a>s)return null;let l=r+i*a,u=r+i*s,d=Math.hypot((s-a)/100*W(p),(u-l)/100*W(m)),f=Math.max(3,Math.min(9,Math.floor(d/65)+2));return{path:`M${Array.from({length:f},(e,t)=>{let n=a+(s-a)*t/(f-1),r=l+(u-l)*t/(f-1);return`${48+n/100*W(p)} ${g(r)}`}).join(` L`)}`,projected:n,safe:n<=100}}),te=N(()=>{if(W(b).length===0)return`NO OBSERVATIONS`;if(W(b).length===1)return`ONE OBSERVATION`;let e=Math.floor(W(x)/6e4);if(e<60)return`${e} MIN CONTINUOUS`;let t=Math.floor(e/60);return t<24?`${t}H CONTINUOUS`:`${Math.floor(t/24)}D ${t%24}H CONTINUOUS`});var E=Ma(),D=R(E),O=L(D);let ne;var k=L(O),re=L(k),ie=B(re);M(k);var ae=B(k),oe=B(ae);X(oe,17,()=>s,Jr,(e,t)=>{var n=wa(),r=R(n),i=B(r),a=z(i);V(()=>{Z(r,`x1`,48+W(t)/100*W(p)),Z(r,`x2`,48+W(t)/100*W(p)),Z(r,`y2`,W(f)),Z(i,`x`,48+W(t)/100*W(p)),Z(i,`y`,W(f)+20),J(a,`${W(t)??``}%`)}),q(e,n)});var se=B(oe);X(se,17,()=>s,Jr,(e,t)=>{var n=Ta(),r=R(n),i=B(r),a=z(i);V((e,n,o)=>{Z(r,`y1`,e),Z(r,`x2`,W(d)),Z(r,`y2`,n),Z(i,`y`,o),J(a,`${W(t)??``}%`)},[()=>g(W(t)),()=>g(W(t)),()=>g(W(t))+4]),q(e,n)});var ce=B(se),le=B(ce),ue=B(le),de=e=>{var t=Ea(),n=R(t),i=B(n),a=B(i),o=z(L(a));M(a),V((e,t)=>{Z(n,`d`,W(y)),Z(i,`d`,W(y)),Z(a,`cx`,48+r()[0].elapsed/100*W(p)),Z(a,`cy`,e),J(o,`First observation: ${t??``}`)},[()=>g(r()[0].used),()=>pa(r()[0].at)]),q(e,t)};Y(ue,e=>{W(a)&&r().length&&e(de)});var fe=B(ue),pe=e=>{var t=Da(),r=R(t),i=B(r),a=z(L(i));M(i),V(e=>{Z(r,`d`,W(T).path),Z(i,`d`,W(T).path),Z(i,`marker-mid`,`url(#${n}-trend-arrow)`),J(a,`${W(o)===`window`?`Window-average pace`:`Recent consumption trajectory`} projects ${e??``}% at reset if continued`)},[()=>W(T).projected.toFixed(1)]),q(e,t)};Y(fe,e=>{W(T)&&e(pe)});var me=B(fe,2),he=B(me),ge=B(he),_e=z(L(ge));M(ge),M(O),M(D);var ve=B(D,2),ye=L(ve),A=L(ye),be=B(A,3),j=z(be,!0),xe=B(be,2),Se=e=>{var t=Oa(),n=z(B(R(t)));V(e=>J(n,`TREND // ${e??``}`),[()=>W(T).projected>=100?`QUOTA EXHAUSTION PROJECTED`:`${W(T).projected.toFixed(1)}% PROJECTED AT RESET`]),q(e,t)};Y(xe,e=>{W(T)&&e(Se)}),M(ye);var we=B(ye,2),Te=L(we),Ee=L(Te);Si(Ee),Ce(),M(Te);var De=B(Te,2),Oe=B(L(De),2),ke=L(Oe);ke.value=ke.__value=`off`;var Ae=B(ke),je=z(Ae);Ae.value=Ae.__value=`halfHour`;var Me=B(Ae),Ne=z(Me);Me.value=Me.__value=`hour`;var Pe=B(Me),Fe=z(Pe);Pe.value=Pe.__value=`day`;var Ie=B(Pe),Le=z(Ie);Ie.value=Ie.__value=`window`,M(Oe),hi(Oe),M(De);var Re=z(B(De,2));M(we),M(ve);var ze=B(ve,2),Be=e=>{var t=ja(),n=B(L(t),2),a=e=>{var t=Aa(),n=L(t),i=B(L(n),2);X(i,21,r,Jr,(e,t,n)=>{var r=ka(),i=L(r),a=L(i),o=z(a,!0);M(i);var s=B(i),c=z(s),l=B(s),u=z(l),d=z(B(l),!0);M(r),V((e,r)=>{Z(a,`datetime`,W(t).at),J(o,e),J(c,`${r??``}%`),J(u,`${W(t).used??``}%`),J(d,n===0?`First observation`:W(t).break?`Gap before this observation`:`Connected to previous observation`)},[()=>pa(W(t).at),()=>W(t).elapsed.toFixed(1)]),q(e,r)}),M(i),M(n),M(t),q(e,t)};Y(n,e=>{W(i)&&e(a)}),M(t),Ri(`open`,`toggle`,t,e=>I(i,e),()=>W(i)),q(e,t)};Y(ze,e=>{r().length&&e(Be)}),V((e,r,i,a,o,s)=>{Z(O,`viewBox`,`0 0 ${W(l)} ${W(u)}`),Z(O,`aria-label`,e),ne=di(O,``,ne,{"--trend-color":W(T)?.safe?`#115b35`:`#7f1825`}),Z(re,`id`,n),Z(ie,`id`,n+`-trend-arrow`),Z(ae,`width`,W(p)),Z(ae,`height`,W(m)),Z(ae,`fill`,`url(#${n})`),Z(ce,`d`,`M48 20 V${W(f)} H${W(d)}`),Z(le,`y1`,r),Z(le,`x2`,W(d)),Z(le,`y2`,i),Z(me,`x`,48+W(p)/2),Z(me,`y`,W(u)-5),Z(he,`cx`,W(h)),Z(he,`cy`,W(_)),Z(ge,`cx`,W(h)),Z(ge,`cy`,W(_)),J(_e,`${t.used??``}% consumed // ${a??``}% of period elapsed`),J(A,`${t.used??``}% USED // ${o??``}% TIME ELAPSED`),J(j,s),Ae.disabled=!W(C).halfHour,J(je,`LAST 30 MINUTES${W(C).halfHour?``:` — UNAVAILABLE`}`),Me.disabled=!W(C).hour,J(Ne,`LAST HOUR${W(C).hour?``:` — UNAVAILABLE`}`),Pe.disabled=!W(C).day,J(Fe,`LAST 24 HOURS${W(C).day?``:` — UNAVAILABLE`}`),Ie.disabled=!W(C).window,J(Le,`FROM WINDOW START${W(C).window?``:` — NO TIME ELAPSED`}`),J(Re,`HISTORY // ${W(te)??``}`)},[()=>`Pace: ${t.used}% consumed, ${t.elapsed.toFixed(1)}% of quota period elapsed. ${W(v)>0?`Above`:W(v)<0?`Below`:`On`} the steady-consumption line.${W(a)&&r().length?` Trace path contains ${r().length} ${r().length===1?`observation`:`observations`}; gaps are not interpolated.`:``}`,()=>g(0),()=>g(100),()=>t.elapsed.toFixed(1),()=>t.elapsed.toFixed(1),()=>Math.abs(W(v))<.05?`ON PACE`:W(v)>0?`ABOVE THE LINE — CONSUMING FASTER THAN TIME`:`BELOW THE LINE — WITHIN PACE`]),Fi(D,`clientWidth`,e=>I(l,e)),Fi(D,`clientHeight`,e=>I(u,e)),Ai(Ee,()=>W(a),e=>I(a,e)),gi(Oe,()=>W(o),e=>I(o,e)),q(e,E),Ke()}var Pa=K(` `),Fa=K(`

Quota refresh failed. Values below are the last successful observation.

`),Ia=K(`

Expiry details unavailable. No listed expiry does not mean no expiry.

`),La=K(`

`),Ra=K(`

Read-only preview. Use the terminal to redeem a reset.

The backend may return only some credits. This list does not establish - redemption order.

`),za=K(` `,1),Ba=Nr(``),Va=Nr(``),Ha=K(`
`),Ua=K(`

Cycle duration or reset date unavailable — position cannot be - plotted.

`),Wa=K(`
EMPTYFULL
`),Ga=K(`

`,1),Ka=K(`
`,1),qa=K(`

`),Ja=K(`

`),Ya=K(`

No quota windows reported yet.

`),Xa=K(`
`,1),Za=K(`

All reported windows are shown. API-equivalent learning and quota status - scoring remain in the terminal for this first preview.

`,1),Qa=K(` `,1);function $a(e,t){Ge(t,!0);let n=Q(t,`params`,19,()=>({})),r=N(()=>ea.filter(e=>e!==`thresholds`||!!$.data?.thresholds?.length)),i=F(Zt(Date.now())),a=N(()=>W(r).includes(ta(n().view))?ta(n().view):`bars`);Gi(()=>{let e=setInterval(()=>I(i,Date.now(),!0),1e3);return()=>clearInterval(e)});function o(e){return!e.duration||e.duration<=0||!e.reset?null:Math.max(0,Math.min(100,100*(1-(e.reset*1e3-W(i))/(e.duration*6e4))))}bn(()=>{aa.view=W(a),(n().view===`zone`||n().view===`consumption-pace`)&&Zi(`/quota/pace`)});function s(e){let t=e/100*Math.PI*2;return`M60 60 L60 14 A46 46 0 ${+(e>50)} 1 ${60+46*Math.sin(t)} ${60-46*Math.cos(t)} Z`}var c=Qa(),l=R(c);X(l,21,()=>W(r),Jr,(e,t)=>{var n=Pa();let r;var i=z(n,!0);V(e=>{Z(n,`href`,`#/quota/`+W(t)),Z(n,`aria-current`,W(a)===W(t)?`page`:void 0),r=li(n,1,``,null,r,{active:W(a)===W(t)}),J(i,e)},[()=>W(t)===`fuel`?`FUEL TANK`:W(t).toUpperCase()]),q(e,n)}),M(l);var u=B(l,2),d=e=>{var t=Za(),n=R(t),r=e=>{q(e,Fa())};Y(n,e=>{$.data.quotaError&&e(r)});var i=B(n,2),c=z(i),l=B(i,2),u=e=>{Ca(e,{})},d=e=>{var t=Ra(),n=L(t),r=z(n),i=B(n,4),a=e=>{q(e,Ia())};Y(i,e=>{$.data.credits.length||e(a)}),X(B(i,2),17,()=>$.data.credits,Jr,(e,t)=>{var n=La(),r=L(n),i=z(r),a=z(B(r,2),!0);M(n),V(e=>{J(i,`${(W(t).title||`Quota reset`)??``} // ${W(t).status??``}`),J(a,e)},[()=>W(t).expiryKnown?W(t).expires?`EXPIRES `+pa(W(t).expires):`Does not expire`:`Expiry information unavailable`]),q(e,n)}),Ce(2),M(t),V(()=>J(r,`RESET INVENTORY // ${$.data.creditCount??``} AVAILABLE`)),q(e,t)},f=e=>{var t=Xa(),n=R(t);let r;X(n,21,()=>$.data.meters,Jr,(e,t)=>{let n=N(()=>o(W(t)));var r=Ja(),i=L(r),c=z(i,!0),l=B(i,2),u=L(l),d=e=>{var n=za(),r=R(n),i=z(r),a=z(B(r));V(()=>{J(i,`FREE ${100-W(t).used}%`),J(a,`USED ${W(t).used??``}%`)}),q(e,n)},f=e=>{var n=za(),r=R(n),i=z(r),a=z(B(r));V(()=>{J(i,`USED ${W(t).used??``}%`),J(a,`FREE ${100-W(t).used}%`)}),q(e,n)};Y(u,e=>{W(a)===`fuel`?e(d):e(f,-1)}),M(l);var p=B(l,2);let m;var h=L(p),g=e=>{var n=Ha(),r=L(n),i=B(L(r)),a=e=>{q(e,Ba())},o=e=>{var n=Va();V(e=>Z(n,`d`,e),[()=>s(W(t).used)]),q(e,n)};Y(i,e=>{W(t).used>=100?e(a):W(t).used>0&&e(o,1)}),M(r),M(n),V(()=>Z(r,`aria-label`,`${W(t).used}% quota used`)),q(e,n)},_=e=>{var r=Fr(),i=R(r),a=e=>{{let r=N(()=>W(t).trail||[]);Na(e,{get used(){return W(t).used},get elapsed(){return W(n)},get trail(){return W(r)},get duration(){return W(t).duration}})}},o=e=>{q(e,Ua())};Y(i,e=>{W(n)===null?e(o,-1):e(a)}),q(e,r)},v=e=>{var r=Ka(),i=R(r),o=L(i);let s;M(i);var c=B(i,2),l=e=>{q(e,Wa())};Y(c,e=>{W(a)===`fuel`&&e(l)});var u=B(c,2),d=e=>{var t=Ga(),r=R(t),i=z(r),o=B(r,2),s=L(o);let c;M(o),V(e=>{J(i,`RESET CYCLE // ${e??``}% ELAPSED`),c=di(s,``,c,{width:`${W(a)===`fuel`?100-W(n):W(n)}%`})},[()=>Math.floor(W(n))]),q(e,t)};Y(u,e=>{W(n)!==null&&e(d)}),V(()=>{Z(i,`aria-label`,W(a)===`fuel`?`Fuel remaining`:`Quota used`),Z(i,`aria-valuenow`,W(a)===`fuel`?100-W(t).used:W(t).used),s=di(o,``,s,{width:`${W(a)===`fuel`?100-W(t).used:W(t).used}%`})}),q(e,r)};Y(h,e=>{W(a)===`pie`?e(g):W(a)===`pace`?e(_,1):e(v,-1)}),M(p);var y=B(p,2),b=z(y),x=B(y,2),S=e=>{var n=qa(),r=z(n,!0);V(()=>J(r,W(t).details)),q(e,n)};Y(x,e=>{W(t).details&&e(S)}),M(r),V(e=>{J(c,W(t).name),m=li(p,1,`meter-graphic`,null,m,{"bar-graphic":W(a)===`bars`||W(a)===`fuel`}),J(b,`RESETS // ${e??``}`)},[()=>pa(W(t).reset)]),q(e,r)}),M(n);var i=B(n,2),c=e=>{q(e,Ya())};Y(i,e=>{$.data.meters.length||e(c)}),V(()=>r=li(n,1,`quota-grid`,null,r,{radial:W(a)===`pie`,zone:W(a)===`pace`})),q(e,t)};Y(l,e=>{W(a)===`thresholds`?e(u):W(a)===`resets`?e(d,1):e(f,-1)}),Ce(2),V(e=>J(c,`QUOTA // OBSERVED ${e??``}`),[()=>pa($.data.quotaAt)]),q(e,t)};Y(u,e=>{$.data&&e(d)}),q(e,c),Ke()}var eo=K(`
`),to=K(`

`,1);function no(e,t){Ge(t,!0);let n=Q(t,`values`,19,()=>[]),r=Q(t,`label`,3,`Token activity`),i=Q(t,`capacity`,3,0),a=N(()=>Math.max(0,...n())),o=N(()=>i()>n().length?[...Array(i()-n().length).fill(0),...n()]:n());var s=to(),c=R(s),l=z(c),u=B(c,2);X(u,21,()=>W(o),Jr,(e,t)=>{var n=eo();let r;V((e,t)=>{Z(n,`title`,e),r=di(n,``,r,{height:t})},[()=>W(t).toLocaleString(`en-GB`)+` tokens`,()=>`${100*W(t)/Math.max(1,W(a))}%`]),q(e,n)}),M(u),V((e,t)=>{J(l,`SCALE // 0 — ${e??``} TOKENS`),Z(u,`aria-label`,t)},[()=>W(a).toLocaleString(`en-GB`),()=>`${r()}. Peak ${W(a).toLocaleString(`en-GB`)} tokens.`]),q(e,s),Ke()}var ro=K(` `),io=K(``),ao=K(`

`),oo=K(`

`,1),so=K(`

`),co=K(`

Loading / sending…

`),lo=K(`
`),uo=K(`

Confirmation expired. Reopen the option.

`),fo=K(`

`,1),po=K(`

 
`),mo=K(`
`),ho=K(`
`),go=K(`

Review expired. Press Enter to review again.

`),_o=K(`

`,1),vo=K(`

↑/↓ select · Enter review · C confirm · Escape cancel

`,1),yo=K(`

No available matching commands.

`),bo=K(`

↑/↓ select · Tab complete · Enter options · Escape dismiss

`),xo=K(` `,1),So=K(` `,1),Co=K(``),wo=K(` `,1),To=K(`
`),Eo=K(`
`);function Do(e,t){let n=Ir();Ge(t,!0);let r=e=>{var t=Fr();X(R(t),19,()=>W(E),e=>e.id,(e,t,r)=>{var i=io();let a;var o=L(i),s=z(o,!0),l=B(o),d=z(l),f=B(l),p=e=>{var n=ro(),r=z(n,!0);V(()=>J(r,W(t).help)),q(e,n)};Y(f,e=>{(W(T)&&W(u)?.path===``||W(C))&&e(p)}),M(i),V(()=>{Z(i,`id`,`${n}-${W(r)}`),Z(i,`role`,W(C)?`option`:void 0),Z(i,`aria-selected`,W(C)?W(_)===W(r):void 0),Z(i,`tabindex`,W(C)?-1:void 0),i.disabled=W(c)||W(O),Z(i,`title`,W(t).help),Z(i,`aria-label`,W(t).label+(W(C)&&W(t).selected?` // CURRENT`:``)+(W(t).next?` →`:W(t).action?``:` // HELP`)),a=li(i,1,`svelte-7bfwr9`,null,a,{suggested:W(_)===W(r)}),J(s,W(t).label),J(d,`${W(C)&&W(t).selected?` // CURRENT`:``}${W(t).next?` →`:W(t).action?``:` // HELP`}`)}),Cr(`focus`,i,()=>{W(C)||k(W(r))}),G(`click`,i,()=>{k(W(r)),oe(W(t))}),q(e,i)}),q(e,t)},i=Q(t,`query`,3,``),a=Q(t,`onchange`,3,()=>{}),o=Q(t,`oncomplete`,3,e=>{}),s=F(!1),c=F(!1),l=F(``),u=F(null),d=F(null),f=F(``),p=F(0),m=F(Zt(Date.now())),h=F(``),g=0,_=F(0),v=F(null),y=F(void 0),b=F(void 0),x=F(void 0),S=F(``),C=N(()=>W(s)&&!!W(u)?.picker&&!W(d)),w=N(()=>W(s)&&!W(u)?.input&&!W(d)),ee=setInterval(()=>{I(m,Date.now(),!0)},1e3);Ki(()=>{clearInterval(ee),g++});let T=N(()=>i().trim().startsWith(`/`)&&!i().trim().startsWith(`//`)),te=N(()=>W(u)?.path===``&&W(T)?i().trim().slice(1).toLowerCase():``),E=N(()=>(W(u)?.choices||[]).filter(e=>!W(te)||e.label.toLowerCase().startsWith(`/`+W(te)))),D=N(()=>W(E).find(e=>e.id===W(S))),O=N(()=>!$.connected||!!$.data?.sessionsError),ne=N(()=>W(s)&&W(T)&&(!W(u)||W(u).path===``)&&!W(d));bn(()=>{i(),I(_,0)}),bn(()=>{let e=W(_);W(E),W(w)&&dr().then(()=>{let t=W(y)?.children[e];if(!t||!W(y))return;let n=W(y).getBoundingClientRect(),r=t.getBoundingClientRect();r.topn.bottom&&(W(y).scrollTop+=r.bottom-n.bottom)})});function k(e){W(_)!==e&&W(u)?.picker&&(I(S,``),I(f,``),I(p,0),I(l,``),g++),I(_,e,!0)}function re(){g++,I(c,!1),I(s,!1),I(v,i()),I(f,``),I(S,``),I(p,0),o()(i())}function ie(e){let t=!!W(b)?.contains(e.target);if(!W(s)||W(u)?.input||!W(w)&&!W(d)||!W(T)&&!t||W(O)||e.isComposing||e.ctrlKey||e.metaKey||e.altKey)return;let n=e.key.toLowerCase()===`c`;if(n&&!t||![`ArrowUp`,`ArrowDown`,`Tab`,`Enter`,`Escape`].includes(e.key)&&!n||e.key===`Tab`&&(W(d)||W(u)?.path!==``||e.shiftKey)||e.key===`Enter`&&e.target instanceof Element&&e.target.closest(`button`)&&!W(y)?.contains(e.target)&&!e.target.closest(`[data-command-confirm]`)||W(d)&&!t||W(d)&&[`ArrowUp`,`ArrowDown`].includes(e.key))return;if(e.preventDefault(),e.stopPropagation(),e.key===`Escape`){re();return}if(W(c)||e.repeat&&n)return;if(n){(W(d)?.action||W(C)&&W(S))&&ce();return}if(W(d))return;if(e.key===`ArrowUp`||e.key===`ArrowDown`){k(Math.min(Math.max(W(_)+(e.key===`ArrowUp`?-1:1),0),Math.max(W(E).length-1,0))),!W(C)&&W(y)?.contains(e.target)&&dr().then(()=>(W(y)?.children[W(_)])?.focus());return}let r=W(E)[W(_)];r&&(e.key===`Tab`?o()(r.label):W(C)?se(r):oe(r))}bn(()=>{W(O)&&(g++,I(c,!1),I(f,``),I(S,``),W(s)&&(I(s,!1),I(v,i())),I(u,null),I(d,null))}),bn(()=>{W(T)&&!W(s)&&i()!==W(v)&&!W(O)&&(I(s,!0),ae(``))});async function ae(e){let n=++g;I(c,!0),I(d,null),I(S,``),I(f,``),I(p,0),I(l,``);try{let r=await _a(`commands`,{session:t.session,command:{mode:`list`,path:e}});n===g&&((e===``||e===`help`)&&r.choices.push({id:`local-statusline`,label:`/statusline`,help:`Choose multiple fields for Codexometer’s detail footer.`,next:`statusline`}),I(u,r,!0),I(_,r.picker?Math.max(r.choices.findIndex(e=>e.selected),0):0,!0),r.picker&&dr().then(()=>W(y)?.focus()),I(h,r.value||``,!0),(r.path.startsWith(`rename/`)||r.path.startsWith(`cd/`))&&r.choices.length===1&&(I(c,!1),oe(r.choices[0])))}catch{n===g&&(I(l,`Command catalogue unavailable. Use Codex.`),(e===``||e===`help`)&&I(u,{title:`/ COMMANDS`,help:`Local display settings remain available.`,path:``,revision:``,choices:[{id:`local-statusline`,label:`/statusline`,help:`Choose multiple fields for Codexometer’s detail footer.`,next:`statusline`}]},!0))}finally{n===g&&I(c,!1)}}async function oe(e){if(W(u)?.picker){k(W(E).findIndex(t=>t.id===e.id)),W(y)?.focus();return}if(e.next===`statusline`){oa.open=!0,I(s,!1),I(v,i());return}if(e.next){await ae(e.next);return}await se(e)}async function se(e){if(W(c)||W(O)||!W(u)||(W(u).picker?I(S,e.id,!0):(I(d,e,!0),dr().then(()=>W(x)?.focus())),I(f,``),I(p,0),I(l,``),!e.action))return;let n=++g;I(c,!0);try{let r=await _a(`commands`,{session:t.session,command:{mode:`prepare`,path:W(u).path,revision:W(u).revision,choice:e.id}});if(n===g){let e=Date.parse(r.expires);if(!r.confirmation||!Number.isFinite(e)||Date.now()>=e)throw Error(`Review confirmation unavailable`);I(f,r.confirmation,!0),I(p,e,!0)}}catch{n===g&&I(l,`Option changed or unavailable. Refresh before retrying.`)}finally{n===g&&I(c,!1)}}async function ce(){if(!W(f)||W(O)||W(c)||Date.now()>=W(p)||!W(u)||W(u).picker&&W(S)!==W(E)[W(_)]?.id)return;let e=W(f);I(f,``),I(c,!0);let n=++g;try{let r=await _a(`commands`,{session:t.session,confirmation:e,command:{mode:`commit`,path:W(u).path}});n===g&&(I(l,r.message,!0),I(s,!1),I(u,null),I(d,null),I(S,``),I(p,0),I(v,null),a()())}catch{n===g&&I(l,`Change unconfirmed. Check Codex before retrying.`)}finally{n===g&&I(c,!1)}}var le={handleKey:ie},ue=Eo(),de=L(ue),fe=B(de,2),pe=e=>{var t=ao(),n=z(t,!0);V(()=>J(n,W(l))),q(e,t)};Y(fe,e=>{W(l)&&!W(s)&&e(pe)});var me=B(fe,2),he=e=>{var i=To();let a;var o=L(i),s=e=>{var t=oo(),n=R(t),r=z(n,!0),i=z(B(n,2),!0);V(()=>{J(r,W(u)?.title||`/ COMMANDS`),J(i,W(u)?.help||`Loading live options…`)}),q(e,t)};Y(o,e=>{W(ne)||e(s)});var v=B(o,2),w=e=>{var t=so(),n=z(t,!0);V(()=>J(n,W(l))),q(e,t)};Y(v,e=>{W(l)&&e(w)});var ee=B(v,2),te=e=>{q(e,co())};Y(ee,e=>{W(c)&&e(te)});var k=B(ee,2),oe=e=>{var t=lo(),n=L(t),r=L(n),i=B(r);Si(i),M(n);var a=B(n,2),o=z(a);M(t),V((e,t)=>{J(r,`${e??``} `),Z(i,`aria-label`,W(u).inputLabel||`Session name`),Z(i,`maxlength`,W(u).inputLimit||512),i.disabled=W(c)||W(O),a.disabled=t,J(o,`REVIEW ${W(u).path===`cd`?`DIRECTORY`:`RENAME`}`)},[()=>(W(u).inputLabel||`Session name`).toUpperCase(),()=>W(c)||W(O)||!W(h).trim()]),Cr(`submit`,t,e=>{e.preventDefault(),W(u)&&W(h).trim()&&!W(c)&&!W(O)&&ae(W(u).path+`/`+encodeURIComponent(W(h).trim()))}),Di(i,()=>W(h),e=>I(h,e)),q(e,t)},le=e=>{var n=po(),r=L(n),i=z(r,!0),a=B(r,2),o=z(a,!0),s=B(a,2),l=e=>{var n=fo(),r=R(n),i=L(r),a=B(i),o=e=>{q(e,Pr(`Only this session's saved - name changes.`))},s=N(()=>W(u)?.path.startsWith(`rename/`)),l=e=>{q(e,Pr(`Only this session’s - directory changes; project configuration is not reloaded.`))},d=N(()=>W(u)?.path.startsWith(`cd/`)),h=e=>{q(e,Pr(`No change sent yet. C confirms the selected setting. Model, - reasoning and speed settings can change token usage and cost. - Changes affect subsequent turns of this session, not global - defaults. Automatic quota thresholds may later supersede model - settings.`))};Y(a,e=>{W(s)?e(o):W(d)?e(l,1):e(h,-1)}),M(r);var g=B(r,2),_=B(g,2),v=e=>{q(e,uo())};Y(_,e=>{W(f)&&W(m)>=W(p)&&e(v)}),V(()=>{J(i,`TARGET // ${t.session??``}. `),g.disabled=W(c)||W(O)||!W(f)||W(m)>=W(p)}),G(`click`,g,ce),q(e,n)};Y(s,e=>{W(d).action&&e(l)});var h=B(s,2);M(n),Li(n,e=>I(x,e),()=>W(x)),V(()=>{J(i,W(d).label),J(o,W(d).help||`No additional help supplied by Codex.`),h.disabled=W(c)}),G(`click`,h,()=>{g++,I(c,!1),I(d,null),I(f,``),dr().then(()=>W(y)?.focus())}),q(e,n)},ue=e=>{var t=xo(),i=R(t),a=e=>{var t=mo(),i=L(t);r(i),M(t),Li(t,e=>I(y,e),()=>W(y)),V(()=>Z(t,`aria-activedescendant`,`${n}-${W(_)}`)),q(e,t)},o=e=>{var t=ho();let n;var i=L(t);r(i),M(t),Li(t,e=>I(y,e),()=>W(y)),V(()=>n=li(t,1,`command-options svelte-7bfwr9`,null,n,{vertical:W(ne)})),q(e,t)};Y(i,e=>{W(C)?e(a):e(o,-1)});var s=B(i,2),l=e=>{var t=vo(),n=R(t),r=z(n,!0),i=B(n,4),a=e=>{var t=_o(),n=R(t),r=z(n),i=B(n,2),a=e=>{q(e,go())};Y(i,e=>{W(f)&&W(m)>=W(p)&&e(a)}),V(()=>J(r,`REVIEW // ${W(D).label??``}. No change sent yet; C confirms.`)),q(e,t)};Y(i,e=>{W(D)&&e(a)}),V(()=>J(r,W(E)[W(_)]?.help)),q(e,t)};Y(s,e=>{W(C)&&e(l)});var d=B(s,2),h=e=>{q(e,yo())};Y(d,e=>{!W(c)&&!W(E).length&&e(h)});var g=B(d,2),v=e=>{q(e,bo())};Y(g,e=>{W(T)&&W(u)?.path===``&&e(v)}),q(e,t)};Y(k,e=>{W(u)?.input?e(oe):W(d)?e(le,1):e(ue,-1)});var de=B(k,2),fe=e=>{var t=wo(),n=R(t),r=e=>{var t=So(),n=R(t),r=B(n,2);V(()=>{n.disabled=W(c)||W(O)||!W(E)[W(_)]?.action||!!W(l),r.disabled=W(c)||W(O)||!W(f)||W(S)!==W(E)[W(_)]?.id||W(m)>=W(p)||!!W(l)}),G(`click`,n,()=>{let e=W(E)[W(_)];e&&se(e)}),G(`click`,r,ce),q(e,t)};Y(n,e=>{W(C)&&e(r)});var i=B(n,2),a=B(i,2),o=B(a,2),s=e=>{var t=Co();V(()=>t.disabled=W(c)),G(`click`,t,()=>{re()}),q(e,t)};Y(o,e=>{W(C)&&e(s)}),V(()=>{i.disabled=W(c),a.disabled=W(c)}),G(`click`,i,()=>ae(``)),G(`click`,a,()=>ae(W(u)?.path||``)),q(e,t)};Y(de,e=>{W(ne)||e(fe)}),M(i),Li(i,e=>I(b,e),()=>W(b)),V(()=>{Z(i,`aria-label`,W(ne)?`Slash command suggestions`:`Session command options`),a=li(i,1,`svelte-7bfwr9`,null,a,{"command-popup":W(ne)})}),G(`keydown`,i,ie),q(e,i)};return Y(me,e=>{W(s)&&e(he)}),M(ue),V(()=>de.disabled=W(O)||W(c)),G(`click`,de,()=>{I(s,!W(s)),I(v,W(s)?null:i(),!0),I(f,``),W(s)&&ae(``)}),q(e,ue),Ke(le)}wr([`click`,`keydown`]);var Oo=K(` `,1),ko=K(`
`),Ao=K(`
/
`);function jo(e,t){Ge(t,!0);let n=N(()=>t.lines.filter(e=>e.kind===`addition`).length),r=N(()=>t.lines.filter(e=>e.kind===`removal`).length);var i=Ao(),a=L(i),o=L(a),s=z(o),c=z(B(o,2));M(a),X(B(a,2),17,()=>t.lines,Jr,(e,t)=>{var n=ko();let r;var i=L(n),a=e=>{var n=Oo(),r=R(n),i=z(r,!0),a=z(B(r),!0);V(()=>{J(i,W(t).old||``),J(a,W(t).new||``)}),q(e,n)};Y(i,e=>{W(t).kind!==`heading`&&W(t).kind!==`metadata`&&e(a)});var o=z(B(i),!0);M(n),V(()=>{r=li(n,1,`diff-line svelte-x4gtb6`,null,r,{added:W(t).kind===`addition`,removed:W(t).kind===`removal`,heading:W(t).kind===`heading`}),J(o,W(t).text)}),q(e,n)}),M(i),V(()=>{Z(a,`aria-label`,`${W(n)} lines added, ${W(r)} lines removed`),J(s,`+${W(n)??``}`),J(c,`−${W(r)??``}`)}),q(e,i),Ke()}var Mo=K(`

`),No=K(`

Send this saved prompt now? This starts Codex work and consumes quota.

`,1),Po=K(``),Fo=K(`

 

In memory only. Follows session model, reasoning and speed. Closing - Codexometer cancels pending work.

`),Io=K(`

CURRENT PROFILE

MODEL / REASONING LEVEL / SPEED

 

PROPOSED PROFILE

MODEL / REASONING LEVEL / SPEED

 

Applied settings remain after Codexometer closes.

`,1),Lo=K(`

`),Ro=K(`

 
`,1),zo=K(`

Command unavailable from this observation. Open Codex to inspect the - request.

`),Bo=K(`

Session controls temporarily unavailable. Check Codex for current state.

`),Vo=K(`

Checking session controls…

`),Ho=K(`

`),Uo=K(`
About browser controls

Controls require a supported live request from a connected shared - app-server session. Local observations alone cannot provide them.

`),Wo=K(` `,1),Go=K(` `),Ko=K(`Grants permission beyond this one action. Check the scope - carefully.`),qo=K(``),Jo=K(``),Yo=K(``),Xo=K(``),Zo=K(`

Not before this time; when quota and idle allow.

`),Qo=K(`

`,1),$o=K(`

The existing trigger remains active until saved or deleted. If - it changes or sends while you edit, saving is blocked.

`),es=K(` `,1),ts=K(``),ns=K(``),rs=K(``),is=K(` `,1),as=K(`
  • `),os=K(`
    View fixed choices

    Type one of these choices exactly. Your answer stays masked.

      `),ss=K(` `,1),cs=K(`

      `),ls=K(`

      `,1),us=K(` `,1),ds=K(``),fs=K(`

      `,1),ps=K(`

      `);function ms(e,t){Ge(t,!0);let n=[],r=Q(t,`observedCommand`,3,``),i=Q(t,`observedFileChanges`,19,()=>[]),a=Q(t,`review`,3,``),o=Q(t,`suspended`,3,!1),s=Q(t,`openScheduler`,3,!1),c=Q(t,`onProtectedChange`,3,e=>{}),l=F(null),u=F(Zt([])),d=F(null),f=F(``),p=F(0),m=F(Zt(Date.now())),h=F(!1),g=F(``),_=F(!1),v=F(!1),y=F(``),b=F(!1),x=F(``),S=F(!1),C=F(``),w=F(`now`),ee=F(60),T=F(``),te=F(!1),E=F(``),D=F(Zt([])),O=N(()=>W(D).find(e=>e.status!==`sent`)),ne=F(void 0),k=F(void 0);function re(e){if(W(b)){dr().then(()=>W(ne)?.focus());return}if(e.status!==`pending`||W(h)||!W(l)?.id||W(l).kind!==`prompt`||W(l).questions?.length)return;I(b,!0),I(x,e.id,!0),dr().then(()=>W(ne)?.focus()),I(u,[e.text],!0),I(w,e.trigger===`quota`?`quota`:`at`,!0),I(f,``),I(C,``);let t=new Date(e.at);e.trigger!==`quota`&&I(T,new Date(t.getTime()-t.getTimezoneOffset()*6e4).toISOString().slice(0,16),!0)}bn(()=>{s()&&W(O)&&!W(S)&&W(l)?.id&&W(l).kind===`prompt`&&!W(l).questions?.length&&(I(S,!0),re(W(O)))});async function ie(){if(!a())try{I(D,await _a(`schedules`,{session:t.session},ye.signal),!0),W(b)&&!W(D).some(e=>e.id===W(x)&&e.status===`pending`)&&I(f,``),W(C)&&!W(D).some(e=>e.id===W(C)&&e.status===`pending`)&&(I(f,``),I(C,``))}catch{}}async function ae(e){try{I(D,await _a(`schedules`,{session:t.session,cancelId:e},ye.signal),!0),I(b,!1),I(f,``),I(C,``),I(u,[],!0)}catch(e){I(g,e instanceof Error?e.message:`Unable to cancel trigger.`,!0)}}bn(()=>(c()(W(h)||W(u).some(e=>e.length>0)),()=>c()(!1)));let oe=N(()=>$.data?.sessions.find(e=>e.id===t.session)?.status),se=N(()=>!$.connected||!!$.data?.sessionsError),ce=N(()=>a()!==`profile`&&W(l)?.kind===`prompt`&&!W(l).questions?.length&&!!$.data?.profiles?.some(e=>e.session===t.session&&e.pending)),le=N(()=>!W(se)&&!W(v)&&!!W(l)?.id&&W(l).kind===`approval`&&W(y)!==W(l).id),ue=N(()=>W(le)?W(l).command:r()),de=N(()=>!!W(f)&&W(m)W(l)?.questions?.length?W(l).questions:[{text:`Follow-up message`,secret:!1,freeText:!0,options:[]}]),pe=N(()=>W(l)?.kind===`approval`||W(l)?.kind===`profile`?W(d)!==null:W(u).length===W(fe).length&&W(u).every((e,t)=>e.trim().length>0&&(W(fe)[t].freeText||W(fe)[t].options?.includes(e)))),me=N(()=>W(l)?.kind===`prompt`&&!W(l).questions?.length&&W(w)!==`now`),he=N(()=>W(w)===`delay`?W(m)+W(ee)*6e4:Date.parse(W(T))),ge=N(()=>{if(!W(me))return``;if(W(b)&&!W(D).some(e=>e.id===W(x)&&e.status===`pending`))return`Trigger changed, removed or already sent. Go back and reopen it; your draft has not been saved.`;if(!W(u)[0]?.trim())return`Enter a message to schedule.`;if(W(w)===`quota`)return``;if(!Number.isFinite(W(he))||W(he)<=W(m))return`Choose a future date/time or a delay greater than zero.`;let e=new Date(W(m));return e.setFullYear(e.getFullYear()+1),W(he)>=e.getTime()?`Choose a time within one year.`:``});function _e(e){return new Date(e).toLocaleString([],{timeZoneName:`short`})}function ve(e){if(e.status!==`pending`)return e.status;if(e.trigger===`at`&&Date.parse(e.at)>W(m))return`Due in `+Math.ceil((Date.parse(e.at)-W(m))/6e4)+` min`;let t=W(se)?`waiting for a fresh connection`:e.waitingReason||(e.canSend?`ready; awaiting dispatch`:`waiting for quota and an eligible idle session`);return(e.trigger===`at`?`Time reached — `:``)+t}bn(()=>{(W(se)||o()||W(ce)||W(m)>=W(p))&&I(f,``)});let ye=new AbortController;Gi(()=>{let e=e=>{e.ctrlKey&&e.key.toLowerCase()===`s`&&!a()&&W(O)&&(e.preventDefault(),re(W(O)))};window.addEventListener(`keydown`,e);let n,r=setInterval(()=>{I(m,Date.now(),!0)},1e3);async function i(){await ie();try{let e=await _a(`offer`,{session:t.session,...a()?{review:a()}:{}},ye.signal);if(ye.signal.aborted)return;I(v,!1),W(l)?.id!==e.id&&(I(f,``),I(d,null),I(u,Array(Math.max(1,e.questions?.length||0)).fill(``),!0)),I(l,e,!0),W(_)&&e.id&&e.id!==W(y)&&(I(g,``),I(_,!1))}catch{ye.signal.aborted||(I(l,null),I(v,!0),I(f,``))}finally{ye.signal.aborted||(n=setTimeout(i,2e3))}}return i(),()=>{window.removeEventListener(`keydown`,e),ye.abort(),clearTimeout(n),clearInterval(r)}});async function A(e){if(!e&&W(l)?.kind===`prompt`&&!W(l).questions?.length&&W(u)[0]?.trim().startsWith(`/`)&&!W(u)[0]?.trim().startsWith(`//`)){I(g,`Choose a slash command from COMMANDS; use // for literal slash text.`);return}if(!W(l)?.id||W(h)||W(se)||o()||W(ce)||(e?!e.canSend:!W(pe)||W(ge)))return;let n=W(l).id;I(h,!0),I(g,``),I(_,!1),I(f,``),I(C,e?.id||``,!0);try{let r=!e&&W(l).kind===`prompt`&&!W(l).questions?.length&&W(w)!==`now`?{trigger:W(w)===`quota`?`quota`:`at`,zone:Intl.DateTimeFormat().resolvedOptions().timeZone,...W(w)===`quota`?{}:{at:(W(w)===`delay`?new Date(Date.now()+W(ee)*6e4):new Date(W(T))).toISOString()}}:void 0;I(te,!!r),I(E,r?r.trigger===`quota`?`After fresh quota becomes available, when the session is idle`:_e(r.at)+` — not before this time; when quota and idle allow`:``,!0);let i=await _a(`prepare`,{session:t.session,...a()?{review:a()}:{},offer:n,...e?{sendId:e.id}:{},...r?{schedule:r}:{},...r&&W(b)?{editId:W(x)}:{},...W(l).kind===`approval`||W(l).kind===`profile`?{choice:W(d)}:{answers:e?[e.text]:[...W(u)]}},ye.signal);W(l)?.id===n&&!ye.signal.aborted&&!W(se)&&!o()&&!W(ce)&&(I(f,i.confirmation,!0),I(p,Date.parse(i.expires),!0))}catch(e){ye.signal.aborted||I(g,e instanceof Error?e.message:`Unable to prepare action.`,!0)}finally{I(h,!1)}}async function be(){if(!W(l)?.id||W(h)||o()||W(ce)||!W(de))return;let e=W(l).id,n=W(l).kind,r=W(f);I(f,``),I(h,!0),I(y,e,!0);try{await _a(`commit`,{session:t.session,...a()?{review:a()}:{},offer:e,confirmation:r},ye.signal),I(_,!0),I(b,!1),W(te)&&(I(y,``),await ie()),I(g,W(te)?`Trigger set. Closing Codexometer cancels it.`:n===`profile`?`Profile decision completed.`:n===`approval`?`Decision sent.`:`Text sent.`,!0)}catch(e){I(g,e instanceof ha?e.message:`Outcome uncertain. Check Codex before taking another action; nothing was retried.`,!0)}finally{I(h,!1),I(C,``),await ie(),I(u,[],!0),I(d,null)}}var j=Wo(),xe=R(j),Se=e=>{var t=Fr();X(R(t),17,()=>W(D).filter(e=>e.status!==`sent`),e=>e.id,(e,t)=>{var n=Fo(),r=L(n),i=z(r,!0),a=B(r,2),s=z(a),c=B(a,2),u=z(c,!0),d=B(c,2),p=z(d,!0),m=B(d,2),_=z(m,!0),v=B(m,2),y=e=>{var t=Mo(),n=z(t,!0);V(()=>J(n,W(g))),q(e,t)};Y(v,e=>{W(g)&&e(y)});var b=B(v,4),x=B(b,2),S=B(x,2),w=e=>{var n=No(),r=B(R(n),2),i=B(r,2);V(()=>r.disabled=W(h)||W(se)||!W(t).canSend),G(`click`,r,be),G(`click`,i,()=>{I(f,``),I(C,``)}),q(e,n)},ee=e=>{var n=Po();V(()=>n.disabled=W(h)||W(se)||!W(t).canSend||o()),G(`click`,n,()=>A(W(t))),q(e,n)};Y(S,e=>{W(de)&&W(C)===W(t).id?e(w):e(ee,-1)}),M(n),V((e,n)=>{J(i,W(t).status===`uncertain`?`CHECK TRIGGER — outcome uncertain; not retried`:`SCHEDULED FOLLOW-UP`),J(s,`TARGET // ${W(t).session??``}`),J(u,e),J(p,n),J(_,W(t).text),b.disabled=W(h)||!W(l)?.id||W(l).kind!==`prompt`||!!W(l).questions?.length||W(t).status!==`pending`,x.disabled=W(h)||W(t).status===`sending`},[()=>W(t).trigger===`quota`?`After confirmed quota recovery, when idle`:`Not before ${_e(W(t).at)}`,()=>ve(W(t))]),G(`click`,b,()=>re(W(t))),G(`click`,x,()=>ae(W(t).id)),q(e,n)}),q(e,t)},we=N(()=>!a()&&W(l)?.kind!==`approval`&&!W(l)?.questions?.length&&![`APPROVAL NEEDED`,`INPUT NEEDED`].includes(W(oe)||``));Y(xe,e=>{W(we)&&e(Se)});var Te=B(xe,2),Ee=e=>{var r=ps(),o=L(r),s=z(o,!0),c=B(o,2),x=e=>{var t=Io(),n=R(t),r=z(n),i=B(n,6),a=z(i,!0),o=z(B(i,6),!0);Ce(2),V(()=>{J(r,`Your ${W(l).profile.threshold??``}% quota threshold has been reached. Review - the profile for subsequent turns.`),J(a,W(l).profile.current),J(o,W(l).profile.proposed)}),q(e,t)};Y(c,e=>{W(l)?.profile&&!W(se)&&!W(v)&&e(x)});var S=B(c,2),C=e=>{var t=Lo();let n;var r=z(t,!0);V(()=>{n=li(t,1,`svelte-1oupzfc`,null,n,{notice:!W(_),sent:W(_)}),J(r,W(g))}),q(e,t)};Y(S,e=>{W(g)&&e(C)});var D=B(S,2),O=e=>{jo(e,{get lines(){return W(l).fileChanges}})},re=e=>{jo(e,{get lines(){return i()}})},ie=e=>{var t=Ro(),n=R(t),r=z(n,!0),i=z(B(n,2),!0);V(()=>{J(r,W(le)?`EXACT COMMAND`:`LAST OBSERVED COMMAND`),J(i,W(ue))}),q(e,t)},ae=e=>{q(e,zo())};Y(D,e=>{W(l)?.fileChanges?.length&&!W(se)&&!W(v)?e(O):i().length?e(re,1):W(ue)?e(ie,2):a()!==`profile`&&W(oe)===`APPROVAL NEEDED`&&!W(_)&&e(ae,3)});var ce=B(D,2),me=e=>{q(e,Bo())},ve=e=>{q(e,Vo())},ye=e=>{var t=Wo(),n=R(t),r=e=>{var t=Ho(),n=z(t,!0);V(e=>J(n,e),[()=>W(oe)===`WORKING`?`Codex is working — nothing to respond to.`:[`APPROVAL NEEDED`,`INPUT NEEDED`].includes(W(oe)||``)?`Respond in Codex for this request.`:`Nothing needs a response right now.`]),q(e,t)};Y(n,e=>{(W(oe)===`WORKING`||!W(_)&&!W(h))&&e(r)});var i=B(n,2),a=e=>{q(e,Uo())},o=N(()=>[`APPROVAL NEEDED`,`INPUT NEEDED`].includes(W(oe)||``)&&!W(_));Y(i,e=>{W(o)&&e(a)}),q(e,t)},j=e=>{var r=fs(),i=R(r),o=z(i),s=B(i,2),c=L(s),g=z(c,!0),_=B(c,2),v=e=>{var r=Fr();X(R(r),17,()=>W(l).choices||[],Jr,(e,r,i)=>{var o=qo(),s=L(o);Si(s),s.value=s.__value=i;var c=B(s),l=B(c),u=e=>{var t=Go(),n=z(t,!0);V(()=>J(n,W(r).detail)),q(e,t)};Y(l,e=>{W(r).detail&&e(u)});var f=B(l,2),p=e=>{q(e,Ko())};Y(f,e=>{W(r).persistent&&e(p)}),M(o),V(()=>{Z(s,`name`,`decision-`+t.session+`-`+a()),J(c,` ${W(r).label??``} `)}),ki(n,[],s,()=>W(d),e=>I(d,e)),q(e,o)}),q(e,r)},y=e=>{var n=Wo(),r=R(n),i=e=>{var t=es(),n=R(t),r=B(L(n)),i=L(r),a=e=>{var t=Jo();t.value=t.__value=`now`,q(e,t)};Y(i,e=>{W(b)||e(a)});var o=B(i);o.value=o.__value=`quota`;var s=B(o);s.value=s.__value=`delay`;var c=B(s);c.value=c.__value=`at`,M(r),hi(r),M(n);var l=B(n,2),u=e=>{var t=Yo(),n=B(L(t));Si(n),M(t),Di(n,()=>W(ee),e=>I(ee,e)),q(e,t)};Y(l,e=>{W(w)===`delay`&&e(u)});var d=B(l,2),f=e=>{var t=Xo(),n=B(L(t));Si(n),M(t),Di(n,()=>W(T),e=>I(T,e)),q(e,t)};Y(d,e=>{W(w)===`at`&&e(f)});var p=B(d,2),m=e=>{var t=Qo(),n=R(t),r=z(n),i=B(n,2),a=e=>{q(e,Zo())};Y(i,e=>{W(w)!==`quota`&&e(a)});var o=B(i,2);o.textContent=`Timezone: ${Intl.DateTimeFormat().resolvedOptions().timeZone??``}. - One pending request per session; saving replaces it. Memory - only; Codexometer must stay running. Uses session model, - reasoning and speed.`,V(e=>J(r,`Will send: ${e??``}`),[()=>W(w)===`quota`?`when quota is available and this session is idle`:Number.isFinite(W(he))?_e(W(he)):`choose a date and time`]),q(e,t)};Y(p,e=>{W(w)!==`now`&&e(m)});var h=B(p,2),g=e=>{q(e,$o())};Y(h,e=>{W(b)&&e(g)}),gi(r,()=>W(w),e=>I(w,e)),q(e,t)};Y(r,e=>{W(l).questions?.length||e(i)}),X(B(r,2),17,()=>W(fe),Jr,(e,n,r)=>{var i=ss(),o=R(i),s=e=>{{let n=N(()=>W(u)[0]||``);Li(Do(e,{get session(){return t.session},get query(){return W(n)},oncomplete:e=>{I(u,[e],!0),dr().then(()=>W(ne)?.focus())},onchange:()=>{I(u,[``],!0),dr().then(()=>W(ne)?.focus())}}),e=>I(k,e,!0),()=>W(k))}};Y(o,e=>{r===0&&a()!==`profile`&&W(l).kind===`prompt`&&!W(l).questions?.length&&e(s)});var c=B(o,2),d=L(c),f=B(d),p=e=>{var t=ts();Si(t),Di(t,()=>W(u)[r],e=>W(u)[r]=e),q(e,t)},m=e=>{var t=rs(),i=L(t);i.value=i.__value=``,X(B(i),17,()=>W(n).options||[],Jr,(e,t)=>{var n=ns(),r=z(n,!0),i={};V(()=>{J(r,W(t)),i!==(i=W(t))&&(n.value=(n.__value=i)??``)}),q(e,n)}),M(t),hi(t),gi(t,()=>W(u)[r],e=>W(u)[r]=e),q(e,t)},h=e=>{var t=is(),i=R(t);rt(i),Li(i,e=>I(ne,e),()=>W(ne));var a=B(i,2),o=e=>{var t=Ho(),r=z(t);V(e=>J(r,`Suggested answers: ${e??``}`),[()=>W(n).options.join(` · `)]),q(e,t)};Y(a,e=>{W(n).options?.length&&e(o)}),G(`keydown`,i,e=>{W(l)?.kind===`prompt`&&!W(l).questions?.length&&W(k)?.handleKey(e)}),Di(i,()=>W(u)[r],e=>W(u)[r]=e),q(e,t)};Y(f,e=>{W(n).secret?e(p):W(n).freeText?e(h,-1):e(m,1)}),M(c);var g=B(c,2),_=e=>{var t=os(),r=B(L(t),4);X(r,21,()=>W(n).options||[],Jr,(e,t)=>{var n=as(),r=z(n,!0);V(()=>J(r,W(t))),q(e,n)}),M(r),M(t),q(e,t)};Y(g,e=>{W(n).secret&&!W(n).freeText&&e(_)}),V(()=>J(d,`${W(n).text??``} `)),q(e,i)}),q(e,n)};Y(_,e=>{W(l).kind===`approval`||W(l).kind===`profile`?e(v):e(y,-1)}),M(s);var x=B(s,2),S=e=>{var t=ls(),n=R(t),r=e=>{var t=cs(),n=z(t);V(()=>J(n,`TRIGGER // ${W(E)??``}`)),q(e,t)};Y(n,e=>{W(te)&&e(r)});var i=B(n,2),a=z(i),o=B(i,2),s=z(o),c=B(o,2);V(e=>{J(a,`Check the target and ${W(l).kind===`profile`?`profile above`:W(l).kind===`approval`?W(l).fileChanges?.length?`proposed file changes above`:`exact command and permission scope`:`message above`}. ${W(te)?`This schedules a follow-up that will send automatically when eligible`:`This will send to Codex`}; it may start work using your quota. - Confirmation expires in ${e??``}s.`),o.disabled=W(h)||W(se),J(s,`CONFIRM ${(W(l).kind===`approval`||W(l).kind===`profile`?W(l).choices?.[W(d)]?.label:W(te)?W(b)?`SAVE CHANGES`:`SCHEDULE`:`SEND`)??``}`)},[()=>Math.max(0,Math.ceil((W(p)-W(m))/1e3))]),G(`click`,o,be),G(`click`,c,()=>{I(f,``)}),q(e,t)},C=e=>{var t=us(),n=R(t),r=e=>{var t=Mo(),n=z(t,!0);V(()=>J(n,W(ge))),q(e,t)};Y(n,e=>{W(ge)&&e(r)});var i=B(n,2),a=z(i,!0);V(()=>{i.disabled=W(h)||W(se)||!W(pe)||!!W(ge),J(a,W(h)?`SENDING…`:W(b)?`REVIEW CHANGES`:`REVIEW BEFORE SENDING`)}),G(`click`,i,()=>A()),q(e,t)};Y(x,e=>{W(de)?e(S):e(C,-1)});var D=B(x,2),O=e=>{var t=ds();G(`click`,t,()=>{I(b,!1),I(f,``),I(u,[],!0)}),q(e,t)};Y(D,e=>{W(b)&&e(O)}),V(()=>{J(o,`TARGET // ${W(l).thread??``} // ${(W(l).directory||`Directory unavailable`)??``}`),s.disabled=W(h)||W(de)||W(se),J(g,W(l).kind===`approval`||W(l).kind===`profile`?`Choose a decision`:W(b)?`EDIT SCHEDULED FOLLOW-UP`:`Reply to this session`)}),q(e,r)};Y(ce,e=>{W(se)||W(v)?e(me):W(l)?W(l).id?W(y)!==W(l).id&&e(j,3):e(ye,2):e(ve,1)}),M(r),V(()=>J(s,a()===`profile`?`QUOTA THRESHOLD`:`SESSION CONTROL // EXPERIMENTAL`)),q(e,r)};Y(Te,e=>{!W(ce)&&(!W(O)||W(b)||a()||W(l)?.kind!==`prompt`||W(l).questions?.length)&&e(Ee)}),q(e,j),Ke()}wr([`click`,`keydown`]);var hs=K(` `,1),gs=K(`
      `),_s=K(`

      STATUS LINE // CODEXOMETER

      Choose multiple fields and their order. These display preferences do not - change Codex CLI configuration. Missing values are omitted.

      `),vs=K(`

      `,1);function ys(e,t){Ge(t,!0);let n=Q(t,`stale`,3,!1),r=F(Zt([])),i=F(!1),a=N(()=>$.data?.statusLineFields||[]),o=e=>[...new Set(e??W(a).filter(e=>e.default).map(e=>e.id))].filter(e=>W(a).some(t=>t.id===e)),s=e=>o(e).map(e=>e===`run-state`&&(n()||!$.connected||$.data?.sessionsError)?`STALE`:t.session.statusLine?.[e]).filter(Boolean).join(` · `),c=N(()=>[...W(r).map(e=>W(a).find(t=>t.id===e)).filter(Boolean),...W(a).filter(e=>!W(r).includes(e.id))]);bn(()=>{oa.open&&!W(i)?(I(r,o(aa.statusLine),!0),I(i,!0)):oa.open||I(i,!1)});function l(e,t){I(r,t?[...W(r),e]:W(r).filter(t=>t!==e),!0)}function u(e,t){let n=W(r).indexOf(e),i=n+t;if(n<0||i<0||i>=W(r).length)return;let a=[...W(r)];[a[n],a[i]]=[a[i],a[n]],I(r,a,!0)}var d=vs(),f=R(d),p=e=>{var t=_s(),n=B(L(t),4);X(n,21,()=>W(c),e=>e.id,(e,t)=>{var n=gs(),i=L(n),a=L(i);Si(a);var o=B(a,1,!0),s=z(B(o),!0);M(i);var c=B(i,2),d=e=>{var n=hs(),i=R(n),a=B(i,2);V((e,n)=>{Z(i,`aria-label`,`Move `+W(t).label+` earlier`),i.disabled=e,Z(a,`aria-label`,`Move `+W(t).label+` later`),a.disabled=n},[()=>W(r).indexOf(W(t).id)===0,()=>W(r).indexOf(W(t).id)===W(r).length-1]),G(`click`,i,()=>u(W(t).id,-1)),G(`click`,a,()=>u(W(t).id,1)),q(e,n)},f=N(()=>W(r).includes(W(t).id));Y(c,e=>{W(f)&&e(d)}),M(n),V(e=>{Z(i,`title`,W(t).help),Ci(a,e),J(o,W(t).label),J(s,W(t).help)},[()=>W(r).includes(W(t).id)]),G(`change`,a,e=>l(W(t).id,e.currentTarget.checked)),q(e,n)}),M(n);var i=B(n,2),a=z(i),o=B(i,2),d=B(o,2);M(t),V(e=>J(a,`Preview // ${e??``}`),[()=>s(W(r))||`—`]),G(`click`,o,()=>{aa.statusLine=[...W(r)],sa(),oa.open=!1}),G(`click`,d,()=>{oa.open=!1}),q(e,t)};Y(f,e=>{oa.open&&e(p)});var m=B(f,2),h=L(m),g=z(h,!0),_=B(h,2);M(m),V((e,t)=>{Z(h,`title`,e),J(g,t)},[()=>s(aa.statusLine),()=>s(aa.statusLine)]),G(`click`,_,()=>{oa.open=!oa.open}),q(e,d),Ke()}wr([`change`,`click`]);var bs=K(`
      `);function xs(e,t){Ge(t,!0);let n=Q(t,`active`,3,!1),r=N(()=>t.session.text||t.session.contextKind===`LAST ACTIVITY`&&t.session.workingCommand||``),i=N(()=>[`LAST REPLY`,`LAST ACTIVITY`].includes(t.session.contextKind)&&!!W(r).trim()),a=F(!1),o=F(``),s=F(!1);bn(()=>{if(!W(s))return;let e=setTimeout(()=>{I(s,!1)},150);return()=>clearTimeout(e)}),bn(()=>{W(r),t.session.status,I(o,``)});async function c(){if(!W(i)||W(a))return;let e=W(r);I(a,!0),I(s,!0),I(o,``);try{await navigator.clipboard.writeText(e),W(r)===e&&I(o,`Copied.`)}catch{W(r)===e&&I(o,`Clipboard unavailable. Select the visible text and copy it manually.`)}finally{I(a,!1)}}function l(e){!n()||!W(i)||e.defaultPrevented||e.repeat||e.ctrlKey||e.metaKey||e.altKey||e.key.toLowerCase()!==`c`||e.target instanceof Element&&e.target.closest(`input, textarea, select, [contenteditable]`)||(e.preventDefault(),c())}var u=Fr();Cr(`keydown`,en,l);var d=R(u),f=e=>{var t=bs(),n=L(t),r=z(n,!0),i=B(n,2);let l;M(t),V(()=>{J(r,W(o)),i.disabled=W(a),l=li(i,1,`svelte-543j00`,null,l,{flashed:W(s)})}),G(`click`,i,c),q(e,t)};Y(d,e=>{W(i)&&e(f)}),q(e,u),Ke()}wr([`click`]);var Ss=K(`

       
      `,1),Cs=K(`

      LATEST GUIDANCE

       
      `,1),ws=K(`

      CONTEXT

       

      `,1),Ts=K(`

      `),Es=K(`

      `),Ds=K(`
       
      `),Os=K(`

       
      `,1),ks=K(`
       
      `),As=K(`

      Command unavailable from this observation. Open Codex to inspect the - request.

      `),js=K(`

      `,1),Ms=K(`

      `),Ns=K(` `,1),Ps=K(`
      `),Fs=K(`

      Session connection or refresh unavailable. Context and telemetry may be - stale.

      `),Is=K(`

      Some quota profile checks are unavailable. Only sessions with freshly - verified quota and settings can be updated; previous outcome notices remain - visible.

      `),Ls=K(` `),Rs=K(` `),zs=K(` `),Bs=K(``),Vs=K(`

      Read only — reply or approve in Codex.

      `),Hs=K(`

      `),Us=K(`QUOTA THRESHOLD // REVIEW PROFILE ↗`),Ws=K(`
      `),Gs=K(`
      `),Ks=K(`

      This session is no longer in the current observation. Return to sessions.

      `),qs=K(`

      `),Js=K(``),Ys=K(`

      `),Xs=K(` `),Zs=K(`

      `),Qs=K(`QUOTA THRESHOLD // REVIEW PROFILE ↗`),$s=K(` `,1),ec=K(`

      `),tc=K(`

      TOKEN ACTIVITY // 30 SECOND SAMPLES

      `),nc=K(`

      TOKENS

      FULL DETAIL →
      `),rc=K(`

      No locally observed sessions yet. Keep Codex running alongside - Codexometer.

      `),ic=K(`

      ↑ ↓ SELECT SESSION // ← LESS DETAIL // → MORE DETAIL // ESC BACK

      `,1),ac=K(`

      SESSION TOTALS

      `,1);function oc(e,t){Ge(t,!0);let n=(e,t=f,n,r)=>{let i=ht(()=>g(n?.(),!0)),a=ht(()=>g(r?.(),!1));var o=Ns(),s=R(o),c=e=>{var n=Ss(),r=R(n),i=z(r,!0),a=z(B(r,2),!0);V(()=>{J(i,t().contextKind===`LAST REPLY`&&!t().streaming?`TASK`:`CURRENT TASK`),J(a,t().currentTask)}),q(e,n)};Y(s,e=>{t().currentTask&&e(c)});var l=B(s,2),u=e=>{var n=Cs(),r=z(B(R(n),2),!0);V(()=>J(r,t().latestGuidance)),q(e,n)};Y(l,e=>{t().latestGuidance&&e(u)});var d=B(l,2),p=e=>{var n=ws(),r=z(B(R(n),2),!0);Ce(2),V(()=>J(r,t().approvalContext)),q(e,n)};Y(d,e=>{W(a)&&t().contextKind===`APPROVAL REQUEST`&&t().approvalContext&&e(p)});var m=B(d,2),_=e=>{var n=Ts();let r;var i=z(n,!0);V(e=>{r=li(n,1,`attention-note`,null,r,{inferred:t().status===`CHECK SESSION`}),J(i,e)},[()=>C(t())]),q(e,n)},v=N(()=>C(t())&&(!W(a)||W(h)||t().status===`CHECK SESSION`));Y(m,e=>{W(v)&&e(_)});var y=B(m,2),b=e=>{var n=Es(),r=z(n,!0);V(e=>J(r,e),[()=>w(t())]),q(e,n)};Y(y,e=>{W(i)&&e(b)});var x=B(y,2),S=e=>{var n=Ds(),r=z(n,!0);V(()=>J(r,t().text||`No session context available.`)),q(e,n)};Y(x,e=>{(t().text||!t().workingCommand)&&e(S)});var ee=B(x,2),T=e=>{var n=Os(),r=B(R(n),2),i=L(r),a=B(i),o=e=>{var n=Pr();V(()=>J(n,`// +${(t().runningCommands||0)-+(t().commandStatus===`running`)} RUNNING`)),q(e,n)};Y(a,e=>{!W(h)&&(t().runningCommands||0)>+(t().commandStatus===`running`)&&e(o)});var s=B(a,2),c=e=>{q(e,Pr(`+`))};Y(s,e=>{t().runningLimited&&e(c)}),M(r);var l=z(B(r,2),!0);V(e=>{J(i,`COMMAND // ${e??``} `),J(l,t().workingCommand)},[()=>W(h)?`UNKNOWN`:(t().commandStatus||`unknown`).toUpperCase()]),q(e,n)};Y(ee,e=>{t().workingCommand&&e(T)});var te=B(ee,2),E=e=>{jo(e,{get lines(){return t().fileChanges}})},D=e=>{var n=js(),r=B(R(n),2),i=z(r,!0),a=B(r,2),o=e=>{var n=ks(),r=z(n,!0);V(()=>J(r,t().command)),q(e,n)},s=e=>{q(e,As())};Y(a,e=>{t().command?e(o):e(s,-1)}),V(()=>J(i,W(h)||t().status!==`APPROVAL NEEDED`?`LAST OBSERVED COMMAND`:$.data?.control?`COMMAND REQUEST`:`COMMAND TO APPROVE IN CODEX`)),q(e,n)};Y(te,e=>{(!W(a)||!$.data?.control)&&t().fileChanges?.length?e(E):(!W(a)||!$.data?.control)&&(t().command||t().status===`APPROVAL NEEDED`)&&e(D,1)});var O=B(te,2),ne=e=>{var n=Ms(),r=z(n);V(()=>J(r,`CONTEXT SOURCE // ${(t().source||`LOCAL`)??``} // OBSERVATION`)),q(e,n)};Y(O,e=>{W(a)||e(ne)}),q(e,o)},r=Q(t,`params`,19,()=>({})),i=N(()=>$.data?.sessions||[]),a=N(()=>$.data?.control&&$.data.profiles||[]),o=N(()=>($.data?.triggers||[]).filter(e=>W(i).some(t=>t.id===e.session)));function s(e,t){if(r().id&&r().id!==t&&W(l)){e.preventDefault();return}b(t)}function c(e){return[`TURN COMPLETE`,`IDLE`,`ACTIVE`].includes(e.status)&&W(o).some(t=>t.session===e.id)?`TRIGGER SET`:e.status}let l=F(!1);function u(e,t){if(r().id&&r().id!==t&&W(l)){e.preventDefault();return}b(t)}bn(()=>{let e=r().id;e&&mr(()=>{aa.selected=e,da(e,2)})});let d=N(()=>W(i).find(e=>e.id===r().id)),p=N(()=>new URLSearchParams(Yi.querystring).get(`review`)===`profile`&&W(a).some(e=>e.session===r().id&&e.pending)),m=N(()=>W(i).some(e=>e.id===aa.selected)?aa.selected:W(i)[0]?.id),h=N(()=>!$.connected||!!$.data?.sessionsError),v=N(()=>[[`OBSERVED TOKENS`,fa(W(i).reduce((e,t)=>e+t.tokens,0))],[`LISTED SESSIONS`,fa(W(i).length)],...[[`WORKING`,`WORKING`],[`AWAITING APPROVAL`,`APPROVAL NEEDED`],[`AWAITING INPUT`,`INPUT NEEDED`],[`CHECK · INFERRED`,`CHECK SESSION`]].map(([e,t])=>[e,W(h)?`—`:fa(W(i).filter(e=>e.status===t).length)])]),y=N(()=>W(i).filter(e=>[`INPUT NEEDED`,`APPROVAL NEEDED`,`CHECK SESSION`].includes(e.status)));function b(e){aa.selected=e,dr().then(()=>document.querySelector(`.session-row.selected`)?.scrollIntoView({block:`nearest`}))}function x(e,t){if(b(e),r().id){t<0&&(da(e,2),location.hash=`/sessions`);return}let n=la(e)+t;n>2?location.hash=`/sessions/`+encodeURIComponent(e):da(e,n)}function S(e){let t=e.target;if(!(e.altKey||e.ctrlKey||e.metaKey||e.shiftKey||t.closest(`input, textarea, select, [contenteditable="true"]`))){if(e.key===`Escape`&&r().id)e.preventDefault(),x(r().id,-1);else if([`ArrowLeft`,`ArrowRight`].includes(e.key)&&(r().id||W(m)))e.preventDefault(),x(r().id||W(m),e.key===`ArrowLeft`?-1:1);else if(!r().id&&[`ArrowUp`,`ArrowDown`].includes(e.key)&&W(i).length){e.preventDefault();let t=W(i).findIndex(e=>e.id===W(m));b(W(i)[Math.max(0,Math.min(W(i).length-1,t+(e.key===`ArrowUp`?-1:1)))].id)}}}function C(e){return W(h)?`Last observation only — refresh unavailable. Check Codex for current state.`:e.status===`CHECK SESSION`?`INFERRED INACTIVITY — a quiet session, not a confirmed input or approval request. Local tools may still be running.`:$.data?.control&&[`APPROVAL NEEDED`,`INPUT NEEDED`].includes(e.status)?`Open full detail for supported live controls; otherwise reply in Codex.`:e.status===`APPROVAL NEEDED`?`OBSERVED APPROVAL SIGNAL — approve or decline in Codex.`:e.status===`INPUT NEEDED`?`OBSERVED INPUT SIGNAL — reply in Codex.`:e.status===`TURN COMPLETE`?`OBSERVED TURN COMPLETION — informational, not an approval request.`:``}function w(e){return e.streaming&&e.contextKind===`LAST REPLY`?`REPLY // STREAMING`:e.contextKind||`LAST ACTIVITY`}var ee=ac();Cr(`keydown`,en,S);var T=R(ee),te=z(B(L(T),2));M(T);var E=B(T,2);let D;X(E,21,()=>W(v),Jr,(e,t)=>{var n=N(()=>_(W(t),2));let r=()=>W(n)[0],i=()=>W(n)[1];var a=Ps(),o=L(a),s=z(o,!0),c=z(B(o,2),!0);M(a),V(()=>{J(s,r()),J(c,i())}),q(e,a)}),M(E);var O=B(E,2),ne=z(O),k=B(O,2),re=e=>{q(e,Fs())};Y(k,e=>{W(h)&&e(re)});var ie=B(k,2),ae=e=>{q(e,Is())};Y(ie,e=>{$.data?.profileError&&e(ae)});var oe=B(ie,2),se=e=>{var t=Bs(),n=L(t);X(n,17,()=>W(y),Jr,(e,t)=>{var n=Ls();let r;var i=z(n);V((e,a)=>{r=li(n,1,`button`,null,r,{approval:W(t).status===`APPROVAL NEEDED`}),Z(n,`href`,e),J(i,`${W(t).status??``} - ${a??``} // ${(W(t).name||W(t).directory||W(t).id)??``}`)},[()=>`#/sessions/`+encodeURIComponent(W(t).id),()=>Array.from(W(t).id).slice(-5).join(``).toUpperCase()]),G(`click`,n,()=>b(W(t).id)),q(e,n)});var c=B(n,2);X(c,17,()=>W(a).filter(e=>e.pending&&W(i).some(t=>t.id===e.session)),Jr,(e,t)=>{var n=Rs(),a=z(n);V((e,i,o)=>{Z(n,`title`,r().id&&r().id!==W(t).session&&W(l)?`Finish sending or clear your current draft before switching sessions.`:`Review this session’s quota threshold`),Z(n,`href`,e),J(a,`QUOTA THRESHOLD ${i??``} // ${o??``}`)},[()=>`#/sessions/`+encodeURIComponent(W(t).session)+`?review=profile`,()=>Array.from(W(t).session).slice(-5).join(``).toUpperCase(),()=>W(i).find(e=>e.id===W(t).session)?.name||W(i).find(e=>e.id===W(t).session)?.directory||W(t).session]),G(`click`,n,e=>u(e,W(t).session)),q(e,n)}),X(B(c,2),17,()=>W(o),Jr,(e,t)=>{var n=zs(),r=z(n);V((e,t,i)=>{Z(n,`href`,e),J(r,`TRIGGER SET ${t??``} // ${i??``}`)},[()=>`#/sessions/`+encodeURIComponent(W(t).session),()=>Array.from(W(t).session).slice(-5).join(``).toUpperCase(),()=>W(i).find(e=>e.id===W(t).session)?.name||W(i).find(e=>e.id===W(t).session)?.directory]),G(`click`,n,e=>s(e,W(t).session)),q(e,n)}),M(t),q(e,t)},ce=N(()=>(W(y).length||W(a).some(e=>e.pending)||W(o).length)&&!W(h));Y(oe,e=>{W(ce)&&e(se)});var le=B(oe,2),ue=e=>{var t=Fr(),i=R(t),o=e=>{var t=Gs(),i=L(t),o=L(i),s=L(o);let u;var f=B(s);M(o);var m=B(o,2);M(i);var g=B(i,2),_=e=>{var t=Ms(),n=z(t,!0);V(()=>J(n,W(d).directory)),q(e,t)};Y(g,e=>{W(d).name&&W(d).directory&&e(_)});var v=B(g,2),y=z(v),x=B(v,2);let S;var C=L(x),w=L(C);n(w,()=>W(d),()=>!0,()=>!0),M(C);var ee=B(C,2),T=e=>{var t=Fr();qr(R(t),()=>W(d).id,e=>{{let t=N(()=>new URLSearchParams(Yi.querystring).get(`schedule`)===`edit`),n=N(()=>W(d).fileChanges||[]);ms(e,{get session(){return W(d).id},get openScheduler(){return W(t)},get observedCommand(){return W(d).command},get observedFileChanges(){return W(n)},get suspended(){return W(p)},onProtectedChange:e=>{I(l,e,!0)}})}}),q(e,t)},te=e=>{q(e,Vs())};Y(ee,e=>{$.data?.control?e(T):e(te,-1)}),M(x);var E=B(x,2);X(E,17,()=>W(a).filter(e=>e.session===W(d).id),e=>e.session,(e,t)=>{var n=Ws(),r=L(n),i=e=>{var n=Hs(),r=z(n,!0);V(()=>J(r,W(t).notice)),q(e,n)};Y(r,e=>{W(t).notice&&e(i)});var a=B(r,2),o=e=>{ms(e,{get session(){return W(d).id},review:`profile`})},s=e=>{var t=Us();V(e=>Z(t,`href`,e),[()=>`#/sessions/`+encodeURIComponent(W(d).id)+`?review=profile`]),q(e,t)};Y(a,e=>{W(t).pending&&W(p)?e(o):W(t).pending&&e(s,1)}),M(n),V(()=>Z(n,`id`,`quota-profile-`+W(d).id)),q(e,n)});var D=B(E,2),O=e=>{var t=Fr();qr(R(t),()=>W(d).id,e=>{xs(e,{get session(){return W(d)},active:!0})}),q(e,t)};Y(D,e=>{W(p)||e(O)}),qr(B(D,2),()=>W(d).id,e=>{ys(e,{get session(){return W(d)},get stale(){return W(h)}})}),M(t),V((e,t)=>{u=li(s,1,`lamp lit`,null,u,{working:W(d).status===`WORKING`&&!W(h)}),J(f,`${e??``} // ${(W(d).name||W(d).directory)??``}`),J(y,`${t??``} TOKENS // ${W(d).id??``} // CONTEXT SOURCE // ${(W(d).source||`LOCAL`)??``}`),S=di(x,``,S,{display:W(p)?`none`:void 0})},[()=>W(h)?`STALE`:W(p)?`QUOTA THRESHOLD`:c(W(d)),()=>fa(W(d).tokens)]),G(`click`,m,()=>{b(r().id),da(r().id,2)}),q(e,t)},s=e=>{q(e,Ks())};Y(i,e=>{W(d)?e(o):e(s,-1)}),q(e,t)},de=e=>{var t=ic(),r=R(t),o=B(L(r),2),s=L(o),l=B(s,2);M(o),M(r);var d=B(r,2);X(d,17,()=>W(i),e=>e.id,(e,t)=>{let r=N(()=>la(W(t).id));var i=nc();let o;var s=L(i),l=L(s),d=e=>{var n=qs(),r=L(n),i=z(r);M(n),V(e=>{Z(r,`aria-pressed`,W(m)===W(t).id),J(i,`${e??``} // ${W(t).name??``}`)},[()=>Array.from(W(t).id).slice(-5).join(``).toUpperCase()]),G(`click`,r,()=>b(W(t).id)),q(e,n)};Y(l,e=>{W(t).name&&e(d)});var f=B(l,2),p=L(f),g=L(p);let _;var v=B(g,1,!0);M(p),M(f);var y=B(f,2),S=e=>{var n=Js(),r=z(n,!0);V(()=>{Z(n,`aria-pressed`,W(m)===W(t).id),J(r,W(t).directory||W(t).id)}),G(`click`,n,()=>b(W(t).id)),q(e,n)};Y(y,e=>{W(t).name||e(S)});var C=B(y,2),ee=L(C);Ce(),M(C);var T=B(C,2),te=e=>{var n=Ms(),r=z(n,!0);V(()=>J(r,W(t).directory)),q(e,n)};Y(T,e=>{W(t).name&&W(t).directory&&e(te)});var E=B(T,2),D=z(E),O=B(E,2),ne=z(O),k=B(O,2),re=L(k),ie=B(re,2),ae=z(ie,!0),oe=B(ie,2);M(k);var se=B(k,2),ce=B(se,2),le=e=>{var n=Ys(),r=z(n,!0);V(()=>J(r,W(t).status===`CHECK SESSION`?`INFERRED INACTIVITY`:$.data?.control?`OPEN FULL DETAIL OR REPLY IN CODEX`:W(t).status===`APPROVAL NEEDED`?`APPROVE OR DECLINE IN CODEX`:`REPLY IN CODEX`)),q(e,n)},ue=N(()=>!W(h)&&[`APPROVAL NEEDED`,`INPUT NEEDED`,`CHECK SESSION`].includes(W(t).status));Y(ce,e=>{W(ue)&&e(le)}),M(s);var de=B(s,2),fe=e=>{var r=ec(),i=L(r),o=L(i),s=z(o,!0),c=B(o,2),l=e=>{var n=Xs(),r=z(n,!0);V(e=>{Z(n,`href`,e),J(r,$.data?.control?`REVIEW IN FULL DETAIL ↗`:`APPROVAL IN CODEX ↗`)},[()=>`#/sessions/`+encodeURIComponent(W(t).id)]),q(e,n)};Y(c,e=>{!W(h)&&W(t).status===`APPROVAL NEEDED`&&e(l)}),M(i);var d=B(i,2);n(d,()=>W(t),()=>!1);var f=B(d,2);X(f,17,()=>W(a).filter(e=>e.session===W(t).id),Jr,(e,n)=>{var r=$s(),i=R(r),a=e=>{var t=Zs(),r=z(t,!0);V(()=>J(r,W(n).notice)),q(e,t)};Y(i,e=>{W(n).notice&&e(a)});var o=B(i,2),s=e=>{var n=Qs();V(e=>Z(n,`href`,e),[()=>`#/sessions/`+encodeURIComponent(W(t).id)+`?review=profile`]),G(`click`,n,e=>u(e,W(t).id)),q(e,n)};Y(o,e=>{W(n).pending&&e(s)}),q(e,r)});var p=B(f,2);{let e=N(()=>W(m)===W(t).id);xs(p,{get session(){return W(t)},get active(){return W(e)}})}M(r),V(e=>J(s,e),[()=>w(W(t))]),q(e,r)};Y(de,e=>{W(r)>0&&e(fe)});var pe=B(de,2),me=e=>{var n=tc(),r=B(L(n),2);{let e=N(()=>(W(t).samples||[]).map(e=>e.tokens));no(r,{get values(){return W(e)},capacity:120})}var i=z(B(r,2));M(n),V(()=>J(i,`LAST ${(W(t).samples?.length||0)??``} SAMPLES // AUTO SCALE`)),q(e,n)};Y(pe,e=>{W(r)<2&&e(me)}),M(i),V((e,n,a,s,c)=>{o=li(i,1,`session-row`,null,o,{selected:W(m)===W(t).id,wide:W(r)===2,split:W(r)===1}),Z(i,`aria-label`,`Session `+(W(t).name||W(t).directory||W(t).id)),Z(p,`href`,e),_=li(g,1,`lamp lit`,null,_,{working:W(t).status===`WORKING`&&!W(h)}),J(v,n),J(ee,`${a??``} `),J(D,`${W(t).agents??``} LINKED AGENTS`),J(ne,`ACTIVE // ${s??``}`),re.disabled=W(r)===0,Z(ie,`aria-expanded`,W(r)>0),J(ae,W(r)?`HIDE DETAIL`:`SHOW DETAIL`),Z(se,`href`,c)},[()=>`#/sessions/`+encodeURIComponent(W(t).id),()=>W(h)?`STALE`:c(W(t)),()=>fa(W(t).tokens),()=>pa(W(t).activity),()=>`#/sessions/`+encodeURIComponent(W(t).id)]),G(`click`,p,()=>b(W(t).id)),G(`click`,re,()=>x(W(t).id,-1)),G(`click`,ie,()=>{b(W(t).id),da(W(t).id,+!W(r))}),G(`click`,oe,()=>x(W(t).id,1)),G(`click`,se,()=>b(W(t).id)),q(e,i)});var f=B(d,2),p=e=>{q(e,rc())};Y(f,e=>{W(i).length||e(p)}),G(`click`,s,()=>ua(1)),G(`click`,l,()=>ua(0)),q(e,t)};Y(le,e=>{r().id?e(ue):e(de,-1)}),V(e=>{J(te,`OBSERVED ${e??``}`),D=li(E,1,`session-totals`,null,D,{stale:W(h)}),J(ne,`${W(h)?`LAST KNOWN TOTALS — live state counts unavailable. `:``}Tokens - observed since this server started for currently listed sessions; linked - agents are already included. Totals can decrease when a session leaves the - list. History samples every 30 seconds. Not account-wide totals.`)},[()=>pa($.data?.sessionsAt)]),q(e,ee),Ke()}wr([`click`]);var sc=K(`

      `),cc=K(`

      Relative usage/credits are not tokens or quota percentages. Groupings - describe the same usage, not additional consumption.

      `,1),lc=K(`// APPROXIMATE`),uc=K(`

      Partial accounting: totals may still change.

      `),dc=K(`

      Percentage of this period's historical allowance, not today's limit. May - exceed 100%. This is not a manual/automatic reset log.

      `,1),fc=K(`

      `,1),pc=K(`

      This optional account report is unavailable. Token history remains - available; missing data does not mean zero usage.

      `),mc=K(`
      `),hc=K(`
      `),gc=K(`

      No usage reported for this day.

      `),_c=K(`

      Selected breakdown unavailable; missing does not mean zero.

      `),vc=K(`

      `,1);function yc(e,t){Ge(t,!0);let n=F(`surface`),r=F(0),i=N(()=>t.reports?.daily),a=N(()=>t.reports?.plan),o=N(()=>t.mode===`breakdown`?W(i)?.days.length||0:W(a)?.periods.length||0),s=N(()=>Math.min(W(r),Math.max(0,W(o)-1))),c=N(()=>W(i)?.days[(W(i)?.days.length||0)-1-W(s)]),l=N(()=>W(a)?.periods[W(s)]),u=N(()=>t.mode===`breakdown`?W(i)?.units||``:`%`),d=N(()=>{let e=Object.create(null);if(t.mode===`breakdown`)e=W(c)?.groups[W(n)]||{};else{let t=W(n)===`feature`?`thread_source`:W(n)===`task start`?`turn_trigger`:W(n);for(let n of W(l)?.breakdowns||[])if(n.dimension===t)for(let t of n.rows)e[t.key]=(e[t.key]||0)+t.basis_points/100}return Object.entries(e).sort((e,t)=>t[1]-e[1]||e[0].localeCompare(t[0]))}),f=N(()=>t.mode===`breakdown`?W(c)?.total:W(l)?.used_basis_points==null?null:W(l).used_basis_points/100),p=N(()=>Math.max(1,W(f)||0,...W(d).map(([,e])=>e))),m=e=>e==null?`UNKNOWN`:e.toLocaleString(`en-GB`,{maximumFractionDigits:2});var h=vc(),g=R(h),v=L(g),y=B(L(v)),b=L(y);b.value=b.__value=`surface`;var x=B(b);x.value=x.__value=`model`;var S=B(x);S.value=S.__value=`feature`;var C=B(S);C.value=C.__value=`task start`,M(y),hi(y),M(v);var w=B(v,2),ee=B(w,2),T=z(B(ee,2),!0);M(g);var te=B(g,2),E=L(te),D=z(E,!0),O=B(E,2),ne=z(O),k=B(O,2),re=e=>{var t=cc(),n=R(t),r=z(n),a=B(n,2),o=e=>{var t=sc(),n=z(t);V(()=>J(n,`Data as of ${W(i).dataAsOf??``}`)),q(e,t)};Y(a,e=>{W(i).dataAsOf&&e(o)});var s=z(B(a,2));Ce(2),V((e,t)=>{J(r,`Latest fetch ${e??``} // queried ${W(i).from??``} → ${W(i).through??``}. - Reports are fetched from OpenAI and are not saved between runs.`),J(s,`${(W(c)?.date||`No daily buckets reported`)??``} // ${t??``} - ${W(u)??``}`)},[()=>pa(W(i).fetchedAt),()=>m(W(f))]),q(e,t)},ie=e=>{var t=fc(),n=R(t),r=L(n);let i;var o=z(r,!0),s=B(r),c=e=>{q(e,lc())};Y(s,e=>{W(a).approximate&&e(c)});var u=B(s);M(n);var d=B(n,2),p=L(d),h=B(p),g=e=>{var t=Pr();V(()=>J(t,`// Boundary tolerance ${W(a).boundary_tolerance_seconds??``}s`)),q(e,t)};Y(h,e=>{W(a).boundary_tolerance_seconds!=null&&e(g)}),M(d);var _=B(d,2),v=e=>{var t=dc(),n=R(t),r=L(n),i=B(r);let a;var o=z(i);M(n);var s=B(n,2),c=z(s),u=B(s,2),d=e=>{q(e,uc())};Y(u,e=>{W(l).accounting_complete||e(d)}),Ce(2),V(e=>{J(r,`${W(l).window_minutes??``} MIN // ${W(l).plan_type??``} // `),a=li(i,1,`svelte-1fbui7h`,null,a,{muted:W(f)==null,"quota-near":W(f)!=null&&W(f)>=80&&W(f)<100,"quota-full":W(f)!=null&&W(f)>=100}),J(o,`USED ${e??``}${W(f)==null?``:`%`}`),J(c,`${W(l).starts_at??``} → ${W(l).ends_at??``}`)},[()=>m(W(f))]),q(e,t)};Y(_,e=>{W(l)&&e(v)}),V(e=>{i=li(r,1,`svelte-1fbui7h`,null,i,{"quality-warning":!W(a).coverage_complete}),J(o,W(a).coverage_complete?`Reported range complete`:`Partial coverage`),J(u,` // Latest fetch ${e??``}`),J(p,`Coverage starts ${(W(a).coverage_start||`unknown`)??``} // Data as of ${(W(a).data_as_of||`unknown`)??``}`)},[()=>pa(W(a).fetchedAt)]),q(e,t)},ae=e=>{q(e,pc())};Y(k,e=>{t.mode===`breakdown`&&W(i)?e(re):t.mode===`periods`&&W(a)?e(ie,1):e(ae,-1)});var oe=B(k,2),se=e=>{var n=hc(),r=L(n),i=z(B(L(r),2),!0);M(r),X(B(r,2),17,()=>W(d),Jr,(e,n,r)=>{var i=N(()=>_(W(n),2));let a=()=>W(i)[0],o=()=>W(i)[1];var s=mc();let c;var l=L(s),u=z(l,!0),d=B(l,2),f=L(d);let h;M(d);var g=z(B(d,2));M(s),V((e,n,i)=>{c=li(s,1,`report-row svelte-1fbui7h`,null,c,{unknown:e,alternate:r%2==1}),Z(l,`title`,a()),J(u,a()),h=di(f,``,h,{width:n}),J(g,`${i??``}${t.mode===`periods`?`%`:``}`)},[()=>a().trim().toLowerCase()===`unknown`,()=>`${Math.max(0,100*o()/W(p))}%`,()=>m(o())]),q(e,s)}),M(n),V(()=>J(i,t.mode===`breakdown`?W(u):`QUOTA USED`)),q(e,n)},ce=e=>{q(e,gc())},le=e=>{q(e,_c())};Y(oe,e=>{W(d).length?e(se):t.mode===`breakdown`&&W(c)?.total===0&&W(c)?.groups[W(n)]!=null?e(ce,1):(W(i)&&t.mode===`breakdown`||W(a)&&t.mode===`periods`)&&e(le,2)}),M(te),V(()=>{w.disabled=W(s)>=W(o)-1,ee.disabled=W(s)===0,J(T,W(o)?`${W(s)+1} / ${W(o)}`:`NO DATA`),J(D,t.mode===`breakdown`?`DAILY BREAKDOWN`:`QUOTA WINDOWS`),J(ne,`${(t.mode===`breakdown`?t.reports?.dailyStatus||`UNAVAILABLE`:t.reports?.planStatus||`UNAVAILABLE`)??``} // UTC`)}),gi(y,()=>W(n),e=>I(n,e)),G(`click`,w,()=>I(r,W(s)+1)),G(`click`,ee,()=>I(r,W(s)-1)),q(e,h),Ke()}wr([`click`]);var bc=864e5;function xc(e,t){let n=new Date(e);n.setUTCDate(1),n.setUTCMonth(n.getUTCMonth()+t);let r=new Date(Date.UTC(n.getUTCFullYear(),n.getUTCMonth()+1,0)).getUTCDate();return n.setUTCDate(Math.min(e.getUTCDate(),r)),n}function Sc(e,t,n){let r=new Date(Date.UTC(e.getUTCFullYear(),e.getUTCMonth(),e.getUTCDate()));for(let e=0;;e++){let i=xc(r,-t),a=new Date(i.getTime()+bc);if(e===n)return{start:a,end:r};r=i}}var Cc=K(``),wc=K(``,1),Tc=K(`

      History refresh failed. Any displayed history is the last successful - observation.

      `),Ec=K(`

      Token history unavailable; other reports may still be available.

      `),Dc=K(``),Oc=K(`
      `),kc=K(`

      LESS ░ ▒ ▓ █ MORE // HOVER FOR DATE AND TOKENS

      `,1),Ac=K(`
      `,1),jc=K(` `),Mc=K(`

      LIFETIME TOKENS

      PEAK DAY

      CURRENT STREAK

      DAYS

      LONGEST TURN

      SECONDS

      LONGEST STREAK

      DAYS

      OPENAI // UTC

      Accessible data table
      Date (UTC)Tokens

      `,1),Nc=K(`

      History unavailable or awaiting a matching account observation. Missing - history is not treated as zero usage.

      `),Pc=K(`

      USAGE // ACCOUNT HISTORY

      Account-wide history reported by Codex, not the local Sessions counter. Dates - use UTC. Allowance history is approximate where indicated; reset causes are - not provided.

      `,1);function Fc(e,t){Ge(t,!0);let n=F(`daily`),r=F(12),i=F(0),a=N(()=>{let e=$.data?.usage?.dailyUsageBuckets;if(!e)return[];let{start:t,end:n}=Sc(new Date,W(r),W(i)),a=new Map;for(let t of e)!Number.isFinite(t.tokens)||t.tokens<0||a.set(t.startDate,(a.get(t.startDate)||0)+t.tokens);let o=[];for(let e=t;e<=n;e=new Date(e.getTime()+864e5)){let t=e.toISOString().slice(0,10);o.push({date:t,tokens:a.get(t)||0})}return o}),o=N(()=>Math.max(1,...W(a).map(e=>e.tokens))),s=N(()=>W(a).length?new Date(W(a)[0].date+`T00:00:00Z`).getUTCDay():0),c=N(()=>{if(W(n)===`monthly`){let e=new Map;for(let t of W(a))e.set(t.date.slice(0,7),(e.get(t.date.slice(0,7))||0)+t.tokens);return[...e].map(([e,t])=>({date:e,tokens:t}))}let e=0;return W(a).map(t=>({date:t.date,tokens:e+=t.tokens}))});var l=Pc(),u=B(R(l),4);X(u,20,()=>[[`daily`,`Daily`],[`monthly`,`Monthly`],[`cumulative`,`Cumulative`],[`breakdown`,`Breakdown`],[`periods`,`Windows`]],Jr,(e,t)=>{var r=N(()=>_(t,2));let a=()=>W(r)[0],o=()=>W(r)[1];var s=Cc();let c;var l=z(s,!0);V(()=>{Z(s,`aria-pressed`,W(n)===a()),c=li(s,1,``,null,c,{active:W(n)===a()}),J(l,o())}),G(`click`,s,()=>{I(n,a(),!0),I(i,0)}),q(e,s)}),M(u);var d=B(u,2),f=L(d),p=e=>{var t=wc(),n=R(t),a=B(L(n)),o=L(a);o.value=o.__value=6;var s=B(o);s.value=s.__value=12,M(a),hi(a),M(n);var c=B(n),l=B(c);V(()=>l.disabled=W(i)===0),G(`change`,a,()=>I(i,0)),gi(a,()=>W(r),e=>I(r,e)),G(`click`,c,()=>Jt(i)),G(`click`,l,()=>Jt(i,-1)),q(e,t)};Y(f,e=>{W(n)!==`breakdown`&&W(n)!==`periods`&&e(p)}),M(d);var m=B(d,2),h=e=>{q(e,Tc())};Y(m,e=>{$.data?.usageError&&e(h)});var g=B(m,2),v=e=>{q(e,Ec())};Y(g,e=>{$.data?.usage?.tokenStatus===`UNAVAILABLE`&&W(n)!==`breakdown`&&W(n)!==`periods`&&e(v)});var y=B(g,2),b=e=>{var t=Fr();qr(R(t),()=>W(n),e=>{{let t=N(()=>$.data?.usage?.reports);yc(e,{get reports(){return W(t)},get mode(){return W(n)}})}}),q(e,t)},x=e=>{var t=Mc(),r=R(t),i=L(r),l=z(B(L(i),2),!0);M(i);var u=B(i,2),d=z(B(L(u),2),!0);M(u);var f=B(u,2),p=B(L(f),2),m=L(p);Ce(),M(p),M(f);var h=B(f,2),g=B(L(h),2),_=L(g);Ce(),M(g),M(h);var v=B(h,2),y=B(L(v),2),b=L(y);Ce(),M(y),M(v),M(r);var x=B(r,4),S=L(x),C=z(S),w=B(S,2),ee=e=>{var t=kc(),n=R(t),r=L(n),i=L(r);X(i,17,()=>Array(W(s)),Jr,(e,t)=>{q(e,Dc())}),X(B(i,2),17,()=>W(a),Jr,(e,t)=>{var n=Oc();let r,i;V(e=>{r=li(n,1,`heat-cell`,null,r,{zero:W(t).tokens===0}),Z(n,`title`,e),i=di(n,``,i,{opacity:W(t).tokens?.25+.75*W(t).tokens/W(o):1})},[()=>`${W(t).date}: ${fa(W(t).tokens)} tokens`]),q(e,n)}),M(r),M(n),Ce(2),q(e,t)},T=e=>{var t=Ac(),r=R(t);{let e=N(()=>W(c).map(e=>e.tokens)),t=N(()=>W(n)+` usage`);no(r,{get values(){return W(e)},get label(){return W(t)}})}var i=B(r,2),a=L(i),o=z(a,!0),s=z(B(a),!0);M(i),V(e=>{J(o,W(c)[0]?.date),J(s,e)},[()=>W(c).at(-1)?.date]),q(e,t)};Y(w,e=>{W(n)===`daily`?e(ee):e(T,-1)});var te=B(w,2),E=B(L(te),2),D=L(E),O=B(L(D));X(O,21,()=>W(n)===`daily`?W(a):W(c),Jr,(e,t)=>{var n=jc(),r=L(n),i=z(r,!0),a=z(B(r),!0);M(n),V(e=>{J(i,W(t).date),J(a,e)},[()=>fa(W(t).tokens)]),q(e,n)}),M(O),M(D),M(E),M(te),M(x);var ne=z(B(x,2));V((e,t,n,r,i,o,s)=>{J(l,e),J(d,t),J(m,`${n??``} `),J(_,`${r??``} `),J(b,`${i??``} `),J(C,`${W(a)[0]?.date??``} — ${o??``}`),J(ne,`OBSERVED ${s??``} // CUMULATIVE IS FOR THE SELECTED PERIOD`)},[()=>fa($.data.usage.summary.lifetimeTokens),()=>fa($.data.usage.summary.peakDailyTokens),()=>fa($.data.usage.summary.currentStreakDays),()=>fa($.data.usage.summary.longestRunningTurnSec),()=>fa($.data.usage.summary.longestStreakDays),()=>W(a).at(-1)?.date,()=>pa($.data.usageAt)]),q(e,t)},S=e=>{q(e,Nc())};Y(y,e=>{W(n)===`breakdown`||W(n)===`periods`?e(b):$.data?.usage&&$.data.usage.dailyUsageBuckets!==null?e(x,1):e(S,-1)}),q(e,l),Ke()}wr([`click`,`change`]);var Ic=K(`

      Page not found

      Return to Quota

      `,1);function Lc(e){var t=Ic();Ce(2),q(e,t)}var Rc=`CODEXOMETER`,zc=[`█▀▀ █▀█ █▀▄ █▀▀ ▀▄▀ █▀█ █▀▄▀█ █▀▀ ▀█▀ █▀▀ █▀█`,`█▄▄ █▄█ █▄▀ ██▄ █ █ █▄█ █ ▀ █ ██▄ █ ██▄ █▀▄`].flatMap(e=>[[...e].map(e=>e===`█`||e===`▀`),[...e].map(e=>e===`█`||e===`▄`)]),Bc=zc[0].length,Vc=zc.length,Hc=0,Uc=[...Rc].map(e=>{let t=e===`M`?5:3,n={start:Hc,width:t};return Hc+=t+1,n}),Wc=`ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789`,Gc=`010 101 111 101.110 111 101 110.111 100 100 111.110 101 101 110.111 100 110 111.111 100 110 100.111 100 101 111.101 101 111 101.111 010 010 111.001 001 101 111.101 110 110 101.100 100 100 111.101 111 101 101.101 111 111 101.111 101 101 111.111 101 111 100.111 101 111 001.111 101 110 101.111 100 001 111.111 010 010 010.101 101 101 111.101 101 101 010.101 101 111 101.101 010 010 101.101 101 010 010.111 001 100 111.111 101 101 111.110 010 010 111.111 001 110 111.111 011 001 111.101 101 111 001.111 110 001 111.100 111 101 111.111 001 010 010.111 111 101 111.111 101 111 001`.split(`.`).map(e=>e.split(` `));function Kc(e=Rc,t=-1,n=!1){let r=``;for(let i=0;i{e|=0,e=e+1831565813|0;let t=Math.imul(e^e>>>15,1|e);return t^=t+Math.imul(t^t>>>7,61|t),((t^t>>>14)>>>0)/4294967296}}function Xc(){let e=qc[Math.floor(Math.random()*qc.length)],t=Math.floor(Math.random()*4294967296),n=Yc(t),r=[...Rc].map((e,t)=>t);for(let e=r.length-1;e>0;e--){let t=Math.floor(n()*(e+1));[r[e],r[t]]=[r[t],r[e]]}return{variant:e,seed:t,order:r}}function Zc(e,t){if(e.variant===`typing`){let e=t<1080,n=e?0:Math.min(Math.floor((t-1080)/90)+1,11);return{text:Rc.slice(0,n).padEnd(11),cursor:n,dot:e?Math.floor(t/180)%2==0:n<11}}if(e.variant===`shuffle`){let n=Yc(e.seed^Math.floor(t/70)),r=[...Rc].map(e=>{let t;do t=Wc[Math.floor(n()*36)];while(t===e);return t}),i=Math.min(Math.floor(t/110),11);for(let t of e.order.slice(0,i))r[t]=Rc[t];return{text:r.join(``),cursor:-1,dot:!1}}return{text:Rc,cursor:-1,dot:!1}}var Qc=Nr(``);function $c(e,t){Ge(t,!0);let n=Q(t,`text`,3,Rc),r=Q(t,`cursor`,19,()=>-1),i=Q(t,`dot`,3,!1),a=N(()=>Kc(n(),r(),i()));var o=Qc(),s=z(o);V(()=>{Z(o,`viewBox`,`0 0 ${Bc} ${Vc}`),Z(o,`width`,Bc),Z(o,`height`,Vc),Z(s,`d`,W(a))}),q(e,o),Ke()}var el=K(`
      `),tl=K(`
      `);function nl(e,t){Ge(t,!0);let n=F(void 0),r=F(0),i=F(Zt({width:0,height:0,pixelRatio:1})),a=F(Zt({x:0,y:0,width:0})),o=N(()=>W(n)?Zc(W(n),W(r)):void 0),s=N(()=>{if(!W(n))return{x:0,y:0,width:0};let e=Jc[W(n).variant],t=Math.min(Math.max((W(r)-e-180)/800,0),1),o=t*t*(3-2*t),s=W(i).width+(W(a).width-W(i).width)*o,c=Math.max((W(i).height-W(i).width*Vc/Bc)/2,0),l=(W(n).variant===`slide`&&W(r)Math.round(e*W(i).pixelRatio)/W(i).pixelRatio;return{x:d(l),y:d(u),width:d(s)}});Gi(()=>{let e=matchMedia(`(prefers-reduced-motion: reduce)`);if(e.matches){t.onfinish();return}I(n,Xc(),!0);let o=Jc[W(n).variant]+180+800,s=0,c=!1,l=performance.now(),u=()=>{let e=t.target?.getBoundingClientRect();I(i,{width:window.innerWidth,height:window.innerHeight,pixelRatio:window.devicePixelRatio||1},!0),e&&I(a,{x:e.x,y:e.y,width:e.width},!0)},d=()=>{c||(c=!0,cancelAnimationFrame(s),t.onfinish())},f=e=>{e instanceof PointerEvent&&e.button!==0||e instanceof KeyboardEvent&&(e.metaKey||e.ctrlKey||e.altKey||e.shiftKey)||e instanceof KeyboardEvent&&[`Shift`,`Control`,`Alt`,`Meta`].includes(e.key)||(e.preventDefault(),e.stopImmediatePropagation(),d())},p=()=>{e.matches&&d()},m=e=>{I(r,Math.max(e-l,0),!0),W(r)>=o?d():s=requestAnimationFrame(m)},h=new ResizeObserver(u);if(t.target){h.observe(t.target),t.target.parentElement&&h.observe(t.target.parentElement);let e=t.target.closest(`header`);e&&h.observe(e)}return u(),window.addEventListener(`resize`,u),document.addEventListener(`keydown`,f,!0),document.addEventListener(`pointerdown`,f,!0),e.addEventListener(`change`,p),s=requestAnimationFrame(m),()=>{c=!0,cancelAnimationFrame(s),h.disconnect(),window.removeEventListener(`resize`,u),document.removeEventListener(`keydown`,f,!0),document.removeEventListener(`pointerdown`,f,!0),e.removeEventListener(`change`,p)}});var c=tl(),l=L(c),u=e=>{var t=el();let n;$c(L(t),{get text(){return W(o).text},get cursor(){return W(o).cursor},get dot(){return W(o).dot}}),M(t),V(()=>{Z(t,`data-text`,W(o).text),Z(t,`data-cursor`,W(o).dot?W(o).cursor:void 0),n=di(t,``,n,{left:`${W(s).x}px`,top:`${W(s).y}px`,width:`${W(s).width}px`})}),q(e,t)};Y(l,e=>{W(o)&&e(u)});var d=B(l,2);M(c),V(()=>Z(c,`data-entrance`,W(n)?.variant)),G(`click`,d,function(...e){t.onfinish?.apply(this,e)}),q(e,c),Ke()}wr([`click`]);var rl=K(` `),il=K(`

      `),al=K(`

      Connecting to your local Codexometer…

      `),ol=K(``),sl=K(`

      Your quota. Your sessions. Your command centre.

      `);function cl(e,t){Ge(t,!0);let n={"/":$a,"/quota/:view?":$a,"/sessions/:id?":oc,"/usage":Fc,"*":Lc},r={quota:/^(?:\/|\/quota(?:\/[^/]+)?\/?)$/,sessions:/^\/sessions(?:\/[^/]+)?\/?$/,usage:/^\/usage\/?$/},i=F(`hacker`),a=F(!0),o=F(void 0),s=[`hacker`,`rust`,`blue-steel`,`ultraviolet`,`nightshade`];bn(()=>{sa()}),bn(()=>{if($.data)for(let[e,t]of Object.entries(r))t.test(Yi.location)&&(aa.tab=e)}),Gi(()=>{try{let e=localStorage.getItem(`codexometer.web.theme`);e&&s.includes(e)&&I(i,e,!0)}catch{}return va()});function c(){try{localStorage.setItem(`codexometer.web.theme`,W(i))}catch{}}var l=sl(),u=L(l),d=L(u),f=L(d);$c(L(f),{}),M(f),Li(f,e=>I(o,e),()=>W(o)),Ce(2),M(d);var p=B(d,2),m=L(p);let h;var g=B(m,1,!0),v=z(B(g));M(p),M(u);var y=B(u,2);X(y,21,()=>Object.entries(r),Jr,(e,t)=>{var n=N(()=>_(W(t),2));let r=()=>W(n)[0],i=()=>W(n)[1],a=N(()=>i().test(Yi.location));var o=rl();let s;var c=z(o,!0);V(e=>{Z(o,`href`,r()===`quota`?`#/quota/`+aa.view:`#/`+r()),Z(o,`aria-current`,W(a)?`page`:void 0),s=li(o,1,``,null,s,{active:W(a)}),J(c,e)},[()=>r().toUpperCase()]),q(e,o)}),M(y);var b=B(y,2),x=L(b),S=e=>{var t=il(),n=z(t,!0);V(()=>J(n,$.error)),q(e,t)};Y(x,e=>{$.error&&e(S)});var C=B(x,2),w=e=>{$i(e,{get routes(){return n}})},ee=e=>{q(e,al())};Y(C,e=>{$.data?e(w):$.error||e(ee,1)}),M(b);var T=B(b,2),te=L(T),E=z(te),D=B(te,2),O=z(D,!0),ne=B(D,2),k=B(L(ne));X(k,21,()=>s,Jr,(e,t)=>{var n=ol(),r=z(n,!0),i={};V(e=>{J(r,e),i!==(i=W(t))&&(n.value=(n.__value=i)??``)},[()=>W(t).replace(`-`,` `).toUpperCase()]),q(e,n)}),M(k),hi(k),M(ne),M(T);var re=B(T,2),ie=e=>{nl(e,{get target(){return W(o)},onfinish:()=>I(a,!1)})};Y(re,e=>{W(a)&&e(ie)}),M(l),V(()=>{Z(l,`data-theme`,W(i)),Z(l,`data-starting`,W(a)),u.inert=W(a),h=li(m,1,`lamp`,null,h,{lit:$.connected}),J(g,$.connected?`CONNECTED`:`OFFLINE`),J(v,`EXPERIMENTAL // ${$.data?.control?`SESSION CONTROL`:`READ ONLY`}`),y.inert=W(a),b.inert=W(a),T.inert=W(a),J(E,`v${($.data?.version||`…`)??``} // LOCAL ONLY`),J(O,$.data?.control?`Session control enabled. Stop the server to revoke access.`:`No actions can be sent from this preview.`)}),G(`change`,k,c),gi(k,()=>W(i),e=>I(i,e)),q(e,l),Ke()}wr([`change`]),Vr(cl,{target:document.getElementById(`app`)}); \ No newline at end of file diff --git a/internal/web/dist/assets/index-Bd-Jwk4i.js b/internal/web/dist/assets/index-Bd-Jwk4i.js new file mode 100644 index 0000000..ea7c245 --- /dev/null +++ b/internal/web/dist/assets/index-Bd-Jwk4i.js @@ -0,0 +1,45 @@ +(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 e=Array.isArray,t=Array.prototype.indexOf,n=Array.prototype.includes,r=Array.from,i=Object.defineProperty,a=Object.getOwnPropertyDescriptor,o=Object.getOwnPropertyDescriptors,s=Object.prototype,c=Array.prototype,l=Object.getPrototypeOf,u=Object.isExtensible;function d(e){return typeof e==`function`}var f=()=>{};function p(e){return e()}function m(e){for(var t=0;t{e=n,t=r}),resolve:e,reject:t}}function g(e,t,n=!1){return e===void 0?n?t():t:e}function _(e,t){if(Array.isArray(e))return e;if(t===void 0||!(Symbol.iterator in e))return Array.from(e);let n=[];for(let r of e)if(n.push(r),n.length===t)break;return n}var v=1024,y=2048,b=4096,x=8192,S=16384,C=32768,w=1<<25,T=65536,E=1<<19,D=1<<20,ee=1<<25,te=1<<21,O=1<<22,k=1<<23,ne=Symbol(`$state`),re=Symbol(`component`),ie=Symbol(`legacy props`),ae=Symbol(``),oe=Symbol(`attributes`),se=Symbol(`class`),A=Symbol(`style`),ce=Symbol(`text`),le=Symbol(`form reset`),ue=new class extends Error{name=`StaleReactionError`;message="The reaction that called `getAbortSignal()` was re-run or destroyed"},de=!!globalThis.document?.contentType&&globalThis.document.contentType.includes(`xml`),fe={},j=Symbol(`uninitialized`),pe=`http://www.w3.org/1999/xhtml`;function me(){console.warn(`https://svelte.dev/e/derived_inert`)}function he(e){console.warn(`https://svelte.dev/e/hydration_mismatch`)}function ge(){console.warn(`https://svelte.dev/e/select_multiple_invalid_value`)}function _e(){console.warn(`https://svelte.dev/e/svelte_boundary_reset_noop`)}var M=!1;function ve(e){M=e}var N;function ye(e){if(e===null)throw he(),fe;return N=e}function be(){return ye(on(N))}function P(e){if(M){if(on(N)!==null)throw he(),fe;N=e}}function xe(e=1){if(M){for(var t=e,n=N;t--;)n=on(n);N=n}}function Se(e=!0){for(var t=0,n=N;;){if(n.nodeType===8){var r=n.data;if(r===`]`){if(t===0)return n;--t}else(r===`[`||r===`[!`||r[0]===`[`&&!isNaN(Number(r.slice(1))))&&(t+=1)}var i=on(n);e&&n.remove(),n=i}}function Ce(e){if(!e||e.nodeType!==8)throw he(),fe;return e.data}function we(e){return e===this.v}function Te(e,t){return e==e?e!==t||typeof e==`object`&&!!e||typeof e==`function`:t==t}function Ee(e){return!Te(e,this.v)}function De(e){throw Error(`https://svelte.dev/e/lifecycle_outside_component`)}function Oe(){throw Error(`https://svelte.dev/e/async_derived_orphan`)}function ke(e,t,n){throw Error(`https://svelte.dev/e/each_key_duplicate`)}function Ae(e){throw Error(`https://svelte.dev/e/effect_in_teardown`)}function je(){throw Error(`https://svelte.dev/e/effect_in_unowned_derived`)}function Me(e){throw Error(`https://svelte.dev/e/effect_orphan`)}function Ne(){throw Error(`https://svelte.dev/e/effect_update_depth_exceeded`)}function Pe(e){throw Error(`https://svelte.dev/e/props_invalid_value`)}function Fe(){throw Error(`https://svelte.dev/e/state_descriptors_fixed`)}function Ie(){throw Error(`https://svelte.dev/e/state_prototype_fixed`)}function Le(){throw Error(`https://svelte.dev/e/state_unsafe_mutation`)}function Re(){throw Error(`https://svelte.dev/e/svelte_boundary_reset_onerror`)}var ze=!1;function Be(){ze=!0}var Ve=null;function He(e){Ve=e}function Ue(e,t=!1,n){Ve={p:Ve,i:!1,c:null,e:null,s:e,x:null,r:G,l:ze&&!t?{s:null,u:null,$:[]}:null}}function We(e){var t=Ve,n=t.e;if(n!==null){t.e=null;for(var r of n)yn(r)}return e!==void 0&&(t.x=e),t.i=!0,Ve=t.p,Ge(e)}function Ge(e={}){return i(e,re,{value:!0}),e}function Ke(){return!ze||Ve!==null&&Ve.l===null}var qe=[];function Je(){var e=qe;qe=[],m(e)}function Ye(e){if(qe.length===0&&!Ct){var t=qe;queueMicrotask(()=>{t===qe&&Je()})}qe.push(e)}function Xe(){for(;qe.length>0;)Je()}var Ze=~(y|b|v);function Qe(e,t){e.f=e.f&Ze|t}function $e(e){e.f&512||e.deps===null?Qe(e,v):Qe(e,b)}function et(e,t,n){e.f&2048?t.add(e):e.f&4096&&n.add(e),Qe(e,v)}function tt(e){M&&an(e)!==null&&sn(e)}var nt=!1;function rt(){nt||(nt=!0,document.addEventListener(`reset`,e=>{Promise.resolve().then(()=>{if(!e.defaultPrevented)for(let t of e.target.elements)t[le]?.()})},{capture:!0}))}function it(e){var t=W,n=G;Un(null),Wn(null);try{return e()}finally{Un(t),Wn(n)}}function at(e,t,n,r=n){e.addEventListener(t,()=>it(n));let i=e[le];e[le]=i?()=>{i(),r(!0)}:()=>r(!0),rt()}function ot(e,t,n,r){let i=Ke()?ut:pt;var a=e.filter(e=>!e.settled),o=t.map(i);if(n.length===0&&a.length===0){r(o);return}var s=G,c=st(),l=a.length===1?a[0].promise:a.length>1?Promise.all(a.map(e=>e.promise)):null;function u(e){if(!(s.f&16384)){c();try{r([...o,...e])}catch(e){fn(e,s)}ct()}}var d=lt();if(n.length===0){l.then(()=>u([])).finally(d);return}function f(){Promise.all(n.map(e=>ft(e))).then(u).catch(e=>fn(e,s)).finally(d)}l?l.then(()=>{c(),f(),ct()}):f()}function st(){var e=G,t=W,n=Ve,r=I;return function(i=!0){Wn(e),Un(t),He(n),i&&!(e.f&16384)&&(r?.activate(),r?.apply())}}function ct(e=!0){Wn(null),Un(null),He(null),e&&I?.deactivate()}function lt(){var e=G,t=e.b,n=I,r=!!t?.is_rendered();return t?.update_pending_count(1,n),n.increment(r,e),()=>{t?.update_pending_count(-1,n),n.decrement(r,e)}}function ut(e){var t=2|y;return G!==null&&(G.f|=E),{ctx:Ve,deps:null,effects:null,equals:we,f:t,fn:e,reactions:null,rv:0,v:j,wv:0,parent:G,ac:null}}var dt=Symbol(`obsolete`);function ft(e,t,n){let r=G;r===null&&Oe();var i=void 0,a=Bt(j),o=!W,s=new Set;return Cn(()=>{var t=G,n=h();i=n.promise;try{Promise.resolve(e()).then(n.resolve,e=>{e!==ue&&n.reject(e)}).finally(ct)}catch(e){n.reject(e),ct()}var c=I;if(o){if(t.f&32768)var l=lt();if(r.b?.is_rendered())c.async_deriveds.get(t)?.reject(dt);else for(let e of s.values())e.reject(dt);s.add(n),c.async_deriveds.set(t,n)}let u=(e,t=void 0)=>{l?.(),s.delete(n),t!==dt&&(c.activate(),t?(a.f|=k,Wt(a,t)):(a.f&8388608&&(a.f^=k),Wt(a,e)),c.deactivate())};n.promise.then(u,e=>u(null,e||`unknown`))}),_n(()=>{for(let e of s)e.reject(dt)}),new Promise(e=>{function t(n){function r(){n===i?e(a):t(i)}n.then(r,r)}t(i)})}function F(e){let t=ut(e);return Kn(t),t}function pt(e){let t=ut(e);return t.equals=Ee,t}function mt(e){var t=e.effects;if(t!==null){e.effects=null;for(var n=0;n{t.ac.abort(ue),t.ac=null}),t.fn!==null&&(t.teardown=f),sr(t,0),On(t))}function vt(e){if(e.effects!==null)for(let t of e.effects)t.teardown&&t.fn!==null&&cr(t)}var yt=null,I=null,bt=null,xt=null,St=null,Ct=!1,wt=!1,Tt=null,Et=null,Dt=0,Ot=1,kt=class e{id=Ot++;#e=!1;linked=!0;#t=null;#n=null;async_deriveds=new Map;current=new Map;previous=new Map;#r=new Set;#i=new Set;#a=0;#o=new Map;#s=null;#c=[];#l=[];#u=new Set;#d=new Set;#f=new Map;#p=new Set;is_fork=!1;#m=!1;constructor(){yt===null?yt=this:(yt.#n=this,this.#t=yt),yt=this}#h(){if(this.is_fork)return!0;for(let n of this.#o.keys()){for(var e=n,t=!1;e.parent!==null;){if(this.#f.has(e)){t=!0;break}e=e.parent}if(!t)return!0}return!1}skip_effect(e){this.#f.has(e)||this.#f.set(e,{d:[],m:[]}),this.#p.delete(e)}unskip_effect(e,t=e=>this.schedule(e)){var n=this.#f.get(e);if(n){this.#f.delete(e);for(var r of n.d)Qe(r,y),t(r);for(r of n.m)Qe(r,b),t(r)}this.#p.add(e)}#g(){var e=[];for(let i of this.#c)if(!(i.f&16384||!(i.f&6144))){for(var t=i,n=!1;t.parent!==null;){t=t.parent;var r=t.f;if(r&96){if(!(r&1024)){n=!0;break}t.f^=v}}n||e.push(t)}return this.#c=[],e}#_(){this.#e=!0;for(let e of this.#u)this.#d.delete(e),Qe(e,y),this.schedule(e);for(let e of this.#d)Qe(e,b),this.schedule(e);this.apply();for(var t=Tt=[],n=[],r=Et=[];this.#c.length>0;){Dt++>1e3&&(this.#S(),jt());for(let e of this.#g())try{this.#v(e,t,n)}catch(t){throw It(e),this.#h()||this.discard(),t}}if(I=null,r.length>0){var i=e.ensure();for(let e of r)i.schedule(e)}if(Tt=null,Et=null,this.#h()){this.#x(n),this.#x(t);for(let[e,t]of this.#f)Ft(e,t);r.length>0&&I.#_();return}let a=this.#y();if(a){this.#x(n),this.#x(t),a.#b(this);return}this.#u.clear(),this.#d.clear();for(let e of this.#r)e(this);this.#r.clear(),bt=this,Nt(n),Nt(t),bt=null,this.#s?.resolve();var o=I;if(this.#a===0&&(this.#c.length===0||o!==null)&&this.#S(),this.#c.length>0){if(o!==null){for(let e of this.#c)o.#c.push(e);this.#c=[]}else o=this}o!==null&&(Rt.clear(),o.#_())}#v(e,t,n){e.f^=v;for(var r=e.first;r!==null;){var i=r.f,a=!!(i&96);if(!(a&&i&1024||i&8192||this.#f.has(r))&&r.fn!==null){a?r.f^=v:i&4?t.push(r):nr(r)&&(i&16&&this.#d.add(r),cr(r));var o=r.first;if(o!==null){r=o;continue}}for(;r!==null;){var s=r.next;if(s!==null){r=s;break}r=r.parent}}}#y(){for(var e=this.#t;e!==null;){if(!e.is_fork){for(let[t,[,n]]of this.current)if(e.current.has(t)&&!n)return e}e=e.#t}return null}#b(e){for(let[t,n]of e.current)!this.previous.has(t)&&e.previous.has(t)&&this.previous.set(t,e.previous.get(t)),this.current.set(t,n);for(let[t,n]of e.async_deriveds){let e=this.async_deriveds.get(t);e&&n.promise.then(e.resolve).catch(e.reject)}e.async_deriveds.clear(),this.transfer_effects(e.#u,e.#d);let t=e=>{var n=e.reactions;if(n!==null&&!(e.f&2&&!(e.f&6144)))for(let e of n){var r=e.f;if(r&2)t(e);else{var i=e;r&4194320&&!this.async_deriveds.has(i)&&(this.#d.delete(i),Qe(i,y),this.schedule(i))}}};for(let e of this.current.keys())t(e);this.oncommit(()=>e.discard()),e.#S(),I=this,this.#_()}#x(e){for(var t=0;t{this.#m=!1,this.linked&&this.flush()}))}transfer_effects(e,t){for(let t of e)this.#u.add(t);for(let e of t)this.#d.add(e);e.clear(),t.clear()}oncommit(e){this.#r.add(e)}ondiscard(e){this.#i.add(e)}settled(){return(this.#s??=h()).promise}static ensure(){if(I===null){let t=I=new e;!wt&&!Ct&&Ye(()=>{t.#e||t.flush()})}return I}apply(){xt=null}schedule(e){if(St=e,e.b?.is_pending&&e.f&16777228&&!(e.f&32768)){e.b.defer_effect(e);return}this.#c.push(e)}#S(){if(this.linked){var e=this.#t,t=this.#n;e===null||(e.#n=t),t===null?yt=e:t.#t=e,this.linked=!1}}};function At(e){var t=Ct;Ct=!0;try{var n;for(e&&(I!==null&&!I.is_fork&&I.flush(),n=e());;){if(Xe(),I===null)return n;I.flush()}}finally{Ct=t}}function jt(){try{Ne()}catch(e){fn(e,St)}}var Mt=null;function Nt(e){var t=e.length;if(t!==0){for(var n=0;n0)){Rt.clear();for(let e of Mt){if(e.f&24576)continue;let t=[e],n=e.parent;for(;n!==null;)Mt.has(n)&&(Mt.delete(n),t.push(n)),n=n.parent;for(let e=t.length-1;e>=0;e--){let n=t[e];n.f&24576||cr(n)}}Mt.clear()}}Mt=null}}function Pt(e){I.schedule(e)}function Ft(e,t){if(!(e.f&32&&e.f&1024)){e.f&2048?t.d.push(e):e.f&4096&&t.m.push(e),Qe(e,v);for(var n=e.first;n!==null;)Ft(n,t),n=n.next}}function It(e){Qe(e,v);for(var t=e.first;t!==null;)It(t),t=t.next}var Lt=new Set,Rt=new Map,zt=!1;function Bt(e,t){return{f:0,v:e,reactions:null,equals:we,rv:0,wv:0}}function L(e,t){let n=Bt(e,t);return Kn(n),n}function Vt(e,t=!1,n=!0){let r=Bt(e);return t||(r.equals=Ee),ze&&n&&Ve!==null&&Ve.l!==null&&(Ve.l.s??=[]).push(r),r}function R(e,t,n=!1){return W!==null&&(!Hn||W.f&131072)&&Ke()&&W.f&4325394&&(Gn===null||!Gn.has(e))&&Le(),Wt(e,n?Yt(t):t,Et)}var Ht=null,Ut=0;function Wt(e,t,n=null){if(!e.equals(t)){Bn?Rt.set(e,t):Rt.has(e)||Rt.set(e,e.v);var r=kt.ensure();if(r.capture(e,t),e.f&2){let t=e;e.f&2048&&ht(t),xt===null&&$e(t)}e.wv=tr(),Ht=null,Ut=0,Jt(e,y,n),Ht=null,Ke()&&G!==null&&G.f&1024&&!(G.f&96)&&(Yn===null?Xn([e]):Yn.push(e)),!r.is_fork&&Lt.size>0&&!zt&&Gt()}return t}function Gt(){zt=!1;for(let e of Lt){e.f&1024&&Qe(e,b);let t;try{t=nr(e)}catch{t=!0}t&&cr(e)}Lt.clear()}function Kt(e,t=1){var n=K(e),r=t===1?n++:n--;return R(e,n),r}function qt(e){R(e,e.v+1)}function Jt(e,t,n){var r=e.reactions;if(r!==null){var i=Ke(),a=r.length;if(Ut+=a,Ut>1e5&&Ht===null&&(Ht=new Set),Ht!==null){if(Ht.has(e))return;Ht.add(e)}for(var o=0;o{if($n===d)return e();var t=W,n=$n;Un(null),er(d);var r=e();return Un(t),er(n),r};return i&&r.set(`length`,L(t.length,u)),new Proxy(t,{defineProperty(e,t,n){(!(`value`in n)||n.configurable===!1||n.enumerable===!1||n.writable===!1)&&Fe();var i=r.get(t);return i===void 0?f(()=>{var e=L(n.value,u);return r.set(t,e),e}):R(i,n.value,!0),!0},deleteProperty(e,t){var n=r.get(t);if(n===void 0){if(t in e){let e=f(()=>L(j,u));r.set(t,e),qt(o)}}else R(n,j),qt(o);return!0},get(e,n,i){if(n===ne)return t;var o=r.get(n),s=n in e;if(o===void 0&&(!s||a(e,n)?.writable)&&(o=f(()=>L(Yt(s?e[n]:j),u)),r.set(n,o)),o!==void 0){var c=K(o);return c===j?void 0:c}return Reflect.get(e,n,i)},getOwnPropertyDescriptor(e,t){this.has?.(e,t);var n=Reflect.getOwnPropertyDescriptor(e,t),i=r.get(t);if(i!==void 0){var a=K(i);if(a===j)return;if(n&&`value`in n)n.value=a;else return{enumerable:!0,configurable:!0,value:a,writable:!0}}return n},has(e,t){if(t===ne)return!0;var n=r.get(t),i=n!==void 0&&n.v!==j||Reflect.has(e,t);return(n!==void 0||G!==null&&(!i||a(e,t)?.writable))&&(n===void 0&&(n=f(()=>L(i?Yt(e[t]):j,u)),r.set(t,n)),K(n)===j)?!1:i},set(e,t,n,s){var c=r.get(t),l=t in e;if(i&&t===`length`)for(var d=n;dL(j,u)),r.set(d+``,p)):R(p,j)}if(c===void 0)(!l||a(e,t)?.writable)&&(c=f(()=>L(void 0,u)),R(c,Yt(n)),r.set(t,c));else{l=c.v!==j;var m=f(()=>Yt(n));R(c,m)}var h=Reflect.getOwnPropertyDescriptor(e,t);if(h?.set&&h.set.call(s,n),!l){if(i&&typeof t==`string`){var g=r.get(`length`),_=Number(t);Number.isInteger(_)&&_>=g.v&&R(g,_+1)}qt(o)}return!0},ownKeys(e){K(o);var t=Reflect.ownKeys(e).filter(e=>{var t=r.get(e);return t===void 0||t.v!==j});for(var[n,i]of r)i.v!==j&&!(n in e)&&t.push(n);return t},setPrototypeOf(){Ie()}})}function Xt(e){try{if(typeof e==`object`&&e&&ne in e)return e[ne]}catch{}return e}function Zt(e,t){return Object.is(Xt(e),Xt(t))}var Qt,$t,en,tn;function nn(){if(Qt===void 0){Qt=window,$t=/Firefox/.test(navigator.userAgent);var e=Element.prototype,t=Node.prototype,n=Text.prototype;en=a(t,`firstChild`).get,tn=a(t,`nextSibling`).get,u(e)&&(e[se]=void 0,e[oe]=null,e[A]=void 0,e.__e=void 0),u(n)&&(n[ce]=void 0)}}function rn(e=``){return document.createTextNode(e)}function an(e){return en.call(e)}function on(e){return tn.call(e)}function z(e,t){if(!M)return an(e);var n=an(N);if(n===null)n=N.appendChild(rn());else if(t&&n.nodeType!==3){var r=rn();return n?.before(r),ye(r),r}return t&&un(n),ye(n),n}function B(e,t=!1){if(!M){var n=an(e);return n instanceof Comment&&n.data===``?on(n):n}if(t){if(N?.nodeType!==3){var r=rn();return N?.before(r),ye(r),r}un(N)}return N}function V(e,t=!1){if(!M)return an(e);var n=z(e,t);return P(e),n}function H(e,t=1,n=!1){let r=M?N:e;for(var i;t--;)i=r,r=on(r);if(!M)return r;if(n){if(r?.nodeType!==3){var a=rn();return r===null?i?.after(a):r.before(a),ye(a),a}un(r)}return ye(r),r}function sn(e){e.textContent=``}function cn(){return!1}function ln(e,t,n){return t==null||t===`http://www.w3.org/1999/xhtml`?n?document.createElement(e,{is:n}):document.createElement(e):n?document.createElementNS(t,e,{is:n}):document.createElementNS(t,e)}function un(e){if(e.nodeValue.length<65536)return;let t=e.nextSibling;for(;t!==null&&t.nodeType===3;)t.remove(),e.nodeValue+=t.nodeValue,t=e.nextSibling}function dn(e){var t=G;if(t===null)return W.f|=k,e;if(!(t.f&32768)&&!(t.f&4))throw e;fn(e,t)}function fn(e,t){if(!(t!==null&&t.f&16384)){for(;t!==null;){if(t.f&128&&!(t.f&33570816)){if(!(t.f&32768))throw e;try{t.b.error(e);return}catch(t){e=t}}t=t.parent}throw e}}function pn(e){G===null&&(W===null&&Me(e),je()),Bn&&Ae(e)}function mn(e,t){var n=t.last;n===null?t.last=t.first=e:(n.next=e,e.prev=n,t.last=e)}function hn(e,t){var n=G;n!==null&&n.f&8192&&(e|=x);var r={ctx:Ve,deps:null,nodes:null,f:e|y|512,first:null,fn:t,last:null,next:null,parent:n,b:n&&n.b,prev:null,teardown:null,wv:0,ac:null};I?.register_created_effect(r);var i=r;if(e&4)Tt===null?kt.ensure().schedule(r):Tt.push(r);else if(t!==null){try{cr(r)}catch(e){throw An(r),e}i.deps===null&&i.teardown===null&&i.nodes===null&&i.first===i.last&&!(i.f&524288)&&(i=i.first,e&16&&e&65536&&i!==null&&(i.f|=T))}if(i!==null&&(i.parent=n,n!==null&&mn(i,n),W!==null&&W.f&2&&!(e&64))){var a=W;(a.effects??=[]).push(i)}return r}function gn(){return W!==null&&!Hn}function _n(e){let t=hn(8,null);return Qe(t,v),t.teardown=e,t}function vn(e){pn(`$effect`);var t=G.f;if(!W&&t&32&&Ve!==null&&!Ve.i){var n=Ve;(n.e??=[]).push(e)}else return yn(e)}function yn(e){return hn(4|D,e)}function bn(e){return pn(`$effect.pre`),hn(8|D,e)}function xn(e){kt.ensure();let t=hn(64|E,e);return(e={})=>new Promise(n=>{e.outro?Nn(t,()=>{An(t),n(void 0)}):(An(t),n(void 0))})}function Sn(e){return hn(4,e)}function Cn(e){return hn(O|E,e)}function wn(e,t=0){return hn(8|t,e)}function U(e,t=[],n=[],r=[]){ot(r,t,n,t=>{hn(8,()=>{e(...t.map(K))})})}function Tn(e,t=0){return hn(16|t,e)}function En(e){return hn(32|E,e)}function Dn(e){var t=e.teardown;if(t!==null){let n=Bn,r=W;Vn(!0),Un(null);try{t.call(null)}catch(t){fn(t,e.parent)}finally{Vn(n),Un(r)}}}function On(e,t=!1){var n=e.first;for(e.first=e.last=null;n!==null;){let e=n.ac;e!==null&&it(()=>{e.abort(ue)});var r=n.next;n.f&64?n.parent=null:An(n,t),n=r}}function kn(e){for(var t=e.first;t!==null;){var n=t.next;t.f&32||An(t),t=n}}function An(e,t=!0){var n=!1;(t||e.f&262144)&&e.nodes!==null&&e.nodes.end!==null&&(jn(e.nodes.start,e.nodes.end),n=!0),e.f|=w,On(e,t&&!n),sr(e,0);var r=e.nodes&&e.nodes.t;if(r!==null)for(let e of r)e.stop();Dn(e),e.f^=w,e.f|=S;var i=e.parent;i!==null&&i.first!==null&&Mn(e),e.next=e.prev=e.teardown=e.ctx=e.deps=e.fn=e.nodes=e.ac=e.b=null}function jn(e,t){for(;e!==null;){var n=e===t?null:on(e);e.remove(),e=n}}function Mn(e){var t=e.parent,n=e.prev,r=e.next;n!==null&&(n.next=r),r!==null&&(r.prev=n),t!==null&&(t.first===e&&(t.first=r),t.last===e&&(t.last=n))}function Nn(e,t,n=!0){var r=[];e.f|=256,Pn(e,r,!0);var i=()=>{n&&An(e),t&&t()},a=r.length;if(a>0){var o=()=>--a||i();for(var s of r)s.out(o)}else i()}function Pn(e,t,n){if(!(e.f&8192)){e.f^=x;var r=e.nodes&&e.nodes.t;if(r!==null)for(let e of r)(e.is_global||n)&&t.push(e);for(var i=e.first;i!==null;){var a=i.next;if(!(i.f&64)){var o=!!(i.f&65536)||!!(i.f&32)&&!!(e.f&16);Pn(i,t,o?n:!1)}i=a}}}function Fn(e){e.f&=-257,In(e,!0)}function In(e,t){if(!(e.f&256)&&e.f&8192){e.f^=x,e.f&1024||(Qe(e,y),kt.ensure().schedule(e));for(var n=e.first;n!==null;){var r=n.next,i=!!(n.f&65536)||!!(n.f&32);In(n,i?t:!1),n=r}var a=e.nodes&&e.nodes.t;if(a!==null)for(let e of a)(e.is_global||t)&&e.in()}}function Ln(e,t){if(e.nodes)for(var n=e.nodes.start,r=e.nodes.end;n!==null;){var i=n===r?null:on(n);t.append(n),n=i}}var Rn=null,zn=!1,Bn=!1;function Vn(e){Bn=e}var W=null,Hn=!1;function Un(e){W=e}var G=null;function Wn(e){G=e}var Gn=null;function Kn(e){W!==null&&(W.f&2097152||W.f&2)&&(Gn??=new Set).add(e)}var qn=null,Jn=0,Yn=null;function Xn(e){Yn=e}var Zn=1,Qn=0,$n=Qn;function er(e){$n=e}function tr(){return++Zn}function nr(e){var t=e.f;if(t&2048)return!0;if(t&4096){for(var n=e.deps,r=n.length,i=0;ie.wv)return!0}t&512&&xt===null&&Qe(e,v)}return!1}function rr(e,t,n=!0){var r=e.reactions;if(r!==null&&!(Gn!==null&&Gn.has(e)))for(var i=0;i{e.ac.abort(ue)}),e.ac=null);try{e.f|=te;var u=e.fn,d=u();e.f|=C;var f=ar(e);if(Ke()&&Yn!==null&&!Hn&&f!==null&&!(e.f&6146))for(var p=0;p0)for(t.length=Jn+qn.length,r=0;r{s.ac.abort(ue),s.ac=null,Qe(s,y)}),_t(s),sr(s,0)}}function sr(e,t){var n=e.deps;if(n!==null)for(var r=t;rn?.call(this,e))}return e.startsWith(`pointer`)||e.startsWith(`touch`)||e===`wheel`?(i.__removed=!1,Ye(()=>{i.__removed||t.addEventListener(e,i,r)})):t.addEventListener(e,i,r),i}function xr(e,t,n,r,i){var a={capture:r,passive:i},o=br(e,t,n,a);(t===document.body||t===window||t===document||t instanceof HTMLMediaElement)&&_n(()=>{o.__removed=!0,t.removeEventListener(e,o,a)})}function q(e,t,n){(t[_r]??={})[e]=n}function Sr(e){for(var t=0;t{wr=!1,Cr=null}));var s=0,c=Cr===e&&e[_r];if(c){var l=a.indexOf(c);if(l!==-1&&(t===document||t===window)){e[_r]=t;return}var u=a.indexOf(t);if(u===-1)return;l<=u&&(s=l)}if(o=a[s]||e.target,o!==t){i(e,`currentTarget`,{configurable:!0,get(){return o||n}});var d=W,f=G;Un(null),Wn(null);try{for(var p,m=[];o!==null&&o!==t;){try{var h=o[_r]?.[r];h!=null&&(!o.disabled||e.target===o)&&h.call(o,e)}catch(e){p?m.push(e):p=e}if(e.cancelBubble)break;s++,o=s{throw e});throw p}}finally{e[_r]=t,delete e.currentTarget,Un(d),Wn(f)}}}var Er=globalThis?.window?.trustedTypes&&globalThis.window.trustedTypes.createPolicy(`svelte-trusted-html`,{createHTML:e=>e});function Dr(e){return Er?.createHTML(e)??e}function Or(e){var t=ln(`template`);return t.innerHTML=Dr(e.replaceAll(``,``)),t.content}function kr(e,t){var n=G;n.nodes===null&&(n.nodes={start:e,end:t,a:null,t:null})}function J(e,t){var n=!!(t&1),r=!!(t&2),i,a=!e.startsWith(``);return()=>{if(M)return kr(N,null),N;i===void 0&&(i=Or(a?e:``+e),n||(i=an(i)));var t=r||$t?document.importNode(i,!0):i.cloneNode(!0);if(n){var o=an(t),s=t.lastChild;kr(o,s)}else kr(t,t);return t}}function Ar(e,t,n=`svg`){var r=!e.startsWith(``),i=!!(t&1),a=`<${n}>${r?e:``+e}`,o;return()=>{if(M)return kr(N,null),N;if(!o){var e=an(Or(a));if(i)for(o=document.createDocumentFragment();an(e);)o.appendChild(an(e));else o=an(e)}var t=o.cloneNode(!0);if(i){var n=an(t),r=t.lastChild;kr(n,r)}else kr(t,t);return t}}function jr(e,t){return Ar(e,t,`svg`)}function Mr(e=``){if(!M){var t=rn(e+``);return kr(t,t),t}var n=N;return n.nodeType===3?un(n):(n.before(n=rn()),ye(n)),kr(n,n),n}function Nr(){if(M)return kr(N,null),N;var e=document.createDocumentFragment(),t=document.createComment(``),n=rn();return e.append(t,n),kr(t,n),e}function Y(e,t){if(M){var n=G;(!(n.f&32768)||n.nodes.end===null)&&(n.nodes.end=N),be();return}e!==null&&e.before(t)}function Pr(){if(M&&N&&N.nodeType===8&&N.textContent?.startsWith(`$`)){let e=N.textContent.substring(1);return be(),e}return(window.__svelte??={}).uid??=1,`c${window.__svelte.uid++}`}function Fr(e){let t=0,n=Bt(0),r;return()=>{gn()&&(K(n),wn(()=>(t===0&&(r=fr(()=>e(()=>qt(n)))),t+=1,()=>{Ye(()=>{--t,t===0&&(r?.(),r=void 0,qt(n))})})))}}var Ir=T|E;function Lr(e,t,n,r){new Rr(e,t,n,r)}var Rr=class{parent;is_pending=!1;transform_error;#e;#t=M?N:null;#n;#r;#i;#a=null;#o=null;#s=null;#c=null;#l=0;#u=0;#d=!1;#f=new Set;#p=new Set;#m=null;#h=Fr(()=>(this.#m=Bt(this.#l),()=>{this.#m=null}));constructor(e,t,n,r){this.#e=e,this.#n=t,this.#r=e=>{var t=G;t.b=this,t.f|=128,n(e)},this.parent=G.b,this.transform_error=r??this.parent?.transform_error??(e=>e),this.#i=Tn(()=>{if(M){let e=this.#t;be();let t=e.data===`[!`;if(e.data.startsWith(`[?`)){let t=JSON.parse(e.data.slice(2));this.#_(t)}else t?this.#y():this.#g()}else this.#b()},Ir),M&&(this.#e=N)}#g(){try{this.#a=En(()=>this.#r(this.#e))}catch(e){this.error(e)}}#_(e){let t=this.#n.failed,{reset:n,invoke_onerror:r}=this.#v(e);Ye(r),t&&(this.#s=En(()=>{t(this.#e,()=>e,()=>n)}))}#v(e){var t=!1,n=!1;let r=()=>{if(t){_e();return}t=!0,n&&Re(),this.#s!==null&&Nn(this.#s,()=>{this.#s=null}),this.#S(()=>{this.#b()})};return{reset:r,invoke_onerror:()=>{try{n=!0,this.#n.onerror?.(e,r),n=!1}catch(e){fn(e,this.#i&&this.#i.parent)}}}}#y(){let e=this.#n.pending;e&&(this.is_pending=!0,this.#o=En(()=>e(this.#e)),Ye(()=>{var e=this.#c=document.createDocumentFragment(),t=rn(),n=!1;if(e.append(t),this.#a=this.#S(()=>{try{return En(()=>this.#r(t))}catch(e){try{this.error(e),n=!0}catch(e){fn(e,this.#i.parent)}return null}}),this.#a===null){this.#c=null,n&&this.#x(I);return}this.#u===0&&(this.#e.before(e),this.#c=null,Nn(this.#o,()=>{this.#o=null}),this.#x(I))}))}#b(){try{if(this.is_pending=this.has_pending_snippet(),this.#u=0,this.#l=0,this.#a=En(()=>{this.#r(this.#e)}),this.#u>0){var e=this.#c=document.createDocumentFragment();Ln(this.#a,e);let t=this.#n.pending;this.#o=En(()=>t(this.#e))}else this.#x(I)}catch(e){this.error(e)}}#x(e){this.is_pending=!1,e.transfer_effects(this.#f,this.#p)}defer_effect(e){et(e,this.#f,this.#p)}is_rendered(){return!this.is_pending&&(!this.parent||this.parent.is_rendered())}has_pending_snippet(){return!!this.#n.pending}#S(e){var t=G,n=W,r=Ve;Wn(this.#i),Un(this.#i),He(this.#i.ctx);try{return kt.ensure(),e()}finally{Wn(t),Un(n),He(r)}}#C(e,t){if(!this.has_pending_snippet()){this.parent&&this.parent.#C(e,t);return}this.#u+=e,this.#u===0&&(this.#x(t),this.#o&&Nn(this.#o,()=>{this.#o=null}),this.#c&&=(this.#e.before(this.#c),null))}update_pending_count(e,t){this.#C(e,t),this.#l+=e,!(!this.#m||this.#d)&&(this.#d=!0,Ye(()=>{this.#d=!1,this.#m&&Wt(this.#m,this.#l)}))}get_effect_pending(){return this.#h(),K(this.#m)}error(e){if(!this.#n.onerror&&!this.#n.failed)throw e;I?.is_fork?(this.#a&&I.skip_effect(this.#a),this.#o&&I.skip_effect(this.#o),this.#s&&I.skip_effect(this.#s),I.oncommit(()=>{this.#w(e)})):this.#w(e)}#w(e){this.#a&&=(An(this.#a),null),this.#o&&=(An(this.#o),null),this.#s&&=(An(this.#s),null),M&&(ye(this.#t),xe(),ye(Se()));let t=this.#n.failed,n=e=>{let{reset:n,invoke_onerror:r}=this.#v(e);r(),t&&(this.#s=this.#S(()=>{try{return En(()=>{var r=G;r.b=this,r.f|=128,t(this.#e,()=>e,()=>n)})}catch(e){return fn(e,this.#i.parent),null}}))};Ye(()=>{var t;try{t=this.transform_error(e)}catch(e){fn(e,this.#i&&this.#i.parent);return}typeof t==`object`&&t&&typeof t.then==`function`?t.then(n,e=>fn(e,this.#i&&this.#i.parent)):n(t)})}};function X(e,t){var n=t==null?``:typeof t==`object`?`${t}`:t;n!==(e[ce]??=e.nodeValue)&&(e[ce]=n,e.nodeValue=`${n}`)}function zr(e,t){return Vr(e,t)}var Br=new Map;function Vr(e,{target:t,anchor:n,props:i={},events:a,context:o,intro:s=!0,transformError:c}){nn();var l=void 0,u=xn(()=>{var s=n??t.appendChild(rn());Lr(s,{pending:()=>{}},t=>{Ue({});var n=Ve;if(o&&(n.c=o),a&&(i.$$events=a),M&&kr(t,null),l=e(t,i)||Ge(),M&&(G.nodes.end=N,N===null||N.nodeType!==8||N.data!==`]`))throw he(),fe;We()},c);var u=new Set,d=e=>{for(var n=0;n{for(var e of u)for(let n of[t,document]){var r=Br.get(n),i=r.get(e);--i==0?(n.removeEventListener(e,Tr),r.delete(e),r.size===0&&Br.delete(n)):r.set(e,i)}yr.delete(d),s!==n&&s.parentNode?.removeChild(s)}});return Hr.set(l,u),l}var Hr=new WeakMap,Ur=class{anchor;#e=new Map;#t=new Map;#n=new Map;#r=new Set;#i=!0;constructor(e,t=!0){this.anchor=e,this.#i=t}#a=e=>{if(this.#e.has(e)){var t=this.#e.get(e),n=this.#t.get(t);if(n)Fn(n),this.#r.delete(t);else{var r=this.#n.get(t);r&&(Fn(r.effect),this.#t.set(t,r.effect),this.#n.delete(t),r.fragment.lastChild.remove(),this.anchor.before(r.fragment),n=r.effect)}for(let[t,n]of this.#e){if(this.#e.delete(t),t===e)break;let r=this.#n.get(n);r&&(An(r.effect),this.#n.delete(n))}for(let[e,r]of this.#t){if(e===t||this.#r.has(e))continue;let i=()=>{if(Array.from(this.#e.values()).includes(e)){var t=document.createDocumentFragment();Ln(r,t),t.append(rn()),this.#n.set(e,{effect:r,fragment:t})}else An(r);this.#r.delete(e),this.#t.delete(e)};this.#i||!n?(this.#r.add(e),Nn(r,i,!1)):i()}}};#o=e=>{this.#e.delete(e);let t=Array.from(this.#e.values());for(let[e,n]of this.#n)t.includes(e)||(An(n.effect),this.#n.delete(e))};ensure(e,t){var n=I,r=cn();if(t&&!this.#t.has(e)&&!this.#n.has(e)){if(r){var i=document.createDocumentFragment(),a=rn();i.append(a),this.#n.set(e,{effect:En(()=>t(a)),fragment:i})}else this.#t.set(e,En(()=>t(this.anchor)))}if(this.#e.set(n,e),r){for(let[t,r]of this.#t)t===e?n.unskip_effect(r):n.skip_effect(r);for(let[t,r]of this.#n)t===e?n.unskip_effect(r.effect):n.skip_effect(r.effect);n.oncommit(this.#a),n.ondiscard(this.#o)}else M&&(this.anchor=N),this.#a(n)}};function Z(e,t,n=!1){var r;M&&(r=N,be());var i=new Ur(e),a=n?T:0;function o(e,t){if(M){var n=Ce(r);if(e!==parseInt(n.substring(1))){var a=Se();ye(a),i.anchor=a,ve(!1),i.ensure(e,t),ve(!0);return}}i.ensure(e,t)}Tn(()=>{var e=!1;t((t,n=0)=>{e=!0,o(n,t)}),e||o(-1,null)},a)}var Wr=Symbol(`NaN`);function Gr(e,t,n){M&&be();var r=new Ur(e),i=!Ke();Tn(()=>{var e=t();e!==e&&(e=Wr),i&&typeof e==`object`&&e&&(e={}),r.ensure(e,n)})}function Kr(e,t){return t}function qr(e,t,n){for(var i=[],a=t.length,o,s=t.length,c=0;c{if(o){if(o.pending.delete(n),o.done.add(n),o.pending.size===0){var t=e.outrogroups;Jr(e,r(o.done)),t.delete(o),t.size===0&&(e.outrogroups=null)}}else--s},!1)}if(s===0){var l=i.length===0&&n!==null&&e.pending.size===0;if(l){var u=n,d=u.parentNode;sn(d),d.append(u),e.items.clear()}Jr(e,t,!l)}else o={pending:new Set(t),done:new Set},(e.outrogroups??=new Set).add(o)}function Jr(e,t,n=!0){var r;if(e.pending.size>0){r=new Set;for(let t of e.pending.values())for(let n of t)r.add(e.items.get(n).e)}for(var i=0;i{var t=i();return e(t)?t:t==null?[]:r(t)}),p,m=new Map,h=!0;function g(e){v.effect.f&16384||(v.pending.delete(e),v.fallback=d,Qr(v,p,c,n,a),d!==null&&(p.length===0?d.f&33554432?(d.f^=ee,ei(d,null,c)):Fn(d):Nn(d,()=>{d=null})))}function _(e){v.pending.delete(e)}var v={effect:Tn(()=>{p=K(f);var e=p.length;let t=!1;M&&Ce(c)===`[!`!=(e===0)&&(c=Se(),ye(c),ve(!1),t=!0);for(var r=new Set,u=I,v=cn(),y=0;ys(c)):(d=En(()=>s(Yr??=rn())),d.f|=ee)),e>r.size&&ke(``,``,``),M&&e>0&&ye(Se()),!h){if(m.set(u,r),v){for(let[e,t]of l)r.has(e)||u.skip_effect(t.e);u.oncommit(g),u.ondiscard(_)}else g(u)}t&&ve(!0),K(f)}),flags:n,items:l,pending:m,outrogroups:null,fallback:d};h=!1,M&&(c=N)}function Zr(e){for(;e!==null&&!(e.f&32);)e=e.next;return e}function Qr(e,t,n,i,a){var o=!!(i&8),s=t.length,c=e.items,l=Zr(e.effect.first),u,d=null,f,p=[],m=[],h,g,_,v;if(o)for(v=0;v0){var E=i&4&&s===0?n:null;if(o){for(v=0;v{if(f!==void 0)for(_ of f)_.nodes?.a?.apply()})}function $r(e,t,n,r,i,a,o,s){var c=o&1?o&16?Bt(n):Vt(n,!1,!1):null,l=o&2?Bt(i):null;return{v:c,i:l,e:En(()=>(a(t,c??n,l??i,s),()=>{e.delete(r)}))}}function ei(e,t,n){if(e.nodes)for(var r=e.nodes.start,i=e.nodes.end,a=t&&!(t.f&33554432)?t.nodes.start:n;r!==null;){var o=on(r);if(a.before(r),r===i)return;r=o}}function ti(e,t,n){t===null?e.effect.first=n:t.next=n,n===null?e.effect.last=t:n.prev=t}function ni(e,t,n){var r;M&&(r=N,be());var i=new Ur(e);Tn(()=>{var e=t()??null;if(M&&Ce(r)===`[`!=(e!==null)){var a=Se();ye(a),i.anchor=a,ve(!1),i.ensure(e,e&&(t=>n(t,e))),ve(!0);return}i.ensure(e,e&&(t=>n(t,e)))},T)}var ri=[...` +\r\f\xA0\v`];function ii(e,t,n){var r=e==null?``:``+e;if(t&&(r=r?r+` `+t:t),n){for(var i of Object.keys(n))if(n[i])r=r?r+` `+i:i;else if(r.length)for(var a=i.length,o=0;(o=r.indexOf(i,o))>=0;){var s=o+a;(o===0||ri.includes(r[o-1]))&&(s===r.length||ri.includes(r[s]))?r=(o===0?``:r.substring(0,o))+r.substring(s+1):o=s}}return r===``?null:r}function ai(e,t=!1){var n=t?` !important;`:`;`,r=``;for(var i of Object.keys(e)){var a=e[i];a!=null&&a!==``&&(r+=` `+i+`: `+a+n)}return r}function oi(e){return e[0]!==`-`||e[1]!==`-`?e.toLowerCase():e}function si(e,t){if(t){var n=``,r,i;if(Array.isArray(t)?(r=t[0],i=t[1]):r=t,e){e=String(e).replaceAll(/\/\*.*?\*\//g,``).trim();var a=!1,o=0,s=!1,c=[];r&&c.push(...Object.keys(r).map(oi)),i&&c.push(...Object.keys(i).map(oi));var l=0,u=-1;let t=e.length;for(var d=0;d{t.every(_i)||(`__defaultValue`in e&&fi(e,!1),`__value`in e&&pi(e,e.__value))});t.observe(e,{childList:!0,subtree:!0,attributes:!0,attributeFilter:[`value`]}),_n(()=>{t.disconnect()})}function hi(e,t,n=t){var r=new WeakSet,i=!0;at(e,`change`,t=>{var i=t?`[selected]`:`:checked`,a;if(e.multiple)a=[].map.call(e.querySelectorAll(i),gi);else{var o=e.querySelector(i)??e.querySelector(`option:not([disabled])`);a=o&&gi(o)}n(a),e.__value=a,I!==null&&r.add(I)}),Sn(()=>{var a=t();if(e===document.activeElement){var o=I;if(r.has(o))return}if(pi(e,a,i),i&&a===void 0){var s=e.querySelector(`:checked`);s!==null&&(a=gi(s),n(a))}e.__value=a,i=!1})}function gi(e){return`__value`in e?e.__value:e.value}function _i(e){if(e.target.closest(`selectedcontent`)!==null)return!0;if(e.type===`childList`){var t=[...e.addedNodes,...e.removedNodes];return t.length>0&&t.every(e=>e.nodeName===`SELECTEDCONTENT`)}return!1}var vi=Symbol(`is custom element`),yi=Symbol(`is html`),bi=de?`link`:`LINK`;function xi(e){if(M){var t=!1,n=()=>{if(!t){if(t=!0,e.hasAttribute(`value`)){var n=e.value;Q(e,`value`,null),e.value=n}if(e.hasAttribute(`checked`)){var r=e.checked;Q(e,`checked`,null),e.checked=r}}};e[le]=n,Ye(n),rt()}}function Si(e,t){var n=Ci(e);n.checked!==(n.checked=t??void 0)&&(e.checked=t)}function Q(e,t,n,r){var i=Ci(e);M&&(i[t]=e.getAttribute(t),t===`src`||t===`srcset`||t===`href`&&e.nodeName===bi)||i[t]!==(i[t]=n)&&(t===`loading`&&(e[ae]=n),n==null?e.removeAttribute(t):typeof n!=`string`&&Ti(e).has(t)?e[t]=n:e.setAttribute(t,n))}function Ci(e){return e[oe]??={[vi]:e.nodeName.includes(`-`),[yi]:e.namespaceURI===pe}}var wi=new Map;function Ti(e){var t=e.getAttribute(`is`)||e.nodeName,n=wi.get(t);if(n)return n;wi.set(t,n=new Set);for(var r,i=e,a=Element.prototype;a!==i;){for(var s in r=o(i),r)r[s].set&&s!==`innerHTML`&&s!==`textContent`&&s!==`innerText`&&n.add(s);i=l(i)}return n}function Ei(e,t,n=t){var r=new WeakSet;at(e,`input`,async i=>{var a=i?e.defaultValue:e.value;if(a=ji(e)?Mi(a):a,n(a),I!==null&&r.add(I),await lr(),a!==(a=t())){var o=e.selectionStart,s=e.selectionEnd,c=e.value.length;if(e.value=a??``,s!==null){var l=e.value.length;o===s&&s===c&&l>c?(e.selectionStart=l,e.selectionEnd=l):(e.selectionStart=o,e.selectionEnd=Math.min(s,l))}}}),(M&&e.defaultValue!==e.value||fr(t)==null&&e.value)&&(n(ji(e)?Mi(e.value):e.value),I!==null&&r.add(I)),wn(()=>{var n=t();if(e===document.activeElement){var i=I;if(r.has(i))return}ji(e)&&n===Mi(e.value)||(e.type!==`date`||n||e.value)&&n!==e.value&&(e.value=n??``)})}var Di=new Set;function Oi(e,t,n,r,i=r){var a=n.getAttribute(`type`)===`checkbox`,o=e;let s=!1;if(t!==null)for(var c of t)o=o[c]??=[];o.push(n),at(n,`change`,()=>{var e=n.__value;a&&(e=Ai(o,e,n.checked)),i(e)},()=>i(a?[]:null)),wn(()=>{var e=r();if(M&&n.defaultChecked!==n.checked){s=!0;return}a?(e||=[],n.checked=e.includes(n.__value)):n.checked=Zt(n.__value,e)}),_n(()=>{var e=o.indexOf(n);e!==-1&&o.splice(e,1)}),Di.has(o)||(Di.add(o),Ye(()=>{o.sort((e,t)=>e.compareDocumentPosition(t)===4?-1:1),Di.delete(o)})),Ye(()=>{if(s){var e=a?Ai(o,e,n.checked):o.find(e=>e.checked)?.__value;i(e)}})}function ki(e,t,n=t){at(e,`change`,t=>{n(t?e.defaultChecked:e.checked)}),(M&&e.defaultChecked!==e.checked||fr(t)==null)&&n(e.checked),wn(()=>{e.checked=!!t()})}function Ai(e,t,n){for(var r=new Set,i=0;i{var n=this.#e.get(e);n.delete(t),n.size===0&&(this.#e.delete(e),this.#t.unobserve(e))}}#r(){return this.#t??=new ResizeObserver(t=>{for(var n of t){e.entries.set(n.target,n);for(var r of this.#e.get(n.target)||[])r(n)}})}}({box:`border-box`});function Pi(e,t,n){var r=Ni.observe(e,()=>n(e[t]));Sn(()=>(fr(()=>n(e[t])),r))}function Fi(e,t){return e===t||e?.[ne]===t}function Ii(e=Ge(),t,n,r){var i=Ve.r,a=G;return Sn(()=>{var o,s;return wn(()=>{o=s,s=r?.()||[],fr(()=>{Fi(n(...s),e)||(t(e,...s),o&&Fi(n(...o),e)&&t(null,...o))})}),()=>{let r=a;for(;r!==i&&r.parent!==null&&r.parent.f&33554432;)r=r.parent;let o=()=>{s&&Fi(n(...s),e)&&t(null,...s)},c=r.teardown;r.teardown=()=>{o(),c?.()}}}),e}function Li(e,t,n,r,i){var a=()=>{r(n[e])};n.addEventListener(t,a),i?wn(()=>{n[e]=i()}):a(),(n===document.body||n===window||n===document)&&_n(()=>{n.removeEventListener(t,a)})}function Ri(e=!1){let t=Ve,n=t.l.u;if(!n)return;let r=()=>pr(t.s);if(e){let e=0,n={},i=ut(()=>{let r=!1,i=t.s;for(let e in i)i[e]!==n[e]&&(n[e]=i[e],r=!0);return r&&e++,e});r=()=>K(i)}n.b.length&&bn(()=>{zi(t,r),m(n.b)}),vn(()=>{let e=fr(()=>n.m.map(p));return()=>{for(let t of e)typeof t==`function`&&t()}}),n.a.length&&vn(()=>{zi(t,r),m(n.a)})}function zi(e,t){if(e.l.s)for(let t of e.l.s)K(t);t()}var Bi=!1;function Vi(e){var t=Bi;try{return Bi=!1,[e(),Bi]}finally{Bi=t}}var Hi={get(e,t){let n=e.props.length;for(;n--;){let r=e.props[n];if(d(r)&&(r=r()),typeof r==`object`&&r&&t in r)return r[t]}},set(e,t,n){let r=e.props.length;for(;r--;){let i=e.props[r];d(i)&&(i=i());let o=a(i,t);if(o&&o.set)return o.set(n),!0}return!1},getOwnPropertyDescriptor(e,t){let n=e.props.length;for(;n--;){let r=e.props[n];if(d(r)&&(r=r()),typeof r==`object`&&r&&t in r){let e=a(r,t);return e&&!e.configurable&&(e.configurable=!0),e}}},has(e,t){if(t===ne||t===ie)return!1;for(let n of e.props)if(d(n)&&(n=n()),n!=null&&t in n)return!0;return!1},ownKeys(e){let t=[];for(let n of e.props)if(d(n)&&(n=n()),n){for(let e in n)t.includes(e)||t.push(e);for(let e of Object.getOwnPropertySymbols(n))t.includes(e)||t.push(e)}return t}};function Ui(...e){return new Proxy({props:e},Hi)}function Wi(e,t,n,r){var i=!ze||!!(n&2),o=!!(n&8),s=!!(n&16),c=r,l=!0,u=void 0,d=()=>s&&i?(u??=ut(r),K(u)):(l&&(l=!1,c=s?fr(r):r),c);let f;if(o){var p=ne in e||ie in e;f=a(e,t)?.set??(p&&t in e?n=>e[t]=n:void 0)}var m,h=!1;o?[m,h]=Vi(()=>e[t]):m=e[t],m===void 0&&r!==void 0&&(m=d(),f&&(i&&Pe(t),f(m)));var g=i?()=>{var n=e[t];return n===void 0?d():(l=!0,n)}:()=>{var n=e[t];return n!==void 0&&(c=void 0),n===void 0?c:n};if(i&&!(n&4))return g;if(f){var _=e.$$legacy;return(function(e,t){return arguments.length>0?((!i||!t||_||h)&&f(t?g():e),e):g()})}var v=!1,y=(n&1?ut:pt)(()=>(v=!1,g()));o&&K(y);var b=G;return(function(e,t){if(arguments.length>0){let n=t?K(y):i&&o?Yt(e):e;return R(y,n),v=!0,c!==void 0&&(c=n),e}return Bn&&v||b.f&16384?y.v:K(y)})}function Gi(e){Ve===null&&De(`onMount`),ze&&Ve.l!==null?qi(Ve).m.push(e):vn(()=>{let t=fr(e);if(typeof t==`function`)return t})}function Ki(e){Ve===null&&De(`onDestroy`),Gi(()=>()=>fr(e))}function qi(e){var t=e.l;return t.u??={a:[],b:[],m:[]}}typeof window<`u`&&((window.__svelte??={}).v??=new Set).add(`5`);function Ji(e,t){if(e instanceof RegExp)return{keys:!1,pattern:e};var n,r,i,a,o=[],s=``,c=e.split(`/`);for(c[0]||c.shift();i=c.shift();)n=i[0],n===`*`?(o.push(`wild`),s+=`/(.*)`):n===`:`?(r=i.indexOf(`?`,1),a=i.indexOf(`.`,1),o.push(i.substring(1,~r?r:~a?a:i.length)),s+=~r&&!~a?`(?:/([^/]+?))?`:`/([^/]+?)`,~a&&(s+=(~r?`?`:``)+`\\`+i.substring(a))):s+=`/`+i;return{keys:o,pattern:RegExp(`^`+s+(t?`(?=$|/)`:`/?$`),`i`)}}var Yi=new class{#e=L(Xi());get _loc(){return K(this.#e)}set _loc(e){R(this.#e,e)}#t=F(()=>this._loc.location);get _location(){return K(this.#t)}set _location(e){R(this.#t,e)}#n=F(()=>this._loc.querystring);get _querystring(){return K(this.#n)}set _querystring(e){R(this.#n,e)}#r=L(void 0);get _params(){return K(this.#r)}set _params(e){R(this.#r,e)}get loc(){return this._loc}get location(){return this._location}get querystring(){return this._querystring}get params(){return this._params}constructor(){typeof window<`u`?window.addEventListener(`hashchange`,()=>{this._loc=Xi()}):console.warn(`[svelte-spa-router] window 'window' is not defined, skipping initiation`)}};function Xi(){let e=typeof window<`u`?window.location.href:``,t=e.indexOf(`#/`),n=t>-1?e.substr(t+1):`/`,r=n.indexOf(`?`),i=``;return r>-1&&(i=n.substr(r+1),n=n.substr(0,r)),{location:n,querystring:i}}async function Zi(e){if(!e||e.length<1||e.charAt(0)!=`/`&&e.indexOf(`#/`)!==0)throw Error(`Invalid parameter location`);await lr();let t=(e.charAt(0)==`#`?``:`#`)+e;try{let e={...history.state};delete e.__svelte_spa_router_scrollX,delete e.__svelte_spa_router_scrollY,window.history.replaceState(e,``,t)}catch{console.warn("Caught exception while replacing the current page. If you're running this in the Svelte REPL, please note that the `replace` method might not work in this environment.")}window.dispatchEvent(new Event(`hashchange`))}function Qi(e){e?window.scrollTo(e.__svelte_spa_router_scrollX||0,e.__svelte_spa_router_scrollY||0):window.scrollTo(0,0)}function $i(e,t){Ue(t,!0);let n=Wi(t,`routes`,19,()=>({})),r=Wi(t,`prefix`,3,``),i=Wi(t,`restoreScrollState`,3,!1),a=Wi(t,`onConditionsFailed`,3,()=>{}),o=Wi(t,`onRouteLoaded`,3,()=>{}),s=Wi(t,`onRouteLoading`,3,()=>{}),c=Wi(t,`onRouteEvent`,3,()=>{});class l{path;component;conditions;userData;props;_pattern;_keys;constructor(e,t){let n=e=>typeof e==`object`&&!!e&&e._sveltesparouter===!0;if(!t||typeof t!=`function`&&!n(t))throw Error(`Invalid component object`);if(!e||typeof e==`string`&&(e.length<1||e.charAt(0)!=`/`&&e.charAt(0)!=`*`)||typeof e==`object`&&!(e instanceof RegExp))throw Error(`Invalid value for "path" argument - strings must start with / or *`);let r=Ji(e);if(this.path=e,n(t)){let e=t;this.component=e.component,this.conditions=e.conditions||[],this.userData=e.userData,this.props=e.props||{}}else{let e=t;this.component=()=>Promise.resolve(e),this.conditions=[],this.props={}}this._pattern=r.pattern,this._keys=r.keys}match(e){if(r()){if(typeof r()==`string`){if(e.startsWith(r()))e=e.substr(r().length)||`/`;else return null}else if(r()instanceof RegExp){let t=e.match(r());if(t&&t[0])e=e.substr(t[0].length)||`/`;else return null}}let t=this._pattern.exec(e);if(t===null)return null;if(this._keys===!1)return t;let n={},i=0;for(;i{u.push(new l(t,e))}):Object.keys(n()).forEach(e=>{let t=n();u.push(new l(e,t[e]))});let d=L(null),f=L(null),p=L({}),m=null,h=null;vn(()=>{history.scrollRestoration=i()?`manual`:`auto`}),vn(()=>{if(!i())return;let e=e=>{m=e.state&&(e.state.__svelte_spa_router_scrollY||e.state.__svelte_spa_router_scrollX)?e.state:null};return window.addEventListener(`popstate`,e),()=>window.removeEventListener(`popstate`,e)});async function g(e,t){await lr(),e(t)}vn(()=>{let e=Yi.loc,t=!1;return fr(async()=>{let n=0;for(;n{t=!0}});function _(e){return e&&typeof e==`object`&&Object.keys(e).length?e:null}var v=Nr(),y=B(v),b=e=>{let t=F(()=>K(d));var n=Nr(),r=B(n),i=e=>{var n=Nr();ni(B(n),()=>K(t),(e,t)=>{t(e,Ui({get params(){return K(f)},get onRouteEvent(){return c()}},()=>K(p)))}),Y(e,n)},a=e=>{var n=Nr();ni(B(n),()=>K(t),(e,t)=>{t(e,Ui({get onRouteEvent(){return c()}},()=>K(p)))}),Y(e,n)};Z(r,e=>{K(f)?e(i):e(a,-1)}),Y(e,n)};Z(y,e=>{K(d)&&e(b)}),Y(e,v),We()}var ea=[`bars`,`pace`,`pie`,`fuel`,`resets`,`thresholds`];function ta(e){return e===`zone`||e===`consumption-pace`?`pace`:typeof e==`string`&&ea.includes(e)?e:`bars`}var na=`codexometer.web.preferences.v1`,ra={statusLine:null,tab:`quota`,view:`bars`,selected:``,defaultDetail:0,layouts:[]};function ia(){try{let e=JSON.parse(localStorage.getItem(na)||`null`);return!e||typeof e!=`object`?ra:{statusLine:Array.isArray(e.statusLine)?[...new Set(e.statusLine.filter(e=>typeof e==`string`&&e.length<64))].slice(0,32):null,tab:[`quota`,`sessions`,`usage`].includes(e.tab)?e.tab:`quota`,view:ta(e.view),selected:typeof e.selected==`string`?e.selected.slice(0,256):``,defaultDetail:+(e.defaultDetail===1),layouts:Array.isArray(e.layouts)?e.layouts.filter(e=>{if(!e||typeof e!=`object`)return!1;let t=e;return typeof t.id==`string`&&t.id.length<=256&&[0,1,2].includes(t.level)}).slice(-100):[]}}catch{return ra}}var aa=Yt(ia()),oa=Yt({open:!1}),sa=Yt({requests:0});function ca(){let e=JSON.stringify(aa);try{localStorage.setItem(na,e)}catch{}}function la(){return aa.tab===`quota`?`/quota/`+aa.view:`/`+aa.tab}function ua(e){return aa.layouts.find(t=>t.id===e)?.level??aa.defaultDetail}function da(e){aa.defaultDetail=e,aa.layouts=[]}function fa(e,t){aa.layouts=[...aa.layouts.filter(t=>t.id!==e),{id:e,level:Math.max(0,Math.min(2,t))}].slice(-100)}var $=Yt({data:null,connected:!1,error:``}),pa=e=>e==null?`Unavailable`:e.toLocaleString(`en-GB`),ma=e=>!e||String(e).startsWith(`0001-`)?`Not yet available`:new Date(typeof e==`number`?e*1e3:e).toLocaleString(`en-GB`),ha=`codexometer.web.session`,ga=class extends Error{},_a;async function va(e,t,n){if(!_a||!$.connected||!$.data?.control||$.data.sessionsError)throw Error(`Session controls unavailable. Check the live connection.`);return await _a(e,t,n)}function ya(){let e=new AbortController,t,n=``;_a=async(t,r,i)=>{let a=await fetch(`/api/control/`+t,{method:`POST`,headers:{Authorization:`Bearer ${n}`,"Content-Type":`application/json`},body:JSON.stringify(r),signal:AbortSignal.any([e.signal,AbortSignal.timeout(8e3),...i?[i]:[]]),cache:`no-store`});if(!a.ok)throw a.status===502?Error(`Outcome uncertain. Check Codex before taking another action; nothing was retried.`):new ga(`Action rejected, expired or changed. Refresh and check Codex; nothing was retried.`);return a.json()};try{n=sessionStorage.getItem(ha)||``}catch{}let r=location.hash,i=r.startsWith(`#pair=`)?r.slice(6):``;(i||!r||r===`#`)&&(history.replaceState(null,``,`/#`+la()),window.dispatchEvent(new HashChangeEvent(`hashchange`)));async function a(){if(i)try{let t=await fetch(`/api/pair`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({secret:i}),signal:e.signal});if(!t.ok)throw Error(`Pairing link expired or already used. Restart --web for a fresh link.`);n=(await t.json()).token;try{sessionStorage.setItem(ha,n)}catch{}}catch(t){e.signal.aborted||($.error=t instanceof Error?t.message:`Pairing failed`);return}if(!n){$.error=`Open the private pairing link printed by codexometer --web in your terminal.`;return}await o()}async function o(){try{let t=await fetch(`/api/events`,{headers:{Authorization:`Bearer ${n}`},signal:e.signal,cache:`no-store`});if(t.status===401){try{sessionStorage.removeItem(ha)}catch{}$.error=`Browser session expired. Restart --web and open its new pairing link.`;return}if(!t.ok||!t.body)throw Error(`Live connection unavailable`);let r=t.body.getReader(),i=new TextDecoder,a=``;for(;!e.signal.aborted;){let{done:e,value:t}=await r.read();if(e)break;a+=i.decode(t,{stream:!0});let n;for(;(n=a.indexOf(` + +`))>=0;){let e=a.slice(0,n);a=a.slice(n+2),e.startsWith(`data: `)&&($.data=JSON.parse(e.slice(6)),$.connected=!0,$.error=``)}}}catch{}finally{$.connected=!1}e.signal.aborted||($.error=`Connection lost — showing last observation. Reconnecting…`,t=setTimeout(o,2500))}return a(),()=>{_a=void 0,e.abort(),clearTimeout(t),$.connected=!1}}Be();var ba=J(`

      Quota refresh failed. Policy state is based on the last successful + observation.

      `),xa=J(`

      `),Sa=J(`

      The longest Codex quota window selects one active model profile. ASK + creates a per-session review; AUTO applies the profile on the next + eligible check.

      `,1),Ca=J(`

      No threshold-based model steps were configured at launch.

      `);function wa(e,t){Ue(t,!1),Ri();var n=Nr(),r=B(n),i=e=>{var t=Sa(),n=B(t),r=V(n),i=H(n,2),a=e=>{Y(e,ba())};Z(i,e=>{$.data.quotaError&&e(a)});var o=H(i,2),s=z(o),c=V(s),l=H(s,4);Xr(l,5,()=>$.data.thresholds,Kr,(e,t)=>{var n=xa();let r;var i=z(n),a=V(i),o=H(i,2),s=z(o),c=V(s,!0),l=V(H(s,2));P(o);var u=H(o,2),d=V(u,!0),f=V(H(u,2));P(n),U((e,i)=>{r=ci(n,1,``,null,r,{active:K(t).state===`ACTIVE`,next:K(t).state===`NEXT`}),X(a,`${K(t).threshold??``}%`),X(c,K(t).model),X(l,`${e??``} REASONING // ${i??``} + SPEED`),X(d,K(t).mode),X(f,`${K(t).state??``}${K(t).state===`NEXT`?` // ${K(t).remaining||0} PP TO GO`:``}`)},[()=>K(t).effort.toUpperCase(),()=>K(t).speed.toUpperCase()]),Y(e,n)}),P(l),P(o),U(e=>{X(r,`MODEL STEP POLICY // OBSERVED ${e??``}`),X(c,`THRESHOLDS // ${$.data.thresholds.length??``} CONFIGURED`)},[()=>ma($.data.quotaAt)]),Y(e,t)},a=e=>{Y(e,Ca())};Z(r,e=>{$.data?.thresholds?.length?e(i):e(a,-1)}),Y(e,n),We()}var Ta=jr(` `,1),Ea=jr(` `,1),Da=jr(` `,1),Oa=jr(` `,1),ka=J(`
      `,1),Aa=J(` `),ja=J(`
      Quota observations
      Observed atPeriod elapsedConsumedTrail segment
      `),Ma=J(`
      OBSERVATION DATA
      `),Na=J(`
      CONSUMPTIONQUOTA PERIOD ELAPSED
      `,1);function Pa(e,t){let n=Pr();Ue(t,!0);let r=Wi(t,`trail`,19,()=>[]),i=L(!1),a=L(!0),o=L(`window`),s=[0,25,50,75,100],c={off:0,halfHour:30,hour:60,day:1440,window:0},l=L(400),u=L(240),d=F(()=>K(l)-24),f=F(()=>K(u)-48),p=F(()=>Math.max(1,K(d)-48)),m=F(()=>Math.max(1,K(f)-20)),h=F(()=>48+Math.max(0,Math.min(100,t.elapsed))/100*K(p));function g(e){return K(f)-(e-0)/100*K(m)}let _=F(()=>g(t.used)),v=F(()=>t.used-t.elapsed),y=F(()=>r().map((e,t)=>`${t===0||e.break?`M`:`L`}${48+e.elapsed/100*K(p)} ${g(e.used)}`).join(` `)),b=F(()=>{let e=0;for(let t=r().length-1;t>0;t--)if(r()[t].break){e=t;break}return r().slice(e)}),x=F(()=>K(b).length<2?0:Math.max(0,Date.parse(K(b).at(-1).at)-Date.parse(K(b)[0].at)));function S(e){if(K(x)Date.parse(e.at)>=t).length>=2}let C=F(()=>({off:!0,halfHour:S(18e5),hour:S(36e5),day:S(864e5),window:Number.isFinite(t.elapsed)&&t.elapsed>0&&Number.isFinite(t.used)}));vn(()=>{K(o)!==`window`&&!K(C)[K(o)]&&R(o,`window`)});function w(e){if(e===`off`||!K(C)[e])return[];let t=c[e]*6e4,n=Date.parse(K(b).at(-1).at)-t,r=K(b).findIndex(e=>Date.parse(e.at)>=n);return r<0?[]:K(b).slice(r)}function T(e){if(e.length<2)return null;let t=e.reduce((e,t)=>e+t.elapsed,0)/e.length,n=e.reduce((e,t)=>e+t.used,0)/e.length,r=0,i=0;for(let a of e)r+=(a.elapsed-t)*(a.used-n),i+=(a.elapsed-t)**2;return i>0?Math.max(0,r/i):null}let E=F(()=>{let e=K(o)===`window`&&K(C).window?t.used/t.elapsed:T(w(K(o)));if(e===null||!t.duration)return null;let n=t.used+e*(100-t.elapsed),r=K(o)===`window`?0:t.used-e*t.elapsed,i=e,a=Math.max(0,t.elapsed-c[K(o)]/t.duration*100);K(o)===`window`&&(a=0);let s=100;if(i!==0){let e=(0-r)/i,t=(100-r)/i;a=Math.max(a,Math.min(e,t)),s=Math.min(100,Math.max(e,t))}if(a>s)return null;let l=r+i*a,u=r+i*s,d=Math.hypot((s-a)/100*K(p),(u-l)/100*K(m)),f=Math.max(3,Math.min(9,Math.floor(d/65)+2));return{path:`M${Array.from({length:f},(e,t)=>{let n=a+(s-a)*t/(f-1),r=l+(u-l)*t/(f-1);return`${48+n/100*K(p)} ${g(r)}`}).join(` L`)}`,projected:n,safe:n<=100}}),D=F(()=>{if(K(b).length===0)return`NO OBSERVATIONS`;if(K(b).length===1)return`ONE OBSERVATION`;let e=Math.floor(K(x)/6e4);if(e<60)return`${e} MIN CONTINUOUS`;let t=Math.floor(e/60);return t<24?`${t}H CONTINUOUS`:`${Math.floor(t/24)}D ${t%24}H CONTINUOUS`});var ee=Na(),te=B(ee),O=z(te);let k;var ne=z(O),re=z(ne),ie=H(re);P(ne);var ae=H(ne),oe=H(ae);Xr(oe,17,()=>s,Kr,(e,t)=>{var n=Ta(),r=B(n),i=H(r),a=V(i);U(()=>{Q(r,`x1`,48+K(t)/100*K(p)),Q(r,`x2`,48+K(t)/100*K(p)),Q(r,`y2`,K(f)),Q(i,`x`,48+K(t)/100*K(p)),Q(i,`y`,K(f)+20),X(a,`${K(t)??``}%`)}),Y(e,n)});var se=H(oe);Xr(se,17,()=>s,Kr,(e,t)=>{var n=Ea(),r=B(n),i=H(r),a=V(i);U((e,n,o)=>{Q(r,`y1`,e),Q(r,`x2`,K(d)),Q(r,`y2`,n),Q(i,`y`,o),X(a,`${K(t)??``}%`)},[()=>g(K(t)),()=>g(K(t)),()=>g(K(t))+4]),Y(e,n)});var A=H(se),ce=H(A),le=H(ce),ue=e=>{var t=Da(),n=B(t),i=H(n),a=H(i),o=V(z(a));P(a),U((e,t)=>{Q(n,`d`,K(y)),Q(i,`d`,K(y)),Q(a,`cx`,48+r()[0].elapsed/100*K(p)),Q(a,`cy`,e),X(o,`First observation: ${t??``}`)},[()=>g(r()[0].used),()=>ma(r()[0].at)]),Y(e,t)};Z(le,e=>{K(a)&&r().length&&e(ue)});var de=H(le),fe=e=>{var t=Oa(),r=B(t),i=H(r),a=V(z(i));P(i),U(e=>{Q(r,`d`,K(E).path),Q(i,`d`,K(E).path),Q(i,`marker-mid`,`url(#${n}-trend-arrow)`),X(a,`${K(o)===`window`?`Window-average pace`:`Recent consumption trajectory`} projects ${e??``}% at reset if continued`)},[()=>K(E).projected.toFixed(1)]),Y(e,t)};Z(de,e=>{K(E)&&e(fe)});var j=H(de,2),pe=H(j),me=H(pe),he=V(z(me));P(me),P(O),P(te);var ge=H(te,2),_e=z(ge),M=z(_e),ve=H(M,3),N=V(ve,!0),ye=H(ve,2),be=e=>{var t=ka(),n=V(H(B(t)));U(e=>X(n,`TREND // ${e??``}`),[()=>K(E).projected>=100?`QUOTA EXHAUSTION PROJECTED`:`${K(E).projected.toFixed(1)}% PROJECTED AT RESET`]),Y(e,t)};Z(ye,e=>{K(E)&&e(be)}),P(_e);var Se=H(_e,2),Ce=z(Se),we=z(Ce);xi(we),xe(),P(Ce);var Te=H(Ce,2),Ee=H(z(Te),2),De=z(Ee);De.value=De.__value=`off`;var Oe=H(De),ke=V(Oe);Oe.value=Oe.__value=`halfHour`;var Ae=H(Oe),je=V(Ae);Ae.value=Ae.__value=`hour`;var Me=H(Ae),Ne=V(Me);Me.value=Me.__value=`day`;var Pe=H(Me),Fe=V(Pe);Pe.value=Pe.__value=`window`,P(Ee),mi(Ee),P(Te);var Ie=V(H(Te,2));P(Se),P(ge);var Le=H(ge,2),Re=e=>{var t=Ma(),n=H(z(t),2),a=e=>{var t=ja(),n=z(t),i=H(z(n),2);Xr(i,21,r,Kr,(e,t,n)=>{var r=Aa(),i=z(r),a=z(i),o=V(a,!0);P(i);var s=H(i),c=V(s),l=H(s),u=V(l),d=V(H(l),!0);P(r),U((e,r)=>{Q(a,`datetime`,K(t).at),X(o,e),X(c,`${r??``}%`),X(u,`${K(t).used??``}%`),X(d,n===0?`First observation`:K(t).break?`Gap before this observation`:`Connected to previous observation`)},[()=>ma(K(t).at),()=>K(t).elapsed.toFixed(1)]),Y(e,r)}),P(i),P(n),P(t),Y(e,t)};Z(n,e=>{K(i)&&e(a)}),P(t),Li(`open`,`toggle`,t,e=>R(i,e),()=>K(i)),Y(e,t)};Z(Le,e=>{r().length&&e(Re)}),U((e,r,i,a,o,s)=>{Q(O,`viewBox`,`0 0 ${K(l)} ${K(u)}`),Q(O,`aria-label`,e),k=ui(O,``,k,{"--trend-color":K(E)?.safe?`#115b35`:`#7f1825`}),Q(re,`id`,n),Q(ie,`id`,n+`-trend-arrow`),Q(ae,`width`,K(p)),Q(ae,`height`,K(m)),Q(ae,`fill`,`url(#${n})`),Q(A,`d`,`M48 20 V${K(f)} H${K(d)}`),Q(ce,`y1`,r),Q(ce,`x2`,K(d)),Q(ce,`y2`,i),Q(j,`x`,48+K(p)/2),Q(j,`y`,K(u)-5),Q(pe,`cx`,K(h)),Q(pe,`cy`,K(_)),Q(me,`cx`,K(h)),Q(me,`cy`,K(_)),X(he,`${t.used??``}% consumed // ${a??``}% of period elapsed`),X(M,`${t.used??``}% USED // ${o??``}% TIME ELAPSED`),X(N,s),Oe.disabled=!K(C).halfHour,X(ke,`LAST 30 MINUTES${K(C).halfHour?``:` — UNAVAILABLE`}`),Ae.disabled=!K(C).hour,X(je,`LAST HOUR${K(C).hour?``:` — UNAVAILABLE`}`),Me.disabled=!K(C).day,X(Ne,`LAST 24 HOURS${K(C).day?``:` — UNAVAILABLE`}`),Pe.disabled=!K(C).window,X(Fe,`FROM WINDOW START${K(C).window?``:` — NO TIME ELAPSED`}`),X(Ie,`HISTORY // ${K(D)??``}`)},[()=>`Pace: ${t.used}% consumed, ${t.elapsed.toFixed(1)}% of quota period elapsed. ${K(v)>0?`Above`:K(v)<0?`Below`:`On`} the steady-consumption line.${K(a)&&r().length?` Trace path contains ${r().length} ${r().length===1?`observation`:`observations`}; gaps are not interpolated.`:``}`,()=>g(0),()=>g(100),()=>t.elapsed.toFixed(1),()=>t.elapsed.toFixed(1),()=>Math.abs(K(v))<.05?`ON PACE`:K(v)>0?`ABOVE THE LINE — CONSUMING FASTER THAN TIME`:`BELOW THE LINE — WITHIN PACE`]),Pi(te,`clientWidth`,e=>R(l,e)),Pi(te,`clientHeight`,e=>R(u,e)),ki(we,()=>K(a),e=>R(a,e)),hi(Ee,()=>K(o),e=>R(o,e)),Y(e,ee),We()}var Fa=J(` `),Ia=J(`

      Quota refresh failed. Values below are the last successful observation.

      `),La=J(`

      Expiry details unavailable. No listed expiry does not mean no expiry.

      `),Ra=J(`

      `),za=J(`

      Read-only preview. Use the terminal to redeem a reset.

      The backend may return only some credits. This list does not establish + redemption order.

      `),Ba=J(` `,1),Va=jr(``),Ha=jr(``),Ua=J(`
      `),Wa=J(`

      Cycle duration or reset date unavailable — position cannot be + plotted.

      `),Ga=J(`
      EMPTYFULL
      `),Ka=J(`

      `,1),qa=J(`
      `,1),Ja=J(`

      `),Ya=J(`

      `),Xa=J(`

      No quota windows reported yet.

      `),Za=J(`
      `,1),Qa=J(`

      All reported windows are shown. API-equivalent learning and quota status + scoring remain in the terminal for this first preview.

      `,1),$a=J(` `,1);function eo(e,t){Ue(t,!0);let n=Wi(t,`params`,19,()=>({})),r=F(()=>ea.filter(e=>e!==`thresholds`||!!$.data?.thresholds?.length)),i=L(Yt(Date.now())),a=F(()=>K(r).includes(ta(n().view))?ta(n().view):`bars`);Gi(()=>{let e=setInterval(()=>R(i,Date.now(),!0),1e3);return()=>clearInterval(e)});function o(e){return!e.duration||e.duration<=0||!e.reset?null:Math.max(0,Math.min(100,100*(1-(e.reset*1e3-K(i))/(e.duration*6e4))))}vn(()=>{aa.view=K(a),(n().view===`zone`||n().view===`consumption-pace`)&&Zi(`/quota/pace`)});function s(e){let t=e/100*Math.PI*2;return`M60 60 L60 14 A46 46 0 ${+(e>50)} 1 ${60+46*Math.sin(t)} ${60-46*Math.cos(t)} Z`}var c=$a(),l=B(c);Xr(l,21,()=>K(r),Kr,(e,t)=>{var n=Fa();let r;var i=V(n,!0);U(e=>{Q(n,`href`,`#/quota/`+K(t)),Q(n,`aria-current`,K(a)===K(t)?`page`:void 0),r=ci(n,1,``,null,r,{active:K(a)===K(t)}),X(i,e)},[()=>K(t)===`fuel`?`FUEL TANK`:K(t).toUpperCase()]),Y(e,n)}),P(l);var u=H(l,2),d=e=>{var t=Qa(),n=B(t),r=e=>{Y(e,Ia())};Z(n,e=>{$.data.quotaError&&e(r)});var i=H(n,2),c=V(i),l=H(i,2),u=e=>{wa(e,{})},d=e=>{var t=za(),n=z(t),r=V(n),i=H(n,4),a=e=>{Y(e,La())};Z(i,e=>{$.data.credits.length||e(a)}),Xr(H(i,2),17,()=>$.data.credits,Kr,(e,t)=>{var n=Ra(),r=z(n),i=V(r),a=V(H(r,2),!0);P(n),U(e=>{X(i,`${(K(t).title||`Quota reset`)??``} // ${K(t).status??``}`),X(a,e)},[()=>K(t).expiryKnown?K(t).expires?`EXPIRES `+ma(K(t).expires):`Does not expire`:`Expiry information unavailable`]),Y(e,n)}),xe(2),P(t),U(()=>X(r,`RESET INVENTORY // ${$.data.creditCount??``} AVAILABLE`)),Y(e,t)},f=e=>{var t=Za(),n=B(t);let r;Xr(n,21,()=>$.data.meters,Kr,(e,t)=>{let n=F(()=>o(K(t)));var r=Ya(),i=z(r),c=V(i,!0),l=H(i,2),u=z(l),d=e=>{var n=Ba(),r=B(n),i=V(r),a=V(H(r));U(()=>{X(i,`FREE ${100-K(t).used}%`),X(a,`USED ${K(t).used??``}%`)}),Y(e,n)},f=e=>{var n=Ba(),r=B(n),i=V(r),a=V(H(r));U(()=>{X(i,`USED ${K(t).used??``}%`),X(a,`FREE ${100-K(t).used}%`)}),Y(e,n)};Z(u,e=>{K(a)===`fuel`?e(d):e(f,-1)}),P(l);var p=H(l,2);let m;var h=z(p),g=e=>{var n=Ua(),r=z(n),i=H(z(r)),a=e=>{Y(e,Va())},o=e=>{var n=Ha();U(e=>Q(n,`d`,e),[()=>s(K(t).used)]),Y(e,n)};Z(i,e=>{K(t).used>=100?e(a):K(t).used>0&&e(o,1)}),P(r),P(n),U(()=>Q(r,`aria-label`,`${K(t).used}% quota used`)),Y(e,n)},_=e=>{var r=Nr(),i=B(r),a=e=>{{let r=F(()=>K(t).trail||[]);Pa(e,{get used(){return K(t).used},get elapsed(){return K(n)},get trail(){return K(r)},get duration(){return K(t).duration}})}},o=e=>{Y(e,Wa())};Z(i,e=>{K(n)===null?e(o,-1):e(a)}),Y(e,r)},v=e=>{var r=qa(),i=B(r),o=z(i);let s;P(i);var c=H(i,2),l=e=>{Y(e,Ga())};Z(c,e=>{K(a)===`fuel`&&e(l)});var u=H(c,2),d=e=>{var t=Ka(),r=B(t),i=V(r),o=H(r,2),s=z(o);let c;P(o),U(e=>{X(i,`RESET CYCLE // ${e??``}% ELAPSED`),c=ui(s,``,c,{width:`${K(a)===`fuel`?100-K(n):K(n)}%`})},[()=>Math.floor(K(n))]),Y(e,t)};Z(u,e=>{K(n)!==null&&e(d)}),U(()=>{Q(i,`aria-label`,K(a)===`fuel`?`Fuel remaining`:`Quota used`),Q(i,`aria-valuenow`,K(a)===`fuel`?100-K(t).used:K(t).used),s=ui(o,``,s,{width:`${K(a)===`fuel`?100-K(t).used:K(t).used}%`})}),Y(e,r)};Z(h,e=>{K(a)===`pie`?e(g):K(a)===`pace`?e(_,1):e(v,-1)}),P(p);var y=H(p,2),b=V(y),x=H(y,2),S=e=>{var n=Ja(),r=V(n,!0);U(()=>X(r,K(t).details)),Y(e,n)};Z(x,e=>{K(t).details&&e(S)}),P(r),U(e=>{X(c,K(t).name),m=ci(p,1,`meter-graphic`,null,m,{"bar-graphic":K(a)===`bars`||K(a)===`fuel`}),X(b,`RESETS // ${e??``}`)},[()=>ma(K(t).reset)]),Y(e,r)}),P(n);var i=H(n,2),c=e=>{Y(e,Xa())};Z(i,e=>{$.data.meters.length||e(c)}),U(()=>r=ci(n,1,`quota-grid`,null,r,{radial:K(a)===`pie`,zone:K(a)===`pace`})),Y(e,t)};Z(l,e=>{K(a)===`thresholds`?e(u):K(a)===`resets`?e(d,1):e(f,-1)}),xe(2),U(e=>X(c,`QUOTA // OBSERVED ${e??``}`),[()=>ma($.data.quotaAt)]),Y(e,t)};Z(u,e=>{$.data&&e(d)}),Y(e,c),We()}var to=J(`
      `),no=J(`

      `,1);function ro(e,t){Ue(t,!0);let n=Wi(t,`values`,19,()=>[]),r=Wi(t,`label`,3,`Token activity`),i=Wi(t,`capacity`,3,0),a=F(()=>Math.max(0,...n())),o=F(()=>i()>n().length?[...Array(i()-n().length).fill(0),...n()]:n());var s=no(),c=B(s),l=V(c),u=H(c,2);Xr(u,21,()=>K(o),Kr,(e,t)=>{var n=to();let r;U((e,t)=>{Q(n,`title`,e),r=ui(n,``,r,{height:t})},[()=>K(t).toLocaleString(`en-GB`)+` tokens`,()=>`${100*K(t)/Math.max(1,K(a))}%`]),Y(e,n)}),P(u),U((e,t)=>{X(l,`SCALE // 0 — ${e??``} TOKENS`),Q(u,`aria-label`,t)},[()=>K(a).toLocaleString(`en-GB`),()=>`${r()}. Peak ${K(a).toLocaleString(`en-GB`)} tokens.`]),Y(e,s),We()}function io(e){if(!e||![`LAST REPLY`,`LAST ACTIVITY`].includes(e.contextKind))return``;let t=e.text||e.contextKind===`LAST ACTIVITY`&&e.workingCommand||``;return t.trim()?t:``}var ao=J(` `),oo=J(``),so=J(`

      `),co=J(`

      `,1),lo=J(`

      `),uo=J(`

      Loading / sending…

      `),fo=J(`
      `),po=J(`

      `),mo=J(`

       
      `),ho=J(`
      `),go=J(`
      `),_o=J(`

      Review expired. Press Enter to review again.

      `),vo=J(`

      `,1),yo=J(`

      `,1),bo=J(`

      No available matching commands.

      `),xo=J(` `,1),So=J(`

      `),Co=J(`

      Review expired. Review the option again.

      `),wo=J(``),To=J(``),Eo=J(``),Do=J(``),Oo=J(``),ko=J(``),Ao=J(``),jo=J(`
      `),Mo=J(`
      `);function No(e,t){let n=Pr();Ue(t,!0);let r=e=>{var t=Nr();Xr(B(t),19,()=>K(fe),e=>e.id,(e,t,r)=>{var i=oo();let o;var s=z(i),c=V(s,!0),l=H(s),u=V(l),d=H(l),f=e=>{var n=ao(),r=V(n,!0);U(()=>X(r,K(t).help)),Y(e,n)};Z(d,e=>{(K(v)?.path===``||K(A))&&e(f)}),P(i),U((e,s)=>{Q(i,`id`,`${n}-${K(r)}`),Q(i,`role`,K(A)?`option`:void 0),Q(i,`aria-selected`,K(A)?K(T)===K(r):void 0),Q(i,`tabindex`,K(A)?-1:void 0),i.disabled=K(g)||K(he)&&!a(),Q(i,`title`,K(t).help),Q(i,`aria-label`,e),o=ci(i,1,`svelte-7bfwr9`,null,o,{suggested:K(T)===K(r)}),X(c,K(t).label),X(u,`${K(A)&&K(t).selected?` // CURRENT`:``}${s??``}`)},[()=>K(t).label+(K(A)&&K(t).selected?` // CURRENT`:``)+ie(K(t)),()=>ie(K(t))]),xr(`focus`,i,()=>{K(A)||_e(K(r))}),q(`click`,i,()=>{_e(K(r)),ye(K(t))}),Y(e,i)}),Y(e,t)},i=Wi(t,`query`,3,``),a=Wi(t,`localOnly`,3,!1),o=Wi(t,`oncopy`,3,()=>{}),s=Wi(t,`onchange`,3,()=>{}),c=Wi(t,`oncomplete`,3,e=>{}),l=[`statusline`,`usage`,`copy`,`theme`,`exit`,`quit`];function u(){return[{id:`local-statusline`,label:`/statusline`,help:`Choose fields for Codexometer’s detail footer.`,next:`statusline`},{id:`local-usage`,label:`/usage`,help:`Open Codexometer’s usage history. Quota and reset views remain available.`,next:`usage`},{id:`local-copy`,label:`/copy`,help:`Copy the selected session’s observed reply or activity with its Copy control.`,next:`copy`},{id:`local-theme`,label:`/theme`,help:`Open the existing Codexometer theme selector. Saved browser display preferences only.`,next:`theme`},{id:`local-exit`,label:`/exit`,help:`Leave session detail and return to Sessions. The local server remains running.`,next:`exit`},{id:`local-quit`,label:`/quit`,help:`Alias for /exit: return to Sessions. The local server remains running.`,next:`quit`}]}function d(){return{title:`/ COMMANDS`,help:`Local Codexometer commands remain available without session control.`,path:``,revision:``,choices:u()}}function f(){R(b,``),R(O,``),R(x,0),R(k,[],!0)}function p(){w++,R(g,!1),R(h,!1),R(E,i()),f(),R(_,``),K(ue)?s()():c()(i())}async function m(e){if(!l.includes(e))return!1;if(e===`copy`&&!io($.data?.sessions.find(e=>e.id===t.session)))return R(_,`No reply or activity text is available to copy for this session.`),!0;if(e===`copy`){let e=o()();p(),await e}else p(),e===`usage`?location.hash=`/usage`:e===`theme`?sa.requests++:e===`statusline`?oa.open=!0:location.hash=`/sessions`;return!0}let h=L(!1),g=L(!1),_=L(``),v=L(null),y=L(null),b=L(``),x=L(0),S=L(Yt(Date.now())),C=L(``),w=0,T=L(0),E=L(null),D=L(void 0),ee=L(void 0),te=L(void 0),O=L(``),k=L(Yt([])),ne=F(()=>K(v)?.path.startsWith(`rename/`)||K(v)?.path.startsWith(`cd/`)),re=F(()=>!!K(y)&&!K(ne)||!!K(O)||K(k).length>0);function ie(e){return e.unavailable?e.unavailable.startsWith(`Waiting for idle.`)?` // WAITING FOR IDLE`:` // UNAVAILABLE`:e.next?` →`:e.action?``:` // HELP`}async function ae(e){K(v)&&!(K(ge)&&K(de))&&R(k,[...K(k),{path:K(v).path,index:K(T),input:K(C)}],!0),await N(e)}async function oe(){if(!K(re))return;if(w++,R(g,!1),R(b,``),R(x,0),R(_,``),K(O)){R(O,``),K(D)?.focus();return}if(K(y)&&!K(ne)){R(y,null),await lr(),K(D)?.focus();return}let e=K(k).at(-1);e&&(R(k,K(k).slice(0,-1),!0),await N(e.path,e))}function se(){K(v)&&K(C).trim()&&!K(g)&&!K(he)&&ae(K(v).path+`/`+encodeURIComponent(K(C).trim()))}let A=F(()=>K(h)&&!!K(v)?.picker&&!K(y)),ce=F(()=>K(h)&&!K(v)?.input&&!K(y)),le=setInterval(()=>{R(S,Date.now(),!0)},1e3);Ki(()=>{clearInterval(le),w++});let ue=F(()=>i().trim().startsWith(`/`)&&!i().trim().startsWith(`//`)),de=F(()=>K(v)?.path===``&&K(ue)?i().trim().slice(1).toLowerCase():``),fe=F(()=>(K(v)?.choices||[]).filter(e=>!K(de)||e.label.toLowerCase().startsWith(`/`+K(de)))),j=F(()=>K(y)||K(fe)[K(T)]),pe=F(()=>!!K(b)&&K(S)K(fe).find(e=>e.id===K(O))),he=F(()=>!$.connected||!!$.data?.sessionsError),ge=F(()=>K(h)&&K(ue)&&(!K(v)||K(v).path===``)&&!K(y));vn(()=>{i(),R(T,0)}),vn(()=>{let e=K(T);K(fe),K(ce)&&lr().then(()=>{let t=K(D)?.children[e];if(!t||!K(D))return;let n=K(D).getBoundingClientRect(),r=t.getBoundingClientRect();r.topn.bottom&&(K(D).scrollTop+=r.bottom-n.bottom)})});function _e(e){K(T)!==e&&K(v)?.picker&&(R(O,``),R(b,``),R(x,0),R(_,``),w++),R(T,e,!0)}function M(){w++,R(g,!1),R(h,!1),R(E,i()),f(),c()(i())}function ve(e){let t=!!K(ee)?.contains(e.target);if(!K(h)||!K(ce)&&!K(y)&&!K(v)?.input||!K(ue)&&!t||K(he)&&!a()||e.isComposing||e.ctrlKey||e.metaKey||e.altKey)return;if(K(v)?.input){e.key===`Escape`&&(e.preventDefault(),e.stopPropagation(),M());return}let n=e.key===`ArrowLeft`,r=e.key.toLowerCase()===`f`,i=e.key.toLowerCase()===`c`;if((i||r||n)&&!t||![`ArrowUp`,`ArrowDown`,`Tab`,`Enter`,`Escape`].includes(e.key)&&!i&&!r&&!n||e.key===`Tab`&&(K(y)||K(v)?.path!==``||e.shiftKey)||e.key===`Enter`&&e.target instanceof Element&&e.target.closest(`button`)&&!K(D)?.contains(e.target)&&!e.target.closest(`[data-command-confirm]`)||K(y)&&!t||K(y)&&[`ArrowUp`,`ArrowDown`].includes(e.key))return;if(e.preventDefault(),e.stopPropagation(),e.key===`Escape`){M();return}if(K(g)||e.repeat&&i)return;if(n){K(re)&&oe();return}if(r){N(K(v)?.path||``);return}if(i){(K(y)?.action||K(A)&&K(O))&&xe();return}if(K(y)){e.key===`Enter`&&K(y).action&&!K(pe)&&!K(_)&&be(K(y));return}if(e.key===`ArrowUp`||e.key===`ArrowDown`){_e(Math.min(Math.max(K(T)+(e.key===`ArrowUp`?-1:1),0),Math.max(K(fe).length-1,0))),!K(A)&&K(D)?.contains(e.target)&&lr().then(()=>(K(D)?.children[K(T)])?.focus());return}let o=K(fe)[K(T)];o&&(e.key===`Tab`?c()(o.label):K(A)?be(o):ye(o))}vn(()=>{K(he)&&!a()&&(w++,R(g,!1),f(),K(h)&&(R(h,!1),R(E,i())),R(v,null),R(y,null))}),vn(()=>{K(ue)&&!K(h)&&i()!==K(E)&&(!K(he)||a())&&(f(),R(h,!0),N(``))});async function N(e,n){let r=++w;if(K(v)&&R(v,{...K(v),path:e},!0),n&&R(C,n.input,!0),R(g,!0),R(y,null),R(O,``),R(b,``),R(x,0),R(_,``),a()){R(v,d(),!0),R(T,n?.index??0,!0),R(g,!1);return}try{let i=await va(`commands`,{session:t.session,command:{mode:`list`,path:e}});r===w&&((e===``||e===`help`)&&(i.choices=[...i.choices.filter(e=>!l.includes(e.label.replace(/^\//,``))),...u()]),R(v,i,!0),R(T,n?Math.min(n.index,Math.max(i.choices.length-1,0)):i.picker?Math.max(i.choices.findIndex(e=>e.selected),0):0,!0),i.picker&&lr().then(()=>K(D)?.focus()),R(C,n?.input??i.value??``,!0),n&&lr().then(()=>{i.input?K(ee)?.querySelector(`input`)?.focus():K(D)?.focus()}),(i.path.startsWith(`rename/`)||i.path.startsWith(`cd/`))&&i.choices.length===1&&(R(g,!1),ye(i.choices[0])))}catch{r===w&&(R(_,`Command catalogue unavailable. Use Codex.`),e===``||e===`help`?(R(v,d(),!0),R(_,``)):R(v,{title:`/`+e,help:``,path:e,revision:``,choices:[]},!0))}finally{r===w&&R(g,!1)}}async function ye(e){if(!(e.unavailable||K(g))&&!(e.next&&await m(e.next))&&!K(_)){if(K(v)?.picker){_e(K(fe).findIndex(t=>t.id===e.id)),K(D)?.focus();return}if(e.next){await ae(e.next);return}await be(e)}}async function be(e){if(K(g)||K(he)||!K(v)||e.unavailable||K(_))return;if(K(v).picker){if(K(pe)&&K(O)===e.id)return;R(O,e.id,!0)}else R(y,e,!0),lr().then(()=>K(te)?.focus());if(R(b,``),R(x,0),R(_,``),!e.action)return;let n=++w;R(g,!0);try{let r=await va(`commands`,{session:t.session,command:{mode:`prepare`,path:K(v).path,revision:K(v).revision,choice:e.id}});if(n===w){let e=Date.parse(r.expires);if(!r.confirmation||!Number.isFinite(e)||Date.now()>=e)throw Error(`Review confirmation unavailable`);R(b,r.confirmation,!0),R(x,e,!0)}}catch{n===w&&R(_,`Option changed or unavailable. Refresh before retrying.`)}finally{n===w&&R(g,!1)}}async function xe(){if(!K(b)||K(he)||K(g)||Date.now()>=K(x)||!K(v)||K(v).picker&&K(O)!==K(fe)[K(T)]?.id)return;let e=K(b);R(b,``),R(g,!0);let n=++w;try{let r=await va(`commands`,{session:t.session,confirmation:e,command:{mode:`commit`,path:K(v).path}});n===w&&(R(_,r.message,!0),R(h,!1),R(v,null),R(y,null),f(),R(E,null),s()())}catch{n===w&&R(_,`Change unconfirmed. Check Codex before retrying.`)}finally{n===w&&R(g,!1)}}var Se={handleKey:ve},Ce=Mo(),we=z(Ce),Te=H(we,2),Ee=e=>{var t=so(),n=V(t,!0);U(()=>X(n,K(_))),Y(e,t)};Z(Te,e=>{K(_)&&!K(h)&&e(Ee)});var De=H(Te,2),Oe=e=>{var i=jo();let o;var s=z(i),c=e=>{var t=co(),n=B(t),r=V(n,!0),i=V(H(n,2),!0);U(()=>{X(r,K(v)?.title||`/ COMMANDS`),X(i,K(v)?.help||`Loading live options…`)}),Y(e,t)};Z(s,e=>{K(ge)||e(c)});var l=H(s,2),u=e=>{var t=lo(),n=V(t,!0);U(()=>X(n,K(_))),Y(e,t)};Z(l,e=>{K(_)&&e(u)});var d=H(l,2),f=e=>{Y(e,uo())};Z(d,e=>{K(g)&&e(f)});var p=H(d,2),m=e=>{var t=fo(),r=z(t),i=z(r),o=H(i);xi(o),P(r),P(t),U(e=>{Q(t,`id`,`${n}-input`),X(i,`${e??``} `),Q(o,`aria-label`,K(v).inputLabel||`Session name`),Q(o,`maxlength`,K(v).inputLimit||512),o.disabled=K(g)||K(he)&&!a()},[()=>(K(v).inputLabel||`Session name`).toUpperCase()]),xr(`submit`,t,e=>{e.preventDefault(),se()}),Ei(o,()=>K(C),e=>R(C,e)),Y(e,t)},h=e=>{var n=mo(),r=z(n),i=V(r,!0),a=H(r,2),o=V(a,!0),s=H(a,2),c=e=>{var n=po(),r=z(n),i=H(r),a=e=>{Y(e,Mr(`Only this session's saved + name changes.`))},o=F(()=>K(v)?.path.startsWith(`rename/`)),s=e=>{Y(e,Mr(`Only this session’s + directory changes; project configuration is not reloaded.`))},c=F(()=>K(v)?.path.startsWith(`cd/`)),l=e=>{Y(e,Mr(`No change sent yet. Model, reasoning and speed settings can + change token usage and cost. Changes affect subsequent turns of + this session, not global defaults. Automatic quota thresholds + may later supersede model settings.`))};Z(i,e=>{K(o)?e(a):K(c)?e(s,1):e(l,-1)}),P(n),U(()=>X(r,`TARGET // ${t.session??``}. `)),Y(e,n)};Z(s,e=>{K(y).action&&e(c)}),P(n),Ii(n,e=>R(te,e),()=>K(te)),U(()=>{X(i,K(y).label),X(o,K(y).help||`No additional help supplied by Codex.`)}),Y(e,n)},w=e=>{var t=xo(),i=B(t),a=e=>{var t=ho(),i=z(t);r(i),P(t),Ii(t,e=>R(D,e),()=>K(D)),U(()=>Q(t,`aria-activedescendant`,`${n}-${K(T)}`)),Y(e,t)},o=e=>{var t=go();let n;var i=z(t);r(i),P(t),Ii(t,e=>R(D,e),()=>K(D)),U(()=>n=ci(t,1,`command-options svelte-7bfwr9`,null,n,{vertical:K(ge)})),Y(e,t)};Z(i,e=>{K(A)?e(a):e(o,-1)});var s=H(i,2),c=e=>{var t=yo(),n=B(t),r=V(n,!0),i=H(n,2),a=e=>{var t=vo(),n=B(t),r=V(n),i=H(n,2),a=e=>{Y(e,_o())};Z(i,e=>{K(b)&&K(S)>=K(x)&&e(a)}),U(()=>X(r,`REVIEW // ${K(me).label??``}. No change sent yet.`)),Y(e,t)};Z(i,e=>{K(me)&&e(a)}),U(()=>X(r,K(fe)[K(T)]?.help)),Y(e,t)};Z(s,e=>{K(A)&&e(c)});var l=H(s,2),u=e=>{Y(e,bo())};Z(l,e=>{!K(g)&&!K(fe).length&&e(u)}),Y(e,t)};Z(p,e=>{K(v)?.input?e(m):K(y)?e(h,1):e(w,-1)});var E=H(p,2),O=e=>{var t=So(),n=V(t,!0);U(()=>X(n,K(j).unavailable)),Y(e,t)};Z(E,e=>{K(j)?.unavailable&&e(O)});var k=H(E,2),ne=e=>{Y(e,Co())};Z(k,e=>{K(b)&&K(S)>=K(x)&&!K(A)&&e(ne)});var ie=H(k,2),ae=z(ie),ce=e=>{var t=Nr(),r=B(t),i=e=>{var t=wo();U(e=>{Q(t,`form`,`${n}-input`),t.disabled=e},[()=>K(g)||K(he)||!K(C).trim()]),Y(e,t)},o=e=>{var t=Nr(),n=B(t),r=e=>{var t=To();U(()=>t.disabled=K(g)||K(he)&&!a()),q(`click`,t,xe),Y(e,t)},i=e=>{var t=Eo();U(()=>t.disabled=K(g)||K(he)&&!a()),q(`click`,t,()=>{K(j)&&be(K(j))}),Y(e,t)};Z(n,e=>{K(pe)?e(r):e(i,-1)}),Y(e,t)},s=e=>{var t=Do(),n=V(t);U(()=>{t.disabled=K(g)||K(he)&&!a(),X(n,`ENTER ${K(j).next?`OPEN`:`HELP`}`)}),q(`click`,t,()=>{K(j)&&ye(K(j))}),Y(e,t)};Z(r,e=>{K(v)?.input?e(i):K(j)?.action&&!K(j).unavailable?e(o,1):!K(y)&&K(j)&&!K(j).unavailable&&e(s,2)}),Y(e,t)};Z(ae,e=>{K(_)||e(ce)});var le=H(ae,2),ue=e=>{var t=Oo();U(()=>t.disabled=K(g)),q(`click`,t,oe),Y(e,t)};Z(le,e=>{K(re)&&e(ue)});var de=H(le,2),_e=e=>{var t=ko();U(()=>t.disabled=K(g)),q(`click`,t,()=>N(K(v)?.path||``)),Y(e,t)};Z(de,e=>{K(ge)||e(_e)});var Se=H(de,2);P(ie);var Ce=H(ie,2),we=e=>{var t=Ao(),n=V(t);U(()=>X(n,`↑/↓ select${K(ge)?` · Tab complete`:``}`)),Y(e,t)};Z(Ce,e=>{!K(v)?.input&&!K(y)&&e(we)}),P(i),Ii(i,e=>R(ee,e),()=>K(ee)),U(()=>{Q(i,`aria-label`,K(ge)?`Slash command suggestions`:`Session command options`),o=ci(i,1,`svelte-7bfwr9`,null,o,{"command-popup":K(ge)})}),q(`keydown`,i,ve),q(`click`,Se,M),Y(e,i)};return Z(De,e=>{K(h)&&e(Oe)}),P(Ce),U(()=>we.disabled=K(he)&&!a()||K(g)),q(`click`,we,()=>{R(h,!K(h)),R(E,K(h)?null:i(),!0),R(b,``),K(h)?(R(k,[],!0),N(``)):M()}),Y(e,Ce),We(Se)}Sr([`click`,`keydown`]);var Po=J(` `,1),Fo=J(`
      `),Io=J(`
      /
      `);function Lo(e,t){Ue(t,!0);let n=F(()=>t.lines.filter(e=>e.kind===`addition`).length),r=F(()=>t.lines.filter(e=>e.kind===`removal`).length);var i=Io(),a=z(i),o=z(a),s=V(o),c=V(H(o,2));P(a),Xr(H(a,2),17,()=>t.lines,Kr,(e,t)=>{var n=Fo();let r;var i=z(n),a=e=>{var n=Po(),r=B(n),i=V(r,!0),a=V(H(r),!0);U(()=>{X(i,K(t).old||``),X(a,K(t).new||``)}),Y(e,n)};Z(i,e=>{K(t).kind!==`heading`&&K(t).kind!==`metadata`&&e(a)});var o=V(H(i),!0);P(n),U(()=>{r=ci(n,1,`diff-line svelte-x4gtb6`,null,r,{added:K(t).kind===`addition`,removed:K(t).kind===`removal`,heading:K(t).kind===`heading`}),X(o,K(t).text)}),Y(e,n)}),P(i),U(()=>{Q(a,`aria-label`,`${K(n)} lines added, ${K(r)} lines removed`),X(s,`+${K(n)??``}`),X(c,`−${K(r)??``}`)}),Y(e,i),We()}var Ro=J(`

      `),zo=J(`

      Send this saved prompt now? This starts Codex work and consumes quota.

      `,1),Bo=J(``),Vo=J(`

       

      In memory only. Follows session model, reasoning and speed. Closing + Codexometer cancels pending work.

      `),Ho=J(`

      CURRENT PROFILE

      MODEL / REASONING LEVEL / SPEED

       

      PROPOSED PROFILE

      MODEL / REASONING LEVEL / SPEED

       

      Applied settings remain after Codexometer closes.

      `,1),Uo=J(`

      `),Wo=J(`

       
      `,1),Go=J(`

      Command unavailable from this observation. Open Codex to inspect the + request.

      `),Ko=J(`

      Session controls temporarily unavailable. Check Codex for current state.

      `),qo=J(`

      Checking session controls…

      `),Jo=J(`

      `),Yo=J(`
      About browser controls

      Controls require a supported live request from a connected shared + app-server session. Local observations alone cannot provide them.

      `),Xo=J(` `,1),Zo=J(` `),Qo=J(`Grants permission beyond this one action. Check the scope + carefully.`),$o=J(``),es=J(``),ts=J(``),ns=J(``),rs=J(`

      Not before this time; when quota and idle allow.

      `),is=J(`

      `,1),as=J(`

      The existing trigger remains active until saved or deleted. If + it changes or sends while you edit, saving is blocked.

      `),os=J(` `,1),ss=J(``),cs=J(``),ls=J(``),us=J(` `,1),ds=J(`
    • `),fs=J(`
      View fixed choices

      Type one of these choices exactly. Your answer stays masked.

        `),ps=J(` `,1),ms=J(`

        `),hs=J(`

        `,1),gs=J(` `,1),_s=J(``),vs=J(`

        `,1),ys=J(`

        `);function bs(e,t){Ue(t,!0);let n=[],r=Wi(t,`observedCommand`,3,``),i=Wi(t,`observedFileChanges`,19,()=>[]),a=Wi(t,`review`,3,``),o=Wi(t,`suspended`,3,!1),s=Wi(t,`openScheduler`,3,!1),c=Wi(t,`onProtectedChange`,3,e=>{}),l=Wi(t,`oncopy`,3,()=>{}),u=L(null),d=L(Yt([])),f=L(null),p=L(``),m=L(0),h=L(Yt(Date.now())),g=L(!1),_=L(``),v=L(!1),y=L(!1),b=L(``),x=L(!1),S=L(``),C=L(!1),w=L(``),T=L(`now`),E=L(60),D=L(``),ee=L(!1),te=L(``),O=L(Yt([])),k=F(()=>K(O).find(e=>e.status!==`sent`)),ne=L(void 0),re=L(void 0);function ie(e){if(K(x)){lr().then(()=>K(ne)?.focus());return}if(e.status!==`pending`||K(g)||!K(u)?.id||K(u).kind!==`prompt`||K(u).questions?.length)return;R(x,!0),R(S,e.id,!0),lr().then(()=>K(ne)?.focus()),R(d,[e.text],!0),R(T,e.trigger===`quota`?`quota`:`at`,!0),R(p,``),R(w,``);let t=new Date(e.at);e.trigger!==`quota`&&R(D,new Date(t.getTime()-t.getTimezoneOffset()*6e4).toISOString().slice(0,16),!0)}vn(()=>{s()&&K(k)&&!K(C)&&K(u)?.id&&K(u).kind===`prompt`&&!K(u).questions?.length&&(R(C,!0),ie(K(k)))});async function ae(){if(!a())try{R(O,await va(`schedules`,{session:t.session},M.signal),!0),K(x)&&!K(O).some(e=>e.id===K(S)&&e.status===`pending`)&&R(p,``),K(w)&&!K(O).some(e=>e.id===K(w)&&e.status===`pending`)&&(R(p,``),R(w,``))}catch{}}async function oe(e){try{R(O,await va(`schedules`,{session:t.session,cancelId:e},M.signal),!0),R(x,!1),R(p,``),R(w,``),R(d,[],!0)}catch(e){R(_,e instanceof Error?e.message:`Unable to cancel trigger.`,!0)}}vn(()=>(c()(K(g)||K(d).some(e=>e.length>0)),()=>c()(!1)));let se=F(()=>$.data?.sessions.find(e=>e.id===t.session)?.status),A=F(()=>!$.connected||!!$.data?.sessionsError),ce=F(()=>a()!==`profile`&&K(u)?.kind===`prompt`&&!K(u).questions?.length&&!!$.data?.profiles?.some(e=>e.session===t.session&&e.pending)),le=F(()=>!K(A)&&!K(y)&&!!K(u)?.id&&K(u).kind===`approval`&&K(b)!==K(u).id),ue=F(()=>K(le)?K(u).command:r()),de=F(()=>!!K(p)&&K(h)K(u)?.questions?.length?K(u).questions:[{text:`Follow-up message`,secret:!1,freeText:!0,options:[]}]),j=F(()=>K(u)?.kind===`approval`||K(u)?.kind===`profile`?K(f)!==null:K(d).length===K(fe).length&&K(d).every((e,t)=>e.trim().length>0&&(K(fe)[t].freeText||K(fe)[t].options?.includes(e)))),pe=F(()=>K(u)?.kind===`prompt`&&!K(u).questions?.length&&K(T)!==`now`),me=F(()=>K(T)===`delay`?K(h)+K(E)*6e4:Date.parse(K(D))),he=F(()=>{if(!K(pe))return``;if(K(x)&&!K(O).some(e=>e.id===K(S)&&e.status===`pending`))return`Trigger changed, removed or already sent. Go back and reopen it; your draft has not been saved.`;if(!K(d)[0]?.trim())return`Enter a message to schedule.`;if(K(T)===`quota`)return``;if(!Number.isFinite(K(me))||K(me)<=K(h))return`Choose a future date/time or a delay greater than zero.`;let e=new Date(K(h));return e.setFullYear(e.getFullYear()+1),K(me)>=e.getTime()?`Choose a time within one year.`:``});function ge(e){return new Date(e).toLocaleString([],{timeZoneName:`short`})}function _e(e){if(e.status!==`pending`)return e.status;if(e.trigger===`at`&&Date.parse(e.at)>K(h))return`Due in `+Math.ceil((Date.parse(e.at)-K(h))/6e4)+` min`;let t=K(A)?`waiting for a fresh connection`:e.waitingReason||(e.canSend?`ready; awaiting dispatch`:`waiting for quota and an eligible idle session`);return(e.trigger===`at`?`Time reached — `:``)+t}vn(()=>{(K(A)||o()||K(ce)||K(h)>=K(m))&&R(p,``)});let M=new AbortController;Gi(()=>{let e=e=>{e.ctrlKey&&e.key.toLowerCase()===`s`&&!a()&&K(k)&&(e.preventDefault(),ie(K(k)))};window.addEventListener(`keydown`,e);let n,r=setInterval(()=>{R(h,Date.now(),!0)},1e3);async function i(){await ae();try{let e=await va(`offer`,{session:t.session,...a()?{review:a()}:{}},M.signal);if(M.signal.aborted)return;R(y,!1),K(u)?.id!==e.id&&(R(p,``),R(f,null),R(d,Array(Math.max(1,e.questions?.length||0)).fill(``),!0)),R(u,e,!0),K(v)&&e.id&&e.id!==K(b)&&(R(_,``),R(v,!1))}catch{M.signal.aborted||(R(u,null),R(y,!0),R(p,``))}finally{M.signal.aborted||(n=setTimeout(i,2e3))}}return i(),()=>{window.removeEventListener(`keydown`,e),M.abort(),clearTimeout(n),clearInterval(r)}});async function ve(e){if(!e&&K(u)?.kind===`prompt`&&!K(u).questions?.length&&K(d)[0]?.trim().startsWith(`/`)&&!K(d)[0]?.trim().startsWith(`//`)){R(_,`Choose a slash command from COMMANDS; use // for literal slash text.`);return}if(!K(u)?.id||K(g)||K(A)||o()||K(ce)||(e?!e.canSend:!K(j)||K(he)))return;let n=K(u).id;R(g,!0),R(_,``),R(v,!1),R(p,``),R(w,e?.id||``,!0);try{let r=!e&&K(u).kind===`prompt`&&!K(u).questions?.length&&K(T)!==`now`?{trigger:K(T)===`quota`?`quota`:`at`,zone:Intl.DateTimeFormat().resolvedOptions().timeZone,...K(T)===`quota`?{}:{at:(K(T)===`delay`?new Date(Date.now()+K(E)*6e4):new Date(K(D))).toISOString()}}:void 0;R(ee,!!r),R(te,r?r.trigger===`quota`?`After fresh quota becomes available, when the session is idle`:ge(r.at)+` — not before this time; when quota and idle allow`:``,!0);let i=await va(`prepare`,{session:t.session,...a()?{review:a()}:{},offer:n,...e?{sendId:e.id}:{},...r?{schedule:r}:{},...r&&K(x)?{editId:K(S)}:{},...K(u).kind===`approval`||K(u).kind===`profile`?{choice:K(f)}:{answers:e?[e.text]:[...K(d)]}},M.signal);K(u)?.id===n&&!M.signal.aborted&&!K(A)&&!o()&&!K(ce)&&(R(p,i.confirmation,!0),R(m,Date.parse(i.expires),!0))}catch(e){M.signal.aborted||R(_,e instanceof Error?e.message:`Unable to prepare action.`,!0)}finally{R(g,!1)}}async function N(){if(!K(u)?.id||K(g)||o()||K(ce)||!K(de))return;let e=K(u).id,n=K(u).kind,r=K(p);R(p,``),R(g,!0),R(b,e,!0);try{await va(`commit`,{session:t.session,...a()?{review:a()}:{},offer:e,confirmation:r},M.signal),R(v,!0),R(x,!1),K(ee)&&(R(b,``),await ae()),R(_,K(ee)?`Trigger set. Closing Codexometer cancels it.`:n===`profile`?`Profile decision completed.`:n===`approval`?`Decision sent.`:`Text sent.`,!0)}catch(e){R(_,e instanceof ga?e.message:`Outcome uncertain. Check Codex before taking another action; nothing was retried.`,!0)}finally{R(g,!1),R(w,``),await ae(),R(d,[],!0),R(f,null)}}var ye=Xo(),be=B(ye),Se=e=>{var t=Nr();Xr(B(t),17,()=>K(O).filter(e=>e.status!==`sent`),e=>e.id,(e,t)=>{var n=Vo(),r=z(n),i=V(r,!0),a=H(r,2),s=V(a),c=H(a,2),l=V(c,!0),d=H(c,2),f=V(d,!0),m=H(d,2),h=V(m,!0),v=H(m,2),y=e=>{var t=Ro(),n=V(t,!0);U(()=>X(n,K(_))),Y(e,t)};Z(v,e=>{K(_)&&e(y)});var b=H(v,4),x=H(b,2),S=H(x,2),C=e=>{var n=zo(),r=H(B(n),2),i=H(r,2);U(()=>r.disabled=K(g)||K(A)||!K(t).canSend),q(`click`,r,N),q(`click`,i,()=>{R(p,``),R(w,``)}),Y(e,n)},T=e=>{var n=Bo();U(()=>n.disabled=K(g)||K(A)||!K(t).canSend||o()),q(`click`,n,()=>ve(K(t))),Y(e,n)};Z(S,e=>{K(de)&&K(w)===K(t).id?e(C):e(T,-1)}),P(n),U((e,n)=>{X(i,K(t).status===`uncertain`?`CHECK TRIGGER — outcome uncertain; not retried`:`SCHEDULED FOLLOW-UP`),X(s,`TARGET // ${K(t).session??``}`),X(l,e),X(f,n),X(h,K(t).text),b.disabled=K(g)||!K(u)?.id||K(u).kind!==`prompt`||!!K(u).questions?.length||K(t).status!==`pending`,x.disabled=K(g)||K(t).status===`sending`},[()=>K(t).trigger===`quota`?`After confirmed quota recovery, when idle`:`Not before ${ge(K(t).at)}`,()=>_e(K(t))]),q(`click`,b,()=>ie(K(t))),q(`click`,x,()=>oe(K(t).id)),Y(e,n)}),Y(e,t)},Ce=F(()=>!a()&&K(u)?.kind!==`approval`&&!K(u)?.questions?.length&&![`APPROVAL NEEDED`,`INPUT NEEDED`].includes(K(se)||``));Z(be,e=>{K(Ce)&&e(Se)});var we=H(be,2),Te=e=>{var r=ys(),o=z(r),s=V(o,!0),c=H(o,2),S=e=>{var t=Ho(),n=B(t),r=V(n),i=H(n,6),a=V(i,!0),o=V(H(i,6),!0);xe(2),U(()=>{X(r,`Your ${K(u).profile.threshold??``}% quota threshold has been reached. Review + the profile for subsequent turns.`),X(a,K(u).profile.current),X(o,K(u).profile.proposed)}),Y(e,t)};Z(c,e=>{K(u)?.profile&&!K(A)&&!K(y)&&e(S)});var C=H(c,2),w=e=>{var t=Uo();let n;var r=V(t,!0);U(()=>{n=ci(t,1,`svelte-1oupzfc`,null,n,{notice:!K(v),sent:K(v)}),X(r,K(_))}),Y(e,t)};Z(C,e=>{K(_)&&e(w)});var O=H(C,2),k=e=>{Lo(e,{get lines(){return K(u).fileChanges}})},ie=e=>{Lo(e,{get lines(){return i()}})},ae=e=>{var t=Wo(),n=B(t),r=V(n,!0),i=V(H(n,2),!0);U(()=>{X(r,K(le)?`EXACT COMMAND`:`LAST OBSERVED COMMAND`),X(i,K(ue))}),Y(e,t)},oe=e=>{Y(e,Go())};Z(O,e=>{K(u)?.fileChanges?.length&&!K(A)&&!K(y)?e(k):i().length?e(ie,1):K(ue)?e(ae,2):a()!==`profile`&&K(se)===`APPROVAL NEEDED`&&!K(v)&&e(oe,3)});var ce=H(O,2),pe=e=>{Y(e,Ko())},_e=e=>{Y(e,qo())},M=e=>{var t=Xo(),n=B(t),r=e=>{var t=Jo(),n=V(t,!0);U(e=>X(n,e),[()=>K(se)===`WORKING`?`Codex is working — nothing to respond to.`:[`APPROVAL NEEDED`,`INPUT NEEDED`].includes(K(se)||``)?`Respond in Codex for this request.`:`Nothing needs a response right now.`]),Y(e,t)};Z(n,e=>{(K(se)===`WORKING`||!K(v)&&!K(g))&&e(r)});var i=H(n,2),a=e=>{Y(e,Yo())},o=F(()=>[`APPROVAL NEEDED`,`INPUT NEEDED`].includes(K(se)||``)&&!K(v));Z(i,e=>{K(o)&&e(a)}),Y(e,t)},ye=e=>{var r=vs(),i=B(r),o=V(i),s=H(i,2),c=z(s),_=V(c,!0),v=H(c,2),y=e=>{var r=Nr();Xr(B(r),17,()=>K(u).choices||[],Kr,(e,r,i)=>{var o=$o(),s=z(o);xi(s),s.value=s.__value=i;var c=H(s),l=H(c),u=e=>{var t=Zo(),n=V(t,!0);U(()=>X(n,K(r).detail)),Y(e,t)};Z(l,e=>{K(r).detail&&e(u)});var d=H(l,2),p=e=>{Y(e,Qo())};Z(d,e=>{K(r).persistent&&e(p)}),P(o),U(()=>{Q(s,`name`,`decision-`+t.session+`-`+a()),X(c,` ${K(r).label??``} `)}),Oi(n,[],s,()=>K(f),e=>R(f,e)),Y(e,o)}),Y(e,r)},b=e=>{var n=Xo(),r=B(n),i=e=>{var t=os(),n=B(t),r=H(z(n)),i=z(r),a=e=>{var t=es();t.value=t.__value=`now`,Y(e,t)};Z(i,e=>{K(x)||e(a)});var o=H(i);o.value=o.__value=`quota`;var s=H(o);s.value=s.__value=`delay`;var c=H(s);c.value=c.__value=`at`,P(r),mi(r),P(n);var l=H(n,2),u=e=>{var t=ts(),n=H(z(t));xi(n),P(t),Ei(n,()=>K(E),e=>R(E,e)),Y(e,t)};Z(l,e=>{K(T)===`delay`&&e(u)});var d=H(l,2),f=e=>{var t=ns(),n=H(z(t));xi(n),P(t),Ei(n,()=>K(D),e=>R(D,e)),Y(e,t)};Z(d,e=>{K(T)===`at`&&e(f)});var p=H(d,2),m=e=>{var t=is(),n=B(t),r=V(n),i=H(n,2),a=e=>{Y(e,rs())};Z(i,e=>{K(T)!==`quota`&&e(a)});var o=H(i,2);o.textContent=`Timezone: ${Intl.DateTimeFormat().resolvedOptions().timeZone??``}. + One pending request per session; saving replaces it. Memory + only; Codexometer must stay running. Uses session model, + reasoning and speed.`,U(e=>X(r,`Will send: ${e??``}`),[()=>K(T)===`quota`?`when quota is available and this session is idle`:Number.isFinite(K(me))?ge(K(me)):`choose a date and time`]),Y(e,t)};Z(p,e=>{K(T)!==`now`&&e(m)});var h=H(p,2),g=e=>{Y(e,as())};Z(h,e=>{K(x)&&e(g)}),hi(r,()=>K(T),e=>R(T,e)),Y(e,t)};Z(r,e=>{K(u).questions?.length||e(i)}),Xr(H(r,2),17,()=>K(fe),Kr,(e,n,r)=>{var i=ps(),o=B(i),s=e=>{{let n=F(()=>K(d)[0]||``);Ii(No(e,{get session(){return t.session},get oncopy(){return l()},get query(){return K(n)},oncomplete:e=>{R(d,[e],!0),lr().then(()=>K(ne)?.focus())},onchange:()=>{R(d,[``],!0),lr().then(()=>K(ne)?.focus())}}),e=>R(re,e,!0),()=>K(re))}};Z(o,e=>{r===0&&a()!==`profile`&&K(u).kind===`prompt`&&!K(u).questions?.length&&e(s)});var c=H(o,2),f=z(c),p=H(f),m=e=>{var t=ss();xi(t),Ei(t,()=>K(d)[r],e=>K(d)[r]=e),Y(e,t)},h=e=>{var t=ls(),i=z(t);i.value=i.__value=``,Xr(H(i),17,()=>K(n).options||[],Kr,(e,t)=>{var n=cs(),r=V(n,!0),i={};U(()=>{X(r,K(t)),i!==(i=K(t))&&(n.value=(n.__value=i)??``)}),Y(e,n)}),P(t),mi(t),hi(t,()=>K(d)[r],e=>K(d)[r]=e),Y(e,t)},g=e=>{var t=us(),i=B(t);tt(i),Ii(i,e=>R(ne,e),()=>K(ne));var a=H(i,2),o=e=>{var t=Jo(),r=V(t);U(e=>X(r,`Suggested answers: ${e??``}`),[()=>K(n).options.join(` · `)]),Y(e,t)};Z(a,e=>{K(n).options?.length&&e(o)}),q(`keydown`,i,e=>{K(u)?.kind===`prompt`&&!K(u).questions?.length&&K(re)?.handleKey(e)}),Ei(i,()=>K(d)[r],e=>K(d)[r]=e),Y(e,t)};Z(p,e=>{K(n).secret?e(m):K(n).freeText?e(g,-1):e(h,1)}),P(c);var _=H(c,2),v=e=>{var t=fs(),r=H(z(t),4);Xr(r,21,()=>K(n).options||[],Kr,(e,t)=>{var n=ds(),r=V(n,!0);U(()=>X(r,K(t))),Y(e,n)}),P(r),P(t),Y(e,t)};Z(_,e=>{K(n).secret&&!K(n).freeText&&e(v)}),U(()=>X(f,`${K(n).text??``} `)),Y(e,i)}),Y(e,n)};Z(v,e=>{K(u).kind===`approval`||K(u).kind===`profile`?e(y):e(b,-1)}),P(s);var S=H(s,2),C=e=>{var t=hs(),n=B(t),r=e=>{var t=ms(),n=V(t);U(()=>X(n,`TRIGGER // ${K(te)??``}`)),Y(e,t)};Z(n,e=>{K(ee)&&e(r)});var i=H(n,2),a=V(i),o=H(i,2),s=V(o),c=H(o,2);U(e=>{X(a,`Check the target and ${K(u).kind===`profile`?`profile above`:K(u).kind===`approval`?K(u).fileChanges?.length?`proposed file changes above`:`exact command and permission scope`:`message above`}. ${K(ee)?`This schedules a follow-up that will send automatically when eligible`:`This will send to Codex`}; it may start work using your quota. + Confirmation expires in ${e??``}s.`),o.disabled=K(g)||K(A),X(s,`CONFIRM ${(K(u).kind===`approval`||K(u).kind===`profile`?K(u).choices?.[K(f)]?.label:K(ee)?K(x)?`SAVE CHANGES`:`SCHEDULE`:`SEND`)??``}`)},[()=>Math.max(0,Math.ceil((K(m)-K(h))/1e3))]),q(`click`,o,N),q(`click`,c,()=>{R(p,``)}),Y(e,t)},w=e=>{var t=gs(),n=B(t),r=e=>{var t=Ro(),n=V(t,!0);U(()=>X(n,K(he))),Y(e,t)};Z(n,e=>{K(he)&&e(r)});var i=H(n,2),a=V(i,!0);U(()=>{i.disabled=K(g)||K(A)||!K(j)||!!K(he),X(a,K(g)?`SENDING…`:K(x)?`REVIEW CHANGES`:`REVIEW BEFORE SENDING`)}),q(`click`,i,()=>ve()),Y(e,t)};Z(S,e=>{K(de)?e(C):e(w,-1)});var O=H(S,2),k=e=>{var t=_s();q(`click`,t,()=>{R(x,!1),R(p,``),R(d,[],!0)}),Y(e,t)};Z(O,e=>{K(x)&&e(k)}),U(()=>{X(o,`TARGET // ${K(u).thread??``} // ${(K(u).directory||`Directory unavailable`)??``}`),s.disabled=K(g)||K(de)||K(A),X(_,K(u).kind===`approval`||K(u).kind===`profile`?`Choose a decision`:K(x)?`EDIT SCHEDULED FOLLOW-UP`:`Reply to this session`)}),Y(e,r)};Z(ce,e=>{K(A)||K(y)?e(pe):K(u)?K(u).id?K(b)!==K(u).id&&e(ye,3):e(M,2):e(_e,1)}),P(r),U(()=>X(s,a()===`profile`?`QUOTA THRESHOLD`:`SESSION CONTROL // EXPERIMENTAL`)),Y(e,r)};Z(we,e=>{!K(ce)&&(!K(k)||K(x)||a()||K(u)?.kind!==`prompt`||K(u).questions?.length)&&e(Te)}),Y(e,ye),We()}Sr([`click`,`keydown`]);var xs=J(` `,1),Ss=J(`
        `),Cs=J(`

        STATUS LINE // CODEXOMETER

        Choose multiple fields and their order. These display preferences do not + change Codex CLI configuration. Missing values are omitted.

        `),ws=J(`

        `,1);function Ts(e,t){Ue(t,!0);let n=Wi(t,`stale`,3,!1),r=L(Yt([])),i=L(!1),a=F(()=>$.data?.statusLineFields||[]),o=e=>[...new Set(e??K(a).filter(e=>e.default).map(e=>e.id))].filter(e=>K(a).some(t=>t.id===e)),s=e=>o(e).map(e=>e===`run-state`&&(n()||!$.connected||$.data?.sessionsError)?`STALE`:t.session.statusLine?.[e]).filter(Boolean).join(` · `),c=F(()=>[...K(r).map(e=>K(a).find(t=>t.id===e)).filter(Boolean),...K(a).filter(e=>!K(r).includes(e.id))]);vn(()=>{oa.open&&!K(i)?(R(r,o(aa.statusLine),!0),R(i,!0)):oa.open||R(i,!1)});function l(e,t){R(r,t?[...K(r),e]:K(r).filter(t=>t!==e),!0)}function u(e,t){let n=K(r).indexOf(e),i=n+t;if(n<0||i<0||i>=K(r).length)return;let a=[...K(r)];[a[n],a[i]]=[a[i],a[n]],R(r,a,!0)}var d=ws(),f=B(d),p=e=>{var t=Cs(),n=H(z(t),4);Xr(n,21,()=>K(c),e=>e.id,(e,t)=>{var n=Ss(),i=z(n),a=z(i);xi(a);var o=H(a,1,!0),s=V(H(o),!0);P(i);var c=H(i,2),d=e=>{var n=xs(),i=B(n),a=H(i,2);U((e,n)=>{Q(i,`aria-label`,`Move `+K(t).label+` earlier`),i.disabled=e,Q(a,`aria-label`,`Move `+K(t).label+` later`),a.disabled=n},[()=>K(r).indexOf(K(t).id)===0,()=>K(r).indexOf(K(t).id)===K(r).length-1]),q(`click`,i,()=>u(K(t).id,-1)),q(`click`,a,()=>u(K(t).id,1)),Y(e,n)},f=F(()=>K(r).includes(K(t).id));Z(c,e=>{K(f)&&e(d)}),P(n),U(e=>{Q(i,`title`,K(t).help),Si(a,e),X(o,K(t).label),X(s,K(t).help)},[()=>K(r).includes(K(t).id)]),q(`change`,a,e=>l(K(t).id,e.currentTarget.checked)),Y(e,n)}),P(n);var i=H(n,2),a=V(i),o=H(i,2),d=H(o,2);P(t),U(e=>X(a,`Preview // ${e??``}`),[()=>s(K(r))||`—`]),q(`click`,o,()=>{aa.statusLine=[...K(r)],ca(),oa.open=!1}),q(`click`,d,()=>{oa.open=!1}),Y(e,t)};Z(f,e=>{oa.open&&e(p)});var m=H(f,2),h=z(m),g=V(h,!0),_=H(h,2);P(m),U((e,t)=>{Q(h,`title`,e),X(g,t)},[()=>s(aa.statusLine),()=>s(aa.statusLine)]),q(`click`,_,()=>{oa.open=!oa.open}),Y(e,d),We()}Sr([`change`,`click`]);var Es=J(`
        `);function Ds(e,t){Ue(t,!0);let n=Wi(t,`active`,3,!1),r=F(()=>io(t.session)),i=F(()=>!!K(r)),a=L(!1),o=L(``),s=L(!1);vn(()=>{if(!K(s))return;let e=setTimeout(()=>{R(s,!1)},150);return()=>clearTimeout(e)}),vn(()=>{K(r),t.session.status,R(o,``)});async function c(){if(!K(i)||K(a))return;let e=K(r);R(a,!0),R(s,!0),R(o,``);try{await navigator.clipboard.writeText(e),K(r)===e&&R(o,`Copied.`)}catch{K(r)===e&&R(o,`Clipboard unavailable. Select the visible text and copy it manually.`)}finally{R(a,!1)}}function l(e){!n()||!K(i)||e.defaultPrevented||e.repeat||e.ctrlKey||e.metaKey||e.altKey||e.key.toLowerCase()!==`c`||e.target instanceof Element&&e.target.closest(`input, textarea, select, [contenteditable]`)||(e.preventDefault(),c())}var u={copy:c},d=Nr();xr(`keydown`,Qt,l);var f=B(d),p=e=>{var t=Es(),n=z(t),r=V(n,!0),i=H(n,2);let l;P(t),U(()=>{X(r,K(o)),i.disabled=K(a),l=ci(i,1,`svelte-543j00`,null,l,{flashed:K(s)})}),q(`click`,i,c),Y(e,t)};return Z(f,e=>{K(i)&&e(p)}),Y(e,d),We(u)}Sr([`click`]);var Os=J(`

         
        `,1),ks=J(`

        LATEST GUIDANCE

         
        `,1),As=J(`

        CONTEXT

         

        `,1),js=J(`

        `),Ms=J(`

        `),Ns=J(`
         
        `),Ps=J(`

         
        `,1),Fs=J(`
         
        `),Is=J(`

        Command unavailable from this observation. Open Codex to inspect the + request.

        `),Ls=J(`

        `,1),Rs=J(`

        `),zs=J(` `,1),Bs=J(`
        `),Vs=J(`

        Session connection or refresh unavailable. Context and telemetry may be + stale.

        `),Hs=J(`

        Some quota profile checks are unavailable. Only sessions with freshly + verified quota and settings can be updated; previous outcome notices remain + visible.

        `),Us=J(` `),Ws=J(` `),Gs=J(` `),Ks=J(``),qs=J(`

        Read only — reply or approve in Codex.

        `),Js=J(`

        `),Ys=J(`QUOTA THRESHOLD // REVIEW PROFILE ↗`),Xs=J(`
        `),Zs=J(`
        `),Qs=J(`

        This session is no longer in the current observation. Return to sessions.

        `),$s=J(`

        `),ec=J(``),tc=J(`

        `),nc=J(` `),rc=J(`

        `),ic=J(`QUOTA THRESHOLD // REVIEW PROFILE ↗`),ac=J(` `,1),oc=J(`

        `),sc=J(`

        TOKEN ACTIVITY // 30 SECOND SAMPLES

        `),cc=J(`

        TOKENS

        FULL DETAIL →
        `),lc=J(`

        No locally observed sessions yet. Keep Codex running alongside + Codexometer.

        `),uc=J(`

        ↑ ↓ SELECT SESSION // ← LESS DETAIL // → MORE DETAIL // ESC BACK

        `,1),dc=J(`

        SESSION TOTALS

        `,1);function fc(e,t){Ue(t,!0);let n=(e,t=f,n,r)=>{let i=pt(()=>g(n?.(),!0)),a=pt(()=>g(r?.(),!1));var o=zs(),s=B(o),c=e=>{var n=Os(),r=B(n),i=V(r,!0),a=V(H(r,2),!0);U(()=>{X(i,t().contextKind===`LAST REPLY`&&!t().streaming?`TASK`:`CURRENT TASK`),X(a,t().currentTask)}),Y(e,n)};Z(s,e=>{t().currentTask&&e(c)});var l=H(s,2),u=e=>{var n=ks(),r=V(H(B(n),2),!0);U(()=>X(r,t().latestGuidance)),Y(e,n)};Z(l,e=>{t().latestGuidance&&e(u)});var d=H(l,2),p=e=>{var n=As(),r=V(H(B(n),2),!0);xe(2),U(()=>X(r,t().approvalContext)),Y(e,n)};Z(d,e=>{K(a)&&t().contextKind===`APPROVAL REQUEST`&&t().approvalContext&&e(p)});var m=H(d,2),h=e=>{var n=js();let r;var i=V(n,!0);U(e=>{r=ci(n,1,`attention-note`,null,r,{inferred:t().status===`CHECK SESSION`}),X(i,e)},[()=>w(t())]),Y(e,n)},_=F(()=>w(t())&&(!K(a)||K(v)||t().status===`CHECK SESSION`));Z(m,e=>{K(_)&&e(h)});var y=H(m,2),b=e=>{var n=Ms(),r=V(n,!0);U(e=>X(r,e),[()=>T(t())]),Y(e,n)};Z(y,e=>{K(i)&&e(b)});var x=H(y,2),S=e=>{var n=Ns(),r=V(n,!0);U(()=>X(r,t().text||`No session context available.`)),Y(e,n)};Z(x,e=>{(t().text||!t().workingCommand)&&e(S)});var C=H(x,2),E=e=>{var n=Ps(),r=H(B(n),2),i=z(r),a=H(i),o=e=>{var n=Mr();U(()=>X(n,`// +${(t().runningCommands||0)-+(t().commandStatus===`running`)} RUNNING`)),Y(e,n)};Z(a,e=>{!K(v)&&(t().runningCommands||0)>+(t().commandStatus===`running`)&&e(o)});var s=H(a,2),c=e=>{Y(e,Mr(`+`))};Z(s,e=>{t().runningLimited&&e(c)}),P(r);var l=V(H(r,2),!0);U(e=>{X(i,`COMMAND // ${e??``} `),X(l,t().workingCommand)},[()=>K(v)?`UNKNOWN`:(t().commandStatus||`unknown`).toUpperCase()]),Y(e,n)};Z(C,e=>{t().workingCommand&&e(E)});var D=H(C,2),ee=e=>{Lo(e,{get lines(){return t().fileChanges}})},te=e=>{var n=Ls(),r=H(B(n),2),i=V(r,!0),a=H(r,2),o=e=>{var n=Fs(),r=V(n,!0);U(()=>X(r,t().command)),Y(e,n)},s=e=>{Y(e,Is())};Z(a,e=>{t().command?e(o):e(s,-1)}),U(()=>X(i,K(v)||t().status!==`APPROVAL NEEDED`?`LAST OBSERVED COMMAND`:$.data?.control?`COMMAND REQUEST`:`COMMAND TO APPROVE IN CODEX`)),Y(e,n)};Z(D,e=>{(!K(a)||!$.data?.control)&&t().fileChanges?.length?e(ee):(!K(a)||!$.data?.control)&&(t().command||t().status===`APPROVAL NEEDED`)&&e(te,1)});var O=H(D,2),k=e=>{var n=Rs(),r=V(n);U(()=>X(r,`CONTEXT SOURCE // ${(t().source||`LOCAL`)??``} // OBSERVATION`)),Y(e,n)};Z(O,e=>{K(a)||e(k)}),Y(e,o)},r=L(void 0),i=Wi(t,`params`,19,()=>({})),a=F(()=>$.data?.sessions||[]),o=F(()=>$.data?.control&&$.data.profiles||[]),s=F(()=>($.data?.triggers||[]).filter(e=>K(a).some(t=>t.id===e.session)));function c(e,t){if(i().id&&i().id!==t&&K(u)){e.preventDefault();return}x(t)}function l(e){return[`TURN COMPLETE`,`IDLE`,`ACTIVE`].includes(e.status)&&K(s).some(t=>t.session===e.id)?`TRIGGER SET`:e.status}let u=L(!1);function d(e,t){if(i().id&&i().id!==t&&K(u)){e.preventDefault();return}x(t)}vn(()=>{let e=i().id;e&&fr(()=>{aa.selected=e,fa(e,2)})});let p=F(()=>K(a).find(e=>e.id===i().id)),m=F(()=>new URLSearchParams(Yi.querystring).get(`review`)===`profile`&&K(o).some(e=>e.session===i().id&&e.pending)),h=F(()=>K(a).some(e=>e.id===aa.selected)?aa.selected:K(a)[0]?.id),v=F(()=>!$.connected||!!$.data?.sessionsError),y=F(()=>[[`OBSERVED TOKENS`,pa(K(a).reduce((e,t)=>e+t.tokens,0))],[`LISTED SESSIONS`,pa(K(a).length)],...[[`WORKING`,`WORKING`],[`AWAITING APPROVAL`,`APPROVAL NEEDED`],[`AWAITING INPUT`,`INPUT NEEDED`],[`CHECK · INFERRED`,`CHECK SESSION`]].map(([e,t])=>[e,K(v)?`—`:pa(K(a).filter(e=>e.status===t).length)])]),b=F(()=>K(a).filter(e=>[`INPUT NEEDED`,`APPROVAL NEEDED`,`CHECK SESSION`].includes(e.status)));function x(e){aa.selected=e,lr().then(()=>document.querySelector(`.session-row.selected`)?.scrollIntoView({block:`nearest`}))}function S(e,t){if(x(e),i().id){t<0&&(fa(e,2),location.hash=`/sessions`);return}let n=ua(e)+t;n>2?location.hash=`/sessions/`+encodeURIComponent(e):fa(e,n)}function C(e){let t=e.target;if(!(e.altKey||e.ctrlKey||e.metaKey||e.shiftKey||t.closest(`input, textarea, select, [contenteditable="true"]`))){if(e.key===`Escape`&&i().id)e.preventDefault(),S(i().id,-1);else if([`ArrowLeft`,`ArrowRight`].includes(e.key)&&(i().id||K(h)))e.preventDefault(),S(i().id||K(h),e.key===`ArrowLeft`?-1:1);else if(!i().id&&[`ArrowUp`,`ArrowDown`].includes(e.key)&&K(a).length){e.preventDefault();let t=K(a).findIndex(e=>e.id===K(h));x(K(a)[Math.max(0,Math.min(K(a).length-1,t+(e.key===`ArrowUp`?-1:1)))].id)}}}function w(e){return K(v)?`Last observation only — refresh unavailable. Check Codex for current state.`:e.status===`CHECK SESSION`?`INFERRED INACTIVITY — a quiet session, not a confirmed input or approval request. Local tools may still be running.`:$.data?.control&&[`APPROVAL NEEDED`,`INPUT NEEDED`].includes(e.status)?`Open full detail for supported live controls; otherwise reply in Codex.`:e.status===`APPROVAL NEEDED`?`OBSERVED APPROVAL SIGNAL — approve or decline in Codex.`:e.status===`INPUT NEEDED`?`OBSERVED INPUT SIGNAL — reply in Codex.`:e.status===`TURN COMPLETE`?`OBSERVED TURN COMPLETION — informational, not an approval request.`:``}function T(e){return e.streaming&&e.contextKind===`LAST REPLY`?`REPLY // STREAMING`:e.contextKind||`LAST ACTIVITY`}var E=dc();xr(`keydown`,Qt,C);var D=B(E),ee=V(H(z(D),2));P(D);var te=H(D,2);let O;Xr(te,21,()=>K(y),Kr,(e,t)=>{var n=F(()=>_(K(t),2));let r=()=>K(n)[0],i=()=>K(n)[1];var a=Bs(),o=z(a),s=V(o,!0),c=V(H(o,2),!0);P(a),U(()=>{X(s,r()),X(c,i())}),Y(e,a)}),P(te);var k=H(te,2),ne=V(k),re=H(k,2),ie=e=>{Y(e,Vs())};Z(re,e=>{K(v)&&e(ie)});var ae=H(re,2),oe=e=>{Y(e,Hs())};Z(ae,e=>{$.data?.profileError&&e(oe)});var se=H(ae,2),A=e=>{var t=Ks(),n=z(t);Xr(n,17,()=>K(b),Kr,(e,t)=>{var n=Us();let r;var i=V(n);U((e,a)=>{r=ci(n,1,`button`,null,r,{approval:K(t).status===`APPROVAL NEEDED`}),Q(n,`href`,e),X(i,`${K(t).status??``} + ${a??``} // ${(K(t).name||K(t).directory||K(t).id)??``}`)},[()=>`#/sessions/`+encodeURIComponent(K(t).id),()=>Array.from(K(t).id).slice(-5).join(``).toUpperCase()]),q(`click`,n,()=>x(K(t).id)),Y(e,n)});var r=H(n,2);Xr(r,17,()=>K(o).filter(e=>e.pending&&K(a).some(t=>t.id===e.session)),Kr,(e,t)=>{var n=Ws(),r=V(n);U((e,a,o)=>{Q(n,`title`,i().id&&i().id!==K(t).session&&K(u)?`Finish sending or clear your current draft before switching sessions.`:`Review this session’s quota threshold`),Q(n,`href`,e),X(r,`QUOTA THRESHOLD ${a??``} // ${o??``}`)},[()=>`#/sessions/`+encodeURIComponent(K(t).session)+`?review=profile`,()=>Array.from(K(t).session).slice(-5).join(``).toUpperCase(),()=>K(a).find(e=>e.id===K(t).session)?.name||K(a).find(e=>e.id===K(t).session)?.directory||K(t).session]),q(`click`,n,e=>d(e,K(t).session)),Y(e,n)}),Xr(H(r,2),17,()=>K(s),Kr,(e,t)=>{var n=Gs(),r=V(n);U((e,t,i)=>{Q(n,`href`,e),X(r,`TRIGGER SET ${t??``} // ${i??``}`)},[()=>`#/sessions/`+encodeURIComponent(K(t).session),()=>Array.from(K(t).session).slice(-5).join(``).toUpperCase(),()=>K(a).find(e=>e.id===K(t).session)?.name||K(a).find(e=>e.id===K(t).session)?.directory]),q(`click`,n,e=>c(e,K(t).session)),Y(e,n)}),P(t),Y(e,t)},ce=F(()=>(K(b).length||K(o).some(e=>e.pending)||K(s).length)&&!K(v));Z(se,e=>{K(ce)&&e(A)});var le=H(se,2),ue=e=>{var t=Nr(),a=B(t),s=e=>{var t=Zs(),a=z(t),s=z(a),c=z(s);let d;var f=H(c);P(s);var h=H(s,2);P(a);var g=H(a,2),_=e=>{var t=Rs(),n=V(t,!0);U(()=>X(n,K(p).directory)),Y(e,t)};Z(g,e=>{K(p).name&&K(p).directory&&e(_)});var y=H(g,2),b=V(y),S=H(y,2);let C;var w=z(S),T=z(w);n(T,()=>K(p),()=>!0,()=>!0),P(w);var E=H(w,2),D=e=>{var t=Nr();Gr(B(t),()=>K(p).id,e=>{{let t=F(()=>new URLSearchParams(Yi.querystring).get(`schedule`)===`edit`),n=F(()=>K(p).fileChanges||[]);bs(e,{get session(){return K(p).id},oncopy:()=>K(r)?.copy(),get openScheduler(){return K(t)},get observedCommand(){return K(p).command},get observedFileChanges(){return K(n)},get suspended(){return K(m)},onProtectedChange:e=>{R(u,e,!0)}})}}),Y(e,t)},ee=e=>{var t=qs();Gr(H(z(t),2),()=>K(p).id,e=>{No(e,{get session(){return K(p).id},localOnly:!0,oncopy:()=>K(r)?.copy()})}),P(t),Y(e,t)};Z(E,e=>{$.data?.control?e(D):e(ee,-1)}),P(S);var te=H(S,2);Xr(te,17,()=>K(o).filter(e=>e.session===K(p).id),e=>e.session,(e,t)=>{var n=Xs(),r=z(n),i=e=>{var n=Js(),r=V(n,!0);U(()=>X(r,K(t).notice)),Y(e,n)};Z(r,e=>{K(t).notice&&e(i)});var a=H(r,2),o=e=>{bs(e,{get session(){return K(p).id},review:`profile`})},s=e=>{var t=Ys();U(e=>Q(t,`href`,e),[()=>`#/sessions/`+encodeURIComponent(K(p).id)+`?review=profile`]),Y(e,t)};Z(a,e=>{K(t).pending&&K(m)?e(o):K(t).pending&&e(s,1)}),P(n),U(()=>Q(n,`id`,`quota-profile-`+K(p).id)),Y(e,n)});var O=H(te,2),k=e=>{var t=Nr();Gr(B(t),()=>K(p).id,e=>{Ii(Ds(e,{get session(){return K(p)},active:!0}),e=>R(r,e,!0),()=>K(r))}),Y(e,t)};Z(O,e=>{K(m)||e(k)}),Gr(H(O,2),()=>K(p).id,e=>{Ts(e,{get session(){return K(p)},get stale(){return K(v)}})}),P(t),U((e,t)=>{d=ci(c,1,`lamp lit`,null,d,{working:K(p).status===`WORKING`&&!K(v)}),X(f,`${e??``} // ${(K(p).name||K(p).directory)??``}`),X(b,`${t??``} TOKENS // ${K(p).id??``} // CONTEXT SOURCE // ${(K(p).source||`LOCAL`)??``}`),C=ui(S,``,C,{display:K(m)?`none`:void 0})},[()=>K(v)?`STALE`:K(m)?`QUOTA THRESHOLD`:l(K(p)),()=>pa(K(p).tokens)]),q(`click`,h,()=>{x(i().id),fa(i().id,2)}),Y(e,t)},c=e=>{Y(e,Qs())};Z(a,e=>{K(p)?e(s):e(c,-1)}),Y(e,t)},de=e=>{var t=uc(),r=B(t),i=H(z(r),2),s=z(i),c=H(s,2);P(i),P(r);var u=H(r,2);Xr(u,17,()=>K(a),e=>e.id,(e,t)=>{let r=F(()=>ua(K(t).id));var i=cc();let a;var s=z(i),c=z(s),u=e=>{var n=$s(),r=z(n),i=V(r);P(n),U(e=>{Q(r,`aria-pressed`,K(h)===K(t).id),X(i,`${e??``} // ${K(t).name??``}`)},[()=>Array.from(K(t).id).slice(-5).join(``).toUpperCase()]),q(`click`,r,()=>x(K(t).id)),Y(e,n)};Z(c,e=>{K(t).name&&e(u)});var f=H(c,2),p=z(f),m=z(p);let g;var _=H(m,1,!0);P(p),P(f);var y=H(f,2),b=e=>{var n=ec(),r=V(n,!0);U(()=>{Q(n,`aria-pressed`,K(h)===K(t).id),X(r,K(t).directory||K(t).id)}),q(`click`,n,()=>x(K(t).id)),Y(e,n)};Z(y,e=>{K(t).name||e(b)});var C=H(y,2),w=z(C);xe(),P(C);var E=H(C,2),D=e=>{var n=Rs(),r=V(n,!0);U(()=>X(r,K(t).directory)),Y(e,n)};Z(E,e=>{K(t).name&&K(t).directory&&e(D)});var ee=H(E,2),te=V(ee),O=H(ee,2),k=V(O),ne=H(O,2),re=z(ne),ie=H(re,2),ae=V(ie,!0),oe=H(ie,2);P(ne);var se=H(ne,2),A=H(se,2),ce=e=>{var n=tc(),r=V(n,!0);U(()=>X(r,K(t).status===`CHECK SESSION`?`INFERRED INACTIVITY`:$.data?.control?`OPEN FULL DETAIL OR REPLY IN CODEX`:K(t).status===`APPROVAL NEEDED`?`APPROVE OR DECLINE IN CODEX`:`REPLY IN CODEX`)),Y(e,n)},le=F(()=>!K(v)&&[`APPROVAL NEEDED`,`INPUT NEEDED`,`CHECK SESSION`].includes(K(t).status));Z(A,e=>{K(le)&&e(ce)}),P(s);var ue=H(s,2),de=e=>{var r=oc(),i=z(r),a=z(i),s=V(a,!0),c=H(a,2),l=e=>{var n=nc(),r=V(n,!0);U(e=>{Q(n,`href`,e),X(r,$.data?.control?`REVIEW IN FULL DETAIL ↗`:`APPROVAL IN CODEX ↗`)},[()=>`#/sessions/`+encodeURIComponent(K(t).id)]),Y(e,n)};Z(c,e=>{!K(v)&&K(t).status===`APPROVAL NEEDED`&&e(l)}),P(i);var u=H(i,2);n(u,()=>K(t),()=>!1);var f=H(u,2);Xr(f,17,()=>K(o).filter(e=>e.session===K(t).id),Kr,(e,n)=>{var r=ac(),i=B(r),a=e=>{var t=rc(),r=V(t,!0);U(()=>X(r,K(n).notice)),Y(e,t)};Z(i,e=>{K(n).notice&&e(a)});var o=H(i,2),s=e=>{var n=ic();U(e=>Q(n,`href`,e),[()=>`#/sessions/`+encodeURIComponent(K(t).id)+`?review=profile`]),q(`click`,n,e=>d(e,K(t).id)),Y(e,n)};Z(o,e=>{K(n).pending&&e(s)}),Y(e,r)});var p=H(f,2);{let e=F(()=>K(h)===K(t).id);Ds(p,{get session(){return K(t)},get active(){return K(e)}})}P(r),U(e=>X(s,e),[()=>T(K(t))]),Y(e,r)};Z(ue,e=>{K(r)>0&&e(de)});var fe=H(ue,2),j=e=>{var n=sc(),r=H(z(n),2);{let e=F(()=>(K(t).samples||[]).map(e=>e.tokens));ro(r,{get values(){return K(e)},capacity:120})}var i=V(H(r,2));P(n),U(()=>X(i,`LAST ${(K(t).samples?.length||0)??``} SAMPLES // AUTO SCALE`)),Y(e,n)};Z(fe,e=>{K(r)<2&&e(j)}),P(i),U((e,n,o,s,c)=>{a=ci(i,1,`session-row`,null,a,{selected:K(h)===K(t).id,wide:K(r)===2,split:K(r)===1}),Q(i,`aria-label`,`Session `+(K(t).name||K(t).directory||K(t).id)),Q(p,`href`,e),g=ci(m,1,`lamp lit`,null,g,{working:K(t).status===`WORKING`&&!K(v)}),X(_,n),X(w,`${o??``} `),X(te,`${K(t).agents??``} LINKED AGENTS`),X(k,`ACTIVE // ${s??``}`),re.disabled=K(r)===0,Q(ie,`aria-expanded`,K(r)>0),X(ae,K(r)?`HIDE DETAIL`:`SHOW DETAIL`),Q(se,`href`,c)},[()=>`#/sessions/`+encodeURIComponent(K(t).id),()=>K(v)?`STALE`:l(K(t)),()=>pa(K(t).tokens),()=>ma(K(t).activity),()=>`#/sessions/`+encodeURIComponent(K(t).id)]),q(`click`,p,()=>x(K(t).id)),q(`click`,re,()=>S(K(t).id,-1)),q(`click`,ie,()=>{x(K(t).id),fa(K(t).id,+!K(r))}),q(`click`,oe,()=>S(K(t).id,1)),q(`click`,se,()=>x(K(t).id)),Y(e,i)});var f=H(u,2),p=e=>{Y(e,lc())};Z(f,e=>{K(a).length||e(p)}),q(`click`,s,()=>da(1)),q(`click`,c,()=>da(0)),Y(e,t)};Z(le,e=>{i().id?e(ue):e(de,-1)}),U(e=>{X(ee,`OBSERVED ${e??``}`),O=ci(te,1,`session-totals`,null,O,{stale:K(v)}),X(ne,`${K(v)?`LAST KNOWN TOTALS — live state counts unavailable. `:``}Tokens + observed since this server started for currently listed sessions; linked + agents are already included. Totals can decrease when a session leaves the + list. History samples every 30 seconds. Not account-wide totals.`)},[()=>ma($.data?.sessionsAt)]),Y(e,E),We()}Sr([`click`]);var pc=J(`

        `),mc=J(`

        Relative usage/credits are not tokens or quota percentages. Groupings + describe the same usage, not additional consumption.

        `,1),hc=J(`// APPROXIMATE`),gc=J(`

        Partial accounting: totals may still change.

        `),_c=J(`

        Percentage of this period's historical allowance, not today's limit. May + exceed 100%. This is not a manual/automatic reset log.

        `,1),vc=J(`

        `,1),yc=J(`

        This optional account report is unavailable. Token history remains + available; missing data does not mean zero usage.

        `),bc=J(`
        `),xc=J(`
        `),Sc=J(`

        No usage reported for this day.

        `),Cc=J(`

        Selected breakdown unavailable; missing does not mean zero.

        `),wc=J(`

        `,1);function Tc(e,t){Ue(t,!0);let n=L(`surface`),r=L(0),i=F(()=>t.reports?.daily),a=F(()=>t.reports?.plan),o=F(()=>t.mode===`breakdown`?K(i)?.days.length||0:K(a)?.periods.length||0),s=F(()=>Math.min(K(r),Math.max(0,K(o)-1))),c=F(()=>K(i)?.days[(K(i)?.days.length||0)-1-K(s)]),l=F(()=>K(a)?.periods[K(s)]),u=F(()=>t.mode===`breakdown`?K(i)?.units||``:`%`),d=F(()=>{let e=Object.create(null);if(t.mode===`breakdown`)e=K(c)?.groups[K(n)]||{};else{let t=K(n)===`feature`?`thread_source`:K(n)===`task start`?`turn_trigger`:K(n);for(let n of K(l)?.breakdowns||[])if(n.dimension===t)for(let t of n.rows)e[t.key]=(e[t.key]||0)+t.basis_points/100}return Object.entries(e).sort((e,t)=>t[1]-e[1]||e[0].localeCompare(t[0]))}),f=F(()=>t.mode===`breakdown`?K(c)?.total:K(l)?.used_basis_points==null?null:K(l).used_basis_points/100),p=F(()=>Math.max(1,K(f)||0,...K(d).map(([,e])=>e))),m=e=>e==null?`UNKNOWN`:e.toLocaleString(`en-GB`,{maximumFractionDigits:2});var h=wc(),g=B(h),v=z(g),y=H(z(v)),b=z(y);b.value=b.__value=`surface`;var x=H(b);x.value=x.__value=`model`;var S=H(x);S.value=S.__value=`feature`;var C=H(S);C.value=C.__value=`task start`,P(y),mi(y),P(v);var w=H(v,2),T=H(w,2),E=V(H(T,2),!0);P(g);var D=H(g,2),ee=z(D),te=V(ee,!0),O=H(ee,2),k=V(O),ne=H(O,2),re=e=>{var t=mc(),n=B(t),r=V(n),a=H(n,2),o=e=>{var t=pc(),n=V(t);U(()=>X(n,`Data as of ${K(i).dataAsOf??``}`)),Y(e,t)};Z(a,e=>{K(i).dataAsOf&&e(o)});var s=V(H(a,2));xe(2),U((e,t)=>{X(r,`Latest fetch ${e??``} // queried ${K(i).from??``} → ${K(i).through??``}. + Reports are fetched from OpenAI and are not saved between runs.`),X(s,`${(K(c)?.date||`No daily buckets reported`)??``} // ${t??``} + ${K(u)??``}`)},[()=>ma(K(i).fetchedAt),()=>m(K(f))]),Y(e,t)},ie=e=>{var t=vc(),n=B(t),r=z(n);let i;var o=V(r,!0),s=H(r),c=e=>{Y(e,hc())};Z(s,e=>{K(a).approximate&&e(c)});var u=H(s);P(n);var d=H(n,2),p=z(d),h=H(p),g=e=>{var t=Mr();U(()=>X(t,`// Boundary tolerance ${K(a).boundary_tolerance_seconds??``}s`)),Y(e,t)};Z(h,e=>{K(a).boundary_tolerance_seconds!=null&&e(g)}),P(d);var _=H(d,2),v=e=>{var t=_c(),n=B(t),r=z(n),i=H(r);let a;var o=V(i);P(n);var s=H(n,2),c=V(s),u=H(s,2),d=e=>{Y(e,gc())};Z(u,e=>{K(l).accounting_complete||e(d)}),xe(2),U(e=>{X(r,`${K(l).window_minutes??``} MIN // ${K(l).plan_type??``} // `),a=ci(i,1,`svelte-1fbui7h`,null,a,{muted:K(f)==null,"quota-near":K(f)!=null&&K(f)>=80&&K(f)<100,"quota-full":K(f)!=null&&K(f)>=100}),X(o,`USED ${e??``}${K(f)==null?``:`%`}`),X(c,`${K(l).starts_at??``} → ${K(l).ends_at??``}`)},[()=>m(K(f))]),Y(e,t)};Z(_,e=>{K(l)&&e(v)}),U(e=>{i=ci(r,1,`svelte-1fbui7h`,null,i,{"quality-warning":!K(a).coverage_complete}),X(o,K(a).coverage_complete?`Reported range complete`:`Partial coverage`),X(u,` // Latest fetch ${e??``}`),X(p,`Coverage starts ${(K(a).coverage_start||`unknown`)??``} // Data as of ${(K(a).data_as_of||`unknown`)??``}`)},[()=>ma(K(a).fetchedAt)]),Y(e,t)},ae=e=>{Y(e,yc())};Z(ne,e=>{t.mode===`breakdown`&&K(i)?e(re):t.mode===`periods`&&K(a)?e(ie,1):e(ae,-1)});var oe=H(ne,2),se=e=>{var n=xc(),r=z(n),i=V(H(z(r),2),!0);P(r),Xr(H(r,2),17,()=>K(d),Kr,(e,n,r)=>{var i=F(()=>_(K(n),2));let a=()=>K(i)[0],o=()=>K(i)[1];var s=bc();let c;var l=z(s),u=V(l,!0),d=H(l,2),f=z(d);let h;P(d);var g=V(H(d,2));P(s),U((e,n,i)=>{c=ci(s,1,`report-row svelte-1fbui7h`,null,c,{unknown:e,alternate:r%2==1}),Q(l,`title`,a()),X(u,a()),h=ui(f,``,h,{width:n}),X(g,`${i??``}${t.mode===`periods`?`%`:``}`)},[()=>a().trim().toLowerCase()===`unknown`,()=>`${Math.max(0,100*o()/K(p))}%`,()=>m(o())]),Y(e,s)}),P(n),U(()=>X(i,t.mode===`breakdown`?K(u):`QUOTA USED`)),Y(e,n)},A=e=>{Y(e,Sc())},ce=e=>{Y(e,Cc())};Z(oe,e=>{K(d).length?e(se):t.mode===`breakdown`&&K(c)?.total===0&&K(c)?.groups[K(n)]!=null?e(A,1):(K(i)&&t.mode===`breakdown`||K(a)&&t.mode===`periods`)&&e(ce,2)}),P(D),U(()=>{w.disabled=K(s)>=K(o)-1,T.disabled=K(s)===0,X(E,K(o)?`${K(s)+1} / ${K(o)}`:`NO DATA`),X(te,t.mode===`breakdown`?`DAILY BREAKDOWN`:`QUOTA WINDOWS`),X(k,`${(t.mode===`breakdown`?t.reports?.dailyStatus||`UNAVAILABLE`:t.reports?.planStatus||`UNAVAILABLE`)??``} // UTC`)}),hi(y,()=>K(n),e=>R(n,e)),q(`click`,w,()=>R(r,K(s)+1)),q(`click`,T,()=>R(r,K(s)-1)),Y(e,h),We()}Sr([`click`]);var Ec=864e5;function Dc(e,t){let n=new Date(e);n.setUTCDate(1),n.setUTCMonth(n.getUTCMonth()+t);let r=new Date(Date.UTC(n.getUTCFullYear(),n.getUTCMonth()+1,0)).getUTCDate();return n.setUTCDate(Math.min(e.getUTCDate(),r)),n}function Oc(e,t,n){let r=new Date(Date.UTC(e.getUTCFullYear(),e.getUTCMonth(),e.getUTCDate()));for(let e=0;;e++){let i=Dc(r,-t),a=new Date(i.getTime()+Ec);if(e===n)return{start:a,end:r};r=i}}var kc=J(``),Ac=J(``,1),jc=J(`

        History refresh failed. Any displayed history is the last successful + observation.

        `),Mc=J(`

        Token history unavailable; other reports may still be available.

        `),Nc=J(``),Pc=J(`
        `),Fc=J(`

        LESS ░ ▒ ▓ █ MORE // HOVER FOR DATE AND TOKENS

        `,1),Ic=J(`
        `,1),Lc=J(` `),Rc=J(`

        LIFETIME TOKENS

        PEAK DAY

        CURRENT STREAK

        DAYS

        LONGEST TURN

        SECONDS

        LONGEST STREAK

        DAYS

        OPENAI // UTC

        Accessible data table
        Date (UTC)Tokens

        `,1),zc=J(`

        History unavailable or awaiting a matching account observation. Missing + history is not treated as zero usage.

        `),Bc=J(`

        USAGE // ACCOUNT HISTORY

        Account-wide history reported by Codex, not the local Sessions counter. Dates + use UTC. Allowance history is approximate where indicated; reset causes are + not provided.

        `,1);function Vc(e,t){Ue(t,!0);let n=L(`daily`),r=L(12),i=L(0),a=F(()=>{let e=$.data?.usage?.dailyUsageBuckets;if(!e)return[];let{start:t,end:n}=Oc(new Date,K(r),K(i)),a=new Map;for(let t of e)!Number.isFinite(t.tokens)||t.tokens<0||a.set(t.startDate,(a.get(t.startDate)||0)+t.tokens);let o=[];for(let e=t;e<=n;e=new Date(e.getTime()+864e5)){let t=e.toISOString().slice(0,10);o.push({date:t,tokens:a.get(t)||0})}return o}),o=F(()=>Math.max(1,...K(a).map(e=>e.tokens))),s=F(()=>K(a).length?new Date(K(a)[0].date+`T00:00:00Z`).getUTCDay():0),c=F(()=>{if(K(n)===`monthly`){let e=new Map;for(let t of K(a))e.set(t.date.slice(0,7),(e.get(t.date.slice(0,7))||0)+t.tokens);return[...e].map(([e,t])=>({date:e,tokens:t}))}let e=0;return K(a).map(t=>({date:t.date,tokens:e+=t.tokens}))});var l=Bc(),u=H(B(l),4);Xr(u,20,()=>[[`daily`,`Daily`],[`monthly`,`Monthly`],[`cumulative`,`Cumulative`],[`breakdown`,`Breakdown`],[`periods`,`Windows`]],Kr,(e,t)=>{var r=F(()=>_(t,2));let a=()=>K(r)[0],o=()=>K(r)[1];var s=kc();let c;var l=V(s,!0);U(()=>{Q(s,`aria-pressed`,K(n)===a()),c=ci(s,1,``,null,c,{active:K(n)===a()}),X(l,o())}),q(`click`,s,()=>{R(n,a(),!0),R(i,0)}),Y(e,s)}),P(u);var d=H(u,2),f=z(d),p=e=>{var t=Ac(),n=B(t),a=H(z(n)),o=z(a);o.value=o.__value=6;var s=H(o);s.value=s.__value=12,P(a),mi(a),P(n);var c=H(n),l=H(c);U(()=>l.disabled=K(i)===0),q(`change`,a,()=>R(i,0)),hi(a,()=>K(r),e=>R(r,e)),q(`click`,c,()=>Kt(i)),q(`click`,l,()=>Kt(i,-1)),Y(e,t)};Z(f,e=>{K(n)!==`breakdown`&&K(n)!==`periods`&&e(p)}),P(d);var m=H(d,2),h=e=>{Y(e,jc())};Z(m,e=>{$.data?.usageError&&e(h)});var g=H(m,2),v=e=>{Y(e,Mc())};Z(g,e=>{$.data?.usage?.tokenStatus===`UNAVAILABLE`&&K(n)!==`breakdown`&&K(n)!==`periods`&&e(v)});var y=H(g,2),b=e=>{var t=Nr();Gr(B(t),()=>K(n),e=>{{let t=F(()=>$.data?.usage?.reports);Tc(e,{get reports(){return K(t)},get mode(){return K(n)}})}}),Y(e,t)},x=e=>{var t=Rc(),r=B(t),i=z(r),l=V(H(z(i),2),!0);P(i);var u=H(i,2),d=V(H(z(u),2),!0);P(u);var f=H(u,2),p=H(z(f),2),m=z(p);xe(),P(p),P(f);var h=H(f,2),g=H(z(h),2),_=z(g);xe(),P(g),P(h);var v=H(h,2),y=H(z(v),2),b=z(y);xe(),P(y),P(v),P(r);var x=H(r,4),S=z(x),C=V(S),w=H(S,2),T=e=>{var t=Fc(),n=B(t),r=z(n),i=z(r);Xr(i,17,()=>Array(K(s)),Kr,(e,t)=>{Y(e,Nc())}),Xr(H(i,2),17,()=>K(a),Kr,(e,t)=>{var n=Pc();let r,i;U(e=>{r=ci(n,1,`heat-cell`,null,r,{zero:K(t).tokens===0}),Q(n,`title`,e),i=ui(n,``,i,{opacity:K(t).tokens?.25+.75*K(t).tokens/K(o):1})},[()=>`${K(t).date}: ${pa(K(t).tokens)} tokens`]),Y(e,n)}),P(r),P(n),xe(2),Y(e,t)},E=e=>{var t=Ic(),r=B(t);{let e=F(()=>K(c).map(e=>e.tokens)),t=F(()=>K(n)+` usage`);ro(r,{get values(){return K(e)},get label(){return K(t)}})}var i=H(r,2),a=z(i),o=V(a,!0),s=V(H(a),!0);P(i),U(e=>{X(o,K(c)[0]?.date),X(s,e)},[()=>K(c).at(-1)?.date]),Y(e,t)};Z(w,e=>{K(n)===`daily`?e(T):e(E,-1)});var D=H(w,2),ee=H(z(D),2),te=z(ee),O=H(z(te));Xr(O,21,()=>K(n)===`daily`?K(a):K(c),Kr,(e,t)=>{var n=Lc(),r=z(n),i=V(r,!0),a=V(H(r),!0);P(n),U(e=>{X(i,K(t).date),X(a,e)},[()=>pa(K(t).tokens)]),Y(e,n)}),P(O),P(te),P(ee),P(D),P(x);var k=V(H(x,2));U((e,t,n,r,i,o,s)=>{X(l,e),X(d,t),X(m,`${n??``} `),X(_,`${r??``} `),X(b,`${i??``} `),X(C,`${K(a)[0]?.date??``} — ${o??``}`),X(k,`OBSERVED ${s??``} // CUMULATIVE IS FOR THE SELECTED PERIOD`)},[()=>pa($.data.usage.summary.lifetimeTokens),()=>pa($.data.usage.summary.peakDailyTokens),()=>pa($.data.usage.summary.currentStreakDays),()=>pa($.data.usage.summary.longestRunningTurnSec),()=>pa($.data.usage.summary.longestStreakDays),()=>K(a).at(-1)?.date,()=>ma($.data.usageAt)]),Y(e,t)},S=e=>{Y(e,zc())};Z(y,e=>{K(n)===`breakdown`||K(n)===`periods`?e(b):$.data?.usage&&$.data.usage.dailyUsageBuckets!==null?e(x,1):e(S,-1)}),Y(e,l),We()}Sr([`click`,`change`]);var Hc=J(`

        Page not found

        Return to Quota

        `,1);function Uc(e){var t=Hc();xe(2),Y(e,t)}var Wc=`CODEXOMETER`,Gc=[`█▀▀ █▀█ █▀▄ █▀▀ ▀▄▀ █▀█ █▀▄▀█ █▀▀ ▀█▀ █▀▀ █▀█`,`█▄▄ █▄█ █▄▀ ██▄ █ █ █▄█ █ ▀ █ ██▄ █ ██▄ █▀▄`].flatMap(e=>[[...e].map(e=>e===`█`||e===`▀`),[...e].map(e=>e===`█`||e===`▄`)]),Kc=Gc[0].length,qc=Gc.length,Jc=0,Yc=[...Wc].map(e=>{let t=e===`M`?5:3,n={start:Jc,width:t};return Jc+=t+1,n}),Xc=`ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789`,Zc=`010 101 111 101.110 111 101 110.111 100 100 111.110 101 101 110.111 100 110 111.111 100 110 100.111 100 101 111.101 101 111 101.111 010 010 111.001 001 101 111.101 110 110 101.100 100 100 111.101 111 101 101.101 111 111 101.111 101 101 111.111 101 111 100.111 101 111 001.111 101 110 101.111 100 001 111.111 010 010 010.101 101 101 111.101 101 101 010.101 101 111 101.101 010 010 101.101 101 010 010.111 001 100 111.111 101 101 111.110 010 010 111.111 001 110 111.111 011 001 111.101 101 111 001.111 110 001 111.100 111 101 111.111 001 010 010.111 111 101 111.111 101 111 001`.split(`.`).map(e=>e.split(` `));function Qc(e=Wc,t=-1,n=!1){let r=``;for(let i=0;i{e|=0,e=e+1831565813|0;let t=Math.imul(e^e>>>15,1|e);return t^=t+Math.imul(t^t>>>7,61|t),((t^t>>>14)>>>0)/4294967296}}function nl(){let e=$c[Math.floor(Math.random()*$c.length)],t=Math.floor(Math.random()*4294967296),n=tl(t),r=[...Wc].map((e,t)=>t);for(let e=r.length-1;e>0;e--){let t=Math.floor(n()*(e+1));[r[e],r[t]]=[r[t],r[e]]}return{variant:e,seed:t,order:r}}function rl(e,t){if(e.variant===`typing`){let e=t<1080,n=e?0:Math.min(Math.floor((t-1080)/90)+1,11);return{text:Wc.slice(0,n).padEnd(11),cursor:n,dot:e?Math.floor(t/180)%2==0:n<11}}if(e.variant===`shuffle`){let n=tl(e.seed^Math.floor(t/70)),r=[...Wc].map(e=>{let t;do t=Xc[Math.floor(n()*36)];while(t===e);return t}),i=Math.min(Math.floor(t/110),11);for(let t of e.order.slice(0,i))r[t]=Wc[t];return{text:r.join(``),cursor:-1,dot:!1}}return{text:Wc,cursor:-1,dot:!1}}var il=jr(``);function al(e,t){Ue(t,!0);let n=Wi(t,`text`,3,Wc),r=Wi(t,`cursor`,19,()=>-1),i=Wi(t,`dot`,3,!1),a=F(()=>Qc(n(),r(),i()));var o=il(),s=V(o);U(()=>{Q(o,`viewBox`,`0 0 ${Kc} ${qc}`),Q(o,`width`,Kc),Q(o,`height`,qc),Q(s,`d`,K(a))}),Y(e,o),We()}var ol=J(`
        `),sl=J(`
        `);function cl(e,t){Ue(t,!0);let n=L(void 0),r=L(0),i=L(Yt({width:0,height:0,pixelRatio:1})),a=L(Yt({x:0,y:0,width:0})),o=F(()=>K(n)?rl(K(n),K(r)):void 0),s=F(()=>{if(!K(n))return{x:0,y:0,width:0};let e=el[K(n).variant],t=Math.min(Math.max((K(r)-e-180)/800,0),1),o=t*t*(3-2*t),s=K(i).width+(K(a).width-K(i).width)*o,c=Math.max((K(i).height-K(i).width*qc/Kc)/2,0),l=(K(n).variant===`slide`&&K(r)Math.round(e*K(i).pixelRatio)/K(i).pixelRatio;return{x:d(l),y:d(u),width:d(s)}});Gi(()=>{let e=matchMedia(`(prefers-reduced-motion: reduce)`);if(e.matches){t.onfinish();return}R(n,nl(),!0);let o=el[K(n).variant]+180+800,s=0,c=!1,l=performance.now(),u=()=>{let e=t.target?.getBoundingClientRect();R(i,{width:window.innerWidth,height:window.innerHeight,pixelRatio:window.devicePixelRatio||1},!0),e&&R(a,{x:e.x,y:e.y,width:e.width},!0)},d=()=>{c||(c=!0,cancelAnimationFrame(s),t.onfinish())},f=e=>{e instanceof PointerEvent&&e.button!==0||e instanceof KeyboardEvent&&(e.metaKey||e.ctrlKey||e.altKey||e.shiftKey)||e instanceof KeyboardEvent&&[`Shift`,`Control`,`Alt`,`Meta`].includes(e.key)||(e.preventDefault(),e.stopImmediatePropagation(),d())},p=()=>{e.matches&&d()},m=e=>{R(r,Math.max(e-l,0),!0),K(r)>=o?d():s=requestAnimationFrame(m)},h=new ResizeObserver(u);if(t.target){h.observe(t.target),t.target.parentElement&&h.observe(t.target.parentElement);let e=t.target.closest(`header`);e&&h.observe(e)}return u(),window.addEventListener(`resize`,u),document.addEventListener(`keydown`,f,!0),document.addEventListener(`pointerdown`,f,!0),e.addEventListener(`change`,p),s=requestAnimationFrame(m),()=>{c=!0,cancelAnimationFrame(s),h.disconnect(),window.removeEventListener(`resize`,u),document.removeEventListener(`keydown`,f,!0),document.removeEventListener(`pointerdown`,f,!0),e.removeEventListener(`change`,p)}});var c=sl(),l=z(c),u=e=>{var t=ol();let n;al(z(t),{get text(){return K(o).text},get cursor(){return K(o).cursor},get dot(){return K(o).dot}}),P(t),U(()=>{Q(t,`data-text`,K(o).text),Q(t,`data-cursor`,K(o).dot?K(o).cursor:void 0),n=ui(t,``,n,{left:`${K(s).x}px`,top:`${K(s).y}px`,width:`${K(s).width}px`})}),Y(e,t)};Z(l,e=>{K(o)&&e(u)});var d=H(l,2);P(c),U(()=>Q(c,`data-entrance`,K(n)?.variant)),q(`click`,d,function(...e){t.onfinish?.apply(this,e)}),Y(e,c),We()}Sr([`click`]);var ll=J(` `),ul=J(`

        `),dl=J(`

        Connecting to your local Codexometer…

        `),fl=J(``),pl=J(`

        Your quota. Your sessions. Your command centre.

        `);function ml(e,t){Ue(t,!0);let n={"/":eo,"/quota/:view?":eo,"/sessions/:id?":fc,"/usage":Vc,"*":Uc},r={quota:/^(?:\/|\/quota(?:\/[^/]+)?\/?)$/,sessions:/^\/sessions(?:\/[^/]+)?\/?$/,usage:/^\/usage\/?$/},i=L(`hacker`),a=L(!0),o=L(void 0);vn(()=>{sa.requests&&lr().then(()=>{K(o)?.focus(),K(o)?.scrollIntoView({block:`nearest`})})});let s=L(void 0),c=[`hacker`,`rust`,`blue-steel`,`ultraviolet`,`nightshade`];vn(()=>{ca()}),vn(()=>{if($.data)for(let[e,t]of Object.entries(r))t.test(Yi.location)&&(aa.tab=e)}),Gi(()=>{try{let e=localStorage.getItem(`codexometer.web.theme`);e&&c.includes(e)&&R(i,e,!0)}catch{}return ya()});function l(){try{localStorage.setItem(`codexometer.web.theme`,K(i))}catch{}}var u=pl(),d=z(u),f=z(d),p=z(f);al(z(p),{}),P(p),Ii(p,e=>R(s,e),()=>K(s)),xe(2),P(f);var m=H(f,2),h=z(m);let g;var v=H(h,1,!0),y=V(H(v));P(m),P(d);var b=H(d,2);Xr(b,21,()=>Object.entries(r),Kr,(e,t)=>{var n=F(()=>_(K(t),2));let r=()=>K(n)[0],i=()=>K(n)[1],a=F(()=>i().test(Yi.location));var o=ll();let s;var c=V(o,!0);U(e=>{Q(o,`href`,r()===`quota`?`#/quota/`+aa.view:`#/`+r()),Q(o,`aria-current`,K(a)?`page`:void 0),s=ci(o,1,``,null,s,{active:K(a)}),X(c,e)},[()=>r().toUpperCase()]),Y(e,o)}),P(b);var x=H(b,2),S=z(x),C=e=>{var t=ul(),n=V(t,!0);U(()=>X(n,$.error)),Y(e,t)};Z(S,e=>{$.error&&e(C)});var w=H(S,2),T=e=>{$i(e,{get routes(){return n}})},E=e=>{Y(e,dl())};Z(w,e=>{$.data?e(T):$.error||e(E,1)}),P(x);var D=H(x,2),ee=z(D),te=V(ee),O=H(ee,2),k=V(O,!0),ne=H(O,2),re=H(z(ne));Xr(re,21,()=>c,Kr,(e,t)=>{var n=fl(),r=V(n,!0),i={};U(e=>{X(r,e),i!==(i=K(t))&&(n.value=(n.__value=i)??``)},[()=>K(t).replace(`-`,` `).toUpperCase()]),Y(e,n)}),P(re),Ii(re,e=>R(o,e),()=>K(o)),mi(re),P(ne),P(D);var ie=H(D,2),ae=e=>{cl(e,{get target(){return K(s)},onfinish:()=>R(a,!1)})};Z(ie,e=>{K(a)&&e(ae)}),P(u),U(()=>{Q(u,`data-theme`,K(i)),Q(u,`data-starting`,K(a)),d.inert=K(a),g=ci(h,1,`lamp`,null,g,{lit:$.connected}),X(v,$.connected?`CONNECTED`:`OFFLINE`),X(y,`EXPERIMENTAL // ${$.data?.control?`SESSION CONTROL`:`READ ONLY`}`),b.inert=K(a),x.inert=K(a),D.inert=K(a),X(te,`v${($.data?.version||`…`)??``} // LOCAL ONLY`),X(k,$.data?.control?`Session control enabled. Stop the server to revoke access.`:`No actions can be sent from this preview.`)}),q(`change`,re,l),hi(re,()=>K(i),e=>R(i,e)),Y(e,u),We()}Sr([`change`]),zr(ml,{target:document.getElementById(`app`)}); \ No newline at end of file diff --git a/internal/web/dist/assets/index-GcuOkuuL.css b/internal/web/dist/assets/index-GcuOkuuL.css new file mode 100644 index 0000000..56ca040 --- /dev/null +++ b/internal/web/dist/assets/index-GcuOkuuL.css @@ -0,0 +1 @@ +.observation-details.svelte-1vgdi83{font-size:12px}summary.svelte-1vgdi83{cursor:pointer;color:var(--accent)}.observation-table.svelte-1vgdi83{max-height:240px;overflow:auto}.zone-canvas.svelte-1vgdi83{flex:1;min-height:170px;margin-top:6px;position:relative}svg.svelte-1vgdi83{width:100%;height:100%;display:block;position:absolute;inset:0}text.svelte-1vgdi83{fill:var(--ink);font:14px Cascadia Code,Consolas,monospace}.axis-title.svelte-1vgdi83{letter-spacing:.04em;font-size:12px}.grid.svelte-1vgdi83{stroke:#fff;stroke-opacity:.14;stroke-width:1px}.axes.svelte-1vgdi83{stroke:var(--ink);stroke-width:1.5px;fill:none}.pace-line.svelte-1vgdi83{stroke:#fff;stroke-width:2px;stroke-dasharray:6 4}.position-halo.svelte-1vgdi83{fill:#101820;stroke:#fff;stroke-width:1.5px}.position-dot.svelte-1vgdi83{fill:#fff}.observation-trail.svelte-1vgdi83{fill:none;stroke:#101820;stroke-width:2.5px;stroke-linejoin:round}.observation-trail-casing.svelte-1vgdi83{fill:none;stroke:#ffffff73;stroke-width:4.5px;stroke-linejoin:round}.trail-start.svelte-1vgdi83{fill:#101820;stroke:#ffffffb3;stroke-width:2px}.trend-line.svelte-1vgdi83{fill:none;stroke:var(--trend-color);stroke-width:2px;stroke-dasharray:3 6}.trend-arrow.svelte-1vgdi83{fill:var(--trend-color);stroke:#ffffff73;stroke-width:.5px}.trend-casing.svelte-1vgdi83{fill:none;stroke:#ffffff73;stroke-width:4px;stroke-dasharray:3 6}.zone-caption.svelte-1vgdi83{min-width:0;color:var(--accent);flex:auto;margin:0}.trend-summary.svelte-1vgdi83{color:var(--ink)}.zone-footer.svelte-1vgdi83{justify-content:space-between;align-items:flex-start;gap:12px;margin-top:4px;display:flex}.zone-controls.svelte-1vgdi83{color:var(--muted);text-align:right;flex-direction:column;align-items:flex-end;gap:5px;font-size:11px;display:flex}.trace-control.svelte-1vgdi83,.trend-control.svelte-1vgdi83{cursor:pointer;white-space:nowrap}.trace-control.svelte-1vgdi83 input:where(.svelte-1vgdi83){accent-color:var(--accent)}.trend-control.svelte-1vgdi83 select:where(.svelte-1vgdi83){border:1px solid var(--edge);background:var(--panel);max-width:min(230px,45vw);color:var(--ink);font:inherit}.trend-control.svelte-1vgdi83 option:where(.svelte-1vgdi83):disabled{color:var(--muted)}.zone-controls.svelte-1vgdi83 small:where(.svelte-1vgdi83){font-size:10px}@container (width<=560px){.zone-footer.svelte-1vgdi83{flex-direction:column}.zone-controls.svelte-1vgdi83{align-self:stretch;align-items:flex-end}}.slash-commands.svelte-7bfwr9{margin:.4rem 0;position:relative}.command-popup.svelte-7bfwr9{z-index:5;box-sizing:border-box;border:1px solid var(--accent);background:var(--panel);width:min(40rem,100%);padding:.35rem;position:absolute;bottom:100%;left:0;box-shadow:0 .3rem 1rem #0006}.command-popup.svelte-7bfwr9 p:where(.svelte-7bfwr9){margin:.3rem 0;font-size:.8em}.command-options.vertical.svelte-7bfwr9{flex-flow:column;gap:.15rem;display:flex}.vertical.svelte-7bfwr9 button:where(.svelte-7bfwr9){text-align:left;white-space:nowrap;width:100%;min-width:0;color:var(--muted);background:var(--panel);border-color:#0000;flex:none;align-items:baseline;gap:.4rem;display:flex}.vertical.svelte-7bfwr9 .command-name:where(.svelte-7bfwr9),.vertical.svelte-7bfwr9 .command-tail:where(.svelte-7bfwr9){flex:none}.vertical.svelte-7bfwr9 .command-name:where(.svelte-7bfwr9){text-overflow:ellipsis;max-width:100%;overflow:hidden}.vertical.svelte-7bfwr9 button.suggested:where(.svelte-7bfwr9){outline:none}.command-options.svelte-7bfwr9 button.suggested:where(.svelte-7bfwr9) .command-name:where(.svelte-7bfwr9){color:var(--ink);font-weight:700}.command-options.svelte-7bfwr9 button:where(.svelte-7bfwr9):not(.suggested):hover .command-name:where(.svelte-7bfwr9){text-decoration:underline}.command-options.svelte-7bfwr9 button:where(.svelte-7bfwr9){color:var(--muted)}.vertical.svelte-7bfwr9 .command-help:where(.svelte-7bfwr9){min-width:0;max-width:none;color:var(--muted);flex:1}.command-options.svelte-7bfwr9{flex-wrap:wrap;gap:.35rem;max-height:35vh;display:flex;overflow:auto}.command-options.svelte-7bfwr9 .suggested:where(.svelte-7bfwr9){outline:none}.command-help.svelte-7bfwr9{text-overflow:ellipsis;white-space:nowrap;opacity:.75;max-width:32ch;font-size:.8em;display:block;overflow:hidden}.command-actions.svelte-7bfwr9{flex-wrap:wrap;gap:.35rem;margin-top:.4rem;display:flex}.availability.svelte-7bfwr9{font-weight:600}.navigation.svelte-7bfwr9{font-size:.8em}pre.svelte-7bfwr9{white-space:pre-wrap;overflow-wrap:anywhere;max-height:35vh;overflow:auto}.file-diff.svelte-x4gtb6{border:1px solid var(--muted);max-height:60vh;padding:.5rem;font-family:monospace;overflow:auto}.diff-line.svelte-x4gtb6{white-space:pre;min-height:1.3em;display:flex}.line-number.svelte-x4gtb6{text-align:right;opacity:.75;-webkit-user-select:none;user-select:none;flex:0 0 5ch;padding-right:1ch;display:inline-block}.added.svelte-x4gtb6{color:#67d391;background:#67d39112}.removed.svelte-x4gtb6{color:#ff6b83;background:#ff6b8312}.heading.svelte-x4gtb6{padding:.5rem 0;font-weight:700}.saved-prompt.svelte-1oupzfc{white-space:pre-wrap;overflow-wrap:anywhere}fieldset.svelte-1oupzfc{border:1px solid;margin:.5rem 0;padding:.35rem .6rem}.decision.svelte-1oupzfc,.answer.svelte-1oupzfc{margin:.3rem 0;display:block}.decision.svelte-1oupzfc code:where(.svelte-1oupzfc),.decision.svelte-1oupzfc span:where(.svelte-1oupzfc){overflow-wrap:anywhere;margin:.3rem 0 .3rem 1.5rem;display:block}textarea.svelte-1oupzfc,.answer.svelte-1oupzfc input:where(.svelte-1oupzfc),.answer.svelte-1oupzfc select:where(.svelte-1oupzfc){box-sizing:border-box;background:var(--bg);width:100%;color:inherit;font:inherit;border:1px solid;margin-top:.4rem;padding:.5rem;display:block}textarea.svelte-1oupzfc{resize:vertical;background:color-mix(in srgb, currentColor 8%, var(--bg))}button.svelte-1oupzfc{margin:.3rem .5rem .3rem 0}h3.svelte-1oupzfc,p.svelte-1oupzfc{margin-block:.4rem}.sent.svelte-1oupzfc{color:var(--accent)}.status-line.svelte-gprptn{align-items:center;gap:.5rem;min-width:0;margin-top:.5rem;display:flex}.status-line.svelte-gprptn p:where(.svelte-gprptn){white-space:nowrap;text-overflow:ellipsis;flex:1;min-width:0;margin:0;font-size:.8rem;overflow:hidden}.configure.svelte-gprptn{padding:.15rem .35rem;font-size:.75rem}.status-picker.svelte-gprptn{border:1px solid var(--edge);margin:.5rem 0;padding:.6rem}.fields.svelte-gprptn{max-height:35vh;overflow:auto}.field.svelte-gprptn{align-items:center;gap:.35rem;display:flex}.field.svelte-gprptn label:where(.svelte-gprptn){flex:1;align-items:center;gap:.4rem;display:flex}.field.svelte-gprptn label:where(.svelte-gprptn) span:where(.svelte-gprptn){font-size:.75rem}.field.svelte-gprptn button:where(.svelte-gprptn){padding:.1rem .35rem}.session-copy.svelte-543j00{justify-content:flex-end;align-items:center;gap:8px;margin-top:auto;padding-top:6px;display:flex}span.svelte-543j00{color:var(--muted);overflow-wrap:anywhere;font-size:12px}button.svelte-543j00{color:var(--accent);flex-shrink:0;padding:3px 7px}button.svelte-543j00:hover,button.flashed.svelte-543j00{color:var(--bg);background:var(--accent)}h3.svelte-1fbui7h,.window-dates.svelte-1fbui7h,.report-value.svelte-1fbui7h{color:var(--accent);font-weight:700}.quality-warning.svelte-1fbui7h,.quota-near.svelte-1fbui7h{color:var(--approval)}.quota-full.svelte-1fbui7h{color:#ff6680}.alternate.svelte-1fbui7h .report-fill:where(.svelte-1fbui7h){background:radial-gradient(circle, var(--panel) .7px, transparent .9px) 0 0 / 3px 3px, var(--accent)}.unknown.svelte-1fbui7h,.unknown.svelte-1fbui7h .report-value:where(.svelte-1fbui7h){color:var(--muted)}.unknown.svelte-1fbui7h .report-fill:where(.svelte-1fbui7h){background:var(--muted);opacity:1}.report-bars.svelte-1fbui7h{grid-template-columns:minmax(5rem,1fr) minmax(2rem,3fr) auto;gap:.6rem;display:grid}.report-row.svelte-1fbui7h,.report-head.svelte-1fbui7h{grid-column:1/-1;grid-template-columns:subgrid;align-items:center;gap:.6rem;display:grid}.report-head.svelte-1fbui7h{color:var(--muted);font-size:.85rem}.report-head.svelte-1fbui7h>span:where(.svelte-1fbui7h):last-child,.report-value.svelte-1fbui7h{text-align:right}.report-row.svelte-1fbui7h>span:where(.svelte-1fbui7h):first-child{overflow-wrap:anywhere}.report-track.svelte-1fbui7h{background:var(--panel);height:1rem}.report-fill.svelte-1fbui7h{background:var(--accent);height:100%}svg.svelte-1jpy949{fill:currentColor;width:100%;height:auto;display:block}.startup.svelte-19xbbtg{z-index:100;background:var(--bg);color:var(--accent);position:fixed;inset:0;overflow:hidden}.wordmark.svelte-19xbbtg{position:absolute}button.svelte-19xbbtg{color:var(--muted);font:inherit;white-space:nowrap;background:0 0;border:0;font-size:12px;position:absolute;bottom:24px;left:50%;transform:translate(-50%)}:root{font-synthesis:none;--lightningcss-light: ;--lightningcss-dark:initial;color-scheme:dark;background:#080e0c;font-family:Cascadia Code,SFMono-Regular,Consolas,monospace}*{box-sizing:border-box}body{margin:0}.shell{--accent:#80edac;--approval:#ffca58;--muted:#98aaa0;--edge:#31473a;--panel:#101c16;--bg:#080e0c;--ink:#e2eee5;background:var(--bg);height:100dvh;color:var(--ink);grid-template-rows:auto auto minmax(0,1fr) auto;padding:clamp(10px,1.2vw,20px);display:grid}.shell[data-theme=rust]{--approval:#ff8a3d;--accent:#ffbc75;--muted:#bfac95;--edge:#59412c;--panel:#261b14;--bg:#140e0a}.shell[data-theme=blue-steel]{--approval:#e8c46a;--accent:#85c8ff;--muted:#9cacc4;--edge:#334d69;--panel:#142235;--bg:#0b1421}.shell[data-theme=ultraviolet]{--approval:#f9a8d4;--accent:#c5adff;--muted:#b3a6c9;--edge:#4b3c68;--panel:#241a35;--bg:#140d22}.shell[data-theme=nightshade]{--approval:#8f7cff;--accent:#e59bff;--muted:#c6a7cf;--edge:#673976;--panel:#301739;--bg:#1c0b24}header,.spread,footer,.controls{flex-wrap:wrap;justify-content:space-between;align-items:center;gap:10px;display:flex}header{margin-bottom:10px}.shell[data-starting=true]>header,.shell[data-starting=true]>nav,.shell[data-starting=true]>main,.shell[data-starting=true]>footer{visibility:hidden}.brand{width:clamp(240px,32vw,405px);max-width:calc(100vw - 40px);color:var(--accent);text-decoration:none;display:block}header p{color:var(--muted);margin:3px 0 0;font-size:13px}.connection{color:var(--accent);text-align:right}small,.eyebrow{letter-spacing:.04em;font-size:12px}.connection small{color:var(--muted);margin-top:4px;display:block}.lamp{background:var(--muted);border-radius:50%;width:9px;height:9px;margin-right:9px;display:inline-block}.lamp.lit{background:var(--accent);box-shadow:0 0 8px color-mix(in srgb, var(--accent) 40%, transparent)}.working{animation:1.5s ease-in-out infinite pulse}@keyframes pulse{50%{opacity:.3}}nav{flex-wrap:wrap;gap:6px;margin-bottom:10px;display:flex}nav a,button,.button,select{font:inherit;color:var(--accent);border:1px solid var(--edge);background:var(--panel);cursor:pointer;border-radius:3px;padding:7px 11px;font-size:13px;text-decoration:none}button:hover,.button:hover,nav a:hover{border-color:var(--accent)}nav a.active,nav button.active{background:var(--accent);color:var(--bg);border-color:var(--accent)}:focus-visible{outline:2px solid var(--accent);outline-offset:4px}.secondary{margin-bottom:8px}.secondary a,.secondary button{padding:6px 10px;font-size:12px}main{scrollbar-gutter:stable;flex-direction:column;min-width:0;min-height:0;display:flex;overflow:auto}main>*{flex-shrink:0}.panel{border:1px solid var(--edge);border-top:2px solid var(--accent);background:var(--panel);border-radius:4px;min-width:0;padding:clamp(10px,1vw,16px)}h1{color:var(--accent);font-size:20px}h2{letter-spacing:.04em;color:var(--accent);overflow-wrap:anywhere;margin:0 0 10px;font-size:13px}h3{overflow-wrap:anywhere;font-size:13px}p{margin:6px 0;font-size:13px;line-height:1.45}a{color:var(--accent)}.muted,.eyebrow{color:var(--muted)}.notice{color:#ffe0aa;background:#332611;border-left:3px solid #ffc26e;padding:12px 16px}.empty{color:var(--muted);padding:35px 0}.quota-grid{flex:1 0 auto;grid-auto-rows:minmax(220px,1fr);gap:10px;display:grid}.quota-card{flex-direction:column;min-height:0;display:flex;container-type:inline-size}.quota-card>:not(.meter-graphic){flex-shrink:0}.meter-graphic{flex-direction:column;flex:1;min-height:100px;display:flex}.bar-graphic{min-height:65px}.quota-card .gauge{flex:2;height:auto;min-height:16px;margin:7px 0}.quota-card .timeline{flex:1;min-height:8px}.quota-grid.zone{grid-template-columns:repeat(auto-fit,minmax(min(100%,420px),1fr));grid-auto-rows:minmax(330px,1fr)}.quota-grid.radial{grid-template-columns:repeat(auto-fit,minmax(min(100%,300px),1fr));grid-auto-rows:minmax(260px,1fr)}.gauge{background:var(--edge);height:35px;margin:15px 0;overflow:hidden}.gauge>div{background:repeating-linear-gradient(90deg, var(--accent) 0, var(--accent) 9px, transparent 9px, transparent 12px);height:100%;transition:width .5s}.gauge.timeline{height:14px}.pie-wrap{flex:1;min-height:100px;margin:6px 0;position:relative}.pie-wrap svg{width:100%;height:100%;position:absolute;inset:0}.pie-base{fill:var(--edge);stroke:var(--accent);stroke-width:1px}.pie-fill{fill:var(--accent)}.readout{overflow-wrap:anywhere;color:var(--accent);margin:18px 0;font-size:clamp(22px,3vw,34px)}.credit+.credit{border-top:1px solid var(--edge);padding-top:20px}.credit{margin-top:24px}.session-row{grid-template-columns:minmax(210px,1.1fr) minmax(0,1.2fr) minmax(0,1.5fr);align-items:stretch;gap:14px;margin:18px 0;display:grid}.session-totals{grid-template-columns:repeat(auto-fit,minmax(min(145px,100%),1fr));gap:8px;margin:8px 0;display:grid}.session-totals>div{border:1px solid var(--edge);min-width:0;padding:10px}.session-totals dt{color:var(--muted);font-size:11px}.session-totals dd{color:var(--accent);overflow-wrap:anywhere;margin:6px 0 0;font-size:24px}.session-totals.stale dd{color:var(--muted)}.session-row.selected{outline:1px solid var(--accent);outline-offset:4px}.session-row.wide .context{grid-column:2/-1}.detail-controls{flex-wrap:wrap;gap:6px;display:flex}.attention-summary{flex-wrap:wrap;gap:8px;margin-block:8px;display:flex}.attention-summary .approval{color:var(--approval);border-color:var(--approval)}.attention-summary .approval:hover{background:color-mix(in srgb, var(--approval) 12%, var(--panel))}.attention-summary .approval:focus-visible{outline-color:var(--approval)}.attention-note,.attention-badge{color:var(--accent);border-left:3px solid;padding-left:8px}.attention-note.inferred{color:var(--muted)}.attention-badge{font-size:12px}.session-select{text-align:left;overflow-wrap:anywhere;max-width:100%}.status-detail{color:inherit;text-decoration:none}.status-detail:hover{text-decoration:underline}button:disabled{opacity:.4;cursor:default}.session-row .graph-panel{flex-direction:column;grid-column:2/-1;display:flex}.session-row.split .graph-panel{grid-column:auto}.session-row .button,.session-row button{margin-top:8px;display:inline-block}.context pre{max-height:230px;overflow:auto}.session-row .context{flex-direction:column;display:flex}pre{font:inherit;white-space:pre-wrap;overflow-wrap:anywhere;font-size:13px;line-height:1.7}.full-detail{margin-top:6px}.detail-heading{flex-wrap:wrap;justify-content:space-between;align-items:center;gap:6px 12px;display:flex}.detail-heading h2{flex:250px;min-width:0;margin:0}.detail-metadata{overflow-wrap:anywhere}.detail-workspace{border-top:1px solid var(--edge);flex-direction:column;gap:10px;margin-top:8px;padding-top:4px;display:flex}.detail-context,.detail-workspace .session-actions{min-width:0}.detail-workspace .session-actions{border-top:1px solid var(--edge);padding-top:6px}.full-detail h3{margin-block:8px}.full-detail pre{margin-block:8px;line-height:1.5}.full-detail hr{margin-block:12px}.full-detail .command,.full-detail .notice{padding:8px 10px}.command{background:var(--bg);border-left:3px solid var(--accent);padding:16px}hr{border:0;border-top:1px solid var(--edge);margin:24px 0}.chart{border-bottom:1px solid var(--muted);align-items:flex-end;gap:2px;height:clamp(120px,22vh,320px);margin-top:18px;display:flex}.chart-bar{background:var(--accent);flex:1;min-width:0;max-height:100%}.controls{justify-content:flex-start;margin:20px 0}.summary-grid{grid-template-columns:repeat(auto-fit,minmax(min(100%,220px),1fr));gap:16px;margin:20px 0;display:grid}.thresholds-panel{padding:clamp(14px,2vw,22px)}.thresholds-panel h1{margin-top:0}.threshold-list{gap:8px;margin-top:16px;display:grid}.threshold-list article{border:1px solid var(--edge);grid-template-columns:minmax(64px,.5fr) minmax(220px,3fr) minmax(64px,.6fr) minmax(120px,1.2fr);align-items:center;gap:12px;padding:10px 12px;display:grid}.threshold-list article.active{border-color:var(--accent);box-shadow:inset 3px 0 0 var(--accent)}.threshold-list article.next{border-color:var(--approval);box-shadow:inset 3px 0 0 var(--approval)}.threshold-list p{color:var(--muted);margin:3px 0 0;font-size:12px}.threshold-trigger{color:var(--accent);font-size:22px;font-weight:800}.threshold-mode,.threshold-state{color:var(--muted);font-size:12px;font-weight:700}.threshold-list article.active .threshold-state{color:var(--accent)}.threshold-list article.next .threshold-state{color:var(--approval)}.heat-scroll{overflow-x:auto}.heatmap{grid-template-rows:repeat(7,13px);grid-auto-columns:minmax(9px,1fr);grid-auto-flow:column;gap:4px;min-width:620px;margin:25px 0;display:grid}.heat-cell{background:var(--accent);border-radius:2px}.heat-cell.zero{background:var(--edge)}.table-scroll{max-height:280px;overflow:auto}table{border-collapse:collapse;width:100%;margin-top:15px}th,td{text-align:left;border-bottom:1px solid var(--edge);padding:8px}summary{cursor:pointer;color:var(--accent);padding-top:14px}footer{border-top:1px solid var(--edge);color:var(--muted);margin-top:8px;padding-top:8px;font-size:11px}footer select{padding:6px}@media (width<=850px){.session-row{grid-template-columns:minmax(0,1fr)}.session-row.wide .context,.session-row .graph-panel{grid-column:auto}.connection{text-align:left}.threshold-list article{grid-template-columns:64px minmax(0,1fr)}.threshold-mode,.threshold-state{grid-column:2}}@media (prefers-reduced-motion:reduce){*,:before,:after{transition:none!important;animation:none!important}} diff --git a/internal/web/dist/assets/index-l8TP2B-n.css b/internal/web/dist/assets/index-l8TP2B-n.css deleted file mode 100644 index c9a602c..0000000 --- a/internal/web/dist/assets/index-l8TP2B-n.css +++ /dev/null @@ -1 +0,0 @@ -.observation-details.svelte-1vgdi83{font-size:12px}summary.svelte-1vgdi83{cursor:pointer;color:var(--accent)}.observation-table.svelte-1vgdi83{max-height:240px;overflow:auto}.zone-canvas.svelte-1vgdi83{flex:1;min-height:170px;margin-top:6px;position:relative}svg.svelte-1vgdi83{width:100%;height:100%;display:block;position:absolute;inset:0}text.svelte-1vgdi83{fill:var(--ink);font:14px Cascadia Code,Consolas,monospace}.axis-title.svelte-1vgdi83{letter-spacing:.04em;font-size:12px}.grid.svelte-1vgdi83{stroke:#fff;stroke-opacity:.14;stroke-width:1px}.axes.svelte-1vgdi83{stroke:var(--ink);stroke-width:1.5px;fill:none}.pace-line.svelte-1vgdi83{stroke:#fff;stroke-width:2px;stroke-dasharray:6 4}.position-halo.svelte-1vgdi83{fill:#101820;stroke:#fff;stroke-width:1.5px}.position-dot.svelte-1vgdi83{fill:#fff}.observation-trail.svelte-1vgdi83{fill:none;stroke:#101820;stroke-width:2.5px;stroke-linejoin:round}.observation-trail-casing.svelte-1vgdi83{fill:none;stroke:#ffffff73;stroke-width:4.5px;stroke-linejoin:round}.trail-start.svelte-1vgdi83{fill:#101820;stroke:#ffffffb3;stroke-width:2px}.trend-line.svelte-1vgdi83{fill:none;stroke:var(--trend-color);stroke-width:2px;stroke-dasharray:3 6}.trend-arrow.svelte-1vgdi83{fill:var(--trend-color);stroke:#ffffff73;stroke-width:.5px}.trend-casing.svelte-1vgdi83{fill:none;stroke:#ffffff73;stroke-width:4px;stroke-dasharray:3 6}.zone-caption.svelte-1vgdi83{min-width:0;color:var(--accent);flex:auto;margin:0}.trend-summary.svelte-1vgdi83{color:var(--ink)}.zone-footer.svelte-1vgdi83{justify-content:space-between;align-items:flex-start;gap:12px;margin-top:4px;display:flex}.zone-controls.svelte-1vgdi83{color:var(--muted);text-align:right;flex-direction:column;align-items:flex-end;gap:5px;font-size:11px;display:flex}.trace-control.svelte-1vgdi83,.trend-control.svelte-1vgdi83{cursor:pointer;white-space:nowrap}.trace-control.svelte-1vgdi83 input:where(.svelte-1vgdi83){accent-color:var(--accent)}.trend-control.svelte-1vgdi83 select:where(.svelte-1vgdi83){border:1px solid var(--edge);background:var(--panel);max-width:min(230px,45vw);color:var(--ink);font:inherit}.trend-control.svelte-1vgdi83 option:where(.svelte-1vgdi83):disabled{color:var(--muted)}.zone-controls.svelte-1vgdi83 small:where(.svelte-1vgdi83){font-size:10px}@container (width<=560px){.zone-footer.svelte-1vgdi83{flex-direction:column}.zone-controls.svelte-1vgdi83{align-self:stretch;align-items:flex-end}}.slash-commands.svelte-7bfwr9{margin:.4rem 0;position:relative}.command-popup.svelte-7bfwr9{z-index:5;box-sizing:border-box;border:1px solid var(--accent);background:var(--panel);width:min(40rem,100%);padding:.35rem;position:absolute;bottom:100%;left:0;box-shadow:0 .3rem 1rem #0006}.command-popup.svelte-7bfwr9 p:where(.svelte-7bfwr9){margin:.3rem 0;font-size:.8em}.command-options.vertical.svelte-7bfwr9{flex-flow:column;gap:.15rem;display:flex}.vertical.svelte-7bfwr9 button:where(.svelte-7bfwr9){text-align:left;white-space:nowrap;width:100%;min-width:0;color:var(--muted);background:var(--panel);border-color:#0000;flex:none;align-items:baseline;gap:.4rem;display:flex}.vertical.svelte-7bfwr9 .command-name:where(.svelte-7bfwr9),.vertical.svelte-7bfwr9 .command-tail:where(.svelte-7bfwr9){flex:none}.vertical.svelte-7bfwr9 .command-name:where(.svelte-7bfwr9){text-overflow:ellipsis;max-width:100%;overflow:hidden}.vertical.svelte-7bfwr9 button.suggested:where(.svelte-7bfwr9){outline:none}.command-options.svelte-7bfwr9 button.suggested:where(.svelte-7bfwr9) .command-name:where(.svelte-7bfwr9){background:var(--accent);color:var(--bg);font-weight:700}.command-options.svelte-7bfwr9 button:where(.svelte-7bfwr9):not(.suggested):hover .command-name:where(.svelte-7bfwr9){text-decoration:underline}.command-options.svelte-7bfwr9 button:where(.svelte-7bfwr9){color:var(--muted)}.vertical.svelte-7bfwr9 .command-help:where(.svelte-7bfwr9){min-width:0;max-width:none;color:var(--muted);flex:1}.command-options.svelte-7bfwr9{flex-wrap:wrap;gap:.35rem;max-height:35vh;display:flex;overflow:auto}.command-options.svelte-7bfwr9 .suggested:where(.svelte-7bfwr9){outline:1px solid var(--accent)}.command-help.svelte-7bfwr9{text-overflow:ellipsis;white-space:nowrap;opacity:.75;max-width:32ch;font-size:.8em;display:block;overflow:hidden}pre.svelte-7bfwr9{white-space:pre-wrap;overflow-wrap:anywhere;max-height:35vh;overflow:auto}.file-diff.svelte-x4gtb6{border:1px solid var(--muted);max-height:60vh;padding:.5rem;font-family:monospace;overflow:auto}.diff-line.svelte-x4gtb6{white-space:pre;min-height:1.3em;display:flex}.line-number.svelte-x4gtb6{text-align:right;opacity:.75;-webkit-user-select:none;user-select:none;flex:0 0 5ch;padding-right:1ch;display:inline-block}.added.svelte-x4gtb6{color:#67d391;background:#67d39112}.removed.svelte-x4gtb6{color:#ff6b83;background:#ff6b8312}.heading.svelte-x4gtb6{padding:.5rem 0;font-weight:700}.saved-prompt.svelte-1oupzfc{white-space:pre-wrap;overflow-wrap:anywhere}fieldset.svelte-1oupzfc{border:1px solid;margin:.5rem 0;padding:.35rem .6rem}.decision.svelte-1oupzfc,.answer.svelte-1oupzfc{margin:.3rem 0;display:block}.decision.svelte-1oupzfc code:where(.svelte-1oupzfc),.decision.svelte-1oupzfc span:where(.svelte-1oupzfc){overflow-wrap:anywhere;margin:.3rem 0 .3rem 1.5rem;display:block}textarea.svelte-1oupzfc,.answer.svelte-1oupzfc input:where(.svelte-1oupzfc),.answer.svelte-1oupzfc select:where(.svelte-1oupzfc){box-sizing:border-box;background:var(--bg);width:100%;color:inherit;font:inherit;border:1px solid;margin-top:.4rem;padding:.5rem;display:block}textarea.svelte-1oupzfc{resize:vertical;background:color-mix(in srgb, currentColor 8%, var(--bg))}button.svelte-1oupzfc{margin:.3rem .5rem .3rem 0}h3.svelte-1oupzfc,p.svelte-1oupzfc{margin-block:.4rem}.sent.svelte-1oupzfc{color:var(--accent)}.status-line.svelte-gprptn{align-items:center;gap:.5rem;min-width:0;margin-top:.5rem;display:flex}.status-line.svelte-gprptn p:where(.svelte-gprptn){white-space:nowrap;text-overflow:ellipsis;flex:1;min-width:0;margin:0;font-size:.8rem;overflow:hidden}.configure.svelte-gprptn{padding:.15rem .35rem;font-size:.75rem}.status-picker.svelte-gprptn{border:1px solid var(--edge);margin:.5rem 0;padding:.6rem}.fields.svelte-gprptn{max-height:35vh;overflow:auto}.field.svelte-gprptn{align-items:center;gap:.35rem;display:flex}.field.svelte-gprptn label:where(.svelte-gprptn){flex:1;align-items:center;gap:.4rem;display:flex}.field.svelte-gprptn label:where(.svelte-gprptn) span:where(.svelte-gprptn){font-size:.75rem}.field.svelte-gprptn button:where(.svelte-gprptn){padding:.1rem .35rem}.session-copy.svelte-543j00{justify-content:flex-end;align-items:center;gap:8px;margin-top:auto;padding-top:6px;display:flex}span.svelte-543j00{color:var(--muted);overflow-wrap:anywhere;font-size:12px}button.svelte-543j00{color:var(--accent);flex-shrink:0;padding:3px 7px}button.svelte-543j00:hover,button.flashed.svelte-543j00{color:var(--bg);background:var(--accent)}h3.svelte-1fbui7h,.window-dates.svelte-1fbui7h,.report-value.svelte-1fbui7h{color:var(--accent);font-weight:700}.quality-warning.svelte-1fbui7h,.quota-near.svelte-1fbui7h{color:var(--approval)}.quota-full.svelte-1fbui7h{color:#ff6680}.alternate.svelte-1fbui7h .report-fill:where(.svelte-1fbui7h){background:radial-gradient(circle, var(--panel) .7px, transparent .9px) 0 0 / 3px 3px, var(--accent)}.unknown.svelte-1fbui7h,.unknown.svelte-1fbui7h .report-value:where(.svelte-1fbui7h){color:var(--muted)}.unknown.svelte-1fbui7h .report-fill:where(.svelte-1fbui7h){background:var(--muted);opacity:1}.report-bars.svelte-1fbui7h{grid-template-columns:minmax(5rem,1fr) minmax(2rem,3fr) auto;gap:.6rem;display:grid}.report-row.svelte-1fbui7h,.report-head.svelte-1fbui7h{grid-column:1/-1;grid-template-columns:subgrid;align-items:center;gap:.6rem;display:grid}.report-head.svelte-1fbui7h{color:var(--muted);font-size:.85rem}.report-head.svelte-1fbui7h>span:where(.svelte-1fbui7h):last-child,.report-value.svelte-1fbui7h{text-align:right}.report-row.svelte-1fbui7h>span:where(.svelte-1fbui7h):first-child{overflow-wrap:anywhere}.report-track.svelte-1fbui7h{background:var(--panel);height:1rem}.report-fill.svelte-1fbui7h{background:var(--accent);height:100%}svg.svelte-1jpy949{fill:currentColor;width:100%;height:auto;display:block}.startup.svelte-19xbbtg{z-index:100;background:var(--bg);color:var(--accent);position:fixed;inset:0;overflow:hidden}.wordmark.svelte-19xbbtg{position:absolute}button.svelte-19xbbtg{color:var(--muted);font:inherit;white-space:nowrap;background:0 0;border:0;font-size:12px;position:absolute;bottom:24px;left:50%;transform:translate(-50%)}:root{font-synthesis:none;--lightningcss-light: ;--lightningcss-dark:initial;color-scheme:dark;background:#080e0c;font-family:Cascadia Code,SFMono-Regular,Consolas,monospace}*{box-sizing:border-box}body{margin:0}.shell{--accent:#80edac;--approval:#ffca58;--muted:#98aaa0;--edge:#31473a;--panel:#101c16;--bg:#080e0c;--ink:#e2eee5;background:var(--bg);height:100dvh;color:var(--ink);grid-template-rows:auto auto minmax(0,1fr) auto;padding:clamp(10px,1.2vw,20px);display:grid}.shell[data-theme=rust]{--approval:#ff8a3d;--accent:#ffbc75;--muted:#bfac95;--edge:#59412c;--panel:#261b14;--bg:#140e0a}.shell[data-theme=blue-steel]{--approval:#e8c46a;--accent:#85c8ff;--muted:#9cacc4;--edge:#334d69;--panel:#142235;--bg:#0b1421}.shell[data-theme=ultraviolet]{--approval:#f9a8d4;--accent:#c5adff;--muted:#b3a6c9;--edge:#4b3c68;--panel:#241a35;--bg:#140d22}.shell[data-theme=nightshade]{--approval:#8f7cff;--accent:#e59bff;--muted:#c6a7cf;--edge:#673976;--panel:#301739;--bg:#1c0b24}header,.spread,footer,.controls{flex-wrap:wrap;justify-content:space-between;align-items:center;gap:10px;display:flex}header{margin-bottom:10px}.shell[data-starting=true]>header,.shell[data-starting=true]>nav,.shell[data-starting=true]>main,.shell[data-starting=true]>footer{visibility:hidden}.brand{width:clamp(240px,32vw,405px);max-width:calc(100vw - 40px);color:var(--accent);text-decoration:none;display:block}header p{color:var(--muted);margin:3px 0 0;font-size:13px}.connection{color:var(--accent);text-align:right}small,.eyebrow{letter-spacing:.04em;font-size:12px}.connection small{color:var(--muted);margin-top:4px;display:block}.lamp{background:var(--muted);border-radius:50%;width:9px;height:9px;margin-right:9px;display:inline-block}.lamp.lit{background:var(--accent);box-shadow:0 0 8px color-mix(in srgb, var(--accent) 40%, transparent)}.working{animation:1.5s ease-in-out infinite pulse}@keyframes pulse{50%{opacity:.3}}nav{flex-wrap:wrap;gap:6px;margin-bottom:10px;display:flex}nav a,button,.button,select{font:inherit;color:var(--accent);border:1px solid var(--edge);background:var(--panel);cursor:pointer;border-radius:3px;padding:7px 11px;font-size:13px;text-decoration:none}button:hover,.button:hover,nav a:hover{border-color:var(--accent)}nav a.active,nav button.active{background:var(--accent);color:var(--bg);border-color:var(--accent)}:focus-visible{outline:2px solid var(--accent);outline-offset:4px}.secondary{margin-bottom:8px}.secondary a,.secondary button{padding:6px 10px;font-size:12px}main{scrollbar-gutter:stable;flex-direction:column;min-width:0;min-height:0;display:flex;overflow:auto}main>*{flex-shrink:0}.panel{border:1px solid var(--edge);border-top:2px solid var(--accent);background:var(--panel);border-radius:4px;min-width:0;padding:clamp(10px,1vw,16px)}h1{color:var(--accent);font-size:20px}h2{letter-spacing:.04em;color:var(--accent);overflow-wrap:anywhere;margin:0 0 10px;font-size:13px}h3{overflow-wrap:anywhere;font-size:13px}p{margin:6px 0;font-size:13px;line-height:1.45}a{color:var(--accent)}.muted,.eyebrow{color:var(--muted)}.notice{color:#ffe0aa;background:#332611;border-left:3px solid #ffc26e;padding:12px 16px}.empty{color:var(--muted);padding:35px 0}.quota-grid{flex:1 0 auto;grid-auto-rows:minmax(220px,1fr);gap:10px;display:grid}.quota-card{flex-direction:column;min-height:0;display:flex;container-type:inline-size}.quota-card>:not(.meter-graphic){flex-shrink:0}.meter-graphic{flex-direction:column;flex:1;min-height:100px;display:flex}.bar-graphic{min-height:65px}.quota-card .gauge{flex:2;height:auto;min-height:16px;margin:7px 0}.quota-card .timeline{flex:1;min-height:8px}.quota-grid.zone{grid-template-columns:repeat(auto-fit,minmax(min(100%,420px),1fr));grid-auto-rows:minmax(330px,1fr)}.quota-grid.radial{grid-template-columns:repeat(auto-fit,minmax(min(100%,300px),1fr));grid-auto-rows:minmax(260px,1fr)}.gauge{background:var(--edge);height:35px;margin:15px 0;overflow:hidden}.gauge>div{background:repeating-linear-gradient(90deg, var(--accent) 0, var(--accent) 9px, transparent 9px, transparent 12px);height:100%;transition:width .5s}.gauge.timeline{height:14px}.pie-wrap{flex:1;min-height:100px;margin:6px 0;position:relative}.pie-wrap svg{width:100%;height:100%;position:absolute;inset:0}.pie-base{fill:var(--edge);stroke:var(--accent);stroke-width:1px}.pie-fill{fill:var(--accent)}.readout{overflow-wrap:anywhere;color:var(--accent);margin:18px 0;font-size:clamp(22px,3vw,34px)}.credit+.credit{border-top:1px solid var(--edge);padding-top:20px}.credit{margin-top:24px}.session-row{grid-template-columns:minmax(210px,1.1fr) minmax(0,1.2fr) minmax(0,1.5fr);align-items:stretch;gap:14px;margin:18px 0;display:grid}.session-totals{grid-template-columns:repeat(auto-fit,minmax(min(145px,100%),1fr));gap:8px;margin:8px 0;display:grid}.session-totals>div{border:1px solid var(--edge);min-width:0;padding:10px}.session-totals dt{color:var(--muted);font-size:11px}.session-totals dd{color:var(--accent);overflow-wrap:anywhere;margin:6px 0 0;font-size:24px}.session-totals.stale dd{color:var(--muted)}.session-row.selected{outline:1px solid var(--accent);outline-offset:4px}.session-row.wide .context{grid-column:2/-1}.detail-controls{flex-wrap:wrap;gap:6px;display:flex}.attention-summary{flex-wrap:wrap;gap:8px;margin-block:8px;display:flex}.attention-summary .approval{color:var(--approval);border-color:var(--approval)}.attention-summary .approval:hover{background:color-mix(in srgb, var(--approval) 12%, var(--panel))}.attention-summary .approval:focus-visible{outline-color:var(--approval)}.attention-note,.attention-badge{color:var(--accent);border-left:3px solid;padding-left:8px}.attention-note.inferred{color:var(--muted)}.attention-badge{font-size:12px}.session-select{text-align:left;overflow-wrap:anywhere;max-width:100%}.status-detail{color:inherit;text-decoration:none}.status-detail:hover{text-decoration:underline}button:disabled{opacity:.4;cursor:default}.session-row .graph-panel{flex-direction:column;grid-column:2/-1;display:flex}.session-row.split .graph-panel{grid-column:auto}.session-row .button,.session-row button{margin-top:8px;display:inline-block}.context pre{max-height:230px;overflow:auto}.session-row .context{flex-direction:column;display:flex}pre{font:inherit;white-space:pre-wrap;overflow-wrap:anywhere;font-size:13px;line-height:1.7}.full-detail{margin-top:6px}.detail-heading{flex-wrap:wrap;justify-content:space-between;align-items:center;gap:6px 12px;display:flex}.detail-heading h2{flex:250px;min-width:0;margin:0}.detail-metadata{overflow-wrap:anywhere}.detail-workspace{border-top:1px solid var(--edge);flex-direction:column;gap:10px;margin-top:8px;padding-top:4px;display:flex}.detail-context,.detail-workspace .session-actions{min-width:0}.detail-workspace .session-actions{border-top:1px solid var(--edge);padding-top:6px}.full-detail h3{margin-block:8px}.full-detail pre{margin-block:8px;line-height:1.5}.full-detail hr{margin-block:12px}.full-detail .command,.full-detail .notice{padding:8px 10px}.command{background:var(--bg);border-left:3px solid var(--accent);padding:16px}hr{border:0;border-top:1px solid var(--edge);margin:24px 0}.chart{border-bottom:1px solid var(--muted);align-items:flex-end;gap:2px;height:clamp(120px,22vh,320px);margin-top:18px;display:flex}.chart-bar{background:var(--accent);flex:1;min-width:0;max-height:100%}.controls{justify-content:flex-start;margin:20px 0}.summary-grid{grid-template-columns:repeat(auto-fit,minmax(min(100%,220px),1fr));gap:16px;margin:20px 0;display:grid}.thresholds-panel{padding:clamp(14px,2vw,22px)}.thresholds-panel h1{margin-top:0}.threshold-list{gap:8px;margin-top:16px;display:grid}.threshold-list article{border:1px solid var(--edge);grid-template-columns:minmax(64px,.5fr) minmax(220px,3fr) minmax(64px,.6fr) minmax(120px,1.2fr);align-items:center;gap:12px;padding:10px 12px;display:grid}.threshold-list article.active{border-color:var(--accent);box-shadow:inset 3px 0 0 var(--accent)}.threshold-list article.next{border-color:var(--approval);box-shadow:inset 3px 0 0 var(--approval)}.threshold-list p{color:var(--muted);margin:3px 0 0;font-size:12px}.threshold-trigger{color:var(--accent);font-size:22px;font-weight:800}.threshold-mode,.threshold-state{color:var(--muted);font-size:12px;font-weight:700}.threshold-list article.active .threshold-state{color:var(--accent)}.threshold-list article.next .threshold-state{color:var(--approval)}.heat-scroll{overflow-x:auto}.heatmap{grid-template-rows:repeat(7,13px);grid-auto-columns:minmax(9px,1fr);grid-auto-flow:column;gap:4px;min-width:620px;margin:25px 0;display:grid}.heat-cell{background:var(--accent);border-radius:2px}.heat-cell.zero{background:var(--edge)}.table-scroll{max-height:280px;overflow:auto}table{border-collapse:collapse;width:100%;margin-top:15px}th,td{text-align:left;border-bottom:1px solid var(--edge);padding:8px}summary{cursor:pointer;color:var(--accent);padding-top:14px}footer{border-top:1px solid var(--edge);color:var(--muted);margin-top:8px;padding-top:8px;font-size:11px}footer select{padding:6px}@media (width<=850px){.session-row{grid-template-columns:minmax(0,1fr)}.session-row.wide .context,.session-row .graph-panel{grid-column:auto}.connection{text-align:left}.threshold-list article{grid-template-columns:64px minmax(0,1fr)}.threshold-mode,.threshold-state{grid-column:2}}@media (prefers-reduced-motion:reduce){*,:before,:after{transition:none!important;animation:none!important}} diff --git a/internal/web/dist/index.html b/internal/web/dist/index.html index aeac37e..fddfcbf 100644 --- a/internal/web/dist/index.html +++ b/internal/web/dist/index.html @@ -5,8 +5,8 @@ Codexometer // Experimental web - - + +
        diff --git a/web/src/App.svelte b/web/src/App.svelte index 1cd32cd..9c32d00 100644 --- a/web/src/App.svelte +++ b/web/src/App.svelte @@ -1,5 +1,5 @@