diff --git a/.githooks/README.md b/.githooks/README.md new file mode 100644 index 0000000..e6c56ed --- /dev/null +++ b/.githooks/README.md @@ -0,0 +1,39 @@ +# .githooks + +Git 钩子目录,通过 `install-hooks.sh` 注册为仓库的 `core.hooksPath`。 + +## 安装 + +```bash +bash install-hooks.sh +``` + +会将 `core.hooksPath` 指向此目录,启用以下守卫。 + +## pre-commit — 规则变更必须绑定治理记录 + +拦截对以下文件的未治理变更: +- `skills-engineering/ios-engineer/SKILL.md` +- `skills-engineering/ios-engineer/references/*.md` + +如果这些文件被 staged,同一个 commit 必须包含对应的 proposal 和 approval 记录。 + +## pre-push — 推送前强制同步并校验 + +推送前顺序执行: +1. `sync-skills.sh` — 同步 skill 到各 Agent 目录 +2. `sync-agent-preamble.sh` — 重写 preamble 托管块 +3. `verify-sync.sh` — 校验同步结果 +4. `sync_all.sh` — 同步 MCP 配置到所有平台 + +任一步骤失败则阻止推送。 + +## 紧急绕过 + +```bash +SKILL_BYPASS=1 git commit -m "..." # 跳过 skill 治理检查 +SKILL_BYPASS=1 git push # 跳过 skill-sync 段 +git push --no-verify # 跳过所有 hooks +``` + +绕过仅限紧急修复,需在 commit message 中说明原因。 diff --git a/.githooks/pre-push b/.githooks/pre-push index 83631de..428117c 100755 --- a/.githooks/pre-push +++ b/.githooks/pre-push @@ -16,9 +16,8 @@ # # MCP-sync: # 4. sync/sync_all.sh — sync MCP server -# definitions to Cursor / Codex / Claude / Xcode, plus the CODEX SHARED -# block from env/codex/shared.toml, plus Claude Code env from -# env/claude/settings.shared.json. +# definitions from env/mcp/*.json plus platform configs from +# env/platforms/*.json to Cursor / Codex / Claude / Xcode. # # Any failure aborts the push. # diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS new file mode 100644 index 0000000..65ce4c1 --- /dev/null +++ b/.github/CODEOWNERS @@ -0,0 +1,13 @@ +# iOS Engineer Skill — 核心治理文件 +skills-engineering/ios-engineer/SKILL.md @i-stack/core +skills-engineering/ios-engineer/references/ @i-stack/core +skills-engineering/ios-engineer/scripts/ @i-stack/core +skills-engineering/ios-engineer/evolution/ @i-stack/core + +# 技能工程基础设施 +skills-engineering/scripts/ @i-stack/core +env/platforms/ @i-stack/core + +# CI / 治理自动化 +.github/workflows/ @i-stack/core +.githooks/ @i-stack/core diff --git a/.github/workflows/deploy-docs.yml b/.github/workflows/deploy-docs.yml new file mode 100644 index 0000000..4aeb52c --- /dev/null +++ b/.github/workflows/deploy-docs.yml @@ -0,0 +1,53 @@ +name: Deploy Docs + +on: + push: + branches: [main, feature_3.0.0] + paths: + - 'docs/**' + - 'package.json' + - '.github/workflows/deploy-docs.yml' + + workflow_dispatch: + +permissions: + contents: read + pages: write + id-token: write + +concurrency: + group: pages + cancel-in-progress: false + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - uses: actions/setup-node@v4 + with: + node-version: 22 + cache: npm + + - name: Install dependencies + run: npm ci + + - name: Build VitePress + run: npm run docs:build + + - name: Upload Pages artifact + uses: actions/upload-pages-artifact@v3 + with: + path: docs/.vitepress/dist + + deploy: + needs: build + runs-on: ubuntu-latest + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + steps: + - name: Deploy to GitHub Pages + id: deployment + uses: actions/deploy-pages@v4 diff --git a/.github/workflows/hardcoded-paths.yml b/.github/workflows/hardcoded-paths.yml new file mode 100644 index 0000000..db89a4a --- /dev/null +++ b/.github/workflows/hardcoded-paths.yml @@ -0,0 +1,42 @@ +name: Check Hardcoded Paths + +on: + pull_request: + push: + branches: [main, feature_*] + +concurrency: + group: hardcoded-paths-${{ github.ref }} + cancel-in-progress: true + +jobs: + hardcoded-paths: + name: Check hardcoded paths + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: Scan for hardcoded personal paths + run: | + echo "Scanning committed files for hardcoded personal paths..." + RESULT_FILE=$(mktemp) + trap 'rm -f "$RESULT_FILE"' EXIT + + find . -type f \ + -not -path './.git/*' \ + -not -path './node_modules/*' \ + -print0 | while IFS= read -r -d '' f; do + matches=$(grep -In '/Users/' "$f" 2>/dev/null | grep -v '/Users/you/' | grep -v '/Users/YourName/' || true) + if [ -n "$matches" ]; then + echo "::error file=$f::Hardcoded personal path found" + echo "$matches" + echo "VIOLATION" >> "$RESULT_FILE" + fi + done + + if grep -q "VIOLATION" "$RESULT_FILE" 2>/dev/null; then + echo "" + echo "::error::Hardcoded personal paths detected. Replace with placeholders like '~/path/to/your/project' or '/Users/you/...'" + exit 1 + fi + echo "No hardcoded personal paths found" diff --git a/.github/workflows/validate.yml b/.github/workflows/validate.yml new file mode 100644 index 0000000..762c9bf --- /dev/null +++ b/.github/workflows/validate.yml @@ -0,0 +1,49 @@ +name: Validate Skills + +on: + pull_request: + paths: + - 'skills-engineering/ios-engineer/**' + push: + branches: [main, feature_*] + paths: + - 'skills-engineering/ios-engineer/**' + +concurrency: + group: validate-${{ github.ref }} + cancel-in-progress: true + +jobs: + validate: + name: Validate ios-engineer + runs-on: ubuntu-latest + defaults: + run: + working-directory: skills-engineering/ios-engineer + + steps: + - uses: actions/checkout@v4 + + - name: Install dependencies + run: | + sudo apt-get update -qq + sudo apt-get install -y -qq ripgrep ruby > /dev/null + + - name: Validate Rule IDs + run: bash scripts/validate_rule_ids.sh + + - name: Validate Scenario Specs + run: bash scripts/validate_scenario_specs.sh + + - name: Audit Reference Freshness + run: | + STALE_MONTHS=12 CRITICAL_MONTHS=18 bash scripts/audit_ref_freshness.sh + + - name: Validate Usage Ledger + run: bash scripts/validate_usage_ledger.sh + + - name: Run full skill evolution validation + run: | + SKIP_SNAPSHOT_CONSISTENCY=1 \ + SKIP_BEHAVIOR_VALIDATION=1 \ + bash scripts/validate_skill_evolution.sh diff --git a/.gitignore b/.gitignore index 3a039e7..f4aa597 100644 --- a/.gitignore +++ b/.gitignore @@ -3,13 +3,17 @@ # skills-engineering: local machine sync config (see scripts/config.local.sh.example) skills-engineering/scripts/config.local.sh -# env/: local secrets and platform config. Copy env/config.json.example and fill in tokens. -env/config.json +# env/: only secrets.json is gitignored. +# env/mcp/*.json and env/platforms/*.json are committed (use ${VAR} references, no real secrets). +# User only needs to create env/secrets.json from env/secrets.json.example. +env/secrets.json *__pycache__*/ +.analysis_output/ .cursor/ .codex/ .claude/ -docs/ -skills-engineering/ios-engineer/evolution/usage \ No newline at end of file +node_modules/ +skills-engineering/ios-engineer/evolution/usage/* +!skills-engineering/ios-engineer/evolution/usage/usage.jsonl diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..9a12bfa --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,38 @@ +# Changelog + +All notable changes to ai-coding-kit will be documented in this file. + +--- + +## [3.0.0] — 2026-07-05 + +### Added +- **i18n 分层**: SKILL.md 英文元指令 + en-US 治理层镜像(rule_index / cognitive_adversary_mode / self_evolution),IR-001 从"强制中文"改为"语言匹配用户输入" +- **CI 自动验证**: `.github/workflows/validate.yml` 在每次 PR / push 时自动校验 Rule IDs、Scenario Specs、Ref 新鲜度、Usage Ledger、演进流水线,并扫查硬编码路径 +- **CODEOWNERS**: ios-engineer 核心文件自动指定 reviewer +- **CONTRIBUTING.md**: 贡献指南(proposal 驱动演进、翻译贡献、平台支持新增) + +### Changed +- **IR-001 语义变更**: 从"始终使用简体中文"→"输出语言与用户输入语言一致" + +--- + +## [2.0.0] — 2026-02-15 + +### Added +- skills-engineering 模块:Agent Skill 多平台统一同步(Claude Code / Codex CLI / Cursor / Gemini CLI / CodeBuddy / Continue / Cline / Xcode) +- ios-engineer skill:完整的 iOS 工程规则体系(Swift / SwiftUI / UIKit / 并发 / 测试 / 迁移),含 40+ 规则 ID 和自演进机制 +- 5 个全局工程技能:工程纪律、认知拓展、真值接地、论证纪律、问题分析 +- sync 模块:MCP 配置同步引擎,从单一数据源渲染到 8 个平台原生格式 +- env 模块:统一配置数据源(secrets + MCP + 平台) +- rag-gateway:TypeScript / Fastify 通用 RAG 网关(OpenAI 兼容 API) +- Git hooks:pre-commit 规则变更治理 + pre-push 同步校验 + +--- + +## [1.0.0] — 2025-10-01 + +### Added +- 初始版本:MCP 配置同步核心引擎 +- 基础平台支持(Cursor / Claude Code) +- env/ 配置分层(secrets.json + mcp/ + platforms/) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 0000000..6e651bc --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,110 @@ +# 贡献指南 + +感谢你对 ai-coding-kit 的关注!本文档说明如何参与贡献。 + +--- + +## 开发环境 + +```bash +git clone https://github.com/i-stack/ai-coding-kit.git +cd ai-coding-kit +cp env/secrets.json.example env/secrets.json +# 编辑 env/secrets.json 填入你的 API keys +``` + +运行验证: + +```bash +cd skills-engineering/ios-engineer +bash scripts/validate.sh +``` + +--- + +## 贡献 Reference(新增 / 修改知识条目) + +ios-engineer 采用**提案驱动**的演进流程,所有对 reference 或 SKILL.md 的变更必须先创建提案: + +```bash +# 1. 创建提案骨架 +bash skills-engineering/ios-engineer/scripts/create_skill_proposal.sh \ + "feat: 新增 CarPlay 适配参考" + +# 2. 编辑 evolution/proposals/.md,填写动机、变更范围、影响分析 + +# 3. 实现变更(修改 references/ 或 SKILL.md) + +# 4. 运行完整验证 +bash skills-engineering/ios-engineer/scripts/validate_skill_evolution.sh + +# 5. 提交 PR,proposal 和变更一起提交 +``` + +### Reference 编写规范 + +- 每个 reference 文件首行必须包含 `` +- 所有规则 ID(如 `IR-001`、`ROUTE-005`)必须在 `rule_index.md` 中注册 +- 禁止跨文件重复定义核心概念(unique ownership 原则) +- 退役术语不得在任何 reference 中重新出现(retired term regression 检查) + +--- + +## 翻译贡献 + +1. 在 `i18n/en-US/references/` 创建与 `references/` 同名的文件 +2. 保持结构一致,标题层级不变 +3. 规则 ID(如 `IR-001`)不翻译,保持原样 +4. 代码示例中的注释可以翻译 + +--- + +## 新增平台支持 + +1. 在 `env/platforms/` 添加平台配置 JSON +2. 更新 `skills-engineering/scripts/sync-skills.sh` 添加新的同步目标 +3. 更新 `skills-engineering/scripts/verify-sync.sh` 添加校验逻辑 +4. 更新根目录 `README.md` 列出新平台 + +--- + +## Commit 规范 + +``` +: <简短描述> + +type 取值: + feat: 新功能 + fix: 修复 + ref: 新增/修改 reference + evolve: 技能演进(proposal → implementation → promotion) + chore: 工程基础设施(CI / 脚本 / 配置) + docs: 文档 +``` + +示例: +``` +ref: 新增 CarPlay 场景适配 reference +evolve: promote v74 — 修复 concurrency reference 中版本前提缺失 +chore: CI 加入 rule_id 双向一致性检查 +``` + +--- + +## PR 要求 + +- 涉及 `SKILL.md` 或 `references/*.md` 的变更必须绑定 `evolution/proposals/` 中的 proposal +- CI 必须全部通过(Rule IDs / Scenario Specs / Ref Freshness / Snapshot Consistency) +- 至少 1 位 [CODEOWNERS](./.github/CODEOWNERS) 批准 + +--- + +## 治理体系速览 + +| 组件 | 文件 | 用途 | +|------|------|------| +| 规则注册表 | `rule_index.md` | 所有规则 ID 的单一事实来源 | +| 自进化 | `self_evolution.md` | 技能演进闭环流程 | +| Usage Ledger | `usage_ledger.md` | 任务命中观测 | +| 认知对手 | `cognitive_adversary_mode.md` | 反 AI 迎合机制 | +| 验证场景 | `validation_scenarios.md` + `evolution/scenarios/` | 回归验证集 | diff --git a/Formula/ai-coding-kit.rb b/Formula/ai-coding-kit.rb new file mode 100644 index 0000000..2f4aa64 --- /dev/null +++ b/Formula/ai-coding-kit.rb @@ -0,0 +1,50 @@ +class AiCodingKit < Formula + desc "One kit for all AI coding tools — Agent Skills, MCP sync, iOS engineering rules, and RAG gateway" + homepage "https://github.com/i-stack/ai-coding-kit" + url "https://github.com/i-stack/ai-coding-kit/archive/refs/tags/v3.0.0.tar.gz" + sha256 "" # ← fill after `brew fetch` or `shasum -a 256 v3.0.0.tar.gz` + license "MIT" + version "3.0.0" + + depends_on "bash" + + def install + # Install all project files + prefix.install Dir["*"] + + # Make key scripts executable and accessible + bin.install_symlink prefix/"sync.sh" => "ai-coding-kit-sync" + bin.install_symlink prefix/"skills-engineering/scripts/sync-skills.sh" => "ai-coding-kit-sync-skills" + bin.install_symlink prefix/"skills-engineering/scripts/list-skills.sh" => "ai-coding-kit-list-skills" + bin.install_symlink prefix/"install-hooks.sh" => "ai-coding-kit-install-hooks" + end + + def caveats + <<~EOS + ai-coding-kit is installed! + + ▶ Configure your secrets: + cp #{prefix}/env/secrets.json.example #{prefix}/env/secrets.json + $EDITOR #{prefix}/env/secrets.json + + ▶ Sync to your AI coding tools: + ai-coding-kit-sync + + ▶ Sync agent skills only: + ai-coding-kit-sync-skills --platforms claude,codex,cursor + + ▶ Install Git hooks (pre-commit governance): + ai-coding-kit-install-hooks + + ▶ List available skills: + ai-coding-kit-list-skills + + Supported platforms: Claude Code, Codex CLI, Cursor, Gemini CLI, + CodeBuddy, Continue, Cline, Xcode Coding Assistant. + EOS + end + + test do + assert_match "ai-coding-kit", shell_output("#{bin}/ai-coding-kit-list-skills 2>&1 || true") + end +end diff --git a/README.md b/README.md index 007f7ec..7ced368 100644 --- a/README.md +++ b/README.md @@ -3,40 +3,49 @@ [![Agent Skills](https://img.shields.io/badge/Agent%20Skills-8%2B%20AI%20Coding%20Tools-5856D6)](skills-engineering/README.md) [![iOS Engineer Skill](https://img.shields.io/badge/iOS%20Engineer-Swift%20%7C%20SwiftUI%20%7C%20UIKit-0A84FF)](skills-engineering/ios-engineer/SKILL.md) [![MCP Config Sync](https://img.shields.io/badge/MCP%20Config-8%20Platforms-663399)](sync/README.md) -[![Universal RAG Gateway](https://img.shields.io/badge/Universal%20RAG%20Gateway-TypeScript%20%7C%20Fastify-34C759)](docs/universal-rag-gateway.md) +[![Universal RAG Gateway](https://img.shields.io/badge/Universal%20RAG%20Gateway-TypeScript%20%7C%20Fastify-34C759)](rag-gateway/README.md) +[![Validate Skills](https://github.com/i-stack/ai-coding-kit/actions/workflows/validate.yml/badge.svg?branch=feature_3.0.0)](https://github.com/i-stack/ai-coding-kit/actions/workflows/validate.yml) +[![Check Hardcoded Paths](https://github.com/i-stack/ai-coding-kit/actions/workflows/hardcoded-paths.yml/badge.svg)](https://github.com/i-stack/ai-coding-kit/actions/workflows/hardcoded-paths.yml) [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](LICENSE) > **One kit. All your AI coding tools.** Agent Skills management, MCP configuration sync, iOS engineering rules, and a Universal RAG Gateway — unified for Cursor, CodeBuddy, Codex, Claude Code, Gemini CLI, Continue, Cline, and Xcode Coding Assistant. -**ai-coding-kit** is a local-first AI coding workflow toolkit for developers who use multiple AI coding tools and need a single source of truth for Agent Skills (AI coding skills / coding agent skills / prompt engineering rules), MCP server configuration (Model Context Protocol config), platform settings, and RAG Gateway routing. It replaces scattered config files with one maintainable `env/config.json` and auto-syncs to every AI coding host you use. +**ai-coding-kit** is a local-first AI coding workflow toolkit. Define your MCP servers, API keys, Agent Skills, and platform settings once — auto-sync to every AI coding host you use. -中文定位:这是一个面向 AI Coding / Agentic Coding / MCP(模型上下文协议)/ RAG Gateway 的本地工程化工具包。为同时使用多个 AI 编码工具(Cursor、CodeBuddy、Codex、Claude Code、Gemini CLI、Continue、Cline、Xcode Coding Assistant)的开发者提供统一的 Agent Skill 维护、MCP 配置同步、iOS 工程规则和智能网关路由。 +面向 AI Coding / Agentic Coding / MCP(模型上下文协议)的多工具本地工程化工具包。为同时使用多个 AI 编码工具的开发者提供统一的 Agent Skill 维护、MCP 配置同步、iOS 工程规则和智能网关路由。 -## Why ai-coding-kit? +## Quick Start + +```bash +git clone https://github.com/i-stack/ai-coding-kit.git +cd ai-coding-kit + +# 唯一需要编辑的文件 +cp env/secrets.json.example env/secrets.json +$EDITOR env/secrets.json -Managing MCP servers, API keys, and Agent Skills across multiple AI coding assistants is a hassle — each tool stores its config in a different format and location. Update one, forget the rest. **ai-coding-kit** solves this: +# 一键同步 +bash sync.sh +``` -- **One config file** → auto-generates Cursor mcp.json, Codex TOML, Claude JSON, CodeBuddy models, Continue YAML, and more. -- **One sync command** → `bash sync.sh` updates every tool in seconds. -- **Git-ignored secrets** → `env/config.json` stays local; only the sanitized example is committed. +## 平台支持 -## Features +当前主要开发和测试环境为 **macOS**。部分平台模块(如 Codex 同步中的 Xcode 集成、`.zshrc` 导出)在 macOS 外不可用。 -> **Agent Skills & Prompt Engineering** -> -> Ready-to-use AI coding skills for engineering discipline, iOS / Swift / SwiftUI / UIKit development, problem analysis, logical reasoning, and cognitive expansion. Version-controlled, syncable, and auditable. +欢迎 Windows 用户在 Windows 上验证并提交 PR。核心同步逻辑已尽量保持跨平台,适配改动预计较小。 -> **MCP Config Sync (Model Context Protocol)** -> -> Define MCP servers once in `env/config.json` and auto-render to Cursor (mcp.json), CodeBuddy (mcp.json + models.json), Codex (config.toml), Claude Code (.claude.json + settings.json), Gemini CLI, Continue (config.yaml), and Cline — with per-server platform filtering. +## 模块 -> **iOS Engineering Rules** -> -> Production-grade rules for Swift, SwiftUI, UIKit, Xcode, concurrency (async/await, actors), networking, performance, testing, code review, migration, and release-risk control — designed for AI coding assistants to produce reliable iOS code. +各模块有独立的 README,按需深入: -> **Universal RAG Gateway** -> -> TypeScript / Fastify gateway with OpenAI-compatible API, provider routing, semantic memory, transcript storage, declarative tools, GraphRAG, and telemetry. A local alternative to cloud RAG services. +| 模块 | 说明 | 文档 | +|------|------|------| +| **skills-engineering/** | Agent Skill 内容源、多端同步、受控演进 | [README](skills-engineering/README.md) | +| **sync/** | MCP 配置同步引擎,注入 secrets 渲染到各平台原生格式 | [README](sync/README.md) | +| **env/** | 配置数据源(secrets + MCP 定义 + 平台配置) | [README](env/README.md) | +| **rag-gateway/** | TypeScript / Fastify 通用 RAG 网关(OpenAI 兼容 API) | [README](rag-gateway/README.md) | +| **hooks/** | 项目钩子脚本(xmcp 初始化等) | [README](hooks/README.md) | +| **.githooks/** | Git 提交/推送守卫(pre-commit + pre-push) | [README](.githooks/README.md) | ## Supported AI Coding Tools @@ -51,69 +60,24 @@ Managing MCP servers, API keys, and Agent Skills across multiple AI coding assis | **Cline** (VSCode) | MCP settings JSON, `skills/` | | **Xcode Coding Assistant** | Codex + Claude Agent config paths | -## Quick Start +## 安装 Git 钩子 ```bash -# 1. Clone the repository -git clone https://github.com/i-stack/ai-coding-kit.git -cd ai-coding-kit - -# 2. Configure your MCP servers, API keys, and platform settings -# First run auto-copies from the example template -vim env/config.json - -# 3. One-command sync to all your AI coding tools -bash sync.sh +bash install-hooks.sh ``` -`sync.sh` automatically syncs your MCP server config and platform settings to **Cursor, CodeBuddy, Codex, Claude Code, Xcode, Cline, Gemini CLI, and Continue** in one shot. +启用 pre-commit(规则变更治理)和 pre-push(推送前强制同步校验)。详见 [.githooks/README.md](.githooks/README.md)。 -| Next Steps | Documentation | -|------|---------------| -| Learn Agent Skills in depth | [skills-engineering/README.md](skills-engineering/README.md) | -| Understand MCP config sync | [sync/README.md](sync/README.md) | -| See the config template | [env/config.json.example](env/config.json.example) | -| Explore the iOS engineer skill | [skills-engineering/ios-engineer/SKILL.md](skills-engineering/ios-engineer/SKILL.md) | -| Study the RAG Gateway | [docs/universal-rag-gateway.md](docs/universal-rag-gateway.md) | -| Set up Git hooks | [install-hooks.sh](install-hooks.sh) | - -## What is MCP? (Model Context Protocol) +## What is MCP? [Model Context Protocol (MCP)](https://modelcontextprotocol.io/) is an open protocol that lets AI coding tools connect to external services — GitHub, Playwright, databases, APIs, design tools — through a standardized interface. **ai-coding-kit** gives you one place to define all your MCP servers and syncs them to every tool that supports MCP. -## Documentation - -| Topic | Link | -|------|------| -| Agent Skill engineering | [skills-engineering/README.md](skills-engineering/README.md) | -| iOS engineer skill | [skills-engineering/ios-engineer/SKILL.md](skills-engineering/ios-engineer/SKILL.md) | -| iOS skill rule index | [skills-engineering/ios-engineer/references/rule_index.md](skills-engineering/ios-engineer/references/rule_index.md) | -| Cognitive expansion skill | [skills-engineering/cognitive-expansion/SKILL.md](skills-engineering/cognitive-expansion/SKILL.md) | -| Engineering discipline skill | [skills-engineering/engineering-discipline/SKILL.md](skills-engineering/engineering-discipline/SKILL.md) | -| Logical reasoning skill | [skills-engineering/logical-reasoning/SKILL.md](skills-engineering/logical-reasoning/SKILL.md) | -| Epistemic integrity skill | [skills-engineering/epistemic-integrity/SKILL.md](skills-engineering/epistemic-integrity/SKILL.md) | -| Problem analysis skill | [skills-engineering/problem-analysis/SKILL.md](skills-engineering/problem-analysis/SKILL.md) | -| MCP and platform config sync | [sync/README.md](sync/README.md) | -| Universal RAG Gateway | [docs/universal-rag-gateway.md](docs/universal-rag-gateway.md) | -| Token comparison notes | [docs/token-comparison-results-v2.md](docs/token-comparison-results-v2.md) | - -## Repository Layout - -| Path | Role | -|------|------| -| [skills-engineering/](skills-engineering/) | Agent Skill sources, references, sync scripts, validation data, and skill evolution workflow. | -| [sync/](sync/) | Renderers and orchestration for local MCP / platform config sync. | -| [env/](env/) | Local configuration template; the real `env/config.json` is intentionally gitignored. | -| [rag-gateway/](rag-gateway/) | Universal RAG Gateway source, tests, providers, retrieval, memory, telemetry, and declarative tool runtime. | -| [docs/](docs/) | Architecture notes, Gateway status, and token comparison reports. | -| [.githooks/](.githooks/) | Repository-managed commit and push guards. | - ## Who This Is For -- **Developers using multiple AI coding tools** who want one config to rule them all — define MCP servers and Agent Skills once, sync everywhere. -- **iOS / Swift engineers** who want production-grade AI coding rules for Swift, SwiftUI, UIKit, Xcode, concurrency, testing, code review, and app migration. -- **AI infrastructure builders** experimenting with local memory, semantic retrieval, declarative tools, provider routing, and OpenAI-compatible RAG gateway patterns. -- **Team maintainers** who need a single source of truth for MCP configuration, API keys, and model settings across Cursor, CodeBuddy, Claude Code, Codex, Gemini, Continue, Cline, and Xcode. +- **Developers using multiple AI coding tools** — define MCP servers and Agent Skills once, sync everywhere. +- **iOS / Swift engineers** — production-grade AI coding rules for Swift, SwiftUI, UIKit, concurrency, testing, and migration. +- **AI infrastructure builders** — local memory, semantic retrieval, declarative tools, and OpenAI-compatible RAG gateway patterns. +- **Team maintainers** — single source of truth for MCP configuration, API keys, and model settings. ## License diff --git a/docs/.vitepress/.temp/@localSearchIndexroot.BF8B3Qzi.js b/docs/.vitepress/.temp/@localSearchIndexroot.BF8B3Qzi.js new file mode 100644 index 0000000..ebda80a --- /dev/null +++ b/docs/.vitepress/.temp/@localSearchIndexroot.BF8B3Qzi.js @@ -0,0 +1,4 @@ +const _localSearchIndexroot = '{"documentCount":22,"nextId":22,"documentIds":{"0":"/ai-coding-kit/#quick-start","1":"/ai-coding-kit/#or-install-via-package-manager","2":"/ai-coding-kit/#platform-support","3":"/ai-coding-kit/#modules","4":"/ai-coding-kit/ios-engineer/#ios-engineer","5":"/ai-coding-kit/ios-engineer/#architecture","6":"/ai-coding-kit/ios-engineer/#rule-system","7":"/ai-coding-kit/ios-engineer/#key-rules","8":"/ai-coding-kit/ios-engineer/#ir-001-—-language-anchoring","9":"/ai-coding-kit/ios-engineer/#ir-006-—-version-context-block","10":"/ai-coding-kit/ios-engineer/#ir-011-—-cognitive-adversary-mode","11":"/ai-coding-kit/ios-engineer/#evolution-governance","12":"/ai-coding-kit/ios-engineer/references#references","13":"/ai-coding-kit/ios-engineer/references#governance-layer","14":"/ai-coding-kit/ios-engineer/references#domain-references","15":"/ai-coding-kit/ios-engineer/references#validation-scripts","16":"/ai-coding-kit/ios-engineer/rule-index#rule-index","17":"/ai-coding-kit/ios-engineer/rule-index#iron-rules-ir-nnn","18":"/ai-coding-kit/ios-engineer/rule-index#global-rules-gr-nnn","19":"/ai-coding-kit/ios-engineer/rule-index#symptom-routing-sym-nnn","20":"/ai-coding-kit/ios-engineer/rule-index#task-routing-route-nnn","21":"/ai-coding-kit/ios-engineer/rule-index#output-templates-out-nnn"},"fieldIds":{"title":0,"titles":1,"text":2},"fieldLength":{"0":[2,1,36],"1":[5,2,13],"2":[2,1,39],"3":[1,1,50],"4":[2,1,51],"5":[1,2,68],"6":[2,2,57],"7":[2,2,1],"8":[4,4,12],"9":[5,4,16],"10":[5,4,21],"11":[2,2,50],"12":[1,1,43],"13":[2,1,26],"14":[2,1,43],"15":[2,1,52],"16":[2,1,30],"17":[5,2,35],"18":[5,2,83],"19":[5,2,54],"20":[5,2,24],"21":[5,2,30]},"averageFieldLength":[3.0454545454545454,1.863636363636364,37.90909090909091],"storedFields":{"0":{"title":"Quick Start","titles":[]},"1":{"title":"Or install via package manager","titles":["Quick Start"]},"2":{"title":"Platform Support","titles":[]},"3":{"title":"Modules","titles":[]},"4":{"title":"iOS Engineer","titles":[]},"5":{"title":"Architecture","titles":["iOS Engineer"]},"6":{"title":"Rule System","titles":["iOS Engineer"]},"7":{"title":"Key Rules","titles":["iOS Engineer"]},"8":{"title":"IR-001 — Language Anchoring","titles":["iOS Engineer","Key Rules"]},"9":{"title":"IR-006 — Version Context Block","titles":["iOS Engineer","Key Rules"]},"10":{"title":"IR-011 — Cognitive Adversary Mode","titles":["iOS Engineer","Key Rules"]},"11":{"title":"Evolution Governance","titles":["iOS Engineer"]},"12":{"title":"References","titles":[]},"13":{"title":"Governance Layer","titles":["References"]},"14":{"title":"Domain References","titles":["References"]},"15":{"title":"Validation Scripts","titles":["References"]},"16":{"title":"Rule Index","titles":[]},"17":{"title":"Iron Rules (IR-NNN)","titles":["Rule Index"]},"18":{"title":"Global Rules (GR-NNN)","titles":["Rule Index"]},"19":{"title":"Symptom Routing (SYM-NNN)","titles":["Rule Index"]},"20":{"title":"Task Routing (ROUTE-NNN)","titles":["Rule Index"]},"21":{"title":"Output Templates (OUT-NNN)","titles":["Rule Index"]}},"dirtCount":0,"index":[["jitter",{"2":{"19":1}}],["json",{"2":{"0":3,"2":6}}],["write",{"2":{"19":1}}],["with",{"2":{"15":1,"18":1,"21":1}}],["why",{"2":{"18":1}}],["which",{"2":{"11":1}}],["when",{"2":{"10":1,"18":1}}],["what",{"2":{"2":1}}],["49",{"2":{"13":1}}],["40+",{"2":{"6":1}}],["15",{"2":{"18":1}}],["1",{"2":{"18":2}}],["14",{"2":{"11":1,"15":1}}],["10",{"2":{"6":1,"20":1}}],["010",{"2":{"18":1}}],["011",{"0":{"10":1},"2":{"17":1}}],["008",{"2":{"18":1}}],["007",{"2":{"18":1,"19":1}}],["005",{"2":{"18":1,"19":1}}],["004",{"2":{"18":1,"19":1}}],["003",{"2":{"18":1,"19":1}}],["002",{"2":{"18":1,"19":1}}],["006",{"0":{"9":1},"2":{"17":1,"18":1,"19":1}}],["001",{"0":{"8":1},"2":{"17":1,"18":1,"19":1}}],["knowledge",{"2":{"12":1}}],["key",{"0":{"7":1},"1":{"8":1,"9":1,"10":1}}],["kit",{"2":{"0":2,"1":2,"4":1}}],["6",{"2":{"6":1,"21":1}}],["→",{"2":{"6":2,"18":3,"19":1}}],["7",{"2":{"6":1}}],["9",{"2":{"6":1}}],["5",{"2":{"6":1}}],["27",{"2":{"5":1,"15":1}}],["3",{"2":{"6":1,"18":1}}],["31",{"2":{"5":1}}],["34",{"2":{"5":1,"12":1,"14":1}}],["└──",{"2":{"5":4}}],["│",{"2":{"5":7}}],["├──",{"2":{"5":9}}],["list",{"2":{"19":1}}],["lifecycle",{"2":{"12":1}}],["legacy",{"2":{"19":1}}],["ledger",{"2":{"13":2,"15":2}}],["level",{"2":{"10":1}}],["loaded",{"2":{"12":1}}],["logic",{"2":{"6":1,"18":1}}],["locales",{"2":{"4":1}}],["launch",{"2":{"19":1}}],["lag",{"2":{"19":1}}],["last",{"2":{"15":1}}],["layer",{"0":{"13":1},"2":{"5":1}}],["layered",{"2":{"5":1}}],["language",{"0":{"8":1},"2":{"4":1,"8":2,"17":2}}],["zh",{"2":{"4":1,"5":1}}],["简体中文",{"2":{"4":1}}],["ui",{"2":{"19":1}}],["uikit",{"2":{"4":1}}],["unwrap",{"2":{"19":2}}],["universal",{"2":{"3":1}}],["update",{"2":{"11":1}}],["usage",{"2":{"13":2,"15":2}}],["used",{"2":{"12":1}}],["user",{"2":{"8":1,"17":1}}],["us",{"2":{"4":1,"5":1}}],["root",{"2":{"18":1,"19":1,"21":1}}],["route",{"0":{"20":1},"2":{"6":3,"12":1}}],["routing",{"0":{"19":1,"20":1},"2":{"5":1,"6":2,"12":2,"20":1}}],["runtime",{"2":{"12":1}}],["run",{"2":{"11":1}}],["rule",{"0":{"6":1,"16":1},"1":{"17":1,"18":1,"19":1,"20":1,"21":1},"2":{"5":2,"6":2,"11":1,"13":2,"15":3,"16":3,"21":1}}],["rules",{"0":{"7":1,"17":1,"18":1},"1":{"8":1,"9":1,"10":1},"2":{"4":1,"6":2,"12":1,"13":1}}],["record",{"2":{"21":1}}],["records",{"2":{"14":2}}],["request",{"2":{"19":2}}],["requires",{"2":{"11":1}}],["require",{"2":{"9":1}}],["release",{"2":{"14":2}}],["restatement",{"2":{"10":1,"17":1}}],["registry",{"2":{"5":1,"6":1,"13":1,"16":1,"21":1}}],["refresh",{"2":{"19":1}}],["ref",{"2":{"15":1}}],["referenced",{"2":{"16":1}}],["reference",{"2":{"5":1,"12":1,"13":1,"14":2,"15":1,"18":1}}],["references",{"0":{"12":1,"14":1},"1":{"13":1,"14":1,"15":1},"2":{"5":3,"6":2,"11":2,"12":2}}],["refactoring",{"2":{"4":1}}],["review",{"2":{"4":1,"5":1,"20":1,"21":2}}],["renders",{"2":{"3":1}}],["rag",{"2":{"3":2}}],["dates",{"2":{"15":1}}],["data",{"2":{"3":1,"20":1}}],["diff",{"2":{"18":1}}],["directory",{"2":{"14":1}}],["discipline",{"2":{"6":1}}],["driven",{"2":{"5":1,"11":1}}],["domain",{"0":{"14":1},"2":{"5":2,"12":2,"14":3}}],["dependency",{"2":{"20":1}}],["design",{"2":{"20":1,"21":1}}],["description",{"2":{"3":1,"13":1}}],["declaration",{"2":{"18":1}}],["decision",{"2":{"14":2,"21":1}}],["defined",{"2":{"16":1}}],["definitions",{"2":{"3":1}}],["detailed",{"2":{"12":1}}],["development",{"2":{"4":1}}],["debugging",{"2":{"4":1,"20":1}}],["fear",{"2":{"19":1}}],["four",{"2":{"18":1}}],["force",{"2":{"19":2}}],["forced",{"2":{"8":1}}],["formatting",{"2":{"18":1}}],["formats",{"2":{"3":1,"6":1}}],["for",{"2":{"4":1,"5":1,"6":1,"12":1,"14":1,"16":1,"18":1,"21":2}}],["fix",{"2":{"18":2}}],["first",{"2":{"16":1,"18":1}}],["files",{"2":{"5":1,"12":1,"14":1,"15":2}}],["file",{"2":{"0":1}}],["freshness",{"2":{"15":1}}],["full",{"2":{"12":1,"14":1}}],["flip",{"2":{"10":1}}],["falsifiability",{"2":{"17":1}}],["falsifiable",{"2":{"10":1}}],["failures",{"2":{"18":1}}],["failure",{"2":{"10":1,"19":1}}],["fastify",{"2":{"3":1}}],["+",{"2":{"2":1,"3":3,"18":1}}],["against",{"2":{"15":1}}],["agent",{"2":{"2":1,"3":1,"4":1,"12":1}}],["auth",{"2":{"19":1}}],["automated",{"2":{"16":1}}],["auto",{"2":{"4":1,"5":1,"6":2,"13":1}}],["audits",{"2":{"15":1}}],["audit",{"2":{"15":1}}],["app",{"2":{"14":2}}],["api",{"2":{"3":1}}],["amp",{"2":{"14":2,"20":2}}],["at",{"2":{"12":1}}],["add",{"2":{"11":1}}],["adversary",{"0":{"10":1},"2":{"13":2,"17":1}}],["are",{"2":{"11":1,"12":2,"15":1}}],["argument",{"2":{"10":1,"17":1}}],["archived",{"2":{"5":1}}],["archive",{"2":{"5":1,"11":1}}],["architecture",{"0":{"5":1},"2":{"4":1,"14":4,"20":1,"21":1}}],["anchor",{"2":{"21":1}}],["anchors",{"2":{"17":1}}],["anchoring",{"0":{"8":1}}],["an",{"2":{"16":1}}],["anti",{"2":{"14":2}}],["and",{"2":{"14":2,"15":2,"21":2}}],["analysis",{"2":{"14":2,"21":1}}],["answers",{"2":{"9":1}}],["availability",{"2":{"9":1,"17":1}}],["all",{"2":{"9":1,"11":1,"14":1}}],["always",{"2":{"6":1}}],["access",{"2":{"19":1}}],["across",{"2":{"6":1}}],["active",{"2":{"5":1,"17":3,"18":9,"19":7}}],["a",{"2":{"5":1,"9":1,"11":3}}],["async",{"2":{"19":1}}],["assertion",{"2":{"19":1}}],["assumptions",{"2":{"10":1,"17":1}}],["assistant",{"2":{"2":1}}],["as",{"2":{"5":1}}],["ai",{"2":{"0":2,"1":2,"4":2,"12":1}}],["xmcp",{"2":{"3":1}}],["xcode",{"2":{"2":1,"4":1}}],["x26",{"2":{"0":1,"5":1}}],["yaml",{"2":{"2":1}}],["you",{"2":{"0":1}}],["your",{"2":{"0":1,"4":1}}],["verify",{"2":{"18":1}}],["verified",{"2":{"15":1}}],["version",{"0":{"9":1},"2":{"9":1,"17":1}}],["validates",{"2":{"15":2}}],["validate",{"2":{"11":2,"15":4,"16":1}}],["validation",{"0":{"15":1},"2":{"5":1,"15":2,"16":1}}],["variables",{"2":{"2":1}}],["vscode",{"2":{"2":1}}],["via",{"0":{"1":1}}],["memory",{"2":{"19":1}}],["misalignment",{"2":{"19":1}}],["minimal",{"2":{"18":1}}],["mirrors",{"2":{"5":1,"18":1}}],["migration",{"2":{"4":1,"20":1,"21":1}}],["md",{"2":{"5":3,"11":2,"13":4,"14":9,"15":2,"16":1,"21":1}}],["markdown",{"2":{"20":1}}],["max",{"2":{"18":1}}],["matches",{"2":{"4":1,"8":1}}],["manager",{"0":{"1":1}}],["multi",{"2":{"3":1}}],["modify",{"2":{"11":1}}],["modeling",{"2":{"14":2}}],["models",{"2":{"2":1}}],["mode",{"0":{"10":1},"2":{"13":2,"17":1}}],["module",{"2":{"3":1}}],["modules",{"0":{"3":1},"2":{"19":1}}],["mcp",{"2":{"2":4,"3":2}}],["plan",{"2":{"21":1}}],["platform",{"0":{"2":1},"2":{"3":2,"6":1,"18":1}}],["persistence",{"2":{"20":1}}],["permission",{"2":{"20":1}}],["performance",{"2":{"4":1}}],["purpose",{"2":{"15":1}}],["push",{"2":{"3":2}}],["position",{"2":{"10":1}}],["points",{"2":{"21":1}}],["point",{"2":{"5":1}}],["pipeline",{"2":{"5":1,"11":1}}],["provide",{"2":{"12":1}}],["providing",{"2":{"4":1}}],["promote",{"2":{"11":1}}],["propose",{"2":{"11":1}}],["proposals",{"2":{"5":3,"11":1}}],["proposal",{"2":{"5":1,"11":4}}],["production",{"2":{"4":1}}],["project",{"2":{"3":1,"19":1}}],["primary",{"2":{"4":1,"18":1}}],["prevents",{"2":{"18":1}}],["prefix",{"2":{"6":1}}],["pre",{"2":{"3":2,"11":1,"18":1}}],["pagination",{"2":{"19":1}}],["patterns",{"2":{"14":2}}],["paths",{"2":{"2":1}}],["package",{"0":{"1":1}}],["gate",{"2":{"18":1}}],["gated",{"2":{"11":1}}],["gateway",{"2":{"3":2}}],["gr",{"0":{"18":1},"2":{"6":1,"18":9}}],["grade",{"2":{"4":1}}],["global",{"0":{"18":1},"2":{"6":1,"18":1}}],["guard",{"2":{"5":1}}],["guards",{"2":{"3":1}}],["governance",{"0":{"11":1,"13":1},"2":{"5":2,"13":1}}],["governed",{"2":{"3":1}}],["generation",{"2":{"20":1}}],["generated",{"2":{"2":1}}],["gemini",{"2":{"2":1}}],["gets",{"2":{"2":1}}],["g",{"2":{"1":1}}],["githooks",{"2":{"3":1}}],["github",{"2":{"0":1,"14":1}}],["git",{"2":{"0":2,"3":1}}],["naming",{"2":{"19":1}}],["native",{"2":{"3":1}}],["noise",{"2":{"18":1}}],["no",{"2":{"8":1,"18":1}}],["nnn",{"0":{"17":1,"18":1,"19":1,"20":1,"21":1},"2":{"6":5}}],["never",{"2":{"18":1}}],["network",{"2":{"9":1,"14":1,"17":1}}],["networking",{"2":{"4":1,"14":1}}],["need",{"2":{"0":1}}],["npm",{"2":{"1":2}}],["back",{"2":{"19":1}}],["based",{"2":{"12":1}}],["bash",{"2":{"0":2,"1":1}}],["budget",{"2":{"18":1}}],["build",{"2":{"14":2,"20":1}}],["bidirectional",{"2":{"16":1}}],["by",{"2":{"11":1,"12":1,"18":1}}],["between",{"2":{"15":1}}],["before",{"2":{"9":1,"17":1}}],["behavior",{"2":{"9":1}}],["blocks",{"2":{"18":1}}],["block",{"0":{"9":1},"2":{"9":1,"17":1,"18":1}}],["brew",{"2":{"1":1}}],["here",{"2":{"16":1}}],["hidden",{"2":{"10":1,"17":1}}],["how",{"2":{"12":1}}],["hook",{"2":{"11":1}}],["hooks",{"2":{"3":2,"5":1}}],["homebrew",{"2":{"1":1}}],["https",{"2":{"0":1}}],["of",{"2":{"19":1}}],["override",{"2":{"19":1}}],["out",{"0":{"21":1},"2":{"6":1}}],["output",{"0":{"21":1},"2":{"5":1,"6":2,"8":2,"10":1,"17":1,"18":1,"21":1}}],["openai",{"2":{"3":1}}],["organized",{"2":{"5":1}}],["or",{"0":{"1":1},"2":{"11":1,"12":1,"18":1}}],["on",{"2":{"12":1,"14":1,"17":1}}],["one",{"2":{"0":1}}],["only",{"2":{"0":1}}],["$editor",{"2":{"0":1}}],["expose",{"2":{"18":1}}],["extensions",{"2":{"14":2}}],["examples",{"2":{"14":2}}],["example",{"2":{"0":1}}],["epistemic",{"2":{"6":1}}],["etc",{"2":{"3":1}}],["every",{"2":{"16":1}}],["everything",{"2":{"0":1}}],["evolves",{"2":{"11":1}}],["evolution",{"0":{"11":1},"2":{"3":1,"5":7,"11":3,"13":2,"15":3}}],["entries",{"2":{"20":1}}],["entry",{"2":{"5":1}}],["energy",{"2":{"19":1}}],["ensures",{"2":{"15":1,"16":1}}],["enforcement",{"2":{"19":1}}],["enforced",{"2":{"6":1}}],["enforces",{"2":{"6":1}}],["en",{"2":{"4":1,"5":1}}],["english",{"2":{"4":1,"5":1}}],["engineer",{"0":{"4":1},"1":{"5":1,"6":1,"7":1,"8":1,"9":1,"10":1,"11":1},"2":{"5":1,"12":1,"16":1,"18":1}}],["engineering",{"2":{"3":1,"4":1,"12":1}}],["engine",{"2":{"3":1}}],["environment",{"2":{"2":1}}],["env",{"2":{"0":3,"3":1}}],["edit",{"2":{"0":1}}],["turns",{"2":{"18":1}}],["traceable",{"2":{"18":1}}],["tracking",{"2":{"13":1}}],["triggered",{"2":{"10":1}}],["triggers",{"2":{"5":1}}],["types",{"2":{"6":1}}],["typescript",{"2":{"3":1}}],["task",{"0":{"20":1},"2":{"6":2,"12":1}}],["tap",{"2":{"1":1}}],["test",{"2":{"21":1}}],["testing",{"2":{"4":1,"20":1}}],["templates",{"0":{"21":1},"2":{"5":1,"6":1,"14":2,"21":1}}],["through",{"2":{"11":1}}],["this",{"2":{"4":1}}],["them",{"2":{"18":1}}],["then",{"2":{"16":1}}],["they",{"2":{"12":1}}],["the",{"2":{"0":1,"4":2,"5":1,"6":3,"8":1,"11":4,"12":3,"14":1,"15":1,"16":1,"18":1,"21":2}}],["toml",{"2":{"2":2}}],["tool",{"2":{"2":1,"18":1}}],["touching",{"2":{"19":1}}],["touch",{"2":{"0":1}}],["to",{"2":{"0":2,"3":1,"11":1,"17":1}}],["slow",{"2":{"19":1}}],["single",{"2":{"18":1}}],["summary",{"2":{"17":1,"18":1,"19":1}}],["supported",{"2":{"4":1}}],["support",{"0":{"2":1}}],["same",{"2":{"11":1}}],["snapshot",{"2":{"11":1,"15":1}}],["snapshots",{"2":{"5":2,"15":1}}],["s",{"2":{"8":1,"17":1}}],["step",{"2":{"11":1,"15":1}}],["strength",{"2":{"18":1}}],["strongest",{"2":{"10":1}}],["structured",{"2":{"6":1}}],["stale",{"2":{"19":1}}],["status",{"2":{"17":1,"18":1,"19":1,"21":1}}],["state",{"2":{"11":1,"15":1,"19":1}}],["staged",{"2":{"11":1}}],["stack",{"2":{"0":1,"1":2}}],["start",{"0":{"0":1},"1":{"1":1}}],["scenario",{"2":{"15":2}}],["scenarios",{"2":{"12":1}}],["script",{"2":{"15":1,"16":1}}],["scripts",{"0":{"15":1},"2":{"5":3,"11":1,"15":2}}],["scope",{"2":{"6":1}}],["specs",{"2":{"15":1}}],["specification",{"2":{"13":1,"15":1}}],["specific",{"2":{"5":1,"12":1}}],["spm",{"2":{"4":1}}],["sym",{"0":{"19":1},"2":{"6":1,"12":1,"19":7}}],["symptoms",{"2":{"6":1}}],["symptom",{"0":{"19":1},"2":{"6":1,"12":1}}],["system",{"0":{"6":1},"2":{"5":1}}],["synced",{"2":{"2":1}}],["sync",{"2":{"0":2,"3":3}}],["swiftui",{"2":{"4":1,"9":1,"17":1}}],["swift",{"2":{"4":1,"12":1}}],["source",{"2":{"3":1}}],["skill",{"2":{"3":1,"4":2,"5":2,"6":1,"11":4,"12":1,"15":4,"16":1,"18":1}}],["skills",{"2":{"2":3,"3":1,"18":1,"20":1}}],["section",{"2":{"18":1}}],["secondary",{"2":{"18":1}}],["security",{"2":{"18":1,"20":1}}],["secrets",{"2":{"0":4,"3":2}}],["see",{"2":{"6":1,"14":1,"21":1}}],["self",{"2":{"5":1,"10":1,"13":1}}],["settings",{"2":{"2":2}}],["ships",{"2":{"15":1}}],["sh",{"2":{"0":1,"11":1,"15":6,"16":1}}],["implement",{"2":{"11":1}}],["implemented",{"2":{"5":1}}],["ir",{"0":{"8":1,"9":1,"10":1,"17":1},"2":{"6":1,"17":3}}],["iron",{"0":{"17":1},"2":{"6":1}}],["i18n",{"2":{"5":1}}],["ids",{"2":{"6":1,"13":1,"15":2,"16":1}}],["id",{"2":{"5":1,"13":1,"16":2,"17":1,"18":1,"19":1}}],["is",{"2":{"4":1,"5":1,"16":1,"18":1}}],["ios",{"0":{"4":1},"1":{"5":1,"6":1,"7":1,"8":1,"9":1,"10":1,"11":1},"2":{"4":2,"5":1,"12":2,"16":1,"18":1}}],["indicators",{"2":{"18":1}}],["independent",{"2":{"18":1}}],["index",{"0":{"16":1},"1":{"17":1,"18":1,"19":1,"20":1,"21":1},"2":{"5":1,"6":1,"11":1,"13":1,"15":1,"21":1}}],["insufficient",{"2":{"18":1}}],["install",{"0":{"1":1},"2":{"1":2}}],["info",{"2":{"18":1}}],["integrity",{"2":{"15":1}}],["includes",{"2":{"12":1}}],["input",{"2":{"8":1,"17":1}}],["in",{"2":{"4":1,"5":1,"11":2,"15":2,"16":1}}],["init",{"2":{"3":1}}],["injects",{"2":{"3":1}}],["i",{"2":{"0":1,"1":2}}],["current",{"2":{"15":1}}],["cursor",{"2":{"2":2}}],["ci",{"2":{"14":2,"20":1}}],["chaos",{"2":{"19":3}}],["chain",{"2":{"18":1}}],["change",{"2":{"18":1}}],["changes",{"2":{"11":1}}],["check",{"2":{"10":1,"11":1,"15":1}}],["checks",{"2":{"5":1}}],["chinese",{"2":{"8":1}}],["credentials",{"2":{"18":1}}],["create",{"2":{"11":1}}],["cross",{"2":{"6":1,"18":1}}],["crash",{"2":{"4":1,"19":1}}],["cause",{"2":{"18":2,"19":1,"21":1}}],["carried",{"2":{"18":1}}],["cancellation",{"2":{"9":1}}],["canonical",{"2":{"5":1,"13":1,"16":1,"21":1}}],["category",{"2":{"6":1}}],["categories",{"2":{"6":1}}],["cn",{"2":{"4":1,"5":1}}],["cline",{"2":{"2":1}}],["cli",{"2":{"2":2}}],["claude",{"2":{"2":3}}],["clone",{"2":{"0":2}}],["cp",{"2":{"0":1}}],["cd",{"2":{"0":1}}],["core",{"2":{"20":1}}],["coverage",{"2":{"18":1}}],["covering",{"2":{"12":1,"20":1}}],["cognitive",{"0":{"10":1},"2":{"13":2,"17":1}}],["counter",{"2":{"10":1,"17":1}}],["count",{"2":{"6":1}}],["cocoapods",{"2":{"4":1}}],["constraint",{"2":{"19":1}}],["consistent",{"2":{"15":1}}],["consistency",{"2":{"5":1,"15":1,"16":1}}],["conflicts",{"2":{"19":1}}],["confirmation",{"2":{"18":1}}],["confidence",{"2":{"10":1}}],["configs",{"2":{"3":1}}],["config",{"2":{"2":3,"3":2}}],["configure",{"2":{"0":1}}],["conformity",{"2":{"10":1}}],["conditions",{"2":{"10":2}}],["conclusion",{"2":{"10":1}}],["conclusions",{"2":{"9":1,"17":1}}],["concurrency",{"2":{"4":1,"9":1,"17":1}}],["control",{"2":{"19":1}}],["context",{"0":{"9":1},"2":{"9":1,"17":1}}],["content",{"2":{"3":1}}],["continue",{"2":{"2":2}}],["codex",{"2":{"2":3}}],["code",{"2":{"2":1,"4":1,"14":2,"18":1,"20":2,"21":1}}],["codebuddy",{"2":{"2":2}}],["coding",{"2":{"0":2,"1":2,"2":1,"4":2}}],["compliance",{"2":{"18":1}}],["complete",{"2":{"6":1,"21":1}}],["compares",{"2":{"15":1}}],["compatible",{"2":{"3":1}}],["comprehensive",{"2":{"15":1}}],["commit",{"2":{"3":2,"11":2}}],["command",{"2":{"0":1}}],["com",{"2":{"0":1}}],["quick",{"0":{"0":1},"1":{"1":1}}]],"serializationVersion":2}'; +export { + _localSearchIndexroot as default +}; diff --git a/docs/.vitepress/.temp/VPLocalSearchBox.BcKWVt-i.js b/docs/.vitepress/.temp/VPLocalSearchBox.BcKWVt-i.js new file mode 100644 index 0000000..7b683d1 --- /dev/null +++ b/docs/.vitepress/.temp/VPLocalSearchBox.BcKWVt-i.js @@ -0,0 +1,366 @@ +var __defProp = Object.defineProperty; +var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value; +var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value); +import { defineComponent, shallowRef, markRaw, computed, ref, watchEffect, watch, createApp, nextTick, onMounted, onBeforeUnmount, unref, useSSRContext } from "vue"; +import { ssrRenderTeleport, ssrRenderAttr, ssrRenderClass, ssrIncludeBooleanAttr, ssrRenderList, ssrInterpolate } from "vue/server-renderer"; +import { computedAsync, useSessionStorage, useLocalStorage, debouncedWatch, onKeyStroke, useEventListener, useScrollLock } from "@vueuse/core"; +import { useFocusTrap } from "@vueuse/integrations/useFocusTrap"; +import Mark from "mark.js/src/vanilla.js"; +import MiniSearch from "minisearch"; +import { u as useData, d as dataSymbol, p as pathToFile, a as useRouter, c as createSearchTranslate, i as inBrowser, e as escapeRegExp } from "./app.js"; +import { _ as _export_sfc } from "./plugin-vue_export-helper.1tPrXgE0.js"; +const localSearchIndex = { "root": () => import("./@localSearchIndexroot.BF8B3Qzi.js") }; +class LRUCache { + constructor(max = 10) { + __publicField(this, "max"); + __publicField(this, "cache"); + this.max = max; + this.cache = /* @__PURE__ */ new Map(); + } + get(key) { + let item = this.cache.get(key); + if (item !== void 0) { + this.cache.delete(key); + this.cache.set(key, item); + } + return item; + } + set(key, val) { + if (this.cache.has(key)) + this.cache.delete(key); + else if (this.cache.size === this.max) + this.cache.delete(this.first()); + this.cache.set(key, val); + } + first() { + return this.cache.keys().next().value; + } + clear() { + this.cache.clear(); + } +} +const _sfc_main = /* @__PURE__ */ defineComponent({ + __name: "VPLocalSearchBox", + __ssrInlineRender: true, + emits: ["close"], + setup(__props, { emit: __emit }) { + var _a, _b; + const emit = __emit; + const el = shallowRef(); + const resultsEl = shallowRef(); + const searchIndexData = shallowRef(localSearchIndex); + const vitePressData = useData(); + const { activate } = useFocusTrap(el, { + immediate: true, + allowOutsideClick: true, + clickOutsideDeactivates: true, + escapeDeactivates: true + }); + const { localeIndex, theme } = vitePressData; + const searchIndex = computedAsync( + async () => { + var _a2, _b2, _c, _d, _e, _f, _g, _h, _i; + return markRaw( + MiniSearch.loadJSON( + (_c = await ((_b2 = (_a2 = searchIndexData.value)[localeIndex.value]) == null ? void 0 : _b2.call(_a2))) == null ? void 0 : _c.default, + { + fields: ["title", "titles", "text"], + storeFields: ["title", "titles"], + searchOptions: { + fuzzy: 0.2, + prefix: true, + boost: { title: 4, text: 2, titles: 1 }, + ...((_d = theme.value.search) == null ? void 0 : _d.provider) === "local" && ((_f = (_e = theme.value.search.options) == null ? void 0 : _e.miniSearch) == null ? void 0 : _f.searchOptions) + }, + ...((_g = theme.value.search) == null ? void 0 : _g.provider) === "local" && ((_i = (_h = theme.value.search.options) == null ? void 0 : _h.miniSearch) == null ? void 0 : _i.options) + } + ) + ); + } + ); + const disableQueryPersistence = computed(() => { + var _a2, _b2; + return ((_a2 = theme.value.search) == null ? void 0 : _a2.provider) === "local" && ((_b2 = theme.value.search.options) == null ? void 0 : _b2.disableQueryPersistence) === true; + }); + const filterText = disableQueryPersistence.value ? ref("") : useSessionStorage("vitepress:local-search-filter", ""); + const showDetailedList = useLocalStorage( + "vitepress:local-search-detailed-list", + ((_a = theme.value.search) == null ? void 0 : _a.provider) === "local" && ((_b = theme.value.search.options) == null ? void 0 : _b.detailedView) === true + ); + const disableDetailedView = computed(() => { + var _a2, _b2, _c; + return ((_a2 = theme.value.search) == null ? void 0 : _a2.provider) === "local" && (((_b2 = theme.value.search.options) == null ? void 0 : _b2.disableDetailedView) === true || ((_c = theme.value.search.options) == null ? void 0 : _c.detailedView) === false); + }); + const buttonText = computed(() => { + var _a2, _b2, _c, _d, _e, _f, _g; + const options = ((_a2 = theme.value.search) == null ? void 0 : _a2.options) ?? theme.value.algolia; + return ((_e = (_d = (_c = (_b2 = options == null ? void 0 : options.locales) == null ? void 0 : _b2[localeIndex.value]) == null ? void 0 : _c.translations) == null ? void 0 : _d.button) == null ? void 0 : _e.buttonText) || ((_g = (_f = options == null ? void 0 : options.translations) == null ? void 0 : _f.button) == null ? void 0 : _g.buttonText) || "Search"; + }); + watchEffect(() => { + if (disableDetailedView.value) { + showDetailedList.value = false; + } + }); + const results = shallowRef([]); + const enableNoResults = ref(false); + watch(filterText, () => { + enableNoResults.value = false; + }); + const mark = computedAsync(async () => { + if (!resultsEl.value) return; + return markRaw(new Mark(resultsEl.value)); + }, null); + const cache = new LRUCache(16); + debouncedWatch( + () => [searchIndex.value, filterText.value, showDetailedList.value], + async ([index, filterTextValue, showDetailedListValue], old, onCleanup) => { + var _a2, _b2, _c, _d; + if ((old == null ? void 0 : old[0]) !== index) { + cache.clear(); + } + let canceled = false; + onCleanup(() => { + canceled = true; + }); + if (!index) return; + results.value = index.search(filterTextValue).slice(0, 16); + enableNoResults.value = true; + const mods = showDetailedListValue ? await Promise.all(results.value.map((r) => fetchExcerpt(r.id))) : []; + if (canceled) return; + for (const { id, mod } of mods) { + const mapId = id.slice(0, id.indexOf("#")); + let map = cache.get(mapId); + if (map) continue; + map = /* @__PURE__ */ new Map(); + cache.set(mapId, map); + const comp = mod.default ?? mod; + if ((comp == null ? void 0 : comp.render) || (comp == null ? void 0 : comp.setup)) { + const app = createApp(comp); + app.config.warnHandler = () => { + }; + app.provide(dataSymbol, vitePressData); + Object.defineProperties(app.config.globalProperties, { + $frontmatter: { + get() { + return vitePressData.frontmatter.value; + } + }, + $params: { + get() { + return vitePressData.page.value.params; + } + } + }); + const div = document.createElement("div"); + app.mount(div); + const headings = div.querySelectorAll("h1, h2, h3, h4, h5, h6"); + headings.forEach((el2) => { + var _a3; + const href = (_a3 = el2.querySelector("a")) == null ? void 0 : _a3.getAttribute("href"); + const anchor = (href == null ? void 0 : href.startsWith("#")) && href.slice(1); + if (!anchor) return; + let html = ""; + while ((el2 = el2.nextElementSibling) && !/^h[1-6]$/i.test(el2.tagName)) + html += el2.outerHTML; + map.set(anchor, html); + }); + app.unmount(); + } + if (canceled) return; + } + const terms = /* @__PURE__ */ new Set(); + results.value = results.value.map((r) => { + const [id, anchor] = r.id.split("#"); + const map = cache.get(id); + const text = (map == null ? void 0 : map.get(anchor)) ?? ""; + for (const term in r.match) { + terms.add(term); + } + return { ...r, text }; + }); + await nextTick(); + if (canceled) return; + await new Promise((r) => { + var _a3; + (_a3 = mark.value) == null ? void 0 : _a3.unmark({ + done: () => { + var _a4; + (_a4 = mark.value) == null ? void 0 : _a4.markRegExp(formMarkRegex(terms), { done: r }); + } + }); + }); + const excerpts = ((_a2 = el.value) == null ? void 0 : _a2.querySelectorAll(".result .excerpt")) ?? []; + for (const excerpt of excerpts) { + (_b2 = excerpt.querySelector('mark[data-markjs="true"]')) == null ? void 0 : _b2.scrollIntoView({ block: "center" }); + } + (_d = (_c = resultsEl.value) == null ? void 0 : _c.firstElementChild) == null ? void 0 : _d.scrollIntoView({ block: "start" }); + }, + { debounce: 200, immediate: true } + ); + async function fetchExcerpt(id) { + const file = pathToFile(id.slice(0, id.indexOf("#"))); + try { + if (!file) throw new Error(`Cannot find file for id: ${id}`); + return { id, mod: await import( + /*@vite-ignore*/ + file + ) }; + } catch (e) { + console.error(e); + return { id, mod: {} }; + } + } + const searchInput = ref(); + const disableReset = computed(() => { + var _a2; + return ((_a2 = filterText.value) == null ? void 0 : _a2.length) <= 0; + }); + function focusSearchInput(select = true) { + var _a2, _b2; + (_a2 = searchInput.value) == null ? void 0 : _a2.focus(); + select && ((_b2 = searchInput.value) == null ? void 0 : _b2.select()); + } + onMounted(() => { + focusSearchInput(); + }); + const selectedIndex = ref(-1); + const disableMouseOver = ref(true); + watch(results, (r) => { + selectedIndex.value = r.length ? 0 : -1; + scrollToSelectedResult(); + }); + function scrollToSelectedResult() { + nextTick(() => { + const selectedEl = document.querySelector(".result.selected"); + selectedEl == null ? void 0 : selectedEl.scrollIntoView({ block: "nearest" }); + }); + } + onKeyStroke("ArrowUp", (event) => { + event.preventDefault(); + selectedIndex.value--; + if (selectedIndex.value < 0) { + selectedIndex.value = results.value.length - 1; + } + disableMouseOver.value = true; + scrollToSelectedResult(); + }); + onKeyStroke("ArrowDown", (event) => { + event.preventDefault(); + selectedIndex.value++; + if (selectedIndex.value >= results.value.length) { + selectedIndex.value = 0; + } + disableMouseOver.value = true; + scrollToSelectedResult(); + }); + const router = useRouter(); + onKeyStroke("Enter", (e) => { + if (e.isComposing) return; + if (e.target instanceof HTMLButtonElement && e.target.type !== "submit") + return; + const selectedPackage = results.value[selectedIndex.value]; + if (e.target instanceof HTMLInputElement && !selectedPackage) { + e.preventDefault(); + return; + } + if (selectedPackage) { + router.go(selectedPackage.id); + emit("close"); + } + }); + onKeyStroke("Escape", () => { + emit("close"); + }); + const defaultTranslations = { + modal: { + displayDetails: "Display detailed list", + resetButtonTitle: "Reset search", + backButtonTitle: "Close search", + noResultsText: "No results for", + footer: { + selectText: "to select", + selectKeyAriaLabel: "enter", + navigateText: "to navigate", + navigateUpKeyAriaLabel: "up arrow", + navigateDownKeyAriaLabel: "down arrow", + closeText: "to close", + closeKeyAriaLabel: "escape" + } + } + }; + const translate = createSearchTranslate(defaultTranslations); + onMounted(() => { + window.history.pushState(null, "", null); + }); + useEventListener("popstate", (event) => { + event.preventDefault(); + emit("close"); + }); + const isLocked = useScrollLock(inBrowser ? document.body : null); + onMounted(() => { + nextTick(() => { + isLocked.value = true; + nextTick().then(() => activate()); + }); + }); + onBeforeUnmount(() => { + isLocked.value = false; + }); + function formMarkRegex(terms) { + return new RegExp( + [...terms].sort((a, b) => b.length - a.length).map((term) => `(${escapeRegExp(term)})`).join("|"), + "gi" + ); + } + return (_ctx, _push, _parent, _attrs) => { + ssrRenderTeleport(_push, (_push2) => { + var _a2, _b2, _c, _d, _e; + _push2(`
`); + }, "body", false, _parent); + }; + } +}); +const _sfc_setup = _sfc_main.setup; +_sfc_main.setup = (props, ctx) => { + const ssrContext = useSSRContext(); + (ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("../node_modules/vitepress/dist/client/theme-default/components/VPLocalSearchBox.vue"); + return _sfc_setup ? _sfc_setup(props, ctx) : void 0; +}; +const VPLocalSearchBox = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-ce626c7c"]]); +export { + VPLocalSearchBox as default +}; diff --git a/docs/.vitepress/.temp/app.js b/docs/.vitepress/.temp/app.js new file mode 100644 index 0000000..d52c080 --- /dev/null +++ b/docs/.vitepress/.temp/app.js @@ -0,0 +1,5198 @@ +import { ssrRenderAttrs, ssrRenderSlot, ssrInterpolate, ssrRenderAttr, ssrRenderList, ssrRenderComponent, ssrRenderVNode, ssrRenderClass, renderToString } from "vue/server-renderer"; +import { defineComponent, mergeProps, useSSRContext, shallowRef, inject, computed, ref, watch, onUnmounted, reactive, markRaw, readonly, nextTick, h, unref, onMounted, watchEffect, watchPostEffect, onUpdated, resolveComponent, createVNode, resolveDynamicComponent, withCtx, renderSlot, createTextVNode, toDisplayString, openBlock, createBlock, createCommentVNode, Fragment, renderList, defineAsyncComponent, provide, toHandlers, withKeys, onBeforeUnmount, useSlots, createSSRApp } from "vue"; +import { usePreferredDark, useDark, useMediaQuery, useWindowSize, onKeyStroke, useWindowScroll, useScrollLock } from "@vueuse/core"; +import { _ as _export_sfc } from "./plugin-vue_export-helper.1tPrXgE0.js"; +const _sfc_main$14 = /* @__PURE__ */ defineComponent({ + __name: "VPBadge", + __ssrInlineRender: true, + props: { + text: {}, + type: { default: "tip" } + }, + setup(__props) { + return (_ctx, _push, _parent, _attrs) => { + _push(``); + ssrRenderSlot(_ctx.$slots, "default", {}, () => { + _push(`${ssrInterpolate(__props.text)}`); + }, _push, _parent); + _push(``); + }; + } +}); +const _sfc_setup$14 = _sfc_main$14.setup; +_sfc_main$14.setup = (props, ctx) => { + const ssrContext = useSSRContext(); + (ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("../node_modules/vitepress/dist/client/theme-default/components/VPBadge.vue"); + return _sfc_setup$14 ? _sfc_setup$14(props, ctx) : void 0; +}; +function deserializeFunctions(r) { + return Array.isArray(r) ? r.map(deserializeFunctions) : typeof r == "object" && r !== null ? Object.keys(r).reduce((t, n) => (t[n] = deserializeFunctions(r[n]), t), {}) : typeof r == "string" && r.startsWith("_vp-fn_") ? new Function(`return ${r.slice(7)}`)() : r; +} +const siteData = deserializeFunctions(JSON.parse('{"lang":"en-US","dir":"ltr","title":"ai-coding-kit","description":"One kit for all AI coding tools — Agent Skills, MCP sync, iOS engineering rules, and RAG gateway","base":"/ai-coding-kit/","head":[],"router":{"prefetchLinks":true},"appearance":true,"themeConfig":{"logo":false,"siteTitle":"ai-coding-kit","nav":[{"text":"Home","link":"/"},{"text":"iOS Engineer","link":"/ios-engineer/"},{"text":"GitHub","link":"https://github.com/i-stack/ai-coding-kit"}],"sidebar":{"/ios-engineer/":[{"text":"iOS Engineer","collapsed":false,"items":[{"text":"Overview","link":"/ios-engineer/"},{"text":"Rule Index","link":"/ios-engineer/rule-index"},{"text":"References","link":"/ios-engineer/references"}]}]},"socialLinks":[{"icon":"github","link":"https://github.com/i-stack/ai-coding-kit"}],"footer":{"message":"Released under the MIT License.","copyright":"Copyright © 2025–2026 i-stack"},"search":{"provider":"local"},"editLink":{"pattern":"https://github.com/i-stack/ai-coding-kit/edit/feature_3.0.0/docs/:path"}},"locales":{},"scrollOffset":134,"cleanUrls":true}')); +const __vite_import_meta_env__ = {}; +const EXTERNAL_URL_RE = /^(?:[a-z]+:|\/\/)/i; +const APPEARANCE_KEY = "vitepress-theme-appearance"; +const HASH_RE = /#.*$/; +const HASH_OR_QUERY_RE = /[?#].*$/; +const INDEX_OR_EXT_RE = /(?:(^|\/)index)?\.(?:md|html)$/; +const inBrowser = typeof document !== "undefined"; +const notFoundPageData = { + relativePath: "404.md", + filePath: "", + title: "404", + description: "Not Found", + headers: [], + frontmatter: { sidebar: false, layout: "page" }, + lastUpdated: 0, + isNotFound: true +}; +function isActive(currentPath, matchPath, asRegex = false) { + if (matchPath === void 0) { + return false; + } + currentPath = normalize(`/${currentPath}`); + if (asRegex) { + return new RegExp(matchPath).test(currentPath); + } + if (normalize(matchPath) !== currentPath) { + return false; + } + const hashMatch = matchPath.match(HASH_RE); + if (hashMatch) { + return (inBrowser ? location.hash : "") === hashMatch[0]; + } + return true; +} +function normalize(path) { + return decodeURI(path).replace(HASH_OR_QUERY_RE, "").replace(INDEX_OR_EXT_RE, "$1"); +} +function isExternal(path) { + return EXTERNAL_URL_RE.test(path); +} +function getLocaleForPath(siteData2, relativePath) { + return Object.keys((siteData2 == null ? void 0 : siteData2.locales) || {}).find((key) => key !== "root" && !isExternal(key) && isActive(relativePath, `/${key}/`, true)) || "root"; +} +function resolveSiteDataByRoute(siteData2, relativePath) { + var _a, _b, _c, _d, _e, _f, _g; + const localeIndex = getLocaleForPath(siteData2, relativePath); + return Object.assign({}, siteData2, { + localeIndex, + lang: ((_a = siteData2.locales[localeIndex]) == null ? void 0 : _a.lang) ?? siteData2.lang, + dir: ((_b = siteData2.locales[localeIndex]) == null ? void 0 : _b.dir) ?? siteData2.dir, + title: ((_c = siteData2.locales[localeIndex]) == null ? void 0 : _c.title) ?? siteData2.title, + titleTemplate: ((_d = siteData2.locales[localeIndex]) == null ? void 0 : _d.titleTemplate) ?? siteData2.titleTemplate, + description: ((_e = siteData2.locales[localeIndex]) == null ? void 0 : _e.description) ?? siteData2.description, + head: mergeHead(siteData2.head, ((_f = siteData2.locales[localeIndex]) == null ? void 0 : _f.head) ?? []), + themeConfig: { + ...siteData2.themeConfig, + ...(_g = siteData2.locales[localeIndex]) == null ? void 0 : _g.themeConfig + } + }); +} +function createTitle(siteData2, pageData) { + const title = pageData.title || siteData2.title; + const template = pageData.titleTemplate ?? siteData2.titleTemplate; + if (typeof template === "string" && template.includes(":title")) { + return template.replace(/:title/g, title); + } + const templateString = createTitleTemplate(siteData2.title, template); + if (title === templateString.slice(3)) { + return title; + } + return `${title}${templateString}`; +} +function createTitleTemplate(siteTitle, template) { + if (template === false) { + return ""; + } + if (template === true || template === void 0) { + return ` | ${siteTitle}`; + } + if (siteTitle === template) { + return ""; + } + return ` | ${template}`; +} +function hasTag(head, tag) { + const [tagType, tagAttrs] = tag; + if (tagType !== "meta") + return false; + const keyAttr = Object.entries(tagAttrs)[0]; + if (keyAttr == null) + return false; + return head.some(([type, attrs]) => type === tagType && attrs[keyAttr[0]] === keyAttr[1]); +} +function mergeHead(prev, curr) { + return [...prev.filter((tagAttrs) => !hasTag(curr, tagAttrs)), ...curr]; +} +const INVALID_CHAR_REGEX = /[\u0000-\u001F"#$&*+,:;<=>?[\]^`{|}\u007F]/g; +const DRIVE_LETTER_REGEX = /^[a-z]:/i; +function sanitizeFileName(name) { + const match = DRIVE_LETTER_REGEX.exec(name); + const driveLetter = match ? match[0] : ""; + return driveLetter + name.slice(driveLetter.length).replace(INVALID_CHAR_REGEX, "_").replace(/(^|\/)_+(?=[^/]*$)/, "$1"); +} +const KNOWN_EXTENSIONS = /* @__PURE__ */ new Set(); +function treatAsHtml(filename) { + var _a; + if (KNOWN_EXTENSIONS.size === 0) { + const extraExts = typeof process === "object" && ((_a = process.env) == null ? void 0 : _a.VITE_EXTRA_EXTENSIONS) || (__vite_import_meta_env__ == null ? void 0 : __vite_import_meta_env__.VITE_EXTRA_EXTENSIONS) || ""; + ("3g2,3gp,aac,ai,apng,au,avif,bin,bmp,cer,class,conf,crl,css,csv,dll,doc,eps,epub,exe,gif,gz,ics,ief,jar,jpe,jpeg,jpg,js,json,jsonld,m4a,man,mid,midi,mjs,mov,mp2,mp3,mp4,mpe,mpeg,mpg,mpp,oga,ogg,ogv,ogx,opus,otf,p10,p7c,p7m,p7s,pdf,png,ps,qt,roff,rtf,rtx,ser,svg,t,tif,tiff,tr,ts,tsv,ttf,txt,vtt,wav,weba,webm,webp,woff,woff2,xhtml,xml,yaml,yml,zip" + (extraExts && typeof extraExts === "string" ? "," + extraExts : "")).split(",").forEach((ext2) => KNOWN_EXTENSIONS.add(ext2)); + } + const ext = filename.split(".").pop(); + return ext == null || !KNOWN_EXTENSIONS.has(ext.toLowerCase()); +} +function escapeRegExp(str) { + return str.replace(/[|\\{}()[\]^$+*?.]/g, "\\$&").replace(/-/g, "\\x2d"); +} +const dataSymbol = Symbol(); +const siteDataRef = shallowRef(siteData); +function initData(route) { + const site = computed(() => resolveSiteDataByRoute(siteDataRef.value, route.data.relativePath)); + const appearance = site.value.appearance; + const isDark = appearance === "force-dark" ? ref(true) : appearance === "force-auto" ? usePreferredDark() : appearance ? useDark({ + storageKey: APPEARANCE_KEY, + initialValue: () => appearance === "dark" ? "dark" : "auto", + ...typeof appearance === "object" ? appearance : {} + }) : ref(false); + const hashRef = ref(inBrowser ? location.hash : ""); + if (inBrowser) { + window.addEventListener("hashchange", () => { + hashRef.value = location.hash; + }); + } + watch(() => route.data, () => { + hashRef.value = inBrowser ? location.hash : ""; + }); + return { + site, + theme: computed(() => site.value.themeConfig), + page: computed(() => route.data), + frontmatter: computed(() => route.data.frontmatter), + params: computed(() => route.data.params), + lang: computed(() => site.value.lang), + dir: computed(() => route.data.frontmatter.dir || site.value.dir), + localeIndex: computed(() => site.value.localeIndex || "root"), + title: computed(() => createTitle(site.value, route.data)), + description: computed(() => route.data.description || site.value.description), + isDark, + hash: computed(() => hashRef.value) + }; +} +function useData$1() { + const data = inject(dataSymbol); + if (!data) { + throw new Error("vitepress data not properly injected in app"); + } + return data; +} +function joinPath(base, path) { + return `${base}${path}`.replace(/\/+/g, "/"); +} +function withBase(path) { + return EXTERNAL_URL_RE.test(path) || !path.startsWith("/") ? path : joinPath(siteDataRef.value.base, path); +} +function pathToFile(path) { + let pagePath = path.replace(/\.html$/, ""); + pagePath = decodeURIComponent(pagePath); + pagePath = pagePath.replace(/\/$/, "/index"); + { + if (inBrowser) { + const base = "/ai-coding-kit/"; + pagePath = sanitizeFileName(pagePath.slice(base.length).replace(/\//g, "_") || "index") + ".md"; + let pageHash = __VP_HASH_MAP__[pagePath.toLowerCase()]; + if (!pageHash) { + pagePath = pagePath.endsWith("_index.md") ? pagePath.slice(0, -9) + ".md" : pagePath.slice(0, -3) + "_index.md"; + pageHash = __VP_HASH_MAP__[pagePath.toLowerCase()]; + } + if (!pageHash) + return null; + pagePath = `${base}${"assets"}/${pagePath}.${pageHash}.js`; + } else { + pagePath = `./${sanitizeFileName(pagePath.slice(1).replace(/\//g, "_"))}.md.js`; + } + } + return pagePath; +} +let contentUpdatedCallbacks = []; +function onContentUpdated(fn) { + contentUpdatedCallbacks.push(fn); + onUnmounted(() => { + contentUpdatedCallbacks = contentUpdatedCallbacks.filter((f) => f !== fn); + }); +} +function getScrollOffset() { + let scrollOffset = siteDataRef.value.scrollOffset; + let offset = 0; + let padding = 24; + if (typeof scrollOffset === "object" && "padding" in scrollOffset) { + padding = scrollOffset.padding; + scrollOffset = scrollOffset.selector; + } + if (typeof scrollOffset === "number") { + offset = scrollOffset; + } else if (typeof scrollOffset === "string") { + offset = tryOffsetSelector(scrollOffset, padding); + } else if (Array.isArray(scrollOffset)) { + for (const selector of scrollOffset) { + const res = tryOffsetSelector(selector, padding); + if (res) { + offset = res; + break; + } + } + } + return offset; +} +function tryOffsetSelector(selector, padding) { + const el = document.querySelector(selector); + if (!el) + return 0; + const bot = el.getBoundingClientRect().bottom; + if (bot < 0) + return 0; + return bot + padding; +} +const RouterSymbol = Symbol(); +const fakeHost = "http://a.com"; +const getDefaultRoute = () => ({ + path: "/", + component: null, + data: notFoundPageData +}); +function createRouter(loadPageModule, fallbackComponent) { + const route = reactive(getDefaultRoute()); + const router = { + route, + go + }; + async function go(href = inBrowser ? location.href : "/") { + var _a, _b; + href = normalizeHref(href); + if (await ((_a = router.onBeforeRouteChange) == null ? void 0 : _a.call(router, href)) === false) + return; + if (inBrowser && href !== normalizeHref(location.href)) { + history.replaceState({ scrollPosition: window.scrollY }, ""); + history.pushState({}, "", href); + } + await loadPage(href); + await ((_b = router.onAfterRouteChange ?? router.onAfterRouteChanged) == null ? void 0 : _b(href)); + } + let latestPendingPath = null; + async function loadPage(href, scrollPosition = 0, isRetry = false) { + var _a, _b; + if (await ((_a = router.onBeforePageLoad) == null ? void 0 : _a.call(router, href)) === false) + return; + const targetLoc = new URL(href, fakeHost); + const pendingPath = latestPendingPath = targetLoc.pathname; + try { + let page = await loadPageModule(pendingPath); + if (!page) { + throw new Error(`Page not found: ${pendingPath}`); + } + if (latestPendingPath === pendingPath) { + latestPendingPath = null; + const { default: comp, __pageData } = page; + if (!comp) { + throw new Error(`Invalid route component: ${comp}`); + } + await ((_b = router.onAfterPageLoad) == null ? void 0 : _b.call(router, href)); + route.path = inBrowser ? pendingPath : withBase(pendingPath); + route.component = markRaw(comp); + route.data = true ? markRaw(__pageData) : readonly(__pageData); + if (inBrowser) { + nextTick(() => { + let actualPathname = siteDataRef.value.base + __pageData.relativePath.replace(/(?:(^|\/)index)?\.md$/, "$1"); + if (!siteDataRef.value.cleanUrls && !actualPathname.endsWith("/")) { + actualPathname += ".html"; + } + if (actualPathname !== targetLoc.pathname) { + targetLoc.pathname = actualPathname; + href = actualPathname + targetLoc.search + targetLoc.hash; + history.replaceState({}, "", href); + } + if (targetLoc.hash && !scrollPosition) { + let target = null; + try { + target = document.getElementById(decodeURIComponent(targetLoc.hash).slice(1)); + } catch (e) { + console.warn(e); + } + if (target) { + scrollTo(target, targetLoc.hash); + return; + } + } + window.scrollTo(0, scrollPosition); + }); + } + } + } catch (err) { + if (!/fetch|Page not found/.test(err.message) && !/^\/404(\.html|\/)?$/.test(href)) { + console.error(err); + } + if (!isRetry) { + try { + const res = await fetch(siteDataRef.value.base + "hashmap.json"); + window.__VP_HASH_MAP__ = await res.json(); + await loadPage(href, scrollPosition, true); + return; + } catch (e) { + } + } + if (latestPendingPath === pendingPath) { + latestPendingPath = null; + route.path = inBrowser ? pendingPath : withBase(pendingPath); + route.component = fallbackComponent ? markRaw(fallbackComponent) : null; + const relativePath = inBrowser ? pendingPath.replace(/(^|\/)$/, "$1index").replace(/(\.html)?$/, ".md").replace(/^\//, "") : "404.md"; + route.data = { ...notFoundPageData, relativePath }; + } + } + } + if (inBrowser) { + if (history.state === null) { + history.replaceState({}, ""); + } + window.addEventListener("click", (e) => { + if (e.defaultPrevented || !(e.target instanceof Element) || e.target.closest("button") || // temporary fix for docsearch action buttons + e.button !== 0 || e.ctrlKey || e.shiftKey || e.altKey || e.metaKey) + return; + const link2 = e.target.closest("a"); + if (!link2 || link2.closest(".vp-raw") || link2.hasAttribute("download") || link2.hasAttribute("target")) + return; + const linkHref = link2.getAttribute("href") ?? (link2 instanceof SVGAElement ? link2.getAttribute("xlink:href") : null); + if (linkHref == null) + return; + const { href, origin, pathname, hash, search } = new URL(linkHref, link2.baseURI); + const currentUrl = new URL(location.href); + if (origin === currentUrl.origin && treatAsHtml(pathname)) { + e.preventDefault(); + if (pathname === currentUrl.pathname && search === currentUrl.search) { + if (hash !== currentUrl.hash) { + history.pushState({}, "", href); + window.dispatchEvent(new HashChangeEvent("hashchange", { + oldURL: currentUrl.href, + newURL: href + })); + } + if (hash) { + scrollTo(link2, hash, link2.classList.contains("header-anchor")); + } else { + window.scrollTo(0, 0); + } + } else { + go(href); + } + } + }, { capture: true }); + window.addEventListener("popstate", async (e) => { + var _a; + if (e.state === null) + return; + const href = normalizeHref(location.href); + await loadPage(href, e.state && e.state.scrollPosition || 0); + await ((_a = router.onAfterRouteChange ?? router.onAfterRouteChanged) == null ? void 0 : _a(href)); + }); + window.addEventListener("hashchange", (e) => { + e.preventDefault(); + }); + } + return router; +} +function useRouter() { + const router = inject(RouterSymbol); + if (!router) { + throw new Error("useRouter() is called without provider."); + } + return router; +} +function useRoute() { + return useRouter().route; +} +function scrollTo(el, hash, smooth = false) { + let target = null; + try { + target = el.classList.contains("header-anchor") ? el : document.getElementById(decodeURIComponent(hash).slice(1)); + } catch (e) { + console.warn(e); + } + if (target) { + let scrollToTarget = function() { + if (!smooth || Math.abs(targetTop - window.scrollY) > window.innerHeight) + window.scrollTo(0, targetTop); + else + window.scrollTo({ left: 0, top: targetTop, behavior: "smooth" }); + }; + const targetPadding = parseInt(window.getComputedStyle(target).paddingTop, 10); + const targetTop = window.scrollY + target.getBoundingClientRect().top - getScrollOffset() + targetPadding; + requestAnimationFrame(scrollToTarget); + } +} +function normalizeHref(href) { + const url = new URL(href, fakeHost); + url.pathname = url.pathname.replace(/(^|\/)index(\.html)?$/, "$1"); + if (siteDataRef.value.cleanUrls) + url.pathname = url.pathname.replace(/\.html$/, ""); + else if (!url.pathname.endsWith("/") && !url.pathname.endsWith(".html")) + url.pathname += ".html"; + return url.pathname + url.search + url.hash; +} +const runCbs = () => contentUpdatedCallbacks.forEach((fn) => fn()); +const Content = defineComponent({ + name: "VitePressContent", + props: { + as: { type: [Object, String], default: "div" } + }, + setup(props) { + const route = useRoute(); + const { frontmatter, site } = useData$1(); + watch(frontmatter, runCbs, { deep: true, flush: "post" }); + return () => h(props.as, site.value.contentProps ?? { style: { position: "relative" } }, [ + route.component ? h(route.component, { + onVnodeMounted: runCbs, + onVnodeUpdated: runCbs, + onVnodeUnmounted: runCbs + }) : "404 Page Not Found" + ]); + } +}); +const _sfc_main$13 = /* @__PURE__ */ defineComponent({ + __name: "VPBackdrop", + __ssrInlineRender: true, + props: { + show: { type: Boolean } + }, + setup(__props) { + return (_ctx, _push, _parent, _attrs) => { + if (__props.show) { + _push(``); + } else { + _push(``); + } + }; + } +}); +const _sfc_setup$13 = _sfc_main$13.setup; +_sfc_main$13.setup = (props, ctx) => { + const ssrContext = useSSRContext(); + (ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("../node_modules/vitepress/dist/client/theme-default/components/VPBackdrop.vue"); + return _sfc_setup$13 ? _sfc_setup$13(props, ctx) : void 0; +}; +const VPBackdrop = /* @__PURE__ */ _export_sfc(_sfc_main$13, [["__scopeId", "data-v-c79a1216"]]); +const useData = useData$1; +function throttleAndDebounce(fn, delay) { + let timeoutId; + let called = false; + return () => { + if (timeoutId) + clearTimeout(timeoutId); + if (!called) { + fn(); + (called = true) && setTimeout(() => called = false, delay); + } else + timeoutId = setTimeout(fn, delay); + }; +} +function ensureStartingSlash(path) { + return path.startsWith("/") ? path : `/${path}`; +} +function normalizeLink$1(url) { + const { pathname, search, hash, protocol } = new URL(url, "http://a.com"); + if (isExternal(url) || url.startsWith("#") || !protocol.startsWith("http") || !treatAsHtml(pathname)) + return url; + const { site } = useData(); + const normalizedPath = pathname.endsWith("/") || pathname.endsWith(".html") ? url : url.replace(/(?:(^\.+)\/)?.*$/, `$1${pathname.replace(/(\.md)?$/, site.value.cleanUrls ? "" : ".html")}${search}${hash}`); + return withBase(normalizedPath); +} +function useLangs({ correspondingLink = false } = {}) { + const { site, localeIndex, page, theme: theme2, hash } = useData(); + const currentLang = computed(() => { + var _a, _b; + return { + label: (_a = site.value.locales[localeIndex.value]) == null ? void 0 : _a.label, + link: ((_b = site.value.locales[localeIndex.value]) == null ? void 0 : _b.link) || (localeIndex.value === "root" ? "/" : `/${localeIndex.value}/`) + }; + }); + const localeLinks = computed(() => Object.entries(site.value.locales).flatMap(([key, value]) => currentLang.value.label === value.label ? [] : { + text: value.label, + link: normalizeLink(value.link || (key === "root" ? "/" : `/${key}/`), theme2.value.i18nRouting !== false && correspondingLink, page.value.relativePath.slice(currentLang.value.link.length - 1), !site.value.cleanUrls) + hash.value + })); + return { localeLinks, currentLang }; +} +function normalizeLink(link2, addPath, path, addExt) { + return addPath ? link2.replace(/\/$/, "") + ensureStartingSlash(path.replace(/(^|\/)index\.md$/, "$1").replace(/\.md$/, addExt ? ".html" : "")) : link2; +} +const _sfc_main$12 = /* @__PURE__ */ defineComponent({ + __name: "NotFound", + __ssrInlineRender: true, + setup(__props) { + const { theme: theme2 } = useData(); + const { currentLang } = useLangs(); + return (_ctx, _push, _parent, _attrs) => { + var _a, _b, _c, _d, _e; + _push(`

${ssrInterpolate(((_a = unref(theme2).notFound) == null ? void 0 : _a.code) ?? "404")}

${ssrInterpolate(((_b = unref(theme2).notFound) == null ? void 0 : _b.title) ?? "PAGE NOT FOUND")}

${ssrInterpolate(((_c = unref(theme2).notFound) == null ? void 0 : _c.quote) ?? "But if you don't change your direction, and if you keep looking, you may end up where you are heading.")}
`); + }; + } +}); +const _sfc_setup$12 = _sfc_main$12.setup; +_sfc_main$12.setup = (props, ctx) => { + const ssrContext = useSSRContext(); + (ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("../node_modules/vitepress/dist/client/theme-default/NotFound.vue"); + return _sfc_setup$12 ? _sfc_setup$12(props, ctx) : void 0; +}; +const NotFound = /* @__PURE__ */ _export_sfc(_sfc_main$12, [["__scopeId", "data-v-d6be1790"]]); +function getSidebar(_sidebar, path) { + if (Array.isArray(_sidebar)) + return addBase(_sidebar); + if (_sidebar == null) + return []; + path = ensureStartingSlash(path); + const dir = Object.keys(_sidebar).sort((a, b) => { + return b.split("/").length - a.split("/").length; + }).find((dir2) => { + return path.startsWith(ensureStartingSlash(dir2)); + }); + const sidebar = dir ? _sidebar[dir] : []; + return Array.isArray(sidebar) ? addBase(sidebar) : addBase(sidebar.items, sidebar.base); +} +function getSidebarGroups(sidebar) { + const groups = []; + let lastGroupIndex = 0; + for (const index in sidebar) { + const item = sidebar[index]; + if (item.items) { + lastGroupIndex = groups.push(item); + continue; + } + if (!groups[lastGroupIndex]) { + groups.push({ items: [] }); + } + groups[lastGroupIndex].items.push(item); + } + return groups; +} +function getFlatSideBarLinks(sidebar) { + const links = []; + function recursivelyExtractLinks(items) { + for (const item of items) { + if (item.text && item.link) { + links.push({ + text: item.text, + link: item.link, + docFooterText: item.docFooterText + }); + } + if (item.items) { + recursivelyExtractLinks(item.items); + } + } + } + recursivelyExtractLinks(sidebar); + return links; +} +function hasActiveLink(path, items) { + if (Array.isArray(items)) { + return items.some((item) => hasActiveLink(path, item)); + } + return isActive(path, items.link) ? true : items.items ? hasActiveLink(path, items.items) : false; +} +function addBase(items, _base) { + return [...items].map((_item) => { + const item = { ..._item }; + const base = item.base || _base; + if (base && item.link) + item.link = base + item.link; + if (item.items) + item.items = addBase(item.items, base); + return item; + }); +} +function useSidebar() { + const { frontmatter, page, theme: theme2 } = useData(); + const is960 = useMediaQuery("(min-width: 960px)"); + const isOpen = ref(false); + const _sidebar = computed(() => { + const sidebarConfig = theme2.value.sidebar; + const relativePath = page.value.relativePath; + return sidebarConfig ? getSidebar(sidebarConfig, relativePath) : []; + }); + const sidebar = ref(_sidebar.value); + watch(_sidebar, (next, prev) => { + if (JSON.stringify(next) !== JSON.stringify(prev)) + sidebar.value = _sidebar.value; + }); + const hasSidebar = computed(() => { + return frontmatter.value.sidebar !== false && sidebar.value.length > 0 && frontmatter.value.layout !== "home"; + }); + const leftAside = computed(() => { + if (hasAside) + return frontmatter.value.aside == null ? theme2.value.aside === "left" : frontmatter.value.aside === "left"; + return false; + }); + const hasAside = computed(() => { + if (frontmatter.value.layout === "home") + return false; + if (frontmatter.value.aside != null) + return !!frontmatter.value.aside; + return theme2.value.aside !== false; + }); + const isSidebarEnabled = computed(() => hasSidebar.value && is960.value); + const sidebarGroups = computed(() => { + return hasSidebar.value ? getSidebarGroups(sidebar.value) : []; + }); + function open() { + isOpen.value = true; + } + function close() { + isOpen.value = false; + } + function toggle() { + isOpen.value ? close() : open(); + } + return { + isOpen, + sidebar, + sidebarGroups, + hasSidebar, + hasAside, + leftAside, + isSidebarEnabled, + open, + close, + toggle + }; +} +function useCloseSidebarOnEscape(isOpen, close) { + let triggerElement; + watchEffect(() => { + triggerElement = isOpen.value ? document.activeElement : void 0; + }); + onMounted(() => { + window.addEventListener("keyup", onEscape); + }); + onUnmounted(() => { + window.removeEventListener("keyup", onEscape); + }); + function onEscape(e) { + if (e.key === "Escape" && isOpen.value) { + close(); + triggerElement == null ? void 0 : triggerElement.focus(); + } + } +} +function useSidebarControl(item) { + const { page, hash } = useData(); + const collapsed = ref(false); + const collapsible = computed(() => { + return item.value.collapsed != null; + }); + const isLink = computed(() => { + return !!item.value.link; + }); + const isActiveLink = ref(false); + const updateIsActiveLink = () => { + isActiveLink.value = isActive(page.value.relativePath, item.value.link); + }; + watch([page, item, hash], updateIsActiveLink); + onMounted(updateIsActiveLink); + const hasActiveLink$1 = computed(() => { + if (isActiveLink.value) { + return true; + } + return item.value.items ? hasActiveLink(page.value.relativePath, item.value.items) : false; + }); + const hasChildren = computed(() => { + return !!(item.value.items && item.value.items.length); + }); + watchEffect(() => { + collapsed.value = !!(collapsible.value && item.value.collapsed); + }); + watchPostEffect(() => { + (isActiveLink.value || hasActiveLink$1.value) && (collapsed.value = false); + }); + function toggle() { + if (collapsible.value) { + collapsed.value = !collapsed.value; + } + } + return { + collapsed, + collapsible, + isLink, + isActiveLink, + hasActiveLink: hasActiveLink$1, + hasChildren, + toggle + }; +} +function useAside() { + const { hasSidebar } = useSidebar(); + const is960 = useMediaQuery("(min-width: 960px)"); + const is1280 = useMediaQuery("(min-width: 1280px)"); + const isAsideEnabled = computed(() => { + if (!is1280.value && !is960.value) { + return false; + } + return hasSidebar.value ? is1280.value : is960.value; + }); + return { + isAsideEnabled + }; +} +const ignoreRE = /\b(?:VPBadge|header-anchor|footnote-ref|ignore-header)\b/; +const resolvedHeaders = []; +function resolveTitle(theme2) { + return typeof theme2.outline === "object" && !Array.isArray(theme2.outline) && theme2.outline.label || theme2.outlineTitle || "On this page"; +} +function getHeaders(range) { + const headers = [ + ...document.querySelectorAll(".VPDoc :where(h1,h2,h3,h4,h5,h6)") + ].filter((el) => el.id && el.hasChildNodes()).map((el) => { + const level = Number(el.tagName[1]); + return { + element: el, + title: serializeHeader(el), + link: "#" + el.id, + level + }; + }); + return resolveHeaders(headers, range); +} +function serializeHeader(h2) { + let ret = ""; + for (const node of h2.childNodes) { + if (node.nodeType === 1) { + if (ignoreRE.test(node.className)) + continue; + ret += node.textContent; + } else if (node.nodeType === 3) { + ret += node.textContent; + } + } + return ret.trim(); +} +function resolveHeaders(headers, range) { + if (range === false) { + return []; + } + const levelsRange = (typeof range === "object" && !Array.isArray(range) ? range.level : range) || 2; + const [high, low] = typeof levelsRange === "number" ? [levelsRange, levelsRange] : levelsRange === "deep" ? [2, 6] : levelsRange; + return buildTree(headers, high, low); +} +function useActiveAnchor(container, marker) { + const { isAsideEnabled } = useAside(); + const onScroll = throttleAndDebounce(setActiveLink, 100); + let prevActiveLink = null; + onMounted(() => { + requestAnimationFrame(setActiveLink); + window.addEventListener("scroll", onScroll); + }); + onUpdated(() => { + activateLink(location.hash); + }); + onUnmounted(() => { + window.removeEventListener("scroll", onScroll); + }); + function setActiveLink() { + if (!isAsideEnabled.value) { + return; + } + const scrollY = window.scrollY; + const innerHeight = window.innerHeight; + const offsetHeight = document.body.offsetHeight; + const isBottom = Math.abs(scrollY + innerHeight - offsetHeight) < 1; + const headers = resolvedHeaders.map(({ element, link: link2 }) => ({ + link: link2, + top: getAbsoluteTop(element) + })).filter(({ top }) => !Number.isNaN(top)).sort((a, b) => a.top - b.top); + if (!headers.length) { + activateLink(null); + return; + } + if (scrollY < 1) { + activateLink(null); + return; + } + if (isBottom) { + activateLink(headers[headers.length - 1].link); + return; + } + let activeLink = null; + for (const { link: link2, top } of headers) { + if (top > scrollY + getScrollOffset() + 4) { + break; + } + activeLink = link2; + } + activateLink(activeLink); + } + function activateLink(hash) { + if (prevActiveLink) { + prevActiveLink.classList.remove("active"); + } + if (hash == null) { + prevActiveLink = null; + } else { + prevActiveLink = container.value.querySelector(`a[href="${decodeURIComponent(hash)}"]`); + } + const activeLink = prevActiveLink; + if (activeLink) { + activeLink.classList.add("active"); + marker.value.style.top = activeLink.offsetTop + 39 + "px"; + marker.value.style.opacity = "1"; + } else { + marker.value.style.top = "33px"; + marker.value.style.opacity = "0"; + } + } +} +function getAbsoluteTop(element) { + let offsetTop = 0; + while (element !== document.body) { + if (element === null) { + return NaN; + } + offsetTop += element.offsetTop; + element = element.offsetParent; + } + return offsetTop; +} +function buildTree(data, min, max) { + resolvedHeaders.length = 0; + const result = []; + const stack = []; + data.forEach((item) => { + const node = { ...item, children: [] }; + let parent = stack[stack.length - 1]; + while (parent && parent.level >= node.level) { + stack.pop(); + parent = stack[stack.length - 1]; + } + if (node.element.classList.contains("ignore-header") || parent && "shouldIgnore" in parent) { + stack.push({ level: node.level, shouldIgnore: true }); + return; + } + if (node.level > max || node.level < min) + return; + resolvedHeaders.push({ element: node.element, link: node.link }); + if (parent) + parent.children.push(node); + else + result.push(node); + stack.push(node); + }); + return result; +} +const _sfc_main$11 = /* @__PURE__ */ defineComponent({ + __name: "VPDocOutlineItem", + __ssrInlineRender: true, + props: { + headers: {}, + root: { type: Boolean } + }, + setup(__props) { + return (_ctx, _push, _parent, _attrs) => { + const _component_VPDocOutlineItem = resolveComponent("VPDocOutlineItem", true); + _push(``); + ssrRenderList(__props.headers, ({ children, link: link2, title }) => { + _push(`
  • ${ssrInterpolate(title)}`); + if (children == null ? void 0 : children.length) { + _push(ssrRenderComponent(_component_VPDocOutlineItem, { headers: children }, null, _parent)); + } else { + _push(``); + } + _push(`
  • `); + }); + _push(``); + }; + } +}); +const _sfc_setup$11 = _sfc_main$11.setup; +_sfc_main$11.setup = (props, ctx) => { + const ssrContext = useSSRContext(); + (ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("../node_modules/vitepress/dist/client/theme-default/components/VPDocOutlineItem.vue"); + return _sfc_setup$11 ? _sfc_setup$11(props, ctx) : void 0; +}; +const VPDocOutlineItem = /* @__PURE__ */ _export_sfc(_sfc_main$11, [["__scopeId", "data-v-b933a997"]]); +const _sfc_main$10 = /* @__PURE__ */ defineComponent({ + __name: "VPDocAsideOutline", + __ssrInlineRender: true, + setup(__props) { + const { frontmatter, theme: theme2 } = useData(); + const headers = shallowRef([]); + onContentUpdated(() => { + headers.value = getHeaders(frontmatter.value.outline ?? theme2.value.outline); + }); + const container = ref(); + const marker = ref(); + useActiveAnchor(container, marker); + return (_ctx, _push, _parent, _attrs) => { + _push(` 0 }], + ref_key: "container", + ref: container + }, _attrs))} data-v-a5bbad30>
    ${ssrInterpolate(unref(resolveTitle)(unref(theme2)))}
    `); + _push(ssrRenderComponent(VPDocOutlineItem, { + headers: headers.value, + root: true + }, null, _parent)); + _push(`
    `); + }; + } +}); +const _sfc_setup$10 = _sfc_main$10.setup; +_sfc_main$10.setup = (props, ctx) => { + const ssrContext = useSSRContext(); + (ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("../node_modules/vitepress/dist/client/theme-default/components/VPDocAsideOutline.vue"); + return _sfc_setup$10 ? _sfc_setup$10(props, ctx) : void 0; +}; +const VPDocAsideOutline = /* @__PURE__ */ _export_sfc(_sfc_main$10, [["__scopeId", "data-v-a5bbad30"]]); +const _sfc_main$$ = /* @__PURE__ */ defineComponent({ + __name: "VPDocAsideCarbonAds", + __ssrInlineRender: true, + props: { + carbonAds: {} + }, + setup(__props) { + const VPCarbonAds = () => null; + return (_ctx, _push, _parent, _attrs) => { + _push(``); + _push(ssrRenderComponent(unref(VPCarbonAds), { "carbon-ads": __props.carbonAds }, null, _parent)); + _push(``); + }; + } +}); +const _sfc_setup$$ = _sfc_main$$.setup; +_sfc_main$$.setup = (props, ctx) => { + const ssrContext = useSSRContext(); + (ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("../node_modules/vitepress/dist/client/theme-default/components/VPDocAsideCarbonAds.vue"); + return _sfc_setup$$ ? _sfc_setup$$(props, ctx) : void 0; +}; +const _sfc_main$_ = /* @__PURE__ */ defineComponent({ + __name: "VPDocAside", + __ssrInlineRender: true, + setup(__props) { + const { theme: theme2 } = useData(); + return (_ctx, _push, _parent, _attrs) => { + _push(``); + ssrRenderSlot(_ctx.$slots, "aside-top", {}, null, _push, _parent); + ssrRenderSlot(_ctx.$slots, "aside-outline-before", {}, null, _push, _parent); + _push(ssrRenderComponent(VPDocAsideOutline, null, null, _parent)); + ssrRenderSlot(_ctx.$slots, "aside-outline-after", {}, null, _push, _parent); + _push(`
    `); + ssrRenderSlot(_ctx.$slots, "aside-ads-before", {}, null, _push, _parent); + if (unref(theme2).carbonAds) { + _push(ssrRenderComponent(_sfc_main$$, { + "carbon-ads": unref(theme2).carbonAds + }, null, _parent)); + } else { + _push(``); + } + ssrRenderSlot(_ctx.$slots, "aside-ads-after", {}, null, _push, _parent); + ssrRenderSlot(_ctx.$slots, "aside-bottom", {}, null, _push, _parent); + _push(``); + }; + } +}); +const _sfc_setup$_ = _sfc_main$_.setup; +_sfc_main$_.setup = (props, ctx) => { + const ssrContext = useSSRContext(); + (ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("../node_modules/vitepress/dist/client/theme-default/components/VPDocAside.vue"); + return _sfc_setup$_ ? _sfc_setup$_(props, ctx) : void 0; +}; +const VPDocAside = /* @__PURE__ */ _export_sfc(_sfc_main$_, [["__scopeId", "data-v-3f215769"]]); +function useEditLink() { + const { theme: theme2, page } = useData(); + return computed(() => { + const { text = "Edit this page", pattern = "" } = theme2.value.editLink || {}; + let url; + if (typeof pattern === "function") { + url = pattern(page.value); + } else { + url = pattern.replace(/:path/g, page.value.filePath); + } + return { url, text }; + }); +} +function usePrevNext() { + const { page, theme: theme2, frontmatter } = useData(); + return computed(() => { + var _a, _b, _c, _d, _e, _f, _g, _h; + const sidebar = getSidebar(theme2.value.sidebar, page.value.relativePath); + const links = getFlatSideBarLinks(sidebar); + const candidates = uniqBy(links, (link2) => link2.link.replace(/[?#].*$/, "")); + const index = candidates.findIndex((link2) => { + return isActive(page.value.relativePath, link2.link); + }); + const hidePrev = ((_a = theme2.value.docFooter) == null ? void 0 : _a.prev) === false && !frontmatter.value.prev || frontmatter.value.prev === false; + const hideNext = ((_b = theme2.value.docFooter) == null ? void 0 : _b.next) === false && !frontmatter.value.next || frontmatter.value.next === false; + return { + prev: hidePrev ? void 0 : { + text: (typeof frontmatter.value.prev === "string" ? frontmatter.value.prev : typeof frontmatter.value.prev === "object" ? frontmatter.value.prev.text : void 0) ?? ((_c = candidates[index - 1]) == null ? void 0 : _c.docFooterText) ?? ((_d = candidates[index - 1]) == null ? void 0 : _d.text), + link: (typeof frontmatter.value.prev === "object" ? frontmatter.value.prev.link : void 0) ?? ((_e = candidates[index - 1]) == null ? void 0 : _e.link) + }, + next: hideNext ? void 0 : { + text: (typeof frontmatter.value.next === "string" ? frontmatter.value.next : typeof frontmatter.value.next === "object" ? frontmatter.value.next.text : void 0) ?? ((_f = candidates[index + 1]) == null ? void 0 : _f.docFooterText) ?? ((_g = candidates[index + 1]) == null ? void 0 : _g.text), + link: (typeof frontmatter.value.next === "object" ? frontmatter.value.next.link : void 0) ?? ((_h = candidates[index + 1]) == null ? void 0 : _h.link) + } + }; + }); +} +function uniqBy(array, keyFn) { + const seen = /* @__PURE__ */ new Set(); + return array.filter((item) => { + const k = keyFn(item); + return seen.has(k) ? false : seen.add(k); + }); +} +const _sfc_main$Z = /* @__PURE__ */ defineComponent({ + __name: "VPLink", + __ssrInlineRender: true, + props: { + tag: {}, + href: {}, + noIcon: { type: Boolean }, + target: {}, + rel: {} + }, + setup(__props) { + const props = __props; + const tag = computed(() => props.tag ?? (props.href ? "a" : "span")); + const isExternal2 = computed( + () => props.href && EXTERNAL_URL_RE.test(props.href) || props.target === "_blank" + ); + return (_ctx, _push, _parent, _attrs) => { + ssrRenderVNode(_push, createVNode(resolveDynamicComponent(tag.value), mergeProps({ + class: ["VPLink", { + link: __props.href, + "vp-external-link-icon": isExternal2.value, + "no-icon": __props.noIcon + }], + href: __props.href ? unref(normalizeLink$1)(__props.href) : void 0, + target: __props.target ?? (isExternal2.value ? "_blank" : void 0), + rel: __props.rel ?? (isExternal2.value ? "noreferrer" : void 0) + }, _attrs), { + default: withCtx((_, _push2, _parent2, _scopeId) => { + if (_push2) { + ssrRenderSlot(_ctx.$slots, "default", {}, null, _push2, _parent2, _scopeId); + } else { + return [ + renderSlot(_ctx.$slots, "default") + ]; + } + }), + _: 3 + }), _parent); + }; + } +}); +const _sfc_setup$Z = _sfc_main$Z.setup; +_sfc_main$Z.setup = (props, ctx) => { + const ssrContext = useSSRContext(); + (ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("../node_modules/vitepress/dist/client/theme-default/components/VPLink.vue"); + return _sfc_setup$Z ? _sfc_setup$Z(props, ctx) : void 0; +}; +const _sfc_main$Y = /* @__PURE__ */ defineComponent({ + __name: "VPDocFooterLastUpdated", + __ssrInlineRender: true, + setup(__props) { + const { theme: theme2, page, lang } = useData(); + const date = computed( + () => new Date(page.value.lastUpdated) + ); + const isoDatetime = computed(() => date.value.toISOString()); + const datetime = ref(""); + onMounted(() => { + watchEffect(() => { + var _a, _b, _c; + datetime.value = new Intl.DateTimeFormat( + ((_b = (_a = theme2.value.lastUpdated) == null ? void 0 : _a.formatOptions) == null ? void 0 : _b.forceLocale) ? lang.value : void 0, + ((_c = theme2.value.lastUpdated) == null ? void 0 : _c.formatOptions) ?? { + dateStyle: "short", + timeStyle: "short" + } + ).format(date.value); + }); + }); + return (_ctx, _push, _parent, _attrs) => { + var _a; + _push(`${ssrInterpolate(((_a = unref(theme2).lastUpdated) == null ? void 0 : _a.text) || unref(theme2).lastUpdatedText || "Last updated")}: ${ssrInterpolate(datetime.value)}

    `); + }; + } +}); +const _sfc_setup$Y = _sfc_main$Y.setup; +_sfc_main$Y.setup = (props, ctx) => { + const ssrContext = useSSRContext(); + (ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("../node_modules/vitepress/dist/client/theme-default/components/VPDocFooterLastUpdated.vue"); + return _sfc_setup$Y ? _sfc_setup$Y(props, ctx) : void 0; +}; +const VPDocFooterLastUpdated = /* @__PURE__ */ _export_sfc(_sfc_main$Y, [["__scopeId", "data-v-e98dd255"]]); +const _sfc_main$X = /* @__PURE__ */ defineComponent({ + __name: "VPDocFooter", + __ssrInlineRender: true, + setup(__props) { + const { theme: theme2, page, frontmatter } = useData(); + const editLink = useEditLink(); + const control = usePrevNext(); + const hasEditLink = computed( + () => theme2.value.editLink && frontmatter.value.editLink !== false + ); + const hasLastUpdated = computed(() => page.value.lastUpdated); + const showFooter = computed( + () => hasEditLink.value || hasLastUpdated.value || control.value.prev || control.value.next + ); + return (_ctx, _push, _parent, _attrs) => { + var _a, _b, _c, _d; + if (showFooter.value) { + _push(``); + ssrRenderSlot(_ctx.$slots, "doc-footer-before", {}, null, _push, _parent); + if (hasEditLink.value || hasLastUpdated.value) { + _push(`
    `); + if (hasEditLink.value) { + _push(``); + } else { + _push(``); + } + if (hasLastUpdated.value) { + _push(`
    `); + _push(ssrRenderComponent(VPDocFooterLastUpdated, null, null, _parent)); + _push(`
    `); + } else { + _push(``); + } + _push(`
    `); + } else { + _push(``); + } + if (((_a = unref(control).prev) == null ? void 0 : _a.link) || ((_b = unref(control).next) == null ? void 0 : _b.link)) { + _push(``); + } else { + _push(``); + } + _push(``); + } else { + _push(``); + } + }; + } +}); +const _sfc_setup$X = _sfc_main$X.setup; +_sfc_main$X.setup = (props, ctx) => { + const ssrContext = useSSRContext(); + (ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("../node_modules/vitepress/dist/client/theme-default/components/VPDocFooter.vue"); + return _sfc_setup$X ? _sfc_setup$X(props, ctx) : void 0; +}; +const VPDocFooter = /* @__PURE__ */ _export_sfc(_sfc_main$X, [["__scopeId", "data-v-e257564d"]]); +const _sfc_main$W = /* @__PURE__ */ defineComponent({ + __name: "VPDoc", + __ssrInlineRender: true, + setup(__props) { + const { theme: theme2 } = useData(); + const route = useRoute(); + const { hasSidebar, hasAside, leftAside } = useSidebar(); + const pageName = computed( + () => route.path.replace(/[./]+/g, "_").replace(/_html$/, "") + ); + return (_ctx, _push, _parent, _attrs) => { + const _component_Content = resolveComponent("Content"); + _push(``); + ssrRenderSlot(_ctx.$slots, "doc-top", {}, null, _push, _parent); + _push(`
    `); + if (unref(hasAside)) { + _push(`
    `); + _push(ssrRenderComponent(VPDocAside, null, { + "aside-top": withCtx((_, _push2, _parent2, _scopeId) => { + if (_push2) { + ssrRenderSlot(_ctx.$slots, "aside-top", {}, null, _push2, _parent2, _scopeId); + } else { + return [ + renderSlot(_ctx.$slots, "aside-top", {}, void 0, true) + ]; + } + }), + "aside-bottom": withCtx((_, _push2, _parent2, _scopeId) => { + if (_push2) { + ssrRenderSlot(_ctx.$slots, "aside-bottom", {}, null, _push2, _parent2, _scopeId); + } else { + return [ + renderSlot(_ctx.$slots, "aside-bottom", {}, void 0, true) + ]; + } + }), + "aside-outline-before": withCtx((_, _push2, _parent2, _scopeId) => { + if (_push2) { + ssrRenderSlot(_ctx.$slots, "aside-outline-before", {}, null, _push2, _parent2, _scopeId); + } else { + return [ + renderSlot(_ctx.$slots, "aside-outline-before", {}, void 0, true) + ]; + } + }), + "aside-outline-after": withCtx((_, _push2, _parent2, _scopeId) => { + if (_push2) { + ssrRenderSlot(_ctx.$slots, "aside-outline-after", {}, null, _push2, _parent2, _scopeId); + } else { + return [ + renderSlot(_ctx.$slots, "aside-outline-after", {}, void 0, true) + ]; + } + }), + "aside-ads-before": withCtx((_, _push2, _parent2, _scopeId) => { + if (_push2) { + ssrRenderSlot(_ctx.$slots, "aside-ads-before", {}, null, _push2, _parent2, _scopeId); + } else { + return [ + renderSlot(_ctx.$slots, "aside-ads-before", {}, void 0, true) + ]; + } + }), + "aside-ads-after": withCtx((_, _push2, _parent2, _scopeId) => { + if (_push2) { + ssrRenderSlot(_ctx.$slots, "aside-ads-after", {}, null, _push2, _parent2, _scopeId); + } else { + return [ + renderSlot(_ctx.$slots, "aside-ads-after", {}, void 0, true) + ]; + } + }), + _: 3 + }, _parent)); + _push(`
    `); + } else { + _push(``); + } + _push(`
    `); + ssrRenderSlot(_ctx.$slots, "doc-before", {}, null, _push, _parent); + _push(`
    `); + _push(ssrRenderComponent(_component_Content, { + class: ["vp-doc", [ + pageName.value, + unref(theme2).externalLinkIcon && "external-link-icon-enabled" + ]] + }, null, _parent)); + _push(`
    `); + _push(ssrRenderComponent(VPDocFooter, null, { + "doc-footer-before": withCtx((_, _push2, _parent2, _scopeId) => { + if (_push2) { + ssrRenderSlot(_ctx.$slots, "doc-footer-before", {}, null, _push2, _parent2, _scopeId); + } else { + return [ + renderSlot(_ctx.$slots, "doc-footer-before", {}, void 0, true) + ]; + } + }), + _: 3 + }, _parent)); + ssrRenderSlot(_ctx.$slots, "doc-after", {}, null, _push, _parent); + _push(`
    `); + ssrRenderSlot(_ctx.$slots, "doc-bottom", {}, null, _push, _parent); + _push(``); + }; + } +}); +const _sfc_setup$W = _sfc_main$W.setup; +_sfc_main$W.setup = (props, ctx) => { + const ssrContext = useSSRContext(); + (ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("../node_modules/vitepress/dist/client/theme-default/components/VPDoc.vue"); + return _sfc_setup$W ? _sfc_setup$W(props, ctx) : void 0; +}; +const VPDoc = /* @__PURE__ */ _export_sfc(_sfc_main$W, [["__scopeId", "data-v-39a288b8"]]); +const _sfc_main$V = /* @__PURE__ */ defineComponent({ + __name: "VPButton", + __ssrInlineRender: true, + props: { + tag: {}, + size: { default: "medium" }, + theme: { default: "brand" }, + text: {}, + href: {}, + target: {}, + rel: {} + }, + setup(__props) { + const props = __props; + const isExternal2 = computed( + () => props.href && EXTERNAL_URL_RE.test(props.href) + ); + const component = computed(() => { + return props.tag || (props.href ? "a" : "button"); + }); + return (_ctx, _push, _parent, _attrs) => { + ssrRenderVNode(_push, createVNode(resolveDynamicComponent(component.value), mergeProps({ + class: ["VPButton", [__props.size, __props.theme]], + href: __props.href ? unref(normalizeLink$1)(__props.href) : void 0, + target: props.target ?? (isExternal2.value ? "_blank" : void 0), + rel: props.rel ?? (isExternal2.value ? "noreferrer" : void 0) + }, _attrs), { + default: withCtx((_, _push2, _parent2, _scopeId) => { + if (_push2) { + _push2(`${ssrInterpolate(__props.text)}`); + } else { + return [ + createTextVNode(toDisplayString(__props.text), 1) + ]; + } + }), + _: 1 + }), _parent); + }; + } +}); +const _sfc_setup$V = _sfc_main$V.setup; +_sfc_main$V.setup = (props, ctx) => { + const ssrContext = useSSRContext(); + (ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("../node_modules/vitepress/dist/client/theme-default/components/VPButton.vue"); + return _sfc_setup$V ? _sfc_setup$V(props, ctx) : void 0; +}; +const VPButton = /* @__PURE__ */ _export_sfc(_sfc_main$V, [["__scopeId", "data-v-fa7799d5"]]); +const _sfc_main$U = /* @__PURE__ */ defineComponent({ + ...{ inheritAttrs: false }, + __name: "VPImage", + __ssrInlineRender: true, + props: { + image: {}, + alt: {} + }, + setup(__props) { + return (_ctx, _push, _parent, _attrs) => { + const _component_VPImage = resolveComponent("VPImage", true); + if (__props.image) { + _push(``); + if (typeof __props.image === "string" || "src" in __props.image) { + _push(``); + } else { + _push(``); + _push(ssrRenderComponent(_component_VPImage, mergeProps({ + class: "dark", + image: __props.image.dark, + alt: __props.image.alt + }, _ctx.$attrs), null, _parent)); + _push(ssrRenderComponent(_component_VPImage, mergeProps({ + class: "light", + image: __props.image.light, + alt: __props.image.alt + }, _ctx.$attrs), null, _parent)); + _push(``); + } + _push(``); + } else { + _push(``); + } + }; + } +}); +const _sfc_setup$U = _sfc_main$U.setup; +_sfc_main$U.setup = (props, ctx) => { + const ssrContext = useSSRContext(); + (ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("../node_modules/vitepress/dist/client/theme-default/components/VPImage.vue"); + return _sfc_setup$U ? _sfc_setup$U(props, ctx) : void 0; +}; +const VPImage = /* @__PURE__ */ _export_sfc(_sfc_main$U, [["__scopeId", "data-v-8426fc1a"]]); +const _sfc_main$T = /* @__PURE__ */ defineComponent({ + __name: "VPHero", + __ssrInlineRender: true, + props: { + name: {}, + text: {}, + tagline: {}, + image: {}, + actions: {} + }, + setup(__props) { + const heroImageSlotExists = inject("hero-image-slot-exists"); + return (_ctx, _push, _parent, _attrs) => { + _push(`
    `); + ssrRenderSlot(_ctx.$slots, "home-hero-info-before", {}, null, _push, _parent); + ssrRenderSlot(_ctx.$slots, "home-hero-info", {}, () => { + _push(`

    `); + if (__props.name) { + _push(`${__props.name ?? ""}`); + } else { + _push(``); + } + if (__props.text) { + _push(`${__props.text ?? ""}`); + } else { + _push(``); + } + _push(`

    `); + if (__props.tagline) { + _push(`

    ${__props.tagline ?? ""}

    `); + } else { + _push(``); + } + }, _push, _parent); + ssrRenderSlot(_ctx.$slots, "home-hero-info-after", {}, null, _push, _parent); + if (__props.actions) { + _push(`
    `); + ssrRenderList(__props.actions, (action) => { + _push(`
    `); + _push(ssrRenderComponent(VPButton, { + tag: "a", + size: "medium", + theme: action.theme, + text: action.text, + href: action.link, + target: action.target, + rel: action.rel + }, null, _parent)); + _push(`
    `); + }); + _push(`
    `); + } else { + _push(``); + } + ssrRenderSlot(_ctx.$slots, "home-hero-actions-after", {}, null, _push, _parent); + _push(`
    `); + if (__props.image || unref(heroImageSlotExists)) { + _push(`
    `); + ssrRenderSlot(_ctx.$slots, "home-hero-image", {}, () => { + if (__props.image) { + _push(ssrRenderComponent(VPImage, { + class: "image-src", + image: __props.image + }, null, _parent)); + } else { + _push(``); + } + }, _push, _parent); + _push(`
    `); + } else { + _push(``); + } + _push(`
    `); + }; + } +}); +const _sfc_setup$T = _sfc_main$T.setup; +_sfc_main$T.setup = (props, ctx) => { + const ssrContext = useSSRContext(); + (ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("../node_modules/vitepress/dist/client/theme-default/components/VPHero.vue"); + return _sfc_setup$T ? _sfc_setup$T(props, ctx) : void 0; +}; +const VPHero = /* @__PURE__ */ _export_sfc(_sfc_main$T, [["__scopeId", "data-v-4f9c455b"]]); +const _sfc_main$S = /* @__PURE__ */ defineComponent({ + __name: "VPHomeHero", + __ssrInlineRender: true, + setup(__props) { + const { frontmatter: fm } = useData(); + return (_ctx, _push, _parent, _attrs) => { + if (unref(fm).hero) { + _push(ssrRenderComponent(VPHero, mergeProps({ + class: "VPHomeHero", + name: unref(fm).hero.name, + text: unref(fm).hero.text, + tagline: unref(fm).hero.tagline, + image: unref(fm).hero.image, + actions: unref(fm).hero.actions + }, _attrs), { + "home-hero-info-before": withCtx((_, _push2, _parent2, _scopeId) => { + if (_push2) { + ssrRenderSlot(_ctx.$slots, "home-hero-info-before", {}, null, _push2, _parent2, _scopeId); + } else { + return [ + renderSlot(_ctx.$slots, "home-hero-info-before") + ]; + } + }), + "home-hero-info": withCtx((_, _push2, _parent2, _scopeId) => { + if (_push2) { + ssrRenderSlot(_ctx.$slots, "home-hero-info", {}, null, _push2, _parent2, _scopeId); + } else { + return [ + renderSlot(_ctx.$slots, "home-hero-info") + ]; + } + }), + "home-hero-info-after": withCtx((_, _push2, _parent2, _scopeId) => { + if (_push2) { + ssrRenderSlot(_ctx.$slots, "home-hero-info-after", {}, null, _push2, _parent2, _scopeId); + } else { + return [ + renderSlot(_ctx.$slots, "home-hero-info-after") + ]; + } + }), + "home-hero-actions-after": withCtx((_, _push2, _parent2, _scopeId) => { + if (_push2) { + ssrRenderSlot(_ctx.$slots, "home-hero-actions-after", {}, null, _push2, _parent2, _scopeId); + } else { + return [ + renderSlot(_ctx.$slots, "home-hero-actions-after") + ]; + } + }), + "home-hero-image": withCtx((_, _push2, _parent2, _scopeId) => { + if (_push2) { + ssrRenderSlot(_ctx.$slots, "home-hero-image", {}, null, _push2, _parent2, _scopeId); + } else { + return [ + renderSlot(_ctx.$slots, "home-hero-image") + ]; + } + }), + _: 3 + }, _parent)); + } else { + _push(``); + } + }; + } +}); +const _sfc_setup$S = _sfc_main$S.setup; +_sfc_main$S.setup = (props, ctx) => { + const ssrContext = useSSRContext(); + (ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("../node_modules/vitepress/dist/client/theme-default/components/VPHomeHero.vue"); + return _sfc_setup$S ? _sfc_setup$S(props, ctx) : void 0; +}; +const _sfc_main$R = /* @__PURE__ */ defineComponent({ + __name: "VPFeature", + __ssrInlineRender: true, + props: { + icon: {}, + title: {}, + details: {}, + link: {}, + linkText: {}, + rel: {}, + target: {} + }, + setup(__props) { + return (_ctx, _push, _parent, _attrs) => { + _push(ssrRenderComponent(_sfc_main$Z, mergeProps({ + class: "VPFeature", + href: __props.link, + rel: __props.rel, + target: __props.target, + "no-icon": true, + tag: __props.link ? "a" : "div" + }, _attrs), { + default: withCtx((_, _push2, _parent2, _scopeId) => { + if (_push2) { + _push2(`
    `); + if (typeof __props.icon === "object" && __props.icon.wrap) { + _push2(`
    `); + _push2(ssrRenderComponent(VPImage, { + image: __props.icon, + alt: __props.icon.alt, + height: __props.icon.height || 48, + width: __props.icon.width || 48 + }, null, _parent2, _scopeId)); + _push2(`
    `); + } else if (typeof __props.icon === "object") { + _push2(ssrRenderComponent(VPImage, { + image: __props.icon, + alt: __props.icon.alt, + height: __props.icon.height || 48, + width: __props.icon.width || 48 + }, null, _parent2, _scopeId)); + } else if (__props.icon) { + _push2(`
    ${__props.icon ?? ""}
    `); + } else { + _push2(``); + } + _push2(`

    ${__props.title ?? ""}

    `); + if (__props.details) { + _push2(`

    ${__props.details ?? ""}

    `); + } else { + _push2(``); + } + if (__props.linkText) { + _push2(``); + } else { + _push2(``); + } + _push2(`
    `); + } else { + return [ + createVNode("article", { class: "box" }, [ + typeof __props.icon === "object" && __props.icon.wrap ? (openBlock(), createBlock("div", { + key: 0, + class: "icon" + }, [ + createVNode(VPImage, { + image: __props.icon, + alt: __props.icon.alt, + height: __props.icon.height || 48, + width: __props.icon.width || 48 + }, null, 8, ["image", "alt", "height", "width"]) + ])) : typeof __props.icon === "object" ? (openBlock(), createBlock(VPImage, { + key: 1, + image: __props.icon, + alt: __props.icon.alt, + height: __props.icon.height || 48, + width: __props.icon.width || 48 + }, null, 8, ["image", "alt", "height", "width"])) : __props.icon ? (openBlock(), createBlock("div", { + key: 2, + class: "icon", + innerHTML: __props.icon + }, null, 8, ["innerHTML"])) : createCommentVNode("", true), + createVNode("h2", { + class: "title", + innerHTML: __props.title + }, null, 8, ["innerHTML"]), + __props.details ? (openBlock(), createBlock("p", { + key: 3, + class: "details", + innerHTML: __props.details + }, null, 8, ["innerHTML"])) : createCommentVNode("", true), + __props.linkText ? (openBlock(), createBlock("div", { + key: 4, + class: "link-text" + }, [ + createVNode("p", { class: "link-text-value" }, [ + createTextVNode(toDisplayString(__props.linkText) + " ", 1), + createVNode("span", { class: "vpi-arrow-right link-text-icon" }) + ]) + ])) : createCommentVNode("", true) + ]) + ]; + } + }), + _: 1 + }, _parent)); + }; + } +}); +const _sfc_setup$R = _sfc_main$R.setup; +_sfc_main$R.setup = (props, ctx) => { + const ssrContext = useSSRContext(); + (ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("../node_modules/vitepress/dist/client/theme-default/components/VPFeature.vue"); + return _sfc_setup$R ? _sfc_setup$R(props, ctx) : void 0; +}; +const VPFeature = /* @__PURE__ */ _export_sfc(_sfc_main$R, [["__scopeId", "data-v-a3976bdc"]]); +const _sfc_main$Q = /* @__PURE__ */ defineComponent({ + __name: "VPFeatures", + __ssrInlineRender: true, + props: { + features: {} + }, + setup(__props) { + const props = __props; + const grid = computed(() => { + const length = props.features.length; + if (!length) { + return; + } else if (length === 2) { + return "grid-2"; + } else if (length === 3) { + return "grid-3"; + } else if (length % 3 === 0) { + return "grid-6"; + } else if (length > 3) { + return "grid-4"; + } + }); + return (_ctx, _push, _parent, _attrs) => { + if (__props.features) { + _push(`
    `); + ssrRenderList(__props.features, (feature) => { + _push(`
    `); + _push(ssrRenderComponent(VPFeature, { + icon: feature.icon, + title: feature.title, + details: feature.details, + link: feature.link, + "link-text": feature.linkText, + rel: feature.rel, + target: feature.target + }, null, _parent)); + _push(`
    `); + }); + _push(`
    `); + } else { + _push(``); + } + }; + } +}); +const _sfc_setup$Q = _sfc_main$Q.setup; +_sfc_main$Q.setup = (props, ctx) => { + const ssrContext = useSSRContext(); + (ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("../node_modules/vitepress/dist/client/theme-default/components/VPFeatures.vue"); + return _sfc_setup$Q ? _sfc_setup$Q(props, ctx) : void 0; +}; +const VPFeatures = /* @__PURE__ */ _export_sfc(_sfc_main$Q, [["__scopeId", "data-v-a6181336"]]); +const _sfc_main$P = /* @__PURE__ */ defineComponent({ + __name: "VPHomeFeatures", + __ssrInlineRender: true, + setup(__props) { + const { frontmatter: fm } = useData(); + return (_ctx, _push, _parent, _attrs) => { + if (unref(fm).features) { + _push(ssrRenderComponent(VPFeatures, mergeProps({ + class: "VPHomeFeatures", + features: unref(fm).features + }, _attrs), null, _parent)); + } else { + _push(``); + } + }; + } +}); +const _sfc_setup$P = _sfc_main$P.setup; +_sfc_main$P.setup = (props, ctx) => { + const ssrContext = useSSRContext(); + (ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("../node_modules/vitepress/dist/client/theme-default/components/VPHomeFeatures.vue"); + return _sfc_setup$P ? _sfc_setup$P(props, ctx) : void 0; +}; +const _sfc_main$O = /* @__PURE__ */ defineComponent({ + __name: "VPHomeContent", + __ssrInlineRender: true, + setup(__props) { + const { width: vw } = useWindowSize({ + initialWidth: 0, + includeScrollbar: false + }); + return (_ctx, _push, _parent, _attrs) => { + _push(``); + ssrRenderSlot(_ctx.$slots, "default", {}, null, _push, _parent); + _push(``); + }; + } +}); +const _sfc_setup$O = _sfc_main$O.setup; +_sfc_main$O.setup = (props, ctx) => { + const ssrContext = useSSRContext(); + (ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("../node_modules/vitepress/dist/client/theme-default/components/VPHomeContent.vue"); + return _sfc_setup$O ? _sfc_setup$O(props, ctx) : void 0; +}; +const VPHomeContent = /* @__PURE__ */ _export_sfc(_sfc_main$O, [["__scopeId", "data-v-8e2d4988"]]); +const _sfc_main$N = /* @__PURE__ */ defineComponent({ + __name: "VPHome", + __ssrInlineRender: true, + setup(__props) { + const { frontmatter, theme: theme2 } = useData(); + return (_ctx, _push, _parent, _attrs) => { + const _component_Content = resolveComponent("Content"); + _push(``); + ssrRenderSlot(_ctx.$slots, "home-hero-before", {}, null, _push, _parent); + _push(ssrRenderComponent(_sfc_main$S, null, { + "home-hero-info-before": withCtx((_, _push2, _parent2, _scopeId) => { + if (_push2) { + ssrRenderSlot(_ctx.$slots, "home-hero-info-before", {}, null, _push2, _parent2, _scopeId); + } else { + return [ + renderSlot(_ctx.$slots, "home-hero-info-before", {}, void 0, true) + ]; + } + }), + "home-hero-info": withCtx((_, _push2, _parent2, _scopeId) => { + if (_push2) { + ssrRenderSlot(_ctx.$slots, "home-hero-info", {}, null, _push2, _parent2, _scopeId); + } else { + return [ + renderSlot(_ctx.$slots, "home-hero-info", {}, void 0, true) + ]; + } + }), + "home-hero-info-after": withCtx((_, _push2, _parent2, _scopeId) => { + if (_push2) { + ssrRenderSlot(_ctx.$slots, "home-hero-info-after", {}, null, _push2, _parent2, _scopeId); + } else { + return [ + renderSlot(_ctx.$slots, "home-hero-info-after", {}, void 0, true) + ]; + } + }), + "home-hero-actions-after": withCtx((_, _push2, _parent2, _scopeId) => { + if (_push2) { + ssrRenderSlot(_ctx.$slots, "home-hero-actions-after", {}, null, _push2, _parent2, _scopeId); + } else { + return [ + renderSlot(_ctx.$slots, "home-hero-actions-after", {}, void 0, true) + ]; + } + }), + "home-hero-image": withCtx((_, _push2, _parent2, _scopeId) => { + if (_push2) { + ssrRenderSlot(_ctx.$slots, "home-hero-image", {}, null, _push2, _parent2, _scopeId); + } else { + return [ + renderSlot(_ctx.$slots, "home-hero-image", {}, void 0, true) + ]; + } + }), + _: 3 + }, _parent)); + ssrRenderSlot(_ctx.$slots, "home-hero-after", {}, null, _push, _parent); + ssrRenderSlot(_ctx.$slots, "home-features-before", {}, null, _push, _parent); + _push(ssrRenderComponent(_sfc_main$P, null, null, _parent)); + ssrRenderSlot(_ctx.$slots, "home-features-after", {}, null, _push, _parent); + if (unref(frontmatter).markdownStyles !== false) { + _push(ssrRenderComponent(VPHomeContent, null, { + default: withCtx((_, _push2, _parent2, _scopeId) => { + if (_push2) { + _push2(ssrRenderComponent(_component_Content, null, null, _parent2, _scopeId)); + } else { + return [ + createVNode(_component_Content) + ]; + } + }), + _: 1 + }, _parent)); + } else { + _push(ssrRenderComponent(_component_Content, null, null, _parent)); + } + _push(``); + }; + } +}); +const _sfc_setup$N = _sfc_main$N.setup; +_sfc_main$N.setup = (props, ctx) => { + const ssrContext = useSSRContext(); + (ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("../node_modules/vitepress/dist/client/theme-default/components/VPHome.vue"); + return _sfc_setup$N ? _sfc_setup$N(props, ctx) : void 0; +}; +const VPHome = /* @__PURE__ */ _export_sfc(_sfc_main$N, [["__scopeId", "data-v-8b561e3d"]]); +const _sfc_main$M = {}; +function _sfc_ssrRender$1(_ctx, _push, _parent, _attrs) { + const _component_Content = resolveComponent("Content"); + _push(``); + ssrRenderSlot(_ctx.$slots, "page-top", {}, null, _push, _parent); + _push(ssrRenderComponent(_component_Content, null, null, _parent)); + ssrRenderSlot(_ctx.$slots, "page-bottom", {}, null, _push, _parent); + _push(``); +} +const _sfc_setup$M = _sfc_main$M.setup; +_sfc_main$M.setup = (props, ctx) => { + const ssrContext = useSSRContext(); + (ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("../node_modules/vitepress/dist/client/theme-default/components/VPPage.vue"); + return _sfc_setup$M ? _sfc_setup$M(props, ctx) : void 0; +}; +const VPPage = /* @__PURE__ */ _export_sfc(_sfc_main$M, [["ssrRender", _sfc_ssrRender$1]]); +const _sfc_main$L = /* @__PURE__ */ defineComponent({ + __name: "VPContent", + __ssrInlineRender: true, + setup(__props) { + const { page, frontmatter } = useData(); + const { hasSidebar } = useSidebar(); + return (_ctx, _push, _parent, _attrs) => { + _push(``); + if (unref(page).isNotFound) { + ssrRenderSlot(_ctx.$slots, "not-found", {}, () => { + _push(ssrRenderComponent(NotFound, null, null, _parent)); + }, _push, _parent); + } else if (unref(frontmatter).layout === "page") { + _push(ssrRenderComponent(VPPage, null, { + "page-top": withCtx((_, _push2, _parent2, _scopeId) => { + if (_push2) { + ssrRenderSlot(_ctx.$slots, "page-top", {}, null, _push2, _parent2, _scopeId); + } else { + return [ + renderSlot(_ctx.$slots, "page-top", {}, void 0, true) + ]; + } + }), + "page-bottom": withCtx((_, _push2, _parent2, _scopeId) => { + if (_push2) { + ssrRenderSlot(_ctx.$slots, "page-bottom", {}, null, _push2, _parent2, _scopeId); + } else { + return [ + renderSlot(_ctx.$slots, "page-bottom", {}, void 0, true) + ]; + } + }), + _: 3 + }, _parent)); + } else if (unref(frontmatter).layout === "home") { + _push(ssrRenderComponent(VPHome, null, { + "home-hero-before": withCtx((_, _push2, _parent2, _scopeId) => { + if (_push2) { + ssrRenderSlot(_ctx.$slots, "home-hero-before", {}, null, _push2, _parent2, _scopeId); + } else { + return [ + renderSlot(_ctx.$slots, "home-hero-before", {}, void 0, true) + ]; + } + }), + "home-hero-info-before": withCtx((_, _push2, _parent2, _scopeId) => { + if (_push2) { + ssrRenderSlot(_ctx.$slots, "home-hero-info-before", {}, null, _push2, _parent2, _scopeId); + } else { + return [ + renderSlot(_ctx.$slots, "home-hero-info-before", {}, void 0, true) + ]; + } + }), + "home-hero-info": withCtx((_, _push2, _parent2, _scopeId) => { + if (_push2) { + ssrRenderSlot(_ctx.$slots, "home-hero-info", {}, null, _push2, _parent2, _scopeId); + } else { + return [ + renderSlot(_ctx.$slots, "home-hero-info", {}, void 0, true) + ]; + } + }), + "home-hero-info-after": withCtx((_, _push2, _parent2, _scopeId) => { + if (_push2) { + ssrRenderSlot(_ctx.$slots, "home-hero-info-after", {}, null, _push2, _parent2, _scopeId); + } else { + return [ + renderSlot(_ctx.$slots, "home-hero-info-after", {}, void 0, true) + ]; + } + }), + "home-hero-actions-after": withCtx((_, _push2, _parent2, _scopeId) => { + if (_push2) { + ssrRenderSlot(_ctx.$slots, "home-hero-actions-after", {}, null, _push2, _parent2, _scopeId); + } else { + return [ + renderSlot(_ctx.$slots, "home-hero-actions-after", {}, void 0, true) + ]; + } + }), + "home-hero-image": withCtx((_, _push2, _parent2, _scopeId) => { + if (_push2) { + ssrRenderSlot(_ctx.$slots, "home-hero-image", {}, null, _push2, _parent2, _scopeId); + } else { + return [ + renderSlot(_ctx.$slots, "home-hero-image", {}, void 0, true) + ]; + } + }), + "home-hero-after": withCtx((_, _push2, _parent2, _scopeId) => { + if (_push2) { + ssrRenderSlot(_ctx.$slots, "home-hero-after", {}, null, _push2, _parent2, _scopeId); + } else { + return [ + renderSlot(_ctx.$slots, "home-hero-after", {}, void 0, true) + ]; + } + }), + "home-features-before": withCtx((_, _push2, _parent2, _scopeId) => { + if (_push2) { + ssrRenderSlot(_ctx.$slots, "home-features-before", {}, null, _push2, _parent2, _scopeId); + } else { + return [ + renderSlot(_ctx.$slots, "home-features-before", {}, void 0, true) + ]; + } + }), + "home-features-after": withCtx((_, _push2, _parent2, _scopeId) => { + if (_push2) { + ssrRenderSlot(_ctx.$slots, "home-features-after", {}, null, _push2, _parent2, _scopeId); + } else { + return [ + renderSlot(_ctx.$slots, "home-features-after", {}, void 0, true) + ]; + } + }), + _: 3 + }, _parent)); + } else if (unref(frontmatter).layout && unref(frontmatter).layout !== "doc") { + ssrRenderVNode(_push, createVNode(resolveDynamicComponent(unref(frontmatter).layout), null, null), _parent); + } else { + _push(ssrRenderComponent(VPDoc, null, { + "doc-top": withCtx((_, _push2, _parent2, _scopeId) => { + if (_push2) { + ssrRenderSlot(_ctx.$slots, "doc-top", {}, null, _push2, _parent2, _scopeId); + } else { + return [ + renderSlot(_ctx.$slots, "doc-top", {}, void 0, true) + ]; + } + }), + "doc-bottom": withCtx((_, _push2, _parent2, _scopeId) => { + if (_push2) { + ssrRenderSlot(_ctx.$slots, "doc-bottom", {}, null, _push2, _parent2, _scopeId); + } else { + return [ + renderSlot(_ctx.$slots, "doc-bottom", {}, void 0, true) + ]; + } + }), + "doc-footer-before": withCtx((_, _push2, _parent2, _scopeId) => { + if (_push2) { + ssrRenderSlot(_ctx.$slots, "doc-footer-before", {}, null, _push2, _parent2, _scopeId); + } else { + return [ + renderSlot(_ctx.$slots, "doc-footer-before", {}, void 0, true) + ]; + } + }), + "doc-before": withCtx((_, _push2, _parent2, _scopeId) => { + if (_push2) { + ssrRenderSlot(_ctx.$slots, "doc-before", {}, null, _push2, _parent2, _scopeId); + } else { + return [ + renderSlot(_ctx.$slots, "doc-before", {}, void 0, true) + ]; + } + }), + "doc-after": withCtx((_, _push2, _parent2, _scopeId) => { + if (_push2) { + ssrRenderSlot(_ctx.$slots, "doc-after", {}, null, _push2, _parent2, _scopeId); + } else { + return [ + renderSlot(_ctx.$slots, "doc-after", {}, void 0, true) + ]; + } + }), + "aside-top": withCtx((_, _push2, _parent2, _scopeId) => { + if (_push2) { + ssrRenderSlot(_ctx.$slots, "aside-top", {}, null, _push2, _parent2, _scopeId); + } else { + return [ + renderSlot(_ctx.$slots, "aside-top", {}, void 0, true) + ]; + } + }), + "aside-outline-before": withCtx((_, _push2, _parent2, _scopeId) => { + if (_push2) { + ssrRenderSlot(_ctx.$slots, "aside-outline-before", {}, null, _push2, _parent2, _scopeId); + } else { + return [ + renderSlot(_ctx.$slots, "aside-outline-before", {}, void 0, true) + ]; + } + }), + "aside-outline-after": withCtx((_, _push2, _parent2, _scopeId) => { + if (_push2) { + ssrRenderSlot(_ctx.$slots, "aside-outline-after", {}, null, _push2, _parent2, _scopeId); + } else { + return [ + renderSlot(_ctx.$slots, "aside-outline-after", {}, void 0, true) + ]; + } + }), + "aside-ads-before": withCtx((_, _push2, _parent2, _scopeId) => { + if (_push2) { + ssrRenderSlot(_ctx.$slots, "aside-ads-before", {}, null, _push2, _parent2, _scopeId); + } else { + return [ + renderSlot(_ctx.$slots, "aside-ads-before", {}, void 0, true) + ]; + } + }), + "aside-ads-after": withCtx((_, _push2, _parent2, _scopeId) => { + if (_push2) { + ssrRenderSlot(_ctx.$slots, "aside-ads-after", {}, null, _push2, _parent2, _scopeId); + } else { + return [ + renderSlot(_ctx.$slots, "aside-ads-after", {}, void 0, true) + ]; + } + }), + "aside-bottom": withCtx((_, _push2, _parent2, _scopeId) => { + if (_push2) { + ssrRenderSlot(_ctx.$slots, "aside-bottom", {}, null, _push2, _parent2, _scopeId); + } else { + return [ + renderSlot(_ctx.$slots, "aside-bottom", {}, void 0, true) + ]; + } + }), + _: 3 + }, _parent)); + } + _push(``); + }; + } +}); +const _sfc_setup$L = _sfc_main$L.setup; +_sfc_main$L.setup = (props, ctx) => { + const ssrContext = useSSRContext(); + (ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("../node_modules/vitepress/dist/client/theme-default/components/VPContent.vue"); + return _sfc_setup$L ? _sfc_setup$L(props, ctx) : void 0; +}; +const VPContent = /* @__PURE__ */ _export_sfc(_sfc_main$L, [["__scopeId", "data-v-1428d186"]]); +const _sfc_main$K = /* @__PURE__ */ defineComponent({ + __name: "VPFooter", + __ssrInlineRender: true, + setup(__props) { + const { theme: theme2, frontmatter } = useData(); + const { hasSidebar } = useSidebar(); + return (_ctx, _push, _parent, _attrs) => { + if (unref(theme2).footer && unref(frontmatter).footer !== false) { + _push(`
    `); + if (unref(theme2).footer.message) { + _push(`

    ${unref(theme2).footer.message ?? ""}

    `); + } else { + _push(``); + } + if (unref(theme2).footer.copyright) { + _push(``); + } else { + _push(``); + } + _push(`
    `); + } else { + _push(``); + } + }; + } +}); +const _sfc_setup$K = _sfc_main$K.setup; +_sfc_main$K.setup = (props, ctx) => { + const ssrContext = useSSRContext(); + (ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("../node_modules/vitepress/dist/client/theme-default/components/VPFooter.vue"); + return _sfc_setup$K ? _sfc_setup$K(props, ctx) : void 0; +}; +const VPFooter = /* @__PURE__ */ _export_sfc(_sfc_main$K, [["__scopeId", "data-v-e315a0ad"]]); +function useLocalNav() { + const { theme: theme2, frontmatter } = useData(); + const headers = shallowRef([]); + const hasLocalNav = computed(() => { + return headers.value.length > 0; + }); + onContentUpdated(() => { + headers.value = getHeaders(frontmatter.value.outline ?? theme2.value.outline); + }); + return { + headers, + hasLocalNav + }; +} +const _sfc_main$J = /* @__PURE__ */ defineComponent({ + __name: "VPLocalNavOutlineDropdown", + __ssrInlineRender: true, + props: { + headers: {}, + navHeight: {} + }, + setup(__props) { + const { theme: theme2 } = useData(); + const open = ref(false); + const vh = ref(0); + const main = ref(); + ref(); + function closeOnClickOutside(e) { + var _a; + if (!((_a = main.value) == null ? void 0 : _a.contains(e.target))) { + open.value = false; + } + } + watch(open, (value) => { + if (value) { + document.addEventListener("click", closeOnClickOutside); + return; + } + document.removeEventListener("click", closeOnClickOutside); + }); + onKeyStroke("Escape", () => { + open.value = false; + }); + onContentUpdated(() => { + open.value = false; + }); + return (_ctx, _push, _parent, _attrs) => { + _push(``); + if (__props.headers.length > 0) { + _push(``); + } else { + _push(``); + } + if (open.value) { + _push(`
    `); + _push(ssrRenderComponent(VPDocOutlineItem, { headers: __props.headers }, null, _parent)); + _push(`
    `); + } else { + _push(``); + } + _push(``); + }; + } +}); +const _sfc_setup$J = _sfc_main$J.setup; +_sfc_main$J.setup = (props, ctx) => { + const ssrContext = useSSRContext(); + (ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("../node_modules/vitepress/dist/client/theme-default/components/VPLocalNavOutlineDropdown.vue"); + return _sfc_setup$J ? _sfc_setup$J(props, ctx) : void 0; +}; +const VPLocalNavOutlineDropdown = /* @__PURE__ */ _export_sfc(_sfc_main$J, [["__scopeId", "data-v-8a42e2b4"]]); +const _sfc_main$I = /* @__PURE__ */ defineComponent({ + __name: "VPLocalNav", + __ssrInlineRender: true, + props: { + open: { type: Boolean } + }, + emits: ["open-menu"], + setup(__props) { + const { theme: theme2, frontmatter } = useData(); + const { hasSidebar } = useSidebar(); + const { headers } = useLocalNav(); + const { y } = useWindowScroll(); + const navHeight = ref(0); + onMounted(() => { + navHeight.value = parseInt( + getComputedStyle(document.documentElement).getPropertyValue( + "--vp-nav-height" + ) + ); + }); + onContentUpdated(() => { + headers.value = getHeaders(frontmatter.value.outline ?? theme2.value.outline); + }); + const empty = computed(() => { + return headers.value.length === 0; + }); + const emptyAndNoSidebar = computed(() => { + return empty.value && !hasSidebar.value; + }); + const classes = computed(() => { + return { + VPLocalNav: true, + "has-sidebar": hasSidebar.value, + empty: empty.value, + fixed: emptyAndNoSidebar.value + }; + }); + return (_ctx, _push, _parent, _attrs) => { + if (unref(frontmatter).layout !== "home" && (!emptyAndNoSidebar.value || unref(y) >= navHeight.value)) { + _push(`
    `); + if (unref(hasSidebar)) { + _push(``); + } else { + _push(``); + } + _push(ssrRenderComponent(VPLocalNavOutlineDropdown, { + headers: unref(headers), + navHeight: navHeight.value + }, null, _parent)); + _push(`
    `); + } else { + _push(``); + } + }; + } +}); +const _sfc_setup$I = _sfc_main$I.setup; +_sfc_main$I.setup = (props, ctx) => { + const ssrContext = useSSRContext(); + (ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("../node_modules/vitepress/dist/client/theme-default/components/VPLocalNav.vue"); + return _sfc_setup$I ? _sfc_setup$I(props, ctx) : void 0; +}; +const VPLocalNav = /* @__PURE__ */ _export_sfc(_sfc_main$I, [["__scopeId", "data-v-a6f0e41e"]]); +function useNav() { + const isScreenOpen = ref(false); + function openScreen() { + isScreenOpen.value = true; + window.addEventListener("resize", closeScreenOnTabletWindow); + } + function closeScreen() { + isScreenOpen.value = false; + window.removeEventListener("resize", closeScreenOnTabletWindow); + } + function toggleScreen() { + isScreenOpen.value ? closeScreen() : openScreen(); + } + function closeScreenOnTabletWindow() { + window.outerWidth >= 768 && closeScreen(); + } + const route = useRoute(); + watch(() => route.path, closeScreen); + return { + isScreenOpen, + openScreen, + closeScreen, + toggleScreen + }; +} +const _sfc_main$H = {}; +function _sfc_ssrRender(_ctx, _push, _parent, _attrs) { + _push(``); + if (_ctx.$slots.default) { + _push(``); + ssrRenderSlot(_ctx.$slots, "default", {}, null, _push, _parent); + _push(``); + } else { + _push(``); + } + _push(``); +} +const _sfc_setup$H = _sfc_main$H.setup; +_sfc_main$H.setup = (props, ctx) => { + const ssrContext = useSSRContext(); + (ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("../node_modules/vitepress/dist/client/theme-default/components/VPSwitch.vue"); + return _sfc_setup$H ? _sfc_setup$H(props, ctx) : void 0; +}; +const VPSwitch = /* @__PURE__ */ _export_sfc(_sfc_main$H, [["ssrRender", _sfc_ssrRender], ["__scopeId", "data-v-1d5665e3"]]); +const _sfc_main$G = /* @__PURE__ */ defineComponent({ + __name: "VPSwitchAppearance", + __ssrInlineRender: true, + setup(__props) { + const { isDark, theme: theme2 } = useData(); + const toggleAppearance = inject("toggle-appearance", () => { + isDark.value = !isDark.value; + }); + const switchTitle = ref(""); + watchPostEffect(() => { + switchTitle.value = isDark.value ? theme2.value.lightModeSwitchTitle || "Switch to light theme" : theme2.value.darkModeSwitchTitle || "Switch to dark theme"; + }); + return (_ctx, _push, _parent, _attrs) => { + _push(ssrRenderComponent(VPSwitch, mergeProps({ + title: switchTitle.value, + class: "VPSwitchAppearance", + "aria-checked": unref(isDark), + onClick: unref(toggleAppearance) + }, _attrs), { + default: withCtx((_, _push2, _parent2, _scopeId) => { + if (_push2) { + _push2(``); + } else { + return [ + createVNode("span", { class: "vpi-sun sun" }), + createVNode("span", { class: "vpi-moon moon" }) + ]; + } + }), + _: 1 + }, _parent)); + }; + } +}); +const _sfc_setup$G = _sfc_main$G.setup; +_sfc_main$G.setup = (props, ctx) => { + const ssrContext = useSSRContext(); + (ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("../node_modules/vitepress/dist/client/theme-default/components/VPSwitchAppearance.vue"); + return _sfc_setup$G ? _sfc_setup$G(props, ctx) : void 0; +}; +const VPSwitchAppearance = /* @__PURE__ */ _export_sfc(_sfc_main$G, [["__scopeId", "data-v-5337faa4"]]); +const _sfc_main$F = /* @__PURE__ */ defineComponent({ + __name: "VPNavBarAppearance", + __ssrInlineRender: true, + setup(__props) { + const { site } = useData(); + return (_ctx, _push, _parent, _attrs) => { + if (unref(site).appearance && unref(site).appearance !== "force-dark" && unref(site).appearance !== "force-auto") { + _push(``); + _push(ssrRenderComponent(VPSwitchAppearance, null, null, _parent)); + _push(``); + } else { + _push(``); + } + }; + } +}); +const _sfc_setup$F = _sfc_main$F.setup; +_sfc_main$F.setup = (props, ctx) => { + const ssrContext = useSSRContext(); + (ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("../node_modules/vitepress/dist/client/theme-default/components/VPNavBarAppearance.vue"); + return _sfc_setup$F ? _sfc_setup$F(props, ctx) : void 0; +}; +const VPNavBarAppearance = /* @__PURE__ */ _export_sfc(_sfc_main$F, [["__scopeId", "data-v-6c893767"]]); +const focusedElement = ref(); +let active = false; +let listeners = 0; +function useFlyout(options) { + const focus = ref(false); + if (inBrowser) { + !active && activateFocusTracking(); + listeners++; + const unwatch = watch(focusedElement, (el) => { + var _a, _b, _c; + if (el === options.el.value || ((_a = options.el.value) == null ? void 0 : _a.contains(el))) { + focus.value = true; + (_b = options.onFocus) == null ? void 0 : _b.call(options); + } else { + focus.value = false; + (_c = options.onBlur) == null ? void 0 : _c.call(options); + } + }); + onUnmounted(() => { + unwatch(); + listeners--; + if (!listeners) { + deactivateFocusTracking(); + } + }); + } + return readonly(focus); +} +function activateFocusTracking() { + document.addEventListener("focusin", handleFocusIn); + active = true; + focusedElement.value = document.activeElement; +} +function deactivateFocusTracking() { + document.removeEventListener("focusin", handleFocusIn); +} +function handleFocusIn() { + focusedElement.value = document.activeElement; +} +const _sfc_main$E = /* @__PURE__ */ defineComponent({ + __name: "VPMenuLink", + __ssrInlineRender: true, + props: { + item: {} + }, + setup(__props) { + const { page } = useData(); + return (_ctx, _push, _parent, _attrs) => { + _push(``); + _push(ssrRenderComponent(_sfc_main$Z, { + class: { + active: unref(isActive)( + unref(page).relativePath, + __props.item.activeMatch || __props.item.link, + !!__props.item.activeMatch + ) + }, + href: __props.item.link, + target: __props.item.target, + rel: __props.item.rel, + "no-icon": __props.item.noIcon + }, { + default: withCtx((_, _push2, _parent2, _scopeId) => { + if (_push2) { + _push2(`${__props.item.text ?? ""}`); + } else { + return [ + createVNode("span", { + innerHTML: __props.item.text + }, null, 8, ["innerHTML"]) + ]; + } + }), + _: 1 + }, _parent)); + _push(``); + }; + } +}); +const _sfc_setup$E = _sfc_main$E.setup; +_sfc_main$E.setup = (props, ctx) => { + const ssrContext = useSSRContext(); + (ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("../node_modules/vitepress/dist/client/theme-default/components/VPMenuLink.vue"); + return _sfc_setup$E ? _sfc_setup$E(props, ctx) : void 0; +}; +const VPMenuLink = /* @__PURE__ */ _export_sfc(_sfc_main$E, [["__scopeId", "data-v-35975db6"]]); +const _sfc_main$D = /* @__PURE__ */ defineComponent({ + __name: "VPMenuGroup", + __ssrInlineRender: true, + props: { + text: {}, + items: {} + }, + setup(__props) { + return (_ctx, _push, _parent, _attrs) => { + _push(``); + if (__props.text) { + _push(`

    ${ssrInterpolate(__props.text)}

    `); + } else { + _push(``); + } + _push(``); + ssrRenderList(__props.items, (item) => { + _push(``); + if ("link" in item) { + _push(ssrRenderComponent(VPMenuLink, { item }, null, _parent)); + } else { + _push(``); + } + _push(``); + }); + _push(``); + }; + } +}); +const _sfc_setup$D = _sfc_main$D.setup; +_sfc_main$D.setup = (props, ctx) => { + const ssrContext = useSSRContext(); + (ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("../node_modules/vitepress/dist/client/theme-default/components/VPMenuGroup.vue"); + return _sfc_setup$D ? _sfc_setup$D(props, ctx) : void 0; +}; +const VPMenuGroup = /* @__PURE__ */ _export_sfc(_sfc_main$D, [["__scopeId", "data-v-69e747b5"]]); +const _sfc_main$C = /* @__PURE__ */ defineComponent({ + __name: "VPMenu", + __ssrInlineRender: true, + props: { + items: {} + }, + setup(__props) { + return (_ctx, _push, _parent, _attrs) => { + _push(``); + if (__props.items) { + _push(`
    `); + ssrRenderList(__props.items, (item) => { + _push(``); + if ("link" in item) { + _push(ssrRenderComponent(VPMenuLink, { item }, null, _parent)); + } else if ("component" in item) { + ssrRenderVNode(_push, createVNode(resolveDynamicComponent(item.component), mergeProps({ ref_for: true }, item.props), null), _parent); + } else { + _push(ssrRenderComponent(VPMenuGroup, { + text: item.text, + items: item.items + }, null, _parent)); + } + _push(``); + }); + _push(`
    `); + } else { + _push(``); + } + ssrRenderSlot(_ctx.$slots, "default", {}, null, _push, _parent); + _push(``); + }; + } +}); +const _sfc_setup$C = _sfc_main$C.setup; +_sfc_main$C.setup = (props, ctx) => { + const ssrContext = useSSRContext(); + (ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("../node_modules/vitepress/dist/client/theme-default/components/VPMenu.vue"); + return _sfc_setup$C ? _sfc_setup$C(props, ctx) : void 0; +}; +const VPMenu = /* @__PURE__ */ _export_sfc(_sfc_main$C, [["__scopeId", "data-v-b98bc113"]]); +const _sfc_main$B = /* @__PURE__ */ defineComponent({ + __name: "VPFlyout", + __ssrInlineRender: true, + props: { + icon: {}, + button: {}, + label: {}, + items: {} + }, + setup(__props) { + const open = ref(false); + const el = ref(); + useFlyout({ el, onBlur }); + function onBlur() { + open.value = false; + } + return (_ctx, _push, _parent, _attrs) => { + _push(``); + }; + } +}); +const _sfc_setup$B = _sfc_main$B.setup; +_sfc_main$B.setup = (props, ctx) => { + const ssrContext = useSSRContext(); + (ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("../node_modules/vitepress/dist/client/theme-default/components/VPFlyout.vue"); + return _sfc_setup$B ? _sfc_setup$B(props, ctx) : void 0; +}; +const VPFlyout = /* @__PURE__ */ _export_sfc(_sfc_main$B, [["__scopeId", "data-v-cf11d7a2"]]); +const _sfc_main$A = /* @__PURE__ */ defineComponent({ + __name: "VPSocialLink", + __ssrInlineRender: true, + props: { + icon: {}, + link: {}, + ariaLabel: {} + }, + setup(__props) { + var _a; + const props = __props; + const el = ref(); + onMounted(async () => { + var _a2; + await nextTick(); + const span = (_a2 = el.value) == null ? void 0 : _a2.children[0]; + if (span instanceof HTMLElement && span.className.startsWith("vpi-social-") && (getComputedStyle(span).maskImage || getComputedStyle(span).webkitMaskImage) === "none") { + span.style.setProperty( + "--icon", + `url('https://api.iconify.design/simple-icons/${props.icon}.svg')` + ); + } + }); + const svg = computed(() => { + if (typeof props.icon === "object") return props.icon.svg; + return ``; + }); + { + typeof props.icon === "string" && ((_a = useSSRContext()) == null ? void 0 : _a.vpSocialIcons.add(props.icon)); + } + return (_ctx, _push, _parent, _attrs) => { + _push(`${svg.value ?? ""}`); + }; + } +}); +const _sfc_setup$A = _sfc_main$A.setup; +_sfc_main$A.setup = (props, ctx) => { + const ssrContext = useSSRContext(); + (ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("../node_modules/vitepress/dist/client/theme-default/components/VPSocialLink.vue"); + return _sfc_setup$A ? _sfc_setup$A(props, ctx) : void 0; +}; +const VPSocialLink = /* @__PURE__ */ _export_sfc(_sfc_main$A, [["__scopeId", "data-v-bd121fe5"]]); +const _sfc_main$z = /* @__PURE__ */ defineComponent({ + __name: "VPSocialLinks", + __ssrInlineRender: true, + props: { + links: {} + }, + setup(__props) { + return (_ctx, _push, _parent, _attrs) => { + _push(``); + ssrRenderList(__props.links, ({ link: link2, icon, ariaLabel }) => { + _push(ssrRenderComponent(VPSocialLink, { + key: link2, + icon, + link: link2, + ariaLabel + }, null, _parent)); + }); + _push(``); + }; + } +}); +const _sfc_setup$z = _sfc_main$z.setup; +_sfc_main$z.setup = (props, ctx) => { + const ssrContext = useSSRContext(); + (ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("../node_modules/vitepress/dist/client/theme-default/components/VPSocialLinks.vue"); + return _sfc_setup$z ? _sfc_setup$z(props, ctx) : void 0; +}; +const VPSocialLinks = /* @__PURE__ */ _export_sfc(_sfc_main$z, [["__scopeId", "data-v-7bc22406"]]); +const _sfc_main$y = /* @__PURE__ */ defineComponent({ + __name: "VPNavBarExtra", + __ssrInlineRender: true, + setup(__props) { + const { site, theme: theme2 } = useData(); + const { localeLinks, currentLang } = useLangs({ correspondingLink: true }); + const hasExtraContent = computed( + () => localeLinks.value.length && currentLang.value.label || site.value.appearance || theme2.value.socialLinks + ); + return (_ctx, _push, _parent, _attrs) => { + if (hasExtraContent.value) { + _push(ssrRenderComponent(VPFlyout, mergeProps({ + class: "VPNavBarExtra", + label: "extra navigation" + }, _attrs), { + default: withCtx((_, _push2, _parent2, _scopeId) => { + if (_push2) { + if (unref(localeLinks).length && unref(currentLang).label) { + _push2(`

    ${ssrInterpolate(unref(currentLang).label)}

    `); + ssrRenderList(unref(localeLinks), (locale) => { + _push2(ssrRenderComponent(VPMenuLink, { item: locale }, null, _parent2, _scopeId)); + }); + _push2(`
    `); + } else { + _push2(``); + } + if (unref(site).appearance && unref(site).appearance !== "force-dark" && unref(site).appearance !== "force-auto") { + _push2(`

    ${ssrInterpolate(unref(theme2).darkModeSwitchLabel || "Appearance")}

    `); + _push2(ssrRenderComponent(VPSwitchAppearance, null, null, _parent2, _scopeId)); + _push2(`
    `); + } else { + _push2(``); + } + if (unref(theme2).socialLinks) { + _push2(`
    `); + } else { + _push2(``); + } + } else { + return [ + unref(localeLinks).length && unref(currentLang).label ? (openBlock(), createBlock("div", { + key: 0, + class: "group translations" + }, [ + createVNode("p", { class: "trans-title" }, toDisplayString(unref(currentLang).label), 1), + (openBlock(true), createBlock(Fragment, null, renderList(unref(localeLinks), (locale) => { + return openBlock(), createBlock(VPMenuLink, { + key: locale.link, + item: locale + }, null, 8, ["item"]); + }), 128)) + ])) : createCommentVNode("", true), + unref(site).appearance && unref(site).appearance !== "force-dark" && unref(site).appearance !== "force-auto" ? (openBlock(), createBlock("div", { + key: 1, + class: "group" + }, [ + createVNode("div", { class: "item appearance" }, [ + createVNode("p", { class: "label" }, toDisplayString(unref(theme2).darkModeSwitchLabel || "Appearance"), 1), + createVNode("div", { class: "appearance-action" }, [ + createVNode(VPSwitchAppearance) + ]) + ]) + ])) : createCommentVNode("", true), + unref(theme2).socialLinks ? (openBlock(), createBlock("div", { + key: 2, + class: "group" + }, [ + createVNode("div", { class: "item social-links" }, [ + createVNode(VPSocialLinks, { + class: "social-links-list", + links: unref(theme2).socialLinks + }, null, 8, ["links"]) + ]) + ])) : createCommentVNode("", true) + ]; + } + }), + _: 1 + }, _parent)); + } else { + _push(``); + } + }; + } +}); +const _sfc_setup$y = _sfc_main$y.setup; +_sfc_main$y.setup = (props, ctx) => { + const ssrContext = useSSRContext(); + (ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("../node_modules/vitepress/dist/client/theme-default/components/VPNavBarExtra.vue"); + return _sfc_setup$y ? _sfc_setup$y(props, ctx) : void 0; +}; +const VPNavBarExtra = /* @__PURE__ */ _export_sfc(_sfc_main$y, [["__scopeId", "data-v-bb2aa2f0"]]); +const _sfc_main$x = /* @__PURE__ */ defineComponent({ + __name: "VPNavBarHamburger", + __ssrInlineRender: true, + props: { + active: { type: Boolean } + }, + emits: ["click"], + setup(__props) { + return (_ctx, _push, _parent, _attrs) => { + _push(``); + }; + } +}); +const _sfc_setup$x = _sfc_main$x.setup; +_sfc_main$x.setup = (props, ctx) => { + const ssrContext = useSSRContext(); + (ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("../node_modules/vitepress/dist/client/theme-default/components/VPNavBarHamburger.vue"); + return _sfc_setup$x ? _sfc_setup$x(props, ctx) : void 0; +}; +const VPNavBarHamburger = /* @__PURE__ */ _export_sfc(_sfc_main$x, [["__scopeId", "data-v-e5dd9c1c"]]); +const _sfc_main$w = /* @__PURE__ */ defineComponent({ + __name: "VPNavBarMenuLink", + __ssrInlineRender: true, + props: { + item: {} + }, + setup(__props) { + const { page } = useData(); + return (_ctx, _push, _parent, _attrs) => { + _push(ssrRenderComponent(_sfc_main$Z, mergeProps({ + class: { + VPNavBarMenuLink: true, + active: unref(isActive)( + unref(page).relativePath, + __props.item.activeMatch || __props.item.link, + !!__props.item.activeMatch + ) + }, + href: __props.item.link, + target: __props.item.target, + rel: __props.item.rel, + "no-icon": __props.item.noIcon, + tabindex: "0" + }, _attrs), { + default: withCtx((_, _push2, _parent2, _scopeId) => { + if (_push2) { + _push2(`${__props.item.text ?? ""}`); + } else { + return [ + createVNode("span", { + innerHTML: __props.item.text + }, null, 8, ["innerHTML"]) + ]; + } + }), + _: 1 + }, _parent)); + }; + } +}); +const _sfc_setup$w = _sfc_main$w.setup; +_sfc_main$w.setup = (props, ctx) => { + const ssrContext = useSSRContext(); + (ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("../node_modules/vitepress/dist/client/theme-default/components/VPNavBarMenuLink.vue"); + return _sfc_setup$w ? _sfc_setup$w(props, ctx) : void 0; +}; +const VPNavBarMenuLink = /* @__PURE__ */ _export_sfc(_sfc_main$w, [["__scopeId", "data-v-e56f3d57"]]); +const _sfc_main$v = /* @__PURE__ */ defineComponent({ + __name: "VPNavBarMenuGroup", + __ssrInlineRender: true, + props: { + item: {} + }, + setup(__props) { + const props = __props; + const { page } = useData(); + const isChildActive = (navItem) => { + if ("component" in navItem) return false; + if ("link" in navItem) { + return isActive( + page.value.relativePath, + navItem.link, + !!props.item.activeMatch + ); + } + return navItem.items.some(isChildActive); + }; + const childrenActive = computed(() => isChildActive(props.item)); + return (_ctx, _push, _parent, _attrs) => { + _push(ssrRenderComponent(VPFlyout, mergeProps({ + class: { + VPNavBarMenuGroup: true, + active: unref(isActive)(unref(page).relativePath, __props.item.activeMatch, !!__props.item.activeMatch) || childrenActive.value + }, + button: __props.item.text, + items: __props.item.items + }, _attrs), null, _parent)); + }; + } +}); +const _sfc_setup$v = _sfc_main$v.setup; +_sfc_main$v.setup = (props, ctx) => { + const ssrContext = useSSRContext(); + (ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("../node_modules/vitepress/dist/client/theme-default/components/VPNavBarMenuGroup.vue"); + return _sfc_setup$v ? _sfc_setup$v(props, ctx) : void 0; +}; +const _sfc_main$u = /* @__PURE__ */ defineComponent({ + __name: "VPNavBarMenu", + __ssrInlineRender: true, + setup(__props) { + const { theme: theme2 } = useData(); + return (_ctx, _push, _parent, _attrs) => { + if (unref(theme2).nav) { + _push(` Main Navigation `); + ssrRenderList(unref(theme2).nav, (item) => { + _push(``); + if ("link" in item) { + _push(ssrRenderComponent(VPNavBarMenuLink, { item }, null, _parent)); + } else if ("component" in item) { + ssrRenderVNode(_push, createVNode(resolveDynamicComponent(item.component), mergeProps({ ref_for: true }, item.props), null), _parent); + } else { + _push(ssrRenderComponent(_sfc_main$v, { item }, null, _parent)); + } + _push(``); + }); + _push(``); + } else { + _push(``); + } + }; + } +}); +const _sfc_setup$u = _sfc_main$u.setup; +_sfc_main$u.setup = (props, ctx) => { + const ssrContext = useSSRContext(); + (ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("../node_modules/vitepress/dist/client/theme-default/components/VPNavBarMenu.vue"); + return _sfc_setup$u ? _sfc_setup$u(props, ctx) : void 0; +}; +const VPNavBarMenu = /* @__PURE__ */ _export_sfc(_sfc_main$u, [["__scopeId", "data-v-dc692963"]]); +function createSearchTranslate(defaultTranslations) { + const { localeIndex, theme: theme2 } = useData(); + function translate(key) { + var _a, _b, _c; + const keyPath = key.split("."); + const themeObject = (_a = theme2.value.search) == null ? void 0 : _a.options; + const isObject = themeObject && typeof themeObject === "object"; + const locales = isObject && ((_c = (_b = themeObject.locales) == null ? void 0 : _b[localeIndex.value]) == null ? void 0 : _c.translations) || null; + const translations = isObject && themeObject.translations || null; + let localeResult = locales; + let translationResult = translations; + let defaultResult = defaultTranslations; + const lastKey = keyPath.pop(); + for (const k of keyPath) { + let fallbackResult = null; + const foundInFallback = defaultResult == null ? void 0 : defaultResult[k]; + if (foundInFallback) { + fallbackResult = defaultResult = foundInFallback; + } + const foundInTranslation = translationResult == null ? void 0 : translationResult[k]; + if (foundInTranslation) { + fallbackResult = translationResult = foundInTranslation; + } + const foundInLocale = localeResult == null ? void 0 : localeResult[k]; + if (foundInLocale) { + fallbackResult = localeResult = foundInLocale; + } + if (!foundInFallback) { + defaultResult = fallbackResult; + } + if (!foundInTranslation) { + translationResult = fallbackResult; + } + if (!foundInLocale) { + localeResult = fallbackResult; + } + } + return (localeResult == null ? void 0 : localeResult[lastKey]) ?? (translationResult == null ? void 0 : translationResult[lastKey]) ?? (defaultResult == null ? void 0 : defaultResult[lastKey]) ?? ""; + } + return translate; +} +const _sfc_main$t = /* @__PURE__ */ defineComponent({ + __name: "VPNavBarSearchButton", + __ssrInlineRender: true, + setup(__props) { + const defaultTranslations = { + button: { + buttonText: "Search", + buttonAriaLabel: "Search" + } + }; + const translate = createSearchTranslate(defaultTranslations); + return (_ctx, _push, _parent, _attrs) => { + _push(`${ssrInterpolate(unref(translate)("button.buttonText"))}K`); + }; + } +}); +const _sfc_setup$t = _sfc_main$t.setup; +_sfc_main$t.setup = (props, ctx) => { + const ssrContext = useSSRContext(); + (ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("../node_modules/vitepress/dist/client/theme-default/components/VPNavBarSearchButton.vue"); + return _sfc_setup$t ? _sfc_setup$t(props, ctx) : void 0; +}; +const _sfc_main$s = /* @__PURE__ */ defineComponent({ + __name: "VPNavBarSearch", + __ssrInlineRender: true, + setup(__props) { + const VPLocalSearchBox = defineAsyncComponent(() => import("./VPLocalSearchBox.BcKWVt-i.js")); + const VPAlgoliaSearchBox = () => null; + const { theme: theme2 } = useData(); + const loaded = ref(false); + const actuallyLoaded = ref(false); + onMounted(() => { + { + return; + } + }); + function load() { + if (!loaded.value) { + loaded.value = true; + setTimeout(poll, 16); + } + } + function poll() { + const e = new Event("keydown"); + e.key = "k"; + e.metaKey = true; + window.dispatchEvent(e); + setTimeout(() => { + if (!document.querySelector(".DocSearch-Modal")) { + poll(); + } + }, 16); + } + function isEditingContent(event) { + const element = event.target; + const tagName = element.tagName; + return element.isContentEditable || tagName === "INPUT" || tagName === "SELECT" || tagName === "TEXTAREA"; + } + const showSearch = ref(false); + { + onKeyStroke("k", (event) => { + if (event.ctrlKey || event.metaKey) { + event.preventDefault(); + showSearch.value = true; + } + }); + onKeyStroke("/", (event) => { + if (!isEditingContent(event)) { + event.preventDefault(); + showSearch.value = true; + } + }); + } + const provider = "local"; + return (_ctx, _push, _parent, _attrs) => { + var _a; + _push(``); + if (unref(provider) === "local") { + _push(``); + if (showSearch.value) { + _push(ssrRenderComponent(unref(VPLocalSearchBox), { + onClose: ($event) => showSearch.value = false + }, null, _parent)); + } else { + _push(``); + } + _push(``); + } else if (unref(provider) === "algolia") { + _push(``); + if (loaded.value) { + _push(ssrRenderComponent(unref(VPAlgoliaSearchBox), { + algolia: ((_a = unref(theme2).search) == null ? void 0 : _a.options) ?? unref(theme2).algolia, + onVnodeBeforeMount: ($event) => actuallyLoaded.value = true + }, null, _parent)); + } else { + _push(``); + } + if (!actuallyLoaded.value) { + _push(`
    `); + _push(ssrRenderComponent(_sfc_main$t, { onClick: load }, null, _parent)); + _push(`
    `); + } else { + _push(``); + } + _push(``); + } else { + _push(``); + } + _push(``); + }; + } +}); +const _sfc_setup$s = _sfc_main$s.setup; +_sfc_main$s.setup = (props, ctx) => { + const ssrContext = useSSRContext(); + (ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("../node_modules/vitepress/dist/client/theme-default/components/VPNavBarSearch.vue"); + return _sfc_setup$s ? _sfc_setup$s(props, ctx) : void 0; +}; +const _sfc_main$r = /* @__PURE__ */ defineComponent({ + __name: "VPNavBarSocialLinks", + __ssrInlineRender: true, + setup(__props) { + const { theme: theme2 } = useData(); + return (_ctx, _push, _parent, _attrs) => { + if (unref(theme2).socialLinks) { + _push(ssrRenderComponent(VPSocialLinks, mergeProps({ + class: "VPNavBarSocialLinks", + links: unref(theme2).socialLinks + }, _attrs), null, _parent)); + } else { + _push(``); + } + }; + } +}); +const _sfc_setup$r = _sfc_main$r.setup; +_sfc_main$r.setup = (props, ctx) => { + const ssrContext = useSSRContext(); + (ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("../node_modules/vitepress/dist/client/theme-default/components/VPNavBarSocialLinks.vue"); + return _sfc_setup$r ? _sfc_setup$r(props, ctx) : void 0; +}; +const VPNavBarSocialLinks = /* @__PURE__ */ _export_sfc(_sfc_main$r, [["__scopeId", "data-v-0394ad82"]]); +const _sfc_main$q = /* @__PURE__ */ defineComponent({ + __name: "VPNavBarTitle", + __ssrInlineRender: true, + setup(__props) { + const { site, theme: theme2 } = useData(); + const { hasSidebar } = useSidebar(); + const { currentLang } = useLangs(); + const link2 = computed( + () => { + var _a; + return typeof theme2.value.logoLink === "string" ? theme2.value.logoLink : (_a = theme2.value.logoLink) == null ? void 0 : _a.link; + } + ); + const rel = computed( + () => { + var _a; + return typeof theme2.value.logoLink === "string" ? void 0 : (_a = theme2.value.logoLink) == null ? void 0 : _a.rel; + } + ); + const target = computed( + () => { + var _a; + return typeof theme2.value.logoLink === "string" ? void 0 : (_a = theme2.value.logoLink) == null ? void 0 : _a.target; + } + ); + return (_ctx, _push, _parent, _attrs) => { + _push(``); + ssrRenderSlot(_ctx.$slots, "nav-bar-title-before", {}, null, _push, _parent); + if (unref(theme2).logo) { + _push(ssrRenderComponent(VPImage, { + class: "logo", + image: unref(theme2).logo + }, null, _parent)); + } else { + _push(``); + } + if (unref(theme2).siteTitle) { + _push(`${unref(theme2).siteTitle ?? ""}`); + } else if (unref(theme2).siteTitle === void 0) { + _push(`${ssrInterpolate(unref(site).title)}`); + } else { + _push(``); + } + ssrRenderSlot(_ctx.$slots, "nav-bar-title-after", {}, null, _push, _parent); + _push(``); + }; + } +}); +const _sfc_setup$q = _sfc_main$q.setup; +_sfc_main$q.setup = (props, ctx) => { + const ssrContext = useSSRContext(); + (ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("../node_modules/vitepress/dist/client/theme-default/components/VPNavBarTitle.vue"); + return _sfc_setup$q ? _sfc_setup$q(props, ctx) : void 0; +}; +const VPNavBarTitle = /* @__PURE__ */ _export_sfc(_sfc_main$q, [["__scopeId", "data-v-1168a8e4"]]); +const _sfc_main$p = /* @__PURE__ */ defineComponent({ + __name: "VPNavBarTranslations", + __ssrInlineRender: true, + setup(__props) { + const { theme: theme2 } = useData(); + const { localeLinks, currentLang } = useLangs({ correspondingLink: true }); + return (_ctx, _push, _parent, _attrs) => { + if (unref(localeLinks).length && unref(currentLang).label) { + _push(ssrRenderComponent(VPFlyout, mergeProps({ + class: "VPNavBarTranslations", + icon: "vpi-languages", + label: unref(theme2).langMenuLabel || "Change language" + }, _attrs), { + default: withCtx((_, _push2, _parent2, _scopeId) => { + if (_push2) { + _push2(`

    ${ssrInterpolate(unref(currentLang).label)}

    `); + ssrRenderList(unref(localeLinks), (locale) => { + _push2(ssrRenderComponent(VPMenuLink, { item: locale }, null, _parent2, _scopeId)); + }); + _push2(`
    `); + } else { + return [ + createVNode("div", { class: "items" }, [ + createVNode("p", { class: "title" }, toDisplayString(unref(currentLang).label), 1), + (openBlock(true), createBlock(Fragment, null, renderList(unref(localeLinks), (locale) => { + return openBlock(), createBlock(VPMenuLink, { + key: locale.link, + item: locale + }, null, 8, ["item"]); + }), 128)) + ]) + ]; + } + }), + _: 1 + }, _parent)); + } else { + _push(``); + } + }; + } +}); +const _sfc_setup$p = _sfc_main$p.setup; +_sfc_main$p.setup = (props, ctx) => { + const ssrContext = useSSRContext(); + (ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("../node_modules/vitepress/dist/client/theme-default/components/VPNavBarTranslations.vue"); + return _sfc_setup$p ? _sfc_setup$p(props, ctx) : void 0; +}; +const VPNavBarTranslations = /* @__PURE__ */ _export_sfc(_sfc_main$p, [["__scopeId", "data-v-88af2de4"]]); +const _sfc_main$o = /* @__PURE__ */ defineComponent({ + __name: "VPNavBar", + __ssrInlineRender: true, + props: { + isScreenOpen: { type: Boolean } + }, + emits: ["toggle-screen"], + setup(__props) { + const props = __props; + const { y } = useWindowScroll(); + const { hasSidebar } = useSidebar(); + const { frontmatter } = useData(); + const classes = ref({}); + watchPostEffect(() => { + classes.value = { + "has-sidebar": hasSidebar.value, + "home": frontmatter.value.layout === "home", + "top": y.value === 0, + "screen-open": props.isScreenOpen + }; + }); + return (_ctx, _push, _parent, _attrs) => { + _push(`
    `); + _push(ssrRenderComponent(VPNavBarTitle, null, { + "nav-bar-title-before": withCtx((_, _push2, _parent2, _scopeId) => { + if (_push2) { + ssrRenderSlot(_ctx.$slots, "nav-bar-title-before", {}, null, _push2, _parent2, _scopeId); + } else { + return [ + renderSlot(_ctx.$slots, "nav-bar-title-before", {}, void 0, true) + ]; + } + }), + "nav-bar-title-after": withCtx((_, _push2, _parent2, _scopeId) => { + if (_push2) { + ssrRenderSlot(_ctx.$slots, "nav-bar-title-after", {}, null, _push2, _parent2, _scopeId); + } else { + return [ + renderSlot(_ctx.$slots, "nav-bar-title-after", {}, void 0, true) + ]; + } + }), + _: 3 + }, _parent)); + _push(`
    `); + ssrRenderSlot(_ctx.$slots, "nav-bar-content-before", {}, null, _push, _parent); + _push(ssrRenderComponent(_sfc_main$s, { class: "search" }, null, _parent)); + _push(ssrRenderComponent(VPNavBarMenu, { class: "menu" }, null, _parent)); + _push(ssrRenderComponent(VPNavBarTranslations, { class: "translations" }, null, _parent)); + _push(ssrRenderComponent(VPNavBarAppearance, { class: "appearance" }, null, _parent)); + _push(ssrRenderComponent(VPNavBarSocialLinks, { class: "social-links" }, null, _parent)); + _push(ssrRenderComponent(VPNavBarExtra, { class: "extra" }, null, _parent)); + ssrRenderSlot(_ctx.$slots, "nav-bar-content-after", {}, null, _push, _parent); + _push(ssrRenderComponent(VPNavBarHamburger, { + class: "hamburger", + active: __props.isScreenOpen, + onClick: ($event) => _ctx.$emit("toggle-screen") + }, null, _parent)); + _push(`
    `); + }; + } +}); +const _sfc_setup$o = _sfc_main$o.setup; +_sfc_main$o.setup = (props, ctx) => { + const ssrContext = useSSRContext(); + (ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("../node_modules/vitepress/dist/client/theme-default/components/VPNavBar.vue"); + return _sfc_setup$o ? _sfc_setup$o(props, ctx) : void 0; +}; +const VPNavBar = /* @__PURE__ */ _export_sfc(_sfc_main$o, [["__scopeId", "data-v-6aa21345"]]); +const _sfc_main$n = /* @__PURE__ */ defineComponent({ + __name: "VPNavScreenAppearance", + __ssrInlineRender: true, + setup(__props) { + const { site, theme: theme2 } = useData(); + return (_ctx, _push, _parent, _attrs) => { + if (unref(site).appearance && unref(site).appearance !== "force-dark" && unref(site).appearance !== "force-auto") { + _push(`

    ${ssrInterpolate(unref(theme2).darkModeSwitchLabel || "Appearance")}

    `); + _push(ssrRenderComponent(VPSwitchAppearance, null, null, _parent)); + _push(``); + } else { + _push(``); + } + }; + } +}); +const _sfc_setup$n = _sfc_main$n.setup; +_sfc_main$n.setup = (props, ctx) => { + const ssrContext = useSSRContext(); + (ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("../node_modules/vitepress/dist/client/theme-default/components/VPNavScreenAppearance.vue"); + return _sfc_setup$n ? _sfc_setup$n(props, ctx) : void 0; +}; +const VPNavScreenAppearance = /* @__PURE__ */ _export_sfc(_sfc_main$n, [["__scopeId", "data-v-b44890b2"]]); +const _sfc_main$m = /* @__PURE__ */ defineComponent({ + __name: "VPNavScreenMenuLink", + __ssrInlineRender: true, + props: { + item: {} + }, + setup(__props) { + const closeScreen = inject("close-screen"); + return (_ctx, _push, _parent, _attrs) => { + _push(ssrRenderComponent(_sfc_main$Z, mergeProps({ + class: "VPNavScreenMenuLink", + href: __props.item.link, + target: __props.item.target, + rel: __props.item.rel, + "no-icon": __props.item.noIcon, + onClick: unref(closeScreen) + }, _attrs), { + default: withCtx((_, _push2, _parent2, _scopeId) => { + if (_push2) { + _push2(`${__props.item.text ?? ""}`); + } else { + return [ + createVNode("span", { + innerHTML: __props.item.text + }, null, 8, ["innerHTML"]) + ]; + } + }), + _: 1 + }, _parent)); + }; + } +}); +const _sfc_setup$m = _sfc_main$m.setup; +_sfc_main$m.setup = (props, ctx) => { + const ssrContext = useSSRContext(); + (ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("../node_modules/vitepress/dist/client/theme-default/components/VPNavScreenMenuLink.vue"); + return _sfc_setup$m ? _sfc_setup$m(props, ctx) : void 0; +}; +const VPNavScreenMenuLink = /* @__PURE__ */ _export_sfc(_sfc_main$m, [["__scopeId", "data-v-df37e6dd"]]); +const _sfc_main$l = /* @__PURE__ */ defineComponent({ + __name: "VPNavScreenMenuGroupLink", + __ssrInlineRender: true, + props: { + item: {} + }, + setup(__props) { + const closeScreen = inject("close-screen"); + return (_ctx, _push, _parent, _attrs) => { + _push(ssrRenderComponent(_sfc_main$Z, mergeProps({ + class: "VPNavScreenMenuGroupLink", + href: __props.item.link, + target: __props.item.target, + rel: __props.item.rel, + "no-icon": __props.item.noIcon, + onClick: unref(closeScreen) + }, _attrs), { + default: withCtx((_, _push2, _parent2, _scopeId) => { + if (_push2) { + _push2(`${__props.item.text ?? ""}`); + } else { + return [ + createVNode("span", { + innerHTML: __props.item.text + }, null, 8, ["innerHTML"]) + ]; + } + }), + _: 1 + }, _parent)); + }; + } +}); +const _sfc_setup$l = _sfc_main$l.setup; +_sfc_main$l.setup = (props, ctx) => { + const ssrContext = useSSRContext(); + (ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("../node_modules/vitepress/dist/client/theme-default/components/VPNavScreenMenuGroupLink.vue"); + return _sfc_setup$l ? _sfc_setup$l(props, ctx) : void 0; +}; +const VPNavScreenMenuGroupLink = /* @__PURE__ */ _export_sfc(_sfc_main$l, [["__scopeId", "data-v-3e9c20e4"]]); +const _sfc_main$k = /* @__PURE__ */ defineComponent({ + __name: "VPNavScreenMenuGroupSection", + __ssrInlineRender: true, + props: { + text: {}, + items: {} + }, + setup(__props) { + return (_ctx, _push, _parent, _attrs) => { + _push(``); + if (__props.text) { + _push(`

    ${ssrInterpolate(__props.text)}

    `); + } else { + _push(``); + } + _push(``); + ssrRenderList(__props.items, (item) => { + _push(ssrRenderComponent(VPNavScreenMenuGroupLink, { + key: item.text, + item + }, null, _parent)); + }); + _push(``); + }; + } +}); +const _sfc_setup$k = _sfc_main$k.setup; +_sfc_main$k.setup = (props, ctx) => { + const ssrContext = useSSRContext(); + (ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("../node_modules/vitepress/dist/client/theme-default/components/VPNavScreenMenuGroupSection.vue"); + return _sfc_setup$k ? _sfc_setup$k(props, ctx) : void 0; +}; +const VPNavScreenMenuGroupSection = /* @__PURE__ */ _export_sfc(_sfc_main$k, [["__scopeId", "data-v-8133b170"]]); +const _sfc_main$j = /* @__PURE__ */ defineComponent({ + __name: "VPNavScreenMenuGroup", + __ssrInlineRender: true, + props: { + text: {}, + items: {} + }, + setup(__props) { + const props = __props; + const isOpen = ref(false); + const groupId = computed( + () => `NavScreenGroup-${props.text.replace(" ", "-").toLowerCase()}` + ); + return (_ctx, _push, _parent, _attrs) => { + _push(``); + ssrRenderList(__props.items, (item) => { + _push(``); + if ("link" in item) { + _push(`
    `); + _push(ssrRenderComponent(VPNavScreenMenuGroupLink, { item }, null, _parent)); + _push(`
    `); + } else if ("component" in item) { + _push(`
    `); + ssrRenderVNode(_push, createVNode(resolveDynamicComponent(item.component), mergeProps({ ref_for: true }, item.props, { "screen-menu": "" }), null), _parent); + _push(`
    `); + } else { + _push(`
    `); + _push(ssrRenderComponent(VPNavScreenMenuGroupSection, { + text: item.text, + items: item.items + }, null, _parent)); + _push(`
    `); + } + _push(``); + }); + _push(``); + }; + } +}); +const _sfc_setup$j = _sfc_main$j.setup; +_sfc_main$j.setup = (props, ctx) => { + const ssrContext = useSSRContext(); + (ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("../node_modules/vitepress/dist/client/theme-default/components/VPNavScreenMenuGroup.vue"); + return _sfc_setup$j ? _sfc_setup$j(props, ctx) : void 0; +}; +const VPNavScreenMenuGroup = /* @__PURE__ */ _export_sfc(_sfc_main$j, [["__scopeId", "data-v-b9ab8c58"]]); +const _sfc_main$i = /* @__PURE__ */ defineComponent({ + __name: "VPNavScreenMenu", + __ssrInlineRender: true, + setup(__props) { + const { theme: theme2 } = useData(); + return (_ctx, _push, _parent, _attrs) => { + if (unref(theme2).nav) { + _push(``); + ssrRenderList(unref(theme2).nav, (item) => { + _push(``); + if ("link" in item) { + _push(ssrRenderComponent(VPNavScreenMenuLink, { item }, null, _parent)); + } else if ("component" in item) { + ssrRenderVNode(_push, createVNode(resolveDynamicComponent(item.component), mergeProps({ ref_for: true }, item.props, { "screen-menu": "" }), null), _parent); + } else { + _push(ssrRenderComponent(VPNavScreenMenuGroup, { + text: item.text || "", + items: item.items + }, null, _parent)); + } + _push(``); + }); + _push(``); + } else { + _push(``); + } + }; + } +}); +const _sfc_setup$i = _sfc_main$i.setup; +_sfc_main$i.setup = (props, ctx) => { + const ssrContext = useSSRContext(); + (ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("../node_modules/vitepress/dist/client/theme-default/components/VPNavScreenMenu.vue"); + return _sfc_setup$i ? _sfc_setup$i(props, ctx) : void 0; +}; +const _sfc_main$h = /* @__PURE__ */ defineComponent({ + __name: "VPNavScreenSocialLinks", + __ssrInlineRender: true, + setup(__props) { + const { theme: theme2 } = useData(); + return (_ctx, _push, _parent, _attrs) => { + if (unref(theme2).socialLinks) { + _push(ssrRenderComponent(VPSocialLinks, mergeProps({ + class: "VPNavScreenSocialLinks", + links: unref(theme2).socialLinks + }, _attrs), null, _parent)); + } else { + _push(``); + } + }; + } +}); +const _sfc_setup$h = _sfc_main$h.setup; +_sfc_main$h.setup = (props, ctx) => { + const ssrContext = useSSRContext(); + (ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("../node_modules/vitepress/dist/client/theme-default/components/VPNavScreenSocialLinks.vue"); + return _sfc_setup$h ? _sfc_setup$h(props, ctx) : void 0; +}; +const _sfc_main$g = /* @__PURE__ */ defineComponent({ + __name: "VPNavScreenTranslations", + __ssrInlineRender: true, + setup(__props) { + const { localeLinks, currentLang } = useLangs({ correspondingLink: true }); + const isOpen = ref(false); + return (_ctx, _push, _parent, _attrs) => { + if (unref(localeLinks).length && unref(currentLang).label) { + _push(`
      `); + ssrRenderList(unref(localeLinks), (locale) => { + _push(`
    • `); + _push(ssrRenderComponent(_sfc_main$Z, { + class: "link", + href: locale.link + }, { + default: withCtx((_, _push2, _parent2, _scopeId) => { + if (_push2) { + _push2(`${ssrInterpolate(locale.text)}`); + } else { + return [ + createTextVNode(toDisplayString(locale.text), 1) + ]; + } + }), + _: 2 + }, _parent)); + _push(`
    • `); + }); + _push(`
    `); + } else { + _push(``); + } + }; + } +}); +const _sfc_setup$g = _sfc_main$g.setup; +_sfc_main$g.setup = (props, ctx) => { + const ssrContext = useSSRContext(); + (ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("../node_modules/vitepress/dist/client/theme-default/components/VPNavScreenTranslations.vue"); + return _sfc_setup$g ? _sfc_setup$g(props, ctx) : void 0; +}; +const VPNavScreenTranslations = /* @__PURE__ */ _export_sfc(_sfc_main$g, [["__scopeId", "data-v-858fe1a4"]]); +const _sfc_main$f = /* @__PURE__ */ defineComponent({ + __name: "VPNavScreen", + __ssrInlineRender: true, + props: { + open: { type: Boolean } + }, + setup(__props) { + const screen = ref(null); + useScrollLock(inBrowser ? document.body : null); + return (_ctx, _push, _parent, _attrs) => { + if (__props.open) { + _push(`
    `); + ssrRenderSlot(_ctx.$slots, "nav-screen-content-before", {}, null, _push, _parent); + _push(ssrRenderComponent(_sfc_main$i, { class: "menu" }, null, _parent)); + _push(ssrRenderComponent(VPNavScreenTranslations, { class: "translations" }, null, _parent)); + _push(ssrRenderComponent(VPNavScreenAppearance, { class: "appearance" }, null, _parent)); + _push(ssrRenderComponent(_sfc_main$h, { class: "social-links" }, null, _parent)); + ssrRenderSlot(_ctx.$slots, "nav-screen-content-after", {}, null, _push, _parent); + _push(`
    `); + } else { + _push(``); + } + }; + } +}); +const _sfc_setup$f = _sfc_main$f.setup; +_sfc_main$f.setup = (props, ctx) => { + const ssrContext = useSSRContext(); + (ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("../node_modules/vitepress/dist/client/theme-default/components/VPNavScreen.vue"); + return _sfc_setup$f ? _sfc_setup$f(props, ctx) : void 0; +}; +const VPNavScreen = /* @__PURE__ */ _export_sfc(_sfc_main$f, [["__scopeId", "data-v-f2779853"]]); +const _sfc_main$e = /* @__PURE__ */ defineComponent({ + __name: "VPNav", + __ssrInlineRender: true, + setup(__props) { + const { isScreenOpen, closeScreen, toggleScreen } = useNav(); + const { frontmatter } = useData(); + const hasNavbar = computed(() => { + return frontmatter.value.navbar !== false; + }); + provide("close-screen", closeScreen); + watchEffect(() => { + if (inBrowser) { + document.documentElement.classList.toggle("hide-nav", !hasNavbar.value); + } + }); + return (_ctx, _push, _parent, _attrs) => { + if (hasNavbar.value) { + _push(``); + _push(ssrRenderComponent(VPNavBar, { + "is-screen-open": unref(isScreenOpen), + onToggleScreen: unref(toggleScreen) + }, { + "nav-bar-title-before": withCtx((_, _push2, _parent2, _scopeId) => { + if (_push2) { + ssrRenderSlot(_ctx.$slots, "nav-bar-title-before", {}, null, _push2, _parent2, _scopeId); + } else { + return [ + renderSlot(_ctx.$slots, "nav-bar-title-before", {}, void 0, true) + ]; + } + }), + "nav-bar-title-after": withCtx((_, _push2, _parent2, _scopeId) => { + if (_push2) { + ssrRenderSlot(_ctx.$slots, "nav-bar-title-after", {}, null, _push2, _parent2, _scopeId); + } else { + return [ + renderSlot(_ctx.$slots, "nav-bar-title-after", {}, void 0, true) + ]; + } + }), + "nav-bar-content-before": withCtx((_, _push2, _parent2, _scopeId) => { + if (_push2) { + ssrRenderSlot(_ctx.$slots, "nav-bar-content-before", {}, null, _push2, _parent2, _scopeId); + } else { + return [ + renderSlot(_ctx.$slots, "nav-bar-content-before", {}, void 0, true) + ]; + } + }), + "nav-bar-content-after": withCtx((_, _push2, _parent2, _scopeId) => { + if (_push2) { + ssrRenderSlot(_ctx.$slots, "nav-bar-content-after", {}, null, _push2, _parent2, _scopeId); + } else { + return [ + renderSlot(_ctx.$slots, "nav-bar-content-after", {}, void 0, true) + ]; + } + }), + _: 3 + }, _parent)); + _push(ssrRenderComponent(VPNavScreen, { open: unref(isScreenOpen) }, { + "nav-screen-content-before": withCtx((_, _push2, _parent2, _scopeId) => { + if (_push2) { + ssrRenderSlot(_ctx.$slots, "nav-screen-content-before", {}, null, _push2, _parent2, _scopeId); + } else { + return [ + renderSlot(_ctx.$slots, "nav-screen-content-before", {}, void 0, true) + ]; + } + }), + "nav-screen-content-after": withCtx((_, _push2, _parent2, _scopeId) => { + if (_push2) { + ssrRenderSlot(_ctx.$slots, "nav-screen-content-after", {}, null, _push2, _parent2, _scopeId); + } else { + return [ + renderSlot(_ctx.$slots, "nav-screen-content-after", {}, void 0, true) + ]; + } + }), + _: 3 + }, _parent)); + _push(``); + } else { + _push(``); + } + }; + } +}); +const _sfc_setup$e = _sfc_main$e.setup; +_sfc_main$e.setup = (props, ctx) => { + const ssrContext = useSSRContext(); + (ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("../node_modules/vitepress/dist/client/theme-default/components/VPNav.vue"); + return _sfc_setup$e ? _sfc_setup$e(props, ctx) : void 0; +}; +const VPNav = /* @__PURE__ */ _export_sfc(_sfc_main$e, [["__scopeId", "data-v-ae24b3ad"]]); +const _sfc_main$d = /* @__PURE__ */ defineComponent({ + __name: "VPSidebarItem", + __ssrInlineRender: true, + props: { + item: {}, + depth: {} + }, + setup(__props) { + const props = __props; + const { + collapsed, + collapsible, + isLink, + isActiveLink, + hasActiveLink: hasActiveLink2, + hasChildren, + toggle + } = useSidebarControl(computed(() => props.item)); + const sectionTag = computed(() => hasChildren.value ? "section" : `div`); + const linkTag = computed(() => isLink.value ? "a" : "div"); + const textTag = computed(() => { + return !hasChildren.value ? "p" : props.depth + 2 === 7 ? "p" : `h${props.depth + 2}`; + }); + const itemRole = computed(() => isLink.value ? void 0 : "button"); + const classes = computed(() => [ + [`level-${props.depth}`], + { collapsible: collapsible.value }, + { collapsed: collapsed.value }, + { "is-link": isLink.value }, + { "is-active": isActiveLink.value }, + { "has-active": hasActiveLink2.value } + ]); + function onItemInteraction(e) { + if ("key" in e && e.key !== "Enter") { + return; + } + !props.item.link && toggle(); + } + function onCaretClick() { + props.item.link && toggle(); + } + return (_ctx, _push, _parent, _attrs) => { + const _component_VPSidebarItem = resolveComponent("VPSidebarItem", true); + ssrRenderVNode(_push, createVNode(resolveDynamicComponent(sectionTag.value), mergeProps({ + class: ["VPSidebarItem", classes.value] + }, _attrs), { + default: withCtx((_, _push2, _parent2, _scopeId) => { + if (_push2) { + if (__props.item.text) { + _push2(`
    `); + if (__props.item.link) { + _push2(ssrRenderComponent(_sfc_main$Z, { + tag: linkTag.value, + class: "link", + href: __props.item.link, + rel: __props.item.rel, + target: __props.item.target + }, { + default: withCtx((_2, _push3, _parent3, _scopeId2) => { + if (_push3) { + ssrRenderVNode(_push3, createVNode(resolveDynamicComponent(textTag.value), { class: "text" }, null), _parent3, _scopeId2); + } else { + return [ + (openBlock(), createBlock(resolveDynamicComponent(textTag.value), { + class: "text", + innerHTML: __props.item.text + }, null, 8, ["innerHTML"])) + ]; + } + }), + _: 1 + }, _parent2, _scopeId)); + } else { + ssrRenderVNode(_push2, createVNode(resolveDynamicComponent(textTag.value), { class: "text" }, null), _parent2, _scopeId); + } + if (__props.item.collapsed != null && __props.item.items && __props.item.items.length) { + _push2(`
    `); + } else { + _push2(``); + } + _push2(`
    `); + } else { + _push2(``); + } + if (__props.item.items && __props.item.items.length) { + _push2(`
    `); + if (__props.depth < 5) { + _push2(``); + ssrRenderList(__props.item.items, (i) => { + _push2(ssrRenderComponent(_component_VPSidebarItem, { + key: i.text, + item: i, + depth: __props.depth + 1 + }, null, _parent2, _scopeId)); + }); + _push2(``); + } else { + _push2(``); + } + _push2(`
    `); + } else { + _push2(``); + } + } else { + return [ + __props.item.text ? (openBlock(), createBlock("div", mergeProps({ + key: 0, + class: "item", + role: itemRole.value + }, toHandlers( + __props.item.items ? { click: onItemInteraction, keydown: onItemInteraction } : {}, + true + ), { + tabindex: __props.item.items && 0 + }), [ + createVNode("div", { class: "indicator" }), + __props.item.link ? (openBlock(), createBlock(_sfc_main$Z, { + key: 0, + tag: linkTag.value, + class: "link", + href: __props.item.link, + rel: __props.item.rel, + target: __props.item.target + }, { + default: withCtx(() => [ + (openBlock(), createBlock(resolveDynamicComponent(textTag.value), { + class: "text", + innerHTML: __props.item.text + }, null, 8, ["innerHTML"])) + ]), + _: 1 + }, 8, ["tag", "href", "rel", "target"])) : (openBlock(), createBlock(resolveDynamicComponent(textTag.value), { + key: 1, + class: "text", + innerHTML: __props.item.text + }, null, 8, ["innerHTML"])), + __props.item.collapsed != null && __props.item.items && __props.item.items.length ? (openBlock(), createBlock("div", { + key: 2, + class: "caret", + role: "button", + "aria-label": "toggle section", + onClick: onCaretClick, + onKeydown: withKeys(onCaretClick, ["enter"]), + tabindex: "0" + }, [ + createVNode("span", { class: "vpi-chevron-right caret-icon" }) + ], 32)) : createCommentVNode("", true) + ], 16, ["role", "tabindex"])) : createCommentVNode("", true), + __props.item.items && __props.item.items.length ? (openBlock(), createBlock("div", { + key: 1, + class: "items" + }, [ + __props.depth < 5 ? (openBlock(true), createBlock(Fragment, { key: 0 }, renderList(__props.item.items, (i) => { + return openBlock(), createBlock(_component_VPSidebarItem, { + key: i.text, + item: i, + depth: __props.depth + 1 + }, null, 8, ["item", "depth"]); + }), 128)) : createCommentVNode("", true) + ])) : createCommentVNode("", true) + ]; + } + }), + _: 1 + }), _parent); + }; + } +}); +const _sfc_setup$d = _sfc_main$d.setup; +_sfc_main$d.setup = (props, ctx) => { + const ssrContext = useSSRContext(); + (ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("../node_modules/vitepress/dist/client/theme-default/components/VPSidebarItem.vue"); + return _sfc_setup$d ? _sfc_setup$d(props, ctx) : void 0; +}; +const VPSidebarItem = /* @__PURE__ */ _export_sfc(_sfc_main$d, [["__scopeId", "data-v-b3fd67f8"]]); +const _sfc_main$c = /* @__PURE__ */ defineComponent({ + __name: "VPSidebarGroup", + __ssrInlineRender: true, + props: { + items: {} + }, + setup(__props) { + const disableTransition = ref(true); + let timer = null; + onMounted(() => { + timer = setTimeout(() => { + timer = null; + disableTransition.value = false; + }, 300); + }); + onBeforeUnmount(() => { + if (timer != null) { + clearTimeout(timer); + timer = null; + } + }); + return (_ctx, _push, _parent, _attrs) => { + _push(``); + ssrRenderList(__props.items, (item) => { + _push(`
    `); + _push(ssrRenderComponent(VPSidebarItem, { + item, + depth: 0 + }, null, _parent)); + _push(`
    `); + }); + _push(``); + }; + } +}); +const _sfc_setup$c = _sfc_main$c.setup; +_sfc_main$c.setup = (props, ctx) => { + const ssrContext = useSSRContext(); + (ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("../node_modules/vitepress/dist/client/theme-default/components/VPSidebarGroup.vue"); + return _sfc_setup$c ? _sfc_setup$c(props, ctx) : void 0; +}; +const VPSidebarGroup = /* @__PURE__ */ _export_sfc(_sfc_main$c, [["__scopeId", "data-v-c40bc020"]]); +const _sfc_main$b = /* @__PURE__ */ defineComponent({ + __name: "VPSidebar", + __ssrInlineRender: true, + props: { + open: { type: Boolean } + }, + setup(__props) { + const { sidebarGroups, hasSidebar } = useSidebar(); + const props = __props; + const navEl = ref(null); + const isLocked = useScrollLock(inBrowser ? document.body : null); + watch( + [props, navEl], + () => { + var _a; + if (props.open) { + isLocked.value = true; + (_a = navEl.value) == null ? void 0 : _a.focus(); + } else isLocked.value = false; + }, + { immediate: true, flush: "post" } + ); + const key = ref(0); + watch( + sidebarGroups, + () => { + key.value += 1; + }, + { deep: true } + ); + return (_ctx, _push, _parent, _attrs) => { + if (unref(hasSidebar)) { + _push(`
    `); + } else { + _push(``); + } + }; + } +}); +const _sfc_setup$b = _sfc_main$b.setup; +_sfc_main$b.setup = (props, ctx) => { + const ssrContext = useSSRContext(); + (ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("../node_modules/vitepress/dist/client/theme-default/components/VPSidebar.vue"); + return _sfc_setup$b ? _sfc_setup$b(props, ctx) : void 0; +}; +const VPSidebar = /* @__PURE__ */ _export_sfc(_sfc_main$b, [["__scopeId", "data-v-319d5ca6"]]); +const _sfc_main$a = /* @__PURE__ */ defineComponent({ + __name: "VPSkipLink", + __ssrInlineRender: true, + setup(__props) { + const { theme: theme2 } = useData(); + const route = useRoute(); + const backToTop = ref(); + watch(() => route.path, () => backToTop.value.focus()); + return (_ctx, _push, _parent, _attrs) => { + _push(`${ssrInterpolate(unref(theme2).skipToContentLabel || "Skip to content")}`); + }; + } +}); +const _sfc_setup$a = _sfc_main$a.setup; +_sfc_main$a.setup = (props, ctx) => { + const ssrContext = useSSRContext(); + (ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("../node_modules/vitepress/dist/client/theme-default/components/VPSkipLink.vue"); + return _sfc_setup$a ? _sfc_setup$a(props, ctx) : void 0; +}; +const VPSkipLink = /* @__PURE__ */ _export_sfc(_sfc_main$a, [["__scopeId", "data-v-0b0ada53"]]); +const _sfc_main$9 = /* @__PURE__ */ defineComponent({ + __name: "Layout", + __ssrInlineRender: true, + setup(__props) { + const { + isOpen: isSidebarOpen, + open: openSidebar, + close: closeSidebar + } = useSidebar(); + const route = useRoute(); + watch(() => route.path, closeSidebar); + useCloseSidebarOnEscape(isSidebarOpen, closeSidebar); + const { frontmatter } = useData(); + const slots = useSlots(); + const heroImageSlotExists = computed(() => !!slots["home-hero-image"]); + provide("hero-image-slot-exists", heroImageSlotExists); + return (_ctx, _push, _parent, _attrs) => { + const _component_Content = resolveComponent("Content"); + if (unref(frontmatter).layout !== false) { + _push(``); + ssrRenderSlot(_ctx.$slots, "layout-top", {}, null, _push, _parent); + _push(ssrRenderComponent(VPSkipLink, null, null, _parent)); + _push(ssrRenderComponent(VPBackdrop, { + class: "backdrop", + show: unref(isSidebarOpen), + onClick: unref(closeSidebar) + }, null, _parent)); + _push(ssrRenderComponent(VPNav, null, { + "nav-bar-title-before": withCtx((_, _push2, _parent2, _scopeId) => { + if (_push2) { + ssrRenderSlot(_ctx.$slots, "nav-bar-title-before", {}, null, _push2, _parent2, _scopeId); + } else { + return [ + renderSlot(_ctx.$slots, "nav-bar-title-before", {}, void 0, true) + ]; + } + }), + "nav-bar-title-after": withCtx((_, _push2, _parent2, _scopeId) => { + if (_push2) { + ssrRenderSlot(_ctx.$slots, "nav-bar-title-after", {}, null, _push2, _parent2, _scopeId); + } else { + return [ + renderSlot(_ctx.$slots, "nav-bar-title-after", {}, void 0, true) + ]; + } + }), + "nav-bar-content-before": withCtx((_, _push2, _parent2, _scopeId) => { + if (_push2) { + ssrRenderSlot(_ctx.$slots, "nav-bar-content-before", {}, null, _push2, _parent2, _scopeId); + } else { + return [ + renderSlot(_ctx.$slots, "nav-bar-content-before", {}, void 0, true) + ]; + } + }), + "nav-bar-content-after": withCtx((_, _push2, _parent2, _scopeId) => { + if (_push2) { + ssrRenderSlot(_ctx.$slots, "nav-bar-content-after", {}, null, _push2, _parent2, _scopeId); + } else { + return [ + renderSlot(_ctx.$slots, "nav-bar-content-after", {}, void 0, true) + ]; + } + }), + "nav-screen-content-before": withCtx((_, _push2, _parent2, _scopeId) => { + if (_push2) { + ssrRenderSlot(_ctx.$slots, "nav-screen-content-before", {}, null, _push2, _parent2, _scopeId); + } else { + return [ + renderSlot(_ctx.$slots, "nav-screen-content-before", {}, void 0, true) + ]; + } + }), + "nav-screen-content-after": withCtx((_, _push2, _parent2, _scopeId) => { + if (_push2) { + ssrRenderSlot(_ctx.$slots, "nav-screen-content-after", {}, null, _push2, _parent2, _scopeId); + } else { + return [ + renderSlot(_ctx.$slots, "nav-screen-content-after", {}, void 0, true) + ]; + } + }), + _: 3 + }, _parent)); + _push(ssrRenderComponent(VPLocalNav, { + open: unref(isSidebarOpen), + onOpenMenu: unref(openSidebar) + }, null, _parent)); + _push(ssrRenderComponent(VPSidebar, { open: unref(isSidebarOpen) }, { + "sidebar-nav-before": withCtx((_, _push2, _parent2, _scopeId) => { + if (_push2) { + ssrRenderSlot(_ctx.$slots, "sidebar-nav-before", {}, null, _push2, _parent2, _scopeId); + } else { + return [ + renderSlot(_ctx.$slots, "sidebar-nav-before", {}, void 0, true) + ]; + } + }), + "sidebar-nav-after": withCtx((_, _push2, _parent2, _scopeId) => { + if (_push2) { + ssrRenderSlot(_ctx.$slots, "sidebar-nav-after", {}, null, _push2, _parent2, _scopeId); + } else { + return [ + renderSlot(_ctx.$slots, "sidebar-nav-after", {}, void 0, true) + ]; + } + }), + _: 3 + }, _parent)); + _push(ssrRenderComponent(VPContent, null, { + "page-top": withCtx((_, _push2, _parent2, _scopeId) => { + if (_push2) { + ssrRenderSlot(_ctx.$slots, "page-top", {}, null, _push2, _parent2, _scopeId); + } else { + return [ + renderSlot(_ctx.$slots, "page-top", {}, void 0, true) + ]; + } + }), + "page-bottom": withCtx((_, _push2, _parent2, _scopeId) => { + if (_push2) { + ssrRenderSlot(_ctx.$slots, "page-bottom", {}, null, _push2, _parent2, _scopeId); + } else { + return [ + renderSlot(_ctx.$slots, "page-bottom", {}, void 0, true) + ]; + } + }), + "not-found": withCtx((_, _push2, _parent2, _scopeId) => { + if (_push2) { + ssrRenderSlot(_ctx.$slots, "not-found", {}, null, _push2, _parent2, _scopeId); + } else { + return [ + renderSlot(_ctx.$slots, "not-found", {}, void 0, true) + ]; + } + }), + "home-hero-before": withCtx((_, _push2, _parent2, _scopeId) => { + if (_push2) { + ssrRenderSlot(_ctx.$slots, "home-hero-before", {}, null, _push2, _parent2, _scopeId); + } else { + return [ + renderSlot(_ctx.$slots, "home-hero-before", {}, void 0, true) + ]; + } + }), + "home-hero-info-before": withCtx((_, _push2, _parent2, _scopeId) => { + if (_push2) { + ssrRenderSlot(_ctx.$slots, "home-hero-info-before", {}, null, _push2, _parent2, _scopeId); + } else { + return [ + renderSlot(_ctx.$slots, "home-hero-info-before", {}, void 0, true) + ]; + } + }), + "home-hero-info": withCtx((_, _push2, _parent2, _scopeId) => { + if (_push2) { + ssrRenderSlot(_ctx.$slots, "home-hero-info", {}, null, _push2, _parent2, _scopeId); + } else { + return [ + renderSlot(_ctx.$slots, "home-hero-info", {}, void 0, true) + ]; + } + }), + "home-hero-info-after": withCtx((_, _push2, _parent2, _scopeId) => { + if (_push2) { + ssrRenderSlot(_ctx.$slots, "home-hero-info-after", {}, null, _push2, _parent2, _scopeId); + } else { + return [ + renderSlot(_ctx.$slots, "home-hero-info-after", {}, void 0, true) + ]; + } + }), + "home-hero-actions-after": withCtx((_, _push2, _parent2, _scopeId) => { + if (_push2) { + ssrRenderSlot(_ctx.$slots, "home-hero-actions-after", {}, null, _push2, _parent2, _scopeId); + } else { + return [ + renderSlot(_ctx.$slots, "home-hero-actions-after", {}, void 0, true) + ]; + } + }), + "home-hero-image": withCtx((_, _push2, _parent2, _scopeId) => { + if (_push2) { + ssrRenderSlot(_ctx.$slots, "home-hero-image", {}, null, _push2, _parent2, _scopeId); + } else { + return [ + renderSlot(_ctx.$slots, "home-hero-image", {}, void 0, true) + ]; + } + }), + "home-hero-after": withCtx((_, _push2, _parent2, _scopeId) => { + if (_push2) { + ssrRenderSlot(_ctx.$slots, "home-hero-after", {}, null, _push2, _parent2, _scopeId); + } else { + return [ + renderSlot(_ctx.$slots, "home-hero-after", {}, void 0, true) + ]; + } + }), + "home-features-before": withCtx((_, _push2, _parent2, _scopeId) => { + if (_push2) { + ssrRenderSlot(_ctx.$slots, "home-features-before", {}, null, _push2, _parent2, _scopeId); + } else { + return [ + renderSlot(_ctx.$slots, "home-features-before", {}, void 0, true) + ]; + } + }), + "home-features-after": withCtx((_, _push2, _parent2, _scopeId) => { + if (_push2) { + ssrRenderSlot(_ctx.$slots, "home-features-after", {}, null, _push2, _parent2, _scopeId); + } else { + return [ + renderSlot(_ctx.$slots, "home-features-after", {}, void 0, true) + ]; + } + }), + "doc-footer-before": withCtx((_, _push2, _parent2, _scopeId) => { + if (_push2) { + ssrRenderSlot(_ctx.$slots, "doc-footer-before", {}, null, _push2, _parent2, _scopeId); + } else { + return [ + renderSlot(_ctx.$slots, "doc-footer-before", {}, void 0, true) + ]; + } + }), + "doc-before": withCtx((_, _push2, _parent2, _scopeId) => { + if (_push2) { + ssrRenderSlot(_ctx.$slots, "doc-before", {}, null, _push2, _parent2, _scopeId); + } else { + return [ + renderSlot(_ctx.$slots, "doc-before", {}, void 0, true) + ]; + } + }), + "doc-after": withCtx((_, _push2, _parent2, _scopeId) => { + if (_push2) { + ssrRenderSlot(_ctx.$slots, "doc-after", {}, null, _push2, _parent2, _scopeId); + } else { + return [ + renderSlot(_ctx.$slots, "doc-after", {}, void 0, true) + ]; + } + }), + "doc-top": withCtx((_, _push2, _parent2, _scopeId) => { + if (_push2) { + ssrRenderSlot(_ctx.$slots, "doc-top", {}, null, _push2, _parent2, _scopeId); + } else { + return [ + renderSlot(_ctx.$slots, "doc-top", {}, void 0, true) + ]; + } + }), + "doc-bottom": withCtx((_, _push2, _parent2, _scopeId) => { + if (_push2) { + ssrRenderSlot(_ctx.$slots, "doc-bottom", {}, null, _push2, _parent2, _scopeId); + } else { + return [ + renderSlot(_ctx.$slots, "doc-bottom", {}, void 0, true) + ]; + } + }), + "aside-top": withCtx((_, _push2, _parent2, _scopeId) => { + if (_push2) { + ssrRenderSlot(_ctx.$slots, "aside-top", {}, null, _push2, _parent2, _scopeId); + } else { + return [ + renderSlot(_ctx.$slots, "aside-top", {}, void 0, true) + ]; + } + }), + "aside-bottom": withCtx((_, _push2, _parent2, _scopeId) => { + if (_push2) { + ssrRenderSlot(_ctx.$slots, "aside-bottom", {}, null, _push2, _parent2, _scopeId); + } else { + return [ + renderSlot(_ctx.$slots, "aside-bottom", {}, void 0, true) + ]; + } + }), + "aside-outline-before": withCtx((_, _push2, _parent2, _scopeId) => { + if (_push2) { + ssrRenderSlot(_ctx.$slots, "aside-outline-before", {}, null, _push2, _parent2, _scopeId); + } else { + return [ + renderSlot(_ctx.$slots, "aside-outline-before", {}, void 0, true) + ]; + } + }), + "aside-outline-after": withCtx((_, _push2, _parent2, _scopeId) => { + if (_push2) { + ssrRenderSlot(_ctx.$slots, "aside-outline-after", {}, null, _push2, _parent2, _scopeId); + } else { + return [ + renderSlot(_ctx.$slots, "aside-outline-after", {}, void 0, true) + ]; + } + }), + "aside-ads-before": withCtx((_, _push2, _parent2, _scopeId) => { + if (_push2) { + ssrRenderSlot(_ctx.$slots, "aside-ads-before", {}, null, _push2, _parent2, _scopeId); + } else { + return [ + renderSlot(_ctx.$slots, "aside-ads-before", {}, void 0, true) + ]; + } + }), + "aside-ads-after": withCtx((_, _push2, _parent2, _scopeId) => { + if (_push2) { + ssrRenderSlot(_ctx.$slots, "aside-ads-after", {}, null, _push2, _parent2, _scopeId); + } else { + return [ + renderSlot(_ctx.$slots, "aside-ads-after", {}, void 0, true) + ]; + } + }), + _: 3 + }, _parent)); + _push(ssrRenderComponent(VPFooter, null, null, _parent)); + ssrRenderSlot(_ctx.$slots, "layout-bottom", {}, null, _push, _parent); + _push(``); + } else { + _push(ssrRenderComponent(_component_Content, _attrs, null, _parent)); + } + }; + } +}); +const _sfc_setup$9 = _sfc_main$9.setup; +_sfc_main$9.setup = (props, ctx) => { + const ssrContext = useSSRContext(); + (ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("../node_modules/vitepress/dist/client/theme-default/Layout.vue"); + return _sfc_setup$9 ? _sfc_setup$9(props, ctx) : void 0; +}; +const Layout = /* @__PURE__ */ _export_sfc(_sfc_main$9, [["__scopeId", "data-v-5d98c3a5"]]); +const GridSettings = { + xmini: [[0, 2]], + mini: [], + small: [ + [920, 6], + [768, 5], + [640, 4], + [480, 3], + [0, 2] + ], + medium: [ + [960, 5], + [832, 4], + [640, 3], + [480, 2] + ], + big: [ + [832, 3], + [640, 2] + ] +}; +function useSponsorsGrid({ el, size = "medium" }) { + const onResize = throttleAndDebounce(manage, 100); + onMounted(() => { + manage(); + window.addEventListener("resize", onResize); + }); + onUnmounted(() => { + window.removeEventListener("resize", onResize); + }); + function manage() { + adjustSlots(el.value, size); + } +} +function adjustSlots(el, size) { + const tsize = el.children.length; + const asize = el.querySelectorAll(".vp-sponsor-grid-item:not(.empty)").length; + const grid = setGrid(el, size, asize); + manageSlots(el, grid, tsize, asize); +} +function setGrid(el, size, items) { + const settings = GridSettings[size]; + const screen = window.innerWidth; + let grid = 1; + settings.some(([breakpoint, value]) => { + if (screen >= breakpoint) { + grid = items < value ? items : value; + return true; + } + }); + setGridData(el, grid); + return grid; +} +function setGridData(el, value) { + el.dataset.vpGrid = String(value); +} +function manageSlots(el, grid, tsize, asize) { + const diff = tsize - asize; + const rem = asize % grid; + const drem = rem === 0 ? rem : grid - rem; + neutralizeSlots(el, drem - diff); +} +function neutralizeSlots(el, count) { + if (count === 0) { + return; + } + count > 0 ? addSlots(el, count) : removeSlots(el, count * -1); +} +function addSlots(el, count) { + for (let i = 0; i < count; i++) { + const slot = document.createElement("div"); + slot.classList.add("vp-sponsor-grid-item", "empty"); + el.append(slot); + } +} +function removeSlots(el, count) { + for (let i = 0; i < count; i++) { + el.removeChild(el.lastElementChild); + } +} +const _sfc_main$8 = /* @__PURE__ */ defineComponent({ + __name: "VPSponsorsGrid", + __ssrInlineRender: true, + props: { + size: { default: "medium" }, + data: {} + }, + setup(__props) { + const props = __props; + const el = ref(null); + useSponsorsGrid({ el, size: props.size }); + return (_ctx, _push, _parent, _attrs) => { + _push(``); + ssrRenderList(__props.data, (sponsor) => { + _push(``); + }); + _push(``); + }; + } +}); +const _sfc_setup$8 = _sfc_main$8.setup; +_sfc_main$8.setup = (props, ctx) => { + const ssrContext = useSSRContext(); + (ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("../node_modules/vitepress/dist/client/theme-default/components/VPSponsorsGrid.vue"); + return _sfc_setup$8 ? _sfc_setup$8(props, ctx) : void 0; +}; +const _sfc_main$7 = /* @__PURE__ */ defineComponent({ + __name: "VPSponsors", + __ssrInlineRender: true, + props: { + mode: { default: "normal" }, + tier: {}, + size: {}, + data: {} + }, + setup(__props) { + const props = __props; + const sponsors = computed(() => { + const isSponsors = props.data.some((s) => { + return "items" in s; + }); + if (isSponsors) { + return props.data; + } + return [ + { tier: props.tier, size: props.size, items: props.data } + ]; + }); + return (_ctx, _push, _parent, _attrs) => { + _push(``); + ssrRenderList(sponsors.value, (sponsor, index) => { + _push(`
    `); + if (sponsor.tier) { + _push(`

    ${ssrInterpolate(sponsor.tier)}

    `); + } else { + _push(``); + } + _push(ssrRenderComponent(_sfc_main$8, { + size: sponsor.size, + data: sponsor.items + }, null, _parent)); + _push(`
    `); + }); + _push(``); + }; + } +}); +const _sfc_setup$7 = _sfc_main$7.setup; +_sfc_main$7.setup = (props, ctx) => { + const ssrContext = useSSRContext(); + (ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("../node_modules/vitepress/dist/client/theme-default/components/VPSponsors.vue"); + return _sfc_setup$7 ? _sfc_setup$7(props, ctx) : void 0; +}; +const _sfc_main$6 = /* @__PURE__ */ defineComponent({ + __name: "VPDocAsideSponsors", + __ssrInlineRender: true, + props: { + tier: {}, + size: {}, + data: {} + }, + setup(__props) { + return (_ctx, _push, _parent, _attrs) => { + _push(``); + _push(ssrRenderComponent(_sfc_main$7, { + mode: "aside", + tier: __props.tier, + size: __props.size, + data: __props.data + }, null, _parent)); + _push(``); + }; + } +}); +const _sfc_setup$6 = _sfc_main$6.setup; +_sfc_main$6.setup = (props, ctx) => { + const ssrContext = useSSRContext(); + (ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("../node_modules/vitepress/dist/client/theme-default/components/VPDocAsideSponsors.vue"); + return _sfc_setup$6 ? _sfc_setup$6(props, ctx) : void 0; +}; +const _sfc_main$5 = /* @__PURE__ */ defineComponent({ + __name: "VPHomeSponsors", + __ssrInlineRender: true, + props: { + message: {}, + actionText: { default: "Become a sponsor" }, + actionLink: {}, + data: {} + }, + setup(__props) { + return (_ctx, _push, _parent, _attrs) => { + _push(`
    `); + if (__props.message) { + _push(`

    ${ssrInterpolate(__props.message)}

    `); + } else { + _push(``); + } + _push(`
    `); + _push(ssrRenderComponent(_sfc_main$7, { data: __props.data }, null, _parent)); + _push(`
    `); + if (__props.actionLink) { + _push(`
    `); + _push(ssrRenderComponent(VPButton, { + theme: "sponsor", + text: __props.actionText, + href: __props.actionLink + }, null, _parent)); + _push(`
    `); + } else { + _push(``); + } + _push(`
    `); + }; + } +}); +const _sfc_setup$5 = _sfc_main$5.setup; +_sfc_main$5.setup = (props, ctx) => { + const ssrContext = useSSRContext(); + (ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("../node_modules/vitepress/dist/client/theme-default/components/VPHomeSponsors.vue"); + return _sfc_setup$5 ? _sfc_setup$5(props, ctx) : void 0; +}; +const _sfc_main$4 = /* @__PURE__ */ defineComponent({ + __name: "VPTeamMembersItem", + __ssrInlineRender: true, + props: { + size: { default: "medium" }, + member: {} + }, + setup(__props) { + return (_ctx, _push, _parent, _attrs) => { + _push(`

    ${ssrInterpolate(__props.member.name)}

    `); + if (__props.member.title || __props.member.org) { + _push(`

    `); + if (__props.member.title) { + _push(`${ssrInterpolate(__props.member.title)}`); + } else { + _push(``); + } + if (__props.member.title && __props.member.org) { + _push(` @ `); + } else { + _push(``); + } + if (__props.member.org) { + _push(ssrRenderComponent(_sfc_main$Z, { + class: ["org", { link: __props.member.orgLink }], + href: __props.member.orgLink, + "no-icon": "" + }, { + default: withCtx((_, _push2, _parent2, _scopeId) => { + if (_push2) { + _push2(`${ssrInterpolate(__props.member.org)}`); + } else { + return [ + createTextVNode(toDisplayString(__props.member.org), 1) + ]; + } + }), + _: 1 + }, _parent)); + } else { + _push(``); + } + _push(`

    `); + } else { + _push(``); + } + if (__props.member.desc) { + _push(`

    ${__props.member.desc ?? ""}

    `); + } else { + _push(``); + } + if (__props.member.links) { + _push(``); + } else { + _push(``); + } + _push(`
    `); + if (__props.member.sponsor) { + _push(`
    `); + _push(ssrRenderComponent(_sfc_main$Z, { + class: "sp-link", + href: __props.member.sponsor, + "no-icon": "" + }, { + default: withCtx((_, _push2, _parent2, _scopeId) => { + if (_push2) { + _push2(` ${ssrInterpolate(__props.member.actionText || "Sponsor")}`); + } else { + return [ + createVNode("span", { class: "vpi-heart sp-icon" }), + createTextVNode(" " + toDisplayString(__props.member.actionText || "Sponsor"), 1) + ]; + } + }), + _: 1 + }, _parent)); + _push(`
    `); + } else { + _push(``); + } + _push(``); + }; + } +}); +const _sfc_setup$4 = _sfc_main$4.setup; +_sfc_main$4.setup = (props, ctx) => { + const ssrContext = useSSRContext(); + (ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("../node_modules/vitepress/dist/client/theme-default/components/VPTeamMembersItem.vue"); + return _sfc_setup$4 ? _sfc_setup$4(props, ctx) : void 0; +}; +const VPTeamMembersItem = /* @__PURE__ */ _export_sfc(_sfc_main$4, [["__scopeId", "data-v-f3fa364a"]]); +const _sfc_main$3 = /* @__PURE__ */ defineComponent({ + __name: "VPTeamMembers", + __ssrInlineRender: true, + props: { + size: { default: "medium" }, + members: {} + }, + setup(__props) { + const props = __props; + const classes = computed(() => [props.size, `count-${props.members.length}`]); + return (_ctx, _push, _parent, _attrs) => { + _push(`
    `); + ssrRenderList(__props.members, (member) => { + _push(`
    `); + _push(ssrRenderComponent(VPTeamMembersItem, { + size: __props.size, + member + }, null, _parent)); + _push(`
    `); + }); + _push(`
    `); + }; + } +}); +const _sfc_setup$3 = _sfc_main$3.setup; +_sfc_main$3.setup = (props, ctx) => { + const ssrContext = useSSRContext(); + (ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("../node_modules/vitepress/dist/client/theme-default/components/VPTeamMembers.vue"); + return _sfc_setup$3 ? _sfc_setup$3(props, ctx) : void 0; +}; +const _sfc_main$2 = {}; +const _sfc_setup$2 = _sfc_main$2.setup; +_sfc_main$2.setup = (props, ctx) => { + const ssrContext = useSSRContext(); + (ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("../node_modules/vitepress/dist/client/theme-default/components/VPTeamPage.vue"); + return _sfc_setup$2 ? _sfc_setup$2(props, ctx) : void 0; +}; +const _sfc_main$1 = {}; +const _sfc_setup$1 = _sfc_main$1.setup; +_sfc_main$1.setup = (props, ctx) => { + const ssrContext = useSSRContext(); + (ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("../node_modules/vitepress/dist/client/theme-default/components/VPTeamPageSection.vue"); + return _sfc_setup$1 ? _sfc_setup$1(props, ctx) : void 0; +}; +const _sfc_main = {}; +const _sfc_setup = _sfc_main.setup; +_sfc_main.setup = (props, ctx) => { + const ssrContext = useSSRContext(); + (ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("../node_modules/vitepress/dist/client/theme-default/components/VPTeamPageTitle.vue"); + return _sfc_setup ? _sfc_setup(props, ctx) : void 0; +}; +const theme = { + Layout, + enhanceApp: ({ app }) => { + app.component("Badge", _sfc_main$14); + } +}; +const ClientOnly = defineComponent({ + setup(_, { slots }) { + const show = ref(false); + onMounted(() => { + show.value = true; + }); + return () => show.value && slots.default ? slots.default() : null; + } +}); +function useCodeGroups() { + if (inBrowser) { + window.addEventListener("click", (e) => { + var _a; + const el = e.target; + if (el.matches(".vp-code-group input")) { + const group = (_a = el.parentElement) == null ? void 0 : _a.parentElement; + if (!group) + return; + const i = Array.from(group.querySelectorAll("input")).indexOf(el); + if (i < 0) + return; + const blocks = group.querySelector(".blocks"); + if (!blocks) + return; + const current = Array.from(blocks.children).find((child) => child.classList.contains("active")); + if (!current) + return; + const next = blocks.children[i]; + if (!next || current === next) + return; + current.classList.remove("active"); + next.classList.add("active"); + const label = group == null ? void 0 : group.querySelector(`label[for="${el.id}"]`); + label == null ? void 0 : label.scrollIntoView({ block: "nearest" }); + } + }); + } +} +function useCopyCode() { + if (inBrowser) { + const timeoutIdMap = /* @__PURE__ */ new WeakMap(); + window.addEventListener("click", (e) => { + var _a; + const el = e.target; + if (el.matches('div[class*="language-"] > button.copy')) { + const parent = el.parentElement; + const sibling = (_a = el.nextElementSibling) == null ? void 0 : _a.nextElementSibling; + if (!parent || !sibling) { + return; + } + const isShell = /language-(shellscript|shell|bash|sh|zsh)/.test(parent.className); + const ignoredNodes = [".vp-copy-ignore", ".diff.remove"]; + const clone = sibling.cloneNode(true); + clone.querySelectorAll(ignoredNodes.join(",")).forEach((node) => node.remove()); + let text = clone.textContent || ""; + if (isShell) { + text = text.replace(/^ *(\$|>) /gm, "").trim(); + } + copyToClipboard(text).then(() => { + el.classList.add("copied"); + clearTimeout(timeoutIdMap.get(el)); + const timeoutId = setTimeout(() => { + el.classList.remove("copied"); + el.blur(); + timeoutIdMap.delete(el); + }, 2e3); + timeoutIdMap.set(el, timeoutId); + }); + } + }); + } +} +async function copyToClipboard(text) { + try { + return navigator.clipboard.writeText(text); + } catch { + const element = document.createElement("textarea"); + const previouslyFocusedElement = document.activeElement; + element.value = text; + element.setAttribute("readonly", ""); + element.style.contain = "strict"; + element.style.position = "absolute"; + element.style.left = "-9999px"; + element.style.fontSize = "12pt"; + const selection = document.getSelection(); + const originalRange = selection ? selection.rangeCount > 0 && selection.getRangeAt(0) : null; + document.body.appendChild(element); + element.select(); + element.selectionStart = 0; + element.selectionEnd = text.length; + document.execCommand("copy"); + document.body.removeChild(element); + if (originalRange) { + selection.removeAllRanges(); + selection.addRange(originalRange); + } + if (previouslyFocusedElement) { + previouslyFocusedElement.focus(); + } + } +} +function useUpdateHead(route, siteDataByRouteRef) { + let isFirstUpdate = true; + let managedHeadElements = []; + const updateHeadTags = (newTags) => { + if (isFirstUpdate) { + isFirstUpdate = false; + newTags.forEach((tag) => { + const headEl = createHeadElement(tag); + for (const el of document.head.children) { + if (el.isEqualNode(headEl)) { + managedHeadElements.push(el); + return; + } + } + }); + return; + } + const newElements = newTags.map(createHeadElement); + managedHeadElements.forEach((oldEl, oldIndex) => { + const matchedIndex = newElements.findIndex((newEl) => newEl == null ? void 0 : newEl.isEqualNode(oldEl ?? null)); + if (matchedIndex !== -1) { + delete newElements[matchedIndex]; + } else { + oldEl == null ? void 0 : oldEl.remove(); + delete managedHeadElements[oldIndex]; + } + }); + newElements.forEach((el) => el && document.head.appendChild(el)); + managedHeadElements = [...managedHeadElements, ...newElements].filter(Boolean); + }; + watchEffect(() => { + const pageData = route.data; + const siteData2 = siteDataByRouteRef.value; + const pageDescription = pageData && pageData.description; + const frontmatterHead = pageData && pageData.frontmatter.head || []; + const title = createTitle(siteData2, pageData); + if (title !== document.title) { + document.title = title; + } + const description = pageDescription || siteData2.description; + let metaDescriptionElement = document.querySelector(`meta[name=description]`); + if (metaDescriptionElement) { + if (metaDescriptionElement.getAttribute("content") !== description) { + metaDescriptionElement.setAttribute("content", description); + } + } else { + createHeadElement(["meta", { name: "description", content: description }]); + } + updateHeadTags(mergeHead(siteData2.head, filterOutHeadDescription(frontmatterHead))); + }); +} +function createHeadElement([tag, attrs, innerHTML]) { + const el = document.createElement(tag); + for (const key in attrs) { + el.setAttribute(key, attrs[key]); + } + if (innerHTML) { + el.innerHTML = innerHTML; + } + if (tag === "script" && attrs.async == null) { + el.async = false; + } + return el; +} +function isMetaDescription(headConfig) { + return headConfig[0] === "meta" && headConfig[1] && headConfig[1].name === "description"; +} +function filterOutHeadDescription(head) { + return head.filter((h2) => !isMetaDescription(h2)); +} +const hasFetched = /* @__PURE__ */ new Set(); +const createLink = () => document.createElement("link"); +const viaDOM = (url) => { + const link2 = createLink(); + link2.rel = `prefetch`; + link2.href = url; + document.head.appendChild(link2); +}; +const viaXHR = (url) => { + const req = new XMLHttpRequest(); + req.open("GET", url, req.withCredentials = true); + req.send(); +}; +let link; +const doFetch = inBrowser && (link = createLink()) && link.relList && link.relList.supports && link.relList.supports("prefetch") ? viaDOM : viaXHR; +function usePrefetch() { + if (!inBrowser) { + return; + } + if (!window.IntersectionObserver) { + return; + } + let conn; + if ((conn = navigator.connection) && (conn.saveData || /2g/.test(conn.effectiveType))) { + return; + } + const rIC = window.requestIdleCallback || setTimeout; + let observer = null; + const observeLinks = () => { + if (observer) { + observer.disconnect(); + } + observer = new IntersectionObserver((entries) => { + entries.forEach((entry) => { + if (entry.isIntersecting) { + const link2 = entry.target; + observer.unobserve(link2); + const { pathname } = link2; + if (!hasFetched.has(pathname)) { + hasFetched.add(pathname); + const pageChunkPath = pathToFile(pathname); + if (pageChunkPath) + doFetch(pageChunkPath); + } + } + }); + }); + rIC(() => { + document.querySelectorAll("#app a").forEach((link2) => { + const { hostname, pathname } = new URL(link2.href instanceof SVGAnimatedString ? link2.href.animVal : link2.href, link2.baseURI); + const extMatch = pathname.match(/\.\w+$/); + if (extMatch && extMatch[0] !== ".html") { + return; + } + if ( + // only prefetch same tab navigation, since a new tab will load + // the lean js chunk instead. + link2.target !== "_blank" && // only prefetch inbound links + hostname === location.hostname + ) { + if (pathname !== location.pathname) { + observer.observe(link2); + } else { + hasFetched.add(pathname); + } + } + }); + }); + }; + onMounted(observeLinks); + const route = useRoute(); + watch(() => route.path, observeLinks); + onUnmounted(() => { + observer && observer.disconnect(); + }); +} +function resolveThemeExtends(theme2) { + if (theme2.extends) { + const base = resolveThemeExtends(theme2.extends); + return { + ...base, + ...theme2, + async enhanceApp(ctx) { + if (base.enhanceApp) + await base.enhanceApp(ctx); + if (theme2.enhanceApp) + await theme2.enhanceApp(ctx); + } + }; + } + return theme2; +} +const Theme = resolveThemeExtends(theme); +const VitePressApp = defineComponent({ + name: "VitePressApp", + setup() { + const { site, lang, dir } = useData$1(); + onMounted(() => { + watchEffect(() => { + document.documentElement.lang = lang.value; + document.documentElement.dir = dir.value; + }); + }); + if (site.value.router.prefetchLinks) { + usePrefetch(); + } + useCopyCode(); + useCodeGroups(); + if (Theme.setup) + Theme.setup(); + return () => h(Theme.Layout); + } +}); +async function createApp() { + globalThis.__VITEPRESS__ = true; + const router = newRouter(); + const app = newApp(); + app.provide(RouterSymbol, router); + const data = initData(router.route); + app.provide(dataSymbol, data); + app.component("Content", Content); + app.component("ClientOnly", ClientOnly); + Object.defineProperties(app.config.globalProperties, { + $frontmatter: { + get() { + return data.frontmatter.value; + } + }, + $params: { + get() { + return data.page.value.params; + } + } + }); + if (Theme.enhanceApp) { + await Theme.enhanceApp({ + app, + router, + siteData: siteDataRef + }); + } + return { app, router, data }; +} +function newApp() { + return createSSRApp(VitePressApp); +} +function newRouter() { + let isInitialPageLoad = inBrowser; + return createRouter((path) => { + let pageFilePath = pathToFile(path); + let pageModule = null; + if (pageFilePath) { + if (isInitialPageLoad) { + pageFilePath = pageFilePath.replace(/\.js$/, ".lean.js"); + } + if (false) ; + else { + pageModule = import( + /*@vite-ignore*/ + pageFilePath + ); + } + } + if (inBrowser) { + isInitialPageLoad = false; + } + return pageModule; + }, Theme.NotFound); +} +if (inBrowser) { + createApp().then(({ app, router, data }) => { + router.go().then(() => { + useUpdateHead(router.route, data.site); + app.mount("#app"); + }); + }); +} +async function render(path) { + const { app, router } = await createApp(); + await router.go(path); + const ctx = { content: "", vpSocialIcons: /* @__PURE__ */ new Set() }; + ctx.content = await renderToString(app, ctx); + return ctx; +} +export { + useRouter as a, + createSearchTranslate as c, + dataSymbol as d, + escapeRegExp as e, + inBrowser as i, + pathToFile as p, + render, + useData as u +}; diff --git a/docs/.vitepress/.temp/assets/style.ClG4-ikt.css b/docs/.vitepress/.temp/assets/style.ClG4-ikt.css new file mode 100644 index 0000000..477c658 --- /dev/null +++ b/docs/.vitepress/.temp/assets/style.ClG4-ikt.css @@ -0,0 +1,5095 @@ + + +@font-face { + font-family: Inter; + font-style: normal; + font-weight: 100 900; + font-display: swap; + src: url('/ai-coding-kit/assets/inter-roman-cyrillic-ext.BBPuwvHQ.woff2') format('woff2'); + unicode-range: U+0460-052F, U+1C80-1C88, U+20B4, U+2DE0-2DFF, U+A640-A69F, + U+FE2E-FE2F; +} + +@font-face { + font-family: Inter; + font-style: normal; + font-weight: 100 900; + font-display: swap; + src: url('/ai-coding-kit/assets/inter-roman-cyrillic.C5lxZ8CY.woff2') format('woff2'); + unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; +} + +@font-face { + font-family: Inter; + font-style: normal; + font-weight: 100 900; + font-display: swap; + src: url('/ai-coding-kit/assets/inter-roman-greek-ext.CqjqNYQ-.woff2') format('woff2'); + unicode-range: U+1F00-1FFF; +} + +@font-face { + font-family: Inter; + font-style: normal; + font-weight: 100 900; + font-display: swap; + src: url('/ai-coding-kit/assets/inter-roman-greek.BBVDIX6e.woff2') format('woff2'); + unicode-range: U+0370-0377, U+037A-037F, U+0384-038A, U+038C, U+038E-03A1, + U+03A3-03FF; +} + +@font-face { + font-family: Inter; + font-style: normal; + font-weight: 100 900; + font-display: swap; + src: url('/ai-coding-kit/assets/inter-roman-vietnamese.BjW4sHH5.woff2') format('woff2'); + unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, + U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, + U+0329, U+1EA0-1EF9, U+20AB; +} + +@font-face { + font-family: Inter; + font-style: normal; + font-weight: 100 900; + font-display: swap; + src: url('/ai-coding-kit/assets/inter-roman-latin-ext.4ZJIpNVo.woff2') format('woff2'); + unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, + U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; +} + +@font-face { + font-family: Inter; + font-style: normal; + font-weight: 100 900; + font-display: swap; + src: url('/ai-coding-kit/assets/inter-roman-latin.Di8DUHzh.woff2') format('woff2'); + unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, + U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, + U+2193, U+2212, U+2215, U+FEFF, U+FFFD; +} + +@font-face { + font-family: Inter; + font-style: italic; + font-weight: 100 900; + font-display: swap; + src: url('/ai-coding-kit/assets/inter-italic-cyrillic-ext.r48I6akx.woff2') format('woff2'); + unicode-range: U+0460-052F, U+1C80-1C88, U+20B4, U+2DE0-2DFF, U+A640-A69F, + U+FE2E-FE2F; +} + +@font-face { + font-family: Inter; + font-style: italic; + font-weight: 100 900; + font-display: swap; + src: url('/ai-coding-kit/assets/inter-italic-cyrillic.By2_1cv3.woff2') format('woff2'); + unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; +} + +@font-face { + font-family: Inter; + font-style: italic; + font-weight: 100 900; + font-display: swap; + src: url('/ai-coding-kit/assets/inter-italic-greek-ext.1u6EdAuj.woff2') format('woff2'); + unicode-range: U+1F00-1FFF; +} + +@font-face { + font-family: Inter; + font-style: italic; + font-weight: 100 900; + font-display: swap; + src: url('/ai-coding-kit/assets/inter-italic-greek.DJ8dCoTZ.woff2') format('woff2'); + unicode-range: U+0370-0377, U+037A-037F, U+0384-038A, U+038C, U+038E-03A1, + U+03A3-03FF; +} + +@font-face { + font-family: Inter; + font-style: italic; + font-weight: 100 900; + font-display: swap; + src: url('/ai-coding-kit/assets/inter-italic-vietnamese.BSbpV94h.woff2') format('woff2'); + unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, + U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, + U+0329, U+1EA0-1EF9, U+20AB; +} + +@font-face { + font-family: Inter; + font-style: italic; + font-weight: 100 900; + font-display: swap; + src: url('/ai-coding-kit/assets/inter-italic-latin-ext.CN1xVJS-.woff2') format('woff2'); + unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, + U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; +} + +@font-face { + font-family: Inter; + font-style: italic; + font-weight: 100 900; + font-display: swap; + src: url('/ai-coding-kit/assets/inter-italic-latin.C2AdPX0b.woff2') format('woff2'); + unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, + U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, + U+2193, U+2212, U+2215, U+FEFF, U+FFFD; +} + +@font-face { + font-family: 'Punctuation SC'; + font-weight: 400; + src: local('PingFang SC Regular'), local('Noto Sans CJK SC'), + local('Microsoft YaHei'); + unicode-range: U+201C, U+201D, U+2018, U+2019, U+2E3A, U+2014, U+2013, U+2026, + U+00B7, U+007E, U+002F; +} + +@font-face { + font-family: 'Punctuation SC'; + font-weight: 500; + src: local('PingFang SC Medium'), local('Noto Sans CJK SC'), + local('Microsoft YaHei'); + unicode-range: U+201C, U+201D, U+2018, U+2019, U+2E3A, U+2014, U+2013, U+2026, + U+00B7, U+007E, U+002F; +} + +@font-face { + font-family: 'Punctuation SC'; + font-weight: 600; + src: local('PingFang SC Semibold'), local('Noto Sans CJK SC Bold'), + local('Microsoft YaHei Bold'); + unicode-range: U+201C, U+201D, U+2018, U+2019, U+2E3A, U+2014, U+2013, U+2026, + U+00B7, U+007E, U+002F; +} + +@font-face { + font-family: 'Punctuation SC'; + font-weight: 700; + src: local('PingFang SC Semibold'), local('Noto Sans CJK SC Bold'), + local('Microsoft YaHei Bold'); + unicode-range: U+201C, U+201D, U+2018, U+2019, U+2E3A, U+2014, U+2013, U+2026, + U+00B7, U+007E, U+002F; +} + +/* Generate the subsetted fonts using: `pyftsubset .woff2 --unicodes="" --output-file="inter-\3c style>-.woff2" --flavor=woff2` */ +/** + * Colors: Solid + * -------------------------------------------------------------------------- */ + +:root { + --vp-c-white: #ffffff; + --vp-c-black: #000000; + + --vp-c-neutral: var(--vp-c-black); + --vp-c-neutral-inverse: var(--vp-c-white); +} + +.dark { + --vp-c-neutral: var(--vp-c-white); + --vp-c-neutral-inverse: var(--vp-c-black); +} + +/** + * Colors: Palette + * + * The primitive colors used for accent colors. These colors are referenced + * by functional colors such as "Text", "Background", or "Brand". + * + * Each colors have exact same color scale system with 3 levels of solid + * colors with different brightness, and 1 soft color. + * + * - `XXX-1`: The most solid color used mainly for colored text. It must + * satisfy the contrast ratio against when used on top of `XXX-soft`. + * + * - `XXX-2`: The color used mainly for hover state of the button. + * + * - `XXX-3`: The color for solid background, such as bg color of the button. + * It must satisfy the contrast ratio with pure white (#ffffff) text on + * top of it. + * + * - `XXX-soft`: The color used for subtle background such as custom container + * or badges. It must satisfy the contrast ratio when putting `XXX-1` colors + * on top of it. + * + * The soft color must be semi transparent alpha channel. This is crucial + * because it allows adding multiple "soft" colors on top of each other + * to create a accent, such as when having inline code block inside + * custom containers. + * -------------------------------------------------------------------------- */ + +:root { + --vp-c-gray-1: #dddde3; + --vp-c-gray-2: #e4e4e9; + --vp-c-gray-3: #ebebef; + --vp-c-gray-soft: rgba(142, 150, 170, 0.14); + + --vp-c-indigo-1: #3451b2; + --vp-c-indigo-2: #3a5ccc; + --vp-c-indigo-3: #5672cd; + --vp-c-indigo-soft: rgba(100, 108, 255, 0.14); + + --vp-c-purple-1: #6f42c1; + --vp-c-purple-2: #7e4cc9; + --vp-c-purple-3: #8e5cd9; + --vp-c-purple-soft: rgba(159, 122, 234, 0.14); + + --vp-c-green-1: #18794e; + --vp-c-green-2: #299764; + --vp-c-green-3: #30a46c; + --vp-c-green-soft: rgba(16, 185, 129, 0.14); + + --vp-c-yellow-1: #915930; + --vp-c-yellow-2: #946300; + --vp-c-yellow-3: #9f6a00; + --vp-c-yellow-soft: rgba(234, 179, 8, 0.14); + + --vp-c-red-1: #b8272c; + --vp-c-red-2: #d5393e; + --vp-c-red-3: #e0575b; + --vp-c-red-soft: rgba(244, 63, 94, 0.14); + + --vp-c-sponsor: #db2777; +} + +.dark { + --vp-c-gray-1: #515c67; + --vp-c-gray-2: #414853; + --vp-c-gray-3: #32363f; + --vp-c-gray-soft: rgba(101, 117, 133, 0.16); + + --vp-c-indigo-1: #a8b1ff; + --vp-c-indigo-2: #5c73e7; + --vp-c-indigo-3: #3e63dd; + --vp-c-indigo-soft: rgba(100, 108, 255, 0.16); + + --vp-c-purple-1: #c8abfa; + --vp-c-purple-2: #a879e6; + --vp-c-purple-3: #8e5cd9; + --vp-c-purple-soft: rgba(159, 122, 234, 0.16); + + --vp-c-green-1: #3dd68c; + --vp-c-green-2: #30a46c; + --vp-c-green-3: #298459; + --vp-c-green-soft: rgba(16, 185, 129, 0.16); + + --vp-c-yellow-1: #f9b44e; + --vp-c-yellow-2: #da8b17; + --vp-c-yellow-3: #a46a0a; + --vp-c-yellow-soft: rgba(234, 179, 8, 0.16); + + --vp-c-red-1: #f66f81; + --vp-c-red-2: #f14158; + --vp-c-red-3: #b62a3c; + --vp-c-red-soft: rgba(244, 63, 94, 0.16); +} + +/** + * Colors: Background + * + * - `bg`: The bg color used for main screen. + * + * - `bg-alt`: The alternative bg color used in places such as "sidebar", + * or "code block". + * + * - `bg-elv`: The elevated bg color. This is used at parts where it "floats", + * such as "dialog". + * + * - `bg-soft`: The bg color to slightly distinguish some components from + * the page. Used for things like "carbon ads" or "table". + * -------------------------------------------------------------------------- */ + +:root { + --vp-c-bg: #ffffff; + --vp-c-bg-alt: #f6f6f7; + --vp-c-bg-elv: #ffffff; + --vp-c-bg-soft: #f6f6f7; +} + +.dark { + --vp-c-bg: #1b1b1f; + --vp-c-bg-alt: #161618; + --vp-c-bg-elv: #202127; + --vp-c-bg-soft: #202127; +} + +/** + * Colors: Borders + * + * - `divider`: This is used for separators. This is used to divide sections + * within the same components, such as having separator on "h2" heading. + * + * - `border`: This is designed for borders on interactive components. + * For example this should be used for a button outline. + * + * - `gutter`: This is used to divide components in the page. For example + * the header and the lest of the page. + * -------------------------------------------------------------------------- */ + +:root { + --vp-c-border: #c2c2c4; + --vp-c-divider: #e2e2e3; + --vp-c-gutter: #e2e2e3; +} + +.dark { + --vp-c-border: #3c3f44; + --vp-c-divider: #2e2e32; + --vp-c-gutter: #000000; +} + +/** + * Colors: Text + * + * - `text-1`: Used for primary text. + * + * - `text-2`: Used for muted texts, such as "inactive menu" or "info texts". + * + * - `text-3`: Used for subtle texts, such as "placeholders" or "caret icon". + * -------------------------------------------------------------------------- */ + +:root { + --vp-c-text-1: #3c3c43; + --vp-c-text-2: #67676c; + --vp-c-text-3: #929295; +} + +.dark { + --vp-c-text-1: #dfdfd6; + --vp-c-text-2: #98989f; + --vp-c-text-3: #6a6a71; +} + +/** + * Colors: Function + * + * - `default`: The color used purely for subtle indication without any + * special meanings attached to it such as bg color for menu hover state. + * + * - `brand`: Used for primary brand colors, such as link text, button with + * brand theme, etc. + * + * - `tip`: Used to indicate useful information. The default theme uses the + * brand color for this by default. + * + * - `warning`: Used to indicate warning to the users. Used in custom + * container, badges, etc. + * + * - `danger`: Used to show error, or dangerous message to the users. Used + * in custom container, badges, etc. + * + * To understand the scaling system, refer to "Colors: Palette" section. + * -------------------------------------------------------------------------- */ + +:root { + --vp-c-default-1: var(--vp-c-gray-1); + --vp-c-default-2: var(--vp-c-gray-2); + --vp-c-default-3: var(--vp-c-gray-3); + --vp-c-default-soft: var(--vp-c-gray-soft); + + --vp-c-brand-1: var(--vp-c-indigo-1); + --vp-c-brand-2: var(--vp-c-indigo-2); + --vp-c-brand-3: var(--vp-c-indigo-3); + --vp-c-brand-soft: var(--vp-c-indigo-soft); + + /* DEPRECATED: Use `--vp-c-brand-1` instead. */ + --vp-c-brand: var(--vp-c-brand-1); + + --vp-c-tip-1: var(--vp-c-brand-1); + --vp-c-tip-2: var(--vp-c-brand-2); + --vp-c-tip-3: var(--vp-c-brand-3); + --vp-c-tip-soft: var(--vp-c-brand-soft); + + --vp-c-note-1: var(--vp-c-brand-1); + --vp-c-note-2: var(--vp-c-brand-2); + --vp-c-note-3: var(--vp-c-brand-3); + --vp-c-note-soft: var(--vp-c-brand-soft); + + --vp-c-success-1: var(--vp-c-green-1); + --vp-c-success-2: var(--vp-c-green-2); + --vp-c-success-3: var(--vp-c-green-3); + --vp-c-success-soft: var(--vp-c-green-soft); + + --vp-c-important-1: var(--vp-c-purple-1); + --vp-c-important-2: var(--vp-c-purple-2); + --vp-c-important-3: var(--vp-c-purple-3); + --vp-c-important-soft: var(--vp-c-purple-soft); + + --vp-c-warning-1: var(--vp-c-yellow-1); + --vp-c-warning-2: var(--vp-c-yellow-2); + --vp-c-warning-3: var(--vp-c-yellow-3); + --vp-c-warning-soft: var(--vp-c-yellow-soft); + + --vp-c-danger-1: var(--vp-c-red-1); + --vp-c-danger-2: var(--vp-c-red-2); + --vp-c-danger-3: var(--vp-c-red-3); + --vp-c-danger-soft: var(--vp-c-red-soft); + + --vp-c-caution-1: var(--vp-c-red-1); + --vp-c-caution-2: var(--vp-c-red-2); + --vp-c-caution-3: var(--vp-c-red-3); + --vp-c-caution-soft: var(--vp-c-red-soft); +} + +/** + * Typography + * -------------------------------------------------------------------------- */ + +:root { + --vp-font-family-base: 'Inter', ui-sans-serif, system-ui, sans-serif, + 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', 'Noto Color Emoji'; + --vp-font-family-mono: ui-monospace, 'Menlo', 'Monaco', 'Consolas', + 'Liberation Mono', 'Courier New', monospace; + font-optical-sizing: auto; +} + +:root:where(:lang(zh)) { + --vp-font-family-base: 'Punctuation SC', 'Inter', ui-sans-serif, system-ui, + sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', + 'Noto Color Emoji'; +} + +/** + * Shadows + * -------------------------------------------------------------------------- */ + +:root { + --vp-shadow-1: 0 1px 2px rgba(0, 0, 0, 0.04), 0 1px 2px rgba(0, 0, 0, 0.06); + --vp-shadow-2: 0 3px 12px rgba(0, 0, 0, 0.07), 0 1px 4px rgba(0, 0, 0, 0.07); + --vp-shadow-3: 0 12px 32px rgba(0, 0, 0, 0.1), 0 2px 6px rgba(0, 0, 0, 0.08); + --vp-shadow-4: 0 14px 44px rgba(0, 0, 0, 0.12), 0 3px 9px rgba(0, 0, 0, 0.12); + --vp-shadow-5: 0 18px 56px rgba(0, 0, 0, 0.16), 0 4px 12px rgba(0, 0, 0, 0.16); +} + +/** + * Z-indexes + * -------------------------------------------------------------------------- */ + +:root { + --vp-z-index-footer: 10; + --vp-z-index-local-nav: 20; + --vp-z-index-nav: 30; + --vp-z-index-layout-top: 40; + --vp-z-index-backdrop: 50; + --vp-z-index-sidebar: 60; +} + +@media (min-width: 960px) { + :root { + --vp-z-index-sidebar: 25; + } +} + +/** + * Layouts + * -------------------------------------------------------------------------- */ + +:root { + --vp-layout-max-width: 1440px; +} + +/** + * Component: Header Anchor + * -------------------------------------------------------------------------- */ + +:root { + --vp-header-anchor-symbol: '#'; +} + +/** + * Component: Code + * -------------------------------------------------------------------------- */ + +:root { + --vp-code-line-height: 1.7; + --vp-code-font-size: 0.875em; + --vp-code-color: var(--vp-c-brand-1); + --vp-code-link-color: var(--vp-c-brand-1); + --vp-code-link-hover-color: var(--vp-c-brand-2); + --vp-code-bg: var(--vp-c-default-soft); + + --vp-code-block-color: var(--vp-c-text-2); + --vp-code-block-bg: var(--vp-c-bg-alt); + --vp-code-block-divider-color: var(--vp-c-gutter); + + --vp-code-lang-color: var(--vp-c-text-3); + + --vp-code-line-highlight-color: var(--vp-c-default-soft); + --vp-code-line-number-color: var(--vp-c-text-3); + + --vp-code-line-diff-add-color: var(--vp-c-success-soft); + --vp-code-line-diff-add-symbol-color: var(--vp-c-success-1); + + --vp-code-line-diff-remove-color: var(--vp-c-danger-soft); + --vp-code-line-diff-remove-symbol-color: var(--vp-c-danger-1); + + --vp-code-line-warning-color: var(--vp-c-warning-soft); + --vp-code-line-error-color: var(--vp-c-danger-soft); + + --vp-code-copy-code-border-color: var(--vp-c-divider); + --vp-code-copy-code-bg: var(--vp-c-bg-soft); + --vp-code-copy-code-hover-border-color: var(--vp-c-divider); + --vp-code-copy-code-hover-bg: var(--vp-c-bg); + --vp-code-copy-code-active-text: var(--vp-c-text-2); + --vp-code-copy-copied-text-content: 'Copied'; + + --vp-code-tab-divider: var(--vp-code-block-divider-color); + --vp-code-tab-text-color: var(--vp-c-text-2); + --vp-code-tab-bg: var(--vp-code-block-bg); + --vp-code-tab-hover-text-color: var(--vp-c-text-1); + --vp-code-tab-active-text-color: var(--vp-c-text-1); + --vp-code-tab-active-bar-color: var(--vp-c-brand-1); +} + +:lang(es), +:lang(pt) { + --vp-code-copy-copied-text-content: 'Copiado'; +} +:lang(fa) { + --vp-code-copy-copied-text-content: 'کپی شد'; +} +:lang(ko) { + --vp-code-copy-copied-text-content: '복사됨'; +} +:lang(ru) { + --vp-code-copy-copied-text-content: 'Скопировано'; +} +:lang(zh) { + --vp-code-copy-copied-text-content: '已复制'; +} + +/** + * Component: Button + * -------------------------------------------------------------------------- */ + +:root { + --vp-button-brand-border: transparent; + --vp-button-brand-text: var(--vp-c-white); + --vp-button-brand-bg: var(--vp-c-brand-3); + --vp-button-brand-hover-border: transparent; + --vp-button-brand-hover-text: var(--vp-c-white); + --vp-button-brand-hover-bg: var(--vp-c-brand-2); + --vp-button-brand-active-border: transparent; + --vp-button-brand-active-text: var(--vp-c-white); + --vp-button-brand-active-bg: var(--vp-c-brand-1); + + --vp-button-alt-border: transparent; + --vp-button-alt-text: var(--vp-c-text-1); + --vp-button-alt-bg: var(--vp-c-default-3); + --vp-button-alt-hover-border: transparent; + --vp-button-alt-hover-text: var(--vp-c-text-1); + --vp-button-alt-hover-bg: var(--vp-c-default-2); + --vp-button-alt-active-border: transparent; + --vp-button-alt-active-text: var(--vp-c-text-1); + --vp-button-alt-active-bg: var(--vp-c-default-1); + + --vp-button-sponsor-border: var(--vp-c-text-2); + --vp-button-sponsor-text: var(--vp-c-text-2); + --vp-button-sponsor-bg: transparent; + --vp-button-sponsor-hover-border: var(--vp-c-sponsor); + --vp-button-sponsor-hover-text: var(--vp-c-sponsor); + --vp-button-sponsor-hover-bg: transparent; + --vp-button-sponsor-active-border: var(--vp-c-sponsor); + --vp-button-sponsor-active-text: var(--vp-c-sponsor); + --vp-button-sponsor-active-bg: transparent; +} + +/** + * Component: Custom Block + * -------------------------------------------------------------------------- */ + +:root { + --vp-custom-block-font-size: 14px; + --vp-custom-block-code-font-size: 13px; + + --vp-custom-block-info-border: transparent; + --vp-custom-block-info-text: var(--vp-c-text-1); + --vp-custom-block-info-bg: var(--vp-c-default-soft); + --vp-custom-block-info-code-bg: var(--vp-c-default-soft); + + --vp-custom-block-note-border: transparent; + --vp-custom-block-note-text: var(--vp-c-text-1); + --vp-custom-block-note-bg: var(--vp-c-default-soft); + --vp-custom-block-note-code-bg: var(--vp-c-default-soft); + + --vp-custom-block-tip-border: transparent; + --vp-custom-block-tip-text: var(--vp-c-text-1); + --vp-custom-block-tip-bg: var(--vp-c-tip-soft); + --vp-custom-block-tip-code-bg: var(--vp-c-tip-soft); + + --vp-custom-block-important-border: transparent; + --vp-custom-block-important-text: var(--vp-c-text-1); + --vp-custom-block-important-bg: var(--vp-c-important-soft); + --vp-custom-block-important-code-bg: var(--vp-c-important-soft); + + --vp-custom-block-warning-border: transparent; + --vp-custom-block-warning-text: var(--vp-c-text-1); + --vp-custom-block-warning-bg: var(--vp-c-warning-soft); + --vp-custom-block-warning-code-bg: var(--vp-c-warning-soft); + + --vp-custom-block-danger-border: transparent; + --vp-custom-block-danger-text: var(--vp-c-text-1); + --vp-custom-block-danger-bg: var(--vp-c-danger-soft); + --vp-custom-block-danger-code-bg: var(--vp-c-danger-soft); + + --vp-custom-block-caution-border: transparent; + --vp-custom-block-caution-text: var(--vp-c-text-1); + --vp-custom-block-caution-bg: var(--vp-c-caution-soft); + --vp-custom-block-caution-code-bg: var(--vp-c-caution-soft); + + --vp-custom-block-details-border: var(--vp-custom-block-info-border); + --vp-custom-block-details-text: var(--vp-custom-block-info-text); + --vp-custom-block-details-bg: var(--vp-custom-block-info-bg); + --vp-custom-block-details-code-bg: var(--vp-custom-block-info-code-bg); +} + +/** + * Component: Input + * -------------------------------------------------------------------------- */ + +:root { + --vp-input-border-color: var(--vp-c-border); + --vp-input-bg-color: var(--vp-c-bg-alt); + + --vp-input-switch-bg-color: var(--vp-c-default-soft); +} + +/** + * Component: Nav + * -------------------------------------------------------------------------- */ + +:root { + --vp-nav-height: 64px; + --vp-nav-bg-color: var(--vp-c-bg); + --vp-nav-screen-bg-color: var(--vp-c-bg); + --vp-nav-logo-height: 24px; +} + +.hide-nav { + --vp-nav-height: 0px; +} + +.hide-nav .VPSidebar { + --vp-nav-height: 22px; +} + +/** + * Component: Local Nav + * -------------------------------------------------------------------------- */ + +:root { + --vp-local-nav-bg-color: var(--vp-c-bg); +} + +/** + * Component: Sidebar + * -------------------------------------------------------------------------- */ + +:root { + --vp-sidebar-width: 272px; + --vp-sidebar-bg-color: var(--vp-c-bg-alt); +} + +/** + * Colors Backdrop + * -------------------------------------------------------------------------- */ + +:root { + --vp-backdrop-bg-color: rgba(0, 0, 0, 0.6); +} + +/** + * Component: Home + * -------------------------------------------------------------------------- */ + +:root { + --vp-home-hero-name-color: var(--vp-c-brand-1); + --vp-home-hero-name-background: transparent; + + --vp-home-hero-image-background-image: none; + --vp-home-hero-image-filter: none; +} + +/** + * Component: Badge + * -------------------------------------------------------------------------- */ + +:root { + --vp-badge-info-border: transparent; + --vp-badge-info-text: var(--vp-c-text-2); + --vp-badge-info-bg: var(--vp-c-default-soft); + + --vp-badge-tip-border: transparent; + --vp-badge-tip-text: var(--vp-c-tip-1); + --vp-badge-tip-bg: var(--vp-c-tip-soft); + + --vp-badge-warning-border: transparent; + --vp-badge-warning-text: var(--vp-c-warning-1); + --vp-badge-warning-bg: var(--vp-c-warning-soft); + + --vp-badge-danger-border: transparent; + --vp-badge-danger-text: var(--vp-c-danger-1); + --vp-badge-danger-bg: var(--vp-c-danger-soft); +} + +/** + * Component: Carbon Ads + * -------------------------------------------------------------------------- */ + +:root { + --vp-carbon-ads-text-color: var(--vp-c-text-1); + --vp-carbon-ads-poweredby-color: var(--vp-c-text-2); + --vp-carbon-ads-bg-color: var(--vp-c-bg-soft); + --vp-carbon-ads-hover-text-color: var(--vp-c-brand-1); + --vp-carbon-ads-hover-poweredby-color: var(--vp-c-text-1); +} + +/** + * Component: Local Search + * -------------------------------------------------------------------------- */ + +:root { + --vp-local-search-bg: var(--vp-c-bg); + --vp-local-search-result-bg: var(--vp-c-bg); + --vp-local-search-result-border: var(--vp-c-divider); + --vp-local-search-result-selected-bg: var(--vp-c-bg); + --vp-local-search-result-selected-border: var(--vp-c-brand-1); + --vp-local-search-highlight-bg: var(--vp-c-brand-1); + --vp-local-search-highlight-text: var(--vp-c-neutral-inverse); +} +@media (prefers-reduced-motion: reduce) { + *, + ::before, + ::after { + animation-delay: -1ms !important; + animation-duration: 1ms !important; + animation-iteration-count: 1 !important; + background-attachment: initial !important; + scroll-behavior: auto !important; + transition-duration: 0s !important; + transition-delay: 0s !important; + } +} + +*, +::before, +::after { + box-sizing: border-box; +} + +html { + line-height: 1.4; + font-size: 16px; + -webkit-text-size-adjust: 100%; +} + +html.dark { + color-scheme: dark; +} + +body { + margin: 0; + width: 100%; + min-width: 320px; + min-height: 100vh; + line-height: 24px; + font-family: var(--vp-font-family-base); + font-size: 16px; + font-weight: 400; + color: var(--vp-c-text-1); + background-color: var(--vp-c-bg); + font-synthesis: style; + text-rendering: optimizeLegibility; + -webkit-font-smoothing: antialiased; + -moz-osx-font-smoothing: grayscale; +} + +main { + display: block; +} + +h1, +h2, +h3, +h4, +h5, +h6 { + margin: 0; + line-height: 24px; + font-size: 16px; + font-weight: 400; +} + +p { + margin: 0; +} + +strong, +b { + font-weight: 600; +} + +/** + * Avoid 300ms click delay on touch devices that support the `touch-action` + * CSS property. + * + * In particular, unlike most other browsers, IE11+Edge on Windows 10 on + * touch devices and IE Mobile 10-11 DON'T remove the click delay when + * `` is present. + * However, they DO support removing the click delay via + * `touch-action: manipulation`. + * + * See: + * - http://v4-alpha.getbootstrap.com/content/reboot/#click-delay-optimization-for-touch + * - http://caniuse.com/#feat=css-touch-action + * - http://patrickhlauke.github.io/touch/tests/results/#suppressing-300ms-delay + */ +a, +area, +button, +[role='button'], +input, +label, +select, +summary, +textarea { + touch-action: manipulation; +} + +a { + color: inherit; + text-decoration: inherit; +} + +ol, +ul { + list-style: none; + margin: 0; + padding: 0; +} + +blockquote { + margin: 0; +} + +pre, +code, +kbd, +samp { + font-family: var(--vp-font-family-mono); +} + +img, +svg, +video, +canvas, +audio, +iframe, +embed, +object { + display: block; +} + +figure { + margin: 0; +} + +img, +video { + max-width: 100%; + height: auto; +} + +button, +input, +optgroup, +select, +textarea { + border: 0; + padding: 0; + line-height: inherit; + color: inherit; +} + +button { + padding: 0; + font-family: inherit; + background-color: transparent; + background-image: none; +} + +button:enabled, +[role='button']:enabled { + cursor: pointer; +} + +button:focus, +button:focus-visible { + outline: 1px dotted; + outline: 4px auto -webkit-focus-ring-color; +} + +button:focus:not(:focus-visible) { + outline: none !important; +} + +input:focus, +textarea:focus, +select:focus { + outline: none; +} + +table { + border-collapse: collapse; +} + +input { + background-color: transparent; +} + +input:-ms-input-placeholder, +textarea:-ms-input-placeholder { + color: var(--vp-c-text-3); +} + +input::-ms-input-placeholder, +textarea::-ms-input-placeholder { + color: var(--vp-c-text-3); +} + +input::placeholder, +textarea::placeholder { + color: var(--vp-c-text-3); +} + +input::-webkit-outer-spin-button, +input::-webkit-inner-spin-button { + -webkit-appearance: none; + margin: 0; +} + +input[type='number'] { + -moz-appearance: textfield; +} + +textarea { + resize: vertical; +} + +select { + -webkit-appearance: none; +} + +fieldset { + margin: 0; + padding: 0; +} + +h1, +h2, +h3, +h4, +h5, +h6, +li, +p { + overflow-wrap: break-word; +} + +vite-error-overlay { + z-index: 9999; +} + +mjx-container { + overflow-x: auto; +} + +mjx-container > svg { + display: inline-block; + margin: auto; +} +[class^='vpi-'], +[class*=' vpi-'], +.vp-icon { + width: 1em; + height: 1em; +} +[class^='vpi-'].bg, +[class*=' vpi-'].bg, +.vp-icon.bg { + background-size: 100% 100%; + background-color: transparent; +} +[class^='vpi-']:not(.bg), +[class*=' vpi-']:not(.bg), +.vp-icon:not(.bg) { + -webkit-mask: var(--icon) no-repeat; + mask: var(--icon) no-repeat; + -webkit-mask-size: 100% 100%; + mask-size: 100% 100%; + background-color: currentColor; + color: inherit; +} + +/* internal icons - used under ISC from https://lucide.dev/ */ +.vpi-align-left { + --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' stroke='currentColor' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' viewBox='0 0 24 24'%3E%3Cpath d='M21 6H3M15 12H3M17 18H3'/%3E%3C/svg%3E"); +} +.vpi-arrow-right, +.vpi-arrow-down, +.vpi-arrow-left, +.vpi-arrow-up { + --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' stroke='currentColor' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' viewBox='0 0 24 24'%3E%3Cpath d='M5 12h14M12 5l7 7-7 7'/%3E%3C/svg%3E"); +} +.vpi-chevron-right, +.vpi-chevron-down, +.vpi-chevron-left, +.vpi-chevron-up { + --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' stroke='currentColor' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' viewBox='0 0 24 24'%3E%3Cpath d='m9 18 6-6-6-6'/%3E%3C/svg%3E"); +} +.vpi-chevron-down, +.vpi-arrow-down { + /*rtl:ignore*/ + transform: rotate(90deg); +} +.vpi-chevron-left, +.vpi-arrow-left { + /*rtl:ignore*/ + transform: rotate(180deg); +} +.vpi-chevron-up, +.vpi-arrow-up { + /*rtl:ignore*/ + transform: rotate(-90deg); +} +.vpi-square-pen { + --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' stroke='currentColor' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' viewBox='0 0 24 24'%3E%3Cpath d='M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7'/%3E%3Cpath d='M18.375 2.625a2.121 2.121 0 1 1 3 3L12 15l-4 1 1-4Z'/%3E%3C/svg%3E"); +} +.vpi-plus { + --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' stroke='currentColor' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' viewBox='0 0 24 24'%3E%3Cpath d='M5 12h14M12 5v14'/%3E%3C/svg%3E"); +} +.vpi-sun { + --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' stroke='currentColor' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' viewBox='0 0 24 24'%3E%3Ccircle cx='12' cy='12' r='4'/%3E%3Cpath d='M12 2v2M12 20v2M4.93 4.93l1.41 1.41M17.66 17.66l1.41 1.41M2 12h2M20 12h2M6.34 17.66l-1.41 1.41M19.07 4.93l-1.41 1.41'/%3E%3C/svg%3E"); +} +.vpi-moon { + --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' stroke='currentColor' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' viewBox='0 0 24 24'%3E%3Cpath d='M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z'/%3E%3C/svg%3E"); +} +.vpi-more-horizontal { + --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' stroke='currentColor' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' viewBox='0 0 24 24'%3E%3Ccircle cx='12' cy='12' r='1'/%3E%3Ccircle cx='19' cy='12' r='1'/%3E%3Ccircle cx='5' cy='12' r='1'/%3E%3C/svg%3E"); +} +.vpi-languages { + --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' stroke='currentColor' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' viewBox='0 0 24 24'%3E%3Cpath d='m5 8 6 6M4 14l6-6 2-3M2 5h12M7 2h1M22 22l-5-10-5 10M14 18h6'/%3E%3C/svg%3E"); +} +.vpi-heart { + --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' stroke='currentColor' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' viewBox='0 0 24 24'%3E%3Cpath d='M19 14c1.49-1.46 3-3.21 3-5.5A5.5 5.5 0 0 0 16.5 3c-1.76 0-3 .5-4.5 2-1.5-1.5-2.74-2-4.5-2A5.5 5.5 0 0 0 2 8.5c0 2.3 1.5 4.05 3 5.5l7 7Z'/%3E%3C/svg%3E"); +} +.vpi-search { + --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' stroke='currentColor' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' viewBox='0 0 24 24'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cpath d='m21 21-4.3-4.3'/%3E%3C/svg%3E"); +} +.vpi-layout-list { + --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' stroke='currentColor' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' viewBox='0 0 24 24'%3E%3Crect width='7' height='7' x='3' y='3' rx='1'/%3E%3Crect width='7' height='7' x='3' y='14' rx='1'/%3E%3Cpath d='M14 4h7M14 9h7M14 15h7M14 20h7'/%3E%3C/svg%3E"); +} +.vpi-delete { + --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' stroke='currentColor' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' viewBox='0 0 24 24'%3E%3Cpath d='M20 5H9l-7 7 7 7h11a2 2 0 0 0 2-2V7a2 2 0 0 0-2-2ZM18 9l-6 6M12 9l6 6'/%3E%3C/svg%3E"); +} +.vpi-corner-down-left { + --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' stroke='currentColor' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' viewBox='0 0 24 24'%3E%3Cpath d='m9 10-5 5 5 5'/%3E%3Cpath d='M20 4v7a4 4 0 0 1-4 4H4'/%3E%3C/svg%3E"); +} +:root { + /* clipboard */ + --vp-icon-copy: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' stroke='rgba(128,128,128,1)' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' viewBox='0 0 24 24'%3E%3Crect width='8' height='4' x='8' y='2' rx='1' ry='1'/%3E%3Cpath d='M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2'/%3E%3C/svg%3E"); + /* clipboard-copy */ + --vp-icon-copied: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' stroke='rgba(128,128,128,1)' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' viewBox='0 0 24 24'%3E%3Crect width='8' height='4' x='8' y='2' rx='1' ry='1'/%3E%3Cpath d='M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2'/%3E%3Cpath d='m9 14 2 2 4-4'/%3E%3C/svg%3E"); +} +.visually-hidden { + position: absolute; + width: 1px; + height: 1px; + white-space: nowrap; + clip: rect(0 0 0 0); + clip-path: inset(50%); + overflow: hidden; +} +.custom-block { + border: 1px solid transparent; + border-radius: 8px; + padding: 16px 16px 8px; + line-height: 24px; + font-size: var(--vp-custom-block-font-size); + color: var(--vp-c-text-2); +} + +.custom-block.info { + border-color: var(--vp-custom-block-info-border); + color: var(--vp-custom-block-info-text); + background-color: var(--vp-custom-block-info-bg); +} + +.custom-block.info a, +.custom-block.info code { + color: var(--vp-c-brand-1); +} + +.custom-block.info a:hover, +.custom-block.info a:hover > code { + color: var(--vp-c-brand-2); +} + +.custom-block.info code { + background-color: var(--vp-custom-block-info-code-bg); +} + +.custom-block.note { + border-color: var(--vp-custom-block-note-border); + color: var(--vp-custom-block-note-text); + background-color: var(--vp-custom-block-note-bg); +} + +.custom-block.note a, +.custom-block.note code { + color: var(--vp-c-brand-1); +} + +.custom-block.note a:hover, +.custom-block.note a:hover > code { + color: var(--vp-c-brand-2); +} + +.custom-block.note code { + background-color: var(--vp-custom-block-note-code-bg); +} + +.custom-block.tip { + border-color: var(--vp-custom-block-tip-border); + color: var(--vp-custom-block-tip-text); + background-color: var(--vp-custom-block-tip-bg); +} + +.custom-block.tip a, +.custom-block.tip code { + color: var(--vp-c-tip-1); +} + +.custom-block.tip a:hover, +.custom-block.tip a:hover > code { + color: var(--vp-c-tip-2); +} + +.custom-block.tip code { + background-color: var(--vp-custom-block-tip-code-bg); +} + +.custom-block.important { + border-color: var(--vp-custom-block-important-border); + color: var(--vp-custom-block-important-text); + background-color: var(--vp-custom-block-important-bg); +} + +.custom-block.important a, +.custom-block.important code { + color: var(--vp-c-important-1); +} + +.custom-block.important a:hover, +.custom-block.important a:hover > code { + color: var(--vp-c-important-2); +} + +.custom-block.important code { + background-color: var(--vp-custom-block-important-code-bg); +} + +.custom-block.warning { + border-color: var(--vp-custom-block-warning-border); + color: var(--vp-custom-block-warning-text); + background-color: var(--vp-custom-block-warning-bg); +} + +.custom-block.warning a, +.custom-block.warning code { + color: var(--vp-c-warning-1); +} + +.custom-block.warning a:hover, +.custom-block.warning a:hover > code { + color: var(--vp-c-warning-2); +} + +.custom-block.warning code { + background-color: var(--vp-custom-block-warning-code-bg); +} + +.custom-block.danger { + border-color: var(--vp-custom-block-danger-border); + color: var(--vp-custom-block-danger-text); + background-color: var(--vp-custom-block-danger-bg); +} + +.custom-block.danger a, +.custom-block.danger code { + color: var(--vp-c-danger-1); +} + +.custom-block.danger a:hover, +.custom-block.danger a:hover > code { + color: var(--vp-c-danger-2); +} + +.custom-block.danger code { + background-color: var(--vp-custom-block-danger-code-bg); +} + +.custom-block.caution { + border-color: var(--vp-custom-block-caution-border); + color: var(--vp-custom-block-caution-text); + background-color: var(--vp-custom-block-caution-bg); +} + +.custom-block.caution a, +.custom-block.caution code { + color: var(--vp-c-caution-1); +} + +.custom-block.caution a:hover, +.custom-block.caution a:hover > code { + color: var(--vp-c-caution-2); +} + +.custom-block.caution code { + background-color: var(--vp-custom-block-caution-code-bg); +} + +.custom-block.details { + border-color: var(--vp-custom-block-details-border); + color: var(--vp-custom-block-details-text); + background-color: var(--vp-custom-block-details-bg); +} + +.custom-block.details a { + color: var(--vp-c-brand-1); +} + +.custom-block.details a:hover, +.custom-block.details a:hover > code { + color: var(--vp-c-brand-2); +} + +.custom-block.details code { + background-color: var(--vp-custom-block-details-code-bg); +} + +.custom-block-title { + font-weight: 600; +} + +.custom-block p + p { + margin: 8px 0; +} + +.custom-block.details summary { + margin: 0 0 8px; + font-weight: 700; + cursor: pointer; + user-select: none; +} + +.custom-block.details summary + p { + margin: 8px 0; +} + +.custom-block a { + color: inherit; + font-weight: 600; + text-decoration: underline; + text-underline-offset: 2px; + transition: opacity 0.25s; +} + +.custom-block a:hover { + opacity: 0.75; +} + +.custom-block code { + font-size: var(--vp-custom-block-code-font-size); +} + +.custom-block.custom-block th, +.custom-block.custom-block blockquote > p { + font-size: var(--vp-custom-block-font-size); + color: inherit; +} +.dark .vp-code span { + color: var(--shiki-dark, inherit); +} + +html:not(.dark) .vp-code span { + color: var(--shiki-light, inherit); +} +.vp-code-group { + margin-top: 16px; +} + +.vp-code-group .tabs { + position: relative; + display: flex; + margin-right: -24px; + margin-left: -24px; + padding: 0 12px; + background-color: var(--vp-code-tab-bg); + overflow-x: auto; + overflow-y: hidden; + box-shadow: inset 0 -1px var(--vp-code-tab-divider); +} + +@media (min-width: 640px) { + .vp-code-group .tabs { + margin-right: 0; + margin-left: 0; + border-radius: 8px 8px 0 0; + } +} + +.vp-code-group .tabs input { + position: fixed; + opacity: 0; + pointer-events: none; +} + +.vp-code-group .tabs label { + position: relative; + display: inline-block; + border-bottom: 1px solid transparent; + padding: 0 12px; + line-height: 48px; + font-size: 14px; + font-weight: 500; + color: var(--vp-code-tab-text-color); + white-space: nowrap; + cursor: pointer; + transition: color 0.25s; +} + +.vp-code-group .tabs label::after { + position: absolute; + right: 8px; + bottom: -1px; + left: 8px; + z-index: 1; + height: 2px; + border-radius: 2px; + content: ''; + background-color: transparent; + transition: background-color 0.25s; +} + +.vp-code-group label:hover { + color: var(--vp-code-tab-hover-text-color); +} + +.vp-code-group input:checked + label { + color: var(--vp-code-tab-active-text-color); +} + +.vp-code-group input:checked + label::after { + background-color: var(--vp-code-tab-active-bar-color); +} + +.vp-code-group div[class*='language-'], +.vp-block { + display: none; + margin-top: 0 !important; + border-top-left-radius: 0 !important; + border-top-right-radius: 0 !important; +} + +.vp-code-group div[class*='language-'].active, +.vp-block.active { + display: block; +} + +.vp-block { + padding: 20px 24px; +} +/** + * Headings + * -------------------------------------------------------------------------- */ + +.vp-doc h1, +.vp-doc h2, +.vp-doc h3, +.vp-doc h4, +.vp-doc h5, +.vp-doc h6 { + position: relative; + font-weight: 600; + outline: none; +} + +.vp-doc h1 { + letter-spacing: -0.02em; + line-height: 40px; + font-size: 28px; +} + +.vp-doc h2 { + margin: 48px 0 16px; + border-top: 1px solid var(--vp-c-divider); + padding-top: 24px; + letter-spacing: -0.02em; + line-height: 32px; + font-size: 24px; +} + +.vp-doc h3 { + margin: 32px 0 0; + letter-spacing: -0.01em; + line-height: 28px; + font-size: 20px; +} + +.vp-doc h4 { + margin: 24px 0 0; + letter-spacing: -0.01em; + line-height: 24px; + font-size: 18px; +} + +.vp-doc .header-anchor { + position: absolute; + top: 0; + left: 0; + margin-left: -0.87em; + font-weight: 500; + user-select: none; + opacity: 0; + text-decoration: none; + transition: + color 0.25s, + opacity 0.25s; +} + +.vp-doc .header-anchor:before { + content: var(--vp-header-anchor-symbol); +} + +.vp-doc h1:hover .header-anchor, +.vp-doc h1 .header-anchor:focus, +.vp-doc h2:hover .header-anchor, +.vp-doc h2 .header-anchor:focus, +.vp-doc h3:hover .header-anchor, +.vp-doc h3 .header-anchor:focus, +.vp-doc h4:hover .header-anchor, +.vp-doc h4 .header-anchor:focus, +.vp-doc h5:hover .header-anchor, +.vp-doc h5 .header-anchor:focus, +.vp-doc h6:hover .header-anchor, +.vp-doc h6 .header-anchor:focus { + opacity: 1; +} + +@media (min-width: 768px) { + .vp-doc h1 { + letter-spacing: -0.02em; + line-height: 40px; + font-size: 32px; + } +} + +.vp-doc h2 .header-anchor { + top: 24px; +} + +/** + * Paragraph and inline elements + * -------------------------------------------------------------------------- */ + +.vp-doc p, +.vp-doc summary { + margin: 16px 0; +} + +.vp-doc p { + line-height: 28px; +} + +.vp-doc blockquote { + margin: 16px 0; + border-left: 2px solid var(--vp-c-divider); + padding-left: 16px; + transition: border-color 0.5s; + color: var(--vp-c-text-2); +} + +.vp-doc blockquote > p { + margin: 0; + font-size: 16px; + transition: color 0.5s; +} + +.vp-doc a { + font-weight: 500; + color: var(--vp-c-brand-1); + text-decoration: underline; + text-underline-offset: 2px; + transition: + color 0.25s, + opacity 0.25s; +} + +.vp-doc a:hover { + color: var(--vp-c-brand-2); +} + +.vp-doc strong { + font-weight: 600; +} + +/** + * Lists + * -------------------------------------------------------------------------- */ + +.vp-doc ul, +.vp-doc ol { + padding-left: 1.25rem; + margin: 16px 0; +} + +.vp-doc ul { + list-style: disc; +} + +.vp-doc ol { + list-style: decimal; +} + +.vp-doc li + li { + margin-top: 8px; +} + +.vp-doc li > ol, +.vp-doc li > ul { + margin: 8px 0 0; +} + +/** + * Table + * -------------------------------------------------------------------------- */ + +.vp-doc table { + display: block; + border-collapse: collapse; + margin: 20px 0; + overflow-x: auto; +} + +.vp-doc tr { + background-color: var(--vp-c-bg); + border-top: 1px solid var(--vp-c-divider); + transition: background-color 0.5s; +} + +.vp-doc tr:nth-child(2n) { + background-color: var(--vp-c-bg-soft); +} + +.vp-doc th, +.vp-doc td { + border: 1px solid var(--vp-c-divider); + padding: 8px 16px; +} + +.vp-doc th { + text-align: left; + font-size: 14px; + font-weight: 600; + color: var(--vp-c-text-2); + background-color: var(--vp-c-bg-soft); +} + +.vp-doc td { + font-size: 14px; +} + +/** + * Decorational elements + * -------------------------------------------------------------------------- */ + +.vp-doc hr { + margin: 16px 0; + border: none; + border-top: 1px solid var(--vp-c-divider); +} + +/** + * Custom Block + * -------------------------------------------------------------------------- */ + +.vp-doc .custom-block { + margin: 16px 0; +} + +.vp-doc .custom-block p { + margin: 8px 0; + line-height: 24px; +} + +.vp-doc .custom-block p:first-child { + margin: 0; +} + +.vp-doc .custom-block div[class*='language-'] { + margin: 8px 0; + border-radius: 8px; +} + +.vp-doc .custom-block div[class*='language-'] code { + font-weight: 400; + background-color: transparent; +} + +.vp-doc .custom-block .vp-code-group .tabs { + margin: 0; + border-radius: 8px 8px 0 0; +} + +/** + * Code + * -------------------------------------------------------------------------- */ + +/* inline code */ +.vp-doc :not(pre, h1, h2, h3, h4, h5, h6) > code { + font-size: var(--vp-code-font-size); + color: var(--vp-code-color); +} + +.vp-doc :not(pre) > code { + border-radius: 4px; + padding: 3px 6px; + background-color: var(--vp-code-bg); + transition: + color 0.25s, + background-color 0.5s; +} + +.vp-doc a > code { + color: var(--vp-code-link-color); +} + +.vp-doc a:hover > code { + color: var(--vp-code-link-hover-color); +} + +.vp-doc h1 > code, +.vp-doc h2 > code, +.vp-doc h3 > code, +.vp-doc h4 > code { + font-size: 0.9em; +} + +.vp-doc div[class*='language-'], +.vp-block { + position: relative; + margin: 16px -24px; + background-color: var(--vp-code-block-bg); + overflow-x: auto; + transition: background-color 0.5s; +} + +@media (min-width: 640px) { + .vp-doc div[class*='language-'], + .vp-block { + border-radius: 8px; + margin: 16px 0; + } +} + +@media (max-width: 639px) { + .vp-doc li div[class*='language-'] { + border-radius: 8px 0 0 8px; + } +} + +.vp-doc div[class*='language-'] + div[class*='language-'], +.vp-doc div[class$='-api'] + div[class*='language-'], +.vp-doc div[class*='language-'] + div[class$='-api'] > div[class*='language-'] { + margin-top: -8px; +} + +.vp-doc [class*='language-'] pre, +.vp-doc [class*='language-'] code { + /*rtl:ignore*/ + direction: ltr; + /*rtl:ignore*/ + text-align: left; + white-space: pre; + word-spacing: normal; + word-break: normal; + word-wrap: normal; + -moz-tab-size: 4; + -o-tab-size: 4; + tab-size: 4; + -webkit-hyphens: none; + -moz-hyphens: none; + -ms-hyphens: none; + hyphens: none; +} + +.vp-doc [class*='language-'] pre { + position: relative; + z-index: 1; + margin: 0; + padding: 20px 0; + background: transparent; + overflow-x: auto; +} + +.vp-doc [class*='language-'] code { + display: block; + padding: 0 24px; + width: fit-content; + min-width: 100%; + line-height: var(--vp-code-line-height); + font-size: var(--vp-code-font-size); + color: var(--vp-code-block-color); + transition: color 0.5s; +} + +.vp-doc [class*='language-'] code .highlighted { + background-color: var(--vp-code-line-highlight-color); + transition: background-color 0.5s; + margin: 0 -24px; + padding: 0 24px; + width: calc(100% + 2 * 24px); + display: inline-block; +} + +.vp-doc [class*='language-'] code .highlighted.error { + background-color: var(--vp-code-line-error-color); +} + +.vp-doc [class*='language-'] code .highlighted.warning { + background-color: var(--vp-code-line-warning-color); +} + +.vp-doc [class*='language-'] code .diff { + transition: background-color 0.5s; + margin: 0 -24px; + padding: 0 24px; + width: calc(100% + 2 * 24px); + display: inline-block; +} + +.vp-doc [class*='language-'] code .diff::before { + position: absolute; + left: 10px; +} + +.vp-doc [class*='language-'] .has-focused-lines .line:not(.has-focus) { + filter: blur(0.095rem); + opacity: 0.4; + transition: + filter 0.35s, + opacity 0.35s; +} + +.vp-doc [class*='language-'] .has-focused-lines .line:not(.has-focus) { + opacity: 0.7; + transition: + filter 0.35s, + opacity 0.35s; +} + +.vp-doc [class*='language-']:hover .has-focused-lines .line:not(.has-focus) { + filter: blur(0); + opacity: 1; +} + +.vp-doc [class*='language-'] code .diff.remove { + background-color: var(--vp-code-line-diff-remove-color); + opacity: 0.7; +} + +.vp-doc [class*='language-'] code .diff.remove::before { + content: '-'; + color: var(--vp-code-line-diff-remove-symbol-color); +} + +.vp-doc [class*='language-'] code .diff.add { + background-color: var(--vp-code-line-diff-add-color); +} + +.vp-doc [class*='language-'] code .diff.add::before { + content: '+'; + color: var(--vp-code-line-diff-add-symbol-color); +} + +.vp-doc div[class*='language-'].line-numbers-mode { + /*rtl:ignore*/ + padding-left: 32px; +} + +.vp-doc .line-numbers-wrapper { + position: absolute; + top: 0; + bottom: 0; + /*rtl:ignore*/ + left: 0; + z-index: 3; + /*rtl:ignore*/ + border-right: 1px solid var(--vp-code-block-divider-color); + padding-top: 20px; + width: 32px; + text-align: center; + font-family: var(--vp-font-family-mono); + line-height: var(--vp-code-line-height); + font-size: var(--vp-code-font-size); + color: var(--vp-code-line-number-color); + transition: + border-color 0.5s, + color 0.5s; +} + +.vp-doc [class*='language-'] > button.copy { + /*rtl:ignore*/ + direction: ltr; + position: absolute; + top: 12px; + /*rtl:ignore*/ + right: 12px; + z-index: 3; + border: 1px solid var(--vp-code-copy-code-border-color); + border-radius: 4px; + width: 40px; + height: 40px; + background-color: var(--vp-code-copy-code-bg); + opacity: 0; + cursor: pointer; + background-image: var(--vp-icon-copy); + background-position: 50%; + background-size: 20px; + background-repeat: no-repeat; + transition: + border-color 0.25s, + background-color 0.25s, + opacity 0.25s; +} + +.vp-doc [class*='language-']:hover > button.copy, +.vp-doc [class*='language-'] > button.copy:focus { + opacity: 1; +} + +.vp-doc [class*='language-'] > button.copy:hover, +.vp-doc [class*='language-'] > button.copy.copied { + border-color: var(--vp-code-copy-code-hover-border-color); + background-color: var(--vp-code-copy-code-hover-bg); +} + +.vp-doc [class*='language-'] > button.copy.copied, +.vp-doc [class*='language-'] > button.copy:hover.copied { + /*rtl:ignore*/ + border-radius: 0 4px 4px 0; + background-color: var(--vp-code-copy-code-hover-bg); + background-image: var(--vp-icon-copied); +} + +.vp-doc [class*='language-'] > button.copy.copied::before, +.vp-doc [class*='language-'] > button.copy:hover.copied::before { + position: relative; + top: -1px; + /*rtl:ignore*/ + transform: translateX(calc(-100% - 1px)); + display: flex; + justify-content: center; + align-items: center; + border: 1px solid var(--vp-code-copy-code-hover-border-color); + /*rtl:ignore*/ + border-right: 0; + /*rtl:ignore*/ + border-radius: 4px 0 0 4px; + padding: 0 10px; + width: fit-content; + height: 40px; + text-align: center; + font-size: 12px; + font-weight: 500; + color: var(--vp-code-copy-code-active-text); + background-color: var(--vp-code-copy-code-hover-bg); + white-space: nowrap; + content: var(--vp-code-copy-copied-text-content); +} + +.vp-doc [class*='language-'] > span.lang { + position: absolute; + top: 2px; + /*rtl:ignore*/ + right: 8px; + z-index: 2; + font-size: 12px; + font-weight: 500; + user-select: none; + color: var(--vp-code-lang-color); + transition: + color 0.4s, + opacity 0.4s; +} + +.vp-doc [class*='language-']:hover > button.copy + span.lang, +.vp-doc [class*='language-'] > button.copy:focus + span.lang { + opacity: 0; +} + +/** + * Component: Team + * -------------------------------------------------------------------------- */ + +.vp-doc .VPTeamMembers { + margin-top: 24px; +} + +.vp-doc .VPTeamMembers.small.count-1 .container { + margin: 0 !important; + max-width: calc((100% - 24px) / 2) !important; +} + +.vp-doc .VPTeamMembers.small.count-2 .container, +.vp-doc .VPTeamMembers.small.count-3 .container { + max-width: 100% !important; +} + +.vp-doc .VPTeamMembers.medium.count-1 .container { + margin: 0 !important; + max-width: calc((100% - 24px) / 2) !important; +} + +/** + * External links + * -------------------------------------------------------------------------- */ + +/* prettier-ignore */ +:is(.vp-external-link-icon, .vp-doc a[href*='://'], .vp-doc a[target='_blank']):not(:is(.no-icon, svg a, :has(img, svg)))::after { + display: inline-block; + margin-top: -1px; + margin-left: 4px; + width: 11px; + height: 11px; + background: currentColor; + color: var(--vp-c-text-3); + flex-shrink: 0; + --icon: url("data:image/svg+xml, %3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' %3E%3Cpath d='M0 0h24v24H0V0z' fill='none' /%3E%3Cpath d='M9 5v2h6.59L4 18.59 5.41 20 17 8.41V15h2V5H9z' /%3E%3C/svg%3E"); + -webkit-mask-image: var(--icon); + mask-image: var(--icon); + /*rtl:raw:transform: scaleX(-1);*/ +} + +.vp-external-link-icon::after { + content: ''; +} + +/* prettier-ignore */ +.external-link-icon-enabled :is(.vp-doc a[href*='://'], .vp-doc a[target='_blank']):not(:is(.no-icon, svg a, :has(img, svg)))::after { + content: ''; + color: currentColor; +} +/** + * VPSponsors styles are defined as global because a new class gets + * allied in onMounted` hook and we can't use scoped style. + */ +.vp-sponsor { + border-radius: 16px; + overflow: hidden; +} + +.vp-sponsor.aside { + border-radius: 12px; +} + +.vp-sponsor-section + .vp-sponsor-section { + margin-top: 4px; +} + +.vp-sponsor-tier { + margin: 0 0 4px !important; + text-align: center; + letter-spacing: 1px !important; + line-height: 24px; + width: 100%; + font-weight: 600; + color: var(--vp-c-text-2); + background-color: var(--vp-c-bg-soft); +} + +.vp-sponsor.normal .vp-sponsor-tier { + padding: 13px 0 11px; + font-size: 14px; +} + +.vp-sponsor.aside .vp-sponsor-tier { + padding: 9px 0 7px; + font-size: 12px; +} + +.vp-sponsor-grid + .vp-sponsor-tier { + margin-top: 4px; +} + +.vp-sponsor-grid { + display: flex; + flex-wrap: wrap; + gap: 4px; +} + +.vp-sponsor-grid.xmini .vp-sponsor-grid-link { + height: 64px; +} +.vp-sponsor-grid.xmini .vp-sponsor-grid-image { + max-width: 64px; + max-height: 22px; +} + +.vp-sponsor-grid.mini .vp-sponsor-grid-link { + height: 72px; +} +.vp-sponsor-grid.mini .vp-sponsor-grid-image { + max-width: 96px; + max-height: 24px; +} + +.vp-sponsor-grid.small .vp-sponsor-grid-link { + height: 96px; +} +.vp-sponsor-grid.small .vp-sponsor-grid-image { + max-width: 96px; + max-height: 24px; +} + +.vp-sponsor-grid.medium .vp-sponsor-grid-link { + height: 112px; +} +.vp-sponsor-grid.medium .vp-sponsor-grid-image { + max-width: 120px; + max-height: 36px; +} + +.vp-sponsor-grid.big .vp-sponsor-grid-link { + height: 184px; +} +.vp-sponsor-grid.big .vp-sponsor-grid-image { + max-width: 192px; + max-height: 56px; +} + +.vp-sponsor-grid[data-vp-grid='2'] .vp-sponsor-grid-item { + width: calc((100% - 4px) / 2); +} + +.vp-sponsor-grid[data-vp-grid='3'] .vp-sponsor-grid-item { + width: calc((100% - 4px * 2) / 3); +} + +.vp-sponsor-grid[data-vp-grid='4'] .vp-sponsor-grid-item { + width: calc((100% - 4px * 3) / 4); +} + +.vp-sponsor-grid[data-vp-grid='5'] .vp-sponsor-grid-item { + width: calc((100% - 4px * 4) / 5); +} + +.vp-sponsor-grid[data-vp-grid='6'] .vp-sponsor-grid-item { + width: calc((100% - 4px * 5) / 6); +} + +.vp-sponsor-grid-item { + flex-shrink: 0; + width: 100%; + background-color: var(--vp-c-bg-soft); + transition: background-color 0.25s; +} + +.vp-sponsor-grid-item:hover { + background-color: var(--vp-c-default-soft); +} + +.vp-sponsor-grid-item:hover .vp-sponsor-grid-image { + filter: grayscale(0) invert(0); +} + +.vp-sponsor-grid-item.empty:hover { + background-color: var(--vp-c-bg-soft); +} + +.dark .vp-sponsor-grid-item:hover { + background-color: var(--vp-c-white); +} + +.dark .vp-sponsor-grid-item.empty:hover { + background-color: var(--vp-c-bg-soft); +} + +.vp-sponsor-grid-link { + display: flex; +} + +.vp-sponsor-grid-box { + display: flex; + justify-content: center; + align-items: center; + width: 100%; +} + +.vp-sponsor-grid-image { + max-width: 100%; + filter: grayscale(1); + transition: filter 0.25s; +} + +.dark .vp-sponsor-grid-image { + filter: grayscale(1) invert(1); +} + +.VPBadge { + display: inline-block; + margin-left: 2px; + border: 1px solid transparent; + border-radius: 12px; + padding: 0 10px; + line-height: 22px; + font-size: 12px; + font-weight: 500; + transform: translateY(-2px); +} +.VPBadge.small { + padding: 0 6px; + line-height: 18px; + font-size: 10px; + transform: translateY(-8px); +} +.VPDocFooter .VPBadge { + display: none; +} +.vp-doc h1 > .VPBadge { + margin-top: 4px; + vertical-align: top; +} +.vp-doc h2 > .VPBadge { + margin-top: 3px; + padding: 0 8px; + vertical-align: top; +} +.vp-doc h3 > .VPBadge { + vertical-align: middle; +} +.vp-doc h4 > .VPBadge, +.vp-doc h5 > .VPBadge, +.vp-doc h6 > .VPBadge { + vertical-align: middle; + line-height: 18px; +} +.VPBadge.info { + border-color: var(--vp-badge-info-border); + color: var(--vp-badge-info-text); + background-color: var(--vp-badge-info-bg); +} +.VPBadge.tip { + border-color: var(--vp-badge-tip-border); + color: var(--vp-badge-tip-text); + background-color: var(--vp-badge-tip-bg); +} +.VPBadge.warning { + border-color: var(--vp-badge-warning-border); + color: var(--vp-badge-warning-text); + background-color: var(--vp-badge-warning-bg); +} +.VPBadge.danger { + border-color: var(--vp-badge-danger-border); + color: var(--vp-badge-danger-text); + background-color: var(--vp-badge-danger-bg); +} + +.VPBackdrop[data-v-c79a1216] { + position: fixed; + top: 0; + /*rtl:ignore*/ + right: 0; + bottom: 0; + /*rtl:ignore*/ + left: 0; + z-index: var(--vp-z-index-backdrop); + background: var(--vp-backdrop-bg-color); + transition: opacity 0.5s; +} +.VPBackdrop.fade-enter-from[data-v-c79a1216], +.VPBackdrop.fade-leave-to[data-v-c79a1216] { + opacity: 0; +} +.VPBackdrop.fade-leave-active[data-v-c79a1216] { + transition-duration: .25s; +} +@media (min-width: 1280px) { +.VPBackdrop[data-v-c79a1216] { + display: none; +} +} + +.NotFound[data-v-d6be1790] { + padding: 64px 24px 96px; + text-align: center; +} +@media (min-width: 768px) { +.NotFound[data-v-d6be1790] { + padding: 96px 32px 168px; +} +} +.code[data-v-d6be1790] { + line-height: 64px; + font-size: 64px; + font-weight: 600; +} +.title[data-v-d6be1790] { + padding-top: 12px; + letter-spacing: 2px; + line-height: 20px; + font-size: 20px; + font-weight: 700; +} +.divider[data-v-d6be1790] { + margin: 24px auto 18px; + width: 64px; + height: 1px; + background-color: var(--vp-c-divider); +} +.quote[data-v-d6be1790] { + margin: 0 auto; + max-width: 256px; + font-size: 14px; + font-weight: 500; + color: var(--vp-c-text-2); +} +.action[data-v-d6be1790] { + padding-top: 20px; +} +.link[data-v-d6be1790] { + display: inline-block; + border: 1px solid var(--vp-c-brand-1); + border-radius: 16px; + padding: 3px 16px; + font-size: 14px; + font-weight: 500; + color: var(--vp-c-brand-1); + transition: + border-color 0.25s, + color 0.25s; +} +.link[data-v-d6be1790]:hover { + border-color: var(--vp-c-brand-2); + color: var(--vp-c-brand-2); +} + +.root[data-v-b933a997] { + position: relative; + z-index: 1; +} +.nested[data-v-b933a997] { + padding-right: 16px; + padding-left: 16px; +} +.outline-link[data-v-b933a997] { + display: block; + line-height: 32px; + font-size: 14px; + font-weight: 400; + color: var(--vp-c-text-2); + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; + transition: color 0.5s; +} +.outline-link[data-v-b933a997]:hover, +.outline-link.active[data-v-b933a997] { + color: var(--vp-c-text-1); + transition: color 0.25s; +} +.outline-link.nested[data-v-b933a997] { + padding-left: 13px; +} + +.VPDocAsideOutline[data-v-a5bbad30] { + display: none; +} +.VPDocAsideOutline.has-outline[data-v-a5bbad30] { + display: block; +} +.content[data-v-a5bbad30] { + position: relative; + border-left: 1px solid var(--vp-c-divider); + padding-left: 16px; + font-size: 13px; + font-weight: 500; +} +.outline-marker[data-v-a5bbad30] { + position: absolute; + top: 32px; + left: -1px; + z-index: 0; + opacity: 0; + width: 2px; + border-radius: 2px; + height: 18px; + background-color: var(--vp-c-brand-1); + transition: + top 0.25s cubic-bezier(0, 1, 0.5, 1), + background-color 0.5s, + opacity 0.25s; +} +.outline-title[data-v-a5bbad30] { + line-height: 32px; + font-size: 14px; + font-weight: 600; +} + +.VPDocAside[data-v-3f215769] { + display: flex; + flex-direction: column; + flex-grow: 1; +} +.spacer[data-v-3f215769] { + flex-grow: 1; +} +.VPDocAside[data-v-3f215769] .spacer + .VPDocAsideSponsors, +.VPDocAside[data-v-3f215769] .spacer + .VPDocAsideCarbonAds { + margin-top: 24px; +} +.VPDocAside[data-v-3f215769] .VPDocAsideSponsors + .VPDocAsideCarbonAds { + margin-top: 16px; +} + +.VPLastUpdated[data-v-e98dd255] { + line-height: 24px; + font-size: 14px; + font-weight: 500; + color: var(--vp-c-text-2); +} +@media (min-width: 640px) { +.VPLastUpdated[data-v-e98dd255] { + line-height: 32px; + font-size: 14px; + font-weight: 500; +} +} + +.VPDocFooter[data-v-e257564d] { + margin-top: 64px; +} +.edit-info[data-v-e257564d] { + padding-bottom: 18px; +} +@media (min-width: 640px) { +.edit-info[data-v-e257564d] { + display: flex; + justify-content: space-between; + align-items: center; + padding-bottom: 14px; +} +} +.edit-link-button[data-v-e257564d] { + display: flex; + align-items: center; + border: 0; + line-height: 32px; + font-size: 14px; + font-weight: 500; + color: var(--vp-c-brand-1); + transition: color 0.25s; +} +.edit-link-button[data-v-e257564d]:hover { + color: var(--vp-c-brand-2); +} +.edit-link-icon[data-v-e257564d] { + margin-right: 8px; +} +.prev-next[data-v-e257564d] { + border-top: 1px solid var(--vp-c-divider); + padding-top: 24px; + display: grid; + grid-row-gap: 8px; +} +@media (min-width: 640px) { +.prev-next[data-v-e257564d] { + grid-template-columns: repeat(2, 1fr); + grid-column-gap: 16px; +} +} +.pager-link[data-v-e257564d] { + display: block; + border: 1px solid var(--vp-c-divider); + border-radius: 8px; + padding: 11px 16px 13px; + width: 100%; + height: 100%; + transition: border-color 0.25s; +} +.pager-link[data-v-e257564d]:hover { + border-color: var(--vp-c-brand-1); +} +.pager-link.next[data-v-e257564d] { + margin-left: auto; + text-align: right; +} +.desc[data-v-e257564d] { + display: block; + line-height: 20px; + font-size: 12px; + font-weight: 500; + color: var(--vp-c-text-2); +} +.title[data-v-e257564d] { + display: block; + line-height: 20px; + font-size: 14px; + font-weight: 500; + color: var(--vp-c-brand-1); + transition: color 0.25s; +} + +.VPDoc[data-v-39a288b8] { + padding: 32px 24px 96px; + width: 100%; +} +@media (min-width: 768px) { +.VPDoc[data-v-39a288b8] { + padding: 48px 32px 128px; +} +} +@media (min-width: 960px) { +.VPDoc[data-v-39a288b8] { + padding: 48px 32px 0; +} +.VPDoc:not(.has-sidebar) .container[data-v-39a288b8] { + display: flex; + justify-content: center; + max-width: 992px; +} +.VPDoc:not(.has-sidebar) .content[data-v-39a288b8] { + max-width: 752px; +} +} +@media (min-width: 1280px) { +.VPDoc .container[data-v-39a288b8] { + display: flex; + justify-content: center; +} +.VPDoc .aside[data-v-39a288b8] { + display: block; +} +} +@media (min-width: 1440px) { +.VPDoc:not(.has-sidebar) .content[data-v-39a288b8] { + max-width: 784px; +} +.VPDoc:not(.has-sidebar) .container[data-v-39a288b8] { + max-width: 1104px; +} +} +.container[data-v-39a288b8] { + margin: 0 auto; + width: 100%; +} +.aside[data-v-39a288b8] { + position: relative; + display: none; + order: 2; + flex-grow: 1; + padding-left: 32px; + width: 100%; + max-width: 256px; +} +.left-aside[data-v-39a288b8] { + order: 1; + padding-left: unset; + padding-right: 32px; +} +.aside-container[data-v-39a288b8] { + position: fixed; + top: 0; + padding-top: calc(var(--vp-nav-height) + var(--vp-layout-top-height, 0px) + var(--vp-doc-top-height, 0px) + 48px); + width: 224px; + height: 100vh; + overflow-x: hidden; + overflow-y: auto; + scrollbar-width: none; +} +.aside-container[data-v-39a288b8]::-webkit-scrollbar { + display: none; +} +.aside-curtain[data-v-39a288b8] { + position: fixed; + bottom: 0; + z-index: 10; + width: 224px; + height: 32px; + background: linear-gradient(transparent, var(--vp-c-bg) 70%); +} +.aside-content[data-v-39a288b8] { + display: flex; + flex-direction: column; + min-height: calc(100vh - (var(--vp-nav-height) + var(--vp-layout-top-height, 0px) + 48px)); + padding-bottom: 32px; +} +.content[data-v-39a288b8] { + position: relative; + margin: 0 auto; + width: 100%; +} +@media (min-width: 960px) { +.content[data-v-39a288b8] { + padding: 0 32px 128px; +} +} +@media (min-width: 1280px) { +.content[data-v-39a288b8] { + order: 1; + margin: 0; + min-width: 640px; +} +} +.content-container[data-v-39a288b8] { + margin: 0 auto; +} +.VPDoc.has-aside .content-container[data-v-39a288b8] { + max-width: 688px; +} + +.VPButton[data-v-fa7799d5] { + display: inline-block; + border: 1px solid transparent; + text-align: center; + font-weight: 600; + white-space: nowrap; + transition: color 0.25s, border-color 0.25s, background-color 0.25s; +} +.VPButton[data-v-fa7799d5]:active { + transition: color 0.1s, border-color 0.1s, background-color 0.1s; +} +.VPButton.medium[data-v-fa7799d5] { + border-radius: 20px; + padding: 0 20px; + line-height: 38px; + font-size: 14px; +} +.VPButton.big[data-v-fa7799d5] { + border-radius: 24px; + padding: 0 24px; + line-height: 46px; + font-size: 16px; +} +.VPButton.brand[data-v-fa7799d5] { + border-color: var(--vp-button-brand-border); + color: var(--vp-button-brand-text); + background-color: var(--vp-button-brand-bg); +} +.VPButton.brand[data-v-fa7799d5]:hover { + border-color: var(--vp-button-brand-hover-border); + color: var(--vp-button-brand-hover-text); + background-color: var(--vp-button-brand-hover-bg); +} +.VPButton.brand[data-v-fa7799d5]:active { + border-color: var(--vp-button-brand-active-border); + color: var(--vp-button-brand-active-text); + background-color: var(--vp-button-brand-active-bg); +} +.VPButton.alt[data-v-fa7799d5] { + border-color: var(--vp-button-alt-border); + color: var(--vp-button-alt-text); + background-color: var(--vp-button-alt-bg); +} +.VPButton.alt[data-v-fa7799d5]:hover { + border-color: var(--vp-button-alt-hover-border); + color: var(--vp-button-alt-hover-text); + background-color: var(--vp-button-alt-hover-bg); +} +.VPButton.alt[data-v-fa7799d5]:active { + border-color: var(--vp-button-alt-active-border); + color: var(--vp-button-alt-active-text); + background-color: var(--vp-button-alt-active-bg); +} +.VPButton.sponsor[data-v-fa7799d5] { + border-color: var(--vp-button-sponsor-border); + color: var(--vp-button-sponsor-text); + background-color: var(--vp-button-sponsor-bg); +} +.VPButton.sponsor[data-v-fa7799d5]:hover { + border-color: var(--vp-button-sponsor-hover-border); + color: var(--vp-button-sponsor-hover-text); + background-color: var(--vp-button-sponsor-hover-bg); +} +.VPButton.sponsor[data-v-fa7799d5]:active { + border-color: var(--vp-button-sponsor-active-border); + color: var(--vp-button-sponsor-active-text); + background-color: var(--vp-button-sponsor-active-bg); +} + +html:not(.dark) .VPImage.dark[data-v-8426fc1a] { + display: none; +} +.dark .VPImage.light[data-v-8426fc1a] { + display: none; +} + +.VPHero[data-v-4f9c455b] { + margin-top: calc((var(--vp-nav-height) + var(--vp-layout-top-height, 0px)) * -1); + padding: calc(var(--vp-nav-height) + var(--vp-layout-top-height, 0px) + 48px) 24px 48px; +} +@media (min-width: 640px) { +.VPHero[data-v-4f9c455b] { + padding: calc(var(--vp-nav-height) + var(--vp-layout-top-height, 0px) + 80px) 48px 64px; +} +} +@media (min-width: 960px) { +.VPHero[data-v-4f9c455b] { + padding: calc(var(--vp-nav-height) + var(--vp-layout-top-height, 0px) + 80px) 64px 64px; +} +} +.container[data-v-4f9c455b] { + display: flex; + flex-direction: column; + margin: 0 auto; + max-width: 1152px; +} +@media (min-width: 960px) { +.container[data-v-4f9c455b] { + flex-direction: row; +} +} +.main[data-v-4f9c455b] { + position: relative; + z-index: 10; + order: 2; + flex-grow: 1; + flex-shrink: 0; +} +.VPHero.has-image .container[data-v-4f9c455b] { + text-align: center; +} +@media (min-width: 960px) { +.VPHero.has-image .container[data-v-4f9c455b] { + text-align: left; +} +} +@media (min-width: 960px) { +.main[data-v-4f9c455b] { + order: 1; + width: calc((100% / 3) * 2); +} +.VPHero.has-image .main[data-v-4f9c455b] { + max-width: 592px; +} +} +.heading[data-v-4f9c455b] { + display: flex; + flex-direction: column; +} +.name[data-v-4f9c455b], +.text[data-v-4f9c455b] { + width: fit-content; + max-width: 392px; + letter-spacing: -0.4px; + line-height: 40px; + font-size: 32px; + font-weight: 700; + white-space: pre-wrap; +} +.VPHero.has-image .name[data-v-4f9c455b], +.VPHero.has-image .text[data-v-4f9c455b] { + margin: 0 auto; +} +.name[data-v-4f9c455b] { + color: var(--vp-home-hero-name-color); +} +.clip[data-v-4f9c455b] { + background: var(--vp-home-hero-name-background); + -webkit-background-clip: text; + background-clip: text; + -webkit-text-fill-color: var(--vp-home-hero-name-color); +} +@media (min-width: 640px) { +.name[data-v-4f9c455b], + .text[data-v-4f9c455b] { + max-width: 576px; + line-height: 56px; + font-size: 48px; +} +} +@media (min-width: 960px) { +.name[data-v-4f9c455b], + .text[data-v-4f9c455b] { + line-height: 64px; + font-size: 56px; +} +.VPHero.has-image .name[data-v-4f9c455b], + .VPHero.has-image .text[data-v-4f9c455b] { + margin: 0; +} +} +.tagline[data-v-4f9c455b] { + padding-top: 8px; + max-width: 392px; + line-height: 28px; + font-size: 18px; + font-weight: 500; + white-space: pre-wrap; + color: var(--vp-c-text-2); +} +.VPHero.has-image .tagline[data-v-4f9c455b] { + margin: 0 auto; +} +@media (min-width: 640px) { +.tagline[data-v-4f9c455b] { + padding-top: 12px; + max-width: 576px; + line-height: 32px; + font-size: 20px; +} +} +@media (min-width: 960px) { +.tagline[data-v-4f9c455b] { + line-height: 36px; + font-size: 24px; +} +.VPHero.has-image .tagline[data-v-4f9c455b] { + margin: 0; +} +} +.actions[data-v-4f9c455b] { + display: flex; + flex-wrap: wrap; + margin: -6px; + padding-top: 24px; +} +.VPHero.has-image .actions[data-v-4f9c455b] { + justify-content: center; +} +@media (min-width: 640px) { +.actions[data-v-4f9c455b] { + padding-top: 32px; +} +} +@media (min-width: 960px) { +.VPHero.has-image .actions[data-v-4f9c455b] { + justify-content: flex-start; +} +} +.action[data-v-4f9c455b] { + flex-shrink: 0; + padding: 6px; +} +.image[data-v-4f9c455b] { + order: 1; + margin: -76px -24px -48px; +} +@media (min-width: 640px) { +.image[data-v-4f9c455b] { + margin: -108px -24px -48px; +} +} +@media (min-width: 960px) { +.image[data-v-4f9c455b] { + flex-grow: 1; + order: 2; + margin: 0; + min-height: 100%; +} +} +.image-container[data-v-4f9c455b] { + position: relative; + margin: 0 auto; + width: 320px; + height: 320px; +} +@media (min-width: 640px) { +.image-container[data-v-4f9c455b] { + width: 392px; + height: 392px; +} +} +@media (min-width: 960px) { +.image-container[data-v-4f9c455b] { + display: flex; + justify-content: center; + align-items: center; + width: 100%; + height: 100%; + /*rtl:ignore*/ + transform: translate(-32px, -32px); +} +} +.image-bg[data-v-4f9c455b] { + position: absolute; + top: 50%; + /*rtl:ignore*/ + left: 50%; + border-radius: 50%; + width: 192px; + height: 192px; + background-image: var(--vp-home-hero-image-background-image); + filter: var(--vp-home-hero-image-filter); + /*rtl:ignore*/ + transform: translate(-50%, -50%); +} +@media (min-width: 640px) { +.image-bg[data-v-4f9c455b] { + width: 256px; + height: 256px; +} +} +@media (min-width: 960px) { +.image-bg[data-v-4f9c455b] { + width: 320px; + height: 320px; +} +} +[data-v-4f9c455b] .image-src { + position: absolute; + top: 50%; + /*rtl:ignore*/ + left: 50%; + max-width: 192px; + max-height: 192px; + /*rtl:ignore*/ + transform: translate(-50%, -50%); +} +@media (min-width: 640px) { +[data-v-4f9c455b] .image-src { + max-width: 256px; + max-height: 256px; +} +} +@media (min-width: 960px) { +[data-v-4f9c455b] .image-src { + max-width: 320px; + max-height: 320px; +} +} + +.VPFeature[data-v-a3976bdc] { + display: block; + border: 1px solid var(--vp-c-bg-soft); + border-radius: 12px; + height: 100%; + background-color: var(--vp-c-bg-soft); + transition: border-color 0.25s, background-color 0.25s; +} +.VPFeature.link[data-v-a3976bdc]:hover { + border-color: var(--vp-c-brand-1); +} +.box[data-v-a3976bdc] { + display: flex; + flex-direction: column; + padding: 24px; + height: 100%; +} +.box[data-v-a3976bdc] > .VPImage { + margin-bottom: 20px; +} +.icon[data-v-a3976bdc] { + display: flex; + justify-content: center; + align-items: center; + margin-bottom: 20px; + border-radius: 6px; + background-color: var(--vp-c-default-soft); + width: 48px; + height: 48px; + font-size: 24px; + transition: background-color 0.25s; +} +.title[data-v-a3976bdc] { + line-height: 24px; + font-size: 16px; + font-weight: 600; +} +.details[data-v-a3976bdc] { + flex-grow: 1; + padding-top: 8px; + line-height: 24px; + font-size: 14px; + font-weight: 500; + color: var(--vp-c-text-2); +} +.link-text[data-v-a3976bdc] { + padding-top: 8px; +} +.link-text-value[data-v-a3976bdc] { + display: flex; + align-items: center; + font-size: 14px; + font-weight: 500; + color: var(--vp-c-brand-1); +} +.link-text-icon[data-v-a3976bdc] { + margin-left: 6px; +} + +.VPFeatures[data-v-a6181336] { + position: relative; + padding: 0 24px; +} +@media (min-width: 640px) { +.VPFeatures[data-v-a6181336] { + padding: 0 48px; +} +} +@media (min-width: 960px) { +.VPFeatures[data-v-a6181336] { + padding: 0 64px; +} +} +.container[data-v-a6181336] { + margin: 0 auto; + max-width: 1152px; +} +.items[data-v-a6181336] { + display: flex; + flex-wrap: wrap; + margin: -8px; +} +.item[data-v-a6181336] { + padding: 8px; + width: 100%; +} +@media (min-width: 640px) { +.item.grid-2[data-v-a6181336], + .item.grid-4[data-v-a6181336], + .item.grid-6[data-v-a6181336] { + width: calc(100% / 2); +} +} +@media (min-width: 768px) { +.item.grid-2[data-v-a6181336], + .item.grid-4[data-v-a6181336] { + width: calc(100% / 2); +} +.item.grid-3[data-v-a6181336], + .item.grid-6[data-v-a6181336] { + width: calc(100% / 3); +} +} +@media (min-width: 960px) { +.item.grid-4[data-v-a6181336] { + width: calc(100% / 4); +} +} + +.container[data-v-8e2d4988] { + margin: auto; + width: 100%; + max-width: 1280px; + padding: 0 24px; +} +@media (min-width: 640px) { +.container[data-v-8e2d4988] { + padding: 0 48px; +} +} +@media (min-width: 960px) { +.container[data-v-8e2d4988] { + width: 100%; + padding: 0 64px; +} +} +.vp-doc[data-v-8e2d4988] .VPHomeSponsors, +.vp-doc[data-v-8e2d4988] .VPTeamPage { + margin-left: var(--vp-offset, calc(50% - 50vw)); + margin-right: var(--vp-offset, calc(50% - 50vw)); +} +.vp-doc[data-v-8e2d4988] .VPHomeSponsors h2 { + border-top: none; + letter-spacing: normal; +} +.vp-doc[data-v-8e2d4988] .VPHomeSponsors a, +.vp-doc[data-v-8e2d4988] .VPTeamPage a { + text-decoration: none; +} + +.VPHome[data-v-8b561e3d] { + margin-bottom: 96px; +} +@media (min-width: 768px) { +.VPHome[data-v-8b561e3d] { + margin-bottom: 128px; +} +} + +.VPContent[data-v-1428d186] { + flex-grow: 1; + flex-shrink: 0; + margin: var(--vp-layout-top-height, 0px) auto 0; + width: 100%; +} +.VPContent.is-home[data-v-1428d186] { + width: 100%; + max-width: 100%; +} +.VPContent.has-sidebar[data-v-1428d186] { + margin: 0; +} +@media (min-width: 960px) { +.VPContent[data-v-1428d186] { + padding-top: var(--vp-nav-height); +} +.VPContent.has-sidebar[data-v-1428d186] { + margin: var(--vp-layout-top-height, 0px) 0 0; + padding-left: var(--vp-sidebar-width); +} +} +@media (min-width: 1440px) { +.VPContent.has-sidebar[data-v-1428d186] { + padding-right: calc((100vw - var(--vp-layout-max-width)) / 2); + padding-left: calc((100vw - var(--vp-layout-max-width)) / 2 + var(--vp-sidebar-width)); +} +} + +.VPFooter[data-v-e315a0ad] { + position: relative; + z-index: var(--vp-z-index-footer); + border-top: 1px solid var(--vp-c-gutter); + padding: 32px 24px; + background-color: var(--vp-c-bg); +} +.VPFooter.has-sidebar[data-v-e315a0ad] { + display: none; +} +.VPFooter[data-v-e315a0ad] a { + text-decoration-line: underline; + text-underline-offset: 2px; + transition: color 0.25s; +} +.VPFooter[data-v-e315a0ad] a:hover { + color: var(--vp-c-text-1); +} +@media (min-width: 768px) { +.VPFooter[data-v-e315a0ad] { + padding: 32px; +} +} +.container[data-v-e315a0ad] { + margin: 0 auto; + max-width: var(--vp-layout-max-width); + text-align: center; +} +.message[data-v-e315a0ad], +.copyright[data-v-e315a0ad] { + line-height: 24px; + font-size: 14px; + font-weight: 500; + color: var(--vp-c-text-2); +} + +.VPLocalNavOutlineDropdown[data-v-8a42e2b4] { + padding: 12px 20px 11px; +} +@media (min-width: 960px) { +.VPLocalNavOutlineDropdown[data-v-8a42e2b4] { + padding: 12px 36px 11px; +} +} +.VPLocalNavOutlineDropdown button[data-v-8a42e2b4] { + display: block; + font-size: 12px; + font-weight: 500; + line-height: 24px; + color: var(--vp-c-text-2); + transition: color 0.5s; + position: relative; +} +.VPLocalNavOutlineDropdown button[data-v-8a42e2b4]:hover { + color: var(--vp-c-text-1); + transition: color 0.25s; +} +.VPLocalNavOutlineDropdown button.open[data-v-8a42e2b4] { + color: var(--vp-c-text-1); +} +.icon[data-v-8a42e2b4] { + display: inline-block; + vertical-align: middle; + margin-left: 2px; + font-size: 14px; + transform: rotate(0)/*rtl:rotate(180deg)*/; + transition: transform 0.25s; +} +@media (min-width: 960px) { +.VPLocalNavOutlineDropdown button[data-v-8a42e2b4] { + font-size: 14px; +} +.icon[data-v-8a42e2b4] { + font-size: 16px; +} +} +.open > .icon[data-v-8a42e2b4] { + /*rtl:ignore*/ + transform: rotate(90deg); +} +.items[data-v-8a42e2b4] { + position: absolute; + top: 40px; + right: 16px; + left: 16px; + display: grid; + gap: 1px; + border: 1px solid var(--vp-c-border); + border-radius: 8px; + background-color: var(--vp-c-gutter); + max-height: calc(var(--vp-vh, 100vh) - 86px); + overflow: hidden auto; + box-shadow: var(--vp-shadow-3); +} +@media (min-width: 960px) { +.items[data-v-8a42e2b4] { + right: auto; + left: calc(var(--vp-sidebar-width) + 32px); + width: 320px; +} +} +.header[data-v-8a42e2b4] { + background-color: var(--vp-c-bg-soft); +} +.top-link[data-v-8a42e2b4] { + display: block; + padding: 0 16px; + line-height: 48px; + font-size: 14px; + font-weight: 500; + color: var(--vp-c-brand-1); +} +.outline[data-v-8a42e2b4] { + padding: 8px 0; + background-color: var(--vp-c-bg-soft); +} +.flyout-enter-active[data-v-8a42e2b4] { + transition: all 0.2s ease-out; +} +.flyout-leave-active[data-v-8a42e2b4] { + transition: all 0.15s ease-in; +} +.flyout-enter-from[data-v-8a42e2b4], +.flyout-leave-to[data-v-8a42e2b4] { + opacity: 0; + transform: translateY(-16px); +} + +.VPLocalNav[data-v-a6f0e41e] { + position: sticky; + top: 0; + /*rtl:ignore*/ + left: 0; + z-index: var(--vp-z-index-local-nav); + border-bottom: 1px solid var(--vp-c-gutter); + padding-top: var(--vp-layout-top-height, 0px); + width: 100%; + background-color: var(--vp-local-nav-bg-color); +} +.VPLocalNav.fixed[data-v-a6f0e41e] { + position: fixed; +} +@media (min-width: 960px) { +.VPLocalNav[data-v-a6f0e41e] { + top: var(--vp-nav-height); +} +.VPLocalNav.has-sidebar[data-v-a6f0e41e] { + padding-left: var(--vp-sidebar-width); +} +.VPLocalNav.empty[data-v-a6f0e41e] { + display: none; +} +} +@media (min-width: 1280px) { +.VPLocalNav[data-v-a6f0e41e] { + display: none; +} +} +@media (min-width: 1440px) { +.VPLocalNav.has-sidebar[data-v-a6f0e41e] { + padding-left: calc((100vw - var(--vp-layout-max-width)) / 2 + var(--vp-sidebar-width)); +} +} +.container[data-v-a6f0e41e] { + display: flex; + justify-content: space-between; + align-items: center; +} +.menu[data-v-a6f0e41e] { + display: flex; + align-items: center; + padding: 12px 24px 11px; + line-height: 24px; + font-size: 12px; + font-weight: 500; + color: var(--vp-c-text-2); + transition: color 0.5s; +} +.menu[data-v-a6f0e41e]:hover { + color: var(--vp-c-text-1); + transition: color 0.25s; +} +@media (min-width: 768px) { +.menu[data-v-a6f0e41e] { + padding: 0 32px; +} +} +@media (min-width: 960px) { +.menu[data-v-a6f0e41e] { + display: none; +} +} +.menu-icon[data-v-a6f0e41e] { + margin-right: 8px; + font-size: 14px; +} +.VPOutlineDropdown[data-v-a6f0e41e] { + padding: 12px 24px 11px; +} +@media (min-width: 768px) { +.VPOutlineDropdown[data-v-a6f0e41e] { + padding: 12px 32px 11px; +} +} + +.VPSwitch[data-v-1d5665e3] { + position: relative; + border-radius: 11px; + display: block; + width: 40px; + height: 22px; + flex-shrink: 0; + border: 1px solid var(--vp-input-border-color); + background-color: var(--vp-input-switch-bg-color); + transition: border-color 0.25s !important; +} +.VPSwitch[data-v-1d5665e3]:hover { + border-color: var(--vp-c-brand-1); +} +.check[data-v-1d5665e3] { + position: absolute; + top: 1px; + /*rtl:ignore*/ + left: 1px; + width: 18px; + height: 18px; + border-radius: 50%; + background-color: var(--vp-c-neutral-inverse); + box-shadow: var(--vp-shadow-1); + transition: transform 0.25s !important; +} +.icon[data-v-1d5665e3] { + position: relative; + display: block; + width: 18px; + height: 18px; + border-radius: 50%; + overflow: hidden; +} +.icon[data-v-1d5665e3] [class^='vpi-'] { + position: absolute; + top: 3px; + left: 3px; + width: 12px; + height: 12px; + color: var(--vp-c-text-2); +} +.dark .icon[data-v-1d5665e3] [class^='vpi-'] { + color: var(--vp-c-text-1); + transition: opacity 0.25s !important; +} + +.sun[data-v-5337faa4] { + opacity: 1; +} +.moon[data-v-5337faa4] { + opacity: 0; +} +.dark .sun[data-v-5337faa4] { + opacity: 0; +} +.dark .moon[data-v-5337faa4] { + opacity: 1; +} +.dark .VPSwitchAppearance[data-v-5337faa4] .check { + /*rtl:ignore*/ + transform: translateX(18px); +} + +.VPNavBarAppearance[data-v-6c893767] { + display: none; +} +@media (min-width: 1280px) { +.VPNavBarAppearance[data-v-6c893767] { + display: flex; + align-items: center; +} +} + +.VPMenuGroup + .VPMenuLink[data-v-35975db6] { + margin: 12px -12px 0; + border-top: 1px solid var(--vp-c-divider); + padding: 12px 12px 0; +} +.link[data-v-35975db6] { + display: block; + border-radius: 6px; + padding: 0 12px; + line-height: 32px; + font-size: 14px; + font-weight: 500; + color: var(--vp-c-text-1); + white-space: nowrap; + transition: + background-color 0.25s, + color 0.25s; +} +.link[data-v-35975db6]:hover { + color: var(--vp-c-brand-1); + background-color: var(--vp-c-default-soft); +} +.link.active[data-v-35975db6] { + color: var(--vp-c-brand-1); +} + +.VPMenuGroup[data-v-69e747b5] { + margin: 12px -12px 0; + border-top: 1px solid var(--vp-c-divider); + padding: 12px 12px 0; +} +.VPMenuGroup[data-v-69e747b5]:first-child { + margin-top: 0; + border-top: 0; + padding-top: 0; +} +.VPMenuGroup + .VPMenuGroup[data-v-69e747b5] { + margin-top: 12px; + border-top: 1px solid var(--vp-c-divider); +} +.title[data-v-69e747b5] { + padding: 0 12px; + line-height: 32px; + font-size: 14px; + font-weight: 600; + color: var(--vp-c-text-2); + white-space: nowrap; + transition: color 0.25s; +} + +.VPMenu[data-v-b98bc113] { + border-radius: 12px; + padding: 12px; + min-width: 128px; + border: 1px solid var(--vp-c-divider); + background-color: var(--vp-c-bg-elv); + box-shadow: var(--vp-shadow-3); + transition: background-color 0.5s; + max-height: calc(100vh - var(--vp-nav-height)); + overflow-y: auto; +} +.VPMenu[data-v-b98bc113] .group { + margin: 0 -12px; + padding: 0 12px 12px; +} +.VPMenu[data-v-b98bc113] .group + .group { + border-top: 1px solid var(--vp-c-divider); + padding: 11px 12px 12px; +} +.VPMenu[data-v-b98bc113] .group:last-child { + padding-bottom: 0; +} +.VPMenu[data-v-b98bc113] .group + .item { + border-top: 1px solid var(--vp-c-divider); + padding: 11px 16px 0; +} +.VPMenu[data-v-b98bc113] .item { + padding: 0 16px; + white-space: nowrap; +} +.VPMenu[data-v-b98bc113] .label { + flex-grow: 1; + line-height: 28px; + font-size: 12px; + font-weight: 500; + color: var(--vp-c-text-2); + transition: color 0.5s; +} +.VPMenu[data-v-b98bc113] .action { + padding-left: 24px; +} + +.VPFlyout[data-v-cf11d7a2] { + position: relative; +} +.VPFlyout[data-v-cf11d7a2]:hover { + color: var(--vp-c-brand-1); + transition: color 0.25s; +} +.VPFlyout:hover .text[data-v-cf11d7a2] { + color: var(--vp-c-text-2); +} +.VPFlyout:hover .icon[data-v-cf11d7a2] { + fill: var(--vp-c-text-2); +} +.VPFlyout.active .text[data-v-cf11d7a2] { + color: var(--vp-c-brand-1); +} +.VPFlyout.active:hover .text[data-v-cf11d7a2] { + color: var(--vp-c-brand-2); +} +.button[aria-expanded="false"] + .menu[data-v-cf11d7a2] { + opacity: 0; + visibility: hidden; + transform: translateY(0); +} +.VPFlyout:hover .menu[data-v-cf11d7a2], +.button[aria-expanded="true"] + .menu[data-v-cf11d7a2] { + opacity: 1; + visibility: visible; + transform: translateY(0); +} +.button[data-v-cf11d7a2] { + display: flex; + align-items: center; + padding: 0 12px; + height: var(--vp-nav-height); + color: var(--vp-c-text-1); + transition: color 0.5s; +} +.text[data-v-cf11d7a2] { + display: flex; + align-items: center; + line-height: var(--vp-nav-height); + font-size: 14px; + font-weight: 500; + color: var(--vp-c-text-1); + transition: color 0.25s; +} +.option-icon[data-v-cf11d7a2] { + margin-right: 0px; + font-size: 16px; +} +.text-icon[data-v-cf11d7a2] { + margin-left: 4px; + font-size: 14px; +} +.icon[data-v-cf11d7a2] { + font-size: 20px; + transition: fill 0.25s; +} +.menu[data-v-cf11d7a2] { + position: absolute; + top: calc(var(--vp-nav-height) / 2 + 20px); + right: 0; + opacity: 0; + visibility: hidden; + transition: opacity 0.25s, visibility 0.25s, transform 0.25s; +} + +.VPSocialLink[data-v-bd121fe5] { + display: flex; + justify-content: center; + align-items: center; + width: 36px; + height: 36px; + color: var(--vp-c-text-2); + transition: color 0.5s; +} +.VPSocialLink[data-v-bd121fe5]:hover { + color: var(--vp-c-text-1); + transition: color 0.25s; +} +.VPSocialLink[data-v-bd121fe5] > svg, +.VPSocialLink[data-v-bd121fe5] > [class^="vpi-social-"] { + width: 20px; + height: 20px; + fill: currentColor; +} + +.VPSocialLinks[data-v-7bc22406] { + display: flex; + justify-content: center; +} + +.VPNavBarExtra[data-v-bb2aa2f0] { + display: none; + margin-right: -12px; +} +@media (min-width: 768px) { +.VPNavBarExtra[data-v-bb2aa2f0] { + display: block; +} +} +@media (min-width: 1280px) { +.VPNavBarExtra[data-v-bb2aa2f0] { + display: none; +} +} +.trans-title[data-v-bb2aa2f0] { + padding: 0 24px 0 12px; + line-height: 32px; + font-size: 14px; + font-weight: 700; + color: var(--vp-c-text-1); +} +.item.appearance[data-v-bb2aa2f0], +.item.social-links[data-v-bb2aa2f0] { + display: flex; + align-items: center; + padding: 0 12px; +} +.item.appearance[data-v-bb2aa2f0] { + min-width: 176px; +} +.appearance-action[data-v-bb2aa2f0] { + margin-right: -2px; +} +.social-links-list[data-v-bb2aa2f0] { + margin: -4px -8px; +} + +.VPNavBarHamburger[data-v-e5dd9c1c] { + display: flex; + justify-content: center; + align-items: center; + width: 48px; + height: var(--vp-nav-height); +} +@media (min-width: 768px) { +.VPNavBarHamburger[data-v-e5dd9c1c] { + display: none; +} +} +.container[data-v-e5dd9c1c] { + position: relative; + width: 16px; + height: 14px; + overflow: hidden; +} +.VPNavBarHamburger:hover .top[data-v-e5dd9c1c] { top: 0; left: 0; transform: translateX(4px); +} +.VPNavBarHamburger:hover .middle[data-v-e5dd9c1c] { top: 6px; left: 0; transform: translateX(0); +} +.VPNavBarHamburger:hover .bottom[data-v-e5dd9c1c] { top: 12px; left: 0; transform: translateX(8px); +} +.VPNavBarHamburger.active .top[data-v-e5dd9c1c] { top: 6px; transform: translateX(0) rotate(225deg); +} +.VPNavBarHamburger.active .middle[data-v-e5dd9c1c] { top: 6px; transform: translateX(16px); +} +.VPNavBarHamburger.active .bottom[data-v-e5dd9c1c] { top: 6px; transform: translateX(0) rotate(135deg); +} +.VPNavBarHamburger.active:hover .top[data-v-e5dd9c1c], +.VPNavBarHamburger.active:hover .middle[data-v-e5dd9c1c], +.VPNavBarHamburger.active:hover .bottom[data-v-e5dd9c1c] { + background-color: var(--vp-c-text-2); + transition: top .25s, background-color .25s, transform .25s; +} +.top[data-v-e5dd9c1c], +.middle[data-v-e5dd9c1c], +.bottom[data-v-e5dd9c1c] { + position: absolute; + width: 16px; + height: 2px; + background-color: var(--vp-c-text-1); + transition: top .25s, background-color .5s, transform .25s; +} +.top[data-v-e5dd9c1c] { top: 0; left: 0; transform: translateX(0); +} +.middle[data-v-e5dd9c1c] { top: 6px; left: 0; transform: translateX(8px); +} +.bottom[data-v-e5dd9c1c] { top: 12px; left: 0; transform: translateX(4px); +} + +.VPNavBarMenuLink[data-v-e56f3d57] { + display: flex; + align-items: center; + padding: 0 12px; + line-height: var(--vp-nav-height); + font-size: 14px; + font-weight: 500; + color: var(--vp-c-text-1); + transition: color 0.25s; +} +.VPNavBarMenuLink.active[data-v-e56f3d57] { + color: var(--vp-c-brand-1); +} +.VPNavBarMenuLink[data-v-e56f3d57]:hover { + color: var(--vp-c-brand-1); +} + +.VPNavBarMenu[data-v-dc692963] { + display: none; +} +@media (min-width: 768px) { +.VPNavBarMenu[data-v-dc692963] { + display: flex; +} +} +/*! @docsearch/css 3.8.2 | MIT License | © Algolia, Inc. and contributors | https://docsearch.algolia.com */ +:root{--docsearch-primary-color:#5468ff;--docsearch-text-color:#1c1e21;--docsearch-spacing:12px;--docsearch-icon-stroke-width:1.4;--docsearch-highlight-color:var(--docsearch-primary-color);--docsearch-muted-color:#969faf;--docsearch-container-background:rgba(101,108,133,.8);--docsearch-logo-color:#5468ff;--docsearch-modal-width:560px;--docsearch-modal-height:600px;--docsearch-modal-background:#f5f6f7;--docsearch-modal-shadow:inset 1px 1px 0 0 hsla(0,0%,100%,.5),0 3px 8px 0 #555a64;--docsearch-searchbox-height:56px;--docsearch-searchbox-background:#ebedf0;--docsearch-searchbox-focus-background:#fff;--docsearch-searchbox-shadow:inset 0 0 0 2px var(--docsearch-primary-color);--docsearch-hit-height:56px;--docsearch-hit-color:#444950;--docsearch-hit-active-color:#fff;--docsearch-hit-background:#fff;--docsearch-hit-shadow:0 1px 3px 0 #d4d9e1;--docsearch-key-gradient:linear-gradient(-225deg,#d5dbe4,#f8f8f8);--docsearch-key-shadow:inset 0 -2px 0 0 #cdcde6,inset 0 0 1px 1px #fff,0 1px 2px 1px rgba(30,35,90,.4);--docsearch-key-pressed-shadow:inset 0 -2px 0 0 #cdcde6,inset 0 0 1px 1px #fff,0 1px 1px 0 rgba(30,35,90,.4);--docsearch-footer-height:44px;--docsearch-footer-background:#fff;--docsearch-footer-shadow:0 -1px 0 0 #e0e3e8,0 -3px 6px 0 rgba(69,98,155,.12)}html[data-theme=dark]{--docsearch-text-color:#f5f6f7;--docsearch-container-background:rgba(9,10,17,.8);--docsearch-modal-background:#15172a;--docsearch-modal-shadow:inset 1px 1px 0 0 #2c2e40,0 3px 8px 0 #000309;--docsearch-searchbox-background:#090a11;--docsearch-searchbox-focus-background:#000;--docsearch-hit-color:#bec3c9;--docsearch-hit-shadow:none;--docsearch-hit-background:#090a11;--docsearch-key-gradient:linear-gradient(-26.5deg,#565872,#31355b);--docsearch-key-shadow:inset 0 -2px 0 0 #282d55,inset 0 0 1px 1px #51577d,0 2px 2px 0 rgba(3,4,9,.3);--docsearch-key-pressed-shadow:inset 0 -2px 0 0 #282d55,inset 0 0 1px 1px #51577d,0 1px 1px 0 #0304094d;--docsearch-footer-background:#1e2136;--docsearch-footer-shadow:inset 0 1px 0 0 rgba(73,76,106,.5),0 -4px 8px 0 rgba(0,0,0,.2);--docsearch-logo-color:#fff;--docsearch-muted-color:#7f8497}.DocSearch-Button{align-items:center;background:var(--docsearch-searchbox-background);border:0;border-radius:40px;color:var(--docsearch-muted-color);cursor:pointer;display:flex;font-weight:500;height:36px;justify-content:space-between;margin:0 0 0 16px;padding:0 8px;user-select:none}.DocSearch-Button:active,.DocSearch-Button:focus,.DocSearch-Button:hover{background:var(--docsearch-searchbox-focus-background);box-shadow:var(--docsearch-searchbox-shadow);color:var(--docsearch-text-color);outline:none}.DocSearch-Button-Container{align-items:center;display:flex}.DocSearch-Search-Icon{stroke-width:1.6}.DocSearch-Button .DocSearch-Search-Icon{color:var(--docsearch-text-color)}.DocSearch-Button-Placeholder{font-size:1rem;padding:0 12px 0 6px}.DocSearch-Button-Keys{display:flex;min-width:calc(40px + .8em)}.DocSearch-Button-Key{align-items:center;background:var(--docsearch-key-gradient);border:0;border-radius:3px;box-shadow:var(--docsearch-key-shadow);color:var(--docsearch-muted-color);display:flex;height:18px;justify-content:center;margin-right:.4em;padding:0 0 2px;position:relative;top:-1px;width:20px}.DocSearch-Button-Key--pressed{box-shadow:var(--docsearch-key-pressed-shadow);transform:translate3d(0,1px,0)}@media (max-width:768px){.DocSearch-Button-Keys,.DocSearch-Button-Placeholder{display:none}}.DocSearch--active{overflow:hidden!important}.DocSearch-Container,.DocSearch-Container *{box-sizing:border-box}.DocSearch-Container{background-color:var(--docsearch-container-background);height:100vh;left:0;position:fixed;top:0;width:100vw;z-index:200}.DocSearch-Container a{text-decoration:none}.DocSearch-Link{appearance:none;background:none;border:0;color:var(--docsearch-highlight-color);cursor:pointer;font:inherit;margin:0;padding:0}.DocSearch-Modal{background:var(--docsearch-modal-background);border-radius:6px;box-shadow:var(--docsearch-modal-shadow);flex-direction:column;margin:60px auto auto;max-width:var(--docsearch-modal-width);position:relative}.DocSearch-SearchBar{display:flex;padding:var(--docsearch-spacing) var(--docsearch-spacing) 0}.DocSearch-Form{align-items:center;background:var(--docsearch-searchbox-focus-background);border-radius:4px;box-shadow:var(--docsearch-searchbox-shadow);display:flex;height:var(--docsearch-searchbox-height);margin:0;padding:0 var(--docsearch-spacing);position:relative;width:100%}.DocSearch-Input{appearance:none;background:transparent;border:0;color:var(--docsearch-text-color);flex:1;font:inherit;font-size:1.2em;height:100%;outline:none;padding:0 0 0 8px;width:80%}.DocSearch-Input::placeholder{color:var(--docsearch-muted-color);opacity:1}.DocSearch-Input::-webkit-search-cancel-button,.DocSearch-Input::-webkit-search-decoration,.DocSearch-Input::-webkit-search-results-button,.DocSearch-Input::-webkit-search-results-decoration{display:none}.DocSearch-LoadingIndicator,.DocSearch-MagnifierLabel,.DocSearch-Reset{margin:0;padding:0}.DocSearch-MagnifierLabel,.DocSearch-Reset{align-items:center;color:var(--docsearch-highlight-color);display:flex;justify-content:center}.DocSearch-Container--Stalled .DocSearch-MagnifierLabel,.DocSearch-LoadingIndicator{display:none}.DocSearch-Container--Stalled .DocSearch-LoadingIndicator{align-items:center;color:var(--docsearch-highlight-color);display:flex;justify-content:center}@media screen and (prefers-reduced-motion:reduce){.DocSearch-Reset{animation:none;appearance:none;background:none;border:0;border-radius:50%;color:var(--docsearch-icon-color);cursor:pointer;right:0;stroke-width:var(--docsearch-icon-stroke-width)}}.DocSearch-Reset{animation:fade-in .1s ease-in forwards;appearance:none;background:none;border:0;border-radius:50%;color:var(--docsearch-icon-color);cursor:pointer;padding:2px;right:0;stroke-width:var(--docsearch-icon-stroke-width)}.DocSearch-Reset[hidden]{display:none}.DocSearch-Reset:hover{color:var(--docsearch-highlight-color)}.DocSearch-LoadingIndicator svg,.DocSearch-MagnifierLabel svg{height:24px;width:24px}.DocSearch-Cancel{display:none}.DocSearch-Dropdown{max-height:calc(var(--docsearch-modal-height) - var(--docsearch-searchbox-height) - var(--docsearch-spacing) - var(--docsearch-footer-height));min-height:var(--docsearch-spacing);overflow-y:auto;overflow-y:overlay;padding:0 var(--docsearch-spacing);scrollbar-color:var(--docsearch-muted-color) var(--docsearch-modal-background);scrollbar-width:thin}.DocSearch-Dropdown::-webkit-scrollbar{width:12px}.DocSearch-Dropdown::-webkit-scrollbar-track{background:transparent}.DocSearch-Dropdown::-webkit-scrollbar-thumb{background-color:var(--docsearch-muted-color);border:3px solid var(--docsearch-modal-background);border-radius:20px}.DocSearch-Dropdown ul{list-style:none;margin:0;padding:0}.DocSearch-Label{font-size:.75em;line-height:1.6em}.DocSearch-Help,.DocSearch-Label{color:var(--docsearch-muted-color)}.DocSearch-Help{font-size:.9em;margin:0;user-select:none}.DocSearch-Title{font-size:1.2em}.DocSearch-Logo a{display:flex}.DocSearch-Logo svg{color:var(--docsearch-logo-color);margin-left:8px}.DocSearch-Hits:last-of-type{margin-bottom:24px}.DocSearch-Hits mark{background:none;color:var(--docsearch-highlight-color)}.DocSearch-HitsFooter{color:var(--docsearch-muted-color);display:flex;font-size:.85em;justify-content:center;margin-bottom:var(--docsearch-spacing);padding:var(--docsearch-spacing)}.DocSearch-HitsFooter a{border-bottom:1px solid;color:inherit}.DocSearch-Hit{border-radius:4px;display:flex;padding-bottom:4px;position:relative}@media screen and (prefers-reduced-motion:reduce){.DocSearch-Hit--deleting{transition:none}}.DocSearch-Hit--deleting{opacity:0;transition:all .25s linear}@media screen and (prefers-reduced-motion:reduce){.DocSearch-Hit--favoriting{transition:none}}.DocSearch-Hit--favoriting{transform:scale(0);transform-origin:top center;transition:all .25s linear;transition-delay:.25s}.DocSearch-Hit a{background:var(--docsearch-hit-background);border-radius:4px;box-shadow:var(--docsearch-hit-shadow);display:block;padding-left:var(--docsearch-spacing);width:100%}.DocSearch-Hit-source{background:var(--docsearch-modal-background);color:var(--docsearch-highlight-color);font-size:.85em;font-weight:600;line-height:32px;margin:0 -4px;padding:8px 4px 0;position:sticky;top:0;z-index:10}.DocSearch-Hit-Tree{color:var(--docsearch-muted-color);height:var(--docsearch-hit-height);opacity:.5;stroke-width:var(--docsearch-icon-stroke-width);width:24px}.DocSearch-Hit[aria-selected=true] a{background-color:var(--docsearch-highlight-color)}.DocSearch-Hit[aria-selected=true] mark{text-decoration:underline}.DocSearch-Hit-Container{align-items:center;color:var(--docsearch-hit-color);display:flex;flex-direction:row;height:var(--docsearch-hit-height);padding:0 var(--docsearch-spacing) 0 0}.DocSearch-Hit-icon{height:20px;width:20px}.DocSearch-Hit-action,.DocSearch-Hit-icon{color:var(--docsearch-muted-color);stroke-width:var(--docsearch-icon-stroke-width)}.DocSearch-Hit-action{align-items:center;display:flex;height:22px;width:22px}.DocSearch-Hit-action svg{display:block;height:18px;width:18px}.DocSearch-Hit-action+.DocSearch-Hit-action{margin-left:6px}.DocSearch-Hit-action-button{appearance:none;background:none;border:0;border-radius:50%;color:inherit;cursor:pointer;padding:2px}svg.DocSearch-Hit-Select-Icon{display:none}.DocSearch-Hit[aria-selected=true] .DocSearch-Hit-Select-Icon{display:block}.DocSearch-Hit-action-button:focus,.DocSearch-Hit-action-button:hover{background:rgba(0,0,0,.2);transition:background-color .1s ease-in}@media screen and (prefers-reduced-motion:reduce){.DocSearch-Hit-action-button:focus,.DocSearch-Hit-action-button:hover{transition:none}}.DocSearch-Hit-action-button:focus path,.DocSearch-Hit-action-button:hover path{fill:#fff}.DocSearch-Hit-content-wrapper{display:flex;flex:1 1 auto;flex-direction:column;font-weight:500;justify-content:center;line-height:1.2em;margin:0 8px;overflow-x:hidden;position:relative;text-overflow:ellipsis;white-space:nowrap;width:80%}.DocSearch-Hit-title{font-size:.9em}.DocSearch-Hit-path{color:var(--docsearch-muted-color);font-size:.75em}.DocSearch-Hit[aria-selected=true] .DocSearch-Hit-Tree,.DocSearch-Hit[aria-selected=true] .DocSearch-Hit-action,.DocSearch-Hit[aria-selected=true] .DocSearch-Hit-icon,.DocSearch-Hit[aria-selected=true] .DocSearch-Hit-path,.DocSearch-Hit[aria-selected=true] .DocSearch-Hit-text,.DocSearch-Hit[aria-selected=true] .DocSearch-Hit-title,.DocSearch-Hit[aria-selected=true] mark{color:var(--docsearch-hit-active-color)!important}@media screen and (prefers-reduced-motion:reduce){.DocSearch-Hit-action-button:focus,.DocSearch-Hit-action-button:hover{background:rgba(0,0,0,.2);transition:none}}.DocSearch-ErrorScreen,.DocSearch-NoResults,.DocSearch-StartScreen{font-size:.9em;margin:0 auto;padding:36px 0;text-align:center;width:80%}.DocSearch-Screen-Icon{color:var(--docsearch-muted-color);padding-bottom:12px}.DocSearch-NoResults-Prefill-List{display:inline-block;padding-bottom:24px;text-align:left}.DocSearch-NoResults-Prefill-List ul{display:inline-block;padding:8px 0 0}.DocSearch-NoResults-Prefill-List li{list-style-position:inside;list-style-type:"» "}.DocSearch-Prefill{appearance:none;background:none;border:0;border-radius:1em;color:var(--docsearch-highlight-color);cursor:pointer;display:inline-block;font-size:1em;font-weight:700;padding:0}.DocSearch-Prefill:focus,.DocSearch-Prefill:hover{outline:none;text-decoration:underline}.DocSearch-Footer{align-items:center;background:var(--docsearch-footer-background);border-radius:0 0 8px 8px;box-shadow:var(--docsearch-footer-shadow);display:flex;flex-direction:row-reverse;flex-shrink:0;height:var(--docsearch-footer-height);justify-content:space-between;padding:0 var(--docsearch-spacing);position:relative;user-select:none;width:100%;z-index:300}.DocSearch-Commands{color:var(--docsearch-muted-color);display:flex;list-style:none;margin:0;padding:0}.DocSearch-Commands li{align-items:center;display:flex}.DocSearch-Commands li:not(:last-of-type){margin-right:.8em}.DocSearch-Commands-Key{align-items:center;background:var(--docsearch-key-gradient);border:0;border-radius:2px;box-shadow:var(--docsearch-key-shadow);color:var(--docsearch-muted-color);display:flex;height:18px;justify-content:center;margin-right:.4em;padding:0 0 1px;width:20px}.DocSearch-VisuallyHiddenForAccessibility{clip:rect(0 0 0 0);clip-path:inset(50%);height:1px;overflow:hidden;position:absolute;white-space:nowrap;width:1px}@media (max-width:768px){:root{--docsearch-spacing:10px;--docsearch-footer-height:40px}.DocSearch-Dropdown{height:100%}.DocSearch-Container{height:100vh;height:-webkit-fill-available;height:calc(var(--docsearch-vh, 1vh)*100);position:absolute}.DocSearch-Footer{border-radius:0;bottom:0;position:absolute}.DocSearch-Hit-content-wrapper{display:flex;position:relative;width:80%}.DocSearch-Modal{border-radius:0;box-shadow:none;height:100vh;height:-webkit-fill-available;height:calc(var(--docsearch-vh, 1vh)*100);margin:0;max-width:100%;width:100%}.DocSearch-Dropdown{max-height:calc(var(--docsearch-vh, 1vh)*100 - var(--docsearch-searchbox-height) - var(--docsearch-spacing) - var(--docsearch-footer-height))}.DocSearch-Cancel{appearance:none;background:none;border:0;color:var(--docsearch-highlight-color);cursor:pointer;display:inline-block;flex:none;font:inherit;font-size:1em;font-weight:500;margin-left:var(--docsearch-spacing);outline:none;overflow:hidden;padding:0;user-select:none;white-space:nowrap}.DocSearch-Commands,.DocSearch-Hit-Tree{display:none}}@keyframes fade-in{0%{opacity:0}to{opacity:1}} +[class*='DocSearch'] { + --docsearch-primary-color: var(--vp-c-brand-1); + --docsearch-highlight-color: var(--docsearch-primary-color); + --docsearch-text-color: var(--vp-c-text-1); + --docsearch-muted-color: var(--vp-c-text-2); + --docsearch-searchbox-shadow: none; + --docsearch-searchbox-background: transparent; + --docsearch-searchbox-focus-background: transparent; + --docsearch-key-gradient: transparent; + --docsearch-key-shadow: none; + --docsearch-modal-background: var(--vp-c-bg-soft); + --docsearch-footer-background: var(--vp-c-bg); +} +.dark [class*='DocSearch'] { + --docsearch-modal-shadow: none; + --docsearch-footer-shadow: none; + --docsearch-logo-color: var(--vp-c-text-2); + --docsearch-hit-background: var(--vp-c-default-soft); + --docsearch-hit-color: var(--vp-c-text-2); + --docsearch-hit-shadow: none; +} +.DocSearch-Button { + display: flex; + justify-content: center; + align-items: center; + margin: 0; + padding: 0; + width: 48px; + height: 55px; + background: transparent; + transition: border-color 0.25s; +} +.DocSearch-Button:hover { + background: transparent; +} +.DocSearch-Button:focus { + outline: 1px dotted; + outline: 5px auto -webkit-focus-ring-color; +} +.DocSearch-Button-Key--pressed { + transform: none; + box-shadow: none; +} +.DocSearch-Button:focus:not(:focus-visible) { + outline: none !important; +} +@media (min-width: 768px) { +.DocSearch-Button { + justify-content: flex-start; + border: 1px solid transparent; + border-radius: 8px; + padding: 0 10px 0 12px; + width: 100%; + height: 40px; + background-color: var(--vp-c-bg-alt); +} +.DocSearch-Button:hover { + border-color: var(--vp-c-brand-1); + background: var(--vp-c-bg-alt); +} +} +.DocSearch-Button .DocSearch-Button-Container { + display: flex; + align-items: center; +} +.DocSearch-Button .DocSearch-Search-Icon { + position: relative; + width: 16px; + height: 16px; + color: var(--vp-c-text-1); + fill: currentColor; + transition: color 0.5s; +} +.DocSearch-Button:hover .DocSearch-Search-Icon { + color: var(--vp-c-text-1); +} +@media (min-width: 768px) { +.DocSearch-Button .DocSearch-Search-Icon { + top: 1px; + margin-right: 8px; + width: 14px; + height: 14px; + color: var(--vp-c-text-2); +} +} +.DocSearch-Button .DocSearch-Button-Placeholder { + display: none; + margin-top: 2px; + padding: 0 16px 0 0; + font-size: 13px; + font-weight: 500; + color: var(--vp-c-text-2); + transition: color 0.5s; +} +.DocSearch-Button:hover .DocSearch-Button-Placeholder { + color: var(--vp-c-text-1); +} +@media (min-width: 768px) { +.DocSearch-Button .DocSearch-Button-Placeholder { + display: inline-block; +} +} +.DocSearch-Button .DocSearch-Button-Keys { + /*rtl:ignore*/ + direction: ltr; + display: none; + min-width: auto; +} +@media (min-width: 768px) { +.DocSearch-Button .DocSearch-Button-Keys { + display: flex; + align-items: center; +} +} +.DocSearch-Button .DocSearch-Button-Key { + display: block; + margin: 2px 0 0 0; + border: 1px solid var(--vp-c-divider); + /*rtl:begin:ignore*/ + border-right: none; + border-radius: 4px 0 0 4px; + padding-left: 6px; + /*rtl:end:ignore*/ + min-width: 0; + width: auto; + height: 22px; + line-height: 22px; + font-family: var(--vp-font-family-base); + font-size: 12px; + font-weight: 500; + transition: color 0.5s, border-color 0.5s; +} +.DocSearch-Button .DocSearch-Button-Key + .DocSearch-Button-Key { + /*rtl:begin:ignore*/ + border-right: 1px solid var(--vp-c-divider); + border-left: none; + border-radius: 0 4px 4px 0; + padding-left: 2px; + padding-right: 6px; + /*rtl:end:ignore*/ +} +.DocSearch-Button .DocSearch-Button-Key:first-child { + font-size: 0 !important; +} +.DocSearch-Button .DocSearch-Button-Key:first-child:after { + content: 'Ctrl'; + font-size: 12px; + letter-spacing: normal; + color: var(--docsearch-muted-color); +} +.mac .DocSearch-Button .DocSearch-Button-Key:first-child:after { + content: '\2318'; +} +.DocSearch-Button .DocSearch-Button-Key:first-child > * { + display: none; +} +.DocSearch-Search-Icon { + --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' stroke-width='1.6' viewBox='0 0 20 20'%3E%3Cpath fill='none' stroke='currentColor' stroke-linecap='round' stroke-linejoin='round' d='m14.386 14.386 4.088 4.088-4.088-4.088A7.533 7.533 0 1 1 3.733 3.733a7.533 7.533 0 0 1 10.653 10.653z'/%3E%3C/svg%3E"); +} + +.VPNavBarSearch { + display: flex; + align-items: center; +} +@media (min-width: 768px) { +.VPNavBarSearch { + flex-grow: 1; + padding-left: 24px; +} +} +@media (min-width: 960px) { +.VPNavBarSearch { + padding-left: 32px; +} +} +.dark .DocSearch-Footer { + border-top: 1px solid var(--vp-c-divider); +} +.DocSearch-Form { + border: 1px solid var(--vp-c-brand-1); + background-color: var(--vp-c-white); +} +.dark .DocSearch-Form { + background-color: var(--vp-c-default-soft); +} +.DocSearch-Screen-Icon > svg { + margin: auto; +} + +.VPNavBarSocialLinks[data-v-0394ad82] { + display: none; +} +@media (min-width: 1280px) { +.VPNavBarSocialLinks[data-v-0394ad82] { + display: flex; + align-items: center; +} +} + +.title[data-v-1168a8e4] { + display: flex; + align-items: center; + border-bottom: 1px solid transparent; + width: 100%; + height: var(--vp-nav-height); + font-size: 16px; + font-weight: 600; + color: var(--vp-c-text-1); + transition: opacity 0.25s; +} +@media (min-width: 960px) { +.title[data-v-1168a8e4] { + flex-shrink: 0; +} +.VPNavBarTitle.has-sidebar .title[data-v-1168a8e4] { + border-bottom-color: var(--vp-c-divider); +} +} +[data-v-1168a8e4] .logo { + margin-right: 8px; + height: var(--vp-nav-logo-height); +} + +.VPNavBarTranslations[data-v-88af2de4] { + display: none; +} +@media (min-width: 1280px) { +.VPNavBarTranslations[data-v-88af2de4] { + display: flex; + align-items: center; +} +} +.title[data-v-88af2de4] { + padding: 0 24px 0 12px; + line-height: 32px; + font-size: 14px; + font-weight: 700; + color: var(--vp-c-text-1); +} + +.VPNavBar[data-v-6aa21345] { + position: relative; + height: var(--vp-nav-height); + pointer-events: none; + white-space: nowrap; + transition: background-color 0.25s; +} +.VPNavBar.screen-open[data-v-6aa21345] { + transition: none; + background-color: var(--vp-nav-bg-color); + border-bottom: 1px solid var(--vp-c-divider); +} +.VPNavBar[data-v-6aa21345]:not(.home) { + background-color: var(--vp-nav-bg-color); +} +@media (min-width: 960px) { +.VPNavBar[data-v-6aa21345]:not(.home) { + background-color: transparent; +} +.VPNavBar[data-v-6aa21345]:not(.has-sidebar):not(.home.top) { + background-color: var(--vp-nav-bg-color); +} +} +.wrapper[data-v-6aa21345] { + padding: 0 8px 0 24px; +} +@media (min-width: 768px) { +.wrapper[data-v-6aa21345] { + padding: 0 32px; +} +} +@media (min-width: 960px) { +.VPNavBar.has-sidebar .wrapper[data-v-6aa21345] { + padding: 0; +} +} +.container[data-v-6aa21345] { + display: flex; + justify-content: space-between; + margin: 0 auto; + max-width: calc(var(--vp-layout-max-width) - 64px); + height: var(--vp-nav-height); + pointer-events: none; +} +.container > .title[data-v-6aa21345], +.container > .content[data-v-6aa21345] { + pointer-events: none; +} +.container[data-v-6aa21345] * { + pointer-events: auto; +} +@media (min-width: 960px) { +.VPNavBar.has-sidebar .container[data-v-6aa21345] { + max-width: 100%; +} +} +.title[data-v-6aa21345] { + flex-shrink: 0; + height: calc(var(--vp-nav-height) - 1px); + transition: background-color 0.5s; +} +@media (min-width: 960px) { +.VPNavBar.has-sidebar .title[data-v-6aa21345] { + position: absolute; + top: 0; + left: 0; + z-index: 2; + padding: 0 32px; + width: var(--vp-sidebar-width); + height: var(--vp-nav-height); + background-color: transparent; +} +} +@media (min-width: 1440px) { +.VPNavBar.has-sidebar .title[data-v-6aa21345] { + padding-left: max(32px, calc((100% - (var(--vp-layout-max-width) - 64px)) / 2)); + width: calc((100% - (var(--vp-layout-max-width) - 64px)) / 2 + var(--vp-sidebar-width) - 32px); +} +} +.content[data-v-6aa21345] { + flex-grow: 1; +} +@media (min-width: 960px) { +.VPNavBar.has-sidebar .content[data-v-6aa21345] { + position: relative; + z-index: 1; + padding-right: 32px; + padding-left: var(--vp-sidebar-width); +} +} +@media (min-width: 1440px) { +.VPNavBar.has-sidebar .content[data-v-6aa21345] { + padding-right: calc((100vw - var(--vp-layout-max-width)) / 2 + 32px); + padding-left: calc((100vw - var(--vp-layout-max-width)) / 2 + var(--vp-sidebar-width)); +} +} +.content-body[data-v-6aa21345] { + display: flex; + justify-content: flex-end; + align-items: center; + height: var(--vp-nav-height); + transition: background-color 0.5s; +} +@media (min-width: 960px) { +.VPNavBar:not(.home.top) .content-body[data-v-6aa21345] { + position: relative; + background-color: var(--vp-nav-bg-color); +} +.VPNavBar:not(.has-sidebar):not(.home.top) .content-body[data-v-6aa21345] { + background-color: transparent; +} +} +@media (max-width: 767px) { +.content-body[data-v-6aa21345] { + column-gap: 0.5rem; +} +} +.menu + .translations[data-v-6aa21345]::before, +.menu + .appearance[data-v-6aa21345]::before, +.menu + .social-links[data-v-6aa21345]::before, +.translations + .appearance[data-v-6aa21345]::before, +.appearance + .social-links[data-v-6aa21345]::before { + margin-right: 8px; + margin-left: 8px; + width: 1px; + height: 24px; + background-color: var(--vp-c-divider); + content: ""; +} +.menu + .appearance[data-v-6aa21345]::before, +.translations + .appearance[data-v-6aa21345]::before { + margin-right: 16px; +} +.appearance + .social-links[data-v-6aa21345]::before { + margin-left: 16px; +} +.social-links[data-v-6aa21345] { + margin-right: -8px; +} +.divider[data-v-6aa21345] { + width: 100%; + height: 1px; +} +@media (min-width: 960px) { +.VPNavBar.has-sidebar .divider[data-v-6aa21345] { + padding-left: var(--vp-sidebar-width); +} +} +@media (min-width: 1440px) { +.VPNavBar.has-sidebar .divider[data-v-6aa21345] { + padding-left: calc((100vw - var(--vp-layout-max-width)) / 2 + var(--vp-sidebar-width)); +} +} +.divider-line[data-v-6aa21345] { + width: 100%; + height: 1px; + transition: background-color 0.5s; +} +.VPNavBar:not(.home) .divider-line[data-v-6aa21345] { + background-color: var(--vp-c-gutter); +} +@media (min-width: 960px) { +.VPNavBar:not(.home.top) .divider-line[data-v-6aa21345] { + background-color: var(--vp-c-gutter); +} +.VPNavBar:not(.has-sidebar):not(.home.top) .divider[data-v-6aa21345] { + background-color: var(--vp-c-gutter); +} +} + +.VPNavScreenAppearance[data-v-b44890b2] { + display: flex; + justify-content: space-between; + align-items: center; + border-radius: 8px; + padding: 12px 14px 12px 16px; + background-color: var(--vp-c-bg-soft); +} +.text[data-v-b44890b2] { + line-height: 24px; + font-size: 12px; + font-weight: 500; + color: var(--vp-c-text-2); +} + +.VPNavScreenMenuLink[data-v-df37e6dd] { + display: block; + border-bottom: 1px solid var(--vp-c-divider); + padding: 12px 0 11px; + line-height: 24px; + font-size: 14px; + font-weight: 500; + color: var(--vp-c-text-1); + transition: + border-color 0.25s, + color 0.25s; +} +.VPNavScreenMenuLink[data-v-df37e6dd]:hover { + color: var(--vp-c-brand-1); +} + +.VPNavScreenMenuGroupLink[data-v-3e9c20e4] { + display: block; + margin-left: 12px; + line-height: 32px; + font-size: 14px; + font-weight: 400; + color: var(--vp-c-text-1); + transition: color 0.25s; +} +.VPNavScreenMenuGroupLink[data-v-3e9c20e4]:hover { + color: var(--vp-c-brand-1); +} + +.VPNavScreenMenuGroupSection[data-v-8133b170] { + display: block; +} +.title[data-v-8133b170] { + line-height: 32px; + font-size: 13px; + font-weight: 700; + color: var(--vp-c-text-2); + transition: color 0.25s; +} + +.VPNavScreenMenuGroup[data-v-b9ab8c58] { + border-bottom: 1px solid var(--vp-c-divider); + height: 48px; + overflow: hidden; + transition: border-color 0.5s; +} +.VPNavScreenMenuGroup .items[data-v-b9ab8c58] { + visibility: hidden; +} +.VPNavScreenMenuGroup.open .items[data-v-b9ab8c58] { + visibility: visible; +} +.VPNavScreenMenuGroup.open[data-v-b9ab8c58] { + padding-bottom: 10px; + height: auto; +} +.VPNavScreenMenuGroup.open .button[data-v-b9ab8c58] { + padding-bottom: 6px; + color: var(--vp-c-brand-1); +} +.VPNavScreenMenuGroup.open .button-icon[data-v-b9ab8c58] { + /*rtl:ignore*/ + transform: rotate(45deg); +} +.button[data-v-b9ab8c58] { + display: flex; + justify-content: space-between; + align-items: center; + padding: 12px 4px 11px 0; + width: 100%; + line-height: 24px; + font-size: 14px; + font-weight: 500; + color: var(--vp-c-text-1); + transition: color 0.25s; +} +.button[data-v-b9ab8c58]:hover { + color: var(--vp-c-brand-1); +} +.button-icon[data-v-b9ab8c58] { + transition: transform 0.25s; +} +.group[data-v-b9ab8c58]:first-child { + padding-top: 0px; +} +.group + .group[data-v-b9ab8c58], +.group + .item[data-v-b9ab8c58] { + padding-top: 4px; +} + +.VPNavScreenTranslations[data-v-858fe1a4] { + height: 24px; + overflow: hidden; +} +.VPNavScreenTranslations.open[data-v-858fe1a4] { + height: auto; +} +.title[data-v-858fe1a4] { + display: flex; + align-items: center; + font-size: 14px; + font-weight: 500; + color: var(--vp-c-text-1); +} +.icon[data-v-858fe1a4] { + font-size: 16px; +} +.icon.lang[data-v-858fe1a4] { + margin-right: 8px; +} +.icon.chevron[data-v-858fe1a4] { + margin-left: 4px; +} +.list[data-v-858fe1a4] { + padding: 4px 0 0 24px; +} +.link[data-v-858fe1a4] { + line-height: 32px; + font-size: 13px; + color: var(--vp-c-text-1); +} + +.VPNavScreen[data-v-f2779853] { + position: fixed; + top: calc(var(--vp-nav-height) + var(--vp-layout-top-height, 0px)); + /*rtl:ignore*/ + right: 0; + bottom: 0; + /*rtl:ignore*/ + left: 0; + padding: 0 32px; + width: 100%; + background-color: var(--vp-nav-screen-bg-color); + overflow-y: auto; + transition: background-color 0.25s; + pointer-events: auto; +} +.VPNavScreen.fade-enter-active[data-v-f2779853], +.VPNavScreen.fade-leave-active[data-v-f2779853] { + transition: opacity 0.25s; +} +.VPNavScreen.fade-enter-active .container[data-v-f2779853], +.VPNavScreen.fade-leave-active .container[data-v-f2779853] { + transition: transform 0.25s ease; +} +.VPNavScreen.fade-enter-from[data-v-f2779853], +.VPNavScreen.fade-leave-to[data-v-f2779853] { + opacity: 0; +} +.VPNavScreen.fade-enter-from .container[data-v-f2779853], +.VPNavScreen.fade-leave-to .container[data-v-f2779853] { + transform: translateY(-8px); +} +@media (min-width: 768px) { +.VPNavScreen[data-v-f2779853] { + display: none; +} +} +.container[data-v-f2779853] { + margin: 0 auto; + padding: 24px 0 96px; + max-width: 288px; +} +.menu + .translations[data-v-f2779853], +.menu + .appearance[data-v-f2779853], +.translations + .appearance[data-v-f2779853] { + margin-top: 24px; +} +.menu + .social-links[data-v-f2779853] { + margin-top: 16px; +} +.appearance + .social-links[data-v-f2779853] { + margin-top: 16px; +} + +.VPNav[data-v-ae24b3ad] { + position: relative; + top: var(--vp-layout-top-height, 0px); + /*rtl:ignore*/ + left: 0; + z-index: var(--vp-z-index-nav); + width: 100%; + pointer-events: none; + transition: background-color 0.5s; +} +@media (min-width: 960px) { +.VPNav[data-v-ae24b3ad] { + position: fixed; +} +} + +.VPSidebarItem.level-0[data-v-b3fd67f8] { + padding-bottom: 24px; +} +.VPSidebarItem.collapsed.level-0[data-v-b3fd67f8] { + padding-bottom: 10px; +} +.item[data-v-b3fd67f8] { + position: relative; + display: flex; + width: 100%; +} +.VPSidebarItem.collapsible > .item[data-v-b3fd67f8] { + cursor: pointer; +} +.indicator[data-v-b3fd67f8] { + position: absolute; + top: 6px; + bottom: 6px; + left: -17px; + width: 2px; + border-radius: 2px; + transition: background-color 0.25s; +} +.VPSidebarItem.level-2.is-active > .item > .indicator[data-v-b3fd67f8], +.VPSidebarItem.level-3.is-active > .item > .indicator[data-v-b3fd67f8], +.VPSidebarItem.level-4.is-active > .item > .indicator[data-v-b3fd67f8], +.VPSidebarItem.level-5.is-active > .item > .indicator[data-v-b3fd67f8] { + background-color: var(--vp-c-brand-1); +} +.link[data-v-b3fd67f8] { + display: flex; + align-items: center; + flex-grow: 1; +} +.text[data-v-b3fd67f8] { + flex-grow: 1; + padding: 4px 0; + line-height: 24px; + font-size: 14px; + transition: color 0.25s; +} +.VPSidebarItem.level-0 .text[data-v-b3fd67f8] { + font-weight: 700; + color: var(--vp-c-text-1); +} +.VPSidebarItem.level-1 .text[data-v-b3fd67f8], +.VPSidebarItem.level-2 .text[data-v-b3fd67f8], +.VPSidebarItem.level-3 .text[data-v-b3fd67f8], +.VPSidebarItem.level-4 .text[data-v-b3fd67f8], +.VPSidebarItem.level-5 .text[data-v-b3fd67f8] { + font-weight: 500; + color: var(--vp-c-text-2); +} +.VPSidebarItem.level-0.is-link > .item > .link:hover .text[data-v-b3fd67f8], +.VPSidebarItem.level-1.is-link > .item > .link:hover .text[data-v-b3fd67f8], +.VPSidebarItem.level-2.is-link > .item > .link:hover .text[data-v-b3fd67f8], +.VPSidebarItem.level-3.is-link > .item > .link:hover .text[data-v-b3fd67f8], +.VPSidebarItem.level-4.is-link > .item > .link:hover .text[data-v-b3fd67f8], +.VPSidebarItem.level-5.is-link > .item > .link:hover .text[data-v-b3fd67f8] { + color: var(--vp-c-brand-1); +} +.VPSidebarItem.level-0.has-active > .item > .text[data-v-b3fd67f8], +.VPSidebarItem.level-1.has-active > .item > .text[data-v-b3fd67f8], +.VPSidebarItem.level-2.has-active > .item > .text[data-v-b3fd67f8], +.VPSidebarItem.level-3.has-active > .item > .text[data-v-b3fd67f8], +.VPSidebarItem.level-4.has-active > .item > .text[data-v-b3fd67f8], +.VPSidebarItem.level-5.has-active > .item > .text[data-v-b3fd67f8], +.VPSidebarItem.level-0.has-active > .item > .link > .text[data-v-b3fd67f8], +.VPSidebarItem.level-1.has-active > .item > .link > .text[data-v-b3fd67f8], +.VPSidebarItem.level-2.has-active > .item > .link > .text[data-v-b3fd67f8], +.VPSidebarItem.level-3.has-active > .item > .link > .text[data-v-b3fd67f8], +.VPSidebarItem.level-4.has-active > .item > .link > .text[data-v-b3fd67f8], +.VPSidebarItem.level-5.has-active > .item > .link > .text[data-v-b3fd67f8] { + color: var(--vp-c-text-1); +} +.VPSidebarItem.level-0.is-active > .item .link > .text[data-v-b3fd67f8], +.VPSidebarItem.level-1.is-active > .item .link > .text[data-v-b3fd67f8], +.VPSidebarItem.level-2.is-active > .item .link > .text[data-v-b3fd67f8], +.VPSidebarItem.level-3.is-active > .item .link > .text[data-v-b3fd67f8], +.VPSidebarItem.level-4.is-active > .item .link > .text[data-v-b3fd67f8], +.VPSidebarItem.level-5.is-active > .item .link > .text[data-v-b3fd67f8] { + color: var(--vp-c-brand-1); +} +.caret[data-v-b3fd67f8] { + display: flex; + justify-content: center; + align-items: center; + margin-right: -7px; + width: 32px; + height: 32px; + color: var(--vp-c-text-3); + cursor: pointer; + transition: color 0.25s; + flex-shrink: 0; +} +.item:hover .caret[data-v-b3fd67f8] { + color: var(--vp-c-text-2); +} +.item:hover .caret[data-v-b3fd67f8]:hover { + color: var(--vp-c-text-1); +} +.caret-icon[data-v-b3fd67f8] { + font-size: 18px; + /*rtl:ignore*/ + transform: rotate(90deg); + transition: transform 0.25s; +} +.VPSidebarItem.collapsed .caret-icon[data-v-b3fd67f8] { + transform: rotate(0)/*rtl:rotate(180deg)*/; +} +.VPSidebarItem.level-1 .items[data-v-b3fd67f8], +.VPSidebarItem.level-2 .items[data-v-b3fd67f8], +.VPSidebarItem.level-3 .items[data-v-b3fd67f8], +.VPSidebarItem.level-4 .items[data-v-b3fd67f8], +.VPSidebarItem.level-5 .items[data-v-b3fd67f8] { + border-left: 1px solid var(--vp-c-divider); + padding-left: 16px; +} +.VPSidebarItem.collapsed .items[data-v-b3fd67f8] { + display: none; +} + +.no-transition[data-v-c40bc020] .caret-icon { + transition: none; +} +.group + .group[data-v-c40bc020] { + border-top: 1px solid var(--vp-c-divider); + padding-top: 10px; +} +@media (min-width: 960px) { +.group[data-v-c40bc020] { + padding-top: 10px; + width: calc(var(--vp-sidebar-width) - 64px); +} +} + +.VPSidebar[data-v-319d5ca6] { + position: fixed; + top: var(--vp-layout-top-height, 0px); + bottom: 0; + left: 0; + z-index: var(--vp-z-index-sidebar); + padding: 32px 32px 96px; + width: calc(100vw - 64px); + max-width: 320px; + background-color: var(--vp-sidebar-bg-color); + opacity: 0; + box-shadow: var(--vp-c-shadow-3); + overflow-x: hidden; + overflow-y: auto; + transform: translateX(-100%); + transition: opacity 0.5s, transform 0.25s ease; + overscroll-behavior: contain; +} +.VPSidebar.open[data-v-319d5ca6] { + opacity: 1; + visibility: visible; + transform: translateX(0); + transition: opacity 0.25s, + transform 0.5s cubic-bezier(0.19, 1, 0.22, 1); +} +.dark .VPSidebar[data-v-319d5ca6] { + box-shadow: var(--vp-shadow-1); +} +@media (min-width: 960px) { +.VPSidebar[data-v-319d5ca6] { + padding-top: var(--vp-nav-height); + width: var(--vp-sidebar-width); + max-width: 100%; + background-color: var(--vp-sidebar-bg-color); + opacity: 1; + visibility: visible; + box-shadow: none; + transform: translateX(0); +} +} +@media (min-width: 1440px) { +.VPSidebar[data-v-319d5ca6] { + padding-left: max(32px, calc((100% - (var(--vp-layout-max-width) - 64px)) / 2)); + width: calc((100% - (var(--vp-layout-max-width) - 64px)) / 2 + var(--vp-sidebar-width) - 32px); +} +} +@media (min-width: 960px) { +.curtain[data-v-319d5ca6] { + position: sticky; + top: -64px; + left: 0; + z-index: 1; + margin-top: calc(var(--vp-nav-height) * -1); + margin-right: -32px; + margin-left: -32px; + height: var(--vp-nav-height); + background-color: var(--vp-sidebar-bg-color); +} +} +.nav[data-v-319d5ca6] { + outline: 0; +} + +.VPSkipLink[data-v-0b0ada53] { + top: 8px; + left: 8px; + padding: 8px 16px; + z-index: 999; + border-radius: 8px; + font-size: 12px; + font-weight: bold; + text-decoration: none; + color: var(--vp-c-brand-1); + box-shadow: var(--vp-shadow-3); + background-color: var(--vp-c-bg); +} +.VPSkipLink[data-v-0b0ada53]:focus { + height: auto; + width: auto; + clip: auto; + clip-path: none; +} +@media (min-width: 1280px) { +.VPSkipLink[data-v-0b0ada53] { + top: 14px; + left: 16px; +} +} + +.Layout[data-v-5d98c3a5] { + display: flex; + flex-direction: column; + min-height: 100vh; +} + +.VPHomeSponsors[data-v-3d121b4a] { + border-top: 1px solid var(--vp-c-gutter); + padding-top: 88px !important; +} +.VPHomeSponsors[data-v-3d121b4a] { + margin: 96px 0; +} +@media (min-width: 768px) { +.VPHomeSponsors[data-v-3d121b4a] { + margin: 128px 0; +} +} +.VPHomeSponsors[data-v-3d121b4a] { + padding: 0 24px; +} +@media (min-width: 768px) { +.VPHomeSponsors[data-v-3d121b4a] { + padding: 0 48px; +} +} +@media (min-width: 960px) { +.VPHomeSponsors[data-v-3d121b4a] { + padding: 0 64px; +} +} +.container[data-v-3d121b4a] { + margin: 0 auto; + max-width: 1152px; +} +.love[data-v-3d121b4a] { + margin: 0 auto; + width: fit-content; + font-size: 28px; + color: var(--vp-c-text-3); +} +.icon[data-v-3d121b4a] { + display: inline-block; +} +.message[data-v-3d121b4a] { + margin: 0 auto; + padding-top: 10px; + max-width: 320px; + text-align: center; + line-height: 24px; + font-size: 16px; + font-weight: 500; + color: var(--vp-c-text-2); +} +.sponsors[data-v-3d121b4a] { + padding-top: 32px; +} +.action[data-v-3d121b4a] { + padding-top: 40px; + text-align: center; +} + +.VPTeamMembersItem[data-v-f3fa364a] { + display: flex; + flex-direction: column; + gap: 2px; + border-radius: 12px; + width: 100%; + height: 100%; + overflow: hidden; +} +.VPTeamMembersItem.small .profile[data-v-f3fa364a] { + padding: 32px; +} +.VPTeamMembersItem.small .data[data-v-f3fa364a] { + padding-top: 20px; +} +.VPTeamMembersItem.small .avatar[data-v-f3fa364a] { + width: 64px; + height: 64px; +} +.VPTeamMembersItem.small .name[data-v-f3fa364a] { + line-height: 24px; + font-size: 16px; +} +.VPTeamMembersItem.small .affiliation[data-v-f3fa364a] { + padding-top: 4px; + line-height: 20px; + font-size: 14px; +} +.VPTeamMembersItem.small .desc[data-v-f3fa364a] { + padding-top: 12px; + line-height: 20px; + font-size: 14px; +} +.VPTeamMembersItem.small .links[data-v-f3fa364a] { + margin: 0 -16px -20px; + padding: 10px 0 0; +} +.VPTeamMembersItem.medium .profile[data-v-f3fa364a] { + padding: 48px 32px; +} +.VPTeamMembersItem.medium .data[data-v-f3fa364a] { + padding-top: 24px; + text-align: center; +} +.VPTeamMembersItem.medium .avatar[data-v-f3fa364a] { + width: 96px; + height: 96px; +} +.VPTeamMembersItem.medium .name[data-v-f3fa364a] { + letter-spacing: 0.15px; + line-height: 28px; + font-size: 20px; +} +.VPTeamMembersItem.medium .affiliation[data-v-f3fa364a] { + padding-top: 4px; + font-size: 16px; +} +.VPTeamMembersItem.medium .desc[data-v-f3fa364a] { + padding-top: 16px; + max-width: 288px; + font-size: 16px; +} +.VPTeamMembersItem.medium .links[data-v-f3fa364a] { + margin: 0 -16px -12px; + padding: 16px 12px 0; +} +.profile[data-v-f3fa364a] { + flex-grow: 1; + background-color: var(--vp-c-bg-soft); +} +.data[data-v-f3fa364a] { + text-align: center; +} +.avatar[data-v-f3fa364a] { + position: relative; + flex-shrink: 0; + margin: 0 auto; + border-radius: 50%; + box-shadow: var(--vp-shadow-3); +} +.avatar-img[data-v-f3fa364a] { + position: absolute; + top: 0; + right: 0; + bottom: 0; + left: 0; + border-radius: 50%; + object-fit: cover; +} +.name[data-v-f3fa364a] { + margin: 0; + font-weight: 600; +} +.affiliation[data-v-f3fa364a] { + margin: 0; + font-weight: 500; + color: var(--vp-c-text-2); +} +.org.link[data-v-f3fa364a] { + color: var(--vp-c-text-2); + transition: color 0.25s; +} +.org.link[data-v-f3fa364a]:hover { + color: var(--vp-c-brand-1); +} +.desc[data-v-f3fa364a] { + margin: 0 auto; +} +.desc[data-v-f3fa364a] a { + font-weight: 500; + color: var(--vp-c-brand-1); + text-decoration-style: dotted; + transition: color 0.25s; +} +.links[data-v-f3fa364a] { + display: flex; + justify-content: center; + height: 56px; +} +.sp-link[data-v-f3fa364a] { + display: flex; + justify-content: center; + align-items: center; + text-align: center; + padding: 16px; + font-size: 14px; + font-weight: 500; + color: var(--vp-c-sponsor); + background-color: var(--vp-c-bg-soft); + transition: color 0.25s, background-color 0.25s; +} +.sp .sp-link.link[data-v-f3fa364a]:hover, +.sp .sp-link.link[data-v-f3fa364a]:focus { + outline: none; + color: var(--vp-c-white); + background-color: var(--vp-c-sponsor); +} +.sp-icon[data-v-f3fa364a] { + margin-right: 8px; + font-size: 16px; +} + +.VPTeamMembers.small .container[data-v-6cb0dbc4] { + grid-template-columns: repeat(auto-fit, minmax(224px, 1fr)); +} +.VPTeamMembers.small.count-1 .container[data-v-6cb0dbc4] { + max-width: 276px; +} +.VPTeamMembers.small.count-2 .container[data-v-6cb0dbc4] { + max-width: calc(276px * 2 + 24px); +} +.VPTeamMembers.small.count-3 .container[data-v-6cb0dbc4] { + max-width: calc(276px * 3 + 24px * 2); +} +.VPTeamMembers.medium .container[data-v-6cb0dbc4] { + grid-template-columns: repeat(auto-fit, minmax(256px, 1fr)); +} +@media (min-width: 375px) { +.VPTeamMembers.medium .container[data-v-6cb0dbc4] { + grid-template-columns: repeat(auto-fit, minmax(288px, 1fr)); +} +} +.VPTeamMembers.medium.count-1 .container[data-v-6cb0dbc4] { + max-width: 368px; +} +.VPTeamMembers.medium.count-2 .container[data-v-6cb0dbc4] { + max-width: calc(368px * 2 + 24px); +} +.container[data-v-6cb0dbc4] { + display: grid; + gap: 24px; + margin: 0 auto; + max-width: 1152px; +} + +.VPTeamPage[data-v-7c57f839] { + margin: 96px 0; +} +@media (min-width: 768px) { +.VPTeamPage[data-v-7c57f839] { + margin: 128px 0; +} +} +.VPHome .VPTeamPageTitle[data-v-7c57f839-s] { + border-top: 1px solid var(--vp-c-gutter); + padding-top: 88px !important; +} +.VPTeamPageSection + .VPTeamPageSection[data-v-7c57f839-s],.VPTeamMembers + .VPTeamPageSection[data-v-7c57f839-s] { + margin-top: 64px; +} +.VPTeamMembers + .VPTeamMembers[data-v-7c57f839-s] { + margin-top: 24px; +} +@media (min-width: 768px) { +.VPTeamPageTitle + .VPTeamPageSection[data-v-7c57f839-s] { + margin-top: 16px; +} +.VPTeamPageSection + .VPTeamPageSection[data-v-7c57f839-s],.VPTeamMembers + .VPTeamPageSection[data-v-7c57f839-s] { + margin-top: 96px; +} +} +.VPTeamMembers[data-v-7c57f839-s] { + padding: 0 24px; +} +@media (min-width: 768px) { +.VPTeamMembers[data-v-7c57f839-s] { + padding: 0 48px; +} +} +@media (min-width: 960px) { +.VPTeamMembers[data-v-7c57f839-s] { + padding: 0 64px; +} +} + +.VPTeamPageSection[data-v-b1a88750] { + padding: 0 32px; +} +@media (min-width: 768px) { +.VPTeamPageSection[data-v-b1a88750] { + padding: 0 48px; +} +} +@media (min-width: 960px) { +.VPTeamPageSection[data-v-b1a88750] { + padding: 0 64px; +} +} +.title[data-v-b1a88750] { + position: relative; + margin: 0 auto; + max-width: 1152px; + text-align: center; + color: var(--vp-c-text-2); +} +.title-line[data-v-b1a88750] { + position: absolute; + top: 16px; + left: 0; + width: 100%; + height: 1px; + background-color: var(--vp-c-divider); +} +.title-text[data-v-b1a88750] { + position: relative; + display: inline-block; + padding: 0 24px; + letter-spacing: 0; + line-height: 32px; + font-size: 20px; + font-weight: 500; + background-color: var(--vp-c-bg); +} +.lead[data-v-b1a88750] { + margin: 0 auto; + max-width: 480px; + padding-top: 12px; + text-align: center; + line-height: 24px; + font-size: 16px; + font-weight: 500; + color: var(--vp-c-text-2); +} +.members[data-v-b1a88750] { + padding-top: 40px; +} + +.VPTeamPageTitle[data-v-bf2cbdac] { + padding: 48px 32px; + text-align: center; +} +@media (min-width: 768px) { +.VPTeamPageTitle[data-v-bf2cbdac] { + padding: 64px 48px 48px; +} +} +@media (min-width: 960px) { +.VPTeamPageTitle[data-v-bf2cbdac] { + padding: 80px 64px 48px; +} +} +.title[data-v-bf2cbdac] { + letter-spacing: 0; + line-height: 44px; + font-size: 36px; + font-weight: 500; +} +@media (min-width: 768px) { +.title[data-v-bf2cbdac] { + letter-spacing: -0.5px; + line-height: 56px; + font-size: 48px; +} +} +.lead[data-v-bf2cbdac] { + margin: 0 auto; + max-width: 512px; + padding-top: 12px; + line-height: 24px; + font-size: 16px; + font-weight: 500; + color: var(--vp-c-text-2); +} +@media (min-width: 768px) { +.lead[data-v-bf2cbdac] { + max-width: 592px; + letter-spacing: 0.15px; + line-height: 28px; + font-size: 20px; +} +} + +.VPLocalSearchBox[data-v-ce626c7c] { + position: fixed; + z-index: 100; + inset: 0; + display: flex; +} +.backdrop[data-v-ce626c7c] { + position: absolute; + inset: 0; + background: var(--vp-backdrop-bg-color); + transition: opacity 0.5s; +} +.shell[data-v-ce626c7c] { + position: relative; + padding: 12px; + margin: 64px auto; + display: flex; + flex-direction: column; + gap: 16px; + background: var(--vp-local-search-bg); + width: min(100vw - 60px, 900px); + height: min-content; + max-height: min(100vh - 128px, 900px); + border-radius: 6px; +} +@media (max-width: 767px) { +.shell[data-v-ce626c7c] { + margin: 0; + width: 100vw; + height: 100vh; + max-height: none; + border-radius: 0; +} +} +.search-bar[data-v-ce626c7c] { + border: 1px solid var(--vp-c-divider); + border-radius: 4px; + display: flex; + align-items: center; + padding: 0 12px; + cursor: text; +} +@media (max-width: 767px) { +.search-bar[data-v-ce626c7c] { + padding: 0 8px; +} +} +.search-bar[data-v-ce626c7c]:focus-within { + border-color: var(--vp-c-brand-1); +} +.local-search-icon[data-v-ce626c7c] { + display: block; + font-size: 18px; +} +.navigate-icon[data-v-ce626c7c] { + display: block; + font-size: 14px; +} +.search-icon[data-v-ce626c7c] { + margin: 8px; +} +@media (max-width: 767px) { +.search-icon[data-v-ce626c7c] { + display: none; +} +} +.search-input[data-v-ce626c7c] { + padding: 6px 12px; + font-size: inherit; + width: 100%; +} +@media (max-width: 767px) { +.search-input[data-v-ce626c7c] { + padding: 6px 4px; +} +} +.search-actions[data-v-ce626c7c] { + display: flex; + gap: 4px; +} +@media (any-pointer: coarse) { +.search-actions[data-v-ce626c7c] { + gap: 8px; +} +} +@media (min-width: 769px) { +.search-actions.before[data-v-ce626c7c] { + display: none; +} +} +.search-actions button[data-v-ce626c7c] { + padding: 8px; +} +.search-actions button[data-v-ce626c7c]:not([disabled]):hover, +.toggle-layout-button.detailed-list[data-v-ce626c7c] { + color: var(--vp-c-brand-1); +} +.search-actions button.clear-button[data-v-ce626c7c]:disabled { + opacity: 0.37; +} +.search-keyboard-shortcuts[data-v-ce626c7c] { + font-size: 0.8rem; + opacity: 75%; + display: flex; + flex-wrap: wrap; + gap: 16px; + line-height: 14px; +} +.search-keyboard-shortcuts span[data-v-ce626c7c] { + display: flex; + align-items: center; + gap: 4px; +} +@media (max-width: 767px) { +.search-keyboard-shortcuts[data-v-ce626c7c] { + display: none; +} +} +.search-keyboard-shortcuts kbd[data-v-ce626c7c] { + background: rgba(128, 128, 128, 0.1); + border-radius: 4px; + padding: 3px 6px; + min-width: 24px; + display: inline-block; + text-align: center; + vertical-align: middle; + border: 1px solid rgba(128, 128, 128, 0.15); + box-shadow: 0 2px 2px 0 rgba(0, 0, 0, 0.1); +} +.results[data-v-ce626c7c] { + display: flex; + flex-direction: column; + gap: 6px; + overflow-x: hidden; + overflow-y: auto; + overscroll-behavior: contain; +} +.result[data-v-ce626c7c] { + display: flex; + align-items: center; + gap: 8px; + border-radius: 4px; + transition: none; + line-height: 1rem; + border: solid 2px var(--vp-local-search-result-border); + outline: none; +} +.result > div[data-v-ce626c7c] { + margin: 12px; + width: 100%; + overflow: hidden; +} +@media (max-width: 767px) { +.result > div[data-v-ce626c7c] { + margin: 8px; +} +} +.titles[data-v-ce626c7c] { + display: flex; + flex-wrap: wrap; + gap: 4px; + position: relative; + z-index: 1001; + padding: 2px 0; +} +.title[data-v-ce626c7c] { + display: flex; + align-items: center; + gap: 4px; +} +.title.main[data-v-ce626c7c] { + font-weight: 500; +} +.title-icon[data-v-ce626c7c] { + opacity: 0.5; + font-weight: 500; + color: var(--vp-c-brand-1); +} +.title svg[data-v-ce626c7c] { + opacity: 0.5; +} +.result.selected[data-v-ce626c7c] { + --vp-local-search-result-bg: var(--vp-local-search-result-selected-bg); + border-color: var(--vp-local-search-result-selected-border); +} +.excerpt-wrapper[data-v-ce626c7c] { + position: relative; +} +.excerpt[data-v-ce626c7c] { + opacity: 50%; + pointer-events: none; + max-height: 140px; + overflow: hidden; + position: relative; + margin-top: 4px; +} +.result.selected .excerpt[data-v-ce626c7c] { + opacity: 1; +} +.excerpt[data-v-ce626c7c] * { + font-size: 0.8rem !important; + line-height: 130% !important; +} +.titles[data-v-ce626c7c] mark, +.excerpt[data-v-ce626c7c] mark { + background-color: var(--vp-local-search-highlight-bg); + color: var(--vp-local-search-highlight-text); + border-radius: 2px; + padding: 0 2px; +} +.excerpt[data-v-ce626c7c] .vp-code-group .tabs { + display: none; +} +.excerpt[data-v-ce626c7c] .vp-code-group div[class*='language-'] { + border-radius: 8px !important; +} +.excerpt-gradient-bottom[data-v-ce626c7c] { + position: absolute; + bottom: -1px; + left: 0; + width: 100%; + height: 8px; + background: linear-gradient(transparent, var(--vp-local-search-result-bg)); + z-index: 1000; +} +.excerpt-gradient-top[data-v-ce626c7c] { + position: absolute; + top: -1px; + left: 0; + width: 100%; + height: 8px; + background: linear-gradient(var(--vp-local-search-result-bg), transparent); + z-index: 1000; +} +.result.selected .titles[data-v-ce626c7c], +.result.selected .title-icon[data-v-ce626c7c] { + color: var(--vp-c-brand-1) !important; +} +.no-results[data-v-ce626c7c] { + font-size: 0.9rem; + text-align: center; + padding: 12px; +} +svg[data-v-ce626c7c] { + flex: none; +} diff --git a/docs/.vitepress/.temp/index.md.js b/docs/.vitepress/.temp/index.md.js new file mode 100644 index 0000000..bba97dc --- /dev/null +++ b/docs/.vitepress/.temp/index.md.js @@ -0,0 +1,32 @@ +import { ssrRenderAttrs, ssrRenderStyle } from "vue/server-renderer"; +import { useSSRContext } from "vue"; +import { _ as _export_sfc } from "./plugin-vue_export-helper.1tPrXgE0.js"; +const __pageData = JSON.parse(`{"title":"ai-coding-kit","description":"","frontmatter":{"layout":"home","title":"ai-coding-kit","hero":{"name":"ai-coding-kit","text":"One Kit. All AI Coding Tools.","tagline":"Agent Skills management, MCP configuration sync, iOS engineering rules, and Universal RAG Gateway — unified for 8+ AI coding platforms.","image":false,"actions":[{"theme":"brand","text":"Get Started","link":"/ios-engineer/"},{"theme":"alt","text":"View on GitHub","link":"https://github.com/i-stack/ai-coding-kit"}]},"features":[{"icon":"🧠","title":"Agent Skills Engineering","details":"Define skills once, sync to Claude Code, Codex CLI, Cursor, Gemini CLI, CodeBuddy, Continue, Cline, and Xcode Coding Assistant — with structured evolution governance."},{"icon":"⚙️","title":"MCP Config Sync","details":"Single source of truth for MCP servers, API keys, and model settings. Auto-render to each platform's native config format."},{"icon":"🍎","title":"iOS Engineering Rules","details":"Production-grade Swift / SwiftUI / UIKit rules with 40+ rule IDs, symptom routing, task triage, and auto-evolution — maintained by an Agent Skill system."},{"icon":"🌐","title":"Universal RAG Gateway","details":"TypeScript / Fastify RAG gateway with OpenAI-compatible API — local memory, semantic retrieval, and multi-provider routing."},{"icon":"🔒","title":"Global Engineering Discipline","details":"Six global skills spanning security compliance, epistemic integrity, logical reasoning, cognitive expansion, and problem analysis — apply to any platform."},{"icon":"🚀","title":"Quick Start","details":"One clone, one secrets file, one sync command. Supports Homebrew and npm installation."}]},"headers":[],"relativePath":"index.md","filePath":"index.md","lastUpdated":1783251060000}`); +const _sfc_main = { name: "index.md" }; +function _sfc_ssrRender(_ctx, _push, _parent, _attrs, $props, $setup, $data, $options) { + _push(`

    Quick Start

    bash
    # Clone & configure
    +git clone https://github.com/i-stack/ai-coding-kit.git
    +cd ai-coding-kit
    +
    +# Edit your secrets (the only file you need to touch)
    +cp env/secrets.json.example env/secrets.json
    +$EDITOR env/secrets.json
    +
    +# One command to sync everything
    +bash sync.sh

    Or install via package manager

    bash
    # Homebrew
    +brew install i-stack/tap/ai-coding-kit
    +
    +# npm
    +npm install -g @i-stack/ai-coding-kit

    Platform Support

    ToolWhat Gets Synced
    Cursor.cursor/mcp.json
    CodeBuddy.codebuddy/mcp.json, models.json, skills/
    Claude Code.claude.json, settings.json, skills/
    Codex CLI.codex/config.toml, mcp.generated.toml
    Gemini CLIEnvironment variables
    Continue.continue/config.yaml
    Cline (VSCode)MCP settings JSON, skills/
    Xcode Coding AssistantCodex + Claude Agent config paths

    Modules

    ModuleDescription
    skills-engineering/Agent Skill content, multi-platform sync, governed evolution
    sync/MCP config sync engine — injects secrets, renders to native formats
    env/Config data source (secrets + MCP definitions + platform configs)
    rag-gateway/TypeScript / Fastify Universal RAG Gateway (OpenAI-compatible API)
    hooks/Project hooks (xmcp init, etc.)
    .githooks/Git commit/push guards (pre-commit + pre-push)
    `); +} +const _sfc_setup = _sfc_main.setup; +_sfc_main.setup = (props, ctx) => { + const ssrContext = useSSRContext(); + (ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("index.md"); + return _sfc_setup ? _sfc_setup(props, ctx) : void 0; +}; +const index = /* @__PURE__ */ _export_sfc(_sfc_main, [["ssrRender", _sfc_ssrRender]]); +export { + __pageData, + index as default +}; diff --git a/docs/.vitepress/.temp/ios-engineer_index.md.js b/docs/.vitepress/.temp/ios-engineer_index.md.js new file mode 100644 index 0000000..8423e6d --- /dev/null +++ b/docs/.vitepress/.temp/ios-engineer_index.md.js @@ -0,0 +1,38 @@ +import { resolveComponent, useSSRContext } from "vue"; +import { ssrRenderAttrs, ssrRenderComponent } from "vue/server-renderer"; +import { _ as _export_sfc } from "./plugin-vue_export-helper.1tPrXgE0.js"; +const __pageData = JSON.parse('{"title":"iOS Engineer","description":"","frontmatter":{},"headers":[],"relativePath":"ios-engineer/index.md","filePath":"ios-engineer/index.md","lastUpdated":1783251060000}'); +const _sfc_main = { name: "ios-engineer/index.md" }; +function _sfc_ssrRender(_ctx, _push, _parent, _attrs, $props, $setup, $data, $options) { + const _component_Badge = resolveComponent("Badge"); + _push(`

    iOS Engineer

    `); + _push(ssrRenderComponent(_component_Badge, { + type: "tip", + text: "v3.0.0" + }, null, _parent)); + _push(`

    iOS / Swift / SwiftUI / UIKit / Xcode / CocoaPods / SPM engineering — architecture, concurrency, networking, performance, crash debugging, code review, refactoring, migration, testing.

    This is the primary Agent Skill in ai-coding-kit, providing production-grade AI coding rules for iOS development.

    Supported Locales

    English (en-US) · 简体中文 (zh-CN). The skill auto-matches your language.

    Architecture

    The skill is organized as a layered system:

    ios-engineer/
    +├── SKILL.md              # Entry point: routing, triggers, output templates
    +├── references/           # 34 domain reference files (zh-CN)
    +│   ├── rule_index.md     # Canonical Rule ID registry
    +│   ├── self_evolution.md # Auto-evolution governance
    +│   └── ...               # 31 domain-specific references
    +├── i18n/en-US/           # English governance-layer mirrors
    +│   └── references/
    +├── scripts/              # 27 validation & evolution scripts
    +├── evolution/            # Proposal-driven evolution pipeline
    +│   ├── proposals/        # Active/in-review proposals
    +│   ├── archive/          # Archived/implemented proposals
    +│   └── hooks/            # Evolution guard scripts
    +└── snapshots/            # Evolution snapshots for consistency checks

    Rule System

    The skill enforces 40+ rule IDs across 5 categories:

    CategoryPrefixCountScope
    Iron RulesIR-NNN3Always enforced
    Global RulesGR-NNN9Cross-platform (epistemic, logic, discipline)
    Symptom RoutingSYM-NNN7Auto-route symptoms → references
    Task RoutingROUTE-NNN10Auto-route task types → references
    Output TemplatesOUT-NNN6Structured output formats

    See the Rule Index for the complete registry.

    Key Rules

    IR-001 — Language Anchoring

    Output language matches the user's input language. No forced Chinese output.

    IR-006 — Version Context Block

    All concurrency / availability / SwiftUI behavior / network cancellation answers require a version context block before conclusions.

    IR-011 — Cognitive Adversary Mode

    When triggered: output restatement, strongest counter-argument, hidden assumptions, failure conditions, falsifiable conditions, position flip, conformity self-check, confidence level, conclusion.

    Evolution Governance

    The skill evolves through a proposal-driven pipeline:

    1. Propose — Create a proposal in evolution/proposals/
    2. Validate — Run scripts/validate_skill_evolution.sh (14-step check)
    3. Implement — Add/modify references; update rule_index.md
    4. Promote — Archive proposal; snapshot the skill state

    All changes to SKILL.md or references/ are gated by the pre-commit hook, which requires a staged evolution proposal in the same commit.

    `); +} +const _sfc_setup = _sfc_main.setup; +_sfc_main.setup = (props, ctx) => { + const ssrContext = useSSRContext(); + (ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("ios-engineer/index.md"); + return _sfc_setup ? _sfc_setup(props, ctx) : void 0; +}; +const index = /* @__PURE__ */ _export_sfc(_sfc_main, [["ssrRender", _sfc_ssrRender]]); +export { + __pageData, + index as default +}; diff --git a/docs/.vitepress/.temp/ios-engineer_references.md.js b/docs/.vitepress/.temp/ios-engineer_references.md.js new file mode 100644 index 0000000..807fb75 --- /dev/null +++ b/docs/.vitepress/.temp/ios-engineer_references.md.js @@ -0,0 +1,19 @@ +import { ssrRenderAttrs } from "vue/server-renderer"; +import { useSSRContext } from "vue"; +import { _ as _export_sfc } from "./plugin-vue_export-helper.1tPrXgE0.js"; +const __pageData = JSON.parse('{"title":"References","description":"","frontmatter":{},"headers":[],"relativePath":"ios-engineer/references.md","filePath":"ios-engineer/references.md","lastUpdated":1783251060000}'); +const _sfc_main = { name: "ios-engineer/references.md" }; +function _sfc_ssrRender(_ctx, _push, _parent, _attrs, $props, $setup, $data, $options) { + _push(`

    References

    The iOS Engineer skill includes 34 domain reference files covering the full iOS / Swift engineering lifecycle.

    How references are used

    References are loaded by the AI agent at runtime based on symptom routing (SYM-) or task routing (ROUTE-) rules. They provide detailed domain knowledge for specific scenarios.

    Governance Layer

    ReferenceDescription
    rule_index.mdCanonical Rule ID registry (49 IDs)
    self_evolution.mdAuto-evolution governance rules
    cognitive_adversary_mode.mdCognitive adversary mode specification
    usage_ledger.mdUsage tracking ledger

    Domain References

    ReferenceDomain
    architecture_analysis.mdArchitecture analysis
    architecture_and_network.mdArchitecture & networking
    anti_patterns.mdAnti-patterns
    app_extensions.mdApp extensions
    build_release_and_ci.mdBuild, release & CI
    code_templates.mdCode templates
    decision_records.mdDecision records
    domain_modeling.mdDomain modeling
    examples.mdExamples

    See the full reference directory on GitHub for all 34 files.

    Validation Scripts

    The skill ships with 27 validation and evolution scripts in scripts/:

    ScriptPurpose
    validate_rule_ids.shEnsures rule IDs are consistent between rule_index.md and SKILL.md
    validate_scenario_specs.shValidates scenario specification files
    audit_ref_freshness.shAudits last-verified dates in reference files
    validate_skill_evolution.sh14-step comprehensive evolution validation
    check_snapshot_consistency.shCompares current skill state against snapshots
    validate_usage_ledger.shValidates usage ledger integrity
    `); +} +const _sfc_setup = _sfc_main.setup; +_sfc_main.setup = (props, ctx) => { + const ssrContext = useSSRContext(); + (ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("ios-engineer/references.md"); + return _sfc_setup ? _sfc_setup(props, ctx) : void 0; +}; +const references = /* @__PURE__ */ _export_sfc(_sfc_main, [["ssrRender", _sfc_ssrRender]]); +export { + __pageData, + references as default +}; diff --git a/docs/.vitepress/.temp/ios-engineer_rule-index.md.js b/docs/.vitepress/.temp/ios-engineer_rule-index.md.js new file mode 100644 index 0000000..8846528 --- /dev/null +++ b/docs/.vitepress/.temp/ios-engineer_rule-index.md.js @@ -0,0 +1,25 @@ +import { resolveComponent, useSSRContext } from "vue"; +import { ssrRenderAttrs, ssrRenderComponent } from "vue/server-renderer"; +import { _ as _export_sfc } from "./plugin-vue_export-helper.1tPrXgE0.js"; +const __pageData = JSON.parse('{"title":"Rule Index","description":"","frontmatter":{},"headers":[],"relativePath":"ios-engineer/rule-index.md","filePath":"ios-engineer/rule-index.md","lastUpdated":1783251060000}'); +const _sfc_main = { name: "ios-engineer/rule-index.md" }; +function _sfc_ssrRender(_ctx, _push, _parent, _attrs, $props, $setup, $data, $options) { + const _component_Badge = resolveComponent("Badge"); + _push(`

    Rule Index

    `); + _push(ssrRenderComponent(_component_Badge, { + type: "tip", + text: "49 IDs registered" + }, null, _parent)); + _push(`

    The canonical Rule ID registry for iOS Engineer. Every rule ID is defined here first, then referenced in SKILL.md. An automated validation script (validate_rule_ids.sh) ensures bidirectional consistency.

    Iron Rules (IR-NNN)

    IDStatusSummary
    IR-001activeOutput language anchors to user's input language
    IR-006activeVersion context block before conclusions on concurrency/availability/SwiftUI/network
    IR-011activeCognitive adversary mode: restatement, counter-argument, hidden assumptions, falsifiability

    Global Rules (GR-NNN)

    Carried by independent global skills, cross-platform. The ios-engineer skill mirrors them for reference.

    IDStatusSummary
    GR-001activeSecurity compliance — never expose credentials
    GR-002activePre-confirmation block when info is insufficient
    GR-003activeSingle root cause (1 primary + max 1 secondary)
    GR-004activeFour-section output (cause → why → fix → verify)
    GR-005activeMinimal fix first
    GR-006activeTool budget gate — 3 failures or 15 turns blocks
    GR-007activeNo code formatting (prevents diff noise)
    GR-008activeChange coverage declaration
    GR-010activeTraceable logic chain with strength indicators

    Symptom Routing (SYM-NNN)

    IDStatusSummary
    SYM-001activeCrash / assertion / force unwrap → root_cause_enforcement
    SYM-002activeUI misalignment / constraint conflicts / list jitter
    SYM-003activeState chaos / async write-back / stale request override
    SYM-004activeRequest failure / auth refresh / pagination
    SYM-005activeLag / slow launch / memory / energy
    SYM-006activeNaming chaos / force unwrap / access control
    SYM-007activeLegacy project chaos / fear of touching modules

    Task Routing (ROUTE-NNN)

    10 routing entries covering: debugging / architecture design / code review / migration / testing / dependency / build & CI / security & permission / data persistence / Core Skills (markdown/code generation).

    Output Templates (OUT-NNN)

    6 output templates for: root cause analysis, architecture review, code review, migration plan, test design, and decision record.


    See the canonical rule_index.md for the complete registry with status and anchor points.

    `); +} +const _sfc_setup = _sfc_main.setup; +_sfc_main.setup = (props, ctx) => { + const ssrContext = useSSRContext(); + (ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("ios-engineer/rule-index.md"); + return _sfc_setup ? _sfc_setup(props, ctx) : void 0; +}; +const ruleIndex = /* @__PURE__ */ _export_sfc(_sfc_main, [["ssrRender", _sfc_ssrRender]]); +export { + __pageData, + ruleIndex as default +}; diff --git a/docs/.vitepress/.temp/package.json b/docs/.vitepress/.temp/package.json new file mode 100644 index 0000000..25d9dcf --- /dev/null +++ b/docs/.vitepress/.temp/package.json @@ -0,0 +1 @@ +{ "private": true, "type": "module" } \ No newline at end of file diff --git a/docs/.vitepress/.temp/plugin-vue_export-helper.1tPrXgE0.js b/docs/.vitepress/.temp/plugin-vue_export-helper.1tPrXgE0.js new file mode 100644 index 0000000..84d1cb5 --- /dev/null +++ b/docs/.vitepress/.temp/plugin-vue_export-helper.1tPrXgE0.js @@ -0,0 +1,10 @@ +const _export_sfc = (sfc, props) => { + const target = sfc.__vccOpts || sfc; + for (const [key, val] of props) { + target[key] = val; + } + return target; +}; +export { + _export_sfc as _ +}; diff --git a/docs/.vitepress/config.ts b/docs/.vitepress/config.ts new file mode 100644 index 0000000..bbca95a --- /dev/null +++ b/docs/.vitepress/config.ts @@ -0,0 +1,60 @@ +import { defineConfig } from 'vitepress' + +const base = '/ai-coding-kit/' + +export default defineConfig({ + base, + title: 'ai-coding-kit', + description: 'One kit for all AI coding tools — Agent Skills, MCP sync, iOS engineering rules, and RAG gateway', + lang: 'en-US', + lastUpdated: true, + cleanUrls: true, + ignoreDeadLinks: false, + + head: [ + ['link', { rel: 'icon', type: 'image/svg+xml', href: '/ai-coding-kit/favicon.svg' }], + ['meta', { name: 'theme-color', content: '#0A84FF' }], + ], + + themeConfig: { + logo: false, + siteTitle: 'ai-coding-kit', + + nav: [ + { text: 'Home', link: '/' }, + { text: 'iOS Engineer', link: '/ios-engineer/' }, + { text: 'GitHub', link: 'https://github.com/i-stack/ai-coding-kit' }, + ], + + sidebar: { + '/ios-engineer/': [ + { + text: 'iOS Engineer', + collapsed: false, + items: [ + { text: 'Overview', link: '/ios-engineer/' }, + { text: 'Rule Index', link: '/ios-engineer/rule-index' }, + { text: 'References', link: '/ios-engineer/references' }, + ], + }, + ], + }, + + socialLinks: [ + { icon: 'github', link: 'https://github.com/i-stack/ai-coding-kit' }, + ], + + footer: { + message: 'Released under the MIT License.', + copyright: 'Copyright © 2025–2026 i-stack', + }, + + search: { + provider: 'local', + }, + + editLink: { + pattern: 'https://github.com/i-stack/ai-coding-kit/edit/feature_3.0.0/docs/:path', + }, + }, +}) diff --git a/docs/.vitepress/dist/404.html b/docs/.vitepress/dist/404.html new file mode 100644 index 0000000..9b65912 --- /dev/null +++ b/docs/.vitepress/dist/404.html @@ -0,0 +1,24 @@ + + + + + + 404 | ai-coding-kit + + + + + + + + + + + + + +
    + + + + \ No newline at end of file diff --git a/docs/.vitepress/dist/assets/app.DVfBX2Do.js b/docs/.vitepress/dist/assets/app.DVfBX2Do.js new file mode 100644 index 0000000..44f7d36 --- /dev/null +++ b/docs/.vitepress/dist/assets/app.DVfBX2Do.js @@ -0,0 +1,106 @@ +import { t as theme } from "./chunks/theme.BrkFYulG.js"; +import { R as inBrowser, a3 as useUpdateHead, a4 as RouterSymbol, a5 as initData, a6 as dataSymbol, a7 as Content, a8 as ClientOnly, a9 as siteDataRef, aa as createRouter, ab as pathToFile, ac as createSSRApp, d as defineComponent, u as useData, v as onMounted, s as watchEffect, ad as usePrefetch, ae as useCopyCode, af as useCodeGroups, ag as h } from "./chunks/framework.BcMzFyCJ.js"; +function resolveThemeExtends(theme2) { + if (theme2.extends) { + const base = resolveThemeExtends(theme2.extends); + return { + ...base, + ...theme2, + async enhanceApp(ctx) { + if (base.enhanceApp) + await base.enhanceApp(ctx); + if (theme2.enhanceApp) + await theme2.enhanceApp(ctx); + } + }; + } + return theme2; +} +const Theme = resolveThemeExtends(theme); +const VitePressApp = defineComponent({ + name: "VitePressApp", + setup() { + const { site, lang, dir } = useData(); + onMounted(() => { + watchEffect(() => { + document.documentElement.lang = lang.value; + document.documentElement.dir = dir.value; + }); + }); + if (site.value.router.prefetchLinks) { + usePrefetch(); + } + useCopyCode(); + useCodeGroups(); + if (Theme.setup) + Theme.setup(); + return () => h(Theme.Layout); + } +}); +async function createApp() { + globalThis.__VITEPRESS__ = true; + const router = newRouter(); + const app = newApp(); + app.provide(RouterSymbol, router); + const data = initData(router.route); + app.provide(dataSymbol, data); + app.component("Content", Content); + app.component("ClientOnly", ClientOnly); + Object.defineProperties(app.config.globalProperties, { + $frontmatter: { + get() { + return data.frontmatter.value; + } + }, + $params: { + get() { + return data.page.value.params; + } + } + }); + if (Theme.enhanceApp) { + await Theme.enhanceApp({ + app, + router, + siteData: siteDataRef + }); + } + return { app, router, data }; +} +function newApp() { + return createSSRApp(VitePressApp); +} +function newRouter() { + let isInitialPageLoad = inBrowser; + return createRouter((path) => { + let pageFilePath = pathToFile(path); + let pageModule = null; + if (pageFilePath) { + if (isInitialPageLoad) { + pageFilePath = pageFilePath.replace(/\.js$/, ".lean.js"); + } + if (false) ; + else { + pageModule = import( + /*@vite-ignore*/ + pageFilePath + ); + } + } + if (inBrowser) { + isInitialPageLoad = false; + } + return pageModule; + }, Theme.NotFound); +} +if (inBrowser) { + createApp().then(({ app, router, data }) => { + router.go().then(() => { + useUpdateHead(router.route, data.site); + app.mount("#app"); + }); + }); +} +export { + createApp +}; diff --git a/docs/.vitepress/dist/assets/chunks/@localSearchIndexroot.DDvkKcys.js b/docs/.vitepress/dist/assets/chunks/@localSearchIndexroot.DDvkKcys.js new file mode 100644 index 0000000..3012155 --- /dev/null +++ b/docs/.vitepress/dist/assets/chunks/@localSearchIndexroot.DDvkKcys.js @@ -0,0 +1,4 @@ +const _localSearchIndexroot = '{"documentCount":22,"nextId":22,"documentIds":{"0":"/ai-coding-kit/#quick-start","1":"/ai-coding-kit/#or-install-via-package-manager","2":"/ai-coding-kit/#platform-support","3":"/ai-coding-kit/#modules","4":"/ai-coding-kit/ios-engineer/#ios-engineer","5":"/ai-coding-kit/ios-engineer/#architecture","6":"/ai-coding-kit/ios-engineer/#rule-system","7":"/ai-coding-kit/ios-engineer/#key-rules","8":"/ai-coding-kit/ios-engineer/#ir-001-—-language-anchoring","9":"/ai-coding-kit/ios-engineer/#ir-006-—-version-context-block","10":"/ai-coding-kit/ios-engineer/#ir-011-—-cognitive-adversary-mode","11":"/ai-coding-kit/ios-engineer/#evolution-governance","12":"/ai-coding-kit/ios-engineer/rule-index#rule-index","13":"/ai-coding-kit/ios-engineer/rule-index#iron-rules-ir-nnn","14":"/ai-coding-kit/ios-engineer/rule-index#global-rules-gr-nnn","15":"/ai-coding-kit/ios-engineer/rule-index#symptom-routing-sym-nnn","16":"/ai-coding-kit/ios-engineer/rule-index#task-routing-route-nnn","17":"/ai-coding-kit/ios-engineer/rule-index#output-templates-out-nnn","18":"/ai-coding-kit/ios-engineer/references#references","19":"/ai-coding-kit/ios-engineer/references#governance-layer","20":"/ai-coding-kit/ios-engineer/references#domain-references","21":"/ai-coding-kit/ios-engineer/references#validation-scripts"},"fieldIds":{"title":0,"titles":1,"text":2},"fieldLength":{"0":[2,1,36],"1":[5,2,13],"2":[2,1,39],"3":[1,1,50],"4":[2,1,51],"5":[1,2,68],"6":[2,2,57],"7":[2,2,1],"8":[4,4,12],"9":[5,4,16],"10":[5,4,21],"11":[2,2,50],"12":[2,1,30],"13":[5,2,35],"14":[5,2,83],"15":[5,2,54],"16":[5,2,24],"17":[5,2,30],"18":[1,1,43],"19":[2,1,26],"20":[2,1,43],"21":[2,1,52]},"averageFieldLength":[3.0454545454545454,1.8636363636363635,37.90909090909091],"storedFields":{"0":{"title":"Quick Start","titles":[]},"1":{"title":"Or install via package manager","titles":["Quick Start"]},"2":{"title":"Platform Support","titles":[]},"3":{"title":"Modules","titles":[]},"4":{"title":"iOS Engineer","titles":[]},"5":{"title":"Architecture","titles":["iOS Engineer"]},"6":{"title":"Rule System","titles":["iOS Engineer"]},"7":{"title":"Key Rules","titles":["iOS Engineer"]},"8":{"title":"IR-001 — Language Anchoring","titles":["iOS Engineer","Key Rules"]},"9":{"title":"IR-006 — Version Context Block","titles":["iOS Engineer","Key Rules"]},"10":{"title":"IR-011 — Cognitive Adversary Mode","titles":["iOS Engineer","Key Rules"]},"11":{"title":"Evolution Governance","titles":["iOS Engineer"]},"12":{"title":"Rule Index","titles":[]},"13":{"title":"Iron Rules (IR-NNN)","titles":["Rule Index"]},"14":{"title":"Global Rules (GR-NNN)","titles":["Rule Index"]},"15":{"title":"Symptom Routing (SYM-NNN)","titles":["Rule Index"]},"16":{"title":"Task Routing (ROUTE-NNN)","titles":["Rule Index"]},"17":{"title":"Output Templates (OUT-NNN)","titles":["Rule Index"]},"18":{"title":"References","titles":[]},"19":{"title":"Governance Layer","titles":["References"]},"20":{"title":"Domain References","titles":["References"]},"21":{"title":"Validation Scripts","titles":["References"]}},"dirtCount":0,"index":[["49",{"2":{"19":1}}],["40+",{"2":{"6":1}}],["jitter",{"2":{"15":1}}],["json",{"2":{"0":3,"2":6}}],["write",{"2":{"15":1}}],["with",{"2":{"14":1,"17":1,"21":1}}],["why",{"2":{"14":1}}],["which",{"2":{"11":1}}],["when",{"2":{"10":1,"14":1}}],["what",{"2":{"2":1}}],["15",{"2":{"14":1}}],["1",{"2":{"14":2}}],["14",{"2":{"11":1,"21":1}}],["10",{"2":{"6":1,"16":1}}],["010",{"2":{"14":1}}],["011",{"0":{"10":1},"2":{"13":1}}],["008",{"2":{"14":1}}],["007",{"2":{"14":1,"15":1}}],["005",{"2":{"14":1,"15":1}}],["004",{"2":{"14":1,"15":1}}],["003",{"2":{"14":1,"15":1}}],["002",{"2":{"14":1,"15":1}}],["006",{"0":{"9":1},"2":{"13":1,"14":1,"15":1}}],["001",{"0":{"8":1},"2":{"13":1,"14":1,"15":1}}],["knowledge",{"2":{"18":1}}],["key",{"0":{"7":1},"1":{"8":1,"9":1,"10":1}}],["kit",{"2":{"0":2,"1":2,"4":1}}],["6",{"2":{"6":1,"17":1}}],["→",{"2":{"6":2,"14":3,"15":1}}],["7",{"2":{"6":1}}],["9",{"2":{"6":1}}],["5",{"2":{"6":1}}],["27",{"2":{"5":1,"21":1}}],["3",{"2":{"6":1,"14":1}}],["31",{"2":{"5":1}}],["34",{"2":{"5":1,"18":1,"20":1}}],["└──",{"2":{"5":4}}],["│",{"2":{"5":7}}],["├──",{"2":{"5":9}}],["lifecycle",{"2":{"18":1}}],["list",{"2":{"15":1}}],["ledger",{"2":{"19":2,"21":2}}],["legacy",{"2":{"15":1}}],["level",{"2":{"10":1}}],["loaded",{"2":{"18":1}}],["logic",{"2":{"6":1,"14":1}}],["locales",{"2":{"4":1}}],["last",{"2":{"21":1}}],["launch",{"2":{"15":1}}],["lag",{"2":{"15":1}}],["layer",{"0":{"19":1},"2":{"5":1}}],["layered",{"2":{"5":1}}],["language",{"0":{"8":1},"2":{"4":1,"8":2,"13":2}}],["zh",{"2":{"4":1,"5":1}}],["简体中文",{"2":{"4":1}}],["ui",{"2":{"15":1}}],["uikit",{"2":{"4":1}}],["unwrap",{"2":{"15":2}}],["universal",{"2":{"3":1}}],["update",{"2":{"11":1}}],["usage",{"2":{"19":2,"21":2}}],["used",{"2":{"18":1}}],["user",{"2":{"8":1,"13":1}}],["us",{"2":{"4":1,"5":1}}],["root",{"2":{"14":1,"15":1,"17":1}}],["route",{"0":{"16":1},"2":{"6":3,"18":1}}],["routing",{"0":{"15":1,"16":1},"2":{"5":1,"6":2,"16":1,"18":2}}],["runtime",{"2":{"18":1}}],["run",{"2":{"11":1}}],["rule",{"0":{"6":1,"12":1},"1":{"13":1,"14":1,"15":1,"16":1,"17":1},"2":{"5":2,"6":2,"11":1,"12":3,"17":1,"19":2,"21":3}}],["rules",{"0":{"7":1,"13":1,"14":1},"1":{"8":1,"9":1,"10":1},"2":{"4":1,"6":2,"18":1,"19":1}}],["release",{"2":{"20":2}}],["records",{"2":{"20":2}}],["record",{"2":{"17":1}}],["request",{"2":{"15":2}}],["requires",{"2":{"11":1}}],["require",{"2":{"9":1}}],["restatement",{"2":{"10":1,"13":1}}],["registry",{"2":{"5":1,"6":1,"12":1,"17":1,"19":1}}],["ref",{"2":{"21":1}}],["refresh",{"2":{"15":1}}],["referenced",{"2":{"12":1}}],["reference",{"2":{"5":1,"14":1,"18":1,"19":1,"20":2,"21":1}}],["references",{"0":{"18":1,"20":1},"1":{"19":1,"20":1,"21":1},"2":{"5":3,"6":2,"11":2,"18":2}}],["refactoring",{"2":{"4":1}}],["review",{"2":{"4":1,"5":1,"16":1,"17":2}}],["renders",{"2":{"3":1}}],["rag",{"2":{"3":2}}],["dates",{"2":{"21":1}}],["data",{"2":{"3":1,"16":1}}],["directory",{"2":{"20":1}}],["diff",{"2":{"14":1}}],["discipline",{"2":{"6":1}}],["driven",{"2":{"5":1,"11":1}}],["domain",{"0":{"20":1},"2":{"5":2,"18":2,"20":3}}],["detailed",{"2":{"18":1}}],["decision",{"2":{"17":1,"20":2}}],["declaration",{"2":{"14":1}}],["dependency",{"2":{"16":1}}],["design",{"2":{"16":1,"17":1}}],["description",{"2":{"3":1,"19":1}}],["defined",{"2":{"12":1}}],["definitions",{"2":{"3":1}}],["development",{"2":{"4":1}}],["debugging",{"2":{"4":1,"16":1}}],["freshness",{"2":{"21":1}}],["full",{"2":{"18":1,"20":1}}],["fear",{"2":{"15":1}}],["four",{"2":{"14":1}}],["force",{"2":{"15":2}}],["forced",{"2":{"8":1}}],["formatting",{"2":{"14":1}}],["formats",{"2":{"3":1,"6":1}}],["for",{"2":{"4":1,"5":1,"6":1,"12":1,"14":1,"17":2,"18":1,"20":1}}],["fix",{"2":{"14":2}}],["first",{"2":{"12":1,"14":1}}],["files",{"2":{"5":1,"18":1,"20":1,"21":2}}],["file",{"2":{"0":1}}],["flip",{"2":{"10":1}}],["falsifiability",{"2":{"13":1}}],["falsifiable",{"2":{"10":1}}],["failures",{"2":{"14":1}}],["failure",{"2":{"10":1,"15":1}}],["fastify",{"2":{"3":1}}],["+",{"2":{"2":1,"3":3,"14":1}}],["against",{"2":{"21":1}}],["agent",{"2":{"2":1,"3":1,"4":1,"18":1}}],["audits",{"2":{"21":1}}],["audit",{"2":{"21":1}}],["auth",{"2":{"15":1}}],["automated",{"2":{"12":1}}],["auto",{"2":{"4":1,"5":1,"6":2,"19":1}}],["app",{"2":{"20":2}}],["api",{"2":{"3":1}}],["at",{"2":{"18":1}}],["amp",{"2":{"16":2,"20":2}}],["add",{"2":{"11":1}}],["adversary",{"0":{"10":1},"2":{"13":1,"19":2}}],["are",{"2":{"11":1,"18":2,"21":1}}],["argument",{"2":{"10":1,"13":1}}],["archived",{"2":{"5":1}}],["archive",{"2":{"5":1,"11":1}}],["architecture",{"0":{"5":1},"2":{"4":1,"16":1,"17":1,"20":4}}],["anti",{"2":{"20":2}}],["and",{"2":{"17":2,"20":2,"21":2}}],["analysis",{"2":{"17":1,"20":2}}],["anchor",{"2":{"17":1}}],["anchors",{"2":{"13":1}}],["anchoring",{"0":{"8":1}}],["an",{"2":{"12":1}}],["answers",{"2":{"9":1}}],["availability",{"2":{"9":1,"13":1}}],["all",{"2":{"9":1,"11":1,"20":1}}],["always",{"2":{"6":1}}],["access",{"2":{"15":1}}],["across",{"2":{"6":1}}],["active",{"2":{"5":1,"13":3,"14":9,"15":7}}],["a",{"2":{"5":1,"9":1,"11":3}}],["async",{"2":{"15":1}}],["assertion",{"2":{"15":1}}],["assumptions",{"2":{"10":1,"13":1}}],["assistant",{"2":{"2":1}}],["as",{"2":{"5":1}}],["ai",{"2":{"0":2,"1":2,"4":2,"18":1}}],["xmcp",{"2":{"3":1}}],["xcode",{"2":{"2":1,"4":1}}],["x26",{"2":{"0":1,"5":1}}],["yaml",{"2":{"2":1}}],["you",{"2":{"0":1}}],["your",{"2":{"0":1,"4":1}}],["verified",{"2":{"21":1}}],["verify",{"2":{"14":1}}],["version",{"0":{"9":1},"2":{"9":1,"13":1}}],["validates",{"2":{"21":2}}],["validate",{"2":{"11":2,"12":1,"21":4}}],["validation",{"0":{"21":1},"2":{"5":1,"12":1,"21":2}}],["variables",{"2":{"2":1}}],["vscode",{"2":{"2":1}}],["via",{"0":{"1":1}}],["memory",{"2":{"15":1}}],["misalignment",{"2":{"15":1}}],["minimal",{"2":{"14":1}}],["mirrors",{"2":{"5":1,"14":1}}],["migration",{"2":{"4":1,"16":1,"17":1}}],["md",{"2":{"5":3,"11":2,"12":1,"17":1,"19":4,"20":9,"21":2}}],["markdown",{"2":{"16":1}}],["max",{"2":{"14":1}}],["matches",{"2":{"4":1,"8":1}}],["manager",{"0":{"1":1}}],["multi",{"2":{"3":1}}],["modify",{"2":{"11":1}}],["modeling",{"2":{"20":2}}],["models",{"2":{"2":1}}],["mode",{"0":{"10":1},"2":{"13":1,"19":2}}],["module",{"2":{"3":1}}],["modules",{"0":{"3":1},"2":{"15":1}}],["mcp",{"2":{"2":4,"3":2}}],["purpose",{"2":{"21":1}}],["push",{"2":{"3":2}}],["plan",{"2":{"17":1}}],["platform",{"0":{"2":1},"2":{"3":2,"6":1,"14":1}}],["persistence",{"2":{"16":1}}],["permission",{"2":{"16":1}}],["performance",{"2":{"4":1}}],["position",{"2":{"10":1}}],["points",{"2":{"17":1}}],["point",{"2":{"5":1}}],["pipeline",{"2":{"5":1,"11":1}}],["provide",{"2":{"18":1}}],["providing",{"2":{"4":1}}],["promote",{"2":{"11":1}}],["propose",{"2":{"11":1}}],["proposals",{"2":{"5":3,"11":1}}],["proposal",{"2":{"5":1,"11":4}}],["production",{"2":{"4":1}}],["project",{"2":{"3":1,"15":1}}],["primary",{"2":{"4":1,"14":1}}],["prevents",{"2":{"14":1}}],["prefix",{"2":{"6":1}}],["pre",{"2":{"3":2,"11":1,"14":1}}],["patterns",{"2":{"20":2}}],["paths",{"2":{"2":1}}],["pagination",{"2":{"15":1}}],["package",{"0":{"1":1}}],["gate",{"2":{"14":1}}],["gated",{"2":{"11":1}}],["gateway",{"2":{"3":2}}],["gr",{"0":{"14":1},"2":{"6":1,"14":9}}],["grade",{"2":{"4":1}}],["global",{"0":{"14":1},"2":{"6":1,"14":1}}],["guard",{"2":{"5":1}}],["guards",{"2":{"3":1}}],["governance",{"0":{"11":1,"19":1},"2":{"5":2,"19":1}}],["governed",{"2":{"3":1}}],["generation",{"2":{"16":1}}],["generated",{"2":{"2":1}}],["gemini",{"2":{"2":1}}],["gets",{"2":{"2":1}}],["g",{"2":{"1":1}}],["githooks",{"2":{"3":1}}],["github",{"2":{"0":1,"20":1}}],["git",{"2":{"0":2,"3":1}}],["naming",{"2":{"15":1}}],["native",{"2":{"3":1}}],["noise",{"2":{"14":1}}],["no",{"2":{"8":1,"14":1}}],["nnn",{"0":{"13":1,"14":1,"15":1,"16":1,"17":1},"2":{"6":5}}],["never",{"2":{"14":1}}],["network",{"2":{"9":1,"13":1,"20":1}}],["networking",{"2":{"4":1,"20":1}}],["need",{"2":{"0":1}}],["npm",{"2":{"1":2}}],["build",{"2":{"16":1,"20":2}}],["budget",{"2":{"14":1}}],["based",{"2":{"18":1}}],["bash",{"2":{"0":2,"1":1}}],["back",{"2":{"15":1}}],["bidirectional",{"2":{"12":1}}],["by",{"2":{"11":1,"14":1,"18":1}}],["between",{"2":{"21":1}}],["before",{"2":{"9":1,"13":1}}],["behavior",{"2":{"9":1}}],["blocks",{"2":{"14":1}}],["block",{"0":{"9":1},"2":{"9":1,"13":1,"14":1}}],["brew",{"2":{"1":1}}],["here",{"2":{"12":1}}],["hidden",{"2":{"10":1,"13":1}}],["how",{"2":{"18":1}}],["hook",{"2":{"11":1}}],["hooks",{"2":{"3":2,"5":1}}],["homebrew",{"2":{"1":1}}],["https",{"2":{"0":1}}],["of",{"2":{"15":1}}],["override",{"2":{"15":1}}],["out",{"0":{"17":1},"2":{"6":1}}],["output",{"0":{"17":1},"2":{"5":1,"6":2,"8":2,"10":1,"13":1,"14":1,"17":1}}],["openai",{"2":{"3":1}}],["organized",{"2":{"5":1}}],["or",{"0":{"1":1},"2":{"11":1,"14":1,"18":1}}],["on",{"2":{"13":1,"18":1,"20":1}}],["one",{"2":{"0":1}}],["only",{"2":{"0":1}}],["$editor",{"2":{"0":1}}],["extensions",{"2":{"20":2}}],["expose",{"2":{"14":1}}],["examples",{"2":{"20":2}}],["example",{"2":{"0":1}}],["epistemic",{"2":{"6":1}}],["etc",{"2":{"3":1}}],["every",{"2":{"12":1}}],["everything",{"2":{"0":1}}],["evolves",{"2":{"11":1}}],["evolution",{"0":{"11":1},"2":{"3":1,"5":7,"11":3,"19":2,"21":3}}],["entries",{"2":{"16":1}}],["entry",{"2":{"5":1}}],["energy",{"2":{"15":1}}],["ensures",{"2":{"12":1,"21":1}}],["enforcement",{"2":{"15":1}}],["enforced",{"2":{"6":1}}],["enforces",{"2":{"6":1}}],["en",{"2":{"4":1,"5":1}}],["english",{"2":{"4":1,"5":1}}],["engineer",{"0":{"4":1},"1":{"5":1,"6":1,"7":1,"8":1,"9":1,"10":1,"11":1},"2":{"5":1,"12":1,"14":1,"18":1}}],["engineering",{"2":{"3":1,"4":1,"18":1}}],["engine",{"2":{"3":1}}],["environment",{"2":{"2":1}}],["env",{"2":{"0":3,"3":1}}],["edit",{"2":{"0":1}}],["tracking",{"2":{"19":1}}],["traceable",{"2":{"14":1}}],["triggered",{"2":{"10":1}}],["triggers",{"2":{"5":1}}],["turns",{"2":{"14":1}}],["types",{"2":{"6":1}}],["typescript",{"2":{"3":1}}],["task",{"0":{"16":1},"2":{"6":2,"18":1}}],["tap",{"2":{"1":1}}],["test",{"2":{"17":1}}],["testing",{"2":{"4":1,"16":1}}],["templates",{"0":{"17":1},"2":{"5":1,"6":1,"17":1,"20":2}}],["through",{"2":{"11":1}}],["this",{"2":{"4":1}}],["they",{"2":{"18":1}}],["them",{"2":{"14":1}}],["then",{"2":{"12":1}}],["the",{"2":{"0":1,"4":2,"5":1,"6":3,"8":1,"11":4,"12":1,"14":1,"17":2,"18":3,"20":1,"21":1}}],["toml",{"2":{"2":2}}],["tool",{"2":{"2":1,"14":1}}],["touching",{"2":{"15":1}}],["touch",{"2":{"0":1}}],["to",{"2":{"0":2,"3":1,"11":1,"13":1}}],["slow",{"2":{"15":1}}],["single",{"2":{"14":1}}],["summary",{"2":{"13":1,"14":1,"15":1}}],["supported",{"2":{"4":1}}],["support",{"0":{"2":1}}],["same",{"2":{"11":1}}],["snapshot",{"2":{"11":1,"21":1}}],["snapshots",{"2":{"5":2,"21":1}}],["s",{"2":{"8":1,"13":1}}],["step",{"2":{"11":1,"21":1}}],["strength",{"2":{"14":1}}],["strongest",{"2":{"10":1}}],["structured",{"2":{"6":1}}],["stale",{"2":{"15":1}}],["status",{"2":{"13":1,"14":1,"15":1,"17":1}}],["state",{"2":{"11":1,"15":1,"21":1}}],["staged",{"2":{"11":1}}],["stack",{"2":{"0":1,"1":2}}],["start",{"0":{"0":1},"1":{"1":1}}],["scenario",{"2":{"21":2}}],["scenarios",{"2":{"18":1}}],["script",{"2":{"12":1,"21":1}}],["scripts",{"0":{"21":1},"2":{"5":3,"11":1,"21":2}}],["scope",{"2":{"6":1}}],["specs",{"2":{"21":1}}],["specification",{"2":{"19":1,"21":1}}],["specific",{"2":{"5":1,"18":1}}],["spm",{"2":{"4":1}}],["sym",{"0":{"15":1},"2":{"6":1,"15":7,"18":1}}],["symptoms",{"2":{"6":1}}],["symptom",{"0":{"15":1},"2":{"6":1,"18":1}}],["system",{"0":{"6":1},"2":{"5":1}}],["synced",{"2":{"2":1}}],["sync",{"2":{"0":2,"3":3}}],["swiftui",{"2":{"4":1,"9":1,"13":1}}],["swift",{"2":{"4":1,"18":1}}],["source",{"2":{"3":1}}],["skill",{"2":{"3":1,"4":2,"5":2,"6":1,"11":4,"12":1,"14":1,"18":1,"21":4}}],["skills",{"2":{"2":3,"3":1,"14":1,"16":1}}],["section",{"2":{"14":1}}],["secondary",{"2":{"14":1}}],["security",{"2":{"14":1,"16":1}}],["secrets",{"2":{"0":4,"3":2}}],["see",{"2":{"6":1,"17":1,"20":1}}],["self",{"2":{"5":1,"10":1,"19":1}}],["settings",{"2":{"2":2}}],["ships",{"2":{"21":1}}],["sh",{"2":{"0":1,"11":1,"12":1,"21":6}}],["implement",{"2":{"11":1}}],["implemented",{"2":{"5":1}}],["ir",{"0":{"8":1,"9":1,"10":1,"13":1},"2":{"6":1,"13":3}}],["iron",{"0":{"13":1},"2":{"6":1}}],["i18n",{"2":{"5":1}}],["ids",{"2":{"6":1,"12":1,"19":1,"21":2}}],["id",{"2":{"5":1,"12":2,"13":1,"14":1,"15":1,"19":1}}],["is",{"2":{"4":1,"5":1,"12":1,"14":1}}],["ios",{"0":{"4":1},"1":{"5":1,"6":1,"7":1,"8":1,"9":1,"10":1,"11":1},"2":{"4":2,"5":1,"12":1,"14":1,"18":2}}],["integrity",{"2":{"21":1}}],["includes",{"2":{"18":1}}],["indicators",{"2":{"14":1}}],["independent",{"2":{"14":1}}],["index",{"0":{"12":1},"1":{"13":1,"14":1,"15":1,"16":1,"17":1},"2":{"5":1,"6":1,"11":1,"17":1,"19":1,"21":1}}],["insufficient",{"2":{"14":1}}],["install",{"0":{"1":1},"2":{"1":2}}],["info",{"2":{"14":1}}],["input",{"2":{"8":1,"13":1}}],["in",{"2":{"4":1,"5":1,"11":2,"12":1,"21":2}}],["init",{"2":{"3":1}}],["injects",{"2":{"3":1}}],["i",{"2":{"0":1,"1":2}}],["current",{"2":{"21":1}}],["cursor",{"2":{"2":2}}],["ci",{"2":{"16":1,"20":2}}],["chaos",{"2":{"15":3}}],["chain",{"2":{"14":1}}],["change",{"2":{"14":1}}],["changes",{"2":{"11":1}}],["check",{"2":{"10":1,"11":1,"21":1}}],["checks",{"2":{"5":1}}],["chinese",{"2":{"8":1}}],["credentials",{"2":{"14":1}}],["create",{"2":{"11":1}}],["cross",{"2":{"6":1,"14":1}}],["crash",{"2":{"4":1,"15":1}}],["cause",{"2":{"14":2,"15":1,"17":1}}],["carried",{"2":{"14":1}}],["cancellation",{"2":{"9":1}}],["canonical",{"2":{"5":1,"12":1,"17":1,"19":1}}],["category",{"2":{"6":1}}],["categories",{"2":{"6":1}}],["cn",{"2":{"4":1,"5":1}}],["cline",{"2":{"2":1}}],["cli",{"2":{"2":2}}],["claude",{"2":{"2":3}}],["clone",{"2":{"0":2}}],["cp",{"2":{"0":1}}],["cd",{"2":{"0":1}}],["core",{"2":{"16":1}}],["covering",{"2":{"16":1,"18":1}}],["coverage",{"2":{"14":1}}],["cognitive",{"0":{"10":1},"2":{"13":1,"19":2}}],["counter",{"2":{"10":1,"13":1}}],["count",{"2":{"6":1}}],["cocoapods",{"2":{"4":1}}],["consistent",{"2":{"21":1}}],["consistency",{"2":{"5":1,"12":1,"21":1}}],["constraint",{"2":{"15":1}}],["conflicts",{"2":{"15":1}}],["confirmation",{"2":{"14":1}}],["confidence",{"2":{"10":1}}],["configs",{"2":{"3":1}}],["config",{"2":{"2":3,"3":2}}],["configure",{"2":{"0":1}}],["conformity",{"2":{"10":1}}],["conditions",{"2":{"10":2}}],["conclusion",{"2":{"10":1}}],["conclusions",{"2":{"9":1,"13":1}}],["concurrency",{"2":{"4":1,"9":1,"13":1}}],["control",{"2":{"15":1}}],["context",{"0":{"9":1},"2":{"9":1,"13":1}}],["content",{"2":{"3":1}}],["continue",{"2":{"2":2}}],["codex",{"2":{"2":3}}],["code",{"2":{"2":1,"4":1,"14":1,"16":2,"17":1,"20":2}}],["codebuddy",{"2":{"2":2}}],["coding",{"2":{"0":2,"1":2,"2":1,"4":2}}],["compares",{"2":{"21":1}}],["compatible",{"2":{"3":1}}],["comprehensive",{"2":{"21":1}}],["compliance",{"2":{"14":1}}],["complete",{"2":{"6":1,"17":1}}],["commit",{"2":{"3":2,"11":2}}],["command",{"2":{"0":1}}],["com",{"2":{"0":1}}],["quick",{"0":{"0":1},"1":{"1":1}}]],"serializationVersion":2}'; +export { + _localSearchIndexroot as default +}; diff --git a/docs/.vitepress/dist/assets/chunks/VPLocalSearchBox.DoLsN_4M.js b/docs/.vitepress/dist/assets/chunks/VPLocalSearchBox.DoLsN_4M.js new file mode 100644 index 0000000..38f91d7 --- /dev/null +++ b/docs/.vitepress/dist/assets/chunks/VPLocalSearchBox.DoLsN_4M.js @@ -0,0 +1,5343 @@ +var __defProp = Object.defineProperty; +var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value; +var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value); +import { V as __vitePreload, q as watch, ah as tryOnScopeDispose, h as computed, ai as toValue, aj as toArray, ak as unrefElement, al as notNullish, G as shallowRef, d as defineComponent, am as computedAsync, p as ref, an as useSessionStorage, ao as useLocalStorage, s as watchEffect, ap as watchDebounced, v as onMounted, P as nextTick, O as onKeyStroke, aq as useRouter, ar as useEventListener, W as useScrollLock, R as inBrowser, $ as onBeforeUnmount, o as openBlock, b as createBlock, j as createBaseVNode, a0 as withModifiers, k as unref, as as withDirectives, at as vModelText, au as isRef, c as createElementBlock, n as normalizeClass, e as createCommentVNode, B as renderList, F as Fragment, a as createTextVNode, t as toDisplayString, av as Teleport, aw as markRaw, ax as createApp, a6 as dataSymbol, ab as pathToFile, ay as escapeRegExp, _ as _export_sfc } from "./framework.BcMzFyCJ.js"; +import { u as useData, c as createSearchTranslate } from "./theme.BrkFYulG.js"; +const localSearchIndex = { "root": () => __vitePreload(() => import("./@localSearchIndexroot.DDvkKcys.js"), true ? [] : void 0) }; +/*! +* tabbable 6.5.0 +* @license MIT, https://github.com/focus-trap/tabbable/blob/master/LICENSE +*/ +var candidateSelectors = ["input:not([inert]):not([inert] *)", "select:not([inert]):not([inert] *)", "textarea:not([inert]):not([inert] *)", "a[href]:not([inert]):not([inert] *)", "area[href]:not([inert]):not([inert] *)", "button:not([inert]):not([inert] *)", "[tabindex]:not(slot):not([inert]):not([inert] *)", "audio[controls]:not([inert]):not([inert] *)", "video[controls]:not([inert]):not([inert] *)", '[contenteditable]:not([contenteditable="false"]):not([inert]):not([inert] *)', "details>summary:first-of-type:not([inert]):not([inert] *)", "details:not([inert]):not([inert] *)"]; +var candidateSelector = /* @__PURE__ */ candidateSelectors.join(","); +var NoElement = typeof Element === "undefined"; +var matches = NoElement ? function() { +} : Element.prototype.matches || Element.prototype.msMatchesSelector || Element.prototype.webkitMatchesSelector; +var getRootNode = !NoElement && Element.prototype.getRootNode ? function(element) { + var _element$getRootNode; + return element === null || element === void 0 ? void 0 : (_element$getRootNode = element.getRootNode) === null || _element$getRootNode === void 0 ? void 0 : _element$getRootNode.call(element); +} : function(element) { + return element === null || element === void 0 ? void 0 : element.ownerDocument; +}; +var _isInert = function isInert(node, lookUp) { + var _node$getAttribute; + if (lookUp === void 0) { + lookUp = true; + } + var inertAtt = node === null || node === void 0 ? void 0 : (_node$getAttribute = node.getAttribute) === null || _node$getAttribute === void 0 ? void 0 : _node$getAttribute.call(node, "inert"); + var inert = inertAtt === "" || inertAtt === "true"; + var result = inert || lookUp && node && // closest does not exist on shadow roots, so we fall back to a manual + // lookup upward, in case it is not defined. + (typeof node.closest === "function" ? node.closest("[inert]") : _isInert(node.parentNode)); + return result; +}; +var isContentEditable = function isContentEditable2(node) { + var _node$getAttribute2; + var attValue = node === null || node === void 0 ? void 0 : (_node$getAttribute2 = node.getAttribute) === null || _node$getAttribute2 === void 0 ? void 0 : _node$getAttribute2.call(node, "contenteditable"); + return attValue === "" || attValue === "true"; +}; +var getCandidates = function getCandidates2(el, includeContainer, filter) { + if (_isInert(el)) { + return []; + } + var candidates = Array.prototype.slice.apply(el.querySelectorAll(candidateSelector)); + if (includeContainer && matches.call(el, candidateSelector)) { + candidates.unshift(el); + } + candidates = candidates.filter(filter); + return candidates; +}; +var _getCandidatesIteratively = function getCandidatesIteratively(elements, includeContainer, options) { + var candidates = []; + var elementsToCheck = Array.from(elements); + while (elementsToCheck.length) { + var element = elementsToCheck.shift(); + if (_isInert(element, false)) { + continue; + } + if (element.tagName === "SLOT") { + var assigned = element.assignedElements(); + var content = assigned.length ? assigned : element.children; + var nestedCandidates = _getCandidatesIteratively(content, true, options); + if (options.flatten) { + candidates.push.apply(candidates, nestedCandidates); + } else { + candidates.push({ + scopeParent: element, + candidates: nestedCandidates + }); + } + } else { + var validCandidate = matches.call(element, candidateSelector); + if (validCandidate && options.filter(element) && (includeContainer || !elements.includes(element))) { + candidates.push(element); + } + var shadowRoot = element.shadowRoot || // check for an undisclosed shadow + typeof options.getShadowRoot === "function" && options.getShadowRoot(element); + var validShadowRoot = !_isInert(shadowRoot, false) && (!options.shadowRootFilter || options.shadowRootFilter(element)); + if (shadowRoot && validShadowRoot) { + var _nestedCandidates = _getCandidatesIteratively(shadowRoot === true ? element.children : shadowRoot.children, true, options); + if (options.flatten) { + candidates.push.apply(candidates, _nestedCandidates); + } else { + candidates.push({ + scopeParent: element, + candidates: _nestedCandidates + }); + } + } else { + elementsToCheck.unshift.apply(elementsToCheck, element.children); + } + } + } + return candidates; +}; +var hasTabIndex = function hasTabIndex2(node) { + return !isNaN(parseInt(node.getAttribute("tabindex"), 10)); +}; +var getTabIndex = function getTabIndex2(node) { + if (!node) { + throw new Error("No node provided"); + } + if (node.tabIndex < 0) { + if ((/^(AUDIO|VIDEO|DETAILS)$/.test(node.tagName) || isContentEditable(node)) && !hasTabIndex(node)) { + return 0; + } + } + return node.tabIndex; +}; +var getSortOrderTabIndex = function getSortOrderTabIndex2(node, isScope) { + var tabIndex = getTabIndex(node); + if (tabIndex < 0 && isScope && !hasTabIndex(node)) { + return 0; + } + return tabIndex; +}; +var sortOrderedTabbables = function sortOrderedTabbables2(a, b) { + return a.tabIndex === b.tabIndex ? a.documentOrder - b.documentOrder : a.tabIndex - b.tabIndex; +}; +var isInput = function isInput2(node) { + return node.tagName === "INPUT"; +}; +var isHiddenInput = function isHiddenInput2(node) { + return isInput(node) && node.type === "hidden"; +}; +var isDetailsWithSummary = function isDetailsWithSummary2(node) { + var r = node.tagName === "DETAILS" && Array.prototype.slice.apply(node.children).some(function(child) { + return child.tagName === "SUMMARY"; + }); + return r; +}; +var getCheckedRadio = function getCheckedRadio2(nodes, form) { + for (var i = 0; i < nodes.length; i++) { + if (nodes[i].checked && nodes[i].form === form) { + return nodes[i]; + } + } +}; +var isTabbableRadio = function isTabbableRadio2(node) { + if (!node.name) { + return true; + } + var radioScope = node.form || getRootNode(node); + var queryRadios = function queryRadios2(name) { + return radioScope.querySelectorAll('input[type="radio"][name="' + name + '"]'); + }; + var radioSet; + if (typeof window !== "undefined" && typeof window.CSS !== "undefined" && typeof window.CSS.escape === "function") { + radioSet = queryRadios(window.CSS.escape(node.name)); + } else { + try { + radioSet = queryRadios(node.name); + } catch (err) { + console.error("Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s", err.message); + return false; + } + } + var checked = getCheckedRadio(radioSet, node.form); + return !checked || checked === node; +}; +var isRadio = function isRadio2(node) { + return isInput(node) && node.type === "radio"; +}; +var isNonTabbableRadio = function isNonTabbableRadio2(node) { + return isRadio(node) && !isTabbableRadio(node); +}; +var isNodeAttached = function isNodeAttached2(node) { + var _nodeRoot; + var nodeRoot = node && getRootNode(node); + var nodeRootHost = (_nodeRoot = nodeRoot) === null || _nodeRoot === void 0 ? void 0 : _nodeRoot.host; + var attached = false; + if (nodeRoot && nodeRoot !== node) { + var _nodeRootHost, _nodeRootHost$ownerDo, _node$ownerDocument; + attached = !!((_nodeRootHost = nodeRootHost) !== null && _nodeRootHost !== void 0 && (_nodeRootHost$ownerDo = _nodeRootHost.ownerDocument) !== null && _nodeRootHost$ownerDo !== void 0 && _nodeRootHost$ownerDo.contains(nodeRootHost) || node !== null && node !== void 0 && (_node$ownerDocument = node.ownerDocument) !== null && _node$ownerDocument !== void 0 && _node$ownerDocument.contains(node)); + while (!attached && nodeRootHost) { + var _nodeRoot2, _nodeRootHost2, _nodeRootHost2$ownerD; + nodeRoot = getRootNode(nodeRootHost); + nodeRootHost = (_nodeRoot2 = nodeRoot) === null || _nodeRoot2 === void 0 ? void 0 : _nodeRoot2.host; + attached = !!((_nodeRootHost2 = nodeRootHost) !== null && _nodeRootHost2 !== void 0 && (_nodeRootHost2$ownerD = _nodeRootHost2.ownerDocument) !== null && _nodeRootHost2$ownerD !== void 0 && _nodeRootHost2$ownerD.contains(nodeRootHost)); + } + } + return attached; +}; +var isZeroArea = function isZeroArea2(node) { + var _node$getBoundingClie = node.getBoundingClientRect(), width = _node$getBoundingClie.width, height = _node$getBoundingClie.height; + return width === 0 && height === 0; +}; +var isHidden = function isHidden2(node, _ref) { + var displayCheck = _ref.displayCheck, getShadowRoot = _ref.getShadowRoot; + if (displayCheck === "full-native") { + if ("checkVisibility" in node) { + var visible = node.checkVisibility({ + // Checking opacity might be desirable for some use cases, but natively, + // opacity zero elements _are_ focusable and tabbable. + checkOpacity: false, + opacityProperty: false, + contentVisibilityAuto: true, + visibilityProperty: true, + // This is an alias for `visibilityProperty`. Contemporary browsers + // support both. However, this alias has wider browser support (Chrome + // >= 105 and Firefox >= 106, vs. Chrome >= 121 and Firefox >= 122), so + // we include it anyway. + checkVisibilityCSS: true + }); + return !visible; + } + } + var _getComputedStyle = getComputedStyle(node), visibility = _getComputedStyle.visibility; + if (visibility === "hidden" || visibility === "collapse") { + return true; + } + var isDirectSummary = matches.call(node, "details>summary:first-of-type"); + var nodeUnderDetails = isDirectSummary ? node.parentElement : node; + if (matches.call(nodeUnderDetails, "details:not([open]) *")) { + return true; + } + if (!displayCheck || displayCheck === "full" || // full-native can run this branch when it falls through in case + // Element#checkVisibility is unsupported + displayCheck === "full-native" || displayCheck === "legacy-full") { + if (typeof getShadowRoot === "function") { + var originalNode = node; + while (node) { + var parentElement = node.parentElement; + var rootNode = getRootNode(node); + if (parentElement && !parentElement.shadowRoot && getShadowRoot(parentElement) === true) { + return isZeroArea(node); + } else if (node.assignedSlot) { + node = node.assignedSlot; + } else if (!parentElement && rootNode !== node.ownerDocument) { + node = rootNode.host; + } else { + node = parentElement; + } + } + node = originalNode; + } + if (isNodeAttached(node)) { + return !node.getClientRects().length; + } + if (displayCheck !== "legacy-full") { + return true; + } + } else if (displayCheck === "non-zero-area") { + return isZeroArea(node); + } + return false; +}; +var isDisabledFromFieldset = function isDisabledFromFieldset2(node) { + if (/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(node.tagName)) { + var parentNode = node.parentElement; + while (parentNode) { + if (parentNode.tagName === "FIELDSET" && parentNode.disabled) { + for (var i = 0; i < parentNode.children.length; i++) { + var child = parentNode.children.item(i); + if (child.tagName === "LEGEND") { + return matches.call(parentNode, "fieldset[disabled] *") ? true : !child.contains(node); + } + } + return true; + } + parentNode = parentNode.parentElement; + } + } + return false; +}; +var isNodeMatchingSelectorFocusable = function isNodeMatchingSelectorFocusable2(options, node) { + if (node.disabled || isHiddenInput(node) || isHidden(node, options) || // For a details element with a summary, the summary element gets the focus + isDetailsWithSummary(node) || isDisabledFromFieldset(node)) { + return false; + } + return true; +}; +var isNodeMatchingSelectorTabbable = function isNodeMatchingSelectorTabbable2(options, node) { + if (isNonTabbableRadio(node) || getTabIndex(node) < 0 || !isNodeMatchingSelectorFocusable(options, node)) { + return false; + } + return true; +}; +var isShadowRootTabbable = function isShadowRootTabbable2(shadowHostNode) { + var tabIndex = parseInt(shadowHostNode.getAttribute("tabindex"), 10); + if (isNaN(tabIndex) || tabIndex >= 0) { + return true; + } + return false; +}; +var _sortByOrder = function sortByOrder(candidates) { + var regularTabbables = []; + var orderedTabbables = []; + candidates.forEach(function(item, i) { + var isScope = !!item.scopeParent; + var element = isScope ? item.scopeParent : item; + var candidateTabindex = getSortOrderTabIndex(element, isScope); + var elements = isScope ? _sortByOrder(item.candidates) : element; + if (candidateTabindex === 0) { + isScope ? regularTabbables.push.apply(regularTabbables, elements) : regularTabbables.push(element); + } else { + orderedTabbables.push({ + documentOrder: i, + tabIndex: candidateTabindex, + item, + isScope, + content: elements + }); + } + }); + return orderedTabbables.sort(sortOrderedTabbables).reduce(function(acc, sortable) { + sortable.isScope ? acc.push.apply(acc, sortable.content) : acc.push(sortable.content); + return acc; + }, []).concat(regularTabbables); +}; +var tabbable = function tabbable2(container, options) { + options = options || {}; + var candidates; + if (options.getShadowRoot) { + candidates = _getCandidatesIteratively([container], options.includeContainer, { + filter: isNodeMatchingSelectorTabbable.bind(null, options), + flatten: false, + getShadowRoot: options.getShadowRoot, + shadowRootFilter: isShadowRootTabbable + }); + } else { + candidates = getCandidates(container, options.includeContainer, isNodeMatchingSelectorTabbable.bind(null, options)); + } + return _sortByOrder(candidates); +}; +var focusable = function focusable2(container, options) { + options = options || {}; + var candidates; + if (options.getShadowRoot) { + candidates = _getCandidatesIteratively([container], options.includeContainer, { + filter: isNodeMatchingSelectorFocusable.bind(null, options), + flatten: true, + getShadowRoot: options.getShadowRoot + }); + } else { + candidates = getCandidates(container, options.includeContainer, isNodeMatchingSelectorFocusable.bind(null, options)); + } + return candidates; +}; +var isTabbable = function isTabbable2(node, options) { + options = options || {}; + if (!node) { + throw new Error("No node provided"); + } + if (matches.call(node, candidateSelector) === false) { + return false; + } + return isNodeMatchingSelectorTabbable(options, node); +}; +var focusableCandidateSelector = /* @__PURE__ */ candidateSelectors.concat("iframe:not([inert]):not([inert] *)").join(","); +var isFocusable = function isFocusable2(node, options) { + options = options || {}; + if (!node) { + throw new Error("No node provided"); + } + if (matches.call(node, focusableCandidateSelector) === false) { + return false; + } + return isNodeMatchingSelectorFocusable(options, node); +}; +/*! +* focus-trap 7.8.0 +* @license MIT, https://github.com/focus-trap/focus-trap/blob/master/LICENSE +*/ +function _arrayLikeToArray(r, a) { + (null == a || a > r.length) && (a = r.length); + for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; + return n; +} +function _arrayWithoutHoles(r) { + if (Array.isArray(r)) return _arrayLikeToArray(r); +} +function _createForOfIteratorHelper(r, e) { + var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; + if (!t) { + if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e) { + t && (r = t); + var n = 0, F = function() { + }; + return { + s: F, + n: function() { + return n >= r.length ? { + done: true + } : { + done: false, + value: r[n++] + }; + }, + e: function(r2) { + throw r2; + }, + f: F + }; + } + throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); + } + var o, a = true, u = false; + return { + s: function() { + t = t.call(r); + }, + n: function() { + var r2 = t.next(); + return a = r2.done, r2; + }, + e: function(r2) { + u = true, o = r2; + }, + f: function() { + try { + a || null == t.return || t.return(); + } finally { + if (u) throw o; + } + } + }; +} +function _defineProperty(e, r, t) { + return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { + value: t, + enumerable: true, + configurable: true, + writable: true + }) : e[r] = t, e; +} +function _iterableToArray(r) { + if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r); +} +function _nonIterableSpread() { + throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); +} +function ownKeys(e, r) { + var t = Object.keys(e); + if (Object.getOwnPropertySymbols) { + var o = Object.getOwnPropertySymbols(e); + r && (o = o.filter(function(r2) { + return Object.getOwnPropertyDescriptor(e, r2).enumerable; + })), t.push.apply(t, o); + } + return t; +} +function _objectSpread2(e) { + for (var r = 1; r < arguments.length; r++) { + var t = null != arguments[r] ? arguments[r] : {}; + r % 2 ? ownKeys(Object(t), true).forEach(function(r2) { + _defineProperty(e, r2, t[r2]); + }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function(r2) { + Object.defineProperty(e, r2, Object.getOwnPropertyDescriptor(t, r2)); + }); + } + return e; +} +function _toConsumableArray(r) { + return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread(); +} +function _toPrimitive(t, r) { + if ("object" != typeof t || !t) return t; + var e = t[Symbol.toPrimitive]; + if (void 0 !== e) { + var i = e.call(t, r); + if ("object" != typeof i) return i; + throw new TypeError("@@toPrimitive must return a primitive value."); + } + return ("string" === r ? String : Number)(t); +} +function _toPropertyKey(t) { + var i = _toPrimitive(t, "string"); + return "symbol" == typeof i ? i : i + ""; +} +function _unsupportedIterableToArray(r, a) { + if (r) { + if ("string" == typeof r) return _arrayLikeToArray(r, a); + var t = {}.toString.call(r).slice(8, -1); + return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; + } +} +var activeFocusTraps = { + // Returns the trap from the top of the stack. + getActiveTrap: function getActiveTrap(trapStack) { + if ((trapStack === null || trapStack === void 0 ? void 0 : trapStack.length) > 0) { + return trapStack[trapStack.length - 1]; + } + return null; + }, + // Pauses the currently active trap, then adds a new trap to the stack. + activateTrap: function activateTrap(trapStack, trap) { + var activeTrap = activeFocusTraps.getActiveTrap(trapStack); + if (trap !== activeTrap) { + activeFocusTraps.pauseTrap(trapStack); + } + var trapIndex = trapStack.indexOf(trap); + if (trapIndex === -1) { + trapStack.push(trap); + } else { + trapStack.splice(trapIndex, 1); + trapStack.push(trap); + } + }, + // Removes the trap from the top of the stack, then unpauses the next trap down. + deactivateTrap: function deactivateTrap(trapStack, trap) { + var trapIndex = trapStack.indexOf(trap); + if (trapIndex !== -1) { + trapStack.splice(trapIndex, 1); + } + activeFocusTraps.unpauseTrap(trapStack); + }, + // Pauses the trap at the top of the stack. + pauseTrap: function pauseTrap(trapStack) { + var activeTrap = activeFocusTraps.getActiveTrap(trapStack); + activeTrap === null || activeTrap === void 0 || activeTrap._setPausedState(true); + }, + // Unpauses the trap at the top of the stack. + unpauseTrap: function unpauseTrap(trapStack) { + var activeTrap = activeFocusTraps.getActiveTrap(trapStack); + if (activeTrap && !activeTrap._isManuallyPaused()) { + activeTrap._setPausedState(false); + } + } +}; +var isSelectableInput = function isSelectableInput2(node) { + return node.tagName && node.tagName.toLowerCase() === "input" && typeof node.select === "function"; +}; +var isEscapeEvent = function isEscapeEvent2(e) { + return (e === null || e === void 0 ? void 0 : e.key) === "Escape" || (e === null || e === void 0 ? void 0 : e.key) === "Esc" || (e === null || e === void 0 ? void 0 : e.keyCode) === 27; +}; +var isTabEvent = function isTabEvent2(e) { + return (e === null || e === void 0 ? void 0 : e.key) === "Tab" || (e === null || e === void 0 ? void 0 : e.keyCode) === 9; +}; +var isKeyForward = function isKeyForward2(e) { + return isTabEvent(e) && !e.shiftKey; +}; +var isKeyBackward = function isKeyBackward2(e) { + return isTabEvent(e) && e.shiftKey; +}; +var delay = function delay2(fn) { + return setTimeout(fn, 0); +}; +var valueOrHandler = function valueOrHandler2(value) { + for (var _len = arguments.length, params = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { + params[_key - 1] = arguments[_key]; + } + return typeof value === "function" ? value.apply(void 0, params) : value; +}; +var getActualTarget = function getActualTarget2(event) { + return event.target.shadowRoot && typeof event.composedPath === "function" ? event.composedPath()[0] : event.target; +}; +var internalTrapStack = []; +var createFocusTrap = function createFocusTrap2(elements, userOptions) { + var doc = (userOptions === null || userOptions === void 0 ? void 0 : userOptions.document) || document; + var trapStack = (userOptions === null || userOptions === void 0 ? void 0 : userOptions.trapStack) || internalTrapStack; + var config = _objectSpread2({ + returnFocusOnDeactivate: true, + escapeDeactivates: true, + delayInitialFocus: true, + isolateSubtrees: false, + isKeyForward, + isKeyBackward + }, userOptions); + var state = { + // containers given to createFocusTrap() + /** @type {Array} */ + containers: [], + // list of objects identifying tabbable nodes in `containers` in the trap + // NOTE: it's possible that a group has no tabbable nodes if nodes get removed while the trap + // is active, but the trap should never get to a state where there isn't at least one group + // with at least one tabbable node in it (that would lead to an error condition that would + // result in an error being thrown) + /** @type {Array<{ + * container: HTMLElement, + * tabbableNodes: Array, // empty if none + * focusableNodes: Array, // empty if none + * posTabIndexesFound: boolean, + * firstTabbableNode: HTMLElement|undefined, + * lastTabbableNode: HTMLElement|undefined, + * firstDomTabbableNode: HTMLElement|undefined, + * lastDomTabbableNode: HTMLElement|undefined, + * nextTabbableNode: (node: HTMLElement, forward: boolean) => HTMLElement|undefined + * }>} + */ + containerGroups: [], + // same order/length as `containers` list + // references to objects in `containerGroups`, but only those that actually have + // tabbable nodes in them + // NOTE: same order as `containers` and `containerGroups`, but __not necessarily__ + // the same length + tabbableGroups: [], + // references to nodes that are siblings to the ancestors of this trap's containers. + /** @type {Set} */ + adjacentElements: /* @__PURE__ */ new Set(), + // references to nodes that were inert or aria-hidden before the trap was activated. + /** @type {Set} */ + alreadySilent: /* @__PURE__ */ new Set(), + nodeFocusedBeforeActivation: null, + mostRecentlyFocusedNode: null, + active: false, + paused: false, + manuallyPaused: false, + // timer ID for when delayInitialFocus is true and initial focus in this trap + // has been delayed during activation + delayInitialFocusTimer: void 0, + // the most recent KeyboardEvent for the configured nav key (typically [SHIFT+]TAB), if any + recentNavEvent: void 0 + }; + var trap; + var getOption = function getOption2(configOverrideOptions, optionName, configOptionName) { + return configOverrideOptions && configOverrideOptions[optionName] !== void 0 ? configOverrideOptions[optionName] : config[configOptionName || optionName]; + }; + var findContainerIndex = function findContainerIndex2(element, event) { + var composedPath = typeof (event === null || event === void 0 ? void 0 : event.composedPath) === "function" ? event.composedPath() : void 0; + return state.containerGroups.findIndex(function(_ref) { + var container = _ref.container, tabbableNodes = _ref.tabbableNodes; + return container.contains(element) || // fall back to explicit tabbable search which will take into consideration any + // web components if the `tabbableOptions.getShadowRoot` option was used for + // the trap, enabling shadow DOM support in tabbable (`Node.contains()` doesn't + // look inside web components even if open) + (composedPath === null || composedPath === void 0 ? void 0 : composedPath.includes(container)) || tabbableNodes.find(function(node) { + return node === element; + }); + }); + }; + var getNodeForOption = function getNodeForOption2(optionName) { + var _ref2 = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, _ref2$hasFallback = _ref2.hasFallback, hasFallback = _ref2$hasFallback === void 0 ? false : _ref2$hasFallback, _ref2$params = _ref2.params, params = _ref2$params === void 0 ? [] : _ref2$params; + var optionValue = config[optionName]; + if (typeof optionValue === "function") { + optionValue = optionValue.apply(void 0, _toConsumableArray(params)); + } + if (optionValue === true) { + optionValue = void 0; + } + if (!optionValue) { + if (optionValue === void 0 || optionValue === false) { + return optionValue; + } + throw new Error("`".concat(optionName, "` was specified but was not a node, or did not return a node")); + } + var node = optionValue; + if (typeof optionValue === "string") { + try { + node = doc.querySelector(optionValue); + } catch (err) { + throw new Error("`".concat(optionName, '` appears to be an invalid selector; error="').concat(err.message, '"')); + } + if (!node) { + if (!hasFallback) { + throw new Error("`".concat(optionName, "` as selector refers to no known node")); + } + } + } + return node; + }; + var getInitialFocusNode = function getInitialFocusNode2() { + var node = getNodeForOption("initialFocus", { + hasFallback: true + }); + if (node === false) { + return false; + } + if (node === void 0 || node && !isFocusable(node, config.tabbableOptions)) { + if (findContainerIndex(doc.activeElement) >= 0) { + node = doc.activeElement; + } else { + var firstTabbableGroup = state.tabbableGroups[0]; + var firstTabbableNode = firstTabbableGroup && firstTabbableGroup.firstTabbableNode; + node = firstTabbableNode || getNodeForOption("fallbackFocus"); + } + } else if (node === null) { + node = getNodeForOption("fallbackFocus"); + } + if (!node) { + throw new Error("Your focus-trap needs to have at least one focusable element"); + } + return node; + }; + var updateTabbableNodes = function updateTabbableNodes2() { + state.containerGroups = state.containers.map(function(container) { + var tabbableNodes = tabbable(container, config.tabbableOptions); + var focusableNodes = focusable(container, config.tabbableOptions); + var firstTabbableNode = tabbableNodes.length > 0 ? tabbableNodes[0] : void 0; + var lastTabbableNode = tabbableNodes.length > 0 ? tabbableNodes[tabbableNodes.length - 1] : void 0; + var firstDomTabbableNode = focusableNodes.find(function(node) { + return isTabbable(node); + }); + var lastDomTabbableNode = focusableNodes.slice().reverse().find(function(node) { + return isTabbable(node); + }); + var posTabIndexesFound = !!tabbableNodes.find(function(node) { + return getTabIndex(node) > 0; + }); + return { + container, + tabbableNodes, + focusableNodes, + /** True if at least one node with positive `tabindex` was found in this container. */ + posTabIndexesFound, + /** First tabbable node in container, __tabindex__ order; `undefined` if none. */ + firstTabbableNode, + /** Last tabbable node in container, __tabindex__ order; `undefined` if none. */ + lastTabbableNode, + // NOTE: DOM order is NOT NECESSARILY "document position" order, but figuring that out + // would require more than just https://developer.mozilla.org/en-US/docs/Web/API/Node/compareDocumentPosition + // because that API doesn't work with Shadow DOM as well as it should (@see + // https://github.com/whatwg/dom/issues/320) and since this first/last is only needed, so far, + // to address an edge case related to positive tabindex support, this seems like a much easier, + // "close enough most of the time" alternative for positive tabindexes which should generally + // be avoided anyway... + /** First tabbable node in container, __DOM__ order; `undefined` if none. */ + firstDomTabbableNode, + /** Last tabbable node in container, __DOM__ order; `undefined` if none. */ + lastDomTabbableNode, + /** + * Finds the __tabbable__ node that follows the given node in the specified direction, + * in this container, if any. + * @param {HTMLElement} node + * @param {boolean} [forward] True if going in forward tab order; false if going + * in reverse. + * @returns {HTMLElement|undefined} The next tabbable node, if any. + */ + nextTabbableNode: function nextTabbableNode(node) { + var forward = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : true; + var nodeIdx = tabbableNodes.indexOf(node); + if (nodeIdx < 0) { + if (forward) { + return focusableNodes.slice(focusableNodes.indexOf(node) + 1).find(function(el) { + return isTabbable(el); + }); + } + return focusableNodes.slice(0, focusableNodes.indexOf(node)).reverse().find(function(el) { + return isTabbable(el); + }); + } + return tabbableNodes[nodeIdx + (forward ? 1 : -1)]; + } + }; + }); + state.tabbableGroups = state.containerGroups.filter(function(group) { + return group.tabbableNodes.length > 0; + }); + if (state.tabbableGroups.length <= 0 && !getNodeForOption("fallbackFocus")) { + throw new Error("Your focus-trap must have at least one container with at least one tabbable node in it at all times"); + } + if (state.containerGroups.find(function(g) { + return g.posTabIndexesFound; + }) && state.containerGroups.length > 1) { + throw new Error("At least one node with a positive tabindex was found in one of your focus-trap's multiple containers. Positive tabindexes are only supported in single-container focus-traps."); + } + }; + var _getActiveElement = function getActiveElement(el) { + var activeElement = el.activeElement; + if (!activeElement) { + return; + } + if (activeElement.shadowRoot && activeElement.shadowRoot.activeElement !== null) { + return _getActiveElement(activeElement.shadowRoot); + } + return activeElement; + }; + var _tryFocus = function tryFocus(node) { + if (node === false) { + return; + } + if (node === _getActiveElement(document)) { + return; + } + if (!node || !node.focus) { + _tryFocus(getInitialFocusNode()); + return; + } + node.focus({ + preventScroll: !!config.preventScroll + }); + state.mostRecentlyFocusedNode = node; + if (isSelectableInput(node)) { + node.select(); + } + }; + var getReturnFocusNode = function getReturnFocusNode2(previousActiveElement) { + var node = getNodeForOption("setReturnFocus", { + params: [previousActiveElement] + }); + return node ? node : node === false ? false : previousActiveElement; + }; + var findNextNavNode = function findNextNavNode2(_ref3) { + var target = _ref3.target, event = _ref3.event, _ref3$isBackward = _ref3.isBackward, isBackward = _ref3$isBackward === void 0 ? false : _ref3$isBackward; + target = target || getActualTarget(event); + updateTabbableNodes(); + var destinationNode = null; + if (state.tabbableGroups.length > 0) { + var containerIndex = findContainerIndex(target, event); + var containerGroup = containerIndex >= 0 ? state.containerGroups[containerIndex] : void 0; + if (containerIndex < 0) { + if (isBackward) { + destinationNode = state.tabbableGroups[state.tabbableGroups.length - 1].lastTabbableNode; + } else { + destinationNode = state.tabbableGroups[0].firstTabbableNode; + } + } else if (isBackward) { + var startOfGroupIndex = state.tabbableGroups.findIndex(function(_ref4) { + var firstTabbableNode = _ref4.firstTabbableNode; + return target === firstTabbableNode; + }); + if (startOfGroupIndex < 0 && (containerGroup.container === target || isFocusable(target, config.tabbableOptions) && !isTabbable(target, config.tabbableOptions) && !containerGroup.nextTabbableNode(target, false))) { + startOfGroupIndex = containerIndex; + } + if (startOfGroupIndex >= 0) { + var destinationGroupIndex = startOfGroupIndex === 0 ? state.tabbableGroups.length - 1 : startOfGroupIndex - 1; + var destinationGroup = state.tabbableGroups[destinationGroupIndex]; + destinationNode = getTabIndex(target) >= 0 ? destinationGroup.lastTabbableNode : destinationGroup.lastDomTabbableNode; + } else if (!isTabEvent(event)) { + destinationNode = containerGroup.nextTabbableNode(target, false); + } + } else { + var lastOfGroupIndex = state.tabbableGroups.findIndex(function(_ref5) { + var lastTabbableNode = _ref5.lastTabbableNode; + return target === lastTabbableNode; + }); + if (lastOfGroupIndex < 0 && (containerGroup.container === target || isFocusable(target, config.tabbableOptions) && !isTabbable(target, config.tabbableOptions) && !containerGroup.nextTabbableNode(target))) { + lastOfGroupIndex = containerIndex; + } + if (lastOfGroupIndex >= 0) { + var _destinationGroupIndex = lastOfGroupIndex === state.tabbableGroups.length - 1 ? 0 : lastOfGroupIndex + 1; + var _destinationGroup = state.tabbableGroups[_destinationGroupIndex]; + destinationNode = getTabIndex(target) >= 0 ? _destinationGroup.firstTabbableNode : _destinationGroup.firstDomTabbableNode; + } else if (!isTabEvent(event)) { + destinationNode = containerGroup.nextTabbableNode(target); + } + } + } else { + destinationNode = getNodeForOption("fallbackFocus"); + } + return destinationNode; + }; + var checkPointerDown = function checkPointerDown2(e) { + var target = getActualTarget(e); + if (findContainerIndex(target, e) >= 0) { + return; + } + if (valueOrHandler(config.clickOutsideDeactivates, e)) { + trap.deactivate({ + // NOTE: by setting `returnFocus: false`, deactivate() will do nothing, + // which will result in the outside click setting focus to the node + // that was clicked (and if not focusable, to "nothing"); by setting + // `returnFocus: true`, we'll attempt to re-focus the node originally-focused + // on activation (or the configured `setReturnFocus` node), whether the + // outside click was on a focusable node or not + returnFocus: config.returnFocusOnDeactivate + }); + return; + } + if (valueOrHandler(config.allowOutsideClick, e)) { + return; + } + e.preventDefault(); + }; + var checkFocusIn = function checkFocusIn2(event) { + var target = getActualTarget(event); + var targetContained = findContainerIndex(target, event) >= 0; + if (targetContained || target instanceof Document) { + if (targetContained) { + state.mostRecentlyFocusedNode = target; + } + } else { + event.stopImmediatePropagation(); + var nextNode; + var navAcrossContainers = true; + if (state.mostRecentlyFocusedNode) { + if (getTabIndex(state.mostRecentlyFocusedNode) > 0) { + var mruContainerIdx = findContainerIndex(state.mostRecentlyFocusedNode); + var tabbableNodes = state.containerGroups[mruContainerIdx].tabbableNodes; + if (tabbableNodes.length > 0) { + var mruTabIdx = tabbableNodes.findIndex(function(node) { + return node === state.mostRecentlyFocusedNode; + }); + if (mruTabIdx >= 0) { + if (config.isKeyForward(state.recentNavEvent)) { + if (mruTabIdx + 1 < tabbableNodes.length) { + nextNode = tabbableNodes[mruTabIdx + 1]; + navAcrossContainers = false; + } + } else { + if (mruTabIdx - 1 >= 0) { + nextNode = tabbableNodes[mruTabIdx - 1]; + navAcrossContainers = false; + } + } + } + } + } else { + if (!state.containerGroups.some(function(g) { + return g.tabbableNodes.some(function(n) { + return getTabIndex(n) > 0; + }); + })) { + navAcrossContainers = false; + } + } + } else { + navAcrossContainers = false; + } + if (navAcrossContainers) { + nextNode = findNextNavNode({ + // move FROM the MRU node, not event-related node (which will be the node that is + // outside the trap causing the focus escape we're trying to fix) + target: state.mostRecentlyFocusedNode, + isBackward: config.isKeyBackward(state.recentNavEvent) + }); + } + if (nextNode) { + _tryFocus(nextNode); + } else { + _tryFocus(state.mostRecentlyFocusedNode || getInitialFocusNode()); + } + } + state.recentNavEvent = void 0; + }; + var checkKeyNav = function checkKeyNav2(event) { + var isBackward = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : false; + state.recentNavEvent = event; + var destinationNode = findNextNavNode({ + event, + isBackward + }); + if (destinationNode) { + if (isTabEvent(event)) { + event.preventDefault(); + } + _tryFocus(destinationNode); + } + }; + var checkTabKey = function checkTabKey2(event) { + if (config.isKeyForward(event) || config.isKeyBackward(event)) { + checkKeyNav(event, config.isKeyBackward(event)); + } + }; + var checkEscapeKey = function checkEscapeKey2(event) { + if (isEscapeEvent(event) && valueOrHandler(config.escapeDeactivates, event) !== false) { + event.preventDefault(); + trap.deactivate(); + } + }; + var checkClick = function checkClick2(e) { + var target = getActualTarget(e); + if (findContainerIndex(target, e) >= 0) { + return; + } + if (valueOrHandler(config.clickOutsideDeactivates, e)) { + return; + } + if (valueOrHandler(config.allowOutsideClick, e)) { + return; + } + e.preventDefault(); + e.stopImmediatePropagation(); + }; + var addListeners = function addListeners2() { + if (!state.active) { + return; + } + activeFocusTraps.activateTrap(trapStack, trap); + state.delayInitialFocusTimer = config.delayInitialFocus ? delay(function() { + _tryFocus(getInitialFocusNode()); + }) : _tryFocus(getInitialFocusNode()); + doc.addEventListener("focusin", checkFocusIn, true); + doc.addEventListener("mousedown", checkPointerDown, { + capture: true, + passive: false + }); + doc.addEventListener("touchstart", checkPointerDown, { + capture: true, + passive: false + }); + doc.addEventListener("click", checkClick, { + capture: true, + passive: false + }); + doc.addEventListener("keydown", checkTabKey, { + capture: true, + passive: false + }); + doc.addEventListener("keydown", checkEscapeKey); + return trap; + }; + var collectAdjacentElements = function collectAdjacentElements2(containers) { + if (state.active && !state.paused) { + trap._setSubtreeIsolation(false); + } + state.adjacentElements.clear(); + state.alreadySilent.clear(); + var containerAncestors = /* @__PURE__ */ new Set(); + var adjacentElements = /* @__PURE__ */ new Set(); + var _iterator = _createForOfIteratorHelper(containers), _step; + try { + for (_iterator.s(); !(_step = _iterator.n()).done; ) { + var container = _step.value; + containerAncestors.add(container); + var insideShadowRoot = typeof ShadowRoot !== "undefined" && container.getRootNode() instanceof ShadowRoot; + var current = container; + while (current) { + containerAncestors.add(current); + var parent = current.parentElement; + var siblings = []; + if (parent) { + siblings = parent.children; + } else if (!parent && insideShadowRoot) { + siblings = current.getRootNode().children; + parent = current.getRootNode().host; + insideShadowRoot = typeof ShadowRoot !== "undefined" && parent.getRootNode() instanceof ShadowRoot; + } + var _iterator2 = _createForOfIteratorHelper(siblings), _step2; + try { + for (_iterator2.s(); !(_step2 = _iterator2.n()).done; ) { + var child = _step2.value; + adjacentElements.add(child); + } + } catch (err) { + _iterator2.e(err); + } finally { + _iterator2.f(); + } + current = parent; + } + } + } catch (err) { + _iterator.e(err); + } finally { + _iterator.f(); + } + containerAncestors.forEach(function(el) { + adjacentElements["delete"](el); + }); + state.adjacentElements = adjacentElements; + }; + var removeListeners = function removeListeners2() { + if (!state.active) { + return; + } + doc.removeEventListener("focusin", checkFocusIn, true); + doc.removeEventListener("mousedown", checkPointerDown, true); + doc.removeEventListener("touchstart", checkPointerDown, true); + doc.removeEventListener("click", checkClick, true); + doc.removeEventListener("keydown", checkTabKey, true); + doc.removeEventListener("keydown", checkEscapeKey); + return trap; + }; + var checkDomRemoval = function checkDomRemoval2(mutations) { + var isFocusedNodeRemoved = mutations.some(function(mutation) { + var removedNodes = Array.from(mutation.removedNodes); + return removedNodes.some(function(node) { + return node === state.mostRecentlyFocusedNode; + }); + }); + if (isFocusedNodeRemoved) { + _tryFocus(getInitialFocusNode()); + } + }; + var mutationObserver = typeof window !== "undefined" && "MutationObserver" in window ? new MutationObserver(checkDomRemoval) : void 0; + var updateObservedNodes = function updateObservedNodes2() { + if (!mutationObserver) { + return; + } + mutationObserver.disconnect(); + if (state.active && !state.paused) { + state.containers.map(function(container) { + mutationObserver.observe(container, { + subtree: true, + childList: true + }); + }); + } + }; + trap = { + get active() { + return state.active; + }, + get paused() { + return state.paused; + }, + activate: function activate(activateOptions) { + if (state.active) { + return this; + } + var onActivate = getOption(activateOptions, "onActivate"); + var onPostActivate = getOption(activateOptions, "onPostActivate"); + var checkCanFocusTrap = getOption(activateOptions, "checkCanFocusTrap"); + var preexistingTrap = activeFocusTraps.getActiveTrap(trapStack); + var revertState = false; + if (preexistingTrap && !preexistingTrap.paused) { + var _preexistingTrap$_set; + (_preexistingTrap$_set = preexistingTrap._setSubtreeIsolation) === null || _preexistingTrap$_set === void 0 || _preexistingTrap$_set.call(preexistingTrap, false); + revertState = true; + } + try { + if (!checkCanFocusTrap) { + updateTabbableNodes(); + } + state.active = true; + state.paused = false; + state.nodeFocusedBeforeActivation = _getActiveElement(doc); + onActivate === null || onActivate === void 0 || onActivate(); + var finishActivation = function finishActivation2() { + if (checkCanFocusTrap) { + updateTabbableNodes(); + } + addListeners(); + updateObservedNodes(); + if (config.isolateSubtrees) { + trap._setSubtreeIsolation(true); + } + onPostActivate === null || onPostActivate === void 0 || onPostActivate(); + }; + if (checkCanFocusTrap) { + checkCanFocusTrap(state.containers.concat()).then(finishActivation, finishActivation); + return this; + } + finishActivation(); + } catch (error) { + if (preexistingTrap === activeFocusTraps.getActiveTrap(trapStack) && revertState) { + var _preexistingTrap$_set2; + (_preexistingTrap$_set2 = preexistingTrap._setSubtreeIsolation) === null || _preexistingTrap$_set2 === void 0 || _preexistingTrap$_set2.call(preexistingTrap, true); + } + throw error; + } + return this; + }, + deactivate: function deactivate(deactivateOptions) { + if (!state.active) { + return this; + } + var options = _objectSpread2({ + onDeactivate: config.onDeactivate, + onPostDeactivate: config.onPostDeactivate, + checkCanReturnFocus: config.checkCanReturnFocus + }, deactivateOptions); + clearTimeout(state.delayInitialFocusTimer); + state.delayInitialFocusTimer = void 0; + if (!state.paused) { + trap._setSubtreeIsolation(false); + } + state.alreadySilent.clear(); + removeListeners(); + state.active = false; + state.paused = false; + updateObservedNodes(); + activeFocusTraps.deactivateTrap(trapStack, trap); + var onDeactivate = getOption(options, "onDeactivate"); + var onPostDeactivate = getOption(options, "onPostDeactivate"); + var checkCanReturnFocus = getOption(options, "checkCanReturnFocus"); + var returnFocus = getOption(options, "returnFocus", "returnFocusOnDeactivate"); + onDeactivate === null || onDeactivate === void 0 || onDeactivate(); + var finishDeactivation = function finishDeactivation2() { + delay(function() { + if (returnFocus) { + _tryFocus(getReturnFocusNode(state.nodeFocusedBeforeActivation)); + } + onPostDeactivate === null || onPostDeactivate === void 0 || onPostDeactivate(); + }); + }; + if (returnFocus && checkCanReturnFocus) { + checkCanReturnFocus(getReturnFocusNode(state.nodeFocusedBeforeActivation)).then(finishDeactivation, finishDeactivation); + return this; + } + finishDeactivation(); + return this; + }, + pause: function pause(pauseOptions) { + if (!state.active) { + return this; + } + state.manuallyPaused = true; + return this._setPausedState(true, pauseOptions); + }, + unpause: function unpause(unpauseOptions) { + if (!state.active) { + return this; + } + state.manuallyPaused = false; + if (trapStack[trapStack.length - 1] !== this) { + return this; + } + return this._setPausedState(false, unpauseOptions); + }, + updateContainerElements: function updateContainerElements(containerElements) { + var elementsAsArray = [].concat(containerElements).filter(Boolean); + state.containers = elementsAsArray.map(function(element) { + return typeof element === "string" ? doc.querySelector(element) : element; + }); + if (config.isolateSubtrees) { + collectAdjacentElements(state.containers); + } + if (state.active) { + updateTabbableNodes(); + if (config.isolateSubtrees && !state.paused) { + trap._setSubtreeIsolation(true); + } + } + updateObservedNodes(); + return this; + } + }; + Object.defineProperties(trap, { + _isManuallyPaused: { + value: function value() { + return state.manuallyPaused; + } + }, + _setPausedState: { + value: function value(paused, options) { + if (state.paused === paused) { + return this; + } + state.paused = paused; + if (paused) { + var onPause = getOption(options, "onPause"); + var onPostPause = getOption(options, "onPostPause"); + onPause === null || onPause === void 0 || onPause(); + removeListeners(); + updateObservedNodes(); + trap._setSubtreeIsolation(false); + onPostPause === null || onPostPause === void 0 || onPostPause(); + } else { + var onUnpause = getOption(options, "onUnpause"); + var onPostUnpause = getOption(options, "onPostUnpause"); + onUnpause === null || onUnpause === void 0 || onUnpause(); + trap._setSubtreeIsolation(true); + updateTabbableNodes(); + addListeners(); + updateObservedNodes(); + onPostUnpause === null || onPostUnpause === void 0 || onPostUnpause(); + } + return this; + } + }, + _setSubtreeIsolation: { + value: function value(isEnabled) { + if (config.isolateSubtrees) { + state.adjacentElements.forEach(function(el) { + var _el$getAttribute; + if (isEnabled) { + switch (config.isolateSubtrees) { + case "aria-hidden": + if (el.ariaHidden === "true" || ((_el$getAttribute = el.getAttribute("aria-hidden")) === null || _el$getAttribute === void 0 ? void 0 : _el$getAttribute.toLowerCase()) === "true") { + state.alreadySilent.add(el); + } + el.setAttribute("aria-hidden", "true"); + break; + default: + if (el.inert || el.hasAttribute("inert")) { + state.alreadySilent.add(el); + } + el.setAttribute("inert", true); + break; + } + } else { + if (state.alreadySilent.has(el)) ; + else { + switch (config.isolateSubtrees) { + case "aria-hidden": + el.removeAttribute("aria-hidden"); + break; + default: + el.removeAttribute("inert"); + break; + } + } + } + }); + } + } + } + }); + trap.updateContainerElements(elements); + return trap; +}; +function useFocusTrap(target, options = {}) { + let trap; + const { immediate, ...focusTrapOptions } = options; + const hasFocus = shallowRef(false); + const isPaused = shallowRef(false); + const activate = (opts) => trap && trap.activate(opts); + const deactivate = (opts) => trap && trap.deactivate(opts); + const pause = () => { + if (trap) { + trap.pause(); + isPaused.value = true; + } + }; + const unpause = () => { + if (trap) { + trap.unpause(); + isPaused.value = false; + } + }; + const targets = computed(() => { + const _targets = toValue(target); + return toArray(_targets).map((el) => { + const _el = toValue(el); + return typeof _el === "string" ? _el : unrefElement(_el); + }).filter(notNullish); + }); + watch( + targets, + (els) => { + if (!els.length) + return; + trap = createFocusTrap(els, { + ...focusTrapOptions, + onActivate() { + hasFocus.value = true; + if (options.onActivate) + options.onActivate(); + }, + onDeactivate() { + hasFocus.value = false; + if (options.onDeactivate) + options.onDeactivate(); + } + }); + if (immediate) + activate(); + }, + { flush: "post" } + ); + tryOnScopeDispose(() => deactivate()); + return { + hasFocus, + isPaused, + activate, + deactivate, + pause, + unpause + }; +} +class DOMIterator { + /** + * @param {HTMLElement|HTMLElement[]|NodeList|string} ctx - The context DOM + * element, an array of DOM elements, a NodeList or a selector + * @param {boolean} [iframes=true] - A boolean indicating if iframes should + * be handled + * @param {string[]} [exclude=[]] - An array containing exclusion selectors + * for iframes + * @param {number} [iframesTimeout=5000] - A number indicating the ms to + * wait before an iframe should be skipped, in case the load event isn't + * fired. This also applies if the user is offline and the resource of the + * iframe is online (either by the browsers "offline" mode or because + * there's no internet connection) + */ + constructor(ctx, iframes = true, exclude = [], iframesTimeout = 5e3) { + this.ctx = ctx; + this.iframes = iframes; + this.exclude = exclude; + this.iframesTimeout = iframesTimeout; + } + /** + * Checks if the specified DOM element matches the selector + * @param {HTMLElement} element - The DOM element + * @param {string|string[]} selector - The selector or an array with + * selectors + * @return {boolean} + * @access public + */ + static matches(element, selector) { + const selectors = typeof selector === "string" ? [selector] : selector, fn = element.matches || element.matchesSelector || element.msMatchesSelector || element.mozMatchesSelector || element.oMatchesSelector || element.webkitMatchesSelector; + if (fn) { + let match = false; + selectors.every((sel) => { + if (fn.call(element, sel)) { + match = true; + return false; + } + return true; + }); + return match; + } else { + return false; + } + } + /** + * Returns all contexts filtered by duplicates (even nested) + * @return {HTMLElement[]} - An array containing DOM contexts + * @access protected + */ + getContexts() { + let ctx, filteredCtx = []; + if (typeof this.ctx === "undefined" || !this.ctx) { + ctx = []; + } else if (NodeList.prototype.isPrototypeOf(this.ctx)) { + ctx = Array.prototype.slice.call(this.ctx); + } else if (Array.isArray(this.ctx)) { + ctx = this.ctx; + } else if (typeof this.ctx === "string") { + ctx = Array.prototype.slice.call( + document.querySelectorAll(this.ctx) + ); + } else { + ctx = [this.ctx]; + } + ctx.forEach((ctx2) => { + const isDescendant = filteredCtx.filter((contexts) => { + return contexts.contains(ctx2); + }).length > 0; + if (filteredCtx.indexOf(ctx2) === -1 && !isDescendant) { + filteredCtx.push(ctx2); + } + }); + return filteredCtx; + } + /** + * @callback DOMIterator~getIframeContentsSuccessCallback + * @param {HTMLDocument} contents - The contentDocument of the iframe + */ + /** + * Calls the success callback function with the iframe document. If it can't + * be accessed it calls the error callback function + * @param {HTMLElement} ifr - The iframe DOM element + * @param {DOMIterator~getIframeContentsSuccessCallback} successFn + * @param {function} [errorFn] + * @access protected + */ + getIframeContents(ifr, successFn, errorFn = () => { + }) { + let doc; + try { + const ifrWin = ifr.contentWindow; + doc = ifrWin.document; + if (!ifrWin || !doc) { + throw new Error("iframe inaccessible"); + } + } catch (e) { + errorFn(); + } + if (doc) { + successFn(doc); + } + } + /** + * Checks if an iframe is empty (if about:blank is the shown page) + * @param {HTMLElement} ifr - The iframe DOM element + * @return {boolean} + * @access protected + */ + isIframeBlank(ifr) { + const bl = "about:blank", src = ifr.getAttribute("src").trim(), href = ifr.contentWindow.location.href; + return href === bl && src !== bl && src; + } + /** + * Observes the onload event of an iframe and calls the success callback or + * the error callback if the iframe is inaccessible. If the event isn't + * fired within the specified {@link DOMIterator#iframesTimeout}, then it'll + * call the error callback too + * @param {HTMLElement} ifr - The iframe DOM element + * @param {DOMIterator~getIframeContentsSuccessCallback} successFn + * @param {function} errorFn + * @access protected + */ + observeIframeLoad(ifr, successFn, errorFn) { + let called = false, tout = null; + const listener = () => { + if (called) { + return; + } + called = true; + clearTimeout(tout); + try { + if (!this.isIframeBlank(ifr)) { + ifr.removeEventListener("load", listener); + this.getIframeContents(ifr, successFn, errorFn); + } + } catch (e) { + errorFn(); + } + }; + ifr.addEventListener("load", listener); + tout = setTimeout(listener, this.iframesTimeout); + } + /** + * Callback when the iframe is ready + * @callback DOMIterator~onIframeReadySuccessCallback + * @param {HTMLDocument} contents - The contentDocument of the iframe + */ + /** + * Callback if the iframe can't be accessed + * @callback DOMIterator~onIframeReadyErrorCallback + */ + /** + * Calls the callback if the specified iframe is ready for DOM access + * @param {HTMLElement} ifr - The iframe DOM element + * @param {DOMIterator~onIframeReadySuccessCallback} successFn - Success + * callback + * @param {DOMIterator~onIframeReadyErrorCallback} errorFn - Error callback + * @see {@link http://stackoverflow.com/a/36155560/3894981} for + * background information + * @access protected + */ + onIframeReady(ifr, successFn, errorFn) { + try { + if (ifr.contentWindow.document.readyState === "complete") { + if (this.isIframeBlank(ifr)) { + this.observeIframeLoad(ifr, successFn, errorFn); + } else { + this.getIframeContents(ifr, successFn, errorFn); + } + } else { + this.observeIframeLoad(ifr, successFn, errorFn); + } + } catch (e) { + errorFn(); + } + } + /** + * Callback when all iframes are ready for DOM access + * @callback DOMIterator~waitForIframesDoneCallback + */ + /** + * Iterates over all iframes and calls the done callback when all of them + * are ready for DOM access (including nested ones) + * @param {HTMLElement} ctx - The context DOM element + * @param {DOMIterator~waitForIframesDoneCallback} done - Done callback + */ + waitForIframes(ctx, done) { + let eachCalled = 0; + this.forEachIframe(ctx, () => true, (ifr) => { + eachCalled++; + this.waitForIframes(ifr.querySelector("html"), () => { + if (!--eachCalled) { + done(); + } + }); + }, (handled) => { + if (!handled) { + done(); + } + }); + } + /** + * Callback allowing to filter an iframe. Must return true when the element + * should remain, otherwise false + * @callback DOMIterator~forEachIframeFilterCallback + * @param {HTMLElement} iframe - The iframe DOM element + */ + /** + * Callback for each iframe content + * @callback DOMIterator~forEachIframeEachCallback + * @param {HTMLElement} content - The iframe document + */ + /** + * Callback if all iframes inside the context were handled + * @callback DOMIterator~forEachIframeEndCallback + * @param {number} handled - The number of handled iframes (those who + * wheren't filtered) + */ + /** + * Iterates over all iframes inside the specified context and calls the + * callbacks when they're ready. Filters iframes based on the instance + * exclusion selectors + * @param {HTMLElement} ctx - The context DOM element + * @param {DOMIterator~forEachIframeFilterCallback} filter - Filter callback + * @param {DOMIterator~forEachIframeEachCallback} each - Each callback + * @param {DOMIterator~forEachIframeEndCallback} [end] - End callback + * @access protected + */ + forEachIframe(ctx, filter, each, end = () => { + }) { + let ifr = ctx.querySelectorAll("iframe"), open = ifr.length, handled = 0; + ifr = Array.prototype.slice.call(ifr); + const checkEnd = () => { + if (--open <= 0) { + end(handled); + } + }; + if (!open) { + checkEnd(); + } + ifr.forEach((ifr2) => { + if (DOMIterator.matches(ifr2, this.exclude)) { + checkEnd(); + } else { + this.onIframeReady(ifr2, (con) => { + if (filter(ifr2)) { + handled++; + each(con); + } + checkEnd(); + }, checkEnd); + } + }); + } + /** + * Creates a NodeIterator on the specified context + * @see {@link https://developer.mozilla.org/en/docs/Web/API/NodeIterator} + * @param {HTMLElement} ctx - The context DOM element + * @param {DOMIterator~whatToShow} whatToShow + * @param {DOMIterator~filterCb} filter + * @return {NodeIterator} + * @access protected + */ + createIterator(ctx, whatToShow, filter) { + return document.createNodeIterator(ctx, whatToShow, filter, false); + } + /** + * Creates an instance of DOMIterator in an iframe + * @param {HTMLDocument} contents - Iframe document + * @return {DOMIterator} + * @access protected + */ + createInstanceOnIframe(contents) { + return new DOMIterator(contents.querySelector("html"), this.iframes); + } + /** + * Checks if an iframe occurs between two nodes, more specifically if an + * iframe occurs before the specified node and after the specified prevNode + * @param {HTMLElement} node - The node that should occur after the iframe + * @param {HTMLElement} prevNode - The node that should occur before the + * iframe + * @param {HTMLElement} ifr - The iframe to check against + * @return {boolean} + * @access protected + */ + compareNodeIframe(node, prevNode, ifr) { + const compCurr = node.compareDocumentPosition(ifr), prev = Node.DOCUMENT_POSITION_PRECEDING; + if (compCurr & prev) { + if (prevNode !== null) { + const compPrev = prevNode.compareDocumentPosition(ifr), after = Node.DOCUMENT_POSITION_FOLLOWING; + if (compPrev & after) { + return true; + } + } else { + return true; + } + } + return false; + } + /** + * @typedef {DOMIterator~getIteratorNodeReturn} + * @type {object.} + * @property {HTMLElement} prevNode - The previous node or null if there is + * no + * @property {HTMLElement} node - The current node + */ + /** + * Returns the previous and current node of the specified iterator + * @param {NodeIterator} itr - The iterator + * @return {DOMIterator~getIteratorNodeReturn} + * @access protected + */ + getIteratorNode(itr) { + const prevNode = itr.previousNode(); + let node; + if (prevNode === null) { + node = itr.nextNode(); + } else { + node = itr.nextNode() && itr.nextNode(); + } + return { + prevNode, + node + }; + } + /** + * An array containing objects. The object key "val" contains an iframe + * DOM element. The object key "handled" contains a boolean indicating if + * the iframe was handled already. + * It wouldn't be enough to save all open or all already handled iframes. + * The information of open iframes is necessary because they may occur after + * all other text nodes (and compareNodeIframe would never be true). The + * information of already handled iframes is necessary as otherwise they may + * be handled multiple times + * @typedef DOMIterator~checkIframeFilterIfr + * @type {object[]} + */ + /** + * Checks if an iframe wasn't handled already and if so, calls + * {@link DOMIterator#compareNodeIframe} to check if it should be handled. + * Information wheter an iframe was or wasn't handled is given within the + * ifr dictionary + * @param {HTMLElement} node - The node that should occur after the iframe + * @param {HTMLElement} prevNode - The node that should occur before the + * iframe + * @param {HTMLElement} currIfr - The iframe to check + * @param {DOMIterator~checkIframeFilterIfr} ifr - The iframe dictionary. + * Will be manipulated (by reference) + * @return {boolean} Returns true when it should be handled, otherwise false + * @access protected + */ + checkIframeFilter(node, prevNode, currIfr, ifr) { + let key = false, handled = false; + ifr.forEach((ifrDict, i) => { + if (ifrDict.val === currIfr) { + key = i; + handled = ifrDict.handled; + } + }); + if (this.compareNodeIframe(node, prevNode, currIfr)) { + if (key === false && !handled) { + ifr.push({ + val: currIfr, + handled: true + }); + } else if (key !== false && !handled) { + ifr[key].handled = true; + } + return true; + } + if (key === false) { + ifr.push({ + val: currIfr, + handled: false + }); + } + return false; + } + /** + * Creates an iterator on all open iframes in the specified array and calls + * the end callback when finished + * @param {DOMIterator~checkIframeFilterIfr} ifr + * @param {DOMIterator~whatToShow} whatToShow + * @param {DOMIterator~forEachNodeCallback} eCb - Each callback + * @param {DOMIterator~filterCb} fCb + * @access protected + */ + handleOpenIframes(ifr, whatToShow, eCb, fCb) { + ifr.forEach((ifrDict) => { + if (!ifrDict.handled) { + this.getIframeContents(ifrDict.val, (con) => { + this.createInstanceOnIframe(con).forEachNode( + whatToShow, + eCb, + fCb + ); + }); + } + }); + } + /** + * Iterates through all nodes in the specified context and handles iframe + * nodes at the correct position + * @param {DOMIterator~whatToShow} whatToShow + * @param {HTMLElement} ctx - The context + * @param {DOMIterator~forEachNodeCallback} eachCb - Each callback + * @param {DOMIterator~filterCb} filterCb - Filter callback + * @param {DOMIterator~forEachNodeEndCallback} doneCb - End callback + * @access protected + */ + iterateThroughNodes(whatToShow, ctx, eachCb, filterCb, doneCb) { + const itr = this.createIterator(ctx, whatToShow, filterCb); + let ifr = [], elements = [], node, prevNode, retrieveNodes = () => { + ({ + prevNode, + node + } = this.getIteratorNode(itr)); + return node; + }; + while (retrieveNodes()) { + if (this.iframes) { + this.forEachIframe(ctx, (currIfr) => { + return this.checkIframeFilter(node, prevNode, currIfr, ifr); + }, (con) => { + this.createInstanceOnIframe(con).forEachNode( + whatToShow, + (ifrNode) => elements.push(ifrNode), + filterCb + ); + }); + } + elements.push(node); + } + elements.forEach((node2) => { + eachCb(node2); + }); + if (this.iframes) { + this.handleOpenIframes(ifr, whatToShow, eachCb, filterCb); + } + doneCb(); + } + /** + * Callback for each node + * @callback DOMIterator~forEachNodeCallback + * @param {HTMLElement} node - The DOM text node element + */ + /** + * Callback if all contexts were handled + * @callback DOMIterator~forEachNodeEndCallback + */ + /** + * Iterates over all contexts and initializes + * {@link DOMIterator#iterateThroughNodes iterateThroughNodes} on them + * @param {DOMIterator~whatToShow} whatToShow + * @param {DOMIterator~forEachNodeCallback} each - Each callback + * @param {DOMIterator~filterCb} filter - Filter callback + * @param {DOMIterator~forEachNodeEndCallback} done - End callback + * @access public + */ + forEachNode(whatToShow, each, filter, done = () => { + }) { + const contexts = this.getContexts(); + let open = contexts.length; + if (!open) { + done(); + } + contexts.forEach((ctx) => { + const ready = () => { + this.iterateThroughNodes(whatToShow, ctx, each, filter, () => { + if (--open <= 0) { + done(); + } + }); + }; + if (this.iframes) { + this.waitForIframes(ctx, ready); + } else { + ready(); + } + }); + } + /** + * Callback to filter nodes. Can return e.g. NodeFilter.FILTER_ACCEPT or + * NodeFilter.FILTER_REJECT + * @see {@link http://tinyurl.com/zdczmm2} + * @callback DOMIterator~filterCb + * @param {HTMLElement} node - The node to filter + */ + /** + * @typedef DOMIterator~whatToShow + * @see {@link http://tinyurl.com/zfqqkx2} + * @type {number} + */ +} +let Mark$1 = class Mark { + // eslint-disable-line no-unused-vars + /** + * @param {HTMLElement|HTMLElement[]|NodeList|string} ctx - The context DOM + * element, an array of DOM elements, a NodeList or a selector + */ + constructor(ctx) { + this.ctx = ctx; + this.ie = false; + const ua = window.navigator.userAgent; + if (ua.indexOf("MSIE") > -1 || ua.indexOf("Trident") > -1) { + this.ie = true; + } + } + /** + * Options defined by the user. They will be initialized from one of the + * public methods. See {@link Mark#mark}, {@link Mark#markRegExp}, + * {@link Mark#markRanges} and {@link Mark#unmark} for option properties. + * @type {object} + * @param {object} [val] - An object that will be merged with defaults + * @access protected + */ + set opt(val) { + this._opt = Object.assign({}, { + "element": "", + "className": "", + "exclude": [], + "iframes": false, + "iframesTimeout": 5e3, + "separateWordSearch": true, + "diacritics": true, + "synonyms": {}, + "accuracy": "partially", + "acrossElements": false, + "caseSensitive": false, + "ignoreJoiners": false, + "ignoreGroups": 0, + "ignorePunctuation": [], + "wildcards": "disabled", + "each": () => { + }, + "noMatch": () => { + }, + "filter": () => true, + "done": () => { + }, + "debug": false, + "log": window.console + }, val); + } + get opt() { + return this._opt; + } + /** + * An instance of DOMIterator + * @type {DOMIterator} + * @access protected + */ + get iterator() { + return new DOMIterator( + this.ctx, + this.opt.iframes, + this.opt.exclude, + this.opt.iframesTimeout + ); + } + /** + * Logs a message if log is enabled + * @param {string} msg - The message to log + * @param {string} [level="debug"] - The log level, e.g. warn + * error, debug + * @access protected + */ + log(msg, level = "debug") { + const log = this.opt.log; + if (!this.opt.debug) { + return; + } + if (typeof log === "object" && typeof log[level] === "function") { + log[level](`mark.js: ${msg}`); + } + } + /** + * Escapes a string for usage within a regular expression + * @param {string} str - The string to escape + * @return {string} + * @access protected + */ + escapeStr(str) { + return str.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, "\\$&"); + } + /** + * Creates a regular expression string to match the specified search + * term including synonyms, diacritics and accuracy if defined + * @param {string} str - The search term to be used + * @return {string} + * @access protected + */ + createRegExp(str) { + if (this.opt.wildcards !== "disabled") { + str = this.setupWildcardsRegExp(str); + } + str = this.escapeStr(str); + if (Object.keys(this.opt.synonyms).length) { + str = this.createSynonymsRegExp(str); + } + if (this.opt.ignoreJoiners || this.opt.ignorePunctuation.length) { + str = this.setupIgnoreJoinersRegExp(str); + } + if (this.opt.diacritics) { + str = this.createDiacriticsRegExp(str); + } + str = this.createMergedBlanksRegExp(str); + if (this.opt.ignoreJoiners || this.opt.ignorePunctuation.length) { + str = this.createJoinersRegExp(str); + } + if (this.opt.wildcards !== "disabled") { + str = this.createWildcardsRegExp(str); + } + str = this.createAccuracyRegExp(str); + return str; + } + /** + * Creates a regular expression string to match the defined synonyms + * @param {string} str - The search term to be used + * @return {string} + * @access protected + */ + createSynonymsRegExp(str) { + const syn = this.opt.synonyms, sens = this.opt.caseSensitive ? "" : "i", joinerPlaceholder = this.opt.ignoreJoiners || this.opt.ignorePunctuation.length ? "\0" : ""; + for (let index in syn) { + if (syn.hasOwnProperty(index)) { + const value = syn[index], k1 = this.opt.wildcards !== "disabled" ? this.setupWildcardsRegExp(index) : this.escapeStr(index), k2 = this.opt.wildcards !== "disabled" ? this.setupWildcardsRegExp(value) : this.escapeStr(value); + if (k1 !== "" && k2 !== "") { + str = str.replace( + new RegExp( + `(${this.escapeStr(k1)}|${this.escapeStr(k2)})`, + `gm${sens}` + ), + joinerPlaceholder + `(${this.processSynomyms(k1)}|${this.processSynomyms(k2)})` + joinerPlaceholder + ); + } + } + } + return str; + } + /** + * Setup synonyms to work with ignoreJoiners and or ignorePunctuation + * @param {string} str - synonym key or value to process + * @return {string} - processed synonym string + */ + processSynomyms(str) { + if (this.opt.ignoreJoiners || this.opt.ignorePunctuation.length) { + str = this.setupIgnoreJoinersRegExp(str); + } + return str; + } + /** + * Sets up the regular expression string to allow later insertion of + * wildcard regular expression matches + * @param {string} str - The search term to be used + * @return {string} + * @access protected + */ + setupWildcardsRegExp(str) { + str = str.replace(/(?:\\)*\?/g, (val) => { + return val.charAt(0) === "\\" ? "?" : ""; + }); + return str.replace(/(?:\\)*\*/g, (val) => { + return val.charAt(0) === "\\" ? "*" : ""; + }); + } + /** + * Sets up the regular expression string to allow later insertion of + * wildcard regular expression matches + * @param {string} str - The search term to be used + * @return {string} + * @access protected + */ + createWildcardsRegExp(str) { + let spaces = this.opt.wildcards === "withSpaces"; + return str.replace(/\u0001/g, spaces ? "[\\S\\s]?" : "\\S?").replace(/\u0002/g, spaces ? "[\\S\\s]*?" : "\\S*"); + } + /** + * Sets up the regular expression string to allow later insertion of + * designated characters (soft hyphens & zero width characters) + * @param {string} str - The search term to be used + * @return {string} + * @access protected + */ + setupIgnoreJoinersRegExp(str) { + return str.replace(/[^(|)\\]/g, (val, indx, original) => { + let nextChar = original.charAt(indx + 1); + if (/[(|)\\]/.test(nextChar) || nextChar === "") { + return val; + } else { + return val + "\0"; + } + }); + } + /** + * Creates a regular expression string to allow ignoring of designated + * characters (soft hyphens, zero width characters & punctuation) based on + * the specified option values of ignorePunctuation and + * ignoreJoiners + * @param {string} str - The search term to be used + * @return {string} + * @access protected + */ + createJoinersRegExp(str) { + let joiner = []; + const ignorePunctuation = this.opt.ignorePunctuation; + if (Array.isArray(ignorePunctuation) && ignorePunctuation.length) { + joiner.push(this.escapeStr(ignorePunctuation.join(""))); + } + if (this.opt.ignoreJoiners) { + joiner.push("\\u00ad\\u200b\\u200c\\u200d"); + } + return joiner.length ? str.split(/\u0000+/).join(`[${joiner.join("")}]*`) : str; + } + /** + * Creates a regular expression string to match diacritics + * @param {string} str - The search term to be used + * @return {string} + * @access protected + */ + createDiacriticsRegExp(str) { + const sens = this.opt.caseSensitive ? "" : "i", dct = this.opt.caseSensitive ? [ + "aàáảãạăằắẳẵặâầấẩẫậäåāą", + "AÀÁẢÃẠĂẰẮẲẴẶÂẦẤẨẪẬÄÅĀĄ", + "cçćč", + "CÇĆČ", + "dđď", + "DĐĎ", + "eèéẻẽẹêềếểễệëěēę", + "EÈÉẺẼẸÊỀẾỂỄỆËĚĒĘ", + "iìíỉĩịîïī", + "IÌÍỈĨỊÎÏĪ", + "lł", + "LŁ", + "nñňń", + "NÑŇŃ", + "oòóỏõọôồốổỗộơởỡớờợöøō", + "OÒÓỎÕỌÔỒỐỔỖỘƠỞỠỚỜỢÖØŌ", + "rř", + "RŘ", + "sšśșş", + "SŠŚȘŞ", + "tťțţ", + "TŤȚŢ", + "uùúủũụưừứửữựûüůū", + "UÙÚỦŨỤƯỪỨỬỮỰÛÜŮŪ", + "yýỳỷỹỵÿ", + "YÝỲỶỸỴŸ", + "zžżź", + "ZŽŻŹ" + ] : [ + "aàáảãạăằắẳẵặâầấẩẫậäåāąAÀÁẢÃẠĂẰẮẲẴẶÂẦẤẨẪẬÄÅĀĄ", + "cçćčCÇĆČ", + "dđďDĐĎ", + "eèéẻẽẹêềếểễệëěēęEÈÉẺẼẸÊỀẾỂỄỆËĚĒĘ", + "iìíỉĩịîïīIÌÍỈĨỊÎÏĪ", + "lłLŁ", + "nñňńNÑŇŃ", + "oòóỏõọôồốổỗộơởỡớờợöøōOÒÓỎÕỌÔỒỐỔỖỘƠỞỠỚỜỢÖØŌ", + "rřRŘ", + "sšśșşSŠŚȘŞ", + "tťțţTŤȚŢ", + "uùúủũụưừứửữựûüůūUÙÚỦŨỤƯỪỨỬỮỰÛÜŮŪ", + "yýỳỷỹỵÿYÝỲỶỸỴŸ", + "zžżźZŽŻŹ" + ]; + let handled = []; + str.split("").forEach((ch) => { + dct.every((dct2) => { + if (dct2.indexOf(ch) !== -1) { + if (handled.indexOf(dct2) > -1) { + return false; + } + str = str.replace( + new RegExp(`[${dct2}]`, `gm${sens}`), + `[${dct2}]` + ); + handled.push(dct2); + } + return true; + }); + }); + return str; + } + /** + * Creates a regular expression string that merges whitespace characters + * including subsequent ones into a single pattern, one or multiple + * whitespaces + * @param {string} str - The search term to be used + * @return {string} + * @access protected + */ + createMergedBlanksRegExp(str) { + return str.replace(/[\s]+/gmi, "[\\s]+"); + } + /** + * Creates a regular expression string to match the specified string with + * the defined accuracy. As in the regular expression of "exactly" can be + * a group containing a blank at the beginning, all regular expressions will + * be created with two groups. The first group can be ignored (may contain + * the said blank), the second contains the actual match + * @param {string} str - The searm term to be used + * @return {str} + * @access protected + */ + createAccuracyRegExp(str) { + const chars = "!\"#$%&'()*+,-./:;<=>?@[\\]^_`{|}~¡¿"; + let acc = this.opt.accuracy, val = typeof acc === "string" ? acc : acc.value, ls = typeof acc === "string" ? [] : acc.limiters, lsJoin = ""; + ls.forEach((limiter) => { + lsJoin += `|${this.escapeStr(limiter)}`; + }); + switch (val) { + case "partially": + default: + return `()(${str})`; + case "complementary": + lsJoin = "\\s" + (lsJoin ? lsJoin : this.escapeStr(chars)); + return `()([^${lsJoin}]*${str}[^${lsJoin}]*)`; + case "exactly": + return `(^|\\s${lsJoin})(${str})(?=$|\\s${lsJoin})`; + } + } + /** + * @typedef Mark~separatedKeywords + * @type {object.} + * @property {array.} keywords - The list of keywords + * @property {number} length - The length + */ + /** + * Returns a list of keywords dependent on whether separate word search + * was defined. Also it filters empty keywords + * @param {array} sv - The array of keywords + * @return {Mark~separatedKeywords} + * @access protected + */ + getSeparatedKeywords(sv) { + let stack = []; + sv.forEach((kw) => { + if (!this.opt.separateWordSearch) { + if (kw.trim() && stack.indexOf(kw) === -1) { + stack.push(kw); + } + } else { + kw.split(" ").forEach((kwSplitted) => { + if (kwSplitted.trim() && stack.indexOf(kwSplitted) === -1) { + stack.push(kwSplitted); + } + }); + } + }); + return { + // sort because of https://git.io/v6USg + "keywords": stack.sort((a, b) => { + return b.length - a.length; + }), + "length": stack.length + }; + } + /** + * Check if a value is a number + * @param {number|string} value - the value to check; + * numeric strings allowed + * @return {boolean} + * @access protected + */ + isNumeric(value) { + return Number(parseFloat(value)) == value; + } + /** + * @typedef Mark~rangeObject + * @type {object} + * @property {number} start - The start position within the composite value + * @property {number} length - The length of the string to mark within the + * composite value. + */ + /** + * @typedef Mark~setOfRanges + * @type {object[]} + * @property {Mark~rangeObject} + */ + /** + * Returns a processed list of integer offset indexes that do not overlap + * each other, and remove any string values or additional elements + * @param {Mark~setOfRanges} array - unprocessed raw array + * @return {Mark~setOfRanges} - processed array with any invalid entries + * removed + * @throws Will throw an error if an array of objects is not passed + * @access protected + */ + checkRanges(array) { + if (!Array.isArray(array) || Object.prototype.toString.call(array[0]) !== "[object Object]") { + this.log("markRanges() will only accept an array of objects"); + this.opt.noMatch(array); + return []; + } + const stack = []; + let last2 = 0; + array.sort((a, b) => { + return a.start - b.start; + }).forEach((item) => { + let { start, end, valid } = this.callNoMatchOnInvalidRanges(item, last2); + if (valid) { + item.start = start; + item.length = end - start; + stack.push(item); + last2 = end; + } + }); + return stack; + } + /** + * @typedef Mark~validObject + * @type {object} + * @property {number} start - The start position within the composite value + * @property {number} end - The calculated end position within the composite + * value. + * @property {boolean} valid - boolean value indicating that the start and + * calculated end range is valid + */ + /** + * Initial validation of ranges for markRanges. Preliminary checks are done + * to ensure the start and length values exist and are not zero or non- + * numeric + * @param {Mark~rangeObject} range - the current range object + * @param {number} last - last index of range + * @return {Mark~validObject} + * @access protected + */ + callNoMatchOnInvalidRanges(range, last2) { + let start, end, valid = false; + if (range && typeof range.start !== "undefined") { + start = parseInt(range.start, 10); + end = start + parseInt(range.length, 10); + if (this.isNumeric(range.start) && this.isNumeric(range.length) && end - last2 > 0 && end - start > 0) { + valid = true; + } else { + this.log( + `Ignoring invalid or overlapping range: ${JSON.stringify(range)}` + ); + this.opt.noMatch(range); + } + } else { + this.log(`Ignoring invalid range: ${JSON.stringify(range)}`); + this.opt.noMatch(range); + } + return { + start, + end, + valid + }; + } + /** + * Check valid range for markRanges. Check ranges with access to the context + * string. Range values are double checked, lengths that extend the mark + * beyond the string length are limitied and ranges containing only + * whitespace are ignored + * @param {Mark~rangeObject} range - the current range object + * @param {number} originalLength - original length of the context string + * @param {string} string - current content string + * @return {Mark~validObject} + * @access protected + */ + checkWhitespaceRanges(range, originalLength, string) { + let end, valid = true, max = string.length, offset = originalLength - max, start = parseInt(range.start, 10) - offset; + start = start > max ? max : start; + end = start + parseInt(range.length, 10); + if (end > max) { + end = max; + this.log(`End range automatically set to the max value of ${max}`); + } + if (start < 0 || end - start < 0 || start > max || end > max) { + valid = false; + this.log(`Invalid range: ${JSON.stringify(range)}`); + this.opt.noMatch(range); + } else if (string.substring(start, end).replace(/\s+/g, "") === "") { + valid = false; + this.log("Skipping whitespace only range: " + JSON.stringify(range)); + this.opt.noMatch(range); + } + return { + start, + end, + valid + }; + } + /** + * @typedef Mark~getTextNodesDict + * @type {object.} + * @property {string} value - The composite value of all text nodes + * @property {object[]} nodes - An array of objects + * @property {number} nodes.start - The start position within the composite + * value + * @property {number} nodes.end - The end position within the composite + * value + * @property {HTMLElement} nodes.node - The DOM text node element + */ + /** + * Callback + * @callback Mark~getTextNodesCallback + * @param {Mark~getTextNodesDict} + */ + /** + * Calls the callback with an object containing all text nodes (including + * iframe text nodes) with start and end positions and the composite value + * of them (string) + * @param {Mark~getTextNodesCallback} cb - Callback + * @access protected + */ + getTextNodes(cb) { + let val = "", nodes = []; + this.iterator.forEachNode(NodeFilter.SHOW_TEXT, (node) => { + nodes.push({ + start: val.length, + end: (val += node.textContent).length, + node + }); + }, (node) => { + if (this.matchesExclude(node.parentNode)) { + return NodeFilter.FILTER_REJECT; + } else { + return NodeFilter.FILTER_ACCEPT; + } + }, () => { + cb({ + value: val, + nodes + }); + }); + } + /** + * Checks if an element matches any of the specified exclude selectors. Also + * it checks for elements in which no marks should be performed (e.g. + * script and style tags) and optionally already marked elements + * @param {HTMLElement} el - The element to check + * @return {boolean} + * @access protected + */ + matchesExclude(el) { + return DOMIterator.matches(el, this.opt.exclude.concat([ + // ignores the elements itself, not their childrens (selector *) + "script", + "style", + "title", + "head", + "html" + ])); + } + /** + * Wraps the instance element and class around matches that fit the start + * and end positions within the node + * @param {HTMLElement} node - The DOM text node + * @param {number} start - The position where to start wrapping + * @param {number} end - The position where to end wrapping + * @return {HTMLElement} Returns the splitted text node that will appear + * after the wrapped text node + * @access protected + */ + wrapRangeInTextNode(node, start, end) { + const hEl = !this.opt.element ? "mark" : this.opt.element, startNode = node.splitText(start), ret = startNode.splitText(end - start); + let repl = document.createElement(hEl); + repl.setAttribute("data-markjs", "true"); + if (this.opt.className) { + repl.setAttribute("class", this.opt.className); + } + repl.textContent = startNode.textContent; + startNode.parentNode.replaceChild(repl, startNode); + return ret; + } + /** + * @typedef Mark~wrapRangeInMappedTextNodeDict + * @type {object.} + * @property {string} value - The composite value of all text nodes + * @property {object[]} nodes - An array of objects + * @property {number} nodes.start - The start position within the composite + * value + * @property {number} nodes.end - The end position within the composite + * value + * @property {HTMLElement} nodes.node - The DOM text node element + */ + /** + * Each callback + * @callback Mark~wrapMatchesEachCallback + * @param {HTMLElement} node - The wrapped DOM element + * @param {number} lastIndex - The last matching position within the + * composite value of text nodes + */ + /** + * Filter callback + * @callback Mark~wrapMatchesFilterCallback + * @param {HTMLElement} node - The matching text node DOM element + */ + /** + * Determines matches by start and end positions using the text node + * dictionary even across text nodes and calls + * {@link Mark#wrapRangeInTextNode} to wrap them + * @param {Mark~wrapRangeInMappedTextNodeDict} dict - The dictionary + * @param {number} start - The start position of the match + * @param {number} end - The end position of the match + * @param {Mark~wrapMatchesFilterCallback} filterCb - Filter callback + * @param {Mark~wrapMatchesEachCallback} eachCb - Each callback + * @access protected + */ + wrapRangeInMappedTextNode(dict, start, end, filterCb, eachCb) { + dict.nodes.every((n, i) => { + const sibl = dict.nodes[i + 1]; + if (typeof sibl === "undefined" || sibl.start > start) { + if (!filterCb(n.node)) { + return false; + } + const s = start - n.start, e = (end > n.end ? n.end : end) - n.start, startStr = dict.value.substr(0, n.start), endStr = dict.value.substr(e + n.start); + n.node = this.wrapRangeInTextNode(n.node, s, e); + dict.value = startStr + endStr; + dict.nodes.forEach((k, j) => { + if (j >= i) { + if (dict.nodes[j].start > 0 && j !== i) { + dict.nodes[j].start -= e; + } + dict.nodes[j].end -= e; + } + }); + end -= e; + eachCb(n.node.previousSibling, n.start); + if (end > n.end) { + start = n.end; + } else { + return false; + } + } + return true; + }); + } + /** + * Filter callback before each wrapping + * @callback Mark~wrapMatchesFilterCallback + * @param {string} match - The matching string + * @param {HTMLElement} node - The text node where the match occurs + */ + /** + * Callback for each wrapped element + * @callback Mark~wrapMatchesEachCallback + * @param {HTMLElement} element - The marked DOM element + */ + /** + * Callback on end + * @callback Mark~wrapMatchesEndCallback + */ + /** + * Wraps the instance element and class around matches within single HTML + * elements in all contexts + * @param {RegExp} regex - The regular expression to be searched for + * @param {number} ignoreGroups - A number indicating the amount of RegExp + * matching groups to ignore + * @param {Mark~wrapMatchesFilterCallback} filterCb + * @param {Mark~wrapMatchesEachCallback} eachCb + * @param {Mark~wrapMatchesEndCallback} endCb + * @access protected + */ + wrapMatches(regex, ignoreGroups, filterCb, eachCb, endCb) { + const matchIdx = ignoreGroups === 0 ? 0 : ignoreGroups + 1; + this.getTextNodes((dict) => { + dict.nodes.forEach((node) => { + node = node.node; + let match; + while ((match = regex.exec(node.textContent)) !== null && match[matchIdx] !== "") { + if (!filterCb(match[matchIdx], node)) { + continue; + } + let pos = match.index; + if (matchIdx !== 0) { + for (let i = 1; i < matchIdx; i++) { + pos += match[i].length; + } + } + node = this.wrapRangeInTextNode( + node, + pos, + pos + match[matchIdx].length + ); + eachCb(node.previousSibling); + regex.lastIndex = 0; + } + }); + endCb(); + }); + } + /** + * Callback for each wrapped element + * @callback Mark~wrapMatchesAcrossElementsEachCallback + * @param {HTMLElement} element - The marked DOM element + */ + /** + * Filter callback before each wrapping + * @callback Mark~wrapMatchesAcrossElementsFilterCallback + * @param {string} match - The matching string + * @param {HTMLElement} node - The text node where the match occurs + */ + /** + * Callback on end + * @callback Mark~wrapMatchesAcrossElementsEndCallback + */ + /** + * Wraps the instance element and class around matches across all HTML + * elements in all contexts + * @param {RegExp} regex - The regular expression to be searched for + * @param {number} ignoreGroups - A number indicating the amount of RegExp + * matching groups to ignore + * @param {Mark~wrapMatchesAcrossElementsFilterCallback} filterCb + * @param {Mark~wrapMatchesAcrossElementsEachCallback} eachCb + * @param {Mark~wrapMatchesAcrossElementsEndCallback} endCb + * @access protected + */ + wrapMatchesAcrossElements(regex, ignoreGroups, filterCb, eachCb, endCb) { + const matchIdx = ignoreGroups === 0 ? 0 : ignoreGroups + 1; + this.getTextNodes((dict) => { + let match; + while ((match = regex.exec(dict.value)) !== null && match[matchIdx] !== "") { + let start = match.index; + if (matchIdx !== 0) { + for (let i = 1; i < matchIdx; i++) { + start += match[i].length; + } + } + const end = start + match[matchIdx].length; + this.wrapRangeInMappedTextNode(dict, start, end, (node) => { + return filterCb(match[matchIdx], node); + }, (node, lastIndex) => { + regex.lastIndex = lastIndex; + eachCb(node); + }); + } + endCb(); + }); + } + /** + * Callback for each wrapped element + * @callback Mark~wrapRangeFromIndexEachCallback + * @param {HTMLElement} element - The marked DOM element + * @param {Mark~rangeObject} range - the current range object; provided + * start and length values will be numeric integers modified from the + * provided original ranges. + */ + /** + * Filter callback before each wrapping + * @callback Mark~wrapRangeFromIndexFilterCallback + * @param {HTMLElement} node - The text node which includes the range + * @param {Mark~rangeObject} range - the current range object + * @param {string} match - string extracted from the matching range + * @param {number} counter - A counter indicating the number of all marks + */ + /** + * Callback on end + * @callback Mark~wrapRangeFromIndexEndCallback + */ + /** + * Wraps the indicated ranges across all HTML elements in all contexts + * @param {Mark~setOfRanges} ranges + * @param {Mark~wrapRangeFromIndexFilterCallback} filterCb + * @param {Mark~wrapRangeFromIndexEachCallback} eachCb + * @param {Mark~wrapRangeFromIndexEndCallback} endCb + * @access protected + */ + wrapRangeFromIndex(ranges, filterCb, eachCb, endCb) { + this.getTextNodes((dict) => { + const originalLength = dict.value.length; + ranges.forEach((range, counter) => { + let { start, end, valid } = this.checkWhitespaceRanges( + range, + originalLength, + dict.value + ); + if (valid) { + this.wrapRangeInMappedTextNode(dict, start, end, (node) => { + return filterCb( + node, + range, + dict.value.substring(start, end), + counter + ); + }, (node) => { + eachCb(node, range); + }); + } + }); + endCb(); + }); + } + /** + * Unwraps the specified DOM node with its content (text nodes or HTML) + * without destroying possibly present events (using innerHTML) and + * normalizes the parent at the end (merge splitted text nodes) + * @param {HTMLElement} node - The DOM node to unwrap + * @access protected + */ + unwrapMatches(node) { + const parent = node.parentNode; + let docFrag = document.createDocumentFragment(); + while (node.firstChild) { + docFrag.appendChild(node.removeChild(node.firstChild)); + } + parent.replaceChild(docFrag, node); + if (!this.ie) { + parent.normalize(); + } else { + this.normalizeTextNode(parent); + } + } + /** + * Normalizes text nodes. It's a workaround for the native normalize method + * that has a bug in IE (see attached link). Should only be used in IE + * browsers as it's slower than the native method. + * @see {@link http://tinyurl.com/z5asa8c} + * @param {HTMLElement} node - The DOM node to normalize + * @access protected + */ + normalizeTextNode(node) { + if (!node) { + return; + } + if (node.nodeType === 3) { + while (node.nextSibling && node.nextSibling.nodeType === 3) { + node.nodeValue += node.nextSibling.nodeValue; + node.parentNode.removeChild(node.nextSibling); + } + } else { + this.normalizeTextNode(node.firstChild); + } + this.normalizeTextNode(node.nextSibling); + } + /** + * Callback when finished + * @callback Mark~commonDoneCallback + * @param {number} totalMatches - The number of marked elements + */ + /** + * @typedef Mark~commonOptions + * @type {object.} + * @property {string} [element="mark"] - HTML element tag name + * @property {string} [className] - An optional class name + * @property {string[]} [exclude] - An array with exclusion selectors. + * Elements matching those selectors will be ignored + * @property {boolean} [iframes=false] - Whether to search inside iframes + * @property {Mark~commonDoneCallback} [done] + * @property {boolean} [debug=false] - Wheter to log messages + * @property {object} [log=window.console] - Where to log messages (only if + * debug is true) + */ + /** + * Callback for each marked element + * @callback Mark~markRegExpEachCallback + * @param {HTMLElement} element - The marked DOM element + */ + /** + * Callback if there were no matches + * @callback Mark~markRegExpNoMatchCallback + * @param {RegExp} regexp - The regular expression + */ + /** + * Callback to filter matches + * @callback Mark~markRegExpFilterCallback + * @param {HTMLElement} textNode - The text node which includes the match + * @param {string} match - The matching string for the RegExp + * @param {number} counter - A counter indicating the number of all marks + */ + /** + * These options also include the common options from + * {@link Mark~commonOptions} + * @typedef Mark~markRegExpOptions + * @type {object.} + * @property {Mark~markRegExpEachCallback} [each] + * @property {Mark~markRegExpNoMatchCallback} [noMatch] + * @property {Mark~markRegExpFilterCallback} [filter] + */ + /** + * Marks a custom regular expression + * @param {RegExp} regexp - The regular expression + * @param {Mark~markRegExpOptions} [opt] - Optional options object + * @access public + */ + markRegExp(regexp, opt) { + this.opt = opt; + this.log(`Searching with expression "${regexp}"`); + let totalMatches = 0, fn = "wrapMatches"; + const eachCb = (element) => { + totalMatches++; + this.opt.each(element); + }; + if (this.opt.acrossElements) { + fn = "wrapMatchesAcrossElements"; + } + this[fn](regexp, this.opt.ignoreGroups, (match, node) => { + return this.opt.filter(node, match, totalMatches); + }, eachCb, () => { + if (totalMatches === 0) { + this.opt.noMatch(regexp); + } + this.opt.done(totalMatches); + }); + } + /** + * Callback for each marked element + * @callback Mark~markEachCallback + * @param {HTMLElement} element - The marked DOM element + */ + /** + * Callback if there were no matches + * @callback Mark~markNoMatchCallback + * @param {RegExp} term - The search term that was not found + */ + /** + * Callback to filter matches + * @callback Mark~markFilterCallback + * @param {HTMLElement} textNode - The text node which includes the match + * @param {string} match - The matching term + * @param {number} totalCounter - A counter indicating the number of all + * marks + * @param {number} termCounter - A counter indicating the number of marks + * for the specific match + */ + /** + * @typedef Mark~markAccuracyObject + * @type {object.} + * @property {string} value - A accuracy string value + * @property {string[]} limiters - A custom array of limiters. For example + * ["-", ","] + */ + /** + * @typedef Mark~markAccuracySetting + * @type {string} + * @property {"partially"|"complementary"|"exactly"|Mark~markAccuracyObject} + * [accuracy="partially"] - Either one of the following string values: + *
      + *
    • partially: When searching for "lor" only "lor" inside + * "lorem" will be marked
    • + *
    • complementary: When searching for "lor" the whole word + * "lorem" will be marked
    • + *
    • exactly: When searching for "lor" only those exact words + * will be marked. In this example nothing inside "lorem". This value + * is equivalent to the previous option wordBoundary
    • + *
    + * Or an object containing two properties: + *
      + *
    • value: One of the above named string values
    • + *
    • limiters: A custom array of string limiters for accuracy + * "exactly" or "complementary"
    • + *
    + */ + /** + * @typedef Mark~markWildcardsSetting + * @type {string} + * @property {"disabled"|"enabled"|"withSpaces"} + * [wildcards="disabled"] - Set to any of the following string values: + *
      + *
    • disabled: Disable wildcard usage
    • + *
    • enabled: When searching for "lor?m", the "?" will match zero + * or one non-space character (e.g. "lorm", "loram", "lor3m", etc). When + * searching for "lor*m", the "*" will match zero or more non-space + * characters (e.g. "lorm", "loram", "lor123m", etc).
    • + *
    • withSpaces: When searching for "lor?m", the "?" will + * match zero or one space or non-space character (e.g. "lor m", "loram", + * etc). When searching for "lor*m", the "*" will match zero or more space + * or non-space characters (e.g. "lorm", "lore et dolor ipsum", "lor: m", + * etc).
    • + *
    + */ + /** + * @typedef Mark~markIgnorePunctuationSetting + * @type {string[]} + * @property {string} The strings in this setting will contain punctuation + * marks that will be ignored: + *
      + *
    • These punctuation marks can be between any characters, e.g. setting + * this option to ["'"] would match "Worlds", "World's" and + * "Wo'rlds"
    • + *
    • One or more apostrophes between the letters would still produce a + * match (e.g. "W'o''r'l'd's").
    • + *
    • A typical setting for this option could be as follows: + *
      ignorePunctuation: ":;.,-–—‒_(){}[]!'\"+=".split(""),
      This + * setting includes common punctuation as well as a minus, en-dash, + * em-dash and figure-dash + * ({@link https://en.wikipedia.org/wiki/Dash#Figure_dash ref}), as well + * as an underscore.
    • + *
    + */ + /** + * These options also include the common options from + * {@link Mark~commonOptions} + * @typedef Mark~markOptions + * @type {object.} + * @property {boolean} [separateWordSearch=true] - Whether to search for + * each word separated by a blank instead of the complete term + * @property {boolean} [diacritics=true] - If diacritic characters should be + * matched. ({@link https://en.wikipedia.org/wiki/Diacritic Diacritics}) + * @property {object} [synonyms] - An object with synonyms. The key will be + * a synonym for the value and the value for the key + * @property {Mark~markAccuracySetting} [accuracy] + * @property {Mark~markWildcardsSetting} [wildcards] + * @property {boolean} [acrossElements=false] - Whether to find matches + * across HTML elements. By default, only matches within single HTML + * elements will be found + * @property {boolean} [ignoreJoiners=false] - Whether to ignore word + * joiners inside of key words. These include soft-hyphens, zero-width + * space, zero-width non-joiners and zero-width joiners. + * @property {Mark~markIgnorePunctuationSetting} [ignorePunctuation] + * @property {Mark~markEachCallback} [each] + * @property {Mark~markNoMatchCallback} [noMatch] + * @property {Mark~markFilterCallback} [filter] + */ + /** + * Marks the specified search terms + * @param {string|string[]} [sv] - Search value, either a search string or + * an array containing multiple search strings + * @param {Mark~markOptions} [opt] - Optional options object + * @access public + */ + mark(sv, opt) { + this.opt = opt; + let totalMatches = 0, fn = "wrapMatches"; + const { + keywords: kwArr, + length: kwArrLen + } = this.getSeparatedKeywords(typeof sv === "string" ? [sv] : sv), sens = this.opt.caseSensitive ? "" : "i", handler = (kw) => { + let regex = new RegExp(this.createRegExp(kw), `gm${sens}`), matches2 = 0; + this.log(`Searching with expression "${regex}"`); + this[fn](regex, 1, (term, node) => { + return this.opt.filter(node, kw, totalMatches, matches2); + }, (element) => { + matches2++; + totalMatches++; + this.opt.each(element); + }, () => { + if (matches2 === 0) { + this.opt.noMatch(kw); + } + if (kwArr[kwArrLen - 1] === kw) { + this.opt.done(totalMatches); + } else { + handler(kwArr[kwArr.indexOf(kw) + 1]); + } + }); + }; + if (this.opt.acrossElements) { + fn = "wrapMatchesAcrossElements"; + } + if (kwArrLen === 0) { + this.opt.done(totalMatches); + } else { + handler(kwArr[0]); + } + } + /** + * Callback for each marked element + * @callback Mark~markRangesEachCallback + * @param {HTMLElement} element - The marked DOM element + * @param {array} range - array of range start and end points + */ + /** + * Callback if a processed range is invalid, out-of-bounds, overlaps another + * range, or only matches whitespace + * @callback Mark~markRangesNoMatchCallback + * @param {Mark~rangeObject} range - a range object + */ + /** + * Callback to filter matches + * @callback Mark~markRangesFilterCallback + * @param {HTMLElement} node - The text node which includes the range + * @param {array} range - array of range start and end points + * @param {string} match - string extracted from the matching range + * @param {number} counter - A counter indicating the number of all marks + */ + /** + * These options also include the common options from + * {@link Mark~commonOptions} + * @typedef Mark~markRangesOptions + * @type {object.} + * @property {Mark~markRangesEachCallback} [each] + * @property {Mark~markRangesNoMatchCallback} [noMatch] + * @property {Mark~markRangesFilterCallback} [filter] + */ + /** + * Marks an array of objects containing a start with an end or length of the + * string to mark + * @param {Mark~setOfRanges} rawRanges - The original (preprocessed) + * array of objects + * @param {Mark~markRangesOptions} [opt] - Optional options object + * @access public + */ + markRanges(rawRanges, opt) { + this.opt = opt; + let totalMatches = 0, ranges = this.checkRanges(rawRanges); + if (ranges && ranges.length) { + this.log( + "Starting to mark with the following ranges: " + JSON.stringify(ranges) + ); + this.wrapRangeFromIndex( + ranges, + (node, range, match, counter) => { + return this.opt.filter(node, range, match, counter); + }, + (element, range) => { + totalMatches++; + this.opt.each(element, range); + }, + () => { + this.opt.done(totalMatches); + } + ); + } else { + this.opt.done(totalMatches); + } + } + /** + * Removes all marked elements inside the context with their HTML and + * normalizes the parent at the end + * @param {Mark~commonOptions} [opt] - Optional options object + * @access public + */ + unmark(opt) { + this.opt = opt; + let sel = this.opt.element ? this.opt.element : "*"; + sel += "[data-markjs]"; + if (this.opt.className) { + sel += `.${this.opt.className}`; + } + this.log(`Removal selector "${sel}"`); + this.iterator.forEachNode(NodeFilter.SHOW_ELEMENT, (node) => { + this.unwrapMatches(node); + }, (node) => { + const matchesSel = DOMIterator.matches(node, sel), matchesExclude = this.matchesExclude(node); + if (!matchesSel || matchesExclude) { + return NodeFilter.FILTER_REJECT; + } else { + return NodeFilter.FILTER_ACCEPT; + } + }, this.opt.done); + } +}; +function Mark2(ctx) { + const instance = new Mark$1(ctx); + this.mark = (sv, opt) => { + instance.mark(sv, opt); + return this; + }; + this.markRegExp = (sv, opt) => { + instance.markRegExp(sv, opt); + return this; + }; + this.markRanges = (sv, opt) => { + instance.markRanges(sv, opt); + return this; + }; + this.unmark = (opt) => { + instance.unmark(opt); + return this; + }; + return this; +} +const ENTRIES = "ENTRIES"; +const KEYS = "KEYS"; +const VALUES = "VALUES"; +const LEAF = ""; +class TreeIterator { + constructor(set, type) { + const node = set._tree; + const keys = Array.from(node.keys()); + this.set = set; + this._type = type; + this._path = keys.length > 0 ? [{ node, keys }] : []; + } + next() { + const value = this.dive(); + this.backtrack(); + return value; + } + dive() { + if (this._path.length === 0) { + return { done: true, value: void 0 }; + } + const { node, keys } = last$1(this._path); + if (last$1(keys) === LEAF) { + return { done: false, value: this.result() }; + } + const child = node.get(last$1(keys)); + this._path.push({ node: child, keys: Array.from(child.keys()) }); + return this.dive(); + } + backtrack() { + if (this._path.length === 0) { + return; + } + const keys = last$1(this._path).keys; + keys.pop(); + if (keys.length > 0) { + return; + } + this._path.pop(); + this.backtrack(); + } + key() { + return this.set._prefix + this._path.map(({ keys }) => last$1(keys)).filter((key) => key !== LEAF).join(""); + } + value() { + return last$1(this._path).node.get(LEAF); + } + result() { + switch (this._type) { + case VALUES: + return this.value(); + case KEYS: + return this.key(); + default: + return [this.key(), this.value()]; + } + } + [Symbol.iterator]() { + return this; + } +} +const last$1 = (array) => { + return array[array.length - 1]; +}; +const fuzzySearch = (node, query, maxDistance) => { + const results = /* @__PURE__ */ new Map(); + if (query === void 0) + return results; + const n = query.length + 1; + const m = n + maxDistance; + const matrix = new Uint8Array(m * n).fill(maxDistance + 1); + for (let j = 0; j < n; ++j) + matrix[j] = j; + for (let i = 1; i < m; ++i) + matrix[i * n] = i; + recurse(node, query, maxDistance, results, matrix, 1, n, ""); + return results; +}; +const recurse = (node, query, maxDistance, results, matrix, m, n, prefix) => { + const offset = m * n; + key: for (const key of node.keys()) { + if (key === LEAF) { + const distance = matrix[offset - 1]; + if (distance <= maxDistance) { + results.set(prefix, [node.get(key), distance]); + } + } else { + let i = m; + for (let pos = 0; pos < key.length; ++pos, ++i) { + const char = key[pos]; + const thisRowOffset = n * i; + const prevRowOffset = thisRowOffset - n; + let minDistance = matrix[thisRowOffset]; + const jmin = Math.max(0, i - maxDistance - 1); + const jmax = Math.min(n - 1, i + maxDistance); + for (let j = jmin; j < jmax; ++j) { + const different = char !== query[j]; + const rpl = matrix[prevRowOffset + j] + +different; + const del = matrix[prevRowOffset + j + 1] + 1; + const ins = matrix[thisRowOffset + j] + 1; + const dist = matrix[thisRowOffset + j + 1] = Math.min(rpl, del, ins); + if (dist < minDistance) + minDistance = dist; + } + if (minDistance > maxDistance) { + continue key; + } + } + recurse(node.get(key), query, maxDistance, results, matrix, i, n, prefix + key); + } + } +}; +class SearchableMap { + /** + * The constructor is normally called without arguments, creating an empty + * map. In order to create a {@link SearchableMap} from an iterable or from an + * object, check {@link SearchableMap.from} and {@link + * SearchableMap.fromObject}. + * + * The constructor arguments are for internal use, when creating derived + * mutable views of a map at a prefix. + */ + constructor(tree = /* @__PURE__ */ new Map(), prefix = "") { + this._size = void 0; + this._tree = tree; + this._prefix = prefix; + } + /** + * Creates and returns a mutable view of this {@link SearchableMap}, + * containing only entries that share the given prefix. + * + * ### Usage: + * + * ```javascript + * let map = new SearchableMap() + * map.set("unicorn", 1) + * map.set("universe", 2) + * map.set("university", 3) + * map.set("unique", 4) + * map.set("hello", 5) + * + * let uni = map.atPrefix("uni") + * uni.get("unique") // => 4 + * uni.get("unicorn") // => 1 + * uni.get("hello") // => undefined + * + * let univer = map.atPrefix("univer") + * univer.get("unique") // => undefined + * univer.get("universe") // => 2 + * univer.get("university") // => 3 + * ``` + * + * @param prefix The prefix + * @return A {@link SearchableMap} representing a mutable view of the original + * Map at the given prefix + */ + atPrefix(prefix) { + if (!prefix.startsWith(this._prefix)) { + throw new Error("Mismatched prefix"); + } + const [node, path] = trackDown(this._tree, prefix.slice(this._prefix.length)); + if (node === void 0) { + const [parentNode, key] = last(path); + for (const k of parentNode.keys()) { + if (k !== LEAF && k.startsWith(key)) { + const node2 = /* @__PURE__ */ new Map(); + node2.set(k.slice(key.length), parentNode.get(k)); + return new SearchableMap(node2, prefix); + } + } + } + return new SearchableMap(node, prefix); + } + /** + * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map/clear + */ + clear() { + this._size = void 0; + this._tree.clear(); + } + /** + * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map/delete + * @param key Key to delete + */ + delete(key) { + this._size = void 0; + return remove(this._tree, key); + } + /** + * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map/entries + * @return An iterator iterating through `[key, value]` entries. + */ + entries() { + return new TreeIterator(this, ENTRIES); + } + /** + * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map/forEach + * @param fn Iteration function + */ + forEach(fn) { + for (const [key, value] of this) { + fn(key, value, this); + } + } + /** + * Returns a Map of all the entries that have a key within the given edit + * distance from the search key. The keys of the returned Map are the matching + * keys, while the values are two-element arrays where the first element is + * the value associated to the key, and the second is the edit distance of the + * key to the search key. + * + * ### Usage: + * + * ```javascript + * let map = new SearchableMap() + * map.set('hello', 'world') + * map.set('hell', 'yeah') + * map.set('ciao', 'mondo') + * + * // Get all entries that match the key 'hallo' with a maximum edit distance of 2 + * map.fuzzyGet('hallo', 2) + * // => Map(2) { 'hello' => ['world', 1], 'hell' => ['yeah', 2] } + * + * // In the example, the "hello" key has value "world" and edit distance of 1 + * // (change "e" to "a"), the key "hell" has value "yeah" and edit distance of 2 + * // (change "e" to "a", delete "o") + * ``` + * + * @param key The search key + * @param maxEditDistance The maximum edit distance (Levenshtein) + * @return A Map of the matching keys to their value and edit distance + */ + fuzzyGet(key, maxEditDistance) { + return fuzzySearch(this._tree, key, maxEditDistance); + } + /** + * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map/get + * @param key Key to get + * @return Value associated to the key, or `undefined` if the key is not + * found. + */ + get(key) { + const node = lookup(this._tree, key); + return node !== void 0 ? node.get(LEAF) : void 0; + } + /** + * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map/has + * @param key Key + * @return True if the key is in the map, false otherwise + */ + has(key) { + const node = lookup(this._tree, key); + return node !== void 0 && node.has(LEAF); + } + /** + * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map/keys + * @return An `Iterable` iterating through keys + */ + keys() { + return new TreeIterator(this, KEYS); + } + /** + * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map/set + * @param key Key to set + * @param value Value to associate to the key + * @return The {@link SearchableMap} itself, to allow chaining + */ + set(key, value) { + if (typeof key !== "string") { + throw new Error("key must be a string"); + } + this._size = void 0; + const node = createPath(this._tree, key); + node.set(LEAF, value); + return this; + } + /** + * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map/size + */ + get size() { + if (this._size) { + return this._size; + } + this._size = 0; + const iter = this.entries(); + while (!iter.next().done) + this._size += 1; + return this._size; + } + /** + * Updates the value at the given key using the provided function. The function + * is called with the current value at the key, and its return value is used as + * the new value to be set. + * + * ### Example: + * + * ```javascript + * // Increment the current value by one + * searchableMap.update('somekey', (currentValue) => currentValue == null ? 0 : currentValue + 1) + * ``` + * + * If the value at the given key is or will be an object, it might not require + * re-assignment. In that case it is better to use `fetch()`, because it is + * faster. + * + * @param key The key to update + * @param fn The function used to compute the new value from the current one + * @return The {@link SearchableMap} itself, to allow chaining + */ + update(key, fn) { + if (typeof key !== "string") { + throw new Error("key must be a string"); + } + this._size = void 0; + const node = createPath(this._tree, key); + node.set(LEAF, fn(node.get(LEAF))); + return this; + } + /** + * Fetches the value of the given key. If the value does not exist, calls the + * given function to create a new value, which is inserted at the given key + * and subsequently returned. + * + * ### Example: + * + * ```javascript + * const map = searchableMap.fetch('somekey', () => new Map()) + * map.set('foo', 'bar') + * ``` + * + * @param key The key to update + * @param initial A function that creates a new value if the key does not exist + * @return The existing or new value at the given key + */ + fetch(key, initial) { + if (typeof key !== "string") { + throw new Error("key must be a string"); + } + this._size = void 0; + const node = createPath(this._tree, key); + let value = node.get(LEAF); + if (value === void 0) { + node.set(LEAF, value = initial()); + } + return value; + } + /** + * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map/values + * @return An `Iterable` iterating through values. + */ + values() { + return new TreeIterator(this, VALUES); + } + /** + * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map/@@iterator + */ + [Symbol.iterator]() { + return this.entries(); + } + /** + * Creates a {@link SearchableMap} from an `Iterable` of entries + * + * @param entries Entries to be inserted in the {@link SearchableMap} + * @return A new {@link SearchableMap} with the given entries + */ + static from(entries) { + const tree = new SearchableMap(); + for (const [key, value] of entries) { + tree.set(key, value); + } + return tree; + } + /** + * Creates a {@link SearchableMap} from the iterable properties of a JavaScript object + * + * @param object Object of entries for the {@link SearchableMap} + * @return A new {@link SearchableMap} with the given entries + */ + static fromObject(object) { + return SearchableMap.from(Object.entries(object)); + } +} +const trackDown = (tree, key, path = []) => { + if (key.length === 0 || tree == null) { + return [tree, path]; + } + for (const k of tree.keys()) { + if (k !== LEAF && key.startsWith(k)) { + path.push([tree, k]); + return trackDown(tree.get(k), key.slice(k.length), path); + } + } + path.push([tree, key]); + return trackDown(void 0, "", path); +}; +const lookup = (tree, key) => { + if (key.length === 0 || tree == null) { + return tree; + } + for (const k of tree.keys()) { + if (k !== LEAF && key.startsWith(k)) { + return lookup(tree.get(k), key.slice(k.length)); + } + } +}; +const createPath = (node, key) => { + const keyLength = key.length; + outer: for (let pos = 0; node && pos < keyLength; ) { + for (const k of node.keys()) { + if (k !== LEAF && key[pos] === k[0]) { + const len = Math.min(keyLength - pos, k.length); + let offset = 1; + while (offset < len && key[pos + offset] === k[offset]) + ++offset; + const child2 = node.get(k); + if (offset === k.length) { + node = child2; + } else { + const intermediate = /* @__PURE__ */ new Map(); + intermediate.set(k.slice(offset), child2); + node.set(key.slice(pos, pos + offset), intermediate); + node.delete(k); + node = intermediate; + } + pos += offset; + continue outer; + } + } + const child = /* @__PURE__ */ new Map(); + node.set(key.slice(pos), child); + return child; + } + return node; +}; +const remove = (tree, key) => { + const [node, path] = trackDown(tree, key); + if (node === void 0) { + return; + } + node.delete(LEAF); + if (node.size === 0) { + cleanup(path); + } else if (node.size === 1) { + const [key2, value] = node.entries().next().value; + merge(path, key2, value); + } +}; +const cleanup = (path) => { + if (path.length === 0) { + return; + } + const [node, key] = last(path); + node.delete(key); + if (node.size === 0) { + cleanup(path.slice(0, -1)); + } else if (node.size === 1) { + const [key2, value] = node.entries().next().value; + if (key2 !== LEAF) { + merge(path.slice(0, -1), key2, value); + } + } +}; +const merge = (path, key, value) => { + if (path.length === 0) { + return; + } + const [node, nodeKey] = last(path); + node.set(nodeKey + key, value); + node.delete(nodeKey); +}; +const last = (array) => { + return array[array.length - 1]; +}; +const OR = "or"; +const AND = "and"; +const AND_NOT = "and_not"; +class MiniSearch { + /** + * @param options Configuration options + * + * ### Examples: + * + * ```javascript + * // Create a search engine that indexes the 'title' and 'text' fields of your + * // documents: + * const miniSearch = new MiniSearch({ fields: ['title', 'text'] }) + * ``` + * + * ### ID Field: + * + * ```javascript + * // Your documents are assumed to include a unique 'id' field, but if you want + * // to use a different field for document identification, you can set the + * // 'idField' option: + * const miniSearch = new MiniSearch({ idField: 'key', fields: ['title', 'text'] }) + * ``` + * + * ### Options and defaults: + * + * ```javascript + * // The full set of options (here with their default value) is: + * const miniSearch = new MiniSearch({ + * // idField: field that uniquely identifies a document + * idField: 'id', + * + * // extractField: function used to get the value of a field in a document. + * // By default, it assumes the document is a flat object with field names as + * // property keys and field values as string property values, but custom logic + * // can be implemented by setting this option to a custom extractor function. + * extractField: (document, fieldName) => document[fieldName], + * + * // tokenize: function used to split fields into individual terms. By + * // default, it is also used to tokenize search queries, unless a specific + * // `tokenize` search option is supplied. When tokenizing an indexed field, + * // the field name is passed as the second argument. + * tokenize: (string, _fieldName) => string.split(SPACE_OR_PUNCTUATION), + * + * // processTerm: function used to process each tokenized term before + * // indexing. It can be used for stemming and normalization. Return a falsy + * // value in order to discard a term. By default, it is also used to process + * // search queries, unless a specific `processTerm` option is supplied as a + * // search option. When processing a term from a indexed field, the field + * // name is passed as the second argument. + * processTerm: (term, _fieldName) => term.toLowerCase(), + * + * // searchOptions: default search options, see the `search` method for + * // details + * searchOptions: undefined, + * + * // fields: document fields to be indexed. Mandatory, but not set by default + * fields: undefined + * + * // storeFields: document fields to be stored and returned as part of the + * // search results. + * storeFields: [] + * }) + * ``` + */ + constructor(options) { + if ((options === null || options === void 0 ? void 0 : options.fields) == null) { + throw new Error('MiniSearch: option "fields" must be provided'); + } + const autoVacuum = options.autoVacuum == null || options.autoVacuum === true ? defaultAutoVacuumOptions : options.autoVacuum; + this._options = { + ...defaultOptions, + ...options, + autoVacuum, + searchOptions: { ...defaultSearchOptions, ...options.searchOptions || {} }, + autoSuggestOptions: { ...defaultAutoSuggestOptions, ...options.autoSuggestOptions || {} } + }; + this._index = new SearchableMap(); + this._documentCount = 0; + this._documentIds = /* @__PURE__ */ new Map(); + this._idToShortId = /* @__PURE__ */ new Map(); + this._fieldIds = {}; + this._fieldLength = /* @__PURE__ */ new Map(); + this._avgFieldLength = []; + this._nextId = 0; + this._storedFields = /* @__PURE__ */ new Map(); + this._dirtCount = 0; + this._currentVacuum = null; + this._enqueuedVacuum = null; + this._enqueuedVacuumConditions = defaultVacuumConditions; + this.addFields(this._options.fields); + } + /** + * Adds a document to the index + * + * @param document The document to be indexed + */ + add(document2) { + const { extractField, stringifyField, tokenize, processTerm, fields, idField } = this._options; + const id = extractField(document2, idField); + if (id == null) { + throw new Error(`MiniSearch: document does not have ID field "${idField}"`); + } + if (this._idToShortId.has(id)) { + throw new Error(`MiniSearch: duplicate ID ${id}`); + } + const shortDocumentId = this.addDocumentId(id); + this.saveStoredFields(shortDocumentId, document2); + for (const field of fields) { + const fieldValue = extractField(document2, field); + if (fieldValue == null) + continue; + const tokens = tokenize(stringifyField(fieldValue, field), field); + const fieldId = this._fieldIds[field]; + const uniqueTerms = new Set(tokens).size; + this.addFieldLength(shortDocumentId, fieldId, this._documentCount - 1, uniqueTerms); + for (const term of tokens) { + const processedTerm = processTerm(term, field); + if (Array.isArray(processedTerm)) { + for (const t of processedTerm) { + this.addTerm(fieldId, shortDocumentId, t); + } + } else if (processedTerm) { + this.addTerm(fieldId, shortDocumentId, processedTerm); + } + } + } + } + /** + * Adds all the given documents to the index + * + * @param documents An array of documents to be indexed + */ + addAll(documents) { + for (const document2 of documents) + this.add(document2); + } + /** + * Adds all the given documents to the index asynchronously. + * + * Returns a promise that resolves (to `undefined`) when the indexing is done. + * This method is useful when index many documents, to avoid blocking the main + * thread. The indexing is performed asynchronously and in chunks. + * + * @param documents An array of documents to be indexed + * @param options Configuration options + * @return A promise resolving to `undefined` when the indexing is done + */ + addAllAsync(documents, options = {}) { + const { chunkSize = 10 } = options; + const acc = { chunk: [], promise: Promise.resolve() }; + const { chunk, promise } = documents.reduce(({ chunk: chunk2, promise: promise2 }, document2, i) => { + chunk2.push(document2); + if ((i + 1) % chunkSize === 0) { + return { + chunk: [], + promise: promise2.then(() => new Promise((resolve) => setTimeout(resolve, 0))).then(() => this.addAll(chunk2)) + }; + } else { + return { chunk: chunk2, promise: promise2 }; + } + }, acc); + return promise.then(() => this.addAll(chunk)); + } + /** + * Removes the given document from the index. + * + * The document to remove must NOT have changed between indexing and removal, + * otherwise the index will be corrupted. + * + * This method requires passing the full document to be removed (not just the + * ID), and immediately removes the document from the inverted index, allowing + * memory to be released. A convenient alternative is {@link + * MiniSearch#discard}, which needs only the document ID, and has the same + * visible effect, but delays cleaning up the index until the next vacuuming. + * + * @param document The document to be removed + */ + remove(document2) { + const { tokenize, processTerm, extractField, stringifyField, fields, idField } = this._options; + const id = extractField(document2, idField); + if (id == null) { + throw new Error(`MiniSearch: document does not have ID field "${idField}"`); + } + const shortId = this._idToShortId.get(id); + if (shortId == null) { + throw new Error(`MiniSearch: cannot remove document with ID ${id}: it is not in the index`); + } + for (const field of fields) { + const fieldValue = extractField(document2, field); + if (fieldValue == null) + continue; + const tokens = tokenize(stringifyField(fieldValue, field), field); + const fieldId = this._fieldIds[field]; + const uniqueTerms = new Set(tokens).size; + this.removeFieldLength(shortId, fieldId, this._documentCount, uniqueTerms); + for (const term of tokens) { + const processedTerm = processTerm(term, field); + if (Array.isArray(processedTerm)) { + for (const t of processedTerm) { + this.removeTerm(fieldId, shortId, t); + } + } else if (processedTerm) { + this.removeTerm(fieldId, shortId, processedTerm); + } + } + } + this._storedFields.delete(shortId); + this._documentIds.delete(shortId); + this._idToShortId.delete(id); + this._fieldLength.delete(shortId); + this._documentCount -= 1; + } + /** + * Removes all the given documents from the index. If called with no arguments, + * it removes _all_ documents from the index. + * + * @param documents The documents to be removed. If this argument is omitted, + * all documents are removed. Note that, for removing all documents, it is + * more efficient to call this method with no arguments than to pass all + * documents. + */ + removeAll(documents) { + if (documents) { + for (const document2 of documents) + this.remove(document2); + } else if (arguments.length > 0) { + throw new Error("Expected documents to be present. Omit the argument to remove all documents."); + } else { + this._index = new SearchableMap(); + this._documentCount = 0; + this._documentIds = /* @__PURE__ */ new Map(); + this._idToShortId = /* @__PURE__ */ new Map(); + this._fieldLength = /* @__PURE__ */ new Map(); + this._avgFieldLength = []; + this._storedFields = /* @__PURE__ */ new Map(); + this._nextId = 0; + } + } + /** + * Discards the document with the given ID, so it won't appear in search results + * + * It has the same visible effect of {@link MiniSearch.remove} (both cause the + * document to stop appearing in searches), but a different effect on the + * internal data structures: + * + * - {@link MiniSearch#remove} requires passing the full document to be + * removed as argument, and removes it from the inverted index immediately. + * + * - {@link MiniSearch#discard} instead only needs the document ID, and + * works by marking the current version of the document as discarded, so it + * is immediately ignored by searches. This is faster and more convenient + * than {@link MiniSearch#remove}, but the index is not immediately + * modified. To take care of that, vacuuming is performed after a certain + * number of documents are discarded, cleaning up the index and allowing + * memory to be released. + * + * After discarding a document, it is possible to re-add a new version, and + * only the new version will appear in searches. In other words, discarding + * and re-adding a document works exactly like removing and re-adding it. The + * {@link MiniSearch.replace} method can also be used to replace a document + * with a new version. + * + * #### Details about vacuuming + * + * Repetite calls to this method would leave obsolete document references in + * the index, invisible to searches. Two mechanisms take care of cleaning up: + * clean up during search, and vacuuming. + * + * - Upon search, whenever a discarded ID is found (and ignored for the + * results), references to the discarded document are removed from the + * inverted index entries for the search terms. This ensures that subsequent + * searches for the same terms do not need to skip these obsolete references + * again. + * + * - In addition, vacuuming is performed automatically by default (see the + * `autoVacuum` field in {@link Options}) after a certain number of + * documents are discarded. Vacuuming traverses all terms in the index, + * cleaning up all references to discarded documents. Vacuuming can also be + * triggered manually by calling {@link MiniSearch#vacuum}. + * + * @param id The ID of the document to be discarded + */ + discard(id) { + const shortId = this._idToShortId.get(id); + if (shortId == null) { + throw new Error(`MiniSearch: cannot discard document with ID ${id}: it is not in the index`); + } + this._idToShortId.delete(id); + this._documentIds.delete(shortId); + this._storedFields.delete(shortId); + (this._fieldLength.get(shortId) || []).forEach((fieldLength, fieldId) => { + this.removeFieldLength(shortId, fieldId, this._documentCount, fieldLength); + }); + this._fieldLength.delete(shortId); + this._documentCount -= 1; + this._dirtCount += 1; + this.maybeAutoVacuum(); + } + maybeAutoVacuum() { + if (this._options.autoVacuum === false) { + return; + } + const { minDirtFactor, minDirtCount, batchSize, batchWait } = this._options.autoVacuum; + this.conditionalVacuum({ batchSize, batchWait }, { minDirtCount, minDirtFactor }); + } + /** + * Discards the documents with the given IDs, so they won't appear in search + * results + * + * It is equivalent to calling {@link MiniSearch#discard} for all the given + * IDs, but with the optimization of triggering at most one automatic + * vacuuming at the end. + * + * Note: to remove all documents from the index, it is faster and more + * convenient to call {@link MiniSearch.removeAll} with no argument, instead + * of passing all IDs to this method. + */ + discardAll(ids) { + const autoVacuum = this._options.autoVacuum; + try { + this._options.autoVacuum = false; + for (const id of ids) { + this.discard(id); + } + } finally { + this._options.autoVacuum = autoVacuum; + } + this.maybeAutoVacuum(); + } + /** + * It replaces an existing document with the given updated version + * + * It works by discarding the current version and adding the updated one, so + * it is functionally equivalent to calling {@link MiniSearch#discard} + * followed by {@link MiniSearch#add}. The ID of the updated document should + * be the same as the original one. + * + * Since it uses {@link MiniSearch#discard} internally, this method relies on + * vacuuming to clean up obsolete document references from the index, allowing + * memory to be released (see {@link MiniSearch#discard}). + * + * @param updatedDocument The updated document to replace the old version + * with + */ + replace(updatedDocument) { + const { idField, extractField } = this._options; + const id = extractField(updatedDocument, idField); + this.discard(id); + this.add(updatedDocument); + } + /** + * Triggers a manual vacuuming, cleaning up references to discarded documents + * from the inverted index + * + * Vacuuming is only useful for applications that use the {@link + * MiniSearch#discard} or {@link MiniSearch#replace} methods. + * + * By default, vacuuming is performed automatically when needed (controlled by + * the `autoVacuum` field in {@link Options}), so there is usually no need to + * call this method, unless one wants to make sure to perform vacuuming at a + * specific moment. + * + * Vacuuming traverses all terms in the inverted index in batches, and cleans + * up references to discarded documents from the posting list, allowing memory + * to be released. + * + * The method takes an optional object as argument with the following keys: + * + * - `batchSize`: the size of each batch (1000 by default) + * + * - `batchWait`: the number of milliseconds to wait between batches (10 by + * default) + * + * On large indexes, vacuuming could have a non-negligible cost: batching + * avoids blocking the thread for long, diluting this cost so that it is not + * negatively affecting the application. Nonetheless, this method should only + * be called when necessary, and relying on automatic vacuuming is usually + * better. + * + * It returns a promise that resolves (to undefined) when the clean up is + * completed. If vacuuming is already ongoing at the time this method is + * called, a new one is enqueued immediately after the ongoing one, and a + * corresponding promise is returned. However, no more than one vacuuming is + * enqueued on top of the ongoing one, even if this method is called more + * times (enqueuing multiple ones would be useless). + * + * @param options Configuration options for the batch size and delay. See + * {@link VacuumOptions}. + */ + vacuum(options = {}) { + return this.conditionalVacuum(options); + } + conditionalVacuum(options, conditions) { + if (this._currentVacuum) { + this._enqueuedVacuumConditions = this._enqueuedVacuumConditions && conditions; + if (this._enqueuedVacuum != null) { + return this._enqueuedVacuum; + } + this._enqueuedVacuum = this._currentVacuum.then(() => { + const conditions2 = this._enqueuedVacuumConditions; + this._enqueuedVacuumConditions = defaultVacuumConditions; + return this.performVacuuming(options, conditions2); + }); + return this._enqueuedVacuum; + } + if (this.vacuumConditionsMet(conditions) === false) { + return Promise.resolve(); + } + this._currentVacuum = this.performVacuuming(options); + return this._currentVacuum; + } + async performVacuuming(options, conditions) { + const initialDirtCount = this._dirtCount; + if (this.vacuumConditionsMet(conditions)) { + const batchSize = options.batchSize || defaultVacuumOptions.batchSize; + const batchWait = options.batchWait || defaultVacuumOptions.batchWait; + let i = 1; + for (const [term, fieldsData] of this._index) { + for (const [fieldId, fieldIndex] of fieldsData) { + for (const [shortId] of fieldIndex) { + if (this._documentIds.has(shortId)) { + continue; + } + if (fieldIndex.size <= 1) { + fieldsData.delete(fieldId); + } else { + fieldIndex.delete(shortId); + } + } + } + if (this._index.get(term).size === 0) { + this._index.delete(term); + } + if (i % batchSize === 0) { + await new Promise((resolve) => setTimeout(resolve, batchWait)); + } + i += 1; + } + this._dirtCount -= initialDirtCount; + } + await null; + this._currentVacuum = this._enqueuedVacuum; + this._enqueuedVacuum = null; + } + vacuumConditionsMet(conditions) { + if (conditions == null) { + return true; + } + let { minDirtCount, minDirtFactor } = conditions; + minDirtCount = minDirtCount || defaultAutoVacuumOptions.minDirtCount; + minDirtFactor = minDirtFactor || defaultAutoVacuumOptions.minDirtFactor; + return this.dirtCount >= minDirtCount && this.dirtFactor >= minDirtFactor; + } + /** + * Is `true` if a vacuuming operation is ongoing, `false` otherwise + */ + get isVacuuming() { + return this._currentVacuum != null; + } + /** + * The number of documents discarded since the most recent vacuuming + */ + get dirtCount() { + return this._dirtCount; + } + /** + * A number between 0 and 1 giving an indication about the proportion of + * documents that are discarded, and can therefore be cleaned up by vacuuming. + * A value close to 0 means that the index is relatively clean, while a higher + * value means that the index is relatively dirty, and vacuuming could release + * memory. + */ + get dirtFactor() { + return this._dirtCount / (1 + this._documentCount + this._dirtCount); + } + /** + * Returns `true` if a document with the given ID is present in the index and + * available for search, `false` otherwise + * + * @param id The document ID + */ + has(id) { + return this._idToShortId.has(id); + } + /** + * Returns the stored fields (as configured in the `storeFields` constructor + * option) for the given document ID. Returns `undefined` if the document is + * not present in the index. + * + * @param id The document ID + */ + getStoredFields(id) { + const shortId = this._idToShortId.get(id); + if (shortId == null) { + return void 0; + } + return this._storedFields.get(shortId); + } + /** + * Search for documents matching the given search query. + * + * The result is a list of scored document IDs matching the query, sorted by + * descending score, and each including data about which terms were matched and + * in which fields. + * + * ### Basic usage: + * + * ```javascript + * // Search for "zen art motorcycle" with default options: terms have to match + * // exactly, and individual terms are joined with OR + * miniSearch.search('zen art motorcycle') + * // => [ { id: 2, score: 2.77258, match: { ... } }, { id: 4, score: 1.38629, match: { ... } } ] + * ``` + * + * ### Restrict search to specific fields: + * + * ```javascript + * // Search only in the 'title' field + * miniSearch.search('zen', { fields: ['title'] }) + * ``` + * + * ### Field boosting: + * + * ```javascript + * // Boost a field + * miniSearch.search('zen', { boost: { title: 2 } }) + * ``` + * + * ### Prefix search: + * + * ```javascript + * // Search for "moto" with prefix search (it will match documents + * // containing terms that start with "moto" or "neuro") + * miniSearch.search('moto neuro', { prefix: true }) + * ``` + * + * ### Fuzzy search: + * + * ```javascript + * // Search for "ismael" with fuzzy search (it will match documents containing + * // terms similar to "ismael", with a maximum edit distance of 0.2 term.length + * // (rounded to nearest integer) + * miniSearch.search('ismael', { fuzzy: 0.2 }) + * ``` + * + * ### Combining strategies: + * + * ```javascript + * // Mix of exact match, prefix search, and fuzzy search + * miniSearch.search('ismael mob', { + * prefix: true, + * fuzzy: 0.2 + * }) + * ``` + * + * ### Advanced prefix and fuzzy search: + * + * ```javascript + * // Perform fuzzy and prefix search depending on the search term. Here + * // performing prefix and fuzzy search only on terms longer than 3 characters + * miniSearch.search('ismael mob', { + * prefix: term => term.length > 3 + * fuzzy: term => term.length > 3 ? 0.2 : null + * }) + * ``` + * + * ### Combine with AND: + * + * ```javascript + * // Combine search terms with AND (to match only documents that contain both + * // "motorcycle" and "art") + * miniSearch.search('motorcycle art', { combineWith: 'AND' }) + * ``` + * + * ### Combine with AND_NOT: + * + * There is also an AND_NOT combinator, that finds documents that match the + * first term, but do not match any of the other terms. This combinator is + * rarely useful with simple queries, and is meant to be used with advanced + * query combinations (see later for more details). + * + * ### Filtering results: + * + * ```javascript + * // Filter only results in the 'fiction' category (assuming that 'category' + * // is a stored field) + * miniSearch.search('motorcycle art', { + * filter: (result) => result.category === 'fiction' + * }) + * ``` + * + * ### Wildcard query + * + * Searching for an empty string (assuming the default tokenizer) returns no + * results. Sometimes though, one needs to match all documents, like in a + * "wildcard" search. This is possible by passing the special value + * {@link MiniSearch.wildcard} as the query: + * + * ```javascript + * // Return search results for all documents + * miniSearch.search(MiniSearch.wildcard) + * ``` + * + * Note that search options such as `filter` and `boostDocument` are still + * applied, influencing which results are returned, and their order: + * + * ```javascript + * // Return search results for all documents in the 'fiction' category + * miniSearch.search(MiniSearch.wildcard, { + * filter: (result) => result.category === 'fiction' + * }) + * ``` + * + * ### Advanced combination of queries: + * + * It is possible to combine different subqueries with OR, AND, and AND_NOT, + * and even with different search options, by passing a query expression + * tree object as the first argument, instead of a string. + * + * ```javascript + * // Search for documents that contain "zen" and ("motorcycle" or "archery") + * miniSearch.search({ + * combineWith: 'AND', + * queries: [ + * 'zen', + * { + * combineWith: 'OR', + * queries: ['motorcycle', 'archery'] + * } + * ] + * }) + * + * // Search for documents that contain ("apple" or "pear") but not "juice" and + * // not "tree" + * miniSearch.search({ + * combineWith: 'AND_NOT', + * queries: [ + * { + * combineWith: 'OR', + * queries: ['apple', 'pear'] + * }, + * 'juice', + * 'tree' + * ] + * }) + * ``` + * + * Each node in the expression tree can be either a string, or an object that + * supports all {@link SearchOptions} fields, plus a `queries` array field for + * subqueries. + * + * Note that, while this can become complicated to do by hand for complex or + * deeply nested queries, it provides a formalized expression tree API for + * external libraries that implement a parser for custom query languages. + * + * @param query Search query + * @param searchOptions Search options. Each option, if not given, defaults to the corresponding value of `searchOptions` given to the constructor, or to the library default. + */ + search(query, searchOptions = {}) { + const { searchOptions: globalSearchOptions } = this._options; + const searchOptionsWithDefaults = { ...globalSearchOptions, ...searchOptions }; + const rawResults = this.executeQuery(query, searchOptions); + const results = []; + for (const [docId, { score, terms, match }] of rawResults) { + const quality = terms.length || 1; + const result = { + id: this._documentIds.get(docId), + score: score * quality, + terms: Object.keys(match), + queryTerms: terms, + match + }; + Object.assign(result, this._storedFields.get(docId)); + if (searchOptionsWithDefaults.filter == null || searchOptionsWithDefaults.filter(result)) { + results.push(result); + } + } + if (query === MiniSearch.wildcard && searchOptionsWithDefaults.boostDocument == null) { + return results; + } + results.sort(byScore); + return results; + } + /** + * Provide suggestions for the given search query + * + * The result is a list of suggested modified search queries, derived from the + * given search query, each with a relevance score, sorted by descending score. + * + * By default, it uses the same options used for search, except that by + * default it performs prefix search on the last term of the query, and + * combine terms with `'AND'` (requiring all query terms to match). Custom + * options can be passed as a second argument. Defaults can be changed upon + * calling the {@link MiniSearch} constructor, by passing a + * `autoSuggestOptions` option. + * + * ### Basic usage: + * + * ```javascript + * // Get suggestions for 'neuro': + * miniSearch.autoSuggest('neuro') + * // => [ { suggestion: 'neuromancer', terms: [ 'neuromancer' ], score: 0.46240 } ] + * ``` + * + * ### Multiple words: + * + * ```javascript + * // Get suggestions for 'zen ar': + * miniSearch.autoSuggest('zen ar') + * // => [ + * // { suggestion: 'zen archery art', terms: [ 'zen', 'archery', 'art' ], score: 1.73332 }, + * // { suggestion: 'zen art', terms: [ 'zen', 'art' ], score: 1.21313 } + * // ] + * ``` + * + * ### Fuzzy suggestions: + * + * ```javascript + * // Correct spelling mistakes using fuzzy search: + * miniSearch.autoSuggest('neromancer', { fuzzy: 0.2 }) + * // => [ { suggestion: 'neuromancer', terms: [ 'neuromancer' ], score: 1.03998 } ] + * ``` + * + * ### Filtering: + * + * ```javascript + * // Get suggestions for 'zen ar', but only within the 'fiction' category + * // (assuming that 'category' is a stored field): + * miniSearch.autoSuggest('zen ar', { + * filter: (result) => result.category === 'fiction' + * }) + * // => [ + * // { suggestion: 'zen archery art', terms: [ 'zen', 'archery', 'art' ], score: 1.73332 }, + * // { suggestion: 'zen art', terms: [ 'zen', 'art' ], score: 1.21313 } + * // ] + * ``` + * + * @param queryString Query string to be expanded into suggestions + * @param options Search options. The supported options and default values + * are the same as for the {@link MiniSearch#search} method, except that by + * default prefix search is performed on the last term in the query, and terms + * are combined with `'AND'`. + * @return A sorted array of suggestions sorted by relevance score. + */ + autoSuggest(queryString, options = {}) { + options = { ...this._options.autoSuggestOptions, ...options }; + const suggestions = /* @__PURE__ */ new Map(); + for (const { score, terms } of this.search(queryString, options)) { + const phrase = terms.join(" "); + const suggestion = suggestions.get(phrase); + if (suggestion != null) { + suggestion.score += score; + suggestion.count += 1; + } else { + suggestions.set(phrase, { score, terms, count: 1 }); + } + } + const results = []; + for (const [suggestion, { score, terms, count }] of suggestions) { + results.push({ suggestion, terms, score: score / count }); + } + results.sort(byScore); + return results; + } + /** + * Total number of documents available to search + */ + get documentCount() { + return this._documentCount; + } + /** + * Number of terms in the index + */ + get termCount() { + return this._index.size; + } + /** + * Deserializes a JSON index (serialized with `JSON.stringify(miniSearch)`) + * and instantiates a MiniSearch instance. It should be given the same options + * originally used when serializing the index. + * + * ### Usage: + * + * ```javascript + * // If the index was serialized with: + * let miniSearch = new MiniSearch({ fields: ['title', 'text'] }) + * miniSearch.addAll(documents) + * + * const json = JSON.stringify(miniSearch) + * // It can later be deserialized like this: + * miniSearch = MiniSearch.loadJSON(json, { fields: ['title', 'text'] }) + * ``` + * + * @param json JSON-serialized index + * @param options configuration options, same as the constructor + * @return An instance of MiniSearch deserialized from the given JSON. + */ + static loadJSON(json, options) { + if (options == null) { + throw new Error("MiniSearch: loadJSON should be given the same options used when serializing the index"); + } + return this.loadJS(JSON.parse(json), options); + } + /** + * Async equivalent of {@link MiniSearch.loadJSON} + * + * This function is an alternative to {@link MiniSearch.loadJSON} that returns + * a promise, and loads the index in batches, leaving pauses between them to avoid + * blocking the main thread. It tends to be slower than the synchronous + * version, but does not block the main thread, so it can be a better choice + * when deserializing very large indexes. + * + * @param json JSON-serialized index + * @param options configuration options, same as the constructor + * @return A Promise that will resolve to an instance of MiniSearch deserialized from the given JSON. + */ + static async loadJSONAsync(json, options) { + if (options == null) { + throw new Error("MiniSearch: loadJSON should be given the same options used when serializing the index"); + } + return this.loadJSAsync(JSON.parse(json), options); + } + /** + * Returns the default value of an option. It will throw an error if no option + * with the given name exists. + * + * @param optionName Name of the option + * @return The default value of the given option + * + * ### Usage: + * + * ```javascript + * // Get default tokenizer + * MiniSearch.getDefault('tokenize') + * + * // Get default term processor + * MiniSearch.getDefault('processTerm') + * + * // Unknown options will throw an error + * MiniSearch.getDefault('notExisting') + * // => throws 'MiniSearch: unknown option "notExisting"' + * ``` + */ + static getDefault(optionName) { + if (defaultOptions.hasOwnProperty(optionName)) { + return getOwnProperty(defaultOptions, optionName); + } else { + throw new Error(`MiniSearch: unknown option "${optionName}"`); + } + } + /** + * @ignore + */ + static loadJS(js, options) { + const { index, documentIds, fieldLength, storedFields, serializationVersion } = js; + const miniSearch = this.instantiateMiniSearch(js, options); + miniSearch._documentIds = objectToNumericMap(documentIds); + miniSearch._fieldLength = objectToNumericMap(fieldLength); + miniSearch._storedFields = objectToNumericMap(storedFields); + for (const [shortId, id] of miniSearch._documentIds) { + miniSearch._idToShortId.set(id, shortId); + } + for (const [term, data] of index) { + const dataMap = /* @__PURE__ */ new Map(); + for (const fieldId of Object.keys(data)) { + let indexEntry = data[fieldId]; + if (serializationVersion === 1) { + indexEntry = indexEntry.ds; + } + dataMap.set(parseInt(fieldId, 10), objectToNumericMap(indexEntry)); + } + miniSearch._index.set(term, dataMap); + } + return miniSearch; + } + /** + * @ignore + */ + static async loadJSAsync(js, options) { + const { index, documentIds, fieldLength, storedFields, serializationVersion } = js; + const miniSearch = this.instantiateMiniSearch(js, options); + miniSearch._documentIds = await objectToNumericMapAsync(documentIds); + miniSearch._fieldLength = await objectToNumericMapAsync(fieldLength); + miniSearch._storedFields = await objectToNumericMapAsync(storedFields); + for (const [shortId, id] of miniSearch._documentIds) { + miniSearch._idToShortId.set(id, shortId); + } + let count = 0; + for (const [term, data] of index) { + const dataMap = /* @__PURE__ */ new Map(); + for (const fieldId of Object.keys(data)) { + let indexEntry = data[fieldId]; + if (serializationVersion === 1) { + indexEntry = indexEntry.ds; + } + dataMap.set(parseInt(fieldId, 10), await objectToNumericMapAsync(indexEntry)); + } + if (++count % 1e3 === 0) + await wait(0); + miniSearch._index.set(term, dataMap); + } + return miniSearch; + } + /** + * @ignore + */ + static instantiateMiniSearch(js, options) { + const { documentCount, nextId, fieldIds, averageFieldLength, dirtCount, serializationVersion } = js; + if (serializationVersion !== 1 && serializationVersion !== 2) { + throw new Error("MiniSearch: cannot deserialize an index created with an incompatible version"); + } + const miniSearch = new MiniSearch(options); + miniSearch._documentCount = documentCount; + miniSearch._nextId = nextId; + miniSearch._idToShortId = /* @__PURE__ */ new Map(); + miniSearch._fieldIds = fieldIds; + miniSearch._avgFieldLength = averageFieldLength; + miniSearch._dirtCount = dirtCount || 0; + miniSearch._index = new SearchableMap(); + return miniSearch; + } + /** + * @ignore + */ + executeQuery(query, searchOptions = {}) { + if (query === MiniSearch.wildcard) { + return this.executeWildcardQuery(searchOptions); + } + if (typeof query !== "string") { + const options2 = { ...searchOptions, ...query, queries: void 0 }; + const results2 = query.queries.map((subquery) => this.executeQuery(subquery, options2)); + return this.combineResults(results2, options2.combineWith); + } + const { tokenize, processTerm, searchOptions: globalSearchOptions } = this._options; + const options = { tokenize, processTerm, ...globalSearchOptions, ...searchOptions }; + const { tokenize: searchTokenize, processTerm: searchProcessTerm } = options; + const terms = searchTokenize(query).flatMap((term) => searchProcessTerm(term)).filter((term) => !!term); + const queries = terms.map(termToQuerySpec(options)); + const results = queries.map((query2) => this.executeQuerySpec(query2, options)); + return this.combineResults(results, options.combineWith); + } + /** + * @ignore + */ + executeQuerySpec(query, searchOptions) { + const options = { ...this._options.searchOptions, ...searchOptions }; + const boosts = (options.fields || this._options.fields).reduce((boosts2, field) => ({ ...boosts2, [field]: getOwnProperty(options.boost, field) || 1 }), {}); + const { boostDocument, weights, maxFuzzy, bm25: bm25params } = options; + const { fuzzy: fuzzyWeight, prefix: prefixWeight } = { ...defaultSearchOptions.weights, ...weights }; + const data = this._index.get(query.term); + const results = this.termResults(query.term, query.term, 1, query.termBoost, data, boosts, boostDocument, bm25params); + let prefixMatches; + let fuzzyMatches; + if (query.prefix) { + prefixMatches = this._index.atPrefix(query.term); + } + if (query.fuzzy) { + const fuzzy = query.fuzzy === true ? 0.2 : query.fuzzy; + const maxDistance = fuzzy < 1 ? Math.min(maxFuzzy, Math.round(query.term.length * fuzzy)) : fuzzy; + if (maxDistance) + fuzzyMatches = this._index.fuzzyGet(query.term, maxDistance); + } + if (prefixMatches) { + for (const [term, data2] of prefixMatches) { + const distance = term.length - query.term.length; + if (!distance) { + continue; + } + fuzzyMatches === null || fuzzyMatches === void 0 ? void 0 : fuzzyMatches.delete(term); + const weight = prefixWeight * term.length / (term.length + 0.3 * distance); + this.termResults(query.term, term, weight, query.termBoost, data2, boosts, boostDocument, bm25params, results); + } + } + if (fuzzyMatches) { + for (const term of fuzzyMatches.keys()) { + const [data2, distance] = fuzzyMatches.get(term); + if (!distance) { + continue; + } + const weight = fuzzyWeight * term.length / (term.length + distance); + this.termResults(query.term, term, weight, query.termBoost, data2, boosts, boostDocument, bm25params, results); + } + } + return results; + } + /** + * @ignore + */ + executeWildcardQuery(searchOptions) { + const results = /* @__PURE__ */ new Map(); + const options = { ...this._options.searchOptions, ...searchOptions }; + for (const [shortId, id] of this._documentIds) { + const score = options.boostDocument ? options.boostDocument(id, "", this._storedFields.get(shortId)) : 1; + results.set(shortId, { + score, + terms: [], + match: {} + }); + } + return results; + } + /** + * @ignore + */ + combineResults(results, combineWith = OR) { + if (results.length === 0) { + return /* @__PURE__ */ new Map(); + } + const operator = combineWith.toLowerCase(); + const combinator = combinators[operator]; + if (!combinator) { + throw new Error(`Invalid combination operator: ${combineWith}`); + } + return results.reduce(combinator) || /* @__PURE__ */ new Map(); + } + /** + * Allows serialization of the index to JSON, to possibly store it and later + * deserialize it with {@link MiniSearch.loadJSON}. + * + * Normally one does not directly call this method, but rather call the + * standard JavaScript `JSON.stringify()` passing the {@link MiniSearch} + * instance, and JavaScript will internally call this method. Upon + * deserialization, one must pass to {@link MiniSearch.loadJSON} the same + * options used to create the original instance that was serialized. + * + * ### Usage: + * + * ```javascript + * // Serialize the index: + * let miniSearch = new MiniSearch({ fields: ['title', 'text'] }) + * miniSearch.addAll(documents) + * const json = JSON.stringify(miniSearch) + * + * // Later, to deserialize it: + * miniSearch = MiniSearch.loadJSON(json, { fields: ['title', 'text'] }) + * ``` + * + * @return A plain-object serializable representation of the search index. + */ + toJSON() { + const index = []; + for (const [term, fieldIndex] of this._index) { + const data = {}; + for (const [fieldId, freqs] of fieldIndex) { + data[fieldId] = Object.fromEntries(freqs); + } + index.push([term, data]); + } + return { + documentCount: this._documentCount, + nextId: this._nextId, + documentIds: Object.fromEntries(this._documentIds), + fieldIds: this._fieldIds, + fieldLength: Object.fromEntries(this._fieldLength), + averageFieldLength: this._avgFieldLength, + storedFields: Object.fromEntries(this._storedFields), + dirtCount: this._dirtCount, + index, + serializationVersion: 2 + }; + } + /** + * @ignore + */ + termResults(sourceTerm, derivedTerm, termWeight, termBoost, fieldTermData, fieldBoosts, boostDocumentFn, bm25params, results = /* @__PURE__ */ new Map()) { + if (fieldTermData == null) + return results; + for (const field of Object.keys(fieldBoosts)) { + const fieldBoost = fieldBoosts[field]; + const fieldId = this._fieldIds[field]; + const fieldTermFreqs = fieldTermData.get(fieldId); + if (fieldTermFreqs == null) + continue; + let matchingFields = fieldTermFreqs.size; + const avgFieldLength = this._avgFieldLength[fieldId]; + for (const docId of fieldTermFreqs.keys()) { + if (!this._documentIds.has(docId)) { + this.removeTerm(fieldId, docId, derivedTerm); + matchingFields -= 1; + continue; + } + const docBoost = boostDocumentFn ? boostDocumentFn(this._documentIds.get(docId), derivedTerm, this._storedFields.get(docId)) : 1; + if (!docBoost) + continue; + const termFreq = fieldTermFreqs.get(docId); + const fieldLength = this._fieldLength.get(docId)[fieldId]; + const rawScore = calcBM25Score(termFreq, matchingFields, this._documentCount, fieldLength, avgFieldLength, bm25params); + const weightedScore = termWeight * termBoost * fieldBoost * docBoost * rawScore; + const result = results.get(docId); + if (result) { + result.score += weightedScore; + assignUniqueTerm(result.terms, sourceTerm); + const match = getOwnProperty(result.match, derivedTerm); + if (match) { + match.push(field); + } else { + result.match[derivedTerm] = [field]; + } + } else { + results.set(docId, { + score: weightedScore, + terms: [sourceTerm], + match: { [derivedTerm]: [field] } + }); + } + } + } + return results; + } + /** + * @ignore + */ + addTerm(fieldId, documentId, term) { + const indexData = this._index.fetch(term, createMap); + let fieldIndex = indexData.get(fieldId); + if (fieldIndex == null) { + fieldIndex = /* @__PURE__ */ new Map(); + fieldIndex.set(documentId, 1); + indexData.set(fieldId, fieldIndex); + } else { + const docs = fieldIndex.get(documentId); + fieldIndex.set(documentId, (docs || 0) + 1); + } + } + /** + * @ignore + */ + removeTerm(fieldId, documentId, term) { + if (!this._index.has(term)) { + this.warnDocumentChanged(documentId, fieldId, term); + return; + } + const indexData = this._index.fetch(term, createMap); + const fieldIndex = indexData.get(fieldId); + if (fieldIndex == null || fieldIndex.get(documentId) == null) { + this.warnDocumentChanged(documentId, fieldId, term); + } else if (fieldIndex.get(documentId) <= 1) { + if (fieldIndex.size <= 1) { + indexData.delete(fieldId); + } else { + fieldIndex.delete(documentId); + } + } else { + fieldIndex.set(documentId, fieldIndex.get(documentId) - 1); + } + if (this._index.get(term).size === 0) { + this._index.delete(term); + } + } + /** + * @ignore + */ + warnDocumentChanged(shortDocumentId, fieldId, term) { + for (const fieldName of Object.keys(this._fieldIds)) { + if (this._fieldIds[fieldName] === fieldId) { + this._options.logger("warn", `MiniSearch: document with ID ${this._documentIds.get(shortDocumentId)} has changed before removal: term "${term}" was not present in field "${fieldName}". Removing a document after it has changed can corrupt the index!`, "version_conflict"); + return; + } + } + } + /** + * @ignore + */ + addDocumentId(documentId) { + const shortDocumentId = this._nextId; + this._idToShortId.set(documentId, shortDocumentId); + this._documentIds.set(shortDocumentId, documentId); + this._documentCount += 1; + this._nextId += 1; + return shortDocumentId; + } + /** + * @ignore + */ + addFields(fields) { + for (let i = 0; i < fields.length; i++) { + this._fieldIds[fields[i]] = i; + } + } + /** + * @ignore + */ + addFieldLength(documentId, fieldId, count, length) { + let fieldLengths = this._fieldLength.get(documentId); + if (fieldLengths == null) + this._fieldLength.set(documentId, fieldLengths = []); + fieldLengths[fieldId] = length; + const averageFieldLength = this._avgFieldLength[fieldId] || 0; + const totalFieldLength = averageFieldLength * count + length; + this._avgFieldLength[fieldId] = totalFieldLength / (count + 1); + } + /** + * @ignore + */ + removeFieldLength(documentId, fieldId, count, length) { + if (count === 1) { + this._avgFieldLength[fieldId] = 0; + return; + } + const totalFieldLength = this._avgFieldLength[fieldId] * count - length; + this._avgFieldLength[fieldId] = totalFieldLength / (count - 1); + } + /** + * @ignore + */ + saveStoredFields(documentId, doc) { + const { storeFields, extractField } = this._options; + if (storeFields == null || storeFields.length === 0) { + return; + } + let documentFields = this._storedFields.get(documentId); + if (documentFields == null) + this._storedFields.set(documentId, documentFields = {}); + for (const fieldName of storeFields) { + const fieldValue = extractField(doc, fieldName); + if (fieldValue !== void 0) + documentFields[fieldName] = fieldValue; + } + } +} +MiniSearch.wildcard = Symbol("*"); +const getOwnProperty = (object, property) => Object.prototype.hasOwnProperty.call(object, property) ? object[property] : void 0; +const combinators = { + [OR]: (a, b) => { + for (const docId of b.keys()) { + const existing = a.get(docId); + if (existing == null) { + a.set(docId, b.get(docId)); + } else { + const { score, terms, match } = b.get(docId); + existing.score = existing.score + score; + existing.match = Object.assign(existing.match, match); + assignUniqueTerms(existing.terms, terms); + } + } + return a; + }, + [AND]: (a, b) => { + const combined = /* @__PURE__ */ new Map(); + for (const docId of b.keys()) { + const existing = a.get(docId); + if (existing == null) + continue; + const { score, terms, match } = b.get(docId); + assignUniqueTerms(existing.terms, terms); + combined.set(docId, { + score: existing.score + score, + terms: existing.terms, + match: Object.assign(existing.match, match) + }); + } + return combined; + }, + [AND_NOT]: (a, b) => { + for (const docId of b.keys()) + a.delete(docId); + return a; + } +}; +const defaultBM25params = { k: 1.2, b: 0.7, d: 0.5 }; +const calcBM25Score = (termFreq, matchingCount, totalCount, fieldLength, avgFieldLength, bm25params) => { + const { k, b, d } = bm25params; + const invDocFreq = Math.log(1 + (totalCount - matchingCount + 0.5) / (matchingCount + 0.5)); + return invDocFreq * (d + termFreq * (k + 1) / (termFreq + k * (1 - b + b * fieldLength / avgFieldLength))); +}; +const termToQuerySpec = (options) => (term, i, terms) => { + const fuzzy = typeof options.fuzzy === "function" ? options.fuzzy(term, i, terms) : options.fuzzy || false; + const prefix = typeof options.prefix === "function" ? options.prefix(term, i, terms) : options.prefix === true; + const termBoost = typeof options.boostTerm === "function" ? options.boostTerm(term, i, terms) : 1; + return { term, fuzzy, prefix, termBoost }; +}; +const defaultOptions = { + idField: "id", + extractField: (document2, fieldName) => document2[fieldName], + stringifyField: (fieldValue, fieldName) => fieldValue.toString(), + tokenize: (text) => text.split(SPACE_OR_PUNCTUATION), + processTerm: (term) => term.toLowerCase(), + fields: void 0, + searchOptions: void 0, + storeFields: [], + logger: (level, message) => { + if (typeof (console === null || console === void 0 ? void 0 : console[level]) === "function") + console[level](message); + }, + autoVacuum: true +}; +const defaultSearchOptions = { + combineWith: OR, + prefix: false, + fuzzy: false, + maxFuzzy: 6, + boost: {}, + weights: { fuzzy: 0.45, prefix: 0.375 }, + bm25: defaultBM25params +}; +const defaultAutoSuggestOptions = { + combineWith: AND, + prefix: (term, i, terms) => i === terms.length - 1 +}; +const defaultVacuumOptions = { batchSize: 1e3, batchWait: 10 }; +const defaultVacuumConditions = { minDirtFactor: 0.1, minDirtCount: 20 }; +const defaultAutoVacuumOptions = { ...defaultVacuumOptions, ...defaultVacuumConditions }; +const assignUniqueTerm = (target, term) => { + if (!target.includes(term)) + target.push(term); +}; +const assignUniqueTerms = (target, source) => { + for (const term of source) { + if (!target.includes(term)) + target.push(term); + } +}; +const byScore = ({ score: a }, { score: b }) => b - a; +const createMap = () => /* @__PURE__ */ new Map(); +const objectToNumericMap = (object) => { + const map = /* @__PURE__ */ new Map(); + for (const key of Object.keys(object)) { + map.set(parseInt(key, 10), object[key]); + } + return map; +}; +const objectToNumericMapAsync = async (object) => { + const map = /* @__PURE__ */ new Map(); + let count = 0; + for (const key of Object.keys(object)) { + map.set(parseInt(key, 10), object[key]); + if (++count % 1e3 === 0) { + await wait(0); + } + } + return map; +}; +const wait = (ms) => new Promise((resolve) => setTimeout(resolve, ms)); +const SPACE_OR_PUNCTUATION = /[\n\r\p{Z}\p{P}]+/u; +class LRUCache { + constructor(max = 10) { + __publicField(this, "max"); + __publicField(this, "cache"); + this.max = max; + this.cache = /* @__PURE__ */ new Map(); + } + get(key) { + let item = this.cache.get(key); + if (item !== void 0) { + this.cache.delete(key); + this.cache.set(key, item); + } + return item; + } + set(key, val) { + if (this.cache.has(key)) + this.cache.delete(key); + else if (this.cache.size === this.max) + this.cache.delete(this.first()); + this.cache.set(key, val); + } + first() { + return this.cache.keys().next().value; + } + clear() { + this.cache.clear(); + } +} +const _hoisted_1 = ["aria-owns"]; +const _hoisted_2 = { class: "shell" }; +const _hoisted_3 = ["title"]; +const _hoisted_4 = { class: "search-actions before" }; +const _hoisted_5 = ["title"]; +const _hoisted_6 = ["aria-activedescendant", "aria-controls", "placeholder"]; +const _hoisted_7 = { class: "search-actions" }; +const _hoisted_8 = ["title"]; +const _hoisted_9 = ["disabled", "title"]; +const _hoisted_10 = ["id", "role", "aria-labelledby"]; +const _hoisted_11 = ["id", "aria-selected"]; +const _hoisted_12 = ["href", "aria-label", "onMouseenter", "onFocusin", "data-index"]; +const _hoisted_13 = { class: "titles" }; +const _hoisted_14 = ["innerHTML"]; +const _hoisted_15 = { class: "title main" }; +const _hoisted_16 = ["innerHTML"]; +const _hoisted_17 = { + key: 0, + class: "excerpt-wrapper" +}; +const _hoisted_18 = { + key: 0, + class: "excerpt", + inert: "" +}; +const _hoisted_19 = ["innerHTML"]; +const _hoisted_20 = { + key: 0, + class: "no-results" +}; +const _hoisted_21 = { class: "search-keyboard-shortcuts" }; +const _hoisted_22 = ["aria-label"]; +const _hoisted_23 = ["aria-label"]; +const _hoisted_24 = ["aria-label"]; +const _hoisted_25 = ["aria-label"]; +const _sfc_main = /* @__PURE__ */ defineComponent({ + __name: "VPLocalSearchBox", + emits: ["close"], + setup(__props, { emit: __emit }) { + var _a, _b; + const emit = __emit; + const el = shallowRef(); + const resultsEl = shallowRef(); + const searchIndexData = shallowRef(localSearchIndex); + const vitePressData = useData(); + const { activate } = useFocusTrap(el, { + immediate: true, + allowOutsideClick: true, + clickOutsideDeactivates: true, + escapeDeactivates: true + }); + const { localeIndex, theme } = vitePressData; + const searchIndex = computedAsync( + async () => { + var _a2, _b2, _c, _d, _e, _f, _g, _h, _i; + return markRaw( + MiniSearch.loadJSON( + (_c = await ((_b2 = (_a2 = searchIndexData.value)[localeIndex.value]) == null ? void 0 : _b2.call(_a2))) == null ? void 0 : _c.default, + { + fields: ["title", "titles", "text"], + storeFields: ["title", "titles"], + searchOptions: { + fuzzy: 0.2, + prefix: true, + boost: { title: 4, text: 2, titles: 1 }, + ...((_d = theme.value.search) == null ? void 0 : _d.provider) === "local" && ((_f = (_e = theme.value.search.options) == null ? void 0 : _e.miniSearch) == null ? void 0 : _f.searchOptions) + }, + ...((_g = theme.value.search) == null ? void 0 : _g.provider) === "local" && ((_i = (_h = theme.value.search.options) == null ? void 0 : _h.miniSearch) == null ? void 0 : _i.options) + } + ) + ); + } + ); + const disableQueryPersistence = computed(() => { + var _a2, _b2; + return ((_a2 = theme.value.search) == null ? void 0 : _a2.provider) === "local" && ((_b2 = theme.value.search.options) == null ? void 0 : _b2.disableQueryPersistence) === true; + }); + const filterText = disableQueryPersistence.value ? ref("") : useSessionStorage("vitepress:local-search-filter", ""); + const showDetailedList = useLocalStorage( + "vitepress:local-search-detailed-list", + ((_a = theme.value.search) == null ? void 0 : _a.provider) === "local" && ((_b = theme.value.search.options) == null ? void 0 : _b.detailedView) === true + ); + const disableDetailedView = computed(() => { + var _a2, _b2, _c; + return ((_a2 = theme.value.search) == null ? void 0 : _a2.provider) === "local" && (((_b2 = theme.value.search.options) == null ? void 0 : _b2.disableDetailedView) === true || ((_c = theme.value.search.options) == null ? void 0 : _c.detailedView) === false); + }); + const buttonText = computed(() => { + var _a2, _b2, _c, _d, _e, _f, _g; + const options = ((_a2 = theme.value.search) == null ? void 0 : _a2.options) ?? theme.value.algolia; + return ((_e = (_d = (_c = (_b2 = options == null ? void 0 : options.locales) == null ? void 0 : _b2[localeIndex.value]) == null ? void 0 : _c.translations) == null ? void 0 : _d.button) == null ? void 0 : _e.buttonText) || ((_g = (_f = options == null ? void 0 : options.translations) == null ? void 0 : _f.button) == null ? void 0 : _g.buttonText) || "Search"; + }); + watchEffect(() => { + if (disableDetailedView.value) { + showDetailedList.value = false; + } + }); + const results = shallowRef([]); + const enableNoResults = ref(false); + watch(filterText, () => { + enableNoResults.value = false; + }); + const mark = computedAsync(async () => { + if (!resultsEl.value) return; + return markRaw(new Mark2(resultsEl.value)); + }, null); + const cache = new LRUCache(16); + watchDebounced( + () => [searchIndex.value, filterText.value, showDetailedList.value], + async ([index, filterTextValue, showDetailedListValue], old, onCleanup) => { + var _a2, _b2, _c, _d; + if ((old == null ? void 0 : old[0]) !== index) { + cache.clear(); + } + let canceled = false; + onCleanup(() => { + canceled = true; + }); + if (!index) return; + results.value = index.search(filterTextValue).slice(0, 16); + enableNoResults.value = true; + const mods = showDetailedListValue ? await Promise.all(results.value.map((r) => fetchExcerpt(r.id))) : []; + if (canceled) return; + for (const { id, mod } of mods) { + const mapId = id.slice(0, id.indexOf("#")); + let map = cache.get(mapId); + if (map) continue; + map = /* @__PURE__ */ new Map(); + cache.set(mapId, map); + const comp = mod.default ?? mod; + if ((comp == null ? void 0 : comp.render) || (comp == null ? void 0 : comp.setup)) { + const app = createApp(comp); + app.config.warnHandler = () => { + }; + app.provide(dataSymbol, vitePressData); + Object.defineProperties(app.config.globalProperties, { + $frontmatter: { + get() { + return vitePressData.frontmatter.value; + } + }, + $params: { + get() { + return vitePressData.page.value.params; + } + } + }); + const div = document.createElement("div"); + app.mount(div); + const headings = div.querySelectorAll("h1, h2, h3, h4, h5, h6"); + headings.forEach((el2) => { + var _a3; + const href = (_a3 = el2.querySelector("a")) == null ? void 0 : _a3.getAttribute("href"); + const anchor = (href == null ? void 0 : href.startsWith("#")) && href.slice(1); + if (!anchor) return; + let html = ""; + while ((el2 = el2.nextElementSibling) && !/^h[1-6]$/i.test(el2.tagName)) + html += el2.outerHTML; + map.set(anchor, html); + }); + app.unmount(); + } + if (canceled) return; + } + const terms = /* @__PURE__ */ new Set(); + results.value = results.value.map((r) => { + const [id, anchor] = r.id.split("#"); + const map = cache.get(id); + const text = (map == null ? void 0 : map.get(anchor)) ?? ""; + for (const term in r.match) { + terms.add(term); + } + return { ...r, text }; + }); + await nextTick(); + if (canceled) return; + await new Promise((r) => { + var _a3; + (_a3 = mark.value) == null ? void 0 : _a3.unmark({ + done: () => { + var _a4; + (_a4 = mark.value) == null ? void 0 : _a4.markRegExp(formMarkRegex(terms), { done: r }); + } + }); + }); + const excerpts = ((_a2 = el.value) == null ? void 0 : _a2.querySelectorAll(".result .excerpt")) ?? []; + for (const excerpt of excerpts) { + (_b2 = excerpt.querySelector('mark[data-markjs="true"]')) == null ? void 0 : _b2.scrollIntoView({ block: "center" }); + } + (_d = (_c = resultsEl.value) == null ? void 0 : _c.firstElementChild) == null ? void 0 : _d.scrollIntoView({ block: "start" }); + }, + { debounce: 200, immediate: true } + ); + async function fetchExcerpt(id) { + const file = pathToFile(id.slice(0, id.indexOf("#"))); + try { + if (!file) throw new Error(`Cannot find file for id: ${id}`); + return { id, mod: await import( + /*@vite-ignore*/ + file + ) }; + } catch (e) { + console.error(e); + return { id, mod: {} }; + } + } + const searchInput = ref(); + const disableReset = computed(() => { + var _a2; + return ((_a2 = filterText.value) == null ? void 0 : _a2.length) <= 0; + }); + function focusSearchInput(select = true) { + var _a2, _b2; + (_a2 = searchInput.value) == null ? void 0 : _a2.focus(); + select && ((_b2 = searchInput.value) == null ? void 0 : _b2.select()); + } + onMounted(() => { + focusSearchInput(); + }); + function onSearchBarClick(event) { + if (event.pointerType === "mouse") { + focusSearchInput(); + } + } + const selectedIndex = ref(-1); + const disableMouseOver = ref(true); + watch(results, (r) => { + selectedIndex.value = r.length ? 0 : -1; + scrollToSelectedResult(); + }); + function scrollToSelectedResult() { + nextTick(() => { + const selectedEl = document.querySelector(".result.selected"); + selectedEl == null ? void 0 : selectedEl.scrollIntoView({ block: "nearest" }); + }); + } + onKeyStroke("ArrowUp", (event) => { + event.preventDefault(); + selectedIndex.value--; + if (selectedIndex.value < 0) { + selectedIndex.value = results.value.length - 1; + } + disableMouseOver.value = true; + scrollToSelectedResult(); + }); + onKeyStroke("ArrowDown", (event) => { + event.preventDefault(); + selectedIndex.value++; + if (selectedIndex.value >= results.value.length) { + selectedIndex.value = 0; + } + disableMouseOver.value = true; + scrollToSelectedResult(); + }); + const router = useRouter(); + onKeyStroke("Enter", (e) => { + if (e.isComposing) return; + if (e.target instanceof HTMLButtonElement && e.target.type !== "submit") + return; + const selectedPackage = results.value[selectedIndex.value]; + if (e.target instanceof HTMLInputElement && !selectedPackage) { + e.preventDefault(); + return; + } + if (selectedPackage) { + router.go(selectedPackage.id); + emit("close"); + } + }); + onKeyStroke("Escape", () => { + emit("close"); + }); + const defaultTranslations = { + modal: { + displayDetails: "Display detailed list", + resetButtonTitle: "Reset search", + backButtonTitle: "Close search", + noResultsText: "No results for", + footer: { + selectText: "to select", + selectKeyAriaLabel: "enter", + navigateText: "to navigate", + navigateUpKeyAriaLabel: "up arrow", + navigateDownKeyAriaLabel: "down arrow", + closeText: "to close", + closeKeyAriaLabel: "escape" + } + } + }; + const translate = createSearchTranslate(defaultTranslations); + onMounted(() => { + window.history.pushState(null, "", null); + }); + useEventListener("popstate", (event) => { + event.preventDefault(); + emit("close"); + }); + const isLocked = useScrollLock(inBrowser ? document.body : null); + onMounted(() => { + nextTick(() => { + isLocked.value = true; + nextTick().then(() => activate()); + }); + }); + onBeforeUnmount(() => { + isLocked.value = false; + }); + function resetSearch() { + filterText.value = ""; + nextTick().then(() => focusSearchInput(false)); + } + function formMarkRegex(terms) { + return new RegExp( + [...terms].sort((a, b) => b.length - a.length).map((term) => `(${escapeRegExp(term)})`).join("|"), + "gi" + ); + } + function onMouseMove(e) { + var _a2; + if (!disableMouseOver.value) return; + const el2 = (_a2 = e.target) == null ? void 0 : _a2.closest(".result"); + const index = Number.parseInt(el2 == null ? void 0 : el2.dataset.index); + if (index >= 0 && index !== selectedIndex.value) { + selectedIndex.value = index; + } + disableMouseOver.value = false; + } + return (_ctx, _cache) => { + var _a2, _b2, _c, _d, _e; + return openBlock(), createBlock(Teleport, { to: "body" }, [ + createBaseVNode("div", { + ref_key: "el", + ref: el, + role: "button", + "aria-owns": ((_a2 = results.value) == null ? void 0 : _a2.length) ? "localsearch-list" : void 0, + "aria-expanded": "true", + "aria-haspopup": "listbox", + "aria-labelledby": "localsearch-label", + class: "VPLocalSearchBox" + }, [ + createBaseVNode("div", { + class: "backdrop", + onClick: _cache[0] || (_cache[0] = ($event) => _ctx.$emit("close")) + }), + createBaseVNode("div", _hoisted_2, [ + createBaseVNode("form", { + class: "search-bar", + onPointerup: _cache[4] || (_cache[4] = ($event) => onSearchBarClick($event)), + onSubmit: _cache[5] || (_cache[5] = withModifiers(() => { + }, ["prevent"])) + }, [ + createBaseVNode("label", { + title: buttonText.value, + id: "localsearch-label", + for: "localsearch-input" + }, [..._cache[7] || (_cache[7] = [ + createBaseVNode("span", { + "aria-hidden": "true", + class: "vpi-search search-icon local-search-icon" + }, null, -1) + ])], 8, _hoisted_3), + createBaseVNode("div", _hoisted_4, [ + createBaseVNode("button", { + class: "back-button", + title: unref(translate)("modal.backButtonTitle"), + onClick: _cache[1] || (_cache[1] = ($event) => _ctx.$emit("close")) + }, [..._cache[8] || (_cache[8] = [ + createBaseVNode("span", { class: "vpi-arrow-left local-search-icon" }, null, -1) + ])], 8, _hoisted_5) + ]), + withDirectives(createBaseVNode("input", { + ref_key: "searchInput", + ref: searchInput, + "onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => isRef(filterText) ? filterText.value = $event : null), + "aria-activedescendant": selectedIndex.value > -1 ? "localsearch-item-" + selectedIndex.value : void 0, + "aria-autocomplete": "both", + "aria-controls": ((_b2 = results.value) == null ? void 0 : _b2.length) ? "localsearch-list" : void 0, + "aria-labelledby": "localsearch-label", + autocapitalize: "off", + autocomplete: "off", + autocorrect: "off", + class: "search-input", + id: "localsearch-input", + enterkeyhint: "go", + maxlength: "64", + placeholder: buttonText.value, + spellcheck: "false", + type: "search" + }, null, 8, _hoisted_6), [ + [vModelText, unref(filterText)] + ]), + createBaseVNode("div", _hoisted_7, [ + !disableDetailedView.value ? (openBlock(), createElementBlock("button", { + key: 0, + class: normalizeClass(["toggle-layout-button", { "detailed-list": unref(showDetailedList) }]), + type: "button", + title: unref(translate)("modal.displayDetails"), + onClick: _cache[3] || (_cache[3] = ($event) => selectedIndex.value > -1 && (showDetailedList.value = !unref(showDetailedList))) + }, [..._cache[9] || (_cache[9] = [ + createBaseVNode("span", { class: "vpi-layout-list local-search-icon" }, null, -1) + ])], 10, _hoisted_8)) : createCommentVNode("", true), + createBaseVNode("button", { + class: "clear-button", + type: "reset", + disabled: disableReset.value, + title: unref(translate)("modal.resetButtonTitle"), + onClick: resetSearch + }, [..._cache[10] || (_cache[10] = [ + createBaseVNode("span", { class: "vpi-delete local-search-icon" }, null, -1) + ])], 8, _hoisted_9) + ]) + ], 32), + createBaseVNode("ul", { + ref_key: "resultsEl", + ref: resultsEl, + id: ((_c = results.value) == null ? void 0 : _c.length) ? "localsearch-list" : void 0, + role: ((_d = results.value) == null ? void 0 : _d.length) ? "listbox" : void 0, + "aria-labelledby": ((_e = results.value) == null ? void 0 : _e.length) ? "localsearch-label" : void 0, + class: "results", + onMousemove: onMouseMove + }, [ + (openBlock(true), createElementBlock(Fragment, null, renderList(results.value, (p, index) => { + return openBlock(), createElementBlock("li", { + key: p.id, + id: "localsearch-item-" + index, + "aria-selected": selectedIndex.value === index ? "true" : "false", + role: "option" + }, [ + createBaseVNode("a", { + href: p.id, + class: normalizeClass(["result", { + selected: selectedIndex.value === index + }]), + "aria-label": [...p.titles, p.title].join(" > "), + onMouseenter: ($event) => !disableMouseOver.value && (selectedIndex.value = index), + onFocusin: ($event) => selectedIndex.value = index, + onClick: _cache[6] || (_cache[6] = ($event) => _ctx.$emit("close")), + "data-index": index + }, [ + createBaseVNode("div", null, [ + createBaseVNode("div", _hoisted_13, [ + _cache[12] || (_cache[12] = createBaseVNode("span", { class: "title-icon" }, "#", -1)), + (openBlock(true), createElementBlock(Fragment, null, renderList(p.titles, (t, index2) => { + return openBlock(), createElementBlock("span", { + key: index2, + class: "title" + }, [ + createBaseVNode("span", { + class: "text", + innerHTML: t + }, null, 8, _hoisted_14), + _cache[11] || (_cache[11] = createBaseVNode("span", { class: "vpi-chevron-right local-search-icon" }, null, -1)) + ]); + }), 128)), + createBaseVNode("span", _hoisted_15, [ + createBaseVNode("span", { + class: "text", + innerHTML: p.title + }, null, 8, _hoisted_16) + ]) + ]), + unref(showDetailedList) ? (openBlock(), createElementBlock("div", _hoisted_17, [ + p.text ? (openBlock(), createElementBlock("div", _hoisted_18, [ + createBaseVNode("div", { + class: "vp-doc", + innerHTML: p.text + }, null, 8, _hoisted_19) + ])) : createCommentVNode("", true), + _cache[13] || (_cache[13] = createBaseVNode("div", { class: "excerpt-gradient-bottom" }, null, -1)), + _cache[14] || (_cache[14] = createBaseVNode("div", { class: "excerpt-gradient-top" }, null, -1)) + ])) : createCommentVNode("", true) + ]) + ], 42, _hoisted_12) + ], 8, _hoisted_11); + }), 128)), + unref(filterText) && !results.value.length && enableNoResults.value ? (openBlock(), createElementBlock("li", _hoisted_20, [ + createTextVNode(toDisplayString(unref(translate)("modal.noResultsText")) + ' "', 1), + createBaseVNode("strong", null, toDisplayString(unref(filterText)), 1), + _cache[15] || (_cache[15] = createTextVNode('" ', -1)) + ])) : createCommentVNode("", true) + ], 40, _hoisted_10), + createBaseVNode("div", _hoisted_21, [ + createBaseVNode("span", null, [ + createBaseVNode("kbd", { + "aria-label": unref(translate)("modal.footer.navigateUpKeyAriaLabel") + }, [..._cache[16] || (_cache[16] = [ + createBaseVNode("span", { class: "vpi-arrow-up navigate-icon" }, null, -1) + ])], 8, _hoisted_22), + createBaseVNode("kbd", { + "aria-label": unref(translate)("modal.footer.navigateDownKeyAriaLabel") + }, [..._cache[17] || (_cache[17] = [ + createBaseVNode("span", { class: "vpi-arrow-down navigate-icon" }, null, -1) + ])], 8, _hoisted_23), + createTextVNode(" " + toDisplayString(unref(translate)("modal.footer.navigateText")), 1) + ]), + createBaseVNode("span", null, [ + createBaseVNode("kbd", { + "aria-label": unref(translate)("modal.footer.selectKeyAriaLabel") + }, [..._cache[18] || (_cache[18] = [ + createBaseVNode("span", { class: "vpi-corner-down-left navigate-icon" }, null, -1) + ])], 8, _hoisted_24), + createTextVNode(" " + toDisplayString(unref(translate)("modal.footer.selectText")), 1) + ]), + createBaseVNode("span", null, [ + createBaseVNode("kbd", { + "aria-label": unref(translate)("modal.footer.closeKeyAriaLabel") + }, "esc", 8, _hoisted_25), + createTextVNode(" " + toDisplayString(unref(translate)("modal.footer.closeText")), 1) + ]) + ]) + ]) + ], 8, _hoisted_1) + ]); + }; + } +}); +const VPLocalSearchBox = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-ce626c7c"]]); +export { + VPLocalSearchBox as default +}; diff --git a/docs/.vitepress/dist/assets/chunks/framework.BcMzFyCJ.js b/docs/.vitepress/dist/assets/chunks/framework.BcMzFyCJ.js new file mode 100644 index 0000000..1afe658 --- /dev/null +++ b/docs/.vitepress/dist/assets/chunks/framework.BcMzFyCJ.js @@ -0,0 +1,10587 @@ +/** +* @vue/shared v3.5.39 +* (c) 2018-present Yuxi (Evan) You and Vue contributors +* @license MIT +**/ +// @__NO_SIDE_EFFECTS__ +function makeMap(str) { + const map = /* @__PURE__ */ Object.create(null); + for (const key of str.split(",")) map[key] = 1; + return (val) => val in map; +} +const EMPTY_OBJ = {}; +const EMPTY_ARR = []; +const NOOP = () => { +}; +const NO = () => false; +const isOn = (key) => key.charCodeAt(0) === 111 && key.charCodeAt(1) === 110 && // uppercase letter +(key.charCodeAt(2) > 122 || key.charCodeAt(2) < 97); +const isModelListener = (key) => key.startsWith("onUpdate:"); +const extend = Object.assign; +const remove = (arr, el) => { + const i = arr.indexOf(el); + if (i > -1) { + arr.splice(i, 1); + } +}; +const hasOwnProperty$1 = Object.prototype.hasOwnProperty; +const hasOwn = (val, key) => hasOwnProperty$1.call(val, key); +const isArray = Array.isArray; +const isMap = (val) => toTypeString(val) === "[object Map]"; +const isSet = (val) => toTypeString(val) === "[object Set]"; +const isDate = (val) => toTypeString(val) === "[object Date]"; +const isFunction = (val) => typeof val === "function"; +const isString = (val) => typeof val === "string"; +const isSymbol = (val) => typeof val === "symbol"; +const isObject$1 = (val) => val !== null && typeof val === "object"; +const isPromise = (val) => { + return (isObject$1(val) || isFunction(val)) && isFunction(val.then) && isFunction(val.catch); +}; +const objectToString = Object.prototype.toString; +const toTypeString = (value) => objectToString.call(value); +const toRawType = (value) => { + return toTypeString(value).slice(8, -1); +}; +const isPlainObject = (val) => toTypeString(val) === "[object Object]"; +const isIntegerKey = (key) => isString(key) && key !== "NaN" && key[0] !== "-" && "" + parseInt(key, 10) === key; +const isReservedProp = /* @__PURE__ */ makeMap( + // the leading comma is intentional so empty string "" is also included + ",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted" +); +const cacheStringFunction = (fn) => { + const cache = /* @__PURE__ */ Object.create(null); + return (str) => { + const hit = cache[str]; + return hit || (cache[str] = fn(str)); + }; +}; +const camelizeRE = /-\w/g; +const camelize = cacheStringFunction( + (str) => { + return str.replace(camelizeRE, (c) => c.slice(1).toUpperCase()); + } +); +const hyphenateRE = /\B([A-Z])/g; +const hyphenate = cacheStringFunction( + (str) => str.replace(hyphenateRE, "-$1").toLowerCase() +); +const capitalize = cacheStringFunction((str) => { + return str.charAt(0).toUpperCase() + str.slice(1); +}); +const toHandlerKey = cacheStringFunction( + (str) => { + const s = str ? `on${capitalize(str)}` : ``; + return s; + } +); +const hasChanged = (value, oldValue) => !Object.is(value, oldValue); +const invokeArrayFns = (fns, ...arg) => { + for (let i = 0; i < fns.length; i++) { + fns[i](...arg); + } +}; +const def = (obj, key, value, writable = false) => { + Object.defineProperty(obj, key, { + configurable: true, + enumerable: false, + writable, + value + }); +}; +const looseToNumber = (val) => { + const n = parseFloat(val); + return isNaN(n) ? val : n; +}; +const toNumber = (val) => { + const n = isString(val) ? Number(val) : NaN; + return isNaN(n) ? val : n; +}; +let _globalThis; +const getGlobalThis = () => { + return _globalThis || (_globalThis = typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : {}); +}; +function normalizeStyle(value) { + if (isArray(value)) { + const res = {}; + for (let i = 0; i < value.length; i++) { + const item = value[i]; + const normalized = isString(item) ? parseStringStyle(item) : normalizeStyle(item); + if (normalized) { + for (const key in normalized) { + res[key] = normalized[key]; + } + } + } + return res; + } else if (isString(value) || isObject$1(value)) { + return value; + } +} +const listDelimiterRE = /;(?![^(]*\))/g; +const propertyDelimiterRE = /:([^]+)/; +const styleCommentRE = /\/\*[^]*?\*\//g; +function parseStringStyle(cssText) { + const ret = {}; + cssText.replace(styleCommentRE, "").split(listDelimiterRE).forEach((item) => { + if (item) { + const tmp = item.split(propertyDelimiterRE); + tmp.length > 1 && (ret[tmp[0].trim()] = tmp[1].trim()); + } + }); + return ret; +} +function stringifyStyle(styles) { + if (!styles) return ""; + if (isString(styles)) return styles; + let ret = ""; + for (const key in styles) { + const value = styles[key]; + if (isString(value) || typeof value === "number") { + const normalizedKey = key.startsWith(`--`) ? key : hyphenate(key); + ret += `${normalizedKey}:${value};`; + } + } + return ret; +} +function normalizeClass(value) { + let res = ""; + if (isString(value)) { + res = value; + } else if (isArray(value)) { + for (let i = 0; i < value.length; i++) { + const normalized = normalizeClass(value[i]); + if (normalized) { + res += normalized + " "; + } + } + } else if (isObject$1(value)) { + for (const name in value) { + if (value[name]) { + res += name + " "; + } + } + } + return res.trim(); +} +const specialBooleanAttrs = `itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly`; +const isSpecialBooleanAttr = /* @__PURE__ */ makeMap(specialBooleanAttrs); +const isBooleanAttr = /* @__PURE__ */ makeMap( + specialBooleanAttrs + `,async,autofocus,autoplay,controls,default,defer,disabled,hidden,inert,loop,open,required,reversed,scoped,seamless,checked,muted,multiple,selected` +); +function includeBooleanAttr(value) { + return !!value || value === ""; +} +const isKnownHtmlAttr = /* @__PURE__ */ makeMap( + `accept,accept-charset,accesskey,action,align,allow,alt,async,autocapitalize,autocomplete,autofocus,autoplay,background,bgcolor,border,buffered,capture,challenge,charset,checked,cite,class,code,codebase,color,cols,colspan,content,contenteditable,contextmenu,controls,coords,crossorigin,csp,data,datetime,decoding,default,defer,dir,dirname,disabled,download,draggable,dropzone,enctype,enterkeyhint,for,form,formaction,formenctype,formmethod,formnovalidate,formtarget,headers,height,hidden,high,href,hreflang,http-equiv,icon,id,importance,inert,integrity,ismap,itemprop,keytype,kind,label,lang,language,loading,list,loop,low,manifest,max,maxlength,minlength,media,min,multiple,muted,name,novalidate,open,optimum,pattern,ping,placeholder,poster,preload,radiogroup,readonly,referrerpolicy,rel,required,reversed,rows,rowspan,sandbox,scope,scoped,selected,shape,size,sizes,slot,span,spellcheck,src,srcdoc,srclang,srcset,start,step,style,summary,tabindex,target,title,translate,type,usemap,value,width,wrap` +); +const isKnownSvgAttr = /* @__PURE__ */ makeMap( + `xmlns,accent-height,accumulate,additive,alignment-baseline,alphabetic,amplitude,arabic-form,ascent,attributeName,attributeType,azimuth,baseFrequency,baseline-shift,baseProfile,bbox,begin,bias,by,calcMode,cap-height,class,clip,clipPathUnits,clip-path,clip-rule,color,color-interpolation,color-interpolation-filters,color-profile,color-rendering,contentScriptType,contentStyleType,crossorigin,cursor,cx,cy,d,decelerate,descent,diffuseConstant,direction,display,divisor,dominant-baseline,dur,dx,dy,edgeMode,elevation,enable-background,end,exponent,fill,fill-opacity,fill-rule,filter,filterRes,filterUnits,flood-color,flood-opacity,font-family,font-size,font-size-adjust,font-stretch,font-style,font-variant,font-weight,format,from,fr,fx,fy,g1,g2,glyph-name,glyph-orientation-horizontal,glyph-orientation-vertical,glyphRef,gradientTransform,gradientUnits,hanging,height,href,hreflang,horiz-adv-x,horiz-origin-x,id,ideographic,image-rendering,in,in2,intercept,k,k1,k2,k3,k4,kernelMatrix,kernelUnitLength,kerning,keyPoints,keySplines,keyTimes,lang,lengthAdjust,letter-spacing,lighting-color,limitingConeAngle,local,marker-end,marker-mid,marker-start,markerHeight,markerUnits,markerWidth,mask,maskContentUnits,maskUnits,mathematical,max,media,method,min,mode,name,numOctaves,offset,opacity,operator,order,orient,orientation,origin,overflow,overline-position,overline-thickness,panose-1,paint-order,path,pathLength,patternContentUnits,patternTransform,patternUnits,ping,pointer-events,points,pointsAtX,pointsAtY,pointsAtZ,preserveAlpha,preserveAspectRatio,primitiveUnits,r,radius,referrerPolicy,refX,refY,rel,rendering-intent,repeatCount,repeatDur,requiredExtensions,requiredFeatures,restart,result,rotate,rx,ry,scale,seed,shape-rendering,slope,spacing,specularConstant,specularExponent,speed,spreadMethod,startOffset,stdDeviation,stemh,stemv,stitchTiles,stop-color,stop-opacity,strikethrough-position,strikethrough-thickness,string,stroke,stroke-dasharray,stroke-dashoffset,stroke-linecap,stroke-linejoin,stroke-miterlimit,stroke-opacity,stroke-width,style,surfaceScale,systemLanguage,tabindex,tableValues,target,targetX,targetY,text-anchor,text-decoration,text-rendering,textLength,to,transform,transform-origin,type,u1,u2,underline-position,underline-thickness,unicode,unicode-bidi,unicode-range,units-per-em,v-alphabetic,v-hanging,v-ideographic,v-mathematical,values,vector-effect,version,vert-adv-y,vert-origin-x,vert-origin-y,viewBox,viewTarget,visibility,width,widths,word-spacing,writing-mode,x,x-height,x1,x2,xChannelSelector,xlink:actuate,xlink:arcrole,xlink:href,xlink:role,xlink:show,xlink:title,xlink:type,xmlns:xlink,xml:base,xml:lang,xml:space,y,y1,y2,yChannelSelector,z,zoomAndPan` +); +function isRenderableAttrValue(value) { + if (value == null) { + return false; + } + const type = typeof value; + return type === "string" || type === "number" || type === "boolean"; +} +const cssVarNameEscapeSymbolsRE = /[ !"#$%&'()*+,./:;<=>?@[\\\]^`{|}~]/g; +function getEscapedCssVarName(key, doubleEscape) { + return key.replace( + cssVarNameEscapeSymbolsRE, + (s) => `\\${s}` + ); +} +function looseCompareArrays(a, b) { + if (a.length !== b.length) return false; + let equal = true; + for (let i = 0; equal && i < a.length; i++) { + equal = looseEqual(a[i], b[i]); + } + return equal; +} +function looseEqual(a, b) { + if (a === b) return true; + let aValidType = isDate(a); + let bValidType = isDate(b); + if (aValidType || bValidType) { + return aValidType && bValidType ? a.getTime() === b.getTime() : false; + } + aValidType = isSymbol(a); + bValidType = isSymbol(b); + if (aValidType || bValidType) { + return a === b; + } + aValidType = isArray(a); + bValidType = isArray(b); + if (aValidType || bValidType) { + return aValidType && bValidType ? looseCompareArrays(a, b) : false; + } + aValidType = isObject$1(a); + bValidType = isObject$1(b); + if (aValidType || bValidType) { + if (!aValidType || !bValidType) { + return false; + } + const aKeysCount = Object.keys(a).length; + const bKeysCount = Object.keys(b).length; + if (aKeysCount !== bKeysCount) { + return false; + } + for (const key in a) { + const aHasKey = a.hasOwnProperty(key); + const bHasKey = b.hasOwnProperty(key); + if (aHasKey && !bHasKey || !aHasKey && bHasKey || !looseEqual(a[key], b[key])) { + return false; + } + } + } + return String(a) === String(b); +} +const isRef$1 = (val) => { + return !!(val && val["__v_isRef"] === true); +}; +const toDisplayString = (val) => { + return isString(val) ? val : val == null ? "" : isArray(val) || isObject$1(val) && (val.toString === objectToString || !isFunction(val.toString)) ? isRef$1(val) ? toDisplayString(val.value) : JSON.stringify(val, replacer, 2) : String(val); +}; +const replacer = (_key, val) => { + if (isRef$1(val)) { + return replacer(_key, val.value); + } else if (isMap(val)) { + return { + [`Map(${val.size})`]: [...val.entries()].reduce( + (entries, [key, val2], i) => { + entries[stringifySymbol(key, i) + " =>"] = val2; + return entries; + }, + {} + ) + }; + } else if (isSet(val)) { + return { + [`Set(${val.size})`]: [...val.values()].map((v) => stringifySymbol(v)) + }; + } else if (isSymbol(val)) { + return stringifySymbol(val); + } else if (isObject$1(val) && !isArray(val) && !isPlainObject(val)) { + return String(val); + } + return val; +}; +const stringifySymbol = (v, i = "") => { + var _a; + return ( + // Symbol.description in es2019+ so we need to cast here to pass + // the lib: es2016 check + isSymbol(v) ? `Symbol(${(_a = v.description) != null ? _a : i})` : v + ); +}; +function normalizeCssVarValue(value) { + if (value == null) { + return "initial"; + } + if (typeof value === "string") { + return value === "" ? " " : value; + } + return String(value); +} +/** +* @vue/reactivity v3.5.39 +* (c) 2018-present Yuxi (Evan) You and Vue contributors +* @license MIT +**/ +let activeEffectScope; +class EffectScope { + // TODO isolatedDeclarations "__v_skip" + constructor(detached = false) { + this.detached = detached; + this._active = true; + this._on = 0; + this.effects = []; + this.cleanups = []; + this._isPaused = false; + this._warnOnRun = true; + this.__v_skip = true; + if (!detached && activeEffectScope) { + if (activeEffectScope.active) { + this.parent = activeEffectScope; + this.index = (activeEffectScope.scopes || (activeEffectScope.scopes = [])).push( + this + ) - 1; + } else { + this._active = false; + this._warnOnRun = false; + } + } + } + get active() { + return this._active; + } + pause() { + if (this._active) { + this._isPaused = true; + let i, l; + if (this.scopes) { + for (i = 0, l = this.scopes.length; i < l; i++) { + this.scopes[i].pause(); + } + } + for (i = 0, l = this.effects.length; i < l; i++) { + this.effects[i].pause(); + } + } + } + /** + * Resumes the effect scope, including all child scopes and effects. + */ + resume() { + if (this._active) { + if (this._isPaused) { + this._isPaused = false; + let i, l; + if (this.scopes) { + for (i = 0, l = this.scopes.length; i < l; i++) { + this.scopes[i].resume(); + } + } + for (i = 0, l = this.effects.length; i < l; i++) { + this.effects[i].resume(); + } + } + } + } + run(fn) { + if (this._active) { + const currentEffectScope = activeEffectScope; + try { + activeEffectScope = this; + return fn(); + } finally { + activeEffectScope = currentEffectScope; + } + } + } + /** + * This should only be called on non-detached scopes + * @internal + */ + on() { + if (++this._on === 1) { + this.prevScope = activeEffectScope; + activeEffectScope = this; + } + } + /** + * This should only be called on non-detached scopes + * @internal + */ + off() { + if (this._on > 0 && --this._on === 0) { + if (activeEffectScope === this) { + activeEffectScope = this.prevScope; + } else { + let current = activeEffectScope; + while (current) { + if (current.prevScope === this) { + current.prevScope = this.prevScope; + break; + } + current = current.prevScope; + } + } + this.prevScope = void 0; + } + } + stop(fromParent) { + if (this._active) { + this._active = false; + let i, l; + for (i = 0, l = this.effects.length; i < l; i++) { + this.effects[i].stop(); + } + this.effects.length = 0; + for (i = 0, l = this.cleanups.length; i < l; i++) { + this.cleanups[i](); + } + this.cleanups.length = 0; + if (this.scopes) { + for (i = 0, l = this.scopes.length; i < l; i++) { + this.scopes[i].stop(true); + } + this.scopes.length = 0; + } + if (!this.detached && this.parent && !fromParent) { + const last = this.parent.scopes.pop(); + if (last && last !== this) { + this.parent.scopes[this.index] = last; + last.index = this.index; + } + } + this.parent = void 0; + } + } +} +function getCurrentScope() { + return activeEffectScope; +} +function onScopeDispose(fn, failSilently = false) { + if (activeEffectScope) { + activeEffectScope.cleanups.push(fn); + } +} +let activeSub; +const pausedQueueEffects = /* @__PURE__ */ new WeakSet(); +class ReactiveEffect { + constructor(fn) { + this.fn = fn; + this.deps = void 0; + this.depsTail = void 0; + this.flags = 1 | 4; + this.next = void 0; + this.cleanup = void 0; + this.scheduler = void 0; + if (activeEffectScope) { + if (activeEffectScope.active) { + activeEffectScope.effects.push(this); + } else { + this.flags &= -2; + } + } + } + pause() { + this.flags |= 64; + } + resume() { + if (this.flags & 64) { + this.flags &= -65; + if (pausedQueueEffects.has(this)) { + pausedQueueEffects.delete(this); + this.trigger(); + } + } + } + /** + * @internal + */ + notify() { + if (this.flags & 2 && !(this.flags & 32)) { + return; + } + if (!(this.flags & 8)) { + batch(this); + } + } + run() { + if (!(this.flags & 1)) { + return this.fn(); + } + this.flags |= 2; + cleanupEffect(this); + prepareDeps(this); + const prevEffect = activeSub; + const prevShouldTrack = shouldTrack; + activeSub = this; + shouldTrack = true; + try { + return this.fn(); + } finally { + cleanupDeps(this); + activeSub = prevEffect; + shouldTrack = prevShouldTrack; + this.flags &= -3; + } + } + stop() { + if (this.flags & 1) { + for (let link2 = this.deps; link2; link2 = link2.nextDep) { + removeSub(link2); + } + this.deps = this.depsTail = void 0; + cleanupEffect(this); + this.onStop && this.onStop(); + this.flags &= -2; + } + } + trigger() { + if (this.flags & 64) { + pausedQueueEffects.add(this); + } else if (this.scheduler) { + this.scheduler(); + } else { + this.runIfDirty(); + } + } + /** + * @internal + */ + runIfDirty() { + if (isDirty(this)) { + this.run(); + } + } + get dirty() { + return isDirty(this); + } +} +let batchDepth = 0; +let batchedSub; +let batchedComputed; +function batch(sub, isComputed = false) { + sub.flags |= 8; + if (isComputed) { + sub.next = batchedComputed; + batchedComputed = sub; + return; + } + sub.next = batchedSub; + batchedSub = sub; +} +function startBatch() { + batchDepth++; +} +function endBatch() { + if (--batchDepth > 0) { + return; + } + if (batchedComputed) { + let e = batchedComputed; + batchedComputed = void 0; + while (e) { + const next = e.next; + e.next = void 0; + e.flags &= -9; + e = next; + } + } + let error; + while (batchedSub) { + let e = batchedSub; + batchedSub = void 0; + while (e) { + const next = e.next; + e.next = void 0; + e.flags &= -9; + if (e.flags & 1) { + try { + ; + e.trigger(); + } catch (err) { + if (!error) error = err; + } + } + e = next; + } + } + if (error) throw error; +} +function prepareDeps(sub) { + for (let link2 = sub.deps; link2; link2 = link2.nextDep) { + link2.version = -1; + link2.prevActiveLink = link2.dep.activeLink; + link2.dep.activeLink = link2; + } +} +function cleanupDeps(sub) { + let head; + let tail = sub.depsTail; + let link2 = tail; + while (link2) { + const prev = link2.prevDep; + if (link2.version === -1) { + if (link2 === tail) tail = prev; + removeSub(link2); + removeDep(link2); + } else { + head = link2; + } + link2.dep.activeLink = link2.prevActiveLink; + link2.prevActiveLink = void 0; + link2 = prev; + } + sub.deps = head; + sub.depsTail = tail; +} +function isDirty(sub) { + for (let link2 = sub.deps; link2; link2 = link2.nextDep) { + if (link2.dep.version !== link2.version || link2.dep.computed && (refreshComputed(link2.dep.computed) || link2.dep.version !== link2.version)) { + return true; + } + } + if (sub._dirty) { + return true; + } + return false; +} +function refreshComputed(computed2) { + if (computed2.flags & 4 && !(computed2.flags & 16)) { + return; + } + computed2.flags &= -17; + if (computed2.globalVersion === globalVersion) { + return; + } + computed2.globalVersion = globalVersion; + if (!computed2.isSSR && computed2.flags & 128 && (!computed2.deps && !computed2._dirty || !isDirty(computed2))) { + return; + } + computed2.flags |= 2; + const dep = computed2.dep; + const prevSub = activeSub; + const prevShouldTrack = shouldTrack; + activeSub = computed2; + shouldTrack = true; + try { + prepareDeps(computed2); + const value = computed2.fn(computed2._value); + if (dep.version === 0 || hasChanged(value, computed2._value)) { + computed2.flags |= 128; + computed2._value = value; + dep.version++; + } + } catch (err) { + dep.version++; + throw err; + } finally { + activeSub = prevSub; + shouldTrack = prevShouldTrack; + cleanupDeps(computed2); + computed2.flags &= -3; + } +} +function removeSub(link2, soft = false) { + const { dep, prevSub, nextSub } = link2; + if (prevSub) { + prevSub.nextSub = nextSub; + link2.prevSub = void 0; + } + if (nextSub) { + nextSub.prevSub = prevSub; + link2.nextSub = void 0; + } + if (dep.subs === link2) { + dep.subs = prevSub; + if (!prevSub && dep.computed) { + dep.computed.flags &= -5; + for (let l = dep.computed.deps; l; l = l.nextDep) { + removeSub(l, true); + } + } + } + if (!soft && !--dep.sc && dep.map) { + dep.map.delete(dep.key); + } +} +function removeDep(link2) { + const { prevDep, nextDep } = link2; + if (prevDep) { + prevDep.nextDep = nextDep; + link2.prevDep = void 0; + } + if (nextDep) { + nextDep.prevDep = prevDep; + link2.nextDep = void 0; + } +} +let shouldTrack = true; +const trackStack = []; +function pauseTracking() { + trackStack.push(shouldTrack); + shouldTrack = false; +} +function resetTracking() { + const last = trackStack.pop(); + shouldTrack = last === void 0 ? true : last; +} +function cleanupEffect(e) { + const { cleanup } = e; + e.cleanup = void 0; + if (cleanup) { + const prevSub = activeSub; + activeSub = void 0; + try { + cleanup(); + } finally { + activeSub = prevSub; + } + } +} +let globalVersion = 0; +class Link { + constructor(sub, dep) { + this.sub = sub; + this.dep = dep; + this.version = dep.version; + this.nextDep = this.prevDep = this.nextSub = this.prevSub = this.prevActiveLink = void 0; + } +} +class Dep { + // TODO isolatedDeclarations "__v_skip" + constructor(computed2) { + this.computed = computed2; + this.version = 0; + this.activeLink = void 0; + this.subs = void 0; + this.map = void 0; + this.key = void 0; + this.sc = 0; + this.__v_skip = true; + } + track(debugInfo) { + if (!activeSub || !shouldTrack || activeSub === this.computed) { + return; + } + let link2 = this.activeLink; + if (link2 === void 0 || link2.sub !== activeSub) { + link2 = this.activeLink = new Link(activeSub, this); + if (!activeSub.deps) { + activeSub.deps = activeSub.depsTail = link2; + } else { + link2.prevDep = activeSub.depsTail; + activeSub.depsTail.nextDep = link2; + activeSub.depsTail = link2; + } + addSub(link2); + } else if (link2.version === -1) { + link2.version = this.version; + if (link2.nextDep) { + const next = link2.nextDep; + next.prevDep = link2.prevDep; + if (link2.prevDep) { + link2.prevDep.nextDep = next; + } + link2.prevDep = activeSub.depsTail; + link2.nextDep = void 0; + activeSub.depsTail.nextDep = link2; + activeSub.depsTail = link2; + if (activeSub.deps === link2) { + activeSub.deps = next; + } + } + } + return link2; + } + trigger(debugInfo) { + this.version++; + globalVersion++; + this.notify(debugInfo); + } + notify(debugInfo) { + startBatch(); + try { + if (false) ; + for (let link2 = this.subs; link2; link2 = link2.prevSub) { + if (link2.sub.notify()) { + ; + link2.sub.dep.notify(); + } + } + } finally { + endBatch(); + } + } +} +function addSub(link2) { + link2.dep.sc++; + if (link2.sub.flags & 4) { + const computed2 = link2.dep.computed; + if (computed2 && !link2.dep.subs) { + computed2.flags |= 4 | 16; + for (let l = computed2.deps; l; l = l.nextDep) { + addSub(l); + } + } + const currentTail = link2.dep.subs; + if (currentTail !== link2) { + link2.prevSub = currentTail; + if (currentTail) currentTail.nextSub = link2; + } + link2.dep.subs = link2; + } +} +const targetMap = /* @__PURE__ */ new WeakMap(); +const ITERATE_KEY = /* @__PURE__ */ Symbol( + "" +); +const MAP_KEY_ITERATE_KEY = /* @__PURE__ */ Symbol( + "" +); +const ARRAY_ITERATE_KEY = /* @__PURE__ */ Symbol( + "" +); +function track(target, type, key) { + if (shouldTrack && activeSub) { + let depsMap = targetMap.get(target); + if (!depsMap) { + targetMap.set(target, depsMap = /* @__PURE__ */ new Map()); + } + let dep = depsMap.get(key); + if (!dep) { + depsMap.set(key, dep = new Dep()); + dep.map = depsMap; + dep.key = key; + } + { + dep.track(); + } + } +} +function trigger(target, type, key, newValue, oldValue, oldTarget) { + const depsMap = targetMap.get(target); + if (!depsMap) { + globalVersion++; + return; + } + const run = (dep) => { + if (dep) { + { + dep.trigger(); + } + } + }; + startBatch(); + if (type === "clear") { + depsMap.forEach(run); + } else { + const targetIsArray = isArray(target); + const isArrayIndex = targetIsArray && isIntegerKey(key); + if (targetIsArray && key === "length") { + const newLength = Number(newValue); + depsMap.forEach((dep, key2) => { + if (key2 === "length" || key2 === ARRAY_ITERATE_KEY || !isSymbol(key2) && key2 >= newLength) { + run(dep); + } + }); + } else { + if (key !== void 0 || depsMap.has(void 0)) { + run(depsMap.get(key)); + } + if (isArrayIndex) { + run(depsMap.get(ARRAY_ITERATE_KEY)); + } + switch (type) { + case "add": + if (!targetIsArray) { + run(depsMap.get(ITERATE_KEY)); + if (isMap(target)) { + run(depsMap.get(MAP_KEY_ITERATE_KEY)); + } + } else if (isArrayIndex) { + run(depsMap.get("length")); + } + break; + case "delete": + if (!targetIsArray) { + run(depsMap.get(ITERATE_KEY)); + if (isMap(target)) { + run(depsMap.get(MAP_KEY_ITERATE_KEY)); + } + } + break; + case "set": + if (isMap(target)) { + run(depsMap.get(ITERATE_KEY)); + } + break; + } + } + } + endBatch(); +} +function getDepFromReactive(object, key) { + const depMap = targetMap.get(object); + return depMap && depMap.get(key); +} +function reactiveReadArray(array) { + const raw = /* @__PURE__ */ toRaw(array); + if (raw === array) return raw; + track(raw, "iterate", ARRAY_ITERATE_KEY); + return /* @__PURE__ */ isShallow(array) ? raw : raw.map(toReactive); +} +function shallowReadArray(arr) { + track(arr = /* @__PURE__ */ toRaw(arr), "iterate", ARRAY_ITERATE_KEY); + return arr; +} +function toWrapped(target, item) { + if (/* @__PURE__ */ isReadonly(target)) { + return /* @__PURE__ */ isReactive(target) ? toReadonly(toReactive(item)) : toReadonly(item); + } + return toReactive(item); +} +const arrayInstrumentations = { + __proto__: null, + [Symbol.iterator]() { + return iterator(this, Symbol.iterator, (item) => toWrapped(this, item)); + }, + concat(...args) { + return reactiveReadArray(this).concat( + ...args.map((x) => isArray(x) ? reactiveReadArray(x) : x) + ); + }, + entries() { + return iterator(this, "entries", (value) => { + value[1] = toWrapped(this, value[1]); + return value; + }); + }, + every(fn, thisArg) { + return apply(this, "every", fn, thisArg, void 0, arguments); + }, + filter(fn, thisArg) { + return apply( + this, + "filter", + fn, + thisArg, + (v) => v.map((item) => toWrapped(this, item)), + arguments + ); + }, + find(fn, thisArg) { + return apply( + this, + "find", + fn, + thisArg, + (item) => toWrapped(this, item), + arguments + ); + }, + findIndex(fn, thisArg) { + return apply(this, "findIndex", fn, thisArg, void 0, arguments); + }, + findLast(fn, thisArg) { + return apply( + this, + "findLast", + fn, + thisArg, + (item) => toWrapped(this, item), + arguments + ); + }, + findLastIndex(fn, thisArg) { + return apply(this, "findLastIndex", fn, thisArg, void 0, arguments); + }, + // flat, flatMap could benefit from ARRAY_ITERATE but are not straight-forward to implement + forEach(fn, thisArg) { + return apply(this, "forEach", fn, thisArg, void 0, arguments); + }, + includes(...args) { + return searchProxy(this, "includes", args); + }, + indexOf(...args) { + return searchProxy(this, "indexOf", args); + }, + join(separator) { + return reactiveReadArray(this).join(separator); + }, + // keys() iterator only reads `length`, no optimization required + lastIndexOf(...args) { + return searchProxy(this, "lastIndexOf", args); + }, + map(fn, thisArg) { + return apply(this, "map", fn, thisArg, void 0, arguments); + }, + pop() { + return noTracking(this, "pop"); + }, + push(...args) { + return noTracking(this, "push", args); + }, + reduce(fn, ...args) { + return reduce(this, "reduce", fn, args); + }, + reduceRight(fn, ...args) { + return reduce(this, "reduceRight", fn, args); + }, + shift() { + return noTracking(this, "shift"); + }, + // slice could use ARRAY_ITERATE but also seems to beg for range tracking + some(fn, thisArg) { + return apply(this, "some", fn, thisArg, void 0, arguments); + }, + splice(...args) { + return noTracking(this, "splice", args); + }, + toReversed() { + return reactiveReadArray(this).toReversed(); + }, + toSorted(comparer) { + return reactiveReadArray(this).toSorted(comparer); + }, + toSpliced(...args) { + return reactiveReadArray(this).toSpliced(...args); + }, + unshift(...args) { + return noTracking(this, "unshift", args); + }, + values() { + return iterator(this, "values", (item) => toWrapped(this, item)); + } +}; +function iterator(self2, method, wrapValue) { + const arr = shallowReadArray(self2); + const iter = arr[method](); + if (arr !== self2 && !/* @__PURE__ */ isShallow(self2)) { + iter._next = iter.next; + iter.next = () => { + const result = iter._next(); + if (!result.done) { + result.value = wrapValue(result.value); + } + return result; + }; + } + return iter; +} +const arrayProto = Array.prototype; +function apply(self2, method, fn, thisArg, wrappedRetFn, args) { + const arr = shallowReadArray(self2); + const needsWrap = arr !== self2 && !/* @__PURE__ */ isShallow(self2); + const methodFn = arr[method]; + if (methodFn !== arrayProto[method]) { + const result2 = methodFn.apply(self2, args); + return needsWrap ? toReactive(result2) : result2; + } + let wrappedFn = fn; + if (arr !== self2) { + if (needsWrap) { + wrappedFn = function(item, index) { + return fn.call(this, toWrapped(self2, item), index, self2); + }; + } else if (fn.length > 2) { + wrappedFn = function(item, index) { + return fn.call(this, item, index, self2); + }; + } + } + const result = methodFn.call(arr, wrappedFn, thisArg); + return needsWrap && wrappedRetFn ? wrappedRetFn(result) : result; +} +function reduce(self2, method, fn, args) { + const arr = shallowReadArray(self2); + const needsWrap = arr !== self2 && !/* @__PURE__ */ isShallow(self2); + let wrappedFn = fn; + let wrapInitialAccumulator = false; + if (arr !== self2) { + if (needsWrap) { + wrapInitialAccumulator = args.length === 0; + wrappedFn = function(acc, item, index) { + if (wrapInitialAccumulator) { + wrapInitialAccumulator = false; + acc = toWrapped(self2, acc); + } + return fn.call(this, acc, toWrapped(self2, item), index, self2); + }; + } else if (fn.length > 3) { + wrappedFn = function(acc, item, index) { + return fn.call(this, acc, item, index, self2); + }; + } + } + const result = arr[method](wrappedFn, ...args); + return wrapInitialAccumulator ? toWrapped(self2, result) : result; +} +function searchProxy(self2, method, args) { + const arr = /* @__PURE__ */ toRaw(self2); + track(arr, "iterate", ARRAY_ITERATE_KEY); + const res = arr[method](...args); + if ((res === -1 || res === false) && /* @__PURE__ */ isProxy(args[0])) { + args[0] = /* @__PURE__ */ toRaw(args[0]); + return arr[method](...args); + } + return res; +} +function noTracking(self2, method, args = []) { + pauseTracking(); + startBatch(); + const res = (/* @__PURE__ */ toRaw(self2))[method].apply(self2, args); + endBatch(); + resetTracking(); + return res; +} +const isNonTrackableKeys = /* @__PURE__ */ makeMap(`__proto__,__v_isRef,__isVue`); +const builtInSymbols = new Set( + /* @__PURE__ */ Object.getOwnPropertyNames(Symbol).filter((key) => key !== "arguments" && key !== "caller").map((key) => Symbol[key]).filter(isSymbol) +); +function hasOwnProperty(key) { + if (!isSymbol(key)) key = String(key); + const obj = /* @__PURE__ */ toRaw(this); + track(obj, "has", key); + return obj.hasOwnProperty(key); +} +class BaseReactiveHandler { + constructor(_isReadonly = false, _isShallow = false) { + this._isReadonly = _isReadonly; + this._isShallow = _isShallow; + } + get(target, key, receiver) { + if (key === "__v_skip") return target["__v_skip"]; + const isReadonly2 = this._isReadonly, isShallow2 = this._isShallow; + if (key === "__v_isReactive") { + return !isReadonly2; + } else if (key === "__v_isReadonly") { + return isReadonly2; + } else if (key === "__v_isShallow") { + return isShallow2; + } else if (key === "__v_raw") { + if (receiver === (isReadonly2 ? isShallow2 ? shallowReadonlyMap : readonlyMap : isShallow2 ? shallowReactiveMap : reactiveMap).get(target) || // receiver is not the reactive proxy, but has the same prototype + // this means the receiver is a user proxy of the reactive proxy + Object.getPrototypeOf(target) === Object.getPrototypeOf(receiver)) { + return target; + } + return; + } + const targetIsArray = isArray(target); + if (!isReadonly2) { + let fn; + if (targetIsArray && (fn = arrayInstrumentations[key])) { + return fn; + } + if (key === "hasOwnProperty") { + return hasOwnProperty; + } + } + const res = Reflect.get( + target, + key, + // if this is a proxy wrapping a ref, return methods using the raw ref + // as receiver so that we don't have to call `toRaw` on the ref in all + // its class methods + /* @__PURE__ */ isRef(target) ? target : receiver + ); + if (isSymbol(key) ? builtInSymbols.has(key) : isNonTrackableKeys(key)) { + return res; + } + if (!isReadonly2) { + track(target, "get", key); + } + if (isShallow2) { + return res; + } + if (/* @__PURE__ */ isRef(res)) { + const value = targetIsArray && isIntegerKey(key) ? res : res.value; + return isReadonly2 && isObject$1(value) ? /* @__PURE__ */ readonly(value) : value; + } + if (isObject$1(res)) { + return isReadonly2 ? /* @__PURE__ */ readonly(res) : /* @__PURE__ */ reactive(res); + } + return res; + } +} +class MutableReactiveHandler extends BaseReactiveHandler { + constructor(isShallow2 = false) { + super(false, isShallow2); + } + set(target, key, value, receiver) { + let oldValue = target[key]; + const isArrayWithIntegerKey = isArray(target) && isIntegerKey(key); + if (!this._isShallow) { + const isOldValueReadonly = /* @__PURE__ */ isReadonly(oldValue); + if (!/* @__PURE__ */ isShallow(value) && !/* @__PURE__ */ isReadonly(value)) { + oldValue = /* @__PURE__ */ toRaw(oldValue); + value = /* @__PURE__ */ toRaw(value); + } + if (!isArrayWithIntegerKey && /* @__PURE__ */ isRef(oldValue) && !/* @__PURE__ */ isRef(value)) { + if (isOldValueReadonly) { + return true; + } else { + oldValue.value = value; + return true; + } + } + } + const hadKey = isArrayWithIntegerKey ? Number(key) < target.length : hasOwn(target, key); + const result = Reflect.set( + target, + key, + value, + /* @__PURE__ */ isRef(target) ? target : receiver + ); + if (target === /* @__PURE__ */ toRaw(receiver) && result) { + if (!hadKey) { + trigger(target, "add", key, value); + } else if (hasChanged(value, oldValue)) { + trigger(target, "set", key, value); + } + } + return result; + } + deleteProperty(target, key) { + const hadKey = hasOwn(target, key); + target[key]; + const result = Reflect.deleteProperty(target, key); + if (result && hadKey) { + trigger(target, "delete", key, void 0); + } + return result; + } + has(target, key) { + const result = Reflect.has(target, key); + if (!isSymbol(key) || !builtInSymbols.has(key)) { + track(target, "has", key); + } + return result; + } + ownKeys(target) { + track( + target, + "iterate", + isArray(target) ? "length" : ITERATE_KEY + ); + return Reflect.ownKeys(target); + } +} +class ReadonlyReactiveHandler extends BaseReactiveHandler { + constructor(isShallow2 = false) { + super(true, isShallow2); + } + set(target, key) { + return true; + } + deleteProperty(target, key) { + return true; + } +} +const mutableHandlers = /* @__PURE__ */ new MutableReactiveHandler(); +const readonlyHandlers = /* @__PURE__ */ new ReadonlyReactiveHandler(); +const shallowReactiveHandlers = /* @__PURE__ */ new MutableReactiveHandler(true); +const shallowReadonlyHandlers = /* @__PURE__ */ new ReadonlyReactiveHandler(true); +const toShallow = (value) => value; +const getProto = (v) => Reflect.getPrototypeOf(v); +function createIterableMethod(method, isReadonly2, isShallow2) { + return function(...args) { + const target = this["__v_raw"]; + const rawTarget = /* @__PURE__ */ toRaw(target); + const targetIsMap = isMap(rawTarget); + const isPair = method === "entries" || method === Symbol.iterator && targetIsMap; + const isKeyOnly = method === "keys" && targetIsMap; + const innerIterator = target[method](...args); + const wrap = isShallow2 ? toShallow : isReadonly2 ? toReadonly : toReactive; + !isReadonly2 && track( + rawTarget, + "iterate", + isKeyOnly ? MAP_KEY_ITERATE_KEY : ITERATE_KEY + ); + return extend( + // inheriting all iterator properties + Object.create(innerIterator), + { + // iterator protocol + next() { + const { value, done } = innerIterator.next(); + return done ? { value, done } : { + value: isPair ? [wrap(value[0]), wrap(value[1])] : wrap(value), + done + }; + } + } + ); + }; +} +function createReadonlyMethod(type) { + return function(...args) { + return type === "delete" ? false : type === "clear" ? void 0 : this; + }; +} +function createInstrumentations(readonly2, shallow) { + const instrumentations = { + get(key) { + const target = this["__v_raw"]; + const rawTarget = /* @__PURE__ */ toRaw(target); + const rawKey = /* @__PURE__ */ toRaw(key); + if (!readonly2) { + if (hasChanged(key, rawKey)) { + track(rawTarget, "get", key); + } + track(rawTarget, "get", rawKey); + } + const { has } = getProto(rawTarget); + const wrap = shallow ? toShallow : readonly2 ? toReadonly : toReactive; + if (has.call(rawTarget, key)) { + return wrap(target.get(key)); + } else if (has.call(rawTarget, rawKey)) { + return wrap(target.get(rawKey)); + } else if (target !== rawTarget) { + target.get(key); + } + }, + get size() { + const target = this["__v_raw"]; + !readonly2 && track(/* @__PURE__ */ toRaw(target), "iterate", ITERATE_KEY); + return target.size; + }, + has(key) { + const target = this["__v_raw"]; + const rawTarget = /* @__PURE__ */ toRaw(target); + const rawKey = /* @__PURE__ */ toRaw(key); + if (!readonly2) { + if (hasChanged(key, rawKey)) { + track(rawTarget, "has", key); + } + track(rawTarget, "has", rawKey); + } + return key === rawKey ? target.has(key) : target.has(key) || target.has(rawKey); + }, + forEach(callback, thisArg) { + const observed = this; + const target = observed["__v_raw"]; + const rawTarget = /* @__PURE__ */ toRaw(target); + const wrap = shallow ? toShallow : readonly2 ? toReadonly : toReactive; + !readonly2 && track(rawTarget, "iterate", ITERATE_KEY); + return target.forEach((value, key) => { + return callback.call(thisArg, wrap(value), wrap(key), observed); + }); + } + }; + extend( + instrumentations, + readonly2 ? { + add: createReadonlyMethod("add"), + set: createReadonlyMethod("set"), + delete: createReadonlyMethod("delete"), + clear: createReadonlyMethod("clear") + } : { + add(value) { + const target = /* @__PURE__ */ toRaw(this); + const proto = getProto(target); + const rawValue = /* @__PURE__ */ toRaw(value); + const valueToAdd = !shallow && !/* @__PURE__ */ isShallow(value) && !/* @__PURE__ */ isReadonly(value) ? rawValue : value; + const hadKey = proto.has.call(target, valueToAdd) || hasChanged(value, valueToAdd) && proto.has.call(target, value) || hasChanged(rawValue, valueToAdd) && proto.has.call(target, rawValue); + if (!hadKey) { + target.add(valueToAdd); + trigger(target, "add", valueToAdd, valueToAdd); + } + return this; + }, + set(key, value) { + if (!shallow && !/* @__PURE__ */ isShallow(value) && !/* @__PURE__ */ isReadonly(value)) { + value = /* @__PURE__ */ toRaw(value); + } + const target = /* @__PURE__ */ toRaw(this); + const { has, get } = getProto(target); + let hadKey = has.call(target, key); + if (!hadKey) { + key = /* @__PURE__ */ toRaw(key); + hadKey = has.call(target, key); + } + const oldValue = get.call(target, key); + target.set(key, value); + if (!hadKey) { + trigger(target, "add", key, value); + } else if (hasChanged(value, oldValue)) { + trigger(target, "set", key, value); + } + return this; + }, + delete(key) { + const target = /* @__PURE__ */ toRaw(this); + const { has, get } = getProto(target); + let hadKey = has.call(target, key); + if (!hadKey) { + key = /* @__PURE__ */ toRaw(key); + hadKey = has.call(target, key); + } + get ? get.call(target, key) : void 0; + const result = target.delete(key); + if (hadKey) { + trigger(target, "delete", key, void 0); + } + return result; + }, + clear() { + const target = /* @__PURE__ */ toRaw(this); + const hadItems = target.size !== 0; + const result = target.clear(); + if (hadItems) { + trigger( + target, + "clear", + void 0, + void 0 + ); + } + return result; + } + } + ); + const iteratorMethods = [ + "keys", + "values", + "entries", + Symbol.iterator + ]; + iteratorMethods.forEach((method) => { + instrumentations[method] = createIterableMethod(method, readonly2, shallow); + }); + return instrumentations; +} +function createInstrumentationGetter(isReadonly2, shallow) { + const instrumentations = createInstrumentations(isReadonly2, shallow); + return (target, key, receiver) => { + if (key === "__v_isReactive") { + return !isReadonly2; + } else if (key === "__v_isReadonly") { + return isReadonly2; + } else if (key === "__v_raw") { + return target; + } + return Reflect.get( + hasOwn(instrumentations, key) && key in target ? instrumentations : target, + key, + receiver + ); + }; +} +const mutableCollectionHandlers = { + get: /* @__PURE__ */ createInstrumentationGetter(false, false) +}; +const shallowCollectionHandlers = { + get: /* @__PURE__ */ createInstrumentationGetter(false, true) +}; +const readonlyCollectionHandlers = { + get: /* @__PURE__ */ createInstrumentationGetter(true, false) +}; +const shallowReadonlyCollectionHandlers = { + get: /* @__PURE__ */ createInstrumentationGetter(true, true) +}; +const reactiveMap = /* @__PURE__ */ new WeakMap(); +const shallowReactiveMap = /* @__PURE__ */ new WeakMap(); +const readonlyMap = /* @__PURE__ */ new WeakMap(); +const shallowReadonlyMap = /* @__PURE__ */ new WeakMap(); +function targetTypeMap(rawType) { + switch (rawType) { + case "Object": + case "Array": + return 1; + case "Map": + case "Set": + case "WeakMap": + case "WeakSet": + return 2; + default: + return 0; + } +} +// @__NO_SIDE_EFFECTS__ +function reactive(target) { + if (/* @__PURE__ */ isReadonly(target)) { + return target; + } + return createReactiveObject( + target, + false, + mutableHandlers, + mutableCollectionHandlers, + reactiveMap + ); +} +// @__NO_SIDE_EFFECTS__ +function shallowReactive(target) { + return createReactiveObject( + target, + false, + shallowReactiveHandlers, + shallowCollectionHandlers, + shallowReactiveMap + ); +} +// @__NO_SIDE_EFFECTS__ +function readonly(target) { + return createReactiveObject( + target, + true, + readonlyHandlers, + readonlyCollectionHandlers, + readonlyMap + ); +} +// @__NO_SIDE_EFFECTS__ +function shallowReadonly(target) { + return createReactiveObject( + target, + true, + shallowReadonlyHandlers, + shallowReadonlyCollectionHandlers, + shallowReadonlyMap + ); +} +function createReactiveObject(target, isReadonly2, baseHandlers, collectionHandlers, proxyMap) { + if (!isObject$1(target)) { + return target; + } + if (target["__v_raw"] && !(isReadonly2 && target["__v_isReactive"])) { + return target; + } + if (target["__v_skip"] || !Object.isExtensible(target)) { + return target; + } + const existingProxy = proxyMap.get(target); + if (existingProxy) { + return existingProxy; + } + const targetType = targetTypeMap(toRawType(target)); + if (targetType === 0) { + return target; + } + const proxy = new Proxy( + target, + targetType === 2 ? collectionHandlers : baseHandlers + ); + proxyMap.set(target, proxy); + return proxy; +} +// @__NO_SIDE_EFFECTS__ +function isReactive(value) { + if (/* @__PURE__ */ isReadonly(value)) { + return /* @__PURE__ */ isReactive(value["__v_raw"]); + } + return !!(value && value["__v_isReactive"]); +} +// @__NO_SIDE_EFFECTS__ +function isReadonly(value) { + return !!(value && value["__v_isReadonly"]); +} +// @__NO_SIDE_EFFECTS__ +function isShallow(value) { + return !!(value && value["__v_isShallow"]); +} +// @__NO_SIDE_EFFECTS__ +function isProxy(value) { + return value ? !!value["__v_raw"] : false; +} +// @__NO_SIDE_EFFECTS__ +function toRaw(observed) { + const raw = observed && observed["__v_raw"]; + return raw ? /* @__PURE__ */ toRaw(raw) : observed; +} +function markRaw(value) { + if (!hasOwn(value, "__v_skip") && Object.isExtensible(value)) { + def(value, "__v_skip", true); + } + return value; +} +const toReactive = (value) => isObject$1(value) ? /* @__PURE__ */ reactive(value) : value; +const toReadonly = (value) => isObject$1(value) ? /* @__PURE__ */ readonly(value) : value; +// @__NO_SIDE_EFFECTS__ +function isRef(r) { + return r ? r["__v_isRef"] === true : false; +} +// @__NO_SIDE_EFFECTS__ +function ref(value) { + return createRef(value, false); +} +// @__NO_SIDE_EFFECTS__ +function shallowRef(value) { + return createRef(value, true); +} +function createRef(rawValue, shallow) { + if (/* @__PURE__ */ isRef(rawValue)) { + return rawValue; + } + return new RefImpl(rawValue, shallow); +} +class RefImpl { + constructor(value, isShallow2) { + this.dep = new Dep(); + this["__v_isRef"] = true; + this["__v_isShallow"] = false; + this._rawValue = isShallow2 ? value : /* @__PURE__ */ toRaw(value); + this._value = isShallow2 ? value : toReactive(value); + this["__v_isShallow"] = isShallow2; + } + get value() { + { + this.dep.track(); + } + return this._value; + } + set value(newValue) { + const oldValue = this._rawValue; + const useDirectValue = this["__v_isShallow"] || /* @__PURE__ */ isShallow(newValue) || /* @__PURE__ */ isReadonly(newValue); + newValue = useDirectValue ? newValue : /* @__PURE__ */ toRaw(newValue); + if (hasChanged(newValue, oldValue)) { + this._rawValue = newValue; + this._value = useDirectValue ? newValue : toReactive(newValue); + { + this.dep.trigger(); + } + } + } +} +function unref(ref2) { + return /* @__PURE__ */ isRef(ref2) ? ref2.value : ref2; +} +function toValue(source) { + return isFunction(source) ? source() : unref(source); +} +const shallowUnwrapHandlers = { + get: (target, key, receiver) => key === "__v_raw" ? target : unref(Reflect.get(target, key, receiver)), + set: (target, key, value, receiver) => { + const oldValue = target[key]; + if (/* @__PURE__ */ isRef(oldValue) && !/* @__PURE__ */ isRef(value)) { + oldValue.value = value; + return true; + } else { + return Reflect.set(target, key, value, receiver); + } + } +}; +function proxyRefs(objectWithRefs) { + return /* @__PURE__ */ isReactive(objectWithRefs) ? objectWithRefs : new Proxy(objectWithRefs, shallowUnwrapHandlers); +} +class CustomRefImpl { + constructor(factory) { + this["__v_isRef"] = true; + this._value = void 0; + const dep = this.dep = new Dep(); + const { get, set } = factory(dep.track.bind(dep), dep.trigger.bind(dep)); + this._get = get; + this._set = set; + } + get value() { + return this._value = this._get(); + } + set value(newVal) { + this._set(newVal); + } +} +function customRef(factory) { + return new CustomRefImpl(factory); +} +class ObjectRefImpl { + constructor(_object, key, _defaultValue) { + this._object = _object; + this._defaultValue = _defaultValue; + this["__v_isRef"] = true; + this._value = void 0; + this._key = isSymbol(key) ? key : String(key); + this._raw = /* @__PURE__ */ toRaw(_object); + let shallow = true; + let obj = _object; + if (!isArray(_object) || isSymbol(this._key) || !isIntegerKey(this._key)) { + do { + shallow = !/* @__PURE__ */ isProxy(obj) || /* @__PURE__ */ isShallow(obj); + } while (shallow && (obj = obj["__v_raw"])); + } + this._shallow = shallow; + } + get value() { + let val = this._object[this._key]; + if (this._shallow) { + val = unref(val); + } + return this._value = val === void 0 ? this._defaultValue : val; + } + set value(newVal) { + if (this._shallow && /* @__PURE__ */ isRef(this._raw[this._key])) { + const nestedRef = this._object[this._key]; + if (/* @__PURE__ */ isRef(nestedRef)) { + nestedRef.value = newVal; + return; + } + } + this._object[this._key] = newVal; + } + get dep() { + return getDepFromReactive(this._raw, this._key); + } +} +class GetterRefImpl { + constructor(_getter) { + this._getter = _getter; + this["__v_isRef"] = true; + this["__v_isReadonly"] = true; + this._value = void 0; + } + get value() { + return this._value = this._getter(); + } +} +// @__NO_SIDE_EFFECTS__ +function toRef$1(source, key, defaultValue) { + if (/* @__PURE__ */ isRef(source)) { + return source; + } else if (isFunction(source)) { + return new GetterRefImpl(source); + } else if (isObject$1(source) && arguments.length > 1) { + return propertyToRef(source, key, defaultValue); + } else { + return /* @__PURE__ */ ref(source); + } +} +function propertyToRef(source, key, defaultValue) { + return new ObjectRefImpl(source, key, defaultValue); +} +class ComputedRefImpl { + constructor(fn, setter, isSSR) { + this.fn = fn; + this.setter = setter; + this._value = void 0; + this.dep = new Dep(this); + this.__v_isRef = true; + this.deps = void 0; + this.depsTail = void 0; + this.flags = 16; + this.globalVersion = globalVersion - 1; + this.next = void 0; + this.effect = this; + this["__v_isReadonly"] = !setter; + this.isSSR = isSSR; + } + /** + * @internal + */ + notify() { + this.flags |= 16; + if (!(this.flags & 8) && // avoid infinite self recursion + activeSub !== this) { + batch(this, true); + return true; + } + } + get value() { + const link2 = this.dep.track(); + refreshComputed(this); + if (link2) { + link2.version = this.dep.version; + } + return this._value; + } + set value(newValue) { + if (this.setter) { + this.setter(newValue); + } + } +} +// @__NO_SIDE_EFFECTS__ +function computed$1(getterOrOptions, debugOptions, isSSR = false) { + let getter; + let setter; + if (isFunction(getterOrOptions)) { + getter = getterOrOptions; + } else { + getter = getterOrOptions.get; + setter = getterOrOptions.set; + } + const cRef = new ComputedRefImpl(getter, setter, isSSR); + return cRef; +} +const INITIAL_WATCHER_VALUE = {}; +const cleanupMap = /* @__PURE__ */ new WeakMap(); +let activeWatcher = void 0; +function onWatcherCleanup(cleanupFn, failSilently = false, owner = activeWatcher) { + if (owner) { + let cleanups = cleanupMap.get(owner); + if (!cleanups) cleanupMap.set(owner, cleanups = []); + cleanups.push(cleanupFn); + } +} +function watch$1(source, cb, options = EMPTY_OBJ) { + const { immediate, deep, once, scheduler, augmentJob, call } = options; + const reactiveGetter = (source2) => { + if (deep) return source2; + if (/* @__PURE__ */ isShallow(source2) || deep === false || deep === 0) + return traverse(source2, 1); + return traverse(source2); + }; + let effect2; + let getter; + let cleanup; + let boundCleanup; + let forceTrigger = false; + let isMultiSource = false; + if (/* @__PURE__ */ isRef(source)) { + getter = () => source.value; + forceTrigger = /* @__PURE__ */ isShallow(source); + } else if (/* @__PURE__ */ isReactive(source)) { + getter = () => reactiveGetter(source); + forceTrigger = true; + } else if (isArray(source)) { + isMultiSource = true; + forceTrigger = source.some((s) => /* @__PURE__ */ isReactive(s) || /* @__PURE__ */ isShallow(s)); + getter = () => source.map((s) => { + if (/* @__PURE__ */ isRef(s)) { + return s.value; + } else if (/* @__PURE__ */ isReactive(s)) { + return reactiveGetter(s); + } else if (isFunction(s)) { + return call ? call(s, 2) : s(); + } else ; + }); + } else if (isFunction(source)) { + if (cb) { + getter = call ? () => call(source, 2) : source; + } else { + getter = () => { + if (cleanup) { + pauseTracking(); + try { + cleanup(); + } finally { + resetTracking(); + } + } + const currentEffect = activeWatcher; + activeWatcher = effect2; + try { + return call ? call(source, 3, [boundCleanup]) : source(boundCleanup); + } finally { + activeWatcher = currentEffect; + } + }; + } + } else { + getter = NOOP; + } + if (cb && deep) { + const baseGetter = getter; + const depth = deep === true ? Infinity : deep; + getter = () => traverse(baseGetter(), depth); + } + const scope = getCurrentScope(); + const watchHandle = () => { + effect2.stop(); + if (scope && scope.active) { + remove(scope.effects, effect2); + } + }; + if (once && cb) { + const _cb = cb; + cb = (...args) => { + const res = _cb(...args); + watchHandle(); + return res; + }; + } + let oldValue = isMultiSource ? new Array(source.length).fill(INITIAL_WATCHER_VALUE) : INITIAL_WATCHER_VALUE; + const job = (immediateFirstRun) => { + if (!(effect2.flags & 1) || !effect2.dirty && !immediateFirstRun) { + return; + } + if (cb) { + const newValue = effect2.run(); + if (immediateFirstRun || deep || forceTrigger || (isMultiSource ? newValue.some((v, i) => hasChanged(v, oldValue[i])) : hasChanged(newValue, oldValue))) { + if (cleanup) { + cleanup(); + } + const currentWatcher = activeWatcher; + activeWatcher = effect2; + try { + const args = [ + newValue, + // pass undefined as the old value when it's changed for the first time + oldValue === INITIAL_WATCHER_VALUE ? void 0 : isMultiSource && oldValue[0] === INITIAL_WATCHER_VALUE ? [] : oldValue, + boundCleanup + ]; + oldValue = newValue; + call ? call(cb, 3, args) : ( + // @ts-expect-error + cb(...args) + ); + } finally { + activeWatcher = currentWatcher; + } + } + } else { + effect2.run(); + } + }; + if (augmentJob) { + augmentJob(job); + } + effect2 = new ReactiveEffect(getter); + effect2.scheduler = scheduler ? () => scheduler(job, false) : job; + boundCleanup = (fn) => onWatcherCleanup(fn, false, effect2); + cleanup = effect2.onStop = () => { + const cleanups = cleanupMap.get(effect2); + if (cleanups) { + if (call) { + call(cleanups, 4); + } else { + for (const cleanup2 of cleanups) cleanup2(); + } + cleanupMap.delete(effect2); + } + }; + if (cb) { + if (immediate) { + job(true); + } else { + oldValue = effect2.run(); + } + } else if (scheduler) { + scheduler(job.bind(null, true), true); + } else { + effect2.run(); + } + watchHandle.pause = effect2.pause.bind(effect2); + watchHandle.resume = effect2.resume.bind(effect2); + watchHandle.stop = watchHandle; + return watchHandle; +} +function traverse(value, depth = Infinity, seen2) { + if (depth <= 0 || !isObject$1(value) || value["__v_skip"]) { + return value; + } + seen2 = seen2 || /* @__PURE__ */ new Map(); + if ((seen2.get(value) || 0) >= depth) { + return value; + } + seen2.set(value, depth); + depth--; + if (/* @__PURE__ */ isRef(value)) { + traverse(value.value, depth, seen2); + } else if (isArray(value)) { + for (let i = 0; i < value.length; i++) { + traverse(value[i], depth, seen2); + } + } else if (isSet(value) || isMap(value)) { + value.forEach((v) => { + traverse(v, depth, seen2); + }); + } else if (isPlainObject(value)) { + for (const key in value) { + traverse(value[key], depth, seen2); + } + for (const key of Object.getOwnPropertySymbols(value)) { + if (Object.prototype.propertyIsEnumerable.call(value, key)) { + traverse(value[key], depth, seen2); + } + } + } + return value; +} +/** +* @vue/runtime-core v3.5.39 +* (c) 2018-present Yuxi (Evan) You and Vue contributors +* @license MIT +**/ +const stack = []; +let isWarning = false; +function warn$1(msg, ...args) { + if (isWarning) return; + isWarning = true; + pauseTracking(); + const instance = stack.length ? stack[stack.length - 1].component : null; + const appWarnHandler = instance && instance.appContext.config.warnHandler; + const trace = getComponentTrace(); + if (appWarnHandler) { + callWithErrorHandling( + appWarnHandler, + instance, + 11, + [ + // eslint-disable-next-line no-restricted-syntax + msg + args.map((a) => { + var _a, _b; + return (_b = (_a = a.toString) == null ? void 0 : _a.call(a)) != null ? _b : JSON.stringify(a); + }).join(""), + instance && instance.proxy, + trace.map( + ({ vnode }) => `at <${formatComponentName(instance, vnode.type)}>` + ).join("\n"), + trace + ] + ); + } else { + const warnArgs = [`[Vue warn]: ${msg}`, ...args]; + if (trace.length && // avoid spamming console during tests + true) { + warnArgs.push(` +`, ...formatTrace(trace)); + } + console.warn(...warnArgs); + } + resetTracking(); + isWarning = false; +} +function getComponentTrace() { + let currentVNode = stack[stack.length - 1]; + if (!currentVNode) { + return []; + } + const normalizedStack = []; + while (currentVNode) { + const last = normalizedStack[0]; + if (last && last.vnode === currentVNode) { + last.recurseCount++; + } else { + normalizedStack.push({ + vnode: currentVNode, + recurseCount: 0 + }); + } + const parentInstance = currentVNode.component && currentVNode.component.parent; + currentVNode = parentInstance && parentInstance.vnode; + } + return normalizedStack; +} +function formatTrace(trace) { + const logs = []; + trace.forEach((entry, i) => { + logs.push(...i === 0 ? [] : [` +`], ...formatTraceEntry(entry)); + }); + return logs; +} +function formatTraceEntry({ vnode, recurseCount }) { + const postfix = recurseCount > 0 ? `... (${recurseCount} recursive calls)` : ``; + const isRoot = vnode.component ? vnode.component.parent == null : false; + const open = ` at <${formatComponentName( + vnode.component, + vnode.type, + isRoot + )}`; + const close = `>` + postfix; + return vnode.props ? [open, ...formatProps(vnode.props), close] : [open + close]; +} +function formatProps(props) { + const res = []; + const keys = Object.keys(props); + keys.slice(0, 3).forEach((key) => { + res.push(...formatProp(key, props[key])); + }); + if (keys.length > 3) { + res.push(` ...`); + } + return res; +} +function formatProp(key, value, raw) { + if (isString(value)) { + value = JSON.stringify(value); + return raw ? value : [`${key}=${value}`]; + } else if (typeof value === "number" || typeof value === "boolean" || value == null) { + return raw ? value : [`${key}=${value}`]; + } else if (/* @__PURE__ */ isRef(value)) { + value = formatProp(key, /* @__PURE__ */ toRaw(value.value), true); + return raw ? value : [`${key}=Ref<`, value, `>`]; + } else if (isFunction(value)) { + return [`${key}=fn${value.name ? `<${value.name}>` : ``}`]; + } else { + value = /* @__PURE__ */ toRaw(value); + return raw ? value : [`${key}=`, value]; + } +} +function callWithErrorHandling(fn, instance, type, args) { + try { + return args ? fn(...args) : fn(); + } catch (err) { + handleError(err, instance, type); + } +} +function callWithAsyncErrorHandling(fn, instance, type, args) { + if (isFunction(fn)) { + const res = callWithErrorHandling(fn, instance, type, args); + if (res && isPromise(res)) { + res.catch((err) => { + handleError(err, instance, type); + }); + } + return res; + } + if (isArray(fn)) { + const values = []; + for (let i = 0; i < fn.length; i++) { + values.push(callWithAsyncErrorHandling(fn[i], instance, type, args)); + } + return values; + } +} +function handleError(err, instance, type, throwInDev = true) { + const contextVNode = instance ? instance.vnode : null; + const { errorHandler, throwUnhandledErrorInProduction } = instance && instance.appContext.config || EMPTY_OBJ; + if (instance) { + let cur = instance.parent; + const exposedInstance = instance.proxy; + const errorInfo = `https://vuejs.org/error-reference/#runtime-${type}`; + while (cur) { + const errorCapturedHooks = cur.ec; + if (errorCapturedHooks) { + for (let i = 0; i < errorCapturedHooks.length; i++) { + if (errorCapturedHooks[i](err, exposedInstance, errorInfo) === false) { + return; + } + } + } + cur = cur.parent; + } + if (errorHandler) { + pauseTracking(); + callWithErrorHandling(errorHandler, null, 10, [ + err, + exposedInstance, + errorInfo + ]); + resetTracking(); + return; + } + } + logError(err, type, contextVNode, throwInDev, throwUnhandledErrorInProduction); +} +function logError(err, type, contextVNode, throwInDev = true, throwInProd = false) { + if (throwInProd) { + throw err; + } else { + console.error(err); + } +} +const queue = []; +let flushIndex = -1; +const pendingPostFlushCbs = []; +let activePostFlushCbs = null; +let postFlushIndex = 0; +const resolvedPromise = /* @__PURE__ */ Promise.resolve(); +let currentFlushPromise = null; +function nextTick(fn) { + const p2 = currentFlushPromise || resolvedPromise; + return fn ? p2.then(this ? fn.bind(this) : fn) : p2; +} +function findInsertionIndex(id) { + let start = flushIndex + 1; + let end = queue.length; + while (start < end) { + const middle = start + end >>> 1; + const middleJob = queue[middle]; + const middleJobId = getId(middleJob); + if (middleJobId < id || middleJobId === id && middleJob.flags & 2) { + start = middle + 1; + } else { + end = middle; + } + } + return start; +} +function queueJob(job) { + if (!(job.flags & 1)) { + const jobId = getId(job); + const lastJob = queue[queue.length - 1]; + if (!lastJob || // fast path when the job id is larger than the tail + !(job.flags & 2) && jobId >= getId(lastJob)) { + queue.push(job); + } else { + queue.splice(findInsertionIndex(jobId), 0, job); + } + job.flags |= 1; + queueFlush(); + } +} +function queueFlush() { + if (!currentFlushPromise) { + currentFlushPromise = resolvedPromise.then(flushJobs); + } +} +function queuePostFlushCb(cb) { + if (!isArray(cb)) { + if (activePostFlushCbs && cb.id === -1) { + activePostFlushCbs.splice(postFlushIndex + 1, 0, cb); + } else if (!(cb.flags & 1)) { + pendingPostFlushCbs.push(cb); + cb.flags |= 1; + } + } else { + pendingPostFlushCbs.push(...cb); + } + queueFlush(); +} +function flushPreFlushCbs(instance, seen2, i = flushIndex + 1) { + for (; i < queue.length; i++) { + const cb = queue[i]; + if (cb && cb.flags & 2) { + if (instance && cb.id !== instance.uid) { + continue; + } + queue.splice(i, 1); + i--; + if (cb.flags & 4) { + cb.flags &= -2; + } + cb(); + if (!(cb.flags & 4)) { + cb.flags &= -2; + } + } + } +} +function flushPostFlushCbs(seen2) { + if (pendingPostFlushCbs.length) { + const deduped = [...new Set(pendingPostFlushCbs)].sort( + (a, b) => getId(a) - getId(b) + ); + pendingPostFlushCbs.length = 0; + if (activePostFlushCbs) { + activePostFlushCbs.push(...deduped); + return; + } + activePostFlushCbs = deduped; + for (postFlushIndex = 0; postFlushIndex < activePostFlushCbs.length; postFlushIndex++) { + const cb = activePostFlushCbs[postFlushIndex]; + if (cb.flags & 4) { + cb.flags &= -2; + } + if (!(cb.flags & 8)) cb(); + cb.flags &= -2; + } + activePostFlushCbs = null; + postFlushIndex = 0; + } +} +const getId = (job) => job.id == null ? job.flags & 2 ? -1 : Infinity : job.id; +function flushJobs(seen2) { + try { + for (flushIndex = 0; flushIndex < queue.length; flushIndex++) { + const job = queue[flushIndex]; + if (job && !(job.flags & 8)) { + if (false) ; + if (job.flags & 4) { + job.flags &= ~1; + } + callWithErrorHandling( + job, + job.i, + job.i ? 15 : 14 + ); + if (!(job.flags & 4)) { + job.flags &= ~1; + } + } + } + } finally { + for (; flushIndex < queue.length; flushIndex++) { + const job = queue[flushIndex]; + if (job) { + job.flags &= -2; + } + } + flushIndex = -1; + queue.length = 0; + flushPostFlushCbs(); + currentFlushPromise = null; + if (queue.length || pendingPostFlushCbs.length) { + flushJobs(); + } + } +} +let currentRenderingInstance = null; +let currentScopeId = null; +function setCurrentRenderingInstance(instance) { + const prev = currentRenderingInstance; + currentRenderingInstance = instance; + currentScopeId = instance && instance.type.__scopeId || null; + return prev; +} +function withCtx(fn, ctx = currentRenderingInstance, isNonScopedSlot) { + if (!ctx) return fn; + if (fn._n) { + return fn; + } + const renderFnWithContext = (...args) => { + if (renderFnWithContext._d) { + setBlockTracking(-1); + } + const prevInstance = setCurrentRenderingInstance(ctx); + let res; + try { + res = fn(...args); + } finally { + setCurrentRenderingInstance(prevInstance); + if (renderFnWithContext._d) { + setBlockTracking(1); + } + } + return res; + }; + renderFnWithContext._n = true; + renderFnWithContext._c = true; + renderFnWithContext._d = true; + return renderFnWithContext; +} +function withDirectives(vnode, directives) { + if (currentRenderingInstance === null) { + return vnode; + } + const instance = getComponentPublicInstance(currentRenderingInstance); + const bindings = vnode.dirs || (vnode.dirs = []); + for (let i = 0; i < directives.length; i++) { + let [dir, value, arg, modifiers = EMPTY_OBJ] = directives[i]; + if (dir) { + if (isFunction(dir)) { + dir = { + mounted: dir, + updated: dir + }; + } + if (dir.deep) { + traverse(value); + } + bindings.push({ + dir, + instance, + value, + oldValue: void 0, + arg, + modifiers + }); + } + } + return vnode; +} +function invokeDirectiveHook(vnode, prevVNode, instance, name) { + const bindings = vnode.dirs; + const oldBindings = prevVNode && prevVNode.dirs; + for (let i = 0; i < bindings.length; i++) { + const binding = bindings[i]; + if (oldBindings) { + binding.oldValue = oldBindings[i].value; + } + let hook = binding.dir[name]; + if (hook) { + pauseTracking(); + callWithAsyncErrorHandling(hook, instance, 8, [ + vnode.el, + binding, + vnode, + prevVNode + ]); + resetTracking(); + } + } +} +function provide(key, value) { + if (currentInstance) { + let provides = currentInstance.provides; + const parentProvides = currentInstance.parent && currentInstance.parent.provides; + if (parentProvides === provides) { + provides = currentInstance.provides = Object.create(parentProvides); + } + provides[key] = value; + } +} +function inject(key, defaultValue, treatDefaultAsFactory = false) { + const instance = getCurrentInstance(); + if (instance || currentApp) { + let provides = currentApp ? currentApp._context.provides : instance ? instance.parent == null || instance.ce ? instance.vnode.appContext && instance.vnode.appContext.provides : instance.parent.provides : void 0; + if (provides && key in provides) { + return provides[key]; + } else if (arguments.length > 1) { + return treatDefaultAsFactory && isFunction(defaultValue) ? defaultValue.call(instance && instance.proxy) : defaultValue; + } else ; + } +} +function hasInjectionContext() { + return !!(getCurrentInstance() || currentApp); +} +const ssrContextKey = /* @__PURE__ */ Symbol.for("v-scx"); +const useSSRContext = () => { + { + const ctx = inject(ssrContextKey); + return ctx; + } +}; +function watchEffect(effect2, options) { + return doWatch(effect2, null, options); +} +function watchPostEffect(effect2, options) { + return doWatch( + effect2, + null, + { flush: "post" } + ); +} +function watch(source, cb, options) { + return doWatch(source, cb, options); +} +function doWatch(source, cb, options = EMPTY_OBJ) { + const { immediate, deep, flush, once } = options; + const baseWatchOptions = extend({}, options); + const runsImmediately = cb && immediate || !cb && flush !== "post"; + let ssrCleanup; + if (isInSSRComponentSetup) { + if (flush === "sync") { + const ctx = useSSRContext(); + ssrCleanup = ctx.__watcherHandles || (ctx.__watcherHandles = []); + } else if (!runsImmediately) { + const watchStopHandle = () => { + }; + watchStopHandle.stop = NOOP; + watchStopHandle.resume = NOOP; + watchStopHandle.pause = NOOP; + return watchStopHandle; + } + } + const instance = currentInstance; + baseWatchOptions.call = (fn, type, args) => callWithAsyncErrorHandling(fn, instance, type, args); + let isPre = false; + if (flush === "post") { + baseWatchOptions.scheduler = (job) => { + queuePostRenderEffect(job, instance && instance.suspense); + }; + } else if (flush !== "sync") { + isPre = true; + baseWatchOptions.scheduler = (job, isFirstRun) => { + if (isFirstRun) { + job(); + } else { + queueJob(job); + } + }; + } + baseWatchOptions.augmentJob = (job) => { + if (cb) { + job.flags |= 4; + } + if (isPre) { + job.flags |= 2; + if (instance) { + job.id = instance.uid; + job.i = instance; + } + } + }; + const watchHandle = watch$1(source, cb, baseWatchOptions); + if (isInSSRComponentSetup) { + if (ssrCleanup) { + ssrCleanup.push(watchHandle); + } else if (runsImmediately) { + watchHandle(); + } + } + return watchHandle; +} +function instanceWatch(source, value, options) { + const publicThis = this.proxy; + const getter = isString(source) ? source.includes(".") ? createPathGetter(publicThis, source) : () => publicThis[source] : source.bind(publicThis, publicThis); + let cb; + if (isFunction(value)) { + cb = value; + } else { + cb = value.handler; + options = value; + } + const reset = setCurrentInstance(this); + const res = doWatch(getter, cb.bind(publicThis), options); + reset(); + return res; +} +function createPathGetter(ctx, path) { + const segments = path.split("."); + return () => { + let cur = ctx; + for (let i = 0; i < segments.length && cur; i++) { + cur = cur[segments[i]]; + } + return cur; + }; +} +const pendingMounts = /* @__PURE__ */ new WeakMap(); +const TeleportEndKey = /* @__PURE__ */ Symbol("_vte"); +const isTeleport = (type) => type.__isTeleport; +const isTeleportDisabled = (props) => props && (props.disabled || props.disabled === ""); +const isTeleportDeferred = (props) => props && (props.defer || props.defer === ""); +const isTargetSVG = (target) => typeof SVGElement !== "undefined" && target instanceof SVGElement; +const isTargetMathML = (target) => typeof MathMLElement === "function" && target instanceof MathMLElement; +const resolveTarget = (props, select) => { + const targetSelector = props && props.to; + if (isString(targetSelector)) { + if (!select) { + return null; + } else { + const target = select(targetSelector); + return target; + } + } else { + return targetSelector; + } +}; +const TeleportImpl = { + name: "Teleport", + __isTeleport: true, + process(n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, internals) { + const { + mc: mountChildren, + pc: patchChildren, + pbc: patchBlockChildren, + o: { insert, querySelector, createText, createComment, parentNode } + } = internals; + const disabled = isTeleportDisabled(n2.props); + let { dynamicChildren } = n2; + const mount = (vnode, container2, anchor2) => { + if (vnode.shapeFlag & 16) { + mountChildren( + vnode.children, + container2, + anchor2, + parentComponent, + parentSuspense, + namespace, + slotScopeIds, + optimized + ); + } + }; + const mountToTarget = (vnode = n2) => { + const disabled2 = isTeleportDisabled(vnode.props); + const target = vnode.target = resolveTarget(vnode.props, querySelector); + const targetAnchor = prepareAnchor(target, vnode, createText, insert); + if (target) { + if (namespace !== "svg" && isTargetSVG(target)) { + namespace = "svg"; + } else if (namespace !== "mathml" && isTargetMathML(target)) { + namespace = "mathml"; + } + if (parentComponent && parentComponent.isCE) { + (parentComponent.ce._teleportTargets || (parentComponent.ce._teleportTargets = /* @__PURE__ */ new Set())).add(target); + } + if (!disabled2) { + mount(vnode, target, targetAnchor); + updateCssVars(vnode, false); + } + } + }; + const queuePendingMount = (vnode) => { + const mountJob = () => { + if (pendingMounts.get(vnode) !== mountJob) return; + pendingMounts.delete(vnode); + if (isTeleportDisabled(vnode.props)) { + const mountContainer = parentNode(vnode.el) || container; + mount(vnode, mountContainer, vnode.anchor); + updateCssVars(vnode, true); + } + mountToTarget(vnode); + }; + pendingMounts.set(vnode, mountJob); + queuePostRenderEffect(mountJob, parentSuspense); + }; + if (n1 == null) { + const placeholder = n2.el = createText(""); + const mainAnchor = n2.anchor = createText(""); + insert(placeholder, container, anchor); + insert(mainAnchor, container, anchor); + if (isTeleportDeferred(n2.props) || parentSuspense && parentSuspense.pendingBranch) { + queuePendingMount(n2); + return; + } + if (disabled) { + mount(n2, container, mainAnchor); + updateCssVars(n2, true); + } + mountToTarget(); + } else { + n2.el = n1.el; + const mainAnchor = n2.anchor = n1.anchor; + const pendingMount = pendingMounts.get(n1); + if (pendingMount) { + pendingMount.flags |= 8; + pendingMounts.delete(n1); + queuePendingMount(n2); + return; + } + n2.targetStart = n1.targetStart; + const target = n2.target = n1.target; + const targetAnchor = n2.targetAnchor = n1.targetAnchor; + const wasDisabled = isTeleportDisabled(n1.props); + const currentContainer = wasDisabled ? container : target; + const currentAnchor = wasDisabled ? mainAnchor : targetAnchor; + if (namespace === "svg" || isTargetSVG(target)) { + namespace = "svg"; + } else if (namespace === "mathml" || isTargetMathML(target)) { + namespace = "mathml"; + } + if (dynamicChildren) { + patchBlockChildren( + n1.dynamicChildren, + dynamicChildren, + currentContainer, + parentComponent, + parentSuspense, + namespace, + slotScopeIds + ); + traverseStaticChildren(n1, n2, true); + } else if (!optimized) { + patchChildren( + n1, + n2, + currentContainer, + currentAnchor, + parentComponent, + parentSuspense, + namespace, + slotScopeIds, + false + ); + } + if (disabled) { + if (!wasDisabled) { + moveTeleport( + n2, + container, + mainAnchor, + internals, + 1 + ); + } else { + if (n2.props && n1.props && n2.props.to !== n1.props.to) { + n2.props.to = n1.props.to; + } + } + } else { + if ((n2.props && n2.props.to) !== (n1.props && n1.props.to)) { + const nextTarget = resolveTarget(n2.props, querySelector); + if (nextTarget) { + n2.target = nextTarget; + moveTeleport( + n2, + nextTarget, + null, + internals, + 0 + ); + } + } else if (wasDisabled) { + moveTeleport( + n2, + target, + targetAnchor, + internals, + 1 + ); + } + } + updateCssVars(n2, disabled); + } + }, + remove(vnode, parentComponent, parentSuspense, { um: unmount, o: { remove: hostRemove } }, doRemove) { + const { + shapeFlag, + children, + anchor, + targetStart, + targetAnchor, + target, + props + } = vnode; + const disabled = isTeleportDisabled(props); + const shouldRemove = doRemove || !disabled; + const pendingMount = pendingMounts.get(vnode); + if (pendingMount) { + pendingMount.flags |= 8; + pendingMounts.delete(vnode); + } + if (target) { + hostRemove(targetStart); + hostRemove(targetAnchor); + } + doRemove && hostRemove(anchor); + if (!pendingMount && (disabled || target) && shapeFlag & 16) { + for (let i = 0; i < children.length; i++) { + const child = children[i]; + unmount( + child, + parentComponent, + parentSuspense, + shouldRemove, + !!child.dynamicChildren + ); + } + } + }, + move: moveTeleport, + hydrate: hydrateTeleport +}; +function moveTeleport(vnode, container, parentAnchor, { o: { insert }, m: move }, moveType = 2) { + if (moveType === 0) { + insert(vnode.targetAnchor, container, parentAnchor); + } + const { el, anchor, shapeFlag, children, props } = vnode; + const isReorder = moveType === 2; + if (isReorder) { + insert(el, container, parentAnchor); + } + if (!pendingMounts.has(vnode) && (!isReorder || isTeleportDisabled(props))) { + if (shapeFlag & 16) { + for (let i = 0; i < children.length; i++) { + move( + children[i], + container, + parentAnchor, + 2 + ); + } + } + } + if (isReorder) { + insert(anchor, container, parentAnchor); + } +} +function hydrateTeleport(node, vnode, parentComponent, parentSuspense, slotScopeIds, optimized, { + o: { nextSibling, parentNode, querySelector, insert, createText } +}, hydrateChildren) { + function hydrateAnchor(target2, targetNode) { + let targetAnchor = targetNode; + while (targetAnchor) { + if (targetAnchor && targetAnchor.nodeType === 8) { + if (targetAnchor.data === "teleport start anchor") { + vnode.targetStart = targetAnchor; + } else if (targetAnchor.data === "teleport anchor") { + vnode.targetAnchor = targetAnchor; + target2._lpa = vnode.targetAnchor && nextSibling(vnode.targetAnchor); + break; + } + } + targetAnchor = nextSibling(targetAnchor); + } + } + function hydrateDisabledTeleport(node2, vnode2) { + vnode2.anchor = hydrateChildren( + nextSibling(node2), + vnode2, + parentNode(node2), + parentComponent, + parentSuspense, + slotScopeIds, + optimized + ); + } + const target = vnode.target = resolveTarget( + vnode.props, + querySelector + ); + const disabled = isTeleportDisabled(vnode.props); + if (target) { + const targetNode = target._lpa || target.firstChild; + if (vnode.shapeFlag & 16) { + if (disabled) { + hydrateDisabledTeleport(node, vnode); + hydrateAnchor(target, targetNode); + if (!vnode.targetAnchor) { + prepareAnchor( + target, + vnode, + createText, + insert, + // if target is the same as the main view, insert anchors before current node + // to avoid hydrating mismatch + parentNode(node) === target ? node : null + ); + } + } else { + vnode.anchor = nextSibling(node); + hydrateAnchor(target, targetNode); + if (!vnode.targetAnchor) { + prepareAnchor(target, vnode, createText, insert); + } + hydrateChildren( + targetNode && nextSibling(targetNode), + vnode, + target, + parentComponent, + parentSuspense, + slotScopeIds, + optimized + ); + } + } + updateCssVars(vnode, disabled); + } else if (disabled) { + if (vnode.shapeFlag & 16) { + hydrateDisabledTeleport(node, vnode); + vnode.targetStart = node; + vnode.targetAnchor = nextSibling(node); + } + } + return vnode.anchor && nextSibling(vnode.anchor); +} +const Teleport = TeleportImpl; +function updateCssVars(vnode, isDisabled) { + const ctx = vnode.ctx; + if (ctx && ctx.ut) { + let node, anchor; + if (isDisabled) { + node = vnode.el; + anchor = vnode.anchor; + } else { + node = vnode.targetStart; + anchor = vnode.targetAnchor; + } + while (node && node !== anchor) { + if (node.nodeType === 1) node.setAttribute("data-v-owner", ctx.uid); + node = node.nextSibling; + } + ctx.ut(); + } +} +function prepareAnchor(target, vnode, createText, insert, anchor = null) { + const targetStart = vnode.targetStart = createText(""); + const targetAnchor = vnode.targetAnchor = createText(""); + targetStart[TeleportEndKey] = targetAnchor; + if (target) { + insert(targetStart, target, anchor); + insert(targetAnchor, target, anchor); + } + return targetAnchor; +} +const leaveCbKey = /* @__PURE__ */ Symbol("_leaveCb"); +const enterCbKey = /* @__PURE__ */ Symbol("_enterCb"); +function useTransitionState() { + const state = { + isMounted: false, + isLeaving: false, + isUnmounting: false, + leavingVNodes: /* @__PURE__ */ new Map() + }; + onMounted(() => { + state.isMounted = true; + }); + onBeforeUnmount(() => { + state.isUnmounting = true; + }); + return state; +} +const TransitionHookValidator = [Function, Array]; +const BaseTransitionPropsValidators = { + mode: String, + appear: Boolean, + persisted: Boolean, + // enter + onBeforeEnter: TransitionHookValidator, + onEnter: TransitionHookValidator, + onAfterEnter: TransitionHookValidator, + onEnterCancelled: TransitionHookValidator, + // leave + onBeforeLeave: TransitionHookValidator, + onLeave: TransitionHookValidator, + onAfterLeave: TransitionHookValidator, + onLeaveCancelled: TransitionHookValidator, + // appear + onBeforeAppear: TransitionHookValidator, + onAppear: TransitionHookValidator, + onAfterAppear: TransitionHookValidator, + onAppearCancelled: TransitionHookValidator +}; +const recursiveGetSubtree = (instance) => { + const subTree = instance.subTree; + return subTree.component ? recursiveGetSubtree(subTree.component) : subTree; +}; +const BaseTransitionImpl = { + name: `BaseTransition`, + props: BaseTransitionPropsValidators, + setup(props, { slots }) { + const instance = getCurrentInstance(); + const state = useTransitionState(); + return () => { + const children = slots.default && getTransitionRawChildren(slots.default(), true); + const child = children && children.length ? findNonCommentChild(children) : ( + // Keep explicit default-slot conditionals on the same transition path + // as regular v-if branches, which render a comment placeholder. + instance.subTree ? createCommentVNode() : void 0 + ); + if (!child) { + return; + } + const rawProps = /* @__PURE__ */ toRaw(props); + const { mode } = rawProps; + if (state.isLeaving) { + return emptyPlaceholder(child); + } + const innerChild = getInnerChild$1(child); + if (!innerChild) { + return emptyPlaceholder(child); + } + let enterHooks = resolveTransitionHooks( + innerChild, + rawProps, + state, + instance, + // #11061, ensure enterHooks is fresh after clone + (hooks) => enterHooks = hooks + ); + if (innerChild.type !== Comment) { + setTransitionHooks(innerChild, enterHooks); + } + let oldInnerChild = instance.subTree && getInnerChild$1(instance.subTree); + if (oldInnerChild && oldInnerChild.type !== Comment && !isSameVNodeType(oldInnerChild, innerChild) && recursiveGetSubtree(instance).type !== Comment) { + let leavingHooks = resolveTransitionHooks( + oldInnerChild, + rawProps, + state, + instance + ); + setTransitionHooks(oldInnerChild, leavingHooks); + if (mode === "out-in" && innerChild.type !== Comment) { + state.isLeaving = true; + leavingHooks.afterLeave = () => { + state.isLeaving = false; + if (!(instance.job.flags & 8)) { + instance.update(); + } + delete leavingHooks.afterLeave; + oldInnerChild = void 0; + }; + return emptyPlaceholder(child); + } else if (mode === "in-out" && innerChild.type !== Comment) { + leavingHooks.delayLeave = (el, earlyRemove, delayedLeave) => { + const leavingVNodesCache = getLeavingNodesForType( + state, + oldInnerChild + ); + leavingVNodesCache[String(oldInnerChild.key)] = oldInnerChild; + el[leaveCbKey] = () => { + earlyRemove(); + el[leaveCbKey] = void 0; + delete enterHooks.delayedLeave; + oldInnerChild = void 0; + }; + enterHooks.delayedLeave = () => { + delayedLeave(); + delete enterHooks.delayedLeave; + oldInnerChild = void 0; + }; + }; + } else { + oldInnerChild = void 0; + } + } else if (oldInnerChild) { + oldInnerChild = void 0; + } + return child; + }; + } +}; +function findNonCommentChild(children) { + let child = children[0]; + if (children.length > 1) { + for (const c of children) { + if (c.type !== Comment) { + child = c; + break; + } + } + } + return child; +} +const BaseTransition = BaseTransitionImpl; +function getLeavingNodesForType(state, vnode) { + const { leavingVNodes } = state; + let leavingVNodesCache = leavingVNodes.get(vnode.type); + if (!leavingVNodesCache) { + leavingVNodesCache = /* @__PURE__ */ Object.create(null); + leavingVNodes.set(vnode.type, leavingVNodesCache); + } + return leavingVNodesCache; +} +function resolveTransitionHooks(vnode, props, state, instance, postClone) { + const { + appear, + mode, + persisted = false, + onBeforeEnter, + onEnter, + onAfterEnter, + onEnterCancelled, + onBeforeLeave, + onLeave, + onAfterLeave, + onLeaveCancelled, + onBeforeAppear, + onAppear, + onAfterAppear, + onAppearCancelled + } = props; + const key = String(vnode.key); + const leavingVNodesCache = getLeavingNodesForType(state, vnode); + const callHook2 = (hook, args) => { + hook && callWithAsyncErrorHandling( + hook, + instance, + 9, + args + ); + }; + const callAsyncHook = (hook, args) => { + const done = args[1]; + callHook2(hook, args); + if (isArray(hook)) { + if (hook.every((hook2) => hook2.length <= 1)) done(); + } else if (hook.length <= 1) { + done(); + } + }; + const hooks = { + mode, + persisted, + beforeEnter(el) { + let hook = onBeforeEnter; + if (!state.isMounted) { + if (appear) { + hook = onBeforeAppear || onBeforeEnter; + } else { + return; + } + } + if (el[leaveCbKey]) { + el[leaveCbKey]( + true + /* cancelled */ + ); + } + const leavingVNode = leavingVNodesCache[key]; + if (leavingVNode && isSameVNodeType(vnode, leavingVNode) && leavingVNode.el[leaveCbKey]) { + leavingVNode.el[leaveCbKey](); + } + callHook2(hook, [el]); + }, + enter(el) { + if (leavingVNodesCache[key] === vnode) return; + let hook = onEnter; + let afterHook = onAfterEnter; + let cancelHook = onEnterCancelled; + if (!state.isMounted) { + if (appear) { + hook = onAppear || onEnter; + afterHook = onAfterAppear || onAfterEnter; + cancelHook = onAppearCancelled || onEnterCancelled; + } else { + return; + } + } + let called = false; + el[enterCbKey] = (cancelled) => { + if (called) return; + called = true; + if (cancelled) { + callHook2(cancelHook, [el]); + } else { + callHook2(afterHook, [el]); + } + if (hooks.delayedLeave) { + hooks.delayedLeave(); + } + el[enterCbKey] = void 0; + }; + const done = el[enterCbKey].bind(null, false); + if (hook) { + callAsyncHook(hook, [el, done]); + } else { + done(); + } + }, + leave(el, remove2) { + const key2 = String(vnode.key); + if (el[enterCbKey]) { + el[enterCbKey]( + true + /* cancelled */ + ); + } + if (state.isUnmounting) { + return remove2(); + } + callHook2(onBeforeLeave, [el]); + let called = false; + el[leaveCbKey] = (cancelled) => { + if (called) return; + called = true; + remove2(); + if (cancelled) { + callHook2(onLeaveCancelled, [el]); + } else { + callHook2(onAfterLeave, [el]); + } + el[leaveCbKey] = void 0; + if (leavingVNodesCache[key2] === vnode) { + delete leavingVNodesCache[key2]; + } + }; + const done = el[leaveCbKey].bind(null, false); + leavingVNodesCache[key2] = vnode; + if (onLeave) { + callAsyncHook(onLeave, [el, done]); + } else { + done(); + } + }, + clone(vnode2) { + const hooks2 = resolveTransitionHooks( + vnode2, + props, + state, + instance, + postClone + ); + if (postClone) postClone(hooks2); + return hooks2; + } + }; + return hooks; +} +function emptyPlaceholder(vnode) { + if (isKeepAlive(vnode)) { + vnode = cloneVNode(vnode); + vnode.children = null; + return vnode; + } +} +function getInnerChild$1(vnode) { + if (!isKeepAlive(vnode)) { + if (isTeleport(vnode.type) && vnode.children) { + return findNonCommentChild(vnode.children); + } + return vnode; + } + if (vnode.component) { + return vnode.component.subTree; + } + const { shapeFlag, children } = vnode; + if (children) { + if (shapeFlag & 16) { + return children[0]; + } + if (shapeFlag & 32 && isFunction(children.default)) { + return children.default(); + } + } +} +function setTransitionHooks(vnode, hooks) { + if (vnode.shapeFlag & 6 && vnode.component) { + vnode.transition = hooks; + setTransitionHooks(vnode.component.subTree, hooks); + } else if (vnode.shapeFlag & 128) { + vnode.ssContent.transition = hooks.clone(vnode.ssContent); + vnode.ssFallback.transition = hooks.clone(vnode.ssFallback); + } else { + vnode.transition = hooks; + } +} +function getTransitionRawChildren(children, keepComment = false, parentKey) { + let ret = []; + let keyedFragmentCount = 0; + for (let i = 0; i < children.length; i++) { + let child = children[i]; + const key = parentKey == null ? child.key : String(parentKey) + String(child.key != null ? child.key : i); + if (child.type === Fragment) { + if (child.patchFlag & 128) keyedFragmentCount++; + ret = ret.concat( + getTransitionRawChildren(child.children, keepComment, key) + ); + } else if (keepComment || child.type !== Comment) { + ret.push(key != null ? cloneVNode(child, { key }) : child); + } + } + if (keyedFragmentCount > 1) { + for (let i = 0; i < ret.length; i++) { + ret[i].patchFlag = -2; + } + } + return ret; +} +// @__NO_SIDE_EFFECTS__ +function defineComponent(options, extraOptions) { + return isFunction(options) ? ( + // #8236: extend call and options.name access are considered side-effects + // by Rollup, so we have to wrap it in a pure-annotated IIFE. + /* @__PURE__ */ (() => extend({ name: options.name }, extraOptions, { setup: options }))() + ) : options; +} +function markAsyncBoundary(instance) { + instance.ids = [instance.ids[0] + instance.ids[2]++ + "-", 0, 0]; +} +function isTemplateRefKey(refs, key) { + let desc; + return !!((desc = Object.getOwnPropertyDescriptor(refs, key)) && !desc.configurable); +} +const pendingSetRefMap = /* @__PURE__ */ new WeakMap(); +function setRef(rawRef, oldRawRef, parentSuspense, vnode, isUnmount = false) { + if (isArray(rawRef)) { + rawRef.forEach( + (r, i) => setRef( + r, + oldRawRef && (isArray(oldRawRef) ? oldRawRef[i] : oldRawRef), + parentSuspense, + vnode, + isUnmount + ) + ); + return; + } + if (isAsyncWrapper(vnode) && !isUnmount) { + if (vnode.shapeFlag & 512 && vnode.type.__asyncResolved && vnode.component.subTree.component) { + setRef(rawRef, oldRawRef, parentSuspense, vnode.component.subTree); + } + return; + } + const refValue = vnode.shapeFlag & 4 ? getComponentPublicInstance(vnode.component) : vnode.el; + const value = isUnmount ? null : refValue; + const { i: owner, r: ref3 } = rawRef; + const oldRef = oldRawRef && oldRawRef.r; + const refs = owner.refs === EMPTY_OBJ ? owner.refs = {} : owner.refs; + const setupState = owner.setupState; + const rawSetupState = /* @__PURE__ */ toRaw(setupState); + const canSetSetupRef = setupState === EMPTY_OBJ ? NO : (key) => { + if (isTemplateRefKey(refs, key)) { + return false; + } + return hasOwn(rawSetupState, key); + }; + const canSetRef = (ref22, key) => { + if (key && isTemplateRefKey(refs, key)) { + return false; + } + return true; + }; + if (oldRef != null && oldRef !== ref3) { + invalidatePendingSetRef(oldRawRef); + if (isString(oldRef)) { + refs[oldRef] = null; + if (canSetSetupRef(oldRef)) { + setupState[oldRef] = null; + } + } else if (/* @__PURE__ */ isRef(oldRef)) { + const oldRawRefAtom = oldRawRef; + if (canSetRef(oldRef, oldRawRefAtom.k)) { + oldRef.value = null; + } + if (oldRawRefAtom.k) refs[oldRawRefAtom.k] = null; + } + } + if (isFunction(ref3)) { + pauseTracking(); + try { + callWithErrorHandling(ref3, owner, 12, [value, refs]); + } finally { + resetTracking(); + } + } else { + const _isString = isString(ref3); + const _isRef = /* @__PURE__ */ isRef(ref3); + if (_isString || _isRef) { + const doSet = () => { + if (rawRef.f) { + const existing = _isString ? canSetSetupRef(ref3) ? setupState[ref3] : refs[ref3] : canSetRef() || !rawRef.k ? ref3.value : refs[rawRef.k]; + if (isUnmount) { + isArray(existing) && remove(existing, refValue); + } else { + if (!isArray(existing)) { + if (_isString) { + refs[ref3] = [refValue]; + if (canSetSetupRef(ref3)) { + setupState[ref3] = refs[ref3]; + } + } else { + const newVal = [refValue]; + if (canSetRef(ref3, rawRef.k)) { + ref3.value = newVal; + } + if (rawRef.k) refs[rawRef.k] = newVal; + } + } else if (!existing.includes(refValue)) { + existing.push(refValue); + } + } + } else if (_isString) { + refs[ref3] = value; + if (canSetSetupRef(ref3)) { + setupState[ref3] = value; + } + } else if (_isRef) { + if (canSetRef(ref3, rawRef.k)) { + ref3.value = value; + } + if (rawRef.k) refs[rawRef.k] = value; + } else ; + }; + if (value) { + const job = () => { + doSet(); + pendingSetRefMap.delete(rawRef); + }; + job.id = -1; + pendingSetRefMap.set(rawRef, job); + queuePostRenderEffect(job, parentSuspense); + } else { + invalidatePendingSetRef(rawRef); + doSet(); + } + } + } +} +function invalidatePendingSetRef(rawRef) { + const pendingSetRef = pendingSetRefMap.get(rawRef); + if (pendingSetRef) { + pendingSetRef.flags |= 8; + pendingSetRefMap.delete(rawRef); + } +} +let hasLoggedMismatchError = false; +const logMismatchError = () => { + if (hasLoggedMismatchError) { + return; + } + console.error("Hydration completed but contains mismatches."); + hasLoggedMismatchError = true; +}; +const isSVGContainer = (container) => container.namespaceURI.includes("svg") && container.tagName !== "foreignObject"; +const isMathMLContainer = (container) => container.namespaceURI.includes("MathML"); +const getContainerType = (container) => { + if (container.nodeType !== 1) return void 0; + if (isSVGContainer(container)) return "svg"; + if (isMathMLContainer(container)) return "mathml"; + return void 0; +}; +const isComment = (node) => node.nodeType === 8; +function createHydrationFunctions(rendererInternals) { + const { + mt: mountComponent, + p: patch, + o: { + patchProp: patchProp2, + createText, + nextSibling, + parentNode, + remove: remove2, + insert, + createComment + } + } = rendererInternals; + const hydrate = (vnode, container) => { + if (!container.hasChildNodes()) { + warn$1( + `Attempting to hydrate existing markup but container is empty. Performing full mount instead.` + ); + patch(null, vnode, container); + flushPostFlushCbs(); + container._vnode = vnode; + return; + } + hydrateNode(container.firstChild, vnode, null, null, null); + flushPostFlushCbs(); + container._vnode = vnode; + }; + const hydrateNode = (node, vnode, parentComponent, parentSuspense, slotScopeIds, optimized = false) => { + optimized = optimized || !!vnode.dynamicChildren; + const isFragmentStart = isComment(node) && node.data === "["; + const onMismatch = () => handleMismatch( + node, + vnode, + parentComponent, + parentSuspense, + slotScopeIds, + isFragmentStart + ); + const { type, ref: ref3, shapeFlag, patchFlag } = vnode; + let domType = node.nodeType; + vnode.el = node; + if (patchFlag === -2) { + optimized = false; + vnode.dynamicChildren = null; + } + let nextNode = null; + switch (type) { + case Text: + if (domType !== 3) { + if (vnode.children === "") { + insert(vnode.el = createText(""), parentNode(node), node); + nextNode = node; + } else { + nextNode = onMismatch(); + } + } else { + if (node.data !== vnode.children) { + warn$1( + `Hydration text mismatch in`, + node.parentNode, + ` + - rendered on server: ${JSON.stringify( + node.data + )} + - expected on client: ${JSON.stringify(vnode.children)}` + ); + logMismatchError(); + node.data = vnode.children; + } + nextNode = nextSibling(node); + } + break; + case Comment: + if (isTemplateNode(node)) { + nextNode = nextSibling(node); + replaceNode( + vnode.el = node.content.firstChild, + node, + parentComponent + ); + } else if (domType !== 8 || isFragmentStart) { + nextNode = onMismatch(); + } else { + nextNode = nextSibling(node); + } + break; + case Static: + if (isFragmentStart) { + node = nextSibling(node); + domType = node.nodeType; + } + if (domType === 1 || domType === 3) { + nextNode = node; + const needToAdoptContent = !vnode.children.length; + for (let i = 0; i < vnode.staticCount; i++) { + if (needToAdoptContent) + vnode.children += nextNode.nodeType === 1 ? nextNode.outerHTML : nextNode.data; + if (i === vnode.staticCount - 1) { + vnode.anchor = nextNode; + } + nextNode = nextSibling(nextNode); + } + return isFragmentStart ? nextSibling(nextNode) : nextNode; + } else { + onMismatch(); + } + break; + case Fragment: + if (!isFragmentStart) { + nextNode = onMismatch(); + } else { + nextNode = hydrateFragment( + node, + vnode, + parentComponent, + parentSuspense, + slotScopeIds, + optimized + ); + } + break; + default: + if (shapeFlag & 1) { + if ((domType !== 1 || vnode.type.toLowerCase() !== node.tagName.toLowerCase()) && !isTemplateNode(node)) { + nextNode = onMismatch(); + } else { + nextNode = hydrateElement( + node, + vnode, + parentComponent, + parentSuspense, + slotScopeIds, + optimized + ); + } + } else if (shapeFlag & 6) { + vnode.slotScopeIds = slotScopeIds; + const container = parentNode(node); + if (isFragmentStart) { + nextNode = locateClosingAnchor(node); + } else if (isComment(node) && node.data === "teleport start") { + nextNode = locateClosingAnchor(node, node.data, "teleport end"); + } else { + nextNode = nextSibling(node); + } + mountComponent( + vnode, + container, + null, + parentComponent, + parentSuspense, + getContainerType(container), + optimized + ); + if (isAsyncWrapper(vnode) && !vnode.type.__asyncResolved) { + let subTree; + if (isFragmentStart) { + subTree = createVNode(Fragment); + subTree.anchor = nextNode ? nextNode.previousSibling : container.lastChild; + } else { + subTree = node.nodeType === 3 ? createTextVNode("") : createVNode("div"); + } + subTree.el = node; + vnode.component.subTree = subTree; + } + } else if (shapeFlag & 64) { + if (domType !== 8) { + nextNode = onMismatch(); + } else { + nextNode = vnode.type.hydrate( + node, + vnode, + parentComponent, + parentSuspense, + slotScopeIds, + optimized, + rendererInternals, + hydrateChildren + ); + } + } else if (shapeFlag & 128) { + nextNode = vnode.type.hydrate( + node, + vnode, + parentComponent, + parentSuspense, + getContainerType(parentNode(node)), + slotScopeIds, + optimized, + rendererInternals, + hydrateNode + ); + } else { + warn$1("Invalid HostVNode type:", type, `(${typeof type})`); + } + } + if (ref3 != null) { + setRef(ref3, null, parentSuspense, vnode); + } + return nextNode; + }; + const hydrateElement = (el, vnode, parentComponent, parentSuspense, slotScopeIds, optimized) => { + optimized = optimized || !!vnode.dynamicChildren; + const { + type, + dynamicProps, + props, + patchFlag, + shapeFlag, + dirs, + transition + } = vnode; + const forcePatch = type === "input" || type === "option"; + const hasDynamicProps = !!dynamicProps; + if (forcePatch || hasDynamicProps || patchFlag !== -1) { + if (dirs) { + invokeDirectiveHook(vnode, null, parentComponent, "created"); + } + let needCallTransitionHooks = false; + if (isTemplateNode(el)) { + needCallTransitionHooks = needTransition( + null, + // no need check parentSuspense in hydration + transition + ) && parentComponent && parentComponent.vnode.props && parentComponent.vnode.props.appear; + const content = el.content.firstChild; + if (needCallTransitionHooks) { + const cls = content.getAttribute("class"); + if (cls) content.$cls = cls; + transition.beforeEnter(content); + } + replaceNode(content, el, parentComponent); + vnode.el = el = content; + } + if (shapeFlag & 16 && // skip if element has innerHTML / textContent + !(props && (props.innerHTML || props.textContent))) { + let next = hydrateChildren( + el.firstChild, + vnode, + el, + parentComponent, + parentSuspense, + slotScopeIds, + optimized + ); + if (next && !isMismatchAllowed( + el, + 1 + /* CHILDREN */ + )) { + warn$1( + `Hydration children mismatch on`, + el, + ` +Server rendered element contains more child nodes than client vdom.` + ); + logMismatchError(); + } + while (next) { + const cur = next; + next = next.nextSibling; + remove2(cur); + } + } else if (shapeFlag & 8) { + let clientText = vnode.children; + if (clientText[0] === "\n" && (el.tagName === "PRE" || el.tagName === "TEXTAREA")) { + clientText = clientText.slice(1); + } + const { textContent } = el; + if (textContent !== clientText && // innerHTML normalize \r\n or \r into a single \n in the DOM + textContent !== clientText.replace(/\r\n|\r/g, "\n")) { + if (!isMismatchAllowed( + el, + 0 + /* TEXT */ + )) { + warn$1( + `Hydration text content mismatch on`, + el, + ` + - rendered on server: ${textContent} + - expected on client: ${clientText}` + ); + logMismatchError(); + } + el.textContent = vnode.children; + } + } + if (props) { + { + const isCustomElement = el.tagName.includes("-"); + for (const key in props) { + if ( + // #11189 skip if this node has directives that have created hooks + // as it could have mutated the DOM in any possible way + !(dirs && dirs.some((d) => d.dir.created)) && propHasMismatch(el, key, props[key], vnode, parentComponent) + ) { + logMismatchError(); + } + if (forcePatch && (key.endsWith("value") || key === "indeterminate") || isOn(key) && !isReservedProp(key) || // force hydrate v-bind with .prop modifiers + key[0] === "." || isCustomElement && !isReservedProp(key) || dynamicProps && dynamicProps.includes(key)) { + patchProp2(el, key, null, props[key], void 0, parentComponent); + } + } + } + } + let vnodeHooks; + if (vnodeHooks = props && props.onVnodeBeforeMount) { + invokeVNodeHook(vnodeHooks, parentComponent, vnode); + } + if (dirs) { + invokeDirectiveHook(vnode, null, parentComponent, "beforeMount"); + } + if ((vnodeHooks = props && props.onVnodeMounted) || dirs || needCallTransitionHooks) { + queueEffectWithSuspense(() => { + vnodeHooks && invokeVNodeHook(vnodeHooks, parentComponent, vnode); + needCallTransitionHooks && transition.enter(el); + dirs && invokeDirectiveHook(vnode, null, parentComponent, "mounted"); + }, parentSuspense); + } + } + return el.nextSibling; + }; + const hydrateChildren = (node, parentVNode, container, parentComponent, parentSuspense, slotScopeIds, optimized) => { + optimized = optimized || !!parentVNode.dynamicChildren; + const children = parentVNode.children; + const l = children.length; + let hasCheckedMismatch = false; + for (let i = 0; i < l; i++) { + const vnode = optimized ? children[i] : children[i] = normalizeVNode(children[i]); + const isText = vnode.type === Text; + if (node) { + if (isText && !optimized) { + if (i + 1 < l && normalizeVNode(children[i + 1]).type === Text) { + insert( + createText( + node.data.slice(vnode.children.length) + ), + container, + nextSibling(node) + ); + node.data = vnode.children; + } + } + node = hydrateNode( + node, + vnode, + parentComponent, + parentSuspense, + slotScopeIds, + optimized + ); + } else if (isText && !vnode.children) { + insert(vnode.el = createText(""), container); + } else { + if (!hasCheckedMismatch) { + hasCheckedMismatch = true; + if (!isMismatchAllowed( + container, + 1 + /* CHILDREN */ + )) { + warn$1( + `Hydration children mismatch on`, + container, + ` +Server rendered element contains fewer child nodes than client vdom.` + ); + logMismatchError(); + } + } + patch( + null, + vnode, + container, + null, + parentComponent, + parentSuspense, + getContainerType(container), + slotScopeIds + ); + } + } + return node; + }; + const hydrateFragment = (node, vnode, parentComponent, parentSuspense, slotScopeIds, optimized) => { + const { slotScopeIds: fragmentSlotScopeIds } = vnode; + if (fragmentSlotScopeIds) { + slotScopeIds = slotScopeIds ? slotScopeIds.concat(fragmentSlotScopeIds) : fragmentSlotScopeIds; + } + const container = parentNode(node); + const next = hydrateChildren( + nextSibling(node), + vnode, + container, + parentComponent, + parentSuspense, + slotScopeIds, + optimized + ); + if (next && isComment(next) && next.data === "]") { + return nextSibling(vnode.anchor = next); + } else { + logMismatchError(); + insert(vnode.anchor = createComment(`]`), container, next); + return next; + } + }; + const handleMismatch = (node, vnode, parentComponent, parentSuspense, slotScopeIds, isFragment) => { + if (!isNodeMismatchAllowed(node, vnode)) { + warn$1( + `Hydration node mismatch: +- rendered on server:`, + node, + node.nodeType === 3 ? `(text)` : isComment(node) && node.data === "[" ? `(start of fragment)` : ``, + ` +- expected on client:`, + vnode.type + ); + logMismatchError(); + } + vnode.el = null; + if (isFragment) { + const end = locateClosingAnchor(node); + while (true) { + const next2 = nextSibling(node); + if (next2 && next2 !== end) { + remove2(next2); + } else { + break; + } + } + } + const next = nextSibling(node); + const container = parentNode(node); + remove2(node); + patch( + null, + vnode, + container, + next, + parentComponent, + parentSuspense, + getContainerType(container), + slotScopeIds + ); + if (parentComponent) { + parentComponent.vnode.el = vnode.el; + updateHOCHostEl(parentComponent, vnode.el); + } + return next; + }; + const locateClosingAnchor = (node, open = "[", close = "]") => { + let match = 0; + while (node) { + node = nextSibling(node); + if (node && isComment(node)) { + if (node.data === open) match++; + if (node.data === close) { + if (match === 0) { + return nextSibling(node); + } else { + match--; + } + } + } + } + return node; + }; + const replaceNode = (newNode, oldNode, parentComponent) => { + const parentNode2 = oldNode.parentNode; + if (parentNode2) { + parentNode2.replaceChild(newNode, oldNode); + } + let parent = parentComponent; + while (parent) { + if (parent.vnode.el === oldNode) { + parent.vnode.el = parent.subTree.el = newNode; + } + parent = parent.parent; + } + }; + const isTemplateNode = (node) => { + return node.nodeType === 1 && node.tagName === "TEMPLATE"; + }; + return [hydrate, hydrateNode]; +} +function propHasMismatch(el, key, clientValue, vnode, instance) { + let mismatchType; + let mismatchKey; + let actual; + let expected; + if (key === "class") { + if (el.$cls) { + actual = el.$cls; + delete el.$cls; + } else { + actual = el.getAttribute("class"); + } + expected = normalizeClass(clientValue); + if (!isSetEqual(toClassSet(actual || ""), toClassSet(expected))) { + mismatchType = 2; + mismatchKey = `class`; + } + } else if (key === "style") { + actual = el.getAttribute("style") || ""; + expected = isString(clientValue) ? clientValue : stringifyStyle(normalizeStyle(clientValue)); + const actualMap = toStyleMap(actual); + const expectedMap = toStyleMap(expected); + if (vnode.dirs) { + for (const { dir, value } of vnode.dirs) { + if (dir.name === "show" && !value) { + expectedMap.set("display", "none"); + } + } + } + if (instance) { + resolveCssVars(instance, vnode, expectedMap); + } + if (!isMapEqual(actualMap, expectedMap)) { + mismatchType = 3; + mismatchKey = "style"; + } + } else if (el instanceof SVGElement && isKnownSvgAttr(key) || el instanceof HTMLElement && (isBooleanAttr(key) || isKnownHtmlAttr(key))) { + if (isBooleanAttr(key)) { + actual = el.hasAttribute(key); + expected = includeBooleanAttr(clientValue); + } else if (clientValue == null) { + actual = el.hasAttribute(key); + expected = false; + } else { + if (el.hasAttribute(key)) { + actual = el.getAttribute(key); + } else if (key === "value" && el.tagName === "TEXTAREA") { + actual = el.value; + } else { + actual = false; + } + expected = isRenderableAttrValue(clientValue) ? String(clientValue) : false; + } + if (actual !== expected) { + mismatchType = 4; + mismatchKey = key; + } + } + if (mismatchType != null && !isMismatchAllowed(el, mismatchType)) { + const format = (v) => v === false ? `(not rendered)` : `${mismatchKey}="${v}"`; + const preSegment = `Hydration ${MismatchTypeString[mismatchType]} mismatch on`; + const postSegment = ` + - rendered on server: ${format(actual)} + - expected on client: ${format(expected)} + Note: this mismatch is check-only. The DOM will not be rectified in production due to performance overhead. + You should fix the source of the mismatch.`; + { + warn$1(preSegment, el, postSegment); + } + return true; + } + return false; +} +function toClassSet(str) { + return new Set(str.trim().split(/\s+/)); +} +function isSetEqual(a, b) { + if (a.size !== b.size) { + return false; + } + for (const s of a) { + if (!b.has(s)) { + return false; + } + } + return true; +} +function toStyleMap(str) { + const styleMap = /* @__PURE__ */ new Map(); + for (const item of str.split(";")) { + let [key, value] = item.split(":"); + key = key.trim(); + value = value && value.trim(); + if (key && value) { + styleMap.set(key, value); + } + } + return styleMap; +} +function isMapEqual(a, b) { + if (a.size !== b.size) { + return false; + } + for (const [key, value] of a) { + if (value !== b.get(key)) { + return false; + } + } + return true; +} +function resolveCssVars(instance, vnode, expectedMap) { + const root = instance.subTree; + if (instance.getCssVars && (vnode === root || root && root.type === Fragment && root.children.includes(vnode))) { + const cssVars = instance.getCssVars(); + for (const key in cssVars) { + const value = normalizeCssVarValue(cssVars[key]); + expectedMap.set(`--${getEscapedCssVarName(key)}`, value); + } + } + if (vnode === root && instance.parent) { + resolveCssVars(instance.parent, instance.vnode, expectedMap); + } +} +const allowMismatchAttr = "data-allow-mismatch"; +const MismatchTypeString = { + [ + 0 + /* TEXT */ + ]: "text", + [ + 1 + /* CHILDREN */ + ]: "children", + [ + 2 + /* CLASS */ + ]: "class", + [ + 3 + /* STYLE */ + ]: "style", + [ + 4 + /* ATTRIBUTE */ + ]: "attribute" +}; +function isMismatchAllowed(el, allowedType) { + if (allowedType === 0 || allowedType === 1) { + while (el && !el.hasAttribute(allowMismatchAttr)) { + el = el.parentElement; + } + } + return isMismatchAllowedByAttr( + el && el.getAttribute(allowMismatchAttr), + allowedType + ); +} +function isMismatchAllowedByAttr(allowedAttr, allowedType) { + if (allowedAttr == null) { + return false; + } else if (allowedAttr === "") { + return true; + } else { + const list = allowedAttr.split(","); + if (allowedType === 0 && list.includes("children")) { + return true; + } + return list.includes(MismatchTypeString[allowedType]); + } +} +function isNodeMismatchAllowed(node, vnode) { + return isMismatchAllowed( + node.parentElement, + 1 + /* CHILDREN */ + ) || isMismatchAllowedByNode(node) || isMismatchAllowedByVNode(vnode); +} +function isMismatchAllowedByNode(node) { + return node.nodeType === 1 && isMismatchAllowedByAttr( + node.getAttribute(allowMismatchAttr), + 1 + /* CHILDREN */ + ); +} +function isMismatchAllowedByVNode({ props }) { + const allowedAttr = props && props[allowMismatchAttr]; + return typeof allowedAttr === "string" && isMismatchAllowedByAttr( + allowedAttr, + 1 + /* CHILDREN */ + ); +} +getGlobalThis().requestIdleCallback || ((cb) => setTimeout(cb, 1)); +getGlobalThis().cancelIdleCallback || ((id) => clearTimeout(id)); +function forEachElement(node, cb) { + if (isComment(node) && node.data === "[") { + let depth = 1; + let next = node.nextSibling; + while (next) { + if (next.nodeType === 1) { + const result = cb(next); + if (result === false) { + break; + } + } else if (isComment(next)) { + if (next.data === "]") { + if (--depth === 0) break; + } else if (next.data === "[") { + depth++; + } + } + next = next.nextSibling; + } + } else { + cb(node); + } +} +const isAsyncWrapper = (i) => !!i.type.__asyncLoader; +// @__NO_SIDE_EFFECTS__ +function defineAsyncComponent(source) { + if (isFunction(source)) { + source = { loader: source }; + } + const { + loader, + loadingComponent, + errorComponent, + delay = 200, + hydrate: hydrateStrategy, + timeout, + // undefined = never times out + suspensible = true, + onError: userOnError + } = source; + let pendingRequest = null; + let resolvedComp; + let retries = 0; + const retry = () => { + retries++; + pendingRequest = null; + return load(); + }; + const load = () => { + let thisRequest; + return pendingRequest || (thisRequest = pendingRequest = loader().catch((err) => { + err = err instanceof Error ? err : new Error(String(err)); + if (userOnError) { + return new Promise((resolve2, reject) => { + const userRetry = () => resolve2(retry()); + const userFail = () => reject(err); + userOnError(err, userRetry, userFail, retries + 1); + }); + } else { + throw err; + } + }).then((comp) => { + if (thisRequest !== pendingRequest && pendingRequest) { + return pendingRequest; + } + if (comp && (comp.__esModule || comp[Symbol.toStringTag] === "Module")) { + comp = comp.default; + } + resolvedComp = comp; + return comp; + })); + }; + return /* @__PURE__ */ defineComponent({ + name: "AsyncComponentWrapper", + __asyncLoader: load, + __asyncHydrate(el, instance, hydrate) { + let patched = false; + (instance.bu || (instance.bu = [])).push(() => patched = true); + const performHydrate = () => { + if (patched) { + return; + } + hydrate(); + }; + const doHydrate = hydrateStrategy ? () => { + const teardown = hydrateStrategy( + performHydrate, + (cb) => forEachElement(el, cb) + ); + if (teardown) { + (instance.bum || (instance.bum = [])).push(teardown); + } + } : performHydrate; + if (resolvedComp) { + doHydrate(); + } else { + load().then(() => !instance.isUnmounted && doHydrate()); + } + }, + get __asyncResolved() { + return resolvedComp; + }, + setup() { + const instance = currentInstance; + markAsyncBoundary(instance); + if (resolvedComp) { + return () => createInnerComp(resolvedComp, instance); + } + const onError = (err) => { + pendingRequest = null; + handleError( + err, + instance, + 13, + !errorComponent + ); + }; + if (suspensible && instance.suspense || isInSSRComponentSetup) { + return load().then((comp) => { + return () => createInnerComp(comp, instance); + }).catch((err) => { + onError(err); + return () => errorComponent ? createVNode(errorComponent, { + error: err + }) : null; + }); + } + const loaded = /* @__PURE__ */ ref(false); + const error = /* @__PURE__ */ ref(); + const delayed = /* @__PURE__ */ ref(!!delay); + let timeoutTimer; + let delayTimer; + onUnmounted(() => { + if (timeoutTimer != null) clearTimeout(timeoutTimer); + if (delayTimer != null) clearTimeout(delayTimer); + }); + if (delay) { + delayTimer = setTimeout(() => { + if (instance.isUnmounted) return; + delayed.value = false; + }, delay); + } + if (timeout != null) { + timeoutTimer = setTimeout(() => { + if (instance.isUnmounted) return; + if (!loaded.value && !error.value) { + const err = new Error( + `Async component timed out after ${timeout}ms.` + ); + onError(err); + error.value = err; + } + }, timeout); + } + load().then(() => { + if (instance.isUnmounted) return; + loaded.value = true; + if (instance.parent && isKeepAlive(instance.parent.vnode)) { + instance.parent.update(); + } + }).catch((err) => { + if (instance.isUnmounted) { + pendingRequest = null; + return; + } + onError(err); + error.value = err; + }); + return () => { + if (loaded.value && resolvedComp) { + return createInnerComp(resolvedComp, instance); + } else if (error.value && errorComponent) { + return createVNode(errorComponent, { + error: error.value + }); + } else if (loadingComponent && !delayed.value) { + return createInnerComp( + loadingComponent, + instance + ); + } + }; + } + }); +} +function createInnerComp(comp, parent) { + const { ref: ref22, props, children, ce } = parent.vnode; + const vnode = createVNode(comp, props, children); + vnode.ref = ref22; + vnode.ce = ce; + delete parent.vnode.ce; + return vnode; +} +const isKeepAlive = (vnode) => vnode.type.__isKeepAlive; +function onActivated(hook, target) { + registerKeepAliveHook(hook, "a", target); +} +function onDeactivated(hook, target) { + registerKeepAliveHook(hook, "da", target); +} +function registerKeepAliveHook(hook, type, target = currentInstance) { + const wrappedHook = hook.__wdc || (hook.__wdc = () => { + let current = target; + while (current) { + if (current.isDeactivated) { + return; + } + current = current.parent; + } + return hook(); + }); + injectHook(type, wrappedHook, target); + if (target) { + let current = target.parent; + while (current && current.parent) { + if (isKeepAlive(current.parent.vnode)) { + injectToKeepAliveRoot(wrappedHook, type, target, current); + } + current = current.parent; + } + } +} +function injectToKeepAliveRoot(hook, type, target, keepAliveRoot) { + const injected = injectHook( + type, + hook, + keepAliveRoot, + true + /* prepend */ + ); + onUnmounted(() => { + remove(keepAliveRoot[type], injected); + }, target); +} +function injectHook(type, hook, target = currentInstance, prepend = false) { + if (target) { + const hooks = target[type] || (target[type] = []); + const wrappedHook = hook.__weh || (hook.__weh = (...args) => { + pauseTracking(); + const reset = setCurrentInstance(target); + const res = callWithAsyncErrorHandling(hook, target, type, args); + reset(); + resetTracking(); + return res; + }); + if (prepend) { + hooks.unshift(wrappedHook); + } else { + hooks.push(wrappedHook); + } + return wrappedHook; + } +} +const createHook = (lifecycle) => (hook, target = currentInstance) => { + if (!isInSSRComponentSetup || lifecycle === "sp") { + injectHook(lifecycle, (...args) => hook(...args), target); + } +}; +const onBeforeMount = createHook("bm"); +const onMounted = createHook("m"); +const onBeforeUpdate = createHook( + "bu" +); +const onUpdated = createHook("u"); +const onBeforeUnmount = createHook( + "bum" +); +const onUnmounted = createHook("um"); +const onServerPrefetch = createHook( + "sp" +); +const onRenderTriggered = createHook("rtg"); +const onRenderTracked = createHook("rtc"); +function onErrorCaptured(hook, target = currentInstance) { + injectHook("ec", hook, target); +} +const COMPONENTS = "components"; +function resolveComponent(name, maybeSelfReference) { + return resolveAsset(COMPONENTS, name, true, maybeSelfReference) || name; +} +const NULL_DYNAMIC_COMPONENT = /* @__PURE__ */ Symbol.for("v-ndc"); +function resolveDynamicComponent(component) { + if (isString(component)) { + return resolveAsset(COMPONENTS, component, false) || component; + } else { + return component || NULL_DYNAMIC_COMPONENT; + } +} +function resolveAsset(type, name, warnMissing = true, maybeSelfReference = false) { + const instance = currentRenderingInstance || currentInstance; + if (instance) { + const Component = instance.type; + { + const selfName = getComponentName( + Component, + false + ); + if (selfName && (selfName === name || selfName === camelize(name) || selfName === capitalize(camelize(name)))) { + return Component; + } + } + const res = ( + // local registration + // check instance[type] first which is resolved for options API + resolve(instance[type] || Component[type], name) || // global registration + resolve(instance.appContext[type], name) + ); + if (!res && maybeSelfReference) { + return Component; + } + return res; + } +} +function resolve(registry, name) { + return registry && (registry[name] || registry[camelize(name)] || registry[capitalize(camelize(name))]); +} +function renderList(source, renderItem, cache, index) { + let ret; + const cached = cache; + const sourceIsArray = isArray(source); + if (sourceIsArray || isString(source)) { + const sourceIsReactiveArray = sourceIsArray && /* @__PURE__ */ isReactive(source); + let needsWrap = false; + let isReadonlySource = false; + if (sourceIsReactiveArray) { + needsWrap = !/* @__PURE__ */ isShallow(source); + isReadonlySource = /* @__PURE__ */ isReadonly(source); + source = shallowReadArray(source); + } + ret = new Array(source.length); + for (let i = 0, l = source.length; i < l; i++) { + ret[i] = renderItem( + needsWrap ? isReadonlySource ? toReadonly(toReactive(source[i])) : toReactive(source[i]) : source[i], + i, + void 0, + cached + ); + } + } else if (typeof source === "number") { + { + ret = new Array(source); + for (let i = 0; i < source; i++) { + ret[i] = renderItem(i + 1, i, void 0, cached); + } + } + } else if (isObject$1(source)) { + if (source[Symbol.iterator]) { + ret = Array.from( + source, + (item, i) => renderItem(item, i, void 0, cached) + ); + } else { + const keys = Object.keys(source); + ret = new Array(keys.length); + for (let i = 0, l = keys.length; i < l; i++) { + const key = keys[i]; + ret[i] = renderItem(source[key], key, i, cached); + } + } + } else { + ret = []; + } + return ret; +} +function renderSlot(slots, name, props = {}, fallback, noSlotted) { + if (currentRenderingInstance.ce || currentRenderingInstance.parent && isAsyncWrapper(currentRenderingInstance.parent) && currentRenderingInstance.parent.ce) { + const hasProps = Object.keys(props).length > 0; + if (name !== "default") props.name = name; + return openBlock(), createBlock( + Fragment, + null, + [createVNode("slot", props, fallback && fallback())], + hasProps ? -2 : 64 + ); + } + let slot = slots[name]; + if (slot && slot._c) { + slot._d = false; + } + openBlock(); + const validSlotContent = slot && ensureValidVNode(slot(props)); + const slotKey = props.key || // slot content array of a dynamic conditional slot may have a branch + // key attached in the `createSlots` helper, respect that + validSlotContent && validSlotContent.key; + const rendered = createBlock( + Fragment, + { + key: (slotKey && !isSymbol(slotKey) ? slotKey : `_${name}`) + // #7256 force differentiate fallback content from actual content + (!validSlotContent && fallback ? "_fb" : "") + }, + validSlotContent || (fallback ? fallback() : []), + validSlotContent && slots._ === 1 ? 64 : -2 + ); + if (!noSlotted && rendered.scopeId) { + rendered.slotScopeIds = [rendered.scopeId + "-s"]; + } + if (slot && slot._c) { + slot._d = true; + } + return rendered; +} +function ensureValidVNode(vnodes) { + return vnodes.some((child) => { + if (!isVNode(child)) return true; + if (child.type === Comment) return false; + if (child.type === Fragment && !ensureValidVNode(child.children)) + return false; + return true; + }) ? vnodes : null; +} +function toHandlers(obj, preserveCaseIfNecessary) { + const ret = {}; + for (const key in obj) { + ret[/[A-Z]/.test(key) ? `on:${key}` : toHandlerKey(key)] = obj[key]; + } + return ret; +} +const getPublicInstance = (i) => { + if (!i) return null; + if (isStatefulComponent(i)) return getComponentPublicInstance(i); + return getPublicInstance(i.parent); +}; +const publicPropertiesMap = ( + // Move PURE marker to new line to workaround compiler discarding it + // due to type annotation + /* @__PURE__ */ extend(/* @__PURE__ */ Object.create(null), { + $: (i) => i, + $el: (i) => i.vnode.el, + $data: (i) => i.data, + $props: (i) => i.props, + $attrs: (i) => i.attrs, + $slots: (i) => i.slots, + $refs: (i) => i.refs, + $parent: (i) => getPublicInstance(i.parent), + $root: (i) => getPublicInstance(i.root), + $host: (i) => i.ce, + $emit: (i) => i.emit, + $options: (i) => resolveMergedOptions(i), + $forceUpdate: (i) => i.f || (i.f = () => { + queueJob(i.update); + }), + $nextTick: (i) => i.n || (i.n = nextTick.bind(i.proxy)), + $watch: (i) => instanceWatch.bind(i) + }) +); +const hasSetupBinding = (state, key) => state !== EMPTY_OBJ && !state.__isScriptSetup && hasOwn(state, key); +const PublicInstanceProxyHandlers = { + get({ _: instance }, key) { + if (key === "__v_skip") { + return true; + } + const { ctx, setupState, data, props, accessCache, type, appContext } = instance; + if (key[0] !== "$") { + const n = accessCache[key]; + if (n !== void 0) { + switch (n) { + case 1: + return setupState[key]; + case 2: + return data[key]; + case 4: + return ctx[key]; + case 3: + return props[key]; + } + } else if (hasSetupBinding(setupState, key)) { + accessCache[key] = 1; + return setupState[key]; + } else if (data !== EMPTY_OBJ && hasOwn(data, key)) { + accessCache[key] = 2; + return data[key]; + } else if (hasOwn(props, key)) { + accessCache[key] = 3; + return props[key]; + } else if (ctx !== EMPTY_OBJ && hasOwn(ctx, key)) { + accessCache[key] = 4; + return ctx[key]; + } else if (shouldCacheAccess) { + accessCache[key] = 0; + } + } + const publicGetter = publicPropertiesMap[key]; + let cssModule, globalProperties; + if (publicGetter) { + if (key === "$attrs") { + track(instance.attrs, "get", ""); + } + return publicGetter(instance); + } else if ( + // css module (injected by vue-loader) + (cssModule = type.__cssModules) && (cssModule = cssModule[key]) + ) { + return cssModule; + } else if (ctx !== EMPTY_OBJ && hasOwn(ctx, key)) { + accessCache[key] = 4; + return ctx[key]; + } else if ( + // global properties + globalProperties = appContext.config.globalProperties, hasOwn(globalProperties, key) + ) { + { + return globalProperties[key]; + } + } else ; + }, + set({ _: instance }, key, value) { + const { data, setupState, ctx } = instance; + if (hasSetupBinding(setupState, key)) { + setupState[key] = value; + return true; + } else if (data !== EMPTY_OBJ && hasOwn(data, key)) { + data[key] = value; + return true; + } else if (hasOwn(instance.props, key)) { + return false; + } + if (key[0] === "$" && key.slice(1) in instance) { + return false; + } else { + { + ctx[key] = value; + } + } + return true; + }, + has({ + _: { data, setupState, accessCache, ctx, appContext, props, type } + }, key) { + let cssModules; + return !!(accessCache[key] || data !== EMPTY_OBJ && key[0] !== "$" && hasOwn(data, key) || hasSetupBinding(setupState, key) || hasOwn(props, key) || hasOwn(ctx, key) || hasOwn(publicPropertiesMap, key) || hasOwn(appContext.config.globalProperties, key) || (cssModules = type.__cssModules) && cssModules[key]); + }, + defineProperty(target, key, descriptor) { + if (descriptor.get != null) { + target._.accessCache[key] = 0; + } else if (hasOwn(descriptor, "value")) { + this.set(target, key, descriptor.value, null); + } + return Reflect.defineProperty(target, key, descriptor); + } +}; +function useSlots() { + return getContext().slots; +} +function getContext(calledFunctionName) { + const i = getCurrentInstance(); + return i.setupContext || (i.setupContext = createSetupContext(i)); +} +function normalizePropsOrEmits(props) { + return isArray(props) ? props.reduce( + (normalized, p2) => (normalized[p2] = null, normalized), + {} + ) : props; +} +let shouldCacheAccess = true; +function applyOptions(instance) { + const options = resolveMergedOptions(instance); + const publicThis = instance.proxy; + const ctx = instance.ctx; + shouldCacheAccess = false; + if (options.beforeCreate) { + callHook$1(options.beforeCreate, instance, "bc"); + } + const { + // state + data: dataOptions, + computed: computedOptions, + methods, + watch: watchOptions, + provide: provideOptions, + inject: injectOptions, + // lifecycle + created, + beforeMount, + mounted, + beforeUpdate, + updated, + activated, + deactivated, + beforeDestroy, + beforeUnmount, + destroyed, + unmounted, + render, + renderTracked, + renderTriggered, + errorCaptured, + serverPrefetch, + // public API + expose, + inheritAttrs, + // assets + components, + directives, + filters + } = options; + const checkDuplicateProperties = null; + if (injectOptions) { + resolveInjections(injectOptions, ctx, checkDuplicateProperties); + } + if (methods) { + for (const key in methods) { + const methodHandler = methods[key]; + if (isFunction(methodHandler)) { + { + ctx[key] = methodHandler.bind(publicThis); + } + } + } + } + if (dataOptions) { + const data = dataOptions.call(publicThis, publicThis); + if (!isObject$1(data)) ; + else { + instance.data = /* @__PURE__ */ reactive(data); + } + } + shouldCacheAccess = true; + if (computedOptions) { + for (const key in computedOptions) { + const opt = computedOptions[key]; + const get = isFunction(opt) ? opt.bind(publicThis, publicThis) : isFunction(opt.get) ? opt.get.bind(publicThis, publicThis) : NOOP; + const set = !isFunction(opt) && isFunction(opt.set) ? opt.set.bind(publicThis) : NOOP; + const c = computed({ + get, + set + }); + Object.defineProperty(ctx, key, { + enumerable: true, + configurable: true, + get: () => c.value, + set: (v) => c.value = v + }); + } + } + if (watchOptions) { + for (const key in watchOptions) { + createWatcher(watchOptions[key], ctx, publicThis, key); + } + } + if (provideOptions) { + const provides = isFunction(provideOptions) ? provideOptions.call(publicThis) : provideOptions; + Reflect.ownKeys(provides).forEach((key) => { + provide(key, provides[key]); + }); + } + if (created) { + callHook$1(created, instance, "c"); + } + function registerLifecycleHook(register, hook) { + if (isArray(hook)) { + hook.forEach((_hook) => register(_hook.bind(publicThis))); + } else if (hook) { + register(hook.bind(publicThis)); + } + } + registerLifecycleHook(onBeforeMount, beforeMount); + registerLifecycleHook(onMounted, mounted); + registerLifecycleHook(onBeforeUpdate, beforeUpdate); + registerLifecycleHook(onUpdated, updated); + registerLifecycleHook(onActivated, activated); + registerLifecycleHook(onDeactivated, deactivated); + registerLifecycleHook(onErrorCaptured, errorCaptured); + registerLifecycleHook(onRenderTracked, renderTracked); + registerLifecycleHook(onRenderTriggered, renderTriggered); + registerLifecycleHook(onBeforeUnmount, beforeUnmount); + registerLifecycleHook(onUnmounted, unmounted); + registerLifecycleHook(onServerPrefetch, serverPrefetch); + if (isArray(expose)) { + if (expose.length) { + const exposed = instance.exposed || (instance.exposed = {}); + expose.forEach((key) => { + Object.defineProperty(exposed, key, { + get: () => publicThis[key], + set: (val) => publicThis[key] = val, + enumerable: true + }); + }); + } else if (!instance.exposed) { + instance.exposed = {}; + } + } + if (render && instance.render === NOOP) { + instance.render = render; + } + if (inheritAttrs != null) { + instance.inheritAttrs = inheritAttrs; + } + if (components) instance.components = components; + if (directives) instance.directives = directives; + if (serverPrefetch) { + markAsyncBoundary(instance); + } +} +function resolveInjections(injectOptions, ctx, checkDuplicateProperties = NOOP) { + if (isArray(injectOptions)) { + injectOptions = normalizeInject(injectOptions); + } + for (const key in injectOptions) { + const opt = injectOptions[key]; + let injected; + if (isObject$1(opt)) { + if ("default" in opt) { + injected = inject( + opt.from || key, + opt.default, + true + ); + } else { + injected = inject(opt.from || key); + } + } else { + injected = inject(opt); + } + if (/* @__PURE__ */ isRef(injected)) { + Object.defineProperty(ctx, key, { + enumerable: true, + configurable: true, + get: () => injected.value, + set: (v) => injected.value = v + }); + } else { + ctx[key] = injected; + } + } +} +function callHook$1(hook, instance, type) { + callWithAsyncErrorHandling( + isArray(hook) ? hook.map((h2) => h2.bind(instance.proxy)) : hook.bind(instance.proxy), + instance, + type + ); +} +function createWatcher(raw, ctx, publicThis, key) { + let getter = key.includes(".") ? createPathGetter(publicThis, key) : () => publicThis[key]; + if (isString(raw)) { + const handler = ctx[raw]; + if (isFunction(handler)) { + { + watch(getter, handler); + } + } + } else if (isFunction(raw)) { + { + watch(getter, raw.bind(publicThis)); + } + } else if (isObject$1(raw)) { + if (isArray(raw)) { + raw.forEach((r) => createWatcher(r, ctx, publicThis, key)); + } else { + const handler = isFunction(raw.handler) ? raw.handler.bind(publicThis) : ctx[raw.handler]; + if (isFunction(handler)) { + watch(getter, handler, raw); + } + } + } else ; +} +function resolveMergedOptions(instance) { + const base = instance.type; + const { mixins, extends: extendsOptions } = base; + const { + mixins: globalMixins, + optionsCache: cache, + config: { optionMergeStrategies } + } = instance.appContext; + const cached = cache.get(base); + let resolved; + if (cached) { + resolved = cached; + } else if (!globalMixins.length && !mixins && !extendsOptions) { + { + resolved = base; + } + } else { + resolved = {}; + if (globalMixins.length) { + globalMixins.forEach( + (m) => mergeOptions(resolved, m, optionMergeStrategies, true) + ); + } + mergeOptions(resolved, base, optionMergeStrategies); + } + if (isObject$1(base)) { + cache.set(base, resolved); + } + return resolved; +} +function mergeOptions(to, from, strats, asMixin = false) { + const { mixins, extends: extendsOptions } = from; + if (extendsOptions) { + mergeOptions(to, extendsOptions, strats, true); + } + if (mixins) { + mixins.forEach( + (m) => mergeOptions(to, m, strats, true) + ); + } + for (const key in from) { + if (asMixin && key === "expose") ; + else { + const strat = internalOptionMergeStrats[key] || strats && strats[key]; + to[key] = strat ? strat(to[key], from[key]) : from[key]; + } + } + return to; +} +const internalOptionMergeStrats = { + data: mergeDataFn, + props: mergeEmitsOrPropsOptions, + emits: mergeEmitsOrPropsOptions, + // objects + methods: mergeObjectOptions, + computed: mergeObjectOptions, + // lifecycle + beforeCreate: mergeAsArray, + created: mergeAsArray, + beforeMount: mergeAsArray, + mounted: mergeAsArray, + beforeUpdate: mergeAsArray, + updated: mergeAsArray, + beforeDestroy: mergeAsArray, + beforeUnmount: mergeAsArray, + destroyed: mergeAsArray, + unmounted: mergeAsArray, + activated: mergeAsArray, + deactivated: mergeAsArray, + errorCaptured: mergeAsArray, + serverPrefetch: mergeAsArray, + // assets + components: mergeObjectOptions, + directives: mergeObjectOptions, + // watch + watch: mergeWatchOptions, + // provide / inject + provide: mergeDataFn, + inject: mergeInject +}; +function mergeDataFn(to, from) { + if (!from) { + return to; + } + if (!to) { + return from; + } + return function mergedDataFn() { + return extend( + isFunction(to) ? to.call(this, this) : to, + isFunction(from) ? from.call(this, this) : from + ); + }; +} +function mergeInject(to, from) { + return mergeObjectOptions(normalizeInject(to), normalizeInject(from)); +} +function normalizeInject(raw) { + if (isArray(raw)) { + const res = {}; + for (let i = 0; i < raw.length; i++) { + res[raw[i]] = raw[i]; + } + return res; + } + return raw; +} +function mergeAsArray(to, from) { + return to ? [...new Set([].concat(to, from))] : from; +} +function mergeObjectOptions(to, from) { + return to ? extend(/* @__PURE__ */ Object.create(null), to, from) : from; +} +function mergeEmitsOrPropsOptions(to, from) { + if (to) { + if (isArray(to) && isArray(from)) { + return [.../* @__PURE__ */ new Set([...to, ...from])]; + } + return extend( + /* @__PURE__ */ Object.create(null), + normalizePropsOrEmits(to), + normalizePropsOrEmits(from != null ? from : {}) + ); + } else { + return from; + } +} +function mergeWatchOptions(to, from) { + if (!to) return from; + if (!from) return to; + const merged = extend(/* @__PURE__ */ Object.create(null), to); + for (const key in from) { + merged[key] = mergeAsArray(to[key], from[key]); + } + return merged; +} +function createAppContext() { + return { + app: null, + config: { + isNativeTag: NO, + performance: false, + globalProperties: {}, + optionMergeStrategies: {}, + errorHandler: void 0, + warnHandler: void 0, + compilerOptions: {} + }, + mixins: [], + components: {}, + directives: {}, + provides: /* @__PURE__ */ Object.create(null), + optionsCache: /* @__PURE__ */ new WeakMap(), + propsCache: /* @__PURE__ */ new WeakMap(), + emitsCache: /* @__PURE__ */ new WeakMap() + }; +} +let uid$1 = 0; +function createAppAPI(render, hydrate) { + return function createApp2(rootComponent, rootProps = null) { + if (!isFunction(rootComponent)) { + rootComponent = extend({}, rootComponent); + } + if (rootProps != null && !isObject$1(rootProps)) { + rootProps = null; + } + const context = createAppContext(); + const installedPlugins = /* @__PURE__ */ new WeakSet(); + const pluginCleanupFns = []; + let isMounted = false; + const app = context.app = { + _uid: uid$1++, + _component: rootComponent, + _props: rootProps, + _container: null, + _context: context, + _instance: null, + version, + get config() { + return context.config; + }, + set config(v) { + }, + use(plugin, ...options) { + if (installedPlugins.has(plugin)) ; + else if (plugin && isFunction(plugin.install)) { + installedPlugins.add(plugin); + plugin.install(app, ...options); + } else if (isFunction(plugin)) { + installedPlugins.add(plugin); + plugin(app, ...options); + } else ; + return app; + }, + mixin(mixin) { + { + if (!context.mixins.includes(mixin)) { + context.mixins.push(mixin); + } + } + return app; + }, + component(name, component) { + if (!component) { + return context.components[name]; + } + context.components[name] = component; + return app; + }, + directive(name, directive) { + if (!directive) { + return context.directives[name]; + } + context.directives[name] = directive; + return app; + }, + mount(rootContainer, isHydrate, namespace) { + if (!isMounted) { + const vnode = app._ceVNode || createVNode(rootComponent, rootProps); + vnode.appContext = context; + if (namespace === true) { + namespace = "svg"; + } else if (namespace === false) { + namespace = void 0; + } + if (isHydrate && hydrate) { + hydrate(vnode, rootContainer); + } else { + render(vnode, rootContainer, namespace); + } + isMounted = true; + app._container = rootContainer; + rootContainer.__vue_app__ = app; + return getComponentPublicInstance(vnode.component); + } + }, + onUnmount(cleanupFn) { + pluginCleanupFns.push(cleanupFn); + }, + unmount() { + if (isMounted) { + callWithAsyncErrorHandling( + pluginCleanupFns, + app._instance, + 16 + ); + render(null, app._container); + delete app._container.__vue_app__; + } + }, + provide(key, value) { + context.provides[key] = value; + return app; + }, + runWithContext(fn) { + const lastApp = currentApp; + currentApp = app; + try { + return fn(); + } finally { + currentApp = lastApp; + } + } + }; + return app; + }; +} +let currentApp = null; +const getModelModifiers = (props, modelName) => { + return modelName === "modelValue" || modelName === "model-value" ? props.modelModifiers : props[`${modelName}Modifiers`] || props[`${camelize(modelName)}Modifiers`] || props[`${hyphenate(modelName)}Modifiers`]; +}; +function emit(instance, event, ...rawArgs) { + if (instance.isUnmounted) return; + const props = instance.vnode.props || EMPTY_OBJ; + let args = rawArgs; + const isModelListener2 = event.startsWith("update:"); + const modifiers = isModelListener2 && getModelModifiers(props, event.slice(7)); + if (modifiers) { + if (modifiers.trim) { + args = rawArgs.map((a) => isString(a) ? a.trim() : a); + } + if (modifiers.number) { + args = rawArgs.map(looseToNumber); + } + } + let handlerName; + let handler = props[handlerName = toHandlerKey(event)] || // also try camelCase event handler (#2249) + props[handlerName = toHandlerKey(camelize(event))]; + if (!handler && isModelListener2) { + handler = props[handlerName = toHandlerKey(hyphenate(event))]; + } + if (handler) { + callWithAsyncErrorHandling( + handler, + instance, + 6, + args + ); + } + const onceHandler = props[handlerName + `Once`]; + if (onceHandler) { + if (!instance.emitted) { + instance.emitted = {}; + } else if (instance.emitted[handlerName]) { + return; + } + instance.emitted[handlerName] = true; + callWithAsyncErrorHandling( + onceHandler, + instance, + 6, + args + ); + } +} +const mixinEmitsCache = /* @__PURE__ */ new WeakMap(); +function normalizeEmitsOptions(comp, appContext, asMixin = false) { + const cache = asMixin ? mixinEmitsCache : appContext.emitsCache; + const cached = cache.get(comp); + if (cached !== void 0) { + return cached; + } + const raw = comp.emits; + let normalized = {}; + let hasExtends = false; + if (!isFunction(comp)) { + const extendEmits = (raw2) => { + const normalizedFromExtend = normalizeEmitsOptions(raw2, appContext, true); + if (normalizedFromExtend) { + hasExtends = true; + extend(normalized, normalizedFromExtend); + } + }; + if (!asMixin && appContext.mixins.length) { + appContext.mixins.forEach(extendEmits); + } + if (comp.extends) { + extendEmits(comp.extends); + } + if (comp.mixins) { + comp.mixins.forEach(extendEmits); + } + } + if (!raw && !hasExtends) { + if (isObject$1(comp)) { + cache.set(comp, null); + } + return null; + } + if (isArray(raw)) { + raw.forEach((key) => normalized[key] = null); + } else { + extend(normalized, raw); + } + if (isObject$1(comp)) { + cache.set(comp, normalized); + } + return normalized; +} +function isEmitListener(options, key) { + if (!options || !isOn(key)) { + return false; + } + key = key.slice(2); + key = key === "Once" ? key : key.replace(/Once$/, ""); + return hasOwn(options, key[0].toLowerCase() + key.slice(1)) || hasOwn(options, hyphenate(key)) || hasOwn(options, key); +} +function markAttrsAccessed() { +} +function renderComponentRoot(instance) { + const { + type: Component, + vnode, + proxy, + withProxy, + propsOptions: [propsOptions], + slots, + attrs, + emit: emit2, + render, + renderCache, + props, + data, + setupState, + ctx, + inheritAttrs + } = instance; + const prev = setCurrentRenderingInstance(instance); + let result; + let fallthroughAttrs; + try { + if (vnode.shapeFlag & 4) { + const proxyToUse = withProxy || proxy; + const thisProxy = false ? new Proxy(proxyToUse, { + get(target, key, receiver) { + warn$1( + `Property '${String( + key + )}' was accessed via 'this'. Avoid using 'this' in templates.` + ); + return Reflect.get(target, key, receiver); + } + }) : proxyToUse; + result = normalizeVNode( + render.call( + thisProxy, + proxyToUse, + renderCache, + false ? /* @__PURE__ */ shallowReadonly(props) : props, + setupState, + data, + ctx + ) + ); + fallthroughAttrs = attrs; + } else { + const render2 = Component; + if (false) ; + result = normalizeVNode( + render2.length > 1 ? render2( + false ? /* @__PURE__ */ shallowReadonly(props) : props, + false ? { + get attrs() { + markAttrsAccessed(); + return /* @__PURE__ */ shallowReadonly(attrs); + }, + slots, + emit: emit2 + } : { attrs, slots, emit: emit2 } + ) : render2( + false ? /* @__PURE__ */ shallowReadonly(props) : props, + null + ) + ); + fallthroughAttrs = Component.props ? attrs : getFunctionalFallthrough(attrs); + } + } catch (err) { + blockStack.length = 0; + handleError(err, instance, 1); + result = createVNode(Comment); + } + let root = result; + if (fallthroughAttrs && inheritAttrs !== false) { + const keys = Object.keys(fallthroughAttrs); + const { shapeFlag } = root; + if (keys.length) { + if (shapeFlag & (1 | 6)) { + if (propsOptions && keys.some(isModelListener)) { + fallthroughAttrs = filterModelListeners( + fallthroughAttrs, + propsOptions + ); + } + root = cloneVNode(root, fallthroughAttrs, false, true); + } + } + } + if (vnode.dirs) { + root = cloneVNode(root, null, false, true); + root.dirs = root.dirs ? root.dirs.concat(vnode.dirs) : vnode.dirs; + } + if (vnode.transition) { + setTransitionHooks(root, vnode.transition); + } + { + result = root; + } + setCurrentRenderingInstance(prev); + return result; +} +const getFunctionalFallthrough = (attrs) => { + let res; + for (const key in attrs) { + if (key === "class" || key === "style" || isOn(key)) { + (res || (res = {}))[key] = attrs[key]; + } + } + return res; +}; +const filterModelListeners = (attrs, props) => { + const res = {}; + for (const key in attrs) { + if (!isModelListener(key) || !(key.slice(9) in props)) { + res[key] = attrs[key]; + } + } + return res; +}; +function shouldUpdateComponent(prevVNode, nextVNode, optimized) { + const { props: prevProps, children: prevChildren, component } = prevVNode; + const { props: nextProps, children: nextChildren, patchFlag } = nextVNode; + const emits = component.emitsOptions; + if (nextVNode.dirs || nextVNode.transition) { + return true; + } + if (optimized && patchFlag >= 0) { + if (patchFlag & 1024) { + return true; + } + if (patchFlag & 16) { + if (!prevProps) { + return !!nextProps; + } + return hasPropsChanged(prevProps, nextProps, emits); + } else if (patchFlag & 8) { + const dynamicProps = nextVNode.dynamicProps; + for (let i = 0; i < dynamicProps.length; i++) { + const key = dynamicProps[i]; + if (hasPropValueChanged(nextProps, prevProps, key) && !isEmitListener(emits, key)) { + return true; + } + } + } + } else { + if (prevChildren || nextChildren) { + if (!nextChildren || !nextChildren.$stable) { + return true; + } + } + if (prevProps === nextProps) { + return false; + } + if (!prevProps) { + return !!nextProps; + } + if (!nextProps) { + return true; + } + return hasPropsChanged(prevProps, nextProps, emits); + } + return false; +} +function hasPropsChanged(prevProps, nextProps, emitsOptions) { + const nextKeys = Object.keys(nextProps); + if (nextKeys.length !== Object.keys(prevProps).length) { + return true; + } + for (let i = 0; i < nextKeys.length; i++) { + const key = nextKeys[i]; + if (hasPropValueChanged(nextProps, prevProps, key) && !isEmitListener(emitsOptions, key)) { + return true; + } + } + return false; +} +function hasPropValueChanged(nextProps, prevProps, key) { + const nextProp = nextProps[key]; + const prevProp = prevProps[key]; + if (key === "style" && isObject$1(nextProp) && isObject$1(prevProp)) { + return !looseEqual(nextProp, prevProp); + } + return nextProp !== prevProp; +} +function updateHOCHostEl({ vnode, parent, suspense }, el) { + while (parent) { + const root = parent.subTree; + if (root.suspense && root.suspense.activeBranch === vnode) { + root.suspense.vnode.el = root.el = el; + vnode = root; + } + if (root === vnode) { + (vnode = parent.vnode).el = el; + parent = parent.parent; + } else { + break; + } + } + if (suspense && suspense.activeBranch === vnode) { + suspense.vnode.el = el; + } +} +const internalObjectProto = {}; +const createInternalObject = () => Object.create(internalObjectProto); +const isInternalObject = (obj) => Object.getPrototypeOf(obj) === internalObjectProto; +function initProps(instance, rawProps, isStateful, isSSR = false) { + const props = {}; + const attrs = createInternalObject(); + instance.propsDefaults = /* @__PURE__ */ Object.create(null); + setFullProps(instance, rawProps, props, attrs); + for (const key in instance.propsOptions[0]) { + if (!(key in props)) { + props[key] = void 0; + } + } + if (isStateful) { + instance.props = isSSR ? props : /* @__PURE__ */ shallowReactive(props); + } else { + if (!instance.type.props) { + instance.props = attrs; + } else { + instance.props = props; + } + } + instance.attrs = attrs; +} +function updateProps(instance, rawProps, rawPrevProps, optimized) { + const { + props, + attrs, + vnode: { patchFlag } + } = instance; + const rawCurrentProps = /* @__PURE__ */ toRaw(props); + const [options] = instance.propsOptions; + let hasAttrsChanged = false; + if ( + // always force full diff in dev + // - #1942 if hmr is enabled with sfc component + // - vite#872 non-sfc component used by sfc component + (optimized || patchFlag > 0) && !(patchFlag & 16) + ) { + if (patchFlag & 8) { + const propsToUpdate = instance.vnode.dynamicProps; + for (let i = 0; i < propsToUpdate.length; i++) { + let key = propsToUpdate[i]; + if (isEmitListener(instance.emitsOptions, key)) { + continue; + } + const value = rawProps[key]; + if (options) { + if (hasOwn(attrs, key)) { + if (value !== attrs[key]) { + attrs[key] = value; + hasAttrsChanged = true; + } + } else { + const camelizedKey = camelize(key); + props[camelizedKey] = resolvePropValue( + options, + rawCurrentProps, + camelizedKey, + value, + instance, + false + ); + } + } else { + if (value !== attrs[key]) { + attrs[key] = value; + hasAttrsChanged = true; + } + } + } + } + } else { + if (setFullProps(instance, rawProps, props, attrs)) { + hasAttrsChanged = true; + } + let kebabKey; + for (const key in rawCurrentProps) { + if (!rawProps || // for camelCase + !hasOwn(rawProps, key) && // it's possible the original props was passed in as kebab-case + // and converted to camelCase (#955) + ((kebabKey = hyphenate(key)) === key || !hasOwn(rawProps, kebabKey))) { + if (options) { + if (rawPrevProps && // for camelCase + (rawPrevProps[key] !== void 0 || // for kebab-case + rawPrevProps[kebabKey] !== void 0)) { + props[key] = resolvePropValue( + options, + rawCurrentProps, + key, + void 0, + instance, + true + ); + } + } else { + delete props[key]; + } + } + } + if (attrs !== rawCurrentProps) { + for (const key in attrs) { + if (!rawProps || !hasOwn(rawProps, key) && true) { + delete attrs[key]; + hasAttrsChanged = true; + } + } + } + } + if (hasAttrsChanged) { + trigger(instance.attrs, "set", ""); + } +} +function setFullProps(instance, rawProps, props, attrs) { + const [options, needCastKeys] = instance.propsOptions; + let hasAttrsChanged = false; + let rawCastValues; + if (rawProps) { + for (let key in rawProps) { + if (isReservedProp(key)) { + continue; + } + const value = rawProps[key]; + let camelKey; + if (options && hasOwn(options, camelKey = camelize(key))) { + if (!needCastKeys || !needCastKeys.includes(camelKey)) { + props[camelKey] = value; + } else { + (rawCastValues || (rawCastValues = {}))[camelKey] = value; + } + } else if (!isEmitListener(instance.emitsOptions, key)) { + if (!(key in attrs) || value !== attrs[key]) { + attrs[key] = value; + hasAttrsChanged = true; + } + } + } + } + if (needCastKeys) { + const rawCurrentProps = /* @__PURE__ */ toRaw(props); + const castValues = rawCastValues || EMPTY_OBJ; + for (let i = 0; i < needCastKeys.length; i++) { + const key = needCastKeys[i]; + props[key] = resolvePropValue( + options, + rawCurrentProps, + key, + castValues[key], + instance, + !hasOwn(castValues, key) + ); + } + } + return hasAttrsChanged; +} +function resolvePropValue(options, props, key, value, instance, isAbsent) { + const opt = options[key]; + if (opt != null) { + const hasDefault = hasOwn(opt, "default"); + if (hasDefault && value === void 0) { + const defaultValue = opt.default; + if (opt.type !== Function && !opt.skipFactory && isFunction(defaultValue)) { + const { propsDefaults } = instance; + if (key in propsDefaults) { + value = propsDefaults[key]; + } else { + const reset = setCurrentInstance(instance); + value = propsDefaults[key] = defaultValue.call( + null, + props + ); + reset(); + } + } else { + value = defaultValue; + } + if (instance.ce) { + instance.ce._setProp(key, value); + } + } + if (opt[ + 0 + /* shouldCast */ + ]) { + if (isAbsent && !hasDefault) { + value = false; + } else if (opt[ + 1 + /* shouldCastTrue */ + ] && (value === "" || value === hyphenate(key))) { + value = true; + } + } + } + return value; +} +const mixinPropsCache = /* @__PURE__ */ new WeakMap(); +function normalizePropsOptions(comp, appContext, asMixin = false) { + const cache = asMixin ? mixinPropsCache : appContext.propsCache; + const cached = cache.get(comp); + if (cached) { + return cached; + } + const raw = comp.props; + const normalized = {}; + const needCastKeys = []; + let hasExtends = false; + if (!isFunction(comp)) { + const extendProps = (raw2) => { + hasExtends = true; + const [props, keys] = normalizePropsOptions(raw2, appContext, true); + extend(normalized, props); + if (keys) needCastKeys.push(...keys); + }; + if (!asMixin && appContext.mixins.length) { + appContext.mixins.forEach(extendProps); + } + if (comp.extends) { + extendProps(comp.extends); + } + if (comp.mixins) { + comp.mixins.forEach(extendProps); + } + } + if (!raw && !hasExtends) { + if (isObject$1(comp)) { + cache.set(comp, EMPTY_ARR); + } + return EMPTY_ARR; + } + if (isArray(raw)) { + for (let i = 0; i < raw.length; i++) { + const normalizedKey = camelize(raw[i]); + if (validatePropName(normalizedKey)) { + normalized[normalizedKey] = EMPTY_OBJ; + } + } + } else if (raw) { + for (const key in raw) { + const normalizedKey = camelize(key); + if (validatePropName(normalizedKey)) { + const opt = raw[key]; + const prop = normalized[normalizedKey] = isArray(opt) || isFunction(opt) ? { type: opt } : extend({}, opt); + const propType = prop.type; + let shouldCast = false; + let shouldCastTrue = true; + if (isArray(propType)) { + for (let index = 0; index < propType.length; ++index) { + const type = propType[index]; + const typeName = isFunction(type) && type.name; + if (typeName === "Boolean") { + shouldCast = true; + break; + } else if (typeName === "String") { + shouldCastTrue = false; + } + } + } else { + shouldCast = isFunction(propType) && propType.name === "Boolean"; + } + prop[ + 0 + /* shouldCast */ + ] = shouldCast; + prop[ + 1 + /* shouldCastTrue */ + ] = shouldCastTrue; + if (shouldCast || hasOwn(prop, "default")) { + needCastKeys.push(normalizedKey); + } + } + } + } + const res = [normalized, needCastKeys]; + if (isObject$1(comp)) { + cache.set(comp, res); + } + return res; +} +function validatePropName(key) { + if (key[0] !== "$" && !isReservedProp(key)) { + return true; + } + return false; +} +const isInternalKey = (key) => key === "_" || key === "_ctx" || key === "$stable"; +const normalizeSlotValue = (value) => isArray(value) ? value.map(normalizeVNode) : [normalizeVNode(value)]; +const normalizeSlot = (key, rawSlot, ctx) => { + if (rawSlot._n) { + return rawSlot; + } + const normalized = withCtx((...args) => { + if (false) ; + return normalizeSlotValue(rawSlot(...args)); + }, ctx); + normalized._c = false; + return normalized; +}; +const normalizeObjectSlots = (rawSlots, slots, instance) => { + const ctx = rawSlots._ctx; + for (const key in rawSlots) { + if (isInternalKey(key)) continue; + const value = rawSlots[key]; + if (isFunction(value)) { + slots[key] = normalizeSlot(key, value, ctx); + } else if (value != null) { + const normalized = normalizeSlotValue(value); + slots[key] = () => normalized; + } + } +}; +const normalizeVNodeSlots = (instance, children) => { + const normalized = normalizeSlotValue(children); + instance.slots.default = () => normalized; +}; +const assignSlots = (slots, children, optimized) => { + for (const key in children) { + if (optimized || !isInternalKey(key)) { + slots[key] = children[key]; + } + } +}; +const initSlots = (instance, children, optimized) => { + const slots = instance.slots = createInternalObject(); + if (instance.vnode.shapeFlag & 32) { + const type = children._; + if (type) { + assignSlots(slots, children, optimized); + if (optimized) { + def(slots, "_", type, true); + } + } else { + normalizeObjectSlots(children, slots); + } + } else if (children) { + normalizeVNodeSlots(instance, children); + } +}; +const updateSlots = (instance, children, optimized) => { + const { vnode, slots } = instance; + let needDeletionCheck = true; + let deletionComparisonTarget = EMPTY_OBJ; + if (vnode.shapeFlag & 32) { + const type = children._; + if (type) { + if (optimized && type === 1) { + needDeletionCheck = false; + } else { + assignSlots(slots, children, optimized); + } + } else { + needDeletionCheck = !children.$stable; + normalizeObjectSlots(children, slots); + } + deletionComparisonTarget = children; + } else if (children) { + normalizeVNodeSlots(instance, children); + deletionComparisonTarget = { default: 1 }; + } + if (needDeletionCheck) { + for (const key in slots) { + if (!isInternalKey(key) && deletionComparisonTarget[key] == null) { + delete slots[key]; + } + } + } +}; +const queuePostRenderEffect = queueEffectWithSuspense; +function createRenderer(options) { + return baseCreateRenderer(options); +} +function createHydrationRenderer(options) { + return baseCreateRenderer(options, createHydrationFunctions); +} +function baseCreateRenderer(options, createHydrationFns) { + const target = getGlobalThis(); + target.__VUE__ = true; + const { + insert: hostInsert, + remove: hostRemove, + patchProp: hostPatchProp, + createElement: hostCreateElement, + createText: hostCreateText, + createComment: hostCreateComment, + setText: hostSetText, + setElementText: hostSetElementText, + parentNode: hostParentNode, + nextSibling: hostNextSibling, + setScopeId: hostSetScopeId = NOOP, + insertStaticContent: hostInsertStaticContent + } = options; + const patch = (n1, n2, container, anchor = null, parentComponent = null, parentSuspense = null, namespace = void 0, slotScopeIds = null, optimized = !!n2.dynamicChildren) => { + if (n1 === n2) { + return; + } + if (n1 && !isSameVNodeType(n1, n2)) { + anchor = getNextHostNode(n1); + unmount(n1, parentComponent, parentSuspense, true); + n1 = null; + } + if (n2.patchFlag === -2) { + optimized = false; + n2.dynamicChildren = null; + } + const { type, ref: ref3, shapeFlag } = n2; + switch (type) { + case Text: + processText(n1, n2, container, anchor); + break; + case Comment: + processCommentNode(n1, n2, container, anchor); + break; + case Static: + if (n1 == null) { + mountStaticNode(n2, container, anchor, namespace); + } + break; + case Fragment: + processFragment( + n1, + n2, + container, + anchor, + parentComponent, + parentSuspense, + namespace, + slotScopeIds, + optimized + ); + break; + default: + if (shapeFlag & 1) { + processElement( + n1, + n2, + container, + anchor, + parentComponent, + parentSuspense, + namespace, + slotScopeIds, + optimized + ); + } else if (shapeFlag & 6) { + processComponent( + n1, + n2, + container, + anchor, + parentComponent, + parentSuspense, + namespace, + slotScopeIds, + optimized + ); + } else if (shapeFlag & 64) { + type.process( + n1, + n2, + container, + anchor, + parentComponent, + parentSuspense, + namespace, + slotScopeIds, + optimized, + internals + ); + } else if (shapeFlag & 128) { + type.process( + n1, + n2, + container, + anchor, + parentComponent, + parentSuspense, + namespace, + slotScopeIds, + optimized, + internals + ); + } else ; + } + if (ref3 != null && parentComponent) { + setRef(ref3, n1 && n1.ref, parentSuspense, n2 || n1, !n2); + } else if (ref3 == null && n1 && n1.ref != null) { + setRef(n1.ref, null, parentSuspense, n1, true); + } + }; + const processText = (n1, n2, container, anchor) => { + if (n1 == null) { + hostInsert( + n2.el = hostCreateText(n2.children), + container, + anchor + ); + } else { + const el = n2.el = n1.el; + if (n2.children !== n1.children) { + hostSetText(el, n2.children); + } + } + }; + const processCommentNode = (n1, n2, container, anchor) => { + if (n1 == null) { + hostInsert( + n2.el = hostCreateComment(n2.children || ""), + container, + anchor + ); + } else { + n2.el = n1.el; + } + }; + const mountStaticNode = (n2, container, anchor, namespace) => { + [n2.el, n2.anchor] = hostInsertStaticContent( + n2.children, + container, + anchor, + namespace, + n2.el, + n2.anchor + ); + }; + const moveStaticNode = ({ el, anchor }, container, nextSibling) => { + let next; + while (el && el !== anchor) { + next = hostNextSibling(el); + hostInsert(el, container, nextSibling); + el = next; + } + hostInsert(anchor, container, nextSibling); + }; + const removeStaticNode = ({ el, anchor }) => { + let next; + while (el && el !== anchor) { + next = hostNextSibling(el); + hostRemove(el); + el = next; + } + hostRemove(anchor); + }; + const processElement = (n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => { + if (n2.type === "svg") { + namespace = "svg"; + } else if (n2.type === "math") { + namespace = "mathml"; + } + if (n1 == null) { + mountElement( + n2, + container, + anchor, + parentComponent, + parentSuspense, + namespace, + slotScopeIds, + optimized + ); + } else { + const customElement = n1.el && n1.el._isVueCE ? n1.el : null; + try { + if (customElement) { + customElement._beginPatch(); + } + patchElement( + n1, + n2, + parentComponent, + parentSuspense, + namespace, + slotScopeIds, + optimized + ); + } finally { + if (customElement) { + customElement._endPatch(); + } + } + } + }; + const mountElement = (vnode, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => { + let el; + let vnodeHook; + const { props, shapeFlag, transition, dirs } = vnode; + el = vnode.el = hostCreateElement( + vnode.type, + namespace, + props && props.is, + props + ); + if (shapeFlag & 8) { + hostSetElementText(el, vnode.children); + } else if (shapeFlag & 16) { + mountChildren( + vnode.children, + el, + null, + parentComponent, + parentSuspense, + resolveChildrenNamespace(vnode, namespace), + slotScopeIds, + optimized + ); + } + if (dirs) { + invokeDirectiveHook(vnode, null, parentComponent, "created"); + } + setScopeId(el, vnode, vnode.scopeId, slotScopeIds, parentComponent); + if (props) { + for (const key in props) { + if (key !== "value" && !isReservedProp(key)) { + hostPatchProp(el, key, null, props[key], namespace, parentComponent); + } + } + if ("value" in props) { + hostPatchProp(el, "value", null, props.value, namespace); + } + if (vnodeHook = props.onVnodeBeforeMount) { + invokeVNodeHook(vnodeHook, parentComponent, vnode); + } + } + if (dirs) { + invokeDirectiveHook(vnode, null, parentComponent, "beforeMount"); + } + const needCallTransitionHooks = needTransition(parentSuspense, transition); + if (needCallTransitionHooks) { + transition.beforeEnter(el); + } + hostInsert(el, container, anchor); + if ((vnodeHook = props && props.onVnodeMounted) || needCallTransitionHooks || dirs) { + queuePostRenderEffect(() => { + try { + vnodeHook && invokeVNodeHook(vnodeHook, parentComponent, vnode); + needCallTransitionHooks && transition.enter(el); + dirs && invokeDirectiveHook(vnode, null, parentComponent, "mounted"); + } finally { + } + }, parentSuspense); + } + }; + const setScopeId = (el, vnode, scopeId, slotScopeIds, parentComponent) => { + if (scopeId) { + hostSetScopeId(el, scopeId); + } + if (slotScopeIds) { + for (let i = 0; i < slotScopeIds.length; i++) { + hostSetScopeId(el, slotScopeIds[i]); + } + } + if (parentComponent) { + let subTree = parentComponent.subTree; + if (vnode === subTree || isSuspense(subTree.type) && (subTree.ssContent === vnode || subTree.ssFallback === vnode)) { + const parentVNode = parentComponent.vnode; + setScopeId( + el, + parentVNode, + parentVNode.scopeId, + parentVNode.slotScopeIds, + parentComponent.parent + ); + } + } + }; + const mountChildren = (children, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, start = 0) => { + for (let i = start; i < children.length; i++) { + const child = children[i] = optimized ? cloneIfMounted(children[i]) : normalizeVNode(children[i]); + patch( + null, + child, + container, + anchor, + parentComponent, + parentSuspense, + namespace, + slotScopeIds, + optimized + ); + } + }; + const patchElement = (n1, n2, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => { + const el = n2.el = n1.el; + let { patchFlag, dynamicChildren, dirs } = n2; + patchFlag |= n1.patchFlag & 16; + const oldProps = n1.props || EMPTY_OBJ; + const newProps = n2.props || EMPTY_OBJ; + let vnodeHook; + parentComponent && toggleRecurse(parentComponent, false); + if (vnodeHook = newProps.onVnodeBeforeUpdate) { + invokeVNodeHook(vnodeHook, parentComponent, n2, n1); + } + if (dirs) { + invokeDirectiveHook(n2, n1, parentComponent, "beforeUpdate"); + } + parentComponent && toggleRecurse(parentComponent, true); + if ( + // #6385 the old vnode may be a user-wrapped non-isomorphic block + // Force full diff when block metadata is unstable. + dynamicChildren && (!n1.dynamicChildren || n1.dynamicChildren.length !== dynamicChildren.length) + ) { + patchFlag = 0; + optimized = false; + dynamicChildren = null; + } + if (oldProps.innerHTML && newProps.innerHTML == null || oldProps.textContent && newProps.textContent == null) { + hostSetElementText(el, ""); + } + if (dynamicChildren) { + patchBlockChildren( + n1.dynamicChildren, + dynamicChildren, + el, + parentComponent, + parentSuspense, + resolveChildrenNamespace(n2, namespace), + slotScopeIds + ); + } else if (!optimized) { + patchChildren( + n1, + n2, + el, + null, + parentComponent, + parentSuspense, + resolveChildrenNamespace(n2, namespace), + slotScopeIds, + false + ); + } + if (patchFlag > 0) { + if (patchFlag & 16) { + patchProps(el, oldProps, newProps, parentComponent, namespace); + } else { + if (patchFlag & 2) { + if (oldProps.class !== newProps.class) { + hostPatchProp(el, "class", null, newProps.class, namespace); + } + } + if (patchFlag & 4) { + hostPatchProp(el, "style", oldProps.style, newProps.style, namespace); + } + if (patchFlag & 8) { + const propsToUpdate = n2.dynamicProps; + for (let i = 0; i < propsToUpdate.length; i++) { + const key = propsToUpdate[i]; + const prev = oldProps[key]; + const next = newProps[key]; + if (next !== prev || key === "value") { + hostPatchProp(el, key, prev, next, namespace, parentComponent); + } + } + } + } + if (patchFlag & 1) { + if (n1.children !== n2.children) { + hostSetElementText(el, n2.children); + } + } + } else if (!optimized && dynamicChildren == null) { + patchProps(el, oldProps, newProps, parentComponent, namespace); + } + if ((vnodeHook = newProps.onVnodeUpdated) || dirs) { + queuePostRenderEffect(() => { + vnodeHook && invokeVNodeHook(vnodeHook, parentComponent, n2, n1); + dirs && invokeDirectiveHook(n2, n1, parentComponent, "updated"); + }, parentSuspense); + } + }; + const patchBlockChildren = (oldChildren, newChildren, fallbackContainer, parentComponent, parentSuspense, namespace, slotScopeIds) => { + for (let i = 0; i < newChildren.length; i++) { + const oldVNode = oldChildren[i]; + const newVNode = newChildren[i]; + const container = ( + // oldVNode may be an errored async setup() component inside Suspense + // which will not have a mounted element + oldVNode.el && // - In the case of a Fragment, we need to provide the actual parent + // of the Fragment itself so it can move its children. + (oldVNode.type === Fragment || // - In the case of different nodes, there is going to be a replacement + // which also requires the correct parent container + !isSameVNodeType(oldVNode, newVNode) || // - In the case of a component, it could contain anything. + oldVNode.shapeFlag & (6 | 64 | 128)) ? hostParentNode(oldVNode.el) : ( + // In other cases, the parent container is not actually used so we + // just pass the block element here to avoid a DOM parentNode call. + fallbackContainer + ) + ); + patch( + oldVNode, + newVNode, + container, + null, + parentComponent, + parentSuspense, + namespace, + slotScopeIds, + true + ); + } + }; + const patchProps = (el, oldProps, newProps, parentComponent, namespace) => { + if (oldProps !== newProps) { + if (oldProps !== EMPTY_OBJ) { + for (const key in oldProps) { + if (!isReservedProp(key) && !(key in newProps)) { + hostPatchProp( + el, + key, + oldProps[key], + null, + namespace, + parentComponent + ); + } + } + } + for (const key in newProps) { + if (isReservedProp(key)) continue; + const next = newProps[key]; + const prev = oldProps[key]; + if (next !== prev && key !== "value") { + hostPatchProp(el, key, prev, next, namespace, parentComponent); + } + } + if ("value" in newProps) { + hostPatchProp(el, "value", oldProps.value, newProps.value, namespace); + } + } + }; + const processFragment = (n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => { + const fragmentStartAnchor = n2.el = n1 ? n1.el : hostCreateText(""); + const fragmentEndAnchor = n2.anchor = n1 ? n1.anchor : hostCreateText(""); + let { patchFlag, dynamicChildren, slotScopeIds: fragmentSlotScopeIds } = n2; + if (fragmentSlotScopeIds) { + slotScopeIds = slotScopeIds ? slotScopeIds.concat(fragmentSlotScopeIds) : fragmentSlotScopeIds; + } + if (n1 == null) { + hostInsert(fragmentStartAnchor, container, anchor); + hostInsert(fragmentEndAnchor, container, anchor); + mountChildren( + // #10007 + // such fragment like `<>` will be compiled into + // a fragment which doesn't have a children. + // In this case fallback to an empty array + n2.children || [], + container, + fragmentEndAnchor, + parentComponent, + parentSuspense, + namespace, + slotScopeIds, + optimized + ); + } else { + if (patchFlag > 0 && patchFlag & 64 && dynamicChildren && // #2715 the previous fragment could've been a BAILed one as a result + // of renderSlot() with no valid children + n1.dynamicChildren && n1.dynamicChildren.length === dynamicChildren.length) { + patchBlockChildren( + n1.dynamicChildren, + dynamicChildren, + container, + parentComponent, + parentSuspense, + namespace, + slotScopeIds + ); + if ( + // #2080 if the stable fragment has a key, it's a