stock-sdk 2.0.0 → 2.1.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/README.md +1 -1
- package/dist/chunk-3X645BZO.js +1 -0
- package/dist/chunk-ANBQABED.cjs +1 -0
- package/dist/chunk-KKBFAS5P.cjs +1 -0
- package/dist/chunk-WP37ZK2F.js +1 -0
- package/dist/cli.cjs +6 -6
- package/dist/cli.js +2 -2
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +12 -3
- package/dist/index.d.ts +12 -3
- package/dist/index.js +1 -1
- package/dist/mcp.cjs +2 -2
- package/dist/mcp.d.cts +1 -1
- package/dist/mcp.d.ts +1 -1
- package/dist/mcp.js +1 -1
- package/dist/{sdk-DOz03n_v.d.ts → sdk-B-hkKcZs.d.ts} +187 -1
- package/dist/{sdk-Cg_jTmTk.d.cts → sdk-CA1tOtb2.d.cts} +187 -1
- package/package.json +61 -16
- package/dist/chunk-2PYGJ5I5.cjs +0 -1
- package/dist/chunk-4PVVFEOQ.js +0 -1
- package/dist/chunk-GBHWMR2O.js +0 -1
- package/dist/chunk-YR2SVSXB.cjs +0 -1
package/README.md
CHANGED
|
@@ -275,7 +275,7 @@ import { SdkError, isSdkError, getSdkErrorCode } from 'stock-sdk/errors';
|
|
|
275
275
|
| `sdk.marketEvent` | `.ztPool` / `.stockChanges` / `.boardChanges` |
|
|
276
276
|
| `sdk.dragonTiger` | `.detail` / `.stockStats` / `.institution` / `.branchRank` / `.seatDetail` |
|
|
277
277
|
| `sdk.blockTrade` / `sdk.margin` | 大宗交易 / 融资融券 |
|
|
278
|
-
| `sdk.fund` | `.dividendList` / `.navHistory` / `.estimate` / `.rankHistory` |
|
|
278
|
+
| `sdk.fund` | `.dividendList` / `.navHistory` / `.estimate` / `.rankHistory` / `.profile` |
|
|
279
279
|
| `sdk.calendar` | `.isTradingDay` / `.nextTradingDay` / `.prevTradingDay` / `.marketStatus` |
|
|
280
280
|
| `sdk.reference` | `.dividendDetail` / `.tradingCalendar` |
|
|
281
281
|
| 顶层 | `sdk.search(keyword)` |
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{t as Mn,v as Nn,w as dt}from"./chunk-G5KF73BW.js";import{d as J,e as In,f as bn,h as ee}from"./chunk-D2MGPO3R.js";import{b as ne}from"./chunk-DU7MCVLJ.js";import{a as C,b as j,c as X,d as ut,e as h,g as lt,h as ct,k as Z,l as Be}from"./chunk-UBIQBXQ7.js";import{a as at}from"./chunk-WOT6VMZA.js";function pt(t){return new TextDecoder("gbk").decode(t)}function mt(t){let e=t.split(";").map(r=>r.trim()).filter(Boolean),n=[];for(let r of e){let o=r.indexOf("=");if(o<0)continue;let i=r.slice(0,o).trim();i.startsWith("v_")&&(i=i.slice(2));let a=r.slice(o+1).trim();a.startsWith('"')&&a.endsWith('"')&&(a=a.slice(1,-1));let u=a.split("~");n.push({key:i,fields:u})}return n}function gt(t){let e=t.trim();return e===""||e==="-"||e==="--"}function f(t){if(!t||t==="")return 0;let e=parseFloat(t);return Number.isNaN(e)?0:e}function _(t){if(!t||gt(t))return null;let e=parseFloat(t);return Number.isNaN(e)?null:e}function m(t){if(!t||gt(t))return null;let e=parseFloat(t);return Number.isNaN(e)?null:e}function s(t){return t==null?null:m(String(t))}function M(t){if(t==null)return null;if(typeof t=="number")return Number.isFinite(t)?t:null;if(gt(t))return null;let e=Number(t);return Number.isFinite(e)?e:null}var Ko=new Set(["daily","weekly","monthly"]),Bo=new Set(["1","5","15","30","60"]),Ho=new Set(["","qfq","hfq"]);function G(t,e){if(!Number.isFinite(t)||!Number.isInteger(t)||t<=0)throw new h(`${e} must be a positive integer`,{argument:e,value:t})}function q(t){if(!Ko.has(t))throw new h("period must be one of: daily, weekly, monthly",{argument:"period",value:t})}function ft(t){if(!Bo.has(t))throw new h("period must be one of: 1, 5, 15, 30, 60",{argument:"period",value:t})}function W(t){if(!Ho.has(t))throw new h("adjust must be one of: '', 'qfq', 'hfq'",{argument:"adjust",value:t})}function He(t){if(t!=="north"&&t!=="south")throw new h("direction must be one of: 'north', 'south'",{argument:"direction",value:t})}function ce(t,e){G(e,"chunkSize");let n=[];for(let r=0;r<t.length;r+=e)n.push(t.slice(r,r+e));return n}async function de(t,e,n=!1){if(G(e,"concurrency"),t.length===0)return[];let r=n?new Array(t.length):[],o=0,i=Array.from({length:Math.min(e,t.length)},async()=>{for(;;){let a=o++;if(a>=t.length)return;let u=await t[a]();n?r[a]=u:r.push(u)}});return await Promise.all(i),r}function z(t){return{daily:"101",weekly:"102",monthly:"103"}[t]}function V(t){return{"":"0",qfq:"1",hfq:"2"}[t]}var qo=typeof document<"u"&&typeof window<"u",zo=0;function kn(){return`__stock_sdk_jsonp_${Date.now()}_${zo++}`}function qe(t){let e=t,n=e.indexOf("*/");n!==-1&&(e=e.slice(n+2).trim());let r=e.indexOf("(");if(r===-1)throw new C({code:"PARSE_ERROR",message:"Invalid JSONP response: no opening parenthesis found"});let o=e.lastIndexOf(")");if(o===-1||o<=r)throw new C({code:"PARSE_ERROR",message:"Invalid JSONP response: no closing parenthesis found"});let i=e.slice(r+1,o);try{return JSON.parse(i)}catch(a){throw new C({code:"PARSE_ERROR",message:"Invalid JSONP response: payload is not valid JSON",cause:a})}}function $o(t,e){let{timeout:n=15e3,callbackParam:r="callback",callbackMode:o="query"}=e;return new Promise((i,a)=>{let u=kn(),l;if(o==="path")l=t.replace("{callback}",u);else{let R=t.includes("?")?"&":"?";l=`${t}${R}${r}=${u}`}let c=document.createElement("script"),d=!1,y=window,p=()=>{c.parentNode&&c.parentNode.removeChild(c),delete y[u]},T=setTimeout(()=>{d||(d=!0,p(),a(new C({code:"TIMEOUT",message:`JSONP request timed out after ${n}ms: ${t}`,url:t,details:{timeout:n}})))},n);y[u]=R=>{d||(d=!0,clearTimeout(T),p(),i(R))},c.onerror=()=>{d||(d=!0,clearTimeout(T),p(),a(new C({code:"NETWORK_ERROR",message:`JSONP script load failed: ${t}`,url:t})))},c.src=l,document.head.appendChild(c)})}async function Qo(t,e){let{timeout:n=15e3,callbackParam:r="callback",callbackMode:o="query"}=e,i=kn(),a;if(o==="path")a=t.replace("{callback}",i);else{let c=t.includes("?")?"&":"?";a=`${t}${c}${r}=${i}`}let u=new AbortController,l=setTimeout(()=>u.abort(),n);try{let c=await fetch(a,{signal:u.signal});if(!c.ok)throw new j(c.status,c.statusText,t);let d=await c.text();return qe(d)}catch(c){throw c instanceof DOMException&&c.name==="AbortError"?new C({code:"TIMEOUT",message:`JSONP request timed out after ${n}ms: ${t}`,url:t,details:{timeout:n}}):c instanceof C?c:new C({code:"NETWORK_ERROR",message:`JSONP request failed: ${c instanceof Error?c.message:String(c)}`,url:t,cause:c})}finally{clearTimeout(l)}}function x(t,e={}){return qo?$o(t,e):Qo(t,e)}var Ln=new Map;async function pe(t,e){let r=(Ln.get(t)??Promise.resolve()).then(e,e);return Ln.set(t,r.then(()=>{},()=>{})),r}function jo(){return typeof document<"u"&&typeof window<"u"}var Go=15e3,Yo="jsVars";async function se(t,e,n={}){let r=n.timeout??Go;return jo()?pe(Yo,()=>Wo(t,e,r)):Vo(t,e,r,n.headers,n.client)}function yt(t,e){let n={};for(let r of e){let o=Xo(t,r);o!==void 0&&(n[r]=o)}return n}function Wo(t,e,n){return new Promise((r,o)=>{let i=document.createElement("script"),a=!1,u=()=>{i.parentNode&&i.parentNode.removeChild(i)},l=setTimeout(()=>{a||(a=!0,u(),o(new C({code:"TIMEOUT",message:`fetchJsVars timed out after ${n}ms: ${t}`,url:t,details:{timeout:n}})))},n);i.onload=()=>{if(a)return;a=!0,clearTimeout(l);let c=window,d={};for(let y of e)if(y in c){d[y]=c[y];try{delete c[y]}catch{}}u(),r(d)},i.onerror=()=>{a||(a=!0,clearTimeout(l),u(),o(new C({code:"NETWORK_ERROR",message:`fetchJsVars script load failed: ${t}`,url:t})))},i.src=t,document.head.appendChild(i)})}async function Vo(t,e,n,r,o){if(o){let u=await o.get(t,{responseType:"text"});return yt(u,e)}let i=new AbortController,a=setTimeout(()=>i.abort(),n);try{let u=await fetch(t,{signal:i.signal,headers:r});if(!u.ok)throw new j(u.status,u.statusText,t);let l=await u.text();return yt(l,e)}catch(u){throw u instanceof DOMException&&u.name==="AbortError"?new C({code:"TIMEOUT",message:`fetchJsVars timed out after ${n}ms: ${t}`,url:t,details:{timeout:n}}):u instanceof C?u:new C({code:"NETWORK_ERROR",message:`fetchJsVars failed: ${u instanceof Error?u.message:String(u)}`,url:t,cause:u})}finally{clearTimeout(a)}}function Xo(t,e){let r=new RegExp(`(?:^|[^\\w$])(?:var|let|const)\\s+${Jo(e)}\\s*=\\s*`,"m").exec(t);if(!r)return;let o=r.index+r[0].length,i=ei(t,o),a=t.slice(o,i).trim();try{return JSON.parse(a)}catch{try{return JSON.parse(Zo(a))}catch{return}}}function Zo(t){let e="",n=null;for(let r=0;r<t.length;r++){let o=t[r];if(n==='"'){e+=o,o==="\\"&&r+1<t.length?e+=t[++r]:o==='"'&&(n=null);continue}if(n==="'"){if(o==="\\"&&r+1<t.length){let i=t[++r];e+=i==="'"?"'":"\\"+i;continue}if(o==="'"){e+='"',n=null;continue}e+=o==='"'?'\\"':o;continue}if(o==='"'){n='"',e+=o;continue}if(o==="'"){n="'",e+='"';continue}e+=o}return e}function Jo(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function ei(t,e){let n=0,r=null;for(let o=e;o<t.length;o++){let i=t[o];if(r){if(i==="\\"){o++;continue}i===r&&(r=null);continue}if(i==='"'||i==="'"){r=i;continue}if(i==="["||i==="{"||i==="("){n++;continue}if(i==="]"||i==="}"||i===")"){n--;continue}if(i===";"&&n===0)return o}return t.length}var E={CN:"Asia/Shanghai",HK:"Asia/Hong_Kong",US:"America/New_York"};function ti(t){if(!t)return null;let e=t.trim();if(!e)return null;let n=/^(\d{4})-(\d{2})-(\d{2})[T ](\d{2}):(\d{2})(?::(\d{2}))?$/.exec(e);if(n)return{year:+n[1],month:+n[2],day:+n[3],hour:+n[4],minute:+n[5],second:n[6]?+n[6]:0};let r=/^(\d{4})-(\d{2})-(\d{2})$/.exec(e);return r?{year:+r[1],month:+r[2],day:+r[3],hour:0,minute:0,second:0}:/^\d{14}$/.test(e)?{year:+e.slice(0,4),month:+e.slice(4,6),day:+e.slice(6,8),hour:+e.slice(8,10),minute:+e.slice(10,12),second:+e.slice(12,14)}:/^\d{8}$/.test(e)?{year:+e.slice(0,4),month:+e.slice(4,6),day:+e.slice(6,8),hour:0,minute:0,second:0}:null}var ni={wallParts:{locale:"en-US",keyPrefix:"en-US|",options:{hour12:!1,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"}},svDisplay:{locale:"sv-SE",keyPrefix:"sv-SE|",options:{hour12:!1,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"}},dateOnly:{locale:"en-CA",keyPrefix:"en-CA|",options:{year:"numeric",month:"2-digit",day:"2-digit"}}},Fn=new Map;function Tt(t,e){let n=ni[t],r=n.keyPrefix+e,o=Fn.get(r);return o||(o=new Intl.DateTimeFormat(n.locale,{timeZone:e,...n.options}),Fn.set(r,o)),o}function me(t,e){let r=Tt("wallParts",e).formatToParts(new Date(t)),o={};for(let a of r)a.type!=="literal"&&(o[a.type]=a.value);let i=parseInt(o.hour??"0",10);return i===24&&(i=0),Date.UTC(parseInt(o.year??"0",10),parseInt(o.month??"1",10)-1,parseInt(o.day??"1",10),i,parseInt(o.minute??"0",10),parseInt(o.second??"0",10))}var xn=new Map;function Un(t,e){return me(t,e)-t}function ri(t,e){let n=`${t}|${e}`,r=xn.get(n);if(r===void 0){let o=Un(Date.UTC(e,0,1,12),t);for(let i=1;i<12;i++)if(Un(Date.UTC(e,i,1,12),t)!==o){o=null;break}r=o,xn.set(n,r)}return r}function wn(t,e){if(!(t.month===1&&t.day<=2||t.month===12&&t.day>=30)){let a=ri(e,t.year);if(a!==null)return Date.UTC(t.year,t.month-1,t.day,t.hour,t.minute,t.second)-a}let r=Date.UTC(t.year,t.month-1,t.day,t.hour,t.minute,t.second),o=2*r-me(r,e);if(me(o,e)===r)return o;let i=r-me(o,e)+o;return me(i,e)===r?i:o}function oi(t,e){let n=(t||"").trim(),r=/^(\d{4})-(\d{2})-(\d{2})$/.exec(n)??/^(\d{4})(\d{2})(\d{2})$/.exec(n);if(!r)return null;let o=/^(\d{2}):(\d{2})(?::(\d{2}))?$/.exec((e||"").trim());return o?{year:+r[1],month:+r[2],day:+r[3],hour:+o[1],minute:+o[2],second:o[3]?+o[3]:0}:null}function ae(t,e){let n=ti(t);return n?wn(n,e):NaN}function re(t){return Number.isNaN(t)?null:t}function k(t,e){return{timestamp:re(ae(t,e)),tz:e}}function ge(t,e){let[n,r,o]=t.split("-").map(Number);return new Date(Date.UTC(n,r-1,o+e)).toISOString().slice(0,10)}function ht(t,e,n){let r=oi(t,e);return r?{timestamp:re(wn(r,n)),tz:n}:{timestamp:null,tz:n}}function St(t,e){if(t==null||!Number.isFinite(t))return"";let n=Tt("svDisplay",e).format(new Date(t)),r=n.match(/^(\d{4}-\d{2}-\d{2})[ T](\d{2}):(\d{2})/);if(!r)return n;let o=r[2]==="24"?"00":r[2];return`${r[1]} ${o}:${r[3]}`}function Y(t,e=Date.now()){return Tt("dateOnly",t).format(new Date(e))}var Et="https://qt.gtimg.cn",Rt="https://web.ifzq.gtimg.cn/appstock/app/minute/query",_t="https://assets.linkdiary.cn/shares/zh_a_list.json",Ct="https://assets.linkdiary.cn/shares/us_list.json",At="https://assets.linkdiary.cn/shares/hk_list.json",ze="https://assets.linkdiary.cn/shares/fund_list",Ot="https://assets.linkdiary.cn/shares/trade-data-list.txt",$e="https://push2his.eastmoney.com/api/qt/stock/kline/get",Pt="https://push2his.eastmoney.com/api/qt/stock/trends2/get",Qe="https://33.push2his.eastmoney.com/api/qt/stock/kline/get",je="https://63.push2his.eastmoney.com/api/qt/stock/kline/get",Dt="https://33.push2his.eastmoney.com/api/qt/stock/trends2/get",It="https://63.push2his.eastmoney.com/api/qt/stock/trends2/get",bt="https://17.push2.eastmoney.com/api/qt/clist/get",Mt="https://91.push2.eastmoney.com/api/qt/stock/get",Nt="https://29.push2.eastmoney.com/api/qt/clist/get",kt="https://7.push2his.eastmoney.com/api/qt/stock/kline/get",Lt="https://push2his.eastmoney.com/api/qt/stock/trends2/get",Ft="https://79.push2.eastmoney.com/api/qt/clist/get",xt="https://91.push2.eastmoney.com/api/qt/stock/get",Ut="https://29.push2.eastmoney.com/api/qt/clist/get",wt="https://91.push2his.eastmoney.com/api/qt/stock/kline/get",vt="https://push2his.eastmoney.com/api/qt/stock/trends2/get",Kt="https://datacenter-web.eastmoney.com/api/data/v1/get",fe="https://push2his.eastmoney.com/api/qt/stock/fflow/daykline/get",Bt="https://push2.eastmoney.com/api/qt/clist/get",Ht="https://push2.eastmoney.com/api/qt/kamtbs.rtmin/get",ye="https://push2ex.eastmoney.com",L="7eea3edcaed734bea9cbfc24409ed989",$="b2884a393a59ad64002292a3e90d46a5",Te="https://push2his.eastmoney.com/api/qt/stock/kline/get",qt="https://futsseapi.eastmoney.com/list/COMEX,NYMEX,COBOT,SGX,NYBOT,LME,MDEX,TOCOM,IPE",he="58b2fa8f54638b60b87d69b31969089c",zt={SHFE:113,DCE:114,CZCE:115,INE:142,CFFEX:220,GFEX:225},ue={cu:"SHFE",al:"SHFE",zn:"SHFE",pb:"SHFE",au:"SHFE",ag:"SHFE",rb:"SHFE",wr:"SHFE",fu:"SHFE",ru:"SHFE",bu:"SHFE",hc:"SHFE",ni:"SHFE",sn:"SHFE",sp:"SHFE",ss:"SHFE",ao:"SHFE",br:"SHFE",c:"DCE",a:"DCE",b:"DCE",m:"DCE",y:"DCE",p:"DCE",l:"DCE",v:"DCE",j:"DCE",jm:"DCE",i:"DCE",jd:"DCE",pp:"DCE",cs:"DCE",eg:"DCE",eb:"DCE",pg:"DCE",lh:"DCE",WH:"CZCE",CF:"CZCE",SR:"CZCE",TA:"CZCE",OI:"CZCE",MA:"CZCE",FG:"CZCE",RM:"CZCE",SF:"CZCE",SM:"CZCE",ZC:"CZCE",AP:"CZCE",CJ:"CZCE",UR:"CZCE",SA:"CZCE",PF:"CZCE",PK:"CZCE",PX:"CZCE",SH:"CZCE",sc:"INE",nr:"INE",lu:"INE",bc:"INE",ec:"INE",IF:"CFFEX",IC:"CFFEX",IH:"CFFEX",IM:"CFFEX",TS:"CFFEX",TF:"CFFEX",T:"CFFEX",TL:"CFFEX",si:"GFEX",lc:"GFEX",ps:"GFEX",pt:"GFEX",pd:"GFEX"},Ge={HG:101,GC:101,SI:101,QI:101,QO:101,MGC:101,CL:102,NG:102,RB:102,HO:102,PA:102,PL:102,ZW:103,ZM:103,ZS:103,ZC:103,ZL:103,ZR:103,YM:103,NQ:103,ES:103,SB:108,CT:108,LCPT:109,LZNT:109,LALT:109},Se="https://stock.finance.sina.com.cn/futures/api/openapi.php/OptionService.getOptionData",Ee="https://stock.finance.sina.com.cn/futures/api/jsonp.php/{callback}/FutureOptionAllService.getOptionDayline",$t="https://stock.finance.sina.com.cn/futures/api/openapi.php/StockOptionService.getStockName",Ye="https://stock.finance.sina.com.cn/futures/api/openapi.php/StockOptionService.getRemainderDay",Qt="https://stock.finance.sina.com.cn/futures/api/openapi.php/StockOptionDaylineService.getOptionMinline",jt="https://stock.finance.sina.com.cn/futures/api/jsonp_v2.php/{callback}/StockOptionDaylineService.getSymbolInfo",Gt="https://stock.finance.sina.com.cn/futures/api/openapi.php/StockOptionDaylineService.getFiveDayLine",Yt="https://futsseapi.eastmoney.com/list/option/221",Wt="https://datacenter-web.eastmoney.com/api/data/get";var We={au:{product:"au_o",exchange:"shfe"},ag:{product:"ag_o",exchange:"shfe"},cu:{product:"cu_o",exchange:"shfe"},al:{product:"al_o",exchange:"shfe"},zn:{product:"zn_o",exchange:"shfe"},ru:{product:"ru_o",exchange:"shfe"},sc:{product:"sc_o",exchange:"ine"},m:{product:"m_o",exchange:"dce"},c:{product:"c_o",exchange:"dce"},i:{product:"i_o",exchange:"dce"},p:{product:"p_o",exchange:"dce"},pp:{product:"pp_o",exchange:"dce"},l:{product:"l_o",exchange:"dce"},v:{product:"v_o",exchange:"dce"},pg:{product:"pg_o",exchange:"dce"},y:{product:"y_o",exchange:"dce"},a:{product:"a_o",exchange:"dce"},b:{product:"b_o",exchange:"dce"},eg:{product:"eg_o",exchange:"dce"},eb:{product:"eb_o",exchange:"dce"},SR:{product:"SR_o",exchange:"czce"},CF:{product:"CF_o",exchange:"czce"},TA:{product:"TA_o",exchange:"czce"},MA:{product:"MA_o",exchange:"czce"},RM:{product:"RM_o",exchange:"czce"},OI:{product:"OI_o",exchange:"czce"},PK:{product:"PK_o",exchange:"czce"},PF:{product:"PF_o",exchange:"czce"},SA:{product:"SA_o",exchange:"czce"},UR:{product:"UR_o",exchange:"czce"}},Vt=3e4,Re=500,_e=500,Ce=7,Xt=3,Zt=1e3,Jt=3e4,en=2,tn=[408,429,500,502,503,504];var Ve=class{constructor(e={}){this.acquireChain=Promise.resolve();let n=e.requestsPerSecond??5;this.maxTokens=e.maxBurst??n,this.tokens=this.maxTokens,this.refillRate=n/1e3,this.lastRefillTime=Date.now()}refill(){let e=Date.now(),r=(e-this.lastRefillTime)*this.refillRate;this.tokens=Math.min(this.maxTokens,this.tokens+r),this.lastRefillTime=e}tryAcquire(){return this.refill(),this.tokens>=1?(this.tokens-=1,!0):!1}getWaitTime(){if(this.refill(),this.tokens>=1)return 0;let e=1-this.tokens;return Math.ceil(e/this.refillRate)}async acquire(){let e=this.acquireChain,n;this.acquireChain=new Promise(r=>{n=r});try{await e;let r=this.getWaitTime();r>0&&await this.sleep(r),this.refill(),this.tokens-=1}finally{n()}}sleep(e){return new Promise(n=>setTimeout(n,e))}getAvailableTokens(){return this.refill(),this.tokens}};var vn=["Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36","Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/119.0.0.0 Safari/537.36","Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/118.0.0.0 Safari/537.36","Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36","Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/119.0.0.0 Safari/537.36","Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:121.0) Gecko/20100101 Firefox/121.0","Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:120.0) Gecko/20100101 Firefox/120.0","Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:121.0) Gecko/20100101 Firefox/121.0","Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/17.2 Safari/605.1.15","Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/17.1 Safari/605.1.15","Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36 Edg/120.0.0.0","Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/119.0.0.0 Safari/537.36 Edg/119.0.0.0"],nn=0;function ii(){return typeof window<"u"&&typeof window.document<"u"}function Kn(){if(ii())return;let t=vn[nn];return nn=(nn+1)%vn.length,t}var le=class extends C{constructor(e="Circuit breaker is OPEN"){super({code:"CIRCUIT_OPEN",message:e}),this.name="CircuitBreakerError"}},Xe=class{constructor(e={}){this.state="CLOSED";this.failureCount=0;this.lastFailureTime=0;this.halfOpenSuccessCount=0;this.halfOpenProbeStartedAt=[];this.failureThreshold=e.failureThreshold??5,this.resetTimeout=e.resetTimeout??3e4,this.halfOpenRequests=e.halfOpenRequests??1,this.probeRecycleTimeout=e.probeRecycleTimeout??Math.max(this.resetTimeout*4,12e4),this.onStateChange=e.onStateChange}getState(){return this.checkStateTransition(),this.state}canRequest(){switch(this.checkStateTransition(),this.state){case"CLOSED":return!0;case"OPEN":return!1;case"HALF_OPEN":{let e=Date.now();for(;this.halfOpenProbeStartedAt.length>0&&e-this.halfOpenProbeStartedAt[0]>=this.probeRecycleTimeout;)this.halfOpenProbeStartedAt.shift();return this.halfOpenProbeStartedAt.length+this.halfOpenSuccessCount>=this.halfOpenRequests?!1:(this.halfOpenProbeStartedAt.push(e),!0)}}}releaseProbe(){this.state==="HALF_OPEN"&&this.halfOpenProbeStartedAt.shift()}recordSuccess(){this.checkStateTransition(),this.state==="HALF_OPEN"?(this.halfOpenProbeStartedAt.shift(),this.halfOpenSuccessCount++,this.halfOpenSuccessCount>=this.halfOpenRequests&&this.transitionTo("CLOSED")):this.state==="CLOSED"&&(this.failureCount=0)}recordFailure(){this.lastFailureTime=Date.now(),this.state==="HALF_OPEN"?(this.halfOpenProbeStartedAt.shift(),this.transitionTo("OPEN")):this.state==="CLOSED"&&(this.failureCount++,this.failureCount>=this.failureThreshold&&this.transitionTo("OPEN"))}checkStateTransition(){this.state==="OPEN"&&Date.now()-this.lastFailureTime>=this.resetTimeout&&this.transitionTo("HALF_OPEN")}transitionTo(e){if(this.state===e)return;let n=this.state;this.state=e,e==="CLOSED"?(this.failureCount=0,this.halfOpenSuccessCount=0,this.halfOpenProbeStartedAt=[]):e==="HALF_OPEN"&&(this.halfOpenSuccessCount=0,this.halfOpenProbeStartedAt=[]),this.onStateChange?.(n,e)}reset(){this.transitionTo("CLOSED"),this.failureCount=0,this.halfOpenSuccessCount=0,this.halfOpenProbeStartedAt=[],this.lastFailureTime=0}async execute(e){if(!this.canRequest())throw new le;try{let n=await e();return this.recordSuccess(),n}catch(n){throw this.recordFailure(),n}}getStats(){return{state:this.getState(),failureCount:this.failureCount,lastFailureTime:this.lastFailureTime,halfOpenSuccessCount:this.halfOpenSuccessCount}}};var si=3e4,ai=1,Bn=["push2his.eastmoney.com","7.push2his.eastmoney.com","33.push2his.eastmoney.com","63.push2his.eastmoney.com","91.push2his.eastmoney.com"],Hn=["17.push2.eastmoney.com","29.push2.eastmoney.com","79.push2.eastmoney.com","91.push2.eastmoney.com"];function ui(t,e){return e!=="eastmoney"?[t]:t.includes("push2his.eastmoney.com")?Bn:t.includes("push2.eastmoney.com")?Hn:[t]}function li(t){return Array.from(new Set(t))}var Ze=class{constructor(e=si,n=ai){this.cooldownMs=e;this.failureThreshold=n;this.states=new Map}getCandidateUrls(e,n){let r;try{r=new URL(e)}catch{return[e]}let o=Date.now(),i=ui(r.hostname,n);if(i.length<=1)return[e];let a=i.filter(c=>{let d=this.states.get(c);return!d||d.cooldownUntil<=o}),u=i.filter(c=>{let d=this.states.get(c);return d&&d.cooldownUntil>o});return li([...a.includes(r.hostname)?[r.hostname]:[],...a.filter(c=>c!==r.hostname),...u.includes(r.hostname)?[r.hostname]:[],...u.filter(c=>c!==r.hostname)]).map(c=>{let d=new URL(e);return d.hostname=c,d.toString()})}recordSuccess(e){let n=this.safeGetHost(e);if(!n)return;let r=this.getState(n);r.failureCount=0,r.cooldownUntil=0,r.successCount++,r.lastErrorCode=void 0}recordFailure(e,n){let r=this.safeGetHost(e);if(!r)return;let o=this.getState(r);o.failureCount++,o.lastFailureAt=Date.now(),o.lastErrorCode=Z(n),o.failureCount>=this.failureThreshold&&(o.cooldownUntil=Date.now()+this.cooldownMs)}shouldFallback(e){let n=Z(e);return n==="NETWORK_ERROR"||n==="TIMEOUT"||n==="PARSE_ERROR"?!0:e instanceof j?e.status===408||e.status===429||e.status>=500:!1}getStats(e){let n=Array.from(this.states.values()).map(o=>({...o}));if(!e)return n;if(e!=="eastmoney")return[];let r=new Set([...Bn,...Hn]);return n.filter(o=>r.has(o.host))}safeGetHost(e){try{return new URL(e).hostname}catch{return null}}getState(e){let n=this.states.get(e);if(n)return n;let r={host:e,failureCount:0,successCount:0,cooldownUntil:0,lastFailureAt:0};return this.states.set(e,r),r}};function ci(t){return{maxRetries:t?.maxRetries??Xt,baseDelay:t?.baseDelay??Zt,maxDelay:t?.maxDelay??Jt,backoffMultiplier:t?.backoffMultiplier??en,retryableStatusCodes:t?.retryableStatusCodes??tn,retryOnNetworkError:t?.retryOnNetworkError??!0,retryOnTimeout:t?.retryOnTimeout??!0,onRetry:t?.onRetry}}function di(t,e){let n={...t??{}};return e&&(Object.keys(n).some(o=>o.toLowerCase()==="user-agent")||(n["User-Agent"]=e)),n}function qn(t,e){return e?{timeout:e.timeout??t.timeout,retry:e.retry?{...t.retry??{},...e.retry}:t.retry?{...t.retry}:void 0,headers:{...t.headers??{},...e.headers??{}},userAgent:e.userAgent??t.userAgent,rateLimit:e.rateLimit?{...t.rateLimit??{},...e.rateLimit}:t.rateLimit?{...t.rateLimit}:void 0,rotateUserAgent:e.rotateUserAgent??t.rotateUserAgent,circuitBreaker:e.circuitBreaker?{...t.circuitBreaker??{},...e.circuitBreaker}:t.circuitBreaker?{...t.circuitBreaker}:void 0}:{...t,headers:{...t.headers??{}},retry:t.retry?{...t.retry}:void 0,rateLimit:t.rateLimit?{...t.rateLimit}:void 0,circuitBreaker:t.circuitBreaker?{...t.circuitBreaker}:void 0}}function rn(t={}){return{timeout:t.timeout??Vt,retry:ci(t.retry),headers:di(t.headers,t.userAgent),rotateUserAgent:t.rotateUserAgent??!1,rateLimit:t.rateLimit?{...t.rateLimit}:void 0,circuitBreaker:t.circuitBreaker?{...t.circuitBreaker}:void 0}}function zn(t,e){if(e)return e;try{let n=new URL(t).hostname;if(n.includes("eastmoney.com"))return"eastmoney";if(n.includes("gtimg.cn"))return"tencent";if(n.includes("sina.com.cn"))return"sina";if(n.includes("linkdiary.cn"))return"linkdiary"}catch{return"unknown"}return"unknown"}function $n(t){if(t instanceof DOMException&&t.name==="AbortError")return!0;if(t instanceof Error){if(t.name==="AbortError")return!0;let e=t.cause;if((e instanceof Error||e instanceof DOMException)&&e.name==="AbortError")return!0}return!1}var on=()=>{};function pi(t){let e=t.filter(u=>!!u);if(e.length===0)return{signal:void 0,cleanup:on};if(e.length===1)return{signal:e[0],cleanup:on};let n=AbortSignal.any;if(typeof n=="function")return{signal:n(e),cleanup:on};let r=new AbortController,o=u=>{r.signal.aborted||r.abort(u)},i=[];for(let u of e){if(u.aborted){o(u.reason);break}let l=()=>o(u.reason);u.addEventListener("abort",l,{once:!0}),i.push({s:u,handler:l})}let a=()=>{for(let{s:u,handler:l}of i)u.removeEventListener("abort",l)};return{signal:r.signal,cleanup:a}}async function mi(t,e){if(!t)return e;if(Promise.resolve(e).catch(()=>{}),t.aborted)return Promise.race([e,Promise.reject(t.reason)]);let n,r=new Promise((o,i)=>{n=()=>i(t.reason),t.addEventListener("abort",n,{once:!0})});try{return await Promise.race([e,r])}finally{t.removeEventListener("abort",n)}}var Ae=class{constructor(e={}){this.baseUrl=e.baseUrl??Et;let n={timeout:e.timeout,retry:e.retry,headers:e.headers,userAgent:e.userAgent,rateLimit:e.rateLimit,rotateUserAgent:e.rotateUserAgent,circuitBreaker:e.circuitBreaker};this.defaultPolicy=rn(n),this.providerPolicies={},this.runtimeStates=new Map,this.fallbackManager=new Ze,this.fetchImpl=e.fetchImpl,this.clientSignal=e.signal,this.hooks=e.hooks;for(let[r,o]of Object.entries(e.providerPolicies??{})){let i=qn(n,o);this.providerPolicies[r]=rn(i)}}getProviderState(e){let n=this.runtimeStates.get(e);if(n)return n;let r=this.providerPolicies[e]??this.defaultPolicy,o={policy:r,rateLimiter:r.rateLimit?new Ve(r.rateLimit):null,circuitBreaker:r.circuitBreaker?new Xe(r.circuitBreaker):null};return this.runtimeStates.set(e,o),o}getTimeout(){return this.defaultPolicy.timeout}getHostHealth(e){return this.fallbackManager.getStats(e)}safe(e){try{e()}catch{}}toSdkError(e){return e instanceof C?e:new C({code:Z(e)??"NETWORK_ERROR",message:e.message,provider:e.provider,url:e.url,status:e.status,details:e.details,cause:e})}calculateDelay(e,n){return Math.min(n.baseDelay*Math.pow(n.backoffMultiplier,e),n.maxDelay)+Math.random()*100}sleep(e){return new Promise(n=>setTimeout(n,e))}shouldRetry(e,n,r){if(n>=r.maxRetries)return!1;let o=Z(e);return o==="ABORTED"?!1:o==="TIMEOUT"?r.retryOnTimeout:o==="NETWORK_ERROR"?r.retryOnNetworkError:e instanceof j?r.retryableStatusCodes.includes(e.status):!1}async executeWithRetry(e,n,r,o=0){try{return await e(o)}catch(i){let a=Be(i,r),u={provider:r.provider,url:r.url,timeout:r.timeout,attempt:o,responseType:r.responseType};if(this.safe(()=>this.hooks?.onError?.(u,this.toSdkError(a))),this.safe(()=>this.hooks?.trace?.("error",u)),this.shouldRetry(a,o,n)){let l=this.calculateDelay(o,n);return n.onRetry&&n.onRetry(o+1,a,l),this.safe(()=>this.hooks?.onRetry?.(u,this.toSdkError(a),l)),this.safe(()=>this.hooks?.trace?.("retry",u)),await this.sleep(l),this.executeWithRetry(e,n,r,o+1)}throw a}}async performRequest(e,n,r,o="text",i={},a=0){n.rateLimiter&&await n.rateLimiter.acquire();let u=new AbortController,l=new DOMException(`Request timed out after ${n.policy.timeout}ms`,"AbortError"),c=setTimeout(()=>u.abort(l),n.policy.timeout),{signal:d,cleanup:y}=pi([u.signal,i.signal,this.clientSignal]),p=i.fetchImpl??this.fetchImpl??globalThis.fetch,T={...n.policy.headers};if(n.policy.rotateUserAgent){let S=Kn();if(S){for(let O of Object.keys(T))O.toLowerCase()==="user-agent"&&delete T[O];T["User-Agent"]=S}}let R={provider:r,url:e,timeout:n.policy.timeout,attempt:a,responseType:o};this.safe(()=>this.hooks?.onRequest?.(R)),this.safe(()=>this.hooks?.trace?.("request",R));let P=Date.now();try{let S=await mi(d,p(e,{signal:d,headers:T}));if(this.safe(()=>this.hooks?.onResponse?.(R,{status:S.status,durationMs:Date.now()-P})),this.safe(()=>this.hooks?.trace?.("response",R)),!S.ok)throw new j(S.status,S.statusText,e,r);switch(o){case"json":try{return await S.json()}catch(O){throw new C({code:"PARSE_ERROR",message:`Failed to parse JSON response from ${e}`,provider:r,url:e,cause:O})}case"arraybuffer":return await S.arrayBuffer();default:return await S.text()}}catch(S){let O=N=>N?.aborted?S===N.reason?!0:S instanceof Error&&S.cause===N.reason:!1;if(!O(u.signal)){let N=i.signal?.aborted||this.clientSignal?.aborted;if(O(i.signal)||O(this.clientSignal)||N&&$n(S))throw new ct("Request aborted by external signal",r,e);if(u.signal.aborted&&$n(S))throw l}throw S}finally{clearTimeout(c),y()}}async get(e,n={}){let r=zn(e,n.provider),o=this.getProviderState(r);if(o.circuitBreaker&&!o.circuitBreaker.canRequest())throw new le("Circuit breaker is OPEN, request rejected");let i={fetchImpl:n.fetchImpl,signal:n.signal},a=this.fallbackManager.getCandidateUrls(e,r),u;for(let l=0;l<a.length;l++){let c=a[l],d=l===0?o.policy.retry:{...o.policy.retry,maxRetries:0};try{let y=await this.executeWithRetry(p=>this.performRequest(c,o,r,n.responseType,i,p),d,{provider:r,url:c,timeout:o.policy.timeout,responseType:n.responseType});return o.circuitBreaker?.recordSuccess(),this.fallbackManager.recordSuccess(c),y}catch(y){let p=Be(y,{provider:r,url:c,timeout:o.policy.timeout});u=p;let T=Z(p)==="ABORTED";if(T?o.circuitBreaker?.releaseProbe():this.fallbackManager.recordFailure(c,p),l<a.length-1&&this.fallbackManager.shouldFallback(p)){this.safe(()=>this.hooks?.trace?.("fallback",{provider:r,url:c,timeout:o.policy.timeout,attempt:0,responseType:n.responseType}));continue}throw T||o.circuitBreaker?.recordFailure(),this.toSdkError(p)}}throw o.circuitBreaker?.recordFailure(),u?this.toSdkError(u):new le("Request failed without a concrete error")}async getTencentQuote(e){let n=`${this.baseUrl}/?q=${encodeURIComponent(e)}`,r=await this.get(n,{responseType:"arraybuffer",provider:"tencent"}),o=pt(r);return mt(o)}};var U=(t,e)=>t*60+e,gi={A:{tz:E.CN,open:[[U(9,30),U(11,30)],[U(13,0),U(15,0)]],lunchBreak:[U(11,30),U(13,0)],tradingWeekdays:[1,2,3,4,5]},HK:{tz:E.HK,open:[[U(9,30),U(12,0)],[U(13,0),U(16,0)]],lunchBreak:[U(12,0),U(13,0)],tradingWeekdays:[1,2,3,4,5]},US:{tz:E.US,open:[[U(9,30),U(16,0)]],tradingWeekdays:[1,2,3,4,5]}};function sn(t,e){if(t==null)return Y(e);if(t instanceof Date)return Y(e,t.getTime());let n=t.trim();if(/^\d{4}-\d{2}-\d{2}$/.test(n))return n;if(/^\d{8}$/.test(n))return`${n.slice(0,4)}-${n.slice(4,6)}-${n.slice(6,8)}`;let r=new Date(n);if(!Number.isNaN(r.getTime()))return Y(e,r.getTime());throw new h(`Unsupported date input: ${JSON.stringify(t)}. Expected 'YYYY-MM-DD', 'YYYYMMDD', or Date.`)}function fi(t,e){let n=new Intl.DateTimeFormat("en-US",{timeZone:e,hour12:!1,weekday:"short",hour:"2-digit",minute:"2-digit"}),r={};for(let l of n.formatToParts(t))l.type!=="literal"&&(r[l.type]=l.value);let o=parseInt(r.hour??"0",10);o===24&&(o=0);let i=parseInt(r.minute??"0",10),u={Mon:1,Tue:2,Wed:3,Thu:4,Fri:5,Sat:6,Sun:7}[r.weekday??""]??0;return{minutes:o*60+i,weekday:u}}function an(t,e){let n=0,r=t.length;for(;n<r;){let o=n+r>>>1;t[o]<e?n=o+1:r=o}return n}var Oe=class{constructor(e){this.quoteService=e}async isTradingDay(e){let n=sn(e,E.CN),r=await this.quoteService.getTradingCalendar(),o=an(r,n);return o<r.length&&r[o]===n}async nextTradingDay(e){let n=sn(e,E.CN),r=await this.quoteService.getTradingCalendar(),o=an(r,n);if(o<r.length&&r[o]===n&&(o+=1),o>=r.length)throw new h(`nextTradingDay: ${n} \u4E4B\u540E\u6CA1\u6709\u53EF\u7528\u4EA4\u6613\u65E5 (\u65E5\u5386\u6700\u5927\u65E5\u671F ${r[r.length-1]??"N/A"})`);return r[o]}async prevTradingDay(e){let n=sn(e,E.CN),r=await this.quoteService.getTradingCalendar(),i=an(r,n)-1;if(i<0)throw new h(`prevTradingDay: ${n} \u4E4B\u524D\u6CA1\u6709\u53EF\u7528\u4EA4\u6613\u65E5 (\u65E5\u5386\u6700\u5C0F\u65E5\u671F ${r[0]??"N/A"})`);return r[i]}getMarketStatus(e="A",n=new Date){let r=gi[e],{minutes:o,weekday:i}=fi(n,r.tz);if(!r.tradingWeekdays.includes(i))return"closed";let a=r.open[0][0],u=r.open[r.open.length-1][1];if(o<a)return"pre_market";if(o>=u)return"after_hours";for(let[l,c]of r.open)if(o>=l&&o<c)return"open";return r.lunchBreak&&o>=r.lunchBreak[0]&&o<r.lunchBreak[1]?"lunch_break":"closed"}};var I={};at(I,{getAShareCodeList:()=>Xn,getAllHKQuotesByCodes:()=>tr,getAllQuotesByCodes:()=>er,getAllUSQuotesByCodes:()=>nr,getFullQuotes:()=>Je,getFundCodeList:()=>rr,getFundFlow:()=>jn,getFundQuotes:()=>Yn,getHKCodeList:()=>Jn,getHKQuotes:()=>et,getPanelLargeOrder:()=>Gn,getSimpleQuotes:()=>Qn,getTodayTimeline:()=>Wn,getTradingCalendar:()=>or,getUSCodeList:()=>Zn,getUSQuotes:()=>tt,parseFullQuote:()=>un,parseFundFlow:()=>cn,parseFundQuote:()=>gn,parseHKQuote:()=>pn,parsePanelLargeOrder:()=>dn,parseSimpleQuote:()=>ln,parseUSQuote:()=>mn,search:()=>sr});function un(t){let e=[];for(let i=0;i<5;i++)e.push({price:f(t[9+i*2]),volume:f(t[10+i*2])});let n=[];for(let i=0;i<5;i++)n.push({price:f(t[19+i*2]),volume:f(t[20+i*2])});let r=t[30]??"",o=k(r,E.CN);return{marketId:t[0]??"",name:t[1]??"",code:t[2]??"",price:f(t[3]),prevClose:f(t[4]),open:f(t[5]),volume:f(t[6]),outerVolume:f(t[7]),innerVolume:f(t[8]),bid:e,ask:n,time:r,timestamp:o.timestamp,tz:o.tz,change:f(t[31]),changePercent:f(t[32]),high:f(t[33]),low:f(t[34]),volume2:f(t[36]),amount:f(t[37]),turnoverRate:_(t[38]),pe:_(t[39]),amplitude:_(t[43]),circulatingMarketCap:_(t[44]),totalMarketCap:_(t[45]),pb:_(t[46]),limitUp:_(t[47]),limitDown:_(t[48]),volumeRatio:_(t[49]),avgPrice:_(t[51]),peStatic:_(t[52]),peDynamic:_(t[53]),high52w:_(t[67]),low52w:_(t[68]),circulatingShares:_(t[72]),totalShares:_(t[73]),market:"CN",assetType:"stock",source:"tencent"}}function ln(t){return{marketId:t[0]??"",name:t[1]??"",code:t[2]??"",price:f(t[3]),change:f(t[4]),changePercent:f(t[5]),volume:f(t[6]),amount:f(t[7]),marketCap:_(t[9]),marketType:t[10]??"",market:"CN",assetType:"stock",source:"tencent"}}function cn(t){let e=t[13]??"",n=k(e,E.CN);return{code:t[0]??"",mainInflow:f(t[1]),mainOutflow:f(t[2]),mainNet:f(t[3]),mainNetRatio:f(t[4]),retailInflow:f(t[5]),retailOutflow:f(t[6]),retailNet:f(t[7]),retailNetRatio:f(t[8]),totalFlow:f(t[9]),name:t[12]??"",date:e,timestamp:n.timestamp,tz:n.tz}}function dn(t){return{buyLargeRatio:f(t[0]),buySmallRatio:f(t[1]),sellLargeRatio:f(t[2]),sellSmallRatio:f(t[3])}}function pn(t){let e=t[30]??"",n=k(e,E.HK);return{marketId:t[0]??"",name:t[1]??"",code:t[2]??"",price:f(t[3]),prevClose:f(t[4]),open:f(t[5]),volume:f(t[6]),time:e,timestamp:n.timestamp,tz:n.tz,change:f(t[31]),changePercent:f(t[32]),high:f(t[33]),low:f(t[34]),amount:f(t[37]),lotSize:_(t[40]),circulatingMarketCap:_(t[44]),totalMarketCap:_(t[45]),currency:t[t.length-3]??"",market:"HK",assetType:"stock",source:"tencent"}}function mn(t){let e=t[30]??"",n=k(e,E.US);return{marketId:t[0]??"",name:t[1]??"",code:t[2]??"",price:f(t[3]),prevClose:f(t[4]),open:f(t[5]),volume:f(t[6]),time:e,timestamp:n.timestamp,tz:n.tz,change:f(t[31]),changePercent:f(t[32]),high:f(t[33]),low:f(t[34]),amount:f(t[37]),turnoverRate:_(t[38]),pe:_(t[39]),amplitude:_(t[43]),totalMarketCap:_(t[45]),pb:_(t[47]),high52w:_(t[48]),low52w:_(t[49]),market:"US",assetType:"stock",source:"tencent"}}function gn(t){let e=t[8]??"",n=k(e,E.CN);return{code:t[0]??"",name:t[1]??"",nav:f(t[5]),accNav:f(t[6]),change:f(t[7]),navDate:e,timestamp:n.timestamp,tz:n.tz,market:"CN",assetType:"fund",source:"tencent"}}async function Je(t,e){if(!e||e.length===0)return[];let n=await t.getTencentQuote(e.join(",")),r=new Set(e);return n.filter(o=>r.has(o.key)&&o.fields&&o.fields.length>5&&o.fields[0]!=="").map(o=>un(o.fields))}async function Qn(t,e){if(!e||e.length===0)return[];let n=e.map(i=>`s_${i}`),r=await t.getTencentQuote(n.join(",")),o=new Set(n);return r.filter(i=>o.has(i.key)&&i.fields&&i.fields.length>5&&i.fields[0]!=="").map(i=>ln(i.fields))}async function jn(t,e){if(!e||e.length===0)return[];let n=e.map(i=>`ff_${i}`),r=await t.getTencentQuote(n.join(",")),o=new Set(n);return r.filter(i=>o.has(i.key)&&i.fields&&i.fields.length>=14&&i.fields[0]!=="").map(i=>cn(i.fields))}async function Gn(t,e){if(!e||e.length===0)return[];let n=e.map(i=>`s_pk${i}`),r=await t.getTencentQuote(n.join(",")),o=new Set(n);return r.filter(i=>o.has(i.key)&&i.fields&&i.fields.length>=4&&i.fields[0]!=="").map(i=>dn(i.fields))}async function et(t,e){if(!e||e.length===0)return[];let n=e.map(i=>`hk${i}`),r=await t.getTencentQuote(n.join(",")),o=new Set(n);return r.filter(i=>o.has(i.key)&&i.fields&&i.fields.length>5&&i.fields[0]!=="").map(i=>pn(i.fields))}async function tt(t,e){if(!e||e.length===0)return[];let n=e.map(i=>`us${i}`),r=await t.getTencentQuote(n.join(",")),o=new Set(n);return r.filter(i=>o.has(i.key)&&i.fields&&i.fields.length>5&&i.fields[0]!=="").map(i=>mn(i.fields))}async function Yn(t,e){if(!e||e.length===0)return[];let n=e.map(i=>`jj${i}`),r=await t.getTencentQuote(n.join(",")),o=new Set(n);return r.filter(i=>o.has(i.key)&&i.fields&&i.fields.length>=9&&i.fields[0]!=="").map(i=>gn(i.fields))}async function Wn(t,e){let n=`${Rt}?code=${encodeURIComponent(e)}`,r=await t.get(n,{responseType:"json",provider:"tencent"});if(r.code!==0)throw new lt(r.msg||"API error","tencent",n);let o=r.data?.[e];if(!o){let p=k("",E.CN);return{code:e,date:"",timestamp:p.timestamp,tz:p.tz,preClose:0,data:[]}}let i=o.data?.data??[],a=o.data?.date??"",u=o.qt?.[e]??[],l=parseFloat(u[4]??"")||0,c=!1;for(let p of i){let T=p.split(" "),R=parseFloat(T[1])||0,P=parseInt(T[2],10)||0,S=parseFloat(T[3])||0;if(P>0&&R>0){S/P>R*50&&(c=!0);break}}let d=i.map(p=>{let T=p.split(" "),R=T[0],P=`${R.slice(0,2)}:${R.slice(2,4)}`,S=parseInt(T[2],10)||0,O=parseFloat(T[3])||0,N=c?S*100:S,H=N>0?O/N:0,w=ht(a,P,E.CN);return{time:P,timestamp:w.timestamp,tz:w.tz,price:parseFloat(T[1])||0,volume:N,amount:O,avgPrice:Math.round(H*100)/100}}),y=k(a,E.CN);return{code:e,date:a,timestamp:y.timestamp,tz:y.tz,preClose:l,data:d}}var Vn=ne("tencent:code-lists",{defaultTTL:360*60*1e3,maxSize:16});async function fn(t,e,n){return Vn.getOrFetch(e,async()=>{let r=await t.get(n,{responseType:"json"}),o=r?.list;if(r?.success===!1||!Array.isArray(o)||o.length===0)throw new X(`\u4EE3\u7801\u5217\u8868\u63A5\u53E3\u8FD4\u56DE\u7A7A\u6570\u636E: ${e}`,"tencent",n);return o})}function yi(t,e){let n=t.replace(/^(sh|sz|bj)/,"");switch(e){case"sh":return n.startsWith("6");case"sz":return n.startsWith("0")||n.startsWith("3");case"bj":return n.startsWith("4")||n.startsWith("8")||n.startsWith("92");case"kc":return n.startsWith("688");case"cy":return n.startsWith("30");default:return!0}}async function Xn(t,e){let n=e?.simple??!1,r=e?.market,i=await fn(t,"a-share:full",_t);return r&&(i=i.filter(a=>yi(a,r))),n?i.map(a=>a.replace(/^(sh|sz|bj)/,"")):i.slice()}async function Zn(t,e){let n=e?.simple??!1,r=e?.market,i=(await fn(t,"us:full",Ct)).slice();if(r){let a=`${bn[r]}.`;i=i.filter(u=>u.startsWith(a))}return n?i.map(a=>a.replace(/^\d{3}\./,"")):i}async function Jn(t){return(await fn(t,"hk:full",At)).slice()}async function er(t,e,n={}){let{batchSize:r=Re,concurrency:o=Ce,onProgress:i}=n;G(r,"batchSize"),G(o,"concurrency");let a=Math.min(r,_e),u=ce(e,a),l=u.length,c=0,d=u.map(p=>async()=>{let T=await Je(t,p);return c++,i&&i(c,l),T});return(await de(d,o,!0)).flat()}async function tr(t,e,n={}){let{batchSize:r=Re,concurrency:o=Ce,onProgress:i}=n;G(r,"batchSize"),G(o,"concurrency");let a=Math.min(r,_e),u=ce(e,a),l=u.length,c=0,d=u.map(p=>async()=>{let T=await et(t,p);return c++,i&&i(c,l),T});return(await de(d,o,!0)).flat()}async function nr(t,e,n={}){let{batchSize:r=Re,concurrency:o=Ce,onProgress:i}=n;G(r,"batchSize"),G(o,"concurrency");let a=Math.min(r,_e),u=ce(e,a),l=u.length,c=0,d=u.map(p=>async()=>{let T=await tt(t,p);return c++,i&&i(c,l),T});return(await de(d,o,!0)).flat()}async function rr(t){return(await Vn.getOrFetch("fund:full",async()=>{let o=(await t.get(ze,{responseType:"text"})??"").split(",").slice(1).filter(i=>i.trim());if(o.length===0)throw new X("\u57FA\u91D1\u4EE3\u7801\u5217\u8868\u63A5\u53E3\u8FD4\u56DE\u7A7A\u6570\u636E","tencent",ze);return o})).slice()}var Ti=ne("tencent:trade-calendar",{defaultTTL:720*60*1e3,maxSize:4});async function or(t){return(await Ti.getOrFetch("a-share",async()=>{let r=(await t.get(Ot)??"").trim().split(",").map(o=>o.trim()).filter(o=>o.length>0);if(r.length===0)throw new X("\u4EA4\u6613\u65E5\u5386\u63A5\u53E3\u8FD4\u56DE\u7A7A\u6570\u636E","tencent",Ot);return r})).slice()}var ir="https://smartbox.gtimg.cn/s3/";function hi(t){return t.replace(/\\u([0-9a-fA-F]{4})/g,(e,n)=>String.fromCharCode(parseInt(n,16)))}function Si(t){let e=t.toUpperCase();return e.startsWith("QDII")||e.startsWith("ETF")||e.startsWith("LOF")||e.startsWith("KJ")||e.startsWith("JJ")||e.includes("FUND")?"fund":e.startsWith("GP")||e.includes("STOCK")?"stock":e==="ZS"||e.includes("INDEX")?"index":e.startsWith("ZQ")||e.includes("BOND")?"bond":e.startsWith("QH")||e.includes("FUTURE")?"futures":e.startsWith("QZ")||e.includes("OPTION")?"option":"other"}function Ei(t){return!t||t==="N"?[]:t.split("^").filter(Boolean).map(n=>{let r=n.split("~"),o=r[0]||"",i=r[1]||"",a=hi(r[2]||""),u=r[4]||"";return{code:o+i,name:a,market:o,type:u,category:Si(u)}})}function Ri(t){return new Promise((e,n)=>{let r=`${ir}?v=2&t=all&q=${encodeURIComponent(t)}`;window.v_hint="";let o=document.createElement("script");o.src=r,o.charset="utf-8",o.onload=()=>{let i=window.v_hint||"";document.body.removeChild(o),e(i)},o.onerror=()=>{document.body.removeChild(o),n(new C({code:"NETWORK_ERROR",message:"Network error calling Smartbox",url:r}))},document.body.appendChild(o)})}async function _i(t,e){let n=`${ir}?v=2&t=all&q=${encodeURIComponent(e)}`,o=(await t.get(n)).match(/v_hint="([^"]*)"/);return o?o[1]:""}function Ci(){return typeof window<"u"&&typeof document<"u"}async function sr(t,e){if(!e||!e.trim())return[];let n;return Ci()?n=await Ri(e):n=await _i(t,e),Ei(n)}var g={};at(g,{extractVariety:()=>Cn,fetchDatacenter:()=>Tn,fetchDatacenterList:()=>A,getBlockTradeDailyStat:()=>Ao,getBlockTradeDetail:()=>Co,getBlockTradeMarketStat:()=>_o,getBoardChanges:()=>go,getCFFEXOptionQuotes:()=>$r,getComexInventory:()=>Wr,getConceptConstituents:()=>br,getConceptKline:()=>Mr,getConceptList:()=>Dr,getConceptMinuteKline:()=>Nr,getConceptSpot:()=>Ir,getDividendDetail:()=>kr,getDragonTigerBranchRank:()=>So,getDragonTigerDetail:()=>yo,getDragonTigerInstitution:()=>ho,getDragonTigerStockSeatDetail:()=>Eo,getDragonTigerStockStats:()=>To,getFundDividendList:()=>Lr,getFundEstimate:()=>xr,getFundFlowRank:()=>no,getFundNavHistory:()=>Fr,getFundProfile:()=>Kr,getFundRankHistory:()=>Ur,getFuturesHistoryKline:()=>Hr,getFuturesInventory:()=>Yr,getFuturesInventorySymbols:()=>Gr,getFuturesMarketCode:()=>An,getGlobalFuturesKline:()=>zr,getGlobalFuturesSpot:()=>qr,getHKHistoryKline:()=>dr,getHKMinuteKline:()=>pr,getHistoryKline:()=>lr,getIndividualFundFlow:()=>eo,getIndustryConstituents:()=>Ar,getIndustryKline:()=>Or,getIndustryList:()=>_r,getIndustryMinuteKline:()=>Pr,getIndustrySpot:()=>Cr,getMarginAccountInfo:()=>Oo,getMarginTargetList:()=>Po,getMarketFundFlow:()=>to,getMinuteKline:()=>cr,getNorthboundFlowSummary:()=>ao,getNorthboundHistory:()=>lo,getNorthboundHoldingRank:()=>uo,getNorthboundIndividual:()=>co,getNorthboundMinute:()=>so,getOptionLHB:()=>Qr,getSectorFundFlowHistory:()=>oo,getSectorFundFlowRank:()=>ro,getStockChanges:()=>mo,getUSHistoryKline:()=>mr,getUSMinuteKline:()=>gr,getZTPool:()=>po});function b(t){return/^\d{8}$/.test(t)?`${t.slice(0,4)}-${t.slice(4,6)}-${t.slice(6,8)}`:t}function ar(t,e){let n=i=>b(i.replace("T"," ").trim()).slice(0,16),r=n(t),o=n(e);return o.length===10&&(o+=" 23:59"),{start:r,end:o}}function ur(t,e,n=0){let r=a=>{if(!a)return;let u=/^(\d{4})-?(\d{2})-?(\d{2})/.exec(a.trim());return u?`${u[1]}${u[2]}${u[3]}`:void 0},o=r(t)??"0",i=r(e);return i!==void 0&&n>0&&(i=ge(`${i.slice(0,4)}-${i.slice(4,6)}-${i.slice(6,8)}`,n).replace(/-/g,"")),{beg:o,end:i??"20500000"}}async function yn(t,e,n,r,o=100,i){let a=[],u=1,l=0;do{let c=new URLSearchParams({...n,pn:String(u),pz:String(o),fields:r}),d=`${e}?${c.toString()}`,p=(await t.get(d,{responseType:"json"}))?.data;if(!p||!Array.isArray(p.diff))break;u===1&&(l=p.total??0);let T=p.diff.map((R,P)=>i(R,a.length+P+1));if(a.push(...T),T.length===0)break;u++}while(a.length<l);return a}function v(t){let[e,n,r,o,i,a,u,l,c,d,y]=t.split(",");return{date:e,open:m(n),close:m(r),high:m(o),low:m(i),volume:m(a),amount:m(u),amplitude:m(l),changePercent:m(c),change:m(d),turnoverRate:m(y)}}async function K(t,e,n){let r=`${e}?${n.toString()}`,o=await t.get(r,{responseType:"json"});return{klines:o?.data?.klines||[],name:o?.data?.name,code:o?.data?.code}}function Ai(t){let[e,n,r,o,i,a,u,l]=t.split(",");return{time:e,open:m(n),close:m(r),high:m(o),low:m(i),volume:m(a),amount:m(u),avgPrice:m(l)}}function nt(t,e){let n=r=>{let o=ae(r,E.CN);return{time:St(o,t)||r,timestamp:re(o)}};return{mapTrendRow:({time:r,...o},i)=>({...n(r),tz:t,...o,currency:e,code:i.code}),mapKlineRow:({date:r,...o},i)=>({...n(r),tz:t,...o,currency:e,code:i.code})}}function te(t){return async function(n,r,o={}){let i=o.period??t.defaultPeriod;ft(i),t.fqt==="option"&&W(o.adjust??"qfq");let a=t.resolveTarget(r),u=t.window,l=p=>{if(u.mode==="full")return p;let{start:T,end:R}=ar(o.startDate??"1979-09-01 09:32:00",o.endDate??"2222-01-01 09:32:00");return p.filter(P=>P.time>=T&&P.time<=R)};if(i==="1"){let p=new URLSearchParams({fields1:"f1,f2,f3,f4,f5,f6,f7,f8,f9,f10,f11,f12,f13",fields2:"f51,f52,f53,f54,f55,f56,f57,f58",...t.includeUt?{ut:L}:{},ndays:t.ndays==="option"?String(o.ndays??1):t.ndays.fixed,iscr:"0",secid:a.secid}),T=`${t.trendsUrl}?${p.toString()}`,P=(await n.get(T,{responseType:"json"}))?.data?.trends;return!Array.isArray(P)||P.length===0?[]:l(P.map(S=>t.mapTrendRow(Ai(S),a)))}let c=u.mode==="filter"?ur(o.startDate,o.endDate,u.endExtraDays??0):{beg:u.beg,end:u.end},d=new URLSearchParams({fields1:"f1,f2,f3,f4,f5,f6",fields2:"f51,f52,f53,f54,f55,f56,f57,f58,f59,f60,f61",...t.includeUt?{ut:L}:{},klt:i,fqt:t.fqt==="option"?V(o.adjust??"qfq"):t.fqt.fixed,secid:a.secid,beg:c.beg,end:c.end,...t.extraKlineParams??{}}),{klines:y}=await K(n,t.klineUrl,d);return!Array.isArray(y)||y.length===0?[]:l(y.map(p=>t.mapKlineRow(v(p),a)))}}async function lr(t,e,n={}){let{period:r="daily",adjust:o="qfq",startDate:i="19700101",endDate:a="20500101"}=n;q(r),W(o);let u=J(e,{market:"CN"}),l=ee(u),c=new URLSearchParams({fields1:"f1,f2,f3,f4,f5,f6",fields2:"f51,f52,f53,f54,f55,f56,f57,f58,f59,f60,f61,f116",ut:L,klt:z(r),fqt:V(o),secid:l,beg:i,end:a}),d=$e,{klines:y}=await K(t,d,c);return y.length===0?[]:y.map(p=>{let T=v(p),R=k(T.date,E.CN);return{...T,timestamp:R.timestamp,tz:R.tz,code:u.code}})}var Oi=te({trendsUrl:Pt,klineUrl:$e,resolveTarget:t=>{let e=J(t,{market:"CN"});return{secid:ee(e),code:e.code}},defaultPeriod:"1",ndays:{fixed:"5"},fqt:"option",includeUt:!0,window:{mode:"filter"},mapTrendRow:({time:t,...e})=>{let n=k(t,E.CN);return{time:t,timestamp:n.timestamp,tz:n.tz,...e}},mapKlineRow:t=>{let e=k(t.date,E.CN);return{...t,time:t.date,timestamp:e.timestamp,tz:e.tz}}});async function cr(t,e,n={}){return Oi(t,e,n)}function rt(t){return async function(n,r,o={}){let{period:i="daily",adjust:a="qfq",startDate:u="19700101",endDate:l="20500101"}=o;q(i),W(a);let c=t.normalizeSymbol(r),d=new URLSearchParams({fields1:"f1,f2,f3,f4,f5,f6",fields2:"f51,f52,f53,f54,f55,f56,f57,f58,f59,f60,f61",ut:L,klt:z(i),fqt:V(a),secid:c.secid,beg:u,end:l,lmt:"1000000"}),{klines:y,name:p,code:T}=await K(n,t.url,d);if(y.length===0)return[];let R=t.resolveResultMeta?t.resolveResultMeta(r,c,{code:T,name:p}):{code:T||c.fallbackCode,name:p||""};return y.map(P=>{let S=v(P),O=k(S.date,t.tz),N={...S,timestamp:O.timestamp,tz:O.tz,code:R.code,name:R.name};return t.enrichItem(N)})}}var Pi=rt({url:Qe,tz:E.HK,normalizeSymbol:t=>{let e=J(t,{market:"HK"});return{secid:ee(e),fallbackCode:e.code}},enrichItem:t=>({...t,currency:"HKD",lotSize:null})});async function dr(t,e,n={}){return Pi(t,e,n)}var Di=te({trendsUrl:Dt,klineUrl:Qe,resolveTarget:t=>{let e=J(t,{market:"HK"});return{secid:ee(e),code:e.code}},defaultPeriod:"1",ndays:"option",fqt:"option",includeUt:!0,window:{mode:"filter"},...nt(E.HK,"HKD")});async function pr(t,e,n={}){return Di(t,e,n)}var Ii=rt({url:je,tz:E.US,normalizeSymbol:t=>({secid:t,fallbackCode:t.split(".")[1]||t}),resolveResultMeta:(t,e,n)=>({code:n.code||e.fallbackCode,name:n.name||""}),enrichItem:t=>({...t,currency:"USD"})});async function mr(t,e,n={}){return Ii(t,e,n)}var bi=te({trendsUrl:It,klineUrl:je,resolveTarget:t=>({secid:t,code:t.split(".")[1]||t}),defaultPeriod:"1",ndays:"option",fqt:"option",includeUt:!0,window:{mode:"filter",endExtraDays:1},...nt(E.US,"USD")});async function gr(t,e,n={}){return bi(t,e,n)}function yr(t){let e=ne(`eastmoney:board-code-map:${t.type}`,{defaultTTL:36e5,maxSize:4});return{async getCode(n,r,o){if(r.startsWith("BK"))return r;let a=(await e.getOrFetch("name-code-map",async()=>{let u=await o(n);if(u.length===0)throw new X(`${t.errorPrefix}: \u677F\u5757\u5217\u8868\u63A5\u53E3\u8FD4\u56DE\u7A7A\u6570\u636E`,"eastmoney");return Object.fromEntries(u.map(l=>[l.name,l.code]))}))[r];if(!a)throw new ut(`${t.errorPrefix}: ${r}`,"eastmoney");return a}}}async function Tr(t,e){let n={po:"1",np:"1",ut:"bd1d9ddb04089700cf9c27f6f7426281",fltt:"2",invt:"2",fid:e.type==="concept"?"f12":"f3",fs:e.fsFilter},r=e.type==="concept"?"f2,f3,f4,f8,f12,f14,f15,f16,f17,f18,f20,f21,f24,f25,f22,f33,f11,f62,f128,f124,f107,f104,f105,f136":"f1,f2,f3,f4,f5,f6,f7,f8,f9,f10,f12,f13,f14,f15,f16,f17,f18,f20,f21,f23,f24,f25,f26,f22,f33,f11,f62,f128,f136,f115,f152,f124,f107,f104,f105,f140,f141,f207,f208,f209,f222",o=await yn(t,e.listUrl,n,r,100,(i,a)=>({rank:a,name:String(i.f14??""),code:String(i.f12??""),price:s(i.f2),change:s(i.f4),changePercent:s(i.f3),totalMarketCap:s(i.f20),turnoverRate:s(i.f8),riseCount:s(i.f104),fallCount:s(i.f105),leadingStock:i.f128?String(i.f128):null,leadingStockChangePercent:s(i.f136)}));return o.sort((i,a)=>(a.changePercent??0)-(i.changePercent??0)),o.forEach((i,a)=>{i.rank=a+1}),o}async function hr(t,e,n){let r=new URLSearchParams({fields:"f43,f44,f45,f46,f47,f48,f170,f171,f168,f169",mpi:"1000",invt:"2",fltt:"1",secid:`90.${e}`}),o=`${n}?${r.toString()}`,a=(await t.get(o,{responseType:"json"}))?.data;return a?[{key:"f43",name:"\u6700\u65B0",divide:!0},{key:"f44",name:"\u6700\u9AD8",divide:!0},{key:"f45",name:"\u6700\u4F4E",divide:!0},{key:"f46",name:"\u5F00\u76D8",divide:!0},{key:"f47",name:"\u6210\u4EA4\u91CF",divide:!1},{key:"f48",name:"\u6210\u4EA4\u989D",divide:!1},{key:"f170",name:"\u6DA8\u8DCC\u5E45",divide:!0},{key:"f171",name:"\u632F\u5E45",divide:!0},{key:"f168",name:"\u6362\u624B\u7387",divide:!0},{key:"f169",name:"\u6DA8\u8DCC\u989D",divide:!0}].map(({key:l,name:c,divide:d})=>{let y=a[l],p=null;return typeof y=="number"&&!isNaN(y)&&(p=d?y/100:y),{item:c,value:p}}):[]}async function Sr(t,e,n){let r={po:"1",np:"1",ut:"bd1d9ddb04089700cf9c27f6f7426281",fltt:"2",invt:"2",fid:"f3",fs:`b:${e} f:!50`};return yn(t,n,r,"f1,f2,f3,f4,f5,f6,f7,f8,f9,f10,f12,f13,f14,f15,f16,f17,f18,f20,f21,f23,f24,f25,f22,f11,f62,f128,f136,f115,f152,f45",100,(i,a)=>({rank:a,code:String(i.f12??""),name:String(i.f14??""),price:s(i.f2),changePercent:s(i.f3),change:s(i.f4),volume:s(i.f5),amount:s(i.f6),amplitude:s(i.f7),high:s(i.f15),low:s(i.f16),open:s(i.f17),prevClose:s(i.f18),turnoverRate:s(i.f8),pe:s(i.f9),pb:s(i.f23)}))}async function Er(t,e,n,r={}){let{period:o="daily",adjust:i="",startDate:a="19700101",endDate:u="20500101"}=r;q(o),W(i);let l=new URLSearchParams({secid:`90.${e}`,fields1:"f1,f2,f3,f4,f5,f6",fields2:"f51,f52,f53,f54,f55,f56,f57,f58,f59,f60,f61",klt:z(o),fqt:V(i),beg:a,end:u,smplmt:"10000",lmt:"1000000"}),{klines:c}=await K(t,n,l);return c.length===0?[]:c.map(d=>v(d))}var fr=new Map;async function Rr(t,e,n,r,o={}){let i=`${n}|${r}`,a=fr.get(i);return a||(a=te({trendsUrl:r,klineUrl:n,resolveTarget:u=>({secid:`90.${u}`,code:u}),defaultPeriod:"5",ndays:{fixed:"1"},fqt:{fixed:"1"},includeUt:!1,window:{mode:"full",beg:"0",end:"20500101"},extraKlineParams:{smplmt:"10000",lmt:"1000000"},mapTrendRow:({avgPrice:u,...l})=>({...l,price:u}),mapKlineRow:u=>({time:u.date,open:u.open,close:u.close,high:u.high,low:u.low,changePercent:u.changePercent,change:u.change,volume:u.volume,amount:u.amount,amplitude:u.amplitude,turnoverRate:u.turnoverRate})}),fr.set(i,a)),a(t,e,o)}function ot(t){let e=yr(t);async function n(o){return Tr(o,t)}async function r(o,i){return e.getCode(o,i,n)}return{async getList(o){return n(o)},async getSpot(o,i){let a=await r(o,i);return hr(o,a,t.spotUrl)},async getConstituents(o,i){let a=await r(o,i);return Sr(o,a,t.consUrl)},async getKline(o,i,a={}){let u=await r(o,i);return Er(o,u,t.klineUrl,a)},async getMinuteKline(o,i,a={}){let u=await r(o,i);return Rr(o,u,t.klineUrl,t.trendsUrl,a)}}}var Mi={type:"industry",fsFilter:"m:90 t:2 f:!50",listUrl:bt,spotUrl:Mt,consUrl:Nt,klineUrl:kt,trendsUrl:Lt,errorPrefix:"\u672A\u627E\u5230\u884C\u4E1A\u677F\u5757"},Pe=ot(Mi);async function _r(t){return Pe.getList(t)}async function Cr(t,e){return Pe.getSpot(t,e)}async function Ar(t,e){return Pe.getConstituents(t,e)}async function Or(t,e,n={}){return Pe.getKline(t,e,n)}async function Pr(t,e,n={}){return Pe.getMinuteKline(t,e,n)}var Ni={type:"concept",fsFilter:"m:90 t:3 f:!50",listUrl:Ft,spotUrl:xt,consUrl:Ut,klineUrl:wt,trendsUrl:vt,errorPrefix:"\u672A\u627E\u5230\u6982\u5FF5\u677F\u5757"},De=ot(Ni);async function Dr(t){return De.getList(t)}async function Ir(t,e){return De.getSpot(t,e)}async function br(t,e){return De.getConstituents(t,e)}async function Mr(t,e,n={}){return De.getKline(t,e,n)}async function Nr(t,e,n={}){return De.getMinuteKline(t,e,n)}async function Tn(t,e,n){let{reportName:r,columns:o="ALL",filter:i,sortColumns:a,sortTypes:u,pageSize:l=500,startPage:c=1,fetchAllPages:d=!0,maxPages:y=1e3,quoteColumns:p,quoteType:T,extraParams:R}=e,P=[],S=c,O=1,N=0,H=0;do{let w=new URLSearchParams({reportName:r,columns:o,pageSize:String(l),pageNumber:String(S),source:"WEB",client:"WEB"});if(i&&w.set("filter",i),a&&w.set("sortColumns",a),u&&w.set("sortTypes",u),p&&w.set("quoteColumns",p),T&&w.set("quoteType",T),R)for(let[it,st]of Object.entries(R))w.set(it,st);let wo=`${Kt}?${w.toString()}`,ie=(await t.get(wo,{responseType:"json"}))?.result;if(!ie||!Array.isArray(ie.data))break;S===c&&(O=ie.pages??1,N=ie.count??ie.data.length);let vo=ie.data.map((it,st)=>n(it,P.length+st));if(P.push(...vo),S++,H++,!d)break}while(S<=O&&H<y);return d&&H>=y&&S<=O&&console.warn(`[stock-sdk] fetchDatacenter("${r}") truncated at maxPages=${y} (server reports ${O} pages). Pass a larger \`maxPages\` to fetch the full dataset.`),{data:P,total:N,pages:O}}async function A(t,e,n){return(await Tn(t,e,n)).data}function F(t){if(t==null)return"";let e=String(t),n=e.match(/^(\d{4}-\d{2}-\d{2})/);return n?n[1]:e}function oe(t){if(!t)return null;let e=t.match(/^(\d{4}-\d{2}-\d{2})/);return e?e[1]:null}function ki(t){return{code:t.SECURITY_CODE??"",name:t.SECURITY_NAME_ABBR??"",reportDate:oe(t.REPORT_DATE),planNoticeDate:oe(t.PLAN_NOTICE_DATE),disclosureDate:oe(t.PUBLISH_DATE??t.PLAN_NOTICE_DATE),assignTransferRatio:t.BONUS_IT_RATIO??null,bonusRatio:t.BONUS_RATIO??null,transferRatio:t.IT_RATIO??null,dividendPretax:t.PRETAX_BONUS_RMB??null,dividendDesc:t.IMPL_PLAN_PROFILE??null,dividendYield:t.DIVIDENT_RATIO??null,eps:t.BASIC_EPS??null,bps:t.BVPS??null,capitalReserve:t.PER_CAPITAL_RESERVE??null,unassignedProfit:t.PER_UNASSIGN_PROFIT??null,netProfitYoy:t.PNP_YOY_RATIO??null,totalShares:t.TOTAL_SHARES??null,equityRecordDate:oe(t.EQUITY_RECORD_DATE),exDividendDate:oe(t.EX_DIVIDEND_DATE),payDate:oe(t.PAY_DATE),assignProgress:t.ASSIGN_PROGRESS??null,noticeDate:oe(t.NOTICE_DATE)}}async function kr(t,e){let n=e.replace(/^(sh|sz|bj)/,"");return A(t,{reportName:"RPT_SHAREBONUS_DET",sortColumns:"REPORT_DATE",sortTypes:"-1",pageSize:500,filter:`(SECURITY_CODE="${n}")`},r=>ki(r))}var Li="https://fund.eastmoney.com/Data/funddataIndex_Interface.aspx",En="https://fund.eastmoney.com/pingzhongdata",Fi="https://fundgz.1234567.com.cn/js";function xi(){return typeof document<"u"&&typeof window<"u"}var Ui=1e4;function wi(){return Number(Y(E.CN).slice(0,4))}function vi(t,e){let n=new URLSearchParams({dt:"8",page:String(e),rank:t.rank??"FSRQ",sort:t.sort??"desc",gs:"",ftype:t.fundType??"",year:String(t.year??wi())});return`${Li}?${n.toString()}`}function hn(t){if(!t)return null;let e=t.trim().match(/^(\d{4}-\d{2}-\d{2})/);return e?e[1]:null}function Ki(t){return{code:t[0]??"",name:t[1]??"",equityRecordDate:hn(t[2]),exDividendDate:hn(t[3]),dividendPerShare:M(t[4]),payDate:hn(t[5]),dividendType:t[6]?.trim()?t[6].trim():null}}async function Sn(t,e,n){let r=vi(e,n),o=await se(r,["pageinfo","jjfh_data"],{client:t}),i=o.pageinfo??[0,0,n],[a=0,u=0,l=n]=i;return{items:(o.jjfh_data??[]).map(Ki),totalPages:a,pageSize:u,currentPage:l}}async function Lr(t,e={}){if(e.page==="all"){let o=await Sn(t,e,1),i=o.items;for(let a=2;a<=o.totalPages;a++){let u=await Sn(t,e,a);i=i.concat(u.items)}return e.code&&(i=i.filter(a=>a.code===e.code)),{items:i,totalPages:o.totalPages,pageSize:o.pageSize,currentPage:-1}}let n=e.page??1,r=await Sn(t,e,n);return e.code?{...r,items:r.items.filter(o=>o.code===e.code)}:r}function Rn(t){return Y(E.CN,t)}function _n(t){return re(ae(t,E.CN))}function Q(t,e){return t?.find(n=>n.name===e)?.data??[]}async function Fr(t,e){let n=`${En}/${encodeURIComponent(e)}.js`,r=await se(n,["fS_code","fS_name","Data_netWorthTrend","Data_ACWorthTrend"],{client:t}),o=r.Data_netWorthTrend??[],i=new Map;for(let u of r.Data_ACWorthTrend??[])Array.isArray(u)&&u.length>=2&&i.set(u[0],u[1]);let a=o.map(u=>({date:Rn(u.x),timestamp:u.x,nav:u.y,accNav:i.has(u.x)?i.get(u.x):null,dailyReturn:M(u.equityReturn),unitMoney:u.unitMoney??""}));return{code:r.fS_code??e,name:r.fS_name??null,items:a}}function Bi(t,e,n=Ui){let r=`${Fi}/${encodeURIComponent(e)}.js?rt=${Date.now()}`;return xi()?pe("fundgz:jsonpgz",()=>Hi(r,n)):qi(t,r)}function Hi(t,e){return new Promise((n,r)=>{let o=document.createElement("script"),i=window,a=i.jsonpgz,u=!1,l=()=>{if(o.parentNode&&o.parentNode.removeChild(o),a===void 0)try{delete i.jsonpgz}catch{}else i.jsonpgz=a},c=setTimeout(()=>{u||(u=!0,l(),r(new C({code:"TIMEOUT",message:`fundgz JSONP timed out after ${e}ms: ${t}`,url:t,details:{timeout:e}})))},e);i.jsonpgz=d=>{u||(u=!0,clearTimeout(c),l(),n(d??{}))},o.onerror=()=>{u||(u=!0,clearTimeout(c),l(),r(new C({code:"NETWORK_ERROR",message:`fundgz JSONP script load failed: ${t}`,url:t})))},o.src=t,document.head.appendChild(o)})}async function qi(t,e){let r=(await t.get(e,{responseType:"text",provider:"eastmoney"})).trim();if(!r)return{};try{return qe(r)}catch{return{}}}async function xr(t,e){let n=await Bi(t,e);return{code:n.fundcode??e,name:n.name??null,navDate:n.jzrq?.trim()?n.jzrq.trim():null,nav:M(n.dwjz),estimatedNav:M(n.gsz),estimatedChangePercent:M(n.gszzl),estimateTime:n.gztime?.trim()?n.gztime.trim():null}}async function Ur(t,e){let n=`${En}/${encodeURIComponent(e)}.js`,r=await se(n,["fS_code","fS_name","Data_rateInSimilarType","Data_rateInSimilarPersent"],{client:t}),o=r.Data_rateInSimilarType??[],i=new Map;for(let u of r.Data_rateInSimilarPersent??[])Array.isArray(u)&&u.length>=2&&i.set(u[0],u[1]);let a=o.map(u=>({date:Rn(u.x),timestamp:u.x,rank:M(u.y),total:M(u.sc),percentile:i.has(u.x)?i.get(u.x):null}));return{code:r.fS_code??e,name:r.fS_name??null,items:a}}function wr(t){let e=t.indexOf(".");return e<0?{code:t,marketId:""}:{marketId:t.slice(0,e),code:t.slice(e+1)}}function zi(t){return t?t.map(e=>e.trim()).filter(Boolean).map(wr):[]}function $i(t){return t?t.split(",").map(e=>e.trim()).filter(Boolean).map(wr):[]}function Qi(t){if(!t?.categories?.length||!t?.series)return[];let e=Q(t.series,"\u80A1\u7968\u5360\u51C0\u6BD4"),n=Q(t.series,"\u503A\u5238\u5360\u51C0\u6BD4"),r=Q(t.series,"\u73B0\u91D1\u5360\u51C0\u6BD4"),o=Q(t.series,"\u5176\u4ED6\u5360\u51C0\u6BD4"),i=Q(t.series,"\u51C0\u8D44\u4EA7");return t.categories.map((a,u)=>({date:a,timestamp:_n(a),stockRatio:e[u]??0,bondRatio:n[u]??0,cashRatio:r[u]??0,otherRatio:o[u]??0,netAsset:i[u]??0}))}function ji(t){return t?t.filter(([e])=>typeof e=="number"&&Number.isFinite(e)).map(([e,n])=>({date:Rn(e),timestamp:e,position:n})):[]}function Gi(t){return t?t.map(e=>{let n=e?.star;return{id:e?.id??"",name:e?.name??"",avatarUrl:e?.pic?.trim()||null,star:typeof n=="number"&&Number.isFinite(n)?n:null,workTime:e?.workTime?.trim()||null,fundSize:e?.fundSize?.trim()||null,power:vr(e?.power)}}):[]}function vr(t){return t?.categories?.length?{overall:M(t.avr)??0,categories:t.categories,scores:t.data??[],descriptions:t.dsc??[]}:null}function Yi(t){if(!t?.categories?.length||!t?.series)return[];let e=Q(t.series,"\u673A\u6784\u6301\u6709\u6BD4\u4F8B"),n=Q(t.series,"\u4E2A\u4EBA\u6301\u6709\u6BD4\u4F8B"),r=Q(t.series,"\u5185\u90E8\u6301\u6709\u6BD4\u4F8B");return t.categories.map((o,i)=>({date:o,timestamp:_n(o),institutionRatio:e[i]??0,individualRatio:n[i]??0,internalRatio:r[i]??0}))}function Wi(t){return!t?.categories?.length||!t?.series?[]:t.categories.map((e,n)=>({date:e,scale:t.series?.[n]?.y??0,mom:t.series?.[n]?.mom??""}))}function Vi(t){if(!t?.categories?.length||!t?.series)return[];let e=Q(t.series,"\u671F\u95F4\u7533\u8D2D"),n=Q(t.series,"\u671F\u95F4\u8D4E\u56DE"),r=Q(t.series,"\u603B\u4EFD\u989D");return t.categories.map((o,i)=>({date:o,timestamp:_n(o),buy:e[i]??0,sell:n[i]??0,total:r[i]??0}))}function Xi(t){return{oneMonth:M(t.syl_1y),threeMonth:M(t.syl_3y),sixMonth:M(t.syl_6y),oneYear:M(t.syl_1n)}}function Zi(t){if(typeof t!="string")return null;let e=t.indexOf("_");if(e<0)return null;let n=t.slice(0,e);if(!n)return null;let r=t.lastIndexOf("_");return r>e?{code:n,name:t.slice(e+1,r),value:M(t.slice(r+1))}:{code:n,name:t.slice(e+1),value:null}}function Ji(t){if(!t?.length)return null;let e=t.map(n=>(Array.isArray(n)?n:[]).map(Zi).filter(r=>r!==null)).filter(n=>n.length>0);return e.length?{groups:e}:null}async function Kr(t,e){let n=`${En}/${encodeURIComponent(e)}.js`,r=await se(n,["fS_code","fS_name","fund_sourceRate","fund_Rate","fund_minsg","stockCodesNew","zqCodesNew","Data_assetAllocation","Data_fundSharesPositions","Data_currentFundManager","Data_performanceEvaluation","Data_holderStructure","Data_fluctuationScale","Data_buySedemption","syl_1y","syl_3y","syl_6y","syl_1n","swithSameType"],{client:t});return{code:r.fS_code??e,name:r.fS_name??null,sourceRate:M(r.fund_sourceRate),rate:M(r.fund_Rate),minSubscription:M(r.fund_minsg),holdings:zi(r.stockCodesNew),bondHoldings:$i(r.zqCodesNew),assetAllocation:Qi(r.Data_assetAllocation),positions:ji(r.Data_fundSharesPositions),managers:Gi(r.Data_currentFundManager),performance:vr(r.Data_performanceEvaluation),holderStructure:Yi(r.Data_holderStructure),scaleChanges:Wi(r.Data_fluctuationScale),buySedemption:Vi(r.Data_buySedemption),stageReturns:Xi(r),sameType:Ji(r.swithSameType)}}function Cn(t){let e=t.match(/^([a-zA-Z]+)/);if(!e)throw new h(`Invalid futures symbol: "${t}". Expected format: variety + contract (e.g., rb2605, RBM, IF2604)`);return e[1]}function Br(t){return ue[t]??ue[t.toLowerCase()]??ue[t.toUpperCase()]}function An(t){let e=Br(t);if(!e&&t.length>1&&t.endsWith("M")&&(e=Br(t.slice(0,-1))),!e){let r=Object.keys(ue).join(", ");throw new h(`Unknown futures variety: "${t}". Supported varieties: ${r}`)}let n=zt[e];if(n===void 0)throw new h(`No market code found for exchange: ${e}`);return n}function es(t){let e=v(t),n=t.split(",");return{...e,openInterest:n.length>12?m(n[12]):null}}async function Hr(t,e,n={}){let{period:r="daily",startDate:o="19700101",endDate:i="20500101"}=n;q(r);let a=Cn(e),l=`${An(a)}.${e}`,c=new URLSearchParams({fields1:"f1,f2,f3,f4,f5,f6",fields2:"f51,f52,f53,f54,f55,f56,f57,f58,f59,f60,f61,f62,f63,f64",ut:L,klt:z(r),fqt:"0",secid:l,beg:o,end:i}),{klines:d,name:y,code:p}=await K(t,Te,c);return d.length===0?[]:d.map(T=>({...es(T),code:p||e,name:y||""}))}async function qr(t,e={}){let n=e.pageSize??20,r=[],o=0,i=0,a=1e3;do{let u=new URLSearchParams({orderBy:"dm",sort:"desc",pageSize:String(n),pageIndex:String(o),token:he,field:"dm,sc,name,p,zsjd,zde,zdf,f152,o,h,l,zjsj,vol,wp,np,ccl",blockName:"callback"}),l=`${qt}?${u.toString()}`,c=await t.get(l,{responseType:"json"});if(!c||!Array.isArray(c.list))break;o===0&&(i=c.total??0);let d=c.list.map(ts);if(r.push(...d),d.length===0)break;o++}while(r.length<i&&o<a);return r}function ts(t){return{code:t.dm||"",name:t.name||"",price:m(String(t.p)),change:m(String(t.zde)),changePercent:m(String(t.zdf)),open:m(String(t.o)),high:m(String(t.h)),low:m(String(t.l)),prevSettle:m(String(t.zjsj)),volume:m(String(t.vol)),buyVolume:m(String(t.wp)),sellVolume:m(String(t.np)),openInterest:m(String(t.ccl))}}function ns(t){let e=v(t),n=t.split(",");return{...e,openInterest:n.length>12?m(n[12]):null}}function rs(t){let e=t.match(/^([A-Z]+)/);if(!e)throw new h(`Invalid global futures symbol: "${t}". Expected format like HG00Y, CL2507`);return e[1]}async function zr(t,e,n={}){let{period:r="daily",startDate:o="19700101",endDate:i="20500101"}=n;q(r);let a=n.marketCode;if(a===void 0){let p=rs(e);if(a=Ge[p],a===void 0){let T=Object.keys(Ge).join(", ");throw new h(`Unknown global futures variety: "${p}". Supported: ${T}. Or specify marketCode manually via options.`)}}let u=`${a}.${e}`,l=new URLSearchParams({fields1:"f1,f2,f3,f4,f5,f6",fields2:"f51,f52,f53,f54,f55,f56,f57,f58,f59,f60,f61,f62,f63,f64",ut:L,klt:z(r),fqt:"0",secid:u,beg:o,end:i}),{klines:c,name:d,code:y}=await K(t,Te,l);return c.length===0?[]:c.map(p=>({...ns(p),code:y||e,name:d||""}))}async function $r(t,e={}){let{pageSize:n=2e4}=e,r=new URLSearchParams({orderBy:"zdf",sort:"desc",pageSize:String(n),pageIndex:"0",token:he,field:"dm,sc,name,p,zsjd,zde,zdf,f152,vol,cje,ccl,xqj,syr,rz,zjsj,o"}),o=`${Yt}?${r.toString()}`,a=(await t.get(o,{responseType:"json"}))?.list;return Array.isArray(a)?a.map(u=>({code:String(u.dm??""),name:String(u.name??""),price:s(u.p),change:s(u.zde),changePercent:s(u.zdf),volume:s(u.vol),amount:s(u.cje),openInterest:s(u.ccl),strikePrice:s(u.xqj),remainDays:s(u.syr),dailyChange:s(u.rz),prevSettle:s(u.zjsj),open:s(u.o)})):[]}async function Qr(t,e,n){let r=new URLSearchParams({type:"RPT_IF_BILLBOARD_TD",sty:"ALL",p:"1",ps:"200",source:"IFBILLBOARD",client:"WEB",ut:$,filter:`(SECURITY_CODE="${e}")(TRADE_DATE='${n}')`}),o=`${Wt}?${r.toString()}`,a=(await t.get(o,{responseType:"json"}))?.result?.data;if(!Array.isArray(a))return[];function u(l){if(!l)return"";let c=String(l),d=c.match(/^(\d{4}-\d{2}-\d{2})/);return d?d[1]:c}return a.map(l=>({tradeType:String(l.TRADE_TYPE??""),date:u(l.TRADE_DATE),symbol:String(l.SECURITY_CODE??""),targetName:String(l.TARGET_NAME??""),memberName:String(l.MEMBER_NAME_ABBR??""),rank:s(l.MEMBER_RANK)??0,sellVolume:s(l.SELL_VOLUME),sellVolumeChange:s(l.SELL_VOLUME_CHANGE),netSellVolume:s(l.NET_SELL_VOLUME),sellVolumeRatio:s(l.SELL_VOLUME_RATIO),buyVolume:s(l.BUY_VOLUME),buyVolumeChange:s(l.BUY_VOLUME_CHANGE),netBuyVolume:s(l.NET_BUY_VOLUME),buyVolumeRatio:s(l.BUY_VOLUME_RATIO),sellPosition:s(l.SELL_POSITION),sellPositionChange:s(l.SELL_POSITION_CHANGE),netSellPosition:s(l.NET_SELL_POSITION),sellPositionRatio:s(l.SELL_POSITION_RATIO),buyPosition:s(l.BUY_POSITION),buyPositionChange:s(l.BUY_POSITION_CHANGE),netBuyPosition:s(l.NET_BUY_POSITION),buyPositionRatio:s(l.BUY_POSITION_RATIO)}))}var os={gold:"EMI00069026",silver:"EMI00069027"};function jr(t){if(!t)return"";let e=String(t),n=e.match(/^(\d{4}-\d{2}-\d{2})/);return n?n[1]:e}async function Gr(t){return A(t,{reportName:"RPT_FUTU_POSITIONCODE",columns:"TRADE_MARKET_CODE,TRADE_CODE,TRADE_TYPE",filter:'(IS_MAINCODE="1")',pageSize:500,fetchAllPages:!1},e=>({code:String(e.TRADE_CODE??""),name:String(e.TRADE_TYPE??""),marketCode:String(e.TRADE_MARKET_CODE??"")}))}async function Yr(t,e,n={}){let{startDate:r="2020-10-28",pageSize:o=500}=n,i=e.toUpperCase();return A(t,{reportName:"RPT_FUTU_STOCKDATA",columns:"SECURITY_CODE,TRADE_DATE,ON_WARRANT_NUM,ADDCHANGE",filter:`(SECURITY_CODE="${i}")(TRADE_DATE>='${b(r)}')`,pageSize:o,sortColumns:"TRADE_DATE",sortTypes:"-1"},a=>({code:String(a.SECURITY_CODE??e),date:jr(a.TRADE_DATE),inventory:s(a.ON_WARRANT_NUM),change:s(a.ADDCHANGE)}))}async function Wr(t,e,n={}){let r=os[e];if(!r)throw new h(`Invalid COMEX symbol: "${e}". Must be "gold" or "silver".`);let{pageSize:o=500}=n,i={gold:"\u9EC4\u91D1",silver:"\u767D\u94F6"};return A(t,{reportName:"RPT_FUTUOPT_GOLDSIL",sortColumns:"REPORT_DATE",sortTypes:"-1",pageSize:o,filter:`(INDICATOR_ID1="${r}")(@STORAGE_TON<>"NULL")`},a=>({date:jr(a.REPORT_DATE),name:i[e]??e,storageTon:s(a.STORAGE_TON),storageOunce:s(a.STORAGE_OUNCE)}))}var Vr={daily:"101",weekly:"102",monthly:"103"},On="f51,f52,f53,f54,f55,f56,f57,f58,f59,f60,f61,f62,f63,f64,f65";function Xr(t){let e=t.split(",");return{date:e[0]??"",mainNetInflow:m(e[1]),smallNetInflow:m(e[2]),mediumNetInflow:m(e[3]),largeNetInflow:m(e[4]),superLargeNetInflow:m(e[5]),mainNetInflowPercent:m(e[6]),smallNetInflowPercent:m(e[7]),mediumNetInflowPercent:m(e[8]),largeNetInflowPercent:m(e[9]),superLargeNetInflowPercent:m(e[10]),close:m(e[11]),changePercent:m(e[12])}}function is(t){let e=t.split(",");return{date:e[0]??"",mainNetInflow:m(e[1]),smallNetInflow:m(e[2]),mediumNetInflow:m(e[3]),largeNetInflow:m(e[4]),superLargeNetInflow:m(e[5]),mainNetInflowPercent:m(e[6]),smallNetInflowPercent:m(e[7]),mediumNetInflowPercent:m(e[8]),largeNetInflowPercent:m(e[9]),superLargeNetInflowPercent:m(e[10]),shClose:m(e[11]),shChangePercent:m(e[12]),szClose:m(e[13]),szChangePercent:m(e[14])}}var Zr={today:{fid:"f62",fields:"f12,f14,f2,f3,f62,f184,f66,f69,f72,f75,f78,f81,f84,f87,f124",changePercentField:"f3",mainNet:"f62",mainPct:"f184",superLargeNet:"f66",superLargePct:"f69",largeNet:"f72",largePct:"f75",mediumNet:"f78",mediumPct:"f81",smallNet:"f84",smallPct:"f87"},"3day":{fid:"f267",fields:"f12,f14,f2,f127,f267,f268,f269,f270,f271,f272,f273,f274,f275,f276,f124",changePercentField:"f127",mainNet:"f267",mainPct:"f268",superLargeNet:"f269",superLargePct:"f270",largeNet:"f271",largePct:"f272",mediumNet:"f273",mediumPct:"f274",smallNet:"f275",smallPct:"f276"},"5day":{fid:"f164",fields:"f12,f14,f2,f109,f164,f165,f166,f167,f168,f169,f170,f171,f172,f173,f124",changePercentField:"f109",mainNet:"f164",mainPct:"f165",superLargeNet:"f166",superLargePct:"f167",largeNet:"f168",largePct:"f169",mediumNet:"f170",mediumPct:"f171",smallNet:"f172",smallPct:"f173"},"10day":{fid:"f174",fields:"f12,f14,f2,f160,f174,f175,f176,f177,f178,f179,f180,f181,f182,f183,f124",changePercentField:"f160",mainNet:"f174",mainPct:"f175",superLargeNet:"f176",superLargePct:"f177",largeNet:"f178",largePct:"f179",mediumNet:"f180",mediumPct:"f181",smallNet:"f182",smallPct:"f183"}},ss={industry:"m:90+t:2",concept:"m:90+t:3",region:"m:90+t:1"},as="m:0+t:6+f:!2,m:0+t:13+f:!2,m:0+t:80+f:!2,m:1+t:2+f:!2,m:1+t:23+f:!2,m:0+t:7+f:!2,m:1+t:3+f:!2";async function Jr(t,e,n=100,r=1e3){let o=[],i=1,a=0;do{let u=new URLSearchParams({...e,pn:String(i),pz:String(n)}),l=`${Bt}?${u.toString()}`,d=(await t.get(l,{responseType:"json"}))?.data;if(!d||!Array.isArray(d.diff)||(i===1&&(a=d.total??0),o.push(...d.diff),o.length>=a||d.diff.length<n))break;i++}while(o.length<a&&i<=r);return i>r&&o.length<a&&console.warn(`[stock-sdk] fetchClistAllPages truncated at maxPages=${r} (server reports total=${a}, fetched=${o.length}). Pass a larger \`maxPages\` to fetch the full dataset.`),o}async function eo(t,e,n={}){let{period:r="daily"}=n,o=Vr[r];if(!o)throw new h(`Invalid period: ${r}. Must be daily/weekly/monthly.`);let i=ee(J(e,{market:"CN"})),a=new URLSearchParams({lmt:"0",klt:o,secid:i,fields1:"f1,f2,f3,f7",fields2:On,ut:$}),u=`${fe}?${a.toString()}`,c=(await t.get(u,{responseType:"json"}))?.data?.klines;return!Array.isArray(c)||c.length===0?[]:c.map(Xr)}async function to(t){let e=new URLSearchParams({lmt:"0",klt:"101",secid:"1.000001",secid2:"0.399001",fields1:"f1,f2,f3,f7",fields2:On,ut:$}),n=`${fe}?${e.toString()}`,o=(await t.get(n,{responseType:"json"}))?.data?.klines;return!Array.isArray(o)||o.length===0?[]:o.map(is)}async function no(t,e={}){let{indicator:n="today"}=e,r=Zr[n];if(!r)throw new h(`Invalid indicator: ${n}.`);let o={fid:r.fid,po:"1",np:"1",fltt:"2",invt:"2",ut:$,fs:as,fields:r.fields};return(await Jr(t,o,100)).map(a=>({code:String(a.f12??""),name:String(a.f14??""),price:s(a.f2),changePercent:s(a[r.changePercentField]),mainNetInflow:s(a[r.mainNet]),mainNetInflowPercent:s(a[r.mainPct]),superLargeNetInflow:s(a[r.superLargeNet]),superLargeNetInflowPercent:s(a[r.superLargePct]),largeNetInflow:s(a[r.largeNet]),largeNetInflowPercent:s(a[r.largePct]),mediumNetInflow:s(a[r.mediumNet]),mediumNetInflowPercent:s(a[r.mediumPct]),smallNetInflow:s(a[r.smallNet]),smallNetInflowPercent:s(a[r.smallPct])}))}async function ro(t,e={}){let{indicator:n="today",sectorType:r="industry"}=e,o=Zr[n];if(!o)throw new h(`Invalid indicator: ${n}.`);let i=ss[r];if(!i)throw new h(`Invalid sectorType: ${r}.`);let a=`${o.fields},f204,f205`,u={fid:o.fid,po:"1",np:"1",fltt:"2",invt:"2",ut:$,fs:i,fields:a};return(await Jr(t,u,100)).map(c=>({code:String(c.f12??""),name:String(c.f14??""),changePercent:s(c[o.changePercentField]),mainNetInflow:s(c[o.mainNet]),mainNetInflowPercent:s(c[o.mainPct]),superLargeNetInflow:s(c[o.superLargeNet]),largeNetInflow:s(c[o.largeNet]),mediumNetInflow:s(c[o.mediumNet]),smallNetInflow:s(c[o.smallNet]),topStockCode:c.f204?String(c.f204):void 0,topStockName:c.f205?String(c.f205):void 0}))}async function oo(t,e,n={}){let{period:r="daily"}=n,o=Vr[r];if(!o)throw new h(`Invalid period: ${r}. Must be daily/weekly/monthly.`);let i=e.includes(".")?e:`90.${e}`,a=new URLSearchParams({lmt:"0",klt:o,secid:i,fields1:"f1,f2,f3,f7",fields2:On,ut:$}),u=`${fe}?${a.toString()}`,c=(await t.get(u,{responseType:"json"}))?.data?.klines;return!Array.isArray(c)||c.length===0?[]:c.map(Xr)}var us={today:"1","3day":"3","5day":"5","10day":"10",month:"M",quarter:"Q",year:"Y"},ls={shanghai:"001",shenzhen:"003"};function io(t,e){let n=t.split(",");return{date:e,time:n[0]??"",shanghaiNetInflow:m(n[1]),shenzhenNetInflow:m(n[3]),totalNetInflow:m(n[5])}}async function so(t,e="north"){He(e);let n=new URLSearchParams({fields1:"f1,f2,f3,f4",fields2:"f51,f54,f52,f58,f53,f62,f56,f57,f60,f61",ut:$}),r=`${Ht}?${n.toString()}`,i=(await t.get(r,{responseType:"json"}))?.data;if(!i)return[];if(e==="south"){let l=i.n2s??[],c=i.n2sDate??"";return l.map(d=>io(d,b(c)))}let a=i.s2n??[],u=i.s2nDate??"";return a.map(l=>io(l,b(u)))}async function ao(t){return A(t,{reportName:"RPT_MUTUAL_QUOTA",columns:"TRADE_DATE,MUTUAL_TYPE,BOARD_TYPE,MUTUAL_TYPE_NAME,FUNDS_DIRECTION,INDEX_CODE,INDEX_NAME,BOARD_CODE",quoteColumns:"status~07~BOARD_CODE,dayNetAmtIn~07~BOARD_CODE,dayAmtRemain~07~BOARD_CODE,dayAmtThreshold~07~BOARD_CODE,f104~07~BOARD_CODE,f105~07~BOARD_CODE,f106~07~BOARD_CODE,f3~03~INDEX_CODE~INDEX_f3,netBuyAmt~07~BOARD_CODE",quoteType:"0",sortColumns:"MUTUAL_TYPE",sortTypes:"1",pageSize:2e3,fetchAllPages:!1},e=>({date:F(e.TRADE_DATE),type:String(e.MUTUAL_TYPE??""),boardName:String(e.MUTUAL_TYPE_NAME??""),direction:String(e.FUNDS_DIRECTION??""),status:String(e.status??""),netBuyAmount:s(e.netBuyAmt),netInflow:s(e.dayNetAmtIn),remainAmount:s(e.dayAmtRemain),upCount:s(e.f104),flatCount:s(e.f106),downCount:s(e.f105),indexCode:String(e.INDEX_CODE??""),indexName:String(e.INDEX_NAME??""),indexChangePercent:s(e.INDEX_f3)}))}async function uo(t,e={}){let{market:n="all",period:r="5day",date:o}=e,i=us[r];if(!i)throw new h(`Invalid period: ${r}.`);let a=[`(INTERVAL_TYPE="${i}")`];return o&&a.push(`(TRADE_DATE='${o}')`),n!=="all"&&a.push(`(MUTUAL_TYPE="${ls[n]}")`),A(t,{reportName:"RPT_MUTUAL_STOCK_NORTHSTA",columns:"ALL",sortColumns:"ADD_MARKET_CAP",sortTypes:"-1",pageSize:500,filter:a.join("")},u=>({date:F(u.TRADE_DATE),code:String(u.SECURITY_CODE??""),name:String(u.SECURITY_NAME??u.SECURITY_NAME_ABBR??""),close:s(u.CLOSE_PRICE),changePercent:s(u.CHANGE_RATE),holdShares:s(u.HOLD_SHARES),holdMarketValue:s(u.HOLD_MARKET_CAP),holdRatioFloat:s(u.HOLD_RATIO),holdRatioTotal:s(u.A_SHARES_RATIO),addShares:s(u.ADD_SHARES),addMarketValue:s(u.ADD_MARKET_CAP),addMarketValuePercent:s(u.ADD_MARKET_CAP_PROPORTION),sector:String(u.BOARD_NAME??"")}))}async function lo(t,e="north",n={}){He(e);let{startDate:r,endDate:o}=n,i=[e==="north"?'(BOARD_TYPE="1")':'(BOARD_TYPE="0")'];return r&&i.push(`(TRADE_DATE>='${b(r)}')`),o&&i.push(`(TRADE_DATE<='${b(o)}')`),A(t,{reportName:"RPT_MUTUAL_DEAL_HISTORY",columns:"ALL",sortColumns:"TRADE_DATE",sortTypes:"-1",pageSize:500,filter:i.join("")},a=>({date:F(a.TRADE_DATE),netBuyAmount:s(a.NET_DEAL_AMT),buyAmount:s(a.BUY_AMT),sellAmount:s(a.SELL_AMT),accNetBuyAmount:s(a.ACCUM_DEAL_AMT),netInflow:s(a.FUND_INFLOW),remainAmount:s(a.QUOTA_BALANCE),topStockCode:a.LEAD_STOCKS_CODE?String(a.LEAD_STOCKS_CODE):null,topStockName:a.LEAD_STOCKS_NAME?String(a.LEAD_STOCKS_NAME):null,topStockChangePercent:s(a.LS_CHANGE_RATE)}))}async function co(t,e,n={}){let r=e.replace(/^(sh|sz|bj)/i,""),{startDate:o,endDate:i}=n,a=[`(SECURITY_CODE="${r}")`];return o&&a.push(`(TRADE_DATE>='${b(o)}')`),i&&a.push(`(TRADE_DATE<='${b(i)}')`),A(t,{reportName:"RPT_MUTUAL_HOLDSTOCKNORTH_STA",columns:"ALL",sortColumns:"TRADE_DATE",sortTypes:"-1",pageSize:500,filter:a.join("")},u=>({date:F(u.TRADE_DATE),holdShares:s(u.HOLD_SHARES),holdMarketValue:s(u.HOLD_MARKET_CAP),holdRatioFloat:s(u.HOLD_RATIO),holdRatioTotal:s(u.A_SHARES_RATIO),close:s(u.CLOSE_PRICE),changePercent:s(u.CHANGE_RATE)}))}var cs={zt:{path:"/getTopicZTPool",sort:"fbt:asc"},yesterday:{path:"/getYesterdayZTPool",sort:"zs:desc"},strong:{path:"/getTopicQSPool",sort:"zdp:desc"},sub_new:{path:"/getTopicCXPool",sort:"ods:asc"},broken:{path:"/getTopicZBPool",sort:"fbt:asc"},dt:{path:"/getTopicDTPool",sort:"fund:asc"}},ds={rocket_launch:"8201",quick_rebound:"8202",large_buy:"8193",limit_up_seal:"4",limit_down_open:"32",big_buy_order:"64",auction_up:"8207",high_open_5d:"8209",gap_up:"8211",high_60d:"8213",surge_60d:"8215",accelerate_down:"8204",high_dive:"8203",large_sell:"8194",limit_down_seal:"8",limit_up_open:"16",big_sell_order:"128",auction_down:"8208",low_open_5d:"8210",gap_down:"8212",low_60d:"8214",drop_60d:"8216"},ps={8201:"\u706B\u7BAD\u53D1\u5C04",8202:"\u5FEB\u901F\u53CD\u5F39",8193:"\u5927\u7B14\u4E70\u5165",4:"\u5C01\u6DA8\u505C\u677F",32:"\u6253\u5F00\u8DCC\u505C\u677F",64:"\u6709\u5927\u4E70\u76D8",8207:"\u7ADE\u4EF7\u4E0A\u6DA8",8209:"\u9AD8\u5F005\u65E5\u7EBF",8211:"\u5411\u4E0A\u7F3A\u53E3",8213:"60\u65E5\u65B0\u9AD8",8215:"60\u65E5\u5927\u5E45\u4E0A\u6DA8",8204:"\u52A0\u901F\u4E0B\u8DCC",8203:"\u9AD8\u53F0\u8DF3\u6C34",8194:"\u5927\u7B14\u5356\u51FA",8:"\u5C01\u8DCC\u505C\u677F",16:"\u6253\u5F00\u6DA8\u505C\u677F",128:"\u6709\u5927\u5356\u76D8",8208:"\u7ADE\u4EF7\u4E0B\u8DCC",8210:"\u4F4E\u5F005\u65E5\u7EBF",8212:"\u5411\u4E0B\u7F3A\u53E3",8214:"60\u65E5\u65B0\u4F4E",8216:"60\u65E5\u5927\u5E45\u4E0B\u8DCC"};function Pn(t){if(t==null)return"";let e=String(t).padStart(6,"0");return`${e.slice(0,2)}:${e.slice(2,4)}:${e.slice(4,6)}`}function ms(t){if(!t||typeof t!="object")return"";let e=t;return`${e.days??""}/${e.ct??""}`}function gs(t){let e=s(t.p),n=s(t.tp);return{code:String(t.c??t.m??""),name:String(t.n??""),price:e!==null?e/1e3:null,changePercent:s(t.zdp),limitPrice:n!==null?n/1e3:null,amount:s(t.amount??t.zb),floatMarketValue:s(t.ltsz),totalMarketValue:s(t.tshare),turnoverRate:s(t.hs),continuousBoardCount:s(t.lbc),firstBoardTime:t.fbt!==void 0&&t.fbt!==null?Pn(t.fbt):null,lastBoardTime:t.lbt!==void 0&&t.lbt!==null?Pn(t.lbt):null,boardAmount:s(t.fund),sealAmount:s(t.fund),failedCount:s(t.zbc),industry:String(t.hybk??""),ztStatistics:ms(t.zttj),amplitude:s(t.zf),speed:s(t.zs)}}function fs(t){if(t)return/^\d{8}$/.test(t)?t:t.replace(/-/g,"")}function ys(){return Y(E.CN).replace(/-/g,"")}async function po(t,e="zt",n){let r=cs[e];if(!r)throw new h(`Invalid ZTPool type: ${e}.`);let o=fs(n)??ys(),i=new URLSearchParams({ut:L,dpt:"wz.ztzt",Pageindex:"0",pagesize:"10000",sort:r.sort,date:o}),a=`${ye}${r.path}?${i.toString()}`,l=(await t.get(a,{responseType:"json"}))?.data?.pool;return!Array.isArray(l)||l.length===0?[]:l.map(gs)}async function mo(t,e="large_buy"){let n=ds[e];if(!n)throw new h(`Invalid StockChangeType: ${e}.`);let r=new URLSearchParams({type:n,pageindex:"0",pagesize:"5000",ut:L,dpt:"wzchanges"}),o=`${ye}/getAllStockChanges?${r.toString()}`,a=(await t.get(o,{responseType:"json"}))?.data?.allstock;return!Array.isArray(a)||a.length===0?[]:a.map(u=>{let l=String(u.t??n);return{time:Pn(u.tm),code:String(u.c??""),name:String(u.n??""),changeType:e,changeTypeLabel:ps[l]??"",info:String(u.i??"")}})}async function go(t){let e=new URLSearchParams({ut:L,dpt:"wzchanges",pageindex:"0",pagesize:"5000"}),n=`${ye}/getAllBKChanges?${e.toString()}`,o=(await t.get(n,{responseType:"json"}))?.data?.allbk;return!Array.isArray(o)||o.length===0?[]:o.map(i=>{let a=i.ms??{},u=a.m===0?"\u5927\u7B14\u4E70\u5165":a.m===1?"\u5927\u7B14\u5356\u51FA":"",l={},c=i.bkdf??i.bkdfdis;if(c&&typeof c=="object")for(let[d,y]of Object.entries(c))l[d]=Number(y)||0;return{name:String(i.bkn??""),changePercent:s(i.bkz),mainNetInflow:s(i.bkj),totalChangeCount:s(i.bkc),topStockCode:String(a.c??""),topStockName:String(a.n??""),topStockDirection:u,changeTypeDistribution:l}})}var fo={"1month":"01","3month":"02","6month":"03","1year":"04"};async function yo(t,e){let n=b(e.startDate),r=b(e.endDate);return A(t,{reportName:"RPT_DAILYBILLBOARD_DETAILSNEW",columns:"SECURITY_CODE,SECUCODE,SECURITY_NAME_ABBR,TRADE_DATE,EXPLAIN,CLOSE_PRICE,CHANGE_RATE,BILLBOARD_NET_AMT,BILLBOARD_BUY_AMT,BILLBOARD_SELL_AMT,BILLBOARD_DEAL_AMT,ACCUM_AMOUNT,DEAL_NET_RATIO,DEAL_AMOUNT_RATIO,TURNOVERRATE,FREE_MARKET_CAP,EXPLANATION,D1_CLOSE_ADJCHRATE,D2_CLOSE_ADJCHRATE,D5_CLOSE_ADJCHRATE,D10_CLOSE_ADJCHRATE",sortColumns:"SECURITY_CODE,TRADE_DATE",sortTypes:"1,-1",pageSize:5e3,filter:`(TRADE_DATE<='${r}')(TRADE_DATE>='${n}')`},o=>({code:String(o.SECURITY_CODE??""),name:String(o.SECURITY_NAME_ABBR??""),date:F(o.TRADE_DATE),close:s(o.CLOSE_PRICE),changePercent:s(o.CHANGE_RATE),netBuyAmount:s(o.BILLBOARD_NET_AMT),buyAmount:s(o.BILLBOARD_BUY_AMT),sellAmount:s(o.BILLBOARD_SELL_AMT),dealAmount:s(o.BILLBOARD_DEAL_AMT),totalAmount:s(o.ACCUM_AMOUNT),netBuyRatio:s(o.DEAL_NET_RATIO),dealAmountRatio:s(o.DEAL_AMOUNT_RATIO),turnoverRate:s(o.TURNOVERRATE),floatMarketValue:s(o.FREE_MARKET_CAP),reason:String(o.EXPLANATION??o.EXPLAIN??""),afterChange1d:s(o.D1_CLOSE_ADJCHRATE),afterChange2d:s(o.D2_CLOSE_ADJCHRATE),afterChange5d:s(o.D5_CLOSE_ADJCHRATE),afterChange10d:s(o.D10_CLOSE_ADJCHRATE)}))}async function To(t,e="1month"){let n=fo[e];if(!n)throw new h(`Invalid period: ${e}.`);return A(t,{reportName:"RPT_BILLBOARD_TRADEALL",columns:"ALL",sortColumns:"BILLBOARD_TIMES,LATEST_TDATE,SECURITY_CODE",sortTypes:"-1,-1,1",pageSize:5e3,filter:`(STATISTICS_CYCLE="${n}")`},r=>({code:String(r.SECURITY_CODE??""),name:String(r.SECURITY_NAME_ABBR??""),latestDate:F(r.LATEST_TDATE),close:s(r.CLOSE_PRICE),changePercent:s(r.CHANGE_RATE),count:s(r.BILLBOARD_TIMES),totalBuyAmount:s(r.BILLBOARD_BUY_AMT),totalSellAmount:s(r.BILLBOARD_SELL_AMT),totalNetAmount:s(r.BILLBOARD_NET_AMT),totalDealAmount:s(r.BILLBOARD_DEAL_AMT),buyOrgCount:s(r.ORG_BUY_TIMES),sellOrgCount:s(r.ORG_SELL_TIMES)}))}async function ho(t,e){let n=b(e.startDate),r=b(e.endDate);return A(t,{reportName:"RPT_ORGANIZATION_TRADE_DETAILS",columns:"ALL",sortColumns:"TRADE_DATE,SECURITY_CODE",sortTypes:"-1,1",pageSize:5e3,filter:`(TRADE_DATE<='${r}')(TRADE_DATE>='${n}')`},o=>({code:String(o.SECURITY_CODE??""),name:String(o.SECURITY_NAME_ABBR??""),date:F(o.TRADE_DATE),close:s(o.CLOSE_PRICE),changePercent:s(o.CHANGE_RATE),buyOrgCount:s(o.BUY_TIMES),sellOrgCount:s(o.SELL_TIMES),orgBuyAmount:s(o.BUY_AMT),orgSellAmount:s(o.SELL_AMT),orgNetAmount:s(o.NET_AMT)}))}async function So(t,e="1month"){let n=fo[e];if(!n)throw new h(`Invalid period: ${e}.`);return A(t,{reportName:"RPT_BILLBOARD_TRADEDETAILS",columns:"ALL",sortColumns:"TOTAL_BUYER_SALESTIMES",sortTypes:"-1",pageSize:5e3,filter:`(STATISTICS_CYCLE="${n}")`},r=>({code:String(r.OPERATEDEPT_CODE??""),name:String(r.OPERATEDEPT_NAME??""),totalBuyAmount:s(r.TOTAL_BUYAMT??r.BUY_AMT),totalSellAmount:s(r.TOTAL_SELLAMT??r.SELL_AMT),buyCount:s(r.TOTAL_BUYER_SALESTIMES??r.BUY_TIMES),sellCount:s(r.TOTAL_SELLER_SALESTIMES??r.SELL_TIMES),totalCount:s(r.TOTAL_TIMES)}))}async function Eo(t,e,n){let r=e.replace(/^(sh|sz|bj)/i,""),o=b(n),i=`(SECURITY_CODE="${r}")(TRADE_DATE='${o}')`,[a,u]=await Promise.all([A(t,{reportName:"RPT_BILLBOARD_DAILYDETAILSBUY",columns:"ALL",sortColumns:"BUY_AMT_REAL",sortTypes:"-1",pageSize:100,filter:i},(l,c)=>({rank:s(l.RANK)??c+1,branchName:String(l.OPERATEDEPT_NAME??""),buyAmount:s(l.BUY_AMT_REAL??l.BUY_AMT),buyAmountRatio:s(l.BUY_RATIO_TOTAL??l.BUY_AMT_RATIO),sellAmount:s(l.SELL_AMT_REAL??l.SELL_AMT),sellAmountRatio:s(l.SELL_RATIO_TOTAL??l.SELL_AMT_RATIO),netAmount:s(l.NET_AMT),side:"buy"})),A(t,{reportName:"RPT_BILLBOARD_DAILYDETAILSSELL",columns:"ALL",sortColumns:"SELL_AMT_REAL",sortTypes:"-1",pageSize:100,filter:i},(l,c)=>({rank:s(l.RANK)??c+1,branchName:String(l.OPERATEDEPT_NAME??""),buyAmount:s(l.BUY_AMT_REAL??l.BUY_AMT),buyAmountRatio:s(l.BUY_RATIO_TOTAL??l.BUY_AMT_RATIO),sellAmount:s(l.SELL_AMT_REAL??l.SELL_AMT),sellAmountRatio:s(l.SELL_RATIO_TOTAL??l.SELL_AMT_RATIO),netAmount:s(l.NET_AMT),side:"sell"}))]);return[...a,...u]}function Ro(t){if(!t)return"";let e=t.startDate?b(t.startDate):void 0,n=t.endDate?b(t.endDate):void 0,r=[];return e&&r.push(`(TRADE_DATE>='${e}')`),n&&r.push(`(TRADE_DATE<='${n}')`),r.join("")}async function _o(t){return A(t,{reportName:"PRT_BLOCKTRADE_MARKET_STA",columns:"ALL",sortColumns:"TRADE_DATE",sortTypes:"-1",pageSize:500},e=>({date:F(e.TRADE_DATE),shClose:s(e.CLOSE_PRICE??e.SH_CLOSE_PRICE),shChangePercent:s(e.CHANGE_RATE??e.SH_CHANGE_RATE),totalAmount:s(e.TURNOVER??e.TOTAL_AMOUNT),premiumAmount:s(e.PREMIUM_TURNOVER??e.PREMIUM_AMOUNT),premiumRatio:s(e.PREMIUM_RATIO),discountAmount:s(e.DISCOUNT_TURNOVER??e.DISCOUNT_AMOUNT),discountRatio:s(e.DISCOUNT_RATIO)}))}async function Co(t,e={}){let n=Ro(e);return A(t,{reportName:"RPT_BLOCK_TRADE_DETAIL",columns:"ALL",sortColumns:"TRADE_DATE,SECURITY_CODE",sortTypes:"-1,1",pageSize:5e3,filter:n||void 0},r=>({code:String(r.SECURITY_CODE??""),name:String(r.SECURITY_NAME_ABBR??""),date:F(r.TRADE_DATE),close:s(r.CLOSE_PRICE),changePercent:s(r.CHANGE_RATE),dealPrice:s(r.DEAL_PRICE??r.PRICE),dealVolume:s(r.DEAL_VOLUME??r.VOLUME),dealAmount:s(r.DEAL_AMT??r.TURNOVER),premiumRate:s(r.PREMIUM_RATIO??r.PREMIUM_RATE),buyBranch:String(r.BUYER_DEPT??r.BUYER_OPERATEDEPT_NAME??""),sellBranch:String(r.SELLER_DEPT??r.SELLER_OPERATEDEPT_NAME??"")}))}async function Ao(t,e={}){let n=Ro(e);return A(t,{reportName:"RPT_BLOCK_TRADE_STA",columns:"ALL",sortColumns:"TRADE_DATE,DEAL_AMT",sortTypes:"-1,-1",pageSize:5e3,filter:n||void 0},r=>({code:String(r.SECURITY_CODE??""),name:String(r.SECURITY_NAME_ABBR??""),date:F(r.TRADE_DATE),changePercent:s(r.CHANGE_RATE),close:s(r.CLOSE_PRICE),dealCount:s(r.DEAL_NUM??r.DEAL_COUNT),dealTotalAmount:s(r.DEAL_AMT??r.TOTAL_AMOUNT),dealTotalVolume:s(r.DEAL_VOLUME??r.TOTAL_VOLUME),premiumAmount:s(r.PREMIUM_AMT??r.PREMIUM_AMOUNT),discountAmount:s(r.DISCOUNT_AMT??r.DISCOUNT_AMOUNT)}))}async function Oo(t){return A(t,{reportName:"RPTA_WEB_MARGIN_DAILYTRADE",columns:"ALL",sortColumns:"STATISTICS_DATE",sortTypes:"-1",pageSize:500},e=>({date:F(e.STATISTICS_DATE??e.TRADE_DATE),finBalance:s(e.FIN_BALANCE),loanBalance:s(e.LOAN_BALANCE),finBuyAmount:s(e.FIN_BUY_AMT),loanSellAmount:s(e.LOAN_SELL_AMT),investorCount:s(e.OPERATE_INVESTOR_NUM??e.INVESTOR_NUM),liabilityInvestorCount:s(e.MARGIN_INVESTOR_NUM),totalGuarantee:s(e.TOTAL_GUARANTEE),avgGuaranteeRatio:s(e.AVG_GUARANTEE_RATIO)}))}async function Po(t,e){let n=e?`(TRADE_DATE='${e}')`:void 0;return A(t,{reportName:"RPT_MARGIN_TRADE_DETAIL",columns:"ALL",sortColumns:"FIN_BALANCE",sortTypes:"-1",pageSize:5e3,filter:n},r=>({code:String(r.SECURITY_CODE??""),name:String(r.SECURITY_NAME_ABBR??""),date:F(r.TRADE_DATE),finBalance:s(r.FIN_BALANCE),finBuyAmount:s(r.FIN_BUY_AMT),finRepayAmount:s(r.FIN_REPAY_AMT),loanBalance:s(r.LOAN_BALANCE),loanSellVolume:s(r.LOAN_SELL_VOLUME),loanRepayVolume:s(r.LOAN_REPAY_VOLUME)}))}var B={};at(B,{getCommodityOptionKline:()=>Uo,getCommodityOptionSpot:()=>xo,getETFOption5DayMinute:()=>Fo,getETFOptionDailyKline:()=>Lo,getETFOptionExpireDay:()=>Mo,getETFOptionMinute:()=>ko,getETFOptionMonths:()=>bo,getIndexOptionKline:()=>Io,getIndexOptionSpot:()=>Do});function Ts(t){return{buyVolume:s(t[0]),buyPrice:s(t[1]),price:s(t[2]),askPrice:s(t[3]),askVolume:s(t[4]),openInterest:s(t[5]),change:s(t[6]),strikePrice:s(t[7]),symbol:t[8]??""}}function hs(t){return{buyVolume:s(t[0]),buyPrice:s(t[1]),price:s(t[2]),askPrice:s(t[3]),askVolume:s(t[4]),openInterest:s(t[5]),change:s(t[6]),strikePrice:null,symbol:t[7]??""}}async function Do(t,e){let n=`${Se}?type=futures&product=${t}&exchange=cffex&pinzhong=${e}`,r=await x(n),o=r?.result?.data?.up??[],i=r?.result?.data?.down??[];return{calls:o.map(Ts),puts:i.map(hs)}}async function Io(t){let e=`${Ee}?symbol=${t}`,n=await x(e,{callbackMode:"path"});return Array.isArray(n)?n.map(r=>({date:r.d,open:s(r.o),high:s(r.h),low:s(r.l),close:s(r.c),volume:s(r.v)})):[]}async function bo(t){let e=`${$t}?exchange=null&cate=${encodeURIComponent(t)}`,r=(await x(e))?.result?.data,o=r?.contractMonth??[];return{months:o.length>1?o.slice(1):o,stockId:r?.stockId??"",cateId:r?.cateId??"",cateList:r?.cateList??[]}}async function Mo(t,e){let n=`${Ye}?exchange=null&cate=${encodeURIComponent(t)}&date=${e}`,r=await x(n),o=r?.result?.data?.remainderDays;if(typeof o=="number"&&o<0){let a=`${Ye}?exchange=null&cate=${encodeURIComponent("XD"+t)}&date=${e}`;r=await x(a)}let i=r?.result?.data;return{expireDay:i?.expireDay??"",remainderDays:i?.remainderDays??0,stockId:i?.stockId??"",name:i?.other?.name??""}}function No(t){let e="";return t.map(n=>(n.d&&(e=n.d),{time:n.i,date:e,price:s(n.p),volume:s(n.v),openInterest:s(n.t),avgPrice:s(n.a)}))}async function ko(t){let e=`CON_OP_${t}`,n=`${Qt}?symbol=${e}`,o=(await x(n))?.result?.data;return Array.isArray(o)?No(o):[]}async function Lo(t){let e=`CON_OP_${t}`,n=`${jt}?symbol=${e}`,r=await x(n,{callbackMode:"path"});return Array.isArray(r)?r.map(o=>({date:o.d,open:s(o.o),high:s(o.h),low:s(o.l),close:s(o.c),volume:s(o.v)})):[]}async function Fo(t){let e=`CON_OP_${t}`,n=`${Gt}?symbol=${e}`,o=(await x(n))?.result?.data;if(!Array.isArray(o))return[];let i=[];for(let a of o)Array.isArray(a)&&i.push(...No(a));return i}function Ss(t){return{buyVolume:s(t[0]),buyPrice:s(t[1]),price:s(t[2]),askPrice:s(t[3]),askVolume:s(t[4]),openInterest:s(t[5]),change:s(t[6]),strikePrice:s(t[7]),symbol:t[8]??""}}function Es(t){return{buyVolume:s(t[0]),buyPrice:s(t[1]),price:s(t[2]),askPrice:s(t[3]),askVolume:s(t[4]),openInterest:s(t[5]),change:s(t[6]),strikePrice:null,symbol:t[7]??""}}async function xo(t,e){let n=We[t];if(!n)throw new h(`Unknown commodity option variety: "${t}". Available: ${Object.keys(We).join(", ")}`);let r=`${Se}?type=futures&product=${n.product}&exchange=${n.exchange}&pinzhong=${e}`,o=await x(r),i=o?.result?.data?.up??[],a=o?.result?.data?.down??[];return{calls:i.map(Ss),puts:a.map(Es)}}async function Uo(t){let e=`${Ee}?symbol=${t}`,n=await x(e,{callbackMode:"path"});return Array.isArray(n)?n.map(r=>({date:r.d,open:s(r.o),high:s(r.h),low:s(r.l),close:s(r.c),volume:s(r.v)})):[]}var D=class{constructor(e){this.client=e}};var Ie=class extends D{constructor(e){super(e)}getFundDividendList(e){return g.getFundDividendList(this.client,e)}getFundNavHistory(e){return g.getFundNavHistory(this.client,e)}getFundEstimate(e){return g.getFundEstimate(this.client,e)}getFundRankHistory(e){return g.getFundRankHistory(this.client,e)}getFundProfile(e){return g.getFundProfile(this.client,e)}};var be=class extends D{constructor(e){super(e)}getFullQuotes(e){return I.getFullQuotes(this.client,e)}getSimpleQuotes(e){return I.getSimpleQuotes(this.client,e)}getHKQuotes(e){return I.getHKQuotes(this.client,e)}getUSQuotes(e){return I.getUSQuotes(this.client,e)}getFundQuotes(e){return I.getFundQuotes(this.client,e)}getFundFlow(e){return I.getFundFlow(this.client,e)}getPanelLargeOrder(e){return I.getPanelLargeOrder(this.client,e)}getTodayTimeline(e){return I.getTodayTimeline(this.client,e)}search(e){return I.search(this.client,e)}getAShareCodeList(e){return I.getAShareCodeList(this.client,e)}getUSCodeList(e){return I.getUSCodeList(this.client,e)}getHKCodeList(){return I.getHKCodeList(this.client)}getFundCodeList(){return I.getFundCodeList(this.client)}async getAllAShareQuotes(e={}){let{market:n,...r}=e,o=await this.getAShareCodeList({market:n});return I.getAllQuotesByCodes(this.client,o,r)}async getAllHKShareQuotes(e={}){let n=await this.getHKCodeList();return I.getAllHKQuotesByCodes(this.client,n,e)}async getAllUSShareQuotes(e={}){let{market:n,...r}=e,o=await this.getUSCodeList({simple:!0,market:n});return I.getAllUSQuotesByCodes(this.client,o,r)}getAllQuotesByCodes(e,n={}){return I.getAllQuotesByCodes(this.client,e,n)}batchRaw(e){return this.client.getTencentQuote(e)}getTradingCalendar(){return I.getTradingCalendar(this.client)}getDividendDetail(e){return g.getDividendDetail(this.client,e)}};var Me=class extends D{constructor(e){super(e)}getIndustryList(){return g.getIndustryList(this.client)}getIndustrySpot(e){return g.getIndustrySpot(this.client,e)}getIndustryConstituents(e){return g.getIndustryConstituents(this.client,e)}getIndustryKline(e,n){return g.getIndustryKline(this.client,e,n)}getIndustryMinuteKline(e,n){return g.getIndustryMinuteKline(this.client,e,n)}getConceptList(){return g.getConceptList(this.client)}getConceptSpot(e){return g.getConceptSpot(this.client,e)}getConceptConstituents(e){return g.getConceptConstituents(this.client,e)}getConceptKline(e,n){return g.getConceptKline(this.client,e,n)}getConceptMinuteKline(e,n){return g.getConceptMinuteKline(this.client,e,n)}};var Ne=class extends D{constructor(e){super(e)}getHistoryKline(e,n){return g.getHistoryKline(this.client,e,n)}getMinuteKline(e,n){return g.getMinuteKline(this.client,e,n)}getHKHistoryKline(e,n){return g.getHKHistoryKline(this.client,e,n)}getHKMinuteKline(e,n){return g.getHKMinuteKline(this.client,e,n)}getUSHistoryKline(e,n){return g.getUSHistoryKline(this.client,e,n)}getUSMinuteKline(e,n){return g.getUSMinuteKline(this.client,e,n)}};var ke=class extends D{constructor(e){super(e)}getFuturesKline(e,n){return g.getFuturesHistoryKline(this.client,e,n)}getGlobalFuturesSpot(e){return g.getGlobalFuturesSpot(this.client,e)}getGlobalFuturesKline(e,n){return g.getGlobalFuturesKline(this.client,e,n)}getFuturesInventorySymbols(){return g.getFuturesInventorySymbols(this.client)}getFuturesInventory(e,n){return g.getFuturesInventory(this.client,e,n)}getComexInventory(e,n){return g.getComexInventory(this.client,e,n)}};var Le=class extends D{constructor(e){super(e)}getIndexOptionSpot(e,n){return B.getIndexOptionSpot(e,n)}getIndexOptionKline(e){return B.getIndexOptionKline(e)}getCFFEXOptionQuotes(e){return g.getCFFEXOptionQuotes(this.client,e)}getETFOptionMonths(e){return B.getETFOptionMonths(e)}getETFOptionExpireDay(e,n){return B.getETFOptionExpireDay(e,n)}getETFOptionMinute(e){return B.getETFOptionMinute(e)}getETFOptionDailyKline(e){return B.getETFOptionDailyKline(e)}getETFOption5DayMinute(e){return B.getETFOption5DayMinute(e)}getCommodityOptionSpot(e,n){return B.getCommodityOptionSpot(e,n)}getCommodityOptionKline(e){return B.getCommodityOptionKline(e)}getOptionLHB(e,n){return g.getOptionLHB(this.client,e,n)}};var Rs=500,_s=15,Fe=class{constructor(e,n){this.klineService=e;this.quoteService=n}detectMarket(e){let n=In(e);return n==="HK"?"HK":n==="US"?"US":"A"}calcActualStartDate(e,n,r=1.5){let o=this.toCompactDate(e),i=Math.ceil(n*r),a=new Date(parseInt(o.slice(0,4)),parseInt(o.slice(4,6))-1,parseInt(o.slice(6,8)));a.setDate(a.getDate()-i);let u=a.getFullYear(),l=String(a.getMonth()+1).padStart(2,"0"),c=String(a.getDate()).padStart(2,"0");return`${u}${l}${c}`}calcActualStartDateByCalendar(e,n,r){if(!r||r.length===0)return;let o=r.findIndex(a=>a>=e);o===-1&&(o=r.length-1);let i=Math.max(0,o-n);return this.toCompactDate(r[i])}tryNormalizeDate(e){let n=e.trim();return/^\d{4}-\d{2}-\d{2}/.test(n)?n.slice(0,10):/^\d{8}$/.test(n)?`${n.slice(0,4)}-${n.slice(4,6)}-${n.slice(6,8)}`:null}normalizeUserDate(e){let n=this.tryNormalizeDate(e);if(n===null)throw new h(`\u65E5\u671F\u683C\u5F0F\u5E94\u4E3A 'YYYY-MM-DD' \u6216 'YYYYMMDD',\u5F97\u5230 '${e}'`,{argument:"date",value:e});return n}normalizeRowDate(e){return this.tryNormalizeDate(e)??e}toCompactDate(e){return e.replace(/-/g,"")}async getKlineWithIndicators(e,n={}){let{indicators:r={}}=n,o=n.startDate?this.normalizeUserDate(n.startDate):void 0,i=n.endDate?this.normalizeUserDate(n.endDate):void 0,a=n.market??this.detectMarket(e),{requiredBars:u,maxRecursiveLookback:l}=Nn(r),c={A:1.5,HK:1.46,US:1.45},d;if(o)if(a==="A")try{let O=await this.quoteService.getTradingCalendar();d=this.calcActualStartDateByCalendar(o,u,O)??this.calcActualStartDate(o,u,c[a])}catch{d=this.calcActualStartDate(o,u,c[a])}else d=this.calcActualStartDate(o,u,c[a]);let y={period:n.period,adjust:n.adjust,startDate:d,endDate:i?this.toCompactDate(i):void 0},p;switch(a){case"HK":p=await this.klineService.getHKHistoryKline(e,y);break;case"US":p=await this.klineService.getUSHistoryKline(e,y);break;default:p=await this.klineService.getHistoryKline(e,y)}let T=n.period??"daily",R=30+(T==="weekly"?7:T==="monthly"?31:0),P=p.length===0||d===void 0||this.normalizeRowDate(p[0].date)<=ge(this.normalizeRowDate(d),R),S=!1;if(o&&p.length<u&&P)switch(S=!0,a){case"HK":p=await this.klineService.getHKHistoryKline(e,{...y,startDate:void 0});break;case"US":p=await this.klineService.getUSHistoryKline(e,{...y,startDate:void 0});break;default:p=await this.klineService.getHistoryKline(e,{...y,startDate:void 0})}if(o){let O=p.findIndex(H=>this.normalizeRowDate(H.date)>=o);if(O===-1)return[];let N=p;if(S&&!Mn(r)){let H=l>0?Math.max(u,Rs,_s*l):u;N=p.slice(Math.max(0,O-H))}return dt(N,r).filter(H=>{let w=this.normalizeRowDate(H.date);return w>=o&&(i===void 0||w<=i)})}return dt(p,r)}};var xe=class extends D{constructor(e){super(e)}getIndividualFundFlow(e,n){return g.getIndividualFundFlow(this.client,e,n)}getMarketFundFlow(){return g.getMarketFundFlow(this.client)}getFundFlowRank(e){return g.getFundFlowRank(this.client,e)}getSectorFundFlowRank(e){return g.getSectorFundFlowRank(this.client,e)}getSectorFundFlowHistory(e,n){return g.getSectorFundFlowHistory(this.client,e,n)}};var Ue=class extends D{constructor(e){super(e)}getNorthboundMinute(e){return g.getNorthboundMinute(this.client,e)}getNorthboundFlowSummary(){return g.getNorthboundFlowSummary(this.client)}getNorthboundHoldingRank(e){return g.getNorthboundHoldingRank(this.client,e)}getNorthboundHistory(e,n){return g.getNorthboundHistory(this.client,e,n)}getNorthboundIndividual(e,n){return g.getNorthboundIndividual(this.client,e,n)}};var we=class extends D{constructor(e){super(e)}getZTPool(e,n){return g.getZTPool(this.client,e,n)}getStockChanges(e){return g.getStockChanges(this.client,e)}getBoardChanges(){return g.getBoardChanges(this.client)}};var ve=class extends D{constructor(e){super(e)}getDragonTigerDetail(e){return g.getDragonTigerDetail(this.client,e)}getDragonTigerStockStats(e){return g.getDragonTigerStockStats(this.client,e)}getDragonTigerInstitution(e){return g.getDragonTigerInstitution(this.client,e)}getDragonTigerBranchRank(e){return g.getDragonTigerBranchRank(this.client,e)}getDragonTigerStockSeatDetail(e,n){return g.getDragonTigerStockSeatDetail(this.client,e,n)}};var Ke=class extends D{constructor(e){super(e)}getBlockTradeMarketStat(){return g.getBlockTradeMarketStat(this.client)}getBlockTradeDetail(e){return g.getBlockTradeDetail(this.client,e)}getBlockTradeDailyStat(e){return g.getBlockTradeDailyStat(this.client,e)}getMarginAccountInfo(){return g.getMarginAccountInfo(this.client)}getMarginTargetList(e){return g.getMarginTargetList(this.client,e)}};var Dn=class{constructor(e={}){this._ns={};this.client=new Ae(e),this.quoteService=new be(this.client),this.boardService=new Me(this.client),this.klineService=new Ne(this.client),this.futuresService=new ke(this.client),this.optionsService=new Le(this.client),this.indicatorService=new Fe(this.klineService,this.quoteService),this.fundFlowService=new xe(this.client),this.northboundService=new Ue(this.client),this.marketEventService=new we(this.client),this.dragonTigerService=new ve(this.client),this.dataService=new Ke(this.client),this.tradingCalendarService=new Oe(this.quoteService),this.fundService=new Ie(this.client)}memoNs(e,n){let r=this._ns[e];return r===void 0&&(r=n(),this._ns[e]=r),r}get quotes(){return this.memoNs("quotes",()=>{let e=this.quoteService;return{cn:e.getFullQuotes.bind(e),cnSimple:e.getSimpleQuotes.bind(e),hk:e.getHKQuotes.bind(e),us:e.getUSQuotes.bind(e),fund:e.getFundQuotes.bind(e),fundFlow:e.getFundFlow.bind(e),largeOrder:e.getPanelLargeOrder.bind(e),timeline:e.getTodayTimeline.bind(e)}})}get codes(){return this.memoNs("codes",()=>{let e=this.quoteService;return{cn:e.getAShareCodeList.bind(e),us:e.getUSCodeList.bind(e),hk:e.getHKCodeList.bind(e),fund:e.getFundCodeList.bind(e)}})}get batch(){return this.memoNs("batch",()=>{let e=this.quoteService;return{cn:e.getAllAShareQuotes.bind(e),hk:e.getAllHKShareQuotes.bind(e),us:e.getAllUSShareQuotes.bind(e),byCodes:e.getAllQuotesByCodes.bind(e),raw:e.batchRaw.bind(e)}})}get kline(){return this.memoNs("kline",()=>{let e=this.klineService,n=this.indicatorService;return{cn:e.getHistoryKline.bind(e),cnMinute:e.getMinuteKline.bind(e),hk:e.getHKHistoryKline.bind(e),hkMinute:e.getHKMinuteKline.bind(e),us:e.getUSHistoryKline.bind(e),usMinute:e.getUSMinuteKline.bind(e),withIndicators:n.getKlineWithIndicators.bind(n)}})}get board(){return this.memoNs("board",()=>{let e=this.boardService;return{industry:{list:e.getIndustryList.bind(e),spot:e.getIndustrySpot.bind(e),constituents:e.getIndustryConstituents.bind(e),kline:e.getIndustryKline.bind(e),minuteKline:e.getIndustryMinuteKline.bind(e)},concept:{list:e.getConceptList.bind(e),spot:e.getConceptSpot.bind(e),constituents:e.getConceptConstituents.bind(e),kline:e.getConceptKline.bind(e),minuteKline:e.getConceptMinuteKline.bind(e)}}})}get options(){return this.memoNs("options",()=>{let e=this.optionsService;return{index:{spot:e.getIndexOptionSpot.bind(e),kline:e.getIndexOptionKline.bind(e)},etf:{months:e.getETFOptionMonths.bind(e),expireDay:e.getETFOptionExpireDay.bind(e),minute:e.getETFOptionMinute.bind(e),dailyKline:e.getETFOptionDailyKline.bind(e),fiveDayMinute:e.getETFOption5DayMinute.bind(e)},commodity:{spot:e.getCommodityOptionSpot.bind(e),kline:e.getCommodityOptionKline.bind(e)},cffex:{quotes:e.getCFFEXOptionQuotes.bind(e)},lhb:e.getOptionLHB.bind(e)}})}get futures(){return this.memoNs("futures",()=>{let e=this.futuresService;return{kline:e.getFuturesKline.bind(e),globalSpot:e.getGlobalFuturesSpot.bind(e),globalKline:e.getGlobalFuturesKline.bind(e),inventorySymbols:e.getFuturesInventorySymbols.bind(e),inventory:e.getFuturesInventory.bind(e),comexInventory:e.getComexInventory.bind(e)}})}get fundFlow(){return this.memoNs("fundFlow",()=>{let e=this.fundFlowService;return{individual:e.getIndividualFundFlow.bind(e),market:e.getMarketFundFlow.bind(e),rank:e.getFundFlowRank.bind(e),sectorRank:e.getSectorFundFlowRank.bind(e),sectorHistory:e.getSectorFundFlowHistory.bind(e)}})}get northbound(){return this.memoNs("northbound",()=>{let e=this.northboundService;return{minute:e.getNorthboundMinute.bind(e),summary:e.getNorthboundFlowSummary.bind(e),holdingRank:e.getNorthboundHoldingRank.bind(e),history:e.getNorthboundHistory.bind(e),individual:e.getNorthboundIndividual.bind(e)}})}get marketEvent(){return this.memoNs("marketEvent",()=>{let e=this.marketEventService;return{ztPool:e.getZTPool.bind(e),stockChanges:e.getStockChanges.bind(e),boardChanges:e.getBoardChanges.bind(e)}})}get dragonTiger(){return this.memoNs("dragonTiger",()=>{let e=this.dragonTigerService;return{detail:e.getDragonTigerDetail.bind(e),stockStats:e.getDragonTigerStockStats.bind(e),institution:e.getDragonTigerInstitution.bind(e),branchRank:e.getDragonTigerBranchRank.bind(e),seatDetail:e.getDragonTigerStockSeatDetail.bind(e)}})}get blockTrade(){return this.memoNs("blockTrade",()=>{let e=this.dataService;return{marketStat:e.getBlockTradeMarketStat.bind(e),detail:e.getBlockTradeDetail.bind(e),dailyStat:e.getBlockTradeDailyStat.bind(e)}})}get margin(){return this.memoNs("margin",()=>{let e=this.dataService;return{accountInfo:e.getMarginAccountInfo.bind(e),targetList:e.getMarginTargetList.bind(e)}})}get fund(){return this.memoNs("fund",()=>{let e=this.fundService;return{dividendList:e.getFundDividendList.bind(e),navHistory:e.getFundNavHistory.bind(e),estimate:e.getFundEstimate.bind(e),rankHistory:e.getFundRankHistory.bind(e),profile:e.getFundProfile.bind(e)}})}get calendar(){return this.memoNs("calendar",()=>{let e=this.tradingCalendarService;return{isTradingDay:e.isTradingDay.bind(e),nextTradingDay:e.nextTradingDay.bind(e),prevTradingDay:e.prevTradingDay.bind(e),marketStatus:e.getMarketStatus.bind(e)}})}get reference(){return this.memoNs("reference",()=>{let e=this.quoteService;return{dividendDetail:e.getDividendDetail.bind(e),tradingCalendar:e.getTradingCalendar.bind(e)}})}search(e){return this.quoteService.search(e)}},Dd=Dn;export{pt as a,mt as b,f as c,_ as d,ce as e,de as f,qe as g,x as h,pe as i,Yo as j,se as k,yt as l,E as m,ae as n,k as o,ht as p,St as q,Oe as r,Ie as s,Dn as t,Dd as u};
|