dsh-code-server-app 0.2.2 → 0.2.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.en.md CHANGED
@@ -12,17 +12,28 @@
12
12
 
13
13
  A static profile plugin (npm package with host + client bundle) that ships the **VS Code server tree** from a [code-server](https://github.com/coder/code-server) release as a **platform-independent dependency package** (pack-time artifact `vendor/vscode` → `@jinsiyu/dshcs-vscode-server`, no install scripts, no postinstall). The code-server **Node service layer is replaced by the plugin's own `lib/launcher.mjs`**: it drives `<tree>/lib/vscode/out/server-main.js` (`loadCodeWithNls()` / `createServer()` / `handleRequest()` / `handleUpgrade()`) directly and re-adds the few HTTP endpoints code-server used to provide (`/healthz`, `/manifest.json`, `/_static/*`, `/proxy/:port`). The 16 native modules (node-pty / @vscode/sqlite3 / spdlog / …) come from `@jinsiyu/dshcs-*-win32-<arch>` platform packages selected automatically per architecture by the platform aggregator. VS Code's inner dependencies and the prebuilt native modules are **all installed by the package manager together with the plugin** — no global npm install, no `bin` configuration, no profile config changes, no second install command, **no argon2/C++ toolchain**.
14
14
 
15
- ## UI carrier (chosen by the DSH version, feature-detected at runtime)
15
+ ## UI carrier and required DSH version (0.2.3: right-sidebar DSH only)
16
16
 
17
17
  | DSH version | Carrier | Entry points |
18
18
  |---|---|---|
19
- | **>= 0.1.5-alpha.1** (has `sidebarRight` / `sidebarRightTabs`) | **Right-sidebar tab** (kind `code-server`, chip `Code Server`); the floating window is **no longer used** | ① the **Code Server box** on the sidebar's guide ("开始") page; ② the icon button beside each turn's artifacts; ③ Settings → Plugins → Code Server → **"Open in right sidebar"** |
20
- | older (no sidebar service) | floating ball + internal floating window (unchanged) | the bottom-right floating ball |
21
-
22
- - Detection: `ctx.inject(['sidebarRightTabs','sidebarRight'], …)` registers the tab type only when the services are ready; if they never appear (or registration fails) nothing is registered and the floating ball fallback stays in place. No version comparison, and the plugin's own activation is never blocked.
19
+ | **>= 0.1.5-alpha.1** (has `sidebarRight` / `sidebarRightTabs`) | **Right-sidebar tab** (kind `code-server`, chip `Code Server`) | ① the **Code Server box** on the sidebar's guide ("开始") page; ② the icon button beside each turn's artifacts; ③ Settings → Plugins → Code Server → **"Open in right sidebar"** |
20
+ | older (no sidebar service) | **Unsupported**: nothing but one notice on the settings page | none (Settings Plugins → Code Server shows an upgrade notice) |
21
+
22
+ - Detection: first a synchronous `ctx.get('sidebarRightTabs') / ctx.get('sidebarRight')` probe; because the services may come up after this plugin, `ctx.inject(['sidebarRightTabs','sidebarRight'], )` is awaited and a **2.5 s timeout marks the DSH as legacy** (no version comparison, and the plugin's own activation is never blocked).
23
+ Since 0.2.4 that verdict is **reversible** and registration no longer relies on `ctx` property access (which on desktop silently skipped registration — the symptom was "settings card looks normal but the sidebar has no entry"):
24
+ - services are looked up as `ctx.<name>` first and `ctx.get(name)` second, so either context shape registers;
25
+ - when the sync probe already sees the services but `inject` never calls back, registration falls back to the sync services after **1.5 s**;
26
+ - at 2.5 s only the settings notice appears; only after **10 s** does the client tell the host to recycle/stop prestarting (so a slow host is not punished);
27
+ - services arriving late automatically revoke the legacy verdict, register the sidebar, and report `{sidebar:true}` so the host re-enables;
28
+ - a failed registration is no longer silent: it logs an error and the card's entry row says "right-sidebar services were found but the tab could not be registered".
29
+ - **0.2.3 dropped legacy-DSH compatibility**: the floating ball and the internal floating window are **deleted**. When the DSH is detected as legacy the plugin
30
+ - registers only the settings card (an upgrade notice) — no ball, no floating window, no artifact buttons, no IDE preload;
31
+ - reports `/api/code-server/ui-mode { sidebar:false }` to the host (after the 10 s grace above); the host then **recycles an instance it auto-prestarted** and stops prestarting (a user-started/adopted instance is never touched), and `{sidebar:true}` reverses that if the services show up later;
32
+ - upgrading DSH needs **no reinstall** — refresh the page and the card turns back into the full settings card.
23
33
  - The sidebar tab hosts the code-server page (iframe) and follows the current session workspace; the panel can be collapsed/split/floated/fullscreened by DSH's right sidebar.
24
34
  - **Resident IDE (0.2.2, on by default)**: switching to another tab or collapsing the sidebar and coming back **no longer reloads** code-server — unsaved editor buffers, terminals and debug sessions all stay put (see "Why switching tabs no longer reloads" below).
25
- - In sidebar mode the settings card hides "Reserve space above the composer" (floating-window geometry only). "Open in a window (new tab)" still applies to every entry point.
35
+ - The settings card now has just two rows: "Open in a window (new tab)" and "Resident in background".
36
+ `reserveComposer` (reserve space above the composer) only ever mattered for the deleted floating window: it is **deprecated** in 0.2.3 — an old value in the settings document is still accepted but ignored.
26
37
  - `windowedOpen` has the highest priority: when on, entry buttons always open a browser tab.
27
38
 
28
39
  ## Why switching tabs no longer reloads (resident IDE)
@@ -48,11 +59,14 @@ it into a **singleton resident surface**:
48
59
  `HierarchyRequestError: invalid hierarchy` (passive effect cleanup runs after DOM removal), the code falls back to
49
60
  `appendChild` — one reload, but the frame is **never lost** — and reports `degraded` / `lastMoveError` so the UI can
50
61
  say "residency unavailable".
51
- - **Repaint fix (measured)**: after a long offscreen park, a moved-back cross-origin iframe had correct size, hit
52
- testing and `visibility`, yet **stopped repainting** (a fully white panel that several tab switches did not fix).
62
+ - **Repaint fallback (measured)**: in the real GUI the surface was seen once with correct size, hit testing and
63
+ `visibility` that simply **stopped repainting** (a fully white panel, byte-identical screenshots proving no new frame).
53
64
  `translateZ(0)` and `opacity` nudges did nothing; `display:none → forced reflow → restore` inside a single JS task
54
- revives it without reloading the iframe document, without losing internal state and without a visible flash. Every
55
- park→dock transition therefore runs one `nudgeRepaint()` (counted as `surfaceSnapshot().nudgeCount` for debugging).
65
+ restored it without reloading the iframe document, without losing internal state and without a visible flash.
66
+ **The trigger could not be reproduced**: in a probe page an offscreen `moveBefore` park of 337 s (past Chrome's
67
+ ~5 min cross-origin throttle window) followed by a dock with the fallback disabled still painted normally. It is
68
+ therefore kept as a **fallback**: every park→dock transition runs one `nudgeRepaint()` (counted as
69
+ `surfaceSnapshot().nudgeCount`; `setNudgeEnabled(false)` A/Bs it live).
56
70
  - **Warm-up**: with `keepResident` (default `true`) the host builds the surface right after plugin start and leaves it
57
71
  parked, so the first tab open needs no cold start; preloading never yanks a surface that is currently docked.
58
72
  - **Debug handle**: `window.__dshcsSurface` (`snapshot()`, `setParkStrategy('offscreen'|'behind')`, `dock()`, `park()`,
@@ -83,14 +97,29 @@ state preserved (no full reload). Full evidence and probe scripts: `docs/analysi
83
97
  browser page could complete a handshake against `ws://127.0.0.1:<port>/stable-<commit>` and drive the IDE.
84
98
 
85
99
 
86
- - **Floating ball** (bottom-right, official code-server icon, above the composer): click to **expand the floating window and light it up** (blue glow), click again to **collapse**; **drag to any position** (remembered across refreshes; no accidental click after drag);
87
- no sidebar button, no window control button group (the ball is the only entry/toggle); the ball carries a status dot (green = running / amber = starting / red = error);
88
- - Window is an **internal floating window** (modeled on dsh-univer-office's WorktreeWindow): fixed-position overlay + an inert root container, the window takes over pointer events,
89
- **no title bar / buttons** — drag the top strip to move (hover shows a faint hint; **drag to the top of the screen and release = maximize**,
90
- **grab the top strip downward while maximized = restore** and keep dragging), double-click to maximize, 8-direction resize, Esc to close (same as collapsing the ball),
91
- initial position above the composer, maximized/resized dimensions stop above the input bar (never cover the composer);
92
- - The window hosts the code-server page directly (iframe); shows status/error info when not running or failed to start;
93
- - code-server's workspace **follows the active DSH session/workspace**: switching sessions/workspaces while the overlay is open restarts code-server to the new directory
100
+ ## Legacy DSH (unsupported since 0.2.3)
101
+
102
+ **Behaviour**: when `sidebarRightTabs` / `sidebarRight` cannot be found, the plugin registers a single settings card:
103
+
104
+ > **Code Server** this DSH version is unsupported (no right-sidebar service)
105
+ > Since 0.2.3 this plugin no longer supports older DSH versions.
106
+ > The right-sidebar plugin services `sidebarRightTabs` / `sidebarRight` were not detected, so the plugin exposes no
107
+ > entry point at all (the old floating ball and floating window have been removed) and will not start the IDE in the
108
+ > background. Upgrade DSH to a version with the right sidebar (>= 0.1.5-alpha.1): Code Server then appears as a
109
+ > right-sidebar tab, this page shows the full settings again, and no reinstall is needed — a page refresh is enough.
110
+
111
+ - **No other UI**: no `shell.overlay` registration (floating ball), no artifact buttons, no resident preload.
112
+ - **Host side**: the client posts `/api/code-server/ui-mode { sidebar:false }`; the host then ① stops auto-prestarting
113
+ the IDE (`maybePrestart` returns immediately) and ② **recycles** an instance it had just auto-prestarted (unless it
114
+ was adopted), so no unusable IDE process or port is left behind. A user-started/adopted instance is never stopped.
115
+ - **Why delete instead of keeping**: the internal floating window was a stopgap from the era of early-2026 DSH builds
116
+ without right-sidebar services. The resident surface, clipboard handling, shortcuts and panel collapsing all build on
117
+ DSH's right sidebar, so maintaining two carriers costs more than it is worth. Older-DSH users should stay on `0.2.2`
118
+ (`dsh plugin --profile web add dsh-code-server-app@0.2.2`).
119
+
120
+ ## code-server workspace and process lifecycle
121
+
122
+ - code-server's workspace **follows the active DSH session/workspace**: switching sessions/workspaces while the IDE is open restarts code-server to the new directory
94
123
  (resolution order: current session cwd → session's workspace.path → recentWorkspace.path → first workspace.path);
95
124
  the opened directory is shown inside code-server (`?folder=<cwd>`, the page reloads when following a switch);
96
125
  implementation note: the iframe `src` must carry `?folder=<cwd>` — code-server's front-end remembers the "last workspace" and restores it by itself;
@@ -108,7 +137,6 @@ state preserved (no full reload). Full evidence and probe scripts: `docs/analysi
108
137
  > placed offline at activation → VS Code internal deps installed → started → healthz 200 →
109
138
  > cwd switch restart while running → stopped → fully recycled.
110
139
 
111
- ## Floating ball / window (legacy-DSH fallback path only)
112
140
  ## Packaging (how to build the tarball)
113
141
 
114
142
  ```powershell
@@ -305,11 +333,12 @@ persisted via the official settings domain (`settingsScope`, namespace `code-ser
305
333
 
306
334
  | Key | Default | Description |
307
335
  |---|---|---|
308
- | `reserveComposer` | `true` | Whether the window **reserves space above the composer**: on, the window's initial/drag/resize/maximize stop above the composer (never covers it); off, it may cover the composer (maximize to viewport bottom). **Applies to the legacy floating window only** hidden in sidebar mode |
309
- | `windowedOpen` | `false` | **Open in a window**: on, every entry point (artifact button / settings card / floating ball) opens code-server in a browser **new tab** (auto-starts and follows the active workspace); off (default) uses the right-sidebar tab (or the internal floating window on older DSH) |
336
+ | `windowedOpen` | `false` | **Open in a window**: on, every entry point (artifact button / settings card) opens code-server in a browser **new tab** (auto-starts and follows the active workspace); off (default) uses the right-sidebar tab |
337
+ | `keepResident` | `true` | **Resident in background**: on, the host preloads the IDE into a parked surface right after start switching tabs or collapsing the sidebar never reloads it and the first open needs no cold start; off loads it only when the panel is opened (saves memory) |
338
+ | ~~`reserveComposer`~~ | `true` | **Deprecated in 0.2.3**: it only ever affected the deleted internal floating window. An old value in the settings document is still accepted but ignored (the key is kept so old settings documents keep validating) |
310
339
 
311
- > Card changes take effect immediately via `scope.watch` (the host status API returns `reserveComposer` and
312
- > `windowedOpen`; the client applies them at once); no dsh restart needed. **After adding new setting keys, restart dsh web before first use**,
340
+ > Card changes take effect immediately via `scope.watch` (the host status API returns `windowedOpen` and
341
+ > `keepResident`; the client applies them at once); no dsh restart needed. **After adding new setting keys, restart dsh web before first use**,
313
342
  > so the host re-registers the settings namespace (schema includes the new key); otherwise save/validation of the new key won't work.
314
343
 
315
344
  The bottom of the card is **Environment check** (click "Check environment" to read the host `status.env`): entry,
@@ -365,14 +394,16 @@ Host/Origin fence and browser auth); in the desktop profile `apps/desktop-host`
365
394
  and the plugin still works: `/api/*` requests travel Electron `dsh-app://` protocol handler → IPC framed pipe → `createSharedFetchHandler('/api')`.
366
395
  - The right-sidebar tab, guide entry box, artifact button, and settings card behave the same as in web (code-server remains an
367
396
  iframe to the local `http://127.0.0.1:<port>`; the desktop renderer uses `webSecurity: true` with no CSP, so the cross-origin iframe loads).
397
+ The desktop build ships `dsh-client-ui-sidebar-right` in its seed package set as well, so the 0.2.3 "right-sidebar DSH only" rule is
398
+ not a regression for desktop; the only difference is the missing `webServer`, where `serve: dsh` falls back to loopback.
368
399
  - Install into the desktop profile with `dsh plugin --profile desktop add dsh-code-server-app@<version>` (or the desktop plugin manager).
369
400
 
370
401
  ## Artifact open buttons
371
402
 
372
403
  Each produced file (written/edited) in a turn is shown as a chip with a **code-server icon button** next to it
373
- in the conversation's turn tail; clicking either opens the file in code-server — in the right-sidebar tab on
374
- DSH >= 0.1.5-alpha.1 (opening/expanding the column and focusing the tab), or in the floating window on older hosts
375
- (when `windowedOpen` is on, both open a browser tab instead).
404
+ in the conversation's turn tail; clicking either opens the file in code-server — in the right-sidebar tab
405
+ (opening/expanding the column and focusing the tab). When `windowedOpen` is on, both open a browser tab instead;
406
+ if the sidebar cannot be opened (no mounted seat), they also fall back to a browser tab.
376
407
  The `dshcs-open-file` extension is installed as a **built-in** extension of code-server (in `lib/vscode/extensions`),
377
408
  so users cannot remove it from the extensions panel.
378
409
 
@@ -388,8 +419,11 @@ so users cannot remove it from the extensions panel.
388
419
  works). Use `serve: loopback` when you need it.
389
420
  - **`serve: dsh` shares DSH's origin**, so the iframe is not sandboxed there (same-origin plus `allow-same-origin` is
390
421
  escapable by the frame itself); in `loopback` mode the iframe is cross-origin and `sandbox` stays as real protection.
391
- - **Single instance across sessions**: one shared IDE per host; switching cwd requires a restart (the sidebar tab /
392
- floating window handles it and hints).
422
+ - **Single instance across sessions**: one shared IDE per host; switching cwd requires a restart (the sidebar tab
423
+ handles it and hints).
424
+ - **Older DSH versions are unsupported (since 0.2.3)**: on a DSH without `sidebarRightTabs` / `sidebarRight` the plugin
425
+ offers nothing but an upgrade notice on the settings page; older-DSH users should stay on `0.2.2`
426
+ (`dsh plugin --profile web add dsh-code-server-app@0.2.2`).
393
427
  - **Sidebar tab switching** (no longer reloads since 0.2.2): DSH's right sidebar renders only the active tab's body, and
394
428
  a React unmount moves the iframe away; the plugin keeps it as a singleton resident surface and shuttles it between the
395
429
  dock slot and a document-level park container with `Element.moveBefore()` (a state-preserving atomic move), so
package/README.md CHANGED
@@ -22,20 +22,32 @@
22
22
  > 全部不再随包分发**(减少 ~34.5MB + 一条原生构建链);IDE 提供方式见下方「服务方式(serve)」。
23
23
  > 依据与实测证据见 `docs/analysis-code-server-as-dsh-plugin.md`(含子路径挂载、WS 路径、命名管道、fence 的逐项验证)。
24
24
 
25
- ## UI 载体(DSH 版本决定,运行时特性检测)
25
+ ## UI 载体与 DSH 版本要求(0.2.3 起只支持带右侧栏的 DSH)
26
26
 
27
27
  | DSH 版本 | 载体 | 入口 |
28
28
  |---|---|---|
29
- | **≥ 0.1.5-alpha.1**(有 `sidebarRight` / `sidebarRightTabs` 服务) | **右侧栏标签**(kind=`code-server`,标签名 `Code Server`),**不再使用悬浮窗** | ① 右侧栏「开始」页的 **Code Server 入口框**;② 每轮产物旁的图标按钮;③ 设置 → 插件 → Code Server → **「在右侧栏打开」** |
30
- | 更早(无右侧栏服务) | 悬浮球 + 内部浮动窗口(与旧版一致) | 右下角悬浮球 |
31
-
32
- - 检测方式:`ctx.inject(['sidebarRightTabs','sidebarRight'], …)`——服务就绪才注册标签类型;
33
- 服务缺失/注册失败则整段不生效,自动回退悬浮球(不按版本号硬判,也不影响插件激活)
29
+ | **≥ 0.1.5-alpha.1**(有 `sidebarRight` / `sidebarRightTabs` 服务) | **右侧栏标签**(kind=`code-server`,标签名 `Code Server`) | ① 右侧栏「开始」页的 **Code Server 入口框**;② 每轮产物旁的图标按钮;③ 设置 → 插件 → Code Server → **「在右侧栏打开」** |
30
+ | 更早(无右侧栏服务) | **不受支持**:除设置页的一条提示外**不提供任何入口** | (设置 插件 → Code Server 显示升级提示) |
31
+
32
+ - 检测方式:先 `ctx.get('sidebarRightTabs') / ctx.get('sidebarRight')` 同步探测;
33
+ 服务可能晚于本插件就绪,则 `ctx.inject(['sidebarRightTabs','sidebarRight'], …)` 等待,
34
+ **2.5 s 内仍未就绪即判定旧版 DSH**(不按版本号硬判,也不影响插件激活)。
35
+ 0.2.4 起判定**可逆**、且注册不再依赖 `ctx` 属性访问(desktop 上曾因此静默不注册、表现为"设置卡正常但侧栏没有入口"):
36
+ - 服务查找先读 `ctx.<name>`,再回退 `ctx.get(name)`——两种上下文形态都能注册;
37
+ - 同步已能看到服务、但 `inject` 迟迟不回调时,**1.5 s 后用同步服务兜底注册**;
38
+ - 2.5 s 只给设置页提示,**10 s** 仍无服务才通知 host 回收/停止预启动(避免误杀慢启动的宿主);
39
+ - 服务晚到 → 自动撤销旧版判定、补注册侧栏,并上报 `{sidebar:true}` 让 host 恢复;
40
+ - 注册失败不再静默:控制台报错,设置卡入口行显示"已探测到右侧栏服务,但标签注册失败"。
41
+ - **0.2.3 起不再兼容旧版 DSH**:悬浮球与内部浮动窗口回退**已删除**。判定为旧版时:
42
+ - 只注册设置卡片,内容是一条升级提示(见下),不注册悬浮球/浮窗/产物按钮,也不预热 IDE;
43
+ - 客户端向 host 上报 `/api/code-server/ui-mode { sidebar:false }`(在上面的 10 s 宽限之后),host 据此**回收自动预启动的实例**
44
+ 并停止预启动(用户手动启动的实例不受影响);服务随后才出现时会再上报 `{sidebar:true}` 撤销;
45
+ - 升级 DSH 后**无需重装插件**,刷新页面即可,本页会恢复为完整设置卡片。
34
46
  - 侧栏标签内即 code-server 页面(iframe),跟随当前会话工作区;面板可折叠/分屏/浮动/全屏(由 DSH 右侧栏提供)。
35
47
  - **IDE 常驻(0.2.2 起,默认开)**:切到别的标签/收起侧栏再回来**不再重载** code-server——
36
48
  未保存的编辑缓冲区、终端、调试会话都留在原处(见下方「为什么切标签不再重载」)。
37
- - 设置卡片在侧栏模式下隐藏「保留输入框上方空间」(只对浮窗有意义);
38
- 「窗口化打开(新标签页)」仍然生效(开启后各入口改为浏览器新标签页打开)。
49
+ - 设置卡片只剩两行:「窗口化打开(新标签页)」与「后台常驻(切标签不重载)」。
50
+ `reserveComposer`(保留输入框上方空间)只对已删除的浮窗有意义,0.2.3 起**废弃**:设置文件里的旧值仍被接受但被忽略。
39
51
  - `windowedOpen` 优先级最高:开启时入口按钮一律新开浏览器标签页。
40
52
 
41
53
  ## 为什么切标签不再重载(IDE 常驻)
@@ -58,10 +70,12 @@
58
70
  - **降级不静默**:`moveBefore` 缺失、或宿主已被 React 摘除而抛 `HierarchyRequestError: invalid hierarchy`
59
71
  (passive effect cleanup 晚于 DOM 卸载)时,退回 `appendChild`——会重载一次,但**绝不丢帧**;
60
72
  状态里 `degraded`/`lastMoveError` 明示,界面据此提示"常驻不可用"。
61
- - **重绘修复(实测坑)**:跨源 iframe 离屏停放较久后被移回,元素尺寸、命中测试、`visibility` 全部正常,
62
- 但**画面不再重绘**(面板一片白,多切几次标签也不恢复)。`translateZ(0)`、`opacity` 微调都无效;
63
- `display:none → 强制重排 → 还原`(同一个 JS 任务内)可唤醒,且 iframe 文档不重载、内部状态不变、无可见闪烁。
64
- 因此每次「停放 停靠」都补一次 `nudgeRepaint()`(`surfaceSnapshot().nudgeCount` 计数,便于排障)
73
+ - **重绘兜底(实测坑)**:真实 GUI 里观测到一次"元素在、画面不重绘"——iframe 尺寸、命中测试、`visibility`
74
+ 全部正常,面板却一片白(连续两张截图哈希相同,确认没有新帧);`translateZ(0)`、`opacity` 微调无效,
75
+ `display:none → 强制重排 → 还原`(同一个 JS 任务内)可恢复,且 iframe 文档不重载、内部状态不变、无可见闪烁。
76
+ **触发条件未能复现**:探针页里 `moveBefore` 停放 337 s(超过 Chrome 对不可见跨源 iframe 的 ~5 min 节流窗口)
77
+ 后移回、且关掉修复,仍正常绘制。因此把它当**兜底**保留:每次「停放 → 停靠」补一次
78
+ `nudgeRepaint()`(`surfaceSnapshot().nudgeCount` 计数,`setNudgeEnabled(false)` 可现场 A/B)。
65
79
  - **后台预热**:配置 `keepResident`(默认 `true`)时,宿主在插件启动后就把面建好并停在停放区,
66
80
  首次点开标签无需冷启动等待;`preload` 不会把正在使用的面拽走。
67
81
  - **排障句柄**:控制台可用 `window.__dshcsSurface`(`snapshot()` / `setParkStrategy('offscreen'|'behind')` /
@@ -90,16 +104,27 @@
90
104
  (含 `Forwarded: host=` / `X-Forwarded-Host` 的反代语义),否则回 `403`;缺 `Origin` 的非浏览器请求放行。
91
105
  没有这道检查时,本机任意浏览器页面都能对 `ws://127.0.0.1:<port>/stable-<commit>` 完成握手并驱动 IDE。
92
106
 
93
- ## 悬浮球 / 浮窗(仅旧版 DSH 回退路径)
107
+ ## 旧版 DSH(0.2.3 起不再支持)
108
+
109
+ **行为**:探测不到 `sidebarRightTabs` / `sidebarRight` 时,插件只注册一张设置卡片,内容是:
110
+
111
+ > **Code Server** — 当前 DSH 版本不受支持(缺少右侧栏服务)
112
+ > 本插件自 0.2.3 起不再兼容旧版 DSH。
113
+ > 未检测到右侧栏插件服务 sidebarRightTabs / sidebarRight,因此插件不提供任何入口(旧版的悬浮球与浮动窗口已移除),
114
+ > 也不会后台启动 IDE。升级 DSH 到带右侧栏的版本(≥ 0.1.5-alpha.1)后,Code Server 会出现在右侧栏标签里,
115
+ > 本页同时显示完整设置项;升级后无需重装本插件,刷新页面即可。
116
+
117
+ - **没有任何其他 UI**:不注册 `shell.overlay`(悬浮球)、不注册产物按钮、不做常驻预热。
118
+ - **host 侧**:客户端会 `POST /api/code-server/ui-mode { sidebar:false }`;host 收到后
119
+ ① 不再自动预启动 IDE(`maybePrestart` 直接返回),② 若 IDE 是本插件刚自动预启动且尚未被 adopt,则**回收**该进程,
120
+ 避免留下一个用不上的 IDE 与端口。用户手动启动的实例(`adopted`)不会被停。
121
+ - **为什么删除而不是保留**:内部浮动窗口是 2026 年早期 DSH(无右侧栏服务)时代的临时载体,
122
+ 常驻面、剪贴板、快捷键、面板折叠等能力都建立在 DSH 右侧栏之上;维护两套载体的成本高于其残余价值。
123
+ 旧版用户继续用 `0.2.2` 即可(`dsh plugin --profile web add dsh-code-server-app@0.2.2`)。
124
+ - **回滚**:任何版本都能降级到旧版实现,例如 `dsh plugin --profile web add dsh-code-server-app@0.2.2`。
125
+
126
+ ## code-server 服务目录与进程生命周期
94
127
 
95
- - **右下角悬浮球**(code-server 官方图标,输入框上方):点击**展开浮窗并亮起**(蓝色光环),再点击**收起并复原**;
96
- **可按住拖动到任意位置**(松手后记忆,刷新不丢;拖完不会误触发点击);
97
- 无侧栏按钮、无窗口控制按钮组(球是唯一入口/开关);球上带运行状态点(绿=运行 / 黄=启动中 / 红=错误);
98
- - 窗口为**内部浮动窗口**(参照 dsh-univer-office 的 WorktreeWindow 模式):固定定位浮窗 + 空转根容器,窗口接管指针事件,
99
- **无标题栏无按钮**——顶部细条拖动(悬停有淡色提示;**拖到窗口顶部松开 = 最大化**,
100
- **最大化后按住顶部细条向下拖 = 恢复**并继续跟手拖动)、双击最大化、8 向缩放、Esc 关闭(与球收起等效),
101
- 初始位置在输入框上方靠右,最大化与缩放都止于输入栏上方,不遮挡 composer;
102
- - 窗口内直接是 code-server 页面(iframe);未运行/启动失败时显示状态说明与错误信息;
103
128
  - code-server 服务目录**跟随活动工作区/会话**:打开期间切换 DSH 会话/工作区,code-server 自动重启到新目录
104
129
  (解析优先级:当前会话 cwd → 会话所属 workspace.path → recentWorkspace.path → 首个 workspace.path);
105
130
  打开目录显示在 code-server 页面内(`?folder=<cwd>`,跟随切换时页面自动重新加载);
@@ -320,15 +345,16 @@ host 探测顺序:`@jinsiyu/dshcs-vscode-server/vscode`(**0.2.0+ 正式布局**)
320
345
 
321
346
  | 键 | 默认 | 说明 |
322
347
  |---|---|---|
323
- | `reserveComposer` | `true` | 窗口是否**保留输入框上方空间**:开启时窗口初始/拖动/缩放/最大化都止于输入栏上方(不遮挡 composer);关闭后允许盖住输入框(最大化到视口底)。**仅对旧版 DSH 的浮窗生效**——右侧栏模式下该行隐藏 |
324
- | `windowedOpen` | `false` | **窗口化打开**:开启后各入口(产物按钮 / 设置卡 / 悬浮球)在浏览器**新标签页**打开 code-server(自动启动并跟随当前工作区目录);关闭(默认)使用右侧栏标签(旧版 DSH 为内部浮动窗口) |
348
+ | `windowedOpen` | `false` | **窗口化打开**:开启后各入口(产物按钮 / 设置卡)在浏览器**新标签页**打开 code-server(自动启动并跟随当前工作区目录);关闭(默认)使用右侧栏标签 |
349
+ | `keepResident` | `true` | **后台常驻**:开启后宿主启动即把 IDE 预加载到"停放区",切标签/收起侧栏不重载、首次打开免等待;关闭则只在打开面板时加载(省内存) |
350
+ | ~~`reserveComposer`~~ | `true` | **0.2.3 起废弃**:只对已删除的内部浮动窗口有意义。设置文件里的旧值仍被接受但被忽略(键保留,避免旧设置文档校验失败) |
325
351
 
326
352
  卡片底部是**环境检测**(点「检测环境」读取 host `status.env`):
327
353
  树版本 / `productPath` / server 入口、VS Code 内部依赖、**预编译原生包**(平台聚合包名 + 已解析模块数)。
328
354
  0.1.36 起没有「安装环境」按钮 —— 依赖由包管理器安装,卡片里只显示结果。
329
355
 
330
- > 卡片改动经 `scope.watch` 实时生效(host 端 status API 同步返回 `reserveComposer` 与
331
- > `windowedOpen`,客户端立即生效);无需重启 dsh。**新增设置键后首次使用前需重启 dsh web**,
356
+ > 卡片改动经 `scope.watch` 实时生效(host 端 status API 同步返回 `windowedOpen` 与
357
+ > `keepResident`,客户端立即生效);无需重启 dsh。**新增设置键后首次使用前需重启 dsh web**,
332
358
  > 让 host 重新注册设置命名空间(schema 含新键),否则新键的保存与校验不生效。
333
359
 
334
360
  ## 配置(cordis.patch.yml 的 `config`,均有默认值)
@@ -378,6 +404,8 @@ desktop profile 由 `apps/desktop-host` 把 `/api/*` 交给同一个 `createShar
378
404
  本插件照常工作;`/api/*` 请求由 Electron `dsh-app://` 协议处理器 → IPC 帧管道 → `createSharedFetchHandler('/api')`。
379
405
  - 右侧栏标签、guide 入口框、产物按钮、设置卡片在 desktop 下与 web 相同(code-server 仍是本机 `http://127.0.0.1:<port>` 的 iframe;
380
406
  桌面端 `webSecurity: true` 且页面无 CSP 限制,跨源 iframe 正常加载)。
407
+ 桌面端同样自带 `dsh-client-ui-sidebar-right`(见 desktop 构建 seed 包列表),因此 0.2.3 的
408
+ "只支持带右侧栏的 DSH" 对 desktop 不构成降级;唯一差别是 desktop 无 `webServer`,`serve: dsh` 会自动回退 loopback。
381
409
  - 安装到 desktop profile:`dsh plugin --profile desktop add dsh-code-server-app@<版本>`(或桌面端插件管理窗)。
382
410
 
383
411
  ## 已知限制
@@ -391,7 +419,9 @@ desktop profile 由 `apps/desktop-host` 把 `/api/*` 交给同一个 `createShar
391
419
  → 该模式下 Ports 面板的 **WebSocket** 转发不可用(HTTP 转发正常);需要时用 `serve: loopback`。
392
420
  - **`serve: dsh` 的 iframe 与 DSH 同源** → 该模式不挂 `sandbox`(同源 + `allow-same-origin` 可被 frame 自行摘除);
393
421
  `loopback` 模式跨源,`sandbox` 作为真防护保留。
394
- - **跨会话单实例**:host 级共享一份 IDE;切换 cwd 需重启实例(右侧栏标签/浮窗自动处理并提示)。
422
+ - **跨会话单实例**:host 级共享一份 IDE;切换 cwd 需重启实例(右侧栏标签自动处理并提示)。
423
+ - **旧版 DSH 不受支持(0.2.3 起)**:没有 `sidebarRightTabs`/`sidebarRight` 的 DSH 上,除设置页一条升级提示外无任何入口;
424
+ 旧版用户请留在 `0.2.2`(`dsh plugin --profile web add dsh-code-server-app@0.2.2`)。
395
425
  - **侧栏标签切换**(0.2.2 起不再重载):DSH 右侧栏只渲染当前激活标签的 body,React 卸载会移走 iframe;
396
426
  插件把 iframe 收成单例常驻面,用 `Element.moveBefore()`(状态保持型原子移动)在停靠位与文档级停放区之间搬,
397
427
  切标签/收起侧栏再回来**不重载**。不支持 `moveBefore` 的浏览器退回旧行为(`appendChild` → 整页重载),
package/cordis.patch.yml CHANGED
@@ -30,6 +30,8 @@
30
30
  locale: ''
31
31
  # 启动就绪探测超时(ms)。
32
32
  readyTimeoutMs: 60000
33
- # 注:窗口行为(是否保留输入框上方空间)由"设置 → 插件 → Code Server"
34
- # 卡片控制,持久化于官方 settings 域(命名空间 code-server,键 reserveComposer,
35
- # 默认 true);此处不需配置,卡片修改即时生效。
33
+ # 注:窗口化打开(新标签页)与后台常驻(切标签不重载)由"设置 → 插件 → Code Server"
34
+ # 卡片控制,持久化于官方 settings 域(命名空间 code-server,键 windowedOpen / keepResident,
35
+ # 默认 false / true);此处不需配置,卡片修改即时生效。
36
+ # 另:0.2.3 起不再兼容旧版 DSH(无 sidebarRightTabs/sidebarRight 服务的版本),
37
+ # 旧版上只在设置页给一条升级提示,不提供任何入口,也不预启动 IDE。
package/lib/client.js CHANGED
@@ -1,4 +1,5 @@
1
1
  window.__ModuleLoader__.load({id:'dsh-code-server-app',factory:function(require){var module={exports:{}};var exports=module.exports;
2
- var Pi=Object.defineProperty;var jc=Object.getOwnPropertyDescriptor;var zc=Object.getOwnPropertyNames;var Gc=Object.prototype.hasOwnProperty;var Wc=(e,t)=>{for(var r in t)Pi(e,r,{get:t[r],enumerable:!0})},Uc=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of zc(t))!Gc.call(e,i)&&i!==r&&Pi(e,i,{get:()=>t[i],enumerable:!(n=jc(t,i))||n.enumerable});return e};var Hc=e=>Uc(Pi({},"__esModule",{value:!0}),e);var pd={};Wc(pd,{apply:()=>ud,inject:()=>md,name:()=>dd});module.exports=Hc(pd);var cs=require("react"),Yr=(0,cs.createContext)({});var us=require("react");function fs(e){let t=(0,us.useRef)(null);return t.current===null&&(t.current=e()),t.current}var $r=require("react");var ms=typeof window!="undefined";var ds=ms?$r.useLayoutEffect:$r.useEffect;var ps=require("react"),Tt=(0,ps.createContext)(null);function nt(e,t){e.indexOf(t)===-1&&e.push(t)}function Ge(e,t){let r=e.indexOf(t);r>-1&&e.splice(r,1)}var Z=(e,t,r)=>r>t?t:r<e?e:r;var Re=()=>{},ae=()=>{};var ie={};var Xt=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e);var qt=e=>typeof e=="object"&&e!==null;var Zt=e=>/^0[^.\s]+$/u.test(e);function Jt(e){let t;return()=>(t===void 0&&(t=e()),t)}var G=e=>e;var be=(...e)=>e.reduce((t,r)=>n=>r(t(n)));var Se=(e,t,r)=>{let n=t-e;return n?(r-e)/n:1};var Le=class{constructor(){this.subscriptions=[]}add(t){return nt(this.subscriptions,t),()=>Ge(this.subscriptions,t)}notify(t,r,n){let i=this.subscriptions.length;if(i)if(i===1)this.subscriptions[0](t,r,n);else for(let s=0;s<i;s++){let o=this.subscriptions[s];o&&o(t,r,n)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}};var _=e=>e*1e3,ee=e=>e/1e3;var Qt=(e,t)=>t?e*(1e3/t):0;var hs=(e,t,r)=>(((1-3*r+3*t)*e+(3*r-6*t))*e+3*t)*e,Kc=1e-7,_c=12;function Yc(e,t,r,n,i){let s,o,a=0;do o=t+(r-t)/2,s=hs(o,n,i)-e,s>0?r=o:t=o;while(Math.abs(s)>Kc&&++a<_c);return o}function We(e,t,r,n){if(e===t&&r===n)return G;let i=s=>Yc(s,0,1,e,r);return s=>s===0||s===1?s:hs(i(s),t,n)}var Xr=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2;var qr=e=>t=>1-e(1-t);var Zr=We(.33,1.53,.69,.99),St=qr(Zr),er=Xr(St);var tr=e=>e>=1?1:(e*=2)<1?.5*St(e):.5*(2-Math.pow(2,-10*(e-1)));var rr=e=>1-Math.sin(Math.acos(e)),nr=qr(rr),ir=Xr(rr);var Ei=We(.42,0,1,1),Mi=We(0,0,.58,1),or=We(.42,0,.58,1);var Ai=e=>Array.isArray(e)&&typeof e[0]!="number";var sr=e=>Array.isArray(e)&&typeof e[0]=="number";var gs={linear:G,easeIn:Ei,easeInOut:or,easeOut:Mi,circIn:rr,circInOut:ir,circOut:nr,backIn:St,backInOut:er,backOut:Zr,anticipate:tr},$c=e=>typeof e=="string",Jr=e=>{if(sr(e)){ae(e.length===4,"Cubic bezier arrays must contain four numerical values.","cubic-bezier-length");let[t,r,n,i]=e;return We(t,r,n,i)}else if($c(e))return ae(gs[e]!==void 0,`Invalid easing type '${e}'`,"invalid-easing-type"),gs[e];return e};var ar=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function xs(e){let t=new Set,r=new Set,n=!1,i=!1,s=new WeakSet,o={delta:0,timestamp:0,isProcessing:!1};function a(c){s.has(c)&&(u.schedule(c),e()),c(o)}let u={schedule:(c,l=!1,f=!1)=>{let d=f&&n?t:r;return l&&s.add(c),d.add(c),c},cancel:c=>{r.delete(c),s.delete(c)},process:c=>{if(o=c,n){i=!0;return}n=!0;let l=t;t=r,r=l,t.forEach(a),t.clear(),n=!1,i&&(i=!1,u.process(c))}};return u}var Xc=40;function Qr(e,t){let r=!1,n=!0,i={delta:0,timestamp:0,isProcessing:!1},s=()=>r=!0,o=ar.reduce((w,v)=>(w[v]=xs(s),w),{}),{setup:a,read:u,resolveKeyframes:c,preUpdate:l,update:f,preRender:m,render:d,postRender:h}=o,g=()=>{let w=ie.useManualTiming,v=w?i.timestamp:performance.now();r=!1,w||(i.delta=n?1e3/60:Math.max(Math.min(v-i.timestamp,Xc),1)),i.timestamp=v,i.isProcessing=!0,a.process(i),u.process(i),c.process(i),l.process(i),f.process(i),m.process(i),d.process(i),h.process(i),i.isProcessing=!1,r&&t&&(n=!1,e(g))},x=()=>{r=!0,n=!0,i.isProcessing||e(g)};return{schedule:ar.reduce((w,v)=>{let C=o[v];return w[v]=(D,V=!1,P=!1)=>(r||x(),C.schedule(D,V,P)),w},{}),cancel:w=>{for(let v=0;v<ar.length;v++)o[ar[v]].cancel(w)},state:i,steps:o}}var{schedule:M,cancel:le,state:K,steps:lr}=Qr(typeof requestAnimationFrame!="undefined"?requestAnimationFrame:G,!0);var en;function qc(){en=void 0}var W={now:()=>(en===void 0&&W.set(K.isProcessing||ie.useManualTiming?K.timestamp:performance.now()),en),set:e=>{en=e,queueMicrotask(qc)}};var ys=e=>t=>typeof t=="string"&&t.startsWith(e),tn=ys("--"),Zc=ys("var(--"),Ct=e=>Zc(e)?Jc.test(e.split("/*")[0].trim()):!1,Jc=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function Di(e){return typeof e!="string"?!1:e.split("/*")[0].includes("var(--")}var Ce={test:e=>typeof e=="number",parse:parseFloat,transform:e=>e},Ie={...Ce,transform:e=>Z(0,1,e)},cr={...Ce,default:1};var Ue=e=>Math.round(e*1e5)/1e5;var Vt=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function vs(e){return e==null}var bs=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu;var Pt=(e,t)=>r=>!!(typeof r=="string"&&bs.test(r)&&r.startsWith(e)||t&&!vs(r)&&Object.prototype.hasOwnProperty.call(r,t)),rn=(e,t,r)=>n=>{if(typeof n!="string")return n;let[i,s,o,a]=n.match(Vt);return{[e]:parseFloat(i),[t]:parseFloat(s),[r]:parseFloat(o),alpha:a!==void 0?parseFloat(a):1}};var Qc=e=>Z(0,255,e),ki={...Ce,transform:e=>Math.round(Qc(e))},Ve={test:Pt("rgb","red"),parse:rn("red","green","blue"),transform:({red:e,green:t,blue:r,alpha:n=1})=>"rgba("+ki.transform(e)+", "+ki.transform(t)+", "+ki.transform(r)+", "+Ue(Ie.transform(n))+")"};function eu(e){let t="",r="",n="",i="";return e.length>5?(t=e.substring(1,3),r=e.substring(3,5),n=e.substring(5,7),i=e.substring(7,9)):(t=e.substring(1,2),r=e.substring(2,3),n=e.substring(3,4),i=e.substring(4,5),t+=t,r+=r,n+=n,i+=i),{red:parseInt(t,16),green:parseInt(r,16),blue:parseInt(n,16),alpha:i?parseInt(i,16)/255:1}}var ur={test:Pt("#"),parse:eu,transform:Ve.transform};var fr=e=>({test:t=>typeof t=="string"&&t.endsWith(e)&&t.split(" ").length===1,parse:parseFloat,transform:t=>`${t}${e}`}),he=fr("deg"),ne=fr("%"),S=fr("px"),Ri=fr("vh"),Li=fr("vw"),nn={...ne,parse:e=>ne.parse(e)/100,transform:e=>ne.transform(e*100)};var He={test:Pt("hsl","hue"),parse:rn("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:r,alpha:n=1})=>"hsla("+Math.round(e)+", "+ne.transform(Ue(t))+", "+ne.transform(Ue(r))+", "+Ue(Ie.transform(n))+")"};var B={test:e=>Ve.test(e)||ur.test(e)||He.test(e),parse:e=>Ve.test(e)?Ve.parse(e):He.test(e)?He.parse(e):ur.parse(e),transform:e=>typeof e=="string"?e:e.hasOwnProperty("red")?Ve.transform(e):He.transform(e),getAnimatableNone:e=>{let t=B.parse(e);return t.alpha=0,B.transform(t)}};var ws=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function tu(e){var t,r;return isNaN(e)&&typeof e=="string"&&(((t=e.match(Vt))==null?void 0:t.length)||0)+(((r=e.match(ws))==null?void 0:r.length)||0)>0}var Ss="number",Cs="color",ru="var",nu="var(",Ts="${}",iu=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function Ke(e){let t=e.toString(),r=[],n={color:[],number:[],var:[]},i=[],s=0,a=t.replace(iu,u=>(B.test(u)?(n.color.push(s),i.push(Cs),r.push(B.parse(u))):u.startsWith(nu)?(n.var.push(s),i.push(ru),r.push(u)):(n.number.push(s),i.push(Ss),r.push(parseFloat(u))),++s,Ts)).split(Ts);return{values:r,split:a,indexes:n,types:i}}function ou(e){return Ke(e).values}function Vs({split:e,types:t}){let r=e.length;return n=>{let i="";for(let s=0;s<r;s++)if(i+=e[s],n[s]!==void 0){let o=t[s];o===Ss?i+=Ue(n[s]):o===Cs?i+=B.transform(n[s]):i+=n[s]}return i}}function su(e){return Vs(Ke(e))}var au=e=>typeof e=="number"?0:B.test(e)?B.getAnimatableNone(e):e,lu=(e,t)=>typeof e=="number"?t!=null&&t.trim().endsWith("/")?e:0:au(e);function cu(e){let t=Ke(e);return Vs(t)(t.values.map((n,i)=>lu(n,t.split[i])))}var J={test:tu,parse:ou,createTransformer:su,getAnimatableNone:cu};function Ii(e,t,r){return r<0&&(r+=1),r>1&&(r-=1),r<1/6?e+(t-e)*6*r:r<1/2?t:r<2/3?e+(t-e)*(2/3-r)*6:e}function Ps({hue:e,saturation:t,lightness:r,alpha:n}){e/=360,t/=100,r/=100;let i=0,s=0,o=0;if(!t)i=s=o=r;else{let a=r<.5?r*(1+t):r+t-r*t,u=2*r-a;i=Ii(u,a,e+1/3),s=Ii(u,a,e),o=Ii(u,a,e-1/3)}return{red:Math.round(i*255),green:Math.round(s*255),blue:Math.round(o*255),alpha:n}}function Et(e,t){return r=>r>0?t:e}var A=(e,t,r)=>e+(t-e)*r;var Ni=(e,t,r)=>{let n=e*e,i=r*(t*t-n)+n;return i<0?0:Math.sqrt(i)},uu=[ur,Ve,He],fu=e=>uu.find(t=>t.test(e));function Es(e){let t=fu(e);if(Re(!!t,`'${e}' is not an animatable color. Use the equivalent color code instead.`,"color-not-animatable"),!t)return!1;let r=t.parse(e);return t===He&&(r=Ps(r)),r}var Oi=(e,t)=>{let r=Es(e),n=Es(t);if(!r||!n)return Et(e,t);let i={...r};return s=>(i.red=Ni(r.red,n.red,s),i.green=Ni(r.green,n.green,s),i.blue=Ni(r.blue,n.blue,s),i.alpha=A(r.alpha,n.alpha,s),Ve.transform(i))};var on=new Set(["none","hidden"]);function Ms(e,t){return on.has(e)?r=>r<=0?e:t:r=>r>=1?t:e}function mu(e,t){return r=>A(e,t,r)}function sn(e){return typeof e=="number"?mu:typeof e=="string"?Ct(e)?Et:B.test(e)?Oi:hu:Array.isArray(e)?As:typeof e=="object"?B.test(e)?Oi:du:Et}function As(e,t){let r=[...e],n=r.length,i=e.map((s,o)=>sn(s)(s,t[o]));return s=>{for(let o=0;o<n;o++)r[o]=i[o](s);return r}}function du(e,t){let r={...e,...t},n={};for(let i in r)e[i]!==void 0&&t[i]!==void 0&&(n[i]=sn(e[i])(e[i],t[i]));return i=>{for(let s in n)r[s]=n[s](i);return r}}function pu(e,t){var i;let r=[],n={color:0,var:0,number:0};for(let s=0;s<t.values.length;s++){let o=t.types[s],a=e.indexes[o][n[o]],u=(i=e.values[a])!=null?i:0;r[s]=u,n[o]++}return r}var hu=(e,t)=>{let r=J.createTransformer(t),n=Ke(e),i=Ke(t);return n.indexes.var.length===i.indexes.var.length&&n.indexes.color.length===i.indexes.color.length&&n.indexes.number.length>=i.indexes.number.length?on.has(e)&&!i.values.length||on.has(t)&&!n.values.length?Ms(e,t):be(As(pu(n,i),i.values),r):(Re(!0,`Complex values '${e}' and '${t}' too different to mix. Ensure all colors are of the same type, and that each contains the same quantity of number and color values. Falling back to instant transition.`,"complex-values-different"),Et(e,t))};function an(e,t,r){return typeof e=="number"&&typeof t=="number"&&typeof r=="number"?A(e,t,r):sn(e)(e,t)}var Ds=e=>{let t=({timestamp:r})=>e(r);return{start:(r=!0)=>M.update(t,r),stop:()=>le(t),now:()=>K.isProcessing?K.timestamp:W.now()}};var ln=(e,t,r=10)=>{let n="",i=Math.max(Math.round(t/r),2);for(let s=0;s<i;s++)n+=Math.round(e(s/(i-1))*1e4)/1e4+", ";return`linear(${n.substring(0,n.length-2)})`};function Mt(e){let t=0,r=50,n=e.next(t);for(;!n.done&&t<2e4;)t+=r,n=e.next(t);return t>=2e4?1/0:t}function ks(e,t=100,r){let n=r({...e,keyframes:[0,t]}),i=Math.min(Mt(n),2e4);return{type:"keyframes",ease:s=>n.next(i*s).value/t,duration:ee(i)}}var U={stiffness:100,damping:10,mass:1,velocity:0,duration:800,bounce:.3,visualDuration:.3,restSpeed:{granular:.01,default:2},restDelta:{granular:.005,default:.5},minDuration:.01,maxDuration:10,minDamping:.05,maxDamping:1};function ji(e,t){return e*Math.sqrt(1-t*t)}var gu=12;function xu(e,t,r){let n=r;for(let i=1;i<gu;i++)n=n-e(n)/t(n);return n}var Fi=.001;function yu({duration:e=U.duration,bounce:t=U.bounce,velocity:r=U.velocity,mass:n=U.mass}){let i,s;Re(e<=_(U.maxDuration),"Spring duration must be 10 seconds or less","spring-duration-limit");let o=1-t;o=Z(U.minDamping,U.maxDamping,o),e=Z(U.minDuration,U.maxDuration,ee(e)),o<1?(i=c=>{let l=c*o,f=l*e,m=l-r,d=ji(c,o),h=Math.exp(-f);return Fi-m/d*h},s=c=>{let f=c*o*e,m=f*r+r,d=Math.pow(o,2)*Math.pow(c,2)*e,h=Math.exp(-f),g=ji(Math.pow(c,2),o);return(-i(c)+Fi>0?-1:1)*((m-d)*h)/g}):(i=c=>{let l=Math.exp(-c*e),f=(c-r)*e+1;return-Fi+l*f},s=c=>{let l=Math.exp(-c*e),f=(r-c)*(e*e);return l*f});let a=5/e,u=xu(i,s,a);if(e=_(e),isNaN(u))return{stiffness:U.stiffness,damping:U.damping,duration:e};{let c=Math.pow(u,2)*n;return{stiffness:c,damping:o*2*Math.sqrt(n*c),duration:e}}}var vu=["duration","bounce"],bu=["stiffness","damping","mass"];function Rs(e,t){return t.some(r=>e[r]!==void 0)}function wu(e){let t={velocity:U.velocity,stiffness:U.stiffness,damping:U.damping,mass:U.mass,isResolvedFromDuration:!1,...e};if(!Rs(e,bu)&&Rs(e,vu))if(t.velocity=0,e.visualDuration){let r=e.visualDuration,n=2*Math.PI/(r*1.2),i=n*n,s=2*Z(.05,1,1-(e.bounce||0))*Math.sqrt(i);t={...t,mass:U.mass,stiffness:i,damping:s}}else{let r=yu({...e,velocity:0});t={...t,...r,mass:U.mass},t.isResolvedFromDuration=!0}return t}function At(e=U.visualDuration,t=U.bounce){let r=typeof e!="object"?{visualDuration:e,keyframes:[0,1],bounce:t}:e,{restSpeed:n,restDelta:i}=r,s=r.keyframes[0],o=r.keyframes[r.keyframes.length-1],a={done:!1,value:s},{stiffness:u,damping:c,mass:l,duration:f,velocity:m,isResolvedFromDuration:d}=wu({...r,velocity:-ee(r.velocity||0)}),h=m||0,g=c/(2*Math.sqrt(u*l)),x=o-s,y=ee(Math.sqrt(u/l)),T=Math.abs(x)<5;n||(n=T?U.restSpeed.granular:U.restSpeed.default),i||(i=T?U.restDelta.granular:U.restDelta.default);let w,v,C,D,V,P;if(g<1)C=ji(y,g),D=(h+g*y*x)/C,w=E=>{let O=Math.exp(-g*y*E);return o-O*(D*Math.sin(C*E)+x*Math.cos(C*E))},V=g*y*D+x*C,P=g*y*x-D*C,v=E=>Math.exp(-g*y*E)*(V*Math.sin(C*E)+P*Math.cos(C*E));else if(g===1){w=O=>o-Math.exp(-y*O)*(x+(h+y*x)*O);let E=h+y*x;v=O=>Math.exp(-y*O)*(y*E*O-h)}else{let E=y*Math.sqrt(g*g-1);w=Y=>{let k=Math.exp(-g*y*Y),N=Math.min(E*Y,300);return o-k*((h+g*y*x)*Math.sinh(N)+E*x*Math.cosh(N))/E};let O=(h+g*y*x)/E,I=g*y*O-x*E,de=g*y*x-O*E;v=Y=>{let k=Math.exp(-g*y*Y),N=Math.min(E*Y,300);return k*(I*Math.sinh(N)+de*Math.cosh(N))}}let H={calculatedDuration:d&&f||null,velocity:E=>_(v(E)),next:E=>{if(!d&&g<1){let I=Math.exp(-g*y*E),de=Math.sin(C*E),Y=Math.cos(C*E),k=o-I*(D*de+x*Y),N=_(I*(V*de+P*Y));return a.done=Math.abs(N)<=n&&Math.abs(o-k)<=i,a.value=a.done?o:k,a}let O=w(E);if(d)a.done=E>=f;else{let I=_(v(E));a.done=Math.abs(I)<=n&&Math.abs(o-O)<=i}return a.value=a.done?o:O,a},toString:()=>{let E=Math.min(Mt(H),2e4),O=ln(I=>H.next(E*I).value,E,30);return E+"ms "+O},toTransition:()=>{}};return H}At.applyToOptions=e=>{let t=ks(e,100,At);return e.ease=t.ease,e.duration=_(t.duration),e.type="keyframes",e};var Tu=5;function cn(e,t,r){let n=Math.max(t-Tu,0);return Qt(r-e(n),t-n)}function mr({keyframes:e,velocity:t=0,power:r=.8,timeConstant:n=325,bounceDamping:i=10,bounceStiffness:s=500,modifyTarget:o,min:a,max:u,restDelta:c=.5,restSpeed:l}){let f=e[0],m={done:!1,value:f},d=P=>a!==void 0&&P<a||u!==void 0&&P>u,h=P=>a===void 0?u:u===void 0||Math.abs(a-P)<Math.abs(u-P)?a:u,g=r*t,x=f+g,y=o===void 0?x:o(x);y!==x&&(g=y-f);let T=P=>-g*Math.exp(-P/n),w=P=>y+T(P),v=P=>{let H=T(P),E=w(P);m.done=Math.abs(H)<=c,m.value=m.done?y:E},C,D,V=P=>{d(m.value)&&(C=P,D=At({keyframes:[m.value,h(m.value)],velocity:cn(w,P,m.value),damping:i,stiffness:s,restDelta:c,restSpeed:l}))};return V(0),{calculatedDuration:null,next:P=>{let H=!1;return!D&&C===void 0&&(H=!0,v(P),V(P)),C!==void 0&&P>=C?D.next(P-C):(!H&&v(P),m)}}}function Su(e,t,r){let n=[],i=r||ie.mix||an,s=e.length-1;for(let o=0;o<s;o++){let a=i(e[o],e[o+1]);if(t){let u=Array.isArray(t)?t[o]||G:t;a=be(u,a)}n.push(a)}return n}function Ls(e,t,{clamp:r=!0,ease:n,mixer:i}={}){let s=e.length;if(ae(s===t.length,"Both input and output ranges must be the same length","range-length"),s===1)return()=>t[0];if(s===2&&t[0]===t[1])return()=>t[1];let o=e[0]===e[1];e[0]>e[s-1]&&(e=[...e].reverse(),t=[...t].reverse());let a=Su(t,n,i),u=a.length,c=l=>{if(o&&l<e[0])return t[0];let f=0;if(u>1)for(;f<e.length-2&&!(l<e[f+1]);f++);let m=Se(e[f],e[f+1],l);return a[f](m)};return r?l=>c(Z(e[0],e[s-1],l)):c}function Is(e,t){let r=e[e.length-1];for(let n=1;n<=t;n++){let i=Se(0,t,n);e.push(A(r,1,i))}}function Ns(e){let t=[0];return Is(t,e.length-1),t}function Os(e,t){return e.map(r=>r*t)}function Cu(e,t){return e.map(()=>t||or).splice(0,e.length-1)}function it({duration:e=300,keyframes:t,times:r,ease:n="easeInOut"}){let i=Ai(n)?n.map(Jr):Jr(n),s={done:!1,value:t[0]},o=Os(r&&r.length===t.length?r:Ns(t),e),a=Ls(o,t,{ease:Array.isArray(i)?i:Cu(t,i)});return{calculatedDuration:e,next:u=>(s.value=a(u),s.done=u>=e,s)}}var Vu=e=>e!==null;function _e(e,{repeat:t,repeatType:r="loop"},n,i=1){let s=e.filter(Vu),a=i<0||t&&r!=="loop"&&t%2===1?0:s.length-1;return!a||n===void 0?s[a]:n}var Pu={decay:mr,inertia:mr,tween:it,keyframes:it,spring:At};function un(e){typeof e.type=="string"&&(e.type=Pu[e.type])}var Ye=class{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(t=>{this.resolve=t})}notifyFinished(){this.resolve()}then(t,r){return this.finished.then(t,r)}};var Eu=e=>e/100,Ne=class extends Ye{constructor(t){super(),this.state="idle",this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.delayState={done:!1,value:void 0},this.stop=()=>{var n,i;let{motionValue:r}=this.options;r&&r.updatedAt!==W.now()&&this.tick(W.now()),this.isStopped=!0,this.state!=="idle"&&(this.teardown(),(i=(n=this.options).onStop)==null||i.call(n))},this.options=t,this.initAnimation(),this.play(),t.autoplay===!1&&this.pause()}initAnimation(){let{options:t}=this;un(t);let{type:r=it,repeat:n=0,repeatDelay:i=0,repeatType:s,velocity:o=0}=t,{keyframes:a}=t,u=r||it;u!==it&&typeof a[0]!="number"&&(this.mixKeyframes=be(Eu,an(a[0],a[1])),a=[0,100]);let c=u({...t,keyframes:a});s==="mirror"&&(this.mirroredGenerator=u({...t,keyframes:[...a].reverse(),velocity:-o})),c.calculatedDuration===null&&(c.calculatedDuration=Mt(c));let{calculatedDuration:l}=c;this.calculatedDuration=l,this.resolvedDuration=l+i,this.totalDuration=this.resolvedDuration*(n+1)-i,this.generator=c}updateTime(t){let r=Math.round(t-this.startTime)*this.playbackSpeed;this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=r}tick(t,r=!1){let{generator:n,totalDuration:i,mixKeyframes:s,mirroredGenerator:o,resolvedDuration:a,calculatedDuration:u}=this;if(this.startTime===null)return n.next(0);let{delay:c=0,keyframes:l,repeat:f,repeatType:m,repeatDelay:d,type:h,onUpdate:g,finalKeyframe:x}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,t):this.speed<0&&(this.startTime=Math.min(t-i/this.speed,this.startTime)),r?this.currentTime=t:this.updateTime(t);let y=this.currentTime-c*(this.playbackSpeed>=0?1:-1),T=this.playbackSpeed>=0?y<0:y>i;this.currentTime=Math.max(y,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=i);let w=this.currentTime,v=n;if(f){let P=Math.min(this.currentTime,i)/a,H=Math.floor(P),E=P%1;!E&&P>=1&&(E=1),E===1&&H--,H=Math.min(H,f+1),!!(H%2)&&(m==="reverse"?(E=1-E,d&&(E-=d/a)):m==="mirror"&&(v=o)),w=Z(0,1,E)*a}let C;T?(this.delayState.value=l[0],C=this.delayState):C=v.next(w),s&&!T&&(C.value=s(C.value));let{done:D}=C;!T&&u!==null&&(D=this.playbackSpeed>=0?this.currentTime>=i:this.currentTime<=0);let V=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&D);return V&&h!==mr&&(C.value=_e(l,this.options,x,this.speed)),g&&g(C.value),V&&this.finish(),C}then(t,r){return this.finished.then(t,r)}get duration(){return ee(this.calculatedDuration)}get iterationDuration(){let{delay:t=0}=this.options||{};return this.duration+ee(t)}get time(){return ee(this.currentTime)}set time(t){t=_(t),this.currentTime=t,this.startTime===null||this.holdTime!==null||this.playbackSpeed===0?this.holdTime=t:this.driver&&(this.startTime=this.driver.now()-t/this.playbackSpeed),this.driver?this.driver.start(!1):(this.startTime=0,this.state="paused",this.holdTime=t,this.tick(t))}getGeneratorVelocity(){let t=this.currentTime;if(t<=0)return this.options.velocity||0;if(this.generator.velocity)return this.generator.velocity(t);let r=this.generator.next(t).value;return cn(n=>this.generator.next(n).value,t,r)}get speed(){return this.playbackSpeed}set speed(t){let r=this.playbackSpeed!==t;r&&this.driver&&this.updateTime(W.now()),this.playbackSpeed=t,r&&this.driver&&(this.time=ee(this.currentTime))}play(){var i,s;if(this.isStopped)return;let{driver:t=Ds,startTime:r}=this.options;this.driver||(this.driver=t(o=>this.tick(o))),(s=(i=this.options).onPlay)==null||s.call(i);let n=this.driver.now();this.state==="finished"?(this.updateFinished(),this.startTime=n):this.holdTime!==null?this.startTime=n-this.holdTime:this.startTime||(this.startTime=r!=null?r:n),this.state==="finished"&&this.speed<0&&(this.startTime+=this.calculatedDuration),this.holdTime=null,this.state="running",this.driver.start()}pause(){this.state="paused",this.updateTime(W.now()),this.holdTime=this.currentTime}complete(){this.state!=="running"&&this.play(),this.state="finished",this.holdTime=null}finish(){var t,r;this.notifyFinished(),this.teardown(),this.state="finished",(r=(t=this.options).onComplete)==null||r.call(t)}cancel(){var t,r;this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),(r=(t=this.options).onCancel)==null||r.call(t)}teardown(){this.state="idle",this.stopDriver(),this.startTime=this.holdTime=null}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(t){return this.startTime=0,this.tick(t,!0)}attachTimeline(t){var r;return this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear",this.initAnimation()),(r=this.driver)==null||r.stop(),t.observe(this)}};function Bs(e){var t;for(let r=1;r<e.length;r++)(t=e[r])!=null||(e[r]=e[r-1])}var ot=e=>e*180/Math.PI,zi=e=>{let t=ot(Math.atan2(e[1],e[0]));return Gi(t)},Mu={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:e=>(Math.abs(e[0])+Math.abs(e[3]))/2,rotate:zi,rotateZ:zi,skewX:e=>ot(Math.atan(e[1])),skewY:e=>ot(Math.atan(e[2])),skew:e=>(Math.abs(e[1])+Math.abs(e[2]))/2},Gi=e=>(e=e%360,e<0&&(e+=360),e),Fs=zi,js=e=>Math.sqrt(e[0]*e[0]+e[1]*e[1]),zs=e=>Math.sqrt(e[4]*e[4]+e[5]*e[5]),Au={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:js,scaleY:zs,scale:e=>(js(e)+zs(e))/2,rotateX:e=>Gi(ot(Math.atan2(e[6],e[5]))),rotateY:e=>Gi(ot(Math.atan2(-e[2],e[0]))),rotateZ:Fs,rotate:Fs,skewX:e=>ot(Math.atan(e[4])),skewY:e=>ot(Math.atan(e[1])),skew:e=>(Math.abs(e[1])+Math.abs(e[4]))/2};function fn(e){return e.includes("scale")?1:0}function mn(e,t){if(!e||e==="none")return fn(t);let r=e.match(/^matrix3d\(([-\d.e\s,]+)\)$/u),n,i;if(r)n=Au,i=r;else{let a=e.match(/^matrix\(([-\d.e\s,]+)\)$/u);n=Mu,i=a}if(!i)return fn(t);let s=n[t],o=i[1].split(",").map(Du);return typeof s=="function"?s(o):o[s]}var Gs=(e,t)=>{let{transform:r="none"}=getComputedStyle(e);return mn(r,t)};function Du(e){return parseFloat(e.trim())}var Pe=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],ge=new Set([...Pe,"pathRotation"]);var Wi=e=>e===Ce||e===S,ku=new Set(["x","y","z"]),Ru=Pe.filter(e=>!ku.has(e));function Ws(e){let t=[];return Ru.forEach(r=>{let n=e.getValue(r);n!==void 0&&(t.push([r,n.get()]),n.set(r.startsWith("scale")?1:0))}),t}var Oe={width:({x:e},{paddingLeft:t="0",paddingRight:r="0",boxSizing:n})=>{let i=e.max-e.min;return n==="border-box"?i:i-parseFloat(t)-parseFloat(r)},height:({y:e},{paddingTop:t="0",paddingBottom:r="0",boxSizing:n})=>{let i=e.max-e.min;return n==="border-box"?i:i-parseFloat(t)-parseFloat(r)},top:(e,{top:t})=>parseFloat(t),left:(e,{left:t})=>parseFloat(t),bottom:({y:e},{top:t})=>parseFloat(t)+(e.max-e.min),right:({x:e},{left:t})=>parseFloat(t)+(e.max-e.min),x:(e,{transform:t})=>mn(t,"x"),y:(e,{transform:t})=>mn(t,"y")};Oe.translateX=Oe.x;Oe.translateY=Oe.y;var st=new Set,Ui=!1,Hi=!1,Ki=!1;function Us(){if(Hi){let e=Array.from(st).filter(n=>n.needsMeasurement),t=new Set(e.map(n=>n.element)),r=new Map;t.forEach(n=>{let i=Ws(n);i.length&&(r.set(n,i),n.render())}),e.forEach(n=>n.measureInitialState()),t.forEach(n=>{n.render();let i=r.get(n);i&&i.forEach(([s,o])=>{var a;(a=n.getValue(s))==null||a.set(o)})}),e.forEach(n=>n.measureEndState()),e.forEach(n=>{n.suspendedScrollY!==void 0&&window.scrollTo(0,n.suspendedScrollY)})}Hi=!1,Ui=!1,st.forEach(e=>e.complete(Ki)),st.clear()}function Hs(){st.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(Hi=!0)})}function Ks(){Ki=!0,Hs(),Us(),Ki=!1}var $e=class{constructor(t,r,n,i,s,o=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...t],this.onComplete=r,this.name=n,this.motionValue=i,this.element=s,this.isAsync=o}scheduleResolve(){this.state="scheduled",this.isAsync?(st.add(this),Ui||(Ui=!0,M.read(Hs),M.resolveKeyframes(Us))):(this.readKeyframes(),this.complete())}readKeyframes(){let{unresolvedKeyframes:t,name:r,element:n,motionValue:i}=this;if(t[0]===null){let s=i==null?void 0:i.get(),o=t[t.length-1];if(s!==void 0)t[0]=s;else if(n&&r){let a=n.readValue(r,o);a!=null&&(t[0]=a)}t[0]===void 0&&(t[0]=o),i&&s===void 0&&i.set(t[0])}Bs(t)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(t=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,t),st.delete(this)}cancel(){this.state==="scheduled"&&(st.delete(this),this.state="pending")}resume(){this.state==="pending"&&this.scheduleResolve()}};var _s=e=>e.startsWith("--");function dn(e,t,r){_s(t)?e.style.setProperty(t,r):e.style[t]=r}var Ys={};function pn(e,t){let r=Jt(e);return()=>{var n;return(n=Ys[t])!=null?n:r()}}var $s=pn(()=>window.ScrollTimeline!==void 0,"scrollTimeline");var hn=pn(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch(e){return!1}return!0},"linearEasing");var at=([e,t,r,n])=>`cubic-bezier(${e}, ${t}, ${r}, ${n})`;var _i={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:at([0,.65,.55,1]),circOut:at([.55,0,1,.45]),backIn:at([.31,.01,.66,-.59]),backOut:at([.33,1.53,.69,.99])};function Yi(e,t){if(e)return typeof e=="function"?hn()?ln(e,t):"ease-out":sr(e)?at(e):Array.isArray(e)?e.map(r=>Yi(r,t)||_i.easeOut):_i[e]}function Xs(e,t,r,{delay:n=0,duration:i=300,repeat:s=0,repeatType:o="loop",ease:a="easeOut",times:u}={},c=void 0){let l={[t]:r};u&&(l.offset=u);let f=Yi(a,i);Array.isArray(f)&&(l.easing=f);let m={delay:n,duration:i,easing:Array.isArray(f)?"linear":f,fill:"both",iterations:s+1,direction:o==="reverse"?"alternate":"normal"};return c&&(m.pseudoElement=c),e.animate(l,m)}function gn(e){return typeof e=="function"&&"applyToOptions"in e}function qs({type:e,...t}){var r,n;return gn(e)&&hn()?e.applyToOptions(t):((r=t.duration)!=null||(t.duration=300),(n=t.ease)!=null||(t.ease="easeOut"),t)}var Dt=class extends Ye{constructor(t){if(super(),this.finishedTime=null,this.isStopped=!1,this.manualStartTime=null,!t)return;let{element:r,name:n,keyframes:i,pseudoElement:s,allowFlatten:o=!1,finalKeyframe:a,onComplete:u}=t;this.isPseudoElement=!!s,this.allowFlatten=o,this.options=t,ae(typeof t.type!="string",`Mini animate() doesn't support "type" as a string.`,"mini-spring");let c=qs(t);this.animation=Xs(r,n,i,c,s),c.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!s){let l=_e(i,this.options,a,this.speed);this.updateMotionValue&&this.updateMotionValue(l),dn(r,n,l),this.animation.cancel()}u==null||u(),this.notifyFinished()}}play(){this.isStopped||(this.manualStartTime=null,this.animation.play(),this.state==="finished"&&this.updateFinished())}pause(){this.animation.pause()}complete(){var t,r;(r=(t=this.animation).finish)==null||r.call(t)}cancel(){try{this.animation.cancel()}catch(t){}}stop(){if(this.isStopped)return;this.isStopped=!0;let{state:t}=this;t==="idle"||t==="finished"||(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){var r,n,i;let t=(r=this.options)==null?void 0:r.element;!this.isPseudoElement&&(t!=null&&t.isConnected)&&((i=(n=this.animation).commitStyles)==null||i.call(n))}get duration(){var r,n;let t=((n=(r=this.animation.effect)==null?void 0:r.getComputedTiming)==null?void 0:n.call(r).duration)||0;return ee(Number(t))}get iterationDuration(){let{delay:t=0}=this.options||{};return this.duration+ee(t)}get time(){return ee(Number(this.animation.currentTime)||0)}set time(t){let r=this.finishedTime!==null;this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=_(t),r&&this.animation.pause()}get speed(){return this.animation.playbackRate}set speed(t){t<0&&(this.finishedTime=null),this.animation.playbackRate=t}get state(){return this.finishedTime!==null?"finished":this.animation.playState}get startTime(){var t;return(t=this.manualStartTime)!=null?t:Number(this.animation.startTime)}set startTime(t){this.manualStartTime=this.animation.startTime=t}attachTimeline({timeline:t,rangeStart:r,rangeEnd:n,observe:i}){var s;return this.allowFlatten&&((s=this.animation.effect)==null||s.updateTiming({easing:"linear"})),this.animation.onfinish=null,t&&$s()?(this.animation.timeline=t,r&&(this.animation.rangeStart=r),n&&(this.animation.rangeEnd=n),G):i(this)}};var Zs={anticipate:tr,backInOut:er,circInOut:ir};function Lu(e){return e in Zs}function Js(e){typeof e.ease=="string"&&Lu(e.ease)&&(e.ease=Zs[e.ease])}var $i=10,xn=class extends Dt{constructor(t){Js(t),un(t),super(t),t.startTime!==void 0&&t.autoplay!==!1&&(this.startTime=t.startTime),this.options=t}updateMotionValue(t){let{motionValue:r,onUpdate:n,onComplete:i,element:s,...o}=this.options;if(!r)return;if(t!==void 0){r.set(t);return}let a=new Ne({...o,autoplay:!1}),u=Math.max($i,W.now()-this.startTime),c=Z(0,$i,u-$i),l=a.sample(u).value,{name:f}=this.options;s&&f&&dn(s,f,l),r.setWithVelocity(a.sample(Math.max(0,u-c)).value,l,c),a.stop()}};var Xi=(e,t)=>t==="zIndex"?!1:!!(typeof e=="number"||Array.isArray(e)||typeof e=="string"&&(J.test(e)||e==="0")&&!e.startsWith("url("));function Iu(e){let t=e[0];if(e.length===1)return!0;for(let r=0;r<e.length;r++)if(e[r]!==t)return!0}function Qs(e,t,r,n){let i=e[0];if(i===null)return!1;if(t==="display"||t==="visibility")return!0;let s=e[e.length-1],o=Xi(i,t),a=Xi(s,t);return Re(o===a,`You are trying to animate ${t} from "${i}" to "${s}". "${o?s:i}" is not an animatable value.`,"value-not-animatable"),!o||!a?!1:Iu(e)||(r==="spring"||gn(r))&&n}function dr(e){e.duration=0,e.type="keyframes"}var yn=new Set(["opacity","clipPath","filter","transform","backgroundColor"]);var Nu=/^(?:oklch|oklab|lab|lch|color|color-mix|light-dark)\(/;function ea(e){for(let t=0;t<e.length;t++)if(typeof e[t]=="string"&&Nu.test(e[t]))return!0;return!1}var Ou=new Set(["color","backgroundColor","outlineColor","fill","stroke","borderColor","borderTopColor","borderRightColor","borderBottomColor","borderLeftColor"]),Bu=Jt(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));function ta(e){var f;let{motionValue:t,name:r,repeatDelay:n,repeatType:i,damping:s,type:o,keyframes:a}=e,u=(f=t==null?void 0:t.owner)==null?void 0:f.current;if(!(u instanceof HTMLElement)&&!(u instanceof SVGElement))return!1;let{onUpdate:c,transformTemplate:l}=t.owner.getProps();return Bu()&&r&&(yn.has(r)||Ou.has(r)&&ea(a))&&(r!=="transform"||!l)&&!c&&!n&&i!=="mirror"&&s!==0&&o!=="inertia"}var Fu=40,vn=class extends Ye{constructor({autoplay:t=!0,delay:r=0,type:n="keyframes",repeat:i=0,repeatDelay:s=0,repeatType:o="loop",keyframes:a,name:u,motionValue:c,element:l,...f}){var h;super(),this.stop=()=>{var g,x;this._animation&&(this._animation.stop(),(g=this.stopTimeline)==null||g.call(this)),(x=this.keyframeResolver)==null||x.cancel()},this.createdAt=W.now();let m={autoplay:t,delay:r,type:n,repeat:i,repeatDelay:s,repeatType:o,name:u,motionValue:c,element:l,...f},d=(l==null?void 0:l.KeyframeResolver)||$e;this.keyframeResolver=new d(a,(g,x,y)=>this.onKeyframesResolved(g,x,m,!y),u,c,l),(h=this.keyframeResolver)==null||h.scheduleResolve()}onKeyframesResolved(t,r,n,i){var y,T;this.keyframeResolver=void 0;let{name:s,type:o,velocity:a,delay:u,isHandoff:c,onUpdate:l}=n;this.resolvedAt=W.now();let f=!0;Qs(t,s,o,a)||(f=!1,(ie.instantAnimations||!u)&&(l==null||l(_e(t,n,r))),t[0]=t[t.length-1],dr(n),n.repeat=0);let d={startTime:i?this.resolvedAt?this.resolvedAt-this.createdAt>Fu?this.resolvedAt:this.createdAt:this.createdAt:void 0,finalKeyframe:r,...n,keyframes:t},h=f&&!c&&ta(d),g=(T=(y=d.motionValue)==null?void 0:y.owner)==null?void 0:T.current,x;if(h)try{x=new xn({...d,element:g})}catch(w){x=new Ne(d)}else x=new Ne(d);x.finished.then(()=>{this.notifyFinished()}).catch(G),this.pendingTimeline&&(this.stopTimeline=x.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=x}get finished(){return this._animation?this.animation.finished:this._finished}then(t,r){return this.finished.finally(t).then(()=>{})}get animation(){var t;return this._animation||((t=this.keyframeResolver)==null||t.resume(),Ks()),this._animation}get duration(){return this.animation.duration}get iterationDuration(){return this.animation.iterationDuration}get time(){return this.animation.time}set time(t){this.animation.time=t}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(t){this.animation.speed=t}get startTime(){return this.animation.startTime}attachTimeline(t){return this._animation?this.stopTimeline=this.animation.attachTimeline(t):this.pendingTimeline=t,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){var t;this._animation&&this.animation.cancel(),(t=this.keyframeResolver)==null||t.cancel()}};function bn(e,t,r,n=0,i=1){let s=Array.from(e).sort((c,l)=>c.sortNodePosition(l)).indexOf(t),o=e.size,a=(o-1)*n;return typeof r=="function"?r(s,o):i===1?s*n:a-s*n}var ra=30,ju=e=>!isNaN(parseFloat(e)),na={current:void 0},qi=class{constructor(t,r={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=n=>{var s;let i=W.now();if(this.updatedAt!==i&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(n),this.current!==this.prev&&((s=this.events.change)==null||s.notify(this.current),this.dependents))for(let o of this.dependents)o.dirty()},this.hasAnimated=!1,this.setCurrent(t),this.owner=r.owner}setCurrent(t){this.current=t,this.updatedAt=W.now(),this.canTrackVelocity===null&&t!==void 0&&(this.canTrackVelocity=ju(this.current))}setPrevFrameValue(t=this.current){this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt}onChange(t){return this.on("change",t)}on(t,r){this.events[t]||(this.events[t]=new Le);let n=this.events[t].add(r);return t==="change"?()=>{n(),M.read(()=>{this.events.change.getSize()||this.stop()})}:n}clearListeners(){for(let t in this.events)this.events[t].clear()}attach(t,r){this.passiveEffect=t,this.stopPassiveEffect=r}set(t){this.passiveEffect?this.passiveEffect(t,this.updateAndNotify):this.updateAndNotify(t)}setWithVelocity(t,r,n){this.set(r),this.prev=void 0,this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt-n}jump(t,r=!0){this.updateAndNotify(t),this.prev=t,this.prevUpdatedAt=this.prevFrameValue=void 0,r&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){var t;(t=this.events.change)==null||t.notify(this.current)}addDependent(t){this.dependents||(this.dependents=new Set),this.dependents.add(t)}removeDependent(t){this.dependents&&this.dependents.delete(t)}get(){return na.current&&na.current.push(this),this.current}getPrevious(){return this.prev}getVelocity(){let t=W.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||t-this.updatedAt>ra)return 0;let r=Math.min(this.updatedAt-this.prevUpdatedAt,ra);return Qt(parseFloat(this.current)-parseFloat(this.prevFrameValue),r)}start(t){return this.stop(),new Promise(r=>{this.hasAnimated=!0,this.animation=t(r),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){var t,r;(t=this.dependents)==null||t.clear(),(r=this.events.destroy)==null||r.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}};function we(e,t){return new qi(e,t)}function wn(e,t){if(e!=null&&e.inherit&&t){let{inherit:r,...n}=e;return{...t,...n}}return e}function kt(e,t){var n,i;let r=(i=(n=e==null?void 0:e[t])!=null?n:e==null?void 0:e.default)!=null?i:e;return r!==e?wn(r,e):r}var zu={type:"spring",stiffness:500,damping:25,restSpeed:10},Gu=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),Wu={type:"keyframes",duration:.8},Uu={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},ia=(e,{keyframes:t})=>t.length>2?Wu:ge.has(e)?e.startsWith("scale")?Gu(t[1]):zu:Uu;var Hu=new Set(["when","delay","delayChildren","staggerChildren","staggerDirection","repeat","repeatType","repeatDelay","from","elapsed"]);function oa(e){for(let t in e)if(!Hu.has(t))return!0;return!1}var lt=(e,t,r,n={},i,s)=>o=>{let a=kt(n,e)||{},u=a.delay||n.delay||0,{elapsed:c=0}=n;c=c-_(u);let l={keyframes:Array.isArray(r)?r:[null,r],ease:"easeOut",velocity:t.getVelocity(),...a,delay:-c,onUpdate:m=>{t.set(m),a.onUpdate&&a.onUpdate(m)},onComplete:()=>{o(),a.onComplete&&a.onComplete()},name:e,motionValue:t,element:s?void 0:i};oa(a)||Object.assign(l,ia(e,l)),l.duration&&(l.duration=_(l.duration)),l.repeatDelay&&(l.repeatDelay=_(l.repeatDelay)),l.from!==void 0&&(l.keyframes[0]=l.from);let f=!1;if((l.type===!1||l.duration===0&&!l.repeatDelay)&&(dr(l),l.delay===0&&(f=!0)),(ie.instantAnimations||ie.skipAnimations||i!=null&&i.shouldSkipAnimations||a.skipAnimations)&&(f=!0,dr(l),l.delay=0),l.allowFlatten=!a.type&&!a.ease,f&&!s&&t.get()!==void 0){let m=_e(l.keyframes,a);if(m!==void 0){M.update(()=>{l.onUpdate(m),l.onComplete()});return}}return a.isSync?new Ne(l):new vn(l)};var Ku=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function _u(e){let t=Ku.exec(e);if(!t)return[,];let[,r,n,i]=t;return[`--${r!=null?r:n}`,i]}var Yu=4;function Zi(e,t,r=1){ae(r<=Yu,`Max CSS variable fallback depth detected in property "${e}". This may indicate a circular fallback dependency.`,"max-css-var-depth");let[n,i]=_u(e);if(!n)return;let s=window.getComputedStyle(t).getPropertyValue(n);if(s){let o=s.trim();return Xt(o)?parseFloat(o):o}return Ct(i)?Zi(i,t,r+1):i}function sa(e){let t=[{},{}];return e==null||e.values.forEach((r,n)=>{t[0][n]=r.get(),t[1][n]=r.getVelocity()}),t}function ct(e,t,r,n){if(typeof t=="function"){let[i,s]=sa(n);t=t(r!==void 0?r:e.custom,i,s)}if(typeof t=="string"&&(t=e.variants&&e.variants[t]),typeof t=="function"){let[i,s]=sa(n);t=t(r!==void 0?r:e.custom,i,s)}return t}function ue(e,t,r){let n=e.getProps();return ct(n,t,r!==void 0?r:n.custom,e)}var Tn=new Set(["width","height","top","left","right","bottom",...Pe]);var pr=e=>Array.isArray(e);function $u(e,t,r){e.hasValue(t)?e.getValue(t).set(r):e.addValue(t,we(r))}function Xu(e){return pr(e)?e[e.length-1]||0:e}function aa(e,t){let r=ue(e,t),{transitionEnd:n={},transition:i={},...s}=r||{};s={...s,...n};for(let o in s){let a=Xu(s[o]);$u(e,o,a)}}var L=e=>!!(e&&e.getVelocity);function la(e){return!!(L(e)&&e.add)}function Rt(e,t){let r=e.getValue("willChange");if(la(r))return r.add(t);if(!r&&ie.WillChange){let n=new ie.WillChange("auto");e.addValue("willChange",n),n.add(t)}}function Lt(e){return e.replace(/([A-Z])/g,t=>`-${t.toLowerCase()}`)}var ca="framerAppearId",hr="data-"+Lt(ca);function Sn(e){return e.props[hr]}function qu({protectedKeys:e,needsAnimating:t},r){let n=e.hasOwnProperty(r)&&t[r]!==!0;return t[r]=!1,n}function Cn(e,t,{delay:r=0,transitionOverride:n,type:i}={}){var h;let{transition:s,transitionEnd:o,...a}=t,u=e.getDefaultTransition();s=s?wn(s,u):u;let c=s==null?void 0:s.reduceMotion,l=s==null?void 0:s.skipAnimations;n&&(s=n);let f=[],m=i&&e.animationState&&e.animationState.getState()[i],d=s==null?void 0:s.path;d&&d.animateVisualElement(e,a,s,r,f);for(let g in a){let x=e.getValue(g,(h=e.latestValues[g])!=null?h:null),y=a[g];if(y===void 0||m&&qu(m,g))continue;let T={delay:r,...kt(s||{},g)};l&&(T.skipAnimations=!0);let w=x.get();if(w!==void 0&&!x.isAnimating()&&!Array.isArray(y)&&y===w&&!T.velocity){M.update(()=>x.set(y));continue}let v=!1;if(window.MotionHandoffAnimation){let V=Sn(e);if(V){let P=window.MotionHandoffAnimation(V,g,M);P!==null&&(T.startTime=P,v=!0)}}Rt(e,g);let C=c!=null?c:e.shouldReduceMotion;x.start(lt(g,x,y,C&&Tn.has(g)?{type:!1}:T,e,v));let D=x.animation;D&&f.push(D)}if(o){let g=()=>M.update(()=>{o&&aa(e,o)});f.length?Promise.all(f).then(g):g()}return f}function Vn(e,t,r={}){var u;let n=ue(e,t,r.type==="exit"?(u=e.presenceContext)==null?void 0:u.custom:void 0),{transition:i=e.getDefaultTransition()||{}}=n||{};r.transitionOverride&&(i=r.transitionOverride);let s=n?()=>Promise.all(Cn(e,n,r)):()=>Promise.resolve(),o=e.variantChildren&&e.variantChildren.size?(c=0)=>{let{delayChildren:l=0,staggerChildren:f,staggerDirection:m}=i;return Zu(e,t,c,l,f,m,r)}:()=>Promise.resolve(),{when:a}=i;if(a){let[c,l]=a==="beforeChildren"?[s,o]:[o,s];return c().then(()=>l())}else return Promise.all([s(),o(r.delay)])}function Zu(e,t,r=0,n=0,i=0,s=1,o){let a=[];for(let u of e.variantChildren)u.notify("AnimationStart",t),a.push(Vn(u,t,{...o,delay:r+(typeof n=="function"?0:n)+bn(e.variantChildren,u,n,i,s)}).then(()=>u.notify("AnimationComplete",t)));return Promise.all(a)}function ua(e,t,r={}){e.notify("AnimationStart",t);let n;if(Array.isArray(t)){let i=t.map(s=>Vn(e,s,r));n=Promise.all(i)}else if(typeof t=="string")n=Vn(e,t,r);else{let i=typeof t=="function"?ue(e,t,r.custom):t;n=Promise.all(Cn(e,i,r))}return n.then(()=>{e.notify("AnimationComplete",t)})}var fa={test:e=>e==="auto",parse:e=>e};var Pn=e=>t=>t.test(e);var Ji=[Ce,S,ne,he,Li,Ri,fa],Qi=e=>Ji.find(Pn(e));function ma(e){return typeof e=="number"?e===0:e!==null?e==="none"||e==="0"||Zt(e):!0}var Ju=new Set(["brightness","contrast","saturate","opacity"]);function Qu(e){let[t,r]=e.slice(0,-1).split("(");if(t==="drop-shadow")return e;let[n]=r.match(Vt)||[];if(!n)return e;let i=r.replace(n,""),s=Ju.has(t)?1:0;return n!==r&&(s*=100),t+"("+s+i+")"}var ef=/\b([a-z-]*)\(.*?\)/gu,gr={...J,getAnimatableNone:e=>{let t=e.match(ef);return t?t.map(Qu).join(" "):e}};var xr={...J,getAnimatableNone:e=>{let t=J.parse(e);return J.createTransformer(e)(t.map(n=>typeof n=="number"?0:typeof n=="object"?{...n,alpha:1}:n))}};var eo={...Ce,transform:Math.round};var da={rotate:he,pathRotation:he,rotateX:he,rotateY:he,rotateZ:he,scale:cr,scaleX:cr,scaleY:cr,scaleZ:cr,skew:he,skewX:he,skewY:he,distance:S,translateX:S,translateY:S,translateZ:S,x:S,y:S,z:S,perspective:S,transformPerspective:S,opacity:Ie,originX:nn,originY:nn,originZ:S};var ut={borderWidth:S,borderTopWidth:S,borderRightWidth:S,borderBottomWidth:S,borderLeftWidth:S,borderRadius:S,borderTopLeftRadius:S,borderTopRightRadius:S,borderBottomRightRadius:S,borderBottomLeftRadius:S,width:S,maxWidth:S,height:S,maxHeight:S,top:S,right:S,bottom:S,left:S,inset:S,insetBlock:S,insetBlockStart:S,insetBlockEnd:S,insetInline:S,insetInlineStart:S,insetInlineEnd:S,padding:S,paddingTop:S,paddingRight:S,paddingBottom:S,paddingLeft:S,paddingBlock:S,paddingBlockStart:S,paddingBlockEnd:S,paddingInline:S,paddingInlineStart:S,paddingInlineEnd:S,margin:S,marginTop:S,marginRight:S,marginBottom:S,marginLeft:S,marginBlock:S,marginBlockStart:S,marginBlockEnd:S,marginInline:S,marginInlineStart:S,marginInlineEnd:S,fontSize:S,backgroundPositionX:S,backgroundPositionY:S,...da,zIndex:eo,fillOpacity:Ie,strokeOpacity:Ie,numOctaves:eo};var tf={...ut,color:B,backgroundColor:B,outlineColor:B,fill:B,stroke:B,borderColor:B,borderTopColor:B,borderRightColor:B,borderBottomColor:B,borderLeftColor:B,filter:gr,WebkitFilter:gr,mask:xr,WebkitMask:xr},En=e=>tf[e];var rf=new Set([gr,xr]);function Mn(e,t){let r=En(e);return rf.has(r)||(r=J),r.getAnimatableNone?r.getAnimatableNone(t):void 0}var nf=new Set(["auto","none","0"]);function pa(e,t,r){let n=0,i;for(;n<e.length&&!i;){let s=e[n];typeof s=="string"&&!nf.has(s)&&Ke(s).values.length&&(i=e[n]),n++}if(i&&r)for(let s of t)e[s]=Mn(r,i)}var An=class extends $e{constructor(t,r,n,i,s){super(t,r,n,i,s,!0)}readKeyframes(){let{unresolvedKeyframes:t,element:r,name:n}=this;if(!r||!r.current)return;super.readKeyframes();for(let l=0;l<t.length;l++){let f=t[l];if(typeof f=="string"&&(f=f.trim(),Ct(f))){let m=Zi(f,r.current);m!==void 0&&(t[l]=m),l===t.length-1&&(this.finalKeyframe=f)}}if(this.resolveNoneKeyframes(),!Tn.has(n)||t.length!==2)return;let[i,s]=t,o=Qi(i),a=Qi(s),u=Di(i),c=Di(s);if(u!==c&&Oe[n]){this.needsMeasurement=!0;return}if(o!==a)if(Wi(o)&&Wi(a))for(let l=0;l<t.length;l++){let f=t[l];typeof f=="string"&&(t[l]=parseFloat(f))}else Oe[n]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){let{unresolvedKeyframes:t,name:r}=this,n=[];for(let i=0;i<t.length;i++)(t[i]===null||ma(t[i]))&&n.push(i);n.length&&pa(t,n,r)}measureInitialState(){let{element:t,unresolvedKeyframes:r,name:n}=this;if(!t||!t.current)return;n==="height"&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=Oe[n](t.measureViewportBox(),window.getComputedStyle(t.current)),r[0]=this.measuredOrigin;let i=r[r.length-1];i!==void 0&&t.getValue(n,i).jump(i,!1)}measureEndState(){var a;let{element:t,name:r,unresolvedKeyframes:n}=this;if(!t||!t.current)return;let i=t.getValue(r);i&&i.jump(this.measuredOrigin,!1);let s=n.length-1,o=n[s];n[s]=Oe[r](t.measureViewportBox(),window.getComputedStyle(t.current)),o!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=o),(a=this.removedTransforms)!=null&&a.length&&this.removedTransforms.forEach(([u,c])=>{t.getValue(u).set(c)}),this.resolveNoneKeyframes()}};var yr=["borderTopLeftRadius","borderTopRightRadius","borderBottomRightRadius","borderBottomLeftRadius"];function Dn(e,t,r){var n;if(e==null)return[];if(e instanceof EventTarget)return[e];if(typeof e=="string"){let i=document;t&&(i=t.current);let s=(n=r==null?void 0:r[e])!=null?n:i.querySelectorAll(e);return s?Array.from(s):[]}return Array.from(e).filter(i=>i!=null)}var vr=(e,t)=>t&&typeof e=="number"?t.transform(e):e;function ha(e){return qt(e)&&"offsetHeight"in e&&!("ownerSVGElement"in e)}var{schedule:ft,cancel:of}=Qr(queueMicrotask,!1);var xe={x:!1,y:!1};function kn(){return xe.x||xe.y}function to(e){return e==="x"||e==="y"?xe[e]?null:(xe[e]=!0,()=>{xe[e]=!1}):xe.x||xe.y?null:(xe.x=xe.y=!0,()=>{xe.x=xe.y=!1})}function Rn(e,t){let r=Dn(e),n=new AbortController,i={passive:!0,...t,signal:n.signal};return[r,i,()=>n.abort()]}function sf(e){return!(e.pointerType==="touch"||kn())}function ro(e,t,r={}){let[n,i,s]=Rn(e,r);return n.forEach(o=>{let a=!1,u=!1,c,l=()=>{o.removeEventListener("pointerleave",h)},f=x=>{c&&(c(x),c=void 0),l()},m=x=>{a=!1,window.removeEventListener("pointerup",m),window.removeEventListener("pointercancel",m),u&&(u=!1,f(x))},d=()=>{a=!0,window.addEventListener("pointerup",m,i),window.addEventListener("pointercancel",m,i)},h=x=>{if(x.pointerType!=="touch"){if(a){u=!0;return}f(x)}},g=x=>{if(!sf(x))return;u=!1;let y=t(o,x);typeof y=="function"&&(c=y,o.addEventListener("pointerleave",h,i))};o.addEventListener("pointerenter",g,i),o.addEventListener("pointerdown",d,i)}),s}var no=(e,t)=>t?e===t?!0:no(e,t.parentElement):!1;var mt=e=>e.pointerType==="mouse"?typeof e.button!="number"||e.button<=0:e.isPrimary!==!1;var af=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function io(e){return af.has(e.tagName)||e.isContentEditable===!0}var lf=new Set(["INPUT","SELECT","TEXTAREA"]);function oo(e){return lf.has(e.tagName)||e.isContentEditable===!0}var It=new WeakSet;function ga(e){return t=>{t.key==="Enter"&&e(t)}}function so(e,t){e.dispatchEvent(new PointerEvent("pointer"+t,{isPrimary:!0,bubbles:!0}))}var xa=(e,t)=>{let r=e.currentTarget;if(!r)return;let n=ga(()=>{if(It.has(r))return;so(r,"down");let i=ga(()=>{so(r,"up")}),s=()=>so(r,"cancel");r.addEventListener("keyup",i,t),r.addEventListener("blur",s,t)});r.addEventListener("keydown",n,t),r.addEventListener("blur",()=>r.removeEventListener("keydown",n),t)};function ya(e){return mt(e)&&!kn()}var va=new WeakSet;function ao(e,t,r={}){let[n,i,s]=Rn(e,r),o=a=>{let u=a.currentTarget;if(!ya(a)||va.has(a))return;It.add(u),r.stopPropagation&&va.add(a);let c=t(u,a),l={...i,capture:!0},f=(h,g)=>{window.removeEventListener("pointerup",m,l),window.removeEventListener("pointercancel",d,l),It.has(u)&&It.delete(u),ya(h)&&typeof c=="function"&&c(h,{success:g})},m=h=>{f(h,u===window||u===document||r.useGlobalTarget||no(u,h.target))},d=h=>{f(h,!1)};window.addEventListener("pointerup",m,l),window.addEventListener("pointercancel",d,l)};return n.forEach(a=>{(r.useGlobalTarget?window:a).addEventListener("pointerdown",o,i),ha(a)&&(a.addEventListener("focus",c=>xa(c,i)),!io(a)&&!a.hasAttribute("tabindex")&&(a.tabIndex=0))}),s}function Nt(e){return qt(e)&&"ownerSVGElement"in e}var Ln=new WeakMap,Xe,ba=(e,t,r)=>(n,i)=>i&&i[0]?i[0][e+"Size"]:Nt(n)&&"getBBox"in n?n.getBBox()[t]:n[r],cf=ba("inline","width","offsetWidth"),uf=ba("block","height","offsetHeight");function ff({target:e,borderBoxSize:t}){var r;(r=Ln.get(e))==null||r.forEach(n=>{n(e,{get width(){return cf(e,t)},get height(){return uf(e,t)}})})}function mf(e){e.forEach(ff)}function df(){typeof ResizeObserver!="undefined"&&(Xe=new ResizeObserver(mf))}function wa(e,t){Xe||df();let r=Dn(e);return r.forEach(n=>{let i=Ln.get(n);i||(i=new Set,Ln.set(n,i)),i.add(t),Xe==null||Xe.observe(n)}),()=>{r.forEach(n=>{let i=Ln.get(n);i==null||i.delete(t),i!=null&&i.size||Xe==null||Xe.unobserve(n)})}}var In=new Set,Ot;function pf(){Ot=()=>{let e={get width(){return window.innerWidth},get height(){return window.innerHeight}};In.forEach(t=>t(e))},window.addEventListener("resize",Ot)}function Ta(e){return In.add(e),Ot||pf(),()=>{In.delete(e),!In.size&&typeof Ot=="function"&&(window.removeEventListener("resize",Ot),Ot=void 0)}}function Nn(e,t){return typeof e=="function"?Ta(e):wa(e,t)}var dt={value:null,addProjectionMetrics:null};function Sa(e){return Nt(e)&&e.tagName==="svg"}var hf=[...Ji,B,J],Ca=e=>hf.find(Pn(e));var lo=()=>({translate:0,scale:1,origin:0,originPoint:0}),qe=()=>({x:lo(),y:lo()}),co=()=>({min:0,max:0}),F=()=>({x:co(),y:co()});var Va=new WeakMap;function Be(e){return e!==null&&typeof e=="object"&&typeof e.start=="function"}function Ee(e){return typeof e=="string"||Array.isArray(e)}var On=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],br=["initial",...On];function Ze(e){return Be(e.animate)||br.some(t=>Ee(e[t]))}function wr(e){return!!(Ze(e)||e.variants)}function Pa(e,t,r){for(let n in t){let i=t[n],s=r[n];if(L(i))e.addValue(n,i);else if(L(s))e.addValue(n,we(i,{owner:e}));else if(s!==i)if(e.hasValue(n)){let o=e.getValue(n);o.liveStyle===!0?o.jump(i):o.hasAnimated||o.set(i)}else{let o=e.getStaticValue(n);e.addValue(n,we(o!==void 0?o:i,{owner:e}))}}for(let n in r)t[n]===void 0&&e.removeValue(n);return t}var Tr={current:null},Bn={current:!1};var gf=typeof window!="undefined";function Ea(){if(Bn.current=!0,!!gf)if(window.matchMedia){let e=window.matchMedia("(prefers-reduced-motion)"),t=()=>Tr.current=e.matches;e.addEventListener("change",t),t()}else Tr.current=!1}var Ma=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"],Fn={};function Cr(e){Fn=e}function uo(){return Fn}var Sr=class{scrapeMotionValuesFromProps(t,r,n){return{}}constructor({parent:t,props:r,presenceContext:n,reducedMotionConfig:i,skipAnimations:s,blockInitialAnimation:o,visualState:a},u={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.shouldSkipAnimations=!1,this.values=new Map,this.KeyframeResolver=$e,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.hasBeenMounted=!1,this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{let d=W.now();this.renderScheduledAt<d&&(this.renderScheduledAt=d,M.render(this.render,!1,!0))};let{latestValues:c,renderState:l}=a;this.latestValues=c,this.baseTarget={...c},this.initialValues=r.initial?{...c}:{},this.renderState=l,this.parent=t,this.props=r,this.presenceContext=n,this.depth=t?t.depth+1:0,this.reducedMotionConfig=i,this.skipAnimationsConfig=s,this.options=u,this.blockInitialAnimation=!!o,this.isControllingVariants=Ze(r),this.isVariantNode=wr(r),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(t&&t.current);let{willChange:f,...m}=this.scrapeMotionValuesFromProps(r,{},this);for(let d in m){let h=m[d];c[d]!==void 0&&L(h)&&h.set(c[d])}}mount(t){var r,n,i;if(this.hasBeenMounted)for(let s in this.initialValues)(r=this.values.get(s))==null||r.jump(this.initialValues[s]),this.latestValues[s]=this.initialValues[s];this.current=t,Va.set(t,this),this.projection&&!this.projection.instance&&this.projection.mount(t),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((s,o)=>this.bindToMotionValue(o,s)),this.reducedMotionConfig==="never"?this.shouldReduceMotion=!1:this.reducedMotionConfig==="always"?this.shouldReduceMotion=!0:(Bn.current||Ea(),this.shouldReduceMotion=Tr.current),this.shouldSkipAnimations=(n=this.skipAnimationsConfig)!=null?n:!1,(i=this.parent)==null||i.addChild(this),this.update(this.props,this.presenceContext),this.hasBeenMounted=!0}unmount(){var t;this.projection&&this.projection.unmount(),le(this.notifyUpdate),le(this.render),this.valueSubscriptions.forEach(r=>r()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),(t=this.parent)==null||t.removeChild(this);for(let r in this.events)this.events[r].clear();for(let r in this.features){let n=this.features[r];n&&(n.unmount(),n.isMounted=!1)}this.current=null}addChild(t){var r;this.children.add(t),(r=this.enteringChildren)!=null||(this.enteringChildren=new Set),this.enteringChildren.add(t)}removeChild(t){this.children.delete(t),this.enteringChildren&&this.enteringChildren.delete(t)}bindToMotionValue(t,r){if(this.valueSubscriptions.has(t)&&this.valueSubscriptions.get(t)(),r.accelerate&&yn.has(t)&&this.current instanceof HTMLElement){let{factory:o,keyframes:a,times:u,ease:c,duration:l}=r.accelerate,f=new Dt({element:this.current,name:t,keyframes:a,times:u,ease:c,duration:_(l)}),m=o(f);this.valueSubscriptions.set(t,()=>{m(),f.cancel()});return}let n=ge.has(t);n&&this.onBindTransform&&this.onBindTransform();let i=r.on("change",o=>{this.latestValues[t]=o,this.props.onUpdate&&M.preRender(this.notifyUpdate),n&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()}),s;typeof window!="undefined"&&window.MotionCheckAppearSync&&(s=window.MotionCheckAppearSync(this,t,r)),this.valueSubscriptions.set(t,()=>{i(),s&&s()})}sortNodePosition(t){return!this.current||!this.sortInstanceNodePosition||this.type!==t.type?0:this.sortInstanceNodePosition(this.current,t.current)}updateFeatures(){let t="animation";for(t in Fn){let r=Fn[t];if(!r)continue;let{isEnabled:n,Feature:i}=r;if(!this.features[t]&&i&&n(this.props)&&(this.features[t]=new i(this)),this.features[t]){let s=this.features[t];s.isMounted?s.update():(s.mount(),s.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):F()}getStaticValue(t){return this.latestValues[t]}setStaticValue(t,r){this.latestValues[t]=r}update(t,r){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=t,this.prevPresenceContext=this.presenceContext,this.presenceContext=r;for(let n=0;n<Ma.length;n++){let i=Ma[n];this.propEventSubscriptions[i]&&(this.propEventSubscriptions[i](),delete this.propEventSubscriptions[i]);let s="on"+i,o=t[s];o&&(this.propEventSubscriptions[i]=this.on(i,o))}this.prevMotionValues=Pa(this,this.scrapeMotionValuesFromProps(t,this.prevProps||{},this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}getProps(){return this.props}getVariant(t){return this.props.variants?this.props.variants[t]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(t){let r=this.getClosestVariantNode();if(r)return r.variantChildren&&r.variantChildren.add(t),()=>r.variantChildren.delete(t)}addValue(t,r){let n=this.values.get(t);r!==n&&(n&&this.removeValue(t),this.bindToMotionValue(t,r),this.values.set(t,r),this.latestValues[t]=r.get())}removeValue(t){this.values.delete(t);let r=this.valueSubscriptions.get(t);r&&(r(),this.valueSubscriptions.delete(t)),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,r){if(this.props.values&&this.props.values[t])return this.props.values[t];let n=this.values.get(t);return n===void 0&&r!==void 0&&(n=we(r===null?void 0:r,{owner:this}),this.addValue(t,n)),n}readValue(t,r){var i;let n=this.latestValues[t]!==void 0||!this.current?this.latestValues[t]:(i=this.getBaseTargetFromProps(this.props,t))!=null?i:this.readValueFromInstance(this.current,t,this.options);return n!=null&&(typeof n=="string"&&(Xt(n)||Zt(n))?n=parseFloat(n):!Ca(n)&&J.test(r)&&(n=Mn(t,r)),this.setBaseTarget(t,L(n)?n.get():n)),L(n)?n.get():n}setBaseTarget(t,r){this.baseTarget[t]=r}getBaseTarget(t){var s;let{initial:r}=this.props,n;if(typeof r=="string"||typeof r=="object"){let o=ct(this.props,r,(s=this.presenceContext)==null?void 0:s.custom);o&&(n=o[t])}if(r&&n!==void 0)return n;let i=this.getBaseTargetFromProps(this.props,t);return i!==void 0&&!L(i)?i:this.initialValues[t]!==void 0&&n===void 0?void 0:this.baseTarget[t]}on(t,r){return this.events[t]||(this.events[t]=new Le),this.events[t].add(r)}notify(t,...r){this.events[t]&&this.events[t].notify(...r)}scheduleRenderMicrotask(){ft.render(this.render)}};var Bt=class extends Sr{constructor(){super(...arguments),this.KeyframeResolver=An}sortInstanceNodePosition(t,r){return t.compareDocumentPosition(r)&2?1:-1}getBaseTargetFromProps(t,r){let n=t.style;return n?n[r]:void 0}removeValueFromRenderState(t,{vars:r,style:n}){delete r[t],delete n[t]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);let{children:t}=this.props;L(t)&&(this.childSubscription=t.on("change",r=>{this.current&&(this.current.textContent=`${r}`)}))}};var Q=class{constructor(t){this.isMounted=!1,this.node=t}update(){}};function Vr({top:e,left:t,right:r,bottom:n}){return{x:{min:t,max:r},y:{min:e,max:n}}}function fo({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function mo(e,t){if(!t)return e;let r=t({x:e.left,y:e.top}),n=t({x:e.right,y:e.bottom});return{top:r.y,left:r.x,bottom:n.y,right:n.x}}function po(e){return e===void 0||e===1}function jn({scale:e,scaleX:t,scaleY:r}){return!po(e)||!po(t)||!po(r)}function Fe(e){return jn(e)||ho(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function ho(e){return Aa(e.x)||Aa(e.y)}function Aa(e){return e&&e!=="0%"}function Pr(e,t,r){let n=e-r,i=t*n;return r+i}function Da(e,t,r,n,i){return i!==void 0&&(e=Pr(e,i,n)),Pr(e,r,n)+t}function go(e,t=0,r=1,n,i){e.min=Da(e.min,t,r,n,i),e.max=Da(e.max,t,r,n,i)}function xo(e,{x:t,y:r}){go(e.x,t.translate,t.scale,t.originPoint),go(e.y,r.translate,r.scale,r.originPoint)}var ka=.999999999999,Ra=1.0000000000001;function Na(e,t,r,n=!1){var a;let i=r.length;if(!i)return;t.x=t.y=1;let s,o;for(let u=0;u<i;u++){s=r[u],o=s.projectionDelta;let{visualElement:c}=s.options;c&&c.props.style&&c.props.style.display==="contents"||(n&&s.options.layoutScroll&&s.scroll&&s!==s.root&&(ye(e.x,-s.scroll.offset.x),ye(e.y,-s.scroll.offset.y)),o&&(t.x*=o.x.scale,t.y*=o.y.scale,xo(e,o)),n&&Fe(s.latestValues)&&Er(e,s.latestValues,(a=s.layout)==null?void 0:a.layoutBox))}t.x<Ra&&t.x>ka&&(t.x=1),t.y<Ra&&t.y>ka&&(t.y=1)}function ye(e,t){e.min+=t,e.max+=t}function La(e,t,r,n,i=.5){let s=A(e.min,e.max,i);go(e,t,r,s,n)}function Ia(e,t){return typeof e=="string"?parseFloat(e)/100*(t.max-t.min):e}function Er(e,t,r){let n=r!=null?r:e;La(e.x,Ia(t.x,n.x),t.scaleX,t.scale,t.originX),La(e.y,Ia(t.y,n.y),t.scaleY,t.scale,t.originY)}function zn(e,t){return Vr(mo(e.getBoundingClientRect(),t))}function yo(e,t,r){let n=zn(e,r),{scroll:i}=t;return i&&(ye(n.x,i.offset.x),ye(n.y,i.offset.y)),n}var xf={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},yf=Pe.length;function Oa(e,t,r){let n="",i=!0;for(let o=0;o<yf;o++){let a=Pe[o],u=e[a];if(u===void 0)continue;let c=!0;if(typeof u=="number")c=u===(a.startsWith("scale")?1:0);else{let l=parseFloat(u);c=a.startsWith("scale")?l===1:l===0}if(!c||r){let l=vr(u,ut[a]);if(!c){i=!1;let f=xf[a]||a;n+=`${f}(${l}) `}r&&(t[a]=l)}}let s=e.pathRotation;return s&&(i=!1,n+=`rotate(${vr(s,ut.pathRotation)}) `),n=n.trim(),r?n=r(t,i?"":n):i&&(n="none"),n}function pt(e,t,r){let{style:n,vars:i,transformOrigin:s}=e,o=!1,a=!1;for(let u in t){let c=t[u];if(ge.has(u)){o=!0;continue}else if(tn(u)){i[u]=c;continue}else{let l=vr(c,ut[u]);u.startsWith("origin")?(a=!0,s[u]=l):n[u]=l}}if(t.transform||(o||r?n.transform=Oa(t,e.transform,r):n.transform&&(n.transform="none")),a){let{originX:u="50%",originY:c="50%",originZ:l=0}=s;n.transformOrigin=`${u} ${c} ${l}`}}function Gn(e,{style:t,vars:r},n,i){let s=e.style,o;for(o in t)s[o]=t[o];i==null||i.applyProjectionStyles(s,n);for(o in r)s.setProperty(o,r[o])}function Ba(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}var Ft={correct:(e,t)=>{if(!t.target)return e;if(typeof e=="string")if(S.test(e))e=parseFloat(e);else return e;let r=Ba(e,t.target.x),n=Ba(e,t.target.y);return`${r}% ${n}%`}};var Fa={correct:(e,{treeScale:t,projectionDelta:r})=>{let n=e,i=J.parse(e);if(i.length>5)return n;let s=J.createTransformer(e),o=typeof i[0]!="number"?1:0,a=r.x.scale*t.x,u=r.y.scale*t.y;i[0+o]/=a,i[1+o]/=u;let c=A(a,u,.5);return typeof i[2+o]=="number"&&(i[2+o]/=c),typeof i[3+o]=="number"&&(i[3+o]/=c),s(i)}};var Mr={borderRadius:{...Ft,applyTo:[...yr]},borderTopLeftRadius:Ft,borderTopRightRadius:Ft,borderBottomLeftRadius:Ft,borderBottomRightRadius:Ft,boxShadow:Fa};function Ar(e,{layout:t,layoutId:r}){return ge.has(e)||e.startsWith("origin")||(t||r!==void 0)&&(!!Mr[e]||e==="opacity")}function ht(e,t,r){var o;let n=e.style,i=t==null?void 0:t.style,s={};if(!n)return s;for(let a in n)(L(n[a])||i&&L(i[a])||Ar(a,e)||((o=r==null?void 0:r.getValue(a))==null?void 0:o.liveStyle)!==void 0)&&(s[a]=n[a]);return s}function vf(e){return window.getComputedStyle(e)}var Dr=class extends Bt{constructor(){super(...arguments),this.type="html",this.renderInstance=Gn}mount(t){ae(!!t.style,"motion.create() components must forward their ref to a HTML or SVG element","custom-component-ref"),super.mount(t)}readValueFromInstance(t,r){var n;if(ge.has(r))return(n=this.projection)!=null&&n.isProjecting?fn(r):Gs(t,r);{let i=vf(t),s=(tn(r)?i.getPropertyValue(r):i[r])||0;return typeof s=="string"?s.trim():s}}measureInstanceViewportBox(t,{transformPagePoint:r}){return zn(t,r)}build(t,r,n){pt(t,r,n.transformTemplate)}scrapeMotionValuesFromProps(t,r,n){return ht(t,r,n)}};var bf={offset:"stroke-dashoffset",array:"stroke-dasharray"},wf={offset:"strokeDashoffset",array:"strokeDasharray"};function ja(e,t,r=1,n=0,i=!0){e.pathLength=1;let s=i?bf:wf;e[s.offset]=`${-n}`,e[s.array]=`${t} ${r}`}var Tf=["offsetDistance","offsetPath","offsetRotate","offsetAnchor"];function kr(e,{attrX:t,attrY:r,attrScale:n,pathLength:i,pathSpacing:s=1,pathOffset:o=0,...a},u,c,l){var d,h;if(pt(e,a,c),u){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};let{attrs:f,style:m}=e;f.transform&&(m.transform=f.transform,delete f.transform),(m.transform||f.transformOrigin)&&(m.transformOrigin=(d=f.transformOrigin)!=null?d:"50% 50%",delete f.transformOrigin),m.transform&&(m.transformBox=(h=l==null?void 0:l.transformBox)!=null?h:"fill-box",delete f.transformBox);for(let g of Tf)f[g]!==void 0&&(m[g]=f[g],delete f[g]);t!==void 0&&(f.x=t),r!==void 0&&(f.y=r),n!==void 0&&(f.scale=n),i!==void 0&&ja(f,i,s,o,!1)}var Wn=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]);var Rr=e=>typeof e=="string"&&e.toLowerCase()==="svg";function za(e,t,r,n){Gn(e,t,void 0,n);for(let i in t.attrs)e.setAttribute(Wn.has(i)?i:Lt(i),t.attrs[i])}function Lr(e,t,r){let n=ht(e,t,r);for(let i in e)if(L(e[i])||L(t[i])){let s=Pe.indexOf(i)!==-1?"attr"+i.charAt(0).toUpperCase()+i.substring(1):i;n[s]=e[i]}return n}var Ir=class extends Bt{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=F}getBaseTargetFromProps(t,r){return t[r]}readValueFromInstance(t,r){if(ge.has(r)){let n=En(r);return n&&n.default||0}return r=Wn.has(r)?r:Lt(r),t.getAttribute(r)}scrapeMotionValuesFromProps(t,r,n){return Lr(t,r,n)}build(t,r,n){kr(t,r,this.isSVGTag,n.transformTemplate,n.style)}renderInstance(t,r,n,i){za(t,r,n,i)}mount(t){this.isSVGTag=Rr(t.tagName),super.mount(t)}};var Sf=br.length;function vo(e){if(!e)return;if(!e.isControllingVariants){let r=e.parent?vo(e.parent)||{}:{};return e.props.initial!==void 0&&(r.initial=e.props.initial),r}let t={};for(let r=0;r<Sf;r++){let n=br[r],i=e.props[n];(Ee(i)||i===!1)&&(t[n]=i)}return t}function bo(e,t){if(!Array.isArray(t))return!1;let r=t.length;if(r!==e.length)return!1;for(let n=0;n<r;n++)if(t[n]!==e[n])return!1;return!0}var Cf=[...On].reverse(),Vf=On.length;function Pf(e){return t=>Promise.all(t.map(({animation:r,options:n})=>ua(e,r,n)))}function wo(e){let t=Pf(e),r=Ga(),n=!0,i=!1,s=c=>(l,f)=>{var d;let m=ue(e,f,c==="exit"?(d=e.presenceContext)==null?void 0:d.custom:void 0);if(m){let{transition:h,transitionEnd:g,...x}=m;l={...l,...x,...g}}return l};function o(c){t=c(e)}function a(c){let{props:l}=e,f=vo(e.parent)||{},m=[],d=new Set,h={},g=1/0;for(let y=0;y<Vf;y++){let T=Cf[y],w=r[T],v=l[T]!==void 0?l[T]:f[T],C=Ee(v),D=T===c?w.isActive:null;D===!1&&(g=y);let V=v===f[T]&&v!==l[T]&&C;if(V&&(n||i)&&e.manuallyAnimateOnMount&&(V=!1),w.protectedKeys={...h},!w.isActive&&D===null||!v&&!w.prevProp||Be(v)||typeof v=="boolean")continue;if(T==="exit"&&w.isActive&&D!==!0){w.prevResolvedValues&&(h={...h,...w.prevResolvedValues});continue}let P=Wa(w.prevProp,v),H=P||T===c&&w.isActive&&!V&&C||y>g&&C,E=!1,O=Array.isArray(v)?v:[v],I=O.reduce(s(T),{});D===!1&&(I={});let{prevResolvedValues:de={}}=w,Y={...de,...I},k=q=>{H=!0,d.has(q)&&(E=!0,d.delete(q)),w.needsAnimating[q]=!0;let j=e.getValue(q);j&&(j.liveStyle=!1)};for(let q in Y){let j=I[q],Te=de[q];if(h.hasOwnProperty(q))continue;let ke=!1;pr(j)&&pr(Te)?ke=!bo(j,Te)||P:ke=j!==Te,ke?j!=null?k(q):d.add(q):j!==void 0&&d.has(q)?k(q):w.protectedKeys[q]=!0}w.prevProp=v,w.prevResolvedValues=I,w.isActive&&(h={...h,...I}),(n||i)&&e.blockInitialAnimation&&(H=!1);let N=V&&P;H&&(!N||E)&&m.push(...O.map(q=>{let j={type:T};if(typeof q=="string"&&(n||i)&&!N&&e.manuallyAnimateOnMount&&e.parent){let{parent:Te}=e,ke=ue(Te,q);if(Te.enteringChildren&&ke){let{delayChildren:Si}=ke.transition||{};j.delay=bn(Te.enteringChildren,e,Si)}}return{animation:q,options:j}}))}if(d.size){let y={};if(typeof l.initial!="boolean"){let T=ue(e,Array.isArray(l.initial)?l.initial[0]:l.initial);T&&T.transition&&(y.transition=T.transition)}d.forEach(T=>{let w=e.getBaseTarget(T),v=e.getValue(T);v&&(v.liveStyle=!0),y[T]=w!=null?w:null}),m.push({animation:y})}let x=!!m.length;return n&&(l.initial===!1||l.initial===l.animate)&&!e.manuallyAnimateOnMount&&(x=!1),n=!1,i=!1,x?t(m):Promise.resolve()}function u(c,l){var m;if(r[c].isActive===l)return Promise.resolve();(m=e.variantChildren)==null||m.forEach(d=>{var h;return(h=d.animationState)==null?void 0:h.setActive(c,l)}),r[c].isActive=l;let f=a(c);for(let d in r)r[d].protectedKeys={};return f}return{animateChanges:a,setActive:u,setAnimateFunction:o,getState:()=>r,reset:()=>{r=Ga(),i=!0}}}function Wa(e,t){return typeof t=="string"?t!==e:Array.isArray(t)?!bo(t,e):!1}function gt(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function Ga(){return{animate:gt(!0),whileInView:gt(),whileHover:gt(),whileTap:gt(),whileDrag:gt(),whileFocus:gt(),exit:gt()}}function Un(e,t){e.min=t.min,e.max=t.max}function ve(e,t){Un(e.x,t.x),Un(e.y,t.y)}function To(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}var Ua=1e-4,Ef=1-Ua,Mf=1+Ua,Ha=.01,Af=0-Ha,Df=0+Ha;function $(e){return e.max-e.min}function Po(e,t,r){return Math.abs(e-t)<=r}function So(e,t,r,n=.5){e.origin=n,e.originPoint=A(t.min,t.max,e.origin),e.scale=$(r)/$(t),e.translate=A(r.min,r.max,e.origin)-e.originPoint,(e.scale>=Ef&&e.scale<=Mf||isNaN(e.scale))&&(e.scale=1),(e.translate>=Af&&e.translate<=Df||isNaN(e.translate))&&(e.translate=0)}function xt(e,t,r,n){So(e.x,t.x,r.x,n?n.originX:void 0),So(e.y,t.y,r.y,n?n.originY:void 0)}function Co(e,t,r,n=0){let i=n?A(r.min,r.max,n):r.min;e.min=i+t.min,e.max=e.min+$(t)}function Eo(e,t,r,n){Co(e.x,t.x,r.x,n==null?void 0:n.x),Co(e.y,t.y,r.y,n==null?void 0:n.y)}function Vo(e,t,r,n=0){let i=n?A(r.min,r.max,n):r.min;e.min=t.min-i,e.max=e.min+$(t)}function jt(e,t,r,n){Vo(e.x,t.x,r.x,n==null?void 0:n.x),Vo(e.y,t.y,r.y,n==null?void 0:n.y)}function Ka(e,t,r,n,i){return e-=t,e=Pr(e,1/r,n),i!==void 0&&(e=Pr(e,1/i,n)),e}function kf(e,t=0,r=1,n=.5,i,s=e,o=e){if(ne.test(t)&&(t=parseFloat(t),t=A(o.min,o.max,t/100)-o.min),typeof t!="number")return;let a=A(s.min,s.max,n);e===s&&(a-=t),e.min=Ka(e.min,t,r,a,i),e.max=Ka(e.max,t,r,a,i)}function _a(e,t,[r,n,i],s,o){kf(e,t[r],t[n],t[i],t.scale,s,o)}var Rf=["x","scaleX","originX"],Lf=["y","scaleY","originY"];function Mo(e,t,r,n){_a(e.x,t,Rf,r?r.x:void 0,n?n.x:void 0),_a(e.y,t,Lf,r?r.y:void 0,n?n.y:void 0)}function Ya(e){return e.translate===0&&e.scale===1}function Ao(e){return Ya(e.x)&&Ya(e.y)}function $a(e,t){return e.min===t.min&&e.max===t.max}function qa(e,t){return $a(e.x,t.x)&&$a(e.y,t.y)}function Xa(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function Do(e,t){return Xa(e.x,t.x)&&Xa(e.y,t.y)}function ko(e){return $(e.x)/$(e.y)}function Ro(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}function fe(e){return[e("x"),e("y")]}function Za(e,t,r){let n="",i=e.x.translate/t.x,s=e.y.translate/t.y,o=(r==null?void 0:r.z)||0;if((i||s||o)&&(n=`translate3d(${i}px, ${s}px, ${o}px) `),(t.x!==1||t.y!==1)&&(n+=`scale(${1/t.x}, ${1/t.y}) `),r){let{transformPerspective:c,rotate:l,pathRotation:f,rotateX:m,rotateY:d,skewX:h,skewY:g}=r;c&&(n=`perspective(${c}px) ${n}`),l&&(n+=`rotate(${l}deg) `),f&&(n+=`rotate(${f}deg) `),m&&(n+=`rotateX(${m}deg) `),d&&(n+=`rotateY(${d}deg) `),h&&(n+=`skewX(${h}deg) `),g&&(n+=`skewY(${g}deg) `)}let a=e.x.scale*t.x,u=e.y.scale*t.y;return(a!==1||u!==1)&&(n+=`scale(${a}, ${u})`),n||"none"}var If=yr.length,Ja=e=>typeof e=="string"?parseFloat(e):e,Qa=e=>typeof e=="number"||S.test(e);function tl(e,t,r,n,i,s){var o,a,u,c;i?(e.opacity=A(0,(o=r.opacity)!=null?o:1,Nf(n)),e.opacityExit=A((a=t.opacity)!=null?a:1,0,Of(n))):s&&(e.opacity=A((u=t.opacity)!=null?u:1,(c=r.opacity)!=null?c:1,n));for(let l=0;l<If;l++){let f=yr[l],m=el(t,f),d=el(r,f);if(m===void 0&&d===void 0)continue;m||(m=0),d||(d=0),m===0||d===0||Qa(m)===Qa(d)?(e[f]=Math.max(A(Ja(m),Ja(d),n),0),(ne.test(d)||ne.test(m))&&(e[f]+="%")):e[f]=d}(t.rotate||r.rotate)&&(e.rotate=A(t.rotate||0,r.rotate||0,n))}function el(e,t){return e[t]!==void 0?e[t]:e.borderRadius}var Nf=rl(0,.5,nr),Of=rl(.5,.95,G);function rl(e,t,r){return n=>n<e?0:n>t?1:r(Se(e,t,n))}function nl(e,t,r){let n=L(e)?e:we(e);return n.start(lt("",n,t,r)),n.animation}function Me(e,t,r,n={passive:!0}){return e.addEventListener(t,r,n),()=>e.removeEventListener(t,r,n)}var il=(e,t)=>e.depth-t.depth;var Hn=class{constructor(){this.children=[],this.isDirty=!1}add(t){nt(this.children,t),this.isDirty=!0}remove(t){Ge(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(il),this.isDirty=!1,this.children.forEach(t)}};function ol(e,t){let r=W.now(),n=({timestamp:i})=>{let s=i-r;s>=t&&(le(n),e(s-t))};return M.setup(n,!0),()=>le(n)}function yt(e){return L(e)?e.get():e}var Kn=class{constructor(){this.members=[]}add(t){nt(this.members,t);for(let r=this.members.length-1;r>=0;r--){let n=this.members[r];if(n===t||n===this.lead||n===this.prevLead)continue;let i=n.instance;(!i||i.isConnected===!1)&&!n.snapshot&&(Ge(this.members,n),n.unmount())}t.scheduleRender()}remove(t){if(Ge(this.members,t),t===this.prevLead&&(this.prevLead=void 0),t===this.lead){let r=this.members[this.members.length-1];r&&this.promote(r)}}relegate(t){var r;for(let n=this.members.indexOf(t)-1;n>=0;n--){let i=this.members[n];if(i.isPresent!==!1&&((r=i.instance)==null?void 0:r.isConnected)!==!1)return this.promote(i),!0}return!1}promote(t,r){var i;let n=this.lead;if(t!==n&&(this.prevLead=n,this.lead=t,t.show(),n)){n.updateSnapshot(),t.scheduleRender();let{layoutDependency:s}=n.options,{layoutDependency:o}=t.options;(s===void 0||s!==o)&&(t.resumeFrom=n,r&&(n.preserveOpacity=!0),n.snapshot&&(t.snapshot=n.snapshot,t.snapshot.latestValues=n.animationValues||n.latestValues),(i=t.root)!=null&&i.isUpdating&&(t.isLayoutDirty=!0)),t.options.crossfade===!1&&n.hide()}}exitAnimationComplete(){this.members.forEach(t=>{var r,n,i,s,o;(n=(r=t.options).onExitComplete)==null||n.call(r),(o=(i=t.resumingFrom)==null?void 0:(s=i.options).onExitComplete)==null||o.call(s)})}scheduleRender(){this.members.forEach(t=>t.instance&&t.scheduleRender(!1))}removeLeadSnapshot(){var t;(t=this.lead)!=null&&t.snapshot&&(this.lead.snapshot=void 0)}};var vt={hasAnimatedSinceResize:!0,hasEverUpdated:!1};var bt={nodes:0,calculatedTargetDeltas:0,calculatedProjections:0},Lo=["","X","Y","Z"],Bf=1e3,Ff=0;function Io(e,t,r,n){let{latestValues:i}=t;i[e]&&(r[e]=i[e],t.setStaticValue(e,0),n&&(n[e]=0))}function pl(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;let{visualElement:t}=e.options;if(!t)return;let r=Sn(t);if(window.MotionHasOptimisedAnimation(r,"transform")){let{layout:i,layoutId:s}=e.options;window.MotionCancelOptimisedAnimation(r,"transform",M,!(i||s))}let{parent:n}=e;n&&!n.hasCheckedOptimisedAppear&&pl(n)}function _n({attachResizeListener:e,defaultParent:t,measureScroll:r,checkIsScrollRoot:n,resetTransform:i}){return class{constructor(o={},a=t==null?void 0:t()){this.id=Ff++,this.animationId=0,this.animationCommitId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.layoutVersion=0,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,dt.value&&(bt.nodes=bt.calculatedTargetDeltas=bt.calculatedProjections=0),this.nodes.forEach(Gf),this.nodes.forEach(Yf),this.nodes.forEach($f),this.nodes.forEach(Wf),dt.addProjectionMetrics&&dt.addProjectionMetrics(bt)},this.resolvedRelativeTargetAt=0,this.linkedParentVersion=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=o,this.root=a?a.root||a:this,this.path=a?[...a.path,a]:[],this.parent=a,this.depth=a?a.depth+1:0;for(let u=0;u<this.path.length;u++)this.path[u].shouldResetTransform=!0;this.root===this&&(this.nodes=new Hn)}addEventListener(o,a){return this.eventHandlers.has(o)||this.eventHandlers.set(o,new Le),this.eventHandlers.get(o).add(a)}notifyListeners(o,...a){let u=this.eventHandlers.get(o);u&&u.notify(...a)}hasListeners(o){return this.eventHandlers.has(o)}mount(o){if(this.instance)return;this.isSVG=Nt(o)&&!Sa(o),this.instance=o;let{layoutId:a,layout:u,visualElement:c}=this.options;if(c&&!c.current&&c.mount(o),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),this.root.hasTreeAnimated&&(u||a)&&(this.isLayoutDirty=!0),e){let l,f=0,m=()=>this.root.updateBlockedByResize=!1;M.read(()=>{f=window.innerWidth}),e(o,()=>{let d=window.innerWidth;d!==f&&(f=d,this.root.updateBlockedByResize=!0,l&&l(),l=ol(m,250),vt.hasAnimatedSinceResize&&(vt.hasAnimatedSinceResize=!1,this.nodes.forEach(ll)))})}a&&this.root.registerSharedNode(a,this),this.options.animate!==!1&&c&&(a||u)&&this.addEventListener("didUpdate",({delta:l,hasLayoutChanged:f,hasRelativeLayoutChanged:m,layout:d})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}let h=this.options.transition||c.getDefaultTransition()||Qf,{onLayoutAnimationStart:g,onLayoutAnimationComplete:x}=c.getProps(),y=!this.targetLayout||!Do(this.targetLayout,d),T=!f&&m;if(this.options.layoutRoot||this.resumeFrom||T||f&&(y||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);let w={...kt(h,"layout"),onPlay:g,onComplete:x};(c.shouldReduceMotion||this.options.layoutRoot)&&(w.delay=0,w.type=!1),this.startAnimation(w),this.setAnimationOrigin(l,T,w.path)}else f||ll(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=d})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);let o=this.getStack();o&&o.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),le(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(Xf),this.animationId++)}getTransformTemplate(){let{visualElement:o}=this.options;return o&&o.getProps().transformTemplate}willUpdate(o=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&pl(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let l=0;l<this.path.length;l++){let f=this.path[l];f.shouldResetTransform=!0,(typeof f.latestValues.x=="string"||typeof f.latestValues.y=="string")&&(f.isLayoutDirty=!0),f.updateScroll("snapshot"),f.options.layoutRoot&&f.willUpdate(!1)}let{layoutId:a,layout:u}=this.options;if(a===void 0&&!u)return;let c=this.getTransformTemplate();this.prevTransformTemplateValue=c?c(this.latestValues,""):void 0,this.updateSnapshot(),o&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){let u=this.updateBlockedByResize;this.unblockUpdate(),this.updateBlockedByResize=!1,this.clearAllSnapshots(),u&&this.nodes.forEach(Hf),this.nodes.forEach(sl);return}if(this.animationId<=this.animationCommitId){this.nodes.forEach(al);return}this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(Kf),this.nodes.forEach(_f),this.nodes.forEach(jf),this.nodes.forEach(zf)):this.nodes.forEach(al),this.clearAllSnapshots();let a=W.now();K.delta=Z(0,1e3/60,a-K.timestamp),K.timestamp=a,K.isProcessing=!0,lr.update.process(K),lr.preRender.process(K),lr.render.process(K),K.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,ft.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(Uf),this.sharedNodes.forEach(qf)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,M.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){M.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!$(this.snapshot.measuredBox.x)&&!$(this.snapshot.measuredBox.y)&&(this.snapshot=void 0))}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let u=0;u<this.path.length;u++)this.path[u].updateScroll();let o=this.layout;this.layout=this.measure(!1),this.layoutVersion++,this.layoutCorrected||(this.layoutCorrected=F()),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);let{visualElement:a}=this.options;a&&a.notify("LayoutMeasure",this.layout.layoutBox,o?o.layoutBox:void 0)}updateScroll(o="measure"){let a=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===o&&(a=!1),a&&this.instance){let u=n(this.instance);this.scroll={animationId:this.root.animationId,phase:o,isRoot:u,offset:r(this.instance),wasRoot:this.scroll?this.scroll.isRoot:u}}}resetTransform(){if(!i)return;let o=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,a=this.projectionDelta&&!Ao(this.projectionDelta),u=this.getTransformTemplate(),c=u?u(this.latestValues,""):void 0,l=c!==this.prevTransformTemplateValue;o&&this.instance&&(a||Fe(this.latestValues)||l)&&(i(this.instance,c),this.shouldResetTransform=!1,this.scheduleRender())}measure(o=!0){let a=this.measurePageBox(),u=this.removeElementScroll(a);return o&&(u=this.removeTransform(u)),em(u),{animationId:this.root.animationId,measuredBox:a,layoutBox:u,latestValues:{},source:this.id}}measurePageBox(){var c;let{visualElement:o}=this.options;if(!o)return F();let a=o.measureViewportBox();if(!(((c=this.scroll)==null?void 0:c.wasRoot)||this.path.some(tm))){let{scroll:l}=this.root;l&&(ye(a.x,l.offset.x),ye(a.y,l.offset.y))}return a}removeElementScroll(o){var u;let a=F();if(ve(a,o),(u=this.scroll)!=null&&u.wasRoot)return a;for(let c=0;c<this.path.length;c++){let l=this.path[c],{scroll:f,options:m}=l;l!==this.root&&f&&m.layoutScroll&&(f.wasRoot&&ve(a,o),ye(a.x,f.offset.x),ye(a.y,f.offset.y))}return a}applyTransform(o,a=!1,u){var l,f;let c=u||F();ve(c,o);for(let m=0;m<this.path.length;m++){let d=this.path[m];!a&&d.options.layoutScroll&&d.scroll&&d!==d.root&&(ye(c.x,-d.scroll.offset.x),ye(c.y,-d.scroll.offset.y)),Fe(d.latestValues)&&Er(c,d.latestValues,(l=d.layout)==null?void 0:l.layoutBox)}return Fe(this.latestValues)&&Er(c,this.latestValues,(f=this.layout)==null?void 0:f.layoutBox),c}removeTransform(o){var u;let a=F();ve(a,o);for(let c=0;c<this.path.length;c++){let l=this.path[c];if(!Fe(l.latestValues))continue;let f;l.instance&&(jn(l.latestValues)&&l.updateSnapshot(),f=F(),ve(f,l.measurePageBox())),Mo(a,l.latestValues,(u=l.snapshot)==null?void 0:u.layoutBox,f)}return Fe(this.latestValues)&&Mo(a,this.latestValues),a}setTargetDelta(o){this.targetDelta=o,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(o){this.options={...this.options,...o,crossfade:o.crossfade!==void 0?o.crossfade:!0}}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==K.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(o=!1){var d;let a=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=a.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=a.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=a.isSharedProjectionDirty);let u=!!this.resumingFrom||this!==a;if(!(o||u&&this.isSharedProjectionDirty||this.isProjectionDirty||(d=this.parent)!=null&&d.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;let{layout:l,layoutId:f}=this.options;if(!this.layout||!(l||f))return;this.resolvedRelativeTargetAt=K.timestamp;let m=this.getClosestProjectingParent();m&&this.linkedParentVersion!==m.layoutVersion&&!m.options.layoutRoot&&this.removeRelativeTarget(),!this.targetDelta&&!this.relativeTarget&&(this.options.layoutAnchor!==!1&&m&&m.layout?this.createRelativeTarget(m,this.layout.layoutBox,m.layout.layoutBox):this.removeRelativeTarget()),!(!this.relativeTarget&&!this.targetDelta)&&(this.target||(this.target=F(),this.targetWithTransforms=F()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),Eo(this.target,this.relativeTarget,this.relativeParent.target,this.options.layoutAnchor||void 0)):this.targetDelta?(this.resumingFrom?this.applyTransform(this.layout.layoutBox,!1,this.target):ve(this.target,this.layout.layoutBox),xo(this.target,this.targetDelta)):ve(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget&&(this.attemptToResolveRelativeTarget=!1,this.options.layoutAnchor!==!1&&m&&!!m.resumingFrom==!!this.resumingFrom&&!m.options.layoutScroll&&m.target&&this.animationProgress!==1?this.createRelativeTarget(m,this.target,m.target):this.relativeParent=this.relativeTarget=void 0),dt.value&&bt.calculatedTargetDeltas++)}getClosestProjectingParent(){if(!(!this.parent||jn(this.parent.latestValues)||ho(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}createRelativeTarget(o,a,u){this.relativeParent=o,this.linkedParentVersion=o.layoutVersion,this.forceRelativeParentToResolveTarget(),this.relativeTarget=F(),this.relativeTargetOrigin=F(),jt(this.relativeTargetOrigin,a,u,this.options.layoutAnchor||void 0),ve(this.relativeTarget,this.relativeTargetOrigin)}removeRelativeTarget(){this.relativeParent=this.relativeTarget=void 0}calcProjection(){var h;let o=this.getLead(),a=!!this.resumingFrom||this!==o,u=!0;if((this.isProjectionDirty||(h=this.parent)!=null&&h.isProjectionDirty)&&(u=!1),a&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(u=!1),this.resolvedRelativeTargetAt===K.timestamp&&(u=!1),u)return;let{layout:c,layoutId:l}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(c||l))return;ve(this.layoutCorrected,this.layout.layoutBox);let f=this.treeScale.x,m=this.treeScale.y;Na(this.layoutCorrected,this.treeScale,this.path,a),o.layout&&!o.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(o.target=o.layout.layoutBox,o.targetWithTransforms=F());let{target:d}=o;if(!d){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(To(this.prevProjectionDelta.x,this.projectionDelta.x),To(this.prevProjectionDelta.y,this.projectionDelta.y)),xt(this.projectionDelta,this.layoutCorrected,d,this.latestValues),(this.treeScale.x!==f||this.treeScale.y!==m||!Ro(this.projectionDelta.x,this.prevProjectionDelta.x)||!Ro(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",d)),dt.value&&bt.calculatedProjections++}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(o=!0){var a;if((a=this.options.visualElement)==null||a.scheduleRender(),o){let u=this.getStack();u&&u.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=qe(),this.projectionDelta=qe(),this.projectionDeltaWithTransform=qe()}setAnimationOrigin(o,a=!1,u){let c=this.snapshot,l=c?c.latestValues:{},f={...this.latestValues},m=qe();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!a;let d=F(),h=c?c.source:void 0,g=this.layout?this.layout.source:void 0,x=h!==g,y=this.getStack(),T=!y||y.members.length<=1,w=!!(x&&!T&&this.options.crossfade===!0&&!this.path.some(Jf));this.animationProgress=0;let v,C=u==null?void 0:u.interpolateProjection(o);this.mixTargetDelta=D=>{let V=D/1e3,P=C==null?void 0:C(V);P?(m.x.translate=P.x,m.x.scale=A(o.x.scale,1,V),m.x.origin=o.x.origin,m.x.originPoint=o.x.originPoint,m.y.translate=P.y,m.y.scale=A(o.y.scale,1,V),m.y.origin=o.y.origin,m.y.originPoint=o.y.originPoint):(cl(m.x,o.x,V),cl(m.y,o.y,V)),this.setTargetDelta(m),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(jt(d,this.layout.layoutBox,this.relativeParent.layout.layoutBox,this.options.layoutAnchor||void 0),Zf(this.relativeTarget,this.relativeTargetOrigin,d,V),v&&qa(this.relativeTarget,v)&&(this.isProjectionDirty=!1),v||(v=F()),ve(v,this.relativeTarget)),x&&(this.animationValues=f,tl(f,l,this.latestValues,V,w,T)),P&&P.rotate!==void 0&&(this.animationValues||(this.animationValues=f),this.animationValues.pathRotation=P.rotate),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=V},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(o){var a,u,c;this.notifyListeners("animationStart"),(a=this.currentAnimation)==null||a.stop(),(c=(u=this.resumingFrom)==null?void 0:u.currentAnimation)==null||c.stop(),this.pendingAnimation&&(le(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=M.update(()=>{vt.hasAnimatedSinceResize=!0,this.motionValue||(this.motionValue=we(0)),this.motionValue.jump(0,!1),this.currentAnimation=nl(this.motionValue,[0,1e3],{...o,velocity:0,isSync:!0,onUpdate:l=>{this.mixTargetDelta(l),o.onUpdate&&o.onUpdate(l)},onComplete:()=>{o.onComplete&&o.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);let o=this.getStack();o&&o.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(Bf),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){let o=this.getLead(),{targetWithTransforms:a,target:u,layout:c,latestValues:l}=o;if(!(!a||!u||!c)){if(this!==o&&this.layout&&c&&hl(this.options.animationType,this.layout.layoutBox,c.layoutBox)){u=this.target||F();let f=$(this.layout.layoutBox.x);u.x.min=o.target.x.min,u.x.max=u.x.min+f;let m=$(this.layout.layoutBox.y);u.y.min=o.target.y.min,u.y.max=u.y.min+m}ve(a,u),Er(a,l),xt(this.projectionDeltaWithTransform,this.layoutCorrected,a,l)}}registerSharedNode(o,a){this.sharedNodes.has(o)||this.sharedNodes.set(o,new Kn),this.sharedNodes.get(o).add(a);let c=a.options.initialPromotionConfig;a.promote({transition:c?c.transition:void 0,preserveFollowOpacity:c&&c.shouldPreserveFollowOpacity?c.shouldPreserveFollowOpacity(a):void 0})}isLead(){let o=this.getStack();return o?o.lead===this:!0}getLead(){var a;let{layoutId:o}=this.options;return o?((a=this.getStack())==null?void 0:a.lead)||this:this}getPrevLead(){var a;let{layoutId:o}=this.options;return o?(a=this.getStack())==null?void 0:a.prevLead:void 0}getStack(){let{layoutId:o}=this.options;if(o)return this.root.sharedNodes.get(o)}promote({needsReset:o,transition:a,preserveFollowOpacity:u}={}){let c=this.getStack();c&&c.promote(this,u),o&&(this.projectionDelta=void 0,this.needsReset=!0),a&&this.setOptions({transition:a})}relegate(){let o=this.getStack();return o?o.relegate(this):!1}resetSkewAndRotation(){let{visualElement:o}=this.options;if(!o)return;let a=!1,{latestValues:u}=o;if((u.z||u.rotate||u.rotateX||u.rotateY||u.rotateZ||u.skewX||u.skewY)&&(a=!0),!a)return;let c={};u.z&&Io("z",o,c,this.animationValues);for(let l=0;l<Lo.length;l++)Io(`rotate${Lo[l]}`,o,c,this.animationValues),Io(`skew${Lo[l]}`,o,c,this.animationValues);o.render();for(let l in c)o.setStaticValue(l,c[l]),this.animationValues&&(this.animationValues[l]=c[l]);o.scheduleRender()}applyProjectionStyles(o,a){var h,g;if(!this.instance||this.isSVG)return;if(!this.isVisible){o.visibility="hidden";return}let u=this.getTransformTemplate();if(this.needsReset){this.needsReset=!1,o.visibility="",o.opacity="",o.pointerEvents=yt(a==null?void 0:a.pointerEvents)||"",o.transform=u?u(this.latestValues,""):"none";return}let c=this.getLead();if(!this.projectionDelta||!this.layout||!c.target){this.options.layoutId&&(o.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,o.pointerEvents=yt(a==null?void 0:a.pointerEvents)||""),this.hasProjected&&!Fe(this.latestValues)&&(o.transform=u?u({},""):"none",this.hasProjected=!1);return}o.visibility="";let l=c.animationValues||c.latestValues;this.applyTransformsToTarget();let f=Za(this.projectionDeltaWithTransform,this.treeScale,l);u&&(f=u(l,f)),o.transform=f;let{x:m,y:d}=this.projectionDelta;o.transformOrigin=`${m.origin*100}% ${d.origin*100}% 0`,c.animationValues?o.opacity=c===this?(g=(h=l.opacity)!=null?h:this.latestValues.opacity)!=null?g:1:this.preserveOpacity?this.latestValues.opacity:l.opacityExit:o.opacity=c===this?l.opacity!==void 0?l.opacity:"":l.opacityExit!==void 0?l.opacityExit:0;for(let x in Mr){if(l[x]===void 0)continue;let{correct:y,applyTo:T,isCSSVariable:w}=Mr[x],v=f==="none"?l[x]:y(l[x],c);if(T){let C=T.length;for(let D=0;D<C;D++)o[T[D]]=v}else w?this.options.visualElement.renderState.vars[x]=v:o[x]=v}this.options.layoutId&&(o.pointerEvents=c===this?yt(a==null?void 0:a.pointerEvents)||"":"none")}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(o=>{var a;return(a=o.currentAnimation)==null?void 0:a.stop()}),this.root.nodes.forEach(sl),this.root.sharedNodes.clear()}}}function jf(e){e.updateLayout()}function zf(e){var r;let t=((r=e.resumeFrom)==null?void 0:r.snapshot)||e.snapshot;if(e.isLead()&&e.layout&&t&&e.hasListeners("didUpdate")){let{layoutBox:n,measuredBox:i}=e.layout,{animationType:s}=e.options,o=t.source!==e.layout.source;if(s==="size")fe(f=>{let m=o?t.measuredBox[f]:t.layoutBox[f],d=$(m);m.min=n[f].min,m.max=m.min+d});else if(s==="x"||s==="y"){let f=s==="x"?"y":"x";Un(o?t.measuredBox[f]:t.layoutBox[f],n[f])}else hl(s,t.layoutBox,n)&&fe(f=>{let m=o?t.measuredBox[f]:t.layoutBox[f],d=$(n[f]);m.max=m.min+d,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[f].max=e.relativeTarget[f].min+d)});let a=qe();xt(a,n,t.layoutBox);let u=qe();o?xt(u,e.applyTransform(i,!0),t.measuredBox):xt(u,n,t.layoutBox);let c=!Ao(a),l=!1;if(!e.resumeFrom){let f=e.getClosestProjectingParent();if(f&&!f.resumeFrom){let{snapshot:m,layout:d}=f;if(m&&d){let h=e.options.layoutAnchor||void 0,g=F();jt(g,t.layoutBox,m.layoutBox,h);let x=F();jt(x,n,d.layoutBox,h),Do(g,x)||(l=!0),f.options.layoutRoot&&(e.relativeTarget=x,e.relativeTargetOrigin=g,e.relativeParent=f)}}}e.notifyListeners("didUpdate",{layout:n,snapshot:t,delta:u,layoutDelta:a,hasLayoutChanged:c,hasRelativeLayoutChanged:l})}else if(e.isLead()){let{onExitComplete:n}=e.options;n&&n()}e.options.transition=void 0}function Gf(e){dt.value&&bt.nodes++,e.parent&&(e.isProjecting()||(e.isProjectionDirty=e.parent.isProjectionDirty),e.isSharedProjectionDirty||(e.isSharedProjectionDirty=!!(e.isProjectionDirty||e.parent.isProjectionDirty||e.parent.isSharedProjectionDirty)),e.isTransformDirty||(e.isTransformDirty=e.parent.isTransformDirty))}function Wf(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function Uf(e){e.clearSnapshot()}function sl(e){e.clearMeasurements()}function Hf(e){e.isLayoutDirty=!0,e.updateLayout()}function al(e){e.isLayoutDirty=!1}function Kf(e){e.isAnimationBlocked&&e.layout&&!e.isLayoutDirty&&(e.snapshot=e.layout,e.isLayoutDirty=!0)}function _f(e){let{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function ll(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function Yf(e){e.resolveTargetDelta()}function $f(e){e.calcProjection()}function Xf(e){e.resetSkewAndRotation()}function qf(e){e.removeLeadSnapshot()}function cl(e,t,r){e.translate=A(t.translate,0,r),e.scale=A(t.scale,1,r),e.origin=t.origin,e.originPoint=t.originPoint}function ul(e,t,r,n){e.min=A(t.min,r.min,n),e.max=A(t.max,r.max,n)}function Zf(e,t,r,n){ul(e.x,t.x,r.x,n),ul(e.y,t.y,r.y,n)}function Jf(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}var Qf={duration:.45,ease:[.4,0,.1,1]},fl=e=>typeof navigator!="undefined"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),ml=fl("applewebkit/")&&!fl("chrome/")?Math.round:G;function dl(e){e.min=ml(e.min),e.max=ml(e.max)}function em(e){dl(e.x),dl(e.y)}function hl(e,t,r){return e==="position"||e==="preserve-aspect"&&!Po(ko(t),ko(r),.2)}function tm(e){var t;return e!==e.root&&((t=e.scroll)==null?void 0:t.wasRoot)}var gl=_n({attachResizeListener:(e,t)=>Me(e,"resize",t),measureScroll:()=>{var e,t;return{x:document.documentElement.scrollLeft||((e=document.body)==null?void 0:e.scrollLeft)||0,y:document.documentElement.scrollTop||((t=document.body)==null?void 0:t.scrollTop)||0}},checkIsScrollRoot:()=>!0});var Yn={current:void 0},Nr=_n({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!Yn.current){let e=new gl({});e.mount(window),e.setOptions({layoutScroll:!0}),Yn.current=e}return Yn.current},resetTransform:(e,t)=>{e.style.transform=t!==void 0?t:"none"},checkIsScrollRoot:e=>window.getComputedStyle(e).position==="fixed"});var xl=require("react"),$n=(0,xl.createContext)({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"});var Je=require("react");function yl(e=!0){let t=(0,Je.useContext)(Tt);if(t===null)return[!0,null];let{isPresent:r,onExitComplete:n,register:i}=t,s=(0,Je.useId)();(0,Je.useEffect)(()=>{if(e)return i(s)},[e]);let o=(0,Je.useCallback)(()=>e&&n&&n(s),[s,n,e]);return!r&&n?[!1,o]:[!0]}var vl=require("react"),Xn=(0,vl.createContext)({strict:!1});var bl={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]},wl=!1;function rm(){if(wl)return;let e={};for(let t in bl)e[t]={isEnabled:r=>bl[t].some(n=>!!r[n])};Cr(e),wl=!0}function qn(){return rm(),uo()}function Tl(e){let t=qn();for(let r in e)t[r]={...t[r],...e[r]};Cr(t)}var nm=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","propagate","ignoreStrict","viewport"]);function Or(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||nm.has(e)}var Sl=e=>!Or(e);function im(e){typeof e=="function"&&(Sl=t=>t.startsWith("on")?!Or(t):e(t))}try{im(require("@emotion/is-prop-valid").default)}catch(e){}function Cl(e,t,r){let n={};for(let i in e)i==="values"&&typeof e.values=="object"||L(e[i])||(Sl(i)||r===!0&&Or(i)||!t&&!Or(i)||e.draggable&&i.startsWith("onDrag"))&&(n[i]=e[i]);return n}var ti=require("react/jsx-runtime");var Ut=require("react");var Vl=require("react"),Qe=(0,Vl.createContext)({});var Zn=require("react");function Pl(e,t){if(Ze(e)){let{initial:r,animate:n}=e;return{initial:r===!1||Ee(r)?r:void 0,animate:Ee(n)?n:void 0}}return e.inherit!==!1?t:{}}function Ml(e){let{initial:t,animate:r}=Pl(e,(0,Zn.useContext)(Qe));return(0,Zn.useMemo)(()=>({initial:t,animate:r}),[El(t),El(r)])}function El(e){return Array.isArray(e)?e.join(" "):e}var Wt=require("react");var Al=require("react");var zt=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function No(e,t,r){for(let n in t)!L(t[n])&&!Ar(n,r)&&(e[n]=t[n])}function om({transformTemplate:e},t){return(0,Al.useMemo)(()=>{let r=zt();return pt(r,t,e),Object.assign({},r.vars,r.style)},[t])}function sm(e,t){let r=e.style||{},n={};return No(n,r,e),Object.assign(n,om(e,t)),n}function Dl(e,t){let r={},n=sm(e,t);return e.drag&&e.dragListener!==!1&&(r.draggable=!1,n.userSelect=n.WebkitUserSelect=n.WebkitTouchCallout="none",n.touchAction=e.drag===!0?"none":`pan-${e.drag==="x"?"y":"x"}`),e.tabIndex===void 0&&(e.onTap||e.onTapStart||e.whileTap)&&(r.tabIndex=0),r.style=n,r}var kl=require("react");var Jn=()=>({...zt(),attrs:{}});function Rl(e,t,r,n){let i=(0,kl.useMemo)(()=>{let s=Jn();return kr(s,t,Rr(n),e.transformTemplate,e.style),{...s.attrs,style:{...s.style}}},[t]);if(e.style){let s={};No(s,e.style,e),i.style={...s,...i.style}}return i}var Ll=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function Gt(e){return typeof e!="string"||e.includes("-")?!1:!!(Ll.indexOf(e)>-1||/[A-Z]/u.test(e))}function Il(e,t,r,{latestValues:n},i,s=!1,o){let u=((o!=null?o:Gt(e))?Rl:Dl)(t,n,i,e),c=Cl(t,typeof e=="string",s),l=e!==Wt.Fragment?{...c,...u,ref:r}:{},{children:f}=t,m=(0,Wt.useMemo)(()=>L(f)?f.get():f,[f]);return(0,Wt.createElement)(e,{...l,children:m})}var Oo=require("react");function am({scrapeMotionValuesFromProps:e,createRenderState:t},r,n,i){return{latestValues:lm(r,n,i,e),renderState:t()}}function lm(e,t,r,n){let i={},s=n(e,{});for(let m in s)i[m]=yt(s[m]);let{initial:o,animate:a}=e,u=Ze(e),c=wr(e);t&&c&&!u&&e.inherit!==!1&&(o===void 0&&(o=t.initial),a===void 0&&(a=t.animate));let l=r?r.initial===!1:!1;l=l||o===!1;let f=l?a:o;if(f&&typeof f!="boolean"&&!Be(f)){let m=Array.isArray(f)?f:[f];for(let d=0;d<m.length;d++){let h=ct(e,m[d]);if(h){let{transitionEnd:g,transition:x,...y}=h;for(let T in y){let w=y[T];if(Array.isArray(w)){let v=l?w.length-1:0;w=w[v]}w!==null&&(i[T]=w)}for(let T in g)i[T]=g[T]}}}return i}var Qn=e=>(t,r)=>{let n=(0,Oo.useContext)(Qe),i=(0,Oo.useContext)(Tt),s=()=>am(e,t,n,i);return r?s():fs(s)};var Nl=Qn({scrapeMotionValuesFromProps:ht,createRenderState:zt});var Ol=Qn({scrapeMotionValuesFromProps:Lr,createRenderState:Jn});var Bl=Symbol.for("motionComponentSymbol");var wt=require("react");function Fl(e,t,r){let n=(0,wt.useRef)(r);(0,wt.useInsertionEffect)(()=>{n.current=r});let i=(0,wt.useRef)(null);return(0,wt.useCallback)(s=>{var a;s&&((a=e.onMount)==null||a.call(e,s)),t&&(s?t.mount(s):t.unmount());let o=n.current;if(typeof o=="function")if(s){let u=o(s);typeof u=="function"&&(i.current=u)}else i.current?(i.current(),i.current=null):o(s);else o&&(o.current=s)},[t])}var oe=require("react");var jl=require("react"),ei=(0,jl.createContext)({});function et(e){return e&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function zl(e,t,r,n,i,s){var w,v;let{visualElement:o}=(0,oe.useContext)(Qe),a=(0,oe.useContext)(Xn),u=(0,oe.useContext)(Tt),c=(0,oe.useContext)($n),l=c.reducedMotion,f=c.skipAnimations,m=(0,oe.useRef)(null),d=(0,oe.useRef)(!1);n=n||a.renderer,!m.current&&n&&(m.current=n(e,{visualState:t,parent:o,props:r,presenceContext:u,blockInitialAnimation:u?u.initial===!1:!1,reducedMotionConfig:l,skipAnimations:f,isSVG:s}),d.current&&m.current&&(m.current.manuallyAnimateOnMount=!0));let h=m.current,g=(0,oe.useContext)(ei);h&&!h.projection&&i&&(h.type==="html"||h.type==="svg")&&cm(m.current,r,i,g);let x=(0,oe.useRef)(!1);(0,oe.useInsertionEffect)(()=>{h&&x.current&&h.update(r,u)});let y=r[hr],T=(0,oe.useRef)(!!y&&typeof window!="undefined"&&!((w=window.MotionHandoffIsComplete)!=null&&w.call(window,y))&&((v=window.MotionHasOptimisedAnimation)==null?void 0:v.call(window,y)));return ds(()=>{d.current=!0,h&&(x.current=!0,window.MotionIsMounted=!0,h.updateFeatures(),h.scheduleRenderMicrotask(),T.current&&h.animationState&&h.animationState.animateChanges())}),(0,oe.useEffect)(()=>{h&&(!T.current&&h.animationState&&h.animationState.animateChanges(),T.current&&(queueMicrotask(()=>{var C;(C=window.MotionHandoffMarkAsComplete)==null||C.call(window,y)}),T.current=!1),h.enteringChildren=void 0)}),h}function cm(e,t,r,n){let{layoutId:i,layout:s,drag:o,dragConstraints:a,layoutScroll:u,layoutRoot:c,layoutAnchor:l,layoutCrossfade:f}=t;e.projection=new r(e.latestValues,t["data-framer-portal-id"]?void 0:Gl(e.parent)),e.projection.setOptions({layoutId:i,layout:s,alwaysMeasureLayout:!!o||a&&et(a),visualElement:e,animationType:typeof s=="string"?s:"both",initialPromotionConfig:n,crossfade:f,layoutScroll:u,layoutRoot:c,layoutAnchor:l})}function Gl(e){if(e)return e.options.allowProjection!==!1?e.projection:Gl(e.parent)}function ri(e,{forwardMotionProps:t=!1,type:r}={},n,i){var c,l;n&&Tl(n);let s=r?r==="svg":Gt(e),o=s?Ol:Nl;function a(f,m){let d,h={...(0,Ut.useContext)($n),...f,layoutId:um(f)},{isStatic:g}=h,x=Ml(f),y=o(f,g);if(!g&&typeof window!="undefined"){fm(h,n);let T=mm(h);d=T.MeasureLayout,x.visualElement=zl(e,y,h,i,T.ProjectionNode,s)}return(0,ti.jsxs)(Qe.Provider,{value:x,children:[d&&x.visualElement?(0,ti.jsx)(d,{visualElement:x.visualElement,...h}):null,Il(e,f,Fl(y,x.visualElement,m),y,g,t,s)]})}a.displayName=`motion.${typeof e=="string"?e:`create(${(l=(c=e.displayName)!=null?c:e.name)!=null?l:""})`}`;let u=(0,Ut.forwardRef)(a);return u[Bl]=e,u}function um({layoutId:e}){let t=(0,Ut.useContext)(Yr).id;return t&&e!==void 0?t+"-"+e:e}function fm(e,t){let r=(0,Ut.useContext)(Xn).strict}function mm(e){let t=qn(),{drag:r,layout:n}=t;if(!r&&!n)return{};let i={...r,...n};return{MeasureLayout:r!=null&&r.isEnabled(e)||n!=null&&n.isEnabled(e)?i.MeasureLayout:void 0,ProjectionNode:i.ProjectionNode}}function Wl(e,t){if(typeof Proxy=="undefined")return ri;let r=new Map,n=(s,o)=>ri(s,o,e,t),i=(s,o)=>n(s,o);return new Proxy(i,{get:(s,o)=>o==="create"?n:(r.has(o)||r.set(o,ri(o,void 0,e,t)),r.get(o))})}var Ul=require("react");var Hl=(e,t)=>{var n;return((n=t.isSVG)!=null?n:Gt(e))?new Ir(t):new Dr(t,{allowProjection:e!==Ul.Fragment})};var ni=class extends Q{constructor(t){super(t),t.animationState||(t.animationState=wo(t))}updateAnimationControlsSubscription(){let{animate:t}=this.node.getProps();Be(t)&&(this.unmountControls=t.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){let{animate:t}=this.node.getProps(),{animate:r}=this.node.prevProps||{};t!==r&&this.updateAnimationControlsSubscription()}unmount(){var t;this.node.animationState.reset(),(t=this.unmountControls)==null||t.call(this)}};var dm=0,ii=class extends Q{constructor(){super(...arguments),this.id=dm++,this.isExitComplete=!1}update(){var s;if(!this.node.presenceContext)return;let{isPresent:t,onExitComplete:r}=this.node.presenceContext,{isPresent:n}=this.node.prevPresenceContext||{};if(!this.node.animationState||t===n)return;if(t&&n===!1){if(this.isExitComplete){let{initial:o,custom:a}=this.node.getProps();if(typeof o=="string"||typeof o=="object"&&o!==null&&!Array.isArray(o)){let u=ue(this.node,o,a);if(u){let{transition:c,transitionEnd:l,...f}=u;for(let m in f)(s=this.node.getValue(m))==null||s.jump(f[m])}}this.node.animationState.reset(),this.node.animationState.animateChanges()}else this.node.animationState.setActive("exit",!1);this.isExitComplete=!1;return}let i=this.node.animationState.setActive("exit",!t);r&&!t&&i.then(()=>{this.isExitComplete=!0,r(this.id)})}mount(){let{register:t,onExitComplete:r}=this.node.presenceContext||{};r&&r(this.id),t&&(this.unmount=t(this.id))}unmount(){}};var Kl={animation:{Feature:ni},exit:{Feature:ii}};function je(e){return{point:{x:e.pageX,y:e.pageY}}}var _l=e=>t=>mt(t)&&e(t,je(t));function tt(e,t,r,n){return Me(e,t,_l(r),n)}var oi=({current:e})=>e?e.ownerDocument.defaultView:null;var Yl=(e,t)=>Math.abs(e-t);function $l(e,t){let r=Yl(e.x,t.x),n=Yl(e.y,t.y);return Math.sqrt(r**2+n**2)}var Xl=new Set(["auto","scroll"]),Ht=class{constructor(t,r,{transformPagePoint:n,contextWindow:i=window,dragSnapToOrigin:s=!1,distanceThreshold:o=3,element:a}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.lastRawMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.scrollPositions=new Map,this.removeScrollListeners=null,this.onElementScroll=h=>{this.handleScroll(h.target)},this.onWindowScroll=()=>{this.handleScroll(window)},this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;this.lastRawMoveEventInfo&&(this.lastMoveEventInfo=si(this.lastRawMoveEventInfo,this.transformPagePoint));let h=Bo(this.lastMoveEventInfo,this.history),g=this.startEvent!==null,x=$l(h.offset,{x:0,y:0})>=this.distanceThreshold;if(!g&&!x)return;let{point:y}=h,{timestamp:T}=K;this.history.push({...y,timestamp:T});let{onStart:w,onMove:v}=this.handlers;g||(w&&w(this.lastMoveEvent,h),this.startEvent=this.lastMoveEvent),v&&v(this.lastMoveEvent,h)},this.handlePointerMove=(h,g)=>{this.lastMoveEvent=h,this.lastRawMoveEventInfo=g,this.lastMoveEventInfo=si(g,this.transformPagePoint),M.update(this.updatePoint,!0)},this.handlePointerUp=(h,g)=>{this.end();let{onEnd:x,onSessionEnd:y,resumeAnimation:T}=this.handlers;if((this.dragSnapToOrigin||!this.startEvent)&&T&&T(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;let w=Bo(h.type==="pointercancel"?this.lastMoveEventInfo:si(g,this.transformPagePoint),this.history);this.startEvent&&x&&x(h,w),y&&y(h,w)},!mt(t))return;this.dragSnapToOrigin=s,this.handlers=r,this.transformPagePoint=n,this.distanceThreshold=o,this.contextWindow=i||window;let u=je(t),c=si(u,this.transformPagePoint),{point:l}=c,{timestamp:f}=K;this.history=[{...l,timestamp:f}];let{onSessionStart:m}=r;m&&m(t,Bo(c,this.history));let d={passive:!0,capture:!0};this.removeListeners=be(tt(this.contextWindow,"pointermove",this.handlePointerMove,d),tt(this.contextWindow,"pointerup",this.handlePointerUp,d),tt(this.contextWindow,"pointercancel",this.handlePointerUp,d)),a&&this.startScrollTracking(a)}startScrollTracking(t){let r=t.parentElement;for(;r;){let n=getComputedStyle(r);(Xl.has(n.overflowX)||Xl.has(n.overflowY))&&this.scrollPositions.set(r,{x:r.scrollLeft,y:r.scrollTop}),r=r.parentElement}this.scrollPositions.set(window,{x:window.scrollX,y:window.scrollY}),window.addEventListener("scroll",this.onElementScroll,{capture:!0}),window.addEventListener("scroll",this.onWindowScroll),this.removeScrollListeners=()=>{window.removeEventListener("scroll",this.onElementScroll,{capture:!0}),window.removeEventListener("scroll",this.onWindowScroll)}}handleScroll(t){let r=this.scrollPositions.get(t);if(!r)return;let n=t===window,i=n?{x:window.scrollX,y:window.scrollY}:{x:t.scrollLeft,y:t.scrollTop},s={x:i.x-r.x,y:i.y-r.y};s.x===0&&s.y===0||(n?this.lastMoveEventInfo&&(this.lastMoveEventInfo.point.x+=s.x,this.lastMoveEventInfo.point.y+=s.y):this.history.length>0&&(this.history[0].x-=s.x,this.history[0].y-=s.y),this.scrollPositions.set(t,i),M.update(this.updatePoint,!0))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),this.removeScrollListeners&&this.removeScrollListeners(),this.scrollPositions.clear(),le(this.updatePoint)}};function si(e,t){return t?{point:t(e.point)}:e}function ql(e,t){return{x:e.x-t.x,y:e.y-t.y}}function Bo({point:e},t){return{point:e,delta:ql(e,Zl(t)),offset:ql(e,pm(t)),velocity:hm(t,.1)}}function pm(e){return e[0]}function Zl(e){return e[e.length-1]}function hm(e,t){if(e.length<2)return{x:0,y:0};let r=e.length-1,n=null,i=Zl(e);for(;r>=0&&(n=e[r],!(i.timestamp-n.timestamp>_(t)));)r--;if(!n)return{x:0,y:0};n===e[0]&&e.length>2&&i.timestamp-n.timestamp>_(t)*2&&(n=e[1]);let s=ee(i.timestamp-n.timestamp);if(s===0)return{x:0,y:0};let o={x:(i.x-n.x)/s,y:(i.y-n.y)/s};return o.x===1/0&&(o.x=0),o.y===1/0&&(o.y=0),o}function rc(e,{min:t,max:r},n){return t!==void 0&&e<t?e=n?A(t,e,n.min):Math.max(e,t):r!==void 0&&e>r&&(e=n?A(r,e,n.max):Math.min(e,r)),e}function Jl(e,t,r){return{min:t!==void 0?e.min+t:void 0,max:r!==void 0?e.max+r-(e.max-e.min):void 0}}function nc(e,{top:t,left:r,bottom:n,right:i}){return{x:Jl(e.x,r,i),y:Jl(e.y,t,n)}}function Ql(e,t){let r=t.min-e.min,n=t.max-e.max;return t.max-t.min<e.max-e.min&&([r,n]=[n,r]),{min:r,max:n}}function ic(e,t){return{x:Ql(e.x,t.x),y:Ql(e.y,t.y)}}function oc(e,t){let r=.5,n=$(e),i=$(t);return i>n?r=Se(t.min,t.max-n,e.min):n>i&&(r=Se(e.min,e.max-i,t.min)),Z(0,1,r)}function sc(e,t){let r={};return t.min!==void 0&&(r.min=t.min-e.min),t.max!==void 0&&(r.max=t.max-e.min),r}var ai=.35;function ac(e=ai){return e===!1?e=0:e===!0&&(e=ai),{x:ec(e,"left","right"),y:ec(e,"top","bottom")}}function ec(e,t,r){return{min:tc(e,t),max:tc(e,r)}}function tc(e,t){return typeof e=="number"?e:e[t]||0}var gm=new WeakMap,ci=class{constructor(t){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=F(),this.latestPointerEvent=null,this.latestPanInfo=null,this.visualElement=t}start(t,{snapToCursor:r=!1,distanceThreshold:n}={}){let{presenceContext:i}=this.visualElement;if(i&&i.isPresent===!1)return;let s=f=>{r&&this.snapToCursor(je(f).point),this.stopAnimation()},o=(f,m)=>{let{drag:d,dragPropagation:h,onDragStart:g}=this.getProps();if(d&&!h&&(this.openDragLock&&this.openDragLock(),this.openDragLock=to(d),!this.openDragLock))return;this.latestPointerEvent=f,this.latestPanInfo=m,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),fe(y=>{let T=this.getAxisMotionValue(y).get()||0;if(ne.test(T)){let{projection:w}=this.visualElement;if(w&&w.layout){let v=w.layout.layoutBox[y];v&&(T=$(v)*(parseFloat(T)/100))}}this.originPoint[y]=T}),g&&M.update(()=>g(f,m),!1,!0),Rt(this.visualElement,"transform");let{animationState:x}=this.visualElement;x&&x.setActive("whileDrag",!0)},a=(f,m)=>{this.latestPointerEvent=f,this.latestPanInfo=m;let{dragPropagation:d,dragDirectionLock:h,onDirectionLock:g,onDrag:x}=this.getProps();if(!d&&!this.openDragLock)return;let{offset:y}=m;if(h&&this.currentDirection===null){this.currentDirection=ym(y),this.currentDirection!==null&&g&&g(this.currentDirection);return}this.updateAxis("x",m.point,y),this.updateAxis("y",m.point,y),this.visualElement.render(),x&&M.update(()=>x(f,m),!1,!0)},u=(f,m)=>{this.latestPointerEvent=f,this.latestPanInfo=m,this.stop(f,m),this.latestPointerEvent=null,this.latestPanInfo=null},c=()=>{let{dragSnapToOrigin:f}=this.getProps();(f||this.constraints)&&this.startAnimation({x:0,y:0})},{dragSnapToOrigin:l}=this.getProps();this.panSession=new Ht(t,{onSessionStart:s,onStart:o,onMove:a,onSessionEnd:u,resumeAnimation:c},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:l,distanceThreshold:n,contextWindow:oi(this.visualElement),element:this.visualElement.current})}stop(t,r){let n=t||this.latestPointerEvent,i=r||this.latestPanInfo,s=this.isDragging;if(this.cancel(),!s||!i||!n)return;let{velocity:o}=i;this.startAnimation(o);let{onDragEnd:a}=this.getProps();a&&M.postRender(()=>a(n,i))}cancel(){this.isDragging=!1;let{projection:t,animationState:r}=this.visualElement;t&&(t.isAnimationBlocked=!1),this.endPanSession();let{dragPropagation:n}=this.getProps();!n&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),r&&r.setActive("whileDrag",!1)}endPanSession(){this.panSession&&this.panSession.end(),this.panSession=void 0}updateAxis(t,r,n){let{drag:i}=this.getProps();if(!n||!li(t,i,this.currentDirection))return;let s=this.getAxisMotionValue(t),o=this.originPoint[t]+n[t];this.constraints&&this.constraints[t]&&(o=rc(o,this.constraints[t],this.elastic[t])),s.set(o)}resolveConstraints(){var s;let{dragConstraints:t,dragElastic:r}=this.getProps(),n=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):(s=this.visualElement.projection)==null?void 0:s.layout,i=this.constraints;t&&et(t)?this.constraints||(this.constraints=this.resolveRefConstraints()):t&&n?this.constraints=nc(n.layoutBox,t):this.constraints=!1,this.elastic=ac(r),i!==this.constraints&&!et(t)&&n&&this.constraints&&!this.hasMutatedConstraints&&fe(o=>{this.constraints!==!1&&this.getAxisMotionValue(o)&&(this.constraints[o]=sc(n.layoutBox[o],this.constraints[o]))})}resolveRefConstraints(){let{dragConstraints:t,onMeasureDragConstraints:r}=this.getProps();if(!t||!et(t))return!1;let n=t.current;ae(n!==null,"If `dragConstraints` is set as a React ref, that ref must be passed to another component's `ref` prop.","drag-constraints-ref");let{projection:i}=this.visualElement;if(!i||!i.layout)return!1;i.root&&(i.root.scroll=void 0,i.root.updateScroll());let s=yo(n,i.root,this.visualElement.getTransformPagePoint()),o=ic(i.layout.layoutBox,s);if(r){let a=r(fo(o));this.hasMutatedConstraints=!!a,a&&(o=Vr(a))}return o}startAnimation(t){let{drag:r,dragMomentum:n,dragElastic:i,dragTransition:s,dragSnapToOrigin:o,onDragTransitionEnd:a}=this.getProps(),u=this.constraints||{},c=fe(l=>{if(!li(l,r,this.currentDirection))return;let f=u&&u[l]||{};(o===!0||o===l)&&(f={min:0,max:0});let m=i?200:1e6,d=i?40:1e7,h={type:"inertia",velocity:n?t[l]:0,bounceStiffness:m,bounceDamping:d,timeConstant:750,restDelta:1,restSpeed:10,...s,...f};return this.startAxisValueAnimation(l,h)});return Promise.all(c).then(a)}startAxisValueAnimation(t,r){let n=this.getAxisMotionValue(t);return Rt(this.visualElement,t),n.start(lt(t,n,0,r,this.visualElement,!1))}stopAnimation(){fe(t=>this.getAxisMotionValue(t).stop())}getAxisMotionValue(t){var s;let r=`_drag${t.toUpperCase()}`,i=this.visualElement.getProps()[r];return i||this.visualElement.getValue(t,(s=this.visualElement.latestValues[t])!=null?s:0)}snapToCursor(t){fe(r=>{let{drag:n}=this.getProps();if(!li(r,n,this.currentDirection))return;let{projection:i}=this.visualElement,s=this.getAxisMotionValue(r);if(i&&i.layout){let{min:o,max:a}=i.layout.layoutBox[r],u=s.get()||0;s.set(t[r]-A(o,a,.5)+u)}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;let{drag:t,dragConstraints:r}=this.getProps(),{projection:n}=this.visualElement;if(!et(r)||!n||!this.constraints)return;this.stopAnimation();let i={x:0,y:0};fe(o=>{let a=this.getAxisMotionValue(o);if(a&&this.constraints!==!1){let u=a.get();i[o]=oc({min:u,max:u},this.constraints[o])}});let{transformTemplate:s}=this.visualElement.getProps();this.visualElement.current.style.transform=s?s({},""):"none",n.root&&n.root.updateScroll(),n.updateLayout(),this.constraints=!1,this.resolveConstraints(),fe(o=>{if(!li(o,t,null))return;let a=this.getAxisMotionValue(o),{min:u,max:c}=this.constraints[o];a.set(A(u,c,i[o]))}),this.visualElement.render()}addListeners(){if(!this.visualElement.current)return;gm.set(this.visualElement,this);let t=this.visualElement.current,r=tt(t,"pointerdown",c=>{let{drag:l,dragListener:f=!0}=this.getProps(),m=c.target,d=m!==t&&oo(m);l&&f&&!d&&this.start(c)}),n,i=()=>{let{dragConstraints:c}=this.getProps();et(c)&&c.current&&(this.constraints=this.resolveRefConstraints(),n||(n=xm(t,c.current,()=>this.scalePositionWithinConstraints())))},{projection:s}=this.visualElement,o=s.addEventListener("measure",i);s&&!s.layout&&(s.root&&s.root.updateScroll(),s.updateLayout()),M.read(i);let a=Me(window,"resize",()=>this.scalePositionWithinConstraints()),u=s.addEventListener("didUpdate",(({delta:c,hasLayoutChanged:l})=>{this.isDragging&&l&&(fe(f=>{let m=this.getAxisMotionValue(f);m&&(this.originPoint[f]+=c[f].translate,m.set(m.get()+c[f].translate))}),this.visualElement.render())}));return()=>{a(),r(),o(),u&&u(),n&&n()}}getProps(){let t=this.visualElement.getProps(),{drag:r=!1,dragDirectionLock:n=!1,dragPropagation:i=!1,dragConstraints:s=!1,dragElastic:o=ai,dragMomentum:a=!0}=t;return{...t,drag:r,dragDirectionLock:n,dragPropagation:i,dragConstraints:s,dragElastic:o,dragMomentum:a}}};function lc(e){let t=!0;return()=>{if(t){t=!1;return}e()}}function xm(e,t,r){let n=Nn(e,lc(r)),i=Nn(t,lc(r));return()=>{n(),i()}}function li(e,t,r){return(t===!0||t===e)&&(r===null||r===e)}function ym(e,t=10){let r=null;return Math.abs(e.y)>t?r="y":Math.abs(e.x)>t&&(r="x"),r}var ui=class extends Q{constructor(t){super(t),this.removeGroupControls=G,this.removeListeners=G,this.controls=new ci(t)}mount(){let{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||G}update(){let{dragControls:t}=this.node.getProps(),{dragControls:r}=this.node.prevProps||{};t!==r&&(this.removeGroupControls(),t&&(this.removeGroupControls=t.subscribe(this.controls)))}unmount(){this.removeGroupControls(),this.removeListeners(),this.controls.isDragging||this.controls.endPanSession()}};var Fo=e=>(t,r)=>{e&&M.update(()=>e(t,r),!1,!0)},fi=class extends Q{constructor(){super(...arguments),this.removePointerDownListener=G}onPointerDown(t){this.session=new Ht(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:oi(this.node)})}createPanHandlers(){let{onPanSessionStart:t,onPanStart:r,onPan:n,onPanEnd:i}=this.node.getProps();return{onSessionStart:Fo(t),onStart:Fo(r),onMove:Fo(n),onEnd:(s,o)=>{delete this.session,i&&M.postRender(()=>i(s,o))}}}mount(){this.removePointerDownListener=tt(this.node.current,"pointerdown",t=>this.onPointerDown(t))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}};var cc=require("react/jsx-runtime");var Br=require("react");var jo=!1,zo=class extends Br.Component{componentDidMount(){let{visualElement:t,layoutGroup:r,switchLayoutGroup:n,layoutId:i}=this.props,{projection:s}=t;s&&(r.group&&r.group.add(s),n&&n.register&&i&&n.register(s),jo&&s.root.didUpdate(),s.addEventListener("animationComplete",()=>{this.safeToRemove()}),s.setOptions({...s.options,layoutDependency:this.props.layoutDependency,onExitComplete:()=>this.safeToRemove()})),vt.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){let{layoutDependency:r,visualElement:n,drag:i,isPresent:s}=this.props,{projection:o}=n;return o&&(o.isPresent=s,t.layoutDependency!==r&&o.setOptions({...o.options,layoutDependency:r}),jo=!0,i||t.layoutDependency!==r||r===void 0||t.isPresent!==s?o.willUpdate():this.safeToRemove(),t.isPresent!==s&&(s?o.promote():o.relegate()||M.postRender(()=>{let a=o.getStack();(!a||!a.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){let{visualElement:t,layoutAnchor:r}=this.props,{projection:n}=t;n&&(n.options.layoutAnchor=r,n.root.didUpdate(),ft.postRender(()=>{!n.currentAnimation&&n.isLead()&&this.safeToRemove()}))}componentWillUnmount(){let{visualElement:t,layoutGroup:r,switchLayoutGroup:n}=this.props,{projection:i}=t;jo=!0,i&&(i.scheduleCheckAfterUnmount(),r&&r.group&&r.group.remove(i),n&&n.deregister&&n.deregister(i))}safeToRemove(){let{safeToRemove:t}=this.props;t&&t()}render(){return null}};function mi(e){let[t,r]=yl(),n=(0,Br.useContext)(Yr);return(0,cc.jsx)(zo,{...e,layoutGroup:n,switchLayoutGroup:(0,Br.useContext)(ei),isPresent:t,safeToRemove:r})}var uc={pan:{Feature:fi},drag:{Feature:ui,ProjectionNode:Nr,MeasureLayout:mi}};function fc(e,t,r){let{props:n}=e;e.animationState&&n.whileHover&&e.animationState.setActive("whileHover",r==="Start");let i="onHover"+r,s=n[i];s&&M.postRender(()=>s(t,je(t)))}var di=class extends Q{mount(){let{current:t}=this.node;t&&(this.unmount=ro(t,(r,n)=>(fc(this.node,n,"Start"),i=>fc(this.node,i,"End"))))}unmount(){}};var pi=class extends Q{constructor(){super(...arguments),this.isActive=!1}onFocus(){let t=!1;try{t=this.node.current.matches(":focus-visible")}catch(r){t=!0}!t||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=be(Me(this.node.current,"focus",()=>this.onFocus()),Me(this.node.current,"blur",()=>this.onBlur()))}unmount(){}};function mc(e,t,r){let{props:n}=e;if(e.current instanceof HTMLButtonElement&&e.current.disabled)return;e.animationState&&n.whileTap&&e.animationState.setActive("whileTap",r==="Start");let i="onTap"+(r==="End"?"":r),s=n[i];s&&M.postRender(()=>s(t,je(t)))}var hi=class extends Q{mount(){let{current:t}=this.node;if(!t)return;let{globalTapTarget:r,propagate:n}=this.node.props;this.unmount=ao(t,(i,s)=>(mc(this.node,s,"Start"),(o,{success:a})=>mc(this.node,o,a?"End":"Cancel")),{useGlobalTarget:r,stopPropagation:(n==null?void 0:n.tap)===!1})}unmount(){}};var Wo=new WeakMap,Go=new WeakMap,vm=e=>{let t=Wo.get(e.target);t&&t(e)},bm=e=>{e.forEach(vm)};function wm({root:e,...t}){let r=e||document;Go.has(r)||Go.set(r,{});let n=Go.get(r),i=JSON.stringify(t);return n[i]||(n[i]=new IntersectionObserver(bm,{root:e,...t})),n[i]}function dc(e,t,r){let n=wm(t);return Wo.set(e,r),n.observe(e),()=>{Wo.delete(e),n.unobserve(e)}}var Tm={some:0,all:1},gi=class extends Q{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){var u;(u=this.stopObserver)==null||u.call(this);let{viewport:t={}}=this.node.getProps(),{root:r,margin:n,amount:i="some",once:s}=t,o={root:r?r.current:void 0,rootMargin:n,threshold:typeof i=="number"?i:Tm[i]},a=c=>{let{isIntersecting:l}=c;if(this.isInView===l||(this.isInView=l,s&&!l&&this.hasEnteredView))return;l&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",l);let{onViewportEnter:f,onViewportLeave:m}=this.node.getProps(),d=l?f:m;d&&d(c)};this.stopObserver=dc(this.node.current,o,a)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver=="undefined")return;let{props:t,prevProps:r}=this.node;["amount","margin","root"].some(Sm(t,r))&&this.startObserver()}unmount(){var t;(t=this.stopObserver)==null||t.call(this),this.hasEnteredView=!1,this.isInView=!1}};function Sm({viewport:e={}},{viewport:t={}}={}){return r=>e[r]!==t[r]}var pc={inView:{Feature:gi},tap:{Feature:hi},focus:{Feature:pi},hover:{Feature:di}};var hc={layout:{ProjectionNode:Nr,MeasureLayout:mi}};var gc={...Kl,...pc,...uc,...hc};var Uo=Wl(gc,Hl);var Ho=Uo;var Fr=typeof Element!="undefined"&&typeof Element.prototype.moveBefore=="function",Vm=-2e4,b={park:null,frame:null,currentSrc:null,sameOrigin:null,owner:null,lastRect:null,parkStrategy:"offscreen",degraded:!1,preloaded:!1,nudgeCount:0,nudgeEnabled:!0,lastNudgeAt:0,listeners:new Set};function Ko(){return{ready:b.frame!==null,docked:b.owner!==null,owner:b.owner,src:b.currentSrc,sameOrigin:b.sameOrigin,parkStrategy:b.parkStrategy,degraded:b.degraded,preloaded:b.preloaded,supportsMoveBefore:Fr,nudgeCount:b.nudgeCount,lastNudgeAt:b.lastNudgeAt}}function jr(){var e=Ko();b.listeners.forEach(function(t){try{t(e)}catch(r){}})}function xc(e){return b.listeners.add(e),function(){b.listeners.delete(e)}}function yc(){return Ko()}function Pm(e){e!=="offscreen"&&e!=="behind"||b.parkStrategy!==e&&(b.parkStrategy=e,b.frame!==null&&b.owner===null&&_o(),jr())}function Em(){return b.parkStrategy}function Mm(){var e=b.lastRect;e!==null&&(b.park.style.width=Math.max(1,Math.round(e.width))+"px",b.park.style.height=Math.max(1,Math.round(e.height))+"px")}function _o(){if(b.park!==null){if(Mm(),b.parkStrategy==="behind"&&b.lastRect!==null){b.park.style.left=Math.round(b.lastRect.left)+"px",b.park.style.top=Math.round(b.lastRect.top)+"px",b.park.style.visibility="visible",b.park.style.zIndex="0";return}b.park.style.left=Vm+"px",b.park.style.top="0px",b.park.style.visibility="hidden",b.park.style.zIndex="0"}}function vc(){b.frame!==null&&(b.frame.setAttribute("inert",""),b.frame.setAttribute("aria-hidden","true"))}function Am(){b.frame!==null&&(b.frame.removeAttribute("inert"),b.frame.removeAttribute("aria-hidden"))}function Dm(){var e=document.createElement("div");e.className="dshcs-park",e.setAttribute("data-dshcs-park",""),e.setAttribute("aria-hidden","true");var t=document.createElement("iframe");return t.className="dshcs-frame",t.setAttribute("title","code-server"),t.setAttribute("allow","clipboard-read; clipboard-write"),t.setAttribute("data-dshcs-resident",""),t.src="about:blank",e.appendChild(t),document.body.appendChild(e),b.park=e,b.frame=t,b.currentSrc="about:blank",b.owner=null,_o(),vc(),t}function km(e){var t=b.frame;if(t!==null){var r=b.sameOrigin!==e;!r&&t.hasAttribute("data-dshcs-attrs")||(e===!0?t.removeAttribute("sandbox"):e===!1&&t.setAttribute("sandbox","allow-scripts allow-same-origin allow-forms allow-modals allow-popups allow-pointer-lock allow-clipboard-read allow-clipboard-write"),t.setAttribute("data-dshcs-attrs",e===!0?"same-origin":"cross-origin"),b.sameOrigin=e)}}function Yo(e){var t=e||{};return b.frame===null&&Dm(),typeof t.sameOrigin=="boolean"&&km(t.sameOrigin),typeof t.src=="string"&&t.src!==""&&t.src!==b.currentSrc&&Rm(t.src),b.frame}function Rm(e){b.frame===null||typeof e!="string"||e===""||e===b.currentSrc||(b.currentSrc=e,b.frame.src=e,jr())}function bc(){var e=b.frame;if(b.nudgeEnabled!==!0||e===null||e.isConnected!==!0)return!1;var t=e.style.display;return e.style.display="none",e.offsetHeight,e.style.display=t,b.nudgeCount+=1,b.lastNudgeAt=Date.now(),!0}function Lm(e){return b.nudgeEnabled=e!==!1,b.nudgeEnabled}function wc(e){if(b.frame!==null){if(Fr)try{e.moveBefore(b.frame,null);return}catch(t){b.degraded=!0,b.lastMoveError=(t&&t.name?t.name+": ":"")+(t&&t.message?t.message:String(t))}else b.degraded=!0;e.appendChild(b.frame)}}function $o(e,t){if(!(b.frame===null||e==null)){var r=b.owner===null,n=e.getBoundingClientRect();n.width>=1&&n.height>=1&&(b.lastRect={left:n.left,top:n.top,width:n.width,height:n.height}),b.owner=t===void 0?null:t,Am(),b.park.setAttribute("aria-hidden","true"),wc(e),r&&bc(),jr()}}function zr(e){b.frame!==null&&(e!==void 0&&b.owner!==e||(b.owner=null,_o(),vc(),b.park.setAttribute("aria-hidden","true"),wc(b.park),jr()))}function Xo(e){var t=e||{};return Yo(t),b.owner===null&&(typeof t.src=="string"&&t.src!==""&&(b.preloaded=!0),zr()),b.frame}function Im(){b.park!==null&&b.park.parentNode!==null&&b.park.parentNode.removeChild(b.park),b.park=null,b.frame=null,b.currentSrc=null,b.sameOrigin=null,b.owner=null,b.lastRect=null,b.degraded=!1,b.preloaded=!1,b.nudgeCount=0,b.lastNudgeAt=0,jr()}typeof window!="undefined"&&(window.__dshcsSurface={snapshot:Ko,setParkStrategy:Pm,getParkStrategy:Em,preload:Xo,dock:$o,park:zr,nudge:bc,setNudgeEnabled:Lm,destroy:Im});var p=require("react"),Vc=require("react-dom"),Qo=new Set,es={open:!1,status:null,busy:!1,ballPos:null,sidebarActive:!1};function X(e){es=Object.assign({},es,e),Qo.forEach(function(t){t()})}function Nm(e){return Qo.add(e),function(){Qo.delete(e)}}function ts(){return es}function Yt(){return p.useSyncExternalStore(Nm,ts)}var Om="/api",ns="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTAwJSIgaGVpZ2h0PSIxMDAlIiB2aWV3Qm94PSIwIDAgMTQ3IDE0NyIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KICA8c3R5bGU+QG1lZGlhIChwcmVmZXJzLWNvbG9yLXNjaGVtZTogZGFyaykgeyogeyBmaWxsOiB3aGl0ZTsgfX08L3N0eWxlPgogIDxwYXRoIGQ9Im00Mi40MjE0LDM5LjY1NWMtMjQuNDA1NywwIC00Mi4xNTU0LDEzLjE3MjEgLTQyLjE1NTQsMzMuODQ1YzAsMjAuNTgxNCAxOC40ODkyLDMzLjg0NSA0Mi4xNTU0LDMzLjg0NWMyMy42NjYyLDAgMzguMTgwMywtMTEuNjE3MSAzOC43MzQ5LC0yOC43MjI1bC0yMS4wNzc3LC0wLjQ1NzRjLTAuOTI0NCw5LjMzMDMgLTkuMTA1OSwxNS4xODQ1IC0xNy42NTcyLDE1LjE4NDVjLTExLjc0MDYsMCAtMjAuNDMwNiwtNy41OTIyIC0yMC40MzA2LC0xOS44NDk2YzAsLTEyLjI1NzQgOC42OSwtMTkuOTg2OCAyMC40MzA2LC0yMC4yMTU1YzguNTUxMywtMC4xODMgMTYuOTE3Nyw1Ljk0NTcgMTcuNDcyMywxNS4yNzZsMjEuMDc3NywtMC42NDAzYy0wLjQ2MjIsLTE2LjgzMTEgLTE0LjE0NDIsLTI4LjI2NTIgLTM4LjU1LC0yOC4yNjUyem00OC44NDQ2LDJsNTUuNDY4LDBsMCw2NC4wMzExbC01NS40NjgsMGwwLC02NC4wMzExeiIgY2xpcC1ydWxlPSJldmVub2RkIiBmaWxsLXJ1bGU9ImV2ZW5vZGQiLz4KPC9zdmc+Cg==";async function me(e,t){var r={method:t===void 0?"GET":"POST",headers:{}};t!==void 0&&(r.headers["content-type"]="application/json",r.body=JSON.stringify(t));var n=await fetch(Om+e,r),i=await n.text(),s=null;try{s=i===""?null:JSON.parse(i)}catch(o){s=null}return n.ok?s!==null?s:{ok:!1,error:"invalid JSON response"}:{ok:!1,error:"HTTP "+n.status+(s!==null&&s.error!==void 0?": "+s.error:"")}}function Gr(e,t){try{var r=e(function(f){return f}),n=t===null?null:typeof t=="function"?t(function(f){return f}):null,i=r!=null?r.current:void 0;if(i!==void 0&&r!=null&&r.byId!=null){var s=r.byId[i];if(s!=null&&typeof s.cwd=="string"&&s.cwd!=="")return s.cwd}var o=n!=null&&Array.isArray(n.items)?n.items:[];if(i!==void 0)for(var a=0;a<o.length;a++){var u=o[a];if(u.sessionIds!=null&&u.sessionIds.indexOf(i)!==-1&&typeof u.path=="string"&&u.path!=="")return u.path}var c=n!=null?n.recentWorkspaceId:void 0;if(c!==void 0){for(var l=0;l<o.length;l++)if(o[l].workspaceId===c&&typeof o[l].path=="string"&&o[l].path!=="")return o[l].path}if(o.length>0&&typeof o[0].path=="string"&&o[0].path!=="")return o[0].path}catch(f){}}function is(e,t){if(e==null||typeof e.url!="string"||e.url==="")return null;var r=typeof t=="string"&&t!==""?t:e!=null&&e.cwd!=null?e.cwd:null;if(r==null||r==="")return e.url;var n=r.replace(/\\/g,"/"),i=n;return(/^[A-Za-z]:\//.test(n)||n.charCodeAt(0)!==47)&&(i="/"+n),e.url+"?folder="+encodeURIComponent(i)}function Pc(e){var t=e.status,r=e.pageUrl,n=e.reloadTick,i=e.owner,s=p.useRef(null),o=t!=null&&t.ok===!0&&t.running===!0,a=t!=null&&t.status==="starting",u=t!=null&&t.ok===!1,c=t!=null&&t.serve==="dsh";if(p.useLayoutEffect(function(){if(!o||r===null){zr(i);return}Yo({src:r,sameOrigin:c}),s.current!==null&&$o(s.current,i)},[o,r,c,n,i]),p.useLayoutEffect(function(){return function(){zr(i)}},[i]),o&&r!==null)return p.createElement("div",{ref:s,className:"dshcs-slot","data-code-server-slot":i!=null?i:"code-server"});if(a)return p.createElement("div",{className:"dshcs-loading"},"\u6B63\u5728\u542F\u52A8 code-server\u2026");var l=u&&t!=null&&t.error?t.error:"code-server \u672A\u8FD0\u884C",f=c?"\u5F53\u524D\u4EE5 DSH \u540C\u6E90\u8DEF\u5F84 "+(t!=null&&t.url||"/code-server/")+" \u63D0\u4F9B(\u65E0\u72EC\u7ACB\u7AEF\u53E3)\u3002":"\u5F53\u524D\u4EE5\u72EC\u7ACB\u56DE\u73AF\u7AEF\u53E3\u63D0\u4F9B(\u7AEF\u53E3 "+(t!=null&&t.port!=null?t.port:"8090")+" \u88AB\u5360\u7528\u65F6\u8BF7\u91CA\u653E\u6216\u4FEE\u6539 port \u914D\u7F6E)\u3002",m=Fr?"\u5E38\u9A7B\u9762:\u53EF\u7528(\u5207\u6807\u7B7E/\u6536\u8D77\u4FA7\u680F\u4E0D\u91CD\u8F7D)\u3002":"\u5E38\u9A7B\u9762:\u5F53\u524D\u6D4F\u89C8\u5668\u4E0D\u652F\u6301 Element.moveBefore \u2014\u2014 \u5207\u6807\u7B7E\u4F1A\u6574\u9875\u91CD\u8F7D(\u5347\u7EA7\u6D4F\u89C8\u5668\u540E\u81EA\u52A8\u53EF\u7528)\u3002";return p.createElement("div",{className:"dshcs-empty"},p.createElement("div",{className:"dshcs-emptybox"},p.createElement("div",null,u?"code-server \u542F\u52A8\u5931\u8D25":"code-server \u672A\u8FD0\u884C"),p.createElement("pre",{className:"dshcs-error"},l),p.createElement("p",{className:"dshcs-hint"},"VS Code \u6811\u968F\u63D2\u4EF6\u5305\u5185\u7F6E\u3001\u5C31\u5730\u8FD0\u884C(\u65E0\u9700\u5168\u5C40\u5B89\u88C5\u3001\u65E0\u9700\u8054\u7F51\u5B89\u88C5\u3001\u65E0\u300C\u5B89\u88C5\u73AF\u5883\u300D\u6B65\u9AA4);\u5185\u90E8\u4F9D\u8D56\u4E0E\u9884\u7F16\u8BD1\u539F\u751F\u6A21\u5757\u7531\u5305\u7BA1\u7406\u5668\u5728\u5B89\u88C5\u63D2\u4EF6\u65F6\u4E00\u5E76\u88C5\u597D(\u65E0\u9700 C++ \u5DE5\u5177\u94FE)\u3002\u82E5\u6B64\u5904\u957F\u671F\u672A\u8FD0\u884C,\u8BF7\u5230 \u8BBE\u7F6E \u2192 \u63D2\u4EF6 \u2192 Code Server \u70B9\u300C\u68C0\u6D4B\u73AF\u5883\u300D\u67E5\u770B\u539F\u56E0\u3002"+f+m)))}function Bm(e){var t=Yt(),r=t.status,n=r!=null&&r.ok===!0&&r.running===!0,i=r!=null&&r.keepResident===!0,s=Gr(e&&e.useSessions,e&&e.useWorkspaces),o=n?is(r,s):null;return p.useEffect(function(){!i||!n||o===null||Xo({src:o,sameOrigin:r!=null&&r.serve==="dsh"})},[i,n,o,r!=null?r.serve:null]),null}function Ec(e){var t=function(n){var i=is(n,e);i!=null&&typeof window.open=="function"&&window.open(i,"_blank","noopener")},r=ts().status;if(r!=null&&r.running===!0){t(r);return}ts().busy!==!0&&(X({busy:!0}),me("/code-server/start",typeof e=="string"?{cwd:e}:{}).then(function(n){X({status:n,busy:!1}),t(n)}).catch(function(){X({busy:!1})}))}var Fm=["nw","n","ne","w","e","sw","s","se"],te=12,jm=720,zm=520,Mc=360,Ac=260,Tc=24;function rs(e){if(e===!1)return 0;try{if(typeof document=="undefined")return 0;var t=document.querySelectorAll("[data-composer-seat]");if(t===null||t.length===0)return 0;for(var r=Number.POSITIVE_INFINITY,n=0,i=0;i<t.length;i++){var s=t[i].getBoundingClientRect();s===null||s.width<=0||(s.top<r&&(r=s.top),s.bottom>n&&(n=s.bottom))}if(!isFinite(r)||n<=0)return 0;var o=window.innerHeight;return o-n>24?0:Math.min(Math.max(1,o-r+8),420)}catch(a){return 0}}function Ae(){return{width:Math.max(1,window.innerWidth),height:Math.max(1,window.innerHeight)}}function wi(e,t){return{width:Math.max(1,e.width-te*2),height:Math.max(1,e.height-te*2-t)}}function rt(e,t,r){return Math.min(r,Math.max(t,e))}function Kt(e,t,r){let n=wi(t,r),i=rt(e.width,Math.min(Mc,n.width),n.width),s=rt(e.height,Math.min(Ac,n.height),n.height);return{x:rt(e.x,te,Math.max(te,t.width-te-i)),y:rt(e.y,te,Math.max(te,t.height-te-r-s)),width:i,height:s}}function Gm(e,t,r){let n=wi(t,r),i=Math.min(jm,n.width),s=Math.min(zm,n.height),o=Wm(),a=o>0?o-8:t.height-te-r;return Kt({x:t.width-te-i-e*Tc,y:Math.max(te,a-s-e*Tc),width:i,height:s},t,r)}function Wm(){try{if(typeof document=="undefined")return-1;var e=document.querySelectorAll("[data-composer-seat]");if(e===null||e.length===0)return-1;for(var t=Number.POSITIVE_INFINITY,r=0;r<e.length;r++){var n=e[r].getBoundingClientRect();n!==null&&n.width>0&&n.top<t&&(t=n.top)}return isFinite(t)?t:-1}catch(i){return-1}}function Um(e,t,r,n,i){return Kt({...e,x:e.x+t,y:e.y+r},n,i)}function Hm(e,t,r,n,i,s){let o=Kt(e,i,s),a=wi(i,s),u=Math.min(Mc,a.width),c=Math.min(Ac,a.height),l=i.height-te-s,f=o.x,m=o.x+o.width,d=o.y,h=o.y+o.height;return t.includes("w")&&(f=rt(o.x+r,te,m-u)),t.includes("e")&&(m=rt(m+r,f+u,i.width-te)),t.includes("n")&&(d=rt(o.y+n,te,h-c)),t.includes("s")&&(h=rt(h+n,d+c,l)),{x:f,y:d,width:m-f,height:h-d}}function xi(e,t){let r=wi(e,t);return{x:te,y:te,width:r.width,height:r.height}}var Km='.dshcs-root{position:fixed;inset:0;z-index:2147483000;pointer-events:none}.dshcs-win{--dshcs-accent:#5b6cff;pointer-events:auto;position:fixed;isolation:isolate;z-index:2147483000;display:flex;flex-direction:column;min-width:1px;min-height:1px;overflow:hidden;color:var(--dsw-alias-label-primary,#172033);background:var(--dsw-alias-bg-base,#fff);border:1px solid var(--dsw-alias-border-l2,#dfe3eb);border-radius:12px;box-shadow:0 1px 2px rgba(13,22,38,.08),0 18px 48px rgba(13,22,38,.2),0 0 0 1px rgba(255,255,255,.4) inset;transition:border-color .16s ease,box-shadow .16s ease}.dshcs-win:hover{border-color:color-mix(in srgb,var(--dshcs-accent) 28%,var(--dsw-alias-border-l2,#dfe3eb));box-shadow:0 2px 5px rgba(13,22,38,.1),0 22px 58px rgba(13,22,38,.24),0 0 0 1px rgba(255,255,255,.5) inset}.dshcs-win[data-interaction]{transition:none;user-select:none}.dshcs-win[data-interaction]::after{content:"";position:absolute;inset:0;z-index:18;background:transparent}.dshcs-win-max{border-radius:14px;z-index:2147483001;box-shadow:0 1px 2px rgba(13,22,38,.06),0 8px 24px rgba(13,22,38,.12)}.dshcs-win-max:hover{box-shadow:0 1px 2px rgba(13,22,38,.06),0 10px 28px rgba(13,22,38,.14)}.dshcs-win-snap{border-color:color-mix(in srgb,var(--dshcs-accent) 70%,var(--dsw-alias-border-l2,#dfe3eb));box-shadow:0 0 0 3px color-mix(in srgb,var(--dshcs-accent) 26%,transparent),0 22px 58px rgba(13,22,38,.24),0 0 0 1px rgba(255,255,255,.5) inset}.dshcs-snapghost{position:fixed;left:0;top:0;z-index:2147483000;pointer-events:none;display:grid;place-items:center;border:1.5px solid color-mix(in srgb,var(--dshcs-accent,#5b6cff) 85%,transparent);background:color-mix(in srgb,var(--dshcs-accent,#5b6cff) 11%,transparent);border-radius:12px;box-shadow:0 0 0 3px color-mix(in srgb,var(--dshcs-accent,#5b6cff) 20%,transparent),0 10px 34px rgba(13,22,38,.14)}.dshcs-snapghint{position:absolute;top:12px;left:50%;transform:translateX(-50%);padding:5px 14px;border-radius:999px;background:color-mix(in srgb,var(--dshcs-accent,#5b6cff) 92%,#172033);color:#fff;font-size:12px;font-weight:650;letter-spacing:.02em;white-space:nowrap;box-shadow:0 6px 18px rgba(13,22,38,.3)}.dshcs-drag{position:absolute;top:0;left:0;right:0;height:14px;z-index:26;cursor:grab;touch-action:none;user-select:none}.dshcs-win[data-interaction=move] .dshcs-drag{cursor:grabbing}.dshcs-win-max .dshcs-drag{cursor:default}.dshcs-drag:hover{background:color-mix(in srgb,var(--dsw-alias-label-primary,#172033) 5%,transparent)}.dshcs-artbtn{appearance:none;display:inline-grid;place-items:center;width:22px;height:22px;padding:0;border:1px solid var(--dsw-alias-border-l2,#dfe3eb);border-radius:6px;color:var(--dsw-alias-label-secondary,#566174);background:color-mix(in srgb,var(--dsw-alias-bg-base,#fff) 60%,transparent);cursor:pointer;transition:color .12s ease,background .12s ease,border-color .12s ease;vertical-align:middle}.dshcs-artbtn:hover{color:var(--dsw-alias-label-primary,#172033);border-color:color-mix(in srgb,var(--dshcs-accent) 40%,var(--dsw-alias-border-l2,#dfe3eb));background:color-mix(in srgb,var(--dshcs-accent) 8%,transparent)}.dshcs-artbtn:active{transform:scale(.94)}.dshcs-artbtn:focus-visible{outline:2px solid color-mix(in srgb,var(--dshcs-accent) 65%,transparent);outline-offset:1px}.dshcs-artifacts{display:grid;grid-template-columns:max-content minmax(0,1fr);align-items:center;gap:6px 8px;margin-top:16px;font-size:13px;line-height:22px;position:relative}.dshcs-artlabel{color:var(--dsw-alias-label-tertiary,#7d8798);grid-area:1/1}.dshcs-artrow{flex-wrap:nowrap;grid-area:1/2;align-items:center;gap:8px;min-width:0;display:flex;overflow:hidden}.dshcs-artitem{display:inline-flex;align-items:center;gap:4px;flex:none;min-width:0}.dshcs-artfile{text-overflow:ellipsis;white-space:nowrap;background:var(--dsw-alias-interactive-bg-hover);max-width:320px;color:var(--dsw-alias-label-secondary,#566174);font:inherit;cursor:pointer;border:none;border-radius:6px;margin:0;padding:0 8px;overflow:hidden}.dshcs-artfile:hover{color:var(--dsw-alias-label-primary,#172033);text-decoration:underline}.dshcs-artfile:focus-visible{box-shadow:inset 0 0 0 2px var(--dsw-alias-border-l3);outline:none}.dshcs-artmore{white-space:nowrap;color:var(--dsw-alias-label-tertiary,#7d8798);flex:none}.dshcs-body{position:relative;display:flex;flex:1;min-width:0;min-height:0;flex-direction:column;background:var(--dsw-alias-bg-base,#fff)}.dshcs-body[hidden]{display:none}.dshcs-frame{display:block;position:absolute;inset:0;z-index:1;width:100%;height:100%;border:0;background:var(--dsw-alias-bg-base,#fff)}.dshcs-loading{position:absolute;inset:0;z-index:2;display:grid;place-items:center;background:var(--dsw-alias-bg-base,#fff);color:var(--dsw-alias-label-tertiary,#7d8798);font-size:13px}.dshcs-win-hidden{pointer-events:none!important}.dshcs-empty{position:relative;z-index:2;flex:1;display:flex;align-items:center;justify-content:center;padding:44px 24px 24px}.dshcs-emptybox{max-width:560px;text-align:left;background:var(--dsw-alias-bg-layer-2,#f7f8fb);border:1px solid var(--dsw-alias-border-l2,#dfe3eb);border-radius:12px;padding:16px 18px}.dshcs-error{color:var(--dsw-alias-label-error,#d92d20);white-space:pre-wrap;word-break:break-all;font-family:ui-monospace,Consolas,monospace;font-size:12px;margin:8px 0 0}.dshcs-hint{color:var(--dsw-alias-label-tertiary,#7d8798);font-size:12px;margin:6px 0 0}.dshcs-resize{position:absolute;z-index:24;display:block;touch-action:none}.dshcs-resize-n,.dshcs-resize-s{left:16px;right:16px;height:10px;cursor:ns-resize}.dshcs-resize-n{top:0}.dshcs-resize-s{bottom:0}.dshcs-resize-w,.dshcs-resize-e{top:16px;bottom:16px;width:10px;cursor:ew-resize}.dshcs-resize-w{left:0}.dshcs-resize-e{right:0}.dshcs-resize-nw,.dshcs-resize-ne,.dshcs-resize-sw,.dshcs-resize-se{width:18px;height:18px}.dshcs-resize-nw{left:0;top:0;cursor:nwse-resize}.dshcs-resize-ne{right:0;top:0;cursor:nesw-resize}.dshcs-resize-sw{left:0;bottom:0;cursor:nesw-resize}.dshcs-resize-se{right:0;bottom:0;cursor:nwse-resize}.dshcs-resize-se::after{content:"";position:absolute;right:4px;bottom:4px;width:7px;height:7px;border-right:1.5px solid color-mix(in srgb,var(--dsw-alias-label-tertiary,#7d8798) 58%,transparent);border-bottom:1.5px solid color-mix(in srgb,var(--dsw-alias-label-tertiary,#7d8798) 58%,transparent);border-radius:0 0 2px}.dshcs-ball{position:fixed;width:38px;height:38px;padding:0;border:1px solid color-mix(in srgb,var(--dsw-alias-border-l2,#dfe3eb) 80%,transparent);border-radius:50%;display:grid;place-items:center;cursor:grab;touch-action:none;user-select:none;-webkit-user-select:none;z-index:2147483002;background:color-mix(in srgb,var(--dsw-alias-bg-layer-2,#f2f4f8) 88%,transparent);backdrop-filter:blur(8px) saturate(1.2);box-shadow:0 8px 20px rgba(13,22,38,.18),0 1px 2px rgba(13,22,38,.1);transition:transform .16s ease,box-shadow .16s ease,background .16s ease,border-color .16s ease}.dshcs-ball img,.dshcs-ball svg{-webkit-user-drag:none;user-drag:none}.dshcs-ball[data-dragging]{cursor:grabbing;transform:scale(1.06);box-shadow:0 14px 28px rgba(13,22,38,.28),0 2px 6px rgba(13,22,38,.16)}.dshcs-ball:hover{transform:scale(1.06);box-shadow:0 10px 24px rgba(13,22,38,.22),0 1px 2px rgba(13,22,38,.1)}.dshcs-ball:active{transform:scale(.94)}.dshcs-ball:focus-visible{outline:2px solid color-mix(in srgb,var(--dshcs-accent) 65%,transparent);outline-offset:2px}.dshcs-ball-open{background:color-mix(in srgb,var(--dshcs-accent) 14%,var(--dsw-alias-bg-layer-2,#f2f4f8));border-color:color-mix(in srgb,var(--dshcs-accent) 55%,var(--dsw-alias-border-l2,#dfe3eb));box-shadow:0 0 0 3px color-mix(in srgb,var(--dshcs-accent) 22%,transparent),0 0 20px color-mix(in srgb,var(--dshcs-accent) 38%,transparent),0 8px 20px rgba(13,22,38,.16);transform:scale(1.08)}.dshcs-ball-dot{position:absolute;top:-2px;right:-2px;width:9px;height:9px;border-radius:50%;background:#20a66a;border:2px solid var(--dsw-alias-bg-base,#fff)}.dshcs-ball-dot[data-status=starting]{background:#d78b25}.dshcs-ball-dot[data-status=error]{background:#f85149}.dshcs-ball-dot[data-status=idle]{background:#7d8798}.dshcs-ball-dot[data-status=running]::after{content:"";position:absolute;inset:-4px;border-radius:50%;border:1px solid currentColor;opacity:.3;animation:dshcs-pulse 2s ease-out infinite}.dshcs-tabroot{position:relative;display:flex;flex-direction:column;width:100%;height:100%;min-width:0;min-height:0;background:var(--dsw-alias-bg-base,#fff)}.dshcs-slot{position:relative;display:block;width:100%;height:100%;min-width:0;min-height:0;overflow:hidden;background:var(--dsw-alias-bg-base,#fff)}.dshcs-park{position:fixed;left:-20000px;top:0;width:320px;height:200px;overflow:hidden;pointer-events:none;z-index:0;visibility:hidden;contain:strict}@keyframes dshcs-pulse{0%{transform:scale(.7);opacity:.35}70%,100%{transform:scale(1.65);opacity:0}}',Sc="dsh-code-server/styles";typeof document!="undefined"&&document.querySelector("style[data-dshcs="+JSON.stringify(Sc)+"]")===null&&(yi=document.createElement("style"),yi.setAttribute("data-dshcs",Sc),yi.textContent=Km,document.head.appendChild(yi));var yi;function _m(e){var[t,r]=p.useState(!1),n=p.useRef(e.url);return p.useEffect(function(){n.current!==e.url&&(n.current=e.url,r(!1))},[e.url]),e.url!=null&&t!==!0?p.createElement("img",{src:e.url,key:"img-"+e.url,alt:"","aria-hidden":!0,draggable:!1,onError:function(){r(!0)},style:{width:20,height:20,display:"block",objectFit:"contain",borderRadius:3,WebkitUserDrag:"none",userSelect:"none"}}):p.createElement("svg",{viewBox:"0 0 18 18","aria-hidden":!0,style:{width:17,height:17}},p.createElement("rect",{x:"3",y:"3",width:"12",height:"12",rx:"2",fill:"none",stroke:"currentColor",strokeWidth:1.4}),p.createElement("path",{d:"M3 7h12M7 3v12",fill:"none",stroke:"currentColor",strokeWidth:1.4}))}var ze=38,De=8,Dc="dshcs-ball-pos";function vi(e){var t=Math.max(De,window.innerWidth-De-ze),r=Math.max(De,window.innerHeight-De-ze);return{x:Math.min(t,Math.max(De,e.x)),y:Math.min(r,Math.max(De,e.y))}}function Ym(){try{var e=window.localStorage.getItem(Dc);if(e==null)return null;var t=JSON.parse(e);if(t!=null&&typeof t.x=="number"&&typeof t.y=="number"&&isFinite(t.x)&&isFinite(t.y))return vi(t)}catch(r){}return null}function $m(e){try{window.localStorage.setItem(Dc,JSON.stringify(e))}catch(t){}}function Xm(e){var t=Yt(),r=t.status,n=r!=null?r.env:null,i=r!=null&&r.running===!0,s=i?"running":r!=null&&r.status==="starting"?"starting":r!=null&&r.status==="error"?"error":"idle",o=rs(r!=null?r.reserveComposer:!0),a=t.open===!0,u=ns,[c,l]=p.useState(Ym),[f,m]=p.useState(!1),d=p.useRef(null),h=p.useRef(!1);if(p.useEffect(function(){var v=function(){l(function(C){return C==null?C:vi(C)})};return window.addEventListener("resize",v),function(){window.removeEventListener("resize",v)}},[]),p.useEffect(function(){var v=c!=null?c:(function(){var C=rs(r!=null?r.reserveComposer:!0);return{x:window.innerWidth-De-ze,y:window.innerHeight-De-ze-(C>0?C+10:18)}})();X({ballPos:vi(v)})},[c,r]),n!=null&&n.ok!==!0||t.sidebarActive===!0)return null;var g=function(v){if(v.button===0){var C=v.currentTarget,D=C.getBoundingClientRect();d.current={pointerId:v.pointerId,dx:v.clientX-D.left,dy:v.clientY-D.top,moved:!1},h.current=!1,m(!0);try{C.setPointerCapture(v.pointerId)}catch(V){}}},x=function(v){var C=d.current;if(!(C==null||v.pointerId!==C.pointerId)){var D=v.clientX-C.dx,V=v.clientY-C.dy;(Math.abs(D-(c!=null?c.x:0))>2||Math.abs(V-(c!=null?c.y:0))>2)&&(C.moved=!0),l(vi({x:D,y:V}))}},y=function(){var v=d.current;d.current=null,m(!1),v!=null&&v.moved===!0&&(h.current=!0),v!=null&&v.moved===!0&&l(function(C){return C!=null&&$m(C),C})},T=function(){if(h.current===!0){h.current=!1;return}if(r!=null&&r.windowedOpen===!0){Ec(Gr(e&&e.useSessions,e&&e.useWorkspaces));return}X({open:!a})},w=c!=null?{left:c.x,top:c.y}:{right:14,bottom:o>0?o+10:18};return Vc.createPortal(p.createElement("button",{type:"button",className:"dshcs-ball"+(a?" dshcs-ball-open":""),style:w,"data-dragging":f===!0?"":void 0,title:r!=null&&r.windowedOpen===!0?"\u5728\u6D4F\u89C8\u5668\u65B0\u6807\u7B7E\u9875\u6253\u5F00 Code Server(\u53EF\u62D6\u52A8)":a?"\u6536\u8D77 Code Server(Esc)":"\u6253\u5F00 Code Server(\u53EF\u62D6\u52A8)","aria-label":a?"\u6536\u8D77 Code Server(Esc)":"\u6253\u5F00 Code Server","aria-expanded":a,onPointerDown:g,onPointerMove:x,onPointerUp:y,onPointerCancel:y,onDragStart:function(v){v&&v.preventDefault&&v.preventDefault()},onClick:T},p.createElement(_m,{url:u}),p.createElement("span",{className:"dshcs-ball-dot","data-status":s,"aria-hidden":!0})),document.body)}function qm(e){var t=Yt(),r=t.status,n=r!=null&&r.ok===!0&&r.running===!0,i=r!=null&&r.status==="starting",s=r!=null&&r.ok===!1,o=Gr(e&&e.useSessions,e&&e.useWorkspaces),a=p.useRef(void 0),[u,c]=p.useState(0),l=rs(r!=null?r.reserveComposer:!0),[f,m]=p.useState(!1),[d,h]=p.useState(null),[g,x]=p.useState(function(){return Gm(0,Ae(),l)}),y=p.useRef(g),T=p.useRef(function(){});y.current=g,p.useEffect(function(){var R=function(){x(function(re){return f?xi(Ae(),l):Kt(re,Ae(),l)})};return window.addEventListener("resize",R),function(){window.removeEventListener("resize",R)}},[f,l]),p.useEffect(function(){x(function(R){return Kt(R,Ae(),l)})},[l]),p.useEffect(function(){return function(){T.current()}},[]);var w=12,v=4,[C,D]=p.useState(!1),V=p.useRef(null),P=function(R,re){if(R.button===0){R.preventDefault(),R.stopPropagation(),T.current();var se=R.currentTarget.ownerDocument.defaultView;if(se!==null){var pe=R.pointerId,Ur=R.currentTarget,os=f,$t=os?xi(Ae(),l):y.current,Nc=$t.width>0?(R.clientX-$t.x)/$t.width:0,Oc=Math.min(14,Math.max(0,R.clientY-$t.y)),z={pointerId:pe,origin:{x:R.clientX,y:R.clientY},start:$t,ratio:Nc,grabY:Oc,wasMaximized:os,restored:!1,snapped:!1,moved:!1};V.current=z,h(re);try{Ur.setPointerCapture(pe)}catch(ce){}var ss=function(ce){if(ce.pointerId===pe){if(re!=="move"){x(Hm(z.start,re,ce.clientX-z.origin.x,ce.clientY-z.origin.y,Ae(),l));return}var ls=ce.clientX-z.origin.x,Kr=ce.clientY-z.origin.y;if(Math.abs(ls)+Math.abs(Kr)>3&&(z.moved=!0),z.wasMaximized&&!z.restored){if(Kr<v)return;var Ci=y.current,_r={x:ce.clientX-Ci.width*Math.min(.9,Math.max(.1,z.ratio)),y:ce.clientY-z.grabY,width:Ci.width,height:Ci.height};_r=Kt(_r,Ae(),l),z.restored=!0,z.start=_r,z.origin={x:ce.clientX,y:ce.clientY},m(!1),x(_r);return}var Bc=z.start.y+Kr,Fc=Um(z.start,ls,Kr,Ae(),l);x(Fc);var Vi=Bc<=w;Vi!==z.snapped&&(z.snapped=Vi,D(Vi))}},as=function(){se.removeEventListener("pointermove",ss),se.removeEventListener("pointerup",Hr),se.removeEventListener("pointercancel",Hr),T.current=function(){},V.current=null;try{Ur.releasePointerCapture(pe)}catch(ce){}},Hr=function(ce){ce.pointerId===pe&&(as(),h(null),(!z.wasMaximized||z.restored===!0)&&(z.snapped===!0&&z.moved===!0&&m(!0),z.snapped===!0&&D(!1)))};T.current=as,se.addEventListener("pointermove",ss),se.addEventListener("pointerup",Hr),se.addEventListener("pointercancel",Hr)}}},H=function(){m(function(R){return!R})},E=function(R){R.target.closest("[data-window-control]")===null&&P(R,"move")},O=function(R){R.target.closest("[data-window-control]")===null&&H()};if(p.useEffect(function(){if(!t.open||t.sidebarActive===!0)return;var R=!1;async function re(){X({busy:!0});var se=await me("/code-server/status");if(!R){if(se!=null&&se.ok===!0&&se.running===!0){X({status:se,busy:!1});return}var pe=await me("/code-server/start",typeof o=="string"?{cwd:o}:{});R||X({status:pe,busy:!1})}}return re(),function(){R=!0}},[t.open,t.sidebarActive]),p.useEffect(function(){if(t.sidebarActive===!0||typeof o!="string"||o===""||a.current===o)return;var R=a.current!==void 0&&a.current!==o;a.current=o;var re=!1;async function se(){X({busy:!0});var pe=await me("/code-server/start",{cwd:o});re||(X({status:pe,busy:!1}),R&&pe!=null&&pe.ok===!0&&pe.running===!0&&c(function(Ur){return Ur+1}))}return se(),function(){re=!0}},[o,t.sidebarActive]),p.useEffect(function(){t.open||(a.current=void 0)},[t.open]),p.useEffect(function(){if(t.sidebarActive!==!0){var R=window.setInterval(function(){me("/code-server/status").then(function(re){X({status:re})})},3e3);return function(){window.clearInterval(R)}}},[t.sidebarActive]),p.useEffect(function(){if(!t.open)return;function R(re){re.key==="Escape"&&X({open:!1})}return window.addEventListener("keydown",R),function(){window.removeEventListener("keydown",R)}},[t.open]),t.sidebarActive===!0)return null;var I=r!=null&&typeof r.url=="string"?r.url:null,de=n&&r!=null&&typeof r.cwd=="string"&&r.cwd!==""?r.cwd:null,Y=null;if(de!==null){var k=de.replace(/\\/g,"/");Y=k,(/^[A-Za-z]:\//.test(k)||k.charCodeAt(0)!==47)&&(Y="/"+k)}var N=I!==null?I+(Y!==null?"?folder="+encodeURIComponent(Y):""):null,Ti=p.createElement(Pc,{status:r,pageUrl:N,reloadTick:u,owner:"window"}),q=["dshcs-win",f?"dshcs-win-max":"",C?"dshcs-win-snap":"",t.open===!1?"dshcs-win-hidden":""].filter(Boolean).join(" "),j=f?xi(Ae(),l):g,Te=t.ballPos!=null?t.ballPos:{x:window.innerWidth-De-ze,y:window.innerHeight-De-ze-(l>0?l+10:18)},ke={x:Te.x+ze/2,y:Te.y+ze/2},Si=Math.max(.05,ze/Math.max(j.width,j.height)),kc=t.open===!1?{x:ke.x-j.width/2,y:ke.y-j.height/2,width:j.width,height:j.height,scale:Si,borderRadius:19,opacity:0}:{x:j.x,y:j.y,width:j.width,height:j.height,scale:1,borderRadius:12,opacity:1},Rc=d!==null?{duration:0}:{type:"spring",stiffness:340,damping:38,mass:.9,opacity:{type:"spring",stiffness:420,damping:40,mass:.8},borderRadius:{duration:.2}},Lc=p.createElement(Ho.section,{className:q,style:t.open===!1?{left:0,top:0,pointerEvents:"none"}:{left:0,top:0},animate:kc,initial:!1,transition:Rc,"data-interaction":d!==null?d:void 0,role:"dialog","aria-label":"Code Server"},p.createElement("span",{className:"dshcs-drag",title:"\u62D6\u52A8\u79FB\u52A8 / \u53CC\u51FB\u6700\u5927\u5316",onPointerDown:E,onDoubleClick:O}),p.createElement("div",{className:"dshcs-body"},Ti),f?null:Fm.map(function(R){return p.createElement("span",{key:R,className:"dshcs-resize dshcs-resize-"+R,"data-direction":R,onPointerDown:function(re){P(re,R)}})})),Wr=xi(Ae(),l),Ic=p.createElement(Ho.div,{className:"dshcs-snapghost",initial:!1,animate:{opacity:C===!0?1:0,x:Wr.x,y:Wr.y,width:Wr.width,height:Wr.height},transition:C===!0?{type:"spring",stiffness:500,damping:44,mass:.9}:{duration:.14}},p.createElement("span",{className:"dshcs-snapghint"},"\u677E\u5F00\u4EE5\u6700\u5927\u5316"));return Vc.createPortal(p.createElement(p.Fragment,null,Lc,Ic),document.body)}var qo="code-server",Cc="dsh-code-server-app",_t={openTab:null};function Zm(e){var t=e!=null&&typeof e.size=="number"?e.size:16;return p.createElement("img",{src:ns,alt:"","aria-hidden":!0,draggable:!1,className:e!=null?e.className:void 0,style:{width:t,height:t,display:"block",objectFit:"contain",WebkitUserDrag:"none",userSelect:"none"}})}function Jm(e){var t=e.useTabInfo(),r=t.tab,n=Yt(),i=n.status,s=Gr(e.useSessions,null),o=p.useRef(void 0),[a,u]=p.useState(0),c=r.navigation,l=c!=null&&typeof c.revision=="number"?c.revision:0;return p.useEffect(function(){if(!(typeof s!="string"||s==="")&&o.current!==s){var f=o.current!==void 0;o.current=s;var m=!1;return me("/code-server/start",{cwd:s}).then(function(d){m||(X({status:d}),f&&d!=null&&d.ok===!0&&d.running===!0&&u(function(h){return h+1}))}).catch(function(){}),function(){m=!0}}},[s]),p.useEffect(function(){me("/code-server/status").then(function(m){m!=null&&X({status:m})}).catch(function(){});var f=window.setInterval(function(){me("/code-server/status").then(function(m){X({status:m})}).catch(function(){})},3e3);return function(){window.clearInterval(f)}},[]),p.useEffect(function(){var f=c!=null?c.params:null,m=f!=null&&typeof f.path=="string"?f.path:"";m!==""&&me("/code-server/open-file",{file:m}).catch(function(){})},[l]),p.createElement("div",{className:"dshcs-tabroot","data-code-server-tab":"body"},p.createElement(Pc,{status:i,pageUrl:is(i,s),reloadTick:a,owner:"tab:"+r.id}))}function Qm(e){var t=e.sidebarRightTabs,r=e.sidebarRight;t==null||r==null||(e.effect(function(){return t.register({id:Cc,kind:qo,priority:"extension",title:function(){return"Code Server"},guide:[{order:20,title:function(){return"Code Server"},description:function(){return"\u5728\u53F3\u4FA7\u680F\u6807\u7B7E\u91CC\u8FD0\u884C VS Code \u7F51\u9875\u7248,\u8DDF\u968F\u5F53\u524D\u4F1A\u8BDD\u5DE5\u4F5C\u533A\u3002"},icon:Zm}]})},"code-server: sidebar tab type"),e.effect(function(){return e.slots.inject("sidebar.right.pane.tab",function(){return e.slots.register({name:"sidebar.right.pane.tab",key:Cc},Jm)})},"code-server: sidebar tab body"),_t.openTab=function(n){try{return r.openTab(qo,n!=null?{params:n}:void 0),!0}catch(i){return console.warn("[code-server] sidebar openTab failed:",i!=null&&i.message!=null?i.message:String(i)),!1}},e.effect(function(){return function(){_t.openTab=null,X({sidebarActive:!1})}},"code-server: sidebar mode reset"),X({sidebarActive:!0,open:!1}),console.log("[code-server] right-sidebar tab registered (kind="+qo+")"))}var ed=".dshcs-card{border:1px solid var(--dsw-alias-border-l2);background:var(--dsw-alias-bg-layer-3);border-radius:12px;list-style:none;transition:border-color .16s,background .16s}.dshcs-card:hover{border-color:var(--dsw-alias-label-dimmed,var(--dsw-alias-border-l2))}.dshcs-cardOpen{background:var(--dsw-alias-bg-layer-2);border-color:var(--dsw-alias-label-dimmed,var(--dsw-alias-border-l2))}.dshcs-cardHeader{appearance:none;width:100%;font:inherit;color:inherit;text-align:left;cursor:pointer;background:0 0;border:0;border-radius:12px;align-items:center;gap:12px;padding:14px 16px;display:flex}.dshcs-cardHeader:focus-visible{outline:2px solid var(--dsw-alias-brand-primary);outline-offset:-2px}.dshcs-cardHeadText{flex-direction:column;flex:1;gap:4px;min-width:0;display:flex}.dshcs-cardName{color:var(--dsw-alias-label-primary);font-size:15px;font-weight:600;line-height:1.4}.dshcs-cardDescription{color:var(--dsw-alias-label-tertiary,var(--dsw-alias-label-secondary));font-size:13px;line-height:1.5}.dshcs-cardChevron{color:var(--dsw-alias-label-tertiary,var(--dsw-alias-label-secondary));flex:none;transition:transform .16s;display:inline-flex}.dshcs-cardChevronOpen{transform:rotate(180deg)}.dshcs-cardBody{border-top:1px solid var(--dsw-alias-border-l2);margin:0 16px;padding-bottom:8px}.dshcs-cardReadOnly{color:var(--dsw-alias-label-tertiary,var(--dsw-alias-label-secondary));margin:12px 0 0;font-size:12px;line-height:1.5}.dshcs-pending{white-space:nowrap;background:var(--dsw-alias-bg-module-platform,var(--dsw-alias-bg-layer-2));color:var(--dsw-alias-label-secondary);border-radius:999px;flex:none;padding:1px 8px;font-size:11px;font-weight:500;line-height:17px}.dshcs-cardFooter{border-top:1px solid var(--dsw-alias-border-l2);justify-content:flex-end;align-items:center;gap:8px;padding:12px 0 4px;display:flex}.dshcs-cardFailed{min-width:0;color:var(--dsw-alias-label-error,var(--dsw-alias-state-error-primary));flex:1;margin:0;font-size:12px;line-height:1.5}.dshcs-cbtn{appearance:none;font:inherit;cursor:pointer;border-radius:8px;padding:5px 14px;font-size:13px;line-height:1.5;border:1px solid transparent;transition:color .12s ease,background .12s ease}.dshcs-cbtn:disabled{opacity:.4;cursor:default}.dshcs-cbtn:focus-visible{outline:2px solid var(--dsw-alias-brand-primary);outline-offset:1px}.dshcs-cbtnOutline{border-color:var(--dsw-alias-border-l2);color:var(--dsw-alias-label-secondary);background:0 0}.dshcs-cbtnOutline:hover:not(:disabled){color:var(--dsw-alias-label-primary);background:var(--dsw-alias-interactive-bg-hover,transparent)}.dshcs-cbtnPrimary{background:var(--dsw-alias-label-primary);color:var(--dsw-alias-bg-layer-3);border-color:var(--dsw-alias-label-primary);font-weight:600}.dshcs-cbtnPrimary:hover:not(:disabled){filter:brightness(.95)}.dshcs-cbtnPrimary:active:not(:disabled){filter:brightness(.9)}.dshcs-field{flex-direction:column;gap:6px;padding:12px 0;display:flex}.dshcs-field+.dshcs-field{border-top:1px solid var(--dsw-alias-border-l2)}.dshcs-fieldHead{align-items:center;gap:8px;display:flex}.dshcs-fieldLabel{min-width:0;color:var(--dsw-alias-label-primary);flex:1;font-size:13px;font-weight:500;line-height:1.5}.dshcs-hint{color:var(--dsw-alias-label-tertiary,var(--dsw-alias-label-secondary));margin:0;font-size:12px;line-height:1.5}.dshcs-check{display:flex;align-items:center;gap:8px;cursor:pointer}.dshcs-check input{accent-color:var(--dsw-alias-brand-primary);width:15px;height:15px;margin:0;flex:none}.dshcs-check input:disabled{cursor:default}.dshcs-badges{align-items:center;gap:8px;display:inline-flex}.dshcs-badge{white-space:nowrap;background:var(--dsw-alias-bg-module-platform,var(--dsw-alias-bg-layer-2));color:var(--dsw-alias-label-secondary);border-radius:999px;padding:1px 8px;font-size:11px;font-weight:500;line-height:17px}.dshcs-reset{font:inherit;color:var(--dsw-alias-label-secondary);cursor:pointer;background:0 0;border:none;padding:0;font-size:12px;line-height:1.5}.dshcs-reset:hover:not(:disabled){color:var(--dsw-alias-label-primary)}.dshcs-reset:disabled{cursor:default}",td="dsh-code-server/Card.module.css";function rd(e,t){if(typeof document!="undefined"&&document.querySelector("style[data-plugin-css="+JSON.stringify(e)+"]")===null){var r=document.createElement("style");r.dataset.plugin="dsh-code-server",r.dataset.pluginCss=e,r.textContent=t,document.head.appendChild(r)}}rd(td,ed);function nd(e){return p.createElement("svg",{width:14,height:14,viewBox:"0 0 14 14",fill:"none","aria-hidden":!0,className:e.className},p.createElement("path",{d:"M3.5 5.25L7 8.75L10.5 5.25",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"}))}function bi(e){return p.createElement("button",{type:"button",className:"dshcs-cbtn "+(e.variant==="primary"?"dshcs-cbtnPrimary":"dshcs-cbtnOutline"),disabled:e.disabled===!0,onClick:e.onClick},e.children)}function Zo(e){return p.createElement("label",{className:"dshcs-check"},p.createElement("input",{type:"checkbox",checked:e.checked===!0,disabled:e.disabled===!0,onChange:function(t){e.onChange(t.target.checked)}}),p.createElement("span",{className:"dshcs-hint"},e.children))}function Jo(e){var t=[];return e.overridden===!0&&(t.push(p.createElement("span",{className:"dshcs-badge"},e.overriddenLabel)),t.push(p.createElement("button",{type:"button",className:"dshcs-reset",disabled:e.disabled===!0,onClick:e.onReset},e.resetLabel))),t.length===0?null:p.createElement("span",{className:"dshcs-badges"},...t)}function id(e){var[t,r]=p.useState(!1),n=e.state;if(n==null||n.available!==!0)return null;var i=e.title,s=n.dirty!==!0||n.invalid===!0||n.saving===!0;return p.createElement("li",{className:"dshcs-card"+(t?" dshcs-cardOpen":"")},p.createElement("button",{type:"button",className:"dshcs-cardHeader","aria-expanded":t,onClick:function(){r(!t)}},p.createElement("span",{className:"dshcs-cardHeadText"},p.createElement("span",{className:"dshcs-cardName"},i),p.createElement("span",{className:"dshcs-cardDescription"},e.description)),n.dirty===!0?p.createElement("span",{className:"dshcs-pending"},e.unsavedLabel):null,p.createElement(nd,{className:"dshcs-cardChevron"+(t?" dshcs-cardChevronOpen":"")})),t===!0?p.createElement("div",{className:"dshcs-cardBody"},n.writable!==!0?p.createElement("p",{className:"dshcs-cardReadOnly",role:"status"},e.readOnlyLabel):null,e.children,p.createElement("div",{className:"dshcs-cardFooter"},n.failed===!0?p.createElement("p",{className:"dshcs-cardFailed",role:"status"},e.saveFailedLabel):null,p.createElement(bi,{disabled:n.dirty!==!0||n.saving===!0,onClick:e.onDiscard},e.discardLabel),p.createElement(bi,{variant:"primary",disabled:s,onClick:e.onSave},n.saving===!0?e.savingLabel:e.saveLabel))):null)}function od(e){try{let I=function(){me("/code-server/status").then(function(k){k!=null&&typeof k=="object"&&X({status:k})}).catch(function(){})};var t=e.scope,[r,n]=p.useState(function(){return t!==void 0?t.getSnapshot():null}),[i,s]=p.useState(null),[o,a]=p.useState(!1),[u,c]=p.useState(!1),l=Yt(),[f,m]=p.useState(yc());if(p.useEffect(function(){return xc(function(k){m(k)})},[]),p.useEffect(function(){if(t===void 0||typeof t.subscribe!="function")return;function k(){try{n(t.getSnapshot())}catch(Ti){}}var N=t.subscribe(k);return function(){typeof N=="function"&&N()}},[t]),t===void 0)return console.error("[code-server] card scope missing"),null;if(r==null||r.status!=="ready")return r!=null&&r.status==="unavailable"&&console.warn("[code-server] settings scope unavailable:",r.status),null;var d=r.value!==void 0&&r.value!==null?r.value:{},h=r.user,g={reserveComposer:d.reserveComposer!==!1,windowedOpen:d.windowedOpen===!0,keepResident:d.keepResident!==!1},x=h!=null&&Object.prototype.hasOwnProperty.call(h,"reserveComposer"),y=h!=null&&Object.prototype.hasOwnProperty.call(h,"windowedOpen"),T=h!=null&&Object.prototype.hasOwnProperty.call(h,"keepResident"),w=l!=null&&l.sidebarActive===!0,v=i!==null&&(i.reserveComposer!==g.reserveComposer||i.windowedOpen!==g.windowedOpen||i.keepResident!==g.keepResident),C=!v||o,D={available:!0,writable:r.writable,dirty:v,invalid:!1,saving:o,failed:u,reserveComposer:{text:i!==null?i.reserveComposer:g.reserveComposer,overridden:x}};async function de(){if(v&&!o){a(!0),c(!1);try{var k=i!==null?i:g;await e.scope.set("reserveComposer",k.reserveComposer===!0),await e.scope.set("windowedOpen",k.windowedOpen===!0),await e.scope.set("keepResident",k.keepResident===!0),s(null),I()}catch(N){c(!0)}a(!1)}}async function Y(){if(!(o||r.writable!==!0)){a(!0),c(!1);try{typeof e.scope.unset=="function"?(await e.scope.unset("reserveComposer"),await e.scope.unset("windowedOpen"),await e.scope.unset("keepResident")):(await e.scope.set("reserveComposer",d.reserveComposer===void 0||d.reserveComposer===null?!0:d.reserveComposer),await e.scope.set("windowedOpen",d.windowedOpen===!0),await e.scope.set("keepResident",d.keepResident===void 0||d.keepResident===null?!0:d.keepResident)),s(null),I()}catch(k){c(!0)}a(!1)}}var[V,P]=p.useState(null),[H,E]=p.useState(!1),O=p.createElement("div",{className:"dshcs-field"},p.createElement("div",{className:"dshcs-fieldHead"},p.createElement("span",{className:"dshcs-fieldLabel"},"\u73AF\u5883\u68C0\u6D4B"),p.createElement("span",{className:"dshcs-badges"},p.createElement(bi,{variant:"primary",disabled:H,onClick:async function(){E(!0);var k=await me("/code-server/status");P(k!=null&&k.env!=null?k.env:{error:"status \u672A\u8FD4\u56DE env"}),E(!1)}},H?"\u68C0\u6D4B\u4E2D\u2026":"\u68C0\u6D4B\u73AF\u5883"))),V!=null?p.createElement("div",{className:"dshcs-hint",style:{marginTop:6}},V.error!=null?p.createElement("span",null,"\u68C0\u6D4B\u5931\u8D25: "+V.error):p.createElement("span",null,"\u72B6\u6001: "+(V.ok===!0?"\u2705 \u5C31\u7EEA":"\u274C \u4E0D\u901A\u8FC7")+(V.treeVersion!=null?" \xB7 VS Code \u6811: "+V.treeVersion:"")+(V.upToDate===!1&&V.vendored!=null?"(\u5185\u7F6E "+V.vendored+") ":"")+(V.productPath!=null?" \xB7 \u5BA2\u6237\u7AEF\u8DEF\u5F84: "+V.productPath:"")+(V.entry!=null?" \xB7 \u5165\u53E3: "+V.entry:" \xB7 \u5165\u53E3\u7F3A\u5931")+" \xB7 VS Code \u5185\u90E8\u4F9D\u8D56: "+(V.vscodeInner===!0?"\u2705":"\u274C")+" \xB7 \u9884\u7F16\u8BD1\u539F\u751F\u5305: "+(V.nativeRuntime!=null&&V.nativeRuntime.packages>0?"\u2705 "+V.nativeRuntime.name+"@"+(V.nativeRuntime.version!=null?V.nativeRuntime.version:"?")+"("+V.nativeRuntime.packages+" \u5305)":"\u274C \u672A\u5B89\u88C5("+(V.nativeRuntime!=null&&V.nativeRuntime.name!=null?V.nativeRuntime.name:"\u5E73\u53F0\u805A\u5408\u5305")+")"))):p.createElement("div",{className:"dshcs-hint",style:{marginTop:6}},'\u70B9\u51FB"\u68C0\u6D4B\u73AF\u5883"\u67E5\u770B VS Code \u6811\u72B6\u6001(\u4F9D\u8D56\u7531\u5305\u7BA1\u7406\u5668\u5B89\u88C5,\u65E0\u9700\u5B89\u88C5\u6B65\u9AA4)'),p.createElement("div",{className:"dshcs-hint",style:{marginTop:10,color:"var(--dsw-alias-label-tertiary,var(--dsw-alias-label-secondary))"}},"\u8FD0\u884C\u4F4D\u7F6E: "+(V!=null&&V.tree!=null?V.tree:"<\u63D2\u4EF6\u76EE\u5F55>\\vendor\\vscode")+`
3
- \u5378\u8F7D: dsh plugin --profile web remove dsh-code-server-app`));return p.createElement(id,{title:"Code Server",description:"\u5165\u53E3:\u53F3\u4FA7\u680F\u6807\u7B7E(DSH \u2265 0.1.5-alpha.1)/ \u60AC\u6D6E\u7403\u56DE\u9000;\u7A97\u53E3\u5316\u8BBE\u7F6E\u63A7\u5236\u65B0\u6807\u7B7E\u9875\u6253\u5F00",state:D,unsavedLabel:"\u672A\u4FDD\u5B58",readOnlyLabel:"\u672C\u90E8\u7F72\u7684\u8BBE\u7F6E\u4E3A\u53EA\u8BFB\u3002",saveFailedLabel:"\u672C\u90E8\u7F72\u6CA1\u6709\u63A5\u53D7\u8FD9\u4E9B\u503C\uFF0C\u5DF2\u4FDD\u7559\u4F9B\u4F60\u4FEE\u6539\u3002",discardLabel:"\u653E\u5F03\u4FEE\u6539",saveLabel:"\u4FDD\u5B58",savingLabel:"\u4FDD\u5B58\u4E2D\u2026",onSave:de,onDiscard:function(){s(null),c(!1)}},p.createElement("div",{className:"dshcs-field"},p.createElement("div",{className:"dshcs-fieldHead"},p.createElement("span",{className:"dshcs-fieldLabel"},"\u5165\u53E3"),p.createElement("span",{className:"dshcs-badges"},p.createElement(bi,{disabled:w!==!0,onClick:function(){_t.openTab!==null&&_t.openTab(null)}},"\u5728\u53F3\u4FA7\u680F\u6253\u5F00"))),p.createElement("div",{className:"dshcs-hint",style:{marginTop:6}},w===!0?"\u5F53\u524D:\u53F3\u4FA7\u680F\u6807\u7B7E(DSH \u2265 0.1.5-alpha.1)\u3002\u4ECE\u53F3\u4FA7\u680F\u300C\u5F00\u59CB\u300D\u9875\u7684 Code Server \u5165\u53E3\u6846\u3001\u4EA7\u7269\u65C1\u6309\u94AE\u6216\u4E0A\u9762\u7684\u6309\u94AE\u6253\u5F00\u3002":"\u5F53\u524D:\u60AC\u6D6E\u7403(\u672C\u90E8\u7F72\u65E0\u53F3\u4FA7\u680F\u670D\u52A1)\u3002\u70B9\u51FB\u53F3\u4E0B\u89D2\u60AC\u6D6E\u7403\u5C55\u5F00\u6D6E\u7A97\u3002")),w===!0?null:p.createElement("div",{className:"dshcs-field"},p.createElement("div",{className:"dshcs-fieldHead"},p.createElement("span",{className:"dshcs-fieldLabel"},"\u4FDD\u7559\u8F93\u5165\u6846\u4E0A\u65B9\u7A7A\u95F4"),x===!0?p.createElement(Jo,{overridden:!0,disabled:r.writable!==!0,overriddenLabel:"\u5DF2\u8986\u76D6",resetLabel:"\u6062\u590D\u9ED8\u8BA4",onReset:function(){Y()}}):null),p.createElement(Zo,{checked:i!==null?i.reserveComposer:g.reserveComposer,disabled:r.writable!==!0,onChange:function(k){s(function(N){return Object.assign({},N!==null?N:g,{reserveComposer:k===!0})}),c(!1)}},"\u5F00\u542F\u65F6\u7A97\u53E3\u521D\u59CB/\u7F29\u653E/\u6700\u5927\u5316\u6B62\u4E8E\u8F93\u5165\u6846\u4E0A\u65B9;\u5173\u95ED\u540E\u5141\u8BB8\u76D6\u4F4F\u8F93\u5165\u6846(\u6700\u5927\u5316\u5230\u89C6\u53E3\u5E95)")),p.createElement("div",{className:"dshcs-field"},p.createElement("div",{className:"dshcs-fieldHead"},p.createElement("span",{className:"dshcs-fieldLabel"},"\u7A97\u53E3\u5316\u6253\u5F00(\u65B0\u6807\u7B7E\u9875)"),y===!0?p.createElement(Jo,{overridden:!0,disabled:r.writable!==!0,overriddenLabel:"\u5DF2\u8986\u76D6",resetLabel:"\u6062\u590D\u9ED8\u8BA4",onReset:function(){Y()}}):null),p.createElement(Zo,{checked:i!==null?i.windowedOpen:g.windowedOpen,disabled:r.writable!==!0,onChange:function(k){s(function(N){return Object.assign({},N!==null?N:g,{windowedOpen:k===!0})}),c(!1)}},"\u5F00\u542F\u540E\u5165\u53E3(\u4EA7\u7269\u6309\u94AE/\u8BBE\u7F6E\u5361/\u60AC\u6D6E\u7403)\u5728\u6D4F\u89C8\u5668\u65B0\u6807\u7B7E\u9875\u6253\u5F00 code-server(\u81EA\u52A8\u542F\u52A8\u5E76\u8DDF\u968F\u5F53\u524D\u5DE5\u4F5C\u533A);\u5173\u95ED\u5219\u4F7F\u7528\u53F3\u4FA7\u680F\u6807\u7B7E\u6216\u5185\u90E8\u6D6E\u52A8\u7A97\u53E3")),p.createElement("div",{className:"dshcs-field"},p.createElement("div",{className:"dshcs-fieldHead"},p.createElement("span",{className:"dshcs-fieldLabel"},"\u540E\u53F0\u5E38\u9A7B(\u5207\u6807\u7B7E\u4E0D\u91CD\u8F7D)"),T===!0?p.createElement(Jo,{overridden:!0,disabled:r.writable!==!0,overriddenLabel:"\u5DF2\u8986\u76D6",resetLabel:"\u6062\u590D\u9ED8\u8BA4",onReset:function(){Y()}}):null),p.createElement(Zo,{checked:i!==null?i.keepResident:g.keepResident,disabled:r.writable!==!0,onChange:function(k){s(function(N){return Object.assign({},N!==null?N:g,{keepResident:k===!0})}),c(!1)}},'\u5F00\u542F\u540E\u5BBF\u4E3B\u542F\u52A8\u5373\u628A IDE \u52A0\u8F7D\u5230\u540E\u53F0"\u505C\u653E\u533A":\u5207\u6362\u53F3\u4FA7\u680F\u6807\u7B7E\u3001\u6536\u8D77/\u5C55\u5F00\u4FA7\u680F\u3001\u62D6\u6210\u6D6E\u52A8\u7A97\u53E3\u90FD\u4E0D\u518D\u91CD\u8F7D,\u9996\u6B21\u6253\u5F00\u514D\u7B49\u5F85;\u5173\u95ED\u5219\u53EA\u5728\u6253\u5F00\u9762\u677F\u65F6\u52A0\u8F7D(\u7701\u5185\u5B58)'),p.createElement("div",{className:"dshcs-hint",style:{marginTop:4}},Fr?"\u5E38\u9A7B\u9762:"+(f.docked?"\u5DF2\u505C\u9760":f.ready?"\u5DF2\u505C\u653E(\u540E\u53F0\u8FD0\u884C\u4E2D)":"\u672A\u542F\u52A8")+(f.degraded?" \xB7 \u672C\u6B21\u53D1\u751F\u8FC7\u964D\u7EA7\u91CD\u8F7D":""):"\u5F53\u524D\u6D4F\u89C8\u5668\u4E0D\u652F\u6301 Element.moveBefore(Chromium <133)\u2192 \u5E38\u9A7B\u4E0D\u53EF\u7528,\u5207\u6807\u7B7E\u4ECD\u4F1A\u6574\u9875\u91CD\u8F7D(\u5347\u7EA7\u6D4F\u89C8\u5668\u540E\u81EA\u52A8\u751F\u6548)")),p.createElement("div",{className:"dshcs-field"},p.createElement("div",{className:"dshcs-fieldHead"},p.createElement("span",{className:"dshcs-fieldLabel"},"\u4F9D\u8D56\u5B89\u88C5"),null),p.createElement("div",{className:"dshcs-hint",style:{marginTop:4}},"0.1.36 \u8D77 code-server \u672C\u4F53\u968F\u63D2\u4EF6\u5305\u53D1\u5E03,VS Code \u5185\u90E8\u4F9D\u8D56\u4E0E\u9884\u7F16\u8BD1\u539F\u751F\u6A21\u5757(\u5E73\u53F0\u805A\u5408\u5305)\u5168\u90E8\u7531\u5305\u7BA1\u7406\u5668\u5728 dsh plugin add \u65F6\u5B89\u88C5,\u4E0D\u518D\u9700\u8981\u300C\u5B89\u88C5\u73AF\u5883\u300D\u6B65\u9AA4\u3002")),O)}catch(I){return console.error("[code-server] card render error:",I!=null&&I.message!==void 0?I.message:String(I)),null}}function sd(e){var t=[];try{var r=e.turn.data.get("deliverables"),n=e.seq!=null?e.seq:Number.POSITIVE_INFINITY;if(r!=null&&Array.isArray(r.produced))for(var i={},s=0;s<r.produced.length;s++){var o=r.produced[s];o==null||typeof o.path!="string"||o.path===""||o.seq!=null&&o.seq>n||i[o.path]!==!0&&(i[o.path]=!0,t.push(o.path))}}catch(a){}return t}function ad(e){var t=sd(e);return t.length===0?null:t}function ld(e){return p.createElement("img",{src:ns,alt:"","aria-hidden":!0,draggable:!1,style:{width:15,height:15,display:"block",objectFit:"contain",WebkitUserDrag:"none",userSelect:"none"}})}function cd(e){var t=Yt();if(e==null||!Array.isArray(e.matched)||e.matched.length===0)return null;var r=e.matched;function n(s){var o=String(s).replace(/\\/g,"/"),a=o.lastIndexOf("/");return a>=0?o.slice(a+1):o}function i(s){var o=t.status;if(o!=null&&o.windowedOpen===!0){Ec(Gr(e.useSessions,e.useWorkspaces));return}t.sidebarActive===!0&&_t.openTab!==null&&_t.openTab({path:s})===!0||(X({open:!0}),me("/code-server/open-file",{file:s}).then(function(a){(a==null||a.ok!==!0)&&window.alert(a!=null&&a.error?a.error:"\u6253\u5F00\u5931\u8D25")}).catch(function(a){window.alert("\u6253\u5F00\u5931\u8D25: "+String(a))}))}return p.createElement("div",{className:"dshcs-artifacts"},p.createElement("span",{className:"dshcs-artlabel"},"\u4EA7\u7269"),p.createElement("div",{className:"dshcs-artrow"},r.slice(0,6).map(function(s){return p.createElement("span",{key:s,className:"dshcs-artitem"},p.createElement("button",{type:"button",className:"dshcs-artfile",title:s,"aria-label":"\u6253\u5F00: "+s,onClick:function(){i(s)}},n(s)),p.createElement("button",{type:"button",className:"dshcs-artbtn",title:"\u5728 Code Server \u6253\u5F00: "+s,"aria-label":"\u5728 Code Server \u6253\u5F00: "+s,onClick:function(){i(s)}},p.createElement(ld,null)))}),r.length>6?p.createElement("span",{className:"dshcs-artmore"},"\u2026"):null))}function ud(e){try{fd(e)}catch(t){console.error("[code-server] apply failed:",t&&t.stack?t.stack:String(t));try{document.title="CS-ERR "+(t&&t.message||String(t))}catch(r){}}}function fd(e){var t=e.get("slots");if(t===void 0){console.error("[code-server] slots service unavailable");return}var r=e.settingsScope,n=null;if(r!==void 0&&typeof r.bind=="function")n=r.bind({namespace:"code-server"});else{console.error("[code-server] settingsScope unavailable (inject missing?); settings card disabled");return}me("/code-server/status").then(function(i){X({status:i})}).catch(function(){}),t.inject("shell.overlay",()=>t.register({name:"shell.overlay",id:"code-server",order:70,label:"Code Server"},i=>p.createElement(p.Fragment,null,p.createElement(Xm,i),p.createElement(qm,i),p.createElement(Bm,i))));try{t.inject("conversation.chat.turnTail",function(){return t.register({name:"conversation.chat.turnTail",priority:-9,id:"dshcs-open-file",select:ad},cd)}),console.log("[code-server] turnTail artifacts buttons registered")}catch(i){console.warn("[code-server] turnTail register failed:",i!=null&&i.message!=null?i.message:String(i))}t.inject("settings.plugin.item",()=>t.register({name:"settings.plugin.item",key:"code-server",label:"Code Server",inject:function(){return{scope:n}}},od));try{typeof e.inject=="function"?e.inject(["sidebarRightTabs","sidebarRight"],function(i){try{Qm(i)}catch(s){console.warn("[code-server] sidebar tab registration failed; keep floating ball:",s!=null&&s.message!=null?s.message:String(s))}}):console.warn("[code-server] ctx.inject unavailable; keep floating ball")}catch(i){console.warn("[code-server] sidebar inject failed; keep floating ball:",i!=null&&i.message!=null?i.message:String(i))}console.log("[code-server] client bundle registered (floating ball + window + settings card; right-sidebar tab pending/active)")}var md=["slots","settingsScope"],dd="code-server";
2
+ var z=Object.defineProperty;var pe=Object.getOwnPropertyDescriptor;var be=Object.getOwnPropertyNames;var he=Object.prototype.hasOwnProperty;var ve=(e,r)=>{for(var n in r)z(e,n,{get:r[n],enumerable:!0})},me=(e,r,n,s)=>{if(r&&typeof r=="object"||typeof r=="function")for(let l of be(r))!he.call(e,l)&&l!==n&&z(e,l,{get:()=>r[l],enumerable:!(s=pe(r,l))||s.enumerable});return e};var ge=e=>me(z({},"__esModule",{value:!0}),e);var $e={};ve($e,{apply:()=>Je,inject:()=>Xe,name:()=>Ke});module.exports=ge($e);var C=typeof Element!="undefined"&&typeof Element.prototype.moveBefore=="function",ye=-2e4,t={park:null,frame:null,currentSrc:null,sameOrigin:null,owner:null,lastRect:null,parkStrategy:"offscreen",degraded:!1,preloaded:!1,nudgeCount:0,nudgeEnabled:!0,lastNudgeAt:0,listeners:new Set};function I(){return{ready:t.frame!==null,docked:t.owner!==null,owner:t.owner,src:t.currentSrc,sameOrigin:t.sameOrigin,parkStrategy:t.parkStrategy,degraded:t.degraded,preloaded:t.preloaded,supportsMoveBefore:C,nudgeCount:t.nudgeCount,lastNudgeAt:t.lastNudgeAt}}function T(){var e=I();t.listeners.forEach(function(r){try{r(e)}catch(n){}})}function J(e){return t.listeners.add(e),function(){t.listeners.delete(e)}}function q(){return I()}function we(e){e!=="offscreen"&&e!=="behind"||t.parkStrategy!==e&&(t.parkStrategy=e,t.frame!==null&&t.owner===null&&P(),T())}function xe(){return t.parkStrategy}function ke(){var e=t.lastRect;e!==null&&(t.park.style.width=Math.max(1,Math.round(e.width))+"px",t.park.style.height=Math.max(1,Math.round(e.height))+"px")}function P(){if(t.park!==null){if(ke(),t.parkStrategy==="behind"&&t.lastRect!==null){t.park.style.left=Math.round(t.lastRect.left)+"px",t.park.style.top=Math.round(t.lastRect.top)+"px",t.park.style.visibility="visible",t.park.style.zIndex="0";return}t.park.style.left=ye+"px",t.park.style.top="0px",t.park.style.visibility="hidden",t.park.style.zIndex="0"}}function X(){t.frame!==null&&(t.frame.setAttribute("inert",""),t.frame.setAttribute("aria-hidden","true"))}function Se(){t.frame!==null&&(t.frame.removeAttribute("inert"),t.frame.removeAttribute("aria-hidden"))}function Ee(){var e=document.createElement("div");e.className="dshcs-park",e.setAttribute("data-dshcs-park",""),e.setAttribute("aria-hidden","true");var r=document.createElement("iframe");return r.className="dshcs-frame",r.setAttribute("title","code-server"),r.setAttribute("allow","clipboard-read; clipboard-write"),r.setAttribute("data-dshcs-resident",""),r.src="about:blank",e.appendChild(r),document.body.appendChild(e),t.park=e,t.frame=r,t.currentSrc="about:blank",t.owner=null,P(),X(),r}function Ne(e){var r=t.frame;if(r!==null){var n=t.sameOrigin!==e;!n&&r.hasAttribute("data-dshcs-attrs")||(e===!0?r.removeAttribute("sandbox"):e===!1&&r.setAttribute("sandbox","allow-scripts allow-same-origin allow-forms allow-modals allow-popups allow-pointer-lock allow-clipboard-read allow-clipboard-write"),r.setAttribute("data-dshcs-attrs",e===!0?"same-origin":"cross-origin"),t.sameOrigin=e)}}function H(e){var r=e||{};return t.frame===null&&Ee(),typeof r.sameOrigin=="boolean"&&Ne(r.sameOrigin),typeof r.src=="string"&&r.src!==""&&r.src!==t.currentSrc&&Ce(r.src),t.frame}function Ce(e){t.frame===null||typeof e!="string"||e===""||e===t.currentSrc||(t.currentSrc=e,t.frame.src=e,T())}function K(){var e=t.frame;if(t.nudgeEnabled!==!0||e===null||e.isConnected!==!0)return!1;var r=e.style.display;return e.style.display="none",e.offsetHeight,e.style.display=r,t.nudgeCount+=1,t.lastNudgeAt=Date.now(),!0}function Te(e){return t.nudgeEnabled=e!==!1,t.nudgeEnabled}function $(e){if(t.frame!==null){if(C)try{e.moveBefore(t.frame,null);return}catch(r){t.degraded=!0,t.lastMoveError=(r&&r.name?r.name+": ":"")+(r&&r.message?r.message:String(r))}else t.degraded=!0;e.appendChild(t.frame)}}function U(e,r){if(!(t.frame===null||e==null)){var n=t.owner===null,s=e.getBoundingClientRect();s.width>=1&&s.height>=1&&(t.lastRect={left:s.left,top:s.top,width:s.width,height:s.height}),t.owner=r===void 0?null:r,Se(),t.park.setAttribute("aria-hidden","true"),$(e),n&&K(),T()}}function L(e){t.frame!==null&&(e!==void 0&&t.owner!==e||(t.owner=null,P(),X(),t.park.setAttribute("aria-hidden","true"),$(t.park),T()))}function B(e){var r=e||{};return H(r),t.owner===null&&(typeof r.src=="string"&&r.src!==""&&(t.preloaded=!0),L()),t.frame}function Le(){t.park!==null&&t.park.parentNode!==null&&t.park.parentNode.removeChild(t.park),t.park=null,t.frame=null,t.currentSrc=null,t.sameOrigin=null,t.owner=null,t.lastRect=null,t.degraded=!1,t.preloaded=!1,t.nudgeCount=0,t.lastNudgeAt=0,T()}typeof window!="undefined"&&(window.__dshcsSurface={snapshot:I,setParkStrategy:we,getParkStrategy:xe,preload:B,dock:U,park:L,nudge:K,setNudgeEnabled:Te,destroy:Le});var a=require("react"),V=new Set,R={status:null,busy:!1,sidebarActive:!1,sidebarUi:"unknown",sidebarRegisterFailed:!1};function k(e){R=Object.assign({},R,e),V.forEach(function(r){r()})}function Oe(e){return V.add(e),function(){V.delete(e)}}function W(){return R}function D(){return a.useSyncExternalStore(Oe,W)}var Re="/api",le="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTAwJSIgaGVpZ2h0PSIxMDAlIiB2aWV3Qm94PSIwIDAgMTQ3IDE0NyIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KICA8c3R5bGU+QG1lZGlhIChwcmVmZXJzLWNvbG9yLXNjaGVtZTogZGFyaykgeyogeyBmaWxsOiB3aGl0ZTsgfX08L3N0eWxlPgogIDxwYXRoIGQ9Im00Mi40MjE0LDM5LjY1NWMtMjQuNDA1NywwIC00Mi4xNTU0LDEzLjE3MjEgLTQyLjE1NTQsMzMuODQ1YzAsMjAuNTgxNCAxOC40ODkyLDMzLjg0NSA0Mi4xNTU0LDMzLjg0NWMyMy42NjYyLDAgMzguMTgwMywtMTEuNjE3MSAzOC43MzQ5LC0yOC43MjI1bC0yMS4wNzc3LC0wLjQ1NzRjLTAuOTI0NCw5LjMzMDMgLTkuMTA1OSwxNS4xODQ1IC0xNy42NTcyLDE1LjE4NDVjLTExLjc0MDYsMCAtMjAuNDMwNiwtNy41OTIyIC0yMC40MzA2LC0xOS44NDk2YzAsLTEyLjI1NzQgOC42OSwtMTkuOTg2OCAyMC40MzA2LC0yMC4yMTU1YzguNTUxMywtMC4xODMgMTYuOTE3Nyw1Ljk0NTcgMTcuNDcyMywxNS4yNzZsMjEuMDc3NywtMC42NDAzYy0wLjQ2MjIsLTE2LjgzMTEgLTE0LjE0NDIsLTI4LjI2NTIgLTM4LjU1LC0yOC4yNjUyem00OC44NDQ2LDJsNTUuNDY4LDBsMCw2NC4wMzExbC01NS40NjgsMGwwLC02NC4wMzExeiIgY2xpcC1ydWxlPSJldmVub2RkIiBmaWxsLXJ1bGU9ImV2ZW5vZGQiLz4KPC9zdmc+Cg==";async function x(e,r){var n={method:r===void 0?"GET":"POST",headers:{}};r!==void 0&&(n.headers["content-type"]="application/json",n.body=JSON.stringify(r));var s=await fetch(Re+e,n),l=await s.text(),i=null;try{i=l===""?null:JSON.parse(l)}catch(d){i=null}return s.ok?i!==null?i:{ok:!1,error:"invalid JSON response"}:{ok:!1,error:"HTTP "+s.status+(i!==null&&i.error!==void 0?": "+i.error:"")}}function M(e,r){try{var n=e(function(p){return p}),s=r===null?null:typeof r=="function"?r(function(p){return p}):null,l=n!=null?n.current:void 0;if(l!==void 0&&n!=null&&n.byId!=null){var i=n.byId[l];if(i!=null&&typeof i.cwd=="string"&&i.cwd!=="")return i.cwd}var d=s!=null&&Array.isArray(s.items)?s.items:[];if(l!==void 0)for(var c=0;c<d.length;c++){var v=d[c];if(v.sessionIds!=null&&v.sessionIds.indexOf(l)!==-1&&typeof v.path=="string"&&v.path!=="")return v.path}var u=s!=null?s.recentWorkspaceId:void 0;if(u!==void 0){for(var b=0;b<d.length;b++)if(d[b].workspaceId===u&&typeof d[b].path=="string"&&d[b].path!=="")return d[b].path}if(d.length>0&&typeof d[0].path=="string"&&d[0].path!=="")return d[0].path}catch(p){}}function F(e,r){if(e==null||typeof e.url!="string"||e.url==="")return null;var n=typeof r=="string"&&r!==""?r:e!=null&&e.cwd!=null?e.cwd:null;if(n==null||n==="")return e.url;var s=n.replace(/\\/g,"/"),l=s;return(/^[A-Za-z]:\//.test(s)||s.charCodeAt(0)!==47)&&(l="/"+s),e.url+"?folder="+encodeURIComponent(l)}function Me(e){var r=e.status,n=e.pageUrl,s=e.reloadTick,l=e.owner,i=a.useRef(null),d=r!=null&&r.ok===!0&&r.running===!0,c=r!=null&&r.status==="starting",v=r!=null&&r.ok===!1,u=r!=null&&r.serve==="dsh";if(a.useLayoutEffect(function(){if(!d||n===null){L(l);return}H({src:n,sameOrigin:u}),i.current!==null&&U(i.current,l)},[d,n,u,s,l]),a.useLayoutEffect(function(){return function(){L(l)}},[l]),d&&n!==null)return a.createElement("div",{ref:i,className:"dshcs-slot","data-code-server-slot":l!=null?l:"code-server"});if(c)return a.createElement("div",{className:"dshcs-loading"},"\u6B63\u5728\u542F\u52A8 code-server\u2026");var b=v&&r!=null&&r.error?r.error:"code-server \u672A\u8FD0\u884C",p=u?"\u5F53\u524D\u4EE5 DSH \u540C\u6E90\u8DEF\u5F84 "+(r!=null&&r.url||"/code-server/")+" \u63D0\u4F9B(\u65E0\u72EC\u7ACB\u7AEF\u53E3)\u3002":"\u5F53\u524D\u4EE5\u72EC\u7ACB\u56DE\u73AF\u7AEF\u53E3\u63D0\u4F9B(\u7AEF\u53E3 "+(r!=null&&r.port!=null?r.port:"8090")+" \u88AB\u5360\u7528\u65F6\u8BF7\u91CA\u653E\u6216\u4FEE\u6539 port \u914D\u7F6E)\u3002",m=C?"\u5E38\u9A7B\u9762:\u53EF\u7528(\u5207\u6807\u7B7E/\u6536\u8D77\u4FA7\u680F\u4E0D\u91CD\u8F7D)\u3002":"\u5E38\u9A7B\u9762:\u5F53\u524D\u6D4F\u89C8\u5668\u4E0D\u652F\u6301 Element.moveBefore \u2014\u2014 \u5207\u6807\u7B7E\u4F1A\u6574\u9875\u91CD\u8F7D(\u5347\u7EA7\u6D4F\u89C8\u5668\u540E\u81EA\u52A8\u53EF\u7528)\u3002";return a.createElement("div",{className:"dshcs-empty"},a.createElement("div",{className:"dshcs-emptybox"},a.createElement("div",null,v?"code-server \u542F\u52A8\u5931\u8D25":"code-server \u672A\u8FD0\u884C"),a.createElement("pre",{className:"dshcs-error"},b),a.createElement("p",{className:"dshcs-hint"},"VS Code \u6811\u968F\u63D2\u4EF6\u5305\u5185\u7F6E\u3001\u5C31\u5730\u8FD0\u884C(\u65E0\u9700\u5168\u5C40\u5B89\u88C5\u3001\u65E0\u9700\u8054\u7F51\u5B89\u88C5\u3001\u65E0\u300C\u5B89\u88C5\u73AF\u5883\u300D\u6B65\u9AA4);\u5185\u90E8\u4F9D\u8D56\u4E0E\u9884\u7F16\u8BD1\u539F\u751F\u6A21\u5757\u7531\u5305\u7BA1\u7406\u5668\u5728\u5B89\u88C5\u63D2\u4EF6\u65F6\u4E00\u5E76\u88C5\u597D(\u65E0\u9700 C++ \u5DE5\u5177\u94FE)\u3002\u82E5\u6B64\u5904\u957F\u671F\u672A\u8FD0\u884C,\u8BF7\u5230 \u8BBE\u7F6E \u2192 \u63D2\u4EF6 \u2192 Code Server \u70B9\u300C\u68C0\u6D4B\u73AF\u5883\u300D\u67E5\u770B\u539F\u56E0\u3002"+p+m)))}function Ae(e){var r=D(),n=r.status,s=n!=null&&n.ok===!0&&n.running===!0,l=n!=null&&n.keepResident===!0,i=M(e&&e.useSessions,e&&e.useWorkspaces),d=s?F(n,i):null;return a.useEffect(function(){!l||!s||d===null||B({src:d,sameOrigin:n!=null&&n.serve==="dsh"})},[l,s,d,n!=null?n.serve:null]),null}function ee(e){var r=function(s){var l=F(s,e);l!=null&&typeof window.open=="function"&&window.open(l,"_blank","noopener")},n=W().status;if(n!=null&&n.running===!0){r(n);return}W().busy!==!0&&(k({busy:!0}),x("/code-server/start",typeof e=="string"?{cwd:e}:{}).then(function(s){k({status:s,busy:!1}),r(s)}).catch(function(){k({busy:!1})}))}var De=".dshcs-artbtn{appearance:none;display:inline-grid;place-items:center;width:22px;height:22px;padding:0;border:1px solid var(--dsw-alias-border-l2,#dfe3eb);border-radius:6px;color:var(--dsw-alias-label-secondary,#566174);background:color-mix(in srgb,var(--dsw-alias-bg-base,#fff) 60%,transparent);cursor:pointer;transition:color .12s ease,background .12s ease,border-color .12s ease;vertical-align:middle}.dshcs-artbtn:hover{color:var(--dsw-alias-label-primary,#172033);border-color:color-mix(in srgb,var(--dshcs-accent,#5b6cff) 40%,var(--dsw-alias-border-l2,#dfe3eb));background:color-mix(in srgb,var(--dshcs-accent,#5b6cff) 8%,transparent)}.dshcs-artbtn:active{transform:scale(.94)}.dshcs-artbtn:focus-visible{outline:2px solid color-mix(in srgb,var(--dshcs-accent,#5b6cff) 65%,transparent);outline-offset:1px}.dshcs-artifacts{display:grid;grid-template-columns:max-content minmax(0,1fr);align-items:center;gap:6px 8px;margin-top:16px;font-size:13px;line-height:22px;position:relative}.dshcs-artlabel{color:var(--dsw-alias-label-tertiary,#7d8798);grid-area:1/1}.dshcs-artrow{flex-wrap:nowrap;grid-area:1/2;align-items:center;gap:8px;min-width:0;display:flex;overflow:hidden}.dshcs-artitem{display:inline-flex;align-items:center;gap:4px;flex:none;min-width:0}.dshcs-artfile{text-overflow:ellipsis;white-space:nowrap;background:var(--dsw-alias-interactive-bg-hover);max-width:320px;color:var(--dsw-alias-label-secondary,#566174);font:inherit;cursor:pointer;border:none;border-radius:6px;margin:0;padding:0 8px;overflow:hidden}.dshcs-artfile:hover{color:var(--dsw-alias-label-primary,#172033);text-decoration:underline}.dshcs-artfile:focus-visible{box-shadow:inset 0 0 0 2px var(--dsw-alias-border-l3);outline:none}.dshcs-artmore{white-space:nowrap;color:var(--dsw-alias-label-tertiary,#7d8798);flex:none}.dshcs-frame{display:block;position:absolute;inset:0;z-index:1;width:100%;height:100%;border:0;background:var(--dsw-alias-bg-base,#fff)}.dshcs-tabroot{position:relative;display:flex;flex-direction:column;width:100%;height:100%;min-width:0;min-height:0;background:var(--dsw-alias-bg-base,#fff)}.dshcs-slot{position:relative;display:block;width:100%;height:100%;min-width:0;min-height:0;overflow:hidden;background:var(--dsw-alias-bg-base,#fff)}.dshcs-park{position:fixed;left:-20000px;top:0;width:320px;height:200px;overflow:hidden;pointer-events:none;z-index:0;visibility:hidden;contain:strict}.dshcs-loading{position:absolute;inset:0;z-index:2;display:grid;place-items:center;background:var(--dsw-alias-bg-base,#fff);color:var(--dsw-alias-label-tertiary,#7d8798);font-size:13px}.dshcs-empty{position:relative;z-index:2;flex:1;display:flex;align-items:center;justify-content:center;padding:44px 24px 24px}.dshcs-emptybox{max-width:560px;text-align:left;background:var(--dsw-alias-bg-layer-2,#f7f8fb);border:1px solid var(--dsw-alias-border-l2,#dfe3eb);border-radius:12px;padding:16px 18px}.dshcs-error{color:var(--dsw-alias-label-error,#d92d20);white-space:pre-wrap;word-break:break-all;font-family:ui-monospace,Consolas,monospace;font-size:12px;margin:8px 0 0}.dshcs-hint{color:var(--dsw-alias-label-tertiary,#7d8798);font-size:12px;margin:6px 0 0}.dshcs-legacy{color:var(--dsw-alias-label-warning,#b54708);font-size:12px;font-weight:600;margin:0 0 6px}",re="dsh-code-server/styles";typeof document!="undefined"&&document.querySelector("style[data-dshcs="+JSON.stringify(re)+"]")===null&&(O=document.createElement("style"),O.setAttribute("data-dshcs",re),O.textContent=De,document.head.appendChild(O));var O,_="code-server",ae="dsh-code-server-app",je=2500,ze=1e4,Ie=1500,N={openTab:null};function Pe(e){var r=e!=null&&typeof e.size=="number"?e.size:16;return a.createElement("img",{src:le,alt:"","aria-hidden":!0,draggable:!1,className:e!=null?e.className:void 0,style:{width:r,height:r,display:"block",objectFit:"contain",WebkitUserDrag:"none",userSelect:"none"}})}function He(e){var r=e.useTabInfo(),n=r.tab,s=D(),l=s.status,i=M(e.useSessions,null),d=a.useRef(void 0),[c,v]=a.useState(0),u=n.navigation,b=u!=null&&typeof u.revision=="number"?u.revision:0;return a.useEffect(function(){if(!(typeof i!="string"||i==="")&&d.current!==i){var p=d.current!==void 0;d.current=i;var m=!1;return x("/code-server/start",{cwd:i}).then(function(f){m||(k({status:f}),p&&f!=null&&f.ok===!0&&f.running===!0&&v(function(w){return w+1}))}).catch(function(){}),function(){m=!0}}},[i]),a.useEffect(function(){x("/code-server/status").then(function(m){m!=null&&k({status:m})}).catch(function(){});var p=window.setInterval(function(){x("/code-server/status").then(function(m){k({status:m})}).catch(function(){})},3e3);return function(){window.clearInterval(p)}},[]),a.useEffect(function(){var p=u!=null?u.params:null,m=p!=null&&typeof p.path=="string"?p.path:"";m!==""&&x("/code-server/open-file",{file:m}).catch(function(){})},[b]),a.createElement("div",{className:"dshcs-tabroot","data-code-server-tab":"body"},a.createElement(Me,{status:l,pageUrl:F(l,i),reloadTick:c,owner:"tab:"+n.id}))}function G(e,r){if(e==null)return null;var n=e[r];if(n!=null)return n;if(typeof e.get=="function"){var s=e.get(r);if(s!=null)return s}return null}function Ue(e){var r=G(e,"sidebarRightTabs"),n=G(e,"sidebarRight");if(r==null||n==null)return console.error("[code-server] \u53F3\u4FA7\u680F\u670D\u52A1\u4E0A\u4E0B\u6587\u4E0D\u53EF\u89C1(sidebarRightTabs="+(r!=null)+", sidebarRight="+(n!=null)+"):\u8DF3\u8FC7\u4FA7\u680F\u6CE8\u518C"),!1;var s=G(e,"slots");if(e.effect(function(){return r.register({id:ae,kind:_,priority:"extension",title:function(){return"Code Server"},guide:[{order:20,title:function(){return"Code Server"},description:function(){return"\u5728\u53F3\u4FA7\u680F\u6807\u7B7E\u91CC\u8FD0\u884C VS Code \u7F51\u9875\u7248,\u8DDF\u968F\u5F53\u524D\u4F1A\u8BDD\u5DE5\u4F5C\u533A\u3002"},icon:Pe}]})},"code-server: sidebar tab type"),s!=null)e.effect(function(){return s.inject("sidebar.right.pane.tab",function(){return s.register({name:"sidebar.right.pane.tab",key:ae},He)})},"code-server: sidebar tab body");else return console.error("[code-server] slots \u670D\u52A1\u4E0D\u53EF\u89C1:\u4FA7\u680F\u6807\u7B7E body \u672A\u6CE8\u518C"),!1;return N.openTab=function(l){try{return n.openTab(_,l!=null?{params:l}:void 0),!0}catch(i){return console.warn("[code-server] sidebar openTab failed:",i!=null&&i.message!=null?i.message:String(i)),!1}},e.effect(function(){return function(){N.openTab=null,k({sidebarActive:!1,sidebarUi:"unknown"})}},"code-server: sidebar mode reset"),console.log("[code-server] right-sidebar tab registered (kind="+_+")"),!0}var Be=".dshcs-card{border:1px solid var(--dsw-alias-border-l2);background:var(--dsw-alias-bg-layer-3);border-radius:12px;list-style:none;transition:border-color .16s,background .16s}.dshcs-card:hover{border-color:var(--dsw-alias-label-dimmed,var(--dsw-alias-border-l2))}.dshcs-cardOpen{background:var(--dsw-alias-bg-layer-2);border-color:var(--dsw-alias-label-dimmed,var(--dsw-alias-border-l2))}.dshcs-cardHeader{appearance:none;width:100%;font:inherit;color:inherit;text-align:left;cursor:pointer;background:0 0;border:0;border-radius:12px;align-items:center;gap:12px;padding:14px 16px;display:flex}.dshcs-cardHeader:focus-visible{outline:2px solid var(--dsw-alias-brand-primary);outline-offset:-2px}.dshcs-cardHeadText{flex-direction:column;flex:1;gap:4px;min-width:0;display:flex}.dshcs-cardName{color:var(--dsw-alias-label-primary);font-size:15px;font-weight:600;line-height:1.4}.dshcs-cardDescription{color:var(--dsw-alias-label-tertiary,var(--dsw-alias-label-secondary));font-size:13px;line-height:1.5}.dshcs-cardChevron{color:var(--dsw-alias-label-tertiary,var(--dsw-alias-label-secondary));flex:none;transition:transform .16s;display:inline-flex}.dshcs-cardChevronOpen{transform:rotate(180deg)}.dshcs-cardBody{border-top:1px solid var(--dsw-alias-border-l2);margin:0 16px;padding-bottom:8px}.dshcs-cardReadOnly{color:var(--dsw-alias-label-tertiary,var(--dsw-alias-label-secondary));margin:12px 0 0;font-size:12px;line-height:1.5}.dshcs-pending{white-space:nowrap;background:var(--dsw-alias-bg-module-platform,var(--dsw-alias-bg-layer-2));color:var(--dsw-alias-label-secondary);border-radius:999px;flex:none;padding:1px 8px;font-size:11px;font-weight:500;line-height:17px}.dshcs-cardFooter{border-top:1px solid var(--dsw-alias-border-l2);justify-content:flex-end;align-items:center;gap:8px;padding:12px 0 4px;display:flex}.dshcs-cardFailed{min-width:0;color:var(--dsw-alias-label-error,var(--dsw-alias-state-error-primary));flex:1;margin:0;font-size:12px;line-height:1.5}.dshcs-cbtn{appearance:none;font:inherit;cursor:pointer;border-radius:8px;padding:5px 14px;font-size:13px;line-height:1.5;border:1px solid transparent;transition:color .12s ease,background .12s ease}.dshcs-cbtn:disabled{opacity:.4;cursor:default}.dshcs-cbtn:focus-visible{outline:2px solid var(--dsw-alias-brand-primary);outline-offset:1px}.dshcs-cbtnOutline{border-color:var(--dsw-alias-border-l2);color:var(--dsw-alias-label-secondary);background:0 0}.dshcs-cbtnOutline:hover:not(:disabled){color:var(--dsw-alias-label-primary);background:var(--dsw-alias-interactive-bg-hover,transparent)}.dshcs-cbtnPrimary{background:var(--dsw-alias-label-primary);color:var(--dsw-alias-bg-layer-3);border-color:var(--dsw-alias-label-primary);font-weight:600}.dshcs-cbtnPrimary:hover:not(:disabled){filter:brightness(.95)}.dshcs-cbtnPrimary:active:not(:disabled){filter:brightness(.9)}.dshcs-field{flex-direction:column;gap:6px;padding:12px 0;display:flex}.dshcs-field+.dshcs-field{border-top:1px solid var(--dsw-alias-border-l2)}.dshcs-fieldHead{align-items:center;gap:8px;display:flex}.dshcs-fieldLabel{min-width:0;color:var(--dsw-alias-label-primary);flex:1;font-size:13px;font-weight:500;line-height:1.5}.dshcs-hint{color:var(--dsw-alias-label-tertiary,var(--dsw-alias-label-secondary));margin:0;font-size:12px;line-height:1.5}.dshcs-check{display:flex;align-items:center;gap:8px;cursor:pointer}.dshcs-check input{accent-color:var(--dsw-alias-brand-primary);width:15px;height:15px;margin:0;flex:none}.dshcs-check input:disabled{cursor:default}.dshcs-badges{align-items:center;gap:8px;display:inline-flex}.dshcs-badge{white-space:nowrap;background:var(--dsw-alias-bg-module-platform,var(--dsw-alias-bg-layer-2));color:var(--dsw-alias-label-secondary);border-radius:999px;padding:1px 8px;font-size:11px;font-weight:500;line-height:17px}.dshcs-reset{font:inherit;color:var(--dsw-alias-label-secondary);cursor:pointer;background:0 0;border:none;padding:0;font-size:12px;line-height:1.5}.dshcs-reset:hover:not(:disabled){color:var(--dsw-alias-label-primary)}.dshcs-reset:disabled{cursor:default}",_e="dsh-code-server/Card.module.css";function Ge(e,r){if(typeof document!="undefined"&&document.querySelector("style[data-plugin-css="+JSON.stringify(e)+"]")===null){var n=document.createElement("style");n.dataset.plugin="dsh-code-server",n.dataset.pluginCss=e,n.textContent=r,document.head.appendChild(n)}}Ge(_e,Be);function Ve(e){return a.createElement("svg",{width:14,height:14,viewBox:"0 0 14 14",fill:"none","aria-hidden":!0,className:e.className},a.createElement("path",{d:"M3.5 5.25L7 8.75L10.5 5.25",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"}))}function A(e){return a.createElement("button",{type:"button",className:"dshcs-cbtn "+(e.variant==="primary"?"dshcs-cbtnPrimary":"dshcs-cbtnOutline"),disabled:e.disabled===!0,onClick:e.onClick},e.children)}function te(e){return a.createElement("label",{className:"dshcs-check"},a.createElement("input",{type:"checkbox",checked:e.checked===!0,disabled:e.disabled===!0,onChange:function(r){e.onChange(r.target.checked)}}),a.createElement("span",{className:"dshcs-hint"},e.children))}function ne(e){var r=[];return e.overridden===!0&&(r.push(a.createElement("span",{className:"dshcs-badge"},e.overriddenLabel)),r.push(a.createElement("button",{type:"button",className:"dshcs-reset",disabled:e.disabled===!0,onClick:e.onReset},e.resetLabel))),r.length===0?null:a.createElement("span",{className:"dshcs-badges"},...r)}function se(e){var[r,n]=a.useState(e.defaultOpen===!0),s=e.state;if(s==null||s.available!==!0)return null;var l=e.title,i=e.noticeOnly===!0,d=s.dirty!==!0||s.invalid===!0||s.saving===!0;return a.createElement("li",{className:"dshcs-card"+(r?" dshcs-cardOpen":"")},a.createElement("button",{type:"button",className:"dshcs-cardHeader","aria-expanded":r,onClick:function(){n(!r)}},a.createElement("span",{className:"dshcs-cardHeadText"},a.createElement("span",{className:"dshcs-cardName"},l),a.createElement("span",{className:"dshcs-cardDescription"},e.description)),s.dirty===!0?a.createElement("span",{className:"dshcs-pending"},e.unsavedLabel):null,a.createElement(Ve,{className:"dshcs-cardChevron"+(r?" dshcs-cardChevronOpen":"")})),r===!0?a.createElement("div",{className:"dshcs-cardBody"},i===!0?null:s.writable!==!0?a.createElement("p",{className:"dshcs-cardReadOnly",role:"status"},e.readOnlyLabel):null,e.children,i===!0?null:a.createElement("div",{className:"dshcs-cardFooter"},s.failed===!0?a.createElement("p",{className:"dshcs-cardFailed",role:"status"},e.saveFailedLabel):null,a.createElement(A,{disabled:s.dirty!==!0||s.saving===!0,onClick:e.onDiscard},e.discardLabel),a.createElement(A,{variant:"primary",disabled:d,onClick:e.onSave},s.saving===!0?e.savingLabel:e.saveLabel))):null)}function We(e){try{let E=function(){x("/code-server/status").then(function(h){h!=null&&typeof h=="object"&&k({status:h})}).catch(function(){})};var r=e.scope,[n,s]=a.useState(function(){return r!==void 0?r.getSnapshot():null}),[l,i]=a.useState(null),[d,c]=a.useState(!1),[v,u]=a.useState(!1),b=D(),[p,m]=a.useState(q());if(a.useEffect(function(){return J(function(h){m(h)})},[]),a.useEffect(function(){if(r===void 0||typeof r.subscribe!="function")return;function h(){try{s(r.getSnapshot())}catch(rr){}}var S=r.subscribe(h);return function(){typeof S=="function"&&S()}},[r]),r===void 0)return console.error("[code-server] card scope missing"),null;if(n==null||n.status!=="ready")return n!=null&&n.status==="unavailable"&&console.warn("[code-server] settings scope unavailable:",n.status),null;var f=n.value!==void 0&&n.value!==null?n.value:{},w=n.user,y={windowedOpen:f.windowedOpen===!0,keepResident:f.keepResident!==!1};if(b!=null&&b.sidebarUi==="legacy")return a.createElement(se,{title:"Code Server",description:"\u5F53\u524D DSH \u7248\u672C\u4E0D\u53D7\u652F\u6301(\u7F3A\u5C11\u53F3\u4FA7\u680F\u670D\u52A1)",defaultOpen:!0,noticeOnly:!0,state:{available:!0,writable:!1,dirty:!1,invalid:!1,saving:!1,failed:!1}},a.createElement("div",{className:"dshcs-field"},a.createElement("div",{className:"dshcs-legacy"},"\u672C\u63D2\u4EF6\u81EA 0.2.3 \u8D77\u4E0D\u518D\u517C\u5BB9\u65E7\u7248 DSH\u3002"),a.createElement("div",{className:"dshcs-hint",style:{marginTop:0}},`\u672A\u68C0\u6D4B\u5230\u53F3\u4FA7\u680F\u63D2\u4EF6\u670D\u52A1 sidebarRightTabs / sidebarRight,\u56E0\u6B64\u63D2\u4EF6\u4E0D\u63D0\u4F9B\u4EFB\u4F55\u5165\u53E3(\u65E7\u7248\u7684\u60AC\u6D6E\u7403\u4E0E\u6D6E\u52A8\u7A97\u53E3\u5DF2\u79FB\u9664),\u4E5F\u4E0D\u4F1A\u540E\u53F0\u542F\u52A8 IDE\u3002
3
+ \u5347\u7EA7 DSH \u5230\u5E26\u53F3\u4FA7\u680F\u7684\u7248\u672C(\u2265 0.1.5-alpha.1)\u540E,Code Server \u4F1A\u51FA\u73B0\u5728\u53F3\u4FA7\u680F\u6807\u7B7E\u91CC,\u672C\u9875\u540C\u65F6\u663E\u793A\u5B8C\u6574\u8BBE\u7F6E\u9879;\u5347\u7EA7\u540E\u65E0\u9700\u91CD\u88C5\u672C\u63D2\u4EF6,\u5237\u65B0\u9875\u9762\u5373\u53EF\u3002`)));var g=w!=null&&Object.prototype.hasOwnProperty.call(w,"windowedOpen"),ie=w!=null&&Object.prototype.hasOwnProperty.call(w,"keepResident"),de=b!=null&&b.sidebarActive===!0,j=l!==null&&(l.windowedOpen!==y.windowedOpen||l.keepResident!==y.keepResident),er=!j||d,ce={available:!0,writable:n.writable,dirty:j,invalid:!1,saving:d,failed:v};async function fe(){if(j&&!d){c(!0),u(!1);try{var h=l!==null?l:y;await e.scope.set("windowedOpen",h.windowedOpen===!0),await e.scope.set("keepResident",h.keepResident===!0),i(null),E()}catch(S){u(!0)}c(!1)}}async function Z(){if(!(d||n.writable!==!0)){c(!0),u(!1);try{typeof e.scope.unset=="function"?(await e.scope.unset("windowedOpen"),await e.scope.unset("keepResident")):(await e.scope.set("windowedOpen",f.windowedOpen===!0),await e.scope.set("keepResident",f.keepResident===void 0||f.keepResident===null?!0:f.keepResident)),i(null),E()}catch(h){u(!0)}c(!1)}}var[o,oe]=a.useState(null),[Q,Y]=a.useState(!1),ue=a.createElement("div",{className:"dshcs-field"},a.createElement("div",{className:"dshcs-fieldHead"},a.createElement("span",{className:"dshcs-fieldLabel"},"\u73AF\u5883\u68C0\u6D4B"),a.createElement("span",{className:"dshcs-badges"},a.createElement(A,{variant:"primary",disabled:Q,onClick:async function(){Y(!0);var h=await x("/code-server/status");oe(h!=null&&h.env!=null?h.env:{error:"status \u672A\u8FD4\u56DE env"}),Y(!1)}},Q?"\u68C0\u6D4B\u4E2D\u2026":"\u68C0\u6D4B\u73AF\u5883"))),o!=null?a.createElement("div",{className:"dshcs-hint",style:{marginTop:6}},o.error!=null?a.createElement("span",null,"\u68C0\u6D4B\u5931\u8D25: "+o.error):a.createElement("span",null,"\u72B6\u6001: "+(o.ok===!0?"\u2705 \u5C31\u7EEA":"\u274C \u4E0D\u901A\u8FC7")+(o.treeVersion!=null?" \xB7 VS Code \u6811: "+o.treeVersion:"")+(o.upToDate===!1&&o.vendored!=null?"(\u5185\u7F6E "+o.vendored+") ":"")+(o.productPath!=null?" \xB7 \u5BA2\u6237\u7AEF\u8DEF\u5F84: "+o.productPath:"")+(o.entry!=null?" \xB7 \u5165\u53E3: "+o.entry:" \xB7 \u5165\u53E3\u7F3A\u5931")+" \xB7 VS Code \u5185\u90E8\u4F9D\u8D56: "+(o.vscodeInner===!0?"\u2705":"\u274C")+" \xB7 \u9884\u7F16\u8BD1\u539F\u751F\u5305: "+(o.nativeRuntime!=null&&o.nativeRuntime.packages>0?"\u2705 "+o.nativeRuntime.name+"@"+(o.nativeRuntime.version!=null?o.nativeRuntime.version:"?")+"("+o.nativeRuntime.packages+" \u5305)":"\u274C \u672A\u5B89\u88C5("+(o.nativeRuntime!=null&&o.nativeRuntime.name!=null?o.nativeRuntime.name:"\u5E73\u53F0\u805A\u5408\u5305")+")"))):a.createElement("div",{className:"dshcs-hint",style:{marginTop:6}},'\u70B9\u51FB"\u68C0\u6D4B\u73AF\u5883"\u67E5\u770B VS Code \u6811\u72B6\u6001(\u4F9D\u8D56\u7531\u5305\u7BA1\u7406\u5668\u5B89\u88C5,\u65E0\u9700\u5B89\u88C5\u6B65\u9AA4)'),a.createElement("div",{className:"dshcs-hint",style:{marginTop:10,color:"var(--dsw-alias-label-tertiary,var(--dsw-alias-label-secondary))"}},"\u8FD0\u884C\u4F4D\u7F6E: "+(o!=null&&o.tree!=null?o.tree:"<\u63D2\u4EF6\u76EE\u5F55>\\vendor\\vscode")+`
4
+ \u5378\u8F7D: dsh plugin --profile web remove dsh-code-server-app`));return a.createElement(se,{title:"Code Server",description:"\u5165\u53E3:\u53F3\u4FA7\u680F\u6807\u7B7E(DSH \u2265 0.1.5-alpha.1);\u7A97\u53E3\u5316\u8BBE\u7F6E\u63A7\u5236\u65B0\u6807\u7B7E\u9875\u6253\u5F00",state:ce,unsavedLabel:"\u672A\u4FDD\u5B58",readOnlyLabel:"\u672C\u90E8\u7F72\u7684\u8BBE\u7F6E\u4E3A\u53EA\u8BFB\u3002",saveFailedLabel:"\u672C\u90E8\u7F72\u6CA1\u6709\u63A5\u53D7\u8FD9\u4E9B\u503C\uFF0C\u5DF2\u4FDD\u7559\u4F9B\u4F60\u4FEE\u6539\u3002",discardLabel:"\u653E\u5F03\u4FEE\u6539",saveLabel:"\u4FDD\u5B58",savingLabel:"\u4FDD\u5B58\u4E2D\u2026",onSave:fe,onDiscard:function(){i(null),u(!1)}},a.createElement("div",{className:"dshcs-field"},a.createElement("div",{className:"dshcs-fieldHead"},a.createElement("span",{className:"dshcs-fieldLabel"},"\u5165\u53E3"),a.createElement("span",{className:"dshcs-badges"},a.createElement(A,{disabled:de!==!0,onClick:function(){N.openTab!==null&&N.openTab(null)}},"\u5728\u53F3\u4FA7\u680F\u6253\u5F00"))),a.createElement("div",{className:"dshcs-hint",style:{marginTop:6}},b!=null&&b.sidebarRegisterFailed===!0?'\u26A0 \u5DF2\u63A2\u6D4B\u5230\u53F3\u4FA7\u680F\u670D\u52A1,\u4F46\u6807\u7B7E\u6CE8\u518C\u5931\u8D25(\u63A7\u5236\u53F0\u6709 [code-server] \u62A5\u9519);IDE \u4ECD\u53EF\u901A\u8FC7"\u7A97\u53E3\u5316\u6253\u5F00(\u65B0\u6807\u7B7E\u9875)"\u4F7F\u7528\u3002':"\u5F53\u524D:\u53F3\u4FA7\u680F\u6807\u7B7E\u3002\u4ECE\u53F3\u4FA7\u680F\u300C\u5F00\u59CB\u300D\u9875\u7684 Code Server \u5165\u53E3\u6846\u3001\u4EA7\u7269\u65C1\u6309\u94AE\u6216\u4E0A\u9762\u7684\u6309\u94AE\u6253\u5F00\u3002")),a.createElement("div",{className:"dshcs-field"},a.createElement("div",{className:"dshcs-fieldHead"},a.createElement("span",{className:"dshcs-fieldLabel"},"\u7A97\u53E3\u5316\u6253\u5F00(\u65B0\u6807\u7B7E\u9875)"),g===!0?a.createElement(ne,{overridden:!0,disabled:n.writable!==!0,overriddenLabel:"\u5DF2\u8986\u76D6",resetLabel:"\u6062\u590D\u9ED8\u8BA4",onReset:function(){Z()}}):null),a.createElement(te,{checked:l!==null?l.windowedOpen:y.windowedOpen,disabled:n.writable!==!0,onChange:function(h){i(function(S){return Object.assign({},S!==null?S:y,{windowedOpen:h===!0})}),u(!1)}},"\u5F00\u542F\u540E\u5165\u53E3(\u4EA7\u7269\u6309\u94AE/\u8BBE\u7F6E\u5361)\u5728\u6D4F\u89C8\u5668\u65B0\u6807\u7B7E\u9875\u6253\u5F00 code-server(\u81EA\u52A8\u542F\u52A8\u5E76\u8DDF\u968F\u5F53\u524D\u5DE5\u4F5C\u533A);\u5173\u95ED\u5219\u4F7F\u7528\u53F3\u4FA7\u680F\u6807\u7B7E")),a.createElement("div",{className:"dshcs-field"},a.createElement("div",{className:"dshcs-fieldHead"},a.createElement("span",{className:"dshcs-fieldLabel"},"\u540E\u53F0\u5E38\u9A7B(\u5207\u6807\u7B7E\u4E0D\u91CD\u8F7D)"),ie===!0?a.createElement(ne,{overridden:!0,disabled:n.writable!==!0,overriddenLabel:"\u5DF2\u8986\u76D6",resetLabel:"\u6062\u590D\u9ED8\u8BA4",onReset:function(){Z()}}):null),a.createElement(te,{checked:l!==null?l.keepResident:y.keepResident,disabled:n.writable!==!0,onChange:function(h){i(function(S){return Object.assign({},S!==null?S:y,{keepResident:h===!0})}),u(!1)}},'\u5F00\u542F\u540E\u5BBF\u4E3B\u542F\u52A8\u5373\u628A IDE \u52A0\u8F7D\u5230\u540E\u53F0"\u505C\u653E\u533A":\u5207\u6362\u53F3\u4FA7\u680F\u6807\u7B7E\u3001\u6536\u8D77/\u5C55\u5F00\u4FA7\u680F\u3001\u62D6\u6210\u6D6E\u52A8\u7A97\u53E3\u90FD\u4E0D\u518D\u91CD\u8F7D,\u9996\u6B21\u6253\u5F00\u514D\u7B49\u5F85;\u5173\u95ED\u5219\u53EA\u5728\u6253\u5F00\u9762\u677F\u65F6\u52A0\u8F7D(\u7701\u5185\u5B58)'),a.createElement("div",{className:"dshcs-hint",style:{marginTop:4}},C?"\u5E38\u9A7B\u9762:"+(p.docked?"\u5DF2\u505C\u9760":p.ready?"\u5DF2\u505C\u653E(\u540E\u53F0\u8FD0\u884C\u4E2D)":"\u672A\u542F\u52A8")+(p.degraded?" \xB7 \u672C\u6B21\u53D1\u751F\u8FC7\u964D\u7EA7\u91CD\u8F7D":""):"\u5F53\u524D\u6D4F\u89C8\u5668\u4E0D\u652F\u6301 Element.moveBefore(Chromium <133)\u2192 \u5E38\u9A7B\u4E0D\u53EF\u7528,\u5207\u6807\u7B7E\u4ECD\u4F1A\u6574\u9875\u91CD\u8F7D(\u5347\u7EA7\u6D4F\u89C8\u5668\u540E\u81EA\u52A8\u751F\u6548)")),a.createElement("div",{className:"dshcs-field"},a.createElement("div",{className:"dshcs-fieldHead"},a.createElement("span",{className:"dshcs-fieldLabel"},"\u4F9D\u8D56\u5B89\u88C5"),null),a.createElement("div",{className:"dshcs-hint",style:{marginTop:4}},"0.1.36 \u8D77 code-server \u672C\u4F53\u968F\u63D2\u4EF6\u5305\u53D1\u5E03,VS Code \u5185\u90E8\u4F9D\u8D56\u4E0E\u9884\u7F16\u8BD1\u539F\u751F\u6A21\u5757(\u5E73\u53F0\u805A\u5408\u5305)\u5168\u90E8\u7531\u5305\u7BA1\u7406\u5668\u5728 dsh plugin add \u65F6\u5B89\u88C5,\u4E0D\u518D\u9700\u8981\u300C\u5B89\u88C5\u73AF\u5883\u300D\u6B65\u9AA4\u3002")),ue)}catch(E){return console.error("[code-server] card render error:",E!=null&&E.message!==void 0?E.message:String(E)),null}}function Fe(e){var r=[];try{var n=e.turn.data.get("deliverables"),s=e.seq!=null?e.seq:Number.POSITIVE_INFINITY;if(n!=null&&Array.isArray(n.produced))for(var l={},i=0;i<n.produced.length;i++){var d=n.produced[i];d==null||typeof d.path!="string"||d.path===""||d.seq!=null&&d.seq>s||l[d.path]!==!0&&(l[d.path]=!0,r.push(d.path))}}catch(c){}return r}function Qe(e){var r=Fe(e);return r.length===0?null:r}function Ye(e){return a.createElement("img",{src:le,alt:"","aria-hidden":!0,draggable:!1,style:{width:15,height:15,display:"block",objectFit:"contain",WebkitUserDrag:"none",userSelect:"none"}})}function Ze(e){var r=D();if(e==null||!Array.isArray(e.matched)||e.matched.length===0)return null;var n=e.matched;function s(i){var d=String(i).replace(/\\/g,"/"),c=d.lastIndexOf("/");return c>=0?d.slice(c+1):d}function l(i){var d=r.status;if(d!=null&&d.windowedOpen===!0){ee(M(e.useSessions,e.useWorkspaces));return}r.sidebarActive===!0&&N.openTab!==null&&N.openTab({path:i})===!0||(ee(M(e.useSessions,e.useWorkspaces)),x("/code-server/open-file",{file:i}).then(function(c){(c==null||c.ok!==!0)&&window.alert(c!=null&&c.error?c.error:"\u6253\u5F00\u5931\u8D25")}).catch(function(c){window.alert("\u6253\u5F00\u5931\u8D25: "+String(c))}))}return a.createElement("div",{className:"dshcs-artifacts"},a.createElement("span",{className:"dshcs-artlabel"},"\u4EA7\u7269"),a.createElement("div",{className:"dshcs-artrow"},n.slice(0,6).map(function(i){return a.createElement("span",{key:i,className:"dshcs-artitem"},a.createElement("button",{type:"button",className:"dshcs-artfile",title:i,"aria-label":"\u6253\u5F00: "+i,onClick:function(){l(i)}},s(i)),a.createElement("button",{type:"button",className:"dshcs-artbtn",title:"\u5728 Code Server \u6253\u5F00: "+i,"aria-label":"\u5728 Code Server \u6253\u5F00: "+i,onClick:function(){l(i)}},a.createElement(Ye,null)))}),n.length>6?a.createElement("span",{className:"dshcs-artmore"},"\u2026"):null))}function Je(e){try{qe(e)}catch(r){console.error("[code-server] apply failed:",r&&r.stack?r.stack:String(r));try{document.title="CS-ERR "+(r&&r.message||String(r))}catch(n){}}}function qe(e){var r=e.get("slots");if(r===void 0){console.error("[code-server] slots service unavailable");return}var n=e.settingsScope,s=null;if(n!==void 0&&typeof n.bind=="function")s=n.bind({namespace:"code-server"});else{console.error("[code-server] settingsScope unavailable (inject missing?); settings card disabled");return}x("/code-server/status").then(function(f){k({status:f})}).catch(function(){}),r.inject("settings.plugin.item",()=>r.register({name:"settings.plugin.item",key:"code-server",label:"Code Server",inject:function(){return{scope:s}}},We));var l=!1;function i(f,w){if(!l){l=!0,b();var y=!1;try{y=Ue(f)}catch(g){console.error("[code-server] sidebar tab registration failed:",g!=null&&g.message!=null?g.message:String(g))}R.sidebarUi==="legacy"&&(console.log("[code-server] \u53F3\u4FA7\u680F\u670D\u52A1\u665A\u5230(\u7ECF "+w+"):\u64A4\u9500\u65E7\u7248 DSH \u5224\u5B9A"),x("/code-server/ui-mode",{sidebar:!0}).catch(function(){})),k({sidebarActive:y,sidebarUi:"modern",sidebarRegisterFailed:y!==!0}),r.inject("shell.overlay",()=>r.register({name:"shell.overlay",id:"code-server",order:70,label:"Code Server"},g=>a.createElement(Ae,g)));try{r.inject("conversation.chat.turnTail",function(){return r.register({name:"conversation.chat.turnTail",priority:-9,id:"dshcs-open-file",select:Qe},Ze)})}catch(g){console.warn("[code-server] turnTail register failed:",g!=null&&g.message!=null?g.message:String(g))}console.log("[code-server] client registered via "+w+": sidebar tab="+y+" + turnTail artifacts + resident preload + settings card")}}function d(f){k({sidebarActive:!1,sidebarUi:"legacy"}),console.warn("[code-server] \u672A\u63A2\u6D4B\u5230\u53F3\u4FA7\u680F\u670D\u52A1(sidebarRightTabs/sidebarRight): \u672C\u63D2\u4EF6\u81EA 0.2.3 \u8D77\u4E0D\u518D\u517C\u5BB9\u65E7\u7248 DSH \u2014\u2014 \u9664\u300C\u8BBE\u7F6E \u2192 \u63D2\u4EF6 \u2192 Code Server\u300D\u7684\u63D0\u793A\u5916\u4E0D\u63D0\u4F9B\u4EFB\u4F55\u5165\u53E3,\u4E5F\u4E0D\u9884\u70ED IDE\u3002\u8BF7\u5347\u7EA7 DSH\u3002"),f===!0&&x("/code-server/ui-mode",{sidebar:!1}).catch(function(){})}var c=null,v=null,u=null;function b(){c!==null&&(clearTimeout(c),c=null),v!==null&&(clearTimeout(v),v=null),u!==null&&(clearTimeout(u),u=null)}var p=!1;try{typeof e.inject=="function"&&(p=!0,e.inject(["sidebarRightTabs","sidebarRight"],function(f){i(f,"inject")}))}catch(f){console.warn("[code-server] sidebar inject failed:",f!=null&&f.message!=null?f.message:String(f))}var m=typeof e.get=="function"&&e.get("sidebarRightTabs")!==void 0&&e.get("sidebarRight")!==void 0;if(m){u=setTimeout(function(){l||(console.warn("[code-server] ctx.inject \u672A\u5728 1.5s \u5185\u56DE\u8C03,\u6539\u7528\u540C\u6B65\u670D\u52A1\u6CE8\u518C\u4FA7\u680F"),i(e,"sync-fallback"))},Ie);return}if(p!==!0){d(!0);return}c=setTimeout(function(){l||d(!1)},je),v=setTimeout(function(){l||d(!0)},ze)}var Xe=["slots","settingsScope"],Ke="code-server";
4
5
  return module.exports;}});
package/lib/index.js CHANGED
@@ -10,8 +10,11 @@
10
10
  * 静态 profile 插件,与 dsh-webproxy-router-plugin 同形态:
11
11
  * - exports.name = 插件名(与 cordis.patch.yml 行 id 一致)
12
12
  * - exports.inject = ['connection', 'settings'](connection 承载 client↔host 通道)
13
- * - apply(ctx, config) 在共享 /api 通道注册 5 条 exact Fetch 路由:
14
- * status / start / stop / setup(兼容空操作) / open-file
13
+ * - apply(ctx, config) 在共享 /api 通道注册 6 条 exact Fetch 路由:
14
+ * status / start / stop / setup(兼容空操作) / open-file / ui-mode
15
+ *
16
+ * 0.2.3 起客户端不再兼容旧版 DSH(没有右侧栏服务的版本):客户端上报 { sidebar:false } 时,
17
+ * 本插件回收「自动预启动」的实例并停止预启动(/ui-mode);用户手动启动的实例不受影响。
15
18
  *
16
19
  * 通道选择(重要):**不依赖 webServer**。路由经 ctx.connection.fetch.register
17
20
  * 挂在 Connection 服务的共享 /api 通道上:
@@ -34,6 +37,7 @@
34
37
  * version, error, logTail[, adopted] }
35
38
  * POST /api/code-server/start { cwd? } → 幂等启动(换 cwd 则先停后启) → status
36
39
  * POST /api/code-server/stop → 停止 → status
40
+ * POST /api/code-server/ui-mode { sidebar } → 客户端上报 UI 载体能力(旧版 DSH 上报 false)
37
41
  */
38
42
 
39
43
  import { spawn, execFile, execFileSync } from 'node:child_process';
@@ -89,10 +93,9 @@ export const SETTINGS_NS = 'code-server';
89
93
 
90
94
  /** 设置卡片 schema(参照 auto-open-web 的 Config 形态)。 */
91
95
  export const Config = z.object({
92
- /** reserveComposer=true(默认)窗口不盖输入框(初始/缩放/最大化止于输入栏上方);
93
- * false 时允许盖住输入框(最大化到视口底)。 */
96
+ /** 【0.2.3 起废弃】只对已删除的内部浮动窗口有意义;保留该键仅为兼容旧设置文件(读写均被忽略)。 */
94
97
  reserveComposer: z.boolean().default(true),
95
- /** windowedOpen=false(默认)点击悬浮球打开内部浮动窗口;
98
+ /** windowedOpen=false(默认)在右侧栏标签里打开;
96
99
  * true 时改为在浏览器新标签页打开 code-server(自动启动并跟随工作区)。 */
97
100
  windowedOpen: z.boolean().default(false),
98
101
  /** 服务方式:loopback(默认)独立回环端口;dsh 挂到 DSH webServer 的 /code-server
@@ -420,7 +423,7 @@ export async function apply(ctx, config) {
420
423
  }
421
424
  });
422
425
  } catch (error) {
423
- console.error(`[code-server] settings unavailable; using defaults (reserveComposer=true, windowedOpen=false): ${error.message}`);
426
+ console.error(`[code-server] settings unavailable; using defaults (keepResident=true, windowedOpen=false): ${error.message}`);
424
427
  }
425
428
  }
426
429
 
@@ -455,6 +458,10 @@ export async function apply(ctx, config) {
455
458
  adopted: false,
456
459
  serve: 'loopback', // 实际生效的服务方式(loopback | dsh)
457
460
  pipe: null, // dsh 模式下的命名管道
461
+ /** 客户端上报的 UI 载体能力:null=未上报 | true=带右侧栏(受支持) | false=旧版 DSH(只提示,不预启动) */
462
+ sidebarUi: null,
463
+ /** 本实例是否由插件的自动预启动拉起(旧版 DSH 上报后据此回收,不动用户/被 adopt 的实例) */
464
+ prestarted: false,
458
465
  env: envCheck(), // 环境检测(VS Code 树 / server 入口 / 内部依赖 / 预编译原生包)
459
466
  setup: { running: false, done: true, ok: true, logTail: '0.1.36 起由包管理器安装依赖,无需「安装环境」步骤', startedAt: null, finishedAt: null }, // 兼容旧客户端
460
467
  };
@@ -509,9 +516,10 @@ export async function apply(ctx, config) {
509
516
  error: state.error,
510
517
  logTail: state.logTail.slice(-LOG_TAIL_MAX),
511
518
  adopted: state.adopted,
512
- reserveComposer,
519
+ reserveComposer, // 0.2.3 起废弃(仅旧版浮窗用过);保留字段以免旧客户端读取时报错
513
520
  windowedOpen,
514
521
  keepResident,
522
+ sidebarUi: state.sidebarUi,
515
523
  env: state.env,
516
524
  setup: {
517
525
  running: state.setup.running,
@@ -943,6 +951,36 @@ export async function apply(ctx, config) {
943
951
  }
944
952
  }
945
953
 
954
+ /**
955
+ * 客户端上报 UI 载体能力(0.2.3):{ sidebar: false } = 旧版 DSH(没有右侧栏服务)。
956
+ * 旧版 DSH 上本插件不提供任何入口 → 这里回收「由本插件自动预启动」的实例,避免留下用不上的 IDE 进程;
957
+ * 用户手动启动的实例(adopted)不动,后续也不再有 UI 触发启动。
958
+ */
959
+ async function handleUiMode(request) {
960
+ try {
961
+ const body = await readJsonBody(request);
962
+ if (body !== null && typeof body.sidebar === 'boolean') {
963
+ const next = body.sidebar;
964
+ if (state.sidebarUi !== next) {
965
+ state.sidebarUi = next;
966
+ console.log(`[code-server] 客户端 UI 载体:${next ? '右侧栏(受支持)' : '无右侧栏(旧版 DSH,只给设置页提示)'}`);
967
+ }
968
+ if (next === false && state.prestarted === true && state.adopted !== true) {
969
+ state.prestarted = false;
970
+ if (state.status === 'running' || state.status === 'starting') {
971
+ console.warn('[code-server] 旧版 DSH:回收自动预启动的实例(旧版已不受支持)');
972
+ await stop('legacy-ui').catch(err => {
973
+ console.error(`[code-server] 回收失败:${err && err.message ? err.message : err}`);
974
+ });
975
+ }
976
+ }
977
+ }
978
+ return jsonResponse({ ok: true, sidebarUi: state.sidebarUi });
979
+ } catch (err) {
980
+ return failureResponse(err);
981
+ }
982
+ }
983
+
946
984
  // 每条操作一条 exact Fetch 路由。desktop 的 assetHandler 只把 /api/* 交给
947
985
  // createSharedFetchHandler('/api'),所以路径必须落在 /api 下。
948
986
  const disposers = [ { path: `${API_BASE}/status`, methods: ['GET'], fetch: handleStatus },
@@ -950,6 +988,7 @@ export async function apply(ctx, config) {
950
988
  { path: `${API_BASE}/stop`, methods: ['POST'], fetch: handleStop },
951
989
  { path: `${API_BASE}/setup`, methods: ['POST'], fetch: handleSetup },
952
990
  { path: `${API_BASE}/open-file`, methods: ['POST'], fetch: handleOpenFile },
991
+ { path: `${API_BASE}/ui-mode`, methods: ['POST'], fetch: handleUiMode },
953
992
  ].map(route => connection.fetch.register({
954
993
  path: route.path,
955
994
  methods: route.methods,
@@ -985,9 +1024,13 @@ export async function apply(ctx, config) {
985
1024
  const liveInstance = record !== undefined && record !== null && isAlive(record.pid);
986
1025
 
987
1026
  function maybePrestart() {
988
- // 环境就绪且未运行 → 后台自动拉起(不等待),悬浮球打开时 iframe 立即加载。
1027
+ // 环境就绪且未运行 → 后台自动拉起(不等待),首次打开侧栏标签时 iframe 立即加载。
1028
+ // 旧版 DSH(客户端上报 sidebarUi=false)没有可用入口 → 不预启动,也不占端口。
1029
+ if (state.sidebarUi === false) return;
989
1030
  if (state.env.ok && state.status !== 'running' && state.status !== 'starting') {
1031
+ state.prestarted = true;
990
1032
  start().catch((err) => {
1033
+ state.prestarted = false;
991
1034
  console.error('[code-server] prestart failed:', err && err.message ? err.message : String(err));
992
1035
  });
993
1036
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "dsh-code-server-app",
3
- "version": "0.2.2",
4
- "description": "VS Code (from a code-server release) inside DSH Web and Desktop: right-sidebar tab with a floating-ball fallback, driven by the plugin's own launcher over the in-process VS Code server (lib/launcher.mjs). The IDE is a resident surface moved with Element.moveBefore instead of being remounted, so switching sidebar tabs no longer reloads the workbench. Two serving modes: loopback port (default) or same-origin mount on DSH's own webServer (/code-server, protected by ctx.connection.requestRejection). No code-server Node layer, no argon2, no C++ toolchain.",
3
+ "version": "0.2.4",
4
+ "description": "VS Code (from a code-server release) inside DSH: a right-sidebar tab driven by the plugin's own launcher over the in-process VS Code server (lib/launcher.mjs). The IDE is a resident surface moved with Element.moveBefore instead of being remounted, so switching sidebar tabs no longer reloads the workbench. Requires a DSH with the right-sidebar services (sidebarRightTabs/sidebarRight, >= 0.1.5-alpha.1); older DSH versions get a single upgrade notice on the settings page and no other UI. Two serving modes: loopback port (default) or same-origin mount on DSH's own webServer (/code-server, protected by ctx.connection.requestRejection). No code-server Node layer, no argon2, no C++ toolchain.",
5
5
  "homepage": "https://github.com/jinsiyu/dsh-code-server-app",
6
6
  "repository": {
7
7
  "type": "git",
@@ -57,8 +57,7 @@
57
57
  "README.en.md"
58
58
  ],
59
59
  "devDependencies": {
60
- "esbuild": "^0.25.0",
61
- "motion": "^12.0.0"
60
+ "esbuild": "^0.25.0"
62
61
  },
63
62
  "license": "MIT",
64
63
  "dependencies": {
@@ -3,7 +3,7 @@
3
3
  "vscodeVersion": "1.136.1",
4
4
  "productPath": "stable-8d5f383f301ca20681f5b6606b8207d9dc87bdd8",
5
5
  "layout": "vscode-only",
6
- "preparedAt": "2026-09-10T13:43:43.880Z",
6
+ "preparedAt": "2026-09-10T14:42:14.464Z",
7
7
  "source": "registry",
8
8
  "node": "v24.13.1",
9
9
  "platform": "win32",