diff --git a/README.md b/README.md index ff632c1..066a3b8 100644 --- a/README.md +++ b/README.md @@ -1119,6 +1119,17 @@ SESSION` is only an inactivity inference, fresh activity anywhere in the group suppresses a stale sibling's check; definite input and approval are never suppressed this way. +Named sessions show ` // ` in the left telemetry panel's border +title, with the directory path inside the box beneath model information when +space permits. Names come from the local +Codex session index and refresh after +renames; unnamed sessions retain their ID/directory presentation. The web Sessions +view uses the same names in selectable headings, with the directory inside the +panel; full detail also identifies the named session. Attention pills use the +same short ID and session name (directory fallback when unnamed), shortening +their labels as space tightens. Click a highlighted session status to open its +full detail and any native approval/input request; this only navigates. + Session rows prioritise the root session's latest observed model, reasoning effort and Fast setting directly below the token count, for example `gpt-6-astra medium fast`. These are observed selections from persisted turn contexts diff --git a/internal/codex/live_usage.go b/internal/codex/live_usage.go index e9202f1..b14b04c 100644 --- a/internal/codex/live_usage.go +++ b/internal/codex/live_usage.go @@ -51,6 +51,7 @@ type LiveUsageSnapshot struct { type LiveUsageSession struct { ModelSettings SessionModelSettings ID string + Name string WorkingDirectory string StartedAt time.Time TotalTokens int64 @@ -108,6 +109,8 @@ type LiveTurnTiming struct { // sessions. It also extracts bounded display-only replies and request context; // reasoning and arbitrary tool output are never retained. type LiveUsageReader struct { + sessionNames map[string]string + nameIndexInfo os.FileInfo daemonContexts map[string]SessionContext SessionsRoot string WriterLocksRoot string @@ -376,6 +379,10 @@ func (r *LiveUsageReader) fetchTokenUsage(ctx context.Context, forceFullDiscover liveWriters, writerLocksSupported := r.liveWriterThreads() sessions, activeSessions, sessionWorking := r.sessionSnapshots(now, liveWriters, writerLocksSupported, exactStatuses) + r.refreshSessionNames() + for i := range sessions { + sessions[i].Name = r.sessionNames[sessions[i].ID] + } codexStatusKnown, codexUp, codexWorking := codexRuntimeHealth( appServerUp, len(liveWriters) > 0, sessionWorking, writerLocksSupported, ) diff --git a/internal/codex/session_names.go b/internal/codex/session_names.go new file mode 100644 index 0000000..6575820 --- /dev/null +++ b/internal/codex/session_names.go @@ -0,0 +1,47 @@ +package codex + +import ( + "bufio" + "encoding/json" + "os" + "path/filepath" + "strings" +) + +// Codex's append-only name index stores renames as later entries. Metadata is +// display-only and optional: an unavailable index must not fail token polling. +// Called under the LiveUsageReader lock. +func (r *LiveUsageReader) refreshSessionNames() { + if r.SessionsRoot == "" { + return + } + file, err := os.Open(filepath.Join(filepath.Dir(r.SessionsRoot), "session_index.jsonl")) + if err != nil { + return + } + defer file.Close() + info, err := file.Stat() + if err != nil || !info.Mode().IsRegular() { + return + } + if old := r.nameIndexInfo; old != nil && os.SameFile(old, info) && old.Size() == info.Size() && old.ModTime() == info.ModTime() { + return + } + names := map[string]string{} + scanner := bufio.NewScanner(file) + scanner.Buffer(make([]byte, 4096), 1024*1024) + for scanner.Scan() { + var entry struct { + ID string `json:"id"` + Name string `json:"thread_name"` + } + if json.Unmarshal(scanner.Bytes(), &entry) != nil || entry.ID == "" { + continue + } + names[entry.ID] = strings.Join(strings.Fields(SanitizeSessionContext(entry.Name)), " ") + } + if scanner.Err() != nil { + return + } + r.sessionNames, r.nameIndexInfo = names, info +} diff --git a/internal/codex/session_names_test.go b/internal/codex/session_names_test.go new file mode 100644 index 0000000..ab01e4d --- /dev/null +++ b/internal/codex/session_names_test.go @@ -0,0 +1,32 @@ +package codex + +import ( + "os" + "path/filepath" + "testing" +) + +func TestSessionNamesFollowRenamesAndIndexReplacement(t *testing.T) { + home := t.TempDir() + r := &LiveUsageReader{SessionsRoot: filepath.Join(home, "sessions")} + path := filepath.Join(home, "session_index.jsonl") + write := func(data string) { + t.Helper() + if err := os.WriteFile(path, []byte(data), 0600); err != nil { + t.Fatal(err) + } + r.refreshSessionNames() + } + write("{\"id\":\"one\",\"thread_name\":\"First name\"}\n{\"id\":\"child\",\"thread_name\":\"Agent name\"}\n") + if r.sessionNames["one"] != "First name" { + t.Fatal(r.sessionNames) + } + write("{\"id\":\"one\",\"thread_name\":\"First name\"}\ninvalid\n{\"id\":\"one\",\"thread_name\":\"New name\\nline\"}\n") + if r.sessionNames["one"] != "New name line" { + t.Fatal(r.sessionNames) + } + write("{\"id\":\"one\",\"thread_name\":\"Final\"}\n") + if r.sessionNames["one"] != "Final" || r.sessionNames["child"] != "" { + t.Fatal(r.sessionNames) + } +} diff --git a/internal/ui/model.go b/internal/ui/model.go index 8fab125..d8249c2 100644 --- a/internal/ui/model.go +++ b/internal/ui/model.go @@ -251,6 +251,7 @@ type monitorSessionDismissal struct { } type monitorSession struct { + name string averageRate int64 modelSettings codex.SessionModelSettings preview codex.SessionContext @@ -2446,6 +2447,7 @@ func (m *Model) resumeMonitorSessions(usage codex.LiveUsageSnapshot, observedAt session.attention = update.Attention session.preview = update.Context session.modelSettings = update.ModelSettings + session.name = update.Name session.callSequence = latestModelCallSequence(update.ModelCalls) session.turnSequence = latestTurnTimingSequence(update.TurnTimings) if update.WorkingDirectory != "" { @@ -2464,8 +2466,8 @@ func (m *Model) resumeMonitorSessions(usage codex.LiveUsageSnapshot, observedAt for _, update := range updates { m.monitorSessionData = append(m.monitorSessionData, monitorSession{ id: update.ID, workingDirectory: update.WorkingDirectory, - modelSettings: update.ModelSettings, - baseline: update.TotalTokens, latest: update.TotalTokens, graphStart: update.TotalTokens, + name: update.Name, modelSettings: update.ModelSettings, + baseline: update.TotalTokens, latest: update.TotalTokens, graphStart: update.TotalTokens, startedAt: observedAt, lastActivity: update.LastActivity, agentCount: update.AgentCount, active: update.Active, working: update.Working, attention: update.Attention, preview: update.Context, displayed: update.Active, unattributed: update.Unattributed, callSequence: latestModelCallSequence(update.ModelCalls), @@ -2625,8 +2627,8 @@ func (m *Model) startMonitorSessions(usage codex.LiveUsageSnapshot, observedAt t for _, session := range usage.Sessions { m.monitorSessionData = append(m.monitorSessionData, monitorSession{ id: session.ID, workingDirectory: session.WorkingDirectory, - modelSettings: session.ModelSettings, - baseline: session.TotalTokens, latest: session.TotalTokens, graphStart: session.TotalTokens, + name: session.Name, modelSettings: session.ModelSettings, + baseline: session.TotalTokens, latest: session.TotalTokens, graphStart: session.TotalTokens, startedAt: observedAt, lastActivity: session.LastActivity, agentCount: session.AgentCount, active: session.Active, working: session.Working, attention: session.Attention, @@ -2660,8 +2662,8 @@ func (m *Model) syncMonitorSessions(usage codex.LiveUsageSnapshot, observedAt ti } created := monitorSession{ id: update.ID, workingDirectory: update.WorkingDirectory, - modelSettings: update.ModelSettings, - latest: update.TotalTokens, graphStart: 0, startedAt: startedAt, + name: update.Name, modelSettings: update.ModelSettings, + latest: update.TotalTokens, graphStart: 0, startedAt: startedAt, lastActivity: update.LastActivity, agentCount: update.AgentCount, active: update.Active, working: update.Working, attention: update.Attention, preview: update.Context, @@ -2685,6 +2687,7 @@ func (m *Model) syncMonitorSessions(usage codex.LiveUsageSnapshot, observedAt ti session.attention = update.Attention session.preview = update.Context session.modelSettings = update.ModelSettings + session.name = update.Name session.displayed = session.displayed || update.Active || update.TotalTokens > session.baseline || len(update.ModelCalls) > 0 || len(update.TurnTimings) > 0 if update.WorkingDirectory != "" { diff --git a/internal/ui/monitor.go b/internal/ui/monitor.go index 4d9f420..513f810 100644 --- a/internal/ui/monitor.go +++ b/internal/ui/monitor.go @@ -287,6 +287,9 @@ func (m Model) renderMonitorSessionMetrics(width, height int, session monitorSes if session.workingDirectory != "" { title = shortSessionID(session.id) + " // " + strings.ToUpper(filepath.Base(terminalLabel(session.workingDirectory))) } + if session.name != "" { + title = shortSessionID(session.id) + " // " + terminalLabel(session.name) + } if session.unattributed { title = "UNATTRIBUTED // INTERNAL" } @@ -333,6 +336,9 @@ func (m Model) renderMonitorSessionMetrics(width, height int, session monitorSes if badge == "" { appendLine(status) } + if session.name != "" { + appendLine(terminalLabel(session.workingDirectory)) + } appendLine(memberLabel) appendLine(formatMonitorCallActivity(session, time.Now())) if session.latestTTFTOK || session.peakTTFTOK { @@ -420,6 +426,9 @@ func (m Model) renderMonitorSessionBadge(session monitorSession, width int, colo badgeColor = paletteFor(m.theme).primary } badge := lipgloss.NewStyle().Bold(true).Foreground(colors.background).Background(badgeColor) + if m.monitorContextHover == "badge:"+session.id { + badge = badge.Underline(true) + } ball := "●" if session.attention == codex.SessionAttentionNone && m.phase%2 == 1 { ball = " " // Blink only WORKING, reserving its cell to avoid layout movement. diff --git a/internal/ui/monitor_context.go b/internal/ui/monitor_context.go index 434e4d6..3b1ae12 100644 --- a/internal/ui/monitor_context.go +++ b/internal/ui/monitor_context.go @@ -379,6 +379,10 @@ func (m Model) monitorContextAt(x, y int) string { rowY := a.topHeight + a.gap - 1 mw, rightWidth, _ := monitorSessionColumnWidths(a.width) for i, s := range sessions { + badge := m.renderMonitorSessionBadge(s, max(mw-4, 1), paletteFor(m.theme)) + if badge != "" && y == rowY+1 && x >= 2 && x < 2+lipgloss.Width(badge) && x < mw-2 { + return "badge:" + s.id + } boxX, boxWidth := mw+1, rightWidth if m.rowContextMode(s.id) == contextSplit { _, cw, gw := m.contextColumns(a.width, s) @@ -451,6 +455,11 @@ func (m Model) updateMonitorContextMouse(msg tea.MouseMsg) (Model, tea.Cmd, bool m.monitorAttentionPage, _ = strconv.Atoi(page) } else if strings.HasPrefix(m.monitorContextHover, "attention:") || strings.HasPrefix(m.monitorContextHover, "attention-profile:") { m.openMonitorAttention(m.monitorContextHover) + } else if id, ok := strings.CutPrefix(m.monitorContextHover, "badge:"); ok { + m.setRowContext(id, contextFull) + row := m.monitorContextRows[id] + row.review = "context" + m.monitorContextRows[id] = row } else if id, ok := strings.CutPrefix(m.monitorContextHover, "detail:"); ok { m.openMonitorContext(id) } else if id, ok := strings.CutPrefix(m.monitorContextHover, "less:"); ok { diff --git a/internal/ui/monitor_name_test.go b/internal/ui/monitor_name_test.go new file mode 100644 index 0000000..04c6ed4 --- /dev/null +++ b/internal/ui/monitor_name_test.go @@ -0,0 +1,100 @@ +package ui + +import ( + "strings" + "testing" + "time" + + tea "charm.land/bubbletea/v2" + "charm.land/lipgloss/v2" + "github.com/charmbracelet/x/ansi" + "github.com/merefield/codexometer/internal/codex" +) + +func TestMonitorSessionNameDisplayAndRename(t *testing.T) { + m := Model{} + u := codex.LiveUsageSnapshot{Sessions: []codex.LiveUsageSession{{ID: "root", Name: "Fix dashboard layout", WorkingDirectory: "/work/dashboard", Active: true}}} + m.startMonitorSessions(u, time.Now()) + for _, height := range []int{4, 8, 12} { + out := m.renderMonitorSessionMetrics(64, height, m.monitorSessionData[0], "", paletteFor(themeHacker)) + if !strings.Contains(ansi.Strip(out), "ROOT // Fix dashboard layout") || strings.Count(ansi.Strip(out), "Fix dashboard layout") != 1 || lipgloss.Height(out) > height || lipgloss.Width(out) > 64 { + t.Fatalf("name missing or oversized: %s", out) + } + if height >= 8 && !strings.Contains(ansi.Strip(out), "/work/dashboard") { + t.Fatal("directory missing from session body") + } + } + u.Sessions[0].Name = "Renamed session" + m.syncMonitorSessions(u, time.Now()) + if m.monitorSessionData[0].name != "Renamed session" { + t.Fatal("rename not propagated") + } +} + +func TestNamedSessionPillAndBadgeNavigation(t *testing.T) { + for _, attention := range []codex.SessionAttention{codex.SessionAttentionComplete, codex.SessionAttentionApproval, codex.SessionAttentionInput} { + m := Model{meterView: viewMonitor, width: 140, height: 40, snapshot: codex.DemoSnapshot(), monitorState: monitorRunning} + s := monitorSession{id: "session-ABCDE", name: "Fix dashboard", workingDirectory: "/work/project", displayed: true, active: true, attention: attention} + m.monitorSessionData = []monitorSession{s} + buttons, _ := m.monitorAttentionButtons(136, 1) + if len(buttons) == 0 || !strings.Contains(buttons[0].label, "ABCDE // Fix dashboard") { + t.Fatalf("pill identity differs: %+v", buttons) + } + found := false + for y := 0; y < m.height && !found; y++ { + for x := 0; x < m.width; x++ { + if m.monitorContextAt(x, y) != "badge:"+s.id { + continue + } + next, _, handled := m.updateMonitorContextMouse(tea.MouseClickMsg{X: x, Y: y, Button: tea.MouseLeft}) + if !handled || next.monitorContextDetail != s.id || next.monitorContextRows[s.id].review != "context" { + t.Fatal("badge did not open native session detail") + } + found = true + break + } + } + if !found { + t.Fatal("badge has no click surface") + } + } +} + +func TestSessionPillLiteralDotNameAndDirectoryFallback(t *testing.T) { + for _, tc := range []struct{ name, directory, suffix string }{ + {".", "/work/project", " // ."}, + {".", "", " // ."}, + {"", "", ""}, + {"", ".", ""}, + {"", "/work/project", " // project"}, + } { + m := Model{monitorState: monitorRunning, monitorSessionData: []monitorSession{{ + id: "session-ABCDE", name: tc.name, workingDirectory: tc.directory, + displayed: true, active: true, attention: codex.SessionAttentionComplete, + }}} + buttons, _ := m.monitorAttentionButtons(136, 1) + want := "[TURN COMPLETE ABCDE" + tc.suffix + "]" + if len(buttons) != 1 || buttons[0].label != want { + t.Fatalf("name=%q directory=%q: got %+v, want %q", tc.name, tc.directory, buttons, want) + } + } +} + +func TestNamedSessionDirectoryDoesNotDisplaceStatus(t *testing.T) { + for _, active := range []bool{false, true} { + s := monitorSession{id: "root", name: "Named session", workingDirectory: "/work/dashboard", active: active} + want := "IDLE" + if active { + want = "ACTIVE" + } + m := Model{} + short := ansi.Strip(m.renderMonitorSessionMetrics(64, 4, s, "", paletteFor(themeHacker))) + if !strings.Contains(short, want) || !strings.Contains(short, "TOKENS") || strings.Contains(short, s.workingDirectory) { + t.Fatalf("short row must retain tokens and %s before directory:\n%s", want, short) + } + tall := ansi.Strip(m.renderMonitorSessionMetrics(64, 8, s, "", paletteFor(themeHacker))) + if !strings.Contains(tall, want) || !strings.Contains(tall, s.workingDirectory) { + t.Fatalf("tall row should show status and directory:\n%s", tall) + } + } +} diff --git a/internal/ui/monitor_summary.go b/internal/ui/monitor_summary.go index 356718b..9f1c3fb 100644 --- a/internal/ui/monitor_summary.go +++ b/internal/ui/monitor_summary.go @@ -228,7 +228,13 @@ func (m Model) layoutMonitorAttention(sessions []monitorAttentionItem, width, ro } caption := state + " " + id name := filepath.Base(terminalLabel(s.workingDirectory)) - if compact < 2 && name != "." && name != "" { + if name == "." { + name = "" + } + if s.name != "" { + name = terminalLabel(s.name) + } + if compact < 2 && name != "" { separator := " // " if compact == 1 { separator = " " diff --git a/internal/web/dist/assets/index-11iTtNNT.js b/internal/web/dist/assets/index-S_KB1qx5.js similarity index 50% rename from internal/web/dist/assets/index-11iTtNNT.js rename to internal/web/dist/assets/index-S_KB1qx5.js index c85fa4b..45117c2 100644 --- a/internal/web/dist/assets/index-11iTtNNT.js +++ b/internal/web/dist/assets/index-S_KB1qx5.js @@ -1,5 +1,5 @@ -(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,ee=1<<20,te=1<<25,ne=65536,re=1<<21,ie=1<<22,ae=1<<23,oe=Symbol(`$state`),se=Symbol(`component`),ce=Symbol(`legacy props`),le=Symbol(``),ue=Symbol(`attributes`),de=Symbol(`class`),fe=Symbol(`style`),pe=Symbol(`text`),me=Symbol(`form reset`),he=new class extends Error{name=`StaleReactionError`;message="The reaction that called `getAbortSignal()` was re-run or destroyed"},ge=!!globalThis.document?.contentType&&globalThis.document.contentType.includes(`xml`),_e={},D=Symbol(`uninitialized`),ve=`http://www.w3.org/1999/xhtml`;function ye(){console.warn(`https://svelte.dev/e/derived_inert`)}function be(e){console.warn(`https://svelte.dev/e/hydration_mismatch`)}function xe(){console.warn(`https://svelte.dev/e/select_multiple_invalid_value`)}function Se(){console.warn(`https://svelte.dev/e/svelte_boundary_reset_noop`)}var O=!1;function Ce(e){O=e}var k;function we(e){if(e===null)throw be(),_e;return k=e}function Te(){return we(un(k))}function A(e){if(O){if(un(k)!==null)throw be(),_e;k=e}}function Ee(e=1){if(O){for(var t=e,n=k;t--;)n=un(n);k=n}}function De(e=!0){for(var t=0,n=k;;){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=un(n);e&&n.remove(),n=i}}function Oe(e){if(!e||e.nodeType!==8)throw be(),_e;return e.data}function ke(e){return e===this.v}function Ae(e,t){return e==e?e!==t||typeof e==`object`&&!!e||typeof e==`function`:t==t}function je(e){return!Ae(e,this.v)}function Me(e){throw Error(`https://svelte.dev/e/lifecycle_outside_component`)}function Ne(){throw Error(`https://svelte.dev/e/async_derived_orphan`)}function Pe(e,t,n){throw Error(`https://svelte.dev/e/each_key_duplicate`)}function Fe(e){throw Error(`https://svelte.dev/e/effect_in_teardown`)}function Ie(){throw Error(`https://svelte.dev/e/effect_in_unowned_derived`)}function Le(e){throw Error(`https://svelte.dev/e/effect_orphan`)}function Re(){throw Error(`https://svelte.dev/e/effect_update_depth_exceeded`)}function ze(e){throw Error(`https://svelte.dev/e/props_invalid_value`)}function Be(){throw Error(`https://svelte.dev/e/state_descriptors_fixed`)}function Ve(){throw Error(`https://svelte.dev/e/state_prototype_fixed`)}function He(){throw Error(`https://svelte.dev/e/state_unsafe_mutation`)}function Ue(){throw Error(`https://svelte.dev/e/svelte_boundary_reset_onerror`)}var We=!1;function Ge(){We=!0}var j=null;function Ke(e){j=e}function qe(e,t=!1,n){j={p:j,i:!1,c:null,e:null,s:e,x:null,r:U,l:We&&!t?{s:null,u:null,$:[]}:null}}function Je(e){var t=j,n=t.e;if(n!==null){t.e=null;for(var r of n)Cn(r)}return e!==void 0&&(t.x=e),t.i=!0,j=t.p,Ye(e)}function Ye(e={}){return i(e,se,{value:!0}),e}function Xe(){return!We||j!==null&&j.l===null}var Ze=[];function Qe(){var e=Ze;Ze=[],m(e)}function $e(e){if(Ze.length===0&&!kt){var t=Ze;queueMicrotask(()=>{t===Ze&&Qe()})}Ze.push(e)}function et(){for(;Ze.length>0;)Qe()}var tt=~(y|b|v);function M(e,t){e.f=e.f&tt|t}function nt(e){e.f&512||e.deps===null?M(e,v):M(e,b)}function rt(e){if(e!==null)for(let t of e)t.f&2&&t.f&65536&&(t.f^=ne,rt(t.deps))}function it(e,t,n){e.f&2048?t.add(e):e.f&4096&&n.add(e),rt(e.deps),M(e,v)}var at=!1;function ot(e){var t=at;try{return at=!1,[e(),at]}finally{at=t}}function st(e){O&&ln(e)!==null&&dn(e)}var ct=!1;function lt(){ct||(ct=!0,document.addEventListener(`reset`,e=>{Promise.resolve().then(()=>{if(!e.defaultPrevented)for(let t of e.target.elements)t[me]?.()})},{capture:!0}))}function ut(e){var t=H,n=U;qn(null),Jn(null);try{return e()}finally{qn(t),Jn(n)}}function dt(e,t,n,r=n){e.addEventListener(t,()=>ut(n));let i=e[me];e[me]=i?()=>{i(),r(!0)}:()=>r(!0),lt()}function ft(e,t,n,r){let i=Xe()?gt:yt;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=pt(),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){gn(e,s)}mt()}}var d=ht();if(n.length===0){l.then(()=>u([])).finally(d);return}function f(){Promise.all(n.map(e=>vt(e))).then(u).catch(e=>gn(e,s)).finally(d)}l?l.then(()=>{c(),f(),mt()}):f()}function pt(){var e=U,t=H,n=j,r=P;return function(i=!0){Jn(e),qn(t),Ke(n),i&&!(e.f&16384)&&(r?.activate(),r?.apply())}}function mt(e=!0){Jn(null),qn(null),Ke(null),e&&P?.deactivate()}function ht(){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 gt(e){var t=2|y;return U!==null&&(U.f|=E),{ctx:j,deps:null,effects:null,equals:ke,f:t,fn:e,reactions:null,rv:0,v:D,wv:0,parent:U,ac:null}}var _t=Symbol(`obsolete`);function vt(e,t,n){let r=U;r===null&&Ne();var i=void 0,a=Kt(D),o=!H,s=new Set;return Dn(()=>{var t=U,n=h();i=n.promise;try{Promise.resolve(e()).then(n.resolve,e=>{e!==he&&n.reject(e)}).finally(mt)}catch(e){n.reject(e),mt()}var c=P;if(o){if(t.f&32768)var l=ht();if(r.b?.is_rendered())c.async_deriveds.get(t)?.reject(_t);else for(let e of s.values())e.reject(_t);s.add(n),c.async_deriveds.set(t,n)}let u=(e,t=void 0)=>{l?.(),s.delete(n),t!==_t&&(c.activate(),t?(a.f|=ae,Jt(a,t)):(a.f&8388608&&(a.f^=ae),Jt(a,e)),c.deactivate())};n.promise.then(u,e=>u(null,e||`unknown`))}),xn(()=>{for(let e of s)e.reject(_t)}),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=gt(e);return Xn(t),t}function yt(e){let t=gt(e);return t.equals=je,t}function bt(e){var t=e.effects;if(t!==null){e.effects=null;for(var n=0;n{t.ac.abort(he),t.ac=null}),t.fn!==null&&(t.teardown=f),dr(t,0),Mn(t))}function wt(e){if(e.effects!==null)for(let t of e.effects)t.teardown&&t.fn!==null&&fr(t)}var Tt=null,P=null,Et=null,Dt=null,Ot=null,kt=!1,At=!1,jt=null,Mt=null,Nt=0,Pt=1,Ft=class e{id=Pt++;#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(){Tt===null?Tt=this:(Tt.#n=this,this.#t=Tt),Tt=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)M(r,y),t(r);for(r of n.m)M(r,b),t(r)}this.#p.add(e)}#g(){this.#e=!0,Nt++>1e3&&(this.#x(),Lt());for(let e of this.#u)this.#d.delete(e),M(e,y),this.schedule(e);for(let e of this.#d)M(e,b),this.schedule(e);let t=this.#c;this.#c=[],this.apply();var n=jt=[],r=[],i=Mt=[];for(let e of t)try{this.#_(e,n,r)}catch(t){throw Ht(e),this.#h()||this.discard(),t}if(P=null,i.length>0){var a=e.ensure();for(let e of i)a.schedule(e)}if(jt=null,Mt=null,this.#h()){this.#b(r),this.#b(n);for(let[e,t]of this.#f)Vt(e,t);i.length>0&&P.#g();return}let o=this.#v();if(o){this.#b(r),this.#b(n),o.#y(this);return}this.#u.clear(),this.#d.clear();for(let e of this.#r)e(this);this.#r.clear(),Et=this,zt(r),zt(n),Et=null,this.#s?.resolve();var s=P;if(this.#a===0&&(this.#c.length===0||s!==null)&&this.#x(),this.#c.length>0){if(s!==null){let e=s;e.#c.push(...this.#c.filter(t=>!e.#c.includes(t)))}else s=this}s!==null&&(Wt.clear(),s.#g())}#_(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):or(r)&&(i&16&&this.#d.add(r),fr(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}}}#v(){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}#y(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),M(i,y),this.schedule(i))}}};for(let e of this.current.keys())t(e);this.oncommit(()=>e.discard()),e.#x(),P=this,this.#g()}#b(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;!At&&!kt&&$e(()=>{t.#e||t.flush()})}return P}apply(){Dt=null}schedule(e){if(Ot=e,e.b?.is_pending&&e.f&16777228&&!(e.f&32768)){e.b.defer_effect(e);return}for(var t=e;t.parent!==null;){t=t.parent;var n=t.f;if(jt!==null&&t===U&&(H===null||!(H.f&2)))return;if(n&96){if(!(n&1024))return;t.f^=v}}this.#c.push(t)}#x(){if(this.linked){var e=this.#t,t=this.#n;e===null||(e.#n=t),t===null?Tt=e:t.#t=e,this.linked=!1}}};function It(e){var t=kt;kt=!0;try{var n;for(e&&(P!==null&&!P.is_fork&&P.flush(),n=e());;){if(et(),P===null)return n;P.flush()}}finally{kt=t}}function Lt(){try{Re()}catch(e){gn(e,Ot)}}var Rt=null;function zt(e){var t=e.length;if(t!==0){for(var n=0;n0)){Wt.clear();for(let e of Rt){if(e.f&24576)continue;let t=[e],n=e.parent;for(;n!==null;)Rt.has(n)&&(Rt.delete(n),t.push(n)),n=n.parent;for(let e=t.length-1;e>=0;e--){let n=t[e];n.f&24576||fr(n)}}Rt.clear()}}Rt=null}}function Bt(e){P.schedule(e)}function Vt(e,t){if(!(e.f&32&&e.f&1024)){e.f&2048?t.d.push(e):e.f&4096&&t.m.push(e),M(e,v);for(var n=e.first;n!==null;)Vt(n,t),n=n.next}}function Ht(e){M(e,v);for(var t=e.first;t!==null;)Ht(t),t=t.next}var Ut=new Set,Wt=new Map,Gt=!1;function Kt(e,t){return{f:0,v:e,reactions:null,equals:ke,rv:0,wv:0}}function F(e,t){let n=Kt(e,t);return Xn(n),n}function qt(e,t=!1,n=!0){let r=Kt(e);return t||(r.equals=je),We&&n&&j!==null&&j.l!==null&&(j.l.s??=[]).push(r),r}function I(e,t,n=!1){return H!==null&&(!Kn||H.f&131072)&&Xe()&&H.f&4325394&&(Yn===null||!Yn.has(e))&&He(),Jt(e,n?$t(t):t,Mt)}function Jt(e,t,n=null){if(!e.equals(t)){Wn?Wt.set(e,t):Wt.has(e)||Wt.set(e,e.v);var r=Ft.ensure();if(r.capture(e,t),e.f&2){let t=e;e.f&2048&&xt(t),Dt===null&&nt(t)}e.wv=ar(),Qt(e,y,n),Xe()&&U!==null&&U.f&1024&&!(U.f&96)&&($n===null?er([e]):$n.push(e)),!r.is_fork&&Ut.size>0&&!Gt&&Yt()}return t}function Yt(){Gt=!1;for(let e of Ut){e.f&1024&&M(e,b);let t;try{t=or(e)}catch{t=!0}t&&fr(e)}Ut.clear()}function Xt(e,t=1){var n=W(e),r=t===1?n++:n--;return I(e,n),r}function Zt(e){I(e,e.v+1)}function Qt(e,t,n){var r=e.reactions;if(r!==null)for(var i=Xe(),a=r.length,o=0;o{if(rr===d)return e();var t=H,n=rr;qn(null),ir(d);var r=e();return qn(t),ir(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)&&Be();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(D,u));r.set(t,e),Zt(o)}}else I(n,D),Zt(o);return!0},get(e,n,i){if(n===oe)return t;var o=r.get(n),s=n in e;if(o===void 0&&(!s||a(e,n)?.writable)&&(o=f(()=>F($t(s?e[n]:D),u)),r.set(n,o)),o!==void 0){var c=W(o);return c===D?void 0:c}return Reflect.get(e,n,i)},getOwnPropertyDescriptor(e,t){var n=Reflect.getOwnPropertyDescriptor(e,t);if(n&&`value`in n){var i=r.get(t);i&&(n.value=W(i))}else if(n===void 0){var a=r.get(t),o=a?.v;if(a!==void 0&&o!==D)return{enumerable:!0,configurable:!0,value:o,writable:!0}}return n},has(e,t){if(t===oe)return!0;var n=r.get(t),i=n!==void 0&&n.v!==D||Reflect.has(e,t);return(n!==void 0||U!==null&&(!i||a(e,t)?.writable))&&(n===void 0&&(n=f(()=>F(i?$t(e[t]):D,u)),r.set(t,n)),W(n)===D)?!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(D,u)),r.set(d+``,p)):I(p,D)}if(c===void 0)(!l||a(e,t)?.writable)&&(c=f(()=>F(void 0,u)),I(c,$t(n)),r.set(t,c));else{l=c.v!==D;var m=f(()=>$t(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)}Zt(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!==D});for(var[n,i]of r)i.v!==D&&!(n in e)&&t.push(n);return t},setPrototypeOf(){Ve()}})}function en(e){try{if(typeof e==`object`&&e&&oe in e)return e[oe]}catch{}return e}function tn(e,t){return Object.is(en(e),en(t))}var nn,rn,an,on;function sn(){if(nn===void 0){nn=window,rn=/Firefox/.test(navigator.userAgent);var e=Element.prototype,t=Node.prototype,n=Text.prototype;an=a(t,`firstChild`).get,on=a(t,`nextSibling`).get,u(e)&&(e[de]=void 0,e[ue]=null,e[fe]=void 0,e.__e=void 0),u(n)&&(n[pe]=void 0)}}function cn(e=``){return document.createTextNode(e)}function ln(e){return an.call(e)}function un(e){return on.call(e)}function L(e,t){if(!O)return ln(e);var n=ln(k);if(n===null)n=k.appendChild(cn());else if(t&&n.nodeType!==3){var r=cn();return n?.before(r),we(r),r}return t&&mn(n),we(n),n}function R(e,t=!1){if(!O){var n=ln(e);return n instanceof Comment&&n.data===``?un(n):n}if(t){if(k?.nodeType!==3){var r=cn();return k?.before(r),we(r),r}mn(k)}return k}function z(e,t=!1){if(!O)return ln(e);var n=L(e,t);return A(e),n}function B(e,t=1,n=!1){let r=O?k:e;for(var i;t--;)i=r,r=un(r);if(!O)return r;if(n){if(r?.nodeType!==3){var a=cn();return r===null?i?.after(a):r.before(a),we(a),a}mn(r)}return we(r),r}function dn(e){e.textContent=``}function fn(){return!1}function pn(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 mn(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 hn(e){var t=U;if(t===null)return H.f|=ae,e;if(!(t.f&32768)&&!(t.f&4))throw e;gn(e,t)}function gn(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 _n(e){U===null&&(H===null&&Le(e),Ie()),Wn&&Fe(e)}function vn(e,t){var n=t.last;n===null?t.last=t.first=e:(n.next=e,e.prev=n,t.last=e)}function yn(e,t){var n=U;n!==null&&n.f&8192&&(e|=x);var r={ctx:j,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)jt===null?Ft.ensure().schedule(r):jt.push(r);else if(t!==null){try{fr(r)}catch(e){throw Pn(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&&vn(i,n),H!==null&&H.f&2&&!(e&64))){var a=H;(a.effects??=[]).push(i)}return r}function bn(){return H!==null&&!Kn}function xn(e){let t=yn(8,null);return M(t,v),t.teardown=e,t}function Sn(e){_n(`$effect`);var t=U.f;if(!H&&t&32&&j!==null&&!j.i){var n=j;(n.e??=[]).push(e)}else return Cn(e)}function Cn(e){return yn(4|ee,e)}function wn(e){return _n(`$effect.pre`),yn(8|ee,e)}function Tn(e){Ft.ensure();let t=yn(64|E,e);return(e={})=>new Promise(n=>{e.outro?Ln(t,()=>{Pn(t),n(void 0)}):(Pn(t),n(void 0))})}function En(e){return yn(4,e)}function Dn(e){return yn(ie|E,e)}function On(e,t=0){return yn(8|t,e)}function V(e,t=[],n=[],r=[]){ft(r,t,n,t=>{yn(8,()=>{e(...t.map(W))})})}function kn(e,t=0){return yn(16|t,e)}function An(e){return yn(32|E,e)}function jn(e){var t=e.teardown;if(t!==null){let n=Wn,r=H;Gn(!0),qn(null);try{t.call(null)}catch(t){gn(t,e.parent)}finally{Gn(n),qn(r)}}}function Mn(e,t=!1){var n=e.first;for(e.first=e.last=null;n!==null;){let e=n.ac;e!==null&&ut(()=>{e.abort(he)});var r=n.next;n.f&64?n.parent=null:Pn(n,t),n=r}}function Nn(e){for(var t=e.first;t!==null;){var n=t.next;t.f&32||Pn(t),t=n}}function Pn(e,t=!0){var n=!1;(t||e.f&262144)&&e.nodes!==null&&e.nodes.end!==null&&(Fn(e.nodes.start,e.nodes.end),n=!0),e.f|=w,Mn(e,t&&!n),dr(e,0);var r=e.nodes&&e.nodes.t;if(r!==null)for(let e of r)e.stop();jn(e),e.f^=w,e.f|=S;var i=e.parent;i!==null&&i.first!==null&&In(e),e.next=e.prev=e.teardown=e.ctx=e.deps=e.fn=e.nodes=e.ac=e.b=null}function Fn(e,t){for(;e!==null;){var n=e===t?null:un(e);e.remove(),e=n}}function In(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 Ln(e,t,n=!0){var r=[];e.f|=256,Rn(e,r,!0);var i=()=>{n&&Pn(e),t&&t()},a=r.length;if(a>0){var o=()=>--a||i();for(var s of r)s.out(o)}else i()}function Rn(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);Rn(i,t,o?n:!1)}i=a}}}function zn(e){e.f&=-257,Bn(e,!0)}function Bn(e,t){if(!(e.f&256)&&e.f&8192){e.f^=x,e.f&1024||(M(e,y),Ft.ensure().schedule(e));for(var n=e.first;n!==null;){var r=n.next,i=!!(n.f&65536)||!!(n.f&32);Bn(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 Vn(e,t){if(e.nodes)for(var n=e.nodes.start,r=e.nodes.end;n!==null;){var i=n===r?null:un(n);t.append(n),n=i}}var Hn=null,Un=!1,Wn=!1;function Gn(e){Wn=e}var H=null,Kn=!1;function qn(e){H=e}var U=null;function Jn(e){U=e}var Yn=null;function Xn(e){H!==null&&(Yn??=new Set).add(e)}var Zn=null,Qn=0,$n=null;function er(e){$n=e}var tr=1,nr=0,rr=nr;function ir(e){rr=e}function ar(){return++tr}function or(e){var t=e.f;if(t&2048)return!0;if(t&2&&(e.f&=~ne),t&4096){for(var n=e.deps,r=n.length,i=0;ie.wv)return!0}t&512&&Dt===null&&M(e,v)}return!1}function sr(e,t,n=!0){var r=e.reactions;if(r!==null&&!(Yn!==null&&Yn.has(e)))for(var i=0;i{e.ac.abort(he)}),e.ac=null);try{e.f|=re;var u=e.fn,d=u();e.f|=C;var f=lr(e);if(Xe()&&$n!==null&&!Kn&&f!==null&&!(e.f&6146))for(var p=0;p<$n.length;p++)sr($n[p],e);if(i!==null&&i!==e){if(nr++,i.deps!==null)for(let e=0;e0)for(t.length=Qn+Zn.length,r=0;r{s.ac.abort(he),s.ac=null,M(s,y)}),Ct(s),dr(s,0)}}function dr(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`?$e(()=>{t.addEventListener(e,i,r)}):t.addEventListener(e,i,r),i}function Tr(e,t,n,r,i){var a={capture:r,passive:i},o=wr(e,t,n,a);(t===document.body||t===window||t===document||t instanceof HTMLMediaElement)&&xn(()=>{t.removeEventListener(e,o,a)})}function G(e,t,n){(t[xr]??={})[e]=n}function Er(e){for(var t=0;t{Or=!1,Dr=null}));var s=0,c=Dr===e&&e[xr];if(c){var l=a.indexOf(c);if(l!==-1&&(t===document||t===window)){e[xr]=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;qn(null),Jn(null);try{for(var p,m=[];o!==null&&o!==t;){try{var h=o[xr]?.[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[xr]=t,delete e.currentTarget,qn(d),Jn(f)}}}var Ar=globalThis?.window?.trustedTypes&&globalThis.window.trustedTypes.createPolicy(`svelte-trusted-html`,{createHTML:e=>e});function jr(e){return Ar?.createHTML(e)??e}function Mr(e){var t=pn(`template`);return t.innerHTML=jr(e.replaceAll(``,``)),t.content}function Nr(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(O)return Nr(k,null),k;i===void 0&&(i=Mr(a?e:``+e),n||(i=ln(i)));var t=r||rn?document.importNode(i,!0):i.cloneNode(!0);if(n){var o=ln(t),s=t.lastChild;Nr(o,s)}else Nr(t,t);return t}}function Pr(e,t,n=`svg`){var r=!e.startsWith(``),i=!!(t&1),a=`<${n}>${r?e:``+e}`,o;return()=>{if(O)return Nr(k,null),k;if(!o){var e=ln(Mr(a));if(i)for(o=document.createDocumentFragment();ln(e);)o.appendChild(ln(e));else o=ln(e)}var t=o.cloneNode(!0);if(i){var n=ln(t),r=t.lastChild;Nr(n,r)}else Nr(t,t);return t}}function Fr(e,t){return Pr(e,t,`svg`)}function Ir(){if(O)return Nr(k,null),k;var e=document.createDocumentFragment(),t=document.createComment(``),n=cn();return e.append(t,n),Nr(t,n),e}function q(e,t){if(O){var n=U;(!(n.f&32768)||n.nodes.end===null)&&(n.nodes.end=k),Te();return}e!==null&&e.before(t)}function Lr(){if(O&&k&&k.nodeType===8&&k.textContent?.startsWith(`$`)){let e=k.textContent.substring(1);return Te(),e}return(window.__svelte??={}).uid??=1,`c${window.__svelte.uid++}`}function Rr(e){let t=0,n=Kt(0),r;return()=>{bn()&&(W(n),On(()=>(t===0&&(r=gr(()=>e(()=>Zt(n)))),t+=1,()=>{$e(()=>{--t,t===0&&(r?.(),r=void 0,Zt(n))})})))}}var zr=T|E;function Br(e,t,n,r){new Vr(e,t,n,r)}var Vr=class{parent;is_pending=!1;transform_error;#e;#t=O?k: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=Rr(()=>(this.#m=Kt(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=kn(()=>{if(O){let e=this.#t;Te();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()},zr),O&&(this.#e=k)}#g(){try{this.#a=An(()=>this.#r(this.#e))}catch(e){this.error(e)}}#_(e){let t=this.#n.failed,{reset:n,invoke_onerror:r}=this.#v(e);$e(r),t&&(this.#s=An(()=>{t(this.#e,()=>e,()=>n)}))}#v(e){var t=!1,n=!1;let r=()=>{if(t){Se();return}t=!0,n&&Ue(),this.#s!==null&&Ln(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){gn(e,this.#i&&this.#i.parent)}}}}#y(){let e=this.#n.pending;e&&(this.is_pending=!0,this.#o=An(()=>e(this.#e)),$e(()=>{var e=this.#c=document.createDocumentFragment(),t=cn(),n=!1;if(e.append(t),this.#a=this.#S(()=>{try{return An(()=>this.#r(t))}catch(e){try{this.error(e),n=!0}catch(e){gn(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,Ln(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=An(()=>{this.#r(this.#e)}),this.#u>0){var e=this.#c=document.createDocumentFragment();Vn(this.#a,e);let t=this.#n.pending;this.#o=An(()=>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){it(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=j;Jn(this.#i),qn(this.#i),Ke(this.#i.ctx);try{return Ft.ensure(),e()}finally{Jn(t),qn(n),Ke(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&&Ln(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,$e(()=>{this.#d=!1,this.#m&&Jt(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&&=(Pn(this.#a),null),this.#o&&=(Pn(this.#o),null),this.#s&&=(Pn(this.#s),null),O&&(we(this.#t),Ee(),we(De()));let t=this.#n.failed,n=e=>{let{reset:n,invoke_onerror:r}=this.#v(e);r(),t&&(this.#s=this.#S(()=>{try{return An(()=>{var r=U;r.b=this,r.f|=128,t(this.#e,()=>e,()=>n)})}catch(e){return gn(e,this.#i.parent),null}}))};$e(()=>{var t;try{t=this.transform_error(e)}catch(e){gn(e,this.#i&&this.#i.parent);return}typeof t==`object`&&t&&typeof t.then==`function`?t.then(n,e=>gn(e,this.#i&&this.#i.parent)):n(t)})}};function J(e,t){var n=t==null?``:typeof t==`object`?`${t}`:t;n!==(e[pe]??=e.nodeValue)&&(e[pe]=n,e.nodeValue=`${n}`)}function Hr(e,t){return Wr(e,t)}var Ur=new Map;function Wr(e,{target:t,anchor:n,props:i={},events:a,context:o,intro:s=!0,transformError:c}){sn();var l=void 0,u=Tn(()=>{var s=n??t.appendChild(cn());Br(s,{pending:()=>{}},t=>{qe({});var n=j;if(o&&(n.c=o),a&&(i.$$events=a),O&&Nr(t,null),l=e(t,i)||Ye(),O&&(U.nodes.end=k,k===null||k.nodeType!==8||k.data!==`]`))throw be(),_e;Je()},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=Ur.get(n),i=r.get(e);--i==0?(n.removeEventListener(e,kr),r.delete(e),r.size===0&&Ur.delete(n)):r.set(e,i)}Cr.delete(d),s!==n&&s.parentNode?.removeChild(s)}});return Gr.set(l,u),l}var Gr=new WeakMap,Kr=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)zn(n),this.#r.delete(t);else{var r=this.#n.get(t);r&&(zn(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&&(Pn(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();Vn(r,t),t.append(cn()),this.#n.set(e,{effect:r,fragment:t})}else Pn(r);this.#r.delete(e),this.#t.delete(e)};this.#i||!n?(this.#r.add(e),Ln(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)||(Pn(n.effect),this.#n.delete(e))};ensure(e,t){var n=P,r=fn();if(t&&!this.#t.has(e)&&!this.#n.has(e)){if(r){var i=document.createDocumentFragment(),a=cn();i.append(a),this.#n.set(e,{effect:An(()=>t(a)),fragment:i})}else this.#t.set(e,An(()=>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 O&&(this.anchor=k),this.#a(n)}};function Y(e,t,n=!1){var r;O&&(r=k,Te());var i=new Kr(e),a=n?T:0;function o(e,t){if(O){var n=Oe(r);if(e!==parseInt(n.substring(1))){var a=De();we(a),i.anchor=a,Ce(!1),i.ensure(e,t),Ce(!0);return}}i.ensure(e,t)}kn(()=>{var e=!1;t((t,n=0)=>{e=!0,o(n,t)}),e||o(-1,null)},a)}var qr=Symbol(`NaN`);function Jr(e,t,n){O&&Te();var r=new Kr(e),i=!Xe();kn(()=>{var e=t();e!==e&&(e=qr),i&&typeof e==`object`&&e&&(e={}),r.ensure(e,n)})}function X(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;dn(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^=te,ti(d,null,c)):zn(d):Ln(d,()=>{d=null})))}function _(e){v.pending.delete(e)}var v={effect:kn(()=>{p=W(f);var e=p.length;let t=!1;O&&Oe(c)===`[!`!=(e===0)&&(c=De(),we(c),Ce(!1),t=!0);for(var r=new Set,u=P,v=fn(),y=0;ys(c)):(d=An(()=>s(Zr??=cn())),d.f|=te)),e>r.size&&Pe(``,``,``),O&&e>0&&we(De()),!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&&Ce(!0),W(f)}),flags:n,items:l,pending:m,outrogroups:null,fallback:d};h=!1,O&&(c=k)}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 E=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?Kt(n):qt(n,!1,!1):null,l=o&2?Kt(i):null;return{v:c,i:l,e:An(()=>(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=un(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;O&&(r=k,Te());var i=new Kr(e);kn(()=>{var e=t()??null;if(O&&Oe(r)===`[`!=(e!==null)){var a=De();we(a),i.anchor=a,Ce(!1),i.ensure(e,e&&(t=>n(t,e))),Ce(!0);return}i.ensure(e,e&&(t=>n(t,e)))},T)}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`]}),xn(()=>{t.disconnect()})}function gi(e,t,n=t){var r=new WeakSet,i=!0;dt(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)}),En(()=>{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=ge?`link`:`LINK`;function Si(e){if(O){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[me]=n,$e(n),lt()}}function Q(e,t,n,r){var i=Ci(e);O&&(i[t]=e.getAttribute(t),t===`src`||t===`srcset`||t===`href`&&e.nodeName===xi)||i[t]!==(i[t]=n)&&(t===`loading`&&(e[le]=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[ue]??={[yi]:e.nodeName.includes(`-`),[bi]:e.namespaceURI===ve}}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;dt(e,`input`,async i=>{var a=i?e.defaultValue:e.value;if(a=Ai(e)?ji(a):a,n(a),P!==null&&r.add(P),await pr(),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))}}}),(O&&e.defaultValue!==e.value||gr(t)==null&&e.value)&&(n(Ai(e)?ji(e.value):e.value),P!==null&&r.add(P)),On(()=>{var n=t();if(e===document.activeElement){var i=P;if(r.has(i))return}Ai(e)&&n===ji(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),dt(n,`change`,()=>{var e=n.__value;a&&(e=ki(o,e,n.checked)),i(e)},()=>i(a?[]:null)),On(()=>{var e=r();if(O&&n.defaultChecked!==n.checked){s=!0;return}a?(e||=[],n.checked=e.includes(n.__value)):n.checked=tn(n.__value,e)}),xn(()=>{var e=o.indexOf(n);e!==-1&&o.splice(e,1)}),Di.has(o)||(Di.add(o),$e(()=>{o.sort((e,t)=>e.compareDocumentPosition(t)===4?-1:1),Di.delete(o)})),$e(()=>{if(s){var e=a?ki(o,e,n.checked):o.find(e=>e.checked)?.__value;i(e)}})}function ki(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 Ni(e,t,n){var r=Mi.observe(e,()=>n(e[t]));En(()=>(gr(()=>n(e[t])),r))}function Pi(e,t,n,r,i){var a=()=>{r(n[e])};n.addEventListener(t,a),i?On(()=>{n[e]=i()}):a(),(n===document.body||n===window||n===document)&&xn(()=>{n.removeEventListener(t,a)})}function Fi(e=!1){let t=j,n=t.l.u;if(!n)return;let r=()=>_r(t.s);if(e){let e=0,n={},i=gt(()=>{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&&wn(()=>{Ii(t,r),m(n.b)}),Sn(()=>{let e=gr(()=>n.m.map(p));return()=>{for(let t of e)typeof t==`function`&&t()}}),n.a.length&&Sn(()=>{Ii(t,r),m(n.a)})}function Ii(e,t){if(e.l.s)for(let t of e.l.s)W(t);t()}var Li={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===oe||t===ce)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 Ri(...e){return new Proxy({props:e},Li)}function zi(e,t,n,r){var i=!We||!!(n&2),o=!!(n&8),s=!!(n&16),c=r,l=!0,u=void 0,d=()=>s&&i?(u??=gt(r),W(u)):(l&&(l=!1,c=s?gr(r):r),c);let f;if(o){var p=oe in e||ce in e;f=a(e,t)?.set??(p&&t in e?n=>e[t]=n:void 0)}var m,h=!1;o?[m,h]=ot(()=>e[t]):m=e[t],m===void 0&&r!==void 0&&(m=d(),f&&(i&&ze(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?gt:yt)(()=>(v=!1,g()));o&&W(y);var b=U;return(function(e,t){if(arguments.length>0){let n=t?W(y):i&&o?$t(e):e;return I(y,n),v=!0,c!==void 0&&(c=n),e}return Wn&&v||b.f&16384?y.v:W(y)})}function Bi(e){j===null&&Me(`onMount`),We&&j.l!==null?Vi(j).m.push(e):Sn(()=>{let t=gr(e);if(typeof t==`function`)return t})}function Vi(e){var t=e.l;return t.u??={a:[],b:[],m:[]}}typeof window<`u`&&((window.__svelte??={}).v??=new Set).add(`5`);function Hi(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 Ui=new class{#e=F(Wi());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=Wi()}):console.warn(`[svelte-spa-router] window 'window' is not defined, skipping initiation`)}};function Wi(){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}}function Gi(e){e?window.scrollTo(e.__svelte_spa_router_scrollX||0,e.__svelte_spa_router_scrollY||0):window.scrollTo(0,0)}function Ki(e,t){qe(t,!0);let n=zi(t,`routes`,19,()=>({})),r=zi(t,`prefix`,3,``),i=zi(t,`restoreScrollState`,3,!1),a=zi(t,`onConditionsFailed`,3,()=>{}),o=zi(t,`onRouteLoaded`,3,()=>{}),s=zi(t,`onRouteLoading`,3,()=>{}),c=zi(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=Hi(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;Sn(()=>{history.scrollRestoration=i()?`manual`:`auto`}),Sn(()=>{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 pr(),e(t)}Sn(()=>{let e=Ui.loc,t=!1;return gr(async()=>{let n=0;for(;n{t=!0}});function _(e){return e&&typeof e==`object`&&Object.keys(e).length?e:null}var v=Ir(),y=R(v),b=e=>{let t=N(()=>W(d));var n=Ir(),r=R(n),i=e=>{var n=Ir();ri(R(n),()=>W(t),(e,t)=>{t(e,Ri({get params(){return W(f)},get onRouteEvent(){return c()}},()=>W(p)))}),q(e,n)},a=e=>{var n=Ir();ri(R(n),()=>W(t),(e,t)=>{t(e,Ri({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),Je()}var qi=[`bars`,`pace`,`zone`,`pie`,`fuel`,`resets`,`thresholds`],Ji=`codexometer.web.preferences.v1`,Yi={tab:`quota`,view:`bars`,selected:``,defaultDetail:0,layouts:[]};function Xi(){try{let e=JSON.parse(localStorage.getItem(Ji)||`null`);return!e||typeof e!=`object`?Yi:{tab:[`quota`,`sessions`,`usage`].includes(e.tab)?e.tab:`quota`,view:qi.includes(e.view)?e.view:`bars`,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 Yi}}var Zi=$t(Xi());function Qi(){let e=JSON.stringify(Zi);try{localStorage.setItem(Ji,e)}catch{}}function $i(){return Zi.tab===`quota`?`/quota/`+Zi.view:`/`+Zi.tab}function ea(e){return Zi.layouts.find(t=>t.id===e)?.level??Zi.defaultDetail}function ta(e){Zi.defaultDetail=e,Zi.layouts=[]}function na(e,t){Zi.layouts=[...Zi.layouts.filter(t=>t.id!==e),{id:e,level:Math.max(0,Math.min(2,t))}].slice(-100)}var $=$t({data:null,connected:!1,error:``}),ra=e=>e==null?`Unavailable`:e.toLocaleString(`en-GB`),ia=e=>!e||String(e).startsWith(`0001-`)?`Not yet available`:new Date(typeof e==`number`?e*1e3:e).toLocaleString(`en-GB`),aa=`codexometer.web.session`,oa=class extends Error{},sa;async function ca(e,t,n){if(!sa||!$.connected||!$.data?.control||$.data.sessionsError)throw Error(`Session controls unavailable. Check the live connection.`);return await sa(e,t,n)}function la(){let e=new AbortController,t,n=``;sa=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 oa(`Action rejected, expired or changed. Refresh and check Codex; nothing was retried.`);return a.json()};try{n=sessionStorage.getItem(aa)||``}catch{}let r=location.hash,i=r.startsWith(`#pair=`)?r.slice(6):``;(i||!r||r===`#`)&&(history.replaceState(null,``,`/#`+$i()),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(aa,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(aa)}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(` +(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,ee=1<<20,D=1<<25,te=65536,ne=1<<21,re=1<<22,ie=1<<23,ae=Symbol(`$state`),oe=Symbol(`component`),se=Symbol(`legacy props`),ce=Symbol(``),le=Symbol(`attributes`),ue=Symbol(`class`),de=Symbol(`style`),fe=Symbol(`text`),pe=Symbol(`form reset`),me=new class extends Error{name=`StaleReactionError`;message="The reaction that called `getAbortSignal()` was re-run or destroyed"},he=!!globalThis.document?.contentType&&globalThis.document.contentType.includes(`xml`),ge={},_e=Symbol(`uninitialized`),ve=`http://www.w3.org/1999/xhtml`;function ye(){console.warn(`https://svelte.dev/e/derived_inert`)}function be(e){console.warn(`https://svelte.dev/e/hydration_mismatch`)}function xe(){console.warn(`https://svelte.dev/e/select_multiple_invalid_value`)}function Se(){console.warn(`https://svelte.dev/e/svelte_boundary_reset_noop`)}var O=!1;function Ce(e){O=e}var k;function we(e){if(e===null)throw be(),ge;return k=e}function Te(){return we(un(k))}function A(e){if(O){if(un(k)!==null)throw be(),ge;k=e}}function Ee(e=1){if(O){for(var t=e,n=k;t--;)n=un(n);k=n}}function De(e=!0){for(var t=0,n=k;;){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=un(n);e&&n.remove(),n=i}}function Oe(e){if(!e||e.nodeType!==8)throw be(),ge;return e.data}function ke(e){return e===this.v}function Ae(e,t){return e==e?e!==t||typeof e==`object`&&!!e||typeof e==`function`:t==t}function je(e){return!Ae(e,this.v)}function Me(e){throw Error(`https://svelte.dev/e/lifecycle_outside_component`)}function Ne(){throw Error(`https://svelte.dev/e/async_derived_orphan`)}function Pe(e,t,n){throw Error(`https://svelte.dev/e/each_key_duplicate`)}function Fe(e){throw Error(`https://svelte.dev/e/effect_in_teardown`)}function Ie(){throw Error(`https://svelte.dev/e/effect_in_unowned_derived`)}function Le(e){throw Error(`https://svelte.dev/e/effect_orphan`)}function Re(){throw Error(`https://svelte.dev/e/effect_update_depth_exceeded`)}function ze(e){throw Error(`https://svelte.dev/e/props_invalid_value`)}function Be(){throw Error(`https://svelte.dev/e/state_descriptors_fixed`)}function Ve(){throw Error(`https://svelte.dev/e/state_prototype_fixed`)}function He(){throw Error(`https://svelte.dev/e/state_unsafe_mutation`)}function Ue(){throw Error(`https://svelte.dev/e/svelte_boundary_reset_onerror`)}var We=!1;function Ge(){We=!0}var j=null;function Ke(e){j=e}function qe(e,t=!1,n){j={p:j,i:!1,c:null,e:null,s:e,x:null,r:U,l:We&&!t?{s:null,u:null,$:[]}:null}}function Je(e){var t=j,n=t.e;if(n!==null){t.e=null;for(var r of n)Cn(r)}return e!==void 0&&(t.x=e),t.i=!0,j=t.p,Ye(e)}function Ye(e={}){return i(e,oe,{value:!0}),e}function Xe(){return!We||j!==null&&j.l===null}var Ze=[];function Qe(){var e=Ze;Ze=[],m(e)}function $e(e){if(Ze.length===0&&!kt){var t=Ze;queueMicrotask(()=>{t===Ze&&Qe()})}Ze.push(e)}function et(){for(;Ze.length>0;)Qe()}var tt=~(y|b|v);function M(e,t){e.f=e.f&tt|t}function nt(e){e.f&512||e.deps===null?M(e,v):M(e,b)}function rt(e){if(e!==null)for(let t of e)t.f&2&&t.f&65536&&(t.f^=te,rt(t.deps))}function it(e,t,n){e.f&2048?t.add(e):e.f&4096&&n.add(e),rt(e.deps),M(e,v)}var at=!1;function ot(e){var t=at;try{return at=!1,[e(),at]}finally{at=t}}function st(e){O&&ln(e)!==null&&dn(e)}var ct=!1;function lt(){ct||(ct=!0,document.addEventListener(`reset`,e=>{Promise.resolve().then(()=>{if(!e.defaultPrevented)for(let t of e.target.elements)t[pe]?.()})},{capture:!0}))}function ut(e){var t=H,n=U;qn(null),Jn(null);try{return e()}finally{qn(t),Jn(n)}}function dt(e,t,n,r=n){e.addEventListener(t,()=>ut(n));let i=e[pe];e[pe]=i?()=>{i(),r(!0)}:()=>r(!0),lt()}function ft(e,t,n,r){let i=Xe()?gt:yt;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=pt(),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){gn(e,s)}mt()}}var d=ht();if(n.length===0){l.then(()=>u([])).finally(d);return}function f(){Promise.all(n.map(e=>vt(e))).then(u).catch(e=>gn(e,s)).finally(d)}l?l.then(()=>{c(),f(),mt()}):f()}function pt(){var e=U,t=H,n=j,r=P;return function(i=!0){Jn(e),qn(t),Ke(n),i&&!(e.f&16384)&&(r?.activate(),r?.apply())}}function mt(e=!0){Jn(null),qn(null),Ke(null),e&&P?.deactivate()}function ht(){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 gt(e){var t=2|y;return U!==null&&(U.f|=E),{ctx:j,deps:null,effects:null,equals:ke,f:t,fn:e,reactions:null,rv:0,v:_e,wv:0,parent:U,ac:null}}var _t=Symbol(`obsolete`);function vt(e,t,n){let r=U;r===null&&Ne();var i=void 0,a=Kt(_e),o=!H,s=new Set;return Dn(()=>{var t=U,n=h();i=n.promise;try{Promise.resolve(e()).then(n.resolve,e=>{e!==me&&n.reject(e)}).finally(mt)}catch(e){n.reject(e),mt()}var c=P;if(o){if(t.f&32768)var l=ht();if(r.b?.is_rendered())c.async_deriveds.get(t)?.reject(_t);else for(let e of s.values())e.reject(_t);s.add(n),c.async_deriveds.set(t,n)}let u=(e,t=void 0)=>{l?.(),s.delete(n),t!==_t&&(c.activate(),t?(a.f|=ie,Jt(a,t)):(a.f&8388608&&(a.f^=ie),Jt(a,e)),c.deactivate())};n.promise.then(u,e=>u(null,e||`unknown`))}),xn(()=>{for(let e of s)e.reject(_t)}),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=gt(e);return Xn(t),t}function yt(e){let t=gt(e);return t.equals=je,t}function bt(e){var t=e.effects;if(t!==null){e.effects=null;for(var n=0;n{t.ac.abort(me),t.ac=null}),t.fn!==null&&(t.teardown=f),dr(t,0),Mn(t))}function wt(e){if(e.effects!==null)for(let t of e.effects)t.teardown&&t.fn!==null&&fr(t)}var Tt=null,P=null,Et=null,Dt=null,Ot=null,kt=!1,At=!1,jt=null,Mt=null,Nt=0,Pt=1,Ft=class e{id=Pt++;#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(){Tt===null?Tt=this:(Tt.#n=this,this.#t=Tt),Tt=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)M(r,y),t(r);for(r of n.m)M(r,b),t(r)}this.#p.add(e)}#g(){this.#e=!0,Nt++>1e3&&(this.#x(),Lt());for(let e of this.#u)this.#d.delete(e),M(e,y),this.schedule(e);for(let e of this.#d)M(e,b),this.schedule(e);let t=this.#c;this.#c=[],this.apply();var n=jt=[],r=[],i=Mt=[];for(let e of t)try{this.#_(e,n,r)}catch(t){throw Ht(e),this.#h()||this.discard(),t}if(P=null,i.length>0){var a=e.ensure();for(let e of i)a.schedule(e)}if(jt=null,Mt=null,this.#h()){this.#b(r),this.#b(n);for(let[e,t]of this.#f)Vt(e,t);i.length>0&&P.#g();return}let o=this.#v();if(o){this.#b(r),this.#b(n),o.#y(this);return}this.#u.clear(),this.#d.clear();for(let e of this.#r)e(this);this.#r.clear(),Et=this,zt(r),zt(n),Et=null,this.#s?.resolve();var s=P;if(this.#a===0&&(this.#c.length===0||s!==null)&&this.#x(),this.#c.length>0){if(s!==null){let e=s;e.#c.push(...this.#c.filter(t=>!e.#c.includes(t)))}else s=this}s!==null&&(Wt.clear(),s.#g())}#_(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):or(r)&&(i&16&&this.#d.add(r),fr(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}}}#v(){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}#y(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),M(i,y),this.schedule(i))}}};for(let e of this.current.keys())t(e);this.oncommit(()=>e.discard()),e.#x(),P=this,this.#g()}#b(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;!At&&!kt&&$e(()=>{t.#e||t.flush()})}return P}apply(){Dt=null}schedule(e){if(Ot=e,e.b?.is_pending&&e.f&16777228&&!(e.f&32768)){e.b.defer_effect(e);return}for(var t=e;t.parent!==null;){t=t.parent;var n=t.f;if(jt!==null&&t===U&&(H===null||!(H.f&2)))return;if(n&96){if(!(n&1024))return;t.f^=v}}this.#c.push(t)}#x(){if(this.linked){var e=this.#t,t=this.#n;e===null||(e.#n=t),t===null?Tt=e:t.#t=e,this.linked=!1}}};function It(e){var t=kt;kt=!0;try{var n;for(e&&(P!==null&&!P.is_fork&&P.flush(),n=e());;){if(et(),P===null)return n;P.flush()}}finally{kt=t}}function Lt(){try{Re()}catch(e){gn(e,Ot)}}var Rt=null;function zt(e){var t=e.length;if(t!==0){for(var n=0;n0)){Wt.clear();for(let e of Rt){if(e.f&24576)continue;let t=[e],n=e.parent;for(;n!==null;)Rt.has(n)&&(Rt.delete(n),t.push(n)),n=n.parent;for(let e=t.length-1;e>=0;e--){let n=t[e];n.f&24576||fr(n)}}Rt.clear()}}Rt=null}}function Bt(e){P.schedule(e)}function Vt(e,t){if(!(e.f&32&&e.f&1024)){e.f&2048?t.d.push(e):e.f&4096&&t.m.push(e),M(e,v);for(var n=e.first;n!==null;)Vt(n,t),n=n.next}}function Ht(e){M(e,v);for(var t=e.first;t!==null;)Ht(t),t=t.next}var Ut=new Set,Wt=new Map,Gt=!1;function Kt(e,t){return{f:0,v:e,reactions:null,equals:ke,rv:0,wv:0}}function F(e,t){let n=Kt(e,t);return Xn(n),n}function qt(e,t=!1,n=!0){let r=Kt(e);return t||(r.equals=je),We&&n&&j!==null&&j.l!==null&&(j.l.s??=[]).push(r),r}function I(e,t,n=!1){return H!==null&&(!Kn||H.f&131072)&&Xe()&&H.f&4325394&&(Yn===null||!Yn.has(e))&&He(),Jt(e,n?$t(t):t,Mt)}function Jt(e,t,n=null){if(!e.equals(t)){Wn?Wt.set(e,t):Wt.has(e)||Wt.set(e,e.v);var r=Ft.ensure();if(r.capture(e,t),e.f&2){let t=e;e.f&2048&&xt(t),Dt===null&&nt(t)}e.wv=ar(),Qt(e,y,n),Xe()&&U!==null&&U.f&1024&&!(U.f&96)&&($n===null?er([e]):$n.push(e)),!r.is_fork&&Ut.size>0&&!Gt&&Yt()}return t}function Yt(){Gt=!1;for(let e of Ut){e.f&1024&&M(e,b);let t;try{t=or(e)}catch{t=!0}t&&fr(e)}Ut.clear()}function Xt(e,t=1){var n=W(e),r=t===1?n++:n--;return I(e,n),r}function Zt(e){I(e,e.v+1)}function Qt(e,t,n){var r=e.reactions;if(r!==null)for(var i=Xe(),a=r.length,o=0;o{if(rr===d)return e();var t=H,n=rr;qn(null),ir(d);var r=e();return qn(t),ir(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)&&Be();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(_e,u));r.set(t,e),Zt(o)}}else I(n,_e),Zt(o);return!0},get(e,n,i){if(n===ae)return t;var o=r.get(n),s=n in e;if(o===void 0&&(!s||a(e,n)?.writable)&&(o=f(()=>F($t(s?e[n]:_e),u)),r.set(n,o)),o!==void 0){var c=W(o);return c===_e?void 0:c}return Reflect.get(e,n,i)},getOwnPropertyDescriptor(e,t){var n=Reflect.getOwnPropertyDescriptor(e,t);if(n&&`value`in n){var i=r.get(t);i&&(n.value=W(i))}else if(n===void 0){var a=r.get(t),o=a?.v;if(a!==void 0&&o!==_e)return{enumerable:!0,configurable:!0,value:o,writable:!0}}return n},has(e,t){if(t===ae)return!0;var n=r.get(t),i=n!==void 0&&n.v!==_e||Reflect.has(e,t);return(n!==void 0||U!==null&&(!i||a(e,t)?.writable))&&(n===void 0&&(n=f(()=>F(i?$t(e[t]):_e,u)),r.set(t,n)),W(n)===_e)?!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(_e,u)),r.set(d+``,p)):I(p,_e)}if(c===void 0)(!l||a(e,t)?.writable)&&(c=f(()=>F(void 0,u)),I(c,$t(n)),r.set(t,c));else{l=c.v!==_e;var m=f(()=>$t(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)}Zt(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!==_e});for(var[n,i]of r)i.v!==_e&&!(n in e)&&t.push(n);return t},setPrototypeOf(){Ve()}})}function en(e){try{if(typeof e==`object`&&e&&ae in e)return e[ae]}catch{}return e}function tn(e,t){return Object.is(en(e),en(t))}var nn,rn,an,on;function sn(){if(nn===void 0){nn=window,rn=/Firefox/.test(navigator.userAgent);var e=Element.prototype,t=Node.prototype,n=Text.prototype;an=a(t,`firstChild`).get,on=a(t,`nextSibling`).get,u(e)&&(e[ue]=void 0,e[le]=null,e[de]=void 0,e.__e=void 0),u(n)&&(n[fe]=void 0)}}function cn(e=``){return document.createTextNode(e)}function ln(e){return an.call(e)}function un(e){return on.call(e)}function L(e,t){if(!O)return ln(e);var n=ln(k);if(n===null)n=k.appendChild(cn());else if(t&&n.nodeType!==3){var r=cn();return n?.before(r),we(r),r}return t&&mn(n),we(n),n}function R(e,t=!1){if(!O){var n=ln(e);return n instanceof Comment&&n.data===``?un(n):n}if(t){if(k?.nodeType!==3){var r=cn();return k?.before(r),we(r),r}mn(k)}return k}function z(e,t=!1){if(!O)return ln(e);var n=L(e,t);return A(e),n}function B(e,t=1,n=!1){let r=O?k:e;for(var i;t--;)i=r,r=un(r);if(!O)return r;if(n){if(r?.nodeType!==3){var a=cn();return r===null?i?.after(a):r.before(a),we(a),a}mn(r)}return we(r),r}function dn(e){e.textContent=``}function fn(){return!1}function pn(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 mn(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 hn(e){var t=U;if(t===null)return H.f|=ie,e;if(!(t.f&32768)&&!(t.f&4))throw e;gn(e,t)}function gn(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 _n(e){U===null&&(H===null&&Le(e),Ie()),Wn&&Fe(e)}function vn(e,t){var n=t.last;n===null?t.last=t.first=e:(n.next=e,e.prev=n,t.last=e)}function yn(e,t){var n=U;n!==null&&n.f&8192&&(e|=x);var r={ctx:j,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)jt===null?Ft.ensure().schedule(r):jt.push(r);else if(t!==null){try{fr(r)}catch(e){throw Pn(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&&vn(i,n),H!==null&&H.f&2&&!(e&64))){var a=H;(a.effects??=[]).push(i)}return r}function bn(){return H!==null&&!Kn}function xn(e){let t=yn(8,null);return M(t,v),t.teardown=e,t}function Sn(e){_n(`$effect`);var t=U.f;if(!H&&t&32&&j!==null&&!j.i){var n=j;(n.e??=[]).push(e)}else return Cn(e)}function Cn(e){return yn(4|ee,e)}function wn(e){return _n(`$effect.pre`),yn(8|ee,e)}function Tn(e){Ft.ensure();let t=yn(64|E,e);return(e={})=>new Promise(n=>{e.outro?Ln(t,()=>{Pn(t),n(void 0)}):(Pn(t),n(void 0))})}function En(e){return yn(4,e)}function Dn(e){return yn(re|E,e)}function On(e,t=0){return yn(8|t,e)}function V(e,t=[],n=[],r=[]){ft(r,t,n,t=>{yn(8,()=>{e(...t.map(W))})})}function kn(e,t=0){return yn(16|t,e)}function An(e){return yn(32|E,e)}function jn(e){var t=e.teardown;if(t!==null){let n=Wn,r=H;Gn(!0),qn(null);try{t.call(null)}catch(t){gn(t,e.parent)}finally{Gn(n),qn(r)}}}function Mn(e,t=!1){var n=e.first;for(e.first=e.last=null;n!==null;){let e=n.ac;e!==null&&ut(()=>{e.abort(me)});var r=n.next;n.f&64?n.parent=null:Pn(n,t),n=r}}function Nn(e){for(var t=e.first;t!==null;){var n=t.next;t.f&32||Pn(t),t=n}}function Pn(e,t=!0){var n=!1;(t||e.f&262144)&&e.nodes!==null&&e.nodes.end!==null&&(Fn(e.nodes.start,e.nodes.end),n=!0),e.f|=w,Mn(e,t&&!n),dr(e,0);var r=e.nodes&&e.nodes.t;if(r!==null)for(let e of r)e.stop();jn(e),e.f^=w,e.f|=S;var i=e.parent;i!==null&&i.first!==null&&In(e),e.next=e.prev=e.teardown=e.ctx=e.deps=e.fn=e.nodes=e.ac=e.b=null}function Fn(e,t){for(;e!==null;){var n=e===t?null:un(e);e.remove(),e=n}}function In(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 Ln(e,t,n=!0){var r=[];e.f|=256,Rn(e,r,!0);var i=()=>{n&&Pn(e),t&&t()},a=r.length;if(a>0){var o=()=>--a||i();for(var s of r)s.out(o)}else i()}function Rn(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);Rn(i,t,o?n:!1)}i=a}}}function zn(e){e.f&=-257,Bn(e,!0)}function Bn(e,t){if(!(e.f&256)&&e.f&8192){e.f^=x,e.f&1024||(M(e,y),Ft.ensure().schedule(e));for(var n=e.first;n!==null;){var r=n.next,i=!!(n.f&65536)||!!(n.f&32);Bn(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 Vn(e,t){if(e.nodes)for(var n=e.nodes.start,r=e.nodes.end;n!==null;){var i=n===r?null:un(n);t.append(n),n=i}}var Hn=null,Un=!1,Wn=!1;function Gn(e){Wn=e}var H=null,Kn=!1;function qn(e){H=e}var U=null;function Jn(e){U=e}var Yn=null;function Xn(e){H!==null&&(Yn??=new Set).add(e)}var Zn=null,Qn=0,$n=null;function er(e){$n=e}var tr=1,nr=0,rr=nr;function ir(e){rr=e}function ar(){return++tr}function or(e){var t=e.f;if(t&2048)return!0;if(t&2&&(e.f&=~te),t&4096){for(var n=e.deps,r=n.length,i=0;ie.wv)return!0}t&512&&Dt===null&&M(e,v)}return!1}function sr(e,t,n=!0){var r=e.reactions;if(r!==null&&!(Yn!==null&&Yn.has(e)))for(var i=0;i{e.ac.abort(me)}),e.ac=null);try{e.f|=ne;var u=e.fn,d=u();e.f|=C;var f=lr(e);if(Xe()&&$n!==null&&!Kn&&f!==null&&!(e.f&6146))for(var p=0;p<$n.length;p++)sr($n[p],e);if(i!==null&&i!==e){if(nr++,i.deps!==null)for(let e=0;e0)for(t.length=Qn+Zn.length,r=0;r{s.ac.abort(me),s.ac=null,M(s,y)}),Ct(s),dr(s,0)}}function dr(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`?$e(()=>{t.addEventListener(e,i,r)}):t.addEventListener(e,i,r),i}function Tr(e,t,n,r,i){var a={capture:r,passive:i},o=wr(e,t,n,a);(t===document.body||t===window||t===document||t instanceof HTMLMediaElement)&&xn(()=>{t.removeEventListener(e,o,a)})}function G(e,t,n){(t[xr]??={})[e]=n}function Er(e){for(var t=0;t{Or=!1,Dr=null}));var s=0,c=Dr===e&&e[xr];if(c){var l=a.indexOf(c);if(l!==-1&&(t===document||t===window)){e[xr]=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;qn(null),Jn(null);try{for(var p,m=[];o!==null&&o!==t;){try{var h=o[xr]?.[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[xr]=t,delete e.currentTarget,qn(d),Jn(f)}}}var Ar=globalThis?.window?.trustedTypes&&globalThis.window.trustedTypes.createPolicy(`svelte-trusted-html`,{createHTML:e=>e});function jr(e){return Ar?.createHTML(e)??e}function Mr(e){var t=pn(`template`);return t.innerHTML=jr(e.replaceAll(``,``)),t.content}function Nr(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(O)return Nr(k,null),k;i===void 0&&(i=Mr(a?e:``+e),n||(i=ln(i)));var t=r||rn?document.importNode(i,!0):i.cloneNode(!0);if(n){var o=ln(t),s=t.lastChild;Nr(o,s)}else Nr(t,t);return t}}function Pr(e,t,n=`svg`){var r=!e.startsWith(``),i=!!(t&1),a=`<${n}>${r?e:``+e}`,o;return()=>{if(O)return Nr(k,null),k;if(!o){var e=ln(Mr(a));if(i)for(o=document.createDocumentFragment();ln(e);)o.appendChild(ln(e));else o=ln(e)}var t=o.cloneNode(!0);if(i){var n=ln(t),r=t.lastChild;Nr(n,r)}else Nr(t,t);return t}}function Fr(e,t){return Pr(e,t,`svg`)}function Ir(){if(O)return Nr(k,null),k;var e=document.createDocumentFragment(),t=document.createComment(``),n=cn();return e.append(t,n),Nr(t,n),e}function q(e,t){if(O){var n=U;(!(n.f&32768)||n.nodes.end===null)&&(n.nodes.end=k),Te();return}e!==null&&e.before(t)}function Lr(){if(O&&k&&k.nodeType===8&&k.textContent?.startsWith(`$`)){let e=k.textContent.substring(1);return Te(),e}return(window.__svelte??={}).uid??=1,`c${window.__svelte.uid++}`}function Rr(e){let t=0,n=Kt(0),r;return()=>{bn()&&(W(n),On(()=>(t===0&&(r=gr(()=>e(()=>Zt(n)))),t+=1,()=>{$e(()=>{--t,t===0&&(r?.(),r=void 0,Zt(n))})})))}}var zr=T|E;function Br(e,t,n,r){new Vr(e,t,n,r)}var Vr=class{parent;is_pending=!1;transform_error;#e;#t=O?k: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=Rr(()=>(this.#m=Kt(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=kn(()=>{if(O){let e=this.#t;Te();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()},zr),O&&(this.#e=k)}#g(){try{this.#a=An(()=>this.#r(this.#e))}catch(e){this.error(e)}}#_(e){let t=this.#n.failed,{reset:n,invoke_onerror:r}=this.#v(e);$e(r),t&&(this.#s=An(()=>{t(this.#e,()=>e,()=>n)}))}#v(e){var t=!1,n=!1;let r=()=>{if(t){Se();return}t=!0,n&&Ue(),this.#s!==null&&Ln(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){gn(e,this.#i&&this.#i.parent)}}}}#y(){let e=this.#n.pending;e&&(this.is_pending=!0,this.#o=An(()=>e(this.#e)),$e(()=>{var e=this.#c=document.createDocumentFragment(),t=cn(),n=!1;if(e.append(t),this.#a=this.#S(()=>{try{return An(()=>this.#r(t))}catch(e){try{this.error(e),n=!0}catch(e){gn(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,Ln(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=An(()=>{this.#r(this.#e)}),this.#u>0){var e=this.#c=document.createDocumentFragment();Vn(this.#a,e);let t=this.#n.pending;this.#o=An(()=>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){it(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=j;Jn(this.#i),qn(this.#i),Ke(this.#i.ctx);try{return Ft.ensure(),e()}finally{Jn(t),qn(n),Ke(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&&Ln(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,$e(()=>{this.#d=!1,this.#m&&Jt(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&&=(Pn(this.#a),null),this.#o&&=(Pn(this.#o),null),this.#s&&=(Pn(this.#s),null),O&&(we(this.#t),Ee(),we(De()));let t=this.#n.failed,n=e=>{let{reset:n,invoke_onerror:r}=this.#v(e);r(),t&&(this.#s=this.#S(()=>{try{return An(()=>{var r=U;r.b=this,r.f|=128,t(this.#e,()=>e,()=>n)})}catch(e){return gn(e,this.#i.parent),null}}))};$e(()=>{var t;try{t=this.transform_error(e)}catch(e){gn(e,this.#i&&this.#i.parent);return}typeof t==`object`&&t&&typeof t.then==`function`?t.then(n,e=>gn(e,this.#i&&this.#i.parent)):n(t)})}};function J(e,t){var n=t==null?``:typeof t==`object`?`${t}`:t;n!==(e[fe]??=e.nodeValue)&&(e[fe]=n,e.nodeValue=`${n}`)}function Hr(e,t){return Wr(e,t)}var Ur=new Map;function Wr(e,{target:t,anchor:n,props:i={},events:a,context:o,intro:s=!0,transformError:c}){sn();var l=void 0,u=Tn(()=>{var s=n??t.appendChild(cn());Br(s,{pending:()=>{}},t=>{qe({});var n=j;if(o&&(n.c=o),a&&(i.$$events=a),O&&Nr(t,null),l=e(t,i)||Ye(),O&&(U.nodes.end=k,k===null||k.nodeType!==8||k.data!==`]`))throw be(),ge;Je()},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=Ur.get(n),i=r.get(e);--i==0?(n.removeEventListener(e,kr),r.delete(e),r.size===0&&Ur.delete(n)):r.set(e,i)}Cr.delete(d),s!==n&&s.parentNode?.removeChild(s)}});return Gr.set(l,u),l}var Gr=new WeakMap,Kr=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)zn(n),this.#r.delete(t);else{var r=this.#n.get(t);r&&(zn(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&&(Pn(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();Vn(r,t),t.append(cn()),this.#n.set(e,{effect:r,fragment:t})}else Pn(r);this.#r.delete(e),this.#t.delete(e)};this.#i||!n?(this.#r.add(e),Ln(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)||(Pn(n.effect),this.#n.delete(e))};ensure(e,t){var n=P,r=fn();if(t&&!this.#t.has(e)&&!this.#n.has(e)){if(r){var i=document.createDocumentFragment(),a=cn();i.append(a),this.#n.set(e,{effect:An(()=>t(a)),fragment:i})}else this.#t.set(e,An(()=>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 O&&(this.anchor=k),this.#a(n)}};function Y(e,t,n=!1){var r;O&&(r=k,Te());var i=new Kr(e),a=n?T:0;function o(e,t){if(O){var n=Oe(r);if(e!==parseInt(n.substring(1))){var a=De();we(a),i.anchor=a,Ce(!1),i.ensure(e,t),Ce(!0);return}}i.ensure(e,t)}kn(()=>{var e=!1;t((t,n=0)=>{e=!0,o(n,t)}),e||o(-1,null)},a)}var qr=Symbol(`NaN`);function Jr(e,t,n){O&&Te();var r=new Kr(e),i=!Xe();kn(()=>{var e=t();e!==e&&(e=qr),i&&typeof e==`object`&&e&&(e={}),r.ensure(e,n)})}function X(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;dn(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^=D,ti(d,null,c)):zn(d):Ln(d,()=>{d=null})))}function _(e){v.pending.delete(e)}var v={effect:kn(()=>{p=W(f);var e=p.length;let t=!1;O&&Oe(c)===`[!`!=(e===0)&&(c=De(),we(c),Ce(!1),t=!0);for(var r=new Set,u=P,v=fn(),y=0;ys(c)):(d=An(()=>s(Zr??=cn())),d.f|=D)),e>r.size&&Pe(``,``,``),O&&e>0&&we(De()),!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&&Ce(!0),W(f)}),flags:n,items:l,pending:m,outrogroups:null,fallback:d};h=!1,O&&(c=k)}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 E=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?Kt(n):qt(n,!1,!1):null,l=o&2?Kt(i):null;return{v:c,i:l,e:An(()=>(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=un(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;O&&(r=k,Te());var i=new Kr(e);kn(()=>{var e=t()??null;if(O&&Oe(r)===`[`!=(e!==null)){var a=De();we(a),i.anchor=a,Ce(!1),i.ensure(e,e&&(t=>n(t,e))),Ce(!0);return}i.ensure(e,e&&(t=>n(t,e)))},T)}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`]}),xn(()=>{t.disconnect()})}function gi(e,t,n=t){var r=new WeakSet,i=!0;dt(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)}),En(()=>{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=he?`link`:`LINK`;function Si(e){if(O){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[pe]=n,$e(n),lt()}}function Q(e,t,n,r){var i=Ci(e);O&&(i[t]=e.getAttribute(t),t===`src`||t===`srcset`||t===`href`&&e.nodeName===xi)||i[t]!==(i[t]=n)&&(t===`loading`&&(e[ce]=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[le]??={[yi]:e.nodeName.includes(`-`),[bi]:e.namespaceURI===ve}}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;dt(e,`input`,async i=>{var a=i?e.defaultValue:e.value;if(a=Ai(e)?ji(a):a,n(a),P!==null&&r.add(P),await pr(),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))}}}),(O&&e.defaultValue!==e.value||gr(t)==null&&e.value)&&(n(Ai(e)?ji(e.value):e.value),P!==null&&r.add(P)),On(()=>{var n=t();if(e===document.activeElement){var i=P;if(r.has(i))return}Ai(e)&&n===ji(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),dt(n,`change`,()=>{var e=n.__value;a&&(e=ki(o,e,n.checked)),i(e)},()=>i(a?[]:null)),On(()=>{var e=r();if(O&&n.defaultChecked!==n.checked){s=!0;return}a?(e||=[],n.checked=e.includes(n.__value)):n.checked=tn(n.__value,e)}),xn(()=>{var e=o.indexOf(n);e!==-1&&o.splice(e,1)}),Di.has(o)||(Di.add(o),$e(()=>{o.sort((e,t)=>e.compareDocumentPosition(t)===4?-1:1),Di.delete(o)})),$e(()=>{if(s){var e=a?ki(o,e,n.checked):o.find(e=>e.checked)?.__value;i(e)}})}function ki(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 Ni(e,t,n){var r=Mi.observe(e,()=>n(e[t]));En(()=>(gr(()=>n(e[t])),r))}function Pi(e,t,n,r,i){var a=()=>{r(n[e])};n.addEventListener(t,a),i?On(()=>{n[e]=i()}):a(),(n===document.body||n===window||n===document)&&xn(()=>{n.removeEventListener(t,a)})}function Fi(e=!1){let t=j,n=t.l.u;if(!n)return;let r=()=>_r(t.s);if(e){let e=0,n={},i=gt(()=>{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&&wn(()=>{Ii(t,r),m(n.b)}),Sn(()=>{let e=gr(()=>n.m.map(p));return()=>{for(let t of e)typeof t==`function`&&t()}}),n.a.length&&Sn(()=>{Ii(t,r),m(n.a)})}function Ii(e,t){if(e.l.s)for(let t of e.l.s)W(t);t()}var Li={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===ae||t===se)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 Ri(...e){return new Proxy({props:e},Li)}function zi(e,t,n,r){var i=!We||!!(n&2),o=!!(n&8),s=!!(n&16),c=r,l=!0,u=void 0,d=()=>s&&i?(u??=gt(r),W(u)):(l&&(l=!1,c=s?gr(r):r),c);let f;if(o){var p=ae in e||se in e;f=a(e,t)?.set??(p&&t in e?n=>e[t]=n:void 0)}var m,h=!1;o?[m,h]=ot(()=>e[t]):m=e[t],m===void 0&&r!==void 0&&(m=d(),f&&(i&&ze(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?gt:yt)(()=>(v=!1,g()));o&&W(y);var b=U;return(function(e,t){if(arguments.length>0){let n=t?W(y):i&&o?$t(e):e;return I(y,n),v=!0,c!==void 0&&(c=n),e}return Wn&&v||b.f&16384?y.v:W(y)})}function Bi(e){j===null&&Me(`onMount`),We&&j.l!==null?Vi(j).m.push(e):Sn(()=>{let t=gr(e);if(typeof t==`function`)return t})}function Vi(e){var t=e.l;return t.u??={a:[],b:[],m:[]}}typeof window<`u`&&((window.__svelte??={}).v??=new Set).add(`5`);function Hi(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 Ui=new class{#e=F(Wi());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=Wi()}):console.warn(`[svelte-spa-router] window 'window' is not defined, skipping initiation`)}};function Wi(){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}}function Gi(e){e?window.scrollTo(e.__svelte_spa_router_scrollX||0,e.__svelte_spa_router_scrollY||0):window.scrollTo(0,0)}function Ki(e,t){qe(t,!0);let n=zi(t,`routes`,19,()=>({})),r=zi(t,`prefix`,3,``),i=zi(t,`restoreScrollState`,3,!1),a=zi(t,`onConditionsFailed`,3,()=>{}),o=zi(t,`onRouteLoaded`,3,()=>{}),s=zi(t,`onRouteLoading`,3,()=>{}),c=zi(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=Hi(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;Sn(()=>{history.scrollRestoration=i()?`manual`:`auto`}),Sn(()=>{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 pr(),e(t)}Sn(()=>{let e=Ui.loc,t=!1;return gr(async()=>{let n=0;for(;n{t=!0}});function _(e){return e&&typeof e==`object`&&Object.keys(e).length?e:null}var v=Ir(),y=R(v),b=e=>{let t=N(()=>W(d));var n=Ir(),r=R(n),i=e=>{var n=Ir();ri(R(n),()=>W(t),(e,t)=>{t(e,Ri({get params(){return W(f)},get onRouteEvent(){return c()}},()=>W(p)))}),q(e,n)},a=e=>{var n=Ir();ri(R(n),()=>W(t),(e,t)=>{t(e,Ri({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),Je()}var qi=[`bars`,`pace`,`zone`,`pie`,`fuel`,`resets`,`thresholds`],Ji=`codexometer.web.preferences.v1`,Yi={tab:`quota`,view:`bars`,selected:``,defaultDetail:0,layouts:[]};function Xi(){try{let e=JSON.parse(localStorage.getItem(Ji)||`null`);return!e||typeof e!=`object`?Yi:{tab:[`quota`,`sessions`,`usage`].includes(e.tab)?e.tab:`quota`,view:qi.includes(e.view)?e.view:`bars`,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 Yi}}var Zi=$t(Xi());function Qi(){let e=JSON.stringify(Zi);try{localStorage.setItem(Ji,e)}catch{}}function $i(){return Zi.tab===`quota`?`/quota/`+Zi.view:`/`+Zi.tab}function ea(e){return Zi.layouts.find(t=>t.id===e)?.level??Zi.defaultDetail}function ta(e){Zi.defaultDetail=e,Zi.layouts=[]}function na(e,t){Zi.layouts=[...Zi.layouts.filter(t=>t.id!==e),{id:e,level:Math.max(0,Math.min(2,t))}].slice(-100)}var $=$t({data:null,connected:!1,error:``}),ra=e=>e==null?`Unavailable`:e.toLocaleString(`en-GB`),ia=e=>!e||String(e).startsWith(`0001-`)?`Not yet available`:new Date(typeof e==`number`?e*1e3:e).toLocaleString(`en-GB`),aa=`codexometer.web.session`,oa=class extends Error{},sa;async function ca(e,t,n){if(!sa||!$.connected||!$.data?.control||$.data.sessionsError)throw Error(`Session controls unavailable. Check the live connection.`);return await sa(e,t,n)}function la(){let e=new AbortController,t,n=``;sa=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 oa(`Action rejected, expired or changed. Refresh and check Codex; nothing was retried.`);return a.json()};try{n=sessionStorage.getItem(aa)||``}catch{}let r=location.hash,i=r.startsWith(`#pair=`)?r.slice(6):``;(i||!r||r===`#`)&&(history.replaceState(null,``,`/#`+$i()),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(aa,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(aa)}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(),()=>{sa=void 0,e.abort(),clearTimeout(t),$.connected=!1}}Ge();var ua=K(`

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

