@v587d/capital-generation 2.27.0 → 2.27.2

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/CHANGELOG.md CHANGED
@@ -7,6 +7,41 @@
7
7
  - **第三位(patch)**:不破坏既有工具 / 配置 / 会话的新增与修复(如 2.1.1、2.1.2)。
8
8
  - **第二位(minor)**:有需要用户知晓的行为变更,且段内附迁移说明(如 2.1.0 的图表呈现通道重做、2.2.0 的数据源与检索来源扩容、2.4.0 的**必须换宿主版本**、2.9.0 的选择器收敛与质检前置——本插件自己的工具与数据契约没变,所以只抬第二位)。
9
9
 
10
+ ## [2.27.2] - 2026-11-19
11
+
12
+ 「自选股」行情工作台的详情头瘦身:标题行只留标题与一个信息键,重复的事实删掉、参考读数收起来。
13
+
14
+ ### Changed
15
+
16
+ - **六个会话读数收进「分时」旁的 ⓘ**:今开 / 最高 / 最低 / 均价 / 成交量 / 成交额原来铺在分时标题行上,现在收在一张悬停卡片里(鼠标移上去或键盘聚焦展开,点一下钉住,触摸端也能开;Esc 与指针移出收起)。卡片是 2×3 的读数格,标签在上、数值在下,等宽数字;同样的六项也写在按钮的 `aria-label` 上,读屏不丢。
17
+ - **分时标题行只剩「分时 ⓘ」**:右侧的「2026-11-19 收盘」与「收起」都去掉。会话状态没有丢——它跟着六项读数进了信息卡的第一行;折叠功能整条下线(随之删掉 `trendFolded` 状态、`.cwd-folded` / `.cwd-blockfold` 样式与「收起 / 展开」两套文案),两块图仍按 `flex: 1 1 0` 平分详情列高度。
18
+
19
+ ### Removed
20
+
21
+ - **详情头里的「标的类型」一格**:行上的类型标签(`A股` / `美股`)已经说了这件事,详情头再写一遍只是重复;meta 区只剩「行情时间」一格,它本来就说明"上面的价格是什么时候印出来的"。
22
+
23
+ ### Notes
24
+
25
+ - 五个包版本同步抬到 `2.27.2`;`LOCAL_FETCH_CLIENT_VERSION` 与 `WIND_CLIENT_VERSION` 随版本号更新。用户侧无需迁移,纯前端改动(刷新页面即生效)。
26
+ - 回归:`⛔ 分时标题行只留标题与信息键`(标题行不许再有会话状态与收起键、状态进卡片首行、六项读数齐、折叠态不再存在)、`⛔ 统计收进信息键`(悬停 / 聚焦 / 钉住三条 CSS 揭示规则 + `aria-label` 六字段 + 点击后 `aria-expanded`),以及 meta 只剩「行情时间」的断言。详见 `docs/design/watchlist-intraday-v0.1.md` §11.8。
27
+
28
+ ## [2.27.1] - 2026-11-18
29
+
30
+ 修掉「分时」块在收盘后必现的加载失败,以及失败态里那个看不出是按钮的「重试」。
31
+
32
+ ### Fixed
33
+
34
+ - **盘后一次"重述"把整块分时判死**:腾讯收盘后会补一根把当日成交额改低的收尾行(300803.SZ:15:29 那行比 15:28 少 263,680.82 元,成交量不变),而分时解析是**先**做"累计量不许倒退"的护栏、**再**按 15:00 截掉盘后行——护栏于是在一根永远不会上图的盘后行上抛错,整块图被判成坏数据。现在先截断再判断;累计量回退当作上游重述(语义是"这一分钟没有新成交"),delta 归零、累计取高水位继续累加;只剩**时间倒流**仍响亮失败(那才会让横轴回头)。
35
+ - **失败原因不再被吞掉**:面板此前只留宿主回执里的 `code`,`message`("上游没有及时回话"一类)在客户端被丢弃,用户只能看到一句「分时加载失败」。现在 `message` 随失败一起进状态,显示在标题下面;同一套失败态给「日K」复用。
36
+ - **「重试」改成真按钮**:原来用的 `.cwd-pill` 背景色与它所在空态盒同色,在 300px 高的虚线框里就是一段可点的文字。新 `.cwd-retry` 与右上角「刷新行情」同一套配方(34px 高 / 10px 圆角 / 12.5px / 主色描边 + 刷新图标 / 悬停、按下与焦点环),空态盒也从虚线改实底。
37
+ - **上游故障不再冒充"该市场没有数据"**:三个分时入口全挂时原本返回 `trend_unavailable`,面板会显示"该市场暂时没有分时数据"的空态(没有重试键),把可恢复的上游故障说成市场能力缺失。现在区分成 `trend_upstream_unavailable` / `kline_upstream_unavailable`(可重试),`*_unavailable` 只留给真正没有该市场数据的情况(港美股指数、场外美股等);报文读不懂与连不上也各有各的码。
38
+
39
+ ### Notes
40
+
41
+ - 五个包版本同步抬到 `2.27.1`;`LOCAL_FETCH_CLIENT_VERSION` 与 `WIND_CLIENT_VERSION` 随版本号更新。用户侧无需迁移。
42
+ - 宿主新增一行失败日志:`capital-watchlist: <route> <标的> → <错误码>`(只记上游与存储故障,代码格式错误、已移出清单这类调用方问题不记)——面板只有一句话,排障靠它。**这一行要重启 dsh 才会出现**(宿主半边没有热更新);前端半边刷新页面即生效。
43
+ - 回归:`test/trend-fixtures.mjs` 收了 300803.SZ 那根收盘后报文的原文,解析护栏用例据此断言盘后行不上图、回退不产生负量、日总量取报价口径;另有「失败原因整条链路」(回执 message → 面板文案)与重试按钮 `type="button"` 的断言。详见 `docs/design/watchlist-intraday-v0.1.md` §11.7。
44
+
10
45
  ## [2.27.0] - 2026-11-18
11
46
 
12
47
  「自选股」行情工作台补上两张图:当日分时(价格、均价、昨收基准与成交量)和历史日 K(蜡烛、四条均线、成交量)。分时 A 股与港股走腾讯公开入口、美股走东财,日 K 三个市场都走腾讯(与 `get_kline` 同一套解析)。
package/README.md CHANGED
@@ -3,7 +3,7 @@
3
3
  <a href="LICENSE"><img src="https://img.shields.io/badge/License-MIT-green" alt="License"></a>
4
4
  <a href="https://github.com/v587d/capital-generation"><img src="https://img.shields.io/badge/Financial%20Market-CN%20%7C%20HK%20%7C%20US-orange" alt="Market·CN+HK+US"></a>
5
5
  <a href="https://github.com/deepseek-ai"><img src="https://img.shields.io/badge/DSH%20Baseline-0.2.2--rc.2-blue" alt="DSH@0.2.2-rc.2"></a>
6
- <a href="https://github.com/v587d/capital-generation/releases"><img src="https://img.shields.io/badge/version-2.27.0-9cf" alt="Version"></a>
6
+ <a href="https://github.com/v587d/capital-generation/releases"><img src="https://img.shields.io/badge/version-2.27.2-9cf" alt="Version"></a>
7
7
  <a href="https://www.npmjs.com/package/@v587d/capital-generation"><img src="https://img.shields.io/npm/v/%40v587d%2Fcapital-generation" alt="npm version"></a>
8
8
  </p>
9
9
 
