diff --git a/CONTEXT.md b/CONTEXT.md index a32afdd3..a1136501 100644 --- a/CONTEXT.md +++ b/CONTEXT.md @@ -144,6 +144,19 @@ data, the Card carries only the shape. _Avoid_: surface (the protocol's word, and `surfaceId` in the code; in this glossary the rendered thing is a Card instance) +**Ephemeral Card**: +A Card generated within a **Chat**, kept in its history across restarts and available +for experimentation with the same capabilities as a catalogued Card. Its definition +enters the **Card catalog** only after the user explicitly saves it as a **Profile card**. +_Avoid_: unsaved Card (ambiguous with a failed file write), temporary Card (does not +say whether it is rendered or catalogued) + +**Card draft**: +One **Ephemeral Card** being iterated in a **Chat**, with its own identity and current +version. A Chat may contain several independent drafts; earlier versions remain in +history, and only the current version of each draft can be saved. +_Avoid_: active draft (there may be several), selected Card (no separate selection state) + **Card catalog**: The set of Cards the agent is offered — what it may render into. Resolved for one profile from the three card layers, minus whatever is **Disabled** or @@ -189,17 +202,19 @@ _Avoid_: **File reference** (the `@`-pointer into a message), **Mentioned in** ( backlink from a file to the conversations touching it) **Rich view** (the `rich-views` **Skill**): -The Bundled Skill the **Card catalog** is disclosed through. Its description is the only -A2UI text a turn carries at all, and names each Card's **topic** — the case it is ready -for; its body is the index of this profile's Cards and how to draw one; each Card is a -script of the Skill that draws it (ADR 0040); one Card's schema and worked call, and the -A2UI protocol at large, are resources read on demand. "Rich view" is what it is called where a user meets it, because the -switch is theirs: turned off, the profile is offered no Card and its turns carry no A2UI -runtime — while a Card instance already in a **Thread**, and a Card the server fills for -itself, go on drawing. +The Bundled **Skill** that discloses the **Card catalog** and lets the agent draw +instances of its available Cards. Turning it off stops new drawings through this +Skill; the independent **Card author**, historical instances and server-filled views +keep their own availability. _Avoid_: A2UI skill (the protocol's name, not the user's), Card skill (that is the Skill that *writes* Cards) +**Card author** (the `card-author` **Skill**): +The Bundled **Skill** for generating and revising **Ephemeral Cards** from the +**Card vocabulary**. It is enabled independently of **Rich view**; turning it off +prevents new authoring but leaves historical drafts available for explicit saving. +_Avoid_: Card skill, rich views (the rendered capability, not the authoring capability) + **Permissions**: The security policy of allowed commands (command-prefix and whole-tool grants). Commands only — folder access is the separate Folder/Grant system. Edited only by diff --git a/docs/adr/0042-card-drafts-live-in-chat-history-until-explicitly-saved.md b/docs/adr/0042-card-drafts-live-in-chat-history-until-explicitly-saved.md new file mode 100644 index 00000000..729360df --- /dev/null +++ b/docs/adr/0042-card-drafts-live-in-chat-history-until-explicitly-saved.md @@ -0,0 +1,29 @@ +--- +status: accepted +date: 2026-10-05 +--- + +# Card drafts live in Chat history until explicitly saved + +Issue #88 supports generating and revising an Ephemeral Card in the same Turn through +a separate bundled `card-author` MemorySkill. Persist its validated definition and +expanded A2UI surface in the Chat's event log, so rendering, iteration and saving survive +restart without changing the Turn's held Card catalog (ADR 0041). + +Each Chat can contain several Card drafts, each with a stable identity and one current +version; revisions append to history and supersede only the previous version of that +draft. Only current versions offer Save, which writes the definition as a Profile Card +after an explicit user request; current instance values remain in Chat history. +Restoring an older definition through conversation appends a new current version of +the same draft. Repeated saving under an occupied name uses the ordinary explicit +Replace / Save as copy choice, including when that draft was saved previously. + +This amends ADR 0036's file requirement for experimental definitions and ADR 0038's +single A2UI Skill boundary: `card-author` and `rich-views` have independent switches, +while Cards share vocabulary, validation, rendering and action semantics. Saving a +definition makes it available to future Turns through the existing Profile layer. + +We considered registering each experiment immediately and storing draft files in a +separate directory. Keeping drafts in the event log preserves the running catalog, +retains the exact view shown to the user and avoids orphaned draft files or a second +source of truth; repeated revision payloads grow with the Chat's history instead. diff --git a/docs/usage.md b/docs/usage.md index 22ebba3e..012e920b 100644 --- a/docs/usage.md +++ b/docs/usage.md @@ -95,6 +95,17 @@ fresh stream on demand — so conversations survive a gateway restart with compl context, not just a text transcript. This applies to **every** surface (web and all chat channels), keyed by chat id. +**Custom Cards.** Ask for a custom visual answer or template, then refine it in Chat. +The `card-author` Skill creates independent drafts with version history; experiments +stay in that Chat across restarts. Only the current version of each draft offers +**Save**. Choose its name and filename to save a reusable definition into the Profile's +`cards/` directory in Files. A name or filename collision requires **Replace** or +**Save as copy**; current instance values stay in Chat, separate from the saved worked +example. You can also explicitly ask the assistant to save or restore an earlier +version. Saved definitions become available on the next Turn, including in other +existing Chats. `card-author` and `rich-views` have independent switches in Settings; +turning authoring off preserves historical previews and their Save buttons. + Endpoints: ``` diff --git a/pyproject.toml b/pyproject.toml index 7a97e174..f241898d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -33,6 +33,7 @@ dependencies = [ "python-telegram-bot>=21.0", "discord.py>=2.4", "slack-bolt>=1.18", + "jsonschema>=4.26.0", ] [project.optional-dependencies] @@ -44,6 +45,7 @@ dev = [ "mypy>=2.3,<2.4", "types-PyYAML>=6.0", "pre-commit>=4.0.0", + "types-jsonschema>=4.26.0.20260518", ] # Provider client libraries not in the base install. # Opt-in: `pip install "ag2-assistant[ollama]"`. @@ -115,7 +117,7 @@ ignore-words-list = "ans,hsi,thur,unparseable,pre-empt,pre-selects,protext,padd, where = ["src"] [tool.setuptools.package-data] -"assistant" = ["skills/*/SKILL.md", "cards/bundled/*.card.yaml"] +"assistant" = ["skills/*/SKILL.md", "cards/bundled/*.card.yaml", "cards/VOCABULARY.md"] "assistant.gateway" = [ "static/*.html", "static/*.svg", diff --git a/src/assistant/agent.py b/src/assistant/agent.py index cc17d703..9c77f745 100644 --- a/src/assistant/agent.py +++ b/src/assistant/agent.py @@ -21,6 +21,7 @@ from assistant.a2ui import CardCatalog from assistant.a2ui_skill import A2UISkillRuntime +from assistant.card_author import CardAuthorRuntime from assistant.codex_auth import BACKEND_BASE, CodexAuth, default_headers from assistant.coding import acp_provider from assistant.config import Config, load_config @@ -299,11 +300,19 @@ def resolve_a2ui_skill(config: Config): return FilteredSkillRuntime(A2UISkillRuntime(CardCatalog(config)), _availability(config)) -def build_skills_plugin(config: Config, runtime, *, catalog=None, snapshot: bool = False): +def build_skills_plugin( + config: Config, runtime, *, catalog=None, snapshot: bool = False, drafts=None +): """Build progressive disclosure and activation tools over resolved Skill availability.""" + author = FilteredSkillRuntime( + CardAuthorRuntime(drafts, catalog or CardCatalog(config)), + _availability(config), + snapshot=snapshot, + ) if snapshot: runtime.invalidate() return SkillPlugin( + author, FilteredSkillRuntime( A2UISkillRuntime(catalog or CardCatalog(config)), _availability(config), @@ -311,7 +320,7 @@ def build_skills_plugin(config: Config, runtime, *, catalog=None, snapshot: bool ), FilteredSkillRuntime(runtime, _availability(config), snapshot=True), ) - return SkillPlugin(resolve_a2ui_skill(config), resolve_skills(config, runtime)) + return SkillPlugin(author, resolve_a2ui_skill(config), resolve_skills(config, runtime)) def build_skills_install_tools(config: Config, runtime) -> list: diff --git a/src/assistant/card_author.py b/src/assistant/card_author.py new file mode 100644 index 00000000..e4e9d8d9 --- /dev/null +++ b/src/assistant/card_author.py @@ -0,0 +1,143 @@ +"""The independently available Bundled Card author MemorySkill.""" + +import json +from collections.abc import Callable, Sequence +from dataclasses import replace +from pathlib import Path +from typing import Any + +from ag2.context import ConversationContext +from ag2.tools.skills import MemoryRuntime, MemorySkill +from ag2.tools.skills.skill_types import Resource, Script, Skill, SkillMetadata + +from assistant.a2ui_skill import _fields_from +from assistant.card_drafts import CardDrafts, DraftError +from assistant.cards import CardError +from assistant.cards.layout import PROPERTIES, primitive_schema + +CARD_AUTHOR = "card-author" +DESCRIPTION = "Create and refine a custom interactive Card in this Chat when the user requests a custom view or no available rich view fits. Save its reusable definition only on explicit request." +INSTRUCTIONS = """Prefer a suitable available Card from rich-views before authoring a custom one. +Read vocabulary.md and examples.md before authoring. Use the existing primitives, styling +words, bindings and repeated templates; never add CSS, JavaScript or backend handlers. +Gather factual values from the user's context and available tools; leave missing facts +absent and explain gaps. For a requested template only, clearly label example values as +illustrative. Definition.example is a worked example, separate from the current data. + +run_skill_script(name="card-author", script="draft_card", args={"definition": {...}, +"data": {...}, "title": "..."}) validates and draws in this same Turn. The definition has +name, description, fields (JSON schemas), required, layout, example and optional topic. +Errors draw nothing: repair the actual definition/data and retry. No file is created. + +To iterate, read drafts.md for the short index, then read_draft with draft_id and optional +version for the exact definition and current surface data. Target the intended draft from +conversation; ask when ambiguous. draft_card revises it with draft_id and expected_version. +Each draft is independent; revisions append to history and supersede only that draft. +restore_card takes draft_id, version (the earlier version), expected_version (current), and +optional schema-compatible data; it appends a new version. Input edits are instance changes. + +Save ONLY on a clear user request: save_card takes draft_id, expected_version, surface_id, +name, filename (a safe basename ending .card.yaml), and request_id (unique to this request). +For ambiguous target/name ask first. A free name saves directly. On conflict ask Replace or +Save as copy: Replace resubmits with replace=true and the returned conflict_token; a copy +needs a distinct name and filename and a new request_id. Never infer overwrite permission +from an earlier save. Current instance data stays in Chat history. Saved definitions become +available on future Turns. Finish with brief orientation; do not restate the entire view. +""" + + +def card_author_descriptor() -> Skill: + """The Bundled discovery entry used by Settings.""" + return Skill(metadata=SkillMetadata(name=CARD_AUTHOR, description=DESCRIPTION)) + + +class _CardAuthorSkill(MemorySkill): + """The author's discoverable resources and structured scripts.""" + + @property + def descriptor(self) -> Skill: + return replace( + super().descriptor, + resources=tuple( + Resource(name=name) for name in ("vocabulary.md", "examples.md", "drafts.md") + ), + scripts=tuple( + Script(name=name) + for name in ("draft_card", "read_draft", "restore_card", "save_card") + ), + ) + + +class CardAuthorRuntime(MemoryRuntime): + """Progressively disclose authoring references and context-scoped operations.""" + + def __init__(self, drafts: CardDrafts | None, catalog) -> None: + super().__init__( + _CardAuthorSkill( + name=CARD_AUTHOR, + description=DESCRIPTION, + instructions=INSTRUCTIONS, + ) + ) + self.drafts = drafts + self.catalog = catalog + + async def read(self, name: str, context: ConversationContext) -> str: + return f'{INSTRUCTIONS}' + + async def read_resource(self, name: str, resource: str, context: ConversationContext) -> str: + if resource == "vocabulary.md": + reference = (Path(__file__).parent / "cards" / "VOCABULARY.md").read_text() + schemas = {kind: primitive_schema(kind) for kind in PROPERTIES} + return ( + reference + + "\n\nValidated primitive properties:\n" + + json.dumps(schemas, ensure_ascii=False) + ) + if resource == "examples.md": + return json.dumps( + [ + { + "name": card.name, + "description": card.description, + "fields": card.fields, + "required": card.required, + "layout": card.layout, + "example": card.example, + } + for card in self.catalog.cards().values() + if card.name in {"Checklist", "DecisionMatrix"} + ], + ensure_ascii=False, + ) + if resource == "drafts.md" and self.drafts is not None: + return json.dumps(await self.drafts.index(context), ensure_ascii=False) + raise FileNotFoundError(resource) + + async def execute( + self, + name: str, + script: str, + context: ConversationContext, + args: dict[str, Any] | Sequence[str] | None = None, + ) -> str: + if self.drafts is None: + return "Card author requires a durable Chat history." + values = _fields_from(args) + if values is None: + return "Not applied: pass a JSON object of named arguments." + operations: dict[str, Callable] = { + "draft_card": self.drafts.draft, + "read_draft": self.drafts.read, + "restore_card": self.drafts.restore, + } + if script == "save_card": + operations[script] = self.drafts.save + operation = operations.get(script) + if operation is None: + raise FileNotFoundError(script) + try: + result = await operation(context, **values) + return json.dumps(result, ensure_ascii=False) + except (CardError, DraftError, TypeError, OSError) as exc: + return f"Not applied: {exc}" diff --git a/src/assistant/card_drafts.py b/src/assistant/card_drafts.py new file mode 100644 index 00000000..85d2aa0e --- /dev/null +++ b/src/assistant/card_drafts.py @@ -0,0 +1,313 @@ +"""Card draft operations over a Chat's durable event history.""" + +import asyncio +import hashlib +import json +import os +import tempfile +import uuid +from collections.abc import Callable + +import yaml +from ag2.context import ConversationContext + +from assistant.a2ui import ( + CARD_VOCABULARY, + _AssistantA2UIRuntime, + card_layers, + durable_surfaces_from_messages, +) +from assistant.a2ui_skill import _card_messages +from assistant.cards import ( + CARD_SUFFIX, + CARDS_DIR, + FILE_BUDGET, + CardError, + expand_card_messages, + load_cards, + validate_card, + validate_card_data, +) +from assistant.events import A2UISurfaceDataUpdated, CardDefinitionSaved, EphemeralCard +from assistant.state_store import ORIGIN_PROFILE +from assistant.workspace import _inside, etag_for_path, invalid_dir_name, slugify, write_text + + +class DraftError(ValueError): + """A draft reference or mutation that cannot be applied.""" + + +class CardDrafts: + """Serialize definition mutations while deriving all draft state from history.""" + + def __init__(self, config: Callable, history: Callable, commit: Callable) -> None: + self.config = config + self.history = history + self.commit = commit + self.lock = asyncio.Lock() + + async def versions(self, context: ConversationContext) -> list[EphemeralCard]: + return [event for event in await self.history(context) if isinstance(event, EphemeralCard)] + + async def index(self, context: ConversationContext) -> list[dict]: + current = {event.draft_id: event for event in await self.versions(context)} + return [ + { + "draft_id": event.draft_id, + "version": event.draft_version, + "surface_id": event.surface_id, + "name": event.definition["name"], + "title": event.title, + } + for event in current.values() + ] + + async def read(self, context: ConversationContext, draft_id: str, version: int | None = None): + matches = [event for event in await self.versions(context) if event.draft_id == draft_id] + if version is not None: + matches = [event for event in matches if event.draft_version == version] + if not matches: + raise DraftError("Draft/version not found in this Chat") + event = matches[-1] + result = event.to_dict() + for update in await self.history(context): + if isinstance(update, A2UISurfaceDataUpdated) and update.surface_id == event.surface_id: + result["data"] = update.data + return result + + async def current(self, context, draft_id: str, expected_version: int, surface_id=""): + event = await self.read(context, draft_id) + if event["draft_version"] != expected_version or ( + surface_id and event["surface_id"] != surface_id + ): + raise DraftError("Obsolete draft version; read the current version before retrying") + return event + + async def draft( + self, + context: ConversationContext, + definition: dict, + data: dict, + *, + draft_id: str = "", + expected_version: int | None = None, + title: str = "", + ) -> dict: + card = validate_card(definition, CARD_VOCABULARY) + if card.name in CARD_VOCABULARY: + raise CardError("Card name must differ from a primitive name") + validate_card_data(card.fields, card.required, data) + runtime = _AssistantA2UIRuntime({card.name: card}) + messages = _card_messages(card, data) + checked = runtime.parser.validate(messages) + if not checked.is_valid: + raise CardError("; ".join(checked.errors)) + surface = durable_surfaces_from_messages(expand_card_messages(messages, runtime.cards))[0] + async with self.lock: + version = 1 + if draft_id: + if expected_version is None: + raise DraftError("A revision needs its expected_version") + await self.current(context, draft_id, expected_version) + version = expected_version + 1 + elif expected_version is not None: + raise DraftError("expected_version needs a draft_id") + event = EphemeralCard( + surface.surface_id, + component=surface.component, + data=surface.data, + title=title or surface.title, + intent="card-draft", + draft_id=draft_id or f"draft-{uuid.uuid4().hex}", + draft_version=version, + definition=json.loads(json.dumps(definition)), + ) + await self.commit(context, event) + return {"draft_id": event.draft_id, "version": version, "surface_id": event.surface_id} + + async def restore(self, context, draft_id: str, version: int, expected_version: int, data=None): + old = await self.read(context, draft_id, version) + return await self.draft( + context, + old["definition"], + old["data"] if data is None else data, + draft_id=draft_id, + expected_version=expected_version, + title=old["title"], + ) + + async def save( + self, + context: ConversationContext, + draft_id: str, + expected_version: int, + surface_id: str, + name: str, + filename: str = "", + request_id: str = "", + replace: bool = False, + conflict_token: str = "", + ) -> dict: + if not isinstance(name, str) or not name.strip(): + raise DraftError("Enter a Card name") + name = name.strip() + filename = filename or f"{slugify(name, default='card')}{CARD_SUFFIX}" + if invalid_dir_name(filename) or not filename.endswith(CARD_SUFFIX): + raise DraftError("Use a safe filename ending .card.yaml") + if not request_id or len(request_id) > 200: + raise DraftError( + "Save needs a stable request_id; reuse it only when retrying that Save" + ) + async with self.lock: + event = await self.read(context, draft_id, expected_version) + if event["surface_id"] != surface_id: + raise DraftError("Surface does not match this draft version") + definition = {**event["definition"], "name": name} + card = validate_card(definition, CARD_VOCABULARY) + if card.name in CARD_VOCABULARY: + raise DraftError("Card name must differ from a primitive name") + config = self.config() + root = config.workspace_dir.resolve() + rel = f"{CARDS_DIR}/{filename}" + path = _inside(root, rel) + if path is None or path.is_symlink(): + raise DraftError("Card destination escapes this Profile's Files space") + receipt = hashlib.sha256( + json.dumps( + [ + str(context.stream.id), + draft_id, + expected_version, + request_id, + rel, + definition, + ], + sort_keys=True, + ensure_ascii=False, + ).encode() + ).hexdigest() + content = f"# card-author-save: {receipt}\n" + yaml.safe_dump( + definition, + sort_keys=False, + allow_unicode=True, + ) + if len(content.encode()) > FILE_BUDGET: + raise CardError( + f"Saved definition exceeds {FILE_BUDGET} bytes; simplify the layout" + ) + retry = path.is_file() and path.read_bytes() == content.encode() + if not retry: + await self.current(context, draft_id, expected_version, surface_id) + conflict, token, profile_match, occupied, base_token = _destination( + config, path, rel, name + ) + if conflict and (not replace or conflict_token != token): + message = "Name or filename is occupied. Choose Replace or Save as copy." + if profile_match and profile_match != path: + message += f" To replace this Profile Card, use {profile_match.name}." + return _conflict(name, rel, token, message) + if profile_match is not None and profile_match != path: + raise DraftError( + f"Replace this Profile Card at its existing filename: {profile_match.name}" + ) + if occupied and not path.is_file(): + raise DraftError("The destination is not a file") + path.parent.mkdir(parents=True, exist_ok=True) + if occupied: + status, _ = write_text(root, rel, content, base_token=base_token) + if status == "conflict": + _, fresh_token, _, _, _ = _destination(config, path, rel, name) + return _conflict( + name, + rel, + fresh_token, + "Destination changed. Choose Replace or Save as copy again.", + ) + if status != "ok": + raise OSError(f"Card write failed: {status}; previous file preserved") + else: + try: + _create_atomic(path, content.encode()) + except FileExistsError: + _, fresh_token, _, _, _ = _destination(config, path, rel, name) + return _conflict( + name, + rel, + fresh_token, + "Destination was created. Choose Replace or Save as copy.", + ) + recorded = False + message = "" + try: + recorded = any( + isinstance(item, CardDefinitionSaved) + and item.request_id == request_id + and item.path == rel + and item.draft_id == draft_id + for item in await self.history(context) + ) + if not recorded: + await self.commit( + context, + CardDefinitionSaved( + draft_id, + draft_version=expected_version, + name=name, + path=rel, + request_id=request_id, + ), + ) + recorded = True + except Exception as exc: + message = f"Saved {rel}; history status could not be recorded: {exc}. Retry the same request to reconcile." + return { + "status": "saved", + "name": name, + "path": rel, + "conflict_token": "", + "history_recorded": recorded, + "message": message, + } + + +def _destination(config, path, rel: str, name: str) -> tuple: + """Fingerprint name and file collisions in all ordinary Card layers.""" + collisions = [] + profile_match = None + for origin, directory in card_layers(config): + for other in load_cards(directory, CARD_VOCABULARY, origin).values(): + if other.name == name and other.path is not None: + collisions.append([str(other.path), etag_for_path(other.path)]) + if origin == ORIGIN_PROFILE: + profile_match = other.path.resolve() + occupied = path.exists() + base_token = etag_for_path(path) + token = hashlib.sha256( + json.dumps([rel, name, collisions, occupied, base_token], sort_keys=True).encode() + ).hexdigest() + return bool(collisions or occupied), token, profile_match, occupied, base_token + + +def _conflict(name: str, rel: str, token: str, message: str) -> dict: + """A collision decision bound to the currently observed destination.""" + return { + "status": "conflict", + "name": name, + "path": rel, + "conflict_token": token, + "history_recorded": False, + "message": message, + } + + +def _create_atomic(path, data: bytes) -> None: + """Create a complete file without replacing a destination created concurrently.""" + fd, temporary = tempfile.mkstemp(dir=path.parent, prefix=".card-") + try: + with os.fdopen(fd, "wb") as output: + output.write(data) + output.flush() + os.fsync(output.fileno()) + os.link(temporary, path) + finally: + os.unlink(temporary) diff --git a/src/assistant/cards/__init__.py b/src/assistant/cards/__init__.py index e3244e46..d88e9c14 100644 --- a/src/assistant/cards/__init__.py +++ b/src/assistant/cards/__init__.py @@ -16,7 +16,11 @@ from typing import Any import yaml +from jsonschema import Draft202012Validator +from jsonschema.exceptions import SchemaError, ValidationError +from referencing.exceptions import Unresolvable +from assistant.cards.layout import validate_primitive from assistant.state_store import ORIGIN_GLOBAL, StateStore logger = logging.getLogger(__name__) @@ -156,8 +160,28 @@ def _read_card(path: Path, components: frozenset[str], origin: str) -> Card: raw = yaml.safe_load(path.read_text()) except (OSError, yaml.YAMLError) as exc: raise CardError(f"unreadable: {exc}") from exc + return validate_card(raw, components, path=path, origin=origin) + + +def validate_card( + raw: Any, + components: Iterable[str] = (), + *, + path: Path | None = None, + origin: str = ORIGIN_GLOBAL, +) -> Card: + """Validate a file or in-memory definition using the same Card rules.""" + try: + size = len(json.dumps(raw, ensure_ascii=False).encode()) + except (TypeError, ValueError) as exc: + raise CardError(f"definition must be JSON-compatible: {exc}") from exc + if size > FILE_BUDGET: + raise CardError(f"definition is {size} bytes, over {FILE_BUDGET}") if not isinstance(raw, dict): raise CardError("not a YAML mapping") + for key in ("name", "description", "topic"): + if key in raw and not isinstance(raw[key], str): + raise CardError(f"{key} must be text") name = str(raw.get("name") or "").strip() description = str(raw.get("description") or "").strip() if not name: @@ -172,7 +196,12 @@ def _read_card(path: Path, components: frozenset[str], origin: str) -> Card: fields = raw.get("fields") if not isinstance(fields, dict) or not fields: raise CardError("no fields") - required = tuple(str(key) for key in raw.get("required") or ()) + if reserved := set(fields) & {"id", "component", "accessibility", "type"}: + raise CardError(f"fields use reserved component metadata: {', '.join(sorted(reserved))}") + required_raw = raw.get("required", []) + if not isinstance(required_raw, list) or any(not isinstance(key, str) for key in required_raw): + raise CardError("required must be a list of field names") + required = tuple(required_raw) if unknown := [key for key in required if key not in fields]: raise CardError(f"required names fields the Card does not declare: {', '.join(unknown)}") example = raw.get("example") @@ -184,12 +213,13 @@ def _read_card(path: Path, components: frozenset[str], origin: str) -> Card: raise CardError(f"example omits required fields: {', '.join(missing)}") if (size := len(json.dumps(example, separators=(",", ":")))) > EXAMPLE_BUDGET: raise CardError(f"example is {size} characters, over {EXAMPLE_BUDGET}") + validate_card_data(fields, required, example, label="example") return Card( name=name, description=description, fields=dict(fields), required=required, - layout=_layout(raw.get("layout"), components), + layout=_layout(raw.get("layout"), frozenset(components)), example=dict(example), topic=topic, path=path, @@ -197,6 +227,28 @@ def _read_card(path: Path, components: frozenset[str], origin: str) -> Card: ) +def validate_card_data(fields: dict, required: tuple[str, ...], data: Any, *, label="data") -> None: + """Validate instance values or a worked example against the declared fields.""" + schema = { + "type": "object", + "properties": fields, + "required": list(required), + "additionalProperties": False, + } + for keyword in ("$ref", "$dynamicRef"): + for ref in _values_for(fields, keyword): + if not isinstance(ref, str) or not ref.startswith("#"): + raise CardError("fields may reference only local schemas") + try: + Draft202012Validator.check_schema(schema) + Draft202012Validator(schema).validate(data) + except (SchemaError, ValidationError) as exc: + at = "/".join(str(part) for part in exc.absolute_path) + raise CardError(f"{label} {at}: {exc.message}") from exc + except Unresolvable as exc: + raise CardError(f"invalid fields reference: {exc}") from exc + + def _layout(raw: Any, components: frozenset[str]) -> tuple[dict[str, Any], ...]: """The layout's components, checked for unique ids and resolvable references.""" if not isinstance(raw, list) or not raw: @@ -219,12 +271,64 @@ def _layout(raw: Any, components: frozenset[str]) -> tuple[dict[str, Any], ...]: raise CardError(f"layout has no {LAYOUT_ROOT!r} component to be rooted at") known = set(ids) for node in nodes: + try: + validate_primitive(node) + except ValueError as exc: + raise CardError(str(exc)) from exc for reference in _references(node): if reference not in known: raise CardError(f"layout references unknown id {reference!r}") + _binding_scopes({node["id"]: node for node in nodes}) return tuple(nodes) +def _values_for(value: Any, key: str): + """Yield values of a named property throughout a JSON tree.""" + if isinstance(value, dict): + for name, item in value.items(): + if name == key: + yield item + yield from _values_for(item, key) + elif isinstance(value, list): + for item in value: + yield from _values_for(item, key) + + +def _binding_scopes(nodes: dict[str, dict]) -> None: + """Check bindings in their inherited repeated-item or Table-template scope.""" + visited: set[tuple[str, bool]] = set() + + def visit(node_id: str, scoped: bool, ancestors: frozenset[str]) -> None: + if len(ancestors) >= 24: + raise CardError("layout exceeds the renderer's maximum depth of 24") + if node_id in ancestors: + raise CardError(f"cyclic layout reference at {node_id!r}") + if (node_id, scoped) in visited: + return + visited.add((node_id, scoped)) + node = nodes[node_id] + unscoped_properties = { + key: value + for key, value in node.items() + if not (node["component"] == "Table" and key in {"cells", "key", "win"}) + } + if not scoped and any( + isinstance(path, str) and path.startswith(".") + for path in _values_for(unscoped_properties, "path") + ): + raise CardError(f"relative binding outside a template scope in {node_id!r}") + children = node.get("children") + repeated = children.get("componentId") if isinstance(children, dict) else None + templates = {node.get(key) for key in TEMPLATE_IDS.get(node["component"], ())} + for ref in _references(node): + visit(ref, scoped or ref == repeated or ref in templates, ancestors | {node_id}) + + visit(LAYOUT_ROOT, False, frozenset()) + for node_id in nodes: + if not any(key[0] == node_id for key in visited): + visit(node_id, False, frozenset()) + + def _references(node: dict[str, Any]) -> list[str]: """The layout ids one component names: its child, its children, or its templates.""" children = node.get("children") diff --git a/src/assistant/cards/bundled/codingsession.card.yaml b/src/assistant/cards/bundled/codingsession.card.yaml index 4184f8f9..2ddb790b 100644 --- a/src/assistant/cards/bundled/codingsession.card.yaml +++ b/src/assistant/cards/bundled/codingsession.card.yaml @@ -140,7 +140,7 @@ layout: - {id: foot_block, component: Column, gap: sm, when: {path: /summary}, children: [rule_foot, foot]} - {id: rule_foot, component: Divider} - {id: foot, component: Row, justify: between, gap: md, children: [foot_source, foot_agent]} - - {id: foot_source, component: Text, text: From the coding agent — the working-tree diff, not a plan, variant: caption, tone: muted} + - {id: foot_source, component: Text, text: "From the coding agent — the working-tree diff, not a plan", variant: caption, tone: muted} - {id: foot_agent, component: Text, text: {path: /agent}, variant: caption, tone: muted} example: diff --git a/src/assistant/cards/layout.py b/src/assistant/cards/layout.py new file mode 100644 index 00000000..766d331d --- /dev/null +++ b/src/assistant/cards/layout.py @@ -0,0 +1,199 @@ +"""Validation schemas for the primitives and styling words drawn by the renderer.""" + +from typing import Any + +from jsonschema import Draft202012Validator +from jsonschema.exceptions import ValidationError + +BINDING = { + "type": "object", + "properties": {"path": {"type": "string"}, "map": {"type": "object"}}, + "required": ["path"], + "additionalProperties": False, +} +TEXT = {"anyOf": [{"type": "string"}, BINDING]} +NUMBER = {"anyOf": [{"type": "number"}, BINDING]} +ARRAY = {"anyOf": [{"type": "array"}, BINDING]} +VALUE: dict[str, Any] = {} +REFERENCE = {"type": "string", "minLength": 1} +CHILDREN = { + "anyOf": [ + {"type": "array", "items": REFERENCE}, + { + "type": "object", + "properties": { + "componentId": REFERENCE, + "path": {"type": "string"}, + "start": {"type": "integer", "minimum": 0}, + }, + "required": ["componentId", "path"], + "additionalProperties": False, + }, + ] +} +PROPERTIES: dict[str, dict[str, Any]] = { + "Card": {"child": REFERENCE, "variant": {"enum": ["feature"]}}, + "Column": {"children": CHILDREN}, + "Row": {"children": CHILDREN}, + "List": {"children": CHILDREN, "variant": {"enum": ["ranked"]}}, + "Divider": {}, + "Text": { + "text": TEXT, + "variant": { + "enum": [ + "h1", + "h2", + "h3", + "h4", + "body", + "caption", + "eyebrow", + "quote", + "pill", + "badge", + "code", + ] + }, + "format": {"enum": ["time", "ago", "datetime"]}, + "map": {"type": "object"}, + }, + "Metric": { + "value": NUMBER, + "unit": TEXT, + "label": TEXT, + "delta": NUMBER, + "deltaPercent": NUMBER, + }, + "Sparkline": {"values": ARRAY}, + "Link": { + "child": REFERENCE, + **{key: TEXT for key in ("task", "chat", "file", "folder", "url")}, + }, + "Figure": {"url": TEXT, "description": TEXT, "caption": TEXT}, + "WeatherGlyph": {"condition": TEXT, "temperature": NUMBER}, + "Diff": {"hunks": TEXT}, + "Icon": {"name": TEXT, "map": {"type": "object"}}, + "Image": { + "url": TEXT, + "description": TEXT, + "fit": {"enum": ["contain", "cover", "fill", "none", "scaleDown"]}, + "variant": { + "enum": ["icon", "avatar", "smallFeature", "mediumFeature", "largeFeature", "header"] + }, + }, + "Video": {"url": TEXT, "posterUrl": TEXT}, + "Button": { + "child": REFERENCE, + "variant": {"enum": ["primary", "borderless"]}, + "action": { + "type": "object", + "properties": { + "event": { + "type": "object", + "properties": {"name": REFERENCE, "context": {"type": "object"}}, + "required": ["name"], + "additionalProperties": False, + } + }, + "required": ["event"], + "additionalProperties": False, + }, + }, + "CheckBox": {"label": TEXT, "value": {"anyOf": [{"type": "boolean"}, BINDING]}}, + "TextField": { + "label": TEXT, + "value": VALUE, + "placeholder": TEXT, + "variant": {"enum": ["shortText", "longText", "number", "obscured"]}, + }, + "ChoicePicker": { + "label": TEXT, + "value": ARRAY, + "options": ARRAY, + "variant": {"enum": ["mutuallyExclusive", "multipleSelection"]}, + "displayStyle": {"enum": ["checkbox", "chips"]}, + }, + "Slider": { + "label": TEXT, + "value": NUMBER, + "min": {"type": "number"}, + "max": {"type": "number"}, + "steps": {"type": "number", "exclusiveMinimum": 0}, + }, + "DateTimeInput": { + "label": TEXT, + "value": TEXT, + "enableDate": {"type": "boolean"}, + "enableTime": {"type": "boolean"}, + "min": TEXT, + "max": TEXT, + }, + "Table": { + **{key: BINDING for key in ("columns", "rows", "cells", "key")}, + **{key: VALUE for key in ("win", "pick")}, + **{key: REFERENCE for key in ("header", "lead", "cell")}, + }, +} +REQUIRED = { + "Card": ["child"], + "Column": ["children"], + "Row": ["children"], + "List": ["children"], + "Text": ["text"], + "Button": ["child", "action"], + "Icon": ["name"], + "Image": ["url"], + "Video": ["url"], + "Link": ["child"], + "Slider": ["max"], + "ChoicePicker": ["options"], +} + + +def primitive_schema(kind: str) -> dict: + """The supported properties of one renderer primitive.""" + properties = { + "id": REFERENCE, + "component": {"const": kind}, + "grow": {"type": "boolean"}, + "when": VALUE, + "accessibility": {"type": "object"}, + **PROPERTIES[kind], + } + if kind in {"Column", "Row", "List", "Card", "Text", "Metric", "Icon", "Sparkline"}: + properties["tone"] = { + "anyOf": [{"enum": ["neutral", "muted", "accent", "positive", "negative"]}, BINDING] + } + if kind in {"Column", "Row", "List", "Card"}: + properties["marker"] = TEXT + if kind in {"Text", "Divider"}: + properties["emphasis"] = {"enum": ["strong"]} + if kind in {"Metric", "Sparkline", "Icon", "Figure", "WeatherGlyph"}: + properties["size"] = {"enum": ["sm", "md", "lg"]} + if kind in {"Column", "Row", "List"}: + properties.update( + { + "gap": {"enum": ["none", "xs", "sm", "md", "lg"]}, + "align": {"enum": ["start", "center", "end", "stretch"]}, + "justify": {"enum": ["start", "center", "end", "between"]}, + } + ) + if kind == "Metric": + properties["align"] = {"enum": ["start", "end"]} + return { + "type": "object", + "properties": properties, + "required": ["id", "component", *REQUIRED.get(kind, [])], + "additionalProperties": False, + } + + +def validate_primitive(node: dict) -> None: + """Reject properties the renderer cannot draw or interpret.""" + kind = node["component"] + if kind not in PROPERTIES: + return + try: + Draft202012Validator(primitive_schema(kind)).validate(node) + except ValidationError as exc: + raise ValueError(f"layout {node['id']!r}: {exc.message}") from exc diff --git a/src/assistant/events.py b/src/assistant/events.py index 4ab95d39..caa4c480 100644 --- a/src/assistant/events.py +++ b/src/assistant/events.py @@ -84,6 +84,24 @@ class A2UISurface(AssistantEvent): intent: str = "" +class EphemeralCard(A2UISurface): + """One durable definition revision and its expanded interactive surface.""" + + draft_id: str = "" + draft_version: int = 1 + definition: dict = Field(default_factory=dict) + + +class CardDefinitionSaved(AssistantEvent): + """A draft definition was saved as a reusable Profile Card.""" + + draft_id: str = Field(kw_only=False) + draft_version: int = 1 + name: str = "" + path: str = "" + request_id: str = "" + + class A2UISurfaceDataUpdated(AssistantEvent): """Durable data-model snapshot emitted after an A2UI server action.""" diff --git a/src/assistant/gateway/app.py b/src/assistant/gateway/app.py index 326057bf..1fc0e523 100644 --- a/src/assistant/gateway/app.py +++ b/src/assistant/gateway/app.py @@ -139,6 +139,7 @@ ) from assistant.gateway.routes import ( acp, + card, chat, connection, file, @@ -508,6 +509,7 @@ async def favicon_ico(): # task-scoped permission pair — in its own module because a module follows its # zod twin (TaskRules is declared in permission.ts). p.include_router(chat.build_profile_router(deps, get_runtime)) + p.include_router(card.build_profile_router(deps, get_runtime)) p.include_router(task.build_profile_router(deps, get_runtime)) p.include_router(permission.build_profile_router(deps, get_runtime)) diff --git a/src/assistant/gateway/core.py b/src/assistant/gateway/core.py index 100a7c56..389e2297 100644 --- a/src/assistant/gateway/core.py +++ b/src/assistant/gateway/core.py @@ -62,6 +62,7 @@ model_config, universal_turn_prompt, ) +from assistant.card_drafts import CardDrafts from assistant.codex_auth import CodexAuth, CodexAuthError from assistant.coding.detect import parse_bridge from assistant.config import Config, load_config @@ -200,6 +201,7 @@ def __init__( title_factory: Callable | None = None, model_factory: Callable | None = None, environment_factory: Callable | None = None, + history_factory: Callable | None = None, subscription_auth: CodexAuth | None = None, google: GoogleAuth | None = None, ) -> None: @@ -214,6 +216,7 @@ def __init__( self._agent_factory = agent_factory or create_agent self._model_factory = model_factory self._environment_factory = environment_factory or docker_environment + self._history_factory = history_factory or (lambda path: SqliteKnowledgeStore(str(path))) self._subscription_auth = subscription_auth or CodexAuth(self._config.paths) self._google = google or GoogleAuth(self._config.paths) self._resources = ProfileResources() @@ -239,6 +242,8 @@ def __init__( self._streams: dict[str, MemoryStream] = {} self._synced: dict[str, str | None] = {} self._locks: dict[str, asyncio.Lock] = {} + self._log_locks: dict[str, asyncio.Lock] = {} + self.card_drafts = CardDrafts(self._config_factory, self._draft_history, self._commit_draft) # chat_id -> the turn currently running on it (feed_message / cancel_turn) self._active: dict[str, _ActiveTurn] = {} self._invocations: set[asyncio.Task] = set() @@ -511,7 +516,7 @@ async def start(self) -> None: "history", "history", lambda: OwnedSqliteStore( - SqliteKnowledgeStore(str(self._config.data_dir / "chats.db")) + self._history_factory(self._config.data_dir / "chats.db") ), ).value ) @@ -627,8 +632,59 @@ async def _read_log(self, chat_id: str) -> str | None: async def _persist_log(self, chat_id: str, stream) -> None: """Write the stream's events as the chat's log and remember the stored text.""" assert self._writer is not None - await self._writer.persist(chat_id, list(await stream.history.get_events())) # type: ignore[arg-type] - self._synced[chat_id] = await self._read_log(chat_id) + async with self._log_locks.setdefault(chat_id, asyncio.Lock()): + await self._writer.persist(chat_id, list(await stream.history.get_events())) # type: ignore[arg-type] + self._synced[chat_id] = await self._read_log(chat_id) + + async def _draft_history(self, context: ConversationContext) -> list: + events = [] if self._writer is None else await self._writer.load(context.stream.id) + stream = self._streams[str(context.stream.id)] + current = list(await stream.history.get_events()) + return list( + { + ( + type(event).__name__, + json.dumps(event.to_dict(), sort_keys=True, default=str), + ): event + for event in [*events, *current] + }.values() + ) + + async def save_card_definition(self, chat_id: str, **request) -> dict: + """Save a current draft through the same operation as the Card author Skill.""" + context = ConversationContext(stream=await self.stream_for(chat_id)) + return await self.card_drafts.save(context, **request) + + async def _commit_draft(self, context: ConversationContext, event) -> None: + writer = self._writer + if writer is None: + raise OSError("Drafts require durable Chat persistence") + chat_id = str(context.stream.id) + stream = self._streams[chat_id] + + async def commit(): + async with self._log_locks.setdefault(chat_id, asyncio.Lock()): + events = list(await stream.history.get_events()) + await writer.persist(context.stream.id, [*events, event]) + try: + await context.send(event) + except Exception as exc: + current = list(await stream.history.get_events()) + if event not in current: + await stream.history.replace([*current, event]) + log_suppressed("draft event delivery", exc, chat_id=chat_id) + try: + self._synced[chat_id] = await self._read_log(chat_id) + except Exception as exc: + self._synced.pop(chat_id, None) + log_suppressed("draft log synchronization", exc, chat_id=chat_id) + + task = asyncio.create_task(commit()) + try: + await asyncio.shield(task) + except asyncio.CancelledError: + await task + raise async def _refresh_subscription(self, config: Config) -> None: if config.llm.provider == "openai" and config.llm.auth_mode == "subscription": @@ -721,7 +777,11 @@ def local_environment_factory(): skill_runtime = build_skills_runtime(effective) tools.extend(build_skills_install_tools(effective, build_skills_runtime(effective))) held_cards = self._catalog.hold() - plugins = [build_skills_plugin(effective, skill_runtime, catalog=held_cards, snapshot=True)] + plugins = [ + build_skills_plugin( + effective, skill_runtime, catalog=held_cards, snapshot=True, drafts=self.card_drafts + ) + ] guidance = [ effective.agent.system_prompt, *universal_turn_prompt( diff --git a/src/assistant/gateway/routes/card.py b/src/assistant/gateway/routes/card.py new file mode 100644 index 00000000..d20d415d --- /dev/null +++ b/src/assistant/gateway/routes/card.py @@ -0,0 +1,43 @@ +"""Explicit shell Save for a current Card draft in this Profile's Chat.""" + +from fastapi import APIRouter, Depends +from fastapi.responses import JSONResponse +from pydantic import BaseModel, ConfigDict + +from assistant.card_drafts import DraftError +from assistant.cards import CardError +from assistant.gateway.profile_manager import ProfileRuntime +from assistant.gateway.schemas.card import CardSaveResponse + + +class CardSaveRequest(BaseModel): + model_config = ConfigDict(extra="forbid") + draft_id: str + expected_version: int + surface_id: str + name: str + filename: str + request_id: str + replace: bool = False + conflict_token: str = "" + + +def build_profile_router(deps, get_runtime) -> APIRouter: + r = APIRouter() + + @r.post("/chats/{chat_id}/cards/save", response_model=CardSaveResponse) + async def save_card( + chat_id: str, request: CardSaveRequest, runtime: ProfileRuntime = Depends(get_runtime) + ): + try: + return await runtime.require_gateway().save_card_definition( + chat_id, **request.model_dump() + ) + except DraftError as exc: + return JSONResponse({"error": str(exc)}, status_code=409) + except CardError as exc: + return JSONResponse({"error": str(exc)}, status_code=400) + except OSError as exc: + return JSONResponse({"error": str(exc)}, status_code=500) + + return r diff --git a/src/assistant/gateway/routes/skill.py b/src/assistant/gateway/routes/skill.py index 2b63e7e9..6e993b67 100644 --- a/src/assistant/gateway/routes/skill.py +++ b/src/assistant/gateway/routes/skill.py @@ -13,6 +13,7 @@ from assistant.a2ui_skill import a2ui_skill_descriptor from assistant.agent import build_skills_runtime, bundled_skills_dir +from assistant.card_author import card_author_descriptor from assistant.gateway.profile_manager import ProfileRuntime from assistant.gateway.routes.deps import GatewayDeps from assistant.gateway.schemas import ( @@ -84,7 +85,14 @@ def _skill_store(d: GatewayDeps) -> SkillStateStore: def _shared_skills(config) -> list: """Every skill the shared layers offer: the A2UI Skill's descriptor first, then the ones on disk, so a same-named skill on disk shadows it.""" - merged = {s.name: s for s in [a2ui_skill_descriptor(), *build_skills_runtime(config).skills]} + merged = { + s.name: s + for s in [ + a2ui_skill_descriptor(), + card_author_descriptor(), + *build_skills_runtime(config).skills, + ] + } return list(merged.values()) diff --git a/src/assistant/gateway/schemas/card.py b/src/assistant/gateway/schemas/card.py new file mode 100644 index 00000000..ce34fa6e --- /dev/null +++ b/src/assistant/gateway/schemas/card.py @@ -0,0 +1,14 @@ +"""Explicit draft-definition Save outcomes.""" + +from typing import Literal + +from pydantic import BaseModel + + +class CardSaveResponse(BaseModel): + status: Literal["saved", "conflict"] + name: str + path: str + conflict_token: str + history_recorded: bool + message: str diff --git a/src/assistant/gateway/static/app/assets/engine-B_l1UeVO.js b/src/assistant/gateway/static/app/assets/engine-CNyu0DUW.js similarity index 96% rename from src/assistant/gateway/static/app/assets/engine-B_l1UeVO.js rename to src/assistant/gateway/static/app/assets/engine-CNyu0DUW.js index 01265933..99a65083 100644 --- a/src/assistant/gateway/static/app/assets/engine-B_l1UeVO.js +++ b/src/assistant/gateway/static/app/assets/engine-CNyu0DUW.js @@ -1 +1 @@ -import{n as e,t}from"./index-DGkm2flu.js";import*as n from"three/webgpu";import{FontLoader as r}from"three/addons/loaders/FontLoader.js";var i=null;function a(){if(!i){let e=new URL(`/app/assets/helvetiker_bold.typeface-Ct6_dhxe.json`,``+import.meta.url).href;i=new r().loadAsync(e)}return i}var o={sunny:()=>t(()=>import(`./sunny-E05NCojR.js`),[]),"partly-cloudy":()=>t(()=>import(`./cloudy-BAHLLGwV.js`),[]),cloudy:()=>t(()=>import(`./cloudy-BAHLLGwV.js`),[]),foggy:()=>t(()=>import(`./foggy-BKtfRmWV.js`),[]),rainy:()=>t(()=>import(`./rainy-DSnKL59d.js`),[]),thunderstorm:()=>t(()=>import(`./thunderstorm-D8V-tCb6.js`),[]),snow:()=>t(()=>import(`./snow-DuMKZ5ft.js`),[]),windy:()=>t(()=>import(`./windy-MO-fvUWb.js`),[])};function s(){return typeof navigator<`u`&&`gpu`in navigator&&!!navigator.gpu}async function c(t,r,i={}){if(!s())throw Error(`no-webgpu`);let c=await o[e(r)](),l=new n.WebGPURenderer({canvas:t,antialias:!0});l.setPixelRatio(Math.min(window.devicePixelRatio||1,2)),await l.init();let u=await a(),d={THREE:n,renderer:l,canvas:t,font:u,temperatureText:i.temperatureText||``},f=await c.build(d),p=f.camera,m=f.render||(()=>l.render(f.scene,p)),h=Number(i.zoom)||1;h!==1&&(p.zoom*=h,p.updateProjectionMatrix());let g=!1;function _(){let e=Math.max(1,Math.round(t.clientWidth||t.width||1)),n=Math.max(1,Math.round(t.clientHeight||t.height||1)),r=l.getPixelRatio();(t.width!==Math.round(e*r)||t.height!==Math.round(n*r))&&(l.setSize(e,n,!1),p.aspect=e/n,p.updateProjectionMatrix())}function v(e){if(g)return;_();let t=(e||0)/1e3;f.frame&&f.frame(t),m(t)}return l.setAnimationLoop(v),{dispose(){if(!g){g=!0,l.setAnimationLoop(null);try{f.dispose&&f.dispose()}catch{}try{l.dispose()}catch{}}}}}export{c as createBanner,a as loadFont,s as supportsWebGPU}; \ No newline at end of file +import{n as e,t}from"./index-CZHkc36N.js";import*as n from"three/webgpu";import{FontLoader as r}from"three/addons/loaders/FontLoader.js";var i=null;function a(){if(!i){let e=new URL(`/app/assets/helvetiker_bold.typeface-Ct6_dhxe.json`,``+import.meta.url).href;i=new r().loadAsync(e)}return i}var o={sunny:()=>t(()=>import(`./sunny-E05NCojR.js`),[]),"partly-cloudy":()=>t(()=>import(`./cloudy-BAHLLGwV.js`),[]),cloudy:()=>t(()=>import(`./cloudy-BAHLLGwV.js`),[]),foggy:()=>t(()=>import(`./foggy-BKtfRmWV.js`),[]),rainy:()=>t(()=>import(`./rainy-DSnKL59d.js`),[]),thunderstorm:()=>t(()=>import(`./thunderstorm-D8V-tCb6.js`),[]),snow:()=>t(()=>import(`./snow-DuMKZ5ft.js`),[]),windy:()=>t(()=>import(`./windy-MO-fvUWb.js`),[])};function s(){return typeof navigator<`u`&&`gpu`in navigator&&!!navigator.gpu}async function c(t,r,i={}){if(!s())throw Error(`no-webgpu`);let c=await o[e(r)](),l=new n.WebGPURenderer({canvas:t,antialias:!0});l.setPixelRatio(Math.min(window.devicePixelRatio||1,2)),await l.init();let u=await a(),d={THREE:n,renderer:l,canvas:t,font:u,temperatureText:i.temperatureText||``},f=await c.build(d),p=f.camera,m=f.render||(()=>l.render(f.scene,p)),h=Number(i.zoom)||1;h!==1&&(p.zoom*=h,p.updateProjectionMatrix());let g=!1;function _(){let e=Math.max(1,Math.round(t.clientWidth||t.width||1)),n=Math.max(1,Math.round(t.clientHeight||t.height||1)),r=l.getPixelRatio();(t.width!==Math.round(e*r)||t.height!==Math.round(n*r))&&(l.setSize(e,n,!1),p.aspect=e/n,p.updateProjectionMatrix())}function v(e){if(g)return;_();let t=(e||0)/1e3;f.frame&&f.frame(t),m(t)}return l.setAnimationLoop(v),{dispose(){if(!g){g=!0,l.setAnimationLoop(null);try{f.dispose&&f.dispose()}catch{}try{l.dispose()}catch{}}}}}export{c as createBanner,a as loadFont,s as supportsWebGPU}; \ No newline at end of file diff --git a/src/assistant/gateway/static/app/assets/index-CVt4_hi3.css b/src/assistant/gateway/static/app/assets/index-CVt4_hi3.css deleted file mode 100644 index 5e4792fa..00000000 --- a/src/assistant/gateway/static/app/assets/index-CVt4_hi3.css +++ /dev/null @@ -1 +0,0 @@ -@import "https://fonts.googleapis.com/css2?family=Geist:wght@400;500;600;700&family=Geist+Mono:wght@400;500;600&family=Inter:wght@400;500;600;700&display=swap";:root{--coral-50:#fff2ee;--coral-100:#ffe1d8;--coral-200:#ffc4b4;--coral-300:#fb9e84;--coral-400:#fb7758;--coral-500:#f95339;--coral-600:#e53c20;--coral-700:#bd2f18;--coral-800:#8f2614;--coral-900:#5e1b10;--sand-0:#fff;--sand-25:#fafbfc;--sand-50:#f5f7fa;--sand-100:#eef1f5;--sand-200:#dde2e8;--sand-300:#c8cfd8;--sand-400:#b5bdc7;--sand-500:#8a94a2;--sand-600:#5f6875;--sand-700:#454c56;--sand-800:#242a33;--sand-900:#161a20;--sand-950:#0b0d10;--ag2-indigo:#4f46e5;--ag2-indigo-bright:#6366f1;--ag2-cyan:#0891b2;--ag2-cyan-bright:#22d3ee;--ag2-model:#6366f1;--ag2-tool:#22d3ee;--ag2-memory:#a78bfa;--ag2-subagent:#38bdf8;--ag2-hitl:#fbbf24;--ag2-observer:#fb7185;--ag2-voice:#2dd4bf;--ag2-usage:#6f7885;--green-500:#10b981;--green-600:#059669;--amber-500:#f59e0b;--red-500:#e11d48;--red-600:#be123c;--blue-500:#0ea5e9;--bg:var(--sand-50);--surface:var(--sand-0);--surface-sunk:var(--sand-100);--surface-hover:var(--sand-100);--surface-elevated:var(--sand-0);--panel:var(--sand-100);--text:var(--sand-900);--text-muted:var(--sand-600);--text-faint:var(--sand-500);--text-on-coral:#fff;--text-on-dark:var(--sand-25);--line:var(--sand-200);--line-strong:var(--sand-300);--accent:var(--p-500);--accent-hover:color-mix(in srgb, #fff 9%, var(--accent));--accent-press:var(--p-600);--accent-soft:color-mix(in srgb, var(--accent) 12%, transparent);--accent-border:color-mix(in srgb, var(--accent) 22%, transparent);--accent-ring:color-mix(in srgb, var(--accent) 38%, transparent);--text-on-accent:#fff;--brand-coral:var(--coral-500);--user-bubble:color-mix(in srgb, var(--accent) 5%, var(--surface));--user-bubble-border:color-mix(in srgb, var(--accent) 22%, var(--line));--user-bubble-ink:var(--text);--agent-bubble:var(--surface);--agent-bubble-ink:var(--sand-900);--success:var(--green-500);--warning:var(--amber-500);--danger:var(--red-500);--info:var(--blue-500);--focus-ring:0 0 0 3px var(--accent-ring);--lightningcss-light:initial;--lightningcss-dark: ;color-scheme:light}[data-theme=dark]{--bg:#0b0d10;--panel:#0f1217;--surface:#13171d;--surface-elevated:#181d25;--surface-sunk:#1b212a;--surface-hover:#1b212a;--text:#f2f4f7;--text-muted:#a7afbb;--text-faint:#6f7885;--text-on-coral:#fff;--text-on-accent:#fff;--text-on-dark:#f2f4f7;--line:#242a33;--line-strong:#303844;--ag2-indigo:#6366f1;--ag2-cyan:#22d3ee;--green-500:#34d399;--green-600:#10b981;--amber-500:#fbbf24;--red-500:#fb7185;--red-600:#f43f5e;--blue-500:#38bdf8;--accent:var(--p-400);--accent-hover:color-mix(in srgb, #fff 10%, var(--accent));--accent-press:var(--p-300);--accent-soft:color-mix(in srgb, var(--accent) 16%, transparent);--accent-border:color-mix(in srgb, var(--accent) 25%, transparent);--accent-ring:color-mix(in srgb, var(--accent) 45%, transparent);--user-bubble:color-mix(in srgb, var(--accent) 8%, var(--surface));--user-bubble-border:color-mix(in srgb, var(--accent) 24%, var(--line-strong));--user-bubble-ink:var(--text);--agent-bubble:var(--surface);--agent-bubble-ink:var(--sand-25);--lightningcss-light: ;--lightningcss-dark:initial;color-scheme:dark}:root,[data-palette=navy-blue]{--p-50:#edf1fc;--p-100:#d6dff8;--p-200:#a9bcf0;--p-300:#7795e8;--p-400:#466edf;--p-500:#1d4ed8;--p-600:#1842b5;--p-700:#13338f;--p-800:#0f276c;--p-900:#0a1b49}[data-palette=royal-blue]{--p-50:#edf0f9;--p-100:#d7ddf1;--p-200:#aab6e1;--p-300:#788ccf;--p-400:#4762bd;--p-500:#1e40af;--p-600:#193693;--p-700:#142a73;--p-800:#0f2058;--p-900:#0a163b}[data-palette=dark-indigo]{--p-50:#f0effb;--p-100:#dddbf5;--p-200:#b8b3eb;--p-300:#8e88df;--p-400:#655cd4;--p-500:#4338ca;--p-600:#382faa;--p-700:#2c2585;--p-800:#221c65;--p-900:#171345}[data-palette=deep-purple]{--p-50:#f2edf9;--p-100:#e1d7f2;--p-200:#c1abe3;--p-300:#9d7ad3;--p-400:#7949c3;--p-500:#5b21b6;--p-600:#4c1c99;--p-700:#3c1678;--p-800:#2e115b;--p-900:#1f0b3e}[data-palette=forest-green]{--p-50:#ecf3ef;--p-100:#d5e3da;--p-200:#a6c4b2;--p-300:#73a385;--p-400:#408159;--p-500:#166534;--p-600:#12552c;--p-700:#0f4322;--p-800:#0b331a;--p-900:#072212}[data-palette=burgundy]{--p-50:#f7ecef;--p-100:#eed4db;--p-200:#dba5b4;--p-300:#c57188;--p-400:#b03d5d;--p-500:#9f1239;--p-600:#860f30;--p-700:#690c26;--p-800:#50091d;--p-900:#360613}:root{--ed-paper:#fff;--ed-paper-2:#eef1f5;--ed-ink:#161a20;--ed-ink-2:#5f6875;--ed-ink-3:#8a94a2;--ed-accent:#e11d48;--ed-accent-d:#be123c;--ed-up:#10b981;--ed-up-d:#059669;--ed-rule:#161a201a;--ed-rule-2:#161a2029;--ed-noise:.015;--ed-serif:"Geist", "Inter", system-ui, sans-serif;--ed-ui:"Geist", "Inter", system-ui, sans-serif;--ed-code:"Geist Mono", "JetBrains Mono", ui-monospace, monospace}[data-theme=dark]{--ed-paper:#13171d;--ed-paper-2:#0f1217;--ed-ink:#f2f4f7;--ed-ink-2:#a7afbb;--ed-ink-3:#6f7885;--ed-accent:#fb7185;--ed-accent-d:#fda4af;--ed-up:#34d399;--ed-up-d:#6ee7b7;--ed-rule:#f2f4f71a;--ed-rule-2:#f2f4f72e;--ed-noise:.02}:root{--font-display:"Geist", "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;--font-sans:"Geist", "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;--font-mono:"Geist Mono", "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;--fw-regular:400;--fw-medium:500;--fw-semibold:600;--fw-bold:700;--text-2xs:10px;--text-xs:11px;--text-sm:13px;--text-base:14px;--text-md:15px;--text-lg:17px;--text-xl:20px;--text-2xl:26px;--text-3xl:34px;--text-4xl:44px;--leading-tight:1.15;--leading-snug:1.3;--leading-normal:1.5;--leading-relaxed:1.6;--tracking-tight:-.02em;--tracking-normal:0;--tracking-wide:.04em;--tracking-eyebrow:.12em;--space-0:0;--space-1:2px;--space-2:4px;--space-3:6px;--space-4:8px;--space-5:12px;--space-6:16px;--space-7:20px;--space-8:24px;--space-9:32px;--space-10:40px;--space-11:48px;--space-12:64px;--radius-xs:6px;--radius-sm:8px;--radius-input:10px;--radius-md:12px;--radius-lg:14px;--radius-xl:16px;--radius-bubble:10px;--radius-pill:999px;--shadow-xs:0 1px 2px #0b0d100f;--shadow-sm:0 1px 3px #0b0d1014, 0 1px 2px #0b0d100d;--shadow-md:0 4px 12px #0b0d101a, 0 1px 3px #0b0d100f;--shadow-lg:0 12px 28px #0b0d1029, 0 2px 6px #0b0d1014;--shadow-xl:0 24px 60px #0b0d1047, 0 4px 12px #0b0d101f;--shadow-coral:0 6px 18px #f9533947;--shadow-accent:0 6px 18px color-mix(in srgb, var(--accent) 26%, transparent);--border-thin:1px;--border-medium:1.5px;--border-thick:2px;--ease-out:cubic-bezier(.22, 1, .36, 1);--ease-in-out:cubic-bezier(.65, 0, .35, 1);--ease-spring:cubic-bezier(.34, 1.56, .64, 1);--dur-fast:.15s;--dur-base:.2s;--dur-slow:.32s;--drawer-w:280px;--inspector-w:372px;--thread-max:780px;--z-modal:50;--z-backdrop:40}*{box-sizing:border-box}html,body{height:100%;margin:0}body{font-family:var(--font-sans);font-size:var(--text-base);line-height:var(--leading-normal);background:var(--bg);color:var(--text);-webkit-font-smoothing:antialiased;text-rendering:optimizelegibility}*{scrollbar-width:thin;scrollbar-color:var(--line-strong) transparent}::-webkit-scrollbar{width:8px;height:8px}::-webkit-scrollbar-track{background:0 0}::-webkit-scrollbar-thumb{background:var(--line-strong);border-radius:var(--radius-pill)}::-webkit-scrollbar-thumb:hover{background:var(--text-faint)}h1,h2,h3,h4{font-family:var(--font-display);font-weight:var(--fw-bold);line-height:var(--leading-tight);letter-spacing:var(--tracking-tight);margin:0}code,pre,kbd,samp{font-family:var(--font-mono)}a{color:var(--accent);text-decoration:none}a:hover{text-decoration:underline}::selection{background:var(--accent-soft);color:var(--accent-press)}@keyframes ag2-dot-pulse{0%,to{opacity:1;transform:scale(1)}50%{opacity:.4;transform:scale(.82)}}@keyframes ag2-blink{0%,80%,to{opacity:.25}40%{opacity:1}}@keyframes ag2-rise{0%{opacity:0;transform:translateY(8px)}to{opacity:1;transform:translateY(0)}}@keyframes ag2-pop{0%{opacity:0;transform:scale(.96)}to{opacity:1;transform:scale(1)}}@keyframes ag2-fade{0%{opacity:0}to{opacity:1}}@keyframes ag2-slide-left{0%{opacity:0;transform:translate(16px)}to{opacity:1;transform:translate(0)}}@keyframes ag2-glow{0%,to{box-shadow:0 0 0 0 color-mix(in srgb, var(--accent) 0%, transparent)}50%{box-shadow:0 0 0 6px color-mix(in srgb, var(--accent) 14%, transparent)}}@keyframes ag2-shimmer{0%{background-position:-180% 0}to{background-position:180% 0}}.ag2-rise{animation:ag2-rise var(--dur-slow) var(--ease-out) both}.ag2-pop{animation:ag2-pop var(--dur-base) var(--ease-spring) both}.ag2-fade{animation:ag2-fade var(--dur-base) var(--ease-out) both}.ag2-slide-left{animation:ag2-slide-left var(--dur-slow) var(--ease-out) both}.ag2-glow{animation:ag2-glow 2.8s var(--ease-in-out) infinite}.ag2-rise{animation-delay:calc(var(--i,0) * 55ms)}.ag2-lift{transition:transform var(--dur-base) var(--ease-out), box-shadow var(--dur-base) var(--ease-out)}.ag2-lift:hover{box-shadow:var(--shadow-md);transform:translateY(-2px)}@media (prefers-reduced-motion:reduce){*,:before,:after{transition-duration:.001ms!important;animation-duration:.001ms!important;animation-iteration-count:1!important}}:root{--ink:var(--text);--muted:var(--text-muted);--code:var(--surface-sunk);--sans:var(--font-sans);--mono:var(--font-mono);--user-bg:var(--user-bubble);--user-ink:var(--user-bubble-ink);--select-chevron:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%23998f83' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E")}.chpick,.settings .keyrow select,.settings .llmfield select,.pfield select{appearance:none;background-image:var(--select-chevron);background-position:right 10px center;background-repeat:no-repeat;background-size:14px}#app{height:100vh}.app{grid-template-columns:var(--drawer-w,270px) 1fr;grid-template-rows:minmax(0,1fr);height:100vh;display:grid}.drawer{border-right:1px solid var(--line);background:var(--panel);flex-direction:column;display:flex;position:relative;overflow:hidden}.main{flex-direction:column;min-width:0;display:flex;position:relative}.dhead{align-items:center;gap:9px;padding:14px 16px;display:flex}.brandlogo{flex:none;width:auto;height:20px;display:block}.brandlogo.on-dark,[data-theme=dark] .brandlogo.on-light{display:none}[data-theme=dark] .brandlogo.on-dark{display:block}.onb-brand .brandlogo{height:38px}.brand{font-family:var(--font-display);font-weight:var(--fw-bold);font-size:var(--text-xl);letter-spacing:-.01em}.segbar{background:var(--code);border-radius:var(--radius-pill);gap:3px;margin:8px 12px 0;padding:3px;display:flex}.seg{font:inherit;font-size:13px;font-weight:var(--fw-medium);color:var(--muted);border-radius:var(--radius-pill);cursor:pointer;transition:color var(--dur-fast) var(--ease-out), background var(--dur-fast) var(--ease-out);background:0 0;border:none;flex:1;justify-content:center;align-items:center;gap:6px;padding:6px 10px;display:inline-flex}.seg:hover{color:var(--text)}.seg.on{color:var(--accent);background:var(--surface);box-shadow:var(--shadow-sm)}.newrow{text-align:left;width:100%;font:inherit;font-size:13px;font-weight:var(--fw-medium);color:var(--muted);border-radius:var(--radius-sm);cursor:pointer;transition:color var(--dur-fast) var(--ease-out), background var(--dur-fast) var(--ease-out);background:0 0;border:none;align-items:center;gap:8px;margin-bottom:4px;padding:8px 11px;display:flex}.newrow:hover{color:var(--accent);background:var(--code)}.dfoot{border-top:1px solid var(--line);padding:8px 12px}.settingsbtn{text-align:left;border:1px solid var(--line);background:var(--surface);width:100%;color:var(--ink);border-radius:var(--radius-sm);cursor:pointer;transition:border-color var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out);align-items:center;gap:7px;padding:8px 11px;font-size:13px;display:inline-flex}.settingsbtn:hover{border-color:color-mix(in srgb, var(--accent) 45%, var(--line));color:var(--accent)}.settings .setrowwrap{align-items:center;gap:8px;display:flex}.settings .setrowwrap .setrow{flex:1;min-width:0}.settings .setrow,.settings .skcard,.settings .llmrow,.settings .mcprow,.settings .cnrow,.settings .mcpcatcard{border:1px solid var(--line);border-radius:var(--radius-md);transition:border-color var(--dur-fast) var(--ease-out);background:0 0}.settings .llmrow.clickable:hover,.settings .cnrow:hover,.settings .mcpcatcard:hover:not(:disabled){border-color:color-mix(in srgb, var(--accent) 45%, var(--line))}.settings .skcard:has(.sktop.clickable:hover){border-color:color-mix(in srgb, var(--accent) 45%, var(--line))}.settings .skcard:has(.sktop:focus-visible){box-shadow:var(--focus-ring)}.settings .sktop:focus-visible{outline:none}.settings .setrow{text-align:left;width:100%;color:var(--ink);align-items:baseline;gap:10px;padding:11px 13px;display:flex}.settings .setrow .sk{flex:none;align-items:center;gap:7px;font-weight:600;display:inline-flex}.settings .setrow .sv{color:var(--muted);text-overflow:ellipsis;white-space:nowrap;flex:1;font-size:13px;overflow:hidden}.settings .sklist{flex-direction:column;gap:8px;display:flex}.settings .skcard{padding:12px 14px}.settings .skcard.off .skmain,.settings .skcard.off .skmeta{opacity:.5}.settings .skcard.off .skmeta:has(.skconfirm){opacity:1}.settings .sktop{align-items:center;gap:14px;display:flex}.settings .sktop.clickable{cursor:pointer}.settings .skctl .setswitch{cursor:inherit}.settings .skctl .setswitch.busy{opacity:.5}.settings .skmain{flex:1;min-width:0}.settings .skname{font-size:14px;font-weight:var(--fw-semibold);color:var(--ink)}.settings .skdesc{color:var(--text-muted);margin:4px 0 0;font-size:12.5px;line-height:1.5}.settings .skctl{flex:none;align-items:center;gap:8px;display:flex}.settings .skmeta{color:var(--text-muted);border-top:1px solid var(--line);align-items:center;gap:7px;margin-top:10px;padding-top:8px;font-size:11px;display:flex}.settings .skdot{background:var(--muted);border-radius:50%;flex:none;width:6px;height:6px}.settings .skdot.third{background:var(--accent)}.settings .skmetabtn{margin-left:auto}.settings .skconfirm{color:var(--danger)}.settings .skzone{position:relative}.settings .skadd:not(:has(.ski)){position:absolute;top:-6px;right:0}.settings .skzone .setgroup{padding-bottom:12px}.settings .skadd .addbtn{margin-top:0}.settings .skadd .ski{border-radius:12px;margin:0 0 8px}.modal.settings{width:min(860px,94vw);height:min(86vh,780px)}.settings .setbody{flex-direction:row;flex:1;gap:16px;min-height:0;display:flex}.settings .setnav{border-right:1px solid var(--line);flex-direction:column;flex:none;gap:2px;width:170px;padding-right:16px;display:flex;overflow-y:auto}.settings .setnavbtn{text-align:left;width:100%;color:var(--ink);font:inherit;border-radius:var(--radius-sm);cursor:pointer;transition:background var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out);background:0 0;border:none;padding:8px 11px;font-size:13px;display:block}.settings .setnavbtn:hover{background:var(--surface-hover)}.settings .setnavbtn.on{background:var(--accent-soft);color:var(--accent);font-weight:var(--fw-semibold)}.settings .setscroll{scrollbar-gutter:stable;flex-direction:column;flex:1;gap:8px;min-width:0;padding-right:10px;display:flex;overflow-y:auto}@media (width<=720px){.settings .setbody{flex-direction:column;gap:12px}.settings .setnav{border-right:none;border-bottom:1px solid var(--line);flex-direction:row;width:auto;padding-bottom:8px;padding-right:0;overflow:auto hidden}.settings .setnavbtn{white-space:nowrap;flex:none;width:auto}}.settings .setgroup{font-size:13px;font-weight:var(--fw-semibold);letter-spacing:.2px;color:var(--ink);border-bottom:1px solid var(--line);margin:14px 0 4px;padding-bottom:5px}.settings .setgroup:first-child{margin-top:0}.settings .setsub{font-size:var(--text-sm);color:var(--text-muted);margin:0 0 12px}.settings .addbtn{cursor:pointer;font:inherit;font-size:var(--text-sm);font-weight:var(--fw-semibold);color:var(--text-muted);background:0 0;border:none;align-self:flex-start;align-items:center;gap:6px;margin-top:6px;padding:8px 4px;display:inline-flex}.settings .addbtn:hover:not(:disabled){color:var(--text)}.settings .addbtn:disabled{opacity:.5;cursor:default}.settings .addbtn:focus-visible{box-shadow:var(--focus-ring);border-radius:var(--radius-sm);outline:none}.settings .setsec{text-transform:uppercase;letter-spacing:1px;color:var(--muted);margin:8px 0 2px;font-size:11px}.settings .setwide{vertical-align:1px;letter-spacing:.5px;text-transform:none;color:var(--muted);background:var(--surface-sunk,#0000000d);border:1px solid var(--line);border-radius:999px;margin-left:6px;padding:1px 7px;font-size:10px;font-weight:600;display:inline-block}.settings .keyrow{align-items:center;gap:8px;display:flex}.settings .keyrow .kp{flex:none;width:78px;font-size:13px}.settings .keyrow input,.settings .keyrow select{border:1px solid var(--line);min-width:0;font:inherit;background-color:var(--bg);color:var(--ink);border-radius:8px;flex:1;padding:7px 9px;font-size:13px}.settings .keyrow select{padding-right:30px}.settings .focuspills{flex-wrap:wrap;gap:7px;display:flex}.settings .focuspill{cursor:pointer;border:1.5px solid var(--line);background:var(--surface);color:var(--ink);font:inherit;transition:border-color var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out), background var(--dur-fast) var(--ease-out);border-radius:999px;align-items:center;gap:6px;padding:6px 12px;font-size:13px;font-weight:600;display:inline-flex}.settings .focuspill:hover{border-color:color-mix(in srgb, var(--accent) 45%, var(--line))}.settings .focuspill.on{border-color:var(--accent);background:var(--accent-soft);color:var(--accent)}.settings .focuspill:disabled{opacity:.6;cursor:default}.modal .open,.panel .open,.taskpage .open,.tf .open{font-family:var(--sans);font-size:13px;font-weight:var(--fw-medium);cursor:pointer;border:1px solid var(--line);background:var(--surface);color:var(--ink);border-radius:var(--radius-sm);transition:border-color var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out), background var(--dur-fast) var(--ease-out);flex:none;justify-content:center;align-items:center;gap:6px;padding:7px 14px;display:inline-flex}.modal .open:hover,.panel .open:hover,.taskpage .open:hover,.tf .open:hover{border-color:color-mix(in srgb, var(--ink) 22%, var(--line));background:var(--code)}.modal .open:active,.panel .open:active,.taskpage .open:active,.tf .open:active{background:var(--code)}.modal .open:disabled,.panel .open:disabled,.taskpage .open:disabled,.tf .open:disabled{opacity:.5;cursor:default;border-color:var(--line);color:var(--muted);background:var(--surface)}.modal .open.primary,.panel .open.primary,.taskpage .open.primary,.tf .open.primary{border-color:var(--accent);color:var(--accent)}.modal .open.primary:hover:not(:disabled),.panel .open.primary:hover:not(:disabled),.taskpage .open.primary:hover:not(:disabled),.tf .open.primary:hover:not(:disabled){background:var(--accent-soft)}.modal .open.danger,.panel .open.danger,.taskpage .open.danger,.tf .open.danger{border-color:color-mix(in srgb, var(--danger) 55%, var(--line));color:var(--danger);background:0 0}.modal .open.danger:hover,.panel .open.danger:hover,.taskpage .open.danger:hover,.tf .open.danger:hover{border-color:var(--danger);color:#fff;background:var(--danger)}.iconbtn{border:1px solid var(--line);background:var(--surface);width:30px;height:30px;color:var(--muted);border-radius:var(--radius-sm);cursor:pointer;transition:border-color var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out), background var(--dur-fast) var(--ease-out);flex:none;justify-content:center;align-items:center;padding:0;display:inline-flex}.iconbtn:hover{color:var(--ink);background:var(--code)}.iconbtn:disabled{opacity:.5;cursor:default}.brandmark{vertical-align:middle;flex:none;display:inline-block}.settings .setswitch{border:1px solid var(--line);background:var(--surface-sunk,var(--code));cursor:pointer;width:34px;height:20px;transition:background var(--dur-fast) var(--ease-out), border-color var(--dur-fast) var(--ease-out);border-radius:999px;flex:none;padding:0;position:relative}.settings .setswitch:after{content:"";background:var(--muted);width:16px;height:16px;transition:transform var(--dur-fast) var(--ease-out), background var(--dur-fast) var(--ease-out);border-radius:50%;position:absolute;top:1px;left:1px}.settings .setswitch.on{background:var(--accent);border-color:var(--accent)}.settings .setswitch.on:after{background:#fff;transform:translate(14px)}.settings .setswitch:disabled{opacity:.5;cursor:default}.settings .setswitch:focus-visible{box-shadow:var(--focus-ring);outline:none}.panel .delconfirm{flex-wrap:wrap;align-items:center;gap:8px;display:inline-flex}.panel .delconfirm .confirm{color:var(--danger);font-size:13px}.modal.memory{width:min(720px,92vw);height:min(88vh,940px)}.memory .msection{flex-direction:column;flex:1;gap:6px;min-height:0;display:flex}.memory .msection h3{font-size:13px;font-weight:var(--fw-medium);color:var(--ink);margin:0}.memory .msection .small{margin:0;font-size:12px}.memory textarea{border:1px solid var(--line);min-height:0;font:inherit;background:var(--bg);color:var(--ink);resize:none;border-radius:10px;flex:1;padding:12px 14px;font-size:13px;line-height:1.5}.memory .mfoot{justify-content:flex-end;align-items:center;gap:10px;display:flex}.memory .okmsg{color:var(--success);font-size:13px}.settings .linkbtn{color:var(--muted);cursor:pointer;background:0 0;border:none;flex:none;font-size:12px}.settings .linkbtn:hover{color:var(--text)}.settings .linkbtn.danger:hover,.settings .linkbtn.quiet:hover{color:var(--danger)}.settings .linkbtn:disabled{opacity:.4;cursor:default}.settings .linkbtn:disabled:hover{color:var(--muted)}.settings .linkbtn.advset,.settings .linkbtn.advset:hover{color:var(--accent)}.settings .setcheck{cursor:pointer;align-items:center;gap:9px;padding:2px 0;font-size:14px;display:flex}.settings .setcheck input{width:16px;height:16px;accent-color:var(--accent);cursor:pointer}.settings .mcprow{align-items:center;gap:8px;padding:9px 10px;display:flex}.settings .mcpmeta{min-width:0;color:var(--muted);flex-direction:column;flex:1;gap:2px;font-size:12px;display:flex}.settings .mcpmeta strong{color:var(--ink);font-size:13px}.settings .mcpmeta span{overflow-wrap:anywhere}.settings .mcpbad{color:var(--danger)}.settings .mcpform{grid-template-columns:1fr 1fr;gap:8px;display:grid}.settings .mcpform input,.settings .mcpform textarea{border:1px solid var(--line);min-width:0;font:inherit;background:var(--bg);color:var(--ink);border-radius:8px;padding:7px 9px;font-size:13px}.settings .mcpform textarea{min-height:74px;font-family:var(--mono);resize:none;grid-column:1/-1;font-size:12px}.settings .mcpform button{justify-self:start}.settings .mcpcat{grid-template-columns:1fr 1fr;gap:8px;display:grid}.settings .mcpcatcard{text-align:left;cursor:pointer;color:var(--ink);font:inherit;border-width:1.5px;flex-direction:column;align-items:flex-start;gap:3px;padding:8px 11px;display:flex}.settings .mcpcatcard.openinputs{border-color:var(--accent)}.settings .mcpcatcard.added{opacity:.55;cursor:default}.settings .mcpcatcard.added .mcpcathead{color:var(--accent)}.settings .mcpcathead{flex-wrap:wrap;align-items:center;gap:6px;font-size:13px;font-weight:600;display:inline-flex}.settings .mcpcatblurb{color:var(--muted);font-size:11.5px}.settings .mcpcatblurb.warn{color:var(--danger)}.settings .mcpcatchip{font-size:10px;font-weight:var(--fw-medium);letter-spacing:.3px;color:var(--muted);border:1px solid var(--line);white-space:nowrap;border-radius:999px;padding:1px 6px}.settings .mcpcat+.setsec{margin-top:14px}.settings .mcpinputs{border:1px solid var(--line);border-radius:var(--radius-md);flex-direction:column;gap:8px;padding:9px 10px;display:flex}.settings .mcpinputs .kp{width:auto;min-width:78px}.settings .mcppaste{border:1px solid var(--line);min-width:0;font-family:var(--mono);resize:none;background:var(--bg);min-height:58px;max-height:240px;color:var(--ink);border-radius:8px;flex:none;padding:7px 9px;font-size:12px;overflow-y:auto}.settings .mcpdraft{border:1px solid var(--accent);border-radius:var(--radius-md);flex-direction:column;gap:8px;padding:9px 10px;display:flex}.settings .mcpdraft .kp{width:auto;min-width:60px}.settings .mcpdraft .mcpenvkey{text-overflow:ellipsis;white-space:nowrap;max-width:40%;font-family:var(--mono);font-size:11.5px;overflow:hidden}.settings .mcpcmd{text-overflow:ellipsis;white-space:nowrap;min-width:0;font-family:var(--mono);color:var(--muted);flex:1;font-size:11.5px;overflow:hidden}.settings .llmenv{color:var(--ink);background:var(--accent-soft);border:1px solid var(--accent);border-radius:10px;padding:8px 11px;font-size:12.5px}.settings .llmrow{align-items:center;gap:10px;padding:9px 10px;display:flex}.settings .llmrow.active{background:color-mix(in srgb, var(--accent) 10%, transparent)}.settings .llmrow.clickable{cursor:pointer}.settings .llmrow.clickable:focus-visible{box-shadow:var(--focus-ring);outline:none}.settings .llmmeta{flex-direction:column;flex:1;gap:2px;min-width:0;display:flex}.settings .llmname{color:var(--ink);align-items:center;gap:8px;font-size:13px;font-weight:600;display:flex}.settings .llmbadge{text-transform:uppercase;letter-spacing:.5px;color:var(--accent);background:var(--accent-soft);border-radius:999px;padding:1px 7px;font-size:10px;font-weight:600}.settings .llmsub{color:var(--muted);overflow-wrap:anywhere;flex-wrap:wrap;align-items:center;gap:8px;font-size:12px;display:flex}.settings .llmkey{font-family:var(--mono);color:var(--muted);background:var(--surface-sunk);border:1px solid var(--line);border-radius:999px;padding:0 7px;font-size:11px}.settings .llmkey.warn{color:var(--danger);border-color:color-mix(in srgb, var(--danger) 45%, var(--line))}.settings .llmtest{color:var(--muted);font-size:12px}.settings .llmtest.ok{color:var(--success)}.settings .llmtest.bad{color:var(--danger)}.settings .llmform{border:1px solid var(--line);background:var(--surface-sunk);border-radius:10px;flex-direction:column;gap:12px;padding:12px;display:flex}.settings .llmfield{flex-direction:column;gap:5px;display:flex}.settings .llmfield>label,.settings .llmfield>.llmlabel{color:var(--muted);font-size:12px;font-weight:600}.settings .llmfield input,.settings .llmfield select{border:1px solid var(--line);min-width:0;font:inherit;background-color:var(--bg);color:var(--ink);border-radius:8px;padding:7px 9px;font-size:13px}.settings .llmfield select{padding-right:30px}.settings .llmfield input:focus,.settings .llmfield select:focus{border-color:var(--accent);box-shadow:var(--focus-ring);outline:none}.settings .llmhint{color:var(--muted);font-size:11px;font-weight:400}.settings .llmkeyfield{align-items:center;gap:6px;display:flex}.settings .llmkeyfield input{flex:1}.settings .llmtool{cursor:pointer;align-items:flex-start;gap:8px;display:flex}.settings .llmtool input[type=checkbox]{width:auto;min-width:0;accent-color:var(--accent);flex:none;margin-top:2px}.settings .llmtoolbody{flex-direction:column;gap:2px;display:flex}.settings .llmtoolname{color:var(--ink);font-size:13px}.settings .llmtoolopts{flex-direction:column;gap:5px;margin-left:22px;display:flex}.settings .llmtoolopts>label{color:var(--muted);font-size:12px;font-weight:600}.settings .advtoggle{color:var(--accent);align-self:flex-start}.settings .advtoggle:hover{color:var(--accent)}.settings .llmadv{border:1px solid var(--line);font-family:var(--mono);resize:vertical;background:var(--bg);min-height:82px;color:var(--ink);border-radius:8px;padding:8px 10px;font-size:12px}.settings .cnrow{text-align:left;width:100%;color:var(--ink);font:inherit;cursor:pointer;align-items:center;gap:10px;margin-bottom:6px;padding:9px 10px;display:flex}.settings .cnrow:focus-visible{box-shadow:var(--focus-ring);outline:none}.settings .cnmark{background:color-mix(in srgb, var(--tint) 22%, transparent);width:20px;height:20px;color:var(--tint);border-radius:6px;flex:none;place-items:center;font-size:11px;font-weight:700;display:inline-grid}.settings .cnmark.sm{border-radius:5px;width:16px;height:16px;font-size:9px}.settings .cnmeta{flex-direction:column;flex:1;gap:2px;min-width:0;display:flex}.settings .cnname{color:var(--ink);align-items:center;gap:7px;font-size:13px;font-weight:600;display:flex}.settings .cntag{text-transform:uppercase;letter-spacing:.5px;color:var(--muted);border:1px solid var(--line);border-radius:999px;padding:0 6px;font-size:10px;font-weight:500}.settings .cnstat{color:var(--text-muted);align-items:center;gap:5px;font-size:12px;display:flex}.settings .cnstat.ok{color:var(--success)}.settings .cnstat.err{color:var(--warning)}.settings .cnback{cursor:pointer;font:inherit;font-size:var(--text-xs);font-weight:var(--fw-semibold);color:var(--text-muted);background:0 0;border:none;align-self:flex-start;align-items:center;gap:3px;margin:0 0 8px -4px;padding:4px;display:inline-flex}.settings .cnback:hover{color:var(--accent)}.settings .cnback:focus-visible{box-shadow:var(--focus-ring);border-radius:var(--radius-sm);outline:none}.settings .cnhead{border-bottom:1px solid var(--line);align-items:center;gap:10px;padding-bottom:10px;display:flex}.settings .cnheadmeta{flex-direction:column;flex:1;gap:3px;min-width:0;display:flex}.settings .cnheadname{color:var(--ink);align-items:center;gap:8px;font-size:15px;font-weight:600;display:flex}.settings .cnrename{border:1px solid var(--accent);background:var(--bg);color:var(--ink);font:inherit;border-radius:8px;padding:5px 9px;font-size:15px;font-weight:600}.settings .cnrename:focus{box-shadow:var(--focus-ring);outline:none}.settings .cnheadact{align-items:center;gap:8px;display:flex}.settings .cnform{flex-direction:column;gap:8px;padding-top:12px;display:flex}.settings .cnhint{color:var(--text-muted);margin:0;font-size:12px;line-height:1.45}.settings .cncatsetup{color:var(--text-muted);font-size:11px;line-height:1.4}.settings .cnwarn{color:var(--warning);font-size:12px;line-height:1.45}.settings .cnerr{color:var(--danger);margin:0 0 6px;font-size:12px}.settings .cnnote{color:var(--success);margin:0 0 6px;font-size:12px}.settings .iconbtn.sm{width:22px;height:22px}.settings .cnexp{border-collapse:collapse;width:100%;margin-bottom:6px}.settings .cnexp th{text-transform:uppercase;letter-spacing:.5px;color:var(--muted);text-align:left;padding:0 0 5px;font-size:10px;font-weight:500}.settings .cnexp td{color:var(--ink);padding:4px 0;font-size:13px}.settings .cnexpdef{width:62px}.settings .cnexpcol{width:132px}.settings .cnexpname{align-items:center;gap:8px;display:flex}.settings .cnexpname .dim{color:var(--muted)}.settings .cnexpdot{background:var(--dot);border-radius:999px;flex:none;width:8px;height:8px}.settings .cnradio{border:1.5px solid var(--line);background:var(--bg);cursor:pointer;border-radius:999px;flex:none;width:15px;height:15px;padding:0;position:relative}.settings .cnradio:hover:not(:disabled),.settings .cnradio.on{border-color:var(--accent)}.settings .cnradio.on:after{content:"";background:var(--accent);border-radius:999px;position:absolute;inset:2.5px}.settings .cnradio:disabled{opacity:.4;cursor:default}.settings .cnradio:focus-visible{box-shadow:var(--focus-ring);outline:none}.settings .cnsechead{justify-content:space-between;align-items:center;gap:8px;display:flex}.settings .cnlist{flex-direction:column;gap:5px;margin:0 0 4px;padding:0;list-style:none;display:flex}.settings .cnitem{align-items:center;gap:8px;min-height:30px;display:flex}.settings .cnid{font-family:var(--mono);color:var(--ink);font-size:12px}.settings .cnpush{margin-left:auto}.settings .cncode{font-family:var(--mono);color:var(--ink);letter-spacing:.04em;font-size:13px}.settings .cngrouppick{border:1px solid var(--line);border-radius:var(--radius-sm);background:var(--bg);color:var(--ink);font:inherit;cursor:pointer;flex:none;margin-left:auto;padding:5px 26px 5px 9px;font-size:12px}.settings .cngrouppick:focus{border-color:var(--accent);box-shadow:var(--focus-ring);outline:none}.settings .cngrouppick:disabled{opacity:.6;cursor:default}.dlist{flex:1;padding:6px;overflow-y:auto}.drow{cursor:pointer;margin:0 -6px;padding:9px 17px;font-size:14px}.drow:hover{background:var(--code)}.drow.on{background:var(--accent-soft);box-shadow:inset 2px 0 0 var(--accent)}.drow.on .ttitle,.drow.on .runwhen{color:var(--text);font-weight:600}.drow .sub{color:var(--muted);gap:6px;margin-top:2px;font-size:11px;display:flex}.tag{border-radius:var(--radius-pill);border:1px solid var(--line);align-items:center;gap:4px;padding:1px 7px;font-size:10px;display:inline-flex}.tag.sched{color:color-mix(in srgb, var(--success) 78%, var(--text));text-overflow:ellipsis;white-space:nowrap;border:none;min-width:0;padding:0;font-size:11px;overflow:hidden}.drow.trow{align-items:center;gap:8px;display:flex}.drow .statusicon{width:16px;color:var(--muted);flex:none;justify-content:center;align-items:center;display:inline-flex}.drow .statusicon.completed{color:var(--success)}.drow .statusicon.failed{color:var(--danger)}.drow .statusicon.running{color:var(--info)}.drow .statusicon.scheduled{color:var(--success)}.drow .ttitle{text-overflow:ellipsis;white-space:nowrap;flex:1;min-width:0;overflow:hidden}.drow .nextin{color:var(--success);white-space:nowrap;flex:none;font-size:11px}.drow.ttask{flex-direction:column;gap:3px;display:flex}.ttask .tline1{align-items:flex-start;gap:8px;display:flex}.ttask .ttitle{white-space:normal;text-overflow:clip;flex:1;min-width:0;line-height:1.3;overflow:visible}.ttask .tmeta{align-items:center;gap:8px;padding-left:24px;display:flex}.drow .runwhen{text-overflow:ellipsis;white-space:nowrap;min-width:0;color:var(--muted);flex:1;font-size:13px;overflow:hidden}.drow.child{border-left:2px solid var(--line);margin-left:14px;padding-left:11px}.drow .unreadcount{background:var(--accent);min-width:17px;height:17px;color:var(--text-on-accent);text-align:center;border-radius:999px;flex:none;padding:0 4px;font-size:11px;line-height:17px}.drow.unseen{background:color-mix(in srgb, var(--accent) 12%, transparent)}.drow.unseen .runwhen,.drow.unseen .ttitle{color:var(--ink);font-weight:600}.drow .dot{background:var(--accent);border-radius:50%;flex:none;width:7px;height:7px}.none{color:var(--muted);padding:16px;font-size:13px}.thread{flex:1;padding:28px 0 176px;overflow-y:auto}.inner{max-width:var(--thread-max);margin:0 auto;padding:0 20px}.daysep{justify-content:center;align-items:center;margin:20px 0 14px;display:flex}.daysep span{letter-spacing:.3px;color:var(--muted);background:var(--surface);border:1px solid var(--line);border-radius:var(--radius-pill);padding:3px 12px;font-size:11px;font-weight:600}.empty{text-align:center;color:var(--muted);margin-top:18vh}.empty h1{color:var(--ink);font-weight:600}.msg{margin:18px 0;display:flex}.msg.user{justify-content:flex-end}.bubble{border-radius:var(--radius-bubble);overflow-wrap:anywhere;max-width:80%;padding:12px 16px;font-size:15px;line-height:1.6}.msg.user .bubble{background:var(--user-bg);color:var(--user-ink);border:1px solid var(--user-bubble-border);box-shadow:inset 2px 0 0 var(--accent);white-space:pre-wrap;max-width:72%}.msg.user.queued{flex-direction:column;align-items:flex-end;gap:4px}.msg.user.queued .bubble{opacity:.6}.msg.user.queued .hint{color:var(--muted);font-size:12px}.msg.agent .bubble{background:0 0;border:none;max-width:100%;padding:0}.msg.agent .bubble.empty{color:var(--muted)}.bubble :first-child{margin-top:0}.bubble :last-child{margin-bottom:0}.bubble a{color:var(--accent)}.bubble pre{background:var(--code);font-family:var(--mono);border-radius:8px;padding:10px;font-size:13px;overflow-x:auto}.bubble code{font-family:var(--mono);font-size:.9em}.bubble img,.asset img,.viewer .vbody img{border:1px solid var(--line);border-radius:10px;max-width:100%;height:auto;margin:8px 0;display:block}a.tasklink{color:var(--accent);border-bottom:1px dashed var(--accent);cursor:pointer;font-weight:600}.note{text-align:center;color:var(--muted);margin:10px 0;font-size:13px}.note.withicon{justify-content:center;align-items:center;gap:6px;display:flex}.note.alert{color:var(--ag2-observer)}.note.pending svg{animation:.9s linear infinite note-spin}@keyframes note-spin{to{transform:rotate(360deg)}}.a2ui{border:1px solid color-mix(in srgb, var(--accent) 26%, var(--line));background:linear-gradient(180deg, color-mix(in srgb, var(--panel) 94%, var(--accent) 6%), var(--panel));border-radius:8px;max-width:min(80%,620px);margin:8px 0 12px;padding:14px;box-shadow:0 10px 28px #0000000e}.a2ui-head{align-items:center;gap:9px;min-width:0;margin-bottom:12px;display:flex}.a2ui-mark{border-radius:var(--radius-sm);width:30px;height:30px;color:var(--accent);background:color-mix(in srgb, var(--accent) 12%, var(--surface));border:1px solid color-mix(in srgb, var(--accent) 20%, var(--line));justify-content:center;align-items:center;display:inline-flex}.a2ui-headtext{flex-direction:column;gap:1px;min-width:0;display:flex}.a2ui-eyebrow{text-transform:uppercase;letter-spacing:.04em;color:var(--muted);font-size:10.5px;line-height:1.1}.a2ui-title{font-size:14px;line-height:1.2;font-weight:var(--fw-semibold);color:var(--ink);text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.a2ui-catalog{border:1px solid var(--line);background:var(--surface);border-radius:var(--radius-pill);color:var(--muted);flex:none;margin-left:auto;padding:2px 8px;font-size:10.5px}.a2ui-composing .a2ui-head{margin-bottom:14px}.a2ui-composing .a2ui-mark{animation:ag2-glow 2.8s var(--ease-in-out) infinite}.a2ui-composing .a2ui-title{color:var(--muted);font-weight:var(--fw-medium)}.a2ui-action-pending{color:var(--muted);justify-content:center;padding:10px 0 2px;display:flex}.a2ui-action-pending svg{animation:.9s linear infinite note-spin}.a2ui-skeleton{flex-direction:column;gap:9px;display:flex}.a2ui-skeleton span{border-radius:var(--radius-pill);background:linear-gradient(90deg, color-mix(in srgb, var(--accent) 8%, var(--code)) 0%, color-mix(in srgb, var(--accent) 22%, var(--code)) 50%, color-mix(in srgb, var(--accent) 8%, var(--code)) 100%);height:10px;animation:ag2-shimmer 1.6s var(--ease-in-out) infinite;background-size:220% 100%}.a2ui-main{font-size:14.5px;font-weight:var(--fw-semibold);color:var(--ink);overflow-wrap:anywhere;line-height:1.35}.a2ui-basic-col{flex-direction:column;gap:10px;min-width:0;display:flex}.a2ui-basic-row{flex-wrap:wrap;gap:10px;min-width:0;display:flex}.a2ui-basic-card{border:1px solid var(--line);background:color-mix(in srgb, var(--surface) 70%, var(--code) 30%);border-radius:7px;min-width:0;padding:10px}.a2ui-text{color:var(--a2ui-ink,var(--ink));overflow-wrap:anywhere;min-width:0;font-size:12.5px;line-height:1.4}.a2ui-icon{color:var(--a2ui-muted,var(--muted));display:inline-flex}.a2ui-divider{background:var(--a2ui-rule,var(--line));align-self:stretch;height:1px;margin:2px 0}.a2ui-divider.strong{background:var(--a2ui-rule-strong,var(--ink));height:2px}:root{--a2ui-positive:var(--ed-up-d);--a2ui-negative:var(--ed-accent-d)}.a2ui-tone-neutral{color:var(--a2ui-ink,var(--ink))}.a2ui-tone-muted{color:var(--a2ui-muted,var(--muted))}.a2ui-tone-accent{color:var(--a2ui-accent,var(--accent))}.a2ui-tone-positive{color:var(--a2ui-positive)}.a2ui-tone-negative{color:var(--a2ui-negative)}.a2ui-feature{--a2ui-ink:var(--ed-ink);--a2ui-muted:var(--ed-ink-3);--a2ui-accent:var(--ed-accent-d);--a2ui-rule:var(--ed-rule);--a2ui-rule-strong:var(--ed-ink);--a2ui-paper:var(--ed-paper);background:var(--ed-paper);color:var(--ed-ink);border:1px solid var(--ed-rule-2);border-radius:var(--radius-md);margin:8px 0 12px;padding:16px 20px 18px}.a2ui-t-h1{font-size:clamp(20px,4vw,27px);font-weight:var(--fw-bold);letter-spacing:var(--tracking-tight);line-height:1.05}.a2ui-t-h2{font-size:21px;font-weight:var(--fw-semibold);letter-spacing:-.015em;line-height:1.1}.a2ui-t-h3{font-size:16px;font-weight:var(--fw-semibold);line-height:1.25}.a2ui-t-h4{font-size:14.5px;font-weight:var(--fw-semibold);line-height:1.3}.a2ui-t-body{font-size:12.5px}.a2ui-t-caption{font-size:11.5px;line-height:1.35}.a2ui-t-eyebrow{font-family:var(--font-mono);font-size:9.5px;font-weight:var(--fw-bold);letter-spacing:.2em;text-transform:uppercase}.a2ui-t-quote{border-left:2px solid var(--a2ui-accent,var(--accent));padding-left:12px;font-size:12.5px;line-height:1.5}.a2ui-t-pill{border:1px solid var(--line);background:var(--surface);border-radius:var(--radius-pill);flex:none;align-self:flex-start;align-items:center;padding:3px 9px;font-size:11.5px;line-height:1.35;display:inline-flex}.a2ui-t-badge{border-radius:var(--radius-sm);font-family:var(--font-mono);font-size:9px;font-weight:var(--fw-bold);letter-spacing:.14em;text-transform:uppercase;border:1px solid;flex:none;align-self:flex-start;align-items:center;padding:1px 7px;line-height:1.6;display:inline-flex}.a2ui-t-code{font-family:var(--font-mono);overflow-wrap:anywhere;font-size:11.5px;line-height:1.4}.a2ui-strong{font-weight:var(--fw-bold)}.a2ui-marker{background:color-mix(in srgb, currentColor 6%, transparent);border-left:2px solid;padding:4px 8px 4px 12px}.a2ui-link{min-width:0;color:inherit;font:inherit;text-align:left;cursor:pointer;background:0 0;border:0;align-items:center;gap:5px;margin:0;padding:0;text-decoration:none;display:inline-flex}.a2ui-link:hover :where(.a2ui-text,.a2ui-metric){color:var(--a2ui-accent,var(--accent));text-underline-offset:3px;text-decoration:underline}.a2ui-link:focus-visible{border-radius:var(--radius-sm);box-shadow:var(--focus-ring);outline:none}.a2ui-metric{min-width:0;font-family:var(--font-mono);flex-direction:column;gap:2px;display:flex}.a2ui-metric.end{text-align:right;align-items:flex-end}.a2ui-metric-label{letter-spacing:var(--tracking-wide);text-transform:uppercase;color:var(--a2ui-muted,var(--muted));font-size:10.5px}.a2ui-metric-value{font-weight:var(--fw-bold);letter-spacing:-.02em;line-height:1}.a2ui-metric-value i{color:var(--a2ui-muted,var(--muted));letter-spacing:.06em;margin-left:5px;font-size:9px;font-style:normal}.a2ui-metric-delta{font-weight:var(--fw-semibold);align-items:baseline;gap:5px;display:inline-flex}.a2ui-metric-arrow{font-size:.82em}.a2ui-metric-sm{min-width:96px}.a2ui-metric-sm .a2ui-metric-value{font-size:14px}.a2ui-metric-sm .a2ui-metric-delta{font-size:12px}.a2ui-metric-md .a2ui-metric-value{font-size:20px}.a2ui-metric-md .a2ui-metric-delta{font-size:13px}.a2ui-metric-lg{flex-flow:wrap;align-items:baseline;gap:12px}.a2ui-metric-lg .a2ui-metric-value{font-size:30px}.a2ui-metric-lg .a2ui-metric-delta{font-size:14px}.a2ui-spark{flex:none;display:block}.a2ui-spark-sm{width:78px;height:30px}.a2ui-spark-md{width:160px;height:56px}.a2ui-spark-lg{flex:200px;width:100%;max-width:340px;height:120px}.a2ui-spark .ln{fill:none;stroke:currentColor;stroke-width:2px;stroke-linejoin:round;stroke-linecap:round;stroke-dasharray:1;stroke-dashoffset:1px;animation:.7s cubic-bezier(.3,.6,.3,1) .1s forwards a2ui-spark-draw}.a2ui-spark .area{fill:currentColor;stroke:none;opacity:0;animation:.45s ease-out .55s forwards a2ui-spark-area}.a2ui-spark .end{fill:currentColor;opacity:0;animation:.25s ease-out .75s forwards a2ui-spark-end}@keyframes a2ui-spark-draw{to{stroke-dashoffset:0}}@keyframes a2ui-spark-area{to{opacity:.14}}@keyframes a2ui-spark-end{to{opacity:1}}[data-animations=off] .a2ui-spark .ln{stroke-dashoffset:0;animation:none}[data-animations=off] .a2ui-spark .area{opacity:.14;animation:none}[data-animations=off] .a2ui-spark .end{opacity:1;animation:none}.a2ui-figure{border:1px solid var(--a2ui-rule,var(--line));border-radius:var(--radius-sm);background:var(--code);flex:none;min-width:0;margin:0;position:relative;overflow:hidden}.a2ui-figure img{object-fit:cover;filter:saturate(.92)contrast(1.02);width:100%;height:100%;display:block}.a2ui-figure figcaption{background:var(--a2ui-ink,var(--ink));color:var(--a2ui-paper,var(--surface));font-family:var(--font-mono);letter-spacing:.1em;text-transform:uppercase;margin:0;padding:4px 9px;font-size:8.5px;position:absolute;bottom:0;left:0}.a2ui-figure-sm{width:66px;height:50px}.a2ui-figure-md{width:120px;height:90px}.a2ui-figure-lg{flex:200px;align-self:stretch;max-width:320px;min-height:190px}.a2ui-figure-lg img{animation:20s ease-in-out infinite alternate a2ui-figure-pan}@keyframes a2ui-figure-pan{0%{transform:scale(1.06)}to{transform:scale(1.16)translate(-2.5%,-2%)}}[data-animations=off] .a2ui-figure-lg img{animation:none;transform:scale(1.06)}.a2ui-glyph{aspect-ratio:16/4;border:1px solid var(--a2ui-rule,var(--line));border-radius:var(--radius-sm);width:100%;margin-inline:auto;position:relative;overflow:hidden}.a2ui-glyph-sm{max-height:64px}.a2ui-glyph-md{max-height:96px}.a2ui-glyph-lg{max-height:132px}.a2ui-diff{border:1px solid var(--a2ui-rule,var(--line));border-radius:var(--radius-sm);background:color-mix(in srgb, var(--a2ui-rule,var(--line)) 12%, transparent);max-height:340px;font-family:var(--font-mono);margin:0;padding:8px 0;font-size:11.5px;line-height:1.5;overflow:auto}.a2ui-diff-line{white-space:pre;color:var(--a2ui-muted,var(--muted));padding:0 10px;display:block}.a2ui-diff-line.ctx{color:var(--a2ui-ink,var(--ink))}.a2ui-diff-line.meta{font-weight:var(--fw-bold)}.a2ui-diff-line.add{color:var(--a2ui-positive);background:color-mix(in srgb, var(--a2ui-positive) 14%, transparent)}.a2ui-diff-line.del{color:var(--a2ui-negative);background:color-mix(in srgb, var(--a2ui-negative) 12%, transparent)}.a2ui-tablewrap{min-width:0;margin-inline:-2px;padding:2px;overflow-x:auto}.a2ui-table{border-top:1.5px solid var(--a2ui-rule-strong,var(--ink));border-left:1px solid var(--a2ui-rule,var(--line));min-width:min-content;display:grid}.a2ui-th,.a2ui-td{border-right:1px solid var(--a2ui-rule,var(--line));border-bottom:1px solid var(--a2ui-rule,var(--line));min-width:0;padding:9px 12px}.a2ui-th,.a2ui-th-row{background:color-mix(in srgb, var(--a2ui-rule,var(--line)) 22%, transparent)}.a2ui-th-row{align-items:center;display:flex}.a2ui-th-row .a2ui-text{overflow-wrap:normal}.a2ui-td{padding-right:24px;position:relative}.a2ui-td-none{color:var(--a2ui-muted,var(--muted));font-size:12.5px}.a2ui-td-win{color:var(--a2ui-accent,var(--accent));font-size:8px;position:absolute;top:18px;right:10px;transform:translateY(-50%)}.a2ui-td.win .a2ui-text{font-weight:var(--fw-semibold)}.a2ui-th.pick,.a2ui-td.pick{background:color-mix(in srgb, var(--a2ui-accent,var(--accent)) 7%, transparent);box-shadow:inset 3px 0 0 var(--a2ui-accent,var(--accent))}@media (width<=640px){.a2ui-th,.a2ui-td{padding:8px}}.a2ui-checkbox{border:1px solid var(--line);background:color-mix(in srgb, var(--surface) 70%, var(--code) 30%);min-height:42px;color:var(--ink);cursor:pointer;border-radius:7px;align-items:center;gap:9px;padding:10px 12px;font-size:12.5px;line-height:1.35;display:flex}.a2ui-checkbox input{width:16px;height:16px;accent-color:var(--accent);cursor:pointer;margin:0}.a2ui-checkbox:has(input:focus-visible){box-shadow:var(--focus-ring);outline:none}.a2ui-button{border:1px solid var(--line);background:var(--surface);min-height:34px;color:var(--ink);font:inherit;cursor:pointer;border-radius:7px;align-self:flex-start;padding:7px 12px;font-size:12.5px;font-weight:650}.a2ui-button.primary{border-color:var(--accent);background:var(--accent);color:#fff}.a2ui-button:focus-visible{box-shadow:var(--focus-ring);outline:none}.a2ui-image{background:var(--code);border-radius:7px;width:100%;max-height:360px;display:block}.a2ui-image.icon,.a2ui-image.avatar{width:48px;height:48px}.a2ui-video{background:#000;border:0;border-radius:7px;width:100%;min-height:220px}.a2ui-field{color:var(--ink);flex-direction:column;gap:6px;font-size:12.5px;display:flex}.a2ui-field input,.a2ui-field textarea{box-sizing:border-box;border:1px solid var(--line);background:var(--code);width:100%;color:var(--ink);font:inherit;border-radius:7px;padding:8px 9px}.a2ui-field textarea{resize:vertical;min-height:88px}.a2ui-slider{grid-template-columns:1fr auto;align-items:center;display:grid}.a2ui-slider>span{grid-column:1/-1}.a2ui-slider input{padding:0}.a2ui-slider output{color:var(--muted);text-align:right;min-width:3ch}.a2ui-choice{border:0;margin:0;padding:0}.a2ui-choice legend{color:var(--ink);padding:0 0 6px;font-size:12.5px}.a2ui-choice>div{flex-direction:column;gap:6px;display:flex}.a2ui-choice label{min-height:34px;color:var(--ink);align-items:center;gap:8px;font-size:12.5px;display:flex}.a2ui-choice .chips{flex-flow:wrap}.a2ui-choice .chips label{border:1px solid var(--line);border-radius:999px;padding:3px 8px}.a2ui-list{flex-direction:column;gap:6px;margin-top:9px;display:flex}.a2ui-ranked{counter-reset:a2ui-rank var(--a2ui-rank-from,0)}.a2ui-ranked>*{counter-increment:a2ui-rank}.a2ui-ranked>:before{content:counter(a2ui-rank, decimal-leading-zero);font-family:var(--font-mono);font-size:11.5px;font-weight:var(--fw-bold);color:var(--a2ui-accent,var(--accent));flex:none;padding-top:2px}.a2ui-basic-col>.a2ui-list,.a2ui-basic-row>.a2ui-list{margin-top:0}@media (width<=720px){.a2ui{max-width:100%}}.itemtime{color:var(--text-faint);font-size:var(--text-xs);font-weight:var(--fw-regular);letter-spacing:0;text-transform:none;white-space:nowrap;flex:none}.srow .itemtime,.deliv .d .itemtime{margin-left:auto}.itemfb{max-width:var(--thread-max);margin:2px auto 6px;padding:0 20px}.genimage .itemfb,.deliv .itemfb{margin:6px 0 0;padding:0}.fb{flex-direction:column;gap:6px;display:flex}.fb-row{align-items:center;gap:4px;display:flex}.fb-thumb{width:26px;height:26px;color:var(--text-faint);border-radius:var(--radius-sm);cursor:pointer;transition:color var(--dur-fast) var(--ease-out), background var(--dur-fast) var(--ease-out), border-color var(--dur-fast) var(--ease-out);background:0 0;border:1px solid #0000;justify-content:center;align-items:center;display:inline-flex}.fb-thumb:hover{color:var(--text-muted);background:var(--surface-hover)}.fb-thumb.active{color:var(--text);background:var(--surface-hover)}.fb-thumb.on{color:var(--text)}.fb-recorded{font-size:var(--text-xs);color:var(--text-faint);text-overflow:ellipsis;white-space:nowrap;max-width:46ch;overflow:hidden}.fb-reason{align-items:center;gap:6px;display:flex}.fb-reason input{border:1px solid var(--line);background:var(--surface-sunk);min-width:0;max-width:520px;color:var(--text);border-radius:var(--radius-sm);font:inherit;font-size:var(--text-sm);flex:1;padding:7px 11px}.fb-reason input:focus{border-color:var(--accent);box-shadow:var(--focus-ring);outline:none}.fb-save{border:1px solid var(--line-strong);background:var(--surface);color:var(--text);border-radius:var(--radius-sm);font:inherit;font-size:var(--text-sm);font-weight:var(--fw-medium);cursor:pointer;transition:background var(--dur-fast) var(--ease-out), border-color var(--dur-fast) var(--ease-out);flex:none;padding:6px 13px}.fb-save:hover{background:var(--surface-hover);border-color:var(--accent-border)}.fb-save:focus-visible{box-shadow:var(--focus-ring);outline:none}.fb-save:disabled{opacity:.5;cursor:default}.fb-x{color:var(--text-muted);cursor:pointer;background:0 0;border:none;align-items:center;padding:4px;display:inline-flex}.fb-x:hover{color:var(--ink)}.fp{flex-direction:column;gap:8px;display:flex}.fp-bar{align-items:center;gap:8px;display:flex}.fp-up{border:1px solid var(--line);background:var(--surface);width:30px;height:30px;color:var(--text-muted);border-radius:var(--radius-sm);cursor:pointer;transition:border-color var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out);flex:none;justify-content:center;align-items:center;display:inline-flex}.fp-up:hover:not(:disabled){border-color:color-mix(in srgb, var(--accent) 45%, var(--line));color:var(--accent)}.fp-up:disabled{opacity:.45;cursor:default}.fp-path{min-width:0;font-family:var(--font-mono);font-size:var(--text-sm);color:var(--text-muted);text-overflow:ellipsis;white-space:nowrap;text-align:left;direction:rtl;flex:1;overflow:hidden}.fp-roots{flex-wrap:wrap;gap:6px;display:flex}.fp-root{border:1px solid var(--line);background:var(--surface);color:var(--text-muted);border-radius:var(--radius-pill);font:inherit;font-size:var(--text-xs);font-weight:var(--fw-medium);cursor:pointer;transition:border-color var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out);padding:3px 11px}.fp-root:hover{border-color:color-mix(in srgb, var(--accent) 45%, var(--line));color:var(--accent)}.fp-list{border:1px solid var(--line);border-radius:var(--radius-md);background:var(--surface-sunk);flex-direction:column;max-height:240px;display:flex;overflow-y:auto}.fp-dir{text-align:left;width:100%;color:var(--text);border:none;border-bottom:1px solid var(--line);font:inherit;font-size:var(--text-sm);cursor:pointer;transition:background var(--dur-fast) var(--ease-out);background:0 0;align-items:center;gap:9px;padding:9px 12px;display:flex}.fp-dir:last-child{border-bottom:none}.fp-dir:hover{background:var(--surface-hover)}.fp-dir .fp-name{text-overflow:ellipsis;white-space:nowrap;flex:1;min-width:0;overflow:hidden}.fp-dir>:global(svg):first-child{color:var(--text-muted)}.fp-dir>:global(svg):last-child{color:var(--text-faint)}.fp-msg{text-align:center;color:var(--text-muted);font-size:var(--text-sm);padding:18px 12px}.fp-msg.err{color:var(--ag2-observer)}.fp-new{border:1px solid var(--line);background:var(--surface);width:30px;height:30px;color:var(--text-muted);border-radius:var(--radius-sm);cursor:pointer;transition:border-color var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out);flex:none;justify-content:center;align-items:center;display:inline-flex}.fp-new:hover:not(:disabled){border-color:color-mix(in srgb, var(--accent) 45%, var(--line));color:var(--accent)}.fp-new:disabled{opacity:.45;cursor:default}.fp-new:focus-visible{box-shadow:var(--focus-ring);outline:none}.fp-newrow{border-bottom:1px solid var(--line);align-items:center;gap:9px;padding:9px 12px;display:flex}.fp-newrow>:global(svg){color:var(--text-muted);flex:none}.fp-input{min-width:0;color:var(--text);font:inherit;font-size:var(--text-sm);background:0 0;border:none;flex:1;padding:0}.fp-input:focus{outline:none}.fp-input::placeholder{color:var(--text-faint)}.fp-err{color:var(--ag2-observer);font-size:var(--text-xs)}.fp-use{border:1px solid var(--line-strong);background:var(--surface);color:var(--text);border-radius:var(--radius-sm);font:inherit;font-size:var(--text-sm);font-weight:var(--fw-semibold);cursor:pointer;transition:background var(--dur-fast) var(--ease-out), border-color var(--dur-fast) var(--ease-out);justify-content:center;align-items:center;gap:7px;padding:9px 16px;display:inline-flex}.fp-use:hover:not(:disabled){background:var(--surface-hover);border-color:var(--accent-border)}.fp-use:focus-visible{box-shadow:var(--focus-ring);outline:none}.fp-use:disabled{opacity:.5;cursor:default}.fp-use.on{background:var(--success);border-color:var(--success);color:#fff}.tools{flex-wrap:wrap;align-items:center;gap:5px;margin:8px 0;display:flex}.chip{color:var(--muted);background:var(--code);border:1px solid var(--line);border-radius:var(--radius-pill);align-items:center;gap:4px;padding:2px 9px;font-size:11px;display:inline-flex}.toolcards{flex-wrap:wrap;gap:6px;margin:2px 0 8px;display:flex}.toolcard{background:var(--code);border:1px solid var(--line);border-radius:8px;align-items:center;gap:7px;max-width:100%;padding:5px 10px;font-size:12px;display:inline-flex}.toolcard .tcicon{color:var(--muted);align-items:center;line-height:1;display:inline-flex}.toolcard .tclink{color:var(--accent,var(--danger));cursor:pointer;font:inherit;text-underline-offset:2px;text-overflow:ellipsis;white-space:nowrap;background:0 0;border:none;max-width:360px;padding:0;text-decoration:underline;overflow:hidden}.toolcard .tcdl{cursor:pointer;color:var(--muted);background:0 0;border:none;align-items:center;padding:0;display:inline-flex}.toolcard .tcdl:hover{color:var(--text,inherit)}.toolcard.gone .tcname{color:var(--muted);text-overflow:ellipsis;white-space:nowrap;max-width:360px;text-decoration:line-through;overflow:hidden}.toolcard .tcgone{color:var(--muted);font-size:11px;font-style:italic}.toolcard .tcquery,.toolcard .tcskill{color:var(--muted);text-overflow:ellipsis;white-space:nowrap;max-width:360px;overflow:hidden}.genimage{margin:8px 0}.genimage .thumbbtn,.attach .thumbbtn{cursor:zoom-in;background:0 0;border:0;padding:0;display:block}.genimage .thumb{border:1px solid var(--line);cursor:zoom-in;background:#fff;border-radius:10px;width:auto;max-width:340px;height:auto;max-height:280px;display:block}.genimage .thumbbtn:hover .thumb{border-color:color-mix(in srgb, var(--accent) 45%, var(--line))}.genimage .filechip{border:1px solid var(--line);background:var(--code);color:var(--ink);border-radius:var(--radius-sm);cursor:pointer;transition:border-color var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out);align-items:center;gap:6px;padding:7px 11px;font-size:13px;display:inline-flex}.genimage .filechip:hover{border-color:color-mix(in srgb, var(--accent) 45%, var(--line));color:var(--accent)}.attach{flex-direction:column;align-items:flex-end;gap:4px;margin:8px 0;display:flex}.attach .who{color:var(--muted);font-size:11px}.attach .thumb{border:1px solid var(--line);cursor:zoom-in;background:#fff;border-radius:10px;width:auto;max-width:260px;height:auto;max-height:220px;display:block}.attach .thumbbtn:hover .thumb{border-color:color-mix(in srgb, var(--accent) 45%, var(--line))}.attach .filechip{border:1px solid var(--line);background:var(--code);color:var(--ink);border-radius:var(--radius-sm);cursor:pointer;transition:border-color var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out);align-items:center;gap:6px;padding:7px 11px;font-size:13px;display:inline-flex}.attach .filechip:hover{border-color:color-mix(in srgb, var(--accent) 45%, var(--line));color:var(--accent)}.dots span{background:var(--muted);border-radius:50%;width:6px;height:6px;margin-right:4px;animation:1.2s infinite both blink;display:inline-block}.dots span:nth-child(2){animation-delay:.2s}.dots span:nth-child(3){animation-delay:.4s}@keyframes blink{0%,80%,to{opacity:.25}40%{opacity:1}}.subagent{border:1px solid var(--line);border-left:3px solid var(--info);background:var(--panel);border-radius:10px;max-width:80%;margin:10px 0;padding:9px 12px}.subagent .srow{align-items:center;gap:8px;min-width:0;display:flex}.subagent .sdot{background:var(--info);border-radius:50%;flex:none;width:8px;height:8px}.subagent.running .sdot{animation:1.2s infinite both blink}.subagent.completed{border-left-color:var(--success)}.subagent.completed .sdot{background:var(--success)}.subagent.failed,.subagent.cancelled{border-left-color:var(--danger)}.subagent.failed .sdot,.subagent.cancelled .sdot{background:var(--danger)}.subagent .sname{color:var(--ink);text-transform:capitalize;overflow-wrap:anywhere;font-size:12px;font-weight:700}.subagent .sstatus{color:var(--muted);text-transform:uppercase;letter-spacing:.04em;margin-left:auto;font-size:11px}.subagent .sobj{color:var(--ink);overflow-wrap:anywhere;margin-top:5px;font-size:13px}.subagent .sres,.subagent .serr{color:var(--muted);overflow-wrap:anywhere;margin-top:6px;font-size:12px}.subagent .serr{color:var(--danger)}.subagent .srow{cursor:pointer;-webkit-user-select:none;user-select:none}.subagent .scount{background:var(--line);min-width:16px;height:16px;color:var(--muted);text-align:center;border-radius:999px;flex:none;padding:0 4px;font-size:10px;line-height:16px}.subagent .scaret{color:var(--muted);flex:none;margin-left:6px;font-size:10px}.subagent .skids{border-left:2px solid var(--line);flex-direction:column;margin-top:8px;padding-left:10px;display:flex}.subagent .skids .msg{margin:6px 0}.subagent .skids .bubble{max-width:100%;font-size:14px}.subagent .skids .subagent{max-width:100%}.card{border:1px solid var(--accent-border);border-radius:12px;max-width:80%;margin:12px 0;padding:12px 14px}.card .k{text-transform:uppercase;letter-spacing:1px;color:var(--accent);align-items:center;gap:6px;font-size:11px;font-weight:700;display:inline-flex}.card .t{margin:4px 0 8px;font-size:14px}.card button,.composer .csend,.panel button{font-family:var(--sans);cursor:pointer}.card .open{font-size:13px;font-weight:var(--fw-medium);border:1px solid var(--accent);color:var(--accent);border-radius:var(--radius-sm);transition:background var(--dur-fast) var(--ease-out);background:0 0;align-items:center;gap:6px;padding:6px 12px;display:inline-flex}.card .open:hover{background:var(--accent-soft)}.deliv{border:1px solid var(--line);border-radius:10px;margin:10px 0;padding:10px 12px}.deliv .d{color:var(--muted);align-items:center;gap:6px;margin-bottom:4px;font-size:12px;display:flex}.deliv .dprev{color:var(--ink);overflow-wrap:anywhere;margin:2px 0;font-size:13px}.asset{background:var(--code);border-radius:8px;max-height:260px;margin:4px 0;padding:10px 12px;font-size:13px;overflow:auto}.viewbtn{color:var(--accent);border:1px solid var(--line);border-radius:var(--radius-sm);cursor:pointer;font-size:12px;font-family:var(--sans);transition:border-color var(--dur-fast) var(--ease-out), background var(--dur-fast) var(--ease-out);background:0 0;align-items:center;gap:5px;margin:4px 0 2px;padding:5px 11px;display:inline-flex}.viewbtn:hover{border-color:color-mix(in srgb, var(--accent) 45%, var(--line));background:var(--accent-soft)}.md>:first-child{margin-top:0}.md>:last-child{margin-bottom:0}.md p{margin:0 0 10px}.md ul,.md ol{margin:0 0 10px;padding-left:22px}.md li{margin:3px 0}.md h1,.md h2,.md h3{margin:14px 0 8px;line-height:1.25}.md h1{font-size:20px}.md h2{font-size:17px}.md h3{font-size:15px}.md a{color:var(--accent)}.md code{font-family:var(--mono);background:var(--code);border-radius:5px;padding:1.5px 5px;font-size:12px}.md pre{background:var(--code);border-radius:10px;margin:0 0 10px;padding:12px 14px;overflow-x:auto}.md pre code{background:0 0;padding:0}.md blockquote{border-left:3px solid var(--line);color:var(--muted);margin:0 0 10px;padding-left:12px}.md table{border-collapse:collapse;margin:0 0 10px;font-size:13px}.md th,.md td{border:1px solid var(--line);padding:5px 9px}.inquiry{border:1px solid var(--accent-border);border-radius:12px;margin:12px 0;padding:12px 14px}.inquiry.resolved{border-color:var(--line);opacity:.6}.inquiry .opts{flex-wrap:wrap;gap:6px;margin-top:8px;display:flex}.inquiry .opts button{border:1px solid var(--line);background:var(--bg);color:var(--ink);border-radius:8px;padding:5px 11px}.inquiry input{border:1px solid var(--line);background:var(--bg);width:100%;color:var(--ink);border-radius:8px;margin-top:8px;padding:8px}.inquiry .idetail{background:var(--code);border:1px solid var(--line);white-space:pre-wrap;word-break:break-word;border-radius:8px;max-height:320px;margin:8px 0;padding:10px 12px;font-family:ui-monospace,monospace;font-size:12px;line-height:1.5;overflow:auto}.composer{background:linear-gradient(to bottom, transparent, var(--bg) 42%);pointer-events:none;padding:28px 20px 16px;position:absolute;bottom:0;left:16px;right:16px}.composer>*{pointer-events:auto}.cnote{max-width:calc(var(--thread-max) - 40px);text-align:center;color:var(--muted);margin:8px auto 0;font-size:12px}.scrolldown{z-index:5;border:1px solid var(--line);background:var(--surface);width:36px;height:36px;color:var(--ink);cursor:pointer;box-shadow:var(--shadow-lg);transition:border-color var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out);border-radius:999px;justify-content:center;align-items:center;display:inline-flex;position:absolute;bottom:148px;left:50%;transform:translate(-50%)}.scrolldown:hover{border-color:color-mix(in srgb, var(--accent) 45%, var(--line));color:var(--accent)}.inputbox{max-width:calc(var(--thread-max) - 40px);border:1px solid var(--line-strong);border-radius:var(--radius-md);background:var(--surface-elevated);box-shadow:var(--shadow-md);transition:border-color var(--dur-fast) var(--ease-out), box-shadow var(--dur-fast) var(--ease-out);margin:0 auto;padding:10px 10px 10px 16px}.inputbox:focus-within{border-color:color-mix(in srgb, var(--accent) 50%, var(--line-strong));box-shadow:var(--shadow-md)}.cinput{resize:none;width:100%;color:var(--ink);font:inherit;font-size:var(--text-md);background:0 0;border:none;max-height:200px;padding:8px 4px 6px;display:block}.cinput:focus{outline:none}.cbar{align-items:center;gap:8px;margin-top:4px;display:flex}.cbar-right{align-items:center;gap:6px;margin-left:auto;display:flex}.cbtn{width:34px;height:34px;color:var(--muted);cursor:pointer;transition:background var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out);background:0 0;border:none;border-radius:999px;justify-content:center;align-items:center;display:inline-flex}.cbtn:hover:not(:disabled){background:var(--surface-hover);color:var(--ink)}.cbtn:disabled{opacity:.4;cursor:default;pointer-events:none}.cbtn.live.on{background:var(--accent);color:var(--text-on-accent);animation:1.4s infinite micpulse}.csend{background:var(--accent);width:36px;height:36px;color:var(--text-on-accent);cursor:pointer;box-shadow:var(--shadow-accent);transition:background var(--dur-fast) var(--ease-out), opacity var(--dur-fast) var(--ease-out);border:none;border-radius:999px;justify-content:center;align-items:center;display:inline-flex}.csend:hover:not(:disabled){background:var(--accent-hover)}.csend:disabled{opacity:.4;cursor:default;box-shadow:none;pointer-events:none}.csend.stop{background:var(--surface);color:var(--ink);border:1px solid var(--line);box-shadow:none}.csend.stop:hover{border-color:var(--danger);color:var(--danger)}@keyframes micpulse{0%,to{box-shadow:0 0 0 0 color-mix(in srgb, var(--accent) 50%, transparent)}50%{box-shadow:0 0 0 6px color-mix(in srgb, var(--accent) 0%, transparent)}}.bubble.voice{font-style:italic}.bubble.voice:before{content:"🎙 ";font-style:normal}.mhead{border-bottom:1px solid var(--line);background:var(--panel);align-items:center;gap:10px;padding:10px 20px;display:flex}.mhead .back{border:1px solid var(--line);background:var(--surface);color:var(--ink);border-radius:var(--radius-sm);cursor:pointer;transition:border-color var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out);align-items:center;gap:4px;padding:5px 11px;display:inline-flex}.mhead .back:hover{border-color:color-mix(in srgb, var(--accent) 45%, var(--line));color:var(--accent)}.mhead .titles{flex-direction:column;gap:1px;min-width:0;display:flex}.mhead .title{font-family:var(--font-display);font-weight:var(--fw-bold);font-size:var(--text-lg);line-height:var(--leading-tight);text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.mhead .msub{font-family:var(--mono);font-size:var(--text-xs);letter-spacing:-.01em;color:var(--muted);text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.mhead .hactions{align-items:center;gap:8px;margin-left:auto;display:flex}.badge{border:1px solid var(--accent-border);background:var(--accent-soft);color:var(--accent);font-size:11px;font-weight:var(--fw-medium);border-radius:999px;padding:1px 8px}.panel{border:1px solid var(--line);max-width:var(--thread-max);border-radius:12px;margin:0 auto 14px;padding:12px 14px}.panel .ptitle{color:var(--muted);text-transform:uppercase;letter-spacing:1px;font-size:12px}.panel .tasktime{font-size:var(--text-sm);color:var(--text-muted);align-items:center;gap:6px;margin-top:6px;display:inline-flex}.panel .taskerror{font-size:var(--text-sm);line-height:var(--leading-snug);color:var(--ag2-observer);background:color-mix(in srgb, var(--ag2-observer) 9%, transparent);border:1px solid color-mix(in srgb, var(--ag2-observer) 28%, transparent);border-radius:var(--radius-sm);overflow-wrap:anywhere;align-items:flex-start;gap:7px;margin-top:8px;padding:9px 11px;display:flex}.panel .taskerror strong{font-weight:var(--fw-semibold)}.panel .child{border-left:2px solid var(--line);margin:6px 0;padding-left:10px}.panel .runlink{color:var(--accent,var(--danger));cursor:pointer;font:inherit;text-underline-offset:2px;background:0 0;border:none;padding:0;text-decoration:underline}.hitl{border-bottom:1px solid var(--line);background:var(--panel);max-height:40vh;padding:10px 20px;overflow-y:auto}.hitlhead{text-transform:uppercase;letter-spacing:1px;color:var(--accent);margin-bottom:6px;font-size:12px;font-weight:700}.qcard{border:1px solid var(--accent-border);border-radius:10px;max-width:760px;margin:6px 0;padding:10px 12px}.qcard .qk{color:var(--muted);font-size:11px}.qcard .qk .tasklink{font:inherit;color:var(--accent);cursor:pointer;background:0 0;border:0;padding:0}.qcard .qt{margin:4px 0;font-size:14px}.qcard .qd{color:var(--ink);background:var(--code);border:1px solid var(--line);white-space:pre-wrap;word-break:break-word;border-radius:6px;max-height:240px;margin:4px 0;padding:8px 10px;font-family:ui-monospace,monospace;font-size:12px;overflow:auto}.qcard .qopts{flex-wrap:wrap;gap:6px;display:flex}.qcard .qopts button{border:1px solid var(--line);background:var(--bg);color:var(--ink);cursor:pointer;border-radius:8px;padding:5px 11px}.qcard input{border:1px solid var(--line);background:var(--bg);width:100%;color:var(--ink);border-radius:8px;padding:8px}.pending{flex-wrap:wrap;gap:6px;padding:2px 4px 4px;display:flex}.pending .chip{align-items:center;gap:4px;display:inline-flex}.pending .chip .x{color:var(--muted);cursor:pointer;background:0 0;border:none;padding:0 2px;font-size:14px}.modelsw{align-items:center;display:inline-flex}.modelsw-wrap{display:inline-block;position:relative}.modelsw-btn{color:var(--muted);font:inherit;cursor:pointer;transition:background var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out);background:0 0;border:none;border-radius:999px;align-items:center;gap:6px;padding:5px 9px;font-size:12px;display:inline-flex}.modelsw-btn:hover:not(:disabled){background:var(--surface-hover);color:var(--ink)}.modelsw-btn:disabled{opacity:.6;cursor:default}.modelsw-name{font-family:var(--mono);letter-spacing:-.01em;align-items:center;gap:4px;display:inline-flex}.modelsw-name.muted{color:var(--muted)}.modelsw-dot{background:var(--ok,var(--success));border-radius:50%;flex:none;width:7px;height:7px}.modelsw-dot.warn{background:var(--muted)}.modelsw-pin,.modelsw-empty{color:var(--muted);font-size:12px}.modelsw-empty{cursor:pointer;text-underline-offset:2px;font:inherit;color:var(--muted);background:0 0;border:none;padding:0;font-size:12px;text-decoration:underline}.modelsw-empty:hover{color:var(--accent)}.modelsw-scrim{z-index:9;cursor:default;background:0 0;border:none;position:fixed;inset:0}.modelsw-menu{z-index:10;background:var(--surface-elevated);border:1px solid var(--line);border-radius:var(--radius-md);min-width:240px;max-width:min(360px,90vw);max-height:320px;box-shadow:var(--shadow-lg);flex-direction:column;gap:2px;padding:4px;display:flex;position:absolute;bottom:calc(100% + 6px);left:0;overflow-y:auto}.modelsw-menu.down{top:calc(100% + 6px);bottom:auto}.modelsw-tag{letter-spacing:.04em;text-transform:uppercase;color:var(--muted);border:1px solid var(--line);border-radius:var(--radius-pill,999px);padding:0 6px;font-size:10px;line-height:15px}.modelsw-item{text-align:left;width:100%;color:var(--ink);border-radius:var(--radius-sm);cursor:pointer;font:inherit;background:0 0;border:none;align-items:center;gap:8px;padding:7px 9px;display:flex}.modelsw-item:hover:not(:disabled){background:var(--code)}.modelsw-item.active{background:color-mix(in srgb, var(--accent) 10%, transparent)}.modelsw-item:disabled{opacity:.5;cursor:default}.modelsw-itemmeta{flex-direction:column;flex:1;min-width:0;display:flex}.modelsw-item .modelsw-name{font-size:13px}.modelsw-sub{color:var(--muted);white-space:nowrap;text-overflow:ellipsis;font-size:11px;overflow:hidden}.modelsw-manage{color:var(--muted);border-radius:var(--radius-sm);text-align:left;cursor:pointer;font:inherit;border:none;border-top:1px solid var(--line);background:0 0;margin-top:2px;padding:7px 9px;font-size:12px}.modelsw-manage:hover{color:var(--accent)}.modal-backdrop{z-index:20;animation:ag2-fade var(--dur-base) var(--ease-out) both;background:#00000080;position:fixed;inset:0}.modal{z-index:21;background:var(--surface-elevated);border:1px solid var(--line);border-radius:var(--radius-lg);width:min(560px,92vw);box-shadow:var(--shadow-lg);animation:modal-pop var(--dur-base) var(--ease-spring) both;flex-direction:column;gap:10px;padding:20px;display:flex;position:fixed;top:50%;left:50%;transform:translate(-50%,-50%)}@keyframes modal-pop{0%{opacity:0;transform:translate(-50%,-50%)scale(.96)}to{opacity:1;transform:translate(-50%,-50%)scale(1)}}@media (prefers-reduced-motion:reduce){.modal,.modal-backdrop{animation:none}}.modal h2{margin:0}.modal>h2{padding-right:34px}.modal textarea{border:1px solid var(--line);min-height:140px;font-family:var(--mono);background:var(--bg);color:var(--ink);border-radius:8px;padding:10px;font-size:12px}.modal-backdrop.over{z-index:29}.modal.over{z-index:30}.modal .muted{color:var(--muted)}.gsteps{color:var(--ink);flex-direction:column;gap:6px;margin:4px 0 0;padding-left:20px;font-size:13px;line-height:1.5;display:flex}.gsteps a{color:var(--accent)}.gwarn{border:1px solid var(--warn,#c9922b);background:#c9922b1a;border-radius:8px;margin:0 0 14px;padding:10px 12px;font-size:13px;line-height:1.5}.gwarn p{margin:0 0 6px}.ghint{background:var(--panel2,#7f7f7f1f);-webkit-user-select:all;user-select:all;border-radius:6px;margin:6px 0 12px;padding:8px 10px;font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-size:12px;overflow-x:auto}.modal-close{border:1px solid var(--line);background:var(--surface);color:var(--ink);border-radius:var(--radius-sm);cursor:pointer;font-family:var(--sans);font-size:13px;font-weight:var(--fw-medium);transition:border-color var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out);align-self:flex-end;align-items:center;gap:6px;padding:7px 14px;display:inline-flex}.modal-close:hover{border-color:color-mix(in srgb, var(--accent) 45%, var(--line));color:var(--accent)}.modal-x{width:30px;height:30px;color:var(--text-muted);cursor:pointer;transition:color var(--dur-fast) var(--ease-out), background var(--dur-fast) var(--ease-out);background:0 0;border:none;border-radius:8px;justify-content:center;align-items:center;padding:0;font-size:22px;line-height:1;display:inline-flex;position:absolute;top:12px;right:12px}.modal-x:hover{color:var(--ink);background:var(--code)}.rail.viewer{border-left:1px solid var(--line);background:var(--panel);flex-direction:column;min-width:0;display:flex;position:relative;overflow:hidden}.rail-resizer{z-index:3;cursor:col-resize;touch-action:none;width:7px;position:absolute;top:0;bottom:0;left:-3px}.rail-resizer:after{content:"";width:1px;transition:background var(--dur-fast) var(--ease-out);background:0 0;position:absolute;top:0;bottom:0;left:3px}.rail-resizer:hover:after,.rail-resizer.dragging:after{background:var(--accent)}.rail-resizer.left{left:auto;right:-3px}.rail-resizer.left:after{left:auto;right:3px}.viewer .vhead{align-items:center;gap:10px;padding:12px 14px;display:flex}.viewer .vhead h2{text-overflow:ellipsis;white-space:nowrap;flex:1;min-width:0;margin:0;font-size:15px;overflow:hidden}.viewer .vhead .vtitle{font:inherit;text-overflow:ellipsis;white-space:nowrap;text-align:left;min-width:0;color:inherit;cursor:pointer;transition:color var(--dur-fast) var(--ease-out);background:0 0;border:none;flex:1;margin:0;padding:0;font-size:15px;font-weight:600;overflow:hidden}.viewer .vhead .vtitle:hover{color:var(--accent);text-underline-offset:2px;text-decoration:underline}.viewer .vhead .vtitle:focus-visible{outline:2px solid var(--accent);outline-offset:2px;border-radius:4px}.viewer .vhead .dl{color:var(--muted);flex:none;align-items:center;display:inline-flex}.viewer .vhead .dl:hover{color:var(--text,inherit)}.viewer .vlink{font:inherit;color:var(--accent);cursor:pointer;text-underline-offset:2px;background:0 0;border:none;padding:0;text-decoration:underline}.viewer .vlink:hover{color:var(--accent);opacity:.8}.viewer .vhead .vseg{background:var(--code);border-radius:8px;flex:none;gap:2px;padding:2px;display:inline-flex}.viewer .vhead .vsegbtn{width:26px;height:22px;color:var(--text-muted);cursor:pointer;transition:color var(--dur-fast) var(--ease-out), background var(--dur-fast) var(--ease-out);background:0 0;border:none;border-radius:6px;justify-content:center;align-items:center;padding:0;display:inline-flex}.viewer .vhead .vsegbtn:hover{color:var(--ink)}.viewer .vhead .vsegbtn.on{color:var(--ink);background:var(--panel);box-shadow:0 1px 2px #00000014}.viewer .vhead .cp{width:26px;height:26px;color:var(--text-muted);cursor:pointer;transition:color var(--dur-fast) var(--ease-out), background var(--dur-fast) var(--ease-out);background:0 0;border:none;border-radius:7px;flex:none;justify-content:center;align-items:center;padding:0;display:inline-flex}.viewer .vhead .cp:hover{color:var(--ink);background:var(--code)}.viewer .vhead .cp.copied{color:var(--accent)}.viewer .vhead .exp{width:26px;height:26px;color:var(--text-muted);cursor:pointer;transition:color var(--dur-fast) var(--ease-out), background var(--dur-fast) var(--ease-out);background:0 0;border:none;border-radius:7px;flex:none;justify-content:center;align-items:center;padding:0;display:inline-flex}.viewer .vhead .exp:hover{color:var(--ink);background:var(--code)}.viewer .vhead .exp[aria-pressed=true]{color:var(--accent)}.viewer .rail-x{width:26px;height:26px;color:var(--text-muted);cursor:pointer;transition:color var(--dur-fast) var(--ease-out), background var(--dur-fast) var(--ease-out);background:0 0;border:none;border-radius:7px;flex:none;justify-content:center;align-items:center;padding:0;font-size:20px;line-height:1;display:inline-flex}.viewer .rail-x:hover{color:var(--ink);background:var(--code)}.viewer .vhead .vdirty{color:var(--accent);flex:none;font-size:10px;line-height:1}.viewer .vhead .vsave{background:var(--accent);color:#fff;font:inherit;cursor:pointer;transition:opacity var(--dur-fast) var(--ease-out);border:none;border-radius:7px;flex:none;padding:4px 12px;font-size:12.5px;font-weight:600}.viewer .vhead .vsave:hover:not(:disabled){opacity:.9}.viewer .vhead .vsave:disabled{background:var(--code);color:var(--text-muted);cursor:default}.viewer .vhead .vmentions-wrap{flex:none;display:inline-flex;position:relative}.viewer .vhead .vmentions{height:26px;color:var(--text-muted);cursor:pointer;transition:color var(--dur-fast) var(--ease-out), background var(--dur-fast) var(--ease-out);background:0 0;border:none;border-radius:7px;align-items:center;gap:3px;padding:0 6px;display:inline-flex}.viewer .vhead .vmentions:hover,.viewer .vhead .vmentions.on{color:var(--ink);background:var(--code)}.viewer .vhead .vmentions-badge{font-size:11px;font-weight:600;line-height:1}.viewer .vhead .vmentions-pop{z-index:20;border:1px solid var(--line);background:var(--panel);border-radius:10px;min-width:220px;max-width:320px;max-height:320px;padding:4px;position:absolute;top:calc(100% + 6px);right:0;overflow-y:auto;box-shadow:0 8px 28px #00000029}.viewer .vhead .vmentions-row{width:100%;color:var(--ink);font:inherit;text-align:left;cursor:pointer;transition:background var(--dur-fast) var(--ease-out);background:0 0;border:none;border-radius:7px;align-items:center;gap:8px;padding:7px 9px;font-size:13px;display:flex}.viewer .vhead .vmentions-row:hover{background:var(--code)}.viewer .vhead .vmentions-row>:global(svg){color:var(--text-muted);flex:none}.viewer .vhead .vmentions-row-title{text-overflow:ellipsis;white-space:nowrap;flex:1;min-width:0;overflow:hidden}.viewer .vhead .vmentions-row-kind{text-transform:uppercase;letter-spacing:.03em;color:var(--text-muted);flex:none;font-size:10.5px;font-weight:600}.viewer .vbody{flex:1;min-height:0;padding:16px 18px;font-size:14px;line-height:1.6;overflow-y:auto}.viewer .vbody.native{padding:8px;overflow:hidden}.viewer .vbody.editing{flex-direction:column;gap:10px;display:flex;overflow:hidden}.viewer .vedit{box-sizing:border-box;resize:none;border:1px solid var(--line);background:var(--code);width:100%;min-height:0;color:var(--ink);white-space:pre;border-radius:6px;flex:1;padding:14px;font-family:ui-monospace,monospace;font-size:12.5px;line-height:1.5;overflow:auto}.viewer .vedit:focus-visible{outline:2px solid var(--accent);outline-offset:-1px;border-color:var(--accent)}.viewer .vsaveerr{background:color-mix(in srgb, var(--danger) 12%, transparent);color:var(--danger);border-radius:6px;flex:none;margin:0;padding:8px 12px;font-size:13px}.viewer .vconflict{background:color-mix(in srgb, var(--accent) 8%, transparent);border:1px solid color-mix(in srgb, var(--accent) 30%, transparent);border-radius:8px;flex-direction:column;flex:none;gap:10px;margin:0;padding:12px;display:flex}.viewer .vconflict-msg{color:var(--ink);margin:0;font-size:13px;line-height:1.5}.viewer .vconflict-actions{gap:8px;display:flex}.viewer .vconflict-btn{text-align:left;border:1px solid var(--line);background:var(--panel);color:var(--ink);font:inherit;cursor:pointer;transition:border-color var(--dur-fast) var(--ease-out);border-radius:7px;flex-direction:column;flex:1;gap:2px;padding:8px 12px;display:flex}.viewer .vconflict-btn:hover:not(:disabled){border-color:color-mix(in srgb, var(--accent) 55%, var(--line))}.viewer .vconflict-btn:disabled{opacity:.6;cursor:default}.viewer .vconflict-verb{font-size:13px;font-weight:600}.viewer .vconflict-note{color:var(--muted);font-size:11.5px}.viewer .vframe{background:#fff;border:0;border-radius:6px;width:100%;height:100%}.viewer .vimg{max-width:100%;height:auto;max-height:100%;margin:0 auto;display:block}.viewer .vmissing{text-align:center;height:100%;color:var(--muted);flex-direction:column;justify-content:center;align-items:center;gap:10px;padding:24px;display:flex}.viewer .vmissing-msg{max-width:42ch;margin:0;font-size:13px;line-height:1.5}.viewer .vmissing-path{word-break:break-all;color:var(--ink);background:var(--code);border-radius:6px;padding:6px 10px;font-family:ui-monospace,monospace;font-size:12px}.viewer .vmissing-detail{color:var(--muted);word-break:break-word;margin:0;font-size:11.5px}.viewer .vcode{white-space:pre;background:var(--code);border-radius:6px;padding:14px;font-family:ui-monospace,monospace;font-size:12.5px;line-height:1.5;overflow:auto}.viewer .vtext{white-space:pre-wrap;word-break:break-word;background:var(--code);border-radius:6px;padding:14px;font-family:ui-monospace,monospace;font-size:12.5px;line-height:1.5}.voicepick .vlist{grid-template-columns:1fr 1fr;gap:6px;max-height:56vh;display:grid;overflow-y:auto}.vrow{text-align:left;border:1px solid var(--line);background:var(--bg);color:var(--ink);cursor:pointer;border-radius:9px;align-items:baseline;gap:8px;padding:9px 11px;display:flex}.vrow:hover{border-color:color-mix(in srgb, var(--accent) 45%, var(--line))}.vrow.on{border-color:var(--accent);background:var(--code)}.vrow .vn{font-weight:600}.vrow .vs{color:var(--muted);font-size:11px}.vrow .vp{color:var(--accent);margin-left:auto;font-size:11px}.app.ag2,.app.rail{grid-template-columns:var(--drawer-w,270px) 1fr var(--rail-w,380px)}.app.rail.railfull{grid-template-columns:var(--drawer-w,270px) 0 1fr}.app.rail.railfull .main{overflow:hidden}.inspector{border-left:1px solid var(--line);background:var(--panel);flex-direction:column;min-width:0;display:flex;position:relative;overflow:hidden}.insp-head{align-items:center;gap:8px;padding:12px 14px 4px;display:flex}.insp-title{font-weight:700}.insp-head .linklike{margin-left:auto}.linklike{color:var(--accent);font:inherit;cursor:pointer;background:0 0;border:none;padding:0;font-size:12px}.insp-x{color:var(--muted);cursor:pointer;transition:color var(--dur-fast) var(--ease-out);background:0 0;border:none;align-items:center;padding:0 2px;display:inline-flex}.insp-x:hover{color:var(--ink)}.insp-sub{color:var(--muted);padding:0 14px 8px;font-size:12px;line-height:1.4}.insp-sub code{background:var(--code);border-radius:4px;padding:0 4px}.insp-list{flex:1;padding:4px 8px;overflow-y:auto}.insp-empty{color:var(--muted);text-align:center;padding:16px;font-size:13px}.insp-row{cursor:pointer;border-radius:7px;align-items:center;gap:8px;padding:5px 6px;font-size:12.5px;display:flex}.insp-row:hover{background:var(--code)}.insp-dot{border-radius:50%;flex:none;width:8px;height:8px}.insp-name{font-family:var(--mono);text-overflow:ellipsis;white-space:nowrap;min-width:0;overflow:hidden}.insp-sub2{text-transform:uppercase;letter-spacing:.04em;flex:none;font-size:10px}.insp-layer{text-transform:uppercase;color:var(--muted);border:1px solid var(--line);border-radius:4px;flex:none;padding:0 3px;font-size:9px}.insp-time{color:var(--muted);font-variant-numeric:tabular-nums;flex:none;margin-left:auto;font-size:11px}.insp-raw{background:var(--code);font-family:var(--mono);border-radius:7px;max-height:240px;margin:0 6px 6px 22px;padding:8px 10px;font-size:11px;line-height:1.4;overflow-x:auto}.insp-legend{border-top:1px solid var(--line);flex-wrap:wrap;gap:6px 12px;padding:8px 14px;display:flex}.insp-leg{color:var(--muted);align-items:center;gap:5px;font-size:11px;display:flex}.mhead .ag2toggle{font-family:var(--mono);border:1px solid var(--line);background:var(--surface);color:var(--muted);border-radius:var(--radius-sm);cursor:pointer;transition:all var(--dur-base) var(--ease-out);align-items:center;gap:6px;padding:5px 10px;font-size:12px;display:inline-flex}.mhead .ag2toggle:hover{border-color:color-mix(in srgb, var(--accent) 45%, var(--line));color:var(--accent)}.mhead .ag2toggle.on{background:var(--accent-soft);color:var(--accent);border-color:var(--accent-border)}.ag2tag{font-family:var(--mono);color:var(--accent);opacity:.85;margin:-6px 0 10px;padding-left:2px;font-size:10.5px}.ag2tag.right{text-align:right;padding-right:2px}.ag2tag.applayer{color:var(--muted)}.ag2-rise:has(>.bs) .ag2tag{margin:6px 0 10px}.modal.poweredby{width:min(640px,94vw);max-height:86vh}.poweredby .setsec{text-transform:uppercase;letter-spacing:1px;color:var(--muted);margin:10px 0 2px;font-size:11px}.poweredby .pbscroll{flex-direction:column;gap:4px;display:flex;overflow-y:auto}.poweredby .pbrow{align-items:flex-start;gap:9px;padding:5px 2px;display:flex}.poweredby .pbrow .insp-dot{margin-top:5px}.poweredby .pbname{font-family:var(--mono);color:var(--ink);font-size:13px}.poweredby .pbwhat{color:var(--muted);font-size:12.5px;line-height:1.4}.poweredby .mfoot{justify-content:flex-end;align-items:center;gap:10px;margin-top:6px;display:flex}.poweredby .mfoot .open{text-decoration:none}.poweredby .mfoot .pbver{color:var(--muted);font-variant-numeric:tabular-nums;margin-right:auto;font-size:12px}.poweredby .pbback{cursor:pointer;font:inherit;font-size:var(--text-xs);font-weight:var(--fw-semibold);color:var(--text-muted);background:0 0;border:none;align-self:flex-start;align-items:center;gap:3px;margin:0 0 -4px -4px;padding:4px;display:inline-flex}.poweredby .pbback:hover{color:var(--accent)}.poweredby .pbback:focus-visible{box-shadow:var(--focus-ring);border-radius:var(--radius-sm);outline:none}.dfoot{gap:6px;display:flex}.dfoot .settingsbtn{text-align:center;flex:1;justify-content:center;width:auto}.usagehud{color:var(--muted);border-top:1px solid var(--line);cursor:default;align-items:center;gap:6px;padding:6px 12px;font-size:11.5px;display:flex}.usagehud .uhicon{align-items:center;display:inline-flex}.usagehud .uhlabel{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.spin.svelte-13so817{animation:1s linear infinite svelte-13so817-spin}@keyframes svelte-13so817-spin{to{transform:rotate(360deg)}}.appearance.svelte-1sms2nq{flex-direction:column;gap:8px;display:flex}.ap-label.svelte-1sms2nq{font-size:var(--text-xs);text-transform:uppercase;letter-spacing:var(--tracking-eyebrow);color:var(--text-muted)}.ap-themes.svelte-1sms2nq{gap:8px;display:flex}.ap-theme.svelte-1sms2nq{cursor:pointer;border:1px solid var(--line);background:var(--surface);color:var(--text-muted);border-radius:var(--radius-sm);font:inherit;font-size:var(--text-sm);font-weight:var(--fw-medium);transition:border-color var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out), background var(--dur-fast) var(--ease-out);align-items:center;gap:6px;padding:7px 14px;display:inline-flex}.ap-theme.svelte-1sms2nq:hover{border-color:var(--accent);color:var(--accent)}.ap-theme.on.svelte-1sms2nq{border-color:var(--accent);background:var(--accent-soft);color:var(--accent)}.pf.svelte-5uf3hr{flex-direction:column;gap:16px;display:flex}.pf-field.svelte-5uf3hr{flex-direction:column;gap:6px;display:flex}.pf-flabel.svelte-5uf3hr{align-items:baseline;gap:8px;display:flex}.pf-flabel.svelte-5uf3hr>span:where(.svelte-5uf3hr):first-child{font-size:var(--text-sm);font-weight:var(--fw-semibold)}.hint.svelte-5uf3hr{font-size:var(--text-xs);color:var(--text-muted)}.pf-input.svelte-5uf3hr{background:var(--surface-sunk);border:1px solid var(--line);border-radius:var(--radius-sm);color:var(--text-muted);transition:border-color var(--dur-fast) var(--ease-out), box-shadow var(--dur-fast) var(--ease-out);align-items:center;gap:9px;padding:0 12px;display:flex}.pf-input.svelte-5uf3hr:focus-within{border-color:var(--accent);box-shadow:var(--focus-ring)}.pf-input.svelte-5uf3hr input:where(.svelte-5uf3hr){min-width:0;color:var(--text);font:inherit;font-size:var(--text-sm);background:0 0;border:none;outline:none;flex:1;padding:11px 0}.pf-dots.svelte-5uf3hr{flex-wrap:wrap;gap:10px;padding:4px;display:flex}.pf-dot.svelte-5uf3hr{cursor:pointer;border-radius:var(--radius-pill);background:var(--dot);color:#fff;width:30px;height:30px;transition:transform var(--dur-fast) var(--ease-out), box-shadow var(--dur-fast) var(--ease-out);border:2px solid #0000;flex:none;justify-content:center;align-items:center;display:inline-flex}.pf-dot.svelte-5uf3hr:hover{transform:scale(1.08)}.pf-dot.on.svelte-5uf3hr{box-shadow:0 0 0 2px var(--bg), 0 0 0 4px var(--dot)}.pf-custom.svelte-5uf3hr{padding:0;position:relative;overflow:hidden}.pf-custom.rainbow.svelte-5uf3hr{background:conic-gradient(from 90deg,#f95339,#ec5d18,#e0b400,#2f8c44,#109e91,#2f6fe0,#7a52ec,#f95339)}.pf-custom.rainbow.on.svelte-5uf3hr{box-shadow:0 0 0 2px var(--bg), 0 0 0 4px var(--accent)}.pf-custom.svelte-5uf3hr input:where(.svelte-5uf3hr){opacity:0;cursor:pointer;background:0 0;border:none;width:100%;height:100%;padding:0;position:absolute;inset:0}.pf-hex.svelte-5uf3hr{font-size:var(--text-xs);color:var(--text-muted);font-variant-numeric:tabular-nums;letter-spacing:.02em;margin-top:2px}.pf-error.svelte-5uf3hr{font-size:var(--text-sm);color:var(--danger,#e53c20);align-items:center;gap:6px;display:flex}.pf-actions.svelte-5uf3hr{justify-content:flex-end;align-items:center;gap:10px;margin-top:4px;display:flex}.pf-btn.svelte-5uf3hr{cursor:pointer;border:1px solid var(--line-strong);border-radius:var(--radius-sm);font:inherit;font-size:var(--text-sm);font-weight:var(--fw-semibold);transition:background var(--dur-fast) var(--ease-out), border-color var(--dur-fast) var(--ease-out);justify-content:center;align-items:center;gap:7px;padding:10px 18px;display:inline-flex}.pf-btn.primary.svelte-5uf3hr{background:var(--surface);color:var(--text)}.pf-btn.primary.svelte-5uf3hr:hover{background:var(--surface-hover);border-color:var(--accent-border)}.pf-btn.primary.svelte-5uf3hr:focus-visible{box-shadow:var(--focus-ring);outline:none}.pf-btn.primary.svelte-5uf3hr:disabled{opacity:.5;cursor:default}.pf-btn.ghost.svelte-5uf3hr{color:var(--text-muted);background:0 0;border-color:#0000}.pf-btn.ghost.svelte-5uf3hr:hover{background:var(--surface-hover);color:var(--text)}.pf-btn.ghost.svelte-5uf3hr:focus-visible{box-shadow:var(--focus-ring);outline:none}.onb.svelte-13krnjv{z-index:100;background:var(--bg);color:var(--text);font-family:var(--font-sans);animation:ag2-fade var(--dur-base) var(--ease-out) both;display:flex;position:fixed;inset:0}.onb-hero.svelte-13krnjv{background:var(--accent-soft);border-right:1px solid var(--line);flex-direction:column;flex:none;width:42%;padding:48px 44px;display:flex;overflow:hidden}.onb-brand.svelte-13krnjv{align-items:center;gap:12px;display:flex}.onb-brandname.svelte-13krnjv{font-family:var(--font-display);font-weight:var(--fw-bold);font-size:var(--text-2xl)}.onb-herobody.svelte-13krnjv{margin-top:40px}.onb-herobody.svelte-13krnjv h1:where(.svelte-13krnjv){font-size:var(--text-4xl);line-height:var(--leading-tight)}.onb-herobody.svelte-13krnjv p:where(.svelte-13krnjv){font-size:var(--text-md);color:var(--text-muted);line-height:var(--leading-normal);max-width:34ch;margin-top:14px}.onb-features.svelte-13krnjv{flex-direction:column;gap:18px;margin-top:auto;display:flex}.onb-feature.svelte-13krnjv{align-items:flex-start;gap:12px;display:flex}.onb-featicon.svelte-13krnjv{border-radius:var(--radius-sm);background:var(--surface);border:1px solid var(--line);width:34px;height:34px;color:var(--accent);flex:none;justify-content:center;align-items:center;display:inline-flex}.onb-feattitle.svelte-13krnjv{font-size:var(--text-sm);font-weight:var(--fw-bold)}.onb-featdesc.svelte-13krnjv{font-size:var(--text-sm);color:var(--text-muted);line-height:var(--leading-snug)}.onb-main.svelte-13krnjv{flex-direction:column;flex:1;min-width:0;display:flex}.onb-stepper.svelte-13krnjv{flex-wrap:wrap;align-items:center;gap:8px;padding:26px 44px 0;display:flex}.onb-stepitem.svelte-13krnjv{align-items:center;gap:7px;display:flex}.onb-stepnum.svelte-13krnjv{border-radius:var(--radius-pill);width:22px;height:22px;font-size:var(--text-xs);font-weight:var(--fw-bold);background:var(--surface-sunk);color:var(--text-faint);border:1px solid var(--line);transition:all var(--dur-base) var(--ease-out);flex:none;justify-content:center;align-items:center;display:inline-flex}.onb-stepnum.on.svelte-13krnjv{background:var(--accent);color:var(--text-on-accent);border-color:var(--accent)}.onb-steplabel.svelte-13krnjv{font-size:var(--text-xs);font-weight:var(--fw-semibold);color:var(--text-muted)}.onb-stepitem.active.svelte-13krnjv .onb-steplabel:where(.svelte-13krnjv){color:var(--text)}.onb-stepline.svelte-13krnjv{background:var(--line);width:18px;height:1px}.onb-body.svelte-13krnjv{flex-direction:column;flex:1;padding:32px 44px;display:flex;overflow-y:auto}.onb-body.center.svelte-13krnjv{justify-content:center}.onb-step.svelte-13krnjv{flex-direction:column;gap:16px;max-width:52ch;display:flex}.onb-step.svelte-13krnjv h2:where(.svelte-13krnjv){font-size:var(--text-2xl)}.onb-step.svelte-13krnjv h2.big:where(.svelte-13krnjv){font-size:var(--text-3xl)}.onb-step.svelte-13krnjv .lead:where(.svelte-13krnjv){font-size:var(--text-md);color:var(--text-muted);line-height:var(--leading-normal);margin:-6px 0 0}.onb-field.svelte-13krnjv{flex-direction:column;gap:6px;display:flex}.onb-flabel.svelte-13krnjv{align-items:baseline;gap:8px;display:flex}.onb-flabel.svelte-13krnjv>span:where(.svelte-13krnjv):first-child{font-size:var(--text-sm);font-weight:var(--fw-semibold)}.onb-flabel.svelte-13krnjv .hint:where(.svelte-13krnjv),.hint.svelte-13krnjv{font-size:var(--text-xs);color:var(--text-muted)}.hint.warn.svelte-13krnjv{color:var(--danger)}.onb-input.svelte-13krnjv{background:var(--surface-sunk);border:1px solid var(--line);border-radius:var(--radius-sm);color:var(--text-muted);transition:border-color var(--dur-fast) var(--ease-out), box-shadow var(--dur-fast) var(--ease-out);align-items:center;gap:9px;padding:0 12px;display:flex}.onb-input.svelte-13krnjv:focus-within{border-color:var(--accent);box-shadow:var(--focus-ring)}.onb-input.svelte-13krnjv input:where(.svelte-13krnjv){min-width:0;color:var(--text);font:inherit;font-size:var(--text-sm);background:0 0;border:none;outline:none;flex:1;padding:11px 0}.onb-pills.svelte-13krnjv{flex-wrap:wrap;gap:8px;display:flex}.onb-pill.svelte-13krnjv{cursor:pointer;border-radius:var(--radius-pill);border:1.5px solid var(--line);background:var(--surface);color:var(--text);font:inherit;font-size:var(--text-sm);font-weight:var(--fw-semibold);transition:all var(--dur-fast) var(--ease-out);align-items:center;gap:6px;padding:7px 14px;display:inline-flex}.onb-pill.svelte-13krnjv:hover{border-color:var(--accent)}.onb-pill.on.svelte-13krnjv{border-color:var(--accent);background:var(--accent-soft);color:var(--accent)}.onb-tabs.svelte-13krnjv{border-radius:var(--radius-sm);background:var(--surface-sunk);border:1px solid var(--line);gap:2px;padding:3px;display:flex}.onb-tab.svelte-13krnjv{cursor:pointer;white-space:nowrap;text-overflow:ellipsis;border-radius:calc(var(--radius-sm) - 2px);min-width:0;color:var(--text-muted);font:inherit;font-size:var(--text-xs);font-weight:var(--fw-semibold);transition:all var(--dur-fast) var(--ease-out);background:0 0;border:none;flex:auto;padding:8px;overflow:hidden}.onb-tab.svelte-13krnjv:hover{color:var(--accent)}.onb-tab.on.svelte-13krnjv{background:var(--surface);color:var(--accent);box-shadow:var(--shadow-sm)}.onb-tabpanel.svelte-13krnjv{flex-direction:column;gap:16px;display:flex}.onb-chips.svelte-13krnjv{flex-wrap:wrap;gap:8px;display:flex}.onb-chip.svelte-13krnjv{border-radius:var(--radius-pill);border:1px solid var(--line);background:var(--surface);font-size:var(--text-sm);font-weight:var(--fw-semibold);align-items:center;gap:7px;padding:5px 12px 5px 10px;display:inline-flex}.onb-chipdot.svelte-13krnjv{border-radius:var(--radius-pill);background:var(--dot,var(--accent));width:10px;height:10px}.onb-loopactions.svelte-13krnjv{align-items:center;gap:10px;display:flex}.onb-btn.svelte-13krnjv{cursor:pointer;border:1px solid var(--line-strong);border-radius:var(--radius-sm);font:inherit;font-size:var(--text-sm);font-weight:var(--fw-semibold);transition:background var(--dur-fast) var(--ease-out), border-color var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out);justify-content:center;align-items:center;gap:7px;padding:9px 16px;display:inline-flex}.onb-btn.lg.svelte-13krnjv{font-size:var(--text-base);padding:11px 20px}.onb-btn.primary.svelte-13krnjv{background:var(--surface);color:var(--text)}.onb-btn.primary.svelte-13krnjv:hover{background:var(--surface-hover);border-color:var(--accent-border)}.onb-btn.primary.svelte-13krnjv:focus-visible{box-shadow:var(--focus-ring);outline:none}.onb-btn.primary.svelte-13krnjv:disabled{opacity:.5;cursor:default}.onb-btn.ghost.svelte-13krnjv{color:var(--text-muted);box-shadow:none;background:0 0;border-color:#0000}.onb-btn.ghost.svelte-13krnjv:hover{color:var(--accent)}.onb-welcomeactions.svelte-13krnjv{gap:10px;margin-top:4px;display:flex}.onb-readyhead.svelte-13krnjv{align-items:center;gap:14px;display:flex}.onb-readytick.svelte-13krnjv{border-radius:var(--radius-pill);background:var(--accent-soft);width:52px;height:52px;color:var(--accent);border:1px solid var(--accent-border);flex:none;justify-content:center;align-items:center;display:inline-flex}.onb-summary.svelte-13krnjv{background:var(--surface-sunk);border:1px solid var(--line);border-radius:var(--radius-md);flex-direction:column;gap:12px;padding:16px;display:flex}.onb-sumrow.svelte-13krnjv{align-items:center;gap:10px;display:flex}.onb-sumicon.svelte-13krnjv{color:var(--accent);display:inline-flex}.onb-sumkey.svelte-13krnjv{width:64px;font-size:var(--text-sm);color:var(--text-muted);flex:none}.onb-sumval.svelte-13krnjv{font-size:var(--text-sm);color:var(--text);flex:1}.onb-optionalhead.svelte-13krnjv{align-items:center;gap:10px;display:flex}.onb-optional.svelte-13krnjv{font-size:var(--text-xs);font-weight:var(--fw-semibold);color:var(--text-muted);background:var(--surface-sunk);border:1px solid var(--line);border-radius:var(--radius-pill);padding:3px 10px}.onb-setuphead.svelte-13krnjv{align-items:center;gap:10px;display:flex}.onb-setupdot.svelte-13krnjv{border-radius:var(--radius-pill);background:var(--dot,var(--accent));flex:none;width:12px;height:12px}.onb-setupprog.svelte-13krnjv{font-size:var(--text-xs);font-weight:var(--fw-semibold);color:var(--text-muted);background:var(--surface-sunk);border:1px solid var(--line);border-radius:var(--radius-pill);margin-left:auto;padding:3px 10px}.onb-profrow.svelte-13krnjv{align-items:flex-start;gap:10px;display:flex}.onb-profdot.svelte-13krnjv{border-radius:var(--radius-pill);background:var(--dot,var(--accent));flex:none;width:10px;height:10px;margin-top:4px}.onb-profname.svelte-13krnjv{width:96px;font-size:var(--text-sm);font-weight:var(--fw-semibold);flex:none}.onb-profmeta.svelte-13krnjv{flex-direction:column;flex:1;gap:3px;min-width:0;display:flex}.onb-profmetaitem.svelte-13krnjv{font-size:var(--text-sm);color:var(--text-muted);overflow-wrap:anywhere;align-items:flex-start;gap:6px;min-width:0;display:flex}.onb-profmetaitem.cap.svelte-13krnjv{text-transform:capitalize}.onb-profmetaitem.svelte-13krnjv svg{color:var(--accent);flex:none;margin-top:3px}.onb-tip.svelte-13krnjv{font-size:var(--text-xs);color:var(--text-muted);align-items:center;gap:8px;display:flex}.onb-tip.svelte-13krnjv b:where(.svelte-13krnjv){color:var(--text)}.onb-nav.svelte-13krnjv{border-top:1px solid var(--line);align-items:center;gap:10px;padding:18px 44px;display:flex}.onb-navright.svelte-13krnjv{align-items:center;gap:12px;margin-left:auto;display:flex}@media (width<=760px){.onb-hero.svelte-13krnjv{display:none}}.sw3ctl.svelte-abh25a{align-items:center;gap:10px;display:inline-flex}.sw3.svelte-abh25a{cursor:pointer;background:color-mix(in srgb, var(--accent) 20%, var(--surface));width:66px;height:22px;box-shadow:inset 0 0 0 1px color-mix(in srgb, var(--accent) 32%, var(--line));transition:background var(--dur-fast) var(--ease-out), box-shadow var(--dur-fast) var(--ease-out);border:none;border-radius:999px;flex:none;padding:0;position:relative}.sw3.rw.svelte-abh25a{background:color-mix(in srgb, var(--warning) 20%, var(--surface));box-shadow:inset 0 0 0 1px color-mix(in srgb, var(--warning) 32%, var(--line))}.sw3.off.svelte-abh25a{background:color-mix(in srgb, var(--ink) 5%, var(--surface));box-shadow:inset 0 0 0 1px var(--line)}.sw3.svelte-abh25a:disabled{cursor:default}.sw3dot.svelte-abh25a{background:color-mix(in srgb, var(--ink) 30%, transparent);z-index:1;border-radius:50%;width:4px;height:4px;margin:-2px 0 0 -2px;position:absolute;top:50%}.sw3knob.svelte-abh25a{width:18px;height:18px;transition:transform var(--dur-fast) var(--ease-out);z-index:2;background:#fff;border-radius:50%;position:absolute;top:2px;left:2px;box-shadow:0 1px 2px #0000004d}.sw3[data-pos="1"].svelte-abh25a .sw3knob:where(.svelte-abh25a){transform:translate(22px)}.sw3[data-pos="2"].svelte-abh25a .sw3knob:where(.svelte-abh25a){transform:translate(44px)}.sw3label.svelte-abh25a{text-align:right;min-width:74px;font-size:13px}.sw3label.muted.svelte-abh25a{color:var(--text-muted)}.wsctl.svelte-u1g0df{align-items:center;gap:10px;display:inline-flex}.wslabel.svelte-u1g0df{text-align:right;min-width:74px;font-size:13px}.ws.svelte-u1g0df{cursor:pointer;background:color-mix(in srgb, var(--success) 20%, var(--surface));width:38px;height:22px;box-shadow:inset 0 0 0 1px color-mix(in srgb, var(--success) 32%, var(--line));transition:background var(--dur-fast) var(--ease-out), box-shadow var(--dur-fast) var(--ease-out);border:none;border-radius:999px;flex:none;padding:0;position:relative}.ws.svelte-u1g0df:after{content:"";width:18px;height:18px;transition:transform var(--dur-fast) var(--ease-out);background:#fff;border-radius:50%;position:absolute;top:2px;left:2px;box-shadow:0 1px 2px #0000004d}.ws.on.svelte-u1g0df{background:color-mix(in srgb, var(--warning) 20%, var(--surface));box-shadow:inset 0 0 0 1px color-mix(in srgb, var(--warning) 32%, var(--line))}.ws.on.svelte-u1g0df:after{transform:translate(16px)}.ws.svelte-u1g0df:disabled{cursor:default}h2.svelte-1qjwdk7{padding-right:34px}.hint.svelte-1qjwdk7{margin:0 0 10px;font-size:12px}.errline.svelte-1qjwdk7{color:var(--danger);font-size:13px}.cfsec.svelte-1qjwdk7{text-transform:uppercase;letter-spacing:1px;color:var(--text-muted);margin:16px 0 6px;font-size:11px}.cfrow.svelte-1qjwdk7{align-items:center;gap:10px;padding:8px 0;display:flex}.cfrow.svelte-1qjwdk7+.cfrow:where(.svelte-1qjwdk7){border-top:1px solid var(--line)}.cfico.svelte-1qjwdk7{color:var(--text-muted);flex:none;display:inline-flex}.cfname.svelte-1qjwdk7{text-overflow:ellipsis;white-space:nowrap;flex:1;min-width:0;font-size:13px;overflow:hidden}.cfctl.svelte-1qjwdk7{flex:none;align-items:center;gap:10px;display:inline-flex}.cfmenuwrap.svelte-1qjwdk7{flex:none;position:relative}.cfkebab.svelte-1qjwdk7{cursor:pointer;color:var(--text-muted);background:0 0;border:none;border-radius:6px;padding:2px 7px;font-size:17px;line-height:1}.cfkebab.svelte-1qjwdk7:hover{color:var(--ink);background:var(--code)}.cfkebab.svelte-1qjwdk7:disabled{cursor:default}.cfscrim.svelte-1qjwdk7{z-index:40;position:fixed;inset:0}.cfmenu.svelte-1qjwdk7{z-index:41;background:var(--surface);border:1px solid var(--line);border-radius:10px;flex-direction:column;gap:2px;min-width:170px;margin-top:5px;padding:5px;display:flex;position:absolute;top:100%;right:0;box-shadow:0 10px 28px #00000047}.cfmenu.svelte-1qjwdk7 button:where(.svelte-1qjwdk7){text-align:left;width:100%;font:inherit;color:var(--ink);cursor:pointer;background:0 0;border:none;border-radius:7px;align-items:center;gap:9px;padding:8px 10px;font-size:13px;display:flex}.cfmenu.svelte-1qjwdk7 button:where(.svelte-1qjwdk7):hover{background:var(--code)}.cfmenu.svelte-1qjwdk7 button.danger:where(.svelte-1qjwdk7){color:var(--danger)}.ftwrap.svelte-evfy7n{flex-direction:column;flex:1;min-height:0;display:flex}.fttoolbar.svelte-evfy7n{border-bottom:1px solid var(--line);align-items:center;gap:2px;padding:6px 8px;display:flex}.fttool.svelte-evfy7n{width:28px;height:28px;color:var(--muted);cursor:pointer;background:0 0;border:none;border-radius:7px;justify-content:center;align-items:center;display:inline-flex}.fttool.svelte-evfy7n:hover{color:var(--text);background:var(--code)}.ftspacer.svelte-evfy7n{flex:1}.ftsel.svelte-evfy7n{text-overflow:ellipsis;white-space:nowrap;max-width:60%;font-family:var(--mono);color:var(--accent);font-size:11px;overflow:hidden}.fterr.svelte-evfy7n{color:var(--danger);margin:6px 8px 0;font-size:12px}.ftlink.svelte-evfy7n{color:var(--accent);font:inherit;cursor:pointer;background:0 0;border:none;padding:0;font-size:12px}.ftlink.svelte-evfy7n:hover{text-decoration:underline}.ftlink.danger.svelte-evfy7n{color:var(--muted)}.ftlink.danger.svelte-evfy7n:hover{color:var(--danger)}.ftlink.danger.svelte-evfy7n:disabled{cursor:default;opacity:.6}.fttree.svelte-evfy7n{flex:1;min-height:0;padding:4px 0;overflow-y:auto}.fttree.droproot.svelte-evfy7n{outline:2px dashed var(--accent);outline-offset:-3px;border-radius:6px}.ftrow.svelte-evfy7n{cursor:pointer;color:var(--text);-webkit-user-select:none;user-select:none;align-items:center;gap:6px;padding:4px 8px 4px 4px;display:flex;position:relative}.ftrow.svelte-evfy7n:hover{background:var(--surface-hover,var(--code))}.ftdir.selected.svelte-evfy7n{background:color-mix(in srgb, var(--accent) 16%, transparent)}.ftrow.active.svelte-evfy7n{background:var(--accent-soft);box-shadow:inset 2px 0 0 var(--accent)}.ftrow.drop.svelte-evfy7n{outline:2px dashed var(--accent);outline-offset:-2px;border-radius:6px}.ftcaret.svelte-evfy7n{width:16px;height:16px;color:var(--muted);cursor:pointer;background:0 0;border:none;border-radius:4px;flex:none;justify-content:center;align-items:center;margin-left:-2px;display:inline-flex}.ftcaret.svelte-evfy7n:hover{color:var(--text)}.ftname.svelte-evfy7n{text-overflow:ellipsis;white-space:nowrap;flex:1;min-width:0;font-size:13px;overflow:hidden}.ftfile.svelte-evfy7n .ftname:where(.svelte-evfy7n){font-family:var(--mono)}.ftmeta.svelte-evfy7n{color:var(--muted);white-space:nowrap;flex:none;font-size:11px}.ftinput.svelte-evfy7n{min-width:0;font:inherit;border:1px solid var(--accent);background:var(--surface);color:var(--text);border-radius:5px;flex:1;padding:1px 5px;font-size:13px}.ftconfirm.svelte-evfy7n{flex:none;align-items:center;gap:7px;margin-left:auto;display:inline-flex}.ftconfirm.svelte-evfy7n .confirm:where(.svelte-evfy7n){color:var(--danger);white-space:nowrap;font-size:12px}.ftkebab.svelte-evfy7n{width:22px;height:22px;color:var(--muted);opacity:0;cursor:pointer;background:0 0;border:none;border-radius:5px;flex:none;justify-content:center;align-items:center;margin-left:auto;display:inline-flex}.ftrow.svelte-evfy7n:hover .ftkebab:where(.svelte-evfy7n),.ftrow.svelte-evfy7n:focus-within .ftkebab:where(.svelte-evfy7n){opacity:.55}.ftkebab.svelte-evfy7n:hover{opacity:1;color:var(--text)}.ftmenu.svelte-evfy7n{z-index:var(--z-modal);background:var(--surface);border:1px solid var(--line);min-width:150px;box-shadow:var(--shadow,0 8px 28px #0000002e);border-radius:10px;padding:5px;position:fixed}.ftmitem.svelte-evfy7n{width:100%;color:var(--text);font:inherit;text-align:left;cursor:pointer;background:0 0;border:none;border-radius:6px;align-items:center;gap:8px;padding:7px 9px;font-size:13px;text-decoration:none;display:flex}.ftmitem.svelte-evfy7n:hover{background:var(--surface-hover,var(--code))}.ftmitem.danger.svelte-evfy7n{color:var(--danger)}.ftmdiv.svelte-evfy7n{background:var(--line);height:1px;margin:4px 6px}.ftmuted.svelte-evfy7n{color:var(--muted);padding:8px 12px;font-size:13px}.ftempty.svelte-evfy7n{line-height:1.5}.ftsection.svelte-evfy7n{border-top:1px solid var(--line);color:var(--muted);text-transform:uppercase;letter-spacing:.04em;margin:8px 8px 2px;padding-top:8px;font-size:10.5px;font-weight:600}.ftfolder.missing.svelte-evfy7n{color:var(--muted)}.ftfolder.missing.svelte-evfy7n .ftcaret:where(.svelte-evfy7n){opacity:.4;cursor:default}.ftbadge.svelte-evfy7n{background:var(--code);color:var(--muted);font-size:10px;font-family:var(--mono);white-space:nowrap;border-radius:999px;flex:none;margin-left:auto;padding:1px 6px}.ftbadge.rw.svelte-evfy7n{background:color-mix(in srgb, var(--accent) 18%, transparent);color:var(--accent)}.ftbadge.warn.svelte-evfy7n{background:color-mix(in srgb, var(--danger) 16%, transparent);color:var(--danger);margin-left:6px}.ftcaption.svelte-evfy7n{border-top:1px solid var(--line);color:var(--muted);font-family:var(--mono);text-overflow:ellipsis;white-space:nowrap;flex:none;margin:0;padding:6px 10px;font-size:10.5px;overflow:hidden}.profchips.svelte-ledzjv{align-items:center;gap:10px;min-width:0;padding:10px 16px;display:flex;position:relative}.chiprow.svelte-ledzjv{flex:none;align-items:center;gap:6px;display:flex}.chip.svelte-ledzjv{border-radius:var(--radius-pill);cursor:pointer;width:28px;height:28px;font:inherit;font-size:var(--text-xs);font-weight:var(--fw-bold);background:var(--surface);color:var(--p,var(--accent));border:1.5px solid var(--p,var(--accent));transition:transform var(--dur-fast) var(--ease-out), box-shadow var(--dur-fast) var(--ease-out);flex:none;justify-content:center;align-items:center;line-height:1;display:inline-flex;position:relative}.chip.svelte-ledzjv:hover{transform:translateY(-1px)}.chip.svelte-ledzjv:focus-visible{box-shadow:0 0 0 3px color-mix(in srgb, var(--p,var(--accent)) 35%, transparent);outline:none}.chip.active.svelte-ledzjv{background:var(--p,var(--accent));color:var(--p-ink,var(--text-on-accent));cursor:default;border-color:var(--p,var(--accent));box-shadow:inset 0 0 0 2px var(--surface)}.chip.more.svelte-ledzjv{color:var(--muted);border-color:var(--line);background:var(--surface);font-weight:var(--fw-semibold)}.chip.more.svelte-ledzjv:hover{color:var(--text);border-color:var(--text)}.chip.more.active.svelte-ledzjv{color:var(--text)}.chip.add.svelte-ledzjv{color:var(--muted);border-style:dashed;border-color:var(--line);background:var(--surface)}.chip.add.svelte-ledzjv:hover{color:var(--text);border-color:var(--text)}.mono.svelte-ledzjv{pointer-events:none}.actdot.svelte-ledzjv{border-radius:var(--radius-pill);background:var(--warning);border:1.5px solid var(--surface);width:8px;height:8px;position:absolute;top:-1px;right:-1px}.actdot.inmenu.svelte-ledzjv{border-color:var(--surface);margin-left:auto;position:static}.activename.svelte-ledzjv{text-overflow:ellipsis;white-space:nowrap;min-width:0;font-size:var(--text-sm);font-weight:var(--fw-semibold);color:var(--text);overflow:hidden}.profdot.svelte-ledzjv{border-radius:var(--radius-pill);background:var(--dot,var(--accent));flex:none;width:8px;height:8px}.profname.svelte-ledzjv{text-overflow:ellipsis;white-space:nowrap;font-weight:var(--fw-medium);overflow:hidden}.profmenu.svelte-ledzjv{z-index:var(--z-modal);background:var(--surface-elevated);border:1px solid var(--line);border-radius:var(--radius-sm);min-width:150px;max-width:220px;box-shadow:var(--shadow-lg);flex-direction:column;padding:4px;display:flex;position:absolute;top:calc(100% - 4px);left:16px}.profitem.svelte-ledzjv{cursor:pointer;text-align:left;width:100%;font:inherit;font-size:var(--text-xs);color:var(--text);border-radius:var(--radius-xs,6px);transition:background var(--dur-fast) var(--ease-out);background:0 0;border:none;align-items:center;gap:8px;padding:6px 8px;display:flex}.profitem.svelte-ledzjv:hover{background:var(--surface-hover)}.profitem.svelte-ledzjv .profname:where(.svelte-ledzjv){font-weight:var(--fw-medium);flex:1}.profitem.active.svelte-ledzjv{color:var(--muted);cursor:default}.profitem.active.svelte-ledzjv:hover{background:0 0}.profitem.svelte-ledzjv svg{opacity:.7;flex:none}.profcreate.svelte-ledzjv{width:min(460px,92vw)}.pc-lead.svelte-ledzjv{font-size:var(--text-sm);color:var(--text-muted);line-height:var(--leading-normal);margin:-2px 0 6px}.datesep.svelte-ledzjv{letter-spacing:.3px;color:var(--muted);text-transform:uppercase;margin:10px 0 2px;padding:2px 8px;font-size:11px;font-weight:600}.datesep.svelte-ledzjv:first-child{margin-top:2px}.chatrow.svelte-ledzjv{align-items:center;gap:8px;display:flex}.clabel.svelte-ledzjv{text-overflow:ellipsis;white-space:nowrap;flex:1;min-width:0;overflow:hidden}.originbadge.svelte-ledzjv{white-space:nowrap;color:var(--text-muted);flex:none;align-items:center;display:inline-flex}.originbadge.live.svelte-ledzjv{color:color-mix(in srgb, var(--success) 78%, var(--text));border-color:color-mix(in srgb, var(--success) 40%, var(--line))}.originbadge.live.svelte-ledzjv:before{content:"";background:var(--success);border-radius:50%;width:6px;height:6px;margin-right:4px;display:inline-block}.rowtime.svelte-ledzjv{color:var(--text-faint);font-variant-numeric:tabular-nums;white-space:nowrap;flex:none;font-size:11px}.chatrow.svelte-ledzjv:hover .rowtime:where(.svelte-ledzjv),.chatrow.svelte-ledzjv:focus-within .rowtime:where(.svelte-ledzjv),.ttask.svelte-ledzjv:hover .rowtime:where(.svelte-ledzjv),.ttask.svelte-ledzjv:focus-within .rowtime:where(.svelte-ledzjv){display:none}.lastrun.failed.svelte-ledzjv{color:var(--danger)}.lastrun.needs_input.svelte-ledzjv{color:var(--accent)}.rowconfirm.svelte-ledzjv{flex:none;align-items:center;gap:7px;display:inline-flex}.rowconfirm.svelte-ledzjv .confirm:where(.svelte-ledzjv){color:var(--danger);font-size:12px}.rowconfirm.svelte-ledzjv .linkbtn:where(.svelte-ledzjv){font:inherit;cursor:pointer;color:var(--accent);background:0 0;border:none;padding:0;font-size:12px}.rowconfirm.svelte-ledzjv .linkbtn:where(.svelte-ledzjv):hover{text-decoration:underline}.rowconfirm.svelte-ledzjv .linkbtn.danger:where(.svelte-ledzjv){color:var(--muted)}.rowconfirm.svelte-ledzjv .linkbtn.danger:where(.svelte-ledzjv):hover{color:var(--danger)}.rowconfirm.svelte-ledzjv .linkbtn.danger:where(.svelte-ledzjv):disabled{cursor:default;opacity:.6}.rowkebab.svelte-ledzjv{color:var(--muted);cursor:pointer;opacity:0;width:0;transition:opacity var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out);background:0 0;border:none;border-radius:6px;flex:none;justify-content:center;align-items:center;padding:2px;display:inline-flex;overflow:hidden}.chatrow.svelte-ledzjv:hover .rowkebab:where(.svelte-ledzjv),.chatrow.svelte-ledzjv:focus-within .rowkebab:where(.svelte-ledzjv),.ttask.svelte-ledzjv:hover .rowkebab:where(.svelte-ledzjv),.ttask.svelte-ledzjv:focus-within .rowkebab:where(.svelte-ledzjv){opacity:.55;width:auto}.rowkebab[aria-expanded=true].svelte-ledzjv{width:auto;color:var(--text);opacity:1!important}.rowkebab.svelte-ledzjv:hover{opacity:1;color:var(--text)}.chatmenu.svelte-ledzjv{z-index:var(--z-modal);background:var(--surface-elevated);border:1px solid var(--line);border-radius:var(--radius-sm);min-width:150px;box-shadow:var(--shadow-lg);flex-direction:column;padding:4px;display:flex;position:fixed;transform:translate(-100%)}.cmitem.svelte-ledzjv{width:100%;font:inherit;font-size:var(--text-xs);color:var(--text);border-radius:var(--radius-xs,6px);cursor:pointer;text-align:left;background:0 0;border:none;align-items:center;gap:8px;padding:6px 8px;display:flex}.cmitem.svelte-ledzjv:hover{background:var(--surface-hover)}.cmitem.danger.svelte-ledzjv{color:var(--danger,var(--danger))}.cmitem.danger.svelte-ledzjv:hover{background:color-mix(in srgb, var(--danger,var(--danger)) 12%, transparent)}.cmitem.svelte-ledzjv svg{opacity:.7;flex:none}.cmdiv.svelte-ledzjv{background:var(--line);height:1px;margin:4px 6px}.renamein.svelte-ledzjv{min-width:0;font:inherit;font-size:inherit;color:var(--text);background:var(--surface);border:1px solid var(--accent);border-radius:6px;outline:none;flex:1;padding:1px 6px}.fileref.svelte-1gro5pp{font:inherit;cursor:pointer;background:var(--accent-soft);color:var(--accent);-webkit-box-decoration-break:clone;box-decoration-break:clone;border:0;border-radius:4px;padding:0 2px}.fileref.svelte-1gro5pp:hover{text-decoration:underline}.choice.svelte-29lwde{border:1px solid var(--accent);border-radius:var(--radius-sm,8px);background:color-mix(in srgb, var(--accent) 4%, transparent);border-left-width:3px;margin:12px 0;padding:13px 16px 14px}.choice.resolved.svelte-29lwde{border-color:var(--line);background:0 0}.choice.resolved.svelte-29lwde .cdot:where(.svelte-29lwde){opacity:.4;animation:none}.choice.unanswered.svelte-29lwde{opacity:.72}.choice.unanswered.svelte-29lwde .cdot:where(.svelte-29lwde){background:var(--muted)}.ck.svelte-29lwde{font-family:var(--code,ui-monospace, monospace);letter-spacing:.18em;text-transform:uppercase;color:var(--accent);align-items:center;gap:7px;font-size:9.5px;font-weight:700;display:flex}.choice.resolved.svelte-29lwde .ck:where(.svelte-29lwde){color:var(--muted)}.detail-toggle.svelte-29lwde{color:var(--muted);font-family:var(--code,ui-monospace, monospace);letter-spacing:.04em;cursor:pointer;text-underline-offset:3px;background:0 0;border:none;margin-top:9px;padding:0;font-size:11px;text-decoration:underline}.detail-toggle.svelte-29lwde:hover{color:var(--ink)}.cdot.svelte-29lwde{background:var(--accent);border-radius:50%;width:7px;height:7px;animation:1.6s infinite svelte-29lwde-choice-pulse}@keyframes svelte-29lwde-choice-pulse{0%{box-shadow:0 0 0 0 color-mix(in srgb, var(--accent) 55%, transparent)}70%{box-shadow:0 0 0 7px #0000}to{box-shadow:0 0 #0000}}[data-animations=off] .cdot.svelte-29lwde{animation:none}.cq.svelte-29lwde{font-family:var(--serif,inherit);letter-spacing:-.01em;color:var(--ink);margin-top:7px;font-size:16.5px;font-weight:600;line-height:1.25}.cdetail.svelte-29lwde{background:var(--code);border:1px solid var(--line);white-space:pre-wrap;word-break:break-word;border-radius:8px;max-height:320px;margin:9px 0 0;padding:10px 12px;font-family:ui-monospace,monospace;font-size:12px;line-height:1.5;overflow:auto}.copts.svelte-29lwde{flex-wrap:wrap;gap:7px;margin-top:11px;display:flex}.chip.svelte-29lwde{border:1px solid var(--line);background:var(--bg);color:var(--ink);cursor:pointer;border-radius:999px;padding:7px 15px;font-size:13.5px;font-weight:550;transition:border-color .12s,color .12s,background .12s}.chip.svelte-29lwde:hover:not(:disabled){border-color:var(--accent);color:var(--accent);background:color-mix(in srgb, var(--accent) 6%, transparent)}.chip.svelte-29lwde:disabled{cursor:default;opacity:.45}.chip.picked.svelte-29lwde{opacity:1;border-color:var(--accent);background:var(--accent);color:var(--text-on-accent,#fff)}.cans.svelte-29lwde{font-family:var(--code,ui-monospace, monospace);color:var(--muted);margin-top:9px;font-size:12.5px}.choice.svelte-29lwde input:where(.svelte-29lwde){border:1px solid var(--line);background:var(--bg);width:100%;color:var(--ink);border-radius:8px;margin-top:10px;padding:9px 11px;font-size:13.5px}.choice.svelte-29lwde input:where(.svelte-29lwde):focus{border-color:var(--accent);outline:none}.g.svelte-1oq623z{aspect-ratio:1;height:112%;position:absolute;top:50%;right:2%;transform:translateY(-50%)}.g-sunny.svelte-1oq623z,.g-partly-cloudy.svelte-1oq623z,.g-cloudy.svelte-1oq623z{aspect-ratio:1;height:185%;right:-8%}.g.svelte-1oq623z svg:where(.svelte-1oq623z){width:100%;height:100%;overflow:visible}.sun.svelte-1oq623z{transform-origin:78% 26%;transform-box:view-box;animation:6s ease-in-out infinite svelte-1oq623z-pulse}@keyframes svelte-1oq623z-pulse{0%,to{transform:scale(1)}50%{transform:scale(1.045)}}.cloud.svelte-1oq623z{animation:14s ease-in-out infinite svelte-1oq623z-drift}@keyframes svelte-1oq623z-drift{0%,to{transform:translate(0)}50%{transform:translate(3.5%)}}.fog.svelte-1oq623z{animation:7s ease-in-out infinite svelte-1oq623z-breathe}.fog.f2.svelte-1oq623z{animation-delay:-2.3s}.fog.f3.svelte-1oq623z{animation-delay:-4.6s}@keyframes svelte-1oq623z-breathe{0%,to{opacity:.55}50%{opacity:1}}.rainrot.svelte-1oq623z{transform-origin:50%;transform-box:view-box;transform:rotate(14deg)}.rainfall.svelte-1oq623z{animation:1.1s linear infinite svelte-1oq623z-fall}@keyframes svelte-1oq623z-fall{0%{transform:translateY(0)}to{transform:translateY(60%)}}.bolt.svelte-1oq623z{transform-origin:50%;animation:4.2s linear infinite svelte-1oq623z-flash}@keyframes svelte-1oq623z-flash{0%,86%,96%,to{opacity:0}88%,94%{opacity:1}91%{opacity:.25}}.snowfall.svelte-1oq623z{animation:9s linear infinite svelte-1oq623z-snowfall}@keyframes svelte-1oq623z-snowfall{0%{transform:translateY(0)}to{transform:translateY(100%)}}.windflow.svelte-1oq623z{animation:2.6s linear infinite svelte-1oq623z-stream}.windflow.w2.svelte-1oq623z{animation-duration:3.4s;animation-delay:-1.2s}.windflow.w3.svelte-1oq623z{animation-duration:2.1s;animation-delay:-.6s}@keyframes svelte-1oq623z-stream{0%{transform:translate(-120%)}to{transform:translate(0)}}.wx-banner.svelte-1y4wig5{aspect-ratio:16/6;border-radius:var(--radius-sm,8px);background:linear-gradient(#9fb6cd,#dde7ed);width:100%;max-height:220px;margin-bottom:12px;position:relative;overflow:hidden;container-type:size}.wx-banner.svelte-1y4wig5 canvas:where(.svelte-1y4wig5){width:100%;height:100%;display:block}.wx-flush.svelte-1y4wig5{aspect-ratio:auto;border-radius:0;width:100%;height:100%;max-height:none;margin-bottom:0;position:absolute;inset:0}.wx-temp.svelte-1y4wig5{letter-spacing:-.03em;color:#212b38;-webkit-user-select:none;user-select:none;justify-content:center;align-items:center;width:44%;font-size:68cqh;font-weight:750;line-height:1;display:flex;position:absolute;top:0;bottom:0;left:0}.wx-temp-light.svelte-1y4wig5{color:#e9eef6}.wx-emoji.svelte-1y4wig5{-webkit-user-select:none;user-select:none;font-size:78cqh;line-height:1;position:absolute;top:50%;right:5%;transform:translateY(-50%)}.wx-sunny.svelte-1y4wig5{background:radial-gradient(120% 90% at 30% 30%,#ffd27a,#ff9d3c 55%,#2c1008)}.wx-partly-cloudy.svelte-1y4wig5{background:linear-gradient(#82b0cf,#e1edf2)}.wx-cloudy.svelte-1y4wig5{background:linear-gradient(#6f9ec4,#dfeaf0)}.wx-foggy.svelte-1y4wig5{background:linear-gradient(#b7c4c6,#dbe0de)}.wx-rainy.svelte-1y4wig5{background:linear-gradient(#2f3743,#5d6772)}.wx-thunderstorm.svelte-1y4wig5{background:linear-gradient(#141a22,#333d48)}.wx-snow.svelte-1y4wig5{background:linear-gradient(#8c9eb0,#c6d1d8)}.wx-windy.svelte-1y4wig5{background:linear-gradient(#6ba2d4,#cfe4f4)}.inputbox.dragging.svelte-1n8df3y{border-color:var(--accent-border);box-shadow:var(--focus-ring), var(--shadow-md)}.inputbox.svelte-1n8df3y,.cinput-wrap.svelte-1n8df3y{position:relative}.cinput-hl.svelte-1n8df3y{z-index:0;font:inherit;font-size:var(--text-md);color:var(--ink);white-space:pre-wrap;overflow-wrap:break-word;word-break:break-word;pointer-events:none;-webkit-user-select:none;user-select:none;margin:0;padding:8px 4px 6px;position:absolute;inset:0;overflow:hidden}.cinput-hl.svelte-1n8df3y mark:where(.svelte-1n8df3y){background:var(--accent-soft);color:var(--accent);-webkit-box-decoration-break:clone;box-decoration-break:clone;border-radius:4px;padding:0}.cinput.svelte-1n8df3y{z-index:1;color:#0000;-webkit-text-fill-color:transparent;caret-color:var(--ink);background:0 0;position:relative}.cinput.svelte-1n8df3y::placeholder{color:var(--text-muted);-webkit-text-fill-color:var(--text-muted)}.atpicker.svelte-1n8df3y{z-index:45;background:var(--surface-elevated);border:1px solid var(--line);border-radius:var(--radius-sm);max-height:240px;box-shadow:var(--shadow-lg);padding:4px;position:absolute;bottom:calc(100% + 6px);left:0;right:0;overflow-y:auto}.atrow.svelte-1n8df3y{text-align:left;border-radius:var(--radius-sm);width:100%;font:inherit;color:var(--ink);cursor:pointer;background:0 0;border:none;align-items:center;gap:8px;padding:6px 8px;display:flex}.atrow.sel.svelte-1n8df3y{background:var(--surface-sunken,#7f7f7f24)}.atname.svelte-1n8df3y{text-overflow:ellipsis;white-space:nowrap;flex:none;max-width:60%;overflow:hidden}.atdir.svelte-1n8df3y{text-overflow:ellipsis;white-space:nowrap;text-align:right;min-width:0;color:var(--text-muted);flex:1;font-size:12px;overflow:hidden}.atempty.svelte-1n8df3y{color:var(--text-muted);padding:8px 10px;font-size:13px}.ctip.svelte-1n8df3y{display:inline-flex;position:relative}.cbtn.needcfg.svelte-1n8df3y{opacity:.45}.ctip-bubble.svelte-1n8df3y{text-align:left;background:var(--surface-elevated);width:max-content;max-width:220px;color:var(--ink);border:1px solid var(--line);border-radius:var(--radius-sm);box-shadow:var(--shadow-lg);opacity:0;pointer-events:none;z-index:40;padding:7px 10px;font-size:12px;line-height:1.35;transition:opacity .12s,transform .12s;position:absolute;bottom:calc(100% + 8px);right:0;transform:translateY(3px)}.ctip.svelte-1n8df3y:hover .ctip-bubble:where(.svelte-1n8df3y){opacity:1;transform:translateY(0)}.cfolders.svelte-1n8df3y{flex-wrap:wrap;gap:6px;margin-bottom:6px;display:flex}.chip.folder.svelte-1n8df3y{transition:padding-right var(--dur-fast) var(--ease-out);align-items:center;display:inline-flex;position:relative}.chip.folder.svelte-1n8df3y .chipbody:where(.svelte-1n8df3y){font:inherit;color:inherit;cursor:pointer;text-overflow:ellipsis;white-space:nowrap;background:0 0;border:none;align-items:center;gap:5px;max-width:220px;margin:0;padding:0;display:inline-flex;overflow:hidden}.chip.folder.svelte-1n8df3y .cfrw:where(.svelte-1n8df3y){letter-spacing:.04em;color:var(--warning,#b8860b);flex:none;font-size:9px;font-weight:700;line-height:1}.chip.folder.missing.svelte-1n8df3y .chipbody:where(.svelte-1n8df3y){color:var(--warning,#b8860b)}.chip.folder.svelte-1n8df3y .x:where(.svelte-1n8df3y){color:var(--muted);cursor:pointer;background:0 0;border:none;justify-content:center;align-items:center;padding:0;font-size:15px;line-height:1;display:none;position:absolute;top:50%;right:7px;transform:translateY(-50%)}.chip.folder.svelte-1n8df3y:hover,.chip.folder.svelte-1n8df3y:focus-within{padding-right:22px}.chip.folder.svelte-1n8df3y:hover .x:where(.svelte-1n8df3y),.chip.folder.svelte-1n8df3y:focus-within .x:where(.svelte-1n8df3y){display:inline-flex}.chip.folder.svelte-1n8df3y .x:where(.svelte-1n8df3y):hover{color:var(--ink)}.chip.folder.svelte-1n8df3y .x:where(.svelte-1n8df3y):disabled{opacity:.5;cursor:default}.cfmore.svelte-1n8df3y{border:1px dashed var(--line);border-radius:var(--radius-pill,999px);color:var(--text-muted);cursor:pointer;background:0 0;padding:2px 10px;font-size:12px}.cfmore.svelte-1n8df3y:hover{color:var(--text);border-color:var(--text-muted)}.cfmsg.svelte-1n8df3y{color:var(--text-muted);margin:0 0 6px;font-size:12px}.cfmsg.err.svelte-1n8df3y{color:var(--danger)}.cfhint.svelte-1n8df3y{margin:0 0 10px;font-size:12px}.runbanner.svelte-auyrd3{font-size:var(--text-sm);flex-wrap:wrap;align-items:center;gap:12px;display:flex}.runmeta.svelte-auyrd3{color:var(--muted)}.runlink.svelte-auyrd3{align-items:center;gap:5px;display:inline-flex}.themetoggle.svelte-1kenrq5{cursor:pointer;border:1px solid var(--line);background:var(--surface);color:var(--muted);border-radius:var(--radius-sm);font-family:var(--font-sans);font-size:var(--text-xs);font-weight:var(--fw-semibold);text-transform:capitalize;transition:border-color var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out);align-items:center;gap:6px;padding:5px 10px;display:inline-flex}.themetoggle.svelte-1kenrq5:hover{border-color:var(--accent);color:var(--accent)}.sh.svelte-ozppsh{align-items:center;display:inline-flex;position:relative}.shdot.svelte-ozppsh{cursor:pointer;border-radius:var(--radius-pill);width:26px;height:26px;transition:background var(--dur-fast) var(--ease-out);background:0 0;border:none;justify-content:center;align-items:center;padding:0;display:inline-flex}.shdot.svelte-ozppsh:hover,.shdot.open.svelte-ozppsh{background:var(--surface-hover)}.shdot.svelte-ozppsh .dot:where(.svelte-ozppsh){border-radius:var(--radius-pill);background:var(--sh-color,var(--muted));width:10px;height:10px;box-shadow:0 0 0 3px color-mix(in srgb, var(--sh-color,var(--muted)) 22%, transparent)}.state-ok.svelte-ozppsh{--sh-color:var(--success)}.state-warn.svelte-ozppsh{--sh-color:var(--warning)}.state-down.svelte-ozppsh{--sh-color:var(--danger)}.state-off.svelte-ozppsh{--sh-color:var(--line)}@media (prefers-reduced-motion:no-preference){.shdot.state-ok.svelte-ozppsh .dot:where(.svelte-ozppsh){animation:svelte-ozppsh-shpulse 2.8s var(--ease-out) infinite}}@keyframes svelte-ozppsh-shpulse{0%,to{box-shadow:0 0 0 3px color-mix(in srgb, var(--success) 22%, transparent)}50%{box-shadow:0 0 0 5px color-mix(in srgb, var(--success) 10%, transparent)}}.shpanel.svelte-ozppsh{z-index:var(--z-modal);background:var(--surface);border:1px solid var(--line);border-radius:var(--radius-sm);min-width:248px;max-width:320px;box-shadow:var(--shadow-lg);flex-direction:column;gap:2px;padding:8px;display:flex;position:absolute;top:calc(100% + 6px);right:0}.shhead.svelte-ozppsh{font-size:var(--text-xs);font-weight:var(--fw-bold);color:var(--muted);text-transform:uppercase;letter-spacing:.04em;padding:2px 4px 6px}.shempty.svelte-ozppsh{font-size:var(--text-sm);color:var(--muted);padding:4px}.shrow.svelte-ozppsh{align-items:flex-start;gap:9px;padding:5px 4px;display:flex}.rowdot.svelte-ozppsh{border-radius:var(--radius-pill);background:var(--sh-color,var(--muted));flex:none;width:8px;height:8px;margin-top:5px}.shtext.svelte-ozppsh{flex:1;min-width:0}.shlabel.svelte-ozppsh{font-size:var(--text-sm);font-weight:var(--fw-medium);color:var(--text);line-height:1.3}.shdetail.svelte-ozppsh{font-size:var(--text-xs);color:var(--muted);overflow-wrap:anywhere}.shservers.svelte-ozppsh{border-left:1px solid var(--line);flex-direction:column;gap:3px;margin:0 4px 4px 21px;padding-left:8px;display:flex}.shsrv.svelte-ozppsh{font-size:var(--text-xs);align-items:center;gap:7px;display:flex}.srvname.svelte-ozppsh{text-overflow:ellipsis;white-space:nowrap;max-width:90px;color:var(--text);font-weight:var(--fw-medium);flex:none;overflow:hidden}.srvstat.svelte-ozppsh{min-width:0;color:var(--muted);text-overflow:ellipsis;white-space:nowrap;flex:1;overflow:hidden}.srvstat.bad.svelte-ozppsh{color:var(--danger)}.recheck.svelte-ozppsh{color:var(--muted);cursor:pointer;transition:color var(--dur-fast) var(--ease-out);background:0 0;border:none;border-radius:5px;flex:none;justify-content:center;align-items:center;padding:2px;display:inline-flex}.recheck.svelte-ozppsh:hover{color:var(--text)}.acpbadge.svelte-1uxvm9k{align-items:center;gap:5px;display:inline-flex}.acpbadge.live.svelte-1uxvm9k:before{content:"";background:var(--success);border-radius:50%;width:6px;height:6px;display:inline-block}.acplive.svelte-1uxvm9k{border:1px solid var(--line);border-radius:var(--radius,12px);background:var(--surface);text-align:center;flex-direction:column;align-items:center;gap:8px;margin:0 16px 16px;padding:14px 16px;display:flex}.acplive.svelte-1uxvm9k p:where(.svelte-1uxvm9k){color:var(--text-muted);margin:0;font-size:13px}.acperr.svelte-1uxvm9k{color:var(--danger)}.acpclose.svelte-1uxvm9k{border:1px solid var(--danger);color:var(--danger);font:inherit;cursor:pointer;background:0 0;border-radius:999px;align-items:center;gap:6px;padding:6px 14px;font-size:13px;display:inline-flex}.acpclose.svelte-1uxvm9k:hover:not(:disabled){background:color-mix(in srgb, var(--danger) 10%, transparent)}.acpclose.svelte-1uxvm9k:disabled{opacity:.6;cursor:default}.schedfield.svelte-33af8b{flex-wrap:wrap;align-items:center;gap:8px;display:flex}.schedfield.svelte-33af8b select:where(.svelte-33af8b),.schedfield.svelte-33af8b input:where(.svelte-33af8b){font:inherit;color:var(--ink);border:1px solid var(--line);background-color:var(--bg);border-radius:8px;min-width:0;padding:7px 9px;font-size:13px}.schedfield.svelte-33af8b select:where(.svelte-33af8b){flex:none;padding-right:30px}.schedfield.svelte-33af8b input:where(.svelte-33af8b){flex:1;min-width:140px}.schedfield.svelte-33af8b select:where(.svelte-33af8b):focus,.schedfield.svelte-33af8b input:where(.svelte-33af8b):focus{border-color:var(--accent);box-shadow:var(--focus-ring);outline:none}.recallfield.svelte-4kedlj{flex-wrap:wrap;align-items:center;gap:8px;display:flex}.recallfield.svelte-4kedlj select:where(.svelte-4kedlj),.recallfield.svelte-4kedlj input:where(.svelte-4kedlj){font:inherit;color:var(--ink);border:1px solid var(--line);background-color:var(--bg);border-radius:8px;min-width:0;padding:7px 9px;font-size:13px}.recallfield.svelte-4kedlj select:where(.svelte-4kedlj){flex:none;padding-right:30px}.recallfield.svelte-4kedlj input:where(.svelte-4kedlj){width:90px}.recallfield.svelte-4kedlj select:where(.svelte-4kedlj):focus,.recallfield.svelte-4kedlj input:where(.svelte-4kedlj):focus{border-color:var(--accent);box-shadow:var(--focus-ring);outline:none}.recallhint.svelte-4kedlj{color:var(--muted);margin:6px 0 0;font-size:12px}.taskpage.svelte-y9xmno{padding:28px 0 60px;overflow-y:auto}.tphead.svelte-y9xmno{flex-wrap:wrap;justify-content:space-between;align-items:flex-start;gap:16px;display:flex}.tpheadmain.svelte-y9xmno{flex:1;min-width:0}.tphead.svelte-y9xmno h1:where(.svelte-y9xmno){font-size:var(--text-2xl);color:var(--ink);margin:0 0 4px}.tpdesc.svelte-y9xmno{color:var(--muted);max-width:60ch;margin-bottom:8px;font-size:13px}.tpstatus.svelte-y9xmno{align-items:center;gap:10px;display:flex}.tpactions.svelte-y9xmno{flex:none;align-items:center;gap:8px;display:flex}.tpnameinput.svelte-y9xmno,.tpdescinput.svelte-y9xmno{width:100%;font:inherit;color:var(--ink);border:1px solid var(--line);background:var(--bg);border-radius:8px;padding:6px 9px;display:block}.tpnameinput.svelte-y9xmno{font-size:var(--text-2xl);font-weight:var(--fw-semibold);margin-bottom:8px}.tpdescinput.svelte-y9xmno{color:var(--muted);max-width:60ch;font-size:13px}.tpnameinput.svelte-y9xmno:focus,.tpdescinput.svelte-y9xmno:focus,.tpinput.svelte-y9xmno:focus{border-color:var(--accent);box-shadow:var(--focus-ring);outline:none}.tpinput.svelte-y9xmno{box-sizing:border-box;width:100%;font:inherit;color:var(--ink);border:1px solid var(--line);background:var(--bg);border-radius:8px;padding:7px 9px;font-size:13px}.tpprompt-input.svelte-y9xmno{resize:vertical;line-height:1.5}.tpmodel.svelte-y9xmno{display:flex}.tpmodel.svelte-y9xmno .modelsw-btn:where(.svelte-y9xmno){margin-left:-9px}.tpmodel.svelte-y9xmno .modelsw-menu{top:calc(100% + 6px);bottom:auto}.tpmodel-view.svelte-y9xmno{color:var(--ink);align-items:center;gap:6px;font-size:13px;display:inline-flex}.tpswitch.svelte-y9xmno{cursor:pointer;flex:none;width:34px;height:20px;display:inline-flex;position:relative}.tpswitch.svelte-y9xmno input:where(.svelte-y9xmno){opacity:0;cursor:pointer;z-index:1;margin:0;position:absolute;inset:0}.tpknob.svelte-y9xmno{background:color-mix(in srgb, var(--ink) 10%, var(--surface));box-shadow:inset 0 0 0 1px var(--line);transition:background var(--dur-fast) var(--ease-out), box-shadow var(--dur-fast) var(--ease-out);border-radius:999px;position:absolute;inset:0}.tpknob.svelte-y9xmno:after{content:"";width:16px;height:16px;transition:transform var(--dur-fast) var(--ease-out);background:#fff;border-radius:50%;position:absolute;top:2px;left:2px;box-shadow:0 1px 2px #0000004d}.tpswitch.svelte-y9xmno input:where(.svelte-y9xmno):checked+.tpknob:where(.svelte-y9xmno){background:color-mix(in srgb, var(--accent) 55%, var(--surface));box-shadow:inset 0 0 0 1px color-mix(in srgb, var(--accent) 40%, var(--line))}.tpswitch.svelte-y9xmno input:where(.svelte-y9xmno):checked+.tpknob:where(.svelte-y9xmno):after{transform:translate(14px)}.tpswitch.svelte-y9xmno input:where(.svelte-y9xmno):disabled+.tpknob:where(.svelte-y9xmno){opacity:.6}.badge.paused.svelte-y9xmno{border-color:var(--line);background:var(--surface);color:var(--muted)}.muted.svelte-y9xmno{color:var(--muted);font-size:13px}.tpcols.svelte-y9xmno{grid-template-columns:minmax(0,1.1fr) minmax(0,1fr);align-items:start;gap:32px;margin-top:24px;display:grid}.tpcols.single.svelte-y9xmno{grid-template-columns:minmax(0,1fr);max-width:640px}@media (width<=760px){.tpcols.svelte-y9xmno{grid-template-columns:1fr}}.histhead.svelte-y9xmno{justify-content:space-between;align-items:baseline;gap:8px;display:flex}.markread.svelte-y9xmno{font:inherit;color:var(--muted);cursor:pointer;background:0 0;border:0;padding:0;font-size:12px}.markread.svelte-y9xmno:hover:not(:disabled){color:var(--ink)}.markread.svelte-y9xmno:disabled{opacity:.5;cursor:default}.tpcols.svelte-y9xmno h2:where(.svelte-y9xmno){font-size:12px;font-weight:var(--fw-semibold);color:var(--muted);text-transform:uppercase;letter-spacing:.5px;margin:20px 0 8px}.tpcols.svelte-y9xmno section:where(.svelte-y9xmno)>h2:where(.svelte-y9xmno):first-child{margin-top:0}.tpprompt.svelte-y9xmno{white-space:pre-wrap;overflow-wrap:anywhere;color:var(--ink);margin:0;font-size:13px;line-height:1.5}.tpmeta.svelte-y9xmno{overflow-wrap:anywhere;color:var(--ink);margin:0;font-size:13px}.fsec.svelte-y9xmno{text-transform:uppercase;letter-spacing:1px;color:var(--muted);margin:14px 0 4px;font-size:11px}.fsec.svelte-y9xmno:first-of-type{margin-top:0}.frow.svelte-y9xmno{align-items:center;gap:10px;padding:7px 0;display:flex}.frow.svelte-y9xmno+.frow:where(.svelte-y9xmno){border-top:1px solid var(--line)}.fico.svelte-y9xmno{color:var(--muted);flex:none;display:inline-flex}.fname.svelte-y9xmno{min-width:0;color:var(--ink);text-overflow:ellipsis;white-space:nowrap;flex:1;font-size:13px;overflow:hidden}.fmode.svelte-y9xmno{color:var(--muted);flex:none;font-size:13px}.fctl.svelte-y9xmno{flex:none;align-items:center;gap:10px;display:inline-flex}.addfolder.svelte-y9xmno{margin-top:12px}.tppicker.svelte-y9xmno{border:1px solid var(--line);border-radius:var(--radius-md);background:var(--surface-sunk,var(--bg));margin-top:10px;padding:10px}.permrow.svelte-y9xmno{border:1px solid var(--line);border-radius:var(--radius-sm);align-items:center;gap:8px;margin-bottom:6px;padding:6px 10px;display:flex}.permrow.svelte-y9xmno code:where(.svelte-y9xmno){min-width:0;font-family:var(--mono);color:var(--ink);text-overflow:ellipsis;white-space:nowrap;flex:1;font-size:12px;overflow:hidden}.runslist.svelte-y9xmno{flex-direction:column;gap:6px;margin-top:8px;display:flex}.runrow.svelte-y9xmno{text-align:left;border:1px solid var(--line);border-radius:var(--radius-sm);background:var(--surface);cursor:pointer;width:100%;font:inherit;transition:border-color var(--dur-fast) var(--ease-out), background var(--dur-fast) var(--ease-out);align-items:center;gap:10px;padding:9px 12px;display:flex}.runrow.svelte-y9xmno:hover{background:var(--code);border-color:color-mix(in srgb, var(--accent) 45%, var(--line))}.runrow.svelte-y9xmno:focus-visible{box-shadow:var(--focus-ring);outline:none}.runrow.unseen.svelte-y9xmno{background:color-mix(in srgb, var(--accent) 12%, transparent)}.runrow.unseen.svelte-y9xmno .runsum:where(.svelte-y9xmno){color:var(--ink);font-weight:var(--fw-semibold)}.runsum.svelte-y9xmno{min-width:0;color:var(--muted);text-overflow:ellipsis;white-space:nowrap;flex:1;overflow:hidden}.delwrap.svelte-y9xmno{flex:none;display:inline-flex;position:relative}.delconfirm.svelte-y9xmno{z-index:5;white-space:nowrap;background:var(--surface-elevated);border:1px solid var(--line);border-radius:var(--radius-sm);box-shadow:var(--shadow-lg);align-items:center;gap:8px;padding:8px 10px;display:flex;position:absolute;top:calc(100% + 8px);right:0}.delconfirm.svelte-y9xmno .confirm:where(.svelte-y9xmno){color:var(--danger);font-size:13px}.taskerror.svelte-y9xmno{font-size:var(--text-sm);line-height:var(--leading-snug);color:var(--ag2-observer);background:color-mix(in srgb, var(--ag2-observer) 9%, transparent);border:1px solid color-mix(in srgb, var(--ag2-observer) 28%, transparent);border-radius:var(--radius-sm);overflow-wrap:anywhere;align-items:flex-start;gap:7px;margin-bottom:8px;padding:9px 11px;display:flex}.statusicon.svelte-y9xmno{width:16px;color:var(--muted);flex:none;justify-content:center;align-items:center;display:inline-flex}.statusicon.completed.svelte-y9xmno{color:var(--success)}.statusicon.failed.svelte-y9xmno{color:var(--danger)}.statusicon.cancelled.svelte-y9xmno{color:var(--muted)}.statusicon.running.svelte-y9xmno{color:var(--info)}.statusicon.needs_input.svelte-y9xmno{color:var(--accent)}.runwhen.svelte-y9xmno{color:var(--muted);flex:none;font-size:13px}.codex.svelte-lf23jv .intro:where(.svelte-lf23jv){font-size:12px;line-height:1.5}.codex.svelte-lf23jv .note:where(.svelte-lf23jv){margin-top:6px;font-size:12px;line-height:1.5}.codex.svelte-lf23jv .warn:where(.svelte-lf23jv){color:var(--danger)}.codex.svelte-lf23jv .err:where(.svelte-lf23jv){color:var(--danger);font-size:13px}.codex.svelte-lf23jv .ok:where(.svelte-lf23jv){font-size:14px}.codex.svelte-lf23jv .linkbtn:where(.svelte-lf23jv){font:inherit;color:var(--accent);cursor:pointer;background:0 0;border:none;flex:none;padding:0;font-size:12px}.codex.svelte-lf23jv .linkbtn:where(.svelte-lf23jv):hover{text-decoration:underline}.codex.svelte-lf23jv .linkbtn:where(.svelte-lf23jv):disabled{opacity:.4;cursor:default;text-decoration:none}.codex.svelte-lf23jv .pasterow:where(.svelte-lf23jv){align-items:center;gap:8px;width:100%;display:flex}.codex.svelte-lf23jv .pasterow:where(.svelte-lf23jv) input:where(.svelte-lf23jv){border:1px solid var(--line);min-width:0;font:inherit;background:var(--bg);color:var(--ink);border-radius:8px;flex:1;padding:8px 10px;font-size:13px}.codex.svelte-lf23jv .pasterow:where(.svelte-lf23jv) input:where(.svelte-lf23jv):focus{border-color:var(--accent);outline:none}.codex.svelte-lf23jv .pasterow:where(.svelte-lf23jv) .open:where(.svelte-lf23jv){flex:none}.codex.svelte-lf23jv .foot:where(.svelte-lf23jv){justify-content:space-between;align-items:center;gap:8px;margin-top:12px;display:flex}.codex.svelte-lf23jv .foot.end:where(.svelte-lf23jv){justify-content:flex-end}.codex.svelte-lf23jv .foot:where(.svelte-lf23jv) .modal-close{align-self:auto}.profiles.svelte-1rlzuji{flex-direction:column;gap:2px;display:flex}.prow.svelte-1rlzuji{border-radius:var(--radius-sm);align-items:center;gap:10px;padding:8px 4px;display:flex}.prow.active.svelte-1rlzuji{background:color-mix(in srgb, var(--accent) 10%, transparent);padding:8px}.prow.clickable.svelte-1rlzuji{cursor:pointer}.prow.clickable.svelte-1rlzuji:hover{background:var(--code)}.prow.clickable.active.svelte-1rlzuji:hover{background:color-mix(in srgb, var(--accent) 14%, transparent)}.prow.clickable.svelte-1rlzuji:focus-visible{box-shadow:var(--focus-ring);outline:none}.pdot.svelte-1rlzuji{border-radius:var(--radius-pill);background:var(--dot,var(--accent));flex:none;width:12px;height:12px}.pmeta.svelte-1rlzuji{flex:1;min-width:0}.pname.svelte-1rlzuji{font-size:var(--text-sm);font-weight:var(--fw-semibold);align-items:center;gap:8px;display:flex}.pbadge.svelte-1rlzuji{font-size:var(--text-xs);font-weight:var(--fw-semibold);text-transform:uppercase;letter-spacing:var(--tracking-eyebrow);color:var(--accent);background:var(--accent-soft);border-radius:var(--radius-pill);padding:1px 7px}.ppath.svelte-1rlzuji{font-size:var(--text-xs);color:var(--text-muted);text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.pactions.svelte-1rlzuji{flex:none;align-items:center;gap:10px;display:flex}.peditor.svelte-1rlzuji{background:var(--surface-sunk);border:1px solid var(--line);border-radius:var(--radius-sm);flex-direction:column;gap:12px;margin:12px 0 6px;padding:12px;display:flex}.pfield.svelte-1rlzuji{flex-direction:column;gap:5px;display:flex}.pfield.svelte-1rlzuji label:where(.svelte-1rlzuji){font-size:var(--text-xs);font-weight:var(--fw-semibold);color:var(--text-muted)}.pfield.svelte-1rlzuji input:where(.svelte-1rlzuji),.pfield.svelte-1rlzuji select:where(.svelte-1rlzuji){border:1px solid var(--line);border-radius:var(--radius-sm);background-color:var(--bg);color:var(--text);font:inherit;font-size:var(--text-sm);padding:8px 10px}.pfield.svelte-1rlzuji select:where(.svelte-1rlzuji){padding-right:30px}.pfield.svelte-1rlzuji input:where(.svelte-1rlzuji):focus,.pfield.svelte-1rlzuji select:where(.svelte-1rlzuji):focus{border-color:var(--accent);box-shadow:var(--focus-ring);outline:none}.phint.svelte-1rlzuji{font-size:var(--text-xs);color:var(--text-muted);line-height:var(--leading-snug)}.peditactions.svelte-1rlzuji{justify-content:flex-end;align-items:center;gap:10px;display:flex}.profile-add.svelte-1rlzuji{cursor:pointer;font:inherit;font-size:var(--text-sm);font-weight:var(--fw-semibold);color:var(--text-muted);background:0 0;border:none;align-self:flex-start;align-items:center;gap:6px;margin-top:6px;padding:8px 4px;display:inline-flex}.profile-add.svelte-1rlzuji:hover{color:var(--accent)}.profile-add.svelte-1rlzuji:focus-visible{box-shadow:var(--focus-ring);border-radius:var(--radius-sm);outline:none}.profile-add-cancel.svelte-1rlzuji{align-self:flex-end}.pconfirm.svelte-1rlzuji{background:var(--surface-sunk);border:1px solid var(--line);border-radius:var(--radius-sm);flex-direction:column;gap:10px;margin:6px 0;padding:12px;display:flex}.pconfirmhead.svelte-1rlzuji{font-size:var(--text-sm);font-weight:var(--fw-semibold);align-items:center;gap:7px;display:flex}.parch.svelte-1rlzuji{border-top:1px solid var(--line);flex-direction:column;gap:2px;margin-top:8px;padding-top:8px;display:flex}.parchhead.svelte-1rlzuji{cursor:pointer;font:inherit;font-size:var(--text-xs);font-weight:var(--fw-semibold);text-transform:uppercase;letter-spacing:var(--tracking-eyebrow);color:var(--text-muted);background:0 0;border:none;align-items:center;gap:6px;padding:6px 4px;display:flex}.parchhead.svelte-1rlzuji:hover{color:var(--accent)}.parchhead.svelte-1rlzuji:focus-visible{box-shadow:var(--focus-ring);border-radius:var(--radius-sm);outline:none}.parchentry.svelte-1rlzuji{flex-direction:column;gap:2px;display:flex}.prow.arch.svelte-1rlzuji{padding:8px 4px}.prow.arch.svelte-1rlzuji .pdot:where(.svelte-1rlzuji){opacity:.55}.prow.arch.svelte-1rlzuji .pname:where(.svelte-1rlzuji){color:var(--text-muted);font-weight:var(--fw-medium)}.perr.svelte-1rlzuji{font-size:var(--text-sm);color:var(--danger,var(--danger));margin:0}.linkbtn.quiet.svelte-1rlzuji{color:var(--text-muted)}.linkbtn.quiet.svelte-1rlzuji:hover{color:var(--danger,var(--danger))}.open.danger.svelte-1rlzuji{border-color:var(--danger,var(--danger));color:var(--danger,var(--danger))}.open.danger.svelte-1rlzuji:hover{background:color-mix(in srgb, var(--danger,var(--danger)) 12%, transparent);border-color:var(--danger,var(--danger));color:var(--danger,var(--danger))}.identity.svelte-tzms08{background:var(--surface-sunk);border:1px solid var(--line);border-radius:var(--radius-md,12px);align-items:center;gap:12px;margin-bottom:4px;padding:14px;display:flex}.idmono.svelte-tzms08{border-radius:var(--radius-pill);background:var(--dot);color:#fff;width:40px;height:40px;font-weight:var(--fw-semibold);flex:none;justify-content:center;align-items:center;font-size:17px;display:inline-flex}.idmeta.svelte-tzms08{min-width:0}.idname.svelte-tzms08{font-size:var(--text-md,15px);font-weight:var(--fw-semibold)}.idpath.svelte-tzms08{font-size:var(--text-xs);color:var(--text-muted);text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.pfield.svelte-tzms08{flex-direction:column;gap:6px;margin-top:12px;display:flex}.pfield.svelte-tzms08 label:where(.svelte-tzms08),.plabel.svelte-tzms08{font-size:var(--text-xs);font-weight:var(--fw-semibold);color:var(--text-muted)}.pfield.svelte-tzms08 input:where(.svelte-tzms08){border:1px solid var(--line);border-radius:var(--radius-sm);background-color:var(--bg);color:var(--text);font:inherit;font-size:var(--text-sm);padding:9px 11px}.pfield.svelte-tzms08 input:where(.svelte-tzms08):focus{border-color:var(--accent);box-shadow:var(--focus-ring);outline:none}.pdots.svelte-tzms08{flex-wrap:wrap;gap:8px;padding:4px;display:flex}.pswatch.svelte-tzms08{cursor:pointer;color:#fff;border-radius:var(--radius-pill);background:var(--dot);width:26px;height:26px;transition:transform var(--dur-fast) var(--ease-out), box-shadow var(--dur-fast) var(--ease-out);border:2px solid #0000;flex:none;justify-content:center;align-items:center;display:inline-flex}.pswatch.svelte-tzms08:hover{transform:scale(1.08)}.pswatch.on.svelte-tzms08{box-shadow:0 0 0 2px var(--surface-sunk), 0 0 0 4px var(--dot)}.pcustom.svelte-tzms08{padding:0;position:relative;overflow:hidden}.pcustom.rainbow.svelte-tzms08{background:conic-gradient(from 90deg,#f95339,#ec5d18,#e0b400,#2f8c44,#109e91,#2f6fe0,#7a52ec,#f95339)}.pcustom.rainbow.on.svelte-tzms08{box-shadow:0 0 0 2px var(--surface-sunk), 0 0 0 4px var(--accent)}.pcustom.svelte-tzms08 input:where(.svelte-tzms08){opacity:0;cursor:pointer;background:0 0;border:none;width:100%;height:100%;padding:0;position:absolute;inset:0}.phex.svelte-tzms08{font-size:var(--text-xs);color:var(--text-muted);font-variant-numeric:tabular-nums;letter-spacing:.02em;margin-top:2px}.pgactions.svelte-tzms08{justify-content:flex-end;align-items:center;gap:12px;margin-top:16px;display:flex}.okmsg.svelte-tzms08{color:var(--accent);font-size:var(--text-xs)}.perr.svelte-tzms08{font-size:var(--text-sm);color:var(--danger,var(--danger));margin:8px 0 0}.pmodels.svelte-yyf8l0{flex-direction:column;gap:20px;display:flex}.pmodel.svelte-yyf8l0{flex-direction:column;align-items:flex-start;gap:6px;display:flex}.pmodel-k.svelte-yyf8l0{font-size:var(--text-xs);text-transform:uppercase;letter-spacing:var(--tracking-eyebrow);color:var(--text-muted);font-weight:var(--fw-semibold)}.pmodel-sub.svelte-yyf8l0{font-size:var(--text-xs);color:var(--text-muted);margin-top:-3px;margin-bottom:2px}.foldercard.svelte-mm2t0q{border:1px solid var(--line);border-radius:var(--radius-sm);align-items:center;gap:10px;margin-bottom:8px;padding:8px 10px;display:flex}.permico.svelte-mm2t0q{color:var(--text-muted);flex:none;display:inline-flex}.foldmeta.svelte-mm2t0q{flex-direction:column;flex:1;gap:1px;min-width:0;display:flex}.foldname.svelte-mm2t0q{font-size:13px;font-weight:var(--fw-semibold);color:var(--text)}.permval.svelte-mm2t0q{font-family:var(--font-mono);color:var(--text-muted);text-overflow:ellipsis;white-space:nowrap;font-size:12px;overflow:hidden}.missing.svelte-mm2t0q{color:var(--warning,#b8860b)}.accctl.svelte-mm2t0q{flex:none;align-items:center;gap:10px;display:inline-flex}.permadd.svelte-mm2t0q{align-self:flex-start}.permempty.svelte-mm2t0q{margin:0 0 8px;font-size:13px}.permhint.svelte-mm2t0q{margin:2px 0 10px;font-size:12px}.permerr.svelte-mm2t0q{color:var(--danger);margin:0 0 8px;font-size:13px}.ski.svelte-1l9ety1{border:1px solid var(--line);border-radius:var(--radius-sm);margin-top:10px;padding:10px}.skihead.svelte-1l9ety1{justify-content:space-between;align-items:center;gap:8px;margin-bottom:10px;display:flex}.skitabs.svelte-1l9ety1{background:var(--code);border-radius:var(--radius-pill);gap:3px;padding:3px;display:inline-flex}.skitab.svelte-1l9ety1{font:inherit;font-size:13px;font-weight:var(--fw-medium);color:var(--muted);border-radius:var(--radius-pill);cursor:pointer;transition:color var(--dur-fast) var(--ease-out), background var(--dur-fast) var(--ease-out);background:0 0;border:none;justify-content:center;align-items:center;padding:5px 12px;display:inline-flex}.skitab.svelte-1l9ety1:hover{color:var(--text)}.skitab.on.svelte-1l9ety1{color:var(--accent);background:var(--surface);box-shadow:var(--shadow-sm)}.skierr.svelte-1l9ety1{color:var(--danger);margin:0 0 8px;font-size:12px}.skirow.svelte-1l9ety1{align-items:center;gap:8px;display:flex}.skiinput.svelte-1l9ety1{border:1px solid var(--line);min-width:0;font:inherit;background:var(--bg);color:var(--ink);border-radius:8px;flex:1;padding:7px 9px;font-size:13px}.skiinput.svelte-1l9ety1:focus{border-color:var(--accent);box-shadow:var(--focus-ring);outline:none}.skifile.svelte-1l9ety1{cursor:pointer;border:1px solid var(--line);min-width:0;font:inherit;background:var(--bg);transition:border-color var(--dur-fast) var(--ease-out), box-shadow var(--dur-fast) var(--ease-out);border-radius:8px;flex:1;align-items:center;gap:8px;padding:5px 6px 5px 11px;font-size:13px;display:flex}.skifile.svelte-1l9ety1:hover{border-color:color-mix(in srgb, var(--accent) 45%, var(--line))}.skifile.svelte-1l9ety1:focus-within{border-color:var(--accent);box-shadow:var(--focus-ring)}.skifile.disabled.svelte-1l9ety1{opacity:.5;pointer-events:none}.skifile.svelte-1l9ety1 input:where(.svelte-1l9ety1){display:none}.skifilename.svelte-1l9ety1{min-width:0;color:var(--ink);text-overflow:ellipsis;white-space:nowrap;flex:1;overflow:hidden}.skifile.nofile.svelte-1l9ety1 .skifilename:where(.svelte-1l9ety1){color:var(--muted)}.skifilepick.svelte-1l9ety1{font-size:12px;font-weight:var(--fw-medium);color:var(--muted);border:1px solid var(--line);background:var(--surface);transition:border-color var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out);border-radius:6px;flex:none;padding:2px 9px}.skifile.svelte-1l9ety1:hover .skifilepick:where(.svelte-1l9ety1){color:var(--accent);border-color:color-mix(in srgb, var(--accent) 45%, var(--line))}.skifound.svelte-1l9ety1,.skicheck.svelte-1l9ety1{border-top:1px solid var(--line);align-items:center;gap:10px;padding:6px 2px;display:flex}.skichecklist.svelte-1l9ety1{margin-top:8px}.skifmeta.svelte-1l9ety1{flex-direction:column;flex:1;min-width:0;display:flex}.skifname.svelte-1l9ety1{font-size:13px;font-weight:var(--fw-semibold);color:var(--text);align-items:baseline;gap:8px;display:flex}.skiinstalls.svelte-1l9ety1{font-size:11px;font-weight:var(--fw-regular,400);color:var(--text-muted)}.skifdesc.svelte-1l9ety1{color:var(--text-muted);text-overflow:ellipsis;white-space:nowrap;font-size:12px;overflow:hidden}.skicheck.svelte-1l9ety1{cursor:pointer}.skicheck.svelte-1l9ety1 .skifdesc:where(.svelte-1l9ety1){flex:1}.skhint.svelte-126h1cg{margin:2px 0 10px;font-size:12px}.skerr.svelte-126h1cg{color:var(--danger);margin:0 0 8px;font-size:13px}.skempty.svelte-126h1cg{margin:0 0 8px;font-size:13px}.skblocked.svelte-126h1cg{color:var(--text-muted);flex:none;font-size:12px;font-style:italic}.mhint.svelte-1h30q9j{font-size:var(--text-xs);color:var(--text-muted);margin:0 0 10px}.merr.svelte-1h30q9j{color:var(--danger,var(--danger));font-size:var(--text-sm);margin:0 0 8px}.mempty.svelte-1h30q9j{text-align:left;background:var(--surface-sunk);border:1px dashed var(--line);border-radius:var(--radius-md,12px);flex-direction:column;align-items:flex-start;gap:6px;padding:22px;display:flex}.memptytitle.svelte-1h30q9j{font-size:var(--text-sm);font-weight:var(--fw-semibold)}.memptybody.svelte-1h30q9j{font-size:var(--text-xs);color:var(--text-muted);line-height:var(--leading-snug);max-width:44ch;margin:0 0 4px}.mcard.svelte-1h30q9j{background:var(--surface-sunk);border:1px solid var(--line);border-radius:var(--radius-md,12px);max-height:260px;padding:14px;overflow:auto}.mpreview.svelte-1h30q9j{font:inherit;font-size:var(--text-sm);line-height:var(--leading-normal,1.5);color:var(--text);white-space:pre-wrap;word-break:break-word;margin:0}.marea.svelte-1h30q9j{resize:vertical;box-sizing:border-box;border:1px solid var(--line);border-radius:var(--radius-sm);width:100%;min-height:220px;font:inherit;font-size:var(--text-sm);background:var(--bg);color:var(--text);padding:10px 12px;line-height:1.5}.marea.svelte-1h30q9j:focus{border-color:var(--accent);box-shadow:var(--focus-ring);outline:none}.mfoot.svelte-1h30q9j{justify-content:flex-end;align-items:center;gap:12px;margin-top:10px;display:flex}.okmsg.svelte-1h30q9j{color:var(--accent);font-size:var(--text-xs)}.linkbtn.quiet.svelte-1h30q9j{color:var(--text-muted)}.linkbtn.quiet.svelte-1h30q9j:hover{color:var(--danger,var(--danger))}.peditor.svelte-1durtx6{flex-direction:column;gap:4px;display:flex}.pback.svelte-1durtx6{cursor:pointer;font:inherit;font-size:var(--text-xs);font-weight:var(--fw-semibold);color:var(--text-muted);background:0 0;border:none;align-self:flex-start;align-items:center;gap:3px;margin:0 0 8px -4px;padding:4px;display:inline-flex}.pback.svelte-1durtx6:hover{color:var(--accent)}.pback.svelte-1durtx6:focus-visible{box-shadow:var(--focus-ring);border-radius:var(--radius-sm);outline:none}.phead.svelte-1durtx6{align-items:center;gap:12px;padding:2px 0 14px;display:flex}.pheaddot.svelte-1durtx6{border-radius:var(--radius-pill);background:var(--dot);flex:none;width:14px;height:14px}.pheadmeta.svelte-1durtx6{min-width:0}.pheadname.svelte-1durtx6{font-size:var(--text-lg,18px);font-weight:var(--fw-semibold);align-items:center;gap:10px;display:flex}.pbadge.svelte-1durtx6{font-size:var(--text-xs);font-weight:var(--fw-semibold);text-transform:uppercase;letter-spacing:var(--tracking-eyebrow);color:var(--accent);background:var(--accent-soft);border-radius:var(--radius-pill);padding:1px 7px}.pheadsub.svelte-1durtx6{font-size:var(--text-xs);color:var(--text-muted);text-overflow:ellipsis;white-space:nowrap;margin-top:2px;overflow:hidden}.ptabs.svelte-1durtx6{border-bottom:1px solid var(--line);flex-wrap:wrap;gap:2px;margin-bottom:16px;display:flex}.ptab.svelte-1durtx6{cursor:pointer;font:inherit;font-size:var(--text-sm);font-weight:var(--fw-medium);color:var(--text-muted);transition:color var(--dur-fast) var(--ease-out);background:0 0;border:none;border-bottom:2px solid #0000;margin-bottom:-1px;padding:9px 12px;position:relative}.ptab.svelte-1durtx6:hover{color:var(--text)}.ptab.on.svelte-1durtx6{color:var(--accent);border-bottom-color:var(--accent);font-weight:var(--fw-semibold)}.ptab.svelte-1durtx6:focus-visible{box-shadow:var(--focus-ring);border-radius:var(--radius-sm);outline:none}.ppanel.svelte-1durtx6{flex-direction:column;gap:6px;display:flex}.llmcombo.svelte-19tyyb4{flex-direction:column;display:flex;position:relative}.llmcombolist.svelte-19tyyb4{z-index:45;background:var(--surface-elevated);border:1px solid var(--line);border-radius:var(--radius-sm);max-height:260px;box-shadow:var(--shadow-lg);padding:4px;position:absolute;top:calc(100% + 4px);left:0;right:0;overflow-y:auto}.llmcomborow.svelte-19tyyb4{text-align:left;border-radius:var(--radius-sm);width:100%;font:inherit;color:var(--ink);cursor:pointer;background:0 0;border:none;align-items:baseline;gap:8px;padding:6px 8px;font-size:13px;display:flex}.llmcomborow.sel.svelte-19tyyb4{background:var(--surface-sunken,#7f7f7f24)}.llmcomboname.svelte-19tyyb4{text-overflow:ellipsis;white-space:nowrap;flex:none;max-width:45%;overflow:hidden}.llmcomboid.svelte-19tyyb4{color:var(--text-muted);text-overflow:ellipsis;white-space:nowrap;flex:none;font-size:11px;overflow:hidden}.llmcombometa.svelte-19tyyb4{min-width:0;color:var(--text-muted);white-space:nowrap;flex:1;justify-content:flex-end;gap:8px;font-size:11px;display:flex;overflow:hidden}.llmcombotag.svelte-19tyyb4{border:1px solid var(--line);letter-spacing:.3px;border-radius:999px;padding:0 5px}.llmcomboload.svelte-19tyyb4{color:var(--text-muted);padding:6px 8px;font-size:12px}.llmconfirm.svelte-1p2yl1j,.llmconfirm.svelte-1wl71qv{color:var(--danger);white-space:nowrap;font-size:12px}.ca-status.svelte-1a3c600{align-items:center;gap:.5em;margin:.4em 0;font-size:.92em;display:flex}.ca-dot.svelte-1a3c600{background:var(--text-faint);border-radius:50%;flex:none;width:9px;height:9px}.ca-dot.on.svelte-1a3c600{background:var(--success)}.ca-dot.off.svelte-1a3c600{background:var(--danger)}.ca-list.svelte-1a3c600{flex-direction:column;gap:.25em;margin:.4em 0;padding:0;list-style:none;display:flex}.ca-list.svelte-1a3c600 li:where(.svelte-1a3c600){border:1px solid var(--line);border-radius:8px;justify-content:space-between;align-items:center;gap:1em;padding:.4em .6em;display:flex}.ca-id.svelte-1a3c600{color:var(--text-faint);font-weight:400}.ca-badge.svelte-1a3c600{background:var(--surface-sunk);color:var(--text-muted);white-space:nowrap;border-radius:999px;padding:.1em .55em;font-size:.78em}.ca-badge.ok.svelte-1a3c600{background:color-mix(in srgb, var(--success) 15%, transparent);color:var(--success)}.ca-empty.svelte-1a3c600{color:var(--text-muted);justify-content:flex-start}.ca-note.svelte-1a3c600{color:var(--text-muted);margin:.4em 0;font-size:.82em;line-height:1.4}.ca-bad.svelte-1a3c600{color:var(--danger)}code.svelte-1a3c600{background:var(--surface-sunk);color:var(--text);border-radius:5px;padding:.05em .35em;font-size:.9em}.permgroup.svelte-s4q8vl{flex-direction:column;gap:6px;margin-bottom:6px;display:flex}.permhd.svelte-s4q8vl{font-size:var(--text-xs);font-weight:var(--fw-semibold);color:var(--text-muted)}.permrow.svelte-s4q8vl{border:1px solid var(--line);border-radius:var(--radius-sm);align-items:center;gap:8px;padding:7px 10px;display:flex}.permico.svelte-s4q8vl{color:var(--text-muted);flex:none;display:inline-flex}.permval.svelte-s4q8vl{min-width:0;font-family:var(--font-mono);color:var(--text);text-overflow:ellipsis;white-space:nowrap;flex:1;font-size:12px;overflow:hidden}.permempty.svelte-s4q8vl{margin:0;font-size:13px}.permhint.svelte-s4q8vl{margin:2px 0 0;font-size:12px}.permerr.svelte-s4q8vl{color:var(--danger);margin:0;font-size:13px}.acplistitem.svelte-1yyb8o2{flex-direction:column;align-items:stretch;gap:6px}.docHint.svelte-pea4po{margin:2px 0 8px;font-size:12px}.docErr.svelte-pea4po{color:var(--danger);margin:0 0 8px;font-size:13px}.docArea.svelte-pea4po{resize:vertical;box-sizing:border-box;border:1px solid var(--line);border-radius:var(--radius-sm);width:100%;font:inherit;background:var(--bg);color:var(--ink);padding:10px 12px;font-size:13px;line-height:1.5}.docArea.svelte-pea4po:focus{border-color:var(--accent);box-shadow:var(--focus-ring);outline:none}.docFoot.svelte-pea4po{justify-content:flex-end;align-items:center;gap:10px;margin-top:8px;display:flex}.okmsg.svelte-pea4po{color:var(--accent);font-size:12px}.timeoutfield.svelte-jg6oyj{color:var(--muted);align-items:center;gap:5px;font-size:13px;display:flex}.timeoutfield.svelte-jg6oyj input:where(.svelte-jg6oyj){border:1px solid var(--line);width:66px;font:inherit;background:var(--bg);color:var(--ink);border-radius:8px;padding:7px 8px}.timeoutfield.svelte-jg6oyj input:where(.svelte-jg6oyj):focus{border-color:var(--accent);box-shadow:var(--focus-ring);outline:none}.notice.svelte-1okvk6k{z-index:var(--z-toast,9999);background:var(--surface);max-width:min(92vw,460px);color:var(--text);border:1px solid var(--line);border-radius:var(--radius-md,10px);box-shadow:var(--shadow-lg);font-family:var(--font-sans);font-size:var(--text-sm);align-items:center;gap:9px;padding:11px 16px;display:inline-flex;position:fixed;bottom:24px;left:50%;transform:translate(-50%)}.ntc-icon.svelte-1okvk6k{color:var(--accent);flex:none;display:inline-flex}.ntc-text.svelte-1okvk6k{line-height:var(--leading-normal)} diff --git a/src/assistant/gateway/static/app/assets/index-DGkm2flu.js b/src/assistant/gateway/static/app/assets/index-CZHkc36N.js similarity index 61% rename from src/assistant/gateway/static/app/assets/index-DGkm2flu.js rename to src/assistant/gateway/static/app/assets/index-CZHkc36N.js index ff2cff30..e53f0606 100644 --- a/src/assistant/gateway/static/app/assets/index-DGkm2flu.js +++ b/src/assistant/gateway/static/app/assets/index-CZHkc36N.js @@ -48,7 +48,7 @@ `)}return o.write(`payload.value = newResult;`),o.write(`return payload;`),o.compile()},o,s=oc,c=!$c.jitless,l=c&&sc.value,u=t.catchall,d;e._zod.parse=(i,f)=>{d??=r.value;let p=i.value;return s(p)?c&&l&&f?.async===!1&&f.jitless!==!0?(o||=a(t.shape),i=o(i,f),u?Sd([],p,i,f,d,e):i):n(i,f):(i.issues.push({expected:`object`,code:`invalid_type`,input:p,inst:e}),i)}});function Ed(e,t,n,r){for(let n of e)if(n.issues.length===0)return t.value=n.value,t;let i=e.filter(e=>!wc(e));return i.length===1?(t.value=i[0].value,i[0]):(t.issues.push({code:`invalid_union`,input:t.value,inst:n,errors:e.map(e=>e.issues.map(e=>kc(e,r,el())))}),t)}var Dd=Y(`$ZodUnion`,(e,t)=>{Du.init(e,t),Uc(e,`optin`,e=>e.def.options.some(e=>e._zod.optin===`defaulted`)?`defaulted`:e.def.options.some(e=>e._zod.optin!==void 0)?`optional`:void 0),Uc(e,`optout`,e=>e.def.options.some(e=>e._zod.optout===`optional`)?`optional`:void 0),Uc(e,`values`,e=>{if(e.def.options.every(e=>e._zod.values))return new Set(e.def.options.flatMap(e=>Array.from(e._zod.values)))}),Uc(e,`pattern`,e=>{if(e.def.options.every(e=>e._zod.pattern)){let t=e.def.options.map(e=>e._zod.pattern);return RegExp(`^(${t.map(e=>$s(e.source)).join(`|`)})$`)}});let n=t.options.length===1?t.options[0]._zod.run:null;e._zod.parse=(r,i)=>{if(n)return n(r,i);let a=!1,o=[];for(let e of t.options){let t=e._zod.run({value:r.value,issues:[]},i);if(t instanceof Promise)o.push(t),a=!0;else{if(t.issues.length===0)return t;o.push(t)}}return a?Promise.all(o).then(t=>Ed(t,r,e,i)):Ed(o,r,e,i)}}),Od=Y(`$ZodDiscriminatedUnion`,(e,t)=>{t.inclusive=!1,Dd.init(e,t);let n=e._zod.parse;Uc(e,`propValues`,e=>{let t={};for(let n of e.def.options){let r=n._zod.propValues;if(!r||Object.keys(r).length===0)throw Error(`Invalid discriminated union option at index "${e.def.options.indexOf(n)}"`);for(let[e,n]of Object.entries(r)){Object.prototype.hasOwnProperty.call(t,e)||tc(t,e,new Set);for(let r of n)t[e].add(r)}}return t}),t.options.forEach((e,n)=>{let r=Cd.get(e._zod.def);if(r&&!Object.prototype.hasOwnProperty.call(r,t.discriminator))throw Error(`Invalid discriminated union option at index "${n}"`)});let r=Zs(()=>{let e=t.options,n=new Map;for(let r of e){let e=r._zod.propValues?.[t.discriminator];if(!e||e.size===0)throw Error(`Invalid discriminated union option at index "${t.options.indexOf(r)}"`);for(let t of e){if(n.has(t))throw Error(`Duplicate discriminator value "${String(t)}"`);n.set(t,r)}}return n});e._zod.parse=(i,a)=>{let o=i.value;if(!oc(o))return i.issues.push({code:`invalid_type`,expected:`object`,input:o,inst:e}),i;let s=r.value.get(o?.[t.discriminator]);return s?s._zod.run(i,a):t.unionFallback||a.direction===`backward`?n(i,a):(i.issues.push({code:`invalid_union`,errors:[],note:`No matching discriminator`,discriminator:t.discriminator,options:Array.from(r.value.keys()),input:o,path:[t.discriminator],inst:e}),i)}}),kd=Y(`$ZodIntersection`,(e,t)=>{Du.init(e,t),e._zod.parse=(e,n)=>{let r=e.value,i=t.left._zod.run({value:r,issues:[]},n),a=t.right._zod.run({value:r,issues:[]},n);return i instanceof Promise||a instanceof Promise?Promise.all([i,a]).then(([t,n])=>jd(e,t,n)):jd(e,i,a)}});function Ad(e,t){if(e===t||e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(cc(e)&&cc(t)){let n=Object.keys(t),r=Object.keys(e).filter(e=>n.indexOf(e)!==-1),i={...e,...t};Object.prototype.hasOwnProperty.call(i,`__proto__`)&&delete i.__proto__;for(let n of r){if(n===`__proto__`)continue;let r=Ad(e[n],t[n]);if(!r.valid)return{valid:!1,mergeErrorPath:[n,...r.mergeErrorPath]};i[n]=r.data}return{valid:!0,data:i}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};let n=[];for(let r=0;r{let n;if(e.code===`unrecognized_keys`&&!e.path?.length)i??=e,n=e.keys;else if(e.code===`invalid_key`&&e.origin===`record`&&e.path?.length===1){let t=String(e.path[0]);a.has(t)||a.set(t,e),n=[t]}else return!1;for(let e of n)r.has(e)||r.set(e,{}),r.get(e)[t]=!0;return!0};for(let n of t.issues)o(n,`l`)||e.issues.push(n);for(let t of n.issues)o(t,`r`)||e.issues.push(t);let s=[...r].filter(([,e])=>e.l&&e.r).map(([e])=>e);if(s.length){let t=i?s.filter(e=>i.keys.includes(e)):[];t.length&&e.issues.push({...i,keys:t});for(let n of s)!t.includes(n)&&a.has(n)&&e.issues.push(a.get(n))}let c=Ad(t.value,n.value);if(!c.valid){if(wc(e))return e;throw Error(`Unmergable intersection. Error path: ${JSON.stringify(c.mergeErrorPath)}`)}return e.value=c.data,e}var Md=Y(`$ZodRecord`,(e,t)=>{Du.init(e,t);let n=$c.memoizer;n?.attach(e),e._zod.parse=(r,i)=>{let a=r.value;if(!cc(a))return r.issues.push({expected:`record`,code:`invalid_type`,input:a,inst:e}),r;let o=[],s=t.keyType._zod.values;if(s&&!t.partial){r.value=n?n.alloc(e,r,{},i):{};let c=new Set;for(let n of s)if(typeof n==`string`||typeof n==`number`||typeof n==`symbol`){if(c.add(typeof n==`number`?n.toString():n),n===`__proto__`)continue;let s=t.keyType._zod.run({value:n,issues:[]},i);if(s instanceof Promise)throw Error(`Async schemas not supported in object keys currently`);if(s.issues.length){r.issues.push({code:`invalid_key`,origin:`record`,issues:s.issues.map(e=>kc(e,i,el())),input:n,path:[n],inst:e});continue}let l=s.value;if(l===`__proto__`)continue;let u=t.valueType._zod.run({value:a[n],issues:[]},i);u instanceof Promise?o.push(u.then(e=>{e.issues.length&&r.issues.push(...Ec(n,e.issues)),r.value[l]=e.value})):(u.issues.length&&r.issues.push(...Ec(n,u.issues)),r.value[l]=u.value)}let l;for(let e in a)if(!c.has(e)){if(t.mode===`loose`){if(e===`__proto__`)continue;r.value[e]=a[e]}else l??=[],l.push(e)}l&&l.length>0&&r.issues.push({code:`unrecognized_keys`,input:a,inst:e,keys:l,continue:!0})}else{r.value=n?n.alloc(e,r,{},i):{};let c;for(let n of Reflect.ownKeys(a)){if(n===`__proto__`||!Object.prototype.propertyIsEnumerable.call(a,n))continue;let l=t.keyType._zod.run({value:n,issues:[]},i);if(l instanceof Promise)throw Error(`Async schemas not supported in object keys currently`);if(typeof n==`string`&&ru.test(n)&&l.issues.length){let e=t.keyType._zod.run({value:Number(n),issues:[]},i);if(e instanceof Promise)throw Error(`Async schemas not supported in object keys currently`);e.issues.length===0&&(l=e)}if(l.issues.length){t.mode===`loose`?r.value[n]=a[n]:s?(c??=[],c.push(n)):r.issues.push({code:`invalid_key`,origin:`record`,issues:l.issues.map(e=>kc(e,i,el())),input:n,path:[n],inst:e});continue}let u=l.value;if(u===`__proto__`)continue;let d=t.valueType._zod.run({value:a[n],issues:[]},i);d instanceof Promise?o.push(d.then(e=>{e.issues.length&&r.issues.push(...Ec(n,e.issues)),r.value[u]=e.value})):(d.issues.length&&r.issues.push(...Ec(n,d.issues)),r.value[u]=d.value)}c&&c.length>0&&r.issues.push({code:`unrecognized_keys`,input:a,inst:e,keys:c,continue:!0})}return o.length?Promise.all(o).then(()=>r):r}}),Nd=Y(`$ZodEnum`,(e,t)=>{Du.init(e,t);let n=Js(t.entries),r=new Set(n);e._zod.values=r;let i=n.filter(e=>uc.has(typeof e));e._zod.pattern=RegExp(i.length?`^(${i.map(e=>dc(e.toString())).join(`|`)})$`:`^[^\\s\\S]$`),e._zod.parse=(t,i)=>{let a=t.value;return r.has(a)||t.issues.push({code:`invalid_value`,values:n,input:a,inst:e}),t}}),Pd=Y(`$ZodLiteral`,(e,t)=>{Du.init(e,t);let n=new Set(t.values);e._zod.values=n,e._zod.pattern=RegExp(t.values.length?`^(${t.values.map(e=>typeof e==`string`?dc(e):e?dc(e.toString()):String(e)).join(`|`)})$`:`^[^\\s\\S]$`),e._zod.parse=(r,i)=>{let a=r.value;return n.has(a)||r.issues.push({code:`invalid_value`,values:t.values,input:a,inst:e}),r}}),Fd=Y(`$ZodTransform`,(e,t)=>{Du.init(e,t),e._zod.optin=`optional`,$c.memoizer?.guard(e),e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new Qc(e.constructor.name);let i=t.transform(n.value,n);if(r.async)return(i instanceof Promise?i:Promise.resolve(i)).then(e=>(n.value=e,n));if(i instanceof Promise)throw new Zc;return n.value=i,n}});function Id(e,t){return e.value=t.issues.length?void 0:t.value,e}var Ld=Y(`$ZodOptional`,(e,t)=>{Du.init(e,t),Uc(e,`optin`,e=>e.def.innerType._zod.optin===`defaulted`?`defaulted`:`optional`),e._zod.optout=`optional`,Uc(e,`values`,e=>{let t=e.def.innerType._zod.values;return t?new Set([...t,void 0]):void 0}),Uc(e,`pattern`,e=>{let t=e.def.innerType._zod.pattern;return t?RegExp(`^(${$s(t.source)})?$`):void 0}),e._zod.parse=(e,n)=>{if(e.value===void 0){if(t.innerType._zod.optin!==`defaulted`)return e;let r=t.innerType._zod.run({value:e.value,issues:[]},n);return r instanceof Promise?r.then(t=>Id(e,t)):Id(e,r)}return t.innerType._zod.run(e,n)}}),Rd=Y(`$ZodExactOptional`,(e,t)=>{Ld.init(e,t),Uc(e,`values`,e=>e.def.innerType._zod.values),Uc(e,`pattern`,e=>e.def.innerType._zod.pattern),e._zod.parse=(e,n)=>t.innerType._zod.run(e,n)}),zd=Y(`$ZodNullable`,(e,t)=>{Du.init(e,t),Uc(e,`optin`,e=>e.def.innerType._zod.optin),Uc(e,`optout`,e=>e.def.innerType._zod.optout),Uc(e,`pattern`,e=>{let t=e.def.innerType._zod.pattern;return t?RegExp(`^(${$s(t.source)}|null)$`):void 0}),Uc(e,`values`,e=>e.def.innerType._zod.values?new Set([...e.def.innerType._zod.values,null]):void 0),e._zod.parse=(e,n)=>e.value===null?e:t.innerType._zod.run(e,n)}),Bd=Y(`$ZodDefault`,(e,t)=>{Du.init(e,t),e._zod.optin=`defaulted`,Uc(e,`values`,e=>e.def.innerType._zod.values),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);if(e.value===void 0)return e.value=t.defaultValue,e;let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(e=>Vd(e,t)):Vd(r,t)}});function Vd(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}var Hd=Y(`$ZodPrefault`,(e,t)=>{Du.init(e,t),e._zod.optin=`defaulted`,Uc(e,`values`,e=>e.def.innerType._zod.values),e._zod.parse=(e,n)=>(n.direction===`backward`||e.value===void 0&&(e.value=t.defaultValue),t.innerType._zod.run(e,n))}),Ud=Y(`$ZodNonOptional`,(e,t)=>{Du.init(e,t),Uc(e,`values`,e=>{let t=e.def.innerType._zod.values;return t?new Set([...t].filter(e=>e!==void 0)):void 0}),e._zod.parse=(n,r)=>{let i=t.innerType._zod.run(n,r);return i instanceof Promise?i.then(t=>Wd(t,e)):Wd(i,e)}});function Wd(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:`invalid_type`,expected:`nonoptional`,input:e.value,inst:t}),e}function Gd(e,t,n,r){return t.issues.length?(e.value=n.catchValue({...t,value:e.value,error:{issues:t.issues.map(e=>kc(e,r,el()))},input:e.value}),e):(e.value=t.value,t.memo&&(e.memo=!0),e)}var Kd=Y(`$ZodCatch`,(e,t)=>{Du.init(e,t),Uc(e,`optin`,e=>e.def.innerType._zod.optin===`defaulted`?`defaulted`:`optional`),Uc(e,`optout`,e=>e.def.innerType._zod.optout),Uc(e,`values`,e=>e.def.innerType._zod.values),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);let r=t.innerType._zod.run({value:e.value,issues:[]},n);return r instanceof Promise?r.then(r=>Gd(e,r,t,n)):Gd(e,r,t,n)}}),qd=Y(`$ZodPipe`,(e,t)=>{Du.init(e,t),Uc(e,`values`,e=>e.def.in._zod.values),Uc(e,`optin`,e=>e.def.in._zod.optin),Uc(e,`optout`,e=>e.def.out._zod.optout),Uc(e,`propValues`,e=>e.def.in._zod.propValues),e._zod.parse=(e,n)=>{if(n.direction===`backward`){let r=t.out._zod.run(e,n);return r instanceof Promise?r.then(e=>Jd(e,t.in,n)):Jd(r,t.in,n)}let r=t.in._zod.run(e,n);return r instanceof Promise?r.then(e=>Jd(e,t.out,n)):Jd(r,t.out,n)}});function Jd(e,t,n){return e.issues.some(e=>e.code!==`unrecognized_keys`)?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},n)}var Yd=Y(`$ZodReadonly`,(e,t)=>{Du.init(e,t),Uc(e,`propValues`,e=>e.def.innerType._zod.propValues),Uc(e,`values`,e=>e.def.innerType._zod.values),Uc(e,`optin`,e=>e.def.innerType?._zod?.optin),Uc(e,`optout`,e=>e.def.innerType?._zod?.optout),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(Xd):Xd(r)}});function Xd(e){return e.memo||(e.value=Object.freeze(e.value)),e}var Zd=Y(`$ZodCustom`,(e,t)=>{su.init(e,t),Du.init(e,t),e._zod.parse=(e,t)=>e,e._zod.check=n=>{let r=n.value,i=t.fn(r);if(i instanceof Promise)return i.then(t=>Qd(t,n,r,e));Qd(i,n,r,e)}});function Qd(e,t,n,r){if(!e){let e={code:`custom`,input:n,inst:r,path:[...r._zod.def.path??[]],continue:!r._zod.def.abort};r._zod.def.params&&(e.params=r._zod.def.params),t.issues.push(Pc(e))}}var $d=class extends Error{constructor(){super(`Cannot parse a reference cycle that closes through a transform`),this.name=`ZodCyclicError`}},ef=`~memo`,tf=[];function nf(e){return e.map(e=>e.path?{...e,path:e.path.slice()}:{...e})}var rf=new WeakMap;function af(e,t){let n=rf.get(e);if(n!==void 0)return n;if(t.has(e))return!0;t.add(e);let r=!1,i=e=>{!r&&e?._zod&&af(e,t)&&(r=!0)},a=e._zod.def;if(a.type===`lazy`)i(e._zod.innerType);else{let e=a.shape;if(e)for(let t of Reflect.ownKeys(e))i(e[t]);for(let e in a){let t=a[e];if(!(!t||typeof t!=`object`)){if(t._zod)i(t);else if(Array.isArray(t))for(let e of t)i(e)}}}return t.delete(e),rf.set(e,r),r}function of(e,t){let n=e.buckets.get(t);return n||(n=new Map,e.buckets.set(t,n)),n}var sf,cf=[],lf={alloc(e,t,n){let r=sf;if(!r)return n;sf=void 0;let i={value:n,issues:null};return r.set(t.value,i),cf.push(i),n},guard(e){var t;(t=e._zod).deferred??(t.deferred=[]),e._zod.deferred.push(()=>{let t=e._zod.parse,n=(e,n)=>{if(n.direction!==`backward`&&df(n,e.value))throw new $d;return t(e,n)};e._zod.parse=n,e._zod.run===t&&(e._zod.run=n)})},attach(e){var t;let n,r,i;(t=e._zod).deferred??(t.deferred=[]),e._zod.deferred.push(()=>{let t=e._zod.parse,a=(o,s)=>{if(n===void 0&&(n=af(e,new Set),!n))return e._zod.parse=t,e._zod.run===a&&(e._zod.run=t),t(o,s);let c=o.value;if(typeof c!=`object`||!c)return t(o,s);let l=s[ef];l||(l={buckets:new Map,backEdges:void 0},s[ef]=l);let u;r===s?u=i:(u=of(l,e),r=s,i=u);let d=u.get(c);if(d)return o.value=d.value,d.issues?d.issues.length&&o.issues.push(...nf(d.issues)):(o.memo=!0,l.backEdges??(l.backEdges=new Set),l.backEdges.add(d.value)),o;sf=u;let f=cf.length,p=t(o,s);sf=void 0;let m=cf.length>f?cf.pop():void 0;return p instanceof Promise?p.then(e=>(m&&(m.issues=e.issues.length?nf(e.issues):tf),e)):(m&&(m.issues=p.issues.length?nf(p.issues):tf),p)};e._zod.parse=a,e._zod.run===t&&(e._zod.run=a)})}};function uf(){return lf}function df(e,t){let n=e[ef]?.backEdges;return n!==void 0&&typeof t==`object`&&!!t&&n.has(t)}var ff=()=>{let e={string:{unit:`characters`,verb:`to have`},file:{unit:`bytes`,verb:`to have`},array:{unit:`items`,verb:`to have`},set:{unit:`items`,verb:`to have`},map:{unit:`entries`,verb:`to have`}};function t(t){return e[t]??null}let n={regex:`input`,email:`email address`,url:`URL`,emoji:`emoji`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`ISO datetime`,date:`ISO date`,time:`ISO time`,duration:`ISO duration`,ipv4:`IPv4 address`,ipv6:`IPv6 address`,mac:`MAC address`,cidrv4:`IPv4 range`,cidrv6:`IPv6 range`,base64:`base64-encoded string`,base64url:`base64url-encoded string`,json_string:`JSON string`,e164:`E.164 number`,credit_card:`credit card number`,jwt:`JWT`,template_literal:`input`},r={nan:`NaN`};function i(e,t){return e===`number`&&typeof t==`number`&&!Number.isFinite(t)?String(t):r[e]??e}return e=>{switch(e.code){case`invalid_type`:return`Invalid input: expected ${i(e.expected)}, received ${i(Nc(e.input),e.input)}`;case`invalid_value`:return e.values.length===1?`Invalid input: expected ${mc(e.values[0])}`:`Invalid option: expected one of ${Ys(e.values,`|`)}`;case`too_big`:{let n=e.exact?`exactly `:e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Too big: expected ${e.origin??`value`} to have ${n}${e.maximum.toString()} ${r.unit??`elements`}`:`Too big: expected ${e.origin??`value`} to be ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.exact?`exactly `:e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Too small: expected ${e.origin} to have ${n}${e.minimum.toString()} ${r.unit}`:`Too small: expected ${e.origin} to be ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Invalid string: must start with "${t.prefix}"`:t.format===`ends_with`?`Invalid string: must end with "${t.suffix}"`:t.format===`includes`?`Invalid string: must include "${t.includes}"`:t.format===`regex`?`Invalid string: must match pattern ${t.pattern}`:`Invalid ${n[t.format]??e.format}`}case`not_multiple_of`:return`Invalid number: must be a multiple of ${e.divisor}`;case`unrecognized_keys`:return`Unrecognized key${e.keys.length>1?`s`:``}: ${Ys(e.keys,`, `)}`;case`invalid_key`:return`Invalid key in ${e.origin}`;case`invalid_union`:return e.options&&Array.isArray(e.options)&&e.options.length>0?`Invalid discriminator value. Expected ${e.options.map(e=>`'${e}'`).join(` | `)}`:e.inclusive===!1?`Invalid input: more than one option matched`:`Invalid input`;case`invalid_element`:return`Invalid value in ${e.origin}`;default:return`Invalid input`}}};function pf(){return{localeError:ff()}}var mf,hf=class{constructor(){this._map=new WeakMap,this._idmap=new Map}add(e,...t){let n=t[0];return this._map.set(e,n),n&&typeof n==`object`&&`id`in n&&this._idmap.set(n.id,e),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(e){let t=this._map.get(e);return t&&typeof t==`object`&&`id`in t&&this._idmap.delete(t.id),this._map.delete(e),this}get(e){let t=e._zod.parent;if(t){let n={...this.get(t)??{}};delete n.id;let r={...n,...this._map.get(e)};return Object.keys(r).length?r:void 0}return this._map.get(e)}has(e){return this._map.has(e)}};function gf(){return new hf}(mf=globalThis).__zod_globalRegistry??(mf.__zod_globalRegistry=gf());var _f=globalThis.__zod_globalRegistry;function vf(e,t){return new e({type:`string`,...pc(t)})}function yf(e,t){return new e({type:`string`,format:`email`,check:`string_format`,abort:!1,...pc(t)})}function bf(e,t){return new e({type:`string`,format:`guid`,check:`string_format`,abort:!1,...pc(t)})}function xf(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,...pc(t)})}function Sf(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v4`,...pc(t)})}function Cf(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v6`,...pc(t)})}function wf(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v7`,...pc(t)})}function Tf(e,t){return new e({type:`string`,format:`url`,check:`string_format`,abort:!1,...pc(t)})}function Ef(e,t){return new e({type:`string`,format:`emoji`,check:`string_format`,abort:!1,...pc(t)})}function Df(e,t){return new e({type:`string`,format:`nanoid`,check:`string_format`,abort:!1,...pc(t)})}function Of(e,t){return new e({type:`string`,format:`cuid`,check:`string_format`,abort:!1,...pc(t)})}function kf(e,t){return new e({type:`string`,format:`cuid2`,check:`string_format`,abort:!1,...pc(t)})}function Af(e,t){return new e({type:`string`,format:`ulid`,check:`string_format`,abort:!1,...pc(t)})}function jf(e,t){return new e({type:`string`,format:`xid`,check:`string_format`,abort:!1,...pc(t)})}function Mf(e,t){return new e({type:`string`,format:`ksuid`,check:`string_format`,abort:!1,...pc(t)})}function Nf(e,t){return new e({type:`string`,format:`ipv4`,check:`string_format`,abort:!1,...pc(t)})}function Pf(e,t){return new e({type:`string`,format:`ipv6`,check:`string_format`,abort:!1,...pc(t)})}function Ff(e,t){return new e({type:`string`,format:`cidrv4`,check:`string_format`,abort:!1,...pc(t)})}function If(e,t){return new e({type:`string`,format:`cidrv6`,check:`string_format`,abort:!1,...pc(t)})}function Lf(e,t){return new e({type:`string`,format:`base64`,check:`string_format`,abort:!1,...pc(t)})}function Rf(e,t){return new e({type:`string`,format:`base64url`,check:`string_format`,abort:!1,...pc(t)})}function zf(e,t){return new e({type:`string`,format:`e164`,check:`string_format`,abort:!1,...pc(t)})}function Bf(e,t){return new e({type:`string`,format:`jwt`,check:`string_format`,abort:!1,...pc(t)})}function Vf(e,t){return new e({type:`string`,format:`datetime`,check:`string_format`,offset:!1,local:!1,precision:null,...pc(t)})}function Hf(e,t){return new e({type:`string`,format:`date`,check:`string_format`,...pc(t)})}function Uf(e,t){return new e({type:`string`,format:`time`,check:`string_format`,precision:null,...pc(t)})}function Wf(e,t){return new e({type:`string`,format:`duration`,check:`string_format`,...pc(t)})}function Gf(e,t){return new e({type:`number`,checks:[],...pc(t)})}function Kf(e,t){return new e({type:`number`,check:`number_format`,abort:!1,format:`safeint`,...pc(t)})}function qf(e,t){return new e({type:`boolean`,...pc(t)})}function Jf(e){return new e({type:`unknown`})}function Yf(e,t){return new e({type:`never`,...pc(t)})}function Xf(e,t){return new uu({check:`less_than`,...pc(t),value:e,inclusive:!1})}function Zf(e,t){return new uu({check:`less_than`,...pc(t),value:e,inclusive:!0})}function Qf(e,t){return new du({check:`greater_than`,...pc(t),value:e,inclusive:!1})}function $f(e,t){return new du({check:`greater_than`,...pc(t),value:e,inclusive:!0})}function ep(e,t){return new fu({check:`multiple_of`,...pc(t),value:e})}function tp(e,t){return new mu({check:`max_length`,...pc(t),maximum:e})}function np(e,t){return new hu({check:`min_length`,...pc(t),minimum:e})}function rp(e,t){return new gu({check:`length_equals`,...pc(t),length:e})}function ip(e,t){return new vu({check:`string_format`,format:`regex`,...pc(t),pattern:e})}function ap(e){return new yu({check:`string_format`,format:`lowercase`,...pc(e)})}function op(e){return new bu({check:`string_format`,format:`uppercase`,...pc(e)})}function sp(e,t){return new xu({check:`string_format`,format:`includes`,...pc(t),includes:e})}function cp(e,t){return new Su({check:`string_format`,format:`starts_with`,...pc(t),prefix:e})}function lp(e,t){return new Cu({check:`string_format`,format:`ends_with`,...pc(t),suffix:e})}function up(e){return new wu({check:`overwrite`,tx:e})}function dp(e){return up(t=>t.normalize(e))}function fp(){return up(e=>e.trim())}function pp(){return up(e=>e.toLowerCase())}function mp(){return up(e=>e.toUpperCase())}function hp(){return up(e=>ic(e))}function gp(e,t,n){return new e({type:`array`,element:t,...pc(n)})}function _p(e,t,n){return new e({type:`custom`,check:`custom`,fn:t,...pc(n)})}function vp(e,t){let n=yp(t=>(t.addIssue=e=>{if(typeof e==`string`)t.issues.push(Pc(e,t.value,n._zod.def));else{let r=e;r.fatal&&(r.continue=!1),r.code??=`custom`,`input`in r||(r.input=t.value),r.inst??=n,r.continue??=!n._zod.def.abort,t.issues.push(Pc(r))}},e(t.value,t)),t);return n}function yp(e,t){let n=new su({check:`custom`,...pc(t)});return n._zod.check=e,n}function bp(e,...t){for(let n of t)for(let t of Reflect.ownKeys(n))Object.prototype.propertyIsEnumerable.call(n,t)&&tc(e,t,n[t]);return e}function xp(e){let t=e?.target??`draft-2020-12`;return t===`draft-4`&&(t=`draft-04`),t===`draft-7`&&(t=`draft-07`),{processors:e.processors??{},metadataRegistry:e?.metadata??_f,target:t,unrepresentable:e?.unrepresentable??`throw`,override:e?.override??(()=>{}),io:e?.io??`output`,counter:0,seen:new Map,sharedDefsExtractedFor:void 0,sharedEmitDoneFor:void 0,cycles:e?.cycles??`ref`,reused:e?.reused??`inline`,intersections:[],external:e?.external??void 0}}function Sp(e,t,n,r,i){let a=typeof t.unrepresentable==`function`?t.unrepresentable({zodSchema:e,path:r.path,message:i}):t.unrepresentable;if(a===`any`)return!1;if(a===void 0||a===`throw`)throw Error(i);return Object.assign(n,a),!0}function Cp(e,t,n={path:[],schemaPath:[]}){var r;let i=e._zod.def,a=t.seen.get(e);if(a)return a.count++,n.schemaPath.includes(e)&&(a.cycle=n.path),a.schema;let o={schema:{},count:1,cycle:void 0,path:n.path};t.seen.set(e,o),t.sharedDefsExtractedFor=void 0,t.sharedEmitDoneFor=void 0;let s=e._zod.toJSONSchema?.();if(s)o.schema=s;else{let r={...n,schemaPath:[...n.schemaPath,e],path:n.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,o.schema,r);else{let n=o.schema,a=t.processors[i.type];if(!a)throw Error(`[toJSONSchema]: Non-representable type encountered: ${i.type}`);a(e,t,n,r)}let a=e._zod.parent;a&&(o.ref||=a,Cp(a,t,r),t.seen.get(a).isParent=!0)}let c=t.metadataRegistry.get(e);return c&&bp(o.schema,c),t.io===`input`&&Np(e)&&(delete o.schema.examples,delete o.schema.default),t.io===`input`&&`_prefault`in o.schema&&((r=o.schema).default??(r.default=o.schema._prefault)),delete o.schema._prefault,t.seen.get(e).schema}function wp(e){return e.replace(/~/g,`~0`).replace(/\//g,`~1`)}function Tp(e,t){let n=e.seen.get(t);if(!n)throw Error(`Unprocessed schema. This is a bug in Zod.`);if(e.external&&e.sharedDefsExtractedFor===e.external)return;let r=new Map;for(let t of e.seen.entries()){let n=e.metadataRegistry.get(t[0])?.id;if(n){let e=r.get(n);if(e&&e!==t[0])throw Error(`Duplicate schema id "${n}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);r.set(n,t[0])}}let i=t=>{let r=e.target===`draft-2020-12`?`$defs`:`definitions`;if(e.external){let n=e.external.registry.get(t[0])?.id,i=e.external.uri??(e=>e);if(n)return{ref:i(n)};let a=t[1].defId??t[1].schema.id??`schema${e.counter++}`;return t[1].defId=a,{defId:a,ref:`${i(`__shared`)}#/${r}/${wp(a)}`}}let i=`#/${r}/`;if(t[1]===n&&!t[1].schema.id)return{ref:`#`};let a=t[1].schema.id??`__schema${e.counter++}`;return{defId:a,ref:i+wp(a)}},a=e=>{if(e[1].schema.$ref)return;let t=e[1],{ref:n,defId:r}=i(e);t.def={...t.schema},r&&(t.defId=r);let a=t.schema;for(let e in a)delete a[e];a.$ref=n};if(e.cycles===`throw`)for(let t of e.seen.entries()){let e=t[1];if(e.cycle)throw Error(`Cycle detected: #/${e.cycle?.join(`/`)}/ -Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let n of e.seen.entries()){let r=n[1];if(t===n[0]){a(n);continue}if(e.external){let r=e.external.registry.get(n[0])?.id;if(t!==n[0]&&r){a(n);continue}}if(e.metadataRegistry.get(n[0])?.id){a(n);continue}if(r.cycle){a(n);continue}if(r.count>1&&e.reused===`ref`){a(n);continue}}e.external&&(e.sharedDefsExtractedFor=e.external)}function Ep(e){let t=e.anyOf;if(!Array.isArray(t)||t.length===0||e.type!==void 0)return;let n=[];for(let e of t){if(!e||typeof e!=`object`)return;Ep(e);let t=Object.keys(e);if(t.length!==1||t[0]!==`type`)return;let r=e.type;for(let e of Array.isArray(r)?r:[r]){if(typeof e!=`string`)return;n.includes(e)||n.push(e)}}delete e.anyOf,e.type=n.length===1?n[0]:n}var Dp=new Set([`type`,`properties`,`required`,`additionalProperties`]),Op=[`oneOf`,`anyOf`];function kp(e){let t=e.additionalProperties;return t===void 0||t===!1||typeof t!=`object`||!t?null:Object.keys(t).length?t:null}function Ap(e){let t=[];for(let n of e){if(typeof n!=`object`||n.type!==`object`)return null;for(let e in n)if(!Dp.has(e))return null;t.push(n)}let n={},r=new Set;for(let e of t){for(let r in e.properties){if(Object.prototype.hasOwnProperty.call(n,r))continue;let e=[];for(let n of t){let t=n.properties?.[r]??kp(n);t!=null&&(e.some(e=>JSON.stringify(e)===JSON.stringify(t))||e.push(t))}tc(n,r,e.length===1?e[0]:Ap(e)??{allOf:e})}for(let t of e.required??[])r.add(t)}let i={type:`object`,properties:n};if(r.size&&(i.required=[...r]),t.every(e=>e.additionalProperties===!1))i.additionalProperties=!1;else{let e=[];for(let n of t){let t=kp(n);t&&!e.some(e=>JSON.stringify(e)===JSON.stringify(t))&&e.push(t)}e.length===1?i.additionalProperties=e[0]:e.length>1&&(i.additionalProperties={allOf:e})}return i}function jp(e){let t=e.allOf;if(!Array.isArray(t)||t.length<2)return;for(let t of Dp)if(t in e)return;let n=t.filter(e=>Op.some(t=>Array.isArray(e[t]))),r=null;if(!n.length)r=Ap(t);else{let e=n[0],i=Op.find(t=>Array.isArray(e[t]));if(Object.keys(e).length!==1)return;let a=t.filter(t=>t!==e),o=e[i].map(e=>Ap([...a,e]));if(o.some(e=>!e))return;r={[i]:o}}r&&(delete e.allOf,bp(e,r))}function Mp(e,t){let n=e.seen.get(t);if(!n)throw Error(`Unprocessed schema. This is a bug in Zod.`);let r=t=>{let n=e.seen.get(t);if(n.ref===null)return;let i=n.def??n.schema,a={...i},o=n.ref;if(n.ref=null,o){r(o);let n=e.seen.get(o),s=n.schema;if(s.$ref&&(e.target===`draft-07`||e.target===`draft-04`||e.target===`openapi-3.0`)?(i.allOf=i.allOf??[],i.allOf.push(s)):bp(i,s),bp(i,a),t._zod.parent===o)for(let e in i)e!==`$ref`&&e!==`allOf`&&(e in a||delete i[e]);if(s.$ref&&n.def)for(let e in i)e!==`$ref`&&e!==`allOf`&&e in n.def&&JSON.stringify(i[e])===JSON.stringify(n.def[e])&&delete i[e]}let s=t._zod.parent;if(s&&s!==o){r(s);let t=e.seen.get(s);if(t?.schema.$ref&&(i.$ref=t.schema.$ref,t.def))for(let e in i)e!==`$ref`&&e!==`allOf`&&e in t.def&&JSON.stringify(i[e])===JSON.stringify(t.def[e])&&delete i[e]}e.override({zodSchema:t,jsonSchema:i,path:n.path??[]})};if(!e.external||e.sharedEmitDoneFor!==e.external){for(let t of[...e.seen.entries()].reverse())r(t[0]);if(e.target!==`openapi-3.0`)for(let t of e.seen.entries())Ep(t[1].def??t[1].schema);if(e.intersections.length){let t=new Map;for(let n of e.seen.values())for(let e of[n.schema,n.def]){let n=e?.allOf;if(!Array.isArray(n))continue;let r=t.get(n);r?r.push(e):t.set(n,[e])}for(let n of e.intersections)for(let e of t.get(n)??[])jp(e)}}let i={};if(e.target===`draft-2020-12`?i.$schema=`https://json-schema.org/draft/2020-12/schema`:e.target===`draft-07`?i.$schema=`http://json-schema.org/draft-07/schema#`:e.target===`draft-04`?i.$schema=`http://json-schema.org/draft-04/schema#`:e.target,e.external?.uri){let n=e.external.registry.get(t)?.id;if(!n)throw Error("Schema is missing an `id` property");i.$id=e.external.uri(n)}bp(i,n.defId?n.schema:n.def??n.schema);let a=e.metadataRegistry.get(t)?.id;a!==void 0&&i.id===a&&delete i.id;let o=e.external?.defs??{};if(!e.external||e.sharedEmitDoneFor!==e.external)for(let t of e.seen.entries()){let e=t[1];e.def&&e.defId&&(e.def.id===e.defId&&delete e.def.id,tc(o,e.defId,e.def))}e.external&&(e.sharedEmitDoneFor=e.external),e.external||Object.keys(o).length>0&&(e.target===`draft-2020-12`?i.$defs=o:i.definitions=o);try{let n=JSON.parse(JSON.stringify(i));return Object.defineProperty(n,"~standard",{value:{...t[`~standard`],jsonSchema:{input:Fp(t,`input`,e.processors),output:Fp(t,`output`,e.processors)}},enumerable:!1,writable:!1}),n}catch{throw Error(`Error converting schema to JSON.`)}}function Np(e,t){let n=t??{seen:new Set};if(n.seen.has(e))return!1;n.seen.add(e);let r=e._zod.def;if(r.type===`transform`)return!0;if(r.type===`array`)return Np(r.element,n);if(r.type===`set`)return Np(r.valueType,n);if(r.type===`lazy`)return Np(r.getter(),n);if(r.type===`promise`||r.type===`optional`||r.type===`nonoptional`||r.type===`nullable`||r.type===`readonly`||r.type==="default"||r.type===`prefault`||r.type===`catch`)return Np(r.innerType,n);if(r.type===`intersection`)return Np(r.left,n)||Np(r.right,n);if(r.type===`record`||r.type===`map`)return Np(r.keyType,n)||Np(r.valueType,n);if(r.type===`pipe`)return e._zod.traits.has(`$ZodCodec`)?!0:Np(r.in,n)||Np(r.out,n);if(r.type===`object`){for(let e in r.shape)if(Np(r.shape[e],n))return!0;return!1}if(r.type===`union`){for(let e of r.options)if(Np(e,n))return!0;return!1}if(r.type===`tuple`){for(let e of r.items)if(Np(e,n))return!0;return!!(r.rest&&Np(r.rest,n))}return!1}var Pp=(e,t={})=>n=>{let r=xp({...n,processors:t});return Cp(e,r),Tp(r,e),Mp(r,e)},Fp=(e,t,n={})=>r=>{let{libraryOptions:i,target:a}=r??{},o=xp({...i??{},target:a,io:t,processors:n});return Cp(e,o),Tp(o,e),Mp(o,e)},Ip={guid:`uuid`,url:`uri`,datetime:`date-time`,json_string:`json-string`,regex:``},Lp=(e,t,n,r)=>{let i=n;i.type=`string`;let{minimum:a,maximum:o,format:s,patterns:c,contentEncoding:l,laxFormat:u}=e._zod.bag;if(typeof a==`number`&&(i.minLength=a),typeof o==`number`&&(i.maxLength=o),s&&(i.format=Ip[s]??s,i.format===``&&delete i.format,(s===`time`||u)&&delete i.format),l&&(i.contentEncoding=l),c&&c.size>0){let e=[...c];e.length===1?i.pattern=e[0].source:e.length>1&&(i.allOf=[...e.map(e=>({...t.target===`draft-07`||t.target===`draft-04`||t.target===`openapi-3.0`?{type:`string`}:{},pattern:e.source}))])}},Rp=(e,t,n,r)=>{let i=n,{minimum:a,maximum:o,format:s,multipleOf:c,exclusiveMaximum:l,exclusiveMinimum:u}=e._zod.bag;i.type=typeof s==`string`&&s.includes(`int`)?`integer`:`number`;let d=typeof u==`number`&&u>=(a??-1/0),f=typeof l==`number`&&l<=(o??1/0),p=t.target===`draft-04`||t.target===`openapi-3.0`;d?p?(i.minimum=u,i.exclusiveMinimum=!0):i.exclusiveMinimum=u:typeof a==`number`&&(i.minimum=a),f?p?(i.maximum=l,i.exclusiveMaximum=!0):i.exclusiveMaximum=l:typeof o==`number`&&(i.maximum=o),typeof c==`number`&&(Number.isFinite(c)&&c!==0?i.multipleOf=Math.abs(c):Sp(e,t,i,r,`A multipleOf divisor of ${c} cannot be represented in JSON Schema`))},zp=(e,t,n,r)=>{n.type=`boolean`},Bp=(e,t,n,r)=>{n.not={}},Vp=(e,t,n,r)=>{let i=e._zod.def,a=Js(i.entries);if(a.length===0){n.not={};return}a.every(e=>typeof e==`number`)&&(n.type=`number`),a.every(e=>typeof e==`string`)&&(n.type=`string`),n.enum=a},Hp=(e,t,n,r)=>{let i=e._zod.def;if(i.values.length===0){n.not={};return}let a=[];for(let o of i.values)if(o===void 0){if(Sp(e,t,n,r,"Literal `undefined` cannot be represented in JSON Schema"))return}else if(typeof o==`bigint`){if(Sp(e,t,n,r,`BigInt literals cannot be represented in JSON Schema`))return;a.push(Number(o))}else a.push(o);if(a.length!==0){if(a.length===1){let e=a[0];n.type=e===null?`null`:typeof e,t.target===`draft-04`||t.target===`openapi-3.0`?n.enum=[e]:n.const=e}else a.every(e=>typeof e==`number`)&&(n.type=`number`),a.every(e=>typeof e==`string`)&&(n.type=`string`),a.every(e=>typeof e==`boolean`)&&(n.type=`boolean`),a.every(e=>e===null)&&(n.type=`null`),n.enum=a}},Up=(e,t,n,r)=>{Sp(e,t,n,r,`Custom types cannot be represented in JSON Schema`)},Wp=(e,t,n,r)=>{Sp(e,t,n,r,`Transforms cannot be represented in JSON Schema`)},Gp=(e,t,n,r)=>{let i=n,a=e._zod.def,{minimum:o,maximum:s}=e._zod.bag;typeof o==`number`&&(i.minItems=o),typeof s==`number`&&(i.maxItems=s),i.type=`array`,i.items=Cp(a.element,t,{...r,path:[...r.path,`items`]})};function Kp(e){let t=e._zod.def;return t.type===`pipe`&&t.in._zod.traits.has(`$ZodTransform`)?Kp(t.out):t.type===`catch`?Kp(t.innerType):e._zod.optin}var qp=(e,t,n,r)=>{let i=n,a=e._zod.def,o=a.shape;if(Object.getOwnPropertySymbols(o).length&&Sp(e,t,i,r,`Symbol keys cannot be represented in JSON Schema`))return;i.type=`object`,i.properties={};for(let e in o)tc(i.properties,e,Cp(o[e],t,{...r,path:[...r.path,`properties`,e]}));let s=new Set(Object.keys(o)),c=new Set([...s].filter(e=>{let n=a.shape[e];return t.io===`input`?Kp(n)===void 0:n._zod.optout===void 0}));c.size>0&&(i.required=Array.from(c)),a.catchall?._zod.def.type===`never`?i.additionalProperties=!1:a.catchall?a.catchall&&(i.additionalProperties=Cp(a.catchall,t,{...r,path:[...r.path,`additionalProperties`]})):t.io===`output`&&(i.additionalProperties=!1)},Jp=(e,t,n,r)=>{let i=e._zod.def,a=i.inclusive===!1,o=i.options.map((e,n)=>Cp(e,t,{...r,path:[...r.path,a?`oneOf`:`anyOf`,n]}));a?n.oneOf=o:n.anyOf=o},Yp=(e,t,n,r)=>{let i=e._zod.def,a=Cp(i.left,t,{...r,path:[...r.path,`allOf`,0]}),o=Cp(i.right,t,{...r,path:[...r.path,`allOf`,1]}),s=e=>`allOf`in e&&Object.keys(e).length===1,c=[...s(a)?a.allOf:[a],...s(o)?o.allOf:[o]];n.allOf=c,t.intersections.push(c)},Xp=(e,t,n,r)=>{let i=n,a=e._zod.def;i.type=`object`;let o=a.keyType,s=o._zod.bag?.patterns;if(a.mode===`loose`&&s&&s.size>0){let e=Cp(a.valueType,t,{...r,path:[...r.path,`patternProperties`,`*`]});i.patternProperties={};for(let t of s)tc(i.patternProperties,t.source,e)}else(t.target===`draft-07`||t.target===`draft-2020-12`)&&(i.propertyNames=Cp(a.keyType,t,{...r,path:[...r.path,`propertyNames`]})),i.additionalProperties=Cp(a.valueType,t,{...r,path:[...r.path,`additionalProperties`]});let c=o._zod.values,l=t.io===`input`&&Kp(a.valueType)!==void 0;if(c&&!a.partial&&!l){let e=[...c].filter(e=>typeof e==`string`||typeof e==`number`);e.length>0&&(i.required=e)}},Zp=(e,t,n,r)=>{let i=e._zod.def,a=Cp(i.innerType,t,r),o=t.seen.get(e);t.target===`openapi-3.0`?(o.ref=i.innerType,n.nullable=!0):n.anyOf=[a,{type:`null`}]},Qp=(e,t,n,r)=>{let i=e._zod.def;Cp(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},$p=Symbol();function em(e,t,n,r,i){let a=!1,o=JSON.stringify(e,(e,t)=>typeof t==`bigint`?(a=!0,null):t);return a?(Sp(t,n,r,i,`BigInt defaults cannot be represented in JSON Schema`),$p):JSON.parse(o)}var tm=(e,t,n,r)=>{let i=e._zod.def;Cp(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType;let o=em(i.defaultValue,e,t,n,r);o!==$p&&(n.default=o)},nm=(e,t,n,r)=>{let i=e._zod.def;Cp(i.innerType,t,r);let a=t.seen.get(e);if(a.ref=i.innerType,t.io!==`input`)return;let o=em(i.defaultValue,e,t,n,r);o!==$p&&(n._prefault=o)},rm=(e,t,n,r)=>{let i=e._zod.def;Cp(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType;let o;try{o=i.catchValue(void 0)}catch{Sp(e,t,n,r,`Dynamic catch values are not supported in JSON Schema`);return}n.default=o},im=(e,t,n,r)=>{let i=e._zod.def,a=i.in._zod.traits.has(`$ZodTransform`),o=t.io===`input`?a?i.out:i.in:i.out;Cp(o,t,r);let s=t.seen.get(e);s.ref=o},am=(e,t,n,r)=>{let i=e._zod.def;Cp(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,n.readOnly=!0},om=(e,t,n,r)=>{let i=e._zod.def;Cp(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},sm=new WeakSet([Object.prototype,Error.prototype]);function cm(e,t,n){Object.defineProperty(e,t,{configurable:!0,enumerable:!1,get(){let e=n(this);return Object.defineProperty(this,t,{value:e,configurable:!0,writable:!0}),e},set(e){Object.defineProperty(this,t,{value:e,configurable:!0,writable:!0})}})}var lm=Y(`ZodError`,(e,t)=>{cl.init(e,t),e.name=`ZodError`;let n=Object.getPrototypeOf(e);sm.has(n)||(sm.add(n),cm(n,`format`,e=>t=>fl(e,t)),cm(n,`flatten`,e=>t=>dl(e,t)),cm(n,`addIssue`,e=>t=>{e.issues.push(t),e.message=JSON.stringify(e.issues,Xs,2)}),cm(n,`addIssues`,e=>t=>{e.issues.push(...t),e.message=JSON.stringify(e.issues,Xs,2)}),Object.defineProperty(n,"isEmpty",{configurable:!0,enumerable:!1,get(){return this.issues.length===0}}))},void 0,{Parent:Error}),um=ml(lm),dm=hl(lm),fm=gl(lm),pm=vl(lm),mm=bl(lm),hm=xl(lm),gm=Sl(lm),_m=Cl(lm),vm=wl(lm),ym=Tl(lm),bm=El(lm),xm=Dl(lm);function Sm(){$c.localeError||el(pf())}function Cm(){$c.memoizer||el({memoizer:uf()})}var wm=Y(`ZodType`,(e,t)=>(Sm(),Du.init(e,t),e.def=t,e.type=t.type,e),{check(...e){let t=this.def;return this.clone(nc(t,{checks:[...t.checks??[],...e.map(e=>typeof e==`function`?{_zod:{check:e,def:{check:`custom`},onattach:[]}}:e)]}),{parent:!0})},with(...e){return this.check(...e)},clone(e,t){return fc(this,e,t)},brand(){return this},register(e,t){return e.add(this,t),this},refine(e,t){return this.check(Wh(e,t))},superRefine(e,t){return this.check(Gh(e,t))},overwrite(e){return this.check(up(e))},optional(){return Eh(this)},exactOptional(){return Oh(this)},nullable(){return Ah(this)},nullish(){return Eh(Ah(this))},nonoptional(e){return Ih(this,e)},array(){return ch(this)},or(e){return fh([this,e])},and(e){return gh(this,e)},transform(e){return Bh(this,wh(e))},default(e){return Mh(this,e)},prefault(e){return Ph(this,e)},catch(e){return Rh(this,e)},pipe(e){return Bh(this,e)},readonly(){return Hh(this)},describe(e){let t=this.clone();return _f.add(t,{description:e}),t},meta(...e){if(e.length===0)return _f.get(this);let t=this.clone();return _f.add(t,e[0]),t},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(e,...t){return t.length===0?e(this):e(this,...t)},get"~standard"(){return Lc(this,`~standard`,{...ku(this),jsonSchema:{input:Fp(this,`input`),output:Fp(this,`output`)}})},set"~standard"(e){Ic(this,`~standard`,e)},parse:function e(t,n){return um(this,t,n,{callee:e})},parseAsync:async function e(t,n){return await dm(this,t,n,{callee:e})},safeParse(e,t){return fm(this,e,t)},async safeParseAsync(e,t){return pm(this,e,t)},get spa(){return this?.safeParseAsync},set spa(e){Ic(this,`spa`,e)},encode:function e(t,n){return mm(this,t,n,{callee:e})},decode:function e(t,n){return hm(this,t,n,{callee:e})},encodeAsync:async function e(t,n){return await gm(this,t,n,{callee:e})},decodeAsync:async function e(t,n){return await _m(this,t,n,{callee:e})},safeEncode(e,t){return vm(this,e,t)},safeDecode(e,t){return ym(this,e,t)},async safeEncodeAsync(e,t){return bm(this,e,t)},async safeDecodeAsync(e,t){return xm(this,e,t)},toJSONSchema(e){return Pp(this,{})(e)},get description(){return _f.get(this)?.description},get _def(){return this._zod.def}}),Tm=Y(`_ZodString`,(e,t)=>{Au.init(e,t),wm.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Lp(e,t,n,r);let n=e._zod.bag;e.format=n.format??null,e.minLength=n.minimum??null,e.maxLength=n.maximum??null},{regex(...e){return this.check(ip(...e))},includes(...e){return this.check(sp(...e))},startsWith(...e){return this.check(cp(...e))},endsWith(...e){return this.check(lp(...e))},min(...e){return this.check(np(...e))},max(...e){return this.check(tp(...e))},length(...e){return this.check(rp(...e))},nonempty(...e){return this.check(np(1,...e))},lowercase(e){return this.check(ap(e))},uppercase(e){return this.check(op(e))},trim(){return this.check(fp())},normalize(...e){return this.check(dp(...e))},toLowerCase(){return this.check(pp())},toUpperCase(){return this.check(mp())},slugify(){return this.check(hp())}}),Em=Y(`ZodString`,(e,t)=>{Au.init(e,t),Tm.init(e,t)},{email(e){return this.check(yf(Mm,e))},url(e){return this.check(Tf(Fm,e))},jwt(e){return this.check(Bf(Xm,e))},emoji(e){return this.check(Ef(Im,e))},guid(e){return this.check(bf(Nm,e))},uuid(e){return this.check(xf(Pm,e))},uuidv4(e){return this.check(Sf(Pm,e))},uuidv6(e){return this.check(Cf(Pm,e))},uuidv7(e){return this.check(wf(Pm,e))},nanoid(e){return this.check(Df(Lm,e))},cuid(e){return this.check(Of(Rm,e))},cuid2(e){return this.check(kf(zm,e))},ulid(e){return this.check(Af(Bm,e))},base64(e){return this.check(Lf(qm,e))},base64url(e){return this.check(Rf(Jm,e))},xid(e){return this.check(jf(Vm,e))},ksuid(e){return this.check(Mf(Hm,e))},ipv4(e){return this.check(Nf(Um,e))},ipv6(e){return this.check(Pf(Wm,e))},cidrv4(e){return this.check(Ff(Gm,e))},cidrv6(e){return this.check(If(Km,e))},e164(e){return this.check(zf(Ym,e))},datetime(e){return this.check(Vf(Om,e))},date(e){return this.check(Hf(km,e))},time(e){return this.check(Uf(Am,e))},duration(e){return this.check(Wf(jm,e))}});function X(e){return vf(Em,e)}var Dm=Y(`ZodStringFormat`,(e,t)=>{ju.init(e,t),Tm.init(e,t)}),Om=Y(`ZodISODateTime`,(e,t)=>{Ju.init(e,t),Dm.init(e,t)}),km=Y(`ZodISODate`,(e,t)=>{Yu.init(e,t),Dm.init(e,t)}),Am=Y(`ZodISOTime`,(e,t)=>{Xu.init(e,t),Dm.init(e,t)}),jm=Y(`ZodISODuration`,(e,t)=>{Zu.init(e,t),Dm.init(e,t)}),Mm=Y(`ZodEmail`,(e,t)=>{Pu.init(e,t),Dm.init(e,t)}),Nm=Y(`ZodGUID`,(e,t)=>{Mu.init(e,t),Dm.init(e,t)}),Pm=Y(`ZodUUID`,(e,t)=>{Nu.init(e,t),Dm.init(e,t)}),Fm=Y(`ZodURL`,(e,t)=>{Bu.init(e,t),Dm.init(e,t)}),Im=Y(`ZodEmoji`,(e,t)=>{Vu.init(e,t),Dm.init(e,t)}),Lm=Y(`ZodNanoID`,(e,t)=>{Hu.init(e,t),Dm.init(e,t)}),Rm=Y(`ZodCUID`,(e,t)=>{Uu.init(e,t),Dm.init(e,t)}),zm=Y(`ZodCUID2`,(e,t)=>{Wu.init(e,t),Dm.init(e,t)}),Bm=Y(`ZodULID`,(e,t)=>{Gu.init(e,t),Dm.init(e,t)}),Vm=Y(`ZodXID`,(e,t)=>{Ku.init(e,t),Dm.init(e,t)}),Hm=Y(`ZodKSUID`,(e,t)=>{qu.init(e,t),Dm.init(e,t)}),Um=Y(`ZodIPv4`,(e,t)=>{Qu.init(e,t),Dm.init(e,t)}),Wm=Y(`ZodIPv6`,(e,t)=>{td.init(e,t),Dm.init(e,t)}),Gm=Y(`ZodCIDRv4`,(e,t)=>{nd.init(e,t),Dm.init(e,t)}),Km=Y(`ZodCIDRv6`,(e,t)=>{id.init(e,t),Dm.init(e,t)}),qm=Y(`ZodBase64`,(e,t)=>{od.init(e,t),Dm.init(e,t)}),Jm=Y(`ZodBase64URL`,(e,t)=>{cd.init(e,t),Dm.init(e,t)}),Ym=Y(`ZodE164`,(e,t)=>{ld.init(e,t),Dm.init(e,t)}),Xm=Y(`ZodJWT`,(e,t)=>{dd.init(e,t),Dm.init(e,t)}),Zm=Y(`ZodNumber`,(e,t)=>{fd.init(e,t),wm.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Rp(e,t,n,r);let n=e._zod.bag;e.minValue=Math.max(n.minimum??-1/0,n.exclusiveMinimum??-1/0)??null,e.maxValue=Math.min(n.maximum??1/0,n.exclusiveMaximum??1/0)??null,e.isInt=(n.format??``).includes(`int`)||Number.isSafeInteger(n.multipleOf??.5),e.isFinite=!0,e.format=n.format??null},{gt(e,t){return this.check(Qf(e,t))},gte(e,t){return this.check($f(e,t))},min(e,t){return this.check($f(e,t))},lt(e,t){return this.check(Xf(e,t))},lte(e,t){return this.check(Zf(e,t))},max(e,t){return this.check(Zf(e,t))},int(e){return this.check(eh(e))},safe(e){return this.check(eh(e))},positive(e){return this.check(Qf(0,e))},nonnegative(e){return this.check($f(0,e))},negative(e){return this.check(Xf(0,e))},nonpositive(e){return this.check(Zf(0,e))},multipleOf(e,t){return this.check(ep(e,t))},step(e,t){return this.check(ep(e,t))},finite(){return this}});function Qm(e){return Gf(Zm,e)}var $m=Y(`ZodNumberFormat`,(e,t)=>{pd.init(e,t),Zm.init(e,t)});function eh(e){return Kf($m,e)}var th=Y(`ZodBoolean`,(e,t)=>{md.init(e,t),wm.init(e,t),e._zod.processJSONSchema=(t,n,r)=>zp(e,t,n,r)});function nh(e){return qf(th,e)}var rh=Y(`ZodUnknown`,(e,t)=>{hd.init(e,t),wm.init(e,t),e._zod.processJSONSchema=(e,t,n)=>void 0});function ih(){return Jf(rh)}var ah=Y(`ZodNever`,(e,t)=>{gd.init(e,t),wm.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Bp(e,t,n,r)});function oh(e){return Yf(ah,e)}var sh=Y(`ZodArray`,(e,t)=>{Cm(),vd.init(e,t),wm.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Gp(e,t,n,r),e.element=t.element},{min(e,t){return this.check(np(e,t))},nonempty(e){return this.check(np(1,e))},max(e,t){return this.check(tp(e,t))},length(e,t){return this.check(rp(e,t))},unwrap(){return this.element}});function ch(e,t){return gp(sh,e,t)}var lh=Y(`ZodObject`,(e,t)=>{Cm(),Td.init(e,t),wm.init(e,t),e._zod.processJSONSchema=(t,n,r)=>qp(e,t,n,r),Wc(e,`shape`,e=>e._zod.def.shape,!1)},{keyof(){return bh(Object.keys(this._zod.def.shape))},catchall(e){return this.clone({...this._zod.def,catchall:e})},passthrough(){return this.clone({...this._zod.def,catchall:ih()})},loose(){return this.clone({...this._zod.def,catchall:ih()})},strict(){return this.clone({...this._zod.def,catchall:oh()})},strip(){return this.clone({...this._zod.def,catchall:void 0})},extend(e){return yc(this,e)},safeExtend(e){return bc(this,e)},merge(e){return xc(this,e)},pick(e){return _c(this,e)},omit(e){return vc(this,e)},partial(...e){return Sc(Th,this,e[0])},exactPartial(...e){return Sc(Dh,this,e[0],`exactPartial`)},required(...e){return Cc(Fh,this,e[0])}});function Z(e,t){return new lh({type:`object`,shape:e??{},...pc(t)})}function uh(e,t){return new lh({type:`object`,shape:e,catchall:ih(),...pc(t)})}var dh=Y(`ZodUnion`,(e,t)=>{Dd.init(e,t),wm.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Jp(e,t,n,r),e.options=t.options});function fh(e,t){return new dh({type:`union`,options:e,...pc(t)})}var ph=Y(`ZodDiscriminatedUnion`,(e,t)=>{dh.init(e,t),Od.init(e,t)});function mh(e,t,n){return new ph({type:`union`,options:t,discriminator:e,...pc(n)})}var hh=Y(`ZodIntersection`,(e,t)=>{kd.init(e,t),wm.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Yp(e,t,n,r)});function gh(e,t){return new hh({type:`intersection`,left:e,right:t})}var _h=Y(`ZodRecord`,(e,t)=>{Cm(),Md.init(e,t),wm.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Xp(e,t,n,r),e.keyType=t.keyType,e.valueType=t.valueType});function vh(e,t,n){return!t||!t._zod?new _h({type:`record`,keyType:X(),valueType:e,...pc(t)}):new _h({type:`record`,keyType:e,valueType:t,...pc(n)})}var yh=Y(`ZodEnum`,(e,t)=>{Nd.init(e,t),wm.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Vp(e,t,n,r),e.enum=t.entries,e.options=Object.values(t.entries);let n=new Set(Object.keys(t.entries));e.extract=(e,r)=>{let i={};for(let r of e)if(n.has(r))i[r]=t.entries[r];else throw Error(`Key ${r} not found in enum`);return new yh({...t,checks:[],...pc(r),entries:i})},e.exclude=(e,r)=>{let i={...t.entries};for(let t of e)if(n.has(t))delete i[t];else throw Error(`Key ${t} not found in enum`);return new yh({...t,checks:[],...pc(r),entries:i})}});function bh(e,t){return new yh({type:`enum`,entries:Array.isArray(e)?Object.fromEntries(e.map(e=>[e,e])):e,...pc(t)})}var xh=Y(`ZodLiteral`,(e,t)=>{Pd.init(e,t),wm.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Hp(e,t,n,r),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});function Sh(e,t){return new xh({type:`literal`,values:Array.isArray(e)?e:[e],...pc(t)})}var Ch=Y(`ZodTransform`,(e,t)=>{Cm(),Fd.init(e,t),wm.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Wp(e,t,n,r),e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new Qc(e.constructor.name);n.addIssue=r=>{if(typeof r==`string`)n.issues.push(Pc(r,n.value,t));else{let t=r;t.fatal&&(t.continue=!1),t.code??=`custom`,`input`in t||(t.input=n.value),t.inst??=e,n.issues.push(Pc(t))}};let i=t.transform(n.value,n);return i instanceof Promise?i.then(e=>(n.value=e,n)):(n.value=i,n)}});function wh(e){return new Ch({type:`transform`,transform:e})}var Th=Y(`ZodOptional`,(e,t)=>{Ld.init(e,t),wm.init(e,t),e._zod.processJSONSchema=(t,n,r)=>om(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Eh(e){return new Th({type:`optional`,innerType:e})}var Dh=Y(`ZodExactOptional`,(e,t)=>{Rd.init(e,t),wm.init(e,t),e._zod.processJSONSchema=(t,n,r)=>om(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Oh(e){return new Dh({type:`optional`,innerType:e})}var kh=Y(`ZodNullable`,(e,t)=>{zd.init(e,t),wm.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Zp(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Ah(e){return new kh({type:`nullable`,innerType:e})}var jh=Y(`ZodDefault`,(e,t)=>{Bd.init(e,t),wm.init(e,t),e._zod.processJSONSchema=(t,n,r)=>tm(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function Mh(e,t){return new jh({type:`default`,innerType:e,get defaultValue(){return typeof t==`function`?t():lc(t)}})}var Nh=Y(`ZodPrefault`,(e,t)=>{Hd.init(e,t),wm.init(e,t),e._zod.processJSONSchema=(t,n,r)=>nm(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Ph(e,t){return new Nh({type:`prefault`,innerType:e,get defaultValue(){return typeof t==`function`?t():lc(t)}})}var Fh=Y(`ZodNonOptional`,(e,t)=>{Ud.init(e,t),wm.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Qp(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Ih(e,t){return new Fh({type:`nonoptional`,innerType:e,...pc(t)})}var Lh=Y(`ZodCatch`,(e,t)=>{Kd.init(e,t),wm.init(e,t),e._zod.processJSONSchema=(t,n,r)=>rm(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function Rh(e,t){return new Lh({type:`catch`,innerType:e,catchValue:typeof t==`function`?t:Kc(t)})}var zh=Y(`ZodPipe`,(e,t)=>{qd.init(e,t),wm.init(e,t),e._zod.processJSONSchema=(t,n,r)=>im(e,t,n,r),e.in=t.in,e.out=t.out});function Bh(e,t){return new zh({type:`pipe`,in:e,out:t})}var Vh=Y(`ZodReadonly`,(e,t)=>{Yd.init(e,t),wm.init(e,t),e._zod.processJSONSchema=(t,n,r)=>am(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Hh(e){return new Vh({type:`readonly`,innerType:e})}var Uh=Y(`ZodCustom`,(e,t)=>{Zd.init(e,t),wm.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Up(e,t,n,r)});function Wh(e,t={}){return _p(Uh,e,t)}function Gh(e,t){return vp(e,t)}var Kh={ModelRequest:Z({parts:ch(Z({__event__:X().optional(),content:X().optional()})).optional()}),ModelMessageChunk:Z({content:X().optional()}),ModelResponse:Z({message:Z({content:X().optional()}).nullish(),tool_calls:Z({calls:ch(ih()).optional()}).nullish()}),ToolCallsEvent:Z({calls:ch(Z({name:X(),arguments:ih().optional()})).optional()}),TaskCreated:Z({task_id:X(),title:X().optional(),kind:X().optional()}),TaskScheduled:Z({scheduled_for:X().optional(),recurrence:X().optional(),recurrence_desc:X().optional()}),TaskLifecycle:Z({agent_name:X().optional(),task_id:X().optional(),objective:X().optional(),result:ih().optional(),error:ih().optional(),reason:X().optional()}),SubagentTrace:Z({subagent_id:X().optional(),inner:uh({type:X()}).nullish()}),ObserverAlert:Z({message:X()}),DeliverableProduced:Z({task_id:X().optional(),deliverable_id:X(),description:X().optional(),preview:X().optional(),path:X().optional()}),ImageGenerated:Z({path:X(),prompt:X().optional()}),A2UISurface:Z({surface_id:X(),version:X().optional(),catalog_id:X().optional(),title:X().optional(),intent:X().optional(),component:vh(X(),ih()).optional(),components:ch(ih()).optional(),data:vh(X(),ih()).optional()}),A2UISurfaceDataUpdated:Z({surface_id:X(),data:vh(X(),ih()).optional()}),A2UIActionSubmitted:Z({surface_id:X()}),A2UIMessageEvent:Z({message:vh(X(),ih())}),Attachment:Z({path:X(),name:X().optional()}),InquiryRaised:Z({inquiry_id:X(),question:X(),detail:X().optional(),options:ch(X()).optional(),kind:X().optional()}),InquiryAnswered:Z({inquiry_id:X(),answer:X().optional(),status:X().optional()}),TurnCancelled:Z({reason:X().optional()}),TurnFailed:Z({error:X().optional()}),FeedbackGiven:Z({target_kind:bh([`message`,`image`,`deliverable`]),target_id:X(),sentiment:X().optional(),reason:X().optional()})},qh=Z({type:X(),data:vh(X(),ih()).default({})}),Jh=Z({created_at:Qm().optional()}),Yh=`ModelRequest.DrainedModelRequest.ModelMessageChunk.ModelResponse.ToolCallsEvent.TaskCreated.TaskScheduled.TaskStarted.TaskCompleted.TaskFailed.TaskCancelled.SubagentTrace.ObserverAlert.DeliverableProduced.ImageGenerated.A2UISurface.A2UISurfaceDataUpdated.A2UIActionSubmitted.A2UIMessageEvent.Attachment.InquiryRaised.InquiryAnswered.TurnCancelled.TurnFailed.FeedbackGiven.FeedbackCleared`.split(`.`),Xh=Z({event:qh}),Zh=Z({type:Sh(`ready`),chat:X().optional()}),Qh=Z({type:Sh(`turn_end`),chat:X().optional(),role:X().optional()}),$h=Z({type:Sh(`queued`),text:X().optional(),chat:X().optional()}),eg=Z({type:Sh(`error`),message:X().optional(),chat:X().optional()}),tg=fh([Xh,mh(`type`,[Zh,Qh,$h,eg])]),ng=fh([Xh,mh(`type`,[Zh,Z({type:Sh(`transcript`),role:bh([`user`,`agent`]),text:X(),final:nh().optional()}),Qh,eg])]);function rg(e){let t;try{t=JSON.parse(e)}catch{return null}let n=tg.safeParse(t);return n.success?n.data:null}var ig=class{chatId;onEvent;onReady;onQueued;onOpen;onTurnEnd;onError;ws;_closed;_queue;constructor(e,{onEvent:t,onReady:n,onOpen:r,onTurnEnd:i,onQueued:a,onError:o}={}){this.chatId=e,this.onEvent=t||(()=>{}),this.onReady=n||(()=>{}),this.onQueued=a||(()=>{}),this.onOpen=r||(()=>{}),this.onTurnEnd=i||(()=>{}),this.onError=o||(()=>{}),this.ws=null,this._closed=!1,this._queue=[]}connect(){let e=`${location.protocol===`https:`?`wss`:`ws`}://${location.host}${ys(`/stream?chat=`+encodeURIComponent(this.chatId))}`;return this.ws=new WebSocket(e),this.ws.onopen=()=>{this.onOpen();let e=this._queue;this._queue=[],e.forEach(e=>this._raw(e))},this.ws.onmessage=e=>{let t=rg(String(e.data));if(t){if(`event`in t){this.onEvent(t.event);return}switch(t.type){case`ready`:this.onReady(t);break;case`turn_end`:this.onTurnEnd(t);break;case`queued`:this.onQueued(t);break;case`error`:this.onError(t)}}},this.ws.onclose=e=>{if(!this._closed){if(e&&(e.code===4001||e.code===4404||e.code===4410)){this._closed=!0,ws(`ws `+e.code);return}setTimeout(()=>this.connect(),1500)}},this}_raw(e){try{this.ws?.send(JSON.stringify(e))}catch{}}_send(e){this.ws&&this.ws.readyState===WebSocket.OPEN?this._raw(e):this._queue.push(e)}send(e,t,n=``){this._send(n?{text:e,attachments:t,model:n}:{text:e,attachments:t})}cancel(){this._send({type:`cancel`})}answer(e,t){this._send({type:`answer`,id:e,answer:t})}feedback(e){this._send({type:`feedback`,...e})}clearFeedback(e){this._send({type:`feedback_clear`,...e})}a2ui(e,t){this._send(t?{type:`a2ui`,message:e,state:t}:{type:`a2ui`,message:e})}close(){this._closed=!0;try{this.ws?.close()}catch{}}},ag=` +Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let n of e.seen.entries()){let r=n[1];if(t===n[0]){a(n);continue}if(e.external){let r=e.external.registry.get(n[0])?.id;if(t!==n[0]&&r){a(n);continue}}if(e.metadataRegistry.get(n[0])?.id){a(n);continue}if(r.cycle){a(n);continue}if(r.count>1&&e.reused===`ref`){a(n);continue}}e.external&&(e.sharedDefsExtractedFor=e.external)}function Ep(e){let t=e.anyOf;if(!Array.isArray(t)||t.length===0||e.type!==void 0)return;let n=[];for(let e of t){if(!e||typeof e!=`object`)return;Ep(e);let t=Object.keys(e);if(t.length!==1||t[0]!==`type`)return;let r=e.type;for(let e of Array.isArray(r)?r:[r]){if(typeof e!=`string`)return;n.includes(e)||n.push(e)}}delete e.anyOf,e.type=n.length===1?n[0]:n}var Dp=new Set([`type`,`properties`,`required`,`additionalProperties`]),Op=[`oneOf`,`anyOf`];function kp(e){let t=e.additionalProperties;return t===void 0||t===!1||typeof t!=`object`||!t?null:Object.keys(t).length?t:null}function Ap(e){let t=[];for(let n of e){if(typeof n!=`object`||n.type!==`object`)return null;for(let e in n)if(!Dp.has(e))return null;t.push(n)}let n={},r=new Set;for(let e of t){for(let r in e.properties){if(Object.prototype.hasOwnProperty.call(n,r))continue;let e=[];for(let n of t){let t=n.properties?.[r]??kp(n);t!=null&&(e.some(e=>JSON.stringify(e)===JSON.stringify(t))||e.push(t))}tc(n,r,e.length===1?e[0]:Ap(e)??{allOf:e})}for(let t of e.required??[])r.add(t)}let i={type:`object`,properties:n};if(r.size&&(i.required=[...r]),t.every(e=>e.additionalProperties===!1))i.additionalProperties=!1;else{let e=[];for(let n of t){let t=kp(n);t&&!e.some(e=>JSON.stringify(e)===JSON.stringify(t))&&e.push(t)}e.length===1?i.additionalProperties=e[0]:e.length>1&&(i.additionalProperties={allOf:e})}return i}function jp(e){let t=e.allOf;if(!Array.isArray(t)||t.length<2)return;for(let t of Dp)if(t in e)return;let n=t.filter(e=>Op.some(t=>Array.isArray(e[t]))),r=null;if(!n.length)r=Ap(t);else{let e=n[0],i=Op.find(t=>Array.isArray(e[t]));if(Object.keys(e).length!==1)return;let a=t.filter(t=>t!==e),o=e[i].map(e=>Ap([...a,e]));if(o.some(e=>!e))return;r={[i]:o}}r&&(delete e.allOf,bp(e,r))}function Mp(e,t){let n=e.seen.get(t);if(!n)throw Error(`Unprocessed schema. This is a bug in Zod.`);let r=t=>{let n=e.seen.get(t);if(n.ref===null)return;let i=n.def??n.schema,a={...i},o=n.ref;if(n.ref=null,o){r(o);let n=e.seen.get(o),s=n.schema;if(s.$ref&&(e.target===`draft-07`||e.target===`draft-04`||e.target===`openapi-3.0`)?(i.allOf=i.allOf??[],i.allOf.push(s)):bp(i,s),bp(i,a),t._zod.parent===o)for(let e in i)e!==`$ref`&&e!==`allOf`&&(e in a||delete i[e]);if(s.$ref&&n.def)for(let e in i)e!==`$ref`&&e!==`allOf`&&e in n.def&&JSON.stringify(i[e])===JSON.stringify(n.def[e])&&delete i[e]}let s=t._zod.parent;if(s&&s!==o){r(s);let t=e.seen.get(s);if(t?.schema.$ref&&(i.$ref=t.schema.$ref,t.def))for(let e in i)e!==`$ref`&&e!==`allOf`&&e in t.def&&JSON.stringify(i[e])===JSON.stringify(t.def[e])&&delete i[e]}e.override({zodSchema:t,jsonSchema:i,path:n.path??[]})};if(!e.external||e.sharedEmitDoneFor!==e.external){for(let t of[...e.seen.entries()].reverse())r(t[0]);if(e.target!==`openapi-3.0`)for(let t of e.seen.entries())Ep(t[1].def??t[1].schema);if(e.intersections.length){let t=new Map;for(let n of e.seen.values())for(let e of[n.schema,n.def]){let n=e?.allOf;if(!Array.isArray(n))continue;let r=t.get(n);r?r.push(e):t.set(n,[e])}for(let n of e.intersections)for(let e of t.get(n)??[])jp(e)}}let i={};if(e.target===`draft-2020-12`?i.$schema=`https://json-schema.org/draft/2020-12/schema`:e.target===`draft-07`?i.$schema=`http://json-schema.org/draft-07/schema#`:e.target===`draft-04`?i.$schema=`http://json-schema.org/draft-04/schema#`:e.target,e.external?.uri){let n=e.external.registry.get(t)?.id;if(!n)throw Error("Schema is missing an `id` property");i.$id=e.external.uri(n)}bp(i,n.defId?n.schema:n.def??n.schema);let a=e.metadataRegistry.get(t)?.id;a!==void 0&&i.id===a&&delete i.id;let o=e.external?.defs??{};if(!e.external||e.sharedEmitDoneFor!==e.external)for(let t of e.seen.entries()){let e=t[1];e.def&&e.defId&&(e.def.id===e.defId&&delete e.def.id,tc(o,e.defId,e.def))}e.external&&(e.sharedEmitDoneFor=e.external),e.external||Object.keys(o).length>0&&(e.target===`draft-2020-12`?i.$defs=o:i.definitions=o);try{let n=JSON.parse(JSON.stringify(i));return Object.defineProperty(n,"~standard",{value:{...t[`~standard`],jsonSchema:{input:Fp(t,`input`,e.processors),output:Fp(t,`output`,e.processors)}},enumerable:!1,writable:!1}),n}catch{throw Error(`Error converting schema to JSON.`)}}function Np(e,t){let n=t??{seen:new Set};if(n.seen.has(e))return!1;n.seen.add(e);let r=e._zod.def;if(r.type===`transform`)return!0;if(r.type===`array`)return Np(r.element,n);if(r.type===`set`)return Np(r.valueType,n);if(r.type===`lazy`)return Np(r.getter(),n);if(r.type===`promise`||r.type===`optional`||r.type===`nonoptional`||r.type===`nullable`||r.type===`readonly`||r.type==="default"||r.type===`prefault`||r.type===`catch`)return Np(r.innerType,n);if(r.type===`intersection`)return Np(r.left,n)||Np(r.right,n);if(r.type===`record`||r.type===`map`)return Np(r.keyType,n)||Np(r.valueType,n);if(r.type===`pipe`)return e._zod.traits.has(`$ZodCodec`)?!0:Np(r.in,n)||Np(r.out,n);if(r.type===`object`){for(let e in r.shape)if(Np(r.shape[e],n))return!0;return!1}if(r.type===`union`){for(let e of r.options)if(Np(e,n))return!0;return!1}if(r.type===`tuple`){for(let e of r.items)if(Np(e,n))return!0;return!!(r.rest&&Np(r.rest,n))}return!1}var Pp=(e,t={})=>n=>{let r=xp({...n,processors:t});return Cp(e,r),Tp(r,e),Mp(r,e)},Fp=(e,t,n={})=>r=>{let{libraryOptions:i,target:a}=r??{},o=xp({...i??{},target:a,io:t,processors:n});return Cp(e,o),Tp(o,e),Mp(o,e)},Ip={guid:`uuid`,url:`uri`,datetime:`date-time`,json_string:`json-string`,regex:``},Lp=(e,t,n,r)=>{let i=n;i.type=`string`;let{minimum:a,maximum:o,format:s,patterns:c,contentEncoding:l,laxFormat:u}=e._zod.bag;if(typeof a==`number`&&(i.minLength=a),typeof o==`number`&&(i.maxLength=o),s&&(i.format=Ip[s]??s,i.format===``&&delete i.format,(s===`time`||u)&&delete i.format),l&&(i.contentEncoding=l),c&&c.size>0){let e=[...c];e.length===1?i.pattern=e[0].source:e.length>1&&(i.allOf=[...e.map(e=>({...t.target===`draft-07`||t.target===`draft-04`||t.target===`openapi-3.0`?{type:`string`}:{},pattern:e.source}))])}},Rp=(e,t,n,r)=>{let i=n,{minimum:a,maximum:o,format:s,multipleOf:c,exclusiveMaximum:l,exclusiveMinimum:u}=e._zod.bag;i.type=typeof s==`string`&&s.includes(`int`)?`integer`:`number`;let d=typeof u==`number`&&u>=(a??-1/0),f=typeof l==`number`&&l<=(o??1/0),p=t.target===`draft-04`||t.target===`openapi-3.0`;d?p?(i.minimum=u,i.exclusiveMinimum=!0):i.exclusiveMinimum=u:typeof a==`number`&&(i.minimum=a),f?p?(i.maximum=l,i.exclusiveMaximum=!0):i.exclusiveMaximum=l:typeof o==`number`&&(i.maximum=o),typeof c==`number`&&(Number.isFinite(c)&&c!==0?i.multipleOf=Math.abs(c):Sp(e,t,i,r,`A multipleOf divisor of ${c} cannot be represented in JSON Schema`))},zp=(e,t,n,r)=>{n.type=`boolean`},Bp=(e,t,n,r)=>{n.not={}},Vp=(e,t,n,r)=>{let i=e._zod.def,a=Js(i.entries);if(a.length===0){n.not={};return}a.every(e=>typeof e==`number`)&&(n.type=`number`),a.every(e=>typeof e==`string`)&&(n.type=`string`),n.enum=a},Hp=(e,t,n,r)=>{let i=e._zod.def;if(i.values.length===0){n.not={};return}let a=[];for(let o of i.values)if(o===void 0){if(Sp(e,t,n,r,"Literal `undefined` cannot be represented in JSON Schema"))return}else if(typeof o==`bigint`){if(Sp(e,t,n,r,`BigInt literals cannot be represented in JSON Schema`))return;a.push(Number(o))}else a.push(o);if(a.length!==0){if(a.length===1){let e=a[0];n.type=e===null?`null`:typeof e,t.target===`draft-04`||t.target===`openapi-3.0`?n.enum=[e]:n.const=e}else a.every(e=>typeof e==`number`)&&(n.type=`number`),a.every(e=>typeof e==`string`)&&(n.type=`string`),a.every(e=>typeof e==`boolean`)&&(n.type=`boolean`),a.every(e=>e===null)&&(n.type=`null`),n.enum=a}},Up=(e,t,n,r)=>{Sp(e,t,n,r,`Custom types cannot be represented in JSON Schema`)},Wp=(e,t,n,r)=>{Sp(e,t,n,r,`Transforms cannot be represented in JSON Schema`)},Gp=(e,t,n,r)=>{let i=n,a=e._zod.def,{minimum:o,maximum:s}=e._zod.bag;typeof o==`number`&&(i.minItems=o),typeof s==`number`&&(i.maxItems=s),i.type=`array`,i.items=Cp(a.element,t,{...r,path:[...r.path,`items`]})};function Kp(e){let t=e._zod.def;return t.type===`pipe`&&t.in._zod.traits.has(`$ZodTransform`)?Kp(t.out):t.type===`catch`?Kp(t.innerType):e._zod.optin}var qp=(e,t,n,r)=>{let i=n,a=e._zod.def,o=a.shape;if(Object.getOwnPropertySymbols(o).length&&Sp(e,t,i,r,`Symbol keys cannot be represented in JSON Schema`))return;i.type=`object`,i.properties={};for(let e in o)tc(i.properties,e,Cp(o[e],t,{...r,path:[...r.path,`properties`,e]}));let s=new Set(Object.keys(o)),c=new Set([...s].filter(e=>{let n=a.shape[e];return t.io===`input`?Kp(n)===void 0:n._zod.optout===void 0}));c.size>0&&(i.required=Array.from(c)),a.catchall?._zod.def.type===`never`?i.additionalProperties=!1:a.catchall?a.catchall&&(i.additionalProperties=Cp(a.catchall,t,{...r,path:[...r.path,`additionalProperties`]})):t.io===`output`&&(i.additionalProperties=!1)},Jp=(e,t,n,r)=>{let i=e._zod.def,a=i.inclusive===!1,o=i.options.map((e,n)=>Cp(e,t,{...r,path:[...r.path,a?`oneOf`:`anyOf`,n]}));a?n.oneOf=o:n.anyOf=o},Yp=(e,t,n,r)=>{let i=e._zod.def,a=Cp(i.left,t,{...r,path:[...r.path,`allOf`,0]}),o=Cp(i.right,t,{...r,path:[...r.path,`allOf`,1]}),s=e=>`allOf`in e&&Object.keys(e).length===1,c=[...s(a)?a.allOf:[a],...s(o)?o.allOf:[o]];n.allOf=c,t.intersections.push(c)},Xp=(e,t,n,r)=>{let i=n,a=e._zod.def;i.type=`object`;let o=a.keyType,s=o._zod.bag?.patterns;if(a.mode===`loose`&&s&&s.size>0){let e=Cp(a.valueType,t,{...r,path:[...r.path,`patternProperties`,`*`]});i.patternProperties={};for(let t of s)tc(i.patternProperties,t.source,e)}else(t.target===`draft-07`||t.target===`draft-2020-12`)&&(i.propertyNames=Cp(a.keyType,t,{...r,path:[...r.path,`propertyNames`]})),i.additionalProperties=Cp(a.valueType,t,{...r,path:[...r.path,`additionalProperties`]});let c=o._zod.values,l=t.io===`input`&&Kp(a.valueType)!==void 0;if(c&&!a.partial&&!l){let e=[...c].filter(e=>typeof e==`string`||typeof e==`number`);e.length>0&&(i.required=e)}},Zp=(e,t,n,r)=>{let i=e._zod.def,a=Cp(i.innerType,t,r),o=t.seen.get(e);t.target===`openapi-3.0`?(o.ref=i.innerType,n.nullable=!0):n.anyOf=[a,{type:`null`}]},Qp=(e,t,n,r)=>{let i=e._zod.def;Cp(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},$p=Symbol();function em(e,t,n,r,i){let a=!1,o=JSON.stringify(e,(e,t)=>typeof t==`bigint`?(a=!0,null):t);return a?(Sp(t,n,r,i,`BigInt defaults cannot be represented in JSON Schema`),$p):JSON.parse(o)}var tm=(e,t,n,r)=>{let i=e._zod.def;Cp(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType;let o=em(i.defaultValue,e,t,n,r);o!==$p&&(n.default=o)},nm=(e,t,n,r)=>{let i=e._zod.def;Cp(i.innerType,t,r);let a=t.seen.get(e);if(a.ref=i.innerType,t.io!==`input`)return;let o=em(i.defaultValue,e,t,n,r);o!==$p&&(n._prefault=o)},rm=(e,t,n,r)=>{let i=e._zod.def;Cp(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType;let o;try{o=i.catchValue(void 0)}catch{Sp(e,t,n,r,`Dynamic catch values are not supported in JSON Schema`);return}n.default=o},im=(e,t,n,r)=>{let i=e._zod.def,a=i.in._zod.traits.has(`$ZodTransform`),o=t.io===`input`?a?i.out:i.in:i.out;Cp(o,t,r);let s=t.seen.get(e);s.ref=o},am=(e,t,n,r)=>{let i=e._zod.def;Cp(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,n.readOnly=!0},om=(e,t,n,r)=>{let i=e._zod.def;Cp(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},sm=new WeakSet([Object.prototype,Error.prototype]);function cm(e,t,n){Object.defineProperty(e,t,{configurable:!0,enumerable:!1,get(){let e=n(this);return Object.defineProperty(this,t,{value:e,configurable:!0,writable:!0}),e},set(e){Object.defineProperty(this,t,{value:e,configurable:!0,writable:!0})}})}var lm=Y(`ZodError`,(e,t)=>{cl.init(e,t),e.name=`ZodError`;let n=Object.getPrototypeOf(e);sm.has(n)||(sm.add(n),cm(n,`format`,e=>t=>fl(e,t)),cm(n,`flatten`,e=>t=>dl(e,t)),cm(n,`addIssue`,e=>t=>{e.issues.push(t),e.message=JSON.stringify(e.issues,Xs,2)}),cm(n,`addIssues`,e=>t=>{e.issues.push(...t),e.message=JSON.stringify(e.issues,Xs,2)}),Object.defineProperty(n,"isEmpty",{configurable:!0,enumerable:!1,get(){return this.issues.length===0}}))},void 0,{Parent:Error}),um=ml(lm),dm=hl(lm),fm=gl(lm),pm=vl(lm),mm=bl(lm),hm=xl(lm),gm=Sl(lm),_m=Cl(lm),vm=wl(lm),ym=Tl(lm),bm=El(lm),xm=Dl(lm);function Sm(){$c.localeError||el(pf())}function Cm(){$c.memoizer||el({memoizer:uf()})}var wm=Y(`ZodType`,(e,t)=>(Sm(),Du.init(e,t),e.def=t,e.type=t.type,e),{check(...e){let t=this.def;return this.clone(nc(t,{checks:[...t.checks??[],...e.map(e=>typeof e==`function`?{_zod:{check:e,def:{check:`custom`},onattach:[]}}:e)]}),{parent:!0})},with(...e){return this.check(...e)},clone(e,t){return fc(this,e,t)},brand(){return this},register(e,t){return e.add(this,t),this},refine(e,t){return this.check(Wh(e,t))},superRefine(e,t){return this.check(Gh(e,t))},overwrite(e){return this.check(up(e))},optional(){return Eh(this)},exactOptional(){return Oh(this)},nullable(){return Ah(this)},nullish(){return Eh(Ah(this))},nonoptional(e){return Ih(this,e)},array(){return ch(this)},or(e){return fh([this,e])},and(e){return gh(this,e)},transform(e){return Bh(this,wh(e))},default(e){return Mh(this,e)},prefault(e){return Ph(this,e)},catch(e){return Rh(this,e)},pipe(e){return Bh(this,e)},readonly(){return Hh(this)},describe(e){let t=this.clone();return _f.add(t,{description:e}),t},meta(...e){if(e.length===0)return _f.get(this);let t=this.clone();return _f.add(t,e[0]),t},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(e,...t){return t.length===0?e(this):e(this,...t)},get"~standard"(){return Lc(this,`~standard`,{...ku(this),jsonSchema:{input:Fp(this,`input`),output:Fp(this,`output`)}})},set"~standard"(e){Ic(this,`~standard`,e)},parse:function e(t,n){return um(this,t,n,{callee:e})},parseAsync:async function e(t,n){return await dm(this,t,n,{callee:e})},safeParse(e,t){return fm(this,e,t)},async safeParseAsync(e,t){return pm(this,e,t)},get spa(){return this?.safeParseAsync},set spa(e){Ic(this,`spa`,e)},encode:function e(t,n){return mm(this,t,n,{callee:e})},decode:function e(t,n){return hm(this,t,n,{callee:e})},encodeAsync:async function e(t,n){return await gm(this,t,n,{callee:e})},decodeAsync:async function e(t,n){return await _m(this,t,n,{callee:e})},safeEncode(e,t){return vm(this,e,t)},safeDecode(e,t){return ym(this,e,t)},async safeEncodeAsync(e,t){return bm(this,e,t)},async safeDecodeAsync(e,t){return xm(this,e,t)},toJSONSchema(e){return Pp(this,{})(e)},get description(){return _f.get(this)?.description},get _def(){return this._zod.def}}),Tm=Y(`_ZodString`,(e,t)=>{Au.init(e,t),wm.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Lp(e,t,n,r);let n=e._zod.bag;e.format=n.format??null,e.minLength=n.minimum??null,e.maxLength=n.maximum??null},{regex(...e){return this.check(ip(...e))},includes(...e){return this.check(sp(...e))},startsWith(...e){return this.check(cp(...e))},endsWith(...e){return this.check(lp(...e))},min(...e){return this.check(np(...e))},max(...e){return this.check(tp(...e))},length(...e){return this.check(rp(...e))},nonempty(...e){return this.check(np(1,...e))},lowercase(e){return this.check(ap(e))},uppercase(e){return this.check(op(e))},trim(){return this.check(fp())},normalize(...e){return this.check(dp(...e))},toLowerCase(){return this.check(pp())},toUpperCase(){return this.check(mp())},slugify(){return this.check(hp())}}),Em=Y(`ZodString`,(e,t)=>{Au.init(e,t),Tm.init(e,t)},{email(e){return this.check(yf(Mm,e))},url(e){return this.check(Tf(Fm,e))},jwt(e){return this.check(Bf(Xm,e))},emoji(e){return this.check(Ef(Im,e))},guid(e){return this.check(bf(Nm,e))},uuid(e){return this.check(xf(Pm,e))},uuidv4(e){return this.check(Sf(Pm,e))},uuidv6(e){return this.check(Cf(Pm,e))},uuidv7(e){return this.check(wf(Pm,e))},nanoid(e){return this.check(Df(Lm,e))},cuid(e){return this.check(Of(Rm,e))},cuid2(e){return this.check(kf(zm,e))},ulid(e){return this.check(Af(Bm,e))},base64(e){return this.check(Lf(qm,e))},base64url(e){return this.check(Rf(Jm,e))},xid(e){return this.check(jf(Vm,e))},ksuid(e){return this.check(Mf(Hm,e))},ipv4(e){return this.check(Nf(Um,e))},ipv6(e){return this.check(Pf(Wm,e))},cidrv4(e){return this.check(Ff(Gm,e))},cidrv6(e){return this.check(If(Km,e))},e164(e){return this.check(zf(Ym,e))},datetime(e){return this.check(Vf(Om,e))},date(e){return this.check(Hf(km,e))},time(e){return this.check(Uf(Am,e))},duration(e){return this.check(Wf(jm,e))}});function X(e){return vf(Em,e)}var Dm=Y(`ZodStringFormat`,(e,t)=>{ju.init(e,t),Tm.init(e,t)}),Om=Y(`ZodISODateTime`,(e,t)=>{Ju.init(e,t),Dm.init(e,t)}),km=Y(`ZodISODate`,(e,t)=>{Yu.init(e,t),Dm.init(e,t)}),Am=Y(`ZodISOTime`,(e,t)=>{Xu.init(e,t),Dm.init(e,t)}),jm=Y(`ZodISODuration`,(e,t)=>{Zu.init(e,t),Dm.init(e,t)}),Mm=Y(`ZodEmail`,(e,t)=>{Pu.init(e,t),Dm.init(e,t)}),Nm=Y(`ZodGUID`,(e,t)=>{Mu.init(e,t),Dm.init(e,t)}),Pm=Y(`ZodUUID`,(e,t)=>{Nu.init(e,t),Dm.init(e,t)}),Fm=Y(`ZodURL`,(e,t)=>{Bu.init(e,t),Dm.init(e,t)}),Im=Y(`ZodEmoji`,(e,t)=>{Vu.init(e,t),Dm.init(e,t)}),Lm=Y(`ZodNanoID`,(e,t)=>{Hu.init(e,t),Dm.init(e,t)}),Rm=Y(`ZodCUID`,(e,t)=>{Uu.init(e,t),Dm.init(e,t)}),zm=Y(`ZodCUID2`,(e,t)=>{Wu.init(e,t),Dm.init(e,t)}),Bm=Y(`ZodULID`,(e,t)=>{Gu.init(e,t),Dm.init(e,t)}),Vm=Y(`ZodXID`,(e,t)=>{Ku.init(e,t),Dm.init(e,t)}),Hm=Y(`ZodKSUID`,(e,t)=>{qu.init(e,t),Dm.init(e,t)}),Um=Y(`ZodIPv4`,(e,t)=>{Qu.init(e,t),Dm.init(e,t)}),Wm=Y(`ZodIPv6`,(e,t)=>{td.init(e,t),Dm.init(e,t)}),Gm=Y(`ZodCIDRv4`,(e,t)=>{nd.init(e,t),Dm.init(e,t)}),Km=Y(`ZodCIDRv6`,(e,t)=>{id.init(e,t),Dm.init(e,t)}),qm=Y(`ZodBase64`,(e,t)=>{od.init(e,t),Dm.init(e,t)}),Jm=Y(`ZodBase64URL`,(e,t)=>{cd.init(e,t),Dm.init(e,t)}),Ym=Y(`ZodE164`,(e,t)=>{ld.init(e,t),Dm.init(e,t)}),Xm=Y(`ZodJWT`,(e,t)=>{dd.init(e,t),Dm.init(e,t)}),Zm=Y(`ZodNumber`,(e,t)=>{fd.init(e,t),wm.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Rp(e,t,n,r);let n=e._zod.bag;e.minValue=Math.max(n.minimum??-1/0,n.exclusiveMinimum??-1/0)??null,e.maxValue=Math.min(n.maximum??1/0,n.exclusiveMaximum??1/0)??null,e.isInt=(n.format??``).includes(`int`)||Number.isSafeInteger(n.multipleOf??.5),e.isFinite=!0,e.format=n.format??null},{gt(e,t){return this.check(Qf(e,t))},gte(e,t){return this.check($f(e,t))},min(e,t){return this.check($f(e,t))},lt(e,t){return this.check(Xf(e,t))},lte(e,t){return this.check(Zf(e,t))},max(e,t){return this.check(Zf(e,t))},int(e){return this.check(eh(e))},safe(e){return this.check(eh(e))},positive(e){return this.check(Qf(0,e))},nonnegative(e){return this.check($f(0,e))},negative(e){return this.check(Xf(0,e))},nonpositive(e){return this.check(Zf(0,e))},multipleOf(e,t){return this.check(ep(e,t))},step(e,t){return this.check(ep(e,t))},finite(){return this}});function Qm(e){return Gf(Zm,e)}var $m=Y(`ZodNumberFormat`,(e,t)=>{pd.init(e,t),Zm.init(e,t)});function eh(e){return Kf($m,e)}var th=Y(`ZodBoolean`,(e,t)=>{md.init(e,t),wm.init(e,t),e._zod.processJSONSchema=(t,n,r)=>zp(e,t,n,r)});function nh(e){return qf(th,e)}var rh=Y(`ZodUnknown`,(e,t)=>{hd.init(e,t),wm.init(e,t),e._zod.processJSONSchema=(e,t,n)=>void 0});function ih(){return Jf(rh)}var ah=Y(`ZodNever`,(e,t)=>{gd.init(e,t),wm.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Bp(e,t,n,r)});function oh(e){return Yf(ah,e)}var sh=Y(`ZodArray`,(e,t)=>{Cm(),vd.init(e,t),wm.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Gp(e,t,n,r),e.element=t.element},{min(e,t){return this.check(np(e,t))},nonempty(e){return this.check(np(1,e))},max(e,t){return this.check(tp(e,t))},length(e,t){return this.check(rp(e,t))},unwrap(){return this.element}});function ch(e,t){return gp(sh,e,t)}var lh=Y(`ZodObject`,(e,t)=>{Cm(),Td.init(e,t),wm.init(e,t),e._zod.processJSONSchema=(t,n,r)=>qp(e,t,n,r),Wc(e,`shape`,e=>e._zod.def.shape,!1)},{keyof(){return bh(Object.keys(this._zod.def.shape))},catchall(e){return this.clone({...this._zod.def,catchall:e})},passthrough(){return this.clone({...this._zod.def,catchall:ih()})},loose(){return this.clone({...this._zod.def,catchall:ih()})},strict(){return this.clone({...this._zod.def,catchall:oh()})},strip(){return this.clone({...this._zod.def,catchall:void 0})},extend(e){return yc(this,e)},safeExtend(e){return bc(this,e)},merge(e){return xc(this,e)},pick(e){return _c(this,e)},omit(e){return vc(this,e)},partial(...e){return Sc(Th,this,e[0])},exactPartial(...e){return Sc(Dh,this,e[0],`exactPartial`)},required(...e){return Cc(Fh,this,e[0])}});function Z(e,t){return new lh({type:`object`,shape:e??{},...pc(t)})}function uh(e,t){return new lh({type:`object`,shape:e,catchall:ih(),...pc(t)})}var dh=Y(`ZodUnion`,(e,t)=>{Dd.init(e,t),wm.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Jp(e,t,n,r),e.options=t.options});function fh(e,t){return new dh({type:`union`,options:e,...pc(t)})}var ph=Y(`ZodDiscriminatedUnion`,(e,t)=>{dh.init(e,t),Od.init(e,t)});function mh(e,t,n){return new ph({type:`union`,options:t,discriminator:e,...pc(n)})}var hh=Y(`ZodIntersection`,(e,t)=>{kd.init(e,t),wm.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Yp(e,t,n,r)});function gh(e,t){return new hh({type:`intersection`,left:e,right:t})}var _h=Y(`ZodRecord`,(e,t)=>{Cm(),Md.init(e,t),wm.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Xp(e,t,n,r),e.keyType=t.keyType,e.valueType=t.valueType});function vh(e,t,n){return!t||!t._zod?new _h({type:`record`,keyType:X(),valueType:e,...pc(t)}):new _h({type:`record`,keyType:e,valueType:t,...pc(n)})}var yh=Y(`ZodEnum`,(e,t)=>{Nd.init(e,t),wm.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Vp(e,t,n,r),e.enum=t.entries,e.options=Object.values(t.entries);let n=new Set(Object.keys(t.entries));e.extract=(e,r)=>{let i={};for(let r of e)if(n.has(r))i[r]=t.entries[r];else throw Error(`Key ${r} not found in enum`);return new yh({...t,checks:[],...pc(r),entries:i})},e.exclude=(e,r)=>{let i={...t.entries};for(let t of e)if(n.has(t))delete i[t];else throw Error(`Key ${t} not found in enum`);return new yh({...t,checks:[],...pc(r),entries:i})}});function bh(e,t){return new yh({type:`enum`,entries:Array.isArray(e)?Object.fromEntries(e.map(e=>[e,e])):e,...pc(t)})}var xh=Y(`ZodLiteral`,(e,t)=>{Pd.init(e,t),wm.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Hp(e,t,n,r),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});function Sh(e,t){return new xh({type:`literal`,values:Array.isArray(e)?e:[e],...pc(t)})}var Ch=Y(`ZodTransform`,(e,t)=>{Cm(),Fd.init(e,t),wm.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Wp(e,t,n,r),e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new Qc(e.constructor.name);n.addIssue=r=>{if(typeof r==`string`)n.issues.push(Pc(r,n.value,t));else{let t=r;t.fatal&&(t.continue=!1),t.code??=`custom`,`input`in t||(t.input=n.value),t.inst??=e,n.issues.push(Pc(t))}};let i=t.transform(n.value,n);return i instanceof Promise?i.then(e=>(n.value=e,n)):(n.value=i,n)}});function wh(e){return new Ch({type:`transform`,transform:e})}var Th=Y(`ZodOptional`,(e,t)=>{Ld.init(e,t),wm.init(e,t),e._zod.processJSONSchema=(t,n,r)=>om(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Eh(e){return new Th({type:`optional`,innerType:e})}var Dh=Y(`ZodExactOptional`,(e,t)=>{Rd.init(e,t),wm.init(e,t),e._zod.processJSONSchema=(t,n,r)=>om(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Oh(e){return new Dh({type:`optional`,innerType:e})}var kh=Y(`ZodNullable`,(e,t)=>{zd.init(e,t),wm.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Zp(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Ah(e){return new kh({type:`nullable`,innerType:e})}var jh=Y(`ZodDefault`,(e,t)=>{Bd.init(e,t),wm.init(e,t),e._zod.processJSONSchema=(t,n,r)=>tm(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function Mh(e,t){return new jh({type:`default`,innerType:e,get defaultValue(){return typeof t==`function`?t():lc(t)}})}var Nh=Y(`ZodPrefault`,(e,t)=>{Hd.init(e,t),wm.init(e,t),e._zod.processJSONSchema=(t,n,r)=>nm(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Ph(e,t){return new Nh({type:`prefault`,innerType:e,get defaultValue(){return typeof t==`function`?t():lc(t)}})}var Fh=Y(`ZodNonOptional`,(e,t)=>{Ud.init(e,t),wm.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Qp(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Ih(e,t){return new Fh({type:`nonoptional`,innerType:e,...pc(t)})}var Lh=Y(`ZodCatch`,(e,t)=>{Kd.init(e,t),wm.init(e,t),e._zod.processJSONSchema=(t,n,r)=>rm(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function Rh(e,t){return new Lh({type:`catch`,innerType:e,catchValue:typeof t==`function`?t:Kc(t)})}var zh=Y(`ZodPipe`,(e,t)=>{qd.init(e,t),wm.init(e,t),e._zod.processJSONSchema=(t,n,r)=>im(e,t,n,r),e.in=t.in,e.out=t.out});function Bh(e,t){return new zh({type:`pipe`,in:e,out:t})}var Vh=Y(`ZodReadonly`,(e,t)=>{Yd.init(e,t),wm.init(e,t),e._zod.processJSONSchema=(t,n,r)=>am(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Hh(e){return new Vh({type:`readonly`,innerType:e})}var Uh=Y(`ZodCustom`,(e,t)=>{Zd.init(e,t),wm.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Up(e,t,n,r)});function Wh(e,t={}){return _p(Uh,e,t)}function Gh(e,t){return vp(e,t)}var Kh={ModelRequest:Z({parts:ch(Z({__event__:X().optional(),content:X().optional()})).optional()}),ModelMessageChunk:Z({content:X().optional()}),ModelResponse:Z({message:Z({content:X().optional()}).nullish(),tool_calls:Z({calls:ch(ih()).optional()}).nullish()}),ToolCallsEvent:Z({calls:ch(Z({name:X(),arguments:ih().optional()})).optional()}),TaskCreated:Z({task_id:X(),title:X().optional(),kind:X().optional()}),TaskScheduled:Z({scheduled_for:X().optional(),recurrence:X().optional(),recurrence_desc:X().optional()}),TaskLifecycle:Z({agent_name:X().optional(),task_id:X().optional(),objective:X().optional(),result:ih().optional(),error:ih().optional(),reason:X().optional()}),SubagentTrace:Z({subagent_id:X().optional(),inner:uh({type:X()}).nullish()}),ObserverAlert:Z({message:X()}),DeliverableProduced:Z({task_id:X().optional(),deliverable_id:X(),description:X().optional(),preview:X().optional(),path:X().optional()}),ImageGenerated:Z({path:X(),prompt:X().optional()}),A2UISurface:Z({surface_id:X(),version:X().optional(),catalog_id:X().optional(),title:X().optional(),intent:X().optional(),component:vh(X(),ih()).optional(),components:ch(ih()).optional(),data:vh(X(),ih()).optional()}),EphemeralCard:Z({draft_id:X(),draft_version:Qm().int().positive(),definition:Z({name:X()})}),CardDefinitionSaved:Z({name:X(),path:X()}),A2UISurfaceDataUpdated:Z({surface_id:X(),data:vh(X(),ih()).optional()}),A2UIActionSubmitted:Z({surface_id:X()}),A2UIMessageEvent:Z({message:vh(X(),ih())}),Attachment:Z({path:X(),name:X().optional()}),InquiryRaised:Z({inquiry_id:X(),question:X(),detail:X().optional(),options:ch(X()).optional(),kind:X().optional()}),InquiryAnswered:Z({inquiry_id:X(),answer:X().optional(),status:X().optional()}),TurnCancelled:Z({reason:X().optional()}),TurnFailed:Z({error:X().optional()}),FeedbackGiven:Z({target_kind:bh([`message`,`image`,`deliverable`]),target_id:X(),sentiment:X().optional(),reason:X().optional()})},qh=Z({type:X(),data:vh(X(),ih()).default({})}),Jh=Z({created_at:Qm().optional()}),Yh=`ModelRequest.DrainedModelRequest.ModelMessageChunk.ModelResponse.ToolCallsEvent.TaskCreated.TaskScheduled.TaskStarted.TaskCompleted.TaskFailed.TaskCancelled.SubagentTrace.ObserverAlert.DeliverableProduced.ImageGenerated.A2UISurface.EphemeralCard.CardDefinitionSaved.A2UISurfaceDataUpdated.A2UIActionSubmitted.A2UIMessageEvent.Attachment.InquiryRaised.InquiryAnswered.TurnCancelled.TurnFailed.FeedbackGiven.FeedbackCleared`.split(`.`),Xh=Z({event:qh}),Zh=Z({type:Sh(`ready`),chat:X().optional()}),Qh=Z({type:Sh(`turn_end`),chat:X().optional(),role:X().optional()}),$h=Z({type:Sh(`queued`),text:X().optional(),chat:X().optional()}),eg=Z({type:Sh(`error`),message:X().optional(),chat:X().optional()}),tg=fh([Xh,mh(`type`,[Zh,Qh,$h,eg])]),ng=fh([Xh,mh(`type`,[Zh,Z({type:Sh(`transcript`),role:bh([`user`,`agent`]),text:X(),final:nh().optional()}),Qh,eg])]);function rg(e){let t;try{t=JSON.parse(e)}catch{return null}let n=tg.safeParse(t);return n.success?n.data:null}var ig=class{chatId;onEvent;onReady;onQueued;onOpen;onTurnEnd;onError;ws;_closed;_queue;constructor(e,{onEvent:t,onReady:n,onOpen:r,onTurnEnd:i,onQueued:a,onError:o}={}){this.chatId=e,this.onEvent=t||(()=>{}),this.onReady=n||(()=>{}),this.onQueued=a||(()=>{}),this.onOpen=r||(()=>{}),this.onTurnEnd=i||(()=>{}),this.onError=o||(()=>{}),this.ws=null,this._closed=!1,this._queue=[]}connect(){let e=`${location.protocol===`https:`?`wss`:`ws`}://${location.host}${ys(`/stream?chat=`+encodeURIComponent(this.chatId))}`;return this.ws=new WebSocket(e),this.ws.onopen=()=>{this.onOpen();let e=this._queue;this._queue=[],e.forEach(e=>this._raw(e))},this.ws.onmessage=e=>{let t=rg(String(e.data));if(t){if(`event`in t){this.onEvent(t.event);return}switch(t.type){case`ready`:this.onReady(t);break;case`turn_end`:this.onTurnEnd(t);break;case`queued`:this.onQueued(t);break;case`error`:this.onError(t)}}},this.ws.onclose=e=>{if(!this._closed){if(e&&(e.code===4001||e.code===4404||e.code===4410)){this._closed=!0,ws(`ws `+e.code);return}setTimeout(()=>this.connect(),1500)}},this}_raw(e){try{this.ws?.send(JSON.stringify(e))}catch{}}_send(e){this.ws&&this.ws.readyState===WebSocket.OPEN?this._raw(e):this._queue.push(e)}send(e,t,n=``){this._send(n?{text:e,attachments:t,model:n}:{text:e,attachments:t})}cancel(){this._send({type:`cancel`})}answer(e,t){this._send({type:`answer`,id:e,answer:t})}feedback(e){this._send({type:`feedback`,...e})}clearFeedback(e){this._send({type:`feedback_clear`,...e})}a2ui(e,t){this._send(t?{type:`a2ui`,message:e,state:t}:{type:`a2ui`,message:e})}close(){this._closed=!0;try{this.ws?.close()}catch{}}},ag=` class PCM16 extends AudioWorkletProcessor { process(inputs) { const ch = inputs[0][0] @@ -60,27 +60,27 @@ class PCM16 extends AudioWorkletProcessor { return true } } -registerProcessor('pcm16', PCM16)`,og=class{query;h;inputRate;ws;micCtx;micNode;micStream;playCtx;playHead;constructor(e,t={},n=16e3){this.query=e,this.h=t,this.inputRate=n,this.ws=null,this.micCtx=null,this.micNode=null,this.micStream=null,this.playCtx=null,this.playHead=0}async start(){try{this.micStream=await navigator.mediaDevices.getUserMedia({audio:{channelCount:1,echoCancellation:!0,noiseSuppression:!0}})}catch{return this.h.onState&&this.h.onState(`error`,`Mic permission denied`),!1}this.h.onState&&this.h.onState(`connecting`,`Connecting…`);let e=location.protocol===`https:`?`wss`:`ws`;this.ws=new WebSocket(`${e}://${location.host}${ys(`/voice`+this.query)}`),this.ws.binaryType=`arraybuffer`,this.ws.onmessage=e=>this._onMessage(e),this.ws.onclose=()=>this.stop(!1),this.ws.onerror=()=>this.h.onState&&this.h.onState(`error`,`Voice connection error`);let t=window.AudioContext||window.webkitAudioContext;if(!t)return this.h.onState&&this.h.onState(`error`,`Audio is unavailable in this browser`),!1;this.micCtx=new t({sampleRate:this.inputRate}),await this.micCtx.audioWorklet.addModule(URL.createObjectURL(new Blob([ag],{type:`application/javascript`})));let n=this.micCtx.createMediaStreamSource(this.micStream);return this.micNode=new AudioWorkletNode(this.micCtx,`pcm16`),this.micNode.port.onmessage=e=>{this.ws&&this.ws.readyState===WebSocket.OPEN&&this.ws.send(e.data)},n.connect(this.micNode),this.playCtx=new t({sampleRate:24e3}),this.playHead=0,!0}_onMessage(e){if(typeof e.data==`string`){let t;try{t=JSON.parse(e.data)}catch{return}let n=ng.safeParse(t);if(!n.success)return;let r=n.data;if(`event`in r){this.h.onEvent&&this.h.onEvent(r.event);return}switch(r.type){case`ready`:this.h.onState&&this.h.onState(`listening`,`Listening…`);break;case`transcript`:this.h.onTranscript&&this.h.onTranscript(r.role,r.text,!!r.final);break;case`turn_end`:this.h.onTurnEnd&&this.h.onTurnEnd(r.role);break;case`error`:this.h.onState&&this.h.onState(`error`,`Voice error: `+(r.message||``))}return}this.h.onAudio&&this.h.onAudio(),this._play(new Int16Array(e.data))}_play(e){if(!this.playCtx)return;let t=new Float32Array(e.length);for(let n=0;ne.stop()),null),this.micCtx&&=(this.micCtx.close().catch(()=>{}),null),this.playCtx&&=(this.playCtx.close().catch(()=>{}),null),e&&this.ws)try{this.ws.close()}catch{}this.ws=null,this.h.onState&&this.h.onState(`off`,`off`)}},sg=class extends Error{label;issues;constructor(e,t){let n=t.issues.map(e=>`${e.path.join(`.`)||``}: ${e.message}`);super(`${e} — ${n.join(`; `)}`),this.name=`SchemaError`,this.label=e,this.issues=t.issues}},cg=`warn`;function lg(e,t,n){let r=e.safeParse(t);if(r.success)return r.data;if(cg===`throw`)throw new sg(n,r.error);return console.warn(`[schema] ${n}`,r.error.issues),t}var ug=class extends Error{status;body;constructor(e,t,n){super(e),this.name=`ApiError`,this.status=t,this.body=n}};function dg(e,t){return e===410||e===404&&t.startsWith(`/api/p/`)}async function fg(e,t,n){if(dg(e.status,n))throw ws(`fetch `+e.status),new ug(`${t} ${n} -> ${e.status}`,e.status,null);if(!e.ok){let r=`${t} ${n} -> ${e.status}`,i=null;try{i=await e.json();let t=i?.error;t&&(r=String(t))}catch{}throw new ug(r,e.status,i)}return e.json()}async function pg(e,t,n,r){return lg(n,await fg(await fetch(t,{method:e,headers:r===void 0?void 0:{"Content-Type":`application/json`},body:r===void 0?void 0:JSON.stringify(r)}),e,t),`${e} ${t}`)}function mg(e,t){return pg(`GET`,e,t)}function hg(e,t,n){return pg(`POST`,e,n,t)}function gg(e,t,n){return pg(`PATCH`,e,n,t)}function _g(e,t,n){return pg(`DELETE`,e,t,n)}async function vg(e,t,n){return lg(n,await fg(await fetch(e,{method:`POST`,body:t}),`POST`,e),`POST ${e}`)}var yg=Z({id:X(),name:X(),profile:X(),port:Qm().nullable(),running:nh(),error:X().nullable(),has_token:nh()}),bg=Z({listeners:ch(yg)}),xg=Z({listener:yg,token:X()}),Sg=Z({listener:yg,token:X()}),Cg=Z({ok:nh()});Z({error:X()});var wg=bh([`read`,`read_write`]),Tg=bh([`read`,`read_write`,`none`]),Eg=Z({id:X(),name:X(),hint:X()}),Dg=Z({env:X(),set:nh(),hint:X()}),Og=(e,t=``)=>xs(`/acp/listeners/`+encodeURIComponent(e)+t),kg={acpListeners:()=>mg(xs(`/acp/listeners`),bg).then(e=>e.listeners),createAcpListener:(e,t,n=``,r=``)=>hg(xs(`/acp/listeners`),{profile:e,port:t,name:n,token:r},xg),deleteAcpListener:e=>_g(Og(e),Cg),stopAcpListener:e=>hg(Og(e,`/stop`),void 0,yg),startAcpListener:e=>hg(Og(e,`/start`),void 0,yg),rotateAcpListenerToken:e=>hg(Og(e,`/rotate-token`),void 0,Sg)},Ag=Z({id:X(),name:X(),provider:X(),default:nh(),hint:X(),used_by:ch(X()).default([])}),jg=Z({secrets:ch(Ag)}),Mg=Z({ok:Sh(!0),secret:Ag}),Ng=Z({ok:Sh(!1),error:X(),existing:Ag});Z({status:X(),model:X().optional(),memory:nh().optional(),platform:X().optional(),chats:Qm().optional(),profiles:Qm().optional()});var Pg=Z({prompt:Qm(),completion:Qm(),total:Qm(),cost:Qm(),priced:nh()}),Fg=Pg.extend({date:X(),by_model:vh(X(),Pg)}),Ig=Z({profiles:ch(Fg.extend({pid:X(),name:X()})),total:Pg}),Lg=ch(Z({pid:X(),busy:nh(),running_tasks:Qm(),unseen_done:Qm()})),Rg=Z({configured:nh(),signed_in:nh(),email:X().nullable(),libs_available:nh(),install_hint:X().nullable()}),zg=Z({signed_in:nh(),source:X().nullable(),account_id:X().nullable(),expires_at:Qm().nullable()}),Bg=Z({ok:Sh(!0),auth_url:X(),state:X()}),Vg=fh([Z({ok:Sh(!0),auth_url:X()}),Z({ok:Sh(!1),error:X()})]),Hg=Z({name:X(),label:X(),available:nh()}),Ug=Z({mode:bh([`local`,`bridge`]),bridge:X().nullable(),connected:nh(),error:X().optional(),agents:ch(Hg)}),Wg=Z({id:X(),name:X(),description:X()}),Gg=Z({models:ch(Wg),current:X(),reason:bh([``,`adapter_missing`,`bridge`,`probe_failed`])}),Kg=fh([Z({ok:Sh(!0),path:X(),parent:X().nullable(),dirs:ch(Z({name:X(),path:X()}))}),Z({ok:Sh(!1),error:X()})]),qg=Z({ok:Sh(!0),path:X()}),Jg=Z({ok:nh(),seeded:nh(),reason:X().optional()}),Yg=fh([Z({ok:Sh(!0)}),Z({ok:Sh(!1),error:X()})]),Xg=Z({ok:nh(),extra:X(),install:X()}),Zg=bh([`secret`,`shared`,`not_needed`,`none`,`subscription`,`cli_login`]),Qg=Z({id:X(),kind:bh([`choice`,`int`,`float`]),choices:ch(X()),minimum:Qm().nullable(),maximum:Qm().nullable()}),$g=Z({id:X(),kind:bh([`int`,`domains`])}),e_=Z({id:X(),name:X(),type:X(),model:X(),base_url:X(),host:X(),options:vh(X(),ih()),builtin_tools:vh(X(),vh(X(),ih())),params:vh(X(),ih()),secret_id:X(),secret:Eg.nullable(),secret_missing:nh(),key_source:Zg,images:nh(),deps:Xg,shared_key:Dg,active:nh(),signed_in:nh().optional()}),t_=Z({provider:X().optional(),model:X().optional()}),n_=Z({configs:ch(e_),active:X().nullable(),env_override:t_.nullable(),provider_deps:vh(X(),Xg),builtin_tools_by_type:vh(X(),ch(X())),builtin_options_by_type:vh(X(),vh(X(),ch($g))),params_by_type:vh(X(),ch(Qg))}),r_=Z({models:ch(Wg),current:X(),reason:bh([``,`unauthorized`,`unreachable`,`no_list_endpoint`,`not_probeable`])}),i_=Z({ok:Sh(!0),config:e_,active:X().nullable()}),a_=bh([`secret`,`shared`,`none`]),o_=Z({id:X(),name:X(),provider:X(),model:X(),voice:X(),secret_id:X(),secret:Eg.nullable(),secret_missing:nh(),key_source:a_,shared_key:Dg,active:nh()}),s_=Z({name:X(),default_model:X(),default_voice:X()}),c_=Z({configs:ch(o_),active:X().nullable(),providers:ch(s_)}),l_=Z({ok:Sh(!0),config:o_,active:X().nullable()}),u_=Z({ok:Sh(!0),reply:X(),latency_ms:Qm()}),d_=Z({id:X(),name:X(),accent:X(),workspace:X(),created:X()}),f_=Z({profiles:ch(d_),archived:ch(d_),active_default:X().nullable(),onboarded:nh(),version:X(),ag2_version:X()}),p_=Z({profile:d_}),m_=bh([`running`,`needs_input`,`completed`,`failed`,`cancelled`]),h_=X(),g_=Z({id:X(),task_id:X(),status:m_,trigger:h_,started_at:X().nullable(),ended_at:X().nullable(),summary:X().nullable(),error:X(),seen:nh()}),__=uh({kind:bh([`manual`,`once`,`cron`]),at:X().nullish(),cron:X().nullish()}),v_=Z({id:X(),name:X(),prompt:X(),model:X().nullable(),description:X(),schedule:__,schedule_desc:X(),paused:nh(),starred:nh(),recall_depth:Qm().default(0),next_run_at:X().nullable(),created_at:X(),updated_at:X(),last_run:g_.nullable(),unread:Qm(),needs_input:nh()}),y_=v_.extend({runs:ch(g_)}),b_=Z({tasks:ch(v_)}),x_=Z({task:y_}),S_=Z({run:g_.extend({task_name:X()})});Z({runs:ch(g_)});var C_=Z({pending:ch(Z({id:X(),task_id:X(),chat:X(),kind:X(),text:X(),detail:X(),options:ch(X()),created_at:X(),root_id:X().nullable(),task_title:X(),run_id:X().nullable()}))}),w_=Z({pending:ch(Z({id:X(),text:X(),detail:X().nullable(),options:ch(X()).nullable(),kind:X(),path:X()}))}),T_=Z({task:v_}),E_=Z({role:bh([`user`,`agent`]),text:X()}),D_=Z({chats:ch(Z({chat_id:X(),updated:X(),title:X(),starred:nh(),preview:X(),turns:Qm(),origin_platform:X().optional(),origin_name:X().optional(),origin_live:nh().optional()}))}),O_=Z({chat_id:X(),messages:ch(E_),model:X(),effective_model:X(),origin_platform:X().optional(),origin_name:X().optional(),origin_live:nh().optional()});Z({reply:X(),chat_id:X()});var k_=bh([`bundled`,`global`,`profile`]),A_=Z({name:X(),description:X(),origin:k_,enabled:nh()}),j_=A_.extend({suppressed:nh(),available:nh()}),M_=Z({skills:ch(A_)}),N_=Z({skills:ch(j_)}),P_=Z({results:ch(Z({name:X(),install_id:X(),description:X(),installs:Qm()}))}),F_=Z({name:X(),description:X()}),I_=Z({skills:ch(F_)}),L_=Z({ok:Sh(!0),installed:ch(F_),skills:ch(A_)}),R_=Z({ok:Sh(!0),installed:ch(F_),skills:ch(j_)}),z_=Z({ok:Sh(!0),skills:ch(A_)}),B_=Z({ok:Sh(!0),skills:ch(j_)}),V_=Z({profile:X(),chat_id:X(),task_id:X(),mode:Tg}),H_=Z({id:X(),name:X(),path:X(),exists:nh(),grants:ch(V_)}),U_=Z({folders:ch(H_)}),W_=Z({ok:Sh(!0),folder:H_,folders:ch(H_)}),G_=Z({error:X(),existing:H_}),K_=Z({ok:Sh(!0),folders:ch(H_)}),q_=Z({roots:ch(Z({id:X(),name:X(),path:X(),mode:wg,exists:nh()}))}),J_=Z({commands:ch(X())}),Y_=Z({ok:Sh(!0),commands:ch(X())}),X_=Z({rules:ch(X())}),Z_=Z({path:X(),name:X(),dir:X(),size:Qm(),modified:X()}),Q_=Z({root:X(),files:ch(Z_),dirs:ch(X())}),$_=Z({path:X(),dirs:ch(Z({name:X(),path:X()})),files:ch(Z({name:X(),path:X(),size:Qm()})),mode:wg});fh([Q_,$_]);var ev=Z({results:ch(Z({path:X(),name:X(),dir:X(),kind:bh([`file`,`directory`])}))}),tv=Z({threads:ch(mh(`kind`,[Z({stream_id:X(),kind:Sh(`chat`),title:X(),updated:X()}),Z({stream_id:X(),kind:Sh(`run`),title:X(),updated:X(),task_id:X(),task_name:X(),run_started_at:X()})]))}),nv=Z({ok:Sh(!0),saved:ch(X())}),rv=Z({ok:Sh(!0),path:X()});Z({ok:Sh(!0),etag:X()});var iv=Z({name:X(),enabled:nh(),command:X(),args:ch(X()),cwd:X().nullable(),allowed_tools:ch(X()),blocked_tools:ch(X()),env_keys:ch(X()).default([])}),av=Z({home:X(),cwd:X(),workspace:X()}),ov=fh([Z({ok:Sh(!0),tools:ch(X())}),Z({ok:Sh(!1),error:X()})]),sv=Z({set:nh(),hint:X().optional(),base_url:X().optional()}),cv=Z({keys:vh(X(),sv),voice_available:vh(X(),nh()),assistant:Z({provider:X(),model:X()}),llm_override:X().nullable(),llm_active:X().nullable(),live_override:X().nullable(),live_active:X().nullable(),codex:Z({signed_in:nh(),source:X().nullable(),account_id:X().nullable(),expires_at:Qm().nullable()}),voice_provider:X(),mcp_servers:ch(iv),focuses:ch(X()),reply_timeout_s:Qm(),fs:av}),lv=bh([`ok`,`warn`,`down`,`off`]),uv=Z({overall:lv,checks:ch(Z({id:X(),label:X(),state:lv,detail:X(),servers:ch(Z({name:X(),enabled:nh()})).optional(),items:ch(Z({connection:X(),name:X(),platform:X(),active:nh(),error:X().nullable()})).optional()}))}),dv=Z({voices:ch(Z({name:X(),style:X()})),current:X().nullable(),provider:X(),input_rate:Qm()}),fv=Z({text:X()}),pv=Z({ok:Sh(!0),voice:X()}),mv=Z({ok:Sh(!0),focuses:ch(X())}),hv=Z({ok:Sh(!0),llm_override:X().nullable()}),gv=Z({ok:Sh(!0),live_override:X().nullable()}),_v=Z({ok:Sh(!0),reply_timeout_s:Qm()}),vv=Z({ok:Sh(!0),server:iv,mcp_servers:ch(iv)}),yv=Z({ok:Sh(!0),mcp_servers:ch(iv)}),bv=Z({set:nh(),hint:X()}),xv=Z({id:X(),platform:X(),name:X(),tokens:vh(X(),bv),default_profile:X().nullable(),active:nh(),error:X().nullable(),paired_accounts:Qm()}),Sv=Z({connections:ch(xv)}),Cv=Z({surfaces:ch(Z({kind:X(),id:X()})),exposure:vh(X(),vh(X(),nh())),default_profile:X().nullable()}),wv=Z({key:X(),account_id:X().nullable(),handle:X().nullable(),pending:nh()}),Tv=Z({code:X(),expires_at:Qm()}),Ev=Z({accounts:ch(wv),code:Tv.nullable()}),Dv=Tv.nullable(),Ov=Z({groups:ch(Z({chat_id:X(),profile:X().nullable()})),profiles:ch(Z({id:X(),name:X()}))}),kv={chats:()=>mg(ys(`/chats`),D_).then(e=>e.chats),chat:e=>mg(ys(`/chats/`+encodeURIComponent(e)),O_),deleteChat:e=>_g(ys(`/chats/`+encodeURIComponent(e)),Cg),updateChat:(e,t)=>gg(ys(`/chats/`+encodeURIComponent(e)),t,Cg),closeAcpSession:e=>hg(ys(`/chats/`+encodeURIComponent(e)+`/acp/close`),void 0,Cg)},Av={codingAgents:()=>mg(xs(`/coding/agents`),Ug),codingModels:(e,t=!1)=>mg(xs(`/coding/${e}/models${t?`?refresh=1`:``}`),Gg)},jv=(e,t=``)=>xs(`/connections/`+encodeURIComponent(e)+t),Mv={connections:()=>mg(xs(`/connections`),Sv).then(e=>e.connections),createConnection:(e,t,n)=>hg(xs(`/connections`),{platform:e,name:t,tokens:n},xv),renameConnection:(e,t)=>hg(jv(e),{name:t},xv),replaceConnectionTokens:(e,t)=>hg(jv(e,`/token`),{tokens:t},xv),deleteConnection:e=>_g(jv(e),Cg),connectionDefault:(e,t)=>hg(jv(e,`/default`),{profile:t},xv),connectionExposure:e=>mg(jv(e,`/exposure`),Cv),setConnectionExposure:(e,t,n,r)=>hg(jv(e,`/exposure`),{profile:t,surface:n,exposed:r},Cv),connectionPairing:e=>mg(jv(e,`/pairing`),Ev),connectionPair:(e,t)=>hg(jv(e,`/pairing`),{value:t},Ev),connectionUnpair:(e,t)=>_g(jv(e,`/pairing/`+encodeURIComponent(t)),Ev),connectionPairingCode:e=>hg(jv(e,`/pairing/code`),void 0,Dv),connectionGroups:e=>mg(jv(e,`/groups`),Ov),connectionGroupProfile:(e,t,n)=>hg(jv(e,`/groups/`+encodeURIComponent(t)+`/profile`),{profile:n},Ov)};function Nv(e){if(!e)return null;let t=String(e).trim();return t.startsWith(`W/`)&&(t=t.slice(2)),t.replace(/^"|"$/g,``)}function Pv(e){return Iv(e).status===409}function Fv(e){let t=Iv(e),n=Lv(t.body);if(n)return n;let r=t.status;return r===404?`This file no longer exists on disk.`:r===400?`Could not save — the file path is invalid.`:r===413?`Could not save — the file is too large.`:!r&&t.message?t.message:`Could not save the file.`}function Iv(e){if(!e||typeof e!=`object`)return{};let t=e;return{status:typeof t.status==`number`?t.status:void 0,body:t.body,message:typeof t.message==`string`?t.message:void 0}}function Lv(e){if(!e||typeof e!=`object`)return``;let t=e.error;return typeof t==`string`?t:``}function Rv(e){let t=String(e??``);return t.startsWith(`/`)||t.startsWith(`~`)}function zv(e){let t=e===`read_write`;return{edit:t,rename:t,delete:t,move:t}}function Bv(e){return e===`read_write`?`read+write`:e===`read`?`read`:``}function Vv(e,t){let n=String(e??``).replace(/\/+$/,``),r=String(t??``);if(!n||!r.startsWith(n+`/`))return[];let i=r.slice(n.length+1).split(`/`);i.pop();let a=[n],o=n;for(let e of i)e&&(o=o+`/`+e,a.push(o));return a}function Hv(e,{download:t=!1,chatId:n=``}={}){let r=[`path=`+encodeURIComponent(String(e??``))];return t&&r.push(`download=true`),Rv(e)&&n&&r.push(`chat_id=`+encodeURIComponent(n)),r.join(`&`)}var Uv={files:()=>mg(ys(`/files`),Q_),folderRoots:(e=``)=>mg(ys(`/folders/roots`+(e?`?chat_id=`+encodeURIComponent(e):``)),q_),folderList:(e,t=``)=>mg(ys(`/files?path=`+encodeURIComponent(e)+(t?`&chat_id=`+encodeURIComponent(t):``)),$_),searchFiles:(e,t=``)=>mg(ys(`/files/search?q=`+encodeURIComponent(e)+(t?`&chat_id=`+encodeURIComponent(t):``)),ev),fileMentions:(e,t=``)=>mg(ys(`/files/mentions?path=`+encodeURIComponent(e)+(t?`&chat_id=`+encodeURIComponent(t):``)),tv),fileUrl:(e,t=!1,n=``)=>ys(`/files/raw?`+Hv(e,{download:t,chatId:n})),fileText:async(e,t=``)=>{let n=await fetch(ys(`/files/raw?`+Hv(e,{chatId:t})));if(!n.ok)throw Error(`file not found`);return n.text()},fileTextWithEtag:async(e,t=``)=>{let n=await fetch(ys(`/files/raw?`+Hv(e,{chatId:t})));if(!n.ok)throw Error(`file not found`);return{text:await n.text(),etag:Nv(n.headers.get(`ETag`)),mode:n.headers.get(`X-File-Mode`)||``}},saveFile:async(e,t,n,r=``)=>{let i=await fetch(ys(`/files/raw?`+Hv(e,{chatId:r})),{method:`PUT`,headers:{"Content-Type":`text/plain; charset=utf-8`,...n?{"If-Match":`"${n}"`}:{}},body:t});if(!i.ok){let e=null;try{e=await i.json()}catch{}let t=e?.error;throw new ug(t||`save failed (${i.status})`,i.status,e)}return(await i.json().catch(()=>({}))).etag||Nv(i.headers.get(`ETag`))},deleteFile:(e,t=``)=>_g(ys(`/files/raw?`+Hv(e,{chatId:t})),Cg),uploadFiles:async(e,t=``,n=``)=>{let r=new FormData;for(let t of e)r.append(`files`,t,t.name);r.append(`dir`,t),n&&r.append(`chat_id`,n);let i=await fetch(ys(`/files/upload`),{method:`POST`,body:r});if(!i.ok){let e=`upload failed (`+i.status+`)`;try{let t=await i.json();t&&t.error&&(e=t.error)}catch{}throw Error(e)}return lg(nv,await i.json(),`POST /files/upload`)},mkdir:(e,t=``)=>hg(ys(`/files/mkdir`),{path:e,chat_id:t},rv),moveFile:(e,t,n=``)=>hg(ys(`/files/move`),{from:e,to:t,chat_id:n},Cg)},Wv={folders:()=>mg(xs(`/folders`),U_),createFolder:(e,t=``)=>hg(xs(`/folders`),{path:e,name:t},W_),updateFolder:(e,t)=>hg(xs(`/folders/`+encodeURIComponent(e)),t,W_),deleteFolder:e=>_g(xs(`/folders/`+encodeURIComponent(e)),K_),setGrant:(e,t,n,r=``,i=``)=>hg(xs(`/folders/`+encodeURIComponent(e)+`/grants`),{profile:t,chat_id:r,task_id:i,mode:n},K_),revokeGrant:(e,t,n=``,r=``)=>_g(xs(`/folders/`+encodeURIComponent(e)+`/grants`),K_,{profile:t,chat_id:n,task_id:r})},Gv={llmConfigs:()=>mg(xs(`/llm-configs`),n_),saveLlmConfig:e=>{let{id:t,...n}=e;return hg(xs(`/llm-configs`+(t?`/`+encodeURIComponent(t):``)),n,i_)},deleteLlmConfig:e=>_g(xs(`/llm-configs/`+encodeURIComponent(e)),Cg),useLlmConfig:e=>hg(xs(`/llm-configs/`+encodeURIComponent(e)+`/use`),void 0,Cg),testLlmConfig:e=>hg(xs(`/llm-configs/`+encodeURIComponent(e)+`/test`),void 0,u_),testLlmConfigDraft:e=>hg(xs(`/llm-configs/test`),e,u_),llmCatalog:(e,t=!1)=>{let n=new URLSearchParams({type:e.type});return e.base_url&&n.set(`base_url`,e.base_url),e.host&&n.set(`host`,e.host),e.secret_id&&n.set(`secret_id`,e.secret_id),t&&n.set(`refresh`,`1`),mg(xs(`/llm-configs/models?${n}`),r_)},liveConfigs:()=>mg(xs(`/live-configs`),c_),saveLiveConfig:e=>{let{id:t,...n}=e;return hg(xs(`/live-configs`+(t?`/`+encodeURIComponent(t):``)),n,l_)},deleteLiveConfig:e=>_g(xs(`/live-configs/`+encodeURIComponent(e)),Cg),useLiveConfig:e=>hg(xs(`/live-configs/`+encodeURIComponent(e)+`/use`),void 0,Cg),testLiveConfig:e=>hg(xs(`/live-configs/`+encodeURIComponent(e)+`/test`),void 0,u_),testLiveConfigDraft:e=>hg(xs(`/live-configs/test`),e,u_)},Kv={permissions:()=>mg(xs(`/permissions`),J_),grantCommand:(e,t)=>hg(xs(`/permissions/commands`),{tool:e,prefix:t},Y_),revokeCommand:e=>_g(xs(`/permissions/commands`),Y_,{rule:e})};function qv(e,t){let n=new FormData;return n.append(`file`,e),t!==void 0&&n.append(`names`,Array.isArray(t)?t.join(`,`):String(t)),n}var Jv={skills:()=>mg(xs(`/skills`),M_),setSkillState:(e,t)=>hg(xs(`/skills/`+encodeURIComponent(e)+`/state`),{enabled:t},z_),deleteSkill:e=>_g(xs(`/skills/`+encodeURIComponent(e)),z_),searchSkills:(e,t=10)=>hg(xs(`/skills/search`),{query:e,limit:t},P_),installSkill:e=>hg(xs(`/skills/install`),e,L_),discoverSkills:e=>hg(xs(`/skills/discover`),{git_url:e},I_),discoverSkillsUpload:e=>vg(xs(`/skills/discover-upload`),qv(e),I_),installSkillUpload:(e,t)=>vg(xs(`/skills/install-upload`),qv(e,t),L_)},Yv={profileSkills:()=>mg(ys(`/skills`),N_),suppressSkill:(e,t)=>t?hg(ys(`/skills/`+encodeURIComponent(e)+`/suppress`),void 0,B_):_g(ys(`/skills/`+encodeURIComponent(e)+`/suppress`),B_),setProfileSkillState:(e,t)=>hg(ys(`/skills/`+encodeURIComponent(e)+`/state`),{enabled:t},B_),deleteProfileSkill:e=>_g(ys(`/skills/`+encodeURIComponent(e)),B_),installProfileSkill:e=>hg(ys(`/skills/install`),e,R_),discoverProfileSkills:e=>hg(ys(`/skills/discover`),{git_url:e},I_),discoverProfileSkillsUpload:e=>vg(ys(`/skills/discover-upload`),qv(e),I_),installProfileSkillUpload:(e,t)=>vg(ys(`/skills/install-upload`),qv(e,t),R_)},Xv={profiles:()=>mg(xs(`/profiles`),f_),createProfile:(e,t)=>hg(xs(`/profiles`),{name:e,accent:t},p_),updateProfile:(e,t)=>hg(xs(`/profiles/`+encodeURIComponent(e)),t,p_),archiveProfile:(e,t)=>_g(xs(`/profiles/`+encodeURIComponent(e)),Cg,t?{new_default:t}:{}),restoreProfile:e=>hg(xs(`/profiles/`+encodeURIComponent(e)+`/restore`),void 0,p_),deleteProfile:e=>_g(xs(`/profiles/`+encodeURIComponent(e)+`?purge=true`),Cg)},Zv={setKey:(e,t)=>hg(xs(`/secrets/key`),{provider:e,value:t},Cg),secrets:()=>mg(xs(`/secrets`),jg),createSecret:e=>hg(xs(`/secrets`),e,Mg),updateSecret:(e,t)=>hg(xs(`/secrets/`+encodeURIComponent(e)),t,Mg),deleteSecret:e=>_g(xs(`/secrets/`+encodeURIComponent(e)),Cg)},Qv={health:()=>mg(ys(`/health`),uv),voices:e=>mg(ys(`/voice/voices`+(e?`?config_id=`+encodeURIComponent(e):``)),dv),settings:()=>mg(ys(`/settings`),cv),setFocuses:e=>hg(ys(`/settings/focuses`),{focuses:e},mv),setLlmOverride:(e=``)=>hg(ys(`/settings/llm-override`),{config_id:e},hv),setLiveOverride:(e=``)=>hg(ys(`/settings/live-override`),{config_id:e},gv),setReplyTimeout:e=>hg(ys(`/settings/reply-timeout`),{reply_timeout_s:e},_v),setVoiceProvider:e=>hg(ys(`/settings/voice_provider`),{provider:e},Cg),addMcpServer:e=>hg(ys(`/settings/mcp`),e,vv),deleteMcpServer:e=>_g(ys(`/settings/mcp/${encodeURIComponent(e)}`),yv),healthMcpServer:e=>hg(ys(`/settings/mcp/${encodeURIComponent(e)}/health`),void 0,ov),getMemory:()=>mg(ys(`/memory`),fv),setMemory:e=>hg(ys(`/memory`),{text:e},Cg),usage:()=>mg(ys(`/usage`),Fg),selectVoice:(e,t)=>hg(ys(`/voice/select`),{voice:e,config_id:t||null},pv),previewVoice:async(e,t)=>{let n=await fetch(ys(`/voice/preview`),{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({voice:e,config_id:t||null})});if(!n.ok)throw Error(`preview failed (`+n.status+`)`);return n.blob()},forProfile:e=>({settings:()=>mg(bs(e,`/settings`),cv),setFocuses:t=>hg(bs(e,`/settings/focuses`),{focuses:t},mv)})},$v={status:()=>mg(xs(`/status`),Lg),usageAll:()=>mg(xs(`/usage`),Ig),setOnboarded:(e=!0)=>hg(xs(`/onboarded`),{value:e},Cg),listDirs:(e=``)=>mg(xs(`/fs/list?path=`+encodeURIComponent(e)),Kg),makeDir:(e,t)=>hg(xs(`/fs/mkdir`),{path:e,name:t},qg),googleStatus:()=>mg(xs(`/google/status`),Rg),googleLoginUrl:()=>hg(xs(`/google/login_url`),void 0,Vg),googleCredentials:e=>hg(xs(`/google/credentials`),{content:e},Yg),googleLogout:()=>hg(xs(`/google/logout`),void 0,Cg),codexStatus:()=>mg(xs(`/codex/status`),zg),codexLoginUrl:()=>hg(xs(`/codex/login_url`),void 0,Bg),codexSubmit:(e,t)=>hg(xs(`/codex/submit`),{state:e,code:t},Cg),codexLogout:()=>hg(xs(`/codex/logout`),void 0,Cg),globalMemory:()=>mg(xs(`/memory`),fv),setGlobalMemory:e=>hg(xs(`/memory`),{text:e},Cg),setIdentity:e=>hg(xs(`/identity`),e,Jg)},ey={tasks:()=>mg(ys(`/tasks`),b_).then(e=>e.tasks),createTask:e=>hg(ys(`/tasks`),e,T_).then(e=>e.task),task:e=>mg(ys(`/tasks/`+encodeURIComponent(e)),x_).then(e=>e.task),updateTask:(e,t)=>gg(ys(`/tasks/`+encodeURIComponent(e)),t,x_).then(e=>e.task),deleteTask:e=>_g(ys(`/tasks/`+encodeURIComponent(e)),Cg),runTask:e=>hg(ys(`/tasks/`+encodeURIComponent(e)+`/run`),void 0,S_).then(e=>e.run),taskPermissions:e=>mg(ys(`/tasks/`+encodeURIComponent(e)+`/permissions`),X_).then(e=>e.rules),deleteTaskPermission:(e,t)=>_g(ys(`/tasks/`+encodeURIComponent(e)+`/permissions`),Cg,{rule:t}),run:e=>mg(ys(`/runs/`+encodeURIComponent(e)),S_).then(e=>e.run),stopRun:e=>hg(ys(`/runs/`+encodeURIComponent(e)+`/stop`),void 0,Cg),runSeen:e=>hg(ys(`/runs/`+encodeURIComponent(e)+`/seen`),void 0,Cg),taskRunsSeen:e=>hg(ys(`/tasks/`+encodeURIComponent(e)+`/seen`),void 0,Cg),inquiries:()=>mg(ys(`/inquiries/pending`),C_).then(e=>e.pending),answerInquiry:(e,t)=>hg(ys(`/inquiries/${encodeURIComponent(e)}/answer`),{answer:t},Cg),hitlPending:()=>mg(ys(`/hitl/pending`),w_).then(e=>e.pending),answerHitl:(e,t)=>hg(`/hitl/${encodeURIComponent(e)}/answer`,{answer:t},Cg)},Q={...Xv,...Zv,...Gv,...Wv,...Kv,...Jv,...$v,...Av,...Mv,...kg,...kv,...ey,...Uv,...Qv,...Yv},ty=e=>{if(!e)return{};if(typeof e==`object`)return e;if(typeof e!=`string`)return{};try{return JSON.parse(e)}catch{return{}}},ny=e=>(e||``).split(`/`).pop()||e,ry=[`write_file`,`append_file`,`edit_file`],iy=[`duckduckgo_search`,`gmail_search`,`drive_search`],ay={};for(let e of ry)ay[e]=e=>typeof e.path==`string`&&e.path?{kind:`file`,path:e.path,name:ny(e.path)}:null;for(let e of iy)ay[e]=e=>typeof e.query==`string`&&e.query?{kind:`search`,query:e.query}:null;ay.load_skill=e=>typeof e.name==`string`&&e.name?{kind:`skill`,name:e.name}:null,ay.run_skill_script=e=>typeof e.name==`string`&&e.name?{kind:`skill`,name:e.name,script:typeof e.script==`string`?e.script:``,ran:!0}:null,ay.generate_image=e=>typeof e.prompt==`string`&&e.prompt?{kind:`image`,prompt:e.prompt,edit:!!e.source_image}:null;function oy(e,t){let n=ay[e];return n&&n(ty(t))||null}function sy(e){if(e==null||e===``)return null;let t=typeof e==`number`?new Date(e*1e3):new Date(e);return isNaN(t.getTime())?null:t}function cy(e){let t=sy(e);return t?t.toDateString()===new Date().toDateString()?t.toLocaleTimeString([],{hour:`numeric`,minute:`2-digit`}):t.toLocaleString([],{month:`short`,day:`numeric`,hour:`numeric`,minute:`2-digit`}):``}function ly(e){let t=sy(e);if(!t)return``;let n=Date.now()-t.getTime();if(n<0)return`just now`;let r=Math.round(n/6e4);if(r<1)return`just now`;if(r<60)return`${r}m ago`;let i=Math.round(r/60);if(i<24)return`${i}h ago`;let a=Math.round(i/24);return a===1?`yesterday`:a<7?`${a}d ago`:t.toLocaleDateString([],{month:`short`,day:`numeric`})}function uy(e){let t=sy(e);if(!t)return``;let n=Date.now()-t.getTime(),r=Math.round(n/6e4);if(r<1)return`now`;if(r<60)return`${r}m`;let i=Math.round(r/60);if(i<24)return`${i}h`;let a=Math.round(i/24);return a<7?`${a}d`:t.toLocaleDateString([],{month:`short`,day:`numeric`})}function dy(e){let t=sy(e);if(!t)return``;let n=new Date,r=t.toLocaleTimeString([],{hour:`numeric`,minute:`2-digit`}),i=e=>new Date(e.getFullYear(),e.getMonth(),e.getDate()),a=Math.round((i(t).getTime()-i(n).getTime())/864e5);return a===0?`Today ${r}`:a===1?`Tomorrow ${r}`:a===-1?`Yesterday ${r}`:a>1&&a<7?`${t.toLocaleDateString([],{weekday:`short`})} ${r}`:t.toLocaleString([],{month:`short`,day:`numeric`,hour:`numeric`,minute:`2-digit`})}function fy(e){let t=sy(e);return t?`${t.getFullYear()}-${t.getMonth()}-${t.getDate()}`:null}function py(e){let t=sy(e);if(!t)return``;let n=new Date,r=t.toLocaleTimeString([],{hour:`numeric`,minute:`2-digit`}),i=e=>new Date(e.getFullYear(),e.getMonth(),e.getDate()),a=Math.round((i(t).getTime()-i(n).getTime())/864e5),o;if(a===0)o=`Today`;else if(a===-1)o=`Yesterday`;else{let e={weekday:`short`,month:`short`,day:`numeric`};t.getFullYear()!==n.getFullYear()&&(e.year=`numeric`),o=t.toLocaleDateString([],e)}return`${o} at ${r}`}function my(e){let t=sy(e);if(!t)return``;let n=new Date,r=e=>new Date(e.getFullYear(),e.getMonth(),e.getDate()),i=Math.round((r(t).getTime()-r(n).getTime())/864e5);if(i===0)return`Recent`;if(i===-1)return`Yesterday`;let a={weekday:`short`,month:`short`,day:`numeric`};return t.getFullYear()!==n.getFullYear()&&(a.year=`numeric`),t.toLocaleDateString([],a)}function hy(e,t=py){let n=null;return e.map(e=>{let r=fy(e.at),i=r&&r!==n?t(e.at):null;return r&&(n=r),{item:e,sep:i}})}function gy(e){let t=cy(e),n=ly(e);return t&&n?`${t} · ${n}`:t||n}function _y(e){let t=e.last_run;return t&&(t.ended_at||t.started_at)||e.created_at}function vy(e){let t=sy(e);if(!t)return``;let n=t.getTime()-Date.now();if(n<=0)return`now`;let r=Math.round(n/6e4);if(r<1)return`in <1m`;if(r<60)return`in ${r}m`;let i=Math.round(r/60);if(i<24)return`in ${i}h`;let a=Math.round(i/24);if(a<7)return`in ${a}d`;let o=Math.round(a/7);return o<5?`in ${o}w`:`in ${Math.round(a/30)}mo`}var yy=0;function by(){return++yy}function xy(e){return typeof e==`string`&&/^https?:\/\//i.test(e.trim())?e:null}var Sy=e=>!!e&&typeof e==`object`&&!Array.isArray(e),Cy=0,wy=()=>`a2ui-${Date.now()}-${++Cy}`;function Ty(e){return String(e||``).replace(/^\//,``).split(`/`).filter(Boolean).map(e=>e.replace(/~1/g,`/`).replace(/~0/g,`~`))}function Ey(e,t){if(!e.startsWith(`.`))return e;let n=e.replace(/^\.\/?/,``);return n?`${t}/${n}`:t}function Dy(e,t={},n=``){let r=e;return!e||typeof e!=`object`||Array.isArray(e)||typeof r?.path!=`string`?e:Ty(Ey(r.path,n)).reduce((e,t)=>e?.[t],t)}function Oy(e,t={},n=``){if(Array.isArray(e))return e.filter(e=>typeof e==`string`).map(e=>({id:e,scope:n}));if(!Sy(e))return[];let{componentId:r,path:i}=e;return typeof r!=`string`||typeof i!=`string`?[]:ky({path:i},t,n).map(e=>({id:r,scope:e})).slice(jy(e))}function ky(e,t={},n=``){let r=hb(e,n),i=Dy(e,t,n);return!r||!Array.isArray(i)?[]:i.map((e,t)=>`${r}/${t}`)}function Ay(e,t,n={},r=[],i=``){let a=Dy(t,n,i);return a==null||a===``||!Sy(e)?-1:r.findIndex(t=>Dy(e,n,t)===a)}function jy(e){return Sy(e)?Math.max(0,Math.trunc(Number(e.start)||0)):0}var My=[`neutral`,`muted`,`accent`,`positive`,`negative`];function Ny(e,t){let n=Sy(t)?t[String(e)]:void 0;return n===void 0?e:n}function Py(e,t={},n=``){let r=Dy(e,t,n),i=Sy(e)?Ny(r,e.map):r;if(typeof i==`number`&&Number.isFinite(i))return i>0?`positive`:i<0?`negative`:`neutral`;let a=ub(i);return My.includes(a)?a:`neutral`}function Fy(e,t={},n=``){if(e===void 0)return!0;if(Array.isArray(e))return e.some(e=>Fy(e,t,n));let r=Dy(e,t,n);return r==null||r===``||r===!1?!1:!Array.isArray(r)||r.length>0}var Iy={time:cy,ago:ly,datetime:dy};function Ly(e,t={},n=``){let r=Dy(e.text,t,n),i=Iy[ub(e.format)];if(i)return i(r);let a=Ny(r,e.map);return a==null||a===``?``:String(a)}function Ry(e,t={},n=``){return ub(Ny(Dy(e.name,t,n),e.map))}var zy=[`task`,`chat`,`file`,`folder`,`url`],By=(e,t)=>e!==null&&!e.includes(t);function Vy(e,t={},n=``,r={tasks:null,chats:null}){for(let i of zy){let a=ub(Dy(e[i],t,n));if(a){if(i===`task`)return By(r.tasks,a)?null:{kind:i,value:a};if(i===`chat`)return By(r.chats,a)?null:{kind:i,value:a};if(i===`url`){let e=xy(a);return e?{kind:i,value:e}:null}return{kind:i,value:a}}}return null}function Hy(e){let t=ub(e);return t?t.split(` -`).filter((e,t,n)=>e!==``||t!==n.length-1).map(e=>{let t=e[0],n=e.startsWith(`+++`)||e.startsWith(`---`)?`meta`:t===`@`?`hunk`:t===`+`?`add`:t===`-`?`del`:`ctx`;return{text:e||` `,kind:n}}):[]}function Uy(e,t,n,r=3){let i=(Array.isArray(e)?e:[]).map(Number).filter(Number.isFinite);if(i.length<2)return null;let a=e=>r+e/(i.length-1)*(t-r*2),o=e=>r+(1-Math.max(0,Math.min(100,e))/100)*(n-r*2),s=`M${i.map((e,t)=>`${a(t).toFixed(1)},${o(e).toFixed(1)}`).join(` L`)}`;return{line:s,area:`${s} L${a(i.length-1).toFixed(1)},${(n-r).toFixed(1)} L${a(0).toFixed(1)},${(n-r).toFixed(1)} Z`,endX:a(i.length-1).toFixed(1),endY:o(i[i.length-1]).toFixed(1)}}var Wy=e=>e.toLocaleString(`en-US`,{minimumFractionDigits:2,maximumFractionDigits:2}),Gy=e=>`${e>0?`+`:``}${Wy(e)}`,Ky=e=>typeof e==`number`&&Number.isFinite(e)?e:null;function qy(e,t={},n=``){let r=Dy(e.value,t,n),i=Ky(Dy(e.delta,t,n)),a=Ky(Dy(e.deltaPercent,t,n)),o=a??i,s=[i==null?``:Gy(i),a==null?``:`${Gy(a)}%`].filter(Boolean);return{value:typeof r==`number`?Wy(r):ub(r),unit:ub(Dy(e.unit,t,n)),delta:s.length===2?`${s[0]} (${s[1]})`:s[0]||``,arrow:o==null||o===0?``:o>0?`▲`:`▼`}}function Jy(e,t){return Array.isArray(e)?/^\d+$/.test(t)&&Number(t)`,Qy=``,$y=[`version`,...Xy].flatMap(e=>[`[{"${e}"`,`{"${e}"`]);function eb(e,t){let n=e[t],r=n===`[`?`]`:`}`,i=0,a=!1,o=!1;for(let s=t;sSy(e)&&Xy.some(t=>t in e))}function nb(e){if(Xy.some(t=>e.includes(t)))return!0;let t=e.replace(/\s+/g,``);return $y.some(e=>t.startsWith(e)||e.startsWith(t))}function rb(e){let t=e||``,n=``,r=!1,i=0;for(;i=0&&(o<0||ethis._onMessage(e),this.ws.onclose=()=>this.stop(!1),this.ws.onerror=()=>this.h.onState&&this.h.onState(`error`,`Voice connection error`);let t=window.AudioContext||window.webkitAudioContext;if(!t)return this.h.onState&&this.h.onState(`error`,`Audio is unavailable in this browser`),!1;this.micCtx=new t({sampleRate:this.inputRate}),await this.micCtx.audioWorklet.addModule(URL.createObjectURL(new Blob([ag],{type:`application/javascript`})));let n=this.micCtx.createMediaStreamSource(this.micStream);return this.micNode=new AudioWorkletNode(this.micCtx,`pcm16`),this.micNode.port.onmessage=e=>{this.ws&&this.ws.readyState===WebSocket.OPEN&&this.ws.send(e.data)},n.connect(this.micNode),this.playCtx=new t({sampleRate:24e3}),this.playHead=0,!0}_onMessage(e){if(typeof e.data==`string`){let t;try{t=JSON.parse(e.data)}catch{return}let n=ng.safeParse(t);if(!n.success)return;let r=n.data;if(`event`in r){this.h.onEvent&&this.h.onEvent(r.event);return}switch(r.type){case`ready`:this.h.onState&&this.h.onState(`listening`,`Listening…`);break;case`transcript`:this.h.onTranscript&&this.h.onTranscript(r.role,r.text,!!r.final);break;case`turn_end`:this.h.onTurnEnd&&this.h.onTurnEnd(r.role);break;case`error`:this.h.onState&&this.h.onState(`error`,`Voice error: `+(r.message||``))}return}this.h.onAudio&&this.h.onAudio(),this._play(new Int16Array(e.data))}_play(e){if(!this.playCtx)return;let t=new Float32Array(e.length);for(let n=0;ne.stop()),null),this.micCtx&&=(this.micCtx.close().catch(()=>{}),null),this.playCtx&&=(this.playCtx.close().catch(()=>{}),null),e&&this.ws)try{this.ws.close()}catch{}this.ws=null,this.h.onState&&this.h.onState(`off`,`off`)}},sg=class extends Error{label;issues;constructor(e,t){let n=t.issues.map(e=>`${e.path.join(`.`)||``}: ${e.message}`);super(`${e} — ${n.join(`; `)}`),this.name=`SchemaError`,this.label=e,this.issues=t.issues}},cg=`warn`;function lg(e,t,n){let r=e.safeParse(t);if(r.success)return r.data;if(cg===`throw`)throw new sg(n,r.error);return console.warn(`[schema] ${n}`,r.error.issues),t}var ug=class extends Error{status;body;constructor(e,t,n){super(e),this.name=`ApiError`,this.status=t,this.body=n}};function dg(e,t){return e===410||e===404&&t.startsWith(`/api/p/`)}async function fg(e,t,n){if(dg(e.status,n))throw ws(`fetch `+e.status),new ug(`${t} ${n} -> ${e.status}`,e.status,null);if(!e.ok){let r=`${t} ${n} -> ${e.status}`,i=null;try{i=await e.json();let t=i?.error;t&&(r=String(t))}catch{}throw new ug(r,e.status,i)}return e.json()}async function pg(e,t,n,r){return lg(n,await fg(await fetch(t,{method:e,headers:r===void 0?void 0:{"Content-Type":`application/json`},body:r===void 0?void 0:JSON.stringify(r)}),e,t),`${e} ${t}`)}function mg(e,t){return pg(`GET`,e,t)}function hg(e,t,n){return pg(`POST`,e,n,t)}function gg(e,t,n){return pg(`PATCH`,e,n,t)}function _g(e,t,n){return pg(`DELETE`,e,t,n)}async function vg(e,t,n){return lg(n,await fg(await fetch(e,{method:`POST`,body:t}),`POST`,e),`POST ${e}`)}var yg=Z({id:X(),name:X(),profile:X(),port:Qm().nullable(),running:nh(),error:X().nullable(),has_token:nh()}),bg=Z({listeners:ch(yg)}),xg=Z({listener:yg,token:X()}),Sg=Z({listener:yg,token:X()}),Cg=Z({ok:nh()});Z({error:X()});var wg=bh([`read`,`read_write`]),Tg=bh([`read`,`read_write`,`none`]),Eg=Z({id:X(),name:X(),hint:X()}),Dg=Z({env:X(),set:nh(),hint:X()}),Og=(e,t=``)=>xs(`/acp/listeners/`+encodeURIComponent(e)+t),kg={acpListeners:()=>mg(xs(`/acp/listeners`),bg).then(e=>e.listeners),createAcpListener:(e,t,n=``,r=``)=>hg(xs(`/acp/listeners`),{profile:e,port:t,name:n,token:r},xg),deleteAcpListener:e=>_g(Og(e),Cg),stopAcpListener:e=>hg(Og(e,`/stop`),void 0,yg),startAcpListener:e=>hg(Og(e,`/start`),void 0,yg),rotateAcpListenerToken:e=>hg(Og(e,`/rotate-token`),void 0,Sg)},Ag=Z({id:X(),name:X(),provider:X(),default:nh(),hint:X(),used_by:ch(X()).default([])}),jg=Z({secrets:ch(Ag)}),Mg=Z({ok:Sh(!0),secret:Ag}),Ng=Z({ok:Sh(!1),error:X(),existing:Ag});Z({status:X(),model:X().optional(),memory:nh().optional(),platform:X().optional(),chats:Qm().optional(),profiles:Qm().optional()});var Pg=Z({prompt:Qm(),completion:Qm(),total:Qm(),cost:Qm(),priced:nh()}),Fg=Pg.extend({date:X(),by_model:vh(X(),Pg)}),Ig=Z({profiles:ch(Fg.extend({pid:X(),name:X()})),total:Pg}),Lg=ch(Z({pid:X(),busy:nh(),running_tasks:Qm(),unseen_done:Qm()})),Rg=Z({configured:nh(),signed_in:nh(),email:X().nullable(),libs_available:nh(),install_hint:X().nullable()}),zg=Z({signed_in:nh(),source:X().nullable(),account_id:X().nullable(),expires_at:Qm().nullable()}),Bg=Z({ok:Sh(!0),auth_url:X(),state:X()}),Vg=fh([Z({ok:Sh(!0),auth_url:X()}),Z({ok:Sh(!1),error:X()})]),Hg=Z({name:X(),label:X(),available:nh()}),Ug=Z({mode:bh([`local`,`bridge`]),bridge:X().nullable(),connected:nh(),error:X().optional(),agents:ch(Hg)}),Wg=Z({id:X(),name:X(),description:X()}),Gg=Z({models:ch(Wg),current:X(),reason:bh([``,`adapter_missing`,`bridge`,`probe_failed`])}),Kg=fh([Z({ok:Sh(!0),path:X(),parent:X().nullable(),dirs:ch(Z({name:X(),path:X()}))}),Z({ok:Sh(!1),error:X()})]),qg=Z({ok:Sh(!0),path:X()}),Jg=Z({ok:nh(),seeded:nh(),reason:X().optional()}),Yg=fh([Z({ok:Sh(!0)}),Z({ok:Sh(!1),error:X()})]),Xg=Z({ok:nh(),extra:X(),install:X()}),Zg=bh([`secret`,`shared`,`not_needed`,`none`,`subscription`,`cli_login`]),Qg=Z({id:X(),kind:bh([`choice`,`int`,`float`]),choices:ch(X()),minimum:Qm().nullable(),maximum:Qm().nullable()}),$g=Z({id:X(),kind:bh([`int`,`domains`])}),e_=Z({id:X(),name:X(),type:X(),model:X(),base_url:X(),host:X(),options:vh(X(),ih()),builtin_tools:vh(X(),vh(X(),ih())),params:vh(X(),ih()),secret_id:X(),secret:Eg.nullable(),secret_missing:nh(),key_source:Zg,images:nh(),deps:Xg,shared_key:Dg,active:nh(),signed_in:nh().optional()}),t_=Z({provider:X().optional(),model:X().optional()}),n_=Z({configs:ch(e_),active:X().nullable(),env_override:t_.nullable(),provider_deps:vh(X(),Xg),builtin_tools_by_type:vh(X(),ch(X())),builtin_options_by_type:vh(X(),vh(X(),ch($g))),params_by_type:vh(X(),ch(Qg))}),r_=Z({models:ch(Wg),current:X(),reason:bh([``,`unauthorized`,`unreachable`,`no_list_endpoint`,`not_probeable`])}),i_=Z({ok:Sh(!0),config:e_,active:X().nullable()}),a_=bh([`secret`,`shared`,`none`]),o_=Z({id:X(),name:X(),provider:X(),model:X(),voice:X(),secret_id:X(),secret:Eg.nullable(),secret_missing:nh(),key_source:a_,shared_key:Dg,active:nh()}),s_=Z({name:X(),default_model:X(),default_voice:X()}),c_=Z({configs:ch(o_),active:X().nullable(),providers:ch(s_)}),l_=Z({ok:Sh(!0),config:o_,active:X().nullable()}),u_=Z({ok:Sh(!0),reply:X(),latency_ms:Qm()}),d_=Z({id:X(),name:X(),accent:X(),workspace:X(),created:X()}),f_=Z({profiles:ch(d_),archived:ch(d_),active_default:X().nullable(),onboarded:nh(),version:X(),ag2_version:X()}),p_=Z({profile:d_}),m_=bh([`running`,`needs_input`,`completed`,`failed`,`cancelled`]),h_=X(),g_=Z({id:X(),task_id:X(),status:m_,trigger:h_,started_at:X().nullable(),ended_at:X().nullable(),summary:X().nullable(),error:X(),seen:nh()}),__=uh({kind:bh([`manual`,`once`,`cron`]),at:X().nullish(),cron:X().nullish()}),v_=Z({id:X(),name:X(),prompt:X(),model:X().nullable(),description:X(),schedule:__,schedule_desc:X(),paused:nh(),starred:nh(),recall_depth:Qm().default(0),next_run_at:X().nullable(),created_at:X(),updated_at:X(),last_run:g_.nullable(),unread:Qm(),needs_input:nh()}),y_=v_.extend({runs:ch(g_)}),b_=Z({tasks:ch(v_)}),x_=Z({task:y_}),S_=Z({run:g_.extend({task_name:X()})});Z({runs:ch(g_)});var C_=Z({pending:ch(Z({id:X(),task_id:X(),chat:X(),kind:X(),text:X(),detail:X(),options:ch(X()),created_at:X(),root_id:X().nullable(),task_title:X(),run_id:X().nullable()}))}),w_=Z({pending:ch(Z({id:X(),text:X(),detail:X().nullable(),options:ch(X()).nullable(),kind:X(),path:X()}))}),T_=Z({task:v_}),E_=Z({role:bh([`user`,`agent`]),text:X()}),D_=Z({chats:ch(Z({chat_id:X(),updated:X(),title:X(),starred:nh(),preview:X(),turns:Qm(),origin_platform:X().optional(),origin_name:X().optional(),origin_live:nh().optional()}))}),O_=Z({chat_id:X(),messages:ch(E_),model:X(),effective_model:X(),origin_platform:X().optional(),origin_name:X().optional(),origin_live:nh().optional()});Z({reply:X(),chat_id:X()});var k_=bh([`bundled`,`global`,`profile`]),A_=Z({name:X(),description:X(),origin:k_,enabled:nh()}),j_=A_.extend({suppressed:nh(),available:nh()}),M_=Z({skills:ch(A_)}),N_=Z({skills:ch(j_)}),P_=Z({results:ch(Z({name:X(),install_id:X(),description:X(),installs:Qm()}))}),F_=Z({name:X(),description:X()}),I_=Z({skills:ch(F_)}),L_=Z({ok:Sh(!0),installed:ch(F_),skills:ch(A_)}),R_=Z({ok:Sh(!0),installed:ch(F_),skills:ch(j_)}),z_=Z({ok:Sh(!0),skills:ch(A_)}),B_=Z({ok:Sh(!0),skills:ch(j_)}),V_=Z({profile:X(),chat_id:X(),task_id:X(),mode:Tg}),H_=Z({id:X(),name:X(),path:X(),exists:nh(),grants:ch(V_)}),U_=Z({folders:ch(H_)}),W_=Z({ok:Sh(!0),folder:H_,folders:ch(H_)}),G_=Z({error:X(),existing:H_}),K_=Z({ok:Sh(!0),folders:ch(H_)}),q_=Z({roots:ch(Z({id:X(),name:X(),path:X(),mode:wg,exists:nh()}))}),J_=Z({commands:ch(X())}),Y_=Z({ok:Sh(!0),commands:ch(X())}),X_=Z({rules:ch(X())}),Z_=Z({path:X(),name:X(),dir:X(),size:Qm(),modified:X()}),Q_=Z({root:X(),files:ch(Z_),dirs:ch(X())}),$_=Z({path:X(),dirs:ch(Z({name:X(),path:X()})),files:ch(Z({name:X(),path:X(),size:Qm()})),mode:wg});fh([Q_,$_]);var ev=Z({results:ch(Z({path:X(),name:X(),dir:X(),kind:bh([`file`,`directory`])}))}),tv=Z({threads:ch(mh(`kind`,[Z({stream_id:X(),kind:Sh(`chat`),title:X(),updated:X()}),Z({stream_id:X(),kind:Sh(`run`),title:X(),updated:X(),task_id:X(),task_name:X(),run_started_at:X()})]))}),nv=Z({ok:Sh(!0),saved:ch(X())}),rv=Z({ok:Sh(!0),path:X()});Z({ok:Sh(!0),etag:X()});var iv=Z({name:X(),enabled:nh(),command:X(),args:ch(X()),cwd:X().nullable(),allowed_tools:ch(X()),blocked_tools:ch(X()),env_keys:ch(X()).default([])}),av=Z({home:X(),cwd:X(),workspace:X()}),ov=fh([Z({ok:Sh(!0),tools:ch(X())}),Z({ok:Sh(!1),error:X()})]),sv=Z({set:nh(),hint:X().optional(),base_url:X().optional()}),cv=Z({keys:vh(X(),sv),voice_available:vh(X(),nh()),assistant:Z({provider:X(),model:X()}),llm_override:X().nullable(),llm_active:X().nullable(),live_override:X().nullable(),live_active:X().nullable(),codex:Z({signed_in:nh(),source:X().nullable(),account_id:X().nullable(),expires_at:Qm().nullable()}),voice_provider:X(),mcp_servers:ch(iv),focuses:ch(X()),reply_timeout_s:Qm(),fs:av}),lv=bh([`ok`,`warn`,`down`,`off`]),uv=Z({overall:lv,checks:ch(Z({id:X(),label:X(),state:lv,detail:X(),servers:ch(Z({name:X(),enabled:nh()})).optional(),items:ch(Z({connection:X(),name:X(),platform:X(),active:nh(),error:X().nullable()})).optional()}))}),dv=Z({voices:ch(Z({name:X(),style:X()})),current:X().nullable(),provider:X(),input_rate:Qm()}),fv=Z({text:X()}),pv=Z({ok:Sh(!0),voice:X()}),mv=Z({ok:Sh(!0),focuses:ch(X())}),hv=Z({ok:Sh(!0),llm_override:X().nullable()}),gv=Z({ok:Sh(!0),live_override:X().nullable()}),_v=Z({ok:Sh(!0),reply_timeout_s:Qm()}),vv=Z({ok:Sh(!0),server:iv,mcp_servers:ch(iv)}),yv=Z({ok:Sh(!0),mcp_servers:ch(iv)}),bv=Z({set:nh(),hint:X()}),xv=Z({id:X(),platform:X(),name:X(),tokens:vh(X(),bv),default_profile:X().nullable(),active:nh(),error:X().nullable(),paired_accounts:Qm()}),Sv=Z({connections:ch(xv)}),Cv=Z({surfaces:ch(Z({kind:X(),id:X()})),exposure:vh(X(),vh(X(),nh())),default_profile:X().nullable()}),wv=Z({key:X(),account_id:X().nullable(),handle:X().nullable(),pending:nh()}),Tv=Z({code:X(),expires_at:Qm()}),Ev=Z({accounts:ch(wv),code:Tv.nullable()}),Dv=Tv.nullable(),Ov=Z({groups:ch(Z({chat_id:X(),profile:X().nullable()})),profiles:ch(Z({id:X(),name:X()}))}),kv={chats:()=>mg(ys(`/chats`),D_).then(e=>e.chats),chat:e=>mg(ys(`/chats/`+encodeURIComponent(e)),O_),deleteChat:e=>_g(ys(`/chats/`+encodeURIComponent(e)),Cg),updateChat:(e,t)=>gg(ys(`/chats/`+encodeURIComponent(e)),t,Cg),closeAcpSession:e=>hg(ys(`/chats/`+encodeURIComponent(e)+`/acp/close`),void 0,Cg)},Av=Z({status:bh([`saved`,`conflict`]),name:X(),path:X(),conflict_token:X(),history_recorded:nh(),message:X()}),jv={saveCard:(e,t)=>hg(ys(`/chats/`+encodeURIComponent(e)+`/cards/save`),t,Av)},Mv={codingAgents:()=>mg(xs(`/coding/agents`),Ug),codingModels:(e,t=!1)=>mg(xs(`/coding/${e}/models${t?`?refresh=1`:``}`),Gg)},Nv=(e,t=``)=>xs(`/connections/`+encodeURIComponent(e)+t),Pv={connections:()=>mg(xs(`/connections`),Sv).then(e=>e.connections),createConnection:(e,t,n)=>hg(xs(`/connections`),{platform:e,name:t,tokens:n},xv),renameConnection:(e,t)=>hg(Nv(e),{name:t},xv),replaceConnectionTokens:(e,t)=>hg(Nv(e,`/token`),{tokens:t},xv),deleteConnection:e=>_g(Nv(e),Cg),connectionDefault:(e,t)=>hg(Nv(e,`/default`),{profile:t},xv),connectionExposure:e=>mg(Nv(e,`/exposure`),Cv),setConnectionExposure:(e,t,n,r)=>hg(Nv(e,`/exposure`),{profile:t,surface:n,exposed:r},Cv),connectionPairing:e=>mg(Nv(e,`/pairing`),Ev),connectionPair:(e,t)=>hg(Nv(e,`/pairing`),{value:t},Ev),connectionUnpair:(e,t)=>_g(Nv(e,`/pairing/`+encodeURIComponent(t)),Ev),connectionPairingCode:e=>hg(Nv(e,`/pairing/code`),void 0,Dv),connectionGroups:e=>mg(Nv(e,`/groups`),Ov),connectionGroupProfile:(e,t,n)=>hg(Nv(e,`/groups/`+encodeURIComponent(t)+`/profile`),{profile:n},Ov)};function Fv(e){if(!e)return null;let t=String(e).trim();return t.startsWith(`W/`)&&(t=t.slice(2)),t.replace(/^"|"$/g,``)}function Iv(e){return Rv(e).status===409}function Lv(e){let t=Rv(e),n=zv(t.body);if(n)return n;let r=t.status;return r===404?`This file no longer exists on disk.`:r===400?`Could not save — the file path is invalid.`:r===413?`Could not save — the file is too large.`:!r&&t.message?t.message:`Could not save the file.`}function Rv(e){if(!e||typeof e!=`object`)return{};let t=e;return{status:typeof t.status==`number`?t.status:void 0,body:t.body,message:typeof t.message==`string`?t.message:void 0}}function zv(e){if(!e||typeof e!=`object`)return``;let t=e.error;return typeof t==`string`?t:``}function Bv(e){let t=String(e??``);return t.startsWith(`/`)||t.startsWith(`~`)}function Vv(e){let t=e===`read_write`;return{edit:t,rename:t,delete:t,move:t}}function Hv(e){return e===`read_write`?`read+write`:e===`read`?`read`:``}function Uv(e,t){let n=String(e??``).replace(/\/+$/,``),r=String(t??``);if(!n||!r.startsWith(n+`/`))return[];let i=r.slice(n.length+1).split(`/`);i.pop();let a=[n],o=n;for(let e of i)e&&(o=o+`/`+e,a.push(o));return a}function Wv(e,{download:t=!1,chatId:n=``}={}){let r=[`path=`+encodeURIComponent(String(e??``))];return t&&r.push(`download=true`),Bv(e)&&n&&r.push(`chat_id=`+encodeURIComponent(n)),r.join(`&`)}var Gv={files:()=>mg(ys(`/files`),Q_),folderRoots:(e=``)=>mg(ys(`/folders/roots`+(e?`?chat_id=`+encodeURIComponent(e):``)),q_),folderList:(e,t=``)=>mg(ys(`/files?path=`+encodeURIComponent(e)+(t?`&chat_id=`+encodeURIComponent(t):``)),$_),searchFiles:(e,t=``)=>mg(ys(`/files/search?q=`+encodeURIComponent(e)+(t?`&chat_id=`+encodeURIComponent(t):``)),ev),fileMentions:(e,t=``)=>mg(ys(`/files/mentions?path=`+encodeURIComponent(e)+(t?`&chat_id=`+encodeURIComponent(t):``)),tv),fileUrl:(e,t=!1,n=``)=>ys(`/files/raw?`+Wv(e,{download:t,chatId:n})),fileText:async(e,t=``)=>{let n=await fetch(ys(`/files/raw?`+Wv(e,{chatId:t})));if(!n.ok)throw Error(`file not found`);return n.text()},fileTextWithEtag:async(e,t=``)=>{let n=await fetch(ys(`/files/raw?`+Wv(e,{chatId:t})));if(!n.ok)throw Error(`file not found`);return{text:await n.text(),etag:Fv(n.headers.get(`ETag`)),mode:n.headers.get(`X-File-Mode`)||``}},saveFile:async(e,t,n,r=``)=>{let i=await fetch(ys(`/files/raw?`+Wv(e,{chatId:r})),{method:`PUT`,headers:{"Content-Type":`text/plain; charset=utf-8`,...n?{"If-Match":`"${n}"`}:{}},body:t});if(!i.ok){let e=null;try{e=await i.json()}catch{}let t=e?.error;throw new ug(t||`save failed (${i.status})`,i.status,e)}return(await i.json().catch(()=>({}))).etag||Fv(i.headers.get(`ETag`))},deleteFile:(e,t=``)=>_g(ys(`/files/raw?`+Wv(e,{chatId:t})),Cg),uploadFiles:async(e,t=``,n=``)=>{let r=new FormData;for(let t of e)r.append(`files`,t,t.name);r.append(`dir`,t),n&&r.append(`chat_id`,n);let i=await fetch(ys(`/files/upload`),{method:`POST`,body:r});if(!i.ok){let e=`upload failed (`+i.status+`)`;try{let t=await i.json();t&&t.error&&(e=t.error)}catch{}throw Error(e)}return lg(nv,await i.json(),`POST /files/upload`)},mkdir:(e,t=``)=>hg(ys(`/files/mkdir`),{path:e,chat_id:t},rv),moveFile:(e,t,n=``)=>hg(ys(`/files/move`),{from:e,to:t,chat_id:n},Cg)},Kv={folders:()=>mg(xs(`/folders`),U_),createFolder:(e,t=``)=>hg(xs(`/folders`),{path:e,name:t},W_),updateFolder:(e,t)=>hg(xs(`/folders/`+encodeURIComponent(e)),t,W_),deleteFolder:e=>_g(xs(`/folders/`+encodeURIComponent(e)),K_),setGrant:(e,t,n,r=``,i=``)=>hg(xs(`/folders/`+encodeURIComponent(e)+`/grants`),{profile:t,chat_id:r,task_id:i,mode:n},K_),revokeGrant:(e,t,n=``,r=``)=>_g(xs(`/folders/`+encodeURIComponent(e)+`/grants`),K_,{profile:t,chat_id:n,task_id:r})},qv={llmConfigs:()=>mg(xs(`/llm-configs`),n_),saveLlmConfig:e=>{let{id:t,...n}=e;return hg(xs(`/llm-configs`+(t?`/`+encodeURIComponent(t):``)),n,i_)},deleteLlmConfig:e=>_g(xs(`/llm-configs/`+encodeURIComponent(e)),Cg),useLlmConfig:e=>hg(xs(`/llm-configs/`+encodeURIComponent(e)+`/use`),void 0,Cg),testLlmConfig:e=>hg(xs(`/llm-configs/`+encodeURIComponent(e)+`/test`),void 0,u_),testLlmConfigDraft:e=>hg(xs(`/llm-configs/test`),e,u_),llmCatalog:(e,t=!1)=>{let n=new URLSearchParams({type:e.type});return e.base_url&&n.set(`base_url`,e.base_url),e.host&&n.set(`host`,e.host),e.secret_id&&n.set(`secret_id`,e.secret_id),t&&n.set(`refresh`,`1`),mg(xs(`/llm-configs/models?${n}`),r_)},liveConfigs:()=>mg(xs(`/live-configs`),c_),saveLiveConfig:e=>{let{id:t,...n}=e;return hg(xs(`/live-configs`+(t?`/`+encodeURIComponent(t):``)),n,l_)},deleteLiveConfig:e=>_g(xs(`/live-configs/`+encodeURIComponent(e)),Cg),useLiveConfig:e=>hg(xs(`/live-configs/`+encodeURIComponent(e)+`/use`),void 0,Cg),testLiveConfig:e=>hg(xs(`/live-configs/`+encodeURIComponent(e)+`/test`),void 0,u_),testLiveConfigDraft:e=>hg(xs(`/live-configs/test`),e,u_)},Jv={permissions:()=>mg(xs(`/permissions`),J_),grantCommand:(e,t)=>hg(xs(`/permissions/commands`),{tool:e,prefix:t},Y_),revokeCommand:e=>_g(xs(`/permissions/commands`),Y_,{rule:e})};function Yv(e,t){let n=new FormData;return n.append(`file`,e),t!==void 0&&n.append(`names`,Array.isArray(t)?t.join(`,`):String(t)),n}var Xv={skills:()=>mg(xs(`/skills`),M_),setSkillState:(e,t)=>hg(xs(`/skills/`+encodeURIComponent(e)+`/state`),{enabled:t},z_),deleteSkill:e=>_g(xs(`/skills/`+encodeURIComponent(e)),z_),searchSkills:(e,t=10)=>hg(xs(`/skills/search`),{query:e,limit:t},P_),installSkill:e=>hg(xs(`/skills/install`),e,L_),discoverSkills:e=>hg(xs(`/skills/discover`),{git_url:e},I_),discoverSkillsUpload:e=>vg(xs(`/skills/discover-upload`),Yv(e),I_),installSkillUpload:(e,t)=>vg(xs(`/skills/install-upload`),Yv(e,t),L_)},Zv={profileSkills:()=>mg(ys(`/skills`),N_),suppressSkill:(e,t)=>t?hg(ys(`/skills/`+encodeURIComponent(e)+`/suppress`),void 0,B_):_g(ys(`/skills/`+encodeURIComponent(e)+`/suppress`),B_),setProfileSkillState:(e,t)=>hg(ys(`/skills/`+encodeURIComponent(e)+`/state`),{enabled:t},B_),deleteProfileSkill:e=>_g(ys(`/skills/`+encodeURIComponent(e)),B_),installProfileSkill:e=>hg(ys(`/skills/install`),e,R_),discoverProfileSkills:e=>hg(ys(`/skills/discover`),{git_url:e},I_),discoverProfileSkillsUpload:e=>vg(ys(`/skills/discover-upload`),Yv(e),I_),installProfileSkillUpload:(e,t)=>vg(ys(`/skills/install-upload`),Yv(e,t),R_)},Qv={profiles:()=>mg(xs(`/profiles`),f_),createProfile:(e,t)=>hg(xs(`/profiles`),{name:e,accent:t},p_),updateProfile:(e,t)=>hg(xs(`/profiles/`+encodeURIComponent(e)),t,p_),archiveProfile:(e,t)=>_g(xs(`/profiles/`+encodeURIComponent(e)),Cg,t?{new_default:t}:{}),restoreProfile:e=>hg(xs(`/profiles/`+encodeURIComponent(e)+`/restore`),void 0,p_),deleteProfile:e=>_g(xs(`/profiles/`+encodeURIComponent(e)+`?purge=true`),Cg)},$v={setKey:(e,t)=>hg(xs(`/secrets/key`),{provider:e,value:t},Cg),secrets:()=>mg(xs(`/secrets`),jg),createSecret:e=>hg(xs(`/secrets`),e,Mg),updateSecret:(e,t)=>hg(xs(`/secrets/`+encodeURIComponent(e)),t,Mg),deleteSecret:e=>_g(xs(`/secrets/`+encodeURIComponent(e)),Cg)},ey={health:()=>mg(ys(`/health`),uv),voices:e=>mg(ys(`/voice/voices`+(e?`?config_id=`+encodeURIComponent(e):``)),dv),settings:()=>mg(ys(`/settings`),cv),setFocuses:e=>hg(ys(`/settings/focuses`),{focuses:e},mv),setLlmOverride:(e=``)=>hg(ys(`/settings/llm-override`),{config_id:e},hv),setLiveOverride:(e=``)=>hg(ys(`/settings/live-override`),{config_id:e},gv),setReplyTimeout:e=>hg(ys(`/settings/reply-timeout`),{reply_timeout_s:e},_v),setVoiceProvider:e=>hg(ys(`/settings/voice_provider`),{provider:e},Cg),addMcpServer:e=>hg(ys(`/settings/mcp`),e,vv),deleteMcpServer:e=>_g(ys(`/settings/mcp/${encodeURIComponent(e)}`),yv),healthMcpServer:e=>hg(ys(`/settings/mcp/${encodeURIComponent(e)}/health`),void 0,ov),getMemory:()=>mg(ys(`/memory`),fv),setMemory:e=>hg(ys(`/memory`),{text:e},Cg),usage:()=>mg(ys(`/usage`),Fg),selectVoice:(e,t)=>hg(ys(`/voice/select`),{voice:e,config_id:t||null},pv),previewVoice:async(e,t)=>{let n=await fetch(ys(`/voice/preview`),{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({voice:e,config_id:t||null})});if(!n.ok)throw Error(`preview failed (`+n.status+`)`);return n.blob()},forProfile:e=>({settings:()=>mg(bs(e,`/settings`),cv),setFocuses:t=>hg(bs(e,`/settings/focuses`),{focuses:t},mv)})},ty={status:()=>mg(xs(`/status`),Lg),usageAll:()=>mg(xs(`/usage`),Ig),setOnboarded:(e=!0)=>hg(xs(`/onboarded`),{value:e},Cg),listDirs:(e=``)=>mg(xs(`/fs/list?path=`+encodeURIComponent(e)),Kg),makeDir:(e,t)=>hg(xs(`/fs/mkdir`),{path:e,name:t},qg),googleStatus:()=>mg(xs(`/google/status`),Rg),googleLoginUrl:()=>hg(xs(`/google/login_url`),void 0,Vg),googleCredentials:e=>hg(xs(`/google/credentials`),{content:e},Yg),googleLogout:()=>hg(xs(`/google/logout`),void 0,Cg),codexStatus:()=>mg(xs(`/codex/status`),zg),codexLoginUrl:()=>hg(xs(`/codex/login_url`),void 0,Bg),codexSubmit:(e,t)=>hg(xs(`/codex/submit`),{state:e,code:t},Cg),codexLogout:()=>hg(xs(`/codex/logout`),void 0,Cg),globalMemory:()=>mg(xs(`/memory`),fv),setGlobalMemory:e=>hg(xs(`/memory`),{text:e},Cg),setIdentity:e=>hg(xs(`/identity`),e,Jg)},ny={tasks:()=>mg(ys(`/tasks`),b_).then(e=>e.tasks),createTask:e=>hg(ys(`/tasks`),e,T_).then(e=>e.task),task:e=>mg(ys(`/tasks/`+encodeURIComponent(e)),x_).then(e=>e.task),updateTask:(e,t)=>gg(ys(`/tasks/`+encodeURIComponent(e)),t,x_).then(e=>e.task),deleteTask:e=>_g(ys(`/tasks/`+encodeURIComponent(e)),Cg),runTask:e=>hg(ys(`/tasks/`+encodeURIComponent(e)+`/run`),void 0,S_).then(e=>e.run),taskPermissions:e=>mg(ys(`/tasks/`+encodeURIComponent(e)+`/permissions`),X_).then(e=>e.rules),deleteTaskPermission:(e,t)=>_g(ys(`/tasks/`+encodeURIComponent(e)+`/permissions`),Cg,{rule:t}),run:e=>mg(ys(`/runs/`+encodeURIComponent(e)),S_).then(e=>e.run),stopRun:e=>hg(ys(`/runs/`+encodeURIComponent(e)+`/stop`),void 0,Cg),runSeen:e=>hg(ys(`/runs/`+encodeURIComponent(e)+`/seen`),void 0,Cg),taskRunsSeen:e=>hg(ys(`/tasks/`+encodeURIComponent(e)+`/seen`),void 0,Cg),inquiries:()=>mg(ys(`/inquiries/pending`),C_).then(e=>e.pending),answerInquiry:(e,t)=>hg(ys(`/inquiries/${encodeURIComponent(e)}/answer`),{answer:t},Cg),hitlPending:()=>mg(ys(`/hitl/pending`),w_).then(e=>e.pending),answerHitl:(e,t)=>hg(`/hitl/${encodeURIComponent(e)}/answer`,{answer:t},Cg)},Q={...Qv,...$v,...qv,...Kv,...Jv,...Xv,...ty,...Mv,...Pv,...kg,...kv,...jv,...ny,...Gv,...ey,...Zv},ry=e=>{if(!e)return{};if(typeof e==`object`)return e;if(typeof e!=`string`)return{};try{return JSON.parse(e)}catch{return{}}},iy=e=>(e||``).split(`/`).pop()||e,ay=[`write_file`,`append_file`,`edit_file`],oy=[`duckduckgo_search`,`gmail_search`,`drive_search`],sy={};for(let e of ay)sy[e]=e=>typeof e.path==`string`&&e.path?{kind:`file`,path:e.path,name:iy(e.path)}:null;for(let e of oy)sy[e]=e=>typeof e.query==`string`&&e.query?{kind:`search`,query:e.query}:null;sy.load_skill=e=>typeof e.name==`string`&&e.name?{kind:`skill`,name:e.name}:null,sy.run_skill_script=e=>typeof e.name==`string`&&e.name?{kind:`skill`,name:e.name,script:typeof e.script==`string`?e.script:``,ran:!0}:null,sy.generate_image=e=>typeof e.prompt==`string`&&e.prompt?{kind:`image`,prompt:e.prompt,edit:!!e.source_image}:null;function cy(e,t){let n=sy[e];return n&&n(ry(t))||null}function ly(e){if(e==null||e===``)return null;let t=typeof e==`number`?new Date(e*1e3):new Date(e);return isNaN(t.getTime())?null:t}function uy(e){let t=ly(e);return t?t.toDateString()===new Date().toDateString()?t.toLocaleTimeString([],{hour:`numeric`,minute:`2-digit`}):t.toLocaleString([],{month:`short`,day:`numeric`,hour:`numeric`,minute:`2-digit`}):``}function dy(e){let t=ly(e);if(!t)return``;let n=Date.now()-t.getTime();if(n<0)return`just now`;let r=Math.round(n/6e4);if(r<1)return`just now`;if(r<60)return`${r}m ago`;let i=Math.round(r/60);if(i<24)return`${i}h ago`;let a=Math.round(i/24);return a===1?`yesterday`:a<7?`${a}d ago`:t.toLocaleDateString([],{month:`short`,day:`numeric`})}function fy(e){let t=ly(e);if(!t)return``;let n=Date.now()-t.getTime(),r=Math.round(n/6e4);if(r<1)return`now`;if(r<60)return`${r}m`;let i=Math.round(r/60);if(i<24)return`${i}h`;let a=Math.round(i/24);return a<7?`${a}d`:t.toLocaleDateString([],{month:`short`,day:`numeric`})}function py(e){let t=ly(e);if(!t)return``;let n=new Date,r=t.toLocaleTimeString([],{hour:`numeric`,minute:`2-digit`}),i=e=>new Date(e.getFullYear(),e.getMonth(),e.getDate()),a=Math.round((i(t).getTime()-i(n).getTime())/864e5);return a===0?`Today ${r}`:a===1?`Tomorrow ${r}`:a===-1?`Yesterday ${r}`:a>1&&a<7?`${t.toLocaleDateString([],{weekday:`short`})} ${r}`:t.toLocaleString([],{month:`short`,day:`numeric`,hour:`numeric`,minute:`2-digit`})}function my(e){let t=ly(e);return t?`${t.getFullYear()}-${t.getMonth()}-${t.getDate()}`:null}function hy(e){let t=ly(e);if(!t)return``;let n=new Date,r=t.toLocaleTimeString([],{hour:`numeric`,minute:`2-digit`}),i=e=>new Date(e.getFullYear(),e.getMonth(),e.getDate()),a=Math.round((i(t).getTime()-i(n).getTime())/864e5),o;if(a===0)o=`Today`;else if(a===-1)o=`Yesterday`;else{let e={weekday:`short`,month:`short`,day:`numeric`};t.getFullYear()!==n.getFullYear()&&(e.year=`numeric`),o=t.toLocaleDateString([],e)}return`${o} at ${r}`}function gy(e){let t=ly(e);if(!t)return``;let n=new Date,r=e=>new Date(e.getFullYear(),e.getMonth(),e.getDate()),i=Math.round((r(t).getTime()-r(n).getTime())/864e5);if(i===0)return`Recent`;if(i===-1)return`Yesterday`;let a={weekday:`short`,month:`short`,day:`numeric`};return t.getFullYear()!==n.getFullYear()&&(a.year=`numeric`),t.toLocaleDateString([],a)}function _y(e,t=hy){let n=null;return e.map(e=>{let r=my(e.at),i=r&&r!==n?t(e.at):null;return r&&(n=r),{item:e,sep:i}})}function vy(e){let t=uy(e),n=dy(e);return t&&n?`${t} · ${n}`:t||n}function yy(e){let t=e.last_run;return t&&(t.ended_at||t.started_at)||e.created_at}function by(e){let t=ly(e);if(!t)return``;let n=t.getTime()-Date.now();if(n<=0)return`now`;let r=Math.round(n/6e4);if(r<1)return`in <1m`;if(r<60)return`in ${r}m`;let i=Math.round(r/60);if(i<24)return`in ${i}h`;let a=Math.round(i/24);if(a<7)return`in ${a}d`;let o=Math.round(a/7);return o<5?`in ${o}w`:`in ${Math.round(a/30)}mo`}var xy=0;function Sy(){return++xy}function Cy(e){return typeof e==`string`&&/^https?:\/\//i.test(e.trim())?e:null}var wy=e=>!!e&&typeof e==`object`&&!Array.isArray(e),Ty=0,Ey=()=>`a2ui-${Date.now()}-${++Ty}`;function Dy(e){return String(e||``).replace(/^\//,``).split(`/`).filter(Boolean).map(e=>e.replace(/~1/g,`/`).replace(/~0/g,`~`))}function Oy(e,t){if(!e.startsWith(`.`))return e;let n=e.replace(/^\.\/?/,``);return n?`${t}/${n}`:t}function ky(e,t={},n=``){let r=e;return!e||typeof e!=`object`||Array.isArray(e)||typeof r?.path!=`string`?e:Dy(Oy(r.path,n)).reduce((e,t)=>e?.[t],t)}function Ay(e,t={},n=``){if(Array.isArray(e))return e.filter(e=>typeof e==`string`).map(e=>({id:e,scope:n}));if(!wy(e))return[];let{componentId:r,path:i}=e;return typeof r!=`string`||typeof i!=`string`?[]:jy({path:i},t,n).map(e=>({id:r,scope:e})).slice(Ny(e))}function jy(e,t={},n=``){let r=_b(e,n),i=ky(e,t,n);return!r||!Array.isArray(i)?[]:i.map((e,t)=>`${r}/${t}`)}function My(e,t,n={},r=[],i=``){let a=ky(t,n,i);return a==null||a===``||!wy(e)?-1:r.findIndex(t=>ky(e,n,t)===a)}function Ny(e){return wy(e)?Math.max(0,Math.trunc(Number(e.start)||0)):0}var Py=[`neutral`,`muted`,`accent`,`positive`,`negative`];function Fy(e,t){let n=wy(t)?t[String(e)]:void 0;return n===void 0?e:n}function Iy(e,t={},n=``){let r=ky(e,t,n),i=wy(e)?Fy(r,e.map):r;if(typeof i==`number`&&Number.isFinite(i))return i>0?`positive`:i<0?`negative`:`neutral`;let a=fb(i);return Py.includes(a)?a:`neutral`}function Ly(e,t={},n=``){if(e===void 0)return!0;if(Array.isArray(e))return e.some(e=>Ly(e,t,n));let r=ky(e,t,n);return r==null||r===``||r===!1?!1:!Array.isArray(r)||r.length>0}var Ry={time:uy,ago:dy,datetime:py};function zy(e,t={},n=``){let r=ky(e.text,t,n),i=Ry[fb(e.format)];if(i)return i(r);let a=Fy(r,e.map);return a==null||a===``?``:String(a)}function By(e,t={},n=``){return fb(Fy(ky(e.name,t,n),e.map))}var Vy=[`task`,`chat`,`file`,`folder`,`url`],Hy=(e,t)=>e!==null&&!e.includes(t);function Uy(e,t={},n=``,r={tasks:null,chats:null}){for(let i of Vy){let a=fb(ky(e[i],t,n));if(a){if(i===`task`)return Hy(r.tasks,a)?null:{kind:i,value:a};if(i===`chat`)return Hy(r.chats,a)?null:{kind:i,value:a};if(i===`url`){let e=Cy(a);return e?{kind:i,value:e}:null}return{kind:i,value:a}}}return null}function Wy(e){let t=fb(e);return t?t.split(` +`).filter((e,t,n)=>e!==``||t!==n.length-1).map(e=>{let t=e[0],n=e.startsWith(`+++`)||e.startsWith(`---`)?`meta`:t===`@`?`hunk`:t===`+`?`add`:t===`-`?`del`:`ctx`;return{text:e||` `,kind:n}}):[]}function Gy(e,t,n,r=3){let i=(Array.isArray(e)?e:[]).map(Number).filter(Number.isFinite);if(i.length<2)return null;let a=e=>r+e/(i.length-1)*(t-r*2),o=e=>r+(1-Math.max(0,Math.min(100,e))/100)*(n-r*2),s=`M${i.map((e,t)=>`${a(t).toFixed(1)},${o(e).toFixed(1)}`).join(` L`)}`;return{line:s,area:`${s} L${a(i.length-1).toFixed(1)},${(n-r).toFixed(1)} L${a(0).toFixed(1)},${(n-r).toFixed(1)} Z`,endX:a(i.length-1).toFixed(1),endY:o(i[i.length-1]).toFixed(1)}}var Ky=e=>e.toLocaleString(`en-US`,{minimumFractionDigits:2,maximumFractionDigits:2}),qy=e=>`${e>0?`+`:``}${Ky(e)}`,Jy=e=>typeof e==`number`&&Number.isFinite(e)?e:null;function Yy(e,t={},n=``){let r=ky(e.value,t,n),i=Jy(ky(e.delta,t,n)),a=Jy(ky(e.deltaPercent,t,n)),o=a??i,s=[i==null?``:qy(i),a==null?``:`${qy(a)}%`].filter(Boolean);return{value:typeof r==`number`?Ky(r):fb(r),unit:fb(ky(e.unit,t,n)),delta:s.length===2?`${s[0]} (${s[1]})`:s[0]||``,arrow:o==null||o===0?``:o>0?`▲`:`▼`}}function Xy(e,t){return Array.isArray(e)?/^\d+$/.test(t)&&Number(t)`,eb=``,tb=[`version`,...Qy].flatMap(e=>[`[{"${e}"`,`{"${e}"`]);function nb(e,t){let n=e[t],r=n===`[`?`]`:`}`,i=0,a=!1,o=!1;for(let s=t;swy(e)&&Qy.some(t=>t in e))}function ib(e){if(Qy.some(t=>e.includes(t)))return!0;let t=e.replace(/\s+/g,``);return tb.some(e=>t.startsWith(e)||e.startsWith(t))}function ab(e){let t=e||``,n=``,r=!1,i=0;for(;i=0&&(o<0||ee.kind===`a2ui`&&e.surfaceId===t);return i||(i={id:by(),kind:`a2ui`,version:r||`v1.0`,catalogId:n||`https://ag2.ai/assistant/a2ui/catalog.json`,surfaceId:t,title:ab,intent:``,component:{},data:{},messages:[]},e.push(i)),i}function lb(e,t){if(!Sy(t))return null;let n=ub(t.version)||`v1.0`;if(Sy(t.createSurface)){let r=t.createSurface,i=cb(e,ub(r.surfaceId)||wy(),ub(r.catalogId)||`https://ag2.ai/assistant/a2ui/catalog.json`,n);return gb(i).push(t),i}if(Sy(t.updateComponents)){let r=t.updateComponents,i=cb(e,ub(r.surfaceId)||wy(),void 0,n),a=pb(r.components);i.components=a;let o=fb(a.find(e=>e.id===`root`)??a[0]);return i.component=o,i.data=sb(o,i.data),i.title=ob(i.data),gb(i).push(t),i}if(Sy(t.updateDataModel)){let r=t.updateDataModel,i=cb(e,ub(r.surfaceId)||wy(),void 0,n),a=ub(r.path);return i.data=!a||a===`/`?Sy(r.value)?r.value:{value:r.value}:Yy(i.data,a,r.value),i.title=ob(i.data),gb(i).push(t),i}if(Sy(t.deleteSurface)){let n=ub(t.deleteSurface.surfaceId),r=e.findIndex(e=>e.kind===`a2ui`&&e.surfaceId===n);r>=0&&e.splice(r,1)}return null}var ub=e=>typeof e==`string`?e:``;function db(e){return Array.isArray(e)?e.filter(Boolean):[]}var fb=e=>Sy(e)?e:{},pb=e=>db(e);function mb(e,t={},n=``){return Array.isArray(e)?e.map(e=>mb(e,t,n)):Sy(e)?typeof e.path==`string`&&Object.keys(e).length===1?Dy(e,t,n):Object.fromEntries(Object.entries(e).map(([e,r])=>[e,mb(r,t,n)])):e}var hb=(e,t=``)=>Sy(e)&&typeof e.path==`string`?Ey(e.path,t):``,gb=e=>e.messages??=[],_b=e=>e.split(`.`).pop()??e;function vb(e){return(e??[]).filter(e=>_b(e.__event__??``)===`TextInput`).map(e=>e.content??``).join(` -`).trim()}function yb(e,t,n=null){if(!t)return;let r=bb(t),i=e[e.length-1],a;i&&i.kind===`tools`?a=i:(a={id:by(),kind:`tools`,names:[],cards:[]},e.push(a));let o=a.names[a.names.length-1];o&&o.name===r?o.n++:a.names.push({name:r,n:1}),n&&a.cards.push({...n,id:by()})}function bb(e){return e.startsWith(`repo_files_`)?`repo-files · `+e.slice(11):e.replace(/_/g,` `)}function xb(e){for(let t=e.length-1;t>=0;t--){let n=e[t];n.kind===`note`&&n.a2uiActionPending&&e.splice(t,1)}}function Sb(e){for(let t=e.length-1;t>=0;t--){let n=e[t];if(n.kind===`note`&&n.ends||n.kind===`agent`&&!n.streaming)return!1;if(n.kind===`user`)return!0}return!1}var Cb={TaskStarted:{icon:`zap`,text:`Task started`},TaskCompleted:{icon:`check`,text:`Task completed`},TaskFailed:{icon:`x`,text:`Task failed`},TaskCancelled:{icon:`x`,text:`Task cancelled`}},wb=new Set([`ag2-assistant`]);function Tb(e){return!e.agent_name||wb.has(e.agent_name)}function Eb(e){return e===`TaskStarted`?`running`:e===`TaskCompleted`?`completed`:e===`TaskCancelled`?`cancelled`:`failed`}function Db(e){if(!e)return``;if(typeof e==`string`)return e;if(typeof e==`object`){if(`message`in e&&typeof e.message==`string`&&e.message)return e.message;if(`content`in e&&typeof e.content==`string`&&e.content)return e.content}return String(e)}function Ob(e){return e?(typeof e==`string`?e:JSON.stringify(e)).replace(/\s+/g,` `).trim().slice(0,240):``}function kb(e,t,n){let r=e.find(e=>e.kind===`subagent`&&e.taskId===t);if(r)return r;let i={id:by(),kind:`subagent`,taskId:t,agent:n||`subagent`,objective:``,status:`running`,items:[]};return e.push(i),i}function Ab(e,t,n){let r=kb(e,n.task_id||`${n.agent_name}:${n.objective||``}`,n.agent_name??``);r.status=Eb(t),n.agent_name&&(r.agent=n.agent_name),n.objective&&(r.objective=n.objective),t===`TaskCompleted`&&(r.result=Ob(n.result)),t===`TaskFailed`&&(r.error=Db(n.error)),t===`TaskCancelled`&&(r.error=n.reason||`cancelled`)}function jb(e,t){return t&&e.push({id:by(),kind:`user`,text:t,queued:!0}),e}var Mb=new Set(Yh);function Nb(e){return Mb.has(e)}function Pb(e){throw Error(`unhandled event: ${String(e)}`)}function Fb(e,t){let n=e.length;try{let n=_b(t.type);Nb(n)&&Bb(e,n,t.data)}catch(e){console.warn(`[project] ${t.type}`,e)}let r=Jh.safeParse(t.data),i=r.success?r.data.created_at:void 0;for(let t=n;t0&&e[t-1].kind!==`user`;)t--;return e.slice(t)}function Lb(e){return Ib(e).some(e=>e.kind===`a2ui`)}function Rb(e){for(let t of Ib(e))t.kind===`agent`&&t.empty&&(t.text=``,t.empty=!1)}function zb(e,t,n){return t===`message`?e.kind===`agent`&&String(e.at)===n:t===`image`?e.kind===`genimage`&&e.path===n:t===`deliverable`&&e.kind===`deliverable`&&e.deliverableId===n}function Bb(e,t,n){switch(t){case`ModelRequest`:case`DrainedModelRequest`:{let t=vb(Kh.ModelRequest.parse(n).parts);if(!t||t.startsWith(`[[A2UI_ACTION]]`))break;let r=e.find(e=>e.kind===`user`&&!!e.queued&&e.text===t);r?r.queued=!1:e.push({id:by(),kind:`user`,text:t});break}case`ModelMessageChunk`:{let t=Kh.ModelMessageChunk.parse(n),r=e[e.length-1];r&&r.kind===`agent`&&r.streaming?r.text+=t.content??``:e.push({id:by(),kind:`agent`,text:t.content??``,streaming:!0});break}case`ModelResponse`:{let t=Kh.ModelResponse.parse(n),r=t.message?.content,i=t.tool_calls?.calls??[];(r||!i.length)&&xb(e);let a=[...e].reverse().find(e=>e.kind===`agent`&&!!e.streaming);if(r)a?(a.text=r,a.streaming=!1):e.push({id:by(),kind:`agent`,text:r});else if(!i.length){let t=Lb(e),n=t?``:`_(no reply)_`;a?(a.text=n,a.streaming=!1,a.empty=!t):e.push({id:by(),kind:`agent`,text:n,empty:!t})}break}case`ToolCallsEvent`:{let t=Kh.ToolCallsEvent.parse(n);for(let n of t.calls??[])yb(e,n.name,oy(n.name,n.arguments));break}case`TaskCreated`:{let t=Kh.TaskCreated.parse(n);e.push({id:by(),kind:`taskcard`,taskId:t.task_id,title:t.title,scheduled:t.kind===`scheduled`});break}case`TaskScheduled`:{let t=Kh.TaskScheduled.parse(n),r=t.recurrence?` · `+(t.recurrence_desc||`repeats `+t.recurrence):``;e.push({id:by(),kind:`note`,icon:`clock`,text:`Scheduled for ${dy(t.scheduled_for)}${r}`});break}case`TaskStarted`:case`TaskCompleted`:case`TaskFailed`:case`TaskCancelled`:{let r=Kh.TaskLifecycle.parse(n);Tb(r)?e.push({id:by(),kind:`note`,icon:Cb[t].icon,text:Cb[t].text}):Ab(e,t,r);break}case`SubagentTrace`:{let t=Kh.SubagentTrace.parse(n),r=t.subagent_id??``,i=kb(e,r,_b(r.split(`:`).pop()??``));t.inner&&Fb(i.items,qh.parse(t.inner));break}case`ObserverAlert`:{let t=Kh.ObserverAlert.parse(n),r=e[e.length-1];(r&&`text`in r?r.text:void 0)!==t.message&&e.push({id:by(),kind:`note`,icon:`zap`,text:t.message,alert:!0});break}case`DeliverableProduced`:{let t=Kh.DeliverableProduced.parse(n);e.push({id:by(),kind:`deliverable`,taskId:t.task_id,deliverableId:t.deliverable_id,description:t.description,preview:t.preview,path:t.path});break}case`ImageGenerated`:{let t=Kh.ImageGenerated.parse(n);e.push({id:by(),kind:`genimage`,path:t.path,prompt:t.prompt});break}case`A2UISurface`:{let t=Kh.A2UISurface.parse(n),r=e.find(e=>e.kind===`a2ui`&&e.surfaceId===t.surface_id);r||(r={id:by(),kind:`a2ui`,surfaceId:t.surface_id,component:{},data:{}},e.push(r));let i=t.component?._components;r.version=t.version,r.catalogId=t.catalog_id,r.title=t.title,r.intent=t.intent;let a=fb(t.component),o=pb(Array.isArray(i)?i:t.components);(a.component||o.length)&&(r.component=a,r.components=o),r.data=t.data??{},Rb(e);break}case`A2UISurfaceDataUpdated`:{let t=Kh.A2UISurfaceDataUpdated.parse(n),r=e.find(e=>e.kind===`a2ui`&&e.surfaceId===t.surface_id);r&&(r.data=t.data??{});break}case`A2UIActionSubmitted`:{let t=Kh.A2UIActionSubmitted.parse(n);xb(e),e.push({id:by(),kind:`note`,icon:`rotate-cw`,pending:!0,a2uiActionPending:!0,surfaceId:t.surface_id,text:``});break}case`A2UIMessageEvent`:lb(e,Kh.A2UIMessageEvent.parse(n).message)&&Rb(e);break;case`Attachment`:{let t=Kh.Attachment.parse(n);e.push({id:by(),kind:`attachment`,path:t.path,name:t.name});break}case`InquiryRaised`:{let t=Kh.InquiryRaised.parse(n);e.push({id:by(),kind:`inquiry`,inquiryId:t.inquiry_id,question:t.question,detail:t.detail??``,options:t.options??[],qkind:t.kind,resolved:!1});break}case`InquiryAnswered`:{let t=Kh.InquiryAnswered.parse(n),r=e.find(e=>e.kind===`inquiry`&&e.inquiryId===t.inquiry_id);r&&(r.resolved=!0,r.answer=t.answer,r.resolution=t.status||`answered`);break}case`TurnCancelled`:{let t=Kh.TurnCancelled.parse(n),r=e[e.length-1];r&&r.kind===`agent`&&r.streaming&&(r.streaming=!1),e.push({id:by(),kind:`note`,icon:`x`,text:t.reason||`Stopped`,ends:!0});break}case`TurnFailed`:{let t=Kh.TurnFailed.parse(n),r=e[e.length-1];r&&r.kind===`agent`&&r.streaming&&(r.streaming=!1),e.push({id:by(),kind:`note`,icon:`x`,text:t.error||`The turn failed unexpectedly.`,alert:!0,ends:!0});break}case`FeedbackGiven`:{let t=Kh.FeedbackGiven.parse(n);for(let n=e.length-1;n>=0;n--){let r=e[n];if(zb(r,t.target_kind,t.target_id)){r.feedback={sentiment:t.sentiment,reason:t.reason};break}}break}case`FeedbackCleared`:{let t=Kh.FeedbackGiven.parse(n);for(let n=e.length-1;n>=0;n--){let r=e[n];if(zb(r,t.target_kind,t.target_id)){r.feedback=null;break}}break}default:Pb(t)}}var Vb=null,Hb=null,Ub=!1,Wb=[],Gb=Wt({active:!1,status:`off`}),Kb=null,qb=!1,Jb=!1,Yb=null,Xb=null,Zb=600;function Qb(e){ts.update(t=>{let n=t.length>=Zb?t.slice(t.length-Zb+1):t;return[...n,{...e,_t:Date.now(),_id:(n.at(-1)?._id||0)+1}]})}function $b(e,t){ox(),Jb=!1,Ub=!0,Wb=[];let n=e===`run`?`task-run:`+t:t;Fo.set({id:t,kind:e,chat:n,items:[],busy:!1}),ts.set([]),Io.set(fo(n)),Vb=new ig(n,{onOpen:()=>{Ub=!0,Wb=[]},onEvent:e=>{if(Qb(e),!Jb){if(Ub){Fb(Wb,e);return}Fo.update(t=>(Fb(t.items,e),{...t,items:t.items,busy:Sb(t.items)}))}},onReady:()=>{if(!Ub)return;Ub=!1;let e=Wb;Wb=[],Fo.update(t=>({...t,items:e,busy:Sb(e)}))},onTurnEnd:()=>Fo.update(e=>({...e,busy:!1})),onQueued:e=>Fo.update(t=>(jb(t.items,e.text??``),{...t,items:t.items,busy:!0})),onError:e=>Fo.update(t=>(t.items.push({id:by(),kind:`note`,icon:`x`,text:e.message||`error`,alert:!0}),{...t,busy:!1}))}).connect(),e===`run`?(hx=!1,Vo.set(null),gx(t),Hb=setInterval(()=>gx(t),3e3)):Vo.set(null)}function ex(e,t=[]){if(!Vb||!e.trim()&&!t.length)return;Fo.update(e=>({...e,busy:!0}));let n=Kt(Fo),r=``,i=Kt(Io);if(i.chatId===n.chat){let e=ho(i);Io.set(e.state),r=e.model}Vb.send(e,t,r),n.kind===`chat`&&e.trim()&&Lo.update(t=>t.some(e=>e.chat_id===n.chat)?t:[{chat_id:n.chat,preview:e.trim().slice(0,80),updated:new Date().toISOString(),turns:0,title:``,starred:!1},...t])}function tx(){Vb&&Vb.cancel()}function nx(e,t){Vb&&Vb.answer(e,t)}function rx(e,t){Vb&&Vb.a2ui(e,t)}function ix({targetKind:e,targetId:t,sentiment:n,reason:r,content:i=``,request:a=``}){Vb&&Vb.feedback({target_kind:e,target_id:t,sentiment:n,reason:r,content:i,request:a})}function ax({targetKind:e,targetId:t}){Vb&&Vb.clearFeedback({target_kind:e,target_id:t})}function ox(){Kb&&=(Kb.stop(),null),qb=!1,Yb=null,Xb=null,Vb&&=(Vb.close(),null),Hb&&=(clearInterval(Hb),null)}function sx(){ox(),Fo.set({id:null,kind:`chat`,chat:``,items:[],busy:!1}),Io.set(uo),Lo.set([]),Ro.set([]),Vo.set(null),Uo.set([]),ts.set([]),Jo.set(null),Po.update(e=>e+1)}function cx(e){if(!(!e||e===hs()))try{sx(),Kt(js).aside?.kind===`file`&&Ws(),gs(e);let t=Kt(No).list.find(t=>t.id===e);t?.accent&&h(t.accent),No.update(t=>({...t,activeId:e})),Fs(`/`,e)}catch(t){console.warn(`[profile] in-place switch failed; falling back to reload`,t),location.assign(`/app/`+e+`/`+location.hash)}}function lx(e){Fo.update(t=>({...t,busy:e}))}function ux(e,t,n){Fo.update(r=>{if(n&&e===`user`)return Yb&&Xb===`user`?Yb.text=t:r.items.push({id:by(),kind:`user`,text:t,voice:!0}),Yb=null,Xb=null,{...r,items:r.items,busy:!0};if(Yb&&Xb===e)Yb.text+=t;else{let n=e===`user`?{id:by(),kind:`user`,text:t,voice:!0}:{id:by(),kind:`agent`,text:t,voice:!0};Yb=n,r.items.push(n),Xb=e}return{...r,items:r.items}})}async function dx(){let e=Kt(Fo);if(!e.id||qb)return;let t=Kt(Po),n=`?chat=`+encodeURIComponent(e.chat),r=16e3;try{r=(await Q.voices()).input_rate||16e3}catch{}Kt(Po)===t&&(qb=!0,Jb=!0,Yb=null,Xb=null,Gb.set({active:!0,status:`connecting`}),Kb=new og(n,{onState:(e,t)=>{e===`off`?fx():Gb.set({active:!0,status:t||e})},onTranscript:ux,onTurnEnd:()=>{Yb=null,Xb=null,lx(!1)},onEvent:e=>{Qb(e),Fo.update(t=>(Fb(t.items,e),{...t,items:t.items}))},onAudio:()=>lx(!1)},r),await Kb.start()||(qb=!1,Jb=!1,Gb.set({active:!1,status:`off`})))}function fx(){Kb=null,qb=!1,Yb=null,Xb=null,Gb.set({active:!1,status:`off`}),Fo.update(e=>({...e,busy:!1})),setTimeout(()=>{Jb=!1},2e3)}function px(){Kb&&Kb.stop()}var mx=new Set([`completed`,`failed`,`cancelled`]),hx=!1;async function gx(e){let t=Kt(Po),n;try{n=await Q.run(e)}catch{return}if(Kt(Po)!==t)return;let r=Kt(Fo);r.kind===`run`&&r.id===e&&(Vo.set(n),!hx&&n&&mx.has(n.status)&&(hx=!0,Q.runSeen(e).catch(()=>{})))}var _x=[{id:`research`,label:`Research`,icon:`search`},{id:`coding`,label:`Coding`,icon:`code`},{id:`scheduling`,label:`Scheduling`,icon:`clock`},{id:`writing`,label:`Writing`,icon:`file-text`},{id:`data`,label:`Data & reports`,icon:`list`},{id:`images`,label:`Images`,icon:`image`}],vx=e=>(_x.find(t=>t.id===e)||{label:e}).label,yx={openai:`OpenAI · Chat Completions`,openai_responses:`OpenAI · Responses`,openai_subscription:`OpenAI · ChatGPT subscription`,anthropic:`Anthropic`,gemini:`Gemini`,ollama:`Ollama`,claude_code:`Claude Code · CLI login`,codex:`Codex · CLI login`},bx=`Subscription — no API key`,xx=[bx,`OpenAI`,`Anthropic`,`Google`,`Ollama`],Sx={openai_subscription:bx,claude_code:bx,codex:bx,openai_responses:`OpenAI`,openai:`OpenAI`,anthropic:`Anthropic`,gemini:`Google`,ollama:`Ollama`},Cx={openai_subscription:`OAuth`,claude_code:`ACP`,codex:`ACP`,openai_responses:`API key`,openai:`API key`,anthropic:`API key`,gemini:`API key`,ollama:`no key`},wx={gemini:`Gemini`,openai:`OpenAI`},Tx={openai:`openai`,openai_responses:`openai`,openai_subscription:`openai`,anthropic:`anthropic`,gemini:`gemini`,ollama:`ollama`},Ex=[{id:`gemini-3.6-flash`,label:`Gemini 3.6 Flash`,provider:`gemini`,price:{in:.3,out:2.5},context:1e6,featured:!0},{id:`gemini-3.1-flash-lite`,label:`Gemini 3.1 Flash Lite`,provider:`gemini`,price:{in:.1,out:.4},context:1e6,featured:!0},{id:`gemini-3.1-pro-preview`,label:`Gemini 3.1 Pro Preview`,provider:`gemini`,price:{in:1.25,out:10},context:1e6,featured:!0},{id:`gpt-5.6-luna`,label:`GPT-5.6 Luna`,provider:`openai`,price:{in:.25,out:2},context:4e5,featured:!0},{id:`gpt-5.6-terra`,label:`GPT-5.6 Terra`,provider:`openai`,price:{in:1.25,out:10},context:4e5,featured:!0},{id:`gpt-5.6-sol`,label:`GPT-5.6 Sol`,provider:`openai`,price:{in:5,out:40},context:4e5,featured:!0},{id:`gpt-5.4-mini`,label:`GPT-5.4 Mini`,provider:`openai`,price:{in:.25,out:2},context:4e5,featured:!0},{id:`gpt-5.4-nano`,label:`GPT-5.4 Nano`,provider:`openai`,price:{in:.05,out:.4},context:4e5,featured:!0},{id:`claude-sonnet-5`,label:`Claude Sonnet 5`,provider:`anthropic`,price:{in:3,out:15},context:2e5,featured:!0},{id:`claude-haiku-4.5`,label:`Claude Haiku 4.5`,provider:`anthropic`,price:{in:1,out:5},context:2e5,featured:!0},{id:`claude-opus-4-8`,label:`Claude Opus 4.8`,provider:`anthropic`,price:{in:5,out:25},context:2e5,featured:!0},{id:`MiniMax-M2.5`,label:`MiniMax M2.5`,provider:`anthropic`,price:{in:.3,out:1.2},context:2e5,featured:!1},{id:`llama3.2`,label:`Llama 3.2`,provider:`ollama`,price:{in:0,out:0},context:128e3,featured:!0}];function Dx(e){return Tx[e]||``}function Ox(e){if(e)return Ex.find(t=>t.id===e)}function kx(e){let t=Dx(e);return t?Ex.filter(e=>e.provider===t):[]}function Ax(e){return kx(e).filter(e=>e.featured)}var jx=e=>e>=1?`$${e}`:`$${e.toFixed(2)}`;function Mx(e){let t=e?.price;return!t||typeof t.in!=`number`||typeof t.out!=`number`?``:!t.in&&!t.out?`Free`:`${jx(t.in)} / ${jx(t.out)} per M`}function Nx(e){let t=e?.context;return typeof t!=`number`||!t?``:`${t>=1e6?`${+(t/1e6).toFixed(1)}M`:`${Math.round(t/1e3)}K`} context`}var Px={claude:`@agentclientprotocol/claude-agent-acp`,codex:`@agentclientprotocol/codex-acp`},Fx={claude:`claude_code`,codex:`codex`};function Ix(e,t){let n=!!e&&typeof e==`object`,r=n&&e?.mode||`local`,i=r!==`bridge`||e?.connected!==!1,a=n?(e?.agents||[]).find(e=>e.name===t):null;return{loaded:n,mode:r,connected:i,available:n&&i&&!!a?.available}}function Lx(e,t){return e?.available?e.mode===`bridge`||!!t&&typeof t==`object`&&!t.reason:!1}function Rx(e,t,n){return t?.loaded?t.mode===`bridge`&&!t.connected?`The host ACP bridge is unreachable — check AG2ASSISTANT_ACP_BRIDGE for this container.`:t.available?t.mode===`bridge`?`Reached through the host ACP bridge. The model list can't be read from inside the container, so this runs on the CLI's own model.`:n===void 0||n===`loading`?``:n?.reason===`adapter_missing`?`Not installed: run npm i -g ${Px[e]}, then re-check.`:n?.reason?`The adapter is installed but didn't answer — check the CLI is logged in, then re-check.`:``:`Not installed: run npm i -g ${Px[e]} and log in to the CLI, then re-check.`:``}function zx(e){let t=typeof e==`object`?e?.current:``;return t?`CLI default (${t})`:`CLI default`}var Bx=/^(.+?)\s*\[([^\]]+)\]$/,Vx={minimal:`Minimal`,low:`Light`,medium:`Medium`,high:`High`,xhigh:`Extra High`,max:`Max`,ultra:`Ultra`};function Hx(e){let t=Bx.exec(e||``);return t?{family:t[1].trim(),effort:t[2].trim()}:{family:(e||``).trim(),effort:``}}function Ux(e,t){return e?t?`${e}[${t}]`:e:``}function Wx(e){return e?Vx[e]||e.charAt(0).toUpperCase()+e.slice(1):`Default`}function Gx(e,t){return(e||``).replace(/\s*\([^)]*\)\s*$/,``).trim()||t}function Kx(e){let t=[],n=new Map;for(let r of e||[]){let{family:e,effort:i}=Hx(r.id);if(!e)continue;let a=n.get(e);a||(a={family:e,label:Gx(r.name,e),efforts:[]},n.set(e,a),t.push(a)),i&&!a.efforts.some(e=>e.value===i)&&a.efforts.push({value:i,label:Wx(i)})}return t}var qx={plus:``,send:``,settings:``,folder:``,"folder-plus":``,paperclip:``,mic:``,search:``,sparkles:``,cpu:``,clock:``,check:``,"chevron-left":``,"chevron-right":``,"chevron-down":``,x:``,code:``,eye:``,sun:``,moon:``,contrast:``,image:``,"image-off":``,"file-x":``,"file-text":``,file:``,"file-code":``,"file-image":``,"file-spreadsheet":``,"file-archive":``,"file-play":``,"file-music":``,download:``,trash:``,list:``,message:``,bot:``,globe:``,brain:``,zap:``,"trending-up":``,"rotate-cw":``,"thumbs-up":``,"thumbs-down":``,users:``,archive:``,"alert-triangle":``,square:``,maximize:``,minimize:``,"maximize-2":``,"minimize-2":``,"arrow-up":``,waveform:``,copy:``,palette:``,"ellipsis-vertical":``,star:``,pencil:``,play:``,pause:``,"help-circle":``,slash:``,spinner:``},Jx=new Set([`$$slots`,`$$events`,`$$legacy`,`name`,`size`,`strokeWidth`]),Yx=Ri(``);function $(e,t){let n=ro(t,`size`,3,18),r=ro(t,`strokeWidth`,3,2),i=no(t,Jx);var a=Yx();Ua(a,()=>({xmlns:`http://www.w3.org/2000/svg`,width:n(),height:n(),viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":r(),"stroke-linecap":`round`,"stroke-linejoin":`round`,style:`display:inline-block;flex:none;vertical-align:middle`,"aria-hidden":`true`,...i,[Aa]:{spin:t.name===`spinner`}}),void 0,void 0,void 0,`svelte-13so817`),sa(a,()=>qx[t.name]||``,!0),D(a),U(e,a)}var Xx=H(``),Zx=H(`
Theme
`);function Qx(e,t){O(t,!0);let n=M(P(C())),r=[{id:`light`,label:`Light`,icon:`sun`},{id:`dark`,label:`Dark`,icon:`moon`},{id:`auto`,label:`Auto`,icon:`contrast`}];function i(e){N(n,e,!0),S(e)}hr(()=>{let e=e=>{N(n,e.detail.theme,!0)};return document.addEventListener(`ag2-theme-change`,e),()=>document.removeEventListener(`ag2-theme-change`,e)});var a=Zx(),o=R(F(a),2);K(o,21,()=>r,Qi,(e,t)=>{var r=Xx();let a;var o=F(r);$(o,{get name(){return B(t).icon},size:15});var s=R(o);D(r),z(()=>{a=q(r,1,`ap-theme svelte-1sms2nq`,null,a,{on:B(n)===B(t).id}),W(s,` ${B(t).label??``}`)}),V(`click`,r,()=>i(B(t).id)),U(e,r)}),D(o),D(a),U(e,a),k()}ki([`click`]);var $x=255,eS=e=>new TextEncoder().encode(e).length;function tS(e){return!e||!e.trim()?`Enter a folder name`:e===e.trim()?e.includes(`/`)||e.includes(`\\`)?`Name can't contain slashes`:e===`.`||e===`..`?`Not a valid folder name`:e.startsWith(`.`)?`Names starting with a dot are hidden and won't show here`:/[\x00-\x1f\x7f]/.test(e)?`Name contains invalid characters`:eS(e)>$x?`Name is too long`:null:`Name can't start or end with a space`}function nS(e,t=``){return e&&typeof e==`object`&&`message`in e&&e.message?String(e.message):t||String(e)}var rS=H(``),iS=H(``),aS=H(``),oS=H(`
`),sS=H(`
`),cS=H(`
Creating…
`),lS=H(`
Loading…
`),uS=H(`
`),dS=H(`
No sub-folders here.
`),fS=H(``),pS=H(`
`),mS=H(` Use this folder`,1),hS=H(``),gS=H(` Selected this folder`,1),_S=H(``),vS=H(`
`);function yS(e,t){O(t,!0);let n=ro(t,`roots`,19,()=>({})),r=ro(t,`start`,3,``),i=ro(t,`selected`,15,``),a=ro(t,`onUse`,3,null),o=ro(t,`busy`,3,!1),s=M(``),c=M(P([])),l=M(null),u=M(!1),d=M(``);async function f(e){N(u,!0),N(d,``);try{let t=await Q.listDirs(e||``);t.ok?(N(s,t.path,!0),N(c,t.dirs,!0),N(l,t.parent,!0)):N(d,t.error||`Could not open that folder`,!0)}catch(e){N(d,nS(e),!0)}N(u,!1)}io(()=>f(r()||n().cwd||n().home||``));let p=M(!1),m=M(!1),h=M(``),g=M(``);function _(){N(p,!0),N(h,``),N(g,``)}function v(){N(p,!1),N(h,``),N(g,``)}function y(e){e.focus()}async function b(e=!1){if(!B(p))return;let t=B(h),n=tS(t);if(n){e?v():N(g,n,!0);return}N(p,!1),N(m,!0);try{await f((await Q.makeDir(B(s),t)).path),N(h,``),N(g,``)}catch(e){N(g,nS(e),!0),N(p,!0)}N(m,!1)}var x=vS(),S=F(x),C=F(S);$(F(C),{name:`chevron-left`,size:15}),D(C);var w=R(C,2),T=L(w,!0),ee=R(w,2);$(F(ee),{name:`plus`,size:15}),D(ee),D(S);var te=R(S,2),ne=e=>{var t=oS(),r=F(t),i=e=>{var t=rS();V(`click`,t,()=>f(n().cwd)),U(e,t)};G(r,e=>{n().cwd&&e(i)});var a=R(r,2),o=e=>{var t=iS();V(`click`,t,()=>f(n().home)),U(e,t)};G(a,e=>{n().home&&e(o)});var s=R(a,2),c=e=>{var t=aS();V(`click`,t,()=>f(n().workspace)),U(e,t)};G(s,e=>{n().workspace&&e(c)}),D(t),U(e,t)};G(te,e=>{(n().cwd||n().home||n().workspace)&&e(ne)});var re=R(te,2),ie=F(re),ae=e=>{var t=sS(),n=F(t);$(n,{name:`folder`,size:15});var r=R(n,2);za(r),yr(()=>qa(r,()=>B(h),e=>N(h,e))),ua(r,e=>y?.(e)),D(t),V(`keydown`,r,e=>{e.key===`Enter`?(e.preventDefault(),b()):e.key===`Escape`?(e.preventDefault(),v()):N(g,``)}),Oi(`blur`,r,()=>b(!0)),U(e,t)};G(ie,e=>{B(p)&&e(ae)});var oe=R(ie,2),se=e=>{U(e,cS())},ce=e=>{U(e,lS())},le=e=>{var t=uS(),n=L(t,!0);z(()=>W(n,B(d))),U(e,t)},ue=e=>{U(e,dS())},de=e=>{var t=Bi();K(I(t),17,()=>B(c),e=>e.path,(e,t)=>{var n=fS(),r=F(n);$(r,{name:`folder`,size:15});var i=R(r),a=L(i,!0);$(R(i),{name:`chevron-right`,size:14}),D(n),z(()=>{J(n,`title`,B(t).path),W(a,B(t).name)}),V(`click`,n,()=>f(B(t).path)),U(e,n)}),U(e,t)};G(oe,e=>{B(m)?e(se):B(u)?e(ce,1):B(d)?e(le,2):!B(c).length&&!B(p)?e(ue,3):e(de,-1)}),D(re);var fe=R(re,2),E=e=>{var t=pS(),n=L(t,!0);z(()=>W(n,B(g))),U(e,t)};G(fe,e=>{B(g)&&e(E)});var pe=R(fe,2),me=e=>{var t=hS(),n=F(t),r=e=>{U(e,zi(`Saving…`))},i=e=>{var t=mS();$(I(t),{name:`check`,size:15}),tt(),U(e,t)};G(n,e=>{o()?e(r):e(i,-1)}),D(t),z(()=>t.disabled=!B(s)||o()),V(`click`,t,()=>a()(B(s))),U(e,t)},he=e=>{var t=_S();let n;var r=F(t),a=e=>{var t=gS();$(I(t),{name:`check`,size:15}),tt(),U(e,t)},o=e=>{U(e,zi(`Use this folder`))};G(r,e=>{B(s)&&i()===B(s)?e(a):e(o,-1)}),D(t),z(()=>{n=q(t,1,`fp-use`,null,n,{on:!!B(s)&&i()===B(s)}),t.disabled=!B(s)}),V(`click`,t,()=>i(B(s))),U(e,t)};G(pe,e=>{a()?e(me):e(he,-1)}),D(x),z(()=>{C.disabled=!B(l),J(w,`title`,B(s)),W(T,B(s)||`…`),ee.disabled=!B(s)||B(u)||B(m)||B(p)}),V(`click`,C,()=>f(B(l))),V(`click`,ee,_),U(e,x),k()}ki([`click`,`keydown`]);var bS=H(``),xS=H(`
`),SS=H(``),CS=H(`
Profile name
Colourits visual identity
`);function wS(e,t){O(t,!0);let n=ro(t,`claimed`,19,()=>[]),i=ro(t,`keepAccents`,19,()=>[]),a=ro(t,`initialName`,3,``),o=ro(t,`initialAccent`,3,null),s=ro(t,`submitLabel`,3,`Create profile`),c=ro(t,`busyLabel`,3,`Creating…`),l=ro(t,`onCancel`,3,null),u=ro(t,`cancelLabel`,3,`Cancel`),d=ro(t,`autofocus`,3,!0),f=j(()=>r.filter(e=>!n().includes(e.hex)||i().includes(e.hex))),p=M(P(fi(()=>a()))),m=M(P(fi(()=>o()||B(f)[0]&&B(f)[0].hex||r[0].hex))),h=M(!1),g=M(``),_=j(()=>!r.some(e=>e.hex===B(m)));hr(()=>{!B(_)&&!B(f).some(e=>e.hex===B(m))&&B(f).length&&N(m,B(f)[0].hex,!0)});function v(e){let t=e.currentTarget.value.toLowerCase();/^#[0-9a-f]{6}$/.test(t)&&N(m,t,!0)}async function y(){if(!(!B(p).trim()||B(h))){N(h,!0),N(g,``);try{await t.onSubmit({name:B(p).trim(),accent:B(m)})}catch(e){N(g,nS(e,`Could not save profile`),!0),N(h,!1)}}}var b=CS(),x=F(b),S=R(F(x),2),C=F(S);$(C,{name:`message`,size:15});var w=R(C,2);za(w),en(w,d()),D(S),D(x);var T=R(x,2),ee=R(F(T),2),te=F(ee);K(te,17,()=>B(f),e=>e.id,(e,t)=>{var n=bS();let r;var i=F(n),a=e=>{$(e,{name:`check`,size:13})};G(i,e=>{B(m)===B(t).hex&&e(a)}),D(n),z(()=>{r=q(n,1,`pf-dot svelte-5uf3hr`,null,r,{on:B(m)===B(t).hex}),xa(n,`--dot:${B(t).hex??``}`),J(n,`title`,B(t).label),J(n,`aria-label`,B(t).label)}),V(`click`,n,()=>N(m,B(t).hex,!0)),U(e,n)});var ne=R(te,2);let re;var ie=F(ne);za(ie),D(ne),D(ee);var ae=R(ee,2),oe=F(ae,!0),se=R(oe),ce=e=>{U(e,zi(`· custom`))};G(se,e=>{B(_)&&e(ce)}),D(ae),D(T);var le=R(T,2),ue=e=>{var t=xS(),n=F(t);$(n,{name:`x`,size:13});var r=R(n);D(t),z(()=>W(r,` ${B(g)??``}`)),U(e,t)};G(le,e=>{B(g)&&e(ue)});var de=R(le,2),fe=F(de),E=e=>{var t=SS(),n=L(t,!0);z(()=>W(n,u())),V(`click`,t,function(...e){l()?.apply(this,e)}),U(e,t)};G(fe,e=>{l()&&e(E)});var pe=R(fe,2),me=F(pe);$(R(me),{name:`chevron-right`,size:16}),D(pe),D(de),D(b),z(e=>{re=q(ne,1,`pf-dot pf-custom rainbow svelte-5uf3hr`,null,re,{on:B(_)}),Ba(ie,B(m)),W(oe,B(m)),pe.disabled=e,W(me,`${(B(h)?c():s())??``} `)},[()=>!B(p).trim()||B(h)]),V(`keydown`,w,e=>e.key===`Enter`&&y()),qa(w,()=>B(p),e=>N(p,e)),V(`input`,ie,v),V(`click`,pe,y),U(e,b),k()}ki([`keydown`,`click`,`input`]);var TS=`data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20width='90'%20height='50'%20fill='none'%3e%3cpath%20fill='%23000001'%20d='M69.285%200h-3.232v3.232h3.232V0Zm-3.232%2016.095h-3.21v6.442h3.21v-6.442Zm0-12.863h-3.21v3.21h3.21v-3.21Zm-3.21%209.652h-3.21v3.21h3.21v-3.21Zm0-6.442h-3.21v3.232h3.21V6.442Zm-3.211%203.232H53.19v3.21h6.442v-3.21ZM53.19%206.442H37.095v3.232H53.19V6.442Zm6.442%2019.305v-6.42h-3.231v-3.232H33.885v3.232h-3.232v6.42h28.98Zm-9.652-6.42h3.21v3.21h-3.21v-3.21Zm-12.885%200h3.21v3.21h-3.21v-3.21Zm0-9.653h-6.442v3.21h6.442v-3.21Zm-6.442%203.21h-3.21v3.21h3.21v-3.21Zm0-6.442h-3.21v3.232h3.21V6.442Zm-3.211%209.653h-3.21v6.442h3.21v-6.442Zm0-12.863h-3.21v3.21h3.21v-3.21ZM24.232%200H21v3.232h3.232V0Z'%3e%3c/path%3e%3cpath%20fill='%23000'%20d='M65.867%2037.748V34.33H55.615v-3.418h10.252v3.418h3.418v3.417h-3.418Zm-6.834%203.417v-3.417h6.834v3.417h-6.834ZM55.615%2048v-6.835h3.418v3.418h10.252V48h-13.67Zm-13.89-13.67v-3.417h10.252v3.418H41.725Zm-3.417%2010.253V34.33h3.417v10.252h-3.417Zm10.252%200v-3.418h-3.417v-3.417h6.834v6.835H48.56ZM41.725%2048v-3.417h6.835V48h-6.835ZM21%2048V34.33h3.417v-3.417h6.835v3.418h3.418V48h-3.418v-6.835h-6.835V48H21Zm3.417-10.252h6.835v-3.28h-6.835v3.28Z'%3e%3c/path%3e%3c/svg%3e`,ES=`data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20width='90'%20height='50'%20fill='none'%3e%3cpath%20fill='%23ffffff'%20d='M69.285%200h-3.232v3.232h3.232V0Zm-3.232%2016.095h-3.21v6.442h3.21v-6.442Zm0-12.863h-3.21v3.21h3.21v-3.21Zm-3.21%209.652h-3.21v3.21h3.21v-3.21Zm0-6.442h-3.21v3.232h3.21V6.442Zm-3.211%203.232H53.19v3.21h6.442v-3.21ZM53.19%206.442H37.095v3.232H53.19V6.442Zm6.442%2019.305v-6.42h-3.231v-3.232H33.885v3.232h-3.232v6.42h28.98Zm-9.652-6.42h3.21v3.21h-3.21v-3.21Zm-12.885%200h3.21v3.21h-3.21v-3.21Zm0-9.653h-6.442v3.21h6.442v-3.21Zm-6.442%203.21h-3.21v3.21h3.21v-3.21Zm0-6.442h-3.21v3.232h3.21V6.442Zm-3.211%209.653h-3.21v6.442h3.21v-6.442Zm0-12.863h-3.21v3.21h3.21v-3.21ZM24.232%200H21v3.232h3.232V0Z'%3e%3c/path%3e%3cpath%20fill='%23ffffff'%20d='M65.867%2037.748V34.33H55.615v-3.418h10.252v3.418h3.418v3.417h-3.418Zm-6.834%203.417v-3.417h6.834v3.417h-6.834ZM55.615%2048v-6.835h3.418v3.418h10.252V48h-13.67Zm-13.89-13.67v-3.417h10.252v3.418H41.725Zm-3.417%2010.253V34.33h3.417v10.252h-3.417Zm10.252%200v-3.418h-3.417v-3.417h6.834v6.835H48.56ZM41.725%2048v-3.417h6.835V48h-6.835ZM21%2048V34.33h3.417v-3.417h6.835v3.418h3.418V48h-3.418v-6.835h-6.835V48H21Zm3.417-10.252h6.835v-3.28h-6.835v3.28Z'%3e%3c/path%3e%3c/svg%3e`,DS=H(`
`),OS=H(``),kS=H(`
`,1),AS=H(`

Hello — ready when you are.

Setup takes about a minute. You'll connect a model, create a profile or two, and you're off. Nothing leaves your machine — keys and settings stay local.

First, what should I call you?so I can greet you properly
`,1),jS=H(`

About you

A few optional details so every profile knows you. Shared across all profiles — helps every profile know you. All optional.

Where are you based?city & country
Usual working hours?e.g. 9-5 weekdays
How do you like your answers?e.g. short and direct
`,1),MS=H(``),NS=H(`
`),PS=H(`
`,1),FS=H(`

Complete sign-in in the opened tab. - Headless?

`,1),IS=H(`

Runs on your ChatGPT Plus/Pro quota. OpenAI doesn't officially support this — your account could be rate-limited.

`,1),LS=H(`
Assistant model
`),RS=H(`
Sign in with your ChatGPT subscriptionno API key · unofficial
`,1),zS=H(`

`),BS=H(`

`),VS=H(``),HS=H(``),US=H(`
Assistant model
`),WS=H(`
Reasoninghow hard it thinks
`),GS=H(`
Assistant model
`,1),KS=H(`
`,1),qS=H(`
Assistant model
`,1),JS=H(`

Connect a model

optional

Add a provider key — or skip keys entirely and run on a subscription you already have: your ChatGPT login, or the Claude Code / Codex CLI. Whatever you choose is stored locally and shared across all your profiles. You can skip this step and connect later in Settings → Models.

`,1),YS=H(` `),XS=H(`
`),ZS=H(`
`),QS=H(`

Create your profiles

A profile is a colour-coded, isolated workspace — its own chats, tasks, memory, and files. Create one now (e.g. Work), and add more like Personal for day-one separation.

`,1),$S=H(` `),eC=H(``),tC=H(`

Give this profile a folder to work in and tell it what you'll use it for. Both are optional — you can change them anytime in Settings.

Folderthe assistant gets read access — manage access later in Settings → Folders
What can I help with?pick any that fit
`,1),nC=H(`

Set up your profiles

No profiles to set up. Go back and create one first.

`,1),rC=H(`
`),iC=H(`

Your preferences are saved to Settings. Let's get to work.

Model
Appearanceshared across all profiles
Every action runs on the AG2 Stream — toggle AG2 view anytime to watch it live.
`,1),aC=H(`
`),oC=H(`You can connect a model later in Settings → Models`),sC=H(`Create a profile to continue`),cC=H(` `,1),lC=H(``),uC=H(``),dC=H(`
`),fC=H(`
`);function pC(e,t){O(t,!0);let n=()=>A(ds,`$profile`,i),r=()=>A(No,`$profiles`,i),[i,a]=Zt(),o=ro(t,`fresh`,3,!1),s=ro(t,`onComplete`,3,null),c=[`Welcome`,`About you`,`Connect`,`Profiles`,`Set up`,`Ready`],l=[{icon:`zap`,title:`Powered by AG2`,desc:`A universal agent runtime — the open-source framework behind every reply.`},{icon:`globe`,title:`Acts, not just answers`,desc:`Searches the web, runs code, generates images, and manages scheduled tasks.`},{icon:`brain`,title:`Remembers what matters`,desc:`Builds a private memory of your preferences so it gets more helpful over time.`}],u={gemini:`Gemini`,openai:`OpenAI`,anthropic:`Anthropic`},d=e=>Ax(e).map(t=>({label:`${u[e]} · ${t.label}`,provider:e,model:t.id})),f=[...d(`gemini`),...d(`openai`),...d(`anthropic`)],p=[{id:`gemini`,label:`Gemini`,keyId:`gemini`,hint:`recommended`,models:d(`gemini`)},{id:`openai`,label:`OpenAI`,keyId:`openai`,hint:`optional`,models:d(`openai`)},{id:`claude`,label:`Claude`,keyId:`anthropic`,hint:`optional`,models:d(`anthropic`)},{id:`oauth`,label:`ChatGPT`,oauth:!0,hint:`no API key · unofficial`},{id:`claude_code`,label:`Claude Code`,cli:`claude`,hint:`no API key · CLI login`},{id:`codex`,label:`Codex`,cli:`codex`,hint:`no API key · CLI login`}],m=M(0),g=P({gemini:``,openai:``,anthropic:``}),_=M(P(p[0].id)),v=M(P(f[0].label)),y=j(()=>p.find(e=>e.id===B(_))||p[0]);function b(e){N(_,e,!0);let t=p.find(t=>t.id===e);t?.oauth?B(ee)?.signed_in&&N(v,T.label,!0):t?.cli||t?.models?.length&&N(v,t.models[0].label,!0)}let x=M(P(n().name||``)),S=P({location:``,hours:``,style:``}),C=M(!1),w=M(P({})),T={label:`OpenAI · gpt-5.6-terra (ChatGPT subscription)`,provider:`openai`,model:`gpt-5.6-terra`,auth:`subscription`},ee=M(null),te=M(!1),ne=M(``),re=M(``),ie=M(!1),ae=null,oe=j(()=>B(ee)?.signed_in?[...f,T]:f),se=M(null),ce=M(P({})),le=P({claude:``,codex:``}),ue=j(()=>B(y).cli?Ix(B(se),B(y).cli):null),de=j(()=>B(y).cli?B(ce)[B(y).cli]:void 0),fe=j(()=>!!B(y).cli&&(!B(ue)?.loaded||B(de)===`loading`)),E=j(()=>typeof B(de)==`object`?B(de):null),pe=j(()=>B(E)?.models??[]),me=j(()=>!!B(y).cli&&Lx(B(ue),B(de))),he=j(()=>B(y).cli?Rx(B(y).cli,B(ue),B(de)):``);function ge(e,t=!1){B(ce)[e]=`loading`,Q.codingModels(e,t).then(t=>{B(ce)[e]={models:t.models,current:t.current,reason:t.reason}}).catch(()=>{B(ce)[e]={models:[],current:``,reason:`probe_failed`}})}async function _e(e){try{N(se,await Q.codingAgents(),!0)}catch{}let t=Ix(B(se),e);if(t.available&&t.mode===`local`)ge(e,!0);else{let{[e]:t,...n}=B(ce);N(ce,n,!0)}}hr(()=>{let e=B(y).cli;e&&B(ue)?.available&&B(ue).mode===`local`&&B(ce)[e]===void 0&&ge(e)});let ve=j(()=>B(y).cli===`codex`?Kx(B(pe)):[]),ye=j(()=>Hx(le.codex)),be=j(()=>B(ve).find(e=>e.family===B(ye).family)?.efforts||[]);function xe(e){let t=(B(ve).find(t=>t.family===e)?.efforts||[]).some(e=>e.value===B(ye).effort)?B(ye).effort:``;le.codex=Ux(e,t)}io(async()=>{try{N(ee,await Q.codexStatus(),!0)}catch{}try{N(se,await Q.codingAgents(),!0)}catch{N(se,{mode:`local`,connected:!0,agents:[]},!0)}}),ao(()=>{ae&&clearInterval(ae)});async function Se(){try{let e=await Q.codexLoginUrl();N(ne,e.state,!0),window.open(e.auth_url,`_blank`),N(te,!0),ae=setInterval(async()=>{let e=await Q.codexStatus();e.signed_in&&(ae&&clearInterval(ae),ae=null,N(te,!1),N(ee,e,!0),N(v,T.label,!0))},2e3)}catch{}}async function Ce(){if(!(!B(re).trim()||!B(ne)))try{await Q.codexSubmit(B(ne),B(re).trim()),N(re,``),N(ie,!1),N(te,!1),ae&&=(clearInterval(ae),null),N(ee,await Q.codexStatus(),!0),B(ee).signed_in&&N(v,T.label,!0)}catch{}}let we=M(P([...r().list])),Te=M(!0),Ee=j(()=>B(we).map(e=>e.accent)),De=M(0),Oe=M(P({})),ke=M(``),Ae=M(P([])),je=j(()=>B(we)[B(De)]||null);async function Me(e){if(!(Object.keys(B(w)).length||!e))try{let t=await Q.forProfile(e).settings();N(w,t.fs,!0)}catch{}}function Ne(e){N(De,e,!0);let t=B(we)[e],n=t?B(Oe)[t.id]:void 0;N(ke,n?.folder||``,!0),N(Ae,n?.focuses?[...n.focuses]:[],!0),Me(t?.id)}let Pe=e=>N(Ae,B(Ae).includes(e)?B(Ae).filter(t=>t!==e):[...B(Ae),e],!0),Fe=j(()=>!!(g.gemini.trim()||g.openai.trim()||g.anthropic.trim())),Ie=j(()=>B(Fe)||!!B(ee)?.signed_in||B(me)),Le=j(()=>B(m)!==3||B(we).length>0),Re=()=>{if(B(m)===4&&B(De)>0){Ne(B(De)-1);return}N(m,Math.max(B(m)-1,0),!0)},ze=()=>Be();function Be(){if(B(m)===3){N(m,4),Ne(0);return}N(m,Math.min(B(m)+1,c.length-1),!0)}async function Ve(e=!1){let t=B(je);if(t&&(N(Oe,{...B(Oe),[t.id]:{folder:B(ke),focuses:[...B(Ae)]}},!0),!e)){let e=Q.forProfile(t.id);if(B(ke))try{let e=null;try{e=(await Q.createFolder(B(ke))).folder}catch(t){let n=t instanceof ug&&t.status===409?G_.safeParse(t.body):null;if(!n?.success)throw t;e=n.data.existing}e&&await Q.setGrant(e.id,t.id,`read`)}catch{}try{await e.setFocuses(B(Ae))}catch{}}B(De){N(Te,!0)};function We(){if(B(y).cli){if(!B(me))return null;let e=Fx[B(y).cli];return{name:yx[e],type:e,model:le[B(y).cli]||``}}if(B(y).oauth&&!B(ee)?.signed_in||B(y).keyId&&!g[B(y).keyId].trim())return null;let e=B(oe).find(e=>e.label===B(v));if(!e)return null;let t=e.auth===`subscription`?`openai_subscription`:e.provider===`openai`?`openai_responses`:e.provider;return{name:e.label,type:t,model:e.model}}let Ge=j(()=>We()?.name||``);async function Ke(){N(C,!0);try{for(let[e,t]of Object.entries(g))if(t.trim())try{await Q.setKey(e,t.trim())}catch{}let e=We();if(e)try{await Q.saveLlmConfig({...e,activate:!0})}catch{}let t={name:B(x).trim(),location:S.location.trim(),hours:S.hours.trim(),style:S.style.trim()};if(Object.values(t).some(e=>e))try{await Q.setIdentity(t)}catch{}try{await Q.setOnboarded()}catch{}}finally{Xt(ds,{name:B(x).trim()}),Xt(us,!1),N(C,!1),o()&&s()&&s()(B(we)[0]?.id||null)}}var qe=fC(),Je=F(qe),Ye=F(Je),Xe=F(Ye),Ze=R(Xe,2);tt(2),D(Ye);var Qe=R(Ye,4);K(Qe,21,()=>l,Qi,(e,t,n)=>{var r=DS();xa(r,`--i:${n}`);var i=F(r);$(F(i),{get name(){return B(t).icon},size:17}),D(i);var a=R(i,2),o=F(a),s=L(o,!0),c=L(R(o,2),!0);D(a),D(r),z(()=>{W(s,B(t).title),W(c,B(t).desc)}),U(e,r)}),D(Qe),D(Je);var $e=R(Je,2),et=F($e);K(et,21,()=>c,Qi,(e,t,n)=>{var r=kS(),i=I(r);let a;var o=F(i);let s;var l=F(o),u=e=>{$(e,{name:`check`,size:12})},d=e=>{var t=zi();t.nodeValue=n+1,U(e,t)};G(l,e=>{n{U(e,OS())};G(p,e=>{n{a=q(i,1,`onb-stepitem svelte-13krnjv`,null,a,{active:n===B(m)}),s=q(o,1,`onb-stepnum svelte-13krnjv`,null,s,{done:nB(m),e=>{var t=aC(),n=F(t),r=e=>{var t=AS(),n=R(I(t),4),r=R(F(n),2),i=F(r);$(i,{name:`message`,size:15});var a=R(i,2);za(a),D(r),D(n);var o=R(n,2),s=F(o);$(R(F(s)),{name:`chevron-right`,size:17}),D(s),D(o),V(`keydown`,a,e=>e.key===`Enter`&&ze()),qa(a,()=>B(x),e=>N(x,e)),V(`click`,s,ze),U(e,t)},i=e=>{var t=jS(),n=R(I(t),4),r=R(F(n),2),i=F(r);$(i,{name:`globe`,size:15});var a=R(i,2);za(a),D(r),D(n);var o=R(n,2),s=R(F(o),2),c=F(s);$(c,{name:`clock`,size:15});var l=R(c,2);za(l),D(s),D(o);var u=R(o,2),d=R(F(u),2),f=F(d);$(f,{name:`message`,size:15});var p=R(f,2);za(p),D(d),D(u),qa(a,()=>S.location,e=>S.location=e),qa(l,()=>S.hours,e=>S.hours=e),qa(p,()=>S.style,e=>S.style=e),U(e,t)},a=e=>{var t=JS(),n=R(I(t),4);K(n,21,()=>p,Qi,(e,t)=>{var n=MS();let r;var i=L(n,!0);z(()=>{r=q(n,1,`onb-tab svelte-13krnjv`,null,r,{on:B(_)===B(t).id}),J(n,`aria-selected`,B(_)===B(t).id),W(i,B(t).label)}),V(`click`,n,()=>b(B(t).id)),U(e,n)}),D(n);var r=R(n,2),i=F(r),a=e=>{var t=RS(),n=I(t),r=R(F(n),2),i=e=>{var t=NS(),n=F(t);$(n,{name:`check`,size:15});var r=L(R(n,2));D(t),z(()=>W(r,`Signed in with ChatGPT${B(ee).account_id?` · `+B(ee).account_id:``}`)),U(e,t)},a=e=>{var t=IS(),n=I(t),r=F(n);$(r,{name:`sparkles`,size:14});var i=R(r);D(n);var a=R(n,2),o=e=>{var t=FS(),n=I(t),r=R(F(n));D(n);var i=R(n,2),a=e=>{var t=PS(),n=I(t),r=F(n);$(r,{name:`settings`,size:15});var i=R(r,2);za(i),D(n);var a=R(n,2);qa(i,()=>B(re),e=>N(re,e)),V(`click`,a,Ce),U(e,t)};G(i,e=>{B(ie)&&e(a)}),V(`click`,r,()=>N(ie,!B(ie))),U(e,t)};G(a,e=>{B(te)&&e(o)}),tt(2),z(()=>W(i,` ${B(te)?`Waiting for ChatGPT…`:`Sign in with ChatGPT`}`)),V(`click`,n,Se),U(e,t)};G(r,e=>{B(ee)?.signed_in?e(i):e(a,-1)}),D(n);var o=R(n,2),s=e=>{var t=LS(),n=R(F(t),2),r=L(F(n),!0);D(n),D(t),z(()=>W(r,T.label)),U(e,t)};G(o,e=>{B(ee)?.signed_in&&e(s)}),U(e,t)},o=e=>{let t=j(()=>B(y).cli);var n=KS(),r=I(n),i=F(r),a=F(i),o=L(a),s=L(R(a,2),!0);D(i);var c=R(i,2),l=e=>{var t=zS(),n=L(t);z(()=>W(n,`Checking the ${B(y).label??``} adapter…`)),U(e,t)},u=e=>{var t=NS(),n=F(t);$(n,{name:`check`,size:15});var r=L(R(n,2),!0);D(t),z(()=>W(r,B(ue)?.mode===`bridge`?`Reachable through the host ACP bridge`:`Adapter answered — running on your CLI login`)),U(e,t)};G(c,e=>{B(fe)?e(l):B(me)&&e(u,1)});var d=R(c,2),f=e=>{var t=BS();let n;var r=L(t,!0);z(()=>{n=q(t,1,`hint svelte-13krnjv`,null,n,{warn:!B(me)}),W(r,B(he))}),U(e,t)};G(d,e=>{B(he)&&e(f)});var p=R(d,2),m=e=>{var n=VS();V(`click`,n,()=>_e(B(t))),U(e,n)};G(p,e=>{B(fe)||e(m)}),D(r);var h=R(r,2),g=e=>{var t=US(),n=R(F(t),2),r=F(n);let i;var a=L(r,!0);K(R(r,2),17,()=>B(pe),Qi,(e,t)=>{var n=HS();let r;var i=L(n,!0);z(()=>{r=q(n,1,`onb-pill svelte-13krnjv`,null,r,{on:le.claude===B(t).id}),W(i,B(t).name||B(t).id)}),V(`click`,n,()=>le.claude=B(t).id),U(e,n)}),D(n),D(t),z(e=>{i=q(r,1,`onb-pill svelte-13krnjv`,null,i,{on:!le.claude}),W(a,e)},[()=>zx(B(de))]),V(`click`,r,()=>le.claude=``),U(e,t)},_=e=>{var t=GS(),n=I(t),r=R(F(n),2),i=F(r);let a;var o=L(i,!0);K(R(i,2),17,()=>B(ve),Qi,(e,t)=>{var n=HS();let r;var i=L(n,!0);z(()=>{r=q(n,1,`onb-pill svelte-13krnjv`,null,r,{on:B(ye).family===B(t).family}),W(i,B(t).label)}),V(`click`,n,()=>xe(B(t).family)),U(e,n)}),D(r),D(n);var s=R(n,2),c=e=>{var t=WS(),n=R(F(t),2),r=F(n);let i;var a=L(r,!0);K(R(r,2),17,()=>B(be),Qi,(e,t)=>{var n=HS();let r;var i=L(n,!0);z(()=>{r=q(n,1,`onb-pill svelte-13krnjv`,null,r,{on:B(ye).effort===B(t).value}),W(i,B(t).label)}),V(`click`,n,()=>le.codex=Ux(B(ye).family,B(t).value)),U(e,n)}),D(n),D(t),z(e=>{i=q(r,1,`onb-pill svelte-13krnjv`,null,i,{on:!B(ye).effort}),W(a,e)},[()=>Wx(``)]),V(`click`,r,()=>le.codex=Ux(B(ye).family,``)),U(e,t)};G(s,e=>{B(be).length&&e(c)}),z(e=>{a=q(i,1,`onb-pill svelte-13krnjv`,null,a,{on:!le.codex}),W(o,e)},[()=>zx(B(de))]),V(`click`,i,()=>le.codex=``),U(e,t)};G(h,e=>{B(me)&&B(y).cli===`claude`?e(g):B(me)&&B(y).cli===`codex`&&e(_,1)}),z(()=>{W(o,`Run on your ${B(y).label??``} CLI`),W(s,B(y).hint)}),U(e,n)},s=e=>{let t=j(()=>B(y).keyId);var n=qS(),r=I(n),i=F(r),a=F(i),o=L(a),s=L(R(a),!0);D(i);var c=R(i,2),l=F(c);$(l,{name:`settings`,size:15});var u=R(l,2);za(u),D(c),D(r);var d=R(r,2),f=R(F(d),2);K(f,21,()=>B(y).models??[],Qi,(e,t)=>{var n=HS();let r;var i=L(n,!0);z(()=>{r=q(n,1,`onb-pill svelte-13krnjv`,null,r,{on:B(v)===B(t).label}),W(i,B(t).label)}),V(`click`,n,()=>N(v,B(t).label,!0)),U(e,n)}),D(f),D(d),z(()=>{W(o,`${B(y).label??``} API key`),W(s,B(y).hint)}),qa(u,()=>g[B(t)],e=>g[B(t)]=e),U(e,n)};G(i,e=>{B(y).oauth?e(a):B(y).cli?e(o,1):B(y).keyId&&e(s,2)}),D(r),U(e,t)},o=e=>{var t=QS(),n=R(I(t),4),r=e=>{var t=XS();K(t,21,()=>B(we),e=>e.id,(e,t)=>{var n=YS(),r=R(F(n),1,!0);D(n),z(()=>{xa(n,`--dot:${B(t).accent??``}`),W(r,B(t).name)}),U(e,n)}),D(t),U(e,t)};G(n,e=>{B(we).length&&e(r)});var i=R(n,2),a=e=>{{let t=j(()=>B(we).length?`Add profile`:`Create profile`);wS(e,{get claimed(){return B(Ee)},get submitLabel(){return B(t)},busyLabel:`Creating…`,onSubmit:He})}},o=e=>{var t=ZS(),n=F(t);$(F(n),{name:`plus`,size:15}),tt(),D(n),D(t),V(`click`,n,Ue),U(e,t)};G(i,e=>{B(Te)?e(a):e(o,-1)}),U(e,t)},s=e=>{var t=Bi(),n=I(t),r=e=>{var t=tC(),n=I(t),r=F(n),i=R(r,2),a=L(i),o=R(i,2),s=e=>{var t=$S(),n=L(t);z(()=>W(n,`${B(De)+1} of ${B(we).length??``}`)),U(e,t)};G(o,e=>{B(we).length>1&&e(s)}),D(n);var c=R(n,4),l=R(F(c),2);{let e=j(()=>B(ke)||B(w).cwd);yS(l,{get roots(){return B(w)},get start(){return B(e)},get selected(){return B(ke)},set selected(e){N(ke,e,!0)}})}D(c);var u=R(c,2),d=R(F(u),2);K(d,21,()=>_x,Qi,(e,t)=>{var n=eC();let r;var i=F(n);$(i,{get name(){return B(t).icon},size:14});var a=R(i);D(n),z(e=>{r=q(n,1,`onb-pill svelte-13krnjv`,null,r,{on:e}),W(a,` ${B(t).label??``}`)},[()=>B(Ae).includes(B(t).id)]),V(`click`,n,()=>Pe(B(t).id)),U(e,n)}),D(d),D(u),z(()=>{xa(r,`--dot:${B(je).accent??``}`),W(a,`Set up ${B(je).name??``}`)}),U(e,t)},i=e=>{var t=nC();tt(2),U(e,t)};G(n,e=>{B(je)?e(r):e(i,-1)}),U(e,t)},c=e=>{var t=iC(),n=I(t),r=F(n);$(F(r),{name:`check`,size:26}),D(r);var i=R(r,2),a=L(F(i),!0);tt(2),D(i),D(n);var o=R(n,2),s=F(o),c=F(s);$(F(c),{name:`cpu`,size:16}),D(c);var l=L(R(c,2),!0);D(s),D(o);var u=R(o,2);K(u,21,()=>B(we),e=>e.id,(e,t)=>{let n=j(()=>B(Oe)[B(t).id]);var r=rC(),i=F(r),a=R(i,2),o=L(a,!0),s=R(a,2),c=F(s),l=F(c);$(l,{name:`folder`,size:13});var u=R(l);D(c);var d=R(c,2),f=F(d);$(f,{name:`sparkles`,size:13});var p=R(f);D(d),D(s),D(r),z(e=>{xa(i,`--dot:${B(t).accent??``}`),W(o,B(t).name),W(u,` ${(B(n)?.folder||`—`)??``}`),W(p,` ${e??``}`)},[()=>B(n)?.focuses.length?B(n).focuses.map(vx).join(`, `):`—`]),U(e,r)}),D(u);var d=R(u,2);Qx(R(F(d),2),{}),D(d);var f=R(d,2);$(F(f),{name:`zap`,size:14}),tt(),D(f),z(e=>{W(a,e),W(l,B(Ge)||`Not connected — add one in Settings → Models`)},[()=>B(x).trim()?`You're all set, ${B(x).trim()}.`:`You're all set.`]),U(e,t)};G(n,e=>{B(m)===0?e(r):B(m)===1?e(i,1):B(m)===2?e(a,2):B(m)===3?e(o,3):B(m)===4?e(s,4):e(c,-1)}),D(t),U(e,t)}),D(nt);var it=R(nt,2),at=e=>{var t=dC(),n=F(t);$(F(n),{name:`chevron-left`,size:16}),tt(),D(n);var r=R(n,2),i=F(r),a=e=>{U(e,oC())};G(i,e=>{B(m)===2&&!B(Ie)&&e(a)});var o=R(i,2),s=e=>{U(e,sC())};G(o,e=>{B(m)===3&&!B(we).length&&e(s)});var l=R(o,2),u=e=>{var t=cC(),n=I(t),r=R(n,2),i=F(r);$(R(i),{name:`chevron-right`,size:16}),D(r),z(()=>{n.disabled=B(C),r.disabled=B(C)||!B(je),W(i,`${B(De)Ve(!0)),V(`click`,r,()=>Ve(!1)),U(e,t)},d=e=>{var t=lC(),n=F(t);$(R(n),{name:`chevron-right`,size:16}),D(t),z(()=>{t.disabled=!B(Le),W(n,`${B(m)===2&&!B(Ie)?`Skip for now`:`Continue`} `)}),V(`click`,t,Be),U(e,t)},f=e=>{var t=uC();$(R(F(t)),{name:`send`,size:15}),D(t),z(()=>t.disabled=B(C)),V(`click`,t,Ke),U(e,t)};G(l,e=>{B(m)===4?e(u):B(m){B(m)>0&&e(at)}),D($e),D(qe),z(()=>{J(Xe,`src`,TS),J(Ze,`src`,ES),rt=q(nt,1,`onb-body svelte-13krnjv`,null,rt,{center:B(m)===0})}),U(e,qe),k(),a()}ki([`keydown`,`click`]);var mC=H(`
`);function hC(e,t){O(t,!0);let n=ro(t,`side`,3,`right`),r=ro(t,`width`,3,is),i=ro(t,`clamp`,3,co),a=M(!1);function o(e){t.onGrab?.(),N(a,!0),e.currentTarget.setPointerCapture(e.pointerId),e.preventDefault()}function s(e){if(!B(a))return;if(e.buttons===0){c(e);return}let t=n()===`left`?e.clientX:window.innerWidth-e.clientX;r().set(i()(t))}function c(e){N(a,!1),e.currentTarget.releasePointerCapture?.(e.pointerId)}var l=mC();let u;z(()=>u=q(l,1,`rail-resizer`,null,u,{dragging:B(a),left:n()===`left`})),V(`pointerdown`,l,o),V(`pointermove`,l,s),V(`pointerup`,l,c),Oi(`pointercancel`,l,c),U(e,l),k()}ki([`pointerdown`,`pointermove`,`pointerup`]);var gC=Wt({folders:[],loaded:!1});async function _C(){try{let e=await Q.folders();gC.set({folders:e.folders||[],loaded:!0})}catch{gC.set({folders:[],loaded:!0})}}function vC(e){return gC.set({folders:e&&e.folders||[],loaded:!0}),e}var yC=H(`
`);function bC(e,t){O(t,!0);let n=ro(t,`disabled`,3,!1),r=e=>e===`read_write`?`Read + write`:e===`read`?`Read`:`Off`,i=e=>e===`read_write`?1:e===`read`?0:2,a=e=>e===`read`?`read_write`:e===`read_write`?null:`read`,o=j(()=>i(t.mode));var s=yC(),c=F(s);let l;var u=L(c,!0),d=R(c,2);let f;D(s),z((e,t)=>{l=q(c,1,`sw3label svelte-abh25a`,null,l,{muted:B(o)===2}),W(u,e),f=q(d,1,`sw3 svelte-abh25a`,null,f,{off:B(o)===2,rw:B(o)===1}),J(d,`data-pos`,B(o)),J(d,`aria-label`,t),d.disabled=n()},[()=>r(t.mode),()=>`Access: ${r(t.mode)} — click to change`]),V(`click`,d,()=>t.onchange?.(a(t.mode))),U(e,s),k()}ki([`click`]);var xC=H(`
`);function SC(e,t){O(t,!0);let n=ro(t,`disabled`,3,!1),r=j(()=>t.mode===`read_write`);var i=xC(),a=F(i),o=L(a,!0),s=R(a,2);let c;D(i),z(()=>{W(o,B(r)?`Read + write`:`Read`),c=q(s,1,`ws svelte-u1g0df`,null,c,{on:B(r)}),J(s,`aria-checked`,B(r)),s.disabled=n()}),V(`click`,s,()=>t.onchange?.(B(r)?`read`:`read_write`)),U(e,i),k()}ki([`click`]);var CC=H(`

`),wC=H(`

No folders in this chat yet. Use the folder button in the composer to add one.

`),TC=H(``),EC=H(`
`,1),DC=H(`
`),OC=H(`
`),kC=H(`
Task folders
`,1),AC=H(`
Profile folders
`,1),jC=H(` `,1);function MC(e,t){O(t,!0);let n=()=>A(No,`$profiles`,i),r=()=>A(gC,`$foldersStore`,i),[i,a]=Zt(),o=ro(t,`taskId`,3,``),s=M(!1),c=M(``),l=M(``),u=j(()=>n().activeId||hs()||``),d=j(()=>r().folders);io(()=>{r().loaded||_C()});async function f(e){N(c,``),N(s,!0);try{vC(await e())}catch(e){N(c,nS(e),!0)}N(s,!1)}let p=e=>e.grants.find(e=>e.profile===B(u)&&e.chat_id===t.chatId),m=e=>e.grants.find(e=>e.profile===B(u)&&!e.chat_id&&!e.task_id),h=e=>o()?e.grants.find(e=>e.profile===B(u)&&e.task_id===o()&&!e.chat_id):null,g=e=>h(e)?.mode??m(e)?.mode,_=j(()=>o()?B(d).filter(e=>h(e)):[]),v=j(()=>B(d).filter(e=>m(e)&&!h(e))),y=j(()=>B(d).filter(e=>p(e)&&!m(e)&&!h(e))),b=e=>{let t=p(e);return t?t.mode:g(e)};function x(e,n){let r=p(e);if(!n){r&&f(()=>Q.revokeGrant(e.id,B(u),t.chatId));return}r?.mode!==n&&f(()=>Q.setGrant(e.id,B(u),n,t.chatId))}function S(e){let n=p(e);if(!n)return;let r=n.mode===`read_write`?`read_write`:`read`;f(async()=>(await Q.setGrant(e.id,B(u),r),Q.revokeGrant(e.id,B(u),t.chatId)))}function C(e){let n=p(e);if(!n||!o())return;let r=n.mode===`read_write`?`read_write`:`read`;f(async()=>(await Q.setGrant(e.id,B(u),r,``,o()),Q.revokeGrant(e.id,B(u),t.chatId)))}function w(e,n){let r=n||`none`;if(b(e)===r)return;let i=p(e);if(r===g(e)){i&&f(()=>Q.revokeGrant(e.id,B(u),t.chatId));return}f(()=>Q.setGrant(e.id,B(u),r,t.chatId))}var T=jC(),ee=I(T),te=R(ee,2),ne=F(te),re=R(ne,4),ie=R(F(re)),ae=e=>{var t=zi();t.nodeValue=` Task folders are shared across this task's runs — changing one here overrides it for this thread only.`,U(e,t)};G(ie,e=>{o()&&e(ae)}),D(re);var oe=R(re,2),se=e=>{var t=CC(),n=L(t,!0);z(()=>W(n,B(c))),U(e,t)};G(oe,e=>{B(c)&&e(se)});var ce=R(oe,2),le=e=>{U(e,wC())};G(ce,e=>{!B(_).length&&!B(v).length&&!B(y).length&&e(le)});var ue=R(ce,2),de=e=>{var t=Bi();K(I(t),17,()=>B(y),e=>e.id,(e,t)=>{let n=j(()=>p(B(t)));var r=DC(),i=F(r);$(F(i),{name:`folder`,size:14}),D(i);var a=R(i,2),c=L(a,!0),u=R(a,2),d=F(u);{let e=j(()=>B(n)?.mode);SC(d,{get mode(){return B(e)},get disabled(){return B(s)},onchange:e=>x(B(t),e)})}var f=R(d,2),m=F(f),h=R(m,2),g=e=>{var n=EC(),r=I(n),i=R(r,2),a=F(i),s=e=>{var n=TC();$(F(n),{name:`list`,size:14}),tt(),D(n),V(`click`,n,()=>{N(l,``),C(B(t))}),U(e,n)};G(a,e=>{o()&&e(s)});var c=R(a,2);$(F(c),{name:`users`,size:14}),tt(),D(c);var u=R(c,2);$(F(u),{name:`trash`,size:14}),tt(),D(u),D(i),V(`click`,r,()=>N(l,``)),V(`click`,c,()=>{N(l,``),S(B(t))}),V(`click`,u,()=>{N(l,``),x(B(t),null)}),U(e,n)};G(h,e=>{B(l)===B(t).id&&e(g)}),D(f),D(u),D(r),z(()=>{J(a,`title`,B(t).path),W(c,B(t).name),J(m,`aria-expanded`,B(l)===B(t).id),m.disabled=B(s)}),V(`click`,m,()=>N(l,B(l)===B(t).id?``:B(t).id,!0)),U(e,r)}),U(e,t)};G(ue,e=>{B(y).length&&e(de)});var fe=R(ue,2),E=e=>{var t=kC();K(R(I(t),2),17,()=>B(_),e=>e.id,(e,t)=>{var n=OC(),r=F(n);$(F(r),{name:`folder`,size:14}),D(r);var i=R(r,2),a=L(i,!0),o=R(i,2);{let e=j(()=>b(B(t)));bC(o,{get mode(){return B(e)},get disabled(){return B(s)},onchange:e=>w(B(t),e)})}D(n),z(()=>{J(i,`title`,B(t).path),W(a,B(t).name)}),U(e,n)}),U(e,t)};G(fe,e=>{B(_).length&&e(E)});var pe=R(fe,2),me=e=>{var t=AC();K(R(I(t),2),17,()=>B(v),e=>e.id,(e,t)=>{var n=OC(),r=F(n);$(F(r),{name:`folder`,size:14}),D(r);var i=R(r,2),a=L(i,!0),o=R(i,2);{let e=j(()=>b(B(t)));bC(o,{get mode(){return B(e)},get disabled(){return B(s)},onchange:e=>w(B(t),e)})}D(n),z(()=>{J(i,`title`,B(t).path),W(a,B(t).name)}),U(e,n)}),U(e,t)};G(pe,e=>{B(v).length&&e(me)}),D(te),V(`click`,ee,function(...e){t.onClose?.apply(this,e)}),V(`click`,ne,function(...e){t.onClose?.apply(this,e)}),U(e,T),k(),a()}ki([`click`]);var NC=Gt(js,Ao),PC={html:`html`,htm:`html`,png:`image`,jpg:`image`,jpeg:`image`,gif:`image`,webp:`image`,svg:`image`,bmp:`image`,ico:`image`,avif:`image`,pdf:`pdf`,md:`markdown`,markdown:`markdown`,txt:`text`,log:`text`,csv:`text`,py:`code`,js:`code`,mjs:`code`,ts:`code`,jsx:`code`,tsx:`code`,json:`code`,css:`code`,scss:`code`,yaml:`code`,yml:`code`,toml:`code`,ini:`code`,sh:`code`,xml:`code`,sql:`code`,rs:`code`,go:`code`,java:`code`,rb:`code`};function FC(e){return PC[((e||``).split(`.`).pop()??``).toLowerCase()]||`download`}var IC={dockerfile:`file-code`,makefile:`file-code`,".gitignore":`file-code`,".env":`file-code`},LC={csv:`file-spreadsheet`,tsv:`file-spreadsheet`,zip:`file-archive`,tar:`file-archive`,gz:`file-archive`,tgz:`file-archive`,bz2:`file-archive`,rar:`file-archive`,"7z":`file-archive`,mp4:`file-play`,mov:`file-play`,webm:`file-play`,mkv:`file-play`,avi:`file-play`,m4v:`file-play`,mp3:`file-music`,wav:`file-music`,flac:`file-music`,ogg:`file-music`,m4a:`file-music`,aac:`file-music`},RC={code:`file-code`,html:`file-code`,image:`file-image`};function zC(e){let t=(e||``).toLowerCase();return IC[t]?IC[t]:LC[t.split(`.`).pop()??``]||RC[FC(e)]||`file`}function BC(e){let t=e||0;return`Mentioned in ${t} ${t===1?`thread`:`threads`}`}function VC(e){return e?(e.title||``).trim()||(e.kind===`run`?`Task run`:`Chat`):``}function HC(e){return e?.kind===`run`?`zap`:`message`}function UC(e){let t=(e||``).split(`/`);t.pop();let n=[],r=``;for(let e of t)e&&(r=r?r+`/`+e:e,n.push(r));return n}function WC(e){return GC(e)?!e.closest(`.ftrow`):!1}function GC(e){return!!e&&typeof e.closest==`function`}var KC=new Set,qC=``,JC=new Set,YC=0,XC=H(``),ZC=H(` `),QC=H(`
`,1),$C=H(` `,1),ew=H(`
`),tw=H(` `,1),nw=H(` `),rw=H(`missing`),iw=H(`
`,1),aw=H(`

Loading…

`),ow=H(`
`,1),sw=H(`
`),cw=H(`

`),lw=H(` `,1),uw=H(`Delete? `),dw=H(` Download`),fw=H(``),pw=H(` `,1),mw=H(`

`),hw=H(`
`),gw=H(`

No files yet — ask the agent to save something, run a task that produces a deliverable, or drag files here (or use +) to upload.

`),_w=H(`
Folders
`,1),vw=H(`

`);function yw(e,t){O(t,!0);let n=()=>A(js,`$route`,o),r=()=>A(NC,`$threadScope`,o),i=()=>A(gC,`$foldersStore`,o),a=()=>A(Yo,`$reveal`,o),[o,s]=Zt(),c=(e,t=ue,n=ue)=>{var r=tw(),i=I(r);K(i,17,()=>ee(t()),e=>e.path,(e,t)=>{var r=QC(),i=I(r);let a;var o=F(i),s=F(o);{let e=j(()=>re(B(t).path)?`chevron-down`:`chevron-right`);$(s,{get name(){return B(e)},size:13})}D(o);var l=R(o,2);$(l,{name:`folder`,size:14});var u=R(l,2),f=e=>{var n=XC();za(n),yr(()=>qa(n,()=>B(ze),e=>N(ze,e))),ua(n,e=>Ge?.(e)),V(`click`,n,e=>e.stopPropagation()),V(`keydown`,n,e=>{e.key===`Enter`?Ue(B(t).path):e.key===`Escape`&&He()}),Oi(`blur`,n,()=>Ue(B(t).path)),U(e,n)},p=e=>{var n=ZC(),r=L(n,!0);z(()=>W(r,B(t).name)),U(e,n)};G(u,e=>{B(Re)===B(t).path?e(f):e(p,-1)});var m=R(u,2);d(m,()=>B(t).path,()=>B(t).name,()=>!0),D(i);var h=R(i,2),g=e=>{c(e,()=>B(t),()=>n()+1)},_=j(()=>re(B(t).path));G(h,e=>{B(_)&&e(g)}),z(e=>{a=q(i,1,`ftrow ftdir svelte-evfy7n`,null,a,{active:B(t).path===B(le),selected:B(v)===B(t).path&&!B(de)&&B(t).path!==B(le),drop:B(et)===B(t).path}),J(i,`data-path`,B(t).path),xa(i,`padding-left:${n()*14+4}px`),J(o,`title`,e)},[()=>re(B(t).path)?`Collapse`:`Expand`]),Oi(`dragstart`,i,e=>nt(e,B(t).path)),Oi(`dragover`,i,e=>rt(e,B(t).path)),Oi(`drop`,i,e=>at(e,B(t).path)),V(`click`,i,()=>{Ee(B(t).path),ie(B(t).path)}),V(`click`,o,e=>{e.stopPropagation(),ie(B(t).path)}),U(e,r)}),K(R(i,2),17,()=>te(t()),e=>e.path,(e,t)=>{var r=ew();let i;var a=F(r);{let e=j(()=>zC(B(t).name));$(a,{get name(){return B(e)},size:14})}var o=R(a,2),s=e=>{var n=XC();za(n),yr(()=>qa(n,()=>B(ze),e=>N(ze,e))),ua(n,e=>Ge?.(e)),V(`click`,n,e=>e.stopPropagation()),V(`keydown`,n,e=>{e.key===`Enter`?Ue(B(t).path):e.key===`Escape`&&He()}),Oi(`blur`,n,()=>Ue(B(t).path)),U(e,n)},c=e=>{var n=$C(),r=I(n),i=L(r,!0),a=L(R(r,2),!0);z(e=>{J(r,`title`,B(t).path),W(i,B(t).name),W(a,e)},[()=>oe(B(t).size)]),U(e,n)};G(o,e=>{B(Re)===B(t).path?e(s):e(c,-1)});var l=R(o,2);d(l,()=>B(t).path,()=>B(t).name,()=>!1),D(r),z(()=>{i=q(r,1,`ftrow ftfile svelte-evfy7n`,null,i,{active:B(se)===B(t).path}),J(r,`data-path`,B(t).path),xa(r,`padding-left:${n()*14+24}px`)}),Oi(`dragstart`,r,e=>nt(e,B(t).path)),V(`click`,r,()=>{B(Re)!==B(t).path&&fe(B(t))}),U(e,r)}),U(e,r)},l=(e,t=ue)=>{let n=j(()=>zv(t().mode));var r=iw(),i=I(r);let a;var o=F(i),s=F(o);{let e=j(()=>B(ge).has(t().path)?`chevron-down`:`chevron-right`);$(s,{get name(){return B(e)},size:13})}D(o);var c=R(o,2);$(c,{name:`folder`,size:14});var l=R(c,2),d=L(l,!0),f=R(l,2),p=e=>{var n=nw();let r;var i=L(n,!0);z(e=>{r=q(n,1,`ftbadge svelte-evfy7n`,null,r,{rw:t().mode===`read_write`}),W(i,e)},[()=>Bv(t().mode)]),U(e,n)},m=j(()=>Bv(t().mode));G(f,e=>{B(m)&&e(p)});var h=R(f,2),g=e=>{U(e,rw())};G(h,e=>{t().exists||e(g)}),D(i);var _=R(i,2),y=e=>{u(e,()=>t().path,()=>1,()=>t().mode)},b=j(()=>t().exists&&B(ge).has(t().path));G(_,e=>{B(b)&&e(y)}),z(e=>{a=q(i,1,`ftrow ftdir ftfolder svelte-evfy7n`,null,a,{missing:!t().exists,drop:B(et)===t().path,selected:t().exists&&B(v)===t().path}),J(i,`title`,t().path),J(o,`title`,e),o.disabled=!t().exists,W(d,t().name)},[()=>B(ge).has(t().path)?`Collapse`:`Expand`]),Oi(`dragover`,i,function(...e){(B(n).move&&t().exists?e=>rt(e,t().path):null)?.apply(this,e)}),Oi(`drop`,i,function(...e){(B(n).move&&t().exists?e=>at(e,t().path):null)?.apply(this,e)}),V(`click`,i,()=>{t().exists&&(B(n).move&&Ee(t().path),be(t().path))}),V(`click`,o,e=>{e.stopPropagation(),t().exists&&be(t().path)}),U(e,r)},u=(e,t=ue,n=ue,r=ue)=>{let i=j(()=>B(he).get(t())),a=j(()=>zv(B(i)?.mode??r()));var o=Bi(),s=I(o),c=e=>{var t=aw();z(()=>xa(t,`padding-left:${n()*14+24}px`)),U(e,t)},l=j(()=>!B(i)&&B(_e).has(t())),f=e=>{var t=lw(),o=I(t);K(o,17,()=>B(i).dirs,e=>e.path,(e,t)=>{var o=ow(),s=I(o);let c;var l=F(s),f=F(l);{let e=j(()=>B(ge).has(B(t).path)?`chevron-down`:`chevron-right`);$(f,{get name(){return B(e)},size:13})}D(l);var p=R(l,2);$(p,{name:`folder`,size:14});var m=R(p,2),h=e=>{var n=XC();za(n),yr(()=>qa(n,()=>B(ze),e=>N(ze,e))),ua(n,e=>Ge?.(e)),V(`click`,n,e=>e.stopPropagation()),V(`keydown`,n,e=>{e.key===`Enter`?Ue(B(t).path):e.key===`Escape`&&He()}),Oi(`blur`,n,()=>Ue(B(t).path)),U(e,n)},g=e=>{var n=ZC(),r=L(n,!0);z(()=>W(r,B(t).name)),U(e,n)};G(m,e=>{B(Re)===B(t).path?e(h):e(g,-1)});var _=R(m,2),y=e=>{d(e,()=>B(t).path,()=>B(t).name,()=>!0)};G(_,e=>{(B(a).rename||B(a).delete)&&e(y)}),D(s);var b=R(s,2),x=e=>{u(e,()=>B(t).path,()=>n()+1,()=>B(i)?.mode??r())},S=j(()=>B(ge).has(B(t).path));G(b,e=>{B(S)&&e(x)}),z(e=>{c=q(s,1,`ftrow ftdir svelte-evfy7n`,null,c,{drop:B(et)===B(t).path,selected:B(v)===B(t).path}),J(s,`data-path`,B(t).path),xa(s,`padding-left:${n()*14+4}px`),J(s,`title`,B(t).path),J(s,`draggable`,B(a).move),J(l,`title`,e)},[()=>B(ge).has(B(t).path)?`Collapse`:`Expand`]),Oi(`dragstart`,s,function(...e){(B(a).move?e=>nt(e,B(t).path):null)?.apply(this,e)}),Oi(`dragover`,s,function(...e){(B(a).move?e=>rt(e,B(t).path):null)?.apply(this,e)}),Oi(`drop`,s,function(...e){(B(a).move?e=>at(e,B(t).path):null)?.apply(this,e)}),V(`click`,s,()=>{B(Re)!==B(t).path&&(B(a).move&&Ee(B(t).path),be(B(t).path))}),V(`click`,l,e=>{e.stopPropagation(),be(B(t).path)}),U(e,o)});var s=R(o,2);K(s,17,()=>B(i).files,e=>e.path,(e,t)=>{var r=sw();let i;var o=F(r);{let e=j(()=>zC(B(t).name));$(o,{get name(){return B(e)},size:14})}var s=R(o,2),c=e=>{var n=XC();za(n),yr(()=>qa(n,()=>B(ze),e=>N(ze,e))),ua(n,e=>Ge?.(e)),V(`click`,n,e=>e.stopPropagation()),V(`keydown`,n,e=>{e.key===`Enter`?Ue(B(t).path):e.key===`Escape`&&He()}),Oi(`blur`,n,()=>Ue(B(t).path)),U(e,n)},l=e=>{var n=$C(),r=I(n),i=L(r,!0),a=L(R(r,2),!0);z(e=>{W(i,B(t).name),W(a,e)},[()=>oe(B(t).size)]),U(e,n)};G(s,e=>{B(Re)===B(t).path?e(c):e(l,-1)});var u=R(s,2),f=e=>{d(e,()=>B(t).path,()=>B(t).name,()=>!1)};G(u,e=>{(B(a).rename||B(a).delete)&&e(f)}),D(r),z(()=>{i=q(r,1,`ftrow ftfile svelte-evfy7n`,null,i,{active:B(se)===B(t).path}),J(r,`data-path`,B(t).path),xa(r,`padding-left:${n()*14+24}px`),J(r,`title`,B(t).path),J(r,`draggable`,B(a).move)}),Oi(`dragstart`,r,function(...e){(B(a).move?e=>nt(e,B(t).path):null)?.apply(this,e)}),V(`click`,r,()=>{B(Re)!==B(t).path&&fe(B(t))}),U(e,r)});var c=R(s,2),l=e=>{var t=cw(),r=L(t,!0);z(()=>{xa(t,`padding-left:${n()*14+24}px`),W(r,B(i).err?`Not reachable`:`Empty`)}),U(e,t)};G(c,e=>{!B(i).dirs.length&&!B(i).files.length&&e(l)}),U(e,t)};G(s,e=>{B(l)?e(c):B(i)&&e(f,1)}),U(e,o)},d=(e,t=ue,n=ue,r=ue)=>{var i=Bi(),a=I(i),o=e=>{var n=uw(),i=F(n),a=R(F(i)),o=e=>{var n=Bi(),r=I(n),i=e=>{U(e,zi(`this folder`))},a=j(()=>Rv(t())),o=e=>{var n=zi();z((e,t)=>W(n,`${e??``} file${t??``}`),[()=>ae(t()),()=>ae(t())===1?``:`s`]),U(e,n)};G(r,e=>{B(a)?e(i):e(o,-1)}),U(e,n)};G(a,e=>{r()&&e(o)}),tt(),D(i);var s=R(i,2),c=L(s,!0),l=R(s,2);D(n),z(()=>{s.disabled=B(Ie)===t(),W(c,B(Ie)===t()?`…`:`yes`)}),V(`click`,n,e=>e.stopPropagation()),V(`click`,s,e=>{e.stopPropagation(),Le(t())}),V(`click`,l,e=>{e.stopPropagation(),N(Fe,``)}),U(e,n)},s=e=>{var i=pw(),a=I(i);$(F(a),{name:`ellipsis-vertical`,size:14}),D(a);var o=R(a,2),s=e=>{var i=fw(),a=F(i),o=e=>{var n=dw();$(F(n),{name:`download`,size:14}),tt(),D(n),z(e=>J(n,`href`,e),[()=>Q.fileUrl(t(),!0,B(E))]),V(`click`,n,()=>N(ke,``)),U(e,n)};G(a,e=>{r()||e(o)});var s=R(a,2);$(F(s),{name:`pencil`,size:14}),tt(),D(s);var c=R(s,4);$(F(c),{name:`trash`,size:14}),tt(),D(c),D(i),ua(i,(e,t)=>Me?.(e,t),()=>B(Ae)),V(`click`,i,e=>e.stopPropagation()),V(`click`,s,()=>Ve(t(),n())),V(`click`,c,()=>{N(ke,``),r()&&(Rv(t())||ae(t()))?N(Fe,t(),!0):Le(t())}),U(e,i)};G(o,e=>{B(ke)===t()&&e(s)}),z(()=>J(a,`aria-expanded`,B(ke)===t())),V(`click`,a,e=>je(e,t())),U(e,i)};G(a,e=>{B(Fe)===t()?e(o):B(Re)!==t()&&e(s,1)}),U(e,i)},f=M(P([])),p=M(P([])),m=M(``),h=M(!0),g=M(``),_=M(P(KC)),v=M(P(qC));hr(()=>{qC=B(v)});let y,b=!1,x=null;async function S(){if(!b&&x)return x;N(h,!0),N(g,``);let e=(async()=>{try{let e=await Q.files();N(f,e.files,!0),N(p,e.dirs,!0),N(m,e.root,!0),C()}catch(e){N(g,nS(e),!0)}N(h,!1)})();x=e;try{await e}finally{x===e&&(x=null)}}function C(){let e=new Set(B(p));if(B(v)&&!Rv(B(v))&&!e.has(B(v))){let t=B(v);do t=t.includes(`/`)?t.slice(0,t.lastIndexOf(`/`)):``;while(t&&!e.has(t));N(v,t,!0)}let t=[...B(_)].filter(t=>e.has(t));t.length!==B(_).size&&(N(_,new Set(t),!0),KC=B(_))}io(async()=>{await S(),b=!0});let w=(e,t)=>e.name.localeCompare(t.name,void 0,{numeric:!0,sensitivity:`base`}),T=j(()=>{let e={name:``,path:``,dirs:new Map,files:[]},t=t=>{let n=e;if(!t)return n;let r=``;for(let e of t.split(`/`)){r=r?r+`/`+e:e;let t=n.dirs.get(e);t||(t={name:e,path:r,dirs:new Map,files:[]},n.dirs.set(e,t)),n=t}return n};for(let e of B(p))t(e);for(let e of B(f))t(e.dir).files.push(e);return e}),ee=e=>[...e.dirs.values()].sort(w),te=e=>[...e.files].sort(w),ne=j(()=>!B(f).length&&!B(p).length),re=e=>B(_).has(e);function ie(e){B(_).has(e)?B(_).delete(e):B(_).add(e),N(_,new Set(B(_)),!0),KC=B(_)}let ae=e=>B(f).filter(t=>t.path===e||t.path.startsWith(e+`/`)).length,oe=e=>e<1024?`${e} B`:e<1048576?`${(e/1024).toFixed(1)} KB`:`${(e/1048576).toFixed(1)} MB`,se=j(()=>n().aside?.kind===`file`?n().aside.path:null),ce=j(()=>!!B(se)&&B(f).some(e=>e.path===B(se))),le=j(()=>{if(!B(ce)||!B(se))return null;let e=``,t=B(se).split(`/`);t.pop();for(let n of t)if(e=e?e+`/`+n:n,!B(_).has(e))return e;return null}),de=j(()=>B(ce)&&B(le)===null);function fe(e){e.path===B(se)?Ws():Hs(e.path)}let E=j(r),pe=M(P([])),me=M(``),he=M(P(new Map)),ge=M(P(JC)),_e=M(P(new Set));async function ve(){N(me,``);try{let e=await Q.folderRoots(B(E));N(pe,e.roots,!0)}catch(e){N(me,nS(e),!0),N(pe,[],!0)}}async function ye(e){B(_e).add(e),N(_e,new Set(B(_e)),!0);try{let t=await Q.folderList(e,B(E));B(he).set(e,{dirs:t.dirs,files:t.files,mode:t.mode})}catch{B(he).set(e,{dirs:[],files:[],err:!0})}finally{N(he,new Map(B(he)),!0),B(_e).delete(e),N(_e,new Set(B(_e)),!0)}}function be(e){B(ge).has(e)?B(ge).delete(e):(B(ge).add(e),B(he).has(e)||ye(e)),N(ge,new Set(B(ge)),!0),JC=B(ge)}async function xe(){await ve();for(let e of B(ge))await ye(e)}hr(()=>{B(E),fi(()=>{N(he,new Map,!0),ve();for(let e of B(ge))ye(e)})});let Se=!1;hr(()=>{if(i(),!Se){Se=!0;return}fi(()=>xe())}),hr(()=>{let{path:e,kind:t,epoch:n}=a();!e||n===YC||(YC=n,Ce(e,t))});async function Ce(e,t){if(Rv(e))return we(e,t);for(let t of UC(e))B(_).add(t);t===`directory`&&(B(_).add(e),N(v,e,!0)),N(_,new Set(B(_)),!0),KC=B(_),await S(),await li(),Te(e,t)}async function we(e,t){await ve();let n=null;for(let r of B(pe)){if(!r.exists)continue;if(r.path===e){n=[r.path];break}let i=Vv(r.path,e);if(i.length){n=t===`directory`?[...i,e]:i;break}}if(n){for(let e of n)B(ge).add(e);N(ge,new Set(B(ge)),!0),JC=B(ge),t===`directory`&&N(v,e,!0);for(let e of n)await ye(e);await li(),Te(e,t)}}function Te(e,t){if(t===`directory`){for(let t of y?.querySelectorAll(`[data-path]`)||[])if(t.dataset.path===e)return void t.scrollIntoView({block:`nearest`});return}y?.querySelector(`.ftrow.active`)?.scrollIntoView({block:`nearest`})}let Ee=e=>{N(v,e,!0)},De=e=>{e.target instanceof Element&&WC(e.target)&&N(v,``)};function Oe(e){for(let t of y?.querySelectorAll(`[data-path]`)||[])if(t.dataset.path===e)return void t.scrollIntoView({block:`nearest`})}let ke=M(``),Ae=M(null);function je(e,t){if(e.stopPropagation(),B(ke)===t){N(ke,``);return}let n=e.currentTarget.getBoundingClientRect();N(Ae,{top:n.top,bottom:n.bottom,left:n.left,right:n.right},!0),N(ke,t,!0)}function Me(e,t){let n=t=>{if(!t)return;let{width:n,height:r}=e.getBoundingClientRect(),i=window.innerWidth,a=window.innerHeight,o=t.right-n;o<8&&(o=t.left),o=Math.max(8,Math.min(o,i-n-8));let s=t.bottom+4;s+r>a-8&&t.top-4-r>=8&&(s=t.top-4-r),s=Math.max(8,Math.min(s,a-r-8)),e.style.left=`${o}px`,e.style.top=`${s}px`,e.style.transform=`none`};return n(t),{update:n}}function Ne(e){let t=e.target instanceof Element?e.target:null;B(ke)&&!t?.closest(`.ftmenu`)&&!t?.closest(`.ftkebab`)&&N(ke,``)}function Pe(e){e.key===`Escape`&&(N(ke,``),B(Re)&&He(),B(Ke)&&N(Ke,!1))}io(()=>(document.addEventListener(`pointerdown`,Ne,!0),document.addEventListener(`keydown`,Pe),()=>{document.removeEventListener(`pointerdown`,Ne,!0),document.removeEventListener(`keydown`,Pe)}));let Fe=M(``),Ie=M(``);async function Le(e){N(Ie,e,!0);try{await Q.deleteFile(e,B(E)),Rv(e)?await xe():await S()}catch(e){N(g,nS(e),!0)}N(Ie,``),N(Fe,``)}let Re=M(``),ze=M(``),Be=e=>e.includes(`/`)?e.slice(0,e.lastIndexOf(`/`)):``;function Ve(e,t){N(ke,``),N(Re,e,!0),N(ze,t,!0)}function He(){N(Re,``)}async function Ue(e){if(B(Re)!==e)return;let t=B(ze).trim();if(N(Re,``),!t)return;let n=t.includes(`/`)?t:Be(e)?Be(e)+`/`+t:t;n!==e&&await We(e,n)}async function We(e,t){N(Ie,e,!0);try{await Q.moveFile(e,t,B(E)),B(se)===e?Hs(t):B(se)&&B(se).startsWith(e+`/`)&&Hs(t+B(se).slice(e.length)),Rv(e)?await xe():await S()}catch(e){N(g,nS(e),!0)}N(Ie,``)}function Ge(e){e.focus(),e.select()}let Ke=M(!1),qe=M(``);function Je(){N(Ke,!0),N(qe,``)}async function Ye(){if(!B(Ke))return;N(Ke,!1);let e=B(qe).trim();if(!e)return;let t=B(v)?B(v)+`/`+e:e;N(Ie,t,!0);try{await Q.mkdir(t,B(E)),Rv(t)?(B(ge).add(B(v)),N(ge,new Set(B(ge)),!0),await xe()):(B(v)&&(B(_).add(B(v)),N(_,new Set(B(_)),!0)),await S()),N(v,t,!0),await li(),Oe(t)}catch(e){N(g,nS(e),!0)}N(Ie,``)}let Xe;async function Ze(e,t){if(!e||!e.length)return;let n=t||``;N(Ie,`upload`);try{let t=(await Q.uploadFiles(e,n,B(E))).saved;Rv(n)?(B(ge).add(n),N(ge,new Set(B(ge)),!0),await xe()):(n&&(B(_).add(n),N(_,new Set(B(_)),!0)),await S());let r=t[0];if(r){let e=Rv(n)?n.replace(/\/+$/,``)+`/`+r.split(`/`).pop():r;Hs(e),await li(),Oe(e)}}catch(e){N(g,nS(e),!0)}N(Ie,``)}function Qe(e){Ze(e.currentTarget.files,B(v)),e.currentTarget.value=``}let $e=`application/x-ag2-path`,et=M(null);function nt(e,t){e.dataTransfer&&(e.dataTransfer.setData($e,t),e.dataTransfer.effectAllowed=`move`)}function rt(e,t){e.preventDefault(),e.stopPropagation(),N(et,t,!0)}function it(e){e.preventDefault(),N(et,``)}async function at(e,t){if(e.preventDefault(),e.stopPropagation(),N(et,null),!e.dataTransfer)return;if(e.dataTransfer.files&&e.dataTransfer.files.length){await Ze(e.dataTransfer.files,t??B(v));return}let n=e.dataTransfer.getData($e);if(!n)return;let r=t??``,i=n.includes(`/`)?n.slice(n.lastIndexOf(`/`)+1):n,a=r?r+`/`+i:i;a!==n&&await We(n,a)}var ot=vw(),st=F(ot),ct=F(st),lt=F(ct),ut=e=>{var t=zi();z(()=>W(t,B(v))),U(e,t)},dt=e=>{U(e,zi(`Search`))};G(lt,e=>{B(v)?e(ut):e(dt,-1)}),D(ct);var ft=R(ct,4);$(F(ft),{name:`plus`,size:15}),D(ft);var pt=R(ft,2);$(F(pt),{name:`folder-plus`,size:15}),D(pt);var mt=R(pt,2);$(F(mt),{name:`rotate-cw`,size:15}),D(mt);var ht=R(mt,2);Qa(ht,e=>Xe=e,()=>Xe),D(st);var gt=R(st,2),_t=e=>{var t=mw(),n=F(t),r=R(n);D(t),z(()=>W(n,`${B(g)??``} `)),V(`click`,r,()=>N(g,``)),U(e,t)};G(gt,e=>{B(g)&&e(_t)});var vt=R(gt,2);let yt;var bt=F(vt),xt=e=>{var t=hw(),n=F(t);$(n,{name:`folder`,size:14});var r=R(n,2);za(r),yr(()=>qa(r,()=>B(qe),e=>N(qe,e))),ua(r,e=>Ge?.(e)),D(t),V(`click`,r,e=>e.stopPropagation()),V(`keydown`,r,e=>{e.key===`Enter`?Ye():e.key===`Escape`&&N(Ke,!1)}),Oi(`blur`,r,Ye),U(e,t)};G(bt,e=>{B(Ke)&&e(xt)});var St=R(bt,2),Ct=e=>{U(e,aw())},wt=e=>{U(e,gw())},Tt=e=>{c(e,()=>B(T),()=>0)};G(St,e=>{B(h)?e(Ct):B(ne)?e(wt,1):e(Tt,-1)});var Et=R(St,2),Dt=e=>{var t=mw(),n=F(t),r=R(n);D(t),z(()=>W(n,`${B(me)??``} `)),V(`click`,r,()=>N(me,``)),U(e,t)};G(Et,e=>{B(me)&&e(Dt)});var Ot=R(Et,2),kt=e=>{var t=_w();K(R(I(t),2),17,()=>B(pe),e=>e.path,(e,t)=>{l(e,()=>B(t))}),U(e,t)};G(Ot,e=>{B(pe).length&&e(kt)}),D(vt),Qa(vt,e=>y=e,()=>y);var At=R(vt,2),jt=L(At,!0);D(ot),z(()=>{J(ft,`title`,`Upload into ${(B(v)||`root`)??``}`),J(pt,`title`,`New directory in ${(B(v)||`root`)??``}`),yt=q(vt,1,`fttree svelte-evfy7n`,null,yt,{droproot:B(et)===``}),J(At,`title`,B(m)),W(jt,B(m))}),V(`click`,ft,()=>Xe?.click()),V(`click`,pt,Je),V(`click`,mt,S),V(`change`,ht,Qe),V(`click`,vt,De),Oi(`dragover`,vt,it),Oi(`drop`,vt,e=>at(e,null)),U(e,ot),k(),s()}ki([`click`,`keydown`,`change`]);var bw=H(`ACP`),xw=H(``),Sw=H(`
`),Cw=H(`Delete? `),ww=H(` `),Tw=H(``),Ew=H(` `,1),Dw=H(`
`),Ow=H(``),kw=H(``),Aw=H(``),jw=H(``),Mw=H(` `),Nw=H(` `),Pw=H(` `,1),Fw=H(``),Iw=H(` `,1),Lw=H(` `),Rw=H(` `),zw=H(`
`),Bw=H(`
`),Vw=H(``),Hw=H(``),Uw=H(``),Ww=H(``),Gw=H(``),Kw=H(``),qw=H(`
`),Jw=H(` `,1),Yw=H(`
`),Xw=H(`
Starred
`,1),Zw=H(`
`),Qw=H(` `,1),$w=H(` `,1),eT=H(` `,1),tT=H(`
`),nT=H(`
`),rT=H(`
Assistant
`);function iT(e,t){O(t,!0);let n=()=>A(No,`$profiles`,c),r=()=>A(Lo,`$chats`,c),i=()=>A(Ro,`$tasks`,c),a=()=>A(zo,`$listsLoaded`,c),o=()=>A(Po,`$profileEpoch`,c),s=()=>A(js,`$route`,c),[c,l]=Zt(),u={Monday:`Mon`,Tuesday:`Tue`,Wednesday:`Wed`,Thursday:`Thu`,Friday:`Fri`,Saturday:`Sat`,Sunday:`Sun`},d=e=>(e||``).replace(/\b(Monday|Tuesday|Wednesday|Thursday|Friday|Saturday|Sunday)\b/g,e=>u[e]||e).replace(/\bEvery hour, between (\S+) and (\S+)/,`Hourly $1–$2`).replace(/\b[Bb]etween (\S+) and (\S+)/,`$1–$2`).replace(/ through /g,`–`),f=j(()=>n().list),p=typeof navigator<`u`&&/Mac|iPhone|iPad/.test(navigator.platform||``),m=e=>{let t=B(f).findIndex(t=>t.id===e);return t>=0&&t<9?` — ${p?`⌘`:`Ctrl+`}${t+1}`:``},h=e=>e.name+m(e.id),g=j(()=>B(f).find(e=>e.id===n().activeId)),v=e=>(e?.name||`?`).trim().charAt(0).toUpperCase()||`?`,y=e=>cx(e),b=j(()=>B(f).length<=4?B(f):B(f).slice(0,3)),x=j(()=>B(f).length<=4?[]:B(f).slice(3)),S=M(!1);function C(e){let t=e.target instanceof Element?e.target:null;B(S)&&!t?.closest(`.profchips`)&&N(S,!1),B(Te)&&!t?.closest(`.chatmenu`)&&!t?.closest(`.rowkebab`)&&N(Te,``),B(Fe)&&!t?.closest(`.taskmenu`)&&!t?.closest(`.rowkebab`)&&N(Fe,``)}function w(e){if(B(T)&&e.key===`Escape`){N(T,!1);return}B(S)&&e.key===`Escape`&&N(S,!1),B(Te)&&e.key===`Escape`&&N(Te,``),B(Fe)&&e.key===`Escape`&&N(Fe,``)}let T=M(!1),ee=j(()=>B(f).map(e=>e.accent));async function te({name:e,accent:t}){let n=await Q.createProfile(e,t);No.update(e=>({...e,list:[...e.list,n.profile]})),N(T,!1),cx(n.profile.id)}let ne=M(null),re=j(()=>(B(ne)?.profiles||[]).find(e=>e.pid===n().activeId)||null),ie=M(P({})),ae=e=>(B(ie)[e]?.unseen_done||0)>0;async function oe(){let e=Kt(Po);try{let t=await Q.chats();if(Kt(Po)===e){let e=new Set(t.map(e=>e.chat_id));Xt(Lo,[...r().filter(t=>!e.has(t.chat_id)),...t])}}catch{}try{let t=await Q.tasks();Kt(Po)===e&&Xt(Ro,t)}catch{}Kt(Po)===e&&Xt(zo,!0);try{N(ne,await Q.usageAll(),!0)}catch{}try{let e=await Q.status();N(ie,Object.fromEntries(e.map(e=>[e.pid,e])),!0)}catch{}}let se=e=>e?e<1e3?String(Math.round(e)):`${(e/1e3).toFixed(+(e<1e4))}k`:`0`,ce=e=>{let t=`${se(e.total)} tok`;return e.priced?`${t} · ~$${e.cost.toFixed(e.cost<1?3:2)}`:t},le=j(()=>(B(ne)?.profiles||[]).length>1),de=j(()=>{if(!B(re)||!B(re).total)return``;let e=ce(B(re));return B(le)&&B(ne)?.total?.total&&(e+=` · all: ${ce(B(ne).total)}`),e}),fe=j(()=>{if(!B(re))return``;let e=Object.keys(B(re).by_model||{}).join(`, `),t=`Today (${B(re).date}): ${se(B(re).prompt)} in / ${se(B(re).completion)} out`+(B(re).priced?` · ~$${(B(re).cost||0).toFixed(4)} (estimate)`:` · cost: no price set`)+(e?`\nmodels: ${e}`:``);if(B(le)&&B(ne)){let e=B(ne).profiles.filter(e=>e.total).map(e=>`${e.name}: ${ce(e)}`).join(` · `);e&&(t+=`\nall profiles — ${e}`)}return t});io(()=>{oe();let e=setInterval(oe,5e3);return document.addEventListener(`pointerdown`,C,!0),document.addEventListener(`keydown`,w),()=>{clearInterval(e),document.removeEventListener(`pointerdown`,C,!0),document.removeEventListener(`keydown`,w)}});let E=-1;hr(()=>{let e=o();if(E===-1){E=e;return}e!==E&&(E=e,Xt(zo,!1),oe())});let pe=j(()=>r().filter(e=>e.starred)),me=j(()=>hy(r().filter(e=>!e.starred).map(e=>({...e,at:e.updated})),my)),he=(e,t)=>new Date(_y(t))-+new Date(_y(e)),ge=j(()=>i().filter(e=>e.starred).sort(he)),_e=j(()=>hy(i().filter(e=>!e.starred).sort(he).map(e=>({...e,at:_y(e)})),my)),ve=e=>Fs(`/c/`+e),ye=e=>Fs(`/t/`+e),be=()=>Fs(`/c/`+qs());function xe(e,t){e.target===e.currentTarget&&(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),t())}let Se=M(``),Ce=M(``);async function we(e){N(Ce,e,!0);try{await Q.deleteChat(e),Xt(Lo,r().filter(t=>t.chat_id!==e)),s().name===`chat`&&s().id===e&&Fs(`/c/`+qs())}catch{}N(Ce,``),N(Se,``)}let Te=M(``),Ee=M(``),De=M(P({x:0,y:0}));function Oe(e,t){if(e.stopPropagation(),B(Te)===t.chat_id){N(Te,``);return}let n=e.currentTarget.getBoundingClientRect();N(De,{x:n.right,y:n.bottom+4},!0),N(Te,t.chat_id,!0)}async function ke(e){N(Te,``);let t=!e.starred;Xt(Lo,r().map(n=>n.chat_id===e.chat_id?{...n,starred:t}:n));try{await Q.updateChat(e.chat_id,{starred:t})}catch{Xt(Lo,r().map(n=>n.chat_id===e.chat_id?{...n,starred:!t}:n))}}let Ae=M(``),je=M(``);function Me(e){N(Te,``),N(Ae,e.chat_id,!0),N(je,e.title||e.preview||``,!0)}async function Ne(e){if(B(Ae)!==e.chat_id)return;N(Ae,``);let t=B(je).trim();if(!t||t===(e.title||``))return;let n=e.title;Xt(Lo,r().map(n=>n.chat_id===e.chat_id?{...n,title:t}:n));try{await Q.updateChat(e.chat_id,{title:t})}catch{Xt(Lo,r().map(t=>t.chat_id===e.chat_id?{...t,title:n}:t))}}function Pe(e){e.focus(),e.select()}let Fe=M(``),Ie=M(``),Le=M(``),Re=M(``),ze=M(``);function Be(e,t){if(e.stopPropagation(),N(Te,``),B(Fe)===t.id){N(Fe,``);return}let n=e.currentTarget.getBoundingClientRect();N(De,{x:n.right,y:n.bottom+4},!0),N(Fe,t.id,!0)}async function Ve(e){N(Fe,``);let t=!e.paused;Xt(Ro,i().map(n=>n.id===e.id?{...n,paused:t}:n));try{await Q.updateTask(e.id,{paused:t})}catch{Xt(Ro,i().map(n=>n.id===e.id?{...n,paused:!t}:n))}}async function He(e){N(Fe,``);let t=!e.starred;Xt(Ro,i().map(n=>n.id===e.id?{...n,starred:t}:n));try{await Q.updateTask(e.id,{starred:t})}catch{Xt(Ro,i().map(n=>n.id===e.id?{...n,starred:!t}:n))}}function Ue(e){N(Fe,``),Ho.set(e.id),ye(e.id)}function We(e){N(Fe,``),N(Ie,e.id,!0),N(Le,e.name||``,!0)}async function Ge(e){if(B(Ie)!==e.id)return;N(Ie,``);let t=B(Le).trim();if(!t||t===e.name)return;let n=e.name;Xt(Ro,i().map(n=>n.id===e.id?{...n,name:t}:n));try{await Q.updateTask(e.id,{name:t})}catch{Xt(Ro,i().map(t=>t.id===e.id?{...t,name:n}:t))}}async function Ke(e){N(ze,e,!0);try{await Q.deleteTask(e),Xt(Ro,i().filter(t=>t.id!==e)),s().name===`task`&&s().id===e&&Is(`tasks`)}catch{}N(ze,``),N(Re,``)}let qe={running:{icon:`spinner`,label:`running`},needs_input:{icon:`help-circle`,label:`needs input`},completed:{icon:`check`,label:`completed`},failed:{icon:`x`,label:`failed`},cancelled:{icon:`slash`,label:`cancelled`}},Je=e=>e&&qe[e]||{icon:`clock`,label:e||``};var Ye=rT();{let e=(e,t=ue)=>{var n=Dw();let r;var i=F(n),a=e=>{var n=bw();let r;z(()=>{r=q(n,1,`tag originbadge svelte-ledzjv`,null,r,{live:t().origin_live}),J(n,`title`,t().origin_live?`Live — driven by the “${t().origin_name}” ACP listener`:`Started by the “${t().origin_name}” ACP listener`)}),U(e,n)};G(i,e=>{t().origin_platform===`acp`&&e(a)});var o=R(i,2),c=e=>{var n=xw();za(n),ua(n,e=>Pe?.(e)),z(()=>Ba(n,B(je))),V(`input`,n,e=>N(je,e.currentTarget.value,!0)),V(`click`,n,e=>e.stopPropagation()),V(`keydown`,n,e=>{e.key===`Enter`?Ne(t()):e.key===`Escape`&&N(Ae,``)}),Oi(`blur`,n,()=>Ne(t())),U(e,n)},l=e=>{var n=Sw(),r=L(n,!0);z(()=>{J(n,`title`,t().preview||``),W(r,t().title||t().preview||t().chat_id)}),U(e,n)};G(o,e=>{B(Ae)===t().chat_id?e(c):e(l,-1)});var u=R(o,2),d=e=>{var n=Cw(),r=R(F(n),2),i=L(r,!0),a=R(r,2);D(n),z(()=>{r.disabled=B(Ce)===t().chat_id,W(i,B(Ce)===t().chat_id?`…`:`yes`)}),V(`click`,n,e=>e.stopPropagation()),V(`click`,r,e=>{e.stopPropagation(),we(t().chat_id)}),V(`click`,a,e=>{e.stopPropagation(),N(Se,``)}),U(e,n)},f=e=>{var n=Ew(),r=I(n),i=e=>{var n=ww(),r=L(n,!0);z(e=>W(r,e),[()=>uy(t().updated)]),U(e,n)};G(r,e=>{t().updated&&e(i)});var a=R(r,2);$(F(a),{name:`ellipsis-vertical`,size:14}),D(a);var o=R(a,2),s=e=>{var n=Tw(),r=F(n),i=F(r);$(i,{name:`star`,size:14});var a=R(i);D(r);var o=R(r,2);$(F(o),{name:`pencil`,size:14}),tt(),D(o);var s=R(o,2);$(F(s),{name:`folder`,size:13}),tt(),D(s);var c=R(s,4);$(F(c),{name:`trash`,size:14}),tt(),D(c),D(n),z(()=>{xa(n,`left:${B(De).x??``}px; top:${B(De).y??``}px`),W(a,` ${t().starred?`Unstar`:`Star`}`)}),V(`click`,n,e=>e.stopPropagation()),V(`click`,r,()=>ke(t())),V(`click`,o,()=>Me(t())),V(`click`,s,()=>{let e=B(Te);N(Te,``),N(Ee,e,!0)}),V(`click`,c,()=>{N(Te,``),N(Se,t().chat_id,!0)}),U(e,n)};G(o,e=>{B(Te)===t().chat_id&&e(s)}),z(()=>J(a,`aria-expanded`,B(Te)===t().chat_id)),V(`click`,a,e=>Oe(e,t())),U(e,n)};G(u,e=>{B(Se)===t().chat_id?e(d):B(Ae)!==t().chat_id&&e(f,1)}),D(n),z(()=>r=q(n,1,`drow chatrow svelte-ledzjv`,null,r,{on:s().name===`chat`&&s().id===t().chat_id})),V(`click`,n,()=>ve(t().chat_id)),V(`keydown`,n,e=>xe(e,()=>ve(t().chat_id))),U(e,n)},t=(e,t=ue)=>{let n=j(()=>!t().paused&&t().next_run_at?vy(t().next_run_at):``);var r=Bw();let i;var a=F(r),o=F(a),c=e=>{var t=Ow();$(F(t),{name:`pause`,size:14}),D(t),U(e,t)},l=e=>{var t=kw();$(F(t),{name:`help-circle`,size:14}),D(t),U(e,t)},u=e=>{var n=Aw(),r=F(n);{let e=j(()=>Je(t().last_run.status).icon);$(r,{get name(){return B(e)},size:14})}D(n),z(()=>{q(n,1,`statusicon ${t().last_run.status??``}`,`svelte-ledzjv`),J(n,`title`,t().last_run.status)}),U(e,n)},f=e=>{var t=jw();$(F(t),{name:`clock`,size:14}),D(t),U(e,t)};G(o,e=>{t().paused?e(c):t().needs_input?e(l,1):t().last_run?e(u,2):e(f,-1)});var p=R(o,2),m=e=>{var n=xw();za(n),ua(n,e=>Pe?.(e)),z(()=>Ba(n,B(Le))),V(`input`,n,e=>N(Le,e.currentTarget.value,!0)),V(`click`,n,e=>e.stopPropagation()),V(`keydown`,n,e=>{e.key===`Enter`?Ge(t()):e.key===`Escape`&&N(Ie,``)}),Oi(`blur`,n,()=>Ge(t())),U(e,n)},h=e=>{var n=Pw(),r=I(n),i=L(r,!0),a=R(r,2),o=e=>{var n=Mw(),r=L(n,!0);z(()=>{J(n,`title`,`${t().unread??``} unread`),W(r,t().unread)}),U(e,n)},s=e=>{var n=Nw(),r=L(n,!0);z((e,i)=>{q(n,1,`rowtime lastrun ${t().last_run.status??``}`,`svelte-ledzjv`),J(n,`title`,`Last run: ${e??``}`),W(r,i)},[()=>Je(t().last_run.status).label,()=>uy(t().last_run.ended_at||t().last_run.started_at)]),U(e,n)};G(a,e=>{t().unread?e(o):t().last_run&&e(s,1)}),z(()=>W(i,t().name)),U(e,n)};G(p,e=>{B(Ie)===t().id?e(m):e(h,-1)});var g=R(p,2),_=e=>{var n=Cw(),r=R(F(n),2),i=L(r,!0),a=R(r,2);D(n),z(()=>{r.disabled=B(ze)===t().id,W(i,B(ze)===t().id?`…`:`yes`)}),V(`click`,n,e=>e.stopPropagation()),V(`click`,r,e=>{e.stopPropagation(),Ke(t().id)}),V(`click`,a,e=>{e.stopPropagation(),N(Re,``)}),U(e,n)},v=e=>{var n=Iw(),r=I(n);$(F(r),{name:`ellipsis-vertical`,size:14}),D(r);var i=R(r,2),a=e=>{var n=Fw(),r=F(n),i=F(r);$(i,{name:`star`,size:14});var a=R(i);D(r);var o=R(r,2);$(F(o),{name:`pencil`,size:14}),tt(),D(o);var s=R(o,2),c=F(s);{let e=j(()=>t().paused?`play`:`pause`);$(c,{get name(){return B(e)},size:14})}var l=R(c);D(s);var u=R(s,2);$(F(u),{name:`pencil`,size:14}),tt(),D(u);var d=R(u,4);$(F(d),{name:`trash`,size:14}),tt(),D(d),D(n),z(()=>{xa(n,`left:${B(De).x??``}px; top:${B(De).y??``}px`),W(a,` ${t().starred?`Unstar`:`Star`}`),W(l,` ${t().paused?`Enable`:`Disable`}`)}),V(`click`,n,e=>e.stopPropagation()),V(`click`,r,()=>He(t())),V(`click`,o,()=>We(t())),V(`click`,s,()=>Ve(t())),V(`click`,u,()=>Ue(t())),V(`click`,d,()=>{N(Fe,``),N(Re,t().id,!0)}),U(e,n)};G(i,e=>{B(Fe)===t().id&&e(a)}),z(()=>J(r,`aria-expanded`,B(Fe)===t().id)),V(`click`,r,e=>Be(e,t())),U(e,n)};G(g,e=>{B(Re)===t().id?e(_):B(Ie)!==t().id&&e(v,1)}),D(a);var y=R(a,2),b=e=>{var r=zw(),i=F(r),a=e=>{var n=Lw(),r=L(n,!0);z(e=>{J(n,`title`,t().schedule_desc),W(r,e)},[()=>d(t().schedule_desc)||t().schedule_desc]),U(e,n)};G(i,e=>{t().schedule.kind!==`manual`&&e(a)});var o=R(i,2),s=e=>{var t=Rw(),r=L(t,!0);z(()=>W(r,B(n))),U(e,t)};G(o,e=>{B(n)&&e(s)}),D(r),U(e,r)};G(y,e=>{(t().schedule.kind!==`manual`||B(n))&&B(Ie)!==t().id&&e(b)}),D(r),z(()=>i=q(r,1,`drow ttask svelte-ledzjv`,null,i,{on:s().name===`task`&&s().id===t().id,unseen:t().unread>0})),V(`click`,r,()=>ye(t().id)),V(`keydown`,r,e=>xe(e,()=>ye(t().id))),U(e,r)};var Xe=F(Ye);hC(Xe,{side:`left`,get width(){return cs},get clamp(){return lo}});var Ze=R(Xe,2),Qe=F(Ze),$e=R(Qe,2);tt(2),D(Ze);var et=R(Ze,2),nt=e=>{var t=qw(),n=F(t),r=F(n);K(r,17,()=>B(b),e=>e.id,(e,t)=>{let n=j(()=>B(t).id===B(g).id);var r=Hw();let i;var a=F(r),o=L(a,!0),s=R(a,2),c=e=>{U(e,Vw())},l=j(()=>ae(B(t).id));G(s,e=>{B(l)&&e(c)}),D(r),z((e,a,s)=>{i=q(r,1,`chip svelte-ledzjv`,null,i,{active:B(n)}),xa(r,`--p:${B(t).accent??``}; --p-ink:${e??``}`),J(r,`title`,a),J(r,`aria-selected`,B(n)),J(r,`aria-current`,B(n)?`true`:void 0),W(o,s)},[()=>_(B(t).accent),()=>h(B(t)),()=>v(B(t))]),V(`click`,r,()=>B(n)?null:y(B(t).id)),U(e,r)});var i=R(r,2),a=e=>{let t=j(()=>B(x).some(e=>e.id===B(g).id)),n=j(()=>B(x).some(e=>ae(e.id)));var r=Uw();let i;var a=F(r),o=L(a),s=R(a,2),c=e=>{U(e,Vw())};G(s,e=>{B(n)&&e(c)}),D(r),z(()=>{i=q(r,1,`chip more svelte-ledzjv`,null,i,{active:B(t)}),J(r,`aria-expanded`,B(S)),W(o,`+${B(x).length??``}`)}),V(`click`,r,()=>N(S,!B(S))),U(e,r)};G(i,e=>{B(x).length&&e(a)});var o=R(i,2);$(F(o),{name:`plus`,size:15}),D(o),D(n);var s=R(n,2),c=L(s,!0),l=R(s,2),u=e=>{var t=Kw();K(t,21,()=>B(x),e=>e.id,(e,t)=>{let n=j(()=>B(t).id===B(g).id);var r=Gw();let i;var a=F(r),o=R(a,2),s=L(o,!0),c=R(o,2),l=e=>{U(e,Ww())},u=j(()=>ae(B(t).id));G(c,e=>{B(u)&&e(l)});var d=R(c,2),f=e=>{$(e,{name:`check`,size:13})};G(d,e=>{B(n)&&e(f)}),D(r),z(e=>{i=q(r,1,`profitem svelte-ledzjv`,null,i,{active:B(n)}),J(r,`title`,e),J(r,`aria-current`,B(n)?`true`:void 0),xa(a,`--dot:${B(t).accent??``}`),W(s,B(t).name)},[()=>h(B(t))]),V(`click`,r,()=>B(n)?N(S,!1):y(B(t).id)),U(e,r)}),D(t),U(e,t)};G(l,e=>{B(S)&&B(x).length&&e(u)}),D(t),z(()=>{J(s,`title`,B(g).name),W(c,B(g).name)}),V(`click`,o,()=>N(T,!0)),U(e,t)};G(et,e=>{B(g)&&e(nt)});var rt=R(et,2),it=e=>{var t=Jw(),n=I(t),r=R(n,2);wS(R(F(r),4),{get claimed(){return B(ee)},submitLabel:`Create profile`,busyLabel:`Creating…`,onSubmit:te,onCancel:()=>N(T,!1)}),D(r),V(`click`,n,()=>N(T,!1)),U(e,t)};G(rt,e=>{B(T)&&e(it)});var at=R(rt,2),ot=e=>{MC(e,{get chatId(){return B(Ee)},onClose:()=>N(Ee,``)})};G(at,e=>{B(Ee)&&e(ot)});var st=R(at,2),ct=F(st);let n;$(F(ct),{name:`message`,size:14}),tt(),D(ct);var lt=R(ct,2);let o;$(F(lt),{name:`list`,size:14}),tt(),D(lt);var ut=R(lt,2);let c;$(F(ut),{name:`folder`,size:14}),tt(),D(ut),D(st);var dt=R(st,2),ft=e=>{yw(e,{})},pt=n=>{var o=tT(),c=F(o),l=t=>{var n=$w(),i=I(n);$(F(i),{name:`plus`,size:15}),tt(),D(i);var o=R(i,2),s=e=>{var t=Yw(),n=L(t,!0);z(()=>W(n,a()?`No conversations yet.`:`Loading…`)),U(e,t)};G(o,e=>{r().length||e(s)});var c=R(o,2),l=t=>{var n=Xw();K(R(I(n),2),17,()=>B(pe),e=>e.chat_id,(t,n)=>{e(t,()=>B(n))}),U(t,n)};G(c,e=>{B(pe).length&&e(l)}),K(R(c,2),17,()=>B(me),({item:e,sep:t})=>e.chat_id,(t,n)=>{let r=()=>B(n).item,i=()=>B(n).sep;var a=Qw(),o=I(a),s=e=>{var t=Zw(),n=L(t,!0);z(()=>W(n,i())),U(e,t)};G(o,e=>{i()&&e(s)});var c=R(o,2);e(c,r),U(t,a)}),V(`click`,i,be),U(t,n)},u=e=>{var n=eT(),r=I(n);$(F(r),{name:`plus`,size:15}),tt(),D(r);var o=R(r,2),s=e=>{var t=Yw(),n=L(t,!0);z(()=>W(n,a()?`No tasks yet.`:`Loading…`)),U(e,t)};G(o,e=>{i().length||e(s)});var c=R(o,2),l=e=>{var n=Xw();K(R(I(n),2),17,()=>B(ge),e=>e.id,(e,n)=>{t(e,()=>B(n))}),U(e,n)};G(c,e=>{B(ge).length&&e(l)}),K(R(c,2),17,()=>B(_e),({item:e,sep:t})=>e.id,(e,n)=>{let r=()=>B(n).item,i=()=>B(n).sep;var a=Qw(),o=I(a),s=e=>{var t=Zw(),n=L(t,!0);z(()=>W(n,i())),U(e,t)};G(o,e=>{i()&&e(s)});var c=R(o,2);t(c,r),U(e,a)}),V(`click`,r,()=>ye(`new`)),U(e,n)};G(c,e=>{s().tab===`chats`?e(l):e(u,-1)}),D(o),Oi(`scroll`,o,()=>{N(Te,``),N(Fe,``)}),U(n,o)};G(dt,e=>{s().tab===`files`?e(ft):e(pt,-1)});var mt=R(dt,2),ht=e=>{var t=nT(),n=F(t);$(F(n),{name:`cpu`,size:13}),D(n);var r=L(R(n));D(t),z(()=>{J(t,`title`,B(fe)),W(r,`Today · ${B(de)??``}`)}),U(e,t)};G(mt,e=>{B(de)&&e(ht)});var gt=R(mt,2),_t=F(gt);$(F(_t),{name:`settings`,size:15}),tt(),D(_t),D(gt),D(Ye),z(()=>{J(Qe,`src`,TS),J($e,`src`,ES),n=q(ct,1,`seg`,null,n,{on:s().tab===`chats`}),J(ct,`aria-selected`,s().tab===`chats`),o=q(lt,1,`seg`,null,o,{on:s().tab===`tasks`}),J(lt,`aria-selected`,s().tab===`tasks`),c=q(ut,1,`seg`,null,c,{on:s().tab===`files`}),J(ut,`aria-selected`,s().tab===`files`)}),V(`click`,ct,()=>Fs(`/chats`)),V(`click`,lt,()=>Fs(`/tasks`)),V(`click`,ut,()=>Fs(`/files`)),V(`click`,_t,()=>Rs(`settings`,`general`))}U(e,Ye),k(),l()}ki([`click`,`keydown`,`input`]);var aT=Wt({configs:[],active:null,envOverride:null,providerDeps:{},builtinByType:{},builtinOptionsByType:{},paramsByType:{},loaded:!1});async function oT(){let e=await Q.llmConfigs();aT.set({configs:e.configs||[],active:e.active??null,envOverride:e.env_override??null,providerDeps:e.provider_deps||{},builtinByType:e.builtin_tools_by_type||{},builtinOptionsByType:e.builtin_options_by_type||{},paramsByType:e.params_by_type||{},loaded:!0})}function sT(e){return e.deps&&!e.deps.ok||e.key_source===`none`?!1:e.type!==`openai_subscription`||!!e.signed_in}var cT=e=>`@`+String(e??``);function lT(e){return{path:e.path,name:e.name,dir:e.dir||``,kind:e.kind||`file`,label:cT(e.name)}}function uT(e,t){let n=String(e??``),r=Math.max(0,Math.min(t??n.length,n.length)),i=r;for(;i>0&&!/\s/.test(n[i-1]);)i--;return n[i]===`@`?{start:i,query:n.slice(i+1,r)}:null}function dT(e,t,n,r){let i=String(e??``),a=i.slice(0,t),o=i.slice(n),s=r+` `;return{text:a+s+o,caret:a.length+s.length}}var fT=e=>e!==``&&/[A-Za-z0-9_]/.test(e),pT=(e,t)=>{if(!t)return 0;let n=0,r=0;for(;(r=e.indexOf(t,r))!==-1;){let i=r===0?``:e[r-1],a=e[r+t.length]??``;(i===``||/\s/.test(i))&&!fT(a)&&(n+=1),r+=t.length}return n};function mT(e,t){let n=String(t??``),r=new Map,i=[];for(let t of e||[]){r.has(t.label)||r.set(t.label,pT(n,t.label));let e=r.get(t.label)??0;e>0&&(r.set(t.label,e-1),i.push(t))}return i}function hT(e){return!e||!e.length?``:`Referenced files: +`).trim(),composing:r}}function ob(e){let{composing:t}=ab(e);return t&&String(e||``).match(/"(?:createSurface|updateComponents|updateDataModel)"\s*:\s*\{[^}]*"surfaceId"\s*:\s*"([^"\\]+)"/)?.[1]||null}var sb=`Interactive view`;function cb(e={}){return typeof e.title==`string`&&e.title?e.title:sb}function lb(e={},t={}){let n={...t};for(let[t,r]of Object.entries(e))[`id`,`component`,`accessibility`,`_components`].includes(t)||(n[t]=r);return n}function ub(e,t,n,r){let i=e.find(e=>e.kind===`a2ui`&&e.surfaceId===t);return i||(i={id:Sy(),kind:`a2ui`,version:r||`v1.0`,catalogId:n||`https://ag2.ai/assistant/a2ui/catalog.json`,surfaceId:t,title:sb,intent:``,component:{},data:{},messages:[]},e.push(i)),i}function db(e,t){if(!wy(t))return null;let n=fb(t.version)||`v1.0`;if(wy(t.createSurface)){let r=t.createSurface,i=ub(e,fb(r.surfaceId)||Ey(),fb(r.catalogId)||`https://ag2.ai/assistant/a2ui/catalog.json`,n);return vb(i).push(t),i}if(wy(t.updateComponents)){let r=t.updateComponents,i=ub(e,fb(r.surfaceId)||Ey(),void 0,n),a=hb(r.components);i.components=a;let o=mb(a.find(e=>e.id===`root`)??a[0]);return i.component=o,i.data=lb(o,i.data),i.title=cb(i.data),vb(i).push(t),i}if(wy(t.updateDataModel)){let r=t.updateDataModel,i=ub(e,fb(r.surfaceId)||Ey(),void 0,n),a=fb(r.path);return i.data=!a||a===`/`?wy(r.value)?r.value:{value:r.value}:Zy(i.data,a,r.value),i.title=cb(i.data),vb(i).push(t),i}if(wy(t.deleteSurface)){let n=fb(t.deleteSurface.surfaceId),r=e.findIndex(e=>e.kind===`a2ui`&&e.surfaceId===n);r>=0&&e.splice(r,1)}return null}var fb=e=>typeof e==`string`?e:``;function pb(e){return Array.isArray(e)?e.filter(Boolean):[]}var mb=e=>wy(e)?e:{},hb=e=>pb(e);function gb(e,t={},n=``){return Array.isArray(e)?e.map(e=>gb(e,t,n)):wy(e)?typeof e.path==`string`&&Object.keys(e).length===1?ky(e,t,n):Object.fromEntries(Object.entries(e).map(([e,r])=>[e,gb(r,t,n)])):e}var _b=(e,t=``)=>wy(e)&&typeof e.path==`string`?Oy(e.path,t):``,vb=e=>e.messages??=[],yb=e=>e.split(`.`).pop()??e;function bb(e){return(e??[]).filter(e=>yb(e.__event__??``)===`TextInput`).map(e=>e.content??``).join(` +`).trim()}function xb(e,t,n=null){if(!t)return;let r=Sb(t),i=e[e.length-1],a;i&&i.kind===`tools`?a=i:(a={id:Sy(),kind:`tools`,names:[],cards:[]},e.push(a));let o=a.names[a.names.length-1];o&&o.name===r?o.n++:a.names.push({name:r,n:1}),n&&a.cards.push({...n,id:Sy()})}function Sb(e){return e.startsWith(`repo_files_`)?`repo-files · `+e.slice(11):e.replace(/_/g,` `)}function Cb(e){for(let t=e.length-1;t>=0;t--){let n=e[t];n.kind===`note`&&n.a2uiActionPending&&e.splice(t,1)}}function wb(e){for(let t=e.length-1;t>=0;t--){let n=e[t];if(n.kind===`note`&&n.ends||n.kind===`agent`&&!n.streaming)return!1;if(n.kind===`user`)return!0}return!1}var Tb={TaskStarted:{icon:`zap`,text:`Task started`},TaskCompleted:{icon:`check`,text:`Task completed`},TaskFailed:{icon:`x`,text:`Task failed`},TaskCancelled:{icon:`x`,text:`Task cancelled`}},Eb=new Set([`ag2-assistant`]);function Db(e){return!e.agent_name||Eb.has(e.agent_name)}function Ob(e){return e===`TaskStarted`?`running`:e===`TaskCompleted`?`completed`:e===`TaskCancelled`?`cancelled`:`failed`}function kb(e){if(!e)return``;if(typeof e==`string`)return e;if(typeof e==`object`){if(`message`in e&&typeof e.message==`string`&&e.message)return e.message;if(`content`in e&&typeof e.content==`string`&&e.content)return e.content}return String(e)}function Ab(e){return e?(typeof e==`string`?e:JSON.stringify(e)).replace(/\s+/g,` `).trim().slice(0,240):``}function jb(e,t,n){let r=e.find(e=>e.kind===`subagent`&&e.taskId===t);if(r)return r;let i={id:Sy(),kind:`subagent`,taskId:t,agent:n||`subagent`,objective:``,status:`running`,items:[]};return e.push(i),i}function Mb(e,t,n){let r=jb(e,n.task_id||`${n.agent_name}:${n.objective||``}`,n.agent_name??``);r.status=Ob(t),n.agent_name&&(r.agent=n.agent_name),n.objective&&(r.objective=n.objective),t===`TaskCompleted`&&(r.result=Ab(n.result)),t===`TaskFailed`&&(r.error=kb(n.error)),t===`TaskCancelled`&&(r.error=n.reason||`cancelled`)}function Nb(e,t){return t&&e.push({id:Sy(),kind:`user`,text:t,queued:!0}),e}var Pb=new Set(Yh);function Fb(e){return Pb.has(e)}function Ib(e){throw Error(`unhandled event: ${String(e)}`)}function Lb(e,t){let n=e.length;try{let n=yb(t.type);Fb(n)&&Hb(e,n,t.data)}catch(e){console.warn(`[project] ${t.type}`,e)}let r=Jh.safeParse(t.data),i=r.success?r.data.created_at:void 0;for(let t=n;t0&&e[t-1].kind!==`user`;)t--;return e.slice(t)}function zb(e){return Rb(e).some(e=>e.kind===`a2ui`)}function Bb(e){for(let t of Rb(e))t.kind===`agent`&&t.empty&&(t.text=``,t.empty=!1)}function Vb(e,t,n){return t===`message`?e.kind===`agent`&&String(e.at)===n:t===`image`?e.kind===`genimage`&&e.path===n:t===`deliverable`&&e.kind===`deliverable`&&e.deliverableId===n}function Hb(e,t,n){switch(t){case`ModelRequest`:case`DrainedModelRequest`:{let t=bb(Kh.ModelRequest.parse(n).parts);if(!t||t.startsWith(`[[A2UI_ACTION]]`))break;let r=e.find(e=>e.kind===`user`&&!!e.queued&&e.text===t);r?r.queued=!1:e.push({id:Sy(),kind:`user`,text:t});break}case`ModelMessageChunk`:{let t=Kh.ModelMessageChunk.parse(n),r=e[e.length-1];r&&r.kind===`agent`&&r.streaming?r.text+=t.content??``:e.push({id:Sy(),kind:`agent`,text:t.content??``,streaming:!0});break}case`ModelResponse`:{let t=Kh.ModelResponse.parse(n),r=t.message?.content,i=t.tool_calls?.calls??[];(r||!i.length)&&Cb(e);let a=[...e].reverse().find(e=>e.kind===`agent`&&!!e.streaming);if(r)a?(a.text=r,a.streaming=!1):e.push({id:Sy(),kind:`agent`,text:r});else if(!i.length){let t=zb(e),n=t?``:`_(no reply)_`;a?(a.text=n,a.streaming=!1,a.empty=!t):e.push({id:Sy(),kind:`agent`,text:n,empty:!t})}break}case`ToolCallsEvent`:{let t=Kh.ToolCallsEvent.parse(n);for(let n of t.calls??[])xb(e,n.name,cy(n.name,n.arguments));break}case`TaskCreated`:{let t=Kh.TaskCreated.parse(n);e.push({id:Sy(),kind:`taskcard`,taskId:t.task_id,title:t.title,scheduled:t.kind===`scheduled`});break}case`TaskScheduled`:{let t=Kh.TaskScheduled.parse(n),r=t.recurrence?` · `+(t.recurrence_desc||`repeats `+t.recurrence):``;e.push({id:Sy(),kind:`note`,icon:`clock`,text:`Scheduled for ${py(t.scheduled_for)}${r}`});break}case`TaskStarted`:case`TaskCompleted`:case`TaskFailed`:case`TaskCancelled`:{let r=Kh.TaskLifecycle.parse(n);Db(r)?e.push({id:Sy(),kind:`note`,icon:Tb[t].icon,text:Tb[t].text}):Mb(e,t,r);break}case`SubagentTrace`:{let t=Kh.SubagentTrace.parse(n),r=t.subagent_id??``,i=jb(e,r,yb(r.split(`:`).pop()??``));t.inner&&Lb(i.items,qh.parse(t.inner));break}case`ObserverAlert`:{let t=Kh.ObserverAlert.parse(n),r=e[e.length-1];(r&&`text`in r?r.text:void 0)!==t.message&&e.push({id:Sy(),kind:`note`,icon:`zap`,text:t.message,alert:!0});break}case`DeliverableProduced`:{let t=Kh.DeliverableProduced.parse(n);e.push({id:Sy(),kind:`deliverable`,taskId:t.task_id,deliverableId:t.deliverable_id,description:t.description,preview:t.preview,path:t.path});break}case`ImageGenerated`:{let t=Kh.ImageGenerated.parse(n);e.push({id:Sy(),kind:`genimage`,path:t.path,prompt:t.prompt});break}case`EphemeralCard`:case`A2UISurface`:{let r=Kh.A2UISurface.parse(n),i=e.find(e=>e.kind===`a2ui`&&e.surfaceId===r.surface_id);i||(i={id:Sy(),kind:`a2ui`,surfaceId:r.surface_id,component:{},data:{}},e.push(i));let a=r.component?._components;i.version=r.version,i.catalogId=r.catalog_id,i.title=r.title,i.intent=r.intent;let o=mb(r.component),s=hb(Array.isArray(a)?a:r.components);if((o.component||s.length)&&(i.component=o,i.components=s),i.data=r.data??{},t===`EphemeralCard`){let e=Kh.EphemeralCard.parse(n);i.draft={id:e.draft_id,version:e.draft_version,name:e.definition.name}}Bb(e);break}case`CardDefinitionSaved`:{let t=Kh.CardDefinitionSaved.parse(n);e.push({id:Sy(),kind:`note`,icon:`check`,text:`Saved ${t.name} to ${t.path}`});break}case`A2UISurfaceDataUpdated`:{let t=Kh.A2UISurfaceDataUpdated.parse(n),r=e.find(e=>e.kind===`a2ui`&&e.surfaceId===t.surface_id);r&&(r.data=t.data??{});break}case`A2UIActionSubmitted`:{let t=Kh.A2UIActionSubmitted.parse(n);Cb(e),e.push({id:Sy(),kind:`note`,icon:`rotate-cw`,pending:!0,a2uiActionPending:!0,surfaceId:t.surface_id,text:``});break}case`A2UIMessageEvent`:db(e,Kh.A2UIMessageEvent.parse(n).message)&&Bb(e);break;case`Attachment`:{let t=Kh.Attachment.parse(n);e.push({id:Sy(),kind:`attachment`,path:t.path,name:t.name});break}case`InquiryRaised`:{let t=Kh.InquiryRaised.parse(n);e.push({id:Sy(),kind:`inquiry`,inquiryId:t.inquiry_id,question:t.question,detail:t.detail??``,options:t.options??[],qkind:t.kind,resolved:!1});break}case`InquiryAnswered`:{let t=Kh.InquiryAnswered.parse(n),r=e.find(e=>e.kind===`inquiry`&&e.inquiryId===t.inquiry_id);r&&(r.resolved=!0,r.answer=t.answer,r.resolution=t.status||`answered`);break}case`TurnCancelled`:{let t=Kh.TurnCancelled.parse(n),r=e[e.length-1];r&&r.kind===`agent`&&r.streaming&&(r.streaming=!1),e.push({id:Sy(),kind:`note`,icon:`x`,text:t.reason||`Stopped`,ends:!0});break}case`TurnFailed`:{let t=Kh.TurnFailed.parse(n),r=e[e.length-1];r&&r.kind===`agent`&&r.streaming&&(r.streaming=!1),e.push({id:Sy(),kind:`note`,icon:`x`,text:t.error||`The turn failed unexpectedly.`,alert:!0,ends:!0});break}case`FeedbackGiven`:{let t=Kh.FeedbackGiven.parse(n);for(let n=e.length-1;n>=0;n--){let r=e[n];if(Vb(r,t.target_kind,t.target_id)){r.feedback={sentiment:t.sentiment,reason:t.reason};break}}break}case`FeedbackCleared`:{let t=Kh.FeedbackGiven.parse(n);for(let n=e.length-1;n>=0;n--){let r=e[n];if(Vb(r,t.target_kind,t.target_id)){r.feedback=null;break}}break}default:Ib(t)}}var Ub=null,Wb=null,Gb=!1,Kb=[],qb=Wt({active:!1,status:`off`}),Jb=null,Yb=!1,Xb=!1,Zb=null,Qb=null,$b=600;function ex(e){ts.update(t=>{let n=t.length>=$b?t.slice(t.length-$b+1):t;return[...n,{...e,_t:Date.now(),_id:(n.at(-1)?._id||0)+1}]})}function tx(e,t){cx(),Xb=!1,Gb=!0,Kb=[];let n=e===`run`?`task-run:`+t:t;Fo.set({id:t,kind:e,chat:n,items:[],busy:!1}),ts.set([]),Io.set(fo(n)),Ub=new ig(n,{onOpen:()=>{Gb=!0,Kb=[]},onEvent:e=>{if(ex(e),!Xb){if(Gb){Lb(Kb,e);return}Fo.update(t=>(Lb(t.items,e),{...t,items:t.items,busy:wb(t.items)}))}},onReady:()=>{if(!Gb)return;Gb=!1;let e=Kb;Kb=[],Fo.update(t=>({...t,items:e,busy:wb(e)}))},onTurnEnd:()=>Fo.update(e=>({...e,busy:!1})),onQueued:e=>Fo.update(t=>(Nb(t.items,e.text??``),{...t,items:t.items,busy:!0})),onError:e=>Fo.update(t=>(t.items.push({id:Sy(),kind:`note`,icon:`x`,text:e.message||`error`,alert:!0}),{...t,busy:!1}))}).connect(),e===`run`?(_x=!1,Vo.set(null),vx(t),Wb=setInterval(()=>vx(t),3e3)):Vo.set(null)}function nx(e,t=[]){if(!Ub||!e.trim()&&!t.length)return;Fo.update(e=>({...e,busy:!0}));let n=Kt(Fo),r=``,i=Kt(Io);if(i.chatId===n.chat){let e=ho(i);Io.set(e.state),r=e.model}Ub.send(e,t,r),n.kind===`chat`&&e.trim()&&Lo.update(t=>t.some(e=>e.chat_id===n.chat)?t:[{chat_id:n.chat,preview:e.trim().slice(0,80),updated:new Date().toISOString(),turns:0,title:``,starred:!1},...t])}function rx(){Ub&&Ub.cancel()}function ix(e,t){Ub&&Ub.answer(e,t)}function ax(e,t){Ub&&Ub.a2ui(e,t)}function ox({targetKind:e,targetId:t,sentiment:n,reason:r,content:i=``,request:a=``}){Ub&&Ub.feedback({target_kind:e,target_id:t,sentiment:n,reason:r,content:i,request:a})}function sx({targetKind:e,targetId:t}){Ub&&Ub.clearFeedback({target_kind:e,target_id:t})}function cx(){Jb&&=(Jb.stop(),null),Yb=!1,Zb=null,Qb=null,Ub&&=(Ub.close(),null),Wb&&=(clearInterval(Wb),null)}function lx(){cx(),Fo.set({id:null,kind:`chat`,chat:``,items:[],busy:!1}),Io.set(uo),Lo.set([]),Ro.set([]),Vo.set(null),Uo.set([]),ts.set([]),Jo.set(null),Po.update(e=>e+1)}function ux(e){if(!(!e||e===hs()))try{lx(),Kt(js).aside?.kind===`file`&&Ws(),gs(e);let t=Kt(No).list.find(t=>t.id===e);t?.accent&&h(t.accent),No.update(t=>({...t,activeId:e})),Fs(`/`,e)}catch(t){console.warn(`[profile] in-place switch failed; falling back to reload`,t),location.assign(`/app/`+e+`/`+location.hash)}}function dx(e){Fo.update(t=>({...t,busy:e}))}function fx(e,t,n){Fo.update(r=>{if(n&&e===`user`)return Zb&&Qb===`user`?Zb.text=t:r.items.push({id:Sy(),kind:`user`,text:t,voice:!0}),Zb=null,Qb=null,{...r,items:r.items,busy:!0};if(Zb&&Qb===e)Zb.text+=t;else{let n=e===`user`?{id:Sy(),kind:`user`,text:t,voice:!0}:{id:Sy(),kind:`agent`,text:t,voice:!0};Zb=n,r.items.push(n),Qb=e}return{...r,items:r.items}})}async function px(){let e=Kt(Fo);if(!e.id||Yb)return;let t=Kt(Po),n=`?chat=`+encodeURIComponent(e.chat),r=16e3;try{r=(await Q.voices()).input_rate||16e3}catch{}Kt(Po)===t&&(Yb=!0,Xb=!0,Zb=null,Qb=null,qb.set({active:!0,status:`connecting`}),Jb=new og(n,{onState:(e,t)=>{e===`off`?mx():qb.set({active:!0,status:t||e})},onTranscript:fx,onTurnEnd:()=>{Zb=null,Qb=null,dx(!1)},onEvent:e=>{ex(e),Fo.update(t=>(Lb(t.items,e),{...t,items:t.items}))},onAudio:()=>dx(!1)},r),await Jb.start()||(Yb=!1,Xb=!1,qb.set({active:!1,status:`off`})))}function mx(){Jb=null,Yb=!1,Zb=null,Qb=null,qb.set({active:!1,status:`off`}),Fo.update(e=>({...e,busy:!1})),setTimeout(()=>{Xb=!1},2e3)}function hx(){Jb&&Jb.stop()}var gx=new Set([`completed`,`failed`,`cancelled`]),_x=!1;async function vx(e){let t=Kt(Po),n;try{n=await Q.run(e)}catch{return}if(Kt(Po)!==t)return;let r=Kt(Fo);r.kind===`run`&&r.id===e&&(Vo.set(n),!_x&&n&&gx.has(n.status)&&(_x=!0,Q.runSeen(e).catch(()=>{})))}var yx=[{id:`research`,label:`Research`,icon:`search`},{id:`coding`,label:`Coding`,icon:`code`},{id:`scheduling`,label:`Scheduling`,icon:`clock`},{id:`writing`,label:`Writing`,icon:`file-text`},{id:`data`,label:`Data & reports`,icon:`list`},{id:`images`,label:`Images`,icon:`image`}],bx=e=>(yx.find(t=>t.id===e)||{label:e}).label,xx={openai:`OpenAI · Chat Completions`,openai_responses:`OpenAI · Responses`,openai_subscription:`OpenAI · ChatGPT subscription`,anthropic:`Anthropic`,gemini:`Gemini`,ollama:`Ollama`,claude_code:`Claude Code · CLI login`,codex:`Codex · CLI login`},Sx=`Subscription — no API key`,Cx=[Sx,`OpenAI`,`Anthropic`,`Google`,`Ollama`],wx={openai_subscription:Sx,claude_code:Sx,codex:Sx,openai_responses:`OpenAI`,openai:`OpenAI`,anthropic:`Anthropic`,gemini:`Google`,ollama:`Ollama`},Tx={openai_subscription:`OAuth`,claude_code:`ACP`,codex:`ACP`,openai_responses:`API key`,openai:`API key`,anthropic:`API key`,gemini:`API key`,ollama:`no key`},Ex={gemini:`Gemini`,openai:`OpenAI`},Dx={openai:`openai`,openai_responses:`openai`,openai_subscription:`openai`,anthropic:`anthropic`,gemini:`gemini`,ollama:`ollama`},Ox=[{id:`gemini-3.6-flash`,label:`Gemini 3.6 Flash`,provider:`gemini`,price:{in:.3,out:2.5},context:1e6,featured:!0},{id:`gemini-3.1-flash-lite`,label:`Gemini 3.1 Flash Lite`,provider:`gemini`,price:{in:.1,out:.4},context:1e6,featured:!0},{id:`gemini-3.1-pro-preview`,label:`Gemini 3.1 Pro Preview`,provider:`gemini`,price:{in:1.25,out:10},context:1e6,featured:!0},{id:`gpt-5.6-luna`,label:`GPT-5.6 Luna`,provider:`openai`,price:{in:.25,out:2},context:4e5,featured:!0},{id:`gpt-5.6-terra`,label:`GPT-5.6 Terra`,provider:`openai`,price:{in:1.25,out:10},context:4e5,featured:!0},{id:`gpt-5.6-sol`,label:`GPT-5.6 Sol`,provider:`openai`,price:{in:5,out:40},context:4e5,featured:!0},{id:`gpt-5.4-mini`,label:`GPT-5.4 Mini`,provider:`openai`,price:{in:.25,out:2},context:4e5,featured:!0},{id:`gpt-5.4-nano`,label:`GPT-5.4 Nano`,provider:`openai`,price:{in:.05,out:.4},context:4e5,featured:!0},{id:`claude-sonnet-5`,label:`Claude Sonnet 5`,provider:`anthropic`,price:{in:3,out:15},context:2e5,featured:!0},{id:`claude-haiku-4.5`,label:`Claude Haiku 4.5`,provider:`anthropic`,price:{in:1,out:5},context:2e5,featured:!0},{id:`claude-opus-4-8`,label:`Claude Opus 4.8`,provider:`anthropic`,price:{in:5,out:25},context:2e5,featured:!0},{id:`MiniMax-M2.5`,label:`MiniMax M2.5`,provider:`anthropic`,price:{in:.3,out:1.2},context:2e5,featured:!1},{id:`llama3.2`,label:`Llama 3.2`,provider:`ollama`,price:{in:0,out:0},context:128e3,featured:!0}];function kx(e){return Dx[e]||``}function Ax(e){if(e)return Ox.find(t=>t.id===e)}function jx(e){let t=kx(e);return t?Ox.filter(e=>e.provider===t):[]}function Mx(e){return jx(e).filter(e=>e.featured)}var Nx=e=>e>=1?`$${e}`:`$${e.toFixed(2)}`;function Px(e){let t=e?.price;return!t||typeof t.in!=`number`||typeof t.out!=`number`?``:!t.in&&!t.out?`Free`:`${Nx(t.in)} / ${Nx(t.out)} per M`}function Fx(e){let t=e?.context;return typeof t!=`number`||!t?``:`${t>=1e6?`${+(t/1e6).toFixed(1)}M`:`${Math.round(t/1e3)}K`} context`}var Ix={claude:`@agentclientprotocol/claude-agent-acp`,codex:`@agentclientprotocol/codex-acp`},Lx={claude:`claude_code`,codex:`codex`};function Rx(e,t){let n=!!e&&typeof e==`object`,r=n&&e?.mode||`local`,i=r!==`bridge`||e?.connected!==!1,a=n?(e?.agents||[]).find(e=>e.name===t):null;return{loaded:n,mode:r,connected:i,available:n&&i&&!!a?.available}}function zx(e,t){return e?.available?e.mode===`bridge`||!!t&&typeof t==`object`&&!t.reason:!1}function Bx(e,t,n){return t?.loaded?t.mode===`bridge`&&!t.connected?`The host ACP bridge is unreachable — check AG2ASSISTANT_ACP_BRIDGE for this container.`:t.available?t.mode===`bridge`?`Reached through the host ACP bridge. The model list can't be read from inside the container, so this runs on the CLI's own model.`:n===void 0||n===`loading`?``:n?.reason===`adapter_missing`?`Not installed: run npm i -g ${Ix[e]}, then re-check.`:n?.reason?`The adapter is installed but didn't answer — check the CLI is logged in, then re-check.`:``:`Not installed: run npm i -g ${Ix[e]} and log in to the CLI, then re-check.`:``}function Vx(e){let t=typeof e==`object`?e?.current:``;return t?`CLI default (${t})`:`CLI default`}var Hx=/^(.+?)\s*\[([^\]]+)\]$/,Ux={minimal:`Minimal`,low:`Light`,medium:`Medium`,high:`High`,xhigh:`Extra High`,max:`Max`,ultra:`Ultra`};function Wx(e){let t=Hx.exec(e||``);return t?{family:t[1].trim(),effort:t[2].trim()}:{family:(e||``).trim(),effort:``}}function Gx(e,t){return e?t?`${e}[${t}]`:e:``}function Kx(e){return e?Ux[e]||e.charAt(0).toUpperCase()+e.slice(1):`Default`}function qx(e,t){return(e||``).replace(/\s*\([^)]*\)\s*$/,``).trim()||t}function Jx(e){let t=[],n=new Map;for(let r of e||[]){let{family:e,effort:i}=Wx(r.id);if(!e)continue;let a=n.get(e);a||(a={family:e,label:qx(r.name,e),efforts:[]},n.set(e,a),t.push(a)),i&&!a.efforts.some(e=>e.value===i)&&a.efforts.push({value:i,label:Kx(i)})}return t}var Yx={plus:``,send:``,settings:``,folder:``,"folder-plus":``,paperclip:``,mic:``,search:``,sparkles:``,cpu:``,clock:``,check:``,"chevron-left":``,"chevron-right":``,"chevron-down":``,x:``,code:``,eye:``,sun:``,moon:``,contrast:``,image:``,"image-off":``,"file-x":``,"file-text":``,file:``,"file-code":``,"file-image":``,"file-spreadsheet":``,"file-archive":``,"file-play":``,"file-music":``,download:``,trash:``,list:``,message:``,bot:``,globe:``,brain:``,zap:``,"trending-up":``,"rotate-cw":``,"thumbs-up":``,"thumbs-down":``,users:``,archive:``,"alert-triangle":``,square:``,maximize:``,minimize:``,"maximize-2":``,"minimize-2":``,"arrow-up":``,waveform:``,copy:``,palette:``,"ellipsis-vertical":``,star:``,pencil:``,play:``,pause:``,"help-circle":``,slash:``,spinner:``},Xx=new Set([`$$slots`,`$$events`,`$$legacy`,`name`,`size`,`strokeWidth`]),Zx=Ri(``);function $(e,t){let n=ro(t,`size`,3,18),r=ro(t,`strokeWidth`,3,2),i=no(t,Xx);var a=Zx();Ua(a,()=>({xmlns:`http://www.w3.org/2000/svg`,width:n(),height:n(),viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":r(),"stroke-linecap":`round`,"stroke-linejoin":`round`,style:`display:inline-block;flex:none;vertical-align:middle`,"aria-hidden":`true`,...i,[Aa]:{spin:t.name===`spinner`}}),void 0,void 0,void 0,`svelte-13so817`),sa(a,()=>Yx[t.name]||``,!0),D(a),U(e,a)}var Qx=H(``),$x=H(`
Theme
`);function eS(e,t){O(t,!0);let n=M(P(C())),r=[{id:`light`,label:`Light`,icon:`sun`},{id:`dark`,label:`Dark`,icon:`moon`},{id:`auto`,label:`Auto`,icon:`contrast`}];function i(e){N(n,e,!0),S(e)}hr(()=>{let e=e=>{N(n,e.detail.theme,!0)};return document.addEventListener(`ag2-theme-change`,e),()=>document.removeEventListener(`ag2-theme-change`,e)});var a=$x(),o=R(F(a),2);K(o,21,()=>r,Qi,(e,t)=>{var r=Qx();let a;var o=F(r);$(o,{get name(){return B(t).icon},size:15});var s=R(o);D(r),z(()=>{a=q(r,1,`ap-theme svelte-1sms2nq`,null,a,{on:B(n)===B(t).id}),W(s,` ${B(t).label??``}`)}),V(`click`,r,()=>i(B(t).id)),U(e,r)}),D(o),D(a),U(e,a),k()}ki([`click`]);var tS=255,nS=e=>new TextEncoder().encode(e).length;function rS(e){return!e||!e.trim()?`Enter a folder name`:e===e.trim()?e.includes(`/`)||e.includes(`\\`)?`Name can't contain slashes`:e===`.`||e===`..`?`Not a valid folder name`:e.startsWith(`.`)?`Names starting with a dot are hidden and won't show here`:/[\x00-\x1f\x7f]/.test(e)?`Name contains invalid characters`:nS(e)>tS?`Name is too long`:null:`Name can't start or end with a space`}function iS(e,t=``){return e&&typeof e==`object`&&`message`in e&&e.message?String(e.message):t||String(e)}var aS=H(``),oS=H(``),sS=H(``),cS=H(`
`),lS=H(`
`),uS=H(`
Creating…
`),dS=H(`
Loading…
`),fS=H(`
`),pS=H(`
No sub-folders here.
`),mS=H(``),hS=H(`
`),gS=H(` Use this folder`,1),_S=H(``),vS=H(` Selected this folder`,1),yS=H(``),bS=H(`
`);function xS(e,t){O(t,!0);let n=ro(t,`roots`,19,()=>({})),r=ro(t,`start`,3,``),i=ro(t,`selected`,15,``),a=ro(t,`onUse`,3,null),o=ro(t,`busy`,3,!1),s=M(``),c=M(P([])),l=M(null),u=M(!1),d=M(``);async function f(e){N(u,!0),N(d,``);try{let t=await Q.listDirs(e||``);t.ok?(N(s,t.path,!0),N(c,t.dirs,!0),N(l,t.parent,!0)):N(d,t.error||`Could not open that folder`,!0)}catch(e){N(d,iS(e),!0)}N(u,!1)}io(()=>f(r()||n().cwd||n().home||``));let p=M(!1),m=M(!1),h=M(``),g=M(``);function _(){N(p,!0),N(h,``),N(g,``)}function v(){N(p,!1),N(h,``),N(g,``)}function y(e){e.focus()}async function b(e=!1){if(!B(p))return;let t=B(h),n=rS(t);if(n){e?v():N(g,n,!0);return}N(p,!1),N(m,!0);try{await f((await Q.makeDir(B(s),t)).path),N(h,``),N(g,``)}catch(e){N(g,iS(e),!0),N(p,!0)}N(m,!1)}var x=bS(),S=F(x),C=F(S);$(F(C),{name:`chevron-left`,size:15}),D(C);var w=R(C,2),T=L(w,!0),ee=R(w,2);$(F(ee),{name:`plus`,size:15}),D(ee),D(S);var te=R(S,2),ne=e=>{var t=cS(),r=F(t),i=e=>{var t=aS();V(`click`,t,()=>f(n().cwd)),U(e,t)};G(r,e=>{n().cwd&&e(i)});var a=R(r,2),o=e=>{var t=oS();V(`click`,t,()=>f(n().home)),U(e,t)};G(a,e=>{n().home&&e(o)});var s=R(a,2),c=e=>{var t=sS();V(`click`,t,()=>f(n().workspace)),U(e,t)};G(s,e=>{n().workspace&&e(c)}),D(t),U(e,t)};G(te,e=>{(n().cwd||n().home||n().workspace)&&e(ne)});var re=R(te,2),ie=F(re),ae=e=>{var t=lS(),n=F(t);$(n,{name:`folder`,size:15});var r=R(n,2);za(r),yr(()=>qa(r,()=>B(h),e=>N(h,e))),ua(r,e=>y?.(e)),D(t),V(`keydown`,r,e=>{e.key===`Enter`?(e.preventDefault(),b()):e.key===`Escape`?(e.preventDefault(),v()):N(g,``)}),Oi(`blur`,r,()=>b(!0)),U(e,t)};G(ie,e=>{B(p)&&e(ae)});var oe=R(ie,2),se=e=>{U(e,uS())},ce=e=>{U(e,dS())},le=e=>{var t=fS(),n=L(t,!0);z(()=>W(n,B(d))),U(e,t)},ue=e=>{U(e,pS())},de=e=>{var t=Bi();K(I(t),17,()=>B(c),e=>e.path,(e,t)=>{var n=mS(),r=F(n);$(r,{name:`folder`,size:15});var i=R(r),a=L(i,!0);$(R(i),{name:`chevron-right`,size:14}),D(n),z(()=>{J(n,`title`,B(t).path),W(a,B(t).name)}),V(`click`,n,()=>f(B(t).path)),U(e,n)}),U(e,t)};G(oe,e=>{B(m)?e(se):B(u)?e(ce,1):B(d)?e(le,2):!B(c).length&&!B(p)?e(ue,3):e(de,-1)}),D(re);var fe=R(re,2),E=e=>{var t=hS(),n=L(t,!0);z(()=>W(n,B(g))),U(e,t)};G(fe,e=>{B(g)&&e(E)});var pe=R(fe,2),me=e=>{var t=_S(),n=F(t),r=e=>{U(e,zi(`Saving…`))},i=e=>{var t=gS();$(I(t),{name:`check`,size:15}),tt(),U(e,t)};G(n,e=>{o()?e(r):e(i,-1)}),D(t),z(()=>t.disabled=!B(s)||o()),V(`click`,t,()=>a()(B(s))),U(e,t)},he=e=>{var t=yS();let n;var r=F(t),a=e=>{var t=vS();$(I(t),{name:`check`,size:15}),tt(),U(e,t)},o=e=>{U(e,zi(`Use this folder`))};G(r,e=>{B(s)&&i()===B(s)?e(a):e(o,-1)}),D(t),z(()=>{n=q(t,1,`fp-use`,null,n,{on:!!B(s)&&i()===B(s)}),t.disabled=!B(s)}),V(`click`,t,()=>i(B(s))),U(e,t)};G(pe,e=>{a()?e(me):e(he,-1)}),D(x),z(()=>{C.disabled=!B(l),J(w,`title`,B(s)),W(T,B(s)||`…`),ee.disabled=!B(s)||B(u)||B(m)||B(p)}),V(`click`,C,()=>f(B(l))),V(`click`,ee,_),U(e,x),k()}ki([`click`,`keydown`]);var SS=H(``),CS=H(`
`),wS=H(``),TS=H(`
Profile name
Colourits visual identity
`);function ES(e,t){O(t,!0);let n=ro(t,`claimed`,19,()=>[]),i=ro(t,`keepAccents`,19,()=>[]),a=ro(t,`initialName`,3,``),o=ro(t,`initialAccent`,3,null),s=ro(t,`submitLabel`,3,`Create profile`),c=ro(t,`busyLabel`,3,`Creating…`),l=ro(t,`onCancel`,3,null),u=ro(t,`cancelLabel`,3,`Cancel`),d=ro(t,`autofocus`,3,!0),f=j(()=>r.filter(e=>!n().includes(e.hex)||i().includes(e.hex))),p=M(P(fi(()=>a()))),m=M(P(fi(()=>o()||B(f)[0]&&B(f)[0].hex||r[0].hex))),h=M(!1),g=M(``),_=j(()=>!r.some(e=>e.hex===B(m)));hr(()=>{!B(_)&&!B(f).some(e=>e.hex===B(m))&&B(f).length&&N(m,B(f)[0].hex,!0)});function v(e){let t=e.currentTarget.value.toLowerCase();/^#[0-9a-f]{6}$/.test(t)&&N(m,t,!0)}async function y(){if(!(!B(p).trim()||B(h))){N(h,!0),N(g,``);try{await t.onSubmit({name:B(p).trim(),accent:B(m)})}catch(e){N(g,iS(e,`Could not save profile`),!0),N(h,!1)}}}var b=TS(),x=F(b),S=R(F(x),2),C=F(S);$(C,{name:`message`,size:15});var w=R(C,2);za(w),en(w,d()),D(S),D(x);var T=R(x,2),ee=R(F(T),2),te=F(ee);K(te,17,()=>B(f),e=>e.id,(e,t)=>{var n=SS();let r;var i=F(n),a=e=>{$(e,{name:`check`,size:13})};G(i,e=>{B(m)===B(t).hex&&e(a)}),D(n),z(()=>{r=q(n,1,`pf-dot svelte-5uf3hr`,null,r,{on:B(m)===B(t).hex}),xa(n,`--dot:${B(t).hex??``}`),J(n,`title`,B(t).label),J(n,`aria-label`,B(t).label)}),V(`click`,n,()=>N(m,B(t).hex,!0)),U(e,n)});var ne=R(te,2);let re;var ie=F(ne);za(ie),D(ne),D(ee);var ae=R(ee,2),oe=F(ae,!0),se=R(oe),ce=e=>{U(e,zi(`· custom`))};G(se,e=>{B(_)&&e(ce)}),D(ae),D(T);var le=R(T,2),ue=e=>{var t=CS(),n=F(t);$(n,{name:`x`,size:13});var r=R(n);D(t),z(()=>W(r,` ${B(g)??``}`)),U(e,t)};G(le,e=>{B(g)&&e(ue)});var de=R(le,2),fe=F(de),E=e=>{var t=wS(),n=L(t,!0);z(()=>W(n,u())),V(`click`,t,function(...e){l()?.apply(this,e)}),U(e,t)};G(fe,e=>{l()&&e(E)});var pe=R(fe,2),me=F(pe);$(R(me),{name:`chevron-right`,size:16}),D(pe),D(de),D(b),z(e=>{re=q(ne,1,`pf-dot pf-custom rainbow svelte-5uf3hr`,null,re,{on:B(_)}),Ba(ie,B(m)),W(oe,B(m)),pe.disabled=e,W(me,`${(B(h)?c():s())??``} `)},[()=>!B(p).trim()||B(h)]),V(`keydown`,w,e=>e.key===`Enter`&&y()),qa(w,()=>B(p),e=>N(p,e)),V(`input`,ie,v),V(`click`,pe,y),U(e,b),k()}ki([`keydown`,`click`,`input`]);var DS=`data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20width='90'%20height='50'%20fill='none'%3e%3cpath%20fill='%23000001'%20d='M69.285%200h-3.232v3.232h3.232V0Zm-3.232%2016.095h-3.21v6.442h3.21v-6.442Zm0-12.863h-3.21v3.21h3.21v-3.21Zm-3.21%209.652h-3.21v3.21h3.21v-3.21Zm0-6.442h-3.21v3.232h3.21V6.442Zm-3.211%203.232H53.19v3.21h6.442v-3.21ZM53.19%206.442H37.095v3.232H53.19V6.442Zm6.442%2019.305v-6.42h-3.231v-3.232H33.885v3.232h-3.232v6.42h28.98Zm-9.652-6.42h3.21v3.21h-3.21v-3.21Zm-12.885%200h3.21v3.21h-3.21v-3.21Zm0-9.653h-6.442v3.21h6.442v-3.21Zm-6.442%203.21h-3.21v3.21h3.21v-3.21Zm0-6.442h-3.21v3.232h3.21V6.442Zm-3.211%209.653h-3.21v6.442h3.21v-6.442Zm0-12.863h-3.21v3.21h3.21v-3.21ZM24.232%200H21v3.232h3.232V0Z'%3e%3c/path%3e%3cpath%20fill='%23000'%20d='M65.867%2037.748V34.33H55.615v-3.418h10.252v3.418h3.418v3.417h-3.418Zm-6.834%203.417v-3.417h6.834v3.417h-6.834ZM55.615%2048v-6.835h3.418v3.418h10.252V48h-13.67Zm-13.89-13.67v-3.417h10.252v3.418H41.725Zm-3.417%2010.253V34.33h3.417v10.252h-3.417Zm10.252%200v-3.418h-3.417v-3.417h6.834v6.835H48.56ZM41.725%2048v-3.417h6.835V48h-6.835ZM21%2048V34.33h3.417v-3.417h6.835v3.418h3.418V48h-3.418v-6.835h-6.835V48H21Zm3.417-10.252h6.835v-3.28h-6.835v3.28Z'%3e%3c/path%3e%3c/svg%3e`,OS=`data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20width='90'%20height='50'%20fill='none'%3e%3cpath%20fill='%23ffffff'%20d='M69.285%200h-3.232v3.232h3.232V0Zm-3.232%2016.095h-3.21v6.442h3.21v-6.442Zm0-12.863h-3.21v3.21h3.21v-3.21Zm-3.21%209.652h-3.21v3.21h3.21v-3.21Zm0-6.442h-3.21v3.232h3.21V6.442Zm-3.211%203.232H53.19v3.21h6.442v-3.21ZM53.19%206.442H37.095v3.232H53.19V6.442Zm6.442%2019.305v-6.42h-3.231v-3.232H33.885v3.232h-3.232v6.42h28.98Zm-9.652-6.42h3.21v3.21h-3.21v-3.21Zm-12.885%200h3.21v3.21h-3.21v-3.21Zm0-9.653h-6.442v3.21h6.442v-3.21Zm-6.442%203.21h-3.21v3.21h3.21v-3.21Zm0-6.442h-3.21v3.232h3.21V6.442Zm-3.211%209.653h-3.21v6.442h3.21v-6.442Zm0-12.863h-3.21v3.21h3.21v-3.21ZM24.232%200H21v3.232h3.232V0Z'%3e%3c/path%3e%3cpath%20fill='%23ffffff'%20d='M65.867%2037.748V34.33H55.615v-3.418h10.252v3.418h3.418v3.417h-3.418Zm-6.834%203.417v-3.417h6.834v3.417h-6.834ZM55.615%2048v-6.835h3.418v3.418h10.252V48h-13.67Zm-13.89-13.67v-3.417h10.252v3.418H41.725Zm-3.417%2010.253V34.33h3.417v10.252h-3.417Zm10.252%200v-3.418h-3.417v-3.417h6.834v6.835H48.56ZM41.725%2048v-3.417h6.835V48h-6.835ZM21%2048V34.33h3.417v-3.417h6.835v3.418h3.418V48h-3.418v-6.835h-6.835V48H21Zm3.417-10.252h6.835v-3.28h-6.835v3.28Z'%3e%3c/path%3e%3c/svg%3e`,kS=H(`
`),AS=H(``),jS=H(`
`,1),MS=H(`

Hello — ready when you are.

Setup takes about a minute. You'll connect a model, create a profile or two, and you're off. Nothing leaves your machine — keys and settings stay local.

First, what should I call you?so I can greet you properly
`,1),NS=H(`

About you

A few optional details so every profile knows you. Shared across all profiles — helps every profile know you. All optional.

Where are you based?city & country
Usual working hours?e.g. 9-5 weekdays
How do you like your answers?e.g. short and direct
`,1),PS=H(``),FS=H(`
`),IS=H(`
`,1),LS=H(`

Complete sign-in in the opened tab. + Headless?

`,1),RS=H(`

Runs on your ChatGPT Plus/Pro quota. OpenAI doesn't officially support this — your account could be rate-limited.

`,1),zS=H(`
Assistant model
`),BS=H(`
Sign in with your ChatGPT subscriptionno API key · unofficial
`,1),VS=H(`

`),HS=H(`

`),US=H(``),WS=H(``),GS=H(`
Assistant model
`),KS=H(`
Reasoninghow hard it thinks
`),qS=H(`
Assistant model
`,1),JS=H(`
`,1),YS=H(`
Assistant model
`,1),XS=H(`

Connect a model

optional

Add a provider key — or skip keys entirely and run on a subscription you already have: your ChatGPT login, or the Claude Code / Codex CLI. Whatever you choose is stored locally and shared across all your profiles. You can skip this step and connect later in Settings → Models.

`,1),ZS=H(` `),QS=H(`
`),$S=H(`
`),eC=H(`

Create your profiles

A profile is a colour-coded, isolated workspace — its own chats, tasks, memory, and files. Create one now (e.g. Work), and add more like Personal for day-one separation.

`,1),tC=H(` `),nC=H(``),rC=H(`

Give this profile a folder to work in and tell it what you'll use it for. Both are optional — you can change them anytime in Settings.

Folderthe assistant gets read access — manage access later in Settings → Folders
What can I help with?pick any that fit
`,1),iC=H(`

Set up your profiles

No profiles to set up. Go back and create one first.

`,1),aC=H(`
`),oC=H(`

Your preferences are saved to Settings. Let's get to work.

Model
Appearanceshared across all profiles
Every action runs on the AG2 Stream — toggle AG2 view anytime to watch it live.
`,1),sC=H(`
`),cC=H(`You can connect a model later in Settings → Models`),lC=H(`Create a profile to continue`),uC=H(` `,1),dC=H(``),fC=H(``),pC=H(`
`),mC=H(`
`);function hC(e,t){O(t,!0);let n=()=>A(ds,`$profile`,i),r=()=>A(No,`$profiles`,i),[i,a]=Zt(),o=ro(t,`fresh`,3,!1),s=ro(t,`onComplete`,3,null),c=[`Welcome`,`About you`,`Connect`,`Profiles`,`Set up`,`Ready`],l=[{icon:`zap`,title:`Powered by AG2`,desc:`A universal agent runtime — the open-source framework behind every reply.`},{icon:`globe`,title:`Acts, not just answers`,desc:`Searches the web, runs code, generates images, and manages scheduled tasks.`},{icon:`brain`,title:`Remembers what matters`,desc:`Builds a private memory of your preferences so it gets more helpful over time.`}],u={gemini:`Gemini`,openai:`OpenAI`,anthropic:`Anthropic`},d=e=>Mx(e).map(t=>({label:`${u[e]} · ${t.label}`,provider:e,model:t.id})),f=[...d(`gemini`),...d(`openai`),...d(`anthropic`)],p=[{id:`gemini`,label:`Gemini`,keyId:`gemini`,hint:`recommended`,models:d(`gemini`)},{id:`openai`,label:`OpenAI`,keyId:`openai`,hint:`optional`,models:d(`openai`)},{id:`claude`,label:`Claude`,keyId:`anthropic`,hint:`optional`,models:d(`anthropic`)},{id:`oauth`,label:`ChatGPT`,oauth:!0,hint:`no API key · unofficial`},{id:`claude_code`,label:`Claude Code`,cli:`claude`,hint:`no API key · CLI login`},{id:`codex`,label:`Codex`,cli:`codex`,hint:`no API key · CLI login`}],m=M(0),g=P({gemini:``,openai:``,anthropic:``}),_=M(P(p[0].id)),v=M(P(f[0].label)),y=j(()=>p.find(e=>e.id===B(_))||p[0]);function b(e){N(_,e,!0);let t=p.find(t=>t.id===e);t?.oauth?B(ee)?.signed_in&&N(v,T.label,!0):t?.cli||t?.models?.length&&N(v,t.models[0].label,!0)}let x=M(P(n().name||``)),S=P({location:``,hours:``,style:``}),C=M(!1),w=M(P({})),T={label:`OpenAI · gpt-5.6-terra (ChatGPT subscription)`,provider:`openai`,model:`gpt-5.6-terra`,auth:`subscription`},ee=M(null),te=M(!1),ne=M(``),re=M(``),ie=M(!1),ae=null,oe=j(()=>B(ee)?.signed_in?[...f,T]:f),se=M(null),ce=M(P({})),le=P({claude:``,codex:``}),ue=j(()=>B(y).cli?Rx(B(se),B(y).cli):null),de=j(()=>B(y).cli?B(ce)[B(y).cli]:void 0),fe=j(()=>!!B(y).cli&&(!B(ue)?.loaded||B(de)===`loading`)),E=j(()=>typeof B(de)==`object`?B(de):null),pe=j(()=>B(E)?.models??[]),me=j(()=>!!B(y).cli&&zx(B(ue),B(de))),he=j(()=>B(y).cli?Bx(B(y).cli,B(ue),B(de)):``);function ge(e,t=!1){B(ce)[e]=`loading`,Q.codingModels(e,t).then(t=>{B(ce)[e]={models:t.models,current:t.current,reason:t.reason}}).catch(()=>{B(ce)[e]={models:[],current:``,reason:`probe_failed`}})}async function _e(e){try{N(se,await Q.codingAgents(),!0)}catch{}let t=Rx(B(se),e);if(t.available&&t.mode===`local`)ge(e,!0);else{let{[e]:t,...n}=B(ce);N(ce,n,!0)}}hr(()=>{let e=B(y).cli;e&&B(ue)?.available&&B(ue).mode===`local`&&B(ce)[e]===void 0&&ge(e)});let ve=j(()=>B(y).cli===`codex`?Jx(B(pe)):[]),ye=j(()=>Wx(le.codex)),be=j(()=>B(ve).find(e=>e.family===B(ye).family)?.efforts||[]);function xe(e){let t=(B(ve).find(t=>t.family===e)?.efforts||[]).some(e=>e.value===B(ye).effort)?B(ye).effort:``;le.codex=Gx(e,t)}io(async()=>{try{N(ee,await Q.codexStatus(),!0)}catch{}try{N(se,await Q.codingAgents(),!0)}catch{N(se,{mode:`local`,connected:!0,agents:[]},!0)}}),ao(()=>{ae&&clearInterval(ae)});async function Se(){try{let e=await Q.codexLoginUrl();N(ne,e.state,!0),window.open(e.auth_url,`_blank`),N(te,!0),ae=setInterval(async()=>{let e=await Q.codexStatus();e.signed_in&&(ae&&clearInterval(ae),ae=null,N(te,!1),N(ee,e,!0),N(v,T.label,!0))},2e3)}catch{}}async function Ce(){if(!(!B(re).trim()||!B(ne)))try{await Q.codexSubmit(B(ne),B(re).trim()),N(re,``),N(ie,!1),N(te,!1),ae&&=(clearInterval(ae),null),N(ee,await Q.codexStatus(),!0),B(ee).signed_in&&N(v,T.label,!0)}catch{}}let we=M(P([...r().list])),Te=M(!0),Ee=j(()=>B(we).map(e=>e.accent)),De=M(0),Oe=M(P({})),ke=M(``),Ae=M(P([])),je=j(()=>B(we)[B(De)]||null);async function Me(e){if(!(Object.keys(B(w)).length||!e))try{let t=await Q.forProfile(e).settings();N(w,t.fs,!0)}catch{}}function Ne(e){N(De,e,!0);let t=B(we)[e],n=t?B(Oe)[t.id]:void 0;N(ke,n?.folder||``,!0),N(Ae,n?.focuses?[...n.focuses]:[],!0),Me(t?.id)}let Pe=e=>N(Ae,B(Ae).includes(e)?B(Ae).filter(t=>t!==e):[...B(Ae),e],!0),Fe=j(()=>!!(g.gemini.trim()||g.openai.trim()||g.anthropic.trim())),Ie=j(()=>B(Fe)||!!B(ee)?.signed_in||B(me)),Le=j(()=>B(m)!==3||B(we).length>0),Re=()=>{if(B(m)===4&&B(De)>0){Ne(B(De)-1);return}N(m,Math.max(B(m)-1,0),!0)},ze=()=>Be();function Be(){if(B(m)===3){N(m,4),Ne(0);return}N(m,Math.min(B(m)+1,c.length-1),!0)}async function Ve(e=!1){let t=B(je);if(t&&(N(Oe,{...B(Oe),[t.id]:{folder:B(ke),focuses:[...B(Ae)]}},!0),!e)){let e=Q.forProfile(t.id);if(B(ke))try{let e=null;try{e=(await Q.createFolder(B(ke))).folder}catch(t){let n=t instanceof ug&&t.status===409?G_.safeParse(t.body):null;if(!n?.success)throw t;e=n.data.existing}e&&await Q.setGrant(e.id,t.id,`read`)}catch{}try{await e.setFocuses(B(Ae))}catch{}}B(De){N(Te,!0)};function We(){if(B(y).cli){if(!B(me))return null;let e=Lx[B(y).cli];return{name:xx[e],type:e,model:le[B(y).cli]||``}}if(B(y).oauth&&!B(ee)?.signed_in||B(y).keyId&&!g[B(y).keyId].trim())return null;let e=B(oe).find(e=>e.label===B(v));if(!e)return null;let t=e.auth===`subscription`?`openai_subscription`:e.provider===`openai`?`openai_responses`:e.provider;return{name:e.label,type:t,model:e.model}}let Ge=j(()=>We()?.name||``);async function Ke(){N(C,!0);try{for(let[e,t]of Object.entries(g))if(t.trim())try{await Q.setKey(e,t.trim())}catch{}let e=We();if(e)try{await Q.saveLlmConfig({...e,activate:!0})}catch{}let t={name:B(x).trim(),location:S.location.trim(),hours:S.hours.trim(),style:S.style.trim()};if(Object.values(t).some(e=>e))try{await Q.setIdentity(t)}catch{}try{await Q.setOnboarded()}catch{}}finally{Xt(ds,{name:B(x).trim()}),Xt(us,!1),N(C,!1),o()&&s()&&s()(B(we)[0]?.id||null)}}var qe=mC(),Je=F(qe),Ye=F(Je),Xe=F(Ye),Ze=R(Xe,2);tt(2),D(Ye);var Qe=R(Ye,4);K(Qe,21,()=>l,Qi,(e,t,n)=>{var r=kS();xa(r,`--i:${n}`);var i=F(r);$(F(i),{get name(){return B(t).icon},size:17}),D(i);var a=R(i,2),o=F(a),s=L(o,!0),c=L(R(o,2),!0);D(a),D(r),z(()=>{W(s,B(t).title),W(c,B(t).desc)}),U(e,r)}),D(Qe),D(Je);var $e=R(Je,2),et=F($e);K(et,21,()=>c,Qi,(e,t,n)=>{var r=jS(),i=I(r);let a;var o=F(i);let s;var l=F(o),u=e=>{$(e,{name:`check`,size:12})},d=e=>{var t=zi();t.nodeValue=n+1,U(e,t)};G(l,e=>{n{U(e,AS())};G(p,e=>{n{a=q(i,1,`onb-stepitem svelte-13krnjv`,null,a,{active:n===B(m)}),s=q(o,1,`onb-stepnum svelte-13krnjv`,null,s,{done:nB(m),e=>{var t=sC(),n=F(t),r=e=>{var t=MS(),n=R(I(t),4),r=R(F(n),2),i=F(r);$(i,{name:`message`,size:15});var a=R(i,2);za(a),D(r),D(n);var o=R(n,2),s=F(o);$(R(F(s)),{name:`chevron-right`,size:17}),D(s),D(o),V(`keydown`,a,e=>e.key===`Enter`&&ze()),qa(a,()=>B(x),e=>N(x,e)),V(`click`,s,ze),U(e,t)},i=e=>{var t=NS(),n=R(I(t),4),r=R(F(n),2),i=F(r);$(i,{name:`globe`,size:15});var a=R(i,2);za(a),D(r),D(n);var o=R(n,2),s=R(F(o),2),c=F(s);$(c,{name:`clock`,size:15});var l=R(c,2);za(l),D(s),D(o);var u=R(o,2),d=R(F(u),2),f=F(d);$(f,{name:`message`,size:15});var p=R(f,2);za(p),D(d),D(u),qa(a,()=>S.location,e=>S.location=e),qa(l,()=>S.hours,e=>S.hours=e),qa(p,()=>S.style,e=>S.style=e),U(e,t)},a=e=>{var t=XS(),n=R(I(t),4);K(n,21,()=>p,Qi,(e,t)=>{var n=PS();let r;var i=L(n,!0);z(()=>{r=q(n,1,`onb-tab svelte-13krnjv`,null,r,{on:B(_)===B(t).id}),J(n,`aria-selected`,B(_)===B(t).id),W(i,B(t).label)}),V(`click`,n,()=>b(B(t).id)),U(e,n)}),D(n);var r=R(n,2),i=F(r),a=e=>{var t=BS(),n=I(t),r=R(F(n),2),i=e=>{var t=FS(),n=F(t);$(n,{name:`check`,size:15});var r=L(R(n,2));D(t),z(()=>W(r,`Signed in with ChatGPT${B(ee).account_id?` · `+B(ee).account_id:``}`)),U(e,t)},a=e=>{var t=RS(),n=I(t),r=F(n);$(r,{name:`sparkles`,size:14});var i=R(r);D(n);var a=R(n,2),o=e=>{var t=LS(),n=I(t),r=R(F(n));D(n);var i=R(n,2),a=e=>{var t=IS(),n=I(t),r=F(n);$(r,{name:`settings`,size:15});var i=R(r,2);za(i),D(n);var a=R(n,2);qa(i,()=>B(re),e=>N(re,e)),V(`click`,a,Ce),U(e,t)};G(i,e=>{B(ie)&&e(a)}),V(`click`,r,()=>N(ie,!B(ie))),U(e,t)};G(a,e=>{B(te)&&e(o)}),tt(2),z(()=>W(i,` ${B(te)?`Waiting for ChatGPT…`:`Sign in with ChatGPT`}`)),V(`click`,n,Se),U(e,t)};G(r,e=>{B(ee)?.signed_in?e(i):e(a,-1)}),D(n);var o=R(n,2),s=e=>{var t=zS(),n=R(F(t),2),r=L(F(n),!0);D(n),D(t),z(()=>W(r,T.label)),U(e,t)};G(o,e=>{B(ee)?.signed_in&&e(s)}),U(e,t)},o=e=>{let t=j(()=>B(y).cli);var n=JS(),r=I(n),i=F(r),a=F(i),o=L(a),s=L(R(a,2),!0);D(i);var c=R(i,2),l=e=>{var t=VS(),n=L(t);z(()=>W(n,`Checking the ${B(y).label??``} adapter…`)),U(e,t)},u=e=>{var t=FS(),n=F(t);$(n,{name:`check`,size:15});var r=L(R(n,2),!0);D(t),z(()=>W(r,B(ue)?.mode===`bridge`?`Reachable through the host ACP bridge`:`Adapter answered — running on your CLI login`)),U(e,t)};G(c,e=>{B(fe)?e(l):B(me)&&e(u,1)});var d=R(c,2),f=e=>{var t=HS();let n;var r=L(t,!0);z(()=>{n=q(t,1,`hint svelte-13krnjv`,null,n,{warn:!B(me)}),W(r,B(he))}),U(e,t)};G(d,e=>{B(he)&&e(f)});var p=R(d,2),m=e=>{var n=US();V(`click`,n,()=>_e(B(t))),U(e,n)};G(p,e=>{B(fe)||e(m)}),D(r);var h=R(r,2),g=e=>{var t=GS(),n=R(F(t),2),r=F(n);let i;var a=L(r,!0);K(R(r,2),17,()=>B(pe),Qi,(e,t)=>{var n=WS();let r;var i=L(n,!0);z(()=>{r=q(n,1,`onb-pill svelte-13krnjv`,null,r,{on:le.claude===B(t).id}),W(i,B(t).name||B(t).id)}),V(`click`,n,()=>le.claude=B(t).id),U(e,n)}),D(n),D(t),z(e=>{i=q(r,1,`onb-pill svelte-13krnjv`,null,i,{on:!le.claude}),W(a,e)},[()=>Vx(B(de))]),V(`click`,r,()=>le.claude=``),U(e,t)},_=e=>{var t=qS(),n=I(t),r=R(F(n),2),i=F(r);let a;var o=L(i,!0);K(R(i,2),17,()=>B(ve),Qi,(e,t)=>{var n=WS();let r;var i=L(n,!0);z(()=>{r=q(n,1,`onb-pill svelte-13krnjv`,null,r,{on:B(ye).family===B(t).family}),W(i,B(t).label)}),V(`click`,n,()=>xe(B(t).family)),U(e,n)}),D(r),D(n);var s=R(n,2),c=e=>{var t=KS(),n=R(F(t),2),r=F(n);let i;var a=L(r,!0);K(R(r,2),17,()=>B(be),Qi,(e,t)=>{var n=WS();let r;var i=L(n,!0);z(()=>{r=q(n,1,`onb-pill svelte-13krnjv`,null,r,{on:B(ye).effort===B(t).value}),W(i,B(t).label)}),V(`click`,n,()=>le.codex=Gx(B(ye).family,B(t).value)),U(e,n)}),D(n),D(t),z(e=>{i=q(r,1,`onb-pill svelte-13krnjv`,null,i,{on:!B(ye).effort}),W(a,e)},[()=>Kx(``)]),V(`click`,r,()=>le.codex=Gx(B(ye).family,``)),U(e,t)};G(s,e=>{B(be).length&&e(c)}),z(e=>{a=q(i,1,`onb-pill svelte-13krnjv`,null,a,{on:!le.codex}),W(o,e)},[()=>Vx(B(de))]),V(`click`,i,()=>le.codex=``),U(e,t)};G(h,e=>{B(me)&&B(y).cli===`claude`?e(g):B(me)&&B(y).cli===`codex`&&e(_,1)}),z(()=>{W(o,`Run on your ${B(y).label??``} CLI`),W(s,B(y).hint)}),U(e,n)},s=e=>{let t=j(()=>B(y).keyId);var n=YS(),r=I(n),i=F(r),a=F(i),o=L(a),s=L(R(a),!0);D(i);var c=R(i,2),l=F(c);$(l,{name:`settings`,size:15});var u=R(l,2);za(u),D(c),D(r);var d=R(r,2),f=R(F(d),2);K(f,21,()=>B(y).models??[],Qi,(e,t)=>{var n=WS();let r;var i=L(n,!0);z(()=>{r=q(n,1,`onb-pill svelte-13krnjv`,null,r,{on:B(v)===B(t).label}),W(i,B(t).label)}),V(`click`,n,()=>N(v,B(t).label,!0)),U(e,n)}),D(f),D(d),z(()=>{W(o,`${B(y).label??``} API key`),W(s,B(y).hint)}),qa(u,()=>g[B(t)],e=>g[B(t)]=e),U(e,n)};G(i,e=>{B(y).oauth?e(a):B(y).cli?e(o,1):B(y).keyId&&e(s,2)}),D(r),U(e,t)},o=e=>{var t=eC(),n=R(I(t),4),r=e=>{var t=QS();K(t,21,()=>B(we),e=>e.id,(e,t)=>{var n=ZS(),r=R(F(n),1,!0);D(n),z(()=>{xa(n,`--dot:${B(t).accent??``}`),W(r,B(t).name)}),U(e,n)}),D(t),U(e,t)};G(n,e=>{B(we).length&&e(r)});var i=R(n,2),a=e=>{{let t=j(()=>B(we).length?`Add profile`:`Create profile`);ES(e,{get claimed(){return B(Ee)},get submitLabel(){return B(t)},busyLabel:`Creating…`,onSubmit:He})}},o=e=>{var t=$S(),n=F(t);$(F(n),{name:`plus`,size:15}),tt(),D(n),D(t),V(`click`,n,Ue),U(e,t)};G(i,e=>{B(Te)?e(a):e(o,-1)}),U(e,t)},s=e=>{var t=Bi(),n=I(t),r=e=>{var t=rC(),n=I(t),r=F(n),i=R(r,2),a=L(i),o=R(i,2),s=e=>{var t=tC(),n=L(t);z(()=>W(n,`${B(De)+1} of ${B(we).length??``}`)),U(e,t)};G(o,e=>{B(we).length>1&&e(s)}),D(n);var c=R(n,4),l=R(F(c),2);{let e=j(()=>B(ke)||B(w).cwd);xS(l,{get roots(){return B(w)},get start(){return B(e)},get selected(){return B(ke)},set selected(e){N(ke,e,!0)}})}D(c);var u=R(c,2),d=R(F(u),2);K(d,21,()=>yx,Qi,(e,t)=>{var n=nC();let r;var i=F(n);$(i,{get name(){return B(t).icon},size:14});var a=R(i);D(n),z(e=>{r=q(n,1,`onb-pill svelte-13krnjv`,null,r,{on:e}),W(a,` ${B(t).label??``}`)},[()=>B(Ae).includes(B(t).id)]),V(`click`,n,()=>Pe(B(t).id)),U(e,n)}),D(d),D(u),z(()=>{xa(r,`--dot:${B(je).accent??``}`),W(a,`Set up ${B(je).name??``}`)}),U(e,t)},i=e=>{var t=iC();tt(2),U(e,t)};G(n,e=>{B(je)?e(r):e(i,-1)}),U(e,t)},c=e=>{var t=oC(),n=I(t),r=F(n);$(F(r),{name:`check`,size:26}),D(r);var i=R(r,2),a=L(F(i),!0);tt(2),D(i),D(n);var o=R(n,2),s=F(o),c=F(s);$(F(c),{name:`cpu`,size:16}),D(c);var l=L(R(c,2),!0);D(s),D(o);var u=R(o,2);K(u,21,()=>B(we),e=>e.id,(e,t)=>{let n=j(()=>B(Oe)[B(t).id]);var r=aC(),i=F(r),a=R(i,2),o=L(a,!0),s=R(a,2),c=F(s),l=F(c);$(l,{name:`folder`,size:13});var u=R(l);D(c);var d=R(c,2),f=F(d);$(f,{name:`sparkles`,size:13});var p=R(f);D(d),D(s),D(r),z(e=>{xa(i,`--dot:${B(t).accent??``}`),W(o,B(t).name),W(u,` ${(B(n)?.folder||`—`)??``}`),W(p,` ${e??``}`)},[()=>B(n)?.focuses.length?B(n).focuses.map(bx).join(`, `):`—`]),U(e,r)}),D(u);var d=R(u,2);eS(R(F(d),2),{}),D(d);var f=R(d,2);$(F(f),{name:`zap`,size:14}),tt(),D(f),z(e=>{W(a,e),W(l,B(Ge)||`Not connected — add one in Settings → Models`)},[()=>B(x).trim()?`You're all set, ${B(x).trim()}.`:`You're all set.`]),U(e,t)};G(n,e=>{B(m)===0?e(r):B(m)===1?e(i,1):B(m)===2?e(a,2):B(m)===3?e(o,3):B(m)===4?e(s,4):e(c,-1)}),D(t),U(e,t)}),D(nt);var it=R(nt,2),at=e=>{var t=pC(),n=F(t);$(F(n),{name:`chevron-left`,size:16}),tt(),D(n);var r=R(n,2),i=F(r),a=e=>{U(e,cC())};G(i,e=>{B(m)===2&&!B(Ie)&&e(a)});var o=R(i,2),s=e=>{U(e,lC())};G(o,e=>{B(m)===3&&!B(we).length&&e(s)});var l=R(o,2),u=e=>{var t=uC(),n=I(t),r=R(n,2),i=F(r);$(R(i),{name:`chevron-right`,size:16}),D(r),z(()=>{n.disabled=B(C),r.disabled=B(C)||!B(je),W(i,`${B(De)Ve(!0)),V(`click`,r,()=>Ve(!1)),U(e,t)},d=e=>{var t=dC(),n=F(t);$(R(n),{name:`chevron-right`,size:16}),D(t),z(()=>{t.disabled=!B(Le),W(n,`${B(m)===2&&!B(Ie)?`Skip for now`:`Continue`} `)}),V(`click`,t,Be),U(e,t)},f=e=>{var t=fC();$(R(F(t)),{name:`send`,size:15}),D(t),z(()=>t.disabled=B(C)),V(`click`,t,Ke),U(e,t)};G(l,e=>{B(m)===4?e(u):B(m){B(m)>0&&e(at)}),D($e),D(qe),z(()=>{J(Xe,`src`,DS),J(Ze,`src`,OS),rt=q(nt,1,`onb-body svelte-13krnjv`,null,rt,{center:B(m)===0})}),U(e,qe),k(),a()}ki([`keydown`,`click`]);var gC=H(`
`);function _C(e,t){O(t,!0);let n=ro(t,`side`,3,`right`),r=ro(t,`width`,3,is),i=ro(t,`clamp`,3,co),a=M(!1);function o(e){t.onGrab?.(),N(a,!0),e.currentTarget.setPointerCapture(e.pointerId),e.preventDefault()}function s(e){if(!B(a))return;if(e.buttons===0){c(e);return}let t=n()===`left`?e.clientX:window.innerWidth-e.clientX;r().set(i()(t))}function c(e){N(a,!1),e.currentTarget.releasePointerCapture?.(e.pointerId)}var l=gC();let u;z(()=>u=q(l,1,`rail-resizer`,null,u,{dragging:B(a),left:n()===`left`})),V(`pointerdown`,l,o),V(`pointermove`,l,s),V(`pointerup`,l,c),Oi(`pointercancel`,l,c),U(e,l),k()}ki([`pointerdown`,`pointermove`,`pointerup`]);var vC=Wt({folders:[],loaded:!1});async function yC(){try{let e=await Q.folders();vC.set({folders:e.folders||[],loaded:!0})}catch{vC.set({folders:[],loaded:!0})}}function bC(e){return vC.set({folders:e&&e.folders||[],loaded:!0}),e}var xC=H(`
`);function SC(e,t){O(t,!0);let n=ro(t,`disabled`,3,!1),r=e=>e===`read_write`?`Read + write`:e===`read`?`Read`:`Off`,i=e=>e===`read_write`?1:e===`read`?0:2,a=e=>e===`read`?`read_write`:e===`read_write`?null:`read`,o=j(()=>i(t.mode));var s=xC(),c=F(s);let l;var u=L(c,!0),d=R(c,2);let f;D(s),z((e,t)=>{l=q(c,1,`sw3label svelte-abh25a`,null,l,{muted:B(o)===2}),W(u,e),f=q(d,1,`sw3 svelte-abh25a`,null,f,{off:B(o)===2,rw:B(o)===1}),J(d,`data-pos`,B(o)),J(d,`aria-label`,t),d.disabled=n()},[()=>r(t.mode),()=>`Access: ${r(t.mode)} — click to change`]),V(`click`,d,()=>t.onchange?.(a(t.mode))),U(e,s),k()}ki([`click`]);var CC=H(`
`);function wC(e,t){O(t,!0);let n=ro(t,`disabled`,3,!1),r=j(()=>t.mode===`read_write`);var i=CC(),a=F(i),o=L(a,!0),s=R(a,2);let c;D(i),z(()=>{W(o,B(r)?`Read + write`:`Read`),c=q(s,1,`ws svelte-u1g0df`,null,c,{on:B(r)}),J(s,`aria-checked`,B(r)),s.disabled=n()}),V(`click`,s,()=>t.onchange?.(B(r)?`read`:`read_write`)),U(e,i),k()}ki([`click`]);var TC=H(`

`),EC=H(`

No folders in this chat yet. Use the folder button in the composer to add one.

`),DC=H(``),OC=H(`
`,1),kC=H(`
`),AC=H(`
`),jC=H(`
Task folders
`,1),MC=H(`
Profile folders
`,1),NC=H(` `,1);function PC(e,t){O(t,!0);let n=()=>A(No,`$profiles`,i),r=()=>A(vC,`$foldersStore`,i),[i,a]=Zt(),o=ro(t,`taskId`,3,``),s=M(!1),c=M(``),l=M(``),u=j(()=>n().activeId||hs()||``),d=j(()=>r().folders);io(()=>{r().loaded||yC()});async function f(e){N(c,``),N(s,!0);try{bC(await e())}catch(e){N(c,iS(e),!0)}N(s,!1)}let p=e=>e.grants.find(e=>e.profile===B(u)&&e.chat_id===t.chatId),m=e=>e.grants.find(e=>e.profile===B(u)&&!e.chat_id&&!e.task_id),h=e=>o()?e.grants.find(e=>e.profile===B(u)&&e.task_id===o()&&!e.chat_id):null,g=e=>h(e)?.mode??m(e)?.mode,_=j(()=>o()?B(d).filter(e=>h(e)):[]),v=j(()=>B(d).filter(e=>m(e)&&!h(e))),y=j(()=>B(d).filter(e=>p(e)&&!m(e)&&!h(e))),b=e=>{let t=p(e);return t?t.mode:g(e)};function x(e,n){let r=p(e);if(!n){r&&f(()=>Q.revokeGrant(e.id,B(u),t.chatId));return}r?.mode!==n&&f(()=>Q.setGrant(e.id,B(u),n,t.chatId))}function S(e){let n=p(e);if(!n)return;let r=n.mode===`read_write`?`read_write`:`read`;f(async()=>(await Q.setGrant(e.id,B(u),r),Q.revokeGrant(e.id,B(u),t.chatId)))}function C(e){let n=p(e);if(!n||!o())return;let r=n.mode===`read_write`?`read_write`:`read`;f(async()=>(await Q.setGrant(e.id,B(u),r,``,o()),Q.revokeGrant(e.id,B(u),t.chatId)))}function w(e,n){let r=n||`none`;if(b(e)===r)return;let i=p(e);if(r===g(e)){i&&f(()=>Q.revokeGrant(e.id,B(u),t.chatId));return}f(()=>Q.setGrant(e.id,B(u),r,t.chatId))}var T=NC(),ee=I(T),te=R(ee,2),ne=F(te),re=R(ne,4),ie=R(F(re)),ae=e=>{var t=zi();t.nodeValue=` Task folders are shared across this task's runs — changing one here overrides it for this thread only.`,U(e,t)};G(ie,e=>{o()&&e(ae)}),D(re);var oe=R(re,2),se=e=>{var t=TC(),n=L(t,!0);z(()=>W(n,B(c))),U(e,t)};G(oe,e=>{B(c)&&e(se)});var ce=R(oe,2),le=e=>{U(e,EC())};G(ce,e=>{!B(_).length&&!B(v).length&&!B(y).length&&e(le)});var ue=R(ce,2),de=e=>{var t=Bi();K(I(t),17,()=>B(y),e=>e.id,(e,t)=>{let n=j(()=>p(B(t)));var r=kC(),i=F(r);$(F(i),{name:`folder`,size:14}),D(i);var a=R(i,2),c=L(a,!0),u=R(a,2),d=F(u);{let e=j(()=>B(n)?.mode);wC(d,{get mode(){return B(e)},get disabled(){return B(s)},onchange:e=>x(B(t),e)})}var f=R(d,2),m=F(f),h=R(m,2),g=e=>{var n=OC(),r=I(n),i=R(r,2),a=F(i),s=e=>{var n=DC();$(F(n),{name:`list`,size:14}),tt(),D(n),V(`click`,n,()=>{N(l,``),C(B(t))}),U(e,n)};G(a,e=>{o()&&e(s)});var c=R(a,2);$(F(c),{name:`users`,size:14}),tt(),D(c);var u=R(c,2);$(F(u),{name:`trash`,size:14}),tt(),D(u),D(i),V(`click`,r,()=>N(l,``)),V(`click`,c,()=>{N(l,``),S(B(t))}),V(`click`,u,()=>{N(l,``),x(B(t),null)}),U(e,n)};G(h,e=>{B(l)===B(t).id&&e(g)}),D(f),D(u),D(r),z(()=>{J(a,`title`,B(t).path),W(c,B(t).name),J(m,`aria-expanded`,B(l)===B(t).id),m.disabled=B(s)}),V(`click`,m,()=>N(l,B(l)===B(t).id?``:B(t).id,!0)),U(e,r)}),U(e,t)};G(ue,e=>{B(y).length&&e(de)});var fe=R(ue,2),E=e=>{var t=jC();K(R(I(t),2),17,()=>B(_),e=>e.id,(e,t)=>{var n=AC(),r=F(n);$(F(r),{name:`folder`,size:14}),D(r);var i=R(r,2),a=L(i,!0),o=R(i,2);{let e=j(()=>b(B(t)));SC(o,{get mode(){return B(e)},get disabled(){return B(s)},onchange:e=>w(B(t),e)})}D(n),z(()=>{J(i,`title`,B(t).path),W(a,B(t).name)}),U(e,n)}),U(e,t)};G(fe,e=>{B(_).length&&e(E)});var pe=R(fe,2),me=e=>{var t=MC();K(R(I(t),2),17,()=>B(v),e=>e.id,(e,t)=>{var n=AC(),r=F(n);$(F(r),{name:`folder`,size:14}),D(r);var i=R(r,2),a=L(i,!0),o=R(i,2);{let e=j(()=>b(B(t)));SC(o,{get mode(){return B(e)},get disabled(){return B(s)},onchange:e=>w(B(t),e)})}D(n),z(()=>{J(i,`title`,B(t).path),W(a,B(t).name)}),U(e,n)}),U(e,t)};G(pe,e=>{B(v).length&&e(me)}),D(te),V(`click`,ee,function(...e){t.onClose?.apply(this,e)}),V(`click`,ne,function(...e){t.onClose?.apply(this,e)}),U(e,T),k(),a()}ki([`click`]);var FC=Gt(js,Ao),IC={html:`html`,htm:`html`,png:`image`,jpg:`image`,jpeg:`image`,gif:`image`,webp:`image`,svg:`image`,bmp:`image`,ico:`image`,avif:`image`,pdf:`pdf`,md:`markdown`,markdown:`markdown`,txt:`text`,log:`text`,csv:`text`,py:`code`,js:`code`,mjs:`code`,ts:`code`,jsx:`code`,tsx:`code`,json:`code`,css:`code`,scss:`code`,yaml:`code`,yml:`code`,toml:`code`,ini:`code`,sh:`code`,xml:`code`,sql:`code`,rs:`code`,go:`code`,java:`code`,rb:`code`};function LC(e){return IC[((e||``).split(`.`).pop()??``).toLowerCase()]||`download`}var RC={dockerfile:`file-code`,makefile:`file-code`,".gitignore":`file-code`,".env":`file-code`},zC={csv:`file-spreadsheet`,tsv:`file-spreadsheet`,zip:`file-archive`,tar:`file-archive`,gz:`file-archive`,tgz:`file-archive`,bz2:`file-archive`,rar:`file-archive`,"7z":`file-archive`,mp4:`file-play`,mov:`file-play`,webm:`file-play`,mkv:`file-play`,avi:`file-play`,m4v:`file-play`,mp3:`file-music`,wav:`file-music`,flac:`file-music`,ogg:`file-music`,m4a:`file-music`,aac:`file-music`},BC={code:`file-code`,html:`file-code`,image:`file-image`};function VC(e){let t=(e||``).toLowerCase();return RC[t]?RC[t]:zC[t.split(`.`).pop()??``]||BC[LC(e)]||`file`}function HC(e){let t=e||0;return`Mentioned in ${t} ${t===1?`thread`:`threads`}`}function UC(e){return e?(e.title||``).trim()||(e.kind===`run`?`Task run`:`Chat`):``}function WC(e){return e?.kind===`run`?`zap`:`message`}function GC(e){let t=(e||``).split(`/`);t.pop();let n=[],r=``;for(let e of t)e&&(r=r?r+`/`+e:e,n.push(r));return n}function KC(e){return qC(e)?!e.closest(`.ftrow`):!1}function qC(e){return!!e&&typeof e.closest==`function`}var JC=new Set,YC=``,XC=new Set,ZC=0,QC=H(``),$C=H(` `),ew=H(`
`,1),tw=H(` `,1),nw=H(`
`),rw=H(` `,1),iw=H(` `),aw=H(`missing`),ow=H(`
`,1),sw=H(`

Loading…

`),cw=H(`
`,1),lw=H(`
`),uw=H(`

`),dw=H(` `,1),fw=H(`Delete? `),pw=H(` Download`),mw=H(``),hw=H(` `,1),gw=H(`

`),_w=H(`
`),vw=H(`

No files yet — ask the agent to save something, run a task that produces a deliverable, or drag files here (or use +) to upload.

`),yw=H(`
Folders
`,1),bw=H(`

`);function xw(e,t){O(t,!0);let n=()=>A(js,`$route`,o),r=()=>A(FC,`$threadScope`,o),i=()=>A(vC,`$foldersStore`,o),a=()=>A(Yo,`$reveal`,o),[o,s]=Zt(),c=(e,t=ue,n=ue)=>{var r=rw(),i=I(r);K(i,17,()=>ee(t()),e=>e.path,(e,t)=>{var r=ew(),i=I(r);let a;var o=F(i),s=F(o);{let e=j(()=>re(B(t).path)?`chevron-down`:`chevron-right`);$(s,{get name(){return B(e)},size:13})}D(o);var l=R(o,2);$(l,{name:`folder`,size:14});var u=R(l,2),f=e=>{var n=QC();za(n),yr(()=>qa(n,()=>B(ze),e=>N(ze,e))),ua(n,e=>Ge?.(e)),V(`click`,n,e=>e.stopPropagation()),V(`keydown`,n,e=>{e.key===`Enter`?Ue(B(t).path):e.key===`Escape`&&He()}),Oi(`blur`,n,()=>Ue(B(t).path)),U(e,n)},p=e=>{var n=$C(),r=L(n,!0);z(()=>W(r,B(t).name)),U(e,n)};G(u,e=>{B(Re)===B(t).path?e(f):e(p,-1)});var m=R(u,2);d(m,()=>B(t).path,()=>B(t).name,()=>!0),D(i);var h=R(i,2),g=e=>{c(e,()=>B(t),()=>n()+1)},_=j(()=>re(B(t).path));G(h,e=>{B(_)&&e(g)}),z(e=>{a=q(i,1,`ftrow ftdir svelte-evfy7n`,null,a,{active:B(t).path===B(le),selected:B(v)===B(t).path&&!B(de)&&B(t).path!==B(le),drop:B(et)===B(t).path}),J(i,`data-path`,B(t).path),xa(i,`padding-left:${n()*14+4}px`),J(o,`title`,e)},[()=>re(B(t).path)?`Collapse`:`Expand`]),Oi(`dragstart`,i,e=>nt(e,B(t).path)),Oi(`dragover`,i,e=>rt(e,B(t).path)),Oi(`drop`,i,e=>at(e,B(t).path)),V(`click`,i,()=>{Ee(B(t).path),ie(B(t).path)}),V(`click`,o,e=>{e.stopPropagation(),ie(B(t).path)}),U(e,r)}),K(R(i,2),17,()=>te(t()),e=>e.path,(e,t)=>{var r=nw();let i;var a=F(r);{let e=j(()=>VC(B(t).name));$(a,{get name(){return B(e)},size:14})}var o=R(a,2),s=e=>{var n=QC();za(n),yr(()=>qa(n,()=>B(ze),e=>N(ze,e))),ua(n,e=>Ge?.(e)),V(`click`,n,e=>e.stopPropagation()),V(`keydown`,n,e=>{e.key===`Enter`?Ue(B(t).path):e.key===`Escape`&&He()}),Oi(`blur`,n,()=>Ue(B(t).path)),U(e,n)},c=e=>{var n=tw(),r=I(n),i=L(r,!0),a=L(R(r,2),!0);z(e=>{J(r,`title`,B(t).path),W(i,B(t).name),W(a,e)},[()=>oe(B(t).size)]),U(e,n)};G(o,e=>{B(Re)===B(t).path?e(s):e(c,-1)});var l=R(o,2);d(l,()=>B(t).path,()=>B(t).name,()=>!1),D(r),z(()=>{i=q(r,1,`ftrow ftfile svelte-evfy7n`,null,i,{active:B(se)===B(t).path}),J(r,`data-path`,B(t).path),xa(r,`padding-left:${n()*14+24}px`)}),Oi(`dragstart`,r,e=>nt(e,B(t).path)),V(`click`,r,()=>{B(Re)!==B(t).path&&fe(B(t))}),U(e,r)}),U(e,r)},l=(e,t=ue)=>{let n=j(()=>Vv(t().mode));var r=ow(),i=I(r);let a;var o=F(i),s=F(o);{let e=j(()=>B(ge).has(t().path)?`chevron-down`:`chevron-right`);$(s,{get name(){return B(e)},size:13})}D(o);var c=R(o,2);$(c,{name:`folder`,size:14});var l=R(c,2),d=L(l,!0),f=R(l,2),p=e=>{var n=iw();let r;var i=L(n,!0);z(e=>{r=q(n,1,`ftbadge svelte-evfy7n`,null,r,{rw:t().mode===`read_write`}),W(i,e)},[()=>Hv(t().mode)]),U(e,n)},m=j(()=>Hv(t().mode));G(f,e=>{B(m)&&e(p)});var h=R(f,2),g=e=>{U(e,aw())};G(h,e=>{t().exists||e(g)}),D(i);var _=R(i,2),y=e=>{u(e,()=>t().path,()=>1,()=>t().mode)},b=j(()=>t().exists&&B(ge).has(t().path));G(_,e=>{B(b)&&e(y)}),z(e=>{a=q(i,1,`ftrow ftdir ftfolder svelte-evfy7n`,null,a,{missing:!t().exists,drop:B(et)===t().path,selected:t().exists&&B(v)===t().path}),J(i,`title`,t().path),J(o,`title`,e),o.disabled=!t().exists,W(d,t().name)},[()=>B(ge).has(t().path)?`Collapse`:`Expand`]),Oi(`dragover`,i,function(...e){(B(n).move&&t().exists?e=>rt(e,t().path):null)?.apply(this,e)}),Oi(`drop`,i,function(...e){(B(n).move&&t().exists?e=>at(e,t().path):null)?.apply(this,e)}),V(`click`,i,()=>{t().exists&&(B(n).move&&Ee(t().path),be(t().path))}),V(`click`,o,e=>{e.stopPropagation(),t().exists&&be(t().path)}),U(e,r)},u=(e,t=ue,n=ue,r=ue)=>{let i=j(()=>B(he).get(t())),a=j(()=>Vv(B(i)?.mode??r()));var o=Bi(),s=I(o),c=e=>{var t=sw();z(()=>xa(t,`padding-left:${n()*14+24}px`)),U(e,t)},l=j(()=>!B(i)&&B(_e).has(t())),f=e=>{var t=dw(),o=I(t);K(o,17,()=>B(i).dirs,e=>e.path,(e,t)=>{var o=cw(),s=I(o);let c;var l=F(s),f=F(l);{let e=j(()=>B(ge).has(B(t).path)?`chevron-down`:`chevron-right`);$(f,{get name(){return B(e)},size:13})}D(l);var p=R(l,2);$(p,{name:`folder`,size:14});var m=R(p,2),h=e=>{var n=QC();za(n),yr(()=>qa(n,()=>B(ze),e=>N(ze,e))),ua(n,e=>Ge?.(e)),V(`click`,n,e=>e.stopPropagation()),V(`keydown`,n,e=>{e.key===`Enter`?Ue(B(t).path):e.key===`Escape`&&He()}),Oi(`blur`,n,()=>Ue(B(t).path)),U(e,n)},g=e=>{var n=$C(),r=L(n,!0);z(()=>W(r,B(t).name)),U(e,n)};G(m,e=>{B(Re)===B(t).path?e(h):e(g,-1)});var _=R(m,2),y=e=>{d(e,()=>B(t).path,()=>B(t).name,()=>!0)};G(_,e=>{(B(a).rename||B(a).delete)&&e(y)}),D(s);var b=R(s,2),x=e=>{u(e,()=>B(t).path,()=>n()+1,()=>B(i)?.mode??r())},S=j(()=>B(ge).has(B(t).path));G(b,e=>{B(S)&&e(x)}),z(e=>{c=q(s,1,`ftrow ftdir svelte-evfy7n`,null,c,{drop:B(et)===B(t).path,selected:B(v)===B(t).path}),J(s,`data-path`,B(t).path),xa(s,`padding-left:${n()*14+4}px`),J(s,`title`,B(t).path),J(s,`draggable`,B(a).move),J(l,`title`,e)},[()=>B(ge).has(B(t).path)?`Collapse`:`Expand`]),Oi(`dragstart`,s,function(...e){(B(a).move?e=>nt(e,B(t).path):null)?.apply(this,e)}),Oi(`dragover`,s,function(...e){(B(a).move?e=>rt(e,B(t).path):null)?.apply(this,e)}),Oi(`drop`,s,function(...e){(B(a).move?e=>at(e,B(t).path):null)?.apply(this,e)}),V(`click`,s,()=>{B(Re)!==B(t).path&&(B(a).move&&Ee(B(t).path),be(B(t).path))}),V(`click`,l,e=>{e.stopPropagation(),be(B(t).path)}),U(e,o)});var s=R(o,2);K(s,17,()=>B(i).files,e=>e.path,(e,t)=>{var r=lw();let i;var o=F(r);{let e=j(()=>VC(B(t).name));$(o,{get name(){return B(e)},size:14})}var s=R(o,2),c=e=>{var n=QC();za(n),yr(()=>qa(n,()=>B(ze),e=>N(ze,e))),ua(n,e=>Ge?.(e)),V(`click`,n,e=>e.stopPropagation()),V(`keydown`,n,e=>{e.key===`Enter`?Ue(B(t).path):e.key===`Escape`&&He()}),Oi(`blur`,n,()=>Ue(B(t).path)),U(e,n)},l=e=>{var n=tw(),r=I(n),i=L(r,!0),a=L(R(r,2),!0);z(e=>{W(i,B(t).name),W(a,e)},[()=>oe(B(t).size)]),U(e,n)};G(s,e=>{B(Re)===B(t).path?e(c):e(l,-1)});var u=R(s,2),f=e=>{d(e,()=>B(t).path,()=>B(t).name,()=>!1)};G(u,e=>{(B(a).rename||B(a).delete)&&e(f)}),D(r),z(()=>{i=q(r,1,`ftrow ftfile svelte-evfy7n`,null,i,{active:B(se)===B(t).path}),J(r,`data-path`,B(t).path),xa(r,`padding-left:${n()*14+24}px`),J(r,`title`,B(t).path),J(r,`draggable`,B(a).move)}),Oi(`dragstart`,r,function(...e){(B(a).move?e=>nt(e,B(t).path):null)?.apply(this,e)}),V(`click`,r,()=>{B(Re)!==B(t).path&&fe(B(t))}),U(e,r)});var c=R(s,2),l=e=>{var t=uw(),r=L(t,!0);z(()=>{xa(t,`padding-left:${n()*14+24}px`),W(r,B(i).err?`Not reachable`:`Empty`)}),U(e,t)};G(c,e=>{!B(i).dirs.length&&!B(i).files.length&&e(l)}),U(e,t)};G(s,e=>{B(l)?e(c):B(i)&&e(f,1)}),U(e,o)},d=(e,t=ue,n=ue,r=ue)=>{var i=Bi(),a=I(i),o=e=>{var n=fw(),i=F(n),a=R(F(i)),o=e=>{var n=Bi(),r=I(n),i=e=>{U(e,zi(`this folder`))},a=j(()=>Bv(t())),o=e=>{var n=zi();z((e,t)=>W(n,`${e??``} file${t??``}`),[()=>ae(t()),()=>ae(t())===1?``:`s`]),U(e,n)};G(r,e=>{B(a)?e(i):e(o,-1)}),U(e,n)};G(a,e=>{r()&&e(o)}),tt(),D(i);var s=R(i,2),c=L(s,!0),l=R(s,2);D(n),z(()=>{s.disabled=B(Ie)===t(),W(c,B(Ie)===t()?`…`:`yes`)}),V(`click`,n,e=>e.stopPropagation()),V(`click`,s,e=>{e.stopPropagation(),Le(t())}),V(`click`,l,e=>{e.stopPropagation(),N(Fe,``)}),U(e,n)},s=e=>{var i=hw(),a=I(i);$(F(a),{name:`ellipsis-vertical`,size:14}),D(a);var o=R(a,2),s=e=>{var i=mw(),a=F(i),o=e=>{var n=pw();$(F(n),{name:`download`,size:14}),tt(),D(n),z(e=>J(n,`href`,e),[()=>Q.fileUrl(t(),!0,B(E))]),V(`click`,n,()=>N(ke,``)),U(e,n)};G(a,e=>{r()||e(o)});var s=R(a,2);$(F(s),{name:`pencil`,size:14}),tt(),D(s);var c=R(s,4);$(F(c),{name:`trash`,size:14}),tt(),D(c),D(i),ua(i,(e,t)=>Me?.(e,t),()=>B(Ae)),V(`click`,i,e=>e.stopPropagation()),V(`click`,s,()=>Ve(t(),n())),V(`click`,c,()=>{N(ke,``),r()&&(Bv(t())||ae(t()))?N(Fe,t(),!0):Le(t())}),U(e,i)};G(o,e=>{B(ke)===t()&&e(s)}),z(()=>J(a,`aria-expanded`,B(ke)===t())),V(`click`,a,e=>je(e,t())),U(e,i)};G(a,e=>{B(Fe)===t()?e(o):B(Re)!==t()&&e(s,1)}),U(e,i)},f=M(P([])),p=M(P([])),m=M(``),h=M(!0),g=M(``),_=M(P(JC)),v=M(P(YC));hr(()=>{YC=B(v)});let y,b=!1,x=null;async function S(){if(!b&&x)return x;N(h,!0),N(g,``);let e=(async()=>{try{let e=await Q.files();N(f,e.files,!0),N(p,e.dirs,!0),N(m,e.root,!0),C()}catch(e){N(g,iS(e),!0)}N(h,!1)})();x=e;try{await e}finally{x===e&&(x=null)}}function C(){let e=new Set(B(p));if(B(v)&&!Bv(B(v))&&!e.has(B(v))){let t=B(v);do t=t.includes(`/`)?t.slice(0,t.lastIndexOf(`/`)):``;while(t&&!e.has(t));N(v,t,!0)}let t=[...B(_)].filter(t=>e.has(t));t.length!==B(_).size&&(N(_,new Set(t),!0),JC=B(_))}io(async()=>{await S(),b=!0});let w=(e,t)=>e.name.localeCompare(t.name,void 0,{numeric:!0,sensitivity:`base`}),T=j(()=>{let e={name:``,path:``,dirs:new Map,files:[]},t=t=>{let n=e;if(!t)return n;let r=``;for(let e of t.split(`/`)){r=r?r+`/`+e:e;let t=n.dirs.get(e);t||(t={name:e,path:r,dirs:new Map,files:[]},n.dirs.set(e,t)),n=t}return n};for(let e of B(p))t(e);for(let e of B(f))t(e.dir).files.push(e);return e}),ee=e=>[...e.dirs.values()].sort(w),te=e=>[...e.files].sort(w),ne=j(()=>!B(f).length&&!B(p).length),re=e=>B(_).has(e);function ie(e){B(_).has(e)?B(_).delete(e):B(_).add(e),N(_,new Set(B(_)),!0),JC=B(_)}let ae=e=>B(f).filter(t=>t.path===e||t.path.startsWith(e+`/`)).length,oe=e=>e<1024?`${e} B`:e<1048576?`${(e/1024).toFixed(1)} KB`:`${(e/1048576).toFixed(1)} MB`,se=j(()=>n().aside?.kind===`file`?n().aside.path:null),ce=j(()=>!!B(se)&&B(f).some(e=>e.path===B(se))),le=j(()=>{if(!B(ce)||!B(se))return null;let e=``,t=B(se).split(`/`);t.pop();for(let n of t)if(e=e?e+`/`+n:n,!B(_).has(e))return e;return null}),de=j(()=>B(ce)&&B(le)===null);function fe(e){e.path===B(se)?Ws():Hs(e.path)}let E=j(r),pe=M(P([])),me=M(``),he=M(P(new Map)),ge=M(P(XC)),_e=M(P(new Set));async function ve(){N(me,``);try{let e=await Q.folderRoots(B(E));N(pe,e.roots,!0)}catch(e){N(me,iS(e),!0),N(pe,[],!0)}}async function ye(e){B(_e).add(e),N(_e,new Set(B(_e)),!0);try{let t=await Q.folderList(e,B(E));B(he).set(e,{dirs:t.dirs,files:t.files,mode:t.mode})}catch{B(he).set(e,{dirs:[],files:[],err:!0})}finally{N(he,new Map(B(he)),!0),B(_e).delete(e),N(_e,new Set(B(_e)),!0)}}function be(e){B(ge).has(e)?B(ge).delete(e):(B(ge).add(e),B(he).has(e)||ye(e)),N(ge,new Set(B(ge)),!0),XC=B(ge)}async function xe(){await ve();for(let e of B(ge))await ye(e)}hr(()=>{B(E),fi(()=>{N(he,new Map,!0),ve();for(let e of B(ge))ye(e)})});let Se=!1;hr(()=>{if(i(),!Se){Se=!0;return}fi(()=>xe())}),hr(()=>{let{path:e,kind:t,epoch:n}=a();!e||n===ZC||(ZC=n,Ce(e,t))});async function Ce(e,t){if(Bv(e))return we(e,t);for(let t of GC(e))B(_).add(t);t===`directory`&&(B(_).add(e),N(v,e,!0)),N(_,new Set(B(_)),!0),JC=B(_),await S(),await li(),Te(e,t)}async function we(e,t){await ve();let n=null;for(let r of B(pe)){if(!r.exists)continue;if(r.path===e){n=[r.path];break}let i=Uv(r.path,e);if(i.length){n=t===`directory`?[...i,e]:i;break}}if(n){for(let e of n)B(ge).add(e);N(ge,new Set(B(ge)),!0),XC=B(ge),t===`directory`&&N(v,e,!0);for(let e of n)await ye(e);await li(),Te(e,t)}}function Te(e,t){if(t===`directory`){for(let t of y?.querySelectorAll(`[data-path]`)||[])if(t.dataset.path===e)return void t.scrollIntoView({block:`nearest`});return}y?.querySelector(`.ftrow.active`)?.scrollIntoView({block:`nearest`})}let Ee=e=>{N(v,e,!0)},De=e=>{e.target instanceof Element&&KC(e.target)&&N(v,``)};function Oe(e){for(let t of y?.querySelectorAll(`[data-path]`)||[])if(t.dataset.path===e)return void t.scrollIntoView({block:`nearest`})}let ke=M(``),Ae=M(null);function je(e,t){if(e.stopPropagation(),B(ke)===t){N(ke,``);return}let n=e.currentTarget.getBoundingClientRect();N(Ae,{top:n.top,bottom:n.bottom,left:n.left,right:n.right},!0),N(ke,t,!0)}function Me(e,t){let n=t=>{if(!t)return;let{width:n,height:r}=e.getBoundingClientRect(),i=window.innerWidth,a=window.innerHeight,o=t.right-n;o<8&&(o=t.left),o=Math.max(8,Math.min(o,i-n-8));let s=t.bottom+4;s+r>a-8&&t.top-4-r>=8&&(s=t.top-4-r),s=Math.max(8,Math.min(s,a-r-8)),e.style.left=`${o}px`,e.style.top=`${s}px`,e.style.transform=`none`};return n(t),{update:n}}function Ne(e){let t=e.target instanceof Element?e.target:null;B(ke)&&!t?.closest(`.ftmenu`)&&!t?.closest(`.ftkebab`)&&N(ke,``)}function Pe(e){e.key===`Escape`&&(N(ke,``),B(Re)&&He(),B(Ke)&&N(Ke,!1))}io(()=>(document.addEventListener(`pointerdown`,Ne,!0),document.addEventListener(`keydown`,Pe),()=>{document.removeEventListener(`pointerdown`,Ne,!0),document.removeEventListener(`keydown`,Pe)}));let Fe=M(``),Ie=M(``);async function Le(e){N(Ie,e,!0);try{await Q.deleteFile(e,B(E)),Bv(e)?await xe():await S()}catch(e){N(g,iS(e),!0)}N(Ie,``),N(Fe,``)}let Re=M(``),ze=M(``),Be=e=>e.includes(`/`)?e.slice(0,e.lastIndexOf(`/`)):``;function Ve(e,t){N(ke,``),N(Re,e,!0),N(ze,t,!0)}function He(){N(Re,``)}async function Ue(e){if(B(Re)!==e)return;let t=B(ze).trim();if(N(Re,``),!t)return;let n=t.includes(`/`)?t:Be(e)?Be(e)+`/`+t:t;n!==e&&await We(e,n)}async function We(e,t){N(Ie,e,!0);try{await Q.moveFile(e,t,B(E)),B(se)===e?Hs(t):B(se)&&B(se).startsWith(e+`/`)&&Hs(t+B(se).slice(e.length)),Bv(e)?await xe():await S()}catch(e){N(g,iS(e),!0)}N(Ie,``)}function Ge(e){e.focus(),e.select()}let Ke=M(!1),qe=M(``);function Je(){N(Ke,!0),N(qe,``)}async function Ye(){if(!B(Ke))return;N(Ke,!1);let e=B(qe).trim();if(!e)return;let t=B(v)?B(v)+`/`+e:e;N(Ie,t,!0);try{await Q.mkdir(t,B(E)),Bv(t)?(B(ge).add(B(v)),N(ge,new Set(B(ge)),!0),await xe()):(B(v)&&(B(_).add(B(v)),N(_,new Set(B(_)),!0)),await S()),N(v,t,!0),await li(),Oe(t)}catch(e){N(g,iS(e),!0)}N(Ie,``)}let Xe;async function Ze(e,t){if(!e||!e.length)return;let n=t||``;N(Ie,`upload`);try{let t=(await Q.uploadFiles(e,n,B(E))).saved;Bv(n)?(B(ge).add(n),N(ge,new Set(B(ge)),!0),await xe()):(n&&(B(_).add(n),N(_,new Set(B(_)),!0)),await S());let r=t[0];if(r){let e=Bv(n)?n.replace(/\/+$/,``)+`/`+r.split(`/`).pop():r;Hs(e),await li(),Oe(e)}}catch(e){N(g,iS(e),!0)}N(Ie,``)}function Qe(e){Ze(e.currentTarget.files,B(v)),e.currentTarget.value=``}let $e=`application/x-ag2-path`,et=M(null);function nt(e,t){e.dataTransfer&&(e.dataTransfer.setData($e,t),e.dataTransfer.effectAllowed=`move`)}function rt(e,t){e.preventDefault(),e.stopPropagation(),N(et,t,!0)}function it(e){e.preventDefault(),N(et,``)}async function at(e,t){if(e.preventDefault(),e.stopPropagation(),N(et,null),!e.dataTransfer)return;if(e.dataTransfer.files&&e.dataTransfer.files.length){await Ze(e.dataTransfer.files,t??B(v));return}let n=e.dataTransfer.getData($e);if(!n)return;let r=t??``,i=n.includes(`/`)?n.slice(n.lastIndexOf(`/`)+1):n,a=r?r+`/`+i:i;a!==n&&await We(n,a)}var ot=bw(),st=F(ot),ct=F(st),lt=F(ct),ut=e=>{var t=zi();z(()=>W(t,B(v))),U(e,t)},dt=e=>{U(e,zi(`Search`))};G(lt,e=>{B(v)?e(ut):e(dt,-1)}),D(ct);var ft=R(ct,4);$(F(ft),{name:`plus`,size:15}),D(ft);var pt=R(ft,2);$(F(pt),{name:`folder-plus`,size:15}),D(pt);var mt=R(pt,2);$(F(mt),{name:`rotate-cw`,size:15}),D(mt);var ht=R(mt,2);Qa(ht,e=>Xe=e,()=>Xe),D(st);var gt=R(st,2),_t=e=>{var t=gw(),n=F(t),r=R(n);D(t),z(()=>W(n,`${B(g)??``} `)),V(`click`,r,()=>N(g,``)),U(e,t)};G(gt,e=>{B(g)&&e(_t)});var vt=R(gt,2);let yt;var bt=F(vt),xt=e=>{var t=_w(),n=F(t);$(n,{name:`folder`,size:14});var r=R(n,2);za(r),yr(()=>qa(r,()=>B(qe),e=>N(qe,e))),ua(r,e=>Ge?.(e)),D(t),V(`click`,r,e=>e.stopPropagation()),V(`keydown`,r,e=>{e.key===`Enter`?Ye():e.key===`Escape`&&N(Ke,!1)}),Oi(`blur`,r,Ye),U(e,t)};G(bt,e=>{B(Ke)&&e(xt)});var St=R(bt,2),Ct=e=>{U(e,sw())},wt=e=>{U(e,vw())},Tt=e=>{c(e,()=>B(T),()=>0)};G(St,e=>{B(h)?e(Ct):B(ne)?e(wt,1):e(Tt,-1)});var Et=R(St,2),Dt=e=>{var t=gw(),n=F(t),r=R(n);D(t),z(()=>W(n,`${B(me)??``} `)),V(`click`,r,()=>N(me,``)),U(e,t)};G(Et,e=>{B(me)&&e(Dt)});var Ot=R(Et,2),kt=e=>{var t=yw();K(R(I(t),2),17,()=>B(pe),e=>e.path,(e,t)=>{l(e,()=>B(t))}),U(e,t)};G(Ot,e=>{B(pe).length&&e(kt)}),D(vt),Qa(vt,e=>y=e,()=>y);var At=R(vt,2),jt=L(At,!0);D(ot),z(()=>{J(ft,`title`,`Upload into ${(B(v)||`root`)??``}`),J(pt,`title`,`New directory in ${(B(v)||`root`)??``}`),yt=q(vt,1,`fttree svelte-evfy7n`,null,yt,{droproot:B(et)===``}),J(At,`title`,B(m)),W(jt,B(m))}),V(`click`,ft,()=>Xe?.click()),V(`click`,pt,Je),V(`click`,mt,S),V(`change`,ht,Qe),V(`click`,vt,De),Oi(`dragover`,vt,it),Oi(`drop`,vt,e=>at(e,null)),U(e,ot),k(),s()}ki([`click`,`keydown`,`change`]);var Sw=H(`ACP`),Cw=H(``),ww=H(`
`),Tw=H(`Delete? `),Ew=H(` `),Dw=H(``),Ow=H(` `,1),kw=H(`
`),Aw=H(``),jw=H(``),Mw=H(``),Nw=H(``),Pw=H(` `),Fw=H(` `),Iw=H(` `,1),Lw=H(``),Rw=H(` `,1),zw=H(` `),Bw=H(` `),Vw=H(`
`),Hw=H(`
`),Uw=H(``),Ww=H(``),Gw=H(``),Kw=H(``),qw=H(``),Jw=H(``),Yw=H(`
`),Xw=H(` `,1),Zw=H(`
`),Qw=H(`
Starred
`,1),$w=H(`
`),eT=H(` `,1),tT=H(` `,1),nT=H(` `,1),rT=H(`
`),iT=H(`
`),aT=H(`
Assistant
`);function oT(e,t){O(t,!0);let n=()=>A(No,`$profiles`,c),r=()=>A(Lo,`$chats`,c),i=()=>A(Ro,`$tasks`,c),a=()=>A(zo,`$listsLoaded`,c),o=()=>A(Po,`$profileEpoch`,c),s=()=>A(js,`$route`,c),[c,l]=Zt(),u={Monday:`Mon`,Tuesday:`Tue`,Wednesday:`Wed`,Thursday:`Thu`,Friday:`Fri`,Saturday:`Sat`,Sunday:`Sun`},d=e=>(e||``).replace(/\b(Monday|Tuesday|Wednesday|Thursday|Friday|Saturday|Sunday)\b/g,e=>u[e]||e).replace(/\bEvery hour, between (\S+) and (\S+)/,`Hourly $1–$2`).replace(/\b[Bb]etween (\S+) and (\S+)/,`$1–$2`).replace(/ through /g,`–`),f=j(()=>n().list),p=typeof navigator<`u`&&/Mac|iPhone|iPad/.test(navigator.platform||``),m=e=>{let t=B(f).findIndex(t=>t.id===e);return t>=0&&t<9?` — ${p?`⌘`:`Ctrl+`}${t+1}`:``},h=e=>e.name+m(e.id),g=j(()=>B(f).find(e=>e.id===n().activeId)),v=e=>(e?.name||`?`).trim().charAt(0).toUpperCase()||`?`,y=e=>ux(e),b=j(()=>B(f).length<=4?B(f):B(f).slice(0,3)),x=j(()=>B(f).length<=4?[]:B(f).slice(3)),S=M(!1);function C(e){let t=e.target instanceof Element?e.target:null;B(S)&&!t?.closest(`.profchips`)&&N(S,!1),B(Te)&&!t?.closest(`.chatmenu`)&&!t?.closest(`.rowkebab`)&&N(Te,``),B(Fe)&&!t?.closest(`.taskmenu`)&&!t?.closest(`.rowkebab`)&&N(Fe,``)}function w(e){if(B(T)&&e.key===`Escape`){N(T,!1);return}B(S)&&e.key===`Escape`&&N(S,!1),B(Te)&&e.key===`Escape`&&N(Te,``),B(Fe)&&e.key===`Escape`&&N(Fe,``)}let T=M(!1),ee=j(()=>B(f).map(e=>e.accent));async function te({name:e,accent:t}){let n=await Q.createProfile(e,t);No.update(e=>({...e,list:[...e.list,n.profile]})),N(T,!1),ux(n.profile.id)}let ne=M(null),re=j(()=>(B(ne)?.profiles||[]).find(e=>e.pid===n().activeId)||null),ie=M(P({})),ae=e=>(B(ie)[e]?.unseen_done||0)>0;async function oe(){let e=Kt(Po);try{let t=await Q.chats();if(Kt(Po)===e){let e=new Set(t.map(e=>e.chat_id));Xt(Lo,[...r().filter(t=>!e.has(t.chat_id)),...t])}}catch{}try{let t=await Q.tasks();Kt(Po)===e&&Xt(Ro,t)}catch{}Kt(Po)===e&&Xt(zo,!0);try{N(ne,await Q.usageAll(),!0)}catch{}try{let e=await Q.status();N(ie,Object.fromEntries(e.map(e=>[e.pid,e])),!0)}catch{}}let se=e=>e?e<1e3?String(Math.round(e)):`${(e/1e3).toFixed(+(e<1e4))}k`:`0`,ce=e=>{let t=`${se(e.total)} tok`;return e.priced?`${t} · ~$${e.cost.toFixed(e.cost<1?3:2)}`:t},le=j(()=>(B(ne)?.profiles||[]).length>1),de=j(()=>{if(!B(re)||!B(re).total)return``;let e=ce(B(re));return B(le)&&B(ne)?.total?.total&&(e+=` · all: ${ce(B(ne).total)}`),e}),fe=j(()=>{if(!B(re))return``;let e=Object.keys(B(re).by_model||{}).join(`, `),t=`Today (${B(re).date}): ${se(B(re).prompt)} in / ${se(B(re).completion)} out`+(B(re).priced?` · ~$${(B(re).cost||0).toFixed(4)} (estimate)`:` · cost: no price set`)+(e?`\nmodels: ${e}`:``);if(B(le)&&B(ne)){let e=B(ne).profiles.filter(e=>e.total).map(e=>`${e.name}: ${ce(e)}`).join(` · `);e&&(t+=`\nall profiles — ${e}`)}return t});io(()=>{oe();let e=setInterval(oe,5e3);return document.addEventListener(`pointerdown`,C,!0),document.addEventListener(`keydown`,w),()=>{clearInterval(e),document.removeEventListener(`pointerdown`,C,!0),document.removeEventListener(`keydown`,w)}});let E=-1;hr(()=>{let e=o();if(E===-1){E=e;return}e!==E&&(E=e,Xt(zo,!1),oe())});let pe=j(()=>r().filter(e=>e.starred)),me=j(()=>_y(r().filter(e=>!e.starred).map(e=>({...e,at:e.updated})),gy)),he=(e,t)=>new Date(yy(t))-+new Date(yy(e)),ge=j(()=>i().filter(e=>e.starred).sort(he)),_e=j(()=>_y(i().filter(e=>!e.starred).sort(he).map(e=>({...e,at:yy(e)})),gy)),ve=e=>Fs(`/c/`+e),ye=e=>Fs(`/t/`+e),be=()=>Fs(`/c/`+qs());function xe(e,t){e.target===e.currentTarget&&(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),t())}let Se=M(``),Ce=M(``);async function we(e){N(Ce,e,!0);try{await Q.deleteChat(e),Xt(Lo,r().filter(t=>t.chat_id!==e)),s().name===`chat`&&s().id===e&&Fs(`/c/`+qs())}catch{}N(Ce,``),N(Se,``)}let Te=M(``),Ee=M(``),De=M(P({x:0,y:0}));function Oe(e,t){if(e.stopPropagation(),B(Te)===t.chat_id){N(Te,``);return}let n=e.currentTarget.getBoundingClientRect();N(De,{x:n.right,y:n.bottom+4},!0),N(Te,t.chat_id,!0)}async function ke(e){N(Te,``);let t=!e.starred;Xt(Lo,r().map(n=>n.chat_id===e.chat_id?{...n,starred:t}:n));try{await Q.updateChat(e.chat_id,{starred:t})}catch{Xt(Lo,r().map(n=>n.chat_id===e.chat_id?{...n,starred:!t}:n))}}let Ae=M(``),je=M(``);function Me(e){N(Te,``),N(Ae,e.chat_id,!0),N(je,e.title||e.preview||``,!0)}async function Ne(e){if(B(Ae)!==e.chat_id)return;N(Ae,``);let t=B(je).trim();if(!t||t===(e.title||``))return;let n=e.title;Xt(Lo,r().map(n=>n.chat_id===e.chat_id?{...n,title:t}:n));try{await Q.updateChat(e.chat_id,{title:t})}catch{Xt(Lo,r().map(t=>t.chat_id===e.chat_id?{...t,title:n}:t))}}function Pe(e){e.focus(),e.select()}let Fe=M(``),Ie=M(``),Le=M(``),Re=M(``),ze=M(``);function Be(e,t){if(e.stopPropagation(),N(Te,``),B(Fe)===t.id){N(Fe,``);return}let n=e.currentTarget.getBoundingClientRect();N(De,{x:n.right,y:n.bottom+4},!0),N(Fe,t.id,!0)}async function Ve(e){N(Fe,``);let t=!e.paused;Xt(Ro,i().map(n=>n.id===e.id?{...n,paused:t}:n));try{await Q.updateTask(e.id,{paused:t})}catch{Xt(Ro,i().map(n=>n.id===e.id?{...n,paused:!t}:n))}}async function He(e){N(Fe,``);let t=!e.starred;Xt(Ro,i().map(n=>n.id===e.id?{...n,starred:t}:n));try{await Q.updateTask(e.id,{starred:t})}catch{Xt(Ro,i().map(n=>n.id===e.id?{...n,starred:!t}:n))}}function Ue(e){N(Fe,``),Ho.set(e.id),ye(e.id)}function We(e){N(Fe,``),N(Ie,e.id,!0),N(Le,e.name||``,!0)}async function Ge(e){if(B(Ie)!==e.id)return;N(Ie,``);let t=B(Le).trim();if(!t||t===e.name)return;let n=e.name;Xt(Ro,i().map(n=>n.id===e.id?{...n,name:t}:n));try{await Q.updateTask(e.id,{name:t})}catch{Xt(Ro,i().map(t=>t.id===e.id?{...t,name:n}:t))}}async function Ke(e){N(ze,e,!0);try{await Q.deleteTask(e),Xt(Ro,i().filter(t=>t.id!==e)),s().name===`task`&&s().id===e&&Is(`tasks`)}catch{}N(ze,``),N(Re,``)}let qe={running:{icon:`spinner`,label:`running`},needs_input:{icon:`help-circle`,label:`needs input`},completed:{icon:`check`,label:`completed`},failed:{icon:`x`,label:`failed`},cancelled:{icon:`slash`,label:`cancelled`}},Je=e=>e&&qe[e]||{icon:`clock`,label:e||``};var Ye=aT();{let e=(e,t=ue)=>{var n=kw();let r;var i=F(n),a=e=>{var n=Sw();let r;z(()=>{r=q(n,1,`tag originbadge svelte-ledzjv`,null,r,{live:t().origin_live}),J(n,`title`,t().origin_live?`Live — driven by the “${t().origin_name}” ACP listener`:`Started by the “${t().origin_name}” ACP listener`)}),U(e,n)};G(i,e=>{t().origin_platform===`acp`&&e(a)});var o=R(i,2),c=e=>{var n=Cw();za(n),ua(n,e=>Pe?.(e)),z(()=>Ba(n,B(je))),V(`input`,n,e=>N(je,e.currentTarget.value,!0)),V(`click`,n,e=>e.stopPropagation()),V(`keydown`,n,e=>{e.key===`Enter`?Ne(t()):e.key===`Escape`&&N(Ae,``)}),Oi(`blur`,n,()=>Ne(t())),U(e,n)},l=e=>{var n=ww(),r=L(n,!0);z(()=>{J(n,`title`,t().preview||``),W(r,t().title||t().preview||t().chat_id)}),U(e,n)};G(o,e=>{B(Ae)===t().chat_id?e(c):e(l,-1)});var u=R(o,2),d=e=>{var n=Tw(),r=R(F(n),2),i=L(r,!0),a=R(r,2);D(n),z(()=>{r.disabled=B(Ce)===t().chat_id,W(i,B(Ce)===t().chat_id?`…`:`yes`)}),V(`click`,n,e=>e.stopPropagation()),V(`click`,r,e=>{e.stopPropagation(),we(t().chat_id)}),V(`click`,a,e=>{e.stopPropagation(),N(Se,``)}),U(e,n)},f=e=>{var n=Ow(),r=I(n),i=e=>{var n=Ew(),r=L(n,!0);z(e=>W(r,e),[()=>fy(t().updated)]),U(e,n)};G(r,e=>{t().updated&&e(i)});var a=R(r,2);$(F(a),{name:`ellipsis-vertical`,size:14}),D(a);var o=R(a,2),s=e=>{var n=Dw(),r=F(n),i=F(r);$(i,{name:`star`,size:14});var a=R(i);D(r);var o=R(r,2);$(F(o),{name:`pencil`,size:14}),tt(),D(o);var s=R(o,2);$(F(s),{name:`folder`,size:13}),tt(),D(s);var c=R(s,4);$(F(c),{name:`trash`,size:14}),tt(),D(c),D(n),z(()=>{xa(n,`left:${B(De).x??``}px; top:${B(De).y??``}px`),W(a,` ${t().starred?`Unstar`:`Star`}`)}),V(`click`,n,e=>e.stopPropagation()),V(`click`,r,()=>ke(t())),V(`click`,o,()=>Me(t())),V(`click`,s,()=>{let e=B(Te);N(Te,``),N(Ee,e,!0)}),V(`click`,c,()=>{N(Te,``),N(Se,t().chat_id,!0)}),U(e,n)};G(o,e=>{B(Te)===t().chat_id&&e(s)}),z(()=>J(a,`aria-expanded`,B(Te)===t().chat_id)),V(`click`,a,e=>Oe(e,t())),U(e,n)};G(u,e=>{B(Se)===t().chat_id?e(d):B(Ae)!==t().chat_id&&e(f,1)}),D(n),z(()=>r=q(n,1,`drow chatrow svelte-ledzjv`,null,r,{on:s().name===`chat`&&s().id===t().chat_id})),V(`click`,n,()=>ve(t().chat_id)),V(`keydown`,n,e=>xe(e,()=>ve(t().chat_id))),U(e,n)},t=(e,t=ue)=>{let n=j(()=>!t().paused&&t().next_run_at?by(t().next_run_at):``);var r=Hw();let i;var a=F(r),o=F(a),c=e=>{var t=Aw();$(F(t),{name:`pause`,size:14}),D(t),U(e,t)},l=e=>{var t=jw();$(F(t),{name:`help-circle`,size:14}),D(t),U(e,t)},u=e=>{var n=Mw(),r=F(n);{let e=j(()=>Je(t().last_run.status).icon);$(r,{get name(){return B(e)},size:14})}D(n),z(()=>{q(n,1,`statusicon ${t().last_run.status??``}`,`svelte-ledzjv`),J(n,`title`,t().last_run.status)}),U(e,n)},f=e=>{var t=Nw();$(F(t),{name:`clock`,size:14}),D(t),U(e,t)};G(o,e=>{t().paused?e(c):t().needs_input?e(l,1):t().last_run?e(u,2):e(f,-1)});var p=R(o,2),m=e=>{var n=Cw();za(n),ua(n,e=>Pe?.(e)),z(()=>Ba(n,B(Le))),V(`input`,n,e=>N(Le,e.currentTarget.value,!0)),V(`click`,n,e=>e.stopPropagation()),V(`keydown`,n,e=>{e.key===`Enter`?Ge(t()):e.key===`Escape`&&N(Ie,``)}),Oi(`blur`,n,()=>Ge(t())),U(e,n)},h=e=>{var n=Iw(),r=I(n),i=L(r,!0),a=R(r,2),o=e=>{var n=Pw(),r=L(n,!0);z(()=>{J(n,`title`,`${t().unread??``} unread`),W(r,t().unread)}),U(e,n)},s=e=>{var n=Fw(),r=L(n,!0);z((e,i)=>{q(n,1,`rowtime lastrun ${t().last_run.status??``}`,`svelte-ledzjv`),J(n,`title`,`Last run: ${e??``}`),W(r,i)},[()=>Je(t().last_run.status).label,()=>fy(t().last_run.ended_at||t().last_run.started_at)]),U(e,n)};G(a,e=>{t().unread?e(o):t().last_run&&e(s,1)}),z(()=>W(i,t().name)),U(e,n)};G(p,e=>{B(Ie)===t().id?e(m):e(h,-1)});var g=R(p,2),_=e=>{var n=Tw(),r=R(F(n),2),i=L(r,!0),a=R(r,2);D(n),z(()=>{r.disabled=B(ze)===t().id,W(i,B(ze)===t().id?`…`:`yes`)}),V(`click`,n,e=>e.stopPropagation()),V(`click`,r,e=>{e.stopPropagation(),Ke(t().id)}),V(`click`,a,e=>{e.stopPropagation(),N(Re,``)}),U(e,n)},v=e=>{var n=Rw(),r=I(n);$(F(r),{name:`ellipsis-vertical`,size:14}),D(r);var i=R(r,2),a=e=>{var n=Lw(),r=F(n),i=F(r);$(i,{name:`star`,size:14});var a=R(i);D(r);var o=R(r,2);$(F(o),{name:`pencil`,size:14}),tt(),D(o);var s=R(o,2),c=F(s);{let e=j(()=>t().paused?`play`:`pause`);$(c,{get name(){return B(e)},size:14})}var l=R(c);D(s);var u=R(s,2);$(F(u),{name:`pencil`,size:14}),tt(),D(u);var d=R(u,4);$(F(d),{name:`trash`,size:14}),tt(),D(d),D(n),z(()=>{xa(n,`left:${B(De).x??``}px; top:${B(De).y??``}px`),W(a,` ${t().starred?`Unstar`:`Star`}`),W(l,` ${t().paused?`Enable`:`Disable`}`)}),V(`click`,n,e=>e.stopPropagation()),V(`click`,r,()=>He(t())),V(`click`,o,()=>We(t())),V(`click`,s,()=>Ve(t())),V(`click`,u,()=>Ue(t())),V(`click`,d,()=>{N(Fe,``),N(Re,t().id,!0)}),U(e,n)};G(i,e=>{B(Fe)===t().id&&e(a)}),z(()=>J(r,`aria-expanded`,B(Fe)===t().id)),V(`click`,r,e=>Be(e,t())),U(e,n)};G(g,e=>{B(Re)===t().id?e(_):B(Ie)!==t().id&&e(v,1)}),D(a);var y=R(a,2),b=e=>{var r=Vw(),i=F(r),a=e=>{var n=zw(),r=L(n,!0);z(e=>{J(n,`title`,t().schedule_desc),W(r,e)},[()=>d(t().schedule_desc)||t().schedule_desc]),U(e,n)};G(i,e=>{t().schedule.kind!==`manual`&&e(a)});var o=R(i,2),s=e=>{var t=Bw(),r=L(t,!0);z(()=>W(r,B(n))),U(e,t)};G(o,e=>{B(n)&&e(s)}),D(r),U(e,r)};G(y,e=>{(t().schedule.kind!==`manual`||B(n))&&B(Ie)!==t().id&&e(b)}),D(r),z(()=>i=q(r,1,`drow ttask svelte-ledzjv`,null,i,{on:s().name===`task`&&s().id===t().id,unseen:t().unread>0})),V(`click`,r,()=>ye(t().id)),V(`keydown`,r,e=>xe(e,()=>ye(t().id))),U(e,r)};var Xe=F(Ye);_C(Xe,{side:`left`,get width(){return cs},get clamp(){return lo}});var Ze=R(Xe,2),Qe=F(Ze),$e=R(Qe,2);tt(2),D(Ze);var et=R(Ze,2),nt=e=>{var t=Yw(),n=F(t),r=F(n);K(r,17,()=>B(b),e=>e.id,(e,t)=>{let n=j(()=>B(t).id===B(g).id);var r=Ww();let i;var a=F(r),o=L(a,!0),s=R(a,2),c=e=>{U(e,Uw())},l=j(()=>ae(B(t).id));G(s,e=>{B(l)&&e(c)}),D(r),z((e,a,s)=>{i=q(r,1,`chip svelte-ledzjv`,null,i,{active:B(n)}),xa(r,`--p:${B(t).accent??``}; --p-ink:${e??``}`),J(r,`title`,a),J(r,`aria-selected`,B(n)),J(r,`aria-current`,B(n)?`true`:void 0),W(o,s)},[()=>_(B(t).accent),()=>h(B(t)),()=>v(B(t))]),V(`click`,r,()=>B(n)?null:y(B(t).id)),U(e,r)});var i=R(r,2),a=e=>{let t=j(()=>B(x).some(e=>e.id===B(g).id)),n=j(()=>B(x).some(e=>ae(e.id)));var r=Gw();let i;var a=F(r),o=L(a),s=R(a,2),c=e=>{U(e,Uw())};G(s,e=>{B(n)&&e(c)}),D(r),z(()=>{i=q(r,1,`chip more svelte-ledzjv`,null,i,{active:B(t)}),J(r,`aria-expanded`,B(S)),W(o,`+${B(x).length??``}`)}),V(`click`,r,()=>N(S,!B(S))),U(e,r)};G(i,e=>{B(x).length&&e(a)});var o=R(i,2);$(F(o),{name:`plus`,size:15}),D(o),D(n);var s=R(n,2),c=L(s,!0),l=R(s,2),u=e=>{var t=Jw();K(t,21,()=>B(x),e=>e.id,(e,t)=>{let n=j(()=>B(t).id===B(g).id);var r=qw();let i;var a=F(r),o=R(a,2),s=L(o,!0),c=R(o,2),l=e=>{U(e,Kw())},u=j(()=>ae(B(t).id));G(c,e=>{B(u)&&e(l)});var d=R(c,2),f=e=>{$(e,{name:`check`,size:13})};G(d,e=>{B(n)&&e(f)}),D(r),z(e=>{i=q(r,1,`profitem svelte-ledzjv`,null,i,{active:B(n)}),J(r,`title`,e),J(r,`aria-current`,B(n)?`true`:void 0),xa(a,`--dot:${B(t).accent??``}`),W(s,B(t).name)},[()=>h(B(t))]),V(`click`,r,()=>B(n)?N(S,!1):y(B(t).id)),U(e,r)}),D(t),U(e,t)};G(l,e=>{B(S)&&B(x).length&&e(u)}),D(t),z(()=>{J(s,`title`,B(g).name),W(c,B(g).name)}),V(`click`,o,()=>N(T,!0)),U(e,t)};G(et,e=>{B(g)&&e(nt)});var rt=R(et,2),it=e=>{var t=Xw(),n=I(t),r=R(n,2);ES(R(F(r),4),{get claimed(){return B(ee)},submitLabel:`Create profile`,busyLabel:`Creating…`,onSubmit:te,onCancel:()=>N(T,!1)}),D(r),V(`click`,n,()=>N(T,!1)),U(e,t)};G(rt,e=>{B(T)&&e(it)});var at=R(rt,2),ot=e=>{PC(e,{get chatId(){return B(Ee)},onClose:()=>N(Ee,``)})};G(at,e=>{B(Ee)&&e(ot)});var st=R(at,2),ct=F(st);let n;$(F(ct),{name:`message`,size:14}),tt(),D(ct);var lt=R(ct,2);let o;$(F(lt),{name:`list`,size:14}),tt(),D(lt);var ut=R(lt,2);let c;$(F(ut),{name:`folder`,size:14}),tt(),D(ut),D(st);var dt=R(st,2),ft=e=>{xw(e,{})},pt=n=>{var o=rT(),c=F(o),l=t=>{var n=tT(),i=I(n);$(F(i),{name:`plus`,size:15}),tt(),D(i);var o=R(i,2),s=e=>{var t=Zw(),n=L(t,!0);z(()=>W(n,a()?`No conversations yet.`:`Loading…`)),U(e,t)};G(o,e=>{r().length||e(s)});var c=R(o,2),l=t=>{var n=Qw();K(R(I(n),2),17,()=>B(pe),e=>e.chat_id,(t,n)=>{e(t,()=>B(n))}),U(t,n)};G(c,e=>{B(pe).length&&e(l)}),K(R(c,2),17,()=>B(me),({item:e,sep:t})=>e.chat_id,(t,n)=>{let r=()=>B(n).item,i=()=>B(n).sep;var a=eT(),o=I(a),s=e=>{var t=$w(),n=L(t,!0);z(()=>W(n,i())),U(e,t)};G(o,e=>{i()&&e(s)});var c=R(o,2);e(c,r),U(t,a)}),V(`click`,i,be),U(t,n)},u=e=>{var n=nT(),r=I(n);$(F(r),{name:`plus`,size:15}),tt(),D(r);var o=R(r,2),s=e=>{var t=Zw(),n=L(t,!0);z(()=>W(n,a()?`No tasks yet.`:`Loading…`)),U(e,t)};G(o,e=>{i().length||e(s)});var c=R(o,2),l=e=>{var n=Qw();K(R(I(n),2),17,()=>B(ge),e=>e.id,(e,n)=>{t(e,()=>B(n))}),U(e,n)};G(c,e=>{B(ge).length&&e(l)}),K(R(c,2),17,()=>B(_e),({item:e,sep:t})=>e.id,(e,n)=>{let r=()=>B(n).item,i=()=>B(n).sep;var a=eT(),o=I(a),s=e=>{var t=$w(),n=L(t,!0);z(()=>W(n,i())),U(e,t)};G(o,e=>{i()&&e(s)});var c=R(o,2);t(c,r),U(e,a)}),V(`click`,r,()=>ye(`new`)),U(e,n)};G(c,e=>{s().tab===`chats`?e(l):e(u,-1)}),D(o),Oi(`scroll`,o,()=>{N(Te,``),N(Fe,``)}),U(n,o)};G(dt,e=>{s().tab===`files`?e(ft):e(pt,-1)});var mt=R(dt,2),ht=e=>{var t=iT(),n=F(t);$(F(n),{name:`cpu`,size:13}),D(n);var r=L(R(n));D(t),z(()=>{J(t,`title`,B(fe)),W(r,`Today · ${B(de)??``}`)}),U(e,t)};G(mt,e=>{B(de)&&e(ht)});var gt=R(mt,2),_t=F(gt);$(F(_t),{name:`settings`,size:15}),tt(),D(_t),D(gt),D(Ye),z(()=>{J(Qe,`src`,DS),J($e,`src`,OS),n=q(ct,1,`seg`,null,n,{on:s().tab===`chats`}),J(ct,`aria-selected`,s().tab===`chats`),o=q(lt,1,`seg`,null,o,{on:s().tab===`tasks`}),J(lt,`aria-selected`,s().tab===`tasks`),c=q(ut,1,`seg`,null,c,{on:s().tab===`files`}),J(ut,`aria-selected`,s().tab===`files`)}),V(`click`,ct,()=>Fs(`/chats`)),V(`click`,lt,()=>Fs(`/tasks`)),V(`click`,ut,()=>Fs(`/files`)),V(`click`,_t,()=>Rs(`settings`,`general`))}U(e,Ye),k(),l()}ki([`click`,`keydown`,`input`]);var sT=Wt({configs:[],active:null,envOverride:null,providerDeps:{},builtinByType:{},builtinOptionsByType:{},paramsByType:{},loaded:!1});async function cT(){let e=await Q.llmConfigs();sT.set({configs:e.configs||[],active:e.active??null,envOverride:e.env_override??null,providerDeps:e.provider_deps||{},builtinByType:e.builtin_tools_by_type||{},builtinOptionsByType:e.builtin_options_by_type||{},paramsByType:e.params_by_type||{},loaded:!0})}function lT(e){return e.deps&&!e.deps.ok||e.key_source===`none`?!1:e.type!==`openai_subscription`||!!e.signed_in}var uT=e=>`@`+String(e??``);function dT(e){return{path:e.path,name:e.name,dir:e.dir||``,kind:e.kind||`file`,label:uT(e.name)}}function fT(e,t){let n=String(e??``),r=Math.max(0,Math.min(t??n.length,n.length)),i=r;for(;i>0&&!/\s/.test(n[i-1]);)i--;return n[i]===`@`?{start:i,query:n.slice(i+1,r)}:null}function pT(e,t,n,r){let i=String(e??``),a=i.slice(0,t),o=i.slice(n),s=r+` `;return{text:a+s+o,caret:a.length+s.length}}var mT=e=>e!==``&&/[A-Za-z0-9_]/.test(e),hT=(e,t)=>{if(!t)return 0;let n=0,r=0;for(;(r=e.indexOf(t,r))!==-1;){let i=r===0?``:e[r-1],a=e[r+t.length]??``;(i===``||/\s/.test(i))&&!mT(a)&&(n+=1),r+=t.length}return n};function gT(e,t){let n=String(t??``),r=new Map,i=[];for(let t of e||[]){r.has(t.label)||r.set(t.label,hT(n,t.label));let e=r.get(t.label)??0;e>0&&(r.set(t.label,e-1),i.push(t))}return i}function _T(e){return!e||!e.length?``:`Referenced files: `+e.map(e=>e.kind===`directory`?`- ${e.path} (directory — list its contents)`:`- ${e.path}`).join(` -`)}function gT(e,t){let n=String(e??``),r=[...new Set((t||[]).map(e=>e.label).filter(Boolean))].sort((e,t)=>t.length-e.length);if(!r.length)return n?[{text:n,mark:!1}]:[];let i=[],a=0,o=0;for(;oe.label).filter(Boolean))].sort((e,t)=>t.length-e.length);if(!r.length)return n?[{text:n,mark:!1}]:[];let i=[],a=0,o=0;for(;o `),xT=H(`
Queued · the agent will see this at its next step
`),ST=H(`
`);function CT(e,t){O(t,!0);let n=j(()=>vT(t.item.text||``)),r=j(()=>gT(B(n).body,B(n).refs)),i=j(()=>{let e=new Map;for(let t of B(n).refs)e.set(t.label,[...e.get(t.label)||[],t]);return e});function a(e){e&&(e.kind===`directory`?Qo(e.path):Hs(e.path))}var o=ST();let s;var c=F(o);let l;K(c,21,()=>B(r),Qi,(e,t)=>{var n=Bi(),r=I(n),o=e=>{let n=j(()=>B(i).get(B(t).text)||[]);var r=bT(),o=L(r,!0);z(e=>{J(r,`title`,e),W(o,B(t).text)},[()=>B(n).map(e=>e.path).join(` -`)]),V(`click`,r,()=>a(B(n)[0])),U(e,r)},s=e=>{var n=zi();z(()=>W(n,B(t).text)),U(e,n)};G(r,e=>{B(t).mark?e(o):e(s,-1)}),U(e,n)}),D(c);var u=R(c,2),d=e=>{U(e,xT())};G(u,e=>{t.item.queued&&e(d)}),D(o),z(()=>{s=q(o,1,`msg user`,null,s,{queued:t.item.queued}),l=q(c,1,`bubble`,null,l,{voice:t.item.voice})}),U(e,o),k()}ki([`click`]);function wT(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var TT=wT();function ET(e){TT=e}var DT={exec:()=>null};function OT(e){let t=[];return n=>{let r=Math.max(0,Math.min(3,n-1)),i=t[r];return i||(i=e(r),t[r]=i),i}}function kT(e,t=``){let n=typeof e==`string`?e:e.source,r={replace:(e,t)=>{let i=typeof t==`string`?t:t.source;return i=i.replace(jT.caret,`$1`),n=n.replace(e,i),r},getRegex:()=>new RegExp(n,t)};return r}var AT=((e=``)=>{try{return!!RegExp(`(?<=1)(?/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] +\S/,listReplaceTask:/^\[[ xX]\] +/,listTaskCheckbox:/\[[ xX]\]/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:e=>RegExp(`^( {0,3}${e})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:OT(e=>RegExp(`^ {0,${e}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`)),hrRegex:OT(e=>RegExp(`^ {0,${e}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`)),fencesBeginRegex:OT(e=>RegExp(`^ {0,${e}}(?:\`\`\`|~~~)`)),headingBeginRegex:OT(e=>RegExp(`^ {0,${e}}#`)),htmlBeginRegex:OT(e=>RegExp(`^ {0,${e}}<(?:[a-z].*>|!--)`,`i`)),blockquoteBeginRegex:OT(e=>RegExp(`^ {0,${e}}>`))},MT=/^(?:[ \t]*(?:\n|$))+/,NT=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,PT=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,FT=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,IT=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,LT=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,RT=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,zT=kT(RT).replace(/bull/g,LT).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}(?:\s|$)/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,``).getRegex(),BT=kT(RT).replace(/bull/g,LT).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}(?:\s|$)/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),VT=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table|[ \t]+\n)[^\n]+)*)/,HT=/^[^\n]+/,UT=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,WT=kT(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace(`label`,UT).replace(`title`,/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),GT=kT(/^(bull)([ \t][^\n]*?)?(?:\n|$)/).replace(/bull/g,LT).getRegex(),KT=`address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul`,qT=/|$))/,JT=kT(`^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:[^\\n]*\\n*|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>[^\\n]*\\n*|$)|[^\\n]*\\n*|$)|[^\\n]*\\n*|$)|)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))`,`i`).replace(`comment`,qT).replace(`tag`,KT).replace(`attribute`,/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),YT=e=>kT(VT).replace(`hr`,FT).replace(`heading`,` {0,3}#{1,6}(?:\\s|$)`).replace(`|lheading`,``).replace(`|table`,``).replace(`blockquote`,` {0,3}>`).replace(`fences`," {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace(`list`,e).replace(`html`,`)|<(?:script|pre|style|textarea|!--)`).replace(`tag`,KT).getRegex(),XT=YT(/ {0,3}(?:[*+-]|1[.)])[ \t]+[^ \t\n]/),ZT=YT(/ {0,3}(?:[*+-]|\d{1,9}[.)])(?:[ \t]|\n|$)/),QT={blockquote:kT(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace(`paragraph`,ZT).getRegex(),code:NT,def:WT,fences:PT,heading:IT,hr:FT,html:JT,lheading:zT,list:GT,newline:MT,paragraph:XT,table:DT,text:HT},$T=kT(`^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)`).replace(`hr`,FT).replace(`heading`,` {0,3}#{1,6}(?:\\s|$)`).replace(`blockquote`,` {0,3}>`).replace(`code`,`(?: {4}| {0,3} )[^\\n]`).replace(`fences`," {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace(`list`,` {0,3}(?:[*+-]|1[.)])[ \\t]`).replace(`html`,`)|<(?:script|pre|style|textarea|!--)`).replace(`tag`,KT).getRegex(),eE={...QT,lheading:BT,table:$T,paragraph:kT(VT).replace(`hr`,FT).replace(`heading`,` {0,3}#{1,6}(?:\\s|$)`).replace(`|lheading`,``).replace(`table`,$T).replace(`blockquote`,` {0,3}>`).replace(`fences`," {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace(`list`,` {0,3}(?:[*+-]|1[.)])[ \\t]+[^ \\t\\n]`).replace(`html`,`)|<(?:script|pre|style|textarea|!--)`).replace(`tag`,KT).getRegex()},tE={...QT,html:kT(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+? *(?:\\n{2,}|\\s*$)|\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace(`comment`,qT).replace(/tag/g,`(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b`).getRegex(),def:/^ *\[([^\]]+)\]: *]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:DT,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:kT(VT).replace(`hr`,FT).replace(`heading`,` *#{1,6} *[^ -]`).replace(`lheading`,zT).replace(`|table`,``).replace(`blockquote`,` {0,3}>`).replace(`|fences`,``).replace(`|list`,``).replace(`|html`,``).replace(`|tag`,``).getRegex()},nE=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,rE=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,iE=/^( {2,}|\\)\n(?!\s*$)/,aE=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\`+)[^`]+\k(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace(`precode-`,AT?"(?`+)[^`]+\k(?!`)/).replace(`html`,/<(?! )[^<>]*?>/).getRegex(),hE=/^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/,gE=kT(hE,`u`).replace(/punct/g,oE).getRegex(),_E=kT(hE,`u`).replace(/punct/g,dE).getRegex(),vE=kT(/^(?:\*+(?:((?!\*)(?!openQuote)punct)|([^\s*]))?)|^_+(?:((?!_)(?!openQuote)punct)|([^\s_]))?/,`u`).replace(/openQuote/g,uE).replace(/punct/g,oE).getRegex(),yE=`^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)`,bE=kT(yE,`gu`).replace(/notPunctSpace/g,cE).replace(/punctSpace/g,sE).replace(/punct/g,oE).getRegex(),xE=kT(yE,`gu`).replace(/notPunctSpace/g,pE).replace(/punctSpace/g,fE).replace(/punct/g,dE).getRegex(),SE=kT(`^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)[\\s](\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|(?:(?!\\*)punct|notPunctSpace)(\\*+)(?!\\*)(?=notPunctSpace)`,`gu`).replace(/notPunctSpace/g,cE).replace(/punctSpace/g,sE).replace(/punct/g,oE).getRegex(),CE=kT(`^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)`,`gu`).replace(/notPunctSpace/g,cE).replace(/punctSpace/g,sE).replace(/punct/g,oE).getRegex(),wE=kT(`^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)[\\s](_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)|(?:(?!_)punct|notPunctSpace)(_+)(?!_)(?=notPunctSpace)`,`gu`).replace(/notPunctSpace/g,cE).replace(/punctSpace/g,sE).replace(/punct/g,oE).getRegex(),TE=kT(/^~~?(?:((?!~)punct)|[^\s~])/,`u`).replace(/punct/g,oE).getRegex(),EE=kT(`^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)`,`gu`).replace(/notPunctSpace/g,cE).replace(/punctSpace/g,sE).replace(/punct/g,oE).getRegex(),DE=kT(/\\(punct)/,`gu`).replace(/punct/g,oE).getRegex(),OE=kT(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace(`scheme`,/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace(`email`,/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),kE=kT(qT).replace(`(?:-->|$)`,`-->`).getRegex(),AE=kT(`^comment|^|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^|^`).replace(`comment`,kE).replace(`attribute`,/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),jE=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/,ME=kT(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?\s*\)/).replace(`label`,jE).replace(`href`,/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]+|(?=\))/).replace(`title`,/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),NE=kT(/^!?\[(label)\]\[(ref)\]/).replace(`label`,jE).replace(`ref`,UT).getRegex(),PE=kT(/^!?\[(ref)\](?:\[\])?/).replace(`ref`,UT).getRegex(),FE=kT(`reflink|nolink(?!\\()`,`g`).replace(`reflink`,NE).replace(`nolink`,PE).getRegex(),IE=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,LE={_backpedal:DT,anyPunctuation:DE,autolink:OE,blockSkip:mE,br:iE,code:rE,del:DT,delLDelim:DT,delRDelim:DT,emStrongLDelim:gE,emStrongRDelimAst:bE,emStrongRDelimUnd:CE,escape:nE,link:ME,nolink:PE,punctuation:lE,reflink:NE,reflinkSearch:FE,tag:AE,text:aE,url:DT},RE={...LE,emStrongLDelim:vE,emStrongRDelimAst:SE,emStrongRDelimUnd:wE,link:kT(/^!?\[(label)\]\((.*?)\)/).replace(`label`,jE).getRegex(),reflink:kT(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace(`label`,jE).getRegex()},zE={...LE,emStrongRDelimAst:xE,emStrongLDelim:_E,delLDelim:TE,delRDelim:EE,url:kT(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace(`protocol`,IE).replace(`email`,/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,text:kT(/^(`+|~+|[^`~])(?:(?=[`~])|(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\":`>`,'"':`"`,"'":`'`},WE=e=>UE[e];function GE(e,t){if(t){if(jT.escapeTest.test(e))return e.replace(jT.escapeReplace,WE)}else if(jT.escapeTestNoEncode.test(e))return e.replace(jT.escapeReplaceNoEncode,WE);return e}function KE(e){try{e=encodeURI(e).replace(jT.percentDecode,`%`)}catch{return null}return e}function qE(e,t){let n=e.replace(jT.findPipe,(e,t,n)=>{let r=!1,i=t;for(;--i>=0&&n[i]===`\\`;)r=!r;return r?`|`:` |`}).split(jT.splitPipe),r=0;if(n[0].trim()||n.shift(),n.length>0&&!n.at(-1)?.trim()&&n.pop(),t){if(n.length>t)n.splice(t);else for(;n.length=0&&jT.blankLine.test(t[n]);)n--;return t.length-n<=2?e:t.slice(0,n+1).join(` -`)}function XE(e,t){if(e.indexOf(t[1])===-1)return-1;let n=0;for(let r=0;r0?-2:-1}function ZE(e,t=0){let n=t,r=``;for(let t of e)if(t===` `){let e=4-n%4;r+=` `.repeat(e),n+=e}else r+=t,n++;return r}function QE(e,t,n,r,i){let a=t.href,o=t.title||null,s=e[1].replace(i.other.outputLinkReplace,`$1`),c=e[0].charAt(0)===`!`;r.state.inLink=!0;let l=r.state.linkEmitted,u=r.state.inRawBlock;r.state.linkEmitted=!1;let d=r.inlineTokens(s),f=r.state.linkEmitted;if(r.state.linkEmitted=l,r.state.inLink=!1,!c){if(f){r.state.inRawBlock=u;return}r.state.linkEmitted=!0}return{type:c?`image`:`link`,raw:n,href:a,title:o,text:s,tokens:d}}function $E(e,t,n){let r=e.match(n.other.indentCodeCompensation);if(r===null)return t;let i=r[1];return t.split(` +`:``)+r:n}var ST=H(``),CT=H(`
Queued · the agent will see this at its next step
`),wT=H(`
`);function TT(e,t){O(t,!0);let n=j(()=>bT(t.item.text||``)),r=j(()=>vT(B(n).body,B(n).refs)),i=j(()=>{let e=new Map;for(let t of B(n).refs)e.set(t.label,[...e.get(t.label)||[],t]);return e});function a(e){e&&(e.kind===`directory`?Qo(e.path):Hs(e.path))}var o=wT();let s;var c=F(o);let l;K(c,21,()=>B(r),Qi,(e,t)=>{var n=Bi(),r=I(n),o=e=>{let n=j(()=>B(i).get(B(t).text)||[]);var r=ST(),o=L(r,!0);z(e=>{J(r,`title`,e),W(o,B(t).text)},[()=>B(n).map(e=>e.path).join(` +`)]),V(`click`,r,()=>a(B(n)[0])),U(e,r)},s=e=>{var n=zi();z(()=>W(n,B(t).text)),U(e,n)};G(r,e=>{B(t).mark?e(o):e(s,-1)}),U(e,n)}),D(c);var u=R(c,2),d=e=>{U(e,CT())};G(u,e=>{t.item.queued&&e(d)}),D(o),z(()=>{s=q(o,1,`msg user`,null,s,{queued:t.item.queued}),l=q(c,1,`bubble`,null,l,{voice:t.item.voice})}),U(e,o),k()}ki([`click`]);function ET(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var DT=ET();function OT(e){DT=e}var kT={exec:()=>null};function AT(e){let t=[];return n=>{let r=Math.max(0,Math.min(3,n-1)),i=t[r];return i||(i=e(r),t[r]=i),i}}function jT(e,t=``){let n=typeof e==`string`?e:e.source,r={replace:(e,t)=>{let i=typeof t==`string`?t:t.source;return i=i.replace(NT.caret,`$1`),n=n.replace(e,i),r},getRegex:()=>new RegExp(n,t)};return r}var MT=((e=``)=>{try{return!!RegExp(`(?<=1)(?/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] +\S/,listReplaceTask:/^\[[ xX]\] +/,listTaskCheckbox:/\[[ xX]\]/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^
/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:e=>RegExp(`^( {0,3}${e})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:AT(e=>RegExp(`^ {0,${e}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`)),hrRegex:AT(e=>RegExp(`^ {0,${e}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`)),fencesBeginRegex:AT(e=>RegExp(`^ {0,${e}}(?:\`\`\`|~~~)`)),headingBeginRegex:AT(e=>RegExp(`^ {0,${e}}#`)),htmlBeginRegex:AT(e=>RegExp(`^ {0,${e}}<(?:[a-z].*>|!--)`,`i`)),blockquoteBeginRegex:AT(e=>RegExp(`^ {0,${e}}>`))},PT=/^(?:[ \t]*(?:\n|$))+/,FT=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,IT=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,LT=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,RT=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,zT=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,BT=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,VT=jT(BT).replace(/bull/g,zT).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}(?:\s|$)/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,``).getRegex(),HT=jT(BT).replace(/bull/g,zT).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}(?:\s|$)/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),UT=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table|[ \t]+\n)[^\n]+)*)/,WT=/^[^\n]+/,GT=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,KT=jT(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace(`label`,GT).replace(`title`,/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),qT=jT(/^(bull)([ \t][^\n]*?)?(?:\n|$)/).replace(/bull/g,zT).getRegex(),JT=`address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul`,YT=/|$))/,XT=jT(`^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:[^\\n]*\\n*|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>[^\\n]*\\n*|$)|[^\\n]*\\n*|$)|[^\\n]*\\n*|$)|)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))`,`i`).replace(`comment`,YT).replace(`tag`,JT).replace(`attribute`,/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),ZT=e=>jT(UT).replace(`hr`,LT).replace(`heading`,` {0,3}#{1,6}(?:\\s|$)`).replace(`|lheading`,``).replace(`|table`,``).replace(`blockquote`,` {0,3}>`).replace(`fences`," {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace(`list`,e).replace(`html`,`)|<(?:script|pre|style|textarea|!--)`).replace(`tag`,JT).getRegex(),QT=ZT(/ {0,3}(?:[*+-]|1[.)])[ \t]+[^ \t\n]/),$T=ZT(/ {0,3}(?:[*+-]|\d{1,9}[.)])(?:[ \t]|\n|$)/),eE={blockquote:jT(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace(`paragraph`,$T).getRegex(),code:FT,def:KT,fences:IT,heading:RT,hr:LT,html:XT,lheading:VT,list:qT,newline:PT,paragraph:QT,table:kT,text:WT},tE=jT(`^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)`).replace(`hr`,LT).replace(`heading`,` {0,3}#{1,6}(?:\\s|$)`).replace(`blockquote`,` {0,3}>`).replace(`code`,`(?: {4}| {0,3} )[^\\n]`).replace(`fences`," {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace(`list`,` {0,3}(?:[*+-]|1[.)])[ \\t]`).replace(`html`,`)|<(?:script|pre|style|textarea|!--)`).replace(`tag`,JT).getRegex(),nE={...eE,lheading:HT,table:tE,paragraph:jT(UT).replace(`hr`,LT).replace(`heading`,` {0,3}#{1,6}(?:\\s|$)`).replace(`|lheading`,``).replace(`table`,tE).replace(`blockquote`,` {0,3}>`).replace(`fences`," {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace(`list`,` {0,3}(?:[*+-]|1[.)])[ \\t]+[^ \\t\\n]`).replace(`html`,`)|<(?:script|pre|style|textarea|!--)`).replace(`tag`,JT).getRegex()},rE={...eE,html:jT(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+? *(?:\\n{2,}|\\s*$)|\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace(`comment`,YT).replace(/tag/g,`(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b`).getRegex(),def:/^ *\[([^\]]+)\]: *]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:kT,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:jT(UT).replace(`hr`,LT).replace(`heading`,` *#{1,6} *[^ +]`).replace(`lheading`,VT).replace(`|table`,``).replace(`blockquote`,` {0,3}>`).replace(`|fences`,``).replace(`|list`,``).replace(`|html`,``).replace(`|tag`,``).getRegex()},iE=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,aE=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,oE=/^( {2,}|\\)\n(?!\s*$)/,sE=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\`+)[^`]+\k(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace(`precode-`,MT?"(?`+)[^`]+\k(?!`)/).replace(`html`,/<(?! )[^<>]*?>/).getRegex(),_E=/^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/,vE=jT(_E,`u`).replace(/punct/g,cE).getRegex(),yE=jT(_E,`u`).replace(/punct/g,pE).getRegex(),bE=jT(/^(?:\*+(?:((?!\*)(?!openQuote)punct)|([^\s*]))?)|^_+(?:((?!_)(?!openQuote)punct)|([^\s_]))?/,`u`).replace(/openQuote/g,fE).replace(/punct/g,cE).getRegex(),xE=`^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)`,SE=jT(xE,`gu`).replace(/notPunctSpace/g,uE).replace(/punctSpace/g,lE).replace(/punct/g,cE).getRegex(),CE=jT(xE,`gu`).replace(/notPunctSpace/g,hE).replace(/punctSpace/g,mE).replace(/punct/g,pE).getRegex(),wE=jT(`^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)[\\s](\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|(?:(?!\\*)punct|notPunctSpace)(\\*+)(?!\\*)(?=notPunctSpace)`,`gu`).replace(/notPunctSpace/g,uE).replace(/punctSpace/g,lE).replace(/punct/g,cE).getRegex(),TE=jT(`^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)`,`gu`).replace(/notPunctSpace/g,uE).replace(/punctSpace/g,lE).replace(/punct/g,cE).getRegex(),EE=jT(`^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)[\\s](_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)|(?:(?!_)punct|notPunctSpace)(_+)(?!_)(?=notPunctSpace)`,`gu`).replace(/notPunctSpace/g,uE).replace(/punctSpace/g,lE).replace(/punct/g,cE).getRegex(),DE=jT(/^~~?(?:((?!~)punct)|[^\s~])/,`u`).replace(/punct/g,cE).getRegex(),OE=jT(`^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)`,`gu`).replace(/notPunctSpace/g,uE).replace(/punctSpace/g,lE).replace(/punct/g,cE).getRegex(),kE=jT(/\\(punct)/,`gu`).replace(/punct/g,cE).getRegex(),AE=jT(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace(`scheme`,/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace(`email`,/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),jE=jT(YT).replace(`(?:-->|$)`,`-->`).getRegex(),ME=jT(`^comment|^|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^|^`).replace(`comment`,jE).replace(`attribute`,/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),NE=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/,PE=jT(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?\s*\)/).replace(`label`,NE).replace(`href`,/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]+|(?=\))/).replace(`title`,/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),FE=jT(/^!?\[(label)\]\[(ref)\]/).replace(`label`,NE).replace(`ref`,GT).getRegex(),IE=jT(/^!?\[(ref)\](?:\[\])?/).replace(`ref`,GT).getRegex(),LE=jT(`reflink|nolink(?!\\()`,`g`).replace(`reflink`,FE).replace(`nolink`,IE).getRegex(),RE=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,zE={_backpedal:kT,anyPunctuation:kE,autolink:AE,blockSkip:gE,br:oE,code:aE,del:kT,delLDelim:kT,delRDelim:kT,emStrongLDelim:vE,emStrongRDelimAst:SE,emStrongRDelimUnd:TE,escape:iE,link:PE,nolink:IE,punctuation:dE,reflink:FE,reflinkSearch:LE,tag:ME,text:sE,url:kT},BE={...zE,emStrongLDelim:bE,emStrongRDelimAst:wE,emStrongRDelimUnd:EE,link:jT(/^!?\[(label)\]\((.*?)\)/).replace(`label`,NE).getRegex(),reflink:jT(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace(`label`,NE).getRegex()},VE={...zE,emStrongRDelimAst:CE,emStrongLDelim:yE,delLDelim:DE,delRDelim:OE,url:jT(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace(`protocol`,RE).replace(`email`,/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,text:jT(/^(`+|~+|[^`~])(?:(?=[`~])|(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\":`>`,'"':`"`,"'":`'`},KE=e=>GE[e];function qE(e,t){if(t){if(NT.escapeTest.test(e))return e.replace(NT.escapeReplace,KE)}else if(NT.escapeTestNoEncode.test(e))return e.replace(NT.escapeReplaceNoEncode,KE);return e}function JE(e){try{e=encodeURI(e).replace(NT.percentDecode,`%`)}catch{return null}return e}function YE(e,t){let n=e.replace(NT.findPipe,(e,t,n)=>{let r=!1,i=t;for(;--i>=0&&n[i]===`\\`;)r=!r;return r?`|`:` |`}).split(NT.splitPipe),r=0;if(n[0].trim()||n.shift(),n.length>0&&!n.at(-1)?.trim()&&n.pop(),t){if(n.length>t)n.splice(t);else for(;n.length=0&&NT.blankLine.test(t[n]);)n--;return t.length-n<=2?e:t.slice(0,n+1).join(` +`)}function QE(e,t){if(e.indexOf(t[1])===-1)return-1;let n=0;for(let r=0;r0?-2:-1}function $E(e,t=0){let n=t,r=``;for(let t of e)if(t===` `){let e=4-n%4;r+=` `.repeat(e),n+=e}else r+=t,n++;return r}function eD(e,t,n,r,i){let a=t.href,o=t.title||null,s=e[1].replace(i.other.outputLinkReplace,`$1`),c=e[0].charAt(0)===`!`;r.state.inLink=!0;let l=r.state.linkEmitted,u=r.state.inRawBlock;r.state.linkEmitted=!1;let d=r.inlineTokens(s),f=r.state.linkEmitted;if(r.state.linkEmitted=l,r.state.inLink=!1,!c){if(f){r.state.inRawBlock=u;return}r.state.linkEmitted=!0}return{type:c?`image`:`link`,raw:n,href:a,title:o,text:s,tokens:d}}function tD(e,t,n){let r=e.match(n.other.indentCodeCompensation);if(r===null)return t;let i=r[1];return t.split(` `).map(e=>{let t=e.match(n.other.beginningSpace);if(t===null)return e;let[r]=t;return r.length>=i.length?e.slice(i.length):e}).join(` -`)}var eD=class{options;rules;lexer;constructor(e){this.options=e||TT}space(e){let t=this.rules.block.newline.exec(e);if(t&&t[0].length>0)return{type:`space`,raw:t[0]}}code(e){let t=this.rules.block.code.exec(e);if(t){let e=this.options.pedantic?t[0]:YE(t[0]);return{type:`code`,raw:e,codeBlockStyle:`indented`,text:e.replace(this.rules.other.codeRemoveIndent,``)}}}fences(e){let t=this.rules.block.fences.exec(e);if(t){let e=t[0],n=$E(e,t[3]||``,this.rules);return{type:`code`,raw:e,lang:t[2]?t[2].trim().replace(this.rules.inline.anyPunctuation,`$1`):t[2],text:n}}}heading(e){let t=this.rules.block.heading.exec(e);if(t){let e=t[2].trim();if(this.rules.other.endingHash.test(e)){let t=JE(e,`#`);(this.options.pedantic||!t||this.rules.other.endingSpaceChar.test(t))&&(e=t.trim())}return{type:`heading`,raw:JE(t[0],` -`),depth:t[1].length,text:e,tokens:this.lexer.inline(e)}}}hr(e){let t=this.rules.block.hr.exec(e);if(t)return{type:`hr`,raw:JE(t[0],` -`)}}blockquote(e){let t=this.rules.block.blockquote.exec(e);if(t){let e=JE(t[0],` +`)}var nD=class{options;rules;lexer;constructor(e){this.options=e||DT}space(e){let t=this.rules.block.newline.exec(e);if(t&&t[0].length>0)return{type:`space`,raw:t[0]}}code(e){let t=this.rules.block.code.exec(e);if(t){let e=this.options.pedantic?t[0]:ZE(t[0]);return{type:`code`,raw:e,codeBlockStyle:`indented`,text:e.replace(this.rules.other.codeRemoveIndent,``)}}}fences(e){let t=this.rules.block.fences.exec(e);if(t){let e=t[0],n=tD(e,t[3]||``,this.rules);return{type:`code`,raw:e,lang:t[2]?t[2].trim().replace(this.rules.inline.anyPunctuation,`$1`):t[2],text:n}}}heading(e){let t=this.rules.block.heading.exec(e);if(t){let e=t[2].trim();if(this.rules.other.endingHash.test(e)){let t=XE(e,`#`);(this.options.pedantic||!t||this.rules.other.endingSpaceChar.test(t))&&(e=t.trim())}return{type:`heading`,raw:XE(t[0],` +`),depth:t[1].length,text:e,tokens:this.lexer.inline(e)}}}hr(e){let t=this.rules.block.hr.exec(e);if(t)return{type:`hr`,raw:XE(t[0],` +`)}}blockquote(e){let t=this.rules.block.blockquote.exec(e);if(t){let e=XE(t[0],` `).split(` `),n=``,r=``,i=[];for(;e.length>0;){let t=!1,a=[],o;for(o=0;o1,i={type:`list`,raw:``,ordered:r,start:r?+n.slice(0,-1):``,loose:!1,items:[]};n=r?`\\d{1,9}\\${n.slice(-1)}`:`\\${n}`,this.options.pedantic&&(n=r?n:`[*+-]`);let a=this.rules.other.listItemRegex(n),o=!1;for(;e;){let n=!1,r=``,s=``;if(!(t=a.exec(e))||this.rules.block.hr.test(e))break;r=t[0],e=e.substring(r.length);let c=ZE(t[2].split(` +`);continue}}return{type:`blockquote`,raw:n,tokens:i,text:r}}}list(e){let t=this.rules.block.list.exec(e);if(t){let n=t[1].trim(),r=n.length>1,i={type:`list`,raw:``,ordered:r,start:r?+n.slice(0,-1):``,loose:!1,items:[]};n=r?`\\d{1,9}\\${n.slice(-1)}`:`\\${n}`,this.options.pedantic&&(n=r?n:`[*+-]`);let a=this.rules.other.listItemRegex(n),o=!1;for(;e;){let n=!1,r=``,s=``;if(!(t=a.exec(e))||this.rules.block.hr.test(e))break;r=t[0],e=e.substring(r.length);let c=$E(t[2].split(` `,1)[0],t[1].length),l=e.split(` `,1)[0],u=!c.trim(),d=0;if(this.options.pedantic?(d=2,s=c.trimStart()):u?d=t[1].length+1:(d=c.search(this.rules.other.nonSpaceChar),d=d>4?1:d,s=c.slice(d),d+=t[1].length),u&&this.rules.other.blankLine.test(l)&&(r+=l+` `,e=e.substring(l.length+1),n=!0),!n){let t=this.rules.other.nextBulletRegex(d),n=this.rules.other.hrRegex(d),i=this.rules.other.fencesBeginRegex(d),a=this.rules.other.headingBeginRegex(d),o=this.rules.other.htmlBeginRegex(d),f=this.rules.other.blockquoteBeginRegex(d);for(;e;){let p=e.split(` `,1)[0],m;if(l=p,this.options.pedantic?(l=l.replace(this.rules.other.listReplaceNesting,` `),m=l):m=l.replace(this.rules.other.tabCharGlobal,` `),i.test(l)||a.test(l)||o.test(l)||f.test(l)||t.test(l)||n.test(l))break;if(m.search(this.rules.other.nonSpaceChar)>=d||!l.trim())s+=` `+m.slice(d);else{if(u||c.replace(this.rules.other.tabCharGlobal,` `).search(this.rules.other.nonSpaceChar)>=4||i.test(c)||a.test(c)||n.test(c))break;s+=` `+l}u=!l.trim(),r+=p+` -`,e=e.substring(p.length+1),c=m.slice(d)}}i.loose||(o?i.loose=!0:this.rules.other.doubleBlankLine.test(r)&&(o=!0)),i.items.push({type:`list_item`,raw:r,task:!!this.options.gfm&&this.rules.other.listIsTask.test(s),loose:!1,text:s,tokens:[]}),i.raw+=r}let s=i.items.at(-1);if(s)s.raw=s.raw.trimEnd(),s.text=s.text.trimEnd();else return;i.raw=i.raw.trimEnd();for(let e of i.items)if(this.lexer.state.top=!1,e.tokens=this.lexer.blockTokens(e.text,[]),!i.loose){let t=e.tokens.filter(e=>e.type===`space`);i.loose=t.length>0&&t.some(e=>this.rules.other.anyLine.test(e.raw))}for(let e of i.items){let t=e.tokens[0];if(e.task&&(t?.type===`text`||t?.type===`paragraph`)){e.text=e.text.replace(this.rules.other.listReplaceTask,``),t.raw=t.raw.replace(this.rules.other.listReplaceTask,``),t.text=t.text.replace(this.rules.other.listReplaceTask,``);for(let e=this.lexer.inlineQueue.length-1;e>=0;e--)if(this.rules.other.listIsTask.test(this.lexer.inlineQueue[e].src)){this.lexer.inlineQueue[e].src=this.lexer.inlineQueue[e].src.replace(this.rules.other.listReplaceTask,``);break}let n=this.rules.other.listTaskCheckbox.exec(e.raw);if(n){let t={type:`checkbox`,raw:n[0]+` `,checked:n[0]!==`[ ]`};e.checked=t.checked,i.loose?e.tokens[0]&&[`paragraph`,`text`].includes(e.tokens[0].type)&&`tokens`in e.tokens[0]&&e.tokens[0].tokens?(e.tokens[0].raw=t.raw+e.tokens[0].raw,e.tokens[0].text=t.raw+e.tokens[0].text,e.tokens[0].tokens.unshift(t)):e.tokens.unshift({type:`paragraph`,raw:t.raw,text:t.raw,tokens:[t]}):e.tokens.unshift(t)}}else e.task&&=!1}if(i.loose)for(let e of i.items){e.loose=!0;for(let t of e.tokens)t.type===`text`&&(t.type=`paragraph`)}return i}}html(e){let t=this.rules.block.html.exec(e);if(t){let e=YE(t[0]);return{type:`html`,block:!0,raw:e,pre:t[1]===`pre`||t[1]===`script`||t[1]===`style`,text:e}}}def(e){let t=this.rules.block.def.exec(e);if(t){let e=t[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal,` `),n=t[2]?t[2].replace(this.rules.other.hrefBrackets,`$1`).replace(this.rules.inline.anyPunctuation,`$1`):``,r=t[3]?t[3].substring(1,t[3].length-1).replace(this.rules.inline.anyPunctuation,`$1`):t[3];return{type:`def`,tag:e,raw:JE(t[0],` -`),href:n,title:r}}}table(e){let t=this.rules.block.table.exec(e);if(!t||!this.rules.other.tableDelimiter.test(t[2]))return;let n=qE(t[1]),r=t[2].replace(this.rules.other.tableAlignChars,``).split(`|`),i=t[3]?.trim()?t[3].replace(this.rules.other.tableRowBlankLine,``).split(` -`):[],a={type:`table`,raw:JE(t[0],` -`),header:[],align:[],rows:[]};if(n.length===r.length){for(let e of r)this.rules.other.tableAlignRight.test(e)?a.align.push(`right`):this.rules.other.tableAlignCenter.test(e)?a.align.push(`center`):this.rules.other.tableAlignLeft.test(e)?a.align.push(`left`):a.align.push(null);for(let e=0;e({text:e,tokens:this.lexer.inline(e),header:!1,align:a.align[t]})));return a}}lheading(e){let t=this.rules.block.lheading.exec(e);if(t){let e=t[1].trim();return{type:`heading`,raw:JE(t[0],` +`,e=e.substring(p.length+1),c=m.slice(d)}}i.loose||(o?i.loose=!0:this.rules.other.doubleBlankLine.test(r)&&(o=!0)),i.items.push({type:`list_item`,raw:r,task:!!this.options.gfm&&this.rules.other.listIsTask.test(s),loose:!1,text:s,tokens:[]}),i.raw+=r}let s=i.items.at(-1);if(s)s.raw=s.raw.trimEnd(),s.text=s.text.trimEnd();else return;i.raw=i.raw.trimEnd();for(let e of i.items)if(this.lexer.state.top=!1,e.tokens=this.lexer.blockTokens(e.text,[]),!i.loose){let t=e.tokens.filter(e=>e.type===`space`);i.loose=t.length>0&&t.some(e=>this.rules.other.anyLine.test(e.raw))}for(let e of i.items){let t=e.tokens[0];if(e.task&&(t?.type===`text`||t?.type===`paragraph`)){e.text=e.text.replace(this.rules.other.listReplaceTask,``),t.raw=t.raw.replace(this.rules.other.listReplaceTask,``),t.text=t.text.replace(this.rules.other.listReplaceTask,``);for(let e=this.lexer.inlineQueue.length-1;e>=0;e--)if(this.rules.other.listIsTask.test(this.lexer.inlineQueue[e].src)){this.lexer.inlineQueue[e].src=this.lexer.inlineQueue[e].src.replace(this.rules.other.listReplaceTask,``);break}let n=this.rules.other.listTaskCheckbox.exec(e.raw);if(n){let t={type:`checkbox`,raw:n[0]+` `,checked:n[0]!==`[ ]`};e.checked=t.checked,i.loose?e.tokens[0]&&[`paragraph`,`text`].includes(e.tokens[0].type)&&`tokens`in e.tokens[0]&&e.tokens[0].tokens?(e.tokens[0].raw=t.raw+e.tokens[0].raw,e.tokens[0].text=t.raw+e.tokens[0].text,e.tokens[0].tokens.unshift(t)):e.tokens.unshift({type:`paragraph`,raw:t.raw,text:t.raw,tokens:[t]}):e.tokens.unshift(t)}}else e.task&&=!1}if(i.loose)for(let e of i.items){e.loose=!0;for(let t of e.tokens)t.type===`text`&&(t.type=`paragraph`)}return i}}html(e){let t=this.rules.block.html.exec(e);if(t){let e=ZE(t[0]);return{type:`html`,block:!0,raw:e,pre:t[1]===`pre`||t[1]===`script`||t[1]===`style`,text:e}}}def(e){let t=this.rules.block.def.exec(e);if(t){let e=t[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal,` `),n=t[2]?t[2].replace(this.rules.other.hrefBrackets,`$1`).replace(this.rules.inline.anyPunctuation,`$1`):``,r=t[3]?t[3].substring(1,t[3].length-1).replace(this.rules.inline.anyPunctuation,`$1`):t[3];return{type:`def`,tag:e,raw:XE(t[0],` +`),href:n,title:r}}}table(e){let t=this.rules.block.table.exec(e);if(!t||!this.rules.other.tableDelimiter.test(t[2]))return;let n=YE(t[1]),r=t[2].replace(this.rules.other.tableAlignChars,``).split(`|`),i=t[3]?.trim()?t[3].replace(this.rules.other.tableRowBlankLine,``).split(` +`):[],a={type:`table`,raw:XE(t[0],` +`),header:[],align:[],rows:[]};if(n.length===r.length){for(let e of r)this.rules.other.tableAlignRight.test(e)?a.align.push(`right`):this.rules.other.tableAlignCenter.test(e)?a.align.push(`center`):this.rules.other.tableAlignLeft.test(e)?a.align.push(`left`):a.align.push(null);for(let e=0;e({text:e,tokens:this.lexer.inline(e),header:!1,align:a.align[t]})));return a}}lheading(e){let t=this.rules.block.lheading.exec(e);if(t){let e=t[1].trim();return{type:`heading`,raw:XE(t[0],` `),depth:t[2].charAt(0)===`=`?1:2,text:e,tokens:this.lexer.inline(e)}}}paragraph(e){let t=this.rules.block.paragraph.exec(e);if(t){let e=t[1].charAt(t[1].length-1)===` -`?t[1].slice(0,-1):t[1];return{type:`paragraph`,raw:t[0],text:e,tokens:this.lexer.inline(e)}}}text(e){let t=this.rules.block.text.exec(e);if(t)return{type:`text`,raw:t[0],text:t[0],tokens:this.lexer.inline(t[0])}}escape(e){let t=this.rules.inline.escape.exec(e);if(t)return{type:`escape`,raw:t[0],text:t[1]}}tag(e){let t=this.rules.inline.tag.exec(e);if(t)return!this.lexer.state.inLink&&this.rules.other.startATag.test(t[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(t[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(t[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(t[0])&&(this.lexer.state.inRawBlock=!1),{type:`html`,raw:t[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:t[0]}}link(e){let t=this.rules.inline.link.exec(e);if(t){let e=t[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(e)){if(!this.rules.other.endAngleBracket.test(e))return;let t=JE(e.slice(0,-1),`\\`);if((e.length-t.length)%2==0)return}else{let e=XE(t[2],`()`);if(e===-2)return;if(e>-1){let n=(t[0].indexOf(`!`)===0?5:4)+t[1].length+e;t[2]=t[2].substring(0,e),t[0]=t[0].substring(0,n).trim(),t[3]=``}}let n=t[2],r=``;if(this.options.pedantic){let e=this.rules.other.pedanticHrefTitle.exec(n);e&&(n=e[1],r=e[3])}else r=t[3]?t[3].slice(1,-1):``;return n=n.trim(),this.rules.other.startAngleBracket.test(n)&&(n=this.options.pedantic&&!this.rules.other.endAngleBracket.test(e)?n.slice(1):n.slice(1,-1)),QE(t,{href:n&&n.replace(this.rules.inline.anyPunctuation,`$1`),title:r&&r.replace(this.rules.inline.anyPunctuation,`$1`)},t[0],this.lexer,this.rules)}}reflink(e,t){let n;if((n=this.rules.inline.reflink.exec(e))||(n=this.rules.inline.nolink.exec(e))){let e=t[(n[2]||n[1]).replace(this.rules.other.multipleSpaceGlobal,` `).toLowerCase()];if(!e){let e=n[0].charAt(0);return{type:`text`,raw:e,text:e}}return QE(n,e,n[0],this.lexer,this.rules)}}emStrong(e,t,n=``){let r=this.rules.inline.emStrongLDelim.exec(e);if(!(!r||!r[1]&&!r[2]&&!r[3]&&!r[4]||r[4]&&n.match(this.rules.other.unicodeAlphaNumeric))&&(!(r[1]||r[3])||!n||this.rules.inline.punctuation.exec(n))){let i=[...r[0]].length-1,a,o,s=i,c=0,l=r[0][0],u=n===l,d=l===`*`?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(d.lastIndex=0,t=t.slice(-1*e.length+i);(r=d.exec(t))!==null;){if(a=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!a)continue;if(o=[...a].length,r[3]||r[4]){s+=o;continue}if(r[5]||r[6]){if(i%3&&!((i+o)%3)){c+=o;continue}if(u)break}if(s-=o,s>0)continue;o=Math.min(o,o+s+c);let t=[...r[0]][0].length,n=e.slice(0,i+r.index+t+o);if(Math.min(i,o)%2){let e=n.slice(1,-1);return{type:`em`,raw:n,text:e,tokens:this.lexer.inlineTokens(e)}}let l=n.slice(2,-2);return{type:`strong`,raw:n,text:l,tokens:this.lexer.inlineTokens(l)}}}}codespan(e){let t=this.rules.inline.code.exec(e);if(t){let e=t[2].replace(this.rules.other.newLineCharGlobal,` `),n=this.rules.other.nonSpaceChar.test(e),r=this.rules.other.startingSpaceChar.test(e)&&this.rules.other.endingSpaceChar.test(e);return n&&r&&(e=e.substring(1,e.length-1)),{type:`codespan`,raw:t[0],text:e}}}br(e){let t=this.rules.inline.br.exec(e);if(t)return{type:`br`,raw:t[0]}}del(e,t,n=``){let r=this.rules.inline.delLDelim.exec(e);if(r&&(!r[1]||!n||this.rules.inline.punctuation.exec(n))){let n=[...r[0]].length-1,i,a,o=n,s=this.rules.inline.delRDelim;for(s.lastIndex=0,t=t.slice(-1*e.length+n);(r=s.exec(t))!==null;){if(i=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!i||(a=[...i].length,a!==n))continue;if(r[3]||r[4]){o+=a;continue}if(o-=a,o>0)continue;a=Math.min(a,a+o);let t=[...r[0]][0].length,s=e.slice(0,n+r.index+t+a),c=s.slice(n,-n);return{type:`del`,raw:s,text:c,tokens:this.lexer.inlineTokens(c)}}}}autolink(e){let t=this.rules.inline.autolink.exec(e);if(t){let e,n;return t[2]===`@`?(e=t[1],n=`mailto:`+e):(e=t[1],n=e),{type:`link`,raw:t[0],text:e,href:n,tokens:[{type:`text`,raw:e,text:e}]}}}url(e){let t;if(t=this.rules.inline.url.exec(e)){let e,n;if(t[2]===`@`)e=t[0],n=`mailto:`+e;else{let r;do r=t[0],t[0]=this.rules.inline._backpedal.exec(t[0])?.[0]??``;while(r!==t[0]);e=t[0],n=t[1]===`www.`?`http://`+t[0]:t[0]}return{type:`link`,raw:t[0],text:e,href:n,tokens:[{type:`text`,raw:e,text:e}]}}}inlineText(e){let t=this.rules.inline.text.exec(e);if(t){let e=this.lexer.state.inRawBlock;return{type:`text`,raw:t[0],text:t[0],escaped:e}}}},tD=class e{tokens;options;state;inlineQueue;tokenizer;constructor(e){this.tokens=[],this.tokens.links=Object.create(null),this.options=e||TT,this.options.tokenizer=this.options.tokenizer||new eD,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,linkEmitted:!1,top:!0};let t={other:jT,block:VE.normal,inline:HE.normal};this.options.pedantic?(t.block=VE.pedantic,t.inline=HE.pedantic):this.options.gfm&&(t.block=VE.gfm,t.inline=this.options.breaks?HE.breaks:HE.gfm),this.tokenizer.rules=t}static get rules(){return{block:VE,inline:HE}}static lex(t,n){return new e(n).lex(t)}static lexInline(t,n){return new e(n).inlineTokens(t)}lex(e){e=e.replace(jT.carriageReturn,` -`),this.blockTokens(e,this.tokens);for(let e=0;e(i=n.call({lexer:this},e,t))?(e=e.substring(i.raw.length),t.push(i),!0):!1))continue;if(i=this.tokenizer.space(e)){e=e.substring(i.raw.length);let n=t.at(-1);i.raw.length===1&&n!==void 0?n.raw+=` +`?t[1].slice(0,-1):t[1];return{type:`paragraph`,raw:t[0],text:e,tokens:this.lexer.inline(e)}}}text(e){let t=this.rules.block.text.exec(e);if(t)return{type:`text`,raw:t[0],text:t[0],tokens:this.lexer.inline(t[0])}}escape(e){let t=this.rules.inline.escape.exec(e);if(t)return{type:`escape`,raw:t[0],text:t[1]}}tag(e){let t=this.rules.inline.tag.exec(e);if(t)return!this.lexer.state.inLink&&this.rules.other.startATag.test(t[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(t[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(t[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(t[0])&&(this.lexer.state.inRawBlock=!1),{type:`html`,raw:t[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:t[0]}}link(e){let t=this.rules.inline.link.exec(e);if(t){let e=t[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(e)){if(!this.rules.other.endAngleBracket.test(e))return;let t=XE(e.slice(0,-1),`\\`);if((e.length-t.length)%2==0)return}else{let e=QE(t[2],`()`);if(e===-2)return;if(e>-1){let n=(t[0].indexOf(`!`)===0?5:4)+t[1].length+e;t[2]=t[2].substring(0,e),t[0]=t[0].substring(0,n).trim(),t[3]=``}}let n=t[2],r=``;if(this.options.pedantic){let e=this.rules.other.pedanticHrefTitle.exec(n);e&&(n=e[1],r=e[3])}else r=t[3]?t[3].slice(1,-1):``;return n=n.trim(),this.rules.other.startAngleBracket.test(n)&&(n=this.options.pedantic&&!this.rules.other.endAngleBracket.test(e)?n.slice(1):n.slice(1,-1)),eD(t,{href:n&&n.replace(this.rules.inline.anyPunctuation,`$1`),title:r&&r.replace(this.rules.inline.anyPunctuation,`$1`)},t[0],this.lexer,this.rules)}}reflink(e,t){let n;if((n=this.rules.inline.reflink.exec(e))||(n=this.rules.inline.nolink.exec(e))){let e=t[(n[2]||n[1]).replace(this.rules.other.multipleSpaceGlobal,` `).toLowerCase()];if(!e){let e=n[0].charAt(0);return{type:`text`,raw:e,text:e}}return eD(n,e,n[0],this.lexer,this.rules)}}emStrong(e,t,n=``){let r=this.rules.inline.emStrongLDelim.exec(e);if(!(!r||!r[1]&&!r[2]&&!r[3]&&!r[4]||r[4]&&n.match(this.rules.other.unicodeAlphaNumeric))&&(!(r[1]||r[3])||!n||this.rules.inline.punctuation.exec(n))){let i=[...r[0]].length-1,a,o,s=i,c=0,l=r[0][0],u=n===l,d=l===`*`?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(d.lastIndex=0,t=t.slice(-1*e.length+i);(r=d.exec(t))!==null;){if(a=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!a)continue;if(o=[...a].length,r[3]||r[4]){s+=o;continue}if(r[5]||r[6]){if(i%3&&!((i+o)%3)){c+=o;continue}if(u)break}if(s-=o,s>0)continue;o=Math.min(o,o+s+c);let t=[...r[0]][0].length,n=e.slice(0,i+r.index+t+o);if(Math.min(i,o)%2){let e=n.slice(1,-1);return{type:`em`,raw:n,text:e,tokens:this.lexer.inlineTokens(e)}}let l=n.slice(2,-2);return{type:`strong`,raw:n,text:l,tokens:this.lexer.inlineTokens(l)}}}}codespan(e){let t=this.rules.inline.code.exec(e);if(t){let e=t[2].replace(this.rules.other.newLineCharGlobal,` `),n=this.rules.other.nonSpaceChar.test(e),r=this.rules.other.startingSpaceChar.test(e)&&this.rules.other.endingSpaceChar.test(e);return n&&r&&(e=e.substring(1,e.length-1)),{type:`codespan`,raw:t[0],text:e}}}br(e){let t=this.rules.inline.br.exec(e);if(t)return{type:`br`,raw:t[0]}}del(e,t,n=``){let r=this.rules.inline.delLDelim.exec(e);if(r&&(!r[1]||!n||this.rules.inline.punctuation.exec(n))){let n=[...r[0]].length-1,i,a,o=n,s=this.rules.inline.delRDelim;for(s.lastIndex=0,t=t.slice(-1*e.length+n);(r=s.exec(t))!==null;){if(i=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!i||(a=[...i].length,a!==n))continue;if(r[3]||r[4]){o+=a;continue}if(o-=a,o>0)continue;a=Math.min(a,a+o);let t=[...r[0]][0].length,s=e.slice(0,n+r.index+t+a),c=s.slice(n,-n);return{type:`del`,raw:s,text:c,tokens:this.lexer.inlineTokens(c)}}}}autolink(e){let t=this.rules.inline.autolink.exec(e);if(t){let e,n;return t[2]===`@`?(e=t[1],n=`mailto:`+e):(e=t[1],n=e),{type:`link`,raw:t[0],text:e,href:n,tokens:[{type:`text`,raw:e,text:e}]}}}url(e){let t;if(t=this.rules.inline.url.exec(e)){let e,n;if(t[2]===`@`)e=t[0],n=`mailto:`+e;else{let r;do r=t[0],t[0]=this.rules.inline._backpedal.exec(t[0])?.[0]??``;while(r!==t[0]);e=t[0],n=t[1]===`www.`?`http://`+t[0]:t[0]}return{type:`link`,raw:t[0],text:e,href:n,tokens:[{type:`text`,raw:e,text:e}]}}}inlineText(e){let t=this.rules.inline.text.exec(e);if(t){let e=this.lexer.state.inRawBlock;return{type:`text`,raw:t[0],text:t[0],escaped:e}}}},rD=class e{tokens;options;state;inlineQueue;tokenizer;constructor(e){this.tokens=[],this.tokens.links=Object.create(null),this.options=e||DT,this.options.tokenizer=this.options.tokenizer||new nD,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,linkEmitted:!1,top:!0};let t={other:NT,block:UE.normal,inline:WE.normal};this.options.pedantic?(t.block=UE.pedantic,t.inline=WE.pedantic):this.options.gfm&&(t.block=UE.gfm,t.inline=this.options.breaks?WE.breaks:WE.gfm),this.tokenizer.rules=t}static get rules(){return{block:UE,inline:WE}}static lex(t,n){return new e(n).lex(t)}static lexInline(t,n){return new e(n).inlineTokens(t)}lex(e){e=e.replace(NT.carriageReturn,` +`),this.blockTokens(e,this.tokens);for(let e=0;e(i=n.call({lexer:this},e,t))?(e=e.substring(i.raw.length),t.push(i),!0):!1))continue;if(i=this.tokenizer.space(e)){e=e.substring(i.raw.length);let n=t.at(-1);i.raw.length===1&&n!==void 0?n.raw+=` `:t.push(i);continue}if(i=this.tokenizer.code(e)){e=e.substring(i.raw.length);let n=t.at(-1);n?.type===`paragraph`||n?.type===`text`?(n.raw+=(n.raw.endsWith(` `)?``:` `)+i.raw,n.text+=` @@ -118,9 +118,9 @@ ${a}`,r=r.substring(0,r.length-t.text.length)+s.text;break}if(u?.type===`list`){ `+i.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=r.text):t.push(i),n=a.length!==e.length,e=e.substring(i.raw.length);continue}if(i=this.tokenizer.text(e)){e=e.substring(i.raw.length);let n=t.at(-1);n?.type===`text`?(n.raw+=(n.raw.endsWith(` `)?``:` `)+i.raw,n.text+=` -`+i.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=n.text):t.push(i);continue}if(e){this.infiniteLoopError(e.charCodeAt(0));break}}return this.state.top=!0,t}inline(e,t=[]){return this.inlineQueue.push({src:e,tokens:t}),t}linkInText(e){if(!e.includes(`[`))return!1;let t=this.tokenizer.rules.inline.link;for(let n of e.matchAll(this.tokenizer.rules.inline.blockSkip))if(t.test(n[0])&&e.charAt(n.index-1)!==`!`)return!0;for(let t of e.matchAll(this.tokenizer.rules.inline.reflinkSearch)){let e=t[0],n=e.lastIndexOf(`[`);if(!(e.charAt(0)===`!`||!Object.hasOwn(this.tokens.links,e.slice(n+1,-1)))&&!(n>1&&this.linkInText(e.slice(1,n-1))))return!0}return!1}inlineTokens(e,t=[]){this.tokenizer.lexer=this;let n=e;if(this.tokens.links&&e.includes(`[`)){let e=this.tokenizer.rules.inline.reflinkSearch,t=n=>{let r=n.lastIndexOf(`[`);if(!Object.hasOwn(this.tokens.links,n.slice(r+1,-1)))return n;if(r>1&&n.charAt(0)!==`!`){let i=n.slice(1,r-1);if(this.linkInText(i))return`[`+i.replace(e,t)+`][`+`a`.repeat(n.length-r-2)+`]`}return`[`+`a`.repeat(n.length-2)+`]`};n=n.replace(e,t)}n=n.replace(this.tokenizer.rules.inline.anyPunctuation,e=>`+`.repeat(e.length)),n=n.replace(this.tokenizer.rules.inline.blockSkip,(e,t,n)=>{let r=n?n.length:0;return e.slice(0,r)+`[`+`a`.repeat(e.length-r-2)+`]`}),n=this.options.hooks?.emStrongMask?.call({lexer:this},n)??n;let r=!1,i=``,a=1/0;for(;e;){if(e.length(o=n.call({lexer:this},e,t))?(e=e.substring(o.raw.length),t.push(o),!0):!1))continue;if(o=this.tokenizer.escape(e)){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.tag(e)){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.link(e)){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(o.raw.length);let n=t.at(-1);o.type===`text`&&n?.type===`text`?(n.raw+=o.raw,n.text+=o.text):t.push(o);continue}if(o=this.tokenizer.emStrong(e,n,i)){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.codespan(e)){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.br(e)){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.del(e,n,i)){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.autolink(e)){e=e.substring(o.raw.length),t.push(o);continue}if(!this.state.inLink&&(o=this.tokenizer.url(e))){e=e.substring(o.raw.length),t.push(o);continue}let s=e;if(this.options.extensions?.startInline){let t=1/0,n=e.slice(1),r;this.options.extensions.startInline.forEach(e=>{r=e.call({lexer:this},n),typeof r==`number`&&r>=0&&(t=Math.min(t,r))}),t<1/0&&t>=0&&(s=e.substring(0,t+1))}if(o=this.tokenizer.inlineText(s)){e=e.substring(o.raw.length),o.raw.slice(-1)!==`_`&&(i=o.raw.slice(-1)),r=!0;let n=t.at(-1);n?.type===`text`?(n.raw+=o.raw,n.text+=o.text):t.push(o);continue}if(e){this.infiniteLoopError(e.charCodeAt(0));break}}return t}infiniteLoopError(e){let t=`Infinite loop on byte: `+e;if(this.options.silent)console.error(t);else throw Error(t)}},nD=class{options;parser;constructor(e){this.options=e||TT}space(e){return``}code({text:e,lang:t,escaped:n}){let r=(t||``).match(jT.notSpaceStart)?.[0],i=e.replace(jT.endingNewline,``)+` -`;return r?`
`+(n?i:GE(i,!0))+`
-`:`
`+(n?i:GE(i,!0))+`
+`+i.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=n.text):t.push(i);continue}if(e){this.infiniteLoopError(e.charCodeAt(0));break}}return this.state.top=!0,t}inline(e,t=[]){return this.inlineQueue.push({src:e,tokens:t}),t}linkInText(e){if(!e.includes(`[`))return!1;let t=this.tokenizer.rules.inline.link;for(let n of e.matchAll(this.tokenizer.rules.inline.blockSkip))if(t.test(n[0])&&e.charAt(n.index-1)!==`!`)return!0;for(let t of e.matchAll(this.tokenizer.rules.inline.reflinkSearch)){let e=t[0],n=e.lastIndexOf(`[`);if(!(e.charAt(0)===`!`||!Object.hasOwn(this.tokens.links,e.slice(n+1,-1)))&&!(n>1&&this.linkInText(e.slice(1,n-1))))return!0}return!1}inlineTokens(e,t=[]){this.tokenizer.lexer=this;let n=e;if(this.tokens.links&&e.includes(`[`)){let e=this.tokenizer.rules.inline.reflinkSearch,t=n=>{let r=n.lastIndexOf(`[`);if(!Object.hasOwn(this.tokens.links,n.slice(r+1,-1)))return n;if(r>1&&n.charAt(0)!==`!`){let i=n.slice(1,r-1);if(this.linkInText(i))return`[`+i.replace(e,t)+`][`+`a`.repeat(n.length-r-2)+`]`}return`[`+`a`.repeat(n.length-2)+`]`};n=n.replace(e,t)}n=n.replace(this.tokenizer.rules.inline.anyPunctuation,e=>`+`.repeat(e.length)),n=n.replace(this.tokenizer.rules.inline.blockSkip,(e,t,n)=>{let r=n?n.length:0;return e.slice(0,r)+`[`+`a`.repeat(e.length-r-2)+`]`}),n=this.options.hooks?.emStrongMask?.call({lexer:this},n)??n;let r=!1,i=``,a=1/0;for(;e;){if(e.length(o=n.call({lexer:this},e,t))?(e=e.substring(o.raw.length),t.push(o),!0):!1))continue;if(o=this.tokenizer.escape(e)){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.tag(e)){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.link(e)){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(o.raw.length);let n=t.at(-1);o.type===`text`&&n?.type===`text`?(n.raw+=o.raw,n.text+=o.text):t.push(o);continue}if(o=this.tokenizer.emStrong(e,n,i)){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.codespan(e)){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.br(e)){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.del(e,n,i)){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.autolink(e)){e=e.substring(o.raw.length),t.push(o);continue}if(!this.state.inLink&&(o=this.tokenizer.url(e))){e=e.substring(o.raw.length),t.push(o);continue}let s=e;if(this.options.extensions?.startInline){let t=1/0,n=e.slice(1),r;this.options.extensions.startInline.forEach(e=>{r=e.call({lexer:this},n),typeof r==`number`&&r>=0&&(t=Math.min(t,r))}),t<1/0&&t>=0&&(s=e.substring(0,t+1))}if(o=this.tokenizer.inlineText(s)){e=e.substring(o.raw.length),o.raw.slice(-1)!==`_`&&(i=o.raw.slice(-1)),r=!0;let n=t.at(-1);n?.type===`text`?(n.raw+=o.raw,n.text+=o.text):t.push(o);continue}if(e){this.infiniteLoopError(e.charCodeAt(0));break}}return t}infiniteLoopError(e){let t=`Infinite loop on byte: `+e;if(this.options.silent)console.error(t);else throw Error(t)}},iD=class{options;parser;constructor(e){this.options=e||DT}space(e){return``}code({text:e,lang:t,escaped:n}){let r=(t||``).match(NT.notSpaceStart)?.[0],i=e.replace(NT.endingNewline,``)+` +`;return r?`
`+(n?i:qE(i,!0))+`
+`:`
`+(n?i:qE(i,!0))+`
`}blockquote({tokens:e}){return`
${this.parser.parse(e)}
`}html({text:e}){return e}def(e){return``}heading({tokens:e,depth:t}){return`${this.parser.parseInline(e)} @@ -136,39 +136,39 @@ ${this.parser.parse(e)} `}tablerow({text:e}){return` ${e} `}tablecell(e){let t=this.parser.parseInline(e.tokens),n=e.header?`th`:`td`;return(e.align?`<${n} align="${e.align}">`:`<${n}>`)+t+` -`}strong({tokens:e}){return`${this.parser.parseInline(e)}`}em({tokens:e}){return`${this.parser.parseInline(e)}`}codespan({text:e}){return`${GE(e,!0)}`}br(e){return`
`}del({tokens:e}){return`${this.parser.parseInline(e)}`}link({href:e,title:t,tokens:n}){let r=this.parser.parseInline(n),i=KE(e);if(i===null)return r;e=i;let a=`
`+r+``,a}image({href:e,title:t,text:n,tokens:r}){r&&(n=this.parser.parseInline(r,this.parser.textRenderer));let i=KE(e);if(i===null)return GE(n);e=i;let a=`${GE(n)}`,a}text(e){return`tokens`in e&&e.tokens?this.parser.parseInline(e.tokens):`escaped`in e&&e.escaped?e.text:GE(e.text)}},rD=class{strong({text:e}){return e}em({text:e}){return e}codespan({text:e}){return e}del({text:e}){return e}html({text:e}){return e}text({text:e}){return e}link({text:e}){return``+e}image({text:e}){return``+e}br(){return``}checkbox({raw:e}){return e}},iD=class e{options;renderer;textRenderer;constructor(e){this.options=e||TT,this.options.renderer=this.options.renderer||new nD,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new rD}static parse(t,n){return new e(n).parse(t)}static parseInline(t,n){return new e(n).parseInline(t)}parse(e){this.renderer.parser=this;let t=``;for(let n=0;n{let i=e[r].flat(1/0);n=n.concat(this.walkTokens(i,t))}):e.tokens&&(n=n.concat(this.walkTokens(e.tokens,t)))}}return n}use(...e){let t=this.defaults.extensions||{renderers:{},childTokens:{}};return e.forEach(e=>{let n={...e};if(n.async=this.defaults.async||n.async||!1,e.extensions&&(e.extensions.forEach(e=>{if(!e.name)throw Error(`extension name required`);if(`renderer`in e){let n=t.renderers[e.name];n?t.renderers[e.name]=function(...t){let r=e.renderer.apply(this,t);return r===!1&&(r=n.apply(this,t)),r}:t.renderers[e.name]=e.renderer}if(`tokenizer`in e){if(!e.level||e.level!==`block`&&e.level!==`inline`)throw Error(`extension level must be 'block' or 'inline'`);let n=t[e.level];n?n.unshift(e.tokenizer):t[e.level]=[e.tokenizer],e.start&&(e.level===`block`?t.startBlock?t.startBlock.push(e.start):t.startBlock=[e.start]:e.level===`inline`&&(t.startInline?t.startInline.push(e.start):t.startInline=[e.start]))}`childTokens`in e&&e.childTokens&&(t.childTokens[e.name]=e.childTokens)}),n.extensions=t),e.renderer){let t=this.defaults.renderer||new nD(this.defaults);for(let n in e.renderer){if(!(n in t))throw Error(`renderer '${n}' does not exist`);if([`options`,`parser`].includes(n))continue;let r=n,i=e.renderer[r],a=t[r];t[r]=(...e)=>{let n=i.apply(t,e);return n===!1&&(n=a.apply(t,e)),n||``}}n.renderer=t}if(e.tokenizer){let t=this.defaults.tokenizer||new eD(this.defaults);for(let n in e.tokenizer){if(!(n in t))throw Error(`tokenizer '${n}' does not exist`);if([`options`,`rules`,`lexer`].includes(n))continue;let r=n,i=e.tokenizer[r],a=t[r];t[r]=(...e)=>{let n=i.apply(t,e);return n===!1&&(n=a.apply(t,e)),n}}n.tokenizer=t}if(e.hooks){let t=this.defaults.hooks||new aD;for(let n in e.hooks){if(!(n in t))throw Error(`hook '${n}' does not exist`);if([`options`,`block`].includes(n))continue;let r=n,i=e.hooks[r],a=t[r];t[r]=aD.passThroughHooks.has(n)?e=>{if(this.defaults.async&&aD.passThroughHooksRespectAsync.has(n))return(async()=>{let n=await i.call(t,e);return a.call(t,n)})();let r=i.call(t,e);return a.call(t,r)}:(...e)=>{if(this.defaults.async)return(async()=>{let n=await i.apply(t,e);return n===!1&&(n=await a.apply(t,e)),n})();let n=i.apply(t,e);return n===!1&&(n=a.apply(t,e)),n}}n.hooks=t}if(e.walkTokens){let t=this.defaults.walkTokens,r=e.walkTokens;n.walkTokens=function(e){let n=[];return n.push(r.call(this,e)),t&&(n=n.concat(t.call(this,e))),n}}this.defaults={...this.defaults,...n}}),this}setOptions(e){return this.defaults={...this.defaults,...e},this}lexer(e,t){return tD.lex(e,t??this.defaults)}parser(e,t){return iD.parse(e,t??this.defaults)}parseMarkdown(e){return(t,n)=>{let r={...n},i={...this.defaults,...r},a=this.onError(!!i.silent,!!i.async);if(this.defaults.async===!0&&r.async===!1)return a(Error(`marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise.`));if(typeof t>`u`||t===null)return a(Error(`marked(): input parameter is undefined or null`));if(typeof t!=`string`)return a(Error(`marked(): input parameter is of type `+Object.prototype.toString.call(t)+`, string expected`));if(i.hooks&&(i.hooks.options=i,i.hooks.block=e),i.async)return(async()=>{let n=i.hooks?await i.hooks.preprocess(t):t,r=await(i.hooks?await i.hooks.provideLexer(e):e?tD.lex:tD.lexInline)(n,i),a=i.hooks?await i.hooks.processAllTokens(r):r;i.walkTokens&&await Promise.all(this.walkTokens(a,i.walkTokens));let o=await(i.hooks?await i.hooks.provideParser(e):e?iD.parse:iD.parseInline)(a,i);return i.hooks?await i.hooks.postprocess(o):o})().catch(a);try{i.hooks&&(t=i.hooks.preprocess(t));let n=(i.hooks?i.hooks.provideLexer(e):e?tD.lex:tD.lexInline)(t,i);i.hooks&&(n=i.hooks.processAllTokens(n)),i.walkTokens&&this.walkTokens(n,i.walkTokens);let r=(i.hooks?i.hooks.provideParser(e):e?iD.parse:iD.parseInline)(n,i);return i.hooks&&(r=i.hooks.postprocess(r)),r}catch(e){return a(e)}}}onError(e,t){return n=>{if(n.message+=` -Please report this to https://github.com/markedjs/marked.`,e){let e=`

An error occurred:

`+GE(n.message+``,!0)+`
`;return t?Promise.resolve(e):e}if(t)return Promise.reject(n);throw n}}};function sD(e,t){return oD.parse(e,t)}sD.options=sD.setOptions=function(e){return oD.setOptions(e),sD.defaults=oD.defaults,ET(sD.defaults),sD},sD.getDefaults=wT,sD.defaults=TT;function cD(...e){return oD.use(...e),sD.defaults=oD.defaults,ET(sD.defaults),sD}sD.use=cD,sD.walkTokens=function(e,t){return oD.walkTokens(e,t)},sD.parseInline=oD.parseInline,sD.Parser=iD,sD.parser=iD.parse,sD.Renderer=nD,sD.TextRenderer=rD,sD.Lexer=tD,sD.lexer=tD.lex,sD.Tokenizer=eD,sD.Hooks=aD,sD.parse=sD,sD.options,sD.setOptions,sD.walkTokens,sD.parseInline,iD.parse,tD.lex;function lD(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n`u`?null:KD(BigInt.prototype.toString),VD=typeof Symbol>`u`?null:KD(Symbol.prototype.toString),HD=KD(Object.prototype.hasOwnProperty),UD=KD(Object.prototype.toString),WD=KD(RegExp.prototype.test),GD=qD(TypeError);function KD(e){return function(t){t instanceof RegExp&&(t.lastIndex=0);var n=[...arguments].slice(1);return wD(e,t,n)}}function qD(e){return function(){return TD(e,[...arguments])}}function JD(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:MD;if(gD&&gD(e,null),!jD(t))return e;let r=t.length;for(;r--;){let i=t[r];if(typeof i==`string`){let e=n(i);e!==i&&(_D(t)||(t[r]=e),i=e)}e[i]=!0}return e}function YD(e){for(let t=0;t/g),pO=xD(/\${[\w\W]*/g),mO=xD(/^data-[\-\w.\u00B7-\uFFFF]+$/),hO=xD(/^aria-[\-\w]+$/),gO=xD(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),_O=xD(/^(?:\w+script|data):/i),vO=xD(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),yO=xD(/^html$/i),bO=xD(/^[a-z][.\w]*(-[.\w]+)+$/i),xO=xD(/<[/\w!]/g),SO=xD(/<[/\w]/g),CO=xD(/<\/no(script|embed|frames)/i),wO=xD(/\/>/i),TO={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,processingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},EO=[`style`,`script`,`xmp`,`iframe`,`noembed`,`noframes`,`plaintext`,`noscript`],DO=bD(JD({},EO)),OO=function(){let e={};return ED(EO,t=>{e[t]=xD(RegExp(`])`,`i`))}),bD(e)}(),kO=function(){return typeof window>`u`?null:window},AO=function(e,t){if(typeof e!=`object`||typeof e.createPolicy!=`function`)return null;let n=null,r=`data-tt-policy-suffix`;t&&t.hasAttribute(r)&&(n=t.getAttribute(r));let i=`dompurify`+(n?`#`+n:``);try{return e.createPolicy(i,{createHTML(e){return e},createScriptURL(e){return e}})}catch{return console.warn(`TrustedTypes policy `+i+` could not be created.`),null}},jO=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},MO=function(e,t,n,r){return HD(e,t)&&jD(e[t])?JD(r.base?XD(r.base):{},e[t],r.transform):n},NO=function(e,t,n){let r=HD(e,t)?e[t]:void 0;return r&&typeof r==`object`?XD(r):n()};function PO(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:kO(),t=e=>PO(e);if(t.version=`3.4.14`,t.removed=[],!e||!e.document||e.document.nodeType!==TO.document||!e.Element)return t.isSupported=!1,t;let n=e.document,r=n,i=r.currentScript;e.DocumentFragment;let a=e.HTMLTemplateElement,o=e.Node,s=e.Element,c=e.NodeFilter;e.NamedNodeMap===void 0&&(e.NamedNodeMap||e.MozNamedAttrMap),e.HTMLFormElement;let l=e.DOMParser,u=e.trustedTypes,d=s.prototype,f=QD(d,`cloneNode`),p=QD(d,`remove`),m=QD(d,`nextSibling`),h=QD(d,`childNodes`),g=QD(d,`parentNode`),_=QD(d,`shadowRoot`),v=QD(d,`attributes`),y=o&&o.prototype?QD(o.prototype,`nodeType`):null,b=o&&o.prototype?QD(o.prototype,`nodeName`):null,x=o&&o.prototype?QD(o.prototype,`ownerDocument`):null,S=function(e){return y?y(e):e.nodeType},C=function(e){return b?b(e):e.nodeName};if(typeof a==`function`){let e=n.createElement(`template`);e.content&&e.content.ownerDocument&&(n=e.content.ownerDocument)}let w,T=``,ee,te=!1,ne=0,re=function(){if(ne>0)throw GD(`A configured TRUSTED_TYPES_POLICY callback (createHTML or createScriptURL) must not call DOMPurify.sanitize, as that causes infinite recursion. Do not pass a policy whose callbacks wrap DOMPurify as TRUSTED_TYPES_POLICY; see the "DOMPurify and Trusted Types" section of the README.`)},ie=function(e){re(),ne++;try{return w.createHTML(e)}finally{ne--}},ae=function(e){re(),ne++;try{return w.createScriptURL(e)}finally{ne--}},oe=function(){return te||=(ee=AO(u,i),!0),ee},se=n,ce=se.implementation,le=se.createNodeIterator,ue=se.createDocumentFragment,de=se.getElementsByTagName,fe=r.importNode,E=jO();t.isSupported=typeof hD==`function`&&typeof g==`function`&&ce&&ce.createHTMLDocument!==void 0;let pe=dO,me=fO,he=pO,ge=mO,_e=hO,ve=_O,ye=vO,be=bO,xe=gO,Se=null,Ce=JD({},[...eO,...tO,...nO,...iO,...oO]),we=null,Te=JD({},[...sO,...cO,...lO,...uO]),Ee=Object.seal(SD(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),De=null,Oe=null,ke=Object.seal(SD(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}})),Ae=!0,je=!0,Me=!1,Ne=!0,Pe=!1,Fe=!0,Ie=!1,Le=!1,Re=null,ze=null,Be=!1,Ve=!1,He=!1,Ue=!1,We=!0,Ge=!1,Ke=`user-content-`,qe=!0,Je=!1,Ye={},Xe=null,Ze=JD({},`annotation-xml.audio.colgroup.desc.foreignobject.head.iframe.math.mi.mn.mo.ms.mtext.noembed.noframes.noscript.plaintext.script.selectedcontent.style.svg.template.thead.title.video.xmp`.split(`.`)),Qe=null,$e=JD({},[`audio`,`video`,`img`,`source`,`image`,`track`]),et=null,D=JD({},[`alt`,`class`,`for`,`id`,`label`,`name`,`pattern`,`placeholder`,`role`,`summary`,`title`,`value`,`style`,`xmlns`]),tt=`http://www.w3.org/1998/Math/MathML`,nt=`http://www.w3.org/2000/svg`,rt=`http://www.w3.org/1999/xhtml`,it=rt,at=!1,ot=null,st=JD({},[tt,nt,rt],ND),ct=bD([`mi`,`mo`,`mn`,`ms`,`mtext`]),lt=JD({},ct),ut=bD([`annotation-xml`]),dt=JD({},ut),ft=JD({},[`title`,`style`,`font`,`a`,`script`]),pt=null,mt=[`application/xhtml+xml`,`text/html`],ht=null,gt=null,_t=n.createElement(`form`),vt=function(e){return e instanceof RegExp||e instanceof Function},yt=function(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(gt&>===e)return;(!e||typeof e!=`object`)&&(e={}),e=XD(e),pt=mt.indexOf(e.PARSER_MEDIA_TYPE)===-1?`text/html`:e.PARSER_MEDIA_TYPE,ht=pt===`application/xhtml+xml`?ND:MD,Se=MO(e,`ALLOWED_TAGS`,Ce,{transform:ht}),we=MO(e,`ALLOWED_ATTR`,Te,{transform:ht}),ot=MO(e,`ALLOWED_NAMESPACES`,st,{transform:ND}),et=MO(e,`ADD_URI_SAFE_ATTR`,D,{transform:ht,base:D}),Qe=MO(e,`ADD_DATA_URI_TAGS`,$e,{transform:ht,base:$e}),Xe=MO(e,`FORBID_CONTENTS`,Ze,{transform:ht}),De=MO(e,`FORBID_TAGS`,XD({}),{transform:ht}),Oe=MO(e,`FORBID_ATTR`,XD({}),{transform:ht}),Ye=HD(e,`USE_PROFILES`)?e.USE_PROFILES&&typeof e.USE_PROFILES==`object`?XD(e.USE_PROFILES):e.USE_PROFILES:!1,Ae=e.ALLOW_ARIA_ATTR!==!1,je=e.ALLOW_DATA_ATTR!==!1,Me=e.ALLOW_UNKNOWN_PROTOCOLS||!1,Ne=e.ALLOW_SELF_CLOSE_IN_ATTR!==!1,Pe=e.SAFE_FOR_TEMPLATES||!1,Fe=e.SAFE_FOR_XML!==!1,Ie=e.WHOLE_DOCUMENT||!1,Ve=e.RETURN_DOM||!1,He=e.RETURN_DOM_FRAGMENT||!1,Ue=e.RETURN_TRUSTED_TYPE||!1,Be=e.FORCE_BODY||!1,We=e.SANITIZE_DOM!==!1,Ge=e.SANITIZE_NAMED_PROPS||!1,qe=e.KEEP_CONTENT!==!1,Je=e.IN_PLACE||!1,xe=$D(e.ALLOWED_URI_REGEXP)?e.ALLOWED_URI_REGEXP:gO,it=typeof e.NAMESPACE==`string`?e.NAMESPACE:rt,lt=NO(e,`MATHML_TEXT_INTEGRATION_POINTS`,()=>JD({},ct)),dt=NO(e,`HTML_INTEGRATION_POINTS`,()=>JD({},ut));let t=NO(e,`CUSTOM_ELEMENT_HANDLING`,()=>SD(null));if(Ee=SD(null),HD(t,`tagNameCheck`)&&vt(t.tagNameCheck)&&(Ee.tagNameCheck=t.tagNameCheck),HD(t,`attributeNameCheck`)&&vt(t.attributeNameCheck)&&(Ee.attributeNameCheck=t.attributeNameCheck),HD(t,`allowCustomizedBuiltInElements`)&&typeof t.allowCustomizedBuiltInElements==`boolean`&&(Ee.allowCustomizedBuiltInElements=t.allowCustomizedBuiltInElements),xD(Ee),Pe&&(je=!1),He&&(Ve=!0),Ye&&(Se=JD({},oO),we=SD(null),Ye.html===!0&&(JD(Se,eO),JD(we,sO)),Ye.svg===!0&&(JD(Se,tO),JD(we,cO),JD(we,uO)),Ye.svgFilters===!0&&(JD(Se,nO),JD(we,cO),JD(we,uO)),Ye.mathMl===!0&&(JD(Se,iO),JD(we,lO),JD(we,uO))),ke.tagCheck=null,ke.attributeCheck=null,HD(e,`ADD_TAGS`)&&(typeof e.ADD_TAGS==`function`?ke.tagCheck=e.ADD_TAGS:jD(e.ADD_TAGS)&&(Se===Ce&&(Se=XD(Se)),JD(Se,e.ADD_TAGS,ht))),HD(e,`ADD_ATTR`)&&(typeof e.ADD_ATTR==`function`?ke.attributeCheck=e.ADD_ATTR:jD(e.ADD_ATTR)&&(we===Te&&(we=XD(we)),JD(we,e.ADD_ATTR,ht))),HD(e,`ADD_FORBID_CONTENTS`)&&jD(e.ADD_FORBID_CONTENTS)&&(Xe===Ze&&(Xe=XD(Xe)),JD(Xe,e.ADD_FORBID_CONTENTS,ht)),qe&&(Se[`#text`]=!0),Ie&&JD(Se,[`html`,`head`,`body`]),Se.table&&(JD(Se,[`tbody`]),delete De.tbody),e.TRUSTED_TYPES_POLICY){if(typeof e.TRUSTED_TYPES_POLICY.createHTML!=`function`)throw GD(`TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.`);if(typeof e.TRUSTED_TYPES_POLICY.createScriptURL!=`function`)throw GD(`TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.`);let t=w;w=e.TRUSTED_TYPES_POLICY;try{T=ie(``)}catch(e){throw w=t,e}}else e.TRUSTED_TYPES_POLICY===null?(w=void 0,T=``):(w===void 0&&(w=oe()),w&&typeof T==`string`&&(T=ie(``)));bD&&bD(e),gt=e},bt=JD({},[...tO,...nO,...rO]),xt=JD({},[...iO,...aO]),St=function(e,t,n){return t.namespaceURI===rt?e===`svg`:t.namespaceURI===tt?e===`svg`&&(n===`annotation-xml`||lt[n]):!!bt[e]},Ct=function(e,t,n){return t.namespaceURI===rt?e===`math`:t.namespaceURI===nt?e===`math`&&dt[n]:!!xt[e]},wt=function(e,t,n){return t.namespaceURI===nt&&!dt[n]||t.namespaceURI===tt&&!lt[n]?!1:!xt[e]&&(ft[e]||!bt[e])},Tt=function(e){let t=g(e);(!t||!t.tagName)&&(t={namespaceURI:it,tagName:`template`});let n=MD(e.tagName),r=MD(t.tagName);return ot[e.namespaceURI]?e.namespaceURI===nt?St(n,t,r):e.namespaceURI===tt?Ct(n,t,r):e.namespaceURI===rt?wt(n,t,r):!!(pt===`application/xhtml+xml`&&ot[e.namespaceURI]):!1},Et=function(e){kD(t.removed,{element:e});try{g(e).removeChild(e)}catch{if(p(e),!g(e))throw GD(`a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place`)}},Dt=function(e,t,n){try{e.removeAttributeNode(t)}catch{try{e.removeAttribute(n)}catch{}}},Ot=function(e){k(e);let t=h(e);if(t){let e=[];ED(t,t=>{kD(e,t)}),ED(e,e=>{try{p(e)}catch{}})}let n=v(e);if(n)for(let t=n.length-1;t>=0;--t){let r=n[t],i=r&&r.name;typeof i==`string`&&Dt(e,r,i)}},kt=function(e,n,r){if(!r)try{r=n.getAttributeNode(e)}catch{r=null}kD(t.removed,{attribute:r||null,from:n});try{r?n.removeAttributeNode(r):n.removeAttribute(e)}catch{try{n.removeAttribute(e)}catch{}}if(e===`is`){if(Ve||He)try{Et(n)}catch{}else try{n.setAttribute(e,``)}catch{}}},O=function(e){let t=v(e);if(t)for(let n=t.length-1;n>=0;--n){let r=t[n],i=r&&r.name;typeof i!=`string`||we[ht(i)]||Dt(e,r,i)}},k=function(e){let t=[e];for(;t.length>0;){let e=t.pop();S(e)===TO.element&&O(e);let n=h(e);if(n)for(let e=n.length-1;e>=0;--e)t.push(n[e])}},At=function(e,t){return Fe?e===`patchsrc`||e===`for`&&t!==`label`&&t!==`output`:!1},jt=function(e){if(!Fe)return;let t=[e];for(;t.length>0;){let e=t.pop(),n=S(e);if(n===TO.processingInstruction||n===TO.comment&&WD(SO,e.data)){try{p(e)}catch{}continue}if(n===TO.element){let t=e,n=ht(C(e));try{t.hasAttribute&&t.hasAttribute(`patchsrc`)&&t.removeAttribute(`patchsrc`),t.hasAttribute&&t.hasAttribute(`for`)&&At(`for`,n)&&t.removeAttribute(`for`)}catch{}}let r=h(e);if(r)for(let e=r.length-1;e>=0;--e)t.push(r[e])}},Mt=function(e){let t=null,r=null;if(Be)e=``+e;else{let t=PD(e,/^[\r\n\t ]+/);r=t&&t[0]}pt===`application/xhtml+xml`&&it===rt&&(e=``+e+``);let i=w?ie(e):e;if(it===rt)try{t=new l().parseFromString(i,pt)}catch{}if(!t||!t.documentElement){t=ce.createDocument(it,`template`,null);try{t.documentElement.innerHTML=at?T:i}catch{}}let a=t.body||t.documentElement;return e&&r&&a.insertBefore(n.createTextNode(r),a.childNodes[0]||null),it===rt?de.call(t,Ie?`html`:`body`)[0]:Ie?t.documentElement:a},Nt=function(e){let t=x?x(e):e.ownerDocument;return le.call(t||e,e,c.SHOW_ELEMENT|c.SHOW_COMMENT|c.SHOW_TEXT|c.SHOW_PROCESSING_INSTRUCTION|c.SHOW_CDATA_SECTION,null)},Pt=function(e){return e=FD(e,pe,` `),e=FD(e,me,` `),e=FD(e,he,` `),e},Ft=function(e){e.normalize();let t=x?x(e):e.ownerDocument,n=le.call(t||e,e,c.SHOW_TEXT|c.SHOW_COMMENT|c.SHOW_CDATA_SECTION|c.SHOW_PROCESSING_INSTRUCTION,null),r=n.nextNode();for(;r;)r.data=Pt(r.data),r=n.nextNode();let i=e.querySelectorAll?.call(e,`template`);i&&ED(i,e=>{Lt(e.content)&&Ft(e.content)})},It=function(e){let t=b?b(e):null;return typeof t!=`string`||ht(t)!==`form`?!1:typeof e.nodeName!=`string`||typeof e.textContent!=`string`||typeof e.removeChild!=`function`||e.attributes!==v(e)||typeof e.removeAttribute!=`function`||typeof e.setAttribute!=`function`||typeof e.namespaceURI!=`string`||typeof e.insertBefore!=`function`||typeof e.hasChildNodes!=`function`||e.nodeType!==y(e)||e.childNodes!==h(e)},Lt=function(e){if(!y||typeof e!=`object`||!e)return!1;try{return y(e)===TO.documentFragment}catch{return!1}},Rt=function(e){if(!y||typeof e!=`object`||!e)return!1;try{return typeof y(e)==`number`}catch{return!1}};function zt(e,n,r){e.length!==0&&ED(e,e=>{e.call(t,n,r,gt)})}let Bt=function(e,t){return!!(Fe&&e.hasChildNodes()&&!Rt(e.firstElementChild)&&WD(xO,e.textContent)&&WD(xO,e.innerHTML)||Fe&&e.namespaceURI===rt&&DO[t]&&(Rt(e.firstElementChild)||typeof e.textContent==`string`&&WD(OO[t],e.textContent))||e.nodeType===TO.processingInstruction||Fe&&e.nodeType===TO.comment&&WD(SO,e.data))},Vt=function(e,t){return e instanceof RegExp?WD(e,t):e instanceof Function&&!!e(t,...[...arguments].slice(2))},Ht=function(e,t,n){if(!De[t]&&Jt(t)&&Vt(Ee.tagNameCheck,t))return!1;if(qe&&!Xe[t]){let t=g(e),r=h(e);if(r&&t){let i=r.length;for(let a=i-1;a>=0;--a){let i=e===n?f(r[a],!0):r[a];t.insertBefore(i,m(e))}}}return Et(e),!0},Ut=function(e,t,n,r){return e.length===0?t:t===n||t===r?XD(t):t},Wt=function(e,t){return e===t||g(e)!==null?!1:(Je&&k(e),!0)},Gt=function(e,n){if(zt(E.beforeSanitizeElements,e,null),Wt(e,n))return!0;if(It(e))return Et(e),!0;let r=ht(C(e));if(Se=Ut(E.uponSanitizeElement,Se,Ce,Re),zt(E.uponSanitizeElement,e,{tagName:r,allowedTags:Se}),Wt(e,n))return!0;if(Bt(e,r))return Et(e),!0;if(De[r]||!(ke.tagCheck instanceof Function&&ke.tagCheck(r))&&!Se[r]){let t=Ht(e,r,n);return t===!1&&zt(E.afterSanitizeElements,e,null),t}if(S(e)===TO.element&&!Tt(e)||(r===`noscript`||r===`noembed`||r===`noframes`)&&WD(CO,e.innerHTML))return Et(e),!0;if(Pe&&e.nodeType===TO.text){let n=Pt(e.textContent);e.textContent!==n&&(kD(t.removed,{element:e.cloneNode()}),e.textContent=n)}return zt(E.afterSanitizeElements,e,null),!1},Kt=function(e,t,r){if(Oe[t]||At(t,e)||We&&(t===`id`||t===`name`)&&(r in n||r in _t))return!1;let i=we[t]||ke.attributeCheck instanceof Function&&ke.attributeCheck(t,e);return je&&WD(ge,t)||Ae&&WD(_e,t)?!0:i?et[t]||WD(xe,FD(r,ye,``))||(t===`src`||t===`xlink:href`||t===`href`)&&e!==`script`&&ID(r,`data:`)===0&&Qe[e]||Me&&!WD(ve,FD(r,ye,``))?!0:!r:Jt(e)&&Vt(Ee.tagNameCheck,e)&&Vt(Ee.attributeNameCheck,t,e)||t===`is`&&Ee.allowCustomizedBuiltInElements&&Vt(Ee.tagNameCheck,r)},qt=JD({},[`annotation-xml`,`color-profile`,`font-face`,`font-face-format`,`font-face-name`,`font-face-src`,`font-face-uri`,`missing-glyph`]),Jt=function(e){return!qt[MD(e)]&&WD(be,e)},Yt=function(e,t,n,r){if(w&&typeof u==`object`&&typeof u.getAttributeType==`function`&&!n)switch(u.getAttributeType(e,t)){case`TrustedHTML`:return ie(r);case`TrustedScriptURL`:return ae(r)}return r},A=function(e,n,r,i){try{r?e.setAttributeNS(r,n,i):e.setAttribute(n,i),It(e)?Et(e):OD(t.removed)}catch{kt(n,e)}},Xt=function(e){zt(E.beforeSanitizeAttributes,e,null);let t=e.attributes;if(!t||It(e))return;we=Ut(E.uponSanitizeAttribute,we,Te,ze);let n={attrName:``,attrValue:``,keepAttr:!0,allowedAttributes:we,forceKeepAttr:void 0},r=t.length,i=ht(e.nodeName);for(;r--;){let a=t[r],o=a.name,s=a.namespaceURI,c=a.value,l=ht(o),u=c,d=o===`value`?u:LD(u);if(n.attrName=l,n.attrValue=d,n.keepAttr=!0,n.forceKeepAttr=void 0,zt(E.uponSanitizeAttribute,e,n),d=n.attrValue,Ge&&(l===`id`||l===`name`)&&ID(d,Ke)!==0&&(kt(o,e,a),d=Ke+d),Fe&&WD(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,d)){kt(o,e,a);continue}if(l===`attributename`&&PD(d,`href`)){kt(o,e,a);continue}if(!n.forceKeepAttr){if(!n.keepAttr){kt(o,e,a);continue}if(!Ne&&WD(wO,d)){kt(o,e,a);continue}if(Pe&&(d=Pt(d)),!Kt(i,l,d)){kt(o,e,a);continue}d=Yt(i,l,s,d),d!==u&&A(e,o,s,d)}}zt(E.afterSanitizeAttributes,e,null)},Zt=function(e){let t=null,n=Nt(e);for(zt(E.beforeSanitizeShadowDOM,e,null);t=n.nextNode();)if(zt(E.uponSanitizeShadowNode,t,null),Gt(t,e),Xt(t),Lt(t.content)&&Zt(t.content),S(t)===TO.element){let e=_(t);Lt(e)&&(Qt(e),Zt(e))}zt(E.afterSanitizeShadowDOM,e,null)},Qt=function(e){let t=[{node:e,shadow:null}];for(;t.length>0;){let e=t.pop();if(e.shadow){Zt(e.shadow);continue}let n=e.node,r=S(n)===TO.element,i=h(n);if(i)for(let e=i.length-1;e>=0;--e)t.push({node:i[e],shadow:null});if(r){let e=b?b(n):null;if(typeof e==`string`&&ht(e)===`template`){let e=n.content;Lt(e)&&t.push({node:e,shadow:null})}}if(r){let e=_(n);Lt(e)&&t.push({node:null,shadow:e},{node:e,shadow:null})}}};return t.sanitize=function(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=null,a=null,o=null,s=null;if(at=!e,at&&(e=``),typeof e!=`string`&&!Rt(e)&&(e=ZD(e),typeof e!=`string`))throw GD(`dirty is not a string, aborting`);if(!t.isSupported)return e;Le?(Se=Re,we=ze):yt(n),(E.uponSanitizeElement.length>0||E.uponSanitizeAttribute.length>0)&&(Se=XD(Se)),E.uponSanitizeAttribute.length>0&&(we=XD(we)),t.removed=[];let c=Je&&typeof e!=`string`&&Rt(e);if(c){jt(e);let t=C(e);if(typeof t==`string`){let n=ht(t);if(!Se[n]||De[n])throw Ot(e),GD(`root node is forbidden and cannot be sanitized in-place`)}if(It(e))throw Ot(e),GD(`root node is clobbered and cannot be sanitized in-place`);try{Qt(e)}catch(t){throw Ot(e),t}}else if(Rt(e))i=Mt(``),a=i.ownerDocument.importNode(e,!0),a.nodeType===TO.element&&a.nodeName===`BODY`||a.nodeName===`HTML`?i=a:i.appendChild(a),Qt(a);else{if(!Ve&&!Pe&&!Ie&&e.indexOf(`<`)===-1)return w&&Ue?ie(e):e;if(i=Mt(e),!i)return Ve?null:Ue?T:``}i&&Be&&Et(i.firstChild);let l=c?e:i;try{let e=Nt(l);for(;o=e.nextNode();)Gt(o,l),Xt(o),Lt(o.content)&&Zt(o.content)}catch(n){throw c&&(Ot(e),ED(t.removed,e=>{e.element&&k(e.element)})),n}if(c)return ED(t.removed,e=>{e.element&&k(e.element)}),Pe&&Ft(e),e;if(Ve){if(Pe&&Ft(i),He)for(s=ue.call(i.ownerDocument);i.firstChild;)s.appendChild(i.firstChild);else s=i;return(we.shadowroot||we.shadowrootmode)&&(s=fe.call(r,s,!0)),s}let u=Ie?i.outerHTML:i.innerHTML;return Ie&&Se[`!doctype`]&&i.ownerDocument&&i.ownerDocument.doctype&&i.ownerDocument.doctype.name&&WD(yO,i.ownerDocument.doctype.name)&&(u=` -`+u),Pe&&(u=Pt(u)),w&&Ue?ie(u):u},t.setConfig=function(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};yt(e),Le=!0,Re=Se,ze=we},t.clearConfig=function(){gt=null,Le=!1,Re=null,ze=null,w=ee,T=``},t.isValidAttribute=function(e,t,n){gt||yt({});let r=ht(e),i=ht(t);return Kt(r,i,n)},t.addHook=function(e,t){typeof t==`function`&&HD(E,e)&&kD(E[e],t)},t.removeHook=function(e,t){if(HD(E,e)){if(t!==void 0){let n=DD(E[e],t);return n===-1?void 0:AD(E[e],n,1)[0]}return OD(E[e])}},t.removeHooks=function(e){HD(E,e)&&(E[e]=[])},t.removeAllHooks=function(){E=jO()},t}var FO=PO(),IO=e=>!!e&&!/^(https?:|data:|blob:|mailto:|#|\/)/i.test(e),LO=e=>ys(`/files/raw?path=`+encodeURIComponent(e.replace(/^\.\//,``))),RO=e=>/^\/api\/p\/[^/]+\/files\/raw$/.test(e);FO.addHook(`afterSanitizeAttributes`,e=>{if(e.tagName===`IMG`&&e.hasAttribute(`src`)){let t=e.getAttribute(`src`);IO(t)&&(e.setAttribute(`src`,LO(t)),e.setAttribute(`loading`,`lazy`));return}if(e.tagName!==`A`||!e.hasAttribute(`href`))return;let t=e.getAttribute(`href`);if(IO(t)){e.setAttribute(`href`,LO(t)),e.setAttribute(`target`,`_blank`),e.setAttribute(`rel`,`noopener noreferrer`);return}if(!(!t||!/^https?:\/\//i.test(t)))try{new URL(t,window.location.href).host!==window.location.host&&(e.setAttribute(`target`,`_blank`),e.setAttribute(`rel`,`noopener noreferrer`))}catch{}});function zO(e){return FO.sanitize(sD.parse(e||``))}function BO(e,t){for(let n of e.querySelectorAll(`img`))n.style.cursor=`zoom-in`,n.onclick=()=>{let e=n.getAttribute(`src`)||``,r=null;try{let t=new URL(e,window.location.href);RO(t.pathname)&&(r=t.searchParams.get(`path`))}catch{}r&&t?t({path:r,name:r.split(`/`).pop()??``,alt:n.getAttribute(`alt`)||``}):window.open(e,`_blank`,`noopener`)}}var VO=/\btask-[0-9a-f]{6,}\b/g;function HO(e,t){let n=document.createTreeWalker(e,NodeFilter.SHOW_TEXT,{acceptNode:e=>e.parentElement&&e.parentElement.closest(`a`)?NodeFilter.FILTER_REJECT:VO.test(e.nodeValue||``)?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}),r=[];for(;n.nextNode();)r.push(n.currentNode);for(let e of r){let n=document.createDocumentFragment(),r=0,i=e.nodeValue||``;VO.lastIndex=0;let a;for(;a=VO.exec(i);){a.index>r&&n.appendChild(document.createTextNode(i.slice(r,a.index)));let e=document.createElement(`a`);e.href=`#`,e.className=`tasklink`,e.textContent=a[0];let o=a[0];e.addEventListener(`click`,e=>{e.preventDefault(),t&&t(o)}),n.appendChild(e),r=a.index+a[0].length}r
Overview Composing a view…
`);function WO(e){var t=UO(),n=F(t),r=F(n);$(F(r),{name:`sparkles`,size:15}),D(r),tt(2),D(n),tt(2),D(t),U(e,t)}function GO(e,t,n){let r=e.findIndex(e=>e.id===t.id);for(let t=r-1;t>=0;t--){let n=e[t];if(n.kind===`user`)return n.text||``}return n&&n.task_name||``}var KO=H(` `),qO=H(`Rating removed — what I learned stays in Memory`),JO=H(`
`),YO=H(`
`);function XO(e,t){O(t,!0);let n=ro(t,`content`,3,``),r=ro(t,`request`,3,``),i=ro(t,`current`,3,null),a=M(null),o=M(``),s=M(null),c=M(null),l=M(!1),u=M(!1),d=j(()=>B(l)?null:B(c)??i()),f=M(!1);async function p(){try{await navigator.clipboard.writeText(n()||``),N(f,!0),setTimeout(()=>N(f,!1),1400)}catch{}}function m(e){B(d)&&B(d).sentiment===e&&!B(a)?v():h(e)}function h(e){N(a,e,!0),N(o,(B(d)&&B(d).sentiment===e?B(d).reason:``)||``,!0),queueMicrotask(()=>B(s)&&B(s).focus())}function g(){N(a,null),N(o,``)}function _(){let e=B(o).trim();!e||!B(a)||(ix({targetKind:t.targetKind,targetId:String(t.targetId),sentiment:B(a),reason:e,content:n(),request:r()}),N(c,{sentiment:B(a),reason:e},!0),N(l,!1),N(u,!1),N(a,null),N(o,``))}function v(){let e=!!(B(d)&&B(d).reason);ax({targetKind:t.targetKind,targetId:String(t.targetId)}),N(l,!0),N(c,null),N(a,null),N(o,``),e&&(N(u,!0),setTimeout(()=>N(u,!1),3200))}function y(e){e.key===`Enter`?(e.preventDefault(),_()):e.key===`Escape`&&g()}var b=YO(),x=F(b),S=F(x);let C;var w=F(S);{let e=j(()=>B(f)?`check`:`copy`);$(w,{get name(){return B(e)},size:14})}D(S);var T=R(S,2);let ee;$(F(T),{name:`thumbs-up`,size:14}),D(T);var te=R(T,2);let ne;$(F(te),{name:`thumbs-down`,size:14}),D(te);var re=R(te,2),ie=e=>{var t=KO(),n=L(t);z(()=>{J(t,`title`,B(d).reason),W(n,`${B(d).sentiment===`up`?`Liked`:`Disliked`} — ${B(d).reason??``}`)}),U(e,t)},ae=e=>{U(e,qO())};G(re,e=>{B(d)&&!B(a)?e(ie):B(u)&&e(ae,1)}),D(x);var oe=R(x,2),se=e=>{var t=JO(),n=F(t);za(n),Qa(n,e=>N(s,e),()=>B(s));var r=R(n,2),i=R(r,2);$(F(i),{name:`x`,size:13}),D(i),D(t),z(e=>{J(n,`placeholder`,B(a)===`up`?`What did you like? (required)`:`What didn't work? (required)`),r.disabled=e},[()=>!B(o).trim()]),V(`keydown`,n,y),qa(n,()=>B(o),e=>N(o,e)),V(`click`,r,_),V(`click`,i,g),U(e,t)};G(oe,e=>{B(a)&&e(se)}),D(b),z(()=>{C=q(S,1,`fb-thumb`,null,C,{on:B(f)}),J(S,`title`,B(f)?`Copied`:`Copy`),ee=q(T,1,`fb-thumb`,null,ee,{on:B(d)?.sentiment===`up`,active:B(a)===`up`}),J(T,`title`,B(d)?.sentiment===`up`?`You liked this: ${B(d).reason} — click to remove`:`Good — tell me why`),ne=q(te,1,`fb-thumb`,null,ne,{on:B(d)?.sentiment===`down`,active:B(a)===`down`}),J(te,`title`,B(d)?.sentiment===`down`?`You disliked this: ${B(d).reason} — click to remove`:`Not right — tell me why`)}),V(`click`,S,p),V(`click`,T,()=>m(`up`)),V(`click`,te,()=>m(`down`)),U(e,b),k()}ki([`click`,`keydown`]);var ZO=H(`
`),QO=H(`
`),$O=H(` `,1);function ek(e,t){O(t,!0);let n=()=>A(Fo,`$thread`,i),r=()=>A(Vo,`$runInfo`,i),[i,a]=Zt(),o=j(()=>rb(t.item.text||``)),s=j(()=>B(o).text),c=j(()=>!!t.item.streaming&&B(o).composing),l=j(()=>ib(t.item.text||``)),u=j(()=>!!B(l)&&n().items.some(e=>e.kind===`a2ui`&&e.surfaceId===B(l))),d=M(void 0);hr(()=>{B(d)&&(B(d).innerHTML=zO(B(s)),HO(B(d),e=>Fs(`/t/`+e)),BO(B(d),e=>Hs(e.path)))});let f=j(()=>!t.item.streaming&&!t.item.empty&&B(s)?t.item.at:null),p=j(()=>GO(n().items,t.item,r()));var m=$O(),h=I(m),g=e=>{var n=ZO(),r=F(n);let i;Qa(r,e=>N(d,e),()=>B(d)),D(n),z(()=>i=q(r,1,`bubble`,null,i,{voice:t.item.voice,empty:t.item.empty})),U(e,n)};G(h,e=>{(B(s)||t.item.empty||t.item.streaming&&!B(c))&&e(g)});var _=R(h,2),v=e=>{WO(e,{})};G(_,e=>{B(c)&&!B(u)&&e(v)});var y=R(_,2),b=e=>{var n=QO();XO(F(n),{targetKind:`message`,get targetId(){return B(f)},get content(){return B(s)},get request(){return B(p)},get current(){return t.item.feedback}}),D(n),U(e,n)};G(y,e=>{B(f)!=null&&e(b)}),U(e,m),k(),a()}var tk=H(` `),nk=H(` deleted`,1),rk=H(` `,1),ik=H(`
`),ak=H(`
`),ok=H(`
`),sk=H(`
`),ck=H(`
`),lk=H(`
`,1);function uk(e,t){O(t,!0);let n=M(P(new Set));function r(e){let t=new Set(B(n));t.add(e.id),N(n,t,!0)}async function i(e){try{let{files:t}=await Q.files(),n=t.find(t=>t.path===e.path)||t.find(t=>t.path.endsWith(`/`+e.path));return n?n.path:null}catch{return null}}async function a(e){let t=await i(e);t?Hs(t):r(e)}async function o(e){let t=e.path,n=await fetch(Q.fileUrl(t,!0)).catch(()=>null);if((!n||!n.ok)&&(t=await i(e),n=t?await fetch(Q.fileUrl(t,!0)).catch(()=>null):null,!n||!n.ok)){r(e);return}let a=URL.createObjectURL(await n.blob()),o=document.createElement(`a`);o.href=a,o.download=e.name,o.click(),URL.revokeObjectURL(a)}var s=lk(),c=I(s);K(c,21,()=>t.item.names,Qi,(e,t)=>{var n=tk(),r=F(n);$(r,{name:`zap`,size:12});var i=R(r);D(n),z(()=>W(i,` ${B(t).name??``}${B(t).n>1?` ×`+B(t).n:``}`)),U(e,n)}),D(c);var l=R(c,2),u=e=>{var r=ck();K(r,21,()=>t.item.cards,e=>e.id,(e,t)=>{var r=Bi(),i=I(r),s=e=>{var r=ik();let i;var s=F(r);$(F(s),{name:`file-text`,size:15}),D(s);var c=R(s,2),l=e=>{var n=nk(),r=L(I(n),!0);tt(2),z(()=>W(r,B(t).name)),U(e,n)},u=j(()=>B(n).has(B(t).id)),d=e=>{var n=rk(),r=I(n),i=L(r,!0),s=R(r,2);$(F(s),{name:`download`,size:15}),D(s),z(()=>{J(r,`title`,B(t).path),W(i,B(t).name)}),V(`click`,r,()=>a(B(t))),V(`click`,s,()=>o(B(t))),U(e,n)};G(c,e=>{B(u)?e(l):e(d,-1)}),D(r),z(e=>i=q(r,1,`toolcard`,null,i,{gone:e}),[()=>B(n).has(B(t).id)]),U(e,r)},c=e=>{var n=ak(),r=F(n);$(F(r),{name:`search`,size:15}),D(r);var i=L(R(r,2),!0);D(n),z(()=>W(i,B(t).query)),U(e,n)},l=e=>{var n=ok(),r=F(n);$(F(r),{name:`image`,size:15}),D(r);var i=L(R(r,2));D(n),z(()=>{J(n,`title`,B(t).edit?`Editing image`:`Generating image`),W(i,`${B(t).edit?`Edit`:`Image`} · ${B(t).prompt??``}`)}),U(e,n)},u=e=>{var n=sk(),r=F(n);$(F(r),{name:`code`,size:15}),D(r);var i=L(R(r,2));D(n),z(()=>{J(n,`title`,B(t).ran?`Ran script ${B(t).script} from skill ${B(t).name}`:`Used skill ${B(t).name}`),W(i,`Skill · ${B(t).name??``}${B(t).ran?` · ▶ ${B(t).script}`:``}`)}),U(e,n)};G(i,e=>{B(t).kind===`file`?e(s):B(t).kind===`search`?e(c,1):B(t).kind===`image`?e(l,2):B(t).kind===`skill`&&e(u,3)}),U(e,r)}),D(r),U(e,r)};G(l,e=>{t.item.cards?.length&&e(u)}),U(e,s),k()}ki([`click`]);var dk=H(` `),fk=H(`
`);function pk(e,t){O(t,!0);var n=fk(),r=F(n),i=F(r);{let e=j(()=>t.item.scheduled?`clock`:`check`);$(i,{get name(){return B(e)},size:14})}var a=R(i),o=R(a),s=e=>{var n=dk(),r=L(n,!0);z(e=>W(r,e),[()=>gy(t.item.at)]),U(e,n)};G(o,e=>{t.item.at&&e(s)}),D(r);var c=R(r,2),l=L(c,!0),u=R(c,2);D(n),z(()=>{W(a,` ${t.item.scheduled?`Task scheduled`:`Task started`}`),W(l,t.item.title||`Task`)}),V(`click`,u,()=>Fs(`/t/`+t.item.taskId)),U(e,n),k()}ki([`click`]);var mk=H(` `),hk=H(`
`),gk=H(`
`),_k=H(``),vk=H(`
`),yk=H(`
`);function bk(e,t){O(t,!0);let n=()=>A(Fo,`$thread`,i),r=()=>A(Vo,`$runInfo`,i),[i,a]=Zt(),o=j(()=>GO(n().items,t.item,r())),s=j(()=>(t.item.preview||``).replace(/[#*`>_~]/g,``).replace(/\s+/g,` `).trim());function c(){Xt(Jo,{title:t.item.description??``,text:t.item.preview??``})}let l=j(()=>(t.item.path||``).split(`/`).pop()),u=()=>{t.item.path&&Hs(t.item.path)};var d=yk(),f=F(d),p=F(f);$(p,{name:`check`,size:13});var m=R(p),h=R(m),g=e=>{var n=mk(),r=L(n,!0);z(e=>W(r,e),[()=>gy(t.item.at)]),U(e,n)};G(h,e=>{t.item.at&&e(g)}),D(f);var _=R(f,2),v=e=>{var t=hk(),n=L(t);z(()=>W(n,`${B(s)??``}…`)),U(e,t)};G(_,e=>{B(s)&&e(v)});var y=R(_,2),b=e=>{var n=gk(),r=F(n);$(F(r),{name:`file-text`,size:15}),D(r);var i=R(r,2),a=L(i,!0);D(n),z(()=>{J(i,`title`,t.item.path),W(a,B(l))}),V(`click`,i,u),U(e,n)};G(y,e=>{t.item.path&&e(b)});var x=R(y,2),S=e=>{var t=_k();V(`click`,t,c),U(e,t)};G(x,e=>{t.item.taskId&&!t.item.path&&e(S)});var C=R(x,2),w=e=>{var n=vk(),r=F(n);{let e=j(()=>(t.item.description||``)+` -`+(t.item.preview||``));XO(r,{targetKind:`deliverable`,get targetId(){return t.item.deliverableId},get content(){return B(e)},get request(){return B(o)},get current(){return t.item.feedback}})}D(n),U(e,n)};G(C,e=>{t.item.deliverableId&&e(w)}),D(d),z(()=>W(m,` Deliverable produced — ${t.item.description??``}`)),U(e,d),k(),a()}ki([`click`]);var xk=H(`
 
`),Sk=H(` `,1),Ck=H(``),wk=H(`
`),Tk=H(`
`,1),Ek=H(``),Dk=H(`
`);function Ok(e,t){O(t,!0);let n=()=>A(Vo,`$runInfo`,r),[r,i]=Zt(),a=new Set([`completed`,`failed`,`cancelled`]),o=M(``),s=M(!1);function c(e){nx(t.item.inquiryId,e)}function l(){B(o).trim()&&(nx(t.item.inquiryId,B(o).trim()),N(o,``))}let u=j(()=>!!n()&&a.has(n().status)),d=j(()=>!!t.item.resolved||B(u)),f=j(()=>t.item.resolution||(t.item.resolved?`answered`:B(d)?`unanswered`:null)),p={answered:`You answered`,expired:`Expired · not answered in time`,cancelled:`Cancelled · task ended`,unanswered:`Not answered`},m=j(()=>B(f)?p[B(f)]:t.item.qkind===`permission`?`Permission · needs your call`:`Needs your answer`),h=j(()=>B(f)===`answered`&&!!t.item.answer);var g=Dk();let _;var v=F(g),y=R(F(v));D(v);var b=R(v,2),x=L(b,!0),S=R(b,2),C=e=>{var n=Bi(),r=I(n),i=e=>{var n=Sk(),r=I(n),i=L(r,!0),a=R(r,2),o=e=>{var n=xk(),r=L(n,!0);z(()=>W(r,t.item.detail)),U(e,n)};G(a,e=>{B(s)&&e(o)}),z(()=>W(i,B(s)?`Hide details`:`Show details`)),V(`click`,r,()=>N(s,!B(s))),U(e,n)},a=e=>{var n=xk(),r=L(n,!0);z(()=>W(r,t.item.detail)),U(e,n)};G(r,e=>{B(d)?e(i):e(a,-1)}),U(e,n)};G(S,e=>{t.item.detail&&e(C)});var w=R(S,2),T=e=>{var n=Tk(),r=I(n);K(r,21,()=>t.item.options,Qi,(e,n)=>{var r=Ck();let i;var a=L(r,!0);z(()=>{i=q(r,1,`chip svelte-29lwde`,null,i,{picked:B(h)&&t.item.answer===B(n)}),r.disabled=B(d),W(a,B(n))}),V(`click`,r,()=>c(B(n))),U(e,r)}),D(r);var i=R(r,2),a=e=>{var n=wk(),r=L(n);z(()=>W(r,`→ ${t.item.answer??``}`)),U(e,n)},o=j(()=>B(h)&&!t.item.options.includes(t.item.answer??``));G(i,e=>{B(o)&&e(a)}),U(e,n)},ee=e=>{var n=wk(),r=L(n);z(()=>W(r,`→ ${t.item.answer??``}`)),U(e,n)},te=e=>{var t=Ek();za(t),V(`keydown`,t,e=>e.key===`Enter`&&l()),qa(t,()=>B(o),e=>N(o,e)),U(e,t)};G(w,e=>{t.item.options&&t.item.options.length?e(T):B(h)?e(ee,1):B(d)||e(te,2)}),D(g),z(()=>{_=q(g,1,`choice svelte-29lwde`,null,_,{resolved:B(d),unanswered:B(d)&&!B(h)}),W(y,` ${B(m)??``}`),W(x,t.item.question)}),U(e,g),k(),i()}ki([`click`,`keydown`]);var kk=H(` `),Ak=H(` `),jk=H(`
`),Mk=H(`
`),Nk=H(`
`),Pk=H(` `,1),Fk=H(`
`),Ik=H(`
`);function Lk(e,t){O(t,!0);let n=j(()=>`${(t.item.agent||`subagent`).replace(/[-_]/g,` `)} (subagent)`),r=j(()=>t.item.items||[]),i=j(()=>(t.item.status||`running`)===`running`),a=M(!1),o=M(!0);hr(()=>{B(a)||N(o,B(i),!0)});let s=()=>{N(a,!0),N(o,!B(o))};var c=Ik(),l=F(c),u=R(F(l),2),d=L(u,!0),f=R(u,2),p=e=>{var t=kk(),n=L(t,!0);z(()=>W(n,B(r).length)),U(e,t)};G(f,e=>{B(r).length&&e(p)});var m=R(f,2),h=e=>{var n=Ak(),r=L(n,!0);z(e=>W(r,e),[()=>gy(t.item.at)]),U(e,n)};G(m,e=>{t.item.at&&e(h)});var g=R(m,2),_=L(g,!0),v=L(R(g,2),!0);D(l);var y=R(l,2),b=e=>{var n=jk(),r=L(n,!0);z(()=>W(r,t.item.objective)),U(e,n)};G(y,e=>{t.item.objective&&e(b)});var x=R(y,2),S=e=>{var n=Pk(),i=I(n),a=e=>{var t=Mk();K(t,21,()=>B(r),e=>e.id,(e,t)=>{Oj(e,{get item(){return B(t)}})}),D(t),U(e,t)};G(i,e=>{B(r).length&&e(a)});var o=R(i,2),s=e=>{var n=Nk(),r=L(n,!0);z(()=>W(r,t.item.result)),U(e,n)};G(o,e=>{t.item.result&&e(s)}),U(e,n)};G(x,e=>{B(o)&&e(S)});var C=R(x,2),w=e=>{var n=Fk(),r=L(n,!0);z(()=>W(r,t.item.error)),U(e,n)};G(C,e=>{t.item.error&&e(w)}),D(c),z(()=>{q(c,1,`subagent ${t.item.status||`running`}`),W(d,B(n)),W(_,t.item.status||`running`),W(v,B(o)?`▾`:`▸`)}),V(`click`,l,s),V(`keydown`,l,e=>(e.key===`Enter`||e.key===` `)&&s()),U(e,c),k()}ki([`click`,`keydown`]);var Rk=H(` `),zk=H(`
`);function Bk(e,t){O(t,!0);var n=zk();let r;var i=F(n),a=e=>{$(e,{get name(){return t.item.icon},size:14})};G(i,e=>{t.item.icon&&e(a)});var o=R(i),s=R(o),c=e=>{var n=Rk(),r=L(n,!0);z(e=>W(r,e),[()=>gy(t.item.at)]),U(e,n)};G(s,e=>{t.item.at&&e(c)}),D(n),z(()=>{r=q(n,1,`note`,null,r,{alert:t.item.alert,withicon:t.item.icon,pending:t.item.pending}),W(o,`${t.item.text??``} `)}),U(e,n),k()}var Vk=H(``),Hk=H(``),Uk=H(`
`),Wk=H(`
`);function Gk(e,t){O(t,!0);let n=()=>A(Fo,`$thread`,i),r=()=>A(Vo,`$runInfo`,i),[i,a]=Zt(),o=()=>Hs(t.item.path),s=j(()=>GO(n().items,t.item,r())),c=M(!1);var l=Wk(),u=F(l),d=e=>{var n=Vk(),r=F(n);$(r,{name:`image-off`,size:14});var i=R(r);D(n),z(()=>{J(n,`title`,t.item.path),W(i,` ${t.item.path??``}`)}),V(`click`,n,o),U(e,n)},f=e=>{var n=Hk(),r=L(n);z(e=>{J(n,`title`,t.item.prompt||``),J(r,`src`,e),J(r,`alt`,t.item.prompt||`generated image`)},[()=>Q.fileUrl(t.item.path)]),V(`click`,n,o),Oi(`error`,r,()=>N(c,!0)),Ei(r),U(e,n)};G(u,e=>{B(c)?e(d):e(f,-1)});var p=R(u,2),m=e=>{var n=Uk(),r=F(n);{let e=j(()=>`Generated image — prompt: `+(t.item.prompt||``));XO(r,{targetKind:`image`,get targetId(){return t.item.path},get content(){return B(e)},get request(){return B(s)},get current(){return t.item.feedback}})}D(n),U(e,n)};G(p,e=>{t.item.path&&e(m)}),D(l),U(e,l),k(),a()}ki([`click`]);var Kk=H(``),qk=H(``),Jk=H(`
You shared
`);function Yk(e,t){O(t,!0);let n=j(()=>FC(t.item.name||t.item.path)===`image`),r=()=>Hs(t.item.path),i=M(!1);var a=Jk(),o=R(F(a),2),s=e=>{var n=Kk(),a=L(n);z(e=>{J(n,`title`,t.item.name),J(n,`aria-label`,`Open ${(t.item.name||t.item.path)??``}`),J(a,`src`,e),J(a,`alt`,t.item.name)},[()=>Q.fileUrl(t.item.path)]),V(`click`,n,r),Oi(`error`,a,()=>N(i,!0)),Ei(a),U(e,n)},c=e=>{var n=qk(),a=F(n);{let e=j(()=>B(i)?`image-off`:`paperclip`);$(a,{get name(){return B(e)},size:14})}var o=R(a);D(n),z(()=>{J(n,`title`,t.item.path),W(o,` ${(B(i)?t.item.path:t.item.name||t.item.path)??``}`)}),V(`click`,n,r),U(e,n)};G(o,e=>{B(n)&&!B(i)?e(s):e(c,-1)}),D(a),U(e,a),k()}ki([`click`]);var Xk=H(``),Zk=H(``);function Qk(e,t){O(t,!0);let n=()=>A(Bo,`$knownThings`,r),[r,i]=Zt(),a=ro(t,`data`,19,()=>({})),o=ro(t,`scope`,3,``),s=j(()=>Vy(t.component,a(),o(),n()));function c(){B(s)&&(B(s).kind===`task`?Fs(`/t/`+B(s).value):B(s).kind===`chat`?Fs(`/c/`+B(s).value):B(s).kind===`file`?Hs(B(s).value):B(s).kind===`folder`&&Qo(B(s).value))}var l=Bi(),u=I(l),d=e=>{var n=Bi();ca(I(n),()=>t.children),U(e,n)},f=e=>{var n=Xk();let r;ca(F(n),()=>t.children),D(n),z(()=>{J(n,`href`,B(s).value),r=xa(n,``,r,{"flex-grow":t.grow})}),U(e,n)},p=e=>{var n=Zk();let r;ca(F(n),()=>t.children),D(n),z(()=>r=xa(n,``,r,{"flex-grow":t.grow})),V(`click`,n,c),U(e,n)};G(u,e=>{B(s)?B(s).kind===`url`?e(f,1):e(p,-1):e(d)}),U(e,l),k(),i()}ki([`click`]);var $k=[`sunny`,`partly-cloudy`,`cloudy`,`foggy`,`rainy`,`thunderstorm`,`snow`,`windy`];function eA(e){let t=String(e??``).trim().toLowerCase();return $k.includes(t)?t:`cloudy`}var tA=Ri(``),nA=Ri(``),rA=Ri(``),iA=Ri(``),aA=Ri(``,1),oA=Ri(``),sA=Ri(``),cA=Ri(``),lA=Ri(``),uA=Ri(``),dA=Ri(``,1),fA=Ri(``),pA=Ri(``,1),mA=Ri(``),hA=Ri(``),gA=H(``);function _A(e,t){let n=ro(t,`condition`,3,`cloudy`);var r=gA(),i=F(r),a=e=>{U(e,tA())},o=e=>{U(e,nA())},s=e=>{U(e,rA())},c=e=>{U(e,iA())},l=e=>{var t=cA(),r=F(t),i=F(r);K(i,20,()=>[0,1],Qi,(e,t)=>{var r=oA();K(r,20,()=>[4,18,32,46,60,74,88],Qi,(e,t,r)=>{var i=aA(),a=I(i);J(a,`y1`,r%3*8),J(a,`y2`,r%3*8+14);var o=R(a);J(o,`y1`,r%3*8+30),J(o,`y2`,r%3*8+44),z(()=>{J(a,`x1`,t),J(a,`x2`,t),J(a,`stroke`,n()===`thunderstorm`?`#9fb1c8`:`#a9bdd6`),J(o,`x1`,t+7),J(o,`x2`,t+7),J(o,`stroke`,n()===`thunderstorm`?`#9fb1c8`:`#a9bdd6`)}),U(e,i)}),D(r),z(()=>J(r,`transform`,`translate(0 ${t*-60})`)),U(e,r)}),D(i),D(r);var a=R(r),o=e=>{U(e,sA())};G(a,e=>{n()===`thunderstorm`&&e(o)}),D(t),U(e,t)},u=e=>{var t=uA(),n=F(t);K(n,20,()=>[0,1],Qi,(e,t)=>{var n=oA();K(n,20,()=>[[8,10,3],[30,34,2.4],[52,6,3.4],[74,46,2.2],[92,22,3],[18,66,2.6],[44,82,3.2],[66,70,2.4],[86,88,2.8],[58,40,2]],Qi,(e,t)=>{var n=j(()=>pe(t,3));let r=()=>B(n)[0],i=()=>B(n)[1],a=()=>B(n)[2];var o=lA();z(()=>{J(o,`cx`,r()),J(o,`cy`,i()),J(o,`r`,a())}),U(e,o)}),D(n),z(()=>J(n,`transform`,`translate(0 ${t*-100})`)),U(e,n)}),D(n),D(t),U(e,t)},d=e=>{var t=mA(),n=F(t),r=F(n);K(r,20,()=>[0,1],Qi,(e,t)=>{var n=dA(),r=I(n),i=R(r);z(()=>{J(r,`x1`,t*120),J(r,`x2`,t*120+46),J(i,`x1`,t*120+66),J(i,`x2`,t*120+96)}),U(e,n)}),D(r),D(n);var i=R(n),a=F(i);K(a,20,()=>[0,1],Qi,(e,t)=>{var n=fA();z(()=>{J(n,`x1`,t*120+20),J(n,`x2`,t*120+84)}),U(e,n)}),D(a),D(i);var o=R(i),s=F(o);K(s,20,()=>[0,1],Qi,(e,t)=>{var n=pA(),r=I(n),i=R(r);z(()=>{J(r,`x1`,t*120+8),J(r,`x2`,t*120+52),J(i,`x1`,t*120+70),J(i,`x2`,t*120+104)}),U(e,n)}),D(s),D(o),D(t),U(e,t)},f=e=>{U(e,hA())};G(i,e=>{n()===`sunny`?e(a):n()===`partly-cloudy`?e(o,1):n()===`cloudy`?e(s,2):n()===`foggy`?e(c,3):n()===`rainy`||n()===`thunderstorm`?e(l,4):n()===`snow`?e(u,5):n()===`windy`?e(d,6):e(f,-1)}),D(r),z(()=>q(r,1,`g g-${n()??``}`,`svelte-1oq623z`)),U(e,r)}var vA=`modulepreload`,yA=function(e){return`/app/`+e},bA={},xA=function(e,t,n){let r=Promise.resolve();if(t&&t.length>0){let e=document.getElementsByTagName(`link`),i=document.querySelector(`meta[property=csp-nonce]`),a=i?.nonce||i?.getAttribute(`nonce`);function o(e){return Promise.all(e.map(e=>Promise.resolve(e).then(e=>({status:`fulfilled`,value:e}),e=>({status:`rejected`,reason:e}))))}function s(e){return import.meta.resolve?import.meta.resolve(e):new URL(e,import.meta.url).href}r=o(t.map(t=>{if(t=yA(t,n),t=s(t),t in bA)return;bA[t]=!0;let r=t.endsWith(`.css`);for(let n=e.length-1;n>=0;n--){let i=e[n];if(i.href===t&&(!r||i.rel===`stylesheet`))return}let i=document.createElement(`link`);if(i.rel=r?`stylesheet`:vA,r||(i.as=`script`),i.crossOrigin=``,i.href=t,a&&i.setAttribute(`nonce`,a),document.head.appendChild(i),r)return new Promise((e,n)=>{i.addEventListener(`load`,e),i.addEventListener(`error`,()=>n(Error(`Unable to preload CSS for ${t}`)))})}))}function i(e){let t=new Event(`vite:preloadError`,{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e}return r.then(t=>{for(let e of t||[])e.status===`rejected`&&i(e.reason);return e().catch(i)})},SA=H(``),CA=H(``),wA=H(`
`),TA=H(` `,1),EA=H(`
`);function DA(e,t){O(t,!0);let n=()=>A(ls,`$animations`,r),[r,i]=Zt(),a=ro(t,`condition`,3,`cloudy`),o=ro(t,`temperatureText`,3,``),s=ro(t,`flush`,3,!1),c=ro(t,`zoom`,3,1),l=j(()=>eA(a())),u=typeof navigator<`u`&&`gpu`in navigator&&!!navigator.gpu,d=j(()=>n()===`high`&&!u?`basic`:n()),f={sunny:`☀️`,"partly-cloudy":`⛅`,cloudy:`☁️`,foggy:`🌫️`,rainy:`🌧️`,thunderstorm:`⛈️`,snow:`🌨️`,windy:`💨`},p=[`rainy`,`thunderstorm`],m=M(void 0),h=M(!1);hr(()=>{if(!B(m))return;let e=!1,t=null;return(async()=>{try{let n=await xA(()=>import(`./engine-B_l1UeVO.js`),[]);if(!n.supportsWebGPU())return;if(t=await n.createBanner(B(m),B(l),{temperatureText:o(),zoom:c()}),e){t.dispose(),t=null;return}N(h,!0)}catch{N(h,!1)}})(),()=>{e=!0,N(h,!1),t&&t.dispose()}});var g=EA();let _;var v=F(g),y=e=>{var t=SA();Qa(t,e=>N(m,e),()=>B(m)),U(e,t)},b=e=>{var t=TA(),n=I(t),r=e=>{_A(e,{get condition(){return B(l)}})},i=e=>{var t=CA(),n=L(t,!0);z(()=>W(n,f[B(l)])),U(e,t)};G(n,e=>{B(d)===`basic`?e(r):e(i,-1)});var a=R(n,2),s=e=>{var t=wA();let n;var r=L(t,!0);z(e=>{n=q(t,1,`wx-temp svelte-1y4wig5`,null,n,{"wx-temp-light":e}),W(r,o())},[()=>p.includes(B(l))]),U(e,t)};G(a,e=>{o()&&e(s)}),U(e,t)};G(v,e=>{B(d)===`high`?e(y):e(b,-1)}),D(g),z(()=>_=q(g,1,`wx-banner wx-${B(l)??``}`,`svelte-1y4wig5`,_,{"wx-live":B(h),"wx-flush":s()})),U(e,g),k(),i()}var OA=H(`
`),kA=H(`
`),AA=H(`
`),jA=H(` `),MA=H(` `),NA=H(`
`),PA=H(`
`),FA=H(``),IA=Ri(``),LA=Ri(``),RA=H(`
`),zA=H(` `,1),BA=H(`
`),VA=H(`—`),HA=H(`●`),UA=H(`
`),WA=H(`
`),GA=H(``),KA=H(``),qA=H(``),JA=H(``),YA=H(`
`),XA=H(`
`),ZA=H(` `),QA=H(`
`),$A=H(``),ej=H(``),tj=H(``,2),nj=H(``),rj=H(``),ij=H(``),aj=H(` `),oj=H(``),sj=H(`
`),cj=H(``),lj=H(``),uj=H(`
This view could not be drawn.
`);function dj(e,t){O(t,!0);let n=e=>{var n=Bi();K(I(n),17,()=>Oy(t.component.children,i(),s()),Qi,(e,t)=>{let n=j(()=>f(B(t).id));var s=Bi(),l=I(s),u=e=>{{let s=j(()=>c()+1);dj(e,{get component(){return B(n)},get components(){return r()},get data(){return i()},get onDataChange(){return a()},get onAction(){return o()},get scope(){return B(t).scope},get depth(){return B(s)}})}};G(l,e=>{B(n)&&e(u)}),U(e,s)}),U(e,n)},r=ro(t,`components`,19,()=>[]),i=ro(t,`data`,19,()=>({})),a=ro(t,`onDataChange`,3,()=>{}),o=ro(t,`onAction`,3,()=>{}),s=ro(t,`scope`,3,``),c=ro(t,`depth`,3,0),l=j(()=>(t.component.component||`Text`).toLowerCase()),u=j(()=>new Map(r().filter(e=>e&&e.id).map(e=>[e.id,e])));function d(e){return db(e)}function f(e){return typeof e==`string`?B(u).get(e):void 0}let p=j(()=>!!Dy(t.component.value,i(),s())),m=j(()=>hb(t.component.value,s()));function h(e){B(m)&&a()(B(m),e.currentTarget.checked)}let g=j(()=>hb(t.component.value,s())),_=j(()=>Dy(t.component.value,i(),s())??``),v=j(()=>Array.isArray(B(_))?``:String(B(_)??``)),y=j(()=>t.component.steps?(Number(t.component.max)-Number(t.component.min||0))/Number(t.component.steps):void 0),b=e=>e==null||e===``?void 0:Number(e),x={accountCircle:`users`,add:`plus`,arrowBack:`chevron-left`,arrowForward:`chevron-right`,attachFile:`paperclip`,calendarToday:`clock`,close:`x`,delete:`trash`,event:`clock`,favorite:`thumbs-up`,folder:`folder`,play:`send`,refresh:`rotate-cw`,send:`send`,settings:`settings`,stop:`square`,warning:`alert-triangle`},S=j(()=>Ry(t.component,i(),s())),C=j(()=>x[B(S)]||B(S)),w=j(()=>ub(Dy(t.component.name,i(),s()))),T={sm:14,md:22,lg:28},ee=j(()=>String(Dy(t.component.url,i(),s())??``)),te=j(()=>oe(B(ee)));function ne(e){B(g)&&a()(B(g),e.currentTarget.value)}function re(e){B(g)&&a()(B(g),Number(e.currentTarget.value))}function ie(e){if(!B(g))return;let n=e.currentTarget.value;a()(B(g),t.component.enableDate&&t.component.enableTime&&n?new Date(n).toISOString():n)}function ae(e,n){if(!B(g))return;let r=Array.isArray(B(_))?B(_):[],i=t.component.variant===`multipleSelection`?n?[...new Set([...r,e])]:r.filter(t=>t!==e):[e];a()(B(g),i)}function oe(e){try{let t=new URL(e),n=t.hostname.replace(/^www\./,``).toLowerCase(),r=t.pathname.split(`/`).filter(Boolean),i=n===`youtu.be`?r[0]:n===`youtube.com`||n===`youtube-nocookie.com`?r[0]===`embed`||r[0]===`shorts`?r[1]:t.searchParams.get(`v`):``;return i&&/^[\w-]{6,}$/.test(i)?`https://www.youtube.com/embed/${i}`:``}catch{return``}}let se={start:`flex-start`,center:`center`,end:`flex-end`,stretch:`stretch`},ce=j(()=>se[String(t.component.align??``)]||void 0),le={none:`0`,xs:`var(--space-2)`,sm:`var(--space-3)`,md:`var(--space-5)`,lg:`var(--space-7)`},ue=j(()=>le[String(t.component.gap??``)]||void 0),de={start:`flex-start`,center:`center`,end:`flex-end`,between:`space-between`},fe=j(()=>de[String(t.component.justify??``)]||void 0),E=j(()=>t.component.grow===!0?1:void 0),pe=j(()=>Py(t.component.tone,i(),s())),me=j(()=>t.component.tone===void 0?``:`a2ui-tone-${B(pe)}`),he=j(()=>Fy(t.component.when,i(),s())),ge=j(()=>t.component.marker!==void 0&&Fy(t.component.marker,i(),s())),_e=j(()=>B(ge)?`a2ui-marker a2ui-tone-${B(pe)}`:``),ve=j(()=>t.component.variant===`ranked`),ye=j(()=>jy(t.component.children)),be=[`h1`,`h2`,`h3`,`h4`,`body`,`caption`,`eyebrow`,`quote`,`pill`,`badge`,`code`],xe=j(()=>be.includes(String(t.component.variant??``))?String(t.component.variant):``),Se=j(()=>Ly(t.component,i(),s())),Ce=j(()=>qy(t.component,i(),s())),we=j(()=>ub(Dy(t.component.label,i(),s()))),Te=j(()=>[`sm`,`md`,`lg`].includes(String(t.component.size??``))?String(t.component.size):`md`),Ee={sm:{w:78,h:30,dot:2.2},md:{w:160,h:56,dot:2.6},lg:{w:300,h:120,dot:3}},De=j(()=>Ee[B(Te)]),Oe=j(()=>Uy(Dy(t.component.values,i(),s()),B(De).w,B(De).h)),ke=j(()=>ky(t.component.columns,i(),s())),Ae=j(()=>ky(t.component.rows,i(),s())),je=j(()=>Ay(t.component.key,t.component.pick,i(),B(ke),s())),Me=j(()=>f(t.component.lead)),Ne=j(()=>`${B(Me)?`minmax(118px, .9fr) `:``}repeat(${B(ke).length}, minmax(94px, 1fr))`);function Pe(){let e=t.component.action?.event;e?.name&&o()({name:e.name,sourceComponentId:t.component.id,context:mb(e.context||{},i(),s())})}var Fe=Bi(),Ie=I(Fe),Le=e=>{},Re=e=>{},ze=e=>{var t=OA();let r;var i=F(t);n(i),D(t),z(()=>{q(t,1,`a2ui-basic-col ${B(_e)??``}`),r=xa(t,``,r,{"align-items":B(ce),"justify-content":B(fe),gap:B(ue),"flex-grow":B(E)})}),U(e,t)},Be=e=>{var t=OA();let r;var i=F(t);n(i),D(t),z(()=>{q(t,1,`a2ui-basic-row ${B(_e)??``}`),r=xa(t,``,r,{"align-items":B(ce),"justify-content":B(fe),gap:B(ue),"flex-grow":B(E)})}),U(e,t)},Ve=e=>{var t=OA();let r,i;var a=F(t);n(a),D(t),z(()=>{r=q(t,1,`a2ui-list ${B(_e)??``}`,null,r,{"a2ui-ranked":B(ve)}),i=xa(t,``,i,{"align-items":B(ce),"justify-content":B(fe),gap:B(ue),"flex-grow":B(E),"--a2ui-rank-from":B(ye)})}),U(e,t)},He=e=>{let n=j(()=>f(t.component.child));var l=OA();let u,d;var p=F(l),m=e=>{{let t=j(()=>c()+1);dj(e,{get component(){return B(n)},get components(){return r()},get data(){return i()},get onDataChange(){return a()},get onAction(){return o()},get scope(){return s()},get depth(){return B(t)}})}};G(p,e=>{B(n)&&e(m)}),D(l),z(()=>{u=q(l,1,`a2ui-basic-card ${B(_e)??``}`,null,u,{"a2ui-feature":t.component.variant===`feature`}),d=xa(l,``,d,{"flex-grow":B(E)})}),U(e,l)},Ue=e=>{let n=j(()=>f(t.component.child));Qk(e,{get component(){return t.component},get data(){return i()},get scope(){return s()},get grow(){return B(E)},children:(e,t)=>{var l=Bi(),u=I(l),d=e=>{{let t=j(()=>c()+1);dj(e,{get component(){return B(n)},get components(){return r()},get data(){return i()},get onDataChange(){return a()},get onAction(){return o()},get scope(){return s()},get depth(){return B(t)}})}};G(u,e=>{B(n)&&e(d)}),U(e,l)},$$slots:{default:!0}})},We=e=>{var n=Bi(),r=I(n),i=e=>{var n=kA();let r,i;var a=L(n,!0);z(()=>{r=q(n,1,`a2ui-text a2ui-tone-${B(pe)??``} ${B(xe)?`a2ui-t-${B(xe)}`:``}`,null,r,{"a2ui-main":!B(xe)&&t.component.variant&&t.component.variant!==`body`,"a2ui-strong":t.component.emphasis===`strong`}),i=xa(n,``,i,{"flex-grow":B(E)}),W(a,B(Se))}),U(e,n)};G(r,e=>{B(Se)&&e(i)}),U(e,n)},Ge=e=>{var n=Bi(),r=I(n),i=e=>{var n=PA();let r,i;var a=F(n),o=e=>{var t=AA(),n=L(t,!0);z(()=>W(n,B(we))),U(e,t)};G(a,e=>{B(we)&&e(o)});var s=R(a,2),c=F(s,!0),l=R(c),u=e=>{var t=jA(),n=L(t,!0);z(()=>W(n,B(Ce).unit)),U(e,t)};G(l,e=>{B(Ce).unit&&e(u)}),D(s);var d=R(s,2),f=e=>{var t=NA(),n=F(t),r=e=>{var t=MA(),n=L(t,!0);z(()=>W(n,B(Ce).arrow)),U(e,t)};G(n,e=>{B(Ce).arrow&&e(r)});var i=R(n,1,!0);D(t),z(()=>{q(t,1,`a2ui-metric-delta a2ui-tone-${B(pe)??``}`),W(i,B(Ce).delta)}),U(e,t)};G(d,e=>{B(Ce).delta&&e(f)}),D(n),z(()=>{r=q(n,1,`a2ui-metric a2ui-metric-${B(Te)??``}`,null,r,{end:t.component.align===`end`}),i=xa(n,``,i,{"flex-grow":B(E)}),W(c,B(Ce).value)}),U(e,n)};G(r,e=>{(B(Ce).value||B(Ce).delta)&&e(i)}),U(e,n)},Ke=e=>{var t=Bi(),n=I(t),r=e=>{var t=FA();z(()=>q(t,1,`a2ui-spark a2ui-spark-${B(Te)??``}`)),U(e,t)},i=e=>{var t=LA();let n;var r=F(t),i=e=>{var t=IA();z(()=>J(t,`d`,B(Oe).area)),U(e,t)};G(r,e=>{B(Te)===`lg`&&e(i)});var a=R(r),o=R(a);D(t),z(()=>{q(t,0,`a2ui-spark a2ui-spark-${B(Te)??``} a2ui-tone-${B(pe)??``}`),J(t,`viewBox`,`0 0 ${B(De).w??``} ${B(De).h??``}`),n=xa(t,``,n,{"flex-grow":B(E)}),J(a,`d`,B(Oe).line),J(o,`cx`,B(Oe).endX),J(o,`cy`,B(Oe).endY),J(o,`r`,B(De).dot)}),U(e,t)};G(n,e=>{!B(Oe)&&B(Te)!==`lg`?e(r):B(Oe)&&e(i,1)}),U(e,t)},qe=e=>{let n=j(()=>f(t.component.header)),s=j(()=>f(t.component.cell));var l=Bi(),u=I(l),d=e=>{var l=WA();let u;var d=F(l);let f;var p=F(d),m=e=>{var t=zA(),s=I(t),l=e=>{U(e,RA())};G(s,e=>{B(Me)&&e(l)}),K(R(s,2),17,()=>B(ke),Qi,(e,t,s)=>{var l=OA();let u;var d=F(l);{let e=j(()=>c()+1);dj(d,{get component(){return B(n)},get components(){return r()},get data(){return i()},get onDataChange(){return a()},get onAction(){return o()},get scope(){return B(t)},get depth(){return B(e)}})}D(l),z(()=>u=q(l,1,`a2ui-th`,null,u,{pick:s===B(je)})),U(e,l)}),U(e,t)};G(p,e=>{B(n)&&e(m)}),K(R(p,2),17,()=>B(Ae),Qi,(e,n)=>{let l=j(()=>ky(t.component.cells,i(),B(n))),u=j(()=>Ay(t.component.key,t.component.win,i(),B(ke),B(n)));var d=zA(),f=I(d),p=e=>{var t=BA(),s=F(t);{let e=j(()=>c()+1);dj(s,{get component(){return B(Me)},get components(){return r()},get data(){return i()},get onDataChange(){return a()},get onAction(){return o()},get scope(){return B(n)},get depth(){return B(e)}})}D(t),U(e,t)};G(f,e=>{B(Me)&&e(p)}),K(R(f,2),17,()=>B(ke),Qi,(e,t,n)=>{var d=UA();let f;var p=F(d),m=e=>{{let t=j(()=>c()+1);dj(e,{get component(){return B(s)},get components(){return r()},get data(){return i()},get onDataChange(){return a()},get onAction(){return o()},get scope(){return B(l)[n]},get depth(){return B(t)}})}},h=e=>{U(e,VA())};G(p,e=>{B(s)&&B(l)[n]!==void 0?e(m):e(h,-1)});var g=R(p,2),_=e=>{U(e,HA())};G(g,e=>{n===B(u)&&e(_)}),D(d),z(()=>f=q(d,1,`a2ui-td`,null,f,{pick:n===B(je),win:n===B(u)})),U(e,d)}),U(e,d)}),D(d),D(l),z(()=>{u=xa(l,``,u,{"flex-grow":B(E)}),f=xa(d,``,f,{"grid-template-columns":B(Ne)})}),U(e,l)};G(u,e=>{B(ke).length&&e(d)}),U(e,l)},Je=e=>{var n=GA();let r;z(()=>r=q(n,1,`a2ui-divider`,null,r,{strong:t.component.emphasis===`strong`})),U(e,n)},Ye=e=>{var n=KA(),r=F(n);za(r);var a=L(R(r,2),!0);D(n),z(e=>{Va(r,B(p)),W(a,e)},[()=>Dy(t.component.label,i(),s())||``]),V(`change`,r,h),U(e,n)},Xe=e=>{var n=qA();let r;var a=L(n,!0);z(e=>{r=q(n,1,`a2ui-button`,null,r,{primary:t.component.variant===`primary`}),W(a,e)},[()=>Dy(f(t.component.child)?.text,i(),s())||`Continue`]),V(`click`,n,Pe),U(e,n)},Ze=e=>{var n=JA();let r;z((e,i)=>{q(n,1,`a2ui-image ${(t.component.variant||``)??``}`),J(n,`src`,e),J(n,`alt`,i),r=xa(n,``,r,{"object-fit":t.component.fit===`scaleDown`?`scale-down`:t.component.fit||`contain`})},[()=>String(Dy(t.component.url,i(),s())??``),()=>String(Dy(t.component.description,i(),s())??``)]),U(e,n)},Qe=e=>{let n=j(()=>String(Dy(t.component.url,i(),s())??``)),r=j(()=>ub(Dy(t.component.caption,i(),s())));var a=Bi(),o=I(a),c=e=>{var a=XA();let o;var c=F(a),l=R(c,2),u=e=>{var t=YA(),n=L(t,!0);z(()=>W(n,B(r))),U(e,t)};G(l,e=>{B(r)&&e(u)}),D(a),z(e=>{q(a,1,`a2ui-figure a2ui-figure-${B(Te)??``}`),o=xa(a,``,o,{"flex-grow":B(E)}),J(c,`src`,B(n)),J(c,`alt`,e)},[()=>String(Dy(t.component.description,i(),s())??``)]),U(e,a)};G(o,e=>{B(n)&&e(c)}),U(e,a)},$e=e=>{let n=j(()=>Hy(Dy(t.component.hunks,i(),s())));var r=Bi(),a=I(r),o=e=>{var t=QA();let r;K(t,21,()=>B(n),Qi,(e,t)=>{var n=ZA(),r=L(n,!0);z(()=>{q(n,1,`a2ui-diff-line ${B(t).kind??``}`),W(r,B(t).text)}),U(e,n)}),D(t),z(()=>r=xa(t,``,r,{"flex-grow":B(E)})),U(e,t)};G(a,e=>{B(n).length&&e(o)}),U(e,r)},et=e=>{var n=OA();let r;Zi(F(n),()=>Dy(t.component.condition,i(),s()),e=>{{let n=j(()=>Dy(t.component.condition,i(),s())),r=j(()=>ub(Dy(t.component.temperature,i(),s())));DA(e,{get condition(){return B(n)},get temperatureText(){return B(r)},zoom:1.3,flush:!0})}}),D(n),z(()=>{q(n,1,`a2ui-glyph a2ui-glyph-${B(Te)??``}`),r=xa(n,``,r,{"flex-grow":B(E)})}),U(e,n)},tt=e=>{var t=$A();$(F(t),{get name(){return B(C)},get size(){return T[B(Te)]}}),D(t),z(()=>{q(t,1,`a2ui-icon ${B(me)??``}`),J(t,`title`,B(w))}),U(e,t)},nt=e=>{var n=Bi(),r=I(n),a=e=>{var t=ej();z(()=>J(t,`src`,B(te))),U(e,t)},o=e=>{var n=tj();z(e=>{J(n,`src`,B(ee)),J(n,`poster`,e)},[()=>String(Dy(t.component.posterUrl,i(),s())??``)||void 0]),U(e,n)};G(r,e=>{B(te)?e(a):e(o,-1)}),U(e,n)},rt=e=>{var n=ij(),r=F(n),a=L(r,!0),o=R(r,2),c=e=>{var n=nj();tn(n),z(e=>{Ba(n,B(v)),J(n,`placeholder`,e)},[()=>String(Dy(t.component.placeholder,i(),s())??``)]),V(`input`,n,ne),U(e,n)},l=e=>{var n=rj();za(n),z(e=>{J(n,`type`,t.component.variant===`number`?`number`:t.component.variant===`obscured`?`password`:`text`),Ba(n,B(v)),J(n,`placeholder`,e)},[()=>String(Dy(t.component.placeholder,i(),s())??``)]),V(`input`,n,ne),U(e,n)};G(o,e=>{t.component.variant===`longText`?e(c):e(l,-1)}),D(n),z(e=>W(a,e),[()=>Dy(t.component.label,i(),s())||``]),U(e,n)},it=e=>{var n=sj(),r=F(n),a=e=>{var n=aj(),r=L(n,!0);z(e=>W(r,e),[()=>Dy(t.component.label,i(),s())]),U(e,n)};G(r,e=>{t.component.label&&e(a)});var o=R(r,2);let c;K(o,21,()=>d(t.component.options),Qi,(e,n)=>{let r=j(()=>Array.isArray(B(_))&&B(_).includes(B(n).value));var a=oj(),o=F(a);za(o);var c=L(R(o,2),!0);D(a),z(e=>{J(o,`type`,t.component.variant===`multipleSelection`?`checkbox`:`radio`),J(o,`name`,(t.component.id||``)+s()),Va(o,B(r)),W(c,e)},[()=>Dy(B(n).label,i(),s())||B(n).value]),V(`change`,o,e=>ae(B(n).value,e.currentTarget.checked)),U(e,a)}),D(o),D(n),z(()=>c=q(o,1,``,null,c,{chips:t.component.displayStyle===`chips`})),U(e,n)},at=e=>{var n=cj(),r=F(n),a=e=>{var n=ZA(),r=L(n,!0);z(e=>W(r,e),[()=>Dy(t.component.label,i(),s())]),U(e,n)};G(r,e=>{t.component.label&&e(a)});var o=R(r,2);za(o);var c=L(R(o,2),!0);D(n),z((e,t)=>{J(o,`min`,e),J(o,`max`,t),J(o,`step`,B(y)),Ba(o,B(v)),W(c,B(v))},[()=>b(t.component.min)??0,()=>b(t.component.max)]),V(`input`,o,re),U(e,n)},ot=e=>{var n=lj(),r=F(n),a=e=>{var n=ZA(),r=L(n,!0);z(e=>W(r,e),[()=>Dy(t.component.label,i(),s())]),U(e,n)};G(r,e=>{t.component.label&&e(a)});var o=R(r,2);za(o),D(n),z((e,n,r)=>{J(o,`type`,t.component.enableDate&&t.component.enableTime?`datetime-local`:t.component.enableDate?`date`:`time`),Ba(o,e),J(o,`min`,n),J(o,`max`,r)},[()=>t.component.enableDate&&t.component.enableTime&&B(v)?B(v).slice(0,16):B(v),()=>String(Dy(t.component.min,i(),s())??``)||void 0,()=>String(Dy(t.component.max,i(),s())??``)||void 0]),V(`change`,o,ie),U(e,n)},st=e=>{U(e,uj())};G(Ie,e=>{c()>=24?e(Le):B(he)?B(l)===`column`?e(ze,2):B(l)===`row`?e(Be,3):B(l)===`list`?e(Ve,4):B(l)===`card`?e(He,5):B(l)===`link`?e(Ue,6):B(l)===`text`?e(We,7):B(l)===`metric`?e(Ge,8):B(l)===`sparkline`?e(Ke,9):B(l)===`table`?e(qe,10):B(l)===`divider`?e(Je,11):B(l)===`checkbox`?e(Ye,12):B(l)===`button`?e(Xe,13):B(l)===`image`?e(Ze,14):B(l)===`figure`?e(Qe,15):B(l)===`diff`?e($e,16):B(l)===`weatherglyph`?e(et,17):B(l)===`icon`?e(tt,18):B(l)===`video`?e(nt,19):B(l)===`textfield`?e(rt,20):B(l)===`choicepicker`?e(it,21):B(l)===`slider`?e(at,22):B(l)===`datetimeinput`?e(ot,23):e(st,-1):e(Re,1)}),U(e,Fe),k()}ki([`change`,`click`,`input`]);var fj=H(`
Overview AG2 catalog
`),pj=H(`
`),mj=H(` `,1);function hj(e,t){O(t,!0);let n=()=>A(Fo,`$thread`,r),[r,i]=Zt(),a=j(()=>t.item.data||{}),o=j(()=>t.item.components||t.item.component._components||[t.item.component]),s=j(()=>ub(t.item.component.component).toLowerCase()),c=j(()=>!!B(s)),l=j(()=>B(s)===`card`&&ub(t.item.component.variant)===`feature`),u=j(()=>t.item.title||`Interactive view`),d=j(()=>n().items.some(e=>e.kind===`agent`&&e.streaming&&ib(e.text)===t.item.surfaceId)),f=j(()=>n().items.some(e=>e.kind===`note`&&e.a2uiActionPending&&e.surfaceId===t.item.surfaceId)),p=M(P({}));hr(()=>{N(p,B(a),!0)});function m(e,t){N(p,Yy(B(p),e,t),!0)}function h(e){rx({version:t.item.version||`v1.0`,action:{...e,surfaceId:t.item.surfaceId,timestamp:new Date().toISOString()}},{surfaceId:t.item.surfaceId,data:B(p)})}var g=mj(),_=I(g),v=e=>{WO(e,{})},y=e=>{dj(e,{get component(){return t.item.component},get components(){return B(o)},get data(){return B(p)},onDataChange:m,onAction:h})},b=e=>{var n=fj(),r=F(n),i=F(r);$(F(i),{name:`sparkles`,size:15}),D(i);var a=R(i,2),s=L(R(F(a),2),!0);D(a);var c=R(a,2);D(r),dj(R(r,2),{get component(){return t.item.component},get components(){return B(o)},get data(){return B(p)},onDataChange:m,onAction:h}),D(n),z(()=>{W(s,B(u)),J(c,`title`,t.item.catalogId)}),U(e,n)};G(_,e=>{B(d)?e(v):B(l)?e(y,1):B(c)&&e(b,2)});var x=R(_,2),S=e=>{var t=pj();$(F(t),{name:`rotate-cw`,size:14}),D(t),U(e,t)};G(x,e=>{B(f)&&e(S)}),U(e,g),k(),i()}var gj=e=>(e||``).split(`.`).pop()??``,_j=`https://docs.ag2.ai`,vj={Model:{color:`#4c8bf5`,blurb:`AG2 Agent ↔ provider (the LLM calls)`},Tool:{color:`#1f9d55`,blurb:`AG2 tools (search, shell, code, fetch, filesystem, MCP…)`},Memory:{color:`#9b59b6`,blurb:`AG2 KnowledgeConfig — aggregation & compaction`},Subagent:{color:`#e67e22`,blurb:`AG2 subagents — run_task lifecycle`},HITL:{color:`#e0b400`,blurb:`AG2 human-in-the-loop (context.input / hitl_hook)`},Observer:{color:`#c2410c`,blurb:`AG2 observers — alerts & halts`},Voice:{color:`#16a3a3`,blurb:`AG2 LiveAgent — realtime voice`},A2UI:{color:`#d8552f`,blurb:`A2UI declarative generative UI surfaces`},Usage:{color:`#888`,blurb:`AG2 token usage accounting`},Stream:{color:`#888`,blurb:`AG2 Stream lifecycle`}},yj={ModelRequest:`Model`,ModelResponse:`Model`,ModelMessage:`Model`,ModelMessageChunk:`Model`,ToolCallsEvent:`Tool`,ToolCallEvent:`Tool`,ToolResultEvent:`Tool`,ToolResultsEvent:`Tool`,GeminiToolCallEvent:`Tool`,OpenAIToolCallEvent:`Tool`,AnthropicToolCallEvent:`Tool`,AggregationStarted:`Memory`,AggregationCompleted:`Memory`,AggregationFailed:`Memory`,CompactionStarted:`Memory`,CompactionCompleted:`Memory`,CompactionFailed:`Memory`,TaskStarted:`Subagent`,TaskCompleted:`Subagent`,TaskFailed:`Subagent`,TaskCancelled:`Subagent`,HumanInputRequest:`HITL`,HumanMessage:`HITL`,ObserverAlert:`Observer`,HaltEvent:`Observer`,UsageEvent:`Usage`,RecordedAudioEvent:`Voice`,SynthesizedAudioEvent:`Voice`,TranscriptionChunkEvent:`Voice`,TranscriptionCompletedEvent:`Voice`,A2UIMessageEvent:`A2UI`,A2UIClientEvent:`A2UI`,A2UIValidationFailedEvent:`A2UI`},bj={TaskCreated:`Subagent`,TaskScheduled:`Subagent`,DeliverableProduced:`Subagent`,InquiryRaised:`HITL`,InquiryAnswered:`HITL`,SubagentTrace:`Subagent`,FeedbackGiven:`Memory`,FeedbackCleared:`Memory`,A2UISurface:`A2UI`};function xj(e){let t=gj(e),n=(e||``).startsWith(`ag2.`);return{sub:yj[t]||bj[t]||`Stream`,label:t,layer:n?`ag2`:`app`}}var Sj={user:{sub:`Model`,label:`ModelRequest`,layer:`ag2`},agent:{sub:`Model`,label:`ModelResponse`,layer:`ag2`},tools:{sub:`Tool`,label:`ToolCallsEvent → AG2 tools`,layer:`ag2`},subagent:{sub:`Subagent`,label:`subagents.run_task`,layer:`ag2`},inquiry:{sub:`HITL`,label:`HumanInputRequest / InquiryRaised`,layer:`ag2`},taskcard:{sub:`Subagent`,label:`TaskCreated (app event on AG2 stream)`,layer:`app`},deliverable:{sub:`Subagent`,label:`DeliverableProduced (app event)`,layer:`app`},a2ui:{sub:`A2UI`,label:`A2UI surface`,layer:`app`},note:{sub:`Stream`,label:`lifecycle note`,layer:`app`}},Cj=e=>Sj[e]||null,wj=[{sub:`Model`,name:`ag2.Agent`,what:`The universal runtime: model config, tools, knowledge, assembly, HITL, middleware, observers`,layer:`ag2`},{sub:`Stream`,name:`Stream + EventLogWriter`,what:`One event stream is the log, the wire protocol, and the source this whole UI is a projection of`,layer:`ag2`},{sub:`Memory`,name:`KnowledgeConfig + WorkingMemoryAggregate`,what:`Persistent learned profile, distilled & injected each turn (+ SummarizeCompact)`,layer:`ag2`},{sub:`Tool`,name:`Native tools`,what:`DuckDuckSearchTool, SandboxShell/CodeTool, WebFetchTool, FilesystemToolkit, SkillSearchToolkit, MCP`,layer:`ag2`},{sub:`Subagent`,name:`subagents.run_task`,what:`Background task work runs as named AG2 subagents (visible, nested)`,layer:`ag2`},{sub:`HITL`,name:`context.input / hitl_hook`,what:`Mid-turn questions & permission gates (durable inquiries ride the stream)`,layer:`ag2`},{sub:`Voice`,name:`LiveAgent`,what:`Realtime voice (Gemini Live / OpenAI realtime), delegating heavy work to the universal agent`,layer:`ag2`},{sub:`A2UI`,name:`autogen.beta.a2ui`,what:`Agent-authored declarative UI messages rendered by the chat/task surface`,layer:`ag2`},{sub:`Observer`,name:`LoopDetector / TokenMonitor / custom`,what:`Stuck-turn guards emitting ObserverAlerts on the stream`,layer:`ag2`},{sub:`Tool`,name:`extensions.docker.DockerEnvironment`,what:`Official AG2 container backend for the code/shell sandbox`,layer:`ag2`},{sub:`Model`,name:`response_schema`,what:`Typed task planning & deliverable verification`,layer:`ag2`},{name:`Durable task store + scheduler`,what:`Persistent tasks, recurrence, cascading cancel, deliverable verification`,layer:`app`},{name:`Gateway + channels + Svelte UI`,what:`FastAPI/WebSocket facade, Telegram/Discord/Slack, this web client`,layer:`app`}],Tj=_j,Ej=H(`
`),Dj=H(`
`);function Oj(e,t){O(t,!0);let n=()=>A(Ks,`$ag2View`,r),[r,i]=Zt(),a=j(()=>n()?Cj(t.item.kind):null);var o=Bi(),s=I(o),c=e=>{var n=Dj(),r=F(n),i=e=>{CT(e,{get item(){return t.item}})},o=e=>{ek(e,{get item(){return t.item}})},s=e=>{uk(e,{get item(){return t.item}})},c=e=>{pk(e,{get item(){return t.item}})},l=e=>{bk(e,{get item(){return t.item}})},u=e=>{Ok(e,{get item(){return t.item}})},d=e=>{Lk(e,{get item(){return t.item}})},f=e=>{Bk(e,{get item(){return t.item}})},p=e=>{Gk(e,{get item(){return t.item}})},m=e=>{Yk(e,{get item(){return t.item}})},h=e=>{hj(e,{get item(){return t.item}})};G(r,e=>{t.item.kind===`user`?e(i):t.item.kind===`agent`?e(o,1):t.item.kind===`tools`?e(s,2):t.item.kind===`taskcard`?e(c,3):t.item.kind===`deliverable`?e(l,4):t.item.kind===`inquiry`?e(u,5):t.item.kind===`subagent`?e(d,6):t.item.kind===`note`?e(f,7):t.item.kind===`genimage`?e(p,8):t.item.kind===`attachment`?e(m,9):t.item.kind===`a2ui`&&e(h,10)});var g=R(r,2),_=e=>{var n=Ej();let r;var i=L(n);z(()=>{r=q(n,1,`ag2tag`,null,r,{right:t.item.kind===`user`,applayer:B(a).layer===`app`}),W(i,`AG2 · ${B(a).label??``}`)}),U(e,n)};G(g,e=>{B(a)&&e(_)}),D(n),U(e,n)};G(s,e=>{t.item.kind===`note`&&t.item.a2uiActionPending||e(c)}),U(e,o),k(),i()}var kj=Wt({configs:[],active:null,providers:[],loaded:!1});async function Aj(){let e=await Q.liveConfigs();kj.set({configs:e.configs||[],active:e.active??null,providers:e.providers||[],loaded:!0})}function jj(e){return e.key_source!==`none`}var Mj=(e,t,n)=>(e.grants||[]).find(e=>e.profile===t&&e.chat_id===n),Nj=(e,t,n)=>n?(e.grants||[]).find(e=>e.profile===t&&e.task_id===n&&!e.chat_id):null,Pj=(e,t)=>(e.grants||[]).some(e=>e.profile===t&&!e.chat_id&&!e.task_id),Fj=(e,t,n)=>{let r=Nj(e,t,n);return r?r.mode===`none`?null:r:(e.grants||[]).find(e=>e.profile===t&&!e.chat_id&&!e.task_id)||null};function Ij(e,t,n,r=``){return(e||[]).map(e=>{let i=Mj(e,t,n),a=Nj(e,t,r);return!i||i.mode===`none`||Pj(e,t)||a&&a.mode!==`none`?null:{id:e.id,name:e.name,path:e.path,exists:e.exists!==!1,mode:i.mode}}).filter(e=>e!==null)}function Lj(e,t,n,r=``){return(e||[]).filter(e=>{if(!Fj(e,t,r))return!1;let i=Mj(e,t,n);return!(i&&i.mode===`none`)}).length}function Rj(e,t,n,r=``){let i=Mj(e,t,n);return Fj(e,t,r)?i&&i.mode===`none`?{status:`unblock`,id:e.id,name:e.name}:{status:`covered`,name:e.name}:i?{status:`exists`}:{status:`grant`,id:e.id}}var zj={telegram:{kind:`solid`,fill:`#26A5E4`,path:`M11.944 0A12 12 0 0 0 0 12a12 12 0 0 0 12 12 12 12 0 0 0 12-12A12 12 0 0 0 12 0a12 12 0 0 0-.056 0zm4.962 7.224c.1-.002.321.023.465.14a.506.506 0 0 1 .171.325c.016.093.036.306.02.472-.18 1.898-.962 6.502-1.36 8.627-.168.9-.499 1.201-.82 1.23-.696.065-1.225-.46-1.9-.902-1.056-.693-1.653-1.124-2.678-1.8-1.185-.78-.417-1.21.258-1.91.177-.184 3.247-2.977 3.307-3.23.007-.032.014-.15-.056-.212s-.174-.041-.249-.024c-.106.024-1.793 1.14-5.061 3.345-.48.33-.913.49-1.302.48-.428-.008-1.252-.241-1.865-.44-.752-.245-1.349-.374-1.297-.789.027-.216.325-.437.893-.663 3.498-1.524 5.83-2.529 6.998-3.014 3.332-1.386 4.025-1.627 4.476-1.635z`},discord:{kind:`solid`,fill:`#5865F2`,path:`M20.317 4.3698a19.7913 19.7913 0 00-4.8851-1.5152.0741.0741 0 00-.0785.0371c-.211.3753-.4447.8648-.6083 1.2495-1.8447-.2762-3.68-.2762-5.4868 0-.1636-.3933-.4058-.8742-.6177-1.2495a.077.077 0 00-.0785-.037 19.7363 19.7363 0 00-4.8852 1.515.0699.0699 0 00-.0321.0277C.5334 9.0458-.319 13.5799.0992 18.0578a.0824.0824 0 00.0312.0561c2.0528 1.5076 4.0413 2.4228 5.9929 3.0294a.0777.0777 0 00.0842-.0276c.4616-.6304.8731-1.2952 1.226-1.9942a.076.076 0 00-.0416-.1057c-.6528-.2476-1.2743-.5495-1.8722-.8923a.077.077 0 01-.0076-.1277c.1258-.0943.2517-.1923.3718-.2914a.0743.0743 0 01.0776-.0105c3.9278 1.7933 8.18 1.7933 12.0614 0a.0739.0739 0 01.0785.0095c.1202.099.246.1981.3728.2924a.077.077 0 01-.0066.1276 12.2986 12.2986 0 01-1.873.8914.0766.0766 0 00-.0407.1067c.3604.698.7719 1.3628 1.225 1.9932a.076.076 0 00.0842.0286c1.961-.6067 3.9495-1.5219 6.0023-3.0294a.077.077 0 00.0313-.0552c.5004-5.177-.8382-9.6739-3.5485-13.6604a.061.061 0 00-.0312-.0286zM8.02 15.3312c-1.1825 0-2.1569-1.0857-2.1569-2.419 0-1.3332.9555-2.4189 2.157-2.4189 1.2108 0 2.1757 1.0952 2.1568 2.419 0 1.3332-.9555 2.4189-2.1569 2.4189zm7.9748 0c-1.1825 0-2.1569-1.0857-2.1569-2.419 0-1.3332.9554-2.4189 2.1569-2.4189 1.2108 0 2.1757 1.0952 2.1568 2.419 0 1.3332-.946 2.4189-2.1568 2.4189Z`},github:{kind:`solid`,path:`M12 .297c-6.63 0-12 5.373-12 12 0 5.303 3.438 9.8 8.205 11.385.6.113.82-.258.82-.577 0-.285-.01-1.04-.015-2.04-3.338.724-4.042-1.61-4.042-1.61C4.422 18.07 3.633 17.7 3.633 17.7c-1.087-.744.084-.729.084-.729 1.205.084 1.838 1.236 1.838 1.236 1.07 1.835 2.809 1.305 3.495.998.108-.776.417-1.305.76-1.605-2.665-.3-5.466-1.332-5.466-5.93 0-1.31.465-2.38 1.235-3.22-.135-.303-.54-1.523.105-3.176 0 0 1.005-.322 3.3 1.23.96-.267 1.98-.399 3-.405 1.02.006 2.04.138 3 .405 2.28-1.552 3.285-1.23 3.285-1.23.645 1.653.24 2.873.12 3.176.765.84 1.23 1.91 1.23 3.22 0 4.61-2.805 5.625-5.475 5.92.42.36.81 1.096.81 2.22 0 1.606-.015 2.896-.015 3.286 0 .315.21.69.825.57C20.565 22.092 24 17.592 24 12.297c0-6.627-5.373-12-12-12`},slack:{kind:`multi`,viewBox:`0 0 128 128`,parts:[{fill:`#de1c59`,path:`M27.255 80.719c0 7.33-5.978 13.317-13.309 13.317C6.616 94.036.63 88.049.63 80.719s5.987-13.317 13.317-13.317h13.309zm6.709 0c0-7.33 5.987-13.317 13.317-13.317s13.317 5.986 13.317 13.317v33.335c0 7.33-5.986 13.317-13.317 13.317-7.33 0-13.317-5.987-13.317-13.317zm0 0`},{fill:`#35c5f0`,path:`M47.281 27.255c-7.33 0-13.317-5.978-13.317-13.309C33.964 6.616 39.951.63 47.281.63s13.317 5.987 13.317 13.317v13.309zm0 6.709c7.33 0 13.317 5.987 13.317 13.317s-5.986 13.317-13.317 13.317H13.946C6.616 60.598.63 54.612.63 47.281c0-7.33 5.987-13.317 13.317-13.317zm0 0`},{fill:`#2eb57d`,path:`M100.745 47.281c0-7.33 5.978-13.317 13.309-13.317 7.33 0 13.317 5.987 13.317 13.317s-5.987 13.317-13.317 13.317h-13.309zm-6.709 0c0 7.33-5.987 13.317-13.317 13.317s-13.317-5.986-13.317-13.317V13.946C67.402 6.616 73.388.63 80.719.63c7.33 0 13.317 5.987 13.317 13.317zm0 0`},{fill:`#ebb02e`,path:`M80.719 100.745c7.33 0 13.317 5.978 13.317 13.309 0 7.33-5.987 13.317-13.317 13.317s-13.317-5.987-13.317-13.317v-13.309zm0-6.709c-7.33 0-13.317-5.987-13.317-13.317s5.986-13.317 13.317-13.317h33.335c7.33 0 13.317 5.986 13.317 13.317 0 7.33-5.987 13.317-13.317 13.317zm0 0`}]},google:{kind:`multi`,viewBox:`0 0 128 128`,parts:[{fill:`#e33629`,path:`M44.59 4.21a64 64 0 0142.61.37 61.22 61.22 0 0120.35 12.62c-2 2.14-4.11 4.14-6.15 6.22Q95.58 29.23 89.77 35a34.28 34.28 0 00-13.64-8 37.17 37.17 0 00-37.46 9.74 39.25 39.25 0 00-9.18 14.91L8.76 35.6A63.53 63.53 0 0144.59 4.21z`},{fill:`#f8bd00`,path:`M3.26 51.5a62.93 62.93 0 015.5-15.9l20.73 16.09a38.31 38.31 0 000 24.63q-10.36 8-20.73 16.08a63.33 63.33 0 01-5.5-40.9z`},{fill:`#587dbd`,path:`M65.27 52.15h59.52a74.33 74.33 0 01-1.61 33.58 57.44 57.44 0 01-16 26.26c-6.69-5.22-13.41-10.4-20.1-15.62a29.72 29.72 0 0012.66-19.54H65.27c-.01-8.22 0-16.45 0-24.68z`},{fill:`#319f43`,path:`M8.75 92.4q10.37-8 20.73-16.08A39.3 39.3 0 0044 95.74a37.16 37.16 0 0014.08 6.08 41.29 41.29 0 0015.1 0 36.16 36.16 0 0013.93-5.5c6.69 5.22 13.41 10.4 20.1 15.62a57.13 57.13 0 01-25.9 13.47 67.6 67.6 0 01-32.36-.35 63 63 0 01-23-11.59A63.73 63.73 0 018.75 92.4z`}]},openai:{kind:`solid`,path:`M22.2819 9.8211a5.9847 5.9847 0 0 0-.5157-4.9108 6.0462 6.0462 0 0 0-6.5098-2.9A6.0651 6.0651 0 0 0 4.9807 4.1818a5.9847 5.9847 0 0 0-3.9977 2.9 6.0462 6.0462 0 0 0 .7427 7.0966 5.98 5.98 0 0 0 .511 4.9107 6.051 6.051 0 0 0 6.5146 2.9001A5.9847 5.9847 0 0 0 13.2599 24a6.0557 6.0557 0 0 0 5.7718-4.2058 5.9894 5.9894 0 0 0 3.9977-2.9001 6.0557 6.0557 0 0 0-.7475-7.0729zm-9.022 12.6081a4.4755 4.4755 0 0 1-2.8764-1.0408l.1419-.0804 4.7783-2.7582a.7948.7948 0 0 0 .3927-.6813v-6.7369l2.02 1.1686a.071.071 0 0 1 .038.052v5.5826a4.504 4.504 0 0 1-4.4945 4.4944zm-9.6607-4.1254a4.4708 4.4708 0 0 1-.5346-3.0137l.142.0852 4.783 2.7582a.7712.7712 0 0 0 .7806 0l5.8428-3.3685v2.3324a.0804.0804 0 0 1-.0332.0615L9.74 19.9502a4.4992 4.4992 0 0 1-6.1408-1.6464zM2.3408 7.8956a4.485 4.485 0 0 1 2.3655-1.9728V11.6a.7664.7664 0 0 0 .3879.6765l5.8144 3.3543-2.0201 1.1685a.0757.0757 0 0 1-.071 0l-4.8303-2.7865A4.504 4.504 0 0 1 2.3408 7.872zm16.5963 3.8558L13.1038 8.364 15.1192 7.2a.0757.0757 0 0 1 .071 0l4.8303 2.7913a4.4944 4.4944 0 0 1-.6765 8.1042v-5.6772a.79.79 0 0 0-.407-.667zm2.0107-3.0231l-.142-.0852-4.7735-2.7818a.7759.7759 0 0 0-.7854 0L9.409 9.2297V6.8974a.0662.0662 0 0 1 .0284-.0615l4.8303-2.7866a4.4992 4.4992 0 0 1 6.6802 4.66zM8.3065 12.863l-2.02-1.1638a.0804.0804 0 0 1-.038-.0567V6.0742a4.4992 4.4992 0 0 1 7.3757-3.4537l-.142.0805L8.704 5.459a.7948.7948 0 0 0-.3927.6813zm1.0976-2.3654l2.602-1.4998 2.6069 1.4998v2.9994l-2.5974 1.4997-2.6067-1.4997Z`},anthropic:{kind:`solid`,fill:`#D97757`,path:`M17.3041 3.541h-3.6718l6.696 16.918H24Zm-10.6082 0L0 20.459h3.7442l1.3693-3.5527h7.0052l1.3693 3.5528h3.7442L10.5363 3.5409Zm-.3712 10.2232 2.2914-5.9456 2.2914 5.9456Z`},gemini:{kind:`gradient`,stops:[`#4285F4`,`#9B72CB`,`#D96570`],path:`M11.04 19.32Q12 21.51 12 24q0-2.49.93-4.68.96-2.19 2.58-3.81t3.81-2.55Q21.51 12 24 12q-2.49 0-4.68-.93a12.3 12.3 0 0 1-3.81-2.58 12.3 12.3 0 0 1-2.58-3.81Q12 2.49 12 0q0 2.49-.96 4.68-.93 2.19-2.55 3.81a12.3 12.3 0 0 1-3.81 2.58Q2.49 12 0 12q2.49 0 4.68.96 2.19.93 3.81 2.55t2.55 3.81`},ollama:{kind:`solid`,path:`M16.361 10.26a.894.894 0 0 0-.558.47l-.072.148.001.207c0 .193.004.217.059.353.076.193.152.312.291.448.24.238.51.3.872.205a.86.86 0 0 0 .517-.436.752.752 0 0 0 .08-.498c-.064-.453-.33-.782-.724-.897a1.06 1.06 0 0 0-.466 0zm-9.203.005c-.305.096-.533.32-.65.639a1.187 1.187 0 0 0-.06.52c.057.309.31.59.598.667.362.095.632.033.872-.205.14-.136.215-.255.291-.448.055-.136.059-.16.059-.353l.001-.207-.072-.148a.894.894 0 0 0-.565-.472 1.02 1.02 0 0 0-.474.007Zm4.184 2c-.131.071-.223.25-.195.383.031.143.157.288.353.407.105.063.112.072.117.136.004.038-.01.146-.029.243-.02.094-.036.194-.036.222.002.074.07.195.143.253.064.052.076.054.255.059.164.005.198.001.264-.03.169-.082.212-.234.15-.525-.052-.243-.042-.28.087-.355.137-.08.281-.219.324-.314a.365.365 0 0 0-.175-.48.394.394 0 0 0-.181-.033c-.126 0-.207.03-.355.124l-.085.053-.053-.032c-.219-.13-.259-.145-.391-.143a.396.396 0 0 0-.193.032zm.39-2.195c-.373.036-.475.05-.654.086-.291.06-.68.195-.951.328-.94.46-1.589 1.226-1.787 2.114-.04.176-.045.234-.045.53 0 .294.005.357.043.524.264 1.16 1.332 2.017 2.714 2.173.3.033 1.596.033 1.896 0 1.11-.125 2.064-.727 2.493-1.571.114-.226.169-.372.22-.602.039-.167.044-.23.044-.523 0-.297-.005-.355-.045-.531-.288-1.29-1.539-2.304-3.072-2.497a6.873 6.873 0 0 0-.855-.031zm.645.937a3.283 3.283 0 0 1 1.44.514c.223.148.537.458.671.662.166.251.26.508.303.82.02.143.01.251-.043.482-.08.345-.332.705-.672.957a3.115 3.115 0 0 1-.689.348c-.382.122-.632.144-1.525.138-.582-.006-.686-.01-.853-.042-.57-.107-1.022-.334-1.35-.68-.264-.28-.385-.535-.45-.946-.03-.192.025-.509.137-.776.136-.326.488-.73.836-.963.403-.269.934-.46 1.422-.512.187-.02.586-.02.773-.002zm-5.503-11a1.653 1.653 0 0 0-.683.298C5.617.74 5.173 1.666 4.985 2.819c-.07.436-.119 1.04-.119 1.503 0 .544.064 1.24.155 1.721.02.107.031.202.023.208a8.12 8.12 0 0 1-.187.152 5.324 5.324 0 0 0-.949 1.02 5.49 5.49 0 0 0-.94 2.339 6.625 6.625 0 0 0-.023 1.357c.091.78.325 1.438.727 2.04l.13.195-.037.064c-.269.452-.498 1.105-.605 1.732-.084.496-.095.629-.095 1.294 0 .67.009.803.088 1.266.095.555.288 1.143.503 1.534.071.128.243.393.264.407.007.003-.014.067-.046.141a7.405 7.405 0 0 0-.548 1.873c-.062.417-.071.552-.071.991 0 .56.031.832.148 1.279L3.42 24h1.478l-.05-.091c-.297-.552-.325-1.575-.068-2.597.117-.472.25-.819.498-1.296l.148-.29v-.177c0-.165-.003-.184-.057-.293a.915.915 0 0 0-.194-.25 1.74 1.74 0 0 1-.385-.543c-.424-.92-.506-2.286-.208-3.451.124-.486.329-.918.544-1.154a.787.787 0 0 0 .223-.531c0-.195-.07-.355-.224-.522a3.136 3.136 0 0 1-.817-1.729c-.14-.96.114-2.005.69-2.834.563-.814 1.353-1.336 2.237-1.475.199-.033.57-.028.776.01.226.04.367.028.512-.041.179-.085.268-.19.374-.431.093-.215.165-.333.36-.576.234-.29.46-.489.822-.729.413-.27.884-.467 1.352-.561.17-.035.25-.04.569-.04.319 0 .398.005.569.04a4.07 4.07 0 0 1 1.914.997c.117.109.398.457.488.602.034.057.095.177.132.267.105.241.195.346.374.43.14.068.286.082.503.045.343-.058.607-.053.943.016 1.144.23 2.14 1.173 2.581 2.437.385 1.108.276 2.267-.296 3.153-.097.15-.193.27-.333.419-.301.322-.301.722-.001 1.053.493.539.801 1.866.708 3.036-.062.772-.26 1.463-.533 1.854a2.096 2.096 0 0 1-.224.258.916.916 0 0 0-.194.25c-.054.109-.057.128-.057.293v.178l.148.29c.248.476.38.823.498 1.295.253 1.008.231 2.01-.059 2.581a.845.845 0 0 0-.044.098c0 .006.329.009.732.009h.73l.02-.074.036-.134c.019-.076.057-.3.088-.516.029-.217.029-1.016 0-1.258-.11-.875-.295-1.57-.597-2.226-.032-.074-.053-.138-.046-.141.008-.005.057-.074.108-.152.376-.569.607-1.284.724-2.228.031-.26.031-1.378 0-1.628-.083-.645-.182-1.082-.348-1.525a6.083 6.083 0 0 0-.329-.7l-.038-.064.131-.194c.402-.604.636-1.262.727-2.04a6.625 6.625 0 0 0-.024-1.358 5.512 5.512 0 0 0-.939-2.339 5.325 5.325 0 0 0-.95-1.02 8.097 8.097 0 0 1-.186-.152.692.692 0 0 1 .023-.208c.208-1.087.201-2.443-.017-3.503-.19-.924-.535-1.658-.98-2.082-.354-.338-.716-.482-1.15-.455-.996.059-1.8 1.205-2.116 3.01a6.805 6.805 0 0 0-.097.726c0 .036-.007.066-.015.066a.96.96 0 0 1-.149-.078A4.857 4.857 0 0 0 12 3.03c-.832 0-1.687.243-2.456.698a.958.958 0 0 1-.148.078c-.008 0-.015-.03-.015-.066a6.71 6.71 0 0 0-.097-.725C8.997 1.392 8.337.319 7.46.048a2.096 2.096 0 0 0-.585-.041Zm.293 1.402c.248.197.523.759.682 1.388.03.113.06.244.069.292.007.047.026.152.041.233.067.365.098.76.102 1.24l.002.475-.12.175-.118.178h-.278c-.324 0-.646.041-.954.124l-.238.06c-.033.007-.038-.003-.057-.144a8.438 8.438 0 0 1 .016-2.323c.124-.788.413-1.501.696-1.711.067-.05.079-.049.157.013zm9.825-.012c.17.126.358.46.498.888.28.854.36 2.028.212 3.145-.019.14-.024.151-.057.144l-.238-.06a3.693 3.693 0 0 0-.954-.124h-.278l-.119-.178-.119-.175.002-.474c.004-.669.066-1.19.214-1.772.157-.623.434-1.185.68-1.382.078-.062.09-.063.159-.012z`}},Bj={openai_responses:`openai`,openai_subscription:`openai`,codex:`openai`,claude_code:`anthropic`};function Vj(e){if(!e)return null;let t=Object.hasOwn(Bj,e)?Bj[e]:e;return Object.hasOwn(zj,t)?zj[t]:null}var Hj=0,Uj=Ri(``),Wj=Ri(``),Gj=Ri(``,1),Kj=Ri(``);function qj(e,t){O(t,!0);let n=ro(t,`size`,3,20),r=j(()=>Vj(t.brand)),i=`brandmark-gradient-${++Hj}`;var a=Bi(),o=I(a),s=e=>{var t=Kj(),a=F(t),o=e=>{var t=Bi();K(I(t),17,()=>B(r).parts||[],Qi,(e,t)=>{var n=Uj();z(()=>{J(n,`d`,B(t).path),J(n,`fill`,B(t).fill)}),U(e,n)}),U(e,t)},s=e=>{var t=Gj(),n=I(t),a=F(n);K(a,21,()=>B(r).stops||[],Qi,(e,t,n)=>{var i=Wj();z(e=>{J(i,`offset`,e),J(i,`stop-color`,B(t))},[()=>n/Math.max(1,(B(r).stops||[]).length-1)]),U(e,i)}),D(a),D(n);var o=R(n);z(()=>{J(a,`id`,i),J(o,`d`,B(r).path),J(o,`fill`,`url(#${i})`)}),U(e,t)},c=e=>{var t=Uj();z(()=>{J(t,`d`,B(r).path),J(t,`fill`,B(r).fill||`currentColor`)}),U(e,t)};G(a,e=>{B(r).kind===`multi`?e(o):B(r).kind===`gradient`?e(s,1):e(c,-1)}),D(t),z(()=>{J(t,`width`,n()),J(t,`height`,n()),J(t,`viewBox`,B(r).viewBox||`0 0 24 24`)}),U(e,t)};G(o,e=>{B(r)&&e(s)}),U(e,a),k()}var Jj=H(`
`),Yj=H(``),Xj=H(`inherited`),Zj=H(` `,1),Qj=H(` `,1),$j=H(` `),eM=H(``),tM=H(``),nM=H(``),rM=H(`
`,1),iM=H(`
`),aM=H(`
`);function oM(e,t){O(t,!0);let n=ro(t,`configs`,19,()=>[]),r=ro(t,`activeId`,3,null),i=ro(t,`envOverride`,3,null),a=ro(t,`busy`,3,!1),o=ro(t,`disabled`,3,!1),s=ro(t,`title`,3,``),c=ro(t,`placeholder`,3,`Choose a model`),l=ro(t,`usable`,3,()=>!0),u=ro(t,`down`,3,!1),d=ro(t,`inherited`,3,!1),f=ro(t,`closedBadges`,3,!0),p=ro(t,`defaultEntry`,3,null),m=ro(t,`emptyLabel`,3,`No models configured`),h=ro(t,`onManage`,3,null),g=ro(t,`manageLabel`,3,`Manage models…`),_=M(!1),v=j(()=>n().find(e=>e.id===r())||null);function y(e){a()||!l()(e)||(N(_,!1),t.onChoose?.(e))}function b(){N(_,!1),t.onDefault?.()}var x=aM();Oi(`keydown`,Xn,e=>{e.key===`Escape`&&N(_,!1)});var S=F(x),C=e=>{var t=Jj(),n=L(t);z(()=>W(n,`Pinned by environment${i().provider?` · ${i().provider}`:``}${i().model?` · ${i().model}`:``}`)),U(e,t)},w=e=>{var n=Yj(),r=L(n,!0);z(()=>W(r,m())),V(`click`,n,function(...e){t.onEmpty?.apply(this,e)}),U(e,n)},T=e=>{var i=iM(),m=F(i),x=F(m),S=e=>{var n=Qj(),r=I(n);{let e=j(()=>t.brandFor(B(v)));qj(r,{get brand(){return B(e)},size:14})}var i=R(r,2),a=L(i,!0),o=R(i,2),s=e=>{var t=Zj(),n=I(t),r=e=>{U(e,Xj())};G(n,e=>{d()&&e(r)});var i=R(n,2);let a;z(e=>a=q(i,1,`modelsw-dot`,null,a,{warn:e}),[()=>!l()(B(v))]),U(e,t)};G(o,e=>{f()&&e(s)}),z(()=>W(a,B(v).name)),U(e,n)},C=e=>{var t=$j(),n=L(t,!0);z(()=>W(n,c())),U(e,t)};G(x,e=>{B(v)?e(S):e(C,-1)}),$(R(x,2),{name:`chevron-down`,size:13}),D(m);var w=R(m,2),T=e=>{var i=rM(),a=I(i),o=R(a,2);let s;var c=F(o),f=e=>{var t=eM();let n;var r=F(t),i=F(r),a=F(i,!0),o=R(a),s=e=>{$(e,{name:`check`,size:12})};G(o,e=>{d()&&e(s)}),D(i);var c=L(R(i,2),!0);D(r),D(t),z(()=>{n=q(t,1,`modelsw-item`,null,n,{active:d()}),W(a,p().label),W(c,p().sub)}),V(`click`,t,b),U(e,t)};G(c,e=>{p()&&e(f)});var m=R(c,2);K(m,17,n,e=>e.id,(e,n)=>{var i=tM();let a;var o=F(i);{let e=j(()=>t.brandFor(B(n)));qj(o,{get brand(){return B(e)},size:14})}var s=R(o,2),c=F(s),u=F(c,!0),f=R(u),p=e=>{$(e,{name:`check`,size:12})};G(f,e=>{!d()&&B(n).id===r()&&e(p)}),D(c);var m=L(R(c,2),!0);D(s);var h=R(s,2);let g;D(i),z((e,t,o,s)=>{a=q(i,1,`modelsw-item`,null,a,{active:!d()&&B(n).id===r()}),i.disabled=e,J(i,`title`,t),W(u,B(n).name),W(m,o),g=q(h,1,`modelsw-dot`,null,g,{warn:s})},[()=>!l()(B(n)),()=>l()(B(n))?``:`Not ready — add a key or sign in via Settings`,()=>t.labelFor(B(n)),()=>!l()(B(n))]),V(`click`,i,()=>y(B(n))),U(e,i)});var v=R(m,2),x=e=>{var t=nM(),n=L(t,!0);z(()=>W(n,g())),V(`click`,t,function(...e){h()?.apply(this,e)}),U(e,t)};G(v,e=>{h()&&e(x)}),D(o),z(()=>s=q(o,1,`modelsw-menu`,null,s,{down:u()})),V(`click`,a,()=>N(_,!1)),U(e,i)};G(w,e=>{B(_)&&e(T)}),D(i),z(()=>{m.disabled=a()||o(),J(m,`title`,s())}),V(`click`,m,()=>N(_,!B(_))),U(e,i)};G(S,e=>{i()?e(C):n().length?e(T,-1):e(w,1)}),D(x),U(e,x),k()}ki([`click`]);function sM(e,t){O(t,!0);let n=()=>A(aT,`$llmConfigs`,i),r=()=>A(Io,`$chatModel`,i),[i,a]=Zt(),o=M(!1);io(()=>{oT().catch(()=>{})});let s=j(()=>n().configs),c=j(()=>n().envOverride),l=j(()=>go(r())),u=j(()=>r().chatId),d=j(()=>n().active),f=j(()=>r().exists===null);async function p(e){try{let t=await Q.chat(e),n=null;Io.update(r=>{let i=po(r,e,t);return n=i.patch,i.state}),n!==null&&await Q.updateChat(e,{model:n})}catch{}}hr(()=>{let e=B(u);B(d),e&&p(e)});async function m(e){let t=r();if(B(o)||!t.chatId)return;let n=mo(t,e);if(Io.set(n.state),n.patch!==null){N(o,!0);try{await Q.updateChat(t.chatId,{model:n.patch})}catch{}await p(t.chatId),N(o,!1)}}let h=()=>Rs(`settings`,yo.MODELS);{let t=j(()=>B(o)||B(f));oM(e,{get configs(){return B(s)},get envOverride(){return B(c)},get busy(){return B(t)},get activeId(){return B(l).activeId},get inherited(){return B(l).inherited},closedBadges:!1,title:`Model for your next message in this chat`,brandFor:e=>e.type,labelFor:e=>`${yx[e.type]} · ${e.model}`,get usable(){return sT},defaultEntry:{label:`Use default`,sub:`Follow the Active model`},emptyLabel:`No models configured — add one in Settings`,onEmpty:h,onChoose:e=>m(e.id),onDefault:()=>m(``),onManage:h})}k(),a()}var cM=H(``),lM=H(`R+W`),uM=H(` `),dM=H(`
`),fM=H(`
`),pM=H(` `),mM=H(`
`),hM=H(` `),gM=H(``),_M=H(`
`),vM=H(`
`),yM=H(` `),bM=H(``),xM=H(`No Live model yet — click to configure one in Settings and enable Live support.`),SM=H(``),CM=H(`No model configured — add one in Settings → Models to send messages.`),wM=H(` `),TM=H(`

`),EM=H(` `,1),DM=H(`
AG2 Assistant is AI and can make mistakes. Check important info.
`,1);function OM(e,t){O(t,!0);let n=()=>A(gC,`$foldersStore`,l),r=()=>A(No,`$profiles`,l),i=()=>A(Fo,`$thread`,l),a=()=>A(Vo,`$runInfo`,l),o=()=>A(kj,`$liveConfigs`,l),s=()=>A(aT,`$llmConfigs`,l),c=()=>A(Gb,`$voice`,l),[l,u]=Zt();io(()=>{Aj().catch(()=>{}),n().loaded||_C(),Q.settings().then(e=>{N(g,e.fs,!0)}).catch(()=>{})});let d=j(()=>r().activeId||hs()||``),f=j(()=>i().chat),p=j(()=>i().kind===`run`&&a()?.id===i().id&&a().task_id||``),m=j(()=>(i().kind===`chat`||i().kind===`run`)&&!!B(f)),h=j(()=>n().folders),g=M(P({})),_=M(!1),v=M(!1),y=M(!1),b=M(``),x=M(``),S=j(()=>B(m)?Ij(B(h),B(d),B(f),B(p)):[]),C=j(()=>B(m)?Lj(B(h),B(d),B(f),B(p)):0);async function w(e){N(b,``),N(x,``),N(y,!0);try{await e()}catch(e){N(b,nS(e),!0)}N(y,!1)}function T(){N(b,``),N(x,``),N(_,!0)}let ee=e=>w(async()=>{let t,n;try{t=await Q.createFolder(e),n=t.folders.find(t=>t.path===e)}catch(e){let r=e instanceof ug&&e.status===409?G_.safeParse(e.body):null;if(r?.success)t=await Q.folders(),n=t.folders.find(e=>e.id===r.data.existing.id);else throw e}if(!n)throw Error(`Could not resolve that folder`);let r=Rj(n,B(d),B(f),B(p));r.status===`grant`?t=await Q.setGrant(n.id,B(d),`read`,B(f)):r.status===`unblock`?(t=await Q.revokeGrant(n.id,B(d),B(f)),N(x,`"${r.name}" is available here again.`)):r.status===`covered`?N(x,`"${r.name}" is already available here.`):r.status===`exists`&&N(x,`"${n.name}" is already in this chat.`),vC(t),N(_,!1)}),te=e=>w(async()=>{vC(await Q.revokeGrant(e.id,B(d),B(f)))});function ne(){N(v,!1)}let re=j(()=>!o().active),ie=j(()=>s().loaded&&!s().configs.length&&!s().envOverride),ae=M(``),oe=M(P([])),se=M(!1),ce,le,ue;function de(){ue&&ce&&(ue.scrollTop=ce.scrollTop,ue.scrollLeft=ce.scrollLeft)}let fe=M(P([])),E=M(!1),pe=M(``),me=M(-1),he=M(P([])),ge=M(0),_e=0,ve,ye=M(void 0),be=[],xe=j(()=>gT(B(ae),B(fe)));function Se(){be[B(ge)]?.scrollIntoView({block:`nearest`})}function Ce(){let e=be[0]?.offsetHeight||32;return Math.max(1,Math.floor((B(ye)?.clientHeight||e)/e))}function we(){N(E,!1),N(pe,``),N(me,-1),N(he,[],!0),N(ge,0),_e++}function Te(){if(!ce)return;let e=uT(B(ae),ce.selectionStart);if(!e){B(E)&&we();return}let t=!B(E)||e.start!==B(me)||e.query!==B(pe);N(me,e.start,!0),N(pe,e.query,!0),N(E,!0),t&&Ee(e.query)}function Ee(e){clearTimeout(ve);let t=++_e;ve=setTimeout(async()=>{try{let n=await Q.searchFiles(e,B(f));if(t!==_e)return;N(he,n.results,!0),N(ge,0)}catch{t===_e&&N(he,[],!0)}},120)}function De(e){if(!e)return;let t=ce?ce.selectionStart:B(ae).length,n=lT(e),r=dT(B(ae),B(me),t,n.label);N(ae,r.text,!0),N(fe,[...B(fe),n],!0),we(),queueMicrotask(()=>{ce&&(ce.focus(),ce.selectionStart=ce.selectionEnd=r.caret,je())})}function Oe(){if(!B(ae).trim()&&!B(oe).length)return;let e=yT(B(ae),B(fe)).trim();!e&&!B(oe).length||(ex(e,B(oe).map(e=>e.payload)),N(ae,``),N(oe,[],!0),N(fe,[],!0),we(),ce&&(ce.style.height=`auto`))}function ke(e){if(B(E)&&B(he).length){let t=B(he).length-1,n=n=>{e.preventDefault(),N(ge,Math.max(0,Math.min(t,n)),!0),Se()};if(e.key===`ArrowDown`){e.preventDefault(),N(ge,(B(ge)+1)%B(he).length),Se();return}if(e.key===`ArrowUp`){e.preventDefault(),N(ge,(B(ge)-1+B(he).length)%B(he).length),Se();return}if(e.key===`PageDown`){n(B(ge)+Ce());return}if(e.key===`PageUp`){n(B(ge)-Ce());return}if(e.key===`Home`){n(0);return}if(e.key===`End`){n(t);return}if(e.key===`Enter`||e.key===`Tab`){e.preventDefault(),De(B(he)[B(ge)]);return}}if(B(E)&&e.key===`Escape`){e.preventDefault(),we();return}e.key===`Enter`&&!e.shiftKey&&(e.preventDefault(),Oe())}function Ae(){return i().busy?`Add something while it works…`:i().kind===`task`?`Tell the agent to change this task…`:`Message AG2 Assistant…`}function je(){ce&&(ce.style.height=`auto`,ce.style.height=Math.min(ce.scrollHeight,160)+`px`)}function Me(){if(!c().active&&B(re)){Rs(`settings`,yo.MODELS);return}c().active?px():dx()}function Ne(e){return new Promise((t,n)=>{let r=new FileReader;r.onload=()=>t(String(r.result).split(`,`)[1]||``),r.onerror=n,r.readAsDataURL(e)})}let Pe={"image/png":`png`,"image/jpeg":`jpg`,"image/gif":`gif`,"image/webp":`webp`,"application/pdf":`pdf`,"audio/mpeg":`mp3`,"audio/ogg":`ogg`,"video/mp4":`mp4`,"video/webm":`webm`,"text/plain":`txt`},Fe=0;function Ie(e){return Pe[e]||(String(e||``).split(`/`)[1]||``).replace(/[^a-z0-9].*$/i,``)||`bin`}function Le(e){return e.name&&/\.[^.]+$/.test(e.name)?e.name:`pasted-${++Fe}.${Ie(e.type)}`}async function Re(e){for(let t of e){let e=await Ne(t),n=Le(t);N(oe,[...B(oe),{name:n,payload:{name:n,mime:t.type,data:e}}],!0)}}async function ze(e){await Re(e.currentTarget.files||[]),le&&(le.value=``)}function Be(e){let t=[...e.clipboardData?.items||[]].filter(e=>e.kind===`file`).map(e=>e.getAsFile()).filter(e=>e!==null);t.length&&(e.preventDefault(),Re(t))}function Ve(e){[...e.dataTransfer?.types||[]].includes(`Files`)&&(e.preventDefault(),N(se,!0))}function He(e){let t=e.relatedTarget;(!(t instanceof Node)||!e.currentTarget.contains(t))&&N(se,!1)}function Ue(e){let t=e.dataTransfer?.files;!t||!t.length||(e.preventDefault(),N(se,!1),Re(t))}let We=e=>{N(oe,B(oe).filter((t,n)=>n!==e),!0)};var Ge=DM(),Ke=I(Ge),qe=F(Ke);let Je;var Ye=F(qe),Xe=e=>{var t=dM(),n=F(t),r=e=>{var t=cM(),n=L(t);z(()=>W(n,`+${B(C)??``} inherited folder${B(C)===1?``:`s`}`)),V(`click`,t,()=>N(v,!0)),U(e,t)};G(n,e=>{B(C)&&e(r)}),K(R(n,2),17,()=>B(S),e=>e.id,(e,t)=>{var n=uM();let r;var i=F(n),a=F(i);$(a,{name:`folder`,size:13});var o=R(a);D(i);var s=R(i,2),c=e=>{U(e,lM())};G(s,e=>{B(t).mode===`read_write`&&e(c)});var l=R(s,2);D(n),z(()=>{r=q(n,1,`chip folder svelte-1n8df3y`,null,r,{missing:!B(t).exists}),J(i,`title`,`${B(t).path} · ${B(t).mode===`read_write`?`read + write`:`read`}`),W(o,` ${B(t).name??``}`),l.disabled=B(y)}),V(`click`,i,()=>N(v,!0)),V(`click`,l,()=>te(B(t))),U(e,n)}),D(t),U(e,t)};G(Ye,e=>{B(m)&&(B(C)||B(S).length)&&e(Xe)});var Ze=R(Ye,2),Qe=e=>{var t=fM();let n;var r=L(t,!0);z(()=>{n=q(t,1,`cfmsg svelte-1n8df3y`,null,n,{err:!!B(b)}),W(r,B(b)||B(x))}),U(e,t)};G(Ze,e=>{B(m)&&(B(x)||B(b))&&e(Qe)});var $e=R(Ze,2),et=e=>{var t=mM();K(t,21,()=>B(oe),Qi,(e,t,n)=>{var r=pM(),i=F(r);$(i,{name:`paperclip`,size:13});var a=R(i),o=R(a);D(r),z(()=>W(a,` ${B(t).name??``}`)),V(`click`,o,()=>We(n)),U(e,r)}),D(t),U(e,t)};G($e,e=>{B(oe).length&&e(et)});var nt=R($e,2);Qa(nt,e=>le=e,()=>le);var rt=R(nt,2),it=e=>{var t=vM(),n=F(t),r=e=>{var t=Bi();K(I(t),19,()=>B(he),e=>e.path,(e,t,n)=>{var r=gM();let i;var a=F(r);{let e=j(()=>B(t).kind===`directory`?`folder`:`file-text`);$(a,{get name(){return B(e)},size:14})}var o=R(a,2),s=L(o,!0),c=R(o,2),l=e=>{var n=hM(),r=L(n,!0);z(()=>W(r,B(t).dir)),U(e,n)};G(c,e=>{B(t).dir&&e(l)}),D(r),Qa(r,(e,t)=>be[t]=e,e=>be?.[e],()=>[B(n)]),z(()=>{i=q(r,1,`atrow svelte-1n8df3y`,null,i,{sel:B(n)===B(ge)}),J(r,`aria-selected`,B(n)===B(ge)),W(s,B(t).name)}),V(`mousedown`,r,e=>{e.preventDefault(),De(B(t))}),Oi(`mouseenter`,r,()=>N(ge,B(n),!0)),U(e,r)}),U(e,t)},i=e=>{var t=_M(),n=L(t,!0);z(()=>W(n,B(pe)?`No matching files`:`Type to search files…`)),U(e,t)};G(n,e=>{B(he).length?e(r):e(i,-1)}),D(t),Qa(t,e=>N(ye,e),()=>B(ye)),U(e,t)};G(rt,e=>{B(E)&&e(it)});var at=R(rt,2),ot=F(at);K(ot,21,()=>B(xe),Qi,(e,t)=>{var n=Bi(),r=I(n),i=e=>{var n=yM(),r=L(n,!0);z(()=>W(r,B(t).text)),U(e,n)},a=e=>{var n=zi();z(()=>W(n,B(t).text)),U(e,n)};G(r,e=>{B(t).mark?e(i):e(a,-1)}),U(e,n)}),D(ot),Qa(ot,e=>ue=e,()=>ue);var st=R(ot,2);tn(st),Qa(st,e=>ce=e,()=>ce),D(at);var ct=R(at,2),lt=F(ct);$(F(lt),{name:`plus`,size:18}),D(lt);var ut=R(lt,2),dt=e=>{var t=bM();$(F(t),{name:`folder-plus`,size:18}),D(t),V(`click`,t,T),U(e,t)};G(ut,e=>{B(m)&&e(dt)});var ft=R(ut,2),pt=F(ft);sM(pt,{});var mt=R(pt,2),ht=F(mt);let gt;$(F(ht),{name:`waveform`,size:18}),D(ht);var _t=R(ht,2),vt=e=>{U(e,xM())};G(_t,e=>{B(re)&&!c().active&&e(vt)}),D(mt);var yt=R(mt,2),bt=e=>{var t=SM();$(F(t),{name:`square`,size:15}),D(t),V(`click`,t,function(...e){tx?.apply(this,e)}),U(e,t)},xt=e=>{var t=wM(),n=F(t);$(F(n),{name:`arrow-up`,size:18}),D(n);var r=R(n,2),i=e=>{U(e,CM())};G(r,e=>{B(ie)&&e(i)}),D(t),z(e=>{n.disabled=e,J(n,`title`,B(ie)?void 0:`Send`)},[()=>B(ie)||!B(ae).trim()&&!B(oe).length]),V(`click`,n,Oe),U(e,t)};G(yt,e=>{i().busy?e(bt):e(xt,-1)}),D(ft),D(ct),D(qe),tt(2),D(Ke);var St=R(Ke,2),Ct=e=>{var t=EM(),n=I(t),r=R(n,2),i=R(F(r),4),a=e=>{var t=TM(),n=L(t,!0);z(()=>W(n,B(b))),U(e,t)};G(i,e=>{B(b)&&e(a)});var o=R(i,2);{let e=j(()=>B(g).cwd||B(g).home||``);yS(o,{get roots(){return B(g)},get start(){return B(e)},get busy(){return B(y)},onUse:ee})}var s=R(o,2);D(r),V(`click`,n,()=>N(_,!1)),V(`click`,s,()=>N(_,!1)),U(e,t)};G(St,e=>{B(_)&&e(Ct)});var wt=R(St,2),Tt=e=>{MC(e,{get chatId(){return B(f)},get taskId(){return B(p)},onClose:ne})};G(wt,e=>{B(v)&&e(Tt)}),z(e=>{Je=q(qe,1,`inputbox svelte-1n8df3y`,null,Je,{busy:i().busy,dragging:B(se)}),J(st,`placeholder`,e),gt=q(ht,1,`cbtn live svelte-1n8df3y`,null,gt,{on:c().active,needcfg:B(re)&&!c().active}),J(ht,`title`,B(re)?void 0:`Live voice`),J(ht,`aria-label`,B(re)?`Configure a Live model`:`Live voice`)},[()=>Ae()]),Oi(`dragover`,qe,Ve),Oi(`dragleave`,qe,He),Oi(`drop`,qe,Ue),V(`change`,nt,ze),V(`input`,st,()=>{je(),Te(),de()}),V(`keydown`,st,ke),V(`keyup`,st,Te),V(`click`,st,Te),Oi(`scroll`,st,de),Oi(`blur`,st,()=>we()),Oi(`paste`,st,Be),qa(st,()=>B(ae),e=>N(ae,e)),V(`click`,lt,()=>le?.click()),V(`click`,ht,Me),U(e,Ge),k(),u()}ki([`click`,`change`,`mousedown`,`input`,`keydown`,`keyup`]);var kM=H(`
`);function AM(e){U(e,kM())}var jM=H(``),MM=H(` `),NM=H(`
`);function PM(e,t){O(t,!1);let n=()=>A(Vo,`$runInfo`,r),[r,i]=Zt(),a=[`completed`,`failed`,`cancelled`],o={completed:`✓ completed`,failed:`✗ failed`,cancelled:`cancelled`,running:`running…`,needs_input:`needs your input`};$a();var s=Bi(),c=I(s),l=e=>{var t=NM(),r=F(t),i=F(r);$(i,{name:`list`,size:13});var s=R(i);D(r);var c=R(r,2),l=L(c),u=R(c,2),d=e=>{var t=jM();$(F(t),{name:`x`,size:13}),tt(),D(t),V(`click`,t,()=>Q.stopRun(n().id)),U(e,t)},f=j(()=>!a.includes(n().status));G(u,e=>{B(f)&&e(d)});var p=R(u,2),m=e=>{var t=MM(),r=F(t);$(r,{name:`x`,size:13});var i=R(r);D(t),z(()=>W(i,` ${n().error??``}`)),U(e,t)};G(p,e=>{n().status===`failed`&&n().error&&e(m)}),D(t),z(e=>{W(s,` ${(n().task_name||`Task`)??``}`),W(l,`${e??``} · ${(o[n().status]||n().status)??``}`)},[()=>gy(n().started_at)]),V(`click`,r,()=>Fs(`/t/`+n().task_id)),U(e,t)};G(c,e=>{n()&&e(l)}),U(e,s),k(),i()}ki([`click`]);var FM=H(``);function IM(e,t){O(t,!0);let n=M(P(C())),r={light:`sun`,dark:`moon`,auto:`contrast`},i=[`light`,`dark`,`auto`];function a(){N(n,i[(i.indexOf(B(n))+1)%i.length],!0),S(B(n))}hr(()=>{let e=e=>{N(n,e.detail.theme,!0)};return document.addEventListener(`ag2-theme-change`,e),()=>document.removeEventListener(`ag2-theme-change`,e)});var o=FM(),s=F(o);$(s,{get name(){return r[B(n)]},size:15});var c=L(R(s),!0);D(o),z(()=>{J(o,`title`,`Theme: `+B(n)+` — click to change`),W(c,B(n))}),V(`click`,o,a),U(e,o),k()}ki([`click`]);var LM=H(`
Checking…
`),RM=H(`
`),zM=H(``),BM=H(`
`),VM=H(`
`),HM=H(`
`,1),UM=H(``),WM=H(`
`);function GM(e,t){O(t,!0);let n=M(null),r=M(!1),i=M(void 0),a=P({}),o=j(()=>(B(n)?.checks||[]).find(e=>e.id===`mcp`)),s={ok:0,off:0,warn:1,down:2},c=j(()=>{let e=B(n)?.overall||`ok`,t=new Set((B(o)?.servers||[]).map(e=>e.name));return Object.entries(a).some(([e,n])=>t.has(e)&&n&&n.ok===!1)&&s[e]<1&&(e=`warn`),e}),l={ok:`All systems healthy`,warn:`Needs attention — click for details`,down:`Problem — click for details`};async function u(){try{N(n,await Q.health(),!0)}catch{}}function d(){let e=B(o)?.servers||[];for(let t of e)t.enabled!==!1&&a[t.name]?.ok!==!1&&f(t.name)}async function f(e){a[e]={checking:!0};try{a[e]=await Q.healthMcpServer(e)}catch(t){a[e]={ok:!1,error:nS(t)}}}function p(){N(r,!B(r)),B(r)&&d()}function m(e){B(r)&&B(i)&&e.target instanceof Node&&!B(i).contains(e.target)&&N(r,!1)}function h(e){B(r)&&e.key===`Escape`&&N(r,!1)}io(()=>{u();let e=setInterval(u,5e3);return document.addEventListener(`pointerdown`,m,!0),document.addEventListener(`keydown`,h),()=>{clearInterval(e),document.removeEventListener(`pointerdown`,m,!0),document.removeEventListener(`keydown`,h)}});var g=WM(),_=F(g);let v;var y=R(_,2),b=e=>{var t=UM(),r=R(F(t),2),i=e=>{U(e,LM())},o=e=>{var t=Bi();K(I(t),17,()=>B(n).checks,e=>e.id,(e,t)=>{var n=HM(),r=I(n),i=F(r),o=R(i,2),s=F(o),c=L(s,!0),l=R(s,2),u=e=>{var n=RM(),r=L(n,!0);z(()=>W(r,B(t).detail)),U(e,n)};G(l,e=>{B(t).detail&&e(u)}),D(o),D(r);var d=R(r,2),p=e=>{var n=VM();K(n,21,()=>B(t).servers,e=>e.name,(e,t)=>{let n=j(()=>a[B(t).name]);var r=BM(),i=F(r),o=R(i,2),s=L(o,!0),c=R(o,2);let l;var u=F(c),d=e=>{U(e,zi(`disabled`))},p=e=>{U(e,zi(`—`))},m=e=>{U(e,zi(`checking…`))},h=e=>{var t=zi();z(()=>W(t,`healthy · ${(B(n).tools||[]).length??``} tools`)),U(e,t)},g=e=>{var t=zi();z(()=>W(t,B(n).error)),U(e,t)};G(u,e=>{B(t).enabled===!1?e(d):B(n)?B(n).checking?e(m,2):B(n).ok?e(h,3):e(g,-1):e(p,1)}),D(c);var _=R(c,2),v=e=>{var n=zM();$(F(n),{name:`rotate-cw`,size:12}),D(n),V(`click`,n,()=>f(B(t).name)),U(e,n)};G(_,e=>{B(t).enabled!==!1&&!(B(n)&&B(n).checking)&&e(v)}),D(r),z(()=>{q(i,1,`rowdot state-${B(n)?.ok?`ok`:B(n)?.ok===!1?`down`:`off`}`,`svelte-ozppsh`),J(o,`title`,B(t).name),W(s,B(t).name),l=q(c,1,`srvstat svelte-ozppsh`,null,l,{bad:B(n)&&B(n).ok===!1})}),U(e,r)}),D(n),U(e,n)};G(d,e=>{B(t).id===`mcp`&&(B(t).servers||[]).length&&e(p)}),z(()=>{q(i,1,`rowdot state-${B(t).state??``}`,`svelte-ozppsh`),W(c,B(t).label)}),U(e,n)}),U(e,t)};G(r,e=>{B(n)?e(o,-1):e(i)}),D(t),U(e,t)};G(y,e=>{B(r)&&e(b)}),D(g),Qa(g,e=>N(i,e),()=>B(i)),z(()=>{v=q(_,1,`shdot state-${B(c)??``}`,`svelte-ozppsh`,v,{open:B(r)}),J(_,`title`,l[B(c)]||`System health`),J(_,`aria-expanded`,B(r))}),V(`click`,_,p),U(e,g),k()}ki([`click`]);var KM=H(``),qM=H(` `),JM=H(`
`);function YM(e,t){O(t,!0);let n=()=>A(Ks,`$ag2View`,r),[r,i]=Zt(),a=ro(t,`back`,3,null),o=ro(t,`title`,3,``),s=ro(t,`subtitle`,3,``);var c=JM(),l=F(c),u=e=>{var t=KM(),n=F(t);$(n,{name:`chevron-left`,size:15});var r=R(n);D(t),z(()=>W(r,` ${a().label??``}`)),V(`click`,t,function(...e){a().onClick?.apply(this,e)}),U(e,t)};G(l,e=>{a()&&e(u)});var d=R(l,2),f=F(d),p=L(f,!0),m=R(f,2),h=e=>{var t=qM(),n=L(t,!0);z(()=>W(n,s())),U(e,t)};G(m,e=>{s()&&e(h)}),D(d);var g=R(d,2);ca(g,()=>t.children??ue);var _=R(g,2),v=F(_);GM(v,{});var y=R(v,2);IM(y,{});var b=R(y,2);let x;$(F(b),{name:`code`,size:14}),tt(),D(b),D(_),D(c),z(()=>{W(p,o()),x=q(b,1,`ag2toggle`,null,x,{on:n(),"ag2-glow":n()})}),V(`click`,b,function(...e){Gs?.apply(this,e)}),U(e,c),k(),i()}ki([`click`]);var XM=H(` `),ZM=H(` `),QM=H(` `,1),$M=H(`

Ask me anything — I can search, run code, manage tasks, and more.
`),eN=H(`
`),tN=H(``),nN=H(`

`),rN=H(`

A remote client is driving this chat — the composer is unavailable until it ends.

`),iN=H(`
`,1);function aN(e,t){O(t,!0);let n=()=>A(Fo,`$thread`,l),r=()=>A(No,`$profiles`,l),i=()=>A(Io,`$chatModel`,l),a=()=>A(aT,`$llmConfigs`,l),o=()=>A(Lo,`$chats`,l),s=()=>A(Vo,`$runInfo`,l),c=()=>A(ds,`$profile`,l),[l,u]=Zt(),d,f=j(()=>n().items[n().items.length-1]),p=j(()=>r().list.find(e=>e.id===r().activeId)),m=j(()=>_o(i(),n().kind===`chat`?n().id:null,a().active)),h=j(()=>a().configs.find(e=>e.id===B(m))),g=j(()=>[B(p)?.name,B(h)?.name].filter(Boolean).join(` • `)),_=j(()=>n().kind===`chat`?o().find(e=>e.chat_id===n().id):void 0),v=j(()=>B(_)?.origin_platform===`acp`?B(_):void 0),y=j(()=>!!B(v)?.origin_live),b=M(!1),x=M(``);async function S(){if(!(!n().id||B(b))){N(b,!0),N(x,``);try{await Q.closeAcpSession(n().id)}catch(e){N(x,nS(e),!0)}N(b,!1)}}let C=j(()=>hy(n().items)),w=j(()=>n().busy&&!(B(f)&&B(f).kind===`agent`&&B(f).streaming)),T=M(!0);function ee(){d&&N(T,d.scrollHeight-d.scrollTop-d.clientHeight<80)}function te(){if(!d)return;let e=d,t=e.scrollTop,n=e.scrollHeight-e.clientHeight-t;if(n<=4){e.scrollTop=e.scrollHeight,N(T,!0);return}let r=Math.min(600,240+n*.3),i=e=>1-(1-e)**3,a=null;function o(s){a===null&&(a=s);let c=Math.min(1,(s-a)/r);e.scrollTop=t+n*i(c),c<1?requestAnimationFrame(o):N(T,!0)}requestAnimationFrame(o)}let ne=M(160),re=j(()=>Math.round(B(ne)-28+12));hr(()=>{let e=d?.parentElement?.querySelector(`.composer`);if(!e)return;let t=new ResizeObserver(()=>{N(ne,e.offsetHeight,!0)});return t.observe(e),()=>t.disconnect()});let ie=null;hr(()=>{n().id!==ie&&(ie=n().id,N(T,!0))});let ae=null;hr(()=>{B(f)&&B(f).kind===`user`&&B(f).id!==ae&&(ae=B(f).id,N(T,!0))}),hr(()=>{n().items,B(w),B(T)&&requestAnimationFrame(()=>{d&&B(T)&&(d.scrollTop=d.scrollHeight)})});var oe=iN(),se=I(oe);{let e=j(()=>({label:n().kind===`run`?`Task`:`Chat`,onClick:()=>Fs(n().kind===`run`?s()?.task_id?`/t/`+s().task_id:`/tasks`:`/c/`+qs())})),t=j(()=>n().kind===`run`?s()&&s().task_name||`Task`:`Conversation`);YM(se,{get back(){return B(e)},get title(){return B(t)},get subtitle(){return B(g)},children:(e,t)=>{var r=QM(),i=I(r),a=e=>{var t=XM(),n=L(t,!0);z(()=>W(n,s().status)),U(e,t)};G(i,e=>{n().kind===`run`&&s()&&e(a)});var o=R(i,2),c=e=>{var t=ZM();let n;var r=L(t);z(()=>{n=q(t,1,`badge acpbadge svelte-1uxvm9k`,null,n,{live:B(y)}),J(t,`title`,B(y)?`Live — driven by the “${B(v).origin_name}” ACP listener`:`Started by the “${B(v).origin_name}” ACP listener`),W(r,`ACP · ${B(v).origin_name??``}`)}),U(e,t)};G(o,e=>{B(v)&&e(c)}),U(e,r)},$$slots:{default:!0}})}var ce=R(se,2),le=F(ce),ue=F(le),de=e=>{PM(e,{})};G(ue,e=>{n().kind===`run`&&e(de)});var fe=R(ue,2),E=e=>{var t=$M(),n=L(F(t));tt(),D(t),z(()=>W(n,`How can I help${c().name?`, ${c().name}`:``}?`)),U(e,t)};G(fe,e=>{!n().items.length&&n().kind===`chat`&&e(E)});var pe=R(fe,2);K(pe,17,()=>B(C),({item:e,sep:t})=>e.id,(e,t)=>{let n=()=>B(t).item,r=()=>B(t).sep;var i=QM(),a=I(i),o=e=>{var t=eN(),n=L(F(t),!0);D(t),z(()=>W(n,r())),U(e,t)};G(a,e=>{r()&&e(o)}),Oj(R(a,2),{get item(){return n()}}),U(e,i)});var me=R(pe,2),he=e=>{AM(e,{})};G(me,e=>{B(w)&&e(he)}),D(le),D(ce),Qa(ce,e=>d=e,()=>d);var ge=R(ce,2),_e=e=>{var t=tN();$(F(t),{name:`chevron-down`,size:18}),D(t),z(()=>xa(t,`bottom: ${B(re)??``}px`)),V(`click`,t,te),U(e,t)};G(ge,e=>{B(T)||e(_e)});var ve=R(ge,2),ye=e=>{var t=rN(),n=R(F(t),2),r=e=>{var t=nN(),n=L(t,!0);z(()=>W(n,B(x))),U(e,t)};G(n,e=>{B(x)&&e(r)});var i=R(n,2),a=F(i);$(a,{name:`x`,size:14});var o=R(a);D(i),D(t),z(()=>{i.disabled=B(b),W(o,` ${B(b)?`Closing…`:`Close session`}`)}),V(`click`,i,S),U(e,t)},be=e=>{OM(e,{})};G(ve,e=>{B(y)?e(ye):e(be,-1)}),Oi(`scroll`,ce,ee),U(e,oe),k(),u()}ki([`click`]);var oN=e=>e===`read`||e===`read_write`;function sN(e,t){return e?!t||t===e?null:t:oN(t)?t:null}function cN(e,t){let n=e||[],r=t||[],i=[],a=new Map(n.filter(e=>e.id!=null).map(e=>[e.id,e])),o=new Map(n.map(e=>[e.path,e])),s=new Set;for(let e of r){let t=e.id==null?o.get(e.path):a.get(e.id);t&&s.add(t);let n=e.profileMode??t?.profileMode??null,r=t?.taskMode??null,c=sN(n,e.mode);if(c!==r){if(c===null){i.push({kind:`revoke`,id:e.id??t?.id??null,path:e.path});continue}e.id==null&&!t&&i.push({kind:`create-folder`,path:e.path}),i.push({kind:`set-grant`,id:e.id??t?.id??null,path:e.path,mode:c})}}for(let e of n)s.has(e)||e.taskMode!=null&&i.push({kind:`revoke`,id:e.id,path:e.path});return i}var lN=(e,t)=>{let n=e=>({kind:e?.kind??`manual`,at:e?.at??null,cron:e?.cron??null}),r=n(e),i=n(t);return r.kind===i.kind&&r.at===i.at&&r.cron===i.cron};function uN(e){let t=e?.kind;return{kind:t===`once`||t===`cron`?t:`manual`,at:typeof e?.at==`string`?e.at:null,cron:typeof e?.cron==`string`?e.cron:null}}function dN(e){let t=Math.floor(Number(e));return Number.isFinite(t)&&t>=1?t:1}function fN(e,t){let n={},r=(t.name||``).trim();r&&r!==(e?.name||``)&&(n.name=r);let i=(t.description||``).trim();i!==(e?.description||``)&&(n.description=i);let a=(t.prompt||``).trim();a!==(e?.prompt||``)&&(n.prompt=a);let o=t.model??``;o!==(e?.model??``)&&(n.model=o),lN(e?.schedule,t.schedule)||(n.schedule=t.schedule);let s=t.recall_depth??0;return s!==(e?.recall_depth??0)&&(n.recall_depth=s),n}var pN=H(``),mN=H(``),hN=H(``),gN=H(``),_N=H(`
`);function vN(e,t){O(t,!0);let n=ro(t,`schedule`,15),r=[{id:`manual`,label:`Manual`},{id:`hourly`,label:`Hourly`},{id:`daily`,label:`Daily`},{id:`weekly`,label:`Weekly`},{id:`weekdays`,label:`Weekdays`},{id:`custom`,label:`Custom cron`},{id:`once`,label:`Once at…`}];function i(e){if(e.kind===`manual`)return`manual`;if(e.kind===`once`)return`once`;let t=e.cron||``;return t===`0 * * * *`?`hourly`:/^\d+ \d+ \* \* \*$/.test(t)?`daily`:/^\d+ \d+ \* \* 1$/.test(t)?`weekly`:/^\d+ \d+ \* \* 1-5$/.test(t)?`weekdays`:`custom`}function a(e){let t=(e||``).match(/^(\d+) (\d+) /);return t?String(t[2]).padStart(2,`0`)+`:`+String(t[1]).padStart(2,`0`):`09:00`}let o=M(P(i(n()))),s=M(P(a(n().cron))),c=M(P(n().cron||``)),l=M(P(n().at?n().at.slice(0,16):``));function u(){let[e,t]=(B(s)||`09:00`).split(`:`).map(Number);B(o)===`manual`?n({kind:`manual`,at:null,cron:null}):B(o)===`once`?n({kind:`once`,at:B(l)?new Date(B(l)).toISOString():null,cron:null}):B(o)===`hourly`?n({kind:`cron`,at:null,cron:`0 * * * *`}):B(o)===`daily`?n({kind:`cron`,at:null,cron:`${t} ${e} * * *`}):B(o)===`weekly`?n({kind:`cron`,at:null,cron:`${t} ${e} * * 1`}):B(o)===`weekdays`?n({kind:`cron`,at:null,cron:`${t} ${e} * * 1-5`}):n({kind:`cron`,at:null,cron:B(c).trim()})}var d=_N(),f=F(d);K(f,21,()=>r,Qi,(e,t)=>{var n=pN(),r=L(n,!0),i={};z(()=>{W(r,B(t).label),i!==(i=B(t).id)&&(n.value=(n.__value=i)??``)}),U(e,n)}),D(f),Ea(f);var p=R(f,2),m=e=>{var t=mN();za(t),V(`change`,t,u),qa(t,()=>B(s),e=>N(s,e)),U(e,t)},h=j(()=>[`daily`,`weekly`,`weekdays`].includes(B(o))),g=e=>{var t=hN();za(t),V(`change`,t,u),qa(t,()=>B(c),e=>N(c,e)),U(e,t)},_=e=>{var t=gN();za(t),V(`change`,t,u),qa(t,()=>B(l),e=>N(l,e)),U(e,t)};G(p,e=>{B(h)?e(m):B(o)===`custom`?e(g,1):B(o)===`once`&&e(_,2)}),D(d),V(`change`,f,u),Da(f,()=>B(o),e=>N(o,e)),U(e,d),k()}ki([`change`]);var yN=H(``),bN=H(``),xN=H(`

`,1);function SN(e,t){O(t,!0);let n=ro(t,`depth`,15),r=[{id:`none`,label:`No recall`},{id:`last`,label:`Last N runs`},{id:`all`,label:`All previous runs`}],i=M(P((e=>e?e<0?`all`:`last`:`none`)(n()))),a=M(P(n()>0?n():5));function o(){B(i)===`none`?n(0):B(i)===`all`?n(-1):n(N(a,dN(B(a)),!0))}var s=xN(),c=I(s),l=F(c);K(l,21,()=>r,Qi,(e,t)=>{var n=yN(),r=L(n,!0),i={};z(()=>{W(r,B(t).label),i!==(i=B(t).id)&&(n.value=(n.__value=i)??``)}),U(e,n)}),D(l),Ea(l);var u=R(l,2),d=e=>{var t=bN();za(t),V(`change`,t,o),qa(t,()=>B(a),e=>N(a,e)),U(e,t)};G(u,e=>{B(i)===`last`&&e(d)}),D(c);var f=R(c,2),p=F(f),m=e=>{U(e,zi(`Each run starts fresh, with no knowledge of earlier runs.`))},h=e=>{U(e,zi(`Each run is given a one-line summary of earlier runs, and can open any of them in full.`))};G(p,e=>{B(i)===`none`?e(m):e(h,-1)}),D(f),V(`change`,l,o),Da(l,()=>B(i),e=>N(i,e)),U(e,s),k()}ki([`change`]);var CN=H(`
`),wN=H(` `,1),TN=H(`
`),EN=H(` `),DN=H(`

`,1),ON=H(``),kN=H(` `,1),AN=H(`Delete permanently? `),jN=H(` `,1),MN=H(``),NN=H(`
No runs yet — hit Run now, or wait for the schedule.
`),PN=H(``),FN=H(`

History

`),IN=H(``),LN=H(`

`),RN=H(` `,1),zN=H(` `),BN=H(``),VN=H(` `,1),HN=H(`
`),UN=H(`
`),WN=H(`
`),GN=H(`
Task folders
`,1),KN=H(`
`),qN=H(`
Profile folders
`,1),JN=H(`
`),YN=H(` `,1),XN=H(`
`),ZN=H(` `,1),QN=H(`

—

`),$N=H(`

`),eP=H(`
`),tP=H(`

Approvals you grant during a run appear here.

`),nP=H(`

Always allowed

`,1),rP=H(`

Instructions

Model

Folders

Repeats

Recall earlier runs

`,1),iP=H(`
Loading…
`),aP=H(`
`,1);function oP(e,t){O(t,!0);let n=()=>A(js,`$route`,c),r=()=>A(No,`$profiles`,c),i=()=>A(gC,`$foldersStore`,c),a=()=>A(aT,`$llmConfigs`,c),o=()=>A(Ho,`$pendingTaskEdit`,c),s=()=>A(Ro,`$tasks`,c),[c,l]=Zt(),u=[`completed`,`failed`,`cancelled`],d=M(null),f=M(P([])),p=M(!1),m=M(!1),h=M(!1),g=M(``),_=M(!1),v=M(!1),y=M(``),b=M(``),x=M(``),S=M(null),C=M(P({kind:`manual`,at:null,cron:null})),w=M(0),T=M(P([])),ee=M(!1),te=M(!1),ne=M(P({})),re=!1,ie=j(()=>n().id===`new`),ae=j(()=>B(_)||B(ie)),oe=j(()=>r().activeId||hs()||``);io(()=>{i().loaded||_C(),a().loaded||oT(),Q.settings().then(e=>{N(ne,e.fs,!0)}).catch(()=>{})});let se=j(()=>r().list.find(e=>e.id===r().activeId)),ce=j(()=>B(ae)?B(S):B(d)?.model),le=j(()=>a().configs.find(e=>e.id===(B(ce)||a().active))),ue=j(()=>[B(se)?.name,B(le)?.name].filter(Boolean).join(` • `)),de=j(()=>{let e=B(d)?.model;return e?a().configs.find(t=>t.id===e)?.name||e:`Profile default`}),fe=j(()=>a().configs.find(e=>e.id===B(S))||null),E=j(()=>{let e=B(d)?.model;return e&&a().configs.find(t=>t.id===e)||null});function pe(e){N(S,e,!0),N(te,!1)}function me(){N(te,!1),Rs(`settings`,yo.MODELS)}let he=e=>{let t=B(d);return t?e.grants.find(e=>e.profile===B(oe)&&e.task_id===t.id&&!e.chat_id):void 0},ge=e=>e.grants.find(e=>e.profile===B(oe)&&!e.chat_id&&!e.task_id),_e=e=>{let t=he(e);return t?t.mode:ge(e)?.mode},ve=j(()=>i().folders),ye=j(()=>B(d)?B(ve).filter(e=>{let t=he(e);return t&&t.mode!==`none`&&!ge(e)}):[]),be=j(()=>B(d)?B(ve).filter(e=>ge(e)&&_e(e)!==`none`):[]),xe=j(()=>B(ye).length>0||B(be).length>0),Se=e=>e===`read_write`?`Read + write`:`Read`;function Ce(){return B(d)?B(ve).filter(e=>ge(e)||he(e)).map(e=>({id:e.id,path:e.path,name:e.name,exists:e.exists!==!1,profileMode:ge(e)?.mode??null,taskMode:he(e)?.mode??null})):[]}let we=j(()=>B(T).filter(e=>e.profileMode==null)),Te=j(()=>B(T).filter(e=>e.profileMode!=null)),Ee=M(!1);async function De(){if(!(!B(d)||B(Ee))){N(Ee,!0);try{await Q.taskRunsSeen(B(d).id),await ke(B(d).id)}finally{N(Ee,!1)}}}let Oe=0;async function ke(e){let t=++Oe;if(N(g,``),N(h,!1),N(_,!1),re=!1,e===`new`){N(d,null),N(f,[],!0),je(null),N(_,!0);return}if(!e){N(d,null),N(f,[],!0);return}try{let[n,r]=await Promise.all([Q.task(e),Q.taskPermissions(e).catch(()=>[])]);if(t!==Oe)return;N(d,n,!0),N(f,r,!0),Be(n)}catch{t===Oe&&(N(g,`Task not found.`),N(d,null),N(f,[],!0))}}let Ae=``;hr(()=>{let e=n().id;e!==Ae&&(Ae=e,ke(e))}),hr(()=>{B(d)&&i().loaded&&o()===B(d).id&&(Ho.set(null),Ne())}),hr(()=>{B(ie)&&i().loaded&&!re&&(re=!0,N(T,Me(),!0))}),hr(()=>{let e=B(d);if(!e)return;let t=s().find(t=>t.id===e.id);t&&(t.name!==e.name||t.paused!==e.paused)&&N(d,{...e,name:t.name,paused:t.paused},!0)});function je(e){N(y,e?.name||``,!0),N(b,e?.description||``,!0),N(x,e?.prompt||``,!0),N(S,e?.model??null,!0),N(C,e?uN(St(e.schedule)):{kind:`manual`,at:null,cron:null},!0),N(w,e?.recall_depth??0,!0),N(T,e?Ce().map(e=>({...e,mode:e.taskMode??e.profileMode})):Me(),!0),N(ee,!1),N(te,!1)}function Me(){let e=[];for(let t of B(ve)){let n=ge(t);n&&e.push({id:t.id,path:t.path,name:t.name,exists:t.exists!==!1,profileMode:n.mode,taskMode:null,mode:n.mode})}return e}function Ne(){B(d)&&(je(B(d)),N(g,``),N(_,!0))}function Pe(){N(_,!1),N(g,``)}function Fe(e,t){e.profileMode==null?t===null?N(T,B(T).filter(t=>t!==e),!0):N(T,B(T).map(n=>n===e?{...n,mode:t}:n),!0):N(T,B(T).map(n=>n===e?{...n,mode:t??`none`}:n),!0)}function Ie(e){N(ee,!1),!(!e||B(T).some(t=>t.path===e))&&N(T,[...B(T),{id:null,path:e,name:e,exists:!0,profileMode:null,taskMode:null,mode:`read`}],!0)}async function Le(e,t){let n={};for(let r of e)if(r.kind===`create-folder`){let e,t;try{e=await Q.createFolder(r.path),t=e.folders.find(e=>e.path===r.path)}catch(n){let r=n instanceof ug&&n.status===409?G_.safeParse(n.body):null;if(r?.success)e=await Q.folders(),t=e.folders.find(e=>e.id===r.data.existing.id);else throw n}t&&(n[r.path]=t.id,vC(e))}else if(r.kind===`set-grant`){let e=r.id??n[r.path];e&&vC(await Q.setGrant(e,B(oe),r.mode,``,t))}else if(r.kind===`revoke`){let e=r.id??n[r.path];e&&vC(await Q.revokeGrant(e,B(oe),``,t))}}async function Re(){if(!B(x).trim()||B(v))return;let e=B(d);if(!(!B(ie)&&!e)){N(v,!0),N(g,``);try{if(B(ie)||!e){let e=await Q.createTask({name:B(y).trim(),description:B(b).trim(),prompt:B(x).trim(),model:B(S)??``,schedule:St(B(C)),recall_depth:B(w)});Be(e);try{await Le(cN([],St(B(T))),e.id)}catch{}Fs(`/t/`+e.id)}else{let t=fN(e,{name:B(y),description:B(b),prompt:B(x),model:B(S),schedule:St(B(C)),recall_depth:B(w)}),n=Object.keys(t).length?await Q.updateTask(e.id,t):e;N(d,n,!0),Be(n),await Le(cN(Ce(),St(B(T))),e.id),N(_,!1)}}catch(e){N(g,nS(e,`save failed`),!0)}finally{N(v,!1)}}}async function ze(){if(!(B(p)||!B(d))){N(p,!0);try{Fs(`/r/`+(await Q.runTask(B(d).id)).id)}catch(e){N(g,nS(e,`run failed`),!0)}finally{N(p,!1)}}}function Be(e){Ro.update(t=>t.map(t=>t.id===e.id?e:t))}async function Ve(){let e=B(d);if(!(!e||B(m))){N(m,!0);try{N(d,await Q.updateTask(e.id,{paused:!e.paused}),!0),Be(B(d))}catch(e){N(g,nS(e,`pause failed`),!0)}finally{N(m,!1)}}}async function He(){if(B(d))try{let e=B(d).id;await Q.deleteTask(e),Ro.update(t=>t.filter(t=>t.id!==e)),Is(`tasks`)}catch(e){N(g,nS(e),!0)}}async function Ue(e){let t=B(d);if(t)try{await Q.deleteTaskPermission(t.id,e),N(f,await Q.taskPermissions(t.id),!0)}catch(e){N(g,nS(e,`revoke failed`),!0)}}let We=e=>e?e<0?`All previous runs`:`Last ${e} runs`:`—`,Ge={running:`spinner`,needs_input:`help-circle`,completed:`check`,failed:`x`,cancelled:`slash`};var Ke=aP();Oi(`keydown`,Xn,e=>{e.key===`Escape`&&N(te,!1)});var qe=I(Ke);{let e=j(()=>B(ae)?B(y)||(B(ie)?`New task`:B(d)?.name)||`Task`:B(d)?.name||`Task`);YM(qe,{back:{label:`Tasks`,onClick:()=>Is(`tasks`)},get title(){return B(e)},get subtitle(){return B(ue)}})}var Je=R(qe,2),Ye=F(Je),Xe=F(Ye),Ze=e=>{var t=CN(),n=F(t);$(n,{name:`x`,size:13});var r=R(n);D(t),z(()=>W(r,` ${B(g)??``}`)),U(e,t)};G(Xe,e=>{B(g)&&e(Ze)});var Qe=R(Xe,2),$e=e=>{var t=rP(),n=I(t),r=F(n),i=F(r),o=e=>{var t=wN(),n=I(t);za(n);var r=R(n,2);za(r),qa(n,()=>B(y),e=>N(y,e)),qa(r,()=>B(b),e=>N(b,e)),U(e,t)},s=e=>{var t=DN(),n=I(t),r=L(n,!0),i=R(n,2),a=e=>{var t=TN(),n=L(t,!0);z(()=>W(n,B(d).description)),U(e,t)};G(i,e=>{B(d).description&&e(a)});var o=R(i,2),s=F(o),c=F(s);za(c),tt(2),D(s);var l=R(s,2);let u;var f=L(l,!0),p=R(l,2),h=e=>{var t=EN(),n=L(t);z(e=>W(n,`Next run: ${e??``}`),[()=>vy(B(d).next_run_at)]),U(e,t)};G(p,e=>{B(d).next_run_at&&!B(d).paused&&e(h)}),D(o),z(()=>{W(r,B(d).name),Va(c,!B(d).paused),c.disabled=B(m),u=q(l,1,`badge svelte-y9xmno`,null,u,{paused:B(d).paused}),W(f,B(d).paused?`Paused`:`Active`)}),V(`change`,c,Ve),U(e,t)};G(i,e=>{B(ae)?e(o):B(d)&&e(s,1)}),D(r);var c=R(r,2),l=F(c),g=e=>{var t=kN(),n=I(t),r=e=>{var t=ON();z(()=>t.disabled=B(v)),V(`click`,t,Pe),U(e,t)};G(n,e=>{B(ie)||e(r)});var i=R(n,2),a=L(i,!0);z(e=>{i.disabled=e,W(a,B(v)?`Saving…`:`Save`)},[()=>!B(x).trim()||B(v)]),V(`click`,i,Re),U(e,t)},_=e=>{var t=jN(),n=I(t);$(F(n),{name:`pencil`,size:15}),D(n);var r=R(n,2),i=F(r);$(F(i),{name:`trash`,size:15}),D(i);var a=R(i,2),o=e=>{var t=AN(),n=R(F(t),2),r=R(n,2);D(t),V(`click`,n,He),V(`click`,r,()=>N(h,!1)),U(e,t)};G(a,e=>{B(h)&&e(o)}),D(r);var s=R(r,2),c=F(s);$(c,{name:`play`,size:14});var l=R(c);D(s),z(()=>{s.disabled=B(p),W(l,` ${B(p)?`Starting…`:`Run now`}`)}),V(`click`,n,Ne),V(`click`,i,()=>N(h,!B(h))),V(`click`,s,ze),U(e,t)};G(l,e=>{B(ae)?e(g):e(_,-1)}),D(c),D(n);var T=R(n,2);let re;var oe=F(T),se=e=>{var t=FN(),n=F(t),r=R(F(n),2),i=e=>{var t=MN();z(()=>t.disabled=B(Ee)),V(`click`,t,De),U(e,t)};G(r,e=>{B(d).unread>0&&e(i)}),D(n);var a=R(n,2),o=e=>{U(e,NN())};G(a,e=>{B(d).runs.length||e(o)});var s=R(a,2);K(s,21,()=>B(d).runs,e=>e.id,(e,t)=>{var n=PN();let r;var i=F(n),a=F(i);{let e=j(()=>Ge[B(t).status]||`clock`);$(a,{get name(){return B(e)},size:13})}D(i);var o=R(i,2),s=L(o,!0),c=L(R(o,2),!0);D(n),z((e,a)=>{r=q(n,1,`runrow svelte-y9xmno`,null,r,{unseen:e}),q(i,1,`statusicon ${B(t).status??``}`,`svelte-y9xmno`),W(s,a),W(c,B(t).summary||B(t).error||B(t).status)},[()=>u.includes(B(t).status)&&!B(t).seen,()=>gy(B(t).started_at)]),V(`click`,n,()=>Fs(`/r/`+B(t).id)),U(e,n)}),D(s),D(t),U(e,t)};G(oe,e=>{!B(ie)&&B(d)&&e(se)});var ce=R(oe,2),le=R(F(ce),2),ue=e=>{var t=IN();tn(t),qa(t,()=>B(x),e=>N(x,e)),U(e,t)},he=e=>{var t=LN(),n=L(t,!0);z(()=>W(n,B(d).prompt)),U(e,t)};G(le,e=>{B(ae)?e(ue):B(d)&&e(he,1)});var ge=R(le,4),ve=e=>{var t=HN(),n=F(t),r=F(n),i=F(r),o=e=>{var t=RN(),n=I(t);qj(n,{get brand(){return B(fe).type},get size(){return 14}});var r=R(n,2),i=L(r,!0),a=R(r,2);let o;z(e=>{W(i,B(fe).name),o=q(a,1,`modelsw-dot`,null,o,{warn:e})},[()=>!sT(B(fe))]),U(e,t)},s=e=>{var t=zN(),n=L(t,!0);z(()=>W(n,B(S)?B(S):`Profile default`)),U(e,t)};G(i,e=>{B(fe)?e(o):e(s,-1)}),$(R(i,2),{name:`chevron-down`,size:13}),D(r);var c=R(r,2),l=e=>{var t=VN(),n=I(t),r=R(n,2),i=F(r);let o;var s=F(i),c=F(s),l=R(F(c)),u=e=>{$(e,{name:`check`,size:12})};G(l,e=>{B(S)??e(u)}),D(c),tt(2),D(s),D(i);var d=R(i,2);K(d,1,()=>a().configs,e=>e.id,(e,t)=>{var n=BN();let r;var i=F(n);qj(i,{get brand(){return B(t).type},get size(){return 14}});var a=R(i,2),o=F(a),s=F(o,!0),c=R(s),l=e=>{$(e,{name:`check`,size:12})};G(c,e=>{B(t).id===B(S)&&e(l)}),D(o);var u=L(R(o,2));D(a);var d=R(a,2);let f;D(n),z((e,i,a)=>{r=q(n,1,`modelsw-item`,null,r,{active:B(t).id===B(S)}),n.disabled=e,J(n,`title`,i),W(s,B(t).name),W(u,`${yx[B(t).type]??``} · ${B(t).model??``}`),f=q(d,1,`modelsw-dot`,null,f,{warn:a})},[()=>!sT(B(t)),()=>sT(B(t))?``:`Not ready — add a key or sign in via Settings`,()=>!sT(B(t))]),V(`click`,n,()=>pe(B(t).id)),U(e,n)});var f=R(d,2);D(r),z(()=>o=q(i,1,`modelsw-item`,null,o,{active:B(S)==null})),V(`click`,n,()=>N(te,!1)),V(`click`,i,()=>pe(null)),V(`click`,f,me),U(e,t)};G(c,e=>{B(te)&&e(l)}),D(n),D(t),z(()=>J(r,`aria-expanded`,B(te))),V(`click`,r,()=>N(te,!B(te))),U(e,t)},Ce=e=>{var t=UN(),n=F(t),r=e=>{var t=RN(),n=I(t);qj(n,{get brand(){return B(E).type},get size(){return 14}});var r=R(n,2),i=L(r,!0),a=R(r,2);let o;z(e=>{W(i,B(E).name),o=q(a,1,`modelsw-dot`,null,o,{warn:e})},[()=>!sT(B(E))]),U(e,t)},i=e=>{var t=zN(),n=L(t,!0);z(()=>W(n,B(de))),U(e,t)};G(n,e=>{B(E)?e(r):e(i,-1)}),D(t),U(e,t)};G(ge,e=>{B(ae)?e(ve):e(Ce,-1)});var Oe=R(ge,4),ke=e=>{var t=YN(),n=I(t),r=e=>{var t=GN();K(R(I(t),2),17,()=>B(we),e=>e.path,(e,t)=>{var n=WN(),r=F(n);$(F(r),{name:`folder`,size:14}),D(r);var i=R(r,2),a=L(i,!0),o=R(i,2),s=F(o);SC(s,{get mode(){return B(t).mode},onchange:e=>Fe(B(t),e)});var c=R(s,2);$(F(c),{name:`trash`,size:14}),D(c),D(o),D(n),z(()=>{J(i,`title`,B(t).path),W(a,B(t).name)}),V(`click`,c,()=>Fe(B(t),null)),U(e,n)}),U(e,t)};G(n,e=>{B(we).length&&e(r)});var i=R(n,2),a=e=>{var t=qN();K(R(I(t),2),17,()=>B(Te),e=>e.path,(e,t)=>{var n=KN(),r=F(n);$(F(r),{name:`folder`,size:14}),D(r);var i=R(r,2),a=L(i,!0);bC(R(i,2),{get mode(){return B(t).mode},onchange:e=>Fe(B(t),e)}),D(n),z(()=>{J(i,`title`,B(t).path),W(a,B(t).name)}),U(e,n)}),U(e,t)};G(i,e=>{B(Te).length&&e(a)});var o=R(i,2);$(F(o),{name:`folder`,size:14}),tt(),D(o);var s=R(o,2),c=e=>{var t=JN(),n=F(t);{let e=j(()=>B(ne).cwd||B(ne).home||``);yS(n,{get roots(){return B(ne)},get start(){return B(e)},onUse:Ie})}D(t),U(e,t)};G(s,e=>{B(ee)&&e(c)}),V(`click`,o,()=>N(ee,!B(ee))),U(e,t)},Ae=e=>{var t=ZN(),n=I(t),r=e=>{var t=GN();K(R(I(t),2),17,()=>B(ye),e=>e.id,(e,t)=>{var n=XN(),r=F(n);$(F(r),{name:`folder`,size:14}),D(r);var i=R(r,2),a=L(i),o=L(R(i,2),!0);D(n),z(e=>{J(i,`title`,B(t).path),W(a,`${B(t).name??``}${B(t).exists===!1?` — path is missing`:``}`),W(o,e)},[()=>Se(_e(B(t)))]),U(e,n)}),U(e,t)};G(n,e=>{B(ye).length&&e(r)});var i=R(n,2),a=e=>{var t=qN();K(R(I(t),2),17,()=>B(be),e=>e.id,(e,t)=>{var n=XN(),r=F(n);$(F(r),{name:`folder`,size:14}),D(r);var i=R(r,2),a=L(i),o=L(R(i,2),!0);D(n),z(e=>{J(i,`title`,B(t).path),W(a,`${B(t).name??``}${B(t).exists===!1?` — path is missing`:``}`),W(o,e)},[()=>Se(_e(B(t)))]),U(e,n)}),U(e,t)};G(i,e=>{B(be).length&&e(a)}),U(e,t)},je=e=>{U(e,QN())};G(Oe,e=>{B(ae)?e(ke):B(xe)?e(Ae,1):e(je,-1)});var Me=R(Oe,4),Le=e=>{vN(e,{get schedule(){return B(C)},set schedule(e){N(C,e,!0)}})},Be=e=>{var t=$N(),n=L(t,!0);z(()=>W(n,B(d).schedule_desc)),U(e,t)};G(Me,e=>{B(ae)?e(Le):B(d)&&e(Be,1)});var Ke=R(Me,4),qe=e=>{SN(e,{get depth(){return B(w)},set depth(e){N(w,e,!0)}})},Je=e=>{var t=$N(),n=L(t,!0);z(e=>W(n,e),[()=>We(B(d).recall_depth)]),U(e,t)};G(Ke,e=>{B(ae)?e(qe):B(d)&&e(Je,1)});var Ye=R(Ke,2),Xe=e=>{var t=nP(),n=R(I(t),2),r=e=>{var t=Bi();K(I(t),16,()=>B(f),e=>e,(e,t)=>{var n=eP(),r=F(n),i=L(r,!0),a=R(r,2);$(F(a),{name:`x`,size:13}),D(a),D(n),z(()=>W(i,t)),V(`click`,a,()=>Ue(t)),U(e,n)}),U(e,t)},i=e=>{U(e,tP())};G(n,e=>{B(f).length?e(r):e(i,-1)}),U(e,t)};G(Ye,e=>{B(ie)||e(Xe)}),D(ce),D(T),z(()=>re=q(T,1,`tpcols svelte-y9xmno`,null,re,{single:B(ie)})),U(e,t)},et=e=>{U(e,iP())};G(Qe,e=>{B(d)||B(ie)?e($e):B(ie)||e(et,1)}),D(Ye),D(Je),U(e,Ke),k(),l()}ki([`change`,`click`]);var sP,cP=()=>window.AudioContext??window.webkitAudioContext;function lP(){try{let e=cP();if(!e)return;let t=sP||=new e;t.state===`suspended`&&t.resume();let n=t.currentTime;[880,1175].forEach((e,r)=>{let i=t.createOscillator(),a=t.createGain();i.type=`sine`,i.frequency.value=e,i.connect(a),a.connect(t.destination);let o=n+r*.16;a.gain.setValueAtTime(0,o),a.gain.linearRampToValueAtTime(.18,o+.02),a.gain.exponentialRampToValueAtTime(1e-4,o+.22),i.start(o),i.stop(o+.24)})}catch{}}var uP=H(`· `,1),dP=H(`
`),fP=H(``),pP=H(`
`),mP=H(``),hP=H(`
`),gP=H(`
`);function _P(e,t){O(t,!0);let n=()=>A(js,`$route`,a),r=()=>A(Uo,`$inquiries`,a),i=()=>A(rs,`$soundOnInput`,a),[a,o]=Zt(),s=P({}),c=new Set,l=!0,u=j(()=>n().name===`run`?`task-run:`+n().id:n().name===`chat`?n().id:null),d=j(()=>r().filter(e=>e._src!==`inquiry`||!(e.chat&&e.chat===B(u)||n().name===`task`&&e.task_id===n().id)));async function f(){let e=Kt(Po);try{let[t,n]=await Promise.all([Q.inquiries().catch(()=>[]),Q.hitlPending().catch(()=>[])]);if(Kt(Po)!==e)return;let r=[...t.map(e=>({...e,_src:`inquiry`,_key:`inq:`+e.id})),...n.map(e=>({...e,_src:`hitl`,_key:`hitl:`+e.id}))],a=!l&&r.some(e=>!c.has(e._key));c=new Set(r.map(e=>e._key)),l=!1,Xt(Uo,r),a&&i()&&lP()}catch{}}io(()=>{f();let e=setInterval(f,4e3);return()=>clearInterval(e)});async function p(e,t){if(!(!t||!t.trim())){try{e._src===`hitl`?await Q.answerHitl(e.id,t.trim()):await Q.answerInquiry(e.id,t.trim())}catch{}s[e._key]=``,f()}}var m=Bi(),h=I(m),g=e=>{var t=gP(),n=F(t),r=L(n);K(R(n,2),17,()=>B(d),e=>e._key,(e,t)=>{var n=hP(),r=F(n),i=F(r),a=R(i),o=e=>{var n=uP(),r=R(I(n)),i=L(r,!0);z(()=>W(i,B(t).task_title)),V(`click`,r,()=>B(t).root_id&&Fs(`/t/`+B(t).root_id)),U(e,n)};G(a,e=>{B(t)._src===`inquiry`&&B(t).task_title&&e(o)}),D(r);var c=R(r,2),l=L(c,!0),u=R(c,2),d=e=>{var n=dP(),r=L(n,!0);z(()=>W(r,B(t).detail)),U(e,n)};G(u,e=>{B(t).detail&&e(d)});var f=R(u,2),m=e=>{var n=pP();K(n,21,()=>B(t).options,Qi,(e,n)=>{var r=fP(),i=L(r,!0);z(()=>W(i,B(n))),V(`click`,r,()=>p(B(t),B(n))),U(e,r)}),D(n),U(e,n)},h=e=>{var n=mP();za(n),V(`keydown`,n,e=>e.key===`Enter`&&p(B(t),s[B(t)._key])),qa(n,()=>s[B(t)._key],e=>s[B(t)._key]=e),U(e,n)};G(f,e=>{B(t).options&&B(t).options.length?e(m):e(h,-1)}),D(n),z(()=>{W(i,`${B(t).kind===`permission`?`Permission`:`Question`} `),W(l,B(t).text)}),U(e,n)}),D(t),z(()=>W(r,`Needs your input (${B(d).length??``})`)),U(e,t)};G(h,e=>{B(d).length&&e(g)}),U(e,m),k(),o()}ki([`click`,`keydown`]);var vP=H(`

Optional Google libraries aren't installed.

Run this, then restart AG2 Assistant:

 
`),yP=H(`

Loading…

`),bP=H(`

Signed in as

`,1),xP=H(`

Google integration is bring-your-own: you create a free OAuth client in - your own Google Cloud, and credentials stay on this machine.

  1. In Google Cloud Console, create a project and enable the Gmail, Google Calendar and Google Drive APIs.
  2. OAuth consent screen: pick Internal on a Workspace account (best — no warnings, no token expiry), or External + add yourself as a test user on a personal account (re-consent every 7 days).
  3. Credentials → Create OAuth client ID → Desktop app → Download JSON on the confirmation dialog (it's only offered at creation).
  4. Paste the JSON file's contents below.

Full guide: docs/usage.md → “Google (Gmail / Calendar / Drive)”.

`,1),SP=H(`

`),CP=H(`

`,1),wP=H(` `,1);function TP(e,t){O(t,!0);let[n,r]=Zt(),i=M(null),a=M(``),o=M(!1),s=null,c=M(``);async function l(){try{N(i,await Q.googleStatus(),!0),N(c,``)}catch{}}io(l),ao(()=>{s&&clearInterval(s)});async function u(){B(a).trim()&&(await Q.googleCredentials(B(a).trim()),N(a,``),l())}async function d(){let e=await Q.googleLoginUrl();e.ok?(window.open(e.auth_url,`_blank`),N(o,!0),s=setInterval(async()=>{let e=await Q.googleStatus();e.signed_in&&(s&&clearInterval(s),s=null,N(o,!1),N(i,e,!0))},2e3)):N(c,e.error||`Could not start sign-in`,!0)}async function f(){await Q.googleLogout(),l()}let p=()=>Xt(Wo,!1);var m=wP(),h=I(m),g=R(h,2),_=F(g),v=R(_,4),y=e=>{var t=vP(),n=F(t),r=R(F(n));D(n);var a=R(n,4),o=L(a,!0),s=R(a,2);D(t),z(()=>{W(r,` Gmail, Calendar and - Drive stay unavailable ${B(i).signed_in?`(even though you're signed in) `:``}until you add them.`),W(o,B(i).install_hint)}),V(`click`,s,l),U(e,t)};G(v,e=>{B(i)&&B(i).libs_available===!1&&e(y)});var b=R(v,2),x=e=>{U(e,yP())},S=e=>{var t=bP(),n=I(t),r=R(F(n)),a=L(r,!0),o=R(r);D(n);var s=R(n,2);z(()=>{W(a,B(i).email||`your account`),W(o,`.${B(i).libs_available===!1?``:` AG2 Assistant can use Gmail, Calendar and Drive.`}`)}),V(`click`,s,f),U(e,t)},C=e=>{var t=xP(),n=R(I(t),6);tn(n),J(n,`placeholder`,`{ "installed": { "client_id": "…", "client_secret": "…", … } }`);var r=R(n,2);qa(n,()=>B(a),e=>N(a,e)),V(`click`,r,u),U(e,t)},w=e=>{var t=CP(),n=I(t),r=L(n,!0),i=R(n,2),a=e=>{var t=SP(),n=L(t,!0);z(()=>W(n,B(c))),U(e,t)};G(i,e=>{B(c)&&e(a)});var s=R(i,2);z(()=>W(r,B(o)?`Waiting for Google — complete consent in the opened tab…`:`Connect your Google account.`)),V(`click`,s,d),U(e,t)};G(b,e=>{B(i)?B(i).signed_in?e(S,1):B(i).configured?e(w,-1):e(C,2):e(x)}),D(g),V(`click`,h,p),V(`click`,_,p),U(e,m),k(),r()}ki([`click`]);var EP=H(`

`),DP=H(`

Loading…

`),OP=H(`

Signed in ✓

Close this to return to your model settings — pick the model there and save to start - using the subscription.

`,1),kP=H(``),AP=H(`

Copy the whole address from the browser's URL bar (even on the error page) — - or just the code value from it — and paste it here:

`,1),jP=H(`

Running in Docker or on a remote host, or the tab shows "localhost refused to connect"? That's expected — the redirect points at localhost:1455, which isn't published.

`,1),MP=H(`

`,1),NP=H(` `);function KO(e){var t=GO(),n=F(t),r=F(n);$(F(r),{name:`sparkles`,size:15}),D(r),tt(2),D(n),tt(2),D(t),U(e,t)}function qO(e,t,n){let r=e.findIndex(e=>e.id===t.id);for(let t=r-1;t>=0;t--){let n=e[t];if(n.kind===`user`)return n.text||``}return n&&n.task_name||``}var JO=H(` `),YO=H(`Rating removed — what I learned stays in Memory`),XO=H(`
`),ZO=H(`
`);function QO(e,t){O(t,!0);let n=ro(t,`content`,3,``),r=ro(t,`request`,3,``),i=ro(t,`current`,3,null),a=M(null),o=M(``),s=M(null),c=M(null),l=M(!1),u=M(!1),d=j(()=>B(l)?null:B(c)??i()),f=M(!1);async function p(){try{await navigator.clipboard.writeText(n()||``),N(f,!0),setTimeout(()=>N(f,!1),1400)}catch{}}function m(e){B(d)&&B(d).sentiment===e&&!B(a)?v():h(e)}function h(e){N(a,e,!0),N(o,(B(d)&&B(d).sentiment===e?B(d).reason:``)||``,!0),queueMicrotask(()=>B(s)&&B(s).focus())}function g(){N(a,null),N(o,``)}function _(){let e=B(o).trim();!e||!B(a)||(ox({targetKind:t.targetKind,targetId:String(t.targetId),sentiment:B(a),reason:e,content:n(),request:r()}),N(c,{sentiment:B(a),reason:e},!0),N(l,!1),N(u,!1),N(a,null),N(o,``))}function v(){let e=!!(B(d)&&B(d).reason);sx({targetKind:t.targetKind,targetId:String(t.targetId)}),N(l,!0),N(c,null),N(a,null),N(o,``),e&&(N(u,!0),setTimeout(()=>N(u,!1),3200))}function y(e){e.key===`Enter`?(e.preventDefault(),_()):e.key===`Escape`&&g()}var b=ZO(),x=F(b),S=F(x);let C;var w=F(S);{let e=j(()=>B(f)?`check`:`copy`);$(w,{get name(){return B(e)},size:14})}D(S);var T=R(S,2);let ee;$(F(T),{name:`thumbs-up`,size:14}),D(T);var te=R(T,2);let ne;$(F(te),{name:`thumbs-down`,size:14}),D(te);var re=R(te,2),ie=e=>{var t=JO(),n=L(t);z(()=>{J(t,`title`,B(d).reason),W(n,`${B(d).sentiment===`up`?`Liked`:`Disliked`} — ${B(d).reason??``}`)}),U(e,t)},ae=e=>{U(e,YO())};G(re,e=>{B(d)&&!B(a)?e(ie):B(u)&&e(ae,1)}),D(x);var oe=R(x,2),se=e=>{var t=XO(),n=F(t);za(n),Qa(n,e=>N(s,e),()=>B(s));var r=R(n,2),i=R(r,2);$(F(i),{name:`x`,size:13}),D(i),D(t),z(e=>{J(n,`placeholder`,B(a)===`up`?`What did you like? (required)`:`What didn't work? (required)`),r.disabled=e},[()=>!B(o).trim()]),V(`keydown`,n,y),qa(n,()=>B(o),e=>N(o,e)),V(`click`,r,_),V(`click`,i,g),U(e,t)};G(oe,e=>{B(a)&&e(se)}),D(b),z(()=>{C=q(S,1,`fb-thumb`,null,C,{on:B(f)}),J(S,`title`,B(f)?`Copied`:`Copy`),ee=q(T,1,`fb-thumb`,null,ee,{on:B(d)?.sentiment===`up`,active:B(a)===`up`}),J(T,`title`,B(d)?.sentiment===`up`?`You liked this: ${B(d).reason} — click to remove`:`Good — tell me why`),ne=q(te,1,`fb-thumb`,null,ne,{on:B(d)?.sentiment===`down`,active:B(a)===`down`}),J(te,`title`,B(d)?.sentiment===`down`?`You disliked this: ${B(d).reason} — click to remove`:`Not right — tell me why`)}),V(`click`,S,p),V(`click`,T,()=>m(`up`)),V(`click`,te,()=>m(`down`)),U(e,b),k()}ki([`click`,`keydown`]);var $O=H(`
`),ek=H(`
`),tk=H(` `,1);function nk(e,t){O(t,!0);let n=()=>A(Fo,`$thread`,i),r=()=>A(Vo,`$runInfo`,i),[i,a]=Zt(),o=j(()=>ab(t.item.text||``)),s=j(()=>B(o).text),c=j(()=>!!t.item.streaming&&B(o).composing),l=j(()=>ob(t.item.text||``)),u=j(()=>!!B(l)&&n().items.some(e=>e.kind===`a2ui`&&e.surfaceId===B(l))),d=M(void 0);hr(()=>{B(d)&&(B(d).innerHTML=VO(B(s)),WO(B(d),e=>Fs(`/t/`+e)),HO(B(d),e=>Hs(e.path)))});let f=j(()=>!t.item.streaming&&!t.item.empty&&B(s)?t.item.at:null),p=j(()=>qO(n().items,t.item,r()));var m=tk(),h=I(m),g=e=>{var n=$O(),r=F(n);let i;Qa(r,e=>N(d,e),()=>B(d)),D(n),z(()=>i=q(r,1,`bubble`,null,i,{voice:t.item.voice,empty:t.item.empty})),U(e,n)};G(h,e=>{(B(s)||t.item.empty||t.item.streaming&&!B(c))&&e(g)});var _=R(h,2),v=e=>{KO(e,{})};G(_,e=>{B(c)&&!B(u)&&e(v)});var y=R(_,2),b=e=>{var n=ek();QO(F(n),{targetKind:`message`,get targetId(){return B(f)},get content(){return B(s)},get request(){return B(p)},get current(){return t.item.feedback}}),D(n),U(e,n)};G(y,e=>{B(f)!=null&&e(b)}),U(e,m),k(),a()}var rk=H(` `),ik=H(` deleted`,1),ak=H(` `,1),ok=H(`
`),sk=H(`
`),ck=H(`
`),lk=H(`
`),uk=H(`
`),dk=H(`
`,1);function fk(e,t){O(t,!0);let n=M(P(new Set));function r(e){let t=new Set(B(n));t.add(e.id),N(n,t,!0)}async function i(e){try{let{files:t}=await Q.files(),n=t.find(t=>t.path===e.path)||t.find(t=>t.path.endsWith(`/`+e.path));return n?n.path:null}catch{return null}}async function a(e){let t=await i(e);t?Hs(t):r(e)}async function o(e){let t=e.path,n=await fetch(Q.fileUrl(t,!0)).catch(()=>null);if((!n||!n.ok)&&(t=await i(e),n=t?await fetch(Q.fileUrl(t,!0)).catch(()=>null):null,!n||!n.ok)){r(e);return}let a=URL.createObjectURL(await n.blob()),o=document.createElement(`a`);o.href=a,o.download=e.name,o.click(),URL.revokeObjectURL(a)}var s=dk(),c=I(s);K(c,21,()=>t.item.names,Qi,(e,t)=>{var n=rk(),r=F(n);$(r,{name:`zap`,size:12});var i=R(r);D(n),z(()=>W(i,` ${B(t).name??``}${B(t).n>1?` ×`+B(t).n:``}`)),U(e,n)}),D(c);var l=R(c,2),u=e=>{var r=uk();K(r,21,()=>t.item.cards,e=>e.id,(e,t)=>{var r=Bi(),i=I(r),s=e=>{var r=ok();let i;var s=F(r);$(F(s),{name:`file-text`,size:15}),D(s);var c=R(s,2),l=e=>{var n=ik(),r=L(I(n),!0);tt(2),z(()=>W(r,B(t).name)),U(e,n)},u=j(()=>B(n).has(B(t).id)),d=e=>{var n=ak(),r=I(n),i=L(r,!0),s=R(r,2);$(F(s),{name:`download`,size:15}),D(s),z(()=>{J(r,`title`,B(t).path),W(i,B(t).name)}),V(`click`,r,()=>a(B(t))),V(`click`,s,()=>o(B(t))),U(e,n)};G(c,e=>{B(u)?e(l):e(d,-1)}),D(r),z(e=>i=q(r,1,`toolcard`,null,i,{gone:e}),[()=>B(n).has(B(t).id)]),U(e,r)},c=e=>{var n=sk(),r=F(n);$(F(r),{name:`search`,size:15}),D(r);var i=L(R(r,2),!0);D(n),z(()=>W(i,B(t).query)),U(e,n)},l=e=>{var n=ck(),r=F(n);$(F(r),{name:`image`,size:15}),D(r);var i=L(R(r,2));D(n),z(()=>{J(n,`title`,B(t).edit?`Editing image`:`Generating image`),W(i,`${B(t).edit?`Edit`:`Image`} · ${B(t).prompt??``}`)}),U(e,n)},u=e=>{var n=lk(),r=F(n);$(F(r),{name:`code`,size:15}),D(r);var i=L(R(r,2));D(n),z(()=>{J(n,`title`,B(t).ran?`Ran script ${B(t).script} from skill ${B(t).name}`:`Used skill ${B(t).name}`),W(i,`Skill · ${B(t).name??``}${B(t).ran?` · ▶ ${B(t).script}`:``}`)}),U(e,n)};G(i,e=>{B(t).kind===`file`?e(s):B(t).kind===`search`?e(c,1):B(t).kind===`image`?e(l,2):B(t).kind===`skill`&&e(u,3)}),U(e,r)}),D(r),U(e,r)};G(l,e=>{t.item.cards?.length&&e(u)}),U(e,s),k()}ki([`click`]);var pk=H(` `),mk=H(`
`);function hk(e,t){O(t,!0);var n=mk(),r=F(n),i=F(r);{let e=j(()=>t.item.scheduled?`clock`:`check`);$(i,{get name(){return B(e)},size:14})}var a=R(i),o=R(a),s=e=>{var n=pk(),r=L(n,!0);z(e=>W(r,e),[()=>vy(t.item.at)]),U(e,n)};G(o,e=>{t.item.at&&e(s)}),D(r);var c=R(r,2),l=L(c,!0),u=R(c,2);D(n),z(()=>{W(a,` ${t.item.scheduled?`Task scheduled`:`Task started`}`),W(l,t.item.title||`Task`)}),V(`click`,u,()=>Fs(`/t/`+t.item.taskId)),U(e,n),k()}ki([`click`]);var gk=H(` `),_k=H(`
`),vk=H(`
`),yk=H(``),bk=H(`
`),xk=H(`
`);function Sk(e,t){O(t,!0);let n=()=>A(Fo,`$thread`,i),r=()=>A(Vo,`$runInfo`,i),[i,a]=Zt(),o=j(()=>qO(n().items,t.item,r())),s=j(()=>(t.item.preview||``).replace(/[#*`>_~]/g,``).replace(/\s+/g,` `).trim());function c(){Xt(Jo,{title:t.item.description??``,text:t.item.preview??``})}let l=j(()=>(t.item.path||``).split(`/`).pop()),u=()=>{t.item.path&&Hs(t.item.path)};var d=xk(),f=F(d),p=F(f);$(p,{name:`check`,size:13});var m=R(p),h=R(m),g=e=>{var n=gk(),r=L(n,!0);z(e=>W(r,e),[()=>vy(t.item.at)]),U(e,n)};G(h,e=>{t.item.at&&e(g)}),D(f);var _=R(f,2),v=e=>{var t=_k(),n=L(t);z(()=>W(n,`${B(s)??``}…`)),U(e,t)};G(_,e=>{B(s)&&e(v)});var y=R(_,2),b=e=>{var n=vk(),r=F(n);$(F(r),{name:`file-text`,size:15}),D(r);var i=R(r,2),a=L(i,!0);D(n),z(()=>{J(i,`title`,t.item.path),W(a,B(l))}),V(`click`,i,u),U(e,n)};G(y,e=>{t.item.path&&e(b)});var x=R(y,2),S=e=>{var t=yk();V(`click`,t,c),U(e,t)};G(x,e=>{t.item.taskId&&!t.item.path&&e(S)});var C=R(x,2),w=e=>{var n=bk(),r=F(n);{let e=j(()=>(t.item.description||``)+` +`+(t.item.preview||``));QO(r,{targetKind:`deliverable`,get targetId(){return t.item.deliverableId},get content(){return B(e)},get request(){return B(o)},get current(){return t.item.feedback}})}D(n),U(e,n)};G(C,e=>{t.item.deliverableId&&e(w)}),D(d),z(()=>W(m,` Deliverable produced — ${t.item.description??``}`)),U(e,d),k(),a()}ki([`click`]);var Ck=H(`
 
`),wk=H(` `,1),Tk=H(``),Ek=H(`
`),Dk=H(`
`,1),Ok=H(``),kk=H(`
`);function Ak(e,t){O(t,!0);let n=()=>A(Vo,`$runInfo`,r),[r,i]=Zt(),a=new Set([`completed`,`failed`,`cancelled`]),o=M(``),s=M(!1);function c(e){ix(t.item.inquiryId,e)}function l(){B(o).trim()&&(ix(t.item.inquiryId,B(o).trim()),N(o,``))}let u=j(()=>!!n()&&a.has(n().status)),d=j(()=>!!t.item.resolved||B(u)),f=j(()=>t.item.resolution||(t.item.resolved?`answered`:B(d)?`unanswered`:null)),p={answered:`You answered`,expired:`Expired · not answered in time`,cancelled:`Cancelled · task ended`,unanswered:`Not answered`},m=j(()=>B(f)?p[B(f)]:t.item.qkind===`permission`?`Permission · needs your call`:`Needs your answer`),h=j(()=>B(f)===`answered`&&!!t.item.answer);var g=kk();let _;var v=F(g),y=R(F(v));D(v);var b=R(v,2),x=L(b,!0),S=R(b,2),C=e=>{var n=Bi(),r=I(n),i=e=>{var n=wk(),r=I(n),i=L(r,!0),a=R(r,2),o=e=>{var n=Ck(),r=L(n,!0);z(()=>W(r,t.item.detail)),U(e,n)};G(a,e=>{B(s)&&e(o)}),z(()=>W(i,B(s)?`Hide details`:`Show details`)),V(`click`,r,()=>N(s,!B(s))),U(e,n)},a=e=>{var n=Ck(),r=L(n,!0);z(()=>W(r,t.item.detail)),U(e,n)};G(r,e=>{B(d)?e(i):e(a,-1)}),U(e,n)};G(S,e=>{t.item.detail&&e(C)});var w=R(S,2),T=e=>{var n=Dk(),r=I(n);K(r,21,()=>t.item.options,Qi,(e,n)=>{var r=Tk();let i;var a=L(r,!0);z(()=>{i=q(r,1,`chip svelte-29lwde`,null,i,{picked:B(h)&&t.item.answer===B(n)}),r.disabled=B(d),W(a,B(n))}),V(`click`,r,()=>c(B(n))),U(e,r)}),D(r);var i=R(r,2),a=e=>{var n=Ek(),r=L(n);z(()=>W(r,`→ ${t.item.answer??``}`)),U(e,n)},o=j(()=>B(h)&&!t.item.options.includes(t.item.answer??``));G(i,e=>{B(o)&&e(a)}),U(e,n)},ee=e=>{var n=Ek(),r=L(n);z(()=>W(r,`→ ${t.item.answer??``}`)),U(e,n)},te=e=>{var t=Ok();za(t),V(`keydown`,t,e=>e.key===`Enter`&&l()),qa(t,()=>B(o),e=>N(o,e)),U(e,t)};G(w,e=>{t.item.options&&t.item.options.length?e(T):B(h)?e(ee,1):B(d)||e(te,2)}),D(g),z(()=>{_=q(g,1,`choice svelte-29lwde`,null,_,{resolved:B(d),unanswered:B(d)&&!B(h)}),W(y,` ${B(m)??``}`),W(x,t.item.question)}),U(e,g),k(),i()}ki([`click`,`keydown`]);var jk=H(` `),Mk=H(` `),Nk=H(`
`),Pk=H(`
`),Fk=H(`
`),Ik=H(` `,1),Lk=H(`
`),Rk=H(`
`);function zk(e,t){O(t,!0);let n=j(()=>`${(t.item.agent||`subagent`).replace(/[-_]/g,` `)} (subagent)`),r=j(()=>t.item.items||[]),i=j(()=>(t.item.status||`running`)===`running`),a=M(!1),o=M(!0);hr(()=>{B(a)||N(o,B(i),!0)});let s=()=>{N(a,!0),N(o,!B(o))};var c=Rk(),l=F(c),u=R(F(l),2),d=L(u,!0),f=R(u,2),p=e=>{var t=jk(),n=L(t,!0);z(()=>W(n,B(r).length)),U(e,t)};G(f,e=>{B(r).length&&e(p)});var m=R(f,2),h=e=>{var n=Mk(),r=L(n,!0);z(e=>W(r,e),[()=>vy(t.item.at)]),U(e,n)};G(m,e=>{t.item.at&&e(h)});var g=R(m,2),_=L(g,!0),v=L(R(g,2),!0);D(l);var y=R(l,2),b=e=>{var n=Nk(),r=L(n,!0);z(()=>W(r,t.item.objective)),U(e,n)};G(y,e=>{t.item.objective&&e(b)});var x=R(y,2),S=e=>{var n=Ik(),i=I(n),a=e=>{var t=Pk();K(t,21,()=>B(r),e=>e.id,(e,t)=>{zj(e,{get item(){return B(t)}})}),D(t),U(e,t)};G(i,e=>{B(r).length&&e(a)});var o=R(i,2),s=e=>{var n=Fk(),r=L(n,!0);z(()=>W(r,t.item.result)),U(e,n)};G(o,e=>{t.item.result&&e(s)}),U(e,n)};G(x,e=>{B(o)&&e(S)});var C=R(x,2),w=e=>{var n=Lk(),r=L(n,!0);z(()=>W(r,t.item.error)),U(e,n)};G(C,e=>{t.item.error&&e(w)}),D(c),z(()=>{q(c,1,`subagent ${t.item.status||`running`}`),W(d,B(n)),W(_,t.item.status||`running`),W(v,B(o)?`▾`:`▸`)}),V(`click`,l,s),V(`keydown`,l,e=>(e.key===`Enter`||e.key===` `)&&s()),U(e,c),k()}ki([`click`,`keydown`]);var Bk=H(` `),Vk=H(`
`);function Hk(e,t){O(t,!0);var n=Vk();let r;var i=F(n),a=e=>{$(e,{get name(){return t.item.icon},size:14})};G(i,e=>{t.item.icon&&e(a)});var o=R(i),s=R(o),c=e=>{var n=Bk(),r=L(n,!0);z(e=>W(r,e),[()=>vy(t.item.at)]),U(e,n)};G(s,e=>{t.item.at&&e(c)}),D(n),z(()=>{r=q(n,1,`note`,null,r,{alert:t.item.alert,withicon:t.item.icon,pending:t.item.pending}),W(o,`${t.item.text??``} `)}),U(e,n),k()}var Uk=H(``),Wk=H(``),Gk=H(`
`),Kk=H(`
`);function qk(e,t){O(t,!0);let n=()=>A(Fo,`$thread`,i),r=()=>A(Vo,`$runInfo`,i),[i,a]=Zt(),o=()=>Hs(t.item.path),s=j(()=>qO(n().items,t.item,r())),c=M(!1);var l=Kk(),u=F(l),d=e=>{var n=Uk(),r=F(n);$(r,{name:`image-off`,size:14});var i=R(r);D(n),z(()=>{J(n,`title`,t.item.path),W(i,` ${t.item.path??``}`)}),V(`click`,n,o),U(e,n)},f=e=>{var n=Wk(),r=L(n);z(e=>{J(n,`title`,t.item.prompt||``),J(r,`src`,e),J(r,`alt`,t.item.prompt||`generated image`)},[()=>Q.fileUrl(t.item.path)]),V(`click`,n,o),Oi(`error`,r,()=>N(c,!0)),Ei(r),U(e,n)};G(u,e=>{B(c)?e(d):e(f,-1)});var p=R(u,2),m=e=>{var n=Gk(),r=F(n);{let e=j(()=>`Generated image — prompt: `+(t.item.prompt||``));QO(r,{targetKind:`image`,get targetId(){return t.item.path},get content(){return B(e)},get request(){return B(s)},get current(){return t.item.feedback}})}D(n),U(e,n)};G(p,e=>{t.item.path&&e(m)}),D(l),U(e,l),k(),a()}ki([`click`]);var Jk=H(``),Yk=H(``),Xk=H(`
You shared
`);function Zk(e,t){O(t,!0);let n=j(()=>LC(t.item.name||t.item.path)===`image`),r=()=>Hs(t.item.path),i=M(!1);var a=Xk(),o=R(F(a),2),s=e=>{var n=Jk(),a=L(n);z(e=>{J(n,`title`,t.item.name),J(n,`aria-label`,`Open ${(t.item.name||t.item.path)??``}`),J(a,`src`,e),J(a,`alt`,t.item.name)},[()=>Q.fileUrl(t.item.path)]),V(`click`,n,r),Oi(`error`,a,()=>N(i,!0)),Ei(a),U(e,n)},c=e=>{var n=Yk(),a=F(n);{let e=j(()=>B(i)?`image-off`:`paperclip`);$(a,{get name(){return B(e)},size:14})}var o=R(a);D(n),z(()=>{J(n,`title`,t.item.path),W(o,` ${(B(i)?t.item.path:t.item.name||t.item.path)??``}`)}),V(`click`,n,r),U(e,n)};G(o,e=>{B(n)&&!B(i)?e(s):e(c,-1)}),D(a),U(e,a),k()}ki([`click`]);var Qk=H(``),$k=H(``);function eA(e,t){O(t,!0);let n=()=>A(Bo,`$knownThings`,r),[r,i]=Zt(),a=ro(t,`data`,19,()=>({})),o=ro(t,`scope`,3,``),s=j(()=>Uy(t.component,a(),o(),n()));function c(){B(s)&&(B(s).kind===`task`?Fs(`/t/`+B(s).value):B(s).kind===`chat`?Fs(`/c/`+B(s).value):B(s).kind===`file`?Hs(B(s).value):B(s).kind===`folder`&&Qo(B(s).value))}var l=Bi(),u=I(l),d=e=>{var n=Bi();ca(I(n),()=>t.children),U(e,n)},f=e=>{var n=Qk();let r;ca(F(n),()=>t.children),D(n),z(()=>{J(n,`href`,B(s).value),r=xa(n,``,r,{"flex-grow":t.grow})}),U(e,n)},p=e=>{var n=$k();let r;ca(F(n),()=>t.children),D(n),z(()=>r=xa(n,``,r,{"flex-grow":t.grow})),V(`click`,n,c),U(e,n)};G(u,e=>{B(s)?B(s).kind===`url`?e(f,1):e(p,-1):e(d)}),U(e,l),k(),i()}ki([`click`]);var tA=[`sunny`,`partly-cloudy`,`cloudy`,`foggy`,`rainy`,`thunderstorm`,`snow`,`windy`];function nA(e){let t=String(e??``).trim().toLowerCase();return tA.includes(t)?t:`cloudy`}var rA=Ri(``),iA=Ri(``),aA=Ri(``),oA=Ri(``),sA=Ri(``,1),cA=Ri(``),lA=Ri(``),uA=Ri(``),dA=Ri(``),fA=Ri(``),pA=Ri(``,1),mA=Ri(``),hA=Ri(``,1),gA=Ri(``),_A=Ri(``),vA=H(``);function yA(e,t){let n=ro(t,`condition`,3,`cloudy`);var r=vA(),i=F(r),a=e=>{U(e,rA())},o=e=>{U(e,iA())},s=e=>{U(e,aA())},c=e=>{U(e,oA())},l=e=>{var t=uA(),r=F(t),i=F(r);K(i,20,()=>[0,1],Qi,(e,t)=>{var r=cA();K(r,20,()=>[4,18,32,46,60,74,88],Qi,(e,t,r)=>{var i=sA(),a=I(i);J(a,`y1`,r%3*8),J(a,`y2`,r%3*8+14);var o=R(a);J(o,`y1`,r%3*8+30),J(o,`y2`,r%3*8+44),z(()=>{J(a,`x1`,t),J(a,`x2`,t),J(a,`stroke`,n()===`thunderstorm`?`#9fb1c8`:`#a9bdd6`),J(o,`x1`,t+7),J(o,`x2`,t+7),J(o,`stroke`,n()===`thunderstorm`?`#9fb1c8`:`#a9bdd6`)}),U(e,i)}),D(r),z(()=>J(r,`transform`,`translate(0 ${t*-60})`)),U(e,r)}),D(i),D(r);var a=R(r),o=e=>{U(e,lA())};G(a,e=>{n()===`thunderstorm`&&e(o)}),D(t),U(e,t)},u=e=>{var t=fA(),n=F(t);K(n,20,()=>[0,1],Qi,(e,t)=>{var n=cA();K(n,20,()=>[[8,10,3],[30,34,2.4],[52,6,3.4],[74,46,2.2],[92,22,3],[18,66,2.6],[44,82,3.2],[66,70,2.4],[86,88,2.8],[58,40,2]],Qi,(e,t)=>{var n=j(()=>pe(t,3));let r=()=>B(n)[0],i=()=>B(n)[1],a=()=>B(n)[2];var o=dA();z(()=>{J(o,`cx`,r()),J(o,`cy`,i()),J(o,`r`,a())}),U(e,o)}),D(n),z(()=>J(n,`transform`,`translate(0 ${t*-100})`)),U(e,n)}),D(n),D(t),U(e,t)},d=e=>{var t=gA(),n=F(t),r=F(n);K(r,20,()=>[0,1],Qi,(e,t)=>{var n=pA(),r=I(n),i=R(r);z(()=>{J(r,`x1`,t*120),J(r,`x2`,t*120+46),J(i,`x1`,t*120+66),J(i,`x2`,t*120+96)}),U(e,n)}),D(r),D(n);var i=R(n),a=F(i);K(a,20,()=>[0,1],Qi,(e,t)=>{var n=mA();z(()=>{J(n,`x1`,t*120+20),J(n,`x2`,t*120+84)}),U(e,n)}),D(a),D(i);var o=R(i),s=F(o);K(s,20,()=>[0,1],Qi,(e,t)=>{var n=hA(),r=I(n),i=R(r);z(()=>{J(r,`x1`,t*120+8),J(r,`x2`,t*120+52),J(i,`x1`,t*120+70),J(i,`x2`,t*120+104)}),U(e,n)}),D(s),D(o),D(t),U(e,t)},f=e=>{U(e,_A())};G(i,e=>{n()===`sunny`?e(a):n()===`partly-cloudy`?e(o,1):n()===`cloudy`?e(s,2):n()===`foggy`?e(c,3):n()===`rainy`||n()===`thunderstorm`?e(l,4):n()===`snow`?e(u,5):n()===`windy`?e(d,6):e(f,-1)}),D(r),z(()=>q(r,1,`g g-${n()??``}`,`svelte-1oq623z`)),U(e,r)}var bA=`modulepreload`,xA=function(e){return`/app/`+e},SA={},CA=function(e,t,n){let r=Promise.resolve();if(t&&t.length>0){let e=document.getElementsByTagName(`link`),i=document.querySelector(`meta[property=csp-nonce]`),a=i?.nonce||i?.getAttribute(`nonce`);function o(e){return Promise.all(e.map(e=>Promise.resolve(e).then(e=>({status:`fulfilled`,value:e}),e=>({status:`rejected`,reason:e}))))}function s(e){return import.meta.resolve?import.meta.resolve(e):new URL(e,import.meta.url).href}r=o(t.map(t=>{if(t=xA(t,n),t=s(t),t in SA)return;SA[t]=!0;let r=t.endsWith(`.css`);for(let n=e.length-1;n>=0;n--){let i=e[n];if(i.href===t&&(!r||i.rel===`stylesheet`))return}let i=document.createElement(`link`);if(i.rel=r?`stylesheet`:bA,r||(i.as=`script`),i.crossOrigin=``,i.href=t,a&&i.setAttribute(`nonce`,a),document.head.appendChild(i),r)return new Promise((e,n)=>{i.addEventListener(`load`,e),i.addEventListener(`error`,()=>n(Error(`Unable to preload CSS for ${t}`)))})}))}function i(e){let t=new Event(`vite:preloadError`,{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e}return r.then(t=>{for(let e of t||[])e.status===`rejected`&&i(e.reason);return e().catch(i)})},wA=H(``),TA=H(``),EA=H(`
`),DA=H(` `,1),OA=H(`
`);function kA(e,t){O(t,!0);let n=()=>A(ls,`$animations`,r),[r,i]=Zt(),a=ro(t,`condition`,3,`cloudy`),o=ro(t,`temperatureText`,3,``),s=ro(t,`flush`,3,!1),c=ro(t,`zoom`,3,1),l=j(()=>nA(a())),u=typeof navigator<`u`&&`gpu`in navigator&&!!navigator.gpu,d=j(()=>n()===`high`&&!u?`basic`:n()),f={sunny:`☀️`,"partly-cloudy":`⛅`,cloudy:`☁️`,foggy:`🌫️`,rainy:`🌧️`,thunderstorm:`⛈️`,snow:`🌨️`,windy:`💨`},p=[`rainy`,`thunderstorm`],m=M(void 0),h=M(!1);hr(()=>{if(!B(m))return;let e=!1,t=null;return(async()=>{try{let n=await CA(()=>import(`./engine-CNyu0DUW.js`),[]);if(!n.supportsWebGPU())return;if(t=await n.createBanner(B(m),B(l),{temperatureText:o(),zoom:c()}),e){t.dispose(),t=null;return}N(h,!0)}catch{N(h,!1)}})(),()=>{e=!0,N(h,!1),t&&t.dispose()}});var g=OA();let _;var v=F(g),y=e=>{var t=wA();Qa(t,e=>N(m,e),()=>B(m)),U(e,t)},b=e=>{var t=DA(),n=I(t),r=e=>{yA(e,{get condition(){return B(l)}})},i=e=>{var t=TA(),n=L(t,!0);z(()=>W(n,f[B(l)])),U(e,t)};G(n,e=>{B(d)===`basic`?e(r):e(i,-1)});var a=R(n,2),s=e=>{var t=EA();let n;var r=L(t,!0);z(e=>{n=q(t,1,`wx-temp svelte-1y4wig5`,null,n,{"wx-temp-light":e}),W(r,o())},[()=>p.includes(B(l))]),U(e,t)};G(a,e=>{o()&&e(s)}),U(e,t)};G(v,e=>{B(d)===`high`?e(y):e(b,-1)}),D(g),z(()=>_=q(g,1,`wx-banner wx-${B(l)??``}`,`svelte-1y4wig5`,_,{"wx-live":B(h),"wx-flush":s()})),U(e,g),k(),i()}var AA=H(`
`),jA=H(`
`),MA=H(`
`),NA=H(` `),PA=H(` `),FA=H(`
`),IA=H(`
`),LA=H(``),RA=Ri(``),zA=Ri(``),BA=H(`
`),VA=H(` `,1),HA=H(`
`),UA=H(`—`),WA=H(`●`),GA=H(`
`),KA=H(`
`),qA=H(``),JA=H(``),YA=H(``),XA=H(``),ZA=H(`
`),QA=H(`
`),$A=H(` `),ej=H(`
`),tj=H(``),nj=H(``),rj=H(``,2),ij=H(``),aj=H(``),oj=H(``),sj=H(` `),cj=H(``),lj=H(`
`),uj=H(``),dj=H(``),fj=H(`
This view could not be drawn.
`);function pj(e,t){O(t,!0);let n=e=>{var n=Bi();K(I(n),17,()=>Ay(t.component.children,i(),s()),Qi,(e,t)=>{let n=j(()=>f(B(t).id));var s=Bi(),l=I(s),u=e=>{{let s=j(()=>c()+1);pj(e,{get component(){return B(n)},get components(){return r()},get data(){return i()},get onDataChange(){return a()},get onAction(){return o()},get scope(){return B(t).scope},get depth(){return B(s)}})}};G(l,e=>{B(n)&&e(u)}),U(e,s)}),U(e,n)},r=ro(t,`components`,19,()=>[]),i=ro(t,`data`,19,()=>({})),a=ro(t,`onDataChange`,3,()=>{}),o=ro(t,`onAction`,3,()=>{}),s=ro(t,`scope`,3,``),c=ro(t,`depth`,3,0),l=j(()=>(t.component.component||`Text`).toLowerCase()),u=j(()=>new Map(r().filter(e=>e&&e.id).map(e=>[e.id,e])));function d(e){return pb(e)}function f(e){return typeof e==`string`?B(u).get(e):void 0}let p=j(()=>!!ky(t.component.value,i(),s())),m=j(()=>_b(t.component.value,s()));function h(e){B(m)&&a()(B(m),e.currentTarget.checked)}let g=j(()=>_b(t.component.value,s())),_=j(()=>ky(t.component.value,i(),s())??``),v=j(()=>Array.isArray(B(_))?``:String(B(_)??``)),y=j(()=>t.component.steps?(Number(t.component.max)-Number(t.component.min||0))/Number(t.component.steps):void 0),b=e=>e==null||e===``?void 0:Number(e),x={accountCircle:`users`,add:`plus`,arrowBack:`chevron-left`,arrowForward:`chevron-right`,attachFile:`paperclip`,calendarToday:`clock`,close:`x`,delete:`trash`,event:`clock`,favorite:`thumbs-up`,folder:`folder`,play:`send`,refresh:`rotate-cw`,send:`send`,settings:`settings`,stop:`square`,warning:`alert-triangle`},S=j(()=>By(t.component,i(),s())),C=j(()=>x[B(S)]||B(S)),w=j(()=>fb(ky(t.component.name,i(),s()))),T={sm:14,md:22,lg:28},ee=j(()=>String(ky(t.component.url,i(),s())??``)),te=j(()=>oe(B(ee)));function ne(e){B(g)&&a()(B(g),e.currentTarget.value)}function re(e){B(g)&&a()(B(g),Number(e.currentTarget.value))}function ie(e){if(!B(g))return;let n=e.currentTarget.value;a()(B(g),t.component.enableDate&&t.component.enableTime&&n?new Date(n).toISOString():n)}function ae(e,n){if(!B(g))return;let r=Array.isArray(B(_))?B(_):[],i=t.component.variant===`multipleSelection`?n?[...new Set([...r,e])]:r.filter(t=>t!==e):[e];a()(B(g),i)}function oe(e){try{let t=new URL(e),n=t.hostname.replace(/^www\./,``).toLowerCase(),r=t.pathname.split(`/`).filter(Boolean),i=n===`youtu.be`?r[0]:n===`youtube.com`||n===`youtube-nocookie.com`?r[0]===`embed`||r[0]===`shorts`?r[1]:t.searchParams.get(`v`):``;return i&&/^[\w-]{6,}$/.test(i)?`https://www.youtube.com/embed/${i}`:``}catch{return``}}let se={start:`flex-start`,center:`center`,end:`flex-end`,stretch:`stretch`},ce=j(()=>se[String(t.component.align??``)]||void 0),le={none:`0`,xs:`var(--space-2)`,sm:`var(--space-3)`,md:`var(--space-5)`,lg:`var(--space-7)`},ue=j(()=>le[String(t.component.gap??``)]||void 0),de={start:`flex-start`,center:`center`,end:`flex-end`,between:`space-between`},fe=j(()=>de[String(t.component.justify??``)]||void 0),E=j(()=>t.component.grow===!0?1:void 0),pe=j(()=>Iy(t.component.tone,i(),s())),me=j(()=>t.component.tone===void 0?``:`a2ui-tone-${B(pe)}`),he=j(()=>Ly(t.component.when,i(),s())),ge=j(()=>t.component.marker!==void 0&&Ly(t.component.marker,i(),s())),_e=j(()=>B(ge)?`a2ui-marker a2ui-tone-${B(pe)}`:``),ve=j(()=>t.component.variant===`ranked`),ye=j(()=>Ny(t.component.children)),be=[`h1`,`h2`,`h3`,`h4`,`body`,`caption`,`eyebrow`,`quote`,`pill`,`badge`,`code`],xe=j(()=>be.includes(String(t.component.variant??``))?String(t.component.variant):``),Se=j(()=>zy(t.component,i(),s())),Ce=j(()=>Yy(t.component,i(),s())),we=j(()=>fb(ky(t.component.label,i(),s()))),Te=j(()=>[`sm`,`md`,`lg`].includes(String(t.component.size??``))?String(t.component.size):`md`),Ee={sm:{w:78,h:30,dot:2.2},md:{w:160,h:56,dot:2.6},lg:{w:300,h:120,dot:3}},De=j(()=>Ee[B(Te)]),Oe=j(()=>Gy(ky(t.component.values,i(),s()),B(De).w,B(De).h)),ke=j(()=>jy(t.component.columns,i(),s())),Ae=j(()=>jy(t.component.rows,i(),s())),je=j(()=>My(t.component.key,t.component.pick,i(),B(ke),s())),Me=j(()=>f(t.component.lead)),Ne=j(()=>`${B(Me)?`minmax(118px, .9fr) `:``}repeat(${B(ke).length}, minmax(94px, 1fr))`);function Pe(){let e=t.component.action?.event;e?.name&&o()({name:e.name,sourceComponentId:t.component.id,context:gb(e.context||{},i(),s())})}var Fe=Bi(),Ie=I(Fe),Le=e=>{},Re=e=>{},ze=e=>{var t=AA();let r;var i=F(t);n(i),D(t),z(()=>{q(t,1,`a2ui-basic-col ${B(_e)??``}`),r=xa(t,``,r,{"align-items":B(ce),"justify-content":B(fe),gap:B(ue),"flex-grow":B(E)})}),U(e,t)},Be=e=>{var t=AA();let r;var i=F(t);n(i),D(t),z(()=>{q(t,1,`a2ui-basic-row ${B(_e)??``}`),r=xa(t,``,r,{"align-items":B(ce),"justify-content":B(fe),gap:B(ue),"flex-grow":B(E)})}),U(e,t)},Ve=e=>{var t=AA();let r,i;var a=F(t);n(a),D(t),z(()=>{r=q(t,1,`a2ui-list ${B(_e)??``}`,null,r,{"a2ui-ranked":B(ve)}),i=xa(t,``,i,{"align-items":B(ce),"justify-content":B(fe),gap:B(ue),"flex-grow":B(E),"--a2ui-rank-from":B(ye)})}),U(e,t)},He=e=>{let n=j(()=>f(t.component.child));var l=AA();let u,d;var p=F(l),m=e=>{{let t=j(()=>c()+1);pj(e,{get component(){return B(n)},get components(){return r()},get data(){return i()},get onDataChange(){return a()},get onAction(){return o()},get scope(){return s()},get depth(){return B(t)}})}};G(p,e=>{B(n)&&e(m)}),D(l),z(()=>{u=q(l,1,`a2ui-basic-card ${B(_e)??``}`,null,u,{"a2ui-feature":t.component.variant===`feature`}),d=xa(l,``,d,{"flex-grow":B(E)})}),U(e,l)},Ue=e=>{let n=j(()=>f(t.component.child));eA(e,{get component(){return t.component},get data(){return i()},get scope(){return s()},get grow(){return B(E)},children:(e,t)=>{var l=Bi(),u=I(l),d=e=>{{let t=j(()=>c()+1);pj(e,{get component(){return B(n)},get components(){return r()},get data(){return i()},get onDataChange(){return a()},get onAction(){return o()},get scope(){return s()},get depth(){return B(t)}})}};G(u,e=>{B(n)&&e(d)}),U(e,l)},$$slots:{default:!0}})},We=e=>{var n=Bi(),r=I(n),i=e=>{var n=jA();let r,i;var a=L(n,!0);z(()=>{r=q(n,1,`a2ui-text a2ui-tone-${B(pe)??``} ${B(xe)?`a2ui-t-${B(xe)}`:``}`,null,r,{"a2ui-main":!B(xe)&&t.component.variant&&t.component.variant!==`body`,"a2ui-strong":t.component.emphasis===`strong`}),i=xa(n,``,i,{"flex-grow":B(E)}),W(a,B(Se))}),U(e,n)};G(r,e=>{B(Se)&&e(i)}),U(e,n)},Ge=e=>{var n=Bi(),r=I(n),i=e=>{var n=IA();let r,i;var a=F(n),o=e=>{var t=MA(),n=L(t,!0);z(()=>W(n,B(we))),U(e,t)};G(a,e=>{B(we)&&e(o)});var s=R(a,2),c=F(s,!0),l=R(c),u=e=>{var t=NA(),n=L(t,!0);z(()=>W(n,B(Ce).unit)),U(e,t)};G(l,e=>{B(Ce).unit&&e(u)}),D(s);var d=R(s,2),f=e=>{var t=FA(),n=F(t),r=e=>{var t=PA(),n=L(t,!0);z(()=>W(n,B(Ce).arrow)),U(e,t)};G(n,e=>{B(Ce).arrow&&e(r)});var i=R(n,1,!0);D(t),z(()=>{q(t,1,`a2ui-metric-delta a2ui-tone-${B(pe)??``}`),W(i,B(Ce).delta)}),U(e,t)};G(d,e=>{B(Ce).delta&&e(f)}),D(n),z(()=>{r=q(n,1,`a2ui-metric a2ui-metric-${B(Te)??``}`,null,r,{end:t.component.align===`end`}),i=xa(n,``,i,{"flex-grow":B(E)}),W(c,B(Ce).value)}),U(e,n)};G(r,e=>{(B(Ce).value||B(Ce).delta)&&e(i)}),U(e,n)},Ke=e=>{var t=Bi(),n=I(t),r=e=>{var t=LA();z(()=>q(t,1,`a2ui-spark a2ui-spark-${B(Te)??``}`)),U(e,t)},i=e=>{var t=zA();let n;var r=F(t),i=e=>{var t=RA();z(()=>J(t,`d`,B(Oe).area)),U(e,t)};G(r,e=>{B(Te)===`lg`&&e(i)});var a=R(r),o=R(a);D(t),z(()=>{q(t,0,`a2ui-spark a2ui-spark-${B(Te)??``} a2ui-tone-${B(pe)??``}`),J(t,`viewBox`,`0 0 ${B(De).w??``} ${B(De).h??``}`),n=xa(t,``,n,{"flex-grow":B(E)}),J(a,`d`,B(Oe).line),J(o,`cx`,B(Oe).endX),J(o,`cy`,B(Oe).endY),J(o,`r`,B(De).dot)}),U(e,t)};G(n,e=>{!B(Oe)&&B(Te)!==`lg`?e(r):B(Oe)&&e(i,1)}),U(e,t)},qe=e=>{let n=j(()=>f(t.component.header)),s=j(()=>f(t.component.cell));var l=Bi(),u=I(l),d=e=>{var l=KA();let u;var d=F(l);let f;var p=F(d),m=e=>{var t=VA(),s=I(t),l=e=>{U(e,BA())};G(s,e=>{B(Me)&&e(l)}),K(R(s,2),17,()=>B(ke),Qi,(e,t,s)=>{var l=AA();let u;var d=F(l);{let e=j(()=>c()+1);pj(d,{get component(){return B(n)},get components(){return r()},get data(){return i()},get onDataChange(){return a()},get onAction(){return o()},get scope(){return B(t)},get depth(){return B(e)}})}D(l),z(()=>u=q(l,1,`a2ui-th`,null,u,{pick:s===B(je)})),U(e,l)}),U(e,t)};G(p,e=>{B(n)&&e(m)}),K(R(p,2),17,()=>B(Ae),Qi,(e,n)=>{let l=j(()=>jy(t.component.cells,i(),B(n))),u=j(()=>My(t.component.key,t.component.win,i(),B(ke),B(n)));var d=VA(),f=I(d),p=e=>{var t=HA(),s=F(t);{let e=j(()=>c()+1);pj(s,{get component(){return B(Me)},get components(){return r()},get data(){return i()},get onDataChange(){return a()},get onAction(){return o()},get scope(){return B(n)},get depth(){return B(e)}})}D(t),U(e,t)};G(f,e=>{B(Me)&&e(p)}),K(R(f,2),17,()=>B(ke),Qi,(e,t,n)=>{var d=GA();let f;var p=F(d),m=e=>{{let t=j(()=>c()+1);pj(e,{get component(){return B(s)},get components(){return r()},get data(){return i()},get onDataChange(){return a()},get onAction(){return o()},get scope(){return B(l)[n]},get depth(){return B(t)}})}},h=e=>{U(e,UA())};G(p,e=>{B(s)&&B(l)[n]!==void 0?e(m):e(h,-1)});var g=R(p,2),_=e=>{U(e,WA())};G(g,e=>{n===B(u)&&e(_)}),D(d),z(()=>f=q(d,1,`a2ui-td`,null,f,{pick:n===B(je),win:n===B(u)})),U(e,d)}),U(e,d)}),D(d),D(l),z(()=>{u=xa(l,``,u,{"flex-grow":B(E)}),f=xa(d,``,f,{"grid-template-columns":B(Ne)})}),U(e,l)};G(u,e=>{B(ke).length&&e(d)}),U(e,l)},Je=e=>{var n=qA();let r;z(()=>r=q(n,1,`a2ui-divider`,null,r,{strong:t.component.emphasis===`strong`})),U(e,n)},Ye=e=>{var n=JA(),r=F(n);za(r);var a=L(R(r,2),!0);D(n),z(e=>{Va(r,B(p)),W(a,e)},[()=>ky(t.component.label,i(),s())||``]),V(`change`,r,h),U(e,n)},Xe=e=>{var n=YA();let r;var a=L(n,!0);z(e=>{r=q(n,1,`a2ui-button`,null,r,{primary:t.component.variant===`primary`}),W(a,e)},[()=>ky(f(t.component.child)?.text,i(),s())||`Continue`]),V(`click`,n,Pe),U(e,n)},Ze=e=>{var n=XA();let r;z((e,i)=>{q(n,1,`a2ui-image ${(t.component.variant||``)??``}`),J(n,`src`,e),J(n,`alt`,i),r=xa(n,``,r,{"object-fit":t.component.fit===`scaleDown`?`scale-down`:t.component.fit||`contain`})},[()=>String(ky(t.component.url,i(),s())??``),()=>String(ky(t.component.description,i(),s())??``)]),U(e,n)},Qe=e=>{let n=j(()=>String(ky(t.component.url,i(),s())??``)),r=j(()=>fb(ky(t.component.caption,i(),s())));var a=Bi(),o=I(a),c=e=>{var a=QA();let o;var c=F(a),l=R(c,2),u=e=>{var t=ZA(),n=L(t,!0);z(()=>W(n,B(r))),U(e,t)};G(l,e=>{B(r)&&e(u)}),D(a),z(e=>{q(a,1,`a2ui-figure a2ui-figure-${B(Te)??``}`),o=xa(a,``,o,{"flex-grow":B(E)}),J(c,`src`,B(n)),J(c,`alt`,e)},[()=>String(ky(t.component.description,i(),s())??``)]),U(e,a)};G(o,e=>{B(n)&&e(c)}),U(e,a)},$e=e=>{let n=j(()=>Wy(ky(t.component.hunks,i(),s())));var r=Bi(),a=I(r),o=e=>{var t=ej();let r;K(t,21,()=>B(n),Qi,(e,t)=>{var n=$A(),r=L(n,!0);z(()=>{q(n,1,`a2ui-diff-line ${B(t).kind??``}`),W(r,B(t).text)}),U(e,n)}),D(t),z(()=>r=xa(t,``,r,{"flex-grow":B(E)})),U(e,t)};G(a,e=>{B(n).length&&e(o)}),U(e,r)},et=e=>{var n=AA();let r;Zi(F(n),()=>ky(t.component.condition,i(),s()),e=>{{let n=j(()=>ky(t.component.condition,i(),s())),r=j(()=>fb(ky(t.component.temperature,i(),s())));kA(e,{get condition(){return B(n)},get temperatureText(){return B(r)},zoom:1.3,flush:!0})}}),D(n),z(()=>{q(n,1,`a2ui-glyph a2ui-glyph-${B(Te)??``}`),r=xa(n,``,r,{"flex-grow":B(E)})}),U(e,n)},tt=e=>{var t=tj();$(F(t),{get name(){return B(C)},get size(){return T[B(Te)]}}),D(t),z(()=>{q(t,1,`a2ui-icon ${B(me)??``}`),J(t,`title`,B(w))}),U(e,t)},nt=e=>{var n=Bi(),r=I(n),a=e=>{var t=nj();z(()=>J(t,`src`,B(te))),U(e,t)},o=e=>{var n=rj();z(e=>{J(n,`src`,B(ee)),J(n,`poster`,e)},[()=>String(ky(t.component.posterUrl,i(),s())??``)||void 0]),U(e,n)};G(r,e=>{B(te)?e(a):e(o,-1)}),U(e,n)},rt=e=>{var n=oj(),r=F(n),a=L(r,!0),o=R(r,2),c=e=>{var n=ij();tn(n),z(e=>{Ba(n,B(v)),J(n,`placeholder`,e)},[()=>String(ky(t.component.placeholder,i(),s())??``)]),V(`input`,n,ne),U(e,n)},l=e=>{var n=aj();za(n),z(e=>{J(n,`type`,t.component.variant===`number`?`number`:t.component.variant===`obscured`?`password`:`text`),Ba(n,B(v)),J(n,`placeholder`,e)},[()=>String(ky(t.component.placeholder,i(),s())??``)]),V(`input`,n,ne),U(e,n)};G(o,e=>{t.component.variant===`longText`?e(c):e(l,-1)}),D(n),z(e=>W(a,e),[()=>ky(t.component.label,i(),s())||``]),U(e,n)},it=e=>{var n=lj(),r=F(n),a=e=>{var n=sj(),r=L(n,!0);z(e=>W(r,e),[()=>ky(t.component.label,i(),s())]),U(e,n)};G(r,e=>{t.component.label&&e(a)});var o=R(r,2);let c;K(o,21,()=>d(t.component.options),Qi,(e,n)=>{let r=j(()=>Array.isArray(B(_))&&B(_).includes(B(n).value));var a=cj(),o=F(a);za(o);var c=L(R(o,2),!0);D(a),z(e=>{J(o,`type`,t.component.variant===`multipleSelection`?`checkbox`:`radio`),J(o,`name`,(t.component.id||``)+s()),Va(o,B(r)),W(c,e)},[()=>ky(B(n).label,i(),s())||B(n).value]),V(`change`,o,e=>ae(B(n).value,e.currentTarget.checked)),U(e,a)}),D(o),D(n),z(()=>c=q(o,1,``,null,c,{chips:t.component.displayStyle===`chips`})),U(e,n)},at=e=>{var n=uj(),r=F(n),a=e=>{var n=$A(),r=L(n,!0);z(e=>W(r,e),[()=>ky(t.component.label,i(),s())]),U(e,n)};G(r,e=>{t.component.label&&e(a)});var o=R(r,2);za(o);var c=L(R(o,2),!0);D(n),z((e,t)=>{J(o,`min`,e),J(o,`max`,t),J(o,`step`,B(y)),Ba(o,B(v)),W(c,B(v))},[()=>b(t.component.min)??0,()=>b(t.component.max)]),V(`input`,o,re),U(e,n)},ot=e=>{var n=dj(),r=F(n),a=e=>{var n=$A(),r=L(n,!0);z(e=>W(r,e),[()=>ky(t.component.label,i(),s())]),U(e,n)};G(r,e=>{t.component.label&&e(a)});var o=R(r,2);za(o),D(n),z((e,n,r)=>{J(o,`type`,t.component.enableDate&&t.component.enableTime?`datetime-local`:t.component.enableDate?`date`:`time`),Ba(o,e),J(o,`min`,n),J(o,`max`,r)},[()=>t.component.enableDate&&t.component.enableTime&&B(v)?B(v).slice(0,16):B(v),()=>String(ky(t.component.min,i(),s())??``)||void 0,()=>String(ky(t.component.max,i(),s())??``)||void 0]),V(`change`,o,ie),U(e,n)},st=e=>{U(e,fj())};G(Ie,e=>{c()>=24?e(Le):B(he)?B(l)===`column`?e(ze,2):B(l)===`row`?e(Be,3):B(l)===`list`?e(Ve,4):B(l)===`card`?e(He,5):B(l)===`link`?e(Ue,6):B(l)===`text`?e(We,7):B(l)===`metric`?e(Ge,8):B(l)===`sparkline`?e(Ke,9):B(l)===`table`?e(qe,10):B(l)===`divider`?e(Je,11):B(l)===`checkbox`?e(Ye,12):B(l)===`button`?e(Xe,13):B(l)===`image`?e(Ze,14):B(l)===`figure`?e(Qe,15):B(l)===`diff`?e($e,16):B(l)===`weatherglyph`?e(et,17):B(l)===`icon`?e(tt,18):B(l)===`video`?e(nt,19):B(l)===`textfield`?e(rt,20):B(l)===`choicepicker`?e(it,21):B(l)===`slider`?e(at,22):B(l)===`datetimeinput`?e(ot,23):e(st,-1):e(Re,1)}),U(e,Fe),k()}ki([`change`,`click`,`input`]);function mj(e,t){let n=t.draft;return!!n&&!e.some(e=>e.kind===`a2ui`&&e.draft?.id===n.id&&e.draft.version>n.version)}function hj(e){return(e.toLowerCase().replace(/[^a-z0-9]+/g,`-`).replace(/^-|-$/g,``).slice(0,48).replace(/-$/g,``)||`card`)+`.card.yaml`}var gj=H(`

`),_j=H(`
`,1),vj=H(``),yj=H(``),bj=H(`
`),xj=H(`
`);function Sj(e,t){O(t,!0);let n=()=>A(Fo,`$thread`,r),[r,i]=Zt(),a=M(!1),o=M(``),s=M(``),c=M(!1),l=M(``),u=M(``),d=M(null),f=M(``),p=M(``);function m(){N(o,t.item.draft?.name||``,!0),N(s,hj(B(o)),!0),N(d,null),N(l,``),N(a,!0)}function h(){N(d,null),N(l,``)}async function g(e=!1){if(!t.item.draft||B(c))return;let r=JSON.stringify([B(o),B(s),t.item.surfaceId]);(r!==B(p)||!B(f))&&(N(p,r,!0),N(f,crypto.randomUUID(),!0)),N(c,!0),N(l,``);try{let r=await Q.saveCard(n().chat,{draft_id:t.item.draft.id,expected_version:t.item.draft.version,surface_id:t.item.surfaceId,name:B(o),filename:B(s),request_id:B(f),replace:e,conflict_token:e&&B(d)?.conflict_token||``});r.status===`conflict`?N(d,r,!0):(N(u,r.message||`Saved to ${r.path}`,!0),N(a,!1),N(f,``))}catch(e){N(l,e instanceof Error?e.message:String(e),!0)}finally{N(c,!1)}}function _(){N(o,B(o)+` copy`),N(s,hj(B(o)),!0),N(f,``),N(d,null)}var v=xj(),y=F(v),b=F(y),x=L(b),S=R(b,2);D(y);var C=R(y,2),w=e=>{var t=gj(),n=L(t,!0);z(()=>W(n,B(u))),U(e,t)};G(C,e=>{B(u)&&e(w)});var T=R(C,2),ee=e=>{var t=bj(),n=F(t),r=R(F(n));za(r),D(n);var i=R(n,2),u=R(F(i));za(u),D(i);var f=R(i,2),p=e=>{var t=_j(),n=I(t),r=L(n,!0),i=R(n,2),a=F(i),o=R(a,2);D(i),z(()=>{W(r,B(d).message),a.disabled=B(c),o.disabled=B(c)}),V(`click`,a,()=>g(!0)),V(`click`,o,_),U(e,t)},m=e=>{var t=vj(),n=L(t,!0);z(e=>{t.disabled=e,W(n,B(c)?`Saving…`:`Save card`)},[()=>B(c)||!B(o).trim()||!B(s).trim()]),U(e,t)};G(f,e=>{B(d)?e(p):e(m,-1)});var v=R(f,2),y=e=>{var t=yj(),n=L(t,!0);z(()=>W(n,B(l))),U(e,t)};G(v,e=>{B(l)&&e(y)});var b=R(v,2);D(t),z(()=>{r.disabled=B(c),u.disabled=B(c),b.disabled=B(c)}),Oi(`submit`,t,e=>{e.preventDefault(),g()}),V(`input`,r,h),qa(r,()=>B(o),e=>N(o,e)),V(`input`,u,h),qa(u,()=>B(s),e=>N(s,e)),V(`click`,b,()=>N(a,!1)),U(e,t)};G(T,e=>{B(a)&&e(ee)}),D(v),z(()=>W(x,`${t.item.draft?.name??``} · Version ${t.item.draft?.version??``}`)),V(`click`,S,m),U(e,v),k(),i()}ki([`click`,`input`]);var Cj=H(`
Overview AG2 catalog
`),wj=H(`
`),Tj=H(` `,1);function Ej(e,t){O(t,!0);let n=()=>A(Fo,`$thread`,r),[r,i]=Zt(),a=j(()=>t.item.data||{}),o=j(()=>t.item.components||t.item.component._components||[t.item.component]),s=j(()=>fb(t.item.component.component).toLowerCase()),c=j(()=>!!B(s)),l=j(()=>B(s)===`card`&&fb(t.item.component.variant)===`feature`),u=j(()=>t.item.title||`Interactive view`),d=j(()=>n().items.some(e=>e.kind===`agent`&&e.streaming&&ob(e.text)===t.item.surfaceId)),f=j(()=>n().items.some(e=>e.kind===`note`&&e.a2uiActionPending&&e.surfaceId===t.item.surfaceId)),p=M(P({}));hr(()=>{N(p,B(a),!0)});function m(e,t){N(p,Zy(B(p),e,t),!0)}function h(e){ax({version:t.item.version||`v1.0`,action:{...e,surfaceId:t.item.surfaceId,timestamp:new Date().toISOString()}},{surfaceId:t.item.surfaceId,data:B(p)})}var g=Tj(),_=I(g),v=e=>{KO(e,{})},y=e=>{pj(e,{get component(){return t.item.component},get components(){return B(o)},get data(){return B(p)},onDataChange:m,onAction:h})},b=e=>{var n=Cj(),r=F(n),i=F(r);$(F(i),{name:`sparkles`,size:15}),D(i);var a=R(i,2),s=L(R(F(a),2),!0);D(a);var c=R(a,2);D(r),pj(R(r,2),{get component(){return t.item.component},get components(){return B(o)},get data(){return B(p)},onDataChange:m,onAction:h}),D(n),z(()=>{W(s,B(u)),J(c,`title`,t.item.catalogId)}),U(e,n)};G(_,e=>{B(d)?e(v):B(l)?e(y,1):B(c)&&e(b,2)});var x=R(_,2),S=e=>{Sj(e,{get item(){return t.item}})},C=j(()=>mj(n().items,t.item));G(x,e=>{B(C)&&e(S)});var w=R(x,2),T=e=>{var t=wj();$(F(t),{name:`rotate-cw`,size:14}),D(t),U(e,t)};G(w,e=>{B(f)&&e(T)}),U(e,g),k(),i()}var Dj=e=>(e||``).split(`.`).pop()??``,Oj=`https://docs.ag2.ai`,kj={Model:{color:`#4c8bf5`,blurb:`AG2 Agent ↔ provider (the LLM calls)`},Tool:{color:`#1f9d55`,blurb:`AG2 tools (search, shell, code, fetch, filesystem, MCP…)`},Memory:{color:`#9b59b6`,blurb:`AG2 KnowledgeConfig — aggregation & compaction`},Subagent:{color:`#e67e22`,blurb:`AG2 subagents — run_task lifecycle`},HITL:{color:`#e0b400`,blurb:`AG2 human-in-the-loop (context.input / hitl_hook)`},Observer:{color:`#c2410c`,blurb:`AG2 observers — alerts & halts`},Voice:{color:`#16a3a3`,blurb:`AG2 LiveAgent — realtime voice`},A2UI:{color:`#d8552f`,blurb:`A2UI declarative generative UI surfaces`},Usage:{color:`#888`,blurb:`AG2 token usage accounting`},Stream:{color:`#888`,blurb:`AG2 Stream lifecycle`}},Aj={ModelRequest:`Model`,ModelResponse:`Model`,ModelMessage:`Model`,ModelMessageChunk:`Model`,ToolCallsEvent:`Tool`,ToolCallEvent:`Tool`,ToolResultEvent:`Tool`,ToolResultsEvent:`Tool`,GeminiToolCallEvent:`Tool`,OpenAIToolCallEvent:`Tool`,AnthropicToolCallEvent:`Tool`,AggregationStarted:`Memory`,AggregationCompleted:`Memory`,AggregationFailed:`Memory`,CompactionStarted:`Memory`,CompactionCompleted:`Memory`,CompactionFailed:`Memory`,TaskStarted:`Subagent`,TaskCompleted:`Subagent`,TaskFailed:`Subagent`,TaskCancelled:`Subagent`,HumanInputRequest:`HITL`,HumanMessage:`HITL`,ObserverAlert:`Observer`,HaltEvent:`Observer`,UsageEvent:`Usage`,RecordedAudioEvent:`Voice`,SynthesizedAudioEvent:`Voice`,TranscriptionChunkEvent:`Voice`,TranscriptionCompletedEvent:`Voice`,A2UIMessageEvent:`A2UI`,A2UIClientEvent:`A2UI`,A2UIValidationFailedEvent:`A2UI`},jj={TaskCreated:`Subagent`,TaskScheduled:`Subagent`,DeliverableProduced:`Subagent`,InquiryRaised:`HITL`,InquiryAnswered:`HITL`,SubagentTrace:`Subagent`,FeedbackGiven:`Memory`,FeedbackCleared:`Memory`,A2UISurface:`A2UI`};function Mj(e){let t=Dj(e),n=(e||``).startsWith(`ag2.`);return{sub:Aj[t]||jj[t]||`Stream`,label:t,layer:n?`ag2`:`app`}}var Nj={user:{sub:`Model`,label:`ModelRequest`,layer:`ag2`},agent:{sub:`Model`,label:`ModelResponse`,layer:`ag2`},tools:{sub:`Tool`,label:`ToolCallsEvent → AG2 tools`,layer:`ag2`},subagent:{sub:`Subagent`,label:`subagents.run_task`,layer:`ag2`},inquiry:{sub:`HITL`,label:`HumanInputRequest / InquiryRaised`,layer:`ag2`},taskcard:{sub:`Subagent`,label:`TaskCreated (app event on AG2 stream)`,layer:`app`},deliverable:{sub:`Subagent`,label:`DeliverableProduced (app event)`,layer:`app`},a2ui:{sub:`A2UI`,label:`A2UI surface`,layer:`app`},note:{sub:`Stream`,label:`lifecycle note`,layer:`app`}},Pj=e=>Nj[e]||null,Fj=[{sub:`Model`,name:`ag2.Agent`,what:`The universal runtime: model config, tools, knowledge, assembly, HITL, middleware, observers`,layer:`ag2`},{sub:`Stream`,name:`Stream + EventLogWriter`,what:`One event stream is the log, the wire protocol, and the source this whole UI is a projection of`,layer:`ag2`},{sub:`Memory`,name:`KnowledgeConfig + WorkingMemoryAggregate`,what:`Persistent learned profile, distilled & injected each turn (+ SummarizeCompact)`,layer:`ag2`},{sub:`Tool`,name:`Native tools`,what:`DuckDuckSearchTool, SandboxShell/CodeTool, WebFetchTool, FilesystemToolkit, SkillSearchToolkit, MCP`,layer:`ag2`},{sub:`Subagent`,name:`subagents.run_task`,what:`Background task work runs as named AG2 subagents (visible, nested)`,layer:`ag2`},{sub:`HITL`,name:`context.input / hitl_hook`,what:`Mid-turn questions & permission gates (durable inquiries ride the stream)`,layer:`ag2`},{sub:`Voice`,name:`LiveAgent`,what:`Realtime voice (Gemini Live / OpenAI realtime), delegating heavy work to the universal agent`,layer:`ag2`},{sub:`A2UI`,name:`autogen.beta.a2ui`,what:`Agent-authored declarative UI messages rendered by the chat/task surface`,layer:`ag2`},{sub:`Observer`,name:`LoopDetector / TokenMonitor / custom`,what:`Stuck-turn guards emitting ObserverAlerts on the stream`,layer:`ag2`},{sub:`Tool`,name:`extensions.docker.DockerEnvironment`,what:`Official AG2 container backend for the code/shell sandbox`,layer:`ag2`},{sub:`Model`,name:`response_schema`,what:`Typed task planning & deliverable verification`,layer:`ag2`},{name:`Durable task store + scheduler`,what:`Persistent tasks, recurrence, cascading cancel, deliverable verification`,layer:`app`},{name:`Gateway + channels + Svelte UI`,what:`FastAPI/WebSocket facade, Telegram/Discord/Slack, this web client`,layer:`app`}],Ij=Oj,Lj=H(`
`),Rj=H(`
`);function zj(e,t){O(t,!0);let n=()=>A(Ks,`$ag2View`,r),[r,i]=Zt(),a=j(()=>n()?Pj(t.item.kind):null);var o=Bi(),s=I(o),c=e=>{var n=Rj(),r=F(n),i=e=>{TT(e,{get item(){return t.item}})},o=e=>{nk(e,{get item(){return t.item}})},s=e=>{fk(e,{get item(){return t.item}})},c=e=>{hk(e,{get item(){return t.item}})},l=e=>{Sk(e,{get item(){return t.item}})},u=e=>{Ak(e,{get item(){return t.item}})},d=e=>{zk(e,{get item(){return t.item}})},f=e=>{Hk(e,{get item(){return t.item}})},p=e=>{qk(e,{get item(){return t.item}})},m=e=>{Zk(e,{get item(){return t.item}})},h=e=>{Ej(e,{get item(){return t.item}})};G(r,e=>{t.item.kind===`user`?e(i):t.item.kind===`agent`?e(o,1):t.item.kind===`tools`?e(s,2):t.item.kind===`taskcard`?e(c,3):t.item.kind===`deliverable`?e(l,4):t.item.kind===`inquiry`?e(u,5):t.item.kind===`subagent`?e(d,6):t.item.kind===`note`?e(f,7):t.item.kind===`genimage`?e(p,8):t.item.kind===`attachment`?e(m,9):t.item.kind===`a2ui`&&e(h,10)});var g=R(r,2),_=e=>{var n=Lj();let r;var i=L(n);z(()=>{r=q(n,1,`ag2tag`,null,r,{right:t.item.kind===`user`,applayer:B(a).layer===`app`}),W(i,`AG2 · ${B(a).label??``}`)}),U(e,n)};G(g,e=>{B(a)&&e(_)}),D(n),U(e,n)};G(s,e=>{t.item.kind===`note`&&t.item.a2uiActionPending||e(c)}),U(e,o),k(),i()}var Bj=Wt({configs:[],active:null,providers:[],loaded:!1});async function Vj(){let e=await Q.liveConfigs();Bj.set({configs:e.configs||[],active:e.active??null,providers:e.providers||[],loaded:!0})}function Hj(e){return e.key_source!==`none`}var Uj=(e,t,n)=>(e.grants||[]).find(e=>e.profile===t&&e.chat_id===n),Wj=(e,t,n)=>n?(e.grants||[]).find(e=>e.profile===t&&e.task_id===n&&!e.chat_id):null,Gj=(e,t)=>(e.grants||[]).some(e=>e.profile===t&&!e.chat_id&&!e.task_id),Kj=(e,t,n)=>{let r=Wj(e,t,n);return r?r.mode===`none`?null:r:(e.grants||[]).find(e=>e.profile===t&&!e.chat_id&&!e.task_id)||null};function qj(e,t,n,r=``){return(e||[]).map(e=>{let i=Uj(e,t,n),a=Wj(e,t,r);return!i||i.mode===`none`||Gj(e,t)||a&&a.mode!==`none`?null:{id:e.id,name:e.name,path:e.path,exists:e.exists!==!1,mode:i.mode}}).filter(e=>e!==null)}function Jj(e,t,n,r=``){return(e||[]).filter(e=>{if(!Kj(e,t,r))return!1;let i=Uj(e,t,n);return!(i&&i.mode===`none`)}).length}function Yj(e,t,n,r=``){let i=Uj(e,t,n);return Kj(e,t,r)?i&&i.mode===`none`?{status:`unblock`,id:e.id,name:e.name}:{status:`covered`,name:e.name}:i?{status:`exists`}:{status:`grant`,id:e.id}}var Xj={telegram:{kind:`solid`,fill:`#26A5E4`,path:`M11.944 0A12 12 0 0 0 0 12a12 12 0 0 0 12 12 12 12 0 0 0 12-12A12 12 0 0 0 12 0a12 12 0 0 0-.056 0zm4.962 7.224c.1-.002.321.023.465.14a.506.506 0 0 1 .171.325c.016.093.036.306.02.472-.18 1.898-.962 6.502-1.36 8.627-.168.9-.499 1.201-.82 1.23-.696.065-1.225-.46-1.9-.902-1.056-.693-1.653-1.124-2.678-1.8-1.185-.78-.417-1.21.258-1.91.177-.184 3.247-2.977 3.307-3.23.007-.032.014-.15-.056-.212s-.174-.041-.249-.024c-.106.024-1.793 1.14-5.061 3.345-.48.33-.913.49-1.302.48-.428-.008-1.252-.241-1.865-.44-.752-.245-1.349-.374-1.297-.789.027-.216.325-.437.893-.663 3.498-1.524 5.83-2.529 6.998-3.014 3.332-1.386 4.025-1.627 4.476-1.635z`},discord:{kind:`solid`,fill:`#5865F2`,path:`M20.317 4.3698a19.7913 19.7913 0 00-4.8851-1.5152.0741.0741 0 00-.0785.0371c-.211.3753-.4447.8648-.6083 1.2495-1.8447-.2762-3.68-.2762-5.4868 0-.1636-.3933-.4058-.8742-.6177-1.2495a.077.077 0 00-.0785-.037 19.7363 19.7363 0 00-4.8852 1.515.0699.0699 0 00-.0321.0277C.5334 9.0458-.319 13.5799.0992 18.0578a.0824.0824 0 00.0312.0561c2.0528 1.5076 4.0413 2.4228 5.9929 3.0294a.0777.0777 0 00.0842-.0276c.4616-.6304.8731-1.2952 1.226-1.9942a.076.076 0 00-.0416-.1057c-.6528-.2476-1.2743-.5495-1.8722-.8923a.077.077 0 01-.0076-.1277c.1258-.0943.2517-.1923.3718-.2914a.0743.0743 0 01.0776-.0105c3.9278 1.7933 8.18 1.7933 12.0614 0a.0739.0739 0 01.0785.0095c.1202.099.246.1981.3728.2924a.077.077 0 01-.0066.1276 12.2986 12.2986 0 01-1.873.8914.0766.0766 0 00-.0407.1067c.3604.698.7719 1.3628 1.225 1.9932a.076.076 0 00.0842.0286c1.961-.6067 3.9495-1.5219 6.0023-3.0294a.077.077 0 00.0313-.0552c.5004-5.177-.8382-9.6739-3.5485-13.6604a.061.061 0 00-.0312-.0286zM8.02 15.3312c-1.1825 0-2.1569-1.0857-2.1569-2.419 0-1.3332.9555-2.4189 2.157-2.4189 1.2108 0 2.1757 1.0952 2.1568 2.419 0 1.3332-.9555 2.4189-2.1569 2.4189zm7.9748 0c-1.1825 0-2.1569-1.0857-2.1569-2.419 0-1.3332.9554-2.4189 2.1569-2.4189 1.2108 0 2.1757 1.0952 2.1568 2.419 0 1.3332-.946 2.4189-2.1568 2.4189Z`},github:{kind:`solid`,path:`M12 .297c-6.63 0-12 5.373-12 12 0 5.303 3.438 9.8 8.205 11.385.6.113.82-.258.82-.577 0-.285-.01-1.04-.015-2.04-3.338.724-4.042-1.61-4.042-1.61C4.422 18.07 3.633 17.7 3.633 17.7c-1.087-.744.084-.729.084-.729 1.205.084 1.838 1.236 1.838 1.236 1.07 1.835 2.809 1.305 3.495.998.108-.776.417-1.305.76-1.605-2.665-.3-5.466-1.332-5.466-5.93 0-1.31.465-2.38 1.235-3.22-.135-.303-.54-1.523.105-3.176 0 0 1.005-.322 3.3 1.23.96-.267 1.98-.399 3-.405 1.02.006 2.04.138 3 .405 2.28-1.552 3.285-1.23 3.285-1.23.645 1.653.24 2.873.12 3.176.765.84 1.23 1.91 1.23 3.22 0 4.61-2.805 5.625-5.475 5.92.42.36.81 1.096.81 2.22 0 1.606-.015 2.896-.015 3.286 0 .315.21.69.825.57C20.565 22.092 24 17.592 24 12.297c0-6.627-5.373-12-12-12`},slack:{kind:`multi`,viewBox:`0 0 128 128`,parts:[{fill:`#de1c59`,path:`M27.255 80.719c0 7.33-5.978 13.317-13.309 13.317C6.616 94.036.63 88.049.63 80.719s5.987-13.317 13.317-13.317h13.309zm6.709 0c0-7.33 5.987-13.317 13.317-13.317s13.317 5.986 13.317 13.317v33.335c0 7.33-5.986 13.317-13.317 13.317-7.33 0-13.317-5.987-13.317-13.317zm0 0`},{fill:`#35c5f0`,path:`M47.281 27.255c-7.33 0-13.317-5.978-13.317-13.309C33.964 6.616 39.951.63 47.281.63s13.317 5.987 13.317 13.317v13.309zm0 6.709c7.33 0 13.317 5.987 13.317 13.317s-5.986 13.317-13.317 13.317H13.946C6.616 60.598.63 54.612.63 47.281c0-7.33 5.987-13.317 13.317-13.317zm0 0`},{fill:`#2eb57d`,path:`M100.745 47.281c0-7.33 5.978-13.317 13.309-13.317 7.33 0 13.317 5.987 13.317 13.317s-5.987 13.317-13.317 13.317h-13.309zm-6.709 0c0 7.33-5.987 13.317-13.317 13.317s-13.317-5.986-13.317-13.317V13.946C67.402 6.616 73.388.63 80.719.63c7.33 0 13.317 5.987 13.317 13.317zm0 0`},{fill:`#ebb02e`,path:`M80.719 100.745c7.33 0 13.317 5.978 13.317 13.309 0 7.33-5.987 13.317-13.317 13.317s-13.317-5.987-13.317-13.317v-13.309zm0-6.709c-7.33 0-13.317-5.987-13.317-13.317s5.986-13.317 13.317-13.317h33.335c7.33 0 13.317 5.986 13.317 13.317 0 7.33-5.987 13.317-13.317 13.317zm0 0`}]},google:{kind:`multi`,viewBox:`0 0 128 128`,parts:[{fill:`#e33629`,path:`M44.59 4.21a64 64 0 0142.61.37 61.22 61.22 0 0120.35 12.62c-2 2.14-4.11 4.14-6.15 6.22Q95.58 29.23 89.77 35a34.28 34.28 0 00-13.64-8 37.17 37.17 0 00-37.46 9.74 39.25 39.25 0 00-9.18 14.91L8.76 35.6A63.53 63.53 0 0144.59 4.21z`},{fill:`#f8bd00`,path:`M3.26 51.5a62.93 62.93 0 015.5-15.9l20.73 16.09a38.31 38.31 0 000 24.63q-10.36 8-20.73 16.08a63.33 63.33 0 01-5.5-40.9z`},{fill:`#587dbd`,path:`M65.27 52.15h59.52a74.33 74.33 0 01-1.61 33.58 57.44 57.44 0 01-16 26.26c-6.69-5.22-13.41-10.4-20.1-15.62a29.72 29.72 0 0012.66-19.54H65.27c-.01-8.22 0-16.45 0-24.68z`},{fill:`#319f43`,path:`M8.75 92.4q10.37-8 20.73-16.08A39.3 39.3 0 0044 95.74a37.16 37.16 0 0014.08 6.08 41.29 41.29 0 0015.1 0 36.16 36.16 0 0013.93-5.5c6.69 5.22 13.41 10.4 20.1 15.62a57.13 57.13 0 01-25.9 13.47 67.6 67.6 0 01-32.36-.35 63 63 0 01-23-11.59A63.73 63.73 0 018.75 92.4z`}]},openai:{kind:`solid`,path:`M22.2819 9.8211a5.9847 5.9847 0 0 0-.5157-4.9108 6.0462 6.0462 0 0 0-6.5098-2.9A6.0651 6.0651 0 0 0 4.9807 4.1818a5.9847 5.9847 0 0 0-3.9977 2.9 6.0462 6.0462 0 0 0 .7427 7.0966 5.98 5.98 0 0 0 .511 4.9107 6.051 6.051 0 0 0 6.5146 2.9001A5.9847 5.9847 0 0 0 13.2599 24a6.0557 6.0557 0 0 0 5.7718-4.2058 5.9894 5.9894 0 0 0 3.9977-2.9001 6.0557 6.0557 0 0 0-.7475-7.0729zm-9.022 12.6081a4.4755 4.4755 0 0 1-2.8764-1.0408l.1419-.0804 4.7783-2.7582a.7948.7948 0 0 0 .3927-.6813v-6.7369l2.02 1.1686a.071.071 0 0 1 .038.052v5.5826a4.504 4.504 0 0 1-4.4945 4.4944zm-9.6607-4.1254a4.4708 4.4708 0 0 1-.5346-3.0137l.142.0852 4.783 2.7582a.7712.7712 0 0 0 .7806 0l5.8428-3.3685v2.3324a.0804.0804 0 0 1-.0332.0615L9.74 19.9502a4.4992 4.4992 0 0 1-6.1408-1.6464zM2.3408 7.8956a4.485 4.485 0 0 1 2.3655-1.9728V11.6a.7664.7664 0 0 0 .3879.6765l5.8144 3.3543-2.0201 1.1685a.0757.0757 0 0 1-.071 0l-4.8303-2.7865A4.504 4.504 0 0 1 2.3408 7.872zm16.5963 3.8558L13.1038 8.364 15.1192 7.2a.0757.0757 0 0 1 .071 0l4.8303 2.7913a4.4944 4.4944 0 0 1-.6765 8.1042v-5.6772a.79.79 0 0 0-.407-.667zm2.0107-3.0231l-.142-.0852-4.7735-2.7818a.7759.7759 0 0 0-.7854 0L9.409 9.2297V6.8974a.0662.0662 0 0 1 .0284-.0615l4.8303-2.7866a4.4992 4.4992 0 0 1 6.6802 4.66zM8.3065 12.863l-2.02-1.1638a.0804.0804 0 0 1-.038-.0567V6.0742a4.4992 4.4992 0 0 1 7.3757-3.4537l-.142.0805L8.704 5.459a.7948.7948 0 0 0-.3927.6813zm1.0976-2.3654l2.602-1.4998 2.6069 1.4998v2.9994l-2.5974 1.4997-2.6067-1.4997Z`},anthropic:{kind:`solid`,fill:`#D97757`,path:`M17.3041 3.541h-3.6718l6.696 16.918H24Zm-10.6082 0L0 20.459h3.7442l1.3693-3.5527h7.0052l1.3693 3.5528h3.7442L10.5363 3.5409Zm-.3712 10.2232 2.2914-5.9456 2.2914 5.9456Z`},gemini:{kind:`gradient`,stops:[`#4285F4`,`#9B72CB`,`#D96570`],path:`M11.04 19.32Q12 21.51 12 24q0-2.49.93-4.68.96-2.19 2.58-3.81t3.81-2.55Q21.51 12 24 12q-2.49 0-4.68-.93a12.3 12.3 0 0 1-3.81-2.58 12.3 12.3 0 0 1-2.58-3.81Q12 2.49 12 0q0 2.49-.96 4.68-.93 2.19-2.55 3.81a12.3 12.3 0 0 1-3.81 2.58Q2.49 12 0 12q2.49 0 4.68.96 2.19.93 3.81 2.55t2.55 3.81`},ollama:{kind:`solid`,path:`M16.361 10.26a.894.894 0 0 0-.558.47l-.072.148.001.207c0 .193.004.217.059.353.076.193.152.312.291.448.24.238.51.3.872.205a.86.86 0 0 0 .517-.436.752.752 0 0 0 .08-.498c-.064-.453-.33-.782-.724-.897a1.06 1.06 0 0 0-.466 0zm-9.203.005c-.305.096-.533.32-.65.639a1.187 1.187 0 0 0-.06.52c.057.309.31.59.598.667.362.095.632.033.872-.205.14-.136.215-.255.291-.448.055-.136.059-.16.059-.353l.001-.207-.072-.148a.894.894 0 0 0-.565-.472 1.02 1.02 0 0 0-.474.007Zm4.184 2c-.131.071-.223.25-.195.383.031.143.157.288.353.407.105.063.112.072.117.136.004.038-.01.146-.029.243-.02.094-.036.194-.036.222.002.074.07.195.143.253.064.052.076.054.255.059.164.005.198.001.264-.03.169-.082.212-.234.15-.525-.052-.243-.042-.28.087-.355.137-.08.281-.219.324-.314a.365.365 0 0 0-.175-.48.394.394 0 0 0-.181-.033c-.126 0-.207.03-.355.124l-.085.053-.053-.032c-.219-.13-.259-.145-.391-.143a.396.396 0 0 0-.193.032zm.39-2.195c-.373.036-.475.05-.654.086-.291.06-.68.195-.951.328-.94.46-1.589 1.226-1.787 2.114-.04.176-.045.234-.045.53 0 .294.005.357.043.524.264 1.16 1.332 2.017 2.714 2.173.3.033 1.596.033 1.896 0 1.11-.125 2.064-.727 2.493-1.571.114-.226.169-.372.22-.602.039-.167.044-.23.044-.523 0-.297-.005-.355-.045-.531-.288-1.29-1.539-2.304-3.072-2.497a6.873 6.873 0 0 0-.855-.031zm.645.937a3.283 3.283 0 0 1 1.44.514c.223.148.537.458.671.662.166.251.26.508.303.82.02.143.01.251-.043.482-.08.345-.332.705-.672.957a3.115 3.115 0 0 1-.689.348c-.382.122-.632.144-1.525.138-.582-.006-.686-.01-.853-.042-.57-.107-1.022-.334-1.35-.68-.264-.28-.385-.535-.45-.946-.03-.192.025-.509.137-.776.136-.326.488-.73.836-.963.403-.269.934-.46 1.422-.512.187-.02.586-.02.773-.002zm-5.503-11a1.653 1.653 0 0 0-.683.298C5.617.74 5.173 1.666 4.985 2.819c-.07.436-.119 1.04-.119 1.503 0 .544.064 1.24.155 1.721.02.107.031.202.023.208a8.12 8.12 0 0 1-.187.152 5.324 5.324 0 0 0-.949 1.02 5.49 5.49 0 0 0-.94 2.339 6.625 6.625 0 0 0-.023 1.357c.091.78.325 1.438.727 2.04l.13.195-.037.064c-.269.452-.498 1.105-.605 1.732-.084.496-.095.629-.095 1.294 0 .67.009.803.088 1.266.095.555.288 1.143.503 1.534.071.128.243.393.264.407.007.003-.014.067-.046.141a7.405 7.405 0 0 0-.548 1.873c-.062.417-.071.552-.071.991 0 .56.031.832.148 1.279L3.42 24h1.478l-.05-.091c-.297-.552-.325-1.575-.068-2.597.117-.472.25-.819.498-1.296l.148-.29v-.177c0-.165-.003-.184-.057-.293a.915.915 0 0 0-.194-.25 1.74 1.74 0 0 1-.385-.543c-.424-.92-.506-2.286-.208-3.451.124-.486.329-.918.544-1.154a.787.787 0 0 0 .223-.531c0-.195-.07-.355-.224-.522a3.136 3.136 0 0 1-.817-1.729c-.14-.96.114-2.005.69-2.834.563-.814 1.353-1.336 2.237-1.475.199-.033.57-.028.776.01.226.04.367.028.512-.041.179-.085.268-.19.374-.431.093-.215.165-.333.36-.576.234-.29.46-.489.822-.729.413-.27.884-.467 1.352-.561.17-.035.25-.04.569-.04.319 0 .398.005.569.04a4.07 4.07 0 0 1 1.914.997c.117.109.398.457.488.602.034.057.095.177.132.267.105.241.195.346.374.43.14.068.286.082.503.045.343-.058.607-.053.943.016 1.144.23 2.14 1.173 2.581 2.437.385 1.108.276 2.267-.296 3.153-.097.15-.193.27-.333.419-.301.322-.301.722-.001 1.053.493.539.801 1.866.708 3.036-.062.772-.26 1.463-.533 1.854a2.096 2.096 0 0 1-.224.258.916.916 0 0 0-.194.25c-.054.109-.057.128-.057.293v.178l.148.29c.248.476.38.823.498 1.295.253 1.008.231 2.01-.059 2.581a.845.845 0 0 0-.044.098c0 .006.329.009.732.009h.73l.02-.074.036-.134c.019-.076.057-.3.088-.516.029-.217.029-1.016 0-1.258-.11-.875-.295-1.57-.597-2.226-.032-.074-.053-.138-.046-.141.008-.005.057-.074.108-.152.376-.569.607-1.284.724-2.228.031-.26.031-1.378 0-1.628-.083-.645-.182-1.082-.348-1.525a6.083 6.083 0 0 0-.329-.7l-.038-.064.131-.194c.402-.604.636-1.262.727-2.04a6.625 6.625 0 0 0-.024-1.358 5.512 5.512 0 0 0-.939-2.339 5.325 5.325 0 0 0-.95-1.02 8.097 8.097 0 0 1-.186-.152.692.692 0 0 1 .023-.208c.208-1.087.201-2.443-.017-3.503-.19-.924-.535-1.658-.98-2.082-.354-.338-.716-.482-1.15-.455-.996.059-1.8 1.205-2.116 3.01a6.805 6.805 0 0 0-.097.726c0 .036-.007.066-.015.066a.96.96 0 0 1-.149-.078A4.857 4.857 0 0 0 12 3.03c-.832 0-1.687.243-2.456.698a.958.958 0 0 1-.148.078c-.008 0-.015-.03-.015-.066a6.71 6.71 0 0 0-.097-.725C8.997 1.392 8.337.319 7.46.048a2.096 2.096 0 0 0-.585-.041Zm.293 1.402c.248.197.523.759.682 1.388.03.113.06.244.069.292.007.047.026.152.041.233.067.365.098.76.102 1.24l.002.475-.12.175-.118.178h-.278c-.324 0-.646.041-.954.124l-.238.06c-.033.007-.038-.003-.057-.144a8.438 8.438 0 0 1 .016-2.323c.124-.788.413-1.501.696-1.711.067-.05.079-.049.157.013zm9.825-.012c.17.126.358.46.498.888.28.854.36 2.028.212 3.145-.019.14-.024.151-.057.144l-.238-.06a3.693 3.693 0 0 0-.954-.124h-.278l-.119-.178-.119-.175.002-.474c.004-.669.066-1.19.214-1.772.157-.623.434-1.185.68-1.382.078-.062.09-.063.159-.012z`}},Zj={openai_responses:`openai`,openai_subscription:`openai`,codex:`openai`,claude_code:`anthropic`};function Qj(e){if(!e)return null;let t=Object.hasOwn(Zj,e)?Zj[e]:e;return Object.hasOwn(Xj,t)?Xj[t]:null}var $j=0,eM=Ri(``),tM=Ri(``),nM=Ri(``,1),rM=Ri(``);function iM(e,t){O(t,!0);let n=ro(t,`size`,3,20),r=j(()=>Qj(t.brand)),i=`brandmark-gradient-${++$j}`;var a=Bi(),o=I(a),s=e=>{var t=rM(),a=F(t),o=e=>{var t=Bi();K(I(t),17,()=>B(r).parts||[],Qi,(e,t)=>{var n=eM();z(()=>{J(n,`d`,B(t).path),J(n,`fill`,B(t).fill)}),U(e,n)}),U(e,t)},s=e=>{var t=nM(),n=I(t),a=F(n);K(a,21,()=>B(r).stops||[],Qi,(e,t,n)=>{var i=tM();z(e=>{J(i,`offset`,e),J(i,`stop-color`,B(t))},[()=>n/Math.max(1,(B(r).stops||[]).length-1)]),U(e,i)}),D(a),D(n);var o=R(n);z(()=>{J(a,`id`,i),J(o,`d`,B(r).path),J(o,`fill`,`url(#${i})`)}),U(e,t)},c=e=>{var t=eM();z(()=>{J(t,`d`,B(r).path),J(t,`fill`,B(r).fill||`currentColor`)}),U(e,t)};G(a,e=>{B(r).kind===`multi`?e(o):B(r).kind===`gradient`?e(s,1):e(c,-1)}),D(t),z(()=>{J(t,`width`,n()),J(t,`height`,n()),J(t,`viewBox`,B(r).viewBox||`0 0 24 24`)}),U(e,t)};G(o,e=>{B(r)&&e(s)}),U(e,a),k()}var aM=H(`
`),oM=H(``),sM=H(`inherited`),cM=H(` `,1),lM=H(` `,1),uM=H(` `),dM=H(``),fM=H(``),pM=H(``),mM=H(`
`,1),hM=H(`
`),gM=H(`
`);function _M(e,t){O(t,!0);let n=ro(t,`configs`,19,()=>[]),r=ro(t,`activeId`,3,null),i=ro(t,`envOverride`,3,null),a=ro(t,`busy`,3,!1),o=ro(t,`disabled`,3,!1),s=ro(t,`title`,3,``),c=ro(t,`placeholder`,3,`Choose a model`),l=ro(t,`usable`,3,()=>!0),u=ro(t,`down`,3,!1),d=ro(t,`inherited`,3,!1),f=ro(t,`closedBadges`,3,!0),p=ro(t,`defaultEntry`,3,null),m=ro(t,`emptyLabel`,3,`No models configured`),h=ro(t,`onManage`,3,null),g=ro(t,`manageLabel`,3,`Manage models…`),_=M(!1),v=j(()=>n().find(e=>e.id===r())||null);function y(e){a()||!l()(e)||(N(_,!1),t.onChoose?.(e))}function b(){N(_,!1),t.onDefault?.()}var x=gM();Oi(`keydown`,Xn,e=>{e.key===`Escape`&&N(_,!1)});var S=F(x),C=e=>{var t=aM(),n=L(t);z(()=>W(n,`Pinned by environment${i().provider?` · ${i().provider}`:``}${i().model?` · ${i().model}`:``}`)),U(e,t)},w=e=>{var n=oM(),r=L(n,!0);z(()=>W(r,m())),V(`click`,n,function(...e){t.onEmpty?.apply(this,e)}),U(e,n)},T=e=>{var i=hM(),m=F(i),x=F(m),S=e=>{var n=lM(),r=I(n);{let e=j(()=>t.brandFor(B(v)));iM(r,{get brand(){return B(e)},size:14})}var i=R(r,2),a=L(i,!0),o=R(i,2),s=e=>{var t=cM(),n=I(t),r=e=>{U(e,sM())};G(n,e=>{d()&&e(r)});var i=R(n,2);let a;z(e=>a=q(i,1,`modelsw-dot`,null,a,{warn:e}),[()=>!l()(B(v))]),U(e,t)};G(o,e=>{f()&&e(s)}),z(()=>W(a,B(v).name)),U(e,n)},C=e=>{var t=uM(),n=L(t,!0);z(()=>W(n,c())),U(e,t)};G(x,e=>{B(v)?e(S):e(C,-1)}),$(R(x,2),{name:`chevron-down`,size:13}),D(m);var w=R(m,2),T=e=>{var i=mM(),a=I(i),o=R(a,2);let s;var c=F(o),f=e=>{var t=dM();let n;var r=F(t),i=F(r),a=F(i,!0),o=R(a),s=e=>{$(e,{name:`check`,size:12})};G(o,e=>{d()&&e(s)}),D(i);var c=L(R(i,2),!0);D(r),D(t),z(()=>{n=q(t,1,`modelsw-item`,null,n,{active:d()}),W(a,p().label),W(c,p().sub)}),V(`click`,t,b),U(e,t)};G(c,e=>{p()&&e(f)});var m=R(c,2);K(m,17,n,e=>e.id,(e,n)=>{var i=fM();let a;var o=F(i);{let e=j(()=>t.brandFor(B(n)));iM(o,{get brand(){return B(e)},size:14})}var s=R(o,2),c=F(s),u=F(c,!0),f=R(u),p=e=>{$(e,{name:`check`,size:12})};G(f,e=>{!d()&&B(n).id===r()&&e(p)}),D(c);var m=L(R(c,2),!0);D(s);var h=R(s,2);let g;D(i),z((e,t,o,s)=>{a=q(i,1,`modelsw-item`,null,a,{active:!d()&&B(n).id===r()}),i.disabled=e,J(i,`title`,t),W(u,B(n).name),W(m,o),g=q(h,1,`modelsw-dot`,null,g,{warn:s})},[()=>!l()(B(n)),()=>l()(B(n))?``:`Not ready — add a key or sign in via Settings`,()=>t.labelFor(B(n)),()=>!l()(B(n))]),V(`click`,i,()=>y(B(n))),U(e,i)});var v=R(m,2),x=e=>{var t=pM(),n=L(t,!0);z(()=>W(n,g())),V(`click`,t,function(...e){h()?.apply(this,e)}),U(e,t)};G(v,e=>{h()&&e(x)}),D(o),z(()=>s=q(o,1,`modelsw-menu`,null,s,{down:u()})),V(`click`,a,()=>N(_,!1)),U(e,i)};G(w,e=>{B(_)&&e(T)}),D(i),z(()=>{m.disabled=a()||o(),J(m,`title`,s())}),V(`click`,m,()=>N(_,!B(_))),U(e,i)};G(S,e=>{i()?e(C):n().length?e(T,-1):e(w,1)}),D(x),U(e,x),k()}ki([`click`]);function vM(e,t){O(t,!0);let n=()=>A(sT,`$llmConfigs`,i),r=()=>A(Io,`$chatModel`,i),[i,a]=Zt(),o=M(!1);io(()=>{cT().catch(()=>{})});let s=j(()=>n().configs),c=j(()=>n().envOverride),l=j(()=>go(r())),u=j(()=>r().chatId),d=j(()=>n().active),f=j(()=>r().exists===null);async function p(e){try{let t=await Q.chat(e),n=null;Io.update(r=>{let i=po(r,e,t);return n=i.patch,i.state}),n!==null&&await Q.updateChat(e,{model:n})}catch{}}hr(()=>{let e=B(u);B(d),e&&p(e)});async function m(e){let t=r();if(B(o)||!t.chatId)return;let n=mo(t,e);if(Io.set(n.state),n.patch!==null){N(o,!0);try{await Q.updateChat(t.chatId,{model:n.patch})}catch{}await p(t.chatId),N(o,!1)}}let h=()=>Rs(`settings`,yo.MODELS);{let t=j(()=>B(o)||B(f));_M(e,{get configs(){return B(s)},get envOverride(){return B(c)},get busy(){return B(t)},get activeId(){return B(l).activeId},get inherited(){return B(l).inherited},closedBadges:!1,title:`Model for your next message in this chat`,brandFor:e=>e.type,labelFor:e=>`${xx[e.type]} · ${e.model}`,get usable(){return lT},defaultEntry:{label:`Use default`,sub:`Follow the Active model`},emptyLabel:`No models configured — add one in Settings`,onEmpty:h,onChoose:e=>m(e.id),onDefault:()=>m(``),onManage:h})}k(),a()}var yM=H(``),bM=H(`R+W`),xM=H(` `),SM=H(`
`),CM=H(`
`),wM=H(` `),TM=H(`
`),EM=H(` `),DM=H(``),OM=H(`
`),kM=H(`
`),AM=H(` `),jM=H(``),MM=H(`No Live model yet — click to configure one in Settings and enable Live support.`),NM=H(``),PM=H(`No model configured — add one in Settings → Models to send messages.`),FM=H(` `),IM=H(`

`),LM=H(` `,1),RM=H(`
AG2 Assistant is AI and can make mistakes. Check important info.
`,1);function zM(e,t){O(t,!0);let n=()=>A(vC,`$foldersStore`,l),r=()=>A(No,`$profiles`,l),i=()=>A(Fo,`$thread`,l),a=()=>A(Vo,`$runInfo`,l),o=()=>A(Bj,`$liveConfigs`,l),s=()=>A(sT,`$llmConfigs`,l),c=()=>A(qb,`$voice`,l),[l,u]=Zt();io(()=>{Vj().catch(()=>{}),n().loaded||yC(),Q.settings().then(e=>{N(g,e.fs,!0)}).catch(()=>{})});let d=j(()=>r().activeId||hs()||``),f=j(()=>i().chat),p=j(()=>i().kind===`run`&&a()?.id===i().id&&a().task_id||``),m=j(()=>(i().kind===`chat`||i().kind===`run`)&&!!B(f)),h=j(()=>n().folders),g=M(P({})),_=M(!1),v=M(!1),y=M(!1),b=M(``),x=M(``),S=j(()=>B(m)?qj(B(h),B(d),B(f),B(p)):[]),C=j(()=>B(m)?Jj(B(h),B(d),B(f),B(p)):0);async function w(e){N(b,``),N(x,``),N(y,!0);try{await e()}catch(e){N(b,iS(e),!0)}N(y,!1)}function T(){N(b,``),N(x,``),N(_,!0)}let ee=e=>w(async()=>{let t,n;try{t=await Q.createFolder(e),n=t.folders.find(t=>t.path===e)}catch(e){let r=e instanceof ug&&e.status===409?G_.safeParse(e.body):null;if(r?.success)t=await Q.folders(),n=t.folders.find(e=>e.id===r.data.existing.id);else throw e}if(!n)throw Error(`Could not resolve that folder`);let r=Yj(n,B(d),B(f),B(p));r.status===`grant`?t=await Q.setGrant(n.id,B(d),`read`,B(f)):r.status===`unblock`?(t=await Q.revokeGrant(n.id,B(d),B(f)),N(x,`"${r.name}" is available here again.`)):r.status===`covered`?N(x,`"${r.name}" is already available here.`):r.status===`exists`&&N(x,`"${n.name}" is already in this chat.`),bC(t),N(_,!1)}),te=e=>w(async()=>{bC(await Q.revokeGrant(e.id,B(d),B(f)))});function ne(){N(v,!1)}let re=j(()=>!o().active),ie=j(()=>s().loaded&&!s().configs.length&&!s().envOverride),ae=M(``),oe=M(P([])),se=M(!1),ce,le,ue;function de(){ue&&ce&&(ue.scrollTop=ce.scrollTop,ue.scrollLeft=ce.scrollLeft)}let fe=M(P([])),E=M(!1),pe=M(``),me=M(-1),he=M(P([])),ge=M(0),_e=0,ve,ye=M(void 0),be=[],xe=j(()=>vT(B(ae),B(fe)));function Se(){be[B(ge)]?.scrollIntoView({block:`nearest`})}function Ce(){let e=be[0]?.offsetHeight||32;return Math.max(1,Math.floor((B(ye)?.clientHeight||e)/e))}function we(){N(E,!1),N(pe,``),N(me,-1),N(he,[],!0),N(ge,0),_e++}function Te(){if(!ce)return;let e=fT(B(ae),ce.selectionStart);if(!e){B(E)&&we();return}let t=!B(E)||e.start!==B(me)||e.query!==B(pe);N(me,e.start,!0),N(pe,e.query,!0),N(E,!0),t&&Ee(e.query)}function Ee(e){clearTimeout(ve);let t=++_e;ve=setTimeout(async()=>{try{let n=await Q.searchFiles(e,B(f));if(t!==_e)return;N(he,n.results,!0),N(ge,0)}catch{t===_e&&N(he,[],!0)}},120)}function De(e){if(!e)return;let t=ce?ce.selectionStart:B(ae).length,n=dT(e),r=pT(B(ae),B(me),t,n.label);N(ae,r.text,!0),N(fe,[...B(fe),n],!0),we(),queueMicrotask(()=>{ce&&(ce.focus(),ce.selectionStart=ce.selectionEnd=r.caret,je())})}function Oe(){if(!B(ae).trim()&&!B(oe).length)return;let e=xT(B(ae),B(fe)).trim();!e&&!B(oe).length||(nx(e,B(oe).map(e=>e.payload)),N(ae,``),N(oe,[],!0),N(fe,[],!0),we(),ce&&(ce.style.height=`auto`))}function ke(e){if(B(E)&&B(he).length){let t=B(he).length-1,n=n=>{e.preventDefault(),N(ge,Math.max(0,Math.min(t,n)),!0),Se()};if(e.key===`ArrowDown`){e.preventDefault(),N(ge,(B(ge)+1)%B(he).length),Se();return}if(e.key===`ArrowUp`){e.preventDefault(),N(ge,(B(ge)-1+B(he).length)%B(he).length),Se();return}if(e.key===`PageDown`){n(B(ge)+Ce());return}if(e.key===`PageUp`){n(B(ge)-Ce());return}if(e.key===`Home`){n(0);return}if(e.key===`End`){n(t);return}if(e.key===`Enter`||e.key===`Tab`){e.preventDefault(),De(B(he)[B(ge)]);return}}if(B(E)&&e.key===`Escape`){e.preventDefault(),we();return}e.key===`Enter`&&!e.shiftKey&&(e.preventDefault(),Oe())}function Ae(){return i().busy?`Add something while it works…`:i().kind===`task`?`Tell the agent to change this task…`:`Message AG2 Assistant…`}function je(){ce&&(ce.style.height=`auto`,ce.style.height=Math.min(ce.scrollHeight,160)+`px`)}function Me(){if(!c().active&&B(re)){Rs(`settings`,yo.MODELS);return}c().active?hx():px()}function Ne(e){return new Promise((t,n)=>{let r=new FileReader;r.onload=()=>t(String(r.result).split(`,`)[1]||``),r.onerror=n,r.readAsDataURL(e)})}let Pe={"image/png":`png`,"image/jpeg":`jpg`,"image/gif":`gif`,"image/webp":`webp`,"application/pdf":`pdf`,"audio/mpeg":`mp3`,"audio/ogg":`ogg`,"video/mp4":`mp4`,"video/webm":`webm`,"text/plain":`txt`},Fe=0;function Ie(e){return Pe[e]||(String(e||``).split(`/`)[1]||``).replace(/[^a-z0-9].*$/i,``)||`bin`}function Le(e){return e.name&&/\.[^.]+$/.test(e.name)?e.name:`pasted-${++Fe}.${Ie(e.type)}`}async function Re(e){for(let t of e){let e=await Ne(t),n=Le(t);N(oe,[...B(oe),{name:n,payload:{name:n,mime:t.type,data:e}}],!0)}}async function ze(e){await Re(e.currentTarget.files||[]),le&&(le.value=``)}function Be(e){let t=[...e.clipboardData?.items||[]].filter(e=>e.kind===`file`).map(e=>e.getAsFile()).filter(e=>e!==null);t.length&&(e.preventDefault(),Re(t))}function Ve(e){[...e.dataTransfer?.types||[]].includes(`Files`)&&(e.preventDefault(),N(se,!0))}function He(e){let t=e.relatedTarget;(!(t instanceof Node)||!e.currentTarget.contains(t))&&N(se,!1)}function Ue(e){let t=e.dataTransfer?.files;!t||!t.length||(e.preventDefault(),N(se,!1),Re(t))}let We=e=>{N(oe,B(oe).filter((t,n)=>n!==e),!0)};var Ge=RM(),Ke=I(Ge),qe=F(Ke);let Je;var Ye=F(qe),Xe=e=>{var t=SM(),n=F(t),r=e=>{var t=yM(),n=L(t);z(()=>W(n,`+${B(C)??``} inherited folder${B(C)===1?``:`s`}`)),V(`click`,t,()=>N(v,!0)),U(e,t)};G(n,e=>{B(C)&&e(r)}),K(R(n,2),17,()=>B(S),e=>e.id,(e,t)=>{var n=xM();let r;var i=F(n),a=F(i);$(a,{name:`folder`,size:13});var o=R(a);D(i);var s=R(i,2),c=e=>{U(e,bM())};G(s,e=>{B(t).mode===`read_write`&&e(c)});var l=R(s,2);D(n),z(()=>{r=q(n,1,`chip folder svelte-1n8df3y`,null,r,{missing:!B(t).exists}),J(i,`title`,`${B(t).path} · ${B(t).mode===`read_write`?`read + write`:`read`}`),W(o,` ${B(t).name??``}`),l.disabled=B(y)}),V(`click`,i,()=>N(v,!0)),V(`click`,l,()=>te(B(t))),U(e,n)}),D(t),U(e,t)};G(Ye,e=>{B(m)&&(B(C)||B(S).length)&&e(Xe)});var Ze=R(Ye,2),Qe=e=>{var t=CM();let n;var r=L(t,!0);z(()=>{n=q(t,1,`cfmsg svelte-1n8df3y`,null,n,{err:!!B(b)}),W(r,B(b)||B(x))}),U(e,t)};G(Ze,e=>{B(m)&&(B(x)||B(b))&&e(Qe)});var $e=R(Ze,2),et=e=>{var t=TM();K(t,21,()=>B(oe),Qi,(e,t,n)=>{var r=wM(),i=F(r);$(i,{name:`paperclip`,size:13});var a=R(i),o=R(a);D(r),z(()=>W(a,` ${B(t).name??``}`)),V(`click`,o,()=>We(n)),U(e,r)}),D(t),U(e,t)};G($e,e=>{B(oe).length&&e(et)});var nt=R($e,2);Qa(nt,e=>le=e,()=>le);var rt=R(nt,2),it=e=>{var t=kM(),n=F(t),r=e=>{var t=Bi();K(I(t),19,()=>B(he),e=>e.path,(e,t,n)=>{var r=DM();let i;var a=F(r);{let e=j(()=>B(t).kind===`directory`?`folder`:`file-text`);$(a,{get name(){return B(e)},size:14})}var o=R(a,2),s=L(o,!0),c=R(o,2),l=e=>{var n=EM(),r=L(n,!0);z(()=>W(r,B(t).dir)),U(e,n)};G(c,e=>{B(t).dir&&e(l)}),D(r),Qa(r,(e,t)=>be[t]=e,e=>be?.[e],()=>[B(n)]),z(()=>{i=q(r,1,`atrow svelte-1n8df3y`,null,i,{sel:B(n)===B(ge)}),J(r,`aria-selected`,B(n)===B(ge)),W(s,B(t).name)}),V(`mousedown`,r,e=>{e.preventDefault(),De(B(t))}),Oi(`mouseenter`,r,()=>N(ge,B(n),!0)),U(e,r)}),U(e,t)},i=e=>{var t=OM(),n=L(t,!0);z(()=>W(n,B(pe)?`No matching files`:`Type to search files…`)),U(e,t)};G(n,e=>{B(he).length?e(r):e(i,-1)}),D(t),Qa(t,e=>N(ye,e),()=>B(ye)),U(e,t)};G(rt,e=>{B(E)&&e(it)});var at=R(rt,2),ot=F(at);K(ot,21,()=>B(xe),Qi,(e,t)=>{var n=Bi(),r=I(n),i=e=>{var n=AM(),r=L(n,!0);z(()=>W(r,B(t).text)),U(e,n)},a=e=>{var n=zi();z(()=>W(n,B(t).text)),U(e,n)};G(r,e=>{B(t).mark?e(i):e(a,-1)}),U(e,n)}),D(ot),Qa(ot,e=>ue=e,()=>ue);var st=R(ot,2);tn(st),Qa(st,e=>ce=e,()=>ce),D(at);var ct=R(at,2),lt=F(ct);$(F(lt),{name:`plus`,size:18}),D(lt);var ut=R(lt,2),dt=e=>{var t=jM();$(F(t),{name:`folder-plus`,size:18}),D(t),V(`click`,t,T),U(e,t)};G(ut,e=>{B(m)&&e(dt)});var ft=R(ut,2),pt=F(ft);vM(pt,{});var mt=R(pt,2),ht=F(mt);let gt;$(F(ht),{name:`waveform`,size:18}),D(ht);var _t=R(ht,2),vt=e=>{U(e,MM())};G(_t,e=>{B(re)&&!c().active&&e(vt)}),D(mt);var yt=R(mt,2),bt=e=>{var t=NM();$(F(t),{name:`square`,size:15}),D(t),V(`click`,t,function(...e){rx?.apply(this,e)}),U(e,t)},xt=e=>{var t=FM(),n=F(t);$(F(n),{name:`arrow-up`,size:18}),D(n);var r=R(n,2),i=e=>{U(e,PM())};G(r,e=>{B(ie)&&e(i)}),D(t),z(e=>{n.disabled=e,J(n,`title`,B(ie)?void 0:`Send`)},[()=>B(ie)||!B(ae).trim()&&!B(oe).length]),V(`click`,n,Oe),U(e,t)};G(yt,e=>{i().busy?e(bt):e(xt,-1)}),D(ft),D(ct),D(qe),tt(2),D(Ke);var St=R(Ke,2),Ct=e=>{var t=LM(),n=I(t),r=R(n,2),i=R(F(r),4),a=e=>{var t=IM(),n=L(t,!0);z(()=>W(n,B(b))),U(e,t)};G(i,e=>{B(b)&&e(a)});var o=R(i,2);{let e=j(()=>B(g).cwd||B(g).home||``);xS(o,{get roots(){return B(g)},get start(){return B(e)},get busy(){return B(y)},onUse:ee})}var s=R(o,2);D(r),V(`click`,n,()=>N(_,!1)),V(`click`,s,()=>N(_,!1)),U(e,t)};G(St,e=>{B(_)&&e(Ct)});var wt=R(St,2),Tt=e=>{PC(e,{get chatId(){return B(f)},get taskId(){return B(p)},onClose:ne})};G(wt,e=>{B(v)&&e(Tt)}),z(e=>{Je=q(qe,1,`inputbox svelte-1n8df3y`,null,Je,{busy:i().busy,dragging:B(se)}),J(st,`placeholder`,e),gt=q(ht,1,`cbtn live svelte-1n8df3y`,null,gt,{on:c().active,needcfg:B(re)&&!c().active}),J(ht,`title`,B(re)?void 0:`Live voice`),J(ht,`aria-label`,B(re)?`Configure a Live model`:`Live voice`)},[()=>Ae()]),Oi(`dragover`,qe,Ve),Oi(`dragleave`,qe,He),Oi(`drop`,qe,Ue),V(`change`,nt,ze),V(`input`,st,()=>{je(),Te(),de()}),V(`keydown`,st,ke),V(`keyup`,st,Te),V(`click`,st,Te),Oi(`scroll`,st,de),Oi(`blur`,st,()=>we()),Oi(`paste`,st,Be),qa(st,()=>B(ae),e=>N(ae,e)),V(`click`,lt,()=>le?.click()),V(`click`,ht,Me),U(e,Ge),k(),u()}ki([`click`,`change`,`mousedown`,`input`,`keydown`,`keyup`]);var BM=H(`
`);function VM(e){U(e,BM())}var HM=H(``),UM=H(` `),WM=H(`
`);function GM(e,t){O(t,!1);let n=()=>A(Vo,`$runInfo`,r),[r,i]=Zt(),a=[`completed`,`failed`,`cancelled`],o={completed:`✓ completed`,failed:`✗ failed`,cancelled:`cancelled`,running:`running…`,needs_input:`needs your input`};$a();var s=Bi(),c=I(s),l=e=>{var t=WM(),r=F(t),i=F(r);$(i,{name:`list`,size:13});var s=R(i);D(r);var c=R(r,2),l=L(c),u=R(c,2),d=e=>{var t=HM();$(F(t),{name:`x`,size:13}),tt(),D(t),V(`click`,t,()=>Q.stopRun(n().id)),U(e,t)},f=j(()=>!a.includes(n().status));G(u,e=>{B(f)&&e(d)});var p=R(u,2),m=e=>{var t=UM(),r=F(t);$(r,{name:`x`,size:13});var i=R(r);D(t),z(()=>W(i,` ${n().error??``}`)),U(e,t)};G(p,e=>{n().status===`failed`&&n().error&&e(m)}),D(t),z(e=>{W(s,` ${(n().task_name||`Task`)??``}`),W(l,`${e??``} · ${(o[n().status]||n().status)??``}`)},[()=>vy(n().started_at)]),V(`click`,r,()=>Fs(`/t/`+n().task_id)),U(e,t)};G(c,e=>{n()&&e(l)}),U(e,s),k(),i()}ki([`click`]);var KM=H(``);function qM(e,t){O(t,!0);let n=M(P(C())),r={light:`sun`,dark:`moon`,auto:`contrast`},i=[`light`,`dark`,`auto`];function a(){N(n,i[(i.indexOf(B(n))+1)%i.length],!0),S(B(n))}hr(()=>{let e=e=>{N(n,e.detail.theme,!0)};return document.addEventListener(`ag2-theme-change`,e),()=>document.removeEventListener(`ag2-theme-change`,e)});var o=KM(),s=F(o);$(s,{get name(){return r[B(n)]},size:15});var c=L(R(s),!0);D(o),z(()=>{J(o,`title`,`Theme: `+B(n)+` — click to change`),W(c,B(n))}),V(`click`,o,a),U(e,o),k()}ki([`click`]);var JM=H(`
Checking…
`),YM=H(`
`),XM=H(``),ZM=H(`
`),QM=H(`
`),$M=H(`
`,1),eN=H(``),tN=H(`
`);function nN(e,t){O(t,!0);let n=M(null),r=M(!1),i=M(void 0),a=P({}),o=j(()=>(B(n)?.checks||[]).find(e=>e.id===`mcp`)),s={ok:0,off:0,warn:1,down:2},c=j(()=>{let e=B(n)?.overall||`ok`,t=new Set((B(o)?.servers||[]).map(e=>e.name));return Object.entries(a).some(([e,n])=>t.has(e)&&n&&n.ok===!1)&&s[e]<1&&(e=`warn`),e}),l={ok:`All systems healthy`,warn:`Needs attention — click for details`,down:`Problem — click for details`};async function u(){try{N(n,await Q.health(),!0)}catch{}}function d(){let e=B(o)?.servers||[];for(let t of e)t.enabled!==!1&&a[t.name]?.ok!==!1&&f(t.name)}async function f(e){a[e]={checking:!0};try{a[e]=await Q.healthMcpServer(e)}catch(t){a[e]={ok:!1,error:iS(t)}}}function p(){N(r,!B(r)),B(r)&&d()}function m(e){B(r)&&B(i)&&e.target instanceof Node&&!B(i).contains(e.target)&&N(r,!1)}function h(e){B(r)&&e.key===`Escape`&&N(r,!1)}io(()=>{u();let e=setInterval(u,5e3);return document.addEventListener(`pointerdown`,m,!0),document.addEventListener(`keydown`,h),()=>{clearInterval(e),document.removeEventListener(`pointerdown`,m,!0),document.removeEventListener(`keydown`,h)}});var g=tN(),_=F(g);let v;var y=R(_,2),b=e=>{var t=eN(),r=R(F(t),2),i=e=>{U(e,JM())},o=e=>{var t=Bi();K(I(t),17,()=>B(n).checks,e=>e.id,(e,t)=>{var n=$M(),r=I(n),i=F(r),o=R(i,2),s=F(o),c=L(s,!0),l=R(s,2),u=e=>{var n=YM(),r=L(n,!0);z(()=>W(r,B(t).detail)),U(e,n)};G(l,e=>{B(t).detail&&e(u)}),D(o),D(r);var d=R(r,2),p=e=>{var n=QM();K(n,21,()=>B(t).servers,e=>e.name,(e,t)=>{let n=j(()=>a[B(t).name]);var r=ZM(),i=F(r),o=R(i,2),s=L(o,!0),c=R(o,2);let l;var u=F(c),d=e=>{U(e,zi(`disabled`))},p=e=>{U(e,zi(`—`))},m=e=>{U(e,zi(`checking…`))},h=e=>{var t=zi();z(()=>W(t,`healthy · ${(B(n).tools||[]).length??``} tools`)),U(e,t)},g=e=>{var t=zi();z(()=>W(t,B(n).error)),U(e,t)};G(u,e=>{B(t).enabled===!1?e(d):B(n)?B(n).checking?e(m,2):B(n).ok?e(h,3):e(g,-1):e(p,1)}),D(c);var _=R(c,2),v=e=>{var n=XM();$(F(n),{name:`rotate-cw`,size:12}),D(n),V(`click`,n,()=>f(B(t).name)),U(e,n)};G(_,e=>{B(t).enabled!==!1&&!(B(n)&&B(n).checking)&&e(v)}),D(r),z(()=>{q(i,1,`rowdot state-${B(n)?.ok?`ok`:B(n)?.ok===!1?`down`:`off`}`,`svelte-ozppsh`),J(o,`title`,B(t).name),W(s,B(t).name),l=q(c,1,`srvstat svelte-ozppsh`,null,l,{bad:B(n)&&B(n).ok===!1})}),U(e,r)}),D(n),U(e,n)};G(d,e=>{B(t).id===`mcp`&&(B(t).servers||[]).length&&e(p)}),z(()=>{q(i,1,`rowdot state-${B(t).state??``}`,`svelte-ozppsh`),W(c,B(t).label)}),U(e,n)}),U(e,t)};G(r,e=>{B(n)?e(o,-1):e(i)}),D(t),U(e,t)};G(y,e=>{B(r)&&e(b)}),D(g),Qa(g,e=>N(i,e),()=>B(i)),z(()=>{v=q(_,1,`shdot state-${B(c)??``}`,`svelte-ozppsh`,v,{open:B(r)}),J(_,`title`,l[B(c)]||`System health`),J(_,`aria-expanded`,B(r))}),V(`click`,_,p),U(e,g),k()}ki([`click`]);var rN=H(``),iN=H(` `),aN=H(`
`);function oN(e,t){O(t,!0);let n=()=>A(Ks,`$ag2View`,r),[r,i]=Zt(),a=ro(t,`back`,3,null),o=ro(t,`title`,3,``),s=ro(t,`subtitle`,3,``);var c=aN(),l=F(c),u=e=>{var t=rN(),n=F(t);$(n,{name:`chevron-left`,size:15});var r=R(n);D(t),z(()=>W(r,` ${a().label??``}`)),V(`click`,t,function(...e){a().onClick?.apply(this,e)}),U(e,t)};G(l,e=>{a()&&e(u)});var d=R(l,2),f=F(d),p=L(f,!0),m=R(f,2),h=e=>{var t=iN(),n=L(t,!0);z(()=>W(n,s())),U(e,t)};G(m,e=>{s()&&e(h)}),D(d);var g=R(d,2);ca(g,()=>t.children??ue);var _=R(g,2),v=F(_);nN(v,{});var y=R(v,2);qM(y,{});var b=R(y,2);let x;$(F(b),{name:`code`,size:14}),tt(),D(b),D(_),D(c),z(()=>{W(p,o()),x=q(b,1,`ag2toggle`,null,x,{on:n(),"ag2-glow":n()})}),V(`click`,b,function(...e){Gs?.apply(this,e)}),U(e,c),k(),i()}ki([`click`]);var sN=H(` `),cN=H(` `),lN=H(` `,1),uN=H(`

Ask me anything — I can search, run code, manage tasks, and more.
`),dN=H(`
`),fN=H(``),pN=H(`

`),mN=H(`

A remote client is driving this chat — the composer is unavailable until it ends.

`),hN=H(`
`,1);function gN(e,t){O(t,!0);let n=()=>A(Fo,`$thread`,l),r=()=>A(No,`$profiles`,l),i=()=>A(Io,`$chatModel`,l),a=()=>A(sT,`$llmConfigs`,l),o=()=>A(Lo,`$chats`,l),s=()=>A(Vo,`$runInfo`,l),c=()=>A(ds,`$profile`,l),[l,u]=Zt(),d,f=j(()=>n().items[n().items.length-1]),p=j(()=>r().list.find(e=>e.id===r().activeId)),m=j(()=>_o(i(),n().kind===`chat`?n().id:null,a().active)),h=j(()=>a().configs.find(e=>e.id===B(m))),g=j(()=>[B(p)?.name,B(h)?.name].filter(Boolean).join(` • `)),_=j(()=>n().kind===`chat`?o().find(e=>e.chat_id===n().id):void 0),v=j(()=>B(_)?.origin_platform===`acp`?B(_):void 0),y=j(()=>!!B(v)?.origin_live),b=M(!1),x=M(``);async function S(){if(!(!n().id||B(b))){N(b,!0),N(x,``);try{await Q.closeAcpSession(n().id)}catch(e){N(x,iS(e),!0)}N(b,!1)}}let C=j(()=>_y(n().items)),w=j(()=>n().busy&&!(B(f)&&B(f).kind===`agent`&&B(f).streaming)),T=M(!0);function ee(){d&&N(T,d.scrollHeight-d.scrollTop-d.clientHeight<80)}function te(){if(!d)return;let e=d,t=e.scrollTop,n=e.scrollHeight-e.clientHeight-t;if(n<=4){e.scrollTop=e.scrollHeight,N(T,!0);return}let r=Math.min(600,240+n*.3),i=e=>1-(1-e)**3,a=null;function o(s){a===null&&(a=s);let c=Math.min(1,(s-a)/r);e.scrollTop=t+n*i(c),c<1?requestAnimationFrame(o):N(T,!0)}requestAnimationFrame(o)}let ne=M(160),re=j(()=>Math.round(B(ne)-28+12));hr(()=>{let e=d?.parentElement?.querySelector(`.composer`);if(!e)return;let t=new ResizeObserver(()=>{N(ne,e.offsetHeight,!0)});return t.observe(e),()=>t.disconnect()});let ie=null;hr(()=>{n().id!==ie&&(ie=n().id,N(T,!0))});let ae=null;hr(()=>{B(f)&&B(f).kind===`user`&&B(f).id!==ae&&(ae=B(f).id,N(T,!0))}),hr(()=>{n().items,B(w),B(T)&&requestAnimationFrame(()=>{d&&B(T)&&(d.scrollTop=d.scrollHeight)})});var oe=hN(),se=I(oe);{let e=j(()=>({label:n().kind===`run`?`Task`:`Chat`,onClick:()=>Fs(n().kind===`run`?s()?.task_id?`/t/`+s().task_id:`/tasks`:`/c/`+qs())})),t=j(()=>n().kind===`run`?s()&&s().task_name||`Task`:`Conversation`);oN(se,{get back(){return B(e)},get title(){return B(t)},get subtitle(){return B(g)},children:(e,t)=>{var r=lN(),i=I(r),a=e=>{var t=sN(),n=L(t,!0);z(()=>W(n,s().status)),U(e,t)};G(i,e=>{n().kind===`run`&&s()&&e(a)});var o=R(i,2),c=e=>{var t=cN();let n;var r=L(t);z(()=>{n=q(t,1,`badge acpbadge svelte-1uxvm9k`,null,n,{live:B(y)}),J(t,`title`,B(y)?`Live — driven by the “${B(v).origin_name}” ACP listener`:`Started by the “${B(v).origin_name}” ACP listener`),W(r,`ACP · ${B(v).origin_name??``}`)}),U(e,t)};G(o,e=>{B(v)&&e(c)}),U(e,r)},$$slots:{default:!0}})}var ce=R(se,2),le=F(ce),ue=F(le),de=e=>{GM(e,{})};G(ue,e=>{n().kind===`run`&&e(de)});var fe=R(ue,2),E=e=>{var t=uN(),n=L(F(t));tt(),D(t),z(()=>W(n,`How can I help${c().name?`, ${c().name}`:``}?`)),U(e,t)};G(fe,e=>{!n().items.length&&n().kind===`chat`&&e(E)});var pe=R(fe,2);K(pe,17,()=>B(C),({item:e,sep:t})=>e.id,(e,t)=>{let n=()=>B(t).item,r=()=>B(t).sep;var i=lN(),a=I(i),o=e=>{var t=dN(),n=L(F(t),!0);D(t),z(()=>W(n,r())),U(e,t)};G(a,e=>{r()&&e(o)}),zj(R(a,2),{get item(){return n()}}),U(e,i)});var me=R(pe,2),he=e=>{VM(e,{})};G(me,e=>{B(w)&&e(he)}),D(le),D(ce),Qa(ce,e=>d=e,()=>d);var ge=R(ce,2),_e=e=>{var t=fN();$(F(t),{name:`chevron-down`,size:18}),D(t),z(()=>xa(t,`bottom: ${B(re)??``}px`)),V(`click`,t,te),U(e,t)};G(ge,e=>{B(T)||e(_e)});var ve=R(ge,2),ye=e=>{var t=mN(),n=R(F(t),2),r=e=>{var t=pN(),n=L(t,!0);z(()=>W(n,B(x))),U(e,t)};G(n,e=>{B(x)&&e(r)});var i=R(n,2),a=F(i);$(a,{name:`x`,size:14});var o=R(a);D(i),D(t),z(()=>{i.disabled=B(b),W(o,` ${B(b)?`Closing…`:`Close session`}`)}),V(`click`,i,S),U(e,t)},be=e=>{zM(e,{})};G(ve,e=>{B(y)?e(ye):e(be,-1)}),Oi(`scroll`,ce,ee),U(e,oe),k(),u()}ki([`click`]);var _N=e=>e===`read`||e===`read_write`;function vN(e,t){return e?!t||t===e?null:t:_N(t)?t:null}function yN(e,t){let n=e||[],r=t||[],i=[],a=new Map(n.filter(e=>e.id!=null).map(e=>[e.id,e])),o=new Map(n.map(e=>[e.path,e])),s=new Set;for(let e of r){let t=e.id==null?o.get(e.path):a.get(e.id);t&&s.add(t);let n=e.profileMode??t?.profileMode??null,r=t?.taskMode??null,c=vN(n,e.mode);if(c!==r){if(c===null){i.push({kind:`revoke`,id:e.id??t?.id??null,path:e.path});continue}e.id==null&&!t&&i.push({kind:`create-folder`,path:e.path}),i.push({kind:`set-grant`,id:e.id??t?.id??null,path:e.path,mode:c})}}for(let e of n)s.has(e)||e.taskMode!=null&&i.push({kind:`revoke`,id:e.id,path:e.path});return i}var bN=(e,t)=>{let n=e=>({kind:e?.kind??`manual`,at:e?.at??null,cron:e?.cron??null}),r=n(e),i=n(t);return r.kind===i.kind&&r.at===i.at&&r.cron===i.cron};function xN(e){let t=e?.kind;return{kind:t===`once`||t===`cron`?t:`manual`,at:typeof e?.at==`string`?e.at:null,cron:typeof e?.cron==`string`?e.cron:null}}function SN(e){let t=Math.floor(Number(e));return Number.isFinite(t)&&t>=1?t:1}function CN(e,t){let n={},r=(t.name||``).trim();r&&r!==(e?.name||``)&&(n.name=r);let i=(t.description||``).trim();i!==(e?.description||``)&&(n.description=i);let a=(t.prompt||``).trim();a!==(e?.prompt||``)&&(n.prompt=a);let o=t.model??``;o!==(e?.model??``)&&(n.model=o),bN(e?.schedule,t.schedule)||(n.schedule=t.schedule);let s=t.recall_depth??0;return s!==(e?.recall_depth??0)&&(n.recall_depth=s),n}var wN=H(``),TN=H(``),EN=H(``),DN=H(``),ON=H(`
`);function kN(e,t){O(t,!0);let n=ro(t,`schedule`,15),r=[{id:`manual`,label:`Manual`},{id:`hourly`,label:`Hourly`},{id:`daily`,label:`Daily`},{id:`weekly`,label:`Weekly`},{id:`weekdays`,label:`Weekdays`},{id:`custom`,label:`Custom cron`},{id:`once`,label:`Once at…`}];function i(e){if(e.kind===`manual`)return`manual`;if(e.kind===`once`)return`once`;let t=e.cron||``;return t===`0 * * * *`?`hourly`:/^\d+ \d+ \* \* \*$/.test(t)?`daily`:/^\d+ \d+ \* \* 1$/.test(t)?`weekly`:/^\d+ \d+ \* \* 1-5$/.test(t)?`weekdays`:`custom`}function a(e){let t=(e||``).match(/^(\d+) (\d+) /);return t?String(t[2]).padStart(2,`0`)+`:`+String(t[1]).padStart(2,`0`):`09:00`}let o=M(P(i(n()))),s=M(P(a(n().cron))),c=M(P(n().cron||``)),l=M(P(n().at?n().at.slice(0,16):``));function u(){let[e,t]=(B(s)||`09:00`).split(`:`).map(Number);B(o)===`manual`?n({kind:`manual`,at:null,cron:null}):B(o)===`once`?n({kind:`once`,at:B(l)?new Date(B(l)).toISOString():null,cron:null}):B(o)===`hourly`?n({kind:`cron`,at:null,cron:`0 * * * *`}):B(o)===`daily`?n({kind:`cron`,at:null,cron:`${t} ${e} * * *`}):B(o)===`weekly`?n({kind:`cron`,at:null,cron:`${t} ${e} * * 1`}):B(o)===`weekdays`?n({kind:`cron`,at:null,cron:`${t} ${e} * * 1-5`}):n({kind:`cron`,at:null,cron:B(c).trim()})}var d=ON(),f=F(d);K(f,21,()=>r,Qi,(e,t)=>{var n=wN(),r=L(n,!0),i={};z(()=>{W(r,B(t).label),i!==(i=B(t).id)&&(n.value=(n.__value=i)??``)}),U(e,n)}),D(f),Ea(f);var p=R(f,2),m=e=>{var t=TN();za(t),V(`change`,t,u),qa(t,()=>B(s),e=>N(s,e)),U(e,t)},h=j(()=>[`daily`,`weekly`,`weekdays`].includes(B(o))),g=e=>{var t=EN();za(t),V(`change`,t,u),qa(t,()=>B(c),e=>N(c,e)),U(e,t)},_=e=>{var t=DN();za(t),V(`change`,t,u),qa(t,()=>B(l),e=>N(l,e)),U(e,t)};G(p,e=>{B(h)?e(m):B(o)===`custom`?e(g,1):B(o)===`once`&&e(_,2)}),D(d),V(`change`,f,u),Da(f,()=>B(o),e=>N(o,e)),U(e,d),k()}ki([`change`]);var AN=H(``),jN=H(``),MN=H(`

`,1);function NN(e,t){O(t,!0);let n=ro(t,`depth`,15),r=[{id:`none`,label:`No recall`},{id:`last`,label:`Last N runs`},{id:`all`,label:`All previous runs`}],i=M(P((e=>e?e<0?`all`:`last`:`none`)(n()))),a=M(P(n()>0?n():5));function o(){B(i)===`none`?n(0):B(i)===`all`?n(-1):n(N(a,SN(B(a)),!0))}var s=MN(),c=I(s),l=F(c);K(l,21,()=>r,Qi,(e,t)=>{var n=AN(),r=L(n,!0),i={};z(()=>{W(r,B(t).label),i!==(i=B(t).id)&&(n.value=(n.__value=i)??``)}),U(e,n)}),D(l),Ea(l);var u=R(l,2),d=e=>{var t=jN();za(t),V(`change`,t,o),qa(t,()=>B(a),e=>N(a,e)),U(e,t)};G(u,e=>{B(i)===`last`&&e(d)}),D(c);var f=R(c,2),p=F(f),m=e=>{U(e,zi(`Each run starts fresh, with no knowledge of earlier runs.`))},h=e=>{U(e,zi(`Each run is given a one-line summary of earlier runs, and can open any of them in full.`))};G(p,e=>{B(i)===`none`?e(m):e(h,-1)}),D(f),V(`change`,l,o),Da(l,()=>B(i),e=>N(i,e)),U(e,s),k()}ki([`change`]);var PN=H(`
`),FN=H(` `,1),IN=H(`
`),LN=H(` `),RN=H(`

`,1),zN=H(``),BN=H(` `,1),VN=H(`Delete permanently? `),HN=H(` `,1),UN=H(``),WN=H(`
No runs yet — hit Run now, or wait for the schedule.
`),GN=H(``),KN=H(`

History

`),qN=H(``),JN=H(`

`),YN=H(` `,1),XN=H(` `),ZN=H(``),QN=H(` `,1),$N=H(`
`),eP=H(`
`),tP=H(`
`),nP=H(`
Task folders
`,1),rP=H(`
`),iP=H(`
Profile folders
`,1),aP=H(`
`),oP=H(` `,1),sP=H(`
`),cP=H(` `,1),lP=H(`

—

`),uP=H(`

`),dP=H(`
`),fP=H(`

Approvals you grant during a run appear here.

`),pP=H(`

Always allowed

`,1),mP=H(`

Instructions

Model

Folders

Repeats

Recall earlier runs

`,1),hP=H(`
Loading…
`),gP=H(`
`,1);function _P(e,t){O(t,!0);let n=()=>A(js,`$route`,c),r=()=>A(No,`$profiles`,c),i=()=>A(vC,`$foldersStore`,c),a=()=>A(sT,`$llmConfigs`,c),o=()=>A(Ho,`$pendingTaskEdit`,c),s=()=>A(Ro,`$tasks`,c),[c,l]=Zt(),u=[`completed`,`failed`,`cancelled`],d=M(null),f=M(P([])),p=M(!1),m=M(!1),h=M(!1),g=M(``),_=M(!1),v=M(!1),y=M(``),b=M(``),x=M(``),S=M(null),C=M(P({kind:`manual`,at:null,cron:null})),w=M(0),T=M(P([])),ee=M(!1),te=M(!1),ne=M(P({})),re=!1,ie=j(()=>n().id===`new`),ae=j(()=>B(_)||B(ie)),oe=j(()=>r().activeId||hs()||``);io(()=>{i().loaded||yC(),a().loaded||cT(),Q.settings().then(e=>{N(ne,e.fs,!0)}).catch(()=>{})});let se=j(()=>r().list.find(e=>e.id===r().activeId)),ce=j(()=>B(ae)?B(S):B(d)?.model),le=j(()=>a().configs.find(e=>e.id===(B(ce)||a().active))),ue=j(()=>[B(se)?.name,B(le)?.name].filter(Boolean).join(` • `)),de=j(()=>{let e=B(d)?.model;return e?a().configs.find(t=>t.id===e)?.name||e:`Profile default`}),fe=j(()=>a().configs.find(e=>e.id===B(S))||null),E=j(()=>{let e=B(d)?.model;return e&&a().configs.find(t=>t.id===e)||null});function pe(e){N(S,e,!0),N(te,!1)}function me(){N(te,!1),Rs(`settings`,yo.MODELS)}let he=e=>{let t=B(d);return t?e.grants.find(e=>e.profile===B(oe)&&e.task_id===t.id&&!e.chat_id):void 0},ge=e=>e.grants.find(e=>e.profile===B(oe)&&!e.chat_id&&!e.task_id),_e=e=>{let t=he(e);return t?t.mode:ge(e)?.mode},ve=j(()=>i().folders),ye=j(()=>B(d)?B(ve).filter(e=>{let t=he(e);return t&&t.mode!==`none`&&!ge(e)}):[]),be=j(()=>B(d)?B(ve).filter(e=>ge(e)&&_e(e)!==`none`):[]),xe=j(()=>B(ye).length>0||B(be).length>0),Se=e=>e===`read_write`?`Read + write`:`Read`;function Ce(){return B(d)?B(ve).filter(e=>ge(e)||he(e)).map(e=>({id:e.id,path:e.path,name:e.name,exists:e.exists!==!1,profileMode:ge(e)?.mode??null,taskMode:he(e)?.mode??null})):[]}let we=j(()=>B(T).filter(e=>e.profileMode==null)),Te=j(()=>B(T).filter(e=>e.profileMode!=null)),Ee=M(!1);async function De(){if(!(!B(d)||B(Ee))){N(Ee,!0);try{await Q.taskRunsSeen(B(d).id),await ke(B(d).id)}finally{N(Ee,!1)}}}let Oe=0;async function ke(e){let t=++Oe;if(N(g,``),N(h,!1),N(_,!1),re=!1,e===`new`){N(d,null),N(f,[],!0),je(null),N(_,!0);return}if(!e){N(d,null),N(f,[],!0);return}try{let[n,r]=await Promise.all([Q.task(e),Q.taskPermissions(e).catch(()=>[])]);if(t!==Oe)return;N(d,n,!0),N(f,r,!0),Be(n)}catch{t===Oe&&(N(g,`Task not found.`),N(d,null),N(f,[],!0))}}let Ae=``;hr(()=>{let e=n().id;e!==Ae&&(Ae=e,ke(e))}),hr(()=>{B(d)&&i().loaded&&o()===B(d).id&&(Ho.set(null),Ne())}),hr(()=>{B(ie)&&i().loaded&&!re&&(re=!0,N(T,Me(),!0))}),hr(()=>{let e=B(d);if(!e)return;let t=s().find(t=>t.id===e.id);t&&(t.name!==e.name||t.paused!==e.paused)&&N(d,{...e,name:t.name,paused:t.paused},!0)});function je(e){N(y,e?.name||``,!0),N(b,e?.description||``,!0),N(x,e?.prompt||``,!0),N(S,e?.model??null,!0),N(C,e?xN(St(e.schedule)):{kind:`manual`,at:null,cron:null},!0),N(w,e?.recall_depth??0,!0),N(T,e?Ce().map(e=>({...e,mode:e.taskMode??e.profileMode})):Me(),!0),N(ee,!1),N(te,!1)}function Me(){let e=[];for(let t of B(ve)){let n=ge(t);n&&e.push({id:t.id,path:t.path,name:t.name,exists:t.exists!==!1,profileMode:n.mode,taskMode:null,mode:n.mode})}return e}function Ne(){B(d)&&(je(B(d)),N(g,``),N(_,!0))}function Pe(){N(_,!1),N(g,``)}function Fe(e,t){e.profileMode==null?t===null?N(T,B(T).filter(t=>t!==e),!0):N(T,B(T).map(n=>n===e?{...n,mode:t}:n),!0):N(T,B(T).map(n=>n===e?{...n,mode:t??`none`}:n),!0)}function Ie(e){N(ee,!1),!(!e||B(T).some(t=>t.path===e))&&N(T,[...B(T),{id:null,path:e,name:e,exists:!0,profileMode:null,taskMode:null,mode:`read`}],!0)}async function Le(e,t){let n={};for(let r of e)if(r.kind===`create-folder`){let e,t;try{e=await Q.createFolder(r.path),t=e.folders.find(e=>e.path===r.path)}catch(n){let r=n instanceof ug&&n.status===409?G_.safeParse(n.body):null;if(r?.success)e=await Q.folders(),t=e.folders.find(e=>e.id===r.data.existing.id);else throw n}t&&(n[r.path]=t.id,bC(e))}else if(r.kind===`set-grant`){let e=r.id??n[r.path];e&&bC(await Q.setGrant(e,B(oe),r.mode,``,t))}else if(r.kind===`revoke`){let e=r.id??n[r.path];e&&bC(await Q.revokeGrant(e,B(oe),``,t))}}async function Re(){if(!B(x).trim()||B(v))return;let e=B(d);if(!(!B(ie)&&!e)){N(v,!0),N(g,``);try{if(B(ie)||!e){let e=await Q.createTask({name:B(y).trim(),description:B(b).trim(),prompt:B(x).trim(),model:B(S)??``,schedule:St(B(C)),recall_depth:B(w)});Be(e);try{await Le(yN([],St(B(T))),e.id)}catch{}Fs(`/t/`+e.id)}else{let t=CN(e,{name:B(y),description:B(b),prompt:B(x),model:B(S),schedule:St(B(C)),recall_depth:B(w)}),n=Object.keys(t).length?await Q.updateTask(e.id,t):e;N(d,n,!0),Be(n),await Le(yN(Ce(),St(B(T))),e.id),N(_,!1)}}catch(e){N(g,iS(e,`save failed`),!0)}finally{N(v,!1)}}}async function ze(){if(!(B(p)||!B(d))){N(p,!0);try{Fs(`/r/`+(await Q.runTask(B(d).id)).id)}catch(e){N(g,iS(e,`run failed`),!0)}finally{N(p,!1)}}}function Be(e){Ro.update(t=>t.map(t=>t.id===e.id?e:t))}async function Ve(){let e=B(d);if(!(!e||B(m))){N(m,!0);try{N(d,await Q.updateTask(e.id,{paused:!e.paused}),!0),Be(B(d))}catch(e){N(g,iS(e,`pause failed`),!0)}finally{N(m,!1)}}}async function He(){if(B(d))try{let e=B(d).id;await Q.deleteTask(e),Ro.update(t=>t.filter(t=>t.id!==e)),Is(`tasks`)}catch(e){N(g,iS(e),!0)}}async function Ue(e){let t=B(d);if(t)try{await Q.deleteTaskPermission(t.id,e),N(f,await Q.taskPermissions(t.id),!0)}catch(e){N(g,iS(e,`revoke failed`),!0)}}let We=e=>e?e<0?`All previous runs`:`Last ${e} runs`:`—`,Ge={running:`spinner`,needs_input:`help-circle`,completed:`check`,failed:`x`,cancelled:`slash`};var Ke=gP();Oi(`keydown`,Xn,e=>{e.key===`Escape`&&N(te,!1)});var qe=I(Ke);{let e=j(()=>B(ae)?B(y)||(B(ie)?`New task`:B(d)?.name)||`Task`:B(d)?.name||`Task`);oN(qe,{back:{label:`Tasks`,onClick:()=>Is(`tasks`)},get title(){return B(e)},get subtitle(){return B(ue)}})}var Je=R(qe,2),Ye=F(Je),Xe=F(Ye),Ze=e=>{var t=PN(),n=F(t);$(n,{name:`x`,size:13});var r=R(n);D(t),z(()=>W(r,` ${B(g)??``}`)),U(e,t)};G(Xe,e=>{B(g)&&e(Ze)});var Qe=R(Xe,2),$e=e=>{var t=mP(),n=I(t),r=F(n),i=F(r),o=e=>{var t=FN(),n=I(t);za(n);var r=R(n,2);za(r),qa(n,()=>B(y),e=>N(y,e)),qa(r,()=>B(b),e=>N(b,e)),U(e,t)},s=e=>{var t=RN(),n=I(t),r=L(n,!0),i=R(n,2),a=e=>{var t=IN(),n=L(t,!0);z(()=>W(n,B(d).description)),U(e,t)};G(i,e=>{B(d).description&&e(a)});var o=R(i,2),s=F(o),c=F(s);za(c),tt(2),D(s);var l=R(s,2);let u;var f=L(l,!0),p=R(l,2),h=e=>{var t=LN(),n=L(t);z(e=>W(n,`Next run: ${e??``}`),[()=>by(B(d).next_run_at)]),U(e,t)};G(p,e=>{B(d).next_run_at&&!B(d).paused&&e(h)}),D(o),z(()=>{W(r,B(d).name),Va(c,!B(d).paused),c.disabled=B(m),u=q(l,1,`badge svelte-y9xmno`,null,u,{paused:B(d).paused}),W(f,B(d).paused?`Paused`:`Active`)}),V(`change`,c,Ve),U(e,t)};G(i,e=>{B(ae)?e(o):B(d)&&e(s,1)}),D(r);var c=R(r,2),l=F(c),g=e=>{var t=BN(),n=I(t),r=e=>{var t=zN();z(()=>t.disabled=B(v)),V(`click`,t,Pe),U(e,t)};G(n,e=>{B(ie)||e(r)});var i=R(n,2),a=L(i,!0);z(e=>{i.disabled=e,W(a,B(v)?`Saving…`:`Save`)},[()=>!B(x).trim()||B(v)]),V(`click`,i,Re),U(e,t)},_=e=>{var t=HN(),n=I(t);$(F(n),{name:`pencil`,size:15}),D(n);var r=R(n,2),i=F(r);$(F(i),{name:`trash`,size:15}),D(i);var a=R(i,2),o=e=>{var t=VN(),n=R(F(t),2),r=R(n,2);D(t),V(`click`,n,He),V(`click`,r,()=>N(h,!1)),U(e,t)};G(a,e=>{B(h)&&e(o)}),D(r);var s=R(r,2),c=F(s);$(c,{name:`play`,size:14});var l=R(c);D(s),z(()=>{s.disabled=B(p),W(l,` ${B(p)?`Starting…`:`Run now`}`)}),V(`click`,n,Ne),V(`click`,i,()=>N(h,!B(h))),V(`click`,s,ze),U(e,t)};G(l,e=>{B(ae)?e(g):e(_,-1)}),D(c),D(n);var T=R(n,2);let re;var oe=F(T),se=e=>{var t=KN(),n=F(t),r=R(F(n),2),i=e=>{var t=UN();z(()=>t.disabled=B(Ee)),V(`click`,t,De),U(e,t)};G(r,e=>{B(d).unread>0&&e(i)}),D(n);var a=R(n,2),o=e=>{U(e,WN())};G(a,e=>{B(d).runs.length||e(o)});var s=R(a,2);K(s,21,()=>B(d).runs,e=>e.id,(e,t)=>{var n=GN();let r;var i=F(n),a=F(i);{let e=j(()=>Ge[B(t).status]||`clock`);$(a,{get name(){return B(e)},size:13})}D(i);var o=R(i,2),s=L(o,!0),c=L(R(o,2),!0);D(n),z((e,a)=>{r=q(n,1,`runrow svelte-y9xmno`,null,r,{unseen:e}),q(i,1,`statusicon ${B(t).status??``}`,`svelte-y9xmno`),W(s,a),W(c,B(t).summary||B(t).error||B(t).status)},[()=>u.includes(B(t).status)&&!B(t).seen,()=>vy(B(t).started_at)]),V(`click`,n,()=>Fs(`/r/`+B(t).id)),U(e,n)}),D(s),D(t),U(e,t)};G(oe,e=>{!B(ie)&&B(d)&&e(se)});var ce=R(oe,2),le=R(F(ce),2),ue=e=>{var t=qN();tn(t),qa(t,()=>B(x),e=>N(x,e)),U(e,t)},he=e=>{var t=JN(),n=L(t,!0);z(()=>W(n,B(d).prompt)),U(e,t)};G(le,e=>{B(ae)?e(ue):B(d)&&e(he,1)});var ge=R(le,4),ve=e=>{var t=$N(),n=F(t),r=F(n),i=F(r),o=e=>{var t=YN(),n=I(t);iM(n,{get brand(){return B(fe).type},get size(){return 14}});var r=R(n,2),i=L(r,!0),a=R(r,2);let o;z(e=>{W(i,B(fe).name),o=q(a,1,`modelsw-dot`,null,o,{warn:e})},[()=>!lT(B(fe))]),U(e,t)},s=e=>{var t=XN(),n=L(t,!0);z(()=>W(n,B(S)?B(S):`Profile default`)),U(e,t)};G(i,e=>{B(fe)?e(o):e(s,-1)}),$(R(i,2),{name:`chevron-down`,size:13}),D(r);var c=R(r,2),l=e=>{var t=QN(),n=I(t),r=R(n,2),i=F(r);let o;var s=F(i),c=F(s),l=R(F(c)),u=e=>{$(e,{name:`check`,size:12})};G(l,e=>{B(S)??e(u)}),D(c),tt(2),D(s),D(i);var d=R(i,2);K(d,1,()=>a().configs,e=>e.id,(e,t)=>{var n=ZN();let r;var i=F(n);iM(i,{get brand(){return B(t).type},get size(){return 14}});var a=R(i,2),o=F(a),s=F(o,!0),c=R(s),l=e=>{$(e,{name:`check`,size:12})};G(c,e=>{B(t).id===B(S)&&e(l)}),D(o);var u=L(R(o,2));D(a);var d=R(a,2);let f;D(n),z((e,i,a)=>{r=q(n,1,`modelsw-item`,null,r,{active:B(t).id===B(S)}),n.disabled=e,J(n,`title`,i),W(s,B(t).name),W(u,`${xx[B(t).type]??``} · ${B(t).model??``}`),f=q(d,1,`modelsw-dot`,null,f,{warn:a})},[()=>!lT(B(t)),()=>lT(B(t))?``:`Not ready — add a key or sign in via Settings`,()=>!lT(B(t))]),V(`click`,n,()=>pe(B(t).id)),U(e,n)});var f=R(d,2);D(r),z(()=>o=q(i,1,`modelsw-item`,null,o,{active:B(S)==null})),V(`click`,n,()=>N(te,!1)),V(`click`,i,()=>pe(null)),V(`click`,f,me),U(e,t)};G(c,e=>{B(te)&&e(l)}),D(n),D(t),z(()=>J(r,`aria-expanded`,B(te))),V(`click`,r,()=>N(te,!B(te))),U(e,t)},Ce=e=>{var t=eP(),n=F(t),r=e=>{var t=YN(),n=I(t);iM(n,{get brand(){return B(E).type},get size(){return 14}});var r=R(n,2),i=L(r,!0),a=R(r,2);let o;z(e=>{W(i,B(E).name),o=q(a,1,`modelsw-dot`,null,o,{warn:e})},[()=>!lT(B(E))]),U(e,t)},i=e=>{var t=XN(),n=L(t,!0);z(()=>W(n,B(de))),U(e,t)};G(n,e=>{B(E)?e(r):e(i,-1)}),D(t),U(e,t)};G(ge,e=>{B(ae)?e(ve):e(Ce,-1)});var Oe=R(ge,4),ke=e=>{var t=oP(),n=I(t),r=e=>{var t=nP();K(R(I(t),2),17,()=>B(we),e=>e.path,(e,t)=>{var n=tP(),r=F(n);$(F(r),{name:`folder`,size:14}),D(r);var i=R(r,2),a=L(i,!0),o=R(i,2),s=F(o);wC(s,{get mode(){return B(t).mode},onchange:e=>Fe(B(t),e)});var c=R(s,2);$(F(c),{name:`trash`,size:14}),D(c),D(o),D(n),z(()=>{J(i,`title`,B(t).path),W(a,B(t).name)}),V(`click`,c,()=>Fe(B(t),null)),U(e,n)}),U(e,t)};G(n,e=>{B(we).length&&e(r)});var i=R(n,2),a=e=>{var t=iP();K(R(I(t),2),17,()=>B(Te),e=>e.path,(e,t)=>{var n=rP(),r=F(n);$(F(r),{name:`folder`,size:14}),D(r);var i=R(r,2),a=L(i,!0);SC(R(i,2),{get mode(){return B(t).mode},onchange:e=>Fe(B(t),e)}),D(n),z(()=>{J(i,`title`,B(t).path),W(a,B(t).name)}),U(e,n)}),U(e,t)};G(i,e=>{B(Te).length&&e(a)});var o=R(i,2);$(F(o),{name:`folder`,size:14}),tt(),D(o);var s=R(o,2),c=e=>{var t=aP(),n=F(t);{let e=j(()=>B(ne).cwd||B(ne).home||``);xS(n,{get roots(){return B(ne)},get start(){return B(e)},onUse:Ie})}D(t),U(e,t)};G(s,e=>{B(ee)&&e(c)}),V(`click`,o,()=>N(ee,!B(ee))),U(e,t)},Ae=e=>{var t=cP(),n=I(t),r=e=>{var t=nP();K(R(I(t),2),17,()=>B(ye),e=>e.id,(e,t)=>{var n=sP(),r=F(n);$(F(r),{name:`folder`,size:14}),D(r);var i=R(r,2),a=L(i),o=L(R(i,2),!0);D(n),z(e=>{J(i,`title`,B(t).path),W(a,`${B(t).name??``}${B(t).exists===!1?` — path is missing`:``}`),W(o,e)},[()=>Se(_e(B(t)))]),U(e,n)}),U(e,t)};G(n,e=>{B(ye).length&&e(r)});var i=R(n,2),a=e=>{var t=iP();K(R(I(t),2),17,()=>B(be),e=>e.id,(e,t)=>{var n=sP(),r=F(n);$(F(r),{name:`folder`,size:14}),D(r);var i=R(r,2),a=L(i),o=L(R(i,2),!0);D(n),z(e=>{J(i,`title`,B(t).path),W(a,`${B(t).name??``}${B(t).exists===!1?` — path is missing`:``}`),W(o,e)},[()=>Se(_e(B(t)))]),U(e,n)}),U(e,t)};G(i,e=>{B(be).length&&e(a)}),U(e,t)},je=e=>{U(e,lP())};G(Oe,e=>{B(ae)?e(ke):B(xe)?e(Ae,1):e(je,-1)});var Me=R(Oe,4),Le=e=>{kN(e,{get schedule(){return B(C)},set schedule(e){N(C,e,!0)}})},Be=e=>{var t=uP(),n=L(t,!0);z(()=>W(n,B(d).schedule_desc)),U(e,t)};G(Me,e=>{B(ae)?e(Le):B(d)&&e(Be,1)});var Ke=R(Me,4),qe=e=>{NN(e,{get depth(){return B(w)},set depth(e){N(w,e,!0)}})},Je=e=>{var t=uP(),n=L(t,!0);z(e=>W(n,e),[()=>We(B(d).recall_depth)]),U(e,t)};G(Ke,e=>{B(ae)?e(qe):B(d)&&e(Je,1)});var Ye=R(Ke,2),Xe=e=>{var t=pP(),n=R(I(t),2),r=e=>{var t=Bi();K(I(t),16,()=>B(f),e=>e,(e,t)=>{var n=dP(),r=F(n),i=L(r,!0),a=R(r,2);$(F(a),{name:`x`,size:13}),D(a),D(n),z(()=>W(i,t)),V(`click`,a,()=>Ue(t)),U(e,n)}),U(e,t)},i=e=>{U(e,fP())};G(n,e=>{B(f).length?e(r):e(i,-1)}),U(e,t)};G(Ye,e=>{B(ie)||e(Xe)}),D(ce),D(T),z(()=>re=q(T,1,`tpcols svelte-y9xmno`,null,re,{single:B(ie)})),U(e,t)},et=e=>{U(e,hP())};G(Qe,e=>{B(d)||B(ie)?e($e):B(ie)||e(et,1)}),D(Ye),D(Je),U(e,Ke),k(),l()}ki([`change`,`click`]);var vP,yP=()=>window.AudioContext??window.webkitAudioContext;function bP(){try{let e=yP();if(!e)return;let t=vP||=new e;t.state===`suspended`&&t.resume();let n=t.currentTime;[880,1175].forEach((e,r)=>{let i=t.createOscillator(),a=t.createGain();i.type=`sine`,i.frequency.value=e,i.connect(a),a.connect(t.destination);let o=n+r*.16;a.gain.setValueAtTime(0,o),a.gain.linearRampToValueAtTime(.18,o+.02),a.gain.exponentialRampToValueAtTime(1e-4,o+.22),i.start(o),i.stop(o+.24)})}catch{}}var xP=H(`· `,1),SP=H(`
`),CP=H(``),wP=H(`
`),TP=H(``),EP=H(`
`),DP=H(`
`);function OP(e,t){O(t,!0);let n=()=>A(js,`$route`,a),r=()=>A(Uo,`$inquiries`,a),i=()=>A(rs,`$soundOnInput`,a),[a,o]=Zt(),s=P({}),c=new Set,l=!0,u=j(()=>n().name===`run`?`task-run:`+n().id:n().name===`chat`?n().id:null),d=j(()=>r().filter(e=>e._src!==`inquiry`||!(e.chat&&e.chat===B(u)||n().name===`task`&&e.task_id===n().id)));async function f(){let e=Kt(Po);try{let[t,n]=await Promise.all([Q.inquiries().catch(()=>[]),Q.hitlPending().catch(()=>[])]);if(Kt(Po)!==e)return;let r=[...t.map(e=>({...e,_src:`inquiry`,_key:`inq:`+e.id})),...n.map(e=>({...e,_src:`hitl`,_key:`hitl:`+e.id}))],a=!l&&r.some(e=>!c.has(e._key));c=new Set(r.map(e=>e._key)),l=!1,Xt(Uo,r),a&&i()&&bP()}catch{}}io(()=>{f();let e=setInterval(f,4e3);return()=>clearInterval(e)});async function p(e,t){if(!(!t||!t.trim())){try{e._src===`hitl`?await Q.answerHitl(e.id,t.trim()):await Q.answerInquiry(e.id,t.trim())}catch{}s[e._key]=``,f()}}var m=Bi(),h=I(m),g=e=>{var t=DP(),n=F(t),r=L(n);K(R(n,2),17,()=>B(d),e=>e._key,(e,t)=>{var n=EP(),r=F(n),i=F(r),a=R(i),o=e=>{var n=xP(),r=R(I(n)),i=L(r,!0);z(()=>W(i,B(t).task_title)),V(`click`,r,()=>B(t).root_id&&Fs(`/t/`+B(t).root_id)),U(e,n)};G(a,e=>{B(t)._src===`inquiry`&&B(t).task_title&&e(o)}),D(r);var c=R(r,2),l=L(c,!0),u=R(c,2),d=e=>{var n=SP(),r=L(n,!0);z(()=>W(r,B(t).detail)),U(e,n)};G(u,e=>{B(t).detail&&e(d)});var f=R(u,2),m=e=>{var n=wP();K(n,21,()=>B(t).options,Qi,(e,n)=>{var r=CP(),i=L(r,!0);z(()=>W(i,B(n))),V(`click`,r,()=>p(B(t),B(n))),U(e,r)}),D(n),U(e,n)},h=e=>{var n=TP();za(n),V(`keydown`,n,e=>e.key===`Enter`&&p(B(t),s[B(t)._key])),qa(n,()=>s[B(t)._key],e=>s[B(t)._key]=e),U(e,n)};G(f,e=>{B(t).options&&B(t).options.length?e(m):e(h,-1)}),D(n),z(()=>{W(i,`${B(t).kind===`permission`?`Permission`:`Question`} `),W(l,B(t).text)}),U(e,n)}),D(t),z(()=>W(r,`Needs your input (${B(d).length??``})`)),U(e,t)};G(h,e=>{B(d).length&&e(g)}),U(e,m),k(),o()}ki([`click`,`keydown`]);var kP=H(`

Optional Google libraries aren't installed.

Run this, then restart AG2 Assistant:

 
`),AP=H(`

Loading…

`),jP=H(`

Signed in as

`,1),MP=H(`

Google integration is bring-your-own: you create a free OAuth client in + your own Google Cloud, and credentials stay on this machine.

  1. In Google Cloud Console, create a project and enable the Gmail, Google Calendar and Google Drive APIs.
  2. OAuth consent screen: pick Internal on a Workspace account (best — no warnings, no token expiry), or External + add yourself as a test user on a personal account (re-consent every 7 days).
  3. Credentials → Create OAuth client ID → Desktop app → Download JSON on the confirmation dialog (it's only offered at creation).
  4. Paste the JSON file's contents below.

Full guide: docs/usage.md → “Google (Gmail / Calendar / Drive)”.

`,1),NP=H(`

`),PP=H(`

`,1),FP=H(` `,1);function IP(e,t){O(t,!0);let[n,r]=Zt(),i=M(null),a=M(``),o=M(!1),s=null,c=M(``);async function l(){try{N(i,await Q.googleStatus(),!0),N(c,``)}catch{}}io(l),ao(()=>{s&&clearInterval(s)});async function u(){B(a).trim()&&(await Q.googleCredentials(B(a).trim()),N(a,``),l())}async function d(){let e=await Q.googleLoginUrl();e.ok?(window.open(e.auth_url,`_blank`),N(o,!0),s=setInterval(async()=>{let e=await Q.googleStatus();e.signed_in&&(s&&clearInterval(s),s=null,N(o,!1),N(i,e,!0))},2e3)):N(c,e.error||`Could not start sign-in`,!0)}async function f(){await Q.googleLogout(),l()}let p=()=>Xt(Wo,!1);var m=FP(),h=I(m),g=R(h,2),_=F(g),v=R(_,4),y=e=>{var t=kP(),n=F(t),r=R(F(n));D(n);var a=R(n,4),o=L(a,!0),s=R(a,2);D(t),z(()=>{W(r,` Gmail, Calendar and + Drive stay unavailable ${B(i).signed_in?`(even though you're signed in) `:``}until you add them.`),W(o,B(i).install_hint)}),V(`click`,s,l),U(e,t)};G(v,e=>{B(i)&&B(i).libs_available===!1&&e(y)});var b=R(v,2),x=e=>{U(e,AP())},S=e=>{var t=jP(),n=I(t),r=R(F(n)),a=L(r,!0),o=R(r);D(n);var s=R(n,2);z(()=>{W(a,B(i).email||`your account`),W(o,`.${B(i).libs_available===!1?``:` AG2 Assistant can use Gmail, Calendar and Drive.`}`)}),V(`click`,s,f),U(e,t)},C=e=>{var t=MP(),n=R(I(t),6);tn(n),J(n,`placeholder`,`{ "installed": { "client_id": "…", "client_secret": "…", … } }`);var r=R(n,2);qa(n,()=>B(a),e=>N(a,e)),V(`click`,r,u),U(e,t)},w=e=>{var t=PP(),n=I(t),r=L(n,!0),i=R(n,2),a=e=>{var t=NP(),n=L(t,!0);z(()=>W(n,B(c))),U(e,t)};G(i,e=>{B(c)&&e(a)});var s=R(i,2);z(()=>W(r,B(o)?`Waiting for Google — complete consent in the opened tab…`:`Connect your Google account.`)),V(`click`,s,d),U(e,t)};G(b,e=>{B(i)?B(i).signed_in?e(S,1):B(i).configured?e(w,-1):e(C,2):e(x)}),D(g),V(`click`,h,p),V(`click`,_,p),U(e,m),k(),r()}ki([`click`]);var LP=H(`

`),RP=H(`

Loading…

`),zP=H(`

Signed in ✓

Close this to return to your model settings — pick the model there and save to start + using the subscription.

`,1),BP=H(``),VP=H(`

Copy the whole address from the browser's URL bar (even on the error page) — + or just the code value from it — and paste it here:

`,1),HP=H(`

Running in Docker or on a remote host, or the tab shows "localhost refused to connect"? That's expected — the redirect points at localhost:1455, which isn't published.

`,1),UP=H(`

`,1),WP=H(` `,1);function PP(e,t){O(t,!0);let[n,r]=Zt(),i=M(null),a=M(!1),o=M(``),s=M(``),c=M(!1),l=M(void 0),u=M(``),d=M(!1),f=null;async function p(){try{N(i,await Q.codexStatus(),!0)}catch(e){N(u,nS(e),!0)}}p(),ao(()=>{f&&clearInterval(f)});async function m(){N(u,``);try{let e=await Q.codexLoginUrl();N(o,e.state,!0),window.open(e.auth_url,`_blank`),N(a,!0),f=setInterval(async()=>{let e=await Q.codexStatus();e.signed_in&&(f&&clearInterval(f),f=null,N(a,!1),N(i,e,!0))},2e3)}catch(e){N(u,nS(e),!0)}}async function h(){N(c,!0),await li(),B(l)?.focus()}async function g(){if(!(!B(s).trim()||!B(o))){N(u,``),N(d,!0);try{await Q.codexSubmit(B(o),B(s).trim()),N(s,``),N(c,!1),N(a,!1),f&&=(clearInterval(f),null),await p()}catch(e){N(u,nS(e),!0)}N(d,!1)}}async function _(){N(u,``),N(d,!0);try{await Q.codexLogout(),await p()}catch(e){N(u,nS(e),!0)}N(d,!1)}let v=()=>Xt(Go,!1);var y=NP(),b=I(y),x=R(b,2),S=R(F(x),4),C=e=>{var t=EP(),n=L(t,!0);z(()=>W(n,B(u))),U(e,t)};G(S,e=>{B(u)&&e(C)});var w=R(S,2),T=e=>{U(e,DP())},ee=e=>{var t=OP(),n=I(t),r=L(R(F(n)));D(n);var a=R(n,4),o=F(a),s=R(o,2);D(a),z(()=>{W(r,`(account: ${(B(i).account_id||`unknown`)??``})`),o.disabled=B(d)}),V(`click`,o,_),V(`click`,s,v),U(e,t)},te=e=>{var t=MP(),n=I(t),r=L(n,!0),i=R(n,2),o=L(i,!0),u=R(i,2),f=e=>{var t=jP(),n=I(t),r=R(F(n),5),i=e=>{var t=kP();V(`click`,t,h),U(e,t)};G(r,e=>{B(c)||e(i)}),D(n);var a=R(n,2),o=e=>{var t=AP(),n=R(I(t),2),r=F(n);za(r),Qa(r,e=>N(l,e),()=>B(l));var i=R(r,2),a=L(i,!0);D(n),z(e=>{i.disabled=e,W(a,B(d)?`Submitting…`:`Submit`)},[()=>B(d)||!B(s).trim()]),V(`keydown`,r,e=>e.key===`Enter`&&g()),qa(r,()=>B(s),e=>N(s,e)),V(`click`,i,g),U(e,t)};G(a,e=>{B(c)&&e(o)}),U(e,t)};G(u,e=>{B(a)&&e(f)});var p=L(R(u,2));z(()=>{W(r,B(a)?`Waiting for ChatGPT — complete sign-in in the opened tab…`:`Sign in with your ChatGPT account.`),W(o,B(a)?`Reopen sign-in tab`:`Sign in with ChatGPT`)}),V(`click`,i,m),V(`click`,p,v),U(e,t)};G(w,e=>{B(i)?B(i).signed_in?e(ee,1):e(te,-1):e(T)}),D(x),V(`click`,b,v),U(e,y),k(),r()}ki([`click`,`keydown`]);var FP=H(``),IP=H(`

Pick a voice — it plays a sample and is saved for your chats (applies next voice session).

`,1);function LP(e,t){O(t,!0);let n=()=>A(qo,`$voicePickerConfig`,r),[r,i]=Zt(),a=n(),o=M(P([])),s=M(``),c=M(``),l=M(``),u=null,d={gemini:`Gemini`,openai:`OpenAI`};async function f(){try{let e=await Q.voices(a);N(o,e.voices,!0),N(s,e.current,!0),N(c,e.provider||``,!0)}catch{}}io(f);function p(){u&&=(u.pause(),URL.revokeObjectURL(u.src),null)}ao(p);function m(e,t){return new Promise((n,r)=>{p(),u=new Audio(e),u.onended=()=>{B(l)===t&&N(l,``)},u.onerror=r,u.play().then(n,r)})}async function h(e){N(s,e.name,!0),Q.selectVoice(e.name,a).then(()=>{a&&Aj()}).catch(()=>{}),N(l,e.name,!0);try{await m(`/voices/`+encodeURIComponent(e.name)+`.wav`,e.name)}catch{try{let t=await Q.previewVoice(e.name,a);await m(URL.createObjectURL(t),e.name)}catch{N(l,``)}}}let g=()=>{p(),qo.set(null),Xt(Ko,!1)};var _=IP(),v=I(_);let y;var b=R(v,2);let x;var S=F(b),C=R(S,2),w=L(C),T=R(C,4);K(T,21,()=>B(o),e=>e.name,(e,t)=>{var n=FP();let r;var i=F(n),a=L(i,!0),o=R(i,2),c=L(o,!0),u=L(R(o,2),!0);D(n),z(()=>{r=q(n,1,`vrow`,null,r,{on:B(s)===B(t).name}),W(a,B(t).name),W(c,B(t).style),W(u,B(l)===B(t).name?`▶ playing…`:B(s)===B(t).name?`✓ current`:``)}),V(`click`,n,()=>h(B(t))),U(e,n)}),D(T),D(b),z(()=>{y=q(v,1,`modal-backdrop`,null,y,{over:!!a}),x=q(b,1,`modal voicepick`,null,x,{over:!!a}),W(w,`Voice${B(c)?` — `+(d[B(c)]||B(c)):``}`)}),V(`click`,v,g),V(`click`,S,g),U(e,_),k(),i()}ki([`click`]);var RP=H(`
`);function zP(e,t){O(t,!0);let n=M(void 0);hr(()=>{B(n)&&(B(n).innerHTML=zO(t.text),HO(B(n),e=>Fs(`/t/`+e)),BO(B(n),e=>Hs(e.path)))});var r=RP();Qa(r,e=>N(n,e),()=>B(n)),U(e,r),k()}var BP=H(`

`),VP=H(``),HP=H(`
`),UP=H(`
`),WP=H(``),GP=H(`

`),KP=H(`Run`),qP=H(``),JP=H(``),YP=H(`
`),XP=H(`●`),ZP=H(``),QP=H(` `,1),$P=H(``),eF=H(``),tF=H(``),nF=H(``),rF=H(`

`),iF=H(``),aF=H(``),oF=H(``),sF=H(`
 
`),cF=H(`
 
`),lF=H(`

No preview for this file type — or download it.

`),uF=H(``),dF=H(``);function fF(e,t){O(t,!0);let n=()=>A(js,`$route`,o),r=()=>A(Jo,`$viewer`,o),i=()=>A(NC,`$threadScope`,o),a=()=>A(os,`$previewExpanded`,o),[o,s]=Zt(),c=(e,t=ue,n=ue,r=ue)=>{var i=VP(),a=F(i);$(a,{get name(){return t()},size:28});var o=R(a,2),s=L(o,!0),c=R(o,2),l=L(c,!0),u=R(c,2),f=e=>{var t=BP(),n=L(t,!0);z(()=>W(n,r())),U(e,t)};G(u,e=>{r()&&e(f)}),D(i),z(()=>{W(s,n()),W(l,B(d))}),U(e,i)},l=j(()=>n().aside?.kind===`file`?n().aside:null),u=j(()=>!B(l)&&r()?.text!=null?r():null),d=j(()=>B(l)?.path||null),f=j(()=>B(d)?B(d).split(`/`).pop():null),p=j(()=>B(l)?B(f)||`Preview`:B(u)?.title||`Preview`),m=j(()=>B(d)?FC(B(f)):`markdown`),h=j(i),g=j(()=>B(d)?Q.fileUrl(B(d),!1,B(h)):``),_=j(()=>B(d)?Q.fileUrl(B(d),!0,B(h)):``),v=j(()=>B(m)===`html`||B(m)===`pdf`||B(m)===`image`),y=j(()=>B(m)===`markdown`||B(m)===`code`||B(m)===`text`||B(m)===`html`||B(m)===`image`),b=M(null),x=j(()=>B(m)===`markdown`&&!!B(d)&&(!Rv(B(d))||zv(B(b)).edit));function S(){B(l)?Ws():Xt(Jo,null)}ao(ss);let C=M(``),w=M(``),T=M(null),ee=M(``),te=M(`preview`),ne=M(`preview`),re=M(``),ie=M(``),ae=M(!1),oe=M(!1),se=M(``),ce=M(!1),le=M(!1),de=j(()=>B(x)&&B(w)!==B(C));io(()=>Es(()=>B(de))),ao(()=>Es(null));let fe=M(P([])),E=M(!1);hr(()=>{let e=B(d),t=B(h);if(N(fe,[],!0),N(E,!1),!e)return;let n=!1;return Q.fileMentions(e,t).then(e=>{n||N(fe,e.threads,!0)}).catch(()=>{n||N(fe,[],!0)}),()=>{n=!0}});function pe(){N(E,!B(E))}function me(e){Zo(e),N(E,!1)}function he(e){let t=e.target instanceof Element?e.target:null;B(E)&&!t?.closest(`.vmentions-pop`)&&!t?.closest(`.vmentions`)&&N(E,!1)}function ge(e){e.key===`Escape`&&N(E,!1)}io(()=>(document.addEventListener(`pointerdown`,he,!0),document.addEventListener(`keydown`,ge),()=>{document.removeEventListener(`pointerdown`,he,!0),document.removeEventListener(`keydown`,ge)})),hr(()=>{let e=B(d),t=B(u),n=B(m),r=B(h),i=!1;return N(C,``),N(w,``),N(T,null),N(ee,``),N(se,``),N(ce,!1),N(oe,!1),N(le,!1),N(te,`preview`),N(ne,`preview`),N(re,``),N(ie,``),N(ae,!1),N(b,null),t?(N(C,t.text,!0),N(w,t.text,!0)):e&&n===`markdown`?Q.fileTextWithEtag(e,r).then(({text:e,etag:t,mode:n})=>{i||(N(C,e,!0),N(w,e,!0),N(T,t,!0),N(b,n,!0))}).catch(e=>{i||N(ee,nS(e),!0)}):e&&(n===`code`||n===`text`)&&Q.fileText(e,r).then(e=>{i||(N(C,e,!0),N(w,e,!0))}).catch(e=>{i||N(ee,nS(e),!0)}),()=>{i=!0}});async function _e(){if(N(ne,`raw`),B(ae))return;N(ae,!0);let e=B(d),t=B(h);if(e)try{let n=await Q.fileText(e,t);e===B(d)&&N(re,n,!0)}catch(t){e===B(d)&&N(ie,nS(t),!0)}}let ve=M(!1);async function ye(){try{B(m)===`image`?await navigator.clipboard.write([new ClipboardItem({"image/png":Ee()})]):B(m)===`html`?await navigator.clipboard.writeText(B(d)?await Q.fileText(B(d),B(h)):``):await navigator.clipboard.writeText(B(w)||``),N(ve,!0),setTimeout(()=>N(ve,!1),1400)}catch{}}async function be(e){if(B(oe))return;let t=B(d);if(!t)return;N(oe,!0),N(se,``);let n=B(w);try{let r=await Q.saveFile(t,n,e,B(h));if(t!==B(d))return;N(C,n,!0),N(T,r,!0),N(ce,!1)}catch(e){if(t!==B(d))return;Pv(e)?N(ce,!0):(N(se,Fv(e),!0),N(ce,!1))}finally{t===B(d)&&N(oe,!1)}}function xe(){!B(x)||!B(de)||B(ce)||be(B(T))}function Se(){be(null)}async function Ce(){if(B(oe))return;let e=B(d);if(e){N(oe,!0),N(se,``);try{let{text:t,etag:n}=await Q.fileTextWithEtag(e,B(h));if(e!==B(d))return;N(C,t,!0),N(w,t,!0),N(T,n,!0),N(ce,!1)}catch(t){if(e!==B(d))return;N(se,Fv(t),!0),N(ce,!1)}finally{e===B(d)&&N(oe,!1)}}}function we(e){B(x)&&(e.metaKey||e.ctrlKey)&&(e.key===`s`||e.key===`S`)&&(e.preventDefault(),xe())}function Te(e){B(de)&&(e.preventDefault(),e.returnValue=``)}async function Ee(){let e=new Image;e.src=B(g),await e.decode();let t=document.createElement(`canvas`);t.width=e.naturalWidth,t.height=e.naturalHeight;let n=t.getContext(`2d`);if(!n)throw Error(`canvas 2d context unavailable`);return n.drawImage(e,0,0),await new Promise((e,n)=>t.toBlob(t=>t?e(t):n(Error(`canvas export failed`)),`image/png`))}var De=dF();Oi(`keydown`,Xn,we),Oi(`beforeunload`,Xn,Te);var Oe=F(De);hC(Oe,{get width(){return as},onGrab:()=>os.set(!1)});var ke=R(Oe,2),Ae=F(ke),je=e=>{var t=HP(),n=F(t);let r;$(F(n),{name:`eye`,size:14}),D(n);var i=R(n,2);let a;$(F(i),{name:`pencil`,size:14}),D(i),D(t),z(()=>{r=q(n,1,`vsegbtn`,null,r,{on:B(te)===`preview`}),J(n,`aria-pressed`,B(te)===`preview`),a=q(i,1,`vsegbtn`,null,a,{on:B(te)===`edit`}),J(i,`aria-pressed`,B(te)===`edit`)}),V(`click`,n,()=>N(te,`preview`)),V(`click`,i,()=>N(te,`edit`)),U(e,t)},Me=e=>{var t=UP(),n=F(t);let r;$(F(n),{name:`eye`,size:14}),D(n);var i=R(n,2);let a;$(F(i),{name:`file-text`,size:14}),D(i),D(t),z(()=>{r=q(n,1,`vsegbtn`,null,r,{on:B(ne)===`preview`}),J(n,`aria-pressed`,B(ne)===`preview`),a=q(i,1,`vsegbtn`,null,a,{on:B(ne)===`raw`}),J(i,`aria-pressed`,B(ne)===`raw`)}),V(`click`,n,()=>N(ne,`preview`)),V(`click`,i,_e),U(e,t)};G(Ae,e=>{B(x)?e(je):B(m)===`download`&&e(Me,1)});var Ne=R(Ae,2),Pe=e=>{var t=WP(),n=L(t,!0);z(()=>{J(t,`title`,`Reveal ${B(f)} in Files`),W(n,B(p))}),V(`click`,t,()=>Xo(B(d))),U(e,t)},Fe=e=>{var t=GP(),n=L(t,!0);z(()=>{J(t,`title`,B(p)),W(n,B(p))}),U(e,t)};G(Ne,e=>{B(d)?e(Pe):e(Fe,-1)});var Ie=R(Ne,2),Le=e=>{var t=YP(),n=F(t);let r;var i=F(n);$(i,{name:`message`,size:15});var a=L(R(i,2),!0);D(n);var o=R(n,2),s=e=>{var t=JP();K(t,21,()=>B(fe),e=>e.stream_id,(e,t)=>{var n=qP(),r=F(n);{let e=j(()=>HC(B(t)));$(r,{get name(){return B(e)},size:14})}var i=R(r,2),a=L(i,!0),o=R(i,2),s=e=>{U(e,KP())};G(o,e=>{B(t).kind===`run`&&e(s)}),D(n),z(e=>W(a,e),[()=>VC(B(t))]),V(`click`,n,()=>me(B(t))),U(e,n)}),D(t),z(e=>J(t,`aria-label`,e),[()=>BC(B(fe).length)]),U(e,t)};G(o,e=>{B(E)&&e(s)}),D(t),z((e,t)=>{r=q(n,1,`vmentions`,null,r,{on:B(E)}),J(n,`aria-expanded`,B(E)),J(n,`title`,e),J(n,`aria-label`,t),W(a,B(fe).length)},[()=>BC(B(fe).length),()=>BC(B(fe).length)]),V(`click`,n,pe),U(e,t)};G(Ie,e=>{B(d)&&B(fe).length>0&&e(Le)});var Re=R(Ie,2),ze=e=>{var t=QP(),n=I(t),r=e=>{U(e,XP())};G(n,e=>{B(de)&&e(r)});var i=R(n,2),a=e=>{var t=ZP(),n=L(t,!0);z(()=>{t.disabled=!B(de)||B(oe)||B(ce),W(n,B(oe)?`Saving…`:`Save`)}),V(`click`,t,xe),U(e,t)};G(i,e=>{B(te)===`edit`&&e(a)}),U(e,t)};G(Re,e=>{B(x)&&e(ze)});var Be=R(Re,2),Ve=e=>{var t=$P();let n;var r=F(t);{let e=j(()=>B(ve)?`check`:`copy`);$(r,{get name(){return B(e)},size:15})}D(t),z(()=>{n=q(t,1,`cp`,null,n,{copied:B(ve)}),J(t,`title`,B(ve)?`Copied`:`Copy`)}),V(`click`,t,ye),U(e,t)};G(Be,e=>{B(y)&&e(Ve)});var He=R(Be,2),Ue=F(He);{let e=j(()=>a()?`minimize-2`:`maximize-2`);$(Ue,{get name(){return B(e)},size:15})}D(He);var We=R(He,2),Ge=e=>{var t=eF();$(F(t),{name:`download`,size:15}),D(t),z(()=>J(t,`href`,B(_))),U(e,t)};G(We,e=>{B(d)&&e(Ge)});var Ke=R(We,2);D(ke);var qe=R(ke,2);let Je;var Ye=F(qe),Xe=e=>{var t=tF(),n=L(t,!0);z(()=>W(n,B(se))),U(e,t)};G(Ye,e=>{B(se)&&e(Xe)});var Ze=R(Ye,2),Qe=e=>{var t=nF(),n=R(F(t),2),r=F(n),i=R(r,2);D(n),D(t),z(()=>{r.disabled=B(oe),i.disabled=B(oe)}),V(`click`,r,Ce),V(`click`,i,Se),U(e,t)};G(Ze,e=>{B(ce)&&e(Qe)});var $e=R(Ze,2),et=e=>{var t=Bi(),n=I(t),r=e=>{c(e,()=>`file-x`,()=>`Couldn’t load this file — it may have moved or been deleted.`,()=>B(ee))},i=e=>{var t=rF(),n=L(t,!0);z(()=>W(n,B(ee))),U(e,t)};G(n,e=>{B(d)?e(r):e(i,-1)}),U(e,t)},nt=e=>{var t=iF();z(()=>{J(t,`title`,B(p)),J(t,`src`,B(g))}),U(e,t)},rt=e=>{var t=aF();z(()=>{J(t,`title`,B(p)),J(t,`src`,B(g))}),U(e,t)},it=e=>{var t=Bi(),n=I(t),r=e=>{c(e,()=>`image-off`,()=>`Couldn’t load this image — the file may have moved or been deleted.`)},i=e=>{var t=oF();z(()=>{J(t,`src`,B(g)),J(t,`alt`,B(p))}),Oi(`error`,t,()=>N(le,!0)),Ei(t),U(e,t)};G(n,e=>{B(le)?e(r):e(i,-1)}),U(e,t)},at=e=>{var t=sF(),n=L(t,!0);z(()=>W(n,B(C))),U(e,t)},ot=e=>{var t=cF(),n=L(t,!0);z(()=>W(n,B(C))),U(e,t)},st=e=>{var t=Bi(),n=I(t),r=e=>{var t=Bi(),n=I(t),r=e=>{c(e,()=>`file-x`,()=>`Couldn’t load this file as text — it may have moved or been deleted.`,()=>B(ie))},i=e=>{var t=cF(),n=L(t,!0);z(()=>W(n,B(re))),U(e,t)};G(n,e=>{B(ie)?e(r):e(i,-1)}),U(e,t)},i=e=>{var t=lF(),n=R(F(t)),r=R(n,2);tt(),D(t),z(()=>J(r,`href`,B(_))),V(`click`,n,_e),U(e,t)};G(n,e=>{B(ne)===`raw`?e(r):e(i,-1)}),U(e,t)},ct=e=>{var t=uF();tn(t),z(()=>J(t,`aria-label`,`Edit ${B(f)}`)),qa(t,()=>B(w),e=>N(w,e)),U(e,t)},lt=e=>{zP(e,{get text(){return B(w)}})};G($e,e=>{B(ee)?e(et):B(m)===`html`?e(nt,1):B(m)===`pdf`?e(rt,2):B(m)===`image`?e(it,3):B(m)===`code`?e(at,4):B(m)===`text`?e(ot,5):B(m)===`download`?e(st,6):B(x)&&B(te)===`edit`?e(ct,7):e(lt,-1)}),D(qe),D(De),z(()=>{J(He,`aria-pressed`,a()),J(He,`title`,a()?`Collapse preview`:`Expand preview`),J(He,`aria-label`,a()?`Collapse preview`:`Expand preview`),Je=q(qe,1,`vbody`,null,Je,{native:B(v),editing:B(x)&&B(te)===`edit`})}),V(`click`,He,()=>os.update(e=>!e)),V(`click`,Ke,S),U(e,De),k(),s()}ki([`click`]);var pF=Symbol(`settings`);function mF(){let e=P({s:null,google:null,drafts:{},busy:!1,err:``,load:async()=>{let t=Kt(Po);try{let n=await Q.settings();if(Kt(Po)!==t)return;e.s=n,e.drafts={}}catch(t){e.err=nS(t)}try{let n=await Q.googleStatus();Kt(Po)===t&&(e.google=n)}catch{}},run:async t=>{e.err=``,e.busy=!0;try{await t(),await e.load()}catch(t){e.err=nS(t)}e.busy=!1},close:()=>Bs(),openVoice:(e=null)=>{qo.set(e),Ko.set(!0)},openGoogle:()=>{Bs(),Wo.set(!0)},openCodex:()=>Go.set(!0),openPoweredBy:()=>Rs(`poweredby`,Kt(js).overlayValue),reRunSetup:()=>{Bs(),us.set(!0)}});return kt(pF,e),e}function hF(){return Ot(pF)}var gF=H(``),_F=H(`
Appearance
Animations

How animated content (weather panels and more) renders on this device — High drives the GPU; Basic and Off are easy on it.

Notifications
Re-run setup
Re-run setup replay the first-run welcome & onboarding
`,1);function vF(e,t){O(t,!1);let n=()=>A(ls,`$animations`,i),r=()=>A(rs,`$soundOnInput`,i),[i,a]=Zt(),o=hF(),s=[{id:`off`,label:`Off`,hint:`static content`},{id:`basic`,label:`Basic`,hint:`light animation`},{id:`high`,label:`High`,hint:`full 3D scenes`}];$a();var c=_F(),l=R(I(c),2);Qx(l,{});var u=R(l,4);K(u,5,()=>s,Qi,(e,t)=>{var r=gF();let i;var a=F(r),o=L(R(a));D(r),z(()=>{i=q(r,1,`focuspill`,null,i,{on:n()===B(t).id}),W(a,`${B(t).label??``} `),W(o,`· ${B(t).hint??``}`)}),V(`click`,r,()=>Xt(ls,B(t).id)),U(e,r)}),D(u);var d=R(u,6),f=F(d);za(f),tt(),D(d);var p=R(d,4),m=F(p),h=F(m);$(F(h),{name:`sparkles`,size:15}),tt(),D(h),tt(2),D(m);var g=R(m,2);D(p),V(`change`,f,e=>e.currentTarget.checked&&lP()),Ja(f,r,e=>Xt(rs,e)),V(`click`,g,function(...e){o.reRunSetup?.apply(this,e)}),U(e,c),k(),a()}ki([`click`,`change`]);var yF=H(`

`),bF=H(`active`),xF=H(``),SF=H(`
`),CF=H(`
`),wF=H(``),TF=H(``),EF=H(`
`),DF=H(`

The profile stops running and is hidden. Its folder stays on disk.

`),OF=H(`

Erases this profile's folder — chats, tasks, memory, and files — from disk. This cannot be undone.

`),kF=H(`
`),AF=H(`
`),jF=H(`
`);function MF(e,t){O(t,!0);let n=()=>A(No,`$profiles`,r),[r,i]=Zt(),a=j(()=>n().list),o=j(()=>n().activeId||hs()),s=M(null),c=M(!1),l=M(``),u=M(null),d=M(``),f=M(!1),p=j(()=>B(a).map(e=>e.accent));async function m({name:e,accent:t}){await Q.createProfile(e,t),N(f,!1),await y()}let h=M(P([])),g=M(!1),_=M(null),v=M(``);async function y(){try{let e=await Q.profiles(),t=e.profiles;N(s,e.active_default,!0),N(h,e.archived,!0);let n=B(_);n&&!B(h).some(e=>e.id===n.pid)&&(N(_,null),N(v,``)),Xt(No,{list:t,activeId:B(o)})}catch{}}function b(e){N(l,``);let t=e.id===B(s),n=B(a).filter(t=>t.id!==e.id),r=n.find(e=>e.id===B(s))||n[0];N(d,r?r.id:``,!0),N(u,{pid:e.id,name:e.name,isActive:e.id===B(o),isActiveDefault:t},!0)}async function x(){if(B(c)||!B(u))return;N(c,!0),N(l,``);let{pid:e,isActive:t}=B(u);try{if(t&&ox(),await Q.archiveProfile(e,B(d)||void 0),t){B(d)?(cx(B(d)),await y(),N(u,null)):location.assign(`/app/`+location.hash);return}N(u,null),await y()}catch(e){N(l,nS(e,`Could not archive profile`),!0)}finally{N(c,!1)}}async function S(e){if(!B(c)){N(c,!0),N(l,``);try{await Q.restoreProfile(e.id),await y()}catch(e){N(l,nS(e,`Could not restore profile`),!0)}N(c,!1)}}function C(e){let t=`color-mix(in srgb, ${e} 40%, transparent)`;return`--accent:${e};--accent-ring:${t};--focus-ring:0 0 0 3px ${t};`}function w(e){N(l,``),N(v,``),N(_,{pid:e.id,name:e.name},!0)}async function T(){if(!(B(c)||!B(_)||B(v)!==B(_).name)){N(c,!0),N(l,``);try{await Q.deleteProfile(B(_).pid),N(_,null),N(v,``),await y()}catch(e){N(l,nS(e,`Could not delete profile`),!0)}N(c,!1)}}function ee(e){cx(e.id)}function te(e){t.onSelect?.(e)}y();var ne=jF(),re=F(ne),ie=e=>{var t=yF(),n=L(t,!0);z(()=>W(n,B(l))),U(e,t)};G(re,e=>{B(l)&&!B(u)&&e(ie)});var ae=R(re,2);K(ae,17,()=>B(a),e=>e.id,(e,t)=>{let n=j(()=>B(t).id===B(o));var r=SF();let i;var s=F(r),c=R(s,2),l=F(c),u=F(l),d=R(u),f=e=>{U(e,bF())};G(d,e=>{B(n)&&e(f)}),D(l);var p=R(l,2),m=L(p,!0);D(c);var h=R(c,2),g=F(h),_=R(g,2),v=e=>{var n=xF();V(`click`,n,e=>{e.stopPropagation(),b(B(t))}),U(e,n)};G(_,e=>{B(a).length>1&&e(v)}),D(h),D(r),z(()=>{i=q(r,1,`prow svelte-1rlzuji`,null,i,{active:B(n),clickable:!B(n)}),J(r,`aria-disabled`,B(n)),J(r,`tabindex`,B(n)?-1:0),J(r,`title`,B(n)?void 0:`Switch to ${B(t).name}`),xa(s,`--dot:${B(t).accent??``}`),W(u,`${B(t).name??``} `),J(p,`title`,B(t).workspace||``),W(m,B(t).workspace||`—`)}),V(`click`,r,function(...e){(B(n)?void 0:()=>ee(B(t)))?.apply(this,e)}),V(`keydown`,r,function(...e){(B(n)?void 0:e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),ee(B(t)))})?.apply(this,e)}),V(`click`,g,e=>{e.stopPropagation(),te(B(t))}),U(e,r)});var oe=R(ae,2),se=e=>{var t=CF(),n=F(t);wS(n,{get claimed(){return B(p)},submitLabel:`Create profile`,busyLabel:`Creating…`,onSubmit:m});var r=R(n,2);D(t),V(`click`,r,()=>N(f,!1)),U(e,t)},ce=e=>{var t=wF();$(F(t),{name:`plus`,size:14}),tt(),D(t),V(`click`,t,()=>{N(l,``),N(f,!0)}),U(e,t)};G(oe,e=>{B(f)?e(se):e(ce,-1)});var le=R(oe,2),ue=e=>{let t=j(()=>B(u));var n=DF(),r=F(n),i=F(r);$(i,{name:`archive`,size:15});var o=R(i);D(r);var s=R(r,4),f=e=>{var n=EF(),r=R(F(n),2);K(r,21,()=>B(a).filter(e=>e.id!==B(t).pid),e=>e.id,(e,t)=>{var n=TF(),r=L(n,!0),i={};z(()=>{W(r,B(t).name),i!==(i=B(t).id)&&(n.value=(n.__value=i)??``)}),U(e,n)}),D(r),Ea(r),D(n),Da(r,()=>B(d),e=>N(d,e)),U(e,n)};G(s,e=>{B(u).isActiveDefault&&e(f)});var p=R(s,2),m=e=>{var t=yF(),n=L(t,!0);z(()=>W(n,B(l))),U(e,t)};G(p,e=>{B(l)&&e(m)});var h=R(p,2),g=F(h),_=R(g,2),v=L(_,!0);D(h),D(n),z(()=>{W(o,` Archive “${B(u).name??``}”?`),g.disabled=B(c),_.disabled=B(c),W(v,B(c)?`Archiving…`:`Archive`)}),V(`click`,g,()=>N(u,null)),V(`click`,_,x),U(e,n)};G(le,e=>{B(u)&&e(ue)});var de=R(le,2),fe=e=>{var t=AF(),n=F(t),r=F(n);{let e=j(()=>B(g)?`chevron-down`:`chevron-right`);$(r,{get name(){return B(e)},size:14})}var i=R(r);D(n);var a=R(n,2),o=e=>{var t=Bi();K(I(t),17,()=>B(h),e=>e.id,(e,t)=>{var n=kF(),r=F(n),i=F(r),a=R(i,2),o=L(F(a),!0);D(a);var s=R(a,2),u=F(s),d=R(u,2);D(s),D(r);var f=R(r,2),p=e=>{var t=OF(),n=F(t),r=F(n);$(r,{name:`trash`,size:15});var i=R(r);D(n);var a=R(n,4),o=F(a),s=L(R(F(o)),!0);tt(),D(o);var u=R(o,2);za(u),D(a);var d=R(a,2),f=e=>{var t=yF(),n=L(t,!0);z(()=>W(n,B(l))),U(e,t)};G(d,e=>{B(l)&&e(f)});var p=R(d,2),m=F(p),h=R(m,2),g=L(h,!0);D(p),D(t),z(()=>{W(i,` Delete “${B(_).name??``}” permanently?`),W(s,B(_).name),J(u,`placeholder`,B(_).name),m.disabled=B(c),h.disabled=B(c)||B(v)!==B(_).name,W(g,B(c)?`Deleting…`:`Delete permanently`)}),qa(u,()=>B(v),e=>N(v,e)),V(`click`,m,()=>{N(_,null),N(v,``)}),V(`click`,h,T),U(e,t)};G(f,e=>{B(_)&&B(_).pid===B(t).id&&e(p)}),D(n),z(e=>{xa(n,e),xa(i,`--dot:${B(t).accent??``}`),W(o,B(t).name),u.disabled=B(c),d.disabled=B(c)},[()=>C(B(t).accent)]),V(`click`,u,()=>S(B(t))),V(`click`,d,()=>w(B(t))),U(e,n)}),U(e,t)};G(a,e=>{B(g)&&e(o)}),D(t),z(()=>{J(n,`aria-expanded`,B(g)),W(i,` Archived (${B(h).length??``})`)}),V(`click`,n,()=>N(g,!B(g))),U(e,t)};G(de,e=>{B(h).length>0&&e(fe)}),D(ne),U(e,ne),k(),i()}ki([`click`,`keydown`]);var NF=H(``),PF=H(`

`),FF=H(`Saved ✓`),IF=H(``),LF=H(`
Colour
`,1),RF=H(`

No profile selected.

`);function zF(e,t){O(t,!0);let n=()=>A(No,`$profiles`,i),[i,a]=Zt(),o=j(()=>n().list||[]),s=j(()=>n().activeId||hs()),c=j(()=>B(o).find(e=>e.id===B(s))||null),l=j(()=>B(o).filter(e=>e.id!==B(s)).map(e=>e.accent)),u=M(``),d=M(``),f=M(``),p=M(``),m=M(!1),_=M(!1),v=M(``),y=M(null);hr(()=>{B(c)&&B(c).id!==B(y)&&(N(y,B(c).id,!0),N(u,B(c).name,!0),N(d,B(c).accent,!0),N(p,B(c).name,!0),N(f,B(c).accent,!0),N(v,``))});let b=j(()=>!r.some(e=>e.hex===B(d))),x=j(()=>!!B(c)&&(B(u).trim()!==B(p)||B(d)!==B(f)));function S(e){Xt(No,{...n(),list:(n().list||[]).map(t=>t.id===B(s)?{...t,accent:e}:t)})}function C(e){N(d,e,!0),h(e),S(e)}function w(e){let t=(e.currentTarget.value||``).toLowerCase();/^#[0-9a-f]{6}$/.test(t)&&C(t)}function T(){B(f)&&(g()!==B(f)&&h(B(f)),(n().list||[]).some(e=>e.id===B(s)&&e.accent!==B(f))&&S(B(f)))}function ee(){N(u,B(p),!0),T(),N(d,B(f),!0),N(v,``)}ao(()=>{B(d)!==B(f)&&T()});async function te(){if(B(m)||!B(c))return;let e=B(c),t={};if(B(u).trim()&&B(u).trim()!==B(p)&&(t.name=B(u).trim()),B(d)&&B(d)!==B(f)&&(t.accent=B(d)),Object.keys(t).length){N(m,!0),N(v,``);try{await Q.updateProfile(e.id,t);let r=t.name;r&&(Xt(No,{...n(),list:(n().list||[]).map(t=>t.id===e.id?{...t,name:r}:t)}),N(p,r,!0),N(u,r,!0)),t.accent&&(e.id===B(s)&&B(d)!==g()&&h(B(d)),N(f,B(d),!0)),N(_,!0),setTimeout(()=>N(_,!1),1500)}catch(e){N(v,nS(e,`Could not save profile`),!0)}N(m,!1)}}var ne=Bi(),re=I(ne),ie=e=>{var t=LF(),n=I(t),i=F(n),a=L(i,!0),o=R(i,2),s=F(o),p=L(s,!0),h=R(s,2),g=L(h,!0);D(o),D(n);var y=R(n,2),S=R(F(y),2);za(S),D(y);var T=R(y,2),ne=R(F(T),2),re=F(ne);K(re,17,()=>r.filter(e=>!B(l).includes(e.hex)||e.hex===B(f)),e=>e.id,(e,t)=>{var n=NF();let r;var i=F(n),a=e=>{$(e,{name:`check`,size:12})};G(i,e=>{B(d)===B(t).hex&&e(a)}),D(n),z(()=>{r=q(n,1,`pswatch svelte-tzms08`,null,r,{on:B(d)===B(t).hex}),xa(n,`--dot:${B(t).hex??``}`),J(n,`title`,B(t).label),J(n,`aria-label`,B(t).label)}),V(`click`,n,()=>C(B(t).hex)),U(e,n)});var ie=R(re,2);let ae;var oe=F(ie);za(oe),D(ie),D(ne);var se=R(ne,2),ce=F(se,!0),le=R(ce),ue=e=>{U(e,zi(`· custom`))};G(le,e=>{B(b)&&e(ue)}),D(se),D(T);var de=R(T,2),fe=e=>{var t=PF(),n=L(t,!0);z(()=>W(n,B(v))),U(e,t)};G(de,e=>{B(v)&&e(fe)});var E=R(de,2),pe=F(E),me=e=>{U(e,FF())};G(pe,e=>{B(_)&&e(me)});var he=R(pe,2),ge=e=>{var t=IF();z(()=>t.disabled=B(m)),V(`click`,t,ee),U(e,t)};G(he,e=>{B(x)&&e(ge)});var _e=R(he,2),ve=L(_e,!0);D(E),z(e=>{xa(n,`--dot:${B(d)??``}`),W(a,e),W(p,B(u)||`Untitled profile`),J(h,`title`,B(c).workspace||``),W(g,B(c).workspace||`—`),ae=q(ie,1,`pswatch pcustom rainbow svelte-tzms08`,null,ae,{on:B(b)}),Ba(oe,B(d)),W(ce,B(d)),_e.disabled=B(m)||!B(x),W(ve,B(m)?`Saving…`:`Save changes`)},[()=>(B(u)||`?`).trim().charAt(0).toUpperCase()]),qa(S,()=>B(u),e=>N(u,e)),V(`input`,oe,w),V(`click`,_e,te),U(e,t)},ae=e=>{U(e,RF())};G(re,e=>{B(c)?e(ie):e(ae,-1)}),U(e,ne),k(),a()}ki([`click`,`input`]);var BF=H(``),VF=H(`

What this profile is for — shapes how the assistant helps.

`,1);function HF(e,t){O(t,!1);let n=hF(),r=e=>{let t=n.s?.focuses||[],r=t.includes(e)?t.filter(t=>t!==e):[...t,e];n.run(()=>Q.setFocuses(r))};$a();var i=VF(),a=I(i);K(a,5,()=>_x,Qi,(e,t)=>{var i=BF();let a;var o=F(i);$(o,{get name(){return B(t).icon},size:13});var s=R(o);D(i),z(e=>{a=q(i,1,`focuspill`,null,a,{on:e}),i.disabled=n.busy,W(s,` ${B(t).label??``}`)},[()=>(n.s?.focuses||[]).includes(B(t).id)]),V(`click`,i,()=>r(B(t).id)),U(e,i)}),D(a),tt(2),U(e,i),k()}ki([`click`]);function UF(e,t){O(t,!0);let n=()=>A(aT,`$llmConfigs`,r),[r,i]=Zt(),a=hF();io(()=>{oT().catch(()=>{})});let o=j(()=>n().configs),s=j(()=>n().envOverride),c=j(()=>a.s?.llm_active??null),l=j(()=>!a.s?.llm_override),u=()=>zs(`settings`,yo.MODELS);oM(e,{get configs(){return B(o)},get activeId(){return B(c)},get envOverride(){return B(s)},get busy(){return a.busy},down:!0,get inherited(){return B(l)},title:`Text model for this profile — takes effect next message`,brandFor:e=>e.type,labelFor:e=>`${yx[e.type]} · ${e.model}`,get usable(){return sT},defaultEntry:{label:`Use install default`,sub:`Follow the install-wide Active model`},emptyLabel:`No models configured`,onEmpty:u,onChoose:e=>a.run(()=>Q.setLlmOverride(e.id)),onDefault:()=>a.run(()=>Q.setLlmOverride(``)),onManage:u,manageLabel:`Manage models…`}),k(),i()}function WF(e,t){O(t,!0);let n=()=>A(kj,`$liveConfigs`,r),[r,i]=Zt(),a=hF();io(()=>{Aj().catch(()=>{})});let o=j(()=>n().configs),s=j(()=>a.s?.live_active??null),c=j(()=>!a.s?.live_override),l=()=>zs(`settings`,yo.MODELS);oM(e,{get configs(){return B(o)},get activeId(){return B(s)},get busy(){return a.busy},down:!0,get inherited(){return B(c)},title:`Voice model for this profile — takes effect next voice session`,placeholder:`Choose a voice model`,brandFor:e=>e.provider,labelFor:e=>`${wx[e.provider]} · ${e.model}${e.voice?` · ${e.voice}`:``}`,get usable(){return jj},defaultEntry:{label:`Use install default`,sub:`Follow the install-wide Active voice`},emptyLabel:`Configure a voice model →`,onEmpty:l,onChoose:e=>a.run(()=>Q.setLiveOverride(e.id)),onDefault:()=>a.run(()=>Q.setLiveOverride(``)),onManage:l,manageLabel:`Manage voice models…`}),k(),i()}var GF=H(`
Text model
Drives chat replies for this profile.
Voice model
Used when you talk to this profile out loud.
`);function KF(e){var t=GF(),n=F(t);UF(R(F(n),4),{}),D(n);var r=R(n,2);WF(R(F(r),4),{}),D(r),D(t),U(e,t)}var qF=H(`

`),JF=H(`

This profile has no folders yet — add one to give it access.

`),YF=H(`· path not found`,1),XF=H(`
`),ZF=H(``),QF=H(`
`,1),$F=H(`

Folders this profile may reach outside its default workspace

`,1);function eI(e,t){O(t,!0);let n=()=>A(No,`$profiles`,i),r=()=>A(gC,`$foldersStore`,i),[i,a]=Zt(),o=hF(),s=M(!1),c=M(``),l=M(!1),u=j(()=>n().activeId||hs()||``),d=(e,t)=>(e.grants||[]).find(e=>e.profile===t&&!e.chat_id&&!e.task_id),f=j(()=>r().folders.filter(e=>d(e,B(u))));io(()=>{r().loaded||_C()});async function p(e){N(c,``),N(s,!0);try{vC(await e())}catch(e){N(c,nS(e),!0)}N(s,!1)}function m(e,t){d(e,B(u))?.mode!==t&&p(()=>Q.setGrant(e.id,B(u),t))}async function h(e){N(c,``),N(s,!0);try{let t;try{let n=await Q.createFolder(e);vC(n),t=n.folder}catch(e){let n=e instanceof ug&&e.status===409?G_.safeParse(e.body):null;if(n?.success)t=n.data.existing;else throw e}t&&!d(t,B(u))&&vC(await Q.setGrant(t.id,B(u),`read`)),N(l,!1)}catch(e){N(c,nS(e),!0)}N(s,!1)}let g=e=>p(()=>Q.revokeGrant(e.id,B(u)));var _=$F(),v=R(I(_),2),y=e=>{var t=qF(),n=L(t,!0);z(()=>W(n,B(c))),U(e,t)};G(v,e=>{B(c)&&e(y)});var b=R(v,2),x=e=>{U(e,JF())};G(b,e=>{B(f).length||e(x)});var S=R(b,2);K(S,17,()=>B(f),e=>e.id,(e,t)=>{let n=j(()=>d(B(t),B(u)));var r=XF(),i=F(r);$(F(i),{name:`folder`,size:14}),D(i);var a=R(i,2),o=F(a),c=L(o,!0),l=R(o,2),f=F(l,!0),p=R(f),h=e=>{var t=YF();tt(),U(e,t)};G(p,e=>{B(t).exists||e(h)}),D(l),D(a);var _=R(a,2),v=F(_);{let e=j(()=>B(n)?.mode);SC(v,{get mode(){return B(e)},get disabled(){return B(s)},onchange:e=>m(B(t),e)})}var y=R(v,2);$(F(y),{name:`trash`,size:14}),D(y),D(_),D(r),z(()=>{W(c,B(t).name),J(l,`title`,B(t).path),W(f,B(t).path),y.disabled=B(s)}),V(`click`,y,()=>g(B(t))),U(e,r)});var C=R(S,2),w=e=>{var t=ZF();V(`click`,t,()=>N(l,!0)),U(e,t)},T=e=>{var t=QF(),n=I(t);{let e=j(()=>o.s?.fs),t=j(()=>o.s?.fs?.cwd||``);yS(n,{get roots(){return B(e)},get start(){return B(t)},get busy(){return B(s)},onUse:h})}V(`click`,L(R(n,2)),()=>N(l,!1)),U(e,t)};G(C,e=>{B(l)?e(T,-1):e(w)}),U(e,_),k(),a()}ki([`click`]);var tI=H(``),nI=H(`

`),rI=H(` `),iI=H(`
`),aI=H(`
`,1),oI=H(`
`),sI=H(`
`),cI=H(``),lI=H(`
`),uI=H(`
`);function dI(e,t){O(t,!0);let n=M(!1),r=M(`registry`),i=M(!1),a=M(``),o=M(``),s=M(P([])),c=M(``),l=M(null),u=M(P([])),d=M(P(new Set)),f=()=>{N(s,[],!0),N(u,[],!0),N(d,new Set,!0),N(a,``)},p=e=>{N(r,e,!0),f()},m=()=>{N(n,!1),N(r,`registry`),N(o,``),N(c,``),N(l,null),f()};async function h(e){N(a,``),N(i,!0);try{return await e()}catch(e){return N(a,nS(e),!0),null}finally{N(i,!1)}}let g=()=>h(async()=>{N(s,(await t.installer.search(B(o))).results||[],!0)}),_=e=>h(async()=>{await t.installer.install({install_id:e.install_id}),t.onInstalled?.()}),v=()=>h(async()=>{let e=null;B(r)===`git`?e=await t.installer.discover(B(c)):B(l)&&(e=await t.installer.discoverUpload(B(l))),e&&(N(u,e.skills||[],!0),N(d,new Set(B(u).map(e=>e.name)),!0))}),y=e=>{let t=new Set(B(d));t.has(e)?t.delete(e):t.add(e),N(d,t,!0)},b=()=>h(async()=>{let e=[...B(d)];if(B(r)===`git`)await t.installer.install({git_url:B(c),names:e});else if(B(l))await t.installer.installUpload(B(l),e);else return;f(),N(c,``),N(l,null),t.onInstalled?.()}),x=e=>{N(l,e.currentTarget.files?.[0]||null,!0),N(u,[],!0),N(d,new Set,!0)};var S=Bi(),C=I(S),w=e=>{var t=tI();$(F(t),{name:`plus`,size:14}),tt(),D(t),V(`click`,t,()=>N(n,!0)),U(e,t)},T=e=>{var t=uI(),n=F(t),f=F(n),h=F(f);let S;var C=R(h,2);let w;var T=R(C,2);let ee;D(f);var te=R(f,2);D(n);var ne=R(n,2),re=e=>{var t=nI(),n=L(t,!0);z(()=>W(n,B(a))),U(e,t)};G(ne,e=>{B(a)&&e(re)});var ie=R(ne,2),ae=e=>{var t=aI(),n=I(t),r=F(n);za(r);var a=R(r,2);D(n),K(R(n,2),17,()=>B(s),e=>e.install_id,(e,t)=>{var n=iI(),r=F(n),a=F(r),o=F(a),s=R(o),c=e=>{var n=rI(),r=L(n);z(e=>W(r,`${e??``} installs`),[()=>B(t).installs.toLocaleString()]),U(e,n)};G(s,e=>{B(t).installs&&e(c)}),D(a);var l=L(R(a,2),!0);D(r);var u=R(r,2);D(n),z(()=>{W(o,`${B(t).name??``} `),W(l,B(t).description),u.disabled=B(i)}),V(`click`,u,()=>_(B(t))),U(e,n)}),z(e=>{r.disabled=B(i),a.disabled=e},[()=>B(i)||!B(o).trim()]),Oi(`submit`,n,e=>{e.preventDefault(),g()}),qa(r,()=>B(o),e=>N(o,e)),U(e,t)},oe=e=>{var t=oI(),n=F(t);za(n);var r=R(n,2);D(t),z(e=>{n.disabled=B(i),r.disabled=e},[()=>B(i)||!B(c).trim()]),Oi(`submit`,t,e=>{e.preventDefault(),v()}),qa(n,()=>B(c),e=>N(c,e)),U(e,t)},se=e=>{var t=sI(),n=F(t);let r;var a=F(n),o=L(R(a,2),!0);tt(2),D(n);var s=R(n,2);D(t),z(()=>{r=q(n,1,`skifile svelte-1l9ety1`,null,r,{nofile:!B(l),disabled:B(i)}),a.disabled=B(i),W(o,B(l)?B(l).name:`Choose a .md file or zipped skill folder…`),s.disabled=B(i)||!B(l)}),V(`change`,a,x),V(`click`,s,v),U(e,t)};G(ie,e=>{B(r)===`registry`?e(ae):B(r)===`git`?e(oe,1):e(se,-1)});var ce=R(ie,2),le=e=>{var t=lI(),n=F(t);K(n,17,()=>B(u),e=>e.name,(e,t)=>{var n=cI(),r=F(n);za(r);var a=R(r,2),o=L(a,!0),s=L(R(a,2),!0);D(n),z(e=>{Va(r,e),r.disabled=B(i),W(o,B(t).name),W(s,B(t).description)},[()=>B(d).has(B(t).name)]),V(`change`,r,()=>y(B(t).name)),U(e,n)});var r=R(n,2),a=L(r);D(t),z(()=>{r.disabled=B(i)||B(d).size===0,W(a,`Install ${B(d).size??``} skill${B(d).size===1?``:`s`}`)}),V(`click`,r,b),U(e,t)};G(ce,e=>{B(r)!==`registry`&&B(u).length>0&&e(le)}),D(t),z(()=>{S=q(h,1,`skitab svelte-1l9ety1`,null,S,{on:B(r)===`registry`}),w=q(C,1,`skitab svelte-1l9ety1`,null,w,{on:B(r)===`git`}),ee=q(T,1,`skitab svelte-1l9ety1`,null,ee,{on:B(r)===`upload`}),te.disabled=B(i)}),V(`click`,h,()=>p(`registry`)),V(`click`,C,()=>p(`git`)),V(`click`,T,()=>p(`upload`)),V(`click`,te,m),U(e,t)};G(C,e=>{B(n)?e(T,-1):e(w)}),U(e,S),k()}ki([`click`,`change`]);var fI=(e,t=ue)=>{var n=pI(),r=F(n),i=L(r,!0),a=R(r,2),o=L(a,!0);D(n),z(()=>{J(r,`id`,`psk-${t().name??``}`),W(i,t().name),J(a,`id`,`pskd-${t().name??``}`),W(o,t().description)}),U(e,n)},pI=H(`

`),mI=H(`
`),hI=H(`
off app-wide
`),gI=H(` `,1),_I=H(``),vI=H(` `,1),yI=H(`
`),bI=H(`

`),xI=H(`

Loading…

`),SI=H(`

No skills installed in this profile yet.

`),CI=H(`
Global & bundled

Shared skills inherited from the app. Turn one off to drop it from just this profile.

`,1),wI=H(`
This profile

Skills installed directly into this profile. Turn one off or delete it — only this profile is affected.

`,1),TI=H(`

Skills this profile can use. Turn an inherited skill off for just this profile, or disable one it owns — other profiles are unaffected.

`,1);function EI(e,t){O(t,!0);let n=()=>A(Po,`$profileEpoch`,r),[r,i]=Zt(),a=(e,t=ue)=>{let n=j(()=>B(l)===t().name),r=j(()=>!B(n)&&B(d)!==t().name&&t().enabled),i=j(()=>t().origin===`profile`?t().available:!t().suppressed);var a=yI();let o;var s=F(a),c=e=>{var a=mI();let o;var s=F(a);fI(s,t);var c=R(s,2),l=F(c);let u;D(c),D(a),z(()=>{o=q(a,1,`sktop`,null,o,{clickable:B(r)}),J(a,`aria-checked`,B(i)),J(a,`aria-disabled`,!B(r)),J(a,`tabindex`,B(r)?0:-1),J(a,`aria-labelledby`,`psk-${t().name??``}`),J(a,`aria-describedby`,`pskd-${t().name??``}`),J(a,`title`,B(r)?B(i)?`Click to turn off for this profile`:`Click to turn on for this profile`:``),u=q(l,1,`setswitch`,null,u,{on:B(i),busy:B(n)})}),V(`click`,a,()=>{B(r)&&_(t())}),V(`keydown`,a,e=>{(e.key===`Enter`||e.key===` `)&&B(r)&&(e.preventDefault(),_(t()))}),U(e,a)},u=e=>{var n=hI();fI(F(n),t),tt(2),D(n),U(e,n)};G(s,e=>{t().enabled?e(c):e(u,-1)});var f=R(s,2),p=F(f),m=e=>{var r=gI(),i=I(r),a=L(i),o=R(i,2),s=R(o,2);z(()=>{W(a,`Delete ${t().name??``}?`),o.disabled=B(n),s.disabled=B(n)}),V(`click`,o,()=>g(t())),V(`click`,s,()=>N(d,``)),U(e,r)},h=e=>{var r=vI(),i=I(r);let a;var o=R(i),s=R(o),c=e=>{var r=_I();z(()=>r.disabled=B(n)),V(`click`,r,()=>N(d,t().name,!0)),U(e,r)};G(s,e=>{t().origin===`profile`&&e(c)}),z(()=>{a=q(i,1,`skdot`,null,a,{third:t().origin!==`bundled`}),W(o,` ${t().origin===`bundled`?`First-party · ships with the app`:t().origin===`profile`?`This profile · installed here`:`Installed · global`} `)}),U(e,r)};G(p,e=>{B(d)===t().name?e(m):e(h,-1)}),D(f),D(a),z(()=>o=q(a,1,`skcard`,null,o,{off:!t().available})),U(e,a)},o={search:Q.searchSkills,install:Q.installProfileSkill,discover:Q.discoverProfileSkills,discoverUpload:Q.discoverProfileSkillsUpload,installUpload:Q.installProfileSkillUpload},s=M(P([])),c=M(!0),l=M(``),u=M(``),d=M(``),f=async()=>{N(c,!0),N(u,``);try{N(s,(await Q.profileSkills()).skills,!0)}catch(e){N(u,nS(e),!0)}N(c,!1)};hr(()=>{n(),f()});async function p(e,t){N(u,``),N(l,e,!0);try{N(s,(await t()).skills,!0)}catch(e){N(u,nS(e),!0)}N(l,``)}let m=e=>p(e.name,()=>Q.suppressSkill(e.name,!e.suppressed)),h=e=>p(e.name,()=>Q.setProfileSkillState(e.name,!e.available)),g=e=>p(e.name,()=>Q.deleteProfileSkill(e.name)).then(()=>N(d,``)),_=e=>e.origin===`profile`?h(e):m(e),v=j(()=>B(s).filter(e=>e.origin===`profile`)),y=j(()=>B(s).filter(e=>e.origin!==`profile`));var b=TI(),x=R(I(b),2),S=e=>{var t=bI(),n=L(t,!0);z(()=>W(n,B(u))),U(e,t)};G(x,e=>{B(u)&&e(S)});var C=R(x,2),w=e=>{U(e,xI())},T=e=>{var t=wI(),n=I(t),r=R(F(n),4);dI(F(r),{get installer(){return o},onInstalled:f}),D(r);var i=R(r,2),s=F(i),c=e=>{U(e,SI())},l=e=>{var t=Bi();K(I(t),17,()=>B(v),e=>e.name,(e,t)=>{a(e,()=>B(t))}),U(e,t)};G(s,e=>{B(v).length===0?e(c):e(l,-1)}),D(i),D(n);var u=R(n,2),d=e=>{var t=CI(),n=R(I(t),4);K(n,21,()=>B(y),e=>e.name,(e,t)=>{a(e,()=>B(t))}),D(n),U(e,t)};G(u,e=>{B(y).length>0&&e(d)}),U(e,t)};G(C,e=>{B(c)?e(w):e(T,-1)}),U(e,b),k(),i()}ki([`click`,`keydown`]);var DI=H(`

`),OI=H(`

Loading…

`),kI=H(`
`,1),AI=H(`
No memories yet

The assistant will gradually learn preferences and context specific to this profile as you chat. You can also add notes yourself.

`),jI=H(`Saved ✓`),MI=H(`
 
`,1),NI=H(`

What this profile has learned about you.

`,1);function PI(e,t){O(t,!0);let n=()=>A(Po,`$profileEpoch`,r),[r,i]=Zt(),a=M(``),o=M(``),s=M(!0),c=M(!1),l=M(!1),u=M(!1),d=M(``),f=j(()=>!!B(a).trim());async function p(){N(s,!0),N(d,``),N(c,!1);try{N(a,await Q.getMemory().then(e=>e.text)||``,!0)}catch(e){N(d,nS(e),!0)}N(s,!1)}hr(()=>{n(),p()});function m(){N(o,B(a),!0),N(c,!0),N(d,``)}function h(){N(c,!1),N(d,``)}async function g(){N(d,``),N(l,!0);try{await Q.setMemory(B(o)),N(a,B(o),!0),N(c,!1),N(u,!0),setTimeout(()=>N(u,!1),1500)}catch(e){N(d,nS(e),!0)}N(l,!1)}async function _(){N(d,``),N(l,!0);try{await Q.setMemory(``),N(a,``),N(c,!1)}catch(e){N(d,nS(e),!0)}N(l,!1)}var v=NI(),y=R(I(v),2),b=e=>{var t=DI(),n=L(t,!0);z(()=>W(n,B(d))),U(e,t)};G(y,e=>{B(d)&&e(b)});var x=R(y,2),S=e=>{U(e,OI())},C=e=>{var t=kI(),n=I(t);tn(n);var r=R(n,2),i=F(r),a=R(i,2),s=L(a,!0);D(r),z(()=>{i.disabled=B(l),a.disabled=B(l),W(s,B(l)?`Saving…`:`Save`)}),qa(n,()=>B(o),e=>N(o,e)),V(`click`,i,h),V(`click`,a,g),U(e,t)},w=e=>{var t=AI(),n=R(F(t),4);D(t),V(`click`,n,m),U(e,t)},T=e=>{var t=MI(),n=I(t),r=L(F(n),!0);D(n);var i=R(n,2),o=F(i),s=e=>{U(e,jI())};G(o,e=>{B(u)&&e(s)});var c=R(o,2),d=R(c,2);D(i),z(()=>{W(r,B(a)),c.disabled=B(l)}),V(`click`,c,_),V(`click`,d,m),U(e,t)};G(x,e=>{B(s)?e(S):B(c)?e(C,1):B(f)?e(T,-1):e(w,2)}),U(e,v),k(),i()}ki([`click`]);var FI=H(`
`),II=H(``),LI=H(`
active
`);function RI(e,t){O(t,!0);let n=()=>A(No,`$profiles`,r),[r,i]=Zt(),a=j(()=>n().list||[]),o=j(()=>n().activeId||hs()),s=j(()=>B(a).find(e=>e.id===B(o))||null),c=[{id:`general`,label:`General`,comp:zF},{id:`focus`,label:`Focus areas`,comp:HF},{id:`model`,label:`Model`,comp:KF},{id:`folders`,label:`Folders`,comp:eI},{id:`skills`,label:`Skills`,comp:EI},{id:`memory`,label:`Memory`,comp:PI}],l=M(`general`),u=j(()=>(c.find(e=>e.id===B(l))||c[0]).comp);var d=LI(),f=F(d);$(F(f),{name:`chevron-left`,size:15}),tt(),D(f);var p=R(f,2),m=R(F(p),2),h=F(m),g=F(h);tt(),D(h);var _=R(h,2),v=e=>{var t=FI(),n=L(t,!0);z(()=>{J(t,`title`,B(s).workspace),W(n,B(s).workspace)}),U(e,t)};G(_,e=>{B(s)?.workspace&&e(v)}),D(m),D(p);var y=R(p,2);K(y,21,()=>c,Qi,(e,t)=>{var n=II();let r;var i=L(n,!0);z(()=>{r=q(n,1,`ptab svelte-1durtx6`,null,r,{on:B(l)===B(t).id}),W(i,B(t).label)}),V(`click`,n,()=>N(l,B(t).id,!0)),U(e,n)}),D(y);var b=R(y,2);la(F(b),()=>B(u),(e,t)=>{t(e,{})}),D(b),D(d),z(()=>{xa(p,`--dot:${(B(s)?.accent||`var(--accent)`)??``}`),W(g,`${(B(s)?.name||`Profile`)??``} `)}),V(`click`,f,function(...e){t.onBack?.apply(this,e)}),U(e,d),k(),i()}ki([`click`]);var zI=H(`
Profiles

Manage how the assistant behaves in different contexts.

`,1);function BI(e,t){O(t,!0);let n=()=>A(No,`$profiles`,r),[r,i]=Zt(),a=M(!1),o=j(()=>n().activeId||hs());function s(e){e.id!==B(o)&&cx(e.id),N(a,!0)}var c=Bi(),l=I(c),u=e=>{RI(e,{onBack:()=>N(a,!1)})},d=e=>{var t=zI();MF(R(I(t),4),{onSelect:s}),U(e,t)};G(l,e=>{B(a)?e(u):e(d,-1)}),U(e,c),k(),i()}var VI=Object.freeze({UNAUTHORIZED:`unauthorized`,UNREACHABLE:`unreachable`,NO_LIST_ENDPOINT:`no_list_endpoint`,NOT_PROBEABLE:`not_probeable`}),HI={ollama:{keyless:!0,browser:!1},gemini:{keyless:!1,browser:!0},openai:{keyless:!1,browser:!0},openai_responses:{keyless:!1,browser:!0},anthropic:{keyless:!1,browser:!0}};function UI(e,{hasCredential:t=!1,hasEndpoint:n=!1,hasPastedKey:r=!1}={}){let i=HI[e];return i?r&&i.browser?`browser`:i.keyless||t||n?`gateway`:``:``}function WI(e){return e===`openai_subscription`?VI.NOT_PROBEABLE:``}var GI=[`embedding`,`tts`,`whisper`,`transcribe`,`dall-e`,`moderation`,`audio`,`realtime`,`image`,`sora`],KI={openai:!0,openai_responses:!0,openai_subscription:!0};function qI(e,t){if(!KI[e])return!1;let n=String(t||``).toLowerCase();return GI.some(e=>n.includes(e))}var JI=(e,t)=>({id:e.id,label:e.label||e.id,price:Mx(e),context:Nx(e),unverified:t}),YI=(e,t)=>{let n=e.trim().toLowerCase();return!n||t.id.toLowerCase().includes(n)||(t.label||``).toLowerCase().includes(n)};function XI(e,t){let n=new Set,r=[];for(let i of t){let t=String(i||``).trim();!t||n.has(t)||qI(e,t)||(n.add(t),r.push(Ox(t)||{id:t,label:t}))}let i=kx(e),a=e=>i.some(t=>t===e)?+!e.featured:2;return r.map((e,t)=>({entry:e,rank:a(e),i:t})).sort((e,t)=>e.rank-t.rank||e.i-t.i).map(e=>e.entry)}function ZI({type:e,query:t=``,catalog:n=null}){let r=!n;return(n?XI(e,n):(()=>{let t=kx(e);return[...t.filter(e=>e.featured),...t.filter(e=>!e.featured)]})()).filter(e=>YI(t,e)).map(e=>JI(e,r))}var QI={gemini:`https://generativelanguage.googleapis.com/v1beta`,openai:`https://api.openai.com/v1`,openai_responses:`https://api.openai.com/v1`,anthropic:`https://api.anthropic.com/v1`},$I=`2023-06-01`;function eL({type:e,baseUrl:t=``,key:n=``}){let r=String(n||``).trim();if(!r||!QI[e])return null;let i=(String(t||``).trim()||QI[e]).replace(/\/+$/,``);return e===`gemini`?{url:`${i}/models?key=${encodeURIComponent(r)}`,headers:{}}:e===`anthropic`?{url:`${i}/models`,headers:{"x-api-key":r,"anthropic-version":$I,"anthropic-dangerous-direct-browser-access":`true`}}:{url:`${i}/models`,headers:{Authorization:`Bearer ${r}`}}}function tL(e,t){if(!t||typeof t!=`object`)return null;let n=t;return e===`gemini`?Array.isArray(n.models)?n.models.filter(e=>!!e&&typeof e==`object`).filter(e=>{let t=e.supportedGenerationMethods;return!Array.isArray(t)||!t.length||t.includes(`generateContent`)}).map(e=>String(e.name||``).replace(/^models\//,``)).filter(Boolean):null:Array.isArray(n.data)?n.data.filter(e=>!!e&&typeof e==`object`).map(e=>String(e.id||``)).filter(Boolean):null}function nL(e){return e===401||e===403?VI.UNAUTHORIZED:e===429||e>=500?VI.UNREACHABLE:e>=400?VI.NO_LIST_ENDPOINT:``}function rL(e,t){let n=yx[t]||`the provider`;return e===VI.UNAUTHORIZED?`${n} rejected this credential, so its model list couldn't be read. Known names are offered below.`:e===VI.UNREACHABLE?`Couldn't reach ${n} for its model list. Known names are offered below.`:e===VI.NO_LIST_ENDPOINT?`This endpoint answered but publishes no model list. Type the name it expects — known names are offered below.`:e===VI.NOT_PROBEABLE?`${n} has no model list to read. Known names are offered below.`:``}async function iL({type:e,baseUrl:t=``,key:n=``,refresh:r=!1}){let i=eL({type:e,baseUrl:t,key:n});if(!i)return{models:[],reason:VI.NOT_PROBEABLE};let a;try{a=await fetch(i.url,{headers:i.headers,cache:r?`reload`:`default`})}catch{return{models:[],reason:VI.UNREACHABLE}}let o=nL(a.status);if(o)return{models:[],reason:o};let s;try{s=await a.json()}catch{return{models:[],reason:VI.NO_LIST_ENDPOINT}}let c=tL(e,s);return c?{models:c,reason:``}:{models:[],reason:VI.NO_LIST_ENDPOINT}}var aL=Wt({secrets:[],loaded:!1});async function oL(){try{let e=await Q.secrets();aL.set({secrets:e.secrets||[],loaded:!0})}catch{aL.set({secrets:[],loaded:!0})}}async function sL(e){try{return(await Q.createSecret(e)).secret}catch(e){let t=e instanceof ug&&e.status===409?Ng.safeParse(e.body):null;if(t?.success)return t.data.existing;throw e}}function cL(e,t){let n=(t||``).trim().slice(-4);return`${(e||``).trim()||`API`} key …${n}`}function lL(e,t){return t?[...e.filter(e=>e.provider===t),...e.filter(e=>e.provider!==t)]:e}var uL={label:`Temperature`,description:`Lower is more predictable, higher is more varied.`},dL={label:`Output limit`,description:`The most tokens one answer may use.`},fL={"openai.reasoning_effort":{label:`Reasoning effort`,description:`How much the model thinks before it answers.`},"openai.temperature":uL,"openai.max_tokens":dL,"openai_responses.temperature":uL,"openai_responses.max_output_tokens":dL,"gemini.thinking_level":{label:`Thinking level`,description:`How much Gemini thinks before it answers.`},"gemini.temperature":uL,"gemini.max_output_tokens":{label:`Output limit`,description:`The most tokens one answer may use, thinking included.`},"anthropic.temperature":uL,"anthropic.max_tokens":dL,"ollama.temperature":uL,"ollama.max_tokens":dL};function pL(e,t){return fL[`${e}.${t}`]||{label:t,description:``}}var mL={xhigh:`Extra high`};function hL(e){return mL[e]||e.charAt(0).toUpperCase()+e.slice(1)}function gL(e,t){let n=t.trim();if(n)return e===`choice`?n:Number(n)}function _L(e){try{let t=JSON.parse(e);if(!(t&&typeof t==`object`&&!Array.isArray(t)))return new Set;let n=t,r=n.extra_body,i=r&&typeof r==`object`&&!Array.isArray(r)?Object.keys(r):[];return new Set([...Object.keys(n),...i])}catch{return new Set}}var vL=`Replaces the built-in DuckDuckGo search for this model.`,yL=`Replaces the built-in page fetcher for this model.`,bL=`Your local sandbox stays available — it is what can reach your own files.`,xL={"anthropic.web_search":{label:`Web search`,description:`Anthropic searches the web and cites its sources.`,note:vL},"anthropic.web_fetch":{label:`Web fetch`,description:`Anthropic fetches a page itself, with citations.`,note:yL},"anthropic.code_execution":{label:`Code execution`,description:`Runs code in Anthropic's own sandbox.`,note:bL},"openai_responses.web_search":{label:`Web search`,description:`OpenAI searches the web and cites its sources.`,note:vL},"openai_responses.code_execution":{label:`Code interpreter`,description:`Runs code in an OpenAI container.`,note:bL},"gemini.web_search":{label:`Google Search grounding`,description:`Gemini grounds its answers in Google Search.`,note:vL},"gemini.web_fetch":{label:`URL context`,description:`Gemini reads a linked page itself.`,note:yL},"gemini.code_execution":{label:`Code execution`,description:`Runs code on Google's servers.`,note:bL}};function SL(e,t){return xL[`${e}.${t}`]||{label:t,description:``}}var CL={web_search:`search`,web_fetch:`fetch`,code_execution:`code`};function wL(e){return CL[e]||e}var TL={max_uses:{label:`Use limit`,description:`The most uses per request to the model.`},allowed_domains:{label:`Only these domains`,description:`Comma-separated.`},blocked_domains:{label:`Never these domains`,description:`Comma-separated.`}};function EL(e){return TL[e]||{label:e,description:``}}function DL(e){return Array.isArray(e)?e.join(`, `):e==null?``:String(e)}function OL(e,t){if(e===`domains`){let e=t.split(`,`).map(e=>e.trim()).filter(Boolean);return e.length?e:void 0}return gL(e,t)}var kL=[`openai_responses`,`openai`,`anthropic`],AL={openai:`openai_responses`};function jL(e){return kL.includes(e)}function ML(e,t){return!!t?.trim()&&jL(e)}function NL(e){return AL[e]||e}var PL=H(`
Reading the provider's model list…
`),FL=H(` `),IL=H(`unverified`),LL=H(` `),RL=H(``),zL=H(`
`),BL=H(`
`);function VL(e,t){O(t,!0);let n=ro(t,`value`,15,``),r=ro(t,`id`,3,`lf-model`),i=ro(t,`placeholder`,3,``),a=ro(t,`catalog`,3,null),o=ro(t,`loading`,3,!1),s=ro(t,`onFirstFocus`,3,null),c=M(!1),l=M(0),u=P([]),d=!1,f=j(()=>ZI({type:t.type,query:n(),catalog:a()})),p=e=>`${r()}-opt-${e}`;hr(()=>{B(f),N(l,0)});function m(e){u[e]?.scrollIntoView({block:`nearest`})}function h(e){n(e.id),N(c,!1)}function g(e){if(e.key===`Escape`){B(c)&&(e.preventDefault(),e.stopPropagation(),N(c,!1));return}if(e.key===`ArrowDown`&&!B(c)){e.preventDefault(),N(c,!0);return}if(!(!B(c)||!B(f).length)){if(e.key===`ArrowDown`){e.preventDefault(),N(l,(B(l)+1)%B(f).length),m(B(l));return}if(e.key===`ArrowUp`){e.preventDefault(),N(l,(B(l)-1+B(f).length)%B(f).length),m(B(l));return}if(e.key===`Home`){e.preventDefault(),N(l,0),m(0);return}if(e.key===`End`){e.preventDefault(),N(l,B(f).length-1),m(B(l));return}e.key===`Enter`&&(e.preventDefault(),h(B(f)[B(l)]))}}var _=BL(),v=F(_);za(v);var y=R(v,2),b=e=>{var t=zL(),n=F(t),i=e=>{U(e,PL())};G(n,e=>{o()&&e(i)}),K(R(n,2),19,()=>B(f),e=>e.id,(e,t,n)=>{var r=RL();let i;var a=F(r),o=L(a,!0),s=R(a,2),c=e=>{var n=FL(),r=L(n,!0);z(()=>W(r,B(t).id)),U(e,n)};G(s,e=>{B(t).label!==B(t).id&&e(c)});var d=R(s,2),f=F(d),m=e=>{U(e,IL())};G(f,e=>{B(t).unverified&&e(m)});var g=R(f,2),_=e=>{var n=LL(),r=L(n,!0);z(()=>W(r,B(t).price)),U(e,n)};G(g,e=>{B(t).price&&e(_)});var v=R(g,2),y=e=>{var n=LL(),r=L(n,!0);z(()=>W(r,B(t).context)),U(e,n)};G(v,e=>{B(t).context&&e(y)}),D(d),D(r),Qa(r,(e,t)=>u[t]=e,e=>u?.[e],()=>[B(n)]),z(e=>{i=q(r,1,`llmcomborow svelte-19tyyb4`,null,i,{sel:B(n)===B(l)}),J(r,`id`,e),J(r,`aria-selected`,B(n)===B(l)),W(o,B(t).label)},[()=>p(B(n))]),V(`mousedown`,r,e=>{e.preventDefault(),h(B(t))}),Oi(`mouseenter`,r,()=>N(l,B(n),!0)),U(e,r)}),D(t),z(()=>J(t,`id`,`${r()}-list`)),U(e,t)};G(y,e=>{B(c)&&(B(f).length||o())&&e(b)}),D(_),z(e=>{J(v,`id`,r()),J(v,`placeholder`,i()),J(v,`aria-expanded`,B(c)&&B(f).length>0),J(v,`aria-controls`,`${r()}-list`),J(v,`aria-activedescendant`,e)},[()=>B(c)&&B(f).length?p(B(l)):void 0]),Oi(`focus`,v,()=>{N(c,!0),d||(d=!0,s()?.())}),V(`input`,v,()=>N(c,!0)),Oi(`blur`,v,()=>N(c,!1)),V(`keydown`,v,g),qa(v,n),U(e,_),k()}ki([`input`,`keydown`,`mousedown`]);var HL=H(``),UL=H(`
`),WL=H(`
`),GL=H(`
`),KL=H(`
`,1),qL=H(`
`),JL=H(`
`),YL=H(`
`),XL=H(`
`),ZL=H(`
`,1),QL=H(`
`),$L=H(`
`),eR=H(`
Sign in Signs requests with your ChatGPT/Codex subscription instead of an API key — unofficial, may break OpenAI's Terms of Service.
`),tR=H(`Requires the claude-agent-acp adapter on PATH (npm i -g @agentclientprotocol/claude-agent-acp) and a logged-in Claude Code CLI.`),nR=H(`Requires the codex-acp adapter on PATH (npm i -g @agentclientprotocol/codex-acp) and a logged-in Codex CLI.`),rR=H(`
Authentication
`),iR=H(`This model referenced a deleted secret.`),aR=H(`
`),oR=H(``),sR=H(``),cR=H(`Overridden by Advanced (JSON) below.`),lR=H(`
`),uR=H(` `),dR=H(` `,1),fR=H(`
`),pR=H(` `,1),mR=H(`
Provider tools
`),hR=H(``),gR=H(`
`),_R=H(`

`),vR=H(`testing…`),yR=H(` `),bR=H(``),xR=H(`
`);function SR(e,t){O(t,!0);let n=()=>A(aT,`$llmConfigs`,a),r=()=>A(Go,`$codexOpen`,a),i=()=>A(aL,`$secretsStore`,a),[a,o]=Zt(),s=hF(),c=ro(t,`activate`,3,!1),l=kL.map(e=>({id:e,label:yx[e]})),u=fi(()=>{let e=!!(t.config.options&&Object.keys(t.config.options).length);return{name:t.config.name||``,type:t.config.type||`gemini`,model:t.config.model||``,baseUrl:t.config.base_url||``,host:t.config.host||``,secretId:t.config.secret_missing?``:t.config.secret_id||``,signedIn:!!t.config.signed_in,hasOptions:e,advText:e?JSON.stringify(t.config.options,null,2):``,builtinTools:{...t.config.builtin_tools||{}},params:{...t.config.params||{}}}}),d=M(P(u.name)),f=M(P(u.type)),p=M(P(u.model)),m=M(P(u.baseUrl)),h=M(P(u.host)),g=M(P(u.secretId)),_=M(``),v=M(P(u.hasOptions)),y=M(P(u.advText)),b=M(P(u.builtinTools)),x=j(()=>n().builtinByType?.[B(f)]||[]);function S(e,t){let n={...B(b)};t?n[e]=n[e]||{}:delete n[e],N(b,n,!0)}let C=j(()=>n().builtinOptionsByType?.[B(f)]||{});function w(e,t,n,r){let i={...B(b)[e]},a=OL(n,r);a===void 0?delete i[t]:i[t]=a,N(b,{...B(b),[e]:i},!0)}let T=M(P(u.params)),ee=j(()=>n().paramsByType?.[B(f)]||[]);function te(e,t,n){let r={...B(T)},i=gL(t,n);i===void 0?delete r[e]:r[e]=i,N(T,r,!0)}let ne=j(()=>B(v)?_L(B(y)):new Set);io(oL);let re=M(!1),ie=M(``),ae=M(!1),oe=M(null),se=M(P(u.signedIn));hr(()=>{let e=r();B(f)===`openai_subscription`&&!e&&Q.codexStatus().then(e=>{N(se,!!e.signed_in)}).catch(()=>{})});let ce={openai:`OPENAI_API_KEY`,openai_responses:`OPENAI_API_KEY`,anthropic:`ANTHROPIC_API_KEY`,gemini:`GEMINI_API_KEY`},le={openai:`openai`,openai_responses:`openai`,anthropic:`anthropic`,gemini:`gemini`},ue=j(()=>lL(i().secrets,le[B(f)]||``)),de=j(()=>{if(B(f)===`openai_subscription`)return`Requests use your ChatGPT/Codex subscription — no API key is involved.`;if(B(f)===`claude_code`)return`Runs on your Claude Code CLI login (claude-agent-acp) — no API key is involved.`;if(B(f)===`codex`)return`Runs on your Codex CLI login (codex-acp) — no API key is involved.`;if(B(f)===`ollama`)return`Ollama is local — no API key is used.`;let e=ce[B(f)],t=s?.s?.keys?.[le[B(f)]||``];if(B(_).trim())return`A new Secret will be created from this key on save (rename it later in Settings → Secrets).`;if(B(g)){let t=i().secrets.find(e=>e.id===B(g));return t?`Uses the "${t.name}" secret${B(m).trim()?` (sent to the custom endpoint)`:``}. It overrides ${e}.`:`The referenced secret was deleted — falls back to the provider default or env key.`}return B(m).trim()?`Custom endpoint with no secret — a placeholder is sent (your ${e} is never sent to non-${B(f).startsWith(`openai`)?`OpenAI`:`Anthropic`} endpoints).`:t?.set?`No secret selected — uses your ${e} (${t.hint||`set`}).`:`No key available — pick or paste one above, or set ${e}.`}),fe=j(()=>B(f)===`codex`||B(f)===`claude_code`),E=e=>Dx(e)||e;function pe(e){if(e===B(f))return;E(e)!==E(B(f))&&N(p,``);let t=n().builtinByType?.[e]||[];N(b,Object.fromEntries(Object.entries(B(b)).filter(([e])=>t.includes(e))),!0);let r=(n().paramsByType?.[e]||[]).map(e=>e.id);N(T,Object.fromEntries(Object.entries(B(T)).filter(([e])=>r.includes(e))),!0),N(f,e,!0)}let me=j(()=>ML(B(f),B(m)));function he(){B(m).trim()||pe(NL(B(f))),De()}let ge=j(()=>!!B(g)||!!s?.s?.keys?.[le[B(f)]||``]?.set),_e=M(``),ve=j(()=>UI(B(f),{hasCredential:B(ge),hasEndpoint:!!B(m).trim(),hasPastedKey:!!B(_e)})),ye=j(()=>WI(B(f))),be=M(!1),xe=M(!1),Se=M(null),Ce=M(``),we=j(()=>B(be)&&!B(xe)?rL(B(Ce),B(f)):``),Te=0;async function Ee(e=!1){if(!B(ve)){N(Se,null),N(Ce,``);return}N(be,!0),N(xe,!0);let t=++Te,n;try{let t=B(ve)===`browser`?await iL({type:B(f),baseUrl:B(m).trim(),key:B(_e),refresh:e}):await Q.llmCatalog({type:B(f),base_url:B(m).trim(),host:B(h).trim(),secret_id:B(g)},e),r=t.reason||``;n={reason:r,catalog:r?null:(t.models||[]).map(e=>typeof e==`string`?e:e.id)}}catch{n={reason:`unreachable`,catalog:null}}t===Te&&(N(Ce,n.reason,!0),N(Se,n.catalog,!0),N(xe,!1))}hr(()=>{B(f),B(g),B(_e),B(ve),fi(()=>B(be))&&fi(()=>Ee())});function De(){B(be)&&Ee()}function Oe(){N(_e,B(_).trim(),!0)}let ke=j(()=>B(f)===`codex`?`codex`:B(f)===`claude_code`?`claude`:``),Ae=P({});function je(e,t=!1){Ae[e]=`loading`,Q.codingModels(e,t).then(t=>{Ae[e]={models:t.models||[],current:t.current||``,reason:t.reason||``}}).catch(()=>{Ae[e]={models:[],current:``,reason:`probe_failed`}})}hr(()=>{B(ke)&&Ae[B(ke)]===void 0&&je(B(ke))});let Me=j(()=>!!B(ke)&&Ae[B(ke)]===`loading`),Ne=j(()=>typeof Ae[B(ke)]==`object`?Ae[B(ke)]:null),Pe=j(()=>B(Ne)?.models??[]),Fe=j(()=>B(Ne)?.current?`CLI default (${B(Ne).current})`:`CLI default`),Ie={claude:`@agentclientprotocol/claude-agent-acp`,codex:`@agentclientprotocol/codex-acp`},Le=j(()=>!B(ke)||B(Me)||B(Pe).length?``:B(Ne)?.reason===`adapter_missing`?`No model list: the ACP adapter isn't installed (npm i -g ${Ie[B(ke)]}). Leave the field empty to use the CLI's own model.`:B(Ne)?.reason===`bridge`?`No model list in bridge mode — the CLI runs on the host, out of reach of this container. Leave the field empty to use the CLI's own model.`:B(Ne)?.reason?`Couldn't read the CLI's model list. Leave the field empty to use the CLI's own model, or type a name it accepts.`:``),Re=j(()=>B(p)&&!B(Pe).some(e=>e.id===B(p))?[{id:B(p),name:B(p),description:``},...B(Pe)]:B(Pe)),ze=j(()=>B(ke)===`codex`?Kx(B(Pe)):[]),Be=j(()=>Hx(B(p))),Ve=j(()=>!B(Be).family||B(ze).some(e=>e.family===B(Be).family)?B(ze):[{family:B(Be).family,label:B(Be).family,efforts:B(Be).effort?[{value:B(Be).effort,label:Wx(B(Be).effort)}]:[]},...B(ze)]),He=j(()=>B(Ve).find(e=>e.family===B(Be).family)?.efforts||[]);function Ue(e){let t=(B(Ve).find(t=>t.family===e)?.efforts||[]).some(e=>e.value===B(Be).effort)?B(Be).effort:``;N(p,Ux(e,t),!0)}function We(){let e={},n=B(y).trim();if(B(v)&&n){try{e=JSON.parse(n)}catch{return N(ie,`Advanced: not valid JSON.`),null}if(!e||typeof e!=`object`||Array.isArray(e))return N(ie,`Advanced: must be a JSON object, e.g. {"temperature": 0.7}.`),null}return N(ie,``),{id:t.config.id,name:B(d).trim(),type:B(f),model:B(p).trim(),base_url:B(m).trim(),host:B(h).trim(),secret_id:B(g),api_key:B(_).trim()||null,options:e,builtin_tools:B(b),params:B(T)}}async function Ge(e=!1){let n=We();if(n){N(re,!0);try{if(B(_).trim()){let e=await sL({name:cL(B(d),B(_)),value:B(_).trim()});n.secret_id=e.id,N(g,e.id,!0),N(_,``),N(_e,``),oL()}delete n.api_key,await Q.saveLlmConfig({...n,activate:c()||e}),t.onSaved()}catch(e){N(ie,nS(e),!0)}N(re,!1)}}async function Ke(){let e=We();if(e){N(ae,!0),N(oe,null);try{N(oe,await Q.testLlmConfigDraft(e),!0)}catch(e){N(oe,{ok:!1,error:nS(e)},!0)}N(ae,!1)}}var qe=xR(),Je=F(qe),Ye=R(F(Je),2);za(Ye),D(Je);var Xe=R(Je,2),Ze=e=>{var t=UL(),n=R(F(t),2);K(n,21,()=>l,Qi,(e,t)=>{var n=HL(),r=L(n,!0),i={};z(()=>{W(r,B(t).label),i!==(i=B(t).id)&&(n.value=(n.__value=i)??``)}),U(e,n)}),D(n);var r;Ea(n),D(t),z(()=>{r!==(r=B(f))&&(n.value=(n.__value=r)??``,Ta(n,r))}),V(`change`,n,e=>pe(e.currentTarget.value)),U(e,t)};G(Xe,e=>{B(me)&&e(Ze)});var Qe=R(Xe,2),$e=e=>{U(e,WL())},et=e=>{var t=KL(),n=I(t),r=R(F(n),2),i=F(r),a=L(i,!0);i.value=i.__value=``,K(R(i),17,()=>B(Ve),e=>e.family,(e,t)=>{var n=HL(),r=L(n,!0),i={};z(()=>{W(r,B(t).label),i!==(i=B(t).family)&&(n.value=(n.__value=i)??``)}),U(e,n)}),D(r);var o;Ea(r),D(n);var s=R(n,2),c=e=>{var t=GL(),n=R(F(t),2),r=F(n);r.value=r.__value=``,K(R(r),17,()=>B(He),e=>e.value,(e,t)=>{var n=HL(),r=L(n,!0),i={};z(()=>{W(r,B(t).label),i!==(i=B(t).value)&&(n.value=(n.__value=i)??``)}),U(e,n)}),D(n);var i;Ea(n),D(t),z(()=>{i!==(i=B(Be).effort)&&(n.value=(n.__value=i)??``,Ta(n,i))}),V(`change`,n,e=>N(p,Ux(B(Be).family,e.currentTarget.value),!0)),U(e,t)};G(s,e=>{B(He).length&&e(c)}),z(()=>{W(a,B(Fe)),o!==(o=B(Be).family)&&(r.value=(r.__value=o)??``,Ta(r,o))}),V(`change`,r,e=>Ue(e.currentTarget.value)),U(e,t)},tt=e=>{var t=qL(),n=R(F(t),2),r=F(n),i=L(r,!0);r.value=r.__value=``,K(R(r),17,()=>B(Re),e=>e.id,(e,t)=>{var n=HL(),r=L(n,!0),i={};z(()=>{J(n,`title`,B(t).description),W(r,B(t).name),i!==(i=B(t).id)&&(n.value=(n.__value=i)??``)}),U(e,n)}),D(n),Ea(n),D(t),z(()=>W(i,B(Fe))),Da(n,()=>B(p),e=>N(p,e)),U(e,t)},nt=e=>{var t=JL(),n=R(F(t),2);za(n),D(t),qa(n,()=>B(p),e=>N(p,e)),U(e,t)},rt=e=>{var t=ZL(),n=I(t);VL(R(F(n),2),{get type(){return B(f)},placeholder:`e.g. gemini-3.6-flash`,get catalog(){return B(Se)},get loading(){return B(xe)},onFirstFocus:()=>Ee(),get value(){return B(p)},set value(e){N(p,e,!0)}}),D(n);var r=R(n,2),i=e=>{var t=YL(),n=L(F(t),!0);D(t),z(e=>W(n,e),[()=>rL(B(ye),B(f))]),U(e,t)},a=e=>{var t=XL(),n=F(t),r=F(n),i=e=>{var t=zi();z(()=>W(t,B(we))),U(e,t)};G(r,e=>{B(we)&&e(i)});var a=R(r,2);D(n),D(t),V(`click`,a,()=>Ee(!0)),U(e,t)};G(r,e=>{B(ye)?e(i):B(ve)&&B(be)&&e(a,1)}),U(e,t)};G(Qe,e=>{B(Me)?e($e):B(f)===`codex`&&B(ze).length?e(et,1):B(f)===`claude_code`&&B(Re).length?e(tt,2):B(ke)?e(nt,3):e(rt,-1)});var it=R(Qe,2),at=e=>{var t=XL(),n=F(t),r=F(n),i=e=>{var t=zi();z(()=>W(t,B(Le))),U(e,t)};G(r,e=>{B(Le)&&e(i)});var a=R(r,2);D(n),D(t),V(`click`,a,()=>je(B(ke),!0)),U(e,t)};G(it,e=>{B(ke)&&!B(Me)&&e(at)});var ot=R(it,2),st=e=>{var t=QL(),n=R(F(t),2);za(n),D(t),Oi(`blur`,n,he),qa(n,()=>B(m),e=>N(m,e)),U(e,t)},ct=j(()=>jL(B(f))),lt=e=>{var t=$L(),n=R(F(t),2);za(n),D(t),Oi(`blur`,n,De),qa(n,()=>B(h),e=>N(h,e)),U(e,t)};G(ot,e=>{B(ct)?e(st):B(f)===`ollama`&&e(lt,1)});var ut=R(ot,2),dt=e=>{var t=eR(),n=R(F(t),4),r=F(n),i=R(r,2);let a;var o=L(i,!0);D(n);var c=L(R(n,2),!0);D(t),z(()=>{a=q(i,1,`llmtest`,null,a,{ok:B(se),bad:!B(se)}),W(o,B(se)?`Signed in`:`Not signed in`),W(c,B(de))}),V(`click`,r,()=>s.openCodex()),U(e,t)},ft=e=>{var t=rR(),n=R(F(t),2),r=L(n,!0),i=R(n,2),a=e=>{U(e,tR())},o=e=>{U(e,nR())};G(i,e=>{B(f)===`claude_code`?e(a):e(o,-1)}),D(t),z(()=>W(r,B(de))),U(e,t)},pt=e=>{var n=aR(),r=R(F(n),2),i=F(r),a=F(i);a.value=a.__value=``,K(R(a),17,()=>B(ue),e=>e.id,(e,t)=>{var n=HL(),r=L(n),i={};z(()=>{W(r,`${B(t).name??``} ${B(t).hint??``}${B(t).default?` · default`:``}`),i!==(i=B(t).id)&&(n.value=(n.__value=i)??``)}),U(e,n)}),D(i),Ea(i),D(r);var o=R(r,2),s=F(o);za(s),D(o);var c=R(o,2),l=e=>{U(e,iR())};G(c,e=>{t.config.secret_missing&&e(l)});var u=L(R(c,2),!0);D(n),z(e=>{i.disabled=e,W(u,B(de))},[()=>!!B(_).trim()]),Da(i,()=>B(g),e=>N(g,e)),Oi(`blur`,s,Oe),qa(s,()=>B(_),e=>N(_,e)),U(e,n)};G(ut,e=>{B(f)===`openai_subscription`?e(dt):B(f)===`claude_code`||B(f)===`codex`?e(ft,1):e(pt,-1)});var mt=R(ut,2);K(mt,17,()=>B(ee),e=>e.id,(e,t)=>{let n=j(()=>pL(B(f),B(t).id));var r=lR(),i=F(r),a=F(i),o=L(R(a),!0);D(i);var s=R(i,2),c=e=>{var n=oR(),r=F(n);r.value=r.__value=``,K(R(r),16,()=>B(t).choices,e=>e,(e,t)=>{var n=HL(),r=L(n,!0),i={};z(e=>{W(r,e),i!==(i=t)&&(n.value=(n.__value=i)??``)},[()=>hL(t)]),U(e,n)}),D(n);var i;Ea(n),z(e=>{J(n,`id`,`lf-param-${B(t).id??``}`),i!==(i=e)&&(n.value=(n.__value=i)??``,Ta(n,i))},[()=>String(B(T)[B(t).id]??``)]),V(`change`,n,e=>te(B(t).id,B(t).kind,e.currentTarget.value)),U(e,n)},l=e=>{var n=sR();za(n),z(e=>{J(n,`id`,`lf-param-${B(t).id??``}`),J(n,`min`,B(t).minimum??void 0),J(n,`max`,B(t).maximum??void 0),J(n,`step`,B(t).kind===`int`?1:.1),Ba(n,e)},[()=>String(B(T)[B(t).id]??``)]),V(`change`,n,e=>te(B(t).id,B(t).kind,e.currentTarget.value)),U(e,n)};G(s,e=>{B(t).kind===`choice`?e(c):e(l,-1)});var u=R(s,2),d=e=>{U(e,cR())},p=j(()=>B(ne).has(B(t).id));G(u,e=>{B(p)&&e(d)}),D(r),z(()=>{J(i,`for`,`lf-param-${B(t).id??``}`),W(a,`${B(n).label??``} `),W(o,B(n).description)}),U(e,r)});var ht=R(mt,2),gt=e=>{var t=mR(),n=F(t),r=L(R(F(n)));D(n),K(R(n,2),16,()=>B(x),e=>e,(e,t)=>{let n=j(()=>SL(B(f),t));var r=pR(),i=I(r),a=F(i);za(a);var o=R(a,2),s=F(o),c=L(s,!0),l=R(s,2),u=L(l,!0),d=R(l,2),p=e=>{var t=uR(),r=L(t,!0);z(()=>W(r,B(n).note)),U(e,t)};G(d,e=>{B(b)[t]&&B(n).note&&e(p)}),D(o),D(i);var m=R(i,2),h=e=>{var n=fR();K(n,21,()=>B(C)[t],e=>e.id,(e,n)=>{let r=j(()=>EL(B(n).id));var i=dR(),a=I(i),o=F(a),s=L(R(o),!0);D(a);var c=R(a,2);za(c),z(e=>{J(a,`for`,`lf-tool-${t??``}-${B(n).id??``}`),W(o,`${B(r).label??``} `),W(s,B(r).description),J(c,`id`,`lf-tool-${t??``}-${B(n).id??``}`),J(c,`type`,B(n).kind===`int`?`number`:`text`),J(c,`min`,B(n).kind===`int`?1:void 0),J(c,`placeholder`,B(n).kind===`int`?`No limit`:`example.com, docs.python.org`),Ba(c,e)},[()=>DL(B(b)[t][B(n).id])]),V(`change`,c,e=>w(t,B(n).id,B(n).kind,e.currentTarget.value)),U(e,i)}),D(n),U(e,n)};G(m,e=>{B(b)[t]&&B(C)[t]?.length&&e(h)}),z(()=>{Va(a,!!B(b)[t]),W(c,B(n).label),W(u,B(n).description)}),V(`change`,a,e=>S(t,e.currentTarget.checked)),U(e,r)}),D(t),z(()=>W(r,`what ${(yx[B(f)]||B(f))??``} can do on its own servers`)),U(e,t)};G(ht,e=>{B(x).length&&e(gt)});var _t=R(ht,2),vt=e=>{var t=gR(),n=F(t),r=L(n),i=R(n,2),a=e=>{var t=hR();tn(t),J(t,`placeholder`,`Extra AG2 provider-config settings as a JSON object, e.g. + could be rate-limited. Requests route through the ChatGPT backend with your sign-in token.

`,1);function GP(e,t){O(t,!0);let[n,r]=Zt(),i=M(null),a=M(!1),o=M(``),s=M(``),c=M(!1),l=M(void 0),u=M(``),d=M(!1),f=null;async function p(){try{N(i,await Q.codexStatus(),!0)}catch(e){N(u,iS(e),!0)}}p(),ao(()=>{f&&clearInterval(f)});async function m(){N(u,``);try{let e=await Q.codexLoginUrl();N(o,e.state,!0),window.open(e.auth_url,`_blank`),N(a,!0),f=setInterval(async()=>{let e=await Q.codexStatus();e.signed_in&&(f&&clearInterval(f),f=null,N(a,!1),N(i,e,!0))},2e3)}catch(e){N(u,iS(e),!0)}}async function h(){N(c,!0),await li(),B(l)?.focus()}async function g(){if(!(!B(s).trim()||!B(o))){N(u,``),N(d,!0);try{await Q.codexSubmit(B(o),B(s).trim()),N(s,``),N(c,!1),N(a,!1),f&&=(clearInterval(f),null),await p()}catch(e){N(u,iS(e),!0)}N(d,!1)}}async function _(){N(u,``),N(d,!0);try{await Q.codexLogout(),await p()}catch(e){N(u,iS(e),!0)}N(d,!1)}let v=()=>Xt(Go,!1);var y=WP(),b=I(y),x=R(b,2),S=R(F(x),4),C=e=>{var t=LP(),n=L(t,!0);z(()=>W(n,B(u))),U(e,t)};G(S,e=>{B(u)&&e(C)});var w=R(S,2),T=e=>{U(e,RP())},ee=e=>{var t=zP(),n=I(t),r=L(R(F(n)));D(n);var a=R(n,4),o=F(a),s=R(o,2);D(a),z(()=>{W(r,`(account: ${(B(i).account_id||`unknown`)??``})`),o.disabled=B(d)}),V(`click`,o,_),V(`click`,s,v),U(e,t)},te=e=>{var t=UP(),n=I(t),r=L(n,!0),i=R(n,2),o=L(i,!0),u=R(i,2),f=e=>{var t=HP(),n=I(t),r=R(F(n),5),i=e=>{var t=BP();V(`click`,t,h),U(e,t)};G(r,e=>{B(c)||e(i)}),D(n);var a=R(n,2),o=e=>{var t=VP(),n=R(I(t),2),r=F(n);za(r),Qa(r,e=>N(l,e),()=>B(l));var i=R(r,2),a=L(i,!0);D(n),z(e=>{i.disabled=e,W(a,B(d)?`Submitting…`:`Submit`)},[()=>B(d)||!B(s).trim()]),V(`keydown`,r,e=>e.key===`Enter`&&g()),qa(r,()=>B(s),e=>N(s,e)),V(`click`,i,g),U(e,t)};G(a,e=>{B(c)&&e(o)}),U(e,t)};G(u,e=>{B(a)&&e(f)});var p=L(R(u,2));z(()=>{W(r,B(a)?`Waiting for ChatGPT — complete sign-in in the opened tab…`:`Sign in with your ChatGPT account.`),W(o,B(a)?`Reopen sign-in tab`:`Sign in with ChatGPT`)}),V(`click`,i,m),V(`click`,p,v),U(e,t)};G(w,e=>{B(i)?B(i).signed_in?e(ee,1):e(te,-1):e(T)}),D(x),V(`click`,b,v),U(e,y),k(),r()}ki([`click`,`keydown`]);var KP=H(``),qP=H(`

Pick a voice — it plays a sample and is saved for your chats (applies next voice session).

`,1);function JP(e,t){O(t,!0);let n=()=>A(qo,`$voicePickerConfig`,r),[r,i]=Zt(),a=n(),o=M(P([])),s=M(``),c=M(``),l=M(``),u=null,d={gemini:`Gemini`,openai:`OpenAI`};async function f(){try{let e=await Q.voices(a);N(o,e.voices,!0),N(s,e.current,!0),N(c,e.provider||``,!0)}catch{}}io(f);function p(){u&&=(u.pause(),URL.revokeObjectURL(u.src),null)}ao(p);function m(e,t){return new Promise((n,r)=>{p(),u=new Audio(e),u.onended=()=>{B(l)===t&&N(l,``)},u.onerror=r,u.play().then(n,r)})}async function h(e){N(s,e.name,!0),Q.selectVoice(e.name,a).then(()=>{a&&Vj()}).catch(()=>{}),N(l,e.name,!0);try{await m(`/voices/`+encodeURIComponent(e.name)+`.wav`,e.name)}catch{try{let t=await Q.previewVoice(e.name,a);await m(URL.createObjectURL(t),e.name)}catch{N(l,``)}}}let g=()=>{p(),qo.set(null),Xt(Ko,!1)};var _=qP(),v=I(_);let y;var b=R(v,2);let x;var S=F(b),C=R(S,2),w=L(C),T=R(C,4);K(T,21,()=>B(o),e=>e.name,(e,t)=>{var n=KP();let r;var i=F(n),a=L(i,!0),o=R(i,2),c=L(o,!0),u=L(R(o,2),!0);D(n),z(()=>{r=q(n,1,`vrow`,null,r,{on:B(s)===B(t).name}),W(a,B(t).name),W(c,B(t).style),W(u,B(l)===B(t).name?`▶ playing…`:B(s)===B(t).name?`✓ current`:``)}),V(`click`,n,()=>h(B(t))),U(e,n)}),D(T),D(b),z(()=>{y=q(v,1,`modal-backdrop`,null,y,{over:!!a}),x=q(b,1,`modal voicepick`,null,x,{over:!!a}),W(w,`Voice${B(c)?` — `+(d[B(c)]||B(c)):``}`)}),V(`click`,v,g),V(`click`,S,g),U(e,_),k(),i()}ki([`click`]);var YP=H(`
`);function XP(e,t){O(t,!0);let n=M(void 0);hr(()=>{B(n)&&(B(n).innerHTML=VO(t.text),WO(B(n),e=>Fs(`/t/`+e)),HO(B(n),e=>Hs(e.path)))});var r=YP();Qa(r,e=>N(n,e),()=>B(n)),U(e,r),k()}var ZP=H(`

`),QP=H(``),$P=H(`
`),eF=H(`
`),tF=H(``),nF=H(`

`),rF=H(`Run`),iF=H(``),aF=H(``),oF=H(`
`),sF=H(`●`),cF=H(``),lF=H(` `,1),uF=H(``),dF=H(``),fF=H(``),pF=H(``),mF=H(`

`),hF=H(``),gF=H(``),_F=H(``),vF=H(`
 
`),yF=H(`
 
`),bF=H(`

No preview for this file type — or download it.

`),xF=H(``),SF=H(``);function CF(e,t){O(t,!0);let n=()=>A(js,`$route`,o),r=()=>A(Jo,`$viewer`,o),i=()=>A(FC,`$threadScope`,o),a=()=>A(os,`$previewExpanded`,o),[o,s]=Zt(),c=(e,t=ue,n=ue,r=ue)=>{var i=QP(),a=F(i);$(a,{get name(){return t()},size:28});var o=R(a,2),s=L(o,!0),c=R(o,2),l=L(c,!0),u=R(c,2),f=e=>{var t=ZP(),n=L(t,!0);z(()=>W(n,r())),U(e,t)};G(u,e=>{r()&&e(f)}),D(i),z(()=>{W(s,n()),W(l,B(d))}),U(e,i)},l=j(()=>n().aside?.kind===`file`?n().aside:null),u=j(()=>!B(l)&&r()?.text!=null?r():null),d=j(()=>B(l)?.path||null),f=j(()=>B(d)?B(d).split(`/`).pop():null),p=j(()=>B(l)?B(f)||`Preview`:B(u)?.title||`Preview`),m=j(()=>B(d)?LC(B(f)):`markdown`),h=j(i),g=j(()=>B(d)?Q.fileUrl(B(d),!1,B(h)):``),_=j(()=>B(d)?Q.fileUrl(B(d),!0,B(h)):``),v=j(()=>B(m)===`html`||B(m)===`pdf`||B(m)===`image`),y=j(()=>B(m)===`markdown`||B(m)===`code`||B(m)===`text`||B(m)===`html`||B(m)===`image`),b=M(null),x=j(()=>B(m)===`markdown`&&!!B(d)&&(!Bv(B(d))||Vv(B(b)).edit));function S(){B(l)?Ws():Xt(Jo,null)}ao(ss);let C=M(``),w=M(``),T=M(null),ee=M(``),te=M(`preview`),ne=M(`preview`),re=M(``),ie=M(``),ae=M(!1),oe=M(!1),se=M(``),ce=M(!1),le=M(!1),de=j(()=>B(x)&&B(w)!==B(C));io(()=>Es(()=>B(de))),ao(()=>Es(null));let fe=M(P([])),E=M(!1);hr(()=>{let e=B(d),t=B(h);if(N(fe,[],!0),N(E,!1),!e)return;let n=!1;return Q.fileMentions(e,t).then(e=>{n||N(fe,e.threads,!0)}).catch(()=>{n||N(fe,[],!0)}),()=>{n=!0}});function pe(){N(E,!B(E))}function me(e){Zo(e),N(E,!1)}function he(e){let t=e.target instanceof Element?e.target:null;B(E)&&!t?.closest(`.vmentions-pop`)&&!t?.closest(`.vmentions`)&&N(E,!1)}function ge(e){e.key===`Escape`&&N(E,!1)}io(()=>(document.addEventListener(`pointerdown`,he,!0),document.addEventListener(`keydown`,ge),()=>{document.removeEventListener(`pointerdown`,he,!0),document.removeEventListener(`keydown`,ge)})),hr(()=>{let e=B(d),t=B(u),n=B(m),r=B(h),i=!1;return N(C,``),N(w,``),N(T,null),N(ee,``),N(se,``),N(ce,!1),N(oe,!1),N(le,!1),N(te,`preview`),N(ne,`preview`),N(re,``),N(ie,``),N(ae,!1),N(b,null),t?(N(C,t.text,!0),N(w,t.text,!0)):e&&n===`markdown`?Q.fileTextWithEtag(e,r).then(({text:e,etag:t,mode:n})=>{i||(N(C,e,!0),N(w,e,!0),N(T,t,!0),N(b,n,!0))}).catch(e=>{i||N(ee,iS(e),!0)}):e&&(n===`code`||n===`text`)&&Q.fileText(e,r).then(e=>{i||(N(C,e,!0),N(w,e,!0))}).catch(e=>{i||N(ee,iS(e),!0)}),()=>{i=!0}});async function _e(){if(N(ne,`raw`),B(ae))return;N(ae,!0);let e=B(d),t=B(h);if(e)try{let n=await Q.fileText(e,t);e===B(d)&&N(re,n,!0)}catch(t){e===B(d)&&N(ie,iS(t),!0)}}let ve=M(!1);async function ye(){try{B(m)===`image`?await navigator.clipboard.write([new ClipboardItem({"image/png":Ee()})]):B(m)===`html`?await navigator.clipboard.writeText(B(d)?await Q.fileText(B(d),B(h)):``):await navigator.clipboard.writeText(B(w)||``),N(ve,!0),setTimeout(()=>N(ve,!1),1400)}catch{}}async function be(e){if(B(oe))return;let t=B(d);if(!t)return;N(oe,!0),N(se,``);let n=B(w);try{let r=await Q.saveFile(t,n,e,B(h));if(t!==B(d))return;N(C,n,!0),N(T,r,!0),N(ce,!1)}catch(e){if(t!==B(d))return;Iv(e)?N(ce,!0):(N(se,Lv(e),!0),N(ce,!1))}finally{t===B(d)&&N(oe,!1)}}function xe(){!B(x)||!B(de)||B(ce)||be(B(T))}function Se(){be(null)}async function Ce(){if(B(oe))return;let e=B(d);if(e){N(oe,!0),N(se,``);try{let{text:t,etag:n}=await Q.fileTextWithEtag(e,B(h));if(e!==B(d))return;N(C,t,!0),N(w,t,!0),N(T,n,!0),N(ce,!1)}catch(t){if(e!==B(d))return;N(se,Lv(t),!0),N(ce,!1)}finally{e===B(d)&&N(oe,!1)}}}function we(e){B(x)&&(e.metaKey||e.ctrlKey)&&(e.key===`s`||e.key===`S`)&&(e.preventDefault(),xe())}function Te(e){B(de)&&(e.preventDefault(),e.returnValue=``)}async function Ee(){let e=new Image;e.src=B(g),await e.decode();let t=document.createElement(`canvas`);t.width=e.naturalWidth,t.height=e.naturalHeight;let n=t.getContext(`2d`);if(!n)throw Error(`canvas 2d context unavailable`);return n.drawImage(e,0,0),await new Promise((e,n)=>t.toBlob(t=>t?e(t):n(Error(`canvas export failed`)),`image/png`))}var De=SF();Oi(`keydown`,Xn,we),Oi(`beforeunload`,Xn,Te);var Oe=F(De);_C(Oe,{get width(){return as},onGrab:()=>os.set(!1)});var ke=R(Oe,2),Ae=F(ke),je=e=>{var t=$P(),n=F(t);let r;$(F(n),{name:`eye`,size:14}),D(n);var i=R(n,2);let a;$(F(i),{name:`pencil`,size:14}),D(i),D(t),z(()=>{r=q(n,1,`vsegbtn`,null,r,{on:B(te)===`preview`}),J(n,`aria-pressed`,B(te)===`preview`),a=q(i,1,`vsegbtn`,null,a,{on:B(te)===`edit`}),J(i,`aria-pressed`,B(te)===`edit`)}),V(`click`,n,()=>N(te,`preview`)),V(`click`,i,()=>N(te,`edit`)),U(e,t)},Me=e=>{var t=eF(),n=F(t);let r;$(F(n),{name:`eye`,size:14}),D(n);var i=R(n,2);let a;$(F(i),{name:`file-text`,size:14}),D(i),D(t),z(()=>{r=q(n,1,`vsegbtn`,null,r,{on:B(ne)===`preview`}),J(n,`aria-pressed`,B(ne)===`preview`),a=q(i,1,`vsegbtn`,null,a,{on:B(ne)===`raw`}),J(i,`aria-pressed`,B(ne)===`raw`)}),V(`click`,n,()=>N(ne,`preview`)),V(`click`,i,_e),U(e,t)};G(Ae,e=>{B(x)?e(je):B(m)===`download`&&e(Me,1)});var Ne=R(Ae,2),Pe=e=>{var t=tF(),n=L(t,!0);z(()=>{J(t,`title`,`Reveal ${B(f)} in Files`),W(n,B(p))}),V(`click`,t,()=>Xo(B(d))),U(e,t)},Fe=e=>{var t=nF(),n=L(t,!0);z(()=>{J(t,`title`,B(p)),W(n,B(p))}),U(e,t)};G(Ne,e=>{B(d)?e(Pe):e(Fe,-1)});var Ie=R(Ne,2),Le=e=>{var t=oF(),n=F(t);let r;var i=F(n);$(i,{name:`message`,size:15});var a=L(R(i,2),!0);D(n);var o=R(n,2),s=e=>{var t=aF();K(t,21,()=>B(fe),e=>e.stream_id,(e,t)=>{var n=iF(),r=F(n);{let e=j(()=>WC(B(t)));$(r,{get name(){return B(e)},size:14})}var i=R(r,2),a=L(i,!0),o=R(i,2),s=e=>{U(e,rF())};G(o,e=>{B(t).kind===`run`&&e(s)}),D(n),z(e=>W(a,e),[()=>UC(B(t))]),V(`click`,n,()=>me(B(t))),U(e,n)}),D(t),z(e=>J(t,`aria-label`,e),[()=>HC(B(fe).length)]),U(e,t)};G(o,e=>{B(E)&&e(s)}),D(t),z((e,t)=>{r=q(n,1,`vmentions`,null,r,{on:B(E)}),J(n,`aria-expanded`,B(E)),J(n,`title`,e),J(n,`aria-label`,t),W(a,B(fe).length)},[()=>HC(B(fe).length),()=>HC(B(fe).length)]),V(`click`,n,pe),U(e,t)};G(Ie,e=>{B(d)&&B(fe).length>0&&e(Le)});var Re=R(Ie,2),ze=e=>{var t=lF(),n=I(t),r=e=>{U(e,sF())};G(n,e=>{B(de)&&e(r)});var i=R(n,2),a=e=>{var t=cF(),n=L(t,!0);z(()=>{t.disabled=!B(de)||B(oe)||B(ce),W(n,B(oe)?`Saving…`:`Save`)}),V(`click`,t,xe),U(e,t)};G(i,e=>{B(te)===`edit`&&e(a)}),U(e,t)};G(Re,e=>{B(x)&&e(ze)});var Be=R(Re,2),Ve=e=>{var t=uF();let n;var r=F(t);{let e=j(()=>B(ve)?`check`:`copy`);$(r,{get name(){return B(e)},size:15})}D(t),z(()=>{n=q(t,1,`cp`,null,n,{copied:B(ve)}),J(t,`title`,B(ve)?`Copied`:`Copy`)}),V(`click`,t,ye),U(e,t)};G(Be,e=>{B(y)&&e(Ve)});var He=R(Be,2),Ue=F(He);{let e=j(()=>a()?`minimize-2`:`maximize-2`);$(Ue,{get name(){return B(e)},size:15})}D(He);var We=R(He,2),Ge=e=>{var t=dF();$(F(t),{name:`download`,size:15}),D(t),z(()=>J(t,`href`,B(_))),U(e,t)};G(We,e=>{B(d)&&e(Ge)});var Ke=R(We,2);D(ke);var qe=R(ke,2);let Je;var Ye=F(qe),Xe=e=>{var t=fF(),n=L(t,!0);z(()=>W(n,B(se))),U(e,t)};G(Ye,e=>{B(se)&&e(Xe)});var Ze=R(Ye,2),Qe=e=>{var t=pF(),n=R(F(t),2),r=F(n),i=R(r,2);D(n),D(t),z(()=>{r.disabled=B(oe),i.disabled=B(oe)}),V(`click`,r,Ce),V(`click`,i,Se),U(e,t)};G(Ze,e=>{B(ce)&&e(Qe)});var $e=R(Ze,2),et=e=>{var t=Bi(),n=I(t),r=e=>{c(e,()=>`file-x`,()=>`Couldn’t load this file — it may have moved or been deleted.`,()=>B(ee))},i=e=>{var t=mF(),n=L(t,!0);z(()=>W(n,B(ee))),U(e,t)};G(n,e=>{B(d)?e(r):e(i,-1)}),U(e,t)},nt=e=>{var t=hF();z(()=>{J(t,`title`,B(p)),J(t,`src`,B(g))}),U(e,t)},rt=e=>{var t=gF();z(()=>{J(t,`title`,B(p)),J(t,`src`,B(g))}),U(e,t)},it=e=>{var t=Bi(),n=I(t),r=e=>{c(e,()=>`image-off`,()=>`Couldn’t load this image — the file may have moved or been deleted.`)},i=e=>{var t=_F();z(()=>{J(t,`src`,B(g)),J(t,`alt`,B(p))}),Oi(`error`,t,()=>N(le,!0)),Ei(t),U(e,t)};G(n,e=>{B(le)?e(r):e(i,-1)}),U(e,t)},at=e=>{var t=vF(),n=L(t,!0);z(()=>W(n,B(C))),U(e,t)},ot=e=>{var t=yF(),n=L(t,!0);z(()=>W(n,B(C))),U(e,t)},st=e=>{var t=Bi(),n=I(t),r=e=>{var t=Bi(),n=I(t),r=e=>{c(e,()=>`file-x`,()=>`Couldn’t load this file as text — it may have moved or been deleted.`,()=>B(ie))},i=e=>{var t=yF(),n=L(t,!0);z(()=>W(n,B(re))),U(e,t)};G(n,e=>{B(ie)?e(r):e(i,-1)}),U(e,t)},i=e=>{var t=bF(),n=R(F(t)),r=R(n,2);tt(),D(t),z(()=>J(r,`href`,B(_))),V(`click`,n,_e),U(e,t)};G(n,e=>{B(ne)===`raw`?e(r):e(i,-1)}),U(e,t)},ct=e=>{var t=xF();tn(t),z(()=>J(t,`aria-label`,`Edit ${B(f)}`)),qa(t,()=>B(w),e=>N(w,e)),U(e,t)},lt=e=>{XP(e,{get text(){return B(w)}})};G($e,e=>{B(ee)?e(et):B(m)===`html`?e(nt,1):B(m)===`pdf`?e(rt,2):B(m)===`image`?e(it,3):B(m)===`code`?e(at,4):B(m)===`text`?e(ot,5):B(m)===`download`?e(st,6):B(x)&&B(te)===`edit`?e(ct,7):e(lt,-1)}),D(qe),D(De),z(()=>{J(He,`aria-pressed`,a()),J(He,`title`,a()?`Collapse preview`:`Expand preview`),J(He,`aria-label`,a()?`Collapse preview`:`Expand preview`),Je=q(qe,1,`vbody`,null,Je,{native:B(v),editing:B(x)&&B(te)===`edit`})}),V(`click`,He,()=>os.update(e=>!e)),V(`click`,Ke,S),U(e,De),k(),s()}ki([`click`]);var wF=Symbol(`settings`);function TF(){let e=P({s:null,google:null,drafts:{},busy:!1,err:``,load:async()=>{let t=Kt(Po);try{let n=await Q.settings();if(Kt(Po)!==t)return;e.s=n,e.drafts={}}catch(t){e.err=iS(t)}try{let n=await Q.googleStatus();Kt(Po)===t&&(e.google=n)}catch{}},run:async t=>{e.err=``,e.busy=!0;try{await t(),await e.load()}catch(t){e.err=iS(t)}e.busy=!1},close:()=>Bs(),openVoice:(e=null)=>{qo.set(e),Ko.set(!0)},openGoogle:()=>{Bs(),Wo.set(!0)},openCodex:()=>Go.set(!0),openPoweredBy:()=>Rs(`poweredby`,Kt(js).overlayValue),reRunSetup:()=>{Bs(),us.set(!0)}});return kt(wF,e),e}function EF(){return Ot(wF)}var DF=H(``),OF=H(`
Appearance
Animations

How animated content (weather panels and more) renders on this device — High drives the GPU; Basic and Off are easy on it.

Notifications
Re-run setup
Re-run setup replay the first-run welcome & onboarding
`,1);function kF(e,t){O(t,!1);let n=()=>A(ls,`$animations`,i),r=()=>A(rs,`$soundOnInput`,i),[i,a]=Zt(),o=EF(),s=[{id:`off`,label:`Off`,hint:`static content`},{id:`basic`,label:`Basic`,hint:`light animation`},{id:`high`,label:`High`,hint:`full 3D scenes`}];$a();var c=OF(),l=R(I(c),2);eS(l,{});var u=R(l,4);K(u,5,()=>s,Qi,(e,t)=>{var r=DF();let i;var a=F(r),o=L(R(a));D(r),z(()=>{i=q(r,1,`focuspill`,null,i,{on:n()===B(t).id}),W(a,`${B(t).label??``} `),W(o,`· ${B(t).hint??``}`)}),V(`click`,r,()=>Xt(ls,B(t).id)),U(e,r)}),D(u);var d=R(u,6),f=F(d);za(f),tt(),D(d);var p=R(d,4),m=F(p),h=F(m);$(F(h),{name:`sparkles`,size:15}),tt(),D(h),tt(2),D(m);var g=R(m,2);D(p),V(`change`,f,e=>e.currentTarget.checked&&bP()),Ja(f,r,e=>Xt(rs,e)),V(`click`,g,function(...e){o.reRunSetup?.apply(this,e)}),U(e,c),k(),a()}ki([`click`,`change`]);var AF=H(`

`),jF=H(`active`),MF=H(``),NF=H(`
`),PF=H(`
`),FF=H(``),IF=H(``),LF=H(`
`),RF=H(`

The profile stops running and is hidden. Its folder stays on disk.

`),zF=H(`

Erases this profile's folder — chats, tasks, memory, and files — from disk. This cannot be undone.

`),BF=H(`
`),VF=H(`
`),HF=H(`
`);function UF(e,t){O(t,!0);let n=()=>A(No,`$profiles`,r),[r,i]=Zt(),a=j(()=>n().list),o=j(()=>n().activeId||hs()),s=M(null),c=M(!1),l=M(``),u=M(null),d=M(``),f=M(!1),p=j(()=>B(a).map(e=>e.accent));async function m({name:e,accent:t}){await Q.createProfile(e,t),N(f,!1),await y()}let h=M(P([])),g=M(!1),_=M(null),v=M(``);async function y(){try{let e=await Q.profiles(),t=e.profiles;N(s,e.active_default,!0),N(h,e.archived,!0);let n=B(_);n&&!B(h).some(e=>e.id===n.pid)&&(N(_,null),N(v,``)),Xt(No,{list:t,activeId:B(o)})}catch{}}function b(e){N(l,``);let t=e.id===B(s),n=B(a).filter(t=>t.id!==e.id),r=n.find(e=>e.id===B(s))||n[0];N(d,r?r.id:``,!0),N(u,{pid:e.id,name:e.name,isActive:e.id===B(o),isActiveDefault:t},!0)}async function x(){if(B(c)||!B(u))return;N(c,!0),N(l,``);let{pid:e,isActive:t}=B(u);try{if(t&&cx(),await Q.archiveProfile(e,B(d)||void 0),t){B(d)?(ux(B(d)),await y(),N(u,null)):location.assign(`/app/`+location.hash);return}N(u,null),await y()}catch(e){N(l,iS(e,`Could not archive profile`),!0)}finally{N(c,!1)}}async function S(e){if(!B(c)){N(c,!0),N(l,``);try{await Q.restoreProfile(e.id),await y()}catch(e){N(l,iS(e,`Could not restore profile`),!0)}N(c,!1)}}function C(e){let t=`color-mix(in srgb, ${e} 40%, transparent)`;return`--accent:${e};--accent-ring:${t};--focus-ring:0 0 0 3px ${t};`}function w(e){N(l,``),N(v,``),N(_,{pid:e.id,name:e.name},!0)}async function T(){if(!(B(c)||!B(_)||B(v)!==B(_).name)){N(c,!0),N(l,``);try{await Q.deleteProfile(B(_).pid),N(_,null),N(v,``),await y()}catch(e){N(l,iS(e,`Could not delete profile`),!0)}N(c,!1)}}function ee(e){ux(e.id)}function te(e){t.onSelect?.(e)}y();var ne=HF(),re=F(ne),ie=e=>{var t=AF(),n=L(t,!0);z(()=>W(n,B(l))),U(e,t)};G(re,e=>{B(l)&&!B(u)&&e(ie)});var ae=R(re,2);K(ae,17,()=>B(a),e=>e.id,(e,t)=>{let n=j(()=>B(t).id===B(o));var r=NF();let i;var s=F(r),c=R(s,2),l=F(c),u=F(l),d=R(u),f=e=>{U(e,jF())};G(d,e=>{B(n)&&e(f)}),D(l);var p=R(l,2),m=L(p,!0);D(c);var h=R(c,2),g=F(h),_=R(g,2),v=e=>{var n=MF();V(`click`,n,e=>{e.stopPropagation(),b(B(t))}),U(e,n)};G(_,e=>{B(a).length>1&&e(v)}),D(h),D(r),z(()=>{i=q(r,1,`prow svelte-1rlzuji`,null,i,{active:B(n),clickable:!B(n)}),J(r,`aria-disabled`,B(n)),J(r,`tabindex`,B(n)?-1:0),J(r,`title`,B(n)?void 0:`Switch to ${B(t).name}`),xa(s,`--dot:${B(t).accent??``}`),W(u,`${B(t).name??``} `),J(p,`title`,B(t).workspace||``),W(m,B(t).workspace||`—`)}),V(`click`,r,function(...e){(B(n)?void 0:()=>ee(B(t)))?.apply(this,e)}),V(`keydown`,r,function(...e){(B(n)?void 0:e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),ee(B(t)))})?.apply(this,e)}),V(`click`,g,e=>{e.stopPropagation(),te(B(t))}),U(e,r)});var oe=R(ae,2),se=e=>{var t=PF(),n=F(t);ES(n,{get claimed(){return B(p)},submitLabel:`Create profile`,busyLabel:`Creating…`,onSubmit:m});var r=R(n,2);D(t),V(`click`,r,()=>N(f,!1)),U(e,t)},ce=e=>{var t=FF();$(F(t),{name:`plus`,size:14}),tt(),D(t),V(`click`,t,()=>{N(l,``),N(f,!0)}),U(e,t)};G(oe,e=>{B(f)?e(se):e(ce,-1)});var le=R(oe,2),ue=e=>{let t=j(()=>B(u));var n=RF(),r=F(n),i=F(r);$(i,{name:`archive`,size:15});var o=R(i);D(r);var s=R(r,4),f=e=>{var n=LF(),r=R(F(n),2);K(r,21,()=>B(a).filter(e=>e.id!==B(t).pid),e=>e.id,(e,t)=>{var n=IF(),r=L(n,!0),i={};z(()=>{W(r,B(t).name),i!==(i=B(t).id)&&(n.value=(n.__value=i)??``)}),U(e,n)}),D(r),Ea(r),D(n),Da(r,()=>B(d),e=>N(d,e)),U(e,n)};G(s,e=>{B(u).isActiveDefault&&e(f)});var p=R(s,2),m=e=>{var t=AF(),n=L(t,!0);z(()=>W(n,B(l))),U(e,t)};G(p,e=>{B(l)&&e(m)});var h=R(p,2),g=F(h),_=R(g,2),v=L(_,!0);D(h),D(n),z(()=>{W(o,` Archive “${B(u).name??``}”?`),g.disabled=B(c),_.disabled=B(c),W(v,B(c)?`Archiving…`:`Archive`)}),V(`click`,g,()=>N(u,null)),V(`click`,_,x),U(e,n)};G(le,e=>{B(u)&&e(ue)});var de=R(le,2),fe=e=>{var t=VF(),n=F(t),r=F(n);{let e=j(()=>B(g)?`chevron-down`:`chevron-right`);$(r,{get name(){return B(e)},size:14})}var i=R(r);D(n);var a=R(n,2),o=e=>{var t=Bi();K(I(t),17,()=>B(h),e=>e.id,(e,t)=>{var n=BF(),r=F(n),i=F(r),a=R(i,2),o=L(F(a),!0);D(a);var s=R(a,2),u=F(s),d=R(u,2);D(s),D(r);var f=R(r,2),p=e=>{var t=zF(),n=F(t),r=F(n);$(r,{name:`trash`,size:15});var i=R(r);D(n);var a=R(n,4),o=F(a),s=L(R(F(o)),!0);tt(),D(o);var u=R(o,2);za(u),D(a);var d=R(a,2),f=e=>{var t=AF(),n=L(t,!0);z(()=>W(n,B(l))),U(e,t)};G(d,e=>{B(l)&&e(f)});var p=R(d,2),m=F(p),h=R(m,2),g=L(h,!0);D(p),D(t),z(()=>{W(i,` Delete “${B(_).name??``}” permanently?`),W(s,B(_).name),J(u,`placeholder`,B(_).name),m.disabled=B(c),h.disabled=B(c)||B(v)!==B(_).name,W(g,B(c)?`Deleting…`:`Delete permanently`)}),qa(u,()=>B(v),e=>N(v,e)),V(`click`,m,()=>{N(_,null),N(v,``)}),V(`click`,h,T),U(e,t)};G(f,e=>{B(_)&&B(_).pid===B(t).id&&e(p)}),D(n),z(e=>{xa(n,e),xa(i,`--dot:${B(t).accent??``}`),W(o,B(t).name),u.disabled=B(c),d.disabled=B(c)},[()=>C(B(t).accent)]),V(`click`,u,()=>S(B(t))),V(`click`,d,()=>w(B(t))),U(e,n)}),U(e,t)};G(a,e=>{B(g)&&e(o)}),D(t),z(()=>{J(n,`aria-expanded`,B(g)),W(i,` Archived (${B(h).length??``})`)}),V(`click`,n,()=>N(g,!B(g))),U(e,t)};G(de,e=>{B(h).length>0&&e(fe)}),D(ne),U(e,ne),k(),i()}ki([`click`,`keydown`]);var WF=H(``),GF=H(`

`),KF=H(`Saved ✓`),qF=H(``),JF=H(`
Colour
`,1),YF=H(`

No profile selected.

`);function XF(e,t){O(t,!0);let n=()=>A(No,`$profiles`,i),[i,a]=Zt(),o=j(()=>n().list||[]),s=j(()=>n().activeId||hs()),c=j(()=>B(o).find(e=>e.id===B(s))||null),l=j(()=>B(o).filter(e=>e.id!==B(s)).map(e=>e.accent)),u=M(``),d=M(``),f=M(``),p=M(``),m=M(!1),_=M(!1),v=M(``),y=M(null);hr(()=>{B(c)&&B(c).id!==B(y)&&(N(y,B(c).id,!0),N(u,B(c).name,!0),N(d,B(c).accent,!0),N(p,B(c).name,!0),N(f,B(c).accent,!0),N(v,``))});let b=j(()=>!r.some(e=>e.hex===B(d))),x=j(()=>!!B(c)&&(B(u).trim()!==B(p)||B(d)!==B(f)));function S(e){Xt(No,{...n(),list:(n().list||[]).map(t=>t.id===B(s)?{...t,accent:e}:t)})}function C(e){N(d,e,!0),h(e),S(e)}function w(e){let t=(e.currentTarget.value||``).toLowerCase();/^#[0-9a-f]{6}$/.test(t)&&C(t)}function T(){B(f)&&(g()!==B(f)&&h(B(f)),(n().list||[]).some(e=>e.id===B(s)&&e.accent!==B(f))&&S(B(f)))}function ee(){N(u,B(p),!0),T(),N(d,B(f),!0),N(v,``)}ao(()=>{B(d)!==B(f)&&T()});async function te(){if(B(m)||!B(c))return;let e=B(c),t={};if(B(u).trim()&&B(u).trim()!==B(p)&&(t.name=B(u).trim()),B(d)&&B(d)!==B(f)&&(t.accent=B(d)),Object.keys(t).length){N(m,!0),N(v,``);try{await Q.updateProfile(e.id,t);let r=t.name;r&&(Xt(No,{...n(),list:(n().list||[]).map(t=>t.id===e.id?{...t,name:r}:t)}),N(p,r,!0),N(u,r,!0)),t.accent&&(e.id===B(s)&&B(d)!==g()&&h(B(d)),N(f,B(d),!0)),N(_,!0),setTimeout(()=>N(_,!1),1500)}catch(e){N(v,iS(e,`Could not save profile`),!0)}N(m,!1)}}var ne=Bi(),re=I(ne),ie=e=>{var t=JF(),n=I(t),i=F(n),a=L(i,!0),o=R(i,2),s=F(o),p=L(s,!0),h=R(s,2),g=L(h,!0);D(o),D(n);var y=R(n,2),S=R(F(y),2);za(S),D(y);var T=R(y,2),ne=R(F(T),2),re=F(ne);K(re,17,()=>r.filter(e=>!B(l).includes(e.hex)||e.hex===B(f)),e=>e.id,(e,t)=>{var n=WF();let r;var i=F(n),a=e=>{$(e,{name:`check`,size:12})};G(i,e=>{B(d)===B(t).hex&&e(a)}),D(n),z(()=>{r=q(n,1,`pswatch svelte-tzms08`,null,r,{on:B(d)===B(t).hex}),xa(n,`--dot:${B(t).hex??``}`),J(n,`title`,B(t).label),J(n,`aria-label`,B(t).label)}),V(`click`,n,()=>C(B(t).hex)),U(e,n)});var ie=R(re,2);let ae;var oe=F(ie);za(oe),D(ie),D(ne);var se=R(ne,2),ce=F(se,!0),le=R(ce),ue=e=>{U(e,zi(`· custom`))};G(le,e=>{B(b)&&e(ue)}),D(se),D(T);var de=R(T,2),fe=e=>{var t=GF(),n=L(t,!0);z(()=>W(n,B(v))),U(e,t)};G(de,e=>{B(v)&&e(fe)});var E=R(de,2),pe=F(E),me=e=>{U(e,KF())};G(pe,e=>{B(_)&&e(me)});var he=R(pe,2),ge=e=>{var t=qF();z(()=>t.disabled=B(m)),V(`click`,t,ee),U(e,t)};G(he,e=>{B(x)&&e(ge)});var _e=R(he,2),ve=L(_e,!0);D(E),z(e=>{xa(n,`--dot:${B(d)??``}`),W(a,e),W(p,B(u)||`Untitled profile`),J(h,`title`,B(c).workspace||``),W(g,B(c).workspace||`—`),ae=q(ie,1,`pswatch pcustom rainbow svelte-tzms08`,null,ae,{on:B(b)}),Ba(oe,B(d)),W(ce,B(d)),_e.disabled=B(m)||!B(x),W(ve,B(m)?`Saving…`:`Save changes`)},[()=>(B(u)||`?`).trim().charAt(0).toUpperCase()]),qa(S,()=>B(u),e=>N(u,e)),V(`input`,oe,w),V(`click`,_e,te),U(e,t)},ae=e=>{U(e,YF())};G(re,e=>{B(c)?e(ie):e(ae,-1)}),U(e,ne),k(),a()}ki([`click`,`input`]);var ZF=H(``),QF=H(`

What this profile is for — shapes how the assistant helps.

`,1);function $F(e,t){O(t,!1);let n=EF(),r=e=>{let t=n.s?.focuses||[],r=t.includes(e)?t.filter(t=>t!==e):[...t,e];n.run(()=>Q.setFocuses(r))};$a();var i=QF(),a=I(i);K(a,5,()=>yx,Qi,(e,t)=>{var i=ZF();let a;var o=F(i);$(o,{get name(){return B(t).icon},size:13});var s=R(o);D(i),z(e=>{a=q(i,1,`focuspill`,null,a,{on:e}),i.disabled=n.busy,W(s,` ${B(t).label??``}`)},[()=>(n.s?.focuses||[]).includes(B(t).id)]),V(`click`,i,()=>r(B(t).id)),U(e,i)}),D(a),tt(2),U(e,i),k()}ki([`click`]);function eI(e,t){O(t,!0);let n=()=>A(sT,`$llmConfigs`,r),[r,i]=Zt(),a=EF();io(()=>{cT().catch(()=>{})});let o=j(()=>n().configs),s=j(()=>n().envOverride),c=j(()=>a.s?.llm_active??null),l=j(()=>!a.s?.llm_override),u=()=>zs(`settings`,yo.MODELS);_M(e,{get configs(){return B(o)},get activeId(){return B(c)},get envOverride(){return B(s)},get busy(){return a.busy},down:!0,get inherited(){return B(l)},title:`Text model for this profile — takes effect next message`,brandFor:e=>e.type,labelFor:e=>`${xx[e.type]} · ${e.model}`,get usable(){return lT},defaultEntry:{label:`Use install default`,sub:`Follow the install-wide Active model`},emptyLabel:`No models configured`,onEmpty:u,onChoose:e=>a.run(()=>Q.setLlmOverride(e.id)),onDefault:()=>a.run(()=>Q.setLlmOverride(``)),onManage:u,manageLabel:`Manage models…`}),k(),i()}function tI(e,t){O(t,!0);let n=()=>A(Bj,`$liveConfigs`,r),[r,i]=Zt(),a=EF();io(()=>{Vj().catch(()=>{})});let o=j(()=>n().configs),s=j(()=>a.s?.live_active??null),c=j(()=>!a.s?.live_override),l=()=>zs(`settings`,yo.MODELS);_M(e,{get configs(){return B(o)},get activeId(){return B(s)},get busy(){return a.busy},down:!0,get inherited(){return B(c)},title:`Voice model for this profile — takes effect next voice session`,placeholder:`Choose a voice model`,brandFor:e=>e.provider,labelFor:e=>`${Ex[e.provider]} · ${e.model}${e.voice?` · ${e.voice}`:``}`,get usable(){return Hj},defaultEntry:{label:`Use install default`,sub:`Follow the install-wide Active voice`},emptyLabel:`Configure a voice model →`,onEmpty:l,onChoose:e=>a.run(()=>Q.setLiveOverride(e.id)),onDefault:()=>a.run(()=>Q.setLiveOverride(``)),onManage:l,manageLabel:`Manage voice models…`}),k(),i()}var nI=H(`
Text model
Drives chat replies for this profile.
Voice model
Used when you talk to this profile out loud.
`);function rI(e){var t=nI(),n=F(t);eI(R(F(n),4),{}),D(n);var r=R(n,2);tI(R(F(r),4),{}),D(r),D(t),U(e,t)}var iI=H(`

`),aI=H(`

This profile has no folders yet — add one to give it access.

`),oI=H(`· path not found`,1),sI=H(`
`),cI=H(``),lI=H(`
`,1),uI=H(`

Folders this profile may reach outside its default workspace

`,1);function dI(e,t){O(t,!0);let n=()=>A(No,`$profiles`,i),r=()=>A(vC,`$foldersStore`,i),[i,a]=Zt(),o=EF(),s=M(!1),c=M(``),l=M(!1),u=j(()=>n().activeId||hs()||``),d=(e,t)=>(e.grants||[]).find(e=>e.profile===t&&!e.chat_id&&!e.task_id),f=j(()=>r().folders.filter(e=>d(e,B(u))));io(()=>{r().loaded||yC()});async function p(e){N(c,``),N(s,!0);try{bC(await e())}catch(e){N(c,iS(e),!0)}N(s,!1)}function m(e,t){d(e,B(u))?.mode!==t&&p(()=>Q.setGrant(e.id,B(u),t))}async function h(e){N(c,``),N(s,!0);try{let t;try{let n=await Q.createFolder(e);bC(n),t=n.folder}catch(e){let n=e instanceof ug&&e.status===409?G_.safeParse(e.body):null;if(n?.success)t=n.data.existing;else throw e}t&&!d(t,B(u))&&bC(await Q.setGrant(t.id,B(u),`read`)),N(l,!1)}catch(e){N(c,iS(e),!0)}N(s,!1)}let g=e=>p(()=>Q.revokeGrant(e.id,B(u)));var _=uI(),v=R(I(_),2),y=e=>{var t=iI(),n=L(t,!0);z(()=>W(n,B(c))),U(e,t)};G(v,e=>{B(c)&&e(y)});var b=R(v,2),x=e=>{U(e,aI())};G(b,e=>{B(f).length||e(x)});var S=R(b,2);K(S,17,()=>B(f),e=>e.id,(e,t)=>{let n=j(()=>d(B(t),B(u)));var r=sI(),i=F(r);$(F(i),{name:`folder`,size:14}),D(i);var a=R(i,2),o=F(a),c=L(o,!0),l=R(o,2),f=F(l,!0),p=R(f),h=e=>{var t=oI();tt(),U(e,t)};G(p,e=>{B(t).exists||e(h)}),D(l),D(a);var _=R(a,2),v=F(_);{let e=j(()=>B(n)?.mode);wC(v,{get mode(){return B(e)},get disabled(){return B(s)},onchange:e=>m(B(t),e)})}var y=R(v,2);$(F(y),{name:`trash`,size:14}),D(y),D(_),D(r),z(()=>{W(c,B(t).name),J(l,`title`,B(t).path),W(f,B(t).path),y.disabled=B(s)}),V(`click`,y,()=>g(B(t))),U(e,r)});var C=R(S,2),w=e=>{var t=cI();V(`click`,t,()=>N(l,!0)),U(e,t)},T=e=>{var t=lI(),n=I(t);{let e=j(()=>o.s?.fs),t=j(()=>o.s?.fs?.cwd||``);xS(n,{get roots(){return B(e)},get start(){return B(t)},get busy(){return B(s)},onUse:h})}V(`click`,L(R(n,2)),()=>N(l,!1)),U(e,t)};G(C,e=>{B(l)?e(T,-1):e(w)}),U(e,_),k(),a()}ki([`click`]);var fI=H(``),pI=H(`

`),mI=H(` `),hI=H(`
`),gI=H(`
`,1),_I=H(`
`),vI=H(`
`),yI=H(``),bI=H(`
`),xI=H(`
`);function SI(e,t){O(t,!0);let n=M(!1),r=M(`registry`),i=M(!1),a=M(``),o=M(``),s=M(P([])),c=M(``),l=M(null),u=M(P([])),d=M(P(new Set)),f=()=>{N(s,[],!0),N(u,[],!0),N(d,new Set,!0),N(a,``)},p=e=>{N(r,e,!0),f()},m=()=>{N(n,!1),N(r,`registry`),N(o,``),N(c,``),N(l,null),f()};async function h(e){N(a,``),N(i,!0);try{return await e()}catch(e){return N(a,iS(e),!0),null}finally{N(i,!1)}}let g=()=>h(async()=>{N(s,(await t.installer.search(B(o))).results||[],!0)}),_=e=>h(async()=>{await t.installer.install({install_id:e.install_id}),t.onInstalled?.()}),v=()=>h(async()=>{let e=null;B(r)===`git`?e=await t.installer.discover(B(c)):B(l)&&(e=await t.installer.discoverUpload(B(l))),e&&(N(u,e.skills||[],!0),N(d,new Set(B(u).map(e=>e.name)),!0))}),y=e=>{let t=new Set(B(d));t.has(e)?t.delete(e):t.add(e),N(d,t,!0)},b=()=>h(async()=>{let e=[...B(d)];if(B(r)===`git`)await t.installer.install({git_url:B(c),names:e});else if(B(l))await t.installer.installUpload(B(l),e);else return;f(),N(c,``),N(l,null),t.onInstalled?.()}),x=e=>{N(l,e.currentTarget.files?.[0]||null,!0),N(u,[],!0),N(d,new Set,!0)};var S=Bi(),C=I(S),w=e=>{var t=fI();$(F(t),{name:`plus`,size:14}),tt(),D(t),V(`click`,t,()=>N(n,!0)),U(e,t)},T=e=>{var t=xI(),n=F(t),f=F(n),h=F(f);let S;var C=R(h,2);let w;var T=R(C,2);let ee;D(f);var te=R(f,2);D(n);var ne=R(n,2),re=e=>{var t=pI(),n=L(t,!0);z(()=>W(n,B(a))),U(e,t)};G(ne,e=>{B(a)&&e(re)});var ie=R(ne,2),ae=e=>{var t=gI(),n=I(t),r=F(n);za(r);var a=R(r,2);D(n),K(R(n,2),17,()=>B(s),e=>e.install_id,(e,t)=>{var n=hI(),r=F(n),a=F(r),o=F(a),s=R(o),c=e=>{var n=mI(),r=L(n);z(e=>W(r,`${e??``} installs`),[()=>B(t).installs.toLocaleString()]),U(e,n)};G(s,e=>{B(t).installs&&e(c)}),D(a);var l=L(R(a,2),!0);D(r);var u=R(r,2);D(n),z(()=>{W(o,`${B(t).name??``} `),W(l,B(t).description),u.disabled=B(i)}),V(`click`,u,()=>_(B(t))),U(e,n)}),z(e=>{r.disabled=B(i),a.disabled=e},[()=>B(i)||!B(o).trim()]),Oi(`submit`,n,e=>{e.preventDefault(),g()}),qa(r,()=>B(o),e=>N(o,e)),U(e,t)},oe=e=>{var t=_I(),n=F(t);za(n);var r=R(n,2);D(t),z(e=>{n.disabled=B(i),r.disabled=e},[()=>B(i)||!B(c).trim()]),Oi(`submit`,t,e=>{e.preventDefault(),v()}),qa(n,()=>B(c),e=>N(c,e)),U(e,t)},se=e=>{var t=vI(),n=F(t);let r;var a=F(n),o=L(R(a,2),!0);tt(2),D(n);var s=R(n,2);D(t),z(()=>{r=q(n,1,`skifile svelte-1l9ety1`,null,r,{nofile:!B(l),disabled:B(i)}),a.disabled=B(i),W(o,B(l)?B(l).name:`Choose a .md file or zipped skill folder…`),s.disabled=B(i)||!B(l)}),V(`change`,a,x),V(`click`,s,v),U(e,t)};G(ie,e=>{B(r)===`registry`?e(ae):B(r)===`git`?e(oe,1):e(se,-1)});var ce=R(ie,2),le=e=>{var t=bI(),n=F(t);K(n,17,()=>B(u),e=>e.name,(e,t)=>{var n=yI(),r=F(n);za(r);var a=R(r,2),o=L(a,!0),s=L(R(a,2),!0);D(n),z(e=>{Va(r,e),r.disabled=B(i),W(o,B(t).name),W(s,B(t).description)},[()=>B(d).has(B(t).name)]),V(`change`,r,()=>y(B(t).name)),U(e,n)});var r=R(n,2),a=L(r);D(t),z(()=>{r.disabled=B(i)||B(d).size===0,W(a,`Install ${B(d).size??``} skill${B(d).size===1?``:`s`}`)}),V(`click`,r,b),U(e,t)};G(ce,e=>{B(r)!==`registry`&&B(u).length>0&&e(le)}),D(t),z(()=>{S=q(h,1,`skitab svelte-1l9ety1`,null,S,{on:B(r)===`registry`}),w=q(C,1,`skitab svelte-1l9ety1`,null,w,{on:B(r)===`git`}),ee=q(T,1,`skitab svelte-1l9ety1`,null,ee,{on:B(r)===`upload`}),te.disabled=B(i)}),V(`click`,h,()=>p(`registry`)),V(`click`,C,()=>p(`git`)),V(`click`,T,()=>p(`upload`)),V(`click`,te,m),U(e,t)};G(C,e=>{B(n)?e(T,-1):e(w)}),U(e,S),k()}ki([`click`,`change`]);var CI=(e,t=ue)=>{var n=wI(),r=F(n),i=L(r,!0),a=R(r,2),o=L(a,!0);D(n),z(()=>{J(r,`id`,`psk-${t().name??``}`),W(i,t().name),J(a,`id`,`pskd-${t().name??``}`),W(o,t().description)}),U(e,n)},wI=H(`

`),TI=H(`
`),EI=H(`
off app-wide
`),DI=H(` `,1),OI=H(``),kI=H(` `,1),AI=H(`
`),jI=H(`

`),MI=H(`

Loading…

`),NI=H(`

No skills installed in this profile yet.

`),PI=H(`
Global & bundled

Shared skills inherited from the app. Turn one off to drop it from just this profile.

`,1),FI=H(`
This profile

Skills installed directly into this profile. Turn one off or delete it — only this profile is affected.

`,1),II=H(`

Skills this profile can use. Turn an inherited skill off for just this profile, or disable one it owns — other profiles are unaffected.

`,1);function LI(e,t){O(t,!0);let n=()=>A(Po,`$profileEpoch`,r),[r,i]=Zt(),a=(e,t=ue)=>{let n=j(()=>B(l)===t().name),r=j(()=>!B(n)&&B(d)!==t().name&&t().enabled),i=j(()=>t().origin===`profile`?t().available:!t().suppressed);var a=AI();let o;var s=F(a),c=e=>{var a=TI();let o;var s=F(a);CI(s,t);var c=R(s,2),l=F(c);let u;D(c),D(a),z(()=>{o=q(a,1,`sktop`,null,o,{clickable:B(r)}),J(a,`aria-checked`,B(i)),J(a,`aria-disabled`,!B(r)),J(a,`tabindex`,B(r)?0:-1),J(a,`aria-labelledby`,`psk-${t().name??``}`),J(a,`aria-describedby`,`pskd-${t().name??``}`),J(a,`title`,B(r)?B(i)?`Click to turn off for this profile`:`Click to turn on for this profile`:``),u=q(l,1,`setswitch`,null,u,{on:B(i),busy:B(n)})}),V(`click`,a,()=>{B(r)&&_(t())}),V(`keydown`,a,e=>{(e.key===`Enter`||e.key===` `)&&B(r)&&(e.preventDefault(),_(t()))}),U(e,a)},u=e=>{var n=EI();CI(F(n),t),tt(2),D(n),U(e,n)};G(s,e=>{t().enabled?e(c):e(u,-1)});var f=R(s,2),p=F(f),m=e=>{var r=DI(),i=I(r),a=L(i),o=R(i,2),s=R(o,2);z(()=>{W(a,`Delete ${t().name??``}?`),o.disabled=B(n),s.disabled=B(n)}),V(`click`,o,()=>g(t())),V(`click`,s,()=>N(d,``)),U(e,r)},h=e=>{var r=kI(),i=I(r);let a;var o=R(i),s=R(o),c=e=>{var r=OI();z(()=>r.disabled=B(n)),V(`click`,r,()=>N(d,t().name,!0)),U(e,r)};G(s,e=>{t().origin===`profile`&&e(c)}),z(()=>{a=q(i,1,`skdot`,null,a,{third:t().origin!==`bundled`}),W(o,` ${t().origin===`bundled`?`First-party · ships with the app`:t().origin===`profile`?`This profile · installed here`:`Installed · global`} `)}),U(e,r)};G(p,e=>{B(d)===t().name?e(m):e(h,-1)}),D(f),D(a),z(()=>o=q(a,1,`skcard`,null,o,{off:!t().available})),U(e,a)},o={search:Q.searchSkills,install:Q.installProfileSkill,discover:Q.discoverProfileSkills,discoverUpload:Q.discoverProfileSkillsUpload,installUpload:Q.installProfileSkillUpload},s=M(P([])),c=M(!0),l=M(``),u=M(``),d=M(``),f=async()=>{N(c,!0),N(u,``);try{N(s,(await Q.profileSkills()).skills,!0)}catch(e){N(u,iS(e),!0)}N(c,!1)};hr(()=>{n(),f()});async function p(e,t){N(u,``),N(l,e,!0);try{N(s,(await t()).skills,!0)}catch(e){N(u,iS(e),!0)}N(l,``)}let m=e=>p(e.name,()=>Q.suppressSkill(e.name,!e.suppressed)),h=e=>p(e.name,()=>Q.setProfileSkillState(e.name,!e.available)),g=e=>p(e.name,()=>Q.deleteProfileSkill(e.name)).then(()=>N(d,``)),_=e=>e.origin===`profile`?h(e):m(e),v=j(()=>B(s).filter(e=>e.origin===`profile`)),y=j(()=>B(s).filter(e=>e.origin!==`profile`));var b=II(),x=R(I(b),2),S=e=>{var t=jI(),n=L(t,!0);z(()=>W(n,B(u))),U(e,t)};G(x,e=>{B(u)&&e(S)});var C=R(x,2),w=e=>{U(e,MI())},T=e=>{var t=FI(),n=I(t),r=R(F(n),4);SI(F(r),{get installer(){return o},onInstalled:f}),D(r);var i=R(r,2),s=F(i),c=e=>{U(e,NI())},l=e=>{var t=Bi();K(I(t),17,()=>B(v),e=>e.name,(e,t)=>{a(e,()=>B(t))}),U(e,t)};G(s,e=>{B(v).length===0?e(c):e(l,-1)}),D(i),D(n);var u=R(n,2),d=e=>{var t=PI(),n=R(I(t),4);K(n,21,()=>B(y),e=>e.name,(e,t)=>{a(e,()=>B(t))}),D(n),U(e,t)};G(u,e=>{B(y).length>0&&e(d)}),U(e,t)};G(C,e=>{B(c)?e(w):e(T,-1)}),U(e,b),k(),i()}ki([`click`,`keydown`]);var RI=H(`

`),zI=H(`

Loading…

`),BI=H(`
`,1),VI=H(`
No memories yet

The assistant will gradually learn preferences and context specific to this profile as you chat. You can also add notes yourself.

`),HI=H(`Saved ✓`),UI=H(`
 
`,1),WI=H(`

What this profile has learned about you.

`,1);function GI(e,t){O(t,!0);let n=()=>A(Po,`$profileEpoch`,r),[r,i]=Zt(),a=M(``),o=M(``),s=M(!0),c=M(!1),l=M(!1),u=M(!1),d=M(``),f=j(()=>!!B(a).trim());async function p(){N(s,!0),N(d,``),N(c,!1);try{N(a,await Q.getMemory().then(e=>e.text)||``,!0)}catch(e){N(d,iS(e),!0)}N(s,!1)}hr(()=>{n(),p()});function m(){N(o,B(a),!0),N(c,!0),N(d,``)}function h(){N(c,!1),N(d,``)}async function g(){N(d,``),N(l,!0);try{await Q.setMemory(B(o)),N(a,B(o),!0),N(c,!1),N(u,!0),setTimeout(()=>N(u,!1),1500)}catch(e){N(d,iS(e),!0)}N(l,!1)}async function _(){N(d,``),N(l,!0);try{await Q.setMemory(``),N(a,``),N(c,!1)}catch(e){N(d,iS(e),!0)}N(l,!1)}var v=WI(),y=R(I(v),2),b=e=>{var t=RI(),n=L(t,!0);z(()=>W(n,B(d))),U(e,t)};G(y,e=>{B(d)&&e(b)});var x=R(y,2),S=e=>{U(e,zI())},C=e=>{var t=BI(),n=I(t);tn(n);var r=R(n,2),i=F(r),a=R(i,2),s=L(a,!0);D(r),z(()=>{i.disabled=B(l),a.disabled=B(l),W(s,B(l)?`Saving…`:`Save`)}),qa(n,()=>B(o),e=>N(o,e)),V(`click`,i,h),V(`click`,a,g),U(e,t)},w=e=>{var t=VI(),n=R(F(t),4);D(t),V(`click`,n,m),U(e,t)},T=e=>{var t=UI(),n=I(t),r=L(F(n),!0);D(n);var i=R(n,2),o=F(i),s=e=>{U(e,HI())};G(o,e=>{B(u)&&e(s)});var c=R(o,2),d=R(c,2);D(i),z(()=>{W(r,B(a)),c.disabled=B(l)}),V(`click`,c,_),V(`click`,d,m),U(e,t)};G(x,e=>{B(s)?e(S):B(c)?e(C,1):B(f)?e(T,-1):e(w,2)}),U(e,v),k(),i()}ki([`click`]);var KI=H(`
`),qI=H(``),JI=H(`
active
`);function YI(e,t){O(t,!0);let n=()=>A(No,`$profiles`,r),[r,i]=Zt(),a=j(()=>n().list||[]),o=j(()=>n().activeId||hs()),s=j(()=>B(a).find(e=>e.id===B(o))||null),c=[{id:`general`,label:`General`,comp:XF},{id:`focus`,label:`Focus areas`,comp:$F},{id:`model`,label:`Model`,comp:rI},{id:`folders`,label:`Folders`,comp:dI},{id:`skills`,label:`Skills`,comp:LI},{id:`memory`,label:`Memory`,comp:GI}],l=M(`general`),u=j(()=>(c.find(e=>e.id===B(l))||c[0]).comp);var d=JI(),f=F(d);$(F(f),{name:`chevron-left`,size:15}),tt(),D(f);var p=R(f,2),m=R(F(p),2),h=F(m),g=F(h);tt(),D(h);var _=R(h,2),v=e=>{var t=KI(),n=L(t,!0);z(()=>{J(t,`title`,B(s).workspace),W(n,B(s).workspace)}),U(e,t)};G(_,e=>{B(s)?.workspace&&e(v)}),D(m),D(p);var y=R(p,2);K(y,21,()=>c,Qi,(e,t)=>{var n=qI();let r;var i=L(n,!0);z(()=>{r=q(n,1,`ptab svelte-1durtx6`,null,r,{on:B(l)===B(t).id}),W(i,B(t).label)}),V(`click`,n,()=>N(l,B(t).id,!0)),U(e,n)}),D(y);var b=R(y,2);la(F(b),()=>B(u),(e,t)=>{t(e,{})}),D(b),D(d),z(()=>{xa(p,`--dot:${(B(s)?.accent||`var(--accent)`)??``}`),W(g,`${(B(s)?.name||`Profile`)??``} `)}),V(`click`,f,function(...e){t.onBack?.apply(this,e)}),U(e,d),k(),i()}ki([`click`]);var XI=H(`
Profiles

Manage how the assistant behaves in different contexts.

`,1);function ZI(e,t){O(t,!0);let n=()=>A(No,`$profiles`,r),[r,i]=Zt(),a=M(!1),o=j(()=>n().activeId||hs());function s(e){e.id!==B(o)&&ux(e.id),N(a,!0)}var c=Bi(),l=I(c),u=e=>{YI(e,{onBack:()=>N(a,!1)})},d=e=>{var t=XI();UF(R(I(t),4),{onSelect:s}),U(e,t)};G(l,e=>{B(a)?e(u):e(d,-1)}),U(e,c),k(),i()}var QI=Object.freeze({UNAUTHORIZED:`unauthorized`,UNREACHABLE:`unreachable`,NO_LIST_ENDPOINT:`no_list_endpoint`,NOT_PROBEABLE:`not_probeable`}),$I={ollama:{keyless:!0,browser:!1},gemini:{keyless:!1,browser:!0},openai:{keyless:!1,browser:!0},openai_responses:{keyless:!1,browser:!0},anthropic:{keyless:!1,browser:!0}};function eL(e,{hasCredential:t=!1,hasEndpoint:n=!1,hasPastedKey:r=!1}={}){let i=$I[e];return i?r&&i.browser?`browser`:i.keyless||t||n?`gateway`:``:``}function tL(e){return e===`openai_subscription`?QI.NOT_PROBEABLE:``}var nL=[`embedding`,`tts`,`whisper`,`transcribe`,`dall-e`,`moderation`,`audio`,`realtime`,`image`,`sora`],rL={openai:!0,openai_responses:!0,openai_subscription:!0};function iL(e,t){if(!rL[e])return!1;let n=String(t||``).toLowerCase();return nL.some(e=>n.includes(e))}var aL=(e,t)=>({id:e.id,label:e.label||e.id,price:Px(e),context:Fx(e),unverified:t}),oL=(e,t)=>{let n=e.trim().toLowerCase();return!n||t.id.toLowerCase().includes(n)||(t.label||``).toLowerCase().includes(n)};function sL(e,t){let n=new Set,r=[];for(let i of t){let t=String(i||``).trim();!t||n.has(t)||iL(e,t)||(n.add(t),r.push(Ax(t)||{id:t,label:t}))}let i=jx(e),a=e=>i.some(t=>t===e)?+!e.featured:2;return r.map((e,t)=>({entry:e,rank:a(e),i:t})).sort((e,t)=>e.rank-t.rank||e.i-t.i).map(e=>e.entry)}function cL({type:e,query:t=``,catalog:n=null}){let r=!n;return(n?sL(e,n):(()=>{let t=jx(e);return[...t.filter(e=>e.featured),...t.filter(e=>!e.featured)]})()).filter(e=>oL(t,e)).map(e=>aL(e,r))}var lL={gemini:`https://generativelanguage.googleapis.com/v1beta`,openai:`https://api.openai.com/v1`,openai_responses:`https://api.openai.com/v1`,anthropic:`https://api.anthropic.com/v1`},uL=`2023-06-01`;function dL({type:e,baseUrl:t=``,key:n=``}){let r=String(n||``).trim();if(!r||!lL[e])return null;let i=(String(t||``).trim()||lL[e]).replace(/\/+$/,``);return e===`gemini`?{url:`${i}/models?key=${encodeURIComponent(r)}`,headers:{}}:e===`anthropic`?{url:`${i}/models`,headers:{"x-api-key":r,"anthropic-version":uL,"anthropic-dangerous-direct-browser-access":`true`}}:{url:`${i}/models`,headers:{Authorization:`Bearer ${r}`}}}function fL(e,t){if(!t||typeof t!=`object`)return null;let n=t;return e===`gemini`?Array.isArray(n.models)?n.models.filter(e=>!!e&&typeof e==`object`).filter(e=>{let t=e.supportedGenerationMethods;return!Array.isArray(t)||!t.length||t.includes(`generateContent`)}).map(e=>String(e.name||``).replace(/^models\//,``)).filter(Boolean):null:Array.isArray(n.data)?n.data.filter(e=>!!e&&typeof e==`object`).map(e=>String(e.id||``)).filter(Boolean):null}function pL(e){return e===401||e===403?QI.UNAUTHORIZED:e===429||e>=500?QI.UNREACHABLE:e>=400?QI.NO_LIST_ENDPOINT:``}function mL(e,t){let n=xx[t]||`the provider`;return e===QI.UNAUTHORIZED?`${n} rejected this credential, so its model list couldn't be read. Known names are offered below.`:e===QI.UNREACHABLE?`Couldn't reach ${n} for its model list. Known names are offered below.`:e===QI.NO_LIST_ENDPOINT?`This endpoint answered but publishes no model list. Type the name it expects — known names are offered below.`:e===QI.NOT_PROBEABLE?`${n} has no model list to read. Known names are offered below.`:``}async function hL({type:e,baseUrl:t=``,key:n=``,refresh:r=!1}){let i=dL({type:e,baseUrl:t,key:n});if(!i)return{models:[],reason:QI.NOT_PROBEABLE};let a;try{a=await fetch(i.url,{headers:i.headers,cache:r?`reload`:`default`})}catch{return{models:[],reason:QI.UNREACHABLE}}let o=pL(a.status);if(o)return{models:[],reason:o};let s;try{s=await a.json()}catch{return{models:[],reason:QI.NO_LIST_ENDPOINT}}let c=fL(e,s);return c?{models:c,reason:``}:{models:[],reason:QI.NO_LIST_ENDPOINT}}var gL=Wt({secrets:[],loaded:!1});async function _L(){try{let e=await Q.secrets();gL.set({secrets:e.secrets||[],loaded:!0})}catch{gL.set({secrets:[],loaded:!0})}}async function vL(e){try{return(await Q.createSecret(e)).secret}catch(e){let t=e instanceof ug&&e.status===409?Ng.safeParse(e.body):null;if(t?.success)return t.data.existing;throw e}}function yL(e,t){let n=(t||``).trim().slice(-4);return`${(e||``).trim()||`API`} key …${n}`}function bL(e,t){return t?[...e.filter(e=>e.provider===t),...e.filter(e=>e.provider!==t)]:e}var xL={label:`Temperature`,description:`Lower is more predictable, higher is more varied.`},SL={label:`Output limit`,description:`The most tokens one answer may use.`},CL={"openai.reasoning_effort":{label:`Reasoning effort`,description:`How much the model thinks before it answers.`},"openai.temperature":xL,"openai.max_tokens":SL,"openai_responses.temperature":xL,"openai_responses.max_output_tokens":SL,"gemini.thinking_level":{label:`Thinking level`,description:`How much Gemini thinks before it answers.`},"gemini.temperature":xL,"gemini.max_output_tokens":{label:`Output limit`,description:`The most tokens one answer may use, thinking included.`},"anthropic.temperature":xL,"anthropic.max_tokens":SL,"ollama.temperature":xL,"ollama.max_tokens":SL};function wL(e,t){return CL[`${e}.${t}`]||{label:t,description:``}}var TL={xhigh:`Extra high`};function EL(e){return TL[e]||e.charAt(0).toUpperCase()+e.slice(1)}function DL(e,t){let n=t.trim();if(n)return e===`choice`?n:Number(n)}function OL(e){try{let t=JSON.parse(e);if(!(t&&typeof t==`object`&&!Array.isArray(t)))return new Set;let n=t,r=n.extra_body,i=r&&typeof r==`object`&&!Array.isArray(r)?Object.keys(r):[];return new Set([...Object.keys(n),...i])}catch{return new Set}}var kL=`Replaces the built-in DuckDuckGo search for this model.`,AL=`Replaces the built-in page fetcher for this model.`,jL=`Your local sandbox stays available — it is what can reach your own files.`,ML={"anthropic.web_search":{label:`Web search`,description:`Anthropic searches the web and cites its sources.`,note:kL},"anthropic.web_fetch":{label:`Web fetch`,description:`Anthropic fetches a page itself, with citations.`,note:AL},"anthropic.code_execution":{label:`Code execution`,description:`Runs code in Anthropic's own sandbox.`,note:jL},"openai_responses.web_search":{label:`Web search`,description:`OpenAI searches the web and cites its sources.`,note:kL},"openai_responses.code_execution":{label:`Code interpreter`,description:`Runs code in an OpenAI container.`,note:jL},"gemini.web_search":{label:`Google Search grounding`,description:`Gemini grounds its answers in Google Search.`,note:kL},"gemini.web_fetch":{label:`URL context`,description:`Gemini reads a linked page itself.`,note:AL},"gemini.code_execution":{label:`Code execution`,description:`Runs code on Google's servers.`,note:jL}};function NL(e,t){return ML[`${e}.${t}`]||{label:t,description:``}}var PL={web_search:`search`,web_fetch:`fetch`,code_execution:`code`};function FL(e){return PL[e]||e}var IL={max_uses:{label:`Use limit`,description:`The most uses per request to the model.`},allowed_domains:{label:`Only these domains`,description:`Comma-separated.`},blocked_domains:{label:`Never these domains`,description:`Comma-separated.`}};function LL(e){return IL[e]||{label:e,description:``}}function RL(e){return Array.isArray(e)?e.join(`, `):e==null?``:String(e)}function zL(e,t){if(e===`domains`){let e=t.split(`,`).map(e=>e.trim()).filter(Boolean);return e.length?e:void 0}return DL(e,t)}var BL=[`openai_responses`,`openai`,`anthropic`],VL={openai:`openai_responses`};function HL(e){return BL.includes(e)}function UL(e,t){return!!t?.trim()&&HL(e)}function WL(e){return VL[e]||e}var GL=H(`
Reading the provider's model list…
`),KL=H(` `),qL=H(`unverified`),JL=H(` `),YL=H(``),XL=H(`
`),ZL=H(`
`);function QL(e,t){O(t,!0);let n=ro(t,`value`,15,``),r=ro(t,`id`,3,`lf-model`),i=ro(t,`placeholder`,3,``),a=ro(t,`catalog`,3,null),o=ro(t,`loading`,3,!1),s=ro(t,`onFirstFocus`,3,null),c=M(!1),l=M(0),u=P([]),d=!1,f=j(()=>cL({type:t.type,query:n(),catalog:a()})),p=e=>`${r()}-opt-${e}`;hr(()=>{B(f),N(l,0)});function m(e){u[e]?.scrollIntoView({block:`nearest`})}function h(e){n(e.id),N(c,!1)}function g(e){if(e.key===`Escape`){B(c)&&(e.preventDefault(),e.stopPropagation(),N(c,!1));return}if(e.key===`ArrowDown`&&!B(c)){e.preventDefault(),N(c,!0);return}if(!(!B(c)||!B(f).length)){if(e.key===`ArrowDown`){e.preventDefault(),N(l,(B(l)+1)%B(f).length),m(B(l));return}if(e.key===`ArrowUp`){e.preventDefault(),N(l,(B(l)-1+B(f).length)%B(f).length),m(B(l));return}if(e.key===`Home`){e.preventDefault(),N(l,0),m(0);return}if(e.key===`End`){e.preventDefault(),N(l,B(f).length-1),m(B(l));return}e.key===`Enter`&&(e.preventDefault(),h(B(f)[B(l)]))}}var _=ZL(),v=F(_);za(v);var y=R(v,2),b=e=>{var t=XL(),n=F(t),i=e=>{U(e,GL())};G(n,e=>{o()&&e(i)}),K(R(n,2),19,()=>B(f),e=>e.id,(e,t,n)=>{var r=YL();let i;var a=F(r),o=L(a,!0),s=R(a,2),c=e=>{var n=KL(),r=L(n,!0);z(()=>W(r,B(t).id)),U(e,n)};G(s,e=>{B(t).label!==B(t).id&&e(c)});var d=R(s,2),f=F(d),m=e=>{U(e,qL())};G(f,e=>{B(t).unverified&&e(m)});var g=R(f,2),_=e=>{var n=JL(),r=L(n,!0);z(()=>W(r,B(t).price)),U(e,n)};G(g,e=>{B(t).price&&e(_)});var v=R(g,2),y=e=>{var n=JL(),r=L(n,!0);z(()=>W(r,B(t).context)),U(e,n)};G(v,e=>{B(t).context&&e(y)}),D(d),D(r),Qa(r,(e,t)=>u[t]=e,e=>u?.[e],()=>[B(n)]),z(e=>{i=q(r,1,`llmcomborow svelte-19tyyb4`,null,i,{sel:B(n)===B(l)}),J(r,`id`,e),J(r,`aria-selected`,B(n)===B(l)),W(o,B(t).label)},[()=>p(B(n))]),V(`mousedown`,r,e=>{e.preventDefault(),h(B(t))}),Oi(`mouseenter`,r,()=>N(l,B(n),!0)),U(e,r)}),D(t),z(()=>J(t,`id`,`${r()}-list`)),U(e,t)};G(y,e=>{B(c)&&(B(f).length||o())&&e(b)}),D(_),z(e=>{J(v,`id`,r()),J(v,`placeholder`,i()),J(v,`aria-expanded`,B(c)&&B(f).length>0),J(v,`aria-controls`,`${r()}-list`),J(v,`aria-activedescendant`,e)},[()=>B(c)&&B(f).length?p(B(l)):void 0]),Oi(`focus`,v,()=>{N(c,!0),d||(d=!0,s()?.())}),V(`input`,v,()=>N(c,!0)),Oi(`blur`,v,()=>N(c,!1)),V(`keydown`,v,g),qa(v,n),U(e,_),k()}ki([`input`,`keydown`,`mousedown`]);var $L=H(``),eR=H(`
`),tR=H(`
`),nR=H(`
`),rR=H(`
`,1),iR=H(`
`),aR=H(`
`),oR=H(`
`),sR=H(`
`),cR=H(`
`,1),lR=H(`
`),uR=H(`
`),dR=H(`
Sign in Signs requests with your ChatGPT/Codex subscription instead of an API key — unofficial, may break OpenAI's Terms of Service.
`),fR=H(`Requires the claude-agent-acp adapter on PATH (npm i -g @agentclientprotocol/claude-agent-acp) and a logged-in Claude Code CLI.`),pR=H(`Requires the codex-acp adapter on PATH (npm i -g @agentclientprotocol/codex-acp) and a logged-in Codex CLI.`),mR=H(`
Authentication
`),hR=H(`This model referenced a deleted secret.`),gR=H(`
`),_R=H(``),vR=H(``),yR=H(`Overridden by Advanced (JSON) below.`),bR=H(`
`),xR=H(` `),SR=H(` `,1),CR=H(`
`),wR=H(` `,1),TR=H(`
Provider tools
`),ER=H(``),DR=H(`
`),OR=H(`

`),kR=H(`testing…`),AR=H(` `),jR=H(``),MR=H(`
`);function NR(e,t){O(t,!0);let n=()=>A(sT,`$llmConfigs`,a),r=()=>A(Go,`$codexOpen`,a),i=()=>A(gL,`$secretsStore`,a),[a,o]=Zt(),s=EF(),c=ro(t,`activate`,3,!1),l=BL.map(e=>({id:e,label:xx[e]})),u=fi(()=>{let e=!!(t.config.options&&Object.keys(t.config.options).length);return{name:t.config.name||``,type:t.config.type||`gemini`,model:t.config.model||``,baseUrl:t.config.base_url||``,host:t.config.host||``,secretId:t.config.secret_missing?``:t.config.secret_id||``,signedIn:!!t.config.signed_in,hasOptions:e,advText:e?JSON.stringify(t.config.options,null,2):``,builtinTools:{...t.config.builtin_tools||{}},params:{...t.config.params||{}}}}),d=M(P(u.name)),f=M(P(u.type)),p=M(P(u.model)),m=M(P(u.baseUrl)),h=M(P(u.host)),g=M(P(u.secretId)),_=M(``),v=M(P(u.hasOptions)),y=M(P(u.advText)),b=M(P(u.builtinTools)),x=j(()=>n().builtinByType?.[B(f)]||[]);function S(e,t){let n={...B(b)};t?n[e]=n[e]||{}:delete n[e],N(b,n,!0)}let C=j(()=>n().builtinOptionsByType?.[B(f)]||{});function w(e,t,n,r){let i={...B(b)[e]},a=zL(n,r);a===void 0?delete i[t]:i[t]=a,N(b,{...B(b),[e]:i},!0)}let T=M(P(u.params)),ee=j(()=>n().paramsByType?.[B(f)]||[]);function te(e,t,n){let r={...B(T)},i=DL(t,n);i===void 0?delete r[e]:r[e]=i,N(T,r,!0)}let ne=j(()=>B(v)?OL(B(y)):new Set);io(_L);let re=M(!1),ie=M(``),ae=M(!1),oe=M(null),se=M(P(u.signedIn));hr(()=>{let e=r();B(f)===`openai_subscription`&&!e&&Q.codexStatus().then(e=>{N(se,!!e.signed_in)}).catch(()=>{})});let ce={openai:`OPENAI_API_KEY`,openai_responses:`OPENAI_API_KEY`,anthropic:`ANTHROPIC_API_KEY`,gemini:`GEMINI_API_KEY`},le={openai:`openai`,openai_responses:`openai`,anthropic:`anthropic`,gemini:`gemini`},ue=j(()=>bL(i().secrets,le[B(f)]||``)),de=j(()=>{if(B(f)===`openai_subscription`)return`Requests use your ChatGPT/Codex subscription — no API key is involved.`;if(B(f)===`claude_code`)return`Runs on your Claude Code CLI login (claude-agent-acp) — no API key is involved.`;if(B(f)===`codex`)return`Runs on your Codex CLI login (codex-acp) — no API key is involved.`;if(B(f)===`ollama`)return`Ollama is local — no API key is used.`;let e=ce[B(f)],t=s?.s?.keys?.[le[B(f)]||``];if(B(_).trim())return`A new Secret will be created from this key on save (rename it later in Settings → Secrets).`;if(B(g)){let t=i().secrets.find(e=>e.id===B(g));return t?`Uses the "${t.name}" secret${B(m).trim()?` (sent to the custom endpoint)`:``}. It overrides ${e}.`:`The referenced secret was deleted — falls back to the provider default or env key.`}return B(m).trim()?`Custom endpoint with no secret — a placeholder is sent (your ${e} is never sent to non-${B(f).startsWith(`openai`)?`OpenAI`:`Anthropic`} endpoints).`:t?.set?`No secret selected — uses your ${e} (${t.hint||`set`}).`:`No key available — pick or paste one above, or set ${e}.`}),fe=j(()=>B(f)===`codex`||B(f)===`claude_code`),E=e=>kx(e)||e;function pe(e){if(e===B(f))return;E(e)!==E(B(f))&&N(p,``);let t=n().builtinByType?.[e]||[];N(b,Object.fromEntries(Object.entries(B(b)).filter(([e])=>t.includes(e))),!0);let r=(n().paramsByType?.[e]||[]).map(e=>e.id);N(T,Object.fromEntries(Object.entries(B(T)).filter(([e])=>r.includes(e))),!0),N(f,e,!0)}let me=j(()=>UL(B(f),B(m)));function he(){B(m).trim()||pe(WL(B(f))),De()}let ge=j(()=>!!B(g)||!!s?.s?.keys?.[le[B(f)]||``]?.set),_e=M(``),ve=j(()=>eL(B(f),{hasCredential:B(ge),hasEndpoint:!!B(m).trim(),hasPastedKey:!!B(_e)})),ye=j(()=>tL(B(f))),be=M(!1),xe=M(!1),Se=M(null),Ce=M(``),we=j(()=>B(be)&&!B(xe)?mL(B(Ce),B(f)):``),Te=0;async function Ee(e=!1){if(!B(ve)){N(Se,null),N(Ce,``);return}N(be,!0),N(xe,!0);let t=++Te,n;try{let t=B(ve)===`browser`?await hL({type:B(f),baseUrl:B(m).trim(),key:B(_e),refresh:e}):await Q.llmCatalog({type:B(f),base_url:B(m).trim(),host:B(h).trim(),secret_id:B(g)},e),r=t.reason||``;n={reason:r,catalog:r?null:(t.models||[]).map(e=>typeof e==`string`?e:e.id)}}catch{n={reason:`unreachable`,catalog:null}}t===Te&&(N(Ce,n.reason,!0),N(Se,n.catalog,!0),N(xe,!1))}hr(()=>{B(f),B(g),B(_e),B(ve),fi(()=>B(be))&&fi(()=>Ee())});function De(){B(be)&&Ee()}function Oe(){N(_e,B(_).trim(),!0)}let ke=j(()=>B(f)===`codex`?`codex`:B(f)===`claude_code`?`claude`:``),Ae=P({});function je(e,t=!1){Ae[e]=`loading`,Q.codingModels(e,t).then(t=>{Ae[e]={models:t.models||[],current:t.current||``,reason:t.reason||``}}).catch(()=>{Ae[e]={models:[],current:``,reason:`probe_failed`}})}hr(()=>{B(ke)&&Ae[B(ke)]===void 0&&je(B(ke))});let Me=j(()=>!!B(ke)&&Ae[B(ke)]===`loading`),Ne=j(()=>typeof Ae[B(ke)]==`object`?Ae[B(ke)]:null),Pe=j(()=>B(Ne)?.models??[]),Fe=j(()=>B(Ne)?.current?`CLI default (${B(Ne).current})`:`CLI default`),Ie={claude:`@agentclientprotocol/claude-agent-acp`,codex:`@agentclientprotocol/codex-acp`},Le=j(()=>!B(ke)||B(Me)||B(Pe).length?``:B(Ne)?.reason===`adapter_missing`?`No model list: the ACP adapter isn't installed (npm i -g ${Ie[B(ke)]}). Leave the field empty to use the CLI's own model.`:B(Ne)?.reason===`bridge`?`No model list in bridge mode — the CLI runs on the host, out of reach of this container. Leave the field empty to use the CLI's own model.`:B(Ne)?.reason?`Couldn't read the CLI's model list. Leave the field empty to use the CLI's own model, or type a name it accepts.`:``),Re=j(()=>B(p)&&!B(Pe).some(e=>e.id===B(p))?[{id:B(p),name:B(p),description:``},...B(Pe)]:B(Pe)),ze=j(()=>B(ke)===`codex`?Jx(B(Pe)):[]),Be=j(()=>Wx(B(p))),Ve=j(()=>!B(Be).family||B(ze).some(e=>e.family===B(Be).family)?B(ze):[{family:B(Be).family,label:B(Be).family,efforts:B(Be).effort?[{value:B(Be).effort,label:Kx(B(Be).effort)}]:[]},...B(ze)]),He=j(()=>B(Ve).find(e=>e.family===B(Be).family)?.efforts||[]);function Ue(e){let t=(B(Ve).find(t=>t.family===e)?.efforts||[]).some(e=>e.value===B(Be).effort)?B(Be).effort:``;N(p,Gx(e,t),!0)}function We(){let e={},n=B(y).trim();if(B(v)&&n){try{e=JSON.parse(n)}catch{return N(ie,`Advanced: not valid JSON.`),null}if(!e||typeof e!=`object`||Array.isArray(e))return N(ie,`Advanced: must be a JSON object, e.g. {"temperature": 0.7}.`),null}return N(ie,``),{id:t.config.id,name:B(d).trim(),type:B(f),model:B(p).trim(),base_url:B(m).trim(),host:B(h).trim(),secret_id:B(g),api_key:B(_).trim()||null,options:e,builtin_tools:B(b),params:B(T)}}async function Ge(e=!1){let n=We();if(n){N(re,!0);try{if(B(_).trim()){let e=await vL({name:yL(B(d),B(_)),value:B(_).trim()});n.secret_id=e.id,N(g,e.id,!0),N(_,``),N(_e,``),_L()}delete n.api_key,await Q.saveLlmConfig({...n,activate:c()||e}),t.onSaved()}catch(e){N(ie,iS(e),!0)}N(re,!1)}}async function Ke(){let e=We();if(e){N(ae,!0),N(oe,null);try{N(oe,await Q.testLlmConfigDraft(e),!0)}catch(e){N(oe,{ok:!1,error:iS(e)},!0)}N(ae,!1)}}var qe=MR(),Je=F(qe),Ye=R(F(Je),2);za(Ye),D(Je);var Xe=R(Je,2),Ze=e=>{var t=eR(),n=R(F(t),2);K(n,21,()=>l,Qi,(e,t)=>{var n=$L(),r=L(n,!0),i={};z(()=>{W(r,B(t).label),i!==(i=B(t).id)&&(n.value=(n.__value=i)??``)}),U(e,n)}),D(n);var r;Ea(n),D(t),z(()=>{r!==(r=B(f))&&(n.value=(n.__value=r)??``,Ta(n,r))}),V(`change`,n,e=>pe(e.currentTarget.value)),U(e,t)};G(Xe,e=>{B(me)&&e(Ze)});var Qe=R(Xe,2),$e=e=>{U(e,tR())},et=e=>{var t=rR(),n=I(t),r=R(F(n),2),i=F(r),a=L(i,!0);i.value=i.__value=``,K(R(i),17,()=>B(Ve),e=>e.family,(e,t)=>{var n=$L(),r=L(n,!0),i={};z(()=>{W(r,B(t).label),i!==(i=B(t).family)&&(n.value=(n.__value=i)??``)}),U(e,n)}),D(r);var o;Ea(r),D(n);var s=R(n,2),c=e=>{var t=nR(),n=R(F(t),2),r=F(n);r.value=r.__value=``,K(R(r),17,()=>B(He),e=>e.value,(e,t)=>{var n=$L(),r=L(n,!0),i={};z(()=>{W(r,B(t).label),i!==(i=B(t).value)&&(n.value=(n.__value=i)??``)}),U(e,n)}),D(n);var i;Ea(n),D(t),z(()=>{i!==(i=B(Be).effort)&&(n.value=(n.__value=i)??``,Ta(n,i))}),V(`change`,n,e=>N(p,Gx(B(Be).family,e.currentTarget.value),!0)),U(e,t)};G(s,e=>{B(He).length&&e(c)}),z(()=>{W(a,B(Fe)),o!==(o=B(Be).family)&&(r.value=(r.__value=o)??``,Ta(r,o))}),V(`change`,r,e=>Ue(e.currentTarget.value)),U(e,t)},tt=e=>{var t=iR(),n=R(F(t),2),r=F(n),i=L(r,!0);r.value=r.__value=``,K(R(r),17,()=>B(Re),e=>e.id,(e,t)=>{var n=$L(),r=L(n,!0),i={};z(()=>{J(n,`title`,B(t).description),W(r,B(t).name),i!==(i=B(t).id)&&(n.value=(n.__value=i)??``)}),U(e,n)}),D(n),Ea(n),D(t),z(()=>W(i,B(Fe))),Da(n,()=>B(p),e=>N(p,e)),U(e,t)},nt=e=>{var t=aR(),n=R(F(t),2);za(n),D(t),qa(n,()=>B(p),e=>N(p,e)),U(e,t)},rt=e=>{var t=cR(),n=I(t);QL(R(F(n),2),{get type(){return B(f)},placeholder:`e.g. gemini-3.6-flash`,get catalog(){return B(Se)},get loading(){return B(xe)},onFirstFocus:()=>Ee(),get value(){return B(p)},set value(e){N(p,e,!0)}}),D(n);var r=R(n,2),i=e=>{var t=oR(),n=L(F(t),!0);D(t),z(e=>W(n,e),[()=>mL(B(ye),B(f))]),U(e,t)},a=e=>{var t=sR(),n=F(t),r=F(n),i=e=>{var t=zi();z(()=>W(t,B(we))),U(e,t)};G(r,e=>{B(we)&&e(i)});var a=R(r,2);D(n),D(t),V(`click`,a,()=>Ee(!0)),U(e,t)};G(r,e=>{B(ye)?e(i):B(ve)&&B(be)&&e(a,1)}),U(e,t)};G(Qe,e=>{B(Me)?e($e):B(f)===`codex`&&B(ze).length?e(et,1):B(f)===`claude_code`&&B(Re).length?e(tt,2):B(ke)?e(nt,3):e(rt,-1)});var it=R(Qe,2),at=e=>{var t=sR(),n=F(t),r=F(n),i=e=>{var t=zi();z(()=>W(t,B(Le))),U(e,t)};G(r,e=>{B(Le)&&e(i)});var a=R(r,2);D(n),D(t),V(`click`,a,()=>je(B(ke),!0)),U(e,t)};G(it,e=>{B(ke)&&!B(Me)&&e(at)});var ot=R(it,2),st=e=>{var t=lR(),n=R(F(t),2);za(n),D(t),Oi(`blur`,n,he),qa(n,()=>B(m),e=>N(m,e)),U(e,t)},ct=j(()=>HL(B(f))),lt=e=>{var t=uR(),n=R(F(t),2);za(n),D(t),Oi(`blur`,n,De),qa(n,()=>B(h),e=>N(h,e)),U(e,t)};G(ot,e=>{B(ct)?e(st):B(f)===`ollama`&&e(lt,1)});var ut=R(ot,2),dt=e=>{var t=dR(),n=R(F(t),4),r=F(n),i=R(r,2);let a;var o=L(i,!0);D(n);var c=L(R(n,2),!0);D(t),z(()=>{a=q(i,1,`llmtest`,null,a,{ok:B(se),bad:!B(se)}),W(o,B(se)?`Signed in`:`Not signed in`),W(c,B(de))}),V(`click`,r,()=>s.openCodex()),U(e,t)},ft=e=>{var t=mR(),n=R(F(t),2),r=L(n,!0),i=R(n,2),a=e=>{U(e,fR())},o=e=>{U(e,pR())};G(i,e=>{B(f)===`claude_code`?e(a):e(o,-1)}),D(t),z(()=>W(r,B(de))),U(e,t)},pt=e=>{var n=gR(),r=R(F(n),2),i=F(r),a=F(i);a.value=a.__value=``,K(R(a),17,()=>B(ue),e=>e.id,(e,t)=>{var n=$L(),r=L(n),i={};z(()=>{W(r,`${B(t).name??``} ${B(t).hint??``}${B(t).default?` · default`:``}`),i!==(i=B(t).id)&&(n.value=(n.__value=i)??``)}),U(e,n)}),D(i),Ea(i),D(r);var o=R(r,2),s=F(o);za(s),D(o);var c=R(o,2),l=e=>{U(e,hR())};G(c,e=>{t.config.secret_missing&&e(l)});var u=L(R(c,2),!0);D(n),z(e=>{i.disabled=e,W(u,B(de))},[()=>!!B(_).trim()]),Da(i,()=>B(g),e=>N(g,e)),Oi(`blur`,s,Oe),qa(s,()=>B(_),e=>N(_,e)),U(e,n)};G(ut,e=>{B(f)===`openai_subscription`?e(dt):B(f)===`claude_code`||B(f)===`codex`?e(ft,1):e(pt,-1)});var mt=R(ut,2);K(mt,17,()=>B(ee),e=>e.id,(e,t)=>{let n=j(()=>wL(B(f),B(t).id));var r=bR(),i=F(r),a=F(i),o=L(R(a),!0);D(i);var s=R(i,2),c=e=>{var n=_R(),r=F(n);r.value=r.__value=``,K(R(r),16,()=>B(t).choices,e=>e,(e,t)=>{var n=$L(),r=L(n,!0),i={};z(e=>{W(r,e),i!==(i=t)&&(n.value=(n.__value=i)??``)},[()=>EL(t)]),U(e,n)}),D(n);var i;Ea(n),z(e=>{J(n,`id`,`lf-param-${B(t).id??``}`),i!==(i=e)&&(n.value=(n.__value=i)??``,Ta(n,i))},[()=>String(B(T)[B(t).id]??``)]),V(`change`,n,e=>te(B(t).id,B(t).kind,e.currentTarget.value)),U(e,n)},l=e=>{var n=vR();za(n),z(e=>{J(n,`id`,`lf-param-${B(t).id??``}`),J(n,`min`,B(t).minimum??void 0),J(n,`max`,B(t).maximum??void 0),J(n,`step`,B(t).kind===`int`?1:.1),Ba(n,e)},[()=>String(B(T)[B(t).id]??``)]),V(`change`,n,e=>te(B(t).id,B(t).kind,e.currentTarget.value)),U(e,n)};G(s,e=>{B(t).kind===`choice`?e(c):e(l,-1)});var u=R(s,2),d=e=>{U(e,yR())},p=j(()=>B(ne).has(B(t).id));G(u,e=>{B(p)&&e(d)}),D(r),z(()=>{J(i,`for`,`lf-param-${B(t).id??``}`),W(a,`${B(n).label??``} `),W(o,B(n).description)}),U(e,r)});var ht=R(mt,2),gt=e=>{var t=TR(),n=F(t),r=L(R(F(n)));D(n),K(R(n,2),16,()=>B(x),e=>e,(e,t)=>{let n=j(()=>NL(B(f),t));var r=wR(),i=I(r),a=F(i);za(a);var o=R(a,2),s=F(o),c=L(s,!0),l=R(s,2),u=L(l,!0),d=R(l,2),p=e=>{var t=xR(),r=L(t,!0);z(()=>W(r,B(n).note)),U(e,t)};G(d,e=>{B(b)[t]&&B(n).note&&e(p)}),D(o),D(i);var m=R(i,2),h=e=>{var n=CR();K(n,21,()=>B(C)[t],e=>e.id,(e,n)=>{let r=j(()=>LL(B(n).id));var i=SR(),a=I(i),o=F(a),s=L(R(o),!0);D(a);var c=R(a,2);za(c),z(e=>{J(a,`for`,`lf-tool-${t??``}-${B(n).id??``}`),W(o,`${B(r).label??``} `),W(s,B(r).description),J(c,`id`,`lf-tool-${t??``}-${B(n).id??``}`),J(c,`type`,B(n).kind===`int`?`number`:`text`),J(c,`min`,B(n).kind===`int`?1:void 0),J(c,`placeholder`,B(n).kind===`int`?`No limit`:`example.com, docs.python.org`),Ba(c,e)},[()=>RL(B(b)[t][B(n).id])]),V(`change`,c,e=>w(t,B(n).id,B(n).kind,e.currentTarget.value)),U(e,i)}),D(n),U(e,n)};G(m,e=>{B(b)[t]&&B(C)[t]?.length&&e(h)}),z(()=>{Va(a,!!B(b)[t]),W(c,B(n).label),W(u,B(n).description)}),V(`change`,a,e=>S(t,e.currentTarget.checked)),U(e,r)}),D(t),z(()=>W(r,`what ${(xx[B(f)]||B(f))??``} can do on its own servers`)),U(e,t)};G(ht,e=>{B(x).length&&e(gt)});var _t=R(ht,2),vt=e=>{var t=DR(),n=F(t),r=L(n),i=R(n,2),a=e=>{var t=ER();tn(t),J(t,`placeholder`,`Extra AG2 provider-config settings as a JSON object, e.g. { "temperature": 0.7 -}`),qa(t,()=>B(y),e=>N(y,e)),U(e,t)};G(i,e=>{B(v)&&e(a)}),D(t),z(()=>W(r,`${B(v)?`▾`:`▸`} Advanced (JSON)`)),V(`click`,n,()=>N(v,!B(v))),U(e,t)};G(_t,e=>{B(f)!==`openai_subscription`&&e(vt)});var yt=R(_t,2),bt=e=>{var t=_R(),n=L(t,!0);z(()=>W(n,B(ie))),U(e,t)};G(yt,e=>{B(ie)&&e(bt)});var xt=R(yt,2),St=F(xt),Ct=e=>{U(e,vR())},wt=e=>{var t=yR();let n;var r=L(t,!0);z(()=>{n=q(t,1,`llmtest`,null,n,{ok:B(oe).ok,bad:!B(oe).ok}),W(r,B(oe).ok?`${B(oe).reply} · ${B(oe).latency_ms} ms`:B(oe).error)}),U(e,t)};G(St,e=>{B(ae)?e(Ct):B(oe)&&e(wt,1)});var Tt=R(St,2),Et=R(Tt,2),Dt=R(Et,2),Ot=L(Dt,!0),kt=R(Dt,2),At=e=>{var t=bR();z(e=>t.disabled=e,[()=>B(re)||B(ae)||!B(d).trim()||!B(p).trim()&&!B(fe)]),V(`click`,t,()=>Ge(!0)),U(e,t)};G(kt,e=>{c()||e(At)}),D(xt),D(qe),z((e,t)=>{Tt.disabled=e,Et.disabled=B(re),Dt.disabled=t,W(Ot,B(re)?`Saving…`:`Save`)},[()=>B(re)||B(ae)||!B(p).trim()&&!B(fe),()=>B(re)||B(ae)||!B(d).trim()||!B(p).trim()&&!B(fe)]),qa(Ye,()=>B(d),e=>N(d,e)),V(`click`,Tt,Ke),V(`click`,Et,function(...e){t.onCancel?.apply(this,e)}),V(`click`,Dt,()=>Ge()),U(e,qe),k(),o()}ki([`change`,`click`]);var CR=H(``),wR=H(`This model referenced a deleted secret.`),TR=H(`

`),ER=H(`testing…`),DR=H(` `),OR=H(``),kR=H(`
`);function AR(e,t){O(t,!0);let n=()=>A(aL,`$secretsStore`,r),[r,i]=Zt(),a=hF(),o=ro(t,`providers`,19,()=>[]),s=ro(t,`activate`,3,!1),c=[`gemini`,`openai`],l=fi(()=>({name:t.config.name||``,provider:t.config.provider||`openai`,model:t.config.model||``,secretId:t.config.secret_missing?``:t.config.secret_id||``})),u=M(P(l.name)),d=M(P(l.provider)),f=M(P(l.model)),p=M(P(l.secretId)),m=M(``);io(oL);let h=M(!1),g=M(``),_=M(!1),v=M(null),y=j(()=>o().find(e=>e.name===B(d))?.default_model||``),b=j(()=>lL(n().secrets,B(d))),x={openai:`OPENAI_API_KEY`,gemini:`GEMINI_API_KEY`},S=j(()=>{let e=x[B(d)],t=a?.s?.keys?.[B(d)];if(B(m).trim())return`A new Secret will be created from this key on save (rename it later in Settings → Secrets).`;if(B(p)){let t=n().secrets.find(e=>e.id===B(p));return t?`Uses the "${t.name}" secret. It overrides ${e}.`:`The referenced secret was deleted — falls back to the provider default or env key.`}return t?.set?`No secret selected — uses your ${e} (${t.hint||`set`}).`:`No key available — pick or paste one above, or set ${e}.`});function C(){return N(g,``),{id:t.config.id,name:B(u).trim(),provider:B(d),model:B(f).trim(),secret_id:B(p),api_key:B(m).trim()||null}}async function w(e=!1){let n=C();N(h,!0);try{if(B(m).trim()){let e=await sL({name:cL(B(u),B(m)),value:B(m).trim()});n.secret_id=e.id,N(p,e.id,!0),N(m,``),oL()}delete n.api_key,await Q.saveLiveConfig({...n,activate:s()||e}),t.onSaved()}catch(e){N(g,nS(e),!0)}N(h,!1)}async function T(){let e=C();N(_,!0),N(v,null);try{N(v,await Q.testLiveConfigDraft(e),!0)}catch(e){N(v,{ok:!1,error:nS(e)},!0)}N(_,!1)}var ee=kR(),te=F(ee),ne=R(F(te),2);za(ne),D(te);var re=R(te,2),ie=R(F(re),2);K(ie,21,()=>c,Qi,(e,t)=>{var n=CR(),r=L(n,!0),i={};z(()=>{W(r,wx[B(t)]),i!==(i=B(t))&&(n.value=(n.__value=i)??``)}),U(e,n)}),D(ie),Ea(ie),D(re);var ae=R(re,2),oe=R(F(ae),2);za(oe),D(ae);var se=R(ae,2),ce=R(F(se),2),le=F(ce),ue=F(le);ue.value=ue.__value=``,K(R(ue),17,()=>B(b),e=>e.id,(e,t)=>{var n=CR(),r=L(n),i={};z(()=>{W(r,`${B(t).name??``} ${B(t).hint??``}${B(t).default?` · default`:``}`),i!==(i=B(t).id)&&(n.value=(n.__value=i)??``)}),U(e,n)}),D(le),Ea(le),D(ce);var de=R(ce,2),fe=F(de);za(fe),D(de);var E=R(de,2),pe=e=>{U(e,wR())};G(E,e=>{t.config.secret_missing&&e(pe)});var me=L(R(E,2),!0);D(se);var he=R(se,2),ge=e=>{var t=TR(),n=L(t,!0);z(()=>W(n,B(g))),U(e,t)};G(he,e=>{B(g)&&e(ge)});var _e=R(he,2),ve=F(_e),ye=e=>{U(e,ER())},be=e=>{var t=DR();let n;var r=L(t,!0);z(()=>{n=q(t,1,`llmtest`,null,n,{ok:B(v).ok,bad:!B(v).ok}),W(r,B(v).ok?`${B(v).reply} · ${B(v).latency_ms} ms`:B(v).error)}),U(e,t)};G(ve,e=>{B(_)?e(ye):B(v)&&e(be,1)});var xe=R(ve,2),Se=R(xe,2),Ce=R(Se,2),we=L(Ce,!0),Te=R(Ce,2),Ee=e=>{var t=OR();z(e=>t.disabled=e,[()=>B(h)||B(_)||!B(u).trim()]),V(`click`,t,()=>w(!0)),U(e,t)};G(Te,e=>{s()||e(Ee)}),D(_e),D(ee),z((e,t)=>{J(oe,`placeholder`,B(y)?`e.g. `+B(y):`realtime model`),le.disabled=e,W(me,B(S)),xe.disabled=B(h)||B(_),Se.disabled=B(h),Ce.disabled=t,W(we,B(h)?`Saving…`:`Save`)},[()=>!!B(m).trim(),()=>B(h)||B(_)||!B(u).trim()]),qa(ne,()=>B(u),e=>N(u,e)),Da(ie,()=>B(d),e=>N(d,e)),qa(oe,()=>B(f),e=>N(f,e)),Da(le,()=>B(p),e=>N(p,e)),qa(fe,()=>B(m),e=>N(m,e)),V(`click`,xe,T),V(`click`,Se,function(...e){t.onCancel?.apply(this,e)}),V(`click`,Ce,()=>w()),U(e,ee),k(),i()}ki([`click`]);var jR=H(`

`),MR=H(`

No live models yet — add one below to talk to the assistant.

`),NR=H(`active`),PR=H(` `),FR=H(`testing…`),IR=H(` `),LR=H(` `),RR=H(`Delete? `,1),zR=H(` `,1),BR=H(`
`),VR=H(``),HR=H(``),UR=H(`
Choose a provider
`,1),WR=H(` `,1);function GR(e,t){O(t,!0);let n=()=>A(kj,`$liveConfigs`,r),[r,i]=Zt(),a=hF(),o=j(()=>n().configs),s=j(()=>n().providers),c=M(P({})),l=M(!1),u=M(``),d=M(null),f=M(!1),p=M(``);io(m);async function m(){try{await Aj()}catch(e){N(u,nS(e),!0)}}async function h(e){N(c,{...B(c),[e.id]:{testing:!0}},!0);try{N(c,{...B(c),[e.id]:await Q.testLiveConfig(e.id)},!0)}catch(t){N(c,{...B(c),[e.id]:{ok:!1,error:nS(t)}},!0)}}async function g(e){N(u,``),N(l,!0);try{await Q.useLiveConfig(e.id),await m()}catch(e){N(u,nS(e),!0)}N(l,!1)}async function _(e){N(u,``),N(l,!0);try{await Q.deleteLiveConfig(e.id);let{[e.id]:t,...n}=B(c);N(c,n,!0),N(p,``),await m()}catch(e){N(u,nS(e),!0)}N(l,!1)}function v(e){N(f,!1),N(p,``),N(d,{provider:e.name,name:wx[e.name]+` Live`,model:``},!0)}function y(e){N(f,!1),N(p,``),N(d,{...e},!0)}let b=j(()=>B(d)?.id?!!B(d).active:B(o).length===0);async function x(){N(d,null),await m()}function S(e){return e.key_source===`secret`?`${e.secret?.name||`secret`} ${e.secret?.hint||``}`.trim():e.key_source===`shared`?`${e.shared_key?.env||`provider key`} ${e.shared_key?.hint||``}`.trim():`no key — pick a secret or set `+(e.shared_key?.env||`the provider key`)}var C=WR(),w=I(C),T=e=>{var t=jR(),n=L(t,!0);z(()=>W(n,B(u))),U(e,t)};G(w,e=>{B(u)&&e(T)});var ee=R(w,2),te=e=>{U(e,MR())};G(ee,e=>{!B(o).length&&!B(d)&&e(te)});var ne=R(ee,2);K(ne,17,()=>B(o),e=>e.id,(e,t)=>{let n=j(()=>!B(d)&&B(p)!==B(t).id);var r=BR();let i;var o=F(r);qj(o,{get brand(){return B(t).provider}});var s=R(o,2),u=F(s),f=F(u),m=R(f),v=e=>{U(e,NR())};G(m,e=>{B(t).active&&e(v)}),D(u);var b=R(u,2),x=L(b),C=R(b,2),w=F(C);let T;var ee=L(w,!0),te=R(w,2),ne=e=>{var n=PR(),r=L(n);z(()=>W(r,`voice: ${B(t).voice??``}`)),U(e,n)};G(te,e=>{B(t).voice&&e(ne)});var re=R(te,2),ie=e=>{var n=Bi(),r=I(n),i=e=>{U(e,FR())},a=e=>{var n=IR(),r=L(n);z(()=>W(r,`${B(c)[B(t).id].reply??``} · ${B(c)[B(t).id].latency_ms??``} ms`)),U(e,n)},o=e=>{var n=LR(),r=L(n,!0);z(()=>W(r,B(c)[B(t).id].error)),U(e,n)};G(r,e=>{B(c)[B(t).id].testing?e(i):B(c)[B(t).id].ok?e(a,1):e(o,-1)}),U(e,n)};G(re,e=>{B(c)[B(t).id]&&e(ie)}),D(C),D(s);var ae=R(s,2),oe=e=>{var n=RR(),r=R(I(n),2),i=R(r,2);z(()=>{r.disabled=B(l),J(r,`title`,B(t).active?`Deleting the active live model falls back to the next one (or legacy)`:``),i.disabled=B(l)}),V(`click`,r,e=>{e.stopPropagation(),_(B(t))}),V(`click`,i,e=>{e.stopPropagation(),N(p,``)}),U(e,n)},se=e=>{var n=zR(),r=I(n),i=R(r,2),o=R(i,2),s=R(o,2);z(()=>{r.disabled=B(l)||!!B(d),i.disabled=B(l)||B(c)[B(t).id]?.testing||!!B(d),o.disabled=B(l)||!!B(d),s.disabled=B(l)||!!B(d)}),V(`click`,r,e=>{e.stopPropagation(),a.openVoice(B(t).id)}),V(`click`,i,e=>{e.stopPropagation(),h(B(t))}),V(`click`,o,e=>{e.stopPropagation(),y(B(t))}),V(`click`,s,e=>{e.stopPropagation(),N(p,B(t).id,!0)}),U(e,n)};G(ae,e=>{B(p)===B(t).id?e(oe):e(se,-1)}),D(r),z(e=>{i=q(r,1,`llmrow`,null,i,{active:B(t).active,clickable:!B(t).active&&B(n)&&!B(l)}),J(r,`aria-disabled`,B(t).active||!B(n)),J(r,`tabindex`,!B(t).active&&B(n)?0:-1),J(r,`aria-label`,B(t).active?void 0:`Use ${B(t).name}`),J(r,`title`,!B(t).active&&B(n)?`Click to use this live model`:``),W(f,`${B(t).name??``} `),W(x,`${wx[B(t).provider]??``} · ${B(t).model??``}`),T=q(w,1,`llmkey`,null,T,{warn:B(t).key_source===`none`||B(t).secret_missing}),W(ee,e)},[()=>S(B(t))]),V(`click`,r,()=>{!B(t).active&&!B(l)&&B(n)&&g(B(t))}),V(`keydown`,r,e=>{(e.key===`Enter`||e.key===` `)&&!B(t).active&&!B(l)&&B(n)&&(e.preventDefault(),g(B(t)))}),U(e,r)});var re=R(ne,2),ie=e=>{AR(e,{get config(){return B(d)},get providers(){return B(s)},get activate(){return B(b)},onSaved:x,onCancel:()=>N(d,null)})},ae=e=>{var t=Bi(),n=I(t),r=e=>{var t=VR();$(F(t),{name:`plus`,size:14}),tt(),D(t),z(()=>t.disabled=B(l)),V(`click`,t,()=>N(f,!0)),U(e,t)},i=e=>{var t=UR(),n=R(I(t),2);K(n,21,()=>B(s),Qi,(e,t)=>{var n=HR(),r=F(n),i=F(r);qj(i,{get brand(){return B(t).name},size:16});var a=R(i);D(r);var o=L(R(r,2));D(n),z(()=>{W(a,` ${wx[B(t).name]??``}`),W(o,`Realtime voice · ${B(t).default_model??``}`)}),V(`click`,n,()=>v(B(t))),U(e,n)}),D(n),V(`click`,L(R(n,2)),()=>N(f,!1)),U(e,t)};G(n,e=>{B(f)?e(i,-1):e(r)}),U(e,t)};G(re,e=>{B(d)?e(ie):e(ae,-1)}),U(e,C),k(),i()}ki([`click`,`keydown`]);var KR=[{name:`OpenAI · ChatGPT subscription`,card:`OpenAI · Sign in with ChatGPT`,type:`openai_subscription`,model:`gpt-5.6-terra`,blurb:`Your ChatGPT plan, via browser sign-in — unofficial, may break OpenAI ToS. Generates images`},{name:`Claude Code`,card:`Claude Code · CLI login`,type:`claude_code`,model:``,blurb:`Your Claude subscription, via the Claude Code CLI you’re already signed in to`},{name:`Codex`,card:`Codex · CLI login`,type:`codex`,model:``,blurb:`Your ChatGPT plan, via the Codex CLI you’re already signed in to`},{name:`OpenAI`,type:`openai_responses`,model:`gpt-5.6-terra`,blurb:`GPT models, direct from OpenAI — generates images`},{name:`OpenAI-compatible`,type:`openai`,model:``,base_url:`http://localhost:8080/v1`,blurb:`Any OpenAI-API endpoint — set the model name and URL`},{name:`Anthropic`,type:`anthropic`,model:`claude-opus-4-8`,blurb:`Claude, direct from Anthropic`},{name:`Anthropic-compatible`,type:`anthropic`,model:`MiniMax-M2.5`,base_url:`https://api.minimax.io/anthropic`,blurb:`Any Anthropic-API endpoint — set the model name and URL`},{name:`Gemini`,type:`gemini`,model:`gemini-3.6-flash`,blurb:`Gemini models, including image generation`},{name:`Ollama`,type:`ollama`,model:`llama3.2`,host:`http://localhost:11434`,blurb:`Models running locally via Ollama`}],qR=H(`

`),JR=H(`
`),YR=H(`

No configurations yet — add one below to connect a model.

`),XR=H(`active`),ZR=H(` `),QR=H(` `),$R=H(`testing…`),ez=H(` `),tz=H(` `),nz=H(`Delete? `,1),rz=H(` `,1),iz=H(`
`,1),az=H(``),oz=H(` `),sz=H(``),cz=H(`
`,1),lz=H(`
`,1),uz=H(`
Text
Live
`,1);function dz(e,t){O(t,!0);let n=()=>A(aT,`$llmConfigs`,r),[r,i]=Zt(),a=e=>{var t=Bi(),n=I(t),r=e=>{SR(e,{get config(){return B(p)},get activate(){return B(S)},onSaved:C,onCancel:()=>N(p,null)})};G(n,e=>{B(p)&&e(r)}),U(e,t)},o=xx.map(e=>({group:e,templates:KR.filter(t=>Sx[t.type]===e)})).filter(e=>e.templates.length),s=j(()=>n().configs),c=j(()=>n().envOverride),l=j(()=>n().providerDeps||{}),u=M(P({})),d=M(!1),f=M(``),p=M(null),m=M(!1),h=M(``);io(g);async function g(){try{await oT()}catch(e){N(f,nS(e),!0)}}async function _(e){N(u,{...B(u),[e.id]:{testing:!0}},!0);try{N(u,{...B(u),[e.id]:await Q.testLlmConfig(e.id)},!0)}catch(t){N(u,{...B(u),[e.id]:{ok:!1,error:nS(t)}},!0)}}async function v(e){N(f,``),N(d,!0);try{await Q.useLlmConfig(e.id),await g()}catch(e){N(f,nS(e),!0)}N(d,!1)}async function y(e){N(f,``),N(d,!0);try{await Q.deleteLlmConfig(e.id);let{[e.id]:t,...n}=B(u);N(u,n,!0),N(h,``),await g()}catch(e){N(f,nS(e),!0)}N(d,!1)}function b(e){N(m,!1),N(h,``),N(p,{...e},!0)}function x(e){N(m,!1),N(h,``),N(p,{...e},!0)}let S=j(()=>B(p)?.id?!!B(p).active:B(s).length===0);async function C(){N(p,null),await g()}let w=e=>(e.type===`ollama`?e.host:e.base_url)||``;function T(e){return e.key_source===`subscription`?e.signed_in?`ChatGPT subscription · signed in`:`ChatGPT subscription · not signed in`:e.key_source===`cli_login`?e.type===`codex`?`Codex CLI login`:`Claude Code CLI login`:e.type===`claude_code`?`Claude Code adapter not found — install claude-agent-acp`:e.type===`codex`?`Codex adapter not found — install @agentclientprotocol/codex-acp`:e.key_source===`secret`?`${e.secret?.name||`secret`} ${e.secret?.hint||``}`.trim():e.key_source===`shared`?`${e.shared_key?.env||`provider key`} ${e.shared_key?.hint||``}`.trim():e.key_source===`not_needed`?`no key needed`:`no key — pick a secret or set `+(e.shared_key?.env||`the provider key`)}var ee=uz(),te=R(I(ee),2),ne=e=>{var t=qR(),n=L(t,!0);z(()=>W(n,B(f))),U(e,t)};G(te,e=>{B(f)&&e(ne)});var re=R(te,2),ie=e=>{var t=JR(),n=L(t);z(()=>W(n,`Pinned by environment${B(c).provider?` · provider ${B(c).provider}`:``}${B(c).model?` · model ${B(c).model}`:``}. - These override the active configuration below until unset.`)),U(e,t)};G(re,e=>{B(c)&&e(ie)});var ae=R(re,2),oe=e=>{U(e,YR())};G(ae,e=>{!B(s).length&&!B(p)&&e(oe)});var se=R(ae,2);K(se,17,()=>B(s),e=>e.id,(e,t)=>{let n=j(()=>!B(p)&&B(h)!==B(t).id);var r=iz(),i=I(r);let o;var s=F(i);qj(s,{get brand(){return B(t).type}});var c=R(s,2),l=F(c),f=F(l),m=R(f),g=e=>{U(e,XR())};G(m,e=>{B(t).active&&e(g)}),D(l);var b=R(l,2),S=F(b),C=R(S),ee=e=>{var n=zi();z(e=>W(n,`· ${e??``}`),[()=>w(B(t))]),U(e,n)},te=j(()=>w(B(t)));G(C,e=>{B(te)&&e(ee)}),D(b);var ne=R(b,2),re=F(ne);let ie;var ae=L(re,!0),oe=R(re,2),se=e=>{var n=ZR(),r=L(n);z(()=>{J(n,`title`,B(t).deps.install),W(r,`needs ${B(t).deps.install??``}`)}),U(e,n)};G(oe,e=>{B(t).deps&&!B(t).deps.ok&&e(se)});var ce=R(oe,2),le=e=>{var n=QR(),r=L(n);z(()=>W(r,`images${B(t).active?` ✓`:``}`)),U(e,n)};G(ce,e=>{B(t).images&&e(le)});var ue=R(ce,2);K(ue,16,()=>Object.keys(B(t).builtin_tools||{}),e=>e,(e,n)=>{var r=QR(),i=L(r,!0);z((e,t)=>{J(r,`title`,e),W(i,t)},[()=>SL(B(t).type,n).label,()=>wL(n)]),U(e,r)});var de=R(ue,2),fe=e=>{var n=Bi(),r=I(n),i=e=>{U(e,$R())},a=e=>{var n=ez(),r=L(n);z(()=>W(r,`${B(u)[B(t).id].reply??``} · ${B(u)[B(t).id].latency_ms??``} ms`)),U(e,n)},o=e=>{var n=tz(),r=L(n,!0);z(()=>W(r,B(u)[B(t).id].error)),U(e,n)};G(r,e=>{B(u)[B(t).id].testing?e(i):B(u)[B(t).id].ok?e(a,1):e(o,-1)}),U(e,n)};G(de,e=>{B(u)[B(t).id]&&e(fe)}),D(ne),D(c);var E=R(c,2),pe=e=>{var n=nz(),r=R(I(n),2),i=R(r,2);z(()=>{r.disabled=B(d),J(r,`title`,B(t).active?`Deleting the active model falls back to the next one (or defaults)`:``),i.disabled=B(d)}),V(`click`,r,e=>{e.stopPropagation(),y(B(t))}),V(`click`,i,e=>{e.stopPropagation(),N(h,``)}),U(e,n)},me=e=>{var n=rz(),r=I(n),i=R(r,2),a=R(i,2);z(()=>{r.disabled=B(d)||B(u)[B(t).id]?.testing||!!B(p),J(r,`title`,B(p)?`Editing in progress — use the editor’s Test button to test your changes`:``),i.disabled=B(d)||!!B(p),a.disabled=B(d)||!!B(p),J(a,`title`,B(t).active?`Deleting the active model falls back to the next one (or defaults)`:``)}),V(`click`,r,e=>{e.stopPropagation(),_(B(t))}),V(`click`,i,e=>{e.stopPropagation(),x(B(t))}),V(`click`,a,e=>{e.stopPropagation(),N(h,B(t).id,!0)}),U(e,n)};G(E,e=>{B(h)===B(t).id?e(pe):e(me,-1)}),D(i);var he=R(i,2),ge=e=>{a(e)};G(he,e=>{B(p)?.id===B(t).id&&e(ge)}),z(e=>{o=q(i,1,`llmrow`,null,o,{active:B(t).active,clickable:!B(t).active&&B(n)&&!B(d)}),J(i,`aria-disabled`,B(t).active||!B(n)),J(i,`tabindex`,!B(t).active&&B(n)?0:-1),J(i,`aria-label`,B(t).active?void 0:`Use ${B(t).name}`),J(i,`title`,!B(t).active&&B(n)?`Click to use this model`:``),W(f,`${B(t).name??``} `),W(S,`${yx[B(t).type]??``} · ${(B(t).model||`CLI default`)??``}`),ie=q(re,1,`llmkey`,null,ie,{warn:B(t).key_source===`none`||B(t).secret_missing||B(t).key_source===`subscription`&&!B(t).signed_in}),W(ae,e)},[()=>T(B(t))]),V(`click`,i,()=>{!B(t).active&&!B(d)&&B(n)&&v(B(t))}),V(`keydown`,i,e=>{(e.key===`Enter`||e.key===` `)&&!B(t).active&&!B(d)&&B(n)&&(e.preventDefault(),v(B(t)))}),U(e,r)});var ce=R(se,2),le=e=>{a(e)},ue=e=>{var t=Bi(),n=I(t),r=e=>{var t=az();$(F(t),{name:`plus`,size:14}),tt(),D(t),z(()=>t.disabled=B(d)),V(`click`,t,()=>N(m,!0)),U(e,t)},i=e=>{var t=lz(),n=I(t);K(n,17,()=>o,({group:e,templates:t})=>e,(e,t)=>{let n=()=>B(t).group,r=()=>B(t).templates;var i=cz(),a=I(i),o=L(a,!0),s=R(a,2);K(s,21,r,Qi,(e,t)=>{var n=sz(),r=F(n),i=F(r);qj(i,{get brand(){return B(t).type},size:16});var a=R(i),o=L(R(a),!0);D(r);var s=R(r,2),c=L(s,!0),u=R(s,2),d=e=>{var n=oz(),r=L(n);z(()=>W(r,`Needs ${B(l)[B(t).type].install??``}`)),U(e,n)};G(u,e=>{B(l)[B(t).type]&&!B(l)[B(t).type].ok&&e(d)}),D(n),z(()=>{W(a,` ${(B(t).card||B(t).name)??``} `),W(o,Cx[B(t).type]),W(c,B(t).blurb)}),V(`click`,n,()=>b(B(t))),U(e,n)}),D(s),z(()=>W(o,n())),U(e,i)}),V(`click`,L(R(n,2)),()=>N(m,!1)),U(e,t)};G(n,e=>{B(m)?e(i,-1):e(r)}),U(e,t)};G(ce,e=>{B(p)&&!B(p).id?e(le):B(p)||e(ue,1)}),GR(R(ce,4),{}),U(e,ee),k(),i()}ki([`click`,`keydown`]);var fz=H(`

`),pz=H(`

No secrets yet — add one below, or paste a key in a model form.

`),mz=H(``),hz=H(`

`),gz=H(`
`),_z=H(`default`),vz=H(`
`),yz=H(`
`),bz=H(``),xz=H(`
Secrets

Named, reusable API keys. Attach one to any Text or Live model; mark a +}`),qa(t,()=>B(y),e=>N(y,e)),U(e,t)};G(i,e=>{B(v)&&e(a)}),D(t),z(()=>W(r,`${B(v)?`▾`:`▸`} Advanced (JSON)`)),V(`click`,n,()=>N(v,!B(v))),U(e,t)};G(_t,e=>{B(f)!==`openai_subscription`&&e(vt)});var yt=R(_t,2),bt=e=>{var t=OR(),n=L(t,!0);z(()=>W(n,B(ie))),U(e,t)};G(yt,e=>{B(ie)&&e(bt)});var xt=R(yt,2),St=F(xt),Ct=e=>{U(e,kR())},wt=e=>{var t=AR();let n;var r=L(t,!0);z(()=>{n=q(t,1,`llmtest`,null,n,{ok:B(oe).ok,bad:!B(oe).ok}),W(r,B(oe).ok?`${B(oe).reply} · ${B(oe).latency_ms} ms`:B(oe).error)}),U(e,t)};G(St,e=>{B(ae)?e(Ct):B(oe)&&e(wt,1)});var Tt=R(St,2),Et=R(Tt,2),Dt=R(Et,2),Ot=L(Dt,!0),kt=R(Dt,2),At=e=>{var t=jR();z(e=>t.disabled=e,[()=>B(re)||B(ae)||!B(d).trim()||!B(p).trim()&&!B(fe)]),V(`click`,t,()=>Ge(!0)),U(e,t)};G(kt,e=>{c()||e(At)}),D(xt),D(qe),z((e,t)=>{Tt.disabled=e,Et.disabled=B(re),Dt.disabled=t,W(Ot,B(re)?`Saving…`:`Save`)},[()=>B(re)||B(ae)||!B(p).trim()&&!B(fe),()=>B(re)||B(ae)||!B(d).trim()||!B(p).trim()&&!B(fe)]),qa(Ye,()=>B(d),e=>N(d,e)),V(`click`,Tt,Ke),V(`click`,Et,function(...e){t.onCancel?.apply(this,e)}),V(`click`,Dt,()=>Ge()),U(e,qe),k(),o()}ki([`change`,`click`]);var PR=H(``),FR=H(`This model referenced a deleted secret.`),IR=H(`

`),LR=H(`testing…`),RR=H(` `),zR=H(``),BR=H(`
`);function VR(e,t){O(t,!0);let n=()=>A(gL,`$secretsStore`,r),[r,i]=Zt(),a=EF(),o=ro(t,`providers`,19,()=>[]),s=ro(t,`activate`,3,!1),c=[`gemini`,`openai`],l=fi(()=>({name:t.config.name||``,provider:t.config.provider||`openai`,model:t.config.model||``,secretId:t.config.secret_missing?``:t.config.secret_id||``})),u=M(P(l.name)),d=M(P(l.provider)),f=M(P(l.model)),p=M(P(l.secretId)),m=M(``);io(_L);let h=M(!1),g=M(``),_=M(!1),v=M(null),y=j(()=>o().find(e=>e.name===B(d))?.default_model||``),b=j(()=>bL(n().secrets,B(d))),x={openai:`OPENAI_API_KEY`,gemini:`GEMINI_API_KEY`},S=j(()=>{let e=x[B(d)],t=a?.s?.keys?.[B(d)];if(B(m).trim())return`A new Secret will be created from this key on save (rename it later in Settings → Secrets).`;if(B(p)){let t=n().secrets.find(e=>e.id===B(p));return t?`Uses the "${t.name}" secret. It overrides ${e}.`:`The referenced secret was deleted — falls back to the provider default or env key.`}return t?.set?`No secret selected — uses your ${e} (${t.hint||`set`}).`:`No key available — pick or paste one above, or set ${e}.`});function C(){return N(g,``),{id:t.config.id,name:B(u).trim(),provider:B(d),model:B(f).trim(),secret_id:B(p),api_key:B(m).trim()||null}}async function w(e=!1){let n=C();N(h,!0);try{if(B(m).trim()){let e=await vL({name:yL(B(u),B(m)),value:B(m).trim()});n.secret_id=e.id,N(p,e.id,!0),N(m,``),_L()}delete n.api_key,await Q.saveLiveConfig({...n,activate:s()||e}),t.onSaved()}catch(e){N(g,iS(e),!0)}N(h,!1)}async function T(){let e=C();N(_,!0),N(v,null);try{N(v,await Q.testLiveConfigDraft(e),!0)}catch(e){N(v,{ok:!1,error:iS(e)},!0)}N(_,!1)}var ee=BR(),te=F(ee),ne=R(F(te),2);za(ne),D(te);var re=R(te,2),ie=R(F(re),2);K(ie,21,()=>c,Qi,(e,t)=>{var n=PR(),r=L(n,!0),i={};z(()=>{W(r,Ex[B(t)]),i!==(i=B(t))&&(n.value=(n.__value=i)??``)}),U(e,n)}),D(ie),Ea(ie),D(re);var ae=R(re,2),oe=R(F(ae),2);za(oe),D(ae);var se=R(ae,2),ce=R(F(se),2),le=F(ce),ue=F(le);ue.value=ue.__value=``,K(R(ue),17,()=>B(b),e=>e.id,(e,t)=>{var n=PR(),r=L(n),i={};z(()=>{W(r,`${B(t).name??``} ${B(t).hint??``}${B(t).default?` · default`:``}`),i!==(i=B(t).id)&&(n.value=(n.__value=i)??``)}),U(e,n)}),D(le),Ea(le),D(ce);var de=R(ce,2),fe=F(de);za(fe),D(de);var E=R(de,2),pe=e=>{U(e,FR())};G(E,e=>{t.config.secret_missing&&e(pe)});var me=L(R(E,2),!0);D(se);var he=R(se,2),ge=e=>{var t=IR(),n=L(t,!0);z(()=>W(n,B(g))),U(e,t)};G(he,e=>{B(g)&&e(ge)});var _e=R(he,2),ve=F(_e),ye=e=>{U(e,LR())},be=e=>{var t=RR();let n;var r=L(t,!0);z(()=>{n=q(t,1,`llmtest`,null,n,{ok:B(v).ok,bad:!B(v).ok}),W(r,B(v).ok?`${B(v).reply} · ${B(v).latency_ms} ms`:B(v).error)}),U(e,t)};G(ve,e=>{B(_)?e(ye):B(v)&&e(be,1)});var xe=R(ve,2),Se=R(xe,2),Ce=R(Se,2),we=L(Ce,!0),Te=R(Ce,2),Ee=e=>{var t=zR();z(e=>t.disabled=e,[()=>B(h)||B(_)||!B(u).trim()]),V(`click`,t,()=>w(!0)),U(e,t)};G(Te,e=>{s()||e(Ee)}),D(_e),D(ee),z((e,t)=>{J(oe,`placeholder`,B(y)?`e.g. `+B(y):`realtime model`),le.disabled=e,W(me,B(S)),xe.disabled=B(h)||B(_),Se.disabled=B(h),Ce.disabled=t,W(we,B(h)?`Saving…`:`Save`)},[()=>!!B(m).trim(),()=>B(h)||B(_)||!B(u).trim()]),qa(ne,()=>B(u),e=>N(u,e)),Da(ie,()=>B(d),e=>N(d,e)),qa(oe,()=>B(f),e=>N(f,e)),Da(le,()=>B(p),e=>N(p,e)),qa(fe,()=>B(m),e=>N(m,e)),V(`click`,xe,T),V(`click`,Se,function(...e){t.onCancel?.apply(this,e)}),V(`click`,Ce,()=>w()),U(e,ee),k(),i()}ki([`click`]);var HR=H(`

`),UR=H(`

No live models yet — add one below to talk to the assistant.

`),WR=H(`active`),GR=H(` `),KR=H(`testing…`),qR=H(` `),JR=H(` `),YR=H(`Delete? `,1),XR=H(` `,1),ZR=H(`
`),QR=H(``),$R=H(``),ez=H(`
Choose a provider
`,1),tz=H(` `,1);function nz(e,t){O(t,!0);let n=()=>A(Bj,`$liveConfigs`,r),[r,i]=Zt(),a=EF(),o=j(()=>n().configs),s=j(()=>n().providers),c=M(P({})),l=M(!1),u=M(``),d=M(null),f=M(!1),p=M(``);io(m);async function m(){try{await Vj()}catch(e){N(u,iS(e),!0)}}async function h(e){N(c,{...B(c),[e.id]:{testing:!0}},!0);try{N(c,{...B(c),[e.id]:await Q.testLiveConfig(e.id)},!0)}catch(t){N(c,{...B(c),[e.id]:{ok:!1,error:iS(t)}},!0)}}async function g(e){N(u,``),N(l,!0);try{await Q.useLiveConfig(e.id),await m()}catch(e){N(u,iS(e),!0)}N(l,!1)}async function _(e){N(u,``),N(l,!0);try{await Q.deleteLiveConfig(e.id);let{[e.id]:t,...n}=B(c);N(c,n,!0),N(p,``),await m()}catch(e){N(u,iS(e),!0)}N(l,!1)}function v(e){N(f,!1),N(p,``),N(d,{provider:e.name,name:Ex[e.name]+` Live`,model:``},!0)}function y(e){N(f,!1),N(p,``),N(d,{...e},!0)}let b=j(()=>B(d)?.id?!!B(d).active:B(o).length===0);async function x(){N(d,null),await m()}function S(e){return e.key_source===`secret`?`${e.secret?.name||`secret`} ${e.secret?.hint||``}`.trim():e.key_source===`shared`?`${e.shared_key?.env||`provider key`} ${e.shared_key?.hint||``}`.trim():`no key — pick a secret or set `+(e.shared_key?.env||`the provider key`)}var C=tz(),w=I(C),T=e=>{var t=HR(),n=L(t,!0);z(()=>W(n,B(u))),U(e,t)};G(w,e=>{B(u)&&e(T)});var ee=R(w,2),te=e=>{U(e,UR())};G(ee,e=>{!B(o).length&&!B(d)&&e(te)});var ne=R(ee,2);K(ne,17,()=>B(o),e=>e.id,(e,t)=>{let n=j(()=>!B(d)&&B(p)!==B(t).id);var r=ZR();let i;var o=F(r);iM(o,{get brand(){return B(t).provider}});var s=R(o,2),u=F(s),f=F(u),m=R(f),v=e=>{U(e,WR())};G(m,e=>{B(t).active&&e(v)}),D(u);var b=R(u,2),x=L(b),C=R(b,2),w=F(C);let T;var ee=L(w,!0),te=R(w,2),ne=e=>{var n=GR(),r=L(n);z(()=>W(r,`voice: ${B(t).voice??``}`)),U(e,n)};G(te,e=>{B(t).voice&&e(ne)});var re=R(te,2),ie=e=>{var n=Bi(),r=I(n),i=e=>{U(e,KR())},a=e=>{var n=qR(),r=L(n);z(()=>W(r,`${B(c)[B(t).id].reply??``} · ${B(c)[B(t).id].latency_ms??``} ms`)),U(e,n)},o=e=>{var n=JR(),r=L(n,!0);z(()=>W(r,B(c)[B(t).id].error)),U(e,n)};G(r,e=>{B(c)[B(t).id].testing?e(i):B(c)[B(t).id].ok?e(a,1):e(o,-1)}),U(e,n)};G(re,e=>{B(c)[B(t).id]&&e(ie)}),D(C),D(s);var ae=R(s,2),oe=e=>{var n=YR(),r=R(I(n),2),i=R(r,2);z(()=>{r.disabled=B(l),J(r,`title`,B(t).active?`Deleting the active live model falls back to the next one (or legacy)`:``),i.disabled=B(l)}),V(`click`,r,e=>{e.stopPropagation(),_(B(t))}),V(`click`,i,e=>{e.stopPropagation(),N(p,``)}),U(e,n)},se=e=>{var n=XR(),r=I(n),i=R(r,2),o=R(i,2),s=R(o,2);z(()=>{r.disabled=B(l)||!!B(d),i.disabled=B(l)||B(c)[B(t).id]?.testing||!!B(d),o.disabled=B(l)||!!B(d),s.disabled=B(l)||!!B(d)}),V(`click`,r,e=>{e.stopPropagation(),a.openVoice(B(t).id)}),V(`click`,i,e=>{e.stopPropagation(),h(B(t))}),V(`click`,o,e=>{e.stopPropagation(),y(B(t))}),V(`click`,s,e=>{e.stopPropagation(),N(p,B(t).id,!0)}),U(e,n)};G(ae,e=>{B(p)===B(t).id?e(oe):e(se,-1)}),D(r),z(e=>{i=q(r,1,`llmrow`,null,i,{active:B(t).active,clickable:!B(t).active&&B(n)&&!B(l)}),J(r,`aria-disabled`,B(t).active||!B(n)),J(r,`tabindex`,!B(t).active&&B(n)?0:-1),J(r,`aria-label`,B(t).active?void 0:`Use ${B(t).name}`),J(r,`title`,!B(t).active&&B(n)?`Click to use this live model`:``),W(f,`${B(t).name??``} `),W(x,`${Ex[B(t).provider]??``} · ${B(t).model??``}`),T=q(w,1,`llmkey`,null,T,{warn:B(t).key_source===`none`||B(t).secret_missing}),W(ee,e)},[()=>S(B(t))]),V(`click`,r,()=>{!B(t).active&&!B(l)&&B(n)&&g(B(t))}),V(`keydown`,r,e=>{(e.key===`Enter`||e.key===` `)&&!B(t).active&&!B(l)&&B(n)&&(e.preventDefault(),g(B(t)))}),U(e,r)});var re=R(ne,2),ie=e=>{VR(e,{get config(){return B(d)},get providers(){return B(s)},get activate(){return B(b)},onSaved:x,onCancel:()=>N(d,null)})},ae=e=>{var t=Bi(),n=I(t),r=e=>{var t=QR();$(F(t),{name:`plus`,size:14}),tt(),D(t),z(()=>t.disabled=B(l)),V(`click`,t,()=>N(f,!0)),U(e,t)},i=e=>{var t=ez(),n=R(I(t),2);K(n,21,()=>B(s),Qi,(e,t)=>{var n=$R(),r=F(n),i=F(r);iM(i,{get brand(){return B(t).name},size:16});var a=R(i);D(r);var o=L(R(r,2));D(n),z(()=>{W(a,` ${Ex[B(t).name]??``}`),W(o,`Realtime voice · ${B(t).default_model??``}`)}),V(`click`,n,()=>v(B(t))),U(e,n)}),D(n),V(`click`,L(R(n,2)),()=>N(f,!1)),U(e,t)};G(n,e=>{B(f)?e(i,-1):e(r)}),U(e,t)};G(re,e=>{B(d)?e(ie):e(ae,-1)}),U(e,C),k(),i()}ki([`click`,`keydown`]);var rz=[{name:`OpenAI · ChatGPT subscription`,card:`OpenAI · Sign in with ChatGPT`,type:`openai_subscription`,model:`gpt-5.6-terra`,blurb:`Your ChatGPT plan, via browser sign-in — unofficial, may break OpenAI ToS. Generates images`},{name:`Claude Code`,card:`Claude Code · CLI login`,type:`claude_code`,model:``,blurb:`Your Claude subscription, via the Claude Code CLI you’re already signed in to`},{name:`Codex`,card:`Codex · CLI login`,type:`codex`,model:``,blurb:`Your ChatGPT plan, via the Codex CLI you’re already signed in to`},{name:`OpenAI`,type:`openai_responses`,model:`gpt-5.6-terra`,blurb:`GPT models, direct from OpenAI — generates images`},{name:`OpenAI-compatible`,type:`openai`,model:``,base_url:`http://localhost:8080/v1`,blurb:`Any OpenAI-API endpoint — set the model name and URL`},{name:`Anthropic`,type:`anthropic`,model:`claude-opus-4-8`,blurb:`Claude, direct from Anthropic`},{name:`Anthropic-compatible`,type:`anthropic`,model:`MiniMax-M2.5`,base_url:`https://api.minimax.io/anthropic`,blurb:`Any Anthropic-API endpoint — set the model name and URL`},{name:`Gemini`,type:`gemini`,model:`gemini-3.6-flash`,blurb:`Gemini models, including image generation`},{name:`Ollama`,type:`ollama`,model:`llama3.2`,host:`http://localhost:11434`,blurb:`Models running locally via Ollama`}],iz=H(`

`),az=H(`
`),oz=H(`

No configurations yet — add one below to connect a model.

`),sz=H(`active`),cz=H(` `),lz=H(` `),uz=H(`testing…`),dz=H(` `),fz=H(` `),pz=H(`Delete? `,1),mz=H(` `,1),hz=H(`
`,1),gz=H(``),_z=H(` `),vz=H(``),yz=H(`
`,1),bz=H(`
`,1),xz=H(`
Text
Live
`,1);function Sz(e,t){O(t,!0);let n=()=>A(sT,`$llmConfigs`,r),[r,i]=Zt(),a=e=>{var t=Bi(),n=I(t),r=e=>{NR(e,{get config(){return B(p)},get activate(){return B(S)},onSaved:C,onCancel:()=>N(p,null)})};G(n,e=>{B(p)&&e(r)}),U(e,t)},o=Cx.map(e=>({group:e,templates:rz.filter(t=>wx[t.type]===e)})).filter(e=>e.templates.length),s=j(()=>n().configs),c=j(()=>n().envOverride),l=j(()=>n().providerDeps||{}),u=M(P({})),d=M(!1),f=M(``),p=M(null),m=M(!1),h=M(``);io(g);async function g(){try{await cT()}catch(e){N(f,iS(e),!0)}}async function _(e){N(u,{...B(u),[e.id]:{testing:!0}},!0);try{N(u,{...B(u),[e.id]:await Q.testLlmConfig(e.id)},!0)}catch(t){N(u,{...B(u),[e.id]:{ok:!1,error:iS(t)}},!0)}}async function v(e){N(f,``),N(d,!0);try{await Q.useLlmConfig(e.id),await g()}catch(e){N(f,iS(e),!0)}N(d,!1)}async function y(e){N(f,``),N(d,!0);try{await Q.deleteLlmConfig(e.id);let{[e.id]:t,...n}=B(u);N(u,n,!0),N(h,``),await g()}catch(e){N(f,iS(e),!0)}N(d,!1)}function b(e){N(m,!1),N(h,``),N(p,{...e},!0)}function x(e){N(m,!1),N(h,``),N(p,{...e},!0)}let S=j(()=>B(p)?.id?!!B(p).active:B(s).length===0);async function C(){N(p,null),await g()}let w=e=>(e.type===`ollama`?e.host:e.base_url)||``;function T(e){return e.key_source===`subscription`?e.signed_in?`ChatGPT subscription · signed in`:`ChatGPT subscription · not signed in`:e.key_source===`cli_login`?e.type===`codex`?`Codex CLI login`:`Claude Code CLI login`:e.type===`claude_code`?`Claude Code adapter not found — install claude-agent-acp`:e.type===`codex`?`Codex adapter not found — install @agentclientprotocol/codex-acp`:e.key_source===`secret`?`${e.secret?.name||`secret`} ${e.secret?.hint||``}`.trim():e.key_source===`shared`?`${e.shared_key?.env||`provider key`} ${e.shared_key?.hint||``}`.trim():e.key_source===`not_needed`?`no key needed`:`no key — pick a secret or set `+(e.shared_key?.env||`the provider key`)}var ee=xz(),te=R(I(ee),2),ne=e=>{var t=iz(),n=L(t,!0);z(()=>W(n,B(f))),U(e,t)};G(te,e=>{B(f)&&e(ne)});var re=R(te,2),ie=e=>{var t=az(),n=L(t);z(()=>W(n,`Pinned by environment${B(c).provider?` · provider ${B(c).provider}`:``}${B(c).model?` · model ${B(c).model}`:``}. + These override the active configuration below until unset.`)),U(e,t)};G(re,e=>{B(c)&&e(ie)});var ae=R(re,2),oe=e=>{U(e,oz())};G(ae,e=>{!B(s).length&&!B(p)&&e(oe)});var se=R(ae,2);K(se,17,()=>B(s),e=>e.id,(e,t)=>{let n=j(()=>!B(p)&&B(h)!==B(t).id);var r=hz(),i=I(r);let o;var s=F(i);iM(s,{get brand(){return B(t).type}});var c=R(s,2),l=F(c),f=F(l),m=R(f),g=e=>{U(e,sz())};G(m,e=>{B(t).active&&e(g)}),D(l);var b=R(l,2),S=F(b),C=R(S),ee=e=>{var n=zi();z(e=>W(n,`· ${e??``}`),[()=>w(B(t))]),U(e,n)},te=j(()=>w(B(t)));G(C,e=>{B(te)&&e(ee)}),D(b);var ne=R(b,2),re=F(ne);let ie;var ae=L(re,!0),oe=R(re,2),se=e=>{var n=cz(),r=L(n);z(()=>{J(n,`title`,B(t).deps.install),W(r,`needs ${B(t).deps.install??``}`)}),U(e,n)};G(oe,e=>{B(t).deps&&!B(t).deps.ok&&e(se)});var ce=R(oe,2),le=e=>{var n=lz(),r=L(n);z(()=>W(r,`images${B(t).active?` ✓`:``}`)),U(e,n)};G(ce,e=>{B(t).images&&e(le)});var ue=R(ce,2);K(ue,16,()=>Object.keys(B(t).builtin_tools||{}),e=>e,(e,n)=>{var r=lz(),i=L(r,!0);z((e,t)=>{J(r,`title`,e),W(i,t)},[()=>NL(B(t).type,n).label,()=>FL(n)]),U(e,r)});var de=R(ue,2),fe=e=>{var n=Bi(),r=I(n),i=e=>{U(e,uz())},a=e=>{var n=dz(),r=L(n);z(()=>W(r,`${B(u)[B(t).id].reply??``} · ${B(u)[B(t).id].latency_ms??``} ms`)),U(e,n)},o=e=>{var n=fz(),r=L(n,!0);z(()=>W(r,B(u)[B(t).id].error)),U(e,n)};G(r,e=>{B(u)[B(t).id].testing?e(i):B(u)[B(t).id].ok?e(a,1):e(o,-1)}),U(e,n)};G(de,e=>{B(u)[B(t).id]&&e(fe)}),D(ne),D(c);var E=R(c,2),pe=e=>{var n=pz(),r=R(I(n),2),i=R(r,2);z(()=>{r.disabled=B(d),J(r,`title`,B(t).active?`Deleting the active model falls back to the next one (or defaults)`:``),i.disabled=B(d)}),V(`click`,r,e=>{e.stopPropagation(),y(B(t))}),V(`click`,i,e=>{e.stopPropagation(),N(h,``)}),U(e,n)},me=e=>{var n=mz(),r=I(n),i=R(r,2),a=R(i,2);z(()=>{r.disabled=B(d)||B(u)[B(t).id]?.testing||!!B(p),J(r,`title`,B(p)?`Editing in progress — use the editor’s Test button to test your changes`:``),i.disabled=B(d)||!!B(p),a.disabled=B(d)||!!B(p),J(a,`title`,B(t).active?`Deleting the active model falls back to the next one (or defaults)`:``)}),V(`click`,r,e=>{e.stopPropagation(),_(B(t))}),V(`click`,i,e=>{e.stopPropagation(),x(B(t))}),V(`click`,a,e=>{e.stopPropagation(),N(h,B(t).id,!0)}),U(e,n)};G(E,e=>{B(h)===B(t).id?e(pe):e(me,-1)}),D(i);var he=R(i,2),ge=e=>{a(e)};G(he,e=>{B(p)?.id===B(t).id&&e(ge)}),z(e=>{o=q(i,1,`llmrow`,null,o,{active:B(t).active,clickable:!B(t).active&&B(n)&&!B(d)}),J(i,`aria-disabled`,B(t).active||!B(n)),J(i,`tabindex`,!B(t).active&&B(n)?0:-1),J(i,`aria-label`,B(t).active?void 0:`Use ${B(t).name}`),J(i,`title`,!B(t).active&&B(n)?`Click to use this model`:``),W(f,`${B(t).name??``} `),W(S,`${xx[B(t).type]??``} · ${(B(t).model||`CLI default`)??``}`),ie=q(re,1,`llmkey`,null,ie,{warn:B(t).key_source===`none`||B(t).secret_missing||B(t).key_source===`subscription`&&!B(t).signed_in}),W(ae,e)},[()=>T(B(t))]),V(`click`,i,()=>{!B(t).active&&!B(d)&&B(n)&&v(B(t))}),V(`keydown`,i,e=>{(e.key===`Enter`||e.key===` `)&&!B(t).active&&!B(d)&&B(n)&&(e.preventDefault(),v(B(t)))}),U(e,r)});var ce=R(se,2),le=e=>{a(e)},ue=e=>{var t=Bi(),n=I(t),r=e=>{var t=gz();$(F(t),{name:`plus`,size:14}),tt(),D(t),z(()=>t.disabled=B(d)),V(`click`,t,()=>N(m,!0)),U(e,t)},i=e=>{var t=bz(),n=I(t);K(n,17,()=>o,({group:e,templates:t})=>e,(e,t)=>{let n=()=>B(t).group,r=()=>B(t).templates;var i=yz(),a=I(i),o=L(a,!0),s=R(a,2);K(s,21,r,Qi,(e,t)=>{var n=vz(),r=F(n),i=F(r);iM(i,{get brand(){return B(t).type},size:16});var a=R(i),o=L(R(a),!0);D(r);var s=R(r,2),c=L(s,!0),u=R(s,2),d=e=>{var n=_z(),r=L(n);z(()=>W(r,`Needs ${B(l)[B(t).type].install??``}`)),U(e,n)};G(u,e=>{B(l)[B(t).type]&&!B(l)[B(t).type].ok&&e(d)}),D(n),z(()=>{W(a,` ${(B(t).card||B(t).name)??``} `),W(o,Tx[B(t).type]),W(c,B(t).blurb)}),V(`click`,n,()=>b(B(t))),U(e,n)}),D(s),z(()=>W(o,n())),U(e,i)}),V(`click`,L(R(n,2)),()=>N(m,!1)),U(e,t)};G(n,e=>{B(m)?e(i,-1):e(r)}),U(e,t)};G(ce,e=>{B(p)&&!B(p).id?e(le):B(p)||e(ue,1)}),nz(R(ce,4),{}),U(e,ee),k(),i()}ki([`click`,`keydown`]);var Cz=H(`

`),wz=H(`

No secrets yet — add one below, or paste a key in a model form.

`),Tz=H(``),Ez=H(`

`),Dz=H(`
`),Oz=H(`default`),kz=H(`
`),Az=H(`
`),jz=H(``),Mz=H(`
Secrets

Named, reusable API keys. Attach one to any Text or Live model; mark a provider-tagged secret as its provider's default fallback. Values are never - shown back — only the last 4 characters.

`,1);function Sz(e,t){O(t,!0);let n=()=>A(aL,`$secretsStore`,r),[r,i]=Zt(),a=[``,`openai`,`anthropic`,`gemini`],o={"":`no provider`,openai:`OpenAI`,anthropic:`Anthropic`,gemini:`Gemini`},s=j(()=>n().secrets),c=M(null),l=M(``),u=M(``),d=M(``),f=M(!1),p=M(!1),m=M(``);io(oL);function h(){N(c,`new`),N(l,``),N(u,``),N(d,``),N(f,!1),N(m,``)}function g(e){N(c,e.id,!0),N(l,e.name,!0),N(u,``),N(d,e.provider,!0),N(f,e.default,!0),N(m,``)}function _(){N(c,null),N(m,``)}async function v(){await Promise.all([oL(),oT(),Aj()])}async function y(){N(p,!0),N(m,``);try{B(c)===`new`?await Q.createSecret({name:B(l).trim(),value:B(u).trim(),provider:B(d),default:B(f)}):B(c)&&await Q.updateSecret(B(c),{name:B(l).trim(),value:B(u)===``?null:B(u).trim(),provider:B(d),default:B(f)}),_(),await v()}catch(e){N(m,nS(e),!0)}N(p,!1)}async function b(e){let t=e.used_by?.length?`\n\nUsed by ${e.used_by.length} model${e.used_by.length>1?`s`:``}: ${e.used_by.join(`, `)}.\nThey will fall back to the provider default or env key.`:``;if(confirm(`Delete secret "${e.name}"?${t}`)){N(p,!0),N(m,``);try{await Q.deleteSecret(e.id),await v()}catch(e){N(m,nS(e),!0)}N(p,!1)}}var x=xz(),S=R(I(x),4),C=e=>{var t=fz(),n=L(t,!0);z(()=>W(n,B(m))),U(e,t)};G(S,e=>{B(m)&&B(c)===null&&e(C)});var w=R(S,2),T=e=>{U(e,pz())};G(w,e=>{!B(s).length&&B(c)===null&&e(T)});var ee=R(w,2);K(ee,17,()=>B(s),e=>e.id,(e,t)=>{var n=Bi(),r=I(n),i=e=>{var n=gz(),r=F(n),i=R(F(r),2);za(i),D(r);var s=R(r,2),c=R(F(s),2);za(c),D(s);var h=R(s,2),g=R(F(h),2);K(g,21,()=>a,Qi,(e,t)=>{var n=mz(),r=L(n,!0),i={};z(()=>{W(r,o[B(t)]),i!==(i=B(t))&&(n.value=(n.__value=i)??``)}),U(e,n)}),D(g),Ea(g),D(h);var v=R(h,2),b=F(v),x=F(b);za(x);var S=R(x);D(b),D(v);var C=R(v,2),w=e=>{var t=hz(),n=L(t,!0);z(()=>W(n,B(m))),U(e,t)};G(C,e=>{B(m)&&e(w)});var T=R(C,2),ee=F(T),te=R(ee,2),ne=L(te,!0);D(T),D(n),z(e=>{J(c,`placeholder`,`•••• `+(B(t).hint||``)),x.disabled=!B(d),W(S,` Default for ${(o[B(d)]||`its provider`)??``}`),ee.disabled=B(p),te.disabled=e,W(ne,B(p)?`Saving…`:`Save`)},[()=>B(p)||!B(l).trim()]),qa(i,()=>B(l),e=>N(l,e)),qa(c,()=>B(u),e=>N(u,e)),V(`change`,g,()=>{B(d)||N(f,!1)}),Da(g,()=>B(d),e=>N(d,e)),Ja(x,()=>B(f),e=>N(f,e)),V(`click`,ee,_),V(`click`,te,y),U(e,n)},s=e=>{var n=vz(),r=F(n),i=F(r),a=F(i),s=R(a),l=e=>{U(e,_z())};G(s,e=>{B(t).default&&e(l)}),D(i);var u=R(i,2),d=L(F(u));D(u),D(r);var f=R(r,2),m=R(f,2);D(n),z(()=>{W(a,`${B(t).name??``} `),W(d,`${B(t).provider?o[B(t).provider]+` · `:``}${B(t).hint??``}${B(t).used_by?.length?` · used by ${B(t).used_by.length} model${B(t).used_by.length>1?`s`:``}`:``}`),f.disabled=B(p)||B(c)!==null,m.disabled=B(p)||B(c)!==null}),V(`click`,f,()=>g(B(t))),V(`click`,m,()=>b(B(t))),U(e,n)};G(r,e=>{B(c)===B(t).id?e(i):e(s,-1)}),U(e,n)});var te=R(ee,2),ne=e=>{var t=yz(),n=F(t),r=R(F(n),2);za(r),D(n);var i=R(n,2),s=R(F(i),2);za(s),D(i);var c=R(i,2),h=R(F(c),2);K(h,21,()=>a,Qi,(e,t)=>{var n=mz(),r=L(n,!0),i={};z(()=>{W(r,o[B(t)]),i!==(i=B(t))&&(n.value=(n.__value=i)??``)}),U(e,n)}),D(h),Ea(h),D(c);var g=R(c,2),v=F(g),b=F(v);za(b);var x=R(b);D(v),D(g);var S=R(g,2),C=e=>{var t=hz(),n=L(t,!0);z(()=>W(n,B(m))),U(e,t)};G(S,e=>{B(m)&&e(C)});var w=R(S,2),T=F(w),ee=R(T,2),te=L(ee,!0);D(w),D(t),z(e=>{b.disabled=!B(d),W(x,` Default for ${(o[B(d)]||`its provider`)??``}`),T.disabled=B(p),ee.disabled=e,W(te,B(p)?`Saving…`:`Add`)},[()=>B(p)||!B(l).trim()||!B(u).trim()]),qa(r,()=>B(l),e=>N(l,e)),qa(s,()=>B(u),e=>N(u,e)),V(`change`,h,()=>{B(d)||N(f,!1)}),Da(h,()=>B(d),e=>N(d,e)),Ja(b,()=>B(f),e=>N(f,e)),V(`click`,T,_),V(`click`,ee,y),U(e,t)},re=e=>{var t=bz();$(F(t),{name:`plus`,size:14}),tt(),D(t),z(()=>t.disabled=B(p)),V(`click`,t,h),U(e,t)};G(te,e=>{B(c)===`new`?e(ne):B(c)===null&&e(re,1)}),U(e,x),k(),i()}ki([`change`,`click`]);var Cz=H(`

`),wz=H(`

No skills installed.

`),Tz=H(` `,1),Ez=H(``),Dz=H(` `,1),Oz=H(`

`),kz=H(`
Skills install-wide

Turn a skill off to drop it from the agent's toolkit everywhere, without deleting it. Bundled skills ship with the app and can't be removed.

`);function Az(e,t){O(t,!0);let n={search:Q.searchSkills,install:Q.installSkill,discover:Q.discoverSkills,discoverUpload:Q.discoverSkillsUpload,installUpload:Q.installSkillUpload},r=M(P([])),i=M(``),a=M(``),o=M(``),s=M(P([])),c=e=>[...e].sort((e,t)=>(e.origin===`bundled`)-+(t.origin===`bundled`)||!e.enabled-+!t.enabled),l=async()=>{try{let e=(await Q.skills()).skills;N(r,e,!0),N(s,c(e).map(e=>e.name),!0)}catch(e){N(a,nS(e),!0)}};io(l);let u=async e=>{N(a,``),N(i,e.name,!0);try{N(r,(await Q.setSkillState(e.name,!e.enabled)).skills,!0)}catch(e){N(a,nS(e),!0)}N(i,``)},d=async e=>{N(a,``),N(i,e.name,!0);try{N(r,(await Q.deleteSkill(e.name)).skills,!0),N(o,``)}catch(e){N(a,nS(e),!0)}N(i,``)},f=j(()=>{let e=new Map(B(s).map((e,t)=>[e,t]));return[...B(r)].sort((t,n)=>(e.get(t.name)??1e9)-(e.get(n.name)??1e9))});var p=kz(),m=R(F(p),4),h=e=>{var t=Cz(),n=L(t,!0);z(()=>W(n,B(a))),U(e,t)};G(m,e=>{B(a)&&e(h)});var g=R(m,2);dI(F(g),{get installer(){return n},onInstalled:l}),D(g);var _=R(g,2),v=F(_),y=e=>{U(e,wz())};G(v,e=>{B(r).length===0&&e(y)}),K(R(v,2),17,()=>B(f),e=>e.name,(e,t)=>{let n=j(()=>B(i)===B(t).name),r=j(()=>!B(n)&&B(o)!==B(t).name);var a=Oz();let s;var c=F(a);let l;var f=F(c),p=F(f),m=L(p,!0),h=R(p,2),g=L(h,!0);D(f);var _=R(f,2),v=F(_);let y;D(_),D(c);var b=R(c,2),x=F(b),S=e=>{var r=Tz(),i=I(r),a=L(i),s=R(i,2),c=R(s,2);z(()=>{W(a,`Delete ${B(t).name??``}?`),s.disabled=B(n),c.disabled=B(n)}),V(`click`,s,()=>d(B(t))),V(`click`,c,()=>N(o,``)),U(e,r)},C=e=>{var r=Dz(),i=I(r);let a;var s=R(i),c=R(s),l=e=>{var r=Ez();z(()=>r.disabled=B(n)),V(`click`,r,()=>N(o,B(t).name,!0)),U(e,r)};G(c,e=>{B(t).origin!==`bundled`&&e(l)}),z(()=>{a=q(i,1,`skdot`,null,a,{third:B(t).origin!==`bundled`}),W(s,` ${B(t).origin===`bundled`?`First-party · ships with the app`:`Installed · global`} `)}),U(e,r)};G(x,e=>{B(o)===B(t).name?e(S):e(C,-1)}),D(b),D(a),z(()=>{s=q(a,1,`skcard`,null,s,{off:!B(t).enabled}),l=q(c,1,`sktop`,null,l,{clickable:B(r)}),J(c,`aria-checked`,B(t).enabled),J(c,`aria-disabled`,!B(r)),J(c,`tabindex`,B(r)?0:-1),J(c,`aria-labelledby`,`sk-${B(t).name??``}`),J(c,`aria-describedby`,`skd-${B(t).name??``}`),J(c,`title`,B(r)?B(t).enabled?`Click to turn off`:`Click to turn on`:``),J(p,`id`,`sk-${B(t).name??``}`),W(m,B(t).name),J(h,`id`,`skd-${B(t).name??``}`),W(g,B(t).description),y=q(v,1,`setswitch`,null,y,{on:B(t).enabled,busy:B(n)})}),V(`click`,c,()=>{B(r)&&u(B(t))}),V(`keydown`,c,e=>{(e.key===`Enter`||e.key===` `)&&B(r)&&(e.preventDefault(),u(B(t)))}),U(e,a)}),D(_),D(p),U(e,p),k()}ki([`click`,`keydown`]);var jz=/^[A-Za-z0-9_.-]{1,64}$/,Mz=new Set([`npx`,`uvx`,`uv`,`npm`,`pnpm`,`bunx`,`node`,`python`,`python3`,`docker`,`deno`]);function Nz(e){let t=String(e||``).trim().replace(/[^A-Za-z0-9_.-]+/g,`-`).replace(/^-+|-+$/g,``).slice(0,64);return jz.test(t)?t:``}var Pz=e=>e.replace(/^(mcp[-_])?(server[-_])?/,``).replace(/[-_]?(mcp|server)$/,``);function Fz(e,t=[]){for(let e of t){let t=String(e);if(t.startsWith(`-`)||t.includes(`=`)||/[\\/]|^\.|^~/.test(t)&&!t.startsWith(`@`))continue;let n=(t.split(`/`).pop()??``).replace(/@[\w.^~-]+$/,``),r=Nz(Pz(n)||n);if(r)return r}let n=String(e||``).split(`/`).pop()??``;return n&&!Mz.has(n)?Nz(Pz(n)||n):`mcp`}function Iz(e,t){if(!t||typeof t!=`object`||Array.isArray(t))return null;let n=t,r=String(n.command||``).trim();if(!r)return null;let i=Array.isArray(n.args)?n.args.map(String):[],a={};if(n.env&&typeof n.env==`object`&&!Array.isArray(n.env))for(let[e,t]of Object.entries(n.env))String(e).trim()&&(a[String(e)]=String(t));return{name:Nz(e)||Fz(r,i),command:r,args:i,env:a,cwd:typeof n.cwd==`string`?n.cwd.trim():``}}function Lz(e){let t=[],n=/"([^"]*)"|'([^']*)'|(\S+)/g,r;for(;r=n.exec(e);)t.push(r[1]??r[2]??r[3]??``);return t}function Rz(e){let t=Lz(e.replace(/^\$\s+/,``)),n={};for(;t.length&&/^[A-Za-z_][A-Za-z0-9_]*=/.test(t[0]);){let[e,...r]=(t.shift()??``).split(`=`);n[e]=r.join(`=`)}if(!t.length)return null;let[r,...i]=t;return{name:Fz(r,i),command:r,args:i,env:n,cwd:``}}function zz(e){if(!e||typeof e!=`object`||Array.isArray(e))return[];let t=e,n=t.mcpServers||t.mcp_servers||t.servers;if(n&&typeof n==`object`&&!Array.isArray(n))return Object.entries(n).map(([e,t])=>Iz(e,t)).filter(Bz);if(t.command)return[Iz(t.name,t)].filter(Bz);let r=Object.entries(t);return r.length&&r.every(([,e])=>e&&typeof e==`object`&&`command`in e&&e.command)?r.map(([e,t])=>Iz(e,t)).filter(Bz):[]}var Bz=e=>e!==null;function Vz(e){let t=String(e||``).trim();if(!t)return{servers:[],error:``};if(t.startsWith(`{`)||t.startsWith(`"`)){let e=[t,`{${t}}`].map(e=>e.replace(/,\s*([}\]])/g,`$1`));for(let t of e)try{let e=zz(JSON.parse(t));if(e.length)return{servers:e,error:``}}catch{}return{servers:[],error:`Could not read that as MCP JSON — expected {"mcpServers": {...}} or a single {"command": ...} config.`}}let n=Rz(t.split(` -`)[0]);return n?{servers:[n],error:``}:{servers:[],error:`Could not read that — paste a JSON config or a command line.`}}var Hz=[{id:`repo-files`,label:`Project files`,blurb:`read-only access to a folder — browse and search, never write`,command:`npx`,args:[`-y`,`@modelcontextprotocol/server-filesystem`],allowed_tools:[`read_file`,`read_multiple_files`,`list_directory`,`directory_tree`,`search_files`,`get_file_info`,`list_allowed_directories`],inputs:[{key:`folder`,label:`Folder`,ph:`/path/to/project`,kind:`arg`,required:!0}],requires:`Node.js`},{id:`browser`,label:`Browser`,blurb:`drive a real web browser — navigate, click, type, screenshot`,command:`npx`,args:[`-y`,`@playwright/mcp@latest`,`--sandbox`],inputs:[],requires:`Node.js + Chrome`},{id:`fetch`,label:`Fetch`,blurb:`fetch a web page by URL and convert it to markdown`,command:`uvx`,args:[`mcp-server-fetch`],inputs:[],requires:`Python (uv)`},{id:`time`,label:`Time`,blurb:`current time and timezone conversions`,command:`uvx`,args:[`mcp-server-time`],inputs:[],requires:`Python (uv)`},{id:`github`,label:`GitHub`,blurb:`repos, issues and pull requests via the GitHub API`,command:`npx`,args:[`-y`,`@modelcontextprotocol/server-github`],inputs:[{key:`GITHUB_PERSONAL_ACCESS_TOKEN`,label:`Access token`,ph:`ghp_…`,kind:`env`,required:!0}],requires:`Node.js`}];function Uz(e,t={}){let n=[...e.args],r={};for(let i of e.inputs||[]){let e=String(t[i.key]||``).trim();e&&(i.kind===`arg`?n.push(e):r[i.key]=e)}let i={name:e.id,command:e.command,args:n,env:r,cwd:``};return e.allowed_tools&&(i.allowed_tools=[...e.allowed_tools]),i}var Wz=H(`

`),Gz=H(`

No MCP servers configured — add one below to give the assistant new tools.

`),Kz=H(` `),qz=H(`checking…`),Jz=H(`
`),Yz=H(``),Xz=H(`
`),Zz=H(`
`),Qz=H(`

`),$z=H(`
`),eB=H(`
Name
`),tB=H(`
`,1),nB=H(``),rB=H(`
`),iB=H(`
`,1);function aB(e,t){O(t,!0);let n=M(P([])),r=M(P({})),i=M(!1),a=M(``),o=M(``),s=M(void 0),c=M(P([])),l=M(``),u=M(``),d=M(P({})),f=M(!1),p=M(P({name:``,command:``,args:``,cwd:``,allowed_tools:``,blocked_tools:``,env:``})),m=j(()=>new Set(B(n).map(e=>e.name)));io(async()=>{try{let e=await Q.settings();N(n,e.mcp_servers,!0)}catch(e){N(a,nS(e),!0)}});async function h(e){N(r,{...B(r),[e]:{checking:!0}},!0);try{N(r,{...B(r),[e]:await Q.healthMcpServer(e)},!0)}catch(t){N(r,{...B(r),[e]:{ok:!1,error:nS(t)}},!0)}}async function g(e){N(a,``),N(i,!0);try{let t=await Q.addMcpServer(e);return N(n,t.mcp_servers,!0),N(i,!1),await h(e.name),!0}catch(e){return N(a,nS(e),!0),N(i,!1),!1}}async function _(e){N(a,``),N(i,!0);try{let t=await Q.deleteMcpServer(e);N(n,t.mcp_servers,!0);let{[e]:i,...a}=B(r);N(r,a,!0)}catch(e){N(a,nS(e),!0)}N(i,!1)}function v(e){N(o,e.value,!0),e.style.height=`auto`,e.style.height=e.value?e.scrollHeight+2+`px`:``;let{servers:t,error:n}=Vz(e.value);N(l,n,!0),N(c,t,!0)}async function y(){for(let e of B(c))if(!await g(e))return;N(o,``),N(c,[],!0),N(l,``),B(s)&&(B(s).style.height=``)}function b(e){if(!(B(m).has(e.id)||B(i))){if(!e.inputs.length){S(e);return}N(u,B(u)===e.id?``:e.id,!0),N(d,{},!0)}}let x=e=>e.inputs.every(e=>!e.required||(B(d)[e.key]||``).trim());async function S(e){await g(Uz(e,B(d)))&&(N(u,``),N(d,{},!0))}async function C(){await g(B(p))&&(N(p,{name:``,command:``,args:``,cwd:``,allowed_tools:``,blocked_tools:``,env:``},!0),N(f,!1))}let w=e=>[e.command,...e.args].join(` `);var T=iB(),ee=I(T),te=e=>{var t=Wz(),n=L(t,!0);z(()=>W(n,B(a))),U(e,t)};G(ee,e=>{B(a)&&e(te)});var ne=R(ee,2),re=e=>{U(e,Gz())};G(ne,e=>{B(n).length||e(re)});var ie=R(ne,2);K(ie,17,()=>B(n),e=>e.name,(e,t)=>{let n=j(()=>B(r)[B(t).name]);var a=Jz(),o=F(a),s=F(o),c=L(s,!0),l=R(s,2),u=L(l,!0),d=R(l,2),f=e=>{var n=Kz(),r=L(n);z(e=>W(r,`env: ${e??``}`),[()=>B(t).env_keys.join(`, `)]),U(e,n)};G(d,e=>{B(t).env_keys.length&&e(f)});var p=R(d,2),m=e=>{var t=Bi(),r=I(t),i=e=>{U(e,qz())},a=e=>{var t=Kz();let r;var i=L(t,!0);z(()=>{r=q(t,1,``,null,r,{mcpbad:!B(n).ok}),W(i,B(n).ok?`healthy · ${(B(n).tools||[]).length} tools`:B(n).error)}),U(e,t)};G(r,e=>{B(n).checking?e(i):e(a,-1)}),U(e,t)};G(p,e=>{B(n)&&e(m)}),D(o);var g=R(o,2),v=R(g,2);D(a),z(e=>{W(c,B(t).name),W(u,e),g.disabled=B(i),v.disabled=B(i)},[()=>w(B(t))]),V(`click`,g,()=>h(B(t).name)),V(`click`,v,()=>_(B(t).name)),U(e,a)});var ae=R(ie,2);K(ae,21,()=>Hz,e=>e.id,(e,t)=>{let n=j(()=>B(m).has(B(t).id));var r=Yz();let a;var o=F(r),s=F(o),c=e=>{$(e,{name:`check`,size:13})},l=e=>{$(e,{name:`plus`,size:13})};G(s,e=>{B(n)?e(c):e(l,-1)});var d=R(s);D(o);var f=L(R(o,2),!0);D(r),z(e=>{a=q(r,1,`mcpcatcard`,null,a,{added:B(n),openinputs:B(u)===B(t).id}),r.disabled=B(i)||B(n),J(r,`title`,e),W(d,` ${B(t).label??``}`),W(f,B(t).blurb)},[()=>B(n)?`Already added`:`Runs: ${[B(t).command,...B(t).args].join(` `)} — needs ${B(t).requires}`]),V(`click`,r,()=>b(B(t))),U(e,r)}),D(ae);var oe=R(ae,2);K(oe,17,()=>Hz.filter(e=>e.id===B(u)),e=>e.id,(e,t)=>{var n=Zz(),r=F(n);K(r,17,()=>B(t).inputs,e=>e.key,(e,t)=>{var n=Xz(),r=F(n),i=L(r,!0),a=R(r,2);za(a),D(n),z(()=>{W(i,B(t).label),J(a,`type`,B(t).kind===`env`?`password`:`text`),J(a,`placeholder`,B(t).ph)}),qa(a,()=>B(d)[B(t).key],e=>B(d)[B(t).key]=e),U(e,n)});var a=R(r,2),o=F(a),s=R(o,2),c=L(s);D(a),D(n),z(e=>{s.disabled=e,W(c,`Add ${B(t).label??``}`)},[()=>B(i)||!x(B(t))]),V(`click`,o,()=>N(u,``)),V(`click`,s,()=>S(B(t))),U(e,n)});var se=R(oe,2);tn(se),J(se,`placeholder`,`Or paste an MCP config — the {"mcpServers": …} JSON from a server's README, or a command line like: npx -y @modelcontextprotocol/server-github`),Qa(se,e=>N(s,e),()=>B(s));var ce=R(se,2),le=e=>{var t=Qz(),n=L(t,!0);z(()=>W(n,B(l))),U(e,t)};G(ce,e=>{B(l)&&e(le)});var ue=R(ce,2),de=e=>{var t=tB(),n=I(t);K(n,17,()=>B(c),Qi,(e,t,n)=>{var r=eB(),i=F(r),a=R(F(i),2);za(a);var o=R(a,2),s=L(o,!0);D(i),K(R(i,2),16,()=>Object.keys(B(t).env),e=>e,(e,n)=>{var r=$z(),i=F(r),a=L(i,!0),o=R(i,2);za(o),D(r),z(()=>{J(i,`title`,n),W(a,n)}),qa(o,()=>B(t).env[n],e=>B(t).env[n]=e),U(e,r)}),D(r),z((e,t)=>{J(o,`title`,e),W(s,t)},[()=>w(B(t)),()=>w(B(t))]),qa(a,()=>B(t).name,e=>B(t).name=e),U(e,r)});var r=R(n,2),a=F(r),o=L(a);D(r),z(e=>{a.disabled=e,W(o,`Add ${(B(c).length===1?B(c)[0].name:`${B(c).length} servers`)??``}`)},[()=>B(i)||B(c).some(e=>!e.name)]),V(`click`,a,y),U(e,t)};G(ue,e=>{B(c).length&&e(de)});var fe=R(ue,2),E=e=>{var t=nB();V(`click`,t,()=>N(f,!0)),U(e,t)},pe=e=>{var t=rB(),n=F(t);za(n);var r=R(n,2);za(r);var a=R(r,2);za(a);var o=R(a,2);za(o);var s=R(o,2);za(s);var c=R(s,2);za(c);var l=R(c,2);tn(l);var u=R(l,2),d=F(u),m=R(d,2);D(u),D(t),z(()=>d.disabled=B(i)||!B(p).name||!B(p).command),qa(n,()=>B(p).name,e=>B(p).name=e),qa(r,()=>B(p).command,e=>B(p).command=e),qa(a,()=>B(p).args,e=>B(p).args=e),qa(o,()=>B(p).cwd,e=>B(p).cwd=e),qa(s,()=>B(p).allowed_tools,e=>B(p).allowed_tools=e),qa(c,()=>B(p).blocked_tools,e=>B(p).blocked_tools=e),qa(l,()=>B(p).env,e=>B(p).env=e),V(`click`,d,C),V(`click`,m,()=>N(f,!1)),U(e,t)};G(fe,e=>{B(f)?e(pe,-1):e(E)}),z(()=>Ba(se,B(o))),V(`input`,se,e=>v(e.currentTarget)),U(e,T),k()}ki([`click`,`input`]);var oB=H(`
`),sB=H(`
Checking…
`),cB=H(` Host bridge `,1),lB=H(` Running on the host — agents detected locally`,1),uB=H(`
ag2-assistant acp-bridge --port 8801
`),dB=H(`
  • `),fB=H(`
  • No coding agents visible.
  • `),pB=H(`To use the host's agents from Docker, run ag2-assistant acp-bridge on the host and - set AG2ASSISTANT_ACP_BRIDGE (see docker-compose.yml).`,1),mB=H(`
      Coding runs are not sandboxed — the agent edits real files in the folder you approve.
      `,1),hB=H(`
      Coding agents host CLIs
      `,1);function gB(e,t){O(t,!0);let n=M(null),r=M(``);async function i(){N(r,``);try{N(n,await Q.codingAgents(),!0)}catch(e){N(r,nS(e),!0)}}io(i);var a=hB(),o=R(I(a),2),s=e=>{var t=oB(),n=L(t);z(()=>W(n,`Couldn't load coding-agent status: ${B(r)??``}`)),U(e,t)},c=e=>{U(e,sB())},l=e=>{var t=mB(),r=I(t),i=F(r),a=e=>{var t=cB(),r=I(t);let i;var a=R(r,2),o=L(a,!0),s=R(a);z(()=>{i=q(r,1,`ca-dot svelte-1a3c600`,null,i,{on:B(n).connected,off:!B(n).connected}),W(o,B(n).bridge),W(s,` — - ${B(n).connected?`connected`:`not reachable`}`)}),U(e,t)},o=e=>{var t=lB();tt(),U(e,t)};G(i,e=>{B(n).mode===`bridge`?e(a):e(o,-1)}),D(r);var s=R(r,2),c=e=>{var t=uB(),r=F(t);tt(),D(t),z(()=>W(r,`${(B(n).error||`The bridge did not respond.`)??``} - Start it on the host: `)),U(e,t)};G(s,e=>{B(n).mode===`bridge`&&!B(n).connected&&e(c)});var l=R(s,2);K(l,21,()=>B(n).agents,e=>e.name,(e,t)=>{var n=dB(),r=F(n),i=F(r),a=L(R(i));D(r);var o=R(r,2);let s;var c=L(o,!0);D(n),z(()=>{W(i,`${B(t).label??``} `),W(a,`(${B(t).name??``})`),s=q(o,1,`ca-badge svelte-1a3c600`,null,s,{ok:B(t).available}),W(c,B(t).available?`available`:`not installed`)}),U(e,n)},e=>{U(e,fB())}),D(l);var u=R(l,2),d=R(F(u)),f=e=>{var t=pB();tt(4),U(e,t)};G(d,e=>{B(n).mode===`local`&&e(f)}),D(u),U(e,t)};G(o,e=>{B(r)?e(s):B(n)?e(l,-1):e(c,1)}),U(e,a),k()}var _B=H(`

      `),vB=H(`

      No command grants yet.

      `),yB=H(`
      `),bB=H(`
      Command grants

      A tool name allows every call to that tool (action tools like gmail_send). Shell takes a prefix rule — run_shell_command(git *) — and host code runs (run_code) are approved individually, never blanket-allowed.

      `,1);function xB(e,t){O(t,!0);let n=M(P({commands:[]})),r=M(!1),i=M(``),a=M(``),o=/^([\w.-]+)\(([^()\s][^()]*) \*\)$/;function s(e){let t=e.trim();if(!t)return null;let n=t.match(o);return n?{tool:n[1],prefix:n[2]}:/^[\w.-]+$/.test(t)?{tool:t,prefix:null}:null}let c=e=>e.prefix?`${e.tool}(${e.prefix} *)`:e.tool,l=j(()=>{let e=s(B(a));return!!e&&!B(n).commands.includes(c(e))}),u=e=>{N(n,{commands:e.commands},!0)};io(async()=>{try{u(await Q.permissions())}catch(e){N(i,nS(e),!0)}});async function d(e){N(i,``),N(r,!0);try{u(await e())}catch(e){N(i,nS(e),!0)}N(r,!1)}let f=e=>d(()=>Q.revokeCommand(e));function p(){let e=s(B(a));!e||!B(l)||d(()=>Q.grantCommand(e.tool,e.prefix).then(e=>(N(a,``),e)))}var m=bB(),h=I(m),g=e=>{var t=_B(),n=L(t,!0);z(()=>W(n,B(i))),U(e,t)};G(h,e=>{B(i)&&e(g)});var _=R(h,2),v=R(F(_),2),y=e=>{U(e,vB())};G(v,e=>{B(n).commands.length||e(y)});var b=R(v,2);K(b,16,()=>B(n).commands,e=>e,(e,t)=>{var n=yB(),i=F(n);$(F(i),{name:`code`,size:14}),D(i);var a=R(i,2),o=L(a,!0),s=R(a,2);D(n),z(()=>{J(a,`title`,t),W(o,t),s.disabled=B(r)}),V(`click`,s,()=>f(t)),U(e,n)});var x=R(b,2),S=F(x);za(S);var C=R(S,2);D(x),tt(2),D(_),z(()=>C.disabled=B(r)||!B(l)),V(`keydown`,S,e=>e.key===`Enter`&&p()),qa(S,()=>B(a),e=>N(a,e)),V(`click`,C,p),U(e,m),k()}ki([`click`,`keydown`]);var SB=H(`
      MCP servers
      Permissions install-wide
      `,1);function CB(e){var t=SB(),n=R(I(t),2);aB(n,{});var r=R(n,2);gB(r,{}),xB(R(r,4),{}),U(e,t)}var wB=H(` `);function TB(e,t){O(t,!0);var n=wB(),r=F(n),i=e=>{$(e,{name:`check`,size:13})};G(r,e=>{t.status.kind===`ok`&&e(i)});var a=R(r,2),o=e=>{$(e,{name:`alert-triangle`,size:13})};G(a,e=>{t.status.kind===`err`&&e(o)});var s=L(R(a,2),!0);D(n),z(()=>{q(n,1,`cnstat ${t.status.kind??``}`),W(s,t.status.text)}),U(e,n),k()}var EB=H(`

      `),DB=H(`

      No listeners yet — add one below.

      `),OB=H(`

      Token
      `),kB=H(` `,1),AB=H(``),jB=H(`

      A stdio listener binds nothing — its client launches it. Point that client at:

      `),MB=H(``),NB=H(`
      `),PB=H(`
    • `),FB=H(`
        `),IB=H(``),LB=H(``),RB=H(`

        Nothing is bound and no token is needed: the client runs itself. The + shown back — only the last 4 characters.

        `,1);function Nz(e,t){O(t,!0);let n=()=>A(gL,`$secretsStore`,r),[r,i]=Zt(),a=[``,`openai`,`anthropic`,`gemini`],o={"":`no provider`,openai:`OpenAI`,anthropic:`Anthropic`,gemini:`Gemini`},s=j(()=>n().secrets),c=M(null),l=M(``),u=M(``),d=M(``),f=M(!1),p=M(!1),m=M(``);io(_L);function h(){N(c,`new`),N(l,``),N(u,``),N(d,``),N(f,!1),N(m,``)}function g(e){N(c,e.id,!0),N(l,e.name,!0),N(u,``),N(d,e.provider,!0),N(f,e.default,!0),N(m,``)}function _(){N(c,null),N(m,``)}async function v(){await Promise.all([_L(),cT(),Vj()])}async function y(){N(p,!0),N(m,``);try{B(c)===`new`?await Q.createSecret({name:B(l).trim(),value:B(u).trim(),provider:B(d),default:B(f)}):B(c)&&await Q.updateSecret(B(c),{name:B(l).trim(),value:B(u)===``?null:B(u).trim(),provider:B(d),default:B(f)}),_(),await v()}catch(e){N(m,iS(e),!0)}N(p,!1)}async function b(e){let t=e.used_by?.length?`\n\nUsed by ${e.used_by.length} model${e.used_by.length>1?`s`:``}: ${e.used_by.join(`, `)}.\nThey will fall back to the provider default or env key.`:``;if(confirm(`Delete secret "${e.name}"?${t}`)){N(p,!0),N(m,``);try{await Q.deleteSecret(e.id),await v()}catch(e){N(m,iS(e),!0)}N(p,!1)}}var x=Mz(),S=R(I(x),4),C=e=>{var t=Cz(),n=L(t,!0);z(()=>W(n,B(m))),U(e,t)};G(S,e=>{B(m)&&B(c)===null&&e(C)});var w=R(S,2),T=e=>{U(e,wz())};G(w,e=>{!B(s).length&&B(c)===null&&e(T)});var ee=R(w,2);K(ee,17,()=>B(s),e=>e.id,(e,t)=>{var n=Bi(),r=I(n),i=e=>{var n=Dz(),r=F(n),i=R(F(r),2);za(i),D(r);var s=R(r,2),c=R(F(s),2);za(c),D(s);var h=R(s,2),g=R(F(h),2);K(g,21,()=>a,Qi,(e,t)=>{var n=Tz(),r=L(n,!0),i={};z(()=>{W(r,o[B(t)]),i!==(i=B(t))&&(n.value=(n.__value=i)??``)}),U(e,n)}),D(g),Ea(g),D(h);var v=R(h,2),b=F(v),x=F(b);za(x);var S=R(x);D(b),D(v);var C=R(v,2),w=e=>{var t=Ez(),n=L(t,!0);z(()=>W(n,B(m))),U(e,t)};G(C,e=>{B(m)&&e(w)});var T=R(C,2),ee=F(T),te=R(ee,2),ne=L(te,!0);D(T),D(n),z(e=>{J(c,`placeholder`,`•••• `+(B(t).hint||``)),x.disabled=!B(d),W(S,` Default for ${(o[B(d)]||`its provider`)??``}`),ee.disabled=B(p),te.disabled=e,W(ne,B(p)?`Saving…`:`Save`)},[()=>B(p)||!B(l).trim()]),qa(i,()=>B(l),e=>N(l,e)),qa(c,()=>B(u),e=>N(u,e)),V(`change`,g,()=>{B(d)||N(f,!1)}),Da(g,()=>B(d),e=>N(d,e)),Ja(x,()=>B(f),e=>N(f,e)),V(`click`,ee,_),V(`click`,te,y),U(e,n)},s=e=>{var n=kz(),r=F(n),i=F(r),a=F(i),s=R(a),l=e=>{U(e,Oz())};G(s,e=>{B(t).default&&e(l)}),D(i);var u=R(i,2),d=L(F(u));D(u),D(r);var f=R(r,2),m=R(f,2);D(n),z(()=>{W(a,`${B(t).name??``} `),W(d,`${B(t).provider?o[B(t).provider]+` · `:``}${B(t).hint??``}${B(t).used_by?.length?` · used by ${B(t).used_by.length} model${B(t).used_by.length>1?`s`:``}`:``}`),f.disabled=B(p)||B(c)!==null,m.disabled=B(p)||B(c)!==null}),V(`click`,f,()=>g(B(t))),V(`click`,m,()=>b(B(t))),U(e,n)};G(r,e=>{B(c)===B(t).id?e(i):e(s,-1)}),U(e,n)});var te=R(ee,2),ne=e=>{var t=Az(),n=F(t),r=R(F(n),2);za(r),D(n);var i=R(n,2),s=R(F(i),2);za(s),D(i);var c=R(i,2),h=R(F(c),2);K(h,21,()=>a,Qi,(e,t)=>{var n=Tz(),r=L(n,!0),i={};z(()=>{W(r,o[B(t)]),i!==(i=B(t))&&(n.value=(n.__value=i)??``)}),U(e,n)}),D(h),Ea(h),D(c);var g=R(c,2),v=F(g),b=F(v);za(b);var x=R(b);D(v),D(g);var S=R(g,2),C=e=>{var t=Ez(),n=L(t,!0);z(()=>W(n,B(m))),U(e,t)};G(S,e=>{B(m)&&e(C)});var w=R(S,2),T=F(w),ee=R(T,2),te=L(ee,!0);D(w),D(t),z(e=>{b.disabled=!B(d),W(x,` Default for ${(o[B(d)]||`its provider`)??``}`),T.disabled=B(p),ee.disabled=e,W(te,B(p)?`Saving…`:`Add`)},[()=>B(p)||!B(l).trim()||!B(u).trim()]),qa(r,()=>B(l),e=>N(l,e)),qa(s,()=>B(u),e=>N(u,e)),V(`change`,h,()=>{B(d)||N(f,!1)}),Da(h,()=>B(d),e=>N(d,e)),Ja(b,()=>B(f),e=>N(f,e)),V(`click`,T,_),V(`click`,ee,y),U(e,t)},re=e=>{var t=jz();$(F(t),{name:`plus`,size:14}),tt(),D(t),z(()=>t.disabled=B(p)),V(`click`,t,h),U(e,t)};G(te,e=>{B(c)===`new`?e(ne):B(c)===null&&e(re,1)}),U(e,x),k(),i()}ki([`change`,`click`]);var Pz=H(`

        `),Fz=H(`

        No skills installed.

        `),Iz=H(` `,1),Lz=H(``),Rz=H(` `,1),zz=H(`

        `),Bz=H(`
        Skills install-wide

        Turn a skill off to drop it from the agent's toolkit everywhere, without deleting it. Bundled skills ship with the app and can't be removed.

        `);function Vz(e,t){O(t,!0);let n={search:Q.searchSkills,install:Q.installSkill,discover:Q.discoverSkills,discoverUpload:Q.discoverSkillsUpload,installUpload:Q.installSkillUpload},r=M(P([])),i=M(``),a=M(``),o=M(``),s=M(P([])),c=e=>[...e].sort((e,t)=>(e.origin===`bundled`)-+(t.origin===`bundled`)||!e.enabled-+!t.enabled),l=async()=>{try{let e=(await Q.skills()).skills;N(r,e,!0),N(s,c(e).map(e=>e.name),!0)}catch(e){N(a,iS(e),!0)}};io(l);let u=async e=>{N(a,``),N(i,e.name,!0);try{N(r,(await Q.setSkillState(e.name,!e.enabled)).skills,!0)}catch(e){N(a,iS(e),!0)}N(i,``)},d=async e=>{N(a,``),N(i,e.name,!0);try{N(r,(await Q.deleteSkill(e.name)).skills,!0),N(o,``)}catch(e){N(a,iS(e),!0)}N(i,``)},f=j(()=>{let e=new Map(B(s).map((e,t)=>[e,t]));return[...B(r)].sort((t,n)=>(e.get(t.name)??1e9)-(e.get(n.name)??1e9))});var p=Bz(),m=R(F(p),4),h=e=>{var t=Pz(),n=L(t,!0);z(()=>W(n,B(a))),U(e,t)};G(m,e=>{B(a)&&e(h)});var g=R(m,2);SI(F(g),{get installer(){return n},onInstalled:l}),D(g);var _=R(g,2),v=F(_),y=e=>{U(e,Fz())};G(v,e=>{B(r).length===0&&e(y)}),K(R(v,2),17,()=>B(f),e=>e.name,(e,t)=>{let n=j(()=>B(i)===B(t).name),r=j(()=>!B(n)&&B(o)!==B(t).name);var a=zz();let s;var c=F(a);let l;var f=F(c),p=F(f),m=L(p,!0),h=R(p,2),g=L(h,!0);D(f);var _=R(f,2),v=F(_);let y;D(_),D(c);var b=R(c,2),x=F(b),S=e=>{var r=Iz(),i=I(r),a=L(i),s=R(i,2),c=R(s,2);z(()=>{W(a,`Delete ${B(t).name??``}?`),s.disabled=B(n),c.disabled=B(n)}),V(`click`,s,()=>d(B(t))),V(`click`,c,()=>N(o,``)),U(e,r)},C=e=>{var r=Rz(),i=I(r);let a;var s=R(i),c=R(s),l=e=>{var r=Lz();z(()=>r.disabled=B(n)),V(`click`,r,()=>N(o,B(t).name,!0)),U(e,r)};G(c,e=>{B(t).origin!==`bundled`&&e(l)}),z(()=>{a=q(i,1,`skdot`,null,a,{third:B(t).origin!==`bundled`}),W(s,` ${B(t).origin===`bundled`?`First-party · ships with the app`:`Installed · global`} `)}),U(e,r)};G(x,e=>{B(o)===B(t).name?e(S):e(C,-1)}),D(b),D(a),z(()=>{s=q(a,1,`skcard`,null,s,{off:!B(t).enabled}),l=q(c,1,`sktop`,null,l,{clickable:B(r)}),J(c,`aria-checked`,B(t).enabled),J(c,`aria-disabled`,!B(r)),J(c,`tabindex`,B(r)?0:-1),J(c,`aria-labelledby`,`sk-${B(t).name??``}`),J(c,`aria-describedby`,`skd-${B(t).name??``}`),J(c,`title`,B(r)?B(t).enabled?`Click to turn off`:`Click to turn on`:``),J(p,`id`,`sk-${B(t).name??``}`),W(m,B(t).name),J(h,`id`,`skd-${B(t).name??``}`),W(g,B(t).description),y=q(v,1,`setswitch`,null,y,{on:B(t).enabled,busy:B(n)})}),V(`click`,c,()=>{B(r)&&u(B(t))}),V(`keydown`,c,e=>{(e.key===`Enter`||e.key===` `)&&B(r)&&(e.preventDefault(),u(B(t)))}),U(e,a)}),D(_),D(p),U(e,p),k()}ki([`click`,`keydown`]);var Hz=/^[A-Za-z0-9_.-]{1,64}$/,Uz=new Set([`npx`,`uvx`,`uv`,`npm`,`pnpm`,`bunx`,`node`,`python`,`python3`,`docker`,`deno`]);function Wz(e){let t=String(e||``).trim().replace(/[^A-Za-z0-9_.-]+/g,`-`).replace(/^-+|-+$/g,``).slice(0,64);return Hz.test(t)?t:``}var Gz=e=>e.replace(/^(mcp[-_])?(server[-_])?/,``).replace(/[-_]?(mcp|server)$/,``);function Kz(e,t=[]){for(let e of t){let t=String(e);if(t.startsWith(`-`)||t.includes(`=`)||/[\\/]|^\.|^~/.test(t)&&!t.startsWith(`@`))continue;let n=(t.split(`/`).pop()??``).replace(/@[\w.^~-]+$/,``),r=Wz(Gz(n)||n);if(r)return r}let n=String(e||``).split(`/`).pop()??``;return n&&!Uz.has(n)?Wz(Gz(n)||n):`mcp`}function qz(e,t){if(!t||typeof t!=`object`||Array.isArray(t))return null;let n=t,r=String(n.command||``).trim();if(!r)return null;let i=Array.isArray(n.args)?n.args.map(String):[],a={};if(n.env&&typeof n.env==`object`&&!Array.isArray(n.env))for(let[e,t]of Object.entries(n.env))String(e).trim()&&(a[String(e)]=String(t));return{name:Wz(e)||Kz(r,i),command:r,args:i,env:a,cwd:typeof n.cwd==`string`?n.cwd.trim():``}}function Jz(e){let t=[],n=/"([^"]*)"|'([^']*)'|(\S+)/g,r;for(;r=n.exec(e);)t.push(r[1]??r[2]??r[3]??``);return t}function Yz(e){let t=Jz(e.replace(/^\$\s+/,``)),n={};for(;t.length&&/^[A-Za-z_][A-Za-z0-9_]*=/.test(t[0]);){let[e,...r]=(t.shift()??``).split(`=`);n[e]=r.join(`=`)}if(!t.length)return null;let[r,...i]=t;return{name:Kz(r,i),command:r,args:i,env:n,cwd:``}}function Xz(e){if(!e||typeof e!=`object`||Array.isArray(e))return[];let t=e,n=t.mcpServers||t.mcp_servers||t.servers;if(n&&typeof n==`object`&&!Array.isArray(n))return Object.entries(n).map(([e,t])=>qz(e,t)).filter(Zz);if(t.command)return[qz(t.name,t)].filter(Zz);let r=Object.entries(t);return r.length&&r.every(([,e])=>e&&typeof e==`object`&&`command`in e&&e.command)?r.map(([e,t])=>qz(e,t)).filter(Zz):[]}var Zz=e=>e!==null;function Qz(e){let t=String(e||``).trim();if(!t)return{servers:[],error:``};if(t.startsWith(`{`)||t.startsWith(`"`)){let e=[t,`{${t}}`].map(e=>e.replace(/,\s*([}\]])/g,`$1`));for(let t of e)try{let e=Xz(JSON.parse(t));if(e.length)return{servers:e,error:``}}catch{}return{servers:[],error:`Could not read that as MCP JSON — expected {"mcpServers": {...}} or a single {"command": ...} config.`}}let n=Yz(t.split(` +`)[0]);return n?{servers:[n],error:``}:{servers:[],error:`Could not read that — paste a JSON config or a command line.`}}var $z=[{id:`repo-files`,label:`Project files`,blurb:`read-only access to a folder — browse and search, never write`,command:`npx`,args:[`-y`,`@modelcontextprotocol/server-filesystem`],allowed_tools:[`read_file`,`read_multiple_files`,`list_directory`,`directory_tree`,`search_files`,`get_file_info`,`list_allowed_directories`],inputs:[{key:`folder`,label:`Folder`,ph:`/path/to/project`,kind:`arg`,required:!0}],requires:`Node.js`},{id:`browser`,label:`Browser`,blurb:`drive a real web browser — navigate, click, type, screenshot`,command:`npx`,args:[`-y`,`@playwright/mcp@latest`,`--sandbox`],inputs:[],requires:`Node.js + Chrome`},{id:`fetch`,label:`Fetch`,blurb:`fetch a web page by URL and convert it to markdown`,command:`uvx`,args:[`mcp-server-fetch`],inputs:[],requires:`Python (uv)`},{id:`time`,label:`Time`,blurb:`current time and timezone conversions`,command:`uvx`,args:[`mcp-server-time`],inputs:[],requires:`Python (uv)`},{id:`github`,label:`GitHub`,blurb:`repos, issues and pull requests via the GitHub API`,command:`npx`,args:[`-y`,`@modelcontextprotocol/server-github`],inputs:[{key:`GITHUB_PERSONAL_ACCESS_TOKEN`,label:`Access token`,ph:`ghp_…`,kind:`env`,required:!0}],requires:`Node.js`}];function eB(e,t={}){let n=[...e.args],r={};for(let i of e.inputs||[]){let e=String(t[i.key]||``).trim();e&&(i.kind===`arg`?n.push(e):r[i.key]=e)}let i={name:e.id,command:e.command,args:n,env:r,cwd:``};return e.allowed_tools&&(i.allowed_tools=[...e.allowed_tools]),i}var tB=H(`

        `),nB=H(`

        No MCP servers configured — add one below to give the assistant new tools.

        `),rB=H(` `),iB=H(`checking…`),aB=H(`
        `),oB=H(``),sB=H(`
        `),cB=H(`
        `),lB=H(`

        `),uB=H(`
        `),dB=H(`
        Name
        `),fB=H(`
        `,1),pB=H(``),mB=H(`
        `),hB=H(`
        `,1);function gB(e,t){O(t,!0);let n=M(P([])),r=M(P({})),i=M(!1),a=M(``),o=M(``),s=M(void 0),c=M(P([])),l=M(``),u=M(``),d=M(P({})),f=M(!1),p=M(P({name:``,command:``,args:``,cwd:``,allowed_tools:``,blocked_tools:``,env:``})),m=j(()=>new Set(B(n).map(e=>e.name)));io(async()=>{try{let e=await Q.settings();N(n,e.mcp_servers,!0)}catch(e){N(a,iS(e),!0)}});async function h(e){N(r,{...B(r),[e]:{checking:!0}},!0);try{N(r,{...B(r),[e]:await Q.healthMcpServer(e)},!0)}catch(t){N(r,{...B(r),[e]:{ok:!1,error:iS(t)}},!0)}}async function g(e){N(a,``),N(i,!0);try{let t=await Q.addMcpServer(e);return N(n,t.mcp_servers,!0),N(i,!1),await h(e.name),!0}catch(e){return N(a,iS(e),!0),N(i,!1),!1}}async function _(e){N(a,``),N(i,!0);try{let t=await Q.deleteMcpServer(e);N(n,t.mcp_servers,!0);let{[e]:i,...a}=B(r);N(r,a,!0)}catch(e){N(a,iS(e),!0)}N(i,!1)}function v(e){N(o,e.value,!0),e.style.height=`auto`,e.style.height=e.value?e.scrollHeight+2+`px`:``;let{servers:t,error:n}=Qz(e.value);N(l,n,!0),N(c,t,!0)}async function y(){for(let e of B(c))if(!await g(e))return;N(o,``),N(c,[],!0),N(l,``),B(s)&&(B(s).style.height=``)}function b(e){if(!(B(m).has(e.id)||B(i))){if(!e.inputs.length){S(e);return}N(u,B(u)===e.id?``:e.id,!0),N(d,{},!0)}}let x=e=>e.inputs.every(e=>!e.required||(B(d)[e.key]||``).trim());async function S(e){await g(eB(e,B(d)))&&(N(u,``),N(d,{},!0))}async function C(){await g(B(p))&&(N(p,{name:``,command:``,args:``,cwd:``,allowed_tools:``,blocked_tools:``,env:``},!0),N(f,!1))}let w=e=>[e.command,...e.args].join(` `);var T=hB(),ee=I(T),te=e=>{var t=tB(),n=L(t,!0);z(()=>W(n,B(a))),U(e,t)};G(ee,e=>{B(a)&&e(te)});var ne=R(ee,2),re=e=>{U(e,nB())};G(ne,e=>{B(n).length||e(re)});var ie=R(ne,2);K(ie,17,()=>B(n),e=>e.name,(e,t)=>{let n=j(()=>B(r)[B(t).name]);var a=aB(),o=F(a),s=F(o),c=L(s,!0),l=R(s,2),u=L(l,!0),d=R(l,2),f=e=>{var n=rB(),r=L(n);z(e=>W(r,`env: ${e??``}`),[()=>B(t).env_keys.join(`, `)]),U(e,n)};G(d,e=>{B(t).env_keys.length&&e(f)});var p=R(d,2),m=e=>{var t=Bi(),r=I(t),i=e=>{U(e,iB())},a=e=>{var t=rB();let r;var i=L(t,!0);z(()=>{r=q(t,1,``,null,r,{mcpbad:!B(n).ok}),W(i,B(n).ok?`healthy · ${(B(n).tools||[]).length} tools`:B(n).error)}),U(e,t)};G(r,e=>{B(n).checking?e(i):e(a,-1)}),U(e,t)};G(p,e=>{B(n)&&e(m)}),D(o);var g=R(o,2),v=R(g,2);D(a),z(e=>{W(c,B(t).name),W(u,e),g.disabled=B(i),v.disabled=B(i)},[()=>w(B(t))]),V(`click`,g,()=>h(B(t).name)),V(`click`,v,()=>_(B(t).name)),U(e,a)});var ae=R(ie,2);K(ae,21,()=>$z,e=>e.id,(e,t)=>{let n=j(()=>B(m).has(B(t).id));var r=oB();let a;var o=F(r),s=F(o),c=e=>{$(e,{name:`check`,size:13})},l=e=>{$(e,{name:`plus`,size:13})};G(s,e=>{B(n)?e(c):e(l,-1)});var d=R(s);D(o);var f=L(R(o,2),!0);D(r),z(e=>{a=q(r,1,`mcpcatcard`,null,a,{added:B(n),openinputs:B(u)===B(t).id}),r.disabled=B(i)||B(n),J(r,`title`,e),W(d,` ${B(t).label??``}`),W(f,B(t).blurb)},[()=>B(n)?`Already added`:`Runs: ${[B(t).command,...B(t).args].join(` `)} — needs ${B(t).requires}`]),V(`click`,r,()=>b(B(t))),U(e,r)}),D(ae);var oe=R(ae,2);K(oe,17,()=>$z.filter(e=>e.id===B(u)),e=>e.id,(e,t)=>{var n=cB(),r=F(n);K(r,17,()=>B(t).inputs,e=>e.key,(e,t)=>{var n=sB(),r=F(n),i=L(r,!0),a=R(r,2);za(a),D(n),z(()=>{W(i,B(t).label),J(a,`type`,B(t).kind===`env`?`password`:`text`),J(a,`placeholder`,B(t).ph)}),qa(a,()=>B(d)[B(t).key],e=>B(d)[B(t).key]=e),U(e,n)});var a=R(r,2),o=F(a),s=R(o,2),c=L(s);D(a),D(n),z(e=>{s.disabled=e,W(c,`Add ${B(t).label??``}`)},[()=>B(i)||!x(B(t))]),V(`click`,o,()=>N(u,``)),V(`click`,s,()=>S(B(t))),U(e,n)});var se=R(oe,2);tn(se),J(se,`placeholder`,`Or paste an MCP config — the {"mcpServers": …} JSON from a server's README, or a command line like: npx -y @modelcontextprotocol/server-github`),Qa(se,e=>N(s,e),()=>B(s));var ce=R(se,2),le=e=>{var t=lB(),n=L(t,!0);z(()=>W(n,B(l))),U(e,t)};G(ce,e=>{B(l)&&e(le)});var ue=R(ce,2),de=e=>{var t=fB(),n=I(t);K(n,17,()=>B(c),Qi,(e,t,n)=>{var r=dB(),i=F(r),a=R(F(i),2);za(a);var o=R(a,2),s=L(o,!0);D(i),K(R(i,2),16,()=>Object.keys(B(t).env),e=>e,(e,n)=>{var r=uB(),i=F(r),a=L(i,!0),o=R(i,2);za(o),D(r),z(()=>{J(i,`title`,n),W(a,n)}),qa(o,()=>B(t).env[n],e=>B(t).env[n]=e),U(e,r)}),D(r),z((e,t)=>{J(o,`title`,e),W(s,t)},[()=>w(B(t)),()=>w(B(t))]),qa(a,()=>B(t).name,e=>B(t).name=e),U(e,r)});var r=R(n,2),a=F(r),o=L(a);D(r),z(e=>{a.disabled=e,W(o,`Add ${(B(c).length===1?B(c)[0].name:`${B(c).length} servers`)??``}`)},[()=>B(i)||B(c).some(e=>!e.name)]),V(`click`,a,y),U(e,t)};G(ue,e=>{B(c).length&&e(de)});var fe=R(ue,2),E=e=>{var t=pB();V(`click`,t,()=>N(f,!0)),U(e,t)},pe=e=>{var t=mB(),n=F(t);za(n);var r=R(n,2);za(r);var a=R(r,2);za(a);var o=R(a,2);za(o);var s=R(o,2);za(s);var c=R(s,2);za(c);var l=R(c,2);tn(l);var u=R(l,2),d=F(u),m=R(d,2);D(u),D(t),z(()=>d.disabled=B(i)||!B(p).name||!B(p).command),qa(n,()=>B(p).name,e=>B(p).name=e),qa(r,()=>B(p).command,e=>B(p).command=e),qa(a,()=>B(p).args,e=>B(p).args=e),qa(o,()=>B(p).cwd,e=>B(p).cwd=e),qa(s,()=>B(p).allowed_tools,e=>B(p).allowed_tools=e),qa(c,()=>B(p).blocked_tools,e=>B(p).blocked_tools=e),qa(l,()=>B(p).env,e=>B(p).env=e),V(`click`,d,C),V(`click`,m,()=>N(f,!1)),U(e,t)};G(fe,e=>{B(f)?e(pe,-1):e(E)}),z(()=>Ba(se,B(o))),V(`input`,se,e=>v(e.currentTarget)),U(e,T),k()}ki([`click`,`input`]);var _B=H(`
        `),vB=H(`
        Checking…
        `),yB=H(` Host bridge `,1),bB=H(` Running on the host — agents detected locally`,1),xB=H(`
        ag2-assistant acp-bridge --port 8801
        `),SB=H(`
      • `),CB=H(`
      • No coding agents visible.
      • `),wB=H(`To use the host's agents from Docker, run ag2-assistant acp-bridge on the host and + set AG2ASSISTANT_ACP_BRIDGE (see docker-compose.yml).`,1),TB=H(`
          Coding runs are not sandboxed — the agent edits real files in the folder you approve.
          `,1),EB=H(`
          Coding agents host CLIs
          `,1);function DB(e,t){O(t,!0);let n=M(null),r=M(``);async function i(){N(r,``);try{N(n,await Q.codingAgents(),!0)}catch(e){N(r,iS(e),!0)}}io(i);var a=EB(),o=R(I(a),2),s=e=>{var t=_B(),n=L(t);z(()=>W(n,`Couldn't load coding-agent status: ${B(r)??``}`)),U(e,t)},c=e=>{U(e,vB())},l=e=>{var t=TB(),r=I(t),i=F(r),a=e=>{var t=yB(),r=I(t);let i;var a=R(r,2),o=L(a,!0),s=R(a);z(()=>{i=q(r,1,`ca-dot svelte-1a3c600`,null,i,{on:B(n).connected,off:!B(n).connected}),W(o,B(n).bridge),W(s,` — + ${B(n).connected?`connected`:`not reachable`}`)}),U(e,t)},o=e=>{var t=bB();tt(),U(e,t)};G(i,e=>{B(n).mode===`bridge`?e(a):e(o,-1)}),D(r);var s=R(r,2),c=e=>{var t=xB(),r=F(t);tt(),D(t),z(()=>W(r,`${(B(n).error||`The bridge did not respond.`)??``} + Start it on the host: `)),U(e,t)};G(s,e=>{B(n).mode===`bridge`&&!B(n).connected&&e(c)});var l=R(s,2);K(l,21,()=>B(n).agents,e=>e.name,(e,t)=>{var n=SB(),r=F(n),i=F(r),a=L(R(i));D(r);var o=R(r,2);let s;var c=L(o,!0);D(n),z(()=>{W(i,`${B(t).label??``} `),W(a,`(${B(t).name??``})`),s=q(o,1,`ca-badge svelte-1a3c600`,null,s,{ok:B(t).available}),W(c,B(t).available?`available`:`not installed`)}),U(e,n)},e=>{U(e,CB())}),D(l);var u=R(l,2),d=R(F(u)),f=e=>{var t=wB();tt(4),U(e,t)};G(d,e=>{B(n).mode===`local`&&e(f)}),D(u),U(e,t)};G(o,e=>{B(r)?e(s):B(n)?e(l,-1):e(c,1)}),U(e,a),k()}var OB=H(`

          `),kB=H(`

          No command grants yet.

          `),AB=H(`
          `),jB=H(`
          Command grants

          A tool name allows every call to that tool (action tools like gmail_send). Shell takes a prefix rule — run_shell_command(git *) — and host code runs (run_code) are approved individually, never blanket-allowed.

          `,1);function MB(e,t){O(t,!0);let n=M(P({commands:[]})),r=M(!1),i=M(``),a=M(``),o=/^([\w.-]+)\(([^()\s][^()]*) \*\)$/;function s(e){let t=e.trim();if(!t)return null;let n=t.match(o);return n?{tool:n[1],prefix:n[2]}:/^[\w.-]+$/.test(t)?{tool:t,prefix:null}:null}let c=e=>e.prefix?`${e.tool}(${e.prefix} *)`:e.tool,l=j(()=>{let e=s(B(a));return!!e&&!B(n).commands.includes(c(e))}),u=e=>{N(n,{commands:e.commands},!0)};io(async()=>{try{u(await Q.permissions())}catch(e){N(i,iS(e),!0)}});async function d(e){N(i,``),N(r,!0);try{u(await e())}catch(e){N(i,iS(e),!0)}N(r,!1)}let f=e=>d(()=>Q.revokeCommand(e));function p(){let e=s(B(a));!e||!B(l)||d(()=>Q.grantCommand(e.tool,e.prefix).then(e=>(N(a,``),e)))}var m=jB(),h=I(m),g=e=>{var t=OB(),n=L(t,!0);z(()=>W(n,B(i))),U(e,t)};G(h,e=>{B(i)&&e(g)});var _=R(h,2),v=R(F(_),2),y=e=>{U(e,kB())};G(v,e=>{B(n).commands.length||e(y)});var b=R(v,2);K(b,16,()=>B(n).commands,e=>e,(e,t)=>{var n=AB(),i=F(n);$(F(i),{name:`code`,size:14}),D(i);var a=R(i,2),o=L(a,!0),s=R(a,2);D(n),z(()=>{J(a,`title`,t),W(o,t),s.disabled=B(r)}),V(`click`,s,()=>f(t)),U(e,n)});var x=R(b,2),S=F(x);za(S);var C=R(S,2);D(x),tt(2),D(_),z(()=>C.disabled=B(r)||!B(l)),V(`keydown`,S,e=>e.key===`Enter`&&p()),qa(S,()=>B(a),e=>N(a,e)),V(`click`,C,p),U(e,m),k()}ki([`click`,`keydown`]);var NB=H(`
          MCP servers
          Permissions install-wide
          `,1);function PB(e){var t=NB(),n=R(I(t),2);gB(n,{});var r=R(n,2);DB(r,{}),MB(R(r,4),{}),U(e,t)}var FB=H(` `);function IB(e,t){O(t,!0);var n=FB(),r=F(n),i=e=>{$(e,{name:`check`,size:13})};G(r,e=>{t.status.kind===`ok`&&e(i)});var a=R(r,2),o=e=>{$(e,{name:`alert-triangle`,size:13})};G(a,e=>{t.status.kind===`err`&&e(o)});var s=L(R(a,2),!0);D(n),z(()=>{q(n,1,`cnstat ${t.status.kind??``}`),W(s,t.status.text)}),U(e,n),k()}var LB=H(`

          `),RB=H(`

          No listeners yet — add one below.

          `),zB=H(`

          Token
          `),BB=H(` `,1),VB=H(``),HB=H(`

          A stdio listener binds nothing — its client launches it. Point that client at:

          `),UB=H(``),WB=H(`
          `),GB=H(`
        • `),KB=H(`
            `),qB=H(``),JB=H(``),YB=H(`

            Nothing is bound and no token is needed: the client runs itself. The record exists so its chats are filed under this listener instead of every stdio client - sharing one identity.

            `),zB=H(`
            Port

            A token is generated for you and shown once the listener is created — paste your own - below instead if you already have one.

            Token
            `,1),BB=H(`
            Profile
            Name
            Transport
            `),VB=H(`
            ACP listeners Experimental

            Serve one profile to an Agent Client Protocol client — over its own port, or over stdio where - the client launches it. One listener drives exactly one profile — add another for another.

            `,1);function HB(e,t){O(t,!0);let n=()=>A(No,`$profiles`,r),[r,i]=Zt(),a=M(P([])),o=M(!1),s=M(``),c=M(!1),l=M(``),u=M(``),d=M(`ws`),f=M(``),p=M(``),m=M(!1),h=M(``),g=M(null),_=M(null),v=M(``),y=M(null),b=M(!1);io(x);async function x(){try{N(a,await Q.acpListeners(),!0),N(s,``)}catch(e){N(s,nS(e),!0)}N(o,!0)}let S=e=>n().list.find(t=>t.id===e)?.name||e;function C(e){return e.error?{kind:`err`,text:e.error}:e.port===null?{kind:`ok`,text:`Ready`}:e.running?{kind:`ok`,text:`Running`}:{kind:`wait`,text:`Not running`}}function w(e){N(g,B(g)===e?null:e,!0),N(_,null)}function T(){N(c,!1),N(l,``),N(u,``),N(f,``),N(p,``),N(d,`ws`),N(h,``)}async function ee(){if(!(!B(l)||B(m))){N(h,``),N(m,!0);try{let e=B(d)===`stdio`,t=e?null:Number(B(f).trim())||8802,n=await Q.createAcpListener(B(l),t,B(u).trim(),e?``:B(p).trim());await x(),T(),N(y,{id:n.listener.id,name:n.listener.name,token:n.token},!0),N(g,n.listener.id,!0)}catch(e){N(h,nS(e),!0)}N(m,!1)}}async function te(e){N(v,e,!0),N(s,``);try{let t=await Q.stopAcpListener(e);N(a,B(a).map(n=>n.id===e?t:n),!0)}catch(e){N(s,nS(e),!0)}N(v,``)}async function ne(e){N(v,e,!0),N(s,``);try{let t=await Q.startAcpListener(e);N(a,B(a).map(n=>n.id===e?t:n),!0)}catch(e){N(s,nS(e),!0)}N(v,``)}async function re(e){N(v,e,!0),N(s,``);try{let t=await Q.rotateAcpListenerToken(e);N(a,B(a).map(n=>n.id===e?t.listener:n),!0),N(y,{id:e,name:t.listener.name,token:t.token},!0)}catch(e){N(s,nS(e),!0)}N(v,``)}async function ie(e){N(v,e,!0),N(s,``);try{await Q.deleteAcpListener(e),N(a,B(a).filter(t=>t.id!==e),!0),B(y)?.id===e&&N(y,null),N(g,null),N(_,null)}catch(e){N(s,nS(e),!0)}N(v,``)}async function ae(){if(B(y))try{await navigator.clipboard.writeText(B(y).token),N(b,!0),setTimeout(()=>N(b,!1),2e3)}catch{}}function oe(){N(y,null),N(b,!1)}var se=VB(),ce=R(I(se),4),le=e=>{var t=EB(),n=L(t,!0);z(()=>W(n,B(s))),U(e,t)};G(ce,e=>{B(s)&&e(le)});var ue=R(ce,2),de=e=>{U(e,DB())};G(ue,e=>{B(o)&&!B(a).length&&!B(c)&&e(de)});var fe=R(ue,2),E=e=>{var t=FB();K(t,21,()=>B(a),e=>e.id,(e,t)=>{var n=PB(),r=F(n),i=F(r),a=L(i,!0),o=R(i,2),s=L(o),c=R(o,2);{let e=j(()=>C(B(t)));TB(c,{get status(){return B(e)}})}var l=R(c,2),u=F(l);{let e=j(()=>B(g)===B(t).id?`chevron-down`:`chevron-right`);$(u,{get name(){return B(e)},size:13})}D(l),D(r);var d=R(r,2),f=e=>{var n=OB(),r=F(n),i=L(r),a=R(r,2),o=R(F(a),2);za(o);var s=R(o,2),c=L(s,!0);D(a);var l=L(R(a,2));D(n),z(()=>{W(i,`Token for "${B(t).name??``}" — copy it now and hand it to the client. It will not be shown again.`),Ba(o,B(y).token),W(c,B(b)?`Copied`:`Copy`)}),V(`click`,o,e=>e.currentTarget.select()),V(`click`,s,ae),V(`click`,l,oe),U(e,n)},p=e=>{var n=jB(),r=R(F(n),2),i=F(r);za(i),D(r);var a=R(r,2),o=F(a),s=e=>{var n=kB(),r=I(n),i=L(r),a=R(r,2),o=R(a,2);z(()=>{W(i,`Delete "${B(t).name??``}"?`),a.disabled=B(v)===B(t).id,o.disabled=B(v)===B(t).id}),V(`click`,a,()=>ie(B(t).id)),V(`click`,o,()=>N(_,null)),U(e,n)},c=e=>{var n=AB();z(()=>n.disabled=B(v)===B(t).id),V(`click`,n,()=>N(_,B(t).id,!0)),U(e,n)};G(o,e=>{B(_)===B(t).id?e(s):e(c,-1)}),D(a),D(n),z(()=>Ba(i,`ag2-assistant acp --connection "${B(t).name}"`)),V(`click`,i,e=>e.currentTarget.select()),U(e,n)},m=e=>{var n=NB(),r=F(n),i=e=>{var n=MB(),r=L(n,!0);z(()=>{n.disabled=B(v)===B(t).id,W(r,B(v)===B(t).id?`Stopping…`:`Stop`)}),V(`click`,n,()=>te(B(t).id)),U(e,n)},a=e=>{var n=MB(),r=L(n,!0);z(()=>{n.disabled=B(v)===B(t).id,W(r,B(v)===B(t).id?`Starting…`:`Start`)}),V(`click`,n,()=>ne(B(t).id)),U(e,n)};G(r,e=>{B(t).running?e(i):e(a,-1)});var o=R(r,2),s=R(o,2),c=e=>{var n=kB(),r=I(n),i=L(r),a=R(r,2),o=R(a,2);z(()=>{W(i,`Delete "${B(t).name??``}"? Its connected clients are dropped.`),a.disabled=B(v)===B(t).id,o.disabled=B(v)===B(t).id}),V(`click`,a,()=>ie(B(t).id)),V(`click`,o,()=>N(_,null)),U(e,n)},l=e=>{var n=AB();z(()=>n.disabled=B(v)===B(t).id),V(`click`,n,()=>N(_,B(t).id,!0)),U(e,n)};G(s,e=>{B(_)===B(t).id?e(c):e(l,-1)}),D(n),z(()=>o.disabled=B(v)===B(t).id),V(`click`,o,()=>re(B(t).id)),U(e,n)};G(d,e=>{B(y)?.id===B(t).id?e(f):B(g)===B(t).id&&B(t).port===null?e(p,1):B(g)===B(t).id&&e(m,2)}),D(n),z(e=>{W(a,B(t).name),W(s,`${e??``} · ${B(t).port===null?`stdio`:`port ${B(t).port}`}`),J(l,`aria-label`,B(g)===B(t).id?`Collapse ${B(t).name}`:`Expand ${B(t).name}`)},[()=>S(B(t).profile)]),V(`click`,l,()=>w(B(t).id)),U(e,n)}),D(t),U(e,t)};G(fe,e=>{B(a).length&&e(E)});var pe=R(fe,2),me=e=>{var t=IB();$(F(t),{name:`plus`,size:14}),tt(),D(t),V(`click`,t,()=>N(c,!0)),U(e,t)},he=e=>{var t=BB(),r=F(t),i=R(F(r),2),a=F(i);a.value=a.__value=``,K(R(a),1,()=>n().list,e=>e.id,(e,t)=>{var n=LB(),r=L(n,!0),i={};z(()=>{W(r,B(t).name),i!==(i=B(t).id)&&(n.value=(n.__value=i)??``)}),U(e,n)}),D(i),Ea(i),D(r);var o=R(r,2),s=R(F(o),2);za(s),D(o);var c=R(o,2),g=R(F(c),2),_=F(g);_.value=_.__value=`ws`;var v=R(_);v.value=v.__value=`stdio`,D(g),Ea(g),D(c);var y=R(c,2),b=e=>{var t=RB(),n=L(R(F(t)));tt(),D(t),z(e=>W(n,`ag2-assistant acp --connection "${e??``}"`),[()=>B(u).trim()||`name`]),U(e,t)},x=e=>{var t=zB(),n=I(t),r=R(F(n),2);za(r),D(n);var i=R(n,4),a=R(F(i),2);za(a),D(i),z(()=>{r.disabled=B(m),a.disabled=B(m)}),qa(r,()=>B(f),e=>N(f,e)),qa(a,()=>B(p),e=>N(p,e)),U(e,t)};G(y,e=>{B(d)===`stdio`?e(b):e(x,-1)});var S=R(y,2),C=e=>{var t=EB(),n=L(t,!0);z(()=>W(n,B(h))),U(e,t)};G(S,e=>{B(h)&&e(C)});var w=R(S,2),te=F(w),ne=L(te,!0),re=R(te,2);D(w),D(t),z(()=>{i.disabled=B(m),s.disabled=B(m),g.disabled=B(m),te.disabled=!B(l)||B(m),W(ne,B(m)?`Creating…`:`Create listener`),re.disabled=B(m)}),Da(i,()=>B(l),e=>N(l,e)),qa(s,()=>B(u),e=>N(u,e)),Da(g,()=>B(d),e=>N(d,e)),V(`click`,te,ee),V(`click`,re,T),U(e,t)};G(pe,e=>{B(c)?e(he,-1):e(me)}),U(e,se),k(),i()}ki([`click`]);var UB=[{id:`telegram`,kind:`channel`,label:`Telegram`,multiple:!0,handles:!0,blurb:`DM the assistant from Telegram. Groups get their own pinned profile.`,setup:`Create a bot with @BotFather and paste the token it gives you.`,fields:[{env:`TELEGRAM_BOT_TOKEN`,label:`Bot token`,placeholder:`123456:AA…`}]},{id:`discord`,kind:`channel`,label:`Discord`,multiple:!0,handles:!0,blurb:`DM the assistant from Discord, or point a server channel at a profile.`,setup:`Discord Developer Portal → New Application → Bot → Reset Token.`,fields:[{env:`DISCORD_BOT_TOKEN`,label:`Bot token`,placeholder:`MTIz…`}]},{id:`slack`,kind:`channel`,label:`Slack`,multiple:!0,handles:!1,blurb:`Slack DMs and channels. Needs both a bot token and an app token.`,setup:`Slack app → OAuth (xoxb-…) and Socket Mode (xapp-…).`,fields:[{env:`SLACK_BOT_TOKEN`,label:`Bot token`,placeholder:`xoxb-…`},{env:`SLACK_APP_TOKEN`,label:`App token`,placeholder:`xapp-…`}]},{id:`google`,kind:`google`,label:`Google`,multiple:!1,blurb:`Gmail, Calendar and Drive, signed in as you.`,setup:`Sign in through the Google flow — no key to paste.`,fields:[]},{id:`github`,kind:`github`,label:`GitHub`,multiple:!1,blurb:`Skills registry — raises the download rate limit. Optional.`,setup:`Any fine-grained personal access token with public read.`,fields:[{env:`token`,label:`Token`,placeholder:`github_pat_…`}]}],WB=Object.fromEntries(UB.map(e=>[e.id,e]));function GB(e){return WB[e]?.label||e}var KB={dm:`Direct messages`,group:`Groups`,all:{discord:`Servers and direct messages`,slack:`Channels and direct messages`}};function qB(e,t){let n=KB[t];return(typeof n==`string`?n:n?.[e])||`Reachable`}function JB(e,t){return Object.values(e?.[t]||{}).some(Boolean)}function YB(e,t){return e.error?{kind:`err`,text:e.error}:e.active?e.paired_accounts?e.default_profile==null?{kind:`wait`,text:`no default profile`}:{kind:`ok`,text:`messages go to ${t||e.default_profile}`}:{kind:`err`,text:`nobody paired — it answers nobody`}:{kind:`wait`,text:`not started`}}function XB(e){return e==null?{kind:`wait`,text:`…`}:e.signed_in&&e.libs_available===!1?{kind:`err`,text:`needs libraries · not usable`}:e.signed_in?{kind:`ok`,text:`connected · `+(e.email||`account`)}:{kind:`wait`,text:`not connected`}}function ZB(e){let t=e?.github;return t?.set?{kind:`ok`,text:`token set · `+(t.hint||``)}:{kind:`wait`,text:`no token — using the anonymous rate limit`}}function QB(e,t){let n=e.filter(e=>e.platform===t.id).length;return n?`${t.label} ${n+1}`:t.label}var $B=H(` `);function eV(e,t){O(t,!0);let n=ro(t,`name`,3,``),r=ro(t,`sm`,3,!1),i=j(()=>Vj(t.platform)!==null);var a=Bi(),o=I(a),s=e=>{{let n=j(()=>r()?16:20);qj(e,{get brand(){return t.platform},get size(){return B(n)}})}},c=e=>{var t=$B();let i;var a=L(t,!0);z(e=>{i=q(t,1,`cnmark`,null,i,{sm:r()}),W(a,e)},[()=>((n()||``).trim()[0]||`?`).toUpperCase()]),U(e,t)};G(o,e=>{B(i)?e(s):e(c,-1)}),U(e,a),k()}var tV=H(`
            Name

            Yours, not the platform's — it is how this connection is listed. Rename it any time.

            `,1),nV=H(`
            `),rV=H(`

            `),iV=H(`

            Written to the secrets store and never shown to the browser again.

            `,1);function aV(e,t){O(t,!0);let n=ro(t,`connections`,19,()=>[]),r=j(()=>n().filter(e=>e.platform===t.entry.id).length),i=M(null),a=j(()=>B(i)??QB(n(),t.entry)),o=P({}),s=M(!1),c=M(``),l=j(()=>t.entry.fields.every(e=>(o[e.env]||``).trim()));async function u(){if(!(!B(l)||B(s))){N(c,``),N(s,!0);try{await t.onConnect(B(a).trim(),Object.fromEntries(t.entry.fields.map(e=>[e.env,(o[e.env]||``).trim()])))}catch(e){N(c,nS(e),!0),N(s,!1)}}}var d=iV(),f=I(d),p=F(f);eV(p,{get platform(){return t.entry.id},get name(){return t.entry.label}});var m=R(p,2),h=F(m),g=L(h),_=L(R(h,2),!0);D(m),D(f);var v=R(f,2),y=F(v),b=e=>{var n=tV(),o=I(n),c=R(F(o),2);za(c),D(o);var l=R(o,2),d=R(F(l)),f=e=>{var n=zi();z(()=>W(n,`You already have ${B(r)??``} ${t.entry.label??``} ${B(r)===1?`connection`:`connections`}.`)),U(e,n)};G(d,e=>{B(r)&&e(f)}),D(l),z(()=>{Ba(c,B(a)),J(c,`placeholder`,t.entry.label),c.disabled=B(s)}),V(`input`,c,e=>N(i,e.currentTarget.value,!0)),V(`keydown`,c,e=>{e.key===`Enter`&&u()}),U(e,n)};G(y,e=>{t.entry.multiple&&e(b)});var x=R(y,2);K(x,17,()=>t.entry.fields,e=>e.env,(e,t)=>{var n=nV(),r=F(n),i=L(r,!0),a=R(r,2);za(a),D(n),z(()=>{W(i,B(t).label),J(a,`placeholder`,B(t).placeholder),a.disabled=B(s),J(a,`aria-label`,B(t).label)}),V(`keydown`,a,e=>{e.key===`Enter`&&u()}),qa(a,()=>o[B(t).env],e=>o[B(t).env]=e),U(e,n)});var S=R(x,4),C=e=>{var t=rV(),n=L(t,!0);z(()=>W(n,B(c))),U(e,t)};G(S,e=>{B(c)&&e(C)});var w=R(S,2),T=F(w),ee=L(T,!0),te=R(T,2);D(w),D(v),z(()=>{W(g,`Connect ${t.entry.label??``}`),W(_,t.entry.setup),T.disabled=!B(l)||B(s),W(ee,B(s)?`Connecting…`:`Connect`),te.disabled=B(s)}),V(`click`,T,u),V(`click`,te,function(...e){t.onCancel?.apply(this,e)}),U(e,d),k()}ki([`input`,`keydown`,`click`]);var oV=H(`
            `,1),sV=H(``),cV=H(` `),lV=H(`
            `,1),uV=H(`
            `);function dV(e,t){O(t,!0);let n=ro(t,`tag`,3,``),r=ro(t,`onRename`,3,null),i=ro(t,`busy`,3,!1),a=M(!1),o=M(``);function s(e){e.focus(),e.select()}function c(){N(o,t.label,!0),N(a,!0)}async function l(){let e=B(o).trim();if(!e||e===t.label){N(a,!1);return}await r()?.(e)&&N(a,!1)}var u=uV(),d=F(u);eV(d,{get platform(){return t.platform},get name(){return t.label}});var f=R(d,2),p=F(f),m=e=>{var t=oV(),n=I(t);za(n),yr(()=>qa(n,()=>B(o),e=>N(o,e))),ua(n,e=>s?.(e));var r=R(n,2),c=F(r),u=R(c,2);D(r),z(e=>{n.disabled=i(),c.disabled=e,u.disabled=i()},[()=>i()||!B(o).trim()]),V(`keydown`,n,e=>{e.key===`Enter`&&l(),e.key===`Escape`&&N(a,!1)}),V(`click`,c,l),V(`click`,u,()=>N(a,!1)),U(e,t)},h=e=>{var a=lV(),o=I(a),s=F(o),l=R(s),u=e=>{var t=sV();$(F(t),{name:`pencil`,size:12}),D(t),z(()=>t.disabled=i()),V(`click`,t,c),U(e,t)};G(l,e=>{r()&&e(u)});var d=R(l,2),f=e=>{var t=cV(),r=L(t,!0);z(()=>W(r,n())),U(e,t)};G(d,e=>{n()&&e(f)}),D(o),TB(R(o,2),{get status(){return t.status}}),z(()=>W(s,`${t.label??``} `)),U(e,a)};G(p,e=>{B(a)?e(m):e(h,-1)}),D(f),D(u),U(e,u),k()}ki([`keydown`,`click`]);var fV=H(`

            `),pV=H(` `),mV=H(``),hV=H(` `),gV=H(`

            A greyed-out profile is withdrawn from every surface here, so it cannot be the default.

            `),_V=H(`

            No default — a conversation that has not been pointed anywhere is refused.

            `),vV=H(`
            ProfileDefault
            `,1),yV=H(`
            Profiles

            Every profile is reachable through this connection until you turn it off; a conversation + sharing one identity.

            `),XB=H(`
            Port

            A token is generated for you and shown once the listener is created — paste your own + below instead if you already have one.

            Token
            `,1),ZB=H(`
            Profile
            Name
            Transport
            `),QB=H(`
            ACP listeners Experimental

            Serve one profile to an Agent Client Protocol client — over its own port, or over stdio where + the client launches it. One listener drives exactly one profile — add another for another.

            `,1);function $B(e,t){O(t,!0);let n=()=>A(No,`$profiles`,r),[r,i]=Zt(),a=M(P([])),o=M(!1),s=M(``),c=M(!1),l=M(``),u=M(``),d=M(`ws`),f=M(``),p=M(``),m=M(!1),h=M(``),g=M(null),_=M(null),v=M(``),y=M(null),b=M(!1);io(x);async function x(){try{N(a,await Q.acpListeners(),!0),N(s,``)}catch(e){N(s,iS(e),!0)}N(o,!0)}let S=e=>n().list.find(t=>t.id===e)?.name||e;function C(e){return e.error?{kind:`err`,text:e.error}:e.port===null?{kind:`ok`,text:`Ready`}:e.running?{kind:`ok`,text:`Running`}:{kind:`wait`,text:`Not running`}}function w(e){N(g,B(g)===e?null:e,!0),N(_,null)}function T(){N(c,!1),N(l,``),N(u,``),N(f,``),N(p,``),N(d,`ws`),N(h,``)}async function ee(){if(!(!B(l)||B(m))){N(h,``),N(m,!0);try{let e=B(d)===`stdio`,t=e?null:Number(B(f).trim())||8802,n=await Q.createAcpListener(B(l),t,B(u).trim(),e?``:B(p).trim());await x(),T(),N(y,{id:n.listener.id,name:n.listener.name,token:n.token},!0),N(g,n.listener.id,!0)}catch(e){N(h,iS(e),!0)}N(m,!1)}}async function te(e){N(v,e,!0),N(s,``);try{let t=await Q.stopAcpListener(e);N(a,B(a).map(n=>n.id===e?t:n),!0)}catch(e){N(s,iS(e),!0)}N(v,``)}async function ne(e){N(v,e,!0),N(s,``);try{let t=await Q.startAcpListener(e);N(a,B(a).map(n=>n.id===e?t:n),!0)}catch(e){N(s,iS(e),!0)}N(v,``)}async function re(e){N(v,e,!0),N(s,``);try{let t=await Q.rotateAcpListenerToken(e);N(a,B(a).map(n=>n.id===e?t.listener:n),!0),N(y,{id:e,name:t.listener.name,token:t.token},!0)}catch(e){N(s,iS(e),!0)}N(v,``)}async function ie(e){N(v,e,!0),N(s,``);try{await Q.deleteAcpListener(e),N(a,B(a).filter(t=>t.id!==e),!0),B(y)?.id===e&&N(y,null),N(g,null),N(_,null)}catch(e){N(s,iS(e),!0)}N(v,``)}async function ae(){if(B(y))try{await navigator.clipboard.writeText(B(y).token),N(b,!0),setTimeout(()=>N(b,!1),2e3)}catch{}}function oe(){N(y,null),N(b,!1)}var se=QB(),ce=R(I(se),4),le=e=>{var t=LB(),n=L(t,!0);z(()=>W(n,B(s))),U(e,t)};G(ce,e=>{B(s)&&e(le)});var ue=R(ce,2),de=e=>{U(e,RB())};G(ue,e=>{B(o)&&!B(a).length&&!B(c)&&e(de)});var fe=R(ue,2),E=e=>{var t=KB();K(t,21,()=>B(a),e=>e.id,(e,t)=>{var n=GB(),r=F(n),i=F(r),a=L(i,!0),o=R(i,2),s=L(o),c=R(o,2);{let e=j(()=>C(B(t)));IB(c,{get status(){return B(e)}})}var l=R(c,2),u=F(l);{let e=j(()=>B(g)===B(t).id?`chevron-down`:`chevron-right`);$(u,{get name(){return B(e)},size:13})}D(l),D(r);var d=R(r,2),f=e=>{var n=zB(),r=F(n),i=L(r),a=R(r,2),o=R(F(a),2);za(o);var s=R(o,2),c=L(s,!0);D(a);var l=L(R(a,2));D(n),z(()=>{W(i,`Token for "${B(t).name??``}" — copy it now and hand it to the client. It will not be shown again.`),Ba(o,B(y).token),W(c,B(b)?`Copied`:`Copy`)}),V(`click`,o,e=>e.currentTarget.select()),V(`click`,s,ae),V(`click`,l,oe),U(e,n)},p=e=>{var n=HB(),r=R(F(n),2),i=F(r);za(i),D(r);var a=R(r,2),o=F(a),s=e=>{var n=BB(),r=I(n),i=L(r),a=R(r,2),o=R(a,2);z(()=>{W(i,`Delete "${B(t).name??``}"?`),a.disabled=B(v)===B(t).id,o.disabled=B(v)===B(t).id}),V(`click`,a,()=>ie(B(t).id)),V(`click`,o,()=>N(_,null)),U(e,n)},c=e=>{var n=VB();z(()=>n.disabled=B(v)===B(t).id),V(`click`,n,()=>N(_,B(t).id,!0)),U(e,n)};G(o,e=>{B(_)===B(t).id?e(s):e(c,-1)}),D(a),D(n),z(()=>Ba(i,`ag2-assistant acp --connection "${B(t).name}"`)),V(`click`,i,e=>e.currentTarget.select()),U(e,n)},m=e=>{var n=WB(),r=F(n),i=e=>{var n=UB(),r=L(n,!0);z(()=>{n.disabled=B(v)===B(t).id,W(r,B(v)===B(t).id?`Stopping…`:`Stop`)}),V(`click`,n,()=>te(B(t).id)),U(e,n)},a=e=>{var n=UB(),r=L(n,!0);z(()=>{n.disabled=B(v)===B(t).id,W(r,B(v)===B(t).id?`Starting…`:`Start`)}),V(`click`,n,()=>ne(B(t).id)),U(e,n)};G(r,e=>{B(t).running?e(i):e(a,-1)});var o=R(r,2),s=R(o,2),c=e=>{var n=BB(),r=I(n),i=L(r),a=R(r,2),o=R(a,2);z(()=>{W(i,`Delete "${B(t).name??``}"? Its connected clients are dropped.`),a.disabled=B(v)===B(t).id,o.disabled=B(v)===B(t).id}),V(`click`,a,()=>ie(B(t).id)),V(`click`,o,()=>N(_,null)),U(e,n)},l=e=>{var n=VB();z(()=>n.disabled=B(v)===B(t).id),V(`click`,n,()=>N(_,B(t).id,!0)),U(e,n)};G(s,e=>{B(_)===B(t).id?e(c):e(l,-1)}),D(n),z(()=>o.disabled=B(v)===B(t).id),V(`click`,o,()=>re(B(t).id)),U(e,n)};G(d,e=>{B(y)?.id===B(t).id?e(f):B(g)===B(t).id&&B(t).port===null?e(p,1):B(g)===B(t).id&&e(m,2)}),D(n),z(e=>{W(a,B(t).name),W(s,`${e??``} · ${B(t).port===null?`stdio`:`port ${B(t).port}`}`),J(l,`aria-label`,B(g)===B(t).id?`Collapse ${B(t).name}`:`Expand ${B(t).name}`)},[()=>S(B(t).profile)]),V(`click`,l,()=>w(B(t).id)),U(e,n)}),D(t),U(e,t)};G(fe,e=>{B(a).length&&e(E)});var pe=R(fe,2),me=e=>{var t=qB();$(F(t),{name:`plus`,size:14}),tt(),D(t),V(`click`,t,()=>N(c,!0)),U(e,t)},he=e=>{var t=ZB(),r=F(t),i=R(F(r),2),a=F(i);a.value=a.__value=``,K(R(a),1,()=>n().list,e=>e.id,(e,t)=>{var n=JB(),r=L(n,!0),i={};z(()=>{W(r,B(t).name),i!==(i=B(t).id)&&(n.value=(n.__value=i)??``)}),U(e,n)}),D(i),Ea(i),D(r);var o=R(r,2),s=R(F(o),2);za(s),D(o);var c=R(o,2),g=R(F(c),2),_=F(g);_.value=_.__value=`ws`;var v=R(_);v.value=v.__value=`stdio`,D(g),Ea(g),D(c);var y=R(c,2),b=e=>{var t=YB(),n=L(R(F(t)));tt(),D(t),z(e=>W(n,`ag2-assistant acp --connection "${e??``}"`),[()=>B(u).trim()||`name`]),U(e,t)},x=e=>{var t=XB(),n=I(t),r=R(F(n),2);za(r),D(n);var i=R(n,4),a=R(F(i),2);za(a),D(i),z(()=>{r.disabled=B(m),a.disabled=B(m)}),qa(r,()=>B(f),e=>N(f,e)),qa(a,()=>B(p),e=>N(p,e)),U(e,t)};G(y,e=>{B(d)===`stdio`?e(b):e(x,-1)});var S=R(y,2),C=e=>{var t=LB(),n=L(t,!0);z(()=>W(n,B(h))),U(e,t)};G(S,e=>{B(h)&&e(C)});var w=R(S,2),te=F(w),ne=L(te,!0),re=R(te,2);D(w),D(t),z(()=>{i.disabled=B(m),s.disabled=B(m),g.disabled=B(m),te.disabled=!B(l)||B(m),W(ne,B(m)?`Creating…`:`Create listener`),re.disabled=B(m)}),Da(i,()=>B(l),e=>N(l,e)),qa(s,()=>B(u),e=>N(u,e)),Da(g,()=>B(d),e=>N(d,e)),V(`click`,te,ee),V(`click`,re,T),U(e,t)};G(pe,e=>{B(c)?e(he,-1):e(me)}),U(e,se),k(),i()}ki([`click`]);var eV=[{id:`telegram`,kind:`channel`,label:`Telegram`,multiple:!0,handles:!0,blurb:`DM the assistant from Telegram. Groups get their own pinned profile.`,setup:`Create a bot with @BotFather and paste the token it gives you.`,fields:[{env:`TELEGRAM_BOT_TOKEN`,label:`Bot token`,placeholder:`123456:AA…`}]},{id:`discord`,kind:`channel`,label:`Discord`,multiple:!0,handles:!0,blurb:`DM the assistant from Discord, or point a server channel at a profile.`,setup:`Discord Developer Portal → New Application → Bot → Reset Token.`,fields:[{env:`DISCORD_BOT_TOKEN`,label:`Bot token`,placeholder:`MTIz…`}]},{id:`slack`,kind:`channel`,label:`Slack`,multiple:!0,handles:!1,blurb:`Slack DMs and channels. Needs both a bot token and an app token.`,setup:`Slack app → OAuth (xoxb-…) and Socket Mode (xapp-…).`,fields:[{env:`SLACK_BOT_TOKEN`,label:`Bot token`,placeholder:`xoxb-…`},{env:`SLACK_APP_TOKEN`,label:`App token`,placeholder:`xapp-…`}]},{id:`google`,kind:`google`,label:`Google`,multiple:!1,blurb:`Gmail, Calendar and Drive, signed in as you.`,setup:`Sign in through the Google flow — no key to paste.`,fields:[]},{id:`github`,kind:`github`,label:`GitHub`,multiple:!1,blurb:`Skills registry — raises the download rate limit. Optional.`,setup:`Any fine-grained personal access token with public read.`,fields:[{env:`token`,label:`Token`,placeholder:`github_pat_…`}]}],tV=Object.fromEntries(eV.map(e=>[e.id,e]));function nV(e){return tV[e]?.label||e}var rV={dm:`Direct messages`,group:`Groups`,all:{discord:`Servers and direct messages`,slack:`Channels and direct messages`}};function iV(e,t){let n=rV[t];return(typeof n==`string`?n:n?.[e])||`Reachable`}function aV(e,t){return Object.values(e?.[t]||{}).some(Boolean)}function oV(e,t){return e.error?{kind:`err`,text:e.error}:e.active?e.paired_accounts?e.default_profile==null?{kind:`wait`,text:`no default profile`}:{kind:`ok`,text:`messages go to ${t||e.default_profile}`}:{kind:`err`,text:`nobody paired — it answers nobody`}:{kind:`wait`,text:`not started`}}function sV(e){return e==null?{kind:`wait`,text:`…`}:e.signed_in&&e.libs_available===!1?{kind:`err`,text:`needs libraries · not usable`}:e.signed_in?{kind:`ok`,text:`connected · `+(e.email||`account`)}:{kind:`wait`,text:`not connected`}}function cV(e){let t=e?.github;return t?.set?{kind:`ok`,text:`token set · `+(t.hint||``)}:{kind:`wait`,text:`no token — using the anonymous rate limit`}}function lV(e,t){let n=e.filter(e=>e.platform===t.id).length;return n?`${t.label} ${n+1}`:t.label}var uV=H(` `);function dV(e,t){O(t,!0);let n=ro(t,`name`,3,``),r=ro(t,`sm`,3,!1),i=j(()=>Qj(t.platform)!==null);var a=Bi(),o=I(a),s=e=>{{let n=j(()=>r()?16:20);iM(e,{get brand(){return t.platform},get size(){return B(n)}})}},c=e=>{var t=uV();let i;var a=L(t,!0);z(e=>{i=q(t,1,`cnmark`,null,i,{sm:r()}),W(a,e)},[()=>((n()||``).trim()[0]||`?`).toUpperCase()]),U(e,t)};G(o,e=>{B(i)?e(s):e(c,-1)}),U(e,a),k()}var fV=H(`
            Name

            Yours, not the platform's — it is how this connection is listed. Rename it any time.

            `,1),pV=H(`
            `),mV=H(`

            `),hV=H(`

            Written to the secrets store and never shown to the browser again.

            `,1);function gV(e,t){O(t,!0);let n=ro(t,`connections`,19,()=>[]),r=j(()=>n().filter(e=>e.platform===t.entry.id).length),i=M(null),a=j(()=>B(i)??lV(n(),t.entry)),o=P({}),s=M(!1),c=M(``),l=j(()=>t.entry.fields.every(e=>(o[e.env]||``).trim()));async function u(){if(!(!B(l)||B(s))){N(c,``),N(s,!0);try{await t.onConnect(B(a).trim(),Object.fromEntries(t.entry.fields.map(e=>[e.env,(o[e.env]||``).trim()])))}catch(e){N(c,iS(e),!0),N(s,!1)}}}var d=hV(),f=I(d),p=F(f);dV(p,{get platform(){return t.entry.id},get name(){return t.entry.label}});var m=R(p,2),h=F(m),g=L(h),_=L(R(h,2),!0);D(m),D(f);var v=R(f,2),y=F(v),b=e=>{var n=fV(),o=I(n),c=R(F(o),2);za(c),D(o);var l=R(o,2),d=R(F(l)),f=e=>{var n=zi();z(()=>W(n,`You already have ${B(r)??``} ${t.entry.label??``} ${B(r)===1?`connection`:`connections`}.`)),U(e,n)};G(d,e=>{B(r)&&e(f)}),D(l),z(()=>{Ba(c,B(a)),J(c,`placeholder`,t.entry.label),c.disabled=B(s)}),V(`input`,c,e=>N(i,e.currentTarget.value,!0)),V(`keydown`,c,e=>{e.key===`Enter`&&u()}),U(e,n)};G(y,e=>{t.entry.multiple&&e(b)});var x=R(y,2);K(x,17,()=>t.entry.fields,e=>e.env,(e,t)=>{var n=pV(),r=F(n),i=L(r,!0),a=R(r,2);za(a),D(n),z(()=>{W(i,B(t).label),J(a,`placeholder`,B(t).placeholder),a.disabled=B(s),J(a,`aria-label`,B(t).label)}),V(`keydown`,a,e=>{e.key===`Enter`&&u()}),qa(a,()=>o[B(t).env],e=>o[B(t).env]=e),U(e,n)});var S=R(x,4),C=e=>{var t=mV(),n=L(t,!0);z(()=>W(n,B(c))),U(e,t)};G(S,e=>{B(c)&&e(C)});var w=R(S,2),T=F(w),ee=L(T,!0),te=R(T,2);D(w),D(v),z(()=>{W(g,`Connect ${t.entry.label??``}`),W(_,t.entry.setup),T.disabled=!B(l)||B(s),W(ee,B(s)?`Connecting…`:`Connect`),te.disabled=B(s)}),V(`click`,T,u),V(`click`,te,function(...e){t.onCancel?.apply(this,e)}),U(e,d),k()}ki([`input`,`keydown`,`click`]);var _V=H(`
            `,1),vV=H(``),yV=H(` `),bV=H(`
            `,1),xV=H(`
            `);function SV(e,t){O(t,!0);let n=ro(t,`tag`,3,``),r=ro(t,`onRename`,3,null),i=ro(t,`busy`,3,!1),a=M(!1),o=M(``);function s(e){e.focus(),e.select()}function c(){N(o,t.label,!0),N(a,!0)}async function l(){let e=B(o).trim();if(!e||e===t.label){N(a,!1);return}await r()?.(e)&&N(a,!1)}var u=xV(),d=F(u);dV(d,{get platform(){return t.platform},get name(){return t.label}});var f=R(d,2),p=F(f),m=e=>{var t=_V(),n=I(t);za(n),yr(()=>qa(n,()=>B(o),e=>N(o,e))),ua(n,e=>s?.(e));var r=R(n,2),c=F(r),u=R(c,2);D(r),z(e=>{n.disabled=i(),c.disabled=e,u.disabled=i()},[()=>i()||!B(o).trim()]),V(`keydown`,n,e=>{e.key===`Enter`&&l(),e.key===`Escape`&&N(a,!1)}),V(`click`,c,l),V(`click`,u,()=>N(a,!1)),U(e,t)},h=e=>{var a=bV(),o=I(a),s=F(o),l=R(s),u=e=>{var t=vV();$(F(t),{name:`pencil`,size:12}),D(t),z(()=>t.disabled=i()),V(`click`,t,c),U(e,t)};G(l,e=>{r()&&e(u)});var d=R(l,2),f=e=>{var t=yV(),r=L(t,!0);z(()=>W(r,n())),U(e,t)};G(d,e=>{n()&&e(f)}),D(o),IB(R(o,2),{get status(){return t.status}}),z(()=>W(s,`${t.label??``} `)),U(e,a)};G(p,e=>{B(a)?e(m):e(h,-1)}),D(f),D(u),U(e,u),k()}ki([`keydown`,`click`]);var CV=H(`

            `),wV=H(` `),TV=H(``),EV=H(` `),DV=H(`

            A greyed-out profile is withdrawn from every surface here, so it cannot be the default.

            `),OV=H(`

            No default — a conversation that has not been pointed anywhere is refused.

            `),kV=H(`
            ProfileDefault
            `,1),AV=H(`
            Profiles

            Every profile is reachable through this connection until you turn it off; a conversation already sitting in a withdrawn one is told, not moved. The default is where a new - conversation lands when nothing else has been chosen.

            `,1);function bV(e,t){O(t,!0);let n=ro(t,`profById`,19,()=>({})),r=M(null),i=M(!1),a=M(``),o=j(()=>Object.keys(B(r)?.exposure||{})),s=j(()=>B(o).some(e=>!JB(B(r)?.exposure,e))),c=j(()=>t.connection.id);hr(()=>{let e=B(c);Q.connectionExposure(e).then(t=>{e===B(c)&&N(r,t,!0)}).catch(e=>{N(a,nS(e),!0)})});async function l(e,n){if(B(i)||!B(r))return;N(a,``),N(i,!0);let o=B(r).default_profile;try{let i=B(r).exposure[e]?.[n]!==!1;N(r,await Q.setConnectionExposure(t.connection.id,e,n,!i),!0),B(r).default_profile!==o&&await t.reload()}catch(e){N(a,nS(e),!0)}N(i,!1)}async function u(e){if(!(B(i)||!B(r))){N(a,``),N(i,!0);try{let n=await Q.connectionDefault(t.connection.id,B(r).default_profile===e?null:e);N(r,{...B(r),default_profile:n.default_profile},!0),await t.reload()}catch(e){N(a,nS(e),!0)}N(i,!1)}}var d=yV(),f=R(I(d),4),p=e=>{var t=fV(),n=L(t,!0);z(()=>W(n,B(a))),U(e,t)};G(f,e=>{B(a)&&e(p)});var m=R(f,2),h=e=>{var a=vV(),c=I(a),d=F(c),f=F(d);K(R(F(f),2),17,()=>B(r).surfaces,e=>e.id,(e,n)=>{var r=pV(),i=L(r,!0);z(e=>W(i,e),[()=>qB(t.connection.platform,B(n).kind)]),U(e,r)}),D(f),D(d);var p=R(d);K(p,20,()=>B(o),e=>e,(e,a)=>{let o=j(()=>n()[a]),s=j(()=>JB(B(r).exposure,a)),c=j(()=>B(o)?.name||a),d=j(()=>B(r).default_profile===a);var f=hV(),p=F(f),m=F(p),h=R(m,2);let g;var _=L(h,!0);D(p);var v=R(p),y=F(v);let b;D(v),K(R(v),17,()=>B(r).surfaces,e=>e.id,(e,n)=>{let o=j(()=>B(r).exposure[a]?.[B(n).id]!==!1);var s=mV(),u=F(s);let d;D(s),z(e=>{d=q(u,1,`setswitch`,null,d,{on:B(o)}),J(u,`aria-checked`,B(o)),u.disabled=B(i),J(u,`title`,B(o)?`Reachable here`:`Withdrawn from this surface`),J(u,`aria-label`,`${B(c)??``} reachable from ${t.connection.name??``} ${e??``}`)},[()=>qB(t.connection.platform,B(n).kind)]),V(`click`,u,()=>l(a,B(n).id)),U(e,s)}),D(f),z(()=>{xa(m,`--dot:${(B(o)?.accent||`var(--muted)`)??``}`),g=q(h,1,``,null,g,{dim:!B(s)}),W(_,B(c)),b=q(y,1,`cnradio`,null,b,{on:B(d)}),J(y,`aria-checked`,B(d)),y.disabled=B(i)||!B(s),J(y,`aria-label`,`${B(c)??``} is the default profile for ${t.connection.name??``}`),J(y,`title`,B(s)?B(d)?`Leave this connection with no default`:`Make this the default profile`:`Withdrawn from every surface — it cannot be the default`)}),V(`click`,y,()=>u(a)),U(e,f)}),D(p),D(c);var m=R(c,2),h=e=>{U(e,gV())};G(m,e=>{B(s)&&e(h)});var g=R(m,2),_=e=>{U(e,_V())};G(g,e=>{B(r).default_profile??e(_)}),U(e,a)};G(m,e=>{B(r)&&e(h)}),U(e,d),k()}ki([`click`]);var xV=H(`

            `),SV=H(`

            Send

            `),CV=H(`

            Nobody is paired — this connection answers nobody.

            `),wV=H(`pending`),TV=H(` `,1),EV=H(``),DV=H(`
          • `),OV=H(`
              `),kV=H(`
              `),AV=H(``),jV=H(` `,1),MV=H(`
              Who it answers

              `,1);function NV(e,t){O(t,!0);let n=M(null),r=M(!1),i=M(``),a=M(!1),o=M(``),s=M(null),c=j(()=>WB[t.connection.platform]),l=j(()=>t.connection.id);hr(()=>{let e=B(l);N(a,!1),N(o,``),N(s,null),Q.connectionPairing(e).then(t=>{e===B(l)&&N(n,t,!0)}).catch(e=>{N(i,nS(e),!0)})});async function u(e,a=!0){if(B(r))return!1;N(i,``),N(r,!0);let o=!1;try{N(n,await e(),!0),a&&await t.reload(),o=!0}catch(e){N(i,nS(e),!0)}return N(r,!1),o}async function d(){let e=B(o).trim();e&&await u(()=>Q.connectionPair(B(l),e))&&(N(o,``),N(a,!1))}async function f(e){await u(()=>Q.connectionUnpair(B(l),e))&&N(s,null)}let p=()=>u(async()=>(await Q.connectionPairingCode(B(l)),Q.connectionPairing(B(l))),!1),m=e=>e.pending?`@${e.handle}`:e.handle?`${e.account_id} (@${e.handle})`:e.account_id;function h(e){let t=Math.max(0,Math.round((e.expires_at*1e3-Date.now())/6e4));return t?`expires in ${t} min`:`expiring now`}var g=MV(),_=I(g),v=R(F(_),2),y=L(v,!0);D(_);var b=R(_,2),x=L(b),S=R(b,2),C=e=>{var t=xV(),n=L(t,!0);z(()=>W(n,B(i))),U(e,t)};G(S,e=>{B(i)&&e(C)});var w=R(S,2),T=e=>{var t=jV(),l=I(t),u=e=>{var t=SV(),r=R(F(t)),i=L(r,!0),a=R(r);D(t),z(e=>{W(i,B(n).code.code),W(a,` to this bot from the account you want to - pair — ${e??``}.`)},[()=>h(B(n).code)]),U(e,t)};G(l,e=>{B(n).code&&e(u)});var p=R(l,2),g=e=>{U(e,CV())},_=e=>{var t=OV();K(t,21,()=>B(n).accounts,e=>e.key,(e,t)=>{var n=DV(),a=F(n),o=L(a,!0),c=R(a,2),l=e=>{U(e,wV())};G(c,e=>{B(t).pending&&e(l)});var u=R(c,2),d=e=>{var n=TV(),i=I(n),a=L(i,!0),o=R(i,2),c=L(o,!0),l=R(o,2);z(()=>{W(a,B(t).pending?`Cancel this invitation?`:`Stop answering them?`),o.disabled=B(r),W(c,B(t).pending?`Cancel invitation`:`Revoke`),l.disabled=B(r)}),V(`click`,o,()=>f(B(t).key)),V(`click`,l,()=>N(s,null)),U(e,n)},p=e=>{var n=EV();z(()=>n.disabled=B(r)),V(`click`,n,()=>{N(s,B(t).key,!0),N(i,``)}),U(e,n)};G(u,e=>{B(s)===B(t).key?e(d):e(p,-1)}),D(n),z(e=>W(o,e),[()=>m(B(t))]),U(e,n)}),D(t),U(e,t)};G(p,e=>{B(n).accounts.length?e(_,-1):e(g)});var v=R(p,2),y=e=>{var t=kV(),n=F(t);za(n);var i=R(n,2),s=L(i,!0),l=R(i,2);D(t),z(e=>{J(n,`placeholder`,B(c)?.handles?`numeric account id, or @handle`:`numeric account id`),n.disabled=B(r),i.disabled=e,W(s,B(r)?`Pairing…`:`Pair`),l.disabled=B(r)},[()=>B(r)||!B(o).trim()]),V(`keydown`,n,e=>{e.key===`Enter`&&d(),e.key===`Escape`&&(N(a,!1),N(o,``))}),qa(n,()=>B(o),e=>N(o,e)),V(`click`,i,d),V(`click`,l,()=>{N(a,!1),N(o,``)}),U(e,t)},b=e=>{var t=AV();$(F(t),{name:`plus`,size:13}),tt(),D(t),z(()=>t.disabled=B(r)),V(`click`,t,()=>{N(a,!0),N(i,``)}),U(e,t)};G(v,e=>{B(a)?e(y):e(b,-1)}),U(e,t)};G(w,e=>{B(n)&&e(T)}),z(()=>{v.disabled=B(r),W(y,B(n)?.code?`New pairing code`:`Pairing code`),W(x,`Only these accounts reach ${t.connection.name??``}. Pairing one here grants it nothing on any - other connection, including another bot of the same kind.`)}),V(`click`,v,p),U(e,g),k()}ki([`click`,`keydown`]);var PV=H(`

              `),FV=H(`not reachable here — this group is silent until it is re-pointed`),IV=H(``),LV=H(``),RV=H(`
            • `),zV=H(`
              Groups

              A group's profile is set here, not from the group — anyone in it can read the answers.

                `,1);function BV(e,t){O(t,!0);let n=M(null),r=M(``),i=M(``),a=j(()=>t.connection.id);hr(()=>{let e=B(a);Q.connectionGroups(e).then(t=>{e===B(a)&&N(n,t,!0)}).catch(e=>{N(i,nS(e),!0)})});let o=e=>!!e.profile&&!!B(n)?.profiles.some(t=>t.id===e.profile);async function s(e,t){if(!(B(r)||!t)){N(i,``),N(r,e,!0);try{N(n,await Q.connectionGroupProfile(B(a),e,t),!0)}catch(e){N(i,nS(e),!0)}N(r,``)}}var c=Bi(),l=I(c),u=e=>{var t=zV(),a=R(I(t),4),c=e=>{var t=PV(),n=L(t,!0);z(()=>W(n,B(i))),U(e,t)};G(a,e=>{B(i)&&e(c)});var l=R(a,2);K(l,21,()=>B(n).groups,e=>e.chat_id,(e,t)=>{let i=j(()=>o(B(t)));var a=RV(),c=F(a),l=L(c,!0),u=R(c,2),d=e=>{U(e,FV())};G(u,e=>{B(i)||e(d)});var f=R(u,2),p=F(f),m=e=>{var t=IV();t.value=t.__value=``,U(e,t)};G(p,e=>{B(i)||e(m)}),K(R(p),17,()=>B(n).profiles,e=>e.id,(e,t)=>{var n=LV(),r=L(n,!0),i={};z(()=>{W(r,B(t).name),i!==(i=B(t).id)&&(n.value=(n.__value=i)??``)}),U(e,n)}),D(f);var h;Ea(f),D(a),z(()=>{W(l,B(t).chat_id),J(f,`aria-label`,`Profile for group ${B(t).chat_id??``}`),f.disabled=B(r)===B(t).chat_id,h!==(h=B(i)?B(t).profile:``)&&(f.value=(f.__value=h)??``,Ta(f,h))}),V(`change`,f,e=>s(B(t).chat_id,e.currentTarget.value)),U(e,a)}),D(l),U(e,t)};G(l,e=>{B(n)?.groups.length&&e(u)}),U(e,c),k()}ki([`change`]);var VV=H(`

                `),HV=H(`

                `),UV=H(`
                `),WV=H(`

                Replacing keeps this connection's paired accounts, group pins and profile settings — + conversation lands when nothing else has been chosen.

                `,1);function jV(e,t){O(t,!0);let n=ro(t,`profById`,19,()=>({})),r=M(null),i=M(!1),a=M(``),o=j(()=>Object.keys(B(r)?.exposure||{})),s=j(()=>B(o).some(e=>!aV(B(r)?.exposure,e))),c=j(()=>t.connection.id);hr(()=>{let e=B(c);Q.connectionExposure(e).then(t=>{e===B(c)&&N(r,t,!0)}).catch(e=>{N(a,iS(e),!0)})});async function l(e,n){if(B(i)||!B(r))return;N(a,``),N(i,!0);let o=B(r).default_profile;try{let i=B(r).exposure[e]?.[n]!==!1;N(r,await Q.setConnectionExposure(t.connection.id,e,n,!i),!0),B(r).default_profile!==o&&await t.reload()}catch(e){N(a,iS(e),!0)}N(i,!1)}async function u(e){if(!(B(i)||!B(r))){N(a,``),N(i,!0);try{let n=await Q.connectionDefault(t.connection.id,B(r).default_profile===e?null:e);N(r,{...B(r),default_profile:n.default_profile},!0),await t.reload()}catch(e){N(a,iS(e),!0)}N(i,!1)}}var d=AV(),f=R(I(d),4),p=e=>{var t=CV(),n=L(t,!0);z(()=>W(n,B(a))),U(e,t)};G(f,e=>{B(a)&&e(p)});var m=R(f,2),h=e=>{var a=kV(),c=I(a),d=F(c),f=F(d);K(R(F(f),2),17,()=>B(r).surfaces,e=>e.id,(e,n)=>{var r=wV(),i=L(r,!0);z(e=>W(i,e),[()=>iV(t.connection.platform,B(n).kind)]),U(e,r)}),D(f),D(d);var p=R(d);K(p,20,()=>B(o),e=>e,(e,a)=>{let o=j(()=>n()[a]),s=j(()=>aV(B(r).exposure,a)),c=j(()=>B(o)?.name||a),d=j(()=>B(r).default_profile===a);var f=EV(),p=F(f),m=F(p),h=R(m,2);let g;var _=L(h,!0);D(p);var v=R(p),y=F(v);let b;D(v),K(R(v),17,()=>B(r).surfaces,e=>e.id,(e,n)=>{let o=j(()=>B(r).exposure[a]?.[B(n).id]!==!1);var s=TV(),u=F(s);let d;D(s),z(e=>{d=q(u,1,`setswitch`,null,d,{on:B(o)}),J(u,`aria-checked`,B(o)),u.disabled=B(i),J(u,`title`,B(o)?`Reachable here`:`Withdrawn from this surface`),J(u,`aria-label`,`${B(c)??``} reachable from ${t.connection.name??``} ${e??``}`)},[()=>iV(t.connection.platform,B(n).kind)]),V(`click`,u,()=>l(a,B(n).id)),U(e,s)}),D(f),z(()=>{xa(m,`--dot:${(B(o)?.accent||`var(--muted)`)??``}`),g=q(h,1,``,null,g,{dim:!B(s)}),W(_,B(c)),b=q(y,1,`cnradio`,null,b,{on:B(d)}),J(y,`aria-checked`,B(d)),y.disabled=B(i)||!B(s),J(y,`aria-label`,`${B(c)??``} is the default profile for ${t.connection.name??``}`),J(y,`title`,B(s)?B(d)?`Leave this connection with no default`:`Make this the default profile`:`Withdrawn from every surface — it cannot be the default`)}),V(`click`,y,()=>u(a)),U(e,f)}),D(p),D(c);var m=R(c,2),h=e=>{U(e,DV())};G(m,e=>{B(s)&&e(h)});var g=R(m,2),_=e=>{U(e,OV())};G(g,e=>{B(r).default_profile??e(_)}),U(e,a)};G(m,e=>{B(r)&&e(h)}),U(e,d),k()}ki([`click`]);var MV=H(`

                `),NV=H(`

                Send

                `),PV=H(`

                Nobody is paired — this connection answers nobody.

                `),FV=H(`pending`),IV=H(` `,1),LV=H(``),RV=H(`
              • `),zV=H(`
                  `),BV=H(`
                  `),VV=H(``),HV=H(` `,1),UV=H(`
                  Who it answers

                  `,1);function WV(e,t){O(t,!0);let n=M(null),r=M(!1),i=M(``),a=M(!1),o=M(``),s=M(null),c=j(()=>tV[t.connection.platform]),l=j(()=>t.connection.id);hr(()=>{let e=B(l);N(a,!1),N(o,``),N(s,null),Q.connectionPairing(e).then(t=>{e===B(l)&&N(n,t,!0)}).catch(e=>{N(i,iS(e),!0)})});async function u(e,a=!0){if(B(r))return!1;N(i,``),N(r,!0);let o=!1;try{N(n,await e(),!0),a&&await t.reload(),o=!0}catch(e){N(i,iS(e),!0)}return N(r,!1),o}async function d(){let e=B(o).trim();e&&await u(()=>Q.connectionPair(B(l),e))&&(N(o,``),N(a,!1))}async function f(e){await u(()=>Q.connectionUnpair(B(l),e))&&N(s,null)}let p=()=>u(async()=>(await Q.connectionPairingCode(B(l)),Q.connectionPairing(B(l))),!1),m=e=>e.pending?`@${e.handle}`:e.handle?`${e.account_id} (@${e.handle})`:e.account_id;function h(e){let t=Math.max(0,Math.round((e.expires_at*1e3-Date.now())/6e4));return t?`expires in ${t} min`:`expiring now`}var g=UV(),_=I(g),v=R(F(_),2),y=L(v,!0);D(_);var b=R(_,2),x=L(b),S=R(b,2),C=e=>{var t=MV(),n=L(t,!0);z(()=>W(n,B(i))),U(e,t)};G(S,e=>{B(i)&&e(C)});var w=R(S,2),T=e=>{var t=HV(),l=I(t),u=e=>{var t=NV(),r=R(F(t)),i=L(r,!0),a=R(r);D(t),z(e=>{W(i,B(n).code.code),W(a,` to this bot from the account you want to + pair — ${e??``}.`)},[()=>h(B(n).code)]),U(e,t)};G(l,e=>{B(n).code&&e(u)});var p=R(l,2),g=e=>{U(e,PV())},_=e=>{var t=zV();K(t,21,()=>B(n).accounts,e=>e.key,(e,t)=>{var n=RV(),a=F(n),o=L(a,!0),c=R(a,2),l=e=>{U(e,FV())};G(c,e=>{B(t).pending&&e(l)});var u=R(c,2),d=e=>{var n=IV(),i=I(n),a=L(i,!0),o=R(i,2),c=L(o,!0),l=R(o,2);z(()=>{W(a,B(t).pending?`Cancel this invitation?`:`Stop answering them?`),o.disabled=B(r),W(c,B(t).pending?`Cancel invitation`:`Revoke`),l.disabled=B(r)}),V(`click`,o,()=>f(B(t).key)),V(`click`,l,()=>N(s,null)),U(e,n)},p=e=>{var n=LV();z(()=>n.disabled=B(r)),V(`click`,n,()=>{N(s,B(t).key,!0),N(i,``)}),U(e,n)};G(u,e=>{B(s)===B(t).key?e(d):e(p,-1)}),D(n),z(e=>W(o,e),[()=>m(B(t))]),U(e,n)}),D(t),U(e,t)};G(p,e=>{B(n).accounts.length?e(_,-1):e(g)});var v=R(p,2),y=e=>{var t=BV(),n=F(t);za(n);var i=R(n,2),s=L(i,!0),l=R(i,2);D(t),z(e=>{J(n,`placeholder`,B(c)?.handles?`numeric account id, or @handle`:`numeric account id`),n.disabled=B(r),i.disabled=e,W(s,B(r)?`Pairing…`:`Pair`),l.disabled=B(r)},[()=>B(r)||!B(o).trim()]),V(`keydown`,n,e=>{e.key===`Enter`&&d(),e.key===`Escape`&&(N(a,!1),N(o,``))}),qa(n,()=>B(o),e=>N(o,e)),V(`click`,i,d),V(`click`,l,()=>{N(a,!1),N(o,``)}),U(e,t)},b=e=>{var t=VV();$(F(t),{name:`plus`,size:13}),tt(),D(t),z(()=>t.disabled=B(r)),V(`click`,t,()=>{N(a,!0),N(i,``)}),U(e,t)};G(v,e=>{B(a)?e(y):e(b,-1)}),U(e,t)};G(w,e=>{B(n)&&e(T)}),z(()=>{v.disabled=B(r),W(y,B(n)?.code?`New pairing code`:`Pairing code`),W(x,`Only these accounts reach ${t.connection.name??``}. Pairing one here grants it nothing on any + other connection, including another bot of the same kind.`)}),V(`click`,v,p),U(e,g),k()}ki([`click`,`keydown`]);var GV=H(`

                  `),KV=H(`not reachable here — this group is silent until it is re-pointed`),qV=H(``),JV=H(``),YV=H(`
                • `),XV=H(`
                  Groups

                  A group's profile is set here, not from the group — anyone in it can read the answers.

                    `,1);function ZV(e,t){O(t,!0);let n=M(null),r=M(``),i=M(``),a=j(()=>t.connection.id);hr(()=>{let e=B(a);Q.connectionGroups(e).then(t=>{e===B(a)&&N(n,t,!0)}).catch(e=>{N(i,iS(e),!0)})});let o=e=>!!e.profile&&!!B(n)?.profiles.some(t=>t.id===e.profile);async function s(e,t){if(!(B(r)||!t)){N(i,``),N(r,e,!0);try{N(n,await Q.connectionGroupProfile(B(a),e,t),!0)}catch(e){N(i,iS(e),!0)}N(r,``)}}var c=Bi(),l=I(c),u=e=>{var t=XV(),a=R(I(t),4),c=e=>{var t=GV(),n=L(t,!0);z(()=>W(n,B(i))),U(e,t)};G(a,e=>{B(i)&&e(c)});var l=R(a,2);K(l,21,()=>B(n).groups,e=>e.chat_id,(e,t)=>{let i=j(()=>o(B(t)));var a=YV(),c=F(a),l=L(c,!0),u=R(c,2),d=e=>{U(e,KV())};G(u,e=>{B(i)||e(d)});var f=R(u,2),p=F(f),m=e=>{var t=qV();t.value=t.__value=``,U(e,t)};G(p,e=>{B(i)||e(m)}),K(R(p),17,()=>B(n).profiles,e=>e.id,(e,t)=>{var n=JV(),r=L(n,!0),i={};z(()=>{W(r,B(t).name),i!==(i=B(t).id)&&(n.value=(n.__value=i)??``)}),U(e,n)}),D(f);var h;Ea(f),D(a),z(()=>{W(l,B(t).chat_id),J(f,`aria-label`,`Profile for group ${B(t).chat_id??``}`),f.disabled=B(r)===B(t).chat_id,h!==(h=B(i)?B(t).profile:``)&&(f.value=(f.__value=h)??``,Ta(f,h))}),V(`change`,f,e=>s(B(t).chat_id,e.currentTarget.value)),U(e,a)}),D(l),U(e,t)};G(l,e=>{B(n)?.groups.length&&e(u)}),U(e,c),k()}ki([`change`]);var QV=H(`

                    `),$V=H(`

                    `),eH=H(`
                    `),tH=H(`

                    Replacing keeps this connection's paired accounts, group pins and profile settings — right for a rotated token, wrong for a different bot, which belongs in its own - integration.

                    `,1),GV=H(`
                    `,1),KV=H(`
                    `),qV=H(`
                    Connection

                    `,1);function JV(e,t){O(t,!0);let n=()=>A(No,`$profiles`,r),[r,i]=Zt(),a=ro(t,`tag`,3,``),o=j(()=>WB[t.connection.platform]),s=j(()=>Object.fromEntries(n().list.map(e=>[e.id,e]))),c=j(()=>YB(t.connection,t.connection.default_profile?B(s)[t.connection.default_profile]?.name:``)),l=M(!1),u=M(``),d=M(``),f=M(!1),p=M(!1),m=M(P({})),h=j(()=>B(o)?.fields||[]),g=j(()=>B(h).length>0&&B(h).every(e=>(B(m)[e.env]||``).trim()));async function _(e){N(u,``),N(l,!0);let n=!1;try{await Q.renameConnection(t.connection.id,e),await t.reload(),n=!0}catch(e){N(u,nS(e),!0)}return N(l,!1),n}async function v(){if(!(!B(g)||B(l))){N(u,``),N(d,``),N(l,!0);try{await Q.replaceConnectionTokens(t.connection.id,Object.fromEntries(B(h).map(e=>[e.env,(B(m)[e.env]||``).trim()]))),await t.reload(),N(m,{},!0),N(f,!1),N(d,`Token replaced — the connection restarted on it.`)}catch(e){N(u,nS(e),!0)}N(l,!1)}}async function y(){N(u,``),N(l,!0);try{await Q.deleteConnection(t.connection.id),await t.reload(),t.onDisconnected()}catch(e){N(u,nS(e),!0)}N(l,!1)}let b=j(()=>B(h).map(e=>`${e.label.toLowerCase()} ${t.connection.tokens?.[e.env]?.hint||``}`.trim()).join(` · `));var x=qV(),S=I(x);dV(S,{get platform(){return t.connection.platform},get label(){return t.connection.name},get tag(){return a()},get status(){return B(c)},onRename:_,get busy(){return B(l)}});var C=R(S,2);bV(C,{get connection(){return t.connection},get profById(){return B(s)},get reload(){return t.reload}});var w=R(C,2);NV(w,{get connection(){return t.connection},get reload(){return t.reload}});var T=R(w,2);BV(T,{get connection(){return t.connection}});var ee=R(T,4),te=L(ee),ne=R(ee,2),re=e=>{var t=VV(),n=L(t,!0);z(()=>W(n,B(u))),U(e,t)};G(ne,e=>{B(u)&&e(re)});var ie=R(ne,2),ae=e=>{var t=HV(),n=L(t,!0);z(()=>W(n,B(d))),U(e,t)};G(ie,e=>{B(d)&&e(ae)});var oe=R(ie,2),se=e=>{var t=WV(),n=R(I(t),2);K(n,17,()=>B(h),e=>e.env,(e,t)=>{var n=UV(),r=F(n),i=L(r,!0),a=R(r,2);za(a),D(n),z(e=>{W(i,B(t).label),a.disabled=B(l),J(a,`aria-label`,`New ${e??``}`)},[()=>B(t).label.toLowerCase()]),V(`keydown`,a,e=>{e.key===`Enter`&&v()}),qa(a,()=>B(m)[B(t).env],e=>B(m)[B(t).env]=e),U(e,n)});var r=R(n,2),i=F(r),a=L(i,!0),o=R(i,2);D(r),z(()=>{i.disabled=!B(g)||B(l),W(a,B(l)?`Replacing…`:`Replace token`),o.disabled=B(l)}),V(`click`,i,v),V(`click`,o,()=>{N(f,!1),N(m,{},!0)}),U(e,t)},ce=e=>{var n=GV(),r=I(n),i=L(F(r));D(r);var a=R(r,2),o=F(a),s=L(o,!0),c=R(o,2);D(a),z(()=>{W(i,`Disconnect ${t.connection.name??``}? Its paired accounts, group pins and default profile go - with it. Every other connection is left running.`),o.disabled=B(l),W(s,B(l)?`Disconnecting…`:`Disconnect`),c.disabled=B(l)}),V(`click`,o,y),V(`click`,c,()=>N(p,!1)),U(e,n)},le=e=>{var t=KV(),n=F(t),r=R(n,2);D(t),z(()=>{n.disabled=B(l),r.disabled=B(l)}),V(`click`,n,()=>{N(f,!0),N(d,``)}),V(`click`,r,()=>N(p,!0)),U(e,t)};G(oe,e=>{B(f)?e(se):B(p)?e(ce,1):e(le,-1)}),z(e=>W(te,`${e??``} · ${(B(b)||`token set when this connection was made`)??``}`),[()=>GB(t.connection.platform)]),U(e,x),k(),i()}ki([`keydown`,`click`]);var YV=H(` `,1),XV=H(`
                    Account

                    `,1),ZV=H(`

                    `),QV=H(`
                    Disconnect GitHub? Skill downloads fall back to the anonymous rate limit.
                    `,1),$V=H(`
                    `),eH=H(`
                    Token

                    Token
                    `,1),tH=H(`

                    Nothing connected yet — add one below.

                    `),nH=H(` `),rH=H(``),iH=H(``),aH=H(``),oH=H(``),sH=H(` `),cH=H(``),lH=H(`
                    Pick an integration
                    `,1),uH=H(`
                    Connected install-wide
                    `,1);function dH(e,t){O(t,!0);let n=()=>A(No,`$profiles`,r),[r,i]=Zt(),a=hF(),o=M(P([])),s=M(``),c=M(!1),l=M(null),u=M(null),d=M(!1),f=M(!1);io(p);async function p(){try{N(o,await Q.connections(),!0),N(s,``)}catch(e){N(s,nS(e),!0)}N(c,!0)}let m=j(()=>Object.fromEntries(n().list.map(e=>[e.id,e]))),h=e=>B(o).filter(t=>t.platform===e).length,g=j(()=>B(o).find(e=>e.id===B(l))||null),_=j(()=>!!a.google?.signed_in),v=j(()=>!!a.s?.keys?.github?.set),y=j(()=>UB.filter(e=>e.multiple||(e.kind===`google`?!B(_):!B(v))));function b(e){if(N(d,!1),e.kind===`google`){a.openGoogle();return}N(u,e,!0)}async function x(e,t){if(!B(u))return;if(B(u).kind===`github`){await Q.setKey(`github`,t.token),await a.load(),N(u,null),N(l,`github`);return}let n=await Q.createConnection(B(u).id,e,t);await p(),N(u,null),N(l,n.id,!0)}function S(){N(l,null),N(u,null),N(f,!1)}let C=()=>a.run(()=>Q.setKey(`github`,a.drafts.github||``).then(()=>{a.drafts.github=``})),w=()=>a.run(()=>Q.setKey(`github`,``).then(()=>{N(f,!1),N(l,null)}));var T=Bi(),ee=I(T),te=e=>{var t=YV(),n=I(t);$(F(n),{name:`chevron-left`,size:13}),tt(),D(n),aV(R(n,2),{get entry(){return B(u)},get connections(){return B(o)},onConnect:x,onCancel:()=>{N(u,null),N(d,!0)}}),V(`click`,n,()=>{N(u,null),N(d,!0)}),U(e,t)},ne=e=>{var t=YV(),n=I(t);$(F(n),{name:`chevron-left`,size:13}),tt(),D(n);var r=R(n,2);{let e=j(()=>h(B(g).platform)>1?GB(B(g).platform):``);JV(r,{get connection(){return B(g)},get tag(){return B(e)},reload:p,onDisconnected:S})}V(`click`,n,S),U(e,t)},re=e=>{var t=XV(),n=I(t);$(F(n),{name:`chevron-left`,size:13}),tt(),D(n);var r=R(n,2);{let e=j(()=>XB(a.google));dV(r,{platform:`google`,label:`Google`,get status(){return B(e)}})}var i=R(r,4),o=L(i),s=L(R(i,2));z(()=>W(o,`${WB.google?.setup??``} Gmail, Calendar and Drive tools appear once you are signed in. - Managing it opens the Google flow — Settings closes behind it.`)),V(`click`,n,S),V(`click`,s,function(...e){a.openGoogle?.apply(this,e)}),U(e,t)},ie=e=>{var t=eH(),n=I(t);$(F(n),{name:`chevron-left`,size:13}),tt(),D(n);var r=R(n,2);{let e=j(()=>ZB(a.s?.keys));dV(r,{platform:`github`,label:`GitHub`,get status(){return B(e)}})}var i=R(r,4),o=L(i),s=R(i,2),c=e=>{var t=ZV(),n=L(t,!0);z(()=>W(n,a.err)),U(e,t)};G(s,e=>{a.err&&e(c)});var l=R(s,2),u=R(F(l),2);za(u);var d=R(u,2);D(l);var p=R(l,2),m=e=>{var t=Bi(),n=I(t),r=e=>{var t=QV(),n=R(I(t),2),r=F(n),i=R(r,2);D(n),z(()=>{r.disabled=a.busy,i.disabled=a.busy}),V(`click`,r,w),V(`click`,i,()=>N(f,!1)),U(e,t)},i=e=>{var t=$V(),n=L(t);z(()=>n.disabled=a.busy),V(`click`,n,()=>N(f,!0)),U(e,t)};G(n,e=>{B(f)?e(r):e(i,-1)}),U(e,t)};G(p,e=>{B(v)&&e(m)}),z(()=>{W(o,`${WB.github?.blurb??``} ${WB.github?.setup??``}`),J(u,`placeholder`,B(v)?`•••• `+(a.s?.keys.github?.hint||``):`paste token`),d.disabled=a.busy}),V(`click`,n,S),qa(u,()=>a.drafts.github,e=>a.drafts.github=e),V(`click`,d,C),U(e,t)},ae=e=>{var t=uH(),n=R(I(t),2),r=e=>{var t=ZV(),n=L(t,!0);z(()=>W(n,B(s))),U(e,t)};G(n,e=>{B(s)&&e(r)});var i=R(n,2),u=e=>{U(e,tH())};G(i,e=>{B(c)&&!B(o).length&&!B(_)&&!B(v)&&e(u)});var f=R(i,2);K(f,17,()=>B(o),e=>e.id,(e,t)=>{var n=rH(),r=F(n);eV(r,{get platform(){return B(t).platform},get name(){return B(t).name}});var i=R(r,2),a=F(i),o=F(a),s=R(o),c=e=>{var n=nH(),r=L(n,!0);z(e=>W(r,e),[()=>GB(B(t).platform)]),U(e,n)},u=j(()=>h(B(t).platform)>1);G(s,e=>{B(u)&&e(c)}),D(a);var d=R(a,2);{let e=j(()=>YB(B(t),B(t).default_profile?B(m)[B(t).default_profile]?.name:``));TB(d,{get status(){return B(e)}})}D(i),$(R(i,2),{name:`chevron-right`,size:15}),D(n),z(()=>W(o,`${B(t).name??``} `)),V(`click`,n,()=>N(l,B(t).id,!0)),U(e,n)});var p=R(f,2),g=e=>{var t=iH(),n=F(t);eV(n,{platform:`google`,name:`Google`});var r=R(n,2),i=R(F(r),2);{let e=j(()=>XB(a.google));TB(i,{get status(){return B(e)}})}D(r),$(R(r,2),{name:`chevron-right`,size:15}),D(t),V(`click`,t,()=>N(l,`google`)),U(e,t)};G(p,e=>{B(_)&&e(g)});var x=R(p,2),S=e=>{var t=aH(),n=F(t);eV(n,{platform:`github`,name:`GitHub`});var r=R(n,2),i=R(F(r),2);{let e=j(()=>ZB(a.s?.keys));TB(i,{get status(){return B(e)}})}D(r),$(R(r,2),{name:`chevron-right`,size:15}),D(t),V(`click`,t,()=>N(l,`github`)),U(e,t)};G(x,e=>{B(v)&&e(S)});var C=R(x,2),w=e=>{var t=oH();$(F(t),{name:`plus`,size:14}),tt(),D(t),V(`click`,t,()=>N(d,!0)),U(e,t)},T=e=>{var t=lH(),n=R(I(t),2);K(n,21,()=>B(y),e=>e.id,(e,t)=>{var n=cH(),r=F(n),i=F(r);eV(i,{get platform(){return B(t).id},get name(){return B(t).label},sm:!0});var a=R(i),o=R(a),s=e=>{var n=nH(),r=L(n);z(e=>W(r,`${e??``} connected`),[()=>h(B(t).id)]),U(e,n)},c=j(()=>h(B(t).id));G(o,e=>{B(c)&&e(s)}),D(r);var l=R(r,2),u=L(l,!0),d=R(l,2),f=e=>{var n=sH(),r=L(n,!0);z(()=>W(r,B(t).setup)),U(e,n)};G(d,e=>{B(t).setup&&e(f)}),D(n),z(()=>{W(a,` ${B(t).label??``} `),W(u,B(t).blurb)}),V(`click`,n,()=>b(B(t))),U(e,n)}),D(n),V(`click`,L(R(n,2)),()=>N(d,!1)),U(e,t)};G(C,e=>{B(d)?e(T,-1):e(w)}),HB(R(C,2),{}),U(e,t)};G(ee,e=>{B(u)?e(te):B(g)?e(ne,1):B(l)===`google`?e(re,2):B(l)===`github`?e(ie,3):e(ae,-1)}),U(e,T),k(),i()}ki([`click`]);var fH=H(`

                    `),pH=H(`

                    Loading…

                    `),mH=H(`Saved ✓`),hH=H(`
                    `,1),gH=H(`

                    `,1);function _H(e,t){O(t,!0);let n=ro(t,`placeholder`,3,``),r=ro(t,`minHeight`,3,`160px`),i=ro(t,`epoch`,3,0),a=M(``),o=M(!0),s=M(!1),c=M(!1),l=M(``);async function u(){N(o,!0),N(l,``);try{N(a,await t.load()||``,!0)}catch(e){N(l,nS(e),!0)}N(o,!1)}hr(()=>{i(),u()});async function d(){N(l,``),N(s,!0);try{await t.save(B(a)),N(c,!0),setTimeout(()=>N(c,!1),1500)}catch(e){N(l,nS(e),!0)}N(s,!1)}var f=gH(),p=I(f),m=L(p,!0),h=R(p,2),g=e=>{var t=fH(),n=L(t,!0);z(()=>W(n,B(l))),U(e,t)};G(h,e=>{B(l)&&e(g)});var _=R(h,2),v=e=>{U(e,pH())},y=e=>{var t=hH(),i=I(t);tn(i);var o=R(i,2),l=F(o),u=e=>{U(e,mH())};G(l,e=>{B(c)&&e(u)});var f=R(l,2);D(o),z(()=>{xa(i,`min-height:${r()??``}`),J(i,`placeholder`,n()),f.disabled=B(s)}),qa(i,()=>B(a),e=>N(a,e)),V(`click`,f,d),U(e,t)};G(_,e=>{B(o)?e(v):e(y,-1)}),z(()=>W(m,t.hint)),U(e,f),k()}ki([`click`]);var vH=H(`
                    Turn budget
                    Chat turn timeout Total time for model calls, tools, and questions
                    Who you are
                    AG2
                    Powered by AG2 the AG2 primitives behind this app
                    `,1);function yH(e,t){O(t,!0);let n=()=>A(Ks,`$ag2View`,r),[r,i]=Zt(),a=hF(),o=M(``);hr(()=>{a.s&&N(o,String(a.s.reply_timeout_s),!0)});function s(){let e=Number(B(o));if(!Number.isFinite(e)||e<=0){a.err=`Chat turn timeout must be greater than zero.`;return}a.run(()=>Q.setReplyTimeout(e))}var c=vH(),l=R(I(c),2),u=F(l),d=F(u);$(F(d),{name:`clock`,size:15}),tt(),D(d),tt(2),D(u);var f=R(u,2),p=F(f);za(p),tt(2),D(f);var m=R(f,2);D(l);var h=R(l,4);_H(h,{load:()=>Q.globalMemory().then(e=>e.text),save:e=>Q.setGlobalMemory(e),hint:`Identity facts — name, location, timezone, family, writing voice — that are true no matter which profile you're in. Shared across every profile.`,placeholder:`(nothing here yet)`});var g=R(h,4),_=F(g),v=F(_);$(F(v),{name:`zap`,size:15}),tt(),D(v),tt(2),D(_);var y=R(_,2);D(g);var b=R(g,2),x=F(b);za(x),tt(),D(b),z(()=>{m.disabled=a.busy,Va(x,n())}),qa(p,()=>B(o),e=>N(o,e)),V(`click`,m,s),V(`click`,y,function(...e){a.openPoweredBy?.apply(this,e)}),V(`change`,x,function(...e){Gs?.apply(this,e)}),U(e,c),k(),i()}ki([`click`,`change`]);var bH=H(`

                    `),xH=H(`

                    Loading…

                    `),SH=H(``),CH=H(`
                    `),wH=H(` `,1);function TH(e,t){O(t,!0);let n=()=>A(js,`$route`,s),r=()=>A(No,`$profiles`,s),i=()=>A(Po,`$profileEpoch`,s),a=()=>A(Ko,`$voicePickerOpen`,s),o=()=>A(Go,`$codexOpen`,s),[s,c]=Zt(),l=[{id:yo.GENERAL,label:`General`,comp:vF},{id:yo.PROFILES,label:`Profiles`,comp:BI},{id:yo.MODELS,label:`Models`,comp:dz},{id:yo.SECRETS,label:`Secrets`,comp:Sz},{id:yo.SKILLS,label:`Skills`,comp:Az},{id:yo.TOOLS,label:`Tools & Permissions`,comp:CB},{id:yo.INTEGRATIONS,label:`Integrations`,comp:dH},{id:yo.ADVANCED,label:`Advanced`,comp:yH}],u=mF(),d=j(()=>l.some(e=>e.id===n().overlayValue)?n().overlayValue:yo.GENERAL);function f(e){zs(`settings`,e)}let p=j(()=>(l.find(e=>e.id===B(d))||l[0]).comp),m=j(()=>{let e=r().activeId||hs();return(r().list||[]).find(t=>t.id===e)?.name||``});hr(()=>{i(),u.load()});function h(e){e.key===`Escape`&&!a()&&!o()&&u.close()}var g=wH();Oi(`keydown`,Xn,h);var _=I(g),v=R(_,2),y=F(v),b=R(y,2),x=L(b),S=R(b,2),C=e=>{var t=bH(),n=L(t,!0);z(()=>W(n,u.err)),U(e,t)};G(S,e=>{u.err&&e(C)});var w=R(S,2),T=e=>{U(e,xH())},ee=e=>{var t=CH(),n=F(t);K(n,21,()=>l,Qi,(e,t)=>{var n=SH();let r;var i=L(n,!0);z(()=>{r=q(n,1,`setnavbtn`,null,r,{on:B(d)===B(t).id}),W(i,B(t).label)}),V(`click`,n,()=>f(B(t).id)),U(e,n)}),D(n);var r=R(n,2);la(F(r),()=>B(p),(e,t)=>{t(e,{})}),D(r),D(t),U(e,t)};G(w,e=>{u.s?e(ee,-1):e(T)}),D(v),z(()=>W(x,`Settings${B(m)?` — `+B(m):``}`)),V(`click`,_,function(...e){u.close?.apply(this,e)}),V(`click`,y,function(...e){u.close?.apply(this,e)}),U(e,g),k(),c()}ki([`click`]);var EH=H(`
                    No events yet — say something to the assistant.
                    `),DH=H(`app`),OH=H(`
                     
                    `),kH=H(`
                    `,1),AH=H(` `),jH=H(``);function MH(e,t){O(t,!0);let n=()=>A(ts,`$inspectorEvents`,r),[r,i]=Zt(),a=M(P(new Set)),o=e=>{let t=new Set(B(a));t.has(e)?t.delete(e):t.add(e),N(a,t,!0)},s=e=>new Date(e).toLocaleTimeString([],{hour12:!1}),c=j(()=>[...n()].reverse());var l=jH(),u=F(l);hC(u,{});var d=R(u,2),f=R(F(d),2),p=R(f,2);$(F(p),{name:`x`,size:16}),D(p),D(d);var m=R(d,4),h=F(m),g=e=>{U(e,EH())};G(h,e=>{B(c).length||e(g)}),K(R(h,2),17,()=>B(c),e=>e._id,(e,t)=>{let n=j(()=>xj(B(t).type)),r=j(()=>(vj[B(n).sub]||{}).color||`#888`);var i=kH(),c=I(i),l=F(c),u=R(l,2),d=L(u,!0),f=R(u,2),p=L(f,!0),m=R(f,2),h=e=>{U(e,DH())};G(m,e=>{B(n).layer===`app`&&e(h)});var g=L(R(m,2),!0);D(c);var _=R(c,2),v=e=>{var n=OH(),r=L(n,!0);z(e=>W(r,e),[()=>JSON.stringify(B(t).data,null,2)]),U(e,n)},y=j(()=>B(a).has(B(t)._id));G(_,e=>{B(y)&&e(v)}),z(e=>{xa(l,`background:${B(r)??``}`),W(d,B(n).label),xa(f,`color:${B(r)??``}`),W(p,B(n).sub),W(g,e)},[()=>s(B(t)._t)]),V(`click`,c,()=>o(B(t)._id)),V(`keydown`,c,e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),o(B(t)._id))}),U(e,i)}),D(m);var _=R(m,2);K(_,21,()=>Object.entries(vj),Qi,(e,t)=>{var n=j(()=>pe(B(t),2));let r=()=>B(n)[0],i=()=>B(n)[1];var a=AH(),o=F(a),s=R(o,1,!0);D(a),z(()=>{J(a,`title`,i().blurb),xa(o,`background:${i().color??``}`),W(s,r())}),U(e,a)}),D(_),D(l),V(`click`,f,()=>Rs(`poweredby`)),V(`click`,p,function(...e){Ws?.apply(this,e)}),U(e,l),k(),i()}ki([`click`,`keydown`]);var NH=H(``),PH=H(`
                    `),FH=H(`
                    `),IH=H(` `),LH=H(` `,1);function YH(e,t){O(t,!0);let n=()=>A(js,`$route`,a),r=()=>A($o,`$appVersion`,a),i=()=>A(es,`$ag2Version`,a),[a,o]=Zt(),s=()=>Bs(),c=j(()=>n().overlayValue),l=()=>zs(`settings`,B(c)),u=Fj.filter(e=>e.layer===`ag2`),d=Fj.filter(e=>e.layer===`app`),f=e=>(e?kj[e]?.color:``)||`var(--line)`,p=e=>{e.key===`Escape`&&s()};var m=JH();Oi(`keydown`,Xn,p);var h=I(m),g=R(h,2),_=F(g),v=R(_,2),y=e=>{var t=WH();$(F(t),{name:`chevron-left`,size:15}),tt(),D(t),V(`click`,t,l),U(e,t)};G(v,e=>{B(c)&&e(y)});var b=R(v,6),x=R(F(b),2);K(x,17,()=>u,Qi,(e,t)=>{var n=GH(),r=F(n),i=R(r,2),a=F(i),o=L(a,!0),s=L(R(a),!0);D(i),D(n),z(e=>{xa(r,`background:${e??``}`),W(o,B(t).name),W(s,B(t).what)},[()=>f(B(t).sub)]),U(e,n)}),K(R(x,4),17,()=>d,Qi,(e,t)=>{var n=KH(),r=R(F(n),2),i=F(r),a=L(i,!0),o=L(R(i),!0);D(r),D(n),z(()=>{W(a,B(t).name),W(o,B(t).what)}),U(e,n)}),D(b);var S=R(b,2),C=F(S),w=e=>{var t=qH(),n=F(t),a=R(n),o=e=>{var t=zi();z(()=>W(t,`· AG2 v${i()??``}`)),U(e,t)};G(a,e=>{i()&&e(o)}),D(t),z(()=>W(n,`AG2 Assistant v${r()??``}`)),U(e,t)};G(C,e=>{r()&&e(w)});var T=R(C,2);D(S),D(g),z(()=>J(T,`href`,Ij)),V(`click`,h,s),V(`click`,_,s),U(e,m),k(),o()}ki([`click`]);var XH=H(`
                    `);function ZH(e,t){O(t,!1);let n=()=>A(fs,`$notice`,r),[r,i]=Zt();$a();var a=Bi(),o=I(a),s=e=>{var t=XH(),r=F(t);$(F(r),{name:`clock`,size:15}),D(r);var i=L(R(r,2),!0);D(t),z(()=>W(i,n().text)),U(e,t)};G(o,e=>{n()&&e(s)}),U(e,a),k(),i()}var QH=H(`

                    AG2 Assistant

                    Loading…
                    `),$H=H(`

                    Files

                    Browse and manage your files from the sidebar.
                    `,1),eU=H(`

                    Tasks

                    Pick a task from the sidebar, or create one with New task.
                    `,1),tU=H(`

                    AG2 Assistant

                    Starting a conversation…
                    `,1),nU=H(`
                    `),rU=H(` `,1);function iU(e,t){O(t,!0);let n=()=>A(js,`$route`,_),r=()=>A(Jo,`$viewer`,_),i=()=>A(as,`$previewWidth`,_),a=()=>A(is,`$railWidth`,_),o=()=>A(os,`$previewExpanded`,_),s=()=>A(No,`$profiles`,_),c=()=>A(us,`$onboardingOpen`,_),l=()=>A(Ms,`$settingsOpen`,_),u=()=>A(Ns,`$poweredByOpen`,_),d=()=>A(Wo,`$googleOpen`,_),f=()=>A(Go,`$codexOpen`,_),p=()=>A(Ko,`$voicePickerOpen`,_),m=()=>A(cs,`$drawerWidth`,_),g=()=>A(ls,`$animations`,_),[_,v]=Zt(),y=M(`loading`),b=M(!0),x=j(()=>B(y)===`ready`&&n().aside?.kind===`inspector`),S=j(()=>n().aside?.kind===`file`),C=j(()=>B(S)||!!r()),w=j(()=>B(C)||B(x)),T=j(()=>B(C)?co(i()):co(a())),ee=j(()=>B(C)&&o());io(async()=>{n().aside?.kind!==`file`&&ss();try{let e=await Q.profiles(),t=e.profiles;if(N(b,e.onboarded,!0),Xt($o,e.version),Xt(es,e.ag2_version),Xt(No,{list:t,activeId:null}),!t.length){N(y,`create`);return}te(t,e.active_default)}catch{N(y,`ready`)}});function te(e,t){let r=new Set(e.map(e=>e.id)),i=n().pid,a=_s(),o=i&&r.has(i)?i:a&&r.has(a)?a:t&&r.has(t)?t:e[0].id;gs(o),Xt(No,{list:e,activeId:o});let s=e.find(e=>e.id===o);s?.accent&&h(s.accent),n().pid!==o&&Ls(o),N(y,`ready`),re()}function ne(e){let t=s().list,n=e||t[0]&&t[0].id;if(!n){N(y,`loading`);return}gs(n),Xt(No,{list:t,activeId:n});let r=t.find(e=>e.id===n);r?.accent&&h(r.accent),Ls(n),N(y,`ready`)}async function re(){if(!B(b))try{let e=await Q.settings();[`gemini`,`openai`,`anthropic`].some(t=>e.keys[t]?.set)||Xt(us,!0)}catch{}}function ie(){return l()||u()||d()||f()||p()||c()}function ae(){let e=document.activeElement;if(!e)return!1;let t=e.tagName;return t===`INPUT`||t===`TEXTAREA`||t===`SELECT`||e instanceof HTMLElement&&e.isContentEditable}function oe(e){if(!(e.metaKey||e.ctrlKey)||e.shiftKey||e.altKey||e.key<`1`||e.key>`9`||B(y)!==`ready`||ie()||ae())return;let t=s().list[Number(e.key)-1];t&&(e.preventDefault(),ux(t.id))}function se(e){e.key!==`Escape`||!B(C)||ie()||ae()||(e.preventDefault(),B(S)?Ws():Xt(Jo,null))}io(()=>(window.addEventListener(`keydown`,oe),window.addEventListener(`keydown`,se),()=>{window.removeEventListener(`keydown`,oe),window.removeEventListener(`keydown`,se)}));let ce=``;hr(()=>{if(B(y)!==`ready`)return;let e=n(),t=e.name+`:`+(e.id||``);t!==ce&&(ce=t,e.name===`run`&&e.id?tx(`run`,e.id):e.name===`chat`&&e.id?tx(`chat`,e.id):e.name===`task`||e.name===`tasks`||e.name===`files`?cx():(cx(),Fs(`/c/`+qs())))});var le=rU(),ue=I(le),de=e=>{U(e,QH())},fe=e=>{hC(e,{fresh:!0,onComplete:ne})},E=e=>{var t=nU();let r;var i=F(t);oT(i,{});var a=R(i,2),o=F(a);OP(o,{});var s=R(o,2),h=e=>{gN(e,{})},_=e=>{_P(e,{})},v=e=>{var t=$H();oN(I(t),{title:`Files`}),tt(2),U(e,t)},y=e=>{var t=eU();oN(I(t),{title:`Tasks`}),tt(2),U(e,t)},b=e=>{var t=tU();oN(I(t),{title:`AG2 Assistant`}),tt(2),U(e,t)};G(s,e=>{n().name===`chat`||n().name===`run`?e(h):n().name===`task`?e(_,1):n().name===`files`?e(v,2):n().name===`tasks`?e(y,3):e(b,-1)}),D(a);var S=R(a,2),te=e=>{CF(e,{})},ne=e=>{UH(e,{})};G(S,e=>{B(C)?e(te):B(x)&&e(ne,1)});var re=R(S,2),ie=e=>{IH(e,{})};G(re,e=>{l()&&e(ie)});var ae=R(re,2),oe=e=>{YH(e,{})};G(ae,e=>{u()&&e(oe)});var se=R(ae,2),ce=e=>{IP(e,{})};G(se,e=>{d()&&e(ce)});var le=R(se,2),ue=e=>{GP(e,{})};G(le,e=>{f()&&e(ue)});var de=R(le,2),fe=e=>{JP(e,{})};G(de,e=>{p()&&e(fe)});var E=R(de,2),pe=e=>{hC(e,{})};G(E,e=>{c()&&e(pe)}),D(t),z(e=>{r=q(t,1,`app`,null,r,{ag2:B(x),rail:B(w),railfull:B(ee)}),xa(t,`--drawer-w: ${e??``}px; --rail-w: ${B(T)??``}px`),J(t,`data-animations`,g())},[()=>lo(m())]),U(e,t)};G(ue,e=>{B(y)===`loading`?e(de):B(y)===`create`?e(fe,1):e(E,-1)}),ZH(R(ue,2),{}),U(e,le),k(),v()}var aU=document.getElementById(`app`);if(!aU)throw Error(`mount target #app is missing from the page shell`);Gi(iU,{target:aU});export{nA as n,CA as t}; \ No newline at end of file diff --git a/src/assistant/gateway/static/app/assets/index-CmMN9xyy.css b/src/assistant/gateway/static/app/assets/index-CmMN9xyy.css new file mode 100644 index 00000000..8e126285 --- /dev/null +++ b/src/assistant/gateway/static/app/assets/index-CmMN9xyy.css @@ -0,0 +1 @@ +@import "https://fonts.googleapis.com/css2?family=Geist:wght@400;500;600;700&family=Geist+Mono:wght@400;500;600&family=Inter:wght@400;500;600;700&display=swap";:root{--coral-50:#fff2ee;--coral-100:#ffe1d8;--coral-200:#ffc4b4;--coral-300:#fb9e84;--coral-400:#fb7758;--coral-500:#f95339;--coral-600:#e53c20;--coral-700:#bd2f18;--coral-800:#8f2614;--coral-900:#5e1b10;--sand-0:#fff;--sand-25:#fafbfc;--sand-50:#f5f7fa;--sand-100:#eef1f5;--sand-200:#dde2e8;--sand-300:#c8cfd8;--sand-400:#b5bdc7;--sand-500:#8a94a2;--sand-600:#5f6875;--sand-700:#454c56;--sand-800:#242a33;--sand-900:#161a20;--sand-950:#0b0d10;--ag2-indigo:#4f46e5;--ag2-indigo-bright:#6366f1;--ag2-cyan:#0891b2;--ag2-cyan-bright:#22d3ee;--ag2-model:#6366f1;--ag2-tool:#22d3ee;--ag2-memory:#a78bfa;--ag2-subagent:#38bdf8;--ag2-hitl:#fbbf24;--ag2-observer:#fb7185;--ag2-voice:#2dd4bf;--ag2-usage:#6f7885;--green-500:#10b981;--green-600:#059669;--amber-500:#f59e0b;--red-500:#e11d48;--red-600:#be123c;--blue-500:#0ea5e9;--bg:var(--sand-50);--surface:var(--sand-0);--surface-sunk:var(--sand-100);--surface-hover:var(--sand-100);--surface-elevated:var(--sand-0);--panel:var(--sand-100);--text:var(--sand-900);--text-muted:var(--sand-600);--text-faint:var(--sand-500);--text-on-coral:#fff;--text-on-dark:var(--sand-25);--line:var(--sand-200);--line-strong:var(--sand-300);--accent:var(--p-500);--accent-hover:color-mix(in srgb, #fff 9%, var(--accent));--accent-press:var(--p-600);--accent-soft:color-mix(in srgb, var(--accent) 12%, transparent);--accent-border:color-mix(in srgb, var(--accent) 22%, transparent);--accent-ring:color-mix(in srgb, var(--accent) 38%, transparent);--text-on-accent:#fff;--brand-coral:var(--coral-500);--user-bubble:color-mix(in srgb, var(--accent) 5%, var(--surface));--user-bubble-border:color-mix(in srgb, var(--accent) 22%, var(--line));--user-bubble-ink:var(--text);--agent-bubble:var(--surface);--agent-bubble-ink:var(--sand-900);--success:var(--green-500);--warning:var(--amber-500);--danger:var(--red-500);--info:var(--blue-500);--focus-ring:0 0 0 3px var(--accent-ring);--lightningcss-light:initial;--lightningcss-dark: ;color-scheme:light}[data-theme=dark]{--bg:#0b0d10;--panel:#0f1217;--surface:#13171d;--surface-elevated:#181d25;--surface-sunk:#1b212a;--surface-hover:#1b212a;--text:#f2f4f7;--text-muted:#a7afbb;--text-faint:#6f7885;--text-on-coral:#fff;--text-on-accent:#fff;--text-on-dark:#f2f4f7;--line:#242a33;--line-strong:#303844;--ag2-indigo:#6366f1;--ag2-cyan:#22d3ee;--green-500:#34d399;--green-600:#10b981;--amber-500:#fbbf24;--red-500:#fb7185;--red-600:#f43f5e;--blue-500:#38bdf8;--accent:var(--p-400);--accent-hover:color-mix(in srgb, #fff 10%, var(--accent));--accent-press:var(--p-300);--accent-soft:color-mix(in srgb, var(--accent) 16%, transparent);--accent-border:color-mix(in srgb, var(--accent) 25%, transparent);--accent-ring:color-mix(in srgb, var(--accent) 45%, transparent);--user-bubble:color-mix(in srgb, var(--accent) 8%, var(--surface));--user-bubble-border:color-mix(in srgb, var(--accent) 24%, var(--line-strong));--user-bubble-ink:var(--text);--agent-bubble:var(--surface);--agent-bubble-ink:var(--sand-25);--lightningcss-light: ;--lightningcss-dark:initial;color-scheme:dark}:root,[data-palette=navy-blue]{--p-50:#edf1fc;--p-100:#d6dff8;--p-200:#a9bcf0;--p-300:#7795e8;--p-400:#466edf;--p-500:#1d4ed8;--p-600:#1842b5;--p-700:#13338f;--p-800:#0f276c;--p-900:#0a1b49}[data-palette=royal-blue]{--p-50:#edf0f9;--p-100:#d7ddf1;--p-200:#aab6e1;--p-300:#788ccf;--p-400:#4762bd;--p-500:#1e40af;--p-600:#193693;--p-700:#142a73;--p-800:#0f2058;--p-900:#0a163b}[data-palette=dark-indigo]{--p-50:#f0effb;--p-100:#dddbf5;--p-200:#b8b3eb;--p-300:#8e88df;--p-400:#655cd4;--p-500:#4338ca;--p-600:#382faa;--p-700:#2c2585;--p-800:#221c65;--p-900:#171345}[data-palette=deep-purple]{--p-50:#f2edf9;--p-100:#e1d7f2;--p-200:#c1abe3;--p-300:#9d7ad3;--p-400:#7949c3;--p-500:#5b21b6;--p-600:#4c1c99;--p-700:#3c1678;--p-800:#2e115b;--p-900:#1f0b3e}[data-palette=forest-green]{--p-50:#ecf3ef;--p-100:#d5e3da;--p-200:#a6c4b2;--p-300:#73a385;--p-400:#408159;--p-500:#166534;--p-600:#12552c;--p-700:#0f4322;--p-800:#0b331a;--p-900:#072212}[data-palette=burgundy]{--p-50:#f7ecef;--p-100:#eed4db;--p-200:#dba5b4;--p-300:#c57188;--p-400:#b03d5d;--p-500:#9f1239;--p-600:#860f30;--p-700:#690c26;--p-800:#50091d;--p-900:#360613}:root{--ed-paper:#fff;--ed-paper-2:#eef1f5;--ed-ink:#161a20;--ed-ink-2:#5f6875;--ed-ink-3:#8a94a2;--ed-accent:#e11d48;--ed-accent-d:#be123c;--ed-up:#10b981;--ed-up-d:#059669;--ed-rule:#161a201a;--ed-rule-2:#161a2029;--ed-noise:.015;--ed-serif:"Geist", "Inter", system-ui, sans-serif;--ed-ui:"Geist", "Inter", system-ui, sans-serif;--ed-code:"Geist Mono", "JetBrains Mono", ui-monospace, monospace}[data-theme=dark]{--ed-paper:#13171d;--ed-paper-2:#0f1217;--ed-ink:#f2f4f7;--ed-ink-2:#a7afbb;--ed-ink-3:#6f7885;--ed-accent:#fb7185;--ed-accent-d:#fda4af;--ed-up:#34d399;--ed-up-d:#6ee7b7;--ed-rule:#f2f4f71a;--ed-rule-2:#f2f4f72e;--ed-noise:.02}:root{--font-display:"Geist", "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;--font-sans:"Geist", "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;--font-mono:"Geist Mono", "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;--fw-regular:400;--fw-medium:500;--fw-semibold:600;--fw-bold:700;--text-2xs:10px;--text-xs:11px;--text-sm:13px;--text-base:14px;--text-md:15px;--text-lg:17px;--text-xl:20px;--text-2xl:26px;--text-3xl:34px;--text-4xl:44px;--leading-tight:1.15;--leading-snug:1.3;--leading-normal:1.5;--leading-relaxed:1.6;--tracking-tight:-.02em;--tracking-normal:0;--tracking-wide:.04em;--tracking-eyebrow:.12em;--space-0:0;--space-1:2px;--space-2:4px;--space-3:6px;--space-4:8px;--space-5:12px;--space-6:16px;--space-7:20px;--space-8:24px;--space-9:32px;--space-10:40px;--space-11:48px;--space-12:64px;--radius-xs:6px;--radius-sm:8px;--radius-input:10px;--radius-md:12px;--radius-lg:14px;--radius-xl:16px;--radius-bubble:10px;--radius-pill:999px;--shadow-xs:0 1px 2px #0b0d100f;--shadow-sm:0 1px 3px #0b0d1014, 0 1px 2px #0b0d100d;--shadow-md:0 4px 12px #0b0d101a, 0 1px 3px #0b0d100f;--shadow-lg:0 12px 28px #0b0d1029, 0 2px 6px #0b0d1014;--shadow-xl:0 24px 60px #0b0d1047, 0 4px 12px #0b0d101f;--shadow-coral:0 6px 18px #f9533947;--shadow-accent:0 6px 18px color-mix(in srgb, var(--accent) 26%, transparent);--border-thin:1px;--border-medium:1.5px;--border-thick:2px;--ease-out:cubic-bezier(.22, 1, .36, 1);--ease-in-out:cubic-bezier(.65, 0, .35, 1);--ease-spring:cubic-bezier(.34, 1.56, .64, 1);--dur-fast:.15s;--dur-base:.2s;--dur-slow:.32s;--drawer-w:280px;--inspector-w:372px;--thread-max:780px;--z-modal:50;--z-backdrop:40}*{box-sizing:border-box}html,body{height:100%;margin:0}body{font-family:var(--font-sans);font-size:var(--text-base);line-height:var(--leading-normal);background:var(--bg);color:var(--text);-webkit-font-smoothing:antialiased;text-rendering:optimizelegibility}*{scrollbar-width:thin;scrollbar-color:var(--line-strong) transparent}::-webkit-scrollbar{width:8px;height:8px}::-webkit-scrollbar-track{background:0 0}::-webkit-scrollbar-thumb{background:var(--line-strong);border-radius:var(--radius-pill)}::-webkit-scrollbar-thumb:hover{background:var(--text-faint)}h1,h2,h3,h4{font-family:var(--font-display);font-weight:var(--fw-bold);line-height:var(--leading-tight);letter-spacing:var(--tracking-tight);margin:0}code,pre,kbd,samp{font-family:var(--font-mono)}a{color:var(--accent);text-decoration:none}a:hover{text-decoration:underline}::selection{background:var(--accent-soft);color:var(--accent-press)}@keyframes ag2-dot-pulse{0%,to{opacity:1;transform:scale(1)}50%{opacity:.4;transform:scale(.82)}}@keyframes ag2-blink{0%,80%,to{opacity:.25}40%{opacity:1}}@keyframes ag2-rise{0%{opacity:0;transform:translateY(8px)}to{opacity:1;transform:translateY(0)}}@keyframes ag2-pop{0%{opacity:0;transform:scale(.96)}to{opacity:1;transform:scale(1)}}@keyframes ag2-fade{0%{opacity:0}to{opacity:1}}@keyframes ag2-slide-left{0%{opacity:0;transform:translate(16px)}to{opacity:1;transform:translate(0)}}@keyframes ag2-glow{0%,to{box-shadow:0 0 0 0 color-mix(in srgb, var(--accent) 0%, transparent)}50%{box-shadow:0 0 0 6px color-mix(in srgb, var(--accent) 14%, transparent)}}@keyframes ag2-shimmer{0%{background-position:-180% 0}to{background-position:180% 0}}.ag2-rise{animation:ag2-rise var(--dur-slow) var(--ease-out) both}.ag2-pop{animation:ag2-pop var(--dur-base) var(--ease-spring) both}.ag2-fade{animation:ag2-fade var(--dur-base) var(--ease-out) both}.ag2-slide-left{animation:ag2-slide-left var(--dur-slow) var(--ease-out) both}.ag2-glow{animation:ag2-glow 2.8s var(--ease-in-out) infinite}.ag2-rise{animation-delay:calc(var(--i,0) * 55ms)}.ag2-lift{transition:transform var(--dur-base) var(--ease-out), box-shadow var(--dur-base) var(--ease-out)}.ag2-lift:hover{box-shadow:var(--shadow-md);transform:translateY(-2px)}@media (prefers-reduced-motion:reduce){*,:before,:after{transition-duration:.001ms!important;animation-duration:.001ms!important;animation-iteration-count:1!important}}:root{--ink:var(--text);--muted:var(--text-muted);--code:var(--surface-sunk);--sans:var(--font-sans);--mono:var(--font-mono);--user-bg:var(--user-bubble);--user-ink:var(--user-bubble-ink);--select-chevron:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%23998f83' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E")}.chpick,.settings .keyrow select,.settings .llmfield select,.pfield select{appearance:none;background-image:var(--select-chevron);background-position:right 10px center;background-repeat:no-repeat;background-size:14px}#app{height:100vh}.app{grid-template-columns:var(--drawer-w,270px) 1fr;grid-template-rows:minmax(0,1fr);height:100vh;display:grid}.drawer{border-right:1px solid var(--line);background:var(--panel);flex-direction:column;display:flex;position:relative;overflow:hidden}.main{flex-direction:column;min-width:0;display:flex;position:relative}.dhead{align-items:center;gap:9px;padding:14px 16px;display:flex}.brandlogo{flex:none;width:auto;height:20px;display:block}.brandlogo.on-dark,[data-theme=dark] .brandlogo.on-light{display:none}[data-theme=dark] .brandlogo.on-dark{display:block}.onb-brand .brandlogo{height:38px}.brand{font-family:var(--font-display);font-weight:var(--fw-bold);font-size:var(--text-xl);letter-spacing:-.01em}.segbar{background:var(--code);border-radius:var(--radius-pill);gap:3px;margin:8px 12px 0;padding:3px;display:flex}.seg{font:inherit;font-size:13px;font-weight:var(--fw-medium);color:var(--muted);border-radius:var(--radius-pill);cursor:pointer;transition:color var(--dur-fast) var(--ease-out), background var(--dur-fast) var(--ease-out);background:0 0;border:none;flex:1;justify-content:center;align-items:center;gap:6px;padding:6px 10px;display:inline-flex}.seg:hover{color:var(--text)}.seg.on{color:var(--accent);background:var(--surface);box-shadow:var(--shadow-sm)}.newrow{text-align:left;width:100%;font:inherit;font-size:13px;font-weight:var(--fw-medium);color:var(--muted);border-radius:var(--radius-sm);cursor:pointer;transition:color var(--dur-fast) var(--ease-out), background var(--dur-fast) var(--ease-out);background:0 0;border:none;align-items:center;gap:8px;margin-bottom:4px;padding:8px 11px;display:flex}.newrow:hover{color:var(--accent);background:var(--code)}.dfoot{border-top:1px solid var(--line);padding:8px 12px}.settingsbtn{text-align:left;border:1px solid var(--line);background:var(--surface);width:100%;color:var(--ink);border-radius:var(--radius-sm);cursor:pointer;transition:border-color var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out);align-items:center;gap:7px;padding:8px 11px;font-size:13px;display:inline-flex}.settingsbtn:hover{border-color:color-mix(in srgb, var(--accent) 45%, var(--line));color:var(--accent)}.settings .setrowwrap{align-items:center;gap:8px;display:flex}.settings .setrowwrap .setrow{flex:1;min-width:0}.settings .setrow,.settings .skcard,.settings .llmrow,.settings .mcprow,.settings .cnrow,.settings .mcpcatcard{border:1px solid var(--line);border-radius:var(--radius-md);transition:border-color var(--dur-fast) var(--ease-out);background:0 0}.settings .llmrow.clickable:hover,.settings .cnrow:hover,.settings .mcpcatcard:hover:not(:disabled){border-color:color-mix(in srgb, var(--accent) 45%, var(--line))}.settings .skcard:has(.sktop.clickable:hover){border-color:color-mix(in srgb, var(--accent) 45%, var(--line))}.settings .skcard:has(.sktop:focus-visible){box-shadow:var(--focus-ring)}.settings .sktop:focus-visible{outline:none}.settings .setrow{text-align:left;width:100%;color:var(--ink);align-items:baseline;gap:10px;padding:11px 13px;display:flex}.settings .setrow .sk{flex:none;align-items:center;gap:7px;font-weight:600;display:inline-flex}.settings .setrow .sv{color:var(--muted);text-overflow:ellipsis;white-space:nowrap;flex:1;font-size:13px;overflow:hidden}.settings .sklist{flex-direction:column;gap:8px;display:flex}.settings .skcard{padding:12px 14px}.settings .skcard.off .skmain,.settings .skcard.off .skmeta{opacity:.5}.settings .skcard.off .skmeta:has(.skconfirm){opacity:1}.settings .sktop{align-items:center;gap:14px;display:flex}.settings .sktop.clickable{cursor:pointer}.settings .skctl .setswitch{cursor:inherit}.settings .skctl .setswitch.busy{opacity:.5}.settings .skmain{flex:1;min-width:0}.settings .skname{font-size:14px;font-weight:var(--fw-semibold);color:var(--ink)}.settings .skdesc{color:var(--text-muted);margin:4px 0 0;font-size:12.5px;line-height:1.5}.settings .skctl{flex:none;align-items:center;gap:8px;display:flex}.settings .skmeta{color:var(--text-muted);border-top:1px solid var(--line);align-items:center;gap:7px;margin-top:10px;padding-top:8px;font-size:11px;display:flex}.settings .skdot{background:var(--muted);border-radius:50%;flex:none;width:6px;height:6px}.settings .skdot.third{background:var(--accent)}.settings .skmetabtn{margin-left:auto}.settings .skconfirm{color:var(--danger)}.settings .skzone{position:relative}.settings .skadd:not(:has(.ski)){position:absolute;top:-6px;right:0}.settings .skzone .setgroup{padding-bottom:12px}.settings .skadd .addbtn{margin-top:0}.settings .skadd .ski{border-radius:12px;margin:0 0 8px}.modal.settings{width:min(860px,94vw);height:min(86vh,780px)}.settings .setbody{flex-direction:row;flex:1;gap:16px;min-height:0;display:flex}.settings .setnav{border-right:1px solid var(--line);flex-direction:column;flex:none;gap:2px;width:170px;padding-right:16px;display:flex;overflow-y:auto}.settings .setnavbtn{text-align:left;width:100%;color:var(--ink);font:inherit;border-radius:var(--radius-sm);cursor:pointer;transition:background var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out);background:0 0;border:none;padding:8px 11px;font-size:13px;display:block}.settings .setnavbtn:hover{background:var(--surface-hover)}.settings .setnavbtn.on{background:var(--accent-soft);color:var(--accent);font-weight:var(--fw-semibold)}.settings .setscroll{scrollbar-gutter:stable;flex-direction:column;flex:1;gap:8px;min-width:0;padding-right:10px;display:flex;overflow-y:auto}@media (width<=720px){.settings .setbody{flex-direction:column;gap:12px}.settings .setnav{border-right:none;border-bottom:1px solid var(--line);flex-direction:row;width:auto;padding-bottom:8px;padding-right:0;overflow:auto hidden}.settings .setnavbtn{white-space:nowrap;flex:none;width:auto}}.settings .setgroup{font-size:13px;font-weight:var(--fw-semibold);letter-spacing:.2px;color:var(--ink);border-bottom:1px solid var(--line);margin:14px 0 4px;padding-bottom:5px}.settings .setgroup:first-child{margin-top:0}.settings .setsub{font-size:var(--text-sm);color:var(--text-muted);margin:0 0 12px}.settings .addbtn{cursor:pointer;font:inherit;font-size:var(--text-sm);font-weight:var(--fw-semibold);color:var(--text-muted);background:0 0;border:none;align-self:flex-start;align-items:center;gap:6px;margin-top:6px;padding:8px 4px;display:inline-flex}.settings .addbtn:hover:not(:disabled){color:var(--text)}.settings .addbtn:disabled{opacity:.5;cursor:default}.settings .addbtn:focus-visible{box-shadow:var(--focus-ring);border-radius:var(--radius-sm);outline:none}.settings .setsec{text-transform:uppercase;letter-spacing:1px;color:var(--muted);margin:8px 0 2px;font-size:11px}.settings .setwide{vertical-align:1px;letter-spacing:.5px;text-transform:none;color:var(--muted);background:var(--surface-sunk,#0000000d);border:1px solid var(--line);border-radius:999px;margin-left:6px;padding:1px 7px;font-size:10px;font-weight:600;display:inline-block}.settings .keyrow{align-items:center;gap:8px;display:flex}.settings .keyrow .kp{flex:none;width:78px;font-size:13px}.settings .keyrow input,.settings .keyrow select{border:1px solid var(--line);min-width:0;font:inherit;background-color:var(--bg);color:var(--ink);border-radius:8px;flex:1;padding:7px 9px;font-size:13px}.settings .keyrow select{padding-right:30px}.settings .focuspills{flex-wrap:wrap;gap:7px;display:flex}.settings .focuspill{cursor:pointer;border:1.5px solid var(--line);background:var(--surface);color:var(--ink);font:inherit;transition:border-color var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out), background var(--dur-fast) var(--ease-out);border-radius:999px;align-items:center;gap:6px;padding:6px 12px;font-size:13px;font-weight:600;display:inline-flex}.settings .focuspill:hover{border-color:color-mix(in srgb, var(--accent) 45%, var(--line))}.settings .focuspill.on{border-color:var(--accent);background:var(--accent-soft);color:var(--accent)}.settings .focuspill:disabled{opacity:.6;cursor:default}.modal .open,.panel .open,.taskpage .open,.tf .open,.draft-save .open{font-family:var(--sans);font-size:13px;font-weight:var(--fw-medium);cursor:pointer;border:1px solid var(--line);background:var(--surface);color:var(--ink);border-radius:var(--radius-sm);transition:border-color var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out), background var(--dur-fast) var(--ease-out);flex:none;justify-content:center;align-items:center;gap:6px;padding:7px 14px;display:inline-flex}.modal .open:hover,.panel .open:hover,.taskpage .open:hover,.tf .open:hover,.draft-save .open:hover{border-color:color-mix(in srgb, var(--ink) 22%, var(--line));background:var(--code)}.modal .open:active,.panel .open:active,.taskpage .open:active,.tf .open:active,.draft-save .open:active{background:var(--code)}.modal .open:disabled,.panel .open:disabled,.taskpage .open:disabled,.tf .open:disabled,.draft-save .open:disabled{opacity:.5;cursor:default;border-color:var(--line);color:var(--muted);background:var(--surface)}.modal .open.primary,.panel .open.primary,.taskpage .open.primary,.tf .open.primary,.draft-save .open.primary{border-color:var(--accent);color:var(--accent)}.modal .open.primary:hover:not(:disabled),.panel .open.primary:hover:not(:disabled),.taskpage .open.primary:hover:not(:disabled),.tf .open.primary:hover:not(:disabled),.draft-save .open.primary:hover:not(:disabled){background:var(--accent-soft)}.modal .open.danger,.panel .open.danger,.taskpage .open.danger,.tf .open.danger,.draft-save .open.danger{border-color:color-mix(in srgb, var(--danger) 55%, var(--line));color:var(--danger);background:0 0}.modal .open.danger:hover,.panel .open.danger:hover,.taskpage .open.danger:hover,.tf .open.danger:hover,.draft-save .open.danger:hover{border-color:var(--danger);color:#fff;background:var(--danger)}.iconbtn{border:1px solid var(--line);background:var(--surface);width:30px;height:30px;color:var(--muted);border-radius:var(--radius-sm);cursor:pointer;transition:border-color var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out), background var(--dur-fast) var(--ease-out);flex:none;justify-content:center;align-items:center;padding:0;display:inline-flex}.iconbtn:hover{color:var(--ink);background:var(--code)}.iconbtn:disabled{opacity:.5;cursor:default}.brandmark{vertical-align:middle;flex:none;display:inline-block}.settings .setswitch{border:1px solid var(--line);background:var(--surface-sunk,var(--code));cursor:pointer;width:34px;height:20px;transition:background var(--dur-fast) var(--ease-out), border-color var(--dur-fast) var(--ease-out);border-radius:999px;flex:none;padding:0;position:relative}.settings .setswitch:after{content:"";background:var(--muted);width:16px;height:16px;transition:transform var(--dur-fast) var(--ease-out), background var(--dur-fast) var(--ease-out);border-radius:50%;position:absolute;top:1px;left:1px}.settings .setswitch.on{background:var(--accent);border-color:var(--accent)}.settings .setswitch.on:after{background:#fff;transform:translate(14px)}.settings .setswitch:disabled{opacity:.5;cursor:default}.settings .setswitch:focus-visible{box-shadow:var(--focus-ring);outline:none}.panel .delconfirm{flex-wrap:wrap;align-items:center;gap:8px;display:inline-flex}.panel .delconfirm .confirm{color:var(--danger);font-size:13px}.modal.memory{width:min(720px,92vw);height:min(88vh,940px)}.memory .msection{flex-direction:column;flex:1;gap:6px;min-height:0;display:flex}.memory .msection h3{font-size:13px;font-weight:var(--fw-medium);color:var(--ink);margin:0}.memory .msection .small{margin:0;font-size:12px}.memory textarea{border:1px solid var(--line);min-height:0;font:inherit;background:var(--bg);color:var(--ink);resize:none;border-radius:10px;flex:1;padding:12px 14px;font-size:13px;line-height:1.5}.memory .mfoot{justify-content:flex-end;align-items:center;gap:10px;display:flex}.memory .okmsg{color:var(--success);font-size:13px}.settings .linkbtn{color:var(--muted);cursor:pointer;background:0 0;border:none;flex:none;font-size:12px}.settings .linkbtn:hover{color:var(--text)}.settings .linkbtn.danger:hover,.settings .linkbtn.quiet:hover{color:var(--danger)}.settings .linkbtn:disabled{opacity:.4;cursor:default}.settings .linkbtn:disabled:hover{color:var(--muted)}.settings .linkbtn.advset,.settings .linkbtn.advset:hover{color:var(--accent)}.settings .setcheck{cursor:pointer;align-items:center;gap:9px;padding:2px 0;font-size:14px;display:flex}.settings .setcheck input{width:16px;height:16px;accent-color:var(--accent);cursor:pointer}.settings .mcprow{align-items:center;gap:8px;padding:9px 10px;display:flex}.settings .mcpmeta{min-width:0;color:var(--muted);flex-direction:column;flex:1;gap:2px;font-size:12px;display:flex}.settings .mcpmeta strong{color:var(--ink);font-size:13px}.settings .mcpmeta span{overflow-wrap:anywhere}.settings .mcpbad{color:var(--danger)}.settings .mcpform{grid-template-columns:1fr 1fr;gap:8px;display:grid}.settings .mcpform input,.settings .mcpform textarea{border:1px solid var(--line);min-width:0;font:inherit;background:var(--bg);color:var(--ink);border-radius:8px;padding:7px 9px;font-size:13px}.settings .mcpform textarea{min-height:74px;font-family:var(--mono);resize:none;grid-column:1/-1;font-size:12px}.settings .mcpform button{justify-self:start}.settings .mcpcat{grid-template-columns:1fr 1fr;gap:8px;display:grid}.settings .mcpcatcard{text-align:left;cursor:pointer;color:var(--ink);font:inherit;border-width:1.5px;flex-direction:column;align-items:flex-start;gap:3px;padding:8px 11px;display:flex}.settings .mcpcatcard.openinputs{border-color:var(--accent)}.settings .mcpcatcard.added{opacity:.55;cursor:default}.settings .mcpcatcard.added .mcpcathead{color:var(--accent)}.settings .mcpcathead{flex-wrap:wrap;align-items:center;gap:6px;font-size:13px;font-weight:600;display:inline-flex}.settings .mcpcatblurb{color:var(--muted);font-size:11.5px}.settings .mcpcatblurb.warn{color:var(--danger)}.settings .mcpcatchip{font-size:10px;font-weight:var(--fw-medium);letter-spacing:.3px;color:var(--muted);border:1px solid var(--line);white-space:nowrap;border-radius:999px;padding:1px 6px}.settings .mcpcat+.setsec{margin-top:14px}.settings .mcpinputs{border:1px solid var(--line);border-radius:var(--radius-md);flex-direction:column;gap:8px;padding:9px 10px;display:flex}.settings .mcpinputs .kp{width:auto;min-width:78px}.settings .mcppaste{border:1px solid var(--line);min-width:0;font-family:var(--mono);resize:none;background:var(--bg);min-height:58px;max-height:240px;color:var(--ink);border-radius:8px;flex:none;padding:7px 9px;font-size:12px;overflow-y:auto}.settings .mcpdraft{border:1px solid var(--accent);border-radius:var(--radius-md);flex-direction:column;gap:8px;padding:9px 10px;display:flex}.settings .mcpdraft .kp{width:auto;min-width:60px}.settings .mcpdraft .mcpenvkey{text-overflow:ellipsis;white-space:nowrap;max-width:40%;font-family:var(--mono);font-size:11.5px;overflow:hidden}.settings .mcpcmd{text-overflow:ellipsis;white-space:nowrap;min-width:0;font-family:var(--mono);color:var(--muted);flex:1;font-size:11.5px;overflow:hidden}.settings .llmenv{color:var(--ink);background:var(--accent-soft);border:1px solid var(--accent);border-radius:10px;padding:8px 11px;font-size:12.5px}.settings .llmrow{align-items:center;gap:10px;padding:9px 10px;display:flex}.settings .llmrow.active{background:color-mix(in srgb, var(--accent) 10%, transparent)}.settings .llmrow.clickable{cursor:pointer}.settings .llmrow.clickable:focus-visible{box-shadow:var(--focus-ring);outline:none}.settings .llmmeta{flex-direction:column;flex:1;gap:2px;min-width:0;display:flex}.settings .llmname{color:var(--ink);align-items:center;gap:8px;font-size:13px;font-weight:600;display:flex}.settings .llmbadge{text-transform:uppercase;letter-spacing:.5px;color:var(--accent);background:var(--accent-soft);border-radius:999px;padding:1px 7px;font-size:10px;font-weight:600}.settings .llmsub{color:var(--muted);overflow-wrap:anywhere;flex-wrap:wrap;align-items:center;gap:8px;font-size:12px;display:flex}.settings .llmkey{font-family:var(--mono);color:var(--muted);background:var(--surface-sunk);border:1px solid var(--line);border-radius:999px;padding:0 7px;font-size:11px}.settings .llmkey.warn{color:var(--danger);border-color:color-mix(in srgb, var(--danger) 45%, var(--line))}.settings .llmtest{color:var(--muted);font-size:12px}.settings .llmtest.ok{color:var(--success)}.settings .llmtest.bad{color:var(--danger)}.settings .llmform{border:1px solid var(--line);background:var(--surface-sunk);border-radius:10px;flex-direction:column;gap:12px;padding:12px;display:flex}.settings .llmfield{flex-direction:column;gap:5px;display:flex}.settings .llmfield>label,.settings .llmfield>.llmlabel{color:var(--muted);font-size:12px;font-weight:600}.settings .llmfield input,.settings .llmfield select{border:1px solid var(--line);min-width:0;font:inherit;background-color:var(--bg);color:var(--ink);border-radius:8px;padding:7px 9px;font-size:13px}.settings .llmfield select{padding-right:30px}.settings .llmfield input:focus,.settings .llmfield select:focus{border-color:var(--accent);box-shadow:var(--focus-ring);outline:none}.settings .llmhint{color:var(--muted);font-size:11px;font-weight:400}.settings .llmkeyfield{align-items:center;gap:6px;display:flex}.settings .llmkeyfield input{flex:1}.settings .llmtool{cursor:pointer;align-items:flex-start;gap:8px;display:flex}.settings .llmtool input[type=checkbox]{width:auto;min-width:0;accent-color:var(--accent);flex:none;margin-top:2px}.settings .llmtoolbody{flex-direction:column;gap:2px;display:flex}.settings .llmtoolname{color:var(--ink);font-size:13px}.settings .llmtoolopts{flex-direction:column;gap:5px;margin-left:22px;display:flex}.settings .llmtoolopts>label{color:var(--muted);font-size:12px;font-weight:600}.settings .advtoggle{color:var(--accent);align-self:flex-start}.settings .advtoggle:hover{color:var(--accent)}.settings .llmadv{border:1px solid var(--line);font-family:var(--mono);resize:vertical;background:var(--bg);min-height:82px;color:var(--ink);border-radius:8px;padding:8px 10px;font-size:12px}.settings .cnrow{text-align:left;width:100%;color:var(--ink);font:inherit;cursor:pointer;align-items:center;gap:10px;margin-bottom:6px;padding:9px 10px;display:flex}.settings .cnrow:focus-visible{box-shadow:var(--focus-ring);outline:none}.settings .cnmark{background:color-mix(in srgb, var(--tint) 22%, transparent);width:20px;height:20px;color:var(--tint);border-radius:6px;flex:none;place-items:center;font-size:11px;font-weight:700;display:inline-grid}.settings .cnmark.sm{border-radius:5px;width:16px;height:16px;font-size:9px}.settings .cnmeta{flex-direction:column;flex:1;gap:2px;min-width:0;display:flex}.settings .cnname{color:var(--ink);align-items:center;gap:7px;font-size:13px;font-weight:600;display:flex}.settings .cntag{text-transform:uppercase;letter-spacing:.5px;color:var(--muted);border:1px solid var(--line);border-radius:999px;padding:0 6px;font-size:10px;font-weight:500}.settings .cnstat{color:var(--text-muted);align-items:center;gap:5px;font-size:12px;display:flex}.settings .cnstat.ok{color:var(--success)}.settings .cnstat.err{color:var(--warning)}.settings .cnback{cursor:pointer;font:inherit;font-size:var(--text-xs);font-weight:var(--fw-semibold);color:var(--text-muted);background:0 0;border:none;align-self:flex-start;align-items:center;gap:3px;margin:0 0 8px -4px;padding:4px;display:inline-flex}.settings .cnback:hover{color:var(--accent)}.settings .cnback:focus-visible{box-shadow:var(--focus-ring);border-radius:var(--radius-sm);outline:none}.settings .cnhead{border-bottom:1px solid var(--line);align-items:center;gap:10px;padding-bottom:10px;display:flex}.settings .cnheadmeta{flex-direction:column;flex:1;gap:3px;min-width:0;display:flex}.settings .cnheadname{color:var(--ink);align-items:center;gap:8px;font-size:15px;font-weight:600;display:flex}.settings .cnrename{border:1px solid var(--accent);background:var(--bg);color:var(--ink);font:inherit;border-radius:8px;padding:5px 9px;font-size:15px;font-weight:600}.settings .cnrename:focus{box-shadow:var(--focus-ring);outline:none}.settings .cnheadact{align-items:center;gap:8px;display:flex}.settings .cnform{flex-direction:column;gap:8px;padding-top:12px;display:flex}.settings .cnhint{color:var(--text-muted);margin:0;font-size:12px;line-height:1.45}.settings .cncatsetup{color:var(--text-muted);font-size:11px;line-height:1.4}.settings .cnwarn{color:var(--warning);font-size:12px;line-height:1.45}.settings .cnerr{color:var(--danger);margin:0 0 6px;font-size:12px}.settings .cnnote{color:var(--success);margin:0 0 6px;font-size:12px}.settings .iconbtn.sm{width:22px;height:22px}.settings .cnexp{border-collapse:collapse;width:100%;margin-bottom:6px}.settings .cnexp th{text-transform:uppercase;letter-spacing:.5px;color:var(--muted);text-align:left;padding:0 0 5px;font-size:10px;font-weight:500}.settings .cnexp td{color:var(--ink);padding:4px 0;font-size:13px}.settings .cnexpdef{width:62px}.settings .cnexpcol{width:132px}.settings .cnexpname{align-items:center;gap:8px;display:flex}.settings .cnexpname .dim{color:var(--muted)}.settings .cnexpdot{background:var(--dot);border-radius:999px;flex:none;width:8px;height:8px}.settings .cnradio{border:1.5px solid var(--line);background:var(--bg);cursor:pointer;border-radius:999px;flex:none;width:15px;height:15px;padding:0;position:relative}.settings .cnradio:hover:not(:disabled),.settings .cnradio.on{border-color:var(--accent)}.settings .cnradio.on:after{content:"";background:var(--accent);border-radius:999px;position:absolute;inset:2.5px}.settings .cnradio:disabled{opacity:.4;cursor:default}.settings .cnradio:focus-visible{box-shadow:var(--focus-ring);outline:none}.settings .cnsechead{justify-content:space-between;align-items:center;gap:8px;display:flex}.settings .cnlist{flex-direction:column;gap:5px;margin:0 0 4px;padding:0;list-style:none;display:flex}.settings .cnitem{align-items:center;gap:8px;min-height:30px;display:flex}.settings .cnid{font-family:var(--mono);color:var(--ink);font-size:12px}.settings .cnpush{margin-left:auto}.settings .cncode{font-family:var(--mono);color:var(--ink);letter-spacing:.04em;font-size:13px}.settings .cngrouppick{border:1px solid var(--line);border-radius:var(--radius-sm);background:var(--bg);color:var(--ink);font:inherit;cursor:pointer;flex:none;margin-left:auto;padding:5px 26px 5px 9px;font-size:12px}.settings .cngrouppick:focus{border-color:var(--accent);box-shadow:var(--focus-ring);outline:none}.settings .cngrouppick:disabled{opacity:.6;cursor:default}.dlist{flex:1;padding:6px;overflow-y:auto}.drow{cursor:pointer;margin:0 -6px;padding:9px 17px;font-size:14px}.drow:hover{background:var(--code)}.drow.on{background:var(--accent-soft);box-shadow:inset 2px 0 0 var(--accent)}.drow.on .ttitle,.drow.on .runwhen{color:var(--text);font-weight:600}.drow .sub{color:var(--muted);gap:6px;margin-top:2px;font-size:11px;display:flex}.tag{border-radius:var(--radius-pill);border:1px solid var(--line);align-items:center;gap:4px;padding:1px 7px;font-size:10px;display:inline-flex}.tag.sched{color:color-mix(in srgb, var(--success) 78%, var(--text));text-overflow:ellipsis;white-space:nowrap;border:none;min-width:0;padding:0;font-size:11px;overflow:hidden}.drow.trow{align-items:center;gap:8px;display:flex}.drow .statusicon{width:16px;color:var(--muted);flex:none;justify-content:center;align-items:center;display:inline-flex}.drow .statusicon.completed{color:var(--success)}.drow .statusicon.failed{color:var(--danger)}.drow .statusicon.running{color:var(--info)}.drow .statusicon.scheduled{color:var(--success)}.drow .ttitle{text-overflow:ellipsis;white-space:nowrap;flex:1;min-width:0;overflow:hidden}.drow .nextin{color:var(--success);white-space:nowrap;flex:none;font-size:11px}.drow.ttask{flex-direction:column;gap:3px;display:flex}.ttask .tline1{align-items:flex-start;gap:8px;display:flex}.ttask .ttitle{white-space:normal;text-overflow:clip;flex:1;min-width:0;line-height:1.3;overflow:visible}.ttask .tmeta{align-items:center;gap:8px;padding-left:24px;display:flex}.drow .runwhen{text-overflow:ellipsis;white-space:nowrap;min-width:0;color:var(--muted);flex:1;font-size:13px;overflow:hidden}.drow.child{border-left:2px solid var(--line);margin-left:14px;padding-left:11px}.drow .unreadcount{background:var(--accent);min-width:17px;height:17px;color:var(--text-on-accent);text-align:center;border-radius:999px;flex:none;padding:0 4px;font-size:11px;line-height:17px}.drow.unseen{background:color-mix(in srgb, var(--accent) 12%, transparent)}.drow.unseen .runwhen,.drow.unseen .ttitle{color:var(--ink);font-weight:600}.drow .dot{background:var(--accent);border-radius:50%;flex:none;width:7px;height:7px}.none{color:var(--muted);padding:16px;font-size:13px}.thread{flex:1;padding:28px 0 176px;overflow-y:auto}.inner{max-width:var(--thread-max);margin:0 auto;padding:0 20px}.daysep{justify-content:center;align-items:center;margin:20px 0 14px;display:flex}.daysep span{letter-spacing:.3px;color:var(--muted);background:var(--surface);border:1px solid var(--line);border-radius:var(--radius-pill);padding:3px 12px;font-size:11px;font-weight:600}.empty{text-align:center;color:var(--muted);margin-top:18vh}.empty h1{color:var(--ink);font-weight:600}.msg{margin:18px 0;display:flex}.msg.user{justify-content:flex-end}.bubble{border-radius:var(--radius-bubble);overflow-wrap:anywhere;max-width:80%;padding:12px 16px;font-size:15px;line-height:1.6}.msg.user .bubble{background:var(--user-bg);color:var(--user-ink);border:1px solid var(--user-bubble-border);box-shadow:inset 2px 0 0 var(--accent);white-space:pre-wrap;max-width:72%}.msg.user.queued{flex-direction:column;align-items:flex-end;gap:4px}.msg.user.queued .bubble{opacity:.6}.msg.user.queued .hint{color:var(--muted);font-size:12px}.msg.agent .bubble{background:0 0;border:none;max-width:100%;padding:0}.msg.agent .bubble.empty{color:var(--muted)}.bubble :first-child{margin-top:0}.bubble :last-child{margin-bottom:0}.bubble a{color:var(--accent)}.bubble pre{background:var(--code);font-family:var(--mono);border-radius:8px;padding:10px;font-size:13px;overflow-x:auto}.bubble code{font-family:var(--mono);font-size:.9em}.bubble img,.asset img,.viewer .vbody img{border:1px solid var(--line);border-radius:10px;max-width:100%;height:auto;margin:8px 0;display:block}a.tasklink{color:var(--accent);border-bottom:1px dashed var(--accent);cursor:pointer;font-weight:600}.note{text-align:center;color:var(--muted);margin:10px 0;font-size:13px}.note.withicon{justify-content:center;align-items:center;gap:6px;display:flex}.note.alert{color:var(--ag2-observer)}.note.pending svg{animation:.9s linear infinite note-spin}@keyframes note-spin{to{transform:rotate(360deg)}}.a2ui{border:1px solid color-mix(in srgb, var(--accent) 26%, var(--line));background:linear-gradient(180deg, color-mix(in srgb, var(--panel) 94%, var(--accent) 6%), var(--panel));border-radius:8px;max-width:min(80%,620px);margin:8px 0 12px;padding:14px;box-shadow:0 10px 28px #0000000e}.a2ui-head{align-items:center;gap:9px;min-width:0;margin-bottom:12px;display:flex}.a2ui-mark{border-radius:var(--radius-sm);width:30px;height:30px;color:var(--accent);background:color-mix(in srgb, var(--accent) 12%, var(--surface));border:1px solid color-mix(in srgb, var(--accent) 20%, var(--line));justify-content:center;align-items:center;display:inline-flex}.a2ui-headtext{flex-direction:column;gap:1px;min-width:0;display:flex}.a2ui-eyebrow{text-transform:uppercase;letter-spacing:.04em;color:var(--muted);font-size:10.5px;line-height:1.1}.a2ui-title{font-size:14px;line-height:1.2;font-weight:var(--fw-semibold);color:var(--ink);text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.a2ui-catalog{border:1px solid var(--line);background:var(--surface);border-radius:var(--radius-pill);color:var(--muted);flex:none;margin-left:auto;padding:2px 8px;font-size:10.5px}.a2ui-composing .a2ui-head{margin-bottom:14px}.a2ui-composing .a2ui-mark{animation:ag2-glow 2.8s var(--ease-in-out) infinite}.a2ui-composing .a2ui-title{color:var(--muted);font-weight:var(--fw-medium)}.a2ui-action-pending{color:var(--muted);justify-content:center;padding:10px 0 2px;display:flex}.a2ui-action-pending svg{animation:.9s linear infinite note-spin}.a2ui-skeleton{flex-direction:column;gap:9px;display:flex}.a2ui-skeleton span{border-radius:var(--radius-pill);background:linear-gradient(90deg, color-mix(in srgb, var(--accent) 8%, var(--code)) 0%, color-mix(in srgb, var(--accent) 22%, var(--code)) 50%, color-mix(in srgb, var(--accent) 8%, var(--code)) 100%);height:10px;animation:ag2-shimmer 1.6s var(--ease-in-out) infinite;background-size:220% 100%}.a2ui-main{font-size:14.5px;font-weight:var(--fw-semibold);color:var(--ink);overflow-wrap:anywhere;line-height:1.35}.a2ui-basic-col{flex-direction:column;gap:10px;min-width:0;display:flex}.a2ui-basic-row{flex-wrap:wrap;gap:10px;min-width:0;display:flex}.a2ui-basic-card{border:1px solid var(--line);background:color-mix(in srgb, var(--surface) 70%, var(--code) 30%);border-radius:7px;min-width:0;padding:10px}.a2ui-text{color:var(--a2ui-ink,var(--ink));overflow-wrap:anywhere;min-width:0;font-size:12.5px;line-height:1.4}.a2ui-icon{color:var(--a2ui-muted,var(--muted));display:inline-flex}.a2ui-divider{background:var(--a2ui-rule,var(--line));align-self:stretch;height:1px;margin:2px 0}.a2ui-divider.strong{background:var(--a2ui-rule-strong,var(--ink));height:2px}:root{--a2ui-positive:var(--ed-up-d);--a2ui-negative:var(--ed-accent-d)}.a2ui-tone-neutral{color:var(--a2ui-ink,var(--ink))}.a2ui-tone-muted{color:var(--a2ui-muted,var(--muted))}.a2ui-tone-accent{color:var(--a2ui-accent,var(--accent))}.a2ui-tone-positive{color:var(--a2ui-positive)}.a2ui-tone-negative{color:var(--a2ui-negative)}.a2ui-feature{--a2ui-ink:var(--ed-ink);--a2ui-muted:var(--ed-ink-3);--a2ui-accent:var(--ed-accent-d);--a2ui-rule:var(--ed-rule);--a2ui-rule-strong:var(--ed-ink);--a2ui-paper:var(--ed-paper);background:var(--ed-paper);color:var(--ed-ink);border:1px solid var(--ed-rule-2);border-radius:var(--radius-md);margin:8px 0 12px;padding:16px 20px 18px}.a2ui-t-h1{font-size:clamp(20px,4vw,27px);font-weight:var(--fw-bold);letter-spacing:var(--tracking-tight);line-height:1.05}.a2ui-t-h2{font-size:21px;font-weight:var(--fw-semibold);letter-spacing:-.015em;line-height:1.1}.a2ui-t-h3{font-size:16px;font-weight:var(--fw-semibold);line-height:1.25}.a2ui-t-h4{font-size:14.5px;font-weight:var(--fw-semibold);line-height:1.3}.a2ui-t-body{font-size:12.5px}.a2ui-t-caption{font-size:11.5px;line-height:1.35}.a2ui-t-eyebrow{font-family:var(--font-mono);font-size:9.5px;font-weight:var(--fw-bold);letter-spacing:.2em;text-transform:uppercase}.a2ui-t-quote{border-left:2px solid var(--a2ui-accent,var(--accent));padding-left:12px;font-size:12.5px;line-height:1.5}.a2ui-t-pill{border:1px solid var(--line);background:var(--surface);border-radius:var(--radius-pill);flex:none;align-self:flex-start;align-items:center;padding:3px 9px;font-size:11.5px;line-height:1.35;display:inline-flex}.a2ui-t-badge{border-radius:var(--radius-sm);font-family:var(--font-mono);font-size:9px;font-weight:var(--fw-bold);letter-spacing:.14em;text-transform:uppercase;border:1px solid;flex:none;align-self:flex-start;align-items:center;padding:1px 7px;line-height:1.6;display:inline-flex}.a2ui-t-code{font-family:var(--font-mono);overflow-wrap:anywhere;font-size:11.5px;line-height:1.4}.a2ui-strong{font-weight:var(--fw-bold)}.a2ui-marker{background:color-mix(in srgb, currentColor 6%, transparent);border-left:2px solid;padding:4px 8px 4px 12px}.a2ui-link{min-width:0;color:inherit;font:inherit;text-align:left;cursor:pointer;background:0 0;border:0;align-items:center;gap:5px;margin:0;padding:0;text-decoration:none;display:inline-flex}.a2ui-link:hover :where(.a2ui-text,.a2ui-metric){color:var(--a2ui-accent,var(--accent));text-underline-offset:3px;text-decoration:underline}.a2ui-link:focus-visible{border-radius:var(--radius-sm);box-shadow:var(--focus-ring);outline:none}.a2ui-metric{min-width:0;font-family:var(--font-mono);flex-direction:column;gap:2px;display:flex}.a2ui-metric.end{text-align:right;align-items:flex-end}.a2ui-metric-label{letter-spacing:var(--tracking-wide);text-transform:uppercase;color:var(--a2ui-muted,var(--muted));font-size:10.5px}.a2ui-metric-value{font-weight:var(--fw-bold);letter-spacing:-.02em;line-height:1}.a2ui-metric-value i{color:var(--a2ui-muted,var(--muted));letter-spacing:.06em;margin-left:5px;font-size:9px;font-style:normal}.a2ui-metric-delta{font-weight:var(--fw-semibold);align-items:baseline;gap:5px;display:inline-flex}.a2ui-metric-arrow{font-size:.82em}.a2ui-metric-sm{min-width:96px}.a2ui-metric-sm .a2ui-metric-value{font-size:14px}.a2ui-metric-sm .a2ui-metric-delta{font-size:12px}.a2ui-metric-md .a2ui-metric-value{font-size:20px}.a2ui-metric-md .a2ui-metric-delta{font-size:13px}.a2ui-metric-lg{flex-flow:wrap;align-items:baseline;gap:12px}.a2ui-metric-lg .a2ui-metric-value{font-size:30px}.a2ui-metric-lg .a2ui-metric-delta{font-size:14px}.a2ui-spark{flex:none;display:block}.a2ui-spark-sm{width:78px;height:30px}.a2ui-spark-md{width:160px;height:56px}.a2ui-spark-lg{flex:200px;width:100%;max-width:340px;height:120px}.a2ui-spark .ln{fill:none;stroke:currentColor;stroke-width:2px;stroke-linejoin:round;stroke-linecap:round;stroke-dasharray:1;stroke-dashoffset:1px;animation:.7s cubic-bezier(.3,.6,.3,1) .1s forwards a2ui-spark-draw}.a2ui-spark .area{fill:currentColor;stroke:none;opacity:0;animation:.45s ease-out .55s forwards a2ui-spark-area}.a2ui-spark .end{fill:currentColor;opacity:0;animation:.25s ease-out .75s forwards a2ui-spark-end}@keyframes a2ui-spark-draw{to{stroke-dashoffset:0}}@keyframes a2ui-spark-area{to{opacity:.14}}@keyframes a2ui-spark-end{to{opacity:1}}[data-animations=off] .a2ui-spark .ln{stroke-dashoffset:0;animation:none}[data-animations=off] .a2ui-spark .area{opacity:.14;animation:none}[data-animations=off] .a2ui-spark .end{opacity:1;animation:none}.a2ui-figure{border:1px solid var(--a2ui-rule,var(--line));border-radius:var(--radius-sm);background:var(--code);flex:none;min-width:0;margin:0;position:relative;overflow:hidden}.a2ui-figure img{object-fit:cover;filter:saturate(.92)contrast(1.02);width:100%;height:100%;display:block}.a2ui-figure figcaption{background:var(--a2ui-ink,var(--ink));color:var(--a2ui-paper,var(--surface));font-family:var(--font-mono);letter-spacing:.1em;text-transform:uppercase;margin:0;padding:4px 9px;font-size:8.5px;position:absolute;bottom:0;left:0}.a2ui-figure-sm{width:66px;height:50px}.a2ui-figure-md{width:120px;height:90px}.a2ui-figure-lg{flex:200px;align-self:stretch;max-width:320px;min-height:190px}.a2ui-figure-lg img{animation:20s ease-in-out infinite alternate a2ui-figure-pan}@keyframes a2ui-figure-pan{0%{transform:scale(1.06)}to{transform:scale(1.16)translate(-2.5%,-2%)}}[data-animations=off] .a2ui-figure-lg img{animation:none;transform:scale(1.06)}.a2ui-glyph{aspect-ratio:16/4;border:1px solid var(--a2ui-rule,var(--line));border-radius:var(--radius-sm);width:100%;margin-inline:auto;position:relative;overflow:hidden}.a2ui-glyph-sm{max-height:64px}.a2ui-glyph-md{max-height:96px}.a2ui-glyph-lg{max-height:132px}.a2ui-diff{border:1px solid var(--a2ui-rule,var(--line));border-radius:var(--radius-sm);background:color-mix(in srgb, var(--a2ui-rule,var(--line)) 12%, transparent);max-height:340px;font-family:var(--font-mono);margin:0;padding:8px 0;font-size:11.5px;line-height:1.5;overflow:auto}.a2ui-diff-line{white-space:pre;color:var(--a2ui-muted,var(--muted));padding:0 10px;display:block}.a2ui-diff-line.ctx{color:var(--a2ui-ink,var(--ink))}.a2ui-diff-line.meta{font-weight:var(--fw-bold)}.a2ui-diff-line.add{color:var(--a2ui-positive);background:color-mix(in srgb, var(--a2ui-positive) 14%, transparent)}.a2ui-diff-line.del{color:var(--a2ui-negative);background:color-mix(in srgb, var(--a2ui-negative) 12%, transparent)}.a2ui-tablewrap{min-width:0;margin-inline:-2px;padding:2px;overflow-x:auto}.a2ui-table{border-top:1.5px solid var(--a2ui-rule-strong,var(--ink));border-left:1px solid var(--a2ui-rule,var(--line));min-width:min-content;display:grid}.a2ui-th,.a2ui-td{border-right:1px solid var(--a2ui-rule,var(--line));border-bottom:1px solid var(--a2ui-rule,var(--line));min-width:0;padding:9px 12px}.a2ui-th,.a2ui-th-row{background:color-mix(in srgb, var(--a2ui-rule,var(--line)) 22%, transparent)}.a2ui-th-row{align-items:center;display:flex}.a2ui-th-row .a2ui-text{overflow-wrap:normal}.a2ui-td{padding-right:24px;position:relative}.a2ui-td-none{color:var(--a2ui-muted,var(--muted));font-size:12.5px}.a2ui-td-win{color:var(--a2ui-accent,var(--accent));font-size:8px;position:absolute;top:18px;right:10px;transform:translateY(-50%)}.a2ui-td.win .a2ui-text{font-weight:var(--fw-semibold)}.a2ui-th.pick,.a2ui-td.pick{background:color-mix(in srgb, var(--a2ui-accent,var(--accent)) 7%, transparent);box-shadow:inset 3px 0 0 var(--a2ui-accent,var(--accent))}@media (width<=640px){.a2ui-th,.a2ui-td{padding:8px}}.a2ui-checkbox{border:1px solid var(--line);background:color-mix(in srgb, var(--surface) 70%, var(--code) 30%);min-height:42px;color:var(--ink);cursor:pointer;border-radius:7px;align-items:center;gap:9px;padding:10px 12px;font-size:12.5px;line-height:1.35;display:flex}.a2ui-checkbox input{width:16px;height:16px;accent-color:var(--accent);cursor:pointer;margin:0}.a2ui-checkbox:has(input:focus-visible){box-shadow:var(--focus-ring);outline:none}.a2ui-button{border:1px solid var(--line);background:var(--surface);min-height:34px;color:var(--ink);font:inherit;cursor:pointer;border-radius:7px;align-self:flex-start;padding:7px 12px;font-size:12.5px;font-weight:650}.a2ui-button.primary{border-color:var(--accent);background:var(--accent);color:#fff}.a2ui-button:focus-visible{box-shadow:var(--focus-ring);outline:none}.a2ui-image{background:var(--code);border-radius:7px;width:100%;max-height:360px;display:block}.a2ui-image.icon,.a2ui-image.avatar{width:48px;height:48px}.a2ui-video{background:#000;border:0;border-radius:7px;width:100%;min-height:220px}.a2ui-field{color:var(--ink);flex-direction:column;gap:6px;font-size:12.5px;display:flex}.a2ui-field input,.a2ui-field textarea{box-sizing:border-box;border:1px solid var(--line);background:var(--code);width:100%;color:var(--ink);font:inherit;border-radius:7px;padding:8px 9px}.a2ui-field textarea{resize:vertical;min-height:88px}.a2ui-slider{grid-template-columns:1fr auto;align-items:center;display:grid}.a2ui-slider>span{grid-column:1/-1}.a2ui-slider input{padding:0}.a2ui-slider output{color:var(--muted);text-align:right;min-width:3ch}.a2ui-choice{border:0;margin:0;padding:0}.a2ui-choice legend{color:var(--ink);padding:0 0 6px;font-size:12.5px}.a2ui-choice>div{flex-direction:column;gap:6px;display:flex}.a2ui-choice label{min-height:34px;color:var(--ink);align-items:center;gap:8px;font-size:12.5px;display:flex}.a2ui-choice .chips{flex-flow:wrap}.a2ui-choice .chips label{border:1px solid var(--line);border-radius:999px;padding:3px 8px}.a2ui-list{flex-direction:column;gap:6px;margin-top:9px;display:flex}.a2ui-ranked{counter-reset:a2ui-rank var(--a2ui-rank-from,0)}.a2ui-ranked>*{counter-increment:a2ui-rank}.a2ui-ranked>:before{content:counter(a2ui-rank, decimal-leading-zero);font-family:var(--font-mono);font-size:11.5px;font-weight:var(--fw-bold);color:var(--a2ui-accent,var(--accent));flex:none;padding-top:2px}.a2ui-basic-col>.a2ui-list,.a2ui-basic-row>.a2ui-list{margin-top:0}@media (width<=720px){.a2ui{max-width:100%}}.itemtime{color:var(--text-faint);font-size:var(--text-xs);font-weight:var(--fw-regular);letter-spacing:0;text-transform:none;white-space:nowrap;flex:none}.srow .itemtime,.deliv .d .itemtime{margin-left:auto}.itemfb{max-width:var(--thread-max);margin:2px auto 6px;padding:0 20px}.genimage .itemfb,.deliv .itemfb{margin:6px 0 0;padding:0}.fb{flex-direction:column;gap:6px;display:flex}.fb-row{align-items:center;gap:4px;display:flex}.fb-thumb{width:26px;height:26px;color:var(--text-faint);border-radius:var(--radius-sm);cursor:pointer;transition:color var(--dur-fast) var(--ease-out), background var(--dur-fast) var(--ease-out), border-color var(--dur-fast) var(--ease-out);background:0 0;border:1px solid #0000;justify-content:center;align-items:center;display:inline-flex}.fb-thumb:hover{color:var(--text-muted);background:var(--surface-hover)}.fb-thumb.active{color:var(--text);background:var(--surface-hover)}.fb-thumb.on{color:var(--text)}.fb-recorded{font-size:var(--text-xs);color:var(--text-faint);text-overflow:ellipsis;white-space:nowrap;max-width:46ch;overflow:hidden}.fb-reason{align-items:center;gap:6px;display:flex}.fb-reason input{border:1px solid var(--line);background:var(--surface-sunk);min-width:0;max-width:520px;color:var(--text);border-radius:var(--radius-sm);font:inherit;font-size:var(--text-sm);flex:1;padding:7px 11px}.fb-reason input:focus{border-color:var(--accent);box-shadow:var(--focus-ring);outline:none}.fb-save{border:1px solid var(--line-strong);background:var(--surface);color:var(--text);border-radius:var(--radius-sm);font:inherit;font-size:var(--text-sm);font-weight:var(--fw-medium);cursor:pointer;transition:background var(--dur-fast) var(--ease-out), border-color var(--dur-fast) var(--ease-out);flex:none;padding:6px 13px}.fb-save:hover{background:var(--surface-hover);border-color:var(--accent-border)}.fb-save:focus-visible{box-shadow:var(--focus-ring);outline:none}.fb-save:disabled{opacity:.5;cursor:default}.fb-x{color:var(--text-muted);cursor:pointer;background:0 0;border:none;align-items:center;padding:4px;display:inline-flex}.fb-x:hover{color:var(--ink)}.fp{flex-direction:column;gap:8px;display:flex}.fp-bar{align-items:center;gap:8px;display:flex}.fp-up{border:1px solid var(--line);background:var(--surface);width:30px;height:30px;color:var(--text-muted);border-radius:var(--radius-sm);cursor:pointer;transition:border-color var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out);flex:none;justify-content:center;align-items:center;display:inline-flex}.fp-up:hover:not(:disabled){border-color:color-mix(in srgb, var(--accent) 45%, var(--line));color:var(--accent)}.fp-up:disabled{opacity:.45;cursor:default}.fp-path{min-width:0;font-family:var(--font-mono);font-size:var(--text-sm);color:var(--text-muted);text-overflow:ellipsis;white-space:nowrap;text-align:left;direction:rtl;flex:1;overflow:hidden}.fp-roots{flex-wrap:wrap;gap:6px;display:flex}.fp-root{border:1px solid var(--line);background:var(--surface);color:var(--text-muted);border-radius:var(--radius-pill);font:inherit;font-size:var(--text-xs);font-weight:var(--fw-medium);cursor:pointer;transition:border-color var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out);padding:3px 11px}.fp-root:hover{border-color:color-mix(in srgb, var(--accent) 45%, var(--line));color:var(--accent)}.fp-list{border:1px solid var(--line);border-radius:var(--radius-md);background:var(--surface-sunk);flex-direction:column;max-height:240px;display:flex;overflow-y:auto}.fp-dir{text-align:left;width:100%;color:var(--text);border:none;border-bottom:1px solid var(--line);font:inherit;font-size:var(--text-sm);cursor:pointer;transition:background var(--dur-fast) var(--ease-out);background:0 0;align-items:center;gap:9px;padding:9px 12px;display:flex}.fp-dir:last-child{border-bottom:none}.fp-dir:hover{background:var(--surface-hover)}.fp-dir .fp-name{text-overflow:ellipsis;white-space:nowrap;flex:1;min-width:0;overflow:hidden}.fp-dir>:global(svg):first-child{color:var(--text-muted)}.fp-dir>:global(svg):last-child{color:var(--text-faint)}.fp-msg{text-align:center;color:var(--text-muted);font-size:var(--text-sm);padding:18px 12px}.fp-msg.err{color:var(--ag2-observer)}.fp-new{border:1px solid var(--line);background:var(--surface);width:30px;height:30px;color:var(--text-muted);border-radius:var(--radius-sm);cursor:pointer;transition:border-color var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out);flex:none;justify-content:center;align-items:center;display:inline-flex}.fp-new:hover:not(:disabled){border-color:color-mix(in srgb, var(--accent) 45%, var(--line));color:var(--accent)}.fp-new:disabled{opacity:.45;cursor:default}.fp-new:focus-visible{box-shadow:var(--focus-ring);outline:none}.fp-newrow{border-bottom:1px solid var(--line);align-items:center;gap:9px;padding:9px 12px;display:flex}.fp-newrow>:global(svg){color:var(--text-muted);flex:none}.fp-input{min-width:0;color:var(--text);font:inherit;font-size:var(--text-sm);background:0 0;border:none;flex:1;padding:0}.fp-input:focus{outline:none}.fp-input::placeholder{color:var(--text-faint)}.fp-err{color:var(--ag2-observer);font-size:var(--text-xs)}.fp-use{border:1px solid var(--line-strong);background:var(--surface);color:var(--text);border-radius:var(--radius-sm);font:inherit;font-size:var(--text-sm);font-weight:var(--fw-semibold);cursor:pointer;transition:background var(--dur-fast) var(--ease-out), border-color var(--dur-fast) var(--ease-out);justify-content:center;align-items:center;gap:7px;padding:9px 16px;display:inline-flex}.fp-use:hover:not(:disabled){background:var(--surface-hover);border-color:var(--accent-border)}.fp-use:focus-visible{box-shadow:var(--focus-ring);outline:none}.fp-use:disabled{opacity:.5;cursor:default}.fp-use.on{background:var(--success);border-color:var(--success);color:#fff}.tools{flex-wrap:wrap;align-items:center;gap:5px;margin:8px 0;display:flex}.chip{color:var(--muted);background:var(--code);border:1px solid var(--line);border-radius:var(--radius-pill);align-items:center;gap:4px;padding:2px 9px;font-size:11px;display:inline-flex}.toolcards{flex-wrap:wrap;gap:6px;margin:2px 0 8px;display:flex}.toolcard{background:var(--code);border:1px solid var(--line);border-radius:8px;align-items:center;gap:7px;max-width:100%;padding:5px 10px;font-size:12px;display:inline-flex}.toolcard .tcicon{color:var(--muted);align-items:center;line-height:1;display:inline-flex}.toolcard .tclink{color:var(--accent,var(--danger));cursor:pointer;font:inherit;text-underline-offset:2px;text-overflow:ellipsis;white-space:nowrap;background:0 0;border:none;max-width:360px;padding:0;text-decoration:underline;overflow:hidden}.toolcard .tcdl{cursor:pointer;color:var(--muted);background:0 0;border:none;align-items:center;padding:0;display:inline-flex}.toolcard .tcdl:hover{color:var(--text,inherit)}.toolcard.gone .tcname{color:var(--muted);text-overflow:ellipsis;white-space:nowrap;max-width:360px;text-decoration:line-through;overflow:hidden}.toolcard .tcgone{color:var(--muted);font-size:11px;font-style:italic}.toolcard .tcquery,.toolcard .tcskill{color:var(--muted);text-overflow:ellipsis;white-space:nowrap;max-width:360px;overflow:hidden}.genimage{margin:8px 0}.genimage .thumbbtn,.attach .thumbbtn{cursor:zoom-in;background:0 0;border:0;padding:0;display:block}.genimage .thumb{border:1px solid var(--line);cursor:zoom-in;background:#fff;border-radius:10px;width:auto;max-width:340px;height:auto;max-height:280px;display:block}.genimage .thumbbtn:hover .thumb{border-color:color-mix(in srgb, var(--accent) 45%, var(--line))}.genimage .filechip{border:1px solid var(--line);background:var(--code);color:var(--ink);border-radius:var(--radius-sm);cursor:pointer;transition:border-color var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out);align-items:center;gap:6px;padding:7px 11px;font-size:13px;display:inline-flex}.genimage .filechip:hover{border-color:color-mix(in srgb, var(--accent) 45%, var(--line));color:var(--accent)}.attach{flex-direction:column;align-items:flex-end;gap:4px;margin:8px 0;display:flex}.attach .who{color:var(--muted);font-size:11px}.attach .thumb{border:1px solid var(--line);cursor:zoom-in;background:#fff;border-radius:10px;width:auto;max-width:260px;height:auto;max-height:220px;display:block}.attach .thumbbtn:hover .thumb{border-color:color-mix(in srgb, var(--accent) 45%, var(--line))}.attach .filechip{border:1px solid var(--line);background:var(--code);color:var(--ink);border-radius:var(--radius-sm);cursor:pointer;transition:border-color var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out);align-items:center;gap:6px;padding:7px 11px;font-size:13px;display:inline-flex}.attach .filechip:hover{border-color:color-mix(in srgb, var(--accent) 45%, var(--line));color:var(--accent)}.dots span{background:var(--muted);border-radius:50%;width:6px;height:6px;margin-right:4px;animation:1.2s infinite both blink;display:inline-block}.dots span:nth-child(2){animation-delay:.2s}.dots span:nth-child(3){animation-delay:.4s}@keyframes blink{0%,80%,to{opacity:.25}40%{opacity:1}}.subagent{border:1px solid var(--line);border-left:3px solid var(--info);background:var(--panel);border-radius:10px;max-width:80%;margin:10px 0;padding:9px 12px}.subagent .srow{align-items:center;gap:8px;min-width:0;display:flex}.subagent .sdot{background:var(--info);border-radius:50%;flex:none;width:8px;height:8px}.subagent.running .sdot{animation:1.2s infinite both blink}.subagent.completed{border-left-color:var(--success)}.subagent.completed .sdot{background:var(--success)}.subagent.failed,.subagent.cancelled{border-left-color:var(--danger)}.subagent.failed .sdot,.subagent.cancelled .sdot{background:var(--danger)}.subagent .sname{color:var(--ink);text-transform:capitalize;overflow-wrap:anywhere;font-size:12px;font-weight:700}.subagent .sstatus{color:var(--muted);text-transform:uppercase;letter-spacing:.04em;margin-left:auto;font-size:11px}.subagent .sobj{color:var(--ink);overflow-wrap:anywhere;margin-top:5px;font-size:13px}.subagent .sres,.subagent .serr{color:var(--muted);overflow-wrap:anywhere;margin-top:6px;font-size:12px}.subagent .serr{color:var(--danger)}.subagent .srow{cursor:pointer;-webkit-user-select:none;user-select:none}.subagent .scount{background:var(--line);min-width:16px;height:16px;color:var(--muted);text-align:center;border-radius:999px;flex:none;padding:0 4px;font-size:10px;line-height:16px}.subagent .scaret{color:var(--muted);flex:none;margin-left:6px;font-size:10px}.subagent .skids{border-left:2px solid var(--line);flex-direction:column;margin-top:8px;padding-left:10px;display:flex}.subagent .skids .msg{margin:6px 0}.subagent .skids .bubble{max-width:100%;font-size:14px}.subagent .skids .subagent{max-width:100%}.card{border:1px solid var(--accent-border);border-radius:12px;max-width:80%;margin:12px 0;padding:12px 14px}.card .k{text-transform:uppercase;letter-spacing:1px;color:var(--accent);align-items:center;gap:6px;font-size:11px;font-weight:700;display:inline-flex}.card .t{margin:4px 0 8px;font-size:14px}.card button,.composer .csend,.panel button{font-family:var(--sans);cursor:pointer}.card .open{font-size:13px;font-weight:var(--fw-medium);border:1px solid var(--accent);color:var(--accent);border-radius:var(--radius-sm);transition:background var(--dur-fast) var(--ease-out);background:0 0;align-items:center;gap:6px;padding:6px 12px;display:inline-flex}.card .open:hover{background:var(--accent-soft)}.deliv{border:1px solid var(--line);border-radius:10px;margin:10px 0;padding:10px 12px}.deliv .d{color:var(--muted);align-items:center;gap:6px;margin-bottom:4px;font-size:12px;display:flex}.deliv .dprev{color:var(--ink);overflow-wrap:anywhere;margin:2px 0;font-size:13px}.asset{background:var(--code);border-radius:8px;max-height:260px;margin:4px 0;padding:10px 12px;font-size:13px;overflow:auto}.viewbtn{color:var(--accent);border:1px solid var(--line);border-radius:var(--radius-sm);cursor:pointer;font-size:12px;font-family:var(--sans);transition:border-color var(--dur-fast) var(--ease-out), background var(--dur-fast) var(--ease-out);background:0 0;align-items:center;gap:5px;margin:4px 0 2px;padding:5px 11px;display:inline-flex}.viewbtn:hover{border-color:color-mix(in srgb, var(--accent) 45%, var(--line));background:var(--accent-soft)}.md>:first-child{margin-top:0}.md>:last-child{margin-bottom:0}.md p{margin:0 0 10px}.md ul,.md ol{margin:0 0 10px;padding-left:22px}.md li{margin:3px 0}.md h1,.md h2,.md h3{margin:14px 0 8px;line-height:1.25}.md h1{font-size:20px}.md h2{font-size:17px}.md h3{font-size:15px}.md a{color:var(--accent)}.md code{font-family:var(--mono);background:var(--code);border-radius:5px;padding:1.5px 5px;font-size:12px}.md pre{background:var(--code);border-radius:10px;margin:0 0 10px;padding:12px 14px;overflow-x:auto}.md pre code{background:0 0;padding:0}.md blockquote{border-left:3px solid var(--line);color:var(--muted);margin:0 0 10px;padding-left:12px}.md table{border-collapse:collapse;margin:0 0 10px;font-size:13px}.md th,.md td{border:1px solid var(--line);padding:5px 9px}.inquiry{border:1px solid var(--accent-border);border-radius:12px;margin:12px 0;padding:12px 14px}.inquiry.resolved{border-color:var(--line);opacity:.6}.inquiry .opts{flex-wrap:wrap;gap:6px;margin-top:8px;display:flex}.inquiry .opts button{border:1px solid var(--line);background:var(--bg);color:var(--ink);border-radius:8px;padding:5px 11px}.inquiry input{border:1px solid var(--line);background:var(--bg);width:100%;color:var(--ink);border-radius:8px;margin-top:8px;padding:8px}.inquiry .idetail{background:var(--code);border:1px solid var(--line);white-space:pre-wrap;word-break:break-word;border-radius:8px;max-height:320px;margin:8px 0;padding:10px 12px;font-family:ui-monospace,monospace;font-size:12px;line-height:1.5;overflow:auto}.composer{background:linear-gradient(to bottom, transparent, var(--bg) 42%);pointer-events:none;padding:28px 20px 16px;position:absolute;bottom:0;left:16px;right:16px}.composer>*{pointer-events:auto}.cnote{max-width:calc(var(--thread-max) - 40px);text-align:center;color:var(--muted);margin:8px auto 0;font-size:12px}.scrolldown{z-index:5;border:1px solid var(--line);background:var(--surface);width:36px;height:36px;color:var(--ink);cursor:pointer;box-shadow:var(--shadow-lg);transition:border-color var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out);border-radius:999px;justify-content:center;align-items:center;display:inline-flex;position:absolute;bottom:148px;left:50%;transform:translate(-50%)}.scrolldown:hover{border-color:color-mix(in srgb, var(--accent) 45%, var(--line));color:var(--accent)}.inputbox{max-width:calc(var(--thread-max) - 40px);border:1px solid var(--line-strong);border-radius:var(--radius-md);background:var(--surface-elevated);box-shadow:var(--shadow-md);transition:border-color var(--dur-fast) var(--ease-out), box-shadow var(--dur-fast) var(--ease-out);margin:0 auto;padding:10px 10px 10px 16px}.inputbox:focus-within{border-color:color-mix(in srgb, var(--accent) 50%, var(--line-strong));box-shadow:var(--shadow-md)}.cinput{resize:none;width:100%;color:var(--ink);font:inherit;font-size:var(--text-md);background:0 0;border:none;max-height:200px;padding:8px 4px 6px;display:block}.cinput:focus{outline:none}.cbar{align-items:center;gap:8px;margin-top:4px;display:flex}.cbar-right{align-items:center;gap:6px;margin-left:auto;display:flex}.cbtn{width:34px;height:34px;color:var(--muted);cursor:pointer;transition:background var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out);background:0 0;border:none;border-radius:999px;justify-content:center;align-items:center;display:inline-flex}.cbtn:hover:not(:disabled){background:var(--surface-hover);color:var(--ink)}.cbtn:disabled{opacity:.4;cursor:default;pointer-events:none}.cbtn.live.on{background:var(--accent);color:var(--text-on-accent);animation:1.4s infinite micpulse}.csend{background:var(--accent);width:36px;height:36px;color:var(--text-on-accent);cursor:pointer;box-shadow:var(--shadow-accent);transition:background var(--dur-fast) var(--ease-out), opacity var(--dur-fast) var(--ease-out);border:none;border-radius:999px;justify-content:center;align-items:center;display:inline-flex}.csend:hover:not(:disabled){background:var(--accent-hover)}.csend:disabled{opacity:.4;cursor:default;box-shadow:none;pointer-events:none}.csend.stop{background:var(--surface);color:var(--ink);border:1px solid var(--line);box-shadow:none}.csend.stop:hover{border-color:var(--danger);color:var(--danger)}@keyframes micpulse{0%,to{box-shadow:0 0 0 0 color-mix(in srgb, var(--accent) 50%, transparent)}50%{box-shadow:0 0 0 6px color-mix(in srgb, var(--accent) 0%, transparent)}}.bubble.voice{font-style:italic}.bubble.voice:before{content:"🎙 ";font-style:normal}.mhead{border-bottom:1px solid var(--line);background:var(--panel);align-items:center;gap:10px;padding:10px 20px;display:flex}.mhead .back{border:1px solid var(--line);background:var(--surface);color:var(--ink);border-radius:var(--radius-sm);cursor:pointer;transition:border-color var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out);align-items:center;gap:4px;padding:5px 11px;display:inline-flex}.mhead .back:hover{border-color:color-mix(in srgb, var(--accent) 45%, var(--line));color:var(--accent)}.mhead .titles{flex-direction:column;gap:1px;min-width:0;display:flex}.mhead .title{font-family:var(--font-display);font-weight:var(--fw-bold);font-size:var(--text-lg);line-height:var(--leading-tight);text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.mhead .msub{font-family:var(--mono);font-size:var(--text-xs);letter-spacing:-.01em;color:var(--muted);text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.mhead .hactions{align-items:center;gap:8px;margin-left:auto;display:flex}.badge{border:1px solid var(--accent-border);background:var(--accent-soft);color:var(--accent);font-size:11px;font-weight:var(--fw-medium);border-radius:999px;padding:1px 8px}.panel{border:1px solid var(--line);max-width:var(--thread-max);border-radius:12px;margin:0 auto 14px;padding:12px 14px}.panel .ptitle{color:var(--muted);text-transform:uppercase;letter-spacing:1px;font-size:12px}.panel .tasktime{font-size:var(--text-sm);color:var(--text-muted);align-items:center;gap:6px;margin-top:6px;display:inline-flex}.panel .taskerror{font-size:var(--text-sm);line-height:var(--leading-snug);color:var(--ag2-observer);background:color-mix(in srgb, var(--ag2-observer) 9%, transparent);border:1px solid color-mix(in srgb, var(--ag2-observer) 28%, transparent);border-radius:var(--radius-sm);overflow-wrap:anywhere;align-items:flex-start;gap:7px;margin-top:8px;padding:9px 11px;display:flex}.panel .taskerror strong{font-weight:var(--fw-semibold)}.panel .child{border-left:2px solid var(--line);margin:6px 0;padding-left:10px}.panel .runlink{color:var(--accent,var(--danger));cursor:pointer;font:inherit;text-underline-offset:2px;background:0 0;border:none;padding:0;text-decoration:underline}.hitl{border-bottom:1px solid var(--line);background:var(--panel);max-height:40vh;padding:10px 20px;overflow-y:auto}.hitlhead{text-transform:uppercase;letter-spacing:1px;color:var(--accent);margin-bottom:6px;font-size:12px;font-weight:700}.qcard{border:1px solid var(--accent-border);border-radius:10px;max-width:760px;margin:6px 0;padding:10px 12px}.qcard .qk{color:var(--muted);font-size:11px}.qcard .qk .tasklink{font:inherit;color:var(--accent);cursor:pointer;background:0 0;border:0;padding:0}.qcard .qt{margin:4px 0;font-size:14px}.qcard .qd{color:var(--ink);background:var(--code);border:1px solid var(--line);white-space:pre-wrap;word-break:break-word;border-radius:6px;max-height:240px;margin:4px 0;padding:8px 10px;font-family:ui-monospace,monospace;font-size:12px;overflow:auto}.qcard .qopts{flex-wrap:wrap;gap:6px;display:flex}.qcard .qopts button{border:1px solid var(--line);background:var(--bg);color:var(--ink);cursor:pointer;border-radius:8px;padding:5px 11px}.qcard input{border:1px solid var(--line);background:var(--bg);width:100%;color:var(--ink);border-radius:8px;padding:8px}.pending{flex-wrap:wrap;gap:6px;padding:2px 4px 4px;display:flex}.pending .chip{align-items:center;gap:4px;display:inline-flex}.pending .chip .x{color:var(--muted);cursor:pointer;background:0 0;border:none;padding:0 2px;font-size:14px}.modelsw{align-items:center;display:inline-flex}.modelsw-wrap{display:inline-block;position:relative}.modelsw-btn{color:var(--muted);font:inherit;cursor:pointer;transition:background var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out);background:0 0;border:none;border-radius:999px;align-items:center;gap:6px;padding:5px 9px;font-size:12px;display:inline-flex}.modelsw-btn:hover:not(:disabled){background:var(--surface-hover);color:var(--ink)}.modelsw-btn:disabled{opacity:.6;cursor:default}.modelsw-name{font-family:var(--mono);letter-spacing:-.01em;align-items:center;gap:4px;display:inline-flex}.modelsw-name.muted{color:var(--muted)}.modelsw-dot{background:var(--ok,var(--success));border-radius:50%;flex:none;width:7px;height:7px}.modelsw-dot.warn{background:var(--muted)}.modelsw-pin,.modelsw-empty{color:var(--muted);font-size:12px}.modelsw-empty{cursor:pointer;text-underline-offset:2px;font:inherit;color:var(--muted);background:0 0;border:none;padding:0;font-size:12px;text-decoration:underline}.modelsw-empty:hover{color:var(--accent)}.modelsw-scrim{z-index:9;cursor:default;background:0 0;border:none;position:fixed;inset:0}.modelsw-menu{z-index:10;background:var(--surface-elevated);border:1px solid var(--line);border-radius:var(--radius-md);min-width:240px;max-width:min(360px,90vw);max-height:320px;box-shadow:var(--shadow-lg);flex-direction:column;gap:2px;padding:4px;display:flex;position:absolute;bottom:calc(100% + 6px);left:0;overflow-y:auto}.modelsw-menu.down{top:calc(100% + 6px);bottom:auto}.modelsw-tag{letter-spacing:.04em;text-transform:uppercase;color:var(--muted);border:1px solid var(--line);border-radius:var(--radius-pill,999px);padding:0 6px;font-size:10px;line-height:15px}.modelsw-item{text-align:left;width:100%;color:var(--ink);border-radius:var(--radius-sm);cursor:pointer;font:inherit;background:0 0;border:none;align-items:center;gap:8px;padding:7px 9px;display:flex}.modelsw-item:hover:not(:disabled){background:var(--code)}.modelsw-item.active{background:color-mix(in srgb, var(--accent) 10%, transparent)}.modelsw-item:disabled{opacity:.5;cursor:default}.modelsw-itemmeta{flex-direction:column;flex:1;min-width:0;display:flex}.modelsw-item .modelsw-name{font-size:13px}.modelsw-sub{color:var(--muted);white-space:nowrap;text-overflow:ellipsis;font-size:11px;overflow:hidden}.modelsw-manage{color:var(--muted);border-radius:var(--radius-sm);text-align:left;cursor:pointer;font:inherit;border:none;border-top:1px solid var(--line);background:0 0;margin-top:2px;padding:7px 9px;font-size:12px}.modelsw-manage:hover{color:var(--accent)}.modal-backdrop{z-index:20;animation:ag2-fade var(--dur-base) var(--ease-out) both;background:#00000080;position:fixed;inset:0}.modal{z-index:21;background:var(--surface-elevated);border:1px solid var(--line);border-radius:var(--radius-lg);width:min(560px,92vw);box-shadow:var(--shadow-lg);animation:modal-pop var(--dur-base) var(--ease-spring) both;flex-direction:column;gap:10px;padding:20px;display:flex;position:fixed;top:50%;left:50%;transform:translate(-50%,-50%)}@keyframes modal-pop{0%{opacity:0;transform:translate(-50%,-50%)scale(.96)}to{opacity:1;transform:translate(-50%,-50%)scale(1)}}@media (prefers-reduced-motion:reduce){.modal,.modal-backdrop{animation:none}}.modal h2{margin:0}.modal>h2{padding-right:34px}.modal textarea{border:1px solid var(--line);min-height:140px;font-family:var(--mono);background:var(--bg);color:var(--ink);border-radius:8px;padding:10px;font-size:12px}.modal-backdrop.over{z-index:29}.modal.over{z-index:30}.modal .muted{color:var(--muted)}.gsteps{color:var(--ink);flex-direction:column;gap:6px;margin:4px 0 0;padding-left:20px;font-size:13px;line-height:1.5;display:flex}.gsteps a{color:var(--accent)}.gwarn{border:1px solid var(--warn,#c9922b);background:#c9922b1a;border-radius:8px;margin:0 0 14px;padding:10px 12px;font-size:13px;line-height:1.5}.gwarn p{margin:0 0 6px}.ghint{background:var(--panel2,#7f7f7f1f);-webkit-user-select:all;user-select:all;border-radius:6px;margin:6px 0 12px;padding:8px 10px;font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-size:12px;overflow-x:auto}.modal-close{border:1px solid var(--line);background:var(--surface);color:var(--ink);border-radius:var(--radius-sm);cursor:pointer;font-family:var(--sans);font-size:13px;font-weight:var(--fw-medium);transition:border-color var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out);align-self:flex-end;align-items:center;gap:6px;padding:7px 14px;display:inline-flex}.modal-close:hover{border-color:color-mix(in srgb, var(--accent) 45%, var(--line));color:var(--accent)}.modal-x{width:30px;height:30px;color:var(--text-muted);cursor:pointer;transition:color var(--dur-fast) var(--ease-out), background var(--dur-fast) var(--ease-out);background:0 0;border:none;border-radius:8px;justify-content:center;align-items:center;padding:0;font-size:22px;line-height:1;display:inline-flex;position:absolute;top:12px;right:12px}.modal-x:hover{color:var(--ink);background:var(--code)}.rail.viewer{border-left:1px solid var(--line);background:var(--panel);flex-direction:column;min-width:0;display:flex;position:relative;overflow:hidden}.rail-resizer{z-index:3;cursor:col-resize;touch-action:none;width:7px;position:absolute;top:0;bottom:0;left:-3px}.rail-resizer:after{content:"";width:1px;transition:background var(--dur-fast) var(--ease-out);background:0 0;position:absolute;top:0;bottom:0;left:3px}.rail-resizer:hover:after,.rail-resizer.dragging:after{background:var(--accent)}.rail-resizer.left{left:auto;right:-3px}.rail-resizer.left:after{left:auto;right:3px}.viewer .vhead{align-items:center;gap:10px;padding:12px 14px;display:flex}.viewer .vhead h2{text-overflow:ellipsis;white-space:nowrap;flex:1;min-width:0;margin:0;font-size:15px;overflow:hidden}.viewer .vhead .vtitle{font:inherit;text-overflow:ellipsis;white-space:nowrap;text-align:left;min-width:0;color:inherit;cursor:pointer;transition:color var(--dur-fast) var(--ease-out);background:0 0;border:none;flex:1;margin:0;padding:0;font-size:15px;font-weight:600;overflow:hidden}.viewer .vhead .vtitle:hover{color:var(--accent);text-underline-offset:2px;text-decoration:underline}.viewer .vhead .vtitle:focus-visible{outline:2px solid var(--accent);outline-offset:2px;border-radius:4px}.viewer .vhead .dl{color:var(--muted);flex:none;align-items:center;display:inline-flex}.viewer .vhead .dl:hover{color:var(--text,inherit)}.viewer .vlink{font:inherit;color:var(--accent);cursor:pointer;text-underline-offset:2px;background:0 0;border:none;padding:0;text-decoration:underline}.viewer .vlink:hover{color:var(--accent);opacity:.8}.viewer .vhead .vseg{background:var(--code);border-radius:8px;flex:none;gap:2px;padding:2px;display:inline-flex}.viewer .vhead .vsegbtn{width:26px;height:22px;color:var(--text-muted);cursor:pointer;transition:color var(--dur-fast) var(--ease-out), background var(--dur-fast) var(--ease-out);background:0 0;border:none;border-radius:6px;justify-content:center;align-items:center;padding:0;display:inline-flex}.viewer .vhead .vsegbtn:hover{color:var(--ink)}.viewer .vhead .vsegbtn.on{color:var(--ink);background:var(--panel);box-shadow:0 1px 2px #00000014}.viewer .vhead .cp{width:26px;height:26px;color:var(--text-muted);cursor:pointer;transition:color var(--dur-fast) var(--ease-out), background var(--dur-fast) var(--ease-out);background:0 0;border:none;border-radius:7px;flex:none;justify-content:center;align-items:center;padding:0;display:inline-flex}.viewer .vhead .cp:hover{color:var(--ink);background:var(--code)}.viewer .vhead .cp.copied{color:var(--accent)}.viewer .vhead .exp{width:26px;height:26px;color:var(--text-muted);cursor:pointer;transition:color var(--dur-fast) var(--ease-out), background var(--dur-fast) var(--ease-out);background:0 0;border:none;border-radius:7px;flex:none;justify-content:center;align-items:center;padding:0;display:inline-flex}.viewer .vhead .exp:hover{color:var(--ink);background:var(--code)}.viewer .vhead .exp[aria-pressed=true]{color:var(--accent)}.viewer .rail-x{width:26px;height:26px;color:var(--text-muted);cursor:pointer;transition:color var(--dur-fast) var(--ease-out), background var(--dur-fast) var(--ease-out);background:0 0;border:none;border-radius:7px;flex:none;justify-content:center;align-items:center;padding:0;font-size:20px;line-height:1;display:inline-flex}.viewer .rail-x:hover{color:var(--ink);background:var(--code)}.viewer .vhead .vdirty{color:var(--accent);flex:none;font-size:10px;line-height:1}.viewer .vhead .vsave{background:var(--accent);color:#fff;font:inherit;cursor:pointer;transition:opacity var(--dur-fast) var(--ease-out);border:none;border-radius:7px;flex:none;padding:4px 12px;font-size:12.5px;font-weight:600}.viewer .vhead .vsave:hover:not(:disabled){opacity:.9}.viewer .vhead .vsave:disabled{background:var(--code);color:var(--text-muted);cursor:default}.viewer .vhead .vmentions-wrap{flex:none;display:inline-flex;position:relative}.viewer .vhead .vmentions{height:26px;color:var(--text-muted);cursor:pointer;transition:color var(--dur-fast) var(--ease-out), background var(--dur-fast) var(--ease-out);background:0 0;border:none;border-radius:7px;align-items:center;gap:3px;padding:0 6px;display:inline-flex}.viewer .vhead .vmentions:hover,.viewer .vhead .vmentions.on{color:var(--ink);background:var(--code)}.viewer .vhead .vmentions-badge{font-size:11px;font-weight:600;line-height:1}.viewer .vhead .vmentions-pop{z-index:20;border:1px solid var(--line);background:var(--panel);border-radius:10px;min-width:220px;max-width:320px;max-height:320px;padding:4px;position:absolute;top:calc(100% + 6px);right:0;overflow-y:auto;box-shadow:0 8px 28px #00000029}.viewer .vhead .vmentions-row{width:100%;color:var(--ink);font:inherit;text-align:left;cursor:pointer;transition:background var(--dur-fast) var(--ease-out);background:0 0;border:none;border-radius:7px;align-items:center;gap:8px;padding:7px 9px;font-size:13px;display:flex}.viewer .vhead .vmentions-row:hover{background:var(--code)}.viewer .vhead .vmentions-row>:global(svg){color:var(--text-muted);flex:none}.viewer .vhead .vmentions-row-title{text-overflow:ellipsis;white-space:nowrap;flex:1;min-width:0;overflow:hidden}.viewer .vhead .vmentions-row-kind{text-transform:uppercase;letter-spacing:.03em;color:var(--text-muted);flex:none;font-size:10.5px;font-weight:600}.viewer .vbody{flex:1;min-height:0;padding:16px 18px;font-size:14px;line-height:1.6;overflow-y:auto}.viewer .vbody.native{padding:8px;overflow:hidden}.viewer .vbody.editing{flex-direction:column;gap:10px;display:flex;overflow:hidden}.viewer .vedit{box-sizing:border-box;resize:none;border:1px solid var(--line);background:var(--code);width:100%;min-height:0;color:var(--ink);white-space:pre;border-radius:6px;flex:1;padding:14px;font-family:ui-monospace,monospace;font-size:12.5px;line-height:1.5;overflow:auto}.viewer .vedit:focus-visible{outline:2px solid var(--accent);outline-offset:-1px;border-color:var(--accent)}.viewer .vsaveerr{background:color-mix(in srgb, var(--danger) 12%, transparent);color:var(--danger);border-radius:6px;flex:none;margin:0;padding:8px 12px;font-size:13px}.viewer .vconflict{background:color-mix(in srgb, var(--accent) 8%, transparent);border:1px solid color-mix(in srgb, var(--accent) 30%, transparent);border-radius:8px;flex-direction:column;flex:none;gap:10px;margin:0;padding:12px;display:flex}.viewer .vconflict-msg{color:var(--ink);margin:0;font-size:13px;line-height:1.5}.viewer .vconflict-actions{gap:8px;display:flex}.viewer .vconflict-btn{text-align:left;border:1px solid var(--line);background:var(--panel);color:var(--ink);font:inherit;cursor:pointer;transition:border-color var(--dur-fast) var(--ease-out);border-radius:7px;flex-direction:column;flex:1;gap:2px;padding:8px 12px;display:flex}.viewer .vconflict-btn:hover:not(:disabled){border-color:color-mix(in srgb, var(--accent) 55%, var(--line))}.viewer .vconflict-btn:disabled{opacity:.6;cursor:default}.viewer .vconflict-verb{font-size:13px;font-weight:600}.viewer .vconflict-note{color:var(--muted);font-size:11.5px}.viewer .vframe{background:#fff;border:0;border-radius:6px;width:100%;height:100%}.viewer .vimg{max-width:100%;height:auto;max-height:100%;margin:0 auto;display:block}.viewer .vmissing{text-align:center;height:100%;color:var(--muted);flex-direction:column;justify-content:center;align-items:center;gap:10px;padding:24px;display:flex}.viewer .vmissing-msg{max-width:42ch;margin:0;font-size:13px;line-height:1.5}.viewer .vmissing-path{word-break:break-all;color:var(--ink);background:var(--code);border-radius:6px;padding:6px 10px;font-family:ui-monospace,monospace;font-size:12px}.viewer .vmissing-detail{color:var(--muted);word-break:break-word;margin:0;font-size:11.5px}.viewer .vcode{white-space:pre;background:var(--code);border-radius:6px;padding:14px;font-family:ui-monospace,monospace;font-size:12.5px;line-height:1.5;overflow:auto}.viewer .vtext{white-space:pre-wrap;word-break:break-word;background:var(--code);border-radius:6px;padding:14px;font-family:ui-monospace,monospace;font-size:12.5px;line-height:1.5}.voicepick .vlist{grid-template-columns:1fr 1fr;gap:6px;max-height:56vh;display:grid;overflow-y:auto}.vrow{text-align:left;border:1px solid var(--line);background:var(--bg);color:var(--ink);cursor:pointer;border-radius:9px;align-items:baseline;gap:8px;padding:9px 11px;display:flex}.vrow:hover{border-color:color-mix(in srgb, var(--accent) 45%, var(--line))}.vrow.on{border-color:var(--accent);background:var(--code)}.vrow .vn{font-weight:600}.vrow .vs{color:var(--muted);font-size:11px}.vrow .vp{color:var(--accent);margin-left:auto;font-size:11px}.app.ag2,.app.rail{grid-template-columns:var(--drawer-w,270px) 1fr var(--rail-w,380px)}.app.rail.railfull{grid-template-columns:var(--drawer-w,270px) 0 1fr}.app.rail.railfull .main{overflow:hidden}.inspector{border-left:1px solid var(--line);background:var(--panel);flex-direction:column;min-width:0;display:flex;position:relative;overflow:hidden}.insp-head{align-items:center;gap:8px;padding:12px 14px 4px;display:flex}.insp-title{font-weight:700}.insp-head .linklike{margin-left:auto}.linklike{color:var(--accent);font:inherit;cursor:pointer;background:0 0;border:none;padding:0;font-size:12px}.insp-x{color:var(--muted);cursor:pointer;transition:color var(--dur-fast) var(--ease-out);background:0 0;border:none;align-items:center;padding:0 2px;display:inline-flex}.insp-x:hover{color:var(--ink)}.insp-sub{color:var(--muted);padding:0 14px 8px;font-size:12px;line-height:1.4}.insp-sub code{background:var(--code);border-radius:4px;padding:0 4px}.insp-list{flex:1;padding:4px 8px;overflow-y:auto}.insp-empty{color:var(--muted);text-align:center;padding:16px;font-size:13px}.insp-row{cursor:pointer;border-radius:7px;align-items:center;gap:8px;padding:5px 6px;font-size:12.5px;display:flex}.insp-row:hover{background:var(--code)}.insp-dot{border-radius:50%;flex:none;width:8px;height:8px}.insp-name{font-family:var(--mono);text-overflow:ellipsis;white-space:nowrap;min-width:0;overflow:hidden}.insp-sub2{text-transform:uppercase;letter-spacing:.04em;flex:none;font-size:10px}.insp-layer{text-transform:uppercase;color:var(--muted);border:1px solid var(--line);border-radius:4px;flex:none;padding:0 3px;font-size:9px}.insp-time{color:var(--muted);font-variant-numeric:tabular-nums;flex:none;margin-left:auto;font-size:11px}.insp-raw{background:var(--code);font-family:var(--mono);border-radius:7px;max-height:240px;margin:0 6px 6px 22px;padding:8px 10px;font-size:11px;line-height:1.4;overflow-x:auto}.insp-legend{border-top:1px solid var(--line);flex-wrap:wrap;gap:6px 12px;padding:8px 14px;display:flex}.insp-leg{color:var(--muted);align-items:center;gap:5px;font-size:11px;display:flex}.mhead .ag2toggle{font-family:var(--mono);border:1px solid var(--line);background:var(--surface);color:var(--muted);border-radius:var(--radius-sm);cursor:pointer;transition:all var(--dur-base) var(--ease-out);align-items:center;gap:6px;padding:5px 10px;font-size:12px;display:inline-flex}.mhead .ag2toggle:hover{border-color:color-mix(in srgb, var(--accent) 45%, var(--line));color:var(--accent)}.mhead .ag2toggle.on{background:var(--accent-soft);color:var(--accent);border-color:var(--accent-border)}.ag2tag{font-family:var(--mono);color:var(--accent);opacity:.85;margin:-6px 0 10px;padding-left:2px;font-size:10.5px}.ag2tag.right{text-align:right;padding-right:2px}.ag2tag.applayer{color:var(--muted)}.ag2-rise:has(>.bs) .ag2tag{margin:6px 0 10px}.modal.poweredby{width:min(640px,94vw);max-height:86vh}.poweredby .setsec{text-transform:uppercase;letter-spacing:1px;color:var(--muted);margin:10px 0 2px;font-size:11px}.poweredby .pbscroll{flex-direction:column;gap:4px;display:flex;overflow-y:auto}.poweredby .pbrow{align-items:flex-start;gap:9px;padding:5px 2px;display:flex}.poweredby .pbrow .insp-dot{margin-top:5px}.poweredby .pbname{font-family:var(--mono);color:var(--ink);font-size:13px}.poweredby .pbwhat{color:var(--muted);font-size:12.5px;line-height:1.4}.poweredby .mfoot{justify-content:flex-end;align-items:center;gap:10px;margin-top:6px;display:flex}.poweredby .mfoot .open{text-decoration:none}.poweredby .mfoot .pbver{color:var(--muted);font-variant-numeric:tabular-nums;margin-right:auto;font-size:12px}.poweredby .pbback{cursor:pointer;font:inherit;font-size:var(--text-xs);font-weight:var(--fw-semibold);color:var(--text-muted);background:0 0;border:none;align-self:flex-start;align-items:center;gap:3px;margin:0 0 -4px -4px;padding:4px;display:inline-flex}.poweredby .pbback:hover{color:var(--accent)}.poweredby .pbback:focus-visible{box-shadow:var(--focus-ring);border-radius:var(--radius-sm);outline:none}.dfoot{gap:6px;display:flex}.dfoot .settingsbtn{text-align:center;flex:1;justify-content:center;width:auto}.usagehud{color:var(--muted);border-top:1px solid var(--line);cursor:default;align-items:center;gap:6px;padding:6px 12px;font-size:11.5px;display:flex}.usagehud .uhicon{align-items:center;display:inline-flex}.usagehud .uhlabel{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.spin.svelte-13so817{animation:1s linear infinite svelte-13so817-spin}@keyframes svelte-13so817-spin{to{transform:rotate(360deg)}}.appearance.svelte-1sms2nq{flex-direction:column;gap:8px;display:flex}.ap-label.svelte-1sms2nq{font-size:var(--text-xs);text-transform:uppercase;letter-spacing:var(--tracking-eyebrow);color:var(--text-muted)}.ap-themes.svelte-1sms2nq{gap:8px;display:flex}.ap-theme.svelte-1sms2nq{cursor:pointer;border:1px solid var(--line);background:var(--surface);color:var(--text-muted);border-radius:var(--radius-sm);font:inherit;font-size:var(--text-sm);font-weight:var(--fw-medium);transition:border-color var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out), background var(--dur-fast) var(--ease-out);align-items:center;gap:6px;padding:7px 14px;display:inline-flex}.ap-theme.svelte-1sms2nq:hover{border-color:var(--accent);color:var(--accent)}.ap-theme.on.svelte-1sms2nq{border-color:var(--accent);background:var(--accent-soft);color:var(--accent)}.pf.svelte-5uf3hr{flex-direction:column;gap:16px;display:flex}.pf-field.svelte-5uf3hr{flex-direction:column;gap:6px;display:flex}.pf-flabel.svelte-5uf3hr{align-items:baseline;gap:8px;display:flex}.pf-flabel.svelte-5uf3hr>span:where(.svelte-5uf3hr):first-child{font-size:var(--text-sm);font-weight:var(--fw-semibold)}.hint.svelte-5uf3hr{font-size:var(--text-xs);color:var(--text-muted)}.pf-input.svelte-5uf3hr{background:var(--surface-sunk);border:1px solid var(--line);border-radius:var(--radius-sm);color:var(--text-muted);transition:border-color var(--dur-fast) var(--ease-out), box-shadow var(--dur-fast) var(--ease-out);align-items:center;gap:9px;padding:0 12px;display:flex}.pf-input.svelte-5uf3hr:focus-within{border-color:var(--accent);box-shadow:var(--focus-ring)}.pf-input.svelte-5uf3hr input:where(.svelte-5uf3hr){min-width:0;color:var(--text);font:inherit;font-size:var(--text-sm);background:0 0;border:none;outline:none;flex:1;padding:11px 0}.pf-dots.svelte-5uf3hr{flex-wrap:wrap;gap:10px;padding:4px;display:flex}.pf-dot.svelte-5uf3hr{cursor:pointer;border-radius:var(--radius-pill);background:var(--dot);color:#fff;width:30px;height:30px;transition:transform var(--dur-fast) var(--ease-out), box-shadow var(--dur-fast) var(--ease-out);border:2px solid #0000;flex:none;justify-content:center;align-items:center;display:inline-flex}.pf-dot.svelte-5uf3hr:hover{transform:scale(1.08)}.pf-dot.on.svelte-5uf3hr{box-shadow:0 0 0 2px var(--bg), 0 0 0 4px var(--dot)}.pf-custom.svelte-5uf3hr{padding:0;position:relative;overflow:hidden}.pf-custom.rainbow.svelte-5uf3hr{background:conic-gradient(from 90deg,#f95339,#ec5d18,#e0b400,#2f8c44,#109e91,#2f6fe0,#7a52ec,#f95339)}.pf-custom.rainbow.on.svelte-5uf3hr{box-shadow:0 0 0 2px var(--bg), 0 0 0 4px var(--accent)}.pf-custom.svelte-5uf3hr input:where(.svelte-5uf3hr){opacity:0;cursor:pointer;background:0 0;border:none;width:100%;height:100%;padding:0;position:absolute;inset:0}.pf-hex.svelte-5uf3hr{font-size:var(--text-xs);color:var(--text-muted);font-variant-numeric:tabular-nums;letter-spacing:.02em;margin-top:2px}.pf-error.svelte-5uf3hr{font-size:var(--text-sm);color:var(--danger,#e53c20);align-items:center;gap:6px;display:flex}.pf-actions.svelte-5uf3hr{justify-content:flex-end;align-items:center;gap:10px;margin-top:4px;display:flex}.pf-btn.svelte-5uf3hr{cursor:pointer;border:1px solid var(--line-strong);border-radius:var(--radius-sm);font:inherit;font-size:var(--text-sm);font-weight:var(--fw-semibold);transition:background var(--dur-fast) var(--ease-out), border-color var(--dur-fast) var(--ease-out);justify-content:center;align-items:center;gap:7px;padding:10px 18px;display:inline-flex}.pf-btn.primary.svelte-5uf3hr{background:var(--surface);color:var(--text)}.pf-btn.primary.svelte-5uf3hr:hover{background:var(--surface-hover);border-color:var(--accent-border)}.pf-btn.primary.svelte-5uf3hr:focus-visible{box-shadow:var(--focus-ring);outline:none}.pf-btn.primary.svelte-5uf3hr:disabled{opacity:.5;cursor:default}.pf-btn.ghost.svelte-5uf3hr{color:var(--text-muted);background:0 0;border-color:#0000}.pf-btn.ghost.svelte-5uf3hr:hover{background:var(--surface-hover);color:var(--text)}.pf-btn.ghost.svelte-5uf3hr:focus-visible{box-shadow:var(--focus-ring);outline:none}.onb.svelte-13krnjv{z-index:100;background:var(--bg);color:var(--text);font-family:var(--font-sans);animation:ag2-fade var(--dur-base) var(--ease-out) both;display:flex;position:fixed;inset:0}.onb-hero.svelte-13krnjv{background:var(--accent-soft);border-right:1px solid var(--line);flex-direction:column;flex:none;width:42%;padding:48px 44px;display:flex;overflow:hidden}.onb-brand.svelte-13krnjv{align-items:center;gap:12px;display:flex}.onb-brandname.svelte-13krnjv{font-family:var(--font-display);font-weight:var(--fw-bold);font-size:var(--text-2xl)}.onb-herobody.svelte-13krnjv{margin-top:40px}.onb-herobody.svelte-13krnjv h1:where(.svelte-13krnjv){font-size:var(--text-4xl);line-height:var(--leading-tight)}.onb-herobody.svelte-13krnjv p:where(.svelte-13krnjv){font-size:var(--text-md);color:var(--text-muted);line-height:var(--leading-normal);max-width:34ch;margin-top:14px}.onb-features.svelte-13krnjv{flex-direction:column;gap:18px;margin-top:auto;display:flex}.onb-feature.svelte-13krnjv{align-items:flex-start;gap:12px;display:flex}.onb-featicon.svelte-13krnjv{border-radius:var(--radius-sm);background:var(--surface);border:1px solid var(--line);width:34px;height:34px;color:var(--accent);flex:none;justify-content:center;align-items:center;display:inline-flex}.onb-feattitle.svelte-13krnjv{font-size:var(--text-sm);font-weight:var(--fw-bold)}.onb-featdesc.svelte-13krnjv{font-size:var(--text-sm);color:var(--text-muted);line-height:var(--leading-snug)}.onb-main.svelte-13krnjv{flex-direction:column;flex:1;min-width:0;display:flex}.onb-stepper.svelte-13krnjv{flex-wrap:wrap;align-items:center;gap:8px;padding:26px 44px 0;display:flex}.onb-stepitem.svelte-13krnjv{align-items:center;gap:7px;display:flex}.onb-stepnum.svelte-13krnjv{border-radius:var(--radius-pill);width:22px;height:22px;font-size:var(--text-xs);font-weight:var(--fw-bold);background:var(--surface-sunk);color:var(--text-faint);border:1px solid var(--line);transition:all var(--dur-base) var(--ease-out);flex:none;justify-content:center;align-items:center;display:inline-flex}.onb-stepnum.on.svelte-13krnjv{background:var(--accent);color:var(--text-on-accent);border-color:var(--accent)}.onb-steplabel.svelte-13krnjv{font-size:var(--text-xs);font-weight:var(--fw-semibold);color:var(--text-muted)}.onb-stepitem.active.svelte-13krnjv .onb-steplabel:where(.svelte-13krnjv){color:var(--text)}.onb-stepline.svelte-13krnjv{background:var(--line);width:18px;height:1px}.onb-body.svelte-13krnjv{flex-direction:column;flex:1;padding:32px 44px;display:flex;overflow-y:auto}.onb-body.center.svelte-13krnjv{justify-content:center}.onb-step.svelte-13krnjv{flex-direction:column;gap:16px;max-width:52ch;display:flex}.onb-step.svelte-13krnjv h2:where(.svelte-13krnjv){font-size:var(--text-2xl)}.onb-step.svelte-13krnjv h2.big:where(.svelte-13krnjv){font-size:var(--text-3xl)}.onb-step.svelte-13krnjv .lead:where(.svelte-13krnjv){font-size:var(--text-md);color:var(--text-muted);line-height:var(--leading-normal);margin:-6px 0 0}.onb-field.svelte-13krnjv{flex-direction:column;gap:6px;display:flex}.onb-flabel.svelte-13krnjv{align-items:baseline;gap:8px;display:flex}.onb-flabel.svelte-13krnjv>span:where(.svelte-13krnjv):first-child{font-size:var(--text-sm);font-weight:var(--fw-semibold)}.onb-flabel.svelte-13krnjv .hint:where(.svelte-13krnjv),.hint.svelte-13krnjv{font-size:var(--text-xs);color:var(--text-muted)}.hint.warn.svelte-13krnjv{color:var(--danger)}.onb-input.svelte-13krnjv{background:var(--surface-sunk);border:1px solid var(--line);border-radius:var(--radius-sm);color:var(--text-muted);transition:border-color var(--dur-fast) var(--ease-out), box-shadow var(--dur-fast) var(--ease-out);align-items:center;gap:9px;padding:0 12px;display:flex}.onb-input.svelte-13krnjv:focus-within{border-color:var(--accent);box-shadow:var(--focus-ring)}.onb-input.svelte-13krnjv input:where(.svelte-13krnjv){min-width:0;color:var(--text);font:inherit;font-size:var(--text-sm);background:0 0;border:none;outline:none;flex:1;padding:11px 0}.onb-pills.svelte-13krnjv{flex-wrap:wrap;gap:8px;display:flex}.onb-pill.svelte-13krnjv{cursor:pointer;border-radius:var(--radius-pill);border:1.5px solid var(--line);background:var(--surface);color:var(--text);font:inherit;font-size:var(--text-sm);font-weight:var(--fw-semibold);transition:all var(--dur-fast) var(--ease-out);align-items:center;gap:6px;padding:7px 14px;display:inline-flex}.onb-pill.svelte-13krnjv:hover{border-color:var(--accent)}.onb-pill.on.svelte-13krnjv{border-color:var(--accent);background:var(--accent-soft);color:var(--accent)}.onb-tabs.svelte-13krnjv{border-radius:var(--radius-sm);background:var(--surface-sunk);border:1px solid var(--line);gap:2px;padding:3px;display:flex}.onb-tab.svelte-13krnjv{cursor:pointer;white-space:nowrap;text-overflow:ellipsis;border-radius:calc(var(--radius-sm) - 2px);min-width:0;color:var(--text-muted);font:inherit;font-size:var(--text-xs);font-weight:var(--fw-semibold);transition:all var(--dur-fast) var(--ease-out);background:0 0;border:none;flex:auto;padding:8px;overflow:hidden}.onb-tab.svelte-13krnjv:hover{color:var(--accent)}.onb-tab.on.svelte-13krnjv{background:var(--surface);color:var(--accent);box-shadow:var(--shadow-sm)}.onb-tabpanel.svelte-13krnjv{flex-direction:column;gap:16px;display:flex}.onb-chips.svelte-13krnjv{flex-wrap:wrap;gap:8px;display:flex}.onb-chip.svelte-13krnjv{border-radius:var(--radius-pill);border:1px solid var(--line);background:var(--surface);font-size:var(--text-sm);font-weight:var(--fw-semibold);align-items:center;gap:7px;padding:5px 12px 5px 10px;display:inline-flex}.onb-chipdot.svelte-13krnjv{border-radius:var(--radius-pill);background:var(--dot,var(--accent));width:10px;height:10px}.onb-loopactions.svelte-13krnjv{align-items:center;gap:10px;display:flex}.onb-btn.svelte-13krnjv{cursor:pointer;border:1px solid var(--line-strong);border-radius:var(--radius-sm);font:inherit;font-size:var(--text-sm);font-weight:var(--fw-semibold);transition:background var(--dur-fast) var(--ease-out), border-color var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out);justify-content:center;align-items:center;gap:7px;padding:9px 16px;display:inline-flex}.onb-btn.lg.svelte-13krnjv{font-size:var(--text-base);padding:11px 20px}.onb-btn.primary.svelte-13krnjv{background:var(--surface);color:var(--text)}.onb-btn.primary.svelte-13krnjv:hover{background:var(--surface-hover);border-color:var(--accent-border)}.onb-btn.primary.svelte-13krnjv:focus-visible{box-shadow:var(--focus-ring);outline:none}.onb-btn.primary.svelte-13krnjv:disabled{opacity:.5;cursor:default}.onb-btn.ghost.svelte-13krnjv{color:var(--text-muted);box-shadow:none;background:0 0;border-color:#0000}.onb-btn.ghost.svelte-13krnjv:hover{color:var(--accent)}.onb-welcomeactions.svelte-13krnjv{gap:10px;margin-top:4px;display:flex}.onb-readyhead.svelte-13krnjv{align-items:center;gap:14px;display:flex}.onb-readytick.svelte-13krnjv{border-radius:var(--radius-pill);background:var(--accent-soft);width:52px;height:52px;color:var(--accent);border:1px solid var(--accent-border);flex:none;justify-content:center;align-items:center;display:inline-flex}.onb-summary.svelte-13krnjv{background:var(--surface-sunk);border:1px solid var(--line);border-radius:var(--radius-md);flex-direction:column;gap:12px;padding:16px;display:flex}.onb-sumrow.svelte-13krnjv{align-items:center;gap:10px;display:flex}.onb-sumicon.svelte-13krnjv{color:var(--accent);display:inline-flex}.onb-sumkey.svelte-13krnjv{width:64px;font-size:var(--text-sm);color:var(--text-muted);flex:none}.onb-sumval.svelte-13krnjv{font-size:var(--text-sm);color:var(--text);flex:1}.onb-optionalhead.svelte-13krnjv{align-items:center;gap:10px;display:flex}.onb-optional.svelte-13krnjv{font-size:var(--text-xs);font-weight:var(--fw-semibold);color:var(--text-muted);background:var(--surface-sunk);border:1px solid var(--line);border-radius:var(--radius-pill);padding:3px 10px}.onb-setuphead.svelte-13krnjv{align-items:center;gap:10px;display:flex}.onb-setupdot.svelte-13krnjv{border-radius:var(--radius-pill);background:var(--dot,var(--accent));flex:none;width:12px;height:12px}.onb-setupprog.svelte-13krnjv{font-size:var(--text-xs);font-weight:var(--fw-semibold);color:var(--text-muted);background:var(--surface-sunk);border:1px solid var(--line);border-radius:var(--radius-pill);margin-left:auto;padding:3px 10px}.onb-profrow.svelte-13krnjv{align-items:flex-start;gap:10px;display:flex}.onb-profdot.svelte-13krnjv{border-radius:var(--radius-pill);background:var(--dot,var(--accent));flex:none;width:10px;height:10px;margin-top:4px}.onb-profname.svelte-13krnjv{width:96px;font-size:var(--text-sm);font-weight:var(--fw-semibold);flex:none}.onb-profmeta.svelte-13krnjv{flex-direction:column;flex:1;gap:3px;min-width:0;display:flex}.onb-profmetaitem.svelte-13krnjv{font-size:var(--text-sm);color:var(--text-muted);overflow-wrap:anywhere;align-items:flex-start;gap:6px;min-width:0;display:flex}.onb-profmetaitem.cap.svelte-13krnjv{text-transform:capitalize}.onb-profmetaitem.svelte-13krnjv svg{color:var(--accent);flex:none;margin-top:3px}.onb-tip.svelte-13krnjv{font-size:var(--text-xs);color:var(--text-muted);align-items:center;gap:8px;display:flex}.onb-tip.svelte-13krnjv b:where(.svelte-13krnjv){color:var(--text)}.onb-nav.svelte-13krnjv{border-top:1px solid var(--line);align-items:center;gap:10px;padding:18px 44px;display:flex}.onb-navright.svelte-13krnjv{align-items:center;gap:12px;margin-left:auto;display:flex}@media (width<=760px){.onb-hero.svelte-13krnjv{display:none}}.sw3ctl.svelte-abh25a{align-items:center;gap:10px;display:inline-flex}.sw3.svelte-abh25a{cursor:pointer;background:color-mix(in srgb, var(--accent) 20%, var(--surface));width:66px;height:22px;box-shadow:inset 0 0 0 1px color-mix(in srgb, var(--accent) 32%, var(--line));transition:background var(--dur-fast) var(--ease-out), box-shadow var(--dur-fast) var(--ease-out);border:none;border-radius:999px;flex:none;padding:0;position:relative}.sw3.rw.svelte-abh25a{background:color-mix(in srgb, var(--warning) 20%, var(--surface));box-shadow:inset 0 0 0 1px color-mix(in srgb, var(--warning) 32%, var(--line))}.sw3.off.svelte-abh25a{background:color-mix(in srgb, var(--ink) 5%, var(--surface));box-shadow:inset 0 0 0 1px var(--line)}.sw3.svelte-abh25a:disabled{cursor:default}.sw3dot.svelte-abh25a{background:color-mix(in srgb, var(--ink) 30%, transparent);z-index:1;border-radius:50%;width:4px;height:4px;margin:-2px 0 0 -2px;position:absolute;top:50%}.sw3knob.svelte-abh25a{width:18px;height:18px;transition:transform var(--dur-fast) var(--ease-out);z-index:2;background:#fff;border-radius:50%;position:absolute;top:2px;left:2px;box-shadow:0 1px 2px #0000004d}.sw3[data-pos="1"].svelte-abh25a .sw3knob:where(.svelte-abh25a){transform:translate(22px)}.sw3[data-pos="2"].svelte-abh25a .sw3knob:where(.svelte-abh25a){transform:translate(44px)}.sw3label.svelte-abh25a{text-align:right;min-width:74px;font-size:13px}.sw3label.muted.svelte-abh25a{color:var(--text-muted)}.wsctl.svelte-u1g0df{align-items:center;gap:10px;display:inline-flex}.wslabel.svelte-u1g0df{text-align:right;min-width:74px;font-size:13px}.ws.svelte-u1g0df{cursor:pointer;background:color-mix(in srgb, var(--success) 20%, var(--surface));width:38px;height:22px;box-shadow:inset 0 0 0 1px color-mix(in srgb, var(--success) 32%, var(--line));transition:background var(--dur-fast) var(--ease-out), box-shadow var(--dur-fast) var(--ease-out);border:none;border-radius:999px;flex:none;padding:0;position:relative}.ws.svelte-u1g0df:after{content:"";width:18px;height:18px;transition:transform var(--dur-fast) var(--ease-out);background:#fff;border-radius:50%;position:absolute;top:2px;left:2px;box-shadow:0 1px 2px #0000004d}.ws.on.svelte-u1g0df{background:color-mix(in srgb, var(--warning) 20%, var(--surface));box-shadow:inset 0 0 0 1px color-mix(in srgb, var(--warning) 32%, var(--line))}.ws.on.svelte-u1g0df:after{transform:translate(16px)}.ws.svelte-u1g0df:disabled{cursor:default}h2.svelte-1qjwdk7{padding-right:34px}.hint.svelte-1qjwdk7{margin:0 0 10px;font-size:12px}.errline.svelte-1qjwdk7{color:var(--danger);font-size:13px}.cfsec.svelte-1qjwdk7{text-transform:uppercase;letter-spacing:1px;color:var(--text-muted);margin:16px 0 6px;font-size:11px}.cfrow.svelte-1qjwdk7{align-items:center;gap:10px;padding:8px 0;display:flex}.cfrow.svelte-1qjwdk7+.cfrow:where(.svelte-1qjwdk7){border-top:1px solid var(--line)}.cfico.svelte-1qjwdk7{color:var(--text-muted);flex:none;display:inline-flex}.cfname.svelte-1qjwdk7{text-overflow:ellipsis;white-space:nowrap;flex:1;min-width:0;font-size:13px;overflow:hidden}.cfctl.svelte-1qjwdk7{flex:none;align-items:center;gap:10px;display:inline-flex}.cfmenuwrap.svelte-1qjwdk7{flex:none;position:relative}.cfkebab.svelte-1qjwdk7{cursor:pointer;color:var(--text-muted);background:0 0;border:none;border-radius:6px;padding:2px 7px;font-size:17px;line-height:1}.cfkebab.svelte-1qjwdk7:hover{color:var(--ink);background:var(--code)}.cfkebab.svelte-1qjwdk7:disabled{cursor:default}.cfscrim.svelte-1qjwdk7{z-index:40;position:fixed;inset:0}.cfmenu.svelte-1qjwdk7{z-index:41;background:var(--surface);border:1px solid var(--line);border-radius:10px;flex-direction:column;gap:2px;min-width:170px;margin-top:5px;padding:5px;display:flex;position:absolute;top:100%;right:0;box-shadow:0 10px 28px #00000047}.cfmenu.svelte-1qjwdk7 button:where(.svelte-1qjwdk7){text-align:left;width:100%;font:inherit;color:var(--ink);cursor:pointer;background:0 0;border:none;border-radius:7px;align-items:center;gap:9px;padding:8px 10px;font-size:13px;display:flex}.cfmenu.svelte-1qjwdk7 button:where(.svelte-1qjwdk7):hover{background:var(--code)}.cfmenu.svelte-1qjwdk7 button.danger:where(.svelte-1qjwdk7){color:var(--danger)}.ftwrap.svelte-evfy7n{flex-direction:column;flex:1;min-height:0;display:flex}.fttoolbar.svelte-evfy7n{border-bottom:1px solid var(--line);align-items:center;gap:2px;padding:6px 8px;display:flex}.fttool.svelte-evfy7n{width:28px;height:28px;color:var(--muted);cursor:pointer;background:0 0;border:none;border-radius:7px;justify-content:center;align-items:center;display:inline-flex}.fttool.svelte-evfy7n:hover{color:var(--text);background:var(--code)}.ftspacer.svelte-evfy7n{flex:1}.ftsel.svelte-evfy7n{text-overflow:ellipsis;white-space:nowrap;max-width:60%;font-family:var(--mono);color:var(--accent);font-size:11px;overflow:hidden}.fterr.svelte-evfy7n{color:var(--danger);margin:6px 8px 0;font-size:12px}.ftlink.svelte-evfy7n{color:var(--accent);font:inherit;cursor:pointer;background:0 0;border:none;padding:0;font-size:12px}.ftlink.svelte-evfy7n:hover{text-decoration:underline}.ftlink.danger.svelte-evfy7n{color:var(--muted)}.ftlink.danger.svelte-evfy7n:hover{color:var(--danger)}.ftlink.danger.svelte-evfy7n:disabled{cursor:default;opacity:.6}.fttree.svelte-evfy7n{flex:1;min-height:0;padding:4px 0;overflow-y:auto}.fttree.droproot.svelte-evfy7n{outline:2px dashed var(--accent);outline-offset:-3px;border-radius:6px}.ftrow.svelte-evfy7n{cursor:pointer;color:var(--text);-webkit-user-select:none;user-select:none;align-items:center;gap:6px;padding:4px 8px 4px 4px;display:flex;position:relative}.ftrow.svelte-evfy7n:hover{background:var(--surface-hover,var(--code))}.ftdir.selected.svelte-evfy7n{background:color-mix(in srgb, var(--accent) 16%, transparent)}.ftrow.active.svelte-evfy7n{background:var(--accent-soft);box-shadow:inset 2px 0 0 var(--accent)}.ftrow.drop.svelte-evfy7n{outline:2px dashed var(--accent);outline-offset:-2px;border-radius:6px}.ftcaret.svelte-evfy7n{width:16px;height:16px;color:var(--muted);cursor:pointer;background:0 0;border:none;border-radius:4px;flex:none;justify-content:center;align-items:center;margin-left:-2px;display:inline-flex}.ftcaret.svelte-evfy7n:hover{color:var(--text)}.ftname.svelte-evfy7n{text-overflow:ellipsis;white-space:nowrap;flex:1;min-width:0;font-size:13px;overflow:hidden}.ftfile.svelte-evfy7n .ftname:where(.svelte-evfy7n){font-family:var(--mono)}.ftmeta.svelte-evfy7n{color:var(--muted);white-space:nowrap;flex:none;font-size:11px}.ftinput.svelte-evfy7n{min-width:0;font:inherit;border:1px solid var(--accent);background:var(--surface);color:var(--text);border-radius:5px;flex:1;padding:1px 5px;font-size:13px}.ftconfirm.svelte-evfy7n{flex:none;align-items:center;gap:7px;margin-left:auto;display:inline-flex}.ftconfirm.svelte-evfy7n .confirm:where(.svelte-evfy7n){color:var(--danger);white-space:nowrap;font-size:12px}.ftkebab.svelte-evfy7n{width:22px;height:22px;color:var(--muted);opacity:0;cursor:pointer;background:0 0;border:none;border-radius:5px;flex:none;justify-content:center;align-items:center;margin-left:auto;display:inline-flex}.ftrow.svelte-evfy7n:hover .ftkebab:where(.svelte-evfy7n),.ftrow.svelte-evfy7n:focus-within .ftkebab:where(.svelte-evfy7n){opacity:.55}.ftkebab.svelte-evfy7n:hover{opacity:1;color:var(--text)}.ftmenu.svelte-evfy7n{z-index:var(--z-modal);background:var(--surface);border:1px solid var(--line);min-width:150px;box-shadow:var(--shadow,0 8px 28px #0000002e);border-radius:10px;padding:5px;position:fixed}.ftmitem.svelte-evfy7n{width:100%;color:var(--text);font:inherit;text-align:left;cursor:pointer;background:0 0;border:none;border-radius:6px;align-items:center;gap:8px;padding:7px 9px;font-size:13px;text-decoration:none;display:flex}.ftmitem.svelte-evfy7n:hover{background:var(--surface-hover,var(--code))}.ftmitem.danger.svelte-evfy7n{color:var(--danger)}.ftmdiv.svelte-evfy7n{background:var(--line);height:1px;margin:4px 6px}.ftmuted.svelte-evfy7n{color:var(--muted);padding:8px 12px;font-size:13px}.ftempty.svelte-evfy7n{line-height:1.5}.ftsection.svelte-evfy7n{border-top:1px solid var(--line);color:var(--muted);text-transform:uppercase;letter-spacing:.04em;margin:8px 8px 2px;padding-top:8px;font-size:10.5px;font-weight:600}.ftfolder.missing.svelte-evfy7n{color:var(--muted)}.ftfolder.missing.svelte-evfy7n .ftcaret:where(.svelte-evfy7n){opacity:.4;cursor:default}.ftbadge.svelte-evfy7n{background:var(--code);color:var(--muted);font-size:10px;font-family:var(--mono);white-space:nowrap;border-radius:999px;flex:none;margin-left:auto;padding:1px 6px}.ftbadge.rw.svelte-evfy7n{background:color-mix(in srgb, var(--accent) 18%, transparent);color:var(--accent)}.ftbadge.warn.svelte-evfy7n{background:color-mix(in srgb, var(--danger) 16%, transparent);color:var(--danger);margin-left:6px}.ftcaption.svelte-evfy7n{border-top:1px solid var(--line);color:var(--muted);font-family:var(--mono);text-overflow:ellipsis;white-space:nowrap;flex:none;margin:0;padding:6px 10px;font-size:10.5px;overflow:hidden}.profchips.svelte-ledzjv{align-items:center;gap:10px;min-width:0;padding:10px 16px;display:flex;position:relative}.chiprow.svelte-ledzjv{flex:none;align-items:center;gap:6px;display:flex}.chip.svelte-ledzjv{border-radius:var(--radius-pill);cursor:pointer;width:28px;height:28px;font:inherit;font-size:var(--text-xs);font-weight:var(--fw-bold);background:var(--surface);color:var(--p,var(--accent));border:1.5px solid var(--p,var(--accent));transition:transform var(--dur-fast) var(--ease-out), box-shadow var(--dur-fast) var(--ease-out);flex:none;justify-content:center;align-items:center;line-height:1;display:inline-flex;position:relative}.chip.svelte-ledzjv:hover{transform:translateY(-1px)}.chip.svelte-ledzjv:focus-visible{box-shadow:0 0 0 3px color-mix(in srgb, var(--p,var(--accent)) 35%, transparent);outline:none}.chip.active.svelte-ledzjv{background:var(--p,var(--accent));color:var(--p-ink,var(--text-on-accent));cursor:default;border-color:var(--p,var(--accent));box-shadow:inset 0 0 0 2px var(--surface)}.chip.more.svelte-ledzjv{color:var(--muted);border-color:var(--line);background:var(--surface);font-weight:var(--fw-semibold)}.chip.more.svelte-ledzjv:hover{color:var(--text);border-color:var(--text)}.chip.more.active.svelte-ledzjv{color:var(--text)}.chip.add.svelte-ledzjv{color:var(--muted);border-style:dashed;border-color:var(--line);background:var(--surface)}.chip.add.svelte-ledzjv:hover{color:var(--text);border-color:var(--text)}.mono.svelte-ledzjv{pointer-events:none}.actdot.svelte-ledzjv{border-radius:var(--radius-pill);background:var(--warning);border:1.5px solid var(--surface);width:8px;height:8px;position:absolute;top:-1px;right:-1px}.actdot.inmenu.svelte-ledzjv{border-color:var(--surface);margin-left:auto;position:static}.activename.svelte-ledzjv{text-overflow:ellipsis;white-space:nowrap;min-width:0;font-size:var(--text-sm);font-weight:var(--fw-semibold);color:var(--text);overflow:hidden}.profdot.svelte-ledzjv{border-radius:var(--radius-pill);background:var(--dot,var(--accent));flex:none;width:8px;height:8px}.profname.svelte-ledzjv{text-overflow:ellipsis;white-space:nowrap;font-weight:var(--fw-medium);overflow:hidden}.profmenu.svelte-ledzjv{z-index:var(--z-modal);background:var(--surface-elevated);border:1px solid var(--line);border-radius:var(--radius-sm);min-width:150px;max-width:220px;box-shadow:var(--shadow-lg);flex-direction:column;padding:4px;display:flex;position:absolute;top:calc(100% - 4px);left:16px}.profitem.svelte-ledzjv{cursor:pointer;text-align:left;width:100%;font:inherit;font-size:var(--text-xs);color:var(--text);border-radius:var(--radius-xs,6px);transition:background var(--dur-fast) var(--ease-out);background:0 0;border:none;align-items:center;gap:8px;padding:6px 8px;display:flex}.profitem.svelte-ledzjv:hover{background:var(--surface-hover)}.profitem.svelte-ledzjv .profname:where(.svelte-ledzjv){font-weight:var(--fw-medium);flex:1}.profitem.active.svelte-ledzjv{color:var(--muted);cursor:default}.profitem.active.svelte-ledzjv:hover{background:0 0}.profitem.svelte-ledzjv svg{opacity:.7;flex:none}.profcreate.svelte-ledzjv{width:min(460px,92vw)}.pc-lead.svelte-ledzjv{font-size:var(--text-sm);color:var(--text-muted);line-height:var(--leading-normal);margin:-2px 0 6px}.datesep.svelte-ledzjv{letter-spacing:.3px;color:var(--muted);text-transform:uppercase;margin:10px 0 2px;padding:2px 8px;font-size:11px;font-weight:600}.datesep.svelte-ledzjv:first-child{margin-top:2px}.chatrow.svelte-ledzjv{align-items:center;gap:8px;display:flex}.clabel.svelte-ledzjv{text-overflow:ellipsis;white-space:nowrap;flex:1;min-width:0;overflow:hidden}.originbadge.svelte-ledzjv{white-space:nowrap;color:var(--text-muted);flex:none;align-items:center;display:inline-flex}.originbadge.live.svelte-ledzjv{color:color-mix(in srgb, var(--success) 78%, var(--text));border-color:color-mix(in srgb, var(--success) 40%, var(--line))}.originbadge.live.svelte-ledzjv:before{content:"";background:var(--success);border-radius:50%;width:6px;height:6px;margin-right:4px;display:inline-block}.rowtime.svelte-ledzjv{color:var(--text-faint);font-variant-numeric:tabular-nums;white-space:nowrap;flex:none;font-size:11px}.chatrow.svelte-ledzjv:hover .rowtime:where(.svelte-ledzjv),.chatrow.svelte-ledzjv:focus-within .rowtime:where(.svelte-ledzjv),.ttask.svelte-ledzjv:hover .rowtime:where(.svelte-ledzjv),.ttask.svelte-ledzjv:focus-within .rowtime:where(.svelte-ledzjv){display:none}.lastrun.failed.svelte-ledzjv{color:var(--danger)}.lastrun.needs_input.svelte-ledzjv{color:var(--accent)}.rowconfirm.svelte-ledzjv{flex:none;align-items:center;gap:7px;display:inline-flex}.rowconfirm.svelte-ledzjv .confirm:where(.svelte-ledzjv){color:var(--danger);font-size:12px}.rowconfirm.svelte-ledzjv .linkbtn:where(.svelte-ledzjv){font:inherit;cursor:pointer;color:var(--accent);background:0 0;border:none;padding:0;font-size:12px}.rowconfirm.svelte-ledzjv .linkbtn:where(.svelte-ledzjv):hover{text-decoration:underline}.rowconfirm.svelte-ledzjv .linkbtn.danger:where(.svelte-ledzjv){color:var(--muted)}.rowconfirm.svelte-ledzjv .linkbtn.danger:where(.svelte-ledzjv):hover{color:var(--danger)}.rowconfirm.svelte-ledzjv .linkbtn.danger:where(.svelte-ledzjv):disabled{cursor:default;opacity:.6}.rowkebab.svelte-ledzjv{color:var(--muted);cursor:pointer;opacity:0;width:0;transition:opacity var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out);background:0 0;border:none;border-radius:6px;flex:none;justify-content:center;align-items:center;padding:2px;display:inline-flex;overflow:hidden}.chatrow.svelte-ledzjv:hover .rowkebab:where(.svelte-ledzjv),.chatrow.svelte-ledzjv:focus-within .rowkebab:where(.svelte-ledzjv),.ttask.svelte-ledzjv:hover .rowkebab:where(.svelte-ledzjv),.ttask.svelte-ledzjv:focus-within .rowkebab:where(.svelte-ledzjv){opacity:.55;width:auto}.rowkebab[aria-expanded=true].svelte-ledzjv{width:auto;color:var(--text);opacity:1!important}.rowkebab.svelte-ledzjv:hover{opacity:1;color:var(--text)}.chatmenu.svelte-ledzjv{z-index:var(--z-modal);background:var(--surface-elevated);border:1px solid var(--line);border-radius:var(--radius-sm);min-width:150px;box-shadow:var(--shadow-lg);flex-direction:column;padding:4px;display:flex;position:fixed;transform:translate(-100%)}.cmitem.svelte-ledzjv{width:100%;font:inherit;font-size:var(--text-xs);color:var(--text);border-radius:var(--radius-xs,6px);cursor:pointer;text-align:left;background:0 0;border:none;align-items:center;gap:8px;padding:6px 8px;display:flex}.cmitem.svelte-ledzjv:hover{background:var(--surface-hover)}.cmitem.danger.svelte-ledzjv{color:var(--danger,var(--danger))}.cmitem.danger.svelte-ledzjv:hover{background:color-mix(in srgb, var(--danger,var(--danger)) 12%, transparent)}.cmitem.svelte-ledzjv svg{opacity:.7;flex:none}.cmdiv.svelte-ledzjv{background:var(--line);height:1px;margin:4px 6px}.renamein.svelte-ledzjv{min-width:0;font:inherit;font-size:inherit;color:var(--text);background:var(--surface);border:1px solid var(--accent);border-radius:6px;outline:none;flex:1;padding:1px 6px}.fileref.svelte-1gro5pp{font:inherit;cursor:pointer;background:var(--accent-soft);color:var(--accent);-webkit-box-decoration-break:clone;box-decoration-break:clone;border:0;border-radius:4px;padding:0 2px}.fileref.svelte-1gro5pp:hover{text-decoration:underline}.choice.svelte-29lwde{border:1px solid var(--accent);border-radius:var(--radius-sm,8px);background:color-mix(in srgb, var(--accent) 4%, transparent);border-left-width:3px;margin:12px 0;padding:13px 16px 14px}.choice.resolved.svelte-29lwde{border-color:var(--line);background:0 0}.choice.resolved.svelte-29lwde .cdot:where(.svelte-29lwde){opacity:.4;animation:none}.choice.unanswered.svelte-29lwde{opacity:.72}.choice.unanswered.svelte-29lwde .cdot:where(.svelte-29lwde){background:var(--muted)}.ck.svelte-29lwde{font-family:var(--code,ui-monospace, monospace);letter-spacing:.18em;text-transform:uppercase;color:var(--accent);align-items:center;gap:7px;font-size:9.5px;font-weight:700;display:flex}.choice.resolved.svelte-29lwde .ck:where(.svelte-29lwde){color:var(--muted)}.detail-toggle.svelte-29lwde{color:var(--muted);font-family:var(--code,ui-monospace, monospace);letter-spacing:.04em;cursor:pointer;text-underline-offset:3px;background:0 0;border:none;margin-top:9px;padding:0;font-size:11px;text-decoration:underline}.detail-toggle.svelte-29lwde:hover{color:var(--ink)}.cdot.svelte-29lwde{background:var(--accent);border-radius:50%;width:7px;height:7px;animation:1.6s infinite svelte-29lwde-choice-pulse}@keyframes svelte-29lwde-choice-pulse{0%{box-shadow:0 0 0 0 color-mix(in srgb, var(--accent) 55%, transparent)}70%{box-shadow:0 0 0 7px #0000}to{box-shadow:0 0 #0000}}[data-animations=off] .cdot.svelte-29lwde{animation:none}.cq.svelte-29lwde{font-family:var(--serif,inherit);letter-spacing:-.01em;color:var(--ink);margin-top:7px;font-size:16.5px;font-weight:600;line-height:1.25}.cdetail.svelte-29lwde{background:var(--code);border:1px solid var(--line);white-space:pre-wrap;word-break:break-word;border-radius:8px;max-height:320px;margin:9px 0 0;padding:10px 12px;font-family:ui-monospace,monospace;font-size:12px;line-height:1.5;overflow:auto}.copts.svelte-29lwde{flex-wrap:wrap;gap:7px;margin-top:11px;display:flex}.chip.svelte-29lwde{border:1px solid var(--line);background:var(--bg);color:var(--ink);cursor:pointer;border-radius:999px;padding:7px 15px;font-size:13.5px;font-weight:550;transition:border-color .12s,color .12s,background .12s}.chip.svelte-29lwde:hover:not(:disabled){border-color:var(--accent);color:var(--accent);background:color-mix(in srgb, var(--accent) 6%, transparent)}.chip.svelte-29lwde:disabled{cursor:default;opacity:.45}.chip.picked.svelte-29lwde{opacity:1;border-color:var(--accent);background:var(--accent);color:var(--text-on-accent,#fff)}.cans.svelte-29lwde{font-family:var(--code,ui-monospace, monospace);color:var(--muted);margin-top:9px;font-size:12.5px}.choice.svelte-29lwde input:where(.svelte-29lwde){border:1px solid var(--line);background:var(--bg);width:100%;color:var(--ink);border-radius:8px;margin-top:10px;padding:9px 11px;font-size:13.5px}.choice.svelte-29lwde input:where(.svelte-29lwde):focus{border-color:var(--accent);outline:none}.g.svelte-1oq623z{aspect-ratio:1;height:112%;position:absolute;top:50%;right:2%;transform:translateY(-50%)}.g-sunny.svelte-1oq623z,.g-partly-cloudy.svelte-1oq623z,.g-cloudy.svelte-1oq623z{aspect-ratio:1;height:185%;right:-8%}.g.svelte-1oq623z svg:where(.svelte-1oq623z){width:100%;height:100%;overflow:visible}.sun.svelte-1oq623z{transform-origin:78% 26%;transform-box:view-box;animation:6s ease-in-out infinite svelte-1oq623z-pulse}@keyframes svelte-1oq623z-pulse{0%,to{transform:scale(1)}50%{transform:scale(1.045)}}.cloud.svelte-1oq623z{animation:14s ease-in-out infinite svelte-1oq623z-drift}@keyframes svelte-1oq623z-drift{0%,to{transform:translate(0)}50%{transform:translate(3.5%)}}.fog.svelte-1oq623z{animation:7s ease-in-out infinite svelte-1oq623z-breathe}.fog.f2.svelte-1oq623z{animation-delay:-2.3s}.fog.f3.svelte-1oq623z{animation-delay:-4.6s}@keyframes svelte-1oq623z-breathe{0%,to{opacity:.55}50%{opacity:1}}.rainrot.svelte-1oq623z{transform-origin:50%;transform-box:view-box;transform:rotate(14deg)}.rainfall.svelte-1oq623z{animation:1.1s linear infinite svelte-1oq623z-fall}@keyframes svelte-1oq623z-fall{0%{transform:translateY(0)}to{transform:translateY(60%)}}.bolt.svelte-1oq623z{transform-origin:50%;animation:4.2s linear infinite svelte-1oq623z-flash}@keyframes svelte-1oq623z-flash{0%,86%,96%,to{opacity:0}88%,94%{opacity:1}91%{opacity:.25}}.snowfall.svelte-1oq623z{animation:9s linear infinite svelte-1oq623z-snowfall}@keyframes svelte-1oq623z-snowfall{0%{transform:translateY(0)}to{transform:translateY(100%)}}.windflow.svelte-1oq623z{animation:2.6s linear infinite svelte-1oq623z-stream}.windflow.w2.svelte-1oq623z{animation-duration:3.4s;animation-delay:-1.2s}.windflow.w3.svelte-1oq623z{animation-duration:2.1s;animation-delay:-.6s}@keyframes svelte-1oq623z-stream{0%{transform:translate(-120%)}to{transform:translate(0)}}.wx-banner.svelte-1y4wig5{aspect-ratio:16/6;border-radius:var(--radius-sm,8px);background:linear-gradient(#9fb6cd,#dde7ed);width:100%;max-height:220px;margin-bottom:12px;position:relative;overflow:hidden;container-type:size}.wx-banner.svelte-1y4wig5 canvas:where(.svelte-1y4wig5){width:100%;height:100%;display:block}.wx-flush.svelte-1y4wig5{aspect-ratio:auto;border-radius:0;width:100%;height:100%;max-height:none;margin-bottom:0;position:absolute;inset:0}.wx-temp.svelte-1y4wig5{letter-spacing:-.03em;color:#212b38;-webkit-user-select:none;user-select:none;justify-content:center;align-items:center;width:44%;font-size:68cqh;font-weight:750;line-height:1;display:flex;position:absolute;top:0;bottom:0;left:0}.wx-temp-light.svelte-1y4wig5{color:#e9eef6}.wx-emoji.svelte-1y4wig5{-webkit-user-select:none;user-select:none;font-size:78cqh;line-height:1;position:absolute;top:50%;right:5%;transform:translateY(-50%)}.wx-sunny.svelte-1y4wig5{background:radial-gradient(120% 90% at 30% 30%,#ffd27a,#ff9d3c 55%,#2c1008)}.wx-partly-cloudy.svelte-1y4wig5{background:linear-gradient(#82b0cf,#e1edf2)}.wx-cloudy.svelte-1y4wig5{background:linear-gradient(#6f9ec4,#dfeaf0)}.wx-foggy.svelte-1y4wig5{background:linear-gradient(#b7c4c6,#dbe0de)}.wx-rainy.svelte-1y4wig5{background:linear-gradient(#2f3743,#5d6772)}.wx-thunderstorm.svelte-1y4wig5{background:linear-gradient(#141a22,#333d48)}.wx-snow.svelte-1y4wig5{background:linear-gradient(#8c9eb0,#c6d1d8)}.wx-windy.svelte-1y4wig5{background:linear-gradient(#6ba2d4,#cfe4f4)}.draft-save.svelte-3sxqsn{border:1px solid var(--line);border-radius:12px;margin:8px 0 16px;padding:12px}.draft-row.svelte-3sxqsn{justify-content:space-between;align-items:center;gap:12px;display:flex}.draft-row.svelte-3sxqsn span:where(.svelte-3sxqsn){color:var(--muted);font-size:12px}form.svelte-3sxqsn{flex-wrap:wrap;align-items:end;gap:12px;margin-top:12px;display:flex}label.svelte-3sxqsn{flex-direction:column;gap:6px;font-size:12px;display:flex}input.svelte-3sxqsn{border:1px solid var(--line);min-width:180px;color:var(--text);background:var(--bg);border-radius:8px;padding:8px 10px}p.svelte-3sxqsn{width:100%;margin:8px 0;font-size:12px}.inputbox.dragging.svelte-1n8df3y{border-color:var(--accent-border);box-shadow:var(--focus-ring), var(--shadow-md)}.inputbox.svelte-1n8df3y,.cinput-wrap.svelte-1n8df3y{position:relative}.cinput-hl.svelte-1n8df3y{z-index:0;font:inherit;font-size:var(--text-md);color:var(--ink);white-space:pre-wrap;overflow-wrap:break-word;word-break:break-word;pointer-events:none;-webkit-user-select:none;user-select:none;margin:0;padding:8px 4px 6px;position:absolute;inset:0;overflow:hidden}.cinput-hl.svelte-1n8df3y mark:where(.svelte-1n8df3y){background:var(--accent-soft);color:var(--accent);-webkit-box-decoration-break:clone;box-decoration-break:clone;border-radius:4px;padding:0}.cinput.svelte-1n8df3y{z-index:1;color:#0000;-webkit-text-fill-color:transparent;caret-color:var(--ink);background:0 0;position:relative}.cinput.svelte-1n8df3y::placeholder{color:var(--text-muted);-webkit-text-fill-color:var(--text-muted)}.atpicker.svelte-1n8df3y{z-index:45;background:var(--surface-elevated);border:1px solid var(--line);border-radius:var(--radius-sm);max-height:240px;box-shadow:var(--shadow-lg);padding:4px;position:absolute;bottom:calc(100% + 6px);left:0;right:0;overflow-y:auto}.atrow.svelte-1n8df3y{text-align:left;border-radius:var(--radius-sm);width:100%;font:inherit;color:var(--ink);cursor:pointer;background:0 0;border:none;align-items:center;gap:8px;padding:6px 8px;display:flex}.atrow.sel.svelte-1n8df3y{background:var(--surface-sunken,#7f7f7f24)}.atname.svelte-1n8df3y{text-overflow:ellipsis;white-space:nowrap;flex:none;max-width:60%;overflow:hidden}.atdir.svelte-1n8df3y{text-overflow:ellipsis;white-space:nowrap;text-align:right;min-width:0;color:var(--text-muted);flex:1;font-size:12px;overflow:hidden}.atempty.svelte-1n8df3y{color:var(--text-muted);padding:8px 10px;font-size:13px}.ctip.svelte-1n8df3y{display:inline-flex;position:relative}.cbtn.needcfg.svelte-1n8df3y{opacity:.45}.ctip-bubble.svelte-1n8df3y{text-align:left;background:var(--surface-elevated);width:max-content;max-width:220px;color:var(--ink);border:1px solid var(--line);border-radius:var(--radius-sm);box-shadow:var(--shadow-lg);opacity:0;pointer-events:none;z-index:40;padding:7px 10px;font-size:12px;line-height:1.35;transition:opacity .12s,transform .12s;position:absolute;bottom:calc(100% + 8px);right:0;transform:translateY(3px)}.ctip.svelte-1n8df3y:hover .ctip-bubble:where(.svelte-1n8df3y){opacity:1;transform:translateY(0)}.cfolders.svelte-1n8df3y{flex-wrap:wrap;gap:6px;margin-bottom:6px;display:flex}.chip.folder.svelte-1n8df3y{transition:padding-right var(--dur-fast) var(--ease-out);align-items:center;display:inline-flex;position:relative}.chip.folder.svelte-1n8df3y .chipbody:where(.svelte-1n8df3y){font:inherit;color:inherit;cursor:pointer;text-overflow:ellipsis;white-space:nowrap;background:0 0;border:none;align-items:center;gap:5px;max-width:220px;margin:0;padding:0;display:inline-flex;overflow:hidden}.chip.folder.svelte-1n8df3y .cfrw:where(.svelte-1n8df3y){letter-spacing:.04em;color:var(--warning,#b8860b);flex:none;font-size:9px;font-weight:700;line-height:1}.chip.folder.missing.svelte-1n8df3y .chipbody:where(.svelte-1n8df3y){color:var(--warning,#b8860b)}.chip.folder.svelte-1n8df3y .x:where(.svelte-1n8df3y){color:var(--muted);cursor:pointer;background:0 0;border:none;justify-content:center;align-items:center;padding:0;font-size:15px;line-height:1;display:none;position:absolute;top:50%;right:7px;transform:translateY(-50%)}.chip.folder.svelte-1n8df3y:hover,.chip.folder.svelte-1n8df3y:focus-within{padding-right:22px}.chip.folder.svelte-1n8df3y:hover .x:where(.svelte-1n8df3y),.chip.folder.svelte-1n8df3y:focus-within .x:where(.svelte-1n8df3y){display:inline-flex}.chip.folder.svelte-1n8df3y .x:where(.svelte-1n8df3y):hover{color:var(--ink)}.chip.folder.svelte-1n8df3y .x:where(.svelte-1n8df3y):disabled{opacity:.5;cursor:default}.cfmore.svelte-1n8df3y{border:1px dashed var(--line);border-radius:var(--radius-pill,999px);color:var(--text-muted);cursor:pointer;background:0 0;padding:2px 10px;font-size:12px}.cfmore.svelte-1n8df3y:hover{color:var(--text);border-color:var(--text-muted)}.cfmsg.svelte-1n8df3y{color:var(--text-muted);margin:0 0 6px;font-size:12px}.cfmsg.err.svelte-1n8df3y{color:var(--danger)}.cfhint.svelte-1n8df3y{margin:0 0 10px;font-size:12px}.runbanner.svelte-auyrd3{font-size:var(--text-sm);flex-wrap:wrap;align-items:center;gap:12px;display:flex}.runmeta.svelte-auyrd3{color:var(--muted)}.runlink.svelte-auyrd3{align-items:center;gap:5px;display:inline-flex}.themetoggle.svelte-1kenrq5{cursor:pointer;border:1px solid var(--line);background:var(--surface);color:var(--muted);border-radius:var(--radius-sm);font-family:var(--font-sans);font-size:var(--text-xs);font-weight:var(--fw-semibold);text-transform:capitalize;transition:border-color var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out);align-items:center;gap:6px;padding:5px 10px;display:inline-flex}.themetoggle.svelte-1kenrq5:hover{border-color:var(--accent);color:var(--accent)}.sh.svelte-ozppsh{align-items:center;display:inline-flex;position:relative}.shdot.svelte-ozppsh{cursor:pointer;border-radius:var(--radius-pill);width:26px;height:26px;transition:background var(--dur-fast) var(--ease-out);background:0 0;border:none;justify-content:center;align-items:center;padding:0;display:inline-flex}.shdot.svelte-ozppsh:hover,.shdot.open.svelte-ozppsh{background:var(--surface-hover)}.shdot.svelte-ozppsh .dot:where(.svelte-ozppsh){border-radius:var(--radius-pill);background:var(--sh-color,var(--muted));width:10px;height:10px;box-shadow:0 0 0 3px color-mix(in srgb, var(--sh-color,var(--muted)) 22%, transparent)}.state-ok.svelte-ozppsh{--sh-color:var(--success)}.state-warn.svelte-ozppsh{--sh-color:var(--warning)}.state-down.svelte-ozppsh{--sh-color:var(--danger)}.state-off.svelte-ozppsh{--sh-color:var(--line)}@media (prefers-reduced-motion:no-preference){.shdot.state-ok.svelte-ozppsh .dot:where(.svelte-ozppsh){animation:svelte-ozppsh-shpulse 2.8s var(--ease-out) infinite}}@keyframes svelte-ozppsh-shpulse{0%,to{box-shadow:0 0 0 3px color-mix(in srgb, var(--success) 22%, transparent)}50%{box-shadow:0 0 0 5px color-mix(in srgb, var(--success) 10%, transparent)}}.shpanel.svelte-ozppsh{z-index:var(--z-modal);background:var(--surface);border:1px solid var(--line);border-radius:var(--radius-sm);min-width:248px;max-width:320px;box-shadow:var(--shadow-lg);flex-direction:column;gap:2px;padding:8px;display:flex;position:absolute;top:calc(100% + 6px);right:0}.shhead.svelte-ozppsh{font-size:var(--text-xs);font-weight:var(--fw-bold);color:var(--muted);text-transform:uppercase;letter-spacing:.04em;padding:2px 4px 6px}.shempty.svelte-ozppsh{font-size:var(--text-sm);color:var(--muted);padding:4px}.shrow.svelte-ozppsh{align-items:flex-start;gap:9px;padding:5px 4px;display:flex}.rowdot.svelte-ozppsh{border-radius:var(--radius-pill);background:var(--sh-color,var(--muted));flex:none;width:8px;height:8px;margin-top:5px}.shtext.svelte-ozppsh{flex:1;min-width:0}.shlabel.svelte-ozppsh{font-size:var(--text-sm);font-weight:var(--fw-medium);color:var(--text);line-height:1.3}.shdetail.svelte-ozppsh{font-size:var(--text-xs);color:var(--muted);overflow-wrap:anywhere}.shservers.svelte-ozppsh{border-left:1px solid var(--line);flex-direction:column;gap:3px;margin:0 4px 4px 21px;padding-left:8px;display:flex}.shsrv.svelte-ozppsh{font-size:var(--text-xs);align-items:center;gap:7px;display:flex}.srvname.svelte-ozppsh{text-overflow:ellipsis;white-space:nowrap;max-width:90px;color:var(--text);font-weight:var(--fw-medium);flex:none;overflow:hidden}.srvstat.svelte-ozppsh{min-width:0;color:var(--muted);text-overflow:ellipsis;white-space:nowrap;flex:1;overflow:hidden}.srvstat.bad.svelte-ozppsh{color:var(--danger)}.recheck.svelte-ozppsh{color:var(--muted);cursor:pointer;transition:color var(--dur-fast) var(--ease-out);background:0 0;border:none;border-radius:5px;flex:none;justify-content:center;align-items:center;padding:2px;display:inline-flex}.recheck.svelte-ozppsh:hover{color:var(--text)}.acpbadge.svelte-1uxvm9k{align-items:center;gap:5px;display:inline-flex}.acpbadge.live.svelte-1uxvm9k:before{content:"";background:var(--success);border-radius:50%;width:6px;height:6px;display:inline-block}.acplive.svelte-1uxvm9k{border:1px solid var(--line);border-radius:var(--radius,12px);background:var(--surface);text-align:center;flex-direction:column;align-items:center;gap:8px;margin:0 16px 16px;padding:14px 16px;display:flex}.acplive.svelte-1uxvm9k p:where(.svelte-1uxvm9k){color:var(--text-muted);margin:0;font-size:13px}.acperr.svelte-1uxvm9k{color:var(--danger)}.acpclose.svelte-1uxvm9k{border:1px solid var(--danger);color:var(--danger);font:inherit;cursor:pointer;background:0 0;border-radius:999px;align-items:center;gap:6px;padding:6px 14px;font-size:13px;display:inline-flex}.acpclose.svelte-1uxvm9k:hover:not(:disabled){background:color-mix(in srgb, var(--danger) 10%, transparent)}.acpclose.svelte-1uxvm9k:disabled{opacity:.6;cursor:default}.schedfield.svelte-33af8b{flex-wrap:wrap;align-items:center;gap:8px;display:flex}.schedfield.svelte-33af8b select:where(.svelte-33af8b),.schedfield.svelte-33af8b input:where(.svelte-33af8b){font:inherit;color:var(--ink);border:1px solid var(--line);background-color:var(--bg);border-radius:8px;min-width:0;padding:7px 9px;font-size:13px}.schedfield.svelte-33af8b select:where(.svelte-33af8b){flex:none;padding-right:30px}.schedfield.svelte-33af8b input:where(.svelte-33af8b){flex:1;min-width:140px}.schedfield.svelte-33af8b select:where(.svelte-33af8b):focus,.schedfield.svelte-33af8b input:where(.svelte-33af8b):focus{border-color:var(--accent);box-shadow:var(--focus-ring);outline:none}.recallfield.svelte-4kedlj{flex-wrap:wrap;align-items:center;gap:8px;display:flex}.recallfield.svelte-4kedlj select:where(.svelte-4kedlj),.recallfield.svelte-4kedlj input:where(.svelte-4kedlj){font:inherit;color:var(--ink);border:1px solid var(--line);background-color:var(--bg);border-radius:8px;min-width:0;padding:7px 9px;font-size:13px}.recallfield.svelte-4kedlj select:where(.svelte-4kedlj){flex:none;padding-right:30px}.recallfield.svelte-4kedlj input:where(.svelte-4kedlj){width:90px}.recallfield.svelte-4kedlj select:where(.svelte-4kedlj):focus,.recallfield.svelte-4kedlj input:where(.svelte-4kedlj):focus{border-color:var(--accent);box-shadow:var(--focus-ring);outline:none}.recallhint.svelte-4kedlj{color:var(--muted);margin:6px 0 0;font-size:12px}.taskpage.svelte-y9xmno{padding:28px 0 60px;overflow-y:auto}.tphead.svelte-y9xmno{flex-wrap:wrap;justify-content:space-between;align-items:flex-start;gap:16px;display:flex}.tpheadmain.svelte-y9xmno{flex:1;min-width:0}.tphead.svelte-y9xmno h1:where(.svelte-y9xmno){font-size:var(--text-2xl);color:var(--ink);margin:0 0 4px}.tpdesc.svelte-y9xmno{color:var(--muted);max-width:60ch;margin-bottom:8px;font-size:13px}.tpstatus.svelte-y9xmno{align-items:center;gap:10px;display:flex}.tpactions.svelte-y9xmno{flex:none;align-items:center;gap:8px;display:flex}.tpnameinput.svelte-y9xmno,.tpdescinput.svelte-y9xmno{width:100%;font:inherit;color:var(--ink);border:1px solid var(--line);background:var(--bg);border-radius:8px;padding:6px 9px;display:block}.tpnameinput.svelte-y9xmno{font-size:var(--text-2xl);font-weight:var(--fw-semibold);margin-bottom:8px}.tpdescinput.svelte-y9xmno{color:var(--muted);max-width:60ch;font-size:13px}.tpnameinput.svelte-y9xmno:focus,.tpdescinput.svelte-y9xmno:focus,.tpinput.svelte-y9xmno:focus{border-color:var(--accent);box-shadow:var(--focus-ring);outline:none}.tpinput.svelte-y9xmno{box-sizing:border-box;width:100%;font:inherit;color:var(--ink);border:1px solid var(--line);background:var(--bg);border-radius:8px;padding:7px 9px;font-size:13px}.tpprompt-input.svelte-y9xmno{resize:vertical;line-height:1.5}.tpmodel.svelte-y9xmno{display:flex}.tpmodel.svelte-y9xmno .modelsw-btn:where(.svelte-y9xmno){margin-left:-9px}.tpmodel.svelte-y9xmno .modelsw-menu{top:calc(100% + 6px);bottom:auto}.tpmodel-view.svelte-y9xmno{color:var(--ink);align-items:center;gap:6px;font-size:13px;display:inline-flex}.tpswitch.svelte-y9xmno{cursor:pointer;flex:none;width:34px;height:20px;display:inline-flex;position:relative}.tpswitch.svelte-y9xmno input:where(.svelte-y9xmno){opacity:0;cursor:pointer;z-index:1;margin:0;position:absolute;inset:0}.tpknob.svelte-y9xmno{background:color-mix(in srgb, var(--ink) 10%, var(--surface));box-shadow:inset 0 0 0 1px var(--line);transition:background var(--dur-fast) var(--ease-out), box-shadow var(--dur-fast) var(--ease-out);border-radius:999px;position:absolute;inset:0}.tpknob.svelte-y9xmno:after{content:"";width:16px;height:16px;transition:transform var(--dur-fast) var(--ease-out);background:#fff;border-radius:50%;position:absolute;top:2px;left:2px;box-shadow:0 1px 2px #0000004d}.tpswitch.svelte-y9xmno input:where(.svelte-y9xmno):checked+.tpknob:where(.svelte-y9xmno){background:color-mix(in srgb, var(--accent) 55%, var(--surface));box-shadow:inset 0 0 0 1px color-mix(in srgb, var(--accent) 40%, var(--line))}.tpswitch.svelte-y9xmno input:where(.svelte-y9xmno):checked+.tpknob:where(.svelte-y9xmno):after{transform:translate(14px)}.tpswitch.svelte-y9xmno input:where(.svelte-y9xmno):disabled+.tpknob:where(.svelte-y9xmno){opacity:.6}.badge.paused.svelte-y9xmno{border-color:var(--line);background:var(--surface);color:var(--muted)}.muted.svelte-y9xmno{color:var(--muted);font-size:13px}.tpcols.svelte-y9xmno{grid-template-columns:minmax(0,1.1fr) minmax(0,1fr);align-items:start;gap:32px;margin-top:24px;display:grid}.tpcols.single.svelte-y9xmno{grid-template-columns:minmax(0,1fr);max-width:640px}@media (width<=760px){.tpcols.svelte-y9xmno{grid-template-columns:1fr}}.histhead.svelte-y9xmno{justify-content:space-between;align-items:baseline;gap:8px;display:flex}.markread.svelte-y9xmno{font:inherit;color:var(--muted);cursor:pointer;background:0 0;border:0;padding:0;font-size:12px}.markread.svelte-y9xmno:hover:not(:disabled){color:var(--ink)}.markread.svelte-y9xmno:disabled{opacity:.5;cursor:default}.tpcols.svelte-y9xmno h2:where(.svelte-y9xmno){font-size:12px;font-weight:var(--fw-semibold);color:var(--muted);text-transform:uppercase;letter-spacing:.5px;margin:20px 0 8px}.tpcols.svelte-y9xmno section:where(.svelte-y9xmno)>h2:where(.svelte-y9xmno):first-child{margin-top:0}.tpprompt.svelte-y9xmno{white-space:pre-wrap;overflow-wrap:anywhere;color:var(--ink);margin:0;font-size:13px;line-height:1.5}.tpmeta.svelte-y9xmno{overflow-wrap:anywhere;color:var(--ink);margin:0;font-size:13px}.fsec.svelte-y9xmno{text-transform:uppercase;letter-spacing:1px;color:var(--muted);margin:14px 0 4px;font-size:11px}.fsec.svelte-y9xmno:first-of-type{margin-top:0}.frow.svelte-y9xmno{align-items:center;gap:10px;padding:7px 0;display:flex}.frow.svelte-y9xmno+.frow:where(.svelte-y9xmno){border-top:1px solid var(--line)}.fico.svelte-y9xmno{color:var(--muted);flex:none;display:inline-flex}.fname.svelte-y9xmno{min-width:0;color:var(--ink);text-overflow:ellipsis;white-space:nowrap;flex:1;font-size:13px;overflow:hidden}.fmode.svelte-y9xmno{color:var(--muted);flex:none;font-size:13px}.fctl.svelte-y9xmno{flex:none;align-items:center;gap:10px;display:inline-flex}.addfolder.svelte-y9xmno{margin-top:12px}.tppicker.svelte-y9xmno{border:1px solid var(--line);border-radius:var(--radius-md);background:var(--surface-sunk,var(--bg));margin-top:10px;padding:10px}.permrow.svelte-y9xmno{border:1px solid var(--line);border-radius:var(--radius-sm);align-items:center;gap:8px;margin-bottom:6px;padding:6px 10px;display:flex}.permrow.svelte-y9xmno code:where(.svelte-y9xmno){min-width:0;font-family:var(--mono);color:var(--ink);text-overflow:ellipsis;white-space:nowrap;flex:1;font-size:12px;overflow:hidden}.runslist.svelte-y9xmno{flex-direction:column;gap:6px;margin-top:8px;display:flex}.runrow.svelte-y9xmno{text-align:left;border:1px solid var(--line);border-radius:var(--radius-sm);background:var(--surface);cursor:pointer;width:100%;font:inherit;transition:border-color var(--dur-fast) var(--ease-out), background var(--dur-fast) var(--ease-out);align-items:center;gap:10px;padding:9px 12px;display:flex}.runrow.svelte-y9xmno:hover{background:var(--code);border-color:color-mix(in srgb, var(--accent) 45%, var(--line))}.runrow.svelte-y9xmno:focus-visible{box-shadow:var(--focus-ring);outline:none}.runrow.unseen.svelte-y9xmno{background:color-mix(in srgb, var(--accent) 12%, transparent)}.runrow.unseen.svelte-y9xmno .runsum:where(.svelte-y9xmno){color:var(--ink);font-weight:var(--fw-semibold)}.runsum.svelte-y9xmno{min-width:0;color:var(--muted);text-overflow:ellipsis;white-space:nowrap;flex:1;overflow:hidden}.delwrap.svelte-y9xmno{flex:none;display:inline-flex;position:relative}.delconfirm.svelte-y9xmno{z-index:5;white-space:nowrap;background:var(--surface-elevated);border:1px solid var(--line);border-radius:var(--radius-sm);box-shadow:var(--shadow-lg);align-items:center;gap:8px;padding:8px 10px;display:flex;position:absolute;top:calc(100% + 8px);right:0}.delconfirm.svelte-y9xmno .confirm:where(.svelte-y9xmno){color:var(--danger);font-size:13px}.taskerror.svelte-y9xmno{font-size:var(--text-sm);line-height:var(--leading-snug);color:var(--ag2-observer);background:color-mix(in srgb, var(--ag2-observer) 9%, transparent);border:1px solid color-mix(in srgb, var(--ag2-observer) 28%, transparent);border-radius:var(--radius-sm);overflow-wrap:anywhere;align-items:flex-start;gap:7px;margin-bottom:8px;padding:9px 11px;display:flex}.statusicon.svelte-y9xmno{width:16px;color:var(--muted);flex:none;justify-content:center;align-items:center;display:inline-flex}.statusicon.completed.svelte-y9xmno{color:var(--success)}.statusicon.failed.svelte-y9xmno{color:var(--danger)}.statusicon.cancelled.svelte-y9xmno{color:var(--muted)}.statusicon.running.svelte-y9xmno{color:var(--info)}.statusicon.needs_input.svelte-y9xmno{color:var(--accent)}.runwhen.svelte-y9xmno{color:var(--muted);flex:none;font-size:13px}.codex.svelte-lf23jv .intro:where(.svelte-lf23jv){font-size:12px;line-height:1.5}.codex.svelte-lf23jv .note:where(.svelte-lf23jv){margin-top:6px;font-size:12px;line-height:1.5}.codex.svelte-lf23jv .warn:where(.svelte-lf23jv){color:var(--danger)}.codex.svelte-lf23jv .err:where(.svelte-lf23jv){color:var(--danger);font-size:13px}.codex.svelte-lf23jv .ok:where(.svelte-lf23jv){font-size:14px}.codex.svelte-lf23jv .linkbtn:where(.svelte-lf23jv){font:inherit;color:var(--accent);cursor:pointer;background:0 0;border:none;flex:none;padding:0;font-size:12px}.codex.svelte-lf23jv .linkbtn:where(.svelte-lf23jv):hover{text-decoration:underline}.codex.svelte-lf23jv .linkbtn:where(.svelte-lf23jv):disabled{opacity:.4;cursor:default;text-decoration:none}.codex.svelte-lf23jv .pasterow:where(.svelte-lf23jv){align-items:center;gap:8px;width:100%;display:flex}.codex.svelte-lf23jv .pasterow:where(.svelte-lf23jv) input:where(.svelte-lf23jv){border:1px solid var(--line);min-width:0;font:inherit;background:var(--bg);color:var(--ink);border-radius:8px;flex:1;padding:8px 10px;font-size:13px}.codex.svelte-lf23jv .pasterow:where(.svelte-lf23jv) input:where(.svelte-lf23jv):focus{border-color:var(--accent);outline:none}.codex.svelte-lf23jv .pasterow:where(.svelte-lf23jv) .open:where(.svelte-lf23jv){flex:none}.codex.svelte-lf23jv .foot:where(.svelte-lf23jv){justify-content:space-between;align-items:center;gap:8px;margin-top:12px;display:flex}.codex.svelte-lf23jv .foot.end:where(.svelte-lf23jv){justify-content:flex-end}.codex.svelte-lf23jv .foot:where(.svelte-lf23jv) .modal-close{align-self:auto}.profiles.svelte-1rlzuji{flex-direction:column;gap:2px;display:flex}.prow.svelte-1rlzuji{border-radius:var(--radius-sm);align-items:center;gap:10px;padding:8px 4px;display:flex}.prow.active.svelte-1rlzuji{background:color-mix(in srgb, var(--accent) 10%, transparent);padding:8px}.prow.clickable.svelte-1rlzuji{cursor:pointer}.prow.clickable.svelte-1rlzuji:hover{background:var(--code)}.prow.clickable.active.svelte-1rlzuji:hover{background:color-mix(in srgb, var(--accent) 14%, transparent)}.prow.clickable.svelte-1rlzuji:focus-visible{box-shadow:var(--focus-ring);outline:none}.pdot.svelte-1rlzuji{border-radius:var(--radius-pill);background:var(--dot,var(--accent));flex:none;width:12px;height:12px}.pmeta.svelte-1rlzuji{flex:1;min-width:0}.pname.svelte-1rlzuji{font-size:var(--text-sm);font-weight:var(--fw-semibold);align-items:center;gap:8px;display:flex}.pbadge.svelte-1rlzuji{font-size:var(--text-xs);font-weight:var(--fw-semibold);text-transform:uppercase;letter-spacing:var(--tracking-eyebrow);color:var(--accent);background:var(--accent-soft);border-radius:var(--radius-pill);padding:1px 7px}.ppath.svelte-1rlzuji{font-size:var(--text-xs);color:var(--text-muted);text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.pactions.svelte-1rlzuji{flex:none;align-items:center;gap:10px;display:flex}.peditor.svelte-1rlzuji{background:var(--surface-sunk);border:1px solid var(--line);border-radius:var(--radius-sm);flex-direction:column;gap:12px;margin:12px 0 6px;padding:12px;display:flex}.pfield.svelte-1rlzuji{flex-direction:column;gap:5px;display:flex}.pfield.svelte-1rlzuji label:where(.svelte-1rlzuji){font-size:var(--text-xs);font-weight:var(--fw-semibold);color:var(--text-muted)}.pfield.svelte-1rlzuji input:where(.svelte-1rlzuji),.pfield.svelte-1rlzuji select:where(.svelte-1rlzuji){border:1px solid var(--line);border-radius:var(--radius-sm);background-color:var(--bg);color:var(--text);font:inherit;font-size:var(--text-sm);padding:8px 10px}.pfield.svelte-1rlzuji select:where(.svelte-1rlzuji){padding-right:30px}.pfield.svelte-1rlzuji input:where(.svelte-1rlzuji):focus,.pfield.svelte-1rlzuji select:where(.svelte-1rlzuji):focus{border-color:var(--accent);box-shadow:var(--focus-ring);outline:none}.phint.svelte-1rlzuji{font-size:var(--text-xs);color:var(--text-muted);line-height:var(--leading-snug)}.peditactions.svelte-1rlzuji{justify-content:flex-end;align-items:center;gap:10px;display:flex}.profile-add.svelte-1rlzuji{cursor:pointer;font:inherit;font-size:var(--text-sm);font-weight:var(--fw-semibold);color:var(--text-muted);background:0 0;border:none;align-self:flex-start;align-items:center;gap:6px;margin-top:6px;padding:8px 4px;display:inline-flex}.profile-add.svelte-1rlzuji:hover{color:var(--accent)}.profile-add.svelte-1rlzuji:focus-visible{box-shadow:var(--focus-ring);border-radius:var(--radius-sm);outline:none}.profile-add-cancel.svelte-1rlzuji{align-self:flex-end}.pconfirm.svelte-1rlzuji{background:var(--surface-sunk);border:1px solid var(--line);border-radius:var(--radius-sm);flex-direction:column;gap:10px;margin:6px 0;padding:12px;display:flex}.pconfirmhead.svelte-1rlzuji{font-size:var(--text-sm);font-weight:var(--fw-semibold);align-items:center;gap:7px;display:flex}.parch.svelte-1rlzuji{border-top:1px solid var(--line);flex-direction:column;gap:2px;margin-top:8px;padding-top:8px;display:flex}.parchhead.svelte-1rlzuji{cursor:pointer;font:inherit;font-size:var(--text-xs);font-weight:var(--fw-semibold);text-transform:uppercase;letter-spacing:var(--tracking-eyebrow);color:var(--text-muted);background:0 0;border:none;align-items:center;gap:6px;padding:6px 4px;display:flex}.parchhead.svelte-1rlzuji:hover{color:var(--accent)}.parchhead.svelte-1rlzuji:focus-visible{box-shadow:var(--focus-ring);border-radius:var(--radius-sm);outline:none}.parchentry.svelte-1rlzuji{flex-direction:column;gap:2px;display:flex}.prow.arch.svelte-1rlzuji{padding:8px 4px}.prow.arch.svelte-1rlzuji .pdot:where(.svelte-1rlzuji){opacity:.55}.prow.arch.svelte-1rlzuji .pname:where(.svelte-1rlzuji){color:var(--text-muted);font-weight:var(--fw-medium)}.perr.svelte-1rlzuji{font-size:var(--text-sm);color:var(--danger,var(--danger));margin:0}.linkbtn.quiet.svelte-1rlzuji{color:var(--text-muted)}.linkbtn.quiet.svelte-1rlzuji:hover{color:var(--danger,var(--danger))}.open.danger.svelte-1rlzuji{border-color:var(--danger,var(--danger));color:var(--danger,var(--danger))}.open.danger.svelte-1rlzuji:hover{background:color-mix(in srgb, var(--danger,var(--danger)) 12%, transparent);border-color:var(--danger,var(--danger));color:var(--danger,var(--danger))}.identity.svelte-tzms08{background:var(--surface-sunk);border:1px solid var(--line);border-radius:var(--radius-md,12px);align-items:center;gap:12px;margin-bottom:4px;padding:14px;display:flex}.idmono.svelte-tzms08{border-radius:var(--radius-pill);background:var(--dot);color:#fff;width:40px;height:40px;font-weight:var(--fw-semibold);flex:none;justify-content:center;align-items:center;font-size:17px;display:inline-flex}.idmeta.svelte-tzms08{min-width:0}.idname.svelte-tzms08{font-size:var(--text-md,15px);font-weight:var(--fw-semibold)}.idpath.svelte-tzms08{font-size:var(--text-xs);color:var(--text-muted);text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.pfield.svelte-tzms08{flex-direction:column;gap:6px;margin-top:12px;display:flex}.pfield.svelte-tzms08 label:where(.svelte-tzms08),.plabel.svelte-tzms08{font-size:var(--text-xs);font-weight:var(--fw-semibold);color:var(--text-muted)}.pfield.svelte-tzms08 input:where(.svelte-tzms08){border:1px solid var(--line);border-radius:var(--radius-sm);background-color:var(--bg);color:var(--text);font:inherit;font-size:var(--text-sm);padding:9px 11px}.pfield.svelte-tzms08 input:where(.svelte-tzms08):focus{border-color:var(--accent);box-shadow:var(--focus-ring);outline:none}.pdots.svelte-tzms08{flex-wrap:wrap;gap:8px;padding:4px;display:flex}.pswatch.svelte-tzms08{cursor:pointer;color:#fff;border-radius:var(--radius-pill);background:var(--dot);width:26px;height:26px;transition:transform var(--dur-fast) var(--ease-out), box-shadow var(--dur-fast) var(--ease-out);border:2px solid #0000;flex:none;justify-content:center;align-items:center;display:inline-flex}.pswatch.svelte-tzms08:hover{transform:scale(1.08)}.pswatch.on.svelte-tzms08{box-shadow:0 0 0 2px var(--surface-sunk), 0 0 0 4px var(--dot)}.pcustom.svelte-tzms08{padding:0;position:relative;overflow:hidden}.pcustom.rainbow.svelte-tzms08{background:conic-gradient(from 90deg,#f95339,#ec5d18,#e0b400,#2f8c44,#109e91,#2f6fe0,#7a52ec,#f95339)}.pcustom.rainbow.on.svelte-tzms08{box-shadow:0 0 0 2px var(--surface-sunk), 0 0 0 4px var(--accent)}.pcustom.svelte-tzms08 input:where(.svelte-tzms08){opacity:0;cursor:pointer;background:0 0;border:none;width:100%;height:100%;padding:0;position:absolute;inset:0}.phex.svelte-tzms08{font-size:var(--text-xs);color:var(--text-muted);font-variant-numeric:tabular-nums;letter-spacing:.02em;margin-top:2px}.pgactions.svelte-tzms08{justify-content:flex-end;align-items:center;gap:12px;margin-top:16px;display:flex}.okmsg.svelte-tzms08{color:var(--accent);font-size:var(--text-xs)}.perr.svelte-tzms08{font-size:var(--text-sm);color:var(--danger,var(--danger));margin:8px 0 0}.pmodels.svelte-yyf8l0{flex-direction:column;gap:20px;display:flex}.pmodel.svelte-yyf8l0{flex-direction:column;align-items:flex-start;gap:6px;display:flex}.pmodel-k.svelte-yyf8l0{font-size:var(--text-xs);text-transform:uppercase;letter-spacing:var(--tracking-eyebrow);color:var(--text-muted);font-weight:var(--fw-semibold)}.pmodel-sub.svelte-yyf8l0{font-size:var(--text-xs);color:var(--text-muted);margin-top:-3px;margin-bottom:2px}.foldercard.svelte-mm2t0q{border:1px solid var(--line);border-radius:var(--radius-sm);align-items:center;gap:10px;margin-bottom:8px;padding:8px 10px;display:flex}.permico.svelte-mm2t0q{color:var(--text-muted);flex:none;display:inline-flex}.foldmeta.svelte-mm2t0q{flex-direction:column;flex:1;gap:1px;min-width:0;display:flex}.foldname.svelte-mm2t0q{font-size:13px;font-weight:var(--fw-semibold);color:var(--text)}.permval.svelte-mm2t0q{font-family:var(--font-mono);color:var(--text-muted);text-overflow:ellipsis;white-space:nowrap;font-size:12px;overflow:hidden}.missing.svelte-mm2t0q{color:var(--warning,#b8860b)}.accctl.svelte-mm2t0q{flex:none;align-items:center;gap:10px;display:inline-flex}.permadd.svelte-mm2t0q{align-self:flex-start}.permempty.svelte-mm2t0q{margin:0 0 8px;font-size:13px}.permhint.svelte-mm2t0q{margin:2px 0 10px;font-size:12px}.permerr.svelte-mm2t0q{color:var(--danger);margin:0 0 8px;font-size:13px}.ski.svelte-1l9ety1{border:1px solid var(--line);border-radius:var(--radius-sm);margin-top:10px;padding:10px}.skihead.svelte-1l9ety1{justify-content:space-between;align-items:center;gap:8px;margin-bottom:10px;display:flex}.skitabs.svelte-1l9ety1{background:var(--code);border-radius:var(--radius-pill);gap:3px;padding:3px;display:inline-flex}.skitab.svelte-1l9ety1{font:inherit;font-size:13px;font-weight:var(--fw-medium);color:var(--muted);border-radius:var(--radius-pill);cursor:pointer;transition:color var(--dur-fast) var(--ease-out), background var(--dur-fast) var(--ease-out);background:0 0;border:none;justify-content:center;align-items:center;padding:5px 12px;display:inline-flex}.skitab.svelte-1l9ety1:hover{color:var(--text)}.skitab.on.svelte-1l9ety1{color:var(--accent);background:var(--surface);box-shadow:var(--shadow-sm)}.skierr.svelte-1l9ety1{color:var(--danger);margin:0 0 8px;font-size:12px}.skirow.svelte-1l9ety1{align-items:center;gap:8px;display:flex}.skiinput.svelte-1l9ety1{border:1px solid var(--line);min-width:0;font:inherit;background:var(--bg);color:var(--ink);border-radius:8px;flex:1;padding:7px 9px;font-size:13px}.skiinput.svelte-1l9ety1:focus{border-color:var(--accent);box-shadow:var(--focus-ring);outline:none}.skifile.svelte-1l9ety1{cursor:pointer;border:1px solid var(--line);min-width:0;font:inherit;background:var(--bg);transition:border-color var(--dur-fast) var(--ease-out), box-shadow var(--dur-fast) var(--ease-out);border-radius:8px;flex:1;align-items:center;gap:8px;padding:5px 6px 5px 11px;font-size:13px;display:flex}.skifile.svelte-1l9ety1:hover{border-color:color-mix(in srgb, var(--accent) 45%, var(--line))}.skifile.svelte-1l9ety1:focus-within{border-color:var(--accent);box-shadow:var(--focus-ring)}.skifile.disabled.svelte-1l9ety1{opacity:.5;pointer-events:none}.skifile.svelte-1l9ety1 input:where(.svelte-1l9ety1){display:none}.skifilename.svelte-1l9ety1{min-width:0;color:var(--ink);text-overflow:ellipsis;white-space:nowrap;flex:1;overflow:hidden}.skifile.nofile.svelte-1l9ety1 .skifilename:where(.svelte-1l9ety1){color:var(--muted)}.skifilepick.svelte-1l9ety1{font-size:12px;font-weight:var(--fw-medium);color:var(--muted);border:1px solid var(--line);background:var(--surface);transition:border-color var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out);border-radius:6px;flex:none;padding:2px 9px}.skifile.svelte-1l9ety1:hover .skifilepick:where(.svelte-1l9ety1){color:var(--accent);border-color:color-mix(in srgb, var(--accent) 45%, var(--line))}.skifound.svelte-1l9ety1,.skicheck.svelte-1l9ety1{border-top:1px solid var(--line);align-items:center;gap:10px;padding:6px 2px;display:flex}.skichecklist.svelte-1l9ety1{margin-top:8px}.skifmeta.svelte-1l9ety1{flex-direction:column;flex:1;min-width:0;display:flex}.skifname.svelte-1l9ety1{font-size:13px;font-weight:var(--fw-semibold);color:var(--text);align-items:baseline;gap:8px;display:flex}.skiinstalls.svelte-1l9ety1{font-size:11px;font-weight:var(--fw-regular,400);color:var(--text-muted)}.skifdesc.svelte-1l9ety1{color:var(--text-muted);text-overflow:ellipsis;white-space:nowrap;font-size:12px;overflow:hidden}.skicheck.svelte-1l9ety1{cursor:pointer}.skicheck.svelte-1l9ety1 .skifdesc:where(.svelte-1l9ety1){flex:1}.skhint.svelte-126h1cg{margin:2px 0 10px;font-size:12px}.skerr.svelte-126h1cg{color:var(--danger);margin:0 0 8px;font-size:13px}.skempty.svelte-126h1cg{margin:0 0 8px;font-size:13px}.skblocked.svelte-126h1cg{color:var(--text-muted);flex:none;font-size:12px;font-style:italic}.mhint.svelte-1h30q9j{font-size:var(--text-xs);color:var(--text-muted);margin:0 0 10px}.merr.svelte-1h30q9j{color:var(--danger,var(--danger));font-size:var(--text-sm);margin:0 0 8px}.mempty.svelte-1h30q9j{text-align:left;background:var(--surface-sunk);border:1px dashed var(--line);border-radius:var(--radius-md,12px);flex-direction:column;align-items:flex-start;gap:6px;padding:22px;display:flex}.memptytitle.svelte-1h30q9j{font-size:var(--text-sm);font-weight:var(--fw-semibold)}.memptybody.svelte-1h30q9j{font-size:var(--text-xs);color:var(--text-muted);line-height:var(--leading-snug);max-width:44ch;margin:0 0 4px}.mcard.svelte-1h30q9j{background:var(--surface-sunk);border:1px solid var(--line);border-radius:var(--radius-md,12px);max-height:260px;padding:14px;overflow:auto}.mpreview.svelte-1h30q9j{font:inherit;font-size:var(--text-sm);line-height:var(--leading-normal,1.5);color:var(--text);white-space:pre-wrap;word-break:break-word;margin:0}.marea.svelte-1h30q9j{resize:vertical;box-sizing:border-box;border:1px solid var(--line);border-radius:var(--radius-sm);width:100%;min-height:220px;font:inherit;font-size:var(--text-sm);background:var(--bg);color:var(--text);padding:10px 12px;line-height:1.5}.marea.svelte-1h30q9j:focus{border-color:var(--accent);box-shadow:var(--focus-ring);outline:none}.mfoot.svelte-1h30q9j{justify-content:flex-end;align-items:center;gap:12px;margin-top:10px;display:flex}.okmsg.svelte-1h30q9j{color:var(--accent);font-size:var(--text-xs)}.linkbtn.quiet.svelte-1h30q9j{color:var(--text-muted)}.linkbtn.quiet.svelte-1h30q9j:hover{color:var(--danger,var(--danger))}.peditor.svelte-1durtx6{flex-direction:column;gap:4px;display:flex}.pback.svelte-1durtx6{cursor:pointer;font:inherit;font-size:var(--text-xs);font-weight:var(--fw-semibold);color:var(--text-muted);background:0 0;border:none;align-self:flex-start;align-items:center;gap:3px;margin:0 0 8px -4px;padding:4px;display:inline-flex}.pback.svelte-1durtx6:hover{color:var(--accent)}.pback.svelte-1durtx6:focus-visible{box-shadow:var(--focus-ring);border-radius:var(--radius-sm);outline:none}.phead.svelte-1durtx6{align-items:center;gap:12px;padding:2px 0 14px;display:flex}.pheaddot.svelte-1durtx6{border-radius:var(--radius-pill);background:var(--dot);flex:none;width:14px;height:14px}.pheadmeta.svelte-1durtx6{min-width:0}.pheadname.svelte-1durtx6{font-size:var(--text-lg,18px);font-weight:var(--fw-semibold);align-items:center;gap:10px;display:flex}.pbadge.svelte-1durtx6{font-size:var(--text-xs);font-weight:var(--fw-semibold);text-transform:uppercase;letter-spacing:var(--tracking-eyebrow);color:var(--accent);background:var(--accent-soft);border-radius:var(--radius-pill);padding:1px 7px}.pheadsub.svelte-1durtx6{font-size:var(--text-xs);color:var(--text-muted);text-overflow:ellipsis;white-space:nowrap;margin-top:2px;overflow:hidden}.ptabs.svelte-1durtx6{border-bottom:1px solid var(--line);flex-wrap:wrap;gap:2px;margin-bottom:16px;display:flex}.ptab.svelte-1durtx6{cursor:pointer;font:inherit;font-size:var(--text-sm);font-weight:var(--fw-medium);color:var(--text-muted);transition:color var(--dur-fast) var(--ease-out);background:0 0;border:none;border-bottom:2px solid #0000;margin-bottom:-1px;padding:9px 12px;position:relative}.ptab.svelte-1durtx6:hover{color:var(--text)}.ptab.on.svelte-1durtx6{color:var(--accent);border-bottom-color:var(--accent);font-weight:var(--fw-semibold)}.ptab.svelte-1durtx6:focus-visible{box-shadow:var(--focus-ring);border-radius:var(--radius-sm);outline:none}.ppanel.svelte-1durtx6{flex-direction:column;gap:6px;display:flex}.llmcombo.svelte-19tyyb4{flex-direction:column;display:flex;position:relative}.llmcombolist.svelte-19tyyb4{z-index:45;background:var(--surface-elevated);border:1px solid var(--line);border-radius:var(--radius-sm);max-height:260px;box-shadow:var(--shadow-lg);padding:4px;position:absolute;top:calc(100% + 4px);left:0;right:0;overflow-y:auto}.llmcomborow.svelte-19tyyb4{text-align:left;border-radius:var(--radius-sm);width:100%;font:inherit;color:var(--ink);cursor:pointer;background:0 0;border:none;align-items:baseline;gap:8px;padding:6px 8px;font-size:13px;display:flex}.llmcomborow.sel.svelte-19tyyb4{background:var(--surface-sunken,#7f7f7f24)}.llmcomboname.svelte-19tyyb4{text-overflow:ellipsis;white-space:nowrap;flex:none;max-width:45%;overflow:hidden}.llmcomboid.svelte-19tyyb4{color:var(--text-muted);text-overflow:ellipsis;white-space:nowrap;flex:none;font-size:11px;overflow:hidden}.llmcombometa.svelte-19tyyb4{min-width:0;color:var(--text-muted);white-space:nowrap;flex:1;justify-content:flex-end;gap:8px;font-size:11px;display:flex;overflow:hidden}.llmcombotag.svelte-19tyyb4{border:1px solid var(--line);letter-spacing:.3px;border-radius:999px;padding:0 5px}.llmcomboload.svelte-19tyyb4{color:var(--text-muted);padding:6px 8px;font-size:12px}.llmconfirm.svelte-1p2yl1j,.llmconfirm.svelte-1wl71qv{color:var(--danger);white-space:nowrap;font-size:12px}.ca-status.svelte-1a3c600{align-items:center;gap:.5em;margin:.4em 0;font-size:.92em;display:flex}.ca-dot.svelte-1a3c600{background:var(--text-faint);border-radius:50%;flex:none;width:9px;height:9px}.ca-dot.on.svelte-1a3c600{background:var(--success)}.ca-dot.off.svelte-1a3c600{background:var(--danger)}.ca-list.svelte-1a3c600{flex-direction:column;gap:.25em;margin:.4em 0;padding:0;list-style:none;display:flex}.ca-list.svelte-1a3c600 li:where(.svelte-1a3c600){border:1px solid var(--line);border-radius:8px;justify-content:space-between;align-items:center;gap:1em;padding:.4em .6em;display:flex}.ca-id.svelte-1a3c600{color:var(--text-faint);font-weight:400}.ca-badge.svelte-1a3c600{background:var(--surface-sunk);color:var(--text-muted);white-space:nowrap;border-radius:999px;padding:.1em .55em;font-size:.78em}.ca-badge.ok.svelte-1a3c600{background:color-mix(in srgb, var(--success) 15%, transparent);color:var(--success)}.ca-empty.svelte-1a3c600{color:var(--text-muted);justify-content:flex-start}.ca-note.svelte-1a3c600{color:var(--text-muted);margin:.4em 0;font-size:.82em;line-height:1.4}.ca-bad.svelte-1a3c600{color:var(--danger)}code.svelte-1a3c600{background:var(--surface-sunk);color:var(--text);border-radius:5px;padding:.05em .35em;font-size:.9em}.permgroup.svelte-s4q8vl{flex-direction:column;gap:6px;margin-bottom:6px;display:flex}.permhd.svelte-s4q8vl{font-size:var(--text-xs);font-weight:var(--fw-semibold);color:var(--text-muted)}.permrow.svelte-s4q8vl{border:1px solid var(--line);border-radius:var(--radius-sm);align-items:center;gap:8px;padding:7px 10px;display:flex}.permico.svelte-s4q8vl{color:var(--text-muted);flex:none;display:inline-flex}.permval.svelte-s4q8vl{min-width:0;font-family:var(--font-mono);color:var(--text);text-overflow:ellipsis;white-space:nowrap;flex:1;font-size:12px;overflow:hidden}.permempty.svelte-s4q8vl{margin:0;font-size:13px}.permhint.svelte-s4q8vl{margin:2px 0 0;font-size:12px}.permerr.svelte-s4q8vl{color:var(--danger);margin:0;font-size:13px}.acplistitem.svelte-1yyb8o2{flex-direction:column;align-items:stretch;gap:6px}.docHint.svelte-pea4po{margin:2px 0 8px;font-size:12px}.docErr.svelte-pea4po{color:var(--danger);margin:0 0 8px;font-size:13px}.docArea.svelte-pea4po{resize:vertical;box-sizing:border-box;border:1px solid var(--line);border-radius:var(--radius-sm);width:100%;font:inherit;background:var(--bg);color:var(--ink);padding:10px 12px;font-size:13px;line-height:1.5}.docArea.svelte-pea4po:focus{border-color:var(--accent);box-shadow:var(--focus-ring);outline:none}.docFoot.svelte-pea4po{justify-content:flex-end;align-items:center;gap:10px;margin-top:8px;display:flex}.okmsg.svelte-pea4po{color:var(--accent);font-size:12px}.timeoutfield.svelte-jg6oyj{color:var(--muted);align-items:center;gap:5px;font-size:13px;display:flex}.timeoutfield.svelte-jg6oyj input:where(.svelte-jg6oyj){border:1px solid var(--line);width:66px;font:inherit;background:var(--bg);color:var(--ink);border-radius:8px;padding:7px 8px}.timeoutfield.svelte-jg6oyj input:where(.svelte-jg6oyj):focus{border-color:var(--accent);box-shadow:var(--focus-ring);outline:none}.notice.svelte-1okvk6k{z-index:var(--z-toast,9999);background:var(--surface);max-width:min(92vw,460px);color:var(--text);border:1px solid var(--line);border-radius:var(--radius-md,10px);box-shadow:var(--shadow-lg);font-family:var(--font-sans);font-size:var(--text-sm);align-items:center;gap:9px;padding:11px 16px;display:inline-flex;position:fixed;bottom:24px;left:50%;transform:translate(-50%)}.ntc-icon.svelte-1okvk6k{color:var(--accent);flex:none;display:inline-flex}.ntc-text.svelte-1okvk6k{line-height:var(--leading-normal)} diff --git a/src/assistant/gateway/static/app/index.html b/src/assistant/gateway/static/app/index.html index 3f538b14..0ae696b7 100644 --- a/src/assistant/gateway/static/app/index.html +++ b/src/assistant/gateway/static/app/index.html @@ -19,8 +19,8 @@ } } - - + +
                    diff --git a/tests/support/cards.py b/tests/support/cards.py index d8813d73..2bcf1854 100644 --- a/tests/support/cards.py +++ b/tests/support/cards.py @@ -6,6 +6,7 @@ from pathlib import Path +import yaml from ag2.a2ui import A2UIMessageEvent from ag2.context import ConversationContext from ag2.stream import MemoryStream @@ -29,6 +30,11 @@ """ +def card_definition(name: str = "Shelf") -> dict: + """A minimal reusable definition with an independently filled title.""" + return yaml.safe_load(CARD.format(name=name, description="Books", topic="", example="Books")) + + def write_card( directory: Path, name: str, diff --git a/tests/support/fakes.py b/tests/support/fakes.py index ae716ac3..3ebc5698 100644 --- a/tests/support/fakes.py +++ b/tests/support/fakes.py @@ -261,6 +261,23 @@ def __call__(self, config, model=None): return _RecordingModel(self, config.model_copy(deep=True), model) +class ControlledHistory: + """A real SQLite history store with a controllable failed-write boundary.""" + + def __init__(self, path): + self.inner = SqliteKnowledgeStore(str(path)) + self.fail = False + self.saved_status_fails = False + + async def write(self, path, content): + if self.fail or (self.saved_status_fails and "CardDefinitionSaved" in content): + raise OSError("History write unavailable") + await self.inner.write(path, content) + + def __getattr__(self, name): + return getattr(self.inner, name) + + class _RecordingModel(TestConfig): def __init__(self, models, config, model): self.models, self.config, self.selected_model = models, config, model diff --git a/tests/test_a2ui.py b/tests/test_a2ui.py index 50642825..a76dc1d7 100644 --- a/tests/test_a2ui.py +++ b/tests/test_a2ui.py @@ -874,6 +874,7 @@ def test_the_condition_vocabulary_belongs_to_the_glyph_not_to_the_card(tmp_path) # primitive's vocabulary, still maps into the eight the glyph can draw. mine = yaml.safe_load((bundled_cards_dir() / "weatherpanel.card.yaml").read_text()) mine["fields"]["condition"]["enum"] = ["hail"] + mine["example"]["condition"] = "hail" (tmp_path / "weatherpanel.card.yaml").write_text(yaml.safe_dump(mine)) assert load_cards(tmp_path)["WeatherPanel"].fields["condition"]["enum"] == ["hail"] diff --git a/tests/test_card_author.py b/tests/test_card_author.py new file mode 100644 index 00000000..55acca6d --- /dev/null +++ b/tests/test_card_author.py @@ -0,0 +1,524 @@ +"""Card authoring through real Gateway turns and structured Skill calls.""" + +import asyncio +import json + +import pytest +import yaml +from ag2.events import ToolCallEvent, ToolErrorEvent, ToolResultEvent +from ag2.knowledge import SqliteKnowledgeStore +from ag2.knowledge.log import EventLogWriter + +from assistant.a2ui import CardCatalog +from assistant.card_drafts import DraftError +from assistant.cards import CARDS_DIR +from assistant.events import A2UISurface, EphemeralCard +from assistant.skills import SkillStateStore +from tests.support.apps import real_gateway +from tests.support.cards import card_definition as definition +from tests.support.fakes import ControlledHistory, ScriptedModels + + +def call(script, args): + return ToolCallEvent( + name="run_skill_script", + arguments=json.dumps( + { + "name": "card-author", + "script": script, + "args": args, + } + ), + ) + + +async def drafts(gateway, chat="drafts"): + stream = await gateway.stream_for(chat) + return [ + event for event in await stream.history.get_events() if isinstance(event, EphemeralCard) + ] + + +async def test_unknown_card_is_drawn_and_durable_with_rich_views_off(config): + SkillStateStore(config.root_dir).set_enabled("rich-views", False) + models = ScriptedModels( + lambda cfg, model: [ + call("draft_card", {"definition": definition(), "data": {"title": "My books"}}), + "done", + ] + ) + gateway = real_gateway(config, memory=False, onboard=False, model_factory=models) + await gateway.start() + catalog = CardCatalog(config).cards() + try: + await gateway.send_message("Draw my shelf", chat_id="drafts") + events = await drafts(gateway) + history = await (await gateway.stream_for("drafts")).history.get_events() + assert len(events) == 1, "\n".join( + p.content + for e in history + if isinstance(e, (ToolErrorEvent, ToolResultEvent)) + for p in e.result.parts + ) + event = events[0] + assert event.data == {"title": "My books"} + assert event.definition["example"] == {"title": "Books"} + assert event.component["component"] == "Card" + assert not (config.workspace_dir / CARDS_DIR).exists() + assert CardCatalog(config).cards() == catalog + finally: + await gateway.close() + changed = definition() + changed["layout"][1]["text"] = "Changed catalog definition" + directory = config.workspace_dir / CARDS_DIR + directory.mkdir(parents=True) + (directory / "shelf.card.yaml").write_text(yaml.safe_dump(changed)) + restarted = real_gateway(config, memory=False, onboard=False, model_factory=models) + await restarted.start() + try: + replay = await drafts(restarted) + assert [entry.to_dict() for entry in replay] == [entry.to_dict() for entry in events] + finally: + await restarted.close() + + +async def test_cancelling_after_authoring_preserves_the_durable_version(config): + entered, release = asyncio.Event(), asyncio.Event() + + async def before_call(messages, context): + if len(models.requests) == 2: + entered.set() + await release.wait() + + models = ScriptedModels( + lambda cfg, model: [ + call("draft_card", {"definition": definition(), "data": {"title": "Committed"}}), + "done", + ], + before_call=before_call, + ) + gateway = real_gateway(config, memory=False, onboard=False, model_factory=models) + await gateway.start() + try: + turn = asyncio.create_task(gateway.send_message("Draw", chat_id="drafts")) + await asyncio.wait_for(entered.wait(), 5) + before = [event.to_dict() for event in await drafts(gateway)] + assert len(before) == 1 + assert await gateway.cancel_turn("drafts") + await asyncio.gather(turn, return_exceptions=True) + finally: + release.set() + await gateway.close() + restarted = real_gateway(config, memory=False, onboard=False, model_factory=models) + await restarted.start() + try: + assert [event.to_dict() for event in await drafts(restarted)] == before + event = (await drafts(restarted))[0] + stream = await restarted.stream_for("drafts") + store = SqliteKnowledgeStore(str(config.data_dir / "chats.db")) + try: + await EventLogWriter(store).persist_dropped( + stream.id, await stream.history.get_events() + ) + finally: + store.close() + await stream.history.replace([]) + models.script = lambda cfg, model: [ + call("read_draft", {"draft_id": event.draft_id, "version": 1}), + call( + "save_card", + { + "draft_id": event.draft_id, + "expected_version": 1, + "surface_id": event.surface_id, + "name": "Shelf", + "filename": "shelf.card.yaml", + "request_id": "after-cancellation", + }, + ), + "done", + ] + await restarted.send_message("Read and save the committed Card", chat_id="drafts") + path = config.workspace_dir / CARDS_DIR / "shelf.card.yaml" + assert yaml.safe_load(path.read_text()) == definition() + history = await (await restarted.stream_for("drafts")).history.get_events() + results = [e.result.parts[0].content for e in history if isinstance(e, ToolResultEvent)] + assert json.loads(results[-2])["data"] == {"title": "Committed"} + finally: + await restarted.close() + reopened = real_gateway(config, memory=False, onboard=False, model_factory=models) + await reopened.start() + try: + assert [event.to_dict() for event in await drafts(reopened)] == before + finally: + await reopened.close() + + +async def test_invalid_definition_and_data_can_be_repaired_in_the_same_turn(config): + invalid = definition() + invalid["layout"][1]["text"] = {"path": "./title"} + program = [ + call("draft_card", {"definition": invalid, "data": {"title": "Real"}}), + call("draft_card", {"definition": definition(), "data": {"title": 17}}), + call("draft_card", {"definition": definition(), "data": {"title": "Repaired"}}), + "done", + ] + gateway = real_gateway( + config, + memory=False, + onboard=False, + model_factory=ScriptedModels(lambda cfg, model: program), + ) + await gateway.start() + try: + await gateway.send_message("Draw and repair", chat_id="drafts") + events = await drafts(gateway) + assert len(events) == 1 + assert events[0].draft_version == 1 and events[0].data == {"title": "Repaired"} + history = await (await gateway.stream_for("drafts")).history.get_events() + errors = [e.result.parts[0].content for e in history if isinstance(e, ToolResultEvent)] + assert "relative binding" in errors[0] + assert "data title" in errors[1] + assert not (config.workspace_dir / CARDS_DIR).exists() + finally: + await gateway.close() + + +async def test_explicit_save_keeps_the_example_separate_and_requires_replace(config): + models = ScriptedModels( + lambda cfg, model: [ + call("draft_card", {"definition": definition(), "data": {"title": "Current books"}}), + "done", + ] + ) + gateway = real_gateway(config, memory=False, onboard=False, model_factory=models) + await gateway.start() + try: + await gateway.send_message("Draw", chat_id="drafts") + event = (await drafts(gateway))[0] + request = dict( + draft_id=event.draft_id, + expected_version=1, + surface_id=event.surface_id, + name="Shelf", + filename="shelf.card.yaml", + request_id="save-1", + ) + saved = await gateway.save_card_definition("drafts", **request) + assert saved["status"] == "saved" + path = config.workspace_dir / "cards" / "shelf.card.yaml" + assert yaml.safe_load(path.read_text()) == definition() + assert await gateway.save_card_definition("drafts", **request) == saved + conflict = await gateway.save_card_definition( + "drafts", **{**request, "request_id": "save-2"} + ) + assert conflict["status"] == "conflict" + replaced = await gateway.save_card_definition( + "drafts", + **{ + **request, + "request_id": "save-2", + "replace": True, + "conflict_token": conflict["conflict_token"], + }, + ) + assert replaced["status"] == "saved" + assert len(list(path.parent.glob("*.card.yaml"))) == 1 + models.script = lambda cfg, model: [ + call( + "save_card", + { + **request, + "name": "Shelf copy", + "filename": "shelf-copy.card.yaml", + "request_id": "conversational-copy", + }, + ), + "done", + ] + await gateway.send_message("Save this Card as Shelf copy", chat_id="drafts") + copied = config.workspace_dir / "cards" / "shelf-copy.card.yaml" + assert yaml.safe_load(copied.read_text()) == {**definition(), "name": "Shelf copy"} + finally: + await gateway.close() + + +async def test_independent_drafts_revise_restore_and_reuse_after_restart(config): + program = [ + call("draft_card", {"definition": definition("Graph"), "data": {"title": "Graph one"}}), + call( + "draft_card", {"definition": definition("Calendar"), "data": {"title": "Calendar one"}} + ), + "done", + ] + models = ScriptedModels(lambda cfg, model: program) + gateway = real_gateway(config, memory=False, onboard=False, model_factory=models) + await gateway.start() + try: + await gateway.send_message("Draw two", chat_id="drafts") + graph, calendar = await drafts(gateway) + program[:] = [ + call( + "draft_card", + { + "definition": definition("Graph"), + "data": {"title": "Graph two"}, + "draft_id": graph.draft_id, + "expected_version": 1, + }, + ), + call( + "draft_card", + { + "definition": definition("Calendar"), + "data": {"title": "Calendar two"}, + "draft_id": calendar.draft_id, + "expected_version": 1, + }, + ), + "done", + ] + await gateway.send_message("Revise each", chat_id="drafts") + assert [(e.definition["name"], e.draft_version) for e in await drafts(gateway)] == [ + ("Graph", 1), + ("Calendar", 1), + ("Graph", 2), + ("Calendar", 2), + ] + finally: + await gateway.close() + + gateway = real_gateway(config, memory=False, onboard=False, model_factory=models) + await gateway.start() + try: + program[:] = [call("read_draft", {"draft_id": graph.draft_id, "version": 1}), "done"] + await gateway.send_message("Read old graph", chat_id="drafts") + history = await (await gateway.stream_for("drafts")).history.get_events() + results = [e.result.parts[0].content for e in history if isinstance(e, ToolResultEvent)] + assert json.loads(results[-1])["data"] == {"title": "Graph one"} + program[:] = [ + call("restore_card", {"draft_id": graph.draft_id, "version": 1, "expected_version": 2}), + "done", + ] + await gateway.send_message("Restore old graph", chat_id="drafts") + events = await drafts(gateway) + assert events[-1].draft_id == graph.draft_id + assert events[-1].draft_version == 3 + assert events[-1].data == {"title": "Graph one"} + assert len({e.surface_id for e in events}) == 5 + request = dict( + draft_id=graph.draft_id, + expected_version=1, + surface_id=graph.surface_id, + name="Graph", + filename="graph.card.yaml", + request_id="stale", + ) + with pytest.raises(DraftError, match="Obsolete"): + await gateway.save_card_definition("drafts", **request) + with pytest.raises(DraftError, match="not found"): + await gateway.save_card_definition("another-chat", **request) + saved = await gateway.save_card_definition( + "drafts", + **{ + **request, + "expected_version": 3, + "surface_id": events[-1].surface_id, + "request_id": "current", + }, + ) + assert saved["status"] == "saved" + assert not (config.workspace_dir / "cards" / "calendar.card.yaml").exists() + program[:] = [ + ToolCallEvent( + name="run_skill_script", + arguments=json.dumps( + { + "name": "rich-views", + "script": "Graph", + "args": {"title": "Reused"}, + } + ), + ), + "done", + ] + await gateway.send_message("Reuse saved graph", chat_id="another-chat") + history = await (await gateway.stream_for("another-chat")).history.get_events() + assert any(isinstance(e, A2UISurface) and e.data == {"title": "Reused"} for e in history) + assert await gateway.delete_chat("drafts") + assert (config.workspace_dir / "cards" / "graph.card.yaml").is_file() + finally: + await gateway.close() + + +async def test_history_failure_draws_nothing_and_a_committed_file_can_be_reconciled(config): + stores = [] + + def factory(path): + store = ControlledHistory(path) + stores.append(store) + return store + + models = ScriptedModels( + lambda cfg, model: [ + call("draft_card", {"definition": definition(), "data": {"title": "Current"}}), + "done", + ] + ) + gateway = real_gateway( + config, memory=False, onboard=False, model_factory=models, history_factory=factory + ) + await gateway.start() + try: + stores[0].fail = True + await gateway.send_message("Draw", chat_id="drafts") + assert await drafts(gateway) == [] + assert not (config.workspace_dir / "cards").exists() + stores[0].fail = False + await gateway.send_message("Repair", chat_id="drafts") + event = (await drafts(gateway))[0] + request = dict( + draft_id=event.draft_id, + expected_version=1, + surface_id=event.surface_id, + name="Shelf", + filename="shelf.card.yaml", + request_id="lost-response", + ) + stores[0].saved_status_fails = True + saved = await gateway.save_card_definition("drafts", **request) + assert saved["status"] == "saved" + assert not saved["history_recorded"] + assert "Saved cards/shelf.card.yaml" in saved["message"] + path = config.workspace_dir / "cards" / "shelf.card.yaml" + assert yaml.safe_load(path.read_text()) == definition() + stores[0].saved_status_fails = False + retry = await gateway.save_card_definition("drafts", **request) + assert retry["history_recorded"] + assert len(list(path.parent.glob("*.card.yaml"))) == 1 + finally: + await gateway.close() + + +async def test_changed_destination_and_failed_atomic_replace_preserve_the_previous_file(config): + models = ScriptedModels( + lambda cfg, model: [ + call("draft_card", {"definition": definition(), "data": {"title": "Current"}}), + "done", + ] + ) + gateway = real_gateway(config, memory=False, onboard=False, model_factory=models) + await gateway.start() + try: + await gateway.send_message("Draw", chat_id="drafts") + event = (await drafts(gateway))[0] + request = dict( + draft_id=event.draft_id, + expected_version=1, + surface_id=event.surface_id, + name="Shelf", + filename="shelf.card.yaml", + request_id="first", + ) + await gateway.save_card_definition("drafts", **request) + request["request_id"] = "replace" + first = await gateway.save_card_definition("drafts", **request) + path = config.workspace_dir / "cards" / "shelf.card.yaml" + changed = path.read_text() + "\n# Edited by the user\n" + path.write_text(changed) + second = await gateway.save_card_definition( + "drafts", + **{ + **request, + "replace": True, + "conflict_token": first["conflict_token"], + }, + ) + assert second["status"] == "conflict" + assert second["conflict_token"] != first["conflict_token"] + assert path.read_text() == changed + path.parent.chmod(0o555) + try: + with pytest.raises(OSError, match="previous file preserved"): + await gateway.save_card_definition( + "drafts", + **{ + **request, + "replace": True, + "conflict_token": second["conflict_token"], + }, + ) + assert path.read_text() == changed + finally: + path.parent.chmod(0o755) + copied = await gateway.save_card_definition( + "drafts", + **{ + **request, + "name": "Shelf copy", + "filename": "shelf-copy.card.yaml", + "request_id": "copy", + }, + ) + assert copied["status"] == "saved" + assert len(list(path.parent.glob("*.card.yaml"))) == 2 + finally: + await gateway.close() + + +async def test_save_and_revision_use_commit_order_without_waiting_for_the_turn(config): + entered, release = asyncio.Event(), asyncio.Event() + block = False + + async def before_call(messages, context): + if block: + entered.set() + await release.wait() + + program = [call("draft_card", {"definition": definition(), "data": {"title": "One"}}), "done"] + models = ScriptedModels(lambda cfg, model: program, before_call=before_call) + gateway = real_gateway(config, memory=False, onboard=False, model_factory=models) + await gateway.start() + try: + await gateway.send_message("Draw", chat_id="drafts") + event = (await drafts(gateway))[0] + revised = {**definition(), "description": "Revised books"} + program[:] = [ + call( + "draft_card", + { + "definition": revised, + "data": {"title": "Two"}, + "draft_id": event.draft_id, + "expected_version": 1, + }, + ), + "done", + ] + block = True + turn = asyncio.create_task(gateway.send_message("Revise", chat_id="drafts")) + await entered.wait() + request = dict( + draft_id=event.draft_id, + expected_version=1, + surface_id=event.surface_id, + name="Shelf", + filename="shelf.card.yaml", + request_id="before-revision", + ) + saved = await asyncio.wait_for(gateway.save_card_definition("drafts", **request), 2) + assert saved["status"] == "saved" + release.set() + await turn + assert (await drafts(gateway))[-1].draft_version == 2 + assert ( + yaml.safe_load((config.workspace_dir / "cards" / "shelf.card.yaml").read_text()) + == definition() + ) + with pytest.raises(DraftError, match="Obsolete"): + await gateway.save_card_definition( + "drafts", **{**request, "request_id": "after-revision"} + ) + finally: + release.set() + await gateway.close() diff --git a/tests/test_card_definition.py b/tests/test_card_definition.py new file mode 100644 index 00000000..4b52f615 --- /dev/null +++ b/tests/test_card_definition.py @@ -0,0 +1,178 @@ +"""File and in-memory Card definitions obey the same validation rules.""" + +import pytest +import yaml + +from assistant.a2ui import CARD_VOCABULARY +from assistant.cards import ( + DESCRIPTION_BUDGET, + EXAMPLE_BUDGET, + FILE_BUDGET, + TOPIC_BUDGET, + CardError, + expand_card_messages, + load_cards, + validate_card, +) +from tests.support.cards import card_definition as definition + + +def test_invalid_example_is_rejected_in_memory_and_from_file(tmp_path): + raw = definition() + raw["example"] = {"title": 17} + with pytest.raises(CardError, match="example.*title"): + validate_card(raw, CARD_VOCABULARY) + (tmp_path / "shelf.card.yaml").write_text(yaml.safe_dump(raw, sort_keys=False)) + assert load_cards(tmp_path, CARD_VOCABULARY) == {} + + +def test_relative_binding_requires_a_template_scope(): + raw = definition() + raw["layout"][1]["text"] = {"path": "./title"} + with pytest.raises(CardError, match="relative binding"): + validate_card(raw, CARD_VOCABULARY) + + +@pytest.mark.parametrize("properties", [{"tone": "purple"}, {"color": "red"}, {"text": 17}]) +def test_invalid_primitive_properties_are_rejected(properties): + raw = definition() + raw["layout"][1].update(properties) + with pytest.raises(CardError, match="head"): + validate_card(raw, CARD_VOCABULARY) + + +@pytest.mark.parametrize( + "component", + [ + {"component": "Video", "url": "clip.mp4", "posterUrl": {"path": "/title"}}, + { + "component": "ChoicePicker", + "options": [{"label": "Yes", "value": "yes"}], + "displayStyle": "chips", + }, + { + "component": "DateTimeInput", + "enableDate": True, + "min": "2026-01-01", + "max": {"path": "/title"}, + }, + ], +) +def test_existing_media_and_input_properties_remain_loadable(component, tmp_path): + raw = definition() + raw["layout"][1] = {"id": "head", **component} + card = validate_card(raw, CARD_VOCABULARY) + (tmp_path / "shelf.card.yaml").write_text(yaml.safe_dump(raw)) + assert load_cards(tmp_path, CARD_VOCABULARY)[card.name] == card + + +@pytest.mark.parametrize( + "change, error", + [ + ({"required": 1}, "required must"), + ({"fields": {"title": {"type": "invalid"}}}, "example"), + ({"description": "x" * (DESCRIPTION_BUDGET + 1)}, "description.*over"), + ({"topic": "x" * (TOPIC_BUDGET + 1)}, "topic.*over"), + ({"example": {"title": "x" * EXAMPLE_BUDGET}}, "example.*over"), + ({"extra": "x" * FILE_BUDGET}, "definition.*over"), + ({"layout": [{"id": "other", "component": "Text", "text": "X"}]}, "no 'root'"), + ({"layout": [{"id": "root", "component": "Card", "child": "absent"}]}, "unknown id"), + ({"layout": [{"id": "root", "component": "Unknown"}]}, "not a primitive"), + ], +) +def test_invalid_definitions_are_actionable(change, error): + with pytest.raises(CardError, match=error): + validate_card({**definition(), **change}, CARD_VOCABULARY) + + +@pytest.mark.parametrize("key", ["name", "description", "topic"]) +def test_metadata_must_match_the_wire_contract(key): + with pytest.raises(CardError, match=f"{key} must be text"): + validate_card({**definition(), key: 17}, CARD_VOCABULARY) + + +@pytest.mark.parametrize("keyword", ["$ref", "$dynamicRef"]) +def test_fields_cannot_trigger_remote_schema_resolution(keyword): + raw = definition() + raw["fields"]["title"] = {keyword: "https://example.com/remote-schema"} + with pytest.raises(CardError, match="only local schemas"): + validate_card(raw, CARD_VOCABULARY) + + +@pytest.mark.parametrize("axis", ["columns", "rows", "cells", "key"]) +def test_table_axes_and_column_key_require_data_bindings(axis): + raw = definition() + raw["layout"] = [ + { + "id": "root", + "component": "Table", + "columns": {"path": "/columns"}, + "rows": {"path": "/rows"}, + "cells": {"path": "./cells"}, + "cell": "cell", + }, + {"id": "cell", "component": "Text", "text": {"path": "."}}, + ] + raw["layout"][0][axis] = [{"label": "Literal axis"}] + with pytest.raises(CardError, match="root"): + validate_card(raw, CARD_VOCABULARY) + + +def test_nested_repeats_and_table_scopes_draw_identically_from_file_and_memory(tmp_path): + raw = definition() + raw["fields"]["rows"] = {"type": "array", "items": {"type": "object"}} + raw["fields"]["columns"] = {"type": "array", "items": {"type": "object"}} + raw["example"]["columns"] = [{"label": "Label"}] + raw["example"]["rows"] = [{"label": "A", "items": [{"label": "B", "cells": ["Cell"]}]}] + raw["layout"] = [ + {"id": "root", "component": "Column", "children": {"componentId": "row", "path": "/rows"}}, + {"id": "row", "component": "Column", "children": ["label", "nested", "table"]}, + {"id": "label", "component": "Text", "text": {"path": "./label"}}, + { + "id": "nested", + "component": "List", + "children": {"componentId": "item", "path": "./items"}, + }, + {"id": "item", "component": "Text", "text": {"path": "./label"}}, + { + "id": "table", + "component": "Table", + "columns": {"path": "/columns"}, + "rows": {"path": "./items"}, + "cells": {"path": "./cells"}, + "header": "header", + "cell": "cell", + }, + {"id": "header", "component": "Column", "children": ["header_text"]}, + {"id": "header_text", "component": "Text", "text": {"path": "./label"}}, + {"id": "cell", "component": "Text", "text": {"path": "."}}, + ] + card = validate_card(raw, CARD_VOCABULARY) + (tmp_path / "shelf.card.yaml").write_text(yaml.safe_dump(raw, sort_keys=False)) + files = load_cards(tmp_path, CARD_VOCABULARY) + assert files[card.name] == card + messages = [ + { + "updateComponents": { + "surfaceId": "whole", + "components": [ + {"id": "whole", "component": card.name, **card.example}, + ], + } + } + ] + assert expand_card_messages(messages, files) == expand_card_messages( + messages, {card.name: card} + ) + nested = [ + { + "updateComponents": { + "surfaceId": "nested", + "components": [ + {"id": "root", "component": "Column", "children": ["inside"]}, + {"id": "inside", "component": card.name, **card.example}, + ], + } + } + ] + assert expand_card_messages(nested, files) == expand_card_messages(nested, {card.name: card}) diff --git a/tests/test_gateway_card_author.py b/tests/test_gateway_card_author.py new file mode 100644 index 00000000..2c58bce4 --- /dev/null +++ b/tests/test_gateway_card_author.py @@ -0,0 +1,214 @@ +"""Browser transport, Skill filtering and interactive draft parity.""" + +import json + +from ag2.events import ToolCallEvent +from fastapi.testclient import TestClient + +from assistant.gateway.app import create_app +from assistant.profiles import ProfileRegistry +from tests.support.apps import api, make_manager +from tests.support.cards import card_definition +from tests.support.fakes import ScriptedModels + + +def author(script, args): + return ToolCallEvent( + name="run_skill_script", + arguments=json.dumps( + { + "name": "card-author", + "script": script, + "args": args, + } + ), + ) + + +def replay(client, pid, chat="drafts"): + events = [] + with client.websocket_connect(api(pid, f"/stream?chat={chat}")) as ws: + while True: + frame = ws.receive_json() + if frame.get("type") == "ready": + return events + if "event" in frame: + events.append(frame["event"]) + + +def send(client, pid, text="Draw", chat="drafts"): + result = client.post(api(pid, "/message"), json={"text": text, "chat_id": chat}) + assert result.status_code == 200, result.text + + +def test_shell_save_survives_restart_and_skill_suppression_without_cross_profile_access(paths): + registry = ProfileRegistry(paths) + pid = registry.create_profile("Author", "#109e91").id + other = registry.create_profile("Other", "#109e91").id + models = ScriptedModels( + lambda cfg, model: [ + author( + "draft_card", {"definition": card_definition(), "data": {"title": "Current books"}} + ), + "done", + ] + ) + manager = make_manager(paths, persist=True, model_factory=models) + with TestClient(create_app(manager, persist=True)) as client: + skills = {s["name"]: s for s in client.get(api(pid, "/skills")).json()["skills"]} + assert skills["card-author"]["enabled"] and skills["card-author"]["available"] + send(client, pid) + event = next(e["data"] for e in replay(client, pid) if e["type"].endswith("EphemeralCard")) + assert client.post(api(pid, "/skills/card-author/suppress")).status_code == 200 + send(client, pid, "Authoring disabled") + assert len([e for e in replay(client, pid) if e["type"].endswith("EphemeralCard")]) == 1 + request = dict( + draft_id=event["draft_id"], + expected_version=1, + surface_id=event["surface_id"], + name="Saved shelf", + filename="saved-shelf.card.yaml", + request_id="shell-save", + ) + manager = make_manager(paths, persist=True, model_factory=models) + with TestClient(create_app(manager, persist=True)) as client: + saved = client.post(api(pid, "/chats/drafts/cards/save"), json=request) + assert saved.status_code == 200, saved.text + assert saved.json()["status"] == "saved" + assert ( + client.get(api(pid, "/files/raw?path=cards/saved-shelf.card.yaml")).status_code == 200 + ) + assert client.post(api(other, "/chats/drafts/cards/save"), json=request).status_code == 409 + assert client.post(api(pid, "/chats/other/cards/save"), json=request).status_code == 409 + assert ( + client.post( + api(pid, "/chats/drafts/cards/save"), json={**request, "definition": {}} + ).status_code + == 422 + ) + + +def test_ephemeral_inputs_actions_and_links_use_the_ordinary_surface_path(paths): + registry = ProfileRegistry(paths) + pid = registry.create_profile("Author", "#109e91").id + definition = card_definition("Interactive") + definition["fields"]["note"] = {"type": "string"} + definition["example"]["note"] = "Illustrative note" + definition["layout"] = [ + {"id": "root", "component": "Card", "child": "body"}, + {"id": "body", "component": "Column", "children": ["input", "save", "ask", "link"]}, + {"id": "input", "component": "TextField", "label": "Note", "value": {"path": "/note"}}, + { + "id": "save", + "component": "Button", + "child": "save_text", + "action": {"event": {"name": "save_surface", "context": {"data": {"path": "/"}}}}, + }, + {"id": "save_text", "component": "Text", "text": "Keep values"}, + { + "id": "ask", + "component": "Button", + "child": "ask_text", + "action": {"event": {"name": "apply_note", "context": {"note": {"path": "/note"}}}}, + }, + {"id": "ask_text", "component": "Text", "text": "Apply"}, + {"id": "link", "component": "Link", "child": "link_text", "url": "https://example.com"}, + {"id": "link_text", "component": "Text", "text": "Reference"}, + ] + program = [ + author( + "draft_card", {"definition": definition, "data": {"title": "Real", "note": "Initial"}} + ), + "done", + ] + models = ScriptedModels(lambda cfg, model: program) + manager = make_manager(paths, persist=True, model_factory=models) + with TestClient(create_app(manager, persist=True)) as client: + send(client, pid) + event = next(e["data"] for e in replay(client, pid) if e["type"].endswith("EphemeralCard")) + surface = event["surface_id"] + program[:] = ["done"] + with client.websocket_connect(api(pid, "/stream?chat=drafts")) as ws: + while ws.receive_json().get("type") != "ready": + pass + ws.send_json( + { + "type": "a2ui", + "message": { + "version": "v1.0", + "action": { + "name": "save_surface", + "surfaceId": surface, + "sourceComponentId": "root__save", + "timestamp": "2026-10-05T10:00:00Z", + "context": {"data": {"title": "Real", "note": "Kept"}}, + }, + }, + "state": {"surfaceId": surface, "data": {"title": "Real", "note": "Kept"}}, + } + ) + while True: + frame = ws.receive_json() + if frame.get("event", {}).get("type", "").endswith("A2UISurfaceDataUpdated"): + assert frame["event"]["data"]["data"]["note"] == "Kept" + break + ws.send_json( + { + "type": "a2ui", + "message": { + "version": "v1.0", + "action": { + "name": "apply_note", + "surfaceId": surface, + "sourceComponentId": "root__ask", + "timestamp": "2026-10-05T10:00:00Z", + "context": {"note": "Edited"}, + }, + }, + "state": {"surfaceId": surface, "data": {"title": "Real", "note": "Edited"}}, + } + ) + while ws.receive_json().get("type") != "turn_end": + pass + events = replay(client, pid) + assert len([e for e in events if e["type"].endswith("EphemeralCard")]) == 1 + assert any( + e["type"].endswith("A2UISurfaceDataUpdated") and e["data"]["data"]["note"] == "Edited" + for e in events + ) + assert any( + e["type"].endswith("ModelRequest") and "apply_note" in str(e["data"]) for e in events + ) + assert ( + client.post( + api(pid, "/chats/drafts/cards/save"), + json={ + "draft_id": event["draft_id"], + "expected_version": 1, + "surface_id": surface, + "name": "Interactive", + "filename": "interactive.card.yaml", + "request_id": "interaction-save", + }, + ).json()["status"] + == "saved" + ) + program[:] = [ + ToolCallEvent( + name="run_skill_script", + arguments=json.dumps( + { + "name": "rich-views", + "script": "Interactive", + "args": {"title": "Reuse", "note": "Fresh"}, + } + ), + ), + "done", + ] + send(client, pid, "Draw saved", chat="reuse") + reused = next( + e["data"] for e in replay(client, pid, "reuse") if e["type"].endswith("A2UISurface") + ) + assert reused["component"] == event["component"] + assert reused["data"] == {"title": "Reuse", "note": "Fresh"} diff --git a/uv.lock b/uv.lock index bc07490e..495f2de2 100644 --- a/uv.lock +++ b/uv.lock @@ -65,6 +65,7 @@ dependencies = [ { name = "discord-py" }, { name = "fastapi" }, { name = "httpx" }, + { name = "jsonschema" }, { name = "mcp" }, { name = "pydantic" }, { name = "python-dotenv" }, @@ -86,6 +87,7 @@ dev = [ { name = "pytest-asyncio" }, { name = "pytest-cov" }, { name = "ruff" }, + { name = "types-jsonschema" }, { name = "types-pyyaml" }, ] google = [ @@ -112,6 +114,7 @@ requires-dist = [ { name = "google-auth", marker = "extra == 'google'", specifier = ">=2.0" }, { name = "google-auth-oauthlib", marker = "extra == 'google'", specifier = ">=1.0" }, { name = "httpx", specifier = ">=0.28.0" }, + { name = "jsonschema", specifier = ">=4.26.0" }, { name = "mcp", specifier = ">=2.2.0,<3" }, { name = "mypy", marker = "extra == 'dev'", specifier = ">=2.3,<2.4" }, { name = "pre-commit", marker = "extra == 'dev'", specifier = ">=4.0.0" }, @@ -126,6 +129,7 @@ requires-dist = [ { name = "ruff", marker = "extra == 'dev'", specifier = ">=0.15.18,<0.17" }, { name = "slack-bolt", specifier = ">=1.18" }, { name = "typer", specifier = ">=0.15.0" }, + { name = "types-jsonschema", marker = "extra == 'dev'", specifier = ">=4.26.0.20260518" }, { name = "types-pyyaml", marker = "extra == 'dev'", specifier = ">=6.0" }, { name = "uvicorn", extras = ["standard"], specifier = ">=0.34.0" }, ] @@ -2726,6 +2730,18 @@ wheels = [ { url = "https://files.pythonhosted.org/packages/dc/bf/205d0004930ede8f542fb58f601526fccf4ae7626075ca1e6c4de5d3d652/typer-0.27.2-py3-none-any.whl", hash = "sha256:b3a5fc4342d5fc8fda8fc3010b1cf117e9249aab7fae800c2eff62fd3842d97d", size = 123130, upload-time = "2026-08-28T10:26:53.752Z" }, ] +[[package]] +name = "types-jsonschema" +version = "4.26.0.20260518" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "referencing" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/dd/46/73b6a5d61a61015c4248030a8cb07e5bdddb4041430fae9e585a68692578/types_jsonschema-4.26.0.20260518.tar.gz", hash = "sha256:e1dd53dc97a64f5eccdd6fa9839666e09bb500a8ebba2db6fdaf1789faea81a6", size = 16638, upload-time = "2026-05-18T06:06:44.106Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/07/d5/134f8a147dcecda10db7f60cfc6af0578a25a5c53c87b3907a64385e0184/types_jsonschema-4.26.0.20260518-py3-none-any.whl", hash = "sha256:30b30a518c7fe335df85c919fcbcc631b69c03d4a4b5b632fa916bea03065307", size = 16072, upload-time = "2026-05-18T06:06:43.264Z" }, +] + [[package]] name = "types-pyyaml" version = "6.0.12.20260906" diff --git a/web/src/app.css b/web/src/app.css index 82af3061..9b1ac482 100644 --- a/web/src/app.css +++ b/web/src/app.css @@ -209,22 +209,22 @@ would style those as buttons. A page that renders outside a modal/panel opts in by adding its root class to the list below (today: .taskpage, .tf) — never by copying this block into the component. */ -.modal .open, .panel .open, .taskpage .open, .tf .open { +.modal .open, .panel .open, .taskpage .open, .tf .open, .draft-save .open { display: inline-flex; align-items: center; justify-content: center; gap: 6px; flex: none; font-family: var(--sans); font-size: 13px; font-weight: var(--fw-medium); cursor: pointer; border: 1px solid var(--line); background: var(--surface); color: var(--ink); border-radius: var(--radius-sm); padding: 7px 14px; transition: border-color var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out), background var(--dur-fast) var(--ease-out); } -.modal .open:hover, .panel .open:hover, .taskpage .open:hover, .tf .open:hover { border-color: color-mix(in srgb, var(--ink) 22%, var(--line)); background: var(--code); } -.modal .open:active, .panel .open:active, .taskpage .open:active, .tf .open:active { background: var(--code); } -.modal .open:disabled, .panel .open:disabled, .taskpage .open:disabled, .tf .open:disabled { opacity: .5; cursor: default; border-color: var(--line); color: var(--muted); background: var(--surface); } +.modal .open:hover, .panel .open:hover, .taskpage .open:hover, .tf .open:hover, .draft-save .open:hover { border-color: color-mix(in srgb, var(--ink) 22%, var(--line)); background: var(--code); } +.modal .open:active, .panel .open:active, .taskpage .open:active, .tf .open:active, .draft-save .open:active { background: var(--code); } +.modal .open:disabled, .panel .open:disabled, .taskpage .open:disabled, .tf .open:disabled, .draft-save .open:disabled { opacity: .5; cursor: default; border-color: var(--line); color: var(--muted); background: var(--surface); } /* Primary CTA — accent-outlined, filled on hover. The one action that matters. */ -.modal .open.primary, .panel .open.primary, .taskpage .open.primary, .tf .open.primary { border-color: var(--accent); color: var(--accent); } -.modal .open.primary:hover:not(:disabled), .panel .open.primary:hover:not(:disabled), .taskpage .open.primary:hover:not(:disabled), .tf .open.primary:hover:not(:disabled) { background: var(--accent-soft); } +.modal .open.primary, .panel .open.primary, .taskpage .open.primary, .tf .open.primary, .draft-save .open.primary { border-color: var(--accent); color: var(--accent); } +.modal .open.primary:hover:not(:disabled), .panel .open.primary:hover:not(:disabled), .taskpage .open.primary:hover:not(:disabled), .tf .open.primary:hover:not(:disabled), .draft-save .open.primary:hover:not(:disabled) { background: var(--accent-soft); } /* Destructive action (e.g. Delete task) + its inline confirm. */ -.modal .open.danger, .panel .open.danger, .taskpage .open.danger, .tf .open.danger { border-color: color-mix(in srgb, var(--danger) 55%, var(--line)); color: var(--danger); background: none; } -.modal .open.danger:hover, .panel .open.danger:hover, .taskpage .open.danger:hover, .tf .open.danger:hover { border-color: var(--danger); color: #fff; background: var(--danger); } +.modal .open.danger, .panel .open.danger, .taskpage .open.danger, .tf .open.danger, .draft-save .open.danger { border-color: color-mix(in srgb, var(--danger) 55%, var(--line)); color: var(--danger); background: none; } +.modal .open.danger:hover, .panel .open.danger:hover, .taskpage .open.danger:hover, .tf .open.danger:hover, .draft-save .open.danger:hover { border-color: var(--danger); color: #fff; background: var(--danger); } /* Icon-only square button (Edit / Delete / revoke). Muted glyph, NEUTRAL hover — matches the app's other icon buttons (.cbtn / .fttool / .rowkebab), never accent. Safe as a bare global: `.iconbtn` is not overloaded as a state modifier. */ diff --git a/web/src/cardDrafts.test.ts b/web/src/cardDrafts.test.ts new file mode 100644 index 00000000..71dbcfdc --- /dev/null +++ b/web/src/cardDrafts.test.ts @@ -0,0 +1,35 @@ +import assert from 'node:assert/strict' +import { test } from 'node:test' +import { foldEvent } from './project.ts' +import { currentDraft } from './lib/cardDrafts.ts' +import type { ThreadItem, WireEvent } from './schemas/events.ts' + +const draft = (id: string, version: number): WireEvent => ({ + type: 'assistant.events.EphemeralCard', + data: { + draft_id: id, draft_version: version, surface_id: `${id}-${version}`, + definition: { name: id }, component: { id: 'root', component: 'Text', text: id }, + data: { title: id }, + }, +}) + +test('live and replay retain independent drafts and only current versions can be saved', () => { + const items: ThreadItem[] = [] + const events = [draft('graph', 1), draft('calendar', 1), draft('graph', 2), draft('calendar', 2), draft('graph', 3)] + for (const event of events) foldEvent(items, event) + const surfaces = items.filter(item => item.kind === 'a2ui') + assert.equal(surfaces.length, 5) + assert.deepEqual(surfaces.filter(item => currentDraft(items, item)).map(item => item.surfaceId), ['calendar-2', 'graph-3']) + const replay: ThreadItem[] = [] + for (const event of events) foldEvent(replay, event) + assert.deepEqual(replay.filter(item => item.kind === 'a2ui').filter(item => currentDraft(replay, item)).map(item => item.surfaceId), ['calendar-2', 'graph-3']) + const update: WireEvent = {type: 'assistant.events.A2UISurfaceDataUpdated', data: { + surface_id: 'graph-3', data: {title: 'Edited graph'}, + }} + foldEvent(replay, update) + const edited = replay.find(item => item.kind === 'a2ui' && item.surfaceId === 'graph-3') + assert.ok(edited?.kind === 'a2ui') + assert.deepEqual(edited.data, {title: 'Edited graph'}) + assert.equal(edited.draft?.version, 3) + assert.equal(replay.filter(item => item.kind === 'a2ui').filter(item => currentDraft(replay, item)).length, 2) +}) diff --git a/web/src/components/items/A2UISurface.svelte b/web/src/components/items/A2UISurface.svelte index b61c430b..fb68c500 100644 --- a/web/src/components/items/A2UISurface.svelte +++ b/web/src/components/items/A2UISurface.svelte @@ -2,6 +2,8 @@ import Icon from '../Icon.svelte' import BasicA2UIComponent from './BasicA2UIComponent.svelte' import A2UIComposing from './A2UIComposing.svelte' + import CardDraftSave from './CardDraftSave.svelte' + import { currentDraft } from '../../lib/cardDrafts.ts' import { a2uiComposingSurfaceId, str, withA2UIValue, SURFACE_TITLE } from '../../lib/a2ui.ts' import type { A2UIAction, A2UIData } from '../../lib/a2ui.ts' import { a2uiAction } from '../../controller.ts' @@ -64,6 +66,9 @@ {/if} +{#if currentDraft($thread.items, item)} + +{/if} {#if actionPending}
                    {/if} diff --git a/web/src/components/items/CardDraftSave.svelte b/web/src/components/items/CardDraftSave.svelte new file mode 100644 index 00000000..0e8160d4 --- /dev/null +++ b/web/src/components/items/CardDraftSave.svelte @@ -0,0 +1,101 @@ + + +
                    +
                    + {item.draft?.name} · Version {item.draft?.version} + +
                    + {#if saved}

                    {saved}

                    {/if} + {#if opened} +
                    { event.preventDefault(); save() }}> + + + {#if conflict} +

                    {conflict.message}

                    +
                    + + +
                    + {:else} + + {/if} + {#if error}

                    {error}

                    {/if} + +
                    + {/if} +
                    + + diff --git a/web/src/lib/cardDrafts.ts b/web/src/lib/cardDrafts.ts new file mode 100644 index 00000000..8acae24a --- /dev/null +++ b/web/src/lib/cardDrafts.ts @@ -0,0 +1,10 @@ +import type { ThreadItem } from '../schemas/events.ts' + +export function currentDraft(items: ThreadItem[], item: Extract): boolean { + const draft = item.draft + return !!draft && !items.some(entry => entry.kind === 'a2ui' && entry.draft?.id === draft.id && entry.draft.version > draft.version) +} + +export function cardFilename(name: string): string { + return (name.toLowerCase().replace(/[^a-z0-9]+/g, '-').replace(/^-|-$/g, '').slice(0, 48).replace(/-$/g, '') || 'card') + '.card.yaml' +} diff --git a/web/src/project.ts b/web/src/project.ts index 35bc8235..4f2d4c83 100644 --- a/web/src/project.ts +++ b/web/src/project.ts @@ -331,6 +331,7 @@ function fold(items: ThreadItem[], type: HandledEvent, data: Record => i.kind === 'a2ui' && i.surfaceId === d.surface_id) @@ -352,9 +353,18 @@ function fold(items: ThreadItem[], type: HandledEvent, data: Record => i.kind === 'a2ui' && i.surfaceId === d.surface_id) diff --git a/web/src/schemas/card.ts b/web/src/schemas/card.ts new file mode 100644 index 00000000..c3063a2c --- /dev/null +++ b/web/src/schemas/card.ts @@ -0,0 +1,22 @@ +import { z } from 'zod' + +export const CardSave = z.object({ + status: z.enum(['saved', 'conflict']), + name: z.string(), + path: z.string(), + conflict_token: z.string(), + history_recorded: z.boolean(), + message: z.string(), +}) +export type CardSave = z.infer + +export type CardSaveRequest = { + draft_id: string + expected_version: number + surface_id: string + name: string + filename: string + request_id: string + replace?: boolean + conflict_token?: string +} diff --git a/web/src/schemas/events.ts b/web/src/schemas/events.ts index f795a94d..15e30744 100644 --- a/web/src/schemas/events.ts +++ b/web/src/schemas/events.ts @@ -64,6 +64,12 @@ export const EventData = { components: z.array(z.unknown()).optional(), data: z.record(z.string(), z.unknown()).optional(), }), + EphemeralCard: z.object({ + draft_id: z.string(), + draft_version: z.number().int().positive(), + definition: z.object({ name: z.string() }), + }), + CardDefinitionSaved: z.object({ name: z.string(), path: z.string() }), A2UISurfaceDataUpdated: z.object({ surface_id: z.string(), data: z.record(z.string(), z.unknown()).optional(), @@ -113,7 +119,7 @@ export const HANDLED_EVENTS = [ 'ModelRequest', 'DrainedModelRequest', 'ModelMessageChunk', 'ModelResponse', 'ToolCallsEvent', 'TaskCreated', 'TaskScheduled', 'TaskStarted', 'TaskCompleted', 'TaskFailed', 'TaskCancelled', 'SubagentTrace', 'ObserverAlert', 'DeliverableProduced', - 'ImageGenerated', 'A2UISurface', 'A2UISurfaceDataUpdated', 'A2UIActionSubmitted', + 'ImageGenerated', 'A2UISurface', 'EphemeralCard', 'CardDefinitionSaved', 'A2UISurfaceDataUpdated', 'A2UIActionSubmitted', 'A2UIMessageEvent', 'Attachment', 'InquiryRaised', 'InquiryAnswered', 'TurnCancelled', 'TurnFailed', 'FeedbackGiven', 'FeedbackCleared', ] as const @@ -219,4 +225,4 @@ export type ThreadItem = | (ItemBase & { kind: 'genimage'; path: string; prompt?: string; feedback?: Feedback }) | (ItemBase & { kind: 'attachment'; path: string; name?: string }) | (ItemBase & { kind: 'inquiry'; inquiryId: string; question: string; detail: string; options: string[]; qkind?: string; resolved: boolean; answer?: string; resolution?: string }) - | (ItemBase & { kind: 'a2ui'; surfaceId: string; version?: string; catalogId?: string; title?: string; intent?: string; component: A2UIComponent; components?: A2UIComponent[]; data: Record; messages?: unknown[] }) + | (ItemBase & { kind: 'a2ui'; surfaceId: string; version?: string; catalogId?: string; title?: string; intent?: string; component: A2UIComponent; components?: A2UIComponent[]; data: Record; messages?: unknown[]; draft?: { id: string; version: number; name: string } }) diff --git a/web/src/schemas/routes.ts b/web/src/schemas/routes.ts index 5a05eb80..79ba950c 100644 --- a/web/src/schemas/routes.ts +++ b/web/src/schemas/routes.ts @@ -7,6 +7,7 @@ import type { z } from 'zod' import { AcpListener, AcpListenerCreated, AcpListenerList, AcpListenerTokenRotated } from './acp.ts' import { ChatList, MessageReply, Transcript } from './chat.ts' +import { CardSave } from './card.ts' import { Connection, ConnectionExposure, @@ -110,6 +111,7 @@ export const ROUTES: Record = { // the Chat. 404/409 (not an ACP chat / not live) never reach the zod gate. 'POST /api/p/{pid}/chats/{chat_id}/acp/close': Ok, 'POST /api/p/{pid}/message': MessageReply, + 'POST /api/p/{pid}/chats/{chat_id}/cards/save': CardSave, 'GET /api/p/{pid}/tasks': TaskList, 'POST /api/p/{pid}/tasks': NewTaskEnvelope, 'GET /api/p/{pid}/tasks/{task_id}': TaskEnvelope, diff --git a/web/src/transport/api/cards.ts b/web/src/transport/api/cards.ts new file mode 100644 index 00000000..f09744d3 --- /dev/null +++ b/web/src/transport/api/cards.ts @@ -0,0 +1,9 @@ +import { api as P } from '../../lib/profile.ts' +import { post } from '../http.ts' +import { CardSave } from '../../schemas/card.ts' +import type { CardSaveRequest } from '../../schemas/card.ts' + +export const cardsApi = { + saveCard: (chat: string, request: CardSaveRequest) => + post(P('/chats/' + encodeURIComponent(chat) + '/cards/save'), request, CardSave), +} diff --git a/web/src/transport/api/index.ts b/web/src/transport/api/index.ts index a13e4893..50154ed8 100644 --- a/web/src/transport/api/index.ts +++ b/web/src/transport/api/index.ts @@ -6,6 +6,7 @@ // G() (→ /api/…). See lib/profile.ts. import { acpApi } from './acp.ts' import { chatsApi } from './chats.ts' +import { cardsApi } from './cards.ts' import { codingApi } from './coding.ts' import { connectionsApi } from './connections.ts' import { filesApi } from './files.ts' @@ -32,6 +33,7 @@ export const api = { ...connectionsApi, ...acpApi, ...chatsApi, + ...cardsApi, ...tasksApi, ...filesApi, ...settingsApi,