`),da=K(`

`),fa=K(`

The longest Codex quota window selects one active model profile. ASK @@ -7,24 +7,25 @@ eligible check.

`,1),pa=K(`

No threshold-based model steps were configured at launch.

`);function ma(e,t){qe(t,!1),Fi();var n=Ir(),r=R(n),i=e=>{var t=fa(),n=R(t),r=z(n),i=B(n,2),a=e=>{q(e,ua())};Y(i,e=>{$.data.quotaError&&e(a)});var o=B(i,2),s=L(o),c=z(s),l=B(s,4);Z(l,5,()=>$.data.thresholds,X,(e,t)=>{var n=da();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));A(o);var u=B(o,2),d=z(u,!0),f=z(B(u,2));A(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)}),A(l),A(o),V(e=>{J(r,`MODEL STEP POLICY // OBSERVED ${e??``}`),J(c,`THRESHOLDS // ${$.data.thresholds.length??``} CONFIGURED`)},[()=>ia($.data.quotaAt)]),q(e,t)},a=e=>{q(e,pa())};Y(r,e=>{$.data?.thresholds?.length?e(i):e(a,-1)}),q(e,n),Je()}var ha=Fr(` `,1),ga=Fr(` `,1),_a=K(` `),va=K(`
Quota observations
Observed atPeriod elapsedConsumedTrail segment
`),ya=K(`


