@lemoncat7/dsh-theme-xiaohei 0.4.5 → 0.4.6

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.md CHANGED
@@ -1,108 +1,35 @@
1
1
  # Xiaohei Night for DSH
2
2
 
3
- > 当前版本 **0.4.3**,已验证宿主 **DSH 0.2.0-rc.2**(宿主仍为 RC)。详见 [兼容说明](docs/dsh-020-compatibility.md) 和 [发布说明](docs/releases/0.4.3.md)。
3
+ 基于 DeepSeek Harness 官方主题接口的非官方粉丝主题。以低饱和天空、日夜光线和小黑角色提供陪伴感,保留原生工作台布局。
4
4
 
5
- `Xiaohei Night` 是一个基于 DeepSeek Harness 官方主题注册接口开发的非官方粉丝主题插件。主题以低饱和天空、日夜光线和坐在小平台上的人形小黑表达陪伴感,保留原生工作台布局。
5
+ [![npm](https://img.shields.io/npm/v/%40lemoncat7%2Fdsh-theme-xiaohei)](https://www.npmjs.com/package/@lemoncat7/dsh-theme-xiaohei)
6
6
 
7
- ## 兼容性
7
+ ## 功能
8
8
 
9
- 正式版 `0.4.3` 适配并验证 DeepSeek Harness `0.2.0-rc.2`,开发依赖锁定该宿主版本,需要 Node.js `^22.19.0` 或 `>=24.0.0`。旧宿主请保留 `0.3.5`。保留侧栏操作与仅思考消息显示修复,不修改官方核心代码。“跟随系统”读取当前设备/浏览器配色偏好,不按服务器时间切换。
10
-
11
- ## 当前范围
12
-
13
- - 保留 DSH 原有布局、密度和交互层级。
14
- - 使用半透明墨黑表面,让背景可见但不压过对话内容。
15
- - 使用青绿色作为唯一交互强调色,错误、成功、警告保留独立语义色。
16
- - 背景与人物分层:保留日间/夜间的柔和天空;人物使用独立高清、无损 WebP,不随整张壁纸放大。坐姿、托腮和打盹统一为 720×1019,探头素材宽 360;最大显示尺寸仍有约 3 倍像素密度。姿势按需解码后再显示,保留轮廓与五官细节。
17
- - 根据真实剩余空间决定姿势:右侧宽裕时坐在小平台上,中等窗口扶着侧栏探头;细侧栏空位使用更窄的半脸偷看。没有安全空间时暂时隐藏,不覆盖消息、头像或侧栏按钮,不修改业务布局。
18
- - 坐姿下,用户空闲 30 秒后托腮、3 分钟后闭眼打盹;鼠标、键盘、触摸点击或滚轮操作后恢复。页面隐藏或不再使用坐姿时暂停计时,返回后重新开始。最多一个空闲计时器,睡着后不继续轮询,不绑定 AI 状态,不读取输入内容。姿势以 220ms 淡化过渡,不是连续骨骼动画。
19
- - 耳根固定、耳尖连续摆动,坐姿和托腮的尾巴通过 7 个关节点与网格蒙皮连续变形,鼠标靠近可触发联动。眨眼提取原图睫毛笔触并连续变形,瞳孔平滑跟随鼠标;身体与四肢没有完整骨骼绑定,并非完整 Live2D。短暂动作最高 60 帧,视线停稳后停止绘制,后台与减少动态模式暂停。
20
- - 装饰背景使用稳定的大视口高度;姿势切换不横穿会话,不读取会话内容或执行状态;流式文本高度变化不触发布局重测。软键盘兼容性仍需 iOS / Android 真机验收。
21
- - bloub 嘿咻保留 alpha.171 略宽于高的小黑团轮廓和圆润奶白眼圈。单击依次眨眼回应、轻跳、歪头、感叹号惊讶;双击或键盘 Shift+Enter 轮换散开重聚、蛋形、环绕、六边形、单眼眨眼、睁大眼、感叹号、警觉、休眠、思考、通知。每隔随机 20–40 秒自动选择一种待机动作(含眨眼、休眠,不含思考、通知、感叹号),不连续重复;打字、飞行或其他动作尚未结束时顺延。后台/离屏/减少动态时取消调度,恢复后重新等待,不补播。
22
- - 嘿咻通过可选的官方 `sessions.list` / `binding().session` 只读订阅当前会话:运行中显示三点思考(代表本轮处理中,不细分推理/输出/工具),观察到本轮结束时提醒一次,新执行错误显示感叹号。提醒表示本轮结束,不承诺任务成功,手动停止也可能触发。初次加载历史、切换会话、重新加载历史不会补发完成提醒。通知徽点采用暖金色和真正透明的缺口;不申请浏览器通知权限、不发送消息、不操作会话、不关联壁纸。
23
- - 新会话将同一只嘿咻停在输入框上方、Logo 左边;输入区落到底部时,用可打断的约 950 ms 飞行动画转移到输入框左侧。手机给 Logo 左侧留出空间并缩小角色;普通窗口缩放不触发跨区域飞行。仅使用现有 Hero 品牌元素和输入框位置,不读取或改变会话业务数据。
24
- - 慢浮动周期 14 秒,宽屏横向 ±7 px、纵向 ±10 px;窄屏自动减小幅度。视线跟随窗口内鼠标,身体只在近处轻微靠近(宽屏最多 5 / 3.5 px),约 480 ms 柔和回位。CSS transform 合成浮动和跟随,不增加持续 JS 帧计算或逐帧布局测量;除短暂换位飞行外,点击区域保持固定。减少动态模式关闭浮动、跟随、飞行和自动动作;不改发送键。
25
- - 嘿咻初始只有 10 个 SVG 节点;首次触发特殊动作才一次性建立粒子/轨道池及通知缺口,之后固定复用(总计 102 节点),帧循环不新增节点、不测量布局,结束后隐藏特效。小尺寸变形中的眼圈适当收窄,避免相互粘连。空闲间歇唤醒,离屏、隐藏和减少动态时暂停,卸载释放监听、观察器、帧请求和定时器。宽屏使用框外空位,窄屏使用框内左侧预留位,不改发送键。原项目 MIT 许可与固定源码版本见 `THIRD_PARTY_NOTICES.md`;观察及改动记录见 `docs/heixiu-motion-reference.md`。
26
- - 对话双方保留静态身份头像;消息气泡使用更舒适的横向留白。
27
- - 左侧栏只有一层独立磨砂材质,目录与会话不再各自模糊。展开目录、Hover、选中会话使用逐级增强的中性底色;移除拼接空间框和底部卡片,原生滚动、拖拽和菜单保持不变。
28
- - 侧栏展开时,内容等待列宽到位后统一淡入,避免文字先出现再被展开裁切。切换期间暂停装饰角色布局和绘制;侧栏品牌金属画面缓存复用,不再反复创建 WebGL 和编译着色器。
29
- - 新会话使用统一圆角控件;发送键嘿咻继续保留完整帧眨眼。左栏行宽、缩进、滚动条预留和收起布局交给 DSH 管理,避免主题强行计算宽度。
30
- - 支持减少动态、增强对比度、强制颜色和打印模式降级。
31
- - 主题通过 DSH Theme Runtime 覆盖 Light / Dark / System 的语义 token,不替换用户的主题偏好;卸载后由 DSH 恢复原始 token。
9
+ - Light / Dark / System 主题,语义颜色与半透明材质。
10
+ - 随空间调整的角色姿态与轻量互动,不遮挡消息或侧栏操作。
11
+ - 可拖动交互的嘿咻装饰,以及会话运行和结束的只读状态提示。
12
+ - 响应式布局,减少动态、增强对比度、强制颜色和打印模式降级。
32
13
 
33
14
  ## 安装
34
15
 
35
- 通过 npm 安装正式版:
36
-
37
- ```bash
38
- dsh plugin --profile web add @lemoncat7/dsh-theme-xiaohei@0.3.5
39
- ```
40
-
41
- 也可在源码目录运行 `npm pack` 生成完整包后安装:
42
-
43
- ```bash
44
- dsh plugin --profile web add ./lemoncat7-dsh-theme-xiaohei-0.3.5.tgz
45
- ```
46
-
47
- 卸载:
48
-
49
- ```bash
50
- dsh plugin --profile web remove @lemoncat7/dsh-theme-xiaohei
51
- ```
52
-
53
- ## 开发与验证
54
-
55
- 需要 Node.js 22.19+ 或 24+:
56
-
57
- ```bash
58
- npm install
59
- npm test
60
- npm run pack:check
61
- ```
62
-
63
- 使用 Docker 24 构建可安装包:
16
+ 适配 DeepSeek Harness **0.2.0-rc.2**(宿主仍为 RC),需要 Node.js **^22.19.0 或 >=24.0.0**。其他宿主版本请先查阅[兼容说明](docs/dsh-020-compatibility.md)和对应版本的发布说明。
64
17
 
65
18
  ```bash
66
- npm run pack:docker
19
+ dsh plugin --profile web add @lemoncat7/dsh-theme-xiaohei@latest
67
20
  ```
68
21
 
69
- ### 代码边界
70
-
71
- - `src/index.ts` 只负责 Host 首帧加载装饰,保持自包含并在客户端插件启动前运行。
72
- - `src/plugin.ts` 通过 DSH 生命周期装配主题 token、Chrome、场景与交互行为。
73
- - `src/chrome/` 管理控件和公共插件表面;`src/scene/` 分离场景样式与运行时 DOM。
74
- - `src/host-contract.ts` 集中维护宿主插槽选择器;`src/host-dom.ts` 为运行期模块共享一个批处理 DOM 观察器。左栏只在尺寸或节点变化时测量布局,流式文本更新不重复强制布局。
75
- - `src/scene/character-layout.ts` 只计算安全位置,`character-idle.ts` 只管理空闲期限,`character-poses.ts` 统一素材目录;`wallpaper-character.ts` 负责生命周期、按需解码和呈现,卸载时释放监听与计时器。
76
- - `src/vendor/bloub/` 保留上游动画计算,`src/bloub-heixiu/` 分离 SVG 呈现、布局、样式和生命周期。`signals.ts` 可选地只读订阅当前会话执行状态,不读取会话内容,不操作会话。
77
- - 旧树洞/落叶挂载器已移除,历史图片保留供版本回溯;背景、材质和业务状态各自独立。
78
-
79
- ## 扩展工具接入主题
80
-
81
- SSH、伙伴、Git 等后续工具不需要复制主题 CSS。插件根节点使用公开的框架属性即可继承小黑主题:
82
-
83
- ```html
84
- <section
85
- data-xiaohei-frame="module"
86
- data-xiaohei-frame-ornament="spirit-knot"
87
- data-xiaohei-module-kind="ssh"
88
- >
89
- <header data-xiaohei-frame-header>
90
- <strong>远程主机</strong>
91
- <div data-xiaohei-frame-actions><!-- 工具按钮 --></div>
92
- </header>
93
- <!-- 模块内容 -->
94
- </section>
95
- ```
22
+ 安装或升级后重启对应的 DSH Profile;`web` 请按实际使用的 Profile 调整。
96
23
 
97
- - `data-xiaohei-frame="module"`:完整区域框裱;紧凑控件可使用 `compact`。
98
- - `data-xiaohei-frame-ornament="spirit-knot"`:兼容既有扩展的猫尾灵珠挂饰入口;挂饰固定在框角,悬停时提供轻微转动反馈。
99
- - `data-xiaohei-module-kind`:保留模块身份,方便主题以后为 SSH、伙伴、Git 等提供差异化细节。
100
- - `data-xiaohei-frame-header` 与 `data-xiaohei-frame-actions`:统一标题栏和操作区对齐。
24
+ 安装后在 DSH 的主题设置中选择 Xiaohei Night;「跟随系统」采用当前设备或浏览器的配色偏好。卸载后由 DSH 恢复原始主题。
101
25
 
102
- ## 视觉资产
26
+ ## 使用边界
103
27
 
104
- 背景使用内置的日夜天空 WebP、CSS 渐变及按需加载的人物透明素材,不加载 Three.js、外部 CDN 或角色模型。品牌头像、消息静态头像、加载动画与发送键嘿咻作为内联资源随插件交付;嘿咻交互使用 SVG。
28
+ 主题不修改官方核心代码,不读取对话正文,也不代替业务插件提供布局或授权能力。角色状态提示只表示本轮结束,不保证任务成功。人物动画不是完整 Live2D;移动端软键盘兼容仍需真机验收。
105
29
 
106
- ## License
30
+ ## 文档
107
31
 
108
- 代码使用 MIT License。角色及相关作品权利归原权利方所有,本项目与官方无关。
32
+ - [效果、开发与扩展接入](docs/usage.md)
33
+ - [第三方许可](THIRD_PARTY_NOTICES.md)
34
+ - [版本与发布说明](https://github.com/lemoncat7/dsh-theme-xiaohei/releases)
35
+ - [发布维护约定](docs/releases/README.md)
@@ -0,0 +1,17 @@
1
+ # 0.4.6 · 对话首屏与人物交互性能优化
2
+
3
+ 适配 DeepSeek Harness **0.2.0-rc.2**;需要 Node.js **^22.19.0 或 >=24.0.0**。不调整宿主兼容范围。
4
+
5
+ ## 本次改进
6
+
7
+ - 输入区人物引擎拆为独立分包,在对话输入区出现并完成首屏绘制后加载,减少主题入口的同步初始化工作。
8
+ - 合并宿主 DOM 变化通知,跳过不影响输入区位置的流式正文更新、人物自身效果和历史滚动,减少重复布局测量。
9
+ - 人物挂载后延后一帧定位,先读取宿主布局再写入样式;通过输入区尺寸计算人物位置,避免写样式后立即测量造成同步布局。
10
+ - 保留欢迎页、窄屏、会话切换、窗口缩放、减少动画和卸载清理行为,不修改对话内容、发送逻辑或用户设置。
11
+
12
+ ## 验证与升级
13
+
14
+ - 构建及单元测试:119 项通过、1 项原有跳过,无失败。
15
+ - 隔离浏览器回归覆盖 375 / 1280 像素、浅深主题和减少动画,共 8 种组合;检查流式更新、历史滚动、输入区替换、人物定位和清理,不向生产会话发送消息。
16
+ - 无数据迁移;升级后重启对应 Profile 并刷新页面,以加载新的异步分包。
17
+ - 本次验证针对 Web,未进行 Desktop 实机回归;优化不代表服务端或其他插件的等待均已消除。
@@ -0,0 +1,14 @@
1
+ # 发布说明维护
2
+
3
+ [返回项目介绍](../../README.md) · [GitHub Releases](https://github.com/lemoncat7/dsh-theme-xiaohei/releases)
4
+
5
+ README 只维护当前功能、安装方法、适用边界和文档入口,不逐版追加更新日志。详细配置放在使用文档中。
6
+
7
+ 每次发布:
8
+
9
+ 1. 在本目录维护 `<version>.md`,记录该版变更、兼容要求、迁移注意事项和实际验证范围;历史说明不代表当前行为。
10
+ 2. 将对应说明同步到 GitHub Release 正文,使用有效的绝对文档链接;不要只放一句更新摘要或指向 README。
11
+ 3. 核对版本标签、npm 版本与附件的一致性,优先使用已验证的同一安装包,不重新构建替换旧版本附件。
12
+ 4. 同一版本复用已有 Release;发布后检查不再遗留重复草稿。补发历史版本不能将它设成 Latest,撤回版本不能自动重新发布。
13
+
14
+ 本次从 README 迁出的历史段落保存在对应版本文件中。尚未正式发布的说明文件不代表该版本可用,请以 GitHub Release 和 npm 实际记录为准。
@@ -15,4 +15,20 @@ export declare function resolveHeixiuWelcome(hero: {
15
15
  left: number;
16
16
  top: number;
17
17
  } | undefined;
18
+ /** Mirror the owned absolute-position CSS without measuring after style writes.
19
+ * The containing block is the composer's padding box (inside its border).
20
+ */
21
+ export declare function resolveHeixiuBox(composer: {
22
+ left: number;
23
+ top: number;
24
+ height: number;
25
+ }, border: {
26
+ left: number;
27
+ top: number;
28
+ }, dock: ReturnType<typeof resolveHeixiuDock>, welcome: ReturnType<typeof resolveHeixiuWelcome>): {
29
+ left: number;
30
+ top: number;
31
+ width: number;
32
+ height: number;
33
+ };
18
34
  //# sourceMappingURL=layout.d.ts.map
@@ -9,4 +9,18 @@ export function resolveHeixiuWelcome(hero, composer, sidebarRight, viewportWidth
9
9
  const left = Math.max(sidebarRight + 6, hero.left - size - (size === 52 ? 10 : 24));
10
10
  return { size, left: left - composer.left, top: hero.top + hero.height / 2 - size / 2 - composer.top };
11
11
  }
12
+ /** Mirror the owned absolute-position CSS without measuring after style writes.
13
+ * The containing block is the composer's padding box (inside its border).
14
+ */
15
+ export function resolveHeixiuBox(composer, border, dock, welcome) {
16
+ const size = welcome?.size ?? dock.size;
17
+ if (welcome)
18
+ return { left: composer.left + border.left + welcome.left,
19
+ top: composer.top + border.top + welcome.top, width: size, height: size };
20
+ if (dock.mode === 'compact')
21
+ return { left: composer.left + border.left + 4,
22
+ top: composer.top + border.top + 6, width: size, height: size };
23
+ return { left: composer.left + border.left - 18 - size,
24
+ top: composer.top + composer.height / 2 - size / 2, width: size, height: size };
25
+ }
12
26
  //# sourceMappingURL=layout.js.map
@@ -4,7 +4,7 @@ import { STATE_BY_ID } from '../vendor/bloub/states.js';
4
4
  import { subscribeXiaoheiHostDom } from '../host-dom.js';
5
5
  import { XIAOHEI_HOST_SELECTORS } from '../host-contract.js';
6
6
  import { createHeixiuRenderer } from './renderer.js';
7
- import { resolveHeixiuDock, resolveHeixiuWelcome } from './layout.js';
7
+ import { resolveHeixiuDock, resolveHeixiuWelcome, resolveHeixiuBox } from './layout.js';
8
8
  import { resolveHeixiuFollow, resolveHeixiuGaze } from './follow.js';
9
9
  import { createHeixiuFlight } from './flight.js';
10
10
  import { heixiuAmbientDelay, heixiuAmbientIndex } from './ambient.js';
@@ -184,6 +184,7 @@ export function installComposerBloub(doc = typeof document === 'undefined' ? und
184
184
  const next = doc.querySelector(XIAOHEI_HOST_SELECTORS.composerCard);
185
185
  const nextSidebar = doc.querySelector(XIAOHEI_HOST_SELECTORS.sidebarShell);
186
186
  const nextHero = doc.querySelector(XIAOHEI_HOST_SELECTORS.composerHeroMark);
187
+ let mounted = false;
187
188
  if (composer !== next || sidebar !== nextSidebar || hero !== nextHero) {
188
189
  composer?.removeAttribute('data-heixiu-dock');
189
190
  ro?.disconnect();
@@ -202,6 +203,7 @@ export function installComposerBloub(doc = typeof document === 'undefined' ? und
202
203
  ro?.observe(hero);
203
204
  if (heroRow)
204
205
  ro?.observe(heroRow);
206
+ mounted = true;
205
207
  }
206
208
  if (!composer) {
207
209
  button.remove();
@@ -213,9 +215,17 @@ export function installComposerBloub(doc = typeof document === 'undefined' ? und
213
215
  // The native trailing toolbar must stay last: DSH and the existing send
214
216
  // skin use its structural position. The overlay must not replace it.
215
217
  const toolbar = [...composer.children].reverse().find(child => child !== button);
218
+ button.hidden = true;
216
219
  composer.insertBefore(button, toolbar ?? null);
217
220
  io?.observe(button);
218
221
  dirty = true;
222
+ mounted = true;
223
+ }
224
+ // Let the host lay out the new dock before reading geometry. Do not force
225
+ // a synchronous layout of the entire newly mounted conversation here.
226
+ if (mounted) {
227
+ scheduleLayout();
228
+ return;
219
229
  }
220
230
  if (!dirty)
221
231
  return;
@@ -223,16 +233,21 @@ export function installComposerBloub(doc = typeof document === 'undefined' ? und
223
233
  const wasFlying = flight.active;
224
234
  const viewportChanged = viewportWidth !== win.innerWidth || viewportHeight !== win.innerHeight;
225
235
  const origin = flight.capture(bounds);
226
- follow(0, 0);
227
236
  const rect = composer.getBoundingClientRect();
237
+ const border = { left: composer.clientLeft || 0, top: composer.clientTop || 0 };
228
238
  const sidebarRight = sidebar?.getBoundingClientRect().right ?? 0;
229
239
  const dock = resolveHeixiuDock(rect.left, sidebarRight, win.innerWidth);
230
240
  const heroRect = hero?.getBoundingClientRect();
231
241
  const welcome = heroRect && resolveHeixiuWelcome(heroRect, rect, sidebarRight, win.innerWidth);
242
+ const target = resolveHeixiuBox(rect, border, dock, welcome || undefined);
243
+ // All geometry reads are complete. Everything below only writes.
244
+ follow(0, 0);
232
245
  if (welcome) {
233
- button.style.setProperty('--heixiu-welcome-left', `${welcome.left}px`);
234
- button.style.setProperty('--heixiu-welcome-top', `${welcome.top}px`);
235
- button.style.setProperty('--heixiu-welcome-size', `${welcome.size}px`);
246
+ for (const [key, value] of Object.entries(welcome)) {
247
+ const property = `--heixiu-welcome-${key}`, css = `${value}px`;
248
+ if (button.style.getPropertyValue(property) !== css)
249
+ button.style.setProperty(property, css);
250
+ }
236
251
  }
237
252
  const mode = welcome ? 'welcome' : dock.mode;
238
253
  const fly = !viewportChanged && (wasFlying || !!dockMode && dockMode !== mode && (dockMode === 'welcome' || mode === 'welcome'));
@@ -241,8 +256,8 @@ export function installComposerBloub(doc = typeof document === 'undefined' ? und
241
256
  viewportHeight = win.innerHeight;
242
257
  if (composer.dataset.heixiuDock !== mode)
243
258
  composer.dataset.heixiuDock = mode;
244
- // One read after layout configuration; never inside the animation loop.
245
- bounds = flight.target(button.getBoundingClientRect());
259
+ bounds = target;
260
+ button.hidden = false;
246
261
  visible = rect.width > 0 && rect.height > 0 && bounds.top + bounds.height > 0 && bounds.top < win.innerHeight;
247
262
  syncPlayback();
248
263
  if (allowed() && fly)
@@ -369,7 +384,23 @@ export function installComposerBloub(doc = typeof document === 'undefined' ? und
369
384
  else if (next.running && (!actionUntil || button.dataset.actionSource !== 'session'))
370
385
  playState('thinking', 'session', true);
371
386
  }) ?? (() => { });
372
- const unsubscribe = subscribeXiaoheiHostDom(doc, scheduleLayout);
387
+ const unsubscribe = subscribeXiaoheiHostDom(doc, records => {
388
+ // Streamed paragraphs and our own SVG effects do not replace host slots.
389
+ // Parent removals still reach us, so session/composer replacement is safe.
390
+ if (records.length && records.every(record => {
391
+ const target = record.target.nodeType === 1 ? record.target : record.target.parentElement;
392
+ return target?.closest('[data-chat-flow], .xiaohei-bloub');
393
+ }))
394
+ return;
395
+ scheduleLayout();
396
+ });
397
+ const scrolled = (event) => {
398
+ const target = event.target;
399
+ // Captured scrolls from history/code blocks cannot move a fixed composer.
400
+ if (target === doc || target === win || target instanceof win.Element &&
401
+ (target.contains(composer) || target.contains(sidebar)))
402
+ resized();
403
+ };
373
404
  doc.addEventListener('pointermove', move, { passive: true });
374
405
  doc.addEventListener('pointerleave', leave);
375
406
  doc.addEventListener('visibilitychange', syncPlayback);
@@ -378,7 +409,7 @@ export function installComposerBloub(doc = typeof document === 'undefined' ? und
378
409
  button.addEventListener('dblclick', doubleClick);
379
410
  button.addEventListener('keydown', keydown);
380
411
  win.addEventListener('resize', resized, { passive: true });
381
- win.addEventListener('scroll', resized, { passive: true, capture: true });
412
+ win.addEventListener('scroll', scrolled, { passive: true, capture: true });
382
413
  motion.addEventListener('change', syncPlayback);
383
414
  scheduleLayout();
384
415
  return () => {
@@ -398,7 +429,7 @@ export function installComposerBloub(doc = typeof document === 'undefined' ? und
398
429
  button.removeEventListener('dblclick', doubleClick);
399
430
  button.removeEventListener('keydown', keydown);
400
431
  win.removeEventListener('resize', resized);
401
- win.removeEventListener('scroll', resized, true);
432
+ win.removeEventListener('scroll', scrolled, true);
402
433
  motion.removeEventListener('change', syncPlayback);
403
434
  heroRow?.removeAttribute('data-heixiu-hero-row');
404
435
  composer?.removeAttribute('data-heixiu-dock');
@@ -0,0 +1,100 @@
1
+ window.__ModuleLoader__.load({ id: "@lemoncat7/dsh-theme-xiaohei", chunk: "client.companion.js", factory: (require) => { var module = { exports: {} }; var exports = module.exports;
2
+ "use strict";var Je=Object.defineProperty;var Fn=Object.getOwnPropertyDescriptor;var Cn=Object.getOwnPropertyNames;var zn=Object.prototype.hasOwnProperty;var Dn=(e,n)=>{for(var t in n)Je(e,t,{get:n[t],enumerable:!0})},Nn=(e,n,t,i)=>{if(n&&typeof n=="object"||typeof n=="function")for(let o of Cn(n))!zn.call(e,o)&&o!==t&&Je(e,o,{get:()=>n[o],enumerable:!(i=Fn(n,o))||i.enumerable});return e};var Xn=e=>Nn(Je({},"__esModule",{value:!0}),e);var So={};Dn(So,{installComposerBloub:()=>An});module.exports=Xn(So);var $=Math.PI*2,I=(e,n=0,t=1)=>e<n?n:e>t?t:e,w=(e,n,t)=>e+(n-e)*t,_={easeOutCubic:e=>1-(1-e)**3,easeInOutCubic:e=>e<.5?4*e**3:1-(-2*e+2)**3/2,easeOutQuint:e=>1-(1-e)**5};function Q(e,n,t=0){let i=e/n*$;return .55*Math.sin(i+t)+.3*Math.sin(2*i+t*1.7+1.1)+.15*Math.sin(3*i+t*2.3+2.4)}function he(e){let n=e>>>0;return()=>{n=n+1831565813>>>0;let t=Math.imul(n^n>>>15,1|n);return t=t+Math.imul(t^t>>>7,61|t)^t,((t^t>>>14)>>>0)/4294967296}}var b=e=>Math.round(e*100)/100;function et(e,n=.55,t=.62){let i=(e%360+360)%360,o=(1-Math.abs(2*t-1))*n,s=o*(1-Math.abs(i/60%2-1)),r=t-o/2,[a,c,u]=i<60?[o,s,0]:i<120?[s,o,0]:i<180?[0,o,s]:i<240?[0,s,o]:i<300?[s,0,o]:[o,0,s],l=p=>Math.round((p+r)*255).toString(16).padStart(2,"0");return`#${l(a)}${l(c)}${l(u)}`}function Rt(e,n,t,i,o=1){let s=e.phase+n*e.speed*$,r=Math.cos(e.tilt),a=Math.sin(e.tilt),c=Math.sqrt(Math.max(0,1-e.k*e.k)),u=64,l=e.sweep*$,p="",m="",f=null;for(let h=0;h<=u;h++){let x=s+h/u*l,y=Math.cos(x),d=Math.sin(x),v=e.a*(y*r+d*-a*e.k)+e.cx,k=e.a*(y*a+d*r*e.k)+e.cy,A=e.a*d*c<0,B=b(v*t),S=b(k*t),F=A!==f?"M":"L";A?m+=`${F}${B} ${S}`:p+=`${F}${B} ${S}`,f=A}let g=Math.cos(e.tilt)*e.a*t,M=Math.sin(e.tilt)*e.a*t;return{id:i,front:p,back:m,width:e.width*t,opacity:o,grad:{x1:b(e.cx*t-g),y1:b(e.cy*t-M),x2:b(e.cx*t+g),y2:b(e.cy*t+M),stops:[et(e.hue),et(e.hue+e.hueSpan*.5),et(e.hue+e.hueSpan)]}}}var W=he(659918),tt=Array.from({length:6},(e,n)=>({a:1.3+W()*.1,k:.05+W()*.4,tilt:n/6*Math.PI+W()*.5,speed:3+W()*.7,phase:W()*$,sweep:.6+W()*.25,hue:n*360/6+W()*30,hueSpan:60+W()*60,width:.05+W()*.012,cx:0,cy:.1})),Tt=Array.from({length:4},(e,n)=>({a:.78+n*.2,k:.05+n*.02,tilt:-.62+n*.05,speed:.3,phase:.06*n,sweep:.4,hue:95+n*62,hueSpan:100,width:.05,cx:0,cy:-.12})),nt=[-.557,-.013,.532],ot=.165,it=1.25,Ht=he(48879),Gn=Array.from({length:5},(e,n)=>({birth:n*.2,angle:Ht()*$,rho:.58+Ht()*.18}));function $t(e,n){let t=[];for(let i of Gn){let o=e-i.birth;if(o<0||o>.62)continue;let s=i.rho*Math.pow(.75,o*10),r=i.angle+o*100*Math.PI/180;t.push({x:Math.cos(r)*s*n,y:Math.sin(r)*s*n,r:(.04+.028*I(o/.55))*n,depth:I(1-s/.8),opacity:I(o/.06)*I((.62-o)/.08)})}return t}var Ot=he(49383),Bt=Array.from({length:4},(e,n)=>{let t=n-1.5;return{a:.85*(1+t*.03),k:.15/.85*(1+t*.16),tilt:34*Math.PI/180+t*.035,speed:210/360,phase:-n*.045+Ot()*.012,sweep:.34,hue:n*85+Ot()*20,hueSpan:80,width:.095,cx:0,cy:0}}),Lt=.129;var _t=-42,rt=1.003,Ft=.15,Ct=1.14,zt=.054;var Me=15.46,we=.186,ve=.412,Se={yaw:28.49,pitch:28.62,roll:-13},Te=e=>e*Math.PI/180;function $e(e,n,t){let i=Math.cos(t),o=Math.sin(t);return[[e[0]*i+n[0]*o,e[1]*i+n[1]*o,e[2]*i+n[2]*o],[n[0]*i-e[0]*o,n[1]*i-e[1]*o,n[2]*i-e[2]*o]]}function Be(e,n,t=Me){let i=[0,0,1],o=[1,0,0],s=[0,1,0];[i,o]=$e(i,o,Te(e.yaw)),[s,i]=$e(s,i,Te(e.pitch)),[o,s]=$e(o,s,Te(e.roll));let r=a=>{let[c,u]=$e(i,o,Te(t*a));return{x:c[0]*n,y:c[1]*n,a:u[0],b:u[1],c:s[0],d:s[1],depth:c[2]}};return[r(-1),r(1)]}var Dt=he(24301),Nt=(()=>{let e=[],n=1.4;for(;n<900;)e.push(n),n+=1.9+Dt()*2.7,Dt()<.18&&(e.push(n),n+=.24);return e})(),Un=.18;function Yn(e){e=(e%900+900)%900;for(let n=0;n<Nt.length;n++){let t=Nt[n];if(e<t)break;let i=(e-t)/Un;if(i>=0&&i<=1)return i<.45?1-i/.45:(i-.45)/.55}return 1}function Le(e,n={}){let{wander:t=1,blink:i=!0,float:o=!0}=n;return{dYaw:(Q(e,11.3,.4)*5.5+Q(e,3.7,2.1)*1.6)*t,dPitch:(Q(e,9.1,1.3)*4.2+Q(e,4.3,.7)*1.3)*t,dRoll:Q(e,13.7,3.2)*2.2*t,lid:i?Yn(e):1,driftX:o?Q(e,7.9,1.9)*.006:0,driftY:o?Q(e,5.3,.3)*.007:0,breath:o?1+Math.sin(e/3.4*Math.PI*2)*.005:1}}function Xt(e){return .06+.94*I(e)}var V=(e,n,t=0,i=1)=>({w:e,h:n,tilt:t,open:i}),U=(e,n,t=0,i=1)=>[V(e,n,t,i),V(e,n,-t,i)],st=[{id:"neutre",gaze:{...Se},split:Me,eyes:[V(we,ve),V(we,ve)]},{id:"attentif",gaze:{yaw:4,pitch:5,roll:-4},split:16,eyes:U(.21,.44)},{id:"surpris",gaze:{yaw:3,pitch:-3,roll:0},split:19,eyes:U(.45,.47)},{id:"excite",gaze:{yaw:6,pitch:-14,roll:0},split:19.5,eyes:U(.4,.56,-10)},{id:"heureux",gaze:{yaw:5,pitch:9,roll:0},split:17,eyes:U(.27,.17,14)},{id:"hilare",gaze:{yaw:4,pitch:14,roll:0},split:18,eyes:U(.34,.13,20)},{id:"colere",gaze:{yaw:3,pitch:7,roll:0},split:17,eyes:U(.34,.15,30)},{id:"triste",gaze:{yaw:3,pitch:-13,roll:0},split:16,eyes:U(.22,.4,-28)},{id:"effraye",gaze:{yaw:2,pitch:-20,roll:0},split:20.5,eyes:U(.4,.6)},{id:"mefiant",gaze:{yaw:12,pitch:6,roll:-6},split:16,eyes:[V(.21,.4),V(.22,.15)]},{id:"confus",gaze:{yaw:-14,pitch:3,roll:8},split:16.5,eyes:[V(.2,.44,-18),V(.28,.17,14)]},{id:"curieux",gaze:{yaw:16,pitch:-9,roll:-15},split:16.5,eyes:[V(.24,.46,-8),V(.2,.38,-8)]},{id:"fier",gaze:{yaw:5,pitch:17,roll:0},split:17,eyes:U(.3,.15,18)},{id:"timide",gaze:{yaw:-19,pitch:-14,roll:-7},split:14,eyes:U(.17,.3)},{id:"blase",gaze:{yaw:-22,pitch:2,roll:0},split:16,eyes:U(.3,.12)},{id:"somnolent",gaze:{yaw:6,pitch:-9,roll:-3},split:16,eyes:U(.2,.42,0,.42)}],$o=new Map(st.map(e=>[e.id,e]));var Gt=(e,n,t)=>({w:w(e.w,n.w,t),h:w(e.h,n.h,t),tilt:w(e.tilt??0,n.tilt??0,t),open:w(e.open,n.open,t)});function Ut(e,n,t){return{id:n.id,gaze:{yaw:w(e.gaze.yaw,n.gaze.yaw,t),pitch:w(e.gaze.pitch,n.gaze.pitch,t),roll:w(e.gaze.roll,n.gaze.roll,t)},split:w(e.split,n.split,t),eyes:[Gt(e.eyes[0],n.eyes[0],t),Gt(e.eyes[1],n.eyes[1],t)]}}var Yt={egg:[.8369,.8424,.8497,.8585,.8674,.8775,.8878,.8983,.9089,.9185,.9288,.9374,.9445,.9504,.9543,.9559,.9555,.9519,.9466,.9389,.9302,.9193,.9085,.8969,.8852,.8734,.8625,.8513,.8411,.8325,.8243,.8179,.8137,.8112,.8102,.8128,.8178,.8262,.8374,.8518,.8702,.8922,.9169,.9446,.9741,1.0023,1.0267,1.0433,1.0481,1.0393,1.0216,.997,.9697,.9418,.9169,.8949,.876,.8604,.849,.8394,.8337,.8314,.8305,.8326],hexagon:[.921,.9282,.9441,.9706,.9984,1.0059,.9896,.9562,.929,.9124,.9047,.9058,.9157,.9349,.9642,.9873,.9882,.9665,.9336,.9105,.8968,.8918,.8955,.908,.9293,.9611,.982,.9812,.959,.9282,.9089,.8978,.8964,.9026,.9189,.9439,.9778,.999,.9964,.9713,.9439,.9274,.9196,.9206,.9308,.9502,.9799,1.0121,1.0226,1.0071,.9752,.951,.9366,.9316,.9351,.9485,.9711,1.0026,1.0213,1.0155,.9863,.9547,.9347,.9232],triangle:[.7819,.8211,.8747,.944,1.0223,1.096,1.1401,1.134,1.0808,1.0047,.9265,.8603,.8104,.773,.745,.7273,.7151,.7118,.7148,.7245,.7427,.768,.8037,.8518,.9148,.9876,1.0583,1.1073,1.1109,1.0667,.994,.9164,.8482,.7948,.7555,.7261,.7056,.6925,.6859,.6869,.6938,.7084,.7305,.7615,.804,.8595,.9311,1.0092,1.0791,1.1171,1.1054,1.0501,.9779,.905,.845,.799,.7656,.7413,.7258,.716,.7146,.7204,.733,.7528]};var at=Array.from({length:64},(e,n)=>n/64*$),_e=at.map(Math.cos),Fe=at.map(Math.sin);function Ce(e,n={}){return{radii:[...Yt[e]],rot:0,cx:0,cy:0,sx:1,sy:1,...n}}function re(e,n={}){return{radii:new Array(64).fill(e),rot:0,cx:0,cy:0,sx:1,sy:1,...n}}function Vt(e,n,t,i){let o=i??{radii:new Array(64),rot:0,cx:0,cy:0,sx:1,sy:1};for(let r=0;r<64;r++)o.radii[r]=w(e.radii[r]??1,n.radii[r]??1,t);let s=n.rot-e.rot;for(;s>Math.PI;)s-=$;for(;s<-Math.PI;)s+=$;return o.rot=e.rot+s*t,o.cx=w(e.cx,n.cx,t),o.cy=w(e.cy,n.cy,t),o.sx=w(e.sx,n.sx,t),o.sy=w(e.sy,n.sy,t),o}function Ie(e,n,t=[]){let i=Math.cos(e.rot),o=Math.sin(e.rot);for(let s=0;s<64;s++){let r=e.radii[s]??1,a=r*(_e[s]??0),c=r*(Fe[s]??0),u=a*i-c*o,l=a*o+c*i,p=t[s]??{x:0,y:0};p.x=(u*e.sx+e.cx)*n,p.y=(l*e.sy+e.cy)*n,t[s]=p}return t.length=64,t}function qt(e,n=1/6){let t=e.length;if(t<3)return"";let i=e[0],o=`M${b(i.x)} ${b(i.y)}`;for(let s=0;s<t;s++){let r=e[(s-1+t)%t],a=e[s],c=e[(s+1)%t],u=e[(s+2)%t],l=a.x+(c.x-r.x)*n,p=a.y+(c.y-r.y)*n,m=c.x-(u.x-a.x)*n,f=c.y-(u.y-a.y)*n;o+=`C${b(l)} ${b(p)} ${b(m)} ${b(f)} ${b(c.x)} ${b(c.y)}`}return`${o}Z`}function se(e,n,t){let i=new Array(64).fill(0),o=e.length;for(let s=0;s<64;s++){let r=_e[s]??0,a=Fe[s]??0,c=0;for(let u=0;u<o;u++){let l=e[u],p=e[(u+1)%o],m=p.x-l.x,f=p.y-l.y,g=r*f-a*m;if(Math.abs(g)<1e-9)continue;let M=l.x-n,h=l.y-t,x=(M*f-h*m)/g,y=(M*a-h*r)/g;x>c&&y>=0&&y<=1&&(c=x)}i[s]=c}return i}function ae(e,n,t,i,o,s,r=96){let a=i-e,c=o-n,u=Math.hypot(a,c)||1e-6,l=Math.atan2(c,a),p=Math.acos(Math.max(-1,Math.min(1,(t-s)/u))),m=[];for(let f=0;f<=r/2;f++){let g=l+p+($-2*p)*f/(r/2);m.push({x:e+Math.cos(g)*t,y:n+Math.sin(g)*t})}for(let f=0;f<=r/2;f++){let g=l-p+2*p*f/(r/2);m.push({x:i+Math.cos(g)*s,y:o+Math.sin(g)*s})}return m}function ze(e,n){let t=e.length,i=(n/$%1+1)%1*t,o=Math.floor(i);return w(e[o%t]??1,e[(o+1)%t]??1,i-o)}function De(e,n=1,t=1){return at.map((i,o)=>{let s=Math.abs((_e[o]??0)/n)**e,r=Math.abs((Fe[o]??0)/t)**e;return(s+r)**(-1/e)})}function Wt(e){let n=new Array(64).fill(0);for(let t=0;t<64;t++){let i=_e[t]??0,o=Fe[t]??0,s=0;for(let r of e){let a=i*r.x+o*r.y,c=a*a-(r.x*r.x+r.y*r.y-r.r*r.r);if(c<0)continue;let u=a+Math.sqrt(c);u>s&&(s=u)}n[t]=s}return n}function Vn(e,n,t=10){let i=e.length,o=[],s=(r,a)=>{let c=a.x-r.x,u=a.y-r.y,l=Math.hypot(c,u)||1;return Math.atan2(-c/l,u/l)};for(let r=0;r<i;r++){let a=e[(r-1+i)%i],c=e[r],u=e[(r+1)%i],l=s(a,c),m=s(c,u)-l;for(;m>Math.PI;)m-=$;for(;m<-Math.PI;)m+=$;for(let f=0;f<=t;f++){let g=l+m*f/t;o.push({x:c.x+Math.cos(g)*n,y:c.y+Math.sin(g)*n})}}return o}function ct(e,n,t,i=0){let o=i*Math.PI/180,s=Array.from({length:e},(r,a)=>{let c=o+a/e*$;return{x:Math.cos(c)*(n-t),y:Math.sin(c)*(n-t)}});return se(Vn(s,t),0,0)}function Kt(e,n=1){if(e.length<3)return"";let t="";for(let i=0;i<e.length;i++){let o=e[i];t+=`${i===0?"M":"L"}${b(o.x*n)} ${b(o.y*n)}`}return`${t}Z`}function jt(e,n){let t=Math.max(e,.01)/2,i=Math.max(n,.01)/2,o=Math.min(t,i);return`M${b(-t)} ${b(-i+o)}A${b(o)} ${b(o)} 0 0 1 ${b(-t+o)} ${b(-i)}L${b(t-o)} ${b(-i)}A${b(o)} ${b(o)} 0 0 1 ${b(t)} ${b(-i+o)}L${b(t)} ${b(i-o)}A${b(o)} ${b(o)} 0 0 1 ${b(t-o)} ${b(i)}L${b(-t+o)} ${b(i)}A${b(o)} ${b(o)} 0 0 1 ${b(-t)} ${b(i-o)}Z`}function Ne(e,n=1){let t=Math.max(...e);if(t<=0)return e;let i=n/t;return e.map(o=>o*i)}var qn=Array.from({length:64},(e,n)=>n/64*Math.PI*2),Wn=Ne(qn.map(e=>1+.075*Math.cos(2*e+.5)+.035*Math.cos(3*e+2.1)),1.02),Kn=Ne(Wt([{x:-.44,y:.2,r:.54},{x:.46,y:.2,r:.5},{x:.02,y:.3,r:.6},{x:-.24,y:-.3,r:.48},{x:.3,y:-.24,r:.44}]),1.02),jn=Ne(se(ae(0,.28,.66,0,-.96,.05),0,0),1.04),Qn=se(ae(-.42,0,.62,.42,0,.62),0,0),Xe=[{id:"cercle",radii:new Array(64).fill(1)},{id:"galet",radii:Wn},{id:"squircle",radii:Ne(De(4.2),1.15)},{id:"capsule",radii:Qn},{id:"triangle",radii:ct(3,1.12,.34,-90)},{id:"hexagone",radii:ct(6,1.04,.26,0)},{id:"nuage",radii:Kn},{id:"goutte",radii:jn}],No=new Map(Xe.map(e=>[e.id,e]));var Zn=[{id:"encre",hex:"#0a0a0c"},{id:"brun",hex:"#8b5e3c"},{id:"rouge",hex:"#e8483f"},{id:"orange",hex:"#f08a24"},{id:"ambre",hex:"#f0b429"},{id:"vert",hex:"#3ecf8e"},{id:"turquoise",hex:"#2fbfa0"},{id:"bleu",hex:"#3b93f0"},{id:"violet",hex:"#8b5cf6"},{id:"rose",hex:"#e152b0"},{id:"gris",hex:"#a3a3a3"},{id:"creme",hex:"#f1efe9"}],Xo=new Map(Zn.map(e=>[e.id,e]));var ce=(e,n)=>[{w:e,h:n,open:1},{w:e,h:n,open:1}];function z(e={}){return{sil:re(1),offX:0,offY:0,gaze:{...Se},split:Me,eyes:ce(we,ve),eyeAlpha:1,bodyAlpha:1,dots:[],arcs:[],notif:null,dotsBehind:!1,...e}}var en=-.1875,Jn=se(ae(0,-.505,.132,0,.13,.075),0,en),eo=se(ae(0,-.2535,.1345,0,.2535,.1345),0,0),to=(e={})=>({radii:[...Jn],rot:0,cx:0,cy:en,sx:1,sy:1,...e}),no=(e={})=>({radii:[...eo],rot:0,cx:0,cy:0,sx:1,sy:1,...e}),oo=Kt(ae(0,0,.118,0,.172,.012)),Qt=.213;function Zt(e){return Ce("triangle",{rot:e,cx:-Qt*Math.sin(e),cy:Qt*Math.cos(e)})}function Jt(e,n){let t=((e-n*.5)/1.5%1+1)%1,i=t<.5?.5-.5*Math.cos(t*$):0;return I(i*2)}var ut=[{id:"idle",duration:2.4,morph:.45,blinkIn:!1,baseFace:!0,baseBody:!0,pose:()=>z()},{id:"thinking",duration:2.6,morph:.4,baseFace:!1,baseBody:!1,blinkIn:!0,pose:e=>{let n=Jt(e,1),t=.3+.7*_.easeOutCubic(I(e/.3));return z({sil:re(ot*(1+(it-1)*n),{cx:nt[1]}),eyeAlpha:0,dots:[0,2].map(i=>{let o=Jt(e,i);return{x:nt[i]*t,y:0,r:ot*(1+(it-1)*o),opacity:.55+.45*o}})})}},{id:"wink",duration:1.6,morph:.3,blinkIn:!0,baseFace:!1,baseBody:!0,pose:()=>z({gaze:{yaw:-5.37,pitch:4.55,roll:6.7},split:16.25,eyes:[{w:.236,h:.464,open:1},{w:.447,h:.089,open:1}]})},{id:"wide",duration:1.8,morph:.55,blinkIn:!0,baseFace:!1,baseBody:!0,pose:()=>z({gaze:{yaw:6.92,pitch:-21.96,roll:11.6},split:18.43,eyes:ce(.356,.875)})},{id:"alert",duration:2.4,minDuration:2,morph:.45,baseFace:!1,baseBody:!1,blinkIn:!1,pose:e=>{let n=I(e/1.5),t=_.easeInOutCubic(n)*.82-.087,i=e>1.6?I((e-1.6)/.4):0,o=t*(1-i)+.1*i,s=Math.sin(e*2.5*$)*.005,r=17.7*Math.PI/180;return z({sil:no({rot:r,cx:o,cy:-.325-s}),eyeAlpha:0,dots:[{x:o-Math.sin(r)*.58,y:-.325+Math.cos(r)*.58+s*2.8,r:.118,d:oo,rot:r*180/Math.PI,opacity:1}]})}},{id:"notify",duration:2.2,morph:.5,blinkIn:!0,baseFace:!1,baseBody:!0,pose:e=>{let n=I(e/.45),t=1+(Ct-1)*Math.sin(n*Math.PI)*(1-n*.35),i=Ft*(n<1?t:1),o=_t*Math.PI/180;return z({gaze:{yaw:-21.94,pitch:-5.82,roll:-12.2},split:18.89,eyes:ce(.505,.498),notif:{x:Math.cos(o)*rt,y:Math.sin(o)*rt,r:i,notch:i+zt}})}},{id:"exclaim",duration:2,morph:.45,baseFace:!1,baseBody:!1,blinkIn:!1,pose:()=>z({sil:to(),eyeAlpha:0,dots:[{x:-.012,y:.526,r:.113,opacity:1}]})},{id:"sleep",duration:2.4,morph:.5,baseFace:!1,baseBody:!1,blinkIn:!1,pose:e=>z({sil:re(.1585,{cy:.11+Math.sin(e*($/.6))*.19}),eyeAlpha:0})},{id:"egg",duration:1.8,morph:.4,baseFace:!1,baseBody:!1,blinkIn:!0,pose:()=>z({sil:Ce("egg"),gaze:{yaw:19.97,pitch:26.01,roll:-17.1},split:11.07,eyes:ce(.164,.385)})},{id:"hexagon",duration:1.6,morph:.4,baseFace:!1,baseBody:!1,blinkIn:!0,pose:()=>z({sil:Ce("hexagon"),gaze:{yaw:23.11,pitch:24.42,roll:-13.3},split:13.37,eyes:ce(.177,.411)})},{id:"play",duration:2,morph:.5,baseFace:!1,baseBody:!1,blinkIn:!0,pose:e=>{let n=I(e/.35)*I((2.2-e)/.5);return z({sil:Zt(0),gaze:{yaw:12,pitch:-8,roll:-6},split:15,eyes:ce(.18,.34),arcs:Tt.map((t,i)=>({id:`sw${i}`,seed:{...t,cx:.45-e*.42},t:e,opacity:n}))})}},{id:"orbit",duration:3.4,minDuration:2.5,morph:.6,baseFace:!1,baseBody:!1,blinkIn:!1,pose:e=>{let n=_.easeInOutCubic(I(e/.35)),t=-$*1.25*e*n,i=_.easeInOutCubic(I((e-1.6)/.9)),o=Zt(t),s=re(1,{rot:t}),r={radii:o.radii.map((c,u)=>c+(s.radii[u]-c)*i),rot:t,cx:o.cx*(1-i),cy:o.cy*(1-i),sx:1,sy:1},a=I(e/.8)*I((3.6-e)/.9);return z({sil:r,gaze:{yaw:Se.yaw+Math.sin(e*6.5)*65*(1-i),pitch:-4+i*32,roll:-13},eyes:ce(.18,.34+i*.07),arcs:tt.map((c,u)=>({id:`rg${u}`,seed:c,t:e,opacity:a*I((e-u*.13)/.3)}))})}},{id:"swirl",duration:1.3,minDuration:1.3,morph:.3,baseFace:!0,baseBody:!0,blinkIn:!0,pose:e=>z({arcs:tt.slice(0,3).map((n,t)=>({id:`sw${t}`,seed:n,t:e,opacity:I((e-t*.06)/.14)*I((1.22-e)/.34)}))})},{id:"burst",duration:2.6,minDuration:2.4,morph:.4,baseFace:!1,baseBody:!1,blinkIn:!1,pose:e=>{let n=1-.834*_.easeOutQuint(I(e/.7)),t=_.easeOutQuint(I((e-1.7)/.7));return z({sil:re(n+(1-n)*t),eyeAlpha:I((e-1.85)/.4),dots:$t(e,1),dotsBehind:!0})}},{id:"comet",duration:2.4,minDuration:2.4,morph:.45,baseFace:!1,baseBody:!1,blinkIn:!1,pose:e=>{let n=1-(1-Lt)*_.easeOutQuint(I(e/.55)),t=_.easeOutQuint(I((e-1.85)/.6)),i=I((e-.15)/.25)*I((1.95-e)/.3);return z({sil:re(n+(1-n)*t,{cy:Math.sin(I(e/1.7)*Math.PI)*.035}),eyeAlpha:I((e-2)/.35),arcs:Bt.map((o,s)=>({id:`cm${s}`,seed:o,t:e,opacity:i}))})}}],Z=new Map(ut.map(e=>[e.id,e]));var K=100,tn=5.5+1.6,nn=4.2+1.3,io=.006,ro=.007;function on(e,n,t){let i=[],o=Be(e.gaze,K,e.split);for(let s=0;s<2;s++){let r=o[s];if(r.depth<=.02)continue;let a=e.eyes[s],c=(a.tilt??0)*Math.PI/180,u=Math.cos(c),l=Math.sin(c),p=r.a*u+r.c*l,m=r.b*u+r.d*l,f=-r.a*l+r.c*u,g=-r.b*l+r.d*u,M=Math.max(a.w*K,.01)/2,h=Math.max(a.h*K,.01)/2,x=Math.min(M,h),y=h>M,d=y?h-x:M-x,v=ze(t,Math.atan2(r.y,r.x)-n.rot);i.push({x:r.x*v,y:r.y*v,ax:(y?f:p)*d,ay:(y?g:m)*d,r:x,m:[p,m,f,g]})}return i}function so(e,n,t,i,o){let s=i-n,r=o-t,a=s*s+r*r,c=1/0,u=0,l=0;for(let m=0;m<e.length;m++){let f=e[m],g=a>0?((f.x-n)*s+(f.y-t)*r)/a:0;g=g<0?0:g>1?1:g;let M=n+g*s-f.x,h=t+g*r-f.y,x=M*M+h*h;x<c&&(c=x,u=M,l=h)}let p=Math.sqrt(c);return{d:p,ux:p>1e-9?u/p:0,uy:p>1e-9?l/p:0}}var ao=Math.hypot(io,ro)*K;function rn(e,n,t,i){let o=1/0,s=0,r=0;for(let a of n){let c=a.x+t,u=a.y+i,l=so(e,c-a.ax,u-a.ay,c+a.ax,u+a.ay),[p,m,f,g]=a.m,M=a.r*Math.hypot(p*l.ux+m*l.uy,f*l.ux+g*l.uy)+ao;l.d-M<o&&(o=l.d-M,s=l.ux,r=l.uy)}return{marge:o,ux:s,uy:r}}var sn=12,co=8;function uo(e){if(!e.length)return{x:0,y:0};let n=(x,y)=>{let d=1/0;for(let v of e)d=Math.min(d,rn(v.contour,v.empreintes,x,y).marge);return d},t=1/0;for(let x of e)t=Math.min(t,rn(x.calContour,x.reference,0,0).marge);let i=0,o=0,s=e[0].empreintes;for(let x of s)i-=x.x/s.length,o-=x.y/s.length;let r=Math.max(.35*K,Math.hypot(i,o)*1.25);t=Math.min(t,n(i,o));let a=n(0,0);if(a>=t&&a>=0)return{x:0,y:0};let c=Math.max(t,0),u=0,l=0,p=1/0,m=0,f=0,g=a;for(let x=0;x<sn;x++){let y=x/sn*Math.PI*2,d=Math.cos(y),v=Math.sin(y);if(n(d*r,v*r)<c){for(let A of[.3,.6,1]){let B=n(d*r*A,v*r*A);B>g&&(g=B,m=d*r*A,f=v*r*A)}continue}let k=0,R=r;for(let A=0;A<co;A++){let B=(k+R)/2;n(d*B,v*B)>=c?R=B:k=B}R<p&&(p=R,u=d*R,l=v*R)}let M=p===1/0?m:u,h=p===1/0?f:l;return{x:+(M/K).toFixed(6),y:+(h/K).toFixed(6)}}function lo(e,n,t){return e.baseFace&&t?{gaze:t.gaze,split:t.split,eyes:t.eyes}:{gaze:n.gaze,split:n.split,eyes:n.eyes}}function po(e){let n=i=>JSON.stringify([i.gaze,i.split,i.eyes,i.sil.rot,i.sil.cx,i.sil.cy,i.sil.sx,i.sil.sy]);if(n(e.pose(0))===n(e.pose(e.duration)))return[0];let t=3;return Array.from({length:t},(i,o)=>o/(t-1)*e.duration)}function ho(e,n,t){let i=[];for(let o of po(e)){let s=e.pose(o),r=Ie({...s.sil,radii:n},K),a=Ie(s.sil,K),c=lo(e,s,t),u=[];for(let l of[-tn,tn])for(let p of[-nn,nn])u.push({...c,gaze:{yaw:c.gaze.yaw+l,pitch:c.gaze.pitch+p,roll:c.gaze.roll}});for(let l of u)i.push({empreintes:on(l,s.sil,n),reference:on(l,s.sil,s.sil.radii),contour:r,calContour:a})}return uo(i)}var lt={x:0,y:0},pt=(e,n)=>`${e}|${n??""}`;function mo(){return new Map(Xe.map(e=>{let n=new Map;for(let t of ut){if(!t.baseBody)continue;let i=t.baseFace?[null,...st]:[null];for(let o of i)n.set(pt(t.id,o?.id??null),ho(t,e.radii,o))}return[e.radii,n]}))}var fo,xo=new Set(Xe.map(e=>e.radii));function ht(e,n,t){if(!e||!xo.has(e))return lt;let i=(fo??=mo()).get(e);return i?i.get(pt(n,t))??i.get(pt(n,null))??lt:lt}var dt={yaw:0,pitch:0,mix:0,spin:0,wander:1},bo=(e,n,t)=>({yaw:w(e.yaw,n.yaw,t),pitch:w(e.pitch,n.pitch,t),mix:w(e.mix,n.mix,t),spin:w(e.spin,n.spin,t),wander:w(e.wander,n.wander,t)}),an=(e,n,t)=>({w:w(e.w,n.w,t),h:w(e.h,n.h,t),open:w(e.open,n.open,t),tilt:w(e.tilt??0,n.tilt??0,t)});function cn(e,n,t){let i=1-t;return{sil:Vt(e.sil,n.sil,t),offX:w(e.offX,n.offX,t),offY:w(e.offY,n.offY,t),gaze:{yaw:w(e.gaze.yaw,n.gaze.yaw,t),pitch:w(e.gaze.pitch,n.gaze.pitch,t),roll:w(e.gaze.roll,n.gaze.roll,t)},split:w(e.split,n.split,t),eyes:[an(e.eyes[0],n.eyes[0],t),an(e.eyes[1],n.eyes[1],t)],eyeAlpha:w(e.eyeAlpha,n.eyeAlpha,t),bodyAlpha:w(e.bodyAlpha,n.bodyAlpha,t),dots:[...e.dots.map(o=>({...o,opacity:o.opacity*i})),...n.dots.map(o=>({...o,opacity:o.opacity*t}))],arcs:[...e.arcs.map(o=>({...o,id:`a${o.id}`,opacity:o.opacity*i})),...n.arcs.map(o=>({...o,id:`b${o.id}`,opacity:o.opacity*t}))],notif:e.notif&&n.notif?{x:w(e.notif.x,n.notif.x,t),y:w(e.notif.y,n.notif.y,t),r:w(e.notif.r,n.notif.r,t),notch:w(e.notif.notch,n.notif.notch,t)}:n.notif?{...n.notif,r:n.notif.r*t,notch:n.notif.notch*t}:e.notif?{...e.notif,r:e.notif.r*i,notch:e.notif.notch*i}:null,dotsBehind:t<.5?e.dotsBehind:n.dotsBehind}}var Ge=class e{scale;cur;prev=null;departFige=null;tCur=0;tPrev=0;blinkAt=-10;pts=[];shape=null;shapePrev=null;shapeAt=-10;expr=null;exprPrev=null;exprAt=-10;look=dt;lookPrev=dt;lookAt=-10;lookMorph=.24;static SHAPE_MORPH=.45;static LOOK_MORPH=.24;constructor(n=100,t="idle",i=null,o=null){this.scale=n,this.cur=t,this.shape=i,this.expr=o}setExpression(n,t=0){n!==this.expr&&(this.exprPrev=this.expr,this.expr=n,this.exprAt=t)}exprAtTime(n){let t=this.expr,i=this.exprPrev;if(!t||!i)return t;let o=(n-this.exprAt)/e.SHAPE_MORPH;return o>=1?t:Ut(i,t,_.easeOutQuint(I(o)))}setShape(n,t=0){n!==this.shape&&(this.shapePrev=this.shape,this.shape=n,this.shapeAt=t)}shapeAtTime(n){let t=this.shape,i=this.shapePrev;if(!t||!i)return t;let o=(n-this.shapeAt)/e.SHAPE_MORPH;if(o>=1)return t;let s=_.easeOutQuint(I(o));return t.map((r,a)=>w(i[a]??r,r,s))}setLook(n,t,i=e.LOOK_MORPH){n&&!Number.isFinite(n.yaw+n.pitch+n.mix+n.spin+n.wander)||(this.lookPrev=this.lookAtTime(t),this.look=n??dt,this.lookAt=t,this.lookMorph=i)}lookAtTime(n){let t=(n-this.lookAt)/this.lookMorph;return t>=1?this.look:bo(this.lookPrev,this.look,_.easeOutQuint(I(t)))}posed(n,t,i,o){let s=n.pose(t);return n.baseBody&&i&&(s={...s,sil:{...s.sil,radii:i}}),n.baseFace&&o&&(s={...s,gaze:o.gaze,split:o.split,eyes:o.eyes}),s}decalageAtTime(n,t){let i=(s,r,a,c)=>{if(a===c)return c;let u=(n-s)/r;if(u>=1)return c;let l=_.easeOutQuint(I(u));return{x:w(a.x,c.x,l),y:w(a.y,c.y,l)}},o=s=>i(this.exprAt,e.SHAPE_MORPH,ht(s,t,this.exprPrev?.id??null),ht(s,t,this.expr?.id??null));return i(this.shapeAt,e.SHAPE_MORPH,o(this.shapePrev),o(this.shape))}get state(){return this.cur}reset(n,t){this.cur=n,this.prev=null,this.departFige=null,this.tCur=t,this.tPrev=t,this.blinkAt=-10}origine(n,t,i){if(this.departFige)return this.departFige;if(!this.prev)return null;let o=Z.get(this.prev);return this.posed(o,Math.max(0,n-this.tPrev),t,i)}poseComposee(n){let t=Z.get(this.cur),i=this.shapeAtTime(n),o=this.exprAtTime(n),s=this.posed(t,Math.max(0,n-this.tCur),i,o),r=n-this.tCur;if(r>=t.morph)return s;let a=this.origine(n,i,o);return a?cn(a,s,_.easeOutQuint(I(r/t.morph))):s}setState(n,t){if(n===this.cur)return;let i=Z.get(this.cur).morph,o=this.prev!==null&&t-this.tCur<i;this.departFige=o?this.poseComposee(t):null,this.prev=this.cur,this.tPrev=this.tCur,this.cur=n,this.tCur=t,Z.get(n)?.blinkIn&&(this.blinkAt=t)}sample(n){let t=this.scale,i=Z.get(this.cur),o=this.shapeAtTime(n),s=this.exprAtTime(n),r=this.posed(i,Math.max(0,n-this.tCur),o,s),a=this.decalageAtTime(n,this.cur),c=n-this.tCur,u=c<i.morph?this.origine(n,o,s):null;if(u){let O=_.easeOutQuint(I(c/i.morph));r=cn(u,r,O);let N=this.prev;if(N){let H=this.decalageAtTime(n,N);a={x:w(H.x,a.x,O),y:w(H.y,a.y,O)}}}let l=r.eyeAlpha>.01,p=this.lookAtTime(n),m=Le(n,{wander:l?p.wander:0,blink:l}),f={yaw:w(r.gaze.yaw,p.yaw,p.mix)+m.dYaw-p.spin,pitch:w(r.gaze.pitch,p.pitch,p.mix)+m.dPitch,roll:r.gaze.roll+m.dRoll},g=I((n-this.blinkAt)/.2),M=g<1?Math.abs(g*2-1):1,h=Math.min(m.lid,M),x=r.offX+m.driftX,y=r.offY+m.driftY,d={...r.sil,cx:r.sil.cx+x,cy:r.sil.cy+y,sy:r.sil.sy*m.breath},v=qt(Ie(d,t,this.pts)),k=(O,N)=>ze(r.sil.radii,Math.atan2(N,O)-r.sil.rot),R=[];if(r.eyeAlpha>.01){let O=Be(f,t,r.split);for(let N=0;N<2;N++){let H=O[N];if(H.depth<=.02)continue;let q=r.eyes[N],J=k(H.x,H.y),de=(q.tilt??0)*Math.PI/180,D=Math.cos(de),ee=Math.sin(de),me=H.a*D+H.c*ee,j=H.b*D+H.d*ee,te=-H.a*ee+H.c*D,fe=-H.b*ee+H.d*D,xe=Xt(Math.min(h,q.open));R.push({width:q.w*t,height:q.h*t,openMatrix:`matrix(${b(me)},${b(j)},${b(te)},${b(fe)},${b(H.x*J+(x+a.x)*t)},${b(H.y*J+(y+a.y)*t)})`,lid:Math.min(h,q.open),d:jt(q.w*t,q.h*t),matrix:`matrix(${b(me)},${b(j*xe)},${b(te)},${b(fe*xe)},${b(H.x*J+(x+a.x)*t)},${b(H.y*J+(y+a.y)*t)})`,alpha:r.eyeAlpha*I(H.depth/.12)})}}let A=r.dots.filter(O=>O.opacity>.01&&O.r>5e-4).map(O=>({...O,x:(O.x+x)*t,y:(O.y+y)*t,r:O.r*t})),B=r.notif?k(r.notif.x,r.notif.y):1,S=r.notif?(r.notif.x*B+x)*t:0,F=r.notif?(r.notif.y*B+y)*t:0,Y=r.notif?{x:S,y:F,r:r.notif.r*t}:null,T=r.notif?{x:S,y:F,r:r.notif.notch*t}:null;return{bodyPath:v,bodyAlpha:r.bodyAlpha,eyes:R,dots:A,dotsBehind:r.dotsBehind,arcs:r.arcs.filter(O=>O.opacity>.01).map(O=>Rt(O.seed,O.t,t,O.id,O.opacity)),notif:Y,notch:T}}};var ke=new WeakMap;function un(e,n){let t=e.defaultView;if(e.body===void 0||t===null||typeof t.MutationObserver!="function")return()=>{};let i=ke.get(e);if(i===void 0){let s=new Set,r={listeners:s,queued:!1,records:[]},a=()=>{if(r.queued=!1,delete r.frame,ke.get(e)!==r)return;let c=r.records;r.records=[];for(let u of[...s])try{u(c)}catch(l){t.setTimeout(()=>{throw l},0)}};r.observer=new t.MutationObserver((c=[])=>{r.records.push(...c),!r.queued&&(r.queued=!0,typeof t.requestAnimationFrame=="function"?r.frame=t.requestAnimationFrame(a):queueMicrotask(a))}),r.observer.observe(e.body,{childList:!0,subtree:!0}),ke.set(e,r),i=r}i.listeners.add(n);let o=!0;return()=>{if(!o)return;o=!1;let s=ke.get(e);s!==void 0&&(s.listeners.delete(n),!(s.listeners.size>0)&&(s.observer?.disconnect(),s.frame!==void 0&&t.cancelAnimationFrame(s.frame),ke.delete(e)))}}var mt="[data-slot='sidebar']",Pe={sidebar:mt,sidebarShell:`#root ${mt} > div`,sidebarColumn:`#root :has(> ${mt})`,composerCard:"#root [data-composer-card='true']",composerHeroMark:"#root .xiaohei-brand-mark[data-brand-context='hero']",composerHeroRow:"[class*='_headline']"};var Ue=De(2.2,1,.89).map((e,n,t)=>{let i=n/t.length*Math.PI*2,o=(s,r,a)=>{let c=Math.atan2(Math.sin(i-s),Math.cos(i-s));return a*Math.exp(-.5*(c/r)**2)};return e*(1+.016*Math.sin(i))+o(6.12,.12,.065)+o(3.3,.12,.065)+o(4.04,.1,.025)}),hn={id:"neutre",gaze:{yaw:0,pitch:-7,roll:-2},split:26,eyes:[{w:.355,h:.48,open:1},{w:.34,h:.465,open:1}]},ft=Math.max(...Ue.map((e,n)=>e*Math.sin(n/Ue.length*Math.PI*2)))*100,ue={x:0,y:0,sx:1,sy:1,roll:0,lid:1,cheer:0},Ve=["greet","hop","wiggle"],ln=e=>{let n=Math.max(0,Math.min(1,e));return n*n*(3-2*n)},yo=e=>({...ue,...e}),go=Object.keys(ue);function pn(e,n,t){if(n===0||n===e.length-1)return 0;let i=e[n-1],o=e[n],s=e[n+1],r=o.at-i.at,a=s.at-o.at,c=(o.pose[t]-i.pose[t])/r,u=(s.pose[t]-o.pose[t])/a;if(c*u<=0)return 0;let l=2*a+r,p=a+2*r;return(l+p)/(l/c+p/u)}var Ye=class{start=0;keys=[];hover=0;hoverAt=0;hoverFrom=0;hoverTo=0;get end(){return this.start+(this.keys.at(-1)?.at??0)}reset(){this.keys=[],this.hover=this.hoverFrom=this.hoverTo=0}settle(n){let t=this.track(n);this.start=n,this.keys=[{at:0,pose:t},{at:.22,pose:{...ue}}],this.aim(0,n)}aim(n,t){this.hover=this.hoverFrom+(this.hoverTo-this.hoverFrom)*ln((t-this.hoverAt)/.28),this.hoverFrom=this.hover,this.hoverTo=Math.max(-1,Math.min(1,n)),this.hoverAt=t}track(n){if(!this.keys.length||n>=this.end)return{...ue};let t=Math.max(0,n-this.start),i=this.keys[0];for(let o=1;o<this.keys.length;o++){let s=this.keys[o];if(t<=s.at){let r=s.at-i.at,a=(t-i.at)/r,c=a*a,u=c*a,l={...i.pose};for(let p of go)l[p]=(2*u-3*c+1)*i.pose[p]+(-2*u+3*c)*s.pose[p]+(u-2*c+a)*r*pn(this.keys,o-1,p)+(u-c)*r*pn(this.keys,o,p);return l}i=s}return{...ue}}play(n,t,i=1){let o=this.track(t),s=i<0?-1:1,r=[{at:0,pose:o}],a=(c,u)=>r.push({at:c,pose:yo(u)});n==="greet"?(a(.09,{lid:.25,sy:.99,cheer:.35}),a(.16,{lid:0,sy:.985,cheer:.35,roll:-2*s}),a(.26,{y:-2,sy:1.005,roll:1*s}),a(.43,{y:-7,sx:.99,sy:1.015,roll:3*s}),a(.67,{sx:1.018,sy:.982,roll:-1*s}),a(.95,{})):n==="hop"?(a(.12,{sx:1.065,sy:.94,lid:.85,roll:-2*s}),a(.23,{sx:.97,sy:1.045,y:-14,roll:2*s}),a(.4,{sx:.99,sy:1.02,y:-28,roll:3*s}),a(.57,{sy:1.015,y:-14,roll:1*s}),a(.69,{sx:1.06,sy:.94,lid:.55,cheer:.3}),a(.8,{sx:.985,sy:1.02}),a(1.02,{})):(a(.18,{x:-2*s,roll:-7*s}),a(.38,{x:2*s,roll:7*s}),a(.55,{x:-1*s,roll:-3*s,lid:.3,cheer:.2}),a(.64,{roll:-1*s,lid:0,cheer:.2}),a(.78,{}),a(.96,{})),this.start=t,this.keys=r}sample(n){let t=this.track(n);return this.hover=this.hoverFrom+(this.hoverTo-this.hoverFrom)*ln((n-this.hoverAt)/.28),t.roll+=this.hover*5,t.x+=this.hover*4,t}};var Eo="http://www.w3.org/2000/svg";function dn(e,n,t,i,o,s){let r=h=>e.createElementNS(Eo,h),a=(h,x)=>{for(let[y,d]of Object.entries(x)){let v=String(d);h.getAttribute(y)!==v&&h.setAttribute(y,v)}},c=r("g"),u=r("g");i.append(c),o.append(u);let l=r("mask"),p=r("rect"),m=r("circle"),f=r("circle");a(l,{id:`${n}-notification`,maskUnits:"userSpaceOnUse",x:-200,y:-200,width:400,height:400,"mask-type":"luminance"}),a(p,{x:-200,y:-200,width:400,height:400,fill:"white"}),a(m,{fill:"black",r:0,"data-heixiu-notch":""}),a(f,{fill:"#dca964",display:"none","data-heixiu-notification":""}),l.append(p,m),t.append(l),o.append(f);let g=Array.from({length:12},()=>{let h=r("path");return a(h,{display:"none","data-heixiu-particle":""}),u.append(h),h}),M=Array.from({length:12},(h,x)=>{let y=r("linearGradient"),d=r("path"),v=r("path");a(y,{id:`${n}-arc-${x}`,gradientUnits:"userSpaceOnUse"});let k=Array.from({length:3},()=>r("stop"));y.append(...k),t.append(y);for(let R of[d,v])a(R,{fill:"none","stroke-linecap":"round",stroke:`url(#${n}-arc-${x})`,display:"none","data-heixiu-orbit":""});return i.append(d),o.append(v),{gradient:y,back:d,fore:v,stops:k}});return h=>{h.notif&&h.notch?(a(s,{mask:`url(#${n}-notification)`}),a(m,{cx:h.notch.x,cy:h.notch.y,r:h.notch.r}),a(f,{display:"inline",cx:h.notif.x,cy:h.notif.y,r:h.notif.r})):(s.getAttribute("mask")&&s.removeAttribute("mask"),a(m,{r:0}),a(f,{display:"none"}));for(let[x,y]of g.entries()){let d=h.dots[x];if(!d){a(y,{display:"none"});continue}let v=h.dotsBehind?c:u;y.parentNode!==v&&v.append(y);let k=d.r;a(y,{display:"inline",d:d.d??`M${-k} 0a${k} ${k} 0 1 0 ${k*2} 0a${k} ${k} 0 1 0 ${-k*2} 0`,transform:`translate(${d.x} ${d.y}) rotate(${d.rot??0}) scale(${d.d?100:1})`,fill:d.color??"var(--heixiu-ink)",opacity:d.opacity*(d.depth??1)})}for(let[x,y]of M.entries()){let d=h.arcs[x];if(!d){a(y.back,{display:"none"}),a(y.fore,{display:"none"});continue}a(y.gradient,{x1:d.grad.x1,y1:d.grad.y1,x2:d.grad.x2,y2:d.grad.y2});for(let[v,k]of y.stops.entries())a(k,{offset:v/2,"stop-color":d.grad.stops[Math.min(v,d.grad.stops.length-1)]??"#ddd"});for(let[v,k]of[[y.back,d.back],[y.fore,d.front]])a(v,{display:"inline",d:k,"stroke-width":d.width,opacity:d.opacity})}}}var Mo="http://www.w3.org/2000/svg",wo=0;function mn(e,n){let t=Math.max(0,Math.min(1,(e-20)/12));return{rx:Math.max(.01,Math.min(e,38)*(1+.15*t)),ry:Math.max(.01,Math.min(n,62)*.96)}}function vo(e){if(e.length!==2)return 1;let n=e.map(l=>l.openMatrix.slice(7,-1).split(/[ ,]+/).map(Number)),[t,i]=n;if(!t||!i||t.length!==6||i.length!==6||[...t,...i].some(l=>!Number.isFinite(l)))return 1;let o=i[4]-t[4],s=i[5]-t[5],r=Math.hypot(o,s);if(r<1)return .1;let a=o/r,c=s/r,u=e.reduce((l,p,m)=>{let f=n[m],{rx:g,ry:M}=mn(p.width,p.height);return l+Math.hypot(g*(f[0]*a+f[1]*c),M*(f[2]*a+f[3]*c))},0);return Math.min(1,Math.max(.1,(r-10)/Math.max(1,u)))}function fn(e){let n=h=>e.createElementNS(Mo,h),t=(h,x)=>{for(let[y,d]of Object.entries(x)){let v=String(d);h.getAttribute(y)!==v&&h.setAttribute(y,v)}},i=n("svg"),o=n("defs"),s=n("clipPath"),r=n("path"),a=`xiaohei-bloub-${++wo}`;t(i,{viewBox:`${-158} ${-158} ${316} ${316}`,"aria-hidden":"true",focusable:"false"}),t(s,{id:`${a}-body`,clipPathUnits:"userSpaceOnUse"}),s.append(r),o.append(s);let c=n("g"),u=n("path"),l=n("g");t(u,{fill:"var(--heixiu-ink)",stroke:"var(--heixiu-outline)","stroke-width":1.2,"data-heixiu-body":""}),t(l,{"clip-path":`url(#${a}-body)`,fill:"none",stroke:"#f5f3db","stroke-width":10.5});let p=[n("path"),n("path")];for(let h of p)t(h,{"data-heixiu-eye":"","stroke-linecap":"round","stroke-linejoin":"round"});l.append(...p),c.append(u,l);let m=n("g");t(m,{"data-heixiu-character":""}),m.append(c),i.append(o,m);let f;function g(){if(f)return;let h=n("g"),x=n("g");m.insertBefore(h,c),m.append(x),f=dn(e,a,o,h,x,c)}function M(h,x=ue){t(m,{transform:`translate(${x.x} ${x.y+ft}) rotate(${x.roll}) scale(${x.sx} ${x.sy}) translate(0 ${-ft})`}),t(u,{d:h.bodyPath}),t(r,{d:h.bodyPath}),t(c,{opacity:h.bodyAlpha});let y=vo(h.eyes);for(let[d,v]of p.entries()){let k=h.eyes[d];if(!k){t(v,{opacity:0});continue}let R=mn(k.width,k.height),A=R.rx*y,B=R.ry*y,S=Math.max(0,Math.min(k.lid,x.lid)),F=-A*.26*x.cheer*(1-S),Y=F-B*S*1.3333,T=F+B*S*1.3333,O=`M${-A} 0C${-A} ${Y} ${A} ${Y} ${A} 0C${A} ${T} ${-A} ${T} ${-A} 0Z`;t(v,{d:O,transform:k.openMatrix,opacity:k.alpha,"stroke-width":Math.min(10.5,A*.28)})}f?.(h)}return{svg:i,render:M,prepareEffects:g}}function xn(e,n,t){let i=t>760&&e-n>=114;return{mode:i?"outside":"compact",size:i?96:52}}function bn(e,n,t,i){if(e.width<=0||e.height<=0||e.top+e.height>n.top)return;let o=i<=760?52:96,s=Math.max(t+6,e.left-o-(o===52?10:24));return{size:o,left:s-n.left,top:e.top+e.height/2-o/2-n.top}}function yn(e,n,t,i){let o=i?.size??t.size;return i?{left:e.left+n.left+i.left,top:e.top+n.top+i.top,width:o,height:o}:t.mode==="compact"?{left:e.left+n.left+4,top:e.top+n.top+6,width:o,height:o}:{left:e.left+n.left-18-o,top:e.top+e.height/2-o/2,width:o,height:o}}function gn(e,n){return!Number.isFinite(e)||!Number.isFinite(n)?{yaw:0,pitch:-7,mix:1,spin:0,wander:.35}:{yaw:Math.max(-14,Math.min(14,e/16)),pitch:-7-Math.max(-31,Math.min(9,n/16)),mix:1,spin:0,wander:0}}function En(e,n,t){if(!Number.isFinite(e)||!Number.isFinite(n))return{x:0,y:0};let i=Math.hypot(e,n),o=t?90:140;if(i>=o)return{x:0,y:0};let s=Math.max(0,Math.min(1,(i-o*.5)/(o*.5))),r=1-s*s*(3-2*s),a=Math.max(t?32:50,i);return{x:e/a*(t?2:5)*r,y:n/a*(t?1.5:3.5)*r}}var Mn=e=>({left:e.left,top:e.top,width:e.width,height:e.height});function wn(e){let n,t,i=()=>n?.playState==="running",o=()=>Math.max(0,Math.min(1,n?.effect?.getComputedTiming().progress??0)),s=(c,u)=>["left","top","width","height"].every(l=>Math.abs(c[l]-u[l])<1);function r(c){if(!i()||!t)return c;let u=o(),l=p=>t.from[p]+(t.to[p]-t.from[p])*u;return{left:l("left"),top:l("top"),width:l("width"),height:l("height")}}function a(){n&&(n.onfinish=null,n.cancel(),n=void 0),t=void 0,e.dataset.flying="false"}return{get active(){return i()},capture:r,target(c){if(!i()||!t)return c;let u=o(),{from:l,to:p}=t,m=l.width/p.width*(1-u)+u,f=c.width/m,g=c.height/m,M=(l.left+l.width/2-p.left-p.width/2)*(1-u),h=(l.top+l.height/2-p.top-p.height/2)*(1-u);return{left:c.left-M+(c.width-f)/2,top:c.top-h+(c.height-g)/2,width:f,height:g}},move(c,u,l){if(!l&&i()&&t&&s(t.to,u))return;let p=i()&&t?Math.max(80,t.duration-Number(n.currentTime??0)):950;if(a(),!c||l||typeof e.animate!="function"||!c.width||!u.width)return;let m=c.left+c.width/2-u.left-u.width/2,f=c.top+c.height/2-u.top-u.height/2;if(Math.hypot(m,f)<4&&Math.abs(c.width-u.width)<1)return;t={from:Mn(c),to:Mn(u),duration:p},n=e.animate([{transform:`translate(${m}px, ${f}px) scale(${c.width/u.width})`},{transform:"translate(0px, 0px) scale(1)"}],{duration:p,easing:"cubic-bezier(.22,.75,.2,1)"}),e.dataset.flying="true";let g=n;g.onfinish=()=>{n===g&&a()}},cancel:a}}var vn=e=>Number.isFinite(e)?Math.max(0,Math.min(.999999,e)):.5;function Sn(e=Math.random){return 2e4+Math.floor(vn(e())*2e4)}function In(e,n,t=Math.random){if(e<=1)return 0;let i=n>=0&&n<e,o=Math.floor(vn(t())*(i?e-1:e));return i&&o>=n?o+1:o}var kn=`
3
+ #root [data-composer-card] > button.xiaohei-bloub {
4
+ all: unset;
5
+ --heixiu-ink: #111214;
6
+ --heixiu-outline: rgba(245,243,215,.16);
7
+ position: absolute;
8
+ box-sizing: border-box;
9
+ display: block;
10
+ width: 96px;
11
+ height: 96px;
12
+ min-width: 44px;
13
+ min-height: 44px;
14
+ right: calc(100% + 18px);
15
+ top: calc(50% - 48px);
16
+ margin: 0 !important;
17
+ padding: 0 !important;
18
+ border: 0 !important;
19
+ border-radius: 50%;
20
+ background: none !important;
21
+ box-shadow: none !important;
22
+ color: inherit;
23
+ cursor: pointer;
24
+ touch-action: manipulation;
25
+ user-select: none;
26
+ -webkit-tap-highlight-color: transparent;
27
+ /* Flight owns this transform. A CSS transition would replay cancelled
28
+ WAAPI transforms and corrupt the next target measurement. */
29
+ transition: none;
30
+ z-index: 3;
31
+ }
32
+ #root [data-composer-card] > button.xiaohei-bloub:focus-visible {
33
+ outline: 2px solid var(--dsw-alias-label-secondary);
34
+ outline-offset: -7px;
35
+ }
36
+ #root [data-composer-card] > button.xiaohei-bloub > .xiaohei-bloub-drift {
37
+ display: block;
38
+ width: 100%; height: 100%;
39
+ pointer-events: none;
40
+ --heixiu-drift-x: 7px;
41
+ --heixiu-drift-y: 10px;
42
+ animation: xiaohei-bloub-float 14s cubic-bezier(.45,0,.55,1) infinite;
43
+ animation-play-state: paused;
44
+ }
45
+ #root [data-composer-card] > button.xiaohei-bloub[data-floating='true'] > .xiaohei-bloub-drift {
46
+ animation-play-state: running;
47
+ }
48
+ @keyframes xiaohei-bloub-float {
49
+ 0%, 100% { transform: translate(calc(-1 * var(--heixiu-drift-x)), var(--heixiu-drift-y)); }
50
+ 50% { transform: translate(var(--heixiu-drift-x), calc(-1 * var(--heixiu-drift-y))); }
51
+ }
52
+ #root [data-composer-card] > button.xiaohei-bloub > .xiaohei-bloub-drift > svg {
53
+ display: block;
54
+ width: 100%; height: 100%;
55
+ overflow: hidden;
56
+ pointer-events: none;
57
+ transform: translate(var(--heixiu-follow-x, 0px), var(--heixiu-follow-y, 0px));
58
+ transition: transform 480ms cubic-bezier(.2,.75,.25,1);
59
+ }
60
+ #root [data-composer-card] > button.xiaohei-bloub:active > .xiaohei-bloub-drift > svg {
61
+ transform: translate(var(--heixiu-follow-x, 0px), var(--heixiu-follow-y, 0px)) scale(.98);
62
+ }
63
+ #root [data-composer-card][data-heixiu-dock='compact'] {
64
+ padding-inline-start: 64px !important;
65
+ }
66
+ #root [data-composer-card][data-heixiu-dock='compact'] > button.xiaohei-bloub {
67
+ width: 52px; height: 52px;
68
+ right: auto; left: 4px; top: 6px;
69
+ }
70
+ #root [data-composer-card][data-heixiu-dock='compact'] .xiaohei-bloub-drift {
71
+ --heixiu-drift-x: 2px;
72
+ --heixiu-drift-y: 3px;
73
+ }
74
+ #root [data-composer-card][data-heixiu-dock='welcome'] > button.xiaohei-bloub {
75
+ right: auto;
76
+ left: var(--heixiu-welcome-left);
77
+ top: var(--heixiu-welcome-top);
78
+ width: var(--heixiu-welcome-size);
79
+ height: var(--heixiu-welcome-size);
80
+ }
81
+ @media (max-width: 760px) {
82
+ #root [data-heixiu-hero-row] { box-sizing: border-box; padding-inline-start: 64px; max-width: 100%; }
83
+ #root [data-composer-card][data-heixiu-dock='welcome'] .xiaohei-bloub-drift {
84
+ --heixiu-drift-x: 2px;
85
+ --heixiu-drift-y: 4px;
86
+ }
87
+ }
88
+ #root [data-composer-card] > button.xiaohei-bloub[hidden] { display: none; }
89
+ @media (prefers-reduced-motion: reduce) {
90
+ #root [data-composer-card] > button.xiaohei-bloub { transition: none; transform: none; }
91
+ #root [data-composer-card] > button.xiaohei-bloub > .xiaohei-bloub-drift { animation: none; transform: none; }
92
+ #root [data-composer-card] > button.xiaohei-bloub > .xiaohei-bloub-drift > svg { transition: none; transform: none; }
93
+ }
94
+ @media print {
95
+ #root [data-composer-card] > button.xiaohei-bloub { display: none; }
96
+ #root [data-composer-card][data-heixiu-dock='compact'] { padding-inline-start: 12px !important; }
97
+ }
98
+ `;var Pn=["burst","egg","orbit","hexagon","wink","wide","exclaim","alert","sleep","thinking","notify"],xt=["burst","egg","orbit","hexagon","wink","wide","sleep"];function An(e=typeof document>"u"?void 0:document,n){let t=e?.defaultView;if(!e||!t)return()=>{};let i=e.createElement("style");i.textContent=kn,e.head.append(i);let o=e.createElement("button");o.className="xiaohei-bloub",o.type="button",o.setAttribute("aria-label","\u9017\u9017\u563F\u54BB"),o.title="\u5355\u51FB\u9017\u9017\u563F\u54BB \xB7 \u53CC\u51FB\u8F6E\u6362\u53D8\u5F62\uFF08\u952E\u76D8 Shift+Enter\uFF09";let s=fn(e),r=e.createElement("span");r.className="xiaohei-bloub-drift",r.append(s.svg),o.append(r);let a=wn(o),c=new Ge(100,"idle",Ue,hn),u=new Ye,l={yaw:0,pitch:-7,mix:1,spin:0,wander:.35},p=l;c.setLook(l,0),s.render(c.sample(0));let m=!1,f=!1,g=!0,M=null,h=null,x=null,y=null,d,v,k,R,A,B=-1/0,S=0,F,Y=2.5,T=0,O=0,N=1,H=!1,q=0,J="",de="",D,ee=-1,me=-1/0,j=n?.getSnapshot(),te,fe=t.innerWidth,xe=t.innerHeight,be=t.matchMedia("(prefers-reduced-motion: reduce)"),le=typeof t.ResizeObserver=="function"?new t.ResizeObserver(()=>{g=!0,ye()}):void 0,bt=typeof t.IntersectionObserver=="function"?new t.IntersectionObserver(E=>{let P=E.find(L=>L.target===o);P&&(f=P.isIntersecting,pe())}):void 0;function Ae(){o.dataset.floating="false",He(0,0),D!==void 0&&t.clearTimeout(D),D=void 0,a.cancel(),k!==void 0&&t.cancelAnimationFrame(k),A!==void 0&&t.clearTimeout(A),R!==void 0&&t.clearTimeout(R),k=void 0,A=void 0,R=void 0,F=void 0}function He(E,P){let L=En(E,P,t.innerWidth<=760||M?.dataset.heixiuDock==="compact"),G=`${L.x.toFixed(3)}px`,ie=`${L.y.toFixed(3)}px`;G!==J&&(o.style.setProperty("--heixiu-follow-x",G),J=G),ie!==de&&(o.style.setProperty("--heixiu-follow-y",ie),de=ie)}function X(){return!m&&f&&!!M?.isConnected&&!e.hidden&&!be.matches}function Oe(E=Sn()){D!==void 0&&t.clearTimeout(D),D=void 0,X()&&(D=t.setTimeout(()=>{if(D=void 0,!!X()){if(T||j?.running||a.active||Date.now()-me<5e3){Oe(5e3);return}oe(xt[In(xt.length,ee)],"ambient")}},E))}function ne(E){Y=Math.max(Y,S+E),!(!X()||k!==void 0||A!==void 0)&&(R!==void 0&&t.clearTimeout(R),R=void 0,F=void 0,k=t.requestAnimationFrame(yt))}function yt(E){if(k=void 0,!X()){Ae();return}F!==void 0&&(S+=Math.min(.05,Math.max(0,(E-F)/1e3))),F=E,T&&S>=T&&(H=!1,c.setLook(p,S),T=0,c.setState("idle",S),o.dataset.action="idle",Y=Math.max(Y,S+.65),j?.running&&oe("thinking","session",!0)),s.render(c.sample(S),u.sample(S)),S<Y||T||Le(S).lid<.99?A=t.setTimeout(()=>{A=void 0,X()&&(k=t.requestAnimationFrame(yt))},1e3/30):(F=void 0,R=t.setTimeout(()=>{R=void 0,ne(1)},8e3))}function pe(){X()?(o.dataset.floating="true",ne(1),j?.running&&!T&&oe("thinking","session",!0),D===void 0&&Oe()):(Ae(),be.matches&&(c.reset("idle",S),c.setLook(l,S,.001),T=0,H=!1,u.reset(),S+=1,s.render(c.sample(S)),o.dataset.action="idle"))}function Hn(){if(v=void 0,m)return;let E=e.querySelector(Pe.composerCard),P=e.querySelector(Pe.sidebarShell),L=e.querySelector(Pe.composerHeroMark),G=!1;if((M!==E||h!==P||x!==L)&&(M?.removeAttribute("data-heixiu-dock"),le?.disconnect(),y?.removeAttribute("data-heixiu-hero-row"),M=E,h=P,x=L,g=!0,y=x?.closest(Pe.composerHeroRow)??null,y?.setAttribute("data-heixiu-hero-row",""),M&&le?.observe(M),h&&le?.observe(h),x&&le?.observe(x),y&&le?.observe(y),G=!0),!M){o.remove(),f=!1,Ae();return}if(o.parentElement!==M||M.lastElementChild===o){let Qe=[...M.children].reverse().find(Ze=>Ze!==o);o.hidden=!0,M.insertBefore(o,Qe??null),bt?.observe(o),g=!0,G=!0}if(G){ye();return}if(!g)return;g=!1;let ie=a.active,Tn=fe!==t.innerWidth||xe!==t.innerHeight,$n=a.capture(d),ge=M.getBoundingClientRect(),Bn={left:M.clientLeft||0,top:M.clientTop||0},St=h?.getBoundingClientRect().right??0,It=xn(ge.left,St,t.innerWidth),kt=x?.getBoundingClientRect(),Re=kt&&bn(kt,ge,St,t.innerWidth),Ln=yn(ge,Bn,It,Re||void 0);if(He(0,0),Re)for(let[Qe,Ze]of Object.entries(Re)){let Pt=`--heixiu-welcome-${Qe}`,At=`${Ze}px`;o.style.getPropertyValue(Pt)!==At&&o.style.setProperty(Pt,At)}let Ee=Re?"welcome":It.mode,_n=!Tn&&(ie||!!te&&te!==Ee&&(te==="welcome"||Ee==="welcome"));te=Ee,fe=t.innerWidth,xe=t.innerHeight,M.dataset.heixiuDock!==Ee&&(M.dataset.heixiuDock=Ee),d=Ln,o.hidden=!1,f=ge.width>0&&ge.height>0&&d.top+d.height>0&&d.top<t.innerHeight,pe(),X()&&_n?a.move($n,d,be.matches):a.cancel()}function ye(){m||v!==void 0||(v=t.requestAnimationFrame(Hn))}let gt=E=>{if(!X()||a.active||!d?.width)return;if(E.pointerType==="touch"){We();return}if(E.timeStamp-B<1e3/30)return;B=E.timeStamp;let P=E.clientX-(d.left+d.width/2),L=E.clientY-(d.top+d.height/2);He(P,L),p=gn(P,L),!H&&(N=P<0?-1:1,u.aim(Math.abs(P)<90&&Math.abs(L)<90?P/60:0,S),c.setLook(p,S),ne(.8))},We=()=>{He(0,0),p=l,X()&&!H&&(u.aim(0,S),c.setLook(l,S),ne(.8))},Et=E=>{if(E.stopPropagation(),!X()||E.detail>1||H&&E.detail>0)return;let P=O++%(Ve.length+1);if(P===Ve.length){oe("exclaim","manual");return}let L=Ve[P];H=!1,c.setState("idle",S),c.setLook(p,S),u.play(L,S,N),o.dataset.action=L,o.dataset.actionSource="manual",Oe(),T=u.end,ne(T-S+.65)};function oe(E,P,L=!1){let G=Z.get(E);s.prepareEffects(),u.settle(S),H=!0,c.setLook(null,S),c.setState(E,S),o.dataset.action=E,ee=xt.findIndex(ie=>ie===E),o.dataset.actionSource=P,T=L?1/0:S+Math.max(G.duration,G.minDuration??0),ne(Math.max(G.duration,G.minDuration??0)+.65),Oe()}let Ke=E=>{E.stopPropagation(),X()&&oe(Pn[q++%Pn.length],"manual")},Mt=E=>{E.key==="Enter"&&E.shiftKey&&(E.preventDefault(),E.repeat||Ke(E))},je=()=>{g=!0,ye()},wt=E=>{M?.contains(E.target)&&(me=Date.now())},On=n?.subscribe(()=>{let E=n.getSnapshot(),P=E.sessionId!==j?.sessionId;if(j=E,o.dataset.sessionState=E.running?"running":"idle",!X()){(T===1/0||o.dataset.actionSource==="session"||P)&&(T=0,H=!1,c.setState("idle",S),c.setLook(p,S),o.dataset.action="idle");return}(P||T===1/0&&!E.running)&&(T=0,H=!1,c.setState("idle",S),c.setLook(p,S),o.dataset.action="idle",ne(.65)),!P&&E.notice?oe(E.notice,"session"):E.running&&(!T||o.dataset.actionSource!=="session")&&oe("thinking","session",!0)})??(()=>{}),Rn=un(e,E=>{E.length&&E.every(P=>(P.target.nodeType===1?P.target:P.target.parentElement)?.closest("[data-chat-flow], .xiaohei-bloub"))||ye()}),vt=E=>{let P=E.target;(P===e||P===t||P instanceof t.Element&&(P.contains(M)||P.contains(h)))&&je()};return e.addEventListener("pointermove",gt,{passive:!0}),e.addEventListener("pointerleave",We),e.addEventListener("visibilitychange",pe),e.addEventListener("input",wt,{passive:!0}),o.addEventListener("click",Et),o.addEventListener("dblclick",Ke),o.addEventListener("keydown",Mt),t.addEventListener("resize",je,{passive:!0}),t.addEventListener("scroll",vt,{passive:!0,capture:!0}),be.addEventListener("change",pe),ye(),()=>{m=!0,Ae(),Rn(),On(),le?.disconnect(),bt?.disconnect(),v!==void 0&&t.cancelAnimationFrame(v),e.removeEventListener("pointermove",gt),e.removeEventListener("pointerleave",We),e.removeEventListener("visibilitychange",pe),o.removeEventListener("click",Et),e.removeEventListener("input",wt),o.removeEventListener("dblclick",Ke),o.removeEventListener("keydown",Mt),t.removeEventListener("resize",je),t.removeEventListener("scroll",vt,!0),be.removeEventListener("change",pe),y?.removeAttribute("data-heixiu-hero-row"),M?.removeAttribute("data-heixiu-dock"),o.remove(),i.remove()}}
99
+ return module.exports; } });
100
+ //# sourceMappingURL=client.companion.js.map