Merge pull request #776 from abraxas914/codex/react-desktop-v2-upstream-final
feat(desktop): integrate compiled React Desktop 2.0
This commit is contained in:
158 files changed
+16383
-1535
No files matched your search
@@ -3,3 +3,7 @@
|
||||
*.command text eol=lf
|
||||
*.ps1 text eol=crlf
|
||||
*.bat text eol=crlf
|
||||
|
||||
# Preserve the byte-exact third-party notice in source and generated delivery trees.
|
||||
frontends/desktop/public/THIRD_PARTY_NOTICES.txt text eol=lf
|
||||
frontends/desktop/dist/THIRD_PARTY_NOTICES.txt text eol=lf
|
||||
@@ -0,0 +1,168 @@
|
||||
name: Desktop 2.0 Quality Gates
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [main]
|
||||
paths:
|
||||
- "agentmain.py"
|
||||
- "llmcore.py"
|
||||
- "llmcore/**"
|
||||
- "frontends/conductor.py"
|
||||
- "frontends/cost_tracker.py"
|
||||
- "frontends/data_backup.py"
|
||||
- "frontends/desktop_bridge.py"
|
||||
- "frontends/desktop_settings.py"
|
||||
- "frontends/ga_contract_probe.py"
|
||||
- "frontends/tests/**"
|
||||
- "frontends/desktop/**"
|
||||
- ".gitattributes"
|
||||
- ".github/workflows/desktop-ci.yml"
|
||||
- ".github/workflows/desktop-release-package.yml"
|
||||
pull_request:
|
||||
branches: [main]
|
||||
paths:
|
||||
- "agentmain.py"
|
||||
- "llmcore.py"
|
||||
- "llmcore/**"
|
||||
- "frontends/conductor.py"
|
||||
- "frontends/cost_tracker.py"
|
||||
- "frontends/data_backup.py"
|
||||
- "frontends/desktop_bridge.py"
|
||||
- "frontends/desktop_settings.py"
|
||||
- "frontends/ga_contract_probe.py"
|
||||
- "frontends/tests/**"
|
||||
- "frontends/desktop/**"
|
||||
- ".gitattributes"
|
||||
- ".github/workflows/desktop-ci.yml"
|
||||
- ".github/workflows/desktop-release-package.yml"
|
||||
workflow_dispatch:
|
||||
|
||||
concurrency:
|
||||
group: desktop-v2-${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
|
||||
cancel-in-progress: true
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
env:
|
||||
PYTHONUNBUFFERED: "1"
|
||||
CARGO_TERM_COLOR: always
|
||||
|
||||
jobs:
|
||||
distribution-contract:
|
||||
name: Compiled distribution contract
|
||||
runs-on: ubuntu-24.04
|
||||
timeout-minutes: 10
|
||||
steps:
|
||||
- uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5.0.1
|
||||
- uses: actions/setup-node@a0853c24544627f65ddf259abe73b1d18a591444 # v5.0.0
|
||||
with:
|
||||
node-version: 22
|
||||
- name: Verify tracked React distribution and package metadata
|
||||
working-directory: frontends/desktop
|
||||
run: npm run test:dist
|
||||
- name: Verify packaging helper syntax
|
||||
run: |
|
||||
bash -n frontends/desktop/packaging/scripts/macos/install_macos.sh
|
||||
bash -n frontends/desktop/scripts/post-dmg.sh
|
||||
python3 -m py_compile frontends/desktop/scripts/gen_ds_store.py
|
||||
- name: Reject source and local-development leakage
|
||||
run: |
|
||||
test -z "$(git ls-files -- \
|
||||
'frontends/desktop/src/**' \
|
||||
'frontends/desktop/public/**' \
|
||||
'frontends/desktop/vite.config.*' \
|
||||
'frontends/desktop/tsconfig*.json' \
|
||||
'.agents/**' '.codex/**' '.trellis/**')"
|
||||
test -z "$(find frontends/desktop/dist -type f \
|
||||
\( -name '*.map' -o -name '*.ts' -o -name '*.tsx' -o -name '*.jsx' \) -print)"
|
||||
! git grep -nE '^(<<<<<<<|=======|>>>>>>>)' -- .github frontends
|
||||
|
||||
python-contracts:
|
||||
name: Python ${{ matrix.python-version }}
|
||||
needs: distribution-contract
|
||||
runs-on: ubuntu-24.04
|
||||
timeout-minutes: 15
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
python-version: ["3.10", "3.11", "3.12", "3.13"]
|
||||
steps:
|
||||
- uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5.0.1
|
||||
- uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
|
||||
with:
|
||||
python-version: ${{ matrix.python-version }}
|
||||
cache: pip
|
||||
cache-dependency-path: frontends/tests/requirements.txt
|
||||
- name: Install Desktop test dependencies
|
||||
run: python -m pip install -r frontends/tests/requirements.txt
|
||||
- name: Run bridge, conductor, cost and backup contracts
|
||||
run: >-
|
||||
python -m pytest frontends/tests -q
|
||||
--ignore=frontends/tests/test_release_qualification.py
|
||||
- name: Run release qualification tooling contracts
|
||||
if: matrix.python-version == '3.12'
|
||||
run: python -m pytest frontends/tests/test_release_qualification.py -q
|
||||
|
||||
rust-contracts:
|
||||
name: Rust ${{ matrix.feature.name }}
|
||||
needs: distribution-contract
|
||||
runs-on: ubuntu-24.04
|
||||
timeout-minutes: 35
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
feature:
|
||||
- name: production
|
||||
args: ""
|
||||
- name: e2e
|
||||
args: "--features e2e"
|
||||
steps:
|
||||
- uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5.0.1
|
||||
- name: Install Tauri system dependencies
|
||||
run: >-
|
||||
sudo apt-get update && sudo apt-get install -y
|
||||
libwebkit2gtk-4.1-dev libappindicator3-dev librsvg2-dev patchelf
|
||||
- uses: dtolnay/rust-toolchain@4360b52568e2003a75bf9bc1d59f33a8e3fc893c # stable action snapshot
|
||||
with:
|
||||
toolchain: "1.95.0"
|
||||
components: clippy, rustfmt
|
||||
- uses: Swatinem/rust-cache@63fed3e2fecf6f7b51dc6f043341b79ef82a9ae7 # v2.9.2
|
||||
with:
|
||||
workspaces: frontends/desktop/src-tauri -> target
|
||||
- name: Verify Rust formatting
|
||||
run: cargo fmt --manifest-path frontends/desktop/src-tauri/Cargo.toml --check
|
||||
- name: Lint Tauri shell
|
||||
run: cargo clippy --manifest-path frontends/desktop/src-tauri/Cargo.toml --all-targets ${{ matrix.feature.args }} -- -D warnings
|
||||
- name: Run Tauri shell contracts
|
||||
run: cargo test --manifest-path frontends/desktop/src-tauri/Cargo.toml ${{ matrix.feature.args }}
|
||||
|
||||
linux-tauri-build:
|
||||
name: Linux Tauri build smoke
|
||||
needs: [distribution-contract, python-contracts, rust-contracts]
|
||||
runs-on: ubuntu-24.04
|
||||
timeout-minutes: 45
|
||||
steps:
|
||||
- uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5.0.1
|
||||
- name: Install Tauri system dependencies
|
||||
run: >-
|
||||
sudo apt-get update && sudo apt-get install -y
|
||||
libwebkit2gtk-4.1-dev libappindicator3-dev librsvg2-dev patchelf
|
||||
- uses: actions/setup-node@a0853c24544627f65ddf259abe73b1d18a591444 # v5.0.0
|
||||
with:
|
||||
node-version: 22
|
||||
- uses: dtolnay/rust-toolchain@4360b52568e2003a75bf9bc1d59f33a8e3fc893c # stable action snapshot
|
||||
with:
|
||||
toolchain: "1.95.0"
|
||||
- uses: Swatinem/rust-cache@63fed3e2fecf6f7b51dc6f043341b79ef82a9ae7 # v2.9.2
|
||||
with:
|
||||
workspaces: frontends/desktop/src-tauri -> target
|
||||
- name: Install Tauri CLI only
|
||||
working-directory: frontends/desktop
|
||||
run: |
|
||||
npm install --package-lock=false
|
||||
node -e "const v=require('./node_modules/@tauri-apps/cli/package.json').version; if(v!=='2.11.4') throw new Error('unexpected Tauri CLI '+v)"
|
||||
test ! -e package-lock.json
|
||||
- name: Build tracked Desktop 2.0 distribution into the native shell
|
||||
working-directory: frontends/desktop
|
||||
run: npm run tauri build -- --no-bundle
|
||||
File diff suppressed because it is too large.
Load diff
@@ -9,6 +9,8 @@ venv/
|
||||
env/
|
||||
build/
|
||||
dist/
|
||||
!frontends/desktop/dist/
|
||||
!frontends/desktop/dist/**
|
||||
*.egg-info/
|
||||
|
||||
.streamlit/
|
||||
|
||||
+204
-47
@@ -9,32 +9,62 @@ from fastapi.middleware.cors import CORSMiddleware
|
||||
from pydantic import BaseModel
|
||||
|
||||
def _resolve_ga_root() -> str:
|
||||
"""External core dir when launched as the bundle's conductor (design 三).
|
||||
Prefer GA_ROOT env (set by the desktop bridge), else derive from own location."""
|
||||
val = (os.environ.get("GA_ROOT", "") or "").strip()
|
||||
if val:
|
||||
root = os.path.abspath(os.path.expanduser(val))
|
||||
"""Use the external core selected by the package-owned desktop bridge when valid."""
|
||||
value = (os.environ.get("GA_ROOT", "") or "").strip()
|
||||
if value:
|
||||
root = os.path.abspath(os.path.expanduser(value))
|
||||
if os.path.exists(os.path.join(root, "agentmain.py")):
|
||||
return root
|
||||
return os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
|
||||
|
||||
|
||||
ROOT = _resolve_ga_root()
|
||||
if ROOT not in sys.path: sys.path.insert(0, ROOT)
|
||||
|
||||
from agentmain import GenericAgent
|
||||
|
||||
HOST = "127.0.0.1"
|
||||
PORT = 8900
|
||||
DEFAULT_PORT = 8900
|
||||
E2E_CONDUCTOR_PORT_ENV = "GA_DESKTOP_E2E_CONDUCTOR_PORT"
|
||||
E2E_REPORT_DIR_ENV = "GA_DESKTOP_E2E_REPORT_DIR"
|
||||
|
||||
|
||||
def _parse_conductor_port(value: Any) -> int:
|
||||
raw = str(value).strip()
|
||||
if not raw.isascii() or not raw.isdigit():
|
||||
raise argparse.ArgumentTypeError("conductor port must be an integer between 1 and 65535")
|
||||
port = int(raw)
|
||||
if not 1 <= port <= 65535:
|
||||
raise argparse.ArgumentTypeError("conductor port must be an integer between 1 and 65535")
|
||||
return port
|
||||
|
||||
|
||||
def _default_conductor_port() -> int:
|
||||
"""Keep production on :8900; only the isolated package journey may override it.
|
||||
|
||||
The renderer and production CSP intentionally target :8900. Treating this as a
|
||||
general runtime setting would make the backend claim configurability the renderer
|
||||
cannot honor, so the override is gated by the existing package-evidence marker.
|
||||
"""
|
||||
if not os.environ.get(E2E_REPORT_DIR_ENV):
|
||||
return DEFAULT_PORT
|
||||
raw = os.environ.get(E2E_CONDUCTOR_PORT_ENV)
|
||||
return DEFAULT_PORT if raw is None else _parse_conductor_port(raw)
|
||||
|
||||
|
||||
PORT = _default_conductor_port()
|
||||
HTML_PATH = os.path.join(os.path.dirname(os.path.abspath(__file__)), "conductor.html")
|
||||
|
||||
parser = argparse.ArgumentParser()
|
||||
parser.add_argument("--host", default=HOST)
|
||||
parser.add_argument("--port", type=int, default=PORT)
|
||||
parser.add_argument("--port", type=_parse_conductor_port, default=PORT)
|
||||
parser.add_argument("--key")
|
||||
parser.add_argument("--no-browser", action="store_true")
|
||||
args = parser.parse_args()
|
||||
if args.host not in ("127.0.0.1", "localhost", "::1") and not args.key:
|
||||
parser.error("--key is required for non-loopback listening")
|
||||
HOST = args.host
|
||||
PORT = args.port
|
||||
|
||||
|
||||
def _settings_doc() -> dict:
|
||||
@@ -63,47 +93,109 @@ def _client_usable(agent: "GenericAgent") -> bool:
|
||||
return hasattr(getattr(agent, "llmclient", None), "backend")
|
||||
|
||||
|
||||
def _fallback_usable_model(agent: "GenericAgent") -> None:
|
||||
for i, client in enumerate(getattr(agent, "llmclients", []) or []):
|
||||
if not hasattr(client, "backend"):
|
||||
continue
|
||||
agent.llm_no = i
|
||||
agent.llmclient = client
|
||||
def _parse_model_no(value: Any) -> Optional[int]:
|
||||
if value is None or isinstance(value, bool):
|
||||
return None
|
||||
try:
|
||||
return int(value)
|
||||
except (TypeError, ValueError):
|
||||
return None
|
||||
|
||||
|
||||
def _usable_model(agent: "GenericAgent", no: Optional[int]) -> bool:
|
||||
clients = getattr(agent, "llmclients", []) or []
|
||||
return no is not None and 0 <= no < len(clients) and hasattr(clients[no], "backend")
|
||||
|
||||
|
||||
def _activate_model(agent: "GenericAgent", no: int) -> None:
|
||||
if not _usable_model(agent, no):
|
||||
raise ValueError(f"llm index out of range or unavailable: {no}")
|
||||
agent.next_llm(no)
|
||||
|
||||
|
||||
def _runtime_model_state(agent: "GenericAgent", configured: Optional[int], reason: Optional[str]) -> dict:
|
||||
effective = getattr(agent, "llm_no", None) if _client_usable(agent) else None
|
||||
current = None
|
||||
if _client_usable(agent):
|
||||
with suppress(Exception):
|
||||
agent.llmclient.last_tools = ''
|
||||
return
|
||||
current = str(agent.llmclient.backend.name)
|
||||
return {"configured": configured, "effective": effective,
|
||||
"fallbackReason": reason, "current": current}
|
||||
|
||||
|
||||
def _apply_desktop_model(agent: "GenericAgent") -> None:
|
||||
def _apply_desktop_model(agent: "GenericAgent") -> dict:
|
||||
"""Make the conductor's session reflect the current desktop config before a task:
|
||||
switch to its bound model if one is set, otherwise still refresh sessions from
|
||||
mykey so live key/model edits (e.g. importing keys) take effect without a restart.
|
||||
next_llm() already reloads internally; the no-bound-model branch must reload too,
|
||||
or a conductor started on an empty/stale mykey would never pick up imported keys."""
|
||||
no = _conductor_llm_no()
|
||||
if no is not None:
|
||||
try:
|
||||
agent.next_llm(int(no))
|
||||
except Exception as e:
|
||||
print(f"[conductor] failed to apply conductor model #{no}: {e}", file=sys.stderr)
|
||||
else:
|
||||
doc = _settings_doc()
|
||||
conductor_cfg = doc.get("conductor") if isinstance(doc.get("conductor"), dict) else {}
|
||||
ui_cfg = doc.get("ui") if isinstance(doc.get("ui"), dict) else {}
|
||||
raw_configured = conductor_cfg.get("llmNo")
|
||||
configured = _parse_model_no(raw_configured)
|
||||
ui_default = _parse_model_no(ui_cfg.get("llmNo"))
|
||||
|
||||
try:
|
||||
agent.load_llm_sessions() # mtime-guarded; rebuilds only when mykey changed
|
||||
if not _client_usable(agent):
|
||||
print("[conductor] selected model is unavailable; falling back to first usable model", file=sys.stderr)
|
||||
_fallback_usable_model(agent)
|
||||
except Exception as e:
|
||||
print(f"[conductor] failed to refresh model sessions: {e}", file=sys.stderr)
|
||||
|
||||
clients = getattr(agent, "llmclients", []) or []
|
||||
|
||||
configured_failed = False
|
||||
if _usable_model(agent, configured):
|
||||
try:
|
||||
_activate_model(agent, configured)
|
||||
return _runtime_model_state(agent, configured, None)
|
||||
except Exception as e:
|
||||
configured_failed = True
|
||||
print(f"[conductor] configured model #{configured} is unavailable: {e}", file=sys.stderr)
|
||||
|
||||
if _usable_model(agent, ui_default):
|
||||
if raw_configured is None:
|
||||
reason = "ui_default"
|
||||
elif configured_failed:
|
||||
reason = "configured_unavailable"
|
||||
elif configured is not None:
|
||||
reason = "configured_unavailable" if 0 <= configured < len(clients) else "invalid_configured"
|
||||
else:
|
||||
reason = "invalid_configured"
|
||||
try:
|
||||
_activate_model(agent, ui_default)
|
||||
return _runtime_model_state(agent, configured, reason)
|
||||
except Exception as e:
|
||||
print(f"[conductor] UI default model #{ui_default} is unavailable: {e}", file=sys.stderr)
|
||||
|
||||
for i, client in enumerate(clients):
|
||||
if hasattr(client, "backend"):
|
||||
try:
|
||||
_activate_model(agent, i)
|
||||
return _runtime_model_state(agent, configured, "first_available")
|
||||
except Exception:
|
||||
continue
|
||||
|
||||
print("[conductor] no usable model is available", file=sys.stderr)
|
||||
return {"configured": configured, "effective": None,
|
||||
"fallbackReason": "no_models", "current": None}
|
||||
|
||||
|
||||
def _select_llm(agent: "GenericAgent", llm: Any) -> bool:
|
||||
if llm is None or str(llm).strip() == "": return False
|
||||
q = str(llm).strip()
|
||||
if isinstance(llm, int) or q.isdigit(): agent.next_llm(int(q)); return True
|
||||
if isinstance(llm, int) or q.isdigit():
|
||||
agent.load_llm_sessions()
|
||||
_activate_model(agent, int(q))
|
||||
return True
|
||||
q = q.lower(); agent.load_llm_sessions()
|
||||
for i, c in enumerate(agent.llmclients):
|
||||
if not hasattr(c, "backend"):
|
||||
continue
|
||||
vals = []
|
||||
for fn in (lambda: agent.get_llm_name(c), lambda: agent.get_llm_name(c, model=True), lambda: c.backend.name, lambda: c.backend.model):
|
||||
try: vals.append(str(fn()).lower())
|
||||
except Exception: pass
|
||||
if any(q in v for v in vals): agent.next_llm(i); return True
|
||||
if any(q in v for v in vals): _activate_model(agent, i); return True
|
||||
raise ValueError(f"llm not found: {llm}")
|
||||
|
||||
|
||||
@@ -362,8 +454,8 @@ GET /files?path=...\t列举目录(默认temp,最高到GA上一级)
|
||||
GET /file?path=...\t下载文件
|
||||
POST /file?name=...\t上传到temp/uploads
|
||||
POST /subagent/{{id}}\tbody: {{"action": "keyinfo", "msg": "..."}}\t注入key_info(agent下轮可见)
|
||||
POST /subagent/{{id}}\tbody: {{"action": "input", "msg": "..."}}\t对subagent输入下一条指令;指定模型加参数llm(数字/名称)
|
||||
POST /subagent/{{id}}\tbody: {{"action": "stop"}}\t中断执行但保留(可继续input)
|
||||
POST /subagent/{{id}}\tbody: {{"action": "input", "msg": "..."}}\t开新一轮任务;指定模型加参数llm(数字/名称)
|
||||
POST /subagent/{{id}}\tbody: {{"action": "stop"}}\t中断执行但保留(可继续input/reply)
|
||||
GET /chat?last=N\t返回最近N条对话(默认20)
|
||||
GET /subagent\t返回 {{"items": [...]}}\t查看所有subagent状态
|
||||
GET /subagent/{{id}}?max_len=N\t返回单个subagent详情,reply经清洗后截取尾部max_len字(默认5000)。仅在摘要不够判断时使用
|
||||
@@ -401,10 +493,56 @@ class Conductor:
|
||||
self.inbox: "queue.Queue[dict]" = queue.Queue() # 收件箱:唯一对外接口
|
||||
self.agent: Optional[GenericAgent] = None
|
||||
self.started = False
|
||||
self._runner_thread: Optional[threading.Thread] = None
|
||||
self.log: list = []
|
||||
self._model_lock = threading.RLock()
|
||||
self._model_state = {
|
||||
"configured": None,
|
||||
"effective": None,
|
||||
"fallbackReason": "no_models",
|
||||
"current": None,
|
||||
"running": False,
|
||||
}
|
||||
|
||||
def model_snapshot(self) -> dict:
|
||||
with self._model_lock:
|
||||
return dict(self._model_state)
|
||||
|
||||
def _publish_model_state(self, state: dict, running: bool) -> None:
|
||||
snapshot = {**state, "running": bool(running)}
|
||||
with self._model_lock:
|
||||
self._model_state = snapshot
|
||||
schedule_broadcast({"type": "model", "model": snapshot})
|
||||
|
||||
def notify(self, event: dict): self.inbox.put(event)
|
||||
|
||||
def _wait_for_agent_idle(self, timeout: float = 10.0) -> None:
|
||||
"""Queue.join semantics with a bounded runner-health escape hatch."""
|
||||
tasks = self.agent.task_queue
|
||||
deadline = time.monotonic() + timeout
|
||||
with tasks.all_tasks_done:
|
||||
while tasks.unfinished_tasks:
|
||||
if self._runner_thread is not None and not self._runner_thread.is_alive():
|
||||
raise RuntimeError("conductor agent runner stopped before task cleanup")
|
||||
remaining = deadline - time.monotonic()
|
||||
if remaining <= 0:
|
||||
raise TimeoutError("conductor agent task cleanup timed out")
|
||||
tasks.all_tasks_done.wait(min(0.25, remaining))
|
||||
|
||||
def _record_unavailable_model(self, events: list) -> None:
|
||||
event_label = ",".join(event.get("type", "") for event in events) or "wake"
|
||||
item = {
|
||||
"id": short_id(),
|
||||
"ts": now_ms(),
|
||||
"event": event_label,
|
||||
"turn": None,
|
||||
"text": "Conductor paused: no usable model profiles are configured; events are deferred.",
|
||||
}
|
||||
self.log.append(item)
|
||||
if len(self.log) > self.LOG_MAX:
|
||||
self.log.pop(0)
|
||||
schedule_broadcast({"type": "log", "item": item})
|
||||
|
||||
def _build_prompt(self, events: list) -> str:
|
||||
running, stopped = pool.counts()
|
||||
unread = sum(1 for m in chat_messages if m.get("role") == "user" and not m.get("read"))
|
||||
@@ -460,33 +598,55 @@ API: {base};requests,GET /readme查用法,GET /chat读未读对话,GET /
|
||||
|
||||
def _run(self):
|
||||
self.agent.inc_out = True
|
||||
start_agent_runner(self.agent, "conductor-agent")
|
||||
self._runner_thread = start_agent_runner(self.agent, "conductor-agent")
|
||||
self.started = True
|
||||
deferred_events: list = []
|
||||
while True:
|
||||
# Block until first event arrives
|
||||
first = self.inbox.get()
|
||||
self.inbox.task_done()
|
||||
# Short debounce: collect any additional events that arrived meanwhile
|
||||
time.sleep(0.3)
|
||||
events = [first]
|
||||
events = [*deferred_events, first]
|
||||
deferred_events = []
|
||||
while not self.inbox.empty():
|
||||
try:
|
||||
events.append(self.inbox.get_nowait())
|
||||
self.inbox.task_done()
|
||||
except Exception:
|
||||
break
|
||||
kind = first.get("type"); others = [e for e in events if e.get("type") != kind]; events = [e for e in events if e.get("type") == kind] or [first]
|
||||
for e in others: self.inbox.put(e)
|
||||
try:
|
||||
# GenericAgent publishes the display ``done`` item before its
|
||||
# runner finishes history persistence and task cleanup. Do not
|
||||
# mutate the live client until that previous task has reached
|
||||
# ``task_done``; the queue join is the authoritative idle barrier.
|
||||
self._wait_for_agent_idle()
|
||||
# Settings can change while this long-lived process remains healthy.
|
||||
# Refresh only at the task boundary so an in-flight task keeps its
|
||||
# client, while the next task observes the newly persisted binding.
|
||||
model_state = _apply_desktop_model(self.agent)
|
||||
if model_state.get("effective") is None:
|
||||
self._publish_model_state(model_state, running=False)
|
||||
self._record_unavailable_model(events)
|
||||
deferred_events = events
|
||||
continue
|
||||
kind = events[0].get("type")
|
||||
other_events = [event for event in events if event.get("type") != kind]
|
||||
events = [event for event in events if event.get("type") == kind]
|
||||
for event in other_events:
|
||||
self.inbox.put(event)
|
||||
prompt = self._build_prompt(events)
|
||||
dq = self.agent.put_task(prompt, source="conductor")
|
||||
self._drain(dq, events)
|
||||
except Exception as e:
|
||||
print(f"Conductor error: {e}")
|
||||
add_chat(f"⚠ 回复失败:{e}", role="error")
|
||||
self._publish_model_state(model_state, running=True)
|
||||
try:
|
||||
dq = self.agent.put_task(prompt, source="conductor")
|
||||
self._drain(dq, events)
|
||||
finally:
|
||||
self._publish_model_state(model_state, running=False)
|
||||
except Exception as e: print(f"Conductor error: {e}")
|
||||
|
||||
def start(self):
|
||||
self.agent = GenericAgent(); _apply_desktop_model(self.agent)
|
||||
self.agent = GenericAgent()
|
||||
self._publish_model_state(_apply_desktop_model(self.agent), running=False)
|
||||
threading.Thread(target=self._run, name="conductor-loop", daemon=True).start()
|
||||
|
||||
|
||||
@@ -494,9 +654,6 @@ conductor = Conductor()
|
||||
|
||||
# ---- IM poller: 探测conductor_im_plugins/下各插件,信号变化→唤醒总管 ----
|
||||
def _resolve_im_dir() -> str:
|
||||
# 方案三: conductor.py itself is bundle-owned, but IM plugins are user/environment
|
||||
# integrations. Prefer the external core's plugins when GA_ROOT points at one; fall back
|
||||
# to the bundle templates/examples when the external core has no plugin directory.
|
||||
external = os.path.join(ROOT, "frontends", "conductor_im_plugins")
|
||||
if os.path.isdir(external):
|
||||
return external
|
||||
@@ -640,12 +797,12 @@ async def websocket(ws: WebSocket):
|
||||
ws_clients.add(ws)
|
||||
try:
|
||||
running = any(s.status == "running" for s in pool.subagents.values())
|
||||
await ws.send_json({"type": "hello", "subagents": pool.snapshot(), "chat": chat_messages, "log": conductor.log, "running": running, "llms": conductor.agent.list_llms(), "llm": conductor.agent.llm_no})
|
||||
await ws.send_json({"type": "hello", "subagents": pool.snapshot(), "chat": chat_messages,
|
||||
"log": conductor.log, "running": running,
|
||||
"model": conductor.model_snapshot(),
|
||||
"llms": conductor.agent.list_llms(), "llm": conductor.agent.llm_no})
|
||||
while True:
|
||||
data = await ws.receive_json()
|
||||
if "llm" in data:
|
||||
if type(n := data["llm"]) is int and 0 <= n < len(conductor.agent.list_llms()): conductor.agent.next_llm(n)
|
||||
continue
|
||||
msg = (data.get("msg") or "").strip()
|
||||
if not msg: continue
|
||||
add_chat(msg, role="user", files=data.get("files") or [], images=data.get("images") or [])
|
||||
|
||||
+252
-2
@@ -9,8 +9,9 @@ Subagent processes are out-of-process, so `scan_subagent_logs` parses the
|
||||
same `[Cache]` / `[Output]` print lines from `temp/*/stdout.log`.
|
||||
"""
|
||||
from __future__ import annotations
|
||||
import glob, os, re, threading, time
|
||||
import glob, json, os, re, threading, time
|
||||
from dataclasses import dataclass, field
|
||||
from pathlib import Path
|
||||
|
||||
|
||||
@dataclass
|
||||
@@ -70,6 +71,247 @@ _CACHE_RE_OLD = re.compile(r'\[Cache\]\s+input=(\d+)\s+cached=(\d+)')
|
||||
_INSTALLED = False
|
||||
_SUBAGENT_GLOB = os.path.join("temp", "*", "stdout.log")
|
||||
|
||||
# ── Per-call ledger ──────────────────────────────────────────────────────────
|
||||
|
||||
_ledger_path: Path | None = None
|
||||
_ledger_fd = None
|
||||
_ledger_lock = threading.RLock()
|
||||
_ledger_uncompacted_bytes = 0
|
||||
_LEDGER_FILENAME = "token_ledger.jsonl"
|
||||
_LEGACY_HISTORY_FILENAME = "desktop_token_history.json"
|
||||
_COMPACT_THRESHOLD = 10 * 1024 * 1024 # 10MB
|
||||
|
||||
|
||||
def _migrate_legacy_history_unlocked() -> None:
|
||||
"""Seed an empty ledger from the previous aggregate JSON format once."""
|
||||
global _ledger_uncompacted_bytes
|
||||
if _ledger_path is None or _ledger_fd is None:
|
||||
return
|
||||
legacy_path = _ledger_path.with_name(_LEGACY_HISTORY_FILENAME)
|
||||
try:
|
||||
if _ledger_path.stat().st_size or not legacy_path.is_file():
|
||||
return
|
||||
doc = json.loads(legacy_path.read_text(encoding="utf-8"))
|
||||
if not isinstance(doc, dict) or not isinstance(doc.get("snap"), dict):
|
||||
return
|
||||
metadata: dict[str, dict] = {}
|
||||
for entry in doc.get("history", []):
|
||||
if not isinstance(entry, dict):
|
||||
continue
|
||||
sid = entry.get("sessionId") or entry.get("id")
|
||||
if not isinstance(sid, str) or not sid:
|
||||
continue
|
||||
key = sid if sid.startswith("GA-") else f"GA-{sid}"
|
||||
try:
|
||||
ts = float(entry.get("ts", 0) or 0)
|
||||
except (TypeError, ValueError):
|
||||
ts = 0
|
||||
if key not in metadata or ts >= metadata[key]["ts"]:
|
||||
metadata[key] = {
|
||||
"ts": ts,
|
||||
"model": entry.get("model") if isinstance(entry.get("model"), str) else "",
|
||||
"title": entry.get("title") if isinstance(entry.get("title"), str) else "",
|
||||
}
|
||||
fallback_ts = legacy_path.stat().st_mtime
|
||||
for key, totals in doc["snap"].items():
|
||||
if not isinstance(key, str) or not key or not isinstance(totals, dict):
|
||||
continue
|
||||
try:
|
||||
values = {
|
||||
"i": int(totals.get("input", 0) or 0),
|
||||
"o": int(totals.get("output", 0) or 0),
|
||||
"cc": int(totals.get("cacheCreate", totals.get("cacheWrite", 0)) or 0),
|
||||
"cr": int(totals.get("cacheRead", 0) or 0),
|
||||
}
|
||||
except (TypeError, ValueError):
|
||||
continue
|
||||
meta = metadata.get(key, {})
|
||||
line = json.dumps(
|
||||
{"t": meta.get("ts") or fallback_ts, "k": key, **values,
|
||||
"m": meta.get("model", ""), "n": meta.get("title", ""), "_migrated": True},
|
||||
separators=(",", ":"),
|
||||
) + "\n"
|
||||
_ledger_fd.write(line)
|
||||
_ledger_uncompacted_bytes += len(line.encode("utf-8"))
|
||||
_ledger_fd.flush()
|
||||
except Exception:
|
||||
return
|
||||
|
||||
|
||||
def init_ledger(root: str) -> None:
|
||||
"""Call once at bridge startup to set the ledger file path."""
|
||||
global _ledger_path, _ledger_fd, _ledger_uncompacted_bytes
|
||||
with _ledger_lock:
|
||||
if _ledger_fd is not None:
|
||||
try:
|
||||
_ledger_fd.close()
|
||||
except Exception:
|
||||
pass
|
||||
_ledger_path = Path(root) / "temp" / _LEDGER_FILENAME
|
||||
_ledger_path.parent.mkdir(parents=True, exist_ok=True)
|
||||
_ledger_fd = open(_ledger_path, "a", encoding="utf-8")
|
||||
try:
|
||||
_ledger_uncompacted_bytes = _ledger_path.stat().st_size
|
||||
if _ledger_uncompacted_bytes == 0:
|
||||
_migrate_legacy_history_unlocked()
|
||||
if _ledger_uncompacted_bytes >= _COMPACT_THRESHOLD:
|
||||
_compact_ledger()
|
||||
except OSError:
|
||||
_ledger_uncompacted_bytes = 0
|
||||
|
||||
|
||||
def _append_ledger(thread_key: str, inp: int, out: int, cc: int, cr: int) -> None:
|
||||
global _ledger_uncompacted_bytes
|
||||
# TUI and conductor processes install the in-memory tracker but never call
|
||||
# init_ledger(). Keep their historical hot path to one lock-free branch:
|
||||
# no clock lookup, JSON encoding, byte counting, or ledger lock acquisition.
|
||||
if _ledger_fd is None:
|
||||
return
|
||||
line = json.dumps(
|
||||
{"t": time.time(), "k": thread_key, "i": inp, "o": out, "cc": cc, "cr": cr},
|
||||
separators=(",", ":"),
|
||||
) + "\n"
|
||||
with _ledger_lock:
|
||||
if _ledger_fd is None:
|
||||
return
|
||||
try:
|
||||
_ledger_fd.write(line)
|
||||
_ledger_fd.flush()
|
||||
_ledger_uncompacted_bytes += len(line.encode("utf-8"))
|
||||
if _ledger_uncompacted_bytes >= _COMPACT_THRESHOLD:
|
||||
_compact_ledger()
|
||||
except Exception:
|
||||
pass
|
||||
|
||||
|
||||
def _iter_ledger_unlocked():
|
||||
if _ledger_path is None or not _ledger_path.is_file():
|
||||
return
|
||||
try:
|
||||
with open(_ledger_path, "r", encoding="utf-8") as f:
|
||||
for line in f:
|
||||
line = line.strip()
|
||||
if not line:
|
||||
continue
|
||||
try:
|
||||
entry = json.loads(line)
|
||||
if isinstance(entry, dict):
|
||||
yield entry
|
||||
except (json.JSONDecodeError, ValueError):
|
||||
continue
|
||||
except OSError:
|
||||
return
|
||||
|
||||
|
||||
def read_ledger() -> list[dict]:
|
||||
"""Read all valid lines from the ledger. Skips corrupted lines."""
|
||||
with _ledger_lock:
|
||||
return list(_iter_ledger_unlocked())
|
||||
|
||||
|
||||
def _aggregate_sessions(entries) -> dict[str, dict]:
|
||||
sessions: dict[str, dict] = {}
|
||||
for e in entries:
|
||||
k = e.get("k", "")
|
||||
if not isinstance(k, str) or not k:
|
||||
continue
|
||||
try:
|
||||
ts = float(e.get("t", 0) or 0)
|
||||
inp = int(e.get("i", 0) or 0)
|
||||
out = int(e.get("o", 0) or 0)
|
||||
cc = int(e.get("cc", 0) or 0)
|
||||
cr = int(e.get("cr", 0) or 0)
|
||||
except (TypeError, ValueError):
|
||||
continue
|
||||
if k not in sessions:
|
||||
sessions[k] = {"input": 0, "output": 0, "cacheCreate": 0, "cacheRead": 0,
|
||||
"model": "", "title": "", "first_ts": ts, "last_ts": ts}
|
||||
s = sessions[k]
|
||||
s["input"] += inp
|
||||
s["output"] += out
|
||||
s["cacheCreate"] += cc
|
||||
s["cacheRead"] += cr
|
||||
s["first_ts"] = min(s["first_ts"], ts)
|
||||
s["last_ts"] = max(s["last_ts"], ts)
|
||||
if isinstance(e.get("m"), str) and e["m"]:
|
||||
s["model"] = e["m"]
|
||||
if isinstance(e.get("n"), str) and e["n"]:
|
||||
s["title"] = e["n"]
|
||||
return sessions
|
||||
|
||||
|
||||
def _format_aggregate(sessions: dict[str, dict]) -> dict:
|
||||
history = []
|
||||
snap = {}
|
||||
for k, s in sessions.items():
|
||||
sid = k.removeprefix("GA-")
|
||||
history.append({
|
||||
"sessionId": sid,
|
||||
"title": s["title"] or sid,
|
||||
"input": s["input"],
|
||||
"output": s["output"],
|
||||
"cacheCreate": s["cacheCreate"],
|
||||
"cacheRead": s["cacheRead"],
|
||||
"model": s["model"],
|
||||
"ts": s["last_ts"],
|
||||
})
|
||||
snap[k] = {
|
||||
"input": s["input"],
|
||||
"output": s["output"],
|
||||
"cacheCreate": s["cacheCreate"],
|
||||
"cacheRead": s["cacheRead"],
|
||||
}
|
||||
return {"history": history, "snap": snap}
|
||||
|
||||
|
||||
def aggregate_ledger() -> dict:
|
||||
"""Aggregate ledger into {history: [...], snap: {...}} for /token-history."""
|
||||
with _ledger_lock:
|
||||
return _format_aggregate(_aggregate_sessions(_iter_ledger_unlocked()))
|
||||
|
||||
|
||||
def _compact_ledger() -> None:
|
||||
"""Compact ledger by aggregating into per-session totals and rewriting."""
|
||||
if _ledger_path is None:
|
||||
return
|
||||
global _ledger_fd, _ledger_uncompacted_bytes
|
||||
with _ledger_lock:
|
||||
temp_path = _ledger_path.with_suffix(".jsonl.tmp")
|
||||
try:
|
||||
if _ledger_fd is not None:
|
||||
_ledger_fd.flush()
|
||||
sessions = _aggregate_sessions(_iter_ledger_unlocked())
|
||||
with open(temp_path, "w", encoding="utf-8") as f:
|
||||
for k, s in sessions.items():
|
||||
line = json.dumps(
|
||||
{"t": s["last_ts"], "k": k, "i": s["input"], "o": s["output"],
|
||||
"cc": s["cacheCreate"], "cr": s["cacheRead"], "m": s["model"],
|
||||
"n": s["title"],
|
||||
"_compacted": True},
|
||||
separators=(",", ":"),
|
||||
)
|
||||
f.write(line + "\n")
|
||||
f.flush()
|
||||
os.fsync(f.fileno())
|
||||
if _ledger_fd is not None:
|
||||
_ledger_fd.close()
|
||||
_ledger_fd = None
|
||||
os.replace(temp_path, _ledger_path)
|
||||
_ledger_fd = open(_ledger_path, "a", encoding="utf-8")
|
||||
_ledger_uncompacted_bytes = 0
|
||||
except Exception:
|
||||
try:
|
||||
temp_path.unlink(missing_ok=True)
|
||||
except Exception:
|
||||
pass
|
||||
if _ledger_fd is None:
|
||||
try:
|
||||
_ledger_fd = open(_ledger_path, "a", encoding="utf-8")
|
||||
except Exception:
|
||||
pass
|
||||
|
||||
|
||||
# ── Core API ─────────────────────────────────────────────────────────────────
|
||||
|
||||
def scan_subagent_logs(since: float = 0.0, root: str | None = None) -> TokenStats:
|
||||
"""Aggregate subagent tokens from `temp/<task>/stdout.log` files; pass
|
||||
@@ -135,6 +377,7 @@ def install() -> None:
|
||||
if usage:
|
||||
t = get(threading.current_thread().name)
|
||||
t.requests += 1
|
||||
inp = cc = cr = 0
|
||||
if api_mode == 'messages':
|
||||
inp = int(usage.get('input_tokens', 0) or 0)
|
||||
cc = int(usage.get('cache_creation_input_tokens', 0) or 0)
|
||||
@@ -144,18 +387,24 @@ def install() -> None:
|
||||
# output_tokens here; SSE message_start carries a 1-token
|
||||
# placeholder to skip.
|
||||
out = int(usage.get('output_tokens', 0) or 0)
|
||||
if out > 1: t.output += out; t.last_output = out
|
||||
if out > 1:
|
||||
t.output += out; t.last_output = out
|
||||
_append_ledger(threading.current_thread().name, inp, out, cc, cr)
|
||||
else:
|
||||
_append_ledger(threading.current_thread().name, inp, 0, cc, cr)
|
||||
t.last_input = inp + cc + cr
|
||||
elif api_mode == 'chat_completions':
|
||||
cached = int((usage.get('prompt_tokens_details') or {}).get('cached_tokens', 0) or 0)
|
||||
inp = int(usage.get('prompt_tokens', 0) or 0) - cached
|
||||
t.input += inp; t.cache_read += cached
|
||||
t.last_input = inp + cached
|
||||
_append_ledger(threading.current_thread().name, inp, 0, 0, cached)
|
||||
elif api_mode == 'responses':
|
||||
cached = int((usage.get('input_tokens_details') or {}).get('cached_tokens', 0) or 0)
|
||||
inp = int(usage.get('input_tokens', 0) or 0) - cached
|
||||
t.input += inp; t.cache_read += cached
|
||||
t.last_input = inp + cached
|
||||
_append_ledger(threading.current_thread().name, inp, 0, 0, cached)
|
||||
except Exception: pass
|
||||
return orig_record(usage, api_mode)
|
||||
llmcore._record_usage = record_patched
|
||||
@@ -168,6 +417,7 @@ def install() -> None:
|
||||
t = get(threading.current_thread().name)
|
||||
n = int(m.group(1))
|
||||
t.output += n; t.last_output = n
|
||||
_append_ledger(threading.current_thread().name, 0, n, 0, 0)
|
||||
except Exception: pass
|
||||
return orig_print(*args, **kwargs)
|
||||
llmcore.print = print_patched
|
||||
|
||||
@@ -0,0 +1,857 @@
|
||||
"""Safe, dependency-free import/export helpers for desktop data snapshots."""
|
||||
from __future__ import annotations
|
||||
|
||||
import contextlib
|
||||
import datetime as dt
|
||||
import errno
|
||||
import json
|
||||
import math
|
||||
import os
|
||||
import re
|
||||
import shutil
|
||||
import stat
|
||||
import tempfile
|
||||
import uuid
|
||||
import zipfile
|
||||
from pathlib import Path, PurePosixPath
|
||||
from typing import Any, Callable, Iterable, Iterator
|
||||
|
||||
|
||||
BACKUP_SCHEMA = "genericagent.data-backup"
|
||||
BACKUP_FORMAT_VERSION = 1
|
||||
MAX_ARCHIVE_ENTRIES = 100_000
|
||||
MAX_ARCHIVE_UNCOMPRESSED_BYTES = 2 * 1024 * 1024 * 1024
|
||||
|
||||
_DATA_PREFIXES = (
|
||||
PurePosixPath("memory"),
|
||||
PurePosixPath("temp/model_responses"),
|
||||
PurePosixPath("temp/desktop_sessions"),
|
||||
)
|
||||
|
||||
_DESKTOP_SESSION_ID_RE = re.compile(r"[A-Za-z0-9][A-Za-z0-9_-]{0,127}")
|
||||
|
||||
|
||||
class BackupFormatError(ValueError):
|
||||
"""Raised when a backup cannot be trusted or is not compatible."""
|
||||
|
||||
|
||||
def _is_relative_to(path: PurePosixPath, parent: PurePosixPath) -> bool:
|
||||
return path == parent or parent in path.parents
|
||||
|
||||
|
||||
def _is_native_relative_to(path: Path, parent: Path) -> bool:
|
||||
try:
|
||||
path.relative_to(parent)
|
||||
return True
|
||||
except ValueError:
|
||||
return False
|
||||
|
||||
|
||||
def _is_link_or_reparse(path: Path) -> bool:
|
||||
"""Recognise POSIX links plus Windows junction/reparse-point indirection."""
|
||||
try:
|
||||
if path.is_symlink():
|
||||
return True
|
||||
is_junction = getattr(path, "is_junction", None)
|
||||
if callable(is_junction) and is_junction():
|
||||
return True
|
||||
attributes = int(getattr(os.lstat(path), "st_file_attributes", 0) or 0)
|
||||
reparse_flag = int(getattr(stat, "FILE_ATTRIBUTE_REPARSE_POINT", 0x400))
|
||||
return bool(attributes & reparse_flag)
|
||||
except OSError:
|
||||
return False
|
||||
|
||||
|
||||
def _resolved_directory(value: str | Path, label: str) -> Path:
|
||||
raw = Path(value).expanduser()
|
||||
if _is_link_or_reparse(raw):
|
||||
raise ValueError(f"{label} cannot be a link or reparse point")
|
||||
try:
|
||||
resolved = raw.resolve(strict=True)
|
||||
except OSError as error:
|
||||
raise ValueError(f"{label} is unavailable") from error
|
||||
if not resolved.is_dir() or _is_link_or_reparse(resolved):
|
||||
raise ValueError(f"{label} is unavailable")
|
||||
return resolved
|
||||
|
||||
|
||||
def _assert_contained(path: Path, root: Path, label: str) -> Path:
|
||||
try:
|
||||
resolved = path.resolve(strict=True)
|
||||
except OSError as error:
|
||||
raise ValueError(f"{label} is unavailable") from error
|
||||
if not _is_native_relative_to(resolved, root):
|
||||
raise ValueError(f"{label} escapes its data root")
|
||||
return resolved
|
||||
|
||||
|
||||
def _archive_path(name: str) -> PurePosixPath:
|
||||
if not name or "\\" in name:
|
||||
raise BackupFormatError("invalid backup entry path")
|
||||
if any(part in ("", ".", "..") for part in name.split("/")):
|
||||
raise BackupFormatError("invalid backup entry path")
|
||||
path = PurePosixPath(name)
|
||||
if path.is_absolute() or any(part in ("", ".", "..") for part in path.parts):
|
||||
raise BackupFormatError("invalid backup entry path")
|
||||
return path
|
||||
|
||||
|
||||
def _is_allowed_data_path(path: PurePosixPath) -> bool:
|
||||
return any(_is_relative_to(path, prefix) for prefix in _DATA_PREFIXES)
|
||||
|
||||
|
||||
def _iter_regular_files(root: Path) -> Iterator[tuple[Path, PurePosixPath]]:
|
||||
root = root.resolve()
|
||||
for folder, dirs, files in os.walk(root, followlinks=False):
|
||||
folder_path = Path(folder)
|
||||
if _is_link_or_reparse(folder_path):
|
||||
raise ValueError(f"data folder contains a link or reparse point: {folder_path}")
|
||||
safe_dirs: list[str] = []
|
||||
for name in sorted(dirs):
|
||||
candidate = folder_path / name
|
||||
if _is_link_or_reparse(candidate):
|
||||
raise ValueError(f"data folder contains a link or reparse point: {candidate}")
|
||||
_assert_contained(candidate, root, "data folder")
|
||||
safe_dirs.append(name)
|
||||
dirs[:] = safe_dirs
|
||||
for name in sorted(files):
|
||||
source = folder_path / name
|
||||
if _is_link_or_reparse(source):
|
||||
raise ValueError(f"data folder contains a link or reparse point: {source}")
|
||||
if not source.is_file():
|
||||
raise ValueError(f"data folder contains an unsupported file: {source}")
|
||||
_assert_contained(source, root, "data file")
|
||||
relative = PurePosixPath(source.relative_to(root).as_posix())
|
||||
yield source, relative
|
||||
|
||||
|
||||
def _source_files(root: Path) -> list[tuple[Path, PurePosixPath]]:
|
||||
files: list[tuple[Path, PurePosixPath]] = []
|
||||
for prefix in _DATA_PREFIXES:
|
||||
source_root = root.joinpath(*prefix.parts)
|
||||
if not source_root.exists():
|
||||
continue
|
||||
if _is_link_or_reparse(source_root) or not source_root.is_dir():
|
||||
raise ValueError(f"data folder is not a safe directory: {source_root}")
|
||||
for source, relative in _iter_regular_files(source_root):
|
||||
files.append((source, prefix / relative))
|
||||
return files
|
||||
|
||||
|
||||
def _content_counts(paths: list[PurePosixPath]) -> dict[str, int]:
|
||||
return {
|
||||
"memory": sum(_is_relative_to(path, _DATA_PREFIXES[0]) for path in paths),
|
||||
"responses": sum(_is_relative_to(path, _DATA_PREFIXES[1]) for path in paths),
|
||||
"sessions": sum(_is_relative_to(path, _DATA_PREFIXES[2]) for path in paths),
|
||||
}
|
||||
|
||||
|
||||
def _normalise_source_mode(value: str) -> str:
|
||||
if value not in ("included", "localRepository"):
|
||||
raise BackupFormatError("invalid backup source mode")
|
||||
return value
|
||||
|
||||
|
||||
def _manifest(source_mode: str, paths: list[PurePosixPath]) -> dict:
|
||||
exported_at = dt.datetime.now(dt.timezone.utc).replace(microsecond=0)
|
||||
return {
|
||||
"schema": BACKUP_SCHEMA,
|
||||
"formatVersion": BACKUP_FORMAT_VERSION,
|
||||
"exportedAt": exported_at.isoformat().replace("+00:00", "Z"),
|
||||
"sourceMode": _normalise_source_mode(source_mode),
|
||||
"content": _content_counts(paths),
|
||||
}
|
||||
|
||||
|
||||
def export_data_backup(
|
||||
ga_root: str,
|
||||
destination_path: str,
|
||||
source_mode: str,
|
||||
*,
|
||||
forbidden_roots: Iterable[str | Path] = (),
|
||||
) -> dict:
|
||||
root = _resolved_directory(ga_root, "current data source")
|
||||
raw_destination = Path(destination_path).expanduser()
|
||||
if _is_link_or_reparse(raw_destination):
|
||||
raise ValueError("backup destination cannot be a link or reparse point")
|
||||
destination = raw_destination.resolve()
|
||||
if destination.suffix.lower() != ".zip":
|
||||
raise ValueError("backup destination must be a zip file")
|
||||
if not destination.parent.is_dir() or _is_link_or_reparse(destination.parent):
|
||||
raise ValueError("backup destination folder does not exist")
|
||||
protected_roots = [root.joinpath(*prefix.parts).resolve() for prefix in _DATA_PREFIXES]
|
||||
protected_roots.extend(Path(value).expanduser().resolve() for value in forbidden_roots)
|
||||
if any(_is_native_relative_to(destination, protected) for protected in protected_roots):
|
||||
raise ValueError("backup destination is inside protected application data")
|
||||
|
||||
files = _source_files(root)
|
||||
paths = [relative for _, relative in files]
|
||||
if not paths:
|
||||
raise BackupFormatError("backup contains no importable data")
|
||||
manifest = _manifest(source_mode, paths)
|
||||
manifest_bytes = (
|
||||
json.dumps(manifest, ensure_ascii=False, indent=2) + "\n"
|
||||
).encode("utf-8")
|
||||
if len(files) + 1 > MAX_ARCHIVE_ENTRIES:
|
||||
raise BackupFormatError("backup contains too many files")
|
||||
total_bytes = len(manifest_bytes)
|
||||
for source, _relative in files:
|
||||
_assert_contained(source, root, "data file")
|
||||
total_bytes += source.stat().st_size
|
||||
if total_bytes > MAX_ARCHIVE_UNCOMPRESSED_BYTES:
|
||||
raise BackupFormatError("backup is too large")
|
||||
|
||||
temp_handle = tempfile.NamedTemporaryFile(
|
||||
prefix=f".{destination.stem}.",
|
||||
suffix=".tmp",
|
||||
dir=destination.parent,
|
||||
delete=False,
|
||||
)
|
||||
temp_path = Path(temp_handle.name)
|
||||
temp_handle.close()
|
||||
try:
|
||||
with zipfile.ZipFile(
|
||||
temp_path,
|
||||
"w",
|
||||
compression=zipfile.ZIP_DEFLATED,
|
||||
compresslevel=6,
|
||||
) as archive:
|
||||
archive.writestr("manifest.json", manifest_bytes)
|
||||
for source, relative in files:
|
||||
if _is_link_or_reparse(source):
|
||||
raise ValueError(f"data file became a link or reparse point: {source}")
|
||||
_assert_contained(source, root, "data file")
|
||||
archive.write(source, relative.as_posix())
|
||||
# Validate the bytes that will actually replace the destination. A source
|
||||
# can change after the preflight stat, and ZipFile only finalises CRCs and
|
||||
# the central directory when it closes.
|
||||
with zipfile.ZipFile(temp_path, "r") as archive:
|
||||
_validated_zip(archive)
|
||||
os.replace(temp_path, destination)
|
||||
except Exception:
|
||||
with contextlib.suppress(OSError):
|
||||
temp_path.unlink()
|
||||
raise
|
||||
|
||||
return {
|
||||
"ok": True,
|
||||
"path": str(destination),
|
||||
"formatVersion": BACKUP_FORMAT_VERSION,
|
||||
"exportedAt": manifest["exportedAt"],
|
||||
"sourceMode": manifest["sourceMode"],
|
||||
"content": manifest["content"],
|
||||
}
|
||||
|
||||
|
||||
def _validated_zip(archive: zipfile.ZipFile) -> tuple[dict, list[zipfile.ZipInfo]]:
|
||||
infos = archive.infolist()
|
||||
if len(infos) > MAX_ARCHIVE_ENTRIES:
|
||||
raise BackupFormatError("backup contains too many files")
|
||||
total_bytes = sum(info.file_size for info in infos)
|
||||
if total_bytes > MAX_ARCHIVE_UNCOMPRESSED_BYTES:
|
||||
raise BackupFormatError("backup is too large")
|
||||
if archive.testzip() is not None:
|
||||
raise BackupFormatError("backup is corrupt")
|
||||
|
||||
manifest_info: zipfile.ZipInfo | None = None
|
||||
data_infos: list[zipfile.ZipInfo] = []
|
||||
seen_paths: set[str] = set()
|
||||
for info in infos:
|
||||
path = _archive_path(info.filename.rstrip("/"))
|
||||
folded_path = path.as_posix().casefold()
|
||||
if folded_path in seen_paths:
|
||||
raise BackupFormatError("backup contains duplicate file paths")
|
||||
seen_paths.add(folded_path)
|
||||
unix_mode = (info.external_attr >> 16) & 0o170000
|
||||
if unix_mode == stat.S_IFLNK:
|
||||
raise BackupFormatError("backup contains links")
|
||||
if path == PurePosixPath("manifest.json"):
|
||||
if info.is_dir() or manifest_info is not None:
|
||||
raise BackupFormatError("backup manifest is invalid")
|
||||
manifest_info = info
|
||||
continue
|
||||
if not _is_allowed_data_path(path):
|
||||
raise BackupFormatError("backup contains unsupported files")
|
||||
if not info.is_dir():
|
||||
data_infos.append(info)
|
||||
|
||||
if manifest_info is None:
|
||||
raise BackupFormatError("backup manifest is missing")
|
||||
try:
|
||||
manifest = json.loads(archive.read(manifest_info).decode("utf-8"))
|
||||
except Exception as error:
|
||||
raise BackupFormatError("backup manifest is invalid") from error
|
||||
if not isinstance(manifest, dict):
|
||||
raise BackupFormatError("backup manifest is invalid")
|
||||
if manifest.get("schema") != BACKUP_SCHEMA:
|
||||
raise BackupFormatError("backup format is not supported")
|
||||
if manifest.get("formatVersion") != BACKUP_FORMAT_VERSION:
|
||||
raise BackupFormatError("backup version is not supported")
|
||||
_normalise_source_mode(str(manifest.get("sourceMode") or ""))
|
||||
if not isinstance(manifest.get("exportedAt"), str) or not manifest["exportedAt"]:
|
||||
raise BackupFormatError("backup export time is missing")
|
||||
|
||||
actual_counts = _content_counts([
|
||||
_archive_path(info.filename) for info in data_infos
|
||||
])
|
||||
if not data_infos:
|
||||
raise BackupFormatError("backup contains no importable data")
|
||||
if manifest.get("content") != actual_counts:
|
||||
raise BackupFormatError("backup content summary does not match its files")
|
||||
return manifest, data_infos
|
||||
|
||||
|
||||
def _legacy_inspection(root: Path) -> dict:
|
||||
files = _source_files(root)
|
||||
paths = [relative for _, relative in files]
|
||||
session_items, _sessions_found, _sessions_skipped = _read_source_sessions(root)
|
||||
counts = _content_counts(paths)
|
||||
counts["sessions"] = len(session_items)
|
||||
if not any(counts.values()):
|
||||
raise BackupFormatError("not a GA data source (no importable data)")
|
||||
return {
|
||||
"ok": True,
|
||||
"sourceType": "legacyFolder",
|
||||
"formatVersion": None,
|
||||
"exportedAt": None,
|
||||
"sourceMode": None,
|
||||
"content": counts,
|
||||
}
|
||||
|
||||
|
||||
def inspect_import_source(source_path: str) -> dict:
|
||||
raw_source = Path(source_path).expanduser()
|
||||
if _is_link_or_reparse(raw_source):
|
||||
raise BackupFormatError("import source cannot be a link or reparse point")
|
||||
source = raw_source.resolve()
|
||||
if source.is_dir() and not _is_link_or_reparse(source):
|
||||
return _legacy_inspection(source)
|
||||
if not source.is_file() or source.suffix.lower() != ".zip":
|
||||
raise BackupFormatError("select a compatible backup or data folder")
|
||||
try:
|
||||
with zipfile.ZipFile(source, "r") as archive:
|
||||
manifest, _ = _validated_zip(archive)
|
||||
except zipfile.BadZipFile as error:
|
||||
raise BackupFormatError("backup is corrupt") from error
|
||||
return {
|
||||
"ok": True,
|
||||
"sourceType": "backupZip",
|
||||
"formatVersion": manifest["formatVersion"],
|
||||
"exportedAt": manifest["exportedAt"],
|
||||
"sourceMode": manifest["sourceMode"],
|
||||
"content": manifest["content"],
|
||||
}
|
||||
|
||||
|
||||
@contextlib.contextmanager
|
||||
def materialize_import_source(source_path: str) -> Iterator[Path]:
|
||||
raw_source = Path(source_path).expanduser()
|
||||
if _is_link_or_reparse(raw_source):
|
||||
raise BackupFormatError("import source cannot be a link or reparse point")
|
||||
source = raw_source.resolve()
|
||||
inspection = inspect_import_source(str(source))
|
||||
if inspection["sourceType"] == "legacyFolder":
|
||||
yield source
|
||||
return
|
||||
|
||||
with tempfile.TemporaryDirectory(prefix="genericagent-data-import-") as temp_dir:
|
||||
target_root = _resolved_directory(temp_dir, "import staging")
|
||||
try:
|
||||
with zipfile.ZipFile(source, "r") as archive:
|
||||
_, data_infos = _validated_zip(archive)
|
||||
for info in data_infos:
|
||||
relative = _archive_path(info.filename)
|
||||
target = target_root.joinpath(*relative.parts)
|
||||
_assert_safe_new_target(target_root, target)
|
||||
target.parent.mkdir(parents=True, exist_ok=True)
|
||||
_assert_contained(target.parent, target_root, "import destination")
|
||||
if target.exists() or _is_link_or_reparse(target):
|
||||
raise BackupFormatError("backup contains duplicate or unsafe paths")
|
||||
with archive.open(info, "r") as reader, target.open("wb") as writer:
|
||||
shutil.copyfileobj(reader, writer)
|
||||
_assert_contained(target, target_root, "import destination")
|
||||
except zipfile.BadZipFile as error:
|
||||
raise BackupFormatError("backup is corrupt") from error
|
||||
yield target_root
|
||||
|
||||
|
||||
def _is_desktop_session_id(value: object) -> bool:
|
||||
if not isinstance(value, str):
|
||||
return False
|
||||
session_id = value
|
||||
return (
|
||||
not session_id.startswith("tui_")
|
||||
and _DESKTOP_SESSION_ID_RE.fullmatch(session_id) is not None
|
||||
)
|
||||
|
||||
|
||||
def _finite_timestamp(value: object, default: float) -> float:
|
||||
if value is None:
|
||||
return default
|
||||
if isinstance(value, bool) or not isinstance(value, (int, float)):
|
||||
raise BackupFormatError("session timestamp is invalid")
|
||||
timestamp = float(value)
|
||||
if not math.isfinite(timestamp):
|
||||
raise BackupFormatError("session timestamp is invalid")
|
||||
return timestamp
|
||||
|
||||
|
||||
def _non_negative_integer(value: object, default: int, label: str) -> int:
|
||||
if value is None:
|
||||
return default
|
||||
if isinstance(value, bool) or not isinstance(value, int) or value < 0:
|
||||
raise BackupFormatError(f"session {label} is invalid")
|
||||
return value
|
||||
|
||||
|
||||
def _record_list(value: object, default: list[dict], label: str) -> list[dict]:
|
||||
if value is None:
|
||||
return list(default)
|
||||
if not isinstance(value, list) or not all(isinstance(item, dict) for item in value):
|
||||
raise BackupFormatError(f"session {label} is invalid")
|
||||
return value
|
||||
|
||||
|
||||
def canonical_session_record(
|
||||
item: object,
|
||||
*,
|
||||
default_cwd: str = "",
|
||||
now: float | None = None,
|
||||
) -> dict[str, Any]:
|
||||
"""Validate and reduce an imported/persisted Desktop session to its schema."""
|
||||
if not isinstance(item, dict):
|
||||
raise BackupFormatError("session record is invalid")
|
||||
session_id = item.get("id")
|
||||
if not _is_desktop_session_id(session_id):
|
||||
raise BackupFormatError("session id is invalid")
|
||||
current_time = float(now if now is not None else dt.datetime.now().timestamp())
|
||||
title = item.get("title", "New chat")
|
||||
cwd = item.get("cwd", default_cwd)
|
||||
plan_path = item.get("plan_path", "")
|
||||
if not isinstance(title, str) or not isinstance(cwd, str) or not isinstance(plan_path, str):
|
||||
raise BackupFormatError("session text field is invalid")
|
||||
messages = _record_list(item.get("messages"), [], "messages")
|
||||
llm_history_value = item.get("llm_history")
|
||||
llm_history = None if llm_history_value is None else _record_list(
|
||||
llm_history_value, [], "llm history"
|
||||
)
|
||||
llm_no_value = item.get("llm_no")
|
||||
llm_no = None if llm_no_value is None else _non_negative_integer(
|
||||
llm_no_value, 0, "model index"
|
||||
)
|
||||
pinned = item.get("pinned", False)
|
||||
untitled = item.get("untitled", True)
|
||||
if not isinstance(pinned, bool) or not isinstance(untitled, bool):
|
||||
raise BackupFormatError("session boolean field is invalid")
|
||||
return {
|
||||
"id": session_id,
|
||||
"title": title,
|
||||
"cwd": cwd,
|
||||
"created_at": _finite_timestamp(item.get("created_at"), current_time),
|
||||
"updated_at": _finite_timestamp(item.get("updated_at"), current_time),
|
||||
"messages": messages,
|
||||
"msg_seq": _non_negative_integer(item.get("msg_seq"), 0, "message sequence"),
|
||||
"pinned": pinned,
|
||||
"untitled": untitled,
|
||||
"plan_scan_baseline": _non_negative_integer(
|
||||
item.get("plan_scan_baseline"), 0, "plan baseline"
|
||||
),
|
||||
"plan_path": plan_path,
|
||||
"llm_no": llm_no,
|
||||
"llm_history": llm_history,
|
||||
}
|
||||
|
||||
|
||||
def _read_source_sessions(source: Path) -> tuple[list[dict], bool, int]:
|
||||
"""Read supported Desktop session stores without trusting filenames.
|
||||
|
||||
Corrupt/non-Desktop records are skipped. The skipped count is intentionally
|
||||
record-oriented; an unreadable file counts as one skipped source record.
|
||||
"""
|
||||
items: list[dict] = []
|
||||
found = False
|
||||
skipped = 0
|
||||
sessions_dir = source / "temp" / "desktop_sessions"
|
||||
if sessions_dir.exists() and _is_link_or_reparse(sessions_dir):
|
||||
raise ValueError(f"session source contains a link or reparse point: {sessions_dir}")
|
||||
if sessions_dir.is_dir():
|
||||
for session_file in sorted(sessions_dir.glob("*.json")):
|
||||
if _is_link_or_reparse(session_file):
|
||||
raise ValueError(
|
||||
f"session source contains a link or reparse point: {session_file}"
|
||||
)
|
||||
if not session_file.is_file():
|
||||
raise ValueError(f"session source contains an unsupported file: {session_file}")
|
||||
found = True
|
||||
try:
|
||||
raw_item = json.loads(session_file.read_text(encoding="utf-8"))
|
||||
item = canonical_session_record(raw_item)
|
||||
except (OSError, UnicodeError, json.JSONDecodeError, ValueError):
|
||||
skipped += 1
|
||||
continue
|
||||
items.append(item)
|
||||
|
||||
for legacy in (
|
||||
source / "temp" / "desktop_sessions.json",
|
||||
source / "temp" / "desktop_sessions.json.migrated",
|
||||
):
|
||||
if _is_link_or_reparse(legacy):
|
||||
raise ValueError(f"session source contains a link or reparse point: {legacy}")
|
||||
if not legacy.is_file():
|
||||
continue
|
||||
found = True
|
||||
try:
|
||||
document = json.loads(legacy.read_text(encoding="utf-8"))
|
||||
except (OSError, UnicodeError, json.JSONDecodeError, ValueError):
|
||||
skipped += 1
|
||||
continue
|
||||
if not isinstance(document, list):
|
||||
skipped += 1
|
||||
continue
|
||||
for item in document:
|
||||
try:
|
||||
items.append(canonical_session_record(item))
|
||||
except ValueError:
|
||||
skipped += 1
|
||||
return items, found, skipped
|
||||
|
||||
|
||||
def _existing_session_ids(destination_root: Path) -> set[str]:
|
||||
ids: set[str] = set()
|
||||
sessions_dir = destination_root / "temp" / "desktop_sessions"
|
||||
if _is_link_or_reparse(sessions_dir):
|
||||
raise ValueError(f"session destination contains a link or reparse point: {sessions_dir}")
|
||||
if not sessions_dir.is_dir():
|
||||
return ids
|
||||
for session_file in sorted(sessions_dir.glob("*.json")):
|
||||
if _is_link_or_reparse(session_file):
|
||||
raise ValueError(
|
||||
f"session destination contains a link or reparse point: {session_file}"
|
||||
)
|
||||
if not session_file.is_file():
|
||||
raise ValueError(f"session destination contains an unsupported file: {session_file}")
|
||||
if _is_desktop_session_id(session_file.stem):
|
||||
ids.add(session_file.stem)
|
||||
try:
|
||||
item = canonical_session_record(
|
||||
json.loads(session_file.read_text(encoding="utf-8"))
|
||||
)
|
||||
except (OSError, UnicodeError, json.JSONDecodeError, ValueError):
|
||||
continue
|
||||
ids.add(item["id"])
|
||||
return ids
|
||||
|
||||
|
||||
def _remove_path(path: Path) -> None:
|
||||
if _is_link_or_reparse(path) or path.is_file():
|
||||
path.unlink()
|
||||
elif path.is_dir():
|
||||
shutil.rmtree(path)
|
||||
|
||||
|
||||
def _copy_tree_strict(source: Path, destination: Path) -> None:
|
||||
"""Copy a complete tree while refusing links and special files."""
|
||||
if _is_link_or_reparse(source) or not source.is_dir():
|
||||
raise ValueError(f"cannot safely copy data folder: {source}")
|
||||
destination.mkdir(parents=True, exist_ok=False)
|
||||
for item in sorted(source.iterdir(), key=lambda path: path.name):
|
||||
if _is_link_or_reparse(item):
|
||||
raise ValueError(f"data folder contains a link or reparse point: {item}")
|
||||
_assert_contained(item, source, "data item")
|
||||
target = destination / item.name
|
||||
if item.is_dir():
|
||||
_copy_tree_strict(item, target)
|
||||
elif item.is_file():
|
||||
shutil.copy2(item, target)
|
||||
else:
|
||||
raise ValueError(f"data folder contains an unsupported file: {item}")
|
||||
|
||||
|
||||
def _prepare_overlay_target(root: Path, relative: PurePosixPath) -> Path:
|
||||
current = root
|
||||
for part in relative.parts[:-1]:
|
||||
current = current / part
|
||||
if _is_link_or_reparse(current):
|
||||
raise ValueError(f"memory destination contains a link or reparse point: {current}")
|
||||
if current.exists() and not current.is_dir():
|
||||
_remove_path(current)
|
||||
current.mkdir(exist_ok=True)
|
||||
_assert_contained(current, root, "memory destination")
|
||||
target = root.joinpath(*relative.parts)
|
||||
if _is_link_or_reparse(target):
|
||||
raise ValueError(f"memory destination contains a link or reparse point: {target}")
|
||||
if target.is_dir():
|
||||
_remove_path(target)
|
||||
return target
|
||||
|
||||
|
||||
def _assert_safe_new_target(root: Path, target: Path) -> None:
|
||||
relative = target.relative_to(root)
|
||||
current = root
|
||||
for part in relative.parts[:-1]:
|
||||
current = current / part
|
||||
if _is_link_or_reparse(current):
|
||||
raise ValueError(f"data destination contains a link or reparse point: {current}")
|
||||
if current.exists() and not current.is_dir():
|
||||
raise ValueError(f"data destination parent is not a directory: {current}")
|
||||
if current.exists():
|
||||
_assert_contained(current, root, "data destination")
|
||||
if _is_link_or_reparse(target):
|
||||
raise ValueError(f"data destination contains a link or reparse point: {target}")
|
||||
|
||||
|
||||
def _new_backup_path(destination_root: Path) -> Path:
|
||||
timestamp = dt.datetime.now().strftime("%Y%m%d_%H%M%S_%f")
|
||||
backup_parent = destination_root / "temp"
|
||||
for suffix in range(1000):
|
||||
tail = "" if suffix == 0 else f"_{suffix}"
|
||||
candidate = backup_parent / f"memory_import_backup_{timestamp}{tail}"
|
||||
if not candidate.exists() and not _is_link_or_reparse(candidate):
|
||||
return candidate
|
||||
raise OSError("cannot allocate a unique memory backup directory")
|
||||
|
||||
|
||||
def _create_memory_backup(destination_root: Path, memory_root: Path) -> Path:
|
||||
backup_dir = _new_backup_path(destination_root)
|
||||
backup_parent = backup_dir.parent
|
||||
if _is_link_or_reparse(backup_parent) or (
|
||||
backup_parent.exists() and not backup_parent.is_dir()
|
||||
):
|
||||
raise ValueError("current backup destination is not a safe directory")
|
||||
backup_parent.mkdir(parents=True, exist_ok=True)
|
||||
_assert_contained(backup_parent, destination_root, "backup destination")
|
||||
staging = backup_parent / f".{backup_dir.name}.staging-{uuid.uuid4().hex}"
|
||||
try:
|
||||
staging.mkdir()
|
||||
_copy_tree_strict(memory_root, staging / "memory")
|
||||
os.replace(staging, backup_dir)
|
||||
except Exception:
|
||||
with contextlib.suppress(OSError):
|
||||
_remove_path(staging)
|
||||
raise
|
||||
return backup_dir
|
||||
|
||||
|
||||
def _install_file_add_only(staged: Path, target: Path) -> None:
|
||||
"""Install one staged file without ever replacing an existing path."""
|
||||
try:
|
||||
os.link(staged, target, follow_symlinks=False)
|
||||
except OSError as error:
|
||||
unsupported_link_errors = {
|
||||
errno.EINVAL,
|
||||
errno.EPERM,
|
||||
errno.EXDEV,
|
||||
getattr(errno, "ENOTSUP", errno.EINVAL),
|
||||
getattr(errno, "EOPNOTSUPP", errno.EINVAL),
|
||||
}
|
||||
if error.errno not in unsupported_link_errors:
|
||||
raise
|
||||
|
||||
# Some removable/network filesystems do not implement hard links.
|
||||
# O_EXCL retains the add-only contract there; a failed copy removes
|
||||
# only the path this call successfully created.
|
||||
flags = os.O_WRONLY | os.O_CREAT | os.O_EXCL
|
||||
flags |= getattr(os, "O_BINARY", 0)
|
||||
descriptor: int | None = None
|
||||
created = False
|
||||
try:
|
||||
descriptor = os.open(target, flags, stat.S_IMODE(staged.stat().st_mode))
|
||||
created = True
|
||||
with staged.open("rb") as reader, os.fdopen(descriptor, "wb") as writer:
|
||||
descriptor = None
|
||||
shutil.copyfileobj(reader, writer)
|
||||
writer.flush()
|
||||
os.fsync(writer.fileno())
|
||||
except Exception:
|
||||
if descriptor is not None:
|
||||
with contextlib.suppress(OSError):
|
||||
os.close(descriptor)
|
||||
if created:
|
||||
with contextlib.suppress(OSError):
|
||||
target.unlink()
|
||||
raise
|
||||
with contextlib.suppress(OSError):
|
||||
staged.unlink()
|
||||
|
||||
|
||||
def merge_data_files(
|
||||
source_dir: str,
|
||||
ga_root: str,
|
||||
*,
|
||||
existing_session_ids: Iterable[str] | None = None,
|
||||
session_preparer: Callable[[dict], object] | None = None,
|
||||
) -> dict[str, Any]:
|
||||
"""Transactionally merge a validated data tree into ``ga_root``.
|
||||
|
||||
``memory`` is source-wins after a durable full backup, responses and
|
||||
Desktop sessions are add-only, and any activation error rolls back files
|
||||
installed by this call. ``session_preparer`` lets the bridge validate and
|
||||
construct its in-memory Session objects before any destination is changed.
|
||||
"""
|
||||
source = _resolved_directory(source_dir, "source data folder")
|
||||
destination_root = _resolved_directory(ga_root, "current data destination")
|
||||
if source == destination_root:
|
||||
raise ValueError("source is the same as current data")
|
||||
|
||||
inspection = _legacy_inspection(source)
|
||||
source_memory = source.joinpath(*_DATA_PREFIXES[0].parts)
|
||||
source_responses = source.joinpath(*_DATA_PREFIXES[1].parts)
|
||||
destination_memory = destination_root.joinpath(*_DATA_PREFIXES[0].parts)
|
||||
destination_responses = destination_root.joinpath(*_DATA_PREFIXES[1].parts)
|
||||
has_source_memory = source_memory.is_dir() and not _is_link_or_reparse(source_memory)
|
||||
|
||||
memory_files = list(_iter_regular_files(source_memory)) if has_source_memory else []
|
||||
response_files: list[tuple[Path, PurePosixPath, Path]] = []
|
||||
responses_skipped = 0
|
||||
if source_responses.exists() and _is_link_or_reparse(source_responses):
|
||||
raise ValueError(f"response source contains a link or reparse point: {source_responses}")
|
||||
if source_responses.is_dir():
|
||||
for item, relative in _iter_regular_files(source_responses):
|
||||
target = destination_responses.joinpath(*relative.parts)
|
||||
if target.exists() or _is_link_or_reparse(target):
|
||||
responses_skipped += 1
|
||||
continue
|
||||
_assert_safe_new_target(destination_root, target)
|
||||
response_files.append((item, relative, target))
|
||||
|
||||
source_session_items, sessions_found, sessions_skipped = _read_source_sessions(source)
|
||||
known_session_ids = _existing_session_ids(destination_root)
|
||||
if existing_session_ids is not None:
|
||||
known_session_ids.update(
|
||||
str(value) for value in existing_session_ids if _is_desktop_session_id(value)
|
||||
)
|
||||
planned_session_ids: set[str] = set()
|
||||
session_files: list[tuple[str, dict, Path, object]] = []
|
||||
for item in source_session_items:
|
||||
session_id = item.get("id")
|
||||
if not _is_desktop_session_id(session_id):
|
||||
sessions_skipped += 1
|
||||
continue
|
||||
session_id = str(session_id)
|
||||
target = destination_root / "temp" / "desktop_sessions" / f"{session_id}.json"
|
||||
if (
|
||||
session_id in known_session_ids
|
||||
or session_id in planned_session_ids
|
||||
or target.exists()
|
||||
or _is_link_or_reparse(target)
|
||||
):
|
||||
sessions_skipped += 1
|
||||
continue
|
||||
_assert_safe_new_target(destination_root, target)
|
||||
try:
|
||||
prepared = session_preparer(item) if session_preparer is not None else item
|
||||
except Exception:
|
||||
sessions_skipped += 1
|
||||
continue
|
||||
planned_session_ids.add(session_id)
|
||||
session_files.append((session_id, item, target, prepared))
|
||||
|
||||
backup_dir = ""
|
||||
prepared_sessions = [entry[3] for entry in session_files]
|
||||
with tempfile.TemporaryDirectory(
|
||||
prefix=".genericagent-memory-import-",
|
||||
dir=destination_root,
|
||||
) as temp_dir:
|
||||
staging_root = Path(temp_dir)
|
||||
if _is_link_or_reparse(staging_root):
|
||||
raise ValueError("import staging cannot be a link or reparse point")
|
||||
_assert_contained(staging_root, destination_root, "import staging")
|
||||
staged_memory = staging_root / "memory"
|
||||
if has_source_memory:
|
||||
if _is_link_or_reparse(destination_memory) or (
|
||||
destination_memory.exists() and not destination_memory.is_dir()
|
||||
):
|
||||
raise ValueError("current memory destination is not a safe directory")
|
||||
if destination_memory.is_dir():
|
||||
_copy_tree_strict(destination_memory, staged_memory)
|
||||
else:
|
||||
staged_memory.mkdir()
|
||||
for item, relative in memory_files:
|
||||
target = _prepare_overlay_target(staged_memory, relative)
|
||||
target.parent.mkdir(parents=True, exist_ok=True)
|
||||
shutil.copy2(item, target)
|
||||
|
||||
staged_responses: list[tuple[Path, Path]] = []
|
||||
for item, relative, target in response_files:
|
||||
staged = staging_root / "responses" / Path(*relative.parts)
|
||||
staged.parent.mkdir(parents=True, exist_ok=True)
|
||||
shutil.copy2(item, staged)
|
||||
staged_responses.append((staged, target))
|
||||
|
||||
staged_sessions: list[tuple[Path, Path]] = []
|
||||
for session_id, item, target, _prepared in session_files:
|
||||
staged = staging_root / "sessions" / f"{session_id}.json"
|
||||
staged.parent.mkdir(parents=True, exist_ok=True)
|
||||
staged.write_text(
|
||||
json.dumps(item, ensure_ascii=False, default=str),
|
||||
encoding="utf-8",
|
||||
)
|
||||
staged_sessions.append((staged, target))
|
||||
|
||||
memory_nonempty = (
|
||||
destination_memory.is_dir()
|
||||
and next(destination_memory.iterdir(), None) is not None
|
||||
)
|
||||
if has_source_memory and memory_nonempty:
|
||||
backup_dir = str(_create_memory_backup(destination_root, destination_memory))
|
||||
|
||||
installed_files: list[Path] = []
|
||||
previous_memory = staging_root / "previous-memory"
|
||||
memory_original_moved = False
|
||||
memory_activated = False
|
||||
memory_existed = destination_memory.is_dir()
|
||||
try:
|
||||
if has_source_memory:
|
||||
if memory_existed:
|
||||
os.replace(destination_memory, previous_memory)
|
||||
memory_original_moved = True
|
||||
os.replace(staged_memory, destination_memory)
|
||||
memory_activated = True
|
||||
|
||||
for staged, target in (*staged_responses, *staged_sessions):
|
||||
if target.exists() or _is_link_or_reparse(target):
|
||||
raise OSError(f"data destination changed during import: {target}")
|
||||
_assert_safe_new_target(destination_root, target)
|
||||
target.parent.mkdir(parents=True, exist_ok=True)
|
||||
# Staging shares the destination filesystem. A hard link gives
|
||||
# POSIX/Windows create-if-absent semantics: unlike replace(), it
|
||||
# cannot overwrite a response/session created concurrently.
|
||||
_install_file_add_only(staged, target)
|
||||
installed_files.append(target)
|
||||
except Exception as error:
|
||||
rollback_errors: list[str] = []
|
||||
for target in reversed(installed_files):
|
||||
try:
|
||||
target.unlink()
|
||||
except OSError as rollback_error:
|
||||
rollback_errors.append(str(rollback_error))
|
||||
if memory_activated or memory_original_moved:
|
||||
try:
|
||||
if destination_memory.exists() or _is_link_or_reparse(destination_memory):
|
||||
_remove_path(destination_memory)
|
||||
if memory_original_moved:
|
||||
os.replace(previous_memory, destination_memory)
|
||||
except OSError as rollback_error:
|
||||
rollback_errors.append(str(rollback_error))
|
||||
if rollback_errors:
|
||||
raise OSError(
|
||||
f"data import failed: {error}; rollback failed: "
|
||||
+ "; ".join(rollback_errors)
|
||||
) from error
|
||||
raise
|
||||
|
||||
result: dict[str, Any] = {
|
||||
"ok": True,
|
||||
"memoryCopied": len(memory_files),
|
||||
"memorySkipped": 0,
|
||||
"responsesCopied": len(response_files),
|
||||
"responsesSkipped": responses_skipped,
|
||||
"sessionsAdded": len(session_files),
|
||||
"sessionsSkipped": sessions_skipped,
|
||||
"sessionsFileFound": sessions_found,
|
||||
"backupDir": backup_dir,
|
||||
"sourceType": inspection["sourceType"],
|
||||
}
|
||||
if session_preparer is not None:
|
||||
result["_preparedSessions"] = prepared_sessions
|
||||
return result
|
||||
@@ -0,0 +1,100 @@
|
||||
# GenericAgent Desktop 2.0 integration boundary
|
||||
|
||||
GenericAgent Desktop 2.0 is a packaged Tauri desktop application with a generated React renderer and
|
||||
Desktop-specific Python services. The React source is intentionally developed outside this upstream tree;
|
||||
the generated distribution and all runtime interfaces required to execute it are tracked here.
|
||||
|
||||
## Renderer ownership
|
||||
|
||||
- `frontends/desktop/dist/**` contains the generated Desktop 2.0 HTML, JavaScript, CSS, fonts, and images.
|
||||
- `frontends/desktop/static/**` is the independent Desktop v1 implementation and remains available unchanged.
|
||||
- Tauri packages `dist/**`; it does not compile React during an upstream build.
|
||||
- The public React source, issue tracker, and contribution home is
|
||||
<https://github.com/abraxas914/GenericAgent>.
|
||||
- The exact fork commit and generated-file content manifest are recorded in
|
||||
`dist/build-provenance.json`.
|
||||
|
||||
Generated files must not be edited by hand. Renderer changes are made and tested in the fork, rebuilt from an
|
||||
accepted fork `main` commit, and submitted upstream as a refreshed `dist/**` tree with matching provenance.
|
||||
The manifest identifies the submitted bytes; it is not a claim that later builds are bit-for-bit reproducible.
|
||||
|
||||
The production Tauri configuration loads only the tracked asset origin and applies an explicit Content Security
|
||||
Policy. React source tooling is absent from the upstream package path, while WebDriver permission remains isolated
|
||||
to `tauri.e2e.conf.json` and is not granted by the production configuration.
|
||||
|
||||
## Desktop runtime ownership
|
||||
|
||||
Desktop 2.0 uses these repository-owned integration layers:
|
||||
|
||||
- `frontends/desktop_bridge.py`: local HTTP/WebSocket API, model/session/upload/data routes, service control,
|
||||
identity, and Desktop diagnostics.
|
||||
- `frontends/conductor.py`: Desktop collaboration and model-routing integration.
|
||||
- `frontends/cost_tracker.py`: Desktop usage and cost ledger.
|
||||
- `frontends/data_backup.py`: validated Desktop data export, inspection, and import/merge behavior.
|
||||
- `frontends/desktop_settings.py`: locked, atomic read/modify/write updates for shared Desktop preferences.
|
||||
- `frontends/desktop/src-tauri/**`: native bootstrap, permissions, file pickers, runtime/source switching,
|
||||
process/port recovery, window behavior, and package resource resolution.
|
||||
|
||||
The package-owned bridge remains the executable service boundary. `GA_ROOT` can point it at a compatible
|
||||
external GenericAgent repository, but does not replace the package-owned bridge or Tauri shell.
|
||||
|
||||
Desktop data import first backs up the complete destination `memory/**` tree, then applies source-wins memory
|
||||
files. Model responses remain add-only, and Desktop sessions are de-duplicated by session ID. Activation is staged
|
||||
and rolled back on failure. Import is rejected while a managed session or Desktop extra has unfinished work; users
|
||||
must also stop any independent TUI, CLI, or automation process before importing because those external processes
|
||||
are outside the bridge's maintenance gate. The persistent cost ledger is initialized by the Desktop bridge only;
|
||||
existing TUI and conductor processes retain their previous in-memory accounting hot path.
|
||||
|
||||
Browser-origin requests are accepted only from the production Tauri origins, the fixed development origin, the
|
||||
explicit E2E origin, or the bridge's own same origin. Native clients without an Origin remain supported, while
|
||||
cross-site, null, lookalike, wrong-port, preflight, and WebSocket requests are rejected before route handling.
|
||||
Backup exports cannot be written into any managed data or HTTP-readable directory.
|
||||
|
||||
Managed-service state is based on the bridge-owned live child process, not merely a listener on the configured
|
||||
port. A foreign conductor on production port `8900` is reported as an external port conflict and is never stopped
|
||||
or counted as an owned running extra. The alternate conductor port is available only to the isolated package E2E
|
||||
journey; production renderer and CSP contracts remain fixed to `8900`.
|
||||
|
||||
On macOS, the package runtime uses a stable writable root and is refreshed through a package/build/source marker
|
||||
with staged atomic activation. A previously shipped versioned runtime is migrated into that stable root. User
|
||||
configuration, memory, responses, sessions, and token ledger data are preserved; a failed migration or activation
|
||||
restores the previous runtime and marker. Matching markers keep the hot-start copy untouched.
|
||||
|
||||
## Core runtime boundary
|
||||
|
||||
Desktop 2.0 does not own or modify GenericAgent's Agent/LLM/Harness business runtime. In particular, the
|
||||
integration does not change `agentmain.py`, LLM execution, Harness/Agent execution, inference, tool-calling,
|
||||
or memory-scheduling semantics. Desktop bridge and conductor changes translate Desktop requests onto those
|
||||
existing core contracts.
|
||||
|
||||
## Version and release contract
|
||||
|
||||
Desktop package metadata is `0.2.0` across npm, Cargo, Tauri, and generated provenance. Upstream packages consume
|
||||
the tracked `dist/**` tree, so an upstream maintainer can build official Windows, Linux, and macOS artifacts
|
||||
without the React source. A `desktop-portable-*` tag starts three read-only platform builders. One separate
|
||||
publisher receives write permission only after all three succeed, validates the six expected files and checksums,
|
||||
creates an invisible draft with all assets, and then exposes that single entry as a prerelease. Manual
|
||||
`workflow_dispatch` runs produce candidate artifacts only and skip the publisher.
|
||||
|
||||
The Linux builder runs on Ubuntu 22.04, isolates Rust target/bin caches from newer runner ABIs, and rejects any
|
||||
ELF requiring a GLIBC version newer than 2.35. Windows remains unsigned and documents SmartScreen plus checksum
|
||||
verification; macOS remains ad-hoc signed and unnotarized.
|
||||
|
||||
The renderer still uses the existing local loopback bridge contract. This integration neither treats that inherited
|
||||
platform requirement as a new release blocker nor claims to have changed operating-system loopback policy.
|
||||
|
||||
## Validation layers
|
||||
|
||||
- Compiled distribution contract: required entries, asset references, source-map/source leakage, E2E markers,
|
||||
version consistency, exact provenance manifest, and the `dist` package entry.
|
||||
- Python contracts: bridge, conductor, model routing, sessions, uploads, cost ledger, `GA_ROOT`, and data backup.
|
||||
- Rust contracts: formatting, clippy, production and E2E feature tests, and
|
||||
path/identity/port/diagnostic/bootstrap behavior.
|
||||
- Native package contract: Linux Tauri build smoke plus the platform release workflow.
|
||||
|
||||
Optional platform release qualification lives under `frontends/desktop/release_qualification/**`.
|
||||
Its automated evidence gate validates package behavior and cleanup; screenshots and manual visual checklists
|
||||
remain separate release-owner review material rather than CI pass/fail inputs.
|
||||
|
||||
The richer React unit/browser/native E2E suites remain in the fork and run before its accepted `main` SHA is
|
||||
used to refresh the generated upstream distribution.
|
||||
Vendored
+66
@@ -0,0 +1,66 @@
|
||||
# GenericAgent React Desktop 2.0 — compiled distribution
|
||||
|
||||
This directory contains generated HTML, JavaScript, CSS, fonts, images, and license notices for the
|
||||
GenericAgent React Desktop 2.0 renderer. It is build output, not the React development tree.
|
||||
|
||||
## Source and contributions
|
||||
|
||||
The public React source of truth and the place for renderer issues, pull requests, and design feedback is:
|
||||
|
||||
- <https://github.com/abraxas914/GenericAgent>
|
||||
- Exact source used for this distribution:
|
||||
[`21f12f6dfe57ada8572bb21fe6604caac230b1cf`](https://github.com/abraxas914/GenericAgent/commit/21f12f6dfe57ada8572bb21fe6604caac230b1cf)
|
||||
|
||||
Over the two-month React Desktop 2.0 development cycle, [abraxas914](https://github.com/abraxas914) led the new
|
||||
renderer architecture and UI, Desktop bridge and Tauri integration, startup and recovery surfaces, package
|
||||
validation, browser/native end-to-end coverage, renderer security hardening, and bundle optimization. Please
|
||||
open an Issue or pull request in the fork above when proposing React renderer changes so source and generated
|
||||
output stay synchronized.
|
||||
|
||||
[yiqi-017](https://github.com/yiqi-017) contributed user-facing help and feedback contacts that remain in the
|
||||
compiled renderer, including the
|
||||
[`help and feedback` settings work](https://github.com/abraxas914/GenericAgent/commit/5ddf03bb152666637bdfcfa44f1fac3cff5a66b6)
|
||||
and [`startup recovery` support contacts](https://github.com/abraxas914/GenericAgent/commit/2fb55d944e4444b08cb9ad76c13aef7a5788186b).
|
||||
He also produced an earlier
|
||||
[`compiled-only delivery` prototype](https://github.com/abraxas914/GenericAgent/commit/3e7ca6a2b20eefdb3ee335dc0d520c3b6d9d57f8)
|
||||
that helped establish this upstream packaging boundary. The current generated tree was rebuilt by abraxas914
|
||||
from the exact merged source commit recorded above.
|
||||
|
||||
## Third-party software: Semi Design
|
||||
|
||||
This distribution contains code from these nine Semi Design packages, all resolved at version `2.101.0`:
|
||||
|
||||
- `@douyinfe/semi-animation`
|
||||
- `@douyinfe/semi-animation-react`
|
||||
- `@douyinfe/semi-animation-styled`
|
||||
- `@douyinfe/semi-foundation`
|
||||
- `@douyinfe/semi-icons`
|
||||
- `@douyinfe/semi-illustrations`
|
||||
- `@douyinfe/semi-json-viewer-core`
|
||||
- `@douyinfe/semi-theme-default`
|
||||
- `@douyinfe/semi-ui`
|
||||
|
||||
- Project: <https://github.com/DouyinFE/semi-design>
|
||||
- Website: <https://semi.design>
|
||||
- Copyright (c) 2021 DouyinFE
|
||||
- License: MIT
|
||||
|
||||
The complete license text and bundled third-party notices are in
|
||||
[`THIRD_PARTY_NOTICES.txt`](./THIRD_PARTY_NOTICES.txt) in this directory.
|
||||
|
||||
## Repository boundary
|
||||
|
||||
- `frontends/desktop/dist/**` is the generated React Desktop 2.0 renderer used by the packaged Tauri app.
|
||||
- `frontends/desktop/static/**` remains the independent legacy Desktop v1 implementation; this distribution
|
||||
neither replaces nor modifies its source files.
|
||||
- The complete Desktop 2.0 integration also uses the repository's Desktop-specific bridge, conductor, cost
|
||||
tracking, data-backup, bootstrap, permissions, and Tauri shell code.
|
||||
- The integration does **not** modify GenericAgent's Agent, LLM, Harness, inference, tool-calling, or memory
|
||||
scheduling core runtime.
|
||||
- `build-provenance.json` records the source repository, exact source commit, generated file count, and a
|
||||
content-manifest SHA-256. This README and the provenance file are excluded from that manifest. The manifest
|
||||
identifies this exact generated tree; it is not a claim that later builds are bit-for-bit reproducible.
|
||||
|
||||
Upstream maintainers can package the tracked distribution directly without the React source. React changes
|
||||
should be built and validated in the fork, then submitted here as a refreshed generated tree with updated
|
||||
provenance and matching Desktop integration contracts.
|
||||
+83
@@ -0,0 +1,83 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2021 DouyinFE
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
|
||||
The code implementation of the external library is referenced by DouyinFe are:
|
||||
|
||||
- animate.css
|
||||
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2020 Daniel Eden
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
|
||||
- Ant Design
|
||||
MIT LICENSE
|
||||
|
||||
Copyright (c) 2015-present Ant UED, https://xtech.antfin.com/
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining
|
||||
a copy of this software and associated documentation files (the
|
||||
"Software"), to deal in the Software without restriction, including
|
||||
without limitation the rights to use, copy, modify, merge, publish,
|
||||
distribute, sublicense, and/or sell copies of the Software, and to
|
||||
permit persons to whom the Software is furnished to do so, subject to
|
||||
the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be
|
||||
included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
||||
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
||||
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
||||
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
|
||||
- rc-tree
|
||||
|
||||
MIT LICENSE
|
||||
|
||||
Copyright (c) 2015-present Alipay.com, https://www.alipay.com/
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
@@ -0,0 +1 @@
|
||||
import{g as q}from"./tauri-compat-tfiFK9EG.js";var x,P;function Q(){if(P)return x;P=1;var i=4,t=.001,e=1e-7,s=10,n=11,a=1/(n-1),c=typeof Float32Array=="function";function l(u,o){return 1-3*o+3*u}function g(u,o){return 3*o-6*u}function T(u){return 3*u}function r(u,o,f){return((l(o,f)*u+g(o,f))*u+T(o))*u}function h(u,o,f){return 3*l(o,f)*u*u+2*g(o,f)*u+T(o)}function C(u,o,f,p,y){var m,_,F=0;do _=o+(f-o)/2,m=r(_,p,y)-u,m>0?f=_:o=_;while(Math.abs(m)>e&&++F<s);return _}function b(u,o,f,p){for(var y=0;y<i;++y){var m=h(o,f,p);if(m===0)return o;var _=r(o,f,p)-u;o-=_/m}return o}function d(u){return u}return x=function(o,f,p,y){if(!(0<=o&&o<=1&&0<=p&&p<=1))throw new Error("bezier x values must be in [0, 1] range");if(o===f&&p===y)return d;for(var m=c?new Float32Array(n):new Array(n),_=0;_<n;++_)m[_]=r(_*a,o,p);function F(v){for(var S=0,j=1,R=n-1;j!==R&&m[j]<=v;++j)S+=a;--j;var U=(v-m[j])/(m[j+1]-m[j]),A=S+U*a,k=h(A,o,p);return k>=t?b(v,A,o,p):k===0?A:C(v,S,S+a,o,p)}return function(S){return S===0?0:S===1?1:r(F(S),f,y)}},x}var K=Q();const z=q(K);function B(i,t,e){return Math.min(Math.max(i,t),e)}function W(i){const t=/\(([^)]+)\)/.exec(i);return t?t[1].split(",").map(e=>parseFloat(e)):[]}function V(){let i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:1,t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:.5;const e=B(i,1,10),s=B(t,.1,2);return n=>n===0||n===1?n:-e*Math.pow(2,10*(n-1))*Math.sin((n-1-s/(Math.PI*2)*Math.asin(1/e))*(Math.PI*2)/s)}const N=(()=>{const i=["Quad","Cubic","Quart","Quint","Sine","Expo","Circ","Back","Elastic"],t={In:[[.55,.085,.68,.53],[.55,.055,.675,.19],[.895,.03,.685,.22],[.755,.05,.855,.06],[.47,0,.745,.715],[.95,.05,.795,.035],[.6,.04,.98,.335],[.6,-.28,.735,.045],V],Out:[[.25,.46,.45,.94],[.215,.61,.355,1],[.165,.84,.44,1],[.23,1,.32,1],[.39,.575,.565,1],[.19,1,.22,1],[.075,.82,.165,1],[.175,.885,.32,1.275],(s,n)=>a=>1-V(s,n)(1-a)],InOut:[[.455,.03,.515,.955],[.645,.045,.355,1],[.77,0,.175,1],[.86,0,.07,1],[.445,.05,.55,.95],[1,0,0,1],[.785,.135,.15,.86],[.68,-.55,.265,1.55],(s,n)=>a=>a<.5?V(s,n)(a*2)/2:1-V(s,n)(a*-2+2)/2]},e={linear:[.25,.25,.75,.75]};for(const s of Object.keys(t))t[s].forEach((n,a)=>{e["ease"+s+i[a]]=n});return e})();function D(i){if(typeof i=="function")return i;!i||typeof i!="string"?i="linear":i=i.trim();let t=i.split("(")[0];const e=W(i);let s;return t==="cubic-bezier"||t==="cubicBezier"?z(...e.length?e:N.linear):((!t||typeof t!="string"||typeof t=="string"&&N[t]==null)&&(t="linear"),s=N[t],typeof s=="function"?s(...e):e.length?z(...e):z(...s))}class Z{constructor(){this._eventMap=new Map}on(t,e){return t&&typeof e=="function"&&(this._eventMap.has(t)||this._eventMap.set(t,[]),this._eventMap.get(t).push(e)),this}once(t,e){var s=this;if(t&&typeof e=="function"){const n=function(){e(...arguments),s.off(t,n)};this.on(t,n)}}off(t,e){if(t)if(typeof e=="function"){const s=this._eventMap.get(t);if(Array.isArray(s)&&s.length){let n=-1;for(;(n=s.findIndex(a=>a===e))>-1;)s.splice(n,1)}}else e==null&&this._eventMap.delete(t);return this}emit(t){for(var e=arguments.length,s=new Array(e>1?e-1:0),n=1;n<e;n++)s[n-1]=arguments[n];return this._eventMap.has(t)?(this._eventMap.get(t).forEach(a=>a(...s)),!0):!1}}function M(i){return!!(i&&typeof i=="object"&&(i.duration>0||typeof i.easing=="string"||typeof i.easing=="function"))}function H(i,t,e,s,n){for(const a of Object.keys(t)){const c=t[a],l=typeof c=="number"?c:c.val;if(!(typeof c=="object"&&c.done)){if(M(c)&&s&&n&&c.duration){if(c.duration+s<=n||l!==i[a])return!1}else if(typeof e[a]=="number"&&e[a]!==0)return!1;if(i[a]!==l)return!1}}return!0}function E(i){const t={};for(const e in i)Object.prototype.hasOwnProperty.call(i,e)&&(t[e]=typeof i[e]=="number"?i[e]:i[e].val);return t}const I=[0,0];function L(i,t,e,s,n,a,c){const l=-n*(t-s),g=-a*e,T=l+g,r=e+T*i,h=t+r*i;return Math.abs(r)<c&&Math.abs(h-s)<c?(I[0]=s,I[1]=0,I):(I[0]=h,I[1]=r,I)}function J(i){const t={},e=i&&Object.keys(i)||[];for(const s of e)t[s]=0;return t}const $={default:{tension:170,friction:26}},Y=Object.assign(Object.assign({},$.default),{precision:.01});function G(i){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(M(t)){const s=D(t.easing),n=typeof t.duration=="number"&&t.duration>0?t.duration:1e3;t=Object.assign(Object.assign({},t),{easing:s,duration:n})}let e=Object.assign(Object.assign(Object.assign({},Y),t),{done:!1});if(i&&typeof i=="object"&&"val"in i){if(M(i)){const s=D(i.easing),n=typeof i.duration=="number"&&i.duration>0?i.duration:parseInt(t.duration)||1e3;i=Object.assign(Object.assign({},i),{easing:s,duration:n})}e=Object.assign(Object.assign({},e),i)}else e=Object.assign(Object.assign({},e),{val:i});return e}const w=()=>Date.now(),O=1e3/60;class tt extends Z{constructor(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};super(),this._props=Object.assign({},t),this._config=Object.assign({},e),this.initStates()}_wrapConfig(t,e){e=e&&typeof e=="object"?Line truncated
|
||||
@@ -0,0 +1 @@
|
||||
.collab-page{display:flex;width:100%;height:100%;overflow:hidden}.collab-main{flex:1;display:flex;flex-direction:column;min-width:0;position:relative}.collab-chat-area{flex:1;position:relative;min-height:0;overflow:hidden}.collab-offline{display:flex;flex-direction:column;align-items:center;justify-content:center;width:100%;height:100%;gap:.5rem;color:var(--semi-color-text-2, #4e5969)}.collab-offline-icon{font-size:2rem;opacity:.5}.collab-offline h3{margin:0;font-size:1rem;font-weight:600;color:var(--semi-color-text-0, #1c1f23)}.collab-offline p{margin:0;font-size:.8125rem}.collab-retry-btn{margin-top:.75rem;padding:.375rem 1rem;border:1px solid var(--semi-color-border, #e0e0e0);border-radius:.375rem;background:var(--semi-color-bg-0, #fff);color:var(--semi-color-text-0, #1c1f23);font-size:.8125rem;cursor:pointer;transition:background .12s}.collab-retry-btn:hover{background:var(--semi-color-fill-0, #f5f5f5)}.collab-connecting{display:flex;align-items:center;justify-content:center;height:100%;gap:.5rem;font-size:.8125rem;color:var(--semi-color-text-2, #4e5969);position:absolute;top:0;right:0;bottom:0;left:0}.collab-connecting-dot{width:8px;height:8px;border-radius:50%;background:var(--semi-color-primary, #3370ff);animation:statusPulse 1.2s ease-in-out infinite}.collab-empty{display:flex;align-items:center;justify-content:center;height:100%;color:var(--semi-color-text-3, #8f959e);font-size:.8125rem;position:absolute;top:0;right:0;bottom:0;left:0}.collab-welcome{position:absolute;top:0;right:0;bottom:0;left:0;display:flex;flex-direction:column;align-items:flex-start;justify-content:center;padding:2rem 0;gap:1rem}.collab-welcome-title{font-size:1.125rem;font-weight:600;color:var(--semi-color-text-0, #1c1f23);margin:0}.collab-welcome-sub{font-size:.8125rem;color:var(--semi-color-text-2, #4e5969);line-height:1.5;margin:0}.collab-welcome-steps{display:flex;flex-direction:column;gap:.75rem;width:100%;margin-top:.5rem}.collab-welcome-step{display:flex;align-items:flex-start;gap:.625rem}.collab-welcome-step-icon{display:flex;align-items:center;justify-content:center;width:1.75rem;height:1.75rem;border-radius:.375rem;background:var(--semi-color-fill-0, #f5f5f5);color:var(--semi-color-text-1, #1c1f23);flex-shrink:0}.collab-welcome-step-text{display:flex;flex-direction:column;gap:.125rem;padding-top:.1875rem}.collab-welcome-step-label{font-size:.8125rem;font-weight:600;color:var(--semi-color-text-0, #1c1f23)}.collab-welcome-step-desc{font-size:.75rem;color:var(--semi-color-text-2, #4e5969);line-height:1.4}.collab-welcome-chips{display:flex;flex-wrap:wrap;gap:.5rem;margin-top:.5rem}.collab-welcome-chip{display:inline-flex;align-items:center;padding:.375rem .625rem;border:1px solid var(--semi-color-border, #e0e0e0);border-radius:6px;background:none;color:var(--ui-text-secondary, #4e5969);font-size:.8125rem;font-weight:500;line-height:1;cursor:pointer;-webkit-user-select:none;user-select:none;transition:background .15s,box-shadow .15s}.collab-welcome-chip:hover{background:color-mix(in srgb,var(--semi-color-primary, #3370ff) 4%,transparent);box-shadow:0 1px 4px color-mix(in srgb,var(--semi-color-primary, #3370ff) 12%,transparent)}.collab-welcome-chip:active{background:color-mix(in srgb,var(--semi-color-primary, #3370ff) 8%,transparent)}[data-slot=collab-page][data-empty] .collab-chat-area{display:flex;flex-direction:column;align-items:center;justify-content:center;overflow:visible}[data-slot=collab-page][data-empty] .collab-welcome{position:relative;inset:unset;width:min(var(--composer-width, 48.75rem),calc(100% - 2rem))}[data-slot=collab-page][data-empty] .collab-composer-wrap{position:relative;width:min(var(--composer-width, 48.75rem),calc(100% - 2rem))}[data-slot=collab-page][data-empty] [data-slot=composer-root]{position:relative;bottom:auto;left:auto;transform:none;width:100%}[data-slot=collab-page][data-empty] [data-slot=composer-root]:before{display:none}[data-slot=collab-page][data-empty] [data-slot=composer-surface]{border-color:var(--semi-color-primary)!important;box-shadow:0 0 20px color-mix(in srgb,var(--semi-color-primary) 12%,transparent),0 0 50px -4px color-mix(in srgb,var(--semi-color-primary) 8%,transparent)!important}[data-slot=collab-messages]{position:absolute;top:0;right:0;bottom:0;left:0;overflow-y:auto;padding:1rem;padding-bottom:calc(var(--composer-measured-height, 62px) + 1rem)}.collab-messages-scroll{display:flex;flex-direction:column;gap:.75rem;max-width:48rem;margin:0 auto}.collab-msg{display:flex}.collab-msg--user{justify-content:flex-end}.collab-msg--conductor,.collab-msg--system{justify-content:flex-start}.collab-bubble{max-width:80%;min-width:min(24rem,100%);padding:.5rem .75rem;border-radius:.75rem;font-size:.8125rem;line-height:1.5}.collab-bubble--user{background:#d3e0fd;color:#000;border-bottom-right-radius:.25rem;min-width:unset;word-break:break-word;white-space:pre-wrap}.collab-bubble--conductor{background:var(--semi-color-fill-0, #f5f5f5);color:var(--semi-color-text-0, #1c1f23);border-bLine truncated
|
||||
@@ -0,0 +1 @@
|
||||
import{b as r,aj as l}from"./tauri-compat-tfiFK9EG.js";import{H as i,b as N,J as C,K as S,L as M,N as T,O as v,M as E,P as W}from"./main-Knf6L_en.js";import{MarkdownPart as w}from"./MarkdownPart-Bhe_jloX.js";import"./index-Bpi3BHKj.js";import"./WindowsTitlebar-CrkUa1UM.js";import"./markdown-preprocess-Bvg4n8KE.js";function R(e){const c=Math.floor(e/1e3);if(c<60)return`${c}s`;const a=Math.floor(c/60),n=c%60;return`${a}m ${n}s`}function $({since:e}){const[c,a]=r.useState(Date.now());return r.useEffect(()=>{const n=setInterval(()=>a(Date.now()),1e3);return()=>clearInterval(n)},[]),l.jsx(l.Fragment,{children:R(c-e)})}const D=200;function P({message:e}){const c=e.role==="user",a=e.role==="conductor";return l.jsx("div",{className:`collab-msg collab-msg--${e.role}`,"data-slot":"collab-msg",children:l.jsxs("div",{className:`collab-bubble ${c?"collab-bubble--user":a?"collab-bubble--conductor":"collab-bubble--system"}`,children:[e.images&&e.images.length>0&&l.jsx("div",{className:"collab-msg-images",children:e.images.map((n,s)=>l.jsx("img",{src:n.base64||n.path,alt:n.name,className:"collab-msg-img"},s))}),e.files&&e.files.length>0&&l.jsx("div",{className:"collab-msg-files",children:e.files.map((n,s)=>l.jsx("span",{className:"collab-msg-file-chip",children:n.name},s))}),a||e.role==="system"?l.jsx(w,{content:e.msg}):l.jsx("span",{className:"collab-msg-text",children:e.msg})]})})}function B({since:e}){const{t:c}=N();return l.jsx("div",{className:"collab-msg collab-msg--conductor","data-slot":"collab-typing",children:l.jsxs("div",{className:"collab-thinking-bar",children:[l.jsx("span",{className:"collab-thinking-dot"}),l.jsx("span",{className:"collab-thinking-label",children:c("collab.typing")}),l.jsx("span",{className:"collab-thinking-time",children:l.jsx($,{since:e})})]})})}function I(){const e=i(o=>o.messages),c=i(o=>o.conductorTyping),a=i(o=>o.connectionStatus),{t:n}=N(),{scrollRef:s}=C(),[u,x]=r.useState(1),d=r.useRef(null),p=r.useRef(0);r.useEffect(()=>{(a==="connecting"||e.length===0)&&x(1)},[a,e.length]);const b=D*u,m=Math.max(0,e.length-b),k=e.slice(m),t=m,g=r.useCallback(()=>{const o=s.current;o&&(d.current=o.scrollHeight-o.scrollTop),x(h=>h+1)},[s]);r.useLayoutEffect(()=>{if(d.current==null)return;if(m>=p.current){d.current=null,p.current=m;return}const o=s.current;o&&(o.scrollTop=o.scrollHeight-d.current),d.current=null,p.current=m},[m,s]),r.useEffect(()=>{p.current=m},[m]);const j=[...e].reverse().find(o=>o.role==="user"),y=o=>o>1e12?o:o*1e3,f=r.useRef(Date.now());return j!=null&&j.ts&&(f.current=y(j.ts)),a==="connecting"?l.jsx("div",{className:"collab-messages-area","data-slot":"collab-messages",children:l.jsxs("div",{className:"collab-connecting",children:[l.jsx("span",{className:"collab-connecting-dot"}),l.jsx("span",{children:n("status.connecting")})]})}):e.length===0?l.jsx("div",{className:"collab-messages-area","data-slot":"collab-messages",children:l.jsx("div",{className:"collab-empty",children:l.jsx("p",{children:n("collab.placeholder")})})}):l.jsx("div",{className:"collab-messages-area","data-slot":"collab-messages",ref:s,children:l.jsxs("div",{className:"collab-messages-scroll",children:[t>0&&l.jsxs("button",{type:"button","data-slot":"show-earlier-btn",onClick:g,children:["Show ",t," earlier"]}),k.map((o,h)=>l.jsx(P,{message:o},o.id||m+h)),c&&l.jsx(B,{since:f.current})]})})}function F(){const e=i(t=>t.sendMessage),c=i(t=>t.conductorTyping),a=i(t=>t.connectionStatus),n=i(t=>t.modelConfig),s=i(t=>t.runtimeModel),u=i(t=>t.loadModel),x=i(t=>t.selectModel),d=S(t=>t.defaultModelNo);r.useEffect(()=>{u()},[u]);const p=r.useCallback((t,g)=>{var f,o;const j=(f=g==null?void 0:g.files)==null?void 0:f.map(h=>({name:h.name,path:h.path})),y=(o=g==null?void 0:g.images)==null?void 0:o.map(h=>({name:h.name,path:h.path,base64:h.base64}));e(t,j,y)},[e]),b=r.useCallback(()=>{},[]),m=a!=="ready",k=(n==null?void 0:n.effective)??(n==null?void 0:n.configured)??d;return l.jsx("div",{className:"collab-composer-wrap","data-slot":"collab-composer","data-disabled":m||void 0,children:l.jsx(M,{onSend:p,onStop:b,isGenerating:c,hideStatusStack:!0,modelControl:l.jsx(T,{selectedNo:k,runningNo:s!=null&&s.running?s.effective:null,isRunning:!!(s!=null&&s.running),onSelect:x})})})}const H=[{key:"1",icon:"comment"},{key:"2",icon:"symbol-misc"},{key:"3",icon:"graph"},{key:"4",icon:"edit"}],L=["collab.chipProgress","collab.chipPause","collab.chipSummary"];function O({onChipClick:e}){const{t:c}=N();return l.jsxs("div",{className:"collab-welcome","data-slot":"collab-welcome",children:[l.jsx("h2",{className:"collab-welcome-title",children:c("collab.guideTitle")}),l.jsx("p",{className:"collab-welcome-sub",children:c("collab.guideWhen")}),l.jsx("div",{className:"collab-welcome-steps",children:H.map(a=>l.jsxs("div",{className:"collab-welcome-step",children:[l.jsx("span",{className:"collab-welcome-step-icon",children:l.jsx(v,{name:a.icon,size:"1rem"})}),l.jsxs("span",{className:"collab-welcome-step-text",children:[l.jsx("span",{className:"collabLine truncated
|
||||
@@ -0,0 +1 @@
|
||||
import{c as t,b as e}from"./tauri-compat-tfiFK9EG.js";function n(a){return e.createElement("svg",Object.assign({viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",focusable:!1,"aria-hidden":!0},a),e.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M12 2a1 1 0 0 0-1-1H6a2 2 0 0 0-2 2v18c0 1.1.9 2 2 2h12a2 2 0 0 0 2-2V10a1 1 0 0 0-1-1h-5a2 2 0 0 1-2-2V2ZM7 8a1 1 0 0 1 1-1h1a1 1 0 0 1 0 2H8a1 1 0 0 1-1-1Zm0 5a1 1 0 0 1 1-1h8a1 1 0 1 1 0 2H8a1 1 0 0 1-1-1Zm1 4a1 1 0 1 0 0 2h8a1 1 0 1 0 0-2H8Zm11.07-9.5H14.5a1 1 0 0 1-1-1V1.93a.8.8 0 0 1 1.37-.56l4.76 4.76a.8.8 0 0 1-.56 1.37Z",fill:"currentColor"}))}const l=t(n,"file");export{l as I};
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,271 @@
|
||||
var an=Object.defineProperty;var nn=(r,e,t)=>e in r?an(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t;var nr=(r,e,t)=>nn(r,typeof e!="symbol"?e+"":e,t);import{bs as ir,g as sn,b as a0,aj as U}from"./tauri-compat-tfiFK9EG.js";import{M as ln,r as on,a as un,b as cn,p as hn,S as dn}from"./markdown-preprocess-Bvg4n8KE.js";import{Q as sr,S as mn,U as pn}from"./main-Knf6L_en.js";import"./index-Bpi3BHKj.js";import"./WindowsTitlebar-CrkUa1UM.js";var at={exports:{}},lr;function fn(){return lr||(lr=1,(function(r){var e=typeof window<"u"?window:typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope?self:{};/**
|
||||
* Prism: Lightweight, robust, elegant syntax highlighting
|
||||
*
|
||||
* @license MIT <https://opensource.org/licenses/MIT>
|
||||
* @author Lea Verou <https://lea.verou.me>
|
||||
* @namespace
|
||||
* @public
|
||||
*/var t=(function(a){var n=/(?:^|\s)lang(?:uage)?-([\w-]+)(?=\s|$)/i,s=0,o={},u={manual:a.Prism&&a.Prism.manual,disableWorkerMessageHandler:a.Prism&&a.Prism.disableWorkerMessageHandler,util:{encode:function y(w){return w instanceof h?new h(w.type,y(w.content),w.alias):Array.isArray(w)?w.map(y):w.replace(/&/g,"&").replace(/</g,"<").replace(/\u00a0/g," ")},type:function(y){return Object.prototype.toString.call(y).slice(8,-1)},objId:function(y){return y.__id||Object.defineProperty(y,"__id",{value:++s}),y.__id},clone:function y(w,k){k=k||{};var A,T;switch(u.util.type(w)){case"Object":if(T=u.util.objId(w),k[T])return k[T];A={},k[T]=A;for(var O in w)w.hasOwnProperty(O)&&(A[O]=y(w[O],k));return A;case"Array":return T=u.util.objId(w),k[T]?k[T]:(A=[],k[T]=A,w.forEach(function(P,B){A[B]=y(P,k)}),A);default:return w}},getLanguage:function(y){for(;y;){var w=n.exec(y.className);if(w)return w[1].toLowerCase();y=y.parentElement}return"none"},setLanguage:function(y,w){y.className=y.className.replace(RegExp(n,"gi"),""),y.classList.add("language-"+w)},currentScript:function(){if(typeof document>"u")return null;if(document.currentScript&&document.currentScript.tagName==="SCRIPT")return document.currentScript;try{throw new Error}catch(A){var y=(/at [^(\r\n]*\((.*):[^:]+:[^:]+\)$/i.exec(A.stack)||[])[1];if(y){var w=document.getElementsByTagName("script");for(var k in w)if(w[k].src==y)return w[k]}return null}},isActive:function(y,w,k){for(var A="no-"+w;y;){var T=y.classList;if(T.contains(w))return!0;if(T.contains(A))return!1;y=y.parentElement}return!!k}},languages:{plain:o,plaintext:o,text:o,txt:o,extend:function(y,w){var k=u.util.clone(u.languages[y]);for(var A in w)k[A]=w[A];return k},insertBefore:function(y,w,k,A){A=A||u.languages;var T=A[y],O={};for(var P in T)if(T.hasOwnProperty(P)){if(P==w)for(var B in k)k.hasOwnProperty(B)&&(O[B]=k[B]);k.hasOwnProperty(P)||(O[P]=T[P])}var j=A[y];return A[y]=O,u.languages.DFS(u.languages,function(W,Y){Y===j&&W!=y&&(this[W]=O)}),O},DFS:function y(w,k,A,T){T=T||{};var O=u.util.objId;for(var P in w)if(w.hasOwnProperty(P)){k.call(w,P,w[P],A||P);var B=w[P],j=u.util.type(B);j==="Object"&&!T[O(B)]?(T[O(B)]=!0,y(B,k,null,T)):j==="Array"&&!T[O(B)]&&(T[O(B)]=!0,y(B,k,P,T))}}},plugins:{},highlightAll:function(y,w){u.highlightAllUnder(document,y,w)},highlightAllUnder:function(y,w,k){var A={callback:k,container:y,selector:'code[class*="language-"], [class*="language-"] code, code[class*="lang-"], [class*="lang-"] code'};u.hooks.run("before-highlightall",A),A.elements=Array.prototype.slice.apply(A.container.querySelectorAll(A.selector)),u.hooks.run("before-all-elements-highlight",A);for(var T=0,O;O=A.elements[T++];)u.highlightElement(O,w===!0,A.callback)},highlightElement:function(y,w,k){var A=u.util.getLanguage(y),T=u.languages[A];u.util.setLanguage(y,A);var O=y.parentElement;O&&O.nodeName.toLowerCase()==="pre"&&u.util.setLanguage(O,A);var P=y.textContent,B={element:y,language:A,grammar:T,code:P};function j(Y){B.highlightedCode=Y,u.hooks.run("before-insert",B),B.element.innerHTML=B.highlightedCode,u.hooks.run("after-highlight",B),u.hooks.run("complete",B),k&&k.call(B.element)}if(u.hooks.run("before-sanity-check",B),O=B.element.parentElement,O&&O.nodeName.toLowerCase()==="pre"&&!O.hasAttribute("tabindex")&&O.setAttribute("tabindex","0"),!B.code){u.hooks.run("complete",B),k&&k.call(B.element);return}if(u.hooks.run("before-highlight",B),!B.grammar){j(u.util.encode(B.code));return}if(w&&a.Worker){var W=new Worker(u.filename);W.onmessage=function(Y){j(Y.data)},W.postMessage(JSON.stringify({language:B.language,code:B.code,immediateClose:!0}))}else j(u.highlight(B.code,B.grammar,B.language))},highlight:function(y,w,k){var A={code:y,grammar:w,language:k};if(u.hooks.run("before-tokenize",A),!A.grammar)throw new Error('The language "'+A.language+'" has no grammar.');return A.tokens=u.tokenize(A.code,A.grammar),u.hooks.run("after-tokenize",A),h.stringify(u.util.encode(A.tokens),A.language)},tokenize:function(y,w){var k=w.rest;if(k){for(var A in k)w[A]=k[A];delete w.rest}var T=new g;return S(T,T.head,y),p(y,T,w,T.head,0),D(T)},hooks:{all:{},add:function(y,w){var k=u.hooks.all;k[y]=k[y]||[],k[y].push(w)},run:function(y,w){var k=u.hooks.all[y];if(!(!k||!k.length))for(var A=0,T;T=k[A++];)T(w)}},Token:h};a.Prism=u;function h(y,w,k,A){this.type=y,this.content=w,this.alias=k,this.length=(A||"").length|0}h.stringify=function y(w,k){if(typeof w=="string")return w;if(Array.isArray(w)){var A="";return w.forEach(function(j){A+=y(j,k)}),A}var T={type:w.type,content:y(w.content,k),tag:"span",classes:["token",w.type],attributes:{},language:k},O=w.alias;O&&(Array.isArray(O)?Array.prototype.push.apply(T.classes,O):T.classes.push(O)),u.hooks.run("wrap",T);var P="";for(var B in T.attributes)P+=" "+B+'="'+(T.attributes[B]||"").replace(/"/g,""")+'"';return"<"+T.tag+' class="'+T.classes.join(" ")+'"'+P+">"+T.content+"</"+T.tag+">"};function m(y,w,k,A){y.lastIndex=w;var T=y.exec(k);if(T&&A&&T[1]){var O=T[1].length;T.indexLine truncated
|
||||
`),M.hasAttribute("data-start")||M.setAttribute("data-start",String(B+1))}R.textContent=T,t.highlightElement(R)},function(T){M.setAttribute(u,p),R.textContent=T})}}),t.plugins.fileHighlight={highlight:function(M){for(var R=(M||document).querySelectorAll(g),y=0,w;w=R[y++];)t.highlightElement(w)}};var D=!1;t.fileHighlight=function(){D||(console.warn("Prism.fileHighlight is deprecated. Use `Prism.plugins.fileHighlight.highlight` instead."),D=!0),t.plugins.fileHighlight.highlight.apply(this,arguments)}})()})(at)),at.exports}var vn=fn();const $e=sn(vn);(function(r){var e=r.util.clone(r.languages.javascript),t=/(?:\s|\/\/.*(?!.)|\/\*(?:[^*]|\*(?!\/))\*\/)/.source,a=/(?:\{(?:\{(?:\{[^{}]*\}|[^{}])*\}|[^{}])*\})/.source,n=/(?:\{<S>*\.{3}(?:[^{}]|<BRACES>)*\})/.source;function s(h,m){return h=h.replace(/<S>/g,function(){return t}).replace(/<BRACES>/g,function(){return a}).replace(/<SPREAD>/g,function(){return n}),RegExp(h,m)}n=s(n).source,r.languages.jsx=r.languages.extend("markup",e),r.languages.jsx.tag.pattern=s(/<\/?(?:[\w.:-]+(?:<S>+(?:[\w.:$-]+(?:=(?:"(?:\\[\s\S]|[^\\"])*"|'(?:\\[\s\S]|[^\\'])*'|[^\s{'"/>=]+|<BRACES>))?|<SPREAD>))*<S>*\/?)?>/.source),r.languages.jsx.tag.inside.tag.pattern=/^<\/?[^\s>\/]*/,r.languages.jsx.tag.inside["attr-value"].pattern=/=(?!\{)(?:"(?:\\[\s\S]|[^\\"])*"|'(?:\\[\s\S]|[^\\'])*'|[^\s'">]+)/,r.languages.jsx.tag.inside.tag.inside["class-name"]=/^[A-Z]\w*(?:\.[A-Z]\w*)*$/,r.languages.jsx.tag.inside.comment=e.comment,r.languages.insertBefore("inside","attr-name",{spread:{pattern:s(/<SPREAD>/.source),inside:r.languages.jsx}},r.languages.jsx.tag),r.languages.insertBefore("inside","special-attr",{script:{pattern:s(/=<BRACES>/.source),alias:"language-javascript",inside:{"script-punctuation":{pattern:/^=(?=\{)/,alias:"punctuation"},rest:r.languages.jsx}}},r.languages.jsx.tag);var o=function(h){return h?typeof h=="string"?h:typeof h.content=="string"?h.content:h.content.map(o).join(""):""},u=function(h){for(var m=[],p=0;p<h.length;p++){var g=h[p],S=!1;if(typeof g!="string"&&(g.type==="tag"&&g.content[0]&&g.content[0].type==="tag"?g.content[0].content[0].content==="</"?m.length>0&&m[m.length-1].tagName===o(g.content[0].content[1])&&m.pop():g.content[g.content.length-1].content==="/>"||m.push({tagName:o(g.content[0].content[1]),openedBraces:0}):m.length>0&&g.type==="punctuation"&&g.content==="{"?m[m.length-1].openedBraces++:m.length>0&&m[m.length-1].openedBraces>0&&g.type==="punctuation"&&g.content==="}"?m[m.length-1].openedBraces--:S=!0),(S||typeof g=="string")&&m.length>0&&m[m.length-1].openedBraces===0){var x=o(g);p<h.length-1&&(typeof h[p+1]=="string"||h[p+1].type==="plain-text")&&(x+=o(h[p+1]),h.splice(p+1,1)),p>0&&(typeof h[p-1]=="string"||h[p-1].type==="plain-text")&&(x=o(h[p-1])+x,h.splice(p-1,1),p--),h[p]=new r.Token("plain-text",x,null,x)}g.content&&typeof g.content!="string"&&u(g.content)}};r.hooks.add("after-tokenize",function(h){h.language!=="jsx"&&h.language!=="tsx"||u(h.tokens)})})(Prism);(function(r){var e=r.util.clone(r.languages.typescript);r.languages.tsx=r.languages.extend("jsx",e),delete r.languages.tsx.parameter,delete r.languages.tsx["literal-property"];var t=r.languages.tsx.tag;t.pattern=RegExp(/(^|[^\w$]|(?=<\/))/.source+"(?:"+t.pattern.source+")",t.pattern.flags),t.lookbehind=!0})(Prism);Prism.languages.markup={comment:{pattern:/<!--(?:(?!<!--)[\s\S])*?-->/,greedy:!0},prolog:{pattern:/<\?[\s\S]+?\?>/,greedy:!0},doctype:{pattern:/<!DOCTYPE(?:[^>"'[\]]|"[^"]*"|'[^']*')+(?:\[(?:[^<"'\]]|"[^"]*"|'[^']*'|<(?!!--)|<!--(?:[^-]|-(?!->))*-->)*\]\s*)?>/i,greedy:!0,inside:{"internal-subset":{pattern:/(^[^\[]*\[)[\s\S]+(?=\]>$)/,lookbehind:!0,greedy:!0,inside:null},string:{pattern:/"[^"]*"|'[^']*'/,greedy:!0},punctuation:/^<!|>$|[[\]]/,"doctype-tag":/^DOCTYPE/i,name:/[^\s<>'"]+/}},cdata:{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,greedy:!0},tag:{pattern:/<\/?(?!\d)[^\s>\/=$<%]+(?:\s(?:\s*[^\s>\/=]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))|(?=[\s/>])))+)?\s*\/?>/,greedy:!0,inside:{tag:{pattern:/^<\/?[^\s>\/]+/,inside:{punctuation:/^<\/?/,namespace:/^[^\s>\/:]+:/}},"special-attr":[],"attr-value":{pattern:/=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+)/,inside:{punctuation:[{pattern:/^=/,alias:"attr-equals"},{pattern:/^(\s*)["']|["']$/,lookbehind:!0}]}},punctuation:/\/?>/,"attr-name":{pattern:/[^\s>\/]+/,inside:{namespace:/^[^\s>\/:]+:/}}}},entity:[{pattern:/&[\da-z]{1,8};/i,alias:"named-entity"},/&#x?[\da-f]{1,8};/i]};Prism.languages.markup.tag.inside["attr-value"].inside.entity=Prism.languages.markup.entity;Prism.languages.markup.doctype.inside["internal-subset"].inside=Prism.languages.markup;Prism.hooks.add("wrap",function(r){r.type==="entity"&&(r.attributes.title=r.content.replace(/&/,"&"))});Object.defineProperty(Prism.languages.markup.tag,"addInlined",{value:function(e,t){var a={};a["language-"+t]={pattern:/(^<!\[CDATA\[)[\s\S]+?(?=\]\]>$)/i,lookbehind:!0,inside:Prism.languages[t]},a.cdata=/^<!\[CDATA\[|\]\]>$/i;var n={"included-cdata":{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,inside:a}
Line truncated
|
||||
?|
|
||||
|(?![\\s\\S])))+`,"m"),alias:n,inside:{line:{pattern:/(.)(?=[\s\S]).*(?:\r\n?|\n)?/,lookbehind:!0},prefix:{pattern:/[\s\S]/,alias:/\w+/.exec(t)[0]}}}}),Object.defineProperty(r.languages.diff,"PREFIXES",{value:e})})(Prism);Prism.languages.sql={comment:{pattern:/(^|[^\\])(?:\/\*[\s\S]*?\*\/|(?:--|\/\/|#).*)/,lookbehind:!0},variable:[{pattern:/@(["'`])(?:\\[\s\S]|(?!\1)[^\\])+\1/,greedy:!0},/@[\w.$]+/],string:{pattern:/(^|[^@\\])("|')(?:\\[\s\S]|(?!\2)[^\\]|\2\2)*\2/,greedy:!0,lookbehind:!0},identifier:{pattern:/(^|[^@\\])`(?:\\[\s\S]|[^`\\]|``)*`/,greedy:!0,lookbehind:!0,inside:{punctuation:/^`|`$/}},function:/\b(?:AVG|COUNT|FIRST|FORMAT|LAST|LCASE|LEN|MAX|MID|MIN|MOD|NOW|ROUND|SUM|UCASE)(?=\s*\()/i,keyword:/\b(?:ACTION|ADD|AFTER|ALGORITHM|ALL|ALTER|ANALYZE|ANY|APPLY|AS|ASC|AUTHORIZATION|AUTO_INCREMENT|BACKUP|BDB|BEGIN|BERKELEYDB|BIGINT|BINARY|BIT|BLOB|BOOL|BOOLEAN|BREAK|BROWSE|BTREE|BULK|BY|CALL|CASCADED?|CASE|CHAIN|CHAR(?:ACTER|SET)?|CHECK(?:POINT)?|CLOSE|CLUSTERED|COALESCE|COLLATE|COLUMNS?|COMMENT|COMMIT(?:TED)?|COMPUTE|CONNECT|CONSISTENT|CONSTRAINT|CONTAINS(?:TABLE)?|CONTINUE|CONVERT|CREATE|CROSS|CURRENT(?:_DATE|_TIME|_TIMESTAMP|_USER)?|CURSOR|CYCLE|DATA(?:BASES?)?|DATE(?:TIME)?|DAY|DBCC|DEALLOCATE|DEC|DECIMAL|DECLARE|DEFAULT|DEFINER|DELAYED|DELETE|DELIMITERS?|DENY|DESC|DESCRIBE|DETERMINISTIC|DISABLE|DISCARD|DISK|DISTINCT|DISTINCTROW|DISTRIBUTED|DO|DOUBLE|DROP|DUMMY|DUMP(?:FILE)?|DUPLICATE|ELSE(?:IF)?|ENABLE|ENCLOSED|END|ENGINE|ENUM|ERRLVL|ERRORS|ESCAPED?|EXCEPT|EXEC(?:UTE)?|EXISTS|EXIT|EXPLAIN|EXTENDED|FETCH|FIELDS|FILE|FILLFACTOR|FIRST|FIXED|FLOAT|FOLLOWING|FOR(?: EACH ROW)?|FORCE|FOREIGN|FREETEXT(?:TABLE)?|FROM|FULL|FUNCTION|GEOMETRY(?:COLLECTION)?|GLOBAL|GOTO|GRANT|GROUP|HANDLER|HASH|HAVING|HOLDLOCK|HOUR|IDENTITY(?:COL|_INSERT)?|IF|IGNORE|IMPORT|INDEX|INFILE|INNER|INNODB|INOUT|INSERT|INT|INTEGER|INTERSECT|INTERVAL|INTO|INVOKER|ISOLATION|ITERATE|JOIN|KEYS?|KILL|LANGUAGE|LAST|LEAVE|LEFT|LEVEL|LIMIT|LINENO|LINES|LINESTRING|LOAD|LOCAL|LOCK|LONG(?:BLOB|TEXT)|LOOP|MATCH(?:ED)?|MEDIUM(?:BLOB|INT|TEXT)|MERGE|MIDDLEINT|MINUTE|MODE|MODIFIES|MODIFY|MONTH|MULTI(?:LINESTRING|POINT|POLYGON)|NATIONAL|NATURAL|NCHAR|NEXT|NO|NONCLUSTERED|NULLIF|NUMERIC|OFF?|OFFSETS?|ON|OPEN(?:DATASOURCE|QUERY|ROWSET)?|OPTIMIZE|OPTION(?:ALLY)?|ORDER|OUT(?:ER|FILE)?|OVER|PARTIAL|PARTITION|PERCENT|PIVOT|PLAN|POINT|POLYGON|PRECEDING|PRECISION|PREPARE|PREV|PRIMARY|PRINT|PRIVILEGES|PROC(?:EDURE)?|PUBLIC|PURGE|QUICK|RAISERROR|READS?|REAL|RECONFIGURE|REFERENCES|RELEASE|RENAME|REPEAT(?:ABLE)?|REPLACE|REPLICATION|REQUIRE|RESIGNAL|RESTORE|RESTRICT|RETURN(?:ING|S)?|REVOKE|RIGHT|ROLLBACK|ROUTINE|ROW(?:COUNT|GUIDCOL|S)?|RTREE|RULE|SAVE(?:POINT)?|SCHEMA|SECOND|SELECT|SERIAL(?:IZABLE)?|SESSION(?:_USER)?|SET(?:USER)?|SHARE|SHOW|SHUTDOWN|SIMPLE|SMALLINT|SNAPSHOT|SOME|SONAME|SQL|START(?:ING)?|STATISTICS|STATUS|STRIPED|SYSTEM_USER|TABLES?|TABLESPACE|TEMP(?:ORARY|TABLE)?|TERMINATED|TEXT(?:SIZE)?|THEN|TIME(?:STAMP)?|TINY(?:BLOB|INT|TEXT)|TOP?|TRAN(?:SACTIONS?)?|TRIGGER|TRUNCATE|TSEQUAL|TYPES?|UNBOUNDED|UNCOMMITTED|UNDEFINED|UNION|UNIQUE|UNLOCK|UNPIVOT|UNSIGNED|UPDATE(?:TEXT)?|USAGE|USE|USER|USING|VALUES?|VAR(?:BINARY|CHAR|CHARACTER|YING)|VIEW|WAITFOR|WARNINGS|WHEN|WHERE|WHILE|WITH(?: ROLLUP|IN)?|WORK|WRITE(?:TEXT)?|YEAR)\b/i,boolean:/\b(?:FALSE|NULL|TRUE)\b/i,number:/\b0x[\da-f]+\b|\b\d+(?:\.\d*)?|\B\.\d+\b/i,operator:/[-+*\/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?|\b(?:AND|BETWEEN|DIV|ILIKE|IN|IS|LIKE|NOT|OR|REGEXP|RLIKE|SOUNDS LIKE|XOR)\b/i,punctuation:/[;[\]()`,.]/};var or={},ur;function gn(){return ur||(ur=1,(function(r){for(var e=/\/\*(?:[^*/]|\*(?!\/)|\/(?!\*)|<self>)*\*\//.source,t=0;t<2;t++)e=e.replace(/<self>/g,function(){return e});e=e.replace(/<self>/g,function(){return/[^\s\S]/.source}),r.languages.rust={comment:[{pattern:RegExp(/(^|[^\\])/.source+e),lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/b?"(?:\\[\s\S]|[^\\"])*"|b?r(#*)"(?:[^"]|"(?!\1))*"\1/,greedy:!0},char:{pattern:/b?'(?:\\(?:x[0-7][\da-fA-F]|u\{(?:[\da-fA-F]_*){1,6}\}|.)|[^\\\r\n\t'])'/,greedy:!0},attribute:{pattern:/#!?\[(?:[^\[\]"]|"(?:\\[\s\S]|[^\\"])*")*\]/,greedy:!0,alias:"attr-name",inside:{string:null}},"closure-params":{pattern:/([=(,:]\s*|\bmove\s*)\|[^|]*\||\|[^|]*\|(?=\s*(?:\{|->))/,lookbehind:!0,greedy:!0,inside:{"closure-punctuation":{pattern:/^\||\|$/,alias:"punctuation"},rest:null}},"lifetime-annotation":{pattern:/'\w+/,alias:"symbol"},"fragment-specifier":{pattern:/(\$\w+:)[a-z]+/,lookbehind:!0,alias:"punctuation"},variable:/\$\w+/,"function-definition":{pattern:/(\bfn\s+)\w+/,lookbehind:!0,alias:"function"},"type-definition":{pattern:/(\b(?:enum|struct|trait|type|union)\s+)\w+/,lookbehind:!0,alias:"class-name"},"module-declaration":[{pattern:/(\b(?:crate|mod)\s+)[a-z][a-z_\d]*/,lookbehind:!0,alias:"namespace"},{pattern:/(\b(?:crate|self|super)\s*)::\s*[a-z][a-z_\d]*\b(?:\s*::(?:\s*[a-z][a-z_\d]*\s*::)*)?/,lookbehind:!0,alias:"namespace",inside:{punctuation:/::/}}],keyword:[/\b(?:Self|abstract|as|async|await|become|boxLine truncated
|
||||
`),t=[];let a=0,n=0;for(const s of e){if(s.startsWith("diff --git")||s.startsWith("index ")||s.startsWith("--- ")||s.startsWith("+++ ")||s.startsWith("new file")||s.startsWith("deleted file")||s.startsWith("similarity index")||s.startsWith("rename from")||s.startsWith("rename to"))continue;const o=s.match(/^@@\s+-(\d+)(?:,\d+)?\s+\+(\d+)(?:,\d+)?\s+@@/);if(o){a=parseInt(o[1],10),n=parseInt(o[2],10),t.push({kind:"header",text:s});continue}if(s.startsWith("+"))t.push({kind:"add",text:s.slice(1),newLine:n++});else if(s.startsWith("-"))t.push({kind:"remove",text:s.slice(1),oldLine:a++});else{const u=s.startsWith(" ")?s.slice(1):s;t.push({kind:"context",text:u,oldLine:a++,newLine:n++})}}return t}const Rn=a0.memo(function({code:e}){const t=a0.useMemo(()=>Cn(e),[e]);return U.jsx("div",{"data-slot":"diff-block",children:t.map((a,n)=>U.jsxs("div",{"data-slot":"diff-line","data-diff-kind":a.kind,children:[a.kind!=="header"&&U.jsxs("span",{"data-slot":"diff-gutter",children:[U.jsx("span",{"data-slot":"diff-line-old",children:a.oldLine??""}),U.jsx("span",{"data-slot":"diff-line-new",children:a.newLine??""})]}),U.jsxs("span",{"data-slot":"diff-content",children:[a.kind==="add"&&U.jsx("span",{"data-slot":"diff-sign",children:"+"}),a.kind==="remove"&&U.jsx("span",{"data-slot":"diff-sign",children:"-"}),a.text]})]},n))})});class F extends Error{constructor(e,t){var a="KaTeX parse error: "+e,n,s,o=t&&t.loc;if(o&&o.start<=o.end){var u=o.lexer.input;n=o.start,s=o.end,n===u.length?a+=" at end of input: ":a+=" at position "+(n+1)+": ";var h=u.slice(n,s).replace(/[^]/g,"$&̲"),m;n>15?m="…"+u.slice(n-15,n):m=u.slice(0,n);var p;s+15<u.length?p=u.slice(s,s+15)+"…":p=u.slice(s),a+=m+h+p}super(a),this.name="ParseError",this.position=void 0,this.length=void 0,this.rawMessage=void 0,Object.setPrototypeOf(this,F.prototype),this.position=n,n!=null&&s!=null&&(this.length=s-n),this.rawMessage=e}}var Fn=/([A-Z])/g,In=r=>r.replace(Fn,"-$1").toLowerCase(),Dn={"&":"&",">":">","<":"<",'"':""","'":"'"},Nn=/[&><"']/g,c0=r=>String(r).replace(Nn,e=>Dn[e]),Pe=r=>r.type==="ordgroup"||r.type==="color"?r.body.length===1?Pe(r.body[0]):r:r.type==="font"?Pe(r.body):r,Bn=new Set(["mathord","textord","atom"]),_0=r=>Bn.has(Pe(r).type),On=r=>{var e=/^[\x00-\x20]*([^\\/#?]*?)(:|�*58|�*3a|&colon)/i.exec(r);return e?e[2]!==":"||!/^[a-zA-Z][a-zA-Z0-9+\-.]*$/.test(e[1])?null:e[1].toLowerCase():"_relative"},xt={displayMode:{type:"boolean",description:"Render math in display mode, which puts the math in display style (so \\int and \\sum are large, for example), and centers the math on the page on its own line.",cli:"-d, --display-mode"},output:{type:{enum:["htmlAndMathml","html","mathml"]},description:"Determines the markup language of the output.",cli:"-F, --format <type>"},leqno:{type:"boolean",description:"Render display math in leqno style (left-justified tags)."},fleqn:{type:"boolean",description:"Render display math flush left."},throwOnError:{type:"boolean",default:!0,cli:"-t, --no-throw-on-error",cliDescription:"Render errors (in the color given by --error-color) instead of throwing a ParseError exception when encountering an error."},errorColor:{type:"string",default:"#cc0000",cli:"-c, --error-color <color>",cliDescription:"A color string given in the format 'rgb' or 'rrggbb' (no #). This option determines the color of errors rendered by the -t option.",cliProcessor:r=>"#"+r},macros:{type:"object",cli:"-m, --macro <def>",cliDescription:"Define custom macro of the form '\\foo:expansion' (use multiple -m arguments for multiple macros).",cliDefault:[],cliProcessor:(r,e)=>(e.push(r),e)},minRuleThickness:{type:"number",description:"Specifies a minimum thickness, in ems, for fraction lines, `\\sqrt` top lines, `{array}` vertical lines, `\\hline`, `\\hdashline`, `\\underline`, `\\overline`, and the borders of `\\fbox`, `\\boxed`, and `\\fcolorbox`.",processor:r=>Math.max(0,r),cli:"--min-rule-thickness <size>",cliProcessor:parseFloat},colorIsTextColor:{type:"boolean",description:"Makes \\color behave like LaTeX's 2-argument \\textcolor, instead of LaTeX's one-argument \\color mode change.",cli:"-b, --color-is-text-color"},strict:{type:[{enum:["warn","ignore","error"]},"boolean","function"],description:"Turn on strict / LaTeX faithfulness mode, which throws an error if the input uses features that are not supported by LaTeX.",cli:"-S, --strict",cliDefault:!1},trust:{type:["boolean","function"],description:"Trust the input, enabling all HTML features such as \\url.",cli:"-T, --trust"},maxSize:{type:"number",default:1/0,description:"If non-zero, all user-specified sizes, e.g. in \\rule{500em}{500em}, will be capped to maxSize ems. Otherwise, elements and spaces can be arbitrarily large",processor:r=>Math.max(0,r),cli:"-s, --max-size <n>",cliProcessor:parseInt},maxExpand:{type:"number",default:1e3,description:"Limit the number of macro expansions to the specified number, to prevent e.g. infinite macro loops. If set to Infinity, the macro e
Line truncated
|
||||
c-2.7,0,-7.17,-2.7,-13.5,-8c-5.8,-5.3,-9.5,-10,-9.5,-14
|
||||
c0,-2,0.3,-3.3,1,-4c1.3,-2.7,23.83,-20.7,67.5,-54
|
||||
c44.2,-33.3,65.8,-50.3,66.5,-51c1.3,-1.3,3,-2,5,-2c4.7,0,8.7,3.3,12,10
|
||||
s173,378,173,378c0.7,0,35.3,-71,104,-213c68.7,-142,137.5,-285,206.5,-429
|
||||
c69,-144,104.5,-217.7,106.5,-221
|
||||
l`+e/2.075+" -"+e+`
|
||||
c5.3,-9.3,12,-14,20,-14
|
||||
H400000v`+(40+e)+`H845.2724
|
||||
s-225.272,467,-225.272,467s-235,486,-235,486c-2.7,4.7,-9,7,-19,7
|
||||
c-6,0,-10,-1,-12,-3s-194,-422,-194,-422s-65,47,-65,47z
|
||||
M`+(834+e)+" "+t+"h400000v"+(40+e)+"h-400000z"},Wn=function(e,t){return"M263,"+(601+e+t)+`c0.7,0,18,39.7,52,119
|
||||
c34,79.3,68.167,158.7,102.5,238c34.3,79.3,51.8,119.3,52.5,120
|
||||
c340,-704.7,510.7,-1060.3,512,-1067
|
||||
l`+e/2.084+" -"+e+`
|
||||
c4.7,-7.3,11,-11,19,-11
|
||||
H40000v`+(40+e)+`H1012.3
|
||||
s-271.3,567,-271.3,567c-38.7,80.7,-84,175,-136,283c-52,108,-89.167,185.3,-111.5,232
|
||||
c-22.3,46.7,-33.8,70.3,-34.5,71c-4.7,4.7,-12.3,7,-23,7s-12,-1,-12,-1
|
||||
s-109,-253,-109,-253c-72.7,-168,-109.3,-252,-110,-252c-10.7,8,-22,16.7,-34,26
|
||||
c-22,17.3,-33.3,26,-34,26s-26,-26,-26,-26s76,-59,76,-59s76,-60,76,-60z
|
||||
M`+(1001+e)+" "+t+"h400000v"+(40+e)+"h-400000z"},Yn=function(e,t){return"M983 "+(10+e+t)+`
|
||||
l`+e/3.13+" -"+e+`
|
||||
c4,-6.7,10,-10,18,-10 H400000v`+(40+e)+`
|
||||
H1013.1s-83.4,268,-264.1,840c-180.7,572,-277,876.3,-289,913c-4.7,4.7,-12.7,7,-24,7
|
||||
s-12,0,-12,0c-1.3,-3.3,-3.7,-11.7,-7,-25c-35.3,-125.3,-106.7,-373.3,-214,-744
|
||||
c-10,12,-21,25,-33,39s-32,39,-32,39c-6,-5.3,-15,-14,-27,-26s25,-30,25,-30
|
||||
c26.7,-32.7,52,-63,76,-91s52,-60,52,-60s208,722,208,722
|
||||
c56,-175.3,126.3,-397.3,211,-666c84.7,-268.7,153.8,-488.2,207.5,-658.5
|
||||
c53.7,-170.3,84.5,-266.8,92.5,-289.5z
|
||||
M`+(1001+e)+" "+t+"h400000v"+(40+e)+"h-400000z"},Zn=function(e,t){return"M424,"+(2398+e+t)+`
|
||||
c-1.3,-0.7,-38.5,-172,-111.5,-514c-73,-342,-109.8,-513.3,-110.5,-514
|
||||
c0,-2,-10.7,14.3,-32,49c-4.7,7.3,-9.8,15.7,-15.5,25c-5.7,9.3,-9.8,16,-12.5,20
|
||||
s-5,7,-5,7c-4,-3.3,-8.3,-7.7,-13,-13s-13,-13,-13,-13s76,-122,76,-122s77,-121,77,-121
|
||||
s209,968,209,968c0,-2,84.7,-361.7,254,-1079c169.3,-717.3,254.7,-1077.7,256,-1081
|
||||
l`+e/4.223+" -"+e+`c4,-6.7,10,-10,18,-10 H400000
|
||||
v`+(40+e)+`H1014.6
|
||||
s-87.3,378.7,-272.6,1166c-185.3,787.3,-279.3,1182.3,-282,1185
|
||||
c-2,6,-10,9,-24,9
|
||||
c-8,0,-12,-0.7,-12,-2z M`+(1001+e)+" "+t+`
|
||||
h400000v`+(40+e)+"h-400000z"},Kn=function(e,t){return"M473,"+(2713+e+t)+`
|
||||
c339.3,-1799.3,509.3,-2700,510,-2702 l`+e/5.298+" -"+e+`
|
||||
c3.3,-7.3,9.3,-11,18,-11 H400000v`+(40+e)+`H1017.7
|
||||
s-90.5,478,-276.2,1466c-185.7,988,-279.5,1483,-281.5,1485c-2,6,-10,9,-24,9
|
||||
c-8,0,-12,-0.7,-12,-2c0,-1.3,-5.3,-32,-16,-92c-50.7,-293.3,-119.7,-693.3,-207,-1200
|
||||
c0,-1.3,-5.3,8.7,-16,30c-10.7,21.3,-21.3,42.7,-32,64s-16,33,-16,33s-26,-26,-26,-26
|
||||
s76,-153,76,-153s77,-151,77,-151c0.7,0.7,35.7,202,105,604c67.3,400.7,102,602.7,104,
|
||||
606zM`+(1001+e)+" "+t+"h400000v"+(40+e)+"H1017.7z"},Jn=function(e){var t=e/2;return"M400000 "+e+" H0 L"+t+" 0 l65 45 L145 "+(e-80)+" H400000z"},Qn=function(e,t,a){var n=a-54-t-e;return"M702 "+(e+t)+"H400000"+(40+e)+`
|
||||
H742v`+n+`l-4 4-4 4c-.667.7 -2 1.5-4 2.5s-4.167 1.833-6.5 2.5-5.5 1-9.5 1
|
||||
h-12l-28-84c-16.667-52-96.667 -294.333-240-727l-212 -643 -85 170
|
||||
c-4-3.333-8.333-7.667-13 -13l-13-13l77-155 77-156c66 199.333 139 419.667
|
||||
219 661 l218 661zM702 `+t+"H400000v"+(40+e)+"H742z"},ei=function(e,t,a){t=1e3*t;var n="";switch(e){case"sqrtMain":n=Vn(t,ce);break;case"sqrtSize1":n=Wn(t,ce);break;case"sqrtSize2":n=Yn(t,ce);break;case"sqrtSize3":n=Zn(t,ce);break;case"sqrtSize4":n=Kn(t,ce);break;case"sqrtTall":n=Qn(t,ce,a)}return n},ti=function(e,t){switch(e){case"⎜":return l0("M291 0 H417 V"+t+" H291z");case"∣":return l0("M145 0 H188 V"+t+" H145z");case"∥":return l0("M145 0 H188 V"+t+" H145z")+l0("M367 0 H410 V"+t+" H367z");case"⎟":return l0("M457 0 H583 V"+t+" H457z");case"⎢":return l0("M319 0 H403 V"+t+" H319z");case"⎥":return l0("M263 0 H347 V"+t+" H263z");case"⎪":return l0("M384 0 H504 V"+t+" H384z");case"⏐":return l0("M312 0 H355 V"+t+" H312z");case"‖":return l0("M257 0 H300 V"+t+" H257z")+l0("M478 0 H521 V"+t+" H478z");default:return""}},yr={doubleleftarrow:`M262 157
|
||||
l10-10c34-36 62.7-77 86-123 3.3-8 5-13.3 5-16 0-5.3-6.7-8-20-8-7.3
|
||||
0-12.2.5-14.5 1.5-2.3 1-4.8 4.5-7.5 10.5-49.3 97.3-121.7 169.3-217 216-28
|
||||
14-57.3 25-88 33-6.7 2-11 3.8-13 5.5-2 1.7-3 4.2-3 7.5s1 5.8 3 7.5
|
||||
c2 1.7 6.3 3.5 13 5.5 68 17.3 128.2 47.8 180.5 91.5 52.3 43.7 93.8 96.2 124.5
|
||||
157.5 9.3 8 15.3 12.3 18 13h6c12-.7 18-4 18-10 0-2-1.7-7-5-15-23.3-46-52-87
|
||||
-86-123l-10-10h399738v-40H218c328 0 0 0 0 0l-10-8c-26.7-20-65.7-43-117-69 2.7
|
||||
-2 6-3.7 10-5 36.7-16 72.3-37.3 107-64l10-8h399782v-40z
|
||||
m8 0v40h399730v-40zm0 194v40h399730v-40z`,doublerightarrow:`M399738 392l
|
||||
-10 10c-34 36-62.7 77-86 123-3.3 8-5 13.3-5 16 0 5.3 6.7 8 20 8 7.3 0 12.2-.5
|
||||
14.5-1.5 2.3-1 4.8-4.5 7.5-10.5 49.3-97.3 121.7-169.3 217-216 28-14 57.3-25 88
|
||||
-33 6.7-2 11-3.8 13-5.5 2-1.7 3-4.2 3-7.5s-1-5.8-3-7.5c-2-1.7-6.3-3.5-13-5.5-68
|
||||
-17.3-128.2-47.8-180.5-91.5-52.3-43.7-93.8-96.2-124.5-157.5-9.3-8-15.3-12.3-18
|
||||
-13h-6c-12 .7-18 4-18 10 0 2 1.7 7 5 15 23.3 46 52 87 86 123l10 10H0v40h399782
|
||||
c-328 0 0 0 0 0l10 8c26.7 20 65.7 43 117 69-2.7 2-6 3.7-10 5-36.7 16-72.3 37.3
|
||||
-107 64l-10 8H0v40zM0 157v40h399730v-40zm0 194v40h399730v-40z`,leftarrow:`M400000 241H110l3-3c68.7-52.7 113.7-120
|
||||
135-202 4-14.7 6-23 6-25 0-7.3-7-11-21-11-8 0-13.2.8-15.5 2.5-2.3 1.7-4.2 5.8
|
||||
-5.5 12.5-1.3 4.7-2.7 10.3-4 17-12 48.7-34.8 92-68.5 130S65.3 228.3 18 247
|
||||
c-10 4-16 7.7-18 11 0 8.7 6 14.3 18 17 47.3 18.7 87.8 47 121.5 85S196 441.3 208
|
||||
490c.7 2 1.3 5 2 9s1.2 6.7 1.5 8c.3 1.3 1 3.3 2 6s2.2 4.5 3.5 5.5c1.3 1 3.3
|
||||
1.8 6 2.5s6 1 10 1c14 0 21-3.7 21-11 0-2-2-10.3-6-25-20-79.3-65-146.7-135-202
|
||||
l-3-3h399890zM100 241v40h399900v-40z`,leftbrace:`M6 548l-6-6v-35l6-11c56-104 135.3-181.3 238-232 57.3-28.7 117
|
||||
-45 179-50h399577v120H403c-43.3 7-81 15-113 26-100.7 33-179.7 91-237 174-2.7
|
||||
5-6 9-10 13-.7 1-7.3 1-20 1H6z`,leftbraceunder:`M0 6l6-6h17c12.688 0 19.313.3 20 1 4 4 7.313 8.3 10 13
|
||||
35.313 51.3 80.813 93.8 136.5 127.5 55.688 33.7 117.188 55.8 184.5 66.5.688
|
||||
0 2 .3 4 1 18.688 2.7 76 4.3 172 5h399450v120H429l-6-1c-124.688-8-235-61.7
|
||||
-331-161C60.687 138.7 32.312 99.3 7 54L0 41V6z`,leftgroup:`M400000 80
|
||||
H435C64 80 168.3 229.4 21 260c-5.9 1.2-18 0-18 0-2 0-3-1-3-3v-38C76 61 257 0
|
||||
435 0h399565z`,leftgroupunder:`M400000 262
|
||||
H435C64 262 168.3 112.6 21 82c-5.9-1.2-18 0-18 0-2 0-3 1-3 3v38c76 158 257 219
|
||||
435 219h399565z`,leftharpoon:`M0 267c.7 5.3 3 10 7 14h399993v-40H93c3.3
|
||||
-3.3 10.2-9.5 20.5-18.5s17.8-15.8 22.5-20.5c50.7-52 88-110.3 112-175 4-11.3 5
|
||||
-18.3 3-21-1.3-4-7.3-6-18-6-8 0-13 .7-15 2s-4.7 6.7-8 16c-42 98.7-107.3 174.7
|
||||
-196 228-6.7 4.7-10.7 8-12 10-1.3 2-2 5.7-2 11zm100-26v40h399900v-40z`,leftharpoonplus:`M0 267c.7 5.3 3 10 7 14h399993v-40H93c3.3-3.3 10.2-9.5
|
||||
20.5-18.5s17.8-15.8 22.5-20.5c50.7-52 88-110.3 112-175 4-11.3 5-18.3 3-21-1.3
|
||||
-4-7.3-6-18-6-8 0-13 .7-15 2s-4.7 6.7-8 16c-42 98.7-107.3 174.7-196 228-6.7 4.7
|
||||
-10.7 8-12 10-1.3 2-2 5.7-2 11zm100-26v40h399900v-40zM0 435v40h400000v-40z
|
||||
m0 0v40h400000v-40z`,leftharpoondown:`M7 241c-4 4-6.333 8.667-7 14 0 5.333.667 9 2 11s5.333
|
||||
5.333 12 10c90.667 54 156 130 196 228 3.333 10.667 6.333 16.333 9 17 2 .667 5
|
||||
1 9 1h5c10.667 0 16.667-2 18-6 2-2.667 1-9.667-3-21-32-87.333-82.667-157.667
|
||||
-152-211l-3-3h399907v-40zM93 281 H400000 v-40L7 241z`,leftharpoondownplus:`M7 435c-4 4-6.3 8.7-7 14 0 5.3.7 9 2 11s5.3 5.3 12
|
||||
10c90.7 54 156 130 196 228 3.3 10.7 6.3 16.3 9 17 2 .7 5 1 9 1h5c10.7 0 16.7
|
||||
-2 18-6 2-2.7 1-9.7-3-21-32-87.3-82.7-157.7-152-211l-3-3h399907v-40H7zm93 0
|
||||
v40h399900v-40zM0 241v40h399900v-40zm0 0v40h399900v-40z`,lefthook:`M400000 281 H103s-33-11.2-61-33.5S0 197.3 0 164s14.2-61.2 42.5
|
||||
-83.5C70.8 58.2 104 47 142 47 c16.7 0 25 6.7 25 20 0 12-8.7 18.7-26 20-40 3.3
|
||||
-68.7 15.7-86 37-10 12-15 25.3-15 40 0 22.7 9.8 40.7 29.5 54 19.7 13.3 43.5 21
|
||||
71.5 23h399859zM103 281v-40h399897v40z`,leftlinesegment:l0("M40 281 V428 H0 V94 H40 V241 H400000 v40z"),leftbracketunder:l0("M0 0 h120 V290 H399995 v120 H0z"),leftbracketover:l0("M0 440 h120 V150 H399995 v-120 H0z"),leftmapsto:l0("M40 281 V448H0V74H40V241H400000v40z"),leftToFrom:`M0 147h400000v40H0zm0 214c68 40 115.7 95.7 143 167h22c15.3 0 23
|
||||
-.3 23-1 0-1.3-5.3-13.7-16-37-18-35.3-41.3-69-70-101l-7-8h399905v-40H95l7-8
|
||||
c28.7-32 52-65.7 70-101 10.7-23.3 16-35.7 16-37 0-.7-7.7-1-23-1h-22C115.7 265.3
|
||||
68 321 0 361zm0-174v-40h399900v40zm100 154v40h399900v-40z`,longequal:l0("M0 50 h400000 v40H0z m0 194h40000v40H0z"),midbrace:`M200428 334
|
||||
c-100.7-8.3-195.3-44-280-108-55.3-42-101.7-93-139-153l-9-14c-2.7 4-5.7 8.7-9 14
|
||||
-53.3 86.7-123.7 153-211 199-66.7 36-137.3 56.3-212 62H0V214h199568c178.3-11.7
|
||||
311.7-78.3 403-201 6-8 9.7-12 11-12 .7-.7 6.7-1 18-1s17.3.3 18 1c1.3 0 5 4 11
|
||||
12 44.7 59.3 101.3 106.3 170 141s145.3 54.3 229 60h199572v120z`,midbraceunder:`M199572 214
|
||||
c100.7 8.3 195.3 44 280 108 55.3 42 101.7 93 139 153l9 14c2.7-4 5.7-8.7 9-14
|
||||
53.3-86.7 123.7-153 211-199 66.7-36 137.3-56.3 212-62h199568v120H200432c-178.3
|
||||
11.7-311.7 78.3-403 201-6 8-9.7 12-11 12-.7.7-6.7 1-18 1s-17.3-.3-18-1c-1.3 0
|
||||
-5-4-11-12-44.7-59.3-101.3-106.3-170-141s-145.3-54.3-229-60H0V214z`,oiintSize1:`M512.6 71.6c272.6 0 320.3 106.8 320.3 178.2 0 70.8-47.7 177.6
|
||||
-320.3 177.6S193.1 320.6 193.1 249.8c0-71.4 46.9-178.2 319.5-178.2z
|
||||
m368.1 178.2c0-86.4-60.9-215.4-368.1-215.4-306.4 0-367.3 129-367.3 215.4 0 85.8
|
||||
60.9 214.8 367.3 214.8 307.2 0 368.1-129 368.1-214.8z`,oiintSize2:`M757.8 100.1c384.7 0 451.1 137.6 451.1 230 0 91.3-66.4 228.8
|
||||
-451.1 228.8-386.3 0-452.7-137.5-452.7-228.8 0-92.4 66.4-230 452.7-230z
|
||||
m502.4 230c0-111.2-82.4-277.2-502.4-277.2s-504 166-504 277.2
|
||||
c0 110 84 276 504 276s502.4-166 502.4-276z`,oiiintSize1:`M681.4 71.6c408.9 0 480.5 106.8 480.5 178.2 0 70.8-71.6 177.6
|
||||
-480.5 177.6S202.1 320.6 202.1 249.8c0-71.4 70.5-178.2 479.3-178.2z
|
||||
m525.8 178.2c0-86.4-86.8-215.4-525.7-215.4-437.9 0-524.7 129-524.7 215.4 0
|
||||
85.8 86.8 214.8 524.7 214.8 438.9 0 525.7-129 525.7-214.8z`,oiiintSize2:`M1021.2 53c603.6 0 707.8 165.8 707.8 277.2 0 110-104.2 275.8
|
||||
-707.8 275.8-606 0-710.2-165.8-710.2-275.8C311 218.8 415.2 53 1021.2 53z
|
||||
m770.4 277.1c0-131.2-126.4-327.6-770.5-327.6S248.4 198.9 248.4 330.1
|
||||
c0 130 128.8 326.4 772.7 326.4s770.5-196.4 770.5-326.4z`,rightarrow:`M0 241v40h399891c-47.3 35.3-84 78-110 128
|
||||
-16.7 32-27.7 63.7-33 95 0 1.3-.2 2.7-.5 4-.3 1.3-.5 2.3-.5 3 0 7.3 6.7 11 20
|
||||
11 8 0 13.2-.8 15.5-2.5 2.3-1.7 4.2-5.5 5.5-11.5 2-13.3 5.7-27 11-41 14.7-44.7
|
||||
39-84.5 73-119.5s73.7-60.2 119-75.5c6-2 9-5.7 9-11s-3-9-9-11c-45.3-15.3-85
|
||||
-40.5-119-75.5s-58.3-74.8-73-119.5c-4.7-14-8.3-27.3-11-40-1.3-6.7-3.2-10.8-5.5
|
||||
-12.5-2.3-1.7-7.5-2.5-15.5-2.5-14 0-21 3.7-21 11 0 2 2 10.3 6 25 20.7 83.3 67
|
||||
151.7 139 205zm0 0v40h399900v-40z`,rightbrace:`M400000 542l
|
||||
-6 6h-17c-12.7 0-19.3-.3-20-1-4-4-7.3-8.3-10-13-35.3-51.3-80.8-93.8-136.5-127.5
|
||||
s-117.2-55.8-184.5-66.5c-.7 0-2-.3-4-1-18.7-2.7-76-4.3-172-5H0V214h399571l6 1
|
||||
c124.7 8 235 61.7 331 161 31.3 33.3 59.7 72.7 85 118l7 13v35z`,rightbraceunder:`M399994 0l6 6v35l-6 11c-56 104-135.3 181.3-238 232-57.3
|
||||
28.7-117 45-179 50H-300V214h399897c43.3-7 81-15 113-26 100.7-33 179.7-91 237
|
||||
-174 2.7-5 6-9 10-13 .7-1 7.3-1 20-1h17z`,rightgroup:`M0 80h399565c371 0 266.7 149.4 414 180 5.9 1.2 18 0 18 0 2 0
|
||||
3-1 3-3v-38c-76-158-257-219-435-219H0z`,rightgroupunder:`M0 262h399565c371 0 266.7-149.4 414-180 5.9-1.2 18 0 18
|
||||
0 2 0 3 1 3 3v38c-76 158-257 219-435 219H0z`,rightharpoon:`M0 241v40h399993c4.7-4.7 7-9.3 7-14 0-9.3
|
||||
-3.7-15.3-11-18-92.7-56.7-159-133.7-199-231-3.3-9.3-6-14.7-8-16-2-1.3-7-2-15-2
|
||||
-10.7 0-16.7 2-18 6-2 2.7-1 9.7 3 21 15.3 42 36.7 81.8 64 119.5 27.3 37.7 58
|
||||
69.2 92 94.5zm0 0v40h399900v-40z`,rightharpoonplus:`M0 241v40h399993c4.7-4.7 7-9.3 7-14 0-9.3-3.7-15.3-11
|
||||
-18-92.7-56.7-159-133.7-199-231-3.3-9.3-6-14.7-8-16-2-1.3-7-2-15-2-10.7 0-16.7
|
||||
2-18 6-2 2.7-1 9.7 3 21 15.3 42 36.7 81.8 64 119.5 27.3 37.7 58 69.2 92 94.5z
|
||||
m0 0v40h399900v-40z m100 194v40h399900v-40zm0 0v40h399900v-40z`,rightharpoondown:`M399747 511c0 7.3 6.7 11 20 11 8 0 13-.8 15-2.5s4.7-6.8
|
||||
8-15.5c40-94 99.3-166.3 178-217 13.3-8 20.3-12.3 21-13 5.3-3.3 8.5-5.8 9.5
|
||||
-7.5 1-1.7 1.5-5.2 1.5-10.5s-2.3-10.3-7-15H0v40h399908c-34 25.3-64.7 57-92 95
|
||||
-27.3 38-48.7 77.7-64 119-3.3 8.7-5 14-5 16zM0 241v40h399900v-40z`,rightharpoondownplus:`M399747 705c0 7.3 6.7 11 20 11 8 0 13-.8
|
||||
15-2.5s4.7-6.8 8-15.5c40-94 99.3-166.3 178-217 13.3-8 20.3-12.3 21-13 5.3-3.3
|
||||
8.5-5.8 9.5-7.5 1-1.7 1.5-5.2 1.5-10.5s-2.3-10.3-7-15H0v40h399908c-34 25.3
|
||||
-64.7 57-92 95-27.3 38-48.7 77.7-64 119-3.3 8.7-5 14-5 16zM0 435v40h399900v-40z
|
||||
m0-194v40h400000v-40zm0 0v40h400000v-40z`,righthook:`M399859 241c-764 0 0 0 0 0 40-3.3 68.7-15.7 86-37 10-12 15-25.3
|
||||
15-40 0-22.7-9.8-40.7-29.5-54-19.7-13.3-43.5-21-71.5-23-17.3-1.3-26-8-26-20 0
|
||||
-13.3 8.7-20 26-20 38 0 71 11.2 99 33.5 0 0 7 5.6 21 16.7 14 11.2 21 33.5 21
|
||||
66.8s-14 61.2-42 83.5c-28 22.3-61 33.5-99 33.5L0 241z M0 281v-40h399859v40z`,rightlinesegment:l0("M399960 241 V94 h40 V428 h-40 V281 H0 v-40z"),rightbracketunder:l0("M399995 0 h-120 V290 H0 v120 H400000z"),rightbracketover:l0("M399995 440 h-120 V150 H0 v-120 H399995z"),rightToFrom:`M400000 167c-70.7-42-118-97.7-142-167h-23c-15.3 0-23 .3-23
|
||||
1 0 1.3 5.3 13.7 16 37 18 35.3 41.3 69 70 101l7 8H0v40h399905l-7 8c-28.7 32
|
||||
-52 65.7-70 101-10.7 23.3-16 35.7-16 37 0 .7 7.7 1 23 1h23c24-69.3 71.3-125 142
|
||||
-167z M100 147v40h399900v-40zM0 341v40h399900v-40z`,twoheadleftarrow:`M0 167c68 40
|
||||
115.7 95.7 143 167h22c15.3 0 23-.3 23-1 0-1.3-5.3-13.7-16-37-18-35.3-41.3-69
|
||||
-70-101l-7-8h125l9 7c50.7 39.3 85 86 103 140h46c0-4.7-6.3-18.7-19-42-18-35.3
|
||||
-40-67.3-66-96l-9-9h399716v-40H284l9-9c26-28.7 48-60.7 66-96 12.7-23.333 19
|
||||
-37.333 19-42h-46c-18 54-52.3 100.7-103 140l-9 7H95l7-8c28.7-32 52-65.7 70-101
|
||||
10.7-23.333 16-35.7 16-37 0-.7-7.7-1-23-1h-22C115.7 71.3 68 127 0 167z`,twoheadrightarrow:`M400000 167
|
||||
c-68-40-115.7-95.7-143-167h-22c-15.3 0-23 .3-23 1 0 1.3 5.3 13.7 16 37 18 35.3
|
||||
41.3 69 70 101l7 8h-125l-9-7c-50.7-39.3-85-86-103-140h-46c0 4.7 6.3 18.7 19 42
|
||||
18 35.3 40 67.3 66 96l9 9H0v40h399716l-9 9c-26 28.7-48 60.7-66 96-12.7 23.333
|
||||
-19 37.333-19 42h46c18-54 52.3-100.7 103-140l9-7h125l-7 8c-28.7 32-52 65.7-70
|
||||
101-10.7 23.333-16 35.7-16 37 0 .7 7.7 1 23 1h22c27.3-71.3 75-127 143-167z`,tilde1:`M200 55.538c-77 0-168 73.953-177 73.953-3 0-7
|
||||
-2.175-9-5.437L2 97c-1-2-2-4-2-6 0-4 2-7 5-9l20-12C116 12 171 0 207 0c86 0
|
||||
114 68 191 68 78 0 168-68 177-68 4 0 7 2 9 5l12 19c1 2.175 2 4.35 2 6.525 0
|
||||
4.35-2 7.613-5 9.788l-19 13.05c-92 63.077-116.937 75.308-183 76.128
|
||||
-68.267.847-113-73.952-191-73.952z`,tilde2:`M344 55.266c-142 0-300.638 81.316-311.5 86.418
|
||||
-8.01 3.762-22.5 10.91-23.5 5.562L1 120c-1-2-1-3-1-4 0-5 3-9 8-10l18.4-9C160.9
|
||||
31.9 283 0 358 0c148 0 188 122 331 122s314-97 326-97c4 0 8 2 10 7l7 21.114
|
||||
c1 2.14 1 3.21 1 4.28 0 5.347-3 9.626-7 10.696l-22.3 12.622C852.6 158.372 751
|
||||
181.476 676 181.476c-149 0-189-126.21-332-126.21z`,tilde3:`M786 59C457 59 32 175.242 13 175.242c-6 0-10-3.457
|
||||
-11-10.37L.15 138c-1-7 3-12 10-13l19.2-6.4C378.4 40.7 634.3 0 804.3 0c337 0
|
||||
411.8 157 746.8 157 328 0 754-112 773-112 5 0 10 3 11 9l1 14.075c1 8.066-.697
|
||||
16.595-6.697 17.492l-21.052 7.31c-367.9 98.146-609.15 122.696-778.15 122.696
|
||||
-338 0-409-156.573-744-156.573z`,tilde4:`M786 58C457 58 32 177.487 13 177.487c-6 0-10-3.345
|
||||
-11-10.035L.15 143c-1-7 3-12 10-13l22-6.7C381.2 35 637.15 0 807.15 0c337 0 409
|
||||
177 744 177 328 0 754-127 773-127 5 0 10 3 11 9l1 14.794c1 7.805-3 13.38-9
|
||||
14.495l-20.7 5.574c-366.85 99.79-607.3 139.372-776.3 139.372-338 0-409
|
||||
-175.236-744-175.236z`,vec:`M377 20c0-5.333 1.833-10 5.5-14S391 0 397 0c4.667 0 8.667 1.667 12 5
|
||||
3.333 2.667 6.667 9 10 19 6.667 24.667 20.333 43.667 41 57 7.333 4.667 11
|
||||
10.667 11 18 0 6-1 10-3 12s-6.667 5-14 9c-28.667 14.667-53.667 35.667-75 63
|
||||
-1.333 1.333-3.167 3.5-5.5 6.5s-4 4.833-5 5.5c-1 .667-2.5 1.333-4.5 2s-4.333 1
|
||||
-7 1c-4.667 0-9.167-1.833-13.5-5.5S337 184 337 178c0-12.667 15.667-32.333 47-59
|
||||
H213l-171-1c-8.667-6-13-12.333-13-19 0-4.667 4.333-11.333 13-20h359
|
||||
c-16-25.333-24-45-24-59z`,widehat1:`M529 0h5l519 115c5 1 9 5 9 10 0 1-1 2-1 3l-4 22
|
||||
c-1 5-5 9-11 9h-2L532 67 19 159h-2c-5 0-9-4-11-9l-5-22c-1-6 2-12 8-13z`,widehat2:`M1181 0h2l1171 176c6 0 10 5 10 11l-2 23c-1 6-5 10
|
||||
-11 10h-1L1182 67 15 220h-1c-6 0-10-4-11-10l-2-23c-1-6 4-11 10-11z`,widehat3:`M1181 0h2l1171 236c6 0 10 5 10 11l-2 23c-1 6-5 10
|
||||
-11 10h-1L1182 67 15 280h-1c-6 0-10-4-11-10l-2-23c-1-6 4-11 10-11z`,widehat4:`M1181 0h2l1171 296c6 0 10 5 10 11l-2 23c-1 6-5 10
|
||||
-11 10h-1L1182 67 15 340h-1c-6 0-10-4-11-10l-2-23c-1-6 4-11 10-11z`,widecheck1:`M529,159h5l519,-115c5,-1,9,-5,9,-10c0,-1,-1,-2,-1,-3l-4,-22c-1,
|
||||
-5,-5,-9,-11,-9h-2l-512,92l-513,-92h-2c-5,0,-9,4,-11,9l-5,22c-1,6,2,12,8,13z`,widecheck2:`M1181,220h2l1171,-176c6,0,10,-5,10,-11l-2,-23c-1,-6,-5,-10,
|
||||
-11,-10h-1l-1168,153l-1167,-153h-1c-6,0,-10,4,-11,10l-2,23c-1,6,4,11,10,11z`,widecheck3:`M1181,280h2l1171,-236c6,0,10,-5,10,-11l-2,-23c-1,-6,-5,-10,
|
||||
-11,-10h-1l-1168,213l-1167,-213h-1c-6,0,-10,4,-11,10l-2,23c-1,6,4,11,10,11z`,widecheck4:`M1181,340h2l1171,-296c6,0,10,-5,10,-11l-2,-23c-1,-6,-5,-10,
|
||||
-11,-10h-1l-1168,273l-1167,-273h-1c-6,0,-10,4,-11,10l-2,23c-1,6,4,11,10,11z`,baraboveleftarrow:`M400000 620h-399890l3 -3c68.7 -52.7 113.7 -120 135 -202
|
||||
c4 -14.7 6 -23 6 -25c0 -7.3 -7 -11 -21 -11c-8 0 -13.2 0.8 -15.5 2.5
|
||||
c-2.3 1.7 -4.2 5.8 -5.5 12.5c-1.3 4.7 -2.7 10.3 -4 17c-12 48.7 -34.8 92 -68.5 130
|
||||
s-74.2 66.3 -121.5 85c-10 4 -16 7.7 -18 11c0 8.7 6 14.3 18 17c47.3 18.7 87.8 47
|
||||
121.5 85s56.5 81.3 68.5 130c0.7 2 1.3 5 2 9s1.2 6.7 1.5 8c0.3 1.3 1 3.3 2 6
|
||||
s2.2 4.5 3.5 5.5c1.3 1 3.3 1.8 6 2.5s6 1 10 1c14 0 21 -3.7 21 -11
|
||||
c0 -2 -2 -10.3 -6 -25c-20 -79.3 -65 -146.7 -135 -202l-3 -3h399890z
|
||||
M100 620v40h399900v-40z M0 241v40h399900v-40zM0 241v40h399900v-40z`,rightarrowabovebar:`M0 241v40h399891c-47.3 35.3-84 78-110 128-16.7 32
|
||||
-27.7 63.7-33 95 0 1.3-.2 2.7-.5 4-.3 1.3-.5 2.3-.5 3 0 7.3 6.7 11 20 11 8 0
|
||||
13.2-.8 15.5-2.5 2.3-1.7 4.2-5.5 5.5-11.5 2-13.3 5.7-27 11-41 14.7-44.7 39
|
||||
-84.5 73-119.5s73.7-60.2 119-75.5c6-2 9-5.7 9-11s-3-9-9-11c-45.3-15.3-85-40.5
|
||||
-119-75.5s-58.3-74.8-73-119.5c-4.7-14-8.3-27.3-11-40-1.3-6.7-3.2-10.8-5.5
|
||||
-12.5-2.3-1.7-7.5-2.5-15.5-2.5-14 0-21 3.7-21 11 0 2 2 10.3 6 25 20.7 83.3 67
|
||||
151.7 139 205zm96 379h399894v40H0zm0 0h399904v40H0z`,baraboveshortleftharpoon:`M507,435c-4,4,-6.3,8.7,-7,14c0,5.3,0.7,9,2,11
|
||||
c1.3,2,5.3,5.3,12,10c90.7,54,156,130,196,228c3.3,10.7,6.3,16.3,9,17
|
||||
c2,0.7,5,1,9,1c0,0,5,0,5,0c10.7,0,16.7,-2,18,-6c2,-2.7,1,-9.7,-3,-21
|
||||
c-32,-87.3,-82.7,-157.7,-152,-211c0,0,-3,-3,-3,-3l399351,0l0,-40
|
||||
c-398570,0,-399437,0,-399437,0z M593 435 v40 H399500 v-40z
|
||||
M0 281 v-40 H399908 v40z M0 281 v-40 H399908 v40z`,rightharpoonaboveshortbar:`M0,241 l0,40c399126,0,399993,0,399993,0
|
||||
c4.7,-4.7,7,-9.3,7,-14c0,-9.3,-3.7,-15.3,-11,-18c-92.7,-56.7,-159,-133.7,-199,
|
||||
-231c-3.3,-9.3,-6,-14.7,-8,-16c-2,-1.3,-7,-2,-15,-2c-10.7,0,-16.7,2,-18,6
|
||||
c-2,2.7,-1,9.7,3,21c15.3,42,36.7,81.8,64,119.5c27.3,37.7,58,69.2,92,94.5z
|
||||
M0 241 v40 H399908 v-40z M0 475 v-40 H399500 v40z M0 475 v-40 H399500 v40z`,shortbaraboveleftharpoon:`M7,435c-4,4,-6.3,8.7,-7,14c0,5.3,0.7,9,2,11
|
||||
c1.3,2,5.3,5.3,12,10c90.7,54,156,130,196,228c3.3,10.7,6.3,16.3,9,17c2,0.7,5,1,9,
|
||||
1c0,0,5,0,5,0c10.7,0,16.7,-2,18,-6c2,-2.7,1,-9.7,-3,-21c-32,-87.3,-82.7,-157.7,
|
||||
-152,-211c0,0,-3,-3,-3,-3l399907,0l0,-40c-399126,0,-399993,0,-399993,0z
|
||||
M93 435 v40 H400000 v-40z M500 241 v40 H400000 v-40z M500 241 v40 H400000 v-40z`,shortrightharpoonabovebar:`M53,241l0,40c398570,0,399437,0,399437,0
|
||||
c4.7,-4.7,7,-9.3,7,-14c0,-9.3,-3.7,-15.3,-11,-18c-92.7,-56.7,-159,-133.7,-199,
|
||||
-231c-3.3,-9.3,-6,-14.7,-8,-16c-2,-1.3,-7,-2,-15,-2c-10.7,0,-16.7,2,-18,6
|
||||
c-2,2.7,-1,9.7,3,21c15.3,42,36.7,81.8,64,119.5c27.3,37.7,58,69.2,92,94.5z
|
||||
M500 241 v40 H399408 v-40z M500 435 v40 H400000 v-40z`},ri=function(e,t){switch(e){case"lbrack":return"M403 1759 V84 H666 V0 H319 V1759 v"+t+` v1759 v84 h347 v-84
|
||||
H403z M403 1759 V0 H319 V1759 v`+t+" v1759 v84 h84z";case"rbrack":return"M347 1759 V0 H0 V84 H263 V1759 v"+t+` v1759 H0 v84 H347z
|
||||
M347 1759 V0 H263 V1759 v`+t+" v1759 h84z";case"vert":return"M145 15 v585 v"+t+` v585 c2.667,10,9.667,15,21,15
|
||||
c10,0,16.667,-5,20,-15 v-585 v`+-t+` v-585 c-2.667,-10,-9.667,-15,-21,-15
|
||||
c-10,0,-16.667,5,-20,15z M188 15 H145 v585 v`+t+" v585 h43z";case"doublevert":return"M145 15 v585 v"+t+` v585 c2.667,10,9.667,15,21,15
|
||||
c10,0,16.667,-5,20,-15 v-585 v`+-t+` v-585 c-2.667,-10,-9.667,-15,-21,-15
|
||||
c-10,0,-16.667,5,-20,15z M188 15 H145 v585 v`+t+` v585 h43z
|
||||
M367 15 v585 v`+t+` v585 c2.667,10,9.667,15,21,15
|
||||
c10,0,16.667,-5,20,-15 v-585 v`+-t+` v-585 c-2.667,-10,-9.667,-15,-21,-15
|
||||
c-10,0,-16.667,5,-20,15z M410 15 H367 v585 v`+t+" v585 h43z";case"lfloor":return"M319 602 V0 H403 V602 v"+t+` v1715 h263 v84 H319z
|
||||
MM319 602 V0 H403 V602 v`+t+" v1715 H319z";case"rfloor":return"M319 602 V0 H403 V602 v"+t+` v1799 H0 v-84 H319z
|
||||
MM319 602 V0 H403 V602 v`+t+" v1715 H319z";case"lceil":return"M403 1759 V84 H666 V0 H319 V1759 v"+t+` v602 h84z
|
||||
M403 1759 V0 H319 V1759 v`+t+" v602 h84z";case"rceil":return"M347 1759 V0 H0 V84 H263 V1759 v"+t+` v602 h84z
|
||||
M347 1759 V0 h-84 V1759 v`+t+" v602 h84z";case"lparen":return`M863,9c0,-2,-2,-5,-6,-9c0,0,-17,0,-17,0c-12.7,0,-19.3,0.3,-20,1
|
||||
c-5.3,5.3,-10.3,11,-15,17c-242.7,294.7,-395.3,682,-458,1162c-21.3,163.3,-33.3,349,
|
||||
-36,557 l0,`+(t+84)+`c0.2,6,0,26,0,60c2,159.3,10,310.7,24,454c53.3,528,210,
|
||||
949.7,470,1265c4.7,6,9.7,11.7,15,17c0.7,0.7,7,1,19,1c0,0,18,0,18,0c4,-4,6,-7,6,-9
|
||||
c0,-2.7,-3.3,-8.7,-10,-18c-135.3,-192.7,-235.5,-414.3,-300.5,-665c-65,-250.7,-102.5,
|
||||
-544.7,-112.5,-882c-2,-104,-3,-167,-3,-189
|
||||
l0,-`+(t+92)+`c0,-162.7,5.7,-314,17,-454c20.7,-272,63.7,-513,129,-723c65.3,
|
||||
-210,155.3,-396.3,270,-559c6.7,-9.3,10,-15.3,10,-18z`;case"rparen":return`M76,0c-16.7,0,-25,3,-25,9c0,2,2,6.3,6,13c21.3,28.7,42.3,60.3,
|
||||
63,95c96.7,156.7,172.8,332.5,228.5,527.5c55.7,195,92.8,416.5,111.5,664.5
|
||||
c11.3,139.3,17,290.7,17,454c0,28,1.7,43,3.3,45l0,`+(t+9)+`
|
||||
c-3,4,-3.3,16.7,-3.3,38c0,162,-5.7,313.7,-17,455c-18.7,248,-55.8,469.3,-111.5,664
|
||||
c-55.7,194.7,-131.8,370.3,-228.5,527c-20.7,34.7,-41.7,66.3,-63,95c-2,3.3,-4,7,-6,11
|
||||
c0,7.3,5.7,11,17,11c0,0,11,0,11,0c9.3,0,14.3,-0.3,15,-1c5.3,-5.3,10.3,-11,15,-17
|
||||
c242.7,-294.7,395.3,-681.7,458,-1161c21.3,-164.7,33.3,-350.7,36,-558
|
||||
l0,-`+(t+144)+`c-2,-159.3,-10,-310.7,-24,-454c-53.3,-528,-210,-949.7,
|
||||
-470,-1265c-4.7,-6,-9.7,-11.7,-15,-17c-0.7,-0.7,-6.7,-1,-18,-1z`;default:throw new Error("Unknown stretchy delimiter.")}};function ai(r){return"toText"in r}class fe{constructor(e){this.children=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.maxFontSize=void 0,this.style=void 0,this.children=e,this.classes=[],this.height=0,this.depth=0,this.maxFontSize=0,this.style={}}hasClass(e){return this.classes.includes(e)}toNode(){for(var e=document.createDocumentFragment(),t=0;t<this.children.length;t++)e.appendChild(this.children[t].toNode());return e}toMarkup(){for(var e="",t=0;t<this.children.length;t++)e+=this.children[t].toMarkup();return e}toText(){return this.children.map(e=>{if(ai(e))return e.toText();throw new Error("Expected MathDomNode with toText, got "+e.constructor.name)}).join("")}}var St={pt:1,mm:7227/2540,cm:7227/254,in:72.27,bp:803/800,pc:12,dd:1238/1157,cc:14856/1157,nd:685/642,nc:1370/107,sp:1/65536,px:803/800},ni={ex:!0,em:!0,mu:!0},sa=function(e){return typeof e!="string"&&(e=e.unit),e in St||e in ni||e==="ex"},t0=function(e,t){var a;if(e.unit in St)a=St[e.unit]/t.fontMetrics().ptPerEm/t.sizeMultiplier;else if(e.unit==="mu")a=t.fontMetrics().cssEmPerMu;else{var n;if(t.style.isTight()?n=t.havingStyle(t.style.text()):n=t,e.unit==="ex")a=n.fontMetrics().xHeight;else if(e.unit==="em")a=n.fontMetrics().quad;else throw new F("Invalid unit: '"+e.unit+"'");n!==t&&(a*=n.sizeMultiplier/t.sizeMultiplier)}return Math.min(e.number*a,t.maxSize)},N=function(e){return+e.toFixed(4)+"em"},K0=function(e){return e.filter(t=>t).join(" ")},$t=function(e){var t="";for(var a of Object.keys(e)){var n=e[a];n!==void 0&&(t+=In(a)+":"+n+";")}return t},la=function(e,t,a){if(this.classes=e||[],this.attributes={},this.height=0,this.depth=0,this.maxFontSize=0,this.style=a||{},t){t.style.isTight()&&this.classes.push("mtight");var n=t.getColor();n&&(this.style.color=n)}},oa=function(e){var t=document.createElement(e);t.className=K0(this.classes),Object.assign(t.style,this.style);for(var a of Object.keys(this.attributes))t.setAttribute(a,this.attributes[a]);for(var n=0;n<this.children.length;n++)t.appendChild(this.children[n].toNode());return t},ii=/[\s"'>/=\x00-\x1f]/,ua=function(e){var t="<"+e;this.classes.length&&(t+=' class="'+c0(K0(this.classes))+'"');var a=$t(this.style);a&&(t+=' style="'+c0(a)+'"');for(var n of Object.keys(this.attributes)){if(ii.test(n))throw new F("Invalid attribute name '"+n+"'");t+=" "+n+'="'+c0(this.attributes[n])+'"'}t+=">";for(var s=0;s<this.children.length;s++)t+=this.children[s].toMarkup();return t+="</"+e+">",t};class ve{constructor(e,t,a,n){this.children=void 0,this.attributes=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.width=void 0,this.maxFontSize=void 0,this.style=void 0,this.italic=void 0,la.call(this,e,a,n),this.children=t||[]}setAttribute(e,t){this.attributes[e]=t}hasClass(e){return this.classes.includes(e)}toNode(){return oa.call(this,"span")}toMarkup(){return ua.call(this,"span")}}class je{constructor(e,t,a,n){this.children=void 0,this.attributes=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.maxFontSize=void 0,this.style=void 0,la.call(this,t,n),this.children=a||[],this.setAttribute("href",e)}setAttribute(e,t){this.attributes[e]=t}hasClass(e){return this.classes.includes(e)}toNode(){return oa.call(this,"a")}toMarkup(){return ua.call(this,"a")}}class si{constructor(e,t,a){this.src=void 0,this.alt=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.maxFontSize=void 0,this.style=void 0,this.alt=t,this.src=e,this.classes=["mord"],this.height=0,this.depth=0,this.maxFontSize=0,this.style=a}hasClass(e){return this.classes.includes(e)}toNode(){var e=document.createElement("img");return e.src=this.src,e.alt=this.alt,e.className="mord",Object.assign(e.style,this.style),e}toMarkup(){var e='<img src="'+c0(this.src)+'"'+(' alt="'+c0(this.alt)+'"'),t=$t(this.style);return t&&(e+=' style="'+c0(t)+'"'),e+="'/>",e}}var li={î:"ı̂",ï:"ı̈",í:"ı́",ì:"ı̀"};class A0{constructor(e,t,a,n,s,o,u,h){this.text=void 0,this.height=void 0,this.depth=void 0,this.italic=void 0,this.skew=void 0,this.width=void 0,this.maxFontSize=void 0,this.classes=void 0,this.style=void 0,this.text=e,this.height=t||0,this.depth=a||0,this.italic=n||0,this.skew=s||0,this.width=o||0,this.classes=u||[],this.style=h||{},this.maxFontSize=0;var m=Xn(this.text.charCodeAt(0));m&&this.classes.push(m+"_fallback"),/[îïíì]/.test(this.text)&&(this.text=li[this.text])}hasClass(e){return this.classes.includes(e)}toNode(){var e=document.createTextNode(this.text),t=null;return this.italic>0&&(t=document.createElement("span"),t.style.marginRight=N(this.italic)),this.classes.length>0&&(t=t||document.createElement("span"),t.className=K0(this.classes)),Object.keys(this.style).length>0&&(t=t||document.createElement("span"),Object.assign(t.style,this.style)),t?(t.appendChild(e),t):e}toMarkup(){var e=!1,t="<span";this.classes.length&&(e=!0,t+=' class="',t+=c0(K0
Line truncated
|
||||
`+T+" children.");for(var B=0;B<T;B++){var j=new J0(y[B]),W=new $0([j],{width:"400em",height:N(A),viewBox:"0 0 "+u+" "+k,preserveAspectRatio:P[B]+" slice"}),Y=Q0([O[B]],[W],t);if(T===1)return{span:Y,minWidth:w,height:A};Y.style.height=N(A),M.push(Y)}return{span:C(["stretchy"],M,t),minWidth:w,height:A}}}var{span:n,minWidth:s,height:o}=a();return n.height=o,n.style.height=N(o),s>0&&(n.style.minWidth=N(s)),n},Bi=function(e,t,a,n,s){var o,u=e.height+e.depth+a+n;if(/fbox|color|angl/.test(t)){if(o=C(["stretchy",t],[],s),t==="fbox"){var h=s.color&&s.getColor();h&&(o.style.borderColor=h)}}else{var m=[];/^[bx]cancel$/.test(t)&&m.push(new kt({x1:"0",y1:"0",x2:"100%",y2:"100%","stroke-width":"0.046em"})),/^x?cancel$/.test(t)&&m.push(new kt({x1:"0",y1:"100%",x2:"100%",y2:"0","stroke-width":"0.046em"}));var p=new $0(m,{width:"100%",height:N(u)});o=Q0([],[p],s)}return o.height=u,o.style.height=N(u),o},Oi={bin:1,close:1,inner:1,open:1,punct:1,rel:1},Li={"accent-token":1,mathord:1,"op-token":1,spacing:1,textord:1};function qi(r){return r in Oi}function G(r,e){if(!r||r.type!==e)throw new Error("Expected node of type "+e+", but got "+(r?"node of type "+r.type:String(r)));return r}function Ze(r){var e=Ke(r);if(!e)throw new Error("Expected node of symbol group type, but got "+(r?"node of type "+r.type:String(r)));return e}function Ke(r){return r&&(r.type==="atom"||Li.hasOwnProperty(r.type))?r:null}var wa=r=>{if(r instanceof A0)return r;if(ci(r)&&r.children.length===1)return wa(r.children[0])},Sa=(r,e)=>{var t,a,n;r&&r.type==="supsub"?(a=G(r.base,"accent"),t=a.base,r.base=t,n=ui(V(r,e)),r.base=a):(a=G(r,"accent"),t=a.base);var s=V(t,e.havingCrampedStyle()),o=a.isShifty&&_0(t),u=0;if(o){var h,m;u=(h=(m=wa(s))==null?void 0:m.skew)!=null?h:0}var p=a.label==="\\c",g=p?s.height+s.depth:Math.min(s.height,e.fontMetrics().xHeight),S;if(a.isStretchy)S=Ye(a,e),S=X({positionType:"firstBaseline",children:[{type:"elem",elem:s},{type:"elem",elem:S,wrapperClasses:["svg-align"],wrapperStyle:u>0?{width:"calc(100% - "+N(2*u)+")",marginLeft:N(2*u)}:void 0}]});else{var x,D;a.label==="\\vec"?(x=pa("vec",e),D=ma.vec[1]):(x=Ve({type:"textord",mode:a.mode,text:a.label},e),x=oi(x),x.italic=0,D=x.width,p&&(g+=x.depth)),S=C(["accent-body"],[x]);var E=a.label==="\\textcircled";E&&(S.classes.push("accent-full"),g=s.height);var M=u;E||(M-=D/2),S.style.left=N(M),a.label==="\\textcircled"&&(S.style.top=".2em"),S=X({positionType:"firstBaseline",children:[{type:"elem",elem:s},{type:"kern",size:-g},{type:"elem",elem:S}]})}var R=C(["mord","accent"],[S],e);return n?(n.children[0]=R,n.height=Math.max(R.height,n.height),n.classes[0]="mord",n):R},Pi=(r,e)=>{var t=r.isStretchy?We(r.label):new I("mo",[z0(r.label,r.mode)]),a=new I("mover",[Z(r.base,e),t]);return a.setAttribute("accent","true"),a},Hi=new RegExp(["\\acute","\\grave","\\ddot","\\tilde","\\bar","\\breve","\\check","\\hat","\\vec","\\dot","\\mathring"].map(r=>"\\"+r).join("|"));L({type:"accent",names:["\\acute","\\grave","\\ddot","\\tilde","\\bar","\\breve","\\check","\\hat","\\vec","\\dot","\\mathring","\\widecheck","\\widehat","\\widetilde","\\overrightarrow","\\overleftarrow","\\Overrightarrow","\\overleftrightarrow","\\overgroup","\\overlinesegment","\\overleftharpoon","\\overrightharpoon"],numArgs:1,handler:(r,e)=>{var t=Ue(e[0]),a=!Hi.test(r.funcName),n=!a||r.funcName==="\\widehat"||r.funcName==="\\widetilde"||r.funcName==="\\widecheck";return{type:"accent",mode:r.parser.mode,label:r.funcName,isStretchy:a,isShifty:n,base:t}},htmlBuilder:Sa,mathmlBuilder:Pi});L({type:"accent",names:["\\'","\\`","\\^","\\~","\\=","\\u","\\.",'\\"',"\\c","\\r","\\H","\\v","\\textcircled"],numArgs:1,allowedInText:!0,allowedInMath:!0,argTypes:["primitive"],handler:(r,e)=>{var t=e[0],a=r.parser.mode;return a==="math"&&(r.parser.settings.reportNonstrict("mathVsTextAccents","LaTeX's accent "+r.funcName+" works only in text mode"),a="text"),{type:"accent",mode:a,label:r.funcName,isStretchy:!1,isShifty:!0,base:t}}});L({type:"accentUnder",names:["\\underleftarrow","\\underrightarrow","\\underleftrightarrow","\\undergroup","\\underlinesegment","\\utilde"],numArgs:1,handler:(r,e)=>{var{parser:t,funcName:a}=r,n=e[0];return{type:"accentUnder",mode:t.mode,label:a,base:n}},htmlBuilder:(r,e)=>{var t=V(r.base,e),a=Ye(r,e),n=r.label==="\\utilde"?.12:0,s=X({positionType:"top",positionData:t.height,children:[{type:"elem",elem:a,wrapperClasses:["svg-align"]},{type:"kern",size:n},{type:"elem",elem:t}]});return C(["mord","accentunder"],[s],e)},mathmlBuilder:(r,e)=>{var t=We(r.label),a=new I("munder",[Z(r.base,e),t]);return a.setAttribute("accentunder","true"),a}});var Be=r=>{var e=new I("mpadded",r?[r]:[]);return e.setAttribute("width","+0.6em"),e.setAttribute("lspace","0.3em"),e};L({type:"xArrow",names:["\\xleftarrow","\\xrightarrow","\\xLeftarrow","\\xRightarrow","\\xleftrightarrow","\\xLeftrightarrow","\\xhookleftarrow","\\xhookrightarrow","\\xmapsto","\\xrightharpoondown","\\xrightharpoonup","\\xleftharpoondown","\\xleLine truncated
|
||||
]`,ks="\\\\[a-zA-Z@]+",As="\\\\[^\uD800-\uDFFF]",Ts="("+ks+")"+Ua+"*",Es=`\\\\(
|
||||
|[ \r ]+
|
||||
?)[ \r ]*`,qt="[̀-ͯ]",Ms=new RegExp(qt+"+$"),zs="("+Ua+"+)|"+(Es+"|")+"([!-\\[\\]-‧-豈-]"+(qt+"*")+"|[\uD800-\uDBFF][\uDC00-\uDFFF]"+(qt+"*")+"|\\\\verb\\*([^]).*?\\4|\\\\verb([^*a-zA-Z]).*?\\5"+("|"+Ts)+("|"+As+")");class Jr{constructor(e,t){this.input=void 0,this.settings=void 0,this.tokenRegex=void 0,this.catcodes=void 0,this.input=e,this.settings=t,this.tokenRegex=new RegExp(zs,"g"),this.catcodes={"%":14,"~":13}}setCatcode(e,t){this.catcodes[e]=t}lex(){var e=this.input,t=this.tokenRegex.lastIndex;if(t===e.length)return new k0("EOF",new g0(this,t,t));var a=this.tokenRegex.exec(e);if(a===null||a.index!==t)throw new F("Unexpected character: '"+e[t]+"'",new k0(e[t],new g0(this,t,t+1)));var n=a[6]||a[3]||(a[2]?"\\ ":" ");if(this.catcodes[n]===14){var s=e.indexOf(`
|
||||
`,this.tokenRegex.lastIndex);return s===-1?(this.tokenRegex.lastIndex=e.length,this.settings.reportNonstrict("commentAtEnd","% comment has no terminating newline; LaTeX would fail because of commenting the end of math mode (e.g. $)")):this.tokenRegex.lastIndex=s+1,this.lex()}return new k0(n,new g0(this,t,this.tokenRegex.lastIndex))}}class Cs{constructor(e,t){e===void 0&&(e={}),t===void 0&&(t={}),this.current=void 0,this.builtins=void 0,this.undefStack=void 0,this.current=t,this.builtins=e,this.undefStack=[]}beginGroup(){this.undefStack.push({})}endGroup(){if(this.undefStack.length===0)throw new F("Unbalanced namespace destruction: attempt to pop global namespace; please report this as a bug");var e=this.undefStack.pop();for(var t in e)e.hasOwnProperty(t)&&(e[t]==null?delete this.current[t]:this.current[t]=e[t])}endGroups(){for(;this.undefStack.length>0;)this.endGroup()}has(e){return this.current.hasOwnProperty(e)||this.builtins.hasOwnProperty(e)}get(e){return this.current.hasOwnProperty(e)?this.current[e]:this.builtins[e]}set(e,t,a){if(a===void 0&&(a=!1),a){for(var n=0;n<this.undefStack.length;n++)delete this.undefStack[n][e];this.undefStack.length>0&&(this.undefStack[this.undefStack.length-1][e]=t)}else{var s=this.undefStack[this.undefStack.length-1];s&&!s.hasOwnProperty(e)&&(s[e]=this.current[e])}t==null?delete this.current[e]:this.current[e]=t}}var Rs=Na;d("\\noexpand",function(r){var e=r.popToken();return r.isExpandable(e.text)&&(e.noexpand=!0,e.treatAsRelax=!0),{tokens:[e],numArgs:0}});d("\\expandafter",function(r){var e=r.popToken();return r.expandOnce(!0),{tokens:[e],numArgs:0}});d("\\@firstoftwo",function(r){var e=r.consumeArgs(2);return{tokens:e[0],numArgs:0}});d("\\@secondoftwo",function(r){var e=r.consumeArgs(2);return{tokens:e[1],numArgs:0}});d("\\@ifnextchar",function(r){var e=r.consumeArgs(3);r.consumeSpaces();var t=r.future();return e[0].length===1&&e[0][0].text===t.text?{tokens:e[1],numArgs:0}:{tokens:e[2],numArgs:0}});d("\\@ifstar","\\@ifnextchar *{\\@firstoftwo{#1}}");d("\\TextOrMath",function(r){var e=r.consumeArgs(2);return r.mode==="text"?{tokens:e[0],numArgs:0}:{tokens:e[1],numArgs:0}});var Qr={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,a:10,A:10,b:11,B:11,c:12,C:12,d:13,D:13,e:14,E:14,f:15,F:15};d("\\char",function(r){var e=r.popToken(),t,a=0;if(e.text==="'")t=8,e=r.popToken();else if(e.text==='"')t=16,e=r.popToken();else if(e.text==="`")if(e=r.popToken(),e.text[0]==="\\")a=e.text.charCodeAt(1);else{if(e.text==="EOF")throw new F("\\char` missing argument");a=e.text.charCodeAt(0)}else t=10;if(t){if(a=Qr[e.text],a==null||a>=t)throw new F("Invalid base-"+t+" digit "+e.text);for(var n;(n=Qr[r.future().text])!=null&&n<t;)a*=t,a+=n,r.popToken()}return"\\@char{"+a+"}"});var Zt=(r,e,t,a)=>{var n=r.consumeArg().tokens;if(n.length!==1)throw new F("\\newcommand's first argument must be a macro name");var s=n[0].text,o=r.isDefined(s);if(o&&!e)throw new F("\\newcommand{"+s+"} attempting to redefine "+(s+"; use \\renewcommand"));if(!o&&!t)throw new F("\\renewcommand{"+s+"} when command "+s+" does not yet exist; use \\newcommand");var u=0;if(n=r.consumeArg().tokens,n.length===1&&n[0].text==="["){for(var h="",m=r.expandNextToken();m.text!=="]"&&m.text!=="EOF";)h+=m.text,m=r.expandNextToken();if(!h.match(/^\s*[0-9]+\s*$/))throw new F("Invalid number of arguments: "+h);u=parseInt(h),n=r.consumeArg().tokens}return o&&a||r.macros.set(s,{tokens:n,numArgs:u}),""};d("\\newcommand",r=>Zt(r,!1,!0,!1));d("\\renewcommand",r=>Zt(r,!0,!1,!1));d("\\providecommand",r=>Zt(r,!0,!0,!0));d("\\message",r=>{var e=r.consumeArgs(1)[0];return console.log(e.reverse().map(t=>t.text).join("")),""});d("\\errmessage",r=>{var e=r.consumeArgs(1)[0];return console.error(e.reverse().map(t=>t.text).join("")),""});d("\\show",r=>{var e=r.popToken(),t=e.text;return console.log(e,r.macros.get(t),Z0[t],K.math[t],K.text[t]),""});d("\\bgroup","{");d("\\egroup","}");d("~","\\nobreakspace");d("\\lq","`");d("\\rq","'");d("\\aa","\\r a");d("\\AA","\\r A");d("\\textcopyright","\\html@mathml{\\textcircled{c}}{\\char`©}");d("\\copyright","\\TextOrMath{\\textcopyright}{\\text{\\textcopyright}}");d("\\textregistered","\\html@mathml{\\textcircled{\\scriptsize R}}{\\char`®}");d("ℬ","\\mathscr{B}");d("ℰ","\\mathscr{E}");d("ℱ","\\mathscr{F}");d("ℋ","\\mathscr{H}");d("ℐ","\\mathscr{I}");d("ℒ","\\mathscr{L}");d("ℳ","\\mathscr{M}");d("ℛ","\\mathscr{R}");d("ℭ","\\mathfrak{C}");d("ℌ","\\mathfrak{H}");d("ℨ","\\mathfrak{Z}");d("\\Bbbk","\\Bbb{k}");d("\\llap","\\mathllap{\\textrm{#1}}");d("\\rlap","\\mathrlap{\\textrm{#1}}");d("\\clap","\\mathclap{\\textrm{#1}}");d("\\mathstrut","\\vphantom{(}");d("\\underbar","\\underline{\\text{#1}}");d("\\not",'\\html@mathml{\\mathrel{\\mathrlap\\@not}\\nobreak}{\\char"338}');d("\\neq","\\html@mathml{\\mathrel{\\not=}}{\\mathrel{\\char`≠}}");d("\\ne","\\neq");d("≠","\\neq");d("\\notin","\\html@mathml{\\mathrel{{\\in}\\mathllap{/\\mskip1mu}}}{\\mathrel{\\char`∉}}");d("∉","\\notin");d("≘","\\htmLine truncated
|
||||
please report what input caused this bug`);return a=a.slice(1,-1),{type:"verb",mode:"text",body:a,star:n}}ra.hasOwnProperty(t[0])&&!K[this.mode][t[0]]&&(this.settings.strict&&this.mode==="math"&&this.settings.reportNonstrict("unicodeTextInMathMode",'Accented Unicode text character "'+t[0]+'" used in math mode',e),t=ra[t[0]]+t.slice(1));var s=Ms.exec(t);s&&(t=t.substring(0,s.index),t==="i"?t="ı":t==="j"&&(t="ȷ"));var o;if(K[this.mode][t]){this.settings.strict&&this.mode==="math"&&At.includes(t)&&this.settings.reportNonstrict("unicodeTextInMathMode",'Latin-1/Unicode text character "'+t[0]+'" used in math mode',e);var u=K[this.mode][t].group,h=g0.range(e),m;qi(u)?m={type:"atom",mode:this.mode,family:u,loc:h,text:t}:m={type:u,mode:this.mode,loc:h,text:t},o=m}else if(t.charCodeAt(0)>=128)this.settings.strict&&(ia(t.charCodeAt(0))?this.mode==="math"&&this.settings.reportNonstrict("unicodeTextInMathMode",'Unicode text character "'+t[0]+'" used in math mode',e):this.settings.reportNonstrict("unknownSymbol",'Unrecognized Unicode character "'+t[0]+'"'+(" ("+t.charCodeAt(0)+")"),e)),o={type:"textord",mode:"text",loc:g0.range(e),text:t};else return null;if(this.consume(),s)for(var p=0;p<s[0].length;p++){var g=s[0][p];if(!yt[g])throw new F("Unknown accent ' "+g+"'",e);var S=yt[g][this.mode]||yt[g].text;if(!S)throw new F("Accent "+g+" unsupported in "+this.mode+" mode",e);o={type:"accent",mode:this.mode,loc:g0.range(e),label:S,isStretchy:!1,isShifty:!0,base:o}}return o}}tt.endOfExpression=new Set(["}","\\endgroup","\\end","\\right","&"]);var Jt=function(e,t){if(!(typeof e=="string"||e instanceof String))throw new TypeError("KaTeX can only parse string typed expression");var a=new tt(e,t);delete a.gullet.macros.current["\\df@tag"];var n=a.parse();if(delete a.gullet.macros.current["\\current@color"],delete a.gullet.macros.current["\\color"],a.gullet.macros.get("\\df@tag")){if(!t.displayMode)throw new F("\\tag works only in display equations");n=[{type:"tag",mode:"text",body:n,tag:a.subparse([new k0("\\df@tag")])}]}return n},Wa=function(e,t,a){t.textContent="";var n=Qt(e,a).toNode();t.appendChild(n)};typeof document<"u"&&document.compatMode!=="CSS1Compat"&&(typeof console<"u"&&console.warn("Warning: KaTeX doesn't work in quirks mode. Make sure your website has a suitable doctype."),Wa=function(){throw new F("KaTeX doesn't work in quirks mode.")});var Ds=function(e,t){var a=Qt(e,t).toMarkup();return a},Ns=function(e,t){var a=new Pt(t);return Jt(e,a)},Ya=function(e,t,a){if(a.throwOnError||!(e instanceof F))throw e;var n=C(["katex-error"],[new A0(t)]);return n.setAttribute("title",e.toString()),n.setAttribute("style","color:"+a.errorColor),n},Qt=function(e,t){var a=new Pt(t);try{var n=Jt(e,a);return Ri(n,e,a)}catch(s){return Ya(s,e,a)}},Bs=function(e,t){var a=new Pt(t);try{var n=Jt(e,a);return Fi(n,e,a)}catch(s){return Ya(s,e,a)}},Os="0.17.0",Ls={Span:ve,Anchor:je,SymbolNode:A0,SvgNode:$0,PathNode:J0,LineNode:kt},aa={version:Os,render:Wa,renderToString:Ds,ParseError:F,SETTINGS_SCHEMA:xt,__parse:Ns,__renderToDomTree:Qt,__renderToHTMLTree:Bs,__setFontMetrics:hi,__defineSymbol:i,__defineFunction:L,__defineMacro:d,__domTree:Ls};const qs=512;class Ps{constructor(){nr(this,"map",new Map)}get(e){const t=this.map.get(e);if(t!==void 0)return this.map.delete(e),this.map.set(e,t),t}set(e,t){if(this.map.has(e))this.map.delete(e);else if(this.map.size>=qs){const a=this.map.keys().next().value;a!==void 0&&this.map.delete(a)}this.map.set(e,t)}get size(){return this.map.size}}const qe=new Ps;function Hs(r,e){return`d\0${e}`}function $s(r,e,t={}){const a=Hs(e,r),n=qe.get(a);if(n!==void 0)return n;const{errorColor:s="var(--semi-color-text-2)",macros:o}=t;let u;try{return u=aa.renderToString(r,{displayMode:e,throwOnError:!0,macros:o,trust:sr}),qe.set(a,u),u}catch{}try{return u=aa.renderToString(r,{displayMode:e,throwOnError:!1,strict:"ignore",errorColor:s,macros:o,trust:sr}),qe.set(a,u),u}catch{}return u=`<span class="katex-error" style="color:${s}" title="KaTeX parse error">${_s(r)}</span>`,qe.set(a,u),u}function _s(r){return r.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""")}const Gs=a0.memo(function({expr:e}){const t=$s(e,!0);return U.jsx("div",{"data-slot":"math-display",dangerouslySetInnerHTML:{__html:t}})}),na=200,Us=a0.memo(function({text:e}){const t=a0.useMemo(()=>{const a=e.split(`
|
||||
`),n=[];for(let s=0;s<a.length;s+=na)n.push(a.slice(s,s+na).join(`
|
||||
`));return n},[e]);return U.jsx("div",{"data-slot":"huge-text-fallback",children:t.map((a,n)=>U.jsx("pre",{style:{contentVisibility:"auto",containIntrinsicSize:"0 400px",margin:0,whiteSpace:"pre-wrap",wordBreak:"break-word",fontFamily:"var(--font-mono, monospace)",fontSize:"var(--font-size-code, 13px)",lineHeight:1.5},children:a},n))})}),js=500,Xs=30,Vs=33,Ws=5e3;function Ys(r,e){const[t,a]=a0.useState(r),n=a0.useRef(r),s=a0.useRef(0),o=a0.useRef(null),u=a0.useRef(r);return u.current=r,a0.useEffect(()=>{if(!e){o.current!==null&&(cancelAnimationFrame(o.current),o.current=null),n.current=r,a(r);return}if(!r.startsWith(n.current)){n.current=r,a(r);return}if(r.length-n.current.length>Ws){n.current=r,a(r);return}function h(){o.current=null;const m=performance.now();if(m-s.current<Vs){o.current=requestAnimationFrame(h);return}const p=u.current,g=p.length-n.current.length;if(g<=0)return;const S=Math.max(1,Math.ceil(js/16.67)),x=Math.min(Xs,Math.ceil(g/S));n.current=p.slice(0,n.current.length+x),a(n.current),s.current=m,n.current.length<p.length&&(o.current=requestAnimationFrame(h))}return n.current.length<r.length&&o.current===null&&(o.current=requestAnimationFrame(h)),()=>{o.current!==null&&(cancelAnimationFrame(o.current),o.current=null)}},[r,e]),e?t:r}const Zs={macros:{"\\vline":"\\vert","\\R":"\\mathbb{R}","\\N":"\\mathbb{N}","\\Z":"\\mathbb{Z}","\\Q":"\\mathbb{Q}","\\C":"\\mathbb{C}","\\norm":"\\left\\lVert #1 \\right\\rVert","\\abs":"\\left\\lvert #1 \\right\\rvert"},...pn,errorColor:"var(--semi-color-text-2)"},Ks=15e4;function Js(r){return{...dn,pre({children:e}){return U.jsx(U.Fragment,{children:e})},code({className:e,children:t}){const a=/language-(\w+)/.exec(e||""),n=String(t).replace(/\n$/,"");return a?a[1]==="math"?U.jsx(Gs,{expr:n}):a[1]==="diff"?U.jsx(Rn,{code:n}):U.jsx(br,{language:a[1],code:n,isStreaming:r}):n.includes(`
|
||||
`)?U.jsx(br,{code:n,isStreaming:r}):U.jsx("code",{className:e,children:t})},table({children:e}){return U.jsx("div",{"data-slot":"md-table-wrap",children:U.jsx("table",{children:e})})}}}const i1=a0.memo(function({content:e,isStreaming:t=!1}){const a=a0.useMemo(()=>Js(t),[t]),n=Ys(e,t),s=a0.useDeferredValue(n);return s.length>Ks?U.jsx("div",{"data-slot":"aui_markdown-part",children:U.jsx(Us,{text:s})}):U.jsx("div",{"data-slot":"aui_markdown-part",children:U.jsx(ln,{remarkPlugins:[un,cn],rehypePlugins:[[on,Zs]],components:a,urlTransform:mn,children:hn(s)})})});export{i1 as MarkdownPart};
|
||||
@@ -0,0 +1 @@
|
||||
[data-slot=code-card]{position:relative;margin:.5rem 0;border-radius:.375rem;border:1px solid var(--semi-color-border);background:var(--semi-color-fill-0);overflow:hidden}[data-slot=code-card-header]{display:flex;align-items:center;justify-content:space-between;padding:.25rem .5rem;border-bottom:1px solid var(--semi-color-border);background:color-mix(in srgb,var(--semi-color-fill-0) 60%,var(--semi-color-bg-0));min-height:1.5rem}[data-slot=code-card-lang]{font-size:.6875rem;font-family:SF Mono,Cascadia Code,Fira Code,monospace;color:var(--semi-color-text-2);text-transform:lowercase}[data-slot=code-card-copy]{display:flex;align-items:center;justify-content:center;width:1.5rem;height:1.5rem;border:none;border-radius:.25rem;background:transparent;color:var(--semi-color-text-2);cursor:pointer;opacity:.55;transition:opacity .12s,background .12s}[data-slot=code-card-copy]:hover{opacity:1;background:var(--semi-color-fill-1)}[data-slot=code-card-body]{position:relative;padding:.625rem .75rem;overflow-x:auto;overflow-y:auto;max-height:7.5rem;font-family:SF Mono,Cascadia Code,Fira Code,monospace;font-size:.7rem;line-height:1.6;color:var(--semi-color-text-0);white-space:pre;-moz-tab-size:2;tab-size:2}[data-slot=code-card-body][data-expanded]{max-height:40dvh}[data-slot=code-card-expand]{position:absolute;inset-inline:0;bottom:0;display:flex;height:1.75rem;cursor:pointer;align-items:flex-end;justify-content:center;padding-bottom:.25rem;border:none;background:linear-gradient(to top,var(--semi-color-fill-0),transparent);color:var(--ui-text-tertiary);transition:color .12s ease-out}[data-slot=code-card-expand]:hover{color:var(--foreground)}[data-slot=code-card-expand] svg{width:.875rem;height:.875rem;transition:transform .15s ease-out}[data-slot=code-card-body][data-expanded]+[data-slot=code-card-expand]{background:none}[data-slot=code-card-body][data-expanded]+[data-slot=code-card-expand] svg{transform:rotate(180deg)}[data-slot=code-card-body] code{font-family:inherit;font-size:inherit;background:none!important;padding:0;display:block}[data-slot=code-card][data-streaming]{animation:code-card-glow 1.8s ease-in-out infinite alternate;border-color:color-mix(in srgb,var(--semi-color-primary) 24%,var(--semi-color-border))}[data-slot=code-card][data-streaming] [data-slot=code-card-body]{mask-image:linear-gradient(to bottom,#000,#000 calc(100% - 1.5rem),#00000080);-webkit-mask-image:linear-gradient(to bottom,black 0%,black calc(100% - 1.5rem),rgba(0,0,0,.5) 100%)}@keyframes code-card-glow{0%{box-shadow:0 0 0 .5px color-mix(in srgb,var(--semi-color-primary) 10%,transparent)}to{box-shadow:0 0 0 .5px color-mix(in srgb,var(--semi-color-primary) 10%,transparent),0 .5rem 1.5rem color-mix(in srgb,var(--semi-color-primary) 6%,transparent)}}:root{--code-keyword: #d73a49;--code-string: #032f62;--code-comment: #6a737d;--code-function: #6f42c1;--code-number: #005cc5;--code-operator: #d73a49;--code-class-name: #6f42c1;--code-punctuation: #24292e;--code-property: #005cc5;--code-builtin: #e36209;--code-attr-name: #6f42c1;--code-attr-value: #032f62;--code-tag: #22863a;--code-selector: #22863a;--code-inserted: #22863a;--code-deleted: #d73a49}[data-appearance=dark]{--code-keyword: #ff7b72;--code-string: #a5d6ff;--code-comment: #8b949e;--code-function: #d2a8ff;--code-number: #79c0ff;--code-operator: #ff7b72;--code-class-name: #f0c674;--code-punctuation: #c9d1d9;--code-property: #79c0ff;--code-builtin: #ffa657;--code-attr-name: #d2a8ff;--code-attr-value: #a5d6ff;--code-tag: #7ee787;--code-selector: #7ee787;--code-inserted: #7ee787;--code-deleted: #ff7b72}.token.keyword,.token.control,.token.directive,.token.important{color:var(--code-keyword)}.token.string,.token.template-string,.token.url{color:var(--code-string)}.token.comment,.token.prolog,.token.doctype,.token.cdata{color:var(--code-comment);font-style:italic}.token.function{color:var(--code-function)}.token.number,.token.boolean{color:var(--code-number)}.token.operator,.token.entity{color:var(--code-operator)}.token.class-name,.token.maybe-class-name{color:var(--code-class-name)}.token.punctuation{color:var(--code-punctuation)}.token.property,.token.constant,.token.variable{color:var(--code-property)}.token.builtin,.token.symbol{color:var(--code-builtin)}.token.attr-name{color:var(--code-attr-name)}.token.attr-value{color:var(--code-attr-value)}.token.tag{color:var(--code-tag)}.token.selector{color:var(--code-selector)}.token.inserted{color:var(--code-inserted)}.token.deleted{color:var(--code-deleted);text-decoration:line-through}.token.italic{font-style:italic}.token.bold{font-weight:700}[data-slot=diff-block]{margin:.5rem 0;border-radius:.375rem;border:1px solid var(--semi-color-border);overflow-x:auto;overscroll-behavior-x:contain;font-family:SF Mono,Cascadia Code,Fira Code,monospace;font-size:var(--font-size-code, 13px);line-height:1.375rem}[data-slot=diff-line]{display:flex;padding:0 .5rem;min-height:1.375rem;line-height:1.375rem;border-left:2px solid transparent}[data-diff-kind=add]{backLine truncated
|
||||
@@ -0,0 +1 @@
|
||||
.semi-input-textarea-wrapper{box-sizing:border-box;display:inline-block;position:relative;width:100%;border:1px transparent solid;border-radius:var(--semi-border-radius-small);vertical-align:bottom;background-color:var(--semi-color-fill-0);transition:background-color var(--semi-transition_duration-none) var(--semi-transition_function-easeIn) var(--semi-transition_delay-none),border var(--semi-transition_duration-none) var(--semi-transition_function-easeIn) var(--semi-transition_delay-none)}.semi-input-textarea-wrapper-resizeX{display:inline-block;width:fit-content;max-width:100%}.semi-input-textarea-wrapper:hover{background-color:var(--semi-color-fill-1)}.semi-input-textarea-wrapper-focus{background-color:var(--semi-color-fill-0);border:1px var(--semi-color-focus-border) solid}.semi-input-textarea-wrapper-focus:hover,.semi-input-textarea-wrapper-focus:active{background-color:var(--semi-color-fill-0)}.semi-input-textarea-wrapper:active{background-color:var(--semi-color-fill-2)}.semi-input-textarea-wrapper .semi-input-clearbtn{position:absolute;top:0;min-width:24px;color:var(--semi-color-text-2);right:4px;height:32px;display:flex;align-items:center;justify-content:center}.semi-input-textarea-wrapper .semi-input-clearbtn>svg{pointer-events:none}.semi-input-textarea-wrapper .semi-input-clearbtn:hover{cursor:pointer}.semi-input-textarea-wrapper .semi-input-clearbtn:hover .semi-icon{color:var(--semi-color-primary-hover)}.semi-input-textarea-wrapper .semi-input-clearbtn-hidden{visibility:hidden}.semi-input-textarea-wrapper-disabled,.semi-input-textarea-wrapper-readonly{cursor:not-allowed;color:var(--semi-color-disabled-text);background-color:var(--semi-color-disabled-fill)}.semi-input-textarea-wrapper-disabled:hover,.semi-input-textarea-wrapper-readonly:hover{background-color:var(--semi-color-disabled-fill)}.semi-input-textarea-wrapper-disabled::placeholder,.semi-input-textarea-wrapper-readonly::placeholder{color:var(--semi-color-disabled-text)}.semi-input-textarea-wrapper-readonly{cursor:text}.semi-input-textarea-wrapper-error{background-color:var(--semi-color-danger-light-default);border-color:var(--semi-color-danger-light-default)}.semi-input-textarea-wrapper-error:hover{background-color:var(--semi-color-danger-light-hover);border-color:var(--semi-color-danger-light-hover)}.semi-input-textarea-wrapper-error.semi-input-textarea-wrapper-focus{background-color:var(--semi-color-danger-light-default);border-color:var(--semi-color-danger)}.semi-input-textarea-wrapper-error:active{background-color:var(--semi-color-danger-light-active);border-color:var(--semi-color-danger)}.semi-input-textarea-wrapper-warning{background-color:var(--semi-color-warning-light-default);border-color:var(--semi-color-warning-light-default)}.semi-input-textarea-wrapper-warning:hover{background-color:var(--semi-color-warning-light-hover);border-color:var(--semi-color-warning-light-hover)}.semi-input-textarea-wrapper-warning.semi-input-textarea-wrapper-focus{background-color:var(--semi-color-warning-light-default);border-color:var(--semi-color-warning)}.semi-input-textarea-wrapper-warning:active{background-color:var(--semi-color-warning-light-active);border-color:var(--semi-color-warning)}.semi-input-textarea{position:relative;resize:none;padding:5px 12px;box-shadow:none;font-size:14px;line-height:20px;font-family:Inter,-apple-system,BlinkMacSystemFont,PingFang SC,Hiragino Sans GB,Microsoft YaHei,Segoe UI,Helvetica Neue,Helvetica,Arial,sans-serif;background-color:transparent;border:0 solid transparent;vertical-align:bottom;width:100%;outline:none;cursor:text;box-sizing:border-box;color:var(--semi-color-text-0)}.semi-input-textarea:hover{border-color:transparent}.semi-input-textarea::placeholder{color:var(--semi-color-text-2)}.semi-input-textarea-showClear{padding-right:36px}.semi-input-textarea-disabled,.semi-input-textarea-readonly{cursor:not-allowed;color:var(--semi-color-disabled-text);background-color:transparent}.semi-input-textarea-disabled:hover,.semi-input-textarea-readonly:hover{background-color:transparent}.semi-input-textarea-disabled::placeholder,.semi-input-textarea-readonly::placeholder{color:var(--semi-color-disabled-text)}.semi-input-textarea-readonly{cursor:text}.semi-input-textarea-autosize{overflow:hidden;resize:none}.semi-input-textarea-counter{font-size:12px;line-height:16px;font-family:Inter,-apple-system,BlinkMacSystemFont,PingFang SC,Hiragino Sans GB,Microsoft YaHei,Segoe UI,Helvetica Neue,Helvetica,Arial,sans-serif;display:flex;flex-direction:column;justify-content:center;padding:3px 12px 5px;min-height:24px;text-align:right;color:var(--semi-color-text-2)}.semi-input-textarea-counter-exceed{color:var(--semi-color-danger)}.semi-input-textarea-borderless:not(:focus-within):not(:hover){background-color:transparent;border-color:transparent}.semi-input-textarea-borderless:focus-within:not(:active){background-color:transparent}.semi-input-textarea-borderless.semi-input-textarea-wrapper-error:not(:focus-within){border-color:vLine truncated
|
||||
@@ -0,0 +1,4 @@
|
||||
import{c as se,b as u,ax as Le,f as Ee,h as S,_ as K,i as oe,R as v,k as Te,ay as re,l as D,n as le,V as Oe,az as X,P as f,aj as i,ab as Me}from"./tauri-compat-tfiFK9EG.js";import{T as He,a as Ve,b as ce}from"./index-DwVcZP0M.js";import{_ as he,t as Fe,c as Pe,I as Ie,a as $e,u as Be,b as q,d as z,M as fe,e as xe,i as be,f as Y,E as ye,T as ee,g as Ae,h as de}from"./main-Knf6L_en.js";import{B as _,c as Q,I as Ke}from"./index-Bpi3BHKj.js";import{S as G}from"./index-D_sWIqse.js";import{I as ve}from"./IconFile-CgfQSwGI.js";import"./WindowsTitlebar-CrkUa1UM.js";function We(s){return u.createElement("svg",Object.assign({viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",focusable:!1,"aria-hidden":!0},s),u.createElement("path",{d:"M5 2.9a1 1 0 0 1 1.57-.82l13.23 9.1a1 1 0 0 1 0 1.64l-13.23 9.1A1 1 0 0 1 5 21.1V2.9Z",fill:"currentColor"}))}const we=se(We,"play");function Ue(s){return u.createElement("svg",Object.assign({viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",focusable:!1,"aria-hidden":!0},s),u.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M8 5.07c-.8.47-1.8.46-2.6 0l-.24-.15a1.4 1.4 0 0 0-1.82.29c-.64.82-1.16 1.73-1.55 2.7a1.4 1.4 0 0 0 .66 1.71l.24.14a2.57 2.57 0 0 1 0 4.48l-.24.14a1.4 1.4 0 0 0-.66 1.72 11.1 11.1 0 0 0 1.55 2.69 1.4 1.4 0 0 0 1.82.3l.25-.15a2.57 2.57 0 0 1 3.88 2.24v.28c-.01.7.46 1.33 1.16 1.43a11 11 0 0 0 3.1 0 1.4 1.4 0 0 0 1.17-1.43v-.28a2.57 2.57 0 0 1 3.87-2.24l.25.14c.6.36 1.38.26 1.82-.29.64-.82 1.16-1.73 1.55-2.7a1.4 1.4 0 0 0-.66-1.71l-.24-.14a2.57 2.57 0 0 1 0-4.48l.24-.14a1.4 1.4 0 0 0 .66-1.72 11.08 11.08 0 0 0-1.55-2.69 1.4 1.4 0 0 0-1.82-.3l-.25.15a2.57 2.57 0 0 1-3.88-2.24v-.28c.01-.7-.46-1.33-1.16-1.43a10.99 10.99 0 0 0-3.1 0c-.7.1-1.17.72-1.17 1.43v.28C9.3 3.75 8.8 4.61 8 5.07Zm6 10.4a4 4 0 1 0-4-6.93 4 4 0 0 0 4 6.92Z",fill:"currentColor"}))}const De=se(Ue,"setting");function qe(s){return u.createElement("svg",Object.assign({viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",focusable:!1,"aria-hidden":!0},s),u.createElement("path",{d:"M3 6a3 3 0 0 1 3-3h12a3 3 0 0 1 3 3v12a3 3 0 0 1-3 3H6a3 3 0 0 1-3-3V6Z",fill:"currentColor"}))}const Se=se(qe,"stop");let R=null;const ue={"min-height":"0","max-height":"none",height:"0",visibility:"hidden",overflow:"hidden",position:"absolute","z-index":"-1000",top:"0",right:"0"},ge=s=>{Object.keys(ue).forEach(e=>{s.style.setProperty(e,ue[e],"important")})},pe=(s,e)=>{const t=s.scrollHeight;return e.sizingStyle.boxSizing==="border-box"?t+e.borderSize:t-e.paddingSize};function Ze(s,e){let t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:1/0;R||(R=document.createElement("textarea"),R.setAttribute("tab-index","-1"),R.setAttribute("aria-hidden","true"),ge(R)),R.parentNode===null&&document.body.appendChild(R);const{paddingSize:a,borderSize:o,sizingStyle:r}=s,{boxSizing:l}=r;Object.keys(r).forEach(x=>{R.style[x]=r[x]}),ge(R),R.value=e;let c=pe(R,s);R.value="x";const g=pe(R,s)-a-o;let m=g*t;l==="border-box"&&(m=m+a+o),c=Math.max(m,c);let w=g*n;return l==="border-box"&&(w=w+a+o),c=Math.min(w,c),c}const Xe=["borderBottomWidth","borderLeftWidth","borderRightWidth","borderTopWidth","boxSizing","fontFamily","fontSize","fontStyle","fontWeight","letterSpacing","lineHeight","paddingBottom","paddingLeft","paddingRight","paddingTop","tabSize","textIndent","textRendering","textTransform","width"],Ye=s=>{const e=window.getComputedStyle(s);if(e===null)return null;const t=Le(e,Xe),{boxSizing:n}=t;if(n==="")return null;const a=parseFloat(t.paddingBottom)+parseFloat(t.paddingTop),o=parseFloat(t.borderBottomWidth)+parseFloat(t.borderTopWidth);return{sizingStyle:t,paddingSize:a,borderSize:o}};class ne extends Ee{static get textAreaDefaultAdapter(){return{notifyChange:S,setValue:S,toggleFocusing:S,toggleHovering:S,notifyFocus:S,notifyBlur:S,notifyKeyDown:S,notifyEnterPress:S}}constructor(e){super(Object.assign(Object.assign({},ne.textAreaDefaultAdapter),e)),this.compositionEnter=!1,this._changeValue=(t,n)=>{this._isControlledComponent()?this._adapter.notifyChange(t,n):(this._adapter.setValue(t),this._adapter.notifyChange(t,n))},this.getNextValue=t=>{const{maxLength:n,minLength:a,getValueLength:o}=this._adapter.getProps();return K(o)?n?this.handleVisibleMaxLength(t):(a&&this.handleVisibleMinLength(t),t):t},this.handleCompositionStart=t=>{this.compositionEnter=!0,this._adapter.notifyCompositionStart(t)},this.handleCompositionEnd=t=>{const{composition:n}=this._adapter.getProps(),a=t.target.value;if(this.compositionEnter=!1,this._adapter.notifyCompositionEnd(t),n){const c=this.getNextValue(a);this._changeValue(c,t);return}const{getValueLength:o,maxLength:r,minLength:l}=this.getProps();if(K(o)){if(r){const c=this.handleVisibleMaxLength(a);c!==a&&this._changeValue(c,t)}l&&this.handleVisibleMinLength(a)}},this.handleCompositionUpdate=t=>{this._adapter.notifyCompLine truncated
|
||||
`):[""],m=D(`${y}-textarea-lineNumber`,n),w=c?this.getTextareaLineHeightPx(c):21,x=Object.assign(Object.assign({},a||{}),{height:l?`${l}px`:void 0,maxHeight:l?`${l}px`:void 0});return v.createElement("div",{ref:this.lineNumberRef,className:m,style:x},g.map((E,C)=>{const k=c?this.calculateWrappedLines(E,c):1;return v.createElement("div",{key:C,className:`${y}-textarea-lineNumber-item`,style:{minHeight:`${k*w}px`,lineHeight:`${w}px`}},t+C)}))}render(){const e=this.props,{autosize:t,placeholder:n,onEnterPress:a,onResize:o,resize:r,disabled:l,readonly:c,className:g,showCounter:m,validateStatus:w,maxCount:x,defaultValue:E,style:C,textareaStyle:k,forwardRef:T,getValueLength:H,maxLength:p,minLength:N,showClear:O,borderless:L,autoFocus:I,showLineNumber:h,lineNumberStart:d,lineNumberClassName:b,lineNumberStyle:M,composition:U}=e,$=Qe(e,["autosize","placeholder","onEnterPress","onResize","resize","disabled","readonly","className","showCounter","validateStatus","maxCount","defaultValue","style","textareaStyle","forwardRef","getValueLength","maxLength","minLength","showClear","borderless","autoFocus","showLineNumber","lineNumberStart","lineNumberClassName","lineNumberStyle","composition"]),{isFocus:Z,value:B,minLength:F}=this.state,A=!le(r),je=!t&&A&&["horizontal","both","inline"].includes(r),Re=!t&&A&&["vertical","both","block"].includes(r),_e=D(g,`${y}-textarea-wrapper`,{[`${y}-textarea-borderless`]:L,[`${y}-textarea-wrapper-disabled`]:l,[`${y}-textarea-wrapper-readonly`]:c,[`${y}-textarea-wrapper-${w}`]:!!w,[`${y}-textarea-wrapper-focus`]:Z,[`${y}-textarea-wrapper-withLineNumber`]:h,[`${y}-textarea-wrapper-resizeX`]:je,[`${y}-textarea-wrapper-resizeY`]:Re}),ke=D(`${y}-textarea`,{[`${y}-textarea-disabled`]:l,[`${y}-textarea-readonly`]:c,[`${y}-textarea-autosize`]:$e(t)?le(t==null?void 0:t.maxRows):t,[`${y}-textarea-showClear`]:O}),J=Object.assign({},k||{});t?J.resize="none":A&&(J.resize=r);const ie=!t&&A&&r&&r!=="none",V=Object.assign(Object.assign({},Oe($,"insetLabel","insetLabelId","getValueLength","onClear","showClear","disabledEnterStartNewLine","composition")),{style:J,autoFocus:I||this.props.autofocus,className:ke,disabled:l,readOnly:c,placeholder:n||null,onChange:j=>this.foundation.handleChange(j.target.value,j),onFocus:j=>this.foundation.handleFocus(j),onBlur:j=>this.foundation.handleBlur(j.nativeEvent),onKeyDown:j=>this.foundation.handleKeyDown(j),onScroll:this.handleTextAreaScroll,value:B??"",onCompositionStart:this.foundation.handleCompositionStart,onCompositionEnd:this.foundation.handleCompositionEnd,onCompositionUpdate:this.foundation.handleCompositionUpdate});return K(H)||(V.maxLength=p),F&&(V.minLength=F),v.createElement("div",{className:_e,style:C,onMouseEnter:j=>this.foundation.handleMouseEnter(j),onMouseLeave:j=>this.foundation.handleMouseLeave(j),onClick:j=>this.handleClick(j)},this.renderLineNumbers(),h?v.createElement("div",{className:`${y}-textarea-content`},t?v.createElement(X,{onResize:this.throttledResizeTextarea},v.createElement("textarea",Object.assign({},V,{ref:this.setRef}))):ie?v.createElement(X,{onResize:this.throttledNotifyNativeResize},v.createElement("textarea",Object.assign({},V,{ref:this.setRef}))):v.createElement("textarea",Object.assign({},V,{ref:this.setRef}))):t?v.createElement(X,{onResize:this.throttledResizeTextarea},v.createElement("textarea",Object.assign({},V,{ref:this.setRef}))):ie?v.createElement(X,{onResize:this.throttledNotifyNativeResize},v.createElement("textarea",Object.assign({},V,{ref:this.setRef}))):v.createElement("textarea",Object.assign({},V,{ref:this.setRef})),this.renderClearBtn(),this.renderCounter())}}ae.propTypes={autosize:f.oneOfType([f.bool,f.object]),borderless:f.bool,placeholder:f.string,value:f.string,rows:f.number,cols:f.number,maxCount:f.number,onEnterPress:f.func,validateStatus:f.string,className:f.string,style:f.object,textareaStyle:f.object,showClear:f.bool,onClear:f.func,onResize:f.func,onCompositionStart:f.func,onCompositionEnd:f.func,onCompositionUpdate:f.func,getValueLength:f.func,disabledEnterStartNewLine:f.bool,composition:f.bool,showLineNumber:f.bool,lineNumberStart:f.number,lineNumberClassName:f.string,lineNumberStyle:f.object,resize:f.oneOf(["none","both","horizontal","vertical","block","inline"])};ae.defaultProps={autosize:!1,borderless:!1,rows:4,cols:20,showCounter:!1,showClear:!1,onEnterPress:S,onChange:S,onBlur:S,onFocus:S,onKeyDown:S,onResize:S,onClear:S,onCompositionStart:S,onCompositionEnd:S,onCompositionUpdate:S,composition:!1,showLineNumber:!1,lineNumberStart:1};const Ge=v.forwardRef((s,e)=>v.createElement(ae,Object.assign({},s,{forwardRef:e})));function Je({lines:s,emptyLabel:e="No logs",className:t}){const n=u.useRef(null),a=u.useRef(!0),[o,r]=u.useState(!1);u.useEffect(()=>{const g=n.current;g&&a.current&&(g.scrollTop=g.scrollHeight)},[s]);const l=u.useCallback(g=>{const m=g.currentTarget;a.current=m.scrollHeight-m.scrollTop-m.clientHeight<24},[]),c=u.useCallback(()=>{s!=null&&s.length&&navigator.clipboard.writeText(s.join(
Line truncated
|
||||
`)).then(()=>{r(!0),setTimeout(()=>r(!1),1500)})},[s]);return i.jsxs("div",{className:`ga-log-tail ${t??""}`,children:[i.jsx("button",{type:"button",className:`ga-log-tail-copy ${o?"copied":""}`,onClick:c,title:"Copy",children:o?"✓":"⎘"}),i.jsx("div",{ref:n,className:"ga-log-tail-scroll",onScroll:l,children:s===null?i.jsx("p",{className:"ga-log-tail-empty",children:"…"}):s.length===0?i.jsx("p",{className:"ga-log-tail-empty",children:e}):i.jsx("pre",{className:"ga-log-tail-pre",children:s.map((g,m)=>i.jsxs("span",{className:g.startsWith("=====")?"ga-log-separator":void 0,children:[g,`
|
||||
`]},m))})})]})}function Ce(s,e){Be.getState().notify({kind:e,message:s})}function W(s){Ce(s,"error")}function P(s){Ce(s,"success")}const et=3e3;function ze({serviceId:s,onClose:e}){const{t}=q(),n=z(c=>c.fetchLogs),[a,o]=u.useState(null),r=u.useRef(null),l=u.useCallback(async()=>{if(!s)return;const c=await n(s);o(c)},[s,n]);return u.useEffect(()=>(s&&(o(null),l(),r.current=setInterval(l,et)),()=>{r.current&&(clearInterval(r.current),r.current=null)}),[s,l]),i.jsx(fe,{title:t("modal.channelLogs"),visible:s!==null,onCancel:e,footer:null,width:870,centered:!0,closeOnEsc:!0,className:"ga-log-dialog",children:a===null?i.jsx("div",{className:"ga-services-loading",style:{padding:24},children:i.jsx(G,{})}):i.jsx(Je,{lines:a,emptyLabel:t("ch.logEmpty"),className:"ga-log-modal-body"})})}function tt({visible:s,onClose:e}){const{t}=q(),n=z(x=>x.fetchMykey),a=z(x=>x.saveMykey),o=z(x=>x.mykeyContent),r=z(x=>x.mykeyLoading),[l,c]=u.useState(""),[g,m]=u.useState(!1);u.useEffect(()=>{s&&n()},[s,n]),u.useEffect(()=>{c(o)},[o]);const w=async()=>{m(!0);const x=await a(l);m(!1),x?(P(t("sys.configSaved")),e()):W(t("err.mykeyExport"))};return i.jsx(fe,{title:t("modal.mykeyConfig"),visible:s,onCancel:e,width:870,centered:!0,closeOnEsc:!0,className:"ga-settings-dialog",footer:i.jsxs("div",{style:{display:"flex",gap:8,justifyContent:"flex-end",padding:"8px 0"},children:[i.jsx(_,{onClick:e,children:t("common.cancel")}),i.jsx(_,{type:"primary",loading:g,onClick:w,children:t("common.save")})]}),children:r?i.jsx("div",{className:"ga-services-loading",children:i.jsx(G,{})}):i.jsx(Ge,{value:l,onChange:x=>c(x),autosize:{minRows:16,maxRows:30},style:{fontFamily:"var(--font-mono)",fontSize:13}})})}const st="data:image/svg+xml,%3csvg%20role='img'%20viewBox='0%200%2024%2024'%20xmlns='http://www.w3.org/2000/svg'%3e%3ctitle%3eTencent%20QQ%3c/title%3e%3cpath%20d='M21.395%2015.035a40%2040%200%200%200-.803-2.264l-1.079-2.695c.001-.032.014-.562.014-.836C19.526%204.632%2017.351%200%2012%200S4.474%204.632%204.474%209.241c0%20.274.013.804.014.836l-1.08%202.695a39%2039%200%200%200-.802%202.264c-1.021%203.283-.69%204.643-.438%204.673.54.065%202.103-2.472%202.103-2.472%200%201.469.756%203.387%202.394%204.771-.612.188-1.363.479-1.845.835-.434.32-.379.646-.301.778.343.578%205.883.369%207.482.189%201.6.18%207.14.389%207.483-.189.078-.132.132-.458-.301-.778-.483-.356-1.233-.646-1.846-.836%201.637-1.384%202.393-3.302%202.393-4.771%200%200%201.563%202.537%202.103%202.472.251-.03.581-1.39-.438-4.673'/%3e%3c/svg%3e",nt="data:image/svg+xml,%3csvg%20role='img'%20viewBox='0%200%2024%2024'%20xmlns='http://www.w3.org/2000/svg'%3e%3ctitle%3eWeChat%3c/title%3e%3cpath%20d='M8.691%202.188C3.891%202.188%200%205.476%200%209.53c0%202.212%201.17%204.203%203.002%205.55a.59.59%200%200%201%20.213.665l-.39%201.48c-.019.07-.048.141-.048.213%200%20.163.13.295.29.295a.326.326%200%200%200%20.167-.054l1.903-1.114a.864.864%200%200%201%20.717-.098%2010.16%2010.16%200%200%200%202.837.403c.276%200%20.543-.027.811-.05-.857-2.578.157-4.972%201.932-6.446%201.703-1.415%203.882-1.98%205.853-1.838-.576-3.583-4.196-6.348-8.596-6.348zM5.785%205.991c.642%200%201.162.529%201.162%201.18a1.17%201.17%200%200%201-1.162%201.178A1.17%201.17%200%200%201%204.623%207.17c0-.651.52-1.18%201.162-1.18zm5.813%200c.642%200%201.162.529%201.162%201.18a1.17%201.17%200%200%201-1.162%201.178%201.17%201.17%200%200%201-1.162-1.178c0-.651.52-1.18%201.162-1.18zm5.34%202.867c-1.797-.052-3.746.512-5.28%201.786-1.72%201.428-2.687%203.72-1.78%206.22.942%202.453%203.666%204.229%206.884%204.229.826%200%201.622-.12%202.361-.336a.722.722%200%200%201%20.598.082l1.584.926a.272.272%200%200%200%20.14.047c.134%200%20.24-.111.24-.247%200-.06-.023-.12-.038-.177l-.327-1.233a.582.582%200%200%201-.023-.156.49.49%200%200%201%20.201-.398C23.024%2018.48%2024%2016.82%2024%2014.98c0-3.21-2.931-5.837-6.656-6.088V8.89c-.135-.01-.27-.027-.407-.03zm-2.53%203.274c.535%200%20.969.44.969.982a.976.976%200%200%201-.969.983.976.976%200%200%201-.969-.983c0-.542.434-.982.97-.982zm4.844%200c.535%200%20.969.44.969.982a.976.976%200%200%201-.969.983.976.976%200%200%201-.969-.983c0-.542.434-.982.969-.982z'/%3e%3c/svg%3e",at="data:image/svg+xml,%3csvg%20width='46'%20height='46'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20clip-path='url(%23clip0_338_13245)'%3e%3cpath%20d='M39.743%200H6.257A6.257%206.257%200%200%200%200%206.257v33.487A6.257%206.257%200%200%200%206.257%2046h33.487A6.257%206.257%200%200%200%2046%2039.743V6.257A6.257%206.257%200%200%200%2039.743%200'%20fill='%23fff'/%3e%3cmask%20id='mask0_338_13245'%20style='mask-type:luminance'%20maskUnits='userSpaceOnUse'%20x='5'%20y='8'%20width='36'%20height='30'%3e%3cpath%20d='M40.514%208.373H5.484v29.262h35.03z'%20fill='%23fff'/%3e%3c/mask%3e%3cg%20mask='url(%23mask0_338_13245)'%3e%3cpath%20d='M28.856%2031.647a.483.483%200%200%200%20.06.738%206.2%206.2%200%200%201%201.911%203.725%202.02%202.02%200%201%200%202.16-2.54%206.2%206.2%200%200%201-3.448-1.922.483.483%200%200%200-.683-.001'%20fill='%23fb
Line truncated
|
||||
@@ -0,0 +1 @@
|
||||
import{b as s,aj as r}from"./tauri-compat-tfiFK9EG.js";import{M as o,S as m,r as t,a as e,b as n,p}from"./markdown-preprocess-Bvg4n8KE.js";import{S as i,U as c}from"./main-Knf6L_en.js";import"./index-Bpi3BHKj.js";import"./WindowsTitlebar-CrkUa1UM.js";const u={...c},O=s.memo(function({content:a}){return r.jsx("div",{"data-slot":"summary-block",children:r.jsx(o,{remarkPlugins:[e,n],rehypePlugins:[[t,u]],components:m,urlTransform:i,children:p(a)})})});export{O as SummaryPart};
|
||||
@@ -0,0 +1,2 @@
|
||||
import{aA as F,aB as L,aC as ee,aD as ze,aE as Xe,aF as wt,aG as Vr,c as Dt,b as J,aH as Br,aI as Gr,B,d as Yi,e as Li,x as $i,aJ as Hi,g as ia,aK as Ui,_ as st,f as He,ae as Be,w as qi,i as Wi,aL as De,N as oe,j as ji,R as b,k as Ue,l as Y,P as p,q as We,h as Q,aM as Vi,aN as Bi,M as K,aO as Gi,aP as zi,ay as Xi,X as zr,T as Zi,O as Xr,s as Qi,aQ as Ki,ax as Ji,aj as A}from"./tauri-compat-tfiFK9EG.js";import{_ as es,c as M,V as ts,i as Sn,d as ns,e as Et,I as Zr,f as as,r as rs,g as rt,h as Un,j as Qn,k as is,l as ss,T as os,a as us,b as Ta}from"./index-DwVcZP0M.js";import{s as Qr,a as Kr,F as gt,I as ls,j as cs,k as ds,B as Jr,C as fs,l as hs,m as wa,b as lt,n as ps,T as ms,E as ei,g as gs}from"./main-Knf6L_en.js";import{a as pt,B as yt}from"./index-Bpi3BHKj.js";import{A as vs}from"./Animation-TKQfYYOo.js";import{B as Da}from"./index-DpGuh58E.js";import{S as ys}from"./index-D_sWIqse.js";import"./WindowsTitlebar-CrkUa1UM.js";function Le(s,e){F(2,arguments);var t=L(s),n=ee(e);if(isNaN(n))return new Date(NaN);if(!n)return t;var a=t.getDate(),i=new Date(t.getTime());i.setMonth(t.getMonth()+n+1,0);var r=i.getDate();return a>=r?i:(t.setFullYear(i.getFullYear(),i.getMonth(),a),t)}function Ts(s,e){F(2,arguments);var t=L(s).getTime(),n=ee(e);return new Date(t+n)}function ti(s){var e=new Date(Date.UTC(s.getFullYear(),s.getMonth(),s.getDate(),s.getHours(),s.getMinutes(),s.getSeconds(),s.getMilliseconds()));return e.setUTCFullYear(s.getFullYear()),s.getTime()-e.getTime()}function Kn(s){F(1,arguments);var e=L(s);return e.setHours(0,0,0,0),e}function xn(s,e){F(2,arguments);var t=ee(e);return Le(s,t*12)}var sa=6e4,oa=36e5,ws=1e3;function ua(s,e){F(2,arguments);var t=Kn(s),n=Kn(e);return t.getTime()===n.getTime()}function Jn(s){return F(1,arguments),s instanceof Date||ze(s)==="object"&&Object.prototype.toString.call(s)==="[object Date]"}function Ce(s){if(F(1,arguments),!Jn(s)&&typeof s!="number")return!1;var e=L(s);return!isNaN(Number(e))}function je(s,e){F(2,arguments);var t=L(s),n=L(e),a=t.getFullYear()-n.getFullYear(),i=t.getMonth()-n.getMonth();return a*12+i}function Ds(s,e){F(2,arguments);var t=L(s),n=L(e);return t.getFullYear()-n.getFullYear()}function bs(s){F(1,arguments);var e=L(s);return e.setDate(1),e.setHours(0,0,0,0),e}function ni(s,e){F(2,arguments);var t=ee(e);return Ts(s,-t)}var _s=864e5;function Cs(s){F(1,arguments);var e=L(s),t=e.getTime();e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0);var n=e.getTime(),a=t-n;return Math.floor(a/_s)+1}function ot(s){F(1,arguments);var e=1,t=L(s),n=t.getUTCDay(),a=(n<e?7:0)+n-e;return t.setUTCDate(t.getUTCDate()-a),t.setUTCHours(0,0,0,0),t}function ai(s){F(1,arguments);var e=L(s),t=e.getUTCFullYear(),n=new Date(0);n.setUTCFullYear(t+1,0,4),n.setUTCHours(0,0,0,0);var a=ot(n),i=new Date(0);i.setUTCFullYear(t,0,4),i.setUTCHours(0,0,0,0);var r=ot(i);return e.getTime()>=a.getTime()?t+1:e.getTime()>=r.getTime()?t:t-1}function Is(s){F(1,arguments);var e=ai(s),t=new Date(0);t.setUTCFullYear(e,0,4),t.setUTCHours(0,0,0,0);var n=ot(t);return n}var Rs=6048e5;function ri(s){F(1,arguments);var e=L(s),t=ot(e).getTime()-Is(e).getTime();return Math.round(t/Rs)+1}function la(s,e){var t,n,a,i,r,u,o,l;F(1,arguments);var c=L(s),d=c.getUTCFullYear(),f=wt(),h=ee((t=(n=(a=(i=e==null?void 0:e.firstWeekContainsDate)!==null&&i!==void 0?i:e==null||(r=e.locale)===null||r===void 0||(u=r.options)===null||u===void 0?void 0:u.firstWeekContainsDate)!==null&&a!==void 0?a:f.firstWeekContainsDate)!==null&&n!==void 0?n:(o=f.locale)===null||o===void 0||(l=o.options)===null||l===void 0?void 0:l.firstWeekContainsDate)!==null&&t!==void 0?t:1);if(!(h>=1&&h<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var v=new Date(0);v.setUTCFullYear(d+1,0,h),v.setUTCHours(0,0,0,0);var w=Xe(v,e),m=new Date(0);m.setUTCFullYear(d,0,h),m.setUTCHours(0,0,0,0);var g=Xe(m,e);return c.getTime()>=w.getTime()?d+1:c.getTime()>=g.getTime()?d:d-1}function Ps(s,e){var t,n,a,i,r,u,o,l;F(1,arguments);var c=wt(),d=ee((t=(n=(a=(i=e==null?void 0:e.firstWeekContainsDate)!==null&&i!==void 0?i:e==null||(r=e.locale)===null||r===void 0||(u=r.options)===null||u===void 0?void 0:u.firstWeekContainsDate)!==null&&a!==void 0?a:c.firstWeekContainsDate)!==null&&n!==void 0?n:(o=c.locale)===null||o===void 0||(l=o.options)===null||l===void 0?void 0:l.firstWeekContainsDate)!==null&&t!==void 0?t:1),f=la(s,e),h=new Date(0);h.setUTCFullYear(f,0,d),h.setUTCHours(0,0,0,0);var v=Xe(h,e);return v}var Es=6048e5;function ii(s,e){F(1,arguments);var t=L(s),n=Xe(t,e).getTime()-Ps(t,e).getTime();return Math.round(n/Es)+1}function z(s,e){for(var t=s<0?"-":"",n=Math.abs(s).toString();n.length<e;)n="0"+n;return t+n}var Fe={y:function(e,t){var n=e.getUTCFullYear(),a=n>0?n:1-n;return z(t==="yy"?a%100:a,t.length)},M:function(e,t){var n=e.getUTCMonth();return t==="M"?String(n+1):z(n+1,2)},d:function(e,t){return z(e.getUTCDate(),t.length)},a:function(e,t){var n=e.getUTCHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.toUpperCase();case"aLine truncated
|
||||
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var i,r=!0,u=!1;return{s:function(){t=t.call(s)},n:function(){var l=t.next();return r=l.done,l},e:function(l){u=!0,i=l},f:function(){try{r||t.return==null||t.return()}finally{if(u)throw i}}}}function q(s,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");s.prototype=Object.create(e&&e.prototype,{constructor:{value:s,writable:!0,configurable:!0}}),Object.defineProperty(s,"prototype",{writable:!1}),e&&es(s,e)}function Nn(s){return Nn=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Nn(s)}function di(){try{var s=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(di=function(){return!!s})()}function Ws(s,e){if(e&&(ze(e)=="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return M(s)}function W(s){var e=di();return function(){var t,n=Nn(s);if(e){var a=Nn(this).constructor;t=Reflect.construct(n,arguments,a)}else t=n.apply(this,arguments);return Ws(this,t)}}function $(s,e){if(!(s instanceof e))throw new TypeError("Cannot call a class as a function")}function js(s,e){if(ze(s)!="object"||!s)return s;var t=s[Symbol.toPrimitive];if(t!==void 0){var n=t.call(s,e);if(ze(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(s)}function fi(s){var e=js(s,"string");return ze(e)=="symbol"?e:e+""}function Vs(s,e){for(var t=0;t<e.length;t++){var n=e[t];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(s,fi(n.key),n)}}function H(s,e,t){return e&&Vs(s.prototype,e),Object.defineProperty(s,"prototype",{writable:!1}),s}function S(s,e,t){return(e=fi(e))in s?Object.defineProperty(s,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):s[e]=t,s}var Bs=10,hi=(function(){function s(){$(this,s),S(this,"priority",void 0),S(this,"subPriority",0)}return H(s,[{key:"validate",value:function(t,n){return!0}}]),s})(),Gs=(function(s){q(t,s);var e=W(t);function t(n,a,i,r,u){var o;return $(this,t),o=e.call(this),o.value=n,o.validateValue=a,o.setValue=i,o.priority=r,u&&(o.subPriority=u),o}return H(t,[{key:"validate",value:function(a,i){return this.validateValue(a,this.value,i)}},{key:"set",value:function(a,i,r){return this.setValue(a,i,this.value,r)}}]),t})(hi),zs=(function(s){q(t,s);var e=W(t);function t(){var n;$(this,t);for(var a=arguments.length,i=new Array(a),r=0;r<a;r++)i[r]=arguments[r];return n=e.call.apply(e,[this].concat(i)),S(M(n),"priority",Bs),S(M(n),"subPriority",-1),n}return H(t,[{key:"set",value:function(a,i){if(i.timestampIsSet)return a;var r=new Date(0);return r.setFullYear(a.getUTCFullYear(),a.getUTCMonth(),a.getUTCDate()),r.setHours(a.getUTCHours(),a.getUTCMinutes(),a.getUTCSeconds(),a.getUTCMilliseconds()),r}}]),t})(hi),j=(function(){function s(){$(this,s),S(this,"incompatibleTokens",void 0),S(this,"priority",void 0),S(this,"subPriority",void 0)}return H(s,[{key:"run",value:function(t,n,a,i){var r=this.parse(t,n,a,i);return r?{setter:new Gs(r.value,this.validate,this.set,this.priority,this.subPriority),rest:r.rest}:null}},{key:"validate",value:function(t,n,a){return!0}}]),s})(),Xs=(function(s){q(t,s);var e=W(t);function t(){var n;$(this,t);for(var a=arguments.length,i=new Array(a),r=0;r<a;r++)i[r]=arguments[r];return n=e.call.apply(e,[this].concat(i)),S(M(n),"priority",140),S(M(n),"incompatibleTokens",["R","u","t","T"]),n}return H(t,[{key:"parse",value:function(a,i,r){switch(i){case"G":case"GG":case"GGG":return r.era(a,{width:"abbreviated"})||r.era(a,{width:"narrow"});case"GGGGG":return r.era(a,{width:"narrow"});case"GGGG":default:return r.era(a,{width:"wide"})||r.era(a,{width:"abbreviated"})||r.era(a,{width:"narrow"})}}},{key:"set",value:function(a,i,r){return i.era=r,a.setUTCFullYear(r,0,1),a.setUTCHours(0,0,0,0),a}}]),t})(j),ue={month:/^(1[0-2]|0?\d)/,date:/^(3[0-1]|[0-2]?\d)/,dayOfYear:/^(36[0-6]|3[0-5]\d|[0-2]?\d?\d)/,week:/^(5[0-3]|[0-4]?\d)/,hour23h:/^(2[0-3]|[0-1]?\d)/,hour24h:/^(2[0-4]|[0-1]?\d)/,hour11h:/^(1[0-1]|0?\d)/,hour12h:/^(1[0-2]|0?\d)/,minute:/^[0-5]?\d/,second:/^[0-5]?\d/,singleDigit:/^\d/,twoDigits:/^\d{1,2}/,threeDigits:/^\d{1,3}/,fourDigits:/^\d{1,4}/,anyDigitsSigned:/^-?\d+/,singleDigitSigned:/^-?\d/,twoDigitsSigned:/^-?\d{1,2}/,threeDigitsSigned:/^-?\d{1,3}/,fourDigitsSigned:/^-?\d{1,4}/},Ee={basicOptionalMinutes:/^([+-])(\d{2})(\d{2})?|Z/,basic:/^([+-])(\d{2})(\d{2})|Z/,basicOptionalSeconds:/^([+-])(\d{2})(\d{2})((\d{2}))?|Z/,extended:/^([+-])(\d{2}):(\d{2})|Z/,extendedOptionalSeconds:/^([+-])(\d{2}):(\d{2})(:(\d{2}))?|Z/};function le(s,e){return s&&{value:e(s.value),rest:s.rest}}function ae(s,e){var t=e.match(s);return t?{value:parseInt(t[0],10),rest:e.slice(t[0].length)}:null}function Oe(s,e){var t=e.match(s);if(!t)return null;if(t[0]==="Z")return{value:0,rest:
Line truncated
|
||||
@@ -0,0 +1 @@
|
||||
.semi-scrolllist{width:100%;height:100%;background:var(--semi-color-bg-3);box-shadow:0 0 1px #0000004d,0 4px 14px #0000001a;border-radius:var(--semi-border-radius-medium);overflow:hidden;font-size:14px;line-height:20px;font-family:Inter,-apple-system,BlinkMacSystemFont,PingFang SC,Hiragino Sans GB,Microsoft YaHei,Segoe UI,Helvetica Neue,Helvetica,Arial,sans-serif;-webkit-user-select:none;user-select:none;display:flex;flex-direction:column}.semi-scrolllist-header{text-align:center;padding:0 16px;background:transparent}.semi-scrolllist-header-title{padding:16px 0;font-weight:600;color:var(--semi-color-text-0);font-size:14px;line-height:20px;font-family:Inter,-apple-system,BlinkMacSystemFont,PingFang SC,Hiragino Sans GB,Microsoft YaHei,Segoe UI,Helvetica Neue,Helvetica,Arial,sans-serif}.semi-scrolllist-body{display:flex;height:300px;padding:0 16px;overflow:hidden}.semi-scrolllist-body .semi-scrolllist-item-wheel .semi-scrolllist-list-outer-nocycle>ul:before,.semi-scrolllist-body .semi-scrolllist-item>ul:before{content:"";display:block;width:100%;height:132px}.semi-scrolllist-body .semi-scrolllist-item{position:relative;flex:1;overflow-x:hidden;overflow-y:auto}.semi-scrolllist-body .semi-scrolllist-item:not(:last-child){border-right:1px solid var(--semi-color-border)}.semi-scrolllist-body .semi-scrolllist-item>ul,.semi-scrolllist-body .semi-scrolllist-item-wheel .semi-scrolllist-list-outer>ul{box-sizing:border-box;width:100%;margin:0;padding:0 0 132px;list-style:none}.semi-scrolllist-body .semi-scrolllist-item>ul>li,.semi-scrolllist-body .semi-scrolllist-item-wheel .semi-scrolllist-list-outer>ul>li{list-style:none;height:36px;box-sizing:border-box;color:var(--semi-color-text-0);text-align:center;display:flex;align-items:center;justify-content:center;cursor:pointer;background-color:transparent;transition:background-color var(--semi-transition_duration-none) var(--semi-transition_function-easeOut) 0ms}.semi-scrolllist-body .semi-scrolllist-item>ul>li.semi-scrolllist-item-sel,.semi-scrolllist-body .semi-scrolllist-item-wheel .semi-scrolllist-list-outer>ul>li.semi-scrolllist-item-sel{background:var(--semi-color-primary-light-default);color:var(--semi-color-text-0)}.semi-scrolllist-body .semi-scrolllist-item>ul>li.semi-scrolllist-item-sel>svg,.semi-scrolllist-body .semi-scrolllist-item-wheel .semi-scrolllist-list-outer>ul>li.semi-scrolllist-item-sel>svg{color:var(--semi-color-text-2);width:16px;height:16px;margin-right:12px}.semi-scrolllist-body .semi-scrolllist-item>ul>li:not(.disabled):not(.semi-scrolllist-item-disabled):not(.semi-scrolllist-item-sel):not(.semi-scrolllist-item-selected),.semi-scrolllist-body .semi-scrolllist-item-wheel .semi-scrolllist-list-outer>ul>li:not(.disabled):not(.semi-scrolllist-item-disabled):not(.semi-scrolllist-item-sel):not(.semi-scrolllist-item-selected){cursor:pointer}.semi-scrolllist-body .semi-scrolllist-item>ul>li:not(.disabled):not(.semi-scrolllist-item-disabled):not(.semi-scrolllist-item-sel):not(.semi-scrolllist-item-selected):hover,.semi-scrolllist-body .semi-scrolllist-item-wheel .semi-scrolllist-list-outer>ul>li:not(.disabled):not(.semi-scrolllist-item-disabled):not(.semi-scrolllist-item-sel):not(.semi-scrolllist-item-selected):hover{background-color:var(--semi-color-fill-1)}.semi-scrolllist-body .semi-scrolllist-item>ul>li:not(.disabled):not(.semi-scrolllist-item-disabled):not(.semi-scrolllist-item-sel):not(.semi-scrolllist-item-selected):active,.semi-scrolllist-body .semi-scrolllist-item-wheel .semi-scrolllist-list-outer>ul>li:not(.disabled):not(.semi-scrolllist-item-disabled):not(.semi-scrolllist-item-sel):not(.semi-scrolllist-item-selected):active{background-color:var(--semi-color-fill-2)}.semi-scrolllist-body .semi-scrolllist-item>ul>li.semi-scrolllist-item-disabled,.semi-scrolllist-body .semi-scrolllist-item-wheel .semi-scrolllist-list-outer>ul>li.semi-scrolllist-item-disabled{color:var(--semi-color-disabled-text);cursor:not-allowed}.semi-scrolllist-body .semi-scrolllist-item-wheel{position:relative;flex:1;overflow:hidden}.semi-scrolllist-body .semi-scrolllist-item-wheel:not(:last-child){border-right:1px solid var(--semi-color-border)}.semi-scrolllist-body .semi-scrolllist-item-wheel .semi-scrolllist-item-selected{font-weight:600;color:var(--semi-color-primary)!important}.semi-scrolllist-body .semi-scrolllist-item-wheel .semi-scrolllist-list-outer{overflow-x:hidden;overflow-y:auto;height:100%;width:100%;padding-right:18px}.semi-scrolllist-body .semi-scrolllist-item-wheel .semi-scrolllist-shade{width:100%;height:50%;pointer-events:none;position:absolute}.semi-scrolllist-body .semi-scrolllist-item-wheel .semi-scrolllist-shade-pre{top:0;margin-top:-19px;background:var(--semi-color-bg-3);opacity:.5}.semi-scrolllist-body .semi-scrolllist-item-wheel .semi-scrolllist-shade-post{top:50%;margin-top:19px;background:var(--semi-color-bg-3);opacity:.5}.semi-scrolllist-body .semi-scrolllist-item-wheel .semi-scrolllist-selector{pointer-events:none;position:absolute;top:50%;border-tLine truncated
|
||||
@@ -0,0 +1 @@
|
||||
import{aj as t}from"./tauri-compat-tfiFK9EG.js";function d(){var n,e,o;const i=(o=(e=(n=window.__TAURI__)==null?void 0:n.window)==null?void 0:e.getCurrentWindow)==null?void 0:o.call(e);return i?t.jsxs("div",{className:"ga-win-controls","data-no-drag":!0,children:[t.jsx("button",{type:"button",className:"ga-win-btn",onClick:()=>i.minimize(),"aria-label":"Minimize",children:t.jsx("svg",{width:"10",height:"1",viewBox:"0 0 10 1",children:t.jsx("rect",{fill:"currentColor",width:"10",height:"1"})})}),t.jsx("button",{type:"button",className:"ga-win-btn",onClick:()=>i.toggleMaximize(),"aria-label":"Maximize",children:t.jsx("svg",{width:"10",height:"10",viewBox:"0 0 10 10",fill:"none",children:t.jsx("rect",{x:"0.5",y:"0.5",width:"9",height:"9",stroke:"currentColor",strokeWidth:"1"})})}),t.jsx("button",{type:"button",className:"ga-win-btn ga-win-btn--close",onClick:()=>i.close(),"aria-label":"Close",children:t.jsx("svg",{width:"10",height:"10",viewBox:"0 0 10 10",children:t.jsx("path",{d:"M1 1l8 8M9 1l-8 8",stroke:"currentColor",strokeWidth:"1.2"})})})]}):null}function c(){const i=n=>{var o,r,s,a,l;n.button!==0||n.target.closest("button, a, input, [data-no-drag]")||(n.preventDefault(),(l=(a=(s=(r=(o=window.__TAURI__)==null?void 0:o.window)==null?void 0:r.getCurrentWindow)==null?void 0:s.call(r))==null?void 0:a.startDragging)==null||l.call(a))};return t.jsx("div",{className:"ga-win-titlebar","data-testid":"windows-titlebar",onMouseDown:i,children:t.jsx(d,{})})}export{c as W};
|
||||
@@ -0,0 +1 @@
|
||||
:root[data-platform=windows]{--ga-titlebar-height: 32px}.ga-win-titlebar{height:32px;flex-shrink:0;width:100%;background:#0a0a0a;display:flex;justify-content:flex-end;align-items:stretch;-webkit-user-select:none;user-select:none}.ga-win-controls{display:flex;height:100%}.ga-win-btn{width:46px;height:100%;border:none;background:transparent;color:#d1d1d1;display:flex;align-items:center;justify-content:center;cursor:pointer;transition:background .1s}.ga-win-btn:hover{background:#2e2e2e;color:#fff}.ga-win-btn--close:hover{background:#c42b1c;color:#fff}
|
||||
Binary file not shown.
@@ -0,0 +1,12 @@
|
||||
<svg width="24"
|
||||
height="24"
|
||||
viewBox="0 0 24 24"
|
||||
fill="none"
|
||||
xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M12.9238 12.8029C12.9427 12.784 12.9616 12.7682 12.9806 12.7493C13.0184 12.7146 13.0563 12.6767 13.091 12.6389L13.1667 12.5631L13.397 12.336L14.7315 11.0173L15.0659 10.686C15.129 10.6229 15.1952 10.563 15.2615 10.5031C15.3845 10.3926 15.5076 10.2854 15.6369 10.1813C15.7536 10.0866 15.8767 9.99514 15.9997 9.9068C16.1732 9.78376 16.3499 9.67019 16.5329 9.55977C16.7127 9.45251 16.8957 9.35471 17.085 9.26322C17.2616 9.17804 17.4415 9.09917 17.6276 9.02661C17.7317 8.9856 17.8326 8.94774 17.9399 8.91304C17.9935 8.89411 18.044 8.87834 18.0977 8.86256C17.6276 7.00439 16.7632 5.3008 15.5991 3.84959C15.3719 3.56566 15.0249 3.40161 14.6589 3.40161H5.0084C4.83489 3.40161 4.76233 3.6256 4.90114 3.72656C8.18528 6.13997 10.9236 9.24114 12.9017 12.825C12.908 12.8187 12.9175 12.8124 12.9238 12.8029Z"
|
||||
fill="#00D6B9" />
|
||||
<path d="M9.09696 21.2986C14.0815 21.2986 18.4225 18.5476 20.6877 14.4843C20.7666 14.3423 20.8454 14.1972 20.918 14.052C20.8044 14.2729 20.6751 14.4811 20.5394 14.6767C20.4889 14.7461 20.4385 14.8155 20.388 14.8818C20.3217 14.9669 20.2555 15.049 20.1861 15.1278C20.1324 15.1909 20.0757 15.2509 20.0189 15.3108C19.9021 15.4307 19.7823 15.5474 19.6561 15.6547C19.5867 15.7146 19.5141 15.7714 19.4415 15.8282C19.3564 15.8944 19.268 15.9575 19.1797 16.0143C19.1229 16.0522 19.0661 16.09 19.0093 16.1247C18.9494 16.1626 18.8895 16.1973 18.8264 16.232C18.7002 16.3014 18.574 16.3645 18.4446 16.4245C18.3311 16.4749 18.2175 16.5223 18.1008 16.5633C17.9746 16.6106 17.8452 16.6516 17.7159 16.6863C17.5234 16.7399 17.3247 16.7809 17.1259 16.8125C16.9808 16.8346 16.8357 16.8504 16.6874 16.863C16.5328 16.8724 16.3751 16.8787 16.2173 16.8756C16.0438 16.8724 15.8703 16.863 15.6936 16.844C15.5643 16.8314 15.435 16.8125 15.3056 16.7873C15.192 16.7683 15.0785 16.7431 14.9649 16.7178C14.9049 16.7021 14.845 16.6895 14.7851 16.6737C14.6179 16.6295 14.4538 16.5822 14.2898 16.5349C14.2077 16.5096 14.1257 16.4875 14.0437 16.4623C13.9206 16.4245 13.7976 16.3897 13.6777 16.3519C13.5768 16.3203 13.479 16.2888 13.378 16.2572C13.2834 16.2257 13.1887 16.1942 13.0941 16.1626C13.031 16.1405 12.9647 16.1184 12.9016 16.0964C12.8228 16.0711 12.7471 16.0427 12.6682 16.0143C12.6114 15.9954 12.5578 15.9765 12.501 15.9544C12.3906 15.9134 12.2802 15.8755 12.1729 15.8345C12.1098 15.8093 12.0467 15.7872 11.9836 15.7619C11.8984 15.7304 11.8132 15.6957 11.7312 15.6641C11.6429 15.6294 11.5514 15.5947 11.4631 15.5569C11.4063 15.5348 11.3463 15.5096 11.2895 15.4875C11.217 15.4591 11.1476 15.4275 11.075 15.3991C11.0214 15.3771 10.9646 15.3518 10.911 15.3297C10.8542 15.3045 10.7974 15.2793 10.7406 15.254C10.6901 15.2319 10.6428 15.2099 10.5923 15.1878C10.5482 15.1688 10.5008 15.1468 10.4567 15.1278C10.4094 15.1057 10.3652 15.0868 10.3179 15.0647C10.2705 15.0427 10.2232 15.0206 10.1759 14.9985C10.116 14.9701 10.056 14.9417 9.99608 14.9165C9.93299 14.8881 9.87304 14.8565 9.80995 14.8281C9.7437 14.7966 9.67745 14.765 9.6112 14.7303C9.55441 14.7019 9.49762 14.6735 9.44084 14.6483C6.45324 13.1592 3.80321 11.1717 1.54438 8.76145C1.43081 8.64157 1.23206 8.72044 1.23206 8.88449L1.23836 18.0933C1.23836 18.494 1.43712 18.8726 1.77153 19.0934C3.86631 20.4878 6.38699 21.2986 9.09696 21.2986Z"
|
||||
fill="#3370FF" />
|
||||
<path d="M23.7322 9.29488C22.7226 8.79642 21.5838 8.5188 20.3818 8.5188C19.6688 8.5188 18.9747 8.6166 18.3217 8.80273C18.246 8.82481 18.1703 8.8469 18.0977 8.86898C18.0441 8.88476 17.9905 8.90368 17.94 8.91946C17.8359 8.95416 17.7318 8.99202 17.6276 9.03303C17.4447 9.10559 17.2617 9.18446 17.085 9.26964C16.8957 9.36113 16.7128 9.45893 16.5329 9.56619C16.35 9.67345 16.1701 9.79018 15.9998 9.91322C15.8767 10.0016 15.7569 10.093 15.637 10.1877C15.5076 10.2918 15.3846 10.3991 15.2616 10.5095C15.1953 10.5694 15.1322 10.6325 15.066 10.6925L14.7315 11.0206L13.3939 12.3424L13.1636 12.5696L13.0879 12.6453C13.05 12.6831 13.0122 12.7178 12.9775 12.7557C12.9586 12.7746 12.9396 12.7904 12.9207 12.8093C12.8923 12.8377 12.8639 12.863 12.8355 12.8882C12.804 12.9166 12.7724 12.9481 12.7409 12.9765C11.9143 13.7368 10.9931 14.3899 9.99304 14.923C10.053 14.9514 10.1129 14.9798 10.1729 15.0051C10.2202 15.0271 10.2675 15.0492 10.3148 15.0713C10.359 15.0934 10.4063 15.1123 10.4536 15.1344C10.4978 15.1533 10.5451 15.1754 10.5893 15.1943C10.6398 15.2164 10.6871 15.2385 10.7376 15.2606C10.7944 15.2858 10.8511 15.3111 10.9079 15.3363C10.9616 15.3584 11.0184 15.3836 11.072 15.4057C11.1445 15.4373 11.2139 15.4657 11.2865 15.4941C11.3433 15.5193 11.4032 15.5414 11.46 15.5635C11.5484 15.5982 11.6367 15.636 11.7282 15.6707C11.8134 15.7023 11.8954 15.737 11.9806 15.7685C12.0437 15.7938 12.1068 15.8158 12.1699 15.8411C12.2803 15.8821 12.3875 15.9231 12.498 15.961C12.5547 15.9799 12.6084 16.002 12.6652 16.0209C12.744 16.0493 12.8197 16.0745 12.8986 16.1029C12.9617 16.125 13.028 16.1471 13.0911 16.1692C13.1857 16.2007 13.2803 16.2323 13.375 16.2638C13.4728 16.2954 13.5737 16.3269 13.6747 16.3585C13.7977 16.3963 13.9176 16.4342 14.0406 16.4689C14.1227 16.4941 14.2047 16.5162 14.2867 16.5414C14.4508 16.5888 14.618 16.6361 14.782 16.6803C14.842 16.696 14.9019 16.7118 14.9618 16.7244C15.0754 16.7528 15.189 16.7749 15.3026 16.7938C15.4319 16.8159 15.5613 16.8348 15.6906 16.8506C15.8673 16.8695 16.0408 16.8822 16.2143 16.8822C16.372 16.8853 16.5298 16.879 16.6844 16.8695C16.8326 16.8601 16.9778 16.8412 17.1229 16.8191C17.3248 16.7875 17.5204 16.7465 17.7128 16.6929C17.8422 16.6582 17.9715 16.6172 18.0977 16.5698C18.2144 16.5257 18.328 16.4815 18.4416 16.4279C18.5709 16.3679 18.7003 16.3048 18.8233 16.2354C18.8833 16.2007 18.9464 16.166 19.0063 16.1282C19.0631 16.0935 19.1199 16.0556 19.1767 16.0178C19.265 15.9578 19.3533 15.8947 19.4385 15.8316C19.5111 15.7748 19.5836 15.718 19.653 15.6581C19.7792 15.5508 19.8991 15.4341 20.0158 15.3142C20.0726 15.2543 20.1294 15.1943 20.183 15.1313C20.2524 15.0524 20.3187 14.9704 20.3849 14.8852C20.4354 14.8189 20.4859 14.7495 20.5364 14.6801C20.672 14.4845 20.7982 14.2763 20.9118 14.0586L21.0411 13.7999L22.2084 11.4748L22.2053 11.4812C22.5807 10.6578 23.1012 9.91953 23.7322 9.29488Z"
|
||||
fill="#133C9A" />
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 6.1 KiB |
+58
@@ -0,0 +1,58 @@
|
||||
<svg
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
viewBox="0 0 878 404"
|
||||
fill="none"
|
||||
role="img"
|
||||
aria-labelledby="ga-logo-title"
|
||||
>
|
||||
<title id="ga-logo-title">GenericAgent</title>
|
||||
<style>
|
||||
path { fill: #000; }
|
||||
@media (prefers-color-scheme: dark) {
|
||||
path { fill: #fff; }
|
||||
}
|
||||
</style>
|
||||
<path
|
||||
fill-rule="evenodd"
|
||||
d="
|
||||
M200 0
|
||||
H489
|
||||
L428 86
|
||||
H187
|
||||
C128.46 86 81 138.83 81 204
|
||||
C81 269.17 130.47 322 189 322
|
||||
H359
|
||||
L401 404
|
||||
H186
|
||||
C83.27 404 0 313.57 0 202
|
||||
C0 90.43 89.54 0 200 0
|
||||
Z
|
||||
|
||||
M240 176
|
||||
H463
|
||||
L506 251
|
||||
H187
|
||||
Z
|
||||
|
||||
M407 251
|
||||
H506
|
||||
L401 404
|
||||
L359 322
|
||||
Z
|
||||
|
||||
M579 0
|
||||
H638
|
||||
L878 404
|
||||
H781
|
||||
L689 251
|
||||
H506
|
||||
L463 176
|
||||
Z
|
||||
|
||||
M606 106
|
||||
L648 174
|
||||
H560
|
||||
Z
|
||||
"
|
||||
/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 858 B |
@@ -0,0 +1 @@
|
||||
import{c as I,b as a,B as R,V as F,l as j,R as i,q as $,P as n,aw as Z,h as N,s as D}from"./tauri-compat-tfiFK9EG.js";function U(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};const{prefix:o="",length:s=7}=t,e="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIGKLMNOPQRSTUVWXYZ",l=e.length;let g="";for(let m=0;m<s;m++){const c=Math.floor(Math.random()*l);g+=e.charAt(c)}return o?`${o}-${g}`:g}function H(t,o){if(typeof t=="string")return new Array(o).fill(t);if(Array.isArray(t)){const s=t.length;let e=t;if(s<o){let l=0;for(e=[];l<o;)e.push(t[l%s]),l++;return e}else s>o&&(e=t.slice(0,o));return e.reverse()}return["rgba(233,69,255)","rgba(166,71,255)","rgba(107,97,255)","rgba(46,140,255)"]}var X=function(t,o){var s={};for(var e in t)Object.prototype.hasOwnProperty.call(t,e)&&o.indexOf(e)<0&&(s[e]=t[e]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var l=0,e=Object.getOwnPropertySymbols(t);l<e.length;l++)o.indexOf(e[l])<0&&Object.prototype.propertyIsEnumerable.call(t,e[l])&&(s[e[l]]=t[e[l]]);return s};function G(t){const{fill:o}=t,s=X(t,["fill"]),e=U({prefix:"semi-ai-loading"}),[l,g,m,c]=H(o,4);return a.createElement("svg",Object.assign({viewBox:"0 0 16 16",width:"1em",height:"1em",fill:"none",xmlns:"http://www.w3.org/2000/svg",focusable:!1,"aria-hidden":!0},s),a.createElement("path",{d:"M15.1112 7.99978C15.1112 4.07242 11.9275 0.888672 8.00009 0.888672C5.18219 0.888672 2.74711 2.52771 1.59619 4.90445",stroke:`url(#${e})`,strokeWidth:"1.77778",strokeLinecap:"round"}),a.createElement("defs",null,a.createElement("linearGradient",{id:e,x1:"16",y1:"8",x2:"2.68594",y2:"11.022",gradientUnits:"userSpaceOnUse"},a.createElement("stop",{stopColor:l}),a.createElement("stop",{offset:"0.3",stopColor:g}),a.createElement("stop",{offset:"0.6",stopColor:m}),a.createElement("stop",{offset:"1",stopColor:c,stopOpacity:"0"}))))}const V=I(G,"ai_loading");function q(t){return a.createElement("svg",Object.assign({viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",focusable:!1,"aria-hidden":!0},t),a.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"m10.23 2.4-8.7 16.67A2 2 0 0 0 3.3 22h17.4a2 2 0 0 0 1.77-2.93L13.77 2.4a2 2 0 0 0-3.54 0ZM13.14 14a1.15 1.15 0 0 1-2.28 0l-.58-4.03a1.73 1.73 0 1 1 3.44 0l-.58 4.03Zm.36 4.49a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0Z",fill:"currentColor"}))}const se=I(q,"alert_triangle");function W(t){return a.createElement("svg",Object.assign({viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",focusable:!1,"aria-hidden":!0},t),a.createElement("path",{d:"M17.66 19.78a1.5 1.5 0 0 0 2.12-2.12L14.12 12l5.66-5.66a1.5 1.5 0 0 0-2.12-2.12L12 9.88 6.34 4.22a1.5 1.5 0 1 0-2.12 2.12L9.88 12l-5.66 5.66a1.5 1.5 0 0 0 2.12 2.12L12 14.12l5.66 5.66Z",fill:"currentColor"}))}const re=I(W,"close");function K(t){return a.createElement("svg",Object.assign({viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",focusable:!1,"aria-hidden":!0},t),a.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M12 23a11 11 0 1 0 0-22 11 11 0 0 0 0 22Zm2-16a2 2 0 1 1-4 0 2 2 0 0 1 4 0Zm-5 3.75c0-.41.34-.75.75-.75h2.75a1 1 0 0 1 1 1v5.5h.75a.75.75 0 0 1 0 1.5h-4.5a.75.75 0 0 1 0-1.5h.75v-5h-.75a.75.75 0 0 1-.75-.75Z",fill:"currentColor"}))}const ie=I(K,"info_circle"),B={PREFIX:`${R}-button`},w={sizes:["default","small","large"],iconPositions:["left","right"],htmlTypes:["button","reset","submit"],btnTypes:["primary","secondary","tertiary","warning","danger"],themes:["solid","borderless","light","outline"],DEFAULT_ICON_POSITION:"left"},Q={SIZE:["extra-small","small","default","large","extra-large","custom"]};var Y=function(t,o){var s={};for(var e in t)Object.prototype.hasOwnProperty.call(t,e)&&o.indexOf(e)<0&&(s[e]=t[e]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var l=0,e=Object.getOwnPropertySymbols(t);l<e.length;l++)o.indexOf(e[l])<0&&Object.prototype.propertyIsEnumerable.call(t,e[l])&&(s[e[l]]=t[e[l]]);return s};const J=w.sizes,{htmlTypes:ee,btnTypes:te}=w;let E=class extends a.PureComponent{render(){const o=this.props,{children:s,block:e,htmlType:l,loading:g,circle:m,className:c,style:f,disabled:p,size:P,theme:u,type:h,colorful:C,prefixCls:r,iconPosition:T}=o,y=Y(o,["children","block","htmlType","loading","circle","className","style","disabled","size","theme","type","colorful","prefixCls","iconPosition"]),S=Object.assign(Object.assign({disabled:p},F(y,["x-semi-children-alias"])),{className:j(r,{[`${r}-${h}`]:!p&&h,[`${r}-disabled`]:p,[`${r}-size-large`]:P==="large",[`${r}-size-small`]:P==="small",[`${r}-block`]:e,[`${r}-circle`]:m,[`${r}-${u}`]:u,[`${r}-${h}-disabled`]:p&&h,[`${r}-colorful`]:C},c),type:l,"aria-disabled":p}),O={};return c&&c.includes("-with-icon")||(O["x-semi-prop"]=this.props["x-semi-children-alias"]||"children"),i.createElement("button",Object.assign({},S,{onClick:this.props.onClick,onMouseDown:this.props.onMouseDown,style:f}),i.creaLine truncated
|
||||
@@ -0,0 +1 @@
|
||||
.semi-banner{padding:12px}.semi-banner-content-wrapper{display:flex;flex-direction:row}.semi-banner-description{margin:0}.semi-banner .semi-banner-content-wrapper .semi-banner-content{display:flex;flex:1}.semi-banner-in-container{border-radius:var(--semi-border-radius-small)}.semi-banner-in-container .semi-banner-content-wrapper .semi-banner-content-body{flex:1}.semi-banner-in-container .semi-banner-content-wrapper .semi-banner-content-body .semi-banner-title+.semi-banner-description{margin-top:2px}.semi-banner-full .semi-banner-content-wrapper .semi-banner-content{justify-content:center}.semi-banner-full .semi-banner-content-wrapper .semi-banner-icon,.semi-banner-full .semi-banner-content-wrapper .semi-banner-content-body{display:flex;align-items:center}.semi-banner-close{margin-left:12px;height:24px;width:24px}.semi-banner-extra{margin-top:8px}.semi-banner-icon{display:flex;margin-right:12px}.semi-banner-info{background-color:var(--semi-color-info-light-default);color:var(--semi-color-info)}.semi-banner-info.semi-banner-bordered{border:1px solid var(--semi-color-info)}.semi-banner-warning{background-color:var(--semi-color-warning-light-default);color:var(--semi-color-warning)}.semi-banner-warning.semi-banner-bordered{border:1px solid var(--semi-color-warning)}.semi-banner-success{background-color:var(--semi-color-success-light-default);color:var(--semi-color-success)}.semi-banner-success.semi-banner-bordered{border:1px solid var(--semi-color-success)}.semi-banner-danger{background-color:var(--semi-color-danger-light-default);color:var(--semi-color-danger)}.semi-banner-danger.semi-banner-bordered{border:1px solid var(--semi-color-danger)}.semi-rtl .semi-banner,.semi-portal-rtl .semi-banner{direction:rtl}.semi-rtl .semi-banner-close,.semi-portal-rtl .semi-banner-close{margin-left:0;margin-right:12px;height:24px;width:24px}.semi-rtl .semi-banner-icon,.semi-portal-rtl .semi-banner-icon{margin-right:0;margin-left:12px}
|
||||
@@ -0,0 +1 @@
|
||||
.semi-button-split{display:inline-block}.semi-button-split .semi-button{border-radius:0;margin-right:1px}.semi-button-split .semi-button-first{border-top-left-radius:var(--semi-border-radius-small);border-bottom-left-radius:var(--semi-border-radius-small)}.semi-button-split .semi-button-last{border-top-right-radius:var(--semi-border-radius-small);border-bottom-right-radius:var(--semi-border-radius-small);margin-right:unset}.semi-button-split:hover .semi-button-borderless:active{background-color:var(--semi-color-fill-1)}.semi-button{--semi-button-colorful-multiple-fill-0: rgba(var(--semi-ai-general-5-3));--semi-button-colorful-multiple-fill-1: rgba(var(--semi-ai-general-5-2));--semi-button-colorful-multiple-fill-2: rgba(var(--semi-ai-general-5-1));--semi-button-colorful-multiple-fill-3: rgba(var(--semi-ai-general-5-0));--semi-button-colorful-disabled-fill: var(--semi-color-disabled-text);--semi-button-colorful-fill-primary: var(--semi-color-ai-purple);--semi-button-colorful-fill-secondary: var(--semi-color-text-0)}.semi-button{box-shadow:none;height:32px;display:inline-flex;align-items:center;justify-content:center;cursor:pointer;-webkit-user-select:none;user-select:none;border:0 transparent solid;border-radius:var(--semi-border-radius-small);padding:6px 12px;font-size:14px;line-height:20px;font-weight:600;outline:none;vertical-align:middle;white-space:nowrap}.semi-button.semi-button-primary:focus-visible,.semi-button.semi-button-secondary:focus-visible,.semi-button.semi-button-tertiary:focus-visible,.semi-button.semi-button-warning:focus-visible,.semi-button.semi-button-danger:focus-visible{outline:2px solid var(--semi-color-primary-light-active)}.semi-button-content{display:flex;align-items:center}.semi-button-danger{background-color:var(--semi-color-danger);color:rgba(var(--semi-white),1);transition:background-color var(--semi-transition_duration-none) var(--semi-transition_function-easeIn) var(--semi-transition_delay-none),border var(--semi-transition_duration-none) var(--semi-transition_function-easeIn) var(--semi-transition_delay-none);transform:scale(var(--semi-transform_scale-none))}.semi-button-danger-disabled{background-color:var(--semi-color-disabled-bg)}.semi-button-danger-disabled.semi-button-outline{background-color:transparent;border:1px solid var(--semi-color-border)}.semi-button-danger-disabled.semi-button-light{background-color:var(--semi-color-fill-0)}.semi-button-danger:hover{background-color:var(--semi-color-danger-hover)}.semi-button-danger:active{background-color:var(--semi-color-danger-active)}.semi-button-danger.semi-button-outline{background-color:transparent;border:1px solid var(--semi-color-danger)}.semi-button-danger.semi-button-light,.semi-button-danger.semi-button-outline,.semi-button-danger.semi-button-borderless{color:var(--semi-color-danger)}.semi-button-danger:not(.semi-button-borderless):not(.semi-button-light):focus-visible{outline:2px solid var(--semi-color-danger-light-active)}.semi-button-warning{background-color:var(--semi-color-warning);color:rgba(var(--semi-white),1);transition:background-color var(--semi-transition_duration-none) var(--semi-transition_function-easeIn) var(--semi-transition_delay-none),border var(--semi-transition_duration-none) var(--semi-transition_function-easeIn) var(--semi-transition_delay-none);transform:scale(var(--semi-transform_scale-none))}.semi-button-warning-disabled{background-color:var(--semi-color-disabled-bg)}.semi-button-warning-disabled.semi-button-outline{background-color:transparent;border:1px solid var(--semi-color-border)}.semi-button-warning-disabled.semi-button-light{background-color:var(--semi-color-fill-0)}.semi-button-warning:hover{background-color:var(--semi-color-warning-hover)}.semi-button-warning:active{background-color:var(--semi-color-warning-active)}.semi-button-warning.semi-button-outline{background-color:transparent;border:1px solid var(--semi-color-warning)}.semi-button-warning.semi-button-light,.semi-button-warning.semi-button-outline,.semi-button-warning.semi-button-borderless{color:var(--semi-color-warning)}.semi-button-warning:not(.semi-button-borderless):not(.semi-button-light):focus-visible{outline:2px solid var(--semi-color-warning-light-active)}.semi-button-tertiary{background-color:var(--semi-color-tertiary);color:rgba(var(--semi-white),1);transition:background-color var(--semi-transition_duration-none) var(--semi-transition_function-easeIn) var(--semi-transition_delay-none),border var(--semi-transition_duration-none) var(--semi-transition_function-easeIn) var(--semi-transition_delay-none);transform:scale(var(--semi-transform_scale-none))}.semi-button-tertiary.semi-button-colorful.semi-button-solid{background:var(--semi-ai-general-0)}.semi-button-tertiary.semi-button-colorful.semi-button-solid:hover{background:var(--semi-ai-general-1)}.semi-button-tertiary.semi-button-colorful.semi-button-solid:active{background:var(--semi-ai-general-2)}.semi-button-tertiary.semi-button-colorful.semi-button-solid .semi-Line truncated
|
||||
@@ -0,0 +1 @@
|
||||
import{B as f,f as y,k as h,R as l,aw as S,l as _,P as a,s as b}from"./tauri-compat-tfiFK9EG.js";const O=`${f}-spin`,E={PREFIX:O},P={SIZE:["small","middle","large"]};class d extends y{static get spinDefaultAdapter(){return{getProp:()=>{},setLoading:e=>{}}}constructor(e){super(Object.assign(Object.assign({},d.spinDefaultAdapter),e))}updateLoadingIfNeedDelay(){const{spinning:e,delay:n}=this._adapter.getProps(),{delay:t}=this._adapter.getStates();if(t){const s=this;this._timer=setTimeout(()=>{s._adapter.setState({loading:e,delay:0})},n)}}destroy(){this._timer&&(clearTimeout(this._timer),this._timer=null)}}var j=function(i,e){var n={};for(var t in i)Object.prototype.hasOwnProperty.call(i,t)&&e.indexOf(t)<0&&(n[t]=i[t]);if(i!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,t=Object.getOwnPropertySymbols(i);s<t.length;s++)e.indexOf(t[s])<0&&Object.prototype.propertyIsEnumerable.call(i,t[s])&&(n[t[s]]=i[t[s]]);return n};const r=E.PREFIX;class o extends h{constructor(e){super(e),this.foundation=new d(this.adapter),this.state={delay:e.delay,loading:!0}}static getDerivedStateFromProps(e){return e.delay?e.spinning===!1?{delay:0,loading:!1}:{delay:e.delay}:{loading:e.spinning}}get adapter(){return Object.assign(Object.assign({},super.adapter),{setLoading:e=>{this.setState({loading:e})}})}componentWillUnmount(){this.foundation.destroy()}renderSpin(){const{indicator:e,tip:n}=this.props,{loading:t}=this.state;return t?l.createElement("div",{className:`${r}-wrapper`},e?l.createElement("div",{className:`${r}-animate`,"x-semi-prop":"indicator"},e):l.createElement(S,null),n?l.createElement("div",{"x-semi-prop":"tip"},n):null):null}render(){this.foundation.updateLoadingIfNeedDelay();const e=this.props,{children:n,style:t,wrapperClassName:s,childStyle:c,size:p}=e,m=j(e,["children","style","wrapperClassName","childStyle","size"]),{loading:u}=this.state,g=_(r,s,{[`${r}-${p}`]:p,[`${r}-block`]:n,[`${r}-hidden`]:!u});return l.createElement("div",Object.assign({className:g,style:t},this.getDataAttr(m)),this.renderSpin(),l.createElement("div",{className:`${r}-children`,style:c,"x-semi-prop":"children"},n))}}o.propTypes={size:a.oneOf(P.SIZE),spinning:a.bool,children:a.node,indicator:a.node,delay:a.number,tip:a.node,wrapperClassName:a.string,childStyle:a.object,style:a.object};o.__SemiComponentName__="Spin";o.defaultProps=b(o.__SemiComponentName__,{size:"middle",spinning:!0,children:null,indicator:null,delay:0});export{o as S};
|
||||
@@ -0,0 +1 @@
|
||||
.semi-spin{position:relative;display:inline-block;width:20px;height:20px}@keyframes semi-animation-rotate{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.semi-spin-wrapper{text-align:center;position:absolute;width:100%;transform:translateY(-50%);top:50%;color:var(--semi-color-primary)}.semi-spin-wrapper>svg{display:inline;animation:.6s linear infinite semi-animation-rotate;animation-fill-mode:forwards;vertical-align:top;width:20px;height:20px}.semi-spin-animate{display:inline-flex;animation:1.6s linear infinite semi-animation-rotate;animation-fill-mode:forwards}.semi-spin-children{opacity:.5;-webkit-user-select:none;user-select:none}.semi-spin-block{display:block}.semi-spin-block:after{content:"";position:absolute;top:0;left:0;width:100%;height:100%;z-index:1}.semi-spin-block .semi-spin-wrapper{display:block}.semi-spin-block.semi-spin{height:auto;width:auto}.semi-spin-hidden:after{content:none}.semi-spin-hidden>.semi-spin-children{opacity:1;-webkit-user-select:auto;user-select:auto}.semi-spin-small{width:14px;height:14px}.semi-spin-small>.semi-spin-wrapper svg{width:14px;height:14px}.semi-spin-middle{width:20px;height:20px}.semi-spin-middle>.semi-spin-wrapper svg{width:20px;height:20px}.semi-spin-large{width:32px;height:32px}.semi-spin-large>.semi-spin-wrapper svg{width:32px;height:32px}.semi-spin-container{overflow:hidden}.semi-rtl .semi-spin,.semi-portal-rtl .semi-spin,.semi-rtl .semi-spin-container,.semi-portal-rtl .semi-spin-container{direction:rtl}
|
||||
@@ -0,0 +1 @@
|
||||
import{B as g,f as y,k as E,w as C,R as t,l as m,T as u,U as $,S as v,P as o}from"./tauri-compat-tfiFK9EG.js";import{a as I,I as N,b as x,c as B}from"./index-Bpi3BHKj.js";const P={PREFIX:`${g}-banner`},w={TYPE:["info","success","danger","warning"]};class l extends y{constructor(e){super(Object.assign(Object.assign({},l.defaultAdapter),e))}removeBanner(e){this._adapter.notifyClose(e),this._adapter.setVisible()}}const n=P.PREFIX,T=w.TYPE;class h extends E{constructor(e){super(e),this.remove=s=>{s&&s.stopPropagation(),this.foundation.removeBanner(s)},this.state={visible:!0},C("target"in this.props,"[Semi Banner] 'target' has been deprecated, please write JSX directly instead.")}get adapter(){return Object.assign(Object.assign({},super.adapter),{setVisible:()=>{this.setState({visible:!1})},notifyClose:e=>{const{onClose:s}=this.props;s(e)}})}componentDidMount(){this.foundation=new l(this.adapter),this.foundation.init()}componentWillUnmount(){this.foundation.destroy()}renderCloser(){const{closeIcon:e}=this.props;return e===null?e:t.createElement(I,{className:`${n}-close`,onClick:this.remove,icon:e||t.createElement(N,{"x-semi-prop":"closeIcon","aria-hidden":!0}),theme:"borderless",size:"small",type:"tertiary","aria-label":"Close"})}renderIcon(){const{type:e,icon:s}=this.props;let a={warning:t.createElement(B,{size:"large","aria-label":"warning"}),success:t.createElement(v,{size:"large","aria-label":"success"}),info:t.createElement(x,{size:"large","aria-label":"info"}),danger:t.createElement($,{size:"large","aria-label":"danger"})}[e];const r=m({[`${n}-icon`]:!0});return typeof s<"u"&&(a=s),a?t.createElement("div",{className:r,"x-semi-prop":"icon"},a):null}render(){const{children:e,type:s,className:c,style:a,bordered:r,title:p,description:d,fullMode:i}=this.props,{visible:b}=this.state,f=m(n,c,{[`${n}-${s}`]:s,[`${n}-full`]:i,[`${n}-in-container`]:!i,[`${n}-bordered`]:!i&&r});return b?t.createElement("div",Object.assign({className:f,style:a,role:"alert"},this.getDataAttr(this.props)),t.createElement("div",{className:`${n}-content-wrapper`},t.createElement("div",{className:`${n}-content`},this.renderIcon(),t.createElement("div",{className:`${n}-content-body`},p?t.createElement(u.Title,{heading:5,className:`${n}-title`,component:"div","x-semi-prop":"title"},p):null,d?t.createElement(u.Paragraph,{className:`${n}-description`,component:"div","x-semi-prop":"description"},d):null)),this.renderCloser()),e?t.createElement("div",{className:`${n}-extra`,"x-semi-prop":"children"},e):null):null}}h.propTypes={fullMode:o.bool,type:o.oneOf(T),title:o.node,description:o.node,icon:o.node,closeIcon:o.node,children:o.node,style:o.object,className:o.string,onClose:o.func,bordered:o.bool};h.defaultProps={onClose:()=>{},type:"info",fullMode:!0};export{h as B};
|
||||
@@ -0,0 +1,4 @@
|
||||
import{g as te,C as _t,c as Oe,b as L,R as b,P as a,B as X,f as ge,i as Ce,l as M,au as qt,aR as va,ad as Ca,aS as Gt,aT as Qo,aU as Jo,K as ei,L as _a,D as Oa,aV as ti,aW as Ra,aX as Ea,aY as ni,v as xa,y as Ta,N as x,aZ as Ps,n as ft,w as $e,a_ as Yt,h as H,k as he,o as jt,aL as re,a$ as Ia,b0 as As,a as Pa,u as si,b1 as Aa,b2 as Da,b3 as ri,G as oi,b4 as Na,b5 as Ds,t as ii,b6 as Ns,b7 as ai,b8 as ka,b9 as li,M as La,_ as ue,az as Pt,s as ks,a0 as Ma,V as ye,J as je,p as Et,E as ja,ae as Xt,aQ as yt,X as Ee,aa as za,ba as Fa,bb as Ka,bc as $a,bd as Ba,m as hr,O as Ls,aH as ci,ag as Ms,be as Ha,bf as Wa,bg as le,bh as Ua,x as di,A as Va,bi as Zt,ax as Ne,bj as qa,bk as we,ab as ui,Y as hi,j as Ae,bl as Ga,bm as Ya,d as Xa,e as Za,aJ as Qa,bn as Ja,H as el,bo as St,bp as pr,bq as zt,br as tl}from"./tauri-compat-tfiFK9EG.js";import{_ as gt,r as nl,o as pi,p as sl,q as rl,v as ol,w as il,x as fi,y as al,T as mt,z as gi,F as fr,I as ll,A as cl,D as gr,G as Fe,R as dl,a as Re,j as ul}from"./main-Knf6L_en.js";import{S as mi}from"./index-D_sWIqse.js";import{B as Ft,I as hl}from"./index-Bpi3BHKj.js";const pl=["default","error","warning","success"];var fl=_t();const gl=te(fl);function mr(i){if(i===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return i}function _s(i,e){return _s=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,n){return t.__proto__=n,t},_s(i,e)}function ml(i){return L.createElement("svg",Object.assign({viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",focusable:!1,"aria-hidden":!0},i),L.createElement("path",{d:"m17.55 15.66-4.8 5.48a1 1 0 0 1-1.5 0l-4.8-5.48A1 1 0 0 1 7.2 14h9.6a1 1 0 0 1 .75 1.66Z",fill:"currentColor"}))}const bl=Oe(ml,"caretdown");function yl(i){return L.createElement("svg",Object.assign({viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",focusable:!1,"aria-hidden":!0},i),L.createElement("path",{d:"m6.45 8.34 4.8-5.48a1 1 0 0 1 1.5 0l4.8 5.48A1 1 0 0 1 16.8 10H7.2a1 1 0 0 1-.75-1.66Z",fill:"currentColor"}))}const Sl=Oe(yl,"caretup");function wl(i){return L.createElement("svg",Object.assign({viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",focusable:!1,"aria-hidden":!0},i),L.createElement("path",{d:"M5 12.5c0-.83.67-1.5 1.5-1.5h11a1.5 1.5 0 0 1 0 3h-11A1.5 1.5 0 0 1 5 12.5Z",fill:"currentColor"}))}const vl=Oe(wl,"checkbox_indeterminate");function Cl(i){return L.createElement("svg",Object.assign({viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",focusable:!1,"aria-hidden":!0},i),L.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M17.41 7.3c.66.51.78 1.45.28 2.11l-6.5 8.5a1.5 1.5 0 0 1-2.37.01l-3.5-4.5a1.5 1.5 0 1 1 2.36-1.84L10 14.54l5.32-6.95a1.5 1.5 0 0 1 2.1-.28Z",fill:"currentColor"}))}const _l=Oe(Cl,"checkbox_tick");function Ol(i){return L.createElement("svg",Object.assign({viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",focusable:!1,"aria-hidden":!0},i),L.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M16.28 4.24a1.5 1.5 0 0 1 0 2.12l-5.66 5.66 5.66 5.65a1.5 1.5 0 1 1-2.12 2.13l-6.72-6.72a1.5 1.5 0 0 1 0-2.12l6.72-6.72a1.5 1.5 0 0 1 2.12 0Z",fill:"currentColor"}))}const bi=Oe(Ol,"chevron_left");function Rl(i){return L.createElement("svg",Object.assign({viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",focusable:!1,"aria-hidden":!0},i),L.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M7.44 19.8a1.5 1.5 0 0 1 0-2.13l5.66-5.65-5.66-5.66a1.5 1.5 0 1 1 2.12-2.12l6.72 6.72a1.5 1.5 0 0 1 0 2.12L9.56 19.8a1.5 1.5 0 0 1-2.12 0Z",fill:"currentColor"}))}const js=Oe(Rl,"chevron_right");function El(i){return L.createElement("svg",Object.assign({viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",focusable:!1,"aria-hidden":!0},i),L.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M1.1 2.58A1 1 0 0 1 2 2h20a1 1 0 0 1 .76 1.65l-8.2 9.18V21a1 1 0 0 1-1.44.9l-3.07-2a1 1 0 0 1-.55-.9v-6.17L1.24 3.65a1 1 0 0 1-.15-1.07Z",fill:"currentColor"}))}const xl=Oe(El,"filter");function Tl(i){return L.createElement("svg",Object.assign({viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",focusable:!1,"aria-hidden":!0},i),L.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M10.5 2a8.5 8.5 0 1 0 4.86 15.48l4.08 4.08a1.5 1.5 0 1 0 2.12-2.12l-4.08-4.08A8.5 8.5 0 0 0 10.5 2ZM5 10.5a5.5 5.5 0 1 1 11 0 5.5 5.5 0 0 1-11 0Z",fill:"currentColor"}))}const Il=Oe(Tl,"search");function Pl(i){return L.createElement("svg",Object.assign({viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",focusable:!1,"aria-hidden":!0},i),L.createElement("path",{d:"m20.56 9.66-7.8 8.97a1 1 0 0 1-1.51 0L3.44 9.66A1 1 0 0 1 4.19 8h15.62a1 1 0
Line truncated
|
||||
Please note that this is not a legal way to use it`);return}t?n=e:n=e.map(r=>r.value),this.handleValueChange(n),this._adapter.notifyChange(n)}checkMultipleProps(e){if(this._isMultiple()){const t=e||this.getProps(),{defaultValue:n,value:s}=t,r=s||n;!Xt(r)&&!Array.isArray(r)&&$e(!0,"[Semi Select] defaultValue/value should be array type in multiple mode")}}updateScrollTop(){this._adapter.updateScrollTop()}updateOverflowItemCount(e,t){const{maxTagCount:n,ellipsisTrigger:s}=this.getProps();s&&(t?this._adapter.updateOverflowItemCount(t):typeof n=="number"&&(e-n>0?this._adapter.updateOverflowItemCount(e-n):this._adapter.updateOverflowItemCount(0)))}updateIsFullTags(){const{isFullTags:e}=this.getStates();e||this._adapter.setState({isFullTags:!0})}handlePopoverClose(){this._adapter.emit("popoverClose")}handleSlotMouseEnter(){this._adapter.updateFocusIndex(-1)}}const lt=al.PREFIX,Ki=gi.TAG_SIZE,Rd=gi.AVATAR_SHAPE;class Ht extends L.PureComponent{renderNTag(e,t){const{size:n,showPopover:s,popoverProps:r,onPlusNMouseEnter:o}=this.props;let l=b.createElement(mt,{closable:!1,size:n,color:"grey",style:{backgroundColor:"transparent"},key:"_+n",onMouseEnter:o},"+",e);return s&&(l=b.createElement(yt,Object.assign({showArrow:!0,content:t,trigger:"hover",position:"top",autoAdjustOverflow:!0,className:`${lt}-rest-group-popover`},r,{key:"_+n_Popover"}),l)),l}renderMergeTags(e){const{maxTagCount:t,tagList:n,restCount:s}=this.props,r=s||n.length-t;let o=e;const l=e.slice(0,t),c=e.slice(t);let d=null;return r>0&&(d=this.renderNTag(r,c),l.push(d),o=l),o}renderAllTags(){const{tagList:e,size:t,mode:n,avatarShape:s,onTagClose:r}=this.props;return e.map(l=>{if(n==="custom")return l;const c=Object.assign({},l);return c.size||(c.size=t),c.avatarShape||(c.avatarShape=s),c.tagKey||(typeof c.children=="string"||typeof c.children=="number"?c.tagKey=c.children:c.tagKey=Math.random()),b.createElement(mt,Object.assign({},c,{key:c.tagKey,onClose:(d,u,h)=>{c.onClose&&c.onClose(d,u,h),r&&r(d,u,h)}}))})}render(){const{style:e,className:t,maxTagCount:n,size:s}=this.props,r=M({[`${lt}-group`]:!0,[`${lt}-group-max`]:n,[`${lt}-group-small`]:s==="small",[`${lt}-group-large`]:s==="large"},t),o=this.renderAllTags(),l=typeof n>"u"?o:this.renderMergeTags(o);return b.createElement("div",{style:e,className:r},l)}}Ht.defaultProps={style:{},className:"",size:Ki[0],avatarShape:"square",onTagClose:()=>{},onPlusNMouseEnter:()=>{}};Ht.propTypes={children:a.node,style:a.object,className:a.string,maxTagCount:a.number,restCount:a.number,tagList:a.array,size:a.oneOf(Ki),mode:a.string,onTagClose:a.func,showPopover:a.bool,popoverProps:a.object,avatarShape:a.oneOf(Rd)};var Ed=function(i,e){var t={};for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&e.indexOf(n)<0&&(t[n]=i[n]);if(i!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,n=Object.getOwnPropertySymbols(i);s<n.length;s++)e.indexOf(n[s])<0&&Object.prototype.propertyIsEnumerable.call(i,n[s])&&(t[n[s]]=i[n[s]]);return t};const so=(i,e,t,n)=>{const s=i.props;if(!i||!s)return null;const r=Object.assign(Object.assign({value:s.value,label:s.label||s.children||s.value,_show:!0,_selected:!1,_scrollIndex:t},s),{_parentGroup:e});return r._keyInJsx=n||i.key,r},xd=i=>{let e=[],t=[];const n={label:"",children:[],_show:!1};let s=b.Children.toArray(i);s=s.filter(l=>l&&l.props);let r="",o=-1;return s.forEach(l=>{if(l.type.isSelectOption){r="option",o++;const c=so(l,void 0,o);n.children.push(c),t.push(c)}else if(l.type.isSelectOptionGroup){r="group";let c=l.props,{children:d}=c,u=Ed(c,["children"]);u.key=l.key;let h=[];Array.isArray(d)?h=d.map(y=>y.key):h.push(d.key),d=b.Children.toArray(d);const g=d.map((y,p)=>{let f=y.key;return h[p]===null&&(f=l.key+""+y.key),o++,so(y,u,o,f)}),m=Object.assign(Object.assign({},l.props),{children:g,key:l.key});e.push(m),t=t.concat(g)}else $e(!0,"[Semi Select] The children of `Select` should be `Select.Option` or `Select.OptionGroup`")}),r==="option"&&(e=[n]),{optionGroups:e,options:t}},Td=i=>{let{index:e,data:t,style:n}=i;const{visibleOptions:s,renderOption:r}=t,o=s[e];return r(o,e,n)};var ro=function(i,e){var t={};for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&e.indexOf(n)<0&&(t[n]=i[n]);if(i!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,n=Object.getOwnPropertySymbols(i);s<n.length;s++)e.indexOf(n[s])<0&&Object.prototype.propertyIsEnumerable.call(i,n[s])&&(t[n[s]]=i[n[s]]);return t};let He=class extends L.PureComponent{onClick(e,t){var{value:n,label:s,children:r}=e,o=ro(e,["value","label","children"]);const{props:l}=this;l.disabled||l.onSelect(Object.assign(Object.assign({},o),{value:n,label:s||r}),t)}renderOptionContent(e){let{config:t,children:n,inputValue:s,prefixCls:r}=e;return Ce(n)&&s?b.createElement(zs,{searchWords:t.searchWords,sourceString:t.sourceString,highlightClassName:t.highlightClassName}):n}render(){const e=this.props,{children:t,disabled:n,value:s,selected:r,label:o,empty:l,emptyContent:c,onSelect:d,focused:u,
Line truncated
|
||||
`,T.innerHTML+=`.react-draggable-transparent-selection *::selection {all: inherit;}
|
||||
`,C.getElementsByTagName("head")[0].appendChild(T)}C.body&&pa(C.body,"react-draggable-transparent-selection")}function or(C){window.requestAnimationFrame?window.requestAnimationFrame(()=>{ir(C)}):ir(C)}function ir(C){if(C)try{C.body&&fa(C.body,"react-draggable-transparent-selection");const R=C.selection;if(R)R.empty();else{const T=(C.defaultView||window).getSelection();T&&T.type!=="Caret"&&T.removeAllRanges()}}catch{}}function pa(C,R){C.classList?C.classList.add(R):C.className.match(new RegExp(`(?:^|\\s)${R}(?!\\S)`))||(C.className+=` ${R}`)}function fa(C,R){C.classList?C.classList.remove(R):C.className=C.className.replace(new RegExp(`(?:^|\\s)${R}(?!\\S)`,"g"),"")}function ga(C,R,T){if(!C.props.bounds)return[R,T];let{bounds:D}=C.props;D=typeof D=="string"?D:ya(D);const j=fn(C);if(typeof D=="string"){const{ownerDocument:J}=j,Y=J.defaultView;if(!Y)throw new Error("Cannot resolve the owner window of the draggable node.");let ee;if(D==="parent"?ee=j.parentNode:ee=j.getRootNode().querySelector(D),!(ee instanceof Y.HTMLElement))throw new Error('Bounds selector "'+D+'" could not find an element.');const fe=ee,Me=Y.getComputedStyle(j),Ue=Y.getComputedStyle(fe);D={left:-j.offsetLeft+w(Ue.paddingLeft)+w(Me.marginLeft),top:-j.offsetTop+w(Ue.paddingTop)+w(Me.marginTop),right:G(fe)-V(j)-j.offsetLeft+w(Ue.paddingRight)-w(Me.marginRight),bottom:W(fe)-q(j)-j.offsetTop+w(Ue.paddingBottom)-w(Me.marginBottom)}}return v(D.right)&&(R=Math.min(R,D.right)),v(D.bottom)&&(T=Math.min(T,D.bottom)),v(D.left)&&(R=Math.max(R,D.left)),v(D.top)&&(T=Math.max(T,D.top)),[R,T]}function ar(C,R,T){const D=Math.round(R/C[0])*C[0],j=Math.round(T/C[1])*C[1];return[D,j]}function ma(C){return C.props.axis==="both"||C.props.axis==="x"}function ba(C){return C.props.axis==="both"||C.props.axis==="y"}function un(C,R,T){const D=typeof R=="number"?de(C,R):null;if(typeof R=="number"&&!D)return null;const j=fn(T),J=T.props.offsetParent||j.offsetParent||j.ownerDocument.body;return se(D||C,J,T.props.scale)}function hn(C,R,T){const D=!v(C.lastX),j=fn(C);return D?{node:j,deltaX:0,deltaY:0,lastX:R,lastY:T,x:R,y:T}:{node:j,deltaX:R-C.lastX,deltaY:T-C.lastY,lastX:C.lastX,lastY:C.lastY,x:R,y:T}}function pn(C,R){const T=C.props.scale;return{node:R.node,x:C.state.x+R.deltaX/T,y:C.state.y+R.deltaY/T,deltaX:R.deltaX/T,deltaY:R.deltaY/T,lastX:C.state.x,lastY:C.state.y}}function ya(C){return{left:C.left,top:C.top,right:C.right,bottom:C.bottom}}function fn(C){const R=C.findDOMNode();if(!R)throw new Error("<DraggableCore>: Unmounted during event!");return R}var gn=d(St()),ae=d(zt()),Sa=d(pr());function Se(...C){i.DRAGGABLE_DEBUG&&console.log(...C)}var me={touch:{start:"touchstart",move:"touchmove",stop:"touchend"},mouse:{start:"mousedown",move:"mousemove",stop:"mouseup"}},Ie=me.mouse,Le=class extends gn.Component{constructor(){super(...arguments),this.dragging=!1,this.lastX=NaN,this.lastY=NaN,this.touchIdentifier=null,this.mounted=!1,this.handleDragStart=C=>{if(this.props.onMouseDown(C),!this.props.allowAnyClick&&(typeof C.button=="number"&&C.button!==0||C.ctrlKey))return!1;const R=this.findDOMNode();if(!R||!R.ownerDocument||!R.ownerDocument.body)throw new Error("<DraggableCore> not mounted on DragStart!");const{ownerDocument:T}=R;if(this.props.disabled||!(C.target instanceof T.defaultView.Node)||this.props.handle&&!F(C.target,this.props.handle,R)||this.props.cancel&&F(C.target,this.props.cancel,R))return;C.type==="touchstart"&&!this.props.allowMobileScroll&&C.preventDefault();const D=ie(C);this.touchIdentifier=D;const j=un(C,D,this);if(j==null)return;const{x:J,y:Y}=j,ee=hn(this,J,Y);Se("DraggableCore: handleDragStart: %j",ee),Se("calling",this.props.onStart),!(this.props.onStart(C,ee)===!1||this.mounted===!1)&&(this.props.enableUserSelectHack&&ha(T,this.props.nonce),this.dragging=!0,this.lastX=J,this.lastY=Y,K(T,Ie.move,this.handleDrag),K(T,Ie.stop,this.handleDragStop))},this.handleDrag=C=>{const R=un(C,this.touchIdentifier,this);if(R==null)return;let{x:T,y:D}=R;if(Array.isArray(this.props.grid)){let Y=T-this.lastX,ee=D-this.lastY;if([Y,ee]=ar(this.props.grid,Y,ee),!Y&&!ee)return;T=this.lastX+Y,D=this.lastY+ee}const j=hn(this,T,D);if(Se("DraggableCore: handleDrag: %j",j),this.props.onDrag(C,j)===!1||this.mounted===!1){try{this.handleDragStop(new MouseEvent("mouseup"))}catch{const Y=document.createEvent("MouseEvents");Y.initMouseEvent("mouseup",!0,!0,window,0,0,0,0,0,!1,!1,!1,!1,0,null),this.handleDragStop(Y)}return}this.lastX=T,this.lastY=D},this.handleDragStop=C=>{if(!this.dragging)return;const R=un(C,this.touchIdentifier,this);if(R==null)return;let{x:T,y:D}=R;if(Array.isArray(this.props.grid)){let ee=T-this.lastX||0,fe=D-this.lastY||0;[ee,fe]=ar(this.props.grid,ee,fe),T=this.lastX+ee,D=this.lastY+fe}const j=hn(this,T,D);if(this.props.onStop(C,j)===!1||this.mounted===!1)return!1;const Y=this.findDOMNode();Y&&this.props.enableUserSelectHack&&or(Y.ownerDocument),Se("DraggableCore: handleDragStop: %j",j),this.dragging=!1,this.lastX=NaN,this.lastY=NaN,Y&&(Se("DraggableCore
Line truncated
|
||||
@@ -0,0 +1 @@
|
||||
.semi-highlight-tag{color:var(--semi-color-highlight);background-color:var(--semi-color-highlight-bg);font-weight:600}.semi-space{display:inline-flex}.semi-space-vertical{flex-direction:column}.semi-space-horizontal{flex-direction:row}.semi-space-align-center{align-items:center}.semi-space-align-end{align-items:flex-end}.semi-space-align-start{align-items:flex-start}.semi-space-align-baseline{align-items:baseline}.semi-space-wrap{flex-wrap:wrap}.semi-space-tight-horizontal{column-gap:8px}.semi-space-tight-vertical{row-gap:8px}.semi-space-medium-horizontal{column-gap:16px}.semi-space-medium-vertical{row-gap:16px}.semi-space-loose-horizontal{column-gap:24px}.semi-space-loose-vertical{row-gap:24px}.semi-rtl .semi-space,.semi-portal-rtl .semi-space{direction:rtl}.semi-checkbox{box-sizing:border-box;position:relative;display:flex;align-items:flex-start;font-size:14px;line-height:20px;font-family:Inter,-apple-system,BlinkMacSystemFont,PingFang SC,Hiragino Sans GB,Microsoft YaHei,Segoe UI,Helvetica Neue,Helvetica,Arial,sans-serif;cursor:pointer;transition:background-color var(--semi-transition_duration-none) var(--semi-transition_function-easeIn) var(--semi-transition_delay-none),border var(--semi-transition_duration-none) var(--semi-transition_function-easeIn) var(--semi-transition_delay-none);transform:scale(var(--semi-transform_scale-none));column-gap:8px}.semi-checkbox input[type=checkbox]{position:absolute;left:0;top:0;width:100%;height:100%;margin:0;opacity:0}.semi-checkbox-content{flex:1;display:flex;flex-direction:column;row-gap:4px}.semi-checkbox-addon{display:flex;flex:1;align-items:center;color:var(--semi-color-text-0);line-height:20px;-webkit-user-select:none;user-select:none}.semi-checkbox:hover .semi-checkbox-inner-display{background:var(--semi-color-fill-0);box-shadow:inset 0 0 0 1px var(--semi-color-focus-border)}.semi-checkbox:hover .semi-checkbox-inner-checked .semi-checkbox-inner-display{background:var(--semi-color-primary-hover);box-shadow:none}.semi-checkbox:active .semi-checkbox-inner-checked .semi-checkbox-inner-display{background:var(--semi-color-primary-active);box-shadow:none}.semi-checkbox.semi-checkbox-disabled:hover .semi-checkbox-inner-display,.semi-checkbox.semi-checkbox-disabled:active .semi-checkbox-inner-display{background:var(--semi-color-disabled-fill);box-shadow:inset 0 0 0 1px var(--semi-color-border)}.semi-checkbox.semi-checkbox-disabled:hover .semi-checkbox-inner-checked .semi-checkbox-inner-display,.semi-checkbox.semi-checkbox-disabled:active .semi-checkbox-inner-checked .semi-checkbox-inner-display{color:var(--semi-color-white);background:var(--semi-color-primary-disabled);box-shadow:none}.semi-checkbox-inner{position:relative;display:flex;align-items:center;width:16px;height:20px;-webkit-user-select:none;user-select:none;cursor:pointer}.semi-checkbox-inner-display{box-sizing:border-box;position:relative;width:16px;height:16px;margin:0;background:transparent;transition:background-color var(--semi-transition_duration-none) var(--semi-transition_function-easeIn) var(--semi-transition_delay-none),border var(--semi-transition_duration-none) var(--semi-transition_function-easeIn) var(--semi-transition_delay-none);box-shadow:inset 0 0 0 1px var(--semi-color-text-3);border-radius:var(--semi-border-radius-extra-small)}.semi-checkbox-inner-display .semi-icon{font-size:16px}.semi-checkbox-inner-checked .semi-checkbox-inner-display{background:var(--semi-color-primary);color:var(--semi-color-white);box-shadow:inset 0 0 0 1px var(--semi-color-primary);border-radius:var(--semi-border-radius-extra-small)}.semi-checkbox-inner-checked>.semi-checkbox-addon{color:var(--semi-color-text-0)}.semi-checkbox:hover .semi-checkbox-inner-display{background:var(--semi-color-fill-0)}.semi-checkbox:hover.semi-checkbox-indeterminate .semi-checkbox-inner-display{background:var(--semi-color-primary-hover);box-shadow:none;color:var(--semi-color-white)}.semi-checkbox:hover .semi-checkbox-inner-checked .semi-checkbox-inner-display{background:var(--semi-color-primary-hover);border-color:var(--semi-color-primary-hover);color:var(--semi-color-white)}.semi-checkbox:hover.semi-checkbox-cardType.semi-checkbox-unChecked.semi-checkbox-cardType_enable .semi-checkbox-inner-display{background:var(--semi-color-white)}.semi-checkbox:active .semi-checkbox-inner-display{background:var(--semi-color-fill-1)}.semi-checkbox:active.semi-checkbox-indeterminate .semi-checkbox-inner-display{background:var(--semi-color-primary-active);border-color:var(--semi-color-primary-active);color:var(--semi-color-white);box-shadow:none}.semi-checkbox:active .semi-checkbox-inner-checked .semi-checkbox-inner-display{background:var(--semi-color-primary-active);border-color:var(--semi-color-primary-active);color:var(--semi-color-white)}.semi-checkbox:active.semi-checkbox-cardType.semi-checkbox-unChecked.semi-checkbox-cardType_enable .semi-checkbox-inner-display{background:var(--semi-color-white)}.semi-checkbox-cardType{flex-wrap:nowrap;align-itemLine truncated
|
||||
@@ -0,0 +1 @@
|
||||
.semi-progress{display:flex;align-items:center}.semi-progress-track{background-color:var(--semi-color-fill-0);border-radius:var(--semi-border-radius-small)}.semi-progress-horizontal{height:4px;margin-top:4px;margin-bottom:4px}.semi-progress-horizontal.semi-progress-large{height:6px}.semi-progress-horizontal .semi-progress-track{height:100%;width:100%}.semi-progress-horizontal .semi-progress-track-inner{height:100%;background-color:var(--semi-color-success);border-radius:var(--semi-border-radius-small);transition:width .3s;transition-timing-function:cubic-bezier(.62,.05,.36,.95)}.semi-progress-horizontal .semi-progress-line-text{min-width:45px;font-weight:600;margin-left:16px;color:var(--semi-color-text-0)}.semi-progress-vertical{width:4px;display:inline-flex;height:100%;margin-left:4px;margin-right:4px;flex-direction:column}.semi-progress-vertical.semi-progress-large{width:6px}.semi-progress-vertical .semi-progress-track{height:100%;width:100%}.semi-progress-vertical .semi-progress-track-inner{background-color:var(--semi-color-success);border-radius:var(--semi-border-radius-small);width:100%;transition:height .3s;transition-timing-function:cubic-bezier(.62,.05,.36,.95)}.semi-progress-vertical .semi-progress-line-text{font-weight:600;margin-top:8px}.semi-progress-circle{position:relative;display:inline-block}.semi-progress-circle-ring{display:block}.semi-progress-circle-ring-track{stroke:var(--semi-color-fill-0)}.semi-progress-circle-ring-inner{transition:stroke-dashoffset .3s;transition-timing-function:cubic-bezier(.62,.05,.36,.95);transform:rotate(-90deg);transform-origin:50% 50%;stroke:var(--semi-color-success)}.semi-progress-circle-text{position:absolute;top:50%;left:50%;width:100%;text-align:center;transform:translate(-50%,-50%);-webkit-user-select:none;user-select:none;color:var(--semi-color-mode-minor-text)}.semi-rtl .semi-progress,.semi-portal-rtl .semi-progress{direction:rtl}.semi-rtl .semi-progress-horizontal .semi-progress-line-text,.semi-portal-rtl .semi-progress-horizontal .semi-progress-line-text{margin-left:0;margin-right:16px}.semi-rtl .semi-progress-circle-ring-inner,.semi-portal-rtl .semi-progress-circle-ring-inner{transform:rotate(-90deg);transform-origin:50% 50%}.semi-rtl .semi-progress-circle-text,.semi-portal-rtl .semi-progress-circle-text{left:auto;right:50%;transform:translate(50%,-50%)}:root{font-family:-apple-system,BlinkMacSystemFont,SF Pro Text,Segoe UI,Microsoft YaHei UI,Helvetica Neue,sans-serif;background:var(--semi-color-bg-0);color:var(--semi-color-text-0)}*{box-sizing:border-box}html,body,#loading-root{width:100%;height:100%;margin:0}body{overflow:hidden;background:var(--semi-color-bg-0)}.ga-bootstrap-shell{height:100%;display:flex;flex-direction:column}.ga-bootstrap-app{flex:1;min-height:0;display:flex;align-items:center;justify-content:center;padding:28px;background:radial-gradient(circle at 50% 18%,color-mix(in srgb,var(--semi-color-primary) 8%,transparent),transparent 42%),var(--semi-color-bg-0);color:var(--semi-color-text-0)}.ga-bootstrap-screen{width:min(100%,380px);text-align:center}.ga-bootstrap-loading{display:flex;flex-direction:column;align-items:center;gap:18px}.ga-bootstrap-title.semi-typography{margin:0;color:var(--semi-color-text-0)}.ga-bootstrap-description.semi-typography{margin:8px auto 22px;max-width:340px;line-height:1.65}.ga-bootstrap-progress-bar{margin-top:4px}.ga-bootstrap-stages{display:grid;gap:2px;margin:18px 0 0;padding:0;list-style:none;text-align:left}.ga-bootstrap-stages li{display:flex;align-items:center;gap:10px;min-height:30px;padding:4px 8px;border-radius:var(--semi-border-radius-small);color:var(--semi-color-text-2)}.ga-bootstrap-stages li[data-state=running]{background:var(--semi-color-primary-light-default);color:var(--semi-color-primary)}.ga-bootstrap-stages li[data-state=done]{color:var(--semi-color-success)}.ga-bootstrap-stages li[data-state=failed]{background:var(--semi-color-danger-light-default);color:var(--semi-color-danger)}.ga-bootstrap-stage-dot{width:14px;height:14px;border:2px solid var(--semi-color-border);border-radius:50%;flex:0 0 auto}.ga-bootstrap-log{margin-top:18px;text-align:left;border-top:1px solid var(--semi-color-border)}.ga-bootstrap-log .semi-collapse-header{padding-inline:4px;color:var(--semi-color-text-2)}.ga-bootstrap-log pre{max-height:150px;margin:0;padding:12px;overflow:auto;border:1px solid var(--semi-color-border);border-radius:var(--semi-border-radius-medium);background:var(--semi-color-fill-0);color:var(--semi-color-text-1);font:11px/1.55 ui-monospace,SFMono-Regular,Consolas,monospace;white-space:pre-wrap;overflow-wrap:anywhere;-webkit-user-select:text;user-select:text}.ga-bootstrap-ready{display:flex;flex-direction:column;align-items:center;gap:10px}.ga-bootstrap-ready-icon{margin-bottom:4px;color:var(--semi-color-success)}
|
||||
@@ -0,0 +1,2 @@
|
||||
import{c as ie,b as v,B as oe,l as A,R as x,au as Y,P as l,an as le,aj as o,T as j,ap as K,S as te,U as ce,ak as pe,at as de,aq as ue,as as ge,ar as he}from"./tauri-compat-tfiFK9EG.js";import{S as fe}from"./index-D_sWIqse.js";import{A as me}from"./Animation-TKQfYYOo.js";import{W as be}from"./WindowsTitlebar-CrkUa1UM.js";function ye(e){return v.createElement("svg",Object.assign({viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",focusable:!1,"aria-hidden":!0},e),v.createElement("g",{clipPath:"url(#clip_loading)"},v.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M12 0c.66 0 1.2.54 1.2 1.2v5.2a1.2 1.2 0 0 1-2.4 0V1.2c0-.66.54-1.2 1.2-1.2Zm7.05 2.3c.54.38.66 1.13.27 1.67l-3.06 4.2a1.2 1.2 0 0 1-1.94-1.4l3.06-4.21a1.2 1.2 0 0 1 1.67-.27Zm-14.1 0a1.2 1.2 0 0 1 1.67.26l3.06 4.2a1.2 1.2 0 1 1-1.94 1.41l-3.06-4.2a1.2 1.2 0 0 1 .27-1.68Zm-4.36 6c.2-.64.88-.98 1.5-.78l4.95 1.6a1.2 1.2 0 0 1-.74 2.3L1.36 9.8a1.2 1.2 0 0 1-.77-1.5Zm22.82 0c.2.62-.14 1.3-.77 1.5l-4.94 1.61a1.2 1.2 0 0 1-.74-2.28l4.94-1.6c.63-.21 1.3.13 1.51.76Zm-15.6 5.06c.21.63-.13 1.3-.77 1.51l-4.94 1.6a1.2 1.2 0 0 1-.74-2.27l4.94-1.61c.63-.2 1.31.14 1.52.77Zm8.37 0c.21-.63.89-.98 1.52-.77l4.94 1.6a1.2 1.2 0 0 1-.74 2.29l-4.94-1.6a1.2 1.2 0 0 1-.78-1.52Zm-6.77 2.2c.54.39.66 1.14.27 1.68l-3.06 4.2a1.2 1.2 0 1 1-1.94-1.4l3.06-4.21a1.2 1.2 0 0 1 1.67-.27Zm5.18 0a1.2 1.2 0 0 1 1.67.27l3.06 4.2a1.2 1.2 0 0 1-1.94 1.41l-3.06-4.2a1.2 1.2 0 0 1 .27-1.68ZM12 16.4c.66 0 1.2.54 1.2 1.2v5.2a1.2 1.2 0 0 1-2.4 0v-5.2c0-.66.54-1.2 1.2-1.2Z",fill:"currentColor"})),v.createElement("defs",null,v.createElement("clipPath",{id:"clip_loading"},v.createElement("rect",{width:24,height:24,fill:"currentColor"}))))}const Se=ie(ye,"loading"),ve={PREFIX:`${oe}-progress`},m={types:["line","circle"],DEFAULT_TYPE:"line",STROKE_DEFAULT:"var(--semi-color-success)",strokeLineCap:["square","round"],DEFAULT_LINECAP:"round",sizes:["default","small","large"],DEFAULT_SIZE:"default",directions:["vertical","horizontal"],DEFAULT_DIRECTION:"horizontal"};function ke(e,r,t){try{const n=xe(e,r,t);if(n.length!==0)return n}catch{return}}function xe(e,r,t){if(e.sort((s,i)=>s.percent-i.percent),e[0].percent>r)return m.STROKE_DEFAULT;const n=e[e.length-1];if(n.percent<r)return F(n.color);for(const[s,i]of e.entries()){if(i.percent===r)return F(i.color);if(r>i.percent)continue;const a=e[s-1];return t?Ee({startColor:F(a.color),endColor:F(i.color),size:i.percent-a.percent-1},r-a.percent-1):F(a.color)}}function Ee(e,r){const{startColor:t,endColor:n,size:s}=e,i=t.split(""),a=n.split(""),c=[parseInt(`${i[1]}${i[2]}`,16),parseInt(`${a[1]}${a[2]}`,16)],h=[parseInt(`${i[3]}${i[4]}`,16),parseInt(`${a[3]}${a[4]}`,16)],d=[parseInt(`${i[5]}${i[6]}`,16),parseInt(`${a[5]}${a[6]}`,16)],p=[parseInt(`${i[7]}${i[8]}`,16),parseInt(`${a[7]}${a[8]}`,16)],u=(c[0]-c[1])/(s+1),D=(h[0]-h[1])/(s+1),O=(d[0]-d[1])/(s+1),R=(p[0]-p[1])/(s+1);function $(g){const k=Math.round(c[0]-u*(g+1)).toString(16),_=Math.round(h[0]-D*(g+1)).toString(16),G=Math.round(d[0]-O*(g+1)).toString(16),w=`${N(k)}${N(_)}${N(G)}`,b=Math.floor(R*(g+1)+p[1]).toString(16);return S.Hex(`#${w}`,b)}function N(g){return g.length===1?`0${g}`:g.length===0?"00":g}if(typeof r>"u"){const g=[t];for(let k=0;k<s;k+=1)g.push($(k));return g}return $(r)}function F(e){if(e=e.trim().toLowerCase(),C.hex.test(e))return S.Hex(e,void 0);if(C.hslA.test(e))return S.Hex(S.HslA(e),void 0);if(C.rgbA.test(e))return S.Hex(S.RgbA(e),void 0);if(C.semiDesignTokens.test(e))return V.ALONG.indexOf(e)!==-1?S.SemiDesignToken(e):V.SEQUENCE.indexOf(e)!==-1?S.SemiDesignToken(`${e}-5`):S.SemiDesignToken(`${e}`)}const S={Hex(e,r){return e=e.replace("#",""),e.length===8?`#${e}`:e.length===6?`#${e}${r||"ff"}`:(e.length===3&&(e=e.split("").map(t=>t+t).join("")),`#${e}${r||"ff"}`)},SemiDesignToken(e){if(typeof window>"u")return;const r=getComputedStyle(document.body).getPropertyValue(`--semi-${e}`);if(r==="")return;const t=`rgba(${r}, 1)`;return S.RgbA(t)},HslA(e){const r=C.hslA.exec(e),t=parseInt(r[2]),n=parseInt(r[3])/100,s=parseInt(r[4])/100,i=r[5],a=(1-Math.abs(2*s-1))*n,c=a*(1-Math.abs(t/60%2-1)),h=s-a/2;let d=0,p=0,u=0;return 0<=t&&t<60?(d=a,p=c,u=0):60<=t&&t<120?(d=c,p=a,u=0):120<=t&&t<180?(d=0,p=a,u=c):180<=t&&t<240?(d=0,p=c,u=a):240<=t&&t<300?(d=c,p=0,u=a):300<=t&&t<360&&(d=a,p=0,u=c),d=Math.round((d+h)*255).toString(16),p=Math.round((p+h)*255).toString(16),u=Math.round((u+h)*255).toString(16),S.utils.pAL(d,p,u,i)},RgbA(e){const r=C.rgbA.exec(e),t=parseInt(r[2],10).toString(16),n=parseInt(r[3],10).toString(16),s=parseInt(r[4],10).toString(16),i=r[5];return S.utils.pAL(t,n,s,i)},utils:{pAL(e,r,t,n){return e.length==1&&(e="0"+e),r.length==1&&(r="0"+r),t.length==1&&(t="0"+t),typeof n<"u"?(n=Math.round(parseInt(n)*255).toString(16),n.length==1&&(n="0"+n),"#"+e+r+t+n):"#"+e+r+t}}},C={hex:/^#([0-9a-fA-F]{3}|[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$/,hslA:/(hsl)a?\(\s*?(\d+),?\s*?(\d+)%,?\s*?(\d+)%,?\s*?\/?(\s*?[\d.]+)?\s*?\)/,rgbA:/(rgb)a?\(\s*?(\d+),?\s*?(Line truncated
|
||||
`)})})})]})}function Me(){return o.jsxs("section",{className:"ga-bootstrap-screen ga-bootstrap-ready","aria-live":"polite",children:[o.jsx(te,{size:"extra-large",className:"ga-bootstrap-ready-icon","aria-hidden":"true"}),o.jsx(j.Title,{heading:5,className:"ga-bootstrap-title",children:E("ready")}),o.jsx(j.Text,{type:"tertiary",children:E("readyDetail")})]})}function Ue(){const[e,r]=v.useReducer(Ne,we);v.useEffect(()=>(je(r).catch(n=>{console.error("[bootstrap] failed to subscribe to startup state",n)}),()=>De()),[]);let t;switch(e.route){case"loading":t=o.jsx(Re,{mode:e.mode});break;case"progress":t=o.jsx(Fe,{stages:e.stages,overallPct:e.overallPct,logs:e.logs});break;case"ready":t=o.jsx(Me,{});break}return o.jsxs("div",{className:"ga-bootstrap-shell",children:[pe&&o.jsx(be,{}),o.jsx("main",{className:"ga-bootstrap-app","data-route":e.route,children:t})]})}function ne(e){e.matches?(document.documentElement.dataset.appearance="dark",document.body.setAttribute("theme-mode","dark")):(document.documentElement.dataset.appearance="light",document.body.removeAttribute("theme-mode"))}const M=window.matchMedia("(prefers-color-scheme: dark)");ne(M);var ee;(ee=M.addEventListener)==null||ee.call(M,"change",()=>ne(M));const J=document.getElementById("loading-root");J&&de.createRoot(J).render(o.jsx(v.StrictMode,{children:o.jsx(ue,{locale:f?ge:he,children:o.jsx(Ue,{})})}));
|
||||
+33
@@ -0,0 +1,33 @@
|
||||
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/MarkdownPart-Bhe_jloX.js","assets/tauri-compat-tfiFK9EG.js","assets/tauri-compat-BTcpEvqB.css","assets/markdown-preprocess-Bvg4n8KE.js","assets/markdown-preprocess-Cp579UoJ.css","assets/index-Bpi3BHKj.js","assets/index-D0pGtk0y.css","assets/WindowsTitlebar-CrkUa1UM.js","assets/WindowsTitlebar-U0YG9JNA.css","assets/MarkdownPart-Cp90Gu77.css","assets/SummaryPart-D48OOFSQ.js","assets/ServicesPage-DrjRw530.js","assets/index-DwVcZP0M.js","assets/index-D_sWIqse.js","assets/index-DkG9Cu-r.css","assets/index-gTPS8Hpa.css","assets/IconFile-CgfQSwGI.js","assets/ServicesPage-Cbm5nbW7.css","assets/TokenPage-C6-RA6yj.js","assets/Animation-TKQfYYOo.js","assets/index-DpGuh58E.js","assets/index-ClU1uQYs.css","assets/TokenPage-DwLDOw_j.css","assets/CollabPage-bnm43hIR.js","assets/CollabPage-CG38jm3S.css"])))=>i.map(i=>d[i]);
|
||||
var _i=Object.defineProperty;var Mi=(n,e,t)=>e in n?_i(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t;var xt=(n,e,t)=>Mi(n,typeof e!="symbol"?e+"":e,t);import{g as We,r as Li,a as Ii,c as fe,b as a,d as $s,e as As,B as Te,_ as Be,f as ge,h as $,i as De,j as Ti,E as Ri,R as g,k as de,l as I,m as Ge,n as Fs,P as h,w as zs,o as jo,p as Je,q as rn,s as ln,t as No,u as Ni,v as Di,x as $i,y as Ai,z as Fi,A as zi,C as Bi,D as Ui,F as Vi,G as Ki,H as Bs,I as Wi,T as Do,J as sn,K as Hi,L as Zi,M as qi,N as Pt,O as Us,Q as Vs,S as Ks,U as Ws,V as Gi,W as Hs,X as Zs,Y as Eo,Z as Qi,$ as Yi,a0 as Xi,a1 as Ji,a2 as ea,a3 as ta,a4 as na,a5 as oa,a6 as ra,a7 as sa,a8 as ia,a9 as aa,aa as Go,ab as $e,ac as la,ad as ca,ae as Jt,af as da,ag as ua,ah as Oo,ai as me,aj as i,ak as pa,al as ha,am as ma,an as fa,ao as Qo,ap as dt,aq as ga,ar as ya,as as ba,at as va}from"./tauri-compat-tfiFK9EG.js";import{I as cn,a as qs,b as Gs,c as Qs,B as ie}from"./index-Bpi3BHKj.js";import{W as xa}from"./WindowsTitlebar-CrkUa1UM.js";const wa="modulepreload",Ca=function(n){return"/"+n},Yo={},Gt=function(e,t,o){let r=Promise.resolve();if(t&&t.length>0){let l=function(p){return Promise.all(p.map(d=>Promise.resolve(d).then(m=>({status:"fulfilled",value:m}),m=>({status:"rejected",reason:m}))))};document.getElementsByTagName("link");const c=document.querySelector("meta[property=csp-nonce]"),u=(c==null?void 0:c.nonce)||(c==null?void 0:c.getAttribute("nonce"));r=l(t.map(p=>{if(p=Ca(p),p in Yo)return;Yo[p]=!0;const d=p.endsWith(".css"),m=d?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${p}"]${m}`))return;const f=document.createElement("link");if(f.rel=d?"stylesheet":wa,d||(f.as="script"),f.crossOrigin="",f.href=p,u&&f.setAttribute("nonce",u),document.head.appendChild(f),d)return new Promise((b,y)=>{f.addEventListener("load",b),f.addEventListener("error",()=>y(new Error(`Unable to preload CSS for ${p}`)))})}))}function s(l){const c=new Event("vite:preloadError",{cancelable:!0});if(c.payload=l,window.dispatchEvent(c),!c.defaultPrevented)throw l}return r.then(l=>{for(const c of l||[])c.status==="rejected"&&s(c.reason);return e().catch(s)})};function Xo(n,e){const t=e,o=new URL(t);if(o.protocol!=="http:"&&o.protocol!=="https:")throw new Error(`Service endpoint must use HTTP(S): ${t}`);return o.toString().replace(/\/+$/,"")}function Jo(n){const e=new URL(n);return e.protocol=e.protocol==="https:"?"wss:":"ws:",e.pathname=`${e.pathname.replace(/\/+$/,"")}/ws`,e.toString().replace(/\/$/,"")}function Sa(n){const e=Xo(n.VITE_BRIDGE_BASE,"http://127.0.0.1:14168"),t=Xo(n.VITE_CONDUCTOR_BASE,"http://127.0.0.1:8900");return{bridgeBase:e,conductorBase:t,wsUrl:Jo(e),conductorWsUrl:Jo(t)}}const dn=Sa({VITE_BRIDGE_BASE:void 0,VITE_CONDUCTOR_BASE:void 0}),ee=dn.bridgeBase,ka=dn.conductorBase,ja=dn.wsUrl,Ea=dn.conductorWsUrl,Oa=1e3,Pa=3e4;let ke=null,Po=0,kn=null;const jt=new Map;let _o="offline";const Mo=new Set;let er=!1;const _a=new Set;function jn(n){n!==_o&&(_o=n,n==="ready"&&(er||(er=!0,_a.forEach(e=>e()))),Mo.forEach(e=>e(n)))}function tr(){return _o}function Ys(n){return Mo.add(n),()=>{Mo.delete(n)}}function Xs(){if(!(ke&&(ke.readyState===WebSocket.OPEN||ke.readyState===WebSocket.CONNECTING))){jn("connecting");try{ke=new WebSocket(ja)}catch{nr();return}ke.onopen=()=>{Po=0,jn("ready")},ke.onmessage=n=>{try{const e=JSON.parse(n.data),t=e.type;if(!t)return;const o=jt.get(t);o&&o.forEach(r=>r(e))}catch{}},ke.onclose=()=>{ke=null,jn("connecting"),nr()},ke.onerror=()=>{ke==null||ke.close()}}}function nr(){if(kn)return;const n=Math.min(Oa*2**Po,Pa);Po++,kn=setTimeout(()=>{kn=null,Xs()},n)}function Ve(n,e){return jt.has(n)||jt.set(n,new Set),jt.get(n).add(e),Xs(),()=>{var t;(t=jt.get(n))==null||t.delete(e)}}let or=[];const Ma=new Set;let rr=!1;function La(){for(const n of Ma)n()}function En(n){or=[...or.slice(-39),n],La()}function Ia(){rr||(rr=!0,Ve("session-state",n=>{const e=n;if(!e.sessionId||!e.status)return;const t=e.status==="running"?"Turn started":e.status==="idle"?"Turn complete":e.status==="error"?"Turn error":`Session ${e.status}`;En(t)}),Ve("service.changed",n=>{const e=n;if(!e.service)return;const t=e.service.name??e.service.id??"service",o=e.service.status??"unknown";En(`${t}: ${o}`)}),Ve("token.changed",n=>{const e=n;!e.session_id||!e.total_output||En(`Token update: +${e.total_output} output`)}))}Ia();const Js=new Set(["http:","https:"]),Ta=new Set(["\\href","\\url"]),Ra=/^data:image\/(?:avif|gif|jpeg|png|webp);base64,[a-z0-9+/]+={0,2}$/i,Na=/^(?:\/|\.\/)?assets\//,Da=/%(?:2e|2f|5c)/i,ei=/[\u0000-\u001f\u007f]/;function $o(n){const e=n.trim();if(!/^https?:\/\//i.test(e)||ei.test(e))return null;try{const t=new URL(e);return Js.has(t.protocol)?t.href:null}catch{return null}}function $a(n){if(!Na.test(n)||n.startsWith("//")||n.includes("\\")||Da.test(n))return null;try{const e=new URL(n,"https://genericagent.invalid/");return e.origin==="https://genericagent.invalid"&&e.pathname.startsWith("/assets/")?n:null}catch{return null}Line truncated
|
||||
/new 新会话 /clear 清屏 /stop 停止 /settings 设置`,"slash.unknown":"未知命令","upload.hint":"上传文件:选择 / 拖拽 / 粘贴","upload.button":"上传文件","upload.tooLarge":"文件过大或数量超限","upload.empty":"跳过空文件","upload.failed":"上传失败","err.charLimit":"已达字数上限({n}),发送时将自动截断","err.charLimitReached":"已达字数上限({n})","err.numMax":"不能超过 {n}","file.openFailed":"无法打开文件","file.kindGeneric":"文件","file.kindDoc":"文档","file.kindSheet":"表格","file.kindSlide":"幻灯片","file.kindCode":"代码","file.kindArchive":"压缩包","file.kindAudio":"音频","file.kindVideo":"视频","upload.removeTitle":"移除","upload.dropHint":"松开以上传文件","lightbox.closeTitle":"关闭","fold.thinking":"思考","fold.tool":"工具调用","fold.toolResult":"工具结果","fold.llm":"LLM Running","fold.turn":"第 {n} 轮","plan.header":"计划 ({done}/{total})","plan.complete":"✓ 计划完成 ({n}/{n})","plan.running":"计划执行中","plan.completeTitle":"计划完成","plan.placeholder":"计划模式已激活","plan.waiting":"等待写入 {path} …","plan.overflow":"还有 {n} 项","plan.current":"当前","plan.collapse":"收起","plan.expand":"展开","plan.details":"详情","plan.capsuleRunning":"运行中","plan.capsuleComplete":"已完成","timing.elapsed":"已运行 {t}","chip.plan":"Plan","chip.auto":"Auto","ch.wechat":"微信","ch.wecom":"企业微信","ch.lark":"飞书","ch.dingtalk":"钉钉","ch.qq":"QQ","ch.telegram":"Telegram","ch.discord":"Discord","ch.loading":"加载中…","ch.empty":"未发现 IM 进程脚本","ch.logEmpty":"暂无日志","err.channelLoad":"加载失败","err.channelStart":"启动失败","err.channelStop":"停止失败","err.mykeyImport":"导入模型配置失败","err.mykeyExport":"导出模型配置失败","err.channelNotConfigured":"请先在密钥配置中完成该平台设置","sys.channelStarted":"已启动","sys.channelStopped":"已停止","sys.bridgeDisconnecting":"正在断开本地连接","modal.channelLogs":"进程日志","modal.mykeyConfig":"密钥配置","sys.configSaved":"配置已保存","sys.mykeyImported":"模型配置已导入","sys.mykeyExported":"模型配置已导出","st.starting":"启动中…","st.stopping":"停止中…","st.online":"在线","st.offline":"离线","st.error":"错误","st.running":"运行中","st.stopped":"已停止","st.abnormal":"异常","st.warning":"警告","err.portBusy":"端口被占用,已自动重连","err.conductorCrash":"内部线程异常退出","err.missingModule":"缺少依赖模块","err.connRefused":"连接被拒绝,将自动重试","err.timeout":"连接超时","err.apiKeyInvalid":"API Key 无效或已过期","err.modelNotFound":"模型不存在或不可用","err.rateLimit":"请求频率超限,请稍后重试","err.quotaExceeded":"额度不足","err.processCrash":"后台进程异常退出","act.configure":"配置","act.logs":"日志","act.restart":"重启","act.stop":"停止","act.start":"启动","act.disconnect":"断开","act.copy":"复制","act.copied":"已复制","act.copyTex":"TeX","act.send":"发送","proc.imbotWechat":"imbot · 微信","proc.imbotDing":"imbot · 钉钉","proc.bridge":"本地连接","proc.bridgeSummary":"连接桌面应用与本地运行环境","proc.bridgeTip":"保持桌面应用与本地运行环境通信","proc.scheduler":"定时任务","proc.schedulerSummary":"按计划自动执行任务","proc.schedulerTip":"在设定时间自动触发并执行任务","proc.conductor":"指挥家","proc.conductorSummary":"异步处理多步骤任务","proc.conductorTip":"通过异步对话拆解任务、分派执行,并持续跟进进度","proc.runtimeComponent":"运行组件","proc.runtimeComponentSummary":"本地运行环境中持续工作的组件","proc.runtimeComponentTip":"查看该组件的状态、日志与控制项","cm.scheduling":"调度中","cm.running":"执行中","cm.idleSt":"空闲","cm.master":"已派 3 子任务","cm.w1":"子任务:抓取数据","cm.w2":"子任务:复核结果","cm.sub":"等待派单","tok.total":"累计","tok.cost":"缓存率","tok.today":"今日","tok.tabAll":"会话","tok.tabConductor":"指挥家","tok.condTotal":"指挥家累计","tok.condCurrent":"指挥家本次","tok.condTip":"指挥家消耗不计入会话累计","tok.condOffline":"指挥家服务离线","tok.disclaimer":"不同 API 网站的计费价格可能会有差异,请以实际网站为准。","tok.colSession":"会话","tok.colIn":"输入","tok.colOut":"输出","tok.colCacheW":"缓存写入","tok.colCache":"缓存读取","tok.colCost":"成本","tok.from":"从","tok.to":"到","tok.reset":"重置","tok.noData":"暂无记录","tok.deleted":"此会话已删除","tok.pricingUnknown":"⚠ 此模型计费规则尚未明确,按默认估算","tok.priceInput":"输入: $","tok.priceOutput":"输出: $","tok.priceCacheW":"缓存写入: $","tok.priceCacheR":"缓存读取: $","presetPrompt.goal":"Line truncated
|
||||
/new new chat /clear clear /stop stop /settings settings`,"slash.unknown":"Unknown command","upload.hint":"Upload file: pick / drag / paste","upload.button":"Upload file","upload.tooLarge":"File too large or limit reached","upload.empty":"Skipped empty file","upload.failed":"Upload failed","err.charLimit":"Character limit reached ({n}), text will be truncated on send","err.charLimitReached":"Character limit reached ({n})","err.numMax":"Cannot exceed {n}","file.openFailed":"Cannot open file","file.kindGeneric":"File","file.kindDoc":"Document","file.kindSheet":"Spreadsheet","file.kindSlide":"Slides","file.kindCode":"Code","file.kindArchive":"Archive","file.kindAudio":"Audio","file.kindVideo":"Video","upload.removeTitle":"Remove","upload.dropHint":"Drop to upload files","lightbox.closeTitle":"Close","fold.thinking":"Thinking","fold.tool":"Tool call","fold.toolResult":"Tool result","fold.llm":"LLM Running","fold.turn":"Turn {n}","plan.header":"Plan ({done}/{total})","plan.complete":"✓ Plan complete ({n}/{n})","plan.running":"Running plan","plan.completeTitle":"Plan complete","plan.placeholder":"Plan mode activated","plan.waiting":"waiting for {path} …","plan.overflow":"+{n} more","plan.current":"Now","plan.collapse":"Collapse","plan.expand":"Expand","plan.details":"Details","plan.capsuleRunning":"Running","plan.capsuleComplete":"Done","timing.elapsed":"Elapsed {t}","chip.plan":"Plan","chip.auto":"Auto","ch.wechat":"WeChat","ch.wecom":"WeCom","ch.lark":"Lark","ch.dingtalk":"DingTalk","ch.qq":"QQ","ch.telegram":"Telegram","ch.discord":"Discord","ch.loading":"Loading…","ch.empty":"No IM process scripts found","ch.logEmpty":"No log output yet","err.channelLoad":"Failed to load","err.channelStart":"Start failed","err.channelStop":"Stop failed","err.mykeyImport":"Failed to import model config","err.mykeyExport":"Failed to export model config","err.channelNotConfigured":"Complete this platform setup in Key configuration first","sys.channelStarted":"Started","sys.channelStopped":"Stopped","sys.bridgeDisconnecting":"Disconnecting from the local runtime","modal.channelLogs":"Process logs","modal.mykeyConfig":"Key configuration","sys.configSaved":"Configuration saved","sys.mykeyImported":"Model config imported","sys.mykeyExported":"Model config exported","st.starting":"Starting…","st.stopping":"Stopping…","st.online":"Online","st.offline":"Offline","st.error":"Error","st.running":"Running","st.stopped":"Stopped","st.abnormal":"Error","st.warning":"Warning","err.portBusy":"Port was busy, reconnected","err.conductorCrash":"Internal thread crashed","err.missingModule":"Missing module","err.connRefused":"Connection refused, retrying","err.timeout":"Connection timed out","err.apiKeyInvalid":"API key invalid or expired","err.modelNotFound":"Model not found or unavailable","err.rateLimit":"Rate limited, try again later","err.quotaExceeded":"Quota exceeded","err.processCrash":"Background process crashed","act.configure":"Configure","act.logs":"Logs","act.restart":"Restart","act.stop":"Stop","act.start":"Start","act.disconnect":"Disconnect","act.copy":"Copy","act.copied":"Copied","act.copyTex":"TeX","act.send":"Send","proc.imbotWechat":"imbot · WeChat","proc.imbotDing":"imbot · DingTalk","proc.bridge":"Local connection","proc.bridgeSummary":"Connects the desktop app to the local runtime","proc.bridgeTip":"Keeps the desktop app and local runtime communicating","proc.scheduler":"Scheduled tasks","proc.schedulerSummary":"Runs tasks on schedule","proc.schedulerTip":"Triggers and runs tasks at configured times","proc.conductor":"Conductor","proc.conductorSummary":"Handles multi-step work asynchronously","proc.conductorTip":"Uses async conversations to break down, delegate, and follow through on tasks","proc.runtimeComponent":"Runtime component","proc.runtimeComponentSummary":"A component that runs in the local environment","proc.runtimeComponentTip":"View this component’s status, logs, and controls","cm.scheduling":"Scheduling","cm.running":"Running","cm.idleSt":"Idle","cm.master":"Dispatched 3 subtasks","cm.w1":"Subtask: fetch data","cm.w2":"Subtask: review results","cm.sub":"Waiting for tasks","tok.total":"Total","tok.cost":"Cache rate","tok.today":"Today","tok.tabAll":"Chat","tok.tabConductor":"Conductor","tok.condTotal":"Conductor Total","tok.condCurrent":"Conductor Current","tok.condTip":"Conductor usage is not included in chat totals","tok.condOffline":"Service offline","tok.disclaimer":"Pricing may vary by API provider. Please refer to the actual website.","tok.colSession":"Session","tok.colIn":"Input","tok.colOut":"Output","tok.colCacheW":"Cache write","tok.colCache":"Cache read","tok.colCost":"Cost","tok.from":"From","tok.to":"To","tok.reset":"Reset","tok.noData":"No records","tok.deleted":"Session deleted","tok.pricingUnknown":"⚠ Pricing not confirmed, using defaults","tok.priceInput":"Input: $","tok.priceOutput":"Output: $","tok.priceCacheW":"Cache write: $","tok.priceCacheR":"Cache read: $","presetPromptLine truncated
|
||||
`)}),i.jsxs("div",{className:"ga-bridge-panel-section-foot",children:[_&&i.jsx("span",{className:"ga-bridge-panel-truncated",children:e("bridge.logLineCount",{count:m})}),i.jsxs("button",{className:"ga-bridge-panel-link-btn",onClick:k,children:[e("bridge.viewAllLogs")," →"]})]})]})]})}const lu=[{key:"services",icon:"symbol-misc",textKey:"nav.services"},{key:"collab",icon:"robot",textKey:"nav.collab"},{key:"token",icon:"graph",textKey:"nav.token"}];function cu(){const{activePage:n,setPage:e}=Ie(),t=H(E=>E.open),o=X(E=>E.newSession),r=X(E=>E.sessions),s=X(E=>E.activeSessionId),l=X(E=>E.setActiveSession),c=X(E=>E.runningSessions),{t:u}=ce(),[p,d]=a.useState(!0),[m,f]=a.useState(""),[b,y]=a.useState(!1),[S,w]=a.useState(!1),C=a.useCallback(()=>y(!1),[]),k=a.useCallback(()=>{C(),t()},[C,t]),_=a.useCallback(()=>{w(!1),y(E=>!E)},[]),x=[...r].sort((E,D)=>{if(E.pinned&&!D.pinned)return-1;if(!E.pinned&&D.pinned)return 1;const P=Number(E.updatedAt||E.createdAt||0);return Number(D.updatedAt||D.createdAt||0)-P}),j=m.trim()?x.filter(E=>E.title.toLowerCase().includes(m.trim().toLowerCase())):x;function v(){o(),e("chat")}function O(E){l(E),e("chat")}return i.jsxs("div",{className:"ga-left-sidebar",children:[i.jsxs("nav",{className:"ga-nav-rail","aria-label":"Main navigation",children:[i.jsxs("button",{type:"button",className:"ga-nav-btn",onClick:v,"aria-label":u("nav.chat"),children:[i.jsx("span",{className:"ga-nav-icon",children:i.jsx(Ee,{name:"comment",size:"1rem"})}),i.jsx("span",{className:"ga-nav-label",children:u("nav.chat")})]}),lu.map(E=>i.jsxs("button",{type:"button",className:`ga-nav-btn${n===E.key?" active":""}`,onClick:()=>e(E.key),"aria-label":u(E.textKey),"aria-current":n===E.key?"page":void 0,children:[i.jsx("span",{className:"ga-nav-icon",children:i.jsx(Ee,{name:E.icon,size:"1rem"})}),i.jsx("span",{className:"ga-nav-label",children:u(E.textKey)})]},E.key))]}),i.jsx("div",{className:"ga-sidebar-search",children:i.jsx(ut,{prefix:i.jsx(ti,{style:{fontSize:14}}),placeholder:u("search.placeholder"),size:"small",value:m,onChange:f})}),!m&&i.jsx(zd,{label:u("section.sessions"),count:r.length,open:p,onToggle:d,onAction:v}),i.jsx("div",{className:"ga-session-section",children:(m||p)&&(j.length===0?i.jsx("div",{className:"ga-session-empty",children:i.jsx("p",{children:u(m?"search.noResults":"conv.emptyList")})}):i.jsx("div",{className:"ga-session-list",children:j.map(E=>i.jsx(Ud,{session:E,isActive:E.id===s,isWorking:c.has(E.id),onClick:()=>O(E.id)},E.id))}))}),i.jsxs("div",{className:"ga-sidebar-footer",children:[i.jsx($e,{content:u("foot.settings"),position:"top",clickToHide:!0,children:i.jsx("button",{type:"button",className:"ga-sidebar-footer-btn",onClick:k,"aria-label":u("foot.settings"),children:i.jsx(Ee,{name:"settings-gear",size:"1rem"})})}),i.jsxs("div",{className:"ga-sidebar-footer-anchor",children:[i.jsx($e,{content:u("foot.runtimeManagement"),position:"top",visible:S&&!b,onVisibleChange:w,children:i.jsx("button",{type:"button",className:"ga-sidebar-footer-btn",onClick:_,"aria-label":u("foot.runtimeManagement"),"aria-expanded":b,"aria-haspopup":"dialog","aria-controls":"ga-runtime-management-panel",children:i.jsx(Ee,{name:"server-process",size:"1rem"})})}),b&&i.jsx(au,{onClose:C})]})]})]})}const du=24;function uu(){const n=a.useRef(null),[e,t]=a.useState(!0),o=a.useRef(!0),r=a.useRef(0),s=a.useCallback(()=>{const u=n.current;if(!u)return;const p=u.scrollHeight-u.scrollTop-u.clientHeight<du;t(p),o.current=p},[]),l=a.useCallback((u="instant")=>{const p=n.current;p&&(u==="instant"?p.scrollTop=p.scrollHeight:pu(p,p.scrollHeight-p.clientHeight,170),o.current=!0,t(!0))},[]),c=a.useCallback(()=>{o.current=!1},[]);return a.useEffect(()=>{const u=n.current;if(!u)return;const p=()=>s(),d=new MutationObserver(()=>{o.current&&(cancelAnimationFrame(r.current),r.current=requestAnimationFrame(()=>{u.scrollTop=u.scrollHeight}))});return u.addEventListener("scroll",p,{passive:!0}),d.observe(u,{childList:!0,subtree:!0,characterData:!0}),()=>{u.removeEventListener("scroll",p),d.disconnect(),cancelAnimationFrame(r.current)}},[s]),{scrollRef:n,isAtBottom:e,scrollToBottom:l,stopScroll:c}}function pu(n,e,t){const o=n.scrollTop,r=e-o,s=performance.now();function l(c){const u=c-s,p=Math.min(u/t,1),d=1-Math.pow(1-p,3);n.scrollTop=o+r*d,p<1&&requestAnimationFrame(l)}requestAnimationFrame(l)}function hu(n,e,t,o){a.useEffect(()=>{const r=n.current;if(!r||!o)return;t(),r.scrollTop=r.scrollHeight;let s=0,l=r.scrollHeight,c=0;function u(){if(r){if(c++,r.scrollHeight===l?s++:(s=0,l=r.scrollHeight,r.scrollTop=r.scrollHeight),s>=5||c>=90){e("instant");return}requestAnimationFrame(u)}}requestAnimationFrame(u)},[o,n,e,t])}function mu({children:n}){return i.jsx("div",{"data-slot":"aui_thread-content",children:n})}function yt(n){const e=/^[ \t]*(`{3,})([^\n`]*)[ \t]*$/.exec(n??"");return e?{ticks:e[1].length,tag:e[2]}:null}function bi(n,e){if(/^🛠️ Tool:/.test(n))return!0;if(!(e!=null&&e.forToolResult)){const t=yt(n);if(t&&t.ticks>=5&&t.
Line truncated
|
||||
`),nextLine:l+1}}function xi(n,e){const t=yt(n[e]);if(!t||t.ticks<5||t.tag!=="")return null;const o=e+1,r=xn(n,o,{forToolResult:!0}),s=wn(n,o,r,t.ticks);return s<0?null:{body:n.slice(o,s).join(`
|
||||
`),nextLine:s+1}}function fu(n,e){if(vi(n,e))return null;const t=/^🛠️ Tool: `([^`]+)`/.exec(n[e]||"");if(!t)return null;const o=yt(n[e+1]);let r,s;if(o&&o.tag==="text"){if(r=e+2,s=xn(n,r),wn(n,r,s,o.ticks)>=0)return null}else{r=e+1,s=n.length;for(let l=e+1;l<n.length;l++)if(bi(n[l])){s=l;break}}return{name:t[1],body:n.slice(r,s).join(`
|
||||
`),nextLine:s,inFlight:!0}}function gu(n,e){if(xi(n,e))return null;const t=yt(n[e]);if(!t||t.ticks<5||t.tag!=="")return null;const o=e+1,r=xn(n,o,{forToolResult:!0});return wn(n,o,r,t.ticks)>=0?null:{body:n.slice(o,r).join(`
|
||||
`),nextLine:r,inFlight:!0}}function yu(n){return n.replace(/^\s*\**LLM Running \(Turn \d+\) \.\.\.\**\s*/i,"")}function bu(n,e){const t=String(n||"").split(`
|
||||
`),o=[];let r=0,s=0;const l=c=>{c<=r||(o.push(t.slice(r,c).join(`
|
||||
`)),r=c)};for(;s<t.length;){const c=vi(t,s);if(c){l(s),o.push(e.onTool(c.name,c.body)),s=c.nextLine,r=s;continue}const u=xi(t,s);if(u){l(s),o.push(e.onResult(u.body)),s=u.nextLine,r=s;continue}const p=fu(t,s);if(p){l(s),o.push(e.onTool(p.name,p.body,{inFlight:!0})),s=p.nextLine,r=s;continue}const d=gu(t,s);if(d){l(s),o.push(e.onResult(d.body,{inFlight:!0})),s=d.nextLine,r=s;continue}s++}return l(t.length),o.join("")}function vu(n){const e=n.split(`
|
||||
`),t=[];let o=!1;for(const r of e){if(/candidates:/i.test(r)){o=!0;continue}if(o){const s=/^\s*-\s*(.+)/.exec(r);s&&t.push(s[1].trim())}}if(t.length===0)try{const r=JSON.parse(n);if(Array.isArray(r==null?void 0:r.candidates))return r.candidates.map(String)}catch{}return t}function xu(n){const e=n.split(`
|
||||
`),t=[];for(const o of e){if(/candidates:/i.test(o))break;const r=o.replace(/^["{\s]*question[":\s]*/i,"").replace(/[",}\s]*$/,"");r&&t.push(r)}if(t.length>0)return t.join(`
|
||||
`);try{const o=JSON.parse(n);if(o!=null&&o.question)return String(o.question)}catch{}return n.trim()}function To(n){const e=[];let t=yu(n);const o=[];t=t.replace(/<thinking>([\s\S]*?)<\/thinking>/gi,(u,p)=>(o.push(p),`
|
||||
§§THINK:${o.length-1}§§
|
||||
`));const r=[];t=t.replace(/<summary>([\s\S]*?)<\/summary>/gi,(u,p)=>(r.push(p),`
|
||||
§§SUMMARY:${r.length-1}§§
|
||||
`));const s=[],l=[];t=bu(t,{onTool(u,p,d){return s.push({name:u,body:p,inFlight:d==null?void 0:d.inFlight}),`
|
||||
§§TOOL:${s.length-1}§§
|
||||
`},onResult(u,p){return l.push({body:u,inFlight:p==null?void 0:p.inFlight}),`
|
||||
§§RESULT:${l.length-1}§§
|
||||
`}}),t=t.replace(/<function_calls>[\s\S]*?<\/function_calls>/gi,u=>(s.push({name:"function_call",body:u}),`
|
||||
§§TOOL:${s.length-1}§§
|
||||
`)),t=t.replace(/<function_results>[\s\S]*?<\/function_results>/gi,u=>(l.push({body:u}),`
|
||||
§§RESULT:${l.length-1}§§
|
||||
`));const c=t.split(/\n?(§§(?:THINK|TOOL|RESULT|SUMMARY):\d+§§)\n?/);for(const u of c){const p=/^§§THINK:(\d+)§§$/.exec(u);if(p){e.push({type:"thinking",content:o[Number(p[1])]});continue}const d=/^§§TOOL:(\d+)§§$/.exec(u);if(d){const y=s[Number(d[1])];if(y.name==="ask_user"){const S=vu(y.body),w=xu(y.body);e.push({type:"approval",content:w,candidates:S})}else e.push({type:"tool",content:y.body,label:y.name,inFlight:y.inFlight});continue}const m=/^§§RESULT:(\d+)§§$/.exec(u);if(m){const y=l[Number(m[1])];e.push({type:"result",content:y.body,inFlight:y.inFlight});continue}const f=/^§§SUMMARY:(\d+)§§$/.exec(u);if(f){e.push({type:"summary",content:r[Number(f[1])]});continue}const b=u.trim();b&&e.push({type:"prose",content:b})}return e}function Hr(n){return n.map((e,t)=>{const o=To(e),r=o.reduce((s,l)=>s+l.content.length,0);return{index:t,segments:o,weight:r}})}function wu(n){const e=[];let t=0;for(;t<n.length;){const o=n[t];if(o.role==="user"){const r=n[t+1];if(r&&r.role==="assistant"){const s=r.turn_segs??(r.content?[r.content]:[]),l=Hr(s);e.push({kind:"turn",userMsg:o,assistantMsg:r,turns:l}),t+=2}else e.push({kind:"standalone",msg:o}),t++}else{if(o.role==="assistant"){const r=o.turn_segs??(o.content?[o.content]:[]),s=Hr(r);e.push({kind:"turn",userMsg:{id:"__synthetic__",role:"user",content:"",status:"completed"},assistantMsg:o,turns:s})}else e.push({kind:"standalone",msg:o});t++}}return e}const Xe=[{id:"plan",title:"Plan",desc:{en:"Explore, plan, execute, verify",zh:"探索、规划、执行、验证"},prompt:"Enter Plan mode: read memory/plan_sop.md, follow Explore → Plan → Execute → Verify flow for the task I describe next."},{id:"goal",title:"Goal",desc:{en:"Achieve a specific objective autonomously",zh:"自主达成指定目标"},prompt:"Enter Goal mode: read L3 goal mode SOP, autonomously achieve the goal I describe next."},{id:"autonomous",title:"Autonomous",desc:{en:"Select tasks and execute independently",zh:"自主选取任务并独立执行"},prompt:"Enter autonomous mode: read memory/autonomous_operation_sop.md, select or plan tasks, execute independently and produce a report."},{id:"hive",title:"Hive",desc:{en:"Multi-agent parallel collaboration",zh:"多 agent 并行协作"},prompt:"Start Goal Hive mode: follow hive SOP, spawn multiple workers to collaboratively achieve my next goal."},{id:"review",title:"Review",desc:{en:"Critical review of latest output",zh:"对最近产出做严格复核"},prompt:"Enter reviewer mode: rigorously critique the latest output, check each item and report issues."},{id:"findwork",title:"Find Work",desc:{en:"Analyze context, suggest next tasks",zh:"分析当前情况,推荐下一步"},prompt:"Analyze my situation using the autonomous planning approach, generate a batch of TODOs that would interest me."}];function Cu(n){for(const e of Xe)if(n.startsWith(e.prompt)){const t=n.slice(e.prompt.length).trimStart();return{id:e.id,rest:t}}return null}function Su(n){return n?n<1024?`${n} B`:n<1024*1024?`${(n/1024).toFixed(1)} KB`:`${(n/(1024*1024)).toFixed(1)} MB`:""}function ku(n){var t;const e=((t=n.split(".").pop())==null?void 0:t.toLowerCase())||"";return["js","ts","tsx","jsx","py","rs","go","c","cpp","java"].includes(e)?"◇":["json","yaml","yml","toml","xml"].includes(e)?"{}":["md","txt","log","csv"].includes(e)?"¶":["pdf"].includes(e)?"⊞":"◎"}function ju({text:n}){const[e,t]=a.useState(!1),o=a.useRef(),r=a.useCallback(s=>{s.stopPropagation(),navigator.clipboard.writeText(n).then(()=>{t(!0),o.current&&clearTimeout(o.current),o.current=setTimeout(()=>t(!1),2e3)})},[n]);return typeof navigator>"u"||!navigator.clipboard?null:i.jsx("button",{"data-slot":"user-bubble-copy",onClick:r,title:e?"Copied":"Copy",children:e?i.jsx("svg",{width:"14",height:"14",viewBox:"0 0 16 16",fill:"none",children:i.jsx("path",{d:"M3 8.5l3 3 7-7",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})}):i.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 16 16",fill:"none",children:[i.jsx("rect",{x:"5.5",y:"5.5",width:"7",height:"7",rx:"1",stroke:"currentColor",strokeWidth:"1.2"}),i.jsx("path",{d:"M3.5 10.5v-7a1 1 0 011-1h7",stroke:"currentColor",strokeWidth:"1.2",strokeLinecap:"round"})]})})}const wi=a.memo(function({content:e,msgId:t,images:o,files:r}){const s=a.useRef(null),[l,c]=a.useState(!1),[u,p]=a.useState(!1),d=a.useRef(!1);if(d.current=u,a.useLayoutEffect(()=>{const f=s.current;if(!f)return;const b=new ResizeObserver(()=>{d.current||c(f.scrollHeight>f.clientHeight+2)});return b.observe(f),()=>b.disconnect()},[]),!e&&(!o||o.length===0)&&(!r||r.length===0))return null;const m=Cu(e);return i.jsxs(i.Fragment,{children:[o&&o.length>0&&i.jsx("div",{"data-slot":"user-images",children:o.map((f,b)=>i.jsx("img",{"data-slot":"user-image-thumb",src:f.path.startsWith("data:")?f.path:`${ee}/upload/raw?path=${encodeURIComponent(f.path)}`,alt:f.name},b))}),r&&r.length>0&&i.jsx("div",{"data-slot":"user-files",children:r.map((f,b)=>i.jsxs("div
Line truncated
|
||||
|
||||
`)},[]);return i.jsxs("div",{"data-slot":"aui_assistant-message-root","data-role":"assistant","data-streaming":t||void 0,children:[i.jsx(Du,{segments:o,isStreaming:t,messageId:String(e.id)}),i.jsx($u,{getMessageText:s})]})}),Fu=a.memo(function({userMsg:e,assistantMsg:t,isStreaming:o}){return i.jsxs("div",{"data-slot":"aui_turn-pair",children:[i.jsx(wi,{content:e.content,msgId:e.id,images:e.images,files:e.files}),i.jsx(Au,{message:t,isStreaming:o})]})}),zu=[{pattern:/invalid.?api.?key|api.?key.?invalid|Incorrect API key/i,key:"err.apiKeyInvalid"},{pattern:/model.*not found|does not exist|model_not_found/i,key:"err.modelNotFound"},{pattern:/rate.?limit|429|Too Many Requests/i,key:"err.rateLimit"},{pattern:/quota|insufficient.?funds|balance|billing/i,key:"err.quotaExceeded"},{pattern:/timed?\s*out|TimeoutError/i,key:"err.timeout"},{pattern:/Connection\s*refused|ConnectionRefusedError/i,key:"err.connRefused"},{pattern:/errno 48|address already in use/i,key:"err.portBusy"},{pattern:/Traceback|Exception.*thread|exit code \d+/i,key:"err.processCrash"}];function Bu(n,e){if(!n)return"";for(const t of zu)if(t.pattern.test(n))return e(t.key);return n.length<=80?n:n.slice(0,77)+"…"}const Uu=a.memo(function({error:e,msgId:t}){const{t:o}=ce(),r=Bu(e,o);return i.jsx("div",{className:"ga-inline-error",role:"alert",id:`msg-${t}`,children:i.jsx("span",{className:"ga-inline-error-text",children:r})})}),Vu=300;function Ku(n){return n.kind==="turn"?n.turns.reduce((e,t)=>e+t.segments.length,0):1}const Wu=a.memo(function({messages:e,isRunning:t,budgetMultiplier:o,onShowEarlier:r,scrollRef:s}){const l=a.useMemo(()=>wu(e),[e]),c=a.useRef(null),u=a.useMemo(()=>{if(!isFinite(o))return 0;const f=Vu*o;let b=0;for(let y=l.length-1;y>=0;y--)if(b+=Ku(l[y]),b>f)return y+1;return 0},[l,o]),p=a.useMemo(()=>l.slice(u),[l,u]),d=u;a.useLayoutEffect(()=>{c.current!==null&&(s!=null&&s.current)&&(s.current.scrollTop=s.current.scrollHeight-c.current,c.current=null)});const m=()=>{const f=s==null?void 0:s.current;f&&(c.current=f.scrollHeight-f.scrollTop),r()};return e.length===0?i.jsx("div",{"data-slot":"thread-empty",children:i.jsx("p",{children:"Send a message to begin."})}):i.jsxs(i.Fragment,{children:[d>0&&i.jsxs("button",{"data-slot":"show-earlier-btn",onClick:m,children:["Show ",d," earlier messages"]}),p.map((f,b)=>{const y=u+b;return f.kind==="turn"?i.jsx(Fu,{userMsg:f.userMsg,assistantMsg:f.assistantMsg,isStreaming:t&&y===l.length-1},f.assistantMsg.id):f.msg.role==="user"?i.jsx("div",{"data-slot":"aui_turn-pair",children:i.jsx(wi,{content:f.msg.content,msgId:f.msg.id,images:f.msg.images,files:f.msg.files})},f.msg.id):f.msg.role==="error"?i.jsx(Uu,{error:f.msg.content,msgId:f.msg.id},f.msg.id):i.jsx("div",{"data-slot":"standalone-message","data-status":f.msg.status,children:f.msg.content},f.msg.id)})]})}),Qr=3,Yr=40,Hu=170,Xr=12;function Jr(n){const e=n.replace(/\s+/g," ").trim();return e.length<=Yr?e:e.slice(0,Yr)+"…"}function Zu(n){return 1-Math.pow(1-n,3)}let eo=0;function qu(n,e,t){cancelAnimationFrame(eo);const o=n.scrollTop,r=e-o;if(Math.abs(r)<1)return;const s=performance.now();function l(c){const u=c-s,p=Math.min(u/t,1);n.scrollTop=o+r*Zu(p),p<1&&(eo=requestAnimationFrame(l))}eo=requestAnimationFrame(l)}const Gu=a.memo(function({messages:e,stopScroll:t,onJumpToCollapsed:o}){const r=a.useMemo(()=>e.filter(y=>y.role==="user").map(y=>({id:y.id,content:y.content})),[e]),[s,l]=a.useState(null),[c,u]=a.useState(!1),p=a.useRef(null),d=a.useRef(0),m=a.useCallback(()=>{p.current&&(clearTimeout(p.current),p.current=null),u(!0)},[]),f=a.useCallback(()=>{p.current=setTimeout(()=>{u(!1),p.current=null},150)},[]);a.useEffect(()=>{if(r.length<Qr)return;const y=document.querySelector('[data-slot="aui_thread-viewport"]');if(!y)return;function S(){if(d.current=0,!y)return;const C=y.getBoundingClientRect().top;let k=null;for(const _ of r){const x=document.getElementById(`msg-${_.id}`);if(!x)continue;if(x.getBoundingClientRect().top-C<=Xr)k=_.id;else break}!k&&r.length>0&&(k=r[0].id),k&&l(k)}function w(){d.current||(d.current=requestAnimationFrame(S))}return y.addEventListener("scroll",w,{passive:!0}),S(),()=>{y.removeEventListener("scroll",w),cancelAnimationFrame(d.current)}},[r]);const b=a.useCallback(y=>{const S=document.querySelector('[data-slot="aui_thread-viewport"]'),w=document.getElementById(`msg-${y}`);if(!w){o(y);return}if(!S)return;t();const _=(w.closest('[data-slot="aui_turn-pair"]')||w).offsetTop-Xr;qu(S,_,Hu)},[t,o]);return r.length<Qr?null:i.jsx("nav",{"data-slot":"user-turn-rail","data-expanded":c||void 0,"aria-label":"User message navigation",children:i.jsxs("div",{"data-slot":"rail-hitarea",onMouseEnter:m,onMouseLeave:f,children:[i.jsx("div",{"data-slot":"rail-panel","aria-hidden":!c,children:r.map(y=>i.jsx("button",{"data-slot":"rail-panel-item","data-active":y.id===s||void 0,onClick:()=>b(y.id),children:Jr(y.content)},y.id))}),i.jsx("div",{"data-slot":"rail-marks",children:r.map(y=>i.jsx("button",{"data-slot":"rail-mark","data-a
Line truncated
|
||||
`;else{const o=Ro(t);o&&(e+=`
|
||||
`+o)}return e}function Yu(n){const e=Array.from(n.childNodes);for(const t of e)if(t instanceof HTMLElement){if(t.dataset.refText||t.tagName==="BR")continue;if(t.tagName==="DIV"||t.tagName==="P"){const o=document.createElement("br");for(n.insertBefore(o,t);t.firstChild;)n.insertBefore(t.firstChild,t);n.removeChild(t)}}n.normalize()}function ki(n){const e=document.createRange();e.selectNodeContents(n),e.collapse(!1);const t=window.getSelection();t&&(t.removeAllRanges(),t.addRange(e))}function es(n,e){n.focus();const t=window.getSelection();if(!t||t.rangeCount===0){n.appendChild(e);return}const o=t.getRangeAt(0);o.deleteContents(),o.insertNode(e),o.setStartAfter(e),o.collapse(!0),t.removeAllRanges(),t.addRange(o)}function Xu(n,e){n.textContent=e,ki(n)}function Ju(n,e,t){const o=document.createElement("span");return o.contentEditable="false",o.dataset.refText=`@${n}:\`${e}\``,o.dataset.refKind=n,o.className="ref-chip",o.innerHTML=`<span class="ref-chip-icon">${r0(n)}</span><span class="ref-chip-label">${o0(t||e)}</span>`,o}function e0(n,e,t,o){const r=Ju(e,t,o);es(n,r);const s=document.createTextNode(" ");es(n,s)}function t0(n,e){const t=document.createElement("span");return t.contentEditable="false",t.dataset.refText=e,t.dataset.skillId=n,t.className="skill-chip",t.textContent=`/${n}`,t}function n0(n,e,t){n.textContent="";const o=t0(e,t);n.appendChild(o);const r=document.createTextNode(" ");n.appendChild(r),ki(n)}function o0(n){return n.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""")}function r0(n){switch(n){case"file":return'<svg width="12" height="12" viewBox="0 0 16 16" fill="none"><path d="M4 2h5l4 4v8a1 1 0 0 1-1 1H4a1 1 0 0 1-1-1V3a1 1 0 0 1 1-1z" stroke="currentColor" stroke-width="1.2"/><path d="M9 2v4h4" stroke="currentColor" stroke-width="1.2"/></svg>';case"url":return'<svg width="12" height="12" viewBox="0 0 16 16" fill="none"><path d="M6.5 9.5l3-3M7 11l-1.5 1.5a2.12 2.12 0 1 1-3-3L4 8m5-3l1.5-1.5a2.12 2.12 0 1 1 3 3L12 8" stroke="currentColor" stroke-width="1.2" stroke-linecap="round"/></svg>';case"image":return'<svg width="12" height="12" viewBox="0 0 16 16" fill="none"><rect x="2" y="2" width="12" height="12" rx="1" stroke="currentColor" stroke-width="1.2"/><circle cx="5.5" cy="5.5" r="1" fill="currentColor"/><path d="M2 11l3-3 2 2 3-3 4 4" stroke="currentColor" stroke-width="1.2" stroke-linecap="round"/></svg>';default:return'<svg width="12" height="12" viewBox="0 0 16 16" fill="none"><circle cx="8" cy="8" r="5" stroke="currentColor" stroke-width="1.2"/></svg>'}}const s0=a.forwardRef(function({placeholder:e,disabled:t,onInput:o,onKeyDown:r,onSlashTrigger:s,onSlashDismiss:l,onAtTrigger:c,onAtDismiss:u,onPasteFiles:p},d){const m=a.useRef(null),f=a.useRef(!1),b=a.useRef("");a.useImperativeHandle(d,()=>({focus(){var x;(x=m.current)==null||x.focus()},clear(){m.current&&(m.current.textContent="",b.current="")},getText(){return m.current?Ro(m.current):""},setText(x){m.current&&(Xu(m.current,x),b.current=x,o(x))},insertChip(x,j,v){m.current&&(m.current.focus(),e0(m.current,x,j,v),y())},setSkillChip(x,j){m.current&&(n0(m.current,x,j),y())},getElement(){return m.current}}));const y=a.useCallback(()=>{if(!m.current)return;const x=Ro(m.current);b.current=x,o(x);const j=x.trimStart();j.startsWith("/")&&!j.includes(`
|
||||
`)?s==null||s(j.slice(1)):l==null||l();const v=x.match(/@([^\s@]*)$/);v?c==null||c(v[1]):u==null||u()},[o,s,l,c,u]),S=a.useCallback(()=>{f.current||(m.current&&Yu(m.current),y())},[y]),w=a.useCallback(()=>{f.current=!0},[]),C=a.useCallback(()=>{f.current=!1,S()},[S]),k=a.useCallback(x=>{f.current||x.nativeEvent.isComposing||x.keyCode===229||r(x)},[r]),_=a.useCallback(x=>{var E;const j=(E=x.clipboardData)==null?void 0:E.items;if(!j)return;const v=[];for(const D of Array.from(j))if(D.type.startsWith("image/")&&D.type!=="image/svg+xml"){const P=D.getAsFile();P&&v.push(P)}if(v.length>0){x.preventDefault(),p==null||p(v);return}const O=x.clipboardData.getData("text/plain");O&&(x.preventDefault(),document.execCommand("insertText",!1,O))},[p]);return a.useEffect(()=>{const x=m.current;if(!x)return;const j=new ResizeObserver(v=>{var E,D,P;const O=((P=(D=(E=v[0])==null?void 0:E.borderBoxSize)==null?void 0:D[0])==null?void 0:P.blockSize)??x.offsetHeight;x.style.setProperty("--editor-scroll-height",`${O}px`)});return j.observe(x),()=>j.disconnect()},[]),i.jsx("div",{ref:m,"data-slot":"composer-rich-input",contentEditable:!t,role:"textbox","aria-multiline":"true","aria-placeholder":e,"data-placeholder":e,suppressContentEditableWarning:!0,onInput:S,onKeyDown:k,onCompositionStart:w,onCompositionEnd:C,onPaste:_})});function i0(){try{const n=localStorage.getItem("ga_custom_presets");return n?JSON.parse(n):[]}catch{return[]}}function a0({visible:n,query:e,onSelect:t,onClose:o}){const r=H(m=>m.lang),[s,l]=a.useState(0),c=a.useRef(null),u=i0(),p=[...Xe,...u],d=e?p.filter(m=>m.id.startsWith(e.toLowerCase())||m.title.toLowerCase().includes(e.toLowerCase())):p;return a.useEffect(()=>{l(0)},[e]),a.useEffect(()=>{if(!n)return;function m(f){f.key==="ArrowDown"?(f.preventDefault(),l(b=>Math.min(b+1,d.length-1))):f.key==="ArrowUp"?(f.preventDefault(),l(b=>Math.max(b-1,0))):f.key==="Enter"?(f.preventDefault(),d[s]&&t(d[s].id,d[s].prompt)):f.key==="Escape"&&(f.preventDefault(),o())}return document.addEventListener("keydown",m,!0),()=>document.removeEventListener("keydown",m,!0)},[n,s,d,t,o]),a.useEffect(()=>{if(!c.current)return;const m=c.current.querySelector("[data-focused]");m==null||m.scrollIntoView({block:"nearest"})},[s]),!n||d.length===0?null:i.jsx("div",{ref:c,"data-slot":"completion-drawer",children:d.map((m,f)=>i.jsx("button",{"data-slot":"completion-item","data-focused":f===s?"":void 0,onClick:()=>t(m.id,m.prompt),onMouseEnter:()=>l(f),children:i.jsxs("span",{"data-slot":"completion-info",children:[i.jsxs("span",{"data-slot":"completion-title",children:["/",m.id]}),i.jsx("span",{"data-slot":"completion-desc",children:m.desc[r]||m.desc.en})]})},m.id))})}const l0=[{id:"file",label:"file"},{id:"url",label:"url"},{id:"image",label:"image"}];function c0({visible:n,query:e,onConfirm:t,onClose:o}){const r=a.useRef(null),[s,l]=a.useState("file"),[c,u]=a.useState("");a.useEffect(()=>{n&&(u(e),l("file"),setTimeout(()=>{var d;return(d=r.current)==null?void 0:d.focus()},0))},[n,e]),a.useEffect(()=>{if(!n)return;function d(m){m.key==="Escape"&&(m.preventDefault(),m.stopPropagation(),o())}return document.addEventListener("keydown",d,!0),()=>document.removeEventListener("keydown",d,!0)},[n,o]);const p=a.useCallback(d=>{d.preventDefault();const m=c.trim();m&&t(s,m)},[s,c,t]);return n?i.jsx("div",{"data-slot":"at-ref-popover",children:i.jsxs("form",{onSubmit:p,"data-slot":"at-ref-form",children:[i.jsx("div",{"data-slot":"at-ref-kinds",children:l0.map(d=>i.jsx("button",{type:"button","data-slot":"at-ref-kind-btn","data-active":d.id===s?"":void 0,onClick:()=>l(d.id),title:d.label,children:i.jsx(d0,{kind:d.id})},d.id))}),i.jsx("input",{ref:r,"data-slot":"at-ref-input",type:"text",value:c,onChange:d=>u(d.target.value),placeholder:s==="url"?"https://...":"path/to/file"}),i.jsx("button",{type:"submit","data-slot":"at-ref-confirm",disabled:!c.trim(),children:"↵"})]})}):null}function d0({kind:n}){switch(n){case"file":return i.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 16 16",fill:"none",children:[i.jsx("path",{d:"M4 2h5l4 4v8a1 1 0 0 1-1 1H4a1 1 0 0 1-1-1V3a1 1 0 0 1 1-1z",stroke:"currentColor",strokeWidth:"1.2"}),i.jsx("path",{d:"M9 2v4h4",stroke:"currentColor",strokeWidth:"1.2"})]});case"url":return i.jsx("svg",{width:"12",height:"12",viewBox:"0 0 16 16",fill:"none",children:i.jsx("path",{d:"M6.5 9.5l3-3M7 11l-1.5 1.5a2.12 2.12 0 1 1-3-3L4 8m5-3l1.5-1.5a2.12 2.12 0 1 1 3 3L12 8",stroke:"currentColor",strokeWidth:"1.2",strokeLinecap:"round"})});case"image":return i.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 16 16",fill:"none",children:[i.jsx("rect",{x:"2",y:"2",width:"12",height:"12",rx:"1",stroke:"currentColor",strokeWidth:"1.2"}),i.jsx("circle",{cx:"5.5",cy:"5.5",r:"1",fill:"currentColor"}),i.jsx("path",{d:"M2 11l3-3 2 2 3-3 4 4",stroke:"currentColor",strokeWidth:"1.2",strokeLinecap:"round"})]});default:return null}}const ts={title:{zh:"附加",en:"Attach"},file:{zh:"文件…",en:"File…"},image:{zh:"图片…",en:"Image…"},paste:
Line truncated
|
||||
|
||||
`)})]})})]})}return this.props.children}}async function bm(){const n=document.getElementById("app");va.createRoot(n).render(i.jsx(ym,{children:i.jsx(gm,{})}))}bm();export{Hn as A,ee as B,ka as C,Re as D,ai as E,ut as F,ae as G,yi as H,Ha as I,uu as J,H as K,Ih as L,re as M,ph as N,Ee as O,G as P,Fa as Q,et as R,Sm as S,Ae as T,km as U,Aa as V,$o as W,Io as _,jm as a,ce as b,oi as c,Is as d,Zo as e,Pi as f,pl as g,Ie as h,Om as i,Lo as j,Yl as k,gt as l,Ve as m,X as n,Nl as o,zl as p,Al as q,$l as r,Qt as s,xl as t,_s as u,Fl as v,Vl as w,Il as x,Kl as y,pn as z};
|
||||
@@ -0,0 +1 @@
|
||||
*{box-sizing:border-box;margin:0;padding:0}.no-transition,.no-transition *,.no-transition *:before,.no-transition *:after{transition:none!important;animation:none!important}::-webkit-scrollbar{width:6px;height:6px}::-webkit-scrollbar-track{background:transparent}::-webkit-scrollbar-thumb{background:var(--semi-color-fill-2);border-radius:3px}::-webkit-scrollbar-thumb:hover{background:var(--semi-color-fill-1)}@font-face{font-family:codicon;src:url(/assets/codicon-DjkITdqj.ttf) format("truetype");font-weight:400;font-style:normal}.codicon{font-family:codicon;font-weight:400;font-style:normal;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}:root{--font-sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", system-ui, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;--font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Monaco, monospace;--foreground: hsl(0 0% 8%);--background: hsl(0 0% 100%);--ui-text-secondary: hsl(0 0% 30%);--ui-text-tertiary: hsl(0 0% 48%);--ui-text-quaternary: hsl(0 0% 60%);--ui-icon-nav: hsl(0 0% 24%);--ui-icon-nav-active: hsl(0 0% 8%);--theme-primary: hsl(220 80% 50%);--ui-row-hover-background: hsl(0 0% 95%);--ui-row-active-background: hsl(0 0% 92%);--ui-control-hover-background: hsl(0 0% 95%);--ui-control-active-background: hsl(0 0% 90%);--ui-sidebar-surface-background: hsl(0 0% 100%);--ui-stroke-tertiary: hsl(0 0% 88%);--sidebar-edge-border: hsl(0 0% 86%);--ui-accent: hsl(220 80% 50%);--chrome-action-hover: hsl(0 0% 93%);--dt-card: hsl(0 0% 100%);--dt-background: hsl(0 0% 97%);--ui-chat-surface-background: hsl(0 0% 100%);--ui-chat-bubble-background: hsl(0 0% 96%);--ui-stroke-secondary: hsl(0 0% 78%);--ui-tooltip-surface: #17181b;--ui-tooltip-text: #fff}[data-appearance=dark]{--foreground: hsl(0 0% 95%);--background: hsl(240 3% 7.5%);--ui-text-secondary: hsl(0 0% 78%);--ui-text-tertiary: hsl(0 0% 60%);--ui-text-quaternary: hsl(0 0% 48%);--ui-icon-nav: hsl(0 0% 72%);--ui-icon-nav-active: hsl(0 0% 95%);--theme-primary: hsl(220 80% 68%);--ui-row-hover-background: hsl(220 3% 15%);--ui-row-active-background: hsl(220 3% 18%);--ui-control-hover-background: hsl(220 3% 16%);--ui-control-active-background: hsl(220 3% 22%);--ui-sidebar-surface-background: hsl(210 3% 12%);--ui-stroke-tertiary: hsl(220 3% 22%);--sidebar-edge-border: hsl(220 3% 20%);--ui-accent: hsl(220 80% 68%);--chrome-action-hover: hsl(220 3% 18%);--dt-card: hsl(220 3% 14%);--dt-background: hsl(240 3% 7.5%);--ui-chat-surface-background: hsl(240 3% 7.5%);--ui-chat-bubble-background: hsl(220 3% 14%);--ui-stroke-secondary: hsl(220 3% 32%)}html,body,#app{height:100%;width:100%;overflow:hidden;font-family:var(--font-sans)}body{background:var(--background);color:var(--foreground);-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.semi-tooltip-wrapper{padding:5px 8px;background-color:var(--ui-tooltip-surface);color:var(--ui-tooltip-text);font-family:var(--font-sans);font-size:12px;line-height:18px}.semi-tooltip-wrapper .semi-tooltip-icon-arrow{color:var(--ui-tooltip-surface)}button,input,select,textarea{font-family:inherit;font-size:inherit;font-weight:inherit;line-height:inherit;color:inherit}[data-appearance=dark] body{color-scheme:dark}[data-slot=model-chip-label],[data-slot=model-menu-name],.ga-model-name,.ga-mixin-member-name{font-family:var(--font-mono)}.ga-root-error{width:min(100%,620px);min-height:100%;margin:0 auto;padding:48px 32px;overflow:auto;color:var(--semi-color-text-0)}.ga-root-error-result.semi-empty{padding:32px 0 18px}.ga-root-error-details{margin-top:18px;border-top:1px solid var(--semi-color-border)}.ga-root-error-details .semi-collapse-header{padding-inline:4px;color:var(--semi-color-text-2)}.ga-root-error-details .semi-typography{margin-top:0}.ga-root-error-details pre{max-height:280px;margin:0;padding:14px;overflow:auto;border:1px solid var(--semi-color-border);border-radius:var(--semi-border-radius-medium);outline:none;background:var(--semi-color-fill-0);color:var(--semi-color-text-1);font:12px/1.55 var(--font-mono);white-space:pre-wrap;overflow-wrap:anywhere;-webkit-user-select:text;user-select:text}.ga-root-error-details pre:focus-visible{border-color:var(--semi-color-primary);box-shadow:0 0 0 2px var(--semi-color-primary-light-default)}@keyframes semi-input-active{0%{transform:scale(1)}to{transform:scale(.97)}}@keyframes semi-input-inactive{0%{transform:scale(.97)}to{transform:scale(1)}}.semi-input{transition:background-color var(--semi-transition_duration-none) var(--semi-transition_function-easeIn) var(--semi-transition_delay-none),border var(--semi-transition_duration-none) var(--semi-transition_function-easeIn) var(--semi-transition_delay-none);transform:scale(var(--semi-transform_scale-none))}.semi-input-wrapper{display:inline-block;position:relative;vertical-align:middle;box-shadow:none;font-size:14px;line-height:20px;font-family:Inter,-apple-system,BlinkMacSystemFont,PingFang SC,Hiragino Sans GB,Microsoft YaHei,Segoe UI,Line truncated
|
||||
@@ -0,0 +1,295 @@
|
||||
import{g as ml,aj as jt}from"./tauri-compat-tfiFK9EG.js";import{V as To,W as Co}from"./main-Knf6L_en.js";function br(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?Ci(e.position):"start"in e||"end"in e?Ci(e):"line"in e||"column"in e?p0(e):""}function p0(e){return zi(e&&e.line)+":"+zi(e&&e.column)}function Ci(e){return p0(e&&e.start)+"-"+p0(e&&e.end)}function zi(e){return e&&typeof e=="number"?e:1}class Be extends Error{constructor(t,r,n){super(),typeof r=="string"&&(n=r,r=void 0);let i="",a={},l=!1;if(r&&("line"in r&&"column"in r?a={place:r}:"start"in r&&"end"in r?a={place:r}:"type"in r?a={ancestors:[r],place:r.position}:a={...r}),typeof t=="string"?i=t:!a.cause&&t&&(l=!0,i=t.message,a.cause=t),!a.ruleId&&!a.source&&typeof n=="string"){const o=n.indexOf(":");o===-1?a.ruleId=n:(a.source=n.slice(0,o),a.ruleId=n.slice(o+1))}if(!a.place&&a.ancestors&&a.ancestors){const o=a.ancestors[a.ancestors.length-1];o&&(a.place=o.position)}const s=a.place&&"start"in a.place?a.place.start:a.place;this.ancestors=a.ancestors||void 0,this.cause=a.cause||void 0,this.column=s?s.column:void 0,this.fatal=void 0,this.file="",this.message=i,this.line=s?s.line:void 0,this.name=br(a.place)||"1:1",this.place=a.place||void 0,this.reason=this.message,this.ruleId=a.ruleId||void 0,this.source=a.source||void 0,this.stack=l&&a.cause&&typeof a.cause.stack=="string"?a.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}Be.prototype.file="";Be.prototype.name="";Be.prototype.reason="";Be.prototype.message="";Be.prototype.stack="";Be.prototype.column=void 0;Be.prototype.line=void 0;Be.prototype.ancestors=void 0;Be.prototype.cause=void 0;Be.prototype.fatal=void 0;Be.prototype.place=void 0;Be.prototype.ruleId=void 0;Be.prototype.source=void 0;const at={basename:zo,dirname:Mo,extname:Eo,join:Io,sep:"/"};function zo(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');Mr(e);let r=0,n=-1,i=e.length,a;if(t===void 0||t.length===0||t.length>e.length){for(;i--;)if(e.codePointAt(i)===47){if(a){r=i+1;break}}else n<0&&(a=!0,n=i+1);return n<0?"":e.slice(r,n)}if(t===e)return"";let l=-1,s=t.length-1;for(;i--;)if(e.codePointAt(i)===47){if(a){r=i+1;break}}else l<0&&(a=!0,l=i+1),s>-1&&(e.codePointAt(i)===t.codePointAt(s--)?s<0&&(n=i):(s=-1,n=l));return r===n?n=l:n<0&&(n=e.length),e.slice(r,n)}function Mo(e){if(Mr(e),e.length===0)return".";let t=-1,r=e.length,n;for(;--r;)if(e.codePointAt(r)===47){if(n){t=r;break}}else n||(n=!0);return t<0?e.codePointAt(0)===47?"/":".":t===1&&e.codePointAt(0)===47?"//":e.slice(0,t)}function Eo(e){Mr(e);let t=e.length,r=-1,n=0,i=-1,a=0,l;for(;t--;){const s=e.codePointAt(t);if(s===47){if(l){n=t+1;break}continue}r<0&&(l=!0,r=t+1),s===46?i<0?i=t:a!==1&&(a=1):i>-1&&(a=-1)}return i<0||r<0||a===0||a===1&&i===r-1&&i===n+1?"":e.slice(i,r)}function Io(...e){let t=-1,r;for(;++t<e.length;)Mr(e[t]),e[t]&&(r=r===void 0?e[t]:r+"/"+e[t]);return r===void 0?".":Do(r)}function Do(e){Mr(e);const t=e.codePointAt(0)===47;let r=Bo(e,!t);return r.length===0&&!t&&(r="."),r.length>0&&e.codePointAt(e.length-1)===47&&(r+="/"),t?"/"+r:r}function Bo(e,t){let r="",n=0,i=-1,a=0,l=-1,s,o;for(;++l<=e.length;){if(l<e.length)s=e.codePointAt(l);else{if(s===47)break;s=47}if(s===47){if(!(i===l-1||a===1))if(i!==l-1&&a===2){if(r.length<2||n!==2||r.codePointAt(r.length-1)!==46||r.codePointAt(r.length-2)!==46){if(r.length>2){if(o=r.lastIndexOf("/"),o!==r.length-1){o<0?(r="",n=0):(r=r.slice(0,o),n=r.length-1-r.lastIndexOf("/")),i=l,a=0;continue}}else if(r.length>0){r="",n=0,i=l,a=0;continue}}t&&(r=r.length>0?r+"/..":"..",n=2)}else r.length>0?r+="/"+e.slice(i+1,l):r=e.slice(i+1,l),n=l-i-1;i=l,a=0}else s===46&&a>-1?a++:a=-1}return r}function Mr(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const Fo={cwd:Ro};function Ro(){return"/"}function d0(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function Lo(e){if(typeof e=="string")e=new URL(e);else if(!d0(e)){const t=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code="ERR_INVALID_ARG_TYPE",t}if(e.protocol!=="file:"){const t=new TypeError("The URL must be of scheme file");throw t.code="ERR_INVALID_URL_SCHEME",t}return No(e)}function No(e){if(e.hostname!==""){const n=new TypeError('File URL host must be "localhost" or empty on darwin');throw n.code="ERR_INVALID_FILE_URL_HOST",n}const t=e.pathname;let r=-1;for(;++r<t.length;)if(t.codePointAt(r)===37&&t.codePointAt(r+1)===50){const n=t.codePointAt(r+2);if(n===70||n===102){const i=new TypeError("File URL path must not include encoded / characters");throw i.code="ERR_INVALID_FILE_URL_PATH",i}}return decodeURIComponent(t)}const Rn=["history","path","basename","stem","extname","dirname"];class fl{constructor(t){let r;t?d0(t)?r={path:t}:typeof t=="string"||Po(t)?r={value:t}:r=t:r={},this.cwd="cwd"in r?"":Fo.cwd(),this.data={},thLine truncated
|
||||
`,u="/",h="*",m="",d="comment",p="declaration";function y(C,A){if(typeof C!="string")throw new TypeError("First argument must be a string");if(!C)return[];A=A||{};var z=1,I=1;function q(Y){var H=Y.match(t);H&&(z+=H.length);var ae=Y.lastIndexOf(o);I=~ae?Y.length-ae:I+Y.length}function O(){var Y={line:z,column:I};return function(H){return H.position=new M(Y),U(),H}}function M(Y){this.start=Y,this.end={line:z,column:I},this.source=A.source}M.prototype.content=C;function G(Y){var H=new Error(A.source+":"+z+":"+I+": "+Y);if(H.reason=Y,H.filename=A.source,H.line=z,H.column=I,H.source=C,!A.silent)throw H}function X(Y){var H=Y.exec(C);if(H){var ae=H[0];return q(ae),C=C.slice(ae.length),H}}function U(){X(r)}function E(Y){var H;for(Y=Y||[];H=V();)H!==!1&&Y.push(H);return Y}function V(){var Y=O();if(!(u!=C.charAt(0)||h!=C.charAt(1))){for(var H=2;m!=C.charAt(H)&&(h!=C.charAt(H)||u!=C.charAt(H+1));)++H;if(H+=2,m===C.charAt(H-1))return G("End of comment missing");var ae=C.slice(2,H-2);return I+=2,q(ae),C=C.slice(H),I+=2,Y({type:d,comment:ae})}}function $(){var Y=O(),H=X(n);if(H){if(V(),!X(i))return G("property missing ':'");var ae=X(a),pe=Y({type:p,property:w(H[0].replace(e,m)),value:ae?w(ae[0].replace(e,m)):m});return X(l),pe}}function se(){var Y=[];E(Y);for(var H;H=$();)H!==!1&&(Y.push(H),E(Y));return Y}return U(),se()}function w(C){return C?C.replace(s,m):m}return On=y,On}var Li;function Qo(){if(Li)return Kt;Li=1;var e=Kt&&Kt.__importDefault||function(n){return n&&n.__esModule?n:{default:n}};Object.defineProperty(Kt,"__esModule",{value:!0}),Kt.default=r;const t=e(Zo());function r(n,i){let a=null;if(!n||typeof n!="string")return a;const l=(0,t.default)(n),s=typeof i=="function";return l.forEach(o=>{if(o.type!=="declaration")return;const{property:u,value:h}=o;s?i(u,h,o):h&&(a=a||{},a[u]=h)}),a}return Kt}var pr={},Ni;function Jo(){if(Ni)return pr;Ni=1,Object.defineProperty(pr,"__esModule",{value:!0}),pr.camelCase=void 0;var e=/^--[a-zA-Z0-9_-]+$/,t=/-([a-z])/g,r=/^[^-]+$/,n=/^-(webkit|moz|ms|o|khtml)-/,i=/^-(ms)-/,a=function(u){return!u||r.test(u)||e.test(u)},l=function(u,h){return h.toUpperCase()},s=function(u,h){return"".concat(h,"-")},o=function(u,h){return h===void 0&&(h={}),a(u)?u:(u=u.toLowerCase(),h.reactCompat?u=u.replace(i,s):u=u.replace(n,s),u.replace(t,l))};return pr.camelCase=o,pr}var dr,Pi;function eu(){if(Pi)return dr;Pi=1;var e=dr&&dr.__importDefault||function(i){return i&&i.__esModule?i:{default:i}},t=e(Qo()),r=Jo();function n(i,a){var l={};return!i||typeof i!="string"||(0,t.default)(i,function(s,o){s&&o&&(l[(0,r.camelCase)(s,a)]=o)}),l}return n.default=n,dr=n,dr}var tu=eu();const ru=ml(tu),nu=/[ \t\n\f\r]/g;function iu(e){return typeof e=="object"?e.type==="text"?Oi(e.value):!1:Oi(e)}function Oi(e){return e.replace(nu,"")===""}const Sl=Al("end"),G0=Al("start");function Al(e){return t;function t(r){const n=r&&r.position&&r.position[e]||{};if(typeof n.line=="number"&&n.line>0&&typeof n.column=="number"&&n.column>0)return{line:n.line,column:n.column,offset:typeof n.offset=="number"&&n.offset>-1?n.offset:void 0}}}function au(e){const t=G0(e),r=Sl(e);if(t&&r)return{start:t,end:r}}function qi(e,t){const r=String(e);if(typeof t!="string")throw new TypeError("Expected character");let n=0,i=r.indexOf(t);for(;i!==-1;)n++,i=r.indexOf(t,i+t.length);return n}const Hi=document.createElement("i");function W0(e){const t="&"+e+";";Hi.innerHTML=t;const r=Hi.textContent;return r.charCodeAt(r.length-1)===59&&e!=="semi"||r===t?!1:r}const Ne=Dt(/[A-Za-z]/),Ie=Dt(/[\dA-Za-z]/),lu=Dt(/[#-'*+\--9=?A-Z^-~]/);function rn(e){return e!==null&&(e<32||e===127)}const y0=Dt(/\d/),su=Dt(/[\dA-Fa-f]/),ou=Dt(/[!-/:-@[-`{-~]/);function K(e){return e!==null&&e<-2}function me(e){return e!==null&&(e<0||e===32)}function le(e){return e===-2||e===-1||e===32}const dn=Dt(new RegExp("\\p{P}|\\p{S}","u")),Ut=Dt(/\s/);function Dt(e){return t;function t(r){return r!==null&&r>-1&&e.test(String.fromCharCode(r))}}function ie(e,t,r,n){const i=n?n-1:Number.POSITIVE_INFINITY;let a=0;return l;function l(o){return le(o)?(e.enter(r),s(o)):t(o)}function s(o){return le(o)&&a++<i?(e.consume(o),s):(e.exit(r),t(o))}}function Ge(e,t,r,n){const i=e.length;let a=0,l;if(t<0?t=-t>i?0:i+t:t=t>i?i:t,r=r>0?r:0,n.length<1e4)l=Array.from(n),l.unshift(t,r),e.splice(...l);else for(r&&e.splice(t,r);a<n.length;)l=n.slice(a,a+1e4),l.unshift(t,0),e.splice(...l),a+=1e4,t+=1e4}function Qe(e,t){return e.length>0?(Ge(e,e.length,0,t),e):t}function er(e){if(e===null||me(e)||Ut(e))return 1;if(dn(e))return 2}function gn(e,t,r){const n=[];let i=-1;for(;++i<e.length;){const a=e[i].resolveAll;a&&!n.includes(a)&&(t=a(t,r),n.push(a))}return t}const b0={name:"attention",resolveAll:uu,tokenize:cu};function uu(e,t){let r=-1,n,i,a,l,s,o,u,h;for(;++r<e.length;)if(e[r][0]==="enter"&&e[r][1].type==="attentionSequence"&&e[r][1]._close){for(n=r;n--;)if(e[n][0]==="exit"&&e[n][1].type==="attentionSequence"&&e[n][1]._open&&t.sliceSerialize(e[n][1]).charCodeAt(0)===t.sliceSerialize(e[r][1]).charCodeAt(0)){Line truncated
|
||||
`;break}case-3:{l=`\r
|
||||
`;break}case-2:{l=t?" ":" ";break}case-1:{if(!t&&i)continue;l=" ";break}default:l=String.fromCharCode(a)}i=a===-2,n.push(l)}return n.join("")}function Q1(e){const n={constructs:Bl([X1,...(e||{}).extensions||[]]),content:i(M1),defined:[],document:i(I1),flow:i(F1),lazy:{},string:i(N1),text:i(P1)};return n;function i(a){return l;function l(s){return Y1(n,a,s)}}}function J1(e){for(;!Ml(e););return e}const Yi=/[\0\t\n\r]/g;function ec(){let e=1,t="",r=!0,n;return i;function i(a,l,s){const o=[];let u,h,m,d,p;for(a=t+(typeof a=="string"?a.toString():new TextDecoder(l||void 0).decode(a)),m=0,t="",r&&(a.charCodeAt(0)===65279&&m++,r=void 0);m<a.length;){if(Yi.lastIndex=m,u=Yi.exec(a),d=u&&u.index!==void 0?u.index:a.length,p=a.charCodeAt(d),!u){t=a.slice(m);break}if(p===10&&m===d&&n)o.push(-3),n=void 0;else switch(n&&(o.push(-5),n=void 0),m<d&&(o.push(a.slice(m,d)),e+=d-m),p){case 0:{o.push(65533),e++;break}case 9:{for(h=Math.ceil(e/4)*4,o.push(-2);e++<h;)o.push(-1);break}case 10:{o.push(-4),e=1;break}default:n=!0,e=1}m=d+1}return s&&(n&&o.push(-5),t&&o.push(t),o.push(null)),o}}const tc=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function rc(e){return e.replace(tc,nc)}function nc(e,t,r){if(t)return t;if(r.charCodeAt(0)===35){const i=r.charCodeAt(1),a=i===120||i===88;return Rl(r.slice(a?2:1),a?16:10)}return W0(r)||e}const Pl={}.hasOwnProperty;function ic(e,t,r){return t&&typeof t=="object"&&(r=t,t=void 0),ac(r)(J1(Q1(r).document().write(ec()(e,t,!0))))}function ac(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:a(cr),autolinkProtocol:U,autolinkEmail:U,atxHeading:a(Lr),blockQuote:a(mt),characterEscape:U,characterReference:U,codeFenced:a(Ft),codeFencedFenceInfo:l,codeFencedFenceMeta:l,codeIndented:a(Ft,l),codeText:a(Rr,l),codeTextData:U,data:U,codeFlowValue:U,definition:a(Wt),definitionDestinationString:l,definitionLabelString:l,definitionTitleString:l,emphasis:a(Xt),hardBreakEscape:a(Nr),hardBreakTrailing:a(Nr),htmlFlow:a(Pr,l),htmlFlowData:U,htmlText:a(Pr,l),htmlTextData:U,image:a(Or),label:l,link:a(cr),listItem:a(Bn),listItemValue:d,listOrdered:a(Rt,m),listUnordered:a(Rt),paragraph:a(Fn),reference:S,referenceString:l,resourceDestinationString:l,resourceTitleString:l,setextHeading:a(Lr),strong:a(hr),thematicBreak:a(Hr)},exit:{atxHeading:o(),atxHeadingSequence:O,autolink:o(),autolinkEmail:Ue,autolinkProtocol:tt,blockQuote:o(),characterEscapeValue:E,characterReferenceMarkerHexadecimal:it,characterReferenceMarkerNumeric:it,characterReferenceValue:Te,characterReference:Ze,codeFenced:o(C),codeFencedFence:w,codeFencedFenceInfo:p,codeFencedFenceMeta:y,codeFlowValue:E,codeIndented:o(A),codeText:o(H),codeTextData:E,data:E,definition:o(),definitionDestinationString:q,definitionLabelString:z,definitionTitleString:I,emphasis:o(),hardBreakEscape:o($),hardBreakTrailing:o($),htmlFlow:o(se),htmlFlowData:E,htmlText:o(Y),htmlTextData:E,image:o(pe),label:$e,labelText:Me,lineEnding:V,link:o(ae),listItem:o(),listOrdered:o(),listUnordered:o(),paragraph:o(),referenceString:Ee,resourceDestinationString:k,resourceTitleString:xe,resource:Fe,setextHeading:o(X),setextHeadingLineSequence:G,setextHeadingText:M,strong:o(),thematicBreak:o()}};Ol(t,(e||{}).mdastExtensions||[]);const r={};return n;function n(D){let j={type:"root",children:[]};const Q={stack:[j],tokenStack:[],config:t,enter:s,exit:u,buffer:l,resume:h,data:r},ne=[];let ce=-1;for(;++ce<D.length;)if(D[ce][1].type==="listOrdered"||D[ce][1].type==="listUnordered")if(D[ce][0]==="enter")ne.push(ce);else{const rt=ne.pop();ce=i(D,rt,ce)}for(ce=-1;++ce<D.length;){const rt=t[D[ce][0]];Pl.call(rt,D[ce][1].type)&&rt[D[ce][1].type].call(Object.assign({sliceSerialize:D[ce][2].sliceSerialize},Q),D[ce][1])}if(Q.tokenStack.length>0){const rt=Q.tokenStack[Q.tokenStack.length-1];(rt[1]||Ki).call(Q,void 0,rt[0])}for(j.position={start:St(D.length>0?D[0][1].start:{line:1,column:1,offset:0}),end:St(D.length>0?D[D.length-2][1].end:{line:1,column:1,offset:0})},ce=-1;++ce<t.transforms.length;)j=t.transforms[ce](j)||j;return j}function i(D,j,Q){let ne=j-1,ce=-1,rt=!1,Lt,ft,mr,fr;for(;++ne<=Q;){const Ve=D[ne];switch(Ve[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{Ve[0]==="enter"?ce++:ce--,fr=void 0;break}case"lineEndingBlank":{Ve[0]==="enter"&&(Lt&&!fr&&!ce&&!mr&&(mr=ne),fr=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:fr=void 0}if(!ce&&Ve[0]==="enter"&&Ve[1].type==="listItemPrefix"||ce===-1&&Ve[0]==="exit"&&(Ve[1].type==="listUnordered"||Ve[1].type==="listOrdered")){if(Lt){let Yt=ne;for(ft=void 0;Yt--;){const pt=D[Yt];if(pt[1].type==="lineEnding"||pt[1].type==="lineEndingBlank"){if(pt[0]==="exit")continue;ft&&(D[ft][1].type="lineEndingBlank",rt=!0),pt[1].type="lineEnding",ft=Yt}else if(!(pt[1].type==="linePrefix"||pt[1].type==="blockQuotePrefix"||pt[1].type==="blockQuotePrefixWhitespace"||pt[1].type==="blockQuoteMarkLine truncated
|
||||
`}]}function cc(e,t){const r=t.value?t.value+`
|
||||
`:"",n={},i=t.lang?t.lang.split(/\s+/):[];i.length>0&&(n.className=["language-"+i[0]]);let a={type:"element",tagName:"code",properties:n,children:[{type:"text",value:r}]};return t.meta&&(a.data={meta:t.meta}),e.patch(t,a),a=e.applyData(t,a),a={type:"element",tagName:"pre",properties:{},children:[a]},e.patch(t,a),a}function hc(e,t){const r={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function mc(e,t){const r={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function fc(e,t){const r=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=String(t.identifier).toUpperCase(),i=ar(n.toLowerCase()),a=e.footnoteOrder.indexOf(n);let l,s=e.footnoteCounts.get(n);s===void 0?(s=0,e.footnoteOrder.push(n),l=e.footnoteOrder.length):l=a+1,s+=1,e.footnoteCounts.set(n,s);const o={type:"element",tagName:"a",properties:{href:"#"+r+"fn-"+i,id:r+"fnref-"+i+(s>1?"-"+s:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(l)}]};e.patch(t,o);const u={type:"element",tagName:"sup",properties:{},children:[o]};return e.patch(t,u),e.applyData(t,u)}function pc(e,t){const r={type:"element",tagName:"h"+t.depth,properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function dc(e,t){if(e.options.allowDangerousHtml){const r={type:"raw",value:t.value};return e.patch(t,r),e.applyData(t,r)}}function ql(e,t){const r=t.referenceType;let n="]";if(r==="collapsed"?n+="[]":r==="full"&&(n+="["+(t.label||t.identifier)+"]"),t.type==="imageReference")return[{type:"text",value:"!["+t.alt+n}];const i=e.all(t),a=i[0];a&&a.type==="text"?a.value="["+a.value:i.unshift({type:"text",value:"["});const l=i[i.length-1];return l&&l.type==="text"?l.value+=n:i.push({type:"text",value:n}),i}function gc(e,t){const r=String(t.identifier).toUpperCase(),n=e.definitionById.get(r);if(!n)return ql(e,t);const i={src:ar(n.url||""),alt:t.alt};n.title!==null&&n.title!==void 0&&(i.title=n.title);const a={type:"element",tagName:"img",properties:i,children:[]};return e.patch(t,a),e.applyData(t,a)}function vc(e,t){const r={src:ar(t.url)};t.alt!==null&&t.alt!==void 0&&(r.alt=t.alt),t.title!==null&&t.title!==void 0&&(r.title=t.title);const n={type:"element",tagName:"img",properties:r,children:[]};return e.patch(t,n),e.applyData(t,n)}function yc(e,t){const r={type:"text",value:t.value.replace(/\r?\n|\r/g," ")};e.patch(t,r);const n={type:"element",tagName:"code",properties:{},children:[r]};return e.patch(t,n),e.applyData(t,n)}function bc(e,t){const r=String(t.identifier).toUpperCase(),n=e.definitionById.get(r);if(!n)return ql(e,t);const i={href:ar(n.url||"")};n.title!==null&&n.title!==void 0&&(i.title=n.title);const a={type:"element",tagName:"a",properties:i,children:e.all(t)};return e.patch(t,a),e.applyData(t,a)}function xc(e,t){const r={href:ar(t.url)};t.title!==null&&t.title!==void 0&&(r.title=t.title);const n={type:"element",tagName:"a",properties:r,children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function wc(e,t,r){const n=e.all(t),i=r?kc(r):Hl(t),a={},l=[];if(typeof t.checked=="boolean"){const h=n[0];let m;h&&h.type==="element"&&h.tagName==="p"?m=h:(m={type:"element",tagName:"p",properties:{},children:[]},n.unshift(m)),m.children.length>0&&m.children.unshift({type:"text",value:" "}),m.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),a.className=["task-list-item"]}let s=-1;for(;++s<n.length;){const h=n[s];(i||s!==0||h.type!=="element"||h.tagName!=="p")&&l.push({type:"text",value:`
|
||||
`}),h.type==="element"&&h.tagName==="p"&&!i?l.push(...h.children):l.push(h)}const o=n[n.length-1];o&&(i||o.type!=="element"||o.tagName!=="p")&&l.push({type:"text",value:`
|
||||
`});const u={type:"element",tagName:"li",properties:a,children:l};return e.patch(t,u),e.applyData(t,u)}function kc(e){let t=!1;if(e.type==="list"){t=e.spread||!1;const r=e.children;let n=-1;for(;!t&&++n<r.length;)t=Hl(r[n])}return t}function Hl(e){const t=e.spread;return t??e.children.length>1}function Sc(e,t){const r={},n=e.all(t);let i=-1;for(typeof t.start=="number"&&t.start!==1&&(r.start=t.start);++i<n.length;){const l=n[i];if(l.type==="element"&&l.tagName==="li"&&l.properties&&Array.isArray(l.properties.className)&&l.properties.className.includes("task-list-item")){r.className=["contains-task-list"];break}}const a={type:"element",tagName:t.ordered?"ol":"ul",properties:r,children:e.wrap(n,!0)};return e.patch(t,a),e.applyData(t,a)}function Ac(e,t){const r={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function Tc(e,t){const r={type:"root",children:e.wrap(e.all(t))};return e.patch(t,r),e.applyData(t,r)}function Cc(e,t){const r={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function zc(e,t){const r=e.all(t),n=r.shift(),i=[];if(n){const l={type:"element",tagName:"thead",properties:{},children:e.wrap([n],!0)};e.patch(t.children[0],l),i.push(l)}if(r.length>0){const l={type:"element",tagName:"tbody",properties:{},children:e.wrap(r,!0)},s=G0(t.children[1]),o=Sl(t.children[t.children.length-1]);s&&o&&(l.position={start:s,end:o}),i.push(l)}const a={type:"element",tagName:"table",properties:{},children:e.wrap(i,!0)};return e.patch(t,a),e.applyData(t,a)}function Mc(e,t,r){const n=r?r.children:void 0,a=(n?n.indexOf(t):1)===0?"th":"td",l=r&&r.type==="table"?r.align:void 0,s=l?l.length:t.children.length;let o=-1;const u=[];for(;++o<s;){const m=t.children[o],d={},p=l?l[o]:void 0;p&&(d.align=p);let y={type:"element",tagName:a,properties:d,children:[]};m&&(y.children=e.all(m),e.patch(m,y),y=e.applyData(m,y)),u.push(y)}const h={type:"element",tagName:"tr",properties:{},children:e.wrap(u,!0)};return e.patch(t,h),e.applyData(t,h)}function Ec(e,t){const r={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}const Zi=9,Qi=32;function Ic(e){const t=String(e),r=/\r?\n|\r/g;let n=r.exec(t),i=0;const a=[];for(;n;)a.push(Ji(t.slice(i,n.index),i>0,!0),n[0]),i=n.index+n[0].length,n=r.exec(t);return a.push(Ji(t.slice(i),i>0,!1)),a.join("")}function Ji(e,t,r){let n=0,i=e.length;if(t){let a=e.codePointAt(n);for(;a===Zi||a===Qi;)n++,a=e.codePointAt(n)}if(r){let a=e.codePointAt(i-1);for(;a===Zi||a===Qi;)i--,a=e.codePointAt(i-1)}return i>n?e.slice(n,i):""}function Dc(e,t){const r={type:"text",value:Ic(String(t.value))};return e.patch(t,r),e.applyData(t,r)}function Bc(e,t){const r={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,r),e.applyData(t,r)}const Fc={blockquote:oc,break:uc,code:cc,delete:hc,emphasis:mc,footnoteReference:fc,heading:pc,html:dc,imageReference:gc,image:vc,inlineCode:yc,linkReference:bc,link:xc,listItem:wc,list:Sc,paragraph:Ac,root:Tc,strong:Cc,table:zc,tableCell:Ec,tableRow:Mc,text:Dc,thematicBreak:Bc,toml:jr,yaml:jr,definition:jr,footnoteDefinition:jr};function jr(){}const jl=-1,vn=0,wr=1,nn=2,K0=3,Z0=4,Q0=5,J0=6,$l=7,Ul=8,Vl=typeof self=="object"?self:globalThis,ea=(e,t)=>{switch(e){case"Function":case"SharedWorker":case"Worker":case"eval":case"setInterval":case"setTimeout":throw new TypeError("unable to deserialize "+e)}return new Vl[e](t)},Rc=(e,t)=>{const r=(i,a)=>(e.set(a,i),i),n=i=>{if(e.has(i))return e.get(i);const[a,l]=t[i];switch(a){case vn:case jl:return r(l,i);case wr:{const s=r([],i);for(const o of l)s.push(n(o));return s}case nn:{const s=r({},i);for(const[o,u]of l)s[n(o)]=n(u);return s}case K0:return r(new Date(l),i);case Z0:{const{source:s,flags:o}=l;return r(new RegExp(s,o),i)}case Q0:{const s=r(new Map,i);for(const[o,u]of l)s.set(n(o),n(u));return s}case J0:{const s=r(new Set,i);for(const o of l)s.add(n(o));return s}case $l:{const{name:s,message:o}=l;return r(typeof Vl[s]=="function"?ea(s,o):new Error(o),i)}case Ul:return r(BigInt(l),i);case"BigInt":return r(Object(BigInt(l)),i);case"ArrayBuffer":return r(new Uint8Array(l).buffer,l);case"DataView":{const{buffer:s}=new Uint8Array(l);return r(new DataView(s),l)}}return r(ea(a,l),i)};return n},ta=e=>Rc(new Map,e)(0),qt="",{toString:Lc}={},{keys:Nc}=Object,vr=e=>{const t=typeof e;if(t!=="object"||!e)return[vn,t];const r=Lc.call(e).slice(8,-1);switch(r){case"Array":return[wr,qt];case"Object":return[nn,qt];case"Date":return[K0,qt];case"RegExp":return[Z0,qt];case"Map":return[Q0,qt];case"Set":return[J0,qt];case"DataView":return[wr,r]}return r.includes("Array")?[wr,r]:e instanceof Error?[$l,e.name||"Error"]:[nn,r]},$r=([e,t])=>e===vn&&(t==="function"||t==="symbol"),Pc=(e,t,r,n)=>{const i=(l,s)=>{const o=n.push(l)-1;return r.set(s,o),o},a=l=>{if(r.has(l))return r.get(l);let[s,o]=vr(l);switch(s){case vn:{let h=l;switch(o){case"bigint":s=Ul,h=l.toString();break;case"function":case"symbol":
Line truncated
|
||||
`},{type:"element",tagName:"ol",properties:{},children:e.wrap(s,!0)},{type:"text",value:`
|
||||
`}]}}const Dr=(function(e){if(e==null)return Vc;if(typeof e=="function")return yn(e);if(typeof e=="object")return Array.isArray(e)?jc(e):$c(e);if(typeof e=="string")return Uc(e);throw new Error("Expected function, string, or object as test")});function jc(e){const t=[];let r=-1;for(;++r<e.length;)t[r]=Dr(e[r]);return yn(n);function n(...i){let a=-1;for(;++a<t.length;)if(t[a].apply(this,i))return!0;return!1}}function $c(e){const t=e;return yn(r);function r(n){const i=n;let a;for(a in e)if(i[a]!==t[a])return!1;return!0}}function Uc(e){return yn(t);function t(r){return r&&r.type===e}}function yn(e){return t;function t(r,n,i){return!!(_c(r)&&e.call(this,r,typeof n=="number"?n:void 0,i||void 0))}}function Vc(){return!0}function _c(e){return e!==null&&typeof e=="object"&&"type"in e}const _l=[],Gc=!0,x0=!1,Gl="skip";function ei(e,t,r,n){let i;typeof t=="function"&&typeof r!="function"?(n=r,r=t):i=t;const a=Dr(i),l=n?-1:1;s(e,void 0,[])();function s(o,u,h){const m=o&&typeof o=="object"?o:{};if(typeof m.type=="string"){const p=typeof m.tagName=="string"?m.tagName:typeof m.name=="string"?m.name:void 0;Object.defineProperty(d,"name",{value:"node ("+(o.type+(p?"<"+p+">":""))+")"})}return d;function d(){let p=_l,y,w,C;if((!t||a(o,u,h[h.length-1]||void 0))&&(p=Wc(r(o,h)),p[0]===x0))return p;if("children"in o&&o.children){const A=o;if(A.children&&p[0]!==Gl)for(w=(n?A.children.length:-1)+l,C=h.concat(A);w>-1&&w<A.children.length;){const z=A.children[w];if(y=s(z,w,C)(),y[0]===x0)return y;w=typeof y[1]=="number"?y[1]:w+l}}return p}}}function Wc(e){return Array.isArray(e)?e:typeof e=="number"?[Gc,e]:e==null?_l:[e]}function ti(e,t,r,n){let i,a,l;typeof t=="function"&&typeof r!="function"?(a=void 0,l=t,i=r):(a=t,l=r,i=n),ei(e,a,s,i);function s(o,u){const h=u[u.length-1],m=h?h.children.indexOf(o):void 0;return l(o,m,h)}}const w0={}.hasOwnProperty,Xc={};function Yc(e,t){const r=t||Xc,n=new Map,i=new Map,a=new Map,l={...Fc,...r.handlers},s={all:u,applyData:Zc,definitionById:n,footnoteById:i,footnoteCounts:a,footnoteOrder:[],handlers:l,one:o,options:r,patch:Kc,wrap:Jc};return ti(e,function(h){if(h.type==="definition"||h.type==="footnoteDefinition"){const m=h.type==="definition"?n:i,d=String(h.identifier).toUpperCase();m.has(d)||m.set(d,h)}}),s;function o(h,m){const d=h.type,p=s.handlers[d];if(w0.call(s.handlers,d)&&p)return p(s,h,m);if(s.options.passThrough&&s.options.passThrough.includes(d)){if("children"in h){const{children:w,...C}=h,A=an(C);return A.children=s.all(h),A}return an(h)}return(s.options.unknownHandler||Qc)(s,h,m)}function u(h){const m=[];if("children"in h){const d=h.children;let p=-1;for(;++p<d.length;){const y=s.one(d[p],h);if(y){if(p&&d[p-1].type==="break"&&(!Array.isArray(y)&&y.type==="text"&&(y.value=na(y.value)),!Array.isArray(y)&&y.type==="element")){const w=y.children[0];w&&w.type==="text"&&(w.value=na(w.value))}Array.isArray(y)?m.push(...y):m.push(y)}}}return m}}function Kc(e,t){e.position&&(t.position=au(e))}function Zc(e,t){let r=t;if(e&&e.data){const n=e.data.hName,i=e.data.hChildren,a=e.data.hProperties;if(typeof n=="string")if(r.type==="element")r.tagName=n;else{const l="children"in r?r.children:[r];r={type:"element",tagName:n,properties:{},children:l}}r.type==="element"&&a&&Object.assign(r.properties,an(a)),"children"in r&&r.children&&i!==null&&i!==void 0&&(r.children=i)}return r}function Qc(e,t){const r=t.data||{},n="value"in t&&!(w0.call(r,"hProperties")||w0.call(r,"hChildren"))?{type:"text",value:t.value}:{type:"element",tagName:"div",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Jc(e,t){const r=[];let n=-1;for(t&&r.push({type:"text",value:`
|
||||
`});++n<e.length;)n&&r.push({type:"text",value:`
|
||||
`}),r.push(e[n]);return t&&e.length>0&&r.push({type:"text",value:`
|
||||
`}),r}function na(e){let t=0,r=e.charCodeAt(t);for(;r===9||r===32;)t++,r=e.charCodeAt(t);return e.slice(t)}function ia(e,t){const r=Yc(e,t),n=r.one(e,void 0),i=Hc(r),a=Array.isArray(n)?{type:"root",children:n}:n||{type:"root",children:[]};return i&&a.children.push({type:"text",value:`
|
||||
`},i),a}function eh(e,t){return e&&"run"in e?async function(r,n){const i=ia(r,{file:n,...t});await e.run(i,n)}:function(r,n){return ia(r,{file:n,...e||t})}}function aa(e){if(e)throw e}var jn,la;function th(){if(la)return jn;la=1;var e=Object.prototype.hasOwnProperty,t=Object.prototype.toString,r=Object.defineProperty,n=Object.getOwnPropertyDescriptor,i=function(u){return typeof Array.isArray=="function"?Array.isArray(u):t.call(u)==="[object Array]"},a=function(u){if(!u||t.call(u)!=="[object Object]")return!1;var h=e.call(u,"constructor"),m=u.constructor&&u.constructor.prototype&&e.call(u.constructor.prototype,"isPrototypeOf");if(u.constructor&&!h&&!m)return!1;var d;for(d in u);return typeof d>"u"||e.call(u,d)},l=function(u,h){r&&h.name==="__proto__"?r(u,h.name,{enumerable:!0,configurable:!0,value:h.newValue,writable:!0}):u[h.name]=h.newValue},s=function(u,h){if(h==="__proto__")if(e.call(u,h)){if(n)return n(u,h).value}else return;return u[h]};return jn=function o(){var u,h,m,d,p,y,w=arguments[0],C=1,A=arguments.length,z=!1;for(typeof w=="boolean"&&(z=w,w=arguments[1]||{},C=2),(w==null||typeof w!="object"&&typeof w!="function")&&(w={});C<A;++C)if(u=arguments[C],u!=null)for(h in u)m=s(w,h),d=s(u,h),w!==d&&(z&&d&&(a(d)||(p=i(d)))?(p?(p=!1,y=m&&i(m)?m:[]):y=m&&a(m)?m:{},l(w,{name:h,newValue:o(z,y,d)})):typeof d<"u"&&l(w,{name:h,newValue:d}));return w},jn}var rh=th();const $n=ml(rh);function k0(e){if(typeof e!="object"||e===null)return!1;const t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function nh(){const e=[],t={run:r,use:n};return t;function r(...i){let a=-1;const l=i.pop();if(typeof l!="function")throw new TypeError("Expected function as last argument, not "+l);s(null,...i);function s(o,...u){const h=e[++a];let m=-1;if(o){l(o);return}for(;++m<i.length;)(u[m]===null||u[m]===void 0)&&(u[m]=i[m]);i=u,h?ih(h,s)(...u):l(null,...u)}}function n(i){if(typeof i!="function")throw new TypeError("Expected `middelware` to be a function, not "+i);return e.push(i),t}}function ih(e,t){let r;return n;function n(...l){const s=e.length>l.length;let o;s&&l.push(i);try{o=e.apply(this,l)}catch(u){const h=u;if(s&&r)throw h;return i(h)}s||(o&&o.then&&typeof o.then=="function"?o.then(a,i):o instanceof Error?i(o):a(o))}function i(l,...s){r||(r=!0,t(l,...s))}function a(l){i(null,l)}}const ah=(function(e){const n=this.constructor.prototype,i=n[e],a=function(){return i.apply(a,arguments)};return Object.setPrototypeOf(a,n),a}),lh={}.hasOwnProperty;class ri extends ah{constructor(){super("copy"),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=nh()}copy(){const t=new ri;let r=-1;for(;++r<this.attachers.length;){const n=this.attachers[r];t.use(...n)}return t.data($n(!0,{},this.namespace)),t}data(t,r){return typeof t=="string"?arguments.length===2?(_n("data",this.frozen),this.namespace[t]=r,this):lh.call(this.namespace,t)&&this.namespace[t]||void 0:t?(_n("data",this.frozen),this.namespace=t,this):this.namespace}freeze(){if(this.frozen)return this;const t=this;for(;++this.freezeIndex<this.attachers.length;){const[r,...n]=this.attachers[this.freezeIndex];if(n[0]===!1)continue;n[0]===!0&&(n[0]=void 0);const i=r.call(t,...n);typeof i=="function"&&this.transformers.use(i)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(t){this.freeze();const r=Ur(t),n=this.parser||this.Parser;return Un("parse",n),n(String(r),r)}process(t,r){const n=this;return this.freeze(),Un("process",this.parser||this.Parser),Vn("process",this.compiler||this.Compiler),r?i(void 0,r):new Promise(i);function i(a,l){const s=Ur(t),o=n.parse(s);n.run(o,s,function(h,m,d){if(h||!m||!d)return u(h);const p=m,y=n.stringify(p,d);uh(y)?d.value=y:d.result=y,u(h,d)});function u(h,m){h||!m?l(h):a?a(m):r(void 0,m)}}}processSync(t){let r=!1,n;return this.freeze(),Un("processSync",this.parser||this.Parser),Vn("processSync",this.compiler||this.Compiler),this.process(t,i),oa("processSync","process",r),n;function i(a,l){r=!0,aa(a),n=l}}run(t,r,n){sa(t),this.freeze();const i=this.transformers;return!n&&typeof r=="function"&&(n=r,r=void 0),n?a(void 0,n):new Promise(a);function a(l,s){const o=Ur(r);i.run(t,o,u);function u(h,m,d){const p=m||t;h?s(h):l?l(p):n(void 0,p,d)}}}runSync(t,r){let n=!1,i;return this.run(t,r,a),oa("runSync","run",n),i;function a(l,s){aa(l),i=s,n=!0}}stringify(t,r){this.freeze();const n=Ur(r),i=this.compiler||this.Compiler;return Vn("stringify",i),sa(t),i(t,n)}use(t,...r){const n=this.attachers,i=this.namespace;if(_n("use",this.frozen),t!=null)if(typeof t=="function")o(t,r);else if(typeof t=="object")Array.isArray(t)?s(t):l(t);else throw new TypeError("Expected usable value, not `"+t+"`");return this;function a(u){if(typeof u=="function")o(u,[]);else if(typeof u=="object")if(Array.isArray(u)){const[h,...m]=u;o(h,m)}else l(u)
Line truncated
|
||||
`:" ")+a.indentLines(a.containerFlow(n,s.current()),t?Yl:qh))),u(),o}}function qh(e,t,r){return t===0?e:Yl(e,t,r)}function Yl(e,t,r){return(r?"":" ")+e}const Hh=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];Kl.peek=_h;function jh(){return{canContainEols:["delete"],enter:{strikethrough:Uh},exit:{strikethrough:Vh}}}function $h(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:Hh}],handlers:{delete:Kl}}}function Uh(e){this.enter({type:"delete",children:[]},e)}function Vh(e){this.exit(e)}function Kl(e,t,r,n){const i=r.createTracker(n),a=r.enter("strikethrough");let l=i.move("~~");return l+=r.containerPhrasing(e,{...i.current(),before:l,after:"~"}),l+=i.move("~~"),a(),l}function _h(){return"~"}function Gh(e){return e.length}function Wh(e,t){const r=t||{},n=(r.align||[]).concat(),i=r.stringLength||Gh,a=[],l=[],s=[],o=[];let u=0,h=-1;for(;++h<e.length;){const w=[],C=[];let A=-1;for(e[h].length>u&&(u=e[h].length);++A<e[h].length;){const z=Xh(e[h][A]);if(r.alignDelimiters!==!1){const I=i(z);C[A]=I,(o[A]===void 0||I>o[A])&&(o[A]=I)}w.push(z)}l[h]=w,s[h]=C}let m=-1;if(typeof n=="object"&&"length"in n)for(;++m<u;)a[m]=ua(n[m]);else{const w=ua(n);for(;++m<u;)a[m]=w}m=-1;const d=[],p=[];for(;++m<u;){const w=a[m];let C="",A="";w===99?(C=":",A=":"):w===108?C=":":w===114&&(A=":");let z=r.alignDelimiters===!1?1:Math.max(1,o[m]-C.length-A.length);const I=C+"-".repeat(z)+A;r.alignDelimiters!==!1&&(z=C.length+z+A.length,z>o[m]&&(o[m]=z),p[m]=z),d[m]=I}l.splice(1,0,d),s.splice(1,0,p),h=-1;const y=[];for(;++h<l.length;){const w=l[h],C=s[h];m=-1;const A=[];for(;++m<u;){const z=w[m]||"";let I="",q="";if(r.alignDelimiters!==!1){const O=o[m]-(C[m]||0),M=a[m];M===114?I=" ".repeat(O):M===99?O%2?(I=" ".repeat(O/2+.5),q=" ".repeat(O/2-.5)):(I=" ".repeat(O/2),q=I):q=" ".repeat(O)}r.delimiterStart!==!1&&!m&&A.push("|"),r.padding!==!1&&!(r.alignDelimiters===!1&&z==="")&&(r.delimiterStart!==!1||m)&&A.push(" "),r.alignDelimiters!==!1&&A.push(I),A.push(z),r.alignDelimiters!==!1&&A.push(q),r.padding!==!1&&A.push(" "),(r.delimiterEnd!==!1||m!==u-1)&&A.push("|")}y.push(r.delimiterEnd===!1?A.join("").replace(/ +$/,""):A.join(""))}return y.join(`
|
||||
`)}function Xh(e){return e==null?"":String(e)}function ua(e){const t=typeof e=="string"?e.codePointAt(0):0;return t===67||t===99?99:t===76||t===108?108:t===82||t===114?114:0}function Yh(e,t,r,n){const i=r.enter("blockquote"),a=r.createTracker(n);a.move("> "),a.shift(2);const l=r.indentLines(r.containerFlow(e,a.current()),Kh);return i(),l}function Kh(e,t,r){return">"+(r?"":" ")+e}function Zh(e,t){return ca(e,t.inConstruct,!0)&&!ca(e,t.notInConstruct,!1)}function ca(e,t,r){if(typeof t=="string"&&(t=[t]),!t||t.length===0)return r;let n=-1;for(;++n<t.length;)if(e.includes(t[n]))return!0;return!1}function ha(e,t,r,n){let i=-1;for(;++i<r.unsafe.length;)if(r.unsafe[i].character===`
|
||||
`&&Zh(r.stack,r.unsafe[i]))return/[ \t]/.test(n.before)?"":" ";return`\\
|
||||
`}function Zl(e,t){const r=String(e);let n=r.indexOf(t),i=n,a=0,l=0;if(typeof t!="string")throw new TypeError("Expected substring");for(;n!==-1;)n===i?++a>l&&(l=a):a=1,i=n+t.length,n=r.indexOf(t,i);return l}function Qh(e,t){return!!(t.options.fences===!1&&e.value&&!e.lang&&/[^ \r\n]/.test(e.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(e.value))}function Jh(e){const t=e.options.fence||"`";if(t!=="`"&&t!=="~")throw new Error("Cannot serialize code with `"+t+"` for `options.fence`, expected `` ` `` or `~`");return t}function e4(e,t,r,n){const i=Jh(r),a=e.value||"",l=i==="`"?"GraveAccent":"Tilde";if(Qh(e,r)){const m=r.enter("codeIndented"),d=r.indentLines(a,t4);return m(),d}const s=r.createTracker(n),o=i.repeat(Math.max(Zl(a,i)+1,3)),u=r.enter("codeFenced");let h=s.move(o);if(e.lang){const m=r.enter(`codeFencedLang${l}`);h+=s.move(r.safe(e.lang,{before:h,after:" ",encode:["`"],...s.current()})),m()}if(e.lang&&e.meta){const m=r.enter(`codeFencedMeta${l}`);h+=s.move(" "),h+=s.move(r.safe(e.meta,{before:h,after:`
|
||||
`,encode:["`"],...s.current()})),m()}return h+=s.move(`
|
||||
`),a&&(h+=s.move(a+`
|
||||
`)),h+=s.move(o),u(),h}function t4(e,t,r){return(r?"":" ")+e}function ni(e){const t=e.options.quote||'"';if(t!=='"'&&t!=="'")throw new Error("Cannot serialize title with `"+t+"` for `options.quote`, expected `\"`, or `'`");return t}function r4(e,t,r,n){const i=ni(r),a=i==='"'?"Quote":"Apostrophe",l=r.enter("definition");let s=r.enter("label");const o=r.createTracker(n);let u=o.move("[");return u+=o.move(r.safe(r.associationId(e),{before:u,after:"]",...o.current()})),u+=o.move("]: "),s(),!e.url||/[\0- \u007F]/.test(e.url)?(s=r.enter("destinationLiteral"),u+=o.move("<"),u+=o.move(r.safe(e.url,{before:u,after:">",...o.current()})),u+=o.move(">")):(s=r.enter("destinationRaw"),u+=o.move(r.safe(e.url,{before:u,after:e.title?" ":`
|
||||
`,...o.current()}))),s(),e.title&&(s=r.enter(`title${a}`),u+=o.move(" "+i),u+=o.move(r.safe(e.title,{before:u,after:i,...o.current()})),u+=o.move(i),s()),l(),u}function n4(e){const t=e.options.emphasis||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize emphasis with `"+t+"` for `options.emphasis`, expected `*`, or `_`");return t}function Ar(e){return"&#x"+e.toString(16).toUpperCase()+";"}function ln(e,t,r){const n=er(e),i=er(t);return n===void 0?i===void 0?r==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:n===1?i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}Ql.peek=i4;function Ql(e,t,r,n){const i=n4(r),a=r.enter("emphasis"),l=r.createTracker(n),s=l.move(i);let o=l.move(r.containerPhrasing(e,{after:i,before:s,...l.current()}));const u=o.charCodeAt(0),h=ln(n.before.charCodeAt(n.before.length-1),u,i);h.inside&&(o=Ar(u)+o.slice(1));const m=o.charCodeAt(o.length-1),d=ln(n.after.charCodeAt(0),m,i);d.inside&&(o=o.slice(0,-1)+Ar(m));const p=l.move(i);return a(),r.attentionEncodeSurroundingInfo={after:d.outside,before:h.outside},s+o+p}function i4(e,t,r){return r.options.emphasis||"*"}function a4(e,t){let r=!1;return ti(e,function(n){if("value"in n&&/\r?\n|\r/.test(n.value)||n.type==="break")return r=!0,x0}),!!((!e.depth||e.depth<3)&&Y0(e)&&(t.options.setext||r))}function l4(e,t,r,n){const i=Math.max(Math.min(6,e.depth||1),1),a=r.createTracker(n);if(a4(e,r)){const h=r.enter("headingSetext"),m=r.enter("phrasing"),d=r.containerPhrasing(e,{...a.current(),before:`
|
||||
`,after:`
|
||||
`});return m(),h(),d+`
|
||||
`+(i===1?"=":"-").repeat(d.length-(Math.max(d.lastIndexOf("\r"),d.lastIndexOf(`
|
||||
`))+1))}const l="#".repeat(i),s=r.enter("headingAtx"),o=r.enter("phrasing");a.move(l+" ");let u=r.containerPhrasing(e,{before:"# ",after:`
|
||||
`,...a.current()});return/^[\t ]/.test(u)&&(u=Ar(u.charCodeAt(0))+u.slice(1)),u=u?l+" "+u:l,r.options.closeAtx&&(u+=" "+l),o(),s(),u}Jl.peek=s4;function Jl(e){return e.value||""}function s4(){return"<"}es.peek=o4;function es(e,t,r,n){const i=ni(r),a=i==='"'?"Quote":"Apostrophe",l=r.enter("image");let s=r.enter("label");const o=r.createTracker(n);let u=o.move("![");return u+=o.move(r.safe(e.alt,{before:u,after:"]",...o.current()})),u+=o.move("]("),s(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(s=r.enter("destinationLiteral"),u+=o.move("<"),u+=o.move(r.safe(e.url,{before:u,after:">",...o.current()})),u+=o.move(">")):(s=r.enter("destinationRaw"),u+=o.move(r.safe(e.url,{before:u,after:e.title?" ":")",...o.current()}))),s(),e.title&&(s=r.enter(`title${a}`),u+=o.move(" "+i),u+=o.move(r.safe(e.title,{before:u,after:i,...o.current()})),u+=o.move(i),s()),u+=o.move(")"),l(),u}function o4(){return"!"}ts.peek=u4;function ts(e,t,r,n){const i=e.referenceType,a=r.enter("imageReference");let l=r.enter("label");const s=r.createTracker(n);let o=s.move("![");const u=r.safe(e.alt,{before:o,after:"]",...s.current()});o+=s.move(u+"]["),l();const h=r.stack;r.stack=[],l=r.enter("reference");const m=r.safe(r.associationId(e),{before:o,after:"]",...s.current()});return l(),r.stack=h,a(),i==="full"||!u||u!==m?o+=s.move(m+"]"):i==="shortcut"?o=o.slice(0,-1):o+=s.move("]"),o}function u4(){return"!"}rs.peek=c4;function rs(e,t,r){let n=e.value||"",i="`",a=-1;for(;new RegExp("(^|[^`])"+i+"([^`]|$)").test(n);)i+="`";for(/[^ \r\n]/.test(n)&&(/^[ \r\n]/.test(n)&&/[ \r\n]$/.test(n)||/^`|`$/.test(n))&&(n=" "+n+" ");++a<r.unsafe.length;){const l=r.unsafe[a],s=r.compilePattern(l);let o;if(l.atBreak)for(;o=s.exec(n);){let u=o.index;n.charCodeAt(u)===10&&n.charCodeAt(u-1)===13&&u--,n=n.slice(0,u)+" "+n.slice(o.index+1)}}return i+n+i}function c4(){return"`"}function ns(e,t){const r=Y0(e);return!!(!t.options.resourceLink&&e.url&&!e.title&&e.children&&e.children.length===1&&e.children[0].type==="text"&&(r===e.url||"mailto:"+r===e.url)&&/^[a-z][a-z+.-]+:/i.test(e.url)&&!/[\0- <>\u007F]/.test(e.url))}is.peek=h4;function is(e,t,r,n){const i=ni(r),a=i==='"'?"Quote":"Apostrophe",l=r.createTracker(n);let s,o;if(ns(e,r)){const h=r.stack;r.stack=[],s=r.enter("autolink");let m=l.move("<");return m+=l.move(r.containerPhrasing(e,{before:m,after:">",...l.current()})),m+=l.move(">"),s(),r.stack=h,m}s=r.enter("link"),o=r.enter("label");let u=l.move("[");return u+=l.move(r.containerPhrasing(e,{before:u,after:"](",...l.current()})),u+=l.move("]("),o(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(o=r.enter("destinationLiteral"),u+=l.move("<"),u+=l.move(r.safe(e.url,{before:u,after:">",...l.current()})),u+=l.move(">")):(o=r.enter("destinationRaw"),u+=l.move(r.safe(e.url,{before:u,after:e.title?" ":")",...l.current()}))),o(),e.title&&(o=r.enter(`title${a}`),u+=l.move(" "+i),u+=l.move(r.safe(e.title,{before:u,after:i,...l.current()})),u+=l.move(i),o()),u+=l.move(")"),s(),u}function h4(e,t,r){return ns(e,r)?"<":"["}as.peek=m4;function as(e,t,r,n){const i=e.referenceType,a=r.enter("linkReference");let l=r.enter("label");const s=r.createTracker(n);let o=s.move("[");const u=r.containerPhrasing(e,{before:o,after:"]",...s.current()});o+=s.move(u+"]["),l();const h=r.stack;r.stack=[],l=r.enter("reference");const m=r.safe(r.associationId(e),{before:o,after:"]",...s.current()});return l(),r.stack=h,a(),i==="full"||!u||u!==m?o+=s.move(m+"]"):i==="shortcut"?o=o.slice(0,-1):o+=s.move("]"),o}function m4(){return"["}function ii(e){const t=e.options.bullet||"*";if(t!=="*"&&t!=="+"&&t!=="-")throw new Error("Cannot serialize items with `"+t+"` for `options.bullet`, expected `*`, `+`, or `-`");return t}function f4(e){const t=ii(e),r=e.options.bulletOther;if(!r)return t==="*"?"-":"*";if(r!=="*"&&r!=="+"&&r!=="-")throw new Error("Cannot serialize items with `"+r+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(r===t)throw new Error("Expected `bullet` (`"+t+"`) and `bulletOther` (`"+r+"`) to be different");return r}function p4(e){const t=e.options.bulletOrdered||".";if(t!=="."&&t!==")")throw new Error("Cannot serialize items with `"+t+"` for `options.bulletOrdered`, expected `.` or `)`");return t}function ls(e){const t=e.options.rule||"*";if(t!=="*"&&t!=="-"&&t!=="_")throw new Error("Cannot serialize rules with `"+t+"` for `options.rule`, expected `*`, `-`, or `_`");return t}function d4(e,t,r,n){const i=r.enter("list"),a=r.bulletCurrent;let l=e.ordered?p4(r):ii(r);const s=e.ordered?l==="."?")":".":f4(r);let o=t&&r.bulletLastUsed?l===r.bulletLastUsed:!1;if(!e.ordered){const h=e.children?e.children[0]:void 0;if((l==="*"||l==="-")&&h&&(!h.children||!h.children[0])&&r.stack[r.stack.length-1]==="list"&&r.stack[r.stack.length-2]==="listItem"&&r.stack[r.stack.length-3]==="list"&&r.stack[r.stack.length-4]==="listItem"&&r.indexStack[r.indexStack.length-1]===0&&r.indexStack[r.indexStack.length-2]===0&&r.indexStack[r.indexStack.length-3]===0&&(o=!0),ls(r)===l&&h){let m=-1;for(;++m<e.chilLine truncated
|
||||
`,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:d,table:l,tableCell:o,tableRow:s}};function l(p,y,w,C){return u(h(p,w,C),p.align)}function s(p,y,w,C){const A=m(p,w,C),z=u([A]);return z.slice(0,z.indexOf(`
|
||||
`))}function o(p,y,w,C){const A=w.enter("tableCell"),z=w.enter("phrasing"),I=w.containerPhrasing(p,{...C,before:a,after:a});return z(),A(),I}function u(p,y){return Wh(p,{align:y,alignDelimiters:n,padding:r,stringLength:i})}function h(p,y,w){const C=p.children;let A=-1;const z=[],I=y.enter("table");for(;++A<C.length;)z[A]=m(C[A],y,w);return I(),z}function m(p,y,w){const C=p.children;let A=-1;const z=[],I=y.enter("tableRow");for(;++A<C.length;)z[A]=o(C[A],p,y,w);return I(),z}function d(p,y,w){let C=os.inlineCode(p,y,w);return w.stack.includes("tableCell")&&(C=C.replace(/\|/g,"\\$&")),C}}function F4(){return{exit:{taskListCheckValueChecked:fa,taskListCheckValueUnchecked:fa,paragraph:L4}}}function R4(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:N4}}}function fa(e){const t=this.stack[this.stack.length-2];t.type,t.checked=e.type==="taskListCheckValueChecked"}function L4(e){const t=this.stack[this.stack.length-2];if(t&&t.type==="listItem"&&typeof t.checked=="boolean"){const r=this.stack[this.stack.length-1];r.type;const n=r.children[0];if(n&&n.type==="text"){const i=t.children;let a=-1,l;for(;++a<i.length;){const s=i[a];if(s.type==="paragraph"){l=s;break}}l===r&&(n.value=n.value.slice(1),n.value.length===0?r.children.shift():r.position&&n.position&&typeof n.position.start.offset=="number"&&(n.position.start.column++,n.position.start.offset++,r.position.start=Object.assign({},n.position.start)))}}this.exit(e)}function N4(e,t,r,n){const i=e.children[0],a=typeof e.checked=="boolean"&&i&&i.type==="paragraph",l="["+(e.checked?"x":" ")+"] ",s=r.createTracker(n);a&&s.move(l);let o=os.listItem(e,t,r,{...n,...s.current()});return a&&(o=o.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,u)),o;function u(h){return h+l}}function P4(){return[gh(),Ph(),jh(),C4(),F4()]}function O4(e){return{extensions:[vh(),Oh(e),$h(),B4(e),R4()]}}const q4={tokenize:_4,partial:!0},us={tokenize:G4,partial:!0},cs={tokenize:W4,partial:!0},hs={tokenize:X4,partial:!0},H4={tokenize:Y4,partial:!0},ms={name:"wwwAutolink",tokenize:U4,previous:ps},fs={name:"protocolAutolink",tokenize:V4,previous:ds},bt={name:"emailAutolink",tokenize:$4,previous:gs},ot={};function j4(){return{text:ot}}let Nt=48;for(;Nt<123;)ot[Nt]=bt,Nt++,Nt===58?Nt=65:Nt===91&&(Nt=97);ot[43]=bt;ot[45]=bt;ot[46]=bt;ot[95]=bt;ot[72]=[bt,fs];ot[104]=[bt,fs];ot[87]=[bt,ms];ot[119]=[bt,ms];function $4(e,t,r){const n=this;let i,a;return l;function l(m){return!S0(m)||!gs.call(n,n.previous)||ai(n.events)?r(m):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),s(m))}function s(m){return S0(m)?(e.consume(m),s):m===64?(e.consume(m),o):r(m)}function o(m){return m===46?e.check(H4,h,u)(m):m===45||m===95||Ie(m)?(a=!0,e.consume(m),o):h(m)}function u(m){return e.consume(m),i=!0,o}function h(m){return a&&i&&Ne(n.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),t(m)):r(m)}}function U4(e,t,r){const n=this;return i;function i(l){return l!==87&&l!==119||!ps.call(n,n.previous)||ai(n.events)?r(l):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(q4,e.attempt(us,e.attempt(cs,a),r),r)(l))}function a(l){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),t(l)}}function V4(e,t,r){const n=this;let i="",a=!1;return l;function l(m){return(m===72||m===104)&&ds.call(n,n.previous)&&!ai(n.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),i+=String.fromCodePoint(m),e.consume(m),s):r(m)}function s(m){if(Ne(m)&&i.length<5)return i+=String.fromCodePoint(m),e.consume(m),s;if(m===58){const d=i.toLowerCase();if(d==="http"||d==="https")return e.consume(m),o}return r(m)}function o(m){return m===47?(e.consume(m),a?u:(a=!0,o)):r(m)}function u(m){return m===null||rn(m)||me(m)||Ut(m)||dn(m)?r(m):e.attempt(us,e.attempt(cs,h),r)(m)}function h(m){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),t(m)}}function _4(e,t,r){let n=0;return i;function i(l){return(l===87||l===119)&&n<3?(n++,e.consume(l),i):l===46&&n===3?(e.consume(l),a):r(l)}function a(l){return l===null?r(l):t(l)}}function G4(e,t,r){let n,i,a;return l;function l(u){return u===46||u===95?e.check(hs,o,s)(u):u===null||me(u)||Ut(u)||u!==45&&dn(u)?o(u):(a=!0,e.consume(u),l)}function s(u){return u===95?n=!0:(i=n,n=void 0),e.consume(u),l}function o(u){return i||n||!a?r(u):t(u)}}function W4(e,t){let r=0,n=0;return i;function i(l){return l===40?(r++,e.consume(l),i):l===41&&n<r?a(l):l===33||l===34||l===38||l===39||l===41||l===42||l===44||l===46||l===58||l===59||l===60||l===63||l===93||l===95||l===126?e.check(hs,t,a)(l):l===null||me(l)||Ut(l)?t(l):(e.consume(l),i)}function a(l){return l===41&&n++,e.consume(l),i}}function X4(e,t,r){return n;function n(s){return s===33||s===34||s===39||s===41||s===42||s===44||s===46||s===58||s===59||s===63||s===95||s===126?(e.consume(s),n):s===38?(e.consume(s),a):s===93?(e.consume(s),i):s===60||s===null||me(s)||Ut(s)?t(s):r(s)}function i(s){return s===null||s===40||s===91||me(s)||Ut(s)?t(s):n(s)}function a(s){return Ne(s)?l(s):r(s)}function l(s){re
Line truncated
|
||||
`,inConstruct:"mathFlowMeta"},{character:"$",after:t?void 0:"\\$",inConstruct:"phrasing"},{character:"$",inConstruct:"mathFlowMeta"},{atBreak:!0,character:"$",after:"\\$"}],handlers:{math:r,inlineMath:n}};function r(a,l,s,o){const u=a.value||"",h=s.createTracker(o),m="$".repeat(Math.max(Zl(u,"$")+1,2)),d=s.enter("mathFlow");let p=h.move(m);if(a.meta){const y=s.enter("mathFlowMeta");p+=h.move(s.safe(a.meta,{after:`
|
||||
`,before:p,encode:["$"],...h.current()})),y()}return p+=h.move(`
|
||||
`),u&&(p+=h.move(u+`
|
||||
`)),p+=h.move(m),d(),p}function n(a,l,s){let o=a.value||"",u=1;for(t||u++;new RegExp("(^|[^$])"+"\\$".repeat(u)+"([^$]|$)").test(o);)u++;const h="$".repeat(u);/[^ \r\n]/.test(o)&&(/^[ \r\n]/.test(o)&&/[ \r\n]$/.test(o)||/^\$|\$$/.test(o))&&(o=" "+o+" ");let m=-1;for(;++m<s.unsafe.length;){const d=s.unsafe[m];if(!d.atBreak)continue;const p=s.compilePattern(d);let y;for(;y=p.exec(o);){let w=y.index;o.codePointAt(w)===10&&o.codePointAt(w-1)===13&&w--,o=o.slice(0,w)+" "+o.slice(y.index+1)}}return h+o+h}function i(){return"$"}}const Wm={tokenize:Xm,concrete:!0,name:"mathFlow"},va={tokenize:Ym,partial:!0};function Xm(e,t,r){const n=this,i=n.events[n.events.length-1],a=i&&i[1].type==="linePrefix"?i[2].sliceSerialize(i[1],!0).length:0;let l=0;return s;function s(z){return e.enter("mathFlow"),e.enter("mathFlowFence"),e.enter("mathFlowFenceSequence"),o(z)}function o(z){return z===36?(e.consume(z),l++,o):l<2?r(z):(e.exit("mathFlowFenceSequence"),ie(e,u,"whitespace")(z))}function u(z){return z===null||K(z)?m(z):(e.enter("mathFlowFenceMeta"),e.enter("chunkString",{contentType:"string"}),h(z))}function h(z){return z===null||K(z)?(e.exit("chunkString"),e.exit("mathFlowFenceMeta"),m(z)):z===36?r(z):(e.consume(z),h)}function m(z){return e.exit("mathFlowFence"),n.interrupt?t(z):e.attempt(va,d,C)(z)}function d(z){return e.attempt({tokenize:A,partial:!0},C,p)(z)}function p(z){return(a?ie(e,y,"linePrefix",a+1):y)(z)}function y(z){return z===null?C(z):K(z)?e.attempt(va,d,C)(z):(e.enter("mathFlowValue"),w(z))}function w(z){return z===null||K(z)?(e.exit("mathFlowValue"),y(z)):(e.consume(z),w)}function C(z){return e.exit("mathFlow"),t(z)}function A(z,I,q){let O=0;return ie(z,M,"linePrefix",n.parser.constructs.disable.null.includes("codeIndented")?void 0:4);function M(U){return z.enter("mathFlowFence"),z.enter("mathFlowFenceSequence"),G(U)}function G(U){return U===36?(O++,z.consume(U),G):O<l?q(U):(z.exit("mathFlowFenceSequence"),ie(z,X,"whitespace")(U))}function X(U){return U===null||K(U)?(z.exit("mathFlowFence"),I(U)):q(U)}}}function Ym(e,t,r){const n=this;return i;function i(l){return l===null?t(l):(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),a)}function a(l){return n.parser.lazy[n.now().line]?r(l):t(l)}}function Km(e){let r=(e||{}).singleDollarTextMath;return r==null&&(r=!0),{tokenize:n,resolve:Zm,previous:Qm,name:"mathText"};function n(i,a,l){let s=0,o,u;return h;function h(w){return i.enter("mathText"),i.enter("mathTextSequence"),m(w)}function m(w){return w===36?(i.consume(w),s++,m):s<2&&!r?l(w):(i.exit("mathTextSequence"),d(w))}function d(w){return w===null?l(w):w===36?(u=i.enter("mathTextSequence"),o=0,y(w)):w===32?(i.enter("space"),i.consume(w),i.exit("space"),d):K(w)?(i.enter("lineEnding"),i.consume(w),i.exit("lineEnding"),d):(i.enter("mathTextData"),p(w))}function p(w){return w===null||w===32||w===36||K(w)?(i.exit("mathTextData"),d(w)):(i.consume(w),p)}function y(w){return w===36?(i.consume(w),o++,y):o===s?(i.exit("mathTextSequence"),i.exit("mathText"),a(w)):(u.type="mathTextData",p(w))}}}function Zm(e){let t=e.length-4,r=3,n,i;if((e[r][1].type==="lineEnding"||e[r][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(n=r;++n<t;)if(e[n][1].type==="mathTextData"){e[t][1].type="mathTextPadding",e[r][1].type="mathTextPadding",r+=2,t-=2;break}}for(n=r-1,t++;++n<=t;)i===void 0?n!==t&&e[n][1].type!=="lineEnding"&&(i=n):(n===t||e[n][1].type==="lineEnding")&&(e[i][1].type="mathTextData",n!==i+2&&(e[i][1].end=e[n-1][1].end,e.splice(i+2,n-i-2),t-=n-i-2,n=i+2),i=void 0);return e}function Qm(e){return e!==36||this.events[this.events.length-1][1].type==="characterEscape"}function Jm(e){return{flow:{36:Wm},text:{36:Km(e)}}}const ef={};function _5(e){const t=this,r=e||ef,n=t.data(),i=n.micromarkExtensions||(n.micromarkExtensions=[]),a=n.fromMarkdownExtensions||(n.fromMarkdownExtensions=[]),l=n.toMarkdownExtensions||(n.toMarkdownExtensions=[]);i.push(Jm(r)),a.push(_m()),l.push(Gm(r))}const ya=/[#.]/g;function tf(e,t){const r=e||"",n={};let i=0,a,l;for(;i<r.length;){ya.lastIndex=i;const s=ya.exec(r),o=r.slice(i,s?s.index:r.length);o&&(a?a==="#"?n.id=o:Array.isArray(n.className)?n.className.push(o):n.className=[o]:l=o,i+=o.length),s&&(a=s[0],i++)}return{type:"element",tagName:l||t||"div",properties:n,children:[]}}function ws(e,t,r){const n=r?lf(r):void 0;function i(a,l,...s){let o;if(a==null){o={type:"root",children:[]};const u=l;s.unshift(u)}else{o=tf(a,t);const u=o.tagName.toLowerCase(),h=n?n.get(u):void 0;if(o.tagName=h||u,rf(l))s.unshift(l);else for(const[m,d]of Object.entries(l))nf(e,o.properties,m,d)}for(const u of s)A0(o.children,u);return o.type==="element"&&o.tagName==="template"&&(o.content={type:"root",children:o.children},o.children=[]),o}return i}function rf(e){if(e===null||typeof e!="object"||Array.isArray(e))return!0;if(typeof e.type!="string")return!1;const t=e,r=Object.keys(e);for(const n of r){const i=t[n];if(i&&typeof i=="object"){if(!Array.isArray(i))return!0;const a=i;for(const l of
Line truncated
|
||||
`.repeat(u)||" "),u=-1,o.push(h))}return o.join("")}function Ts(e,t,r){return e.type==="element"?Tf(e,t,r):e.type==="text"?r.whitespace==="normal"?Cs(e,r):Cf(e):[]}function Tf(e,t,r){const n=zs(e,r),i=e.children||[];let a=-1,l=[];if(Sf(e))return l;let s,o;for(T0(e)||Ta(e)&&wa(t,e,Ta)?o=`
|
||||
`:kf(e)?(s=2,o=2):As(e)&&(s=1,o=1);++a<i.length;)l=l.concat(Ts(i[a],e,{whitespace:n,breakBefore:a?void 0:s,breakAfter:a<i.length-1?T0(i[a+1]):o}));return Aa(e)&&wa(t,e,Aa)&&l.push(" "),s&&l.unshift(s),o&&l.push(o),l}function Cs(e,t){const r=String(e.value),n=[],i=[];let a=0;for(;a<=r.length;){ka.lastIndex=a;const o=ka.exec(r),u=o&&"index"in o?o.index:r.length;n.push(zf(r.slice(a,u).replace(/[\u061C\u200E\u200F\u202A-\u202E\u2066-\u2069]/g,""),a===0?t.breakBefore:!0,u===r.length?t.breakAfter:!0)),a=u+1}let l=-1,s;for(;++l<n.length;)n[l].charCodeAt(n[l].length-1)===8203||l<n.length-1&&n[l+1].charCodeAt(0)===8203?(i.push(n[l]),s=void 0):n[l]?(typeof s=="number"&&i.push(s),i.push(n[l]),s=0):(l===0||l===n.length-1)&&i.push(0);return i}function Cf(e){return[String(e.value)]}function zf(e,t,r){const n=[];let i=0,a;for(;i<e.length;){Sa.lastIndex=i;const l=Sa.exec(e);a=l?l.index:e.length,!i&&!a&&l&&!t&&n.push(""),i!==a&&n.push(e.slice(i,a)),i=l?a+l[0].length:a}return i!==a&&!r&&n.push(""),n.join(" ")}function zs(e,t){if(e.type==="element"){const r=e.properties||{};switch(e.tagName){case"listing":case"plaintext":case"xmp":return"pre";case"nobr":return"nowrap";case"pre":return r.wrap?"pre-wrap":"pre";case"td":case"th":return r.noWrap?"nowrap":t.whitespace;case"textarea":return"pre-wrap"}}return t.whitespace}function Mf(e){return!!(e.properties||{}).hidden}function Ef(e){return e.tagName==="td"||e.tagName==="th"}function If(e){return e.tagName==="dialog"&&!(e.properties||{}).open}class L extends Error{constructor(t,r){var n="KaTeX parse error: "+t,i,a,l=r&&r.loc;if(l&&l.start<=l.end){var s=l.lexer.input;i=l.start,a=l.end,i===s.length?n+=" at end of input: ":n+=" at position "+(i+1)+": ";var o=s.slice(i,a).replace(/[^]/g,"$&̲"),u;i>15?u="…"+s.slice(i-15,i):u=s.slice(0,i);var h;a+15<s.length?h=s.slice(a,a+15)+"…":h=s.slice(a),n+=u+o+h}super(n),this.name="ParseError",this.position=void 0,this.length=void 0,this.rawMessage=void 0,Object.setPrototypeOf(this,L.prototype),this.position=i,i!=null&&a!=null&&(this.length=a-i),this.rawMessage=t}}var Df=/([A-Z])/g,Bf=e=>e.replace(Df,"-$1").toLowerCase(),Ff={"&":"&",">":">","<":"<",'"':""","'":"'"},Rf=/[&><"']/g,De=e=>String(e).replace(Rf,t=>Ff[t]),en=e=>e.type==="ordgroup"||e.type==="color"?e.body.length===1?en(e.body[0]):e:e.type==="font"?en(e.body):e,Lf=new Set(["mathord","textord","atom"]),xt=e=>Lf.has(en(e).type),Nf=e=>{var t=/^[\x00-\x20]*([^\\/#?]*?)(:|�*58|�*3a|&colon)/i.exec(e);return t?t[2]!==":"||!/^[a-zA-Z][a-zA-Z0-9+\-.]*$/.test(t[1])?null:t[1].toLowerCase():"_relative"},C0={displayMode:{type:"boolean",description:"Render math in display mode, which puts the math in display style (so \\int and \\sum are large, for example), and centers the math on the page on its own line.",cli:"-d, --display-mode"},output:{type:{enum:["htmlAndMathml","html","mathml"]},description:"Determines the markup language of the output.",cli:"-F, --format <type>"},leqno:{type:"boolean",description:"Render display math in leqno style (left-justified tags)."},fleqn:{type:"boolean",description:"Render display math flush left."},throwOnError:{type:"boolean",default:!0,cli:"-t, --no-throw-on-error",cliDescription:"Render errors (in the color given by --error-color) instead of throwing a ParseError exception when encountering an error."},errorColor:{type:"string",default:"#cc0000",cli:"-c, --error-color <color>",cliDescription:"A color string given in the format 'rgb' or 'rrggbb' (no #). This option determines the color of errors rendered by the -t option.",cliProcessor:e=>"#"+e},macros:{type:"object",cli:"-m, --macro <def>",cliDescription:"Define custom macro of the form '\\foo:expansion' (use multiple -m arguments for multiple macros).",cliDefault:[],cliProcessor:(e,t)=>(t.push(e),t)},minRuleThickness:{type:"number",description:"Specifies a minimum thickness, in ems, for fraction lines, `\\sqrt` top lines, `{array}` vertical lines, `\\hline`, `\\hdashline`, `\\underline`, `\\overline`, and the borders of `\\fbox`, `\\boxed`, and `\\fcolorbox`.",processor:e=>Math.max(0,e),cli:"--min-rule-thickness <size>",cliProcessor:parseFloat},colorIsTextColor:{type:"boolean",description:"Makes \\color behave like LaTeX's 2-argument \\textcolor, instead of LaTeX's one-argument \\color mode change.",cli:"-b, --color-is-text-color"},strict:{type:[{enum:["warn","ignore","error"]},"boolean","function"],description:"Turn on strict / LaTeX faithfulness mode, which throws an error if the input uses features that are not supported by LaTeX.",cli:"-S, --strict",cliDefault:!1},trust:{type:["boolean","function"],description:"Trust the input, enabling all HTML features such as \\url.",cli:"-T, --trust"},maxSize:{type:"number",default:1/0,description:"If non-zero, all user-specified sizes, e.g. in \\rule{500em}{500em}, will be capped to maxSize ems. Otherwise, elements and spaces can be arbitrarily large",processor:e=>Math.max(0,e),cli:"-s, --max-size <n>",cliProcessor:parseInt},maxExpand:{type:"
Line truncated
|
||||
c-2.7,0,-7.17,-2.7,-13.5,-8c-5.8,-5.3,-9.5,-10,-9.5,-14
|
||||
c0,-2,0.3,-3.3,1,-4c1.3,-2.7,23.83,-20.7,67.5,-54
|
||||
c44.2,-33.3,65.8,-50.3,66.5,-51c1.3,-1.3,3,-2,5,-2c4.7,0,8.7,3.3,12,10
|
||||
s173,378,173,378c0.7,0,35.3,-71,104,-213c68.7,-142,137.5,-285,206.5,-429
|
||||
c69,-144,104.5,-217.7,106.5,-221
|
||||
l`+t/2.075+" -"+t+`
|
||||
c5.3,-9.3,12,-14,20,-14
|
||||
H400000v`+(40+t)+`H845.2724
|
||||
s-225.272,467,-225.272,467s-235,486,-235,486c-2.7,4.7,-9,7,-19,7
|
||||
c-6,0,-10,-1,-12,-3s-194,-422,-194,-422s-65,47,-65,47z
|
||||
M`+(834+t)+" "+r+"h400000v"+(40+t)+"h-400000z"},Xf=function(t,r){return"M263,"+(601+t+r)+`c0.7,0,18,39.7,52,119
|
||||
c34,79.3,68.167,158.7,102.5,238c34.3,79.3,51.8,119.3,52.5,120
|
||||
c340,-704.7,510.7,-1060.3,512,-1067
|
||||
l`+t/2.084+" -"+t+`
|
||||
c4.7,-7.3,11,-11,19,-11
|
||||
H40000v`+(40+t)+`H1012.3
|
||||
s-271.3,567,-271.3,567c-38.7,80.7,-84,175,-136,283c-52,108,-89.167,185.3,-111.5,232
|
||||
c-22.3,46.7,-33.8,70.3,-34.5,71c-4.7,4.7,-12.3,7,-23,7s-12,-1,-12,-1
|
||||
s-109,-253,-109,-253c-72.7,-168,-109.3,-252,-110,-252c-10.7,8,-22,16.7,-34,26
|
||||
c-22,17.3,-33.3,26,-34,26s-26,-26,-26,-26s76,-59,76,-59s76,-60,76,-60z
|
||||
M`+(1001+t)+" "+r+"h400000v"+(40+t)+"h-400000z"},Yf=function(t,r){return"M983 "+(10+t+r)+`
|
||||
l`+t/3.13+" -"+t+`
|
||||
c4,-6.7,10,-10,18,-10 H400000v`+(40+t)+`
|
||||
H1013.1s-83.4,268,-264.1,840c-180.7,572,-277,876.3,-289,913c-4.7,4.7,-12.7,7,-24,7
|
||||
s-12,0,-12,0c-1.3,-3.3,-3.7,-11.7,-7,-25c-35.3,-125.3,-106.7,-373.3,-214,-744
|
||||
c-10,12,-21,25,-33,39s-32,39,-32,39c-6,-5.3,-15,-14,-27,-26s25,-30,25,-30
|
||||
c26.7,-32.7,52,-63,76,-91s52,-60,52,-60s208,722,208,722
|
||||
c56,-175.3,126.3,-397.3,211,-666c84.7,-268.7,153.8,-488.2,207.5,-658.5
|
||||
c53.7,-170.3,84.5,-266.8,92.5,-289.5z
|
||||
M`+(1001+t)+" "+r+"h400000v"+(40+t)+"h-400000z"},Kf=function(t,r){return"M424,"+(2398+t+r)+`
|
||||
c-1.3,-0.7,-38.5,-172,-111.5,-514c-73,-342,-109.8,-513.3,-110.5,-514
|
||||
c0,-2,-10.7,14.3,-32,49c-4.7,7.3,-9.8,15.7,-15.5,25c-5.7,9.3,-9.8,16,-12.5,20
|
||||
s-5,7,-5,7c-4,-3.3,-8.3,-7.7,-13,-13s-13,-13,-13,-13s76,-122,76,-122s77,-121,77,-121
|
||||
s209,968,209,968c0,-2,84.7,-361.7,254,-1079c169.3,-717.3,254.7,-1077.7,256,-1081
|
||||
l`+t/4.223+" -"+t+`c4,-6.7,10,-10,18,-10 H400000
|
||||
v`+(40+t)+`H1014.6
|
||||
s-87.3,378.7,-272.6,1166c-185.3,787.3,-279.3,1182.3,-282,1185
|
||||
c-2,6,-10,9,-24,9
|
||||
c-8,0,-12,-0.7,-12,-2z M`+(1001+t)+" "+r+`
|
||||
h400000v`+(40+t)+"h-400000z"},Zf=function(t,r){return"M473,"+(2713+t+r)+`
|
||||
c339.3,-1799.3,509.3,-2700,510,-2702 l`+t/5.298+" -"+t+`
|
||||
c3.3,-7.3,9.3,-11,18,-11 H400000v`+(40+t)+`H1017.7
|
||||
s-90.5,478,-276.2,1466c-185.7,988,-279.5,1483,-281.5,1485c-2,6,-10,9,-24,9
|
||||
c-8,0,-12,-0.7,-12,-2c0,-1.3,-5.3,-32,-16,-92c-50.7,-293.3,-119.7,-693.3,-207,-1200
|
||||
c0,-1.3,-5.3,8.7,-16,30c-10.7,21.3,-21.3,42.7,-32,64s-16,33,-16,33s-26,-26,-26,-26
|
||||
s76,-153,76,-153s77,-151,77,-151c0.7,0.7,35.7,202,105,604c67.3,400.7,102,602.7,104,
|
||||
606zM`+(1001+t)+" "+r+"h400000v"+(40+t)+"H1017.7z"},Qf=function(t){var r=t/2;return"M400000 "+t+" H0 L"+r+" 0 l65 45 L145 "+(t-80)+" H400000z"},Jf=function(t,r,n){var i=n-54-r-t;return"M702 "+(t+r)+"H400000"+(40+t)+`
|
||||
H742v`+i+`l-4 4-4 4c-.667.7 -2 1.5-4 2.5s-4.167 1.833-6.5 2.5-5.5 1-9.5 1
|
||||
h-12l-28-84c-16.667-52-96.667 -294.333-240-727l-212 -643 -85 170
|
||||
c-4-3.333-8.333-7.667-13 -13l-13-13l77-155 77-156c66 199.333 139 419.667
|
||||
219 661 l218 661zM702 `+r+"H400000v"+(40+t)+"H742z"},e2=function(t,r,n){r=1e3*r;var i="";switch(t){case"sqrtMain":i=Wf(r,Zt);break;case"sqrtSize1":i=Xf(r,Zt);break;case"sqrtSize2":i=Yf(r,Zt);break;case"sqrtSize3":i=Kf(r,Zt);break;case"sqrtSize4":i=Zf(r,Zt);break;case"sqrtTall":i=Jf(r,Zt,n)}return i},t2=function(t,r){switch(t){case"⎜":return Ce("M291 0 H417 V"+r+" H291z");case"∣":return Ce("M145 0 H188 V"+r+" H145z");case"∥":return Ce("M145 0 H188 V"+r+" H145z")+Ce("M367 0 H410 V"+r+" H367z");case"⎟":return Ce("M457 0 H583 V"+r+" H457z");case"⎢":return Ce("M319 0 H403 V"+r+" H319z");case"⎥":return Ce("M263 0 H347 V"+r+" H263z");case"⎪":return Ce("M384 0 H504 V"+r+" H384z");case"⏐":return Ce("M312 0 H355 V"+r+" H312z");case"‖":return Ce("M257 0 H300 V"+r+" H257z")+Ce("M478 0 H521 V"+r+" H478z");default:return""}},Ca={doubleleftarrow:`M262 157
|
||||
l10-10c34-36 62.7-77 86-123 3.3-8 5-13.3 5-16 0-5.3-6.7-8-20-8-7.3
|
||||
0-12.2.5-14.5 1.5-2.3 1-4.8 4.5-7.5 10.5-49.3 97.3-121.7 169.3-217 216-28
|
||||
14-57.3 25-88 33-6.7 2-11 3.8-13 5.5-2 1.7-3 4.2-3 7.5s1 5.8 3 7.5
|
||||
c2 1.7 6.3 3.5 13 5.5 68 17.3 128.2 47.8 180.5 91.5 52.3 43.7 93.8 96.2 124.5
|
||||
157.5 9.3 8 15.3 12.3 18 13h6c12-.7 18-4 18-10 0-2-1.7-7-5-15-23.3-46-52-87
|
||||
-86-123l-10-10h399738v-40H218c328 0 0 0 0 0l-10-8c-26.7-20-65.7-43-117-69 2.7
|
||||
-2 6-3.7 10-5 36.7-16 72.3-37.3 107-64l10-8h399782v-40z
|
||||
m8 0v40h399730v-40zm0 194v40h399730v-40z`,doublerightarrow:`M399738 392l
|
||||
-10 10c-34 36-62.7 77-86 123-3.3 8-5 13.3-5 16 0 5.3 6.7 8 20 8 7.3 0 12.2-.5
|
||||
14.5-1.5 2.3-1 4.8-4.5 7.5-10.5 49.3-97.3 121.7-169.3 217-216 28-14 57.3-25 88
|
||||
-33 6.7-2 11-3.8 13-5.5 2-1.7 3-4.2 3-7.5s-1-5.8-3-7.5c-2-1.7-6.3-3.5-13-5.5-68
|
||||
-17.3-128.2-47.8-180.5-91.5-52.3-43.7-93.8-96.2-124.5-157.5-9.3-8-15.3-12.3-18
|
||||
-13h-6c-12 .7-18 4-18 10 0 2 1.7 7 5 15 23.3 46 52 87 86 123l10 10H0v40h399782
|
||||
c-328 0 0 0 0 0l10 8c26.7 20 65.7 43 117 69-2.7 2-6 3.7-10 5-36.7 16-72.3 37.3
|
||||
-107 64l-10 8H0v40zM0 157v40h399730v-40zm0 194v40h399730v-40z`,leftarrow:`M400000 241H110l3-3c68.7-52.7 113.7-120
|
||||
135-202 4-14.7 6-23 6-25 0-7.3-7-11-21-11-8 0-13.2.8-15.5 2.5-2.3 1.7-4.2 5.8
|
||||
-5.5 12.5-1.3 4.7-2.7 10.3-4 17-12 48.7-34.8 92-68.5 130S65.3 228.3 18 247
|
||||
c-10 4-16 7.7-18 11 0 8.7 6 14.3 18 17 47.3 18.7 87.8 47 121.5 85S196 441.3 208
|
||||
490c.7 2 1.3 5 2 9s1.2 6.7 1.5 8c.3 1.3 1 3.3 2 6s2.2 4.5 3.5 5.5c1.3 1 3.3
|
||||
1.8 6 2.5s6 1 10 1c14 0 21-3.7 21-11 0-2-2-10.3-6-25-20-79.3-65-146.7-135-202
|
||||
l-3-3h399890zM100 241v40h399900v-40z`,leftbrace:`M6 548l-6-6v-35l6-11c56-104 135.3-181.3 238-232 57.3-28.7 117
|
||||
-45 179-50h399577v120H403c-43.3 7-81 15-113 26-100.7 33-179.7 91-237 174-2.7
|
||||
5-6 9-10 13-.7 1-7.3 1-20 1H6z`,leftbraceunder:`M0 6l6-6h17c12.688 0 19.313.3 20 1 4 4 7.313 8.3 10 13
|
||||
35.313 51.3 80.813 93.8 136.5 127.5 55.688 33.7 117.188 55.8 184.5 66.5.688
|
||||
0 2 .3 4 1 18.688 2.7 76 4.3 172 5h399450v120H429l-6-1c-124.688-8-235-61.7
|
||||
-331-161C60.687 138.7 32.312 99.3 7 54L0 41V6z`,leftgroup:`M400000 80
|
||||
H435C64 80 168.3 229.4 21 260c-5.9 1.2-18 0-18 0-2 0-3-1-3-3v-38C76 61 257 0
|
||||
435 0h399565z`,leftgroupunder:`M400000 262
|
||||
H435C64 262 168.3 112.6 21 82c-5.9-1.2-18 0-18 0-2 0-3 1-3 3v38c76 158 257 219
|
||||
435 219h399565z`,leftharpoon:`M0 267c.7 5.3 3 10 7 14h399993v-40H93c3.3
|
||||
-3.3 10.2-9.5 20.5-18.5s17.8-15.8 22.5-20.5c50.7-52 88-110.3 112-175 4-11.3 5
|
||||
-18.3 3-21-1.3-4-7.3-6-18-6-8 0-13 .7-15 2s-4.7 6.7-8 16c-42 98.7-107.3 174.7
|
||||
-196 228-6.7 4.7-10.7 8-12 10-1.3 2-2 5.7-2 11zm100-26v40h399900v-40z`,leftharpoonplus:`M0 267c.7 5.3 3 10 7 14h399993v-40H93c3.3-3.3 10.2-9.5
|
||||
20.5-18.5s17.8-15.8 22.5-20.5c50.7-52 88-110.3 112-175 4-11.3 5-18.3 3-21-1.3
|
||||
-4-7.3-6-18-6-8 0-13 .7-15 2s-4.7 6.7-8 16c-42 98.7-107.3 174.7-196 228-6.7 4.7
|
||||
-10.7 8-12 10-1.3 2-2 5.7-2 11zm100-26v40h399900v-40zM0 435v40h400000v-40z
|
||||
m0 0v40h400000v-40z`,leftharpoondown:`M7 241c-4 4-6.333 8.667-7 14 0 5.333.667 9 2 11s5.333
|
||||
5.333 12 10c90.667 54 156 130 196 228 3.333 10.667 6.333 16.333 9 17 2 .667 5
|
||||
1 9 1h5c10.667 0 16.667-2 18-6 2-2.667 1-9.667-3-21-32-87.333-82.667-157.667
|
||||
-152-211l-3-3h399907v-40zM93 281 H400000 v-40L7 241z`,leftharpoondownplus:`M7 435c-4 4-6.3 8.7-7 14 0 5.3.7 9 2 11s5.3 5.3 12
|
||||
10c90.7 54 156 130 196 228 3.3 10.7 6.3 16.3 9 17 2 .7 5 1 9 1h5c10.7 0 16.7
|
||||
-2 18-6 2-2.7 1-9.7-3-21-32-87.3-82.7-157.7-152-211l-3-3h399907v-40H7zm93 0
|
||||
v40h399900v-40zM0 241v40h399900v-40zm0 0v40h399900v-40z`,lefthook:`M400000 281 H103s-33-11.2-61-33.5S0 197.3 0 164s14.2-61.2 42.5
|
||||
-83.5C70.8 58.2 104 47 142 47 c16.7 0 25 6.7 25 20 0 12-8.7 18.7-26 20-40 3.3
|
||||
-68.7 15.7-86 37-10 12-15 25.3-15 40 0 22.7 9.8 40.7 29.5 54 19.7 13.3 43.5 21
|
||||
71.5 23h399859zM103 281v-40h399897v40z`,leftlinesegment:Ce("M40 281 V428 H0 V94 H40 V241 H400000 v40z"),leftbracketunder:Ce("M0 0 h120 V290 H399995 v120 H0z"),leftbracketover:Ce("M0 440 h120 V150 H399995 v-120 H0z"),leftmapsto:Ce("M40 281 V448H0V74H40V241H400000v40z"),leftToFrom:`M0 147h400000v40H0zm0 214c68 40 115.7 95.7 143 167h22c15.3 0 23
|
||||
-.3 23-1 0-1.3-5.3-13.7-16-37-18-35.3-41.3-69-70-101l-7-8h399905v-40H95l7-8
|
||||
c28.7-32 52-65.7 70-101 10.7-23.3 16-35.7 16-37 0-.7-7.7-1-23-1h-22C115.7 265.3
|
||||
68 321 0 361zm0-174v-40h399900v40zm100 154v40h399900v-40z`,longequal:Ce("M0 50 h400000 v40H0z m0 194h40000v40H0z"),midbrace:`M200428 334
|
||||
c-100.7-8.3-195.3-44-280-108-55.3-42-101.7-93-139-153l-9-14c-2.7 4-5.7 8.7-9 14
|
||||
-53.3 86.7-123.7 153-211 199-66.7 36-137.3 56.3-212 62H0V214h199568c178.3-11.7
|
||||
311.7-78.3 403-201 6-8 9.7-12 11-12 .7-.7 6.7-1 18-1s17.3.3 18 1c1.3 0 5 4 11
|
||||
12 44.7 59.3 101.3 106.3 170 141s145.3 54.3 229 60h199572v120z`,midbraceunder:`M199572 214
|
||||
c100.7 8.3 195.3 44 280 108 55.3 42 101.7 93 139 153l9 14c2.7-4 5.7-8.7 9-14
|
||||
53.3-86.7 123.7-153 211-199 66.7-36 137.3-56.3 212-62h199568v120H200432c-178.3
|
||||
11.7-311.7 78.3-403 201-6 8-9.7 12-11 12-.7.7-6.7 1-18 1s-17.3-.3-18-1c-1.3 0
|
||||
-5-4-11-12-44.7-59.3-101.3-106.3-170-141s-145.3-54.3-229-60H0V214z`,oiintSize1:`M512.6 71.6c272.6 0 320.3 106.8 320.3 178.2 0 70.8-47.7 177.6
|
||||
-320.3 177.6S193.1 320.6 193.1 249.8c0-71.4 46.9-178.2 319.5-178.2z
|
||||
m368.1 178.2c0-86.4-60.9-215.4-368.1-215.4-306.4 0-367.3 129-367.3 215.4 0 85.8
|
||||
60.9 214.8 367.3 214.8 307.2 0 368.1-129 368.1-214.8z`,oiintSize2:`M757.8 100.1c384.7 0 451.1 137.6 451.1 230 0 91.3-66.4 228.8
|
||||
-451.1 228.8-386.3 0-452.7-137.5-452.7-228.8 0-92.4 66.4-230 452.7-230z
|
||||
m502.4 230c0-111.2-82.4-277.2-502.4-277.2s-504 166-504 277.2
|
||||
c0 110 84 276 504 276s502.4-166 502.4-276z`,oiiintSize1:`M681.4 71.6c408.9 0 480.5 106.8 480.5 178.2 0 70.8-71.6 177.6
|
||||
-480.5 177.6S202.1 320.6 202.1 249.8c0-71.4 70.5-178.2 479.3-178.2z
|
||||
m525.8 178.2c0-86.4-86.8-215.4-525.7-215.4-437.9 0-524.7 129-524.7 215.4 0
|
||||
85.8 86.8 214.8 524.7 214.8 438.9 0 525.7-129 525.7-214.8z`,oiiintSize2:`M1021.2 53c603.6 0 707.8 165.8 707.8 277.2 0 110-104.2 275.8
|
||||
-707.8 275.8-606 0-710.2-165.8-710.2-275.8C311 218.8 415.2 53 1021.2 53z
|
||||
m770.4 277.1c0-131.2-126.4-327.6-770.5-327.6S248.4 198.9 248.4 330.1
|
||||
c0 130 128.8 326.4 772.7 326.4s770.5-196.4 770.5-326.4z`,rightarrow:`M0 241v40h399891c-47.3 35.3-84 78-110 128
|
||||
-16.7 32-27.7 63.7-33 95 0 1.3-.2 2.7-.5 4-.3 1.3-.5 2.3-.5 3 0 7.3 6.7 11 20
|
||||
11 8 0 13.2-.8 15.5-2.5 2.3-1.7 4.2-5.5 5.5-11.5 2-13.3 5.7-27 11-41 14.7-44.7
|
||||
39-84.5 73-119.5s73.7-60.2 119-75.5c6-2 9-5.7 9-11s-3-9-9-11c-45.3-15.3-85
|
||||
-40.5-119-75.5s-58.3-74.8-73-119.5c-4.7-14-8.3-27.3-11-40-1.3-6.7-3.2-10.8-5.5
|
||||
-12.5-2.3-1.7-7.5-2.5-15.5-2.5-14 0-21 3.7-21 11 0 2 2 10.3 6 25 20.7 83.3 67
|
||||
151.7 139 205zm0 0v40h399900v-40z`,rightbrace:`M400000 542l
|
||||
-6 6h-17c-12.7 0-19.3-.3-20-1-4-4-7.3-8.3-10-13-35.3-51.3-80.8-93.8-136.5-127.5
|
||||
s-117.2-55.8-184.5-66.5c-.7 0-2-.3-4-1-18.7-2.7-76-4.3-172-5H0V214h399571l6 1
|
||||
c124.7 8 235 61.7 331 161 31.3 33.3 59.7 72.7 85 118l7 13v35z`,rightbraceunder:`M399994 0l6 6v35l-6 11c-56 104-135.3 181.3-238 232-57.3
|
||||
28.7-117 45-179 50H-300V214h399897c43.3-7 81-15 113-26 100.7-33 179.7-91 237
|
||||
-174 2.7-5 6-9 10-13 .7-1 7.3-1 20-1h17z`,rightgroup:`M0 80h399565c371 0 266.7 149.4 414 180 5.9 1.2 18 0 18 0 2 0
|
||||
3-1 3-3v-38c-76-158-257-219-435-219H0z`,rightgroupunder:`M0 262h399565c371 0 266.7-149.4 414-180 5.9-1.2 18 0 18
|
||||
0 2 0 3 1 3 3v38c-76 158-257 219-435 219H0z`,rightharpoon:`M0 241v40h399993c4.7-4.7 7-9.3 7-14 0-9.3
|
||||
-3.7-15.3-11-18-92.7-56.7-159-133.7-199-231-3.3-9.3-6-14.7-8-16-2-1.3-7-2-15-2
|
||||
-10.7 0-16.7 2-18 6-2 2.7-1 9.7 3 21 15.3 42 36.7 81.8 64 119.5 27.3 37.7 58
|
||||
69.2 92 94.5zm0 0v40h399900v-40z`,rightharpoonplus:`M0 241v40h399993c4.7-4.7 7-9.3 7-14 0-9.3-3.7-15.3-11
|
||||
-18-92.7-56.7-159-133.7-199-231-3.3-9.3-6-14.7-8-16-2-1.3-7-2-15-2-10.7 0-16.7
|
||||
2-18 6-2 2.7-1 9.7 3 21 15.3 42 36.7 81.8 64 119.5 27.3 37.7 58 69.2 92 94.5z
|
||||
m0 0v40h399900v-40z m100 194v40h399900v-40zm0 0v40h399900v-40z`,rightharpoondown:`M399747 511c0 7.3 6.7 11 20 11 8 0 13-.8 15-2.5s4.7-6.8
|
||||
8-15.5c40-94 99.3-166.3 178-217 13.3-8 20.3-12.3 21-13 5.3-3.3 8.5-5.8 9.5
|
||||
-7.5 1-1.7 1.5-5.2 1.5-10.5s-2.3-10.3-7-15H0v40h399908c-34 25.3-64.7 57-92 95
|
||||
-27.3 38-48.7 77.7-64 119-3.3 8.7-5 14-5 16zM0 241v40h399900v-40z`,rightharpoondownplus:`M399747 705c0 7.3 6.7 11 20 11 8 0 13-.8
|
||||
15-2.5s4.7-6.8 8-15.5c40-94 99.3-166.3 178-217 13.3-8 20.3-12.3 21-13 5.3-3.3
|
||||
8.5-5.8 9.5-7.5 1-1.7 1.5-5.2 1.5-10.5s-2.3-10.3-7-15H0v40h399908c-34 25.3
|
||||
-64.7 57-92 95-27.3 38-48.7 77.7-64 119-3.3 8.7-5 14-5 16zM0 435v40h399900v-40z
|
||||
m0-194v40h400000v-40zm0 0v40h400000v-40z`,righthook:`M399859 241c-764 0 0 0 0 0 40-3.3 68.7-15.7 86-37 10-12 15-25.3
|
||||
15-40 0-22.7-9.8-40.7-29.5-54-19.7-13.3-43.5-21-71.5-23-17.3-1.3-26-8-26-20 0
|
||||
-13.3 8.7-20 26-20 38 0 71 11.2 99 33.5 0 0 7 5.6 21 16.7 14 11.2 21 33.5 21
|
||||
66.8s-14 61.2-42 83.5c-28 22.3-61 33.5-99 33.5L0 241z M0 281v-40h399859v40z`,rightlinesegment:Ce("M399960 241 V94 h40 V428 h-40 V281 H0 v-40z"),rightbracketunder:Ce("M399995 0 h-120 V290 H0 v120 H400000z"),rightbracketover:Ce("M399995 440 h-120 V150 H0 v-120 H399995z"),rightToFrom:`M400000 167c-70.7-42-118-97.7-142-167h-23c-15.3 0-23 .3-23
|
||||
1 0 1.3 5.3 13.7 16 37 18 35.3 41.3 69 70 101l7 8H0v40h399905l-7 8c-28.7 32
|
||||
-52 65.7-70 101-10.7 23.3-16 35.7-16 37 0 .7 7.7 1 23 1h23c24-69.3 71.3-125 142
|
||||
-167z M100 147v40h399900v-40zM0 341v40h399900v-40z`,twoheadleftarrow:`M0 167c68 40
|
||||
115.7 95.7 143 167h22c15.3 0 23-.3 23-1 0-1.3-5.3-13.7-16-37-18-35.3-41.3-69
|
||||
-70-101l-7-8h125l9 7c50.7 39.3 85 86 103 140h46c0-4.7-6.3-18.7-19-42-18-35.3
|
||||
-40-67.3-66-96l-9-9h399716v-40H284l9-9c26-28.7 48-60.7 66-96 12.7-23.333 19
|
||||
-37.333 19-42h-46c-18 54-52.3 100.7-103 140l-9 7H95l7-8c28.7-32 52-65.7 70-101
|
||||
10.7-23.333 16-35.7 16-37 0-.7-7.7-1-23-1h-22C115.7 71.3 68 127 0 167z`,twoheadrightarrow:`M400000 167
|
||||
c-68-40-115.7-95.7-143-167h-22c-15.3 0-23 .3-23 1 0 1.3 5.3 13.7 16 37 18 35.3
|
||||
41.3 69 70 101l7 8h-125l-9-7c-50.7-39.3-85-86-103-140h-46c0 4.7 6.3 18.7 19 42
|
||||
18 35.3 40 67.3 66 96l9 9H0v40h399716l-9 9c-26 28.7-48 60.7-66 96-12.7 23.333
|
||||
-19 37.333-19 42h46c18-54 52.3-100.7 103-140l9-7h125l-7 8c-28.7 32-52 65.7-70
|
||||
101-10.7 23.333-16 35.7-16 37 0 .7 7.7 1 23 1h22c27.3-71.3 75-127 143-167z`,tilde1:`M200 55.538c-77 0-168 73.953-177 73.953-3 0-7
|
||||
-2.175-9-5.437L2 97c-1-2-2-4-2-6 0-4 2-7 5-9l20-12C116 12 171 0 207 0c86 0
|
||||
114 68 191 68 78 0 168-68 177-68 4 0 7 2 9 5l12 19c1 2.175 2 4.35 2 6.525 0
|
||||
4.35-2 7.613-5 9.788l-19 13.05c-92 63.077-116.937 75.308-183 76.128
|
||||
-68.267.847-113-73.952-191-73.952z`,tilde2:`M344 55.266c-142 0-300.638 81.316-311.5 86.418
|
||||
-8.01 3.762-22.5 10.91-23.5 5.562L1 120c-1-2-1-3-1-4 0-5 3-9 8-10l18.4-9C160.9
|
||||
31.9 283 0 358 0c148 0 188 122 331 122s314-97 326-97c4 0 8 2 10 7l7 21.114
|
||||
c1 2.14 1 3.21 1 4.28 0 5.347-3 9.626-7 10.696l-22.3 12.622C852.6 158.372 751
|
||||
181.476 676 181.476c-149 0-189-126.21-332-126.21z`,tilde3:`M786 59C457 59 32 175.242 13 175.242c-6 0-10-3.457
|
||||
-11-10.37L.15 138c-1-7 3-12 10-13l19.2-6.4C378.4 40.7 634.3 0 804.3 0c337 0
|
||||
411.8 157 746.8 157 328 0 754-112 773-112 5 0 10 3 11 9l1 14.075c1 8.066-.697
|
||||
16.595-6.697 17.492l-21.052 7.31c-367.9 98.146-609.15 122.696-778.15 122.696
|
||||
-338 0-409-156.573-744-156.573z`,tilde4:`M786 58C457 58 32 177.487 13 177.487c-6 0-10-3.345
|
||||
-11-10.035L.15 143c-1-7 3-12 10-13l22-6.7C381.2 35 637.15 0 807.15 0c337 0 409
|
||||
177 744 177 328 0 754-127 773-127 5 0 10 3 11 9l1 14.794c1 7.805-3 13.38-9
|
||||
14.495l-20.7 5.574c-366.85 99.79-607.3 139.372-776.3 139.372-338 0-409
|
||||
-175.236-744-175.236z`,vec:`M377 20c0-5.333 1.833-10 5.5-14S391 0 397 0c4.667 0 8.667 1.667 12 5
|
||||
3.333 2.667 6.667 9 10 19 6.667 24.667 20.333 43.667 41 57 7.333 4.667 11
|
||||
10.667 11 18 0 6-1 10-3 12s-6.667 5-14 9c-28.667 14.667-53.667 35.667-75 63
|
||||
-1.333 1.333-3.167 3.5-5.5 6.5s-4 4.833-5 5.5c-1 .667-2.5 1.333-4.5 2s-4.333 1
|
||||
-7 1c-4.667 0-9.167-1.833-13.5-5.5S337 184 337 178c0-12.667 15.667-32.333 47-59
|
||||
H213l-171-1c-8.667-6-13-12.333-13-19 0-4.667 4.333-11.333 13-20h359
|
||||
c-16-25.333-24-45-24-59z`,widehat1:`M529 0h5l519 115c5 1 9 5 9 10 0 1-1 2-1 3l-4 22
|
||||
c-1 5-5 9-11 9h-2L532 67 19 159h-2c-5 0-9-4-11-9l-5-22c-1-6 2-12 8-13z`,widehat2:`M1181 0h2l1171 176c6 0 10 5 10 11l-2 23c-1 6-5 10
|
||||
-11 10h-1L1182 67 15 220h-1c-6 0-10-4-11-10l-2-23c-1-6 4-11 10-11z`,widehat3:`M1181 0h2l1171 236c6 0 10 5 10 11l-2 23c-1 6-5 10
|
||||
-11 10h-1L1182 67 15 280h-1c-6 0-10-4-11-10l-2-23c-1-6 4-11 10-11z`,widehat4:`M1181 0h2l1171 296c6 0 10 5 10 11l-2 23c-1 6-5 10
|
||||
-11 10h-1L1182 67 15 340h-1c-6 0-10-4-11-10l-2-23c-1-6 4-11 10-11z`,widecheck1:`M529,159h5l519,-115c5,-1,9,-5,9,-10c0,-1,-1,-2,-1,-3l-4,-22c-1,
|
||||
-5,-5,-9,-11,-9h-2l-512,92l-513,-92h-2c-5,0,-9,4,-11,9l-5,22c-1,6,2,12,8,13z`,widecheck2:`M1181,220h2l1171,-176c6,0,10,-5,10,-11l-2,-23c-1,-6,-5,-10,
|
||||
-11,-10h-1l-1168,153l-1167,-153h-1c-6,0,-10,4,-11,10l-2,23c-1,6,4,11,10,11z`,widecheck3:`M1181,280h2l1171,-236c6,0,10,-5,10,-11l-2,-23c-1,-6,-5,-10,
|
||||
-11,-10h-1l-1168,213l-1167,-213h-1c-6,0,-10,4,-11,10l-2,23c-1,6,4,11,10,11z`,widecheck4:`M1181,340h2l1171,-296c6,0,10,-5,10,-11l-2,-23c-1,-6,-5,-10,
|
||||
-11,-10h-1l-1168,273l-1167,-273h-1c-6,0,-10,4,-11,10l-2,23c-1,6,4,11,10,11z`,baraboveleftarrow:`M400000 620h-399890l3 -3c68.7 -52.7 113.7 -120 135 -202
|
||||
c4 -14.7 6 -23 6 -25c0 -7.3 -7 -11 -21 -11c-8 0 -13.2 0.8 -15.5 2.5
|
||||
c-2.3 1.7 -4.2 5.8 -5.5 12.5c-1.3 4.7 -2.7 10.3 -4 17c-12 48.7 -34.8 92 -68.5 130
|
||||
s-74.2 66.3 -121.5 85c-10 4 -16 7.7 -18 11c0 8.7 6 14.3 18 17c47.3 18.7 87.8 47
|
||||
121.5 85s56.5 81.3 68.5 130c0.7 2 1.3 5 2 9s1.2 6.7 1.5 8c0.3 1.3 1 3.3 2 6
|
||||
s2.2 4.5 3.5 5.5c1.3 1 3.3 1.8 6 2.5s6 1 10 1c14 0 21 -3.7 21 -11
|
||||
c0 -2 -2 -10.3 -6 -25c-20 -79.3 -65 -146.7 -135 -202l-3 -3h399890z
|
||||
M100 620v40h399900v-40z M0 241v40h399900v-40zM0 241v40h399900v-40z`,rightarrowabovebar:`M0 241v40h399891c-47.3 35.3-84 78-110 128-16.7 32
|
||||
-27.7 63.7-33 95 0 1.3-.2 2.7-.5 4-.3 1.3-.5 2.3-.5 3 0 7.3 6.7 11 20 11 8 0
|
||||
13.2-.8 15.5-2.5 2.3-1.7 4.2-5.5 5.5-11.5 2-13.3 5.7-27 11-41 14.7-44.7 39
|
||||
-84.5 73-119.5s73.7-60.2 119-75.5c6-2 9-5.7 9-11s-3-9-9-11c-45.3-15.3-85-40.5
|
||||
-119-75.5s-58.3-74.8-73-119.5c-4.7-14-8.3-27.3-11-40-1.3-6.7-3.2-10.8-5.5
|
||||
-12.5-2.3-1.7-7.5-2.5-15.5-2.5-14 0-21 3.7-21 11 0 2 2 10.3 6 25 20.7 83.3 67
|
||||
151.7 139 205zm96 379h399894v40H0zm0 0h399904v40H0z`,baraboveshortleftharpoon:`M507,435c-4,4,-6.3,8.7,-7,14c0,5.3,0.7,9,2,11
|
||||
c1.3,2,5.3,5.3,12,10c90.7,54,156,130,196,228c3.3,10.7,6.3,16.3,9,17
|
||||
c2,0.7,5,1,9,1c0,0,5,0,5,0c10.7,0,16.7,-2,18,-6c2,-2.7,1,-9.7,-3,-21
|
||||
c-32,-87.3,-82.7,-157.7,-152,-211c0,0,-3,-3,-3,-3l399351,0l0,-40
|
||||
c-398570,0,-399437,0,-399437,0z M593 435 v40 H399500 v-40z
|
||||
M0 281 v-40 H399908 v40z M0 281 v-40 H399908 v40z`,rightharpoonaboveshortbar:`M0,241 l0,40c399126,0,399993,0,399993,0
|
||||
c4.7,-4.7,7,-9.3,7,-14c0,-9.3,-3.7,-15.3,-11,-18c-92.7,-56.7,-159,-133.7,-199,
|
||||
-231c-3.3,-9.3,-6,-14.7,-8,-16c-2,-1.3,-7,-2,-15,-2c-10.7,0,-16.7,2,-18,6
|
||||
c-2,2.7,-1,9.7,3,21c15.3,42,36.7,81.8,64,119.5c27.3,37.7,58,69.2,92,94.5z
|
||||
M0 241 v40 H399908 v-40z M0 475 v-40 H399500 v40z M0 475 v-40 H399500 v40z`,shortbaraboveleftharpoon:`M7,435c-4,4,-6.3,8.7,-7,14c0,5.3,0.7,9,2,11
|
||||
c1.3,2,5.3,5.3,12,10c90.7,54,156,130,196,228c3.3,10.7,6.3,16.3,9,17c2,0.7,5,1,9,
|
||||
1c0,0,5,0,5,0c10.7,0,16.7,-2,18,-6c2,-2.7,1,-9.7,-3,-21c-32,-87.3,-82.7,-157.7,
|
||||
-152,-211c0,0,-3,-3,-3,-3l399907,0l0,-40c-399126,0,-399993,0,-399993,0z
|
||||
M93 435 v40 H400000 v-40z M500 241 v40 H400000 v-40z M500 241 v40 H400000 v-40z`,shortrightharpoonabovebar:`M53,241l0,40c398570,0,399437,0,399437,0
|
||||
c4.7,-4.7,7,-9.3,7,-14c0,-9.3,-3.7,-15.3,-11,-18c-92.7,-56.7,-159,-133.7,-199,
|
||||
-231c-3.3,-9.3,-6,-14.7,-8,-16c-2,-1.3,-7,-2,-15,-2c-10.7,0,-16.7,2,-18,6
|
||||
c-2,2.7,-1,9.7,3,21c15.3,42,36.7,81.8,64,119.5c27.3,37.7,58,69.2,92,94.5z
|
||||
M500 241 v40 H399408 v-40z M500 435 v40 H400000 v-40z`},r2=function(t,r){switch(t){case"lbrack":return"M403 1759 V84 H666 V0 H319 V1759 v"+r+` v1759 v84 h347 v-84
|
||||
H403z M403 1759 V0 H319 V1759 v`+r+" v1759 v84 h84z";case"rbrack":return"M347 1759 V0 H0 V84 H263 V1759 v"+r+` v1759 H0 v84 H347z
|
||||
M347 1759 V0 H263 V1759 v`+r+" v1759 h84z";case"vert":return"M145 15 v585 v"+r+` v585 c2.667,10,9.667,15,21,15
|
||||
c10,0,16.667,-5,20,-15 v-585 v`+-r+` v-585 c-2.667,-10,-9.667,-15,-21,-15
|
||||
c-10,0,-16.667,5,-20,15z M188 15 H145 v585 v`+r+" v585 h43z";case"doublevert":return"M145 15 v585 v"+r+` v585 c2.667,10,9.667,15,21,15
|
||||
c10,0,16.667,-5,20,-15 v-585 v`+-r+` v-585 c-2.667,-10,-9.667,-15,-21,-15
|
||||
c-10,0,-16.667,5,-20,15z M188 15 H145 v585 v`+r+` v585 h43z
|
||||
M367 15 v585 v`+r+` v585 c2.667,10,9.667,15,21,15
|
||||
c10,0,16.667,-5,20,-15 v-585 v`+-r+` v-585 c-2.667,-10,-9.667,-15,-21,-15
|
||||
c-10,0,-16.667,5,-20,15z M410 15 H367 v585 v`+r+" v585 h43z";case"lfloor":return"M319 602 V0 H403 V602 v"+r+` v1715 h263 v84 H319z
|
||||
MM319 602 V0 H403 V602 v`+r+" v1715 H319z";case"rfloor":return"M319 602 V0 H403 V602 v"+r+` v1799 H0 v-84 H319z
|
||||
MM319 602 V0 H403 V602 v`+r+" v1715 H319z";case"lceil":return"M403 1759 V84 H666 V0 H319 V1759 v"+r+` v602 h84z
|
||||
M403 1759 V0 H319 V1759 v`+r+" v602 h84z";case"rceil":return"M347 1759 V0 H0 V84 H263 V1759 v"+r+` v602 h84z
|
||||
M347 1759 V0 h-84 V1759 v`+r+" v602 h84z";case"lparen":return`M863,9c0,-2,-2,-5,-6,-9c0,0,-17,0,-17,0c-12.7,0,-19.3,0.3,-20,1
|
||||
c-5.3,5.3,-10.3,11,-15,17c-242.7,294.7,-395.3,682,-458,1162c-21.3,163.3,-33.3,349,
|
||||
-36,557 l0,`+(r+84)+`c0.2,6,0,26,0,60c2,159.3,10,310.7,24,454c53.3,528,210,
|
||||
949.7,470,1265c4.7,6,9.7,11.7,15,17c0.7,0.7,7,1,19,1c0,0,18,0,18,0c4,-4,6,-7,6,-9
|
||||
c0,-2.7,-3.3,-8.7,-10,-18c-135.3,-192.7,-235.5,-414.3,-300.5,-665c-65,-250.7,-102.5,
|
||||
-544.7,-112.5,-882c-2,-104,-3,-167,-3,-189
|
||||
l0,-`+(r+92)+`c0,-162.7,5.7,-314,17,-454c20.7,-272,63.7,-513,129,-723c65.3,
|
||||
-210,155.3,-396.3,270,-559c6.7,-9.3,10,-15.3,10,-18z`;case"rparen":return`M76,0c-16.7,0,-25,3,-25,9c0,2,2,6.3,6,13c21.3,28.7,42.3,60.3,
|
||||
63,95c96.7,156.7,172.8,332.5,228.5,527.5c55.7,195,92.8,416.5,111.5,664.5
|
||||
c11.3,139.3,17,290.7,17,454c0,28,1.7,43,3.3,45l0,`+(r+9)+`
|
||||
c-3,4,-3.3,16.7,-3.3,38c0,162,-5.7,313.7,-17,455c-18.7,248,-55.8,469.3,-111.5,664
|
||||
c-55.7,194.7,-131.8,370.3,-228.5,527c-20.7,34.7,-41.7,66.3,-63,95c-2,3.3,-4,7,-6,11
|
||||
c0,7.3,5.7,11,17,11c0,0,11,0,11,0c9.3,0,14.3,-0.3,15,-1c5.3,-5.3,10.3,-11,15,-17
|
||||
c242.7,-294.7,395.3,-681.7,458,-1161c21.3,-164.7,33.3,-350.7,36,-558
|
||||
l0,-`+(r+144)+`c-2,-159.3,-10,-310.7,-24,-454c-53.3,-528,-210,-949.7,
|
||||
-470,-1265c-4.7,-6,-9.7,-11.7,-15,-17c-0.7,-0.7,-6.7,-1,-18,-1z`;default:throw new Error("Unknown stretchy delimiter.")}};function n2(e){return"toText"in e}class lr{constructor(t){this.children=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.maxFontSize=void 0,this.style=void 0,this.children=t,this.classes=[],this.height=0,this.depth=0,this.maxFontSize=0,this.style={}}hasClass(t){return this.classes.includes(t)}toNode(){for(var t=document.createDocumentFragment(),r=0;r<this.children.length;r++)t.appendChild(this.children[r].toNode());return t}toMarkup(){for(var t="",r=0;r<this.children.length;r++)t+=this.children[r].toMarkup();return t}toText(){return this.children.map(t=>{if(n2(t))return t.toText();throw new Error("Expected MathDomNode with toText, got "+t.constructor.name)}).join("")}}var M0={pt:1,mm:7227/2540,cm:7227/254,in:72.27,bp:803/800,pc:12,dd:1238/1157,cc:14856/1157,nd:685/642,nc:1370/107,sp:1/65536,px:803/800},i2={ex:!0,em:!0,mu:!0},Es=function(t){return typeof t!="string"&&(t=t.unit),t in M0||t in i2||t==="ex"},ye=function(t,r){var n;if(t.unit in M0)n=M0[t.unit]/r.fontMetrics().ptPerEm/r.sizeMultiplier;else if(t.unit==="mu")n=r.fontMetrics().cssEmPerMu;else{var i;if(r.style.isTight()?i=r.havingStyle(r.style.text()):i=r,t.unit==="ex")n=i.fontMetrics().xHeight;else if(t.unit==="em")n=i.fontMetrics().quad;else throw new L("Invalid unit: '"+t.unit+"'");i!==r&&(n*=i.sizeMultiplier/r.sizeMultiplier)}return Math.min(t.number*n,r.maxSize)},P=function(t){return+t.toFixed(4)+"em"},zt=function(t){return t.filter(r=>r).join(" ")},mi=function(t){var r="";for(var n of Object.keys(t)){var i=t[n];i!==void 0&&(r+=Bf(n)+":"+i+";")}return r},Is=function(t,r,n){if(this.classes=t||[],this.attributes={},this.height=0,this.depth=0,this.maxFontSize=0,this.style=n||{},r){r.style.isTight()&&this.classes.push("mtight");var i=r.getColor();i&&(this.style.color=i)}},Ds=function(t){var r=document.createElement(t);r.className=zt(this.classes),Object.assign(r.style,this.style);for(var n of Object.keys(this.attributes))r.setAttribute(n,this.attributes[n]);for(var i=0;i<this.children.length;i++)r.appendChild(this.children[i].toNode());return r},a2=/[\s"'>/=\x00-\x1f]/,Bs=function(t){var r="<"+t;this.classes.length&&(r+=' class="'+De(zt(this.classes))+'"');var n=mi(this.style);n&&(r+=' style="'+De(n)+'"');for(var i of Object.keys(this.attributes)){if(a2.test(i))throw new L("Invalid attribute name '"+i+"'");r+=" "+i+'="'+De(this.attributes[i])+'"'}r+=">";for(var a=0;a<this.children.length;a++)r+=this.children[a].toMarkup();return r+="</"+t+">",r};class sr{constructor(t,r,n,i){this.children=void 0,this.attributes=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.width=void 0,this.maxFontSize=void 0,this.style=void 0,this.italic=void 0,Is.call(this,t,n,i),this.children=r||[]}setAttribute(t,r){this.attributes[t]=r}hasClass(t){return this.classes.includes(t)}toNode(){return Ds.call(this,"span")}toMarkup(){return Bs.call(this,"span")}}class bn{constructor(t,r,n,i){this.children=void 0,this.attributes=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.maxFontSize=void 0,this.style=void 0,Is.call(this,r,i),this.children=n||[],this.setAttribute("href",t)}setAttribute(t,r){this.attributes[t]=r}hasClass(t){return this.classes.includes(t)}toNode(){return Ds.call(this,"a")}toMarkup(){return Bs.call(this,"a")}}class l2{constructor(t,r,n){this.src=void 0,this.alt=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.maxFontSize=void 0,this.style=void 0,this.alt=r,this.src=t,this.classes=["mord"],this.height=0,this.depth=0,this.maxFontSize=0,this.style=n}hasClass(t){return this.classes.includes(t)}toNode(){var t=document.createElement("img");return t.src=this.src,t.alt=this.alt,t.className="mord",Object.assign(t.style,this.style),t}toMarkup(){var t='<img src="'+De(this.src)+'"'+(' alt="'+De(this.alt)+'"'),r=mi(this.style);return r&&(t+=' style="'+De(r)+'"'),t+="'/>",t}}var s2={î:"ı̂",ï:"ı̈",í:"ı́",ì:"ı̀"};class Xe{constructor(t,r,n,i,a,l,s,o){this.text=void 0,this.height=void 0,this.depth=void 0,this.italic=void 0,this.skew=void 0,this.width=void 0,this.maxFontSize=void 0,this.classes=void 0,this.style=void 0,this.text=t,this.height=r||0,this.depth=n||0,this.italic=i||0,this.skew=a||0,this.width=l||0,this.classes=s||[],this.style=o||{},this.maxFontSize=0;var u=Gf(this.text.charCodeAt(0));u&&this.classes.push(u+"_fallback"),/[îïíì]/.test(this.text)&&(this.text=s2[this.text])}hasClass(t){return this.classes.includes(t)}toNode(){var t=document.createTextNode(this.text),r=null;return this.italic>0&&(r=document.createElement("span"),r.style.marginRight=P(this.italic)),this.classes.length>0&&(r=r||document.createElement("span"),r.className=zt(this.classes)),Object.keys(this.style).length>0&&(r=r||document.createElement("span"),Object.assign(r.style,this.style)),r?(r.appendChild(t),r):t}toMarkup(){var t=!1,r="<span";this.classes.length&&(t=!0,r+=' class="',r+=De(zt
Line truncated
|
||||
`+M+" children.");for(var U=0;U<M;U++){var E=new Mt(z[U]),V=new yt([E],{width:"400em",height:P(O),viewBox:"0 0 "+s+" "+q,preserveAspectRatio:X[U]+" slice"}),$=Et([G[U]],[V],r);if(M===1)return{span:$,minWidth:I,height:O};$.style.height=P(O),C.push($)}return{span:F(["stretchy"],C,r),minWidth:I,height:O}}}var{span:i,minWidth:a,height:l}=n();return i.height=l,i.style.height=P(l),a>0&&(i.style.minWidth=P(a)),i},L2=function(t,r,n,i,a){var l,s=t.height+t.depth+n+i;if(/fbox|color|angl/.test(r)){if(l=F(["stretchy",r],[],a),r==="fbox"){var o=a.color&&a.getColor();o&&(l.style.borderColor=o)}}else{var u=[];/^[bx]cancel$/.test(r)&&u.push(new E0({x1:"0",y1:"0",x2:"100%",y2:"100%","stroke-width":"0.046em"})),/^x?cancel$/.test(r)&&u.push(new E0({x1:"0",y1:"100%",x2:"100%",y2:"0","stroke-width":"0.046em"}));var h=new yt(u,{width:"100%",height:P(s)});l=Et([],[h],a)}return l.height=s,l.style.height=P(s),l},N2={bin:1,close:1,inner:1,open:1,punct:1,rel:1},P2={"accent-token":1,mathord:1,"op-token":1,spacing:1,textord:1};function O2(e){return e in N2}function re(e,t){if(!e||e.type!==t)throw new Error("Expected node of type "+t+", but got "+(e?"node of type "+e.type:String(e)));return e}function An(e){var t=Tn(e);if(!t)throw new Error("Expected node of symbol group type, but got "+(e?"node of type "+e.type:String(e)));return t}function Tn(e){return e&&(e.type==="atom"||P2.hasOwnProperty(e.type))?e:null}var Vs=e=>{if(e instanceof Xe)return e;if(c2(e)&&e.children.length===1)return Vs(e.children[0])},yi=(e,t)=>{var r,n,i;e&&e.type==="supsub"?(n=re(e.base,"accent"),r=n.base,e.base=r,i=u2(ue(e,t)),e.base=n):(n=re(e,"accent"),r=n.base);var a=ue(r,t.havingCrampedStyle()),l=n.isShifty&&xt(r),s=0;if(l){var o,u;s=(o=(u=Vs(a))==null?void 0:u.skew)!=null?o:0}var h=n.label==="\\c",m=h?a.height+a.depth:Math.min(a.height,t.fontMetrics().xHeight),d;if(n.isStretchy)d=Sn(n,t),d=oe({positionType:"firstBaseline",children:[{type:"elem",elem:a},{type:"elem",elem:d,wrapperClasses:["svg-align"],wrapperStyle:s>0?{width:"calc(100% - "+P(2*s)+")",marginLeft:P(2*s)}:void 0}]});else{var p,y;n.label==="\\vec"?(p=Ps("vec",t),y=Ns.vec[1]):(p=wn({mode:n.mode,text:n.label},t,"textord"),p=o2(p),p.italic=0,y=p.width,h&&(m+=p.depth)),d=F(["accent-body"],[p]);var w=n.label==="\\textcircled";w&&(d.classes.push("accent-full"),m=a.height);var C=s;w||(C-=y/2),d.style.left=P(C),n.label==="\\textcircled"&&(d.style.top=".2em"),d=oe({positionType:"firstBaseline",children:[{type:"elem",elem:a},{type:"kern",size:-m},{type:"elem",elem:d}]})}var A=F(["mord","accent"],[d],t);return i?(i.children[0]=A,i.height=Math.max(A.height,i.height),i.classes[0]="mord",i):A},_s=(e,t)=>{var r=e.isStretchy?kn(e.label):new N("mo",[et(e.label,e.mode)]),n=new N("mover",[fe(e.base,t),r]);return n.setAttribute("accent","true"),n},q2=new RegExp(["\\acute","\\grave","\\ddot","\\tilde","\\bar","\\breve","\\check","\\hat","\\vec","\\dot","\\mathring"].map(e=>"\\"+e).join("|"));_({type:"accent",names:["\\acute","\\grave","\\ddot","\\tilde","\\bar","\\breve","\\check","\\hat","\\vec","\\dot","\\mathring","\\widecheck","\\widehat","\\widetilde","\\overrightarrow","\\overleftarrow","\\Overrightarrow","\\overleftrightarrow","\\overgroup","\\overlinesegment","\\overleftharpoon","\\overrightharpoon"],props:{numArgs:1},handler:(e,t)=>{var r=hn(t[0]),n=!q2.test(e.funcName),i=!n||e.funcName==="\\widehat"||e.funcName==="\\widetilde"||e.funcName==="\\widecheck";return{type:"accent",mode:e.parser.mode,label:e.funcName,isStretchy:n,isShifty:i,base:r}},htmlBuilder:yi,mathmlBuilder:_s});_({type:"accent",names:["\\'","\\`","\\^","\\~","\\=","\\u","\\.",'\\"',"\\c","\\r","\\H","\\v","\\textcircled"],props:{numArgs:1,allowedInText:!0,allowedInMath:!0,argTypes:["primitive"]},handler:(e,t)=>{var r=t[0],n=e.parser.mode;return n==="math"&&(e.parser.settings.reportNonstrict("mathVsTextAccents","LaTeX's accent "+e.funcName+" works only in text mode"),n="text"),{type:"accent",mode:n,label:e.funcName,isStretchy:!1,isShifty:!0,base:r}},htmlBuilder:yi,mathmlBuilder:_s});_({type:"accentUnder",names:["\\underleftarrow","\\underrightarrow","\\underleftrightarrow","\\undergroup","\\underlinesegment","\\utilde"],props:{numArgs:1},handler:(e,t)=>{var{parser:r,funcName:n}=e,i=t[0];return{type:"accentUnder",mode:r.mode,label:n,base:i}},htmlBuilder:(e,t)=>{var r=ue(e.base,t),n=Sn(e,t),i=e.label==="\\utilde"?.12:0,a=oe({positionType:"top",positionData:r.height,children:[{type:"elem",elem:n,wrapperClasses:["svg-align"]},{type:"kern",size:i},{type:"elem",elem:r}]});return F(["mord","accentunder"],[a],t)},mathmlBuilder:(e,t)=>{var r=kn(e.label),n=new N("munder",[fe(e.base,t),r]);return n.setAttribute("accentunder","true"),n}});var Kr=e=>{var t=new N("mpadded",e?[e]:[]);return t.setAttribute("width","+0.6em"),t.setAttribute("lspace","0.3em"),t};_({type:"xArrow",names:["\\xleftarrow","\\xrightarrow","\\xLeftarrow","\\xRightarrow","\\xleftrightarrow","\\xLeftrightarrow","\\xhookleftarrow","\\xhookrightarrow","\\xmapsto","\\xrigLine truncated
|
||||
]`,f5="\\\\[a-zA-Z@]+",p5="\\\\[^\uD800-\uDFFF]",d5="("+f5+")"+bo+"*",g5=`\\\\(
|
||||
|[ \r ]+
|
||||
?)[ \r ]*`,V0="[̀-ͯ]",v5=new RegExp(V0+"+$"),y5="("+bo+"+)|"+(g5+"|")+"([!-\\[\\]-‧-豈-]"+(V0+"*")+"|[\uD800-\uDBFF][\uDC00-\uDFFF]"+(V0+"*")+"|\\\\verb\\*([^]).*?\\4|\\\\verb([^*a-zA-Z]).*?\\5"+("|"+d5)+("|"+p5+")");class al{constructor(t,r){this.input=void 0,this.settings=void 0,this.tokenRegex=void 0,this.catcodes=void 0,this.input=t,this.settings=r,this.tokenRegex=new RegExp(y5,"g"),this.catcodes={"%":14,"~":13}}setCatcode(t,r){this.catcodes[t]=r}lex(){var t=this.input,r=this.tokenRegex.lastIndex;if(r===t.length)return new We("EOF",new He(this,r,r));var n=this.tokenRegex.exec(t);if(n===null||n.index!==r)throw new L("Unexpected character: '"+t[r]+"'",new We(t[r],new He(this,r,r+1)));var i=n[6]||n[3]||(n[2]?"\\ ":" ");if(this.catcodes[i]===14){var a=t.indexOf(`
|
||||
`,this.tokenRegex.lastIndex);return a===-1?(this.tokenRegex.lastIndex=t.length,this.settings.reportNonstrict("commentAtEnd","% comment has no terminating newline; LaTeX would fail because of commenting the end of math mode (e.g. $)")):this.tokenRegex.lastIndex=a+1,this.lex()}return new We(i,new He(this,r,this.tokenRegex.lastIndex))}}class b5{constructor(t,r){t===void 0&&(t={}),r===void 0&&(r={}),this.current=void 0,this.builtins=void 0,this.undefStack=void 0,this.current=r,this.builtins=t,this.undefStack=[]}beginGroup(){this.undefStack.push({})}endGroup(){if(this.undefStack.length===0)throw new L("Unbalanced namespace destruction: attempt to pop global namespace; please report this as a bug");var t=this.undefStack.pop();for(var r in t)t.hasOwnProperty(r)&&(t[r]==null?delete this.current[r]:this.current[r]=t[r])}endGroups(){for(;this.undefStack.length>0;)this.endGroup()}has(t){return this.current.hasOwnProperty(t)||this.builtins.hasOwnProperty(t)}get(t){return this.current.hasOwnProperty(t)?this.current[t]:this.builtins[t]}set(t,r,n){if(n===void 0&&(n=!1),n){for(var i=0;i<this.undefStack.length;i++)delete this.undefStack[i][t];this.undefStack.length>0&&(this.undefStack[this.undefStack.length-1][t]=r)}else{var a=this.undefStack[this.undefStack.length-1];a&&!a.hasOwnProperty(t)&&(a[t]=this.current[t])}r==null?delete this.current[t]:this.current[t]=r}}var x5=so;v("\\noexpand",function(e){var t=e.popToken();return e.isExpandable(t.text)&&(t.noexpand=!0,t.treatAsRelax=!0),{tokens:[t],numArgs:0}});v("\\expandafter",function(e){var t=e.popToken();return e.expandOnce(!0),{tokens:[t],numArgs:0}});v("\\@firstoftwo",function(e){var t=e.consumeArgs(2);return{tokens:t[0],numArgs:0}});v("\\@secondoftwo",function(e){var t=e.consumeArgs(2);return{tokens:t[1],numArgs:0}});v("\\@ifnextchar",function(e){var t=e.consumeArgs(3);e.consumeSpaces();var r=e.future();return t[0].length===1&&t[0][0].text===r.text?{tokens:t[1],numArgs:0}:{tokens:t[2],numArgs:0}});v("\\@ifstar","\\@ifnextchar *{\\@firstoftwo{#1}}");v("\\TextOrMath",function(e){var t=e.consumeArgs(2);return e.mode==="text"?{tokens:t[0],numArgs:0}:{tokens:t[1],numArgs:0}});var ll={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,a:10,A:10,b:11,B:11,c:12,C:12,d:13,D:13,e:14,E:14,f:15,F:15};v("\\char",function(e){var t=e.popToken(),r,n=0;if(t.text==="'")r=8,t=e.popToken();else if(t.text==='"')r=16,t=e.popToken();else if(t.text==="`")if(t=e.popToken(),t.text[0]==="\\")n=t.text.charCodeAt(1);else{if(t.text==="EOF")throw new L("\\char` missing argument");n=t.text.charCodeAt(0)}else r=10;if(r){if(n=ll[t.text],n==null||n>=r)throw new L("Invalid base-"+r+" digit "+t.text);for(var i;(i=ll[e.future().text])!=null&&i<r;)n*=r,n+=i,e.popToken()}return"\\@char{"+n+"}"});var ki=(e,t,r,n)=>{var i=e.consumeArg().tokens;if(i.length!==1)throw new L("\\newcommand's first argument must be a macro name");var a=i[0].text,l=e.isDefined(a);if(l&&!t)throw new L("\\newcommand{"+a+"} attempting to redefine "+(a+"; use \\renewcommand"));if(!l&&!r)throw new L("\\renewcommand{"+a+"} when command "+a+" does not yet exist; use \\newcommand");var s=0;if(i=e.consumeArg().tokens,i.length===1&&i[0].text==="["){for(var o="",u=e.expandNextToken();u.text!=="]"&&u.text!=="EOF";)o+=u.text,u=e.expandNextToken();if(!o.match(/^\s*[0-9]+\s*$/))throw new L("Invalid number of arguments: "+o);s=parseInt(o),i=e.consumeArg().tokens}return l&&n||e.macros.set(a,{tokens:i,numArgs:s}),""};v("\\newcommand",e=>ki(e,!1,!0,!1));v("\\renewcommand",e=>ki(e,!0,!1,!1));v("\\providecommand",e=>ki(e,!0,!0,!0));v("\\message",e=>{var t=e.consumeArgs(1)[0];return console.log(t.reverse().map(r=>r.text).join("")),""});v("\\errmessage",e=>{var t=e.consumeArgs(1)[0];return console.error(t.reverse().map(r=>r.text).join("")),""});v("\\show",e=>{var t=e.popToken(),r=t.text;return console.log(t,e.macros.get(r),Ct[r],de.math[r],de.text[r]),""});v("\\bgroup","{");v("\\egroup","}");v("~","\\nobreakspace");v("\\lq","`");v("\\rq","'");v("\\aa","\\r a");v("\\AA","\\r A");v("\\textcopyright","\\html@mathml{\\textcircled{c}}{\\char`©}");v("\\copyright","\\TextOrMath{\\textcopyright}{\\text{\\textcopyright}}");v("\\textregistered","\\html@mathml{\\textcircled{\\scriptsize R}}{\\char`®}");v("ℬ","\\mathscr{B}");v("ℰ","\\mathscr{E}");v("ℱ","\\mathscr{F}");v("ℋ","\\mathscr{H}");v("ℐ","\\mathscr{I}");v("ℒ","\\mathscr{L}");v("ℳ","\\mathscr{M}");v("ℛ","\\mathscr{R}");v("ℭ","\\mathfrak{C}");v("ℌ","\\mathfrak{H}");v("ℨ","\\mathfrak{Z}");v("\\Bbbk","\\Bbb{k}");v("\\llap","\\mathllap{\\textrm{#1}}");v("\\rlap","\\mathrlap{\\textrm{#1}}");v("\\clap","\\mathclap{\\textrm{#1}}");v("\\mathstrut","\\vphantom{(}");v("\\underbar","\\underline{\\text{#1}}");v("\\not",'\\html@mathml{\\mathrel{\\mathrlap\\@not}\\nobreak}{\\char"338}');v("\\neq","\\html@mathml{\\mathrel{\\not=}}{\\mathrel{\\char`≠}}");v("\\ne","\\neq");v("≠","\\neq");v("\\notin","\\html@mathml{\\mathrel{{\\in}\\mathllap{/\\mskip1mu}}}{\\mathrel{\\char`∉}}");v("∉","\\notin");v("≘","\\hLine truncated
|
||||
please report what input caused this bug`);return n=n.slice(1,-1),{type:"verb",mode:"text",body:n,star:i}}ul.hasOwnProperty(r[0])&&!de[this.mode][r[0]]&&(this.settings.strict&&this.mode==="math"&&this.settings.reportNonstrict("unicodeTextInMathMode",'Accented Unicode text character "'+r[0]+'" used in math mode',t),r=ul[r[0]]+r.slice(1));var a=v5.exec(r);a&&(r=r.substring(0,a.index),r==="i"?r="ı":r==="j"&&(r="ȷ"));var l;if(de[this.mode][r]){this.settings.strict&&this.mode==="math"&&I0.includes(r)&&this.settings.reportNonstrict("unicodeTextInMathMode",'Latin-1/Unicode text character "'+r[0]+'" used in math mode',t);var s=de[this.mode][r].group,o=He.range(t),u;O2(s)?u={type:"atom",mode:this.mode,family:s,loc:o,text:r}:u={type:s,mode:this.mode,loc:o,text:r},l=u}else if(r.charCodeAt(0)>=128)this.settings.strict&&(Ms(r.charCodeAt(0))?this.mode==="math"&&this.settings.reportNonstrict("unicodeTextInMathMode",'Unicode text character "'+r[0]+'" used in math mode',t):this.settings.reportNonstrict("unknownSymbol",'Unrecognized Unicode character "'+r[0]+'"'+(" ("+r.charCodeAt(0)+")"),t)),l={type:"textord",mode:"text",loc:He.range(t),text:r};else return null;if(this.consume(),a)for(var h=0;h<a[0].length;h++){var m=a[0][h];if(!f0[m])throw new L("Unknown accent ' "+m+"'",t);var d=f0[m][this.mode]||f0[m].text;if(!d)throw new L("Accent "+m+" unsupported in "+this.mode+" mode",t);l={type:"accent",mode:this.mode,loc:He.range(t),label:d,isStretchy:!1,isShifty:!0,base:l}}return l}}Dn.endOfExpression=new Set(["}","\\endgroup","\\end","\\right","&"]);var Ai=function(t,r){if(!(typeof t=="string"||t instanceof String))throw new TypeError("KaTeX can only parse string typed expression");var n=new Dn(t,r);delete n.gullet.macros.current["\\df@tag"];var i=n.parse();if(delete n.gullet.macros.current["\\current@color"],delete n.gullet.macros.current["\\color"],n.gullet.macros.get("\\df@tag")){if(!r.displayMode)throw new L("\\tag works only in display equations");i=[{type:"tag",mode:"text",body:i,tag:n.subparse([new We("\\df@tag")])}]}return i},So=function(t,r,n){r.textContent="";var i=Ti(t,n).toNode();r.appendChild(i)};typeof document<"u"&&document.compatMode!=="CSS1Compat"&&(typeof console<"u"&&console.warn("Warning: KaTeX doesn't work in quirks mode. Make sure your website has a suitable doctype."),So=function(){throw new L("KaTeX doesn't work in quirks mode.")});var S5=function(t,r){var n=Ti(t,r).toMarkup();return n},A5=function(t,r){var n=new ci(r);return Ai(t,n)},Ao=function(t,r,n){if(n.throwOnError||!(t instanceof L))throw t;var i=F(["katex-error"],[new Xe(r)]);return i.setAttribute("title",t.toString()),i.setAttribute("style","color:"+n.errorColor),i},Ti=function(t,r){var n=new ci(r);try{var i=Ai(t,n);return I2(i,t,n)}catch(a){return Ao(a,t,n)}},T5=function(t,r){var n=new ci(r);try{var i=Ai(t,n);return D2(i,t,n)}catch(a){return Ao(a,t,n)}},C5="0.16.47",z5={Span:sr,Anchor:bn,SymbolNode:Xe,SvgNode:yt,PathNode:Mt,LineNode:E0},cl={version:C5,render:So,renderToString:S5,ParseError:L,SETTINGS_SCHEMA:C0,__parse:A5,__renderToDomTree:Ti,__renderToHTMLTree:T5,__setFontMetrics:h2,__defineSymbol:c,__defineFunction:_,__defineMacro:v,__domTree:z5};const M5={},E5=[];function G5(e){const t=e||M5;return function(r,n){ei(r,"element",function(i,a){const l=Array.isArray(i.properties.className)?i.properties.className:E5,s=l.includes("language-math"),o=l.includes("math-display"),u=l.includes("math-inline");let h=o;if(!s&&!o&&!u)return;let m=a[a.length-1],d=i;if(i.tagName==="code"&&s&&m&&m.type==="element"&&m.tagName==="pre"&&(d=m,m=a[a.length-2],h=!0),!m)return;const p=Af(d,{whitespace:"pre"});let y;try{y=cl.renderToString(p,{...t,displayMode:h,throwOnError:!0})}catch(C){const A=C,z=A.name.toLowerCase();n.message("Could not render math with KaTeX",{ancestors:[...a,i],cause:A,place:i.position,ruleId:z,source:"rehype-katex"});try{y=cl.renderToString(p,{...t,displayMode:h,strict:"ignore",throwOnError:!1})}catch{y=[{type:"element",tagName:"span",properties:{className:["katex-error"],style:"color:"+(t.errorColor||"#cc0000"),title:String(C)},children:[{type:"text",value:p}]}]}}typeof y=="string"&&(y=gf(y).children);const w=m.children.indexOf(d);return m.children.splice(w,1,...y),Gl})}}const W5={a({href:e,children:t,node:r,...n}){const i=Co(e??"");return i?jt.jsx("a",{...n,href:i,target:"_blank",rel:"noopener noreferrer",children:t}):jt.jsx("span",{"data-slot":"md-link-blocked",children:t})},img({src:e,alt:t,node:r,...n}){const i=To(e??"");return i?jt.jsx("img",{...n,src:i,alt:t??"",loading:"lazy",decoding:"async"}):t?jt.jsx("span",{"data-slot":"md-image-blocked",children:t}):null}},I5=/((?:```|~~~)[\s\S]*?(?:```|~~~))/g,D5=/(`[^`\n]+`)/g,B5=/(^|[^\\])\$(?=\d)/g,F5=/\\\((.+?)\\\)/g,R5=/\\\[([\s\S]+?)\\\]/g,mn=/^([ \t]*)(`{3,}|~{3,})([^\n]*)$/,L5=/^[a-z][a-z0-9+#.\-]{0,15}$/i;function fn(e){const t=e.toLowerCase().trim();return L5.test(t)?t:null}function hl(e){const t=e.split(/\s+/,1)[0]||"";return!fn(t)}function N5(e){const t=e.split(`
|
||||
`),r=[];let n=0;for(;n<t.length;){const l=t[n].match(mn);if(!l){n++;continue}const s=l[2][0],o=l[2].length,u=l[1],h=n;let m=-1;for(let d=n+1;d<t.length;d++){const p=t[d].match(mn);if(p&&p[2][0]===s&&p[2].length>=o&&p[1]===u&&p[3].trim()===""){m=d;break}}if(m!==-1)r.push([h,m]),n=m+1;else{const p=l[3].trim().split(/\s+/,1)[0]||"",y=fn(p)!==null,w=n+1<t.length&&t.slice(n+1).some(C=>C.trim()!=="");if(y&&w){r.push([h,t.length-1]);break}n++}}function i(l){return r.some(([s,o])=>l>=s&&l<=o)}return t.map((l,s)=>{if(i(s))return l;let o=l.replace(/`{3,}/g,"");return o=o.replace(/``\s*``/g,""),o=o.replace(/``(?=[.,;:!?\s]|$)/g,""),o}).join(`
|
||||
`)}function P5(e){const t=e.split(`
|
||||
`),r=[];let n=0;for(;n<t.length;){const i=t[n].match(mn);if(!i){r.push(t[n]),n++;continue}const a=i[1],l=i[2],s=l[0],o=l.length,u=i[3].trim();let h=-1;for(let m=n+1;m<t.length;m++){const d=t[m].match(mn);if(d&&d[2][0]===s&&d[2].length>=o&&d[1]===a&&d[3].trim()===""){h=m;break}}if(h!==-1){const m=t.slice(n+1,h);if(!m.some(C=>C.trim()!=="")){n=h+1;continue}const p=u.split(/\s+/,1)[0]||"";if(p.toLowerCase()==="math"){r.push(`${a}\`\`\`math`);for(const C of m)r.push(C);r.push(`${a}\`\`\``),n=h+1;continue}if(u&&hl(u)){for(const C of m)r.push(C);n=h+1;continue}const y=u?fn(p):null,w=y||"";r.push(`${a}\`\`\`${w}`);for(const C of m)r.push(C);r.push(`${a}\`\`\``),n=h+1}else{const m=t.slice(n+1);if(!m.some(w=>w.trim()!=="")){n++;continue}const p=u.split(/\s+/,1)[0]||"",y=fn(p);if(y||p.toLowerCase()==="math"){const w=p.toLowerCase()==="math"?"math":y;r.push(`${a}\`\`\`${w}`);for(const C of m)r.push(C)}else if(u&&hl(u))for(const w of m)r.push(w);else{r.push(`${a}\`\`\``);for(const w of m)r.push(w)}break}}return r.join(`
|
||||
`)}function O5(e){return e.replace(/(^|\n)[ \t]*(?:`{3,}|~{3,})[^\n]*\n[ \t]*\n?[ \t]*(?:`{3,}|~{3,})[ \t]*(?=\n|$)/g,"$1")}function q5(e){return e.replace(B5,"$1\\$")}function H5(e){let t=e;return t=t.replace(R5,(r,n)=>`$$${n}$$`),t=t.replace(F5,(r,n)=>`$${n}$`),t}function X5(e){const t=N5(e),r=P5(t);return O5(r).split(I5).map((i,a)=>a%2===1||!i.trim()?i:i.split(D5).map((l,s)=>s%2===1?l:H5(q5(l))).join("")).join("")}export{V5 as M,W5 as S,U5 as a,_5 as b,X5 as p,G5 as r};
|
||||
@@ -0,0 +1 @@
|
||||
@font-face{font-display:block;font-family:KaTeX_AMS;font-style:normal;font-weight:400;src:url(/assets/KaTeX_AMS-Regular-BQhdFMY1.woff2) format("woff2"),url(/assets/KaTeX_AMS-Regular-DMm9YOAa.woff) format("woff"),url(/assets/KaTeX_AMS-Regular-DRggAlZN.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_Caligraphic;font-style:normal;font-weight:700;src:url(/assets/KaTeX_Caligraphic-Bold-Dq_IR9rO.woff2) format("woff2"),url(/assets/KaTeX_Caligraphic-Bold-BEiXGLvX.woff) format("woff"),url(/assets/KaTeX_Caligraphic-Bold-ATXxdsX0.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_Caligraphic;font-style:normal;font-weight:400;src:url(/assets/KaTeX_Caligraphic-Regular-Di6jR-x-.woff2) format("woff2"),url(/assets/KaTeX_Caligraphic-Regular-CTRA-rTL.woff) format("woff"),url(/assets/KaTeX_Caligraphic-Regular-wX97UBjC.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_Fraktur;font-style:normal;font-weight:700;src:url(/assets/KaTeX_Fraktur-Bold-CL6g_b3V.woff2) format("woff2"),url(/assets/KaTeX_Fraktur-Bold-BsDP51OF.woff) format("woff"),url(/assets/KaTeX_Fraktur-Bold-BdnERNNW.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_Fraktur;font-style:normal;font-weight:400;src:url(/assets/KaTeX_Fraktur-Regular-CTYiF6lA.woff2) format("woff2"),url(/assets/KaTeX_Fraktur-Regular-Dxdc4cR9.woff) format("woff"),url(/assets/KaTeX_Fraktur-Regular-CB_wures.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_Main;font-style:normal;font-weight:700;src:url(/assets/KaTeX_Main-Bold-Cx986IdX.woff2) format("woff2"),url(/assets/KaTeX_Main-Bold-Jm3AIy58.woff) format("woff"),url(/assets/KaTeX_Main-Bold-waoOVXN0.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_Main;font-style:italic;font-weight:700;src:url(/assets/KaTeX_Main-BoldItalic-DxDJ3AOS.woff2) format("woff2"),url(/assets/KaTeX_Main-BoldItalic-SpSLRI95.woff) format("woff"),url(/assets/KaTeX_Main-BoldItalic-DzxPMmG6.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_Main;font-style:italic;font-weight:400;src:url(/assets/KaTeX_Main-Italic-NWA7e6Wa.woff2) format("woff2"),url(/assets/KaTeX_Main-Italic-BMLOBm91.woff) format("woff"),url(/assets/KaTeX_Main-Italic-3WenGoN9.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_Main;font-style:normal;font-weight:400;src:url(/assets/KaTeX_Main-Regular-B22Nviop.woff2) format("woff2"),url(/assets/KaTeX_Main-Regular-Dr94JaBh.woff) format("woff"),url(/assets/KaTeX_Main-Regular-ypZvNtVU.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_Math;font-style:italic;font-weight:700;src:url(/assets/KaTeX_Math-BoldItalic-CZnvNsCZ.woff2) format("woff2"),url(/assets/KaTeX_Math-BoldItalic-iY-2wyZ7.woff) format("woff"),url(/assets/KaTeX_Math-BoldItalic-B3XSjfu4.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_Math;font-style:italic;font-weight:400;src:url(/assets/KaTeX_Math-Italic-t53AETM-.woff2) format("woff2"),url(/assets/KaTeX_Math-Italic-DA0__PXp.woff) format("woff"),url(/assets/KaTeX_Math-Italic-flOr_0UB.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_SansSerif;font-style:normal;font-weight:700;src:url(/assets/KaTeX_SansSerif-Bold-D1sUS0GD.woff2) format("woff2"),url(/assets/KaTeX_SansSerif-Bold-DbIhKOiC.woff) format("woff"),url(/assets/KaTeX_SansSerif-Bold-CFMepnvq.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_SansSerif;font-style:italic;font-weight:400;src:url(/assets/KaTeX_SansSerif-Italic-C3H0VqGB.woff2) format("woff2"),url(/assets/KaTeX_SansSerif-Italic-DN2j7dab.woff) format("woff"),url(/assets/KaTeX_SansSerif-Italic-YYjJ1zSn.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_SansSerif;font-style:normal;font-weight:400;src:url(/assets/KaTeX_SansSerif-Regular-DDBCnlJ7.woff2) format("woff2"),url(/assets/KaTeX_SansSerif-Regular-CS6fqUqJ.woff) format("woff"),url(/assets/KaTeX_SansSerif-Regular-BNo7hRIc.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_Script;font-style:normal;font-weight:400;src:url(/assets/KaTeX_Script-Regular-D3wIWfF6.woff2) format("woff2"),url(/assets/KaTeX_Script-Regular-D5yQViql.woff) format("woff"),url(/assets/KaTeX_Script-Regular-C5JkGWo-.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_Size1;font-style:normal;font-weight:400;src:url(/assets/KaTeX_Size1-Regular-mCD8mA8B.woff2) format("woff2"),url(/assets/KaTeX_Size1-Regular-C195tn64.woff) format("woff"),url(/assets/KaTeX_Size1-Regular-Dbsnue_I.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_Size2;font-style:normal;font-weight:400;src:url(/assets/KaTeX_Size2-Regular-Dy4dx90m.woff2) format("woff2"),url(/assets/KaTeX_Size2-Regular-oD1tc_U0.woff) format("woff"),url(/assets/KaTeX_Size2-Regular-B7gKUWhC.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_Size3;font-style:normal;font-weight:400;src:url(data:font/woff2;base64,d09GMgABAAAALine truncated
|
||||
@@ -0,0 +1,2 @@
|
||||
import{c as te,b as c,an as G,ao as oe,aj as r,T as f,ap as I,av as re,at as ne,aq as ae,as as ie,ar as ce}from"./tauri-compat-tfiFK9EG.js";import{B as F}from"./index-DpGuh58E.js";import{B as L}from"./index-Bpi3BHKj.js";import{I as se}from"./IconFile-CgfQSwGI.js";function le(t){return c.createElement("svg",Object.assign({viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",focusable:!1,"aria-hidden":!0},t),c.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M2 5a3 3 0 0 1 3-3h3.3a2 2 0 0 1 1.25.44l1.13.9a3 3 0 0 0 1.87.66H18c2 0 3 2 3 4H7.53A2 2 0 0 0 5.6 9.48L2.57 20.76C2.21 20.26 2 19.66 2 19V5Zm20.17 5H9.5a2 2 0 0 0-1.92 1.44l-2.7 9.28A1 1 0 0 0 5.82 22H18.5a2 2 0 0 0 1.92-1.44l2.7-9.28a1 1 0 0 0-.95-1.28Z",fill:"currentColor"}))}const pe=te(le,"folder_open");function C(){return window.__TAURI__}function de(t,e){return Number.isFinite(e.seq)?e.seq>t:!0}function O(t,e,n,i="prepare_failed"){const u=e==null?"":oe(e);return{seq:n,mode:"cold_start",phase:"failed",stage:null,progress:0,failure:{code:u?i:"unknown",detail:u},diagnostics:{buildId:"",platform:navigator.platform||"",projectDir:t[1]||"",pythonPath:t[0]||"",portState:"unknown",bridgeIdentity:null,recentLogs:[]}}}async function ue(t,e=0){const n=await t("get_config").catch(()=>["",""]);try{return{config:n,mode:"snapshot",snapshot:await t("get_bootstrap_snapshot")}}catch(i){if(!G(i,"get_bootstrap_snapshot"))throw i;const u=await t("get_prepare_error").catch(()=>null);return{config:n,mode:"legacy",snapshot:O(n,u,e)}}}async function he(t,e,n){if(n==="snapshot")try{return await t("retry_bootstrap",e),{mode:"snapshot"}}catch(i){if(!G(i,"retry_bootstrap"))return{mode:"snapshot",error:i}}try{return await t("start_bridge_with_config",e),{mode:"legacy"}}catch(i){return{mode:"legacy",error:i}}}async function ye(t,e,n){const i=await t("pick_directory",{title:n});if(!i)return null;const u=await t("discover_python_for_project",{projectDir:i,currentPython:e||null}).catch(()=>e);return{projectDir:i,pythonPath:u||""}}async function ge(t,e){return t("pick_python_interpreter",{title:e})}const H={config_unresolved:{zh:{title:"未找到应用文件",description:"请选择应用文件夹后继续。"},en:{title:"Application files not found",description:"Choose the application folder to continue."}},prepare_failed:{zh:{title:"运行环境尚未准备完成",description:"请检查所选应用文件夹和 Python 环境,然后继续启动。"},en:{title:"Environment setup is incomplete",description:"Check the application folder and Python environment, then continue startup."}},spawn_failed:{zh:{title:"本地连接未能启动",description:"请选择可用的应用文件夹和 Python 环境后继续。"},en:{title:"Local connection could not start",description:"Choose a usable application folder and Python environment to continue."}},bridge_shutdown_refused:{zh:{title:"本地连接暂时无法安全重启",description:"请等待当前操作完成后重试。"},en:{title:"Local connection cannot restart safely",description:"Wait for the current operation to finish, then retry."}},port_conflict:{zh:{title:"本地连接被占用",description:"另一个应用正在使用本地连接。关闭相关应用后继续启动。"},en:{title:"Local connection is in use",description:"Another app is using the local connection. Close it, then continue startup."}},service_timeout:{zh:{title:"本地连接启动时间过长",description:"请检查所选位置;诊断信息中包含最近的启动记录。"},en:{title:"Local connection is taking too long",description:"Check the selected locations. Diagnostics contain the latest startup records."}},service_exited:{zh:{title:"本地连接意外停止",description:"诊断信息中包含停止状态和最近的启动记录。"},en:{title:"Local connection stopped unexpectedly",description:"Diagnostics contain the stop status and latest startup records."}},ui_navigation_failed:{zh:{title:"主界面未能打开",description:"本地连接已经就绪,但界面加载失败。诊断信息中包含详细原因。"},en:{title:"Main window could not open",description:"The local connection is ready, but the interface failed to load. Diagnostics contain details."}},unknown:{zh:{title:"启动尚未完成",description:"请检查所选位置;需要协助时可复制诊断信息。"},en:{title:"Startup is not complete",description:"Check the selected locations. Copy diagnostics if you need support."}}},fe={zh:{pageTitle:"完成启动设置",intro:"选择应用运行所需的位置。你的记忆、会话和设置不会受到影响。",projectLabel:"应用文件夹",projectHint:"选择此前用于运行桌面版的应用文件夹。",projectPickerTitle:"选择应用文件夹",chooseProject:"选择文件夹",changeProject:"重新选择",projectEmpty:"尚未选择应用文件夹",pythonLabel:"Python 环境",pythonHint:"应用会自动选择可用环境;如有需要,可以重新选择。",pythonPickerTitlLine truncated
|
||||
`)}const B={projectDir:"",pythonPath:""};function q({label:t,hint:e,value:n,emptyText:i,buttonText:u,buttonLabel:l,loading:k,disabled:m,icon:j,onChoose:P}){return r.jsxs("section",{className:"ga-setup-location","aria-label":t,children:[r.jsxs("div",{className:"ga-setup-location-header",children:[r.jsx(f.Text,{strong:!0,children:t}),r.jsx(L,{size:"small",type:"tertiary",theme:"light",icon:j,loading:k,disabled:m,"aria-label":l,onClick:P,children:u})]}),r.jsx("div",{className:`ga-setup-path${n?"":" ga-setup-path--empty"}`,role:"textbox","aria-readonly":"true","aria-label":t,tabIndex:0,children:n?r.jsx("code",{children:n}):r.jsx("span",{children:i})}),r.jsx(f.Paragraph,{type:"tertiary",size:"small",className:"ga-setup-location-hint",children:e})]})}function S(t,e){return{seq:e,mode:"cold_start",phase:"failed",stage:null,progress:0,failure:{code:"unknown",detail:String(t)},diagnostics:{buildId:"",platform:navigator.platform||"",projectDir:"",pythonPath:"",portState:"unknown",bridgeIdentity:null,recentLogs:[]}}}function Pe(){var M;const t=V(),e=me(t),n=c.useRef(B),[i,u]=c.useState(B),[l,k]=c.useState(null),[m,j]=c.useState(!1),[P,N]=c.useState(!1),[T,z]=c.useState(!1),[R,b]=c.useState(""),[W,E]=c.useState(""),g=c.useRef(-1),w=c.useRef(null),D=c.useRef("snapshot"),h=c.useCallback(o=>{n.current=o,u(o)},[]),y=c.useCallback(o=>{var d,s,_,v;const a=w.current;if(!de(g.current,o))return;g.current=Number.isFinite(o.seq)?o.seq:g.current+1,w.current=o,k(o),o.phase==="failed"&&j(!1);const p={};(d=o.diagnostics)!=null&&d.projectDir&&(!n.current.projectDir||((s=a==null?void 0:a.diagnostics)==null?void 0:s.projectDir)===n.current.projectDir)&&(p.projectDir=o.diagnostics.projectDir),(_=o.diagnostics)!=null&&_.pythonPath&&(!n.current.pythonPath||((v=a==null?void 0:a.diagnostics)==null?void 0:v.pythonPath)===n.current.pythonPath)&&(p.pythonPath=o.diagnostics.pythonPath),Object.keys(p).length&&h({...n.current,...p})},[h]);c.useEffect(()=>{var o;(o=window.__GA_SETUP_MARK_READY__)==null||o.call(window)},[]),c.useEffect(()=>{const o=C();if(!(o!=null&&o.core.invoke)){y(S("Tauri bootstrap API is unavailable",0));return}let a=!0,p;return(async()=>{var v;if((v=o.event)!=null&&v.listen)try{const x=await o.event.listen("bootstrap",ee=>{a&&y(ee.payload)});if(!a){x();return}p=x}catch(x){console.warn("[setup] bootstrap events unavailable; using command compatibility mode",x)}const d=await ue(o.core.invoke,g.current+1);if(!a)return;D.current=d.mode;const s=d.config,_={pythonPath:(s==null?void 0:s[0])||"",projectDir:(s==null?void 0:s[1])||""};h({pythonPath:n.current.pythonPath||_.pythonPath,projectDir:n.current.projectDir||_.projectDir}),y(d.snapshot)})().catch(d=>{a&&y(S(d,g.current+1))}),()=>{a=!1,p==null||p()}},[h,y]);const $=c.useMemo(()=>{var o;return je((o=l==null?void 0:l.failure)==null?void 0:o.code,t)},[t,(M=l==null?void 0:l.failure)==null?void 0:M.code]),A=c.useMemo(()=>be(l),[l]),Z=c.useCallback(async()=>{const o=C();if(!(o!=null&&o.core.invoke)){b(e.pickerError);return}N(!0),b("");try{const a=await ye(o.core.invoke,n.current.pythonPath,e.projectPickerTitle);a&&h(a)}catch(a){console.error("[setup] application folder selection failed",a),b(e.pickerError)}finally{N(!1)}},[h,e]),J=c.useCallback(async()=>{const o=C();if(!(o!=null&&o.core.invoke)){b(e.pickerError);return}z(!0),b("");try{const a=await ge(o.core.invoke,e.pythonPickerTitle);a&&h({...n.current,pythonPath:a})}catch(a){console.error("[setup] Python environment selection failed",a),b(e.pickerError)}finally{z(!1)}},[h,e]),Q=c.useCallback(async()=>{const o=n.current.projectDir.trim(),a=n.current.pythonPath.trim();if(h({projectDir:o,pythonPath:a}),E(""),!o){const s=w.current??S("",g.current+1);y({...s,seq:g.current+1,phase:"failed",failure:{code:"config_unresolved",detail:""}});return}j(!0);const p=C();if(!(p!=null&&p.core.invoke)){y(S("Tauri bootstrap API is unavailable",g.current+1)),j(!1);return}const d=await he(p.core.invoke,{pythonPath:a,projectDir:o},D.current);if(D.current=d.mode,d.error){if(d.mode==="legacy")y(O([a,o],d.error,g.current+1,"spawn_failed"));else{const s=await p.core.invoke("get_bootstrap_snapshot").catch(()=>w.current);s&&y(s)}j(!1)}},[h,y]),X=c.useCallback(async()=>{var o;try{if(!((o=navigator.clipboard)!=null&&o.writeText))throw new Error("clipboard unavailable");await navigator.clipboard.writeText(A),E(e.copied)}catch{const p=document.getElementById("diagnostics");if(p){const d=document.createRange();d.selectNodeContents(p);const s=window.getSelection();s==null||s.removeAllRanges(),s==null||s.addRange(d),p.focus()}E(e.selectCopy)}},[e,A]);return r.jsx("main",{className:"ga-setup-page",children:r.jsxs("section",{className:"ga-setup-panel","aria-labelledby":"ga-setup-title",children:[r.jsxs("header",{className:"ga-setup-header",children:[r.jsx(f.Title,{id:"ga-setup-title",heading:3,children:e.pageTitle}),r.jsx(f.Paragraph,{type:"tertiary",children:e.intro})]}),(l==null?void 0:l.failure)&&r.jsx(F,{className:"ga-setup-banner",type:"danger",fullMode:!1,bordered
Line truncated
|
||||
Loaded 100 of 158 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user