@@ -191,7 +191,7 @@ Capital Generation 是运行在 [DeepSeek Harness(DSH)](https://github.com/d
191
191
  - **安装后找不到模式?** 确认插件出现在「插件」→ 已安装列表;Web / CLI profile 安装后要重启该 profile,并在新会话选择模式。选择器里应看到自动模式、行情专家、资讯专员;分析师和绘图专员是自动模式的内部角色,不会出现在这里。
192
192
  - **配置在哪?** 打开「插件」→ 已安装的 **Capital Generation**,插件介绍下方就是「数据源 / 投研自动化 / 精选 Skills / 包含的组件 / 分析环境」五格,五把密钥都在第一格;第二格可指定任务统一使用的默认工作区,也能改自动检查间隔与最长运行时间等上限;第五格准备 Python 分析环境;不在 DSH 的普通「设置」页面,也不用点进任何一行组件。保存密钥后新建会话再试。
193
193
  - **升级到 2.9.0 后,分析师和绘图专员去哪了?** 这一版把它们收进自动模式内部,不再出现在选择器与预设管理里,避免误开一个没有取数入口的空会话。旧会话仍能按原身份恢复;新任务直接用自动模式提出即可。
194
- - **桌面端升级后仍是旧版?** 桌面端安装时会固定所解析的版本,不会自动升级。卸载后重新安装,再到插件详情查看版本号;如需指定版本,可在地址末尾加 `#v2.27.0` 或 `@2.27.0`。
194
+ - **桌面端升级后仍是旧版?** 桌面端安装时会固定所解析的版本,不会自动升级。卸载后重新安装,再到插件详情查看版本号;如需指定版本,可在地址末尾加 `#v2.27.2` 或 `@2.27.2`。
195
195
  - **刚发布的新版本装不到?** 桌面端取包时会跳过**刚发布不久**的版本(宿主侧包管理器的发布冷却策略,实测会静默装成上一个版本),国内镜像的同步也可能滞后一段时间。急着用最新代码,改用仓库地址安装最直接;但仓库地址安装的是 git 依赖,插件页不显示「版本」检查。
196
196
  - **插件页的「版本」段怎么用?** 只有用包名从 npm 安装的版本才有;它只列比当前新的版本。回旧版要先卸载,再安装 `@v587d/capital-generation@版本号`(桌面端地址末尾加 `#v版本号`);旧版必须匹配当前 DSH 基线,对应关系见 [CHANGELOG 的 Migration](CHANGELOG.md)。
197
197
  - **网页抓取失败?** 配置卡片中的「允许启动本地提取网页内容」默认开启:AnySearch 提取失败时可尝试本机直连。关闭后,本机直连的具名来源查询也不可用;请检查该开关和网络连接。
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@v587d/capital-automation",
3
- "version": "2.27.0",
3
+ "version": "2.27.2",
4
4
  "description": "CapGen 投研自动化:独立 host bundle(固定 capital_automation 域、单 scheduler owner、/capital-automation 路由与浏览器页面)。",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@v587d/capital-charts",
3
- "version": "2.27.0",
3
+ "version": "2.27.2",
4
4
  "description": "自动模式的图表前端组件(浏览器半边 + 序列旁路路由):由 @v587d/capital-generation 随包携带并作为 host 平面行挂载。",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@v587d/config",
3
- "version": "2.27.0",
3
+ "version": "2.27.2",
4
4
  "description": "自动模式的取数凭据与偏好配置行:卡片坐在 @v587d/capital-generation 插件主页的「配置」段,点这一行本身没有表单。",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -211,8 +211,6 @@ async function fetchTencentTrend(target, signal, now) {
211
211
  const high = numberOrNull(qt[33]);
212
212
  const low = numberOrNull(qt[34]);
213
213
  const rows = [];
214
- let previousVolume = 0;
215
- let previousAmount = 0;
216
214
  for (const raw of series.data) {
217
215
  if (typeof raw !== 'string')
218
216
  throw sourceError(`Tencent minute trend ${symbol} row is not a string`, 'trend_parse_failed');
@@ -227,11 +225,6 @@ async function fetchTencentTrend(target, signal, now) {
227
225
  const cumAmount = requiredNumber(amountText, 'cumulative amount');
228
226
  if (price <= 0)
229
227
  throw sourceError(`Tencent minute trend ${symbol} returned a non-positive price at ${stamp}`, 'trend_parse_failed');
230
- if (cumVolume < previousVolume || cumAmount < previousAmount) {
231
- throw sourceError(`Tencent minute trend ${symbol} cumulative totals moved backwards at ${stamp}`, 'trend_parse_failed');
232
- }
233
- previousVolume = cumVolume;
234
- previousAmount = cumAmount;
235
228
  rows.push({ time: `${stamp.slice(0, 2)}:${stamp.slice(2)}`, price, cumVolume, cumAmount });
236
229
  }
237
230
  if (rows.length === 0)
@@ -252,11 +245,19 @@ async function fetchTencentTrend(target, signal, now) {
252
245
  const points = [];
253
246
  let previousKeptVolume = 0;
254
247
  let previousKeptAmount = 0;
248
+ let previousTime = '';
255
249
  for (const row of kept) {
256
- const volume = row.cumVolume - previousKeptVolume;
257
- const amount = row.cumAmount - previousKeptAmount;
258
- previousKeptVolume = row.cumVolume;
259
- previousKeptAmount = row.cumAmount;
250
+ if (previousTime !== '' && row.time < previousTime) {
251
+ throw sourceError(`Tencent minute trend ${symbol} time moved backwards at ${row.time}`, 'trend_parse_failed');
252
+ }
253
+ previousTime = row.time;
254
+ // Tencent restates the running totals when a print settles (300803.SZ 2026-11-18: the final row
255
+ // carried 0.04% less turnover than the row before it). A restatement is not corruption: it means
256
+ // "no new trade", so the delta clamps to zero and the running total keeps its high-water mark.
257
+ const volume = Math.max(0, row.cumVolume - previousKeptVolume);
258
+ const amount = Math.max(0, row.cumAmount - previousKeptAmount);
259
+ previousKeptVolume = Math.max(previousKeptVolume, row.cumVolume);
260
+ previousKeptAmount = Math.max(previousKeptAmount, row.cumAmount);
260
261
  const shares = row.cumVolume * lot;
261
262
  const avg = target.isIndex || shares <= 0 ? null : row.cumAmount / shares;
262
263
  points.push([row.time, row.price, avg, volume, amount]);
@@ -3,7 +3,7 @@
3
3
  * Known limit: DNS resolves per request but the IP is not pinned to the connection,
4
4
  * so a rebinding window remains (same trade-off as dsh-search-first).
5
5
  */
6
- export declare const LOCAL_FETCH_CLIENT_VERSION = "2.27.0";
6
+ export declare const LOCAL_FETCH_CLIENT_VERSION = "2.27.2";
7
7
  export declare const LOCAL_FETCH_MAX_URL_LENGTH = 2048;
8
8
  export type LocalFetchErrorCode = 'ABORTED' | 'TIMEOUT' | 'INVALID_URL' | 'BLOCKED_URL' | 'DNS' | 'REDIRECT' | 'HTTP' | 'TOO_LARGE' | 'UNSUPPORTED_CONTENT_TYPE';
9
9
  export declare class LocalFetchError extends Error {
@@ -4,7 +4,7 @@
4
4
  * so a rebinding window remains (same trade-off as dsh-search-first).
5
5
  */
6
6
  import { htmlToMarkdown, stripInvisibleText } from './html-markdown.js';
7
- export const LOCAL_FETCH_CLIENT_VERSION = '2.27.0';
7
+ export const LOCAL_FETCH_CLIENT_VERSION = '2.27.2';
8
8
  export const LOCAL_FETCH_MAX_URL_LENGTH = 2048;
9
9
  export class LocalFetchError extends Error {
10
10
  code;
@@ -35,7 +35,7 @@ export interface WindCallResult {
35
35
  code?: WindErrorCode;
36
36
  }
37
37
  /** Must match `package.json` version; a test pins the two together. */
38
- export declare const WIND_CLIENT_VERSION = "2.27.0";
38
+ export declare const WIND_CLIENT_VERSION = "2.27.2";
39
39
  export interface WindClient {
40
40
  callTool(toolName: string, args: Record<string, unknown>, signal?: AbortSignal): Promise<WindCallResult>;
41
41
  }
@@ -19,7 +19,7 @@ export const WIND_SERVER_ENDPOINTS = {
19
19
  analytics_data: 'https://mcp.wind.com.cn/vserver_analytics_data/mcp/',
20
20
  };
21
21
  /** Must match `package.json` version; a test pins the two together. */
22
- export const WIND_CLIENT_VERSION = '2.27.0';
22
+ export const WIND_CLIENT_VERSION = '2.27.2';
23
23
  function errorText(error) {
24
24
  return error instanceof Error ? error.message : String(error);
25
25
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@v587d/capital-generation",
3
- "version": "2.27.0",
4
- "description": "Capital Generation:面向中国散户的 AI 投资助手插件(自动模式 Agent Preset)",
3
+ "version": "2.27.2",
4
+ "description": "Capital Generation:面向中国散户的 AI 投资助手插件",
5
5
  "icon": "assets/cg-icon.png",
6
6
  "author": "v587d",
7
7
  "license": "MIT",
@@ -5,7 +5,7 @@ window.__ModuleLoader__.load({
5
5
  var module = { exports: {} }
6
6
  var exports = module.exports
7
7
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' })
8
- "use strict";var Te=Object.defineProperty;var Ct=Object.getOwnPropertyDescriptor;var Mt=Object.getOwnPropertyNames;var At=Object.prototype.hasOwnProperty;var Tt=(t,a,i)=>()=>{if(i)throw i[0];try{return t&&(a=t(t=0)),a}catch(r){throw i=[r],r}};var zt=(t,a)=>{for(var i in a)Te(t,i,{get:a[i],enumerable:!0})},Ht=(t,a,i,r)=>{if(a&&typeof a=="object"||typeof a=="function")for(let s of Mt(a))!At.call(t,s)&&s!==i&&Te(t,s,{get:()=>a[s],enumerable:!(r=Ct(a,s))||r.enumerable});return t};var Pt=t=>Ht(Te({},"__esModule",{value:!0}),t);var Ke={};zt(Ke,{ASSET_TYPES:()=>Et,HOLDABLE_ASSET_TYPES:()=>qe,MAX_ROW_WEIGHT_PCT:()=>Ft,MAX_TOTAL_WEIGHT_PCT:()=>Ot,holdingWeight:()=>Be,isHoldable:()=>Rt,otherHeldWeightPct:()=>We,weightCeiling:()=>It});var Et,qe,Rt,Ft,Ot,Be,We,It,Qe=Tt(()=>{"use strict";Et=["a-share","a-share-index","fund-etf","hk-stock","hk-index","us-stock","us-index"],qe=["a-share","fund-etf","hk-stock","us-stock"],Rt=t=>qe.includes(t?.asset_type),Ft=100,Ot=120,Be=t=>t?.holding===null||t?.holding===void 0?0:t?.holding?.weight_pct??0,We=(t,a)=>t.reduce((i,r)=>r?.thscode===a?i:i+Be(r),0),It=(t,a)=>Math.max(0,Math.min(100,120-We(t,a)))});var{createElement:e,useEffect:ge,useRef:Le,useState:A}=require("react"),{createSnapshotStore:Lt}=require("@deepseek-ai/dsh-client-store"),{IconChecklistOutlineRegular:ke,IconCloseOutlineRegular:Ye,IconDatabaseOutlineRegular:Ut,IconEllipsisOutlineRegular:nt,IconGoalOutlineRegular:rt,IconListPenOutlineRegular:jt,IconPinOutlineRegular:ot,IconRefreshOutlineRegular:ct,IconSearchOutlineRegular:dt,IconTrashOutlineRegular:Re,Menu:Fe,MenuItemButton:Ne,Modal:Dt,Switch:Gt}=require("@deepseek-ai/dsh-client-ui-primitives"),{isHoldable:Ve,weightCeiling:pt}=(Qe(),Pt(Ke)),he="capital-watchlist",fe="capital.watchlist",Xe="conversation.input.overlay",Ze="/capital-watchlist",qt="capital-generation",Bt=300,ze=10,Je="capital-watchlist-css",Wt={"command.label":"\u81EA\u9009\u80A1","command.description":"\u6DFB\u52A0 / \u67E5\u770B / \u5220\u9664\u81EA\u9009\u80A1",title:"\u81EA\u9009\u80A1",close:"\u5173\u95ED",searchPlaceholder:"\u8F93\u5165\u8BC1\u5238\u4EE3\u7801\u6216\u540D\u79F0\uFF0C\u652F\u6301A\u80A1/\u6E2F\u80A1/\u7F8E\u80A1",add:"\u6DFB\u52A0",added:"\u5DF2\u6DFB\u52A0",refreshing:"\u5237\u65B0\u4E2D\u2026",refresh:"\u5237\u65B0\u62A5\u4EF7",loading:"\u6B63\u5728\u8BFB\u53D6\u6E05\u5355\u2026",empty:"\u8FD8\u6CA1\u6709\u81EA\u9009\u80A1\uFF0C\u7528\u4E0A\u9762\u7684\u8F93\u5165\u6846\u6DFB\u52A0\u3002",colName:"\u540D\u79F0",colQuote:"\u6700\u65B0\u4EF7 / \u6DA8\u8DCC\u5E45",colAction:"\u64CD\u4F5C",updated:"\u66F4\u65B0\u65F6\u95F4",notRefreshed:"\u672A\u5237\u65B0",stale:"\u4E0A\u4E00\u6B21\u5FEB\u7167",exchangeTime:"\u4EA4\u6613\u6240\u65F6\u95F4",noChangePct:"\u6682\u65E0\u6DA8\u8DCC\u6570\u636E",typeAShare:"A\u80A1",typeHkStock:"\u6E2F\u80A1",typeUsStock:"\u7F8E\u80A1",typeAIndex:"A\u6307",typeHkIndex:"\u6E2F\u6307",typeUsIndex:"\u7F8E\u6307",kindStock:"\u80A1\u7968",kindIndex:"\u6307\u6570",kindEtf:"ETF",remove:"\u79FB\u9664",more:"\u66F4\u591A",pin:"\u7F6E\u9876",holdingWeightLabel:"\u6301\u4ED3\u6BD4\u4F8B",holdingStepper:"\u6301\u4ED3\u6BD4\u4F8B\uFF08\u6BCF\u6863 10 \u4E2A\u767E\u5206\u70B9\uFF09",holdingStepUp:"\u589E\u52A0\u6301\u4ED3\u6BD4\u4F8B",holdingStepDown:"\u51CF\u5C11\u6301\u4ED3\u6BD4\u4F8B",holdingName:"\u6301\u4ED3",predict:"\u9884\u6D4B",predictTip:"AI\u9884\u6D4B",review:"\u590D\u76D8",reviewTip:"AI\u590D\u76D8",predictPromptPrefix:"\u8BF7\u9884\u6D4B ",predictPromptSuffix:"\uFF1A\u672A\u6765 5 \u4E2A\u4EA4\u6613\u65E5\u7684\u8D70\u52BF\u4E0E\u5173\u952E\u70B9\u4F4D\uFF0C\u8BF4\u660E\u4F9D\u636E\uFF0C\u5E76\u7ED9\u51FA\u5224\u65AD\u7684\u4E0D\u786E\u5B9A\u6027\u3002",reviewPromptPrefix:"\u8BF7\u590D\u76D8 ",reviewPromptSuffix:"\uFF1A\u4ECA\u65E5\u8D70\u52BF\u4E0E\u91CF\u4EF7\u3001\u8FD1 20 \u65E5\u8D8B\u52BF\u3001\u57FA\u7840\u9762\u3001\u6D88\u606F\u9762\uFF0C\u7ED9\u51FA\u7ED3\u8BBA\u548C\u5FC5\u8981\u98CE\u9669\u8BC4\u4F30\u3002",searching:"\u641C\u7D22\u4E2D\u2026",composingHint:"\u8F93\u5165\u5B8C\u6210\u540E\u81EA\u52A8\u641C\u7D22",clearInput:"\u6E05\u7A7A\u8F93\u5165",confirmTitle:"\u786E\u8BA4\u79FB\u9664\uFF1F",confirmDescPrefix:"\u786E\u5B9A\u5C06 ",confirmDescSuffix:" \u4ECE\u81EA\u9009\u4E2D\u79FB\u9664\u5417\uFF1F",confirmCancel:"\u53D6\u6D88",confirmOk:"\u786E\u8BA4\u79FB\u9664",truncated:"\u6CA1\u6709\u66F4\u591A\uFF0C\u8BF7\u8F93\u5165\u51C6\u786E\u7684\u8BC1\u5238\u4EE3\u7801\u6216\u540D\u79F0\u3002",filterAll:"\u5168\u90E8",filterLabel:"\u6309\u5E02\u573A\u7B5B\u9009\u5019\u9009",filterNoHit:"\u8FD9\u4E2A\u5E02\u573A\u4E0B\u6CA1\u6709\u5339\u914D\u7684\u6807\u7684\u3002",noHit:"\u6CA1\u6709\u5339\u914D\u7684\u6807\u7684\uFF08A\u80A1 / \u6E2F\u80A1 / \u7F8E\u80A1\uFF0C\u542B\u6307\u6570\u4E0E\u573A\u5185\u57FA\u91D1\uFF09\u3002","error.invalid_query":"\u8F93\u5165\u4E0D\u88AB\u63A5\u53D7","error.not_found":"\u6CA1\u6709\u627E\u5230\u8BE5\u6807\u7684","error.ambiguous":"\u547D\u4E2D\u591A\u6761\uFF0C\u8BF7\u4ECE\u5019\u9009\u91CC\u9009\u4E00\u6761","error.list_full":"\u81EA\u9009\u80A1\u6700\u591A {max} \u6761\uFF0C\u5148\u5220\u4E00\u6761\u518D\u52A0","error.list_full_noMax":"\u81EA\u9009\u80A1\u5DF2\u8FBE\u4E0A\u9650\uFF0C\u5148\u5220\u4E00\u6761\u518D\u52A0","error.credential_missing":"\u672A\u914D\u7F6E Fuyao \u5BC6\u94A5\uFF1A\u5728\u300C\u63D2\u4EF6\u300D\u9875\u7684 \u81EA\u52A8\u6A21\u5F0F\u5361\u7247\u91CC\u586B API Key\uFF08\u53EA\u5F71\u54CD A \u80A1\u90A3\u4E00\u8DEF\uFF0C\u6E2F\u7F8E\u80A1\u7167\u5E38\u7528\uFF09","error.rate_limited":"\u884C\u60C5\u670D\u52A1\u9650\u6D41\uFF0C\u8BF7\u7A0D\u540E\u518D\u8BD5","error.fuyao_unavailable":"A \u80A1\u884C\u60C5\u6682\u65F6\u53D6\u4E0D\u5230\uFF0C\u8BF7\u7A0D\u540E\u518D\u8BD5","error.tencent_unavailable":"\u6E2F\u7F8E\u80A1\u884C\u60C5\u6682\u65F6\u53D6\u4E0D\u5230\uFF0C\u8BF7\u7A0D\u540E\u518D\u8BD5","error.quote_unavailable":"\u8BE5\u6807\u7684\u6CA1\u6709\u53EF\u7528\u62A5\u4EF7","error.refresh_timeout":"\u5237\u65B0\u8D85\u65F6\uFF0C\u8BF7\u7A0D\u540E\u518D\u8BD5","error.store_unavailable":"\u81EA\u9009\u80A1\u5B58\u50A8\u4E0D\u53EF\u7528","error.unauthorized":"\u767B\u5F55\u72B6\u6001\u5DF2\u5931\u6548\uFF1A\u8BF7\u5148\u56DE\u5230\u5BBF\u4E3B\u7A97\u53E3\u91CD\u65B0\u767B\u5F55",errorSuffix:"\uFF08\u5176\u4ED6\u6807\u7684\u4ECD\u662F\u4E0A\u4E00\u6B21\u6210\u529F\u5FEB\u7167\uFF09","partial.a-share":"A \u80A1\u68C0\u7D22\u4E0D\u53EF\u7528\uFF1A","partial.hk":"\u6E2F\u80A1\u68C0\u7D22\u4E0D\u53EF\u7528\uFF1A","partial.us":"\u7F8E\u80A1\u68C0\u7D22\u4E0D\u53EF\u7528\uFF1A","desk.panel":"\u81EA\u9009\u80A1","desk.title":"\u81EA\u9009\u80A1\u884C\u60C5\u5DE5\u4F5C\u53F0","desk.refresh":"\u5237\u65B0\u884C\u60C5","desk.refreshing":"\u5237\u65B0\u4E2D\u2026","desk.loading":"\u6B63\u5728\u8BFB\u53D6\u81EA\u9009\u80A1\u2026","desk.lastUpdate":"\u6700\u8FD1\u66F4\u65B0","desk.notRefreshed":"\u672A\u5237\u65B0","desk.filter":"\u7B5B\u9009\u6807\u7684","desk.filterPlaceholder":"\u540D\u79F0\u6216\u4EE3\u7801","desk.group":"\u5206\u7EC4","desk.allGroups":"\u5168\u90E8","desk.newGroup":"\u5206\u7EC4\u540D\u79F0","desk.createGroup":"\u65B0\u5EFA","desk.deleteGroup":"\u5220\u9664\u5206\u7EC4","desk.noGroup":"\u672A\u5206\u7EC4","desk.more":"\u66F4\u591A\u64CD\u4F5C","desk.noGroupYet":"\u8FD8\u6CA1\u6709\u5206\u7EC4","desk.pin":"\u7F6E\u9876","desk.remove":"\u79FB\u9664","desk.removeHint":"\u518D\u70B9\u4E00\u6B21\u5220\u9664\u6309\u94AE\u786E\u8BA4\u79FB\u9664","desk.cancel":"\u53D6\u6D88","desk.empty":"\u8FD8\u6CA1\u6709\u81EA\u9009\u80A1","desk.emptyHint":"\u7528\u8F93\u5165\u6846\u7684\u300C\u81EA\u9009\u80A1\u300D\u9762\u677F\u6DFB\u52A0\u6807\u7684\uFF0C\u8FD9\u91CC\u4F1A\u540C\u6B65\u663E\u793A\u3002","desk.noMatch":"\u6CA1\u6709\u5339\u914D\u7684\u6807\u7684","desk.noMatchHint":"\u6362\u4E2A\u5173\u952E\u8BCD\uFF0C\u6216\u5207\u56DE\u300C\u5168\u90E8\u300D\u5206\u7EC4\u3002","desk.selectHint":"\u9009\u62E9\u4E00\u53EA\u6807\u7684\u67E5\u770B\u8BE6\u60C5","desk.selectHintBody":"\u5DE6\u4FA7\u5217\u8868\u6309\u5206\u7EC4\u7B5B\u9009\uFF1B\u9009\u4E2D\u540E\u8FD9\u91CC\u663E\u793A\u62A5\u4EF7\u3001\u5206\u65F6\u4E0E\u6210\u4EA4\u91CF\u3002","desk.intraday":"\u5206\u65F6","desk.trendLoading":"\u6B63\u5728\u8BFB\u53D6\u5206\u65F6\u2026","desk.trendUnavailable":"\u8BE5\u5E02\u573A\u6682\u65F6\u6CA1\u6709\u5206\u65F6\u6570\u636E","desk.trendUnavailableHint":"\u573A\u5916\u7F8E\u80A1\u4E0E\u90E8\u5206\u6D77\u5916\u6307\u6570\u6CA1\u6709\u5206\u65F6\u6E90\uFF0C\u8FD9\u91CC\u4E0D\u753B\u5047\u8D70\u52BF\u3002","desk.trendError":"\u5206\u65F6\u52A0\u8F7D\u5931\u8D25","desk.trendRetry":"\u91CD\u8BD5","desk.daily":"\u65E5K","desk.fold":"\u6536\u8D77","desk.unfold":"\u5C55\u5F00","desk.adjustQfq":"\u524D\u590D\u6743","desk.klineLoading":"\u6B63\u5728\u8BFB\u53D6\u65E5K\u2026","desk.klineError":"\u65E5K\u6682\u65F6\u53D6\u4E0D\u5230","desk.klineUnavailable":"\u8BE5\u5E02\u573A\u6682\u65F6\u6CA1\u6709\u65E5K\u6570\u636E","desk.klineUnavailableHint":"\u6E2F\u7F8E\u80A1\u6307\u6570\u53EA\u6709\u5206\u65F6\uFF0C\u6CA1\u6709\u53EF\u7528\u7684\u65E5\u7EBF\u5E8F\u5217","desk.kOpen":"\u5F00","desk.kHigh":"\u9AD8","desk.kLow":"\u4F4E","desk.kClose":"\u6536","desk.trendLive":"\u76D8\u4E2D","desk.trendClosed":"\u6536\u76D8","desk.trendPrevious":"\u4E0A\u4E00\u4EA4\u6613\u65E5","desk.trendStale":"\u6570\u636E\u6EDE\u540E","desk.trendOpen":"\u4ECA\u5F00","desk.trendHigh":"\u6700\u9AD8","desk.trendLow":"\u6700\u4F4E","desk.trendAvg":"\u5747\u4EF7","desk.trendVolume":"\u6210\u4EA4\u91CF","desk.trendAmount":"\u6210\u4EA4\u989D","desk.lot":"\u624B","desk.share":"\u80A1","desk.trendZoneUs":"\u7F8E\u4E1C","desk.trendZoneHk":"\u9999\u6E2F","desk.capturedAt":"\u884C\u60C5\u65F6\u95F4","desk.groupsOf":"\u6240\u5C5E\u5206\u7EC4","desk.kind":"\u6807\u7684\u7C7B\u578B","desk.colName":"\u540D\u79F0","desk.colPrice":"\u6700\u65B0","desk.colChange":"\u6DA8\u8DCC","desk.colAction":"\u64CD\u4F5C","desk.loadFailed":"\u81EA\u9009\u80A1\u670D\u52A1\u6682\u4E0D\u53EF\u7528"},Kt={"command.label":"Watchlist","command.description":"Add / view / remove watched symbols",title:"Watchlist",close:"Close",searchPlaceholder:"Symbol code or name \u2014 A-share / HK / US",add:"Add",added:"Added",refreshing:"Refreshing\u2026",refresh:"Refresh quotes",loading:"Loading list\u2026",empty:"No symbols yet \u2014 use the input above to add one.",colName:"Symbol",colQuote:"Last / change",colAction:"Actions",updated:"Updated",notRefreshed:"Not refreshed",stale:"last snapshot",exchangeTime:"exchange time",noChangePct:"No change data yet",typeAShare:"A-Share",typeHkStock:"HK",typeUsStock:"US",typeAIndex:"A-Index",typeHkIndex:"HK-Index",typeUsIndex:"US-Index",kindStock:"stock",kindIndex:"index",kindEtf:"ETF",remove:"Remove",more:"More",pin:"Pin to top",holdingWeightLabel:"Holding weight",holdingStepper:"Holding weight, in steps of 10 percentage points",holdingStepUp:"Increase holding weight",holdingStepDown:"Decrease holding weight",holdingName:"Holding",predict:"Predict",predictTip:"AI prediction",review:"Review",reviewTip:"AI review",predictPromptPrefix:"Predict ",predictPromptSuffix:" over the next 5 sessions: the likely path and key levels, the evidence behind the call, and how uncertain it is.",reviewPromptPrefix:"Review ",reviewPromptSuffix:" with today's trend and volume, the last 20 sessions, fundamental, news, then a conclusion and the necessary risks analysis.",searching:"Searching\u2026",composingHint:"Search runs when you finish typing",clearInput:"Clear input",confirmTitle:"Remove this symbol?",confirmDescPrefix:"Remove ",confirmDescSuffix:" from your watchlist?",confirmCancel:"Cancel",confirmOk:"Remove",truncated:"No more candidates \u2014 enter an accurate code or name.",filterAll:"All",filterLabel:"Filter candidates by market",filterNoHit:"No matching symbol in this market.",noHit:"No matching symbol (A-share / HK / US, including indices and listed funds).","error.invalid_query":"Input not accepted","error.not_found":"Symbol not found","error.ambiguous":"Multiple hits \u2014 pick one candidate","error.list_full":"Watchlist holds at most {max} symbols \u2014 remove one first","error.list_full_noMax":"Watchlist is full \u2014 remove one first","error.credential_missing":"No Fuyao API key: set it on the Capital card in the Plugins page (A-share quotes only \u2014 HK and US keep working)","error.rate_limited":"Quote service is rate limited \u2014 try again later","error.fuyao_unavailable":"A-share quotes unavailable \u2014 try again later","error.tencent_unavailable":"HK / US quotes unavailable \u2014 try again later","error.quote_unavailable":"No quote for this symbol","error.refresh_timeout":"Refresh timed out \u2014 try again later","error.store_unavailable":"Watchlist storage unavailable","error.unauthorized":"Session expired \u2014 sign back in to the host first",errorSuffix:" (other symbols still show their last good snapshot)","partial.a-share":"A-share search unavailable: ","partial.hk":"HK search unavailable: ","partial.us":"US search unavailable: ","desk.panel":"Watchlist","desk.title":"Watchlist market desk","desk.refresh":"Refresh quotes","desk.refreshing":"Refreshing\u2026","desk.loading":"Loading watchlist\u2026","desk.lastUpdate":"Last update","desk.notRefreshed":"Not refreshed","desk.filter":"Filter symbols","desk.filterPlaceholder":"Name or code","desk.group":"Group","desk.allGroups":"All","desk.newGroup":"Group name","desk.createGroup":"Create","desk.deleteGroup":"Delete group","desk.noGroup":"Ungrouped","desk.more":"More actions","desk.noGroupYet":"No groups yet","desk.pin":"Pin","desk.remove":"Remove","desk.removeHint":"Press remove again to confirm","desk.cancel":"Cancel","desk.empty":"No symbols yet","desk.emptyHint":"Add symbols from the watchlist panel in the composer; they appear here.","desk.noMatch":"No symbols match","desk.noMatchHint":"Try another term, or switch back to All.","desk.selectHint":"Select a symbol","desk.selectHintBody":"The left list filters by group; the quote, intraday and volume panels follow the selection.","desk.intraday":"Intraday","desk.trendLoading":"Loading intraday\u2026","desk.trendUnavailable":"No intraday series for this market","desk.trendUnavailableHint":"OTC US lines and some overseas indices have no intraday source; nothing is drawn to fill the gap.","desk.trendError":"Intraday failed to load","desk.trendRetry":"Retry","desk.daily":"Daily","desk.fold":"Collapse","desk.unfold":"Expand","desk.adjustQfq":"Forward-adjusted","desk.klineLoading":"Loading daily bars\u2026","desk.klineError":"Daily bars are unavailable","desk.klineUnavailable":"No daily bars for this market","desk.klineUnavailableHint":"HK/US indices carry an intraday series only","desk.kOpen":"Open","desk.kHigh":"High","desk.kLow":"Low","desk.kClose":"Close","desk.trendLive":"Live","desk.trendClosed":"Closed","desk.trendPrevious":"Previous session","desk.trendStale":"Stale","desk.trendOpen":"Open","desk.trendHigh":"High","desk.trendLow":"Low","desk.trendAvg":"VWAP","desk.trendVolume":"Volume","desk.trendAmount":"Turnover","desk.lot":"lots","desk.share":"shares","desk.trendZoneUs":"ET","desk.trendZoneHk":"HK","desk.capturedAt":"As of","desk.groupsOf":"Groups","desk.kind":"Instrument","desk.colName":"Symbol","desk.colPrice":"Last","desk.colChange":"Change","desk.colAction":"Actions","desk.loadFailed":"Watchlist service unavailable"},Qt={"a-share":"typeAShare","hk-stock":"typeHkStock","us-stock":"typeUsStock","a-share-index":"typeAIndex","hk-index":"typeHkIndex","us-index":"typeUsIndex","fund-etf":"typeAShare"},Yt={"a-share":"kindStock","hk-stock":"kindStock","us-stock":"kindStock","a-share-index":"kindIndex","hk-index":"kindIndex","us-index":"kindIndex","fund-etf":"kindEtf"};function ht(t,a){let i=Qt[t];return i===void 0?String(t??""):a(i)}function Vt(t,a){let i=Yt[t];return i===void 0?String(t??""):a(i)}var Xt=/[\u0000-\u0008\u000B\u000C\u000E-\u001F\u007F-\u009F\u00AD\u200B-\u200F\u2028\u2029\u202A-\u202E\u2060-\u2064\u2066-\u2069\uFEFF]/gu;function xe(t){return String(t??"").replace(Xt,"")}function ce(t){return Array.isArray(t)?t.map(a=>a===null||typeof a!="object"?a:{...a,name:xe(a.name)}):t}var Zt={"a-share":"capital-watchlist-tag-cn","a-share-index":"capital-watchlist-tag-cn","fund-etf":"capital-watchlist-tag-cn","hk-stock":"capital-watchlist-tag-hk","hk-index":"capital-watchlist-tag-hk","us-stock":"capital-watchlist-tag-us","us-index":"capital-watchlist-tag-us"},ut=[{id:"all"},{id:"cn",label:"CN"},{id:"hk",label:"HK"},{id:"us",label:"US"}],et=t=>t.exchange==="HK"?"hk":t.exchange==="US"?"us":"cn",Jt=`
8
+ "use strict";var ze=Object.defineProperty;var Mt=Object.getOwnPropertyDescriptor;var At=Object.getOwnPropertyNames;var zt=Object.prototype.hasOwnProperty;var Pt=(t,a,i)=>()=>{if(i)throw i[0];try{return t&&(a=t(t=0)),a}catch(r){throw i=[r],r}};var Tt=(t,a)=>{for(var i in a)ze(t,i,{get:a[i],enumerable:!0})},Ht=(t,a,i,r)=>{if(a&&typeof a=="object"||typeof a=="function")for(let s of At(a))!zt.call(t,s)&&s!==i&&ze(t,s,{get:()=>a[s],enumerable:!(r=Mt(a,s))||r.enumerable});return t};var Et=t=>Ht(ze({},"__esModule",{value:!0}),t);var Xe={};Tt(Xe,{ASSET_TYPES:()=>Rt,HOLDABLE_ASSET_TYPES:()=>Qe,MAX_ROW_WEIGHT_PCT:()=>Ft,MAX_TOTAL_WEIGHT_PCT:()=>It,holdingWeight:()=>Ye,isHoldable:()=>Ot,otherHeldWeightPct:()=>Ve,weightCeiling:()=>Lt});var Rt,Qe,Ot,Ft,It,Ye,Ve,Lt,Ze=Pt(()=>{"use strict";Rt=["a-share","a-share-index","fund-etf","hk-stock","hk-index","us-stock","us-index"],Qe=["a-share","fund-etf","hk-stock","us-stock"],Ot=t=>Qe.includes(t?.asset_type),Ft=100,It=120,Ye=t=>t?.holding===null||t?.holding===void 0?0:t?.holding?.weight_pct??0,Ve=(t,a)=>t.reduce((i,r)=>r?.thscode===a?i:i+Ye(r),0),Lt=(t,a)=>Math.max(0,Math.min(100,120-Ve(t,a)))});var{createElement:e,useEffect:ge,useRef:Ue,useState:M}=require("react"),{createSnapshotStore:Ut}=require("@deepseek-ai/dsh-client-store"),{IconChecklistOutlineRegular:ke,IconCloseOutlineRegular:Je,IconDatabaseOutlineRegular:jt,IconEllipsisOutlineRegular:dt,IconInfoOutlineRegular:Dt,IconGoalOutlineRegular:pt,IconListPenOutlineRegular:Gt,IconPinOutlineRegular:ht,IconRefreshOutlineRegular:Re,IconSearchOutlineRegular:ut,IconTrashOutlineRegular:Oe,Menu:Fe,MenuItemButton:Ne,Modal:qt,Switch:Bt}=require("@deepseek-ai/dsh-client-ui-primitives"),{isHoldable:et,weightCeiling:wt}=(Ze(),Et(Xe)),ue="capital-watchlist",fe="capital.watchlist",tt="conversation.input.overlay",at="/capital-watchlist",Wt="capital-generation",Kt=300,Pe=10,it="capital-watchlist-css",Qt={"command.label":"\u81EA\u9009\u80A1","command.description":"\u6DFB\u52A0 / \u67E5\u770B / \u5220\u9664\u81EA\u9009\u80A1",title:"\u81EA\u9009\u80A1",close:"\u5173\u95ED",searchPlaceholder:"\u8F93\u5165\u8BC1\u5238\u4EE3\u7801\u6216\u540D\u79F0\uFF0C\u652F\u6301A\u80A1/\u6E2F\u80A1/\u7F8E\u80A1",add:"\u6DFB\u52A0",added:"\u5DF2\u6DFB\u52A0",refreshing:"\u5237\u65B0\u4E2D\u2026",refresh:"\u5237\u65B0\u62A5\u4EF7",loading:"\u6B63\u5728\u8BFB\u53D6\u6E05\u5355\u2026",empty:"\u8FD8\u6CA1\u6709\u81EA\u9009\u80A1\uFF0C\u7528\u4E0A\u9762\u7684\u8F93\u5165\u6846\u6DFB\u52A0\u3002",colName:"\u540D\u79F0",colQuote:"\u6700\u65B0\u4EF7 / \u6DA8\u8DCC\u5E45",colAction:"\u64CD\u4F5C",updated:"\u66F4\u65B0\u65F6\u95F4",notRefreshed:"\u672A\u5237\u65B0",stale:"\u4E0A\u4E00\u6B21\u5FEB\u7167",exchangeTime:"\u4EA4\u6613\u6240\u65F6\u95F4",noChangePct:"\u6682\u65E0\u6DA8\u8DCC\u6570\u636E",typeAShare:"A\u80A1",typeHkStock:"\u6E2F\u80A1",typeUsStock:"\u7F8E\u80A1",typeAIndex:"A\u6307",typeHkIndex:"\u6E2F\u6307",typeUsIndex:"\u7F8E\u6307",kindStock:"\u80A1\u7968",kindIndex:"\u6307\u6570",kindEtf:"ETF",remove:"\u79FB\u9664",more:"\u66F4\u591A",pin:"\u7F6E\u9876",holdingWeightLabel:"\u6301\u4ED3\u6BD4\u4F8B",holdingStepper:"\u6301\u4ED3\u6BD4\u4F8B\uFF08\u6BCF\u6863 10 \u4E2A\u767E\u5206\u70B9\uFF09",holdingStepUp:"\u589E\u52A0\u6301\u4ED3\u6BD4\u4F8B",holdingStepDown:"\u51CF\u5C11\u6301\u4ED3\u6BD4\u4F8B",holdingName:"\u6301\u4ED3",predict:"\u9884\u6D4B",predictTip:"AI\u9884\u6D4B",review:"\u590D\u76D8",reviewTip:"AI\u590D\u76D8",predictPromptPrefix:"\u8BF7\u9884\u6D4B ",predictPromptSuffix:"\uFF1A\u672A\u6765 5 \u4E2A\u4EA4\u6613\u65E5\u7684\u8D70\u52BF\u4E0E\u5173\u952E\u70B9\u4F4D\uFF0C\u8BF4\u660E\u4F9D\u636E\uFF0C\u5E76\u7ED9\u51FA\u5224\u65AD\u7684\u4E0D\u786E\u5B9A\u6027\u3002",reviewPromptPrefix:"\u8BF7\u590D\u76D8 ",reviewPromptSuffix:"\uFF1A\u4ECA\u65E5\u8D70\u52BF\u4E0E\u91CF\u4EF7\u3001\u8FD1 20 \u65E5\u8D8B\u52BF\u3001\u57FA\u7840\u9762\u3001\u6D88\u606F\u9762\uFF0C\u7ED9\u51FA\u7ED3\u8BBA\u548C\u5FC5\u8981\u98CE\u9669\u8BC4\u4F30\u3002",searching:"\u641C\u7D22\u4E2D\u2026",composingHint:"\u8F93\u5165\u5B8C\u6210\u540E\u81EA\u52A8\u641C\u7D22",clearInput:"\u6E05\u7A7A\u8F93\u5165",confirmTitle:"\u786E\u8BA4\u79FB\u9664\uFF1F",confirmDescPrefix:"\u786E\u5B9A\u5C06 ",confirmDescSuffix:" \u4ECE\u81EA\u9009\u4E2D\u79FB\u9664\u5417\uFF1F",confirmCancel:"\u53D6\u6D88",confirmOk:"\u786E\u8BA4\u79FB\u9664",truncated:"\u6CA1\u6709\u66F4\u591A\uFF0C\u8BF7\u8F93\u5165\u51C6\u786E\u7684\u8BC1\u5238\u4EE3\u7801\u6216\u540D\u79F0\u3002",filterAll:"\u5168\u90E8",filterLabel:"\u6309\u5E02\u573A\u7B5B\u9009\u5019\u9009",filterNoHit:"\u8FD9\u4E2A\u5E02\u573A\u4E0B\u6CA1\u6709\u5339\u914D\u7684\u6807\u7684\u3002",noHit:"\u6CA1\u6709\u5339\u914D\u7684\u6807\u7684\uFF08A\u80A1 / \u6E2F\u80A1 / \u7F8E\u80A1\uFF0C\u542B\u6307\u6570\u4E0E\u573A\u5185\u57FA\u91D1\uFF09\u3002","error.invalid_query":"\u8F93\u5165\u4E0D\u88AB\u63A5\u53D7","error.not_found":"\u6CA1\u6709\u627E\u5230\u8BE5\u6807\u7684","error.ambiguous":"\u547D\u4E2D\u591A\u6761\uFF0C\u8BF7\u4ECE\u5019\u9009\u91CC\u9009\u4E00\u6761","error.list_full":"\u81EA\u9009\u80A1\u6700\u591A {max} \u6761\uFF0C\u5148\u5220\u4E00\u6761\u518D\u52A0","error.list_full_noMax":"\u81EA\u9009\u80A1\u5DF2\u8FBE\u4E0A\u9650\uFF0C\u5148\u5220\u4E00\u6761\u518D\u52A0","error.credential_missing":"\u672A\u914D\u7F6E Fuyao \u5BC6\u94A5\uFF1A\u5728\u300C\u63D2\u4EF6\u300D\u9875\u7684 \u81EA\u52A8\u6A21\u5F0F\u5361\u7247\u91CC\u586B API Key\uFF08\u53EA\u5F71\u54CD A \u80A1\u90A3\u4E00\u8DEF\uFF0C\u6E2F\u7F8E\u80A1\u7167\u5E38\u7528\uFF09","error.rate_limited":"\u884C\u60C5\u670D\u52A1\u9650\u6D41\uFF0C\u8BF7\u7A0D\u540E\u518D\u8BD5","error.fuyao_unavailable":"A \u80A1\u884C\u60C5\u6682\u65F6\u53D6\u4E0D\u5230\uFF0C\u8BF7\u7A0D\u540E\u518D\u8BD5","error.tencent_unavailable":"\u6E2F\u7F8E\u80A1\u884C\u60C5\u6682\u65F6\u53D6\u4E0D\u5230\uFF0C\u8BF7\u7A0D\u540E\u518D\u8BD5","error.quote_unavailable":"\u8BE5\u6807\u7684\u6CA1\u6709\u53EF\u7528\u62A5\u4EF7","error.refresh_timeout":"\u5237\u65B0\u8D85\u65F6\uFF0C\u8BF7\u7A0D\u540E\u518D\u8BD5","error.store_unavailable":"\u81EA\u9009\u80A1\u5B58\u50A8\u4E0D\u53EF\u7528","error.unauthorized":"\u767B\u5F55\u72B6\u6001\u5DF2\u5931\u6548\uFF1A\u8BF7\u5148\u56DE\u5230\u5BBF\u4E3B\u7A97\u53E3\u91CD\u65B0\u767B\u5F55",errorSuffix:"\uFF08\u5176\u4ED6\u6807\u7684\u4ECD\u662F\u4E0A\u4E00\u6B21\u6210\u529F\u5FEB\u7167\uFF09","partial.a-share":"A \u80A1\u68C0\u7D22\u4E0D\u53EF\u7528\uFF1A","partial.hk":"\u6E2F\u80A1\u68C0\u7D22\u4E0D\u53EF\u7528\uFF1A","partial.us":"\u7F8E\u80A1\u68C0\u7D22\u4E0D\u53EF\u7528\uFF1A","desk.panel":"\u81EA\u9009\u80A1","desk.title":"\u81EA\u9009\u80A1\u884C\u60C5\u5DE5\u4F5C\u53F0","desk.refresh":"\u5237\u65B0\u884C\u60C5","desk.refreshing":"\u5237\u65B0\u4E2D\u2026","desk.loading":"\u6B63\u5728\u8BFB\u53D6\u81EA\u9009\u80A1\u2026","desk.lastUpdate":"\u6700\u8FD1\u66F4\u65B0","desk.notRefreshed":"\u672A\u5237\u65B0","desk.filter":"\u7B5B\u9009\u6807\u7684","desk.filterPlaceholder":"\u540D\u79F0\u6216\u4EE3\u7801","desk.group":"\u5206\u7EC4","desk.allGroups":"\u5168\u90E8","desk.newGroup":"\u5206\u7EC4\u540D\u79F0","desk.createGroup":"\u65B0\u5EFA","desk.deleteGroup":"\u5220\u9664\u5206\u7EC4","desk.noGroup":"\u672A\u5206\u7EC4","desk.more":"\u66F4\u591A\u64CD\u4F5C","desk.noGroupYet":"\u8FD8\u6CA1\u6709\u5206\u7EC4","desk.pin":"\u7F6E\u9876","desk.remove":"\u79FB\u9664","desk.removeHint":"\u518D\u70B9\u4E00\u6B21\u5220\u9664\u6309\u94AE\u786E\u8BA4\u79FB\u9664","desk.cancel":"\u53D6\u6D88","desk.empty":"\u8FD8\u6CA1\u6709\u81EA\u9009\u80A1","desk.emptyHint":"\u7528\u8F93\u5165\u6846\u7684\u300C\u81EA\u9009\u80A1\u300D\u9762\u677F\u6DFB\u52A0\u6807\u7684\uFF0C\u8FD9\u91CC\u4F1A\u540C\u6B65\u663E\u793A\u3002","desk.noMatch":"\u6CA1\u6709\u5339\u914D\u7684\u6807\u7684","desk.noMatchHint":"\u6362\u4E2A\u5173\u952E\u8BCD\uFF0C\u6216\u5207\u56DE\u300C\u5168\u90E8\u300D\u5206\u7EC4\u3002","desk.selectHint":"\u9009\u62E9\u4E00\u53EA\u6807\u7684\u67E5\u770B\u8BE6\u60C5","desk.selectHintBody":"\u5DE6\u4FA7\u5217\u8868\u6309\u5206\u7EC4\u7B5B\u9009\uFF1B\u9009\u4E2D\u540E\u8FD9\u91CC\u663E\u793A\u62A5\u4EF7\u3001\u5206\u65F6\u4E0E\u6210\u4EA4\u91CF\u3002","desk.intraday":"\u5206\u65F6","desk.trendLoading":"\u6B63\u5728\u8BFB\u53D6\u5206\u65F6\u2026","desk.trendUnavailable":"\u8BE5\u5E02\u573A\u6682\u65F6\u6CA1\u6709\u5206\u65F6\u6570\u636E","desk.trendUnavailableHint":"\u573A\u5916\u7F8E\u80A1\u4E0E\u90E8\u5206\u6D77\u5916\u6307\u6570\u6CA1\u6709\u5206\u65F6\u6E90\uFF0C\u8FD9\u91CC\u4E0D\u753B\u5047\u8D70\u52BF\u3002","desk.trendError":"\u5206\u65F6\u52A0\u8F7D\u5931\u8D25","desk.retry":"\u91CD\u8BD5","desk.daily":"\u65E5K","desk.adjustQfq":"\u524D\u590D\u6743","desk.klineLoading":"\u6B63\u5728\u8BFB\u53D6\u65E5K\u2026","desk.klineError":"\u65E5K\u52A0\u8F7D\u5931\u8D25","desk.klineUnavailable":"\u8BE5\u5E02\u573A\u6682\u65F6\u6CA1\u6709\u65E5K\u6570\u636E","desk.klineUnavailableHint":"\u6E2F\u7F8E\u80A1\u6307\u6570\u53EA\u6709\u5206\u65F6\uFF0C\u6CA1\u6709\u53EF\u7528\u7684\u65E5\u7EBF\u5E8F\u5217","desk.kOpen":"\u5F00","desk.kHigh":"\u9AD8","desk.kLow":"\u4F4E","desk.kClose":"\u6536","desk.trendLive":"\u76D8\u4E2D","desk.trendClosed":"\u6536\u76D8","desk.trendPrevious":"\u4E0A\u4E00\u4EA4\u6613\u65E5","desk.trendStale":"\u6570\u636E\u6EDE\u540E","desk.trendOpen":"\u4ECA\u5F00","desk.trendHigh":"\u6700\u9AD8","desk.trendLow":"\u6700\u4F4E","desk.trendAvg":"\u5747\u4EF7","desk.trendVolume":"\u6210\u4EA4\u91CF","desk.trendAmount":"\u6210\u4EA4\u989D","desk.stats":"\u884C\u60C5\u7EDF\u8BA1","desk.lot":"\u624B","desk.share":"\u80A1","desk.trendZoneUs":"\u7F8E\u4E1C","desk.trendZoneHk":"\u9999\u6E2F","desk.capturedAt":"\u884C\u60C5\u65F6\u95F4","desk.groupsOf":"\u6240\u5C5E\u5206\u7EC4","desk.colName":"\u540D\u79F0","desk.colPrice":"\u6700\u65B0","desk.colChange":"\u6DA8\u8DCC","desk.colAction":"\u64CD\u4F5C","desk.loadFailed":"\u81EA\u9009\u80A1\u670D\u52A1\u6682\u4E0D\u53EF\u7528"},Yt={"command.label":"Watchlist","command.description":"Add / view / remove watched symbols",title:"Watchlist",close:"Close",searchPlaceholder:"Symbol code or name \u2014 A-share / HK / US",add:"Add",added:"Added",refreshing:"Refreshing\u2026",refresh:"Refresh quotes",loading:"Loading list\u2026",empty:"No symbols yet \u2014 use the input above to add one.",colName:"Symbol",colQuote:"Last / change",colAction:"Actions",updated:"Updated",notRefreshed:"Not refreshed",stale:"last snapshot",exchangeTime:"exchange time",noChangePct:"No change data yet",typeAShare:"A-Share",typeHkStock:"HK",typeUsStock:"US",typeAIndex:"A-Index",typeHkIndex:"HK-Index",typeUsIndex:"US-Index",kindStock:"stock",kindIndex:"index",kindEtf:"ETF",remove:"Remove",more:"More",pin:"Pin to top",holdingWeightLabel:"Holding weight",holdingStepper:"Holding weight, in steps of 10 percentage points",holdingStepUp:"Increase holding weight",holdingStepDown:"Decrease holding weight",holdingName:"Holding",predict:"Predict",predictTip:"AI prediction",review:"Review",reviewTip:"AI review",predictPromptPrefix:"Predict ",predictPromptSuffix:" over the next 5 sessions: the likely path and key levels, the evidence behind the call, and how uncertain it is.",reviewPromptPrefix:"Review ",reviewPromptSuffix:" with today's trend and volume, the last 20 sessions, fundamental, news, then a conclusion and the necessary risks analysis.",searching:"Searching\u2026",composingHint:"Search runs when you finish typing",clearInput:"Clear input",confirmTitle:"Remove this symbol?",confirmDescPrefix:"Remove ",confirmDescSuffix:" from your watchlist?",confirmCancel:"Cancel",confirmOk:"Remove",truncated:"No more candidates \u2014 enter an accurate code or name.",filterAll:"All",filterLabel:"Filter candidates by market",filterNoHit:"No matching symbol in this market.",noHit:"No matching symbol (A-share / HK / US, including indices and listed funds).","error.invalid_query":"Input not accepted","error.not_found":"Symbol not found","error.ambiguous":"Multiple hits \u2014 pick one candidate","error.list_full":"Watchlist holds at most {max} symbols \u2014 remove one first","error.list_full_noMax":"Watchlist is full \u2014 remove one first","error.credential_missing":"No Fuyao API key: set it on the Capital card in the Plugins page (A-share quotes only \u2014 HK and US keep working)","error.rate_limited":"Quote service is rate limited \u2014 try again later","error.fuyao_unavailable":"A-share quotes unavailable \u2014 try again later","error.tencent_unavailable":"HK / US quotes unavailable \u2014 try again later","error.quote_unavailable":"No quote for this symbol","error.refresh_timeout":"Refresh timed out \u2014 try again later","error.store_unavailable":"Watchlist storage unavailable","error.unauthorized":"Session expired \u2014 sign back in to the host first",errorSuffix:" (other symbols still show their last good snapshot)","partial.a-share":"A-share search unavailable: ","partial.hk":"HK search unavailable: ","partial.us":"US search unavailable: ","desk.panel":"Watchlist","desk.title":"Watchlist market desk","desk.refresh":"Refresh quotes","desk.refreshing":"Refreshing\u2026","desk.loading":"Loading watchlist\u2026","desk.lastUpdate":"Last update","desk.notRefreshed":"Not refreshed","desk.filter":"Filter symbols","desk.filterPlaceholder":"Name or code","desk.group":"Group","desk.allGroups":"All","desk.newGroup":"Group name","desk.createGroup":"Create","desk.deleteGroup":"Delete group","desk.noGroup":"Ungrouped","desk.more":"More actions","desk.noGroupYet":"No groups yet","desk.pin":"Pin","desk.remove":"Remove","desk.removeHint":"Press remove again to confirm","desk.cancel":"Cancel","desk.empty":"No symbols yet","desk.emptyHint":"Add symbols from the watchlist panel in the composer; they appear here.","desk.noMatch":"No symbols match","desk.noMatchHint":"Try another term, or switch back to All.","desk.selectHint":"Select a symbol","desk.selectHintBody":"The left list filters by group; the quote, intraday and volume panels follow the selection.","desk.intraday":"Intraday","desk.trendLoading":"Loading intraday\u2026","desk.trendUnavailable":"No intraday series for this market","desk.trendUnavailableHint":"OTC US lines and some overseas indices have no intraday source; nothing is drawn to fill the gap.","desk.trendError":"Intraday failed to load","desk.retry":"Retry","desk.daily":"Daily","desk.adjustQfq":"Forward-adjusted","desk.klineLoading":"Loading daily bars\u2026","desk.klineError":"Daily bars failed to load","desk.klineUnavailable":"No daily bars for this market","desk.klineUnavailableHint":"HK/US indices carry an intraday series only","desk.kOpen":"Open","desk.kHigh":"High","desk.kLow":"Low","desk.kClose":"Close","desk.trendLive":"Live","desk.trendClosed":"Closed","desk.trendPrevious":"Previous session","desk.trendStale":"Stale","desk.trendOpen":"Open","desk.trendHigh":"High","desk.trendLow":"Low","desk.trendAvg":"VWAP","desk.trendVolume":"Volume","desk.trendAmount":"Turnover","desk.stats":"Session stats","desk.lot":"lots","desk.share":"shares","desk.trendZoneUs":"ET","desk.trendZoneHk":"HK","desk.capturedAt":"As of","desk.groupsOf":"Groups","desk.colName":"Symbol","desk.colPrice":"Last","desk.colChange":"Change","desk.colAction":"Actions","desk.loadFailed":"Watchlist service unavailable"},Vt={"a-share":"typeAShare","hk-stock":"typeHkStock","us-stock":"typeUsStock","a-share-index":"typeAIndex","hk-index":"typeHkIndex","us-index":"typeUsIndex","fund-etf":"typeAShare"},Xt={"a-share":"kindStock","hk-stock":"kindStock","us-stock":"kindStock","a-share-index":"kindIndex","hk-index":"kindIndex","us-index":"kindIndex","fund-etf":"kindEtf"};function Zt(t,a){let i=Vt[t];return i===void 0?String(t??""):a(i)}function Jt(t,a){let i=Xt[t];return i===void 0?String(t??""):a(i)}var ea=/[\u0000-\u0008\u000B\u000C\u000E-\u001F\u007F-\u009F\u00AD\u200B-\u200F\u2028\u2029\u202A-\u202E\u2060-\u2064\u2066-\u2069\uFEFF]/gu;function xe(t){return String(t??"").replace(ea,"")}function de(t){return Array.isArray(t)?t.map(a=>a===null||typeof a!="object"?a:{...a,name:xe(a.name)}):t}var ta={"a-share":"capital-watchlist-tag-cn","a-share-index":"capital-watchlist-tag-cn","fund-etf":"capital-watchlist-tag-cn","hk-stock":"capital-watchlist-tag-hk","hk-index":"capital-watchlist-tag-hk","us-stock":"capital-watchlist-tag-us","us-index":"capital-watchlist-tag-us"},mt=[{id:"all"},{id:"cn",label:"CN"},{id:"hk",label:"HK"},{id:"us",label:"US"}],st=t=>t.exchange==="HK"?"hk":t.exchange==="US"?"us":"cn",aa=`
9
9
  .capital-watchlist-dialog.capital-watchlist-dialog { width: min(420px, 92vw); max-height: 100%; padding: 0; gap: 0; border-radius: 18px; }
10
10
  .capital-watchlist-card { position: relative; display: flex; flex-direction: column; min-height: 0; overflow: hidden; border-radius: 18px; --capital-watchlist-up: #d1493f; --capital-watchlist-down: #17a063; --dsh-scrollbar-thumb: var(--dsw-alias-scrollbar-bg-l2); --dsh-scrollbar-thumb-hover: var(--dsw-alias-scrollbar-hover-l2); }
11
11
  .capital-watchlist-header { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 18px 20px 14px; }
@@ -187,21 +187,34 @@ window.__ModuleLoader__.load({
187
187
  .cwd-metavalue { font-size: 12px; line-height: 16px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
188
188
  .cwd-block { flex: none; padding-top: 12px; border-top: .5px solid var(--dsw-alias-border-l2); }
189
189
  .cwd-block-chart { flex: 1 1 0; display: flex; flex-direction: column; min-height: 200px; }
190
- /* Folded block keeps only its title row, so it stops competing for height. */
191
- .cwd-block-chart.cwd-folded { flex: none; min-height: 0; }
192
190
  .cwd-blockhead { display: flex; flex: none; align-items: baseline; gap: 12px; margin-bottom: 8px; }
193
191
  .cwd-blocktitle { flex: none; font-size: 12.5px; line-height: 18px; font-weight: 600; }
194
192
  .cwd-blocknote { margin-left: auto; font-size: 11px; line-height: 16px; color: var(--dsw-alias-label-tertiary); }
195
- .cwd-blockfold { flex: none; padding: 0 2px; border: 0; background: none; font-family: inherit; font-size: 11px; line-height: 16px; color: var(--dsw-alias-label-tertiary); cursor: pointer; }
196
- .cwd-blockfold:hover { color: var(--dsw-alias-label-primary); }
197
193
  .cwd-chart { flex: 1; min-height: 150px; display: grid; place-items: center; padding: 12px; border: 1px dashed var(--dsw-alias-border-l2); border-radius: 10px; background: repeating-linear-gradient(180deg, color-mix(in srgb, var(--dsw-alias-border-l2) 60%, transparent) 0 1px, transparent 1px 36px), var(--dsw-alias-bg-module-platform); text-align: center; }
198
194
  .cwd-charttext { font-size: 12.5px; line-height: 18px; font-weight: 500; color: var(--dsw-alias-label-secondary); }
199
195
  .cwd-charthint { margin-top: 4px; font-size: 11px; line-height: 16px; color: var(--dsw-alias-label-tertiary); }
200
- .cwd-trendstats { display: flex; flex: 1 1 auto; flex-wrap: wrap; gap: 2px 14px; min-width: 0; }
201
- .cwd-trendstat { display: flex; align-items: baseline; gap: 5px; font-size: 11px; line-height: 17px; }
196
+ .cwd-chartfail { border-style: solid; background: var(--dsw-alias-bg-module-platform); }
197
+ .cwd-chartfail .cwd-charttext { color: var(--dsw-alias-label-primary); }
198
+ .cwd-fallback { display: flex; flex-direction: column; align-items: center; gap: 2px; max-width: 360px; }
199
+ .cwd-retry { display: inline-flex; align-items: center; gap: 6px; flex: none; margin-top: 12px; height: 34px; padding: 0 14px; border: .5px solid color-mix(in srgb, var(--dsw-alias-state-business-primary) 38%, transparent); border-radius: 10px; background: color-mix(in srgb, var(--dsw-alias-state-business-primary) 12%, transparent); color: var(--dsw-alias-state-business-primary); font-family: inherit; font-size: 12.5px; line-height: 20px; font-weight: 500; cursor: pointer; }
200
+ .cwd-retry:hover { background: color-mix(in srgb, var(--dsw-alias-state-business-primary) 22%, transparent); }
201
+ .cwd-retry:active { background: color-mix(in srgb, var(--dsw-alias-state-business-primary) 30%, transparent); }
202
+ .cwd-retry:focus-visible { outline: 2px solid color-mix(in srgb, var(--dsw-alias-state-business-primary) 60%, transparent); outline-offset: 2px; }
203
+ .cwd-statsbox { position: relative; display: inline-flex; align-items: center; flex: none; align-self: center; }
204
+ .cwd-statsinfo { display: inline-flex; align-items: center; justify-content: center; width: 20px; height: 20px; padding: 0; border: 0; border-radius: 6px; background: none; color: var(--dsw-alias-label-tertiary); cursor: help; }
205
+ .cwd-statsinfo:hover, .cwd-statsinfo:focus-visible, .cwd-statsbox-pinned .cwd-statsinfo { color: var(--dsw-alias-label-primary); background: var(--dsw-alias-interactive-bg-hover-accent); }
206
+ .cwd-statsinfo:focus-visible { outline: 2px solid color-mix(in srgb, var(--dsw-alias-state-business-primary) 55%, transparent); outline-offset: 1px; }
207
+ /* The padding on the panel is the hover bridge: the card starts 8px below the icon without a dead
208
+ strip where the pointer would drop the hover. */
209
+ .cwd-statspanel { position: absolute; top: 100%; left: -10px; z-index: 8; padding-top: 8px; opacity: 0; visibility: hidden; transition: opacity .12s ease, visibility .12s ease; }
210
+ .cwd-statsbox:hover .cwd-statspanel, .cwd-statsbox:focus-within .cwd-statspanel, .cwd-statsbox-pinned .cwd-statspanel { opacity: 1; visibility: visible; }
211
+ .cwd-statscard { display: flex; flex-direction: column; gap: 7px; padding: 10px 14px; border: .5px solid var(--dsw-alias-border-l1); border-radius: 10px; background: var(--dsw-alias-bg-layer-2, var(--dsw-alias-bg-layer-1)); box-shadow: var(--dsw-elevation-prominent); }
212
+ .cwd-statscap { font-size: 10.5px; line-height: 14px; color: var(--dsw-alias-label-tertiary); white-space: nowrap; }
213
+ .cwd-statsgrid { display: grid; grid-template-columns: repeat(3, minmax(66px, auto)); gap: 7px 20px; }
214
+ .cwd-trendstat { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
202
215
  .cwd-trendstat span { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
203
- .cwd-trendstat span:first-child { flex: none; color: var(--dsw-alias-label-tertiary); }
204
- .cwd-trendstat span:last-child { font-variant-numeric: tabular-nums; }
216
+ .cwd-trendstat span:first-child { flex: none; font-size: 10.5px; line-height: 14px; color: var(--dsw-alias-label-tertiary); }
217
+ .cwd-trendstat span:last-child { font-size: 12px; line-height: 16px; font-weight: 500; color: var(--dsw-alias-label-primary); font-variant-numeric: tabular-nums; }
205
218
  .cwd-chartbox { position: relative; flex: 1; min-height: 120px; min-width: 0; overflow: hidden; border-radius: 10px; background: var(--dsw-alias-bg-module-platform); }
206
219
  /* The daily pane shares the SVG contract above (absolute child, determinate height): a flexed chart
207
220
  next to a scrolled column is exactly how the container used to grow. */
@@ -247,8 +260,8 @@ window.__ModuleLoader__.load({
247
260
  .cwd-skeleton { display: block; height: 12px; border-radius: 6px; background: var(--dsw-alias-bg-skeleton); }
248
261
  @media (max-width: 1040px) { .cwd-body { flex: none; grid-template-columns: minmax(0, 1fr); gap: 16px; height: auto; max-height: none; } .cwd-card { height: auto; } .cwd-tablebody { flex: none; max-height: 60vh; } .cwd-chart { flex: none; height: 200px; } .cwd-chartbox { flex: none; height: 260px; } .cwd-klinebox { flex: none; height: 260px; } .cwd-block-chart, .cwd-block-kline { flex: none; } }
249
262
  @media (max-width: 720px) { .cwd-inner { padding: 20px 16px 32px; } .cwd-thead, .cwd-row { grid-template-columns: minmax(0, 1.5fr) 78px 72px 36px; gap: 8px; } .cwd-thead { padding: 8px 10px; } .cwd-row { padding: 9px 10px; } }
250
- `;function ea(){let t=globalThis.document;if(!t||typeof t.createElement!="function"||t.querySelector(`style[data-${Je}]`))return;let a=t.createElement("style");a.setAttribute(`data-${Je}`,""),a.textContent=Jt;let i=t.head??t.body;if(!(i===void 0||typeof i.appendChild!="function"))return i.appendChild(a),()=>a.remove()}async function B(t,{query:a,body:i,signal:r}={}){let s=a!==void 0?`${Ze}${t}?${a}`:`${Ze}${t}`,u=i===void 0?{method:"GET",cache:"no-store",credentials:"same-origin",signal:r}:{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(i),credentials:"same-origin",signal:r},g=await fetch(s,u),c=await g.text(),d={};try{d=c.length>0?JSON.parse(c):{}}catch{d={}}if(g.ok===!0&&d.ok===!0)return d;let x=typeof d.code=="string"&&d.code.length>0?d.code:g.status===401||g.status===403?"unauthorized":"fuyao_unavailable",N=new Error(x);throw N.code=x,N.candidates=d.candidates,N.limit=d.limit,N}var tt=()=>({open:!1,loading:!1,refreshing:!1,searching:!1,items:[],candidates:[],truncated:!1,marketFilter:"all",query:"",dropdownOpen:!1,rowMenu:null,pendingRemove:null,refreshed_at:null,error:null,searchError:null,searchPartial:null,addError:null,loadError:null,failures:{},composing:!1,pendingSearch:!1}),Oe=class{constructor(){this.store=Lt(tt()),this.searchController=null,this.timer=null,this.pending=null,this.lastQuery=null,this.holdingOps=new Map}get state(){return this.store}get snapshot(){return this.store.getSnapshot()}patch(a){this.store.update(i=>Object.assign(i,a))}open(){this.patch({...tt(),open:!0,loading:!0}),this.load().then(()=>this.refresh(),()=>this.patch({loading:!1}))}close(){this.timer!==null&&clearTimeout(this.timer),this.searchController!==null&&this.searchController.abort(),this.lastQuery=null,this.patch({open:!1,rowMenu:null,composing:!1,pendingSearch:!1}),this.holdingOps.clear()}async load(){try{let a=await B("/list");this.holdingOps.clear(),this.patch({items:ce(a.items)??[],seeded_at:a.seeded_at,loading:!1,loadError:null})}catch(a){throw this.patch({loading:!1,loadError:{code:a.code??"fuyao_unavailable"}}),a}}refresh(){if(this.pending!==null)return this.pending;this.patch({refreshing:!0});let a=B("/refresh",{body:{}}).then(i=>{let r={};for(let g of i.failures??[])r[g.thscode]=g.code;let s=ce(i.items),u=s??this.snapshot.items;s!==null&&this.holdingOps.clear(),this.patch({items:u,refreshed_at:i.refreshed_at??this.snapshot.refreshed_at,failures:r,error:i.error?{code:i.error.code,partial:u.length>0&&u.some(g=>r[g.thscode]===void 0)}:null})}).catch(i=>{this.patch({error:{code:i.code??"fuyao_unavailable",partial:this.snapshot.items.some(r=>r.quote!==null)}})}).finally(()=>{this.patch({refreshing:!1}),this.pending=null});return this.pending=a,a}onQueryChange(a,i){let r=a.trim(),s=i===void 0?this.snapshot.composing===!0:i===!0;if(this.patch({query:a,searchError:null,composing:s,dropdownOpen:r.length>0}),this.timer!==null&&clearTimeout(this.timer),r.length===0){this.searchController!==null&&this.searchController.abort(),this.lastQuery=null,this.patch({candidates:[],truncated:!1,searching:!1,pendingSearch:!1});return}r===this.lastQuery&&this.snapshot.pendingSearch===!1||(this.patch({candidates:[],truncated:!1,pendingSearch:!s}),s!==!0&&(this.timer=setTimeout(()=>this.search(r),Bt)))}beginComposition(){this.timer!==null&&clearTimeout(this.timer),this.patch({composing:!0})}endComposition(a){this.onQueryChange(a,!1)}hideDropdown(){this.patch({dropdownOpen:!1})}setMarketFilter(a){ut.some(i=>i.id===a)&&this.patch({marketFilter:a})}toggleRowMenu(a){this.patch({rowMenu:this.snapshot.rowMenu===a?null:a})}closeRowMenu(){this.snapshot.rowMenu!==null&&this.patch({rowMenu:null})}setPendingRemove(a){this.patch({pendingRemove:a??null})}replaceRow(a){let[i]=ce([a]);i===void 0||typeof i?.thscode!="string"||this.patch({items:this.snapshot.items.map(r=>r.thscode===i.thscode?i:r)})}async search(a){this.lastQuery=a,this.searchController!==null&&this.searchController.abort();let i=new AbortController;this.searchController=i,this.patch({searching:!0,searchError:null,searchPartial:null});let r=()=>this.snapshot.query.trim()===a;try{let s=await B("/search",{query:`q=${encodeURIComponent(a)}`,signal:i.signal});if(!r()){this.patch({searching:!1});return}this.patch({candidates:ce(s.items)??[],truncated:s.truncated===!0,searching:!1,pendingSearch:!1,searchPartial:Array.isArray(s.partial)&&s.partial.length>0?s.partial:null})}catch(s){if(s.name==="AbortError"||(this.lastQuery===a&&(this.lastQuery=null),!r()))return;this.patch({candidates:[],truncated:!1,searching:!1,pendingSearch:!1,searchError:{code:s.code??"fuyao_unavailable"},searchPartial:null})}}async add(a){try{await B("/add",{body:{thscode:a.thscode}})}catch(r){this.patch({addError:{code:r.code??"fuyao_unavailable",candidates:r.candidates,limit:r.limit}}),r.candidates!==void 0&&this.patch({candidates:r.candidates,truncated:!1});return}this.patch({addError:null,candidates:this.snapshot.candidates.map(r=>r.thscode===a.thscode?{...r,in_list:!0}:r)}),await this.load().catch(()=>{}),await this.refresh();let i=this.snapshot.items.find(r=>r.thscode===a.thscode);i!==void 0&&i.quote===null&&this.snapshot.failures[a.thscode]===void 0&&await this.refresh()}async remove(a){let i=this.snapshot.items;this.patch({items:i.filter(r=>r.thscode!==a),rowMenu:null});try{await B("/remove",{body:{thscode:a}}),this.snapshot.addError?.code==="list_full"&&this.patch({addError:null})}catch{this.patch({items:i})}}async pin(a){let i=this.snapshot.items,r=i.find(s=>s.thscode===a);if(r!==void 0){this.patch({items:[r,...i.filter(s=>s.thscode!==a)],rowMenu:null});try{let s=await B("/pin",{body:{thscode:a}});Array.isArray(s.items)&&this.patch({items:ce(s.items)})}catch{let s=this.snapshot.items,u=i.map(c=>s.find(d=>d.thscode===c.thscode)).filter(Boolean),g=new Set(u.map(c=>c.thscode));this.patch({items:[...u,...s.filter(c=>!g.has(c.thscode))]})}}}async writeHolding(a,i,r){let s=this.snapshot.items.find(d=>d.thscode===a);if(s===void 0)return;let u=this.holdingOps.get(a)??{seq:0,baseline:s};this.holdingOps.set(a,u);let g=++u.seq;this.patch({items:this.snapshot.items.map(d=>d.thscode===a?r(d):d)});let c=()=>this.holdingOps.get(a)!==u||u.seq!==g;try{let d=await B("/holding",{body:i});if(c())return;this.replaceRow(d.item),u.baseline=d.item??r(s),this.holdingOps.delete(a)}catch{if(c())return;this.replaceRow(u.baseline),this.holdingOps.delete(a)}}markHolding(a,i){return this.writeHolding(a,{thscode:a,weight_pct:i},r=>({...r,holding:{weight_pct:i,marked_at:Date.now()}}))}clearHolding(a){return this.writeHolding(a,{thscode:a,clear:!0},i=>{let r={...i};return delete r.holding,r})}stepHolding(a,i){let r=this.snapshot.items,s=r.find(g=>g.thscode===a)?.holding?.weight_pct;if(typeof s!="number"&&i<0)return;let u=Math.min(pt(r,a),Math.max(0,(typeof s=="number"?s:0)+i));if(u!==s)return this.markHolding(a,u)}async copyToClipboard(){let a=this.snapshot.items.map(i=>[i.thscode,xe(i.name),i.asset_type,i.quote?.price??"",i.quote?.change_pct??"",i.quote?.captured_at??""].join(" ")).join(`
251
- `);return await navigator.clipboard.writeText(a),a}dispose(){this.timer!==null&&clearTimeout(this.timer),this.searchController!==null&&this.searchController.abort()}};function $e(t){if(typeof t!="number"||!Number.isFinite(t))return"";let a=new Date(t),i=r=>String(r).padStart(2,"0");return`${i(a.getMonth()+1)}-${i(a.getDate())} ${i(a.getHours())}:${i(a.getMinutes())}`}function Se({assetType:t,t:a}){return e("span",{className:`capital-watchlist-tag ${Zt[t]??"capital-watchlist-tag-cn"}`},ht(t,a))}function ta(t,a,i){let r=xe(t.name);return`${a(`${i}PromptPrefix`)}${r} (${t.thscode} \xB7 ${Vt(t.asset_type,a)})${a(`${i}PromptSuffix`)}`}function aa({quote:t,failureCode:a,refreshing:i,t:r}){let s=a!==void 0;if(t==null)return i===!0?e("div",{className:"capital-watchlist-quote"},e("span",{className:"capital-watchlist-skeleton capital-watchlist-skeleton-price"}),e("span",{className:"capital-watchlist-skeleton capital-watchlist-skeleton-change"})):s?e("div",{className:"capital-watchlist-quote",title:r(`error.${a}`)},e("div",{className:"capital-watchlist-price capital-watchlist-quotefailed"},"\u2014")):e("div",{className:"capital-watchlist-quote"},e("div",{className:"capital-watchlist-price"},r("notRefreshed")));let u=typeof t.change_pct=="number"&&Number.isFinite(t.change_pct),g=u?`${t.change_pct>0?"+":""}${t.change_pct.toFixed(2)}%`:"\u2014",c=s?"capital-watchlist-stale":u?t.change_pct>0?"capital-watchlist-up":t.change_pct<0?"capital-watchlist-down":"capital-watchlist-flat":"capital-watchlist-nodata",d=typeof t.source_time=="string"&&t.source_time.length>0?`${r("exchangeTime")} ${t.source_time}`:"",x=[];return s?x.push(`${r(`error.${a}`)} \xB7 ${r("stale")} ${$e(t.captured_at)}`):u||x.push(r("noChangePct")),d.length>0&&x.push(d),e("div",{className:"capital-watchlist-quote",title:x.length===0?void 0:x.join(" \xB7 ")},e("div",{className:s?"capital-watchlist-price capital-watchlist-stale":"capital-watchlist-price"},t.price.toFixed(2)),e("div",{className:`capital-watchlist-change ${c}`},g))}function ia(t,a){if(a.code!=="list_full")return t(`error.${a.code}`);let i=a.limit;return typeof i!="number"||!Number.isFinite(i)?t("error.list_full_noMax"):t("error.list_full").replace("{max}",String(i))}function sa(t,a){let i=t?.weight_pct;return i==null?a("holdingName"):`${a("holdingName")} ${i}%`}function la(t,a){let i=`${t.name} ${t.ticker}`;return t.holding===null||t.holding===void 0?i:`${i} \xB7 ${sa(t.holding,a)}`}function na({useDialog:t,surface:a,t:i,inputActions:r}){let s=t(n=>n),[u,g]=A(!1),[c,d]=A(null),x=s.pendingRemove??null;if(ge(()=>()=>a.dispose(),[a]),!s.open)return null;let N=s.dropdownOpen===!0,$=x!==null,D=n=>{if(n.key==="Escape"){if($){n.stopPropagation(),a.setPendingRemove(null);return}N&&(n.stopPropagation(),a.hideDropdown())}},v=n=>{if(!N)return;let C=n.relatedTarget;C!=null&&n.currentTarget?.contains?.(C)===!0||a.hideDropdown()},I=s.error,P=I==null?null:e("p",{className:"capital-watchlist-notice",role:"alert","data-code":I.code},`${i(`error.${I.code}`)}${I.partial===!0?i("errorSuffix"):""}`),G=(n,C)=>{r.insertText(ta(n,i,C),r.captureInsertion())===!0&&a.close()},E=s.marketFilter==="all"?s.candidates:s.candidates.filter(n=>et(n)===s.marketFilter),z={all:s.candidates.length,cn:0,hk:0,us:0};for(let n of s.candidates)z[et(n)]+=1;let Y=s.candidates.length===0?null:e("div",{className:"capital-watchlist-filter",role:"group","aria-label":i("filterLabel")},ut.map(n=>e("button",{key:n.id,type:"button",className:"capital-watchlist-filterbtn","aria-pressed":s.marketFilter===n.id,onClick:()=>a.setMarketFilter(n.id)},e("span",{className:"capital-watchlist-filterlabel"},n.id==="all"?i("filterAll"):n.label),e("span",{className:"capital-watchlist-filtercount"},String(z[n.id]))))),te=N?e("div",{className:"capital-watchlist-dropdown","aria-label":i("title"),"data-menu-material":"translucent"},Y,e("div",{className:"capital-watchlist-options",role:"listbox","aria-label":i("title")},E.map(n=>e("button",{key:n.thscode,type:"button",role:"option",className:"capital-watchlist-option",title:n.name,"aria-disabled":n.in_list===!0||c===n.thscode,onClick:()=>{n.in_list===!0||c===n.thscode||(g(!0),d(n.thscode),a.add(n).finally(()=>{g(!1),d(null)}))}},e("span",{className:"capital-watchlist-optionmain"},e("span",{className:"capital-watchlist-optionname"},n.name),e("span",{className:"capital-watchlist-codeline"},e("span",{className:"capital-watchlist-optioncode"},n.thscode),e(Se,{assetType:n.asset_type,t:i}))),e("span",{className:"capital-watchlist-addbtn","data-state":n.in_list===!0?"added":"idle"},n.in_list===!0?i("added"):i("add")))),s.truncated===!0&&E.length>0?e("div",{className:"capital-watchlist-hint capital-watchlist-endhint"},i("truncated")):null),s.composing===!0?e("div",{className:"capital-watchlist-hint"},i("composingHint")):s.searching===!0||s.pendingSearch===!0?e("div",{className:"capital-watchlist-hint"},i("searching")):s.searchError!==null&&s.searchError!==void 0?e("div",{className:"capital-watchlist-hint capital-watchlist-searcherror",role:"alert","data-code":s.searchError.code},i(`error.${s.searchError.code}`)):s.candidates.length===0?e("div",{className:"capital-watchlist-hint"},i("noHit")):E.length===0?e("div",{className:"capital-watchlist-hint","data-filter":s.marketFilter},i("filterNoHit")):null,...(s.searchPartial??[]).map(n=>e("div",{key:`partial-${n.market}`,className:"capital-watchlist-hint capital-watchlist-searcherror",role:"status","data-market":n.market,"data-code":n.code},`${i(`partial.${n.market}`)}${i(`error.${n.code}`)}`))):null,ae=s.items.length===0?null:e("div",{className:"capital-watchlist-grid capital-watchlist-head"},e("span",null,i("colName")),e("span",{className:"capital-watchlist-quote"},i("colQuote")),e("span",{className:"capital-watchlist-headaction"},i("colAction"))),V=s.loadError!==null&&s.loadError!==void 0?e("p",{className:"capital-watchlist-empty capital-watchlist-loaderror",role:"alert","data-code":s.loadError.code},i(`error.${s.loadError.code}`)):e("p",{className:"capital-watchlist-empty"},i("empty")),L=s.loading?e("p",{className:"capital-watchlist-empty"},i("loading")):s.items.length===0?V:e("div",{className:N?"capital-watchlist-list capital-watchlist-list-open":"capital-watchlist-list"},s.items.map((n,C)=>{let R=n.holding!==null&&n.holding!==void 0,k=n.holding?.weight_pct,H=Ve(n)||R,W=pt(s.items,n.thscode),T=!R||k===null||k===void 0||k<=0,K=(typeof k=="number"?k:0)+ze>W;return e("div",{key:n.thscode,className:"capital-watchlist-grid capital-watchlist-row","data-thscode":n.thscode},e("span",{className:"capital-watchlist-namewrap"},e("span",{className:R?"capital-watchlist-name capital-watchlist-name-held":"capital-watchlist-name",title:la(n,i)},n.name),e("span",{className:"capital-watchlist-codeline"},e("span",{className:"capital-watchlist-code"},n.ticker),e(Se,{assetType:n.asset_type,t:i}))),e(aa,{quote:n.quote,failureCode:s.failures[n.thscode],refreshing:s.refreshing,t:i}),e("span",{className:"capital-watchlist-rowactions"},e("button",{type:"button",className:"capital-watchlist-predict",disabled:u,title:i("predictTip"),"aria-label":`${i("predict")} ${n.name}`,onClick:()=>G(n,"predict")},e(rt,{size:14})),e("button",{type:"button",className:"capital-watchlist-review",disabled:u,title:i("reviewTip"),"aria-label":`${i("review")} ${n.name}`,onClick:()=>G(n,"review")},e(jt,{size:14})),e(Fe,{open:s.rowMenu===n.thscode,anchor:e("button",{type:"button",className:"capital-watchlist-more",disabled:u,title:i("more"),"aria-label":`${i("more")} ${n.name}`,"aria-haspopup":"menu","aria-expanded":s.rowMenu===n.thscode,onClick:()=>a.toggleRowMenu(n.thscode)},e(nt,{size:14})),items:[{id:"pin",label:i("pin"),icon:e(ot,{size:14}),disabled:C===0}],children:[...H?[e("div",{key:"holding-check",role:"group","aria-label":i("holdingName"),className:"capital-watchlist-checkrow"},e("span",{className:"capital-watchlist-checkicon","aria-hidden":"true"},e(Ut,{size:14})),e("span",{className:"capital-watchlist-checklabel"},i("holdingName")),e(Gt,{checked:R,disabled:u,label:i("holdingName"),onChange:j=>j?a.markHolding(n.thscode,null):a.clearHolding(n.thscode)}))]:[],...R&&Ve(n)?[e("div",{key:"holding-step",className:"capital-watchlist-stepper",role:"group","aria-label":i("holdingStepper")},e("span",{className:"capital-watchlist-stepperlabel"},i("holdingWeightLabel")),e("span",{className:"capital-watchlist-stepperline"},e("button",{type:"button",className:"capital-watchlist-stepperbtn","aria-label":i("holdingStepDown"),disabled:T,onClick:()=>a.stepHolding(n.thscode,-ze)},"\u2212"),e("span",{className:typeof k=="number"?"capital-watchlist-stepperreadout":"capital-watchlist-stepperreadout capital-watchlist-stepperplaceholder",role:"status"},typeof k=="number"?`${k}%`:`0~${W}`),e("button",{type:"button",className:"capital-watchlist-stepperbtn","aria-label":i("holdingStepUp"),title:`0~${W}`,disabled:K,onClick:()=>a.stepHolding(n.thscode,ze)},"+")))]:[],e(Ne,{key:"remove",danger:!0,separatorBefore:!0,icon:e(Re,{size:14}),onSelect:()=>{a.closeRowMenu(),a.setPendingRemove(n)}},i("remove"))],onSelect:j=>{j==="pin"&&(a.closeRowMenu(),a.pin(n.thscode))},onClose:()=>a.closeRowMenu(),align:"end",portal:!0,listClassName:"capital-watchlist-rows",className:"capital-watchlist-actions"})))})),U=e("div",{className:$?"capital-watchlist-confirm capital-watchlist-confirm-open":"capital-watchlist-confirm","aria-hidden":$?void 0:"true"},e("div",{className:"capital-watchlist-confirmbox",role:$?"alertdialog":void 0,"aria-label":i("confirmTitle")},e("div",{className:"capital-watchlist-confirmtitle"},i("confirmTitle")),$?e("p",{className:"capital-watchlist-confirmdesc"},i("confirmDescPrefix"),e("strong",null,`${x.name} \xB7 ${x.ticker}`),i("confirmDescSuffix")):null,e("div",{className:"capital-watchlist-confirmactions"},e("button",{type:"button",className:"capital-watchlist-confirmbtn",onClick:()=>a.setPendingRemove(null)},i("confirmCancel")),e("button",{type:"button",className:"capital-watchlist-confirmbtn capital-watchlist-confirmdanger",onClick:()=>{let n=x;a.setPendingRemove(null),n!==null&&a.remove(n.thscode)}},i("confirmOk")))));return e(Dt,{open:!0,onClose:()=>a.close(),title:i("title"),headless:!0,shortcutModal:"watchlist",className:"capital-watchlist-dialog"},e("div",{className:"capital-watchlist-card",onKeyDown:D},e("div",{className:"capital-watchlist-header"},e("h2",{className:"capital-watchlist-title"},i("title")),e("button",{type:"button",className:"capital-watchlist-close","aria-label":i("close"),onClick:()=>a.close()},e(Ye,{size:14}))),e("div",{className:"capital-watchlist-search",onBlur:v},e("div",{className:"capital-watchlist-field"},e("span",{className:"capital-watchlist-searchicon"},e(dt,{size:16})),e("input",{className:"capital-watchlist-input","data-modal-autofocus":!0,value:s.query,placeholder:i("searchPlaceholder"),onChange:n=>a.onQueryChange(n.target.value,n.isComposing),onCompositionStart:()=>a.beginComposition(),onCompositionEnd:n=>a.endComposition(n.target.value)}),s.query.length>0?e("button",{type:"button",className:"capital-watchlist-clear",title:i("clearInput"),"aria-label":i("clearInput"),onMouseDown:n=>n.preventDefault(),onClick:()=>a.onQueryChange("",!1)},e(Ye,{size:12})):null),te),s.addError!==null&&s.addError!==void 0?e("p",{className:"capital-watchlist-adderror",role:"status","data-code":s.addError.code},ia(i,s.addError)):null,ae,L,e("div",{className:"capital-watchlist-footer"},e("div",{className:"capital-watchlist-footcol"},e("button",{type:"button",className:"capital-watchlist-refresh",disabled:s.refreshing||u,onClick:()=>{a.refresh()}},e(ct,{size:14}),s.refreshing?i("refreshing"):i("refresh")),P),e("span",{className:"capital-watchlist-updated"},`${i("updated")} ${s.refreshed_at===null||s.refreshed_at===void 0?i("notRefreshed"):$e(s.refreshed_at)}`)),U))}var at=`${he}:desk`,wt="capital.watchlist.desk.groups.v1",le="__all__",He=0,Pe=0;function ra(){let t={names:[],assignments:{}};try{let a=JSON.parse(localStorage.getItem(wt)??"{}");return a===null||typeof a!="object"||!Array.isArray(a.names)||a.assignments===null||typeof a.assignments!="object"?t:{names:a.names.filter(i=>typeof i=="string"&&i.length>0).slice(0,20),assignments:a.assignments}}catch{return t}}function oa(t){try{localStorage.setItem(wt,JSON.stringify(t))}catch{}}var Ee=(t,a)=>{let i=t.assignments[a];return Array.isArray(i)?i:[]},it=t=>t!=null&&typeof t.change_pct=="number"&&Number.isFinite(t.change_pct)?t.change_pct:null,Ie=t=>t===null?"cwd-flat":t>0?"cwd-up":t<0?"cwd-down":"cwd-flat",_e=t=>t===null?"\u2014":`${t>0?"+":""}${t.toFixed(2)}%`,mt=new Intl.NumberFormat("en-US",{minimumFractionDigits:2,maximumFractionDigits:2}),st=t=>t!=null&&typeof t.price=="number"&&Number.isFinite(t.price)?mt.format(t.price):"\u2014",F=t=>typeof t=="number"&&Number.isFinite(t)?mt.format(t):"\u2014";function Ue(t,a=2){if(typeof t!="number"||!Number.isFinite(t))return"\u2014";let i=Math.abs(t);return i>=1e8?`${(t/1e8).toFixed(a)}\u4EBF`:i>=1e4?`${(t/1e4).toFixed(a)}\u4E07`:new Intl.NumberFormat("en-US",{maximumFractionDigits:a}).format(t)}var ca=t=>typeof t=="string"&&t.length>=5?Number(t.slice(0,2))*60+Number(t.slice(3,5)):0;function je(t,a,i){let r=Ue(t);return r==="\u2014"?r:a==="lot"?`${r}${i("desk.lot")}`:a==="share"?`${r}${i("desk.share")}`:r}function da(t,a){let i=Ue(t);return i==="\u2014"||a==null||a==="CNY"?i:`${i} ${a}`}var lt={"a-share":[[570,690],[780,900]],hk:[[570,720],[780,960]],us:[[570,960]]},pa=t=>`${String(Math.floor(t/60)).padStart(2,"0")}:${String(t%60).padStart(2,"0")}`;function ha(t){let a=[],i=0;for(let[r,s]of lt[t]??lt.us)a.push([r,s,i]),i+=s-r;return{spans:a,total:i}}function ua(t,a){for(let[i,r,s]of t.spans){if(a<=i)return s;if(a<r)return s+a-i}return t.total}function wa(t){let a=[];for(let[i,r,s]of t.spans)for(let u=i;u<=r;u+=30){let g=s+u-i;(a.length===0||a[a.length-1].slot!==g)&&a.push({time:pa(u),slot:g})}return a}function ma({data:t,t:a}){let[i,r]=A({width:720,height:300}),[s,u]=A(null),g=Le(null);ge(()=>{let h=g.current;if(h==null)return;let p=()=>{let q=h.getBoundingClientRect();if(!(q.width>0)||!(q.height>0))return;let J=Math.max(280,Math.round(q.width)),we=Math.max(180,Math.round(q.height));r(be=>Math.abs(be.width-J)<2&&Math.abs(be.height-we)<2?be:{width:J,height:we})};if(p(),typeof ResizeObserver>"u")return;let Q=new ResizeObserver(p);return Q.observe(h),()=>Q.disconnect()},[]);let c=t.points,d=t.prev_close,x=i.width,N=i.height,$=66,D=54,v=12,I=18,P=Math.round(Math.min(70,Math.max(30,N*.22))),G=Math.max(60,N-v-I-P-10),E=Math.max(60,x-$-D),z=ha(t.market),Y=E/z.total,te=c.map(h=>h[1]),ae=Math.min(d,...te),V=Math.max(d,...te),L=(V-ae)*.06||Math.max(V*.002,.01),U=ae-L,n=V+L,C=h=>v+(n-h)/(n-U)*G,R=c.map(h=>ua(z,ca(h[0]))),k=h=>$+h*Y,H=k(R[0]).toFixed(1),W=k(R[c.length-1]).toFixed(1),T=t.last===null||t.last>=d?"up":"down",K=T==="up"?"var(--capital-watchlist-up)":"var(--capital-watchlist-down)",j=c.map((h,p)=>`${p===0?"M":"L"}${k(R[p]).toFixed(1)} ${C(h[1]).toFixed(1)}`).join(""),ue=(v+G).toFixed(1),b=`${j}L${W} ${ue}L${H} ${ue}Z`,ie=c.reduce((h,p,Q)=>p[2]===null?h:`${h}${h===""?"M":"L"}${k(R[Q]).toFixed(1)} ${C(p[2]).toFixed(1)}`,""),X=v+G+10,ee=Math.max(1,...c.map(h=>h[3]??0)),se=Math.max(1,Math.min(10,Y*.72)),ne=C(d),ye=[0,1,2,3,4].map(h=>{let p=U+(n-U)*h/4;return{value:p,y:C(p),pct:(p-d)/d*100}}).filter(h=>Math.abs(h.y-ne)>9),de=z.spans.length>1?z.spans[1][2]:null,o=wa(z),y=x>=620?1:2,O=o.filter((h,p)=>p%y===0||p===o.length-1),S=s===null||s<0||s>=c.length?null:c[s],Z=S===null?0:k(R[s]),M=S===null?0:C(S[1]),pe=Math.min(x-172,Math.max(8,Z+12)),ve=`${t.thscode} ${t.session_date??""} ${a("desk.intraday")} \xB7 ${a("desk.trendOpen")} ${F(t.open)} \xB7 ${a("desk.trendHigh")} ${F(t.high)} \xB7 ${a("desk.trendLow")} ${F(t.low)} \xB7 ${a("desk.trendAvg")} ${F(t.avg)}`,Ce=h=>{let p=h.currentTarget.getBoundingClientRect();if(!(p.width>0))return;let Q=Math.max(0,Math.min(z.total,(h.clientX-p.left-$)/E*z.total)),q=0;for(let J=1;J<R.length;J+=1)Math.abs(R[J]-Q)<Math.abs(R[q]-Q)&&(q=J);u(q)};return e("div",{className:"cwd-chartbox",ref:g},e("svg",{className:"cwd-chartsvg",viewBox:`0 0 ${x} ${N}`,role:"img","aria-label":ve,onPointerMove:Ce,onPointerLeave:()=>u(null)},e("defs",null,e("linearGradient",{id:"cwd-trend-fill",x1:"0",y1:"0",x2:"0",y2:"1"},e("stop",{offset:"0%",style:{stopColor:K,stopOpacity:.2}}),e("stop",{offset:"100%",style:{stopColor:K,stopOpacity:0}}))),ye.map(h=>e("g",{key:`grid-${h.value.toFixed(4)}`},e("line",{className:"cwd-chartgrid",x1:$,x2:$+E,y1:h.y,y2:h.y}),e("text",{className:"cwd-chartaxis",x:$-8,y:h.y+3.5,textAnchor:"end"},F(h.value)),e("text",{className:"cwd-chartaxis",x:$+E+8,y:h.y+3.5},`${h.pct>0?"+":""}${h.pct.toFixed(2)}%`))),O.map(h=>e("line",{key:`grid-${h.time}`,className:"cwd-chartgrid",x1:k(h.slot),x2:k(h.slot),y1:v,y2:X+P})),de===null?null:e("line",{className:"cwd-chartsep",x1:k(de),x2:k(de),y1:v,y2:X+P}),e("path",{className:"cwd-chartarea",d:b,fill:"url(#cwd-trend-fill)"}),c.map((h,p)=>{let Q=h[3]??0,q=Math.max(0,Q/ee*P),J=p===0?d:c[p-1][1],we=k(R[p]+.5);return e("rect",{key:`vol-${p}`,className:h[1]>=J?"cwd-vol-up":"cwd-vol-down",x:Math.min($+E-se,Math.max($,we-se/2)).toFixed(1),y:(X+P-q).toFixed(1),width:se.toFixed(1),height:Math.max(.5,q).toFixed(1)})}),e("path",{className:"cwd-chartline",d:j,style:{stroke:K}}),ie===""?null:e("path",{className:"cwd-chartavg",d:ie}),e("line",{className:"cwd-chartbase",x1:$,x2:$+E,y1:ne,y2:ne,strokeDasharray:"4 3"}),e("text",{className:"cwd-chartaxis cwd-chartbaselabel",x:$-8,y:ne+3.5,textAnchor:"end"},F(d)),O.map(h=>e("text",{key:`tick-${h.time}`,className:"cwd-chartaxis",x:k(h.slot),y:N-5,textAnchor:h.slot===0?"start":h.slot>=z.total?"end":"middle"},h.time)),S===null?null:e("g",null,e("line",{className:"cwd-chartcross",x1:Z,x2:Z,y1:v,y2:X+P}),e("line",{className:"cwd-chartcross",x1:$,x2:$+E,y1:M,y2:M}),e("circle",{className:`cwd-chartdot ${T==="up"?"cwd-up":"cwd-down"}`,cx:Z,cy:M,r:3}))),S===null?null:e("div",{className:"cwd-charttip",style:{left:`${pe}px`}},e("div",{className:"cwd-charttiptime"},S[0]),e("div",{className:`cwd-charttipprice ${T==="up"?"cwd-up":"cwd-down"}`},`${F(S[1])} ${_e((S[1]-d)/d*100)}`),S[2]===null?null:e("div",{className:"cwd-charttiprow"},e("span",null,a("desk.trendAvg")),e("span",null,F(S[2]))),S[3]===null?null:e("div",{className:"cwd-charttiprow"},e("span",null,a("desk.trendVolume")),e("span",null,je(S[3],t.volume_unit,a)))))}function ft(t,a){let i=new Array(t.length).fill(null),r=0;for(let s=0;s<t.length;s+=1)r+=t[s].close,s>=a&&(r-=t[s-a].close),s>=a-1&&(i[s]=r/a);return i}var gt=[5,10,20,60];function fa({data:t,t:a}){let[i,r]=A({width:720,height:300}),[s,u]=A(null),g=Le(null);ge(()=>{let o=g.current;if(o==null)return;let y=()=>{let S=o.getBoundingClientRect();if(!(S.width>0)||!(S.height>0))return;let Z=Math.max(280,Math.round(S.width)),M=Math.max(180,Math.round(S.height));r(pe=>Math.abs(pe.width-Z)<2&&Math.abs(pe.height-M)<2?pe:{width:Z,height:M})};if(y(),typeof ResizeObserver>"u")return;let O=new ResizeObserver(y);return O.observe(o),()=>O.disconnect()},[]);let c=t.bars,d=i.width,x=i.height,N=66,$=54,D=10,v=18,I=Math.round(Math.min(64,Math.max(28,x*.2))),P=Math.max(60,x-D-v-I-12),G=Math.max(60,d-N-$),E=G/Math.max(1,c.length),z=Math.max(1,Math.min(14,E*.62)),Y=Math.max(...c.map(o=>o.high)),te=Math.min(...c.map(o=>o.low)),ae=(Y-te)*.06||Math.max(Y*.01,.01),V=Y+ae,L=te-ae,U=o=>D+(V-o)/(V-L)*P,n=o=>N+(o+.5)*E,C=D+P+12,R=Math.max(1,...c.map(o=>o.volume)),k=o=>o/R*I,H=gt.map(o=>({window:o,values:ft(c,o)})),W=o=>o.reduce((y,O,S)=>O===null?y:`${y}${y===""?"M":"L"}${n(S).toFixed(1)} ${U(O).toFixed(1)}`,""),T=[];for(let o=0;o<c.length;o+=1){let y=c[o].date.slice(5,7);(o===0||y!==c[o-1].date.slice(5,7))&&T.push({index:o,month:y})}let K=T.length>1?(T[1].index-T[0].index)*E:Number.POSITIVE_INFINITY,j=T.map((o,y)=>({index:o.index,label:y===0&&K>=56?`${c[o.index].date.slice(0,4)}/${o.month}`:o.month})),ue=[0,1,2,3,4].map(o=>{let y=V-(V-L)*o/4;return{value:y,y:U(y)}}),b=s===null||s<0||s>=c.length?null:c[s],ie=b===null?0:n(s),X=b===null?0:U(b.close),ee=s===null||s<=0?null:c[s-1].close,se=b===null||ee===null||ee<=0?null:(b.close-ee)/ee*100,ne=Math.min(d-186,Math.max(8,ie+12)),ye=`${t.thscode} ${a("desk.daily")} \xB7 ${c.length} \xB7 ${F(c[c.length-1].close)}`,de=o=>{let y=o.currentTarget.getBoundingClientRect();if(!(y.width>0))return;let O=Math.round((o.clientX-y.left-N)/E-.5);u(Math.max(0,Math.min(c.length-1,O)))};return e("div",{className:"cwd-klinebox",ref:g},e("svg",{className:"cwd-chartsvg",viewBox:`0 0 ${d} ${x}`,role:"img","aria-label":ye,onPointerMove:de,onPointerLeave:()=>u(null)},ue.map(o=>e("g",{key:`grid-${o.value.toFixed(4)}`},e("line",{className:"cwd-chartgrid",x1:N,x2:N+G,y1:o.y,y2:o.y}),e("text",{className:"cwd-chartaxis",x:N-8,y:o.y+3.5,textAnchor:"end"},F(o.value)))),j.map(o=>e("g",{key:`tick-${o.index}`},e("line",{className:"cwd-chartgrid",x1:n(o.index),x2:n(o.index),y1:D,y2:C+I}),e("text",{className:"cwd-chartaxis",x:n(o.index),y:x-5,textAnchor:o.index===0?"start":"middle"},o.label))),c.map((o,y)=>{let O=Math.max(.5,k(o.volume));return e("rect",{key:`vol-${o.date}`,className:o.close>=o.open?"cwd-vol-up":"cwd-vol-down",x:(n(y)-z/2).toFixed(1),y:(C+I-O).toFixed(1),width:z.toFixed(1),height:O.toFixed(1)})}),e("text",{className:"cwd-chartaxis",x:N-8,y:C+8,textAnchor:"end"},Ue(R)),c.map((o,y)=>{let O=U(o.open),S=U(o.close),Z=Math.min(O,S),M=Math.max(.8,Math.abs(S-O));return e("g",{key:`bar-${o.date}`,className:o.close>=o.open?"cwd-candle-up":"cwd-candle-down"},e("line",{x1:n(y).toFixed(1),x2:n(y).toFixed(1),y1:U(o.high).toFixed(1),y2:U(o.low).toFixed(1)}),e("rect",{x:(n(y)-z/2).toFixed(1),y:Z.toFixed(1),width:z.toFixed(1),height:M.toFixed(1)}))}),H.map(o=>{let y=W(o.values);return y===""?null:e("path",{key:`ma-${o.window}`,className:`cwd-maline cwd-ma${o.window}`,d:y})}),b===null?null:e("g",null,e("line",{className:"cwd-chartcross",x1:ie,x2:ie,y1:D,y2:C+I}),e("line",{className:"cwd-chartcross",x1:N,x2:N+G,y1:X,y2:X}))),b===null?null:e("div",{className:"cwd-charttip",style:{left:`${ne}px`}},e("div",{className:"cwd-charttiptime"},b.date),e("div",{className:`cwd-charttipprice ${Ie(se)}`},`${F(b.close)} ${_e(se)}`),e("div",{className:"cwd-charttiprow"},e("span",null,a("desk.kOpen")),e("span",null,F(b.open)),e("span",null,a("desk.kHigh")),e("span",null,F(b.high))),e("div",{className:"cwd-charttiprow"},e("span",null,a("desk.kLow")),e("span",null,F(b.low)),e("span",null,a("desk.kClose")),e("span",null,F(b.close))),e("div",{className:"cwd-charttiprow"},e("span",null,a("desk.trendVolume")),e("span",null,je(b.volume,t.volume_unit,a)))))}function ga({size:t=18}){return e("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.8,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true"},e("path",{d:"M4 19V5"}),e("path",{d:"M4 19h16"}),e("path",{d:"m7 15 3-4 3 2 5-7"}),e("circle",{cx:18,cy:6,r:1.4,fill:"currentColor",stroke:"none"}))}function xa({t}){let[a,i]=A([]),[r,s]=A(!0),[u,g]=A(!1),[c,d]=A(null),[x,N]=A({}),[$,D]=A(null),[v,I]=A(ra),[P,G]=A(le),[E,z]=A(!1),[Y,te]=A(""),[ae,V]=A(""),[L,U]=A(null),[n,C]=A(null),[R,k]=A(null),[H,W]=A({status:"idle",data:null,code:null}),[T,K]=A({status:"idle",data:null,code:null}),[j,ue]=A(!1),b=Le(!0);ge(()=>(b.current=!0,()=>{b.current=!1}),[]),ge(()=>{oa(v)},[v]);let ie=l=>{let m=ce(l.items);Array.isArray(m)&&i(m);let f={};for(let w of l.failures??[])w!==null&&typeof w=="object"&&typeof w.thscode=="string"&&(f[w.thscode]=w.code);N(f),typeof l.refreshed_at=="number"&&d(l.refreshed_at),D(l.error!==void 0&&l.error!==null&&typeof l.error.code=="string"?l.error.code:null)},X=async(l,m={})=>{if(typeof l!="string"||l.length===0){W({status:"idle",data:null,code:null}),K({status:"idle",data:null,code:null});return}let f=He+=1;W(w=>({status:"loading",data:w.data!==null&&w.data.thscode===l?w.data:null,code:null}));try{let w=`thscode=${encodeURIComponent(l)}${m.bust===!0?"&refresh=1":""}`,_=await B("/trend",{query:w});if(!b.current||f!==He)return;W({status:"ready",data:_,code:null})}catch(w){if(!b.current||f!==He)return;let _=typeof w?.code=="string"?w.code:"trend_unavailable";W({status:_==="trend_unavailable"?"unavailable":"error",data:null,code:_})}},ee=async(l,m={})=>{if(typeof l!="string"||l.length===0){K({status:"idle",data:null,code:null});return}let f=Pe+=1;K(w=>({status:"loading",data:w.data!==null&&w.data.thscode===l?w.data:null,code:null}));try{let w=`thscode=${encodeURIComponent(l)}${m.bust===!0?"&refresh=1":""}`,_=await B("/kline",{query:w});if(!b.current||f!==Pe)return;K({status:"ready",data:_,code:null})}catch(w){if(!b.current||f!==Pe)return;let _=typeof w?.code=="string"?w.code:"kline_unavailable";K({status:_==="kline_unavailable"?"unavailable":"error",data:null,code:_})}},se=l=>{U(l),X(l),ee(l)};ge(()=>{let l=!1;return(async()=>{try{let f=await B("/list");if(l)return;let w=ce(f.items)??[];i(w);let _=typeof w[0]?.thscode=="string"?w[0].thscode:null;U(re=>re!==null?re:_),_!==null&&(X(_),ee(_))}catch(f){l||D(f.code??"load_failed");return}finally{l||s(!1)}try{let f=await B("/refresh",{body:{}});l||ie(f)}catch(f){l||D(f.code??"fuyao_unavailable")}})(),()=>{l=!0}},[]);let ne=async()=>{if(!u){g(!0);try{let l=await B("/refresh",{body:{}});b.current&&ie(l),b.current&&L!==null&&(X(L,{bust:!0}),ee(L,{bust:!0}))}catch(l){b.current&&D(l.code??"fuyao_unavailable")}finally{b.current&&g(!1)}}},ye=async l=>{let m=a;C(null),i(m.filter(f=>f.thscode!==l)),L===l&&(U(null),W({status:"idle",data:null,code:null}));try{await B("/remove",{body:{thscode:l}})}catch{b.current&&i(m)}},de=async l=>{let m=a,f=m.find(w=>w.thscode===l);if(f!==void 0){i([f,...m.filter(w=>w.thscode!==l)]);try{let w=await B("/pin",{body:{thscode:l}});Array.isArray(w.items)&&b.current&&i(ce(w.items))}catch{b.current&&i(m)}}},o=()=>{let l=Y.trim();l.length===0||l===le||v.names.includes(l)||(I({names:[...v.names,l],assignments:v.assignments}),te(""),G(l))},y=l=>{if(l===le)return;let m={};for(let[f,w]of Object.entries(v.assignments)){let _=(Array.isArray(w)?w:[]).filter(re=>re!==l);_.length>0&&(m[f]=_)}I({names:v.names.filter(f=>f!==l),assignments:m}),G(le),z(!1)},O=(l,m)=>{let f=Ee(v,l),w=f.includes(m)?f.filter(re=>re!==m):[...f,m],_={...v.assignments};w.length===0?delete _[l]:_[l]=w,I({names:v.names,assignments:_})},S=ae.trim().toLowerCase(),Z=a.filter(l=>P!==le&&!Ee(v,l.thscode).includes(P)?!1:S.length===0?!0:[l.name,l.thscode,l.ticker].some(m=>typeof m=="string"&&m.toLowerCase().includes(S))),M=L===null?null:a.find(l=>l.thscode===L)??null,pe=[{id:le,label:t("desk.allGroups"),icon:P===le?e(ke,{size:14}):void 0}].concat(v.names.map(l=>({id:l,label:l,icon:P===l?e(ke,{size:14}):void 0}))),ve=l=>{if(H.status!=="ready"||H.data===null||H.data.thscode!==l.thscode||typeof H.data.last!="number")return l.quote;let m=H.data.prev_close;return{price:H.data.last,change_pct:m>0?(H.data.last-m)/m*100:null}},Ce=Z.map((l,m)=>{let f=ve(l),w=it(f),_=x[l.thscode],re=Ee(v,l.thscode),De=L===l.thscode,Ge=_===void 0?void 0:t(`error.${_}`),Ae=R===l.thscode;return e("div",{key:l.thscode,className:"cwd-row",role:"listitem","aria-current":De?"true":void 0,onClick:oe=>{oe.target.closest(".cwd-rowactions")===null&&se(l.thscode)}},e("button",{type:"button",className:"cwd-cellname","aria-pressed":De,onClick:()=>se(l.thscode)},e("span",{className:"cwd-nameline"},e("span",{className:"cwd-nametext",title:l.name},xe(l.name)),e(Se,{assetType:l.asset_type,t})),e("span",{className:"cwd-codeline"},e("span",{className:"cwd-code"},l.thscode))),e("div",{className:_===void 0?"cwd-price":"cwd-price cwd-stale",title:Ge},st(f)),e("div",{className:`cwd-pct ${Ie(w)}`,title:Ge},_e(w)),e("div",{className:"cwd-rowactions"},e(Fe,{open:Ae,anchor:e("button",{type:"button",className:"cwd-iconbtn",title:t("desk.more"),"aria-label":`${t("desk.more")} ${l.name}`,"aria-haspopup":"menu","aria-expanded":Ae,onClick:()=>{C(null),k(Ae?null:l.thscode)}},e(nt,{size:16})),items:[{id:"pin",label:t("desk.pin"),icon:e(ot,{size:14}),disabled:m===0}],children:[...v.names.length===0?[e("div",{key:"no-group",className:"cwd-menuhint"},t("desk.noGroupYet"))]:v.names.map(oe=>e(Ne,{key:`group:${oe}`,icon:re.includes(oe)?e(ke,{size:14}):void 0,onSelect:()=>O(l.thscode,oe)},oe)),e(Ne,{key:"remove",danger:!0,separatorBefore:!0,icon:e(Re,{size:14}),onSelect:()=>{k(null),C(l)}},t("desk.remove"))],onSelect:oe=>{oe==="pin"&&(k(null),de(l.thscode))},onClose:()=>k(null),align:"end",portal:!0,listClassName:"cwd-menulist"})))}),h=r?e("div",{className:"cwd-empty"},e("div",{className:"cwd-emptytitle"},t("desk.loading"))):a.length===0?e("div",{className:"cwd-empty"},e("div",{className:"cwd-emptytitle"},t("desk.empty")),e("p",{className:"cwd-emptyhint"},t("desk.emptyHint"))):Z.length===0?e("div",{className:"cwd-empty"},e("div",{className:"cwd-emptytitle"},t("desk.noMatch")),e("p",{className:"cwd-emptyhint"},t("desk.noMatchHint"))):e("div",{className:"cwd-tablebody",role:"list","aria-label":t("desk.title")},Ce),p=H.status==="ready"?H.data:null,Q=p!==null&&M!==null&&p.thscode===M.thscode&&typeof p.last=="number",q=M===null?null:ve(M),J=it(q),we=Q?p.points[p.points.length-1][0]:null,be=Q&&p.market==="us"?` ${t("desk.trendZoneUs")}`:"",xt=Q?`${String(p.session_date??"").slice(5)} ${we}${be}`.trim():M===null||M.quote===null||M.quote===void 0?t("desk.notRefreshed"):$e(M.quote.captured_at)||t("desk.notRefreshed"),Me=p===null||p.market==="a-share"?"":` ${t(p.market==="us"?"desk.trendZoneUs":"desk.trendZoneHk")}`,bt=p===null?H.status==="loading"?t("desk.trendLoading"):H.status==="error"?t("desk.trendError"):"":p.session_status==="live"?`${p.stale?t("desk.trendStale"):t("desk.trendLive")}${Me} \xB7 ${p.points[p.points.length-1][0]}`:p.session_status==="closed"?`${p.session_date??""} ${t("desk.trendClosed")}${Me}`:`${t("desk.trendPrevious")} ${p.session_date??""}${Me}`,yt=p===null?null:e("div",{className:"cwd-trendstats"},...[[t("desk.trendOpen"),F(p.open)],[t("desk.trendHigh"),F(p.high)],[t("desk.trendLow"),F(p.low)],[t("desk.trendAvg"),F(p.avg)],[t("desk.trendVolume"),je(p.volume,p.volume_unit,t)],[t("desk.trendAmount"),da(p.amount,p.currency)]].map(([l,m])=>e("div",{key:l,className:"cwd-trendstat"},e("span",null,l),e("span",{title:m},m)))),vt=p!==null?e(ma,{key:p.thscode,data:p,t}):e("div",{className:"cwd-chart"},e("div",null,e("div",{className:"cwd-charttext"},H.status==="error"?t("desk.trendError"):H.status==="loading"?t("desk.trendLoading"):t("desk.trendUnavailable")),H.status==="unavailable"?e("div",{className:"cwd-charthint"},t("desk.trendUnavailableHint")):null,H.status==="error"?e("button",{type:"button",className:"cwd-pill",onClick:()=>{X(L,{bust:!0})}},t("desk.trendRetry")):null)),me=T.status==="ready"&&Array.isArray(T.data?.bars)&&T.data.bars.length>0?T.data:null,kt=me===null?T.status==="loading"?t("desk.klineLoading"):T.status==="error"?t("desk.klineError"):"":t("desk.adjustQfq"),Nt=me===null?null:e("div",{className:"cwd-malegend"},...gt.map(l=>{let m=ft(me.bars,l),f=m[m.length-1];return e("span",{key:l,className:`cwd-malegenditem cwd-ma${l}`},`MA${l} ${f==null?"\u2014":F(f)}`)})),$t=me!==null?e(fa,{key:me.thscode,data:me,t}):e("div",{className:"cwd-chart"},e("div",null,e("div",{className:"cwd-charttext"},T.status==="error"?t("desk.klineError"):T.status==="loading"?t("desk.klineLoading"):t("desk.klineUnavailable")),T.status==="unavailable"?e("div",{className:"cwd-charthint"},t("desk.klineUnavailableHint")):null,T.status==="error"?e("button",{type:"button",className:"cwd-pill",onClick:()=>{ee(L,{bust:!0})}},t("desk.trendRetry")):null)),St=e("div",{className:"cwd-block cwd-block-kline"},e("div",{className:"cwd-blockhead"},e("span",{className:"cwd-blocktitle"},t("desk.daily")),Nt,e("span",{className:"cwd-blocknote"},kt)),$t),_t=M===null?e("div",{className:"cwd-card"},e("div",{className:"cwd-empty"},e("div",{className:"cwd-emptytitle"},t("desk.selectHint")),e("p",{className:"cwd-emptyhint"},t("desk.selectHintBody")))):e("div",{className:"cwd-card"},e("div",{className:"cwd-detail"},e("div",{className:"cwd-detailhead"},e("div",{style:{minWidth:0}},e("div",{className:"cwd-detailname"},e("span",{className:"cwd-detailtext",title:M.name},xe(M.name)),e(Se,{assetType:M.asset_type,t})),e("div",{className:"cwd-detailcode"},M.thscode))),e("div",{className:"cwd-quoterow"},e("div",{className:"cwd-bigquote"},e("span",{className:"cwd-bigprice"},st(q)),e("span",{className:`cwd-bigpct ${Ie(J)}`},_e(J))),e("div",{className:"cwd-meta"},e("div",{className:"cwd-metaitem"},e("div",{className:"cwd-metalabel"},t("desk.capturedAt")),e("div",{className:"cwd-metavalue"},xt)),e("div",{className:"cwd-metaitem"},e("div",{className:"cwd-metalabel"},t("desk.kind")),e("div",{className:"cwd-metavalue"},ht(M.asset_type,t))))),e("div",{className:j?"cwd-block cwd-block-chart cwd-folded":"cwd-block cwd-block-chart"},e("div",{className:"cwd-blockhead"},e("span",{className:"cwd-blocktitle"},t("desk.intraday")),j?null:yt,e("span",{className:"cwd-blocknote"},bt),e("button",{type:"button",className:"cwd-blockfold","aria-expanded":j?"false":"true",onClick:()=>ue(!j)},t(j?"desk.unfold":"desk.fold"))),j?null:vt),St));return e("div",{className:"cwd-page"},e("div",{className:"cwd-inner"},e("header",{className:"cwd-head"},e("h1",{className:"cwd-title"},t("desk.title")),e("div",{className:"cwd-headactions"},e("span",{className:"cwd-updated"},`${t("desk.lastUpdate")} ${c===null?t("desk.notRefreshed"):$e(c)}`),e("button",{type:"button",className:"cwd-refresh",disabled:u,onClick:()=>{ne()}},e(ct,{size:14}),t(u?"desk.refreshing":"desk.refresh")))),e("div",{className:"cwd-body"},e("section",{className:"cwd-card"},e("div",{className:"cwd-toolbar"},e("label",{className:"cwd-field"},e(dt,{size:14}),e("input",{type:"text",value:ae,placeholder:t("desk.filterPlaceholder"),"aria-label":t("desk.filter"),onChange:l=>V(l.target.value)})),e(Fe,{open:E,anchor:e("button",{type:"button",className:"cwd-pill","aria-haspopup":"menu","aria-expanded":E,"aria-label":t("desk.group"),onClick:()=>z(!E)},e(rt,{size:14}),e("span",null,P===le?t("desk.allGroups"):P)),items:pe,children:P===le?[]:[e(Ne,{key:"delete-group",danger:!0,separatorBefore:!0,icon:e(Re,{size:14}),onSelect:()=>y(P)},t("desk.deleteGroup"))],onSelect:l=>{z(!1),G(l)},onClose:()=>z(!1),align:"start",portal:!0,listClassName:"cwd-menulist"}),e("div",{className:"cwd-groupcreate"},e("input",{type:"text",value:Y,maxLength:20,placeholder:t("desk.newGroup"),"aria-label":t("desk.newGroup"),onChange:l=>te(l.target.value),onKeyDown:l=>{l.key==="Enter"&&o()}}),e("button",{type:"button",className:"cwd-pill",disabled:Y.trim().length===0,onClick:o},t("desk.createGroup")))),$===null?null:e("div",{className:"cwd-error",role:"alert"},t($==="load_failed"?"desk.loadFailed":`error.${$}`)),n===null?null:e("div",{className:"cwd-notice cwd-notice-danger"},e("span",null,`${t("desk.removeHint")} \xB7 ${xe(n.name)}`),e("button",{type:"button",className:"cwd-pill",onClick:()=>C(null)},t("desk.cancel"))),e("div",{className:"cwd-thead",role:"row"},e("span",null,t("desk.colName")),e("span",{className:"cwd-right"},t("desk.colPrice")),e("span",{className:"cwd-right"},t("desk.colChange")),e("span",{className:"cwd-right"},t("desk.colAction"))),h),e("aside",null,_t))))}function ba(t){t.effect(ea,`${he}: styles`),t.effect(()=>t.locale.register(fe,{zh:Wt,en:Kt}),`${he}: dictionaries`);let a=new Map,i=c=>{let d=a.get(c);return d===void 0&&(d=new Oe,a.set(c,d)),d};t.effect(()=>()=>{for(let c of a.values())c.dispose();a.clear()},`${he}: per-session surfaces`);let r=c=>{let x=t.sessions?.list?.getSnapshot?.().byId?.[c]?.projectionValues?.agentPreset;return typeof x=="string"?x:void 0},s=new Set,u=c=>{let d=r(c);return d!==void 0?d===qt:(s.has(c)||(s.add(c),Promise.resolve(t.sessions?.refreshProjections?.(c)).catch(()=>{})),!1)};t.slots.inject(Xe,()=>t.slots.register({name:Xe,id:"capital-watchlist-dialog",order:3,locale:fe,inject:c=>{let d=i(c);return{hooks:{dialog:d.state},surface:d}}},na));let g=t.locale.bind(fe);t.slots.inject("main",()=>t.slots.register({name:"main",key:at,locale:fe},xa)),t.slots.inject("sidebar.panellist",()=>t.slots.register({name:"sidebar.panellist",id:at,order:12,locale:fe,label:()=>g("desk.panel")},ga)),t.inject(["commandUi"],c=>{let d=t.locale.bind(fe);c.effect(()=>c.commandUi.register({name:"watchlist",label:()=>d("command.label"),description:()=>d("command.description"),icon:ke,available:x=>u(x.sessionId),ui:{kind:"action",run:x=>{i(x.sessionId).open()}}}),`${he}: /watchlist contribution`)}),t.logger?.info?.(`${he}: \u5BA2\u6237\u7AEF\u534A\u8FB9\u5DF2\u6302\u8F7D\uFF08/watchlist \u83DC\u5355\u884C + \u81EA\u9009\u80A1\u5F39\u7A97\uFF09`)}exports.name=he;exports.inject=["slots","locale","commandUi","sessions"];exports.apply=ba;
263
+ `;function ia(){let t=globalThis.document;if(!t||typeof t.createElement!="function"||t.querySelector(`style[data-${it}]`))return;let a=t.createElement("style");a.setAttribute(`data-${it}`,""),a.textContent=aa;let i=t.head??t.body;if(!(i===void 0||typeof i.appendChild!="function"))return i.appendChild(a),()=>a.remove()}async function B(t,{query:a,body:i,signal:r}={}){let s=a!==void 0?`${at}${t}?${a}`:`${at}${t}`,w=i===void 0?{method:"GET",cache:"no-store",credentials:"same-origin",signal:r}:{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(i),credentials:"same-origin",signal:r},g=await fetch(s,w),c=await g.text(),d={};try{d=c.length>0?JSON.parse(c):{}}catch{d={}}if(g.ok===!0&&d.ok===!0)return d;let x=typeof d.code=="string"&&d.code.length>0?d.code:g.status===401||g.status===403?"unauthorized":"fuyao_unavailable",k=new Error(x);throw k.code=x,k.detail=typeof d.message=="string"&&d.message.length>0?d.message:null,k.candidates=d.candidates,k.limit=d.limit,k}var lt=()=>({open:!1,loading:!1,refreshing:!1,searching:!1,items:[],candidates:[],truncated:!1,marketFilter:"all",query:"",dropdownOpen:!1,rowMenu:null,pendingRemove:null,refreshed_at:null,error:null,searchError:null,searchPartial:null,addError:null,loadError:null,failures:{},composing:!1,pendingSearch:!1}),Ie=class{constructor(){this.store=Ut(lt()),this.searchController=null,this.timer=null,this.pending=null,this.lastQuery=null,this.holdingOps=new Map}get state(){return this.store}get snapshot(){return this.store.getSnapshot()}patch(a){this.store.update(i=>Object.assign(i,a))}open(){this.patch({...lt(),open:!0,loading:!0}),this.load().then(()=>this.refresh(),()=>this.patch({loading:!1}))}close(){this.timer!==null&&clearTimeout(this.timer),this.searchController!==null&&this.searchController.abort(),this.lastQuery=null,this.patch({open:!1,rowMenu:null,composing:!1,pendingSearch:!1}),this.holdingOps.clear()}async load(){try{let a=await B("/list");this.holdingOps.clear(),this.patch({items:de(a.items)??[],seeded_at:a.seeded_at,loading:!1,loadError:null})}catch(a){throw this.patch({loading:!1,loadError:{code:a.code??"fuyao_unavailable"}}),a}}refresh(){if(this.pending!==null)return this.pending;this.patch({refreshing:!0});let a=B("/refresh",{body:{}}).then(i=>{let r={};for(let g of i.failures??[])r[g.thscode]=g.code;let s=de(i.items),w=s??this.snapshot.items;s!==null&&this.holdingOps.clear(),this.patch({items:w,refreshed_at:i.refreshed_at??this.snapshot.refreshed_at,failures:r,error:i.error?{code:i.error.code,partial:w.length>0&&w.some(g=>r[g.thscode]===void 0)}:null})}).catch(i=>{this.patch({error:{code:i.code??"fuyao_unavailable",partial:this.snapshot.items.some(r=>r.quote!==null)}})}).finally(()=>{this.patch({refreshing:!1}),this.pending=null});return this.pending=a,a}onQueryChange(a,i){let r=a.trim(),s=i===void 0?this.snapshot.composing===!0:i===!0;if(this.patch({query:a,searchError:null,composing:s,dropdownOpen:r.length>0}),this.timer!==null&&clearTimeout(this.timer),r.length===0){this.searchController!==null&&this.searchController.abort(),this.lastQuery=null,this.patch({candidates:[],truncated:!1,searching:!1,pendingSearch:!1});return}r===this.lastQuery&&this.snapshot.pendingSearch===!1||(this.patch({candidates:[],truncated:!1,pendingSearch:!s}),s!==!0&&(this.timer=setTimeout(()=>this.search(r),Kt)))}beginComposition(){this.timer!==null&&clearTimeout(this.timer),this.patch({composing:!0})}endComposition(a){this.onQueryChange(a,!1)}hideDropdown(){this.patch({dropdownOpen:!1})}setMarketFilter(a){mt.some(i=>i.id===a)&&this.patch({marketFilter:a})}toggleRowMenu(a){this.patch({rowMenu:this.snapshot.rowMenu===a?null:a})}closeRowMenu(){this.snapshot.rowMenu!==null&&this.patch({rowMenu:null})}setPendingRemove(a){this.patch({pendingRemove:a??null})}replaceRow(a){let[i]=de([a]);i===void 0||typeof i?.thscode!="string"||this.patch({items:this.snapshot.items.map(r=>r.thscode===i.thscode?i:r)})}async search(a){this.lastQuery=a,this.searchController!==null&&this.searchController.abort();let i=new AbortController;this.searchController=i,this.patch({searching:!0,searchError:null,searchPartial:null});let r=()=>this.snapshot.query.trim()===a;try{let s=await B("/search",{query:`q=${encodeURIComponent(a)}`,signal:i.signal});if(!r()){this.patch({searching:!1});return}this.patch({candidates:de(s.items)??[],truncated:s.truncated===!0,searching:!1,pendingSearch:!1,searchPartial:Array.isArray(s.partial)&&s.partial.length>0?s.partial:null})}catch(s){if(s.name==="AbortError"||(this.lastQuery===a&&(this.lastQuery=null),!r()))return;this.patch({candidates:[],truncated:!1,searching:!1,pendingSearch:!1,searchError:{code:s.code??"fuyao_unavailable"},searchPartial:null})}}async add(a){try{await B("/add",{body:{thscode:a.thscode}})}catch(r){this.patch({addError:{code:r.code??"fuyao_unavailable",candidates:r.candidates,limit:r.limit}}),r.candidates!==void 0&&this.patch({candidates:r.candidates,truncated:!1});return}this.patch({addError:null,candidates:this.snapshot.candidates.map(r=>r.thscode===a.thscode?{...r,in_list:!0}:r)}),await this.load().catch(()=>{}),await this.refresh();let i=this.snapshot.items.find(r=>r.thscode===a.thscode);i!==void 0&&i.quote===null&&this.snapshot.failures[a.thscode]===void 0&&await this.refresh()}async remove(a){let i=this.snapshot.items;this.patch({items:i.filter(r=>r.thscode!==a),rowMenu:null});try{await B("/remove",{body:{thscode:a}}),this.snapshot.addError?.code==="list_full"&&this.patch({addError:null})}catch{this.patch({items:i})}}async pin(a){let i=this.snapshot.items,r=i.find(s=>s.thscode===a);if(r!==void 0){this.patch({items:[r,...i.filter(s=>s.thscode!==a)],rowMenu:null});try{let s=await B("/pin",{body:{thscode:a}});Array.isArray(s.items)&&this.patch({items:de(s.items)})}catch{let s=this.snapshot.items,w=i.map(c=>s.find(d=>d.thscode===c.thscode)).filter(Boolean),g=new Set(w.map(c=>c.thscode));this.patch({items:[...w,...s.filter(c=>!g.has(c.thscode))]})}}}async writeHolding(a,i,r){let s=this.snapshot.items.find(d=>d.thscode===a);if(s===void 0)return;let w=this.holdingOps.get(a)??{seq:0,baseline:s};this.holdingOps.set(a,w);let g=++w.seq;this.patch({items:this.snapshot.items.map(d=>d.thscode===a?r(d):d)});let c=()=>this.holdingOps.get(a)!==w||w.seq!==g;try{let d=await B("/holding",{body:i});if(c())return;this.replaceRow(d.item),w.baseline=d.item??r(s),this.holdingOps.delete(a)}catch{if(c())return;this.replaceRow(w.baseline),this.holdingOps.delete(a)}}markHolding(a,i){return this.writeHolding(a,{thscode:a,weight_pct:i},r=>({...r,holding:{weight_pct:i,marked_at:Date.now()}}))}clearHolding(a){return this.writeHolding(a,{thscode:a,clear:!0},i=>{let r={...i};return delete r.holding,r})}stepHolding(a,i){let r=this.snapshot.items,s=r.find(g=>g.thscode===a)?.holding?.weight_pct;if(typeof s!="number"&&i<0)return;let w=Math.min(wt(r,a),Math.max(0,(typeof s=="number"?s:0)+i));if(w!==s)return this.markHolding(a,w)}async copyToClipboard(){let a=this.snapshot.items.map(i=>[i.thscode,xe(i.name),i.asset_type,i.quote?.price??"",i.quote?.change_pct??"",i.quote?.captured_at??""].join(" ")).join(`
264
+ `);return await navigator.clipboard.writeText(a),a}dispose(){this.timer!==null&&clearTimeout(this.timer),this.searchController!==null&&this.searchController.abort()}};function $e(t){if(typeof t!="number"||!Number.isFinite(t))return"";let a=new Date(t),i=r=>String(r).padStart(2,"0");return`${i(a.getMonth()+1)}-${i(a.getDate())} ${i(a.getHours())}:${i(a.getMinutes())}`}function Se({assetType:t,t:a}){return e("span",{className:`capital-watchlist-tag ${ta[t]??"capital-watchlist-tag-cn"}`},Zt(t,a))}function sa(t,a,i){let r=xe(t.name);return`${a(`${i}PromptPrefix`)}${r} (${t.thscode} \xB7 ${Jt(t.asset_type,a)})${a(`${i}PromptSuffix`)}`}function la({quote:t,failureCode:a,refreshing:i,t:r}){let s=a!==void 0;if(t==null)return i===!0?e("div",{className:"capital-watchlist-quote"},e("span",{className:"capital-watchlist-skeleton capital-watchlist-skeleton-price"}),e("span",{className:"capital-watchlist-skeleton capital-watchlist-skeleton-change"})):s?e("div",{className:"capital-watchlist-quote",title:r(`error.${a}`)},e("div",{className:"capital-watchlist-price capital-watchlist-quotefailed"},"\u2014")):e("div",{className:"capital-watchlist-quote"},e("div",{className:"capital-watchlist-price"},r("notRefreshed")));let w=typeof t.change_pct=="number"&&Number.isFinite(t.change_pct),g=w?`${t.change_pct>0?"+":""}${t.change_pct.toFixed(2)}%`:"\u2014",c=s?"capital-watchlist-stale":w?t.change_pct>0?"capital-watchlist-up":t.change_pct<0?"capital-watchlist-down":"capital-watchlist-flat":"capital-watchlist-nodata",d=typeof t.source_time=="string"&&t.source_time.length>0?`${r("exchangeTime")} ${t.source_time}`:"",x=[];return s?x.push(`${r(`error.${a}`)} \xB7 ${r("stale")} ${$e(t.captured_at)}`):w||x.push(r("noChangePct")),d.length>0&&x.push(d),e("div",{className:"capital-watchlist-quote",title:x.length===0?void 0:x.join(" \xB7 ")},e("div",{className:s?"capital-watchlist-price capital-watchlist-stale":"capital-watchlist-price"},t.price.toFixed(2)),e("div",{className:`capital-watchlist-change ${c}`},g))}function na(t,a){if(a.code!=="list_full")return t(`error.${a.code}`);let i=a.limit;return typeof i!="number"||!Number.isFinite(i)?t("error.list_full_noMax"):t("error.list_full").replace("{max}",String(i))}function ra(t,a){let i=t?.weight_pct;return i==null?a("holdingName"):`${a("holdingName")} ${i}%`}function oa(t,a){let i=`${t.name} ${t.ticker}`;return t.holding===null||t.holding===void 0?i:`${i} \xB7 ${ra(t.holding,a)}`}function ca({useDialog:t,surface:a,t:i,inputActions:r}){let s=t(n=>n),[w,g]=M(!1),[c,d]=M(null),x=s.pendingRemove??null;if(ge(()=>()=>a.dispose(),[a]),!s.open)return null;let k=s.dropdownOpen===!0,S=x!==null,D=n=>{if(n.key==="Escape"){if(S){n.stopPropagation(),a.setPendingRemove(null);return}k&&(n.stopPropagation(),a.hideDropdown())}},N=n=>{if(!k)return;let C=n.relatedTarget;C!=null&&n.currentTarget?.contains?.(C)===!0||a.hideDropdown()},I=s.error,P=I==null?null:e("p",{className:"capital-watchlist-notice",role:"alert","data-code":I.code},`${i(`error.${I.code}`)}${I.partial===!0?i("errorSuffix"):""}`),G=(n,C)=>{r.insertText(sa(n,i,C),r.captureInsertion())===!0&&a.close()},T=s.marketFilter==="all"?s.candidates:s.candidates.filter(n=>st(n)===s.marketFilter),z={all:s.candidates.length,cn:0,hk:0,us:0};for(let n of s.candidates)z[st(n)]+=1;let V=s.candidates.length===0?null:e("div",{className:"capital-watchlist-filter",role:"group","aria-label":i("filterLabel")},mt.map(n=>e("button",{key:n.id,type:"button",className:"capital-watchlist-filterbtn","aria-pressed":s.marketFilter===n.id,onClick:()=>a.setMarketFilter(n.id)},e("span",{className:"capital-watchlist-filterlabel"},n.id==="all"?i("filterAll"):n.label),e("span",{className:"capital-watchlist-filtercount"},String(z[n.id]))))),ae=k?e("div",{className:"capital-watchlist-dropdown","aria-label":i("title"),"data-menu-material":"translucent"},V,e("div",{className:"capital-watchlist-options",role:"listbox","aria-label":i("title")},T.map(n=>e("button",{key:n.thscode,type:"button",role:"option",className:"capital-watchlist-option",title:n.name,"aria-disabled":n.in_list===!0||c===n.thscode,onClick:()=>{n.in_list===!0||c===n.thscode||(g(!0),d(n.thscode),a.add(n).finally(()=>{g(!1),d(null)}))}},e("span",{className:"capital-watchlist-optionmain"},e("span",{className:"capital-watchlist-optionname"},n.name),e("span",{className:"capital-watchlist-codeline"},e("span",{className:"capital-watchlist-optioncode"},n.thscode),e(Se,{assetType:n.asset_type,t:i}))),e("span",{className:"capital-watchlist-addbtn","data-state":n.in_list===!0?"added":"idle"},n.in_list===!0?i("added"):i("add")))),s.truncated===!0&&T.length>0?e("div",{className:"capital-watchlist-hint capital-watchlist-endhint"},i("truncated")):null),s.composing===!0?e("div",{className:"capital-watchlist-hint"},i("composingHint")):s.searching===!0||s.pendingSearch===!0?e("div",{className:"capital-watchlist-hint"},i("searching")):s.searchError!==null&&s.searchError!==void 0?e("div",{className:"capital-watchlist-hint capital-watchlist-searcherror",role:"alert","data-code":s.searchError.code},i(`error.${s.searchError.code}`)):s.candidates.length===0?e("div",{className:"capital-watchlist-hint"},i("noHit")):T.length===0?e("div",{className:"capital-watchlist-hint","data-filter":s.marketFilter},i("filterNoHit")):null,...(s.searchPartial??[]).map(n=>e("div",{key:`partial-${n.market}`,className:"capital-watchlist-hint capital-watchlist-searcherror",role:"status","data-market":n.market,"data-code":n.code},`${i(`partial.${n.market}`)}${i(`error.${n.code}`)}`))):null,ie=s.items.length===0?null:e("div",{className:"capital-watchlist-grid capital-watchlist-head"},e("span",null,i("colName")),e("span",{className:"capital-watchlist-quote"},i("colQuote")),e("span",{className:"capital-watchlist-headaction"},i("colAction"))),X=s.loadError!==null&&s.loadError!==void 0?e("p",{className:"capital-watchlist-empty capital-watchlist-loaderror",role:"alert","data-code":s.loadError.code},i(`error.${s.loadError.code}`)):e("p",{className:"capital-watchlist-empty"},i("empty")),L=s.loading?e("p",{className:"capital-watchlist-empty"},i("loading")):s.items.length===0?X:e("div",{className:k?"capital-watchlist-list capital-watchlist-list-open":"capital-watchlist-list"},s.items.map((n,C)=>{let H=n.holding!==null&&n.holding!==void 0,$=n.holding?.weight_pct,O=et(n)||H,W=wt(s.items,n.thscode),R=!H||$===null||$===void 0||$<=0,K=(typeof $=="number"?$:0)+Pe>W;return e("div",{key:n.thscode,className:"capital-watchlist-grid capital-watchlist-row","data-thscode":n.thscode},e("span",{className:"capital-watchlist-namewrap"},e("span",{className:H?"capital-watchlist-name capital-watchlist-name-held":"capital-watchlist-name",title:oa(n,i)},n.name),e("span",{className:"capital-watchlist-codeline"},e("span",{className:"capital-watchlist-code"},n.ticker),e(Se,{assetType:n.asset_type,t:i}))),e(la,{quote:n.quote,failureCode:s.failures[n.thscode],refreshing:s.refreshing,t:i}),e("span",{className:"capital-watchlist-rowactions"},e("button",{type:"button",className:"capital-watchlist-predict",disabled:w,title:i("predictTip"),"aria-label":`${i("predict")} ${n.name}`,onClick:()=>G(n,"predict")},e(pt,{size:14})),e("button",{type:"button",className:"capital-watchlist-review",disabled:w,title:i("reviewTip"),"aria-label":`${i("review")} ${n.name}`,onClick:()=>G(n,"review")},e(Gt,{size:14})),e(Fe,{open:s.rowMenu===n.thscode,anchor:e("button",{type:"button",className:"capital-watchlist-more",disabled:w,title:i("more"),"aria-label":`${i("more")} ${n.name}`,"aria-haspopup":"menu","aria-expanded":s.rowMenu===n.thscode,onClick:()=>a.toggleRowMenu(n.thscode)},e(dt,{size:14})),items:[{id:"pin",label:i("pin"),icon:e(ht,{size:14}),disabled:C===0}],children:[...O?[e("div",{key:"holding-check",role:"group","aria-label":i("holdingName"),className:"capital-watchlist-checkrow"},e("span",{className:"capital-watchlist-checkicon","aria-hidden":"true"},e(jt,{size:14})),e("span",{className:"capital-watchlist-checklabel"},i("holdingName")),e(Bt,{checked:H,disabled:w,label:i("holdingName"),onChange:Q=>Q?a.markHolding(n.thscode,null):a.clearHolding(n.thscode)}))]:[],...H&&et(n)?[e("div",{key:"holding-step",className:"capital-watchlist-stepper",role:"group","aria-label":i("holdingStepper")},e("span",{className:"capital-watchlist-stepperlabel"},i("holdingWeightLabel")),e("span",{className:"capital-watchlist-stepperline"},e("button",{type:"button",className:"capital-watchlist-stepperbtn","aria-label":i("holdingStepDown"),disabled:R,onClick:()=>a.stepHolding(n.thscode,-Pe)},"\u2212"),e("span",{className:typeof $=="number"?"capital-watchlist-stepperreadout":"capital-watchlist-stepperreadout capital-watchlist-stepperplaceholder",role:"status"},typeof $=="number"?`${$}%`:`0~${W}`),e("button",{type:"button",className:"capital-watchlist-stepperbtn","aria-label":i("holdingStepUp"),title:`0~${W}`,disabled:K,onClick:()=>a.stepHolding(n.thscode,Pe)},"+")))]:[],e(Ne,{key:"remove",danger:!0,separatorBefore:!0,icon:e(Oe,{size:14}),onSelect:()=>{a.closeRowMenu(),a.setPendingRemove(n)}},i("remove"))],onSelect:Q=>{Q==="pin"&&(a.closeRowMenu(),a.pin(n.thscode))},onClose:()=>a.closeRowMenu(),align:"end",portal:!0,listClassName:"capital-watchlist-rows",className:"capital-watchlist-actions"})))})),U=e("div",{className:S?"capital-watchlist-confirm capital-watchlist-confirm-open":"capital-watchlist-confirm","aria-hidden":S?void 0:"true"},e("div",{className:"capital-watchlist-confirmbox",role:S?"alertdialog":void 0,"aria-label":i("confirmTitle")},e("div",{className:"capital-watchlist-confirmtitle"},i("confirmTitle")),S?e("p",{className:"capital-watchlist-confirmdesc"},i("confirmDescPrefix"),e("strong",null,`${x.name} \xB7 ${x.ticker}`),i("confirmDescSuffix")):null,e("div",{className:"capital-watchlist-confirmactions"},e("button",{type:"button",className:"capital-watchlist-confirmbtn",onClick:()=>a.setPendingRemove(null)},i("confirmCancel")),e("button",{type:"button",className:"capital-watchlist-confirmbtn capital-watchlist-confirmdanger",onClick:()=>{let n=x;a.setPendingRemove(null),n!==null&&a.remove(n.thscode)}},i("confirmOk")))));return e(qt,{open:!0,onClose:()=>a.close(),title:i("title"),headless:!0,shortcutModal:"watchlist",className:"capital-watchlist-dialog"},e("div",{className:"capital-watchlist-card",onKeyDown:D},e("div",{className:"capital-watchlist-header"},e("h2",{className:"capital-watchlist-title"},i("title")),e("button",{type:"button",className:"capital-watchlist-close","aria-label":i("close"),onClick:()=>a.close()},e(Je,{size:14}))),e("div",{className:"capital-watchlist-search",onBlur:N},e("div",{className:"capital-watchlist-field"},e("span",{className:"capital-watchlist-searchicon"},e(ut,{size:16})),e("input",{className:"capital-watchlist-input","data-modal-autofocus":!0,value:s.query,placeholder:i("searchPlaceholder"),onChange:n=>a.onQueryChange(n.target.value,n.isComposing),onCompositionStart:()=>a.beginComposition(),onCompositionEnd:n=>a.endComposition(n.target.value)}),s.query.length>0?e("button",{type:"button",className:"capital-watchlist-clear",title:i("clearInput"),"aria-label":i("clearInput"),onMouseDown:n=>n.preventDefault(),onClick:()=>a.onQueryChange("",!1)},e(Je,{size:12})):null),ae),s.addError!==null&&s.addError!==void 0?e("p",{className:"capital-watchlist-adderror",role:"status","data-code":s.addError.code},na(i,s.addError)):null,ie,L,e("div",{className:"capital-watchlist-footer"},e("div",{className:"capital-watchlist-footcol"},e("button",{type:"button",className:"capital-watchlist-refresh",disabled:s.refreshing||w,onClick:()=>{a.refresh()}},e(Re,{size:14}),s.refreshing?i("refreshing"):i("refresh")),P),e("span",{className:"capital-watchlist-updated"},`${i("updated")} ${s.refreshed_at===null||s.refreshed_at===void 0?i("notRefreshed"):$e(s.refreshed_at)}`)),U))}var nt=`${ue}:desk`,ft="capital.watchlist.desk.groups.v1",ne="__all__",Te=0,He=0;function da(){let t={names:[],assignments:{}};try{let a=JSON.parse(localStorage.getItem(ft)??"{}");return a===null||typeof a!="object"||!Array.isArray(a.names)||a.assignments===null||typeof a.assignments!="object"?t:{names:a.names.filter(i=>typeof i=="string"&&i.length>0).slice(0,20),assignments:a.assignments}}catch{return t}}function pa(t){try{localStorage.setItem(ft,JSON.stringify(t))}catch{}}var Ee=(t,a)=>{let i=t.assignments[a];return Array.isArray(i)?i:[]},rt=t=>t!=null&&typeof t.change_pct=="number"&&Number.isFinite(t.change_pct)?t.change_pct:null,Le=t=>t===null?"cwd-flat":t>0?"cwd-up":t<0?"cwd-down":"cwd-flat",_e=t=>t===null?"\u2014":`${t>0?"+":""}${t.toFixed(2)}%`,gt=new Intl.NumberFormat("en-US",{minimumFractionDigits:2,maximumFractionDigits:2}),ot=t=>t!=null&&typeof t.price=="number"&&Number.isFinite(t.price)?gt.format(t.price):"\u2014",E=t=>typeof t=="number"&&Number.isFinite(t)?gt.format(t):"\u2014";function je(t,a=2){if(typeof t!="number"||!Number.isFinite(t))return"\u2014";let i=Math.abs(t);return i>=1e8?`${(t/1e8).toFixed(a)}\u4EBF`:i>=1e4?`${(t/1e4).toFixed(a)}\u4E07`:new Intl.NumberFormat("en-US",{maximumFractionDigits:a}).format(t)}var ha=t=>typeof t=="string"&&t.length>=5?Number(t.slice(0,2))*60+Number(t.slice(3,5)):0;function De(t,a,i){let r=je(t);return r==="\u2014"?r:a==="lot"?`${r}${i("desk.lot")}`:a==="share"?`${r}${i("desk.share")}`:r}function ua(t,a){let i=je(t);return i==="\u2014"||a==null||a==="CNY"?i:`${i} ${a}`}var ct={"a-share":[[570,690],[780,900]],hk:[[570,720],[780,960]],us:[[570,960]]},wa=t=>`${String(Math.floor(t/60)).padStart(2,"0")}:${String(t%60).padStart(2,"0")}`;function ma(t){let a=[],i=0;for(let[r,s]of ct[t]??ct.us)a.push([r,s,i]),i+=s-r;return{spans:a,total:i}}function fa(t,a){for(let[i,r,s]of t.spans){if(a<=i)return s;if(a<r)return s+a-i}return t.total}function ga(t){let a=[];for(let[i,r,s]of t.spans)for(let w=i;w<=r;w+=30){let g=s+w-i;(a.length===0||a[a.length-1].slot!==g)&&a.push({time:wa(w),slot:g})}return a}function xa({data:t,t:a}){let[i,r]=M({width:720,height:300}),[s,w]=M(null),g=Ue(null);ge(()=>{let h=g.current;if(h==null)return;let p=()=>{let q=h.getBoundingClientRect();if(!(q.width>0)||!(q.height>0))return;let ee=Math.max(280,Math.round(q.width)),we=Math.max(180,Math.round(q.height));r(be=>Math.abs(be.width-ee)<2&&Math.abs(be.height-we)<2?be:{width:ee,height:we})};if(p(),typeof ResizeObserver>"u")return;let Y=new ResizeObserver(p);return Y.observe(h),()=>Y.disconnect()},[]);let c=t.points,d=t.prev_close,x=i.width,k=i.height,S=66,D=54,N=12,I=18,P=Math.round(Math.min(70,Math.max(30,k*.22))),G=Math.max(60,k-N-I-P-10),T=Math.max(60,x-S-D),z=ma(t.market),V=T/z.total,ae=c.map(h=>h[1]),ie=Math.min(d,...ae),X=Math.max(d,...ae),L=(X-ie)*.06||Math.max(X*.002,.01),U=ie-L,n=X+L,C=h=>N+(n-h)/(n-U)*G,H=c.map(h=>fa(z,ha(h[0]))),$=h=>S+h*V,O=$(H[0]).toFixed(1),W=$(H[c.length-1]).toFixed(1),R=t.last===null||t.last>=d?"up":"down",K=R==="up"?"var(--capital-watchlist-up)":"var(--capital-watchlist-down)",Q=c.map((h,p)=>`${p===0?"M":"L"}${$(H[p]).toFixed(1)} ${C(h[1]).toFixed(1)}`).join(""),re=(N+G).toFixed(1),b=`${Q}L${W} ${re}L${O} ${re}Z`,se=c.reduce((h,p,Y)=>p[2]===null?h:`${h}${h===""?"M":"L"}${$(H[Y]).toFixed(1)} ${C(p[2]).toFixed(1)}`,""),Z=N+G+10,te=Math.max(1,...c.map(h=>h[3]??0)),le=Math.max(1,Math.min(10,V*.72)),oe=C(d),ye=[0,1,2,3,4].map(h=>{let p=U+(n-U)*h/4;return{value:p,y:C(p),pct:(p-d)/d*100}}).filter(h=>Math.abs(h.y-oe)>9),pe=z.spans.length>1?z.spans[1][2]:null,o=ga(z),y=x>=620?1:2,F=o.filter((h,p)=>p%y===0||p===o.length-1),_=s===null||s<0||s>=c.length?null:c[s],J=_===null?0:$(H[s]),A=_===null?0:C(_[1]),he=Math.min(x-172,Math.max(8,J+12)),ve=`${t.thscode} ${t.session_date??""} ${a("desk.intraday")} \xB7 ${a("desk.trendOpen")} ${E(t.open)} \xB7 ${a("desk.trendHigh")} ${E(t.high)} \xB7 ${a("desk.trendLow")} ${E(t.low)} \xB7 ${a("desk.trendAvg")} ${E(t.avg)}`,Ce=h=>{let p=h.currentTarget.getBoundingClientRect();if(!(p.width>0))return;let Y=Math.max(0,Math.min(z.total,(h.clientX-p.left-S)/T*z.total)),q=0;for(let ee=1;ee<H.length;ee+=1)Math.abs(H[ee]-Y)<Math.abs(H[q]-Y)&&(q=ee);w(q)};return e("div",{className:"cwd-chartbox",ref:g},e("svg",{className:"cwd-chartsvg",viewBox:`0 0 ${x} ${k}`,role:"img","aria-label":ve,onPointerMove:Ce,onPointerLeave:()=>w(null)},e("defs",null,e("linearGradient",{id:"cwd-trend-fill",x1:"0",y1:"0",x2:"0",y2:"1"},e("stop",{offset:"0%",style:{stopColor:K,stopOpacity:.2}}),e("stop",{offset:"100%",style:{stopColor:K,stopOpacity:0}}))),ye.map(h=>e("g",{key:`grid-${h.value.toFixed(4)}`},e("line",{className:"cwd-chartgrid",x1:S,x2:S+T,y1:h.y,y2:h.y}),e("text",{className:"cwd-chartaxis",x:S-8,y:h.y+3.5,textAnchor:"end"},E(h.value)),e("text",{className:"cwd-chartaxis",x:S+T+8,y:h.y+3.5},`${h.pct>0?"+":""}${h.pct.toFixed(2)}%`))),F.map(h=>e("line",{key:`grid-${h.time}`,className:"cwd-chartgrid",x1:$(h.slot),x2:$(h.slot),y1:N,y2:Z+P})),pe===null?null:e("line",{className:"cwd-chartsep",x1:$(pe),x2:$(pe),y1:N,y2:Z+P}),e("path",{className:"cwd-chartarea",d:b,fill:"url(#cwd-trend-fill)"}),c.map((h,p)=>{let Y=h[3]??0,q=Math.max(0,Y/te*P),ee=p===0?d:c[p-1][1],we=$(H[p]+.5);return e("rect",{key:`vol-${p}`,className:h[1]>=ee?"cwd-vol-up":"cwd-vol-down",x:Math.min(S+T-le,Math.max(S,we-le/2)).toFixed(1),y:(Z+P-q).toFixed(1),width:le.toFixed(1),height:Math.max(.5,q).toFixed(1)})}),e("path",{className:"cwd-chartline",d:Q,style:{stroke:K}}),se===""?null:e("path",{className:"cwd-chartavg",d:se}),e("line",{className:"cwd-chartbase",x1:S,x2:S+T,y1:oe,y2:oe,strokeDasharray:"4 3"}),e("text",{className:"cwd-chartaxis cwd-chartbaselabel",x:S-8,y:oe+3.5,textAnchor:"end"},E(d)),F.map(h=>e("text",{key:`tick-${h.time}`,className:"cwd-chartaxis",x:$(h.slot),y:k-5,textAnchor:h.slot===0?"start":h.slot>=z.total?"end":"middle"},h.time)),_===null?null:e("g",null,e("line",{className:"cwd-chartcross",x1:J,x2:J,y1:N,y2:Z+P}),e("line",{className:"cwd-chartcross",x1:S,x2:S+T,y1:A,y2:A}),e("circle",{className:`cwd-chartdot ${R==="up"?"cwd-up":"cwd-down"}`,cx:J,cy:A,r:3}))),_===null?null:e("div",{className:"cwd-charttip",style:{left:`${he}px`}},e("div",{className:"cwd-charttiptime"},_[0]),e("div",{className:`cwd-charttipprice ${R==="up"?"cwd-up":"cwd-down"}`},`${E(_[1])} ${_e((_[1]-d)/d*100)}`),_[2]===null?null:e("div",{className:"cwd-charttiprow"},e("span",null,a("desk.trendAvg")),e("span",null,E(_[2]))),_[3]===null?null:e("div",{className:"cwd-charttiprow"},e("span",null,a("desk.trendVolume")),e("span",null,De(_[3],t.volume_unit,a)))))}function xt(t,a){let i=new Array(t.length).fill(null),r=0;for(let s=0;s<t.length;s+=1)r+=t[s].close,s>=a&&(r-=t[s-a].close),s>=a-1&&(i[s]=r/a);return i}var bt=[5,10,20,60];function ba({data:t,t:a}){let[i,r]=M({width:720,height:300}),[s,w]=M(null),g=Ue(null);ge(()=>{let o=g.current;if(o==null)return;let y=()=>{let _=o.getBoundingClientRect();if(!(_.width>0)||!(_.height>0))return;let J=Math.max(280,Math.round(_.width)),A=Math.max(180,Math.round(_.height));r(he=>Math.abs(he.width-J)<2&&Math.abs(he.height-A)<2?he:{width:J,height:A})};if(y(),typeof ResizeObserver>"u")return;let F=new ResizeObserver(y);return F.observe(o),()=>F.disconnect()},[]);let c=t.bars,d=i.width,x=i.height,k=66,S=54,D=10,N=18,I=Math.round(Math.min(64,Math.max(28,x*.2))),P=Math.max(60,x-D-N-I-12),G=Math.max(60,d-k-S),T=G/Math.max(1,c.length),z=Math.max(1,Math.min(14,T*.62)),V=Math.max(...c.map(o=>o.high)),ae=Math.min(...c.map(o=>o.low)),ie=(V-ae)*.06||Math.max(V*.01,.01),X=V+ie,L=ae-ie,U=o=>D+(X-o)/(X-L)*P,n=o=>k+(o+.5)*T,C=D+P+12,H=Math.max(1,...c.map(o=>o.volume)),$=o=>o/H*I,O=bt.map(o=>({window:o,values:xt(c,o)})),W=o=>o.reduce((y,F,_)=>F===null?y:`${y}${y===""?"M":"L"}${n(_).toFixed(1)} ${U(F).toFixed(1)}`,""),R=[];for(let o=0;o<c.length;o+=1){let y=c[o].date.slice(5,7);(o===0||y!==c[o-1].date.slice(5,7))&&R.push({index:o,month:y})}let K=R.length>1?(R[1].index-R[0].index)*T:Number.POSITIVE_INFINITY,Q=R.map((o,y)=>({index:o.index,label:y===0&&K>=56?`${c[o.index].date.slice(0,4)}/${o.month}`:o.month})),re=[0,1,2,3,4].map(o=>{let y=X-(X-L)*o/4;return{value:y,y:U(y)}}),b=s===null||s<0||s>=c.length?null:c[s],se=b===null?0:n(s),Z=b===null?0:U(b.close),te=s===null||s<=0?null:c[s-1].close,le=b===null||te===null||te<=0?null:(b.close-te)/te*100,oe=Math.min(d-186,Math.max(8,se+12)),ye=`${t.thscode} ${a("desk.daily")} \xB7 ${c.length} \xB7 ${E(c[c.length-1].close)}`,pe=o=>{let y=o.currentTarget.getBoundingClientRect();if(!(y.width>0))return;let F=Math.round((o.clientX-y.left-k)/T-.5);w(Math.max(0,Math.min(c.length-1,F)))};return e("div",{className:"cwd-klinebox",ref:g},e("svg",{className:"cwd-chartsvg",viewBox:`0 0 ${d} ${x}`,role:"img","aria-label":ye,onPointerMove:pe,onPointerLeave:()=>w(null)},re.map(o=>e("g",{key:`grid-${o.value.toFixed(4)}`},e("line",{className:"cwd-chartgrid",x1:k,x2:k+G,y1:o.y,y2:o.y}),e("text",{className:"cwd-chartaxis",x:k-8,y:o.y+3.5,textAnchor:"end"},E(o.value)))),Q.map(o=>e("g",{key:`tick-${o.index}`},e("line",{className:"cwd-chartgrid",x1:n(o.index),x2:n(o.index),y1:D,y2:C+I}),e("text",{className:"cwd-chartaxis",x:n(o.index),y:x-5,textAnchor:o.index===0?"start":"middle"},o.label))),c.map((o,y)=>{let F=Math.max(.5,$(o.volume));return e("rect",{key:`vol-${o.date}`,className:o.close>=o.open?"cwd-vol-up":"cwd-vol-down",x:(n(y)-z/2).toFixed(1),y:(C+I-F).toFixed(1),width:z.toFixed(1),height:F.toFixed(1)})}),e("text",{className:"cwd-chartaxis",x:k-8,y:C+8,textAnchor:"end"},je(H)),c.map((o,y)=>{let F=U(o.open),_=U(o.close),J=Math.min(F,_),A=Math.max(.8,Math.abs(_-F));return e("g",{key:`bar-${o.date}`,className:o.close>=o.open?"cwd-candle-up":"cwd-candle-down"},e("line",{x1:n(y).toFixed(1),x2:n(y).toFixed(1),y1:U(o.high).toFixed(1),y2:U(o.low).toFixed(1)}),e("rect",{x:(n(y)-z/2).toFixed(1),y:J.toFixed(1),width:z.toFixed(1),height:A.toFixed(1)}))}),O.map(o=>{let y=W(o.values);return y===""?null:e("path",{key:`ma-${o.window}`,className:`cwd-maline cwd-ma${o.window}`,d:y})}),b===null?null:e("g",null,e("line",{className:"cwd-chartcross",x1:se,x2:se,y1:D,y2:C+I}),e("line",{className:"cwd-chartcross",x1:k,x2:k+G,y1:Z,y2:Z}))),b===null?null:e("div",{className:"cwd-charttip",style:{left:`${oe}px`}},e("div",{className:"cwd-charttiptime"},b.date),e("div",{className:`cwd-charttipprice ${Le(le)}`},`${E(b.close)} ${_e(le)}`),e("div",{className:"cwd-charttiprow"},e("span",null,a("desk.kOpen")),e("span",null,E(b.open)),e("span",null,a("desk.kHigh")),e("span",null,E(b.high))),e("div",{className:"cwd-charttiprow"},e("span",null,a("desk.kLow")),e("span",null,E(b.low)),e("span",null,a("desk.kClose")),e("span",null,E(b.close))),e("div",{className:"cwd-charttiprow"},e("span",null,a("desk.trendVolume")),e("span",null,De(b.volume,t.volume_unit,a)))))}function ya({size:t=18}){return e("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.8,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true"},e("path",{d:"M4 19V5"}),e("path",{d:"M4 19h16"}),e("path",{d:"m7 15 3-4 3 2 5-7"}),e("circle",{cx:18,cy:6,r:1.4,fill:"currentColor",stroke:"none"}))}function va({t}){let[a,i]=M([]),[r,s]=M(!0),[w,g]=M(!1),[c,d]=M(null),[x,k]=M({}),[S,D]=M(null),[N,I]=M(da),[P,G]=M(ne),[T,z]=M(!1),[V,ae]=M(""),[ie,X]=M(""),[L,U]=M(null),[n,C]=M(null),[H,$]=M(null),[O,W]=M({status:"idle",data:null,code:null,detail:null}),[R,K]=M({status:"idle",data:null,code:null,detail:null}),[Q,re]=M(!1),b=Ue(!0);ge(()=>(b.current=!0,()=>{b.current=!1}),[]),ge(()=>{pa(N)},[N]);let se=l=>{let m=de(l.items);Array.isArray(m)&&i(m);let f={};for(let u of l.failures??[])u!==null&&typeof u=="object"&&typeof u.thscode=="string"&&(f[u.thscode]=u.code);k(f),typeof l.refreshed_at=="number"&&d(l.refreshed_at),D(l.error!==void 0&&l.error!==null&&typeof l.error.code=="string"?l.error.code:null)},Z=async(l,m={})=>{if(typeof l!="string"||l.length===0){W({status:"idle",data:null,code:null,detail:null}),K({status:"idle",data:null,code:null,detail:null});return}let f=Te+=1;W(u=>({status:"loading",data:u.data!==null&&u.data.thscode===l?u.data:null,code:null,detail:null}));try{let u=`thscode=${encodeURIComponent(l)}${m.bust===!0?"&refresh=1":""}`,v=await B("/trend",{query:u});if(!b.current||f!==Te)return;W({status:"ready",data:v,code:null,detail:null})}catch(u){if(!b.current||f!==Te)return;let v=typeof u?.code=="string"?u.code:"trend_unavailable",j=typeof u?.detail=="string"&&u.detail.length>0?u.detail:null;W({status:v==="trend_unavailable"?"unavailable":"error",data:null,code:v,detail:j})}},te=async(l,m={})=>{if(typeof l!="string"||l.length===0){K({status:"idle",data:null,code:null,detail:null});return}let f=He+=1;K(u=>({status:"loading",data:u.data!==null&&u.data.thscode===l?u.data:null,code:null,detail:null}));try{let u=`thscode=${encodeURIComponent(l)}${m.bust===!0?"&refresh=1":""}`,v=await B("/kline",{query:u});if(!b.current||f!==He)return;K({status:"ready",data:v,code:null,detail:null})}catch(u){if(!b.current||f!==He)return;let v=typeof u?.code=="string"?u.code:"kline_unavailable",j=typeof u?.detail=="string"&&u.detail.length>0?u.detail:null;K({status:v==="kline_unavailable"?"unavailable":"error",data:null,code:v,detail:j})}},le=l=>{U(l),Z(l),te(l)};ge(()=>{let l=!1;return(async()=>{try{let f=await B("/list");if(l)return;let u=de(f.items)??[];i(u);let v=typeof u[0]?.thscode=="string"?u[0].thscode:null;U(j=>j!==null?j:v),v!==null&&(Z(v),te(v))}catch(f){l||D(f.code??"load_failed");return}finally{l||s(!1)}try{let f=await B("/refresh",{body:{}});l||se(f)}catch(f){l||D(f.code??"fuyao_unavailable")}})(),()=>{l=!0}},[]);let oe=async()=>{if(!w){g(!0);try{let l=await B("/refresh",{body:{}});b.current&&se(l),b.current&&L!==null&&(Z(L,{bust:!0}),te(L,{bust:!0}))}catch(l){b.current&&D(l.code??"fuyao_unavailable")}finally{b.current&&g(!1)}}},ye=async l=>{let m=a;C(null),i(m.filter(f=>f.thscode!==l)),L===l&&(U(null),W({status:"idle",data:null,code:null,detail:null}));try{await B("/remove",{body:{thscode:l}})}catch{b.current&&i(m)}},pe=async l=>{let m=a,f=m.find(u=>u.thscode===l);if(f!==void 0){i([f,...m.filter(u=>u.thscode!==l)]);try{let u=await B("/pin",{body:{thscode:l}});Array.isArray(u.items)&&b.current&&i(de(u.items))}catch{b.current&&i(m)}}},o=()=>{let l=V.trim();l.length===0||l===ne||N.names.includes(l)||(I({names:[...N.names,l],assignments:N.assignments}),ae(""),G(l))},y=l=>{if(l===ne)return;let m={};for(let[f,u]of Object.entries(N.assignments)){let v=(Array.isArray(u)?u:[]).filter(j=>j!==l);v.length>0&&(m[f]=v)}I({names:N.names.filter(f=>f!==l),assignments:m}),G(ne),z(!1)},F=(l,m)=>{let f=Ee(N,l),u=f.includes(m)?f.filter(j=>j!==m):[...f,m],v={...N.assignments};u.length===0?delete v[l]:v[l]=u,I({names:N.names,assignments:v})},_=ie.trim().toLowerCase(),J=a.filter(l=>P!==ne&&!Ee(N,l.thscode).includes(P)?!1:_.length===0?!0:[l.name,l.thscode,l.ticker].some(m=>typeof m=="string"&&m.toLowerCase().includes(_))),A=L===null?null:a.find(l=>l.thscode===L)??null,he=[{id:ne,label:t("desk.allGroups"),icon:P===ne?e(ke,{size:14}):void 0}].concat(N.names.map(l=>({id:l,label:l,icon:P===l?e(ke,{size:14}):void 0}))),ve=l=>{if(O.status!=="ready"||O.data===null||O.data.thscode!==l.thscode||typeof O.data.last!="number")return l.quote;let m=O.data.prev_close;return{price:O.data.last,change_pct:m>0?(O.data.last-m)/m*100:null}},Ce=J.map((l,m)=>{let f=ve(l),u=rt(f),v=x[l.thscode],j=Ee(N,l.thscode),We=L===l.thscode,Ke=v===void 0?void 0:t(`error.${v}`),Ae=H===l.thscode;return e("div",{key:l.thscode,className:"cwd-row",role:"listitem","aria-current":We?"true":void 0,onClick:ce=>{ce.target.closest(".cwd-rowactions")===null&&le(l.thscode)}},e("button",{type:"button",className:"cwd-cellname","aria-pressed":We,onClick:()=>le(l.thscode)},e("span",{className:"cwd-nameline"},e("span",{className:"cwd-nametext",title:l.name},xe(l.name)),e(Se,{assetType:l.asset_type,t})),e("span",{className:"cwd-codeline"},e("span",{className:"cwd-code"},l.thscode))),e("div",{className:v===void 0?"cwd-price":"cwd-price cwd-stale",title:Ke},ot(f)),e("div",{className:`cwd-pct ${Le(u)}`,title:Ke},_e(u)),e("div",{className:"cwd-rowactions"},e(Fe,{open:Ae,anchor:e("button",{type:"button",className:"cwd-iconbtn",title:t("desk.more"),"aria-label":`${t("desk.more")} ${l.name}`,"aria-haspopup":"menu","aria-expanded":Ae,onClick:()=>{C(null),$(Ae?null:l.thscode)}},e(dt,{size:16})),items:[{id:"pin",label:t("desk.pin"),icon:e(ht,{size:14}),disabled:m===0}],children:[...N.names.length===0?[e("div",{key:"no-group",className:"cwd-menuhint"},t("desk.noGroupYet"))]:N.names.map(ce=>e(Ne,{key:`group:${ce}`,icon:j.includes(ce)?e(ke,{size:14}):void 0,onSelect:()=>F(l.thscode,ce)},ce)),e(Ne,{key:"remove",danger:!0,separatorBefore:!0,icon:e(Oe,{size:14}),onSelect:()=>{$(null),C(l)}},t("desk.remove"))],onSelect:ce=>{ce==="pin"&&($(null),pe(l.thscode))},onClose:()=>$(null),align:"end",portal:!0,listClassName:"cwd-menulist"})))}),h=r?e("div",{className:"cwd-empty"},e("div",{className:"cwd-emptytitle"},t("desk.loading"))):a.length===0?e("div",{className:"cwd-empty"},e("div",{className:"cwd-emptytitle"},t("desk.empty")),e("p",{className:"cwd-emptyhint"},t("desk.emptyHint"))):J.length===0?e("div",{className:"cwd-empty"},e("div",{className:"cwd-emptytitle"},t("desk.noMatch")),e("p",{className:"cwd-emptyhint"},t("desk.noMatchHint"))):e("div",{className:"cwd-tablebody",role:"list","aria-label":t("desk.title")},Ce),p=O.status==="ready"?O.data:null,Y=p!==null&&A!==null&&p.thscode===A.thscode&&typeof p.last=="number",q=A===null?null:ve(A),ee=rt(q),we=Y?p.points[p.points.length-1][0]:null,be=Y&&p.market==="us"?` ${t("desk.trendZoneUs")}`:"",yt=Y?`${String(p.session_date??"").slice(5)} ${we}${be}`.trim():A===null||A.quote===null||A.quote===void 0?t("desk.notRefreshed"):$e(A.quote.captured_at)||t("desk.notRefreshed"),Me=p===null||p.market==="a-share"?"":` ${t(p.market==="us"?"desk.trendZoneUs":"desk.trendZoneHk")}`,Ge=p===null?O.status==="loading"?t("desk.trendLoading"):O.status==="error"?t("desk.trendError"):"":p.session_status==="live"?`${p.stale?t("desk.trendStale"):t("desk.trendLive")}${Me} \xB7 ${p.points[p.points.length-1][0]}`:p.session_status==="closed"?`${p.session_date??""} ${t("desk.trendClosed")}${Me}`:`${t("desk.trendPrevious")} ${p.session_date??""}${Me}`,qe=p===null?[]:[[t("desk.trendOpen"),E(p.open)],[t("desk.trendHigh"),E(p.high)],[t("desk.trendLow"),E(p.low)],[t("desk.trendAvg"),E(p.avg)],[t("desk.trendVolume"),De(p.volume,p.volume_unit,t)],[t("desk.trendAmount"),ua(p.amount,p.currency)]],vt=p===null?null:e("div",{className:Q?"cwd-statsbox cwd-statsbox-pinned":"cwd-statsbox",onMouseLeave:()=>{Q&&re(!1)}},e("button",{type:"button",className:"cwd-statsinfo","aria-label":`${t("desk.stats")}\uFF1A${qe.map(([l,m])=>`${l} ${m}`).join("\uFF0C")}`,"aria-expanded":Q?"true":"false",onClick:()=>re(!Q),onKeyDown:l=>{l.key==="Escape"&&re(!1)}},e(Dt,{size:13})),e("div",{className:"cwd-statspanel","aria-hidden":"true"},e("div",{className:"cwd-statscard"},Ge===""?null:e("div",{className:"cwd-statscap"},Ge),e("div",{className:"cwd-statsgrid"},...qe.map(([l,m])=>e("div",{key:l,className:"cwd-trendstat"},e("span",null,l),e("span",{title:m},m))))))),Be=(l,m,f=null)=>{let u=l.status==="error"?m.error:l.status==="loading"?m.loading:m.unavailable,v=l.status==="error"?l.detail:l.status==="unavailable"?m.hint:null,j=l.status==="error"&&f!==null;return e("div",{className:j?"cwd-chart cwd-chartfail":"cwd-chart"},e("div",{className:"cwd-fallback"},e("div",{className:"cwd-charttext"},u),v==null||v.length===0?null:e("div",{className:"cwd-charthint"},v),j?e("button",{type:"button",className:"cwd-retry",onClick:f.onClick},e(Re,{size:14}),e("span",null,t("desk.retry"))):null))},kt=p!==null?e(xa,{key:p.thscode,data:p,t}):Be(O,{error:t("desk.trendError"),loading:t("desk.trendLoading"),unavailable:t("desk.trendUnavailable"),hint:t("desk.trendUnavailableHint")},{onClick:()=>{Z(L,{bust:!0})}}),me=R.status==="ready"&&Array.isArray(R.data?.bars)&&R.data.bars.length>0?R.data:null,Nt=me===null?R.status==="loading"?t("desk.klineLoading"):R.status==="error"?t("desk.klineError"):"":t("desk.adjustQfq"),$t=me===null?null:e("div",{className:"cwd-malegend"},...bt.map(l=>{let m=xt(me.bars,l),f=m[m.length-1];return e("span",{key:l,className:`cwd-malegenditem cwd-ma${l}`},`MA${l} ${f==null?"\u2014":E(f)}`)})),St=me!==null?e(ba,{key:me.thscode,data:me,t}):Be(R,{error:t("desk.klineError"),loading:t("desk.klineLoading"),unavailable:t("desk.klineUnavailable"),hint:t("desk.klineUnavailableHint")},{onClick:()=>{te(L,{bust:!0})}}),_t=e("div",{className:"cwd-block cwd-block-kline"},e("div",{className:"cwd-blockhead"},e("span",{className:"cwd-blocktitle"},t("desk.daily")),$t,e("span",{className:"cwd-blocknote"},Nt)),St),Ct=A===null?e("div",{className:"cwd-card"},e("div",{className:"cwd-empty"},e("div",{className:"cwd-emptytitle"},t("desk.selectHint")),e("p",{className:"cwd-emptyhint"},t("desk.selectHintBody")))):e("div",{className:"cwd-card"},e("div",{className:"cwd-detail"},e("div",{className:"cwd-detailhead"},e("div",{style:{minWidth:0}},e("div",{className:"cwd-detailname"},e("span",{className:"cwd-detailtext",title:A.name},xe(A.name)),e(Se,{assetType:A.asset_type,t})),e("div",{className:"cwd-detailcode"},A.thscode))),e("div",{className:"cwd-quoterow"},e("div",{className:"cwd-bigquote"},e("span",{className:"cwd-bigprice"},ot(q)),e("span",{className:`cwd-bigpct ${Le(ee)}`},_e(ee))),e("div",{className:"cwd-meta"},e("div",{className:"cwd-metaitem"},e("div",{className:"cwd-metalabel"},t("desk.capturedAt")),e("div",{className:"cwd-metavalue"},yt)))),e("div",{className:"cwd-block cwd-block-chart"},e("div",{className:"cwd-blockhead"},e("span",{className:"cwd-blocktitle"},t("desk.intraday")),vt),kt),_t));return e("div",{className:"cwd-page"},e("div",{className:"cwd-inner"},e("header",{className:"cwd-head"},e("h1",{className:"cwd-title"},t("desk.title")),e("div",{className:"cwd-headactions"},e("span",{className:"cwd-updated"},`${t("desk.lastUpdate")} ${c===null?t("desk.notRefreshed"):$e(c)}`),e("button",{type:"button",className:"cwd-refresh",disabled:w,onClick:()=>{oe()}},e(Re,{size:14}),t(w?"desk.refreshing":"desk.refresh")))),e("div",{className:"cwd-body"},e("section",{className:"cwd-card"},e("div",{className:"cwd-toolbar"},e("label",{className:"cwd-field"},e(ut,{size:14}),e("input",{type:"text",value:ie,placeholder:t("desk.filterPlaceholder"),"aria-label":t("desk.filter"),onChange:l=>X(l.target.value)})),e(Fe,{open:T,anchor:e("button",{type:"button",className:"cwd-pill","aria-haspopup":"menu","aria-expanded":T,"aria-label":t("desk.group"),onClick:()=>z(!T)},e(pt,{size:14}),e("span",null,P===ne?t("desk.allGroups"):P)),items:he,children:P===ne?[]:[e(Ne,{key:"delete-group",danger:!0,separatorBefore:!0,icon:e(Oe,{size:14}),onSelect:()=>y(P)},t("desk.deleteGroup"))],onSelect:l=>{z(!1),G(l)},onClose:()=>z(!1),align:"start",portal:!0,listClassName:"cwd-menulist"}),e("div",{className:"cwd-groupcreate"},e("input",{type:"text",value:V,maxLength:20,placeholder:t("desk.newGroup"),"aria-label":t("desk.newGroup"),onChange:l=>ae(l.target.value),onKeyDown:l=>{l.key==="Enter"&&o()}}),e("button",{type:"button",className:"cwd-pill",disabled:V.trim().length===0,onClick:o},t("desk.createGroup")))),S===null?null:e("div",{className:"cwd-error",role:"alert"},t(S==="load_failed"?"desk.loadFailed":`error.${S}`)),n===null?null:e("div",{className:"cwd-notice cwd-notice-danger"},e("span",null,`${t("desk.removeHint")} \xB7 ${xe(n.name)}`),e("button",{type:"button",className:"cwd-pill",onClick:()=>C(null)},t("desk.cancel"))),e("div",{className:"cwd-thead",role:"row"},e("span",null,t("desk.colName")),e("span",{className:"cwd-right"},t("desk.colPrice")),e("span",{className:"cwd-right"},t("desk.colChange")),e("span",{className:"cwd-right"},t("desk.colAction"))),h),e("aside",null,Ct))))}function ka(t){t.effect(ia,`${ue}: styles`),t.effect(()=>t.locale.register(fe,{zh:Qt,en:Yt}),`${ue}: dictionaries`);let a=new Map,i=c=>{let d=a.get(c);return d===void 0&&(d=new Ie,a.set(c,d)),d};t.effect(()=>()=>{for(let c of a.values())c.dispose();a.clear()},`${ue}: per-session surfaces`);let r=c=>{let x=t.sessions?.list?.getSnapshot?.().byId?.[c]?.projectionValues?.agentPreset;return typeof x=="string"?x:void 0},s=new Set,w=c=>{let d=r(c);return d!==void 0?d===Wt:(s.has(c)||(s.add(c),Promise.resolve(t.sessions?.refreshProjections?.(c)).catch(()=>{})),!1)};t.slots.inject(tt,()=>t.slots.register({name:tt,id:"capital-watchlist-dialog",order:3,locale:fe,inject:c=>{let d=i(c);return{hooks:{dialog:d.state},surface:d}}},ca));let g=t.locale.bind(fe);t.slots.inject("main",()=>t.slots.register({name:"main",key:nt,locale:fe},va)),t.slots.inject("sidebar.panellist",()=>t.slots.register({name:"sidebar.panellist",id:nt,order:12,locale:fe,label:()=>g("desk.panel")},ya)),t.inject(["commandUi"],c=>{let d=t.locale.bind(fe);c.effect(()=>c.commandUi.register({name:"watchlist",label:()=>d("command.label"),description:()=>d("command.description"),icon:ke,available:x=>w(x.sessionId),ui:{kind:"action",run:x=>{i(x.sessionId).open()}}}),`${ue}: /watchlist contribution`)}),t.logger?.info?.(`${ue}: \u5BA2\u6237\u7AEF\u534A\u8FB9\u5DF2\u6302\u8F7D\uFF08/watchlist \u83DC\u5355\u884C + \u81EA\u9009\u80A1\u5F39\u7A97\uFF09`)}exports.name=ue;exports.inject=["slots","locale","commandUi","sessions"];exports.apply=ka;
252
265
  return module.exports
253
266
  },
254
267
  })
@@ -9,7 +9,7 @@ const { createElement: h, useEffect, useRef, useState } = require('react')
9
9
  const { createSnapshotStore } = require('@deepseek-ai/dsh-client-store')
10
10
  // Official icons only; the set has no wallet/pie/coin glyph, so stepper keys use text −/+.
11
11
  // `MenuItemButton` gives the remove row official geometry and its separator line.
12
- const { IconChecklistOutlineRegular, IconCloseOutlineRegular, IconDatabaseOutlineRegular, IconEllipsisOutlineRegular, IconGoalOutlineRegular, IconListPenOutlineRegular, IconPinOutlineRegular, IconRefreshOutlineRegular, IconSearchOutlineRegular, IconTrashOutlineRegular, Menu, MenuItemButton, Modal, Switch } = require('@deepseek-ai/dsh-client-ui-primitives')
12
+ const { IconChecklistOutlineRegular, IconCloseOutlineRegular, IconDatabaseOutlineRegular, IconEllipsisOutlineRegular, IconInfoOutlineRegular, IconGoalOutlineRegular, IconListPenOutlineRegular, IconPinOutlineRegular, IconRefreshOutlineRegular, IconSearchOutlineRegular, IconTrashOutlineRegular, Menu, MenuItemButton, Modal, Switch } = require('@deepseek-ai/dsh-client-ui-primitives')
13
13
  // Holdability and ceiling come from the same module the host gate uses.
14
14
  const { isHoldable, weightCeiling } = require('./holding-rules.js')
15
15
 
@@ -144,13 +144,11 @@ const zh = {
144
144
  'desk.trendUnavailable': '该市场暂时没有分时数据',
145
145
  'desk.trendUnavailableHint': '场外美股与部分海外指数没有分时源,这里不画假走势。',
146
146
  'desk.trendError': '分时加载失败',
147
- 'desk.trendRetry': '重试',
147
+ 'desk.retry': '重试',
148
148
  'desk.daily': '日K',
149
- 'desk.fold': '收起',
150
- 'desk.unfold': '展开',
151
149
  'desk.adjustQfq': '前复权',
152
150
  'desk.klineLoading': '正在读取日K…',
153
- 'desk.klineError': '日K暂时取不到',
151
+ 'desk.klineError': '日K加载失败',
154
152
  'desk.klineUnavailable': '该市场暂时没有日K数据',
155
153
  'desk.klineUnavailableHint': '港美股指数只有分时,没有可用的日线序列',
156
154
  'desk.kOpen': '开',
@@ -167,13 +165,13 @@ const zh = {
167
165
  'desk.trendAvg': '均价',
168
166
  'desk.trendVolume': '成交量',
169
167
  'desk.trendAmount': '成交额',
168
+ 'desk.stats': '行情统计',
170
169
  'desk.lot': '手',
171
170
  'desk.share': '股',
172
171
  'desk.trendZoneUs': '美东',
173
172
  'desk.trendZoneHk': '香港',
174
173
  'desk.capturedAt': '行情时间',
175
174
  'desk.groupsOf': '所属分组',
176
- 'desk.kind': '标的类型',
177
175
  'desk.colName': '名称',
178
176
  'desk.colPrice': '最新',
179
177
  'desk.colChange': '涨跌',
@@ -291,13 +289,11 @@ const en = {
291
289
  'desk.trendUnavailable': 'No intraday series for this market',
292
290
  'desk.trendUnavailableHint': 'OTC US lines and some overseas indices have no intraday source; nothing is drawn to fill the gap.',
293
291
  'desk.trendError': 'Intraday failed to load',
294
- 'desk.trendRetry': 'Retry',
292
+ 'desk.retry': 'Retry',
295
293
  'desk.daily': 'Daily',
296
- 'desk.fold': 'Collapse',
297
- 'desk.unfold': 'Expand',
298
294
  'desk.adjustQfq': 'Forward-adjusted',
299
295
  'desk.klineLoading': 'Loading daily bars…',
300
- 'desk.klineError': 'Daily bars are unavailable',
296
+ 'desk.klineError': 'Daily bars failed to load',
301
297
  'desk.klineUnavailable': 'No daily bars for this market',
302
298
  'desk.klineUnavailableHint': 'HK/US indices carry an intraday series only',
303
299
  'desk.kOpen': 'Open',
@@ -314,13 +310,13 @@ const en = {
314
310
  'desk.trendAvg': 'VWAP',
315
311
  'desk.trendVolume': 'Volume',
316
312
  'desk.trendAmount': 'Turnover',
313
+ 'desk.stats': 'Session stats',
317
314
  'desk.lot': 'lots',
318
315
  'desk.share': 'shares',
319
316
  'desk.trendZoneUs': 'ET',
320
317
  'desk.trendZoneHk': 'HK',
321
318
  'desk.capturedAt': 'As of',
322
319
  'desk.groupsOf': 'Groups',
323
- 'desk.kind': 'Instrument',
324
320
  'desk.colName': 'Symbol',
325
321
  'desk.colPrice': 'Last',
326
322
  'desk.colChange': 'Change',
@@ -583,21 +579,34 @@ const CSS = `
583
579
  .cwd-metavalue { font-size: 12px; line-height: 16px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
584
580
  .cwd-block { flex: none; padding-top: 12px; border-top: .5px solid var(--dsw-alias-border-l2); }
585
581
  .cwd-block-chart { flex: 1 1 0; display: flex; flex-direction: column; min-height: 200px; }
586
- /* Folded block keeps only its title row, so it stops competing for height. */
587
- .cwd-block-chart.cwd-folded { flex: none; min-height: 0; }
588
582
  .cwd-blockhead { display: flex; flex: none; align-items: baseline; gap: 12px; margin-bottom: 8px; }
589
583
  .cwd-blocktitle { flex: none; font-size: 12.5px; line-height: 18px; font-weight: 600; }
590
584
  .cwd-blocknote { margin-left: auto; font-size: 11px; line-height: 16px; color: var(--dsw-alias-label-tertiary); }
591
- .cwd-blockfold { flex: none; padding: 0 2px; border: 0; background: none; font-family: inherit; font-size: 11px; line-height: 16px; color: var(--dsw-alias-label-tertiary); cursor: pointer; }
592
- .cwd-blockfold:hover { color: var(--dsw-alias-label-primary); }
593
585
  .cwd-chart { flex: 1; min-height: 150px; display: grid; place-items: center; padding: 12px; border: 1px dashed var(--dsw-alias-border-l2); border-radius: 10px; background: repeating-linear-gradient(180deg, color-mix(in srgb, var(--dsw-alias-border-l2) 60%, transparent) 0 1px, transparent 1px 36px), var(--dsw-alias-bg-module-platform); text-align: center; }
594
586
  .cwd-charttext { font-size: 12.5px; line-height: 18px; font-weight: 500; color: var(--dsw-alias-label-secondary); }
595
587
  .cwd-charthint { margin-top: 4px; font-size: 11px; line-height: 16px; color: var(--dsw-alias-label-tertiary); }
596
- .cwd-trendstats { display: flex; flex: 1 1 auto; flex-wrap: wrap; gap: 2px 14px; min-width: 0; }
597
- .cwd-trendstat { display: flex; align-items: baseline; gap: 5px; font-size: 11px; line-height: 17px; }
588
+ .cwd-chartfail { border-style: solid; background: var(--dsw-alias-bg-module-platform); }
589
+ .cwd-chartfail .cwd-charttext { color: var(--dsw-alias-label-primary); }
590
+ .cwd-fallback { display: flex; flex-direction: column; align-items: center; gap: 2px; max-width: 360px; }
591
+ .cwd-retry { display: inline-flex; align-items: center; gap: 6px; flex: none; margin-top: 12px; height: 34px; padding: 0 14px; border: .5px solid color-mix(in srgb, var(--dsw-alias-state-business-primary) 38%, transparent); border-radius: 10px; background: color-mix(in srgb, var(--dsw-alias-state-business-primary) 12%, transparent); color: var(--dsw-alias-state-business-primary); font-family: inherit; font-size: 12.5px; line-height: 20px; font-weight: 500; cursor: pointer; }
592
+ .cwd-retry:hover { background: color-mix(in srgb, var(--dsw-alias-state-business-primary) 22%, transparent); }
593
+ .cwd-retry:active { background: color-mix(in srgb, var(--dsw-alias-state-business-primary) 30%, transparent); }
594
+ .cwd-retry:focus-visible { outline: 2px solid color-mix(in srgb, var(--dsw-alias-state-business-primary) 60%, transparent); outline-offset: 2px; }
595
+ .cwd-statsbox { position: relative; display: inline-flex; align-items: center; flex: none; align-self: center; }
596
+ .cwd-statsinfo { display: inline-flex; align-items: center; justify-content: center; width: 20px; height: 20px; padding: 0; border: 0; border-radius: 6px; background: none; color: var(--dsw-alias-label-tertiary); cursor: help; }
597
+ .cwd-statsinfo:hover, .cwd-statsinfo:focus-visible, .cwd-statsbox-pinned .cwd-statsinfo { color: var(--dsw-alias-label-primary); background: var(--dsw-alias-interactive-bg-hover-accent); }
598
+ .cwd-statsinfo:focus-visible { outline: 2px solid color-mix(in srgb, var(--dsw-alias-state-business-primary) 55%, transparent); outline-offset: 1px; }
599
+ /* The padding on the panel is the hover bridge: the card starts 8px below the icon without a dead
600
+ strip where the pointer would drop the hover. */
601
+ .cwd-statspanel { position: absolute; top: 100%; left: -10px; z-index: 8; padding-top: 8px; opacity: 0; visibility: hidden; transition: opacity .12s ease, visibility .12s ease; }
602
+ .cwd-statsbox:hover .cwd-statspanel, .cwd-statsbox:focus-within .cwd-statspanel, .cwd-statsbox-pinned .cwd-statspanel { opacity: 1; visibility: visible; }
603
+ .cwd-statscard { display: flex; flex-direction: column; gap: 7px; padding: 10px 14px; border: .5px solid var(--dsw-alias-border-l1); border-radius: 10px; background: var(--dsw-alias-bg-layer-2, var(--dsw-alias-bg-layer-1)); box-shadow: var(--dsw-elevation-prominent); }
604
+ .cwd-statscap { font-size: 10.5px; line-height: 14px; color: var(--dsw-alias-label-tertiary); white-space: nowrap; }
605
+ .cwd-statsgrid { display: grid; grid-template-columns: repeat(3, minmax(66px, auto)); gap: 7px 20px; }
606
+ .cwd-trendstat { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
598
607
  .cwd-trendstat span { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
599
- .cwd-trendstat span:first-child { flex: none; color: var(--dsw-alias-label-tertiary); }
600
- .cwd-trendstat span:last-child { font-variant-numeric: tabular-nums; }
608
+ .cwd-trendstat span:first-child { flex: none; font-size: 10.5px; line-height: 14px; color: var(--dsw-alias-label-tertiary); }
609
+ .cwd-trendstat span:last-child { font-size: 12px; line-height: 16px; font-weight: 500; color: var(--dsw-alias-label-primary); font-variant-numeric: tabular-nums; }
601
610
  .cwd-chartbox { position: relative; flex: 1; min-height: 120px; min-width: 0; overflow: hidden; border-radius: 10px; background: var(--dsw-alias-bg-module-platform); }
602
611
  /* The daily pane shares the SVG contract above (absolute child, determinate height): a flexed chart
603
612
  next to a scrolled column is exactly how the container used to grow. */
@@ -681,6 +690,9 @@ async function call(path, { query, body, signal } = {}) {
681
690
  : (response.status === 401 || response.status === 403) ? 'unauthorized' : 'fuyao_unavailable'
682
691
  const error = new Error(code)
683
692
  error.code = code
693
+ // The host's sentence already names what failed (timeout / garbled payload / upstream down);
694
+ // the pane prints it under the title instead of guessing from the code.
695
+ error.detail = typeof payload.message === 'string' && payload.message.length > 0 ? payload.message : null
684
696
  error.candidates = payload.candidates
685
697
  error.limit = payload.limit
686
698
  throw error
@@ -1989,10 +2001,10 @@ function WatchlistDeskPage({ t }) {
1989
2001
  const [selected, setSelected] = useState(null)
1990
2002
  const [pendingRemove, setPendingRemove] = useState(null)
1991
2003
  const [rowMenu, setRowMenu] = useState(null)
1992
- const [trend, setTrend] = useState({ status: 'idle', data: null, code: null })
1993
- const [kline, setKline] = useState({ status: 'idle', data: null, code: null })
1994
- // Folded = the intraday pane keeps only its title row, so the daily pane gets the whole column.
1995
- const [trendFolded, setTrendFolded] = useState(false)
2004
+ const [trend, setTrend] = useState({ status: 'idle', data: null, code: null, detail: null })
2005
+ const [kline, setKline] = useState({ status: 'idle', data: null, code: null, detail: null })
2006
+ // Touch has no hover: a tap pins the stats card open until the pointer leaves the box.
2007
+ const [statsPinned, setStatsPinned] = useState(false)
1996
2008
  const alive = useRef(true)
1997
2009
 
1998
2010
  useEffect(() => {
@@ -2020,41 +2032,43 @@ function WatchlistDeskPage({ t }) {
2020
2032
  */
2021
2033
  const loadTrend = async (thscode, options = {}) => {
2022
2034
  if (typeof thscode !== 'string' || thscode.length === 0) {
2023
- setTrend({ status: 'idle', data: null, code: null })
2024
- setKline({ status: 'idle', data: null, code: null })
2035
+ setTrend({ status: 'idle', data: null, code: null, detail: null })
2036
+ setKline({ status: 'idle', data: null, code: null, detail: null })
2025
2037
  return
2026
2038
  }
2027
2039
  const request = (deskTrendSequence += 1)
2028
- setTrend((previous) => ({ status: 'loading', data: previous.data !== null && previous.data.thscode === thscode ? previous.data : null, code: null }))
2040
+ setTrend((previous) => ({ status: 'loading', data: previous.data !== null && previous.data.thscode === thscode ? previous.data : null, code: null, detail: null }))
2029
2041
  try {
2030
2042
  const query = `thscode=${encodeURIComponent(thscode)}${options.bust === true ? '&refresh=1' : ''}`
2031
2043
  const payload = await call('/trend', { query })
2032
2044
  if (!alive.current || request !== deskTrendSequence) return
2033
- setTrend({ status: 'ready', data: payload, code: null })
2045
+ setTrend({ status: 'ready', data: payload, code: null, detail: null })
2034
2046
  } catch (failure) {
2035
2047
  if (!alive.current || request !== deskTrendSequence) return
2036
2048
  const code = typeof failure?.code === 'string' ? failure.code : 'trend_unavailable'
2037
- setTrend({ status: code === 'trend_unavailable' ? 'unavailable' : 'error', data: null, code })
2049
+ const detail = typeof failure?.detail === 'string' && failure.detail.length > 0 ? failure.detail : null
2050
+ setTrend({ status: code === 'trend_unavailable' ? 'unavailable' : 'error', data: null, code, detail })
2038
2051
  }
2039
2052
  }
2040
2053
 
2041
2054
  /** Same shape as `loadTrend`: the daily pane has its own request, so one slow history never blocks a tick. */
2042
2055
  const loadKline = async (thscode, options = {}) => {
2043
2056
  if (typeof thscode !== 'string' || thscode.length === 0) {
2044
- setKline({ status: 'idle', data: null, code: null })
2057
+ setKline({ status: 'idle', data: null, code: null, detail: null })
2045
2058
  return
2046
2059
  }
2047
2060
  const request = (deskKlineSequence += 1)
2048
- setKline((previous) => ({ status: 'loading', data: previous.data !== null && previous.data.thscode === thscode ? previous.data : null, code: null }))
2061
+ setKline((previous) => ({ status: 'loading', data: previous.data !== null && previous.data.thscode === thscode ? previous.data : null, code: null, detail: null }))
2049
2062
  try {
2050
2063
  const query = `thscode=${encodeURIComponent(thscode)}${options.bust === true ? '&refresh=1' : ''}`
2051
2064
  const payload = await call('/kline', { query })
2052
2065
  if (!alive.current || request !== deskKlineSequence) return
2053
- setKline({ status: 'ready', data: payload, code: null })
2066
+ setKline({ status: 'ready', data: payload, code: null, detail: null })
2054
2067
  } catch (failure) {
2055
2068
  if (!alive.current || request !== deskKlineSequence) return
2056
2069
  const code = typeof failure?.code === 'string' ? failure.code : 'kline_unavailable'
2057
- setKline({ status: code === 'kline_unavailable' ? 'unavailable' : 'error', data: null, code })
2070
+ const detail = typeof failure?.detail === 'string' && failure.detail.length > 0 ? failure.detail : null
2071
+ setKline({ status: code === 'kline_unavailable' ? 'unavailable' : 'error', data: null, code, detail })
2058
2072
  }
2059
2073
  }
2060
2074
 
@@ -2120,7 +2134,7 @@ function WatchlistDeskPage({ t }) {
2120
2134
  setItems(before.filter((row) => row.thscode !== thscode))
2121
2135
  if (selected === thscode) {
2122
2136
  setSelected(null)
2123
- setTrend({ status: 'idle', data: null, code: null })
2137
+ setTrend({ status: 'idle', data: null, code: null, detail: null })
2124
2138
  }
2125
2139
  try {
2126
2140
  await call('/remove', { body: { thscode } })
@@ -2294,27 +2308,65 @@ function WatchlistDeskPage({ t }) {
2294
2308
  ? `${trendData.session_date ?? ''} ${t('desk.trendClosed')}${trendZone}`
2295
2309
  : `${t('desk.trendPrevious')} ${trendData.session_date ?? ''}${trendZone}`
2296
2310
 
2297
- const trendStats = trendData === null ? null : h('div', { className: 'cwd-trendstats' },
2298
- ...[
2299
- [t('desk.trendOpen'), deskNumberText(trendData.open)],
2300
- [t('desk.trendHigh'), deskNumberText(trendData.high)],
2301
- [t('desk.trendLow'), deskNumberText(trendData.low)],
2302
- [t('desk.trendAvg'), deskNumberText(trendData.avg)],
2303
- [t('desk.trendVolume'), deskVolumeText(trendData.volume, trendData.volume_unit, t)],
2304
- [t('desk.trendAmount'), deskAmountText(trendData.amount, trendData.currency)],
2305
- ].map(([label, value]) => h('div', { key: label, className: 'cwd-trendstat' },
2306
- h('span', null, label), h('span', { title: value }, value))))
2311
+ // The six session facts are reference material, not the headline: they live behind one info
2312
+ // button on the title row (hover / focus / tap) instead of eating the width the title and the
2313
+ // session state need. The button carries them as its accessible name, so nothing is lost.
2314
+ const trendFacts = trendData === null ? [] : [
2315
+ [t('desk.trendOpen'), deskNumberText(trendData.open)],
2316
+ [t('desk.trendHigh'), deskNumberText(trendData.high)],
2317
+ [t('desk.trendLow'), deskNumberText(trendData.low)],
2318
+ [t('desk.trendAvg'), deskNumberText(trendData.avg)],
2319
+ [t('desk.trendVolume'), deskVolumeText(trendData.volume, trendData.volume_unit, t)],
2320
+ [t('desk.trendAmount'), deskAmountText(trendData.amount, trendData.currency)],
2321
+ ]
2322
+ const trendStats = trendData === null ? null : h('div', {
2323
+ className: statsPinned ? 'cwd-statsbox cwd-statsbox-pinned' : 'cwd-statsbox',
2324
+ onMouseLeave: () => { if (statsPinned) setStatsPinned(false) },
2325
+ },
2326
+ h('button', {
2327
+ type: 'button',
2328
+ className: 'cwd-statsinfo',
2329
+ 'aria-label': `${t('desk.stats')}:${trendFacts.map(([label, value]) => `${label} ${value}`).join(',')}`,
2330
+ 'aria-expanded': statsPinned ? 'true' : 'false',
2331
+ onClick: () => setStatsPinned(!statsPinned),
2332
+ onKeyDown: (event) => { if (event.key === 'Escape') setStatsPinned(false) },
2333
+ }, h(IconInfoOutlineRegular, { size: 13 })),
2334
+ h('div', { className: 'cwd-statspanel', 'aria-hidden': 'true' },
2335
+ h('div', { className: 'cwd-statscard' },
2336
+ // The session state moved in here with the facts: the title row is the title's.
2337
+ trendNote === '' ? null : h('div', { className: 'cwd-statscap' }, trendNote),
2338
+ h('div', { className: 'cwd-statsgrid' },
2339
+ ...trendFacts.map(([label, value]) => h('div', { key: label, className: 'cwd-trendstat' },
2340
+ h('span', null, label), h('span', { title: value }, value)))))))
2341
+
2342
+ /**
2343
+ * One look for both panes when there is nothing to draw: the host's own sentence says what went
2344
+ * wrong, and the retry is a real button — inside an empty 300px box a borderless pill reads as
2345
+ * plain text, which is exactly what makes a dead pane look unrecoverable.
2346
+ */
2347
+ const chartFallback = (state, labels, retry = null) => {
2348
+ const title = state.status === 'error' ? labels.error : state.status === 'loading' ? labels.loading : labels.unavailable
2349
+ const reason = state.status === 'error' ? state.detail : state.status === 'unavailable' ? labels.hint : null
2350
+ const showRetry = state.status === 'error' && retry !== null
2351
+ return h('div', { className: showRetry ? 'cwd-chart cwd-chartfail' : 'cwd-chart' },
2352
+ h('div', { className: 'cwd-fallback' },
2353
+ h('div', { className: 'cwd-charttext' }, title),
2354
+ reason === null || reason === undefined || reason.length === 0 ? null : h('div', { className: 'cwd-charthint' }, reason),
2355
+ showRetry
2356
+ ? h('button', { type: 'button', className: 'cwd-retry', onClick: retry.onClick },
2357
+ h(IconRefreshOutlineRegular, { size: 14 }),
2358
+ h('span', null, t('desk.retry')))
2359
+ : null))
2360
+ }
2307
2361
 
2308
2362
  const trendBody = trendData !== null
2309
2363
  ? h(IntradayChart, { key: trendData.thscode, data: trendData, t })
2310
- : h('div', { className: 'cwd-chart' }, h('div', null,
2311
- h('div', { className: 'cwd-charttext' }, trend.status === 'error' ? t('desk.trendError') : trend.status === 'loading' ? t('desk.trendLoading') : t('desk.trendUnavailable')),
2312
- trend.status === 'unavailable'
2313
- ? h('div', { className: 'cwd-charthint' }, t('desk.trendUnavailableHint'))
2314
- : null,
2315
- trend.status === 'error'
2316
- ? h('button', { type: 'button', className: 'cwd-pill', onClick: () => { void loadTrend(selected, { bust: true }) } }, t('desk.trendRetry'))
2317
- : null))
2364
+ : chartFallback(trend, {
2365
+ error: t('desk.trendError'),
2366
+ loading: t('desk.trendLoading'),
2367
+ unavailable: t('desk.trendUnavailable'),
2368
+ hint: t('desk.trendUnavailableHint'),
2369
+ }, { onClick: () => { void loadTrend(selected, { bust: true }) } })
2318
2370
  const klineData = kline.status === 'ready' && Array.isArray(kline.data?.bars) && kline.data.bars.length > 0 ? kline.data : null
2319
2371
  const klineNote = klineData === null
2320
2372
  ? (kline.status === 'loading' ? t('desk.klineLoading') : kline.status === 'error' ? t('desk.klineError') : '')
@@ -2328,12 +2380,12 @@ function WatchlistDeskPage({ t }) {
2328
2380
  }))
2329
2381
  const klineBody = klineData !== null
2330
2382
  ? h(DailyChart, { key: klineData.thscode, data: klineData, t })
2331
- : h('div', { className: 'cwd-chart' }, h('div', null,
2332
- h('div', { className: 'cwd-charttext' }, kline.status === 'error' ? t('desk.klineError') : kline.status === 'loading' ? t('desk.klineLoading') : t('desk.klineUnavailable')),
2333
- kline.status === 'unavailable' ? h('div', { className: 'cwd-charthint' }, t('desk.klineUnavailableHint')) : null,
2334
- kline.status === 'error'
2335
- ? h('button', { type: 'button', className: 'cwd-pill', onClick: () => { void loadKline(selected, { bust: true }) } }, t('desk.trendRetry'))
2336
- : null))
2383
+ : chartFallback(kline, {
2384
+ error: t('desk.klineError'),
2385
+ loading: t('desk.klineLoading'),
2386
+ unavailable: t('desk.klineUnavailable'),
2387
+ hint: t('desk.klineUnavailableHint'),
2388
+ }, { onClick: () => { void loadKline(selected, { bust: true }) } })
2337
2389
  const klineBlock = h('div', { className: 'cwd-block cwd-block-kline' },
2338
2390
  h('div', { className: 'cwd-blockhead' },
2339
2391
  h('span', { className: 'cwd-blocktitle' }, t('desk.daily')),
@@ -2359,22 +2411,12 @@ function WatchlistDeskPage({ t }) {
2359
2411
  h('span', { className: 'cwd-bigprice' }, deskPriceText(detailQuote)),
2360
2412
  h('span', { className: `cwd-bigpct ${deskToneOf(detailPct)}` }, deskPctText(detailPct))),
2361
2413
  h('div', { className: 'cwd-meta' },
2362
- h('div', { className: 'cwd-metaitem' }, h('div', { className: 'cwd-metalabel' }, t('desk.capturedAt')), h('div', { className: 'cwd-metavalue' }, detailAt)),
2363
- h('div', { className: 'cwd-metaitem' }, h('div', { className: 'cwd-metalabel' }, t('desk.kind')), h('div', { className: 'cwd-metavalue' }, typeLabel(current.asset_type, t))))),
2364
- h('div', { className: trendFolded ? 'cwd-block cwd-block-chart cwd-folded' : 'cwd-block cwd-block-chart' },
2414
+ h('div', { className: 'cwd-metaitem' }, h('div', { className: 'cwd-metalabel' }, t('desk.capturedAt')), h('div', { className: 'cwd-metavalue' }, detailAt)))),
2415
+ h('div', { className: 'cwd-block cwd-block-chart' },
2365
2416
  h('div', { className: 'cwd-blockhead' },
2366
2417
  h('span', { className: 'cwd-blocktitle' }, t('desk.intraday')),
2367
- trendFolded ? null : trendStats,
2368
- h('span', { className: 'cwd-blocknote' }, trendNote),
2369
- // Two panes in one column: folding the upper one hands the height to the daily pane instead
2370
- // of pushing the card into a scrollbar.
2371
- h('button', {
2372
- type: 'button',
2373
- className: 'cwd-blockfold',
2374
- 'aria-expanded': trendFolded ? 'false' : 'true',
2375
- onClick: () => setTrendFolded(!trendFolded),
2376
- }, trendFolded ? t('desk.unfold') : t('desk.fold'))),
2377
- trendFolded ? null : trendBody),
2418
+ trendStats),
2419
+ trendBody),
2378
2420
  klineBlock))
2379
2421
 
2380
2422
  return h('div', { className: 'cwd-page' },
@@ -969,27 +969,33 @@ export function createWatchlistService(options = {}) {
969
969
  }
970
970
  }
971
971
 
972
+ /** A body we cannot read: empty series, changed row shape, unreadable field. */
973
+ const PARSE_FAILURES = new Set(['tencent_parse_failed', 'tencent_invalid_response', 'tencent_empty_response'])
974
+
972
975
  /** Upstream failures degrade to one block in the desk, never to a whole-route error. */
973
976
  function trendFailure(error) {
974
977
  const name = typeof error?.name === 'string' ? error.name : ''
975
- if (name === 'AbortError' || name === 'TimeoutError') return { ok: false, code: 'trend_timeout', message: '分时数据请求超时' }
978
+ if (name === 'AbortError' || name === 'TimeoutError') return { ok: false, code: 'trend_timeout', message: '上游没有及时回话' }
976
979
  const code = typeof error?.code === 'string' ? error.code : ''
977
- if (code === 'trend_unavailable' || code === 'trend_parse_failed') return { ok: false, code, message: '分时数据暂时取不到' }
980
+ if (PARSE_FAILURES.has(code) || code === 'trend_parse_failed') return { ok: false, code: 'trend_parse_failed', message: '上游这次回的报文不完整' }
981
+ if (code === 'trend_unavailable') return { ok: false, code, message: '该市场暂时没有分时数据' }
978
982
  if (code === 'rate_limited' || code === 'tencent_rate_limit' || code === 'eastmoney_rate_limit') {
979
983
  return { ok: false, code: 'rate_limited', message: '行情服务限流,请稍后再试' }
980
984
  }
981
- return { ok: false, code: 'trend_unavailable', message: '分时数据暂时取不到' }
985
+ // "All three minute hosts are down" is an upstream outage, not a market without data: the desk
986
+ // must not answer it with the market hint.
987
+ return { ok: false, code: 'trend_upstream_unavailable', message: '行情源这次没有给出分时' }
982
988
  }
983
989
 
984
990
  function klineFailure(error) {
985
991
  const name = typeof error?.name === 'string' ? error.name : ''
986
- if (name === 'AbortError' || name === 'TimeoutError') return { ok: false, code: 'kline_timeout', message: '日K数据请求超时' }
992
+ if (name === 'AbortError' || name === 'TimeoutError') return { ok: false, code: 'kline_timeout', message: '上游没有及时回话' }
987
993
  const code = typeof error?.code === 'string' ? error.code : ''
988
- if (code === 'tencent_parse_failed' || code === 'trend_parse_failed') return { ok: false, code: 'kline_parse_failed', message: '日K数据解析失败' }
994
+ if (PARSE_FAILURES.has(code) || code === 'trend_parse_failed') return { ok: false, code: 'kline_parse_failed', message: '上游这次回的报文不完整' }
989
995
  if (code === 'rate_limited' || code === 'tencent_rate_limit' || code === 'eastmoney_rate_limit') {
990
996
  return { ok: false, code: 'rate_limited', message: '行情服务限流,请稍后再试' }
991
997
  }
992
- return { ok: false, code: 'kline_unavailable', message: '日K数据暂时取不到' }
998
+ return { ok: false, code: 'kline_upstream_unavailable', message: '行情源这次没有给出日线' }
993
999
  }
994
1000
 
995
1001
  /** Only whole-batch failures become batch errors (rate limit, missing key, service down). */
@@ -1055,9 +1061,11 @@ const FAILURE_STATUS = {
1055
1061
  trend_unavailable: 502,
1056
1062
  trend_timeout: 504,
1057
1063
  trend_parse_failed: 502,
1064
+ trend_upstream_unavailable: 502,
1058
1065
  kline_unavailable: 502,
1059
1066
  kline_timeout: 504,
1060
1067
  kline_parse_failed: 502,
1068
+ kline_upstream_unavailable: 502,
1061
1069
  ambiguous: 409,
1062
1070
  list_full: 409,
1063
1071
  credential_missing: 503,
@@ -1133,10 +1141,12 @@ export function createRouteHandler(service, options = {}) {
1133
1141
  }
1134
1142
  if (method === 'GET' && pathname === '/list') return send(res, 200, await service.list())
1135
1143
  if (method === 'GET' && pathname === '/kline') {
1136
- return sendBusiness(res, await service.kline({ thscode: searchParams.get('thscode') ?? '', refresh: searchParams.get('refresh') === '1' }))
1144
+ const thscode = searchParams.get('thscode') ?? ''
1145
+ return sendBusiness(res, logUpstreamFailure(options.logger, 'kline', thscode, await service.kline({ thscode, refresh: searchParams.get('refresh') === '1' })))
1137
1146
  }
1138
1147
  if (method === 'GET' && pathname === '/trend') {
1139
- return sendBusiness(res, await service.trend({ thscode: searchParams.get('thscode') ?? '', refresh: searchParams.get('refresh') === '1' }))
1148
+ const thscode = searchParams.get('thscode') ?? ''
1149
+ return sendBusiness(res, logUpstreamFailure(options.logger, 'trend', thscode, await service.trend({ thscode, refresh: searchParams.get('refresh') === '1' })))
1140
1150
  }
1141
1151
  if (method === 'GET' && pathname === '/search') return sendBusiness(res, await service.search(searchParams.get('q') ?? ''))
1142
1152
  send(res, 404, { ok: false, code: 'not_found', message: 'unknown watchlist route' })
@@ -1151,6 +1161,20 @@ function storeCause(error) {
1151
1161
  return [error?.code, error?.message ?? error].filter(Boolean).join(':') || 'unknown'
1152
1162
  }
1153
1163
 
1164
+ /** Caller mistakes (a stale row, a bad code) are not incidents; only upstream and storage faults are. */
1165
+ const REQUEST_FAULTS = new Set(['invalid_query', 'not_watched', 'not_found', 'ambiguous', 'list_full'])
1166
+
1167
+ /**
1168
+ * The panel shows one sentence and nothing else, so the failure code has to land somewhere the
1169
+ * maintainer can read it back: the host log names the route, the symbol and the upstream code.
1170
+ */
1171
+ function logUpstreamFailure(logger, route, thscode, result) {
1172
+ if (result?.ok !== true && !REQUEST_FAULTS.has(result.code)) {
1173
+ logger?.warn?.(`capital-watchlist: ${route} ${thscode} → ${result.code}${result.reason === undefined ? '' : ` (${result.reason})`}`)
1174
+ }
1175
+ return result
1176
+ }
1177
+
1154
1178
  function sendBusiness(res, result) {
1155
1179
  if (result.ok === true) return send(res, 200, result)
1156
1180
  return send(res, FAILURE_STATUS[result.code] ?? 400, result)
@@ -1207,7 +1231,7 @@ export function apply(ctx) {
1207
1231
  const dispose = webCtx.webServer.register({
1208
1232
  kind: 'prefix',
1209
1233
  path: ROUTE_PATH,
1210
- handler: createRouteHandler(service, { authorize }),
1234
+ handler: createRouteHandler(service, { authorize, logger: ctx.logger }),
1211
1235
  })
1212
1236
  return () => {
1213
1237
  if (typeof dispose === 'function') dispose()
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@v587d/watchlist",
3
- "version": "2.27.0",
3
+ "version": "2.27.2",
4
4
  "description": "自动模式的用户自选股(宿主级清单 + Fuyao 报价快照 + /capital-watchlist 路由 + 输入框菜单弹窗):由 @v587d/capital-generation 随包携带并作为 host 平面行挂载。",
5
5
  "license": "MIT",
6
6
  "type": "module",