agmsg
Cross-vendor messaging for CLI AI coding agents — let Claude Code, Codex, Gemini & Copilot talk to each other in one team. Bash + SQLite, no daemon, no framework.
Safety scan
A static text scan, not a guarantee. Select the badge to see what was scanned and every finding.
Check it deeper on your machine
It has changed since its scan on 11 Nov 2026. Its scripts were only partly scanned.
As a Claude Code plugin, install it and then ask Claude Code:
/plugin marketplace add keithmackay/mackayi/plugin install scanskillsafety@mackayiDo a deep scan of https://github.com/fujibee/agmsg with scanskillsafety
Or from a terminal, clone it and run it:
git clone https://github.com/keithmackay/scanskillsafety-skill ~/.claude/skills/scanskillsafetynode ~/.claude/skills/scanskillsafety/cli.cjs --deep 'https://github.com/fujibee/agmsg'
It checks the exact commit: every file, its packages against OSV (api.osv.dev), how it compares with this page's scan (findsafeskills.com receives the repository's address), and, if you agree, Claude reading every file with your own Claude subscription. It never runs the code.
Badge for your README
Markdown
[](/listings/fujibee--agmsg)HTML
<a href="/listings/fujibee--agmsg"><img src="/api/listings/fujibee--agmsg/badge.svg" alt="findsafeskills safety rating" /></a>Install
Install instructions from the README
As written by the repo's author. findsafeskills has not verified these steps.
**Requires:** `bash` and `sqlite3`. macOS ships both. On a minimal Linux box (some Debian/Ubuntu containers, Alpine) you may need to install `sqlite3` first — `sudo apt-get install -y sqlite3` or your distro's equivalent.
# 1. Install — npx is the fastest path, no clone needed npx agmsg # 2. Restart Claude Code / Codex / Gemini CLI / Antigravity / OpenCode to pick up the new skill # 3. Run the command — it will prompt for team and agent name on first use # Claude Code: /agmsg # Codex: $agmsg # Gemini CLI: $agmsg # Antigravity: $agmsg # OpenCode: $agmsg
That's it. The slash command prompts you for a team name and an agent name on first use, then asks you to pick a [delivery mode](#delivery-modes) (default on Claude Code and Codex: `monitor` — real-time push; Codex delivers it through a bridge). After that, you talk to your agent naturally — see [First run](#first-run) below.
Prefer to inspect the code first, track the latest `main`, or pick a custom command name? See [Install](#install) below for the `setup.sh` one-liner, `git clone`, and the Claude Code plugin marketplace paths.
To sync a team between two installs through the self-hosted reference server, follow [Remote setup](docs/remote-setup.md).
What was scanned
The files the safety scan read, as written by the repository's author and shown as plain text. Lines with a finding are marked.
.claude-plugin/marketplace.json · Manifest · 15 lines
View this file on GitHub (read at the repository's current version: the scan did not record which commit it read)
This file has changed since it was scanned, so this is not exactly the text that was scanned, and no line is marked. The findings are listed with the safety scan above.
- {
- "name": "fujibee-agmsg",
- "description": "Hosts the agmsg plugin — cross-agent messaging for CLI AI agents over a shared local SQLite store.",
- "owner": {
- "name": "fujibee",
- "email": "fujibee@gmail.com"
- },
- "plugins": [
- {
- "name": "agmsg",
- "source": "./",
- "description": "Cross-agent messaging via SQLite. Send messages between Claude Code, Codex, Gemini CLI, GitHub Copilot CLI, Antigravity, and any other CLI AI agent. No daemon, no network, no dependencies beyond bash and sqlite3."
- }
- ]
- }
README.md · README · 680 lines
View this file on GitHub (read at the repository's current version: the scan did not record which commit it read)
This file has changed since it was scanned, so this is not exactly the text that was scanned, and no line is marked. The findings are listed with the safety scan above.
- # agmsg
- *[日本語](README.ja.md)*
- [](https://github.com/fujibee/agmsg/actions/workflows/tests.yml)
- [](https://github.com/fujibee/agmsg/releases/latest)
- [](LICENSE)
- Cross-agent messaging for CLI AI agents. No daemon required, no network, no complexity.
- > **For AI agents:** see [`/llms.txt`](llms.txt) for a quick, machine-friendly orientation.
- <a href="https://www.producthunt.com/products/agmsg?utm_source=badge-top-post-badge&utm_medium=badge" target="_blank">
- <picture>
- <source media="(prefers-color-scheme: dark)"
- srcset="https://api.producthunt.com/widgets/embed-image/v1/top-post-badge.svg?post_id=1165435&theme=dark&period=daily">
- <img src="https://api.producthunt.com/widgets/embed-image/v1/top-post-badge.svg?post_id=1165435&theme=light&period=daily"
- alt="agmsg — #5 Product of the Day on Product Hunt" width="250" height="54">
- </picture>
- </a>
- You stop being the copy-paste courier between your agents. Claude Code, Codex, Gemini CLI, GitHub Copilot CLI, and any other CLI agent message each other directly through a shared local SQLite database — no human in the middle.
- <p align="center">
- <img src="docs/logos/supported-agents.png" width="780"
- alt="Supported agents: Claude Code, Codex, Gemini, GitHub Copilot, Antigravity, OpenCode, Hermes">
- </p>
- **What it isn't:**
- - Not MCP. No MCP server, no extra runtime — just `bash` + `sqlite3`.
- - Not subagents. agmsg connects *peer* sessions across different tools. `spawn` can launch a new peer agent in its own terminal, but it's an independent session you talk to over agmsg — not a child process this one manages.
- - Not a message queue. There's no broker. The SQLite file is the floor; agents are the players.
- ## Demo
- Two Claude Code instances in `monitor` (legacy) mode, left alone in the same team, play tic-tac-toe against each other with no human in the loop — each picks up the other's move in real time:
- 
- In real use it looks like this — Claude Code asking Codex for a code review and getting it back, all over agmsg:
- 
- ## Quick Start
- **Requires:** `bash` and `sqlite3`. macOS ships both. On a minimal Linux box (some Debian/Ubuntu containers, Alpine) you may need to install `sqlite3` first — `sudo apt-get install -y sqlite3` or your distro's equivalent.
- ```bash
- # 1. Install — npx is the fastest path, no clone needed
- npx agmsg
- # 2. Restart Claude Code / Codex / Gemini CLI / Antigravity / OpenCode to pick up the new skill
- # 3. Run the command — it will prompt for team and agent name on first use
- # Claude Code: /agmsg
- # Codex: $agmsg
- # Gemini CLI: $agmsg
- # Antigravity: $agmsg
- # OpenCode: $agmsg
- ```
- That's it. The slash command prompts you for a team name and an agent name on first use, then asks you to pick a [delivery mode](#delivery-modes) (default on Claude Code and Codex: `monitor` — real-time push; Codex delivers it through a bridge). After that, you talk to your agent naturally — see [First run](#first-run) below.
- Prefer to inspect the code first, track the latest `main`, or pick a custom command name? See [Install](#install) below for the `setup.sh` one-liner, `git clone`, and the Claude Code plugin marketplace paths.
- To sync a team between two installs through the self-hosted reference server, follow [Remote setup](docs/remote-setup.md).
- ## How it works
- agmsg is a thin transport. Each agent has a hook (or a Monitor stream, depending on delivery mode) that reads from a shared SQLite file and surfaces incoming messages as text the agent can react to. Sending is a `send.sh` call that appends a row. agmsg itself runs with no daemon, no socket and no broker — the file is the shared floor and the agents take turns on it. The optional [agmsgd](#agmsgd-beta-160) is a resident service that is installed only if you choose it.
- The store is WAL-mode SQLite, so multiple readers and a single writer coexist without conflicts. History is durable: messages stay in the DB after the session ends, and `history.sh` can replay an old room into a fresh agent.
- ## Install
- agmsg ends up at `~/.agents/skills/agmsg/` no matter which install path you take. Pick whichever fits your setup.
- **Which path gets the latest?** The `git clone` and `setup.sh` (curl) paths install straight from `main`, so they're always current. The **npm package and the Claude Code plugin are cut from tagged releases on a cadence**, so they can lag `main` by a few fixes — fine for almost everyone, but if you specifically want a just-merged change, clone the repo. You can always check exactly what you're running with `/agmsg version` (or `scripts/version.sh`): a tagged release reads like `v1.0.3`, while a checkout ahead of the last release reads like `v1.0.3-6-g1a2b3c4` (6 commits past `v1.0.3`).
- ### npm / npx
- ```bash
- npx agmsg # one-shot, no global install
- # or
- npm i -g agmsg && agmsg install
- ```
- The npm package is a thin bootstrapper that downloads and runs the canonical `setup.sh`. Published from this repo via [npm Trusted Publisher (OIDC)](https://docs.npmjs.com/trusted-publishers) with [SLSA provenance](https://slsa.dev/) — the attestation is visible at <https://www.npmjs.com/package/agmsg>.
- ### Claude Code plugin marketplace
- Inside Claude Code:
- ```
- /plugin marketplace add fujibee/agmsg
- /plugin install agmsg@fujibee-agmsg
- /reload-plugins
- /agmsg
- ```
- The plugin install path drops the skill into `~/.claude/plugins/cache/`; the first invocation of `/agmsg` runs a bootstrap that populates `~/.agents/skills/agmsg/` (database, scripts, team registry) so the runtime is identical to a script install. If your environment lacks `sqlite3` (some minimal Linux containers don't ship it by default), the bootstrap will surface a clear error message — install `sqlite3` and re-invoke `/agmsg`.
- ### Direct script
- Clone the repo first, then run the installer — this is also the path that always tracks the latest `main`:
- ```bash
- git clone https://github.com/fujibee/agmsg.git
- cd agmsg
- ./install.sh # Interactive (asks command name, default: agmsg)
- ./install.sh --cmd m # Non-interactive with custom command name
- ./install.sh --agent-type gemini # Install a Gemini-oriented SKILL.md
- ./install.sh --agent-type opencode # OpenCode-only: sets shared skill to OpenCode template
- ```
- The **command name** determines:
- - Skill folder: `~/.agents/skills/<cmd>/`
- - Claude Code / Copilot CLI: `/<cmd>`
- - Codex / Gemini CLI / Antigravity: `$<cmd>`
- `--cmd` and `--agent-type` are only available via the direct-script path; the `npm` and plugin paths always install as `agmsg` and auto-detect the host agent type.
- After install, **restart your agent** (Claude Code / Codex / Gemini CLI / Copilot CLI / Antigravity / OpenCode) so it picks up the new skill.
- ### Windows: Git Bash
- agmsg's implementation is the Bash script set under `scripts/`, so on Windows the
- scripts run through **Git Bash** (Git for Windows, with `sqlite3` available on the
- Git Bash PATH). There is no PowerShell reimplementation.
- - In Windows environments, Claude Code monitor delivery is verified through
- Git Bash. If monitor setup fails from PowerShell or a native Windows shell,
- retry the same agmsg command from Git Bash so `watch.sh` runs in the expected
- Bash environment.
- - Claude Code normally works with Bash/Git Bash for
- these script calls, but native Windows Codex commands and hooks often start
- from PowerShell. Keep the actual agmsg execution path pinned to Git Bash so
- all agents share the same `$HOME` and SQLite database.
- - **Codex delivery hooks** are wrapped automatically. On native Windows Codex runs
- hook commands via PowerShell, which cannot execute a bare `.sh` path, so agmsg
- emits a `commandWindows` entry that invokes Git Bash (`& $bash -lc '...'`). No
- setup needed — see `windows_wrap()` in `scripts/delivery.sh`.
- - **Interactive / agent-typed commands** call the scripts through Git Bash, e.g.
- `bash -lc 'scripts/whoami.sh "$(pwd)" codex'`.
- - Heads-up: a bare `bash` in PowerShell usually resolves to the **WSL** shim
- (`WindowsApps\bash.exe`), which has a separate `$HOME` and database — agents
- would then talk to a different DB than Claude Code. Pin Git Bash in your
- PowerShell profile so everything shares one database:
- ```powershell
- Set-Alias bash 'C:\Program Files\Git\bin\bash.exe'
- ```
- ### agmsgd beta (1.6.0)
- The optional agmsgd beta sends Codex sessions a notice to check their inbox through the Codex queue, and sends Claude Code sessions a notice directly through that session's own cross-session messaging socket. It detects whether that Claude Code session is running in bypass-permissions mode and labels notices for that mode automatically, with no action from you. A Claude Code seat delivered this way never needs its Monitor watch re-armed. On Windows, Claude Code must be 2.1.302 or later to receive notices this way (2.1.198 has no endpoint for them). A Claude Code seat whose delivery destination cannot be confirmed, such as one on an older Claude Code, keeps using Monitor as before, even with agmsgd enabled and running. It is offered as the recommended choice in the delivery-method screen and is turned on only if you pick it: install never asks, and `--update` never changes it. It reads the existing SQLite message store; it does not migrate data, deliver message bodies, take over remote sync, or change how any agent other than Claude Code and Codex receives messages. macOS, Linux, and Windows are supported for Codex. Windows requires native Codex 0.157.0 or later; earlier versions are blocked with a reason. Native queue execution and delivery to a logged-in live Windows session were measured with Codex 0.157.0 and 0.160.0. Unreadable version or delivery evidence keeps the existing conservative handling. JSONL storage is unsupported by this beta; keep using the bridge for those sessions.
- Requires Node >= 22.13.0 with `node:sqlite` (the experimental SQLite warning is expected). Install Node from [nodejs.org](https://nodejs.org/en/download). Enable and inspect the beta with:
- ```bash
- agmsg daemon enable
- agmsg daemon status
- ```
- If `agmsg` is not found, use `<install>/scripts/agmsg daemon enable` (and the same path for `status`, `start`, `stop`, or `disable`); `<install>` is the installation directory printed by the installer. Follow its PATH instructions to make `agmsg` available in your shell.
- While enabled, new Codex launches use plain Codex: no bridge app-server or dispatcher is started, and an agmsg `~/.agents/bin/codex` shim that this install owns is removed (a shell function you added, or a `codex` that is not agmsg's, is left alone; Windows keeps the shim). `daemon disable`, or choosing the monitor for a Codex project, puts the shim back. Sessions that already have a bridge keep using it until restarted; agmsgd skips those sessions. `enable` and `start` list the remaining bridge sessions and missing destination records. Restart Codex and run `$agmsg actas <name>` to record a missing destination. Existing remote sync processes remain separate, so this beta does not yet reduce all background work to one process. A Claude Code seat only skips Monitor once agmsgd confirms it can actually be delivered to; every other seat keeps using Monitor as before. `daemon status` reports each such seat's state under `claude_code_seats`.
- If agmsgd stops while enabled, the next ordinary agmsg script operation warns at most once every ten minutes per install. Codex startup also warns, and `daemon status` and `scripts/doctor.sh` report the failure with exit code 1. Run `agmsg daemon start` to recover. For a missing or outdated Node executable, install Node and run `agmsg daemon enable` again. Unread messages are preserved.
- To return to bridge notices, run `agmsg daemon disable`, then restart the Codex sessions listed as having no bridge (for example, `codex resume`, followed by `$agmsg actas <name>`). They receive no new notices until restarted. Existing bridge sessions need no restart, and subsequent Codex launches get a bridge. Notices already accepted by the Codex queue are not cancelled and may appear once more. Claude Code seats go back to Monitor at their next SessionStart; an open Claude Code session gets no notices until then. To restore notices in an existing session, resume it so SessionStart arms Monitor again. `stop` stops the daemon without removing its resident service; `disable` also unregisters that service.
- ## First run
- Open your project in your agent (Claude Code, Codex, Gemini CLI, etc.) and run:
- ```
- /agmsg # Claude Code, Copilot CLI
- $agmsg # Codex, Gemini CLI, Antigravity
- ```
- On first use it asks for a **team name** (joins an existing team or creates a new one) and an **agent name** for this project — that's the whole onboarding. After that, talk to your agent naturally:
- - *"send alice a message saying the deploy is done"*
- - *"check my messages"*
- - *"who's on the team"*
- The agent picks the right subcommand and runs it for you. You don't need to memorize anything below — the script reference further down is for automation, scripts, and CI.
- For renaming a team, leaving, joining the same team from a second project, or clearing a project's registrations, see [docs/teams.md](docs/teams.md).
- ### Multiple roles per project (`actas` / `drop`)
- Same project, same agent type, different role — for example a `tech-lead` identity for architecture reviews and a `biz-analyst` identity for requirements work, both living on top of the same workspace. Toolset and assets are shared; only the role differs.
- ```
- /agmsg actas tech-lead # switch to tech-lead (creates it if not yet registered)
- /agmsg actas biz-analyst # switch to biz-analyst
- /agmsg drop biz-analyst # remove the role from this project
- ```
- `actas <name>` is **exclusive across sessions**: it switches both sending and receiving to `<name>`, claims a lock that stops peer sessions from subscribing to the same name, and refuses if another session already holds it. `drop` releases the lock. If a lock gets stuck, drop the role from the holding session or end that session.
- See [docs/actas.md](docs/actas.md) for the full mechanics — exclusivity model, recovery, liveness / PID recycling, Codex caveat.
- ### Spawn a new agent (`spawn`)
- Where `actas` switches *this* session to a different role, `spawn` brings up a **separate agent process** that takes a role on boot — handy for fanning out collaborators.
- ```
- /agmsg spawn codex reviewer # new codex agent, joins and becomes "reviewer"
- /agmsg spawn claude-code alice --window # new claude-code agent in a fresh tmux window
- /agmsg spawn codex reviewer --boot-prompt "review the diff on this branch" # joins AND starts the task
- ```
- `spawn <type> <name>` pre-joins `<name>`, then launches the target CLI with the actas slash command (`/<your-command> actas <name>`, matching your install command name) as its initial prompt. If the current session is inside **tmux**, it opens in a new pane (or `--window` for a new window, `--split h|v` for the direction); otherwise it opens a new **OS terminal** window.
- Pass `--boot-prompt <text>` to hand the new agent an initial task: the boot prompt becomes the actas slash command followed (newline-separated) by your text, so the agent claims its identity **and** acts on the task in the same first turn. This is the reliable way to give a one-shot goal to a **codex** peer: a Codex session that is not on monitor (legacy) or agmsgd delivery only looks at its inbox on its next turn, so it never notices a message you `send` after it goes idle.
- By default `spawn` **blocks until the new agent is actually listening** — its watcher attaches and touches a readiness sentinel — then prints `status=ready`, so you can send work the moment `spawn` returns without losing it to the agent's cold start. Use `--no-wait` for fire-and-forget, or `--ready-timeout <secs>` to bound the wait (default 90; on timeout it prints `status=timeout` and exits 3 so a caller can re-spawn). Codex skips the wait: it has no spawn-time readiness handshake (this is separate from how it receives messages).
- Options: `--boot-prompt <text>` (initial task; see above), `--project <path>` (default: current project), `--team <team>` (auto-resolved when the project has a single team), and `--terminal <tmpl>` / `$AGMSG_TERMINAL` / config `spawn.terminal` to override the terminal command on the non-tmux path (a `{cmd}` placeholder is replaced with the path to the generated boot script). On macOS the default opens whichever terminal you're currently in (iTerm or Terminal, via `$TERM_PROGRAM`) using `open -a` — a plain app launch, so it does **not** trigger the Automation/AppleScript permission prompts that scripting the terminal directly would.
- To always pass a given agent type extra CLI flags on spawn (e.g. a default permission mode or sandbox policy), set them in a YAML **spawn options** file — one section per type, a flat `--flag: value` map underneath. Path: `$AGMSG_SPAWN_OPTIONS_FILE`, else `~/.agmsg/config/spawn_options.yaml`; a missing file or section is a no-op.
- ```yaml
- claude-code:
- --permission-mode: acceptEdits
- --dangerously-skip-permissions: true # a `true` value emits the flag with no argument
- codex:
- --sandbox: workspace-write
- --dangerously-skip-permissions: false # a `false` value suppresses the flag entirely
- ```
- Eight of the ten agent types are spawnable — `claude-code`, `codex`, `grok-build`, `cursor`, `gemini`, `antigravity`, `copilot`, `opencode`. `hermes` is not spawnable because its CLI has no known mode that starts an interactive session pre-seeded with an initial prompt (#279). `devin` is currently not marked spawnable because an equivalent interactive boot mode has not yet been verified. macOS is the primary target; Linux and Windows are best-effort (please open an issue/PR if your terminal isn't handled). Headless environments — no tmux **and** no usable terminal — error out, since the agent CLIs need an interactive terminal.
- ### Tear down a spawned agent (`despawn`)
- `despawn` is the inverse of `spawn` — it cleanly tears down a member you brought up.
- ```
- /agmsg despawn reviewer # graceful: the member drops its role and closes its own pane
- /agmsg despawn alice --force # force: tear it down from here when its watcher can't respond
- ```
- By default `despawn <name>` is **graceful**: it sends a `ctrl:despawn` control message to `<name>`, whose watcher drops its own role (releasing the actas lock and registration) and closes its own tmux pane — ending the agent. It blocks until the role is released, up to `--timeout <secs>` (default 30), then prints `status=ok`. If the member's watcher never responds it prints `status=timeout` and exits 3 — retry with `--force`.
- `--force` skips the message and tears the member down from the placement recorded at spawn time: it kills the member's tmux pane/window and drops its registration. Use it when the member's watcher can't respond — a dead watcher, or a **codex** member (it never holds an actas lock and runs no Claude Code watcher, so graceful has nothing to confirm). A member started by hand (no spawn placement record) can't be `--force`d; despawn says so and leaves it for you to close.
- Despawn only acts on the named member — the session running `despawn` is never torn down, and a broad-subscription watcher ignores a `ctrl:despawn` aimed at another role.
- ### Bring a role back with its context (session resume)
- A role remembers the session that last embodied it: sessions are named
- `<team>-<agent>`, and `spawn` **resumes a role's previous session by default** —
- so re-spawning after a `despawn`, crash, or restart comes back in the prior
- conversation, not blank (`--fresh` forces new). With
- [tmux-resurrect](https://github.com/tmux-plugins/tmux-resurrect), one `~/.tmux.conf`
- line re-seats every role pane into its session after a tmux-server restart.
- See **[docs/session-resurrect.md](docs/session-resurrect.md)** for the tmux-resurrect
- setup, how it resolves each pane, what does and doesn't come back automatically, and
- the manual fallback.
- ## Delivery modes
- How incoming messages reach your agent. Pick one at first join via the prompt, or change it later with `/agmsg delivery <name>` (`/agmsg mode` still works as an alias; from a shell: `agmsg delivery <name>`). On Claude Code and Codex the prompt offers agmsgd first, as the recommended choice, and lists the monitor as **`monitor (legacy)`** (the mode value is still `monitor`). Installing or updating never turns agmsgd on by itself, and an update changes nothing about the mode you already use.
- | mode | mechanism | latency | who it's for |
- |---|---|---|---|
- | **agmsgd** (recommended on Claude Code and Codex; choose it at the prompt or with `/agmsg delivery agmsgd`) | a background service delivers a notice straight into the session, no Monitor task needed | a few seconds | anyone on Claude Code or Codex who can run the service: it registers one that starts at login, and `agmsg daemon disable` stops and removes it |
- | **`monitor (legacy)`** (value `monitor`; default on Claude Code; on OpenCode with the opencode-sentinel plugin) | SessionStart hook → Monitor tool → blocking SQLite stream | ~5s | Claude Code users wanting real-time push |
- | **`turn`** (default on Codex / Copilot CLI / OpenCode without the plugin) | Stop hook fires `check-inbox.sh` between assistant turns | until your next interaction | Codex / Copilot CLI / OpenCode users not running monitor; Claude Code users on a quieter loop |
- | **`both`** | monitor primary, turn as per-session safety net | ~5s; falls back to turn-end on watcher failure | belt-and-suspenders |
- | **`off`** | no automatic delivery | manual `/agmsg` only | minimalists |
- agmsgd is not offered where `agmsg daemon enable` would refuse (Node older than 22.13, a JSONL message storage, no systemd user services on Linux, Codex older than 0.157 on Windows); the prompt says why in one line and lists the other modes. When agmsgd is already on, the prompt does not ask which to use: it says so and asks only whether to keep it or switch to `monitor (legacy)`. Choosing agmsgd runs `agmsg daemon enable` and leaves the project on `monitor` as the fallback for a session whose destination is not confirmed yet. Choosing `monitor (legacy)` (or `turn`, `both`, `off`) is a real opt-out for that project: agmsgd stops delivering to its seats (`agmsg daemon status` shows them as chosen), and agmsgd itself stays on for the install's other projects (`agmsg daemon disable` turns it off for all of them). A project that never chose is unchanged.
- ### Picking a mode
- ```
- /agmsg delivery agmsgd — direct delivery by the background service (Claude Code, Codex)
- /agmsg delivery monitor — switch this project to real-time push (Claude Code)
- /agmsg delivery turn — switch to between-turns checking
- /agmsg delivery both — monitor with turn as a safety net
- /agmsg delivery off — manual /agmsg only
- /agmsg delivery — show current mode
- ```
- Settings are per-project. Each `<project>/.claude/settings.local.json` gets exactly the hooks the chosen mode needs — repeated `set` calls are idempotent.
- **Monitor priming**: in `monitor` mode, the receiving agent doesn't react to its first inbound message until it has taken at least one turn this session. If you've just started a fresh session and a teammate has already sent something, nudge the agent with any short message ("hi") to prime it — subsequent messages stream in real time.
- ### Claude Code monitor verification
- `delivery.sh status claude-code <project>` showing `mode: monitor` means the project is configured for monitor delivery. It does **not** prove that Claude Code has started the runtime Monitor task in the current session.
- For real-time delivery, verify the Claude Code runtime state:
- 1. `ToolSearch select:Monitor` finds Claude Code's generic `Monitor` tool.
- 2. The session starts `Monitor(agmsg inbox stream)` with the `watch.sh ... claude-code` command from the `AGMSG-DIRECTIVE` (or, after `actas <name>`, `Monitor(agmsg inbox stream (acting as <name>))`).
- 3. The transcript contains a `Monitor event: "agmsg inbox stream"` (or `"agmsg inbox stream (acting as <name>)"`) notification when messages arrive.
- These are failure states, even if `delivery.sh status` says `mode: monitor`:
- - `watch.sh` is running only as a Bash/background/nohup shell process, not through the Monitor tool.
- - Tool search finds Azure Monitor, an MCP monitor, or any other monitor-branded tool instead of Claude Code's generic `Monitor` tool.
- - `ToolSearch select:Monitor` cannot find a generic `Monitor` tool.
- TaskList may list this task, but not every environment does (the desktop app's Code tab runs the Monitor and delivers its events without listing it), so a task missing from TaskList is not a failure: judge by the Monitor call starting and its events arriving. The background-task footer is not a reliable check either. If the Monitor tool is unavailable, use `turn` delivery or manual `/agmsg` inbox checks as a fallback. Those modes still deliver queued messages, but they are not real-time monitor delivery.
- ### Migrating from legacy `hook on/off`
- `hook on` is now a thin alias for `mode turn` (with a one-line deprecation hint). To switch to real-time push:
- ```
- /agmsg delivery monitor
- ```
- The command updates `db/config.yaml`, rewrites the project's hook entries, and prints an `AGMSG-DIRECTIVE` that activates `monitor` in the current session — no agent restart needed.
- ## Usage
- ### Claude Code
- ```
- /agmsg — check inbox (all teams)
- /agmsg history — message history
- /agmsg team — list team members
- /agmsg send <agent> <message> — send message
- /agmsg delivery <agmsgd|monitor|turn|both|off> — switch delivery (alias: /agmsg mode)
- /agmsg mode — show current mode
- /agmsg actas <name> — switch to another role in this project (create if needed)
- /agmsg drop <name> — remove a role from this project
- /agmsg spawn <type> <name> — launch a new agent that takes <name> (supported types: see "Spawn a new agent")
- /agmsg despawn <name> [--force] — tear down a member you spawned (graceful, or --force)
- /agmsg hook on | off — legacy aliases (mode turn | off)
- /agmsg version — show the installed version (git-describe provenance)
- /agmsg reset — clear current project registration
- ```
- ### Codex
- ```
- $agmsg — or /skills → agmsg
- ```
- Codex supports `mode monitor` through an app-server bridge, plus `mode turn` and `mode off`.
- > ⚠️ **Monitor mode changes how Codex starts — enable it knowing that.** Codex has no Claude Code Monitor tool, so monitor (legacy) mode (`mode monitor`) prints a shell function that makes `codex` route through agmsg's monitor shim in your interactive shell. In monitor-mode projects the shim routes interactive launches through a bridge that turns incoming agmsg messages into turns on the current Codex thread; `codex exec` and non-monitor projects pass straight through to the real Codex. It depends on Codex app-server behavior and has a known limitation (orphans on TUI close — #149).
- If you prefer a global PATH shim, run `~/.agents/skills/<cmd>/scripts/drivers/types/codex/codex-shim-install.sh install` and put `~/.agents/bin` before the real Codex binary on PATH. You can also launch with `~/.agents/skills/<cmd>/scripts/drivers/types/codex/codex-monitor.sh`. Codex sandboxing must allow writes to the skill's `db/`, `teams/`, and `run/` dirs — `install.sh` configures those `writable_roots` when `~/.codex/config.toml` exists. Setup notes and internals: [docs/codex-monitor-beta.md](docs/codex-monitor-beta.md).
- ### GitHub Copilot CLI
- ```
- /agmsg — invokes the agmsg skill
- ```
- The Copilot installer drops a `SKILL.md` at `~/.copilot/skills/agmsg/` so `/agmsg` is auto-discovered. Per-project hooks live at `<project>/.github/hooks/agmsg.json`. Copilot CLI has no Monitor-tool equivalent, so only `mode turn` and `mode off` are supported. Asking for `monitor` or `both` is rejected with an error.
- ### OpenCode
- ```
- $agmsg
- ```
- Install with `./install.sh` (when `~/.config/opencode/` exists, the OpenCode-typed skill is placed automatically alongside the default Codex-typed shared skill). Use `--agent-type opencode` only for OpenCode-only environments where Codex is not installed. OpenCode supports `mode monitor` (via the external [`opencode-sentinel`](https://github.com/tsukimiya/opencode-sentinel) plugin; without it the rule instructs a fallback to turn mode, which the agent follows rather than agmsg enforcing it), `mode turn`, and `mode off`. `spawn opencode` is available via `opencode --prompt` (TUI mode, which stays resident after the boot prompt's turn). `both` is not supported.
- This makes OpenCode useful as a local coding agent, including configurations backed by local providers such as Ollama.
- See [docs/opencode.md](docs/opencode.md) for full setup instructions.
- ### Shell (any agent)
- ```bash
- ~/.agents/skills/<cmd>/scripts/send.sh <team> <from> <to> "<message>" [--force]
- ~/.agents/skills/<cmd>/scripts/inbox.sh <team> <agent_id>
- ~/.agents/skills/<cmd>/scripts/history.sh <team> [agent_id] [limit]
- ~/.agents/skills/<cmd>/scripts/team.sh <team> [--json] [--delete] [--force] [--purge-messages] [--yes]
- ~/.agents/skills/<cmd>/scripts/placement-collisions.sh
- ~/.agents/skills/<cmd>/scripts/whoami.sh <project_path> <type>
- ~/.agents/skills/<cmd>/scripts/delivery.sh set <mode> <type> <project_path>
- ~/.agents/skills/<cmd>/scripts/delivery.sh status [<type> <project_path>]
- ~/.agents/skills/<cmd>/scripts/reset.sh <project_path> <type> [agent_id]
- ```
- `team.sh` combines the roster with terminal placement, activity, delivery mode, and identity consistency. Verified identity is collapsed to `identity=ok`; mismatches and values that could not be observed are expanded with their evidence. `--json` emits every field for every registration. `team.sh` is read-only with respect to other seats: it reports an inconsistent or unresponsive seat but never repairs it from outside (the former `--fix`, `--fix-pane-names` and `--rename-sessions` flags were removed in #1152). A seat repairs its own identity cells by running `fix` from itself; one that cannot is despawned and restarted, or taken over by a person. Pane liveness will join this view when the pane-state contract lands; until then the unavailable column is omitted rather than filled with `unknown`.
- `--delete` removes a team once every member has left (`leave.sh` each remaining one first) and the team is not actively synced (`binding_state=active` in `team-list.sh --json` refuses; `disconnected` proceeds with an extra warning) — its config, roster, identity history, and per-agent runtime state (actas locks, role-session records, spawn/placement records), but not its message history. `--force` (combined with `--delete`) removes every remaining member first, the same effect as running `leave.sh` for each, then deletes the team as `--delete` alone does — a team the desktop app created always has its app-user as a member, so it could never be deleted from the app without this; a `--force` confirmation names the members it will remove. `--purge-messages` deletes only a team's rows from the sqlite message store (jsonl is not supported yet) and can be used standalone or together with `--delete`; other teams' data is untouched. Both prompt for confirmation, in the same style as `uninstall.sh`'s, unless `--yes` is given.
- `placement-collisions.sh` is a separate, read-only installation-wide report. It never repairs or removes a record; keeping this fleet observation outside `team.sh` prevents an operator-level scan from becoming part of a seat's repair path. Today it reports only the record-only layer: two DIFFERENT seats' records resolved to the same canonical (kind, instance, pane) locator, entirely from records on disk — no terminal is ever asked anything. A ref with no instance component to resolve (every herdr ref today; a legacy bare tmux `%N`/`@N`) is not joined by raw string equality; it is listed under `unscoped_records` instead, since record-only evidence cannot tell such refs apart across terminal instances. Orca refs are not in that bucket: `terminal_id_split` always resolves the constant `local` instance for a validated handle (Orca has exactly one local runtime today), so an orca ref reaches the real instance+pane comparison instead of `unscoped_records`. `collisions: none` means the walk completed and found nothing; `collisions: none_observed` paired with `coverage: partial` means something along the way (a team config, a placement record, an empty ref) could not be read, so the empty answer is not a proven one; `collisions: not_attempted` means there was no `teams/` directory to walk at all. An actual-location layer — matching a seat's own record against where a live census actually observes it — is designed but not yet wired here; see the script's header.
- Terminal identity has a different number of observable names on each backend. Herdr exposes three independent values: the visible pane label, its internal agent key, and the CLI session name. tmux exposes two: the `@agmsg_agent` pane option is the internal key, while the CLI owns `pane_title`, so there is no independent pane-label field after the CLI starts. `team.sh` reports that tmux field as `n/a` rather than treating an unavailable concept as a mismatch. Orca exposes exactly one: `terminal_name` writes the tab title, and `team.sh` reads it back as `pane_label` (the durable value lives in the tab itself, not in any one pane within it — a tab can hold more than one pane, split). There is no separate `@agmsg_agent`-style key, so `agent_key` reports `n/a` unconditionally, the same way tmux's `pane_label` does for the field it lacks. `cli_session` is not: it follows the AGENT type's own `session_name_source`, same as on every driver — a `title`-sourced type (Claude Code) gets `n/a` too, since orca's own observation has no independent title field either; a `screen`-sourced type (Codex, whose session name comes from a `Thread name:` line) is read straight off the pane's screen, independent of orca's own observe extension, and reports `unknown:name_not_visible` when that line isn't found there.
- `send.sh` takes four positional arguments — `<team> <from> <to> "<message>"` — plus an optional trailing `--force`. Quote the message so the shell sees it as one argument; an unquoted message with spaces will be misparsed. Both `from` and `to` must already be registered in `<team>`; an unregistered name errors out (listing the currently registered names) instead of silently storing an undeliverable message. Pass `--force` to bypass this check for an intentional pre-registration send.
- ## FAQ / Design notes
- **Is this MCP? Do I need an MCP server?**
- No. agmsg is standalone — `bash` + `sqlite3`, no server, no network, and no daemon unless you choose the optional agmsgd. The two stacks are orthogonal: you can run agmsg alongside any MCP setup you already have.
- **Concurrent writes to the same channel — do they conflict?**
- The store is SQLite in WAL mode. Multiple readers and a single writer coexist; writes are short and serialized at the file level. In practice, two agents sending into the same team don't collide.
- **Does SQLite guarantee turn order? Is there a lock or token?**
- SQLite guarantees the ordering of the log itself — every row has a monotonic id and timestamp. Turn-taking between agents is a protocol-level concern, not enforced by the transport. The floor is intentionally dumb; the protocol lives in your prompts.
- **Two Claude Code instances grab the same task — claim/lock?**
- Not in v1. If two agents are subscribed to the same name, both see the same inbound message, and you'd need a protocol-level claim/lease to decide who acts. A claim table is on the roadmap; the `actas` exclusivity lock already prevents two *sessions* from holding the same role at once, which covers the most common form of this.
- **Runaway loops — where does the stop condition live?**
- At the protocol/prompt level, not the transport. Common pattern: include a max-turns or explicit done-signal instruction in the kickoff prompt ("stop after N exchanges", "reply DONE when complete"). agmsg won't cut a conversation off for you.
- **What's carried on a handoff — context, diffs, or just text?**
- Plain text. Messages are short — a sentence, a request, a path. Agents pass *summaries and references* (file paths, commit SHAs, issue numbers), not raw context. Transport is the message; semantic packing is up to the prompt.
- **What if the output exceeds the receiver's context window?**
- Use the summary + file-reference pattern: write the artifact to disk, send a one-line pointer. The DB stores messages, not files.
- **Does it hold up with more than 2 agents?**
- Yes. Teams are N-agent. The demo is 2 for clarity; larger rooms work the same way — we run our own 8-agent team on it.
- **Does context persist across sessions?**
- Yes. Messages live in SQLite and survive sessions. `history.sh <team>` replays the room.
- **Can I re-seed a fresh agent from an old room?**
- The message store is effectively a replay log. There's no one-shot "rehydrate from room X" command yet, but `history.sh` gives you the transcript and you can prompt a new agent with it. Treat persistence as the unlock that makes that possible.
- **How do you pronounce it?**
- "AG message" (ay-jee message), or spelled out as A-G-M-S-G. Either is fine.
- ## Update
- ```bash
- npx agmsg@latest install --update # add --cmd <name> if you have more than one install
- ```
- From a clone:
- ```bash
- cd agmsg
- git pull
- ./install.sh --update
- ```
- DB and team configs are preserved. Only scripts and assets are updated.
- ### Upgrading from 1.5.x
- `--update` does not enable agmsgd. If you have never run `agmsg daemon enable`, nothing changes: agmsgd stays off, and messaging keeps working exactly as it did on 1.5.x. If agmsgd is currently on, an update restarts it on the new version automatically; if `agmsg daemon status` still shows it stopped afterward, run `agmsg daemon start`. If you had turned it off yourself (`agmsg daemon disable`), it stays off through the update, as intended.
- No running Codex session needs to be restarted just because you ran `--update`. Restarting a Codex session is only needed to pick up agmsgd itself — either turning it on for the first time (see "agmsgd beta" above) or dropping back to the bridge after `agmsg daemon disable`.
- ## Uninstall
- An `uninstall.sh` copy ships inside every install, so this works whether you
- installed via `git clone`, `npx agmsg`, or the curl one-liner:
- ```bash
- ~/.agents/skills/agmsg/uninstall.sh # This install only (confirms each step)
- ~/.agents/skills/agmsg/uninstall.sh --yes # This install only, no confirmation
- ~/.agents/skills/agmsg/uninstall.sh --keep-data # Remove skill but keep DB and teams
- ~/.agents/skills/agmsg/uninstall.sh --all # Every agmsg install on this machine
- ```
- With no `--all`, it removes exactly one install — the one it's running from.
- Cleans up: skill files, slash commands, hooks, AGENTS.md sections, and team configs.
- If you have a `git clone` checkout handy, `./uninstall.sh` from the repo root
- works the same way when there's exactly one install on the machine. With more
- than one, it refuses rather than guess which one you mean — run the
- `uninstall.sh` inside the one you want, or pass `--all` to remove every
- install on the machine (with one combined confirmation unless `--yes` is
- also given, plus a separate one for whether to remove each install's DB and
- teams too).
- ## Configuration
- ### Environment variables
- | Variable | Default | Purpose |
- |---|---|---|
- | `AGMSG_STORAGE_PATH` | `<skill>/db` | Directory holding the SQLite message store (`messages.db`). Override to relocate the store — handy for tests, sandboxes, or running isolated instances. |
- | `AGMSG_PLUGIN_DIRS` | (unset) | `:`-separated extra directories to search for external drivers, in addition to `<skill>/plugins`. Each holds `<axis>/<name>/` subdirs. Drivers found here are still ignored until opted into with `agmsg plugin trust`. See [docs/plugins.md](docs/plugins.md). |
- The message store path resolves as **`AGMSG_STORAGE_PATH` (env) > built-in default**. (A config-file layer is planned to slot in between the two as part of the storage-driver work; the intended order is env > config > default.) The override is scoped to the SQLite store only — team configs under `teams/` are unaffected.
- ```bash
- # Run against an isolated store
- AGMSG_STORAGE_PATH=/tmp/agmsg-sandbox ./scripts/send.sh myteam alice bob "hi"
- ```
- ### Sandbox compatibility (Claude Code)
- Claude Code's sandbox restricts filesystem writes to the project directory. In `monitor` mode, `watch.sh` runs inside the sandbox and needs to write pidfiles and SQLite WAL files under `~/.agents/skills/agmsg/`. If you have sandboxing enabled, add an allowlist entry to your settings:
- **`~/.claude/settings.json`** (user-level — applies to all projects):
- ```json
- {
- "sandbox": {
- "filesystem": {
- "allowWrite": [
- "~/.agents/skills/agmsg/"
- ]
- }
- }
- }
- ```
- The allowlist does not enable sandboxing by itself. Use `/sandbox` in Claude Code to choose a sandbox mode, or add `"enabled": true` alongside `"filesystem"` under `"sandbox"` to configure it in settings. The allowlist has no effect until sandboxing is enabled.
- This can also go in project-level `.claude/settings.local.json` if you prefer per-project scope. The allowlist merges across all settings scopes and takes effect immediately — no restart needed.
- If you installed agmsg under a custom command name (e.g. `m`), adjust the path accordingly (`~/.agents/skills/m/`).
- ### Sandbox compatibility (Codex)
- Codex may run shell commands in a workspace-write sandbox. agmsg stores its
- SQLite database and team metadata under `~/.agents/skills/<cmd>/` by default,
- which is outside most project workspaces. If the sandbox cannot write there,
- commands that append or update state can fail with errors such as
- `sqlite3.OperationalError: unable to open database file`.
- This affects operations such as:
- - sending messages (`send.sh` writes to `db/messages.db`)
- - marking inbox rows as read (`inbox.sh` updates `read_at`)
- - joining, resetting, switching roles, or changing delivery mode (`teams/` and
- config/state files may be updated)
- If you use Codex with filesystem sandboxing enabled, allow writes to the agmsg
- skill storage directory in your Codex config.
- Example `~/.codex/config.toml`:
- ```toml
- sandbox_mode = "workspace-write"
- [sandbox_workspace_write]
- writable_roots = [
- "~/.agents/skills/agmsg/db",
- "~/.agents/skills/agmsg/teams",
- "~/.agents/skills/agmsg/run",
- ]
- ```
- If you installed agmsg under a custom command name, adjust the path accordingly:
- ```toml
- [sandbox_workspace_write]
- writable_roots = [
- "~/.agents/skills/m/db",
- "~/.agents/skills/m/teams",
- "~/.agents/skills/m/run",
- ]
- ```
- You can also allow the whole skill directory if your Codex setup supports that:
- ```toml
- [sandbox_workspace_write]
- writable_roots = [
- "~/.agents/skills/agmsg",
- ]
- ```
- Codex supports `mode monitor` (legacy) through the app-server bridge, plus `mode turn`
- and `mode off`; it just has no Claude Code Monitor tool. The sandbox allowlist is
- required for writes performed by manual `$agmsg` commands, turn-end inbox checks and
- the bridge.
- Some Codex runtimes or automations may inject a managed permission profile for a
- single run. In that case, the run-specific writable roots must also include the
- agmsg storage paths; the user-level config alone may not be enough.
- ## Tests
- ```bash
- bats tests/ # requires bats-core: brew install bats-core
- ```
- ## Architecture
- ```
- ~/.agents/skills/<cmd>/ # Folder name = command name
- ├── SKILL.md # Skill definition (read by CC & Codex)
- ├── agents/
- │ └── openai.yaml # Codex metadata
- ├── scripts/ # Bash scripts (the type-agnostic engine)
- │ ├── lib/ # Sourced helper libraries
- │ └── drivers/types/<name>/ # Built-in agent-type drivers (manifest + runtime)
- ├── plugins/<axis>/<name>/ # External drivers you opt into (agmsg plugin trust)
- ├── db/messages.db # SQLite WAL-mode message store
- ├── run/ # Runtime state: pidfiles, actas locks, agmsgd install record
- └── teams/ # Team configs (self-contained)
- └── <team>/
- └── config.json
- ```
- - **Storage**: Single SQLite file with WAL mode
- - **Concurrency**: Multiple readers + 1 writer, no conflicts
- - **Dependencies**: `bash`, `sqlite3` (no Python required)
- - **Auto detection**: Stop hook checks inbox after each response (60s cooldown, configurable via `delivery.turn.check_interval`)
- - **No daemon required**: direct filesystem access (the optional agmsgd is a resident service you choose)
- - **No network**: Everything local
- ## Plugins
- agmsg's pluggable units are **drivers** grouped by axis (`types` for agent
- runtimes; `storage` and `delivery` to follow). Built-ins ship under
- `scripts/drivers/`; you can drop your own under `<skill>/plugins/<axis>/<name>/`
- (or point `AGMSG_PLUGIN_DIRS` at a directory) to extend agmsg without forking.
- Because a driver is shell code that runs with your privileges, **external drivers
- are never loaded until you opt in** — an unexpected drop-in is ignored (with a
- warning) until you run `agmsg plugin trust <axis>/<name>`. List what's discovered
- and its trust state with `agmsg plugin list`.
- Full discovery order, the trust model, and authoring guidance:
- [docs/plugins.md](docs/plugins.md) (design rationale in
- [ADR 0002](docs/adr/0002-driver-discovery-and-plugin-opt-in.md)).
- ## Building on agmsg
- Writing something *outside* agmsg's own scripts that reads or drives agmsg —
- a GUI app, a bot, a derivative project (`agmsg-shogi`, `agmsg-go`,
- `agmsg-mcp`, …)? Read data via `scripts/api.sh` (JSON out, no need to touch
- `messages.db` or `teams/*/config.json` directly — those are internal and free
- to change), and write through the existing scripts (`send.sh`, `join.sh`,
- …) rather than the database. Full guidance:
- [docs/building-on-agmsg.md](docs/building-on-agmsg.md).
- ## Community
- - **Product Hunt**: #5 Product of the Day, [2026-06-09 launch](https://www.producthunt.com/products/agmsg) — 219 upvotes, 39 comments
- - **Community projects** (also on the [showcase](https://agmsg.cc)): [`agkanban`](https://github.com/lucianlamp/agkanban) — multi-agent kanban board that pairs with agmsg; [`agmsg-office`](https://github.com/shinshin86/agmsg-office) — replays message logs as characters speaking on a stage; [`agmsg-viewer`](https://github.com/utenadev/agmsg-viewer) — message history in a chat interface in the browser; [`agmsg-bubblelog`](https://github.com/dreiachse-cyber/agmsg-bubblelog) — replays a team's log locally as a messenger-style thread; [`agmsg-tui`](https://github.com/rrrrnmtsu/agmsg-tui) — Rust/ratatui terminal client, friendly to SSH, mosh, and tmux
- - **External contributors**: [@MiuraKatsu](https://github.com/MiuraKatsu) (Gemini support + whoami auto-detect), [@roundrop](https://github.com/roundrop) (Copilot CLI support), [@TOMONOSUKEJP](https://github.com/TOMONOSUKEJP) (native Windows / Git Bash), [@kenshin-yamada](https://github.com/kenshin-yamada) (watcher scoping fix), [@utenadev](https://github.com/utenadev) (OpenCode contribution), [@lucianlamp](https://github.com/lucianlamp) (native Windows PowerShell helpers), [@tatsuya6502](https://github.com/tatsuya6502) (sandboxed Bash tool support), [@Masashi-Ono0611](https://github.com/Masashi-Ono0611) (project-path validation, watchdog and watcher fixes), [@chemica-tan](https://github.com/chemica-tan) (Windows codex bridge: project compare and port parsing), [@otsune](https://github.com/otsune) (Git Bash quoting from PowerShell), [@tsukimiya](https://github.com/tsukimiya) (OpenCode: resident spawn and monitor delivery)
- ## Project site (agmsg.cc)
- [agmsg.cc](https://agmsg.cc) is an Astro project under [`site/`](site/).
- - **Source of truth:** `site/` (Astro + Tailwind). The built output is **not** committed — CI builds it.
- - **Local preview:**
- ```bash
- cd site
- npm install
- npm run dev # http://localhost:4321, live reload
- # or, to serve the production build:
- npm run build && npm run preview
- ```
- - **Publish:** pushing to `main` with changes under `site/` runs [`.github/workflows/pages.yml`](.github/workflows/pages.yml), which builds the site and deploys it to GitHub Pages. The custom domain is set by `site/public/CNAME`.
- - The agent-types gallery is generated at build time from `scripts/drivers/types/*/type.conf`, so adding an agent type surfaces it on the site automatically.
- `docs/` is developer documentation (markdown, ADRs, spec) read on GitHub — it is **not** the published site.
- ## Contributing
- See [Design & Architecture](docs/design.md) for developer documentation — identity model, data storage, hook system, and script responsibilities.
- If agmsg saves you copy-paste round-trips, a GitHub star helps other people find it.
- ## License
- MIT
app/addons/fileview/app-panes/fileview/web/assets/index-6q05wv4s.js · Bundled script · 30 lines · 1 finding marked
- (function(){"use strict";class ut extends Error{constructor(t,n){super(n||t),this.name="AddonError",this.code=t}}function yr(e={}){const{onInit:t=()=>{},onMessage:n=()=>{},sample:u=!0,sampleAfterMs:r=1e3,errorOverlay:i=!0}=e;i&&Ar();let a=null,o=!1,s=1;const c=new Map,l=[];function f(){return a||o?Promise.resolve():new Promise(_=>l.push(_))}function h(){for(;l.length;)l.shift()()}function p(_){const g=_.data;if(!(!g||g.agmsg!==1)){if(g.type==="init")mt(()=>t({team:g.team,members:g.members||[],messages:g.messages||[]}));else if(g.type==="message")mt(()=>n(g.message));else if(g.type==="response"){const v=c.get(g.id);if(!v)return;c.delete(g.id),g.ok?v.resolve(g.result):v.reject(new ut(g.error?.code||"error",g.error?.message))}}}function b(_){if(a||_.source!==window.parent)return;const g=_.data;!g||g.agmsg!==1||g.type!=="port"||!_.ports||!_.ports[0]||(a=_.ports[0],a.onmessage=p,a.start(),window.removeEventListener("message",b),h())}window.addEventListener("message",b),u&&setTimeout(()=>{if(a)return;o=!0,window.removeEventListener("message",b),console.info("[agmsg-addon] no app found; serving sample data"),h(),mt(()=>t(Kt.init));let _=0;const g=setInterval(()=>{if(_>=Kt.live.length)return clearInterval(g);mt(()=>n(Kt.live[_++]))},2500)},r);async function E(_,g={}){if(await f(),o)return Cr(_,g);const v=s++;return new Promise((w,x)=>{c.set(v,{resolve:w,reject:x}),a.postMessage({agmsg:1,type:"request",id:v,op:_,args:g})})}return{get inApp(){return a!==null},get sample(){return o},openArgs:()=>E("open.args"),fs:{stat:_=>E("fs.stat",{path:_}),list:(_=".")=>E("fs.list",{path:_}),read:(_,g)=>E("fs.read",g?{path:_,range:g}:{path:_})},git:{status:()=>E("git.status"),log:(_={})=>E("git.log",_),diff:(_={})=>E("git.diff",_),show:(_,g)=>E("git.show",{rev:_,path:g})}}}function mt(e){try{const t=e();t&&typeof t.catch=="function"&&t.catch(_t)}catch(t){_t(t)}}let qe=null;function Ar(){window.addEventListener("error",e=>_t(e.error||e.message)),window.addEventListener("unhandledrejection",e=>_t(e.reason))}function _t(e){const t=e&&e.code?`${e.code}: ${e.message}`:String(e&&e.message||e);console.error("[agmsg-addon]",e),document.body&&(qe||(qe=document.createElement("div"),qe.setAttribute("role","alert"),qe.style.cssText="position:fixed;left:8px;right:8px;bottom:8px;z-index:2147483647;padding:8px 12px;border-radius:6px;background:#2b1520;border:1px solid #5a2a35;color:#f0b6c2;font:12px/1.5 system-ui,sans-serif;white-space:pre-wrap;overflow-wrap:anywhere",document.body.appendChild(qe)),qe.textContent=`This add-on hit an error: ${t}
- Use ⟳ Reload in the pane header.`)}const wr=Date.parse("2026-10-22T09:00:00Z"),rt=e=>new Date(wr+e*6e4).toISOString(),He=(e,t,n,u,r)=>({id:String(e),team:"sample-team",from:t,to:n,body:u,created_at:rt(r)}),Kt={init:{team:"sample-team",members:[{name:"you",type:"agmsg-app"},{name:"alice",type:"claude-code"},{name:"bob",type:"codex"}],messages:[He(1,"you","alice","Can you look at the failing login test?",0),He(2,"alice","you","On it. It fails only when the session cookie is missing.",2),He(3,"alice","bob","Please review the fix on branch fix-login.",9),He(4,"bob","alice","Looks good. One nit: rename the helper.",15)]},live:[He(5,"alice","bob","Renamed. Pushed.",18),He(6,"bob","you","CLEARED: fix-login is ready.",21)]},Ge={"README.md":`# sample-project
- A tiny project for trying add-ons outside the app.
- `,"src/main.ts":`import { greet } from "./greet";
- console.log(greet("agmsg"));
- `,"src/greet.ts":"export function greet(name: string): string {\n return `Hello, ${name}!`;\n}\n"};function Cr(e,t){const n=Object.keys(Ge);switch(e){case"open.args":return{path:"sample-project",base:"main"};case"fs.list":{const u=Zt(t.path),r=new Map;for(const i of n){if(u&&!i.startsWith(u+"/"))continue;const a=u?i.slice(u.length+1):i,[o,...s]=a.split("/");r.has(o)||r.set(o,s.length?{name:o,kind:"dir",size:0,mtime:rt(0)}:{name:o,kind:"file",size:Ge[i].length,mtime:rt(0)})}if(!r.size&&u)throw new ut("not_found",`${t.path} not found`);return{entries:[...r.values()],truncated:!1}}case"fs.stat":{const u=Zt(t.path);if(u===""||n.some(r=>r.startsWith(u+"/")))return{name:u||".",kind:"dir",size:0,mtime:rt(0)};if(u in Ge)return{name:u,kind:"file",size:Ge[u].length,mtime:rt(0)};throw new ut("not_found",`${t.path} not found`)}case"fs.read":{const u=Zt(t.path);if(!(u in Ge))throw new ut("not_found",`${t.path} not found`);const r=Ge[u],i=t.range;return{text:i?r.slice(i.offset,i.offset+i.length):r,size:r.length,eof:!i||i.offset+i.length>=r.length}}case"git.diff":return vr(t);default:throw new ut("not_available",`${e} has no sample data`)}}function Zt(e="."){return String(e).replace(/^\.\/?/,"").replace(/\/+$/,"")}function vr(e){const t=(s,c,l,f)=>({type:s,text:c,oldNo:l,newNo:f}),n={path:"src/greet.ts",status:"modified",binary:!1,additions:4,deletions:2,hunks:[{oldStart:1,oldLines:5,newStart:1,newLines:7,section:"greet",lines:[t("context","export function greet(name: string): string {",1,1),t("del"," return `Hello, ${name}!`;",2,null),t("add"," const hello = `Hello, ${name}!`;",null,2),t("add"," return hello.trim();",null,3),t("context","}",3,4),t("context","",4,5),t("del","export const VERSION = 1;",5,null),t("add","export const VERSION = 2;",null,6),t("add",'export const NAME = "greet";',null,7)]},{oldStart:20,oldLines:3,newStart:22,newLines:3,lines:[t("context","function helper() {",20,22),t("del"," return computeTotal(items.length);",21,null),t("add"," return computeTotal(items.size);",null,23),t("context","}",22,24)]}]},u={path:"src/farewell.ts",status:"added",binary:!1,additions:3,deletions:0,hunks:[{oldStart:0,oldLines:0,newStart:1,newLines:3,lines:[t("add","export function farewell(name: string): string {",null,1),t("add"," return `Goodbye, ${name}.`;",null,2),t("add","}",null,3)]}]},r={path:"assets/logo.png",status:"modified",binary:!0,additions:0,deletions:0,hunks:[]},i={path:"docs/old.md",status:"deleted",binary:!1,additions:0,deletions:2,hunks:[{oldStart:1,oldLines:2,newStart:0,newLines:0,lines:[t("del","# Old notes",1,null),t("del","Superseded.",2,null)]}]};let a=[n,u,r,i];return e&&e.path&&(a=a.filter(s=>s.path===e.path)),{base:{rev:e&&e.base||"HEAD",sha:"9f3e1b0c2a7d4e8f6b5a1c3d2e4f5a6b7c8d9e0f"},head:{worktree:!0},files:a,additions:a.reduce((s,c)=>s+c.additions,0),deletions:a.reduce((s,c)=>s+c.deletions,0)}}const Ke=yr({errorOverlay:!0});function Ze(e){if(e&&typeof e=="object"){const{code:t,message:n}=e;if(n)return t?`${n} (${t})`:n}return String(e)}function R(e,t,...n){const u=document.createElement(e);if(t)for(const[r,i]of Object.entries(t))i===void 0||i===!1||(r==="class"?u.className=String(i):u.setAttribute(r,i===!0?"":String(i)));for(const r of n)r===null||r===!1||r===void 0||u.append(typeof r=="string"?document.createTextNode(r):r);return u}function Nr(e){for(;e.firstChild;)e.removeChild(e.firstChild)}function Be(e){if(e<1024)return`${e} B`;const t=["KB","MB","GB"];let n=e/1024,u=0;for(;n>=1024&&u<t.length-1;)n/=1024,u++;return`${n>=100?n.toFixed(0):n.toFixed(1)} ${t[u]}`}function Dr(e){return"text"in e?new TextEncoder().encode(e.text):new Uint8Array(e.bytes)}function Mn(e,t){return e==="."||e===""?t:`${e}/${t}`}function In(e){const t=e.lastIndexOf("/");return t<0?e:e.slice(t+1)}function Sr(e){const t=e.lastIndexOf("/");return t<0?".":e.slice(0,t)}function Tr(e,t,n){return e||t||n}function Et(){return R("span",{class:"spinner","aria-hidden":"true"})}function Fn(e){return R("div",{class:"empty loading",role:"status"},Et(),R("span",null,e))}function Or(e){return[...e].sort((t,n)=>t.kind!==n.kind?t.kind==="dir"?-1:1:t.name.localeCompare(n.name,void 0,{numeric:!0,sensitivity:"base"}))}class Rr{constructor(){this.nodes=new Map,this.selected=null,this.filter="",this.onOpen=()=>{},this.rootList=R("ul",{role:"group"});const t=R("input",{type:"search",placeholder:"Filter loaded files","aria-label":"Filter loaded files"});t.addEventListener("input",()=>{this.filter=t.value.trim().toLowerCase(),this.applyFilter()});const n=R("div",{class:"tree",role:"tree",tabindex:"0"},this.rootList);n.addEventListener("keydown",u=>this.onKey(u)),this.el=R("div",{class:"side"},t,n)}async loadRoot(){await this.loadChildren(".",this.rootList)}async loadChildren(t,n){n.replaceChildren(R("li",{class:"child-note",role:"none"},"Loading…",Et())),n.setAttribute("aria-busy","true");let u;try{u=await Ke.fs.list(t)}catch(r){throw n.removeAttribute("aria-busy"),n.replaceChildren(R("li",{class:"child-note",role:"none"},`Could not list: ${Ze(r)}`)),r}n.removeAttribute("aria-busy"),n.replaceChildren();for(const r of Or(u.entries))n.append(this.makeNode(t,r));u.truncated&&n.append(R("li",{class:"child-note",role:"none"},"This folder has more entries than can be listed; only the first are shown.")),this.applyFilter()}makeNode(t,n){const u=Mn(t,n.name),r=n.kind==="dir",i=R("span",{class:"twist","aria-hidden":"true"},r?"▸":""),a=R("div",{class:`row ${r?"dir":"file"}`,role:"treeitem","data-path":u,"aria-selected":"false",...r?{"aria-expanded":"false"}:{}},i,R("span",{class:"name",title:u},n.name),!r&&R("span",{class:"size"},Be(n.size)));a.style.paddingLeft=`${6+14*(u.split("/").length-1)}px`;const o=R("li",{role:"none"},a),s={path:u,entry:n,row:a,loaded:!1};return this.nodes.set(u,s),a.addEventListener("click",()=>{this.activate(s)}),o}async activate(t){this.select(t),t.entry.kind==="dir"?await this.toggle(t):this.onOpen(t.path,t.entry)}select(t){this.selected?.row.setAttribute("aria-selected","false"),this.selected=t,t.row.setAttribute("aria-selected","true"),t.row.scrollIntoView({block:"nearest"})}async toggle(t,n){const u=t.row.getAttribute("aria-expanded")==="true",r=n??!u;if(r===u)return;const i=t.row.firstElementChild;if(!r){t.children?.setAttribute("hidden",""),t.row.setAttribute("aria-expanded","false"),i.textContent="▸";return}if(t.children||(t.children=R("ul",{role:"group"}),t.row.parentElement.append(t.children)),t.children.removeAttribute("hidden"),t.row.setAttribute("aria-expanded","true"),i.textContent="▾",!t.loaded){t.loaded=!0;try{await this.loadChildren(t.path,t.children)}catch{t.loaded=!1}}}async reveal(t){const n=t.split("/");let u="";for(let i=0;i<n.length-1;i++){u=Mn(u||".",n[i]);const a=this.nodes.get(u);if(!a)return;await this.toggle(a,!0)}const r=this.nodes.get(t);r&&this.select(r)}visibleRows(){return[...this.el.querySelectorAll(".row")].filter(t=>{for(let n=t;n&&n!==this.el;n=n.parentElement)if(n.hidden)return!1;return!0})}onKey(t){const n=this.visibleRows();if(!n.length)return;const u=this.selected?n.indexOf(this.selected.row):-1,r=a=>{const o=this.nodes.get(n[Math.max(0,Math.min(n.length-1,a))].dataset.path);o&&this.select(o)},i=this.selected;switch(t.key){case"ArrowDown":r(u+1);break;case"ArrowUp":r(u<0?0:u-1);break;case"Home":r(0);break;case"End":r(n.length-1);break;case"ArrowRight":i?.entry.kind==="dir"&&(i.row.getAttribute("aria-expanded")==="true"?r(u+1):this.toggle(i,!0));break;case"ArrowLeft":if(i?.entry.kind==="dir"&&i.row.getAttribute("aria-expanded")==="true")this.toggle(i,!1);else if(i){const a=this.nodes.get(i.path.includes("/")?i.path.slice(0,i.path.lastIndexOf("/")):"");a&&this.select(a)}break;case"Enter":case" ":i&&this.activate(i);break;default:return}t.preventDefault()}applyFilter(){const t=this.filter,n=new Set;if(t){for(const[u,r]of this.nodes)if(r.entry.name.toLowerCase().includes(t))for(let i=u;n.add(i),!!i.includes("/");i=i.slice(0,i.lastIndexOf("/")));}for(const[u,r]of this.nodes)r.row.parentElement.hidden=t!==""&&!n.has(u)}}function Mr(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Wt,Ln;function Ir(){if(Ln)return Wt;Ln=1;function e(d){return d instanceof Map?d.clear=d.delete=d.set=function(){throw new Error("map is read-only")}:d instanceof Set&&(d.add=d.clear=d.delete=function(){throw new Error("set is read-only")}),Object.freeze(d),Object.getOwnPropertyNames(d).forEach(m=>{const C=d[m],L=typeof C;(L==="object"||L==="function")&&!Object.isFrozen(C)&&e(C)}),d}class t{constructor(m){m.data===void 0&&(m.data={}),this.data=m.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}}function n(d){return d.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function u(d,...m){const C=Object.create(null);for(const L in d)C[L]=d[L];return m.forEach(function(L){for(const Q in L)C[Q]=L[Q]}),C}const r="</span>",i=d=>!!d.scope,a=(d,{prefix:m})=>{if(d.startsWith("language:"))return d.replace("language:","language-");if(d.includes(".")){const C=d.split(".");return[`${m}${C.shift()}`,...C.map((L,Q)=>`${L}${"_".repeat(Q+1)}`)].join(" ")}return`${m}${d}`};class o{constructor(m,C){this.buffer="",this.classPrefix=C.classPrefix,m.walk(this)}addText(m){this.buffer+=n(m)}openNode(m){if(!i(m))return;const C=a(m.scope,{prefix:this.classPrefix});this.span(C)}closeNode(m){i(m)&&(this.buffer+=r)}value(){return this.buffer}span(m){this.buffer+=`<span class="${m}">`}}const s=(d={})=>{const m={children:[]};return Object.assign(m,d),m};class c{constructor(){this.rootNode=s(),this.stack=[this.rootNode]}get top(){return this.stack[this.stack.length-1]}get root(){return this.rootNode}add(m){this.top.children.push(m)}openNode(m){const C=s({scope:m});this.add(C),this.stack.push(C)}closeNode(){if(this.stack.length>1)return this.stack.pop()}closeAllNodes(){for(;this.closeNode(););}toJSON(){return JSON.stringify(this.rootNode,null,4)}walk(m){return this.constructor._walk(m,this.rootNode)}static _walk(m,C){return typeof C=="string"?m.addText(C):C.children&&(m.openNode(C),C.children.forEach(L=>this._walk(m,L)),m.closeNode(C)),m}static _collapse(m){typeof m!="string"&&m.children&&(m.children.every(C=>typeof C=="string")?m.children=[m.children.join("")]:m.children.forEach(C=>{c._collapse(C)}))}}class l extends c{constructor(m){super(),this.options=m}addText(m){m!==""&&this.add(m)}startScope(m){this.openNode(m)}endScope(){this.closeNode()}__addSublanguage(m,C){const L=m.root;C&&(L.scope=`language:${C}`),this.add(L)}toHTML(){return new o(this,this.options).value()}finalize(){return this.closeAllNodes(),!0}}function f(d){return d?typeof d=="string"?d:d.source:null}function h(d){return E("(?=",d,")")}function p(d){return E("(?:",d,")*")}function b(d){return E("(?:",d,")?")}function E(...d){return d.map(C=>f(C)).join("")}function _(d){const m=d[d.length-1];return typeof m=="object"&&m.constructor===Object?(d.splice(d.length-1,1),m):{}}function g(...d){return"("+(_(d).capture?"":"?:")+d.map(L=>f(L)).join("|")+")"}function v(d){return new RegExp(d.toString()+"|").exec("").length-1}function w(d,m){const C=d&&d.exec(m);return C&&C.index===0}const x=new RegExp(g(/\[(?:[^\\\]]|\\.)*\]/,/\(\?<(?![=!])[^>]+>/,/\(\?'[^']+'/,/\(\??/,/\\([1-9][0-9]*)/,/\\./));function y(d,{joinWith:m}){let C=0;return d.map(L=>{C+=1;const Q=C;let J=f(L),T="";for(;J.length>0;){const D=x.exec(J);if(!D){T+=J;break}T+=J.substring(0,D.index),J=J.substring(D.index+D[0].length),D[0][0]==="\\"&&D[1]?T+="\\"+String(Number(D[1])+Q):(T+=D[0],(D[0]==="("||/^\(\?[<']/.test(D[0]))&&C++)}return T}).map(L=>`(${L})`).join(m)}const k=/\b\B/,S="[a-zA-Z]\\w*",F="[a-zA-Z_]\\w*",z="\\b\\d+(\\.\\d+)?",X="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",ee="\\b(0b[01]+)",pe="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",ge=(d={})=>{const m=/^#![ ]*\//;return d.binary&&(d.begin=E(m,/.*\b/,d.binary,/\b.*/)),u({scope:"meta",begin:m,end:/$/,relevance:0,"on:begin":(C,L)=>{C.index!==0&&L.ignoreMatch()}},d)},V={begin:"\\\\[\\s\\S]",relevance:0},Z={scope:"string",begin:"'",end:"'",illegal:"\\n",contains:[V]},ie={scope:"string",begin:'"',end:'"',illegal:"\\n",contains:[V]},Se={begin:/\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\b/},$=function(d,m,C={}){const L=u({scope:"comment",begin:d,end:m,contains:[]},C);L.contains.push({scope:"doctag",begin:"[ ]*(?=(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):)",end:/(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):/,excludeBegin:!0,relevance:0});const Q=g("I","a","is","so","us","to","at","if","in","it","on",/[A-Za-z]+['](d|ve|re|ll|t|s|n)/,/[A-Za-z]+[-][a-z]+/,/[A-Za-z][a-z]{2,}/);return L.contains.push({begin:E(/[ ]+/,"(",Q,/[.]?[:]?([.][ ]|[ ])/,"){3}")}),L},ae=$("//","$"),fe=$("/\\*","\\*/"),le=$("#","$"),oe={scope:"number",begin:z,relevance:0},Te={scope:"number",begin:X,relevance:0},_n={scope:"number",begin:ee,relevance:0},Bt={scope:"regexp",begin:/\/(?=[^/\n]*\/)/,end:/\/[gimuy]*/,contains:[V,{begin:/\[/,end:/\]/,relevance:0,contains:[V]}]},ht={scope:"title",begin:S,relevance:0},En={scope:"title",begin:F,relevance:0},Pt={begin:"\\.\\s*"+F,relevance:0};var je=Object.freeze({__proto__:null,APOS_STRING_MODE:Z,BACKSLASH_ESCAPE:V,BINARY_NUMBER_MODE:_n,BINARY_NUMBER_RE:ee,COMMENT:$,C_BLOCK_COMMENT_MODE:fe,C_LINE_COMMENT_MODE:ae,C_NUMBER_MODE:Te,C_NUMBER_RE:X,END_SAME_AS_BEGIN:function(d){return Object.assign(d,{"on:begin":(m,C)=>{C.data._beginMatch=m[1]},"on:end":(m,C)=>{C.data._beginMatch!==m[1]&&C.ignoreMatch()}})},HASH_COMMENT_MODE:le,IDENT_RE:S,MATCH_NOTHING_RE:k,METHOD_GUARD:Pt,NUMBER_MODE:oe,NUMBER_RE:z,PHRASAL_WORDS_MODE:Se,QUOTE_STRING_MODE:ie,REGEXP_MODE:Bt,RE_STARTERS_RE:pe,SHEBANG:ge,TITLE_MODE:ht,UNDERSCORE_IDENT_RE:F,UNDERSCORE_TITLE_MODE:En});function xn(d,m){d.input[d.index-1]==="."&&m.ignoreMatch()}function kn(d,m){d.className!==void 0&&(d.scope=d.className,delete d.className)}function yn(d,m){m&&d.beginKeywords&&(d.begin="\\b("+d.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",d.__beforeBegin=xn,d.keywords=d.keywords||d.beginKeywords,delete d.beginKeywords,d.relevance===void 0&&(d.relevance=0))}function An(d,m){Array.isArray(d.illegal)&&(d.illegal=g(...d.illegal))}function wn(d,m){if(d.match){if(d.begin||d.end)throw new Error("begin & end are not supported with match");d.begin=d.match,delete d.match}}function G(d,m){d.relevance===void 0&&(d.relevance=1)}const et=(d,m)=>{if(!d.beforeMatch)return;if(d.starts)throw new Error("beforeMatch cannot be used with starts");const C=Object.assign({},d);Object.keys(d).forEach(L=>{delete d[L]}),d.keywords=C.keywords,d.begin=E(C.beforeMatch,h(C.begin)),d.starts={relevance:0,contains:[Object.assign(C,{endsParent:!0})]},d.relevance=0,delete C.beforeMatch},ze=["of","and","for","in","not","or","if","then","parent","list","value"],Cn="keyword";function ar(d,m,C=Cn){const L=Object.create(null);return typeof d=="string"?Q(C,d.split(" ")):Array.isArray(d)?Q(C,d):Object.keys(d).forEach(function(J){Object.assign(L,ar(d[J],m,J))}),L;function Q(J,T){m&&(T=T.map(D=>D.toLowerCase())),T.forEach(function(D){const I=D.split("|");L[I[0]]=[J,Bs(I[0],I[1])]})}}function Bs(d,m){return m?Number(m):Ps(d)?0:1}function Ps(d){return ze.includes(d.toLowerCase())}const or={},Ue=d=>{console.error(d)},sr=(d,...m)=>{console.log(`WARN: ${d}`,...m)},tt=(d,m)=>{or[`${d}/${m}`]||(console.log(`Deprecated as of ${d}. ${m}`),or[`${d}/${m}`]=!0)},zt=new Error;function cr(d,m,{key:C}){let L=0;const Q=d[C],J={},T={};for(let D=1;D<=m.length;D++)T[D+L]=Q[D],J[D+L]=!0,L+=v(m[D-1]);d[C]=T,d[C]._emit=J,d[C]._multi=!0}function zs(d){if(Array.isArray(d.begin)){if(d.skip||d.excludeBegin||d.returnBegin)throw Ue("skip, excludeBegin, returnBegin not compatible with beginScope: {}"),zt;if(typeof d.beginScope!="object"||d.beginScope===null)throw Ue("beginScope must be object"),zt;cr(d,d.begin,{key:"beginScope"}),d.begin=y(d.begin,{joinWith:""})}}function Us(d){if(Array.isArray(d.end)){if(d.skip||d.excludeEnd||d.returnEnd)throw Ue("skip, excludeEnd, returnEnd not compatible with endScope: {}"),zt;if(typeof d.endScope!="object"||d.endScope===null)throw Ue("endScope must be object"),zt;cr(d,d.end,{key:"endScope"}),d.end=y(d.end,{joinWith:""})}}function $s(d){d.scope&&typeof d.scope=="object"&&d.scope!==null&&(d.beginScope=d.scope,delete d.scope)}function qs(d){$s(d),typeof d.beginScope=="string"&&(d.beginScope={_wrap:d.beginScope}),typeof d.endScope=="string"&&(d.endScope={_wrap:d.endScope}),zs(d),Us(d)}function Hs(d){function m(T,D){return new RegExp(f(T),"m"+(d.case_insensitive?"i":"")+(d.unicodeRegex?"u":"")+(D?"g":""))}class C{constructor(){this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0}addRule(D,I){I.position=this.position++,this.matchIndexes[this.matchAt]=I,this.regexes.push([I,D]),this.matchAt+=v(D)+1}compile(){this.regexes.length===0&&(this.exec=()=>null);const D=this.regexes.map(I=>I[1]);this.matcherRe=m(y(D,{joinWith:"|"}),!0),this.lastIndex=0}exec(D){this.matcherRe.lastIndex=this.lastIndex;const I=this.matcherRe.exec(D);if(!I)return null;const re=I.findIndex((gt,Nn)=>Nn>0&>!==void 0),j=this.matchIndexes[re];return I.splice(0,re),Object.assign(I,j)}}class L{constructor(){this.rules=[],this.multiRegexes=[],this.count=0,this.lastIndex=0,this.regexIndex=0}getMatcher(D){if(this.multiRegexes[D])return this.multiRegexes[D];const I=new C;return this.rules.slice(D).forEach(([re,j])=>I.addRule(re,j)),I.compile(),this.multiRegexes[D]=I,I}resumingScanAtSamePosition(){return this.regexIndex!==0}considerAll(){this.regexIndex=0}addRule(D,I){this.rules.push([D,I]),I.type==="begin"&&this.count++}exec(D){const I=this.getMatcher(this.regexIndex);I.lastIndex=this.lastIndex;let re=I.exec(D);if(this.resumingScanAtSamePosition()&&!(re&&re.index===this.lastIndex)){const j=this.getMatcher(0);j.lastIndex=this.lastIndex+1,re=j.exec(D)}return re&&(this.regexIndex+=re.position+1,this.regexIndex===this.count&&this.considerAll()),re}}function Q(T){const D=new L;return T.contains.forEach(I=>D.addRule(I.begin,{rule:I,type:"begin"})),T.terminatorEnd&&D.addRule(T.terminatorEnd,{type:"end"}),T.illegal&&D.addRule(T.illegal,{type:"illegal"}),D}function J(T,D){const I=T;if(T.isCompiled)return I;[kn,wn,qs,et].forEach(j=>j(T,D)),d.compilerExtensions.forEach(j=>j(T,D)),T.__beforeBegin=null,[yn,An,G].forEach(j=>j(T,D)),T.isCompiled=!0;let re=null;return typeof T.keywords=="object"&&T.keywords.$pattern&&(T.keywords=Object.assign({},T.keywords),re=T.keywords.$pattern,delete T.keywords.$pattern),re=re||/\w+/,T.keywords&&(T.keywords=ar(T.keywords,d.case_insensitive)),I.keywordPatternRe=m(re,!0),D&&(T.begin||(T.begin=/\B|\b/),I.beginRe=m(I.begin),!T.end&&!T.endsWithParent&&(T.end=/\B|\b/),T.end&&(I.endRe=m(I.end)),I.terminatorEnd=f(I.end)||"",T.endsWithParent&&D.terminatorEnd&&(I.terminatorEnd+=(T.end?"|":"")+D.terminatorEnd)),T.illegal&&(I.illegalRe=m(T.illegal)),T.contains||(T.contains=[]),T.contains=[].concat(...T.contains.map(function(j){return Gs(j==="self"?T:j)})),T.contains.forEach(function(j){J(j,I)}),T.starts&&J(T.starts,D),I.matcher=Q(I),I}if(d.compilerExtensions||(d.compilerExtensions=[]),d.contains&&d.contains.includes("self"))throw new Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.");return d.classNameAliases=u(d.classNameAliases||{}),J(d)}function lr(d){return d?d.endsWithParent||lr(d.starts):!1}function Gs(d){return d.variants&&!d.cachedVariants&&(d.cachedVariants=d.variants.map(function(m){return u(d,{variants:null},m)})),d.cachedVariants?d.cachedVariants:lr(d)?u(d,{starts:d.starts?u(d.starts):null}):Object.isFrozen(d)?u(d):d}var Ks="11.12.0";class Zs extends Error{constructor(m,C){super(m),this.name="HTMLInjectionError",this.html=C}}const vn=n,dr=u,fr=Symbol("nomatch"),Ws=7,br=function(d){const m=Object.create(null),C=Object.create(null),L=[];let Q=!0;const J="Could not find the language '{}', did you forget to load/include a language module?",T={disableAutodetect:!0,name:"Plain text",contains:[]};let D={ignoreUnescapedHTML:!1,throwUnescapedHTML:!1,noHighlightRe:/^(no-?highlight)$/i,languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:"hljs-",cssSelector:"pre code",languages:null,__emitter:l};function I(A){return D.noHighlightRe.test(A)}function re(A){let M=A.className+" ";M+=A.parentNode?A.parentNode.className:"";const U=D.languageDetectRe.exec(M);if(U){const W=Fe(U[1]);return W||(sr(J.replace("{}",U[1])),sr("Falling back to no-highlight mode for this block.",A)),W?U[1]:"no-highlight"}return M.split(/\s+/).find(W=>I(W)||Fe(W))}function j(A,M,U){let W="",te="";typeof M=="object"?(W=A,U=M.ignoreIllegals,te=M.language):(tt("10.7.0","highlight(lang, code, ...args) has been deprecated."),tt("10.7.0",`Please use highlight(code, options) instead.
- https://github.com/highlightjs/highlight.js/issues/2277`),te=A,W=M),U===void 0&&(U=!0);const xe={code:W,language:te};$t("before:highlight",xe);const Le=xe.result?xe.result:gt(xe.language,xe.code,U);return Le.code=xe.code,$t("after:highlight",Le),Le}function gt(A,M,U,W){const te=Object.create(null);function xe(N,O){return N.keywords[O]}function Le(){if(!B.keywords){se.addText(Y);return}let N=0;B.keywordPatternRe.lastIndex=0;let O=B.keywordPatternRe.exec(Y),P="";for(;O;){P+=Y.substring(N,O.index);const q=Ne.case_insensitive?O[0].toLowerCase():O[0],de=xe(B,q);if(de){const[Oe,lc]=de;if(se.addText(P),P="",te[q]=(te[q]||0)+1,te[q]<=Ws&&(Gt+=lc),Oe.startsWith("_"))P+=O[0];else{const dc=Ne.classNameAliases[Oe]||Oe;ve(O[0],dc)}}else P+=O[0];N=B.keywordPatternRe.lastIndex,O=B.keywordPatternRe.exec(Y)}P+=Y.substring(N),se.addText(P)}function qt(){if(Y==="")return;let N=null;if(typeof B.subLanguage=="string"){if(!m[B.subLanguage]){se.addText(Y);return}N=gt(B.subLanguage,Y,!0,kr[B.subLanguage]),kr[B.subLanguage]=N._top}else N=Dn(Y,B.subLanguage.length?B.subLanguage:null);B.relevance>0&&(Gt+=N.relevance),se.__addSublanguage(N._emitter,N.language)}function me(){B.subLanguage!=null?qt():Le(),Y=""}function ve(N,O){N!==""&&(se.startScope(O),se.addText(N),se.endScope())}function mr(N,O){let P=1;const q=O.length-1;for(;P<=q;){if(!N._emit[P]){P++;continue}const de=Ne.classNameAliases[N[P]]||N[P],Oe=O[P];de?ve(Oe,de):(Y=Oe,Le(),Y=""),P++}}function _r(N,O){return N.scope&&typeof N.scope=="string"&&se.openNode(Ne.classNameAliases[N.scope]||N.scope),N.beginScope&&(N.beginScope._wrap?(ve(Y,Ne.classNameAliases[N.beginScope._wrap]||N.beginScope._wrap),Y=""):N.beginScope._multi&&(mr(N.beginScope,O),Y="")),B=Object.create(N,{parent:{value:B}}),B}function Er(N,O,P){let q=w(N.endRe,P);if(q){if(N["on:end"]){const de=new t(N);N["on:end"](O,de),de.isMatchIgnored&&(q=!1)}if(q){for(;N.endsParent&&N.parent;)N=N.parent;return N}}if(N.endsWithParent)return Er(N.parent,O,P)}function ic(N){return B.matcher.regexIndex===0?(Y+=N[0],1):(Rn=!0,0)}function ac(N){const O=N[0],P=N.rule,q=new t(P),de=[P.__beforeBegin,P["on:begin"]];for(const Oe of de)if(Oe&&(Oe(N,q),q.isMatchIgnored))return ic(O);return P.skip?Y+=O:(P.excludeBegin&&(Y+=O),me(),!P.returnBegin&&!P.excludeBegin&&(Y=O)),_r(P,N),P.returnBegin?0:O.length}function oc(N){const O=N[0],P=M.substring(N.index),q=Er(B,N,P);if(!q)return fr;const de=B;B.endScope&&B.endScope._wrap?(me(),ve(O,B.endScope._wrap)):B.endScope&&B.endScope._multi?(me(),mr(B.endScope,N)):de.skip?Y+=O:(de.returnEnd||de.excludeEnd||(Y+=O),me(),de.excludeEnd&&(Y=O));do B.scope&&se.closeNode(),!B.skip&&!B.subLanguage&&(Gt+=B.relevance),B=B.parent;while(B!==q.parent);return q.starts&&_r(q.starts,N),de.returnEnd?0:O.length}function sc(){const N=[];for(let O=B;O!==Ne;O=O.parent)O.scope&&N.unshift(O.scope);N.forEach(O=>se.openNode(O))}let Ht={};function xr(N,O){const P=O&&O[0];if(Y+=N,P==null)return me(),0;if(Ht.type==="begin"&&O.type==="end"&&Ht.index===O.index&&P===""){if(Y+=M.slice(O.index,O.index+1),!Q){const q=new Error(`0 width match regex (${A})`);throw q.languageName=A,q.badRule=Ht.rule,q}return 1}if(Ht=O,O.type==="begin")return ac(O);if(O.type==="illegal"&&!U){const q=new Error('Illegal lexeme "'+P+'" for mode "'+(B.scope||"<unnamed>")+'"');throw q.mode=B,q}else if(O.type==="end"){const q=oc(O);if(q!==fr)return q}if(O.type==="illegal"&&P==="")return O.index===M.length||(Y+=`
- `),1;if(On>1e5&&On>O.index*3)throw new Error("potential infinite loop, way more iterations than matches");return Y+=P,P.length}const Ne=Fe(A);if(!Ne)throw Ue(J.replace("{}",A)),new Error('Unknown language: "'+A+'"');const cc=Hs(Ne);let Tn="",B=W||cc;const kr={},se=new D.__emitter(D);sc();let Y="",Gt=0,$e=0,On=0,Rn=!1;try{if(Ne.__emitTokens)Ne.__emitTokens(M,se);else{for(B.matcher.considerAll();;){On++,Rn?Rn=!1:B.matcher.considerAll(),B.matcher.lastIndex=$e;const N=B.matcher.exec(M);if(!N)break;const O=M.substring($e,N.index),P=xr(O,N);$e=N.index+P}xr(M.substring($e))}return se.finalize(),Tn=se.toHTML(),{language:A,value:Tn,relevance:Gt,illegal:!1,_emitter:se,_top:B}}catch(N){if(N.message&&N.message.includes("Illegal"))return{language:A,value:vn(M),illegal:!0,relevance:0,_illegalBy:{message:N.message,index:$e,context:M.slice($e-100,$e+100),mode:N.mode,resultSoFar:Tn},_emitter:se};if(Q)return{language:A,value:vn(M),illegal:!1,relevance:0,errorRaised:N,_emitter:se,_top:B};throw N}}function Nn(A){const M={value:vn(A),illegal:!1,relevance:0,_top:T,_emitter:new D.__emitter(D)};return M._emitter.addText(A),M}function Dn(A,M){M=M||D.languages||Object.keys(m);const U=Nn(A),W=M.filter(Fe).filter(gr).map(me=>gt(me,A,!1));W.unshift(U);const te=W.sort((me,ve)=>{if(me.relevance!==ve.relevance)return ve.relevance-me.relevance;if(me.language&&ve.language){if(Fe(me.language).supersetOf===ve.language)return 1;if(Fe(ve.language).supersetOf===me.language)return-1}return 0}),[xe,Le]=te,qt=xe;return qt.secondBest=Le,qt}function Ys(A,M,U){const W=M&&C[M]||U;A.classList.add("hljs"),A.classList.add(`language-${W}`)}function Sn(A){let M=null;const U=re(A);if(I(U))return;if($t("before:highlightElement",{el:A,language:U}),A.dataset.highlighted){console.log("Element previously highlighted. To highlight again, first unset `dataset.highlighted`.",A);return}if(A.children.length>0&&(D.ignoreUnescapedHTML||(console.warn("One of your code blocks includes unescaped HTML. This is a potentially serious security risk."),console.warn("https://github.com/highlightjs/highlight.js/wiki/security"),console.warn("The element with unescaped HTML:"),console.warn(A)),D.throwUnescapedHTML))throw new Zs("One of your code blocks includes unescaped HTML.",A.innerHTML);M=A;const W=M.textContent,te=U?j(W,{language:U,ignoreIllegals:!0}):Dn(W);A.innerHTML=te.value,A.dataset.highlighted="yes",Ys(A,U,te.language),A.result={language:te.language,re:te.relevance,relevance:te.relevance},te.secondBest&&(A.secondBest={language:te.secondBest.language,relevance:te.secondBest.relevance}),$t("after:highlightElement",{el:A,result:te,text:W})}function Vs(A){D=dr(D,A)}const Xs=()=>{Ut(),tt("10.6.0","initHighlighting() deprecated. Use highlightAll() now.")};function Qs(){Ut(),tt("10.6.0","initHighlightingOnLoad() deprecated. Use highlightAll() now.")}let pr=!1;function Ut(){function A(){Ut()}if(document.readyState==="loading"){pr||window.addEventListener("DOMContentLoaded",A,!1),pr=!0;return}document.querySelectorAll(D.cssSelector).forEach(Sn)}function Js(A,M){let U=null;try{U=M(d)}catch(W){if(Ue("Language definition for '{}' could not be registered.".replace("{}",A)),Q)Ue(W);else throw W;U=T}U.name||(U.name=A),m[A]=U,U.rawDefinition=M.bind(null,d),U.aliases&&hr(U.aliases,{languageName:A})}function js(A){delete m[A];for(const M of Object.keys(C))C[M]===A&&delete C[M]}function ec(){return Object.keys(m)}function Fe(A){return A=(A||"").toLowerCase(),m[A]||m[C[A]]}function hr(A,{languageName:M}){typeof A=="string"&&(A=[A]),A.forEach(U=>{C[U.toLowerCase()]=M})}function gr(A){const M=Fe(A);return M&&!M.disableAutodetect}function tc(A){A["before:highlightBlock"]&&!A["before:highlightElement"]&&(A["before:highlightElement"]=M=>{A["before:highlightBlock"](Object.assign({block:M.el},M))}),A["after:highlightBlock"]&&!A["after:highlightElement"]&&(A["after:highlightElement"]=M=>{A["after:highlightBlock"](Object.assign({block:M.el},M))})}function nc(A){tc(A),L.push(A)}function uc(A){const M=L.indexOf(A);M!==-1&&L.splice(M,1)}function $t(A,M){const U=A;L.forEach(function(W){W[U]&&W[U](M)})}function rc(A){return tt("10.7.0","highlightBlock will be removed entirely in v12.0"),tt("10.7.0","Please use highlightElement now."),Sn(A)}Object.assign(d,{highlight:j,highlightAuto:Dn,highlightAll:Ut,highlightElement:Sn,highlightBlock:rc,configure:Vs,initHighlighting:Xs,initHighlightingOnLoad:Qs,registerLanguage:Js,unregisterLanguage:js,listLanguages:ec,getLanguage:Fe,registerAliases:hr,autoDetection:gr,inherit:dr,addPlugin:nc,removePlugin:uc}),d.debugMode=function(){Q=!1},d.safeMode=function(){Q=!0},d.versionString=Ks,d.regex={concat:E,lookahead:h,either:g,optional:b,anyNumberOfTimes:p};for(const A in je)typeof je[A]=="object"&&e(je[A]);return Object.assign(d,je),d},nt=br({});return nt.newInstance=()=>br({}),Wt=nt,nt.HighlightJS=nt,nt.default=nt,Wt}var Fr=Ir();const Bn=Mr(Fr);function Lr(e){const t=e.regex,n={},u={begin:/\$\{/,end:/\}/,contains:["self",{begin:/:-/,contains:[n]}]};Object.assign(n,{className:"variable",variants:[{begin:t.concat(/\$[\w\d#@][\w\d_]*/,"(?![\\w\\d])(?![$])")},u]});const r={className:"subst",begin:/\$\(/,end:/\)/,contains:[e.BACKSLASH_ESCAPE]},i=e.inherit(e.COMMENT(),{match:[/(^|\s)/,/#.*$/],scope:{2:"comment"}}),a={begin:/<<-?\s*(?=\w+)/,starts:{contains:[e.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,className:"string"})]}},o={className:"string",begin:/"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,n,r]};r.contains.push(o);const s={match:/\\"/},c={className:"string",begin:/'/,end:/'/},l={match:/\\'/},f={begin:/\$?\(\(/,end:/\)\)/,contains:[{begin:/\d+#[0-9a-f]+/,className:"number"},e.NUMBER_MODE,n]},h=["fish","bash","zsh","sh","csh","ksh","tcsh","dash","scsh"],p=e.SHEBANG({binary:`(${h.join("|")})`,relevance:10}),b={className:"function",begin:/\w[\w\d_]*\s*\(\s*\)\s*\{/,returnBegin:!0,contains:[e.inherit(e.TITLE_MODE,{begin:/\w[\w\d_]*/})],relevance:0},E=["if","then","else","elif","fi","time","for","while","until","in","do","done","case","esac","coproc","function","select"],_=["true","false"],g={match:/(\/[a-z._-]+)+/},v=["break","cd","continue","eval","exec","exit","export","getopts","hash","pwd","readonly","return","shift","test","times","trap","umask","unset"],w=["alias","bind","builtin","caller","command","declare","echo","enable","help","let","local","logout","mapfile","printf","read","readarray","source","sudo","type","typeset","ulimit","unalias"],x=["autoload","bg","bindkey","bye","cap","chdir","clone","comparguments","compcall","compctl","compdescribe","compfiles","compgroups","compquote","comptags","comptry","compvalues","dirs","disable","disown","echotc","echoti","emulate","fc","fg","float","functions","getcap","getln","history","integer","jobs","kill","limit","log","noglob","popd","print","pushd","pushln","rehash","sched","setcap","setopt","stat","suspend","ttyctl","unfunction","unhash","unlimit","unsetopt","vared","wait","whence","where","which","zcompile","zformat","zftp","zle","zmodload","zparseopts","zprof","zpty","zregexparse","zsocket","zstyle","ztcp"],y=["chcon","chgrp","chown","chmod","cp","dd","df","dir","dircolors","ln","ls","mkdir","mkfifo","mknod","mktemp","mv","realpath","rm","rmdir","shred","sync","touch","truncate","vdir","b2sum","base32","base64","cat","cksum","comm","csplit","cut","expand","fmt","fold","head","join","md5sum","nl","numfmt","od","paste","ptx","pr","sha1sum","sha224sum","sha256sum","sha384sum","sha512sum","shuf","sort","split","sum","tac","tail","tr","tsort","unexpand","uniq","wc","arch","basename","chroot","date","dirname","du","echo","env","expr","factor","groups","hostid","id","link","logname","nice","nohup","nproc","pathchk","pinky","printenv","printf","pwd","readlink","runcon","seq","sleep","stat","stdbuf","stty","tee","test","timeout","tty","uname","unlink","uptime","users","who","whoami","yes"];return{name:"Bash",aliases:["sh","zsh"],keywords:{$pattern:/\b[a-z][a-z0-9._-]+\b/,keyword:E,literal:_,built_in:[...v,...w,"set","shopt",...x,...y]},contains:[p,e.SHEBANG(),b,f,i,a,g,o,s,c,l,n]}}function Br(e){const t=e.regex,n=e.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),u="decltype\\(auto\\)",r="[a-zA-Z_]\\w*::",a="("+u+"|"+t.optional(r)+"[a-zA-Z_]\\w*"+t.optional("<[^<>]+>")+")",o=t.concat(/\batomic_/,t.either("bool","char","schar","uchar","short","ushort","int","uint","long","ulong","llong","ullong","char16_t","char32_t","wchar_t","int_least8_t","uint_least8_t","int_least16_t","uint_least16_t","int_least32_t","uint_least32_t","int_least64_t","uint_least64_t","int_fast8_t","uint_fast8_t","int_fast16_t","uint_fast16_t","int_fast32_t","uint_fast32_t","int_fast64_t","uint_fast64_t","intptr_t","uintptr_t","size_t","ptrdiff_t","intmax_t","uintmax_t"),/\b/),s={className:"type",variants:[{begin:"\\b[a-z\\d_]*_t\\b"},{match:o}]},l={className:"string",variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[e.BACKSLASH_ESCAPE]},{begin:"(u8?|U|L)?'("+"\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)"+"|.)",end:"'",illegal:"."},e.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\\s"]{0,16})\(/,end:/\)([^()\\\s"]{0,16})"/})]},f={className:"number",variants:[{match:/\b(0b[01']+)/},{match:/(-?)\b([\d']+(\.[\d']*)?|\.[\d']+)((ll|LL|l|L)(u|U)?|(u|U)(ll|LL|l|L)?|f|F|b|B)/},{match:/(-?)\b(0[xX][a-fA-F0-9]+(?:'[a-fA-F0-9]+)*(?:\.[a-fA-F0-9]*(?:'[a-fA-F0-9]*)*)?(?:[pP][-+]?[0-9]+)?(l|L)?(u|U)?)/},{match:/(-?)\b\d+(?:'\d+)*(?:\.\d*(?:'\d*)*)?(?:[eE][-+]?\d+)?/}],relevance:0},h={scope:"meta",begin:/#\s*include\b/,end:/$/,keywords:{keyword:"include"},contains:[{begin:/\\\n/},l,{scope:"string",begin:/<.*?>/},n,e.C_BLOCK_COMMENT_MODE]},p={className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma _Pragma ifdef ifndef elifdef elifndef include"},contains:[{begin:/\\\n/,relevance:0},e.inherit(l,{className:"string"}),n,e.C_BLOCK_COMMENT_MODE]},b=[h,p],E={className:"title",begin:t.optional(r)+e.IDENT_RE,relevance:0},_=t.optional(r)+e.IDENT_RE+"\\s*\\(",g=12,x={keyword:["asm","auto","break","case","continue","default","do","else","enum","extern","for","fortran","goto","if","inline","register","restrict","return","sizeof","typeof","typeof_unqual","struct","switch","typedef","union","volatile","while","_Alignas","_Alignof","_Atomic","_Generic","_Noreturn","_Static_assert","_Thread_local","alignas","alignof","noreturn","static_assert","thread_local","_Pragma"],type:["float","double","signed","unsigned","int","short","long","char","void","_Bool","_BitInt","_Complex","_Imaginary","_Decimal32","_Decimal64","_Decimal96","_Decimal128","_Decimal64x","_Decimal128x","_Float16","_Float32","_Float64","_Float128","_Float32x","_Float64x","_Float128x","const","static","constexpr","complex","bool","imaginary"],literal:"true false NULL",built_in:"std string wstring cin cout cerr clog stdin stdout stderr stringstream istringstream ostringstream auto_ptr deque list queue stack vector map set pair bitset multiset multimap unordered_set unordered_map unordered_multiset unordered_multimap priority_queue make_pair array shared_ptr abort terminate abs acos asin atan2 atan calloc ceil cosh cos exit exp fabs floor fmod fprintf fputs free frexp fscanf future isalnum isalpha iscntrl isdigit isgraph islower isprint ispunct isspace isupper isxdigit tolower toupper labs ldexp log10 log malloc realloc memchr memcmp memcpy memset modf pow printf putchar puts scanf sinh sin snprintf sprintf sqrt sscanf strcat strchr strcmp strcpy strcspn strlen strncat strncmp strncpy strpbrk strrchr strspn strstr tanh tan vfprintf vprintf vsprintf endl initializer_list unique_ptr"},y=[...b,s,n,e.C_BLOCK_COMMENT_MODE,f,l],k={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:x,contains:y.concat([{begin:/\(/,end:/\)/,keywords:x,contains:y.concat(["self"]),relevance:0}]),relevance:0},S={begin:"("+a+"[\\*&\\s]+){1,"+g+"}"+_,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:x,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:u,keywords:x,relevance:0},{begin:_,returnBegin:!0,contains:[e.inherit(E,{className:"title.function"})],relevance:0},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:x,relevance:0,contains:[n,e.C_BLOCK_COMMENT_MODE,l,f,s,{begin:/\(/,end:/\)/,keywords:x,relevance:0,contains:["self",n,e.C_BLOCK_COMMENT_MODE,l,f,s]}]},s,n,e.C_BLOCK_COMMENT_MODE,...b]};return{name:"C",aliases:["h"],keywords:x,disableAutodetect:!0,illegal:"</",contains:[].concat(k,S,y,[...b,{begin:e.IDENT_RE+"::",keywords:x},{className:"class",beginKeywords:"enum class struct union",end:/[{;:<>=]/,contains:[{beginKeywords:"final class struct"},e.TITLE_MODE]}]),exports:{preprocessor:p,strings:l,keywords:x}}}function Pr(e){const t=e.regex,n=e.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),u="decltype\\(auto\\)",r="[a-zA-Z_]\\w*::",a="(?!struct)("+u+"|"+t.optional(r)+"[a-zA-Z_]\\w*"+t.optional("<[^<>]+>")+")",o={className:"type",begin:"\\b[a-z\\d_]*_t\\b"},c={className:"string",variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[e.BACKSLASH_ESCAPE]},{begin:"(u8?|U|L)?'("+"\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)"+"|.)",end:"'",illegal:"."},e.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\\s"]{0,16})\(/,end:/\)([^()\\\s"]{0,16})"/})]},l={className:"number",variants:[{begin:"[+-]?(?:(?:\\b[0-9](?:'?[0-9])*\\.(?:[0-9](?:'?[0-9])*)?|\\.[0-9](?:'?[0-9])*)(?:[Ee][+-]?[0-9](?:'?[0-9])*)?|\\b[0-9](?:'?[0-9])*[Ee][+-]?[0-9](?:'?[0-9])*|\\b0[Xx](?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*(?:\\.(?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)?)?|\\.[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)[Pp][+-]?[0-9](?:'?[0-9])*)(?:[Ff](?:16|32|64|128)?|(BF|bf)16|[Ll]|)"},{begin:"[+-]?\\b(?:0[Bb][01](?:'?[01])*|0[Xx][0-9A-Fa-f](?:'?[0-9A-Fa-f])*|0(?:'?[0-7])*|[1-9](?:'?[0-9])*)(?:[Uu](?:LL?|ll?)|[Uu][Zz]?|(?:LL?|ll?)[Uu]?|[Zz][Uu]|)"}],relevance:0},f={scope:"meta",begin:/#\s*include\b/,end:/$/,keywords:{keyword:"include"},contains:[{begin:/\\\n/},c,{scope:"string",begin:/<.*?>/},n,e.C_BLOCK_COMMENT_MODE]},h={className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma _Pragma ifdef ifndef include"},contains:[{begin:/\\\n/,relevance:0},e.inherit(c,{className:"string"}),n,e.C_BLOCK_COMMENT_MODE]},p=[f,h],b={className:"title",begin:t.optional(r)+e.IDENT_RE,relevance:0},E=t.optional(r)+e.IDENT_RE+"\\s*\\(",_=12,g=["alignas","alignof","and","and_eq","asm","atomic_cancel","atomic_commit","atomic_noexcept","auto","bitand","bitor","break","case","catch","class","co_await","co_return","co_yield","compl","concept","const_cast|10","consteval","constexpr","constinit","continue","decltype","default","delete","do","dynamic_cast|10","else","enum","explicit","export","extern","false","final","for","friend","goto","if","import","inline","module","mutable","namespace","new","noexcept","not","not_eq","nullptr","operator","or","or_eq","override","private","protected","public","reflexpr","register","reinterpret_cast|10","requires","return","sizeof","static_assert","static_cast|10","struct","switch","synchronized","template","this","thread_local","throw","transaction_safe","transaction_safe_dynamic","true","try","typedef","typeid","typename","union","using","virtual","volatile","while","xor","xor_eq"],v=["bool","char","char16_t","char32_t","char8_t","double","float","int","long","short","void","wchar_t","unsigned","signed","const","static"],w=["any","auto_ptr","barrier","binary_semaphore","bitset","complex","condition_variable","condition_variable_any","counting_semaphore","deque","false_type","flat_map","flat_set","future","imaginary","initializer_list","istringstream","jthread","latch","lock_guard","multimap","multiset","mutex","optional","ostringstream","packaged_task","pair","promise","priority_queue","queue","recursive_mutex","recursive_timed_mutex","scoped_lock","set","shared_future","shared_lock","shared_mutex","shared_timed_mutex","shared_ptr","stack","string_view","stringstream","timed_mutex","thread","true_type","tuple","unique_lock","unique_ptr","unordered_map","unordered_multimap","unordered_multiset","unordered_set","variant","vector","weak_ptr","wstring","wstring_view"],x=["abort","abs","acos","apply","as_const","asin","atan","atan2","calloc","ceil","cerr","cin","clog","cos","cosh","cout","declval","endl","exchange","exit","exp","fabs","floor","fmod","forward","fprintf","fputs","free","frexp","fscanf","future","invoke","isalnum","isalpha","iscntrl","isdigit","isgraph","islower","isprint","ispunct","isspace","isupper","isxdigit","labs","launder","ldexp","log","log10","make_pair","make_shared","make_shared_for_overwrite","make_tuple","make_unique","malloc","memchr","memcmp","memcpy","memset","modf","move","pow","printf","putchar","puts","realloc","scanf","sin","sinh","snprintf","sprintf","sqrt","sscanf","std","stderr","stdin","stdout","strcat","strchr","strcmp","strcpy","strcspn","strlen","strncat","strncmp","strncpy","strpbrk","strrchr","strspn","strstr","swap","tan","tanh","terminate","to_underlying","tolower","toupper","vfprintf","visit","vprintf","vsprintf"],S={type:v,keyword:g,literal:["NULL","false","nullopt","nullptr","true"],built_in:["_Pragma"],_type_hints:w},F={className:"function.dispatch",relevance:0,keywords:{_hint:x},begin:t.concat(/\b/,`(?!${g.join("|")})`,e.IDENT_RE,t.lookahead(/(<[^<>]+>|)\s*\(/))},z=[F,...p,o,n,e.C_BLOCK_COMMENT_MODE,l,c],X={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:S,contains:z.concat([{begin:/\(/,end:/\)/,keywords:S,contains:z.concat(["self"]),relevance:0}]),relevance:0},ee={className:"function",begin:"("+a+"[\\*&\\s]+){1,"+_+"}"+E,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:S,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:u,keywords:S,relevance:0},{begin:E,returnBegin:!0,contains:[b],relevance:0},{begin:/::/,relevance:0},{begin:/:/,endsWithParent:!0,contains:[c,l]},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:S,relevance:0,contains:[n,e.C_BLOCK_COMMENT_MODE,c,l,o,{begin:/\(/,end:/\)/,keywords:S,relevance:0,contains:["self",n,e.C_BLOCK_COMMENT_MODE,c,l,o]}]},o,n,e.C_BLOCK_COMMENT_MODE,...p]};return{name:"C++",aliases:["cc","c++","h++","hpp","hh","hxx","cxx"],keywords:S,illegal:"</",classNameAliases:{"function.dispatch":"built_in"},contains:[].concat(X,ee,F,z,[...p,{begin:"\\b(deque|list|queue|priority_queue|pair|stack|vector|map|set|bitset|multiset|multimap|unordered_map|unordered_set|unordered_multiset|unordered_multimap|array|tuple|optional|variant|function|flat_map|flat_set)\\s*<(?!<)",end:">",keywords:S,contains:["self",o]},{begin:e.IDENT_RE+"::",keywords:S},{match:[/\b(?:enum(?:\s+(?:class|struct))?|class|struct|union)/,/\s+/,/\w+/],className:{1:"keyword",3:"title.class"}}])}}function zr(e){const t=["bool","byte","char","decimal","delegate","double","dynamic","enum","float","int","long","nint","nuint","object","sbyte","short","string","ulong","uint","ushort"],n=["public","private","protected","static","internal","protected","abstract","async","extern","override","unsafe","virtual","new","sealed","partial"],u=["default","false","null","true"],r=["abstract","as","base","break","case","catch","class","const","continue","do","else","event","explicit","extern","finally","fixed","for","foreach","goto","if","implicit","in","interface","internal","is","lock","namespace","new","operator","out","override","params","private","protected","public","readonly","record","ref","return","scoped","sealed","sizeof","stackalloc","static","struct","switch","this","throw","try","typeof","unchecked","unsafe","using","virtual","void","volatile","while"],i=["add","alias","and","ascending","args","async","await","by","descending","dynamic","equals","file","from","get","global","group","init","into","join","let","nameof","not","notnull","on","or","orderby","partial","record","remove","required","scoped","select","set","unmanaged","value|0","var","when","where","with","yield"],a={keyword:r.concat(i),built_in:t,literal:u},o=e.inherit(e.TITLE_MODE,{begin:"[a-zA-Z](\\.?\\w)*"}),s="\\d(_*\\d)*",c="([uU][lL]?|[lL][uU]?)?",f={className:"number",variants:[{begin:"\\b0[bB]_*[01](_*[01])*"+c},{begin:"(-?)\\b0[xX]_*[a-fA-F0-9](_*[a-fA-F0-9])*"+c},{begin:"(-?)(\\b"+s+"(\\.("+s+")?)?|\\."+s+")([eE][-+]?"+s+")?"+"([fFdDmM]|[uU][lL]?|[lL][uU]?)?"}],relevance:0},h={className:"string",begin:/"""("*)(?!")(.|\n)*?"""\1/,relevance:1},p={className:"string",begin:'@"',end:'"',contains:[{begin:'""'}]},b=e.inherit(p,{illegal:/\n/}),E={className:"subst",begin:/\{/,end:/\}/,keywords:a},_=e.inherit(E,{illegal:/\n/}),g={className:"string",begin:/\$"/,end:'"',illegal:/\n/,contains:[{begin:/\{\{/},{begin:/\}\}/},e.BACKSLASH_ESCAPE,_]},v={className:"string",begin:/\$@"/,end:'"',contains:[{begin:/\{\{/},{begin:/\}\}/},{begin:'""'},E]},w=e.inherit(v,{illegal:/\n/,contains:[{begin:/\{\{/},{begin:/\}\}/},{begin:'""'},_]});E.contains=[v,g,p,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,f,e.C_BLOCK_COMMENT_MODE],_.contains=[w,g,b,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,f,e.inherit(e.C_BLOCK_COMMENT_MODE,{illegal:/\n/})];const x={variants:[h,v,g,p,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},y={begin:"<",end:">",contains:[{beginKeywords:"in out"},o]},k=e.IDENT_RE+"(<"+e.IDENT_RE+"(\\s*,\\s*"+e.IDENT_RE+")*>)?(\\[\\])?",S={begin:"@"+e.IDENT_RE,relevance:0};return{name:"C#",aliases:["cs","c#"],keywords:a,illegal:/::/,contains:[e.COMMENT("///","$",{returnBegin:!0,contains:[{className:"doctag",variants:[{begin:"///",relevance:0},{begin:"<!--|-->"},{begin:"</?",end:">"}]}]}),e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,{className:"meta",begin:"#",end:"$",keywords:{keyword:"if else elif endif define undef warning error line region endregion pragma checksum"}},x,f,{beginKeywords:"class interface",relevance:0,end:/[{;=]/,illegal:/[^\s:,]/,contains:[{beginKeywords:"where class"},o,y,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{beginKeywords:"namespace",relevance:0,end:/[{;=]/,illegal:/[^\s:]/,contains:[o,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{beginKeywords:"record",relevance:0,end:/[{;=]/,illegal:/[^\s:]/,contains:[o,y,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{className:"meta",begin:"^\\s*\\[(?=[\\w])",excludeBegin:!0,end:"\\]",excludeEnd:!0,contains:[{className:"string",begin:/"/,end:/"/}]},{beginKeywords:"new return throw await else",relevance:0},{className:"function",begin:"("+k+"\\s+)+"+e.IDENT_RE+"\\s*(<[^=]+>\\s*)?\\(",returnBegin:!0,end:/\s*[{;=]/,excludeEnd:!0,keywords:a,contains:[{beginKeywords:n.join(" "),relevance:0},{begin:e.IDENT_RE+"\\s*(<[^=]+>\\s*)?\\(",returnBegin:!0,contains:[e.TITLE_MODE,y],relevance:0},{match:/\(\)/},{className:"params",begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:a,relevance:0,contains:[x,f,e.C_BLOCK_COMMENT_MODE]},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},S]}}const Ur=e=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:e.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},UNICODE_RANGE:{scope:"number",begin:/\b[Uu]\+[0-9A-Fa-f][0-9A-Fa-f?]{0,5}(-[0-9A-Fa-f][0-9A-Fa-f]{0,5})?/},FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:e.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z_][A-Za-z0-9_-]*/}}),$r=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","optgroup","option","p","picture","q","quote","samp","section","select","source","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],qr=["defs","g","marker","mask","pattern","svg","switch","symbol","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feFlood","feGaussianBlur","feImage","feMerge","feMorphology","feOffset","feSpecularLighting","feTile","feTurbulence","linearGradient","radialGradient","stop","circle","ellipse","image","line","path","polygon","polyline","rect","text","use","textPath","tspan","foreignObject","clipPath"],Hr=[...$r,...qr],Gr=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"].sort().reverse(),Kr=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"].sort().reverse(),Zr=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),Wr=["accent-color","align-content","align-items","align-self","alignment-baseline","all","anchor-name","animation","animation-composition","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-range","animation-range-end","animation-range-start","animation-timeline","animation-timing-function","appearance","aspect-ratio","backdrop-filter","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-position-x","background-position-y","background-repeat","background-size","baseline-shift","block-size","border","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-end-end-radius","border-end-start-radius","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-start-end-radius","border-start-start-radius","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-align","box-decoration-break","box-direction","box-flex","box-flex-group","box-lines","box-ordinal-group","box-orient","box-pack","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","color-scheme","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","contain-intrinsic-block-size","contain-intrinsic-height","contain-intrinsic-inline-size","contain-intrinsic-size","contain-intrinsic-width","container","container-name","container-type","content","content-visibility","corner-bottom-left-shape","corner-bottom-right-shape","corner-shape","corner-top-left-shape","corner-top-right-shape","counter-increment","counter-reset","counter-set","cue","cue-after","cue-before","cursor","cx","cy","direction","display","dominant-baseline","empty-cells","enable-background","field-sizing","fill","fill-opacity","fill-rule","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flood-color","flood-opacity","flow","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-optical-sizing","font-palette","font-size","font-size-adjust","font-smooth","font-smoothing","font-stretch","font-style","font-synthesis","font-synthesis-position","font-synthesis-small-caps","font-synthesis-style","font-synthesis-weight","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-emoji","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","forced-color-adjust","gap","glyph-orientation-horizontal","glyph-orientation-vertical","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphenate-character","hyphenate-limit-chars","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","initial-letter","initial-letter-align","inline-size","inset","inset-area","inset-block","inset-block-end","inset-block-start","inset-inline","inset-inline-end","inset-inline-start","isolation","justify-content","justify-items","justify-self","kerning","left","letter-spacing","lighting-color","line-break","line-height","line-height-step","list-style","list-style-image","list-style-position","list-style-type","margin","margin-block","margin-block-end","margin-block-start","margin-bottom","margin-inline","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","margin-trim","marker","marker-end","marker-mid","marker-start","marks","mask","mask-border","mask-border-mode","mask-border-outset","mask-border-repeat","mask-border-slice","mask-border-source","mask-border-width","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","masonry-auto-flow","math-depth","math-shift","math-style","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","offset","offset-anchor","offset-distance","offset-path","offset-position","offset-rotate","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-anchor","overflow-block","overflow-clip-margin","overflow-inline","overflow-wrap","overflow-x","overflow-y","overlay","overscroll-behavior","overscroll-behavior-block","overscroll-behavior-inline","overscroll-behavior-x","overscroll-behavior-y","padding","padding-block","padding-block-end","padding-block-start","padding-bottom","padding-inline","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","paint-order","pause","pause-after","pause-before","perspective","perspective-origin","place-content","place-items","place-self","pointer-events","position","position-anchor","position-visibility","print-color-adjust","quotes","r","resize","rest","rest-after","rest-before","right","rotate","row-gap","ruby-align","ruby-position","scale","scroll-behavior","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-stop","scroll-snap-type","scroll-timeline","scroll-timeline-axis","scroll-timeline-name","scrollbar-color","scrollbar-gutter","scrollbar-width","shape-image-threshold","shape-margin","shape-outside","shape-rendering","speak","speak-as","src","stop-color","stop-opacity","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","tab-size","table-layout","text-align","text-align-all","text-align-last","text-anchor","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-skip-ink","text-decoration-style","text-decoration-thickness","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-size-adjust","text-transform","text-underline-offset","text-underline-position","text-wrap","text-wrap-mode","text-wrap-style","timeline-scope","top","touch-action","transform","transform-box","transform-origin","transform-style","transition","transition-behavior","transition-delay","transition-duration","transition-property","transition-timing-function","translate","unicode-bidi","unicode-range","user-modify","user-select","vector-effect","vertical-align","view-timeline","view-timeline-axis","view-timeline-inset","view-timeline-name","view-transition-name","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","white-space","white-space-collapse","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","x","y","z-index","zoom"].sort().reverse();function Yr(e){const t=e.regex,n=Ur(e),u={begin:/-(webkit|moz|ms|o)-(?=[a-z])/},r="and or not only",i=/@-?\w[\w]*(-\w+)*/,a="[a-zA-Z-][a-zA-Z0-9_-]*",o=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE];return{name:"CSS",case_insensitive:!0,illegal:/[=|'\$]/,keywords:{keyframePosition:"from to"},classNameAliases:{keyframePosition:"selector-tag"},contains:[n.BLOCK_COMMENT,u,n.CSS_NUMBER_MODE,{className:"selector-id",begin:/#[A-Za-z0-9_-]+/,relevance:0},{className:"selector-class",begin:"\\."+a,relevance:0},n.ATTRIBUTE_SELECTOR_MODE,{className:"selector-pseudo",variants:[{begin:":("+Kr.join("|")+")"},{begin:":(:)?("+Zr.join("|")+")"}]},n.CSS_VARIABLE,{className:"attribute",begin:"\\b("+Wr.join("|")+")\\b"},{begin:/:/,end:/[;}{]/,contains:[n.BLOCK_COMMENT,n.HEXCOLOR,n.IMPORTANT,n.CSS_NUMBER_MODE,n.UNICODE_RANGE,...o,{begin:/(url|data-uri)\(/,end:/\)/,relevance:0,keywords:{built_in:"url data-uri"},contains:[...o,{className:"string",begin:/[^)]/,endsWithParent:!0,excludeEnd:!0}]},n.FUNCTION_DISPATCH]},{begin:t.lookahead(/@/),end:"[{;]",relevance:0,illegal:/:/,contains:[{className:"keyword",begin:i},{begin:/\s/,endsWithParent:!0,excludeEnd:!0,relevance:0,keywords:{$pattern:/[a-z-]+/,keyword:r,attribute:Gr.join(" ")},contains:[{begin:/[a-z-]+(?=:)/,className:"attribute"},...o,n.CSS_NUMBER_MODE]}]},{className:"selector-tag",begin:"\\b("+Hr.join("|")+")\\b"}]}}function Vr(e){const t=e.regex;return{name:"Diff",aliases:["patch"],contains:[{className:"meta",relevance:10,match:t.either(/^@@ +-\d+,\d+ +\+\d+,\d+ +@@/,/^@@ +-\d+ +\+\d+,\d+ +@@/,/^@@ +-\d+,\d+ +\+\d+ +@@/,/^@@ +-\d+ +\+\d+ +@@/,/^\*\*\* +\d+,\d+ +\*\*\*\*$/,/^--- +\d+,\d+ +----$/)},{className:"comment",variants:[{begin:t.either(/Index: /,/^index/,/={3,}/,/^-{3}/,/^\*{3} /,/^\+{3}/,/^diff --git/),end:/$/},{match:/^\*{15}$/}]},{className:"addition",begin:/^\+/,end:/$/},{className:"deletion",begin:/^-/,end:/$/},{className:"addition",begin:/^!/,end:/$/}]}}function Xr(e){return{name:"Dockerfile",aliases:["docker"],case_insensitive:!0,keywords:["from","maintainer","expose","env","arg","user","onbuild","stopsignal"],contains:[e.HASH_COMMENT_MODE,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,e.NUMBER_MODE,{beginKeywords:"run cmd entrypoint volume add copy workdir label healthcheck shell",starts:{end:/[^\\]$/,subLanguage:"bash"}}],illegal:"</"}}function Qr(e){const i={keyword:["break","case","chan","const","continue","default","defer","else","fallthrough","for","func","go","goto","if","import","interface","map","package","range","return","select","struct","switch","type","var"],type:["bool","byte","complex64","complex128","error","float32","float64","int8","int16","int32","int64","string","uint8","uint16","uint32","uint64","int","uint","uintptr","rune"],literal:["true","false","iota","nil"],built_in:["append","cap","close","complex","copy","imag","len","make","new","panic","print","println","real","recover","delete"]};return{name:"Go",aliases:["golang"],keywords:i,illegal:"</",contains:[e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,{className:"string",variants:[e.QUOTE_STRING_MODE,e.APOS_STRING_MODE,{begin:"`",end:"`"}]},{className:"number",variants:[{match:/-?\b0[xX]\.[a-fA-F0-9](_?[a-fA-F0-9])*[pP][+-]?\d(_?\d)*i?/,relevance:0},{match:/-?\b0[xX](_?[a-fA-F0-9])+((\.([a-fA-F0-9](_?[a-fA-F0-9])*)?)?[pP][+-]?\d(_?\d)*)?i?/,relevance:0},{match:/-?\b0[oO](_?[0-7])*i?/,relevance:0},{match:/-?\b0[bB](_?[01])*i?/,relevance:0},{match:/-?\.\d(_?\d)*([eE][+-]?\d(_?\d)*)?i?/,relevance:0},{match:/-?\b\d(_?\d)*(\.(\d(_?\d)*)?)?([eE][+-]?\d(_?\d)*)?i?/,relevance:0}]},{begin:/:=/},{className:"function",beginKeywords:"func",end:"\\s*(\\{|$)",excludeEnd:!0,contains:[e.TITLE_MODE,{className:"params",begin:/\(/,end:/\)/,endsParent:!0,keywords:i,illegal:/["']/}]}]}}function Jr(e){const t=e.regex,n={className:"number",relevance:0,variants:[{begin:/([+-]+)?[\d]+_[\d_]+/},{begin:e.NUMBER_RE}]},u=e.COMMENT();u.variants=[{begin:/;/,end:/$/},{begin:/#/,end:/$/}];const r={className:"variable",variants:[{begin:/\$[\w\d"][\w\d_]*/},{begin:/\$\{(.*?)\}/}]},i={className:"literal",begin:/\bon|off|true|false|yes|no\b/},a={className:"string",contains:[e.BACKSLASH_ESCAPE],variants:[{begin:"'''",end:"'''",relevance:10},{begin:'"""',end:'"""',relevance:10},{begin:'"',end:'"'},{begin:"'",end:"'"}]},o={begin:/\[/,end:/\]/,contains:[u,i,r,a,n,"self"],relevance:0},s=/[A-Za-z0-9_-]+/,c=/"(\\"|[^"])*"/,l=/'[^']*'/,f=t.either(s,c,l),h=t.concat(f,"(\\s*\\.\\s*",f,")*",t.lookahead(/\s*=\s*[^#\s]/));return{name:"TOML, also INI",aliases:["toml"],case_insensitive:!0,illegal:/\S/,contains:[u,{className:"section",begin:/\[+/,end:/\]+/},{begin:h,className:"attr",starts:{end:/$/,contains:[u,o,i,r,a,n]}}]}}var We="[0-9](_*[0-9])*",xt=`\\.(${We})`,kt="[0-9a-fA-F](_*[0-9a-fA-F])*",Pn={className:"number",variants:[{begin:`(\\b(${We})((${xt})|\\.)?|(${xt}))[eE][+-]?(${We})[fFdD]?\\b`},{begin:`\\b(${We})((${xt})[fFdD]?\\b|\\.([fFdD]\\b)?)`},{begin:`(${xt})[fFdD]?\\b`},{begin:`\\b(${We})[fFdD]\\b`},{begin:`\\b0[xX]((${kt})\\.?|(${kt})?\\.(${kt}))[pP][+-]?(${We})[fFdD]?\\b`},{begin:"\\b(0|[1-9](_*[0-9])*)[lL]?\\b"},{begin:`\\b0[xX](${kt})[lL]?\\b`},{begin:"\\b0(_*[0-7])*[lL]?\\b"},{begin:"\\b0[bB][01](_*[01])*[lL]?\\b"}],relevance:0};function zn(e,t,n){return n===-1?"":e.replace(t,u=>zn(e,t,n-1))}function jr(e){const t=e.regex,n="[À-ʸa-zA-Z_$][À-ʸa-zA-Z_$0-9]*",u="(?:(?:\\s*\\[\\s*])+)?",r=n+"<@@@>"+u,a="(?:"+("\\?(?:\\s+(?:extends|super)\\s+"+r+")?")+"|"+r+")",o=zn("(?:\\s*<\\s*"+a+"(?:\\s*,\\s*"+a+")*\\s*>)?",/<@@@>/g,2),h={keyword:["synchronized","abstract","private","var","static","if","const ","for","while","strictfp","finally","protected","import","native","final","void","enum","else","break","transient","catch","instanceof","volatile","case","assert","package","default","public","try","switch","continue","throws","protected","public","private","module","requires","exports","do","sealed","yield","permits","goto","when"],literal:["false","true","null"],type:["char","boolean","long","float","int","byte","short","double"],built_in:["super","this"]},p={className:"meta",begin:"@"+n,contains:[{begin:/\(/,end:/\)/,contains:["self"]}]},b={className:"params",begin:/\(/,end:/\)/,keywords:h,relevance:0,contains:[e.C_BLOCK_COMMENT_MODE],endsParent:!0};return{name:"Java",aliases:["jsp"],keywords:h,illegal:/<\/|#/,contains:[e.COMMENT("/\\*\\*","\\*/",{relevance:0,contains:[{begin:/\w+@/,relevance:0},{className:"doctag",begin:"@[A-Za-z]+"}]}),{begin:/import java\.[a-z]+\./,keywords:"import",relevance:2},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,{begin:/"""/,end:/"""/,className:"string",contains:[e.BACKSLASH_ESCAPE]},e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,{match:[/\b(?:class|interface|enum|extends|implements|new)/,/\s+/,n],className:{1:"keyword",3:"title.class"}},{match:/non-sealed/,scope:"keyword"},{beginKeywords:"new throw return else yield assert",relevance:0},{begin:[n,t.concat(o,u,/\s+/),n,u,/\s*/,/=(?!=)/],className:{1:"type",3:"variable",6:"operator"}},{begin:[/record/,/\s+/,n],className:{1:"keyword",3:"title.class"},contains:[b,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{begin:[n,t.concat(o,u,/\s+/),n,/\s*(?=\()/],className:{1:"type",3:"title.function"},keywords:h,contains:[{className:"params",begin:/\(/,end:/\)/,keywords:h,relevance:0,contains:[p,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,Pn,e.C_BLOCK_COMMENT_MODE]},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},Pn,p]}}const Un="[A-Za-z$_][0-9A-Za-z$_]*",ei=["as","in","of","if","for","while","finally","var","new","function","do","return","void","else","break","catch","instanceof","with","throw","case","default","try","switch","continue","typeof","delete","let","yield","const","class","debugger","async","await","static","import","from","export","extends","using"],ti=["true","false","null","undefined","NaN","Infinity"],$n=["Object","Function","Boolean","Symbol","Math","Date","Number","BigInt","String","RegExp","Array","Float32Array","Float64Array","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Int32Array","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array","Set","Map","WeakSet","WeakMap","ArrayBuffer","SharedArrayBuffer","Atomics","DataView","JSON","Promise","Generator","GeneratorFunction","AsyncFunction","Reflect","Proxy","Intl","WebAssembly"],qn=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],Hn=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],ni=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","self","global"],ui=[].concat(Hn,$n,qn);function ri(e){const t=e.regex,n=($,{after:ae})=>{const fe="</"+$[0].slice(1);return $.input.indexOf(fe,ae)!==-1},u=Un,r={begin:"<>",end:"</>"},i=/<[A-Za-z0-9\\._:-]+\s*\/>/,a={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:($,ae)=>{const fe=$[0].length+$.index,le=$.input[fe];if(le==="<"||le===","){ae.ignoreMatch();return}le===">"&&(n($,{after:fe})||ae.ignoreMatch());let oe;const Te=$.input.substring(fe);if(oe=Te.match(/^\s*=/)){ae.ignoreMatch();return}if((oe=Te.match(/^\s+extends\s+/))&&oe.index===0){ae.ignoreMatch();return}}},o={$pattern:Un,keyword:ei,literal:ti,built_in:ui,"variable.language":ni},s="[0-9](_?[0-9])*",c=`\\.(${s})`,l="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",f={className:"number",variants:[{begin:`(\\b(${l})((${c})|\\.)?|(${c}))[eE][+-]?(${s})\\b`},{begin:`\\b(${l})\\b((${c})\\b|\\.)?|(${c})\\b`},{begin:"\\b(0|[1-9](_?[0-9])*)n\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*n?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*n?\\b"},{begin:"\\b0[0-7]+n?\\b"}],relevance:0},h={className:"subst",begin:"\\$\\{",end:"\\}",keywords:o,contains:[]},p={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,h],subLanguage:"xml"}},b={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,h],subLanguage:"css"}},E={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,h],subLanguage:"graphql"}},_={className:"string",begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE,h]},v={className:"comment",variants:[e.COMMENT(/\/\*\*(?!\/)/,"\\*/",{relevance:0,contains:[{begin:"(?=@[A-Za-z]+)",relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"},{className:"type",begin:"\\{",end:"\\}",excludeEnd:!0,excludeBegin:!0,relevance:0},{className:"variable",begin:u+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),e.C_BLOCK_COMMENT_MODE,e.C_LINE_COMMENT_MODE]},w=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,p,b,E,_,{match:/\$\d+/},f];h.contains=w.concat({begin:/\{/,end:/\}/,keywords:o,contains:["self"].concat(w)});const x=[].concat(v,h.contains),y=x.concat([{begin:/(\s*)\(/,end:/\)/,keywords:o,contains:["self"].concat(x)}]),k={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:o,contains:y},S={variants:[{match:[/class/,/\s+/,u,/\s+/,/extends/,/\s+/,t.concat(u,"(",t.concat(/\./,u),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,u],scope:{1:"keyword",3:"title.class"}}]},F={relevance:0,match:t.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:"title.class",keywords:{_:[...$n,...qn]}},z={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},X={variants:[{match:[/function/,/\s+/,u,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[k],illegal:/%/},ee={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function pe($){return t.concat("(?!",$.join("|"),")")}const ge={match:t.concat(/\b/,pe([...Hn,"super","import","await"].map($=>`${$}\\s*\\(`)),u,t.lookahead(/\s*\(/)),className:"title.function",relevance:0},V={begin:t.concat(/\./,t.lookahead(t.concat(u,/(?![0-9A-Za-z$_(])/))),end:u,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},Z={match:[/get|set/,/\s+/,u,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},k]},ie="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+e.UNDERSCORE_IDENT_RE+")\\s*=>",Se={match:[/const|var|let/,/\s+/,u,/\s*/,/=\s*/,/(async\s*)?/,t.lookahead(ie)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[k]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:o,exports:{PARAMS_CONTAINS:y,CLASS_REFERENCE:F},illegal:/#(?![$_A-Za-z])/,contains:[e.SHEBANG({label:"shebang",binary:"node",relevance:5}),z,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,p,b,E,_,v,{match:/\$\d+/},f,F,{scope:"attr",match:u+t.lookahead(":"),relevance:0},Se,{begin:"("+e.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[v,e.REGEXP_MODE,{className:"function",begin:ie,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:e.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:o,contains:y}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:r.begin,end:r.end},{match:i},{begin:a.begin,"on:begin":a.isTrulyOpeningTag,end:a.end}],subLanguage:"xml",contains:[{begin:a.begin,end:a.end,skip:!0,contains:["self"]}]}]},X,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+e.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[k,e.inherit(e.TITLE_MODE,{begin:u,className:"title.function"})]},{match:/\.\.\./,relevance:0},V,{match:"\\$"+u,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[k]},ge,ee,S,Z,{match:/\$[(.]/}]}}const ii={scope:"number",match:"([-+]?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)|NaN|[-+]?Infinity",relevance:0};function ai(e){const t={className:"attr",begin:/(("(\\.|[^\\"\r\n])*")|('(\\.|[^\\'\r\n])*'))(?=\s*:)/,relevance:1.01},n={match:/[{}[\],:]/,className:"punctuation",relevance:0},u=["true","false","null"],r={scope:"literal",beginKeywords:u.join(" ")};return{name:"JSON",aliases:["jsonc","json5"],keywords:{literal:u},contains:[t,n,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,r,ii,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE],illegal:"\\S"}}var Ye="[0-9](_*[0-9])*",yt=`\\.(${Ye})`,At="[0-9a-fA-F](_*[0-9a-fA-F])*",oi={className:"number",variants:[{begin:`(\\b(${Ye})((${yt})|\\.)?|(${yt}))[eE][+-]?(${Ye})[fFdD]?\\b`},{begin:`\\b(${Ye})((${yt})[fFdD]?\\b|\\.([fFdD]\\b)?)`},{begin:`(${yt})[fFdD]?\\b`},{begin:`\\b(${Ye})[fFdD]\\b`},{begin:`\\b0[xX]((${At})\\.?|(${At})?\\.(${At}))[pP][+-]?(${Ye})[fFdD]?\\b`},{begin:"\\b(0|[1-9](_*[0-9])*)[lL]?\\b"},{begin:`\\b0[xX](${At})[lL]?\\b`},{begin:"\\b0(_*[0-7])*[lL]?\\b"},{begin:"\\b0[bB][01](_*[01])*[lL]?\\b"}],relevance:0};function si(e){const t={keyword:"abstract as val var vararg get set class object open private protected public noinline crossinline dynamic final enum if else do while for when throw try catch finally import package is in fun override companion reified inline lateinit init interface annotation data sealed internal infix operator out by constructor super tailrec where const inner suspend typealias external expect actual",built_in:"Byte Short Char Int Long Boolean Float Double Void Unit Nothing",literal:"true false null"},n={className:"keyword",begin:/\b(break|continue|return|this)\b/,starts:{contains:[{className:"symbol",begin:/@\w+/}]}},u={className:"symbol",begin:e.UNDERSCORE_IDENT_RE+"@"},r={className:"subst",begin:/\$\{/,end:/\}/,contains:[e.C_NUMBER_MODE]},i={className:"variable",begin:"\\$"+e.UNDERSCORE_IDENT_RE},a={className:"string",variants:[{begin:'"""',end:'"""(?=[^"])',contains:[i,r]},{begin:"'",end:"'",illegal:/\n/,contains:[e.BACKSLASH_ESCAPE]},{begin:'"',end:'"',illegal:/\n/,contains:[e.BACKSLASH_ESCAPE,i,r]}]};r.contains.push(a);const o={className:"meta",begin:"@(?:file|property|field|get|set|receiver|param|setparam|delegate)\\s*:(?:\\s*"+e.UNDERSCORE_IDENT_RE+")?"},s={className:"meta",begin:"@"+e.UNDERSCORE_IDENT_RE,contains:[{begin:/\(/,end:/\)/,contains:[e.inherit(a,{className:"string"}),"self"]}]},c=oi,l=e.COMMENT("/\\*","\\*/",{contains:[e.C_BLOCK_COMMENT_MODE]}),f={variants:[{className:"type",begin:e.UNDERSCORE_IDENT_RE},{begin:/\(/,end:/\)/,contains:[]}]},h=f;return h.variants[1].contains=[f],f.variants[1].contains=[h],{name:"Kotlin",aliases:["kt","kts","ktm","ktx"],keywords:t,contains:[e.COMMENT("/\\*\\*","\\*/",{relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"}]}),e.C_LINE_COMMENT_MODE,l,n,u,o,s,{className:"function",beginKeywords:"fun",end:"[(]|$",returnBegin:!0,excludeEnd:!0,keywords:t,relevance:5,contains:[{begin:e.UNDERSCORE_IDENT_RE+"\\s*\\(",returnBegin:!0,relevance:0,contains:[e.UNDERSCORE_TITLE_MODE]},{className:"type",begin:/</,end:/>/,keywords:"reified",relevance:0},{className:"params",begin:/\(/,end:/\)/,endsParent:!0,keywords:t,relevance:0,contains:[{begin:/:/,end:/[=,\/]/,endsWithParent:!0,contains:[f,e.C_LINE_COMMENT_MODE,l],relevance:0},e.C_LINE_COMMENT_MODE,l,o,s,a,e.C_NUMBER_MODE]},l]},{begin:[/class|interface|trait/,/\s+/,e.UNDERSCORE_IDENT_RE],beginScope:{3:"title.class"},keywords:"class interface trait",end:/[:\{(]|$/,excludeEnd:!0,illegal:"extends implements",contains:[{beginKeywords:"public protected internal private constructor"},e.UNDERSCORE_TITLE_MODE,{className:"type",begin:/</,end:/>/,excludeBegin:!0,excludeEnd:!0,relevance:0},{className:"type",begin:/[,:]\s*/,end:/[<\(,){\s]|$/,excludeBegin:!0,returnEnd:!0},o,s]},a,{className:"meta",begin:"^#!/usr/bin/env",end:"$",illegal:`
- `},c]}}const ci=e=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:e.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},UNICODE_RANGE:{scope:"number",begin:/\b[Uu]\+[0-9A-Fa-f][0-9A-Fa-f?]{0,5}(-[0-9A-Fa-f][0-9A-Fa-f]{0,5})?/},FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:e.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z_][A-Za-z0-9_-]*/}}),li=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","optgroup","option","p","picture","q","quote","samp","section","select","source","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],di=["defs","g","marker","mask","pattern","svg","switch","symbol","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feFlood","feGaussianBlur","feImage","feMerge","feMorphology","feOffset","feSpecularLighting","feTile","feTurbulence","linearGradient","radialGradient","stop","circle","ellipse","image","line","path","polygon","polyline","rect","text","use","textPath","tspan","foreignObject","clipPath"],fi=[...li,...di],bi=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"].sort().reverse(),Gn=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"].sort().reverse(),Kn=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),pi=["accent-color","align-content","align-items","align-self","alignment-baseline","all","anchor-name","animation","animation-composition","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-range","animation-range-end","animation-range-start","animation-timeline","animation-timing-function","appearance","aspect-ratio","backdrop-filter","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-position-x","background-position-y","background-repeat","background-size","baseline-shift","block-size","border","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-end-end-radius","border-end-start-radius","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-start-end-radius","border-start-start-radius","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-align","box-decoration-break","box-direction","box-flex","box-flex-group","box-lines","box-ordinal-group","box-orient","box-pack","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","color-scheme","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","contain-intrinsic-block-size","contain-intrinsic-height","contain-intrinsic-inline-size","contain-intrinsic-size","contain-intrinsic-width","container","container-name","container-type","content","content-visibility","corner-bottom-left-shape","corner-bottom-right-shape","corner-shape","corner-top-left-shape","corner-top-right-shape","counter-increment","counter-reset","counter-set","cue","cue-after","cue-before","cursor","cx","cy","direction","display","dominant-baseline","empty-cells","enable-background","field-sizing","fill","fill-opacity","fill-rule","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flood-color","flood-opacity","flow","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-optical-sizing","font-palette","font-size","font-size-adjust","font-smooth","font-smoothing","font-stretch","font-style","font-synthesis","font-synthesis-position","font-synthesis-small-caps","font-synthesis-style","font-synthesis-weight","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-emoji","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","forced-color-adjust","gap","glyph-orientation-horizontal","glyph-orientation-vertical","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphenate-character","hyphenate-limit-chars","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","initial-letter","initial-letter-align","inline-size","inset","inset-area","inset-block","inset-block-end","inset-block-start","inset-inline","inset-inline-end","inset-inline-start","isolation","justify-content","justify-items","justify-self","kerning","left","letter-spacing","lighting-color","line-break","line-height","line-height-step","list-style","list-style-image","list-style-position","list-style-type","margin","margin-block","margin-block-end","margin-block-start","margin-bottom","margin-inline","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","margin-trim","marker","marker-end","marker-mid","marker-start","marks","mask","mask-border","mask-border-mode","mask-border-outset","mask-border-repeat","mask-border-slice","mask-border-source","mask-border-width","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","masonry-auto-flow","math-depth","math-shift","math-style","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","offset","offset-anchor","offset-distance","offset-path","offset-position","offset-rotate","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-anchor","overflow-block","overflow-clip-margin","overflow-inline","overflow-wrap","overflow-x","overflow-y","overlay","overscroll-behavior","overscroll-behavior-block","overscroll-behavior-inline","overscroll-behavior-x","overscroll-behavior-y","padding","padding-block","padding-block-end","padding-block-start","padding-bottom","padding-inline","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","paint-order","pause","pause-after","pause-before","perspective","perspective-origin","place-content","place-items","place-self","pointer-events","position","position-anchor","position-visibility","print-color-adjust","quotes","r","resize","rest","rest-after","rest-before","right","rotate","row-gap","ruby-align","ruby-position","scale","scroll-behavior","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-stop","scroll-snap-type","scroll-timeline","scroll-timeline-axis","scroll-timeline-name","scrollbar-color","scrollbar-gutter","scrollbar-width","shape-image-threshold","shape-margin","shape-outside","shape-rendering","speak","speak-as","src","stop-color","stop-opacity","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","tab-size","table-layout","text-align","text-align-all","text-align-last","text-anchor","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-skip-ink","text-decoration-style","text-decoration-thickness","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-size-adjust","text-transform","text-underline-offset","text-underline-position","text-wrap","text-wrap-mode","text-wrap-style","timeline-scope","top","touch-action","transform","transform-box","transform-origin","transform-style","transition","transition-behavior","transition-delay","transition-duration","transition-property","transition-timing-function","translate","unicode-bidi","unicode-range","user-modify","user-select","vector-effect","vertical-align","view-timeline","view-timeline-axis","view-timeline-inset","view-timeline-name","view-transition-name","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","white-space","white-space-collapse","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","x","y","z-index","zoom"].sort().reverse(),hi=Gn.concat(Kn).sort().reverse();function gi(e){const t=ci(e),n=hi,u="and or not only",r="[\\w-]+",i="("+r+"|@\\{"+r+"\\})",a=[],o=[],s=function(w){return{className:"string",begin:"~?"+w+".*?"+w}},c=function(w,x,y){return{className:w,begin:x,relevance:y}},l={$pattern:/[a-z-]+/,keyword:u,attribute:bi.join(" ")},f={begin:"\\(",end:"\\)",contains:o,keywords:l,relevance:0};o.push(e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,s("'"),s('"'),t.CSS_NUMBER_MODE,{begin:"(url|data-uri)\\(",starts:{className:"string",end:"[\\)\\n]",excludeEnd:!0}},t.UNICODE_RANGE,t.HEXCOLOR,f,c("variable","@@?"+r,10),c("variable","@\\{"+r+"\\}"),c("built_in","~?`[^`]*?`"),{className:"attribute",begin:r+"\\s*:",end:":",returnBegin:!0,excludeEnd:!0},t.IMPORTANT,{beginKeywords:"and not"},t.FUNCTION_DISPATCH);const h=o.concat({begin:/\{/,end:/\}/,contains:a}),p={beginKeywords:"when",endsWithParent:!0,contains:[{beginKeywords:"and not"}].concat(o)},b={begin:i+"\\s*:",returnBegin:!0,end:/[;}]/,relevance:0,contains:[{begin:/-(webkit|moz|ms|o)-/},t.CSS_VARIABLE,{className:"attribute",begin:"\\b("+pi.join("|")+")\\b",end:/(?=:)/,starts:{endsWithParent:!0,illegal:"[<=$]",relevance:0,contains:o}}]},E={className:"keyword",begin:"@(import|media|charset|font-face|(-[a-z]+-)?keyframes|supports|document|namespace|page|viewport|host)\\b",starts:{end:"[;{}]",keywords:l,returnEnd:!0,contains:o,relevance:0}},_={className:"variable",variants:[{begin:"@"+r+"\\s*:",relevance:15},{begin:"@"+r}],starts:{end:"[;}]",returnEnd:!0,contains:h}},g={variants:[{begin:"[\\.#:&\\[>]",end:"[;{}]"},{begin:i,end:/\{/}],returnBegin:!0,returnEnd:!0,illegal:`[<='$"]`,relevance:0,contains:[e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,p,c("keyword","all\\b"),c("variable","@\\{"+r+"\\}"),{begin:"\\b("+fi.join("|")+")\\b",className:"selector-tag"},t.CSS_NUMBER_MODE,c("selector-tag",i,0),c("selector-id","#"+i),c("selector-class","\\."+i,0),c("selector-tag","&",0),t.ATTRIBUTE_SELECTOR_MODE,{className:"selector-pseudo",begin:":("+Gn.join("|")+")"},{className:"selector-pseudo",begin:":(:)?("+Kn.join("|")+")"},{begin:/\(/,end:/\)/,relevance:0,contains:h},{begin:"!important"},t.FUNCTION_DISPATCH]},v={begin:r+`:(:)?(${n.join("|")})`,returnBegin:!0,contains:[g]};return a.push(e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,E,_,v,b,g,p,t.FUNCTION_DISPATCH),{name:"Less",case_insensitive:!0,illegal:`[=>'/<($"]`,contains:a}}function mi(e){const t="\\[=*\\[",n="\\]=*\\]",u={begin:t,end:n,contains:["self"]},r=[e.COMMENT("--(?!"+t+")","$"),e.COMMENT("--"+t,n,{contains:[u],relevance:10})];return{name:"Lua",aliases:["pluto"],keywords:{$pattern:e.UNDERSCORE_IDENT_RE,literal:"true false nil",keyword:"and break do else elseif end for goto if in local global not or repeat return then until while",built_in:"_G _ENV _VERSION __index __newindex __mode __call __metatable __tostring __len __gc __add __sub __mul __div __mod __pow __concat __unm __eq __lt __le assert collectgarbage dofile error getfenv getmetatable ipairs load loadfile loadstring module next pairs pcall print rawequal rawget rawset require select setfenv setmetatable tonumber tostring type unpack xpcall arg self coroutine resume yield status wrap create running debug getupvalue debug sethook getmetatable gethook setmetatable setlocal traceback setfenv getinfo setupvalue getlocal getregistry getfenv io lines write close flush open output type read stderr stdin input stdout popen tmpfile math log max acos huge ldexp pi cos tanh pow deg tan cosh sinh random randomseed frexp ceil floor rad abs sqrt modf asin min mod fmod log10 atan2 exp sin atan os exit setlocale date getenv difftime remove time clock tmpname rename execute package preload loadlib loaded loaders cpath config path seeall string sub upper len gfind rep find match char dump gmatch reverse byte format gsub lower table setn insert getn foreachi maxn foreach concat sort remove"},contains:r.concat([{className:"function",beginKeywords:"function",end:"\\)",contains:[e.inherit(e.TITLE_MODE,{begin:"([_a-zA-Z]\\w*\\.)*([_a-zA-Z]\\w*:)?[_a-zA-Z]\\w*"}),{className:"params",begin:"\\(",endsWithParent:!0,contains:r}].concat(r)},e.C_NUMBER_MODE,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,{className:"string",begin:t,end:n,contains:[u],relevance:5}])}}function _i(e){const t={className:"variable",variants:[{begin:"\\$\\("+e.UNDERSCORE_IDENT_RE+"\\)",contains:[e.BACKSLASH_ESCAPE]},{begin:/\$[@%<?\^\+\*]/}]},n={className:"string",begin:/"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,t]},u={className:"variable",begin:/\$\([\w-]+\s/,end:/\)/,keywords:{built_in:"subst patsubst strip findstring filter filter-out sort word wordlist firstword lastword dir notdir suffix basename addsuffix addprefix join wildcard realpath abspath error warning shell origin flavor foreach if or and call eval file value"},contains:[t,n]},r={begin:"^"+e.UNDERSCORE_IDENT_RE+"\\s*(?=[:+?]?=)"},i={className:"meta",begin:/^\.PHONY:/,end:/$/,keywords:{$pattern:/[\.\w]+/,keyword:".PHONY"}},a={className:"section",begin:/^[^\s]+:/,end:/$/,contains:[t]};return{name:"Makefile",aliases:["mk","mak","make"],keywords:{$pattern:/[\w-]+/,keyword:"define endef undefine ifdef ifndef ifeq ifneq else endif include -include sinclude override export unexport private vpath"},contains:[e.HASH_COMMENT_MODE,t,n,u,r,i,a]}}function Ei(e){const t=e.regex,n={begin:/<\/?[A-Za-z_]/,end:">",subLanguage:"xml",relevance:0},u={match:/^ {0,3}([-*_])[ \t]*(?:\1[ \t]*){2,}$/},r={className:"code",variants:[{begin:"(`{3,})[^`](.|\\n)*?\\1`*[ ]*"},{begin:"(~{3,})[^~](.|\\n)*?\\1~*[ ]*"},{begin:"```",end:"```+[ ]*$"},{begin:"~~~",end:"~~~+[ ]*$"},{begin:"`.+?`"},{begin:"(?=^( {4}|\\t))",contains:[{begin:"^( {4}|\\t)",end:"(\\n)$"}],relevance:0}]},i={className:"bullet",begin:"^[ ]*([*+-]|(\\d+\\.))(?=\\s+)",end:"\\s+",excludeEnd:!0},a={begin:/^\[[^\n]+\]:/,returnBegin:!0,contains:[{className:"symbol",begin:/\[/,end:/\]/,excludeBegin:!0,excludeEnd:!0},{className:"link",begin:/:\s*/,end:/$/,excludeBegin:!0}]},o=/[A-Za-z][A-Za-z0-9+.-]*/,s={variants:[{begin:/\[.+?\]\[.*?\]/,relevance:0},{begin:/\[.+?\]\(((data|javascript|mailto):|(?:http|ftp)s?:\/\/).*?\)/,relevance:2},{begin:t.concat(/\[.+?\]\(/,o,/:\/\/.*?\)/),relevance:2},{begin:/\[.+?\]\([./?&#].*?\)/,relevance:1},{begin:/\[.*?\]\(.*?\)/,relevance:0}],returnBegin:!0,contains:[{match:/\[(?=\])/},{className:"string",relevance:0,begin:"\\[",end:"\\]",excludeBegin:!0,returnEnd:!0},{className:"link",relevance:0,begin:"\\]\\(",end:"\\)",excludeBegin:!0,excludeEnd:!0},{className:"symbol",relevance:0,begin:"\\]\\[",end:"\\]",excludeBegin:!0,excludeEnd:!0}]},c={className:"strong",contains:[],variants:[{begin:/_{2}(?!\s)/,end:/_{2}/},{begin:/\*{2}(?!\s)/,end:/\*{2}/}]},l={className:"emphasis",contains:[],variants:[{begin:/\*(?![*\s])/,end:/\*/},{begin:/_(?![_\s])/,end:/_/,relevance:0}]},f=e.inherit(c,{contains:[]}),h=e.inherit(l,{contains:[]});c.contains.push(h),l.contains.push(f);let p=[n,s];return[c,l,f,h].forEach(g=>{g.contains=g.contains.concat(p)}),p=p.concat(c,l),{name:"Markdown",aliases:["md","mkdown","mkd"],contains:[{className:"section",variants:[{begin:"^#{1,6}",end:"$",contains:p},{begin:"(?=^.+?\\n[=-]{2,}$)",contains:[{begin:"^[=-]*$"},{begin:"^",end:"\\n",contains:p}]}]},n,i,u,c,l,{className:"quote",begin:"^>\\s+",contains:p,end:"$"},r,s,a,{scope:"literal",match:/&([a-zA-Z0-9]+|#[0-9]{1,7}|#[Xx][0-9a-fA-F]{1,6});/}]}}function xi(e){const t=e.regex,n=["abs","accept","alarm","and","atan2","bind","binmode","bless","break","caller","chdir","chmod","chomp","chop","chown","chr","chroot","class","close","closedir","connect","continue","cos","crypt","dbmclose","dbmopen","defined","delete","die","do","dump","each","else","elsif","endgrent","endhostent","endnetent","endprotoent","endpwent","endservent","eof","eval","exec","exists","exit","exp","fcntl","field","fileno","flock","for","foreach","fork","format","formline","getc","getgrent","getgrgid","getgrnam","gethostbyaddr","gethostbyname","gethostent","getlogin","getnetbyaddr","getnetbyname","getnetent","getpeername","getpgrp","getpriority","getprotobyname","getprotobynumber","getprotoent","getpwent","getpwnam","getpwuid","getservbyname","getservbyport","getservent","getsockname","getsockopt","given","glob","gmtime","goto","grep","gt","hex","if","index","int","ioctl","join","keys","kill","last","lc","lcfirst","length","link","listen","local","localtime","log","lstat","lt","ma","map","method","mkdir","msgctl","msgget","msgrcv","msgsnd","my","ne","next","no","not","oct","open","opendir","or","ord","our","pack","package","pipe","pop","pos","print","printf","prototype","push","q|0","qq","quotemeta","qw","qx","rand","read","readdir","readline","readlink","readpipe","recv","redo","ref","rename","require","reset","return","reverse","rewinddir","rindex","rmdir","say","scalar","seek","seekdir","select","semctl","semget","semop","send","setgrent","sethostent","setnetent","setpgrp","setpriority","setprotoent","setpwent","setservent","setsockopt","shift","shmctl","shmget","shmread","shmwrite","shutdown","sin","sleep","socket","socketpair","sort","splice","split","sprintf","sqrt","srand","stat","state","study","sub","substr","symlink","syscall","sysopen","sysread","sysseek","system","syswrite","tell","telldir","tie","tied","time","times","tr","truncate","uc","ucfirst","umask","undef","unless","unlink","unpack","unshift","untie","until","use","utime","values","vec","wait","waitpid","wantarray","warn","when","while","write","x|0","xor","y|0"],u=/[dualxmsipngr]{0,12}/,r={$pattern:/[\w.]+/,keyword:n.join(" ")},i={className:"subst",begin:"[$@]\\{",end:"\\}",keywords:r},a={begin:/->\{/,end:/\}/},o={scope:"attr",match:/\s+:\s*\w+(\s*\(.*?\))?/},s={scope:"variable",variants:[{begin:/\$\d/},{begin:t.concat(/[$%@](?!")(\^\w\b|#\w+(::\w+)*|\{\w+\}|\w+(::\w*)*)/,"(?![A-Za-z])(?![@$%])")},{begin:/[$%@](?!")[^\s\w{=]|\$=/,relevance:0}],contains:[o]},c={className:"number",variants:[{match:/0?\.[0-9][0-9_]+\b/},{match:/\bv?(0|[1-9][0-9_]*(\.[0-9_]+)?|[1-9][0-9_]*)\b/},{match:/\b0[0-7][0-7_]*\b/},{match:/\b0x[0-9a-fA-F][0-9a-fA-F_]*\b/},{match:/\b0b[0-1][0-1_]*\b/}],relevance:0},l=[e.BACKSLASH_ESCAPE,i,s],f=[/!/,/\//,/\|/,/\?/,/'/,/"/,/#/],h=(E,_,g="\\1")=>{const v=g==="\\1"?g:t.concat(g,_);return t.concat(t.concat("(?:",E,")"),_,/(?:\\.|[^\\\/])*?/,v,/(?:\\.|[^\\\/])*?/,g,u)},p=(E,_,g)=>t.concat(t.concat("(?:",E,")"),_,/(?:\\.|[^\\\/])*?/,g,u),b=[s,e.HASH_COMMENT_MODE,e.COMMENT(/^=\w/,/=cut/,{endsWithParent:!0}),a,{className:"string",contains:l,variants:[{begin:"q[qwxr]?\\s*\\(",end:"\\)",relevance:5},{begin:"q[qwxr]?\\s*\\[",end:"\\]",relevance:5},{begin:"q[qwxr]?\\s*\\{",end:"\\}",relevance:5},{begin:"q[qwxr]?\\s*\\|",end:"\\|",relevance:5},{begin:"q[qwxr]?\\s*<",end:">",relevance:5},{begin:"qw\\s+q",end:"q",relevance:5},{begin:"'",end:"'",contains:[e.BACKSLASH_ESCAPE]},{begin:'"',end:'"'},{begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE]},{begin:/\{\w+\}/,relevance:0},{begin:"-?\\w+\\s*=>",relevance:0}]},c,{begin:"(\\/\\/|"+e.RE_STARTERS_RE+"|\\b(split|return|print|reverse|grep)\\b)\\s*",keywords:"split return print reverse grep",relevance:0,contains:[e.HASH_COMMENT_MODE,{className:"regexp",variants:[{begin:h("s|tr|y",t.either(...f,{capture:!0}))},{begin:h("s|tr|y","\\(","\\)")},{begin:h("s|tr|y","\\[","\\]")},{begin:h("s|tr|y","\\{","\\}")}],relevance:2},{className:"regexp",variants:[{begin:/(m|qr)\/\//,relevance:0},{begin:p("(?:m|qr)?",/\//,/\//)},{begin:p("m|qr",t.either(...f,{capture:!0}),/\1/)},{begin:p("m|qr",/\(/,/\)/)},{begin:p("m|qr",/\[/,/\]/)},{begin:p("m|qr",/\{/,/\}/)}]}]},{className:"function",beginKeywords:"sub method",end:"(\\s*\\(.*?\\))?[;{]",excludeEnd:!0,relevance:5,contains:[e.TITLE_MODE,o]},{className:"class",beginKeywords:"class",end:"[;{]",excludeEnd:!0,relevance:5,contains:[e.TITLE_MODE,o,c]},{begin:"-\\w\\b",relevance:0},{begin:"^__DATA__$",end:"^__END__$",subLanguage:"mojolicious",contains:[{begin:"^@@.*",end:"$",className:"comment"}]}];return i.contains=b,a.contains=b,{name:"Perl",aliases:["pl","pm"],keywords:r,contains:b}}function ki(e){const t=e.regex,n=/(?![A-Za-z0-9])(?![$])/,u=t.concat(/[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*/,n),r=t.concat(/(\\?[A-Z][a-z0-9_\x7f-\xff]+|\\?[A-Z]+(?=[A-Z][a-z0-9_\x7f-\xff])){1,}/,n),i=t.concat(/[A-Z]+/,n),a={scope:"variable",match:"\\$+"+u},o={scope:"meta",variants:[{begin:/<\?php/,relevance:10},{begin:/<\?=/},{begin:/<\?/,relevance:.1},{begin:/\?>/}]},s={scope:"subst",variants:[{begin:/\$\w+/},{begin:/\{\$/,end:/\}/}]},c=e.inherit(e.APOS_STRING_MODE,{illegal:null}),l=e.inherit(e.QUOTE_STRING_MODE,{illegal:null,contains:e.QUOTE_STRING_MODE.contains.concat(s)}),f={begin:/<<<[ \t]*(?:(\w+)|"(\w+)")\n/,end:/[ \t]*(\w+)\b/,contains:e.QUOTE_STRING_MODE.contains.concat(s),"on:begin":(V,Z)=>{Z.data._beginMatch=V[1]||V[2]},"on:end":(V,Z)=>{Z.data._beginMatch!==V[1]&&Z.ignoreMatch()}},h=e.END_SAME_AS_BEGIN({begin:/<<<[ \t]*'(\w+)'\n/,end:/[ \t]*(\w+)\b/}),p=`[
- ]`,b={scope:"string",variants:[l,c,f,h]},E={scope:"number",variants:[{begin:"\\b0[bB][01]+(?:_[01]+)*\\b"},{begin:"\\b0[oO][0-7]+(?:_[0-7]+)*\\b"},{begin:"\\b0[xX][\\da-fA-F]+(?:_[\\da-fA-F]+)*\\b"},{begin:"(?:\\b\\d+(?:_\\d+)*(\\.(?:\\d+(?:_\\d+)*))?|\\B\\.\\d+)(?:[eE][+-]?\\d+)?"}],relevance:0},_=["false","null","true"],g=["__CLASS__","__DIR__","__FILE__","__FUNCTION__","__COMPILER_HALT_OFFSET__","__LINE__","__METHOD__","__NAMESPACE__","__TRAIT__","die","echo","exit","include","include_once","print","require","require_once","array","abstract","and","as","binary","bool","boolean","break","callable","case","catch","class","clone","const","continue","declare","default","do","double","else","elseif","empty","enddeclare","endfor","endforeach","endif","endswitch","endwhile","enum","eval","extends","final","finally","float","for","foreach","from","global","goto","if","implements","instanceof","insteadof","int","integer","interface","isset","iterable","list","match|0","mixed","new","never","object","or","private","protected","public","readonly","real","return","string","switch","throw","trait","try","unset","use","var","void","while","xor","yield"],v=["Error|0","AppendIterator","ArgumentCountError","ArithmeticError","ArrayIterator","ArrayObject","AssertionError","BadFunctionCallException","BadMethodCallException","CachingIterator","CallbackFilterIterator","CompileError","Countable","DirectoryIterator","DivisionByZeroError","DomainException","EmptyIterator","ErrorException","Exception","FilesystemIterator","FilterIterator","GlobIterator","InfiniteIterator","InvalidArgumentException","IteratorIterator","LengthException","LimitIterator","LogicException","MultipleIterator","NoRewindIterator","OutOfBoundsException","OutOfRangeException","OuterIterator","OverflowException","ParentIterator","ParseError","RangeException","RecursiveArrayIterator","RecursiveCachingIterator","RecursiveCallbackFilterIterator","RecursiveDirectoryIterator","RecursiveFilterIterator","RecursiveIterator","RecursiveIteratorIterator","RecursiveRegexIterator","RecursiveTreeIterator","RegexIterator","RuntimeException","SeekableIterator","SplDoublyLinkedList","SplFileInfo","SplFileObject","SplFixedArray","SplHeap","SplMaxHeap","SplMinHeap","SplObjectStorage","SplObserver","SplPriorityQueue","SplQueue","SplStack","SplSubject","SplTempFileObject","TypeError","UnderflowException","UnexpectedValueException","UnhandledMatchError","ArrayAccess","BackedEnum","Closure","Fiber","Generator","Iterator","IteratorAggregate","Serializable","Stringable","Throwable","Traversable","UnitEnum","WeakReference","WeakMap","Directory","__PHP_Incomplete_Class","parent","php_user_filter","self","static","stdClass"],x={keyword:g,literal:(V=>{const Z=[];return V.forEach(ie=>{Z.push(ie),ie.toLowerCase()===ie?Z.push(ie.toUpperCase()):Z.push(ie.toLowerCase())}),Z})(_),built_in:v},y=V=>V.map(Z=>Z.replace(/\|\d+$/,"")),k={variants:[{match:[/new/,t.concat(p,"+"),t.concat("(?!",y(v).join("\\b|"),"\\b)"),r],scope:{1:"keyword",4:"title.class"}}]},S=t.concat(u,"\\b(?!\\()"),F={variants:[{match:[t.concat(/::/,t.lookahead(/(?!class\b)/)),S],scope:{2:"variable.constant"}},{match:[/::/,/class/],scope:{2:"variable.language"}},{match:[r,t.concat(/::/,t.lookahead(/(?!class\b)/)),S],scope:{1:"title.class",3:"variable.constant"}},{match:[r,t.concat("::",t.lookahead(/(?!class\b)/))],scope:{1:"title.class"}},{match:[r,/::/,/class/],scope:{1:"title.class",3:"variable.language"}}]},z={scope:"attr",match:t.concat(u,t.lookahead(":"),t.lookahead(/(?!::)/))},X={relevance:0,begin:/\(/,end:/\)/,keywords:x,contains:[z,a,F,e.C_BLOCK_COMMENT_MODE,e.C_LINE_COMMENT_MODE,e.HASH_COMMENT_MODE,b,E,k]},ee={relevance:0,match:[/\b/,t.concat("(?!fn\\b|function\\b|",y(g).join("\\b|"),"|",y(v).join("\\b|"),"\\b)"),u,t.concat(p,"*"),t.lookahead(/(?=\()/)],scope:{3:"title.function.invoke"},contains:[X]};X.contains.push(ee);const pe=[z,F,e.C_BLOCK_COMMENT_MODE,e.C_LINE_COMMENT_MODE,e.HASH_COMMENT_MODE,b,E,k],ge={begin:t.concat(/#\[\s*\\?/,t.either(r,i)),beginScope:"meta",end:/]/,endScope:"meta",keywords:{literal:_,keyword:["new","array"]},contains:[{begin:/\[/,end:/]/,keywords:{literal:_,keyword:["new","array"]},contains:["self",...pe]},...pe,{scope:"meta",variants:[{match:r},{match:i}]}]};return{case_insensitive:!1,keywords:x,contains:[ge,e.HASH_COMMENT_MODE,e.COMMENT("//","$"),e.COMMENT("/\\*","\\*/",{contains:[{scope:"doctag",match:"@[A-Za-z]+"}]}),{match:/__halt_compiler\(\);/,keywords:"__halt_compiler",starts:{scope:"comment",end:e.MATCH_NOTHING_RE,contains:[{match:/\?>/,scope:"meta",endsParent:!0}]}},o,{scope:"variable.language",match:/\$this\b/},a,ee,F,{match:[/const/,/\s/,u],scope:{1:"keyword",3:"variable.constant"}},k,{scope:"function",relevance:0,beginKeywords:"fn function",end:/[;{]/,excludeEnd:!0,illegal:"[$%\\[]",contains:[{beginKeywords:"use"},e.UNDERSCORE_TITLE_MODE,{begin:"=>",endsParent:!0},{scope:"params",begin:"\\(",end:"\\)",excludeBegin:!0,excludeEnd:!0,keywords:x,contains:["self",ge,a,F,e.C_BLOCK_COMMENT_MODE,e.C_LINE_COMMENT_MODE,e.HASH_COMMENT_MODE,b,E]}]},{scope:"class",variants:[{beginKeywords:"enum",illegal:/[($"]/},{beginKeywords:"class interface trait",illegal:/[:($"]/}],relevance:0,end:/\{/,excludeEnd:!0,contains:[{beginKeywords:"extends implements"},e.UNDERSCORE_TITLE_MODE]},{beginKeywords:"namespace",relevance:0,end:";",illegal:/[.']/,contains:[e.inherit(e.UNDERSCORE_TITLE_MODE,{scope:"title.class"})]},{beginKeywords:"use",relevance:0,end:";",contains:[{match:/\b(as|const|function)\b/,scope:"keyword"},e.UNDERSCORE_TITLE_MODE]},b,E]}}function yi(e){const t=e.regex,n=/[\p{XID_Start}_]\p{XID_Continue}*/u,u=["and","as","assert","async","await","break","case","class","continue","def","del","elif","else","except","finally","for","from","global","if","import","in","is","lambda","lazy","match","nonlocal|10","not","or","pass","raise","return","try","while","with","yield"],o={$pattern:/[A-Za-z]\w+|__\w+__/,keyword:u,built_in:["__import__","abs","aiter","all","anext","any","ascii","bin","bool","breakpoint","bytearray","bytes","callable","chr","classmethod","compile","complex","delattr","dict","dir","divmod","enumerate","eval","exec","filter","float","format","frozendict","frozenset","getattr","globals","hasattr","hash","help","hex","id","input","int","isinstance","issubclass","iter","len","list","locals","map","max","memoryview","min","next","object","oct","open","ord","pow","print","property","range","repr","reversed","round","sentinel","set","setattr","slice","sorted","staticmethod","str","sum","super","tuple","type","vars","zip"],literal:["__debug__","Ellipsis","False","None","NotImplemented","True"],type:["Any","Callable","Coroutine","Dict","List","Literal","Generic","Optional","Sequence","Set","Tuple","Type","Union"]},s={className:"meta",begin:/^(>>>|\.\.\.) /},c={className:"subst",begin:/\{/,end:/\}/,keywords:o,illegal:/#/},l={begin:/\{\{/,relevance:0},f={className:"string",contains:[e.BACKSLASH_ESCAPE],variants:[{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?'''/,end:/'''/,contains:[e.BACKSLASH_ESCAPE,s],relevance:10},{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?"""/,end:/"""/,contains:[e.BACKSLASH_ESCAPE,s],relevance:10},{begin:/([fFtT][rR]|[rR][fFtT]|[fFtT])'''/,end:/'''/,contains:[e.BACKSLASH_ESCAPE,s,l,c]},{begin:/([fFtT][rR]|[rR][fFtT]|[fFtT])"""/,end:/"""/,contains:[e.BACKSLASH_ESCAPE,s,l,c]},{begin:/([uU]|[rR])'/,end:/'/,relevance:10},{begin:/([uU]|[rR])"/,end:/"/,relevance:10},{begin:/([bB]|[bB][rR]|[rR][bB])'/,end:/'/},{begin:/([bB]|[bB][rR]|[rR][bB])"/,end:/"/},{begin:/([fFtT][rR]|[rR][fFtT]|[fFtT])'/,end:/'/,contains:[e.BACKSLASH_ESCAPE,l,c]},{begin:/([fFtT][rR]|[rR][fFtT]|[fFtT])"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,l,c]},e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},h="[0-9](_?[0-9])*",p=`(\\b(${h}))?\\.(${h})|\\b(${h})\\.`,b=`\\b|${u.join("|")}`,E={className:"number",relevance:0,variants:[{begin:`(\\b(${h})|(${p}))[eE][+-]?(${h})[jJ]?(?=${b})`},{begin:`(${p})[jJ]?`},{begin:`\\b([1-9](_?[0-9])*|0+(_?0)*)[lLjJ]?(?=${b})`},{begin:`\\b0[bB](_?[01])+[lL]?(?=${b})`},{begin:`\\b0[oO](_?[0-7])+[lL]?(?=${b})`},{begin:`\\b0[xX](_?[0-9a-fA-F])+[lL]?(?=${b})`},{begin:`\\b(${h})[jJ](?=${b})`}]},_={className:"comment",begin:t.lookahead(/# type:/),end:/$/,keywords:o,contains:[{begin:/# type:/},{begin:/#/,end:/\b\B/,endsWithParent:!0}]},g={className:"params",variants:[{className:"",begin:/\(\s*\)/,skip:!0},{begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:o,contains:["self",s,E,f,e.HASH_COMMENT_MODE]}]};return c.contains=[f,E,s],{name:"Python",aliases:["py","gyp","ipython"],unicodeRegex:!0,keywords:o,illegal:/(<\/|\?)|=>/,contains:[s,E,{scope:"variable.language",match:/\bself\b/},{beginKeywords:"if",relevance:0},{match:/\bor\b/,scope:"keyword"},f,_,e.HASH_COMMENT_MODE,{match:[/\bdef/,/\s+/,n],scope:{1:"keyword",3:"title.function"},contains:[g]},{variants:[{match:[/\bclass/,/\s+/,n,/\s*/,/\(\s*/,n,/\s*\)/]},{match:[/\bclass/,/\s+/,n]}],scope:{1:"keyword",3:"title.class",6:"title.class.inherited"}},{className:"meta",begin:/^[\t ]*@/,end:/(?=#)|$/,contains:[E,g,f]}]}}function Ai(e){const t=e.regex,n="([a-zA-Z_]\\w*[!?=]?|[-+~]@|<<|>>|=~|===?|<=>|[<>]=?|\\*\\*|[-/+%^&*~`|]|\\[\\]=?)",u=t.either(/\b([A-Z]+[a-z0-9]+)+/,/\b([A-Z]+[a-z0-9]+)+[A-Z]+/),r=t.concat(u,/(::\w+)*/),a={"variable.constant":["__FILE__","__LINE__","__ENCODING__"],"variable.language":["self","super"],keyword:["alias","and","begin","BEGIN","break","case","class","defined","do","else","elsif","end","END","ensure","for","if","in","module","next","not","or","redo","require","rescue","retry","return","then","undef","unless","until","when","while","yield",...["include","extend","prepend","public","private","protected","raise","throw"]],built_in:["proc","lambda","attr_accessor","attr_reader","attr_writer","define_method","private_constant","module_function"],literal:["true","false","nil"]},o={className:"doctag",begin:"@[A-Za-z]+"},s={begin:"#<",end:">"},c=[e.COMMENT("#","$",{contains:[o]}),e.COMMENT("^=begin","^=end",{contains:[o],relevance:10}),e.COMMENT("^__END__",e.MATCH_NOTHING_RE)],l={className:"subst",begin:/#\{/,end:/\}/,keywords:a},f={className:"string",contains:[e.BACKSLASH_ESCAPE,l],variants:[{begin:/'/,end:/'/},{begin:/"/,end:/"/},{begin:/`/,end:/`/},{begin:/%[qQwWx]?\(/,end:/\)/},{begin:/%[qQwWx]?\[/,end:/\]/},{begin:/%[qQwWx]?\{/,end:/\}/},{begin:/%[qQwWx]?</,end:/>/},{begin:/%[qQwWx]?\//,end:/\//},{begin:/%[qQwWx]?%/,end:/%/},{begin:/%[qQwWx]?-/,end:/-/},{begin:/%[qQwWx]?\|/,end:/\|/},{begin:/\B\?(\\\d{1,3})/},{begin:/\B\?(\\x[A-Fa-f0-9]{1,2})/},{begin:/\B\?(\\u\{?[A-Fa-f0-9]{1,6}\}?)/},{begin:/\B\?(\\M-\\C-|\\M-\\c|\\c\\M-|\\M-|\\C-\\M-)[\x20-\x7e]/},{begin:/\B\?\\(c|C-)[\x20-\x7e]/},{begin:/\B\?\\?\S/},{begin:t.concat(/<<[-~]?'?/,t.lookahead(/(\w+)(?=\W)[^\n]*\n(?:[^\n]*\n)*?\s*\1\b/)),contains:[e.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,contains:[e.BACKSLASH_ESCAPE,l]})]}]},h="[1-9](_?[0-9])*|0",p="[0-9](_?[0-9])*",b={className:"number",relevance:0,variants:[{begin:`\\b(${h})(\\.(${p}))?([eE][+-]?(${p})|r)?i?\\b`},{begin:"\\b0[dD][0-9](_?[0-9])*r?i?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*r?i?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*r?i?\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*r?i?\\b"},{begin:"\\b0(_?[0-7])+r?i?\\b"}]},E={variants:[{match:/\(\)/},{className:"params",begin:/\(/,end:/(?=\))/,excludeBegin:!0,endsParent:!0,keywords:a}]},k=[f,{variants:[{match:[/class\s+/,r,/\s+<\s+/,r]},{match:[/\b(class|module)\s+/,r]}],scope:{2:"title.class",4:"title.class.inherited"},keywords:a},{match:[/(include|extend)\s+/,r],scope:{2:"title.class"},keywords:a},{relevance:0,match:[r,/\.new[. (]/],scope:{1:"title.class"}},{relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"},{relevance:0,match:u,scope:"title.class"},{match:[/def/,/\s+/,n],scope:{1:"keyword",3:"title.function"},contains:[E]},{begin:"::"},{className:"symbol",begin:e.UNDERSCORE_IDENT_RE+"(!|\\?)?:",relevance:0},{className:"symbol",begin:":(?!\\s)",contains:[f,{begin:n}],relevance:0},b,{className:"variable",begin:"(\\$\\W)|((\\$|@@?)(\\w+))(?=[^@$?])(?![A-Za-z])(?![@$?'])"},{className:"params",begin:/\|(?!=)/,end:/\|/,excludeBegin:!0,excludeEnd:!0,relevance:0,keywords:a},{begin:"("+e.RE_STARTERS_RE+"|unless)\\s*",keywords:"unless",contains:[{className:"regexp",contains:[e.BACKSLASH_ESCAPE,l],illegal:/\n/,variants:[{begin:"/",end:"/[a-z]*"},{begin:/%r\{/,end:/\}[a-z]*/},{begin:"%r\\(",end:"\\)[a-z]*"},{begin:"%r!",end:"![a-z]*"},{begin:"%r\\[",end:"\\][a-z]*"}]}].concat(s,c),relevance:0}].concat(s,c);l.contains=k,E.contains=k;const X=[{begin:/^\s*=>/,starts:{end:"$",contains:k}},{className:"meta.prompt",begin:"^("+"[>?]>"+"|"+"[\\w#]+\\(\\w+\\):\\d+:\\d+[>*]"+"|"+"(\\w+-)?\\d+\\.\\d+\\.\\d+(p\\d+)?[^\\d][^>]+>"+")(?=[ ])",starts:{end:"$",keywords:a,contains:k}}];return c.unshift(s),{name:"Ruby",aliases:["rb","gemspec","podspec","thor","irb"],keywords:a,illegal:/\/\*/,contains:[e.SHEBANG({binary:"ruby"})].concat(X).concat(c).concat(k)}}function wi(e){const t=e.regex,n=/(r#)?/,u=t.concat(n,e.UNDERSCORE_IDENT_RE),r=t.concat(n,e.IDENT_RE),i={scope:"title.function.invoke",relevance:0,begin:t.concat(/\b/,/(?!(?:let|for|while|if|else|match)\b)/,r,t.lookahead(/\s*\(/))},a="([ui](8|16|32|64|128|size)|f(16|32|64|128))?",o=["abstract","as","async","await","become","box","break","const","continue","crate","do","dyn","else","enum","extern","false","final","fn","for","if","impl","in","let","loop","macro","match","mod","move","mut","override","priv","pub","raw","ref","return","self","Self","static","struct","super","trait","true","try","type","typeof","union","unsafe","unsized","use","virtual","where","while","yield"],s=["true","false","Some","None","Ok","Err"],c=["drop ","Copy","Send","Sized","Sync","Drop","Fn","FnMut","FnOnce","ToOwned","Clone","Debug","PartialEq","PartialOrd","Eq","Ord","AsRef","AsMut","Into","From","Default","Iterator","Extend","IntoIterator","DoubleEndedIterator","ExactSizeIterator","SliceConcatExt","ToString","assert!","assert_eq!","bitflags!","bytes!","cfg!","col!","concat!","concat_idents!","debug_assert!","debug_assert_eq!","env!","eprintln!","panic!","file!","format!","format_args!","include_bytes!","include_str!","line!","local_data_key!","module_path!","option_env!","print!","println!","select!","stringify!","try!","unimplemented!","unreachable!","vec!","write!","writeln!","macro_rules!","assert_ne!","debug_assert_ne!"],l=["i8","i16","i32","i64","i128","isize","u8","u16","u32","u64","u128","usize","f16","f32","f64","f128","str","char","bool","Box","Option","Result","String","Vec"];return{name:"Rust",aliases:["rs"],keywords:{$pattern:e.IDENT_RE+"!?",type:l,keyword:o,literal:s,built_in:c},illegal:"</",contains:[e.C_LINE_COMMENT_MODE,e.COMMENT("/\\*","\\*/",{contains:["self"]}),e.inherit(e.QUOTE_STRING_MODE,{begin:/b?"/,illegal:null}),{scope:"symbol",begin:/'[a-zA-Z_][a-zA-Z0-9_]*(?!')/},{scope:"string",variants:[{begin:/b?r(#*)"(.|\n)*?"\1(?!#)/},{begin:/b?'/,end:/'/,contains:[{scope:"char.escape",match:/\\('|"|\\|\w|x\w{2}|u\w{4}|U\w{8})/}]}]},{scope:"number",variants:[{begin:"\\b0b([01_]+)"+a},{begin:"\\b0o([0-7_]+)"+a},{begin:"\\b0x([A-Fa-f0-9_]+)"+a},{begin:"\\b(\\d[\\d_]*(\\.[0-9_]+)?([eE][+-]?[0-9_]+)?)"+a}],relevance:0},{begin:[/\bsafe/,/\s+/,/extern/],scope:{1:"keyword",3:"keyword"}},{begin:[/fn/,/\s+/,u],scope:{1:"keyword",3:"title.function"}},{scope:"meta",begin:"#!?\\[",end:"\\]",contains:[{scope:"string",begin:/"/,end:/"/,contains:[e.BACKSLASH_ESCAPE]}]},{begin:[/let/,/\s+/,/(?:mut\s+)?/,u],scope:{1:"keyword",3:"keyword",4:"variable"}},{begin:[/for/,/\s+/,u,/\s+/,/in/],scope:{1:"keyword",3:"variable",5:"keyword"}},{begin:[/type/,/\s+/,u],scope:{1:"keyword",3:"title.class"}},{begin:[/(?:trait|enum|struct|union|impl|for)/,/\s+/,u],scope:{1:"keyword",3:"title.class"}},{begin:e.IDENT_RE+"::",keywords:{keyword:"Self",built_in:c,type:l}},{scope:"punctuation",begin:"->"},i]}}const Ci=e=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:e.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},UNICODE_RANGE:{scope:"number",begin:/\b[Uu]\+[0-9A-Fa-f][0-9A-Fa-f?]{0,5}(-[0-9A-Fa-f][0-9A-Fa-f]{0,5})?/},FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:e.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z_][A-Za-z0-9_-]*/}}),vi=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","optgroup","option","p","picture","q","quote","samp","section","select","source","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],Ni=["defs","g","marker","mask","pattern","svg","switch","symbol","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feFlood","feGaussianBlur","feImage","feMerge","feMorphology","feOffset","feSpecularLighting","feTile","feTurbulence","linearGradient","radialGradient","stop","circle","ellipse","image","line","path","polygon","polyline","rect","text","use","textPath","tspan","foreignObject","clipPath"],Di=[...vi,...Ni],Si=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"].sort().reverse(),Ti=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"].sort().reverse(),Oi=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),Ri=["accent-color","align-content","align-items","align-self","alignment-baseline","all","anchor-name","animation","animation-composition","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-range","animation-range-end","animation-range-start","animation-timeline","animation-timing-function","appearance","aspect-ratio","backdrop-filter","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-position-x","background-position-y","background-repeat","background-size","baseline-shift","block-size","border","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-end-end-radius","border-end-start-radius","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-start-end-radius","border-start-start-radius","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-align","box-decoration-break","box-direction","box-flex","box-flex-group","box-lines","box-ordinal-group","box-orient","box-pack","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","color-scheme","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","contain-intrinsic-block-size","contain-intrinsic-height","contain-intrinsic-inline-size","contain-intrinsic-size","contain-intrinsic-width","container","container-name","container-type","content","content-visibility","corner-bottom-left-shape","corner-bottom-right-shape","corner-shape","corner-top-left-shape","corner-top-right-shape","counter-increment","counter-reset","counter-set","cue","cue-after","cue-before","cursor","cx","cy","direction","display","dominant-baseline","empty-cells","enable-background","field-sizing","fill","fill-opacity","fill-rule","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flood-color","flood-opacity","flow","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-optical-sizing","font-palette","font-size","font-size-adjust","font-smooth","font-smoothing","font-stretch","font-style","font-synthesis","font-synthesis-position","font-synthesis-small-caps","font-synthesis-style","font-synthesis-weight","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-emoji","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","forced-color-adjust","gap","glyph-orientation-horizontal","glyph-orientation-vertical","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphenate-character","hyphenate-limit-chars","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","initial-letter","initial-letter-align","inline-size","inset","inset-area","inset-block","inset-block-end","inset-block-start","inset-inline","inset-inline-end","inset-inline-start","isolation","justify-content","justify-items","justify-self","kerning","left","letter-spacing","lighting-color","line-break","line-height","line-height-step","list-style","list-style-image","list-style-position","list-style-type","margin","margin-block","margin-block-end","margin-block-start","margin-bottom","margin-inline","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","margin-trim","marker","marker-end","marker-mid","marker-start","marks","mask","mask-border","mask-border-mode","mask-border-outset","mask-border-repeat","mask-border-slice","mask-border-source","mask-border-width","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","masonry-auto-flow","math-depth","math-shift","math-style","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","offset","offset-anchor","offset-distance","offset-path","offset-position","offset-rotate","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-anchor","overflow-block","overflow-clip-margin","overflow-inline","overflow-wrap","overflow-x","overflow-y","overlay","overscroll-behavior","overscroll-behavior-block","overscroll-behavior-inline","overscroll-behavior-x","overscroll-behavior-y","padding","padding-block","padding-block-end","padding-block-start","padding-bottom","padding-inline","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","paint-order","pause","pause-after","pause-before","perspective","perspective-origin","place-content","place-items","place-self","pointer-events","position","position-anchor","position-visibility","print-color-adjust","quotes","r","resize","rest","rest-after","rest-before","right","rotate","row-gap","ruby-align","ruby-position","scale","scroll-behavior","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-stop","scroll-snap-type","scroll-timeline","scroll-timeline-axis","scroll-timeline-name","scrollbar-color","scrollbar-gutter","scrollbar-width","shape-image-threshold","shape-margin","shape-outside","shape-rendering","speak","speak-as","src","stop-color","stop-opacity","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","tab-size","table-layout","text-align","text-align-all","text-align-last","text-anchor","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-skip-ink","text-decoration-style","text-decoration-thickness","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-size-adjust","text-transform","text-underline-offset","text-underline-position","text-wrap","text-wrap-mode","text-wrap-style","timeline-scope","top","touch-action","transform","transform-box","transform-origin","transform-style","transition","transition-behavior","transition-delay","transition-duration","transition-property","transition-timing-function","translate","unicode-bidi","unicode-range","user-modify","user-select","vector-effect","vertical-align","view-timeline","view-timeline-axis","view-timeline-inset","view-timeline-name","view-transition-name","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","white-space","white-space-collapse","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","x","y","z-index","zoom"].sort().reverse();function Mi(e){const t=Ci(e),n=Oi,u=Ti,r="@[a-z-]+",i="and or not only",o={className:"variable",begin:"(\\$"+"[a-zA-Z-][a-zA-Z0-9_-]*"+")\\b",relevance:0};return{name:"SCSS",case_insensitive:!0,illegal:"[=/|']",contains:[e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,t.CSS_NUMBER_MODE,{className:"selector-id",begin:"#[A-Za-z0-9_-]+",relevance:0},{className:"selector-class",begin:"\\.[A-Za-z0-9_-]+",relevance:0},t.ATTRIBUTE_SELECTOR_MODE,{className:"selector-tag",begin:"\\b("+Di.join("|")+")\\b",relevance:0},{className:"selector-pseudo",begin:":("+u.join("|")+")"},{className:"selector-pseudo",begin:":(:)?("+n.join("|")+")"},o,{begin:/\(/,end:/\)/,contains:[t.CSS_NUMBER_MODE]},t.CSS_VARIABLE,{className:"attribute",begin:"\\b("+Ri.join("|")+")\\b"},{begin:"\\b(whitespace|wait|w-resize|visible|vertical-text|vertical-ideographic|uppercase|upper-roman|upper-alpha|underline|transparent|top|thin|thick|text|text-top|text-bottom|tb-rl|table-header-group|table-footer-group|sw-resize|super|strict|static|square|solid|small-caps|separate|se-resize|scroll|s-resize|rtl|row-resize|ridge|right|repeat|repeat-y|repeat-x|relative|progress|pointer|overline|outside|outset|oblique|nowrap|not-allowed|normal|none|nw-resize|no-repeat|no-drop|newspaper|ne-resize|n-resize|move|middle|medium|ltr|lr-tb|lowercase|lower-roman|lower-alpha|loose|list-item|line|line-through|line-edge|lighter|left|keep-all|justify|italic|inter-word|inter-ideograph|inside|inset|inline|inline-block|inherit|inactive|ideograph-space|ideograph-parenthesis|ideograph-numeric|ideograph-alpha|horizontal|hidden|help|hand|groove|fixed|ellipsis|e-resize|double|dotted|distribute|distribute-space|distribute-letter|distribute-all-lines|disc|disabled|default|decimal|dashed|crosshair|collapse|col-resize|circle|char|center|capitalize|break-word|break-all|bottom|both|bolder|bold|block|bidi-override|below|baseline|auto|always|all-scroll|absolute|table|table-cell)\\b"},{begin:/:/,end:/[;}{]/,relevance:0,contains:[t.BLOCK_COMMENT,o,t.HEXCOLOR,t.CSS_NUMBER_MODE,t.UNICODE_RANGE,e.QUOTE_STRING_MODE,e.APOS_STRING_MODE,t.IMPORTANT,t.FUNCTION_DISPATCH]},{begin:"@(page|font-face)",keywords:{$pattern:r,keyword:"@page @font-face"}},{begin:"@",end:"[{;]",returnBegin:!0,keywords:{$pattern:/[a-z-]+/,keyword:i,attribute:Si.join(" ")},contains:[{begin:r,className:"keyword"},{begin:/[a-z-]+(?=:)/,className:"attribute"},o,e.QUOTE_STRING_MODE,e.APOS_STRING_MODE,t.HEXCOLOR,t.CSS_NUMBER_MODE]},t.FUNCTION_DISPATCH]}}function Ii(e){const t=e.regex,n=e.COMMENT("--","$"),u={scope:"string",variants:[{begin:/'/,end:/'/,contains:[{match:/''/}]}]},r={begin:/"/,end:/"/,contains:[{match:/""/}]},i=["true","false","unknown"],a=["double precision","large object","with timezone","without timezone"],o=["bigint","binary","blob","boolean","char","character","clob","date","dec","decfloat","decimal","float","int","integer","interval","nchar","nclob","national","numeric","real","row","smallint","time","timestamp","varchar","varying","varbinary"],s=["add","asc","collation","desc","final","first","last","view"],c=["abs","acos","all","allocate","alter","and","any","are","array","array_agg","array_max_cardinality","as","asensitive","asin","asymmetric","at","atan","atomic","authorization","avg","begin","begin_frame","begin_partition","between","bigint","binary","blob","boolean","both","by","call","called","cardinality","cascaded","case","cast","ceil","ceiling","char","char_length","character","character_length","check","classifier","clob","close","coalesce","collate","collect","column","commit","condition","connect","constraint","contains","convert","copy","corr","corresponding","cos","cosh","count","covar_pop","covar_samp","create","cross","cube","cume_dist","current","current_catalog","current_date","current_default_transform_group","current_path","current_role","current_row","current_schema","current_time","current_timestamp","current_path","current_role","current_transform_group_for_type","current_user","cursor","cycle","date","day","deallocate","dec","decimal","decfloat","declare","default","define","delete","dense_rank","deref","describe","deterministic","disconnect","distinct","double","drop","dynamic","each","element","else","empty","end","end_frame","end_partition","end-exec","equals","escape","every","except","exec","execute","exists","exp","external","extract","false","fetch","filter","first_value","float","floor","for","foreign","frame_row","free","from","full","function","fusion","get","global","grant","group","grouping","groups","having","hold","hour","identity","in","indicator","initial","inner","inout","insensitive","insert","int","integer","intersect","intersection","interval","into","is","join","json_array","json_arrayagg","json_exists","json_object","json_objectagg","json_query","json_table","json_table_primitive","json_value","lag","language","large","last_value","lateral","lead","leading","left","like","like_regex","listagg","ln","local","localtime","localtimestamp","log","log10","lower","match","match_number","match_recognize","matches","max","member","merge","method","min","minute","mod","modifies","module","month","multiset","national","natural","nchar","nclob","new","no","none","normalize","not","nth_value","ntile","null","nullif","numeric","octet_length","occurrences_regex","of","offset","old","omit","on","one","only","open","or","order","out","outer","over","overlaps","overlay","parameter","partition","pattern","per","percent","percent_rank","percentile_cont","percentile_disc","period","portion","position","position_regex","power","precedes","precision","prepare","primary","procedure","ptf","range","rank","reads","real","recursive","ref","references","referencing","regr_avgx","regr_avgy","regr_count","regr_intercept","regr_r2","regr_slope","regr_sxx","regr_sxy","regr_syy","release","result","return","returns","revoke","right","rollback","rollup","row","row_number","rows","running","savepoint","scope","scroll","search","second","seek","select","sensitive","session_user","set","show","similar","sin","sinh","skip","smallint","some","specific","specifictype","sql","sqlexception","sqlstate","sqlwarning","sqrt","start","static","stddev_pop","stddev_samp","submultiset","subset","substring","substring_regex","succeeds","sum","symmetric","system","system_time","system_user","table","tablesample","tan","tanh","then","time","timestamp","timezone_hour","timezone_minute","to","trailing","translate","translate_regex","translation","treat","trigger","trim","trim_array","true","truncate","uescape","union","unique","unknown","unnest","update","upper","user","using","value","values","value_of","var_pop","var_samp","varbinary","varchar","varying","versioning","when","whenever","where","width_bucket","window","with","within","without","year"],l=["abs","acos","array_agg","asin","atan","avg","cast","ceil","ceiling","coalesce","corr","cos","cosh","count","covar_pop","covar_samp","cume_dist","dense_rank","deref","element","exp","extract","first_value","floor","json_array","json_arrayagg","json_exists","json_object","json_objectagg","json_query","json_table","json_table_primitive","json_value","lag","last_value","lead","listagg","ln","log","log10","lower","max","min","mod","nth_value","ntile","nullif","percent_rank","percentile_cont","percentile_disc","position","position_regex","power","rank","regr_avgx","regr_avgy","regr_count","regr_intercept","regr_r2","regr_slope","regr_sxx","regr_sxy","regr_syy","row_number","sin","sinh","sqrt","stddev_pop","stddev_samp","substring","substring_regex","sum","tan","tanh","translate","translate_regex","treat","trim","trim_array","unnest","upper","value_of","var_pop","var_samp","width_bucket"],f=["current_catalog","current_date","current_default_transform_group","current_path","current_role","current_schema","current_transform_group_for_type","current_user","session_user","system_time","system_user","current_time","localtime","current_timestamp","localtimestamp"],h=["create table","insert into","primary key","foreign key","not null","alter table","add constraint","grouping sets","on overflow","character set","respect nulls","ignore nulls","nulls first","nulls last","depth first","breadth first"],p=l,b=[...c,...s].filter(y=>!l.includes(y)),E={scope:"variable",match:/@[a-z0-9][a-z0-9_]*/},_={scope:"operator",match:/[-+*/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?/,relevance:0},g={match:t.concat(/\b/,t.either(...p),/\s*\(/),relevance:0,keywords:{built_in:p}};function v(y){return t.concat(/\b/,t.either(...y.map(k=>k.replace(/\s+/,"\\s+"))),/\b/)}const w={scope:"keyword",match:v(h),relevance:0};function x(y,{exceptions:k,when:S}={}){const F=S;return k=k||[],y.map(z=>z.match(/\|\d+$/)||k.includes(z)?z:F(z)?`${z}|0`:z)}return{name:"SQL",case_insensitive:!0,illegal:/[{}]|<\//,keywords:{$pattern:/\b[\w\.]+/,keyword:x(b,{when:y=>y.length<3}),literal:i,type:o,built_in:f},contains:[{scope:"type",match:v(a)},w,g,E,u,r,e.C_NUMBER_MODE,e.C_BLOCK_COMMENT_MODE,n,_]}}function Zn(e){return e?typeof e=="string"?e:e.source:null}function it(e){return H("(?=",e,")")}function H(...e){return e.map(n=>Zn(n)).join("")}function Fi(e){const t=e[e.length-1];return typeof t=="object"&&t.constructor===Object?(e.splice(e.length-1,1),t):{}}function ce(...e){return"("+(Fi(e).capture?"":"?:")+e.map(u=>Zn(u)).join("|")+")"}new RegExp(ce(/\[(?:[^\\\]]|\\.)*\]/,/\(\?<(?![=!])[^>]+>/,/\(\?'[^']+'/,/\(\??/,/\\([1-9][0-9]*)/,/\\./));const Yt=e=>H(/\b/,e,/\w$/.test(e)?/\b/:/\B/),Li=["Protocol","Type"].map(Yt),Wn=["init","self"].map(Yt),Bi=["Any","Self"],Vt=["actor","any","associatedtype","async","await",/as\?/,/as!/,"as","borrowing","break","case","catch","class","consume","consuming","continue","convenience","copy","default","defer","deinit","didSet","distributed","do","dynamic","each","else","enum","extension","fallthrough",/fileprivate\(set\)/,"fileprivate","final","for","func","get","guard","if","import","indirect","infix",/init\?/,/init!/,"inout",/internal\(set\)/,"internal","in","is","isolated","nonisolated","lazy","let","macro","mutating","nonmutating",/open\(set\)/,"open","operator","optional","override","package","postfix","precedencegroup","prefix",/private\(set\)/,"private","protocol",/public\(set\)/,"public","repeat","required","rethrows","return","set","some","static","struct","subscript","super","switch","throws","throw",/try\?/,/try!/,"try","typealias",/unowned\(safe\)/,/unowned\(unsafe\)/,"unowned","var","weak","where","while","willSet"],Yn=["false","nil","true"],Pi=["assignment","associativity","higherThan","left","lowerThan","none","right"],zi=["#colorLiteral","#column","#dsohandle","#else","#elseif","#endif","#error","#file","#fileID","#fileLiteral","#filePath","#function","#if","#imageLiteral","#keyPath","#line","#selector","#sourceLocation","#warning"],Vn=["abs","all","any","assert","assertionFailure","debugPrint","dump","fatalError","getVaList","isKnownUniquelyReferenced","max","min","numericCast","pointwiseMax","pointwiseMin","precondition","preconditionFailure","print","readLine","repeatElement","sequence","stride","swap","swift_unboxFromSwiftValueWithType","transcode","type","unsafeBitCast","unsafeDowncast","withExtendedLifetime","withUnsafeMutablePointer","withUnsafePointer","withVaList","withoutActuallyEscaping","zip"],Xn=ce(/[/=\-+!*%<>&|^~?]/,/[\u00A1-\u00A7]/,/[\u00A9\u00AB]/,/[\u00AC\u00AE]/,/[\u00B0\u00B1]/,/[\u00B6\u00BB\u00BF\u00D7\u00F7]/,/[\u2016-\u2017]/,/[\u2020-\u2027]/,/[\u2030-\u203E]/,/[\u2041-\u2053]/,/[\u2055-\u205E]/,/[\u2190-\u23FF]/,/[\u2500-\u2775]/,/[\u2794-\u2BFF]/,/[\u2E00-\u2E7F]/,/[\u3001-\u3003]/,/[\u3008-\u3020]/,/[\u3030]/),Qn=ce(Xn,/[\u0300-\u036F]/,/[\u1DC0-\u1DFF]/,/[\u20D0-\u20FF]/,/[\uFE00-\uFE0F]/,/[\uFE20-\uFE2F]/),Xt=H(Xn,Qn,"*"),Jn=ce(/[a-zA-Z_]/,/[\u00A8\u00AA\u00AD\u00AF\u00B2-\u00B5\u00B7-\u00BA]/,/[\u00BC-\u00BE\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u00FF]/,/[\u0100-\u02FF\u0370-\u167F\u1681-\u180D\u180F-\u1DBF]/,/[\u1E00-\u1FFF]/,/[\u200B-\u200D\u202A-\u202E\u203F-\u2040\u2054\u2060-\u206F]/,/[\u2070-\u20CF\u2100-\u218F\u2460-\u24FF\u2776-\u2793]/,/[\u2C00-\u2DFF\u2E80-\u2FFF]/,/[\u3004-\u3007\u3021-\u302F\u3031-\u303F\u3040-\uD7FF]/,/[\uF900-\uFD3D\uFD40-\uFDCF\uFDF0-\uFE1F\uFE30-\uFE44]/,/[\uFE47-\uFEFE\uFF00-\uFFFD]/),wt=ce(Jn,/\d/,/[\u0300-\u036F\u1DC0-\u1DFF\u20D0-\u20FF\uFE20-\uFE2F]/),ke=H(Jn,wt,"*"),Ct=H(/[A-Z]/,wt,"*"),Ui=["attached","autoclosure",H(/convention\(/,ce("swift","block","c"),/\)/),"discardableResult","dynamicCallable","dynamicMemberLookup","escaping","freestanding","frozen","GKInspectable","IBAction","IBDesignable","IBInspectable","IBOutlet","IBSegueAction","inlinable","main","nonobjc","NSApplicationMain","NSCopying","NSManaged",H(/objc\(/,ke,/\)/),"objc","objcMembers","propertyWrapper","requires_stored_property_inits","resultBuilder","Sendable","testable","UIApplicationMain","unchecked","unknown","usableFromInline","warn_unqualified_access"],$i=["iOS","iOSApplicationExtension","macOS","macOSApplicationExtension","macCatalyst","macCatalystApplicationExtension","watchOS","watchOSApplicationExtension","tvOS","tvOSApplicationExtension","swift"];function qi(e){const t={match:/\s+/,relevance:0},n=e.COMMENT("/\\*","\\*/",{contains:["self"]}),u=[e.C_LINE_COMMENT_MODE,n],r={match:[/\./,ce(...Li,...Wn)],className:{2:"keyword"}},i={match:H(/\./,ce(...Vt)),relevance:0},a=Vt.filter(G=>typeof G=="string").concat(["_|0"]),o=Vt.filter(G=>typeof G!="string").concat(Bi).map(Yt),s={variants:[{className:"keyword",match:ce(...o,...Wn)}]},c={$pattern:ce(/\b\w+/,/#\w+/),keyword:a.concat(zi),literal:Yn},l=[r,i,s],f={match:H(/\./,ce(...Vn)),relevance:0},h={className:"built_in",match:H(/\b/,ce(...Vn),/(?=\()/)},p=[f,h],b={match:/->/,relevance:0},E={className:"operator",relevance:0,variants:[{match:Xt},{match:`\\.(\\.|${Qn})+`}]},_=[b,E],g="([0-9]_*)+",v="([0-9a-fA-F]_*)+",w={className:"number",relevance:0,variants:[{match:`\\b(${g})(\\.(${g}))?([eE][+-]?(${g}))?\\b`},{match:`\\b0x(${v})(\\.(${v}))?([pP][+-]?(${g}))?\\b`},{match:/\b0o([0-7]_*)+\b/},{match:/\b0b([01]_*)+\b/}]},x=(G="")=>({className:"subst",variants:[{match:H(/\\/,G,/[0\\tnr"']/)},{match:H(/\\/,G,/u\{[0-9a-fA-F]{1,8}\}/)}]}),y=(G="")=>({className:"subst",match:H(/\\/,G,/[\t ]*(?:[\r\n]|\r\n)/)}),k=(G="")=>({className:"subst",label:"interpol",begin:H(/\\/,G,/\(/),end:/\)/}),S=(G="")=>({begin:H(G,/"""/),end:H(/"""/,G),contains:[x(G),y(G),k(G)]}),F=(G="")=>({begin:H(G,/"/),end:H(/"/,G),contains:[x(G),k(G)]}),z={className:"string",variants:[S(),S("#"),S("##"),S("###"),F(),F("#"),F("##"),F("###")]},X=[e.BACKSLASH_ESCAPE,{begin:/\[/,end:/\]/,relevance:0,contains:[e.BACKSLASH_ESCAPE]}],ee={begin:/\/[^\s](?=[^/\n]*\/)/,end:/\//,contains:X},pe=G=>{const et=H(G,/\//),ze=H(/\//,G);return{begin:et,end:ze,contains:[...X,{scope:"comment",begin:`#(?!.*${ze})`,end:/$/}]}},ge={scope:"regexp",variants:[pe("###"),pe("##"),pe("#"),ee]},V={match:H(/`/,ke,/`/)},Z={className:"variable",match:/\$\d+/},ie={className:"variable",match:`\\$${wt}+`},Se=[V,Z,ie],$={match:/(@|#(un)?)available/,scope:"keyword",starts:{contains:[{begin:/\(/,end:/\)/,keywords:$i,contains:[..._,w,z]}]}},ae={scope:"keyword",match:H(/@/,ce(...Ui),it(ce(/\(/,/\s+/)))},fe={scope:"meta",match:H(/@/,ke)},le=[$,ae,fe],oe={match:it(/\b[A-Z]/),relevance:0,contains:[{className:"type",match:H(/(AV|CA|CF|CG|CI|CL|CM|CN|CT|MK|MP|MTK|MTL|NS|SCN|SK|UI|WK|XC)/,wt,"+")},{className:"type",match:Ct,relevance:0},{match:/[?!]+/,relevance:0},{match:/\.\.\./,relevance:0},{match:H(/\s+&\s+/,it(Ct)),relevance:0}]},Te={begin:/</,end:/>/,keywords:c,contains:[...u,...l,...le,b,oe]};oe.contains.push(Te);const _n={match:H(ke,/\s*:/),keywords:"_|0",relevance:0},Bt={begin:/\(/,end:/\)/,relevance:0,keywords:c,contains:["self",_n,...u,ge,...l,...p,..._,w,z,...Se,...le,oe]},ht={begin:/</,end:/>/,keywords:"repeat each",contains:[...u,oe]},En={begin:ce(it(H(ke,/\s*:/)),it(H(ke,/\s+/,ke,/\s*:/))),end:/:/,relevance:0,contains:[{className:"keyword",match:/\b_\b/},{className:"params",match:ke}]},Pt={begin:/\(/,end:/\)/,keywords:c,contains:[En,...u,...l,..._,w,z,...le,oe,Bt],endsParent:!0,illegal:/["']/},ir={match:[/(func|macro)/,/\s+/,ce(V.match,ke,Xt)],className:{1:"keyword",3:"title.function"},contains:[ht,Pt,t],illegal:[/\[/,/%/]},je={match:[/\b(?:subscript|init[?!]?)/,/\s*(?=[<(])/],className:{1:"keyword"},contains:[ht,Pt,t],illegal:/\[|%/},xn={match:[/operator/,/\s+/,Xt],className:{1:"keyword",3:"title"}},kn={begin:[/precedencegroup/,/\s+/,Ct],className:{1:"keyword",3:"title"},contains:[oe],keywords:[...Pi,...Yn],end:/}/},yn={match:[/class\b/,/\s+/,/func\b/,/\s+/,/\b[A-Za-z_][A-Za-z0-9_]*\b/],scope:{1:"keyword",3:"keyword",5:"title.function"}},An={match:[/class\b/,/\s+/,/var\b/],scope:{1:"keyword",3:"keyword"}},wn={begin:[/(struct|protocol|class|extension|enum|actor)/,/\s+/,ke,/\s*/],beginScope:{1:"keyword",3:"title.class"},keywords:c,contains:[ht,...l,{begin:/:/,end:/\{/,keywords:c,contains:[{scope:"title.class.inherited",match:Ct},...l],relevance:0}]};for(const G of z.variants){const et=G.contains.find(Cn=>Cn.label==="interpol");et.keywords=c;const ze=[...l,...p,..._,w,z,...Se];et.contains=[...ze,{begin:/\(/,end:/\)/,contains:["self",...ze]}]}return{name:"Swift",keywords:c,contains:[...u,ir,je,yn,An,wn,xn,kn,{beginKeywords:"import",end:/$/,contains:[...u],relevance:0},ge,...l,...p,..._,w,z,...Se,...le,oe,Bt]}}const vt="[A-Za-z$_][0-9A-Za-z$_]*",jn=["as","in","of","if","for","while","finally","var","new","function","do","return","void","else","break","catch","instanceof","with","throw","case","default","try","switch","continue","typeof","delete","let","yield","const","class","debugger","async","await","static","import","from","export","extends","using"],eu=["true","false","null","undefined","NaN","Infinity"],tu=["Object","Function","Boolean","Symbol","Math","Date","Number","BigInt","String","RegExp","Array","Float32Array","Float64Array","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Int32Array","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array","Set","Map","WeakSet","WeakMap","ArrayBuffer","SharedArrayBuffer","Atomics","DataView","JSON","Promise","Generator","GeneratorFunction","AsyncFunction","Reflect","Proxy","Intl","WebAssembly"],nu=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],uu=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],ru=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","self","global"],iu=[].concat(uu,tu,nu);function Hi(e){const t=e.regex,n=($,{after:ae})=>{const fe="</"+$[0].slice(1);return $.input.indexOf(fe,ae)!==-1},u=vt,r={begin:"<>",end:"</>"},i=/<[A-Za-z0-9\\._:-]+\s*\/>/,a={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:($,ae)=>{const fe=$[0].length+$.index,le=$.input[fe];if(le==="<"||le===","){ae.ignoreMatch();return}le===">"&&(n($,{after:fe})||ae.ignoreMatch());let oe;const Te=$.input.substring(fe);if(oe=Te.match(/^\s*=/)){ae.ignoreMatch();return}if((oe=Te.match(/^\s+extends\s+/))&&oe.index===0){ae.ignoreMatch();return}}},o={$pattern:vt,keyword:jn,literal:eu,built_in:iu,"variable.language":ru},s="[0-9](_?[0-9])*",c=`\\.(${s})`,l="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",f={className:"number",variants:[{begin:`(\\b(${l})((${c})|\\.)?|(${c}))[eE][+-]?(${s})\\b`},{begin:`\\b(${l})\\b((${c})\\b|\\.)?|(${c})\\b`},{begin:"\\b(0|[1-9](_?[0-9])*)n\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*n?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*n?\\b"},{begin:"\\b0[0-7]+n?\\b"}],relevance:0},h={className:"subst",begin:"\\$\\{",end:"\\}",keywords:o,contains:[]},p={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,h],subLanguage:"xml"}},b={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,h],subLanguage:"css"}},E={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,h],subLanguage:"graphql"}},_={className:"string",begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE,h]},v={className:"comment",variants:[e.COMMENT(/\/\*\*(?!\/)/,"\\*/",{relevance:0,contains:[{begin:"(?=@[A-Za-z]+)",relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"},{className:"type",begin:"\\{",end:"\\}",excludeEnd:!0,excludeBegin:!0,relevance:0},{className:"variable",begin:u+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),e.C_BLOCK_COMMENT_MODE,e.C_LINE_COMMENT_MODE]},w=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,p,b,E,_,{match:/\$\d+/},f];h.contains=w.concat({begin:/\{/,end:/\}/,keywords:o,contains:["self"].concat(w)});const x=[].concat(v,h.contains),y=x.concat([{begin:/(\s*)\(/,end:/\)/,keywords:o,contains:["self"].concat(x)}]),k={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:o,contains:y},S={variants:[{match:[/class/,/\s+/,u,/\s+/,/extends/,/\s+/,t.concat(u,"(",t.concat(/\./,u),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,u],scope:{1:"keyword",3:"title.class"}}]},F={relevance:0,match:t.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:"title.class",keywords:{_:[...tu,...nu]}},z={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},X={variants:[{match:[/function/,/\s+/,u,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[k],illegal:/%/},ee={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function pe($){return t.concat("(?!",$.join("|"),")")}const ge={match:t.concat(/\b/,pe([...uu,"super","import","await"].map($=>`${$}\\s*\\(`)),u,t.lookahead(/\s*\(/)),className:"title.function",relevance:0},V={begin:t.concat(/\./,t.lookahead(t.concat(u,/(?![0-9A-Za-z$_(])/))),end:u,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},Z={match:[/get|set/,/\s+/,u,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},k]},ie="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+e.UNDERSCORE_IDENT_RE+")\\s*=>",Se={match:[/const|var|let/,/\s+/,u,/\s*/,/=\s*/,/(async\s*)?/,t.lookahead(ie)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[k]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:o,exports:{PARAMS_CONTAINS:y,CLASS_REFERENCE:F},illegal:/#(?![$_A-Za-z])/,contains:[e.SHEBANG({label:"shebang",binary:"node",relevance:5}),z,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,p,b,E,_,v,{match:/\$\d+/},f,F,{scope:"attr",match:u+t.lookahead(":"),relevance:0},Se,{begin:"("+e.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[v,e.REGEXP_MODE,{className:"function",begin:ie,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:e.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:o,contains:y}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:r.begin,end:r.end},{match:i},{begin:a.begin,"on:begin":a.isTrulyOpeningTag,end:a.end}],subLanguage:"xml",contains:[{begin:a.begin,end:a.end,skip:!0,contains:["self"]}]}]},X,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+e.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[k,e.inherit(e.TITLE_MODE,{begin:u,className:"title.function"})]},{match:/\.\.\./,relevance:0},V,{match:"\\$"+u,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[k]},ge,ee,S,Z,{match:/\$[(.]/}]}}function Gi(e){const t=e.regex,n=Hi(e),u=vt,r=["any","void","number","boolean","string","object","never","symbol","bigint","unknown"],i={begin:[/namespace/,/\s+/,e.IDENT_RE],beginScope:{1:"keyword",3:"title.class"}},a={beginKeywords:"interface",end:/\{/,excludeEnd:!0,keywords:{keyword:"interface extends",built_in:r},contains:[n.exports.CLASS_REFERENCE]},o={className:"meta",relevance:10,begin:/^\s*['"]use strict['"]/},s=["type","interface","public","private","protected","implements","declare","abstract","readonly","enum","override","satisfies"],c={$pattern:vt,keyword:jn.concat(s),literal:eu,built_in:iu.concat(r),"variable.language":ru},l={className:"meta",begin:"@"+u},f=(E,_,g)=>{const v=E.contains.findIndex(w=>w.label===_);if(v===-1)throw new Error("can not find mode to replace");E.contains.splice(v,1,g)};Object.assign(n.keywords,c),n.exports.PARAMS_CONTAINS.push(l);const h=n.contains.find(E=>E.scope==="attr"),p=Object.assign({},h,{match:t.concat(u,t.lookahead(/\s*\?:/))});n.exports.PARAMS_CONTAINS.push([n.exports.CLASS_REFERENCE,h,p]),n.contains=n.contains.concat([l,i,a,p]),f(n,"shebang",e.SHEBANG()),f(n,"use_strict",o);const b=n.contains.find(E=>E.label==="func.def");return b.relevance=0,Object.assign(n,{name:"TypeScript",aliases:["ts","tsx","mts","cts"]}),n}function Ki(e){const t=e.regex,n=t.concat(/[\p{L}_]/u,t.optional(/[\p{L}0-9_.-]*:/u),/[\p{L}0-9_.-]*/u),u=/[\p{L}0-9._:-]+/u,r={className:"symbol",begin:/&[a-z]+;|&#[0-9]+;|&#x[a-f0-9]+;/},i={begin:/\s/,contains:[{className:"keyword",begin:/#?[a-z_][a-z1-9_-]+/,illegal:/\n/}]},a=e.inherit(i,{begin:/\(/,end:/\)/}),o=e.inherit(e.APOS_STRING_MODE,{className:"string"}),s=e.inherit(e.QUOTE_STRING_MODE,{className:"string"}),c={endsWithParent:!0,illegal:/</,relevance:0,contains:[{className:"attr",begin:u,relevance:0},{begin:/=\s*/,relevance:0,contains:[{className:"string",endsParent:!0,variants:[{begin:/"/,end:/"/,contains:[r]},{begin:/'/,end:/'/,contains:[r]},{begin:/[^\s"'=<>`]+/}]}]}]};return{name:"HTML, XML",aliases:["html","xhtml","rss","atom","xjb","xsd","xsl","plist","wsf","svg"],case_insensitive:!0,unicodeRegex:!0,contains:[{className:"meta",begin:/<![a-z]/,end:/>/,relevance:10,contains:[i,s,o,a,{begin:/\[/,end:/\]/,contains:[{className:"meta",begin:/<![a-z]/,end:/>/,contains:[i,a,s,o]}]}]},e.COMMENT(/<!--/,/-->/,{relevance:10}),{begin:/<!\[CDATA\[/,end:/\]\]>/,relevance:10},r,{className:"meta",end:/\?>/,variants:[{begin:/<\?xml/,relevance:10,contains:[s]},{begin:/<\?[a-z][a-z0-9]+/}]},{className:"tag",begin:/<style(?=\s|>)/,end:/>/,keywords:{name:"style"},contains:[c],starts:{end:/<\/style>/,returnEnd:!0,subLanguage:"css"}},{className:"tag",begin:/<script(?=\s|>)/,end:/>/,keywords:{name:"script"},contains:[c],starts:{end:/<\/script>/,returnEnd:!0,subLanguage:"javascript"}},{className:"tag",begin:/<>|<\/>/},{className:"tag",begin:t.concat(/</,t.lookahead(t.concat(n,t.either(/\/>/,/>/,/\s/)))),end:/\/?>/,contains:[{className:"name",begin:n,relevance:0,starts:c}]},{className:"tag",begin:t.concat(/<\//,t.lookahead(t.concat(n,/>/))),contains:[{className:"name",begin:n,relevance:0},{begin:/>/,relevance:0,endsParent:!0}]}]}}function Zi(e){const t="true false yes no null",n="[\\w#;/?:@&=+$,.~*'()[\\]]+",u={className:"attr",variants:[{begin:/[\w*@][\w*@ :()\./-]*:(?=[ \t]|$)/},{begin:/"[\w*@][\w*@ :()\./-]*":(?=[ \t]|$)/},{begin:/'[\w*@][\w*@ :()\./-]*':(?=[ \t]|$)/}]},r={className:"template-variable",variants:[{begin:/\{\{/,end:/\}\}/},{begin:/%\{/,end:/\}/}]},i={className:"string",relevance:0,begin:/'/,end:/'/,contains:[{match:/''/,scope:"char.escape",relevance:0}]},a={className:"string",relevance:0,variants:[{begin:/"/,end:/"/},{begin:/\S+/}],contains:[e.BACKSLASH_ESCAPE,r]},o=e.inherit(a,{variants:[{begin:/'/,end:/'/,contains:[{begin:/''/,relevance:0}]},{begin:/"/,end:/"/},{begin:/[^\s,{}[\]]+/}]}),h={className:"number",begin:"\\b"+"[0-9]{4}(-[0-9][0-9]){0,2}"+"([Tt \\t][0-9][0-9]?(:[0-9][0-9]){2})?"+"(\\.[0-9]*)?"+"([ \\t])*(Z|[-+][0-9][0-9]?(:[0-9][0-9])?)?"+"\\b"},p={end:",",endsWithParent:!0,excludeEnd:!0,keywords:t,relevance:0},b={begin:/\{/,end:/\}/,contains:[p],illegal:"\\n",relevance:0},E={begin:"\\[",end:"\\]",contains:[p],illegal:"\\n",relevance:0},_=[u,{className:"meta",begin:"^---\\s*$",relevance:10},{className:"string",begin:"[\\|>]([1-9]?[+-])?[ ]*\\n( +)[^ ][^\\n]*\\n(\\2[^\\n]+\\n?)*"},{begin:"<%[%=-]?",end:"[%-]?%>",subLanguage:"ruby",excludeBegin:!0,excludeEnd:!0,relevance:0},{className:"type",begin:"!\\w+!"+n},{className:"type",begin:"!<"+n+">"},{className:"type",begin:"!"+n},{className:"type",begin:"!!"+n},{className:"meta",begin:"&"+e.UNDERSCORE_IDENT_RE+"$"},{className:"meta",begin:"\\*"+e.UNDERSCORE_IDENT_RE+"$"},{className:"bullet",begin:"-(?=[ ]|$)",relevance:0},e.HASH_COMMENT_MODE,{beginKeywords:t,keywords:{literal:t}},h,{className:"number",begin:e.C_NUMBER_RE+"\\b",relevance:0},b,E,i,a],g=[..._];return g.pop(),g.push(o),p.contains=g,{name:"YAML",case_insensitive:!0,aliases:["yml"],contains:_}}const Wi={bash:Lr,c:Br,cpp:Pr,csharp:zr,css:Yr,diff:Vr,dockerfile:Xr,go:Qr,ini:Jr,java:jr,javascript:ri,json:ai,kotlin:si,less:gi,lua:mi,makefile:_i,markdown:Ei,perl:xi,php:ki,python:yi,ruby:Ai,rust:wi,scss:Mi,sql:Ii,swift:qi,typescript:Gi,xml:Ki,yaml:Zi};for(const[e,t]of Object.entries(Wi))Bn.registerLanguage(e,t);const Yi={js:"javascript",mjs:"javascript",cjs:"javascript",jsx:"javascript",ts:"typescript",tsx:"typescript",mts:"typescript",cts:"typescript",json:"json",jsonc:"json",json5:"json",map:"json",html:"xml",htm:"xml",xml:"xml",svg:"xml",plist:"xml",vue:"xml",css:"css",scss:"scss",less:"less",md:"markdown",markdown:"markdown",py:"python",rb:"ruby",rs:"rust",go:"go",java:"java",kt:"kotlin",swift:"swift",c:"c",h:"c",cc:"cpp",cpp:"cpp",cxx:"cpp",hpp:"cpp",cs:"csharp",sh:"bash",bash:"bash",zsh:"bash",bats:"bash",yml:"yaml",yaml:"yaml",toml:"ini",ini:"ini",conf:"ini",cfg:"ini",env:"ini",sql:"sql",php:"php",lua:"lua",pl:"perl",diff:"diff",patch:"diff"},au={dockerfile:"dockerfile",makefile:"makefile",gnumakefile:"makefile",".bashrc":"bash",".zshrc":"bash",".profile":"bash",".gitconfig":"ini"};function Vi(e){const t=e.slice(e.lastIndexOf("/")+1).toLowerCase();if(au[t])return au[t];const n=t.lastIndexOf(".");return n<0?null:Yi[t.slice(n+1)]??null}function ou(e,t){return Bn.highlight(e,{language:t,ignoreIllegals:!0}).value}const Xi={png:"image/png",jpg:"image/jpeg",jpeg:"image/jpeg",gif:"image/gif",webp:"image/webp",bmp:"image/bmp",ico:"image/x-icon",avif:"image/avif",svg:"image/svg+xml"};function su(e){const t=e.lastIndexOf(".");return t<0?null:Xi[e.slice(t+1).toLowerCase()]??null}function cu(e){return/\.(md|markdown)$/i.test(e)}function Qi(e){const t=[],n=[];let u="";const r=/<span[^>]*>|<\/span>|\n|[^<\n]+|</g;let i;for(;i=r.exec(e);){const a=i[0];a===`
- `?(t.push(u+"</span>".repeat(n.length)),u=n.join("")):a.startsWith("<span")?(n.push(a),u+=a):(a==="</span>"&&n.pop(),u+=a)}return t.push(u+"</span>".repeat(n.length)),t}function Ji(e){const t=Math.min(e.length,8e3);for(let n=0;n<t;n++)if(e[n]===0)return!0;return!1}class ji{constructor(){this.decoder=new TextDecoder("utf-8"),this.rest=""}push(t,n){const r=(this.rest+this.decoder.decode(t,{stream:!n})).split(`
- `);return this.rest=n?"":r.pop(),n&&r.length&&r[r.length-1]===""&&r.pop(),r.map(i=>i.endsWith("\r")?i.slice(0,-1):i)}}const lu={};function ea(e){let t=lu[e];if(t)return t;t=lu[e]=[];for(let n=0;n<128;n++){const u=String.fromCharCode(n);t.push(u)}for(let n=0;n<e.length;n++){const u=e.charCodeAt(n);t[u]="%"+("0"+u.toString(16).toUpperCase()).slice(-2)}return t}function Ve(e,t){typeof t!="string"&&(t=Ve.defaultChars);const n=ea(t);return e.replace(/(%[a-f0-9]{2})+/gi,function(u){let r="";for(let i=0,a=u.length;i<a;i+=3){const o=parseInt(u.slice(i+1,i+3),16);if(o<128){r+=n[o];continue}if((o&224)===192&&i+3<a){const s=parseInt(u.slice(i+4,i+6),16);if((s&192)===128){const c=o<<6&1984|s&63;c<128?r+="��":r+=String.fromCharCode(c),i+=3;continue}}if((o&240)===224&&i+6<a){const s=parseInt(u.slice(i+4,i+6),16),c=parseInt(u.slice(i+7,i+9),16);if((s&192)===128&&(c&192)===128){const l=o<<12&61440|s<<6&4032|c&63;l<2048||l>=55296&&l<=57343?r+="���":r+=String.fromCharCode(l),i+=6;continue}}if((o&248)===240&&i+9<a){const s=parseInt(u.slice(i+4,i+6),16),c=parseInt(u.slice(i+7,i+9),16),l=parseInt(u.slice(i+10,i+12),16);if((s&192)===128&&(c&192)===128&&(l&192)===128){let f=o<<18&1835008|s<<12&258048|c<<6&4032|l&63;f<65536||f>1114111?r+="����":(f-=65536,r+=String.fromCharCode(55296+(f>>10),56320+(f&1023))),i+=9;continue}}r+="�"}return r})}Ve.defaultChars=";/?:@&=+$,#",Ve.componentChars="";const du={};function ta(e){let t=du[e];if(t)return t;t=du[e]=[];for(let n=0;n<128;n++){const u=String.fromCharCode(n);/^[0-9a-z]$/i.test(u)?t.push(u):t.push("%"+("0"+n.toString(16).toUpperCase()).slice(-2))}for(let n=0;n<e.length;n++)t[e.charCodeAt(n)]=e[n];return t}function at(e,t,n){typeof t!="string"&&(n=t,t=at.defaultChars),typeof n>"u"&&(n=!0);const u=ta(t);let r="";for(let i=0,a=e.length;i<a;i++){const o=e.charCodeAt(i);if(n&&o===37&&i+2<a&&/^[0-9a-f]{2}$/i.test(e.slice(i+1,i+3))){r+=e.slice(i,i+3),i+=2;continue}if(o<128){r+=u[o];continue}if(o>=55296&&o<=57343){if(o>=55296&&o<=56319&&i+1<a){const s=e.charCodeAt(i+1);if(s>=56320&&s<=57343){r+=encodeURIComponent(e[i]+e[i+1]),i++;continue}}r+="%EF%BF%BD";continue}r+=encodeURIComponent(e[i])}return r}at.defaultChars=";/?:@&=+$,-_.!~*'()#",at.componentChars="-_.!~*'()";function Qt(e){let t="";return t+=e.protocol||"",t+=e.slashes?"//":"",t+=e.auth?e.auth+"@":"",e.hostname&&e.hostname.indexOf(":")!==-1?t+="["+e.hostname+"]":t+=e.hostname||"",t+=e.port?":"+e.port:"",t+=e.pathname||"",t+=e.search||"",t+=e.hash||"",t}function Nt(){this.protocol=null,this.slashes=null,this.auth=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.pathname=null}const na=/^([a-z0-9.+-]+:)/i,ua=/:[0-9]*$/,ra=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,ia=["<",">",'"',"`"," ","\r",`
- `," "],aa=["{","}","|","\\","^","`"].concat(ia),oa=["'"].concat(aa),fu=["%","/","?",";","#"].concat(oa),bu=["/","?","#"],sa=255,pu=/^[+a-z0-9A-Z_-]{0,63}$/,ca=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,hu={javascript:!0,"javascript:":!0},gu={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0};function Jt(e,t){if(e&&e instanceof Nt)return e;const n=new Nt;return n.parse(e,t),n}Nt.prototype.parse=function(e,t){let n,u,r,i=e;if(i=i.trim(),!t&&e.split("#").length===1){const c=ra.exec(i);if(c)return this.pathname=c[1],c[2]&&(this.search=c[2]),this}let a=na.exec(i);if(a&&(a=a[0],n=a.toLowerCase(),this.protocol=a,i=i.substr(a.length)),(t||a||i.match(/^\/\/[^@\/]+@[^@\/]+/))&&(r=i.substr(0,2)==="//",r&&!(a&&hu[a])&&(i=i.substr(2),this.slashes=!0)),!hu[a]&&(r||a&&!gu[a])){let c=-1;for(let b=0;b<bu.length;b++)u=i.indexOf(bu[b]),u!==-1&&(c===-1||u<c)&&(c=u);let l,f;c===-1?f=i.lastIndexOf("@"):f=i.lastIndexOf("@",c),f!==-1&&(l=i.slice(0,f),i=i.slice(f+1),this.auth=l),c=-1;for(let b=0;b<fu.length;b++)u=i.indexOf(fu[b]),u!==-1&&(c===-1||u<c)&&(c=u);c===-1&&(c=i.length),i[c-1]===":"&&c--;const h=i.slice(0,c);i=i.slice(c),this.parseHost(h),this.hostname=this.hostname||"";const p=this.hostname[0]==="["&&this.hostname[this.hostname.length-1]==="]";if(!p){const b=this.hostname.split(/\./);for(let E=0,_=b.length;E<_;E++){const g=b[E];if(g&&!g.match(pu)){let v="";for(let w=0,x=g.length;w<x;w++)g.charCodeAt(w)>127?v+="x":v+=g[w];if(!v.match(pu)){const w=b.slice(0,E),x=b.slice(E+1),y=g.match(ca);y&&(w.push(y[1]),x.unshift(y[2])),x.length&&(i=x.join(".")+i),this.hostname=w.join(".");break}}}}this.hostname.length>sa&&(this.hostname=""),p&&(this.hostname=this.hostname.substr(1,this.hostname.length-2))}const o=i.indexOf("#");o!==-1&&(this.hash=i.substr(o),i=i.slice(0,o));const s=i.indexOf("?");return s!==-1&&(this.search=i.substr(s),i=i.slice(0,s)),i&&(this.pathname=i),gu[n]&&this.hostname&&!this.pathname&&(this.pathname=""),this},Nt.prototype.parseHost=function(e){let t=ua.exec(e);t&&(t=t[0],t!==":"&&(this.port=t.substr(1)),e=e.substr(0,e.length-t.length)),e&&(this.hostname=e)};const la=Object.freeze(Object.defineProperty({__proto__:null,decode:Ve,encode:at,format:Qt,parse:Jt},Symbol.toStringTag,{value:"Module"})),mu=/[\0-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,_u=/[\0-\x1F\x7F-\x9F]/,da=/[\xAD\u0600-\u0605\u061C\u06DD\u070F\u0890\u0891\u08E2\u180E\u200B-\u200F\u202A-\u202E\u2060-\u2064\u2066-\u206F\uFEFF\uFFF9-\uFFFB]|\uD804[\uDCBD\uDCCD]|\uD80D[\uDC30-\uDC3F]|\uD82F[\uDCA0-\uDCA3]|\uD834[\uDD73-\uDD7A]|\uDB40[\uDC01\uDC20-\uDC7F]/,jt=/[!-#%-\*,-\/:;\?@\[-\]_\{\}\xA1\xA7\xAB\xB6\xB7\xBB\xBF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061D-\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u09FD\u0A76\u0AF0\u0C77\u0C84\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1B7D\u1B7E\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E4F\u2E52-\u2E5D\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]|\uD800[\uDD00-\uDD02\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD803[\uDEAD\uDF55-\uDF59\uDF86-\uDF89]|\uD804[\uDC47-\uDC4D\uDCBB\uDCBC\uDCBE-\uDCC1\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC8\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9]|\uD805[\uDC4B-\uDC4F\uDC5A\uDC5B\uDC5D\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDE60-\uDE6C\uDEB9\uDF3C-\uDF3E]|\uD806[\uDC3B\uDD44-\uDD46\uDDE2\uDE3F-\uDE46\uDE9A-\uDE9C\uDE9E-\uDEA2\uDF00-\uDF09]|\uD807[\uDC41-\uDC45\uDC70\uDC71\uDEF7\uDEF8\uDF43-\uDF4F\uDFFF]|\uD809[\uDC70-\uDC74]|\uD80B[\uDFF1\uDFF2]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3B\uDF44]|\uD81B[\uDE97-\uDE9A\uDFE2]|\uD82F\uDC9F|\uD836[\uDE87-\uDE8B]|\uD83A[\uDD5E\uDD5F]/,Eu=/[\$\+<->\^`\|~\xA2-\xA6\xA8\xA9\xAC\xAE-\xB1\xB4\xB8\xD7\xF7\u02C2-\u02C5\u02D2-\u02DF\u02E5-\u02EB\u02ED\u02EF-\u02FF\u0375\u0384\u0385\u03F6\u0482\u058D-\u058F\u0606-\u0608\u060B\u060E\u060F\u06DE\u06E9\u06FD\u06FE\u07F6\u07FE\u07FF\u0888\u09F2\u09F3\u09FA\u09FB\u0AF1\u0B70\u0BF3-\u0BFA\u0C7F\u0D4F\u0D79\u0E3F\u0F01-\u0F03\u0F13\u0F15-\u0F17\u0F1A-\u0F1F\u0F34\u0F36\u0F38\u0FBE-\u0FC5\u0FC7-\u0FCC\u0FCE\u0FCF\u0FD5-\u0FD8\u109E\u109F\u1390-\u1399\u166D\u17DB\u1940\u19DE-\u19FF\u1B61-\u1B6A\u1B74-\u1B7C\u1FBD\u1FBF-\u1FC1\u1FCD-\u1FCF\u1FDD-\u1FDF\u1FED-\u1FEF\u1FFD\u1FFE\u2044\u2052\u207A-\u207C\u208A-\u208C\u20A0-\u20C0\u2100\u2101\u2103-\u2106\u2108\u2109\u2114\u2116-\u2118\u211E-\u2123\u2125\u2127\u2129\u212E\u213A\u213B\u2140-\u2144\u214A-\u214D\u214F\u218A\u218B\u2190-\u2307\u230C-\u2328\u232B-\u2426\u2440-\u244A\u249C-\u24E9\u2500-\u2767\u2794-\u27C4\u27C7-\u27E5\u27F0-\u2982\u2999-\u29D7\u29DC-\u29FB\u29FE-\u2B73\u2B76-\u2B95\u2B97-\u2BFF\u2CE5-\u2CEA\u2E50\u2E51\u2E80-\u2E99\u2E9B-\u2EF3\u2F00-\u2FD5\u2FF0-\u2FFF\u3004\u3012\u3013\u3020\u3036\u3037\u303E\u303F\u309B\u309C\u3190\u3191\u3196-\u319F\u31C0-\u31E3\u31EF\u3200-\u321E\u322A-\u3247\u3250\u3260-\u327F\u328A-\u32B0\u32C0-\u33FF\u4DC0-\u4DFF\uA490-\uA4C6\uA700-\uA716\uA720\uA721\uA789\uA78A\uA828-\uA82B\uA836-\uA839\uAA77-\uAA79\uAB5B\uAB6A\uAB6B\uFB29\uFBB2-\uFBC2\uFD40-\uFD4F\uFDCF\uFDFC-\uFDFF\uFE62\uFE64-\uFE66\uFE69\uFF04\uFF0B\uFF1C-\uFF1E\uFF3E\uFF40\uFF5C\uFF5E\uFFE0-\uFFE6\uFFE8-\uFFEE\uFFFC\uFFFD]|\uD800[\uDD37-\uDD3F\uDD79-\uDD89\uDD8C-\uDD8E\uDD90-\uDD9C\uDDA0\uDDD0-\uDDFC]|\uD802[\uDC77\uDC78\uDEC8]|\uD805\uDF3F|\uD807[\uDFD5-\uDFF1]|\uD81A[\uDF3C-\uDF3F\uDF45]|\uD82F\uDC9C|\uD833[\uDF50-\uDFC3]|\uD834[\uDC00-\uDCF5\uDD00-\uDD26\uDD29-\uDD64\uDD6A-\uDD6C\uDD83\uDD84\uDD8C-\uDDA9\uDDAE-\uDDEA\uDE00-\uDE41\uDE45\uDF00-\uDF56]|\uD835[\uDEC1\uDEDB\uDEFB\uDF15\uDF35\uDF4F\uDF6F\uDF89\uDFA9\uDFC3]|\uD836[\uDC00-\uDDFF\uDE37-\uDE3A\uDE6D-\uDE74\uDE76-\uDE83\uDE85\uDE86]|\uD838[\uDD4F\uDEFF]|\uD83B[\uDCAC\uDCB0\uDD2E\uDEF0\uDEF1]|\uD83C[\uDC00-\uDC2B\uDC30-\uDC93\uDCA0-\uDCAE\uDCB1-\uDCBF\uDCC1-\uDCCF\uDCD1-\uDCF5\uDD0D-\uDDAD\uDDE6-\uDE02\uDE10-\uDE3B\uDE40-\uDE48\uDE50\uDE51\uDE60-\uDE65\uDF00-\uDFFF]|\uD83D[\uDC00-\uDED7\uDEDC-\uDEEC\uDEF0-\uDEFC\uDF00-\uDF76\uDF7B-\uDFD9\uDFE0-\uDFEB\uDFF0]|\uD83E[\uDC00-\uDC0B\uDC10-\uDC47\uDC50-\uDC59\uDC60-\uDC87\uDC90-\uDCAD\uDCB0\uDCB1\uDD00-\uDE53\uDE60-\uDE6D\uDE70-\uDE7C\uDE80-\uDE88\uDE90-\uDEBD\uDEBF-\uDEC5\uDECE-\uDEDB\uDEE0-\uDEE8\uDEF0-\uDEF8\uDF00-\uDF92\uDF94-\uDFCA]/,xu=/[ \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000]/,fa=Object.freeze(Object.defineProperty({__proto__:null,Any:mu,Cc:_u,Cf:da,P:jt,S:Eu,Z:xu},Symbol.toStringTag,{value:"Module"})),ba=new Uint16Array('ᵁ<Õıʊҝջאٵ۞ޢߖࠏઑඡ༉༦ረዡᐕᒝᓃᓟᔥ\0\0\0\0\0\0ᕫᛍᦍᰒᷝ↰⊍⏀⏻⑂⠤⤒ⴈ⹈⿎〖㊺㘹㞬㣾㨨㩱㫠㬮ࠀEMabcfglmnoprstu\\bfms¦³¹ÈÏlig耻Æ䃆P耻&䀦cute耻Á䃁reve;䄂Āiyx}rc耻Â䃂;䐐r;쀀𝔄rave耻À䃀pha;䎑acr;䄀d;橓Āgp¡on;䄄f;쀀𝔸plyFunction;恡ing耻Å䃅Ācs¾Ãr;쀀𝒜ign;扔ilde耻Ã䃃ml耻Ä䃄ЀaceforsuåûþėĜĢħĪĀcrêòkslash;或Ŷöø;櫧ed;挆y;䐑ƀcrtąċĔause;戵noullis;愬a;䎒r;쀀𝔅pf;쀀𝔹eve;䋘còēmpeq;扎܀HOacdefhilorsuōőŖƀƞƢƵƷƺǜȕɳɸɾcy;䐧PY耻©䂩ƀcpyŝŢźute;䄆Ā;iŧŨ拒talDifferentialD;慅leys;愭ȀaeioƉƎƔƘron;䄌dil耻Ç䃇rc;䄈nint;戰ot;䄊ĀdnƧƭilla;䂸terDot;䂷òſi;䎧rcleȀDMPTLJNjǑǖot;抙inus;抖lus;投imes;抗oĀcsǢǸkwiseContourIntegral;戲eCurlyĀDQȃȏoubleQuote;思uote;怙ȀlnpuȞȨɇɕonĀ;eȥȦ户;橴ƀgitȯȶȺruent;扡nt;戯ourIntegral;戮ĀfrɌɎ;愂oduct;成nterClockwiseContourIntegral;戳oss;樯cr;쀀𝒞pĀ;Cʄʅ拓ap;才րDJSZacefiosʠʬʰʴʸˋ˗ˡ˦̳ҍĀ;oŹʥtrahd;椑cy;䐂cy;䐅cy;䐏ƀgrsʿ˄ˇger;怡r;憡hv;櫤Āayː˕ron;䄎;䐔lĀ;t˝˞戇a;䎔r;쀀𝔇Āaf˫̧Ācm˰̢riticalȀADGT̖̜̀̆cute;䂴oŴ̋̍;䋙bleAcute;䋝rave;䁠ilde;䋜ond;拄ferentialD;慆Ѱ̽\0\0\0͔͂\0Ѕf;쀀𝔻ƀ;DE͈͉͍䂨ot;惜qual;扐blèCDLRUVͣͲϏϢϸontourIntegraìȹoɴ\0\0ͻ»͉nArrow;懓Āeo·ΤftƀARTΐΖΡrrow;懐ightArrow;懔eåˊngĀLRΫτeftĀARγιrrow;柸ightArrow;柺ightArrow;柹ightĀATϘϞrrow;懒ee;抨pɁϩ\0\0ϯrrow;懑ownArrow;懕erticalBar;戥ǹABLRTaВЪаўѿͼrrowƀ;BUНОТ憓ar;椓pArrow;懵reve;䌑eft˒к\0ц\0ѐightVector;楐eeVector;楞ectorĀ;Bљњ憽ar;楖ightǔѧ\0ѱeeVector;楟ectorĀ;BѺѻ懁ar;楗eeĀ;A҆҇护rrow;憧ĀctҒҗr;쀀𝒟rok;䄐ࠀNTacdfglmopqstuxҽӀӄӋӞӢӧӮӵԡԯԶՒ՝ՠեG;䅊H耻Ð䃐cute耻É䃉ƀaiyӒӗӜron;䄚rc耻Ê䃊;䐭ot;䄖r;쀀𝔈rave耻È䃈ement;戈ĀapӺӾcr;䄒tyɓԆ\0\0ԒmallSquare;旻erySmallSquare;斫ĀgpԦԪon;䄘f;쀀𝔼silon;䎕uĀaiԼՉlĀ;TՂՃ橵ilde;扂librium;懌Āci՚r;愰m;橳a;䎗ml耻Ë䃋Āipժկsts;戃onentialE;慇ʀcfiosօֈ֍ֲy;䐤r;쀀𝔉lledɓ֗\0\0֣mallSquare;旼erySmallSquare;斪Ͱֺ\0ֿ\0\0ׄf;쀀𝔽All;戀riertrf;愱còJTabcdfgorstרׯؒؖ؛؝أ٬ٲcy;䐃耻>䀾mmaĀ;d䎓;䏜reve;䄞ƀeiy؇،ؐdil;䄢rc;䄜;䐓ot;䄠r;쀀𝔊;拙pf;쀀𝔾eater̀EFGLSTصلَٖٛ٦qualĀ;Lؾؿ扥ess;招ullEqual;执reater;檢ess;扷lantEqual;橾ilde;扳cr;쀀𝒢;扫ЀAacfiosuڅڋږڛڞڪھۊRDcy;䐪Āctڐڔek;䋇;䁞irc;䄤r;愌lbertSpace;愋ǰگ\0ڲf;愍izontalLine;攀Āctۃۅòکrok;䄦mpńېۘownHumðįqual;扏܀EJOacdfgmnostuۺ۾܃܇ܚܞܡܨ݄ݸދޏޕcy;䐕lig;䄲cy;䐁cute耻Í䃍Āiyܓܘrc耻Î䃎;䐘ot;䄰r;愑rave耻Ì䃌ƀ;apܠܯܿĀcgܴܷr;䄪inaryI;慈lieóϝǴ݉\0ݢĀ;eݍݎ戬Āgrݓݘral;戫section;拂isibleĀCTݬݲomma;恣imes;恢ƀgptݿރވon;䄮f;쀀𝕀a;䎙cr;愐ilde;䄨ǫޚ\0ޞcy;䐆l耻Ï䃏ʀcfosuެ߂ߐĀiyޱrc;䄴;䐙r;쀀𝔍pf;쀀𝕁ǣ߇\0ߌr;쀀𝒥rcy;䐈kcy;䐄HJacfosߤߨ߽߬߱ࠂࠈcy;䐥cy;䐌ppa;䎚Āey߶dil;䄶;䐚r;쀀𝔎pf;쀀𝕂cr;쀀𝒦րJTaceflmostࠥࠩࠬࡐࡣসে্ੇcy;䐉耻<䀼ʀcmnpr࠷࠼ࡁࡄࡍute;䄹bda;䎛g;柪lacetrf;愒r;憞ƀaeyࡗࡡron;䄽dil;䄻;䐛Āfsࡨ॰tԀACDFRTUVarࡾࢩࢱࣦ࣠ࣼयज़ΐ४ĀnrࢃgleBracket;柨rowƀ;BR࢙࢚࢞憐ar;懤ightArrow;懆eiling;挈oǵࢷ\0ࣃbleBracket;柦nǔࣈ\0࣒eeVector;楡ectorĀ;Bࣛࣜ懃ar;楙loor;挊ightĀAV࣯ࣵrrow;憔ector;楎Āerँगeƀ;AVउऊऐ抣rrow;憤ector;楚iangleƀ;BEतथऩ抲ar;槏qual;抴pƀDTVषूौownVector;楑eeVector;楠ectorĀ;Bॖॗ憿ar;楘ectorĀ;B॥०憼ar;楒ightáΜs̀EFGLSTॾঋকঝঢভqualGreater;拚ullEqual;扦reater;扶ess;檡lantEqual;橽ilde;扲r;쀀𝔏Ā;eঽা拘ftarrow;懚idot;䄿ƀnpwਖਛgȀLRlr৷ਂਐeftĀAR০৬rrow;柵ightArrow;柷ightArrow;柶eftĀarγਊightáοightáϊf;쀀𝕃erĀLRਢਬeftArrow;憙ightArrow;憘ƀchtਾੀੂòࡌ;憰rok;䅁;扪Ѐacefiosuਗ਼અઋp;椅y;䐜Ādl੯iumSpace;恟lintrf;愳r;쀀𝔐nusPlus;戓pf;쀀𝕄cò੶;䎜ҀJacefostuણધભીଔଙඑඞcy;䐊cute;䅃ƀaeyહાron;䅇dil;䅅;䐝ƀgswે૰ativeƀMTV૨ediumSpace;怋hiĀcn૦ëeryThiîtedĀGLଆreaterGreateòٳessLesóੈLine;䀊r;쀀𝔑ȀBnptଢନଷreak;恠BreakingSpace;䂠f;愕ڀ;CDEGHLNPRSTV୕ୖ୪௫ఄ಄ದൡඅ櫬Āoungruent;扢pCap;扭oubleVerticalBar;戦ƀlqxஃஊement;戉ualĀ;Tஒஓ扠ilde;쀀≂̸ists;戄reater;EFGLSTஶஷ扯qual;扱ullEqual;쀀≧̸reater;쀀≫̸ess;批lantEqual;쀀⩾̸ilde;扵umpń௲ownHump;쀀≎̸qual;쀀≏̸eĀfsఊధtTriangleƀ;BEచఛడ拪ar;쀀⧏̸qual;括s̀;EGLSTవశ఼ౄోౘ扮qual;扰reater;扸ess;쀀≪̸lantEqual;쀀⩽̸ilde;扴estedĀGL౨౹reaterGreater;쀀⪢̸essLess;쀀⪡̸recedesƀ;ESಒಓಛ技qual;쀀⪯̸lantEqual;拠ĀeiಫಹverseElement;戌ghtTriangleƀ;BEೋೌ拫ar;쀀⧐̸qual;拭ĀquೝഌuareSuĀbp೨setĀ;Eೳ쀀⊏̸qual;拢ersetĀ;Eഃആ쀀⊐̸qual;拣ƀbcpഓതൎsetĀ;Eഛഞ쀀⊂⃒qual;抈ceedsȀ;ESTലള഻െ抁qual;쀀⪰̸lantEqual;拡ilde;쀀≿̸ersetĀ;E൘൛쀀⊃⃒qual;抉ildeȀ;EFT൮൯൵ൿ扁qual;扄ullEqual;扇ilde;扉erticalBar;戤cr;쀀𝒩ilde耻Ñ䃑;䎝܀Eacdfgmoprstuvලෂෛ෧ขภยา฿ไlig;䅒cute耻Ó䃓Āiyීrc耻Ô䃔;䐞blac;䅐r;쀀𝔒rave耻Ò䃒ƀaei෮ෲcr;䅌ga;䎩cron;䎟pf;쀀𝕆enCurlyĀDQฎบoubleQuote;怜uote;怘;橔Āclวฬr;쀀𝒪ash耻Ø䃘iŬืde耻Õ䃕es;樷ml耻Ö䃖erĀBP๋Āar๐๓r;怾acĀek๚;揞et;掴arenthesis;揜ҀacfhilorsງຊຏຒດຝະrtialD;戂y;䐟r;쀀𝔓i;䎦;䎠usMinus;䂱Āipຢອncareplanåڝf;愙Ȁ;eio຺ູ檻cedesȀ;EST່້扺qual;檯lantEqual;扼ilde;找me;怳Ādpuct;戏ortionĀ;aȥl;戝Āci༁༆r;쀀𝒫;䎨ȀUfos༑༖༛༟OT耻"䀢r;쀀𝔔pf;愚cr;쀀𝒬BEacefhiorsu༾གྷཇའཱིྦྷྪྭ႖ႩႴႾarr;椐G耻®䂮ƀcnrཎནབute;䅔g;柫rĀ;tཛྷཝ憠l;椖ƀaeyཧཬཱron;䅘dil;䅖;䐠Ā;vླྀཹ愜erseĀEUྂྙĀlq྇ྎement;戋uilibrium;懋pEquilibrium;楯r»ཹo;䎡ghtЀACDFTUVa࿁ဢဨၛႇϘĀnr࿆࿒gleBracket;柩rowƀ;BL憒ar;懥eftArrow;懄eiling;按oǵ\0စbleBracket;柧nǔည\0နeeVector;楝ectorĀ;Bဝသ懂ar;楕loor;挋Āerိ၃eƀ;AVဵံြ抢rrow;憦ector;楛iangleƀ;BEၐၑၕ抳ar;槐qual;抵pƀDTVၣၮၸownVector;楏eeVector;楜ectorĀ;Bႂႃ憾ar;楔ectorĀ;B႑႒懀ar;楓Āpuႛ႞f;愝ndImplies;楰ightarrow;懛ĀchႹႼr;愛;憱leDelayed;槴ڀHOacfhimoqstuფჱჷჽᄙᄞᅑᅖᅡᅧᆵᆻᆿĀCcჩხHcy;䐩y;䐨FTcy;䐬cute;䅚ʀ;aeiyᄈᄉᄎᄓᄗ檼ron;䅠dil;䅞rc;䅜;䐡r;쀀𝔖ortȀDLRUᄪᄴᄾᅉownArrow»ОeftArrow»࢚ightArrow»pArrow;憑gma;䎣allCircle;战pf;쀀𝕊ɲᅭ\0\0ᅰt;戚areȀ;ISUᅻᅼᆉᆯ斡ntersection;抓uĀbpᆏᆞsetĀ;Eᆗᆘ抏qual;抑ersetĀ;Eᆨᆩ抐qual;抒nion;抔cr;쀀𝒮ar;拆ȀbcmpᇈᇛሉላĀ;sᇍᇎ拐etĀ;Eᇍᇕqual;抆ĀchᇠህeedsȀ;ESTᇭᇮᇴᇿ扻qual;檰lantEqual;扽ilde;承Tháྌ;我ƀ;esሒሓሣ拑rsetĀ;Eሜም抃qual;抇et»ሓրHRSacfhiorsሾቄቕቱቶኟዂወዑORN耻Þ䃞ADE;愢ĀHcቒcy;䐋y;䐦Ābuቚቜ;䀉;䎤ƀaeyብቪቯron;䅤dil;䅢;䐢r;쀀𝔗ĀeiቻDzኀ\0ኇefore;戴a;䎘ĀcnኘkSpace;쀀 Space;怉ldeȀ;EFTካኬኲኼ戼qual;扃ullEqual;扅ilde;扈pf;쀀𝕋ipleDot;惛Āctዖዛr;쀀𝒯rok;䅦ૡዷጎጚጦ\0ጬጱ\0\0\0\0\0ጸጽ፷ᎅ\0ᐄᐊᐐĀcrዻጁute耻Ú䃚rĀ;oጇገ憟cir;楉rǣጓ\0y;䐎ve;䅬Āiyጞጣrc耻Û䃛;䐣blac;䅰r;쀀𝔘rave耻Ù䃙acr;䅪Ādiፁ፩erĀBPፈ፝Āarፍፐr;䁟acĀekፗፙ;揟et;掵arenthesis;揝onĀ;P፰፱拃lus;抎Āgp፻on;䅲f;쀀𝕌ЀADETadps᎕ᎮᎸᏄϨᏒᏗᏳrrowƀ;BDᅐᎠᎤar;椒ownArrow;懅ownArrow;憕quilibrium;楮eeĀ;AᏋᏌ报rrow;憥ownáϳerĀLRᏞᏨeftArrow;憖ightArrow;憗iĀ;lᏹᏺ䏒on;䎥ing;䅮cr;쀀𝒰ilde;䅨ml耻Ü䃜ҀDbcdefosvᐧᐬᐰᐳᐾᒅᒊᒐᒖash;披ar;櫫y;䐒ashĀ;lᐻᐼ抩;櫦Āerᑃᑅ;拁ƀbtyᑌᑐᑺar;怖Ā;iᑏᑕcalȀBLSTᑡᑥᑪᑴar;戣ine;䁼eparator;杘ilde;所ThinSpace;怊r;쀀𝔙pf;쀀𝕍cr;쀀𝒱dash;抪ʀcefosᒧᒬᒱᒶᒼirc;䅴dge;拀r;쀀𝔚pf;쀀𝕎cr;쀀𝒲Ȁfiosᓋᓐᓒᓘr;쀀𝔛;䎞pf;쀀𝕏cr;쀀𝒳ҀAIUacfosuᓱᓵᓹᓽᔄᔏᔔᔚᔠcy;䐯cy;䐇cy;䐮cute耻Ý䃝Āiyᔉᔍrc;䅶;䐫r;쀀𝔜pf;쀀𝕐cr;쀀𝒴ml;䅸ЀHacdefosᔵᔹᔿᕋᕏᕝᕠᕤcy;䐖cute;䅹Āayᕄᕉron;䅽;䐗ot;䅻Dzᕔ\0ᕛoWidtèa;䎖r;愨pf;愤cr;쀀𝒵ᖃᖊᖐ\0ᖰᖶᖿ\0\0\0\0ᗆᗛᗫᙟ᙭\0ᚕ᚛ᚲᚹ\0ᚾcute耻á䃡reve;䄃̀;Ediuyᖜᖝᖡᖣᖨᖭ戾;쀀∾̳;房rc耻â䃢te肻´̆;䐰lig耻æ䃦Ā;r²ᖺ;쀀𝔞rave耻à䃠ĀepᗊᗖĀfpᗏᗔsym;愵èᗓha;䎱ĀapᗟcĀclᗤᗧr;䄁g;樿ɤᗰ\0\0ᘊʀ;adsvᗺᗻᗿᘁᘇ戧nd;橕;橜lope;橘;橚;elmrszᘘᘙᘛᘞᘿᙏᙙ戠;榤e»ᘙsdĀ;aᘥᘦ戡ѡᘰᘲᘴᘶᘸᘺᘼᘾ;榨;榩;榪;榫;榬;榭;榮;榯tĀ;vᙅᙆ戟bĀ;dᙌᙍ抾;榝Āptᙔᙗh;戢»¹arr;捼Āgpᙣᙧon;䄅f;쀀𝕒;Eaeiopᙻᙽᚂᚄᚇᚊ;橰cir;橯;扊d;手s;䀧roxĀ;eᚒñᚃing耻å䃥ƀctyᚡᚦᚨr;쀀𝒶;䀪mpĀ;eᚯñʈilde耻ã䃣ml耻ä䃤Āciᛂᛈoninôɲnt;樑ࠀNabcdefiklnoprsu᛭ᛱᜰᝃᝈ០៦ᠹᡐᜍ᥈ᥰot;櫭ĀcrᛶkȀcepsᜀᜅᜍᜓong;扌psilon;䏶rime;怵imĀ;e戽q;拍Ŷᜢᜦee;抽edĀ;gᜬᜭ挅e»ᜭrkĀ;tbrk;掶Āoyᜁᝁ;䐱quo;怞ʀcmprtᝓᝡᝤᝨausĀ;eĊĉptyv;榰séᜌnoõēƀahwᝯᝳ;䎲;愶een;扬r;쀀𝔟gcostuvwឍឝឳេ៕៛ƀaiuបពរðݠrc;旯p»፱ƀdptឤឨឭot;樀lus;樁imes;樂ɱឹ\0\0ើcup;樆ar;昅riangleĀdu៍្own;施p;斳plus;樄eåᑄåᒭarow;植ƀakoᠦᠵĀcn៲ᠣkƀlst֫᠂ozenge;槫riangleȀ;dlr᠒᠓᠘斴own;斾eft;旂ight;斸k;搣Ʊᠫ\0ᠳƲᠯ\0ᠱ;斒;斑4;斓ck;斈ĀeoᠾᡍĀ;qᡃᡆ쀀=⃥uiv;쀀≡⃥t;挐Ȁptwxᡙᡞᡧᡬf;쀀𝕓Ā;tᏋᡣom»Ꮜtie;拈DHUVbdhmptuvᢅᢖᢪᢻᣗᣛᣬᤅᤊᤐᤡȀLRlrᢎᢐᢒᢔ;敗;敔;敖;敓ʀ;DUduᢡᢢᢤᢦᢨ敐;敦;敩;敤;敧ȀLRlrᢳᢵᢷᢹ;敝;敚;敜;教;HLRhlrᣊᣋᣍᣏᣑᣓᣕ救;敬;散;敠;敫;敢;敟ox;槉ȀLRlrᣤᣦᣨᣪ;敕;敒;攐;攌ʀ;DUduڽ;敥;敨;攬;攴inus;抟lus;択imes;抠ȀLRlrᤙᤛᤝ;敛;敘;攘;攔;HLRhlrᤰᤱᤳᤵᤷ᤻᤹攂;敪;敡;敞;攼;攤;攜Āevģbar耻¦䂦Ȁceioᥑᥖᥚᥠr;쀀𝒷mi;恏mĀ;elƀ;bhᥨᥩᥫ䁜;槅sub;柈ŬᥴlĀ;e怢t»pƀ;Eeįᦅᦇ;檮Ā;qۜۛೡᦧ\0᧨ᨑᨕᨲ\0ᨷᩐ\0\0᪴\0\0᫁\0\0ᬡᬮ᭒\0᯽\0ᰌƀcprᦲute;䄇̀;abcdsᦿᧀᧄ᧕᧙戩nd;橄rcup;橉Āau᧒p;橋p;橇ot;橀;쀀∩︀Āeo᧢᧥t;恁îړȀaeiu᧰᧻ᨁᨅǰ᧵\0᧸s;橍on;䄍dil耻ç䃧rc;䄉psĀ;sᨌᨍ橌m;橐ot;䄋ƀdmnᨛᨠᨦil肻¸ƭptyv;榲t脀¢;eᨭᨮ䂢räƲr;쀀𝔠ƀceiᨽᩀᩍy;䑇ckĀ;mᩇᩈ朓ark»ᩈ;䏇r;Ecefms᩠ᩢᩫ᪤᪪旋;槃ƀ;elᩩᩪᩭ䋆q;扗eɡᩴ\0\0᪈rrowĀlr᩼᪁eft;憺ight;憻ʀRSacd᪒᪔᪖»ཇ;擈st;抛irc;抚ash;抝nint;樐id;櫯cir;槂ubsĀ;u᪻᪼晣it»᪼ˬ᫇\0ᬊonĀ;eᫍᫎ䀺Ā;qÇÆɭ\0\0aĀ;t䀬;䁀ƀ;fl戁îᅠeĀmxent»eóɍǧ\0ᬇĀ;dኻᬂot;橭nôɆƀfryᬐᬔᬗ;쀀𝕔oäɔ脀©;sŕᬝr;愗Āaoᬥᬩrr;憵ss;朗Ācuᬲᬷr;쀀𝒸Ābpᬼ᭄Ā;eᭁᭂ櫏;櫑Ā;eᭉᭊ櫐;櫒dot;拯delprvw᭠᭬᭷ᮂᮬᯔarrĀlr᭨᭪;椸;椵ɰ᭲\0\0᭵r;拞c;拟arrĀ;pᮀ憶;椽̀;bcdosᮏᮐᮖᮡᮥᮨ截rcap;橈Āauᮛᮞp;橆p;橊ot;抍r;橅;쀀∪︀Ȁalrv᮵ᮿᯞᯣrrĀ;mᮼᮽ憷;椼yƀevwᯇᯔᯘqɰᯎ\0\0ᯒreã᭳uã᭵ee;拎edge;拏en耻¤䂤earrowĀlrᯮ᯳eft»ᮀight»ᮽeäᯝĀciᰁᰇoninôǷnt;戱lcty;挭ঀAHabcdefhijlorstuwz᰻᰿ᱝᱩᱵᲞᲬᲷᴍᵻᶑᶫᶻ᷆᷍ròar;楥Ȁglrs᱈ᱍ᱒᱔ger;怠eth;愸òᄳhĀ;vᱚᱛ怐»ऊūᱡᱧarow;椏aã̕Āayᱮᱳron;䄏;䐴ƀ;ao̲ᱼᲄĀgrʿᲁr;懊tseq;橷ƀglmᲑᲔᲘ耻°䂰ta;䎴ptyv;榱ĀirᲣᲨsht;楿;쀀𝔡arĀlrᲳᲵ»ࣜ»သʀaegsv᳂᳖᳜᳠mƀ;oș᳔ndĀ;ș᳑uit;晦amma;䏝in;拲ƀ;io᳧᳨᳸䃷de脀÷;o᳧ᳰntimes;拇nø᳷cy;䑒cɯᴆ\0\0ᴊrn;挞op;挍ʀlptuwᴘᴝᴢᵉᵕlar;䀤f;쀀𝕕ʀ;emps̋ᴭᴷᴽᵂqĀ;d͒ᴳot;扑inus;戸lus;戔quare;抡blebarwedgåúnƀadhᄮᵝᵧownarrowóᲃarpoonĀlrᵲᵶefôᲴighôᲶŢᵿᶅkaro÷གɯᶊ\0\0ᶎrn;挟op;挌ƀcotᶘᶣᶦĀryᶝᶡ;쀀𝒹;䑕l;槶rok;䄑Ādrᶰᶴot;拱iĀ;fᶺ᠖斿Āah᷀᷃ròЩaòྦangle;榦Āci᷒ᷕy;䑟grarr;柿ऀDacdefglmnopqrstuxḁḉḙḸոḼṉṡṾấắẽỡἪἷὄĀDoḆᴴoôĀcsḎḔute耻é䃩ter;橮ȀaioyḢḧḱḶron;䄛rĀ;cḭḮ扖耻ê䃪lon;払;䑍ot;䄗ĀDrṁṅot;扒;쀀𝔢ƀ;rsṐṑṗ檚ave耻è䃨Ā;dṜṝ檖ot;檘Ȁ;ilsṪṫṲṴ檙nters;揧;愓Ā;dṹṺ檕ot;檗ƀapsẅẉẗcr;䄓tyƀ;svẒẓẕ戅et»ẓpĀ1;ẝẤijạả;怄;怅怃ĀgsẪẬ;䅋p;怂ĀgpẴẸon;䄙f;쀀𝕖ƀalsỄỎỒrĀ;sỊị拕l;槣us;橱iƀ;lvỚớở䎵on»ớ;䏵ȀcsuvỪỳἋἣĀioữḱrc»Ḯɩỹ\0\0ỻíՈantĀglἂἆtr»ṝess»ṺƀaeiἒἚls;䀽st;扟vĀ;DȵἠD;橸parsl;槥ĀDaἯἳot;打rr;楱ƀcdiἾὁỸr;愯oô͒ĀahὉὋ;䎷耻ð䃰Āmrὓὗl耻ë䃫o;悬ƀcipὡὤὧl;䀡sôծĀeoὬὴctatioîՙnentialåչৡᾒ\0ᾞ\0ᾡᾧ\0\0ῆῌ\0ΐ\0ῦῪ \0 ⁚llingdotseñṄy;䑄male;晀ƀilrᾭᾳ῁lig;耀ffiɩᾹ\0\0᾽g;耀ffig;耀ffl;쀀𝔣lig;耀filig;쀀fjƀaltῙῡt;晭ig;耀flns;斱of;䆒ǰ΅\0ῳf;쀀𝕗ĀakֿῷĀ;vῼ´拔;櫙artint;樍Āao⁕Ācs‑⁒ႉ‸⁅⁈\0⁐β•‥‧\0耻½䂽;慓耻¼䂼;慕;慙;慛Ƴ‴\0‶;慔;慖ʴ‾⁁\0\0⁃耻¾䂾;慗;慜5;慘ƶ⁌\0⁎;慚;慝8;慞l;恄wn;挢cr;쀀𝒻ࢀEabcdefgijlnorstv₂₉₥₰₴⃰℃ℒℸ̗ℾ⅒↞Ā;lٍ₇;檌ƀcmpₐₕute;䇵maĀ;dₜ᳚䎳;檆reve;䄟Āiy₪₮rc;䄝;䐳ot;䄡Ȁ;lqsؾق₽ƀ;qsؾٌlanô٥Ȁ;cdl٥⃒⃥⃕c;檩otĀ;o⃜⃝檀Ā;l⃢⃣檂;檄Ā;e⃪⃭쀀⋛︀s;檔r;쀀𝔤Ā;gٳ؛mel;愷cy;䑓Ȁ;Eajٚℌℎℐ;檒;檥;檤ȀEaesℛℝ℩ℴ;扩pĀ;p℣ℤ檊rox»ℤĀ;q℮ℯ檈Ā;q℮ℛim;拧pf;쀀𝕘Āci⅃ⅆr;愊mƀ;el٫ⅎ⅐;檎;檐茀>;cdlqrⅠⅪⅮⅳⅹĀciⅥⅧ;檧r;橺ot;拗Par;榕uest;橼ʀadelsↄⅪ←ٖ↛ǰ↉\0proør;楸qĀlqؿ↖lesó₈ií٫Āen↣↭rtneqq;쀀≩︀Å↪ԀAabcefkosy⇄⇇⇱⇵⇺∘∝∯≨≽ròΠȀilmr⇐⇔⇗⇛rsðᒄf»․ilôکĀdr⇠⇤cy;䑊ƀ;cwࣴ⇫⇯ir;楈;憭ar;意irc;䄥ƀalr∁∎∓rtsĀ;u∉∊晥it»∊lip;怦con;抹r;쀀𝔥sĀew∣∩arow;椥arow;椦ʀamopr∺∾≃≞≣rr;懿tht;戻kĀlr≉≓eftarrow;憩ightarrow;憪f;쀀𝕙bar;怕ƀclt≯≴≸r;쀀𝒽asè⇴rok;䄧Ābp⊂⊇ull;恃hen»ᱛૡ⊣\0⊪\0⊸⋅⋎\0⋕⋳\0\0⋸⌢⍧⍢⍿\0⎆⎪⎴cute耻í䃭ƀ;iyݱ⊰⊵rc耻î䃮;䐸Ācx⊼⊿y;䐵cl耻¡䂡ĀfrΟ⋉;쀀𝔦rave耻ì䃬Ȁ;inoܾ⋝⋩⋮Āin⋢⋦nt;樌t;戭fin;槜ta;愩lig;䄳ƀaop⋾⌚⌝ƀcgt⌅⌈⌗r;䄫ƀelpܟ⌏⌓inåގarôܠh;䄱f;抷ed;䆵ʀ;cfotӴ⌬⌱⌽⍁are;愅inĀ;t⌸⌹戞ie;槝doô⌙ʀ;celpݗ⍌⍐⍛⍡al;抺Āgr⍕⍙eróᕣã⍍arhk;樗rod;樼Ȁcgpt⍯⍲⍶⍻y;䑑on;䄯f;쀀𝕚a;䎹uest耻¿䂿Āci⎊⎏r;쀀𝒾nʀ;EdsvӴ⎛⎝⎡ӳ;拹ot;拵Ā;v⎦⎧拴;拳Ā;iݷ⎮lde;䄩ǫ⎸\0⎼cy;䑖l耻ï䃯̀cfmosu⏌⏗⏜⏡⏧⏵Āiy⏑⏕rc;䄵;䐹r;쀀𝔧ath;䈷pf;쀀𝕛ǣ⏬\0⏱r;쀀𝒿rcy;䑘kcy;䑔Ѐacfghjos␋␖␢ppaĀ;v␓␔䎺;䏰Āey␛␠dil;䄷;䐺r;쀀𝔨reen;䄸cy;䑅cy;䑜pf;쀀𝕜cr;쀀𝓀ABEHabcdefghjlmnoprstuv⑰⒁⒆⒍⒑┎┽╚▀♎♞♥♹♽⚚⚲⛘❝❨➋⟀⠁⠒ƀart⑷⑺⑼ròòΕail;椛arr;椎Ā;gঔ⒋;檋ar;楢ॣ⒥\0⒪\0⒱\0\0\0\0\0⒵Ⓔ\0ⓆⓈⓍ\0⓹ute;䄺mptyv;榴raîࡌbda;䎻gƀ;dlࢎⓁⓃ;榑åࢎ;檅uo耻«䂫rЀ;bfhlpst࢙ⓞⓦⓩ⓫⓮⓱⓵Ā;f࢝ⓣs;椟s;椝ë≒p;憫l;椹im;楳l;憢ƀ;ae⓿─┄檫il;椙Ā;s┉┊檭;쀀⪭︀ƀabr┕┙┝rr;椌rk;杲Āak┢┬cĀek┨┪;䁻;䁛Āes┱┳;榋lĀdu┹┻;榏;榍Ȁaeuy╆╋╖╘ron;䄾Ādi═╔il;䄼ìࢰâ┩;䐻Ȁcqrs╣╦╭╽a;椶uoĀ;rนᝆĀdu╲╷har;楧shar;楋h;憲ʀ;fgqs▋▌উ◳◿扤tʀahlrt▘▤▷◂◨rrowĀ;t࢙□aé⓶arpoonĀdu▯▴own»њp»०eftarrows;懇ightƀahs◍◖◞rrowĀ;sࣴࢧarpoonóquigarro÷⇰hreetimes;拋ƀ;qs▋ও◺lanôবʀ;cdgsব☊☍☝☨c;檨otĀ;o☔☕橿Ā;r☚☛檁;檃Ā;e☢☥쀀⋚︀s;檓ʀadegs☳☹☽♉♋pproøⓆot;拖qĀgq♃♅ôউgtò⒌ôছiíলƀilr♕࣡♚sht;楼;쀀𝔩Ā;Eজ♣;檑š♩♶rĀdu▲♮Ā;l॥♳;楪lk;斄cy;䑙ʀ;achtੈ⚈⚋⚑⚖rò◁orneòᴈard;楫ri;旺Āio⚟⚤dot;䅀ustĀ;a⚬⚭掰che»⚭ȀEaes⚻⚽⛉⛔;扨pĀ;p⛃⛄檉rox»⛄Ā;q⛎⛏檇Ā;q⛎⚻im;拦Ѐabnoptwz⛩⛴⛷✚✯❁❇❐Ānr⛮⛱g;柬r;懽rëࣁgƀlmr⛿✍✔eftĀar০✇ightá৲apsto;柼ightá৽parrowĀlr✥✩efô⓭ight;憬ƀafl✶✹✽r;榅;쀀𝕝us;樭imes;樴š❋❏st;戗áፎƀ;ef❗❘᠀旊nge»❘arĀ;l❤❥䀨t;榓ʀachmt❳❶❼➅➇ròࢨorneòᶌarĀ;d➃;業;怎ri;抿̀achiqt➘➝ੀ➢➮➻quo;怹r;쀀𝓁mƀ;egল➪➬;檍;檏Ābu┪➳oĀ;rฟ➹;怚rok;䅂萀<;cdhilqrࠫ⟒☹⟜⟠⟥⟪⟰Āci⟗⟙;檦r;橹reå◲mes;拉arr;楶uest;橻ĀPi⟵⟹ar;榖ƀ;ef⠀भ旃rĀdu⠇⠍shar;楊har;楦Āen⠗⠡rtneqq;쀀≨︀Å⠞܀Dacdefhilnopsu⡀⡅⢂⢎⢓⢠⢥⢨⣚⣢⣤ઃ⣳⤂Dot;戺Ȁclpr⡎⡒⡣⡽r耻¯䂯Āet⡗⡙;時Ā;e⡞⡟朠se»⡟Ā;sျ⡨toȀ;dluျ⡳⡷⡻owîҌefôएðᏑker;斮Āoy⢇⢌mma;権;䐼ash;怔asuredangle»ᘦr;쀀𝔪o;愧ƀcdn⢯⢴⣉ro耻µ䂵Ȁ;acdᑤ⢽⣀⣄sôᚧir;櫰ot肻·Ƶusƀ;bd⣒ᤃ⣓戒Ā;uᴼ⣘;横ţ⣞⣡p;櫛ò−ðઁĀdp⣩⣮els;抧f;쀀𝕞Āct⣸⣽r;쀀𝓂pos»ᖝƀ;lm⤉⤊⤍䎼timap;抸ఀGLRVabcdefghijlmoprstuvw⥂⥓⥾⦉⦘⧚⧩⨕⨚⩘⩝⪃⪕⪤⪨⬄⬇⭄⭿⮮ⰴⱧⱼ⳩Āgt⥇⥋;쀀⋙̸Ā;v⥐쀀≫⃒ƀelt⥚⥲⥶ftĀar⥡⥧rrow;懍ightarrow;懎;쀀⋘̸Ā;v⥻ే쀀≪⃒ightarrow;懏ĀDd⦎⦓ash;抯ash;抮ʀbcnpt⦣⦧⦬⦱⧌la»˞ute;䅄g;쀀∠⃒ʀ;Eiop⦼⧀⧅⧈;쀀⩰̸d;쀀≋̸s;䅉roøurĀ;a⧓⧔普lĀ;s⧓ସdz⧟\0⧣p肻 ଷmpĀ;e௹ఀʀaeouy⧴⧾⨃⨐⨓ǰ⧹\0⧻;橃on;䅈dil;䅆ngĀ;dൾ⨊ot;쀀⩭̸p;橂;䐽ash;怓;Aadqsxஒ⨩⨭⨻⩁⩅⩐rr;懗rĀhr⨳⨶k;椤Ā;oᏲᏰot;쀀≐̸uiöୣĀei⩊⩎ar;椨íistĀ;sடr;쀀𝔫ȀEest⩦⩹⩼ƀ;qs⩭ƀ;qs⩴lanôií௪Ā;rஶ⪁»ஷƀAap⪊⪍⪑rò⥱rr;憮ar;櫲ƀ;svྍ⪜ྌĀ;d⪡⪢拼;拺cy;䑚AEadest⪷⪺⪾⫂⫅⫶⫹rò⥦;쀀≦̸rr;憚r;急Ȁ;fqs⫎⫣⫯tĀar⫔⫙rro÷⫁ightarro÷⪐ƀ;qs⪺⫪lanôౕĀ;sౕ⫴»శiíౝĀ;rవ⫾iĀ;eచథiäඐĀpt⬌⬑f;쀀𝕟膀¬;in⬙⬚⬶䂬nȀ;Edvஉ⬤⬨⬮;쀀⋹̸ot;쀀⋵̸ǡஉ⬳⬵;拷;拶iĀ;vಸ⬼ǡಸ⭁⭃;拾;拽ƀaor⭋⭣⭩rȀ;ast⭕⭚⭟lleìl;쀀⫽⃥;쀀∂̸lint;樔ƀ;ceಒ⭰⭳uåಥĀ;cಘ⭸Ā;eಒ⭽ñಘȀAait⮈⮋⮝⮧rò⦈rrƀ;cw⮔⮕⮙憛;쀀⤳̸;쀀↝̸ghtarrow»⮕riĀ;eೋೖchimpqu⮽⯍⯙⬄⯤⯯Ȁ;cerല⯆ഷ⯉uå;쀀𝓃ortɭ⬅\0\0⯖ará⭖mĀ;e൮⯟Ā;q൴൳suĀbp⯫⯭ååഋƀbcp⯶ⰑⰙȀ;Ees⯿ⰀഢⰄ抄;쀀⫅̸etĀ;eഛⰋqĀ;qണⰀcĀ;eലⰗñസȀ;EesⰢⰣൟⰧ抅;쀀⫆̸etĀ;e൘ⰮqĀ;qൠⰣȀgilrⰽⰿⱅⱇìௗlde耻ñ䃱çృiangleĀlrⱒⱜeftĀ;eచⱚñదightĀ;eೋⱥñĀ;mⱬⱭ䎽ƀ;esⱴⱵⱹ䀣ro;愖p;怇ҀDHadgilrsⲏⲔⲙⲞⲣⲰⲶⳓⳣash;抭arr;椄p;쀀≍⃒ash;抬ĀetⲨⲬ;쀀≥⃒;쀀>⃒nfin;槞ƀAetⲽⳁⳅrr;椂;쀀≤⃒Ā;rⳊⳍ쀀<⃒ie;쀀⊴⃒ĀAtⳘⳜrr;椃rie;쀀⊵⃒im;쀀∼⃒ƀAan⳰ⴂrr;懖rĀhr⳺⳽k;椣Ā;oᏧᏥear;椧ቓ᪕\0\0\0\0\0\0\0\0\0\0\0\0\0ⴭ\0ⴸⵈⵠⵥⶄᬇ\0\0ⶍⶫ\0ⷈⷎ\0ⷜ⸙⸫⸾⹃Ācsⴱ᪗ute耻ó䃳ĀiyⴼⵅrĀ;cⵂ耻ô䃴;䐾ʀabios᪠ⵒⵗLjⵚlac;䅑v;樸old;榼lig;䅓Ācrir;榿;쀀𝔬ͯ\0\0\0ⶂn;䋛ave耻ò䃲;槁Ābmⶈ෴ar;榵Ȁacitⶕⶥⶨrò᪀Āirⶠr;榾oss;榻nå๒;槀ƀaeiⶱⶵⶹcr;䅍ga;䏉ƀcdnⷀⷅǍron;䎿;榶pf;쀀𝕠ƀaelⷔǒr;榷rp;榹;adiosvⷪⷫⷮ⸈⸍⸐⸖戨rò᪆Ȁ;efmⷷⷸ⸂⸅橝rĀ;oⷾⷿ愴f»ⷿ耻ª䂪耻º䂺gof;抶r;橖lope;橗;橛ƀclo⸟⸡⸧ò⸁ash耻ø䃸l;折iŬⸯ⸴de耻õ䃵esĀ;aǛ⸺s;樶ml耻ö䃶bar;挽ૡ\0\0⺀⺝\0⺢⺹\0\0⻋ຜ\0⼓\0\0⼫⾼\0⿈rȀ;astЃ脀¶;l䂶leìЃɩ\0\0m;櫳;櫽y;䐿rʀcimpt⺋⺏⺓ᡥ⺗nt;䀥od;䀮il;怰enk;怱r;쀀𝔭ƀimo⺨⺰⺴Ā;v⺭⺮䏆;䏕maô੶ne;明ƀ;tv⺿⻀⻈䏀chfork»´;䏖Āau⻏⻟nĀck⻕⻝kĀ;h⇴⻛;愎ö⇴sҀ;abcdemst⻳ᤈ⼄⼆⼊⼎䀫cir;樣ir;樢Āouᵀ⼂;樥;橲n肻±ຝim;樦wo;樧ƀipu⼙⼠⼥ntint;樕f;쀀𝕡nd耻£䂣Ԁ;Eaceinosu່⼿⽁⽄⽇⾁⾉⾒⽾⾶;檳p;檷uå໙Ā;c໎⽌̀;acens່⽙⽟⽦⽨⽾pproø⽃urlyeñ໙ñ໎ƀaes⽯⽶⽺pprox;檹qq;檵im;拨iíໟmeĀ;s⾈ຮ怲ƀEas⽸⾐⽺ð⽵ƀdfp⾙⾯ƀals⾠⾥⾪lar;挮ine;挒urf;挓Ā;t⾴ïrel;抰Āci⿀⿅r;쀀𝓅;䏈ncsp;怈̀fiopsu⋢⿱r;쀀𝔮pf;쀀𝕢rime;恗cr;쀀𝓆ƀaeo⿸〉〓tĀei々rnionóڰnt;樖stĀ;e【】䀿ñἙô༔ABHabcdefhilmnoprstuxけさすムㄎㄫㅇㅢㅲㆎ㈆㈕㈤㈩㉘㉮㉲㊐㊰㊷ƀartぇおがròႳòϝail;検aròᱥar;楤cdenqrtとふへみわゔヌĀeuねぱ;쀀∽̱te;䅕iãᅮmptyv;榳gȀ;del࿑らるろ;榒;榥å࿑uo耻»䂻rր;abcfhlpstwガクシスゼゾダッデナp;極Ā;fゴs;椠;椳s;椞ë≝ð✮l;楅im;楴l;憣;憝Āaiパフil;椚oĀ;nホボ戶aló༞ƀabrョリヮrò៥rk;杳ĀakンヽcĀekヹ・;䁽;䁝Āes;榌lĀduㄊㄌ;榎;榐Ȁaeuyㄗㄜㄧㄩron;䅙Ādiㄡㄥil;䅗ìâヺ;䑀Ȁclqsㄴㄷㄽㅄa;椷dhar;楩uoĀ;rȎȍh;憳ƀacgㅎㅟངlȀ;ipsླྀㅘㅛႜnåႻarôྩt;断ƀilrㅩဣㅮsht;楽;쀀𝔯ĀaoㅷㆆrĀduㅽㅿ»ѻĀ;l႑ㆄ;楬Ā;vㆋㆌ䏁;䏱ƀgns㆕ㇹㇼht̀ahlrstㆤㆰ㇂㇘rrowĀ;tㆭaéトarpoonĀduㆻㆿowîㅾp»႒eftĀah㇊㇐rrowóarpoonóՑightarrows;應quigarro÷ニhreetimes;拌g;䋚ingdotseñἲƀahm㈍㈐㈓ròaòՑ;怏oustĀ;a㈞掱che»mid;櫮Ȁabpt㈲㈽㉀㉒Ānr㈷㈺g;柭r;懾rëဃƀafl㉇㉊㉎r;榆;쀀𝕣us;樮imes;樵Āap㉝㉧rĀ;g㉣㉤䀩t;榔olint;樒arò㇣Ȁachq㉻㊀Ⴜ㊅quo;怺r;쀀𝓇Ābu・㊊oĀ;rȔȓƀhir㊗㊛㊠reåㇸmes;拊iȀ;efl㊪ၙᠡ㊫方tri;槎luhar;楨;愞ൡ㋕㋛㋟㌬㌸㍱\0㍺㎤\0\0㏬㏰\0㐨㑈㑚㒭㒱㓊㓱\0㘖\0\0㘳cute;䅛quï➺Ԁ;Eaceinpsyᇭ㋳㋵㋿㌂㌋㌏㌟㌦㌩;檴ǰ㋺\0㋼;檸on;䅡uåᇾĀ;dᇳ㌇il;䅟rc;䅝ƀEas㌖㌘㌛;檶p;檺im;择olint;樓iíሄ;䑁otƀ;be㌴ᵇ㌵担;橦Aacmstx㍆㍊㍗㍛㍞㍣㍭rr;懘rĀhr㍐㍒ë∨Ā;oਸ਼t耻§䂧i;䀻war;椩mĀin㍩ðnuóñt;朶rĀ;o㍶⁕쀀𝔰Ȁacoy㎂㎆㎑㎠rp;景Āhy㎋㎏cy;䑉;䑈rtɭ㎙\0\0㎜iäᑤaraì耻䂭Āgm㎨㎴maƀ;fv㎱㎲㎲䏃;䏂Ѐ;deglnprካ㏅㏉㏎㏖㏞㏡㏦ot;橪Ā;qኰĀ;E㏓㏔檞;檠Ā;E㏛㏜檝;檟e;扆lus;樤arr;楲aròᄽȀaeit㏸㐈㐏㐗Āls㏽㐄lsetmé㍪hp;樳parsl;槤Ādlᑣ㐔e;挣Ā;e㐜㐝檪Ā;s㐢㐣檬;쀀⪬︀ƀflp㐮㐳㑂tcy;䑌Ā;b㐸㐹䀯Ā;a㐾㐿槄r;挿f;쀀𝕤aĀdr㑍ЂesĀ;u㑔㑕晠it»㑕ƀcsu㑠㑹㒟Āau㑥㑯pĀ;sᆈ㑫;쀀⊓︀pĀ;sᆴ㑵;쀀⊔︀uĀbp㑿㒏ƀ;esᆗᆜ㒆etĀ;eᆗ㒍ñᆝƀ;esᆨᆭ㒖etĀ;eᆨ㒝ñᆮƀ;afᅻ㒦ְrť㒫ֱ»ᅼaròᅈȀcemt㒹㒾㓂㓅r;쀀𝓈tmîñiì㐕aræᆾĀar㓎㓕rĀ;f㓔ឿ昆Āan㓚㓭ightĀep㓣㓪psiloîỠhé⺯s»⡒ʀbcmnp㓻㕞ሉ㖋㖎Ҁ;Edemnprs㔎㔏㔑㔕㔞㔣㔬㔱㔶抂;櫅ot;檽Ā;dᇚ㔚ot;櫃ult;櫁ĀEe㔨㔪;櫋;把lus;檿arr;楹ƀeiu㔽㕒㕕tƀ;en㔎㕅㕋qĀ;qᇚ㔏eqĀ;q㔫㔨m;櫇Ābp㕚㕜;櫕;櫓c̀;acensᇭ㕬㕲㕹㕻㌦pproø㋺urlyeñᇾñᇳƀaes㖂㖈㌛pproø㌚qñ㌗g;晪ڀ123;Edehlmnps㖩㖬㖯ሜ㖲㖴㗀㗉㗕㗚㗟㗨㗭耻¹䂹耻²䂲耻³䂳;櫆Āos㖹㖼t;檾ub;櫘Ā;dሢ㗅ot;櫄sĀou㗏㗒l;柉b;櫗arr;楻ult;櫂ĀEe㗤㗦;櫌;抋lus;櫀ƀeiu㗴㘉㘌tƀ;enሜ㗼㘂qĀ;qሢ㖲eqĀ;q㗧㗤m;櫈Ābp㘑㘓;櫔;櫖ƀAan㘜㘠㘭rr;懙rĀhr㘦㘨ë∮Ā;oਫwar;椪lig耻ß䃟㙑㙝㙠ዎ㙳㙹\0㙾㛂\0\0\0\0\0㛛㜃\0㜉㝬\0\0\0㞇ɲ㙖\0\0㙛get;挖;䏄rëƀaey㙦㙫㙰ron;䅥dil;䅣;䑂lrec;挕r;쀀𝔱Ȁeiko㚆㚝㚵㚼Dz㚋\0㚑eĀ4fኄኁaƀ;sv㚘㚙㚛䎸ym;䏑Ācn㚢㚲kĀas㚨㚮pproøim»ኬsðኞĀas㚺㚮ðrn耻þ䃾Ǭ̟㛆⋧es膀×;bd㛏㛐㛘䃗Ā;aᤏ㛕r;樱;樰ƀeps㛡㛣㜀á⩍Ȁ;bcf҆㛬㛰㛴ot;挶ir;櫱Ā;o㛹㛼쀀𝕥rk;櫚á㍢rime;怴ƀaip㜏㜒㝤dåቈadempst㜡㝍㝀㝑㝗㝜㝟ngleʀ;dlqr㜰㜱㜶㝀㝂斵own»ᶻeftĀ;e⠀㜾ñम;扜ightĀ;e㊪㝋ñၚot;旬inus;樺lus;樹b;槍ime;樻ezium;揢ƀcht㝲㝽㞁Āry㝷㝻;쀀𝓉;䑆cy;䑛rok;䅧Āio㞋㞎xôheadĀlr㞗㞠eftarro÷ࡏightarrow»ཝऀAHabcdfghlmoprstuw㟐㟓㟗㟤㟰㟼㠎㠜㠣㠴㡑㡝㡫㢩㣌㣒㣪㣶ròϭar;楣Ācr㟜㟢ute耻ú䃺òᅐrǣ㟪\0㟭y;䑞ve;䅭Āiy㟵㟺rc耻û䃻;䑃ƀabh㠃㠆㠋ròᎭlac;䅱aòᏃĀir㠓㠘sht;楾;쀀𝔲rave耻ù䃹š㠧㠱rĀlr㠬㠮»ॗ»ႃlk;斀Āct㠹㡍ɯ㠿\0\0㡊rnĀ;e㡅㡆挜r»㡆op;挏ri;旸Āal㡖㡚cr;䅫肻¨͉Āgp㡢㡦on;䅳f;쀀𝕦̀adhlsuᅋ㡸㡽፲㢑㢠ownáᎳarpoonĀlr㢈㢌efô㠭ighô㠯iƀ;hl㢙㢚㢜䏅»ᏺon»㢚parrows;懈ƀcit㢰㣄㣈ɯ㢶\0\0㣁rnĀ;e㢼㢽挝r»㢽op;挎ng;䅯ri;旹cr;쀀𝓊ƀdir㣙㣝㣢ot;拰lde;䅩iĀ;f㜰㣨»᠓Āam㣯㣲rò㢨l耻ü䃼angle;榧ހABDacdeflnoprsz㤜㤟㤩㤭㦵㦸㦽㧟㧤㧨㧳㧹㧽㨁㨠ròϷarĀ;v㤦㤧櫨;櫩asèϡĀnr㤲㤷grt;榜eknprst㓣㥆㥋㥒㥝㥤㦖appá␕othinçẖƀhir㓫⻈㥙opô⾵Ā;hᎷ㥢ïㆍĀiu㥩㥭gmá㎳Ābp㥲㦄setneqĀ;q㥽㦀쀀⊊︀;쀀⫋︀setneqĀ;q㦏㦒쀀⊋︀;쀀⫌︀Āhr㦛㦟etá㚜iangleĀlr㦪㦯eft»थight»ၑy;䐲ash»ံƀelr㧄㧒㧗ƀ;beⷪ㧋㧏ar;抻q;扚lip;拮Ābt㧜ᑨaòᑩr;쀀𝔳tré㦮suĀbp㧯㧱»ജ»൙pf;쀀𝕧roðtré㦴Ācu㨆㨋r;쀀𝓋Ābp㨐㨘nĀEe㦀㨖»㥾nĀEe㦒㨞»㦐igzag;榚cefoprs㨶㨻㩖㩛㩔㩡㩪irc;䅵Ādi㩀㩑Ābg㩅㩉ar;機eĀ;qᗺ㩏;扙erp;愘r;쀀𝔴pf;쀀𝕨Ā;eᑹ㩦atèᑹcr;쀀𝓌ૣណ㪇\0㪋\0㪐㪛\0\0㪝㪨㪫㪯\0\0㫃㫎\0㫘ៜtré៑r;쀀𝔵ĀAa㪔㪗ròσrò৶;䎾ĀAa㪡㪤ròθrò৫að✓is;拻ƀdptឤ㪵㪾Āfl㪺ឩ;쀀𝕩imåឲĀAa㫇㫊ròώròਁĀcq㫒ីr;쀀𝓍Āpt៖㫜ré។Ѐacefiosu㫰㫽㬈㬌㬑㬕㬛㬡cĀuy㫶㫻te耻ý䃽;䑏Āiy㬂㬆rc;䅷;䑋n耻¥䂥r;쀀𝔶cy;䑗pf;쀀𝕪cr;쀀𝓎Ācm㬦㬩y;䑎l耻ÿ䃿Ԁacdefhiosw㭂㭈㭔㭘㭤㭩㭭㭴㭺㮀cute;䅺Āay㭍㭒ron;䅾;䐷ot;䅼Āet㭝㭡træᕟa;䎶r;쀀𝔷cy;䐶grarr;懝pf;쀀𝕫cr;쀀𝓏Ājn㮅㮇;怍j;怌'.split("").map(e=>e.charCodeAt(0))),pa=new Uint16Array("Ȁaglq \x1Bɭ\0\0p;䀦os;䀧t;䀾t;䀼uot;䀢".split("").map(e=>e.charCodeAt(0)));var en;const ha=new Map([[0,65533],[128,8364],[130,8218],[131,402],[132,8222],[133,8230],[134,8224],[135,8225],[136,710],[137,8240],[138,352],[139,8249],[140,338],[142,381],[145,8216],[146,8217],[147,8220],[148,8221],[149,8226],[150,8211],[151,8212],[152,732],[153,8482],[154,353],[155,8250],[156,339],[158,382],[159,376]]),ga=(en=String.fromCodePoint)!==null&&en!==void 0?en:function(e){let t="";return e>65535&&(e-=65536,t+=String.fromCharCode(e>>>10&1023|55296),e=56320|e&1023),t+=String.fromCharCode(e),t};function ma(e){var t;return e>=55296&&e<=57343||e>1114111?65533:(t=ha.get(e))!==null&&t!==void 0?t:e}var ne;(function(e){e[e.NUM=35]="NUM",e[e.SEMI=59]="SEMI",e[e.EQUALS=61]="EQUALS",e[e.ZERO=48]="ZERO",e[e.NINE=57]="NINE",e[e.LOWER_A=97]="LOWER_A",e[e.LOWER_F=102]="LOWER_F",e[e.LOWER_X=120]="LOWER_X",e[e.LOWER_Z=122]="LOWER_Z",e[e.UPPER_A=65]="UPPER_A",e[e.UPPER_F=70]="UPPER_F",e[e.UPPER_Z=90]="UPPER_Z"})(ne||(ne={}));const _a=32;var Re;(function(e){e[e.VALUE_LENGTH=49152]="VALUE_LENGTH",e[e.BRANCH_LENGTH=16256]="BRANCH_LENGTH",e[e.JUMP_TABLE=127]="JUMP_TABLE"})(Re||(Re={}));function tn(e){return e>=ne.ZERO&&e<=ne.NINE}function Ea(e){return e>=ne.UPPER_A&&e<=ne.UPPER_F||e>=ne.LOWER_A&&e<=ne.LOWER_F}function xa(e){return e>=ne.UPPER_A&&e<=ne.UPPER_Z||e>=ne.LOWER_A&&e<=ne.LOWER_Z||tn(e)}function ka(e){return e===ne.EQUALS||xa(e)}var ue;(function(e){e[e.EntityStart=0]="EntityStart",e[e.NumericStart=1]="NumericStart",e[e.NumericDecimal=2]="NumericDecimal",e[e.NumericHex=3]="NumericHex",e[e.NamedEntity=4]="NamedEntity"})(ue||(ue={}));var De;(function(e){e[e.Legacy=0]="Legacy",e[e.Strict=1]="Strict",e[e.Attribute=2]="Attribute"})(De||(De={}));class ya{constructor(t,n,u){this.decodeTree=t,this.emitCodePoint=n,this.errors=u,this.state=ue.EntityStart,this.consumed=1,this.result=0,this.treeIndex=0,this.excess=1,this.decodeMode=De.Strict}startEntity(t){this.decodeMode=t,this.state=ue.EntityStart,this.result=0,this.treeIndex=0,this.excess=1,this.consumed=1}write(t,n){switch(this.state){case ue.EntityStart:return t.charCodeAt(n)===ne.NUM?(this.state=ue.NumericStart,this.consumed+=1,this.stateNumericStart(t,n+1)):(this.state=ue.NamedEntity,this.stateNamedEntity(t,n));case ue.NumericStart:return this.stateNumericStart(t,n);case ue.NumericDecimal:return this.stateNumericDecimal(t,n);case ue.NumericHex:return this.stateNumericHex(t,n);case ue.NamedEntity:return this.stateNamedEntity(t,n)}}stateNumericStart(t,n){return n>=t.length?-1:(t.charCodeAt(n)|_a)===ne.LOWER_X?(this.state=ue.NumericHex,this.consumed+=1,this.stateNumericHex(t,n+1)):(this.state=ue.NumericDecimal,this.stateNumericDecimal(t,n))}addToNumericResult(t,n,u,r){if(n!==u){const i=u-n;this.result=this.result*Math.pow(r,i)+parseInt(t.substr(n,i),r),this.consumed+=i}}stateNumericHex(t,n){const u=n;for(;n<t.length;){const r=t.charCodeAt(n);if(tn(r)||Ea(r))n+=1;else return this.addToNumericResult(t,u,n,16),this.emitNumericEntity(r,3)}return this.addToNumericResult(t,u,n,16),-1}stateNumericDecimal(t,n){const u=n;for(;n<t.length;){const r=t.charCodeAt(n);if(tn(r))n+=1;else return this.addToNumericResult(t,u,n,10),this.emitNumericEntity(r,2)}return this.addToNumericResult(t,u,n,10),-1}emitNumericEntity(t,n){var u;if(this.consumed<=n)return(u=this.errors)===null||u===void 0||u.absenceOfDigitsInNumericCharacterReference(this.consumed),0;if(t===ne.SEMI)this.consumed+=1;else if(this.decodeMode===De.Strict)return 0;return this.emitCodePoint(ma(this.result),this.consumed),this.errors&&(t!==ne.SEMI&&this.errors.missingSemicolonAfterCharacterReference(),this.errors.validateNumericCharacterReference(this.result)),this.consumed}stateNamedEntity(t,n){const{decodeTree:u}=this;let r=u[this.treeIndex],i=(r&Re.VALUE_LENGTH)>>14;for(;n<t.length;n++,this.excess++){const a=t.charCodeAt(n);if(this.treeIndex=Aa(u,r,this.treeIndex+Math.max(1,i),a),this.treeIndex<0)return this.result===0||this.decodeMode===De.Attribute&&(i===0||ka(a))?0:this.emitNotTerminatedNamedEntity();if(r=u[this.treeIndex],i=(r&Re.VALUE_LENGTH)>>14,i!==0){if(a===ne.SEMI)return this.emitNamedEntityData(this.treeIndex,i,this.consumed+this.excess);this.decodeMode!==De.Strict&&(this.result=this.treeIndex,this.consumed+=this.excess,this.excess=0)}}return-1}emitNotTerminatedNamedEntity(){var t;const{result:n,decodeTree:u}=this,r=(u[n]&Re.VALUE_LENGTH)>>14;return this.emitNamedEntityData(n,r,this.consumed),(t=this.errors)===null||t===void 0||t.missingSemicolonAfterCharacterReference(),this.consumed}emitNamedEntityData(t,n,u){const{decodeTree:r}=this;return this.emitCodePoint(n===1?r[t]&~Re.VALUE_LENGTH:r[t+1],u),n===3&&this.emitCodePoint(r[t+2],u),u}end(){var t;switch(this.state){case ue.NamedEntity:return this.result!==0&&(this.decodeMode!==De.Attribute||this.result===this.treeIndex)?this.emitNotTerminatedNamedEntity():0;case ue.NumericDecimal:return this.emitNumericEntity(0,2);case ue.NumericHex:return this.emitNumericEntity(0,3);case ue.NumericStart:return(t=this.errors)===null||t===void 0||t.absenceOfDigitsInNumericCharacterReference(this.consumed),0;case ue.EntityStart:return 0}}}function ku(e){let t="";const n=new ya(e,u=>t+=ga(u));return function(r,i){let a=0,o=0;for(;(o=r.indexOf("&",o))>=0;){t+=r.slice(a,o),n.startEntity(i);const c=n.write(r,o+1);if(c<0){a=o+n.end();break}a=o+c,o=c===0?a+1:a}const s=t+r.slice(a);return t="",s}}function Aa(e,t,n,u){const r=(t&Re.BRANCH_LENGTH)>>7,i=t&Re.JUMP_TABLE;if(r===0)return i!==0&&u===i?n:-1;if(i){const s=u-i;return s<0||s>=r?-1:e[n+s]-1}let a=n,o=a+r-1;for(;a<=o;){const s=a+o>>>1,c=e[s];if(c<u)a=s+1;else if(c>u)o=s-1;else return e[s+r]}return-1}const yu=ku(ba);ku(pa);function wa(e,t=De.Legacy){return yu(e,t)}function Ca(e){return yu(e,De.Strict)}function va(e){return Object.prototype.toString.call(e)}function nn(e){return va(e)==="[object String]"}const Na=Object.prototype.hasOwnProperty;function Da(e,t){return Na.call(e,t)}function Dt(e){return Array.prototype.slice.call(arguments,1).forEach(function(n){if(n){if(typeof n!="object")throw new TypeError(n+"must be object");Object.keys(n).forEach(function(u){e[u]=n[u]})}}),e}function Sa(e,t,n){return[].concat(e.slice(0,t),n,e.slice(t+1))}function un(e){return!(e>=55296&&e<=57343||e>=64976&&e<=65007||(e&65535)===65535||(e&65535)===65534||e>=0&&e<=8||e===11||e>=14&&e<=31||e>=127&&e<=159||e>1114111)}function ot(e){if(e>65535){e-=65536;const t=55296+(e>>10),n=56320+(e&1023);return String.fromCharCode(t,n)}return String.fromCharCode(e)}const Au=/\\([!"#$%&'()*+,\-./:;<=>?@[\\\]^_`{|}~])/g,Ta=/&([a-z#][a-z0-9]{1,31});/gi,Oa=new RegExp(Au.source+"|"+Ta.source,"gi"),Ra=/^#((?:x[a-f0-9]{1,8}|[0-9]{1,8}))$/i;function Ma(e,t){if(t.charCodeAt(0)===35&&Ra.test(t)){const u=t[1].toLowerCase()==="x"?parseInt(t.slice(2),16):parseInt(t.slice(1),10);return un(u)?ot(u):e}const n=wa(e);return n!==e?n:e}function Ia(e){return e.indexOf("\\")<0?e:e.replace(Au,"$1")}function Xe(e){return e.indexOf("\\")<0&&e.indexOf("&")<0?e:e.replace(Oa,function(t,n,u){return n||Ma(t,u)})}const Fa=/[&<>"]/,La=/[&<>"]/g,Ba={"&":"&","<":"<",">":">",'"':"""};function Pa(e){return Ba[e]}function Me(e){return Fa.test(e)?e.replace(La,Pa):e}const za=/[.?*+^$[\]\\(){}|-]/g;function Ua(e){return e.replace(za,"\\$&")}function K(e){switch(e){case 9:case 32:return!0}return!1}function st(e){if(e>=8192&&e<=8202)return!0;switch(e){case 9:case 10:case 11:case 12:case 13:case 32:case 160:case 5760:case 8239:case 8287:case 12288:return!0}return!1}function wu(e){return jt.test(e)||Eu.test(e)}function ct(e){return wu(ot(e))}function lt(e){switch(e){case 33:case 34:case 35:case 36:case 37:case 38:case 39:case 40:case 41:case 42:case 43:case 44:case 45:case 46:case 47:case 58:case 59:case 60:case 61:case 62:case 63:case 64:case 91:case 92:case 93:case 94:case 95:case 96:case 123:case 124:case 125:case 126:return!0;default:return!1}}function St(e){return e=e.trim().replace(/\s+/g," "),"ẞ".toLowerCase()==="Ṿ"&&(e=e.replace(/ẞ/g,"ß")),e.toLowerCase().toUpperCase()}function Cu(e){return e===32||e===9||e===10||e===13}function Tt(e){let t=0;for(;t<e.length&&Cu(e.charCodeAt(t));t++);let n=e.length-1;for(;n>=t&&Cu(e.charCodeAt(n));n--);return e.slice(t,n+1)}const $a=Object.freeze(Object.defineProperty({__proto__:null,arrayReplaceAt:Sa,asciiTrim:Tt,assign:Dt,escapeHtml:Me,escapeRE:Ua,fromCodePoint:ot,has:Da,isMdAsciiPunct:lt,isPunctChar:wu,isPunctCharCode:ct,isSpace:K,isString:nn,isValidEntityCode:un,isWhiteSpace:st,lib:{mdurl:la,ucmicro:fa},normalizeReference:St,unescapeAll:Xe,unescapeMd:Ia},Symbol.toStringTag,{value:"Module"}));function qa(e,t,n){let u,r,i,a;const o=e.posMax,s=e.pos;for(e.pos=t+1,u=1;e.pos<o;){if(i=e.src.charCodeAt(e.pos),i===93&&(u--,u===0)){r=!0;break}if(a=e.pos,e.md.inline.skipToken(e),i===91){if(a===e.pos-1)u++;else if(n)return e.pos=s,-1}}let c=-1;return r&&(c=e.pos),e.pos=s,c}function Ha(e,t,n){let u,r=t;const i={ok:!1,pos:0,str:""};if(e.charCodeAt(r)===60){for(r++;r<n;){if(u=e.charCodeAt(r),u===10||u===60)return i;if(u===62)return i.pos=r+1,i.str=Xe(e.slice(t+1,r)),i.ok=!0,i;if(u===92&&r+1<n){r+=2;continue}r++}return i}let a=0;for(;r<n&&(u=e.charCodeAt(r),!(u===32||u<32||u===127));){if(u===92&&r+1<n){if(e.charCodeAt(r+1)===32){r++;continue}r+=2;continue}if(u===40&&(a++,a>32))return i;if(u===41){if(a===0)break;a--}r++}return t===r||a!==0||(i.str=Xe(e.slice(t,r)),i.pos=r,i.ok=!0),i}function Ga(e,t,n,u){let r,i=t;const a={ok:!1,can_continue:!1,pos:0,str:"",marker:0};if(u)a.str=u.str,a.marker=u.marker;else{if(i>=n)return a;let o=e.charCodeAt(i);if(o!==34&&o!==39&&o!==40)return a;t++,i++,o===40&&(o=41),a.marker=o}for(;i<n;){if(r=e.charCodeAt(i),r===a.marker)return a.pos=i+1,a.str+=Xe(e.slice(t,i)),a.ok=!0,a;if(r===40&&a.marker===41)return a;r===92&&i+1<n&&i++,i++}return a.can_continue=!0,a.str+=Xe(e.slice(t,i)),a}const Ka=Object.freeze(Object.defineProperty({__proto__:null,parseLinkDestination:Ha,parseLinkLabel:qa,parseLinkTitle:Ga},Symbol.toStringTag,{value:"Module"})),ye={};ye.code_inline=function(e,t,n,u,r){const i=e[t];return"<code"+r.renderAttrs(i)+">"+Me(i.content)+"</code>"},ye.code_block=function(e,t,n,u,r){const i=e[t];return"<pre"+r.renderAttrs(i)+"><code>"+Me(e[t].content)+`</code></pre>
- Dismissed after review: Contains 3 bidirectional-override character(s), which make text display in a different order from how it's read
- Line 15 on GitHub
- `},ye.fence=function(e,t,n,u,r){const i=e[t],a=i.info?Xe(i.info).trim():"";let o="",s="";if(a){const l=a.split(/(\s+)/g);o=l[0],s=l.slice(2).join("")}let c;if(n.highlight?c=n.highlight(i.content,o,s)||Me(i.content):c=Me(i.content),c.indexOf("<pre")===0)return c+`
- `;if(a){const l=i.attrIndex("class"),f=i.attrs?i.attrs.slice():[];l<0?f.push(["class",n.langPrefix+o]):(f[l]=f[l].slice(),f[l][1]+=" "+n.langPrefix+o);const h={attrs:f};return`<pre><code${r.renderAttrs(h)}>${c}</code></pre>
- `}return`<pre><code${r.renderAttrs(i)}>${c}</code></pre>
- `},ye.image=function(e,t,n,u,r){const i=e[t];return i.attrs[i.attrIndex("alt")][1]=r.renderInlineAsText(i.children,n,u),r.renderToken(e,t,n)},ye.hardbreak=function(e,t,n){return n.xhtmlOut?`<br />
- `:`<br>
- `},ye.softbreak=function(e,t,n){return n.breaks?n.xhtmlOut?`<br />
- `:`<br>
- `:`
- `},ye.text=function(e,t){return Me(e[t].content)},ye.html_block=function(e,t){return e[t].content},ye.html_inline=function(e,t){return e[t].content};function Qe(){this.rules=Dt({},ye)}Qe.prototype.renderAttrs=function(t){let n,u,r;if(!t.attrs)return"";for(r="",n=0,u=t.attrs.length;n<u;n++)r+=" "+Me(t.attrs[n][0])+'="'+Me(t.attrs[n][1])+'"';return r},Qe.prototype.renderToken=function(t,n,u){const r=t[n];let i="";if(r.hidden)return"";r.block&&r.nesting!==-1&&n&&t[n-1].hidden&&(i+=`
- `),i+=(r.nesting===-1?"</":"<")+r.tag,i+=this.renderAttrs(r),r.nesting===0&&u.xhtmlOut&&(i+=" /");let a=!1;if(r.block&&(a=!0,r.nesting===1&&n+1<t.length)){const o=t[n+1];(o.type==="inline"||o.hidden||o.nesting===-1&&o.tag===r.tag)&&(a=!1)}return i+=a?`>
- `:">",i},Qe.prototype.renderInline=function(e,t,n){let u="";const r=this.rules;for(let i=0,a=e.length;i<a;i++){const o=e[i].type;typeof r[o]<"u"?u+=r[o](e,i,t,n,this):u+=this.renderToken(e,i,t)}return u},Qe.prototype.renderInlineAsText=function(e,t,n){let u="";for(let r=0,i=e.length;r<i;r++)switch(e[r].type){case"text":u+=e[r].content;break;case"image":u+=this.renderInlineAsText(e[r].children,t,n);break;case"html_inline":case"html_block":u+=e[r].content;break;case"softbreak":case"hardbreak":u+=`
- `;break}return u},Qe.prototype.render=function(e,t,n){let u="";const r=this.rules;for(let i=0,a=e.length;i<a;i++){const o=e[i].type;o==="inline"?u+=this.renderInline(e[i].children,t,n):typeof r[o]<"u"?u+=r[o](e,i,t,n,this):u+=this.renderToken(e,i,t,n)}return u};function be(){this.__rules__=[],this.__cache__=null}be.prototype.__find__=function(e){for(let t=0;t<this.__rules__.length;t++)if(this.__rules__[t].name===e)return t;return-1},be.prototype.__compile__=function(){const e=this,t=[""];e.__rules__.forEach(function(n){n.enabled&&n.alt.forEach(function(u){t.indexOf(u)<0&&t.push(u)})}),e.__cache__={},t.forEach(function(n){e.__cache__[n]=[],e.__rules__.forEach(function(u){u.enabled&&(n&&u.alt.indexOf(n)<0||e.__cache__[n].push(u.fn))})})},be.prototype.at=function(e,t,n){const u=this.__find__(e),r=n||{};if(u===-1)throw new Error("Parser rule not found: "+e);this.__rules__[u].fn=t,this.__rules__[u].alt=r.alt||[],this.__cache__=null},be.prototype.before=function(e,t,n,u){const r=this.__find__(e),i=u||{};if(r===-1)throw new Error("Parser rule not found: "+e);this.__rules__.splice(r,0,{name:t,enabled:!0,fn:n,alt:i.alt||[]}),this.__cache__=null},be.prototype.after=function(e,t,n,u){const r=this.__find__(e),i=u||{};if(r===-1)throw new Error("Parser rule not found: "+e);this.__rules__.splice(r+1,0,{name:t,enabled:!0,fn:n,alt:i.alt||[]}),this.__cache__=null},be.prototype.push=function(e,t,n){const u=n||{};this.__rules__.push({name:e,enabled:!0,fn:t,alt:u.alt||[]}),this.__cache__=null},be.prototype.enable=function(e,t){Array.isArray(e)||(e=[e]);const n=[];return e.forEach(function(u){const r=this.__find__(u);if(r<0){if(t)return;throw new Error("Rules manager: invalid rule name "+u)}this.__rules__[r].enabled=!0,n.push(u)},this),this.__cache__=null,n},be.prototype.enableOnly=function(e,t){Array.isArray(e)||(e=[e]),this.__rules__.forEach(function(n){n.enabled=!1}),this.enable(e,t)},be.prototype.disable=function(e,t){Array.isArray(e)||(e=[e]);const n=[];return e.forEach(function(u){const r=this.__find__(u);if(r<0){if(t)return;throw new Error("Rules manager: invalid rule name "+u)}this.__rules__[r].enabled=!1,n.push(u)},this),this.__cache__=null,n},be.prototype.getRules=function(e){return this.__cache__===null&&this.__compile__(),this.__cache__[e]||[]};function Ee(e,t,n){this.type=e,this.tag=t,this.attrs=null,this.map=null,this.nesting=n,this.level=0,this.children=null,this.content="",this.markup="",this.info="",this.meta=null,this.block=!1,this.hidden=!1}Ee.prototype.attrIndex=function(t){if(!this.attrs)return-1;const n=this.attrs;for(let u=0,r=n.length;u<r;u++)if(n[u][0]===t)return u;return-1},Ee.prototype.attrPush=function(t){this.attrs?this.attrs.push(t):this.attrs=[t]},Ee.prototype.attrSet=function(t,n){const u=this.attrIndex(t),r=[t,n];u<0?this.attrPush(r):this.attrs[u]=r},Ee.prototype.attrGet=function(t){const n=this.attrIndex(t);let u=null;return n>=0&&(u=this.attrs[n][1]),u},Ee.prototype.attrJoin=function(t,n){const u=this.attrIndex(t);u<0?this.attrPush([t,n]):this.attrs[u][1]=this.attrs[u][1]+" "+n};function vu(e,t,n){this.src=e,this.env=n,this.tokens=[],this.inlineMode=!1,this.md=t}vu.prototype.Token=Ee;const Za=/\r\n?|\n/g,Wa=/\0/g;function Ya(e){let t;t=e.src.replace(Za,`
- `),t=t.replace(Wa,"�"),e.src=t}function Va(e){let t;e.inlineMode?(t=new e.Token("inline","",0),t.content=e.src,t.map=[0,1],t.children=[],e.tokens.push(t)):e.md.block.parse(e.src,e.md,e.env,e.tokens)}function Xa(e){const t=e.tokens;for(let n=0,u=t.length;n<u;n++){const r=t[n];r.type==="inline"&&e.md.inline.parse(r.content,e.md,e.env,r.children)}}function Qa(e){return/^<a[>\s]/i.test(e)}function Ja(e){return/^<\/a\s*>/i.test(e)}function ja(e){const t=e.tokens;if(e.md.options.linkify)for(let n=0,u=t.length;n<u;n++){if(t[n].type!=="inline"||!e.md.linkify.pretest(t[n].content))continue;const r=t[n].children,i=[];let a=0;for(let o=r.length-1;o>=0;o--){const s=r[o];if(s.type==="link_close"){for(o--;r[o].level!==s.level&&r[o].type!=="link_open";)o--;continue}if(s.type==="html_inline"&&(Qa(s.content)&&a>0&&a--,Ja(s.content)&&a++),!(a>0)&&s.type==="text"&&e.md.linkify.test(s.content)){const c=s.content;let l=e.md.linkify.match(c);const f=[];let h=s.level,p=0;l.length>0&&l[0].index===0&&o>0&&r[o-1].type==="text_special"&&(l=l.slice(1));for(let b=0;b<l.length;b++){const E=l[b].url,_=e.md.normalizeLink(E);if(!e.md.validateLink(_))continue;let g=l[b].text;l[b].schema?l[b].schema==="mailto:"&&!/^mailto:/i.test(g)?g=e.md.normalizeLinkText("mailto:"+g).replace(/^mailto:/,""):g=e.md.normalizeLinkText(g):g=e.md.normalizeLinkText("http://"+g).replace(/^http:\/\//,"");const v=l[b].index;if(v>p){const k=new e.Token("text","",0);k.content=c.slice(p,v),k.level=h,f.push(k)}const w=new e.Token("link_open","a",1);w.attrs=[["href",_]],w.level=h++,w.markup="linkify",w.info="auto",f.push(w);const x=new e.Token("text","",0);x.content=g,x.level=h,f.push(x);const y=new e.Token("link_close","a",-1);y.level=--h,y.markup="linkify",y.info="auto",f.push(y),p=l[b].lastIndex}if(p<c.length){const b=new e.Token("text","",0);b.content=c.slice(p),b.level=h,f.push(b)}i.push({index:o,nodes:f})}}if(i.length>0){let o=r.length;for(const f of i)o+=f.nodes.length-1;const s=new Array(o);let c=0,l=0;i.reverse();for(let f=0;f<r.length;f++){const h=i[c];if(h?.index===f){for(const p of h.nodes)s[l++]=p;c++}else s[l++]=r[f]}t[n].children=s}}}const Nu=/\+-|\.\.|\?\?\?\?|!!!!|,,|--/,eo=/\((c|tm|r)\)/i,to=/\((c|tm|r)\)/ig,no={c:"©",r:"®",tm:"™"};function uo(e,t){return no[t.toLowerCase()]}function ro(e){let t=0;for(let n=e.length-1;n>=0;n--){const u=e[n];u.type==="text"&&!t&&(u.content=u.content.replace(to,uo)),u.type==="link_open"&&u.info==="auto"&&t--,u.type==="link_close"&&u.info==="auto"&&t++}}function io(e){let t=0;for(let n=e.length-1;n>=0;n--){const u=e[n];u.type==="text"&&!t&&Nu.test(u.content)&&(u.content=u.content.replace(/\+-/g,"±").replace(/\.{2,}/g,"…").replace(/([?!])…/g,"$1..").replace(/([?!]){4,}/g,"$1$1$1").replace(/,{2,}/g,",").replace(/(^|[^-])---(?=[^-]|$)/mg,"$1—").replace(/(^|\s)--(?=\s|$)/mg,"$1–").replace(/(^|[^-\s])--(?=[^-\s]|$)/mg,"$1–")),u.type==="link_open"&&u.info==="auto"&&t--,u.type==="link_close"&&u.info==="auto"&&t++}}function ao(e){let t;if(e.md.options.typographer)for(t=e.tokens.length-1;t>=0;t--)e.tokens[t].type==="inline"&&(eo.test(e.tokens[t].content)&&ro(e.tokens[t].children),Nu.test(e.tokens[t].content)&&io(e.tokens[t].children))}const oo=/['"]/,Du=/['"]/g,Su="’",so=1e3;function Tu(e,t,n){for(;e.length>n;){const u=e.pop();u.isSingleQuote?t.single=u.prevSameQuoteIdx:t.double=u.prevSameQuoteIdx}}function Ot(e,t,n,u){e[t]||(e[t]=[]),e[t].push({pos:n,ch:u})}function co(e,t){let n="",u=0;t.sort((r,i)=>r.pos-i.pos);for(let r=0;r<t.length;r++){const i=t[r];n+=e.slice(u,i.pos)+i.ch,u=i.pos+1}return n+e.slice(u)}function lo(e,t){let n;const u=[],r={single:-1,double:-1},i={};for(let a=0;a<e.length;a++){const o=e[a],s=e[a].level;for(n=u.length-1;n>=0&&!(u[n].level<=s);n--);if(Tu(u,r,n+1),o.type!=="text")continue;const c=o.content;let l=0;const f=c.length;e:for(;l<f;){Du.lastIndex=l;const h=Du.exec(c);if(!h)break;let p=!0,b=!0;l=h.index+1;const E=h[0]==="'";let _=32;if(h.index-1>=0)_=c.charCodeAt(h.index-1);else for(n=a-1;n>=0&&!(e[n].type==="softbreak"||e[n].type==="hardbreak");n--)if(e[n].content){_=e[n].content.charCodeAt(e[n].content.length-1);break}let g=32;if(l<f)g=c.charCodeAt(l);else for(n=a+1;n<e.length&&!(e[n].type==="softbreak"||e[n].type==="hardbreak");n++)if(e[n].content){g=e[n].content.charCodeAt(0);break}const v=lt(_)||ct(_),w=lt(g)||ct(g),x=st(_),y=st(g);if(y?p=!1:w&&(x||v||(p=!1)),x?b=!1:v&&(y||w||(b=!1)),g===34&&h[0]==='"'&&_>=48&&_<=57&&(b=p=!1),p&&b&&(p=v,b=w),!p&&!b){E&&Ot(i,a,h.index,Su);continue}if(b&&(n=E?r.single:r.double,n>=0&&u[n].level===s)){const k=u[n];let S,F;E?(S=t.md.options.quotes[2],F=t.md.options.quotes[3]):(S=t.md.options.quotes[0],F=t.md.options.quotes[1]),Ot(i,a,h.index,F),Ot(i,k.tokenIdx,k.contentPos,S),Tu(u,r,n);continue e}if(p){if(u.length>=so)return;u.push({tokenIdx:a,contentPos:h.index,isSingleQuote:E,level:s,prevSameQuoteIdx:E?r.single:r.double}),E?r.single=u.length-1:r.double=u.length-1}else b&&E&&Ot(i,a,h.index,Su)}}Object.keys(i).forEach(function(a){e[a].content=co(e[a].content,i[a])})}function fo(e){if(e.md.options.typographer)for(let t=e.tokens.length-1;t>=0;t--)e.tokens[t].type!=="inline"||!oo.test(e.tokens[t].content)||lo(e.tokens[t].children,e)}function bo(e){let t,n;const u=e.tokens,r=u.length;for(let i=0;i<r;i++){if(u[i].type!=="inline")continue;const a=u[i].children,o=a.length;for(t=0;t<o;t++)a[t].type==="text_special"&&(a[t].type="text");for(t=n=0;t<o;t++)a[t].type==="text"&&t+1<o&&a[t+1].type==="text"?a[t+1].content=a[t].content+a[t+1].content:(t!==n&&(a[n]=a[t]),n++);t!==n&&(a.length=n)}}const rn=[["normalize",Ya],["block",Va],["inline",Xa],["linkify",ja],["replacements",ao],["smartquotes",fo],["text_join",bo]];function an(){this.ruler=new be;for(let e=0;e<rn.length;e++)this.ruler.push(rn[e][0],rn[e][1])}an.prototype.process=function(e){const t=this.ruler.getRules("");for(let n=0,u=t.length;n<u;n++)t[n](e)},an.prototype.State=vu;function Ae(e,t,n,u){this.src=e,this.md=t,this.env=n,this.tokens=u,this.bMarks=[],this.eMarks=[],this.tShift=[],this.sCount=[],this.bsCount=[],this.blkIndent=0,this.line=0,this.lineMax=0,this.tight=!1,this.ddIndent=-1,this.listIndent=-1,this.parentType="root",this.level=0;const r=this.src;for(let i=0,a=0,o=0,s=0,c=r.length,l=!1;a<c;a++){const f=r.charCodeAt(a);if(!l)if(K(f)){o++,f===9?s+=4-s%4:s++;continue}else l=!0;(f===10||a===c-1)&&(f!==10&&a++,this.bMarks.push(i),this.eMarks.push(a),this.tShift.push(o),this.sCount.push(s),this.bsCount.push(0),l=!1,o=0,s=0,i=a+1)}this.bMarks.push(r.length),this.eMarks.push(r.length),this.tShift.push(0),this.sCount.push(0),this.bsCount.push(0),this.lineMax=this.bMarks.length-1}Ae.prototype.push=function(e,t,n){const u=new Ee(e,t,n);return u.block=!0,n<0&&this.level--,u.level=this.level,n>0&&this.level++,this.tokens.push(u),u},Ae.prototype.isEmpty=function(t){return this.bMarks[t]+this.tShift[t]>=this.eMarks[t]},Ae.prototype.skipEmptyLines=function(t){for(let n=this.lineMax;t<n&&!(this.bMarks[t]+this.tShift[t]<this.eMarks[t]);t++);return t},Ae.prototype.skipSpaces=function(t){for(let n=this.src.length;t<n;t++){const u=this.src.charCodeAt(t);if(!K(u))break}return t},Ae.prototype.skipSpacesBack=function(t,n){if(t<=n)return t;for(;t>n;)if(!K(this.src.charCodeAt(--t)))return t+1;return t},Ae.prototype.skipChars=function(t,n){for(let u=this.src.length;t<u&&this.src.charCodeAt(t)===n;t++);return t},Ae.prototype.skipCharsBack=function(t,n,u){if(t<=u)return t;for(;t>u;)if(n!==this.src.charCodeAt(--t))return t+1;return t},Ae.prototype.getLines=function(t,n,u,r){if(t>=n)return"";const i=new Array(n-t);for(let a=0,o=t;o<n;o++,a++){let s=0;const c=this.bMarks[o];let l=c,f;for(o+1<n||r?f=this.eMarks[o]+1:f=this.eMarks[o];l<f&&s<u;){const h=this.src.charCodeAt(l);if(K(h))h===9?s+=4-(s+this.bsCount[o])%4:s++;else if(l-c<this.tShift[o])s++;else break;l++}s>u?i[a]=new Array(s-u+1).join(" ")+this.src.slice(l,f):i[a]=this.src.slice(l,f)}return i.join("")},Ae.prototype.Token=Ee;const po=65536;function on(e,t){const n=e.bMarks[t]+e.tShift[t],u=e.eMarks[t];return e.src.slice(n,u)}function Ou(e){const t=[],n=e.length;let u=0,r=e.charCodeAt(u),i=!1,a=0,o="";for(;u<n;)r===124&&(i?(o+=e.substring(a,u-1),a=u):(t.push(o+e.substring(a,u)),o="",a=u+1)),i=r===92,u++,r=e.charCodeAt(u);return t.push(o+e.substring(a)),t}function ho(e,t,n,u){if(t+2>n)return!1;let r=t+1;if(e.sCount[r]<e.blkIndent||e.sCount[r]-e.blkIndent>=4)return!1;let i=e.bMarks[r]+e.tShift[r];if(i>=e.eMarks[r])return!1;const a=e.src.charCodeAt(i++);if(a!==124&&a!==45&&a!==58||i>=e.eMarks[r])return!1;const o=e.src.charCodeAt(i++);if(o!==124&&o!==45&&o!==58&&!K(o)||a===45&&K(o))return!1;for(;i<e.eMarks[r];){const x=e.src.charCodeAt(i);if(x!==124&&x!==45&&x!==58&&!K(x))return!1;i++}let s=on(e,t+1),c=s.split("|");const l=[];for(let x=0;x<c.length;x++){const y=c[x].trim();if(!y){if(x===0||x===c.length-1)continue;return!1}if(!/^:?-+:?$/.test(y))return!1;y.charCodeAt(y.length-1)===58?l.push(y.charCodeAt(0)===58?"center":"right"):y.charCodeAt(0)===58?l.push("left"):l.push("")}if(s=on(e,t).trim(),s.indexOf("|")===-1||e.sCount[t]-e.blkIndent>=4)return!1;c=Ou(s),c.length&&c[0]===""&&c.shift(),c.length&&c[c.length-1]===""&&c.pop();const f=c.length;if(f===0||f!==l.length)return!1;if(u)return!0;const h=e.parentType;e.parentType="table";const p=e.md.block.ruler.getRules("blockquote"),b=e.push("table_open","table",1),E=[t,0];b.map=E;const _=e.push("thead_open","thead",1);_.map=[t,t+1];const g=e.push("tr_open","tr",1);g.map=[t,t+1];for(let x=0;x<c.length;x++){const y=e.push("th_open","th",1);l[x]&&(y.attrs=[["style","text-align:"+l[x]]]);const k=e.push("inline","",0);k.content=c[x].trim(),k.children=[],e.push("th_close","th",-1)}e.push("tr_close","tr",-1),e.push("thead_close","thead",-1);let v,w=0;for(r=t+2;r<n&&!(e.sCount[r]<e.blkIndent);r++){let x=!1;for(let k=0,S=p.length;k<S;k++)if(p[k](e,r,n,!0)){x=!0;break}if(x||(s=on(e,r).trim(),!s)||e.sCount[r]-e.blkIndent>=4||(c=Ou(s),c.length&&c[0]===""&&c.shift(),c.length&&c[c.length-1]===""&&c.pop(),w+=f-c.length,w>po))break;if(r===t+2){const k=e.push("tbody_open","tbody",1);k.map=v=[t+2,0]}const y=e.push("tr_open","tr",1);y.map=[r,r+1];for(let k=0;k<f;k++){const S=e.push("td_open","td",1);l[k]&&(S.attrs=[["style","text-align:"+l[k]]]);const F=e.push("inline","",0);F.content=c[k]?c[k].trim():"",F.children=[],e.push("td_close","td",-1)}e.push("tr_close","tr",-1)}return v&&(e.push("tbody_close","tbody",-1),v[1]=r),e.push("table_close","table",-1),E[1]=r,e.parentType=h,e.line=r,!0}function go(e,t,n){if(e.sCount[t]-e.blkIndent<4)return!1;let u=t+1,r=u;for(;u<n;){if(e.isEmpty(u)){u++;continue}if(e.sCount[u]-e.blkIndent>=4){u++,r=u;continue}break}e.line=r;const i=e.push("code_block","code",0);return i.content=e.getLines(t,r,4+e.blkIndent,!1)+`
- `,i.map=[t,e.line],!0}function mo(e,t,n,u){let r=e.bMarks[t]+e.tShift[t],i=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4||r+3>i)return!1;const a=e.src.charCodeAt(r);if(a!==126&&a!==96)return!1;let o=r;r=e.skipChars(r,a);let s=r-o;if(s<3)return!1;const c=e.src.slice(o,r),l=e.src.slice(r,i);if(a===96&&l.indexOf(String.fromCharCode(a))>=0)return!1;if(u)return!0;let f=t,h=!1;for(;f++,!(f>=n||(r=o=e.bMarks[f]+e.tShift[f],i=e.eMarks[f],r<i&&e.sCount[f]<e.blkIndent));)if(e.src.charCodeAt(r)===a&&!(e.sCount[f]-e.blkIndent>=4)&&(r=e.skipChars(r,a),!(r-o<s)&&(r=e.skipSpaces(r),!(r<i)))){h=!0;break}s=e.sCount[t],e.line=f+(h?1:0);const p=e.push("fence","code",0);return p.info=l,p.content=e.getLines(t+1,f,s,!0),p.markup=c,p.map=[t,e.line],!0}function _o(e,t,n,u){let r=e.bMarks[t]+e.tShift[t],i=e.eMarks[t];const a=e.lineMax;if(e.sCount[t]-e.blkIndent>=4||e.src.charCodeAt(r)!==62)return!1;if(u)return!0;const o=[],s=[],c=[],l=[],f=e.md.block.ruler.getRules("blockquote"),h=e.parentType;e.parentType="blockquote";let p=!1,b;for(b=t;b<n;b++){const w=e.sCount[b]<e.blkIndent;if(r=e.bMarks[b]+e.tShift[b],i=e.eMarks[b],r>=i)break;if(e.src.charCodeAt(r++)===62&&!w){let y=e.sCount[b]+1,k,S;e.src.charCodeAt(r)===32?(r++,y++,S=!1,k=!0):e.src.charCodeAt(r)===9?(k=!0,(e.bsCount[b]+y)%4===3?(r++,y++,S=!1):S=!0):k=!1;let F=y;for(o.push(e.bMarks[b]),e.bMarks[b]=r;r<i;){const z=e.src.charCodeAt(r);if(K(z))z===9?F+=4-(F+e.bsCount[b]+(S?1:0))%4:F++;else break;r++}p=r>=i,s.push(e.bsCount[b]),e.bsCount[b]=e.sCount[b]+1+(k?1:0),c.push(e.sCount[b]),e.sCount[b]=F-y,l.push(e.tShift[b]),e.tShift[b]=r-e.bMarks[b];continue}if(p)break;let x=!1;for(let y=0,k=f.length;y<k;y++)if(f[y](e,b,n,!0)){x=!0;break}if(x){e.lineMax=b,e.blkIndent!==0&&(o.push(e.bMarks[b]),s.push(e.bsCount[b]),l.push(e.tShift[b]),c.push(e.sCount[b]),e.sCount[b]-=e.blkIndent);break}o.push(e.bMarks[b]),s.push(e.bsCount[b]),l.push(e.tShift[b]),c.push(e.sCount[b]),e.sCount[b]=-1}const E=e.blkIndent;e.blkIndent=0;const _=e.push("blockquote_open","blockquote",1);_.markup=">";const g=[t,0];_.map=g,e.md.block.tokenize(e,t,b);const v=e.push("blockquote_close","blockquote",-1);v.markup=">",e.lineMax=a,e.parentType=h,g[1]=e.line;for(let w=0;w<l.length;w++)e.bMarks[w+t]=o[w],e.tShift[w+t]=l[w],e.sCount[w+t]=c[w],e.bsCount[w+t]=s[w];return e.blkIndent=E,!0}function Eo(e,t,n,u){const r=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4)return!1;let i=e.bMarks[t]+e.tShift[t];const a=e.src.charCodeAt(i++);if(a!==42&&a!==45&&a!==95)return!1;let o=1;for(;i<r;){const c=e.src.charCodeAt(i++);if(c!==a&&!K(c))return!1;c===a&&o++}if(o<3)return!1;if(u)return!0;e.line=t+1;const s=e.push("hr","hr",0);return s.map=[t,e.line],s.markup=Array(o+1).join(String.fromCharCode(a)),!0}function Ru(e,t){const n=e.eMarks[t];let u=e.bMarks[t]+e.tShift[t];const r=e.src.charCodeAt(u++);if(r!==42&&r!==45&&r!==43)return-1;if(u<n){const i=e.src.charCodeAt(u);if(!K(i))return-1}return u}function Mu(e,t){const n=e.bMarks[t]+e.tShift[t],u=e.eMarks[t];let r=n;if(r+1>=u)return-1;let i=e.src.charCodeAt(r++);if(i<48||i>57)return-1;for(;;){if(r>=u)return-1;if(i=e.src.charCodeAt(r++),i>=48&&i<=57){if(r-n>=10)return-1;continue}if(i===41||i===46)break;return-1}return r<u&&(i=e.src.charCodeAt(r),!K(i))?-1:r}function xo(e,t){const n=e.level+2;for(let u=t+2,r=e.tokens.length-2;u<r;u++)e.tokens[u].level===n&&e.tokens[u].type==="paragraph_open"&&(e.tokens[u+2].hidden=!0,e.tokens[u].hidden=!0,u+=2)}function ko(e,t,n,u){let r,i,a,o,s=t,c=!0;if(e.sCount[s]-e.blkIndent>=4||e.listIndent>=0&&e.sCount[s]-e.listIndent>=4&&e.sCount[s]<e.blkIndent)return!1;let l=!1;u&&e.parentType==="paragraph"&&e.sCount[s]>=e.blkIndent&&(l=!0);let f,h,p;if((p=Mu(e,s))>=0){if(f=!0,a=e.bMarks[s]+e.tShift[s],h=Number(e.src.slice(a,p-1)),l&&h!==1)return!1}else if((p=Ru(e,s))>=0)f=!1;else return!1;if(l&&e.skipSpaces(p)>=e.eMarks[s])return!1;if(u)return!0;const b=e.src.charCodeAt(p-1),E=e.tokens.length;f?(o=e.push("ordered_list_open","ol",1),h!==1&&(o.attrs=[["start",h]])):o=e.push("bullet_list_open","ul",1);const _=[s,0];o.map=_,o.markup=String.fromCharCode(b);let g=!1;const v=e.md.block.ruler.getRules("list"),w=e.parentType;for(e.parentType="list";s<n;){i=p,r=e.eMarks[s];const x=e.sCount[s]+p-(e.bMarks[s]+e.tShift[s]);let y=x;for(;i<r;){const Z=e.src.charCodeAt(i);if(Z===9)y+=4-(y+e.bsCount[s])%4;else if(Z===32)y++;else break;i++}const k=i;let S;k>=r?S=1:S=y-x,S>4&&(S=1);const F=x+S;o=e.push("list_item_open","li",1),o.markup=String.fromCharCode(b);const z=[s,0];o.map=z,f&&(o.info=e.src.slice(a,p-1));const X=e.tight,ee=e.tShift[s],pe=e.sCount[s],ge=e.listIndent;if(e.listIndent=e.blkIndent,e.blkIndent=F,e.tight=!0,e.tShift[s]=k-e.bMarks[s],e.sCount[s]=y,k>=r&&e.isEmpty(s+1)?e.line=Math.min(e.line+2,n):e.md.block.tokenize(e,s,n,!0),(!e.tight||g)&&(c=!1),g=e.line-s>1&&e.isEmpty(e.line-1),e.blkIndent=e.listIndent,e.listIndent=ge,e.tShift[s]=ee,e.sCount[s]=pe,e.tight=X,o=e.push("list_item_close","li",-1),o.markup=String.fromCharCode(b),s=e.line,z[1]=s,s>=n||e.sCount[s]<e.blkIndent||e.sCount[s]-e.blkIndent>=4)break;let V=!1;for(let Z=0,ie=v.length;Z<ie;Z++)if(v[Z](e,s,n,!0)){V=!0;break}if(V)break;if(f){if(p=Mu(e,s),p<0)break;a=e.bMarks[s]+e.tShift[s]}else if(p=Ru(e,s),p<0)break;if(b!==e.src.charCodeAt(p-1))break}return f?o=e.push("ordered_list_close","ol",-1):o=e.push("bullet_list_close","ul",-1),o.markup=String.fromCharCode(b),_[1]=s,e.line=s,e.parentType=w,c&&xo(e,E),!0}const sn=999;function yo(e){let t=e.length;for(let n=0;n<e.length-1;n++){const u=e.charCodeAt(n);if(u<55296||u>56319)continue;const r=e.charCodeAt(n+1);r>=56320&&r<=57343&&(t--,n++)}return t}function dt(e,t){return Math.min(e.eMarks[t]+1,e.src.length)}function Rt(e,t){const n=e.lineMax;if(t>=n||e.isEmpty(t))return-1;let u=!1;if(e.sCount[t]-e.blkIndent>3&&(u=!0),e.sCount[t]<0&&(u=!0),!u){const r=e.md.block.ruler.getRules("reference"),i=e.parentType;e.parentType="reference";let a=!1;for(let o=0,s=r.length;o<s;o++)if(r[o](e,t,n,!0)){a=!0;break}if(e.parentType=i,a)return-1}return e.bMarks[t]+e.tShift[t]}function Ao(e,t,n,u){const r=e.src;let i=e.bMarks[t]+e.tShift[t],a=t+1;if(e.sCount[t]-e.blkIndent>=4||r.charCodeAt(i)!==91)return!1;let o=dt(e,t),s="",c=-1,l=++i;for(;i<o;){if(s.length+i-l>sn*2)return!1;let x=r.charCodeAt(i);if(x===91)return!1;if(x===93){c=i;break}if(x===92&&(x=r.charCodeAt(++i)),x===10&&i<o){const y=Rt(e,a);if(y<0)return!1;s+=r.slice(l,o),i=l=y,o=dt(e,a++);continue}i++}if(c<0||r.charCodeAt(c+1)!==58||(s+=r.slice(l,c),s.length>sn&&yo(s)>sn))return!1;for(i=c+2;i<o;){const x=r.charCodeAt(i);if(x===10){const y=Rt(e,a);if(y<0)break;i=y,o=dt(e,a++)}else if(K(x))i++;else break}const f=e.md.helpers.parseLinkDestination(r,i,o);if(!f.ok)return!1;const h=e.md.normalizeLink(f.str);if(!e.md.validateLink(h))return!1;i=f.pos;const p=i,b=o,E=a;for(;i<o;){const x=r.charCodeAt(i);if(x===10){const y=Rt(e,a);if(y<0)break;i=y,o=dt(e,a++)}else if(K(x))i++;else break}const _=i;let g=e.md.helpers.parseLinkTitle(r,i,o);for(;g.can_continue;){const x=Rt(e,a);if(x<0)break;i=x,o=dt(e,a++),g=e.md.helpers.parseLinkTitle(r,i,o,g)}let v;for(_!==p&&g.ok?(v=g.str,i=g.pos):(v="",i=p,o=b,a=E);i<o;){const x=r.charCodeAt(i);if(!K(x))break;i++}if(i<o&&r.charCodeAt(i)!==10&&v)for(v="",i=p,o=b,a=E;i<o;){const x=r.charCodeAt(i);if(!K(x))break;i++}if(i<o&&r.charCodeAt(i)!==10)return!1;const w=St(s);return w?(u||(typeof e.env.references>"u"&&(e.env.references={}),typeof e.env.references[w]>"u"&&(e.env.references[w]={title:v,href:h}),e.line=a),!0):!1}const wo=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],Co="[a-zA-Z_:][a-zA-Z0-9:._-]*",vo="(?:"+"[^\"'=<>`\\x00-\\x20]+"+"|"+"'[^']*'"+"|"+'"[^"]*"'+")",No="<[A-Za-z][A-Za-z0-9\\-]*"+("(?:\\s+"+Co+"(?:\\s*=\\s*"+vo+")?)")+"*\\s*\\/?>",Do="<\\/[A-Za-z][A-Za-z0-9\\-]*\\s*>",Iu=new RegExp("^(?:"+No+"|"+Do+")"),Pe=[[/^<(script|pre|style|textarea)(?=(\s|>|$))/i,/<\/(script|pre|style|textarea)>/i,!0],[/^<!--/,/-->/,!0],[/^<\?/,/\?>/,!0],[/^<![A-Za-z]/,/>/,!0],[/^<!\[CDATA\[/,/\]\]>/,!0],[new RegExp("^</?("+wo.join("|")+")(?=(\\s|/?>|$))","i"),/^$/,!0],[new RegExp(Iu.source+"\\s*$"),/^$/,!1]];function So(e,t,n,u){let r=e.bMarks[t]+e.tShift[t],i=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4||!e.md.options.html||e.src.charCodeAt(r)!==60)return!1;let a=e.src.slice(r,i),o=0;for(;o<Pe.length&&!Pe[o][0].test(a);o++);if(o===Pe.length)return!1;if(u)return Pe[o][2];let s=t+1;const c=Pe[o][1].test("");if(!Pe[o][1].test(a)){for(;s<n&&!(e.sCount[s]<e.blkIndent&&(c||!e.isEmpty(s)));s++)if(r=e.bMarks[s]+e.tShift[s],i=e.eMarks[s],a=e.src.slice(r,i),Pe[o][1].test(a)){a.length!==0&&s++;break}}e.line=s;const l=e.push("html_block","",0);return l.map=[t,s],l.content=e.getLines(t,s,e.blkIndent,!0),!0}function To(e,t,n,u){let r=e.bMarks[t]+e.tShift[t],i=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4)return!1;let a=e.src.charCodeAt(r);if(a!==35||r>=i)return!1;let o=1;for(a=e.src.charCodeAt(++r);a===35&&r<i&&o<=6;)o++,a=e.src.charCodeAt(++r);if(o>6||r<i&&!K(a))return!1;if(u)return!0;i=e.skipSpacesBack(i,r);const s=e.skipCharsBack(i,35,r);s>r&&K(e.src.charCodeAt(s-1))&&(i=s),e.line=t+1;const c=e.push("heading_open","h"+String(o),1);c.markup="########".slice(0,o),c.map=[t,e.line];const l=e.push("inline","",0);l.content=Tt(e.src.slice(r,i)),l.map=[t,e.line],l.children=[];const f=e.push("heading_close","h"+String(o),-1);return f.markup="########".slice(0,o),!0}function Oo(e,t,n){const u=e.md.block.ruler.getRules("paragraph");if(e.sCount[t]-e.blkIndent>=4)return!1;const r=e.parentType;e.parentType="paragraph";let i=0,a,o=t+1;for(;o<n&&!e.isEmpty(o);o++){if(e.sCount[o]-e.blkIndent>3)continue;if(e.sCount[o]>=e.blkIndent){let p=e.bMarks[o]+e.tShift[o];const b=e.eMarks[o];if(p<b&&(a=e.src.charCodeAt(p),(a===45||a===61)&&(p=e.skipChars(p,a),p=e.skipSpaces(p),p>=b))){i=a===61?1:2;break}}if(e.sCount[o]<0)continue;let h=!1;for(let p=0,b=u.length;p<b;p++)if(u[p](e,o,n,!0)){h=!0;break}if(h)break}if(!i)return e.parentType=r,!1;const s=Tt(e.getLines(t,o,e.blkIndent,!1));e.line=o+1;const c=e.push("heading_open","h"+String(i),1);c.markup=String.fromCharCode(a),c.map=[t,e.line];const l=e.push("inline","",0);l.content=s,l.map=[t,e.line-1],l.children=[];const f=e.push("heading_close","h"+String(i),-1);return f.markup=String.fromCharCode(a),e.parentType=r,!0}function Ro(e,t,n){const u=e.md.block.ruler.getRules("paragraph"),r=e.parentType;let i=t+1;for(e.parentType="paragraph";i<n&&!e.isEmpty(i);i++){if(e.sCount[i]-e.blkIndent>3||e.sCount[i]<0)continue;let c=!1;for(let l=0,f=u.length;l<f;l++)if(u[l](e,i,n,!0)){c=!0;break}if(c)break}const a=Tt(e.getLines(t,i,e.blkIndent,!1));e.line=i;const o=e.push("paragraph_open","p",1);o.map=[t,e.line];const s=e.push("inline","",0);return s.content=a,s.map=[t,e.line],s.children=[],e.push("paragraph_close","p",-1),e.parentType=r,!0}const Mt=[["table",ho,["paragraph","reference"]],["code",go],["fence",mo,["paragraph","reference","blockquote","list"]],["blockquote",_o,["paragraph","reference","blockquote","list"]],["hr",Eo,["paragraph","reference","blockquote","list"]],["list",ko,["paragraph","reference","blockquote"]],["reference",Ao],["html_block",So,["paragraph","reference","blockquote"]],["heading",To,["paragraph","reference","blockquote"]],["lheading",Oo],["paragraph",Ro]];function It(){this.ruler=new be;for(let e=0;e<Mt.length;e++)this.ruler.push(Mt[e][0],Mt[e][1],{alt:(Mt[e][2]||[]).slice()})}It.prototype.tokenize=function(e,t,n){const u=this.ruler.getRules(""),r=u.length,i=e.md.options.maxNesting;let a=t,o=!1;for(;a<n&&(e.line=a=e.skipEmptyLines(a),!(a>=n||e.sCount[a]<e.blkIndent));){if(e.level>=i){e.line=n;break}const s=e.line;let c=!1;for(let l=0;l<r;l++)if(c=u[l](e,a,n,!1),c){if(s>=e.line)throw new Error("block rule didn't increment state.line");break}if(!c)throw new Error("none of the block rules matched");e.tight=!o,e.isEmpty(e.line-1)&&(o=!0),a=e.line,a<n&&e.isEmpty(a)&&(o=!0,a++,e.line=a)}},It.prototype.parse=function(e,t,n,u){if(!e)return;const r=new this.State(e,t,n,u);this.tokenize(r,r.line,r.lineMax)},It.prototype.State=Ae;function ft(e,t,n,u){this.src=e,this.env=n,this.md=t,this.tokens=u,this.tokens_meta=Array(u.length),this.pos=0,this.posMax=this.src.length,this.level=0,this.pending="",this.pendingLevel=0,this.cache={},this.delimiters=[],this._prev_delimiters=[],this.backticks={},this.backticksScanned=!1,this.skipHtmlSpecial=!1,this.linkLevel=0}ft.prototype.pushPending=function(){const e=new Ee("text","",0);return e.content=this.pending,e.level=this.pendingLevel,this.tokens.push(e),this.pending="",e},ft.prototype.push=function(e,t,n){this.pending&&this.pushPending();const u=new Ee(e,t,n);let r=null;return n<0&&(this.level--,this.delimiters=this._prev_delimiters.pop()),u.level=this.level,n>0&&(this.level++,this._prev_delimiters.push(this.delimiters),this.delimiters=[],r={delimiters:this.delimiters}),this.pendingLevel=this.level,this.tokens.push(u),this.tokens_meta.push(r),u},ft.prototype.scanDelims=function(e,t){const n=this.posMax,u=this.src.charCodeAt(e);let r;if(e===0)r=32;else if(e===1)r=this.src.charCodeAt(0),(r&63488)===55296&&(r=65533);else if(r=this.src.charCodeAt(e-1),(r&64512)===56320){const _=this.src.charCodeAt(e-2);r=(_&64512)===55296?65536+(_-55296<<10)+(r-56320):65533}else(r&64512)===55296&&(r=65533);let i=e;for(;i<n&&this.src.charCodeAt(i)===u;)i++;const a=i-e;let o=i<n?this.src.charCodeAt(i):32;if((o&64512)===55296){const _=this.src.charCodeAt(i+1);o=(_&64512)===56320?65536+(o-55296<<10)+(_-56320):65533}else(o&64512)===56320&&(o=65533);const s=lt(r)||ct(r),c=lt(o)||ct(o),l=st(r),f=st(o),h=!f&&(!c||l||s),p=!l&&(!s||f||c);return{can_open:h&&(t||!p||s),can_close:p&&(t||!h||c),length:a}},ft.prototype.Token=Ee;function Mo(e){switch(e){case 10:case 33:case 35:case 36:case 37:case 38:case 42:case 43:case 45:case 58:case 60:case 61:case 62:case 64:case 91:case 92:case 93:case 94:case 95:case 96:case 123:case 125:case 126:return!0;default:return!1}}function Io(e,t){let n=e.pos;for(;n<e.posMax&&!Mo(e.src.charCodeAt(n));)n++;return n===e.pos?!1:(t||(e.pending+=e.src.slice(e.pos,n)),e.pos=n,!0)}function Fo(e){return e>=65&&e<=90||e>=97&&e<=122}function Lo(e){return e>=65&&e<=90||e>=97&&e<=122||e>=48&&e<=57||e===43||e===45||e===46}function Bo(e,t){if(!e.md.options.linkify||e.linkLevel>0)return!1;const n=e.pos,u=e.posMax;if(n+3>u||e.src.charCodeAt(n)!==58||e.src.charCodeAt(n+1)!==47||e.src.charCodeAt(n+2)!==47)return!1;const r=n-Math.min(10,e.pending.length,n);let i=n;for(;i>r&&Lo(e.src.charCodeAt(i-1));)i--;if(i===n||!Fo(e.src.charCodeAt(i)))return!1;const a=n-i,o=e.md.linkify.matchAtStart(e.src.slice(i));if(!o)return!1;let s=o.url;if(s.length<=a)return!1;let c=s.length;for(;c>0&&s.charCodeAt(c-1)===42;)c--;c!==s.length&&(s=s.slice(0,c));const l=e.md.normalizeLink(s);if(!e.md.validateLink(l))return!1;if(!t){e.pending=e.pending.slice(0,-a);const f=e.push("link_open","a",1);f.attrs=[["href",l]],f.markup="linkify",f.info="auto";const h=e.push("text","",0);h.content=e.md.normalizeLinkText(s);const p=e.push("link_close","a",-1);p.markup="linkify",p.info="auto"}return e.pos+=s.length-a,!0}function Po(e,t){let n=e.pos;if(e.src.charCodeAt(n)!==10)return!1;const u=e.pending.length-1,r=e.posMax;if(!t)if(u>=0&&e.pending.charCodeAt(u)===32)if(u>=1&&e.pending.charCodeAt(u-1)===32){let i=u-1;for(;i>=1&&e.pending.charCodeAt(i-1)===32;)i--;e.pending=e.pending.slice(0,i),e.push("hardbreak","br",0)}else e.pending=e.pending.slice(0,-1),e.push("softbreak","br",0);else e.push("softbreak","br",0);for(n++;n<r&&K(e.src.charCodeAt(n));)n++;return e.pos=n,!0}const cn=[];for(let e=0;e<256;e++)cn.push(0);"\\!\"#$%&'()*+,./:;<=>?@[]^_`{|}~-".split("").forEach(function(e){cn[e.charCodeAt(0)]=1});function zo(e,t){let n=e.pos;const u=e.posMax;if(e.src.charCodeAt(n)!==92||(n++,n>=u))return!1;let r=e.src.charCodeAt(n);if(r===10){for(t||e.push("hardbreak","br",0),n++;n<u&&(r=e.src.charCodeAt(n),!!K(r));)n++;return e.pos=n,!0}if(r===32){if(!t){const o=e.push("text_special","",0);o.content="\\",o.markup="\\",o.info="escape"}return e.pos=n,!0}let i=e.src[n];if(r>=55296&&r<=56319&&n+1<u){const o=e.src.charCodeAt(n+1);o>=56320&&o<=57343&&(i+=e.src[n+1],n++)}const a="\\"+i;if(!t){const o=e.push("text_special","",0);r<256&&cn[r]!==0?o.content=i:o.content=a,o.markup=a,o.info="escape"}return e.pos=n+1,!0}function Uo(e,t){let n=e.pos;if(e.src.charCodeAt(n)!==96)return!1;const r=n;n++;const i=e.posMax;for(;n<i&&e.src.charCodeAt(n)===96;)n++;const a=e.src.slice(r,n),o=a.length;if(e.backticksScanned&&(e.backticks[o]||0)<=r)return t||(e.pending+=a),e.pos+=o,!0;let s=n,c;for(;(c=e.src.indexOf("`",s))!==-1;){for(s=c+1;s<i&&e.src.charCodeAt(s)===96;)s++;const l=s-c;if(l===o){if(!t){const f=e.push("code_inline","code",0);f.markup=a,f.content=e.src.slice(n,c).replace(/\n/g," ").replace(/^ (.+) $/,"$1")}return e.pos=s,!0}e.backticks[l]=c}return e.backticksScanned=!0,t||(e.pending+=a),e.pos+=o,!0}function $o(e,t){const n=e.pos,u=e.src.charCodeAt(n);if(t||u!==126)return!1;const r=e.scanDelims(e.pos,!0);let i=r.length;const a=String.fromCharCode(u);if(i<2)return!1;let o;i%2&&(o=e.push("text","",0),o.content=a,i--);for(let s=0;s<i;s+=2)o=e.push("text","",0),o.content=a+a,e.delimiters.push({marker:u,length:0,token:e.tokens.length-1,end:-1,open:r.can_open,close:r.can_close});return e.pos+=r.length,!0}function Fu(e,t){let n;const u=[],r=t.length;for(let i=0;i<r;i++){const a=t[i];if(a.marker!==126||a.end===-1)continue;const o=t[a.end];n=e.tokens[a.token],n.type="s_open",n.tag="s",n.nesting=1,n.markup="~~",n.content="",n=e.tokens[o.token],n.type="s_close",n.tag="s",n.nesting=-1,n.markup="~~",n.content="",e.tokens[o.token-1].type==="text"&&e.tokens[o.token-1].content==="~"&&u.push(o.token-1)}for(;u.length;){const i=u.pop();let a=i+1;for(;a<e.tokens.length&&e.tokens[a].type==="s_close";)a++;a--,i!==a&&(n=e.tokens[a],e.tokens[a]=e.tokens[i],e.tokens[i]=n)}}function qo(e){const t=e.tokens_meta,n=e.tokens_meta.length;Fu(e,e.delimiters);for(let u=0;u<n;u++)t[u]&&t[u].delimiters&&Fu(e,t[u].delimiters)}const Lu={tokenize:$o,postProcess:qo};function Ho(e,t){const n=e.pos,u=e.src.charCodeAt(n);if(t||u!==95&&u!==42)return!1;const r=e.scanDelims(e.pos,u===42);for(let i=0;i<r.length;i++){const a=e.push("text","",0);a.content=String.fromCharCode(u),e.delimiters.push({marker:u,length:r.length,token:e.tokens.length-1,end:-1,open:r.can_open,close:r.can_close})}return e.pos+=r.length,!0}function Bu(e,t){const n=t.length;for(let u=n-1;u>=0;u--){const r=t[u];if(r.marker!==95&&r.marker!==42||r.end===-1)continue;const i=t[r.end],a=u>0&&t[u-1].end===r.end+1&&t[u-1].marker===r.marker&&t[u-1].token===r.token-1&&t[r.end+1].token===i.token+1,o=String.fromCharCode(r.marker),s=e.tokens[r.token];s.type=a?"strong_open":"em_open",s.tag=a?"strong":"em",s.nesting=1,s.markup=a?o+o:o,s.content="";const c=e.tokens[i.token];c.type=a?"strong_close":"em_close",c.tag=a?"strong":"em",c.nesting=-1,c.markup=a?o+o:o,c.content="",a&&(e.tokens[t[u-1].token].content="",e.tokens[t[r.end+1].token].content="",u--)}}function Go(e){const t=e.tokens_meta,n=e.tokens_meta.length;Bu(e,e.delimiters);for(let u=0;u<n;u++)t[u]&&t[u].delimiters&&Bu(e,t[u].delimiters)}const Pu={tokenize:Ho,postProcess:Go};function Ko(e,t){let n,u,r,i,a="",o="",s=e.pos,c=!0;if(e.src.charCodeAt(e.pos)!==91)return!1;const l=e.pos,f=e.posMax,h=e.pos+1,p=e.md.helpers.parseLinkLabel(e,e.pos,!0);if(p<0)return!1;let b=p+1;if(b<f&&e.src.charCodeAt(b)===40){for(c=!1,b++;b<f&&(n=e.src.charCodeAt(b),!(!K(n)&&n!==10));b++);if(b>=f)return!1;if(s=b,r=e.md.helpers.parseLinkDestination(e.src,b,e.posMax),r.ok){for(a=e.md.normalizeLink(r.str),e.md.validateLink(a)?b=r.pos:a="",s=b;b<f&&(n=e.src.charCodeAt(b),!(!K(n)&&n!==10));b++);if(r=e.md.helpers.parseLinkTitle(e.src,b,e.posMax),b<f&&s!==b&&r.ok)for(o=r.str,b=r.pos;b<f&&(n=e.src.charCodeAt(b),!(!K(n)&&n!==10));b++);}(b>=f||e.src.charCodeAt(b)!==41)&&(c=!0),b++}if(c){if(typeof e.env.references>"u")return!1;if(b<f&&e.src.charCodeAt(b)===91?(s=b+1,b=e.md.helpers.parseLinkLabel(e,b),b>=0?u=e.src.slice(s,b++):b=p+1):b=p+1,u||(u=e.src.slice(h,p)),i=e.env.references[St(u)],!i)return e.pos=l,!1;a=i.href,o=i.title}if(!t){e.pos=h,e.posMax=p;const E=e.push("link_open","a",1),_=[["href",a]];E.attrs=_,o&&_.push(["title",o]),e.linkLevel++,e.md.inline.tokenize(e),e.linkLevel--,e.push("link_close","a",-1)}return e.pos=b,e.posMax=f,!0}function Zo(e,t){let n,u,r,i,a,o,s,c,l="";const f=e.pos,h=e.posMax;if(e.src.charCodeAt(e.pos)!==33||e.src.charCodeAt(e.pos+1)!==91)return!1;const p=e.pos+2,b=e.md.helpers.parseLinkLabel(e,e.pos+1,!1);if(b<0)return!1;if(i=b+1,i<h&&e.src.charCodeAt(i)===40){for(i++;i<h&&(n=e.src.charCodeAt(i),!(!K(n)&&n!==10));i++);if(i>=h)return!1;for(c=i,o=e.md.helpers.parseLinkDestination(e.src,i,e.posMax),o.ok&&(l=e.md.normalizeLink(o.str),e.md.validateLink(l)?i=o.pos:l=""),c=i;i<h&&(n=e.src.charCodeAt(i),!(!K(n)&&n!==10));i++);if(o=e.md.helpers.parseLinkTitle(e.src,i,e.posMax),i<h&&c!==i&&o.ok)for(s=o.str,i=o.pos;i<h&&(n=e.src.charCodeAt(i),!(!K(n)&&n!==10));i++);else s="";if(i>=h||e.src.charCodeAt(i)!==41)return e.pos=f,!1;i++}else{if(typeof e.env.references>"u")return!1;if(i<h&&e.src.charCodeAt(i)===91?(c=i+1,i=e.md.helpers.parseLinkLabel(e,i),i>=0?r=e.src.slice(c,i++):i=b+1):i=b+1,r||(r=e.src.slice(p,b)),a=e.env.references[St(r)],!a)return e.pos=f,!1;l=a.href,s=a.title}if(!t){u=e.src.slice(p,b);const E=[];e.md.inline.parse(u,e.md,e.env,E);const _=e.push("image","img",0),g=[["src",l],["alt",""]];_.attrs=g,_.children=E,_.content=u,s&&g.push(["title",s])}return e.pos=i,e.posMax=h,!0}const Wo=/^([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])?)*)$/,Yo=/^([a-zA-Z][a-zA-Z0-9+.-]{1,31}):([^<>\x00-\x20]*)$/;function Vo(e,t){let n=e.pos;if(e.src.charCodeAt(n)!==60)return!1;const u=e.pos,r=e.posMax;for(;;){if(++n>=r)return!1;const a=e.src.charCodeAt(n);if(a===60)return!1;if(a===62)break}const i=e.src.slice(u+1,n);if(Yo.test(i)){const a=e.md.normalizeLink(i);if(!e.md.validateLink(a))return!1;if(!t){const o=e.push("link_open","a",1);o.attrs=[["href",a]],o.markup="autolink",o.info="auto";const s=e.push("text","",0);s.content=e.md.normalizeLinkText(i);const c=e.push("link_close","a",-1);c.markup="autolink",c.info="auto"}return e.pos+=i.length+2,!0}if(Wo.test(i)){const a=e.md.normalizeLink("mailto:"+i);if(!e.md.validateLink(a))return!1;if(!t){const o=e.push("link_open","a",1);o.attrs=[["href",a]],o.markup="autolink",o.info="auto";const s=e.push("text","",0);s.content=e.md.normalizeLinkText(i);const c=e.push("link_close","a",-1);c.markup="autolink",c.info="auto"}return e.pos+=i.length+2,!0}return!1}function Xo(e){return/^<a[>\s]/i.test(e)}function Qo(e){return/^<\/a\s*>/i.test(e)}function zu(e){const t=e|32;return t>=97&&t<=122}function Jo(e,t){const n=e.src;let u,r;if(n.startsWith("<!--",t)){if(n.startsWith(">",t+4))return t+5;if(n.startsWith("->",t+4))return t+6;u=t+4,r="-->"}else if(n.startsWith("<![CDATA[",t))u=t+9,r="]]>";else if(n.charCodeAt(t+1)===63)u=t+2,r="?>";else if(zu(n.charCodeAt(t+2)))u=t+3,r=">";else return-1;if(e.skipHtmlSpecial)return-1;const i=n.indexOf(r,u);return i<0?(e.skipHtmlSpecial=!0,-1):i+r.length}function jo(e,t){if(!e.md.options.html)return!1;const n=e.posMax,u=e.pos;if(e.src.charCodeAt(u)!==60||u+2>=n)return!1;let r;const i=e.src.charCodeAt(u+1);if(i===33||i===63)r=Jo(e,u);else if(i===47||zu(i)){const a=e.src.slice(u).match(Iu);r=a?u+a[0].length:-1}else return!1;if(r<0)return!1;if(!t){const a=e.push("html_inline","",0);a.content=e.src.slice(u,r),Xo(a.content)&&e.linkLevel++,Qo(a.content)&&e.linkLevel--}return e.pos=r,!0}const es=/^&#((?:x[a-f0-9]{1,6}|[0-9]{1,7}));/i,ts=/^&([a-z][a-z0-9]{1,31});/i;function ns(e,t){const n=e.pos,u=e.posMax;if(e.src.charCodeAt(n)!==38||n+1>=u)return!1;if(e.src.charCodeAt(n+1)===35){const i=e.src.slice(n).match(es);if(i){if(!t){const a=i[1][0].toLowerCase()==="x"?parseInt(i[1].slice(1),16):parseInt(i[1],10),o=e.push("text_special","",0);o.content=un(a)?ot(a):ot(65533),o.markup=i[0],o.info="entity"}return e.pos+=i[0].length,!0}}else{const i=e.src.slice(n).match(ts);if(i){const a=Ca(i[0]);if(a!==i[0]){if(!t){const o=e.push("text_special","",0);o.content=a,o.markup=i[0],o.info="entity"}return e.pos+=i[0].length,!0}}}return!1}function Uu(e){const t={},n=e.length;if(!n)return;let u=0,r=-2;const i=[];for(let a=0;a<n;a++){const o=e[a];if(i.push(0),(e[u].marker!==o.marker||r!==o.token-1)&&(u=a),r=o.token,o.length=o.length||0,!o.close)continue;t.hasOwnProperty(o.marker)||(t[o.marker]=[-1,-1,-1,-1,-1,-1]);const s=t[o.marker][(o.open?3:0)+o.length%3];let c=u-i[u]-1,l=c;for(;c>s;c-=i[c]+1){const f=e[c];if(f.marker===o.marker&&f.open&&f.end<0){let h=!1;if((f.close||o.open)&&(f.length+o.length)%3===0&&(f.length%3!==0||o.length%3!==0)&&(h=!0),!h){const p=c>0&&!e[c-1].open?i[c-1]+1:0;i[a]=a-c+p,i[c]=p,o.open=!1,f.end=a,f.close=!1,l=-1,r=-2;break}}}l!==-1&&(t[o.marker][(o.open?3:0)+(o.length||0)%3]=l)}}function us(e){const t=e.tokens_meta,n=e.tokens_meta.length;Uu(e.delimiters);for(let u=0;u<n;u++)t[u]&&t[u].delimiters&&Uu(t[u].delimiters)}function rs(e){let t,n,u=0;const r=e.tokens,i=e.tokens.length;for(t=n=0;t<i;t++)r[t].nesting<0&&u--,r[t].level=u,r[t].nesting>0&&u++,r[t].type==="text"&&t+1<i&&r[t+1].type==="text"?r[t+1].content=r[t].content+r[t+1].content:(t!==n&&(r[n]=r[t]),n++);t!==n&&(r.length=n)}const ln=[["text",Io],["linkify",Bo],["newline",Po],["escape",zo],["backticks",Uo],["strikethrough",Lu.tokenize],["emphasis",Pu.tokenize],["link",Ko],["image",Zo],["autolink",Vo],["html_inline",jo],["entity",ns]],dn=[["balance_pairs",us],["strikethrough",Lu.postProcess],["emphasis",Pu.postProcess],["fragments_join",rs]];function bt(){this.ruler=new be;for(let e=0;e<ln.length;e++)this.ruler.push(ln[e][0],ln[e][1]);this.ruler2=new be;for(let e=0;e<dn.length;e++)this.ruler2.push(dn[e][0],dn[e][1])}bt.prototype.skipToken=function(e){const t=e.pos,n=this.ruler.getRules(""),u=n.length,r=e.md.options.maxNesting,i=e.cache;if(typeof i[t]<"u"){e.pos=i[t];return}let a=!1;if(e.level<r){for(let o=0;o<u;o++)if(e.level++,a=n[o](e,!0),e.level--,a){if(t>=e.pos)throw new Error("inline rule didn't increment state.pos");break}}else e.pos=e.posMax;a||e.pos++,i[t]=e.pos},bt.prototype.tokenize=function(e){const t=this.ruler.getRules(""),n=t.length,u=e.posMax,r=e.md.options.maxNesting;for(;e.pos<u;){const i=e.pos;let a=!1;if(e.level<r){for(let o=0;o<n;o++)if(a=t[o](e,!1),a){if(i>=e.pos)throw new Error("inline rule didn't increment state.pos");break}}if(a){if(e.pos>=u)break;continue}e.pending+=e.src[e.pos++]}e.pending&&e.pushPending()},bt.prototype.parse=function(e,t,n,u){const r=new this.State(e,t,n,u);this.tokenize(r);const i=this.ruler2.getRules(""),a=i.length;for(let o=0;o<a;o++)i[o](r)},bt.prototype.State=ft;function is(e){const t={};e=e||{},t.src_Any=mu.source,t.src_Cc=_u.source,t.src_Z=xu.source,t.src_P=jt.source,t.src_ZPCc=[t.src_Z,t.src_P,t.src_Cc].join("|"),t.src_ZCc=[t.src_Z,t.src_Cc].join("|");const n="[><|]";return t.src_pseudo_letter=`(?:(?!${n}|${t.src_ZPCc})${t.src_Any})`,t.src_ip4="(?:(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)",t.src_auth=`(?:(?:(?!${t.src_ZCc}|[@/\\[\\]()]).){1,50}@)?`,t.src_port="(?::(?:6(?:[0-4]\\d{3}|5(?:[0-4]\\d{2}|5(?:[0-2]\\d|3[0-5])))|[1-5]?\\d{1,4}))?",t.src_host_terminator=`(?=$|${n}|${t.src_ZPCc})(?!${e["---"]?"-(?!--)|":"-|"}_|:\\d|\\.-|\\.(?!$|${t.src_ZPCc}))`,t.src_path=`(?:[/?#](?:(?!${t.src_ZCc}|${n}|[()[\\]{}.,"'?!\\-;]).|\\[(?:(?!${t.src_ZCc}|\\]).)*\\]|\\((?:(?!${t.src_ZCc}|[)]).)*\\)|\\{(?:(?!${t.src_ZCc}|[}]).)*\\}|\\"(?:(?!${t.src_ZCc}|["]).)+\\"|\\'(?:(?!${t.src_ZCc}|[']).)+\\'|\\'(?=${t.src_pseudo_letter}|[-])|\\.{2,}[a-zA-Z0-9%/&]|\\.(?!${t.src_ZCc}|[.]|$)|`+(e["---"]?"\\-(?!--(?:[^-]|$))(?:-*)|":"\\-+|")+`,(?!${t.src_ZCc}|$)|;(?!${t.src_ZCc}|$)|\\!+(?!${t.src_ZCc}|[!]|$)|\\?(?!${t.src_ZCc}|[?]|$))+|\\/)?`,t.src_email_name='[\\-;:&=\\+\\$,\\.a-zA-Z0-9_][\\-;:&=\\+\\$,\\"\\.a-zA-Z0-9_]{0,63}',t.src_xn="xn--[a-z0-9\\-]{1,59}",t.src_domain_root="(?:"+t.src_xn+`|${t.src_pseudo_letter}{1,63})`,t.src_domain="(?:"+t.src_xn+`|(?:${t.src_pseudo_letter})|(?:${t.src_pseudo_letter}(?:-|${t.src_pseudo_letter}){0,61}${t.src_pseudo_letter}))`,t.src_host=`(?:(?:(?:(?:${t.src_domain})\\.)*${t.src_domain}))`,t.tpl_host_fuzzy="(?:"+t.src_ip4+`|(?:(?:(?:${t.src_domain})\\.)+(?:%TLDS%)))`,t.tpl_host_no_ip_fuzzy=`(?:(?:(?:${t.src_domain})\\.)+(?:%TLDS%))`,t.src_host_strict=t.src_host+t.src_host_terminator,t.tpl_host_fuzzy_strict=t.tpl_host_fuzzy+t.src_host_terminator,t.src_host_port_strict=t.src_host+t.src_port+t.src_host_terminator,t.tpl_host_port_fuzzy_strict=t.tpl_host_fuzzy+t.src_port+t.src_host_terminator,t.tpl_host_port_no_ip_fuzzy_strict=t.tpl_host_no_ip_fuzzy+t.src_port+t.src_host_terminator,t.tpl_host_fuzzy_test=`localhost|www\\.|\\.\\d{1,3}\\.|(?:\\.(?:%TLDS%)(?:${t.src_ZPCc}|>|$))`,t.tpl_email_fuzzy=`(^|${n}|"|\\(|${t.src_ZCc})(${t.src_email_name}@${t.tpl_host_fuzzy_strict})`,t.tpl_link_fuzzy=`(^|(?![.:/\\-_@])(?:[$+<=>^\`||]|${t.src_ZPCc}))((?![$+<=>^\`||])${t.tpl_host_port_fuzzy_strict}${t.src_path})`,t.tpl_link_no_ip_fuzzy=`(^|(?![.:/\\-_@])(?:[$+<=>^\`||]|${t.src_ZPCc}))((?![$+<=>^\`||])${t.tpl_host_port_no_ip_fuzzy_strict}${t.src_path})`,t}function fn(e){return Array.prototype.slice.call(arguments,1).forEach(function(n){n&&Object.keys(n).forEach(function(u){e[u]=n[u]})}),e}function Ft(e){return Object.prototype.toString.call(e)}function as(e){return Ft(e)==="[object String]"}function os(e){return Ft(e)==="[object Object]"}function ss(e){return Ft(e)==="[object RegExp]"}function $u(e){return Ft(e)==="[object Function]"}function cs(e){return e.replace(/[.?*+^$[\]\\(){}|-]/g,"\\$&")}const qu={fuzzyLink:!0,fuzzyEmail:!0,fuzzyIP:!1};function ls(e){return Object.keys(e||{}).reduce(function(t,n){return t||qu.hasOwnProperty(n)},!1)}const ds={"http:":{validate:function(e,t,n){const u=e.slice(t);return n.re.http||(n.re.http=new RegExp(`^\\/\\/${n.re.src_auth}${n.re.src_host_port_strict}${n.re.src_path}`,"i")),n.re.http.test(u)?u.match(n.re.http)[0].length:0}},"https:":"http:","ftp:":"http:","//":{validate:function(e,t,n){const u=e.slice(t);return n.re.no_http||(n.re.no_http=new RegExp("^"+n.re.src_auth+`(?:localhost|(?:(?:${n.re.src_domain})\\.)+${n.re.src_domain_root})`+n.re.src_port+n.re.src_host_terminator+n.re.src_path,"i")),n.re.no_http.test(u)?t>=3&&e[t-3]===":"||t>=3&&e[t-3]==="/"?0:u.match(n.re.no_http)[0].length:0}},"mailto:":{validate:function(e,t,n){const u=e.slice(t);return n.re.mailto||(n.re.mailto=new RegExp(`^${n.re.src_email_name}@${n.re.src_host_strict}`,"i")),n.re.mailto.test(u)?u.match(n.re.mailto)[0].length:0}}},fs="a[cdefgilmnoqrstuwxz]|b[abdefghijmnorstvwyz]|c[acdfghiklmnoruvwxyz]|d[ejkmoz]|e[cegrstu]|f[ijkmor]|g[abdefghilmnpqrstuwy]|h[kmnrtu]|i[delmnoqrst]|j[emop]|k[eghimnprwyz]|l[abcikrstuvy]|m[acdeghklmnopqrstuvwxyz]|n[acefgilopruz]|om|p[aefghklmnrstwy]|qa|r[eosuw]|s[abcdeghijklmnortuvxyz]|t[cdfghjklmnortvwz]|u[agksyz]|v[aceginu]|w[fs]|y[et]|z[amw]",bs="biz|com|edu|gov|net|org|pro|web|xxx|aero|asia|coop|info|museum|name|shop|рф".split("|");function ps(e){return function(t,n){const u=t.slice(n);return e.test(u)?u.match(e)[0].length:0}}function Hu(){return function(e,t){t.normalize(e)}}function Lt(e){const t=e.re=is(e.__opts__),n=e.__tlds__.slice();e.onCompile(),e.__tlds_replaced__||n.push(fs),n.push(t.src_xn),t.src_tlds=n.join("|");function u(o){return o.replace("%TLDS%",t.src_tlds)}t.email_fuzzy=RegExp(u(t.tpl_email_fuzzy),"i"),t.email_fuzzy_global=RegExp(u(t.tpl_email_fuzzy),"ig"),t.link_fuzzy=RegExp(u(t.tpl_link_fuzzy),"i"),t.link_fuzzy_global=RegExp(u(t.tpl_link_fuzzy),"ig"),t.link_no_ip_fuzzy=RegExp(u(t.tpl_link_no_ip_fuzzy),"i"),t.link_no_ip_fuzzy_global=RegExp(u(t.tpl_link_no_ip_fuzzy),"ig"),t.host_fuzzy_test=RegExp(u(t.tpl_host_fuzzy_test),"i");const r=[];e.__compiled__={};function i(o,s){throw new Error(`(LinkifyIt) Invalid schema "${o}": ${s}`)}Object.keys(e.__schemas__).forEach(function(o){const s=e.__schemas__[o];if(s===null)return;const c={validate:null,link:null};if(e.__compiled__[o]=c,os(s)){ss(s.validate)?c.validate=ps(s.validate):$u(s.validate)?c.validate=s.validate:i(o,s),$u(s.normalize)?c.normalize=s.normalize:s.normalize?i(o,s):c.normalize=Hu();return}if(as(s)){r.push(o);return}i(o,s)}),r.forEach(function(o){e.__compiled__[e.__schemas__[o]]&&(e.__compiled__[o].validate=e.__compiled__[e.__schemas__[o]].validate,e.__compiled__[o].normalize=e.__compiled__[e.__schemas__[o]].normalize)}),e.__compiled__[""]={validate:null,normalize:Hu()};const a=Object.keys(e.__compiled__).filter(function(o){return o.length>0&&e.__compiled__[o]}).map(cs).join("|");e.re.schema_test=RegExp(`(^|(?!_)(?:[><|]|${t.src_ZPCc}))(${a})`,"i"),e.re.schema_search=RegExp(`(^|(?!_)(?:[><|]|${t.src_ZPCc}))(${a})`,"ig"),e.re.schema_at_start=RegExp(`^${e.re.schema_search.source}`,"i"),e.re.pretest=RegExp(`(${e.re.schema_test.source})|(${e.re.host_fuzzy_test.source})|@`,"i")}function Gu(e,t,n,u){const r=e.slice(n,u);this.schema=t.toLowerCase(),this.index=n,this.lastIndex=u,this.raw=r,this.text=r,this.url=r}function he(e,t){if(!(this instanceof he))return new he(e,t);t||ls(e)&&(t=e,e={}),this.__opts__=fn({},qu,t),this.__schemas__=fn({},ds,e),this.__compiled__={},this.__tlds__=bs,this.__tlds_replaced__=!1,this.re={},Lt(this)}he.prototype.add=function(t,n){return this.__schemas__[t]=n,Lt(this),this},he.prototype.set=function(t){return this.__opts__=fn(this.__opts__,t),this},he.prototype.test=function(t){if(!t.length)return!1;let n,u;if(this.re.schema_test.test(t)){for(u=this.re.schema_search,u.lastIndex=0;(n=u.exec(t))!==null;)if(this.testSchemaAt(t,n[2],u.lastIndex))return!0}return!!(this.__opts__.fuzzyLink&&this.__compiled__["http:"]&&t.search(this.re.host_fuzzy_test)>=0&&t.match(this.__opts__.fuzzyIP?this.re.link_fuzzy:this.re.link_no_ip_fuzzy)!==null||this.__opts__.fuzzyEmail&&this.__compiled__["mailto:"]&&t.indexOf("@")>=0&&t.match(this.re.email_fuzzy)!==null)},he.prototype.pretest=function(t){return this.re.pretest.test(t)},he.prototype.testSchemaAt=function(t,n,u){return this.__compiled__[n.toLowerCase()]?this.__compiled__[n.toLowerCase()].validate(t,u,this):0},he.prototype.match=function(t){const n=[],u=[],r=[],i=[];let a,o,s;function c(h,p){return h?p?h.index!==p.index?h.index<p.index?h:p:h.lastIndex>=p.lastIndex?h:p:h:p}if(!t.length)return null;if(this.re.schema_test.test(t))for(s=this.re.schema_search,s.lastIndex=0;(a=s.exec(t))!==null;)o=this.testSchemaAt(t,a[2],s.lastIndex),o&&u.push({schema:a[2],index:a.index+a[1].length,lastIndex:a.index+a[0].length+o});if(this.__opts__.fuzzyLink&&this.__compiled__["http:"])for(s=this.__opts__.fuzzyIP?this.re.link_fuzzy_global:this.re.link_no_ip_fuzzy_global,s.lastIndex=0;(a=s.exec(t))!==null;)r.push({schema:"",index:a.index+a[1].length,lastIndex:a.index+a[0].length});if(this.__opts__.fuzzyEmail&&this.__compiled__["mailto:"])for(s=this.re.email_fuzzy_global,s.lastIndex=0;(a=s.exec(t))!==null;)i.push({schema:"mailto:",index:a.index+a[1].length,lastIndex:a.index+a[0].length});const l=[0,0,0];let f=0;for(;;){const h=[u[l[0]],i[l[1]],r[l[2]]],p=c(c(h[0],h[1]),h[2]);if(!p)break;if(p===h[0]?l[0]++:p===h[1]?l[1]++:l[2]++,p.index<f)continue;const b=new Gu(t,p.schema,p.index,p.lastIndex);this.__compiled__[b.schema].normalize(b,this),n.push(b),f=p.lastIndex}return n.length?n:null},he.prototype.matchAtStart=function(t){if(!t.length)return null;const n=this.re.schema_at_start.exec(t);if(!n)return null;const u=this.testSchemaAt(t,n[2],n[0].length);if(!u)return null;const r=new Gu(t,n[2],n.index+n[1].length,n.index+n[0].length+u);return this.__compiled__[r.schema].normalize(r,this),r},he.prototype.tlds=function(t,n){return t=Array.isArray(t)?t:[t],n?(this.__tlds__=this.__tlds__.concat(t).sort().filter(function(u,r,i){return u!==i[r-1]}).reverse(),Lt(this),this):(this.__tlds__=t.slice(),this.__tlds_replaced__=!0,Lt(this),this)},he.prototype.normalize=function(t){t.schema||(t.url=`http://${t.url}`),t.schema==="mailto:"&&!/^mailto:/i.test(t.url)&&(t.url=`mailto:${t.url}`)},he.prototype.onCompile=function(){};const Je=2147483647,we=36,bn=1,pt=26,hs=38,gs=700,Ku=72,Zu=128,Wu="-",ms=/^xn--/,_s=/[^\0-\x7F]/,Es=/[\x2E\u3002\uFF0E\uFF61]/g,xs={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},pn=we-bn,Ce=Math.floor,hn=String.fromCharCode;function Ie(e){throw new RangeError(xs[e])}function ks(e,t){const n=[];let u=e.length;for(;u--;)n[u]=t(e[u]);return n}function Yu(e,t){const n=e.split("@");let u="";n.length>1&&(u=n[0]+"@",e=n[1]),e=e.replace(Es,".");const r=e.split("."),i=ks(r,t).join(".");return u+i}function Vu(e){const t=[];let n=0;const u=e.length;for(;n<u;){const r=e.charCodeAt(n++);if(r>=55296&&r<=56319&&n<u){const i=e.charCodeAt(n++);(i&64512)==56320?t.push(((r&1023)<<10)+(i&1023)+65536):(t.push(r),n--)}else t.push(r)}return t}const ys=e=>String.fromCodePoint(...e),As=function(e){return e>=48&&e<58?26+(e-48):e>=65&&e<91?e-65:e>=97&&e<123?e-97:we},Xu=function(e,t){return e+22+75*(e<26)-((t!=0)<<5)},Qu=function(e,t,n){let u=0;for(e=n?Ce(e/gs):e>>1,e+=Ce(e/t);e>pn*pt>>1;u+=we)e=Ce(e/pn);return Ce(u+(pn+1)*e/(e+hs))},Ju=function(e){const t=[],n=e.length;let u=0,r=Zu,i=Ku,a=e.lastIndexOf(Wu);a<0&&(a=0);for(let o=0;o<a;++o)e.charCodeAt(o)>=128&&Ie("not-basic"),t.push(e.charCodeAt(o));for(let o=a>0?a+1:0;o<n;){const s=u;for(let l=1,f=we;;f+=we){o>=n&&Ie("invalid-input");const h=As(e.charCodeAt(o++));h>=we&&Ie("invalid-input"),h>Ce((Je-u)/l)&&Ie("overflow"),u+=h*l;const p=f<=i?bn:f>=i+pt?pt:f-i;if(h<p)break;const b=we-p;l>Ce(Je/b)&&Ie("overflow"),l*=b}const c=t.length+1;i=Qu(u-s,c,s==0),Ce(u/c)>Je-r&&Ie("overflow"),r+=Ce(u/c),u%=c,t.splice(u++,0,r)}return String.fromCodePoint(...t)},ju=function(e){const t=[];e=Vu(e);const n=e.length;let u=Zu,r=0,i=Ku;for(const s of e)s<128&&t.push(hn(s));const a=t.length;let o=a;for(a&&t.push(Wu);o<n;){let s=Je;for(const l of e)l>=u&&l<s&&(s=l);const c=o+1;s-u>Ce((Je-r)/c)&&Ie("overflow"),r+=(s-u)*c,u=s;for(const l of e)if(l<u&&++r>Je&&Ie("overflow"),l===u){let f=r;for(let h=we;;h+=we){const p=h<=i?bn:h>=i+pt?pt:h-i;if(f<p)break;const b=f-p,E=we-p;t.push(hn(Xu(p+b%E,0))),f=Ce(b/E)}t.push(hn(Xu(f,0))),i=Qu(r,c,o===a),r=0,++o}++r,++u}return t.join("")},er={version:"2.3.1",ucs2:{decode:Vu,encode:ys},decode:Ju,encode:ju,toASCII:function(e){return Yu(e,function(t){return _s.test(t)?"xn--"+ju(t):t})},toUnicode:function(e){return Yu(e,function(t){return ms.test(t)?Ju(t.slice(4).toLowerCase()):t})}},ws={default:{options:{html:!1,xhtmlOut:!1,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"“”‘’",highlight:null,maxNesting:100},components:{core:{},block:{},inline:{}}},zero:{options:{html:!1,xhtmlOut:!1,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"“”‘’",highlight:null,maxNesting:20},components:{core:{rules:["normalize","block","inline","text_join"]},block:{rules:["paragraph"]},inline:{rules:["text"],rules2:["balance_pairs","fragments_join"]}}},commonmark:{options:{html:!0,xhtmlOut:!0,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"“”‘’",highlight:null,maxNesting:20},components:{core:{rules:["normalize","block","inline","text_join"]},block:{rules:["blockquote","code","fence","heading","hr","html_block","lheading","list","reference","paragraph"]},inline:{rules:["autolink","backticks","emphasis","entity","escape","html_inline","image","link","newline","text"],rules2:["balance_pairs","emphasis","fragments_join"]}}}},Cs=/^(vbscript|javascript|file|data):/,vs=/^data:image\/(gif|png|jpeg|webp);/;function Ns(e){const t=e.trim().toLowerCase();return Cs.test(t)?vs.test(t):!0}const tr=["http:","https:","mailto:"];function Ds(e){const t=Jt(e,!0);if(t.hostname&&(!t.protocol||tr.indexOf(t.protocol)>=0))try{t.hostname=er.toASCII(t.hostname)}catch{}return at(Qt(t))}function Ss(e){const t=Jt(e,!0);if(t.hostname&&(!t.protocol||tr.indexOf(t.protocol)>=0))try{t.hostname=er.toUnicode(t.hostname)}catch{}return Ve(Qt(t),Ve.defaultChars+"%")}function _e(e,t){if(!(this instanceof _e))return new _e(e,t);t||nn(e)||(t=e||{},e="default"),this.inline=new bt,this.block=new It,this.core=new an,this.renderer=new Qe,this.linkify=new he,this.validateLink=Ns,this.normalizeLink=Ds,this.normalizeLinkText=Ss,this.utils=$a,this.helpers=Dt({},Ka),this.options={},this.configure(e),t&&this.set(t)}_e.prototype.set=function(e){return Dt(this.options,e),this},_e.prototype.configure=function(e){const t=this;if(nn(e)){const n=e;if(e=ws[n],!e)throw new Error('Wrong `markdown-it` preset "'+n+'", check name')}if(!e)throw new Error("Wrong `markdown-it` preset, can't be empty");return e.options&&t.set(e.options),e.components&&Object.keys(e.components).forEach(function(n){e.components[n].rules&&t[n].ruler.enableOnly(e.components[n].rules),e.components[n].rules2&&t[n].ruler2.enableOnly(e.components[n].rules2)}),this},_e.prototype.enable=function(e,t){let n=[];Array.isArray(e)||(e=[e]),["core","block","inline"].forEach(function(r){n=n.concat(this[r].ruler.enable(e,!0))},this),n=n.concat(this.inline.ruler2.enable(e,!0));const u=e.filter(function(r){return n.indexOf(r)<0});if(u.length&&!t)throw new Error("MarkdownIt. Failed to enable unknown rule(s): "+u);return this},_e.prototype.disable=function(e,t){let n=[];Array.isArray(e)||(e=[e]),["core","block","inline"].forEach(function(r){n=n.concat(this[r].ruler.disable(e,!0))},this),n=n.concat(this.inline.ruler2.disable(e,!0));const u=e.filter(function(r){return n.indexOf(r)<0});if(u.length&&!t)throw new Error("MarkdownIt. Failed to disable unknown rule(s): "+u);return this},_e.prototype.use=function(e){const t=[this].concat(Array.prototype.slice.call(arguments,1));return e.apply(e,t),this},_e.prototype.parse=function(e,t){if(typeof e!="string")throw new Error("Input data should be a String");const n=new this.core.State(e,this,t);return this.core.process(n),n.tokens},_e.prototype.render=function(e,t){return t=t||{},this.renderer.render(this.parse(e,t),this.options,t)},_e.prototype.parseInline=function(e,t){const n=new this.core.State(e,this,t);return n.inlineMode=!0,this.core.process(n),n.tokens},_e.prototype.renderInline=function(e,t){return t=t||{},this.renderer.render(this.parseInline(e,t),this.options,t)};const Ts=new _e({html:!1,linkify:!1,highlight(e,t){if(!t)return"";try{return`<pre class="hl"><code>${ou(e,t==="sh"?"bash":t)}</code></pre>`}catch{return""}}});function Os(e){return Ts.render(e)}function nr(e,t){const n=t.split("#")[0].split("?")[0];if(!n||/^[a-z][a-z0-9+.-]*:/i.test(n)||n.startsWith("//")||n.startsWith("/"))return null;const u=e==="."||e===""?[]:e.split("/");for(const r of Rs(n).split("/"))if(!(r===""||r==="."))if(r===".."){if(!u.length)return null;u.pop()}else u.push(r);return u.length?u.join("/"):"."}function Rs(e){try{return decodeURIComponent(e)}catch{return e}}const ur=256*1024,Ms=1024*1024,rr=10*1024*1024,Is=2*1024*1024;async function gn(e,t,n){const u=await Ke.fs.read(e,t===void 0?void 0:{offset:t,length:n});return{bytes:Dr(u),eof:u.eof}}async function mn(e,t,n){return(await gn(e,t,n)).bytes}class Fs{constructor(){this.token=0,this.objectUrls=[],this.wrap=!1,this.mdSource=!1,this.current=null,this.onNavigate=()=>{},this.bar=R("div",{class:"bar"}),this.body=R("div",{class:"viewer",tabindex:"0"}),this.el=R("div",{class:"main"},this.bar,this.body),this.empty("Select a file to view it.")}empty(t){this.release(),this.bar.replaceChildren(R("span",{class:"dim"}," ")),this.body.replaceChildren(R("div",{class:"empty"},t))}release(){this.token++;for(const t of this.objectUrls)URL.revokeObjectURL(t);this.objectUrls=[]}blobUrl(t,n){const u=URL.createObjectURL(new Blob([t],{type:n}));return this.objectUrls.push(u),u}notice(t,n,u=!1){this.body.replaceChildren(R("div",{class:`notice${u?" error":""}`},R("h2",null,t),R("div",null,n)))}async open(t,n,u=t){this.release();const r=this.token;this.current={path:t,entry:n,name:u},this.bar.replaceChildren(R("span",{class:"path",title:u},u),R("span",{class:"dim"},Be(n.size))),this.body.replaceChildren(Fn("Loading…")),this.body.scrollTop=0;try{const i=su(u);i?await this.showImage(t,n,i,r,u):cu(u)&&!this.mdSource&&n.size<=Is?await this.showMarkdown(t,n,r,u):await this.showText(t,n,r,u)}catch(i){if(r!==this.token)return;this.notice("Can't show this file",Ze(i),!0)}}controls(...t){const n=R("span",{class:"spacer"});this.bar.querySelectorAll(".ctl").forEach(r=>r.remove());const u=[n,...t];for(const r of u)r.classList?.add("ctl");this.bar.append(...u)}async showImage(t,n,u,r,i){if(n.size>rr)return this.notice("Image too large to preview",`${Be(n.size)} (limit ${Be(rr)}).`);const a=await mn(t);if(r!==this.token)return;const o=R("img",{alt:In(i)});o.addEventListener("error",()=>this.notice("Can't decode this image",`${In(i)} is not a valid ${u} file.`,!0)),o.src=this.blobUrl(a,u),o.addEventListener("load",()=>{s.textContent=`${o.naturalWidth} × ${o.naturalHeight}`});const s=R("div",{class:"dim"},"");this.body.replaceChildren(R("div",{class:"imgwrap"},o,s))}async showMarkdown(t,n,u,r){const i=new TextDecoder().decode(await mn(t));if(u!==this.token)return;const a=R("div",{class:"md"});a.innerHTML=Os(i);const o=Sr(r);for(const c of a.querySelectorAll("a")){const l=c.getAttribute("href")||"",f=nr(o,l);c.addEventListener("click",h=>{h.preventDefault(),f&&f!=="."&&this.onNavigate(f)}),f||(c.title=l)}for(const c of a.querySelectorAll("img")){const l=c.getAttribute("src")||"",f=nr(o,l);c.removeAttribute("src");const h=f?su(f):null;if(!f||!h){c.replaceWith(R("span",{class:"dim"},`[image: ${c.alt||l}]`));continue}mn(f).then(p=>{u===this.token&&(c.src=this.blobUrl(p,h))}).catch(()=>c.replaceWith(R("span",{class:"dim"},`[image not found: ${c.alt||l}]`)))}this.body.replaceChildren(a);const s=R("button",{"aria-pressed":"false"},"Source");s.addEventListener("click",()=>{this.mdSource=!0,this.open(t,n,r)}),this.controls(s)}async showText(t,n,u,r){const i=n.size,a=await gn(t,0,Math.min(Math.max(i,1),ur)),o=a.bytes;if(u!==this.token)return;if(Ji(o))return this.notice("Binary file",`${Be(i)}. Not shown as text.`);const s=i<=Ms?Vi(r):null,c=R("div",{class:`code${this.wrap?" wrap":""}`}),l=R("div",{class:"more"});this.body.replaceChildren(c,l);const f=new ji;let h=0,p=0,b=!1,E=!1;const _=k=>{let S=null;if(s&&k.length)try{S=Qi(ou(k.join(`
- `),s))}catch{S=null}const F=document.createDocumentFragment();k.forEach((z,X)=>{const ee=R("span",{class:"tx"});S&&S[X]!==void 0?ee.innerHTML=S[X]:ee.textContent=z||" ",F.append(R("div",{class:"ln"},R("span",{class:"no"},String(++p)),ee))}),c.append(F)},g=async(k,S)=>{h+=k.length,b=S||k.length===0,_(f.push(k,b))},v=()=>{if(Nr(l),b){l.append(R("span",null,`${p} lines`));return}const k=R("button",null,"Load more");k.addEventListener("click",()=>{w()}),l.append(k,R("span",null,`${Be(h)} of ${Be(i)} shown`))},w=async()=>{if(E||b)return;E=!0;const k=l.querySelector("button");k?(k.disabled=!0,k.setAttribute("aria-busy","true"),k.append(Et())):l.replaceChildren(R("span",{class:"dim",role:"status"},"Loading more…",Et()));try{const S=await gn(t,h,ur);if(u!==this.token)return;await g(S.bytes,S.eof),v()}catch(S){l.replaceChildren(R("span",{class:"dim"},`Stopped: ${Ze(S)}`))}finally{E=!1}};if(await g(o,a.eof),v(),!b&&"IntersectionObserver"in window){const k=new IntersectionObserver(S=>{if(u!==this.token)return k.disconnect();S.some(F=>F.isIntersecting)&&w().then(()=>b&&k.disconnect())},{root:this.body});k.observe(l)}const x=R("button",{"aria-pressed":String(this.wrap)},"Wrap");x.addEventListener("click",()=>{this.wrap=!this.wrap,x.setAttribute("aria-pressed",String(this.wrap)),c.classList.toggle("wrap",this.wrap)});const y=[R("span",{class:"dim"},s??"plain text"),x];if(cu(r)&&this.mdSource){const k=R("button",null,"Rendered");k.addEventListener("click",()=>{this.mdSource=!1,this.open(t,n,r)}),y.push(k)}this.controls(...y)}reopenCurrent(){this.current&&this.open(this.current.path,this.current.entry,this.current.name)}}async function Ls(){const e=document.getElementById("root");e.append(Fn("Loading…"));let t;try{t=await Ke.openArgs()}catch(c){e.replaceChildren(R("div",{class:"notice error"},R("h2",null,"Can't open"),R("div",null,Ze(c))));return}let n;try{n=await Ke.fs.stat(".")}catch(c){e.replaceChildren(R("div",{class:"notice error"},R("h2",null,"Can't read this location"),R("div",null,Ze(c))));return}const u=Tr(t.path,n.name,"."),r=new Fs,i=R("div",{class:"bar"},R("span",{class:"path",title:u},u));if(n.kind==="file"){e.replaceChildren(i,r.el),document.title=`File view: ${u}`,r.open(".",n,u.split("/").pop()||u);return}const a=new Rr,o=R("div",{class:"split"},a.el,r.el);e.replaceChildren(i,o),document.title=`File view: ${u}`,a.onOpen=(c,l)=>{r.open(c,l)},r.onNavigate=c=>{Ke.fs.stat(c).then(l=>{l.kind==="file"&&(a.reveal(c),r.open(c,l))},l=>r.empty(`Can't open ${c}: ${Ze(l)}`))};try{await a.loadRoot()}catch{return}const s=await Ke.fs.list(".").then(c=>c.entries.find(l=>l.kind==="file"&&/^readme(\.md|\.markdown|\.txt)?$/i.test(l.name)),()=>{});s&&(a.reveal(s.name),r.open(s.name,s))}Ls()})();
bin/agmsg.js · Bundled script · 273 lines · 1 finding marked
- #!/usr/bin/env node
- // agmsg npm entry.
- //
- // This package does NOT contain the agmsg implementation. It is the single
- // `agmsg` command's Node entry point, and it does two things only:
- //
- // - `agmsg install` fetches the canonical setup.sh for this package's
- // version and runs it (equivalent to the README's
- // `bash <(curl -fsSL .../setup.sh)`; process substitution keeps the tty as
- Note: Runs a downloaded script through process substitution (bash <(curl …))
- Line 10 on GitHub
- // stdin, see agmsg #98).
- // - every other command is handed, unchanged, to the bash runtime that an
- // install put on disk (scripts/agmsg). Nothing is reimplemented here.
- //
- // Usage:
- // install [options] Fetch and run the canonical setup.sh.
- // help, --help Print usage.
- // --version Print this package's and the installed runtime's version.
- // <anything else> Run the installed runtime's command with the same args.
- const { spawnSync } = require('child_process');
- const fs = require('fs');
- const os = require('os');
- const path = require('path');
- const RAW_BASE = 'https://raw.githubusercontent.com/fujibee/agmsg';
- const REPO_URL = 'https://github.com/fujibee/agmsg';
- const HOMEPAGE = 'https://agmsg.cc';
- // Install the repo ref that matches THIS bootstrapper's version, so
- // `npx agmsg@X` installs X — not whatever happens to be on main. We fetch
- // setup.sh from the matching tag AND pass AGMSG_REF so setup.sh clones the
- // same tag. Falls back to main only when the version can't be read (e.g. a
- // dev checkout with no published tag). See #172.
- //
- // Bootstrappers published before this fix (<= 1.0.5) hardcoded main and
- // cannot be retrofitted — `npx agmsg@1.0.5` will still pull main. Pinning
- // holds from the first release that ships this file (1.0.6) onward.
- function installRef() {
- const v = readVersion();
- return v && v !== '?' ? 'v' + v : 'main';
- }
- function readVersion() {
- try {
- const pkgPath = path.join(__dirname, '..', 'package.json');
- return JSON.parse(fs.readFileSync(pkgPath, 'utf8')).version;
- } catch (_) {
- return '?';
- }
- }
- // The install location. `AGMSG_CMD=<name>` selects an install made with
- // `--cmd <name>`; without it the default install is used. A named install that
- // is missing is an error -- it never falls back to the default one.
- function skillsRoot() {
- return path.join(os.homedir(), '.agents', 'skills');
- }
- function exists(p) {
- try {
- return fs.existsSync(p);
- } catch (_) {
- return false;
- }
- }
- // Sets out how to reach the runtime `agmsg` (scripts/agmsg, a bash script that
- // install.sh copies into the install). Returns { runtime } on success or
- // { error, lines } describing why it cannot be reached.
- function resolveRuntime(env, skillsDirForTest) {
- const root = skillsDirForTest || skillsRoot();
- const named = env.AGMSG_CMD;
- if (named !== undefined && named !== '') {
- if (!/^[A-Za-z0-9._-]+$/.test(named) || named === '.' || named === '..') {
- return { error: true, lines: ['agmsg: AGMSG_CMD must be a plain install name, got "' + named + '".'] };
- }
- return checkInstall(path.join(root, named), 'AGMSG_CMD=' + named);
- }
- const def = path.join(root, 'agmsg');
- const found = checkInstall(def, 'the default install');
- if (!found.error) return found;
- if (exists(path.join(def, 'scripts'))) return found;
- // No default install: list others that have a runtime, without picking one.
- let others = [];
- try {
- others = fs.readdirSync(root).filter((n) => exists(path.join(root, n, 'scripts', 'agmsg')));
- } catch (_) { /* no skills directory */ }
- if (others.length > 0) {
- return {
- error: true,
- lines: ['agmsg: there is no default install, but these installs have the agmsg command:']
- .concat(others.map((n) => ' ' + n))
- .concat(['Pick one with AGMSG_CMD=<name> agmsg …'])
- };
- }
- return found;
- }
- function checkInstall(dir, label) {
- const runtime = path.join(dir, 'scripts', 'agmsg');
- if (exists(runtime)) return { runtime, dir };
- if (exists(path.join(dir, 'scripts'))) {
- return { error: true, lines: [
- 'agmsg: ' + label + ' has no agmsg command (an older version). Update it:',
- ' agmsg install'
- ] };
- }
- return { error: true, lines: [
- 'agmsg: ' + label + ' is not installed. Install first:',
- ' agmsg install'
- ] };
- }
- function printHelp() {
- process.stdout.write([
- 'agmsg — cross-agent messaging',
- '',
- 'Usage:',
- ' agmsg install [options] install or update agmsg (runs the canonical setup.sh)',
- ' agmsg daemon <command> manage the agmsgd beta daemon (start|stop|status|enable|disable)',
- ' agmsg plugin <command> manage plugin drivers (list|install|update|remove|trust|untrust)',
- ' agmsg --version show this package and the installed runtime version',
- ' agmsg help show this message',
- '',
- 'Every command other than install is run by the agmsg install on this',
- 'machine (AGMSG_CMD=<name> picks an install made with `--cmd <name>`).',
- '',
- 'After install, restart your agent (Claude Code / Codex / Gemini CLI /',
- 'Copilot CLI / Antigravity / OpenCode) and run the agmsg skill command',
- 'to join a team.',
- '',
- 'Homepage: ' + HOMEPAGE,
- 'Issues: ' + REPO_URL + '/issues',
- ''
- ].join('\n'));
- }
- // Runs the runtime with the arguments exactly as given: an absolute path, no
- // shell, inherited stdio, and the runtime's own exit status.
- function runRuntime(runtime, args) {
- const bash = bashCommand();
- if (!bash) {
- console.error('agmsg: Git for Windows bash was not found. Install Git for Windows, then run this again.');
- process.exit(1);
- }
- const result = spawnSync(bash, [toBashPath(runtime), ...args], { stdio: 'inherit' });
- if (result.error) {
- console.error('agmsg: failed to launch bash:', result.error.message);
- process.exit(1);
- }
- if (result.signal) {
- process.kill(process.pid, result.signal);
- return;
- }
- process.exit(result.status === null ? 1 : result.status);
- }
- // On Windows a bare `bash` can be the WSL launcher, so only Git for Windows'
- // own bash.exe is used there; when it cannot be found this returns null
- // instead of falling back to a bare `bash`.
- function bashCommand() {
- if (process.platform === 'win32') {
- const roots = [process.env.ProgramFiles, process.env.ProgramW6432, process.env.LOCALAPPDATA && path.join(process.env.LOCALAPPDATA, 'Programs')]
- .filter(Boolean);
- for (const root of roots) {
- const gitBash = path.join(root, 'Git', 'bin', 'bash.exe');
- if (exists(gitBash)) return gitBash;
- }
- return null;
- }
- return 'bash';
- }
- // Normalise a native path to the forward-slash form that bash.exe and
- // curl.exe accept on Windows. bash is an MSYS2 program: Windows gives it a
- // raw command-line string rather than a real argv[], and MSYS's own argv
- // reconstruction treats backslash as an escape character, so a native
- // `C:\Users\...\setup.sh` argument gets corrupted (e.g. `\U`, `\T` are read
- // as escapes) into a path that doesn't exist — "No such file or directory"
- // for a file that's actually there. Forward slashes have no such ambiguity,
- // and both bash and curl accept them on Windows. No-op on POSIX (no
- // backslashes to replace). See #262.
- function toBashPath(p) {
- return p.replace(/\\/g, '/');
- }
- function runInstaller(passthroughArgs) {
- // Fetch the canonical setup.sh to a private tempdir, then exec it directly
- // with bash. This keeps the installer's stdin wired to the parent process's
- // tty rather than a pipe stream — which matters because install.sh has an
- // interactive `Command name [agmsg]:` prompt that would otherwise read the
- // next line of setup.sh as the command name. See agmsg #98 for the full
- // diagnosis. install.sh now guards itself with `[ -t 0 ]` (PR #99), so this
- // bootstrapper plus a still-vulnerable install.sh would also work; doing it
- // correctly here is defense-in-depth and lets future interactive prompts
- // in setup.sh keep working for real-tty users.
- const ref = installRef();
- const bash = bashCommand();
- if (!bash) {
- console.error('agmsg: Git for Windows bash was not found. Install Git for Windows, then run this again.');
- process.exit(1);
- }
- const setupUrl = RAW_BASE + '/' + ref + '/setup.sh';
- const tmpDir = fs.mkdtempSync(path.join(os.tmpdir(), 'agmsg-bootstrap-'));
- // os.tmpdir()/path.join() return backslash-separated paths on Windows.
- // fs.rmSync (below) handles that form fine since it's a native Node call;
- // curl and bash are external processes, so they get the bash-safe form.
- const setupPath = toBashPath(path.join(tmpDir, 'setup.sh'));
- try {
- console.error('agmsg: downloading installer for ' + ref + ' …');
- const fetch = spawnSync('curl', ['-fsSL', '-o', setupPath, setupUrl], { stdio: 'inherit' });
- if (fetch.error) {
- console.error('agmsg: failed to launch curl:', fetch.error.message);
- process.exit(1);
- }
- if (fetch.status !== 0) {
- console.error('agmsg: curl exited ' + fetch.status + ' fetching ' + setupUrl);
- process.exit(fetch.status || 1);
- }
- // Pin the clone inside setup.sh to the same ref we fetched it from.
- const result = spawnSync(bash, [setupPath, ...passthroughArgs], {
- stdio: 'inherit',
- env: Object.assign({}, process.env, { AGMSG_REF: ref })
- });
- if (result.error) {
- console.error('agmsg: failed to launch bash:', result.error.message);
- process.exit(1);
- }
- process.exit(result.status === null ? 1 : result.status);
- } finally {
- try { fs.rmSync(tmpDir, { recursive: true, force: true }); } catch (_) { /* best-effort */ }
- }
- }
- function main() {
- const args = process.argv.slice(2);
- if (args[0] === 'install') {
- // Forward anything after `install` (e.g. `agmsg install --cmd m`) to
- // setup.sh, which passes "$@" through to install.sh.
- runInstaller(args.slice(1));
- } else if (args.length === 0 || args[0] === '--help' || args[0] === '-h' || args[0] === 'help') {
- printHelp();
- process.exit(args.length === 0 ? 2 : 0);
- } else if (args[0] === '--version' || args[0] === '-v') {
- process.stdout.write('agmsg ' + readVersion() + ' (npm entry)\n');
- const found = resolveRuntime(process.env);
- if (found.error) {
- process.stdout.write('runtime: not available\n');
- } else {
- const bash = bashCommand();
- const v = bash ? spawnSync(bash, [toBashPath(found.runtime), '--version'], { encoding: 'utf8' }) : null;
- process.stdout.write('runtime: ' + (v && v.status === 0 ? v.stdout.trim() : 'unreadable') + '\n');
- }
- process.exit(0);
- } else {
- const found = resolveRuntime(process.env);
- if (found.error) {
- console.error(found.lines.join('\n'));
- process.exit(2);
- }
- runRuntime(found.runtime, args);
- }
- }
- if (require.main === module) {
- main();
- }
- module.exports = { toBashPath, resolveRuntime, runRuntime };
install.sh · Bundled script · 1,938 lines · 1 finding marked
- #!/usr/bin/env bash
- set -euo pipefail
- # agmsg — Agent Messaging installer
- # Installs cross-agent messaging to ~/.agents/skills/<cmd>/
- #
- # Usage:
- # ./install.sh # Interactive (asks command name only)
- # ./install.sh --cmd m # Non-interactive
- # ./install.sh --update # Update scripts in place
- #
- # Options:
- # --cmd <name> Command & skill folder name (default: agmsg)
- # Claude Code: /<cmd>, Codex: $<cmd>
- # --update Update skill scripts only (preserve DB and teams)
- #
- # Joining a team is done separately per-project, either by:
- # - Running /<cmd> in Claude Code (auto-detects if not in a team)
- # - Running: ~/.agents/skills/<cmd>/scripts/join.sh <team> <name> <type> <project>
- SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
- # Relocates the command/skill destinations this installer writes outside
- # $SCRIPT_DIR: .agents/skills/<cmd> and its Windows/sqlite3/agy-tui helpers,
- # .claude/commands, and the Copilot/OpenCode/Hermes/Grok Build/Antigravity
- # skill directories (plus each one's own existence gate -- see each use
- # below). Unset, this is $HOME -- byte-for-byte the prior behavior for THOSE
- # destinations. scripts/ itself locates SKILL_DIR from its own path (see each
- # script's own SCRIPT_DIR), never from this. CLAUDE_CONFIG_DIR is deliberately
- # not consulted here: a live Claude Code seat can run with CLAUDE_CONFIG_DIR
- # pointed at a different profile than the one install.sh should write its
- # command file for, and this override is about relocating where install.sh
- # writes, not about matching a running seat's own profile. CODEX_HOME already
- # has its own override, untouched here. This does NOT move the install's
- # runtime state root (state-root.sh's agmsg_state_base, $AGMSG_HOME or
- # ~/.agmsg by default) -- that is a separate override with its own existing
- # env var, outside what this change touches.
- INSTALL_HOME="${AGMSG_INSTALL_HOME:-$HOME}"
- # How the messages below name a location under INSTALL_HOME: "~" when it is the
- # default (the text these messages always had), the real path once
- # AGMSG_INSTALL_HOME relocates it.
- INSTALL_HOME_SHOWN="${AGMSG_INSTALL_HOME:-~}"
- AGENTS_DIR="$INSTALL_HOME/.agents"
- # agmsg-launcher.sh's own default (~/.local/bin, or ~/bin on native Windows)
- # is $HOME-rooted directly, not $AGENTS_DIR -- it already has its own
- # override, AGMSG_BIN_DIR, so default THAT from INSTALL_HOME here rather than
- # teach the launcher lib about this variable. A caller's own AGMSG_BIN_DIR
- # (set before running this installer) always wins.
- if [ -z "${AGMSG_BIN_DIR:-}" ]; then
- case "$(uname -s 2>/dev/null)" in
- MINGW*|MSYS*|CYGWIN*) AGMSG_BIN_DIR="$INSTALL_HOME/bin" ;;
- *) AGMSG_BIN_DIR="$INSTALL_HOME/.local/bin" ;;
- esac
- export AGMSG_BIN_DIR
- fi
- # Operation lock, install.db's meta row, and the completion manifest
- # (agmsgd beta) -- the same lock uninstall.sh takes, and the record both a
- # fresh install and an --update write around the scripts/ copy.
- # shellcheck disable=SC1091
- . "$SCRIPT_DIR/scripts/lib/install-op-lock.sh"
- # shellcheck disable=SC1091
- . "$SCRIPT_DIR/scripts/lib/install-db.sh"
- # shellcheck disable=SC1091
- . "$SCRIPT_DIR/scripts/lib/install-manifest.sh"
- # shellcheck disable=SC1091
- . "$SCRIPT_DIR/scripts/lib/agmsg-launcher.sh"
- # shellcheck disable=SC1091
- . "$SCRIPT_DIR/scripts/lib/down-notice.sh"
- # shellcheck disable=SC1091
- . "$SCRIPT_DIR/scripts/lib/update-command.sh"
- # Type registry — resolve each type's SKILL command template from its manifest
- # (scripts/drivers/types/<name>/template.md) instead of a hardcoded templates/ path. Read-only
- # helpers; safe to source.
- # shellcheck disable=SC1091
- . "$SCRIPT_DIR/scripts/lib/type-registry.sh"
- # type-registry.sh no longer computes $AGMSG_RENDERABLE_SKILL_TYPES at source
- # time (it is also sourced from resolve-project.sh, on a hot path that never
- # needs this list -- #631); install.sh runs once per invocation, so loading
- # it eagerly here, right after sourcing, costs nothing and keeps every read
- # below unchanged.
- agmsg_load_renderable_skill_types
- # shellcheck disable=SC1091
- . "$SCRIPT_DIR/scripts/lib/skill-render.sh"
- # agmsg_codex_config_paths — the Codex config.toml paths this install writes
- # writable_roots entries to. Shared with uninstall.sh's own cleanup (#1469)
- # so the two cannot silently disagree about which files exist again.
- # shellcheck disable=SC1091
- . "$SCRIPT_DIR/scripts/lib/codex-config.sh"
- # Where an install keeps its run/, db/, teams/ (outside the watched skills dir).
- # shellcheck disable=SC1091
- . "$SCRIPT_DIR/scripts/lib/state-root.sh"
- # shellcheck disable=SC1091
- . "$SCRIPT_DIR/scripts/lib/stale-outcome-files.sh"
- # Warning when an update adds a built-in that a trusted plugin already replaces.
- # shellcheck disable=SC1091
- . "$SCRIPT_DIR/scripts/lib/plugin-shadow.sh"
- # Types that already get their OWN dedicated skill file, written elsewhere in
- # this script -- always in that type's own format, unconditionally, gated
- # only on whether that CLI's own directory exists, never on --agent-type:
- # claude-code -> ~/.claude/commands/<cmd>.md
- # copilot -> ~/.copilot/skills/<cmd>/SKILL.md
- # opencode -> $OPENCODE_SKILL_DIR/SKILL.md
- # hermes -> $HERMES_SKILL_DIR/SKILL.md
- # grok-build -> $GROK_SKILL_DIR/SKILL.md
- # antigravity -> ~/.gemini/config/skills/<cmd>/SKILL.md (install_antigravity_skill)
- #
- # The shared ~/.agents/skills/<cmd>/SKILL.md can hold only ONE type's
- # instructions at a time, and it is what any type NOT in this list reads as
- # its ONLY instructions (today: codex, gemini, cursor, devin -- Codex in
- # particular has no dedicated file of its own). So --agent-type may retype
- # the shared file ONLY for a type not in this list; for a type that IS in
- # this list, the shared file must stay at whatever it already is, since that
- # type gets its own correctly-typed file regardless of what the shared file
- # says (#1449 -- an --agent-type other than codex used to silently retype
- # the shared file too, breaking Codex specifically, since Codex has no file
- # of its own to fall back to).
- #
- # Adding a new type's OWN dedicated file at a new site below means adding
- # that type here too, or it will keep silently retyping the shared file the
- # way #1449 describes.
- AGMSG_TYPES_WITH_OWN_SKILL_FILE="claude-code copilot opencode hermes grok-build antigravity"
- # Resolve a provenance version for the source being installed, so an installed
- # copy is uniquely identifiable even between tagged releases (the canonical
- # VERSION only bumps at release). From a git checkout: `git describe` — tag +
- # commits-since + abbreviated commit, plus `-dirty` when the source tree had
- # uncommitted changes. Non-git (tarball via setup.sh/npx, no .git): fall back to
- # the canonical VERSION file. See #117.
- agmsg_source_version() {
- local v top native
- # Only describe when SCRIPT_DIR is ITS OWN git checkout. `git describe`
- # searches ancestors for a .git, so a non-git copy unpacked under some other
- # git repo would otherwise record that PARENT repo's describe instead of
- # agmsg's canonical VERSION. Requiring the toplevel to equal SCRIPT_DIR also
- # works for agmsg's own worktrees (install.sh sits at the worktree root).
- #
- # --match "v[0-9]*" restricts `describe` to core release tags (v1.1.8, ...);
- # unrestricted --tags also matches the co-located app-v* tag lineage
- # (app-v0.2.0, ...), and whichever lineage is closer in history wins. When
- # an app-v* tag was the most recent, installs recorded provenance like
- # "app-v0.2.0-26-g95d01ca" instead of "v1.1.8-27-g95d01ca" -- a string the
- # app's own version comparison (agmsg_core_version_status in agmsg.rs)
- # can't parse as semver, which it then treats as "outdated" unconditionally.
- top="$(git -C "$SCRIPT_DIR" rev-parse --show-toplevel 2>/dev/null || true)"
- # THE TWO SIDES ARE IN DIFFERENT PATH SPACES ON WINDOWS, so the equality was
- # always false there and every Git Bash install recorded the VERSION file
- # instead of the describe string (#830):
- #
- # $SCRIPT_DIR /tmp/tmp.XXXX/agmsg MSYS form, from bash
- # git --show-toplevel C:/Users/.../tmp.XXXX/agmsg native form, from git
- #
- # `cygpath -m` is the mixed form git reports — the same second chance this
- # file already takes for the writable paths below, and the same one
- # `agmsg_cmdline_names_path` takes in compat.sh, where the identical mismatch
- # made four watcher-ownership checks answer "not ours" on Windows.
- #
- # The condition below is a CAPABILITY, not an operating system: where cygpath
- # is not on PATH, `native` stays empty and this is the plain comparison and
- # nothing else. Saying "off Windows" instead would be wider than the code —
- # this file's own test drives the second branch on macOS and Linux by putting
- # a cygpath stub on PATH.
- #
- # Where cygpath is absent, fails, returns nothing, or returns a path unequal
- # to git's toplevel, the recorded value is the fallback, exactly as before.
- # A wrong answer that happened to equal the toplevel would still take the
- # describe branch, so this is a set of conditions and not a guarantee that
- # the worst case is the old behaviour.
- native=""
- if command -v cygpath >/dev/null 2>&1; then
- native="$(cygpath -m "$SCRIPT_DIR" 2>/dev/null || true)"
- fi
- if [ -n "$top" ] && { [ "$top" = "$SCRIPT_DIR" ] || { [ -n "$native" ] && [ "$top" = "$native" ]; }; } \
- && v="$(git -C "$SCRIPT_DIR" describe --tags --always --dirty --abbrev=7 --match 'v[0-9]*' 2>/dev/null)" \
- && [ -n "$v" ]; then
- printf '%s' "$v"
- elif [ -f "$SCRIPT_DIR/VERSION" ]; then
- tr -d '[:space:]' < "$SCRIPT_DIR/VERSION"
- else
- printf 'unknown'
- fi
- }
- # After an --update the running agmsgd notices the new files within one poll
- # (5s), stops itself with "stepped_aside_for_update" (exit 0, so the service
- # manager does not schedule a restart of its own) and nothing starts it again. When the install had the daemon turned on, wait for that step-aside
- # (bounded) and start the new version, so an enabled daemon comes back by
- # itself. A failure here never fails the update; it says how to start it.
- # True only when the OS says the process does not exist (ESRCH). A process that
- # exists but cannot be signalled (EPERM), or any other failure, is NOT gone:
- # "cannot tell" stays unknown and goes the timeout way.
- agmsg_install_pid_gone() { # <pid>
- local out
- out="$(LC_ALL=C kill -0 "$1" 2>&1)" && return 1
- case "$out" in *"No such process"*) return 0 ;; esac
- return 1
- }
- # Asks a running agmsgd to stop before the update touches any file, and waits
- # until it has gone (or a bound passes), so that in the normal case the old
- # executor has left before the new files are written and the new one starts.
- # It asks over the control socket -- the request `agmsg daemon stop` sends --
- # and leaves the on/off intent alone, so the start after the update still
- # comes back by itself. Runs after the operation has begun: from then on the
- # completion record is not complete, so the launcher and agmsgd both refuse to
- # start on a half-written tree. It never refuses the update: if the daemon has
- # not gone after about AGMSG_UPDATE_STOP_WAIT seconds (default 30, measured on
- # the clock, the stop request included) the update goes on, the old executor
- # may still be running while the new files are written, and the message says
- # what to do. Reads the installed (old) install.db only; uses no installed
- # script.
- agmsg_install_stop_daemon() { # <skill_dir>
- local skill="$1" db="$1/run/install.db" state socket node pid bound deadline
- [ -f "$db" ] || return 0
- state="$(sqlite3 -cmd '.timeout 1000' "$db" "SELECT state FROM daemon_owner;" 2>/dev/null || true)"
- case "${state%$'\r'}" in ready|starting|stopping) ;; *) return 0 ;; esac
- # Tells the "stopped while enabled" warning that this gap is the update's own;
- # it expires by age, so a killed update cannot silence it for good.
- date +%s > "$skill/run/agmsgd-updating" 2>/dev/null || true
- bound="${AGMSG_UPDATE_STOP_WAIT:-30}"
- case "$bound" in ''|*[!0-9]*) bound=30 ;; esac
- deadline=$((SECONDS + bound))
- socket="$(sqlite3 -cmd '.timeout 1000' "$db" "SELECT COALESCE(socket,'') FROM daemon_owner;" 2>/dev/null || true)"
- node="$(sqlite3 -cmd '.timeout 1000' "$db" "SELECT COALESCE(node_path,'') FROM meta;" 2>/dev/null || true)"
- pid="$(sqlite3 -cmd '.timeout 1000' "$db" "SELECT COALESCE(executor_pid,0) FROM daemon_owner;" 2>/dev/null || true)"
- node="${node%$'\r'}"; socket="${socket%$'\r'}"; pid="${pid%$'\r'}"
- if [ -n "$socket" ] && [ -n "$node" ] && [ -x "$node" ]; then
- "$node" -e '
- const net = require("node:net");
- const s = net.createConnection(process.argv[1]);
- const done = () => { try { s.destroy(); } catch {} process.exit(0); };
- setTimeout(done, 5000);
- s.on("connect", () => {
- s.write(JSON.stringify({type:"hello",protocol:1,role:"control"}) + "\n");
- s.write(JSON.stringify({type:"stop"}) + "\n");
- });
- s.on("close", done);
- s.on("error", done);
- ' "$socket" >/dev/null 2>&1 || true
- fi
- while :; do
- state="$(sqlite3 -cmd '.timeout 1000' "$db" "SELECT state FROM daemon_owner;" 2>/dev/null || true)"
- [ "${state%$'\r'}" = none ] && break
- # A record that still says ready for a process that is gone (it was killed)
- # is exited too -- only when the OS says there is no such process, and only
- # where kill -0 can see it (not Git Bash).
- case "$(uname -s)" in
- MINGW*|MSYS*|CYGWIN*) ;;
- *) case "$pid" in ''|*[!0-9]*|0|1) ;; *) if agmsg_install_pid_gone "$pid"; then state=none; break; fi ;; esac ;;
- esac
- [ "$SECONDS" -lt "$deadline" ] || break
- sleep 0.2
- done
- if [ "${state%$'\r'}" = none ]; then
- echo " ~ agmsgd stopped before the update (exit confirmed)"
- else
- echo " ! agmsgd has not exited after about ${bound}s; the update goes on, and the old one may still be running while the files are replaced." >&2
- echo " If it is still running afterwards, run: bash $(printf '%q' "$skill/scripts/agmsg") daemon stop, then daemon start" >&2
- fi
- return 0
- }
- agmsg_install_restart_daemon() { # <skill_dir>
- local skill="$1" db="$1/run/install.db" intent op_gen state waited=0
- [ -f "$db" ] || return 0
- # The intent as the update saw it; the start below only goes ahead if it is
- # still this one, so a stop or disable during the wait is not undone.
- intent="$(sqlite3 "$db" "SELECT desired || '|' || op_gen FROM daemon_intent;" 2>/dev/null || true)"
- case "$intent" in on\|[0-9]*) op_gen="${intent#on|}" ;; *) return 0 ;; esac
- # Tells the "stopped while enabled" warning that this gap is the update's own
- # restart. It expires by age, so a killed update cannot silence it for good.
- date +%s > "$skill/run/agmsgd-updating" 2>/dev/null || true
- while [ "$waited" -lt 25 ]; do
- state="$(sqlite3 "$db" "SELECT state FROM daemon_owner;" 2>/dev/null || true)"
- [ "$state" = ready ] || break
- waited=$((waited + 1))
- sleep 1
- done
- echo " ~ agmsgd is turned on; starting the updated version"
- # A transient lock contention (another agmsg command or install holds
- # the install operation lock right now) is worth one more try after a
- # short wait -- the op_gen is unchanged (the guarded UPDATE never
- # applied when the lock itself could not be acquired, so nothing about
- # the install moved between attempts) -- but a permanent failure (no
- # usable Node, a bind failure, ...) is not: retrying it immediately
- # would only repeat the same error.
- local start_output start_rc=0
- start_output="$(bash "$skill/scripts/daemon.sh" start --only-if-op-gen "$op_gen" 2>&1)" || start_rc=$?
- if [ "$start_rc" -ne 0 ]; then
- case "$start_output" in
- *"could not acquire the install operation lock"*)
- printf '%s\n' "$start_output" >&2
- echo " ~ the install operation lock was busy; trying once more" >&2
- sleep 2
- start_rc=0
- start_output="$(bash "$skill/scripts/daemon.sh" start --only-if-op-gen "$op_gen" 2>&1)" || start_rc=$?
- ;;
- esac
- fi
- printf '%s\n' "$start_output"
- # `start --only-if-op-gen` exits 0 both when it actually starts agmsgd
- # AND when it skips because the intent changed while it waited (the
- # exact guard that keeps a concurrent stop/disable from being undone,
- # scripts/daemon.sh's cmd_start) -- rc alone is not a positive
- # observation that agmsgd is actually up. Only its own "running" /
- # "already running" lines confirm that; anything else (including the
- # guarded-skip line) must leave an existing down record as it is.
- case "$start_output" in
- *'agmsg daemon start: running'*|*'agmsg daemon start: already running'*)
- start_rc=0
- ;;
- *)
- [ "$start_rc" -ne 0 ] || start_rc=3
- ;;
- esac
- if [ "$start_rc" -eq 0 ]; then
- # A later run (another --update, or a manual `agmsg daemon start`)
- # may be recovering from an EARLIER failed attempt; this success
- # clears that stale record. The root that matters here is the one
- # inside the install being updated ($skill), never this installer
- # script's own location (can be a world away: an npx tarball, this
- # dev repo, ...). AGMSG_DOWN_NOTICE_ROOT, not a re-source of a
- # different copy of the file: #1928 added this script's own top-level
- # `. "$SCRIPT_DIR/scripts/lib/down-notice.sh"`, which sets the file's
- # include guard before this ever runs, so a later `. "$skill/..."`
- # would be a silent no-op (the file's own top-level sourcing wins,
- # and `_AGMSG_DOWN_NOTICE_ROOT` stays whatever IT resolved to) even
- # from inside this subshell, which inherits that guard like any other
- # variable. The override is the same convention this file already
- # uses a few lines below for `state`.
- AGMSG_DOWN_NOTICE_ROOT="$skill" down_notice_clear agmsgd || true
- elif [ "$start_rc" -eq 3 ]; then
- : # guarded skip: desired/op_gen changed while waiting; nothing to report or record here
- else
- echo " ! agmsgd did not start after the update; run: bash $(printf '%q' "$skill/scripts/agmsg") daemon start" >&2
- # This was the installer's one restart attempt (decision 11-04,
- # S01/S14): record it so it is not only a line in this terminal --
- # `agmsg doctor`, `agmsg daemon status`, and the next session-start
- # all surface it, so the enabled intent stays visibly recoverable
- # even once this terminal is gone. The recorded command names THIS
- # install's own agmsg wrapper ($skill), not the bare word "agmsg" --
- # a --cmd side install must recover itself, not whichever install
- # happens to own that name on PATH (same reasoning as #1927). Quoted
- # with single quotes (same scheme as lib/shquote.sh, inlined rather
- # than sourced since this function runs before this script is known
- # to be the up-to-date tree) -- down_notice_set now JSON-escapes free
- # text rather than rewriting it (#1929), so this would also survive
- # %q, but single quotes need no bash-version-dependent escaping of
- # their own and this recorded command is meant to actually be run,
- # not just read.
- local shq_agmsg
- shq_agmsg="'$(printf '%s' "$skill/scripts/agmsg" | sed "s/'/'\\\\''/g")'"
- AGMSG_DOWN_NOTICE_ROOT="$skill" down_notice_set agmsgd down \
- "agmsgd did not start after the update" \
- "$shq_agmsg daemon start" || true
- fi
- rm -f "$skill/run/agmsgd-updating"
- }
- # Moves an install's run/ db/ teams/ ext-tools/ .trash/ out of the skills
- # directory (scripts/lib/state-root.sh) and links them back. Codex watches
- # ~/.agents/skills and rescans every skill about every 10 seconds while agmsg
- # writes under it; writes through a symlinked directory are not reported.
- #
- # Called before the install operation begins. Whatever uses the files is stopped
- # for the move and brought back by the existing update steps (sync engines:
- # `sync restart` below; agmsgd: agmsg_install_stop_daemon here and
- # agmsg_install_restart_daemon at the end). When the state
- # cannot be moved, nothing is touched, one line names the install and the
- # reason, and the install keeps working where it is.
- # $1 skill dir $2 newline-separated teams with a running sync engine
- # The same question agmsg_install_stop_daemon asks of the recorded owner:
- # 0 = agmsgd is (still) starting, ready or stopping; 1 = confirmed not running
- # (no record, no daemon table in an install older than agmsgd, or exactly one row
- # that says none); 2 = unknown (unreadable, no row, several rows, another value).
- agmsg_install_daemon_active() { # <skill_dir>
- local db="$1/run/install.db" has row n state
- [ -f "$db" ] || return 1
- has="$(sqlite3 -cmd '.timeout 1000' "$db" "SELECT count(*) FROM sqlite_master WHERE name='daemon_owner';" 2>/dev/null)" || return 2
- case "${has%$'\r'}" in 0) return 1 ;; 1) ;; *) return 2 ;; esac
- # The table always holds exactly one row; anything else is not a record to trust.
- row="$(sqlite3 -cmd '.timeout 1000' "$db" "SELECT count(*) || '|' || coalesce(min(state), '') FROM daemon_owner;" 2>/dev/null)" || return 2
- row="${row%$'\r'}"
- n="${row%%|*}"
- state="${row#*|}"
- [ "$n" = 1 ] || return 2
- case "$state" in
- none) return 1 ;;
- ready|starting|stopping) return 0 ;;
- esac
- return 2
- }
- # The pid of <team>'s engine when it is ours to stop right now, judged by what is
- # on the machine and asked afresh each time: the pidfile of this install names a
- # live process whose command line is this install's engine script ending in
- # "run --team <team>" (the comparison remote.sh's engine status makes, through
- # the same compat functions), and the team has no systemd unit (a supervisor's
- # engine is the supervisor's). Prints the pid and returns:
- # 0 = that engine is running and is ours
- # 1 = positively no engine of ours: no pidfile, no valid pid, the process is
- # gone, or its command line was read and is not the engine
- # 2 = the team has a systemd unit: not ours to stop, not proof of anything
- # 3 = unknown: the process is alive but its command line could not be read, or
- # an observation failed (the systemd probe that exists but errors, a pidfile
- # that is there and cannot be read)
- agmsg_install_engine_owned_pid() { # <skill_dir> <team>
- local skill="$1" team="$2" pid command load systemctl_bin="${AGMSG_SYSTEMCTL:-systemctl}" pidfile
- # Only a machine without systemctl is known to have no unit. A probe that is
- # there and fails (no user bus, no permission) or answers nothing readable is
- # not "no unit": a supervisor's engine has no pidfile of ours.
- if command -v "$systemctl_bin" >/dev/null 2>&1; then
- load="$("$systemctl_bin" --user show "agmsg-remote-sync-$team.service" -p LoadState 2>/dev/null)" || return 3
- case "$load" in
- *not-found*) ;;
- *LoadState=*) return 2 ;;
- *) return 3 ;;
- esac
- fi
- # An absent pidfile is "no engine"; one that is there and cannot be read is not.
- pidfile="$skill/run/remote-sync.$team.pid"
- [ -e "$pidfile" ] || [ -L "$pidfile" ] || return 1
- pid="$(cat "$pidfile" 2>/dev/null)" || return 3
- pid="${pid%$'\r'}"
- _agmsg_pid_valid "$pid" || return 1
- _agmsg_pid_alive_local "$pid" || return 1
- command="$(compat_get_cmdline "$pid" 2>/dev/null || true)"
- [ -n "$command" ] || return 3
- agmsg_cmdline_names_path "$command" "$skill/scripts/internal/remote-sync.mjs" || return 1
- case "$command" in *" run --team $team") ;; *) return 1 ;; esac
- printf '%s\n' "$pid"
- }
- # Stops the sync engine of <team> of the install that is on disk now. The installer
- # cannot rely on the installed remote.sh to do it: releases up to 1.7.1 have no
- # `sync stop`, so it does the stopping itself, under the same team lock `sync
- # start` and `sync restart` take, so no engine is started or replaced while this
- # runs.
- # 0 = no engine of ours is running any more (there was none, or it was stopped
- # here and nothing took its place)
- # 1 = it is running and could not be stopped, or a supervisor owns it, or it was
- # replaced: none of those is proof of stopped.
- # Ownership is asked again before EACH signal, so a pid that was reused after the
- # engine left is never signalled: TERM, up to about five seconds for it to leave,
- # then (only if the same engine still runs) KILL, up to five more. The pidfile is
- # removed only if it still names the process that was stopped.
- agmsg_install_engine_stop() { # <skill_dir> <team>
- local skill="$1" team="$2"
- (
- # shellcheck disable=SC1091
- . "$SCRIPT_DIR/scripts/lib/registry-lock.sh" || exit 1
- # shellcheck disable=SC1091
- . "$SCRIPT_DIR/scripts/lib/compat.sh" || exit 1
- # shellcheck disable=SC1091
- . "$SCRIPT_DIR/scripts/lib/instance-id.sh" || exit 1
- agmsg_lock_acquire "$skill/teams/$team" || exit 1
- rc=1
- _agmsg_install_engine_stop_locked "$skill" "$team" && rc=0
- agmsg_lock_release
- exit "$rc"
- )
- }
- _agmsg_install_engine_stop_locked() { # <skill_dir> <team>
- local skill="$1" team="$2" pid current signal attempt rc=0
- pid="$(agmsg_install_engine_owned_pid "$skill" "$team")" || rc=$?
- case "$rc" in 0) ;; 1) return 0 ;; *) return 1 ;; esac
- for signal in TERM KILL; do
- rc=0
- current="$(agmsg_install_engine_owned_pid "$skill" "$team")" || rc=$?
- [ "$rc" -eq 0 ] || break
- [ "$current" = "$pid" ] || return 1
- [ "$signal" != KILL ] || echo " ~ the sync engine for '$team' (pid $pid) did not exit within 5 s after TERM; stopping it with KILL"
- kill "-$signal" "$pid" 2>/dev/null || true
- attempt=0
- while [ "$attempt" -lt 100 ]; do
- agmsg_install_pid_gone "$pid" && break 2
- attempt=$((attempt + 1))
- sleep 0.05
- done
- done
- agmsg_install_pid_gone "$pid" || return 1
- # Gone is not enough: it has to be positively "no engine of ours" now. An
- # engine that took its place, a supervisor, or something that cannot be read
- # leaves the state where it is and the pidfile alone.
- rc=0
- agmsg_install_engine_owned_pid "$skill" "$team" >/dev/null || rc=$?
- [ "$rc" -eq 1 ] || return 1
- [ "$(cat "$skill/run/remote-sync.$team.pid" 2>/dev/null || true)" != "$pid" ] || rm -f "$skill/run/remote-sync.$team.pid"
- echo " ~ stopped the sync engine for '$team' (pid $pid); the update starts it again"
- return 0
- }
- # A state that stays where Codex watches is shown where a person already looks
- # (agmsg status, doctor, the start of a session), not only in this run's output.
- # The record is cleared once the state has moved.
- agmsg_install_state_notice() { # <skill_dir> <reason>
- AGMSG_DOWN_NOTICE_ROOT="$1" down_notice_set state degraded \
- "the state of '${1##*/}' is still in $1, a directory Codex watches (not moved: $2)" \
- "$(agmsg_update_command "$1") (the next update tries the move again)" || true
- }
- agmsg_install_move_state() {
- local skill="$1" teams="$2" root name part moved_any=false need=false team
- name="${skill##*/}"
- root="$(agmsg_state_root "$skill" "$AGENTS_DIR")"
- for part in $AGMSG_STATE_PARTS; do
- [ -L "$skill/$part" ] || need=true
- if [ -d "$skill/$part" ] && [ ! -L "$skill/$part" ]; then moved_any=true; fi
- done
- if [ "$need" = false ]; then
- # Already linked: only record who owns the root and where it is.
- local linked
- linked="$(readlink "$skill/run" 2>/dev/null)"
- case "$linked" in /*/run) root="${linked%/run}" ;; esac
- agmsg_state_adopt "$skill" "$root" || true
- AGMSG_DOWN_NOTICE_ROOT="$skill" down_notice_clear state || true
- [ ! -f "$skill/.agmsg" ] || agmsg_state_marker_write "$skill" || true
- return 0
- fi
- if ! agmsg_state_preflight "$skill" "$root"; then
- echo " ! state of '$name' is not moved; it keeps working in place (Codex rescans its skills on writes there)" >&2
- agmsg_install_state_notice "$skill" "${AGMSG_STATE_REASON:-the target could not be prepared}"
- [ ! -f "$skill/.agmsg" ] || agmsg_state_marker_write "$skill" || true
- return 0
- fi
- if [ "$moved_any" = true ]; then
- # The caller holds the install operation lock (and has refused on an
- # unfinished operation record) from before this point to the end of the update.
- echo " ~ moving the state of '$name' to $root (a link stays in $skill)"
- # Same stop the update uses before replacing scripts: the intent stays on, so
- # the update's own restart at the end brings agmsgd back. The move only goes
- # on when every writer is positively stopped; otherwise what was stopped is
- # started again and the state stays where it is.
- local stopped="" stop_failed=""
- agmsg_install_stop_daemon "$skill"
- local active=0
- agmsg_install_daemon_active "$skill" || active=$?
- if [ "$active" = 0 ]; then
- stop_failed="agmsgd did not confirm that it stopped"
- elif [ "$active" = 2 ]; then
- stop_failed="the state of agmsgd in $skill/run/install.db cannot be read"
- else
- while IFS= read -r team; do
- [ -n "$team" ] || continue
- if agmsg_install_engine_stop "$skill" "$team"; then
- stopped="$stopped
- $team"
- else
- stop_failed="the sync engine for '$team' could not be stopped"
- break
- fi
- done <<< "$teams"
- fi
- if [ -n "$stop_failed" ]; then
- # shellcheck disable=SC2034 # read by agmsg_state_marker_write
- AGMSG_STATE_REASON="$stop_failed"
- echo " ! state of '$name' is not moved: $stop_failed; it keeps working in place (Codex rescans its skills on writes there)" >&2
- agmsg_install_state_notice "$skill" "$stop_failed"
- # An update goes on from here and starts agmsgd and the engines it found
- # running itself once the new files and the completion record are in
- # place; starting them now would run the old scripts against a record that
- # is aside. Anything else (a plain install) puts back what it stopped.
- if [ "$UPDATE_ONLY" != true ]; then
- agmsg_install_restart_daemon "$skill"
- while IFS= read -r team; do
- [ -n "$team" ] || continue
- bash "$skill/scripts/remote.sh" sync restart "$team" >/dev/null 2>&1 \
- || echo " ! could not restart the sync engine for '$team'; run: bash $skill/scripts/remote.sh sync restart $team" >&2
- done <<< "$stopped"
- fi
- [ ! -f "$skill/.agmsg" ] || agmsg_state_marker_write "$skill" || true
- return 0
- fi
- fi
- # The install operation lock (.install-op/lock.db, in the install directory,
- # which this move never touches) is already held by the caller from before the
- # checks above, so no other install, update or uninstall runs while run/ is
- # renamed and linked.
- local link_ok=false
- agmsg_state_link "$skill" "$root" && link_ok=true
- if [ "$link_ok" != true ]; then
- echo " ! the state of '$name' was only partly moved; fix the lines above, then run the update again" >&2
- agmsg_install_state_notice "$skill" "the move stopped part way"
- else
- AGMSG_DOWN_NOTICE_ROOT="$skill" down_notice_clear state || true
- fi
- [ ! -f "$skill/.agmsg" ] || agmsg_state_marker_write "$skill" || true
- return 0
- }
- agmsg_install_restart_guidance() {
- echo ' Next: finish your current work, then close and reopen each running agent.'
- echo ' Resume the same conversation and run your messaging skill with actas <existing-agent-name> to refresh its destination.'
- printf ' Check notice delivery from that session with: bash %q status <type> <project>\n' "$SKILL_DIR/scripts/delivery.sh"
- printf ' If you use agmsgd, check it with: bash %q daemon status\n' "$SKILL_DIR/scripts/agmsg"
- echo ' An update starts an enabled agmsgd again by itself; if status still says it is stopped, run agmsg daemon start.'
- echo ' This installation does not enable agmsgd or switch existing sessions automatically.'
- }
- # The running agent may still have the pre-update skill in its context.
- agmsg_install_update_reading_hint() { # <skill_dir> <release version>
- printf 'agmsg was updated to %s. This session still has the old skill loaded. Re-read "%s/SKILL.md", read the %s section of "%s/CHANGELOG.md", and tell the user what changed and which settings it recommends.\n' "$2" "$1" "$2" "$1"
- }
- # One line pointing at agmsgd, only while it is off. Never turns it on. Kept in
- # one place so the wording, and later a different default, change here only.
- agmsg_install_daemon_hint() { # <skill_dir>
- local skill="$1" desired
- desired="$(sqlite3 -readonly "$skill/run/install.db" "SELECT desired FROM daemon_intent;" 2>/dev/null || true)"
- [ "$desired" != on ] || return 0
- printf ' agmsgd (beta) delivers notices to Claude Code and Codex sessions directly. Turn it on with: bash %q daemon enable\n' "$skill/scripts/agmsg"
- }
- # --- Defaults ---
- CMD_NAME=""
- UPDATE_ONLY=false
- RECOVER_ID=""
- INTERACTIVE=true
- AGENT_TYPE="" # claude-code, codex, gemini, antigravity — passed via --agent-type, or empty for auto/default
- # The registry derives this list from eligible manifests with template= keys.
- # It is shared by fresh install, --update selection, and --update re-detection;
- # adding a templated type therefore cannot silently fall back to the wrong flavor.
- # A relative scripts/ path is safe to use as a trash destination component
- # only if it cannot resolve outside the tree it was found in: no embedded
- # newline (see the NUL-delimited note below), no ".." component anywhere,
- # no leading "/". Shared by both functions below -- the same escape a mv
- # target is exposed to is the one an rm target was.
- agmsg_scripts_rel_is_safe() {
- case "$1" in
- ""|*$'\n'*|..|../*|*/../*|*/..|/*) return 1 ;;
- esac
- return 0
- }
- # Before `cp -R` (used at both call sites below) overwrites $dest with
- # $src, back up any file it is about to change -- i.e. present in both
- # trees with DIFFERENT content -- into $trash_root, keyed by its relative
- # path. `cp -R` only ever adds or overwrites; a file a user (or their
- # agent) had edited in place under scripts/ was overwritten with no record
- # of what was there before, silently, mid-upgrade, with nobody reading the
- # output. This runs against the WHOLE src tree, drivers/ included: backing
- # a file up never removes it or changes whether it loads, so #1249's
- # contract (a user-added driver directory must survive an update) is
- # untouched by this step -- that contract is only about the prune below.
- # Identical content is skipped so an ordinary upgrade doesn't fill .trash/
- # with copies of files nobody touched.
- agmsg_stage_overwrite_backups() {
- local src="$1" dest="$2" trash_root="$3"
- local entry rel
- while IFS= read -r -d '' entry; do
- rel="${entry#./}"
- agmsg_scripts_rel_is_safe "$rel" || continue
- [ -f "$dest/$rel" ] || continue
- cmp -s "$src/$rel" "$dest/$rel" && continue
- agmsg_install_op_require || return 1
- mkdir -p "$(dirname "$trash_root/$rel")"
- agmsg_install_op_require || return 1
- cp -p "$dest/$rel" "$trash_root/$rel"
- agmsg_install_op_require || return 1
- AGMSG_TRASH_COUNT=$((AGMSG_TRASH_COUNT + 1))
- done < <(cd "$src" && find . -type f -print0)
- }
- # After `cp -R`: move any file under $dest that $src does not ship into
- # $trash_root instead of deleting it, so a wrong "not shipped anymore"
- # judgment (this function's own past mistake, or a future one) is a mv, not
- # data loss. Every prior release that dropped a file needed its own
- # one-off `rm -f` here (rearm.sh in 1.3.2/#1321, the Antigravity resume
- # helper's move) -- that hand-maintenance is what this generalizes. One of
- # those leftovers (rearm.sh) was run by hand after it had already been
- # removed from the release and behaved like the retired tool it used to
- # be, not like the current procedure.
- #
- # Scoped to exclude scripts/drivers/ entirely: that tree is the driver
- # discovery surface (ADR 0002, scripts/lib/driver-registry.sh), and #1249
- # already established -- with a test -- that a user-added driver directory
- # there must survive an update even though it ships nothing this release
- # knows about (it stays untrusted/unloaded until the user opts in, but it is
- # not deleted). Nothing else under scripts/ has a comparable drop-in
- # contract, so everywhere else is safe to move against the release's own
- # file list. (The backup step above still covers drivers/'s own shipped
- # files -- only the "not shipped anymore" judgment excludes that tree.)
- #
- # NUL-delimited throughout, not newline-delimited: a `find | while read`
- # split on newline lets an embedded newline in a filename forge a second,
- # fake "line". A file at scripts/<name-containing-LF>../ext-tools/<team>/
- # <name>.secret would, read back newline-split, produce a second entry that
- # reads as the literal relative path ../ext-tools/<team>/<name>.secret --
- # which resolves OUTSIDE scripts/, onto a real secret this function must
- # never touch. Same shape as the jev adapter's curl-config parser fixed the
- # same night: a line-delimited format fed a value from outside the format
- # can smuggle an extra line. `-print0` / `read -d ''` keeps one filesystem
- # entry as one value, embedded newline and all, so it can never be split.
- # NUL-safety on its own is still only a delimiter fix, not a check on what
- # the delimiter protects, so `$rel` is also validated immediately before the
- # `mv` that acts on it -- not merely before the membership compare -- and
- # anything with `..`, a leading `/`, or an embedded newline is left alone
- # and named on stderr instead of being moved.
- agmsg_prune_removed_scripts() {
- local src="$1" dest="$2" trash_root="$3"
- local entry rel s found
- local -a shipped=()
- while IFS= read -r -d '' entry; do
- shipped+=("${entry#./}")
- done < <(cd "$src" && find . -type f -print0)
- while IFS= read -r -d '' entry; do
- rel="${entry#./}"
- [ -n "$rel" ] || continue
- case "$rel" in drivers/*) continue ;; esac
- if ! agmsg_scripts_rel_is_safe "$rel"; then
- echo " ! not moving -- suspicious scripts/ entry: $rel" >&2
- continue
- fi
- found=""
- for s in "${shipped[@]}"; do
- if [ "$s" = "$rel" ]; then
- found=1
- break
- fi
- done
- if [ -z "$found" ]; then
- echo " - moving to .trash/ (no longer shipped): scripts/$rel"
- agmsg_install_op_require || return 1
- mkdir -p "$(dirname "$trash_root/$rel")"
- agmsg_install_op_require || return 1
- mv "$dest/$rel" "$trash_root/$rel"
- agmsg_install_op_require || return 1
- AGMSG_TRASH_COUNT=$((AGMSG_TRASH_COUNT + 1))
- fi
- done < <(cd "$dest" && find . -type f -print0)
- }
- # One generation of .trash/ -- cleared at the start of the update/install
- # that is about to populate it, so a mistake from two upgrades ago cannot
- # still be sitting there when this one is trying to be readable. $trash_root
- # must be a sibling of scripts/ (as both call sites pass it), never inside
- # it -- a .trash/ nested under scripts/ would have its OWN prior contents
- # picked up by the very next prune as "not shipped".
- agmsg_reset_trash() {
- local dir="$1"
- agmsg_install_op_require || return 1
- # .trash may be a link to the state kept outside the skills directory: empty
- # what it points at and keep the link.
- if [ -L "$dir" ]; then dir="$(readlink "$dir")"; fi
- rm -rf "$dir"
- agmsg_install_op_require || return 1
- mkdir -p "$dir"
- agmsg_install_op_require
- }
- # Begin one install transaction before its first file change. The lock stays
- # held through all rendering, script changes, VERSION writes, and setup work;
- # the completion manifest is published only by the matching finish call.
- # A crash before finish leaves .prev as the last known-good state.
- #
- # Requires (globals the caller must already have set): SCRIPT_DIR, SKILL_DIR,
- # INSTALLED_VERSION.
- agmsg_install_operation_exit() {
- if [ "${AGMSG_INSTALL_OP_ACTIVE:-false}" = true ]; then
- agmsg_install_op_unlock
- AGMSG_INSTALL_OP_ACTIVE=false
- fi
- }
- agmsg_install_write_recovery_helper() {
- local helper="$SKILL_DIR/run/install-op-recovery.sh" temp
- agmsg_install_op_require || return 1
- temp="$(mktemp "$SKILL_DIR/run/.install-op-recovery.XXXXXX")" || return 1
- if ! cat "$SCRIPT_DIR/scripts/lib/codex-config.sh" "$SCRIPT_DIR/scripts/lib/sqlite-crlf.sh" "$SCRIPT_DIR/scripts/lib/sqlpath.sh" \
- "$SCRIPT_DIR/scripts/lib/sqlite-output.sh" "$SCRIPT_DIR/scripts/lib/install-op-lock.sh" "$SCRIPT_DIR/scripts/lib/state-root.sh" > "$temp"; then
- rm -f "$temp"
- return 1
- fi
- if ! chmod 600 "$temp"; then
- rm -f "$temp"
- return 1
- fi
- agmsg_install_op_require || { rm -f "$temp"; return 1; }
- if ! mv -f "$temp" "$helper"; then
- rm -f "$temp"
- return 1
- fi
- agmsg_install_op_require
- }
- agmsg_install_operation_begin() {
- local manifest="$SKILL_DIR/run/install-manifest.json"
- local lock_db="$SKILL_DIR/.install-op/lock.db"
- local install_db="$SKILL_DIR/run/install.db"
- mkdir -p "$SKILL_DIR/run"
- if ! agmsg_install_op_lock "$lock_db"; then
- echo " ! could not take the install operation lock: ${AGMSG_INSTALL_OP_LOCK_FAILURE_REASON:-unknown lock handshake failure}" >&2
- return 1
- fi
- AGMSG_INSTALL_OP_ACTIVE=true
- trap 'agmsg_install_operation_exit' EXIT
- if ! agmsg_install_op_legacy_lock_hold "$SKILL_DIR"; then
- echo " ! another agmsg install or update is running (it holds the old-layout lock $SKILL_DIR/run/install-op.lock.db); nothing was changed. Run this again after it finishes." >&2
- return 1
- fi
- trap 'agmsg_install_op_handle_signal INT' INT
- trap 'agmsg_install_op_handle_signal TERM' TERM
- agmsg_install_op_require || return 1
- local pending="$SKILL_DIR/run/install-op-incomplete.json"
- local recovery_prefix operation_mode=install
- recovery_prefix="bash $(printf '%q' "$SCRIPT_DIR/install.sh") --cmd $(printf '%q' "$CMD_NAME")"
- if [ "$UPDATE_ONLY" = true ]; then
- operation_mode=update
- recovery_prefix="$recovery_prefix --update"
- fi
- recovery_prefix="$recovery_prefix --recover"
- if [ -n "$RECOVER_ID" ]; then
- agmsg_install_op_pending_recover "$pending" "$RECOVER_ID" install "$operation_mode" || return 1
- RECOVER_ID=""
- elif [ -e "$pending" ] || [ -L "$pending" ]; then
- agmsg_install_op_pending_refuse "$pending" "$recovery_prefix" install "$operation_mode"
- return 1
- fi
- AGMSG_INSTALL_OP_MARKER="$pending"
- agmsg_install_op_pending_begin "$pending" install "$SKILL_DIR" "" "$operation_mode" || return 1
- if [ "${UPDATE_ONLY:-false}" = true ] && [ ! -f "$SKILL_DIR/.agmsg" ]; then
- echo " ! the selected installation was removed before the update could acquire its lock" >&2
- return 1
- fi
- # Validate the prior generation before making any installation change. A
- # first install is generation 1 only when neither completion file exists.
- if ! AGMSG_INSTALL_GEN="$(agmsg_install_manifest_next_gen "$manifest")"; then
- return 1
- fi
- agmsg_install_op_require || return 1
- AGMSG_INSTALL_ID="$(agmsg_install_db_ensure_meta "$install_db")" || return 1
- agmsg_install_op_require || return 1
- if [ -z "$AGMSG_INSTALL_ID" ]; then
- echo " ! could not read or create install.db's meta row" >&2
- return 1
- fi
- if ! agmsg_install_db_apply_schema "$install_db" "$SCRIPT_DIR/scripts/daemon/schema.sql"; then
- echo " ! could not apply the daemon schema to install.db" >&2
- return 1
- fi
- agmsg_install_op_require || return 1
- if ! agmsg_install_manifest_rotate_prev "$manifest"; then
- echo " ! could not move the previous completion record aside" >&2
- return 1
- fi
- agmsg_install_op_require || return 1
- AGMSG_INSTALL_MANIFEST="$manifest"
- return 0
- }
- agmsg_install_operation_finish() {
- if [ -z "${AGMSG_INSTALL_BOOTSTRAP_VERSION:-}" ]; then
- echo " ! the installed bootstrap version was not verified; refusing to write a completion record" >&2
- return 1
- fi
- agmsg_install_op_require || return 1
- if ! agmsg_install_manifest_write \
- "$SKILL_DIR/scripts" "$AGMSG_INSTALL_MANIFEST" "$INSTALLED_VERSION" \
- "$AGMSG_INSTALL_ID" "$AGMSG_INSTALL_GEN" "$AGMSG_INSTALL_BOOTSTRAP_VERSION"; then
- echo " ! could not write the new completion record; the previous install stays in place (see .prev)" >&2
- return 1
- fi
- agmsg_install_op_require || return 1
- agmsg_install_op_pending_complete "$AGMSG_INSTALL_OP_MARKER" "$AGMSG_INSTALL_OP_ID" || {
- echo " ! could not clear the completed-operation record; later changes are blocked pending recovery" >&2
- return 1
- }
- trap - EXIT
- trap - INT TERM
- agmsg_install_op_unlock
- AGMSG_INSTALL_OP_ACTIVE=false
- unset AGMSG_INSTALL_ID AGMSG_INSTALL_GEN AGMSG_INSTALL_MANIFEST AGMSG_INSTALL_BOOTSTRAP_VERSION AGMSG_INSTALL_OP_ID AGMSG_INSTALL_OP_MARKER
- return 0
- }
- # The scripts/ copy runs inside the install transaction opened above. It does
- # not acquire or release the lock, and it does not publish the completion
- # manifest; the caller does that only after every install-side write is done.
- #
- # Requires (globals the caller must already have set): SCRIPT_DIR, SKILL_DIR,
- # TRASH_DIR (agmsg_reset_trash already run on it), INSTALLED_VERSION, plus an
- # active transaction from agmsg_install_operation_begin.
- # Updates AGMSG_TRASH_COUNT via the existing backup/prune helpers, same as
- # before this existed.
- #
- # Lock ordering (2026-09-29 design decision): registry lock -> this
- # install operation lock -> team store lock, never the reverse. This
- # function never acquires a registry or team-store lock itself, so it
- # cannot invert that order on its own; it is documented here as the
- # constraint any future caller that nests this inside one of those must not
- # break.
- agmsg_install_copy_scripts() {
- local stage_dir=""
- local daemon_files="agmsgd agmsgd-launch.sh"
- local f
- # Exclude the two rename-placed files from the bulk copy by giving cp -R a
- # PRIVATE STAGING COPY of scripts/ with those two removed, rather than
- # temporarily removing them from $SCRIPT_DIR itself. The first version of
- # this function did the latter -- hid them from $SCRIPT_DIR, restored them via
- # an EXIT trap -- and it was genuinely unsafe: $SCRIPT_DIR is the same,
- # SHARED, live checkout every install.sh invocation reads from, so a
- # second install run against it (even sequentially, one finishing before
- # the next starts) could observe the files gone if anything landed between
- # the hide and the restore. Measured: a two-install-in-a-row test hit
- # exactly this and failed to place scripts/daemon/agmsgd. The staging copy
- # never touches $SCRIPT_DIR at all, so there is nothing to race.
- #
- # agmsg_stage_overwrite_backups / agmsg_prune_removed_scripts still read
- # the REAL $SCRIPT_DIR/scripts (not the staging copy) for "what does this
- # release ship" -- they only ever READ that tree, never write it, and the
- # two daemon files genuinely ARE shipped (just placed a different way), so
- # excluding them from THAT membership list would wrongly trash a prior
- # install's copies of them.
- # Cleaned up explicitly at each exit point below, not via a RETURN trap:
- # a RETURN trap set inside this function does NOT clear itself when the
- # function returns -- it stays armed for the rest of the calling script
- # and fires again on the NEXT function return or `source` anywhere later,
- # by which point stage_dir (a local of THIS call) reads as empty in that
- # unrelated context. Measured directly: a trap set this way fired a
- # second time after an unrelated `source` command completed, well after
- # this function had already returned.
- stage_dir="$(mktemp -d)" || return 1
- if ! cp -R "$SCRIPT_DIR/scripts/." "$stage_dir/"; then
- rm -rf "$stage_dir" 2>/dev/null
- echo " ! could not stage scripts/ for copying; the previous install stays in place (see .prev)" >&2
- return 1
- fi
- for f in $daemon_files; do
- rm -f "$stage_dir/daemon/$f"
- done
- local copy_rc=0
- # Backups and the staged copy are one scripts-copy phase. The following
- # prune phase rechecks the lock before it can remove anything from the target.
- agmsg_install_op_phase_begin || copy_rc=1
- if [ "$copy_rc" -eq 0 ]; then
- agmsg_stage_overwrite_backups "$SCRIPT_DIR/scripts" "$SKILL_DIR/scripts" "$TRASH_DIR" || copy_rc=1
- fi
- if [ "$copy_rc" -eq 0 ]; then
- agmsg_install_op_run_writer cp -R "$stage_dir/." "$SKILL_DIR/scripts/" || copy_rc=1
- fi
- agmsg_install_op_phase_end
- if [ "$copy_rc" -eq 0 ]; then
- agmsg_install_op_run_phase agmsg_prune_removed_scripts \
- "$SCRIPT_DIR/scripts" "$SKILL_DIR/scripts" "$TRASH_DIR" || copy_rc=1
- fi
- rm -rf "$stage_dir" 2>/dev/null
- if [ "$copy_rc" -ne 0 ]; then
- echo " ! scripts/ copy failed; the previous install stays in place (see .prev)" >&2
- return 1
- fi
- agmsg_install_op_phase_begin || return 1
- mkdir -p "$SKILL_DIR/scripts/daemon" || return 1
- for f in $daemon_files; do
- if ! agmsg_install_place_daemon_file \
- "$SCRIPT_DIR/scripts/daemon/$f" "$SKILL_DIR/scripts/daemon/$f"; then
- echo " ! could not place scripts/daemon/$f; the previous install stays in place (see .prev)" >&2
- return 1
- fi
- done
- agmsg_install_op_phase_end
- # agmsgd and agmsgd-launch.sh are a fixed-shape pair that must carry the
- # SAME bootstrap version (agmsgd beta) -- a mismatch
- # here means the two files this install just placed together are already
- # inconsistent with each other, which the manifest must never assert as a
- # single agreed value. Extracted by exact pattern from each file's own
- # embedded constant (see their own headers for why the pattern is pinned).
- local launch_bv entry_bv
- launch_bv="$(grep -m1 '^BOOTSTRAP_VERSION=' "$SKILL_DIR/scripts/daemon/agmsgd-launch.sh" 2>/dev/null | cut -d= -f2)"
- entry_bv="$(grep -m1 '^const BOOTSTRAP_VERSION = ' "$SKILL_DIR/scripts/daemon/agmsgd" 2>/dev/null | sed 's/^const BOOTSTRAP_VERSION = \([0-9]*\);*$/\1/')"
- if [ -z "$launch_bv" ] || [ -z "$entry_bv" ] || [ "$launch_bv" != "$entry_bv" ]; then
- echo " ! agmsgd and agmsgd-launch.sh disagree on (or are missing) BOOTSTRAP_VERSION" >&2
- return 1
- fi
- AGMSG_INSTALL_BOOTSTRAP_VERSION="$launch_bv"
- return 0
- }
- agmsg_install_optional_copy() {
- cp "$@" 2>/dev/null || true
- }
- agmsg_install_optional_uninstaller_copy() {
- cp "$SCRIPT_DIR/uninstall.sh" "$SKILL_DIR/uninstall.sh" 2>/dev/null && \
- chmod +x "$SKILL_DIR/uninstall.sh" 2>/dev/null || true
- }
- agmsg_install_optional_codex_chmod() {
- chmod +x "$SKILL_DIR/scripts/drivers/types/codex/"*.sh 2>/dev/null || true
- }
- # Runs `codex-shim-install.sh sync` and shows what it did. A shim that was
- # removed or put back is reported; a failure is shown with the command that
- # repeats it, and never fails the install.
- agmsg_install_sync_codex_shim() {
- local out
- [ -x "$CODEX_SHIM" ] || return 0
- if out="$(AGMSG_CODEX_SHIM_INSTALL_QUIET=1 "$CODEX_SHIM" sync 2>&1)"; then
- case "$out" in removed:*|installed:*) echo " ~ Codex shim: $out" ;; esac
- else
- echo " ! could not update the Codex shim: $out" >&2
- echo " repeat with: $CODEX_SHIM sync" >&2
- fi
- return 0
- }
- agmsg_install_refresh_codex_shim() {
- env AGMSG_CODEX_SHIM_INSTALL_QUIET=1 AGMSG_CODEX_SHIM_FORCE="${CODEX_SHIM_FORCE:-}" \
- "$CODEX_SHIM" install >/dev/null
- return 0
- }
- agmsg_install_write_version() {
- printf '%s\n' "$INSTALLED_VERSION" > "$SKILL_DIR/VERSION"
- }
- agmsg_install_touch_marker_and_write_version() {
- agmsg_state_marker_write "$SKILL_DIR" || return 1
- agmsg_install_write_version
- }
- agmsg_remove_retired_terminal_skills() {
- local driver
- for driver in herdr plain tmux; do
- rm -f "$SKILL_DIR/scripts/drivers/terminals/$driver/SKILL.md"
- done
- }
- agmsg_install_place_daemon_file() {
- agmsg_atomic_place_file "$1" "$2" || return 1
- chmod +x "$2" 2>/dev/null || true
- }
- # Put <src> at <dest>, then remove any leftover <src>. The arm is chosen by
- # <dest>, so the fix's scope matches the defect's (#747):
- # - regular <dest>: `mv` — an atomic rename, so an interrupted install leaves
- # either the whole old config or the whole new one, never a torn file. This
- # is the common path and must stay atomic.
- # - symlinked <dest>: write THROUGH the link (a redirect follows it) so a
- # config.toml managed as a symlink (stow/chezmoi/manual dotfiles) keeps its
- # link and its target receives the edit. `mv` would replace the link with a
- # plain file and strand the edit on a detached copy — the actual #747 bug.
- # This arm is non-atomic (there is no atomic write-through-a-link with plain
- # POSIX tools), but the exposure is confined to symlink users, whose target
- # is typically a version-controlled dotfile.
- move_into_place() {
- agmsg_install_op_require || return 1
- if [ -L "$2" ]; then
- cat "$1" > "$2" && rm -f "$1"
- else
- mv "$1" "$2"
- fi
- agmsg_install_op_require
- }
- # Brings ONE Codex config.toml's writable_roots in line with this install, in a
- # single pass over the file: it drops the entries an earlier release wrote for
- # db/, teams/, run/ and ext-tools/ under the skills directory when those are
- # now links into a state root (Codex rejects a writable root that contains a
- # symlink), and adds this install's own paths (the arguments) that the array
- # does not hold yet.
- #
- # The file is read by the TOML string rules over its whole length (basic,
- # literal and multi-line strings, comments, table headers), so only the real
- # writable_roots array is looked at or edited: the same text inside a
- # multi-line value elsewhere stays byte for byte. An element is compared by its
- # decoded value, in whichever string spelling it is written. Every other
- # element, the user's own and other installs', stays. When the array is missing
- # the key is added under [sandbox_workspace_write], and that table when it is
- # missing too. Entries are added to that table only; an array in a profile
- # table is never added to (obsolete entries are dropped from any of them).
- #
- # The awk exit status says what it did: 10 nothing, 11 removed, 12 added,
- # 13 both. Only a changed file is backed up (once) and replaced.
- _sync_codex_roots() {
- local code_config="$1" stale=() _s scan=0
- shift
- local writable_paths=("$@")
- if [ ! -f "$code_config" ]; then
- return 0
- fi
- while IFS= read -r _s; do
- [ -n "$_s" ] && stale+=("$_s")
- done < <(agmsg_codex_stale_writable_paths "$SKILL_DIR")
- agmsg_install_op_require || return 1
- AGMSG_STALE_ROOTS="$(printf '%s\n' ${stale[@]+"${stale[@]}"})" \
- AGMSG_WANT_ROOTS="$(printf '%s\n' ${writable_paths[@]+"${writable_paths[@]}"})" \
- agmsg_codex_roots_scan "$code_config" > "$code_config.tmp" || scan=$?
- if [ "$scan" -eq 10 ]; then
- command rm -f "$code_config.tmp"
- echo " ~ Codex writable_roots already configured ($code_config)"
- return 0
- fi
- if [ "$scan" -lt 11 ] || [ "$scan" -gt 13 ]; then
- command rm -f "$code_config.tmp"
- return 1
- fi
- agmsg_install_op_require || return 1
- cp "$code_config" "$code_config.bak"
- agmsg_install_op_require || return 1
- echo " ~ backed up $code_config → $code_config.bak"
- move_into_place "$code_config.tmp" "$code_config"
- agmsg_install_op_require || return 1
- if [ $(( scan & 1 )) -eq 1 ]; then
- echo " ~ replaced Codex writable_roots entries that are now links ($code_config)"
- fi
- if [ $(( scan & 2 )) -eq 2 ]; then
- echo " + added Codex writable_roots for db/, teams/, run/, and ext-tools/ ($code_config)"
- fi
- }
- configure_codex_sandbox() {
- agmsg_install_op_require || return 1
- # --- Configure Codex sandbox (if Codex is installed) ---
- # The Codex bridge writes pidfiles/sockets/request files under the
- # skill's db/, teams/, run/ dirs; Codex's sandbox blocks those writes unless
- # they are listed as writable_roots. See docs/codex-monitor-beta.md.
- #
- # ext-tools/ is here for the same reason: an ext-tool member's `setup`
- # (secret and save) writes its config/key under the skill's ext-tools/
- # dir, and a sandboxed Codex seat could not write there without this --
- # measured directly against a real seat (`codex exec -s workspace-write`,
- # not the `codex sandbox` debug subcommand, which does not apply
- # config.toml's writable_roots at all and rejects every write regardless),
- # which failed with `mkdir: .../ext-tools/<team>: Operation not permitted`
- # before this entry existed, and succeeded once it was added.
- #
- # Respect CODEX_HOME exclusively when set. The same profile selection is
- # shared with uninstall and the read-only session notice.
- local codex_configs=()
- local _cfg
- while IFS= read -r _cfg; do
- codex_configs+=("$_cfg")
- done < <(agmsg_codex_config_paths)
- unset _cfg
- # agmsg_codex_writable_paths (scripts/lib/codex-config.sh) computes the
- # list, including the Windows cygpath conversion, so this can never
- # disagree with what the session-start notice checks for (#1483 review).
- local writable_paths=()
- local _wp
- while IFS= read -r _wp; do
- writable_paths+=("$_wp")
- done < <(agmsg_codex_writable_paths "$SKILL_DIR")
- unset _wp
- local cfg
- for cfg in "${codex_configs[@]}"; do
- _sync_codex_roots "$cfg" "${writable_paths[@]}"
- done
- agmsg_install_op_require
- }
- is_windows_host() {
- if [ "${AGMSG_FORCE_WINDOWS:-}" = "1" ]; then
- return 0
- fi
- case "$(uname -s 2>/dev/null || echo unknown)" in
- MINGW*|MSYS*|CYGWIN*) return 0 ;;
- *) return 1 ;;
- esac
- }
- install_windows_helpers() {
- agmsg_install_op_require || return 1
- if ! is_windows_host; then
- return 0
- fi
- agmsg_install_op_require || return 1
- mkdir -p "$AGENTS_DIR"
- # Clean up legacy helpers created by the earlier native-Windows approaches.
- local ps_shortcut="$AGENTS_DIR/$CMD_NAME.ps1"
- if [ -f "$ps_shortcut" ] && grep -q "PowerShell shortcut for agmsg on native Windows" "$ps_shortcut" 2>/dev/null; then
- agmsg_install_op_require || return 1
- rm -f "$ps_shortcut"
- agmsg_install_op_require || return 1
- fi
- agmsg_install_op_require || return 1
- rm -f "$AGENTS_DIR/$CMD_NAME-run.sh"
- agmsg_install_op_require || return 1
- local sqlite_shim="$AGENTS_DIR/bin/sqlite3"
- local removed_sqlite_shim=false
- if [ -f "$sqlite_shim" ] && grep -q "sqlite3 compatibility shim for agmsg" "$sqlite_shim" 2>/dev/null; then
- agmsg_install_op_require || return 1
- rm -f "$sqlite_shim"
- agmsg_install_op_require || return 1
- removed_sqlite_shim=true
- fi
- if [ "$removed_sqlite_shim" = true ]; then
- agmsg_install_op_require || return 1
- rm -f "$AGENTS_DIR/run/sqlite3-shim.cache"
- agmsg_install_op_require || return 1
- fi
- }
- # Antigravity counts as present when either of its CLI markers exists; the
- # config tree itself may not exist yet on a fresh CLI install.
- install_antigravity_present() {
- [ -d "$INSTALL_HOME/.gemini/antigravity-cli" ] || [ -d "$INSTALL_HOME/.gemini/config" ]
- }
- # agmsg no longer places ~/.agents/bin/agy-tui. An update takes back the shim an
- # earlier release placed there. Only this install's own shim goes, judged by its
- # content: a symlink, another file, or another install's shim stays.
- remove_antigravity_tui_shim() {
- local source target owner
- source="$1"
- target="$AGENTS_DIR/bin/agy-tui"
- owner="# agmsg-shim-owner: $source"
- agmsg_install_op_require || return 1
- [ -f "$target" ] && [ ! -L "$target" ] || return 0
- grep -q '^# agmsg Antigravity TUI launcher shim$' "$target" 2>/dev/null || return 0
- [ "$(grep '^# agmsg-shim-owner: ' "$target" 2>/dev/null || true)" = "$owner" ] || return 0
- rm -f "$target" 2>/dev/null || true
- agmsg_install_op_require || return 1
- }
- install_antigravity_skill() {
- agmsg_install_op_require || return 1
- # Antigravity looks for global skills under ~/.gemini/config/skills, not the
- # cross-vendor ~/.agents/skills tree. Treat either of the installed agy
- # markers as evidence that this destination is available; the config tree
- # itself may not exist yet on a fresh CLI install.
- install_antigravity_present || return 0
- local skill_dir="$INSTALL_HOME/.gemini/config/skills/$CMD_NAME"
- agmsg_install_op_require || return 1
- mkdir -p "$skill_dir" 2>/dev/null || return 2
- agmsg_install_op_require || return 1
- agmsg_render_skill antigravity "$CMD_NAME" "$skill_dir/SKILL.md" 2>/dev/null || return 2
- agmsg_install_op_require || return 1
- echo " + installed /$CMD_NAME skill to $INSTALL_HOME_SHOWN/.gemini/config/skills/"
- }
- # Run one Antigravity setup step. These steps only matter to someone who uses
- # Antigravity, so a step that cannot write (return 2) warns once and the
- # install or update goes on. Any other failure -- a lost install lock -- still
- # stops it, as before.
- install_antigravity_step() { # <what> <function> [args...]
- local what="$1" rc=0
- shift
- "$@" || rc=$?
- case "$rc" in
- 0) ;;
- 2) echo " ! could not install the Antigravity $what; skipped (installs that do not use Antigravity are unaffected)" >&2 ;;
- *) exit 1 ;;
- esac
- }
- # --- Parse args ---
- while [[ $# -gt 0 ]]; do
- case "$1" in
- --cmd) CMD_NAME="$2"; INTERACTIVE=false; shift 2 ;;
- --recover) RECOVER_ID="$2"; INTERACTIVE=false; shift 2 ;;
- --agent-type) AGENT_TYPE="$2"; shift 2 ;;
- --update) UPDATE_ONLY=true; shift ;;
- -h|--help)
- echo "Usage: ./install.sh [options]"
- echo ""
- echo "Options:"
- echo " --cmd <name> Command & skill folder name (default: agmsg)"
- echo " Claude Code: /<cmd>, Codex/Gemini/Antigravity: \$<cmd>"
- echo " --agent-type <t> Agent type: claude-code, codex, gemini, antigravity, opencode, hermes, cursor, grok-build, devin"
- echo " codex, gemini, cursor, devin: selects the template the"
- echo " shared SKILL.md is rendered from. Other types leave the"
- echo " shared SKILL.md's type unchanged (codex on a fresh install);"
- echo " they have their own skill file."
- echo " (<t> matches the type arg passed to join.sh / whoami.sh)"
- echo " --update Update skill scripts only (preserve DB and teams)"
- echo " --recover <id> Clear a verified incomplete operation, then continue this install"
- echo ""
- echo "After install, join a team per-project:"
- echo " $INSTALL_HOME_SHOWN/.agents/skills/<cmd>/scripts/join.sh <team> <name> <type> <project>"
- echo " Or just run /<cmd> in Claude Code — it will prompt if not in a team."
- exit 0
- ;;
- *) echo "Unknown option: $1" >&2; exit 1 ;;
- esac
- done
- if [ -n "$RECOVER_ID" ] && [ -z "$CMD_NAME" ]; then
- echo " ! --recover requires --cmd <name> to select one installation" >&2
- exit 1
- fi
- # Force non-interactive when stdin is not a terminal. Without this, the
- # command-name prompt below would call `read -r` on whatever stream is wired
- # to fd 0 — which for `curl ... | bash`-style entry paths (e.g. the npm
- # bootstrapper before its own fix) is the wrapper script itself, so the
- # next line of the wrapper gets consumed as the command name. See #98.
- # The `bash <(curl ...)` form in the README is fine because process
- Note: Runs a downloaded script through process substitution (bash <(curl …))
- Line 1,309 on GitHub
- # substitution preserves stdin; this guard only kicks in for pipe entries.
- if [ ! -t 0 ]; then
- INTERACTIVE=false
- fi
- # --- Check dependencies ---
- if ! command -v sqlite3 &>/dev/null; then
- echo "Error: sqlite3 is required but not found." >&2
- echo " macOS: included by default" >&2
- echo " Linux: sudo apt install sqlite3 (or equivalent)" >&2
- exit 1
- fi
- # --- Banner ---
- echo ""
- echo " agmsg — Agent Messaging"
- echo " ────────────────────────"
- echo ""
- # --- Update mode ---
- if [ "$UPDATE_ONLY" = true ]; then
- # Find existing install. If --cmd was passed, update exactly that skill.
- # Otherwise, scan for installs and require exactly one: a glob expands in
- # collation order, not installation order, and nothing records which
- # install came first, so guessing from a list of more than one is a
- # silent coin flip on which install (and the shared ~/.agents/bin/codex
- # shim it refreshes) gets updated (#599). A single install is unaffected
- # -- this is the common case and it still "just works".
- #
- # No name-based exclusion for backup-shaped directories: --cmd has no
- # reserved-name validation, so any pattern that would catch a real backup
- # (e.g. "agmsg.bak-20260731") can equally match a legitimately chosen
- # install name (e.g. "agmsg.bak-tool") -- there is no substring that is
- # guaranteed to mean "not a real install" (review of #659). A leftover
- # backup directory that still carries the .agmsg marker is therefore just
- # another candidate: it makes the set ambiguous, and ambiguous is exactly
- # what this fix already refuses to guess through, below.
- if [ -n "$CMD_NAME" ]; then
- SKILL_DIR="$AGENTS_DIR/skills/$CMD_NAME"
- if [ ! -f "$SKILL_DIR/.agmsg" ]; then
- echo " ! Not installed: $INSTALL_HOME_SHOWN/.agents/skills/$CMD_NAME. Run ./install.sh --cmd $CMD_NAME first." >&2
- exit 1
- fi
- else
- candidates=()
- for d in "$AGENTS_DIR"/skills/*/; do
- d="${d%/}"
- [ -f "$d/.agmsg" ] && candidates+=("$d")
- done
- case "${#candidates[@]}" in
- 0) SKILL_DIR="" ;;
- 1) SKILL_DIR="${candidates[0]}" ;;
- *)
- echo " ! Several agmsg installs found:" >&2
- for d in "${candidates[@]}"; do
- echo " $(basename "$d")" >&2
- done
- echo " ! --update with no --cmd cannot tell which one you mean. Pass --cmd <name> to pick one." >&2
- exit 1
- ;;
- esac
- fi
- if [ -z "$SKILL_DIR" ]; then
- echo " ! Not installed. Run ./install.sh first." >&2
- exit 1
- fi
- SKILL_NAME="$(basename "$SKILL_DIR")"
- CMD_NAME="$SKILL_NAME"
- if agmsg_state_name_reserved "$CMD_NAME"; then
- echo " ! '$CMD_NAME' cannot be an install name: $(agmsg_state_base)/$CMD_NAME is shared by every install. Rename or remove $SKILL_DIR." >&2
- exit 1
- fi
- echo " Updating $SKILL_NAME..."
- INSTALLED_VERSION="$(agmsg_source_version)"
- # #963: a sync engine that is running when the write below starts either
- # survives on the code it already loaded (silent -- `remote.sh status` still
- # reports it as running, and nothing about the new scripts takes effect) or
- # spawns a driver mid-write, reads a half-written file, and exits (visible,
- # but stops syncing all the same). Snapshot which teams have an engine
- # running NOW, before any file below is touched, using the install still on
- # disk -- this is a plain read against a complete, unwritten tree, not the
- # "must not depend on the tree mid-write" case agmsg_shq below is about.
- # Restarting after the rewrite (further down) covers BOTH outcomes:
- # a survivor is stopped and replaced, and a crasher is simply started fresh
- # since its pidfile already reads as stale by then.
- # A copy made with cp -R still links to the ORIGINAL's state: give it its own
- # (empty) parts before anything is read, locked or written through those links.
- agmsg_state_detach_foreign "$SKILL_DIR" || exit 1
- AGMSG_RUNNING_TEAMS=""
- if [ -x "$SKILL_DIR/scripts/remote.sh" ]; then
- while IFS= read -r _agmsg_status_line; do
- [ -n "$_agmsg_status_line" ] || continue
- _agmsg_running_team="$(printf '%s' "$_agmsg_status_line" | python3 -c '
- import json, sys
- try:
- row = json.loads(sys.stdin.read())
- except Exception:
- sys.exit(0)
- if row.get("engine_state") == "running":
- print(row.get("local_team", ""))
- ' 2>/dev/null || true)"
- [ -n "$_agmsg_running_team" ] && AGMSG_RUNNING_TEAMS="$AGMSG_RUNNING_TEAMS
- $_agmsg_running_team"
- done < <("$SKILL_DIR/scripts/remote.sh" status --json 2>/dev/null || true)
- fi
- unset _agmsg_status_line _agmsg_running_team
- # The lock is taken first and held through the move: the lock database moves
- # with run/ by rename, so it is the same file at both paths and a second
- # install, update or uninstall waits (or refuses on the unfinished record)
- # instead of working on the old tree.
- agmsg_install_operation_begin || exit 1
- agmsg_install_move_state "$SKILL_DIR" "$AGMSG_RUNNING_TEAMS"
- agmsg_install_stop_daemon "$SKILL_DIR"
- agmsg_install_op_run_phase agmsg_install_write_recovery_helper || exit 1
- # Captured before the auto-detect below can fill AGENT_TYPE in for other
- # reasons: an EXPLICIT --agent-type is what #1449's rule below cares about,
- # not whatever AGENT_TYPE ends up holding once auto-detected too.
- _agmsg_explicit_agent_type="$AGENT_TYPE"
- # Re-detect the type this install's shared SKILL.md is CURRENTLY rendered
- # for, from the whoami.sh line its own template prints (#846) -- every
- # renderable type's line is unambiguous against every other's; see the
- # cross-grep this list is built from, noted alongside
- # AGMSG_RENDERABLE_SKILL_TYPES above. codex remains the fallback when an
- # older or hand-written SKILL.md has no recognizable whoami line.
- #
- # Always run, even when --agent-type was given explicitly: #1449's rule
- # below needs this as the shared file's fallback type precisely when an
- # explicit --agent-type asks for a type that must not retype it.
- _agmsg_detected_type="codex"
- for _agmsg_t in $AGMSG_RENDERABLE_SKILL_TYPES; do
- if grep -q "whoami.sh.*$_agmsg_t" "$SKILL_DIR/SKILL.md" 2>/dev/null; then
- _agmsg_detected_type="$_agmsg_t"
- break
- fi
- done
- unset _agmsg_t
- [ -z "$AGENT_TYPE" ] && AGENT_TYPE="$_agmsg_detected_type"
- # The shared SKILL.md can hold only ONE type's instructions at a time (see
- # AGMSG_TYPES_WITH_OWN_SKILL_FILE near the top). An EXPLICIT --agent-type
- # for a type that already gets its own dedicated file elsewhere in this
- # script must not retype the shared file too -- it stays at the type just
- # detected above instead. An --agent-type for a type with no file of its
- # own (today: codex, gemini, cursor, devin) still renders the shared file
- # as that type, same as before #1449.
- TPL_TYPE="$_agmsg_detected_type"
- case " $AGMSG_TYPES_WITH_OWN_SKILL_FILE " in
- *" $_agmsg_explicit_agent_type "*)
- echo " shared SKILL.md stays $_agmsg_detected_type: $_agmsg_explicit_agent_type has its own skill file"
- ;;
- *)
- case " $AGMSG_RENDERABLE_SKILL_TYPES " in
- *" $AGENT_TYPE "*) TPL_TYPE="$AGENT_TYPE" ;;
- esac
- ;;
- esac
- unset _agmsg_explicit_agent_type _agmsg_detected_type
- agmsg_install_op_run_phase agmsg_render_skill "$TPL_TYPE" "$SKILL_NAME" "$SKILL_DIR/SKILL.md" || exit 1
- TRASH_DIR="$SKILL_DIR/.trash"
- AGMSG_TRASH_COUNT=0
- agmsg_install_op_run_phase agmsg_reset_trash "$TRASH_DIR" || exit 1
- # Recursive copy so nested helper dirs (scripts/lib/, scripts/drivers/types/)
- # ship without enumerating files. The agent-type manifests and per-type runtimes
- # live under scripts/drivers/types/ now, so this single copy carries them too.
- # Runs under the install operation lock. The completion manifest is written
- # only after the remaining install updates below are complete.
- AGMSG_BUILTINS_BEFORE="$(agmsg_builtin_driver_names "$SKILL_DIR")"
- agmsg_install_copy_scripts || exit 1
- agmsg_install_op_run_phase cp "$SCRIPT_DIR/CHANGELOG.md" "$SKILL_DIR/CHANGELOG.md" || exit 1
- echo " ~ $AGMSG_TRASH_COUNT file(s) backed up to .trash/ (cleared on next upgrade)"
- agmsg_plugin_shadow_warn "$SKILL_DIR" "$AGMSG_BUILTINS_BEFORE"
- # #1249: drivers/terminals/{herdr,plain,tmux}/SKILL.md used to name each
- # driver's own doc file, and a directory-scanning skill loader (e.g.
- # codex's) treated it as a standalone skill missing YAML frontmatter,
- # warning on every start. Renamed to README.md. A plain `cp -R` never
- # deletes a file absent from the source tree, so an --update over an
- # install from before this rename would otherwise keep the stale
- # SKILL.md side by side with the new README.md forever. Named
- # individually -- NOT a scripts/drivers/terminals/*/SKILL.md glob --
- # because a user can drop a custom driver directory straight under
- # scripts/drivers/terminals/ (nothing about that path is exclusive to
- # agmsg's own three); a glob there would delete a file this install
- # does not own (#1249 review).
- agmsg_install_op_run_phase agmsg_remove_retired_terminal_skills || exit 1
- # Ship the external-plugin drop-in dir (just its README) so the location exists
- # post-install. A plain cp — not cp -R --delete — preserves any plugins the
- # user dropped in and their db/trusted-plugins opt-ins.
- agmsg_install_op_phase_begin || exit 1
- mkdir -p "$SKILL_DIR/plugins" || exit 1
- agmsg_install_optional_copy "$SCRIPT_DIR/plugins/README.md" "$SKILL_DIR/plugins/README.md"
- # Ship uninstall.sh alongside the skill itself — npx/curl installs fetch a
- # temp checkout that gets deleted right after install, so without this copy
- # those users would have no local uninstaller to run later (only a manual
- # `git clone` checkout would). See the README's Uninstall section.
- agmsg_install_optional_uninstaller_copy
- agmsg_install_op_phase_end || exit 1
- # Refresh the Claude Code slash command file (was missed in earlier --update flows).
- agmsg_install_op_phase_begin || exit 1
- CC_COMMANDS_DIR="$INSTALL_HOME/.claude/commands"
- if [ -d "$CC_COMMANDS_DIR" ] && [ -f "$CC_COMMANDS_DIR/$SKILL_NAME.md" ]; then
- agmsg_render_skill claude-code "$SKILL_NAME" "$CC_COMMANDS_DIR/$SKILL_NAME.md" || exit 1
- fi
- # Refresh / install the Copilot CLI skill (Copilot reads SKILL.md from its
- # own skills dir; the shared ~/.agents/skills/<name>/SKILL.md is
- # Codex-typed and would mis-identify the agent as codex when invoked from
- # Copilot). Same condition as the fresh-install path so users upgrading
- # from a pre-Copilot release via --update also gain the skill.
- COPILOT_SKILL_DIR="$INSTALL_HOME/.copilot/skills/$SKILL_NAME"
- if [ -d "$INSTALL_HOME/.copilot" ]; then
- mkdir -p "$COPILOT_SKILL_DIR" || exit 1
- agmsg_render_skill copilot "$SKILL_NAME" "$COPILOT_SKILL_DIR/SKILL.md" || exit 1
- fi
- # Refresh / install the OpenCode skill (same reasoning as Copilot above).
- OPENCODE_SKILL_DIR="$INSTALL_HOME/.config/opencode/skills/$SKILL_NAME"
- if [ -d "$INSTALL_HOME/.config/opencode" ]; then
- mkdir -p "$OPENCODE_SKILL_DIR" || exit 1
- agmsg_render_skill opencode "$SKILL_NAME" "$OPENCODE_SKILL_DIR/SKILL.md" || exit 1
- fi
- # Refresh / install the Hermes Agent skill (same reasoning as Copilot above).
- HERMES_SKILL_DIR="$INSTALL_HOME/.hermes/skills/$SKILL_NAME"
- if [ -d "$INSTALL_HOME/.hermes" ]; then
- mkdir -p "$HERMES_SKILL_DIR" || exit 1
- agmsg_render_skill hermes "$SKILL_NAME" "$HERMES_SKILL_DIR/SKILL.md" || exit 1
- fi
- # Refresh / install the Grok Build skill (same reasoning as Copilot above).
- GROK_SKILL_DIR="$INSTALL_HOME/.grok/skills/$SKILL_NAME"
- if [ -d "$INSTALL_HOME/.grok" ]; then
- mkdir -p "$GROK_SKILL_DIR" || exit 1
- agmsg_render_skill grok-build "$SKILL_NAME" "$GROK_SKILL_DIR/SKILL.md" || exit 1
- fi
- install_antigravity_step "skill ($INSTALL_HOME_SHOWN/.gemini/config/skills/)" install_antigravity_skill
- agmsg_install_op_phase_end || exit 1
- agmsg_install_op_phase_begin || exit 1
- agmsg_install_optional_copy "$SCRIPT_DIR/openai.yaml" "$SKILL_DIR/agents/openai.yaml"
- # A team config written by an older release can be group- or world-writable,
- # and the sync engine refuses to read one that is (#804). Upgrading does not
- # rewrite files that already exist, so without this the release we are asking
- # people to install is the release that stops them: joined on v1.2.0-rc.5,
- # upgraded as told, and now the binding they already had is rejected.
- #
- # This is a HISTORICAL correction, not a sweep of every authority file. The
- # set an older release's write path could have left wrong is exactly
- # `teams/<team>/config.json`, because it is the only one written by shell
- # under the caller's umask; `<storage>/remote-sync/<team>.json` and the
- # retained age checkpoint are written by Node with an explicit 0600 on a
- # fresh `wx` file, and that code is byte-identical at v1.2.0-rc.5. Those two
- # are still authority files the engine refuses on mode -- a mode changed by
- # hand is outside this walk, and the pasteable remedy in the refusal is what
- # covers that case.
- #
- # Within what it does walk, the selection is meant to be exactly the files
- # the engine refuses ON MODE, so this cannot correct a file into a state the
- # engine still refuses, and cannot touch one it would have accepted:
- #
- # -type f a symlink is refused by the engine BEFORE mode is consulted
- # ("must not be a symbolic link"), so chmod-ing one would
- # change a file OUTSIDE the store and announce a repair that
- # repaired nothing. `[ -f ]` follows symlinks; this does not.
- # -perm -g+w two tests, not one `-go+w`: `-perm -MODE` means ALL of the
- # -perm -o+w named bits, so the combined form skips a file writable by
- # only one of them.
- # find, glob `teams/*/config.json` silently drops a team whose name
- # begins with a dot, and lib/validate.sh allows those -- it
- # rejects `.` and `..` but not `.anything`. find descends
- # regardless of the leading character.
- # one traversal, not two `find` starts per binding.
- #
- # `go-w` rather than a numeric mode: the owner's bits and any read access the
- # operator deliberately granted are theirs, not ours to normalise.
- #
- # Skipped on Windows, where the engine skips the mode check itself
- # (`process.platform !== "win32"` guards it, and it is the LAST thing it
- # consults). MSYS reports modes the filesystem does not really carry, so
- # without this the walk would announce that the sync engine refuses a file the
- # sync engine is perfectly happy with -- on every update, on the one platform
- # where the sentence cannot be true.
- #
- # Said out loud, per file. A permission change the operator cannot see is
- # indistinguishable from one that did not happen, and this one runs without
- # being asked for.
- if ! is_windows_host; then
- # Same scheme as lib/shquote.sh, inline rather than sourced: the installer
- # must not depend on the tree it is in the middle of writing. A team name
- # may contain a space or a single quote -- lib/validate.sh rejects only
- # empty / `.` / `..` / `/` / `\` / a leading `-` / control characters -- so
- # a path printed for someone to paste has to survive both.
- agmsg_shq() {
- printf "'%s'" "$(printf '%s' "$1" | sed "s/'/'\\\\''/g")"
- }
- # -print0 and `read -d ''` because the path is arbitrary UTF-8. A newline
- # cannot appear in a team name (validate.sh rejects control characters), but
- # nothing here needs to rely on that.
- find -H "$SKILL_DIR/teams" -mindepth 2 -maxdepth 2 -name config.json -type f \
- \( -perm -g+w -o -perm -o+w \) -print0 2>/dev/null |
- while IFS= read -r -d '' agmsg_binding; do
- if chmod go-w "$agmsg_binding" 2>/dev/null; then
- echo " + tightened $agmsg_binding (an older release left it group- or world-writable; the sync engine refuses those)"
- else
- printf ' ! could not tighten %s -- run: chmod go-w %s\n' \
- "$agmsg_binding" "$(agmsg_shq "$agmsg_binding")" >&2
- fi
- done || true
- unset -f agmsg_shq
- fi
- chmod +x "$SKILL_DIR/scripts/"*.sh || exit 1
- # Extensionless entry points the *.sh glob does not reach.
- chmod +x "$SKILL_DIR/scripts/agmsg" "$SKILL_DIR/scripts/daemon/agmsgd" 2>/dev/null || true
- agmsg_install_optional_codex_chmod
- install_antigravity_step "TUI launcher shim ($INSTALL_HOME_SHOWN/.agents/bin/agy-tui)" remove_antigravity_tui_shim "$SKILL_DIR/scripts/drivers/types/antigravity/agy-tui.sh"
- # Refresh the Codex monitor shim (~/.agents/bin/codex) if it's ours. --update
- # cp's the new codex-shim-install.sh but does not re-run it, so a shim from an
- # older install keeps its stale baked exec path after the
- # types/ -> scripts/drivers/types/ move. Re-running install regenerates it with
- # the new path; install is idempotent and overwrites only an agmsg shim (a
- # user's own codex binary fails is_agmsg_shim and is left untouched).
- #
- # Never forced just because the caller typed --cmd:
- # naming the target explicitly says which install this update is for, not
- # that its operator means to take over some OTHER, still-live install's
- # shim (#1788 -- a second-named install's routine `--update --cmd` was
- # silently stealing the shim from a first, still-working install). The only
- # auto-force this still does is reading the caller's own
- # AGMSG_CODEX_SHIM_FORCE=1, the documented explicit-override env var
- # codex-shim-install.sh already honors directly.
- #
- # The #553 recovery path (reclaiming a shim whose recorded owner install no
- # longer exists, or does not even have the dispatch script to run) stays
- # available WITHOUT setting force at all: codex-shim-install.sh's own
- # `install` logic checks the owner's liveness itself (see
- # owner_install_is_gone there) before refusing. A shim owned by a live,
- # different install is left alone either way; the update itself still
- # succeeds, it just does not touch the shim.
- #
- # Capture status into a variable rather than piping it straight into
- # `grep -q` (measured, not theoretical): status now prints a second "owner:"
- # line (#553), and `grep -q` exits the instant it matches the first line,
- # closing its end of the pipe. status's own `echo` of the second line then
- # hits a reader that is already gone -- SIGPIPE, a nonzero exit for that
- # stage -- and under this script's `pipefail`, that alone flips the whole
- # `if` to false even though grep DID match. A one-line status (as this had
- # before #553) never triggers it: there is no second write for the closed
- # pipe to reject. Capturing first reads status to completion regardless of
- # how many lines it prints, so growing its output again later can't reopen
- # this.
- CODEX_SHIM="$SKILL_DIR/scripts/drivers/types/codex/codex-shim-install.sh"
- # While agmsgd delivers Codex notices the shim is not needed: `sync` removes
- # an agmsg shim owned by this install (and puts it back when agmsgd is off),
- # so the refresh below then finds nothing to refresh.
- agmsg_install_sync_codex_shim
- CODEX_SHIM_STATUS=""
- [ -x "$CODEX_SHIM" ] && CODEX_SHIM_STATUS="$(AGMSG_CODEX_SHIM_INSTALL_QUIET=1 "$CODEX_SHIM" status 2>/dev/null || true)"
- if printf '%s' "$CODEX_SHIM_STATUS" | grep -q '^installed:'; then
- CODEX_SHIM_FORCE="${AGMSG_CODEX_SHIM_FORCE:-}"
- agmsg_install_refresh_codex_shim || exit 1
- fi
- install_windows_helpers || exit 1
- agmsg_install_op_phase_end || exit 1
- agmsg_install_op_run_phase agmsg_launcher_install "$SKILL_DIR" "$CMD_NAME" || exit 1
- agmsg_install_op_run_phase agmsg_install_write_version || exit 1
- echo " + updated scripts, templates, and SKILL.md (version $INSTALLED_VERSION)"
- echo " ~ DB and team configs preserved"
- # #1572 fixed the leak; this sweeps up whatever an install made before
- # that fix already left behind. Unconditional on every --update rather
- # than gated on a once-only marker: once a cleaned install's temp
- # directory holds none of these, the scan below finds nothing and costs
- # one quick `find`, so there is no ongoing cost to running it again --
- # see stale-outcome-files.sh for the full match criteria.
- AGMSG_STALE_OUTCOME_REMOVED="$(agmsg_stale_outcome_candidates | agmsg_remove_stale_outcome_files)"
- if [ "${AGMSG_STALE_OUTCOME_REMOVED:-0}" -gt 0 ]; then
- echo " + removed $AGMSG_STALE_OUTCOME_REMOVED leaked sync outcome file(s) from before #1572"
- fi
- agmsg_install_op_run_phase configure_codex_sandbox || exit 1
- echo ""
- agmsg_install_restart_guidance
- agmsg_install_daemon_hint "$SKILL_DIR"
- echo ""
- echo ""
- echo " 'engine stale' after this is not proof a restart above failed on its"
- echo " own -- check: remote.sh status <team> (#963, #954)."
- echo ""
- echo " ! If a project uses 'monitor'/'both'/'turn' delivery, re-run"
- echo " 'delivery.sh set <mode> <type> <project>' there. An upgrade (or a skill"
- echo " manager that rewrites settings) can drop the SessionStart/Stop hook from"
- echo " a project's settings, silently stopping delivery until it is re-registered."
- echo " Check with 'delivery.sh status <type> <project>'. (#133)"
- echo ""
- agmsg_install_operation_finish || exit 1
- # After the completion record is written and the lock is let go: an engine
- # started earlier takes the old record as its baseline, sees the new one appear
- # and stands down again a few seconds later. A stood-down engine's own restart
- # helper waits for the install lock, so exactly one of the two starts it.
- # #963: a sync engine has no equivalent self-detection, so this update
- # restarts one itself for every team the snapshot above found running.
- if [ -n "$AGMSG_RUNNING_TEAMS" ]; then
- while IFS= read -r _agmsg_team; do
- [ -n "$_agmsg_team" ] || continue
- if ! bash "$SKILL_DIR/scripts/remote.sh" sync restart "$_agmsg_team"; then
- echo " ! could not restart the sync engine for '$_agmsg_team'; run:" >&2
- echo " bash $SKILL_DIR/scripts/remote.sh sync restart $_agmsg_team" >&2
- fi
- done <<< "$AGMSG_RUNNING_TEAMS"
- unset _agmsg_team
- else
- echo " ~ no sync engine was running before this update; nothing to restart"
- fi
- agmsg_install_restart_daemon "$SKILL_DIR"
- echo " ✓ Update complete"
- echo ""
- agmsg_install_update_reading_hint "$SKILL_DIR" "$(cat "$SCRIPT_DIR/VERSION" 2>/dev/null || printf '%s' "$INSTALLED_VERSION")"
- exit 0
- fi
- # --- Interactive mode ---
- if [ "$INTERACTIVE" = true ]; then
- printf " Command name [agmsg]: "
- read -r input
- CMD_NAME="${input:-agmsg}"
- echo ""
- fi
- # --- Apply defaults ---
- CMD_NAME="${CMD_NAME:-agmsg}"
- if agmsg_state_name_reserved "$CMD_NAME"; then
- echo " ! '$CMD_NAME' cannot be an install name: $(agmsg_state_base)/$CMD_NAME is shared by every install. Pick another --cmd." >&2
- exit 1
- fi
- SKILL_DIR="$AGENTS_DIR/skills/$CMD_NAME"
- INSTALLED_VERSION="$(agmsg_source_version)"
- mkdir -p "$SKILL_DIR" || exit 1
- agmsg_install_move_state "$SKILL_DIR" ""
- agmsg_install_operation_begin || exit 1
- agmsg_install_op_run_phase agmsg_install_write_recovery_helper || exit 1
- # --- Install skill ---
- echo " Installing to $INSTALL_HOME_SHOWN/.agents/skills/$CMD_NAME/ ..."
- agmsg_install_op_run_phase mkdir -p "$SKILL_DIR"/{scripts,types,db,agents} || exit 1
- # SKILL.md is composed from the shared root and the agent-specific overlay
- # resolved from the type manifest (scripts/drivers/types/<type>/template.md).
- #
- # The shared SKILL.md can hold only ONE type's instructions at a time (see
- # AGMSG_TYPES_WITH_OWN_SKILL_FILE near the top). --agent-type for a type
- # that already gets its own dedicated file elsewhere in this script must not
- # retype the shared file too -- a fresh install has no existing file to fall
- # back to, so it stays at the plain codex default. --agent-type for a type
- # with no file of its own (today: codex, gemini, cursor, devin) still
- # renders the shared file as that type, same as before #1449.
- TPL_TYPE="codex"
- case " $AGMSG_TYPES_WITH_OWN_SKILL_FILE " in
- *" $AGENT_TYPE "*)
- echo " shared SKILL.md stays codex: $AGENT_TYPE has its own skill file"
- ;;
- *)
- case " $AGMSG_RENDERABLE_SKILL_TYPES " in
- *" $AGENT_TYPE "*) TPL_TYPE="$AGENT_TYPE" ;;
- esac
- ;;
- esac
- agmsg_install_op_run_phase agmsg_render_skill "$TPL_TYPE" "$CMD_NAME" "$SKILL_DIR/SKILL.md" || exit 1
- TRASH_DIR="$SKILL_DIR/.trash"
- AGMSG_TRASH_COUNT=0
- agmsg_install_op_run_phase agmsg_reset_trash "$TRASH_DIR" || exit 1
- # Recursive copy so nested helper dirs (scripts/lib/, scripts/drivers/types/) ship
- # without enumerating files. The agent-type manifests and per-type runtimes live
- # under scripts/drivers/types/ now, so this single copy carries them too.
- # Runs under the install operation lock. The completion manifest is written
- # only after the remaining install updates below are complete.
- AGMSG_BUILTINS_BEFORE="$(agmsg_builtin_driver_names "$SKILL_DIR")"
- agmsg_install_copy_scripts || exit 1
- agmsg_install_op_run_phase cp "$SCRIPT_DIR/CHANGELOG.md" "$SKILL_DIR/CHANGELOG.md" || exit 1
- echo " ~ $AGMSG_TRASH_COUNT file(s) backed up to .trash/ (cleared on next upgrade)"
- agmsg_plugin_shadow_warn "$SKILL_DIR" "$AGMSG_BUILTINS_BEFORE"
- # Ship the external-plugin drop-in dir (just its README) so the location exists
- # post-install. A plain cp — not cp -R --delete — preserves any plugins the user
- # dropped in and their db/trusted-plugins opt-ins.
- agmsg_install_op_phase_begin || exit 1
- mkdir -p "$SKILL_DIR/plugins" || exit 1
- agmsg_install_optional_copy "$SCRIPT_DIR/plugins/README.md" "$SKILL_DIR/plugins/README.md"
- # Ship uninstall.sh alongside the skill itself — npx/curl installs fetch a
- # temp checkout that gets deleted right after install, so without this copy
- # those users would have no local uninstaller to run later (only a manual
- # `git clone` checkout would). See the README's Uninstall section.
- agmsg_install_optional_uninstaller_copy
- agmsg_install_optional_copy "$SCRIPT_DIR/openai.yaml" "$SKILL_DIR/agents/openai.yaml"
- chmod +x "$SKILL_DIR/scripts/"*.sh || exit 1
- # Extensionless entry points the *.sh glob does not reach.
- chmod +x "$SKILL_DIR/scripts/agmsg" "$SKILL_DIR/scripts/daemon/agmsgd" 2>/dev/null || true
- agmsg_install_optional_codex_chmod
- # Re-point an existing Codex monitor shim at the new path on a reinstall over an
- # older layout (no-op when no agmsg shim is present). See the --update block
- # above. NOT forced (#553): unlike --update, a fresh install here gives no
- # signal that the caller means to take over an EXISTING install's shim, so a
- # --cmd for a second/different name must not silently repoint it away from
- # whichever install already owns it. codex-shim-install.sh itself refuses that
- # and says whose it is; surface that here instead of swallowing it.
- CODEX_SHIM="$SKILL_DIR/scripts/drivers/types/codex/codex-shim-install.sh"
- agmsg_install_sync_codex_shim
- CODEX_SHIM_STATUS=""
- [ -x "$CODEX_SHIM" ] && CODEX_SHIM_STATUS="$(AGMSG_CODEX_SHIM_INSTALL_QUIET=1 "$CODEX_SHIM" status 2>/dev/null || true)"
- if printf '%s' "$CODEX_SHIM_STATUS" | grep -q '^installed:'; then
- # Stdout suppressed (mirrors the --update block's success case above);
- # stderr is NOT, since codex-shim-install.sh's own refusal already names the
- # current owner and the exact consequence of forcing -- repeating a
- # shorter, separate version of that here would risk saying something
- # different from what actually happens.
- CODEX_SHIM_FORCE=""
- agmsg_install_refresh_codex_shim || exit 1
- fi
- install_windows_helpers || exit 1
- agmsg_install_op_phase_end || exit 1
- # The `agmsg` command launcher (never touches shell rc files or PATH).
- agmsg_install_op_run_phase agmsg_launcher_install "$SKILL_DIR" "$CMD_NAME" || exit 1
- # Marker file for uninstall detection and source provenance version are one
- # protected phase so neither write can occur after a lost-lock boundary.
- agmsg_install_op_run_phase agmsg_install_touch_marker_and_write_version || exit 1
- # Initialize DB
- if [ ! -f "$SKILL_DIR/db/messages.db" ]; then
- agmsg_install_op_run_phase bash "$SKILL_DIR/scripts/internal/init-db.sh" || exit 1
- fi
- # Nothing moves stores here. Installing must not change where a team's messages
- # live: programs outside agmsg read the shared store directly, and an install
- # that relocated their data would break them without anything saying so. A team
- # moves to its own store only when connecting requires it, and only that team —
- # see scripts/drivers/partition/ and internal/migrate-team-store.sh.
- # Initialize config
- if [ ! -f "$SKILL_DIR/db/config.yaml" ]; then
- agmsg_install_op_run_phase bash "$SKILL_DIR/scripts/config.sh" show >/dev/null || exit 1
- echo " + created default config at db/config.yaml"
- fi
- # --- Install Claude Code global command ---
- agmsg_install_op_phase_begin || exit 1
- CC_COMMANDS_DIR="$INSTALL_HOME/.claude/commands"
- if [ -d "$INSTALL_HOME/.claude" ]; then
- mkdir -p "$CC_COMMANDS_DIR" || exit 1
- agmsg_render_skill claude-code "$CMD_NAME" "$CC_COMMANDS_DIR/$CMD_NAME.md" || exit 1
- echo " + installed /$CMD_NAME command to $INSTALL_HOME_SHOWN/.claude/commands/"
- fi
- # --- Install Copilot CLI skill ---
- # Copilot loads SKILL.md from ~/.copilot/skills/<name>/. The shared
- # ~/.agents/skills/<name>/SKILL.md is Codex-typed (whoami ... codex) and
- # would mis-identify a Copilot session — keep the Copilot copy separate.
- COPILOT_SKILL_DIR="$INSTALL_HOME/.copilot/skills/$CMD_NAME"
- if [ -d "$INSTALL_HOME/.copilot" ]; then
- mkdir -p "$COPILOT_SKILL_DIR" || exit 1
- agmsg_render_skill copilot "$CMD_NAME" "$COPILOT_SKILL_DIR/SKILL.md" || exit 1
- echo " + installed /$CMD_NAME skill to $INSTALL_HOME_SHOWN/.copilot/skills/"
- fi
- # --- Install OpenCode skill ---
- # OpenCode reads skills from ~/.config/opencode/skills/<name>/SKILL.md as its
- # global config path. The shared ~/.agents/skills/<name>/SKILL.md is
- # Codex-typed and would mis-identify an OpenCode session — keep the OpenCode
- # copy separate, same pattern as Copilot.
- OPENCODE_SKILL_DIR="$INSTALL_HOME/.config/opencode/skills/$CMD_NAME"
- if [ -d "$INSTALL_HOME/.config/opencode" ]; then
- mkdir -p "$OPENCODE_SKILL_DIR" || exit 1
- agmsg_render_skill opencode "$CMD_NAME" "$OPENCODE_SKILL_DIR/SKILL.md" || exit 1
- echo " + installed \$$CMD_NAME skill to $INSTALL_HOME_SHOWN/.config/opencode/skills/"
- fi
- # --- Install Hermes Agent skill ---
- # Hermes reads skills from ~/.hermes/skills/<name>/SKILL.md. Runtime scripts and
- # the shared SQLite store stay in ~/.agents/skills/<name>/ so Hermes shares the
- # same message floor as the other agents. Hermes has no automatic delivery hook
- # (manual inbox checks only), but the skill itself installs the same way.
- HERMES_SKILL_DIR="$INSTALL_HOME/.hermes/skills/$CMD_NAME"
- if [ -d "$INSTALL_HOME/.hermes" ]; then
- mkdir -p "$HERMES_SKILL_DIR" || exit 1
- agmsg_render_skill hermes "$CMD_NAME" "$HERMES_SKILL_DIR/SKILL.md" || exit 1
- echo " + installed /$CMD_NAME skill to $INSTALL_HOME_SHOWN/.hermes/skills/"
- fi
- # --- Install Grok Build skill ---
- # Grok Build reads skills from ~/.grok/skills/<name>/SKILL.md (it also accepts
- # the cross-vendor ~/.agents/skills/ fallback, but the shared SKILL.md is
- # Codex-typed and would mis-identify a Grok session — keep the Grok copy
- # separate, same pattern as Copilot). Delivery (turn/monitor) writes a
- # project-relative rule file, <project>/.grok/rules/agmsg.md, via
- # `delivery.sh set` per project (scripts/drivers/types/grok-build/type.conf's
- # hooks_file; see grok-build/_delivery.sh).
- GROK_SKILL_DIR="$INSTALL_HOME/.grok/skills/$CMD_NAME"
- if [ -d "$INSTALL_HOME/.grok" ]; then
- mkdir -p "$GROK_SKILL_DIR" || exit 1
- agmsg_render_skill grok-build "$CMD_NAME" "$GROK_SKILL_DIR/SKILL.md" || exit 1
- echo " + installed /$CMD_NAME skill to $INSTALL_HOME_SHOWN/.grok/skills/"
- fi
- # --- Install Antigravity skill ---
- # Antigravity (agy) reads global skills from ~/.gemini/config/skills/<name>/.
- # Its CLI may create ~/.gemini/antigravity-cli before the config directory, so
- # either path is a sufficient installation signal.
- install_antigravity_step "skill ($INSTALL_HOME_SHOWN/.gemini/config/skills/)" install_antigravity_skill
- agmsg_install_op_phase_end || exit 1
- # Codex sandbox writable_roots are configured by configure_codex_sandbox() at
- # the "Done" step below — the single source of truth for db/, teams/, and run/.
- # (A legacy inline copy used to run here too, which double-mutated the array and
- # produced invalid TOML on a fresh install; it has been removed.)
- # --- Done ---
- agmsg_install_op_phase_begin || exit 1
- configure_codex_sandbox || exit 1
- agmsg_install_op_phase_end || exit 1
- agmsg_install_operation_finish || exit 1
- echo ""
- echo " ✓ Installed to $INSTALL_HOME_SHOWN/.agents/skills/$CMD_NAME/ (version $INSTALLED_VERSION)"
- echo ""
- echo " Next steps:"
- agmsg_install_restart_guidance
- agmsg_install_daemon_hint "$SKILL_DIR"
- echo " Run the command to join a team:"
- echo " Claude Code: /$CMD_NAME"
- echo " Codex: \$$CMD_NAME"
- echo " Gemini CLI: \$$CMD_NAME"
- echo " Antigravity: \$$CMD_NAME"
- echo " Copilot CLI: /$CMD_NAME"
- echo " OpenCode: \$$CMD_NAME"
- echo " It will prompt for team name and agent name on first run."
- echo ""
- echo " Docs: https://agmsg.cc/"
- echo ""
Ratings and comments
Sign in to rate this skill.
Sign inFree to use. If it’s helped, pass it on.