Observed quota path, not individual session usage. Gaps are not interpolated. Expand the - observation table for times, positions and gaps.

OBSERVATION TABLE
`,1),ba=K(`
CONSUMPTIONQUOTA PERIOD ELAPSED


`,1);function xa(e,t){let n=Lr();qe(t,!0);let r=zi(t,`trail`,19,()=>[]),i=F(!1),a=[0,25,50,75,100],o=F(400),s=F(240),c=N(()=>W(o)-24),l=N(()=>W(s)-48),u=N(()=>Math.max(1,W(c)-48)),d=N(()=>Math.max(1,W(l)-20)),f=N(()=>48+Math.max(0,Math.min(100,t.elapsed))/100*W(u)),p=N(()=>W(l)-Math.max(0,Math.min(100,t.used))/100*W(d)),m=N(()=>t.used-t.elapsed),h=N(()=>r().map((e,t)=>`${t===0||e.break?`M`:`L`}${48+e.elapsed/100*W(u)} ${W(l)-e.used/100*W(d)}`).join(` `));var g=ba(),_=R(g),v=L(_),y=L(v),b=z(y),x=B(y),S=B(x);Z(S,17,()=>a,X,(e,t)=>{var n=ha(),r=R(n),i=B(r),a=B(i),o=z(a),s=B(a),f=z(s);V(()=>{Q(r,`x1`,48+W(t)/100*W(u)),Q(r,`x2`,48+W(t)/100*W(u)),Q(r,`y2`,W(l)),Q(i,`y1`,W(l)-W(t)/100*W(d)),Q(i,`x2`,W(c)),Q(i,`y2`,W(l)-W(t)/100*W(d)),Q(a,`x`,48+W(t)/100*W(u)),Q(a,`y`,W(l)+20),J(o,`${W(t)??``}%`),Q(s,`y`,W(l)+4-W(t)/100*W(d)),J(f,`${W(t)??``}%`)}),q(e,n)});var C=B(S),w=B(C),T=B(w),E=e=>{var t=ga(),n=R(t),i=B(n),a=z(L(i));A(i),V(e=>{Q(n,`d`,W(h)),Q(i,`cx`,48+r()[0].elapsed/100*W(u)),Q(i,`cy`,W(l)-r()[0].used/100*W(d)),J(a,`First observation: ${e??``}`)},[()=>ia(r()[0].at)]),q(e,t)};Y(T,e=>{r().length&&e(E)});var ee=B(T,2),te=B(ee),ne=B(te),re=z(L(ne));A(ne),A(v),A(_);var ie=B(_,2),ae=L(ie),oe=z(B(ae,3),!0);A(ie);var se=B(ie,2),ce=e=>{var t=ya(),a=R(t),o=L(a);Ee(2),A(a);var s=B(a,2),c=B(L(s),2),l=e=>{var t=va(),n=L(t),i=B(L(n),2);Z(i,21,r,X,(e,t,n)=>{var r=_a(),i=L(r),a=L(i),o=z(a,!0);A(i);var s=B(i),c=z(s),l=B(s),u=z(l),d=z(B(l),!0);A(r),V((e,r)=>{Q(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`)},[()=>ia(W(t).at),()=>W(t).elapsed.toFixed(1)]),q(e,r)}),A(i),A(n),A(t),q(e,t)};Y(c,e=>{W(i)&&e(l)}),A(s),V(e=>{Q(a,`id`,n+`-trail-summary`),J(o,`○ START ${e??``} // ${r().length??``} - ${r().length===1?`OBSERVATION`:`OBSERVATIONS`}`)},[()=>ia(r()[0].at)]),Pi(`open`,`toggle`,s,e=>I(i,e),()=>W(i)),q(e,t)};Y(se,e=>{r().length&&e(ce)}),V((e,i,a,m)=>{Q(v,`viewBox`,`0 0 ${W(o)} ${W(s)}`),Q(v,`aria-describedby`,r().length?n+`-trail-summary`:void 0),Q(v,`aria-label`,e),Q(b,`id`,n),Q(x,`width`,W(u)),Q(x,`height`,W(d)),Q(x,`fill`,`url(#${n})`),Q(C,`d`,`M48 20 V${W(l)} H${W(c)}`),Q(w,`y1`,W(l)),Q(w,`x2`,W(c)),Q(ee,`x`,48+W(u)/2),Q(ee,`y`,W(s)-5),Q(te,`cx`,W(f)),Q(te,`cy`,W(p)),Q(ne,`cx`,W(f)),Q(ne,`cy`,W(p)),J(re,`${t.used??``}% consumed // ${i??``}% of period elapsed`),J(ae,`${t.used??``}% USED // ${a??``}% TIME ELAPSED`),J(oe,m)},[()=>`Consumption zone: ${t.used}% consumed, ${t.elapsed.toFixed(1)}% of quota period elapsed. ${W(m)>0?`Above`:W(m)<0?`Below`:`On`} the steady-consumption line.`,()=>t.elapsed.toFixed(1),()=>t.elapsed.toFixed(1),()=>Math.abs(W(m))<.05?`ON PACE`:W(m)>0?`ABOVE THE LINE — CONSUMING FASTER THAN TIME`:`BELOW THE LINE — WITHIN PACE`]),Ni(_,`clientWidth`,e=>I(o,e)),Ni(_,`clientHeight`,e=>I(s,e)),q(e,g),Je()}var Sa=K(` `),Ca=K(`

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

`),wa=K(`

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

`),Ta=K(`

`),Ea=K(`

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

The backend may return only some credits. This list does not establish + observation table for times, positions and gaps.

OBSERVATION TABLE
`,1),ba=K(`
CONSUMPTIONQUOTA PERIOD ELAPSED


`,1);function xa(e,t){let n=Lr();qe(t,!0);let r=zi(t,`trail`,19,()=>[]),i=F(!1),a=[0,25,50,75,100],o=F(400),s=F(240),c=N(()=>W(o)-24),l=N(()=>W(s)-48),u=N(()=>Math.max(1,W(c)-48)),d=N(()=>Math.max(1,W(l)-20)),f=N(()=>48+Math.max(0,Math.min(100,t.elapsed))/100*W(u)),p=N(()=>W(l)-Math.max(0,Math.min(100,t.used))/100*W(d)),m=N(()=>t.used-t.elapsed),h=N(()=>r().map((e,t)=>`${t===0||e.break?`M`:`L`}${48+e.elapsed/100*W(u)} ${W(l)-e.used/100*W(d)}`).join(` `));var g=ba(),_=R(g),v=L(_),y=L(v),b=z(y),x=B(y),S=B(x);Z(S,17,()=>a,X,(e,t)=>{var n=ha(),r=R(n),i=B(r),a=B(i),o=z(a),s=B(a),f=z(s);V(()=>{Q(r,`x1`,48+W(t)/100*W(u)),Q(r,`x2`,48+W(t)/100*W(u)),Q(r,`y2`,W(l)),Q(i,`y1`,W(l)-W(t)/100*W(d)),Q(i,`x2`,W(c)),Q(i,`y2`,W(l)-W(t)/100*W(d)),Q(a,`x`,48+W(t)/100*W(u)),Q(a,`y`,W(l)+20),J(o,`${W(t)??``}%`),Q(s,`y`,W(l)+4-W(t)/100*W(d)),J(f,`${W(t)??``}%`)}),q(e,n)});var C=B(S),w=B(C),T=B(w),E=e=>{var t=ga(),n=R(t),i=B(n),a=z(L(i));A(i),V(e=>{Q(n,`d`,W(h)),Q(i,`cx`,48+r()[0].elapsed/100*W(u)),Q(i,`cy`,W(l)-r()[0].used/100*W(d)),J(a,`First observation: ${e??``}`)},[()=>ia(r()[0].at)]),q(e,t)};Y(T,e=>{r().length&&e(E)});var ee=B(T,2),D=B(ee),te=B(D),ne=z(L(te));A(te),A(v),A(_);var re=B(_,2),ie=L(re),ae=z(B(ie,3),!0);A(re);var oe=B(re,2),se=e=>{var t=ya(),a=R(t),o=L(a);Ee(2),A(a);var s=B(a,2),c=B(L(s),2),l=e=>{var t=va(),n=L(t),i=B(L(n),2);Z(i,21,r,X,(e,t,n)=>{var r=_a(),i=L(r),a=L(i),o=z(a,!0);A(i);var s=B(i),c=z(s),l=B(s),u=z(l),d=z(B(l),!0);A(r),V((e,r)=>{Q(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`)},[()=>ia(W(t).at),()=>W(t).elapsed.toFixed(1)]),q(e,r)}),A(i),A(n),A(t),q(e,t)};Y(c,e=>{W(i)&&e(l)}),A(s),V(e=>{Q(a,`id`,n+`-trail-summary`),J(o,`○ START ${e??``} // ${r().length??``} + ${r().length===1?`OBSERVATION`:`OBSERVATIONS`}`)},[()=>ia(r()[0].at)]),Pi(`open`,`toggle`,s,e=>I(i,e),()=>W(i)),q(e,t)};Y(oe,e=>{r().length&&e(se)}),V((e,i,a,m)=>{Q(v,`viewBox`,`0 0 ${W(o)} ${W(s)}`),Q(v,`aria-describedby`,r().length?n+`-trail-summary`:void 0),Q(v,`aria-label`,e),Q(b,`id`,n),Q(x,`width`,W(u)),Q(x,`height`,W(d)),Q(x,`fill`,`url(#${n})`),Q(C,`d`,`M48 20 V${W(l)} H${W(c)}`),Q(w,`y1`,W(l)),Q(w,`x2`,W(c)),Q(ee,`x`,48+W(u)/2),Q(ee,`y`,W(s)-5),Q(D,`cx`,W(f)),Q(D,`cy`,W(p)),Q(te,`cx`,W(f)),Q(te,`cy`,W(p)),J(ne,`${t.used??``}% consumed // ${i??``}% of period elapsed`),J(ie,`${t.used??``}% USED // ${a??``}% TIME ELAPSED`),J(ae,m)},[()=>`Consumption zone: ${t.used}% consumed, ${t.elapsed.toFixed(1)}% of quota period elapsed. ${W(m)>0?`Above`:W(m)<0?`Below`:`On`} the steady-consumption line.`,()=>t.elapsed.toFixed(1),()=>t.elapsed.toFixed(1),()=>Math.abs(W(m))<.05?`ON PACE`:W(m)>0?`ABOVE THE LINE — CONSUMING FASTER THAN TIME`:`BELOW THE LINE — WITHIN PACE`]),Ni(_,`clientWidth`,e=>I(o,e)),Ni(_,`clientHeight`,e=>I(s,e)),q(e,g),Je()}var Sa=K(` `),Ca=K(`

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

`),wa=K(`

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

`),Ta=K(`

`),Ea=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.

`),Da=K(` `,1),Oa=Fr(``),ka=Fr(``),Aa=K(`
`),ja=K(`

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

`),Ma=K(`
−100 // OVER BUDGET+100 // HEADROOM

`,1),Na=K(`

Cycle duration unavailable — pace cannot be calculated.

`),Pa=K(`
EMPTYFULL
`),Fa=K(`

`,1),Ia=K(`
`,1),La=K(`

`),Ra=K(`

`),za=K(`

No quota windows reported yet.

`),Ba=K(`
`,1),Va=K(`

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

`,1),Ha=K(` `,1);function Ua(e,t){qe(t,!0);let n=zi(t,`params`,19,()=>({})),r=N(()=>qi.filter(e=>e!==`thresholds`||!!$.data?.thresholds?.length)),i=F($t(Date.now())),a=N(()=>W(r).includes(n().view||``)?n().view:`bars`);Bi(()=>{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))))}Sn(()=>{Zi.view=W(a)});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=Ha(),l=R(c);Z(l,21,()=>W(r),X,(e,t)=>{var n=Sa();let r;var i=z(n,!0);V(e=>{Q(n,`href`,`#/quota/`+W(t)),Q(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)===`pace`?`CONSUMPTION PACE`:W(t)===`zone`?`CONSUMPTION ZONE`:W(t)===`fuel`?`FUEL TANK`:W(t).toUpperCase()]),q(e,n)}),A(l);var u=B(l,2),d=e=>{var t=Va(),n=R(t),r=e=>{q(e,Ca())};Y(n,e=>{$.data.quotaError&&e(r)});var i=B(n,2),c=z(i),l=B(i,2),u=e=>{ma(e,{})},d=e=>{var t=Ea(),n=L(t),r=z(n),i=B(n,4),a=e=>{q(e,wa())};Y(i,e=>{$.data.credits.length||e(a)}),Z(B(i,2),17,()=>$.data.credits,X,(e,t)=>{var n=Ta(),r=L(n),i=z(r),a=z(B(r,2),!0);A(n),V(e=>{J(i,`${(W(t).title||`Quota reset`)??``} // ${W(t).status??``}`),J(a,e)},[()=>W(t).expiryKnown?W(t).expires?`EXPIRES `+ia(W(t).expires):`Does not expire`:`Expiry information unavailable`]),q(e,n)}),Ee(2),A(t),V(()=>J(r,`RESET INVENTORY // ${$.data.creditCount??``} AVAILABLE`)),q(e,t)},f=e=>{var t=Ba(),n=R(t);let r;Z(n,21,()=>$.data.meters,X,(e,t)=>{let n=N(()=>o(W(t))),r=N(()=>W(n)===null?null:W(n)-W(t).used);var i=Ra(),c=L(i),l=z(c,!0),u=B(c,2),d=L(u),f=e=>{var n=Da(),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)},p=e=>{var n=Da(),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(d,e=>{W(a)===`fuel`?e(f):e(p,-1)}),A(u);var m=B(u,2);let h;var g=L(m),_=e=>{var n=Aa(),r=L(n),i=B(L(r)),a=e=>{q(e,Oa())},o=e=>{var n=ka();V(e=>Q(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)}),A(r),A(n),V(()=>Q(r,`aria-label`,`${W(t).used}% quota used`)),q(e,n)},v=e=>{var r=Ir(),i=R(r),a=e=>{{let r=N(()=>W(t).trail||[]);xa(e,{get used(){return W(t).used},get elapsed(){return W(n)},get trail(){return W(r)}})}},o=e=>{q(e,ja())};Y(i,e=>{W(n)===null?e(o,-1):e(a)}),q(e,r)},y=e=>{var t=Ir(),n=R(t),i=e=>{var t=Ma(),n=R(t),i=B(L(n),2);let a;A(n);var o=B(n,4),s=L(o),c=z(B(s),!0);A(o),V(e=>{a=di(i,``,a,{left:`${(W(r)+100)/2}%`}),J(s,`${W(r)>=0?`+`:``}${e??``} PP `),J(c,W(r)>=0?`WITHIN PACE`:`USING FASTER THAN TIME`)},[()=>W(r).toFixed(1)]),q(e,t)},a=e=>{q(e,Na())};Y(n,e=>{W(r)===null?e(a,-1):e(i)}),q(e,t)},b=e=>{var r=Ia(),i=R(r),o=L(i);let s;A(i);var c=B(i,2),l=e=>{q(e,Pa())};Y(c,e=>{W(a)===`fuel`&&e(l)});var u=B(c,2),d=e=>{var t=Fa(),r=R(t),i=z(r),o=B(r,2),s=L(o);let c;A(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(()=>{Q(i,`aria-label`,W(a)===`fuel`?`Fuel remaining`:`Quota used`),Q(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(g,e=>{W(a)===`pie`?e(_):W(a)===`zone`?e(v,1):W(a)===`pace`?e(y,2):e(b,-1)}),A(m);var x=B(m,2),S=z(x),C=B(x,2),w=e=>{var n=La(),r=z(n,!0);V(()=>J(r,W(t).details)),q(e,n)};Y(C,e=>{W(t).details&&e(w)}),A(i),V(e=>{J(l,W(t).name),h=li(m,1,`meter-graphic`,null,h,{"bar-graphic":W(a)===`bars`||W(a)===`fuel`}),J(S,`RESETS // ${e??``}`)},[()=>ia(W(t).reset)]),q(e,i)}),A(n);var i=B(n,2),c=e=>{q(e,za())};Y(i,e=>{$.data.meters.length||e(c)}),V(()=>r=li(n,1,`quota-grid`,null,r,{radial:W(a)===`pie`,zone:W(a)===`zone`})),q(e,t)};Y(l,e=>{W(a)===`thresholds`?e(u):W(a)===`resets`?e(d,1):e(f,-1)}),Ee(2),V(e=>J(c,`QUOTA // OBSERVED ${e??``}`),[()=>ia($.data.quotaAt)]),q(e,t)};Y(u,e=>{$.data&&e(d)}),q(e,c),Je()}var Wa=K(`
`),Ga=K(`

`,1);function Ka(e,t){qe(t,!0);let n=zi(t,`values`,19,()=>[]),r=zi(t,`label`,3,`Token activity`),i=zi(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=Ga(),c=R(s),l=z(c),u=B(c,2);Z(u,21,()=>W(o),X,(e,t)=>{var n=Wa();let r;V((e,t)=>{Q(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)}),A(u),V((e,t)=>{J(l,`SCALE // 0 — ${e??``} TOKENS`),Q(u,`aria-label`,t)},[()=>W(a).toLocaleString(`en-GB`),()=>`${r()}. Peak ${W(a).toLocaleString(`en-GB`)} tokens.`]),q(e,s),Je()}var qa=K(`

CURRENT PROFILE

MODEL / REASONING LEVEL / SPEED

 

PROPOSED PROFILE

MODEL / REASONING LEVEL / SPEED

 

Applied settings remain after Codexometer closes.

`,1),Ja=K(`

`),Ya=K(`

 
`,1),Xa=K(`

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

`),Za=K(`

Session controls temporarily unavailable. Check Codex for current state.

`),Qa=K(`

Checking session controls…

`),$a=K(`

`),eo=K(`
About browser controls

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

`),to=K(` `,1),no=K(` `),ro=K(`Grants permission beyond this one command. Check the scope - carefully.`),io=K(``),ao=K(``),oo=K(``),so=K(``),co=K(` `,1),lo=K(`
  • `),uo=K(`
    View fixed choices

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

      `),fo=K(` `,1),po=K(`

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

      `,1),go=K(`

      `);function _o(e,t){qe(t,!0);let n=[],r=zi(t,`observedCommand`,3,``),i=zi(t,`review`,3,``),a=zi(t,`suspended`,3,!1),o=zi(t,`onProtectedChange`,3,e=>{}),s=F(null),c=F($t([])),l=F(null),u=F(``),d=F(0),f=F($t(Date.now())),p=F(!1),m=F(``),h=F(!1),g=F(!1),_=F(``);Sn(()=>(o()(W(p)||W(c).some(e=>e.length>0)),()=>o()(!1)));let v=N(()=>$.data?.sessions.find(e=>e.id===t.session)?.status),y=N(()=>!$.connected||!!$.data?.sessionsError),b=N(()=>i()!==`profile`&&W(s)?.kind===`prompt`&&!W(s).questions?.length&&!!$.data?.profiles?.some(e=>e.session===t.session&&e.pending)),x=N(()=>!W(y)&&!W(g)&&!!W(s)?.id&&W(s).kind===`approval`&&W(_)!==W(s).id),S=N(()=>W(x)?W(s).command:r()),C=N(()=>!!W(u)&&W(f)W(s)?.questions?.length?W(s).questions:[{text:`Follow-up message`,secret:!1,freeText:!0,options:[]}]),T=N(()=>W(s)?.kind===`approval`||W(s)?.kind===`profile`?W(l)!==null:W(c).length===W(w).length&&W(c).every((e,t)=>e.trim().length>0&&(W(w)[t].freeText||W(w)[t].options?.includes(e))));Sn(()=>{(W(y)||a()||W(b)||W(f)>=W(d))&&I(u,``)});let E=new AbortController;Bi(()=>{let e,n=setInterval(()=>{I(f,Date.now(),!0)},1e3);async function r(){try{let e=await ca(`offer`,{session:t.session,...i()?{review:i()}:{}},E.signal);if(E.signal.aborted)return;I(g,!1),W(s)?.id!==e.id&&(I(u,``),I(l,null),I(c,Array(Math.max(1,e.questions?.length||0)).fill(``),!0)),I(s,e,!0),W(h)&&e.id&&e.id!==W(_)&&(I(m,``),I(h,!1))}catch{E.signal.aborted||(I(s,null),I(g,!0),I(u,``))}finally{E.signal.aborted||(e=setTimeout(r,2e3))}}return r(),()=>{E.abort(),clearTimeout(e),clearInterval(n)}});async function ee(){if(!W(s)?.id||W(p)||W(y)||a()||W(b)||!W(T))return;let e=W(s).id;I(p,!0),I(m,``),I(h,!1),I(u,``);try{let n=await ca(`prepare`,{session:t.session,...i()?{review:i()}:{},offer:e,...W(s).kind===`approval`||W(s).kind===`profile`?{choice:W(l)}:{answers:[...W(c)]}},E.signal);W(s)?.id===e&&!E.signal.aborted&&!W(y)&&!a()&&!W(b)&&(I(u,n.confirmation,!0),I(d,Date.parse(n.expires),!0))}catch(e){E.signal.aborted||I(m,e instanceof Error?e.message:`Unable to prepare action.`,!0)}finally{I(p,!1)}}async function te(){if(!W(s)?.id||W(p)||a()||W(b)||!W(C))return;let e=W(s).id,n=W(s).kind,r=W(u);I(u,``),I(p,!0),I(_,e,!0);try{await ca(`commit`,{session:t.session,...i()?{review:i()}:{},offer:e,confirmation:r},E.signal),I(h,!0),I(m,n===`profile`?`Profile decision completed.`:n===`approval`?`Decision sent.`:`Text sent.`,!0)}catch(e){I(m,e instanceof oa?e.message:`Outcome uncertain. Check Codex before taking another action; nothing was retried.`,!0)}finally{I(p,!1),I(c,[],!0),I(l,null)}}var ne=Ir(),re=R(ne),ie=e=>{var r=go(),a=L(r),o=z(a,!0),b=B(a,2),E=e=>{var t=qa(),n=R(t),r=z(n),i=B(n,6),a=z(i,!0),o=z(B(i,6),!0);Ee(2),V(()=>{J(r,`Your ${W(s).profile.threshold??``}% quota threshold has been reached. Review - the profile for subsequent turns.`),J(a,W(s).profile.current),J(o,W(s).profile.proposed)}),q(e,t)};Y(b,e=>{W(s)?.profile&&!W(y)&&!W(g)&&e(E)});var ne=B(b,2),re=e=>{var t=Ja();let n;var r=z(t,!0);V(()=>{n=li(t,1,`svelte-1oupzfc`,null,n,{notice:!W(h),sent:W(h)}),J(r,W(m))}),q(e,t)};Y(ne,e=>{W(m)&&e(re)});var ie=B(ne,2),ae=e=>{var t=Ya(),n=R(t),r=z(n,!0),i=z(B(n,2),!0);V(()=>{J(r,W(x)?`EXACT COMMAND`:`LAST OBSERVED COMMAND`),J(i,W(S))}),q(e,t)},oe=e=>{q(e,Xa())};Y(ie,e=>{W(S)?e(ae):i()!==`profile`&&W(v)===`APPROVAL NEEDED`&&!W(h)&&e(oe,1)});var se=B(ie,2),ce=e=>{q(e,Za())},le=e=>{q(e,Qa())},ue=e=>{var t=to(),n=R(t),r=e=>{var t=$a(),n=z(t,!0);V(e=>J(n,e),[()=>W(v)===`WORKING`?`Codex is working — nothing to respond to.`:[`APPROVAL NEEDED`,`INPUT NEEDED`].includes(W(v)||``)?`Respond in Codex for this request.`:`Nothing needs a response right now.`]),q(e,t)};Y(n,e=>{(W(v)===`WORKING`||!W(h)&&!W(p))&&e(r)});var i=B(n,2),a=e=>{q(e,eo())},o=N(()=>[`APPROVAL NEEDED`,`INPUT NEEDED`].includes(W(v)||``)&&!W(h));Y(i,e=>{W(o)&&e(a)}),q(e,t)},de=e=>{var r=ho(),a=R(r),o=z(a),m=B(a,2),h=L(m),g=z(h,!0),_=B(h,2),v=e=>{var r=Ir();Z(R(r),17,()=>W(s).choices||[],X,(e,r,a)=>{var o=io(),s=L(o);Si(s),s.value=s.__value=a;var c=B(s),u=B(c),d=e=>{var t=no(),n=z(t,!0);V(()=>J(n,W(r).detail)),q(e,t)};Y(u,e=>{W(r).detail&&e(d)});var f=B(u,2),p=e=>{q(e,ro())};Y(f,e=>{W(r).persistent&&e(p)}),A(o),V(()=>{Q(s,`name`,`decision-`+t.session+`-`+i()),J(c,` ${W(r).label??``} `)}),Oi(n,[],s,()=>W(l),e=>I(l,e)),q(e,o)}),q(e,r)},b=e=>{var t=Ir();Z(R(t),17,()=>W(w),X,(e,t,n)=>{var r=fo(),i=R(r),a=L(i),o=B(a),s=e=>{var t=ao();Si(t),Ei(t,()=>W(c)[n],e=>W(c)[n]=e),q(e,t)},l=e=>{var r=so(),i=L(r);i.value=i.__value=``,Z(B(i),17,()=>W(t).options||[],X,(e,t)=>{var n=oo(),r=z(n,!0),i={};V(()=>{J(r,W(t)),i!==(i=W(t))&&(n.value=(n.__value=i)??``)}),q(e,n)}),A(r),hi(r),gi(r,()=>W(c)[n],e=>W(c)[n]=e),q(e,r)},u=e=>{var r=co(),i=R(r);st(i);var a=B(i,2),o=e=>{var n=$a(),r=z(n);V(e=>J(r,`Suggested answers: ${e??``}`),[()=>W(t).options.join(` · `)]),q(e,n)};Y(a,e=>{W(t).options?.length&&e(o)}),Ei(i,()=>W(c)[n],e=>W(c)[n]=e),q(e,r)};Y(o,e=>{W(t).secret?e(s):W(t).freeText?e(u,-1):e(l,1)}),A(i);var d=B(i,2),f=e=>{var n=uo(),r=B(L(n),4);Z(r,21,()=>W(t).options||[],X,(e,t)=>{var n=lo(),r=z(n,!0);V(()=>J(r,W(t))),q(e,n)}),A(r),A(n),q(e,n)};Y(d,e=>{W(t).secret&&!W(t).freeText&&e(f)}),V(()=>J(a,`${W(t).text??``} `)),q(e,r)}),q(e,t)};Y(_,e=>{W(s).kind===`approval`||W(s).kind===`profile`?e(v):e(b,-1)}),A(m);var x=B(m,2),S=e=>{var t=po(),n=R(t),r=z(n),i=B(n,2),a=z(i),o=B(i,2);V(e=>{J(r,`Check the target and ${W(s).kind===`profile`?`profile above`:W(s).kind===`approval`?`exact command and permission scope`:`message above`}. This will send to Codex; it may start work - using your quota. Confirmation expires in ${e??``}s.`),i.disabled=W(p)||W(y),J(a,`CONFIRM ${(W(s).kind===`approval`||W(s).kind===`profile`?W(s).choices?.[W(l)]?.label:`SEND`)??``}`)},[()=>Math.max(0,Math.ceil((W(d)-W(f))/1e3))]),G(`click`,i,te),G(`click`,o,()=>{I(u,``)}),q(e,t)},E=e=>{var t=mo(),n=z(t,!0);V(()=>{t.disabled=W(p)||W(y)||!W(T),J(n,W(p)?`SENDING…`:`REVIEW BEFORE SENDING`)}),G(`click`,t,ee),q(e,t)};Y(x,e=>{W(C)?e(S):e(E,-1)}),V(()=>{J(o,`TARGET // ${W(s).thread??``} // ${(W(s).directory||`Directory unavailable`)??``}`),m.disabled=W(p)||W(C)||W(y),J(g,W(s).kind===`approval`||W(s).kind===`profile`?`Choose a decision`:`Reply to this session`)}),q(e,r)};Y(se,e=>{W(y)||W(g)?e(ce):W(s)?W(s).id?W(_)!==W(s).id&&e(de,3):e(ue,2):e(le,1)}),A(r),V(()=>J(o,i()===`profile`?`QUOTA THRESHOLD`:`SESSION CONTROL // EXPERIMENTAL`)),q(e,r)};Y(re,e=>{W(b)||e(ie)}),q(e,ne),Je()}Er([`click`]);var vo=K(`
      `);function yo(e,t){qe(t,!0);let n=zi(t,`active`,3,!1),r=N(()=>[`LAST REPLY`,`LAST ACTIVITY`].includes(t.session.contextKind)&&!!t.session.text.trim()),i=F(!1),a=F(``),o=F(!1);Sn(()=>{if(!W(o))return;let e=setTimeout(()=>{I(o,!1)},150);return()=>clearTimeout(e)}),Sn(()=>{t.session.text,t.session.status,I(a,``)});async function s(){if(!W(r)||W(i))return;let e=t.session.text;I(i,!0),I(o,!0),I(a,``);try{await navigator.clipboard.writeText(e),t.session.text===e&&I(a,`Copied.`)}catch{t.session.text===e&&I(a,`Clipboard unavailable. Select the visible text and copy it manually.`)}finally{I(i,!1)}}function c(e){!n()||!W(r)||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(),s())}var l=Ir();Tr(`keydown`,nn,c);var u=R(l),d=e=>{var t=vo(),n=L(t),r=z(n,!0),c=B(n,2);let l;A(t),V(()=>{J(r,W(a)),c.disabled=W(i),l=li(c,1,`svelte-543j00`,null,l,{flashed:W(o)})}),G(`click`,c,s),q(e,t)};Y(u,e=>{W(r)&&e(d)}),q(e,l),Je()}Er([`click`]);var bo=K(`

      `),xo=K(`

      `),So=K(`
       
      `),Co=K(`

      Command unavailable from this observation. Open Codex to inspect the + carefully.`),io=K(``),ao=K(``),oo=K(``),so=K(``),co=K(` `,1),lo=K(`

    • `),uo=K(`
      View fixed choices

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

        `),fo=K(` `,1),po=K(`

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

        `,1),go=K(`

        `);function _o(e,t){qe(t,!0);let n=[],r=zi(t,`observedCommand`,3,``),i=zi(t,`review`,3,``),a=zi(t,`suspended`,3,!1),o=zi(t,`onProtectedChange`,3,e=>{}),s=F(null),c=F($t([])),l=F(null),u=F(``),d=F(0),f=F($t(Date.now())),p=F(!1),m=F(``),h=F(!1),g=F(!1),_=F(``);Sn(()=>(o()(W(p)||W(c).some(e=>e.length>0)),()=>o()(!1)));let v=N(()=>$.data?.sessions.find(e=>e.id===t.session)?.status),y=N(()=>!$.connected||!!$.data?.sessionsError),b=N(()=>i()!==`profile`&&W(s)?.kind===`prompt`&&!W(s).questions?.length&&!!$.data?.profiles?.some(e=>e.session===t.session&&e.pending)),x=N(()=>!W(y)&&!W(g)&&!!W(s)?.id&&W(s).kind===`approval`&&W(_)!==W(s).id),S=N(()=>W(x)?W(s).command:r()),C=N(()=>!!W(u)&&W(f)W(s)?.questions?.length?W(s).questions:[{text:`Follow-up message`,secret:!1,freeText:!0,options:[]}]),T=N(()=>W(s)?.kind===`approval`||W(s)?.kind===`profile`?W(l)!==null:W(c).length===W(w).length&&W(c).every((e,t)=>e.trim().length>0&&(W(w)[t].freeText||W(w)[t].options?.includes(e))));Sn(()=>{(W(y)||a()||W(b)||W(f)>=W(d))&&I(u,``)});let E=new AbortController;Bi(()=>{let e,n=setInterval(()=>{I(f,Date.now(),!0)},1e3);async function r(){try{let e=await ca(`offer`,{session:t.session,...i()?{review:i()}:{}},E.signal);if(E.signal.aborted)return;I(g,!1),W(s)?.id!==e.id&&(I(u,``),I(l,null),I(c,Array(Math.max(1,e.questions?.length||0)).fill(``),!0)),I(s,e,!0),W(h)&&e.id&&e.id!==W(_)&&(I(m,``),I(h,!1))}catch{E.signal.aborted||(I(s,null),I(g,!0),I(u,``))}finally{E.signal.aborted||(e=setTimeout(r,2e3))}}return r(),()=>{E.abort(),clearTimeout(e),clearInterval(n)}});async function ee(){if(!W(s)?.id||W(p)||W(y)||a()||W(b)||!W(T))return;let e=W(s).id;I(p,!0),I(m,``),I(h,!1),I(u,``);try{let n=await ca(`prepare`,{session:t.session,...i()?{review:i()}:{},offer:e,...W(s).kind===`approval`||W(s).kind===`profile`?{choice:W(l)}:{answers:[...W(c)]}},E.signal);W(s)?.id===e&&!E.signal.aborted&&!W(y)&&!a()&&!W(b)&&(I(u,n.confirmation,!0),I(d,Date.parse(n.expires),!0))}catch(e){E.signal.aborted||I(m,e instanceof Error?e.message:`Unable to prepare action.`,!0)}finally{I(p,!1)}}async function D(){if(!W(s)?.id||W(p)||a()||W(b)||!W(C))return;let e=W(s).id,n=W(s).kind,r=W(u);I(u,``),I(p,!0),I(_,e,!0);try{await ca(`commit`,{session:t.session,...i()?{review:i()}:{},offer:e,confirmation:r},E.signal),I(h,!0),I(m,n===`profile`?`Profile decision completed.`:n===`approval`?`Decision sent.`:`Text sent.`,!0)}catch(e){I(m,e instanceof oa?e.message:`Outcome uncertain. Check Codex before taking another action; nothing was retried.`,!0)}finally{I(p,!1),I(c,[],!0),I(l,null)}}var te=Ir(),ne=R(te),re=e=>{var r=go(),a=L(r),o=z(a,!0),b=B(a,2),E=e=>{var t=qa(),n=R(t),r=z(n),i=B(n,6),a=z(i,!0),o=z(B(i,6),!0);Ee(2),V(()=>{J(r,`Your ${W(s).profile.threshold??``}% quota threshold has been reached. Review + the profile for subsequent turns.`),J(a,W(s).profile.current),J(o,W(s).profile.proposed)}),q(e,t)};Y(b,e=>{W(s)?.profile&&!W(y)&&!W(g)&&e(E)});var te=B(b,2),ne=e=>{var t=Ja();let n;var r=z(t,!0);V(()=>{n=li(t,1,`svelte-1oupzfc`,null,n,{notice:!W(h),sent:W(h)}),J(r,W(m))}),q(e,t)};Y(te,e=>{W(m)&&e(ne)});var re=B(te,2),ie=e=>{var t=Ya(),n=R(t),r=z(n,!0),i=z(B(n,2),!0);V(()=>{J(r,W(x)?`EXACT COMMAND`:`LAST OBSERVED COMMAND`),J(i,W(S))}),q(e,t)},ae=e=>{q(e,Xa())};Y(re,e=>{W(S)?e(ie):i()!==`profile`&&W(v)===`APPROVAL NEEDED`&&!W(h)&&e(ae,1)});var oe=B(re,2),se=e=>{q(e,Za())},ce=e=>{q(e,Qa())},le=e=>{var t=to(),n=R(t),r=e=>{var t=$a(),n=z(t,!0);V(e=>J(n,e),[()=>W(v)===`WORKING`?`Codex is working — nothing to respond to.`:[`APPROVAL NEEDED`,`INPUT NEEDED`].includes(W(v)||``)?`Respond in Codex for this request.`:`Nothing needs a response right now.`]),q(e,t)};Y(n,e=>{(W(v)===`WORKING`||!W(h)&&!W(p))&&e(r)});var i=B(n,2),a=e=>{q(e,eo())},o=N(()=>[`APPROVAL NEEDED`,`INPUT NEEDED`].includes(W(v)||``)&&!W(h));Y(i,e=>{W(o)&&e(a)}),q(e,t)},ue=e=>{var r=ho(),a=R(r),o=z(a),m=B(a,2),h=L(m),g=z(h,!0),_=B(h,2),v=e=>{var r=Ir();Z(R(r),17,()=>W(s).choices||[],X,(e,r,a)=>{var o=io(),s=L(o);Si(s),s.value=s.__value=a;var c=B(s),u=B(c),d=e=>{var t=no(),n=z(t,!0);V(()=>J(n,W(r).detail)),q(e,t)};Y(u,e=>{W(r).detail&&e(d)});var f=B(u,2),p=e=>{q(e,ro())};Y(f,e=>{W(r).persistent&&e(p)}),A(o),V(()=>{Q(s,`name`,`decision-`+t.session+`-`+i()),J(c,` ${W(r).label??``} `)}),Oi(n,[],s,()=>W(l),e=>I(l,e)),q(e,o)}),q(e,r)},b=e=>{var t=Ir();Z(R(t),17,()=>W(w),X,(e,t,n)=>{var r=fo(),i=R(r),a=L(i),o=B(a),s=e=>{var t=ao();Si(t),Ei(t,()=>W(c)[n],e=>W(c)[n]=e),q(e,t)},l=e=>{var r=so(),i=L(r);i.value=i.__value=``,Z(B(i),17,()=>W(t).options||[],X,(e,t)=>{var n=oo(),r=z(n,!0),i={};V(()=>{J(r,W(t)),i!==(i=W(t))&&(n.value=(n.__value=i)??``)}),q(e,n)}),A(r),hi(r),gi(r,()=>W(c)[n],e=>W(c)[n]=e),q(e,r)},u=e=>{var r=co(),i=R(r);st(i);var a=B(i,2),o=e=>{var n=$a(),r=z(n);V(e=>J(r,`Suggested answers: ${e??``}`),[()=>W(t).options.join(` · `)]),q(e,n)};Y(a,e=>{W(t).options?.length&&e(o)}),Ei(i,()=>W(c)[n],e=>W(c)[n]=e),q(e,r)};Y(o,e=>{W(t).secret?e(s):W(t).freeText?e(u,-1):e(l,1)}),A(i);var d=B(i,2),f=e=>{var n=uo(),r=B(L(n),4);Z(r,21,()=>W(t).options||[],X,(e,t)=>{var n=lo(),r=z(n,!0);V(()=>J(r,W(t))),q(e,n)}),A(r),A(n),q(e,n)};Y(d,e=>{W(t).secret&&!W(t).freeText&&e(f)}),V(()=>J(a,`${W(t).text??``} `)),q(e,r)}),q(e,t)};Y(_,e=>{W(s).kind===`approval`||W(s).kind===`profile`?e(v):e(b,-1)}),A(m);var x=B(m,2),S=e=>{var t=po(),n=R(t),r=z(n),i=B(n,2),a=z(i),o=B(i,2);V(e=>{J(r,`Check the target and ${W(s).kind===`profile`?`profile above`:W(s).kind===`approval`?`exact command and permission scope`:`message above`}. This will send to Codex; it may start work + using your quota. Confirmation expires in ${e??``}s.`),i.disabled=W(p)||W(y),J(a,`CONFIRM ${(W(s).kind===`approval`||W(s).kind===`profile`?W(s).choices?.[W(l)]?.label:`SEND`)??``}`)},[()=>Math.max(0,Math.ceil((W(d)-W(f))/1e3))]),G(`click`,i,D),G(`click`,o,()=>{I(u,``)}),q(e,t)},E=e=>{var t=mo(),n=z(t,!0);V(()=>{t.disabled=W(p)||W(y)||!W(T),J(n,W(p)?`SENDING…`:`REVIEW BEFORE SENDING`)}),G(`click`,t,ee),q(e,t)};Y(x,e=>{W(C)?e(S):e(E,-1)}),V(()=>{J(o,`TARGET // ${W(s).thread??``} // ${(W(s).directory||`Directory unavailable`)??``}`),m.disabled=W(p)||W(C)||W(y),J(g,W(s).kind===`approval`||W(s).kind===`profile`?`Choose a decision`:`Reply to this session`)}),q(e,r)};Y(oe,e=>{W(y)||W(g)?e(se):W(s)?W(s).id?W(_)!==W(s).id&&e(ue,3):e(le,2):e(ce,1)}),A(r),V(()=>J(o,i()===`profile`?`QUOTA THRESHOLD`:`SESSION CONTROL // EXPERIMENTAL`)),q(e,r)};Y(ne,e=>{W(b)||e(re)}),q(e,te),Je()}Er([`click`]);var vo=K(`
        `);function yo(e,t){qe(t,!0);let n=zi(t,`active`,3,!1),r=N(()=>[`LAST REPLY`,`LAST ACTIVITY`].includes(t.session.contextKind)&&!!t.session.text.trim()),i=F(!1),a=F(``),o=F(!1);Sn(()=>{if(!W(o))return;let e=setTimeout(()=>{I(o,!1)},150);return()=>clearTimeout(e)}),Sn(()=>{t.session.text,t.session.status,I(a,``)});async function s(){if(!W(r)||W(i))return;let e=t.session.text;I(i,!0),I(o,!0),I(a,``);try{await navigator.clipboard.writeText(e),t.session.text===e&&I(a,`Copied.`)}catch{t.session.text===e&&I(a,`Clipboard unavailable. Select the visible text and copy it manually.`)}finally{I(i,!1)}}function c(e){!n()||!W(r)||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(),s())}var l=Ir();Tr(`keydown`,nn,c);var u=R(l),d=e=>{var t=vo(),n=L(t),r=z(n,!0),c=B(n,2);let l;A(t),V(()=>{J(r,W(a)),c.disabled=W(i),l=li(c,1,`svelte-543j00`,null,l,{flashed:W(o)})}),G(`click`,c,s),q(e,t)};Y(u,e=>{W(r)&&e(d)}),q(e,l),Je()}Er([`click`]);var bo=K(`

        `),xo=K(`

        `),So=K(`
         
        `),Co=K(`

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

        `),wo=K(`

        `,1),To=K(`

        `),Eo=K(`
         
        `,1),Do=K(`
        `),Oo=K(`

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

        `),ko=K(`

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

        `),Ao=K(` `),jo=K(` `),Mo=K(``),No=K(`

        Read only — reply or approve in Codex.

        `),Po=K(`

        `),Fo=K(`QUOTA THRESHOLD // REVIEW PROFILE ↗`),Io=K(`
        `),Lo=K(`
        `),Ro=K(`

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

        `),zo=K(`

        `),Bo=K(` `),Vo=K(`

        `),Ho=K(`QUOTA THRESHOLD // REVIEW PROFILE ↗`),Uo=K(` `,1),Wo=K(`

        `),Go=K(`

        TOKEN ACTIVITY // 30 SECOND SAMPLES

        `),Ko=K(`

        TOKENS

        FULL DETAIL →
        `),qo=K(`

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

        `),Jo=K(`

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

        `,1),Yo=K(`

        SESSION TOTALS

        `,1);function Xo(e,t){qe(t,!0);let n=(e,t=f,n,r)=>{let i=yt(()=>g(n?.(),!0)),a=yt(()=>g(r?.(),!1));var o=Eo(),s=R(o),c=e=>{var n=bo();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)},[()=>b(t())]),q(e,n)},l=N(()=>b(t())&&(!W(a)||W(d)||t().status===`CHECK SESSION`));Y(s,e=>{W(l)&&e(c)});var u=B(s,2),p=e=>{var n=xo(),r=z(n,!0);V(()=>J(r,t().contextKind||`LAST ACTIVITY`)),q(e,n)};Y(u,e=>{W(i)&&e(p)});var m=B(u,2),h=z(m,!0),_=B(m,2),v=e=>{var n=wo(),r=B(R(n),2),i=z(r,!0),a=B(r,2),o=e=>{var n=So(),r=z(n,!0);V(()=>J(r,t().command)),q(e,n)},s=e=>{q(e,Co())};Y(a,e=>{t().command?e(o):e(s,-1)}),V(()=>J(i,W(d)||t().status!==`APPROVAL NEEDED`?`LAST OBSERVED COMMAND`:$.data?.control?`COMMAND REQUEST`:`COMMAND TO APPROVE IN CODEX`)),q(e,n)};Y(_,e=>{(!W(a)||!$.data?.control)&&(t().command||t().status===`APPROVAL NEEDED`)&&e(v)});var y=B(_,2),x=e=>{var n=To(),r=z(n);V(()=>J(r,`CONTEXT SOURCE // ${(t().source||`LOCAL`)??``} // OBSERVATION`)),q(e,n)};Y(y,e=>{W(a)||e(x)}),V(()=>J(h,t().text||`No session context available.`)),q(e,o)},r=zi(t,`params`,19,()=>({})),i=N(()=>$.data?.sessions||[]),a=N(()=>$.data?.control&&$.data.profiles||[]),o=F(!1);function s(e,t){if(r().id&&r().id!==t&&W(o)){e.preventDefault();return}h(t)}Sn(()=>{let e=r().id;e&&gr(()=>{Zi.selected=e,na(e,2)})});let c=N(()=>W(i).find(e=>e.id===r().id)),l=N(()=>new URLSearchParams(Ui.querystring).get(`review`)===`profile`&&W(a).some(e=>e.session===r().id&&e.pending)),u=N(()=>W(i).some(e=>e.id===Zi.selected)?Zi.selected:W(i)[0]?.id),d=N(()=>!$.connected||!!$.data?.sessionsError),p=N(()=>[[`OBSERVED TOKENS`,ra(W(i).reduce((e,t)=>e+t.tokens,0))],[`LISTED SESSIONS`,ra(W(i).length)],...[[`WORKING`,`WORKING`],[`AWAITING APPROVAL`,`APPROVAL NEEDED`],[`AWAITING INPUT`,`INPUT NEEDED`],[`CHECK · INFERRED`,`CHECK SESSION`]].map(([e,t])=>[e,W(d)?`—`:ra(W(i).filter(e=>e.status===t).length)])]),m=N(()=>W(i).filter(e=>[`INPUT NEEDED`,`APPROVAL NEEDED`,`CHECK SESSION`].includes(e.status)));function h(e){Zi.selected=e,pr().then(()=>document.querySelector(`.session-row.selected`)?.scrollIntoView({block:`nearest`}))}function v(e,t){if(h(e),r().id){t<0&&(na(e,2),location.hash=`/sessions`);return}let n=ea(e)+t;n>2?location.hash=`/sessions/`+encodeURIComponent(e):na(e,n)}function y(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(),v(r().id,-1);else if([`ArrowLeft`,`ArrowRight`].includes(e.key)&&(r().id||W(u)))e.preventDefault(),v(r().id||W(u),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(u));h(W(i)[Math.max(0,Math.min(W(i).length-1,t+(e.key===`ArrowUp`?-1:1)))].id)}}}function b(e){return W(d)?`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.`:``}var x=Yo();Tr(`keydown`,nn,y);var S=R(x),C=z(B(L(S),2));A(S);var w=B(S,2);let T;Z(w,21,()=>W(p),X,(e,t)=>{var n=N(()=>_(W(t),2));let r=()=>W(n)[0],i=()=>W(n)[1];var a=Do(),o=L(a),s=z(o,!0),c=z(B(o,2),!0);A(a),V(()=>{J(s,r()),J(c,i())}),q(e,a)}),A(w);var E=B(w,2),ee=z(E),te=B(E,2),ne=e=>{q(e,Oo())};Y(te,e=>{W(d)&&e(ne)});var re=B(te,2),ie=e=>{q(e,ko())};Y(re,e=>{$.data?.profileError&&e(ie)});var ae=B(re,2),oe=e=>{var t=Mo(),n=L(t);Z(n,17,()=>W(m),X,(e,t)=>{var n=Ao();let r;var i=z(n);V(e=>{r=li(n,1,`button`,null,r,{approval:W(t).status===`APPROVAL NEEDED`}),Q(n,`href`,e),J(i,`${W(t).status??``} // ${(W(t).directory||W(t).id)??``}`)},[()=>`#/sessions/`+encodeURIComponent(W(t).id)]),G(`click`,n,()=>h(W(t).id)),q(e,n)}),Z(B(n,2),17,()=>W(a).filter(e=>e.pending&&W(i).some(t=>t.id===e.session)),X,(e,t)=>{var n=jo(),a=z(n);V((e,i)=>{Q(n,`title`,r().id&&r().id!==W(t).session&&W(o)?`Finish sending or clear your current draft before switching sessions.`:`Review this session’s quota threshold`),Q(n,`href`,e),J(a,`QUOTA THRESHOLD // ${i??``}`)},[()=>`#/sessions/`+encodeURIComponent(W(t).session)+`?review=profile`,()=>W(i).find(e=>e.id===W(t).session)?.directory||W(t).session]),G(`click`,n,e=>s(e,W(t).session)),q(e,n)}),A(t),q(e,t)},se=N(()=>(W(m).length||W(a).some(e=>e.pending))&&!W(d));Y(ae,e=>{W(se)&&e(oe)});var ce=B(ae,2),le=e=>{var t=Ir(),i=R(t),s=e=>{var t=Lo(),i=L(t),s=L(i),u=L(s);let f;var p=B(u);A(s);var m=B(s,2);A(i);var g=B(i,2),_=z(g),v=B(g,2);let y;var b=L(v),x=L(b);n(x,()=>W(c),()=>!0,()=>!0),A(b);var S=B(b,2),C=e=>{var t=Ir();Jr(R(t),()=>W(c).id,e=>{_o(e,{get session(){return W(c).id},get observedCommand(){return W(c).command},get suspended(){return W(l)},onProtectedChange:e=>{I(o,e,!0)}})}),q(e,t)},w=e=>{q(e,No())};Y(S,e=>{$.data?.control?e(C):e(w,-1)}),A(v);var T=B(v,2);Z(T,17,()=>W(a).filter(e=>e.session===W(c).id),e=>e.session,(e,t)=>{var n=Io(),r=L(n),i=e=>{var n=Po(),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=>{_o(e,{get session(){return W(c).id},review:`profile`})},s=e=>{var t=Fo();V(e=>Q(t,`href`,e),[()=>`#/sessions/`+encodeURIComponent(W(c).id)+`?review=profile`]),q(e,t)};Y(a,e=>{W(t).pending&&W(l)?e(o):W(t).pending&&e(s,1)}),A(n),V(()=>Q(n,`id`,`quota-profile-`+W(c).id)),q(e,n)});var E=B(T,2),ee=e=>{var t=Ir();Jr(R(t),()=>W(c).id,e=>{yo(e,{get session(){return W(c)},active:!0})}),q(e,t)};Y(E,e=>{W(l)||e(ee)}),A(t),V(e=>{f=li(u,1,`lamp lit`,null,f,{working:W(c).status===`WORKING`&&!W(d)}),J(p,`${(W(d)?`STALE`:W(l)?`QUOTA THRESHOLD`:W(c).status)??``} // ${W(c).directory??``}`),J(_,`${e??``} TOKENS // ${W(c).id??``} // CONTEXT SOURCE // ${(W(c).source||`LOCAL`)??``}`),y=di(v,``,y,{display:W(l)?`none`:void 0})},[()=>ra(W(c).tokens)]),G(`click`,m,()=>{h(r().id),na(r().id,2)}),q(e,t)},u=e=>{q(e,Ro())};Y(i,e=>{W(c)?e(s):e(u,-1)}),q(e,t)},ue=e=>{var t=Jo(),r=R(t),o=B(L(r),2),c=L(o),l=B(c,2);A(o),A(r);var f=B(r,2);Z(f,17,()=>W(i),e=>e.id,(e,t)=>{let r=N(()=>ea(W(t).id));var i=Ko();let o;var c=L(i),l=L(c),f=L(l);let p;var m=B(f,1,!0);A(l);var g=B(l,2),_=z(g,!0),y=B(g,2),b=L(y);Ee(),A(y);var x=B(y,2),S=z(x),C=B(x,2),w=z(C),T=B(C,2),E=L(T),ee=B(E,2),te=z(ee,!0),ne=B(ee,2);A(T);var re=B(T,2),ie=B(re,2),ae=e=>{var n=zo(),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)},oe=N(()=>!W(d)&&[`APPROVAL NEEDED`,`INPUT NEEDED`,`CHECK SESSION`].includes(W(t).status));Y(ie,e=>{W(oe)&&e(ae)}),A(c);var se=B(c,2),ce=e=>{var r=Wo(),i=L(r),o=L(i),c=z(o,!0),l=B(o,2),f=e=>{var n=Bo(),r=z(n,!0);V(e=>{Q(n,`href`,e),J(r,$.data?.control?`REVIEW IN FULL DETAIL ↗`:`APPROVAL IN CODEX ↗`)},[()=>`#/sessions/`+encodeURIComponent(W(t).id)]),q(e,n)};Y(l,e=>{!W(d)&&W(t).status===`APPROVAL NEEDED`&&e(f)}),A(i);var p=B(i,2);n(p,()=>W(t),()=>!1);var m=B(p,2);Z(m,17,()=>W(a).filter(e=>e.session===W(t).id),X,(e,n)=>{var r=Uo(),i=R(r),a=e=>{var t=Vo(),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),c=e=>{var n=Ho();V(e=>Q(n,`href`,e),[()=>`#/sessions/`+encodeURIComponent(W(t).id)+`?review=profile`]),G(`click`,n,e=>s(e,W(t).id)),q(e,n)};Y(o,e=>{W(n).pending&&e(c)}),q(e,r)});var h=B(m,2);{let e=N(()=>W(u)===W(t).id);yo(h,{get session(){return W(t)},get active(){return W(e)}})}A(r),V(()=>J(c,W(t).contextKind||`LAST ACTIVITY`)),q(e,r)};Y(se,e=>{W(r)>0&&e(ce)});var le=B(se,2),ue=e=>{var n=Go(),r=B(L(n),2);{let e=N(()=>(W(t).samples||[]).map(e=>e.tokens));Ka(r,{get values(){return W(e)},capacity:120})}var i=z(B(r,2));A(n),V(()=>J(i,`LAST ${(W(t).samples?.length||0)??``} SAMPLES // AUTO SCALE`)),q(e,n)};Y(le,e=>{W(r)<2&&e(ue)}),A(i),V((e,n,a)=>{o=li(i,1,`session-row`,null,o,{selected:W(u)===W(t).id,wide:W(r)===2,split:W(r)===1}),Q(i,`aria-label`,`Session `+(W(t).directory||W(t).id)),p=li(f,1,`lamp lit`,null,p,{working:W(t).status===`WORKING`&&!W(d)}),J(m,W(d)?`STALE`:W(t).status),Q(g,`aria-pressed`,W(u)===W(t).id),J(_,W(t).directory||W(t).id),J(b,`${e??``} `),J(S,`${W(t).agents??``} LINKED AGENTS`),J(w,`ACTIVE // ${n??``}`),E.disabled=W(r)===0,Q(ee,`aria-expanded`,W(r)>0),J(te,W(r)?`HIDE DETAIL`:`SHOW DETAIL`),Q(re,`href`,a)},[()=>ra(W(t).tokens),()=>ia(W(t).activity),()=>`#/sessions/`+encodeURIComponent(W(t).id)]),G(`click`,g,()=>h(W(t).id)),G(`click`,E,()=>v(W(t).id,-1)),G(`click`,ee,()=>{h(W(t).id),na(W(t).id,+!W(r))}),G(`click`,ne,()=>v(W(t).id,1)),G(`click`,re,()=>h(W(t).id)),q(e,i)});var p=B(f,2),m=e=>{q(e,qo())};Y(p,e=>{W(i).length||e(m)}),G(`click`,c,()=>ta(1)),G(`click`,l,()=>ta(0)),q(e,t)};Y(ce,e=>{r().id?e(le):e(ue,-1)}),V(e=>{J(C,`OBSERVED ${e??``}`),T=li(w,1,`session-totals`,null,T,{stale:W(d)}),J(ee,`${W(d)?`LAST KNOWN TOTALS — live state counts unavailable. `:``}Tokens + visible.

        `),Ao=K(` `),jo=K(` `),Mo=K(``),No=K(`

        Read only — reply or approve in Codex.

        `),Po=K(`

        `),Fo=K(`QUOTA THRESHOLD // REVIEW PROFILE ↗`),Io=K(`
        `),Lo=K(`
        `),Ro=K(`

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

        `),zo=K(`

        `),Bo=K(``),Vo=K(`

        `),Ho=K(` `),Uo=K(`

        `),Wo=K(`QUOTA THRESHOLD // REVIEW PROFILE ↗`),Go=K(` `,1),Ko=K(`

        `),qo=K(`

        TOKEN ACTIVITY // 30 SECOND SAMPLES

        `),Jo=K(`

        TOKENS

        FULL DETAIL →
        `),Yo=K(`

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

        `),Xo=K(`

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

        `,1),Zo=K(`

        SESSION TOTALS

        `,1);function Qo(e,t){qe(t,!0);let n=(e,t=f,n,r)=>{let i=yt(()=>g(n?.(),!0)),a=yt(()=>g(r?.(),!1));var o=Eo(),s=R(o),c=e=>{var n=bo();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)},[()=>b(t())]),q(e,n)},l=N(()=>b(t())&&(!W(a)||W(d)||t().status===`CHECK SESSION`));Y(s,e=>{W(l)&&e(c)});var u=B(s,2),p=e=>{var n=xo(),r=z(n,!0);V(()=>J(r,t().contextKind||`LAST ACTIVITY`)),q(e,n)};Y(u,e=>{W(i)&&e(p)});var m=B(u,2),h=z(m,!0),_=B(m,2),v=e=>{var n=wo(),r=B(R(n),2),i=z(r,!0),a=B(r,2),o=e=>{var n=So(),r=z(n,!0);V(()=>J(r,t().command)),q(e,n)},s=e=>{q(e,Co())};Y(a,e=>{t().command?e(o):e(s,-1)}),V(()=>J(i,W(d)||t().status!==`APPROVAL NEEDED`?`LAST OBSERVED COMMAND`:$.data?.control?`COMMAND REQUEST`:`COMMAND TO APPROVE IN CODEX`)),q(e,n)};Y(_,e=>{(!W(a)||!$.data?.control)&&(t().command||t().status===`APPROVAL NEEDED`)&&e(v)});var y=B(_,2),x=e=>{var n=To(),r=z(n);V(()=>J(r,`CONTEXT SOURCE // ${(t().source||`LOCAL`)??``} // OBSERVATION`)),q(e,n)};Y(y,e=>{W(a)||e(x)}),V(()=>J(h,t().text||`No session context available.`)),q(e,o)},r=zi(t,`params`,19,()=>({})),i=N(()=>$.data?.sessions||[]),a=N(()=>$.data?.control&&$.data.profiles||[]),o=F(!1);function s(e,t){if(r().id&&r().id!==t&&W(o)){e.preventDefault();return}h(t)}Sn(()=>{let e=r().id;e&&gr(()=>{Zi.selected=e,na(e,2)})});let c=N(()=>W(i).find(e=>e.id===r().id)),l=N(()=>new URLSearchParams(Ui.querystring).get(`review`)===`profile`&&W(a).some(e=>e.session===r().id&&e.pending)),u=N(()=>W(i).some(e=>e.id===Zi.selected)?Zi.selected:W(i)[0]?.id),d=N(()=>!$.connected||!!$.data?.sessionsError),p=N(()=>[[`OBSERVED TOKENS`,ra(W(i).reduce((e,t)=>e+t.tokens,0))],[`LISTED SESSIONS`,ra(W(i).length)],...[[`WORKING`,`WORKING`],[`AWAITING APPROVAL`,`APPROVAL NEEDED`],[`AWAITING INPUT`,`INPUT NEEDED`],[`CHECK · INFERRED`,`CHECK SESSION`]].map(([e,t])=>[e,W(d)?`—`:ra(W(i).filter(e=>e.status===t).length)])]),m=N(()=>W(i).filter(e=>[`INPUT NEEDED`,`APPROVAL NEEDED`,`CHECK SESSION`].includes(e.status)));function h(e){Zi.selected=e,pr().then(()=>document.querySelector(`.session-row.selected`)?.scrollIntoView({block:`nearest`}))}function v(e,t){if(h(e),r().id){t<0&&(na(e,2),location.hash=`/sessions`);return}let n=ea(e)+t;n>2?location.hash=`/sessions/`+encodeURIComponent(e):na(e,n)}function y(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(),v(r().id,-1);else if([`ArrowLeft`,`ArrowRight`].includes(e.key)&&(r().id||W(u)))e.preventDefault(),v(r().id||W(u),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(u));h(W(i)[Math.max(0,Math.min(W(i).length-1,t+(e.key===`ArrowUp`?-1:1)))].id)}}}function b(e){return W(d)?`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.`:``}var x=Zo();Tr(`keydown`,nn,y);var S=R(x),C=z(B(L(S),2));A(S);var w=B(S,2);let T;Z(w,21,()=>W(p),X,(e,t)=>{var n=N(()=>_(W(t),2));let r=()=>W(n)[0],i=()=>W(n)[1];var a=Do(),o=L(a),s=z(o,!0),c=z(B(o,2),!0);A(a),V(()=>{J(s,r()),J(c,i())}),q(e,a)}),A(w);var E=B(w,2),ee=z(E),D=B(E,2),te=e=>{q(e,Oo())};Y(D,e=>{W(d)&&e(te)});var ne=B(D,2),re=e=>{q(e,ko())};Y(ne,e=>{$.data?.profileError&&e(re)});var ie=B(ne,2),ae=e=>{var t=Mo(),n=L(t);Z(n,17,()=>W(m),X,(e,t)=>{var n=Ao();let r;var i=z(n);V((e,a)=>{r=li(n,1,`button`,null,r,{approval:W(t).status===`APPROVAL NEEDED`}),Q(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,()=>h(W(t).id)),q(e,n)}),Z(B(n,2),17,()=>W(a).filter(e=>e.pending&&W(i).some(t=>t.id===e.session)),X,(e,t)=>{var n=jo(),a=z(n);V((e,i,s)=>{Q(n,`title`,r().id&&r().id!==W(t).session&&W(o)?`Finish sending or clear your current draft before switching sessions.`:`Review this session’s quota threshold`),Q(n,`href`,e),J(a,`QUOTA THRESHOLD ${i??``} // ${s??``}`)},[()=>`#/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=>s(e,W(t).session)),q(e,n)}),A(t),q(e,t)},oe=N(()=>(W(m).length||W(a).some(e=>e.pending))&&!W(d));Y(ie,e=>{W(oe)&&e(ae)});var se=B(ie,2),ce=e=>{var t=Ir(),i=R(t),s=e=>{var t=Lo(),i=L(t),s=L(i),u=L(s);let f;var p=B(u);A(s);var m=B(s,2);A(i);var g=B(i,2),_=e=>{var t=To(),n=z(t,!0);V(()=>J(n,W(c).directory)),q(e,t)};Y(g,e=>{W(c).name&&W(c).directory&&e(_)});var v=B(g,2),y=z(v),b=B(v,2);let x;var S=L(b),C=L(S);n(C,()=>W(c),()=>!0,()=>!0),A(S);var w=B(S,2),T=e=>{var t=Ir();Jr(R(t),()=>W(c).id,e=>{_o(e,{get session(){return W(c).id},get observedCommand(){return W(c).command},get suspended(){return W(l)},onProtectedChange:e=>{I(o,e,!0)}})}),q(e,t)},E=e=>{q(e,No())};Y(w,e=>{$.data?.control?e(T):e(E,-1)}),A(b);var ee=B(b,2);Z(ee,17,()=>W(a).filter(e=>e.session===W(c).id),e=>e.session,(e,t)=>{var n=Io(),r=L(n),i=e=>{var n=Po(),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=>{_o(e,{get session(){return W(c).id},review:`profile`})},s=e=>{var t=Fo();V(e=>Q(t,`href`,e),[()=>`#/sessions/`+encodeURIComponent(W(c).id)+`?review=profile`]),q(e,t)};Y(a,e=>{W(t).pending&&W(l)?e(o):W(t).pending&&e(s,1)}),A(n),V(()=>Q(n,`id`,`quota-profile-`+W(c).id)),q(e,n)});var D=B(ee,2),te=e=>{var t=Ir();Jr(R(t),()=>W(c).id,e=>{yo(e,{get session(){return W(c)},active:!0})}),q(e,t)};Y(D,e=>{W(l)||e(te)}),A(t),V(e=>{f=li(u,1,`lamp lit`,null,f,{working:W(c).status===`WORKING`&&!W(d)}),J(p,`${(W(d)?`STALE`:W(l)?`QUOTA THRESHOLD`:W(c).status)??``} // ${(W(c).name||W(c).directory)??``}`),J(y,`${e??``} TOKENS // ${W(c).id??``} // CONTEXT SOURCE // ${(W(c).source||`LOCAL`)??``}`),x=di(b,``,x,{display:W(l)?`none`:void 0})},[()=>ra(W(c).tokens)]),G(`click`,m,()=>{h(r().id),na(r().id,2)}),q(e,t)},u=e=>{q(e,Ro())};Y(i,e=>{W(c)?e(s):e(u,-1)}),q(e,t)},le=e=>{var t=Xo(),r=R(t),o=B(L(r),2),c=L(o),l=B(c,2);A(o),A(r);var f=B(r,2);Z(f,17,()=>W(i),e=>e.id,(e,t)=>{let r=N(()=>ea(W(t).id));var i=Jo();let o;var c=L(i),l=L(c),f=e=>{var n=zo(),r=L(n),i=z(r);A(n),V(e=>{Q(r,`aria-pressed`,W(u)===W(t).id),J(i,`${e??``} // ${W(t).name??``}`)},[()=>Array.from(W(t).id).slice(-5).join(``).toUpperCase()]),G(`click`,r,()=>h(W(t).id)),q(e,n)};Y(l,e=>{W(t).name&&e(f)});var p=B(l,2),m=L(p),g=L(m);let _;var y=B(g,1,!0);A(m),A(p);var b=B(p,2),x=e=>{var n=Bo(),r=z(n,!0);V(()=>{Q(n,`aria-pressed`,W(u)===W(t).id),J(r,W(t).directory||W(t).id)}),G(`click`,n,()=>h(W(t).id)),q(e,n)};Y(b,e=>{W(t).name||e(x)});var S=B(b,2),C=L(S);Ee(),A(S);var w=B(S,2),T=e=>{var n=To(),r=z(n,!0);V(()=>J(r,W(t).directory)),q(e,n)};Y(w,e=>{W(t).name&&W(t).directory&&e(T)});var E=B(w,2),ee=z(E),D=B(E,2),te=z(D),ne=B(D,2),re=L(ne),ie=B(re,2),ae=z(ie,!0),oe=B(ie,2);A(ne);var se=B(ne,2),ce=B(se,2),le=e=>{var n=Vo(),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(d)&&[`APPROVAL NEEDED`,`INPUT NEEDED`,`CHECK SESSION`].includes(W(t).status));Y(ce,e=>{W(ue)&&e(le)}),A(c);var de=B(c,2),fe=e=>{var r=Ko(),i=L(r),o=L(i),c=z(o,!0),l=B(o,2),f=e=>{var n=Ho(),r=z(n,!0);V(e=>{Q(n,`href`,e),J(r,$.data?.control?`REVIEW IN FULL DETAIL ↗`:`APPROVAL IN CODEX ↗`)},[()=>`#/sessions/`+encodeURIComponent(W(t).id)]),q(e,n)};Y(l,e=>{!W(d)&&W(t).status===`APPROVAL NEEDED`&&e(f)}),A(i);var p=B(i,2);n(p,()=>W(t),()=>!1);var m=B(p,2);Z(m,17,()=>W(a).filter(e=>e.session===W(t).id),X,(e,n)=>{var r=Go(),i=R(r),a=e=>{var t=Uo(),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),c=e=>{var n=Wo();V(e=>Q(n,`href`,e),[()=>`#/sessions/`+encodeURIComponent(W(t).id)+`?review=profile`]),G(`click`,n,e=>s(e,W(t).id)),q(e,n)};Y(o,e=>{W(n).pending&&e(c)}),q(e,r)});var h=B(m,2);{let e=N(()=>W(u)===W(t).id);yo(h,{get session(){return W(t)},get active(){return W(e)}})}A(r),V(()=>J(c,W(t).contextKind||`LAST ACTIVITY`)),q(e,r)};Y(de,e=>{W(r)>0&&e(fe)});var pe=B(de,2),me=e=>{var n=qo(),r=B(L(n),2);{let e=N(()=>(W(t).samples||[]).map(e=>e.tokens));Ka(r,{get values(){return W(e)},capacity:120})}var i=z(B(r,2));A(n),V(()=>J(i,`LAST ${(W(t).samples?.length||0)??``} SAMPLES // AUTO SCALE`)),q(e,n)};Y(pe,e=>{W(r)<2&&e(me)}),A(i),V((e,n,a,s)=>{o=li(i,1,`session-row`,null,o,{selected:W(u)===W(t).id,wide:W(r)===2,split:W(r)===1}),Q(i,`aria-label`,`Session `+(W(t).name||W(t).directory||W(t).id)),Q(m,`href`,e),_=li(g,1,`lamp lit`,null,_,{working:W(t).status===`WORKING`&&!W(d)}),J(y,W(d)?`STALE`:W(t).status),J(C,`${n??``} `),J(ee,`${W(t).agents??``} LINKED AGENTS`),J(te,`ACTIVE // ${a??``}`),re.disabled=W(r)===0,Q(ie,`aria-expanded`,W(r)>0),J(ae,W(r)?`HIDE DETAIL`:`SHOW DETAIL`),Q(se,`href`,s)},[()=>`#/sessions/`+encodeURIComponent(W(t).id),()=>ra(W(t).tokens),()=>ia(W(t).activity),()=>`#/sessions/`+encodeURIComponent(W(t).id)]),G(`click`,m,()=>h(W(t).id)),G(`click`,re,()=>v(W(t).id,-1)),G(`click`,ie,()=>{h(W(t).id),na(W(t).id,+!W(r))}),G(`click`,oe,()=>v(W(t).id,1)),G(`click`,se,()=>h(W(t).id)),q(e,i)});var p=B(f,2),m=e=>{q(e,Yo())};Y(p,e=>{W(i).length||e(m)}),G(`click`,c,()=>ta(1)),G(`click`,l,()=>ta(0)),q(e,t)};Y(se,e=>{r().id?e(ce):e(le,-1)}),V(e=>{J(C,`OBSERVED ${e??``}`),T=li(w,1,`session-totals`,null,T,{stale:W(d)}),J(ee,`${W(d)?`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.`)},[()=>ia($.data?.sessionsAt)]),q(e,x),Je()}Er([`click`]);var Zo=864e5;function Qo(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 $o(e,t,n){let r=new Date(Date.UTC(e.getUTCFullYear(),e.getUTCMonth(),e.getUTCDate()));for(let e=0;;e++){let i=Qo(r,-t),a=new Date(i.getTime()+Zo);if(e===n)return{start:a,end:r};r=i}}var es=K(`

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

        `),ts=K(``),ns=K(`
        `),rs=K(`

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

        `,1),is=K(`
        `,1),as=K(` `),os=K(`

        LIFETIME TOKENS

        PEAK DAY

        CURRENT STREAK

        DAYS

        Accessible data table
        Date (UTC)Tokens

        `,1),ss=K(`

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

        `),cs=K(`

        USAGE // ACCOUNT HISTORY

        Account-wide history reported by Codex, not the local Sessions counter. Dates - use UTC. Historical resets are not provided by this data.

        `,1);function ls(e,t){qe(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}=$o(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=cs(),u=B(R(l),4),d=L(u),f=B(L(d)),p=L(f);p.value=p.__value=`daily`;var m=B(p);m.value=m.__value=`monthly`;var h=B(m);h.value=h.__value=`cumulative`,A(f),hi(f),A(d);var g=B(d),_=B(L(g)),v=L(_);v.value=v.__value=6;var y=B(v);y.value=y.__value=12,A(_),hi(_),A(g);var b=B(g),x=B(b);A(u);var S=B(u,2),C=e=>{q(e,es())};Y(S,e=>{$.data?.usageError&&e(C)});var w=B(S,2),T=e=>{var t=os(),r=R(t),i=L(r),l=z(B(L(i),2),!0);A(i);var u=B(i,2),d=z(B(L(u),2),!0);A(u);var f=B(u,2),p=B(L(f),2),m=L(p);Ee(),A(p),A(f),A(r);var h=B(r,2),g=L(h),_=z(g),v=B(g,2),y=e=>{var t=rs(),n=R(t),r=L(n),i=L(r);Z(i,17,()=>Array(W(s)),X,(e,t)=>{q(e,ts())}),Z(B(i,2),17,()=>W(a),X,(e,t)=>{var n=ns();let r,i;V(e=>{r=li(n,1,`heat-cell`,null,r,{zero:W(t).tokens===0}),Q(n,`title`,e),i=di(n,``,i,{opacity:W(t).tokens?.25+.75*W(t).tokens/W(o):1})},[()=>`${W(t).date}: ${ra(W(t).tokens)} tokens`]),q(e,n)}),A(r),A(n),Ee(2),q(e,t)},b=e=>{var t=is(),r=R(t);{let e=N(()=>W(c).map(e=>e.tokens)),t=N(()=>W(n)+` usage`);Ka(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);A(i),V(e=>{J(o,W(c)[0]?.date),J(s,e)},[()=>W(c).at(-1)?.date]),q(e,t)};Y(v,e=>{W(n)===`daily`?e(y):e(b,-1)});var x=B(v,2),S=B(L(x),2),C=L(S),w=B(L(C));Z(w,21,()=>W(n)===`daily`?W(a):W(c),X,(e,t)=>{var n=as(),r=L(n),i=z(r,!0),a=z(B(r),!0);A(n),V(e=>{J(i,W(t).date),J(a,e)},[()=>ra(W(t).tokens)]),q(e,n)}),A(w),A(C),A(S),A(x),A(h);var T=z(B(h,2));V((e,t,n,r,i)=>{J(l,e),J(d,t),J(m,`${n??``} `),J(_,`${W(a)[0]?.date??``} — ${r??``}`),J(T,`OBSERVED ${i??``} // CUMULATIVE IS FOR THE SELECTED PERIOD`)},[()=>ra($.data.usage.summary.lifetimeTokens),()=>ra($.data.usage.summary.peakDailyTokens),()=>ra($.data.usage.summary.currentStreakDays),()=>W(a).at(-1)?.date,()=>ia($.data.usageAt)]),q(e,t)},E=e=>{q(e,ss())};Y(w,e=>{$.data?.usage&&$.data.usage.dailyUsageBuckets!==null?e(T):e(E,-1)}),V(()=>x.disabled=W(i)===0),gi(f,()=>W(n),e=>I(n,e)),G(`change`,_,()=>I(i,0)),gi(_,()=>W(r),e=>I(r,e)),G(`click`,b,()=>Xt(i)),G(`click`,x,()=>Xt(i,-1)),q(e,l),Je()}Er([`change`,`click`]);var us=K(`

        Page not found

        Return to Quota

        `,1);function ds(e){var t=us();Ee(2),q(e,t)}var fs=K(` `),ps=K(`

        `),ms=K(`

        Connecting to your local Codexometer…

        `),hs=K(``),gs=K(`
        CODEXOMETER

        Your quota. Your sessions. Your command centre.

        `);function _s(e,t){qe(t,!0);let n={"/":Ua,"/quota/:view?":Ua,"/sessions/:id?":Xo,"/usage":ls,"*":ds},r={quota:/^(?:\/|\/quota(?:\/[^/]+)?\/?)$/,sessions:/^\/sessions(?:\/[^/]+)?\/?$/,usage:/^\/usage\/?$/},i=F(`hacker`),a=[`hacker`,`rust`,`blue-steel`,`ultraviolet`,`nightshade`];Sn(()=>{Qi()}),Sn(()=>{if($.data)for(let[e,t]of Object.entries(r))t.test(Ui.location)&&(Zi.tab=e)}),Bi(()=>{try{let e=localStorage.getItem(`codexometer.web.theme`);e&&a.includes(e)&&I(i,e,!0)}catch{}return la()});function o(){try{localStorage.setItem(`codexometer.web.theme`,W(i))}catch{}}var s=gs(),c=L(s),l=B(L(c),2),u=L(l);let d;var f=B(u,1,!0),p=z(B(f));A(l),A(c);var m=B(c,2);Z(m,21,()=>Object.entries(r),X,(e,t)=>{var n=N(()=>_(W(t),2));let r=()=>W(n)[0],i=()=>W(n)[1],a=N(()=>i().test(Ui.location));var o=fs();let s;var c=z(o,!0);V(e=>{Q(o,`href`,r()===`quota`?`#/quota/`+Zi.view:`#/`+r()),Q(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)}),A(m);var h=B(m,2),g=L(h),v=e=>{var t=ps(),n=z(t,!0);V(()=>J(n,$.error)),q(e,t)};Y(g,e=>{$.error&&e(v)});var y=B(g,2),b=e=>{Ki(e,{get routes(){return n}})},x=e=>{q(e,ms())};Y(y,e=>{$.data?e(b):$.error||e(x,1)}),A(h);var S=B(h,2),C=L(S),w=z(C),T=B(C,2),E=z(T,!0),ee=B(T,2),te=B(L(ee));Z(te,21,()=>a,X,(e,t)=>{var n=hs(),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)}),A(te),hi(te),A(ee),A(S),A(s),V(()=>{Q(s,`data-theme`,W(i)),d=li(u,1,`lamp`,null,d,{lit:$.connected}),J(f,$.connected?`CONNECTED`:`OFFLINE`),J(p,`EXPERIMENTAL // ${$.data?.control?`SESSION CONTROL`:`READ ONLY`}`),J(w,`v${($.data?.version||`…`)??``} // LOCAL ONLY`),J(E,$.data?.control?`Session control enabled. Stop the server to revoke access.`:`No actions can be sent from this preview.`)}),G(`change`,te,o),gi(te,()=>W(i),e=>I(i,e)),q(e,s),Je()}Er([`change`]),Hr(_s,{target:document.getElementById(`app`)}); \ No newline at end of file + list. History samples every 30 seconds. Not account-wide totals.`)},[()=>ia($.data?.sessionsAt)]),q(e,x),Je()}Er([`click`]);var $o=864e5;function es(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 ts(e,t,n){let r=new Date(Date.UTC(e.getUTCFullYear(),e.getUTCMonth(),e.getUTCDate()));for(let e=0;;e++){let i=es(r,-t),a=new Date(i.getTime()+$o);if(e===n)return{start:a,end:r};r=i}}var ns=K(`

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

        `),rs=K(``),is=K(`
        `),as=K(`

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

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

        LIFETIME TOKENS

        PEAK DAY

        CURRENT STREAK

        DAYS

        Accessible data table
        Date (UTC)Tokens

        `,1),ls=K(`

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

        `),us=K(`

        USAGE // ACCOUNT HISTORY

        Account-wide history reported by Codex, not the local Sessions counter. Dates + use UTC. Historical resets are not provided by this data.

        `,1);function ds(e,t){qe(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}=ts(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=us(),u=B(R(l),4),d=L(u),f=B(L(d)),p=L(f);p.value=p.__value=`daily`;var m=B(p);m.value=m.__value=`monthly`;var h=B(m);h.value=h.__value=`cumulative`,A(f),hi(f),A(d);var g=B(d),_=B(L(g)),v=L(_);v.value=v.__value=6;var y=B(v);y.value=y.__value=12,A(_),hi(_),A(g);var b=B(g),x=B(b);A(u);var S=B(u,2),C=e=>{q(e,ns())};Y(S,e=>{$.data?.usageError&&e(C)});var w=B(S,2),T=e=>{var t=cs(),r=R(t),i=L(r),l=z(B(L(i),2),!0);A(i);var u=B(i,2),d=z(B(L(u),2),!0);A(u);var f=B(u,2),p=B(L(f),2),m=L(p);Ee(),A(p),A(f),A(r);var h=B(r,2),g=L(h),_=z(g),v=B(g,2),y=e=>{var t=as(),n=R(t),r=L(n),i=L(r);Z(i,17,()=>Array(W(s)),X,(e,t)=>{q(e,rs())}),Z(B(i,2),17,()=>W(a),X,(e,t)=>{var n=is();let r,i;V(e=>{r=li(n,1,`heat-cell`,null,r,{zero:W(t).tokens===0}),Q(n,`title`,e),i=di(n,``,i,{opacity:W(t).tokens?.25+.75*W(t).tokens/W(o):1})},[()=>`${W(t).date}: ${ra(W(t).tokens)} tokens`]),q(e,n)}),A(r),A(n),Ee(2),q(e,t)},b=e=>{var t=os(),r=R(t);{let e=N(()=>W(c).map(e=>e.tokens)),t=N(()=>W(n)+` usage`);Ka(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);A(i),V(e=>{J(o,W(c)[0]?.date),J(s,e)},[()=>W(c).at(-1)?.date]),q(e,t)};Y(v,e=>{W(n)===`daily`?e(y):e(b,-1)});var x=B(v,2),S=B(L(x),2),C=L(S),w=B(L(C));Z(w,21,()=>W(n)===`daily`?W(a):W(c),X,(e,t)=>{var n=ss(),r=L(n),i=z(r,!0),a=z(B(r),!0);A(n),V(e=>{J(i,W(t).date),J(a,e)},[()=>ra(W(t).tokens)]),q(e,n)}),A(w),A(C),A(S),A(x),A(h);var T=z(B(h,2));V((e,t,n,r,i)=>{J(l,e),J(d,t),J(m,`${n??``} `),J(_,`${W(a)[0]?.date??``} — ${r??``}`),J(T,`OBSERVED ${i??``} // CUMULATIVE IS FOR THE SELECTED PERIOD`)},[()=>ra($.data.usage.summary.lifetimeTokens),()=>ra($.data.usage.summary.peakDailyTokens),()=>ra($.data.usage.summary.currentStreakDays),()=>W(a).at(-1)?.date,()=>ia($.data.usageAt)]),q(e,t)},E=e=>{q(e,ls())};Y(w,e=>{$.data?.usage&&$.data.usage.dailyUsageBuckets!==null?e(T):e(E,-1)}),V(()=>x.disabled=W(i)===0),gi(f,()=>W(n),e=>I(n,e)),G(`change`,_,()=>I(i,0)),gi(_,()=>W(r),e=>I(r,e)),G(`click`,b,()=>Xt(i)),G(`click`,x,()=>Xt(i,-1)),q(e,l),Je()}Er([`change`,`click`]);var fs=K(`

        Page not found

        Return to Quota

        `,1);function ps(e){var t=fs();Ee(2),q(e,t)}var ms=K(` `),hs=K(`

        `),gs=K(`

        Connecting to your local Codexometer…

        `),_s=K(``),vs=K(`
        CODEXOMETER

        Your quota. Your sessions. Your command centre.

        `);function ys(e,t){qe(t,!0);let n={"/":Ua,"/quota/:view?":Ua,"/sessions/:id?":Qo,"/usage":ds,"*":ps},r={quota:/^(?:\/|\/quota(?:\/[^/]+)?\/?)$/,sessions:/^\/sessions(?:\/[^/]+)?\/?$/,usage:/^\/usage\/?$/},i=F(`hacker`),a=[`hacker`,`rust`,`blue-steel`,`ultraviolet`,`nightshade`];Sn(()=>{Qi()}),Sn(()=>{if($.data)for(let[e,t]of Object.entries(r))t.test(Ui.location)&&(Zi.tab=e)}),Bi(()=>{try{let e=localStorage.getItem(`codexometer.web.theme`);e&&a.includes(e)&&I(i,e,!0)}catch{}return la()});function o(){try{localStorage.setItem(`codexometer.web.theme`,W(i))}catch{}}var s=vs(),c=L(s),l=B(L(c),2),u=L(l);let d;var f=B(u,1,!0),p=z(B(f));A(l),A(c);var m=B(c,2);Z(m,21,()=>Object.entries(r),X,(e,t)=>{var n=N(()=>_(W(t),2));let r=()=>W(n)[0],i=()=>W(n)[1],a=N(()=>i().test(Ui.location));var o=ms();let s;var c=z(o,!0);V(e=>{Q(o,`href`,r()===`quota`?`#/quota/`+Zi.view:`#/`+r()),Q(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)}),A(m);var h=B(m,2),g=L(h),v=e=>{var t=hs(),n=z(t,!0);V(()=>J(n,$.error)),q(e,t)};Y(g,e=>{$.error&&e(v)});var y=B(g,2),b=e=>{Ki(e,{get routes(){return n}})},x=e=>{q(e,gs())};Y(y,e=>{$.data?e(b):$.error||e(x,1)}),A(h);var S=B(h,2),C=L(S),w=z(C),T=B(C,2),E=z(T,!0),ee=B(T,2),D=B(L(ee));Z(D,21,()=>a,X,(e,t)=>{var n=_s(),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)}),A(D),hi(D),A(ee),A(S),A(s),V(()=>{Q(s,`data-theme`,W(i)),d=li(u,1,`lamp`,null,d,{lit:$.connected}),J(f,$.connected?`CONNECTED`:`OFFLINE`),J(p,`EXPERIMENTAL // ${$.data?.control?`SESSION CONTROL`:`READ ONLY`}`),J(w,`v${($.data?.version||`…`)??``} // LOCAL ONLY`),J(E,$.data?.control?`Session control enabled. Stop the server to revoke access.`:`No actions can be sent from this preview.`)}),G(`change`,D,o),gi(D,()=>W(i),e=>I(i,e)),q(e,s),Je()}Er([`change`]),Hr(ys,{target:document.getElementById(`app`)}); \ No newline at end of file diff --git a/internal/web/dist/assets/index-BF0PrFr9.css b/internal/web/dist/assets/index-dawColZR.css similarity index 69% rename from internal/web/dist/assets/index-BF0PrFr9.css rename to internal/web/dist/assets/index-dawColZR.css index 9f30cdf..0273ca3 100644 --- a/internal/web/dist/assets/index-BF0PrFr9.css +++ b/internal/web/dist/assets/index-dawColZR.css @@ -1 +1 @@ -.observation-details.svelte-1wk8llw{font-size:12px}summary.svelte-1wk8llw{cursor:pointer;color:var(--accent)}.observation-table.svelte-1wk8llw{max-height:240px;overflow:auto}.zone-canvas.svelte-1wk8llw{flex:1;min-height:170px;margin-top:6px;position:relative}svg.svelte-1wk8llw{width:100%;height:100%;display:block;position:absolute;inset:0}text.svelte-1wk8llw{fill:var(--ink);font:14px Cascadia Code,Consolas,monospace}.axis-title.svelte-1wk8llw{letter-spacing:.04em;font-size:12px}.grid.svelte-1wk8llw{stroke:#fff;stroke-opacity:.14;stroke-width:1px}.axes.svelte-1wk8llw{stroke:var(--ink);stroke-width:1.5px;fill:none}.pace-line.svelte-1wk8llw{stroke:#fff;stroke-width:2px;stroke-dasharray:6 4}.position-halo.svelte-1wk8llw{fill:#101820;stroke:#fff;stroke-width:1.5px}.position-dot.svelte-1wk8llw{fill:#fff}.observation-trail.svelte-1wk8llw{fill:none;stroke:#fff;stroke-width:2.5px;stroke-linejoin:round}.trail-start.svelte-1wk8llw{fill:none;stroke:#fff;stroke-width:2px}.trail-caption.svelte-1wk8llw{text-align:center;font-size:11px}.zone-caption.svelte-1wk8llw{color:var(--accent);text-align:center}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}button.svelte-1oupzfc{margin:.3rem .5rem .3rem 0}h3.svelte-1oupzfc,p.svelte-1oupzfc{margin-block:.4rem}.sent.svelte-1oupzfc{color:var(--accent)}.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)}: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}.brand{letter-spacing:.08em;color:var(--accent);text-shadow:0 0 22px color-mix(in srgb, var(--accent) 20%, transparent);font-size:clamp(22px,2.5vw,32px);font-weight:800;text-decoration:none}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{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{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}.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-card .pace{flex:1;height:auto;min-height:20px;margin:20px 14px 8px}.quota-card .readout{margin:6px 0;font-size:clamp(18px,2vw,28px)}.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)}.pace{background:linear-gradient(90deg, #6d3838, var(--edge) 50%, #376348);height:28px;margin:28px 14px 15px;position:relative}.pace-mid{border-left:2px solid var(--ink);height:100%;position:absolute;left:50%}.pace-marker{color:var(--accent);font-size:27px;position:absolute;top:-16px;transform:translate(-50%)}.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%}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}} +.observation-details.svelte-1wk8llw{font-size:12px}summary.svelte-1wk8llw{cursor:pointer;color:var(--accent)}.observation-table.svelte-1wk8llw{max-height:240px;overflow:auto}.zone-canvas.svelte-1wk8llw{flex:1;min-height:170px;margin-top:6px;position:relative}svg.svelte-1wk8llw{width:100%;height:100%;display:block;position:absolute;inset:0}text.svelte-1wk8llw{fill:var(--ink);font:14px Cascadia Code,Consolas,monospace}.axis-title.svelte-1wk8llw{letter-spacing:.04em;font-size:12px}.grid.svelte-1wk8llw{stroke:#fff;stroke-opacity:.14;stroke-width:1px}.axes.svelte-1wk8llw{stroke:var(--ink);stroke-width:1.5px;fill:none}.pace-line.svelte-1wk8llw{stroke:#fff;stroke-width:2px;stroke-dasharray:6 4}.position-halo.svelte-1wk8llw{fill:#101820;stroke:#fff;stroke-width:1.5px}.position-dot.svelte-1wk8llw{fill:#fff}.observation-trail.svelte-1wk8llw{fill:none;stroke:#fff;stroke-width:2.5px;stroke-linejoin:round}.trail-start.svelte-1wk8llw{fill:none;stroke:#fff;stroke-width:2px}.trail-caption.svelte-1wk8llw{text-align:center;font-size:11px}.zone-caption.svelte-1wk8llw{color:var(--accent);text-align:center}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}button.svelte-1oupzfc{margin:.3rem .5rem .3rem 0}h3.svelte-1oupzfc,p.svelte-1oupzfc{margin-block:.4rem}.sent.svelte-1oupzfc{color:var(--accent)}.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)}: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}.brand{letter-spacing:.08em;color:var(--accent);text-shadow:0 0 22px color-mix(in srgb, var(--accent) 20%, transparent);font-size:clamp(22px,2.5vw,32px);font-weight:800;text-decoration:none}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{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{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}.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-card .pace{flex:1;height:auto;min-height:20px;margin:20px 14px 8px}.quota-card .readout{margin:6px 0;font-size:clamp(18px,2vw,28px)}.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)}.pace{background:linear-gradient(90deg, #6d3838, var(--edge) 50%, #376348);height:28px;margin:28px 14px 15px;position:relative}.pace-mid{border-left:2px solid var(--ink);height:100%;position:absolute;left:50%}.pace-marker{color:var(--accent);font-size:27px;position:absolute;top:-16px;transform:translate(-50%)}.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 74cc3b5..2ae4273 100644 --- a/internal/web/dist/index.html +++ b/internal/web/dist/index.html @@ -5,8 +5,8 @@ Codexometer // Experimental web - - + +
        diff --git a/internal/web/state.go b/internal/web/state.go index 3def6ab..a1bc0e9 100644 --- a/internal/web/state.go +++ b/internal/web/state.go @@ -21,6 +21,7 @@ type Source interface { // Deliberately project source types: never serialize approval/input capabilities, // account fingerprints, arbitrary errors, or authentication objects to browsers. type session struct { + Name string `json:"name,omitempty"` ID string `json:"id"` Directory string `json:"directory"` Tokens int64 `json:"tokens"` @@ -306,7 +307,7 @@ func (s *store) live(l codex.LiveUsageSnapshot, err error, now time.Time) { text = row.Context.CommandDetails.Justification } s.state.Sessions = append(s.state.Sessions, session{ - ID: row.ID, Directory: row.WorkingDirectory, Tokens: row.TotalTokens, Agents: row.AgentCount, + ID: row.ID, Name: codex.SanitizeSessionContext(row.Name), Directory: row.WorkingDirectory, Tokens: row.TotalTokens, Agents: row.AgentCount, Status: sessionStatus(row), ContextKind: contextKind(row.Context.Kind), Text: text, Command: row.Context.CommandDetails.Command, Source: row.Context.Source, Activity: row.LastActivity, Samples: s.samples[row.ID], diff --git a/web/src/Sessions.svelte b/web/src/Sessions.svelte index 4e73afe..81436f0 100644 --- a/web/src/Sessions.svelte +++ b/web/src/Sessions.svelte @@ -210,7 +210,10 @@ class:approval={session.status === 'APPROVAL NEEDED'} href={'#/sessions/' + encodeURIComponent(session.id)} onclick={() => select(session.id)} - >{session.status} // {session.directory || session.id}{session.status} + {Array.from(session.id).slice(-5).join('').toUpperCase()} // {session.name || + session.directory || + session.id}{/each} {#each profiles.filter((p) => p.pending && sessions.some((s) => s.id === p.session)) as profile} openProfile(event, profile.session)} - >QUOTA THRESHOLD // {sessions.find((s) => s.id === profile.session) - ?.directory || profile.session}QUOTA THRESHOLD {Array.from(profile.session) + .slice(-5) + .join('') + .toUpperCase()} // {sessions.find((s) => s.id === profile.session) + ?.name || + sessions.find((s) => s.id === profile.session)?.directory || + profile.session} {/each} {/if} @@ -238,7 +246,7 @@ ? 'STALE' : profileFocused ? 'QUOTA THRESHOLD' - : selected.status} // {selected.directory} + : selected.status} // {selected.name || selected.directory} ← ALL SESSIONS + {#if selected.name && selected.directory}

        + {selected.directory} +

        {/if}
        + {#if session.name} +

        + +

        + {/if}

        - {stale ? 'STALE' : session.status} + select(session.id)} + > + {stale ? 'STALE' : session.status} +

        - + {#if !session.name}{/if}

        {number(session.tokens)} TOKENS

        + {#if session.name && session.directory}

        + {session.directory} +

        {/if}

        {session.agents} LINKED AGENTS

        ACTIVE // {date(session.activity)}

        diff --git a/web/src/state.svelte.ts b/web/src/state.svelte.ts index 9158aea..faac510 100644 --- a/web/src/state.svelte.ts +++ b/web/src/state.svelte.ts @@ -4,6 +4,7 @@ export interface Sample { tokens: number; } export interface Session { + name?: string; id: string; directory: string; tokens: number; diff --git a/web/src/style.css b/web/src/style.css index 0c66a41..e333266 100644 --- a/web/src/style.css +++ b/web/src/style.css @@ -417,6 +417,13 @@ a { overflow-wrap: anywhere; max-width: 100%; } +.status-detail { + color: inherit; + text-decoration: none; +} +.status-detail:hover { + text-decoration: underline; +} button:disabled { opacity: 0.4; cursor: default; diff --git a/web/tests/browser.spec.ts b/web/tests/browser.spec.ts index 6b7f564..67e43b4 100644 --- a/web/tests/browser.spec.ts +++ b/web/tests/browser.spec.ts @@ -193,6 +193,53 @@ test.describe('quota profile reviews', () => { }); }); +test('session names identify selectable telemetry and full detail', async ({ + page, + pairingURL, +}) => { + await mockStream(page, { + control: false, + sessionsAt: new Date().toISOString(), + meters: [], + credits: [], + sessions: [ + { + id: 'named-root', + name: 'Repair dashboard', + directory: '/work/dashboard', + tokens: 12, + agents: 0, + status: 'INPUT NEEDED', + contextKind: 'LAST REPLY', + text: 'Done', + command: '', + source: 'LOCAL', + activity: '', + samples: [], + }, + ], + }); + await page.goto(pairingURL); + await page.getByRole('link', { name: 'SESSIONS', exact: true }).click(); + const row = page.getByRole('region', { + name: 'Session Repair dashboard', + exact: true, + }); + await expect( + row.getByRole('heading', { name: '-ROOT // Repair dashboard' }), + ).toBeVisible(); + await expect(row.locator('.telemetry')).toContainText('/work/dashboard'); + await row.getByRole('button', { name: '-ROOT // Repair dashboard' }).click(); + await expect( + page.getByRole('navigation', { name: 'Sessions needing attention' }), + ).toContainText('INPUT NEEDED -ROOT // Repair dashboard'); + await row.getByRole('link', { name: 'INPUT NEEDED', exact: true }).click(); + await expect(page.locator('.detail-heading')).toContainText( + 'Repair dashboard', + ); + await expect(page.locator('.full-detail')).toContainText('/work/dashboard'); +}); + test('Thresholds navigation stays hidden without a launch policy', async ({ page, pairingURL,