@v587d/capital-generation 2.25.0 → 2.27.0
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 +69 -0
- package/README.md +8 -6
- package/automation/brief.js +21 -24
- package/automation/builtins.js +55 -54
- package/automation/client.js +11 -3
- package/automation/client.src.cjs +70 -8
- package/automation/package.json +1 -1
- package/chart-ui/package.json +1 -1
- package/config/package.json +1 -1
- package/lib/sources/tencent-http.d.ts +20 -0
- package/lib/sources/tencent-http.js +37 -58
- package/lib/sources/tencent-public-core.d.ts +31 -0
- package/lib/sources/tencent-public-core.js +63 -0
- package/lib/sources/trend-series.d.ts +53 -0
- package/lib/sources/trend-series.js +382 -0
- package/lib/web-retriever/local-fetch.d.ts +1 -1
- package/lib/web-retriever/local-fetch.js +1 -1
- package/lib/web-retriever/wind-client.d.ts +1 -1
- package/lib/web-retriever/wind-client.js +1 -1
- package/package.json +2 -1
- package/watchlist/client.js +124 -3
- package/watchlist/client.src.cjs +1229 -1
- package/watchlist/index.js +146 -0
- package/watchlist/package.json +1 -1
package/watchlist/client.js
CHANGED
|
@@ -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 S=Object.defineProperty;var rt=Object.getOwnPropertyDescriptor;var nt=Object.getOwnPropertyNames;var ot=Object.prototype.hasOwnProperty;var ct=(e,a,t)=>()=>{if(t)throw t[0];try{return e&&(a=e(e=0)),a}catch(r){throw t=[r],r}};var dt=(e,a)=>{for(var t in a)S(e,t,{get:a[t],enumerable:!0})},pt=(e,a,t,r)=>{if(a&&typeof a=="object"||typeof a=="function")for(let i of nt(a))!ot.call(e,i)&&i!==t&&S(e,i,{get:()=>a[i],enumerable:!(r=rt(a,i))||r.enumerable});return e};var ht=e=>pt(S({},"__esModule",{value:!0}),e);var H={};dt(H,{ASSET_TYPES:()=>ut,HOLDABLE_ASSET_TYPES:()=>P,MAX_ROW_WEIGHT_PCT:()=>mt,MAX_TOTAL_WEIGHT_PCT:()=>ft,holdingWeight:()=>R,isHoldable:()=>wt,otherHeldWeightPct:()=>I,weightCeiling:()=>gt});var ut,P,wt,mt,ft,R,I,gt,z=ct(()=>{"use strict";ut=["a-share","a-share-index","fund-etf","hk-stock","hk-index","us-stock","us-index"],P=["a-share","fund-etf","hk-stock","us-stock"],wt=e=>P.includes(e?.asset_type),mt=100,ft=120,R=e=>e?.holding===null||e?.holding===void 0?0:e?.holding?.weight_pct??0,I=(e,a)=>e.reduce((t,r)=>r?.thscode===a?t:t+R(r),0),gt=(e,a)=>Math.max(0,Math.min(100,120-I(e,a)))});var{createElement:l,useEffect:bt,useState:M}=require("react"),{createSnapshotStore:xt}=require("@deepseek-ai/dsh-client-store"),{IconChecklistOutlineRegular:yt,IconCloseOutlineRegular:O,IconDatabaseOutlineRegular:vt,IconEllipsisOutlineRegular:kt,IconGoalOutlineRegular:Nt,IconListPenOutlineRegular:St,IconPinOutlineRegular:_t,IconRefreshOutlineRegular:Ct,IconSearchOutlineRegular:Et,IconTrashOutlineRegular:At,Menu:$t,MenuItemButton:Tt,Modal:Pt,Switch:Rt}=require("@deepseek-ai/dsh-client-ui-primitives"),{isHoldable:F,weightCeiling:Q}=(z(),ht(H)),f="capital-watchlist",_="capital.watchlist",D="conversation.input.overlay",j="/capital-watchlist",It="capital-generation",Ht=300,C=10,L="capital-watchlist-css",zt={"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"},Mt={"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: "},Ot={"a-share":"typeAShare","hk-stock":"typeHkStock","us-stock":"typeUsStock","a-share-index":"typeAIndex","hk-index":"typeHkIndex","us-index":"typeUsIndex","fund-etf":"typeAShare"},Ft={"a-share":"kindStock","hk-stock":"kindStock","us-stock":"kindStock","a-share-index":"kindIndex","hk-index":"kindIndex","us-index":"kindIndex","fund-etf":"kindEtf"};function Dt(e,a){let t=Ot[e];return t===void 0?String(e??""):a(t)}function jt(e,a){let t=Ft[e];return t===void 0?String(e??""):a(t)}var Lt=/[\u0000-\u0008\u000B\u000C\u000E-\u001F\u007F-\u009F\u00AD\u200B-\u200F\u2028\u2029\u202A-\u202E\u2060-\u2064\u2066-\u2069\uFEFF]/gu;function A(e){return String(e??"").replace(Lt,"")}function y(e){return Array.isArray(e)?e.map(a=>a===null||typeof a!="object"?a:{...a,name:A(a.name)}):e}var Ut={"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"},K=[{id:"all"},{id:"cn",label:"CN"},{id:"hk",label:"HK"},{id:"us",label:"US"}],U=e=>e.exchange==="HK"?"hk":e.exchange==="US"?"us":"cn",qt=`
|
|
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=`
|
|
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; }
|
|
@@ -126,8 +126,129 @@ window.__ModuleLoader__.load({
|
|
|
126
126
|
.capital-watchlist-rows { width: 256px; }
|
|
127
127
|
/* Theme has no global border-box reset; the official item padding would overflow the list. */
|
|
128
128
|
.capital-watchlist-rows button { box-sizing: border-box; }
|
|
129
|
-
|
|
130
|
-
`);return await navigator.clipboard.writeText(a),a}dispose(){this.timer!==null&&clearTimeout(this.timer),this.searchController!==null&&this.searchController.abort()}};function B(e){if(typeof e!="number"||!Number.isFinite(e))return"";let a=new Date(e),t=r=>String(r).padStart(2,"0");return`${t(a.getMonth()+1)}-${t(a.getDate())} ${t(a.getHours())}:${t(a.getMinutes())}`}function W({assetType:e,t:a}){return l("span",{className:`capital-watchlist-tag ${Ut[e]??"capital-watchlist-tag-cn"}`},Dt(e,a))}function Qt(e,a,t){let r=A(e.name);return`${a(`${t}PromptPrefix`)}${r} (${e.thscode} \xB7 ${jt(e.asset_type,a)})${a(`${t}PromptSuffix`)}`}function Kt({quote:e,failureCode:a,refreshing:t,t:r}){let i=a!==void 0;if(e==null)return t===!0?l("div",{className:"capital-watchlist-quote"},l("span",{className:"capital-watchlist-skeleton capital-watchlist-skeleton-price"}),l("span",{className:"capital-watchlist-skeleton capital-watchlist-skeleton-change"})):i?l("div",{className:"capital-watchlist-quote",title:r(`error.${a}`)},l("div",{className:"capital-watchlist-price capital-watchlist-quotefailed"},"\u2014")):l("div",{className:"capital-watchlist-quote"},l("div",{className:"capital-watchlist-price"},r("notRefreshed")));let d=typeof e.change_pct=="number"&&Number.isFinite(e.change_pct),n=d?`${e.change_pct>0?"+":""}${e.change_pct.toFixed(2)}%`:"\u2014",c=i?"capital-watchlist-stale":d?e.change_pct>0?"capital-watchlist-up":e.change_pct<0?"capital-watchlist-down":"capital-watchlist-flat":"capital-watchlist-nodata",o=typeof e.source_time=="string"&&e.source_time.length>0?`${r("exchangeTime")} ${e.source_time}`:"",p=[];return i?p.push(`${r(`error.${a}`)} \xB7 ${r("stale")} ${B(e.captured_at)}`):d||p.push(r("noChangePct")),o.length>0&&p.push(o),l("div",{className:"capital-watchlist-quote",title:p.length===0?void 0:p.join(" \xB7 ")},l("div",{className:i?"capital-watchlist-price capital-watchlist-stale":"capital-watchlist-price"},e.price.toFixed(2)),l("div",{className:`capital-watchlist-change ${c}`},n))}function Bt(e,a){if(a.code!=="list_full")return e(`error.${a.code}`);let t=a.limit;return typeof t!="number"||!Number.isFinite(t)?e("error.list_full_noMax"):e("error.list_full").replace("{max}",String(t))}function Yt(e,a){let t=e?.weight_pct;return t==null?a("holdingName"):`${a("holdingName")} ${t}%`}function Gt(e,a){let t=`${e.name} ${e.ticker}`;return e.holding===null||e.holding===void 0?t:`${t} \xB7 ${Yt(e.holding,a)}`}function Xt({useDialog:e,surface:a,t,inputActions:r}){let i=e(s=>s),[d,n]=M(!1),[c,o]=M(null),p=i.pendingRemove??null;if(bt(()=>()=>a.dispose(),[a]),!i.open)return null;let h=i.dropdownOpen===!0,g=p!==null,Y=s=>{if(s.key==="Escape"){if(g){s.stopPropagation(),a.setPendingRemove(null);return}h&&(s.stopPropagation(),a.hideDropdown())}},G=s=>{if(!h)return;let w=s.relatedTarget;w!=null&&s.currentTarget?.contains?.(w)===!0||a.hideDropdown()},b=i.error,X=b==null?null:l("p",{className:"capital-watchlist-notice",role:"alert","data-code":b.code},`${t(`error.${b.code}`)}${b.partial===!0?t("errorSuffix"):""}`),$=(s,w)=>{r.insertText(Qt(s,t,w),r.captureInsertion())===!0&&a.close()},v=i.marketFilter==="all"?i.candidates:i.candidates.filter(s=>U(s)===i.marketFilter),T={all:i.candidates.length,cn:0,hk:0,us:0};for(let s of i.candidates)T[U(s)]+=1;let J=i.candidates.length===0?null:l("div",{className:"capital-watchlist-filter",role:"group","aria-label":t("filterLabel")},K.map(s=>l("button",{key:s.id,type:"button",className:"capital-watchlist-filterbtn","aria-pressed":i.marketFilter===s.id,onClick:()=>a.setMarketFilter(s.id)},l("span",{className:"capital-watchlist-filterlabel"},s.id==="all"?t("filterAll"):s.label),l("span",{className:"capital-watchlist-filtercount"},String(T[s.id]))))),V=h?l("div",{className:"capital-watchlist-dropdown","aria-label":t("title"),"data-menu-material":"translucent"},J,l("div",{className:"capital-watchlist-options",role:"listbox","aria-label":t("title")},v.map(s=>l("button",{key:s.thscode,type:"button",role:"option",className:"capital-watchlist-option",title:s.name,"aria-disabled":s.in_list===!0||c===s.thscode,onClick:()=>{s.in_list===!0||c===s.thscode||(n(!0),o(s.thscode),a.add(s).finally(()=>{n(!1),o(null)}))}},l("span",{className:"capital-watchlist-optionmain"},l("span",{className:"capital-watchlist-optionname"},s.name),l("span",{className:"capital-watchlist-codeline"},l("span",{className:"capital-watchlist-optioncode"},s.thscode),l(W,{assetType:s.asset_type,t}))),l("span",{className:"capital-watchlist-addbtn","data-state":s.in_list===!0?"added":"idle"},s.in_list===!0?t("added"):t("add")))),i.truncated===!0&&v.length>0?l("div",{className:"capital-watchlist-hint capital-watchlist-endhint"},t("truncated")):null),i.composing===!0?l("div",{className:"capital-watchlist-hint"},t("composingHint")):i.searching===!0||i.pendingSearch===!0?l("div",{className:"capital-watchlist-hint"},t("searching")):i.searchError!==null&&i.searchError!==void 0?l("div",{className:"capital-watchlist-hint capital-watchlist-searcherror",role:"alert","data-code":i.searchError.code},t(`error.${i.searchError.code}`)):i.candidates.length===0?l("div",{className:"capital-watchlist-hint"},t("noHit")):v.length===0?l("div",{className:"capital-watchlist-hint","data-filter":i.marketFilter},t("filterNoHit")):null,...(i.searchPartial??[]).map(s=>l("div",{key:`partial-${s.market}`,className:"capital-watchlist-hint capital-watchlist-searcherror",role:"status","data-market":s.market,"data-code":s.code},`${t(`partial.${s.market}`)}${t(`error.${s.code}`)}`))):null,Z=i.items.length===0?null:l("div",{className:"capital-watchlist-grid capital-watchlist-head"},l("span",null,t("colName")),l("span",{className:"capital-watchlist-quote"},t("colQuote")),l("span",{className:"capital-watchlist-headaction"},t("colAction"))),tt=i.loadError!==null&&i.loadError!==void 0?l("p",{className:"capital-watchlist-empty capital-watchlist-loaderror",role:"alert","data-code":i.loadError.code},t(`error.${i.loadError.code}`)):l("p",{className:"capital-watchlist-empty"},t("empty")),at=i.loading?l("p",{className:"capital-watchlist-empty"},t("loading")):i.items.length===0?tt:l("div",{className:h?"capital-watchlist-list capital-watchlist-list-open":"capital-watchlist-list"},i.items.map((s,w)=>{let x=s.holding!==null&&s.holding!==void 0,u=s.holding?.weight_pct,it=F(s)||x,k=Q(i.items,s.thscode),lt=!x||u===null||u===void 0||u<=0,st=(typeof u=="number"?u:0)+C>k;return l("div",{key:s.thscode,className:"capital-watchlist-grid capital-watchlist-row","data-thscode":s.thscode},l("span",{className:"capital-watchlist-namewrap"},l("span",{className:x?"capital-watchlist-name capital-watchlist-name-held":"capital-watchlist-name",title:Gt(s,t)},s.name),l("span",{className:"capital-watchlist-codeline"},l("span",{className:"capital-watchlist-code"},s.ticker),l(W,{assetType:s.asset_type,t}))),l(Kt,{quote:s.quote,failureCode:i.failures[s.thscode],refreshing:i.refreshing,t}),l("span",{className:"capital-watchlist-rowactions"},l("button",{type:"button",className:"capital-watchlist-predict",disabled:d,title:t("predictTip"),"aria-label":`${t("predict")} ${s.name}`,onClick:()=>$(s,"predict")},l(Nt,{size:14})),l("button",{type:"button",className:"capital-watchlist-review",disabled:d,title:t("reviewTip"),"aria-label":`${t("review")} ${s.name}`,onClick:()=>$(s,"review")},l(St,{size:14})),l($t,{open:i.rowMenu===s.thscode,anchor:l("button",{type:"button",className:"capital-watchlist-more",disabled:d,title:t("more"),"aria-label":`${t("more")} ${s.name}`,"aria-haspopup":"menu","aria-expanded":i.rowMenu===s.thscode,onClick:()=>a.toggleRowMenu(s.thscode)},l(kt,{size:14})),items:[{id:"pin",label:t("pin"),icon:l(_t,{size:14}),disabled:w===0}],children:[...it?[l("div",{key:"holding-check",role:"group","aria-label":t("holdingName"),className:"capital-watchlist-checkrow"},l("span",{className:"capital-watchlist-checkicon","aria-hidden":"true"},l(vt,{size:14})),l("span",{className:"capital-watchlist-checklabel"},t("holdingName")),l(Rt,{checked:x,disabled:d,label:t("holdingName"),onChange:N=>N?a.markHolding(s.thscode,null):a.clearHolding(s.thscode)}))]:[],...x&&F(s)?[l("div",{key:"holding-step",className:"capital-watchlist-stepper",role:"group","aria-label":t("holdingStepper")},l("span",{className:"capital-watchlist-stepperlabel"},t("holdingWeightLabel")),l("span",{className:"capital-watchlist-stepperline"},l("button",{type:"button",className:"capital-watchlist-stepperbtn","aria-label":t("holdingStepDown"),disabled:lt,onClick:()=>a.stepHolding(s.thscode,-C)},"\u2212"),l("span",{className:typeof u=="number"?"capital-watchlist-stepperreadout":"capital-watchlist-stepperreadout capital-watchlist-stepperplaceholder",role:"status"},typeof u=="number"?`${u}%`:`0~${k}`),l("button",{type:"button",className:"capital-watchlist-stepperbtn","aria-label":t("holdingStepUp"),title:`0~${k}`,disabled:st,onClick:()=>a.stepHolding(s.thscode,C)},"+")))]:[],l(Tt,{key:"remove",danger:!0,separatorBefore:!0,icon:l(At,{size:14}),onSelect:()=>{a.closeRowMenu(),a.setPendingRemove(s)}},t("remove"))],onSelect:N=>{N==="pin"&&(a.closeRowMenu(),a.pin(s.thscode))},onClose:()=>a.closeRowMenu(),align:"end",portal:!0,listClassName:"capital-watchlist-rows",className:"capital-watchlist-actions"})))})),et=l("div",{className:g?"capital-watchlist-confirm capital-watchlist-confirm-open":"capital-watchlist-confirm","aria-hidden":g?void 0:"true"},l("div",{className:"capital-watchlist-confirmbox",role:g?"alertdialog":void 0,"aria-label":t("confirmTitle")},l("div",{className:"capital-watchlist-confirmtitle"},t("confirmTitle")),g?l("p",{className:"capital-watchlist-confirmdesc"},t("confirmDescPrefix"),l("strong",null,`${p.name} \xB7 ${p.ticker}`),t("confirmDescSuffix")):null,l("div",{className:"capital-watchlist-confirmactions"},l("button",{type:"button",className:"capital-watchlist-confirmbtn",onClick:()=>a.setPendingRemove(null)},t("confirmCancel")),l("button",{type:"button",className:"capital-watchlist-confirmbtn capital-watchlist-confirmdanger",onClick:()=>{let s=p;a.setPendingRemove(null),s!==null&&a.remove(s.thscode)}},t("confirmOk")))));return l(Pt,{open:!0,onClose:()=>a.close(),title:t("title"),headless:!0,shortcutModal:"watchlist",className:"capital-watchlist-dialog"},l("div",{className:"capital-watchlist-card",onKeyDown:Y},l("div",{className:"capital-watchlist-header"},l("h2",{className:"capital-watchlist-title"},t("title")),l("button",{type:"button",className:"capital-watchlist-close","aria-label":t("close"),onClick:()=>a.close()},l(O,{size:14}))),l("div",{className:"capital-watchlist-search",onBlur:G},l("div",{className:"capital-watchlist-field"},l("span",{className:"capital-watchlist-searchicon"},l(Et,{size:16})),l("input",{className:"capital-watchlist-input","data-modal-autofocus":!0,value:i.query,placeholder:t("searchPlaceholder"),onChange:s=>a.onQueryChange(s.target.value,s.isComposing),onCompositionStart:()=>a.beginComposition(),onCompositionEnd:s=>a.endComposition(s.target.value)}),i.query.length>0?l("button",{type:"button",className:"capital-watchlist-clear",title:t("clearInput"),"aria-label":t("clearInput"),onMouseDown:s=>s.preventDefault(),onClick:()=>a.onQueryChange("",!1)},l(O,{size:12})):null),V),i.addError!==null&&i.addError!==void 0?l("p",{className:"capital-watchlist-adderror",role:"status","data-code":i.addError.code},Bt(t,i.addError)):null,Z,at,l("div",{className:"capital-watchlist-footer"},l("div",{className:"capital-watchlist-footcol"},l("button",{type:"button",className:"capital-watchlist-refresh",disabled:i.refreshing||d,onClick:()=>{a.refresh()}},l(Ct,{size:14}),i.refreshing?t("refreshing"):t("refresh")),X),l("span",{className:"capital-watchlist-updated"},`${t("updated")} ${i.refreshed_at===null||i.refreshed_at===void 0?t("notRefreshed"):B(i.refreshed_at)}`)),et))}function Jt(e){e.effect(Wt,`${f}: styles`),e.effect(()=>e.locale.register(_,{zh:zt,en:Mt}),`${f}: dictionaries`);let a=new Map,t=n=>{let c=a.get(n);return c===void 0&&(c=new E,a.set(n,c)),c};e.effect(()=>()=>{for(let n of a.values())n.dispose();a.clear()},`${f}: per-session surfaces`);let r=n=>{let o=e.sessions?.list?.getSnapshot?.().byId?.[n]?.projectionValues?.agentPreset;return typeof o=="string"?o:void 0},i=new Set,d=n=>{let c=r(n);return c!==void 0?c===It:(i.has(n)||(i.add(n),Promise.resolve(e.sessions?.refreshProjections?.(n)).catch(()=>{})),!1)};e.slots.inject(D,()=>e.slots.register({name:D,id:"capital-watchlist-dialog",order:3,locale:_,inject:n=>{let c=t(n);return{hooks:{dialog:c.state},surface:c}}},Xt)),e.inject(["commandUi"],n=>{let c=e.locale.bind(_);n.effect(()=>n.commandUi.register({name:"watchlist",label:()=>c("command.label"),description:()=>c("command.description"),icon:yt,available:o=>d(o.sessionId),ui:{kind:"action",run:o=>{t(o.sessionId).open()}}}),`${f}: /watchlist contribution`)}),e.logger?.info?.(`${f}: \u5BA2\u6237\u7AEF\u534A\u8FB9\u5DF2\u6302\u8F7D\uFF08/watchlist \u83DC\u5355\u884C + \u81EA\u9009\u80A1\u5F39\u7A97\uFF09`)}exports.name=f;exports.inject=["slots","locale","commandUi","sessions"];exports.apply=Jt;
|
|
129
|
+
/* --- \u884C\u60C5\u5DE5\u4F5C\u53F0\uFF1A\u5DE6\u4FA7\u680F\u5165\u53E3 + main \u9762\u677F\u3002\u5361\u7247\u8D70\u53D1\u4E1D\u7EBF\uFF0C\u6D6E\u5C42\u4EA4\u7ED9\u5B98\u65B9 Menu\u3002 --- */
|
|
130
|
+
.cwd-page { display: flex; flex-direction: column; height: 100%; min-height: 0; overflow-y: auto; background: var(--dsw-alias-bg-base); color: var(--dsw-alias-label-primary); --cwd-card: var(--dsw-alias-bg-layer-2, var(--dsw-alias-bg-layer-1)); --capital-watchlist-up: #d1493f; --capital-watchlist-down: #17a063; }
|
|
131
|
+
.cwd-inner { display: flex; flex: 1; flex-direction: column; width: 100%; min-height: 0; max-width: 1180px; margin: 0 auto; padding: 24px 32px 32px; }
|
|
132
|
+
.cwd-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
|
|
133
|
+
.cwd-title { margin: 0; font-size: 26px; line-height: 32px; font-weight: 650; letter-spacing: -.2px; }
|
|
134
|
+
.cwd-headactions { display: flex; align-items: center; gap: 14px; flex: none; }
|
|
135
|
+
.cwd-updated { font-size: 12px; line-height: 18px; color: var(--dsw-alias-label-tertiary); font-variant-numeric: tabular-nums; white-space: nowrap; }
|
|
136
|
+
.cwd-refresh { display: inline-flex; align-items: center; gap: 6px; flex: none; height: 34px; padding: 0 14px; border: .5px solid color-mix(in srgb, var(--dsw-alias-state-business-primary) 25%, 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: 13px; line-height: 20px; font-weight: 500; cursor: pointer; }
|
|
137
|
+
.cwd-refresh:hover:not(:disabled) { background: color-mix(in srgb, var(--dsw-alias-state-business-primary) 20%, transparent); }
|
|
138
|
+
.cwd-refresh:disabled { opacity: .45; cursor: not-allowed; }
|
|
139
|
+
.cwd-body { display: grid; flex: 1 1 auto; grid-template-columns: minmax(0, 1fr) minmax(430px, 1.35fr); grid-template-rows: minmax(0, 1fr); gap: 22px; align-items: stretch; min-height: 420px; max-height: 880px; }
|
|
140
|
+
/* \u26D4 \u884C\u9AD8\u5FC5\u987B\u9489\u6B7B\uFF1A\u9690\u5F0F\u884C\u6309\u5185\u5BB9\u81EA\u9002\u5E94\u65F6\uFF0C\u53F3\u680F\u4E00\u65E6\u957F\u9AD8\u5C31\u628A\u884C\u6491\u5F00\uFF0C\u5DE6\u5217\u8DDF\u7740 height:100% \u4E00\u8D77\u53D8\u9AD8\uFF08\u5B9E\u6D4B\u75C7\u72B6\uFF09\u3002 */
|
|
141
|
+
.cwd-card { display: flex; flex-direction: column; height: 100%; min-width: 0; min-height: 0; border: .5px solid var(--dsw-alias-border-l1); border-radius: 14px; background: var(--cwd-card); overflow: hidden; }
|
|
142
|
+
.cwd-toolbar { display: flex; flex: none; align-items: center; gap: 8px; flex-wrap: wrap; padding: 12px 14px; border-bottom: .5px solid var(--dsw-alias-border-l2); }
|
|
143
|
+
.cwd-field { display: flex; align-items: center; gap: 6px; flex: 1 1 170px; min-width: 0; height: 34px; padding: 0 10px; border-radius: 10px; background: var(--dsw-alias-bg-module-platform); color: var(--dsw-alias-label-tertiary); }
|
|
144
|
+
.cwd-field input { flex: 1 1 auto; min-width: 0; height: 100%; padding: 0; border: none; outline: none; background: transparent; color: var(--dsw-alias-label-primary); font-family: inherit; font-size: 13px; }
|
|
145
|
+
.cwd-field input::placeholder { color: var(--dsw-alias-label-tertiary); }
|
|
146
|
+
.cwd-pill { display: inline-flex; align-items: center; gap: 6px; flex: none; max-width: 160px; height: 34px; padding: 0 12px; border: none; border-radius: 10px; background: var(--dsw-alias-bg-module-platform); color: var(--dsw-alias-label-secondary); font-family: inherit; font-size: 12.5px; line-height: 20px; cursor: pointer; }
|
|
147
|
+
.cwd-pill:hover:not(:disabled) { background: var(--dsw-alias-interactive-bg-hover-accent); color: var(--dsw-alias-label-primary); }
|
|
148
|
+
.cwd-pill:disabled { opacity: .45; cursor: not-allowed; }
|
|
149
|
+
.cwd-pill span { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
|
|
150
|
+
.cwd-groupcreate { display: inline-flex; align-items: center; gap: 6px; min-width: 0; }
|
|
151
|
+
.cwd-groupcreate input { width: 104px; height: 34px; padding: 0 10px; border: .5px solid var(--dsw-alias-border-l1); border-radius: 10px; background: var(--dsw-alias-bg-module-platform); color: var(--dsw-alias-label-primary); font-family: inherit; font-size: 12.5px; }
|
|
152
|
+
.cwd-thead, .cwd-row { display: grid; grid-template-columns: minmax(0, 1.6fr) 92px 84px 40px; gap: 10px; align-items: center; }
|
|
153
|
+
.cwd-thead { flex: none; padding: 8px 14px; border-bottom: .5px solid var(--dsw-alias-border-l2); font-size: 11px; line-height: 16px; letter-spacing: .2px; color: var(--dsw-alias-label-tertiary); white-space: nowrap; }
|
|
154
|
+
.cwd-right { text-align: right; }
|
|
155
|
+
.cwd-tablebody { flex: 1; min-height: 0; overflow-y: auto; border-bottom: .5px solid var(--dsw-alias-border-l2); }
|
|
156
|
+
.cwd-row { padding: 9px 14px; border-bottom: .5px solid var(--dsw-alias-border-l2); transition: background .15s var(--ds-ease-in-out); }
|
|
157
|
+
.cwd-row:last-of-type { border-bottom: none; }
|
|
158
|
+
.cwd-row:hover { background: var(--dsw-alias-interactive-bg-hover); }
|
|
159
|
+
.cwd-row[aria-current="true"] { background: color-mix(in srgb, var(--dsw-alias-state-business-primary) 10%, transparent); }
|
|
160
|
+
.cwd-nameline { display: flex; align-items: center; gap: 6px; min-width: 0; }
|
|
161
|
+
.cwd-cellname { display: flex; flex-direction: column; gap: 1px; min-width: 0; padding: 0; border: none; background: transparent; color: inherit; font-family: inherit; text-align: left; cursor: pointer; }
|
|
162
|
+
.cwd-nametext { flex: 0 1 auto; min-width: 0; font-size: 14px; line-height: 19px; font-weight: 500; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
|
|
163
|
+
.cwd-codeline { display: flex; align-items: center; gap: 8px; min-width: 0; font-size: 11px; line-height: 15px; color: var(--dsw-alias-label-tertiary); }
|
|
164
|
+
.cwd-code { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
|
|
165
|
+
.cwd-price { text-align: right; font-size: 14px; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
|
|
166
|
+
.cwd-pct { text-align: right; font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
|
|
167
|
+
.cwd-up { color: var(--capital-watchlist-up); }
|
|
168
|
+
.cwd-down { color: var(--capital-watchlist-down); }
|
|
169
|
+
.cwd-flat { color: var(--dsw-alias-label-secondary); }
|
|
170
|
+
.cwd-stale { color: var(--dsw-alias-label-secondary); }
|
|
171
|
+
.cwd-rowactions { display: inline-flex; align-items: center; justify-content: flex-end; gap: 2px; }
|
|
172
|
+
.cwd-iconbtn { flex: none; width: 26px; height: 26px; display: inline-flex; align-items: center; justify-content: center; border: none; border-radius: var(--dsw-radius-sm); background: transparent; color: var(--dsw-alias-label-secondary); cursor: pointer; }
|
|
173
|
+
.cwd-iconbtn:hover:not(:disabled) { background: var(--dsw-alias-interactive-bg-hover-accent); color: var(--dsw-alias-label-primary); }
|
|
174
|
+
.cwd-iconbtn:disabled { opacity: .45; cursor: not-allowed; }
|
|
175
|
+
.cwd-detail { display: flex; flex: 1; flex-direction: column; gap: 12px; min-height: 0; padding: 16px; overflow-y: auto; }
|
|
176
|
+
.cwd-detailhead { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; min-width: 0; }
|
|
177
|
+
.cwd-detailname { display: flex; align-items: center; gap: 8px; min-width: 0; font-size: 16px; line-height: 22px; font-weight: 600; }
|
|
178
|
+
.cwd-detailtext { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
|
|
179
|
+
.cwd-detailcode { margin-top: 3px; font-size: 12px; line-height: 17px; color: var(--dsw-alias-label-tertiary); }
|
|
180
|
+
.cwd-bigquote { display: flex; align-items: baseline; flex-wrap: wrap; gap: 10px; }
|
|
181
|
+
.cwd-bigprice { font-size: 34px; line-height: 40px; font-weight: 650; font-variant-numeric: tabular-nums; }
|
|
182
|
+
.cwd-bigpct { font-size: 14px; line-height: 20px; font-weight: 600; font-variant-numeric: tabular-nums; }
|
|
183
|
+
.cwd-quoterow { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; }
|
|
184
|
+
.cwd-meta { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 4px 20px; padding-bottom: 4px; }
|
|
185
|
+
.cwd-metaitem { display: flex; align-items: baseline; gap: 6px; }
|
|
186
|
+
.cwd-metalabel { flex: none; font-size: 11px; line-height: 16px; color: var(--dsw-alias-label-tertiary); }
|
|
187
|
+
.cwd-metavalue { font-size: 12px; line-height: 16px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
|
|
188
|
+
.cwd-block { flex: none; padding-top: 12px; border-top: .5px solid var(--dsw-alias-border-l2); }
|
|
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
|
+
.cwd-blockhead { display: flex; flex: none; align-items: baseline; gap: 12px; margin-bottom: 8px; }
|
|
193
|
+
.cwd-blocktitle { flex: none; font-size: 12.5px; line-height: 18px; font-weight: 600; }
|
|
194
|
+
.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
|
+
.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
|
+
.cwd-charttext { font-size: 12.5px; line-height: 18px; font-weight: 500; color: var(--dsw-alias-label-secondary); }
|
|
199
|
+
.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; }
|
|
202
|
+
.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; }
|
|
205
|
+
.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
|
+
/* The daily pane shares the SVG contract above (absolute child, determinate height): a flexed chart
|
|
207
|
+
next to a scrolled column is exactly how the container used to grow. */
|
|
208
|
+
.cwd-block-kline { flex: 1 1 0; display: flex; flex-direction: column; min-height: 220px; }
|
|
209
|
+
.cwd-klinebox { position: relative; flex: 1; min-height: 140px; min-width: 0; overflow: hidden; border-radius: 10px; background: var(--dsw-alias-bg-module-platform); }
|
|
210
|
+
.cwd-malegend { display: flex; flex: 1 1 auto; flex-wrap: wrap; gap: 2px 12px; min-width: 0; font-size: 11px; line-height: 16px; font-variant-numeric: tabular-nums; }
|
|
211
|
+
.cwd-candle-up { fill: var(--capital-watchlist-up); stroke: var(--capital-watchlist-up); stroke-width: 1; }
|
|
212
|
+
.cwd-candle-down { fill: var(--capital-watchlist-down); stroke: var(--capital-watchlist-down); stroke-width: 1; }
|
|
213
|
+
.cwd-maline { fill: none; stroke-width: 1.1; stroke-linejoin: round; }
|
|
214
|
+
.cwd-ma5 { color: var(--dsw-alias-label-primary); stroke: var(--dsw-alias-label-primary); }
|
|
215
|
+
.cwd-ma10 { color: var(--dsw-alias-state-warn-primary); stroke: var(--dsw-alias-state-warn-primary); }
|
|
216
|
+
.cwd-ma20 { color: var(--dsw-alias-brand-primary); stroke: var(--dsw-alias-brand-primary); }
|
|
217
|
+
.cwd-ma60 { color: var(--dsw-alias-label-tertiary); stroke: var(--dsw-alias-label-tertiary); }
|
|
218
|
+
/* \u26D4 \u7EDD\u5BF9\u5B9A\u4F4D\u4E0D\u662F\u4E3A\u4E86\u53E0\u5C42\uFF1ASVG \u4E00\u65E6\u53C2\u4E0E\u6D41\u5F0F\u5E03\u5C40\uFF0CviewBox \u7684\u5BBD\u9AD8\u6BD4\u4F1A\u53CD\u63A8\u7236\u76D2\u9AD8\u5EA6\uFF0C
|
|
219
|
+
\u91CF\u6D4B\u56DE\u5199\u5C31\u628A\u5BB9\u5668\u8D8A\u6491\u8D8A\u5927\uFF08\u5B9E\u6D4B\u9010\u5E27\u589E\u957F\uFF09\u3002\u5B83\u5FC5\u987B\u6C38\u8FDC\u5F71\u54CD\u4E0D\u4E86\u81EA\u5DF1\u7684\u5BB9\u5668\u3002 */
|
|
220
|
+
.cwd-chartsvg { position: absolute; inset: 0; display: block; width: 100%; height: 100%; touch-action: pan-y; }
|
|
221
|
+
.cwd-chartaxis { fill: var(--dsw-alias-label-tertiary); font-size: 10.5px; font-variant-numeric: tabular-nums; }
|
|
222
|
+
.cwd-chartbaselabel { fill: var(--dsw-alias-label-secondary); }
|
|
223
|
+
.cwd-chartgrid { stroke: color-mix(in srgb, var(--dsw-alias-border-l2) 55%, transparent); stroke-width: 1; shape-rendering: crispEdges; }
|
|
224
|
+
.cwd-chartsep { stroke: var(--dsw-alias-border-l2); stroke-width: 1; stroke-dasharray: 2 3; }
|
|
225
|
+
.cwd-chartline { fill: none; stroke-width: 1.6; stroke-linejoin: round; stroke-linecap: round; }
|
|
226
|
+
.cwd-chartavg { fill: none; stroke: var(--dsw-alias-state-business-primary); stroke-width: 1; stroke-dasharray: 3 3; opacity: .85; }
|
|
227
|
+
.cwd-chartbase { stroke: var(--dsw-alias-label-tertiary); stroke-width: 1; opacity: .7; }
|
|
228
|
+
.cwd-chartcross { stroke: var(--dsw-alias-label-tertiary); stroke-width: 1; stroke-dasharray: 3 3; opacity: .8; }
|
|
229
|
+
.cwd-chartdot { fill: currentColor; }
|
|
230
|
+
.cwd-vol-up { fill: var(--capital-watchlist-up); opacity: .55; }
|
|
231
|
+
.cwd-vol-down { fill: var(--capital-watchlist-down); opacity: .55; }
|
|
232
|
+
.cwd-charttip { position: absolute; top: 8px; min-width: 150px; padding: 7px 9px; border-radius: 8px; border: .5px solid var(--dsw-alias-border-l2); background: var(--dsw-alias-bg-layer-2, var(--dsw-alias-bg-layer-1)); pointer-events: none; }
|
|
233
|
+
.cwd-charttiptime { font-size: 11px; line-height: 16px; color: var(--dsw-alias-label-tertiary); }
|
|
234
|
+
.cwd-charttipprice { font-size: 13px; line-height: 18px; font-weight: 600; font-variant-numeric: tabular-nums; }
|
|
235
|
+
.cwd-charttiprow { display: flex; justify-content: space-between; gap: 10px; font-size: 11px; line-height: 16px; color: var(--dsw-alias-label-secondary); font-variant-numeric: tabular-nums; }
|
|
236
|
+
.cwd-empty { flex: 1; display: flex; flex-direction: column; justify-content: center; padding: 34px 18px; text-align: center; }
|
|
237
|
+
.cwd-emptytitle { font-size: 14px; line-height: 20px; font-weight: 600; }
|
|
238
|
+
.cwd-emptyhint { margin: 6px 0 0; font-size: 12.5px; line-height: 19px; color: var(--dsw-alias-label-tertiary); }
|
|
239
|
+
.cwd-notice { display: flex; flex: none; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 14px; border-bottom: .5px solid var(--dsw-alias-border-l2); font-size: 12px; line-height: 18px; color: var(--dsw-alias-label-secondary); }
|
|
240
|
+
.cwd-notice-danger { color: var(--dsw-alias-state-error-primary); }
|
|
241
|
+
.cwd-error { flex: none; padding: 8px 14px; border-bottom: .5px solid var(--dsw-alias-border-l2); font-size: 12px; line-height: 18px; color: var(--dsw-alias-state-error-primary); }
|
|
242
|
+
.cwd-menuhint { padding: 6px 10px; font-size: 12px; line-height: 18px; color: var(--dsw-alias-label-tertiary); }
|
|
243
|
+
.cwd-menulist { width: 208px; }
|
|
244
|
+
.cwd-menulist button { box-sizing: border-box; }
|
|
245
|
+
.cwd-field:focus-within { outline: var(--dsw-focus-ring-width) solid var(--dsw-focus-ring-color, var(--dsw-alias-state-business-primary)); outline-offset: 1px; }
|
|
246
|
+
.cwd-page button:focus-visible, .cwd-groupcreate input:focus-visible { outline: var(--dsw-focus-ring-width) solid var(--dsw-focus-ring-color, var(--dsw-alias-state-business-primary)); outline-offset: 1px; }
|
|
247
|
+
.cwd-skeleton { display: block; height: 12px; border-radius: 6px; background: var(--dsw-alias-bg-skeleton); }
|
|
248
|
+
@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
|
+
@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;
|
|
131
252
|
return module.exports
|
|
132
253
|
},
|
|
133
254
|
})
|