@guihz/trading-vue-editor-tes 0.1.5 → 0.1.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -10305,7 +10305,7 @@ const O1 = (i) => {
10305
10305
  const k = (A) => {
10306
10306
  const Y = r.replace(`${n?.prefix}_`, ""), Z = u?.[n?.key]?.get(Y);
10307
10307
  I(A), Z && ba(Z, A).then((X) => {
10308
- p(X), b(`${window.location.origin}/reference-manual/v${c}/#${n?.prefix}_${X?.orirginalName}`);
10308
+ p(X), b(`${window.location.origin}/reference-manual/#${n?.prefix}_${X?.orirginalName}`);
10309
10309
  });
10310
10310
  }, Q = (A) => {
10311
10311
  k(A);
@@ -10411,11 +10411,11 @@ const O1 = (i) => {
10411
10411
  }, E1 = (i) => {
10412
10412
  const { onItemClick: n, item: r, prefix: s, value: a, version: u } = i, { t: c } = br(), [f, h] = Re(), [p, v] = Re(""), [b, x] = Re(0), [I, T] = Re(c("Copy code")), [F, U] = Re(c("Copy link"));
10413
10413
  Oe(() => {
10414
- a && (h(a), v(`${window.location.origin}/reference-manual/v${u}/#${s}_${a?.orirginalName}`));
10414
+ a && (h(a), v(`${window.location.origin}/reference-manual/#${s}_${a?.orirginalName}`));
10415
10415
  }, [a]);
10416
10416
  const W = (M = 0) => {
10417
10417
  x(M), ba(r, M).then((A) => {
10418
- h(A), v(`${window.location.origin}/reference-manual/v${u}/#${s}_${A?.orirginalName}`);
10418
+ h(A), v(`${window.location.origin}/reference-manual/#${s}_${A?.orirginalName}`);
10419
10419
  });
10420
10420
  }, k = (M) => {
10421
10421
  W(M);
@@ -81,7 +81,7 @@ plot(close)
81
81
  `),re=await Fl(j)),L.detailedDesc.push({desc:z,examples:re,originalExample:j})}}return q&&(L.returns=q.map(K=>Es(K))),m&&(L.remarks=typeof m=="string"?[Es(m)]:m.map(K=>Es(K))),g&&(L.syntax=n.map(K=>K.syntax?.[0])),w&&(L.fields=w.map(K=>{const{name:H,desc:G,type:z}=K;return{label:`${H} (${z})`,desc:G&&Es(G)}})),_&&(L.seeAlso=_.map(K=>Yy(K))),L}function Yy(n){const r=/\[([^\[\]]+)\]\(([^\(\)]+)\)/g.exec(n);if(r){const[a,o,l]=r;return{name:o,link:l}}}function Es(n){const s=/\*\*([^\*]+)\*\*/g,r=/\`([^\`]+)\`/g,a=/\[([^\[\]]+)\]\(([^\(\)]+)\)/g;return n.replace(s,(o,l)=>`<strong>${l}</strong>`).replace(r,(o,l)=>`<code>${l}</code>`).replace(a,(o,l,p)=>`<a ${p.startsWith("#")?`data-name="${l}"`:'target="_blank"'} class="manual-content-text-link" href="${p}">${l}</a>`)}function Rl(n,s,r,a){const o=[];let l=0;const p=[];if(!s||!r||!a)return{labelList:o,contentList:p};for(const d of s)for(let[m,_]of r[d.key].entries()){let g=_;d.prefix==="fun"&&(g=`${_}()`),g.includes(n)&&(g.startsWith(n)?(g.includes(".")?o.splice(l,0,{label:g,index:m,group:d,key:`${d.prefix}_${_}`}):o.unshift({label:g,index:m,group:d,key:`${d.prefix}_${_}`}),l++):o.push({label:g,index:m,group:d,key:`${d.prefix}_${_}`}));const x=a[d.key].get(_)||[];for(const w of x){const{name:q,args:L,type:K,desc:H,examples:G,remarks:z,seeAlso:re,syntax:j,detailedDesc:W,fields:P,returns:C}=w,Q={label:q,index:m,group:d,key:`${d.prefix}_${q}`};if(d.prefix==="fun"&&(Q.label=`${q}()`),Q.label.includes(n))break;if(L){let te=!1;for(const se of L){const{name:ae,desc:De,displayType:X}=se;if(ae.includes(n)||De?.includes(n)||X?.includes(n)){p.push(Q),te=!0;break}}if(te)break}if(K&&K.includes(n)){p.push(Q);break}if(H){let te=!1;for(const se of H)if(se.includes(n)){p.push(Q),te=!0;break}if(te)break}if(G){let te=!1;for(const se of G)if(se.includes(n)){p.push(Q),te=!0;break}if(te)break}if(z&&(typeof z=="string"?z:z.join(`
82
82
  `)).includes(n)){p.push(Q);break}if(j){let te=!1;for(const se of j)if(se.includes(n)){p.push(Q),te=!0;break}if(te)break}if(W){let te=!1;for(const se of W){const{desc:ae,examples:De}=se;if(ae.join(`
83
83
  `).includes(n)){p.push(Q),te=!0;break}if(De?.join(`
84
- `)?.includes(n)){p.push(Q),te=!0;break}}if(te)break}if(P){let te=!1;for(const se of P){const{name:ae,desc:De,type:X}=se;if(ae.includes(n)||De?.includes(n)||X?.includes(n)){p.push(Q),te=!0;break}}if(te)break}if(C){let te=!1;for(const se of C)if(se.includes(n)){p.push(Q),te=!0;break}if(te)break}}}return{labelList:o,contentList:p}}const Zy=n=>{const{group:s,itemKey:r,onItemClick:a,currentIndex:o,keyMaps:l,version:p}=n,{t:d}=Zs(),[m,_]=I.useState(),[g,x]=I.useState(""),[w,q]=I.useState(0),[L,K]=I.useState(d("Copy code")),[H,G]=I.useState(d("Copy link"));I.useEffect(()=>{z(o)},[r,l]);const z=C=>{const Q=r.replace(`${s?.prefix}_`,""),te=l?.[s?.key]?.get(Q);q(C),te&&si(te,C).then(se=>{_(se),x(`${window.location.origin}/reference-manual/v${p}/#${s?.prefix}_${se?.orirginalName}`)})},re=C=>{z(C)},j=C=>{if(C.target.localName==="a"&&C.target.hash&&C.target?.dataset?.name){C.preventDefault();const{hash:Q}=C.target;a(Q.replace("#",""))}},W=()=>{K(d("Copied")),setTimeout(()=>{K(d("Copy code"))},1e3)},P=()=>{G(d("Link copied")),setTimeout(()=>{G(d("Copy link"))},3e3)};return T.jsx("div",{onClick:j,id:`#${r}`,children:T.jsxs("div",{className:"manual-content-wrapper",children:[T.jsxs("div",{className:"manual-content-header",children:[T.jsxs("div",{children:[T.jsx("h3",{className:"manual-content-header-title",children:m?.name}),!!m?.overloads&&T.jsx("span",{className:"manual-content-header-overloads",children:m?.overloads})]}),T.jsx(Qs,{text:g,onCopy:P,children:T.jsx("div",{"data-tooltip":H,className:"manual-content-btn",children:T.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 28 28",width:"28",height:"28",children:T.jsxs("g",{fill:"currentColor",children:[T.jsx("path",{fillRule:"nonzero",d:"M15.039 5.969l-.019-.019-2.828 2.828.707.707 2.474-2.474c1.367-1.367 3.582-1.367 4.949 0s1.367 3.582 0 4.949l-2.474 2.474.707.707 2.828-2.828-.019-.019c1.415-1.767 1.304-4.352-.334-5.99-1.638-1.638-4.224-1.749-5.99-.334zM5.97 15.038l-.019-.019 2.828-2.828.707.707-2.475 2.475c-1.367 1.367-1.367 3.582 0 4.949s3.582 1.367 4.949 0l2.474-2.474.707.707-2.828 2.828-.019-.019c-1.767 1.415-4.352 1.304-5.99-.334-1.638-1.638-1.749-4.224-.334-5.99z"}),T.jsx("path",{d:"M10.485 16.141l5.656-5.656.707.707-5.656 5.656z"})]})})})})]}),m?.desc?.map((C,Q)=>T.jsx("div",{dangerouslySetInnerHTML:{__html:C},className:"manual-content-text"},Q)),m?.type&&T.jsxs(I.Fragment,{children:[T.jsx("div",{className:"manual-content-sub-title",children:d("type")}),T.jsx("div",{className:"manual-content-text",children:m.type})]}),m?.syntax&&T.jsxs(I.Fragment,{children:[T.jsxs("div",{className:"manual-content-sub-title",children:[d("syntax")," ",!!m?.overloads&&`& ${d("overloads")}`]}),m.syntax.map((C,Q)=>(m.syntax?.length||0)>1?T.jsx("div",{onClick:()=>re(Q),children:T.jsx("pre",{className:`manual-content-syntax with-overloads ${Q===w?"selected":""}`,children:C})},Q):T.jsx("pre",{className:"manual-content-syntax",children:C},Q))]}),m?.args&&T.jsxs(I.Fragment,{children:[T.jsx("div",{className:"manual-content-sub-title",children:d("arguments")}),m.args.map((C,Q)=>T.jsxs("div",{className:"manual-content-text",children:[T.jsx("span",{className:"manual-content-args-label",children:C.label})," ",T.jsx("span",{dangerouslySetInnerHTML:{__html:C.desc||""}})]},Q))]}),m?.fields&&T.jsxs(I.Fragment,{children:[T.jsx("div",{className:"manual-content-sub-title",children:d("fields")}),m.fields.map((C,Q)=>T.jsxs("div",{className:"manual-content-text",children:[T.jsx("span",{className:"manual-content-args-label",children:C.label})," ",T.jsx("span",{dangerouslySetInnerHTML:{__html:C.desc||""}})]},Q))]}),m?.examples&&T.jsxs(I.Fragment,{children:[T.jsxs("div",{className:"manual-content-sub-title manual-content-example-header",children:[T.jsx("div",{children:T.jsx("span",{children:d("example")})}),T.jsx(Qs,{text:m.originalExample||"",onCopy:W,children:T.jsx("div",{"data-tooltip":L,className:"manual-content-btn manual-content-example-copy",children:T.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"28",height:"28",fill:"none",children:T.jsx("path",{stroke:"currentColor",d:"M8 9.5H6.5a1 1 0 0 0-1 1v11a1 1 0 0 0 1 1h11a1 1 0 0 0 1-1V20m-8-1.5h11a1 1 0 0 0 1-1v-11a1 1 0 0 0-1-1h-11a1 1 0 0 0-1 1v11a1 1 0 0 0 1 1z"})})})})]}),T.jsx("pre",{className:"manual-content-example",children:T.jsx("code",{dangerouslySetInnerHTML:{__html:m.examples}})})]}),m?.detailedDesc&&m.detailedDesc.map((C,Q)=>T.jsxs(I.Fragment,{children:[C.desc.map((te,se)=>T.jsx("div",{className:"manual-content-text",dangerouslySetInnerHTML:{__html:te}},se)),T.jsxs("div",{className:"manual-content-sub-title manual-content-example-header",children:[T.jsx("div",{children:T.jsx("span",{children:d("example")})}),T.jsx(Qs,{text:C.originalExample||"",onCopy:W,children:T.jsx("div",{"data-tooltip":L,className:"manual-content-btn manual-content-example-copy",children:T.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"28",height:"28",fill:"none",children:T.jsx("path",{stroke:"currentColor",d:"M8 9.5H6.5a1 1 0 0 0-1 1v11a1 1 0 0 0 1 1h11a1 1 0 0 0 1-1V20m-8-1.5h11a1 1 0 0 0 1-1v-11a1 1 0 0 0-1-1h-11a1 1 0 0 0-1 1v11a1 1 0 0 0 1 1z"})})})})]}),T.jsx("pre",{className:"manual-content-example",children:T.jsx("code",{dangerouslySetInnerHTML:{__html:C.examples||""}})})]},Q)),m?.returns&&T.jsxs(I.Fragment,{children:[T.jsx("div",{className:"manual-content-sub-title",children:d("returns")}),m.returns.map((C,Q)=>T.jsx("div",{className:"manual-content-text",dangerouslySetInnerHTML:{__html:C}},Q))]}),m?.remarks&&T.jsxs(I.Fragment,{children:[T.jsx("div",{className:"manual-content-sub-title",children:d("remarks")}),m.remarks.map((C,Q)=>T.jsx("div",{className:"manual-content-text",dangerouslySetInnerHTML:{__html:C}},Q))]}),m?.seeAlso&&T.jsxs(I.Fragment,{children:[T.jsx("div",{className:"manual-content-sub-title",children:d("see also")}),T.jsx("div",{className:"manual-content-see_also",children:m.seeAlso.map((C,Q)=>T.jsx("a",{className:"manual-content-see_also-tag","data-name":C?.name,href:C?.link,children:C?.name},Q))})]})]})})},Pl={title:"内置变量",key:"variables",prefix:"var",index:0},Qy=({theme:n="vs-dark",language:s,currentValue:r,version:a=Bt,onChange:o,onVersionChange:l})=>{const[p,d]=I.useState({}),{t:m,i18n:_}=Zs(),[g,x]=I.useState(Pl),[w,q]=I.useState(a||5),[L,K]=I.useState(null),[H,G]=I.useState(0),[z,re]=I.useState(""),[j,W]=I.useState(a!==5?"var_accdist":"var_bar_index"),P=I.useRef(null),C=I.useRef(null),Q=I.useRef(null),te=$=>{$.key===g?.key&&!g?.isHidden?x({...$,isHidden:!0}):x($),P.current?.focus()},se=($,J=!1)=>{ti($),fs($).then(be=>{be&&(d(be),J&&De($!==5?"var_accdist":"var_bar_index",Pl))})};I.useEffect(()=>{a&&se(a)},[a]),I.useEffect(()=>{o&&o(j)},[]),I.useEffect(()=>{Le.editor.setTheme(n)},[n]),I.useEffect(()=>{ae()},[r]);const ae=async()=>{const $=await fs(a);if($&&r.value){const[J]=r.value.split("_"),be=$.CONTENT_GROUPS?.find(ze=>J===ze.prefix);be&&(G(r.index||0),Z(be,r.value)),P.current?.focus()}};I.useEffect(()=>{s&&_.changeLanguage(s)},[s]),I.useEffect(()=>{P.current?.focus()},[P.current]);const De=($,J)=>{$!==j&&(J&&x(J),G(0),W($),o&&o($),Q.current?.scrollTo({top:0}),P.current?.focus())},X=$=>{if($.target.value.trim()==="")ie();else{re($.target.value);const J=Rl($.target.value,p.CONTENT_GROUPS,p.MANUAL_KEYS,p.KEY_MAP_LIST);K(J)}},ie=()=>{re(""),K(null),setTimeout(()=>{C.current?.querySelector(`a[data-href="${j}"]`)?.scrollIntoView(!0)},10),P.current?.focus()},Z=($,J)=>{x($),W(J),o&&o(J),setTimeout(()=>{C.current?.querySelector(`a[data-href="${J}"]`)?.scrollIntoView(!0)},10),Q.current?.scrollTo({top:0})},le=$=>{const J=p.CONTENT_GROUPS?.find(be=>$.startsWith(be.prefix));J&&(G(0),Z(J,$),P.current?.focus())};return T.jsxs("div",{className:`${n} manual-warpper`,children:[T.jsxs("div",{className:"manual-left",children:[T.jsxs("div",{className:"manual-search",children:[T.jsx("span",{className:"manual-search-icon",children:T.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 18 18",width:"18px",height:"18px",children:T.jsx("path",{fillRule:"evenodd",d:"M12.5 11h-.79l-.28-.27A6.47 6.47 0 0 0 13 6.5 6.5 6.5 0 1 0 6.5 13c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L17.49 16l-4.99-5zm-6 0C4.01 11 2 8.99 2 6.5S4.01 2 6.5 2 11 4.01 11 6.5 8.99 11 6.5 11z"})})}),T.jsx("input",{onChange:X,ref:P,spellCheck:"false",value:z,className:"manual-search-input",autoComplete:"off",placeholder:m("search"),type:"text"}),T.jsx("span",{onClick:ie,className:`manual-search-clear ${z?"":"hide"}`,children:T.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 95.939 95.939",width:"9",height:"9",children:T.jsx("path",{d:"M62.82 47.97l32.53-32.534a2 2 0 0 0 0-2.828L83.332.586a2 2 0 0 0-2.827 0L47.97 33.12 15.435.587c-.75-.75-2.078-.75-2.828 0L.587 12.607a2 2 0 0 0 0 2.83L33.12 47.97.588 80.504a2 2 0 0 0 0 2.828l12.02 12.02a1.997 1.997 0 0 0 2.83 0L47.97 62.818l32.535 32.535a2 2 0 0 0 2.827 0l12.02-12.02c.78-.783.78-2.05 0-2.83L62.82 47.97z"})})})]}),T.jsx("div",{className:`manual-group-search-list manual-scroll ${z?"":"hide"}`,children:T.jsxs("div",{children:[L?.labelList.map($=>T.jsx("a",{onClick:J=>{J.preventDefault(),De($.key,$.group)},className:`manual-group-body-item ${$.key===j?"manual-group-body-item-selected":""}`,"data-href":$.key,href:`#${$.key}`,children:$.label},`search_${$.key}`)),T.jsx("div",{className:"manual-content-separator"}),L?.contentList.map($=>T.jsx("a",{onClick:J=>{J.preventDefault(),De($.key,$.group)},className:`manual-group-body-item ${$.key===j?"manual-group-body-item-selected":""}`,"data-href":$.key,href:`#${$.key}`,children:$.label},`search_${$.key}`))]})}),T.jsx("div",{className:`manual-group-list manual-scroll ${z?"hide":""}`,ref:C,children:p.CONTENT_GROUPS?.map($=>T.jsxs(I.Fragment,{children:[T.jsx("div",{onClick:()=>te($),className:`manual-group-title ${$.key===g?.key&&!g?.isHidden?"active":""}`,children:m($.key)}),T.jsx("div",{className:`manual-group-body manual-scroll ${$.key!==g?.key||g?.isHidden?"hide":""}`,children:p.KEY_LIST?.[$.key]?.sort().filter(J=>!p.NOT_SHOW_KEYWORDS?.includes(J))?.map(J=>{const be=`${$.prefix}_${J}`;return T.jsx("a",{onClick:ze=>{ze.preventDefault(),De(be)},className:`manual-group-body-item ${be===j?"manual-group-body-item-selected":""}`,"data-href":be,href:`#${be}`,children:`${J}${$.prefix==="fun"?"()":""}`},be)})})]},$.key))})]}),T.jsx("div",{ref:Q,className:"manual-right manual-scroll",children:T.jsx(Zy,{currentIndex:H,version:w,keyMaps:p.KEY_MAP_LIST,group:g,itemKey:j,onItemClick:le})})]})},Jy=n=>{const{onItemClick:s,item:r,prefix:a,value:o,version:l}=n,{t:p}=Zs(),[d,m]=I.useState(),[_,g]=I.useState(""),[x,w]=I.useState(0),[q,L]=I.useState(p("Copy code")),[K,H]=I.useState(p("Copy link"));I.useEffect(()=>{o&&(m(o),g(`${window.location.origin}/reference-manual/v${l}/#${a}_${o?.orirginalName}`))},[o]);const G=(P=0)=>{w(P),si(r,P).then(C=>{m(C),g(`${window.location.origin}/reference-manual/v${l}/#${a}_${C?.orirginalName}`)})},z=P=>{G(P)},re=P=>{if(P.target.localName==="a"&&P.target.hash&&P.target?.dataset?.name){P.preventDefault();const{hash:C}=P.target;s(C.replace("#",""))}},j=()=>{L(p("Copied")),setTimeout(()=>{L(p("Copy code"))},1e3)},W=()=>{H(p("Link copied")),setTimeout(()=>{H(p("Copy link"))},3e3)};return T.jsx("div",{onClick:re,id:`${a}_${d?.orirginalName}`,children:T.jsxs("div",{className:"manual-page-content-wrapper",children:[T.jsxs("div",{className:"manual-page-content-header",children:[T.jsxs("div",{children:[T.jsx("h3",{className:"manual-page-content-header-title",children:d?.name}),!!d?.overloads&&T.jsx("span",{className:"manual-page-content-header-overloads",children:d?.overloads})]}),T.jsx(Qs,{text:_,onCopy:W,children:T.jsx("div",{"data-tooltip":K,className:"manual-page-content-btn",children:T.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 28 28",width:"28",height:"28",children:T.jsxs("g",{fill:"currentColor",children:[T.jsx("path",{fillRule:"nonzero",d:"M15.039 5.969l-.019-.019-2.828 2.828.707.707 2.474-2.474c1.367-1.367 3.582-1.367 4.949 0s1.367 3.582 0 4.949l-2.474 2.474.707.707 2.828-2.828-.019-.019c1.415-1.767 1.304-4.352-.334-5.99-1.638-1.638-4.224-1.749-5.99-.334zM5.97 15.038l-.019-.019 2.828-2.828.707.707-2.475 2.475c-1.367 1.367-1.367 3.582 0 4.949s3.582 1.367 4.949 0l2.474-2.474.707.707-2.828 2.828-.019-.019c-1.767 1.415-4.352 1.304-5.99-.334-1.638-1.638-1.749-4.224-.334-5.99z"}),T.jsx("path",{d:"M10.485 16.141l5.656-5.656.707.707-5.656 5.656z"})]})})})})]}),d?.desc?.map((P,C)=>T.jsx("div",{dangerouslySetInnerHTML:{__html:P},className:"manual-page-content-text"},C)),d?.type&&T.jsxs(I.Fragment,{children:[T.jsx("div",{className:"manual-page-content-sub-title",children:p("type")}),T.jsx("div",{className:"manual-page-content-text",children:d.type})]}),d?.syntax&&T.jsxs(I.Fragment,{children:[T.jsxs("div",{className:"manual-page-content-sub-title",children:[p("syntax")," ",!!d?.overloads&&`& ${p("overloads")}`]}),d.syntax.map((P,C)=>(d.syntax?.length||0)>1?T.jsx("div",{onClick:()=>z(C),children:T.jsx("pre",{className:`manual-page-content-syntax with-overloads ${C===x?"selected":""}`,children:P})},C):T.jsx("pre",{className:"manual-page-content-syntax",children:P},C))]}),d?.args&&T.jsxs(I.Fragment,{children:[T.jsx("div",{className:"manual-page-content-sub-title",children:p("arguments")}),d.args.map((P,C)=>T.jsxs("div",{className:"manual-page-content-text",children:[T.jsx("span",{className:"manual-page-content-args-label",children:P.label})," ",T.jsx("span",{dangerouslySetInnerHTML:{__html:P.desc||""}})]},C))]}),d?.fields&&T.jsxs(I.Fragment,{children:[T.jsx("div",{className:"manual-page-content-sub-title",children:p("fields")}),d.fields.map((P,C)=>T.jsxs("div",{className:"manual-page-content-text",children:[T.jsx("span",{className:"manual-page-content-args-label",children:P.label})," ",T.jsx("span",{dangerouslySetInnerHTML:{__html:P.desc||""}})]},C))]}),d?.examples&&T.jsxs(I.Fragment,{children:[T.jsxs("div",{className:"manual-page-content-sub-title manual-page-content-example-header",children:[T.jsx("div",{children:T.jsx("span",{children:p("example")})}),T.jsx(Qs,{text:d.originalExample||"",onCopy:j,children:T.jsx("div",{"data-tooltip":q,className:"manual-page-content-btn manual-page-content-example-copy",children:T.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"28",height:"28",fill:"none",children:T.jsx("path",{stroke:"currentColor",d:"M8 9.5H6.5a1 1 0 0 0-1 1v11a1 1 0 0 0 1 1h11a1 1 0 0 0 1-1V20m-8-1.5h11a1 1 0 0 0 1-1v-11a1 1 0 0 0-1-1h-11a1 1 0 0 0-1 1v11a1 1 0 0 0 1 1z"})})})})]}),T.jsx("pre",{className:"manual-page-content-example",children:T.jsx("code",{dangerouslySetInnerHTML:{__html:d.examples}})})]}),d?.detailedDesc&&d.detailedDesc.map((P,C)=>T.jsxs(I.Fragment,{children:[P.desc.map((Q,te)=>T.jsx("div",{className:"manual-page-content-text",dangerouslySetInnerHTML:{__html:Q}},te)),T.jsxs("div",{className:"manual-page-content-sub-title manual-page-content-example-header",children:[T.jsx("div",{children:T.jsx("span",{children:p("example")})}),T.jsx(Qs,{text:P.originalExample||"",onCopy:j,children:T.jsx("div",{"data-tooltip":q,className:"manual-page-content-btn manual-page-content-example-copy",children:T.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"28",height:"28",fill:"none",children:T.jsx("path",{stroke:"currentColor",d:"M8 9.5H6.5a1 1 0 0 0-1 1v11a1 1 0 0 0 1 1h11a1 1 0 0 0 1-1V20m-8-1.5h11a1 1 0 0 0 1-1v-11a1 1 0 0 0-1-1h-11a1 1 0 0 0-1 1v11a1 1 0 0 0 1 1z"})})})})]}),T.jsx("pre",{className:"manual-page-content-example",children:T.jsx("code",{dangerouslySetInnerHTML:{__html:P.examples||""}})})]},C)),d?.returns&&T.jsxs(I.Fragment,{children:[T.jsx("div",{className:"manual-page-content-sub-title",children:p("returns")}),d.returns.map((P,C)=>T.jsx("div",{className:"manual-page-content-text",dangerouslySetInnerHTML:{__html:P}},C))]}),d?.remarks&&T.jsxs(I.Fragment,{children:[T.jsx("div",{className:"manual-page-content-sub-title",children:p("remarks")}),d.remarks.map((P,C)=>T.jsx("div",{className:"manual-page-content-text",dangerouslySetInnerHTML:{__html:P}},C))]}),d?.seeAlso&&T.jsxs(I.Fragment,{children:[T.jsx("div",{className:"manual-page-content-sub-title",children:p("see also")}),T.jsx("div",{className:"manual-page-content-see_also",children:d.seeAlso.map((P,C)=>T.jsx("a",{className:"manual-page-content-see_also-tag","data-name":P?.name,href:P?.link,children:P?.name},C))})]})]})})},e_=({onItemClick:n,onGroupClick:s,selectedItemChange:r,selectItem:a,manualTabRef:o,searchRef:l,contentGroups:p,manualKeys:d,keyMaps:m,version:_,onVersionChange:g})=>{const{t:x}=Zs(),[w,q]=I.useState(null),[L,K]=I.useState("");I.useEffect(()=>{l.current?.focus()},[l.current]);const H=z=>{if(z.target.value.trim()==="")G();else{K(z.target.value);const re=Rl(z.target.value,p,d,m);q(re)}},G=()=>{K(""),q(null),setTimeout(()=>{a.current&&r(a.current,!0)},10),l.current?.focus()};return T.jsxs("div",{className:"manual-page-left",children:[T.jsxs("div",{className:"manual-page-search",children:[T.jsx("span",{className:"manual-page-search-icon",children:T.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 18 18",width:"18px",height:"18px",children:T.jsx("path",{fillRule:"evenodd",d:"M12.5 11h-.79l-.28-.27A6.47 6.47 0 0 0 13 6.5 6.5 6.5 0 1 0 6.5 13c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L17.49 16l-4.99-5zm-6 0C4.01 11 2 8.99 2 6.5S4.01 2 6.5 2 11 4.01 11 6.5 8.99 11 6.5 11z"})})}),T.jsx("input",{onChange:H,ref:l,spellCheck:"false",value:L,className:"manual-page-search-input",autoComplete:"off",placeholder:x("search"),type:"text"}),T.jsx("span",{onClick:G,className:`manual-page-search-clear ${L?"":"hide"}`,children:T.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 95.939 95.939",width:"9",height:"9",children:T.jsx("path",{d:"M62.82 47.97l32.53-32.534a2 2 0 0 0 0-2.828L83.332.586a2 2 0 0 0-2.827 0L47.97 33.12 15.435.587c-.75-.75-2.078-.75-2.828 0L.587 12.607a2 2 0 0 0 0 2.83L33.12 47.97.588 80.504a2 2 0 0 0 0 2.828l12.02 12.02a1.997 1.997 0 0 0 2.83 0L47.97 62.818l32.535 32.535a2 2 0 0 0 2.827 0l12.02-12.02c.78-.783.78-2.05 0-2.83L62.82 47.97z"})})})]}),T.jsxs("div",{ref:o,className:"manual-page-group-container",children:[T.jsx("div",{className:`manual-page-group-search-list manual-page-scroll ${L?"":"hide"}`,children:T.jsxs("div",{children:[w?.labelList.map(z=>T.jsx("a",{onClick:re=>{re.preventDefault(),n(z.key,z.index,z.group)},className:"manual-page-group-body-item","data-href":z.key,href:`#${z.key}`,children:z.label},`search_${z.key}`)),T.jsx("div",{className:"manual-page-content-separator"}),w?.contentList.map(z=>T.jsx("a",{onClick:re=>{re.preventDefault(),n(z.key,z.index,z.group)},className:"manual-page-group-body-item","data-href":z.key,href:`#${z.key}`,children:z.label},`search_${z.key}`))]})}),T.jsx("div",{className:`manual-page-group-list manual-page-scroll ${L?"hide":""}`,children:p?.map(z=>T.jsxs(I.Fragment,{children:[T.jsx("div",{onClick:()=>s(z),className:"manual-page-group-title manual-page-group-t",children:x(z.key)}),T.jsx("div",{className:"manual-page-group-body manual-page-group-b manual-page-scroll hide",children:d?.[z.key]?.map((re,j)=>{const W=`${z.prefix}_${re}`;return T.jsx("a",{onClick:P=>{P.preventDefault(),n(W,j)},className:"manual-page-group-body-item","data-href":W,href:`#${W}`,children:`${re}${z.prefix==="fun"?"()":""}`},W)})})]},z.key))})]})]})},ri={title:"内置变量",key:"variables",prefix:"var",index:0},t_=({theme:n="vs-dark",language:s,version:r=Bt,onVersionChange:a})=>{const[o,l]=I.useState({}),{t:p,i18n:d}=Zs(),[m,_]=I.useState(),g=I.useRef(""),x=I.useRef(null),w=I.useRef(null),q=I.useRef(null),L=I.useRef(null),K=I.useRef(null),H=I.useRef(null),G=I.useRef(0),z=I.useRef({startTop:0,endTop:0,key:r!==5?"var_accdist":"var_bar_index",group:ri,index:0}),re=X=>{ae(X),x.current?.focus()};I.useEffect(()=>{r&&(ti(r),fs(r).then(X=>{X&&l(X)}))},[r]),I.useEffect(()=>{K.current||(j(),G.current=q.current?.offsetTop||0)},[o]);const j=async()=>{if(!o.CONTENT_GROUPS)return;const X={};for(const ie of o.CONTENT_GROUPS){const Z=ie.key,le=new Map;for(const $ of o.MANUAL_KEYS?.[Z]){const J=await si(o.KEY_MAP_LIST?.[Z].get($)||[],0);J&&le.set($,J)}X[Z]=le}_(X)};I.useEffect(()=>{if(!K.current&&m){const X=window.location.hash;if(X){const ie=X.replace(/^#/,""),[Z]=ie.split("_"),le=o.CONTENT_GROUPS?.find($=>$.prefix===Z);if(le){ae(le),Q(ie,!0),setTimeout(()=>{const $=document.getElementById(ie);$?.scrollIntoView(),$?.classList.add("reference-item-selected")},10);return}}ae(ri),setTimeout(()=>{De(ri,r!==5?"accdist":"bar_index",0,92)},10)}},[m]),I.useEffect(()=>{Le.editor.setTheme(n)},[n]),I.useEffect(()=>{s&&d.changeLanguage(s)},[s]),I.useEffect(()=>{x.current?.focus()},[x.current]);const W=(X,ie,Z)=>{if(X===g.current)return;Z&&Z.key!==K.current?.key&&ae(Z),Q(X),window.location.href=`#${X}`;const[le,$]=P(X,ie);z.current={startTop:le,endTop:$,group:Z||K.current,index:ie,key:X},L.current?.classList?.remove("manual-page-current-item-bg"),x.current?.focus()},P=(X,ie=0)=>{const Z=document.getElementById(X),le=Z?.offsetHeight||0,$=ie?0:78,J=(Z?.offsetTop||0)-72-G.current;return[J-$,J+le]},C=(X,ie)=>{X.key!==K.current?.key&&ae(X),Q(ie,!0)},Q=(X,ie=!1)=>{const Z=w.current?.querySelector(`a[data-href="${X}"]`);if(ie&&Z?.scrollIntoView({block:"nearest"}),document.getElementById(g.current)?.classList.remove("reference-item-selected"),document.getElementById(X)?.classList.add("reference-item-selected"),X===g.current){!Z?.classList.contains("manual-page-group-body-item-selected")&&Z?.classList.add("manual-page-group-body-item-selected"),H.current=Z;return}g.current=X,H.current?.classList.remove("manual-page-group-body-item-selected"),Z?.classList.add("manual-page-group-body-item-selected"),H.current=Z},te=X=>{const ie=o.CONTENT_GROUPS?.find(Z=>X.startsWith(Z.prefix));ie&&(C(ie,X),window.location.href=`#${X}`,x.current?.focus())},se=I.useCallback(X=>{const{startTop:ie,endTop:Z,index:le,group:$,key:J}=z.current;let be=Z,ze=ie;be||([ze,be]=P(J,le),z.current={startTop:ze,endTop:be,group:$,index:le,key:J}),$.key!==K.current?.key&&ae($);const _e=X.currentTarget.scrollTop;if(_e>=ze&&_e<be)return;let Be=!1,Ge=le,ot=$.index,Je=o.MANUAL_KEYS?.[$.key],Ye=$;if(_e>=be)for(;!Be;){Ge++;const xt=Je[Ge];if(xt)Be=De(Ye,xt,Ge,_e);else{if(ot++,Ye=o.CONTENT_GROUPS?.[ot],Je=o.MANUAL_KEYS?.[Ye?.key],!Je){Be=!0;return}ae(Ye),Ge=-1}}else for(;!Be;)if(Ge--,Ge>=0){const xt=Je[Ge];Be=De(Ye,xt,Ge,_e)}else{if(ot--,ot<0){Be=!0;return}Ye=o.CONTENT_GROUPS?.[ot],ae(Ye),Je=o.MANUAL_KEYS?.[Ye?.key],Ge=Je.length}},[o]),ae=X=>{const ie=K.current?.index,Z=w.current?.querySelectorAll(".manual-page-group-t"),le=w.current?.querySelectorAll(".manual-page-group-b"),$=X.index;if(le?.[ie]?.classList?.add("hide"),Z?.[ie]?.classList?.remove("active"),ie===$){K.current=null;return}else Z?.[$]?.classList?.add("active"),le?.[$]?.classList?.remove("hide"),K.current=X},De=(X,ie,Z,le)=>{const $=`${X.prefix}_${ie}`,[J,be]=P($,Z);if(J<=le&&le<be){z.current={startTop:J,endTop:be,group:X,index:Z,key:$};const ze=w.current?.querySelector(`a[data-href="${$}"]`);return L.current?.classList?.remove("manual-page-current-item-bg"),L.current=ze,ze?.scrollIntoView({block:"nearest"}),ze?.classList.add("manual-page-current-item-bg"),!0}return!1};return T.jsxs("div",{ref:q,className:`${n} manual-page-warpper ${m?"show-warpper":""}`,children:[T.jsx(e_,{onGroupClick:re,onItemClick:W,selectItem:g,manualTabRef:w,searchRef:x,selectedItemChange:Q,manualKeys:o.MANUAL_KEYS,contentGroups:o.CONTENT_GROUPS,keyMaps:o.KEY_MAP_LIST,version:r||5,onVersionChange:a}),T.jsxs("div",{className:"manual-page-right",children:[T.jsx("div",{children:T.jsx("h1",{className:"manual-page-title",children:p("Mine Script® v1 Reference Manual",{version:r})})}),T.jsx("div",{onScroll:se,className:"manual-page-scroll manual-page-scroll-none",children:o.CONTENT_GROUPS?.map(X=>T.jsxs(I.Fragment,{children:[T.jsx("h2",{className:"manual-page-header",children:p(X.key)}),T.jsx("div",{children:o.MANUAL_KEYS?.[X.key]?.map(ie=>T.jsx(Jy,{version:r||5,item:o.KEY_MAP_LIST?.[X.key].get(ie)||[],value:m?.[X.key]?.get(ie),prefix:X.prefix,onItemClick:te},ie))})]},X.key))})]})]})};O.VType=void 0,function(n){n.BOOL="bool",n.INT="int",n.FLOAT="float",n.ARRAY="array",n.BOX="box",n.CHART_POINT="chart.point",n.COLOR="color",n.CONST="const",n.LABEL="label",n.LINE="line",n.LINEFILL="linefill",n.MAP="map",n.MATRIX="matrix",n.POLYLINE="polyline",n.SERIES="series",n.SIMPLE="simple",n.STRING="string",n.TABLE="table",n.UNDETERMINED="undetermined type",n.INPUT="input",n.NA="na",n.VOID="void",n.ENUM="enum"}(O.VType||(O.VType={}));var Bl;(function(n){n.TYPE="type",n.ARRAY="array",n.BOX="box",n.CHART_POINT="chart.point",n.LABEL="label",n.LINE="line",n.LINEFILL="linefill",n.MAP="map",n.MATRIX="matrix",n.POLYLINE="polyline",n.TABLE="table"})(Bl||(Bl={})),O.VRuleType=void 0,function(n){n.FlowStmt="FlowStmt",n.DeclareAssign="DeclareAssign",n.VarBlockStmt="VarBlockStmt",n.VarSingle="VarSingle",n.VarMultiple="VarMultiple",n.ParenthesizedExpression="ParenthesizedExpression",n.AdditiveExpression="AdditiveExpression",n.RelationalExpression="RelationalExpression",n.EqualityExpression="EqualityExpression",n.TernaryExpression="TernaryExpression",n.UnaryExpression="UnaryExpression",n.NotExpression="NotExpression",n.MemberIndexExpression="MemberIndexExpression",n.MethodExpression="MethodExpression",n.LogicalAndExpression="LogicalAndExpression",n.LogicalOrExpression="LogicalOrExpression",n.MultiplicativeExpression="MultiplicativeExpression",n.Brackethesized="Brackethesized",n.IfStatement="IfStatement",n.ForToStatement="ForToStatement",n.ForInStatement="ForInStatement",n.SwitchStatement="SwitchStatement",n.CaseClause="CaseClause",n.DefaultCaluse="DefaultCaluse",n.WhileStatement="WhileStatement",n.ImportElement="ImportElement",n.Literal="Literal",n.ArrowFunction="ArrowFunction",n.ArrowMethod="ArrowMethod",n.TypeStatement="TypeStatement",n.Name="Name",n.AgainAssign="AgainAssign",n.EnumStatement="EnumStatement"}(O.VRuleType||(O.VRuleType={})),O.VAdjustment=void 0,function(n){n.dividends="dividends",n.none="none",n.splits="splits"}(O.VAdjustment||(O.VAdjustment={})),O.VAlert=void 0,function(n){n.freqAll="freq_all",n.freqOncePerBar="freq_once_per_bar",n.freqOncePerBarClose="freq_once_per_bar_close"}(O.VAlert||(O.VAlert={})),O.VBarmergeGaps=void 0,function(n){n.gapsOff="gaps_off",n.gapsOn="gaps_on",n.lookaheadOff="lookahead_off",n.lookaheadOn="lookahead_on"}(O.VBarmergeGaps||(O.VBarmergeGaps={})),O.VPlotDisplay=void 0,function(n){n.all="all",n.dataWindow="data_window",n.none="none",n.pane="pane",n.priceScale="price_scale",n.statusLine="status_line"}(O.VPlotDisplay||(O.VPlotDisplay={})),O.VExtend=void 0,function(n){n.both="both",n.left="left",n.none="none",n.right="right"}(O.VExtend||(O.VExtend={})),O.VFormatType=void 0,function(n){n.inherit="inherit",n.mintick="mintick",n.percent="percent",n.price="price",n.volume="volume"}(O.VFormatType||(O.VFormatType={})),O.VHlineStyle=void 0,function(n){n.styleDashed="style_dashed",n.styleDotted="style_dotted",n.styleSolid="style_solid"}(O.VHlineStyle||(O.VHlineStyle={})),O.VLabelStyle=void 0,function(n){n.styleArrowdown="style_arrowdown",n.styleArrowup="style_arrowup",n.styleCircle="style_circle",n.styleCross="style_cross",n.styleDiamond="style_diamond",n.styleFlag="style_flag",n.styleLabelCenter="style_label_center",n.styleLabelDown="style_label_down",n.styleLabelLeft="style_label_left",n.styleLabelLowerLeft="style_label_lower_left",n.styleLabelLowerRight="style_label_lower_right",n.styleLabelRight="style_label_right",n.styleLabelUp="style_label_up",n.styleLabelUpperLeft="style_label_upper_left",n.styleLabelUpperRight="style_label_upper_right",n.styleNone="style_none",n.styleSquare="style_square",n.styleTextOutline="style_text_outline",n.styleTriangledown="style_triangledown",n.styleTriangleup="style_triangleup",n.styleXcross="style_xcross"}(O.VLabelStyle||(O.VLabelStyle={})),O.VLineStyle=void 0,function(n){n.styleArrowBoth="style_arrow_both",n.styleArrowLeft="style_arrow_left",n.styleArrowRight="style_arrow_right",n.styleDashed="style_dashed",n.styleDotted="style_dotted",n.styleSolid="style_solid"}(O.VLineStyle||(O.VLineStyle={})),O.VLocation=void 0,function(n){n.abovebar="abovebar",n.absolute="absolute",n.belowbar="belowbar",n.bottom="bottom",n.top="top"}(O.VLocation||(O.VLocation={})),O.VSortOrder=void 0,function(n){n.ascending="ascending",n.descending="descending"}(O.VSortOrder||(O.VSortOrder={})),O.VPlotStyle=void 0,function(n){n.styleArea="Area",n.styleAreabr="Area With Breaks",n.styleCircles="Circles",n.styleColumns="Columns",n.styleCross="Cross",n.styleHistogram="Histogram",n.styleLine="Line",n.styleLinebr="Line With Breaks",n.styleStepline="Step Line",n.styleSteplineDiamond="Step Line With Diamonds",n.styleSteplinebr="Step line with Breaks"}(O.VPlotStyle||(O.VPlotStyle={})),O.VPosition=void 0,function(n){n.bottomCenter="bottom_center",n.bottomLeft="bottom_left",n.bottomRight="bottom_right",n.middleCenter="middle_center",n.middleLeft="middle_left",n.middleRight="middle_right",n.topCenter="top_center",n.topLeft="top_left",n.topRight="top_right"}(O.VPosition||(O.VPosition={})),O.VScale=void 0,function(n){n.left="left",n.none="none",n.right="right"}(O.VScale||(O.VScale={})),O.VSession=void 0,function(n){n.extended="extended",n.regular="regular"}(O.VSession||(O.VSession={})),O.VShape=void 0,function(n){n.arrowdown="arrowdown",n.arrowup="arrowup",n.circle="circle",n.cross="cross",n.diamond="diamond",n.flag="flag",n.labeldown="labeldown",n.labelup="labelup",n.square="square",n.triangledown="triangledown",n.triangleup="triangleup",n.xcross="xcross"}(O.VShape||(O.VShape={})),O.VSize=void 0,function(n){n.auto="auto",n.huge="huge",n.large="large",n.normal="normal",n.small="small",n.tiny="tiny"}(O.VSize||(O.VSize={})),O.VFont=void 0,function(n){n.familyDefault="default",n.familyMonospace="monospace"}(O.VFont||(O.VFont={})),O.VStrategy=void 0,function(n){n.cash="cash",n.fixed="fixed",n.percentOfEquity="percent_of_equity"}(O.VStrategy||(O.VStrategy={})),O.VCommission=void 0,function(n){n.cashPerContract="cash_per_contract",n.cashPerOrder="cash_per_order",n.percent="percent"}(O.VCommission||(O.VCommission={})),O.VDirection=void 0,function(n){n.all="all",n.long="long",n.short="short"}(O.VDirection||(O.VDirection={})),O.VOca=void 0,function(n){n.cancel="cancel",n.none="none",n.reduce="reduce"}(O.VOca||(O.VOca={})),O.VText=void 0,function(n){n.alignBottom="align_bottom",n.alignCenter="align_center",n.alignLeft="align_left",n.alignRight="align_right",n.alignTop="align_top",n.wrapAuto="wrap_auto",n.wrapNone="wrap_none"}(O.VText||(O.VText={})),O.VXloc=void 0,function(n){n.bar_index="bar_index",n.bar_time="bar_time"}(O.VXloc||(O.VXloc={})),O.VYloc=void 0,function(n){n.abovebar="abovebar",n.belowbar="belowbar",n.price="price"}(O.VYloc||(O.VYloc={})),O.VEarnings=void 0,function(n){n.actual="actual",n.estimate="estimate",n.standardized="standardized"}(O.VEarnings||(O.VEarnings={})),O.VPivotType=void 0,function(n){n.traditional="Traditional",n.fibonacci="Fibonacci",n.woodie="Woodie",n.classic="Classic",n.dm="DM",n.camarilla="Camarilla"}(O.VPivotType||(O.VPivotType={})),O.VInputType=void 0,function(n){n.INT="int",n.BOOL="bool",n.TIME="time",n.COLOR="color",n.FLOAT="float",n.PRICE="price",n.SOURCE="source",n.STRING="string",n.SYMBOL="symbol",n.SESSION="session",n.TEXT_AREA="text_area",n.TIMEFRAME="timeframe",n.ENUM="enum"}(O.VInputType||(O.VInputType={}));var Kl;(function(n){n.description="description",n.field="field",n.function="function",n.param="param",n.returns="returns",n.type="type",n.variable="variable",n.enum="enum"})(Kl||(Kl={})),O.VScriptType=void 0,function(n){n.library="library",n.indicator="indicator",n.strategy="strategy"}(O.VScriptType||(O.VScriptType={}));const Ul={keywords:[{name:"or",desc:["逻辑 OR。适用于布尔表达式。"],syntax:["expr1 or expr2"]},{name:"and",desc:["逻辑 AND。适用于布尔表达式。"],syntax:["expr1 and expr2"]},{name:"not",desc:["逻辑求反(NOT)。 适用于布尔表达式。"],syntax:["not expr1"]},{name:"if",desc:["If语句定义了在满足表达式条件时必须执行的语句块。","要访问和使用if语句,应在第一行代码中指定Mine脚本语言的版本 >= 2,例如://@version=3","通用编码来自:"],syntax:[`var_declarationX = if condition
84
+ `)?.includes(n)){p.push(Q),te=!0;break}}if(te)break}if(P){let te=!1;for(const se of P){const{name:ae,desc:De,type:X}=se;if(ae.includes(n)||De?.includes(n)||X?.includes(n)){p.push(Q),te=!0;break}}if(te)break}if(C){let te=!1;for(const se of C)if(se.includes(n)){p.push(Q),te=!0;break}if(te)break}}}return{labelList:o,contentList:p}}const Zy=n=>{const{group:s,itemKey:r,onItemClick:a,currentIndex:o,keyMaps:l,version:p}=n,{t:d}=Zs(),[m,_]=I.useState(),[g,x]=I.useState(""),[w,q]=I.useState(0),[L,K]=I.useState(d("Copy code")),[H,G]=I.useState(d("Copy link"));I.useEffect(()=>{z(o)},[r,l]);const z=C=>{const Q=r.replace(`${s?.prefix}_`,""),te=l?.[s?.key]?.get(Q);q(C),te&&si(te,C).then(se=>{_(se),x(`${window.location.origin}/reference-manual/#${s?.prefix}_${se?.orirginalName}`)})},re=C=>{z(C)},j=C=>{if(C.target.localName==="a"&&C.target.hash&&C.target?.dataset?.name){C.preventDefault();const{hash:Q}=C.target;a(Q.replace("#",""))}},W=()=>{K(d("Copied")),setTimeout(()=>{K(d("Copy code"))},1e3)},P=()=>{G(d("Link copied")),setTimeout(()=>{G(d("Copy link"))},3e3)};return T.jsx("div",{onClick:j,id:`#${r}`,children:T.jsxs("div",{className:"manual-content-wrapper",children:[T.jsxs("div",{className:"manual-content-header",children:[T.jsxs("div",{children:[T.jsx("h3",{className:"manual-content-header-title",children:m?.name}),!!m?.overloads&&T.jsx("span",{className:"manual-content-header-overloads",children:m?.overloads})]}),T.jsx(Qs,{text:g,onCopy:P,children:T.jsx("div",{"data-tooltip":H,className:"manual-content-btn",children:T.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 28 28",width:"28",height:"28",children:T.jsxs("g",{fill:"currentColor",children:[T.jsx("path",{fillRule:"nonzero",d:"M15.039 5.969l-.019-.019-2.828 2.828.707.707 2.474-2.474c1.367-1.367 3.582-1.367 4.949 0s1.367 3.582 0 4.949l-2.474 2.474.707.707 2.828-2.828-.019-.019c1.415-1.767 1.304-4.352-.334-5.99-1.638-1.638-4.224-1.749-5.99-.334zM5.97 15.038l-.019-.019 2.828-2.828.707.707-2.475 2.475c-1.367 1.367-1.367 3.582 0 4.949s3.582 1.367 4.949 0l2.474-2.474.707.707-2.828 2.828-.019-.019c-1.767 1.415-4.352 1.304-5.99-.334-1.638-1.638-1.749-4.224-.334-5.99z"}),T.jsx("path",{d:"M10.485 16.141l5.656-5.656.707.707-5.656 5.656z"})]})})})})]}),m?.desc?.map((C,Q)=>T.jsx("div",{dangerouslySetInnerHTML:{__html:C},className:"manual-content-text"},Q)),m?.type&&T.jsxs(I.Fragment,{children:[T.jsx("div",{className:"manual-content-sub-title",children:d("type")}),T.jsx("div",{className:"manual-content-text",children:m.type})]}),m?.syntax&&T.jsxs(I.Fragment,{children:[T.jsxs("div",{className:"manual-content-sub-title",children:[d("syntax")," ",!!m?.overloads&&`& ${d("overloads")}`]}),m.syntax.map((C,Q)=>(m.syntax?.length||0)>1?T.jsx("div",{onClick:()=>re(Q),children:T.jsx("pre",{className:`manual-content-syntax with-overloads ${Q===w?"selected":""}`,children:C})},Q):T.jsx("pre",{className:"manual-content-syntax",children:C},Q))]}),m?.args&&T.jsxs(I.Fragment,{children:[T.jsx("div",{className:"manual-content-sub-title",children:d("arguments")}),m.args.map((C,Q)=>T.jsxs("div",{className:"manual-content-text",children:[T.jsx("span",{className:"manual-content-args-label",children:C.label})," ",T.jsx("span",{dangerouslySetInnerHTML:{__html:C.desc||""}})]},Q))]}),m?.fields&&T.jsxs(I.Fragment,{children:[T.jsx("div",{className:"manual-content-sub-title",children:d("fields")}),m.fields.map((C,Q)=>T.jsxs("div",{className:"manual-content-text",children:[T.jsx("span",{className:"manual-content-args-label",children:C.label})," ",T.jsx("span",{dangerouslySetInnerHTML:{__html:C.desc||""}})]},Q))]}),m?.examples&&T.jsxs(I.Fragment,{children:[T.jsxs("div",{className:"manual-content-sub-title manual-content-example-header",children:[T.jsx("div",{children:T.jsx("span",{children:d("example")})}),T.jsx(Qs,{text:m.originalExample||"",onCopy:W,children:T.jsx("div",{"data-tooltip":L,className:"manual-content-btn manual-content-example-copy",children:T.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"28",height:"28",fill:"none",children:T.jsx("path",{stroke:"currentColor",d:"M8 9.5H6.5a1 1 0 0 0-1 1v11a1 1 0 0 0 1 1h11a1 1 0 0 0 1-1V20m-8-1.5h11a1 1 0 0 0 1-1v-11a1 1 0 0 0-1-1h-11a1 1 0 0 0-1 1v11a1 1 0 0 0 1 1z"})})})})]}),T.jsx("pre",{className:"manual-content-example",children:T.jsx("code",{dangerouslySetInnerHTML:{__html:m.examples}})})]}),m?.detailedDesc&&m.detailedDesc.map((C,Q)=>T.jsxs(I.Fragment,{children:[C.desc.map((te,se)=>T.jsx("div",{className:"manual-content-text",dangerouslySetInnerHTML:{__html:te}},se)),T.jsxs("div",{className:"manual-content-sub-title manual-content-example-header",children:[T.jsx("div",{children:T.jsx("span",{children:d("example")})}),T.jsx(Qs,{text:C.originalExample||"",onCopy:W,children:T.jsx("div",{"data-tooltip":L,className:"manual-content-btn manual-content-example-copy",children:T.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"28",height:"28",fill:"none",children:T.jsx("path",{stroke:"currentColor",d:"M8 9.5H6.5a1 1 0 0 0-1 1v11a1 1 0 0 0 1 1h11a1 1 0 0 0 1-1V20m-8-1.5h11a1 1 0 0 0 1-1v-11a1 1 0 0 0-1-1h-11a1 1 0 0 0-1 1v11a1 1 0 0 0 1 1z"})})})})]}),T.jsx("pre",{className:"manual-content-example",children:T.jsx("code",{dangerouslySetInnerHTML:{__html:C.examples||""}})})]},Q)),m?.returns&&T.jsxs(I.Fragment,{children:[T.jsx("div",{className:"manual-content-sub-title",children:d("returns")}),m.returns.map((C,Q)=>T.jsx("div",{className:"manual-content-text",dangerouslySetInnerHTML:{__html:C}},Q))]}),m?.remarks&&T.jsxs(I.Fragment,{children:[T.jsx("div",{className:"manual-content-sub-title",children:d("remarks")}),m.remarks.map((C,Q)=>T.jsx("div",{className:"manual-content-text",dangerouslySetInnerHTML:{__html:C}},Q))]}),m?.seeAlso&&T.jsxs(I.Fragment,{children:[T.jsx("div",{className:"manual-content-sub-title",children:d("see also")}),T.jsx("div",{className:"manual-content-see_also",children:m.seeAlso.map((C,Q)=>T.jsx("a",{className:"manual-content-see_also-tag","data-name":C?.name,href:C?.link,children:C?.name},Q))})]})]})})},Pl={title:"内置变量",key:"variables",prefix:"var",index:0},Qy=({theme:n="vs-dark",language:s,currentValue:r,version:a=Bt,onChange:o,onVersionChange:l})=>{const[p,d]=I.useState({}),{t:m,i18n:_}=Zs(),[g,x]=I.useState(Pl),[w,q]=I.useState(a||5),[L,K]=I.useState(null),[H,G]=I.useState(0),[z,re]=I.useState(""),[j,W]=I.useState(a!==5?"var_accdist":"var_bar_index"),P=I.useRef(null),C=I.useRef(null),Q=I.useRef(null),te=$=>{$.key===g?.key&&!g?.isHidden?x({...$,isHidden:!0}):x($),P.current?.focus()},se=($,J=!1)=>{ti($),fs($).then(be=>{be&&(d(be),J&&De($!==5?"var_accdist":"var_bar_index",Pl))})};I.useEffect(()=>{a&&se(a)},[a]),I.useEffect(()=>{o&&o(j)},[]),I.useEffect(()=>{Le.editor.setTheme(n)},[n]),I.useEffect(()=>{ae()},[r]);const ae=async()=>{const $=await fs(a);if($&&r.value){const[J]=r.value.split("_"),be=$.CONTENT_GROUPS?.find(ze=>J===ze.prefix);be&&(G(r.index||0),Z(be,r.value)),P.current?.focus()}};I.useEffect(()=>{s&&_.changeLanguage(s)},[s]),I.useEffect(()=>{P.current?.focus()},[P.current]);const De=($,J)=>{$!==j&&(J&&x(J),G(0),W($),o&&o($),Q.current?.scrollTo({top:0}),P.current?.focus())},X=$=>{if($.target.value.trim()==="")ie();else{re($.target.value);const J=Rl($.target.value,p.CONTENT_GROUPS,p.MANUAL_KEYS,p.KEY_MAP_LIST);K(J)}},ie=()=>{re(""),K(null),setTimeout(()=>{C.current?.querySelector(`a[data-href="${j}"]`)?.scrollIntoView(!0)},10),P.current?.focus()},Z=($,J)=>{x($),W(J),o&&o(J),setTimeout(()=>{C.current?.querySelector(`a[data-href="${J}"]`)?.scrollIntoView(!0)},10),Q.current?.scrollTo({top:0})},le=$=>{const J=p.CONTENT_GROUPS?.find(be=>$.startsWith(be.prefix));J&&(G(0),Z(J,$),P.current?.focus())};return T.jsxs("div",{className:`${n} manual-warpper`,children:[T.jsxs("div",{className:"manual-left",children:[T.jsxs("div",{className:"manual-search",children:[T.jsx("span",{className:"manual-search-icon",children:T.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 18 18",width:"18px",height:"18px",children:T.jsx("path",{fillRule:"evenodd",d:"M12.5 11h-.79l-.28-.27A6.47 6.47 0 0 0 13 6.5 6.5 6.5 0 1 0 6.5 13c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L17.49 16l-4.99-5zm-6 0C4.01 11 2 8.99 2 6.5S4.01 2 6.5 2 11 4.01 11 6.5 8.99 11 6.5 11z"})})}),T.jsx("input",{onChange:X,ref:P,spellCheck:"false",value:z,className:"manual-search-input",autoComplete:"off",placeholder:m("search"),type:"text"}),T.jsx("span",{onClick:ie,className:`manual-search-clear ${z?"":"hide"}`,children:T.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 95.939 95.939",width:"9",height:"9",children:T.jsx("path",{d:"M62.82 47.97l32.53-32.534a2 2 0 0 0 0-2.828L83.332.586a2 2 0 0 0-2.827 0L47.97 33.12 15.435.587c-.75-.75-2.078-.75-2.828 0L.587 12.607a2 2 0 0 0 0 2.83L33.12 47.97.588 80.504a2 2 0 0 0 0 2.828l12.02 12.02a1.997 1.997 0 0 0 2.83 0L47.97 62.818l32.535 32.535a2 2 0 0 0 2.827 0l12.02-12.02c.78-.783.78-2.05 0-2.83L62.82 47.97z"})})})]}),T.jsx("div",{className:`manual-group-search-list manual-scroll ${z?"":"hide"}`,children:T.jsxs("div",{children:[L?.labelList.map($=>T.jsx("a",{onClick:J=>{J.preventDefault(),De($.key,$.group)},className:`manual-group-body-item ${$.key===j?"manual-group-body-item-selected":""}`,"data-href":$.key,href:`#${$.key}`,children:$.label},`search_${$.key}`)),T.jsx("div",{className:"manual-content-separator"}),L?.contentList.map($=>T.jsx("a",{onClick:J=>{J.preventDefault(),De($.key,$.group)},className:`manual-group-body-item ${$.key===j?"manual-group-body-item-selected":""}`,"data-href":$.key,href:`#${$.key}`,children:$.label},`search_${$.key}`))]})}),T.jsx("div",{className:`manual-group-list manual-scroll ${z?"hide":""}`,ref:C,children:p.CONTENT_GROUPS?.map($=>T.jsxs(I.Fragment,{children:[T.jsx("div",{onClick:()=>te($),className:`manual-group-title ${$.key===g?.key&&!g?.isHidden?"active":""}`,children:m($.key)}),T.jsx("div",{className:`manual-group-body manual-scroll ${$.key!==g?.key||g?.isHidden?"hide":""}`,children:p.KEY_LIST?.[$.key]?.sort().filter(J=>!p.NOT_SHOW_KEYWORDS?.includes(J))?.map(J=>{const be=`${$.prefix}_${J}`;return T.jsx("a",{onClick:ze=>{ze.preventDefault(),De(be)},className:`manual-group-body-item ${be===j?"manual-group-body-item-selected":""}`,"data-href":be,href:`#${be}`,children:`${J}${$.prefix==="fun"?"()":""}`},be)})})]},$.key))})]}),T.jsx("div",{ref:Q,className:"manual-right manual-scroll",children:T.jsx(Zy,{currentIndex:H,version:w,keyMaps:p.KEY_MAP_LIST,group:g,itemKey:j,onItemClick:le})})]})},Jy=n=>{const{onItemClick:s,item:r,prefix:a,value:o,version:l}=n,{t:p}=Zs(),[d,m]=I.useState(),[_,g]=I.useState(""),[x,w]=I.useState(0),[q,L]=I.useState(p("Copy code")),[K,H]=I.useState(p("Copy link"));I.useEffect(()=>{o&&(m(o),g(`${window.location.origin}/reference-manual/#${a}_${o?.orirginalName}`))},[o]);const G=(P=0)=>{w(P),si(r,P).then(C=>{m(C),g(`${window.location.origin}/reference-manual/#${a}_${C?.orirginalName}`)})},z=P=>{G(P)},re=P=>{if(P.target.localName==="a"&&P.target.hash&&P.target?.dataset?.name){P.preventDefault();const{hash:C}=P.target;s(C.replace("#",""))}},j=()=>{L(p("Copied")),setTimeout(()=>{L(p("Copy code"))},1e3)},W=()=>{H(p("Link copied")),setTimeout(()=>{H(p("Copy link"))},3e3)};return T.jsx("div",{onClick:re,id:`${a}_${d?.orirginalName}`,children:T.jsxs("div",{className:"manual-page-content-wrapper",children:[T.jsxs("div",{className:"manual-page-content-header",children:[T.jsxs("div",{children:[T.jsx("h3",{className:"manual-page-content-header-title",children:d?.name}),!!d?.overloads&&T.jsx("span",{className:"manual-page-content-header-overloads",children:d?.overloads})]}),T.jsx(Qs,{text:_,onCopy:W,children:T.jsx("div",{"data-tooltip":K,className:"manual-page-content-btn",children:T.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 28 28",width:"28",height:"28",children:T.jsxs("g",{fill:"currentColor",children:[T.jsx("path",{fillRule:"nonzero",d:"M15.039 5.969l-.019-.019-2.828 2.828.707.707 2.474-2.474c1.367-1.367 3.582-1.367 4.949 0s1.367 3.582 0 4.949l-2.474 2.474.707.707 2.828-2.828-.019-.019c1.415-1.767 1.304-4.352-.334-5.99-1.638-1.638-4.224-1.749-5.99-.334zM5.97 15.038l-.019-.019 2.828-2.828.707.707-2.475 2.475c-1.367 1.367-1.367 3.582 0 4.949s3.582 1.367 4.949 0l2.474-2.474.707.707-2.828 2.828-.019-.019c-1.767 1.415-4.352 1.304-5.99-.334-1.638-1.638-1.749-4.224-.334-5.99z"}),T.jsx("path",{d:"M10.485 16.141l5.656-5.656.707.707-5.656 5.656z"})]})})})})]}),d?.desc?.map((P,C)=>T.jsx("div",{dangerouslySetInnerHTML:{__html:P},className:"manual-page-content-text"},C)),d?.type&&T.jsxs(I.Fragment,{children:[T.jsx("div",{className:"manual-page-content-sub-title",children:p("type")}),T.jsx("div",{className:"manual-page-content-text",children:d.type})]}),d?.syntax&&T.jsxs(I.Fragment,{children:[T.jsxs("div",{className:"manual-page-content-sub-title",children:[p("syntax")," ",!!d?.overloads&&`& ${p("overloads")}`]}),d.syntax.map((P,C)=>(d.syntax?.length||0)>1?T.jsx("div",{onClick:()=>z(C),children:T.jsx("pre",{className:`manual-page-content-syntax with-overloads ${C===x?"selected":""}`,children:P})},C):T.jsx("pre",{className:"manual-page-content-syntax",children:P},C))]}),d?.args&&T.jsxs(I.Fragment,{children:[T.jsx("div",{className:"manual-page-content-sub-title",children:p("arguments")}),d.args.map((P,C)=>T.jsxs("div",{className:"manual-page-content-text",children:[T.jsx("span",{className:"manual-page-content-args-label",children:P.label})," ",T.jsx("span",{dangerouslySetInnerHTML:{__html:P.desc||""}})]},C))]}),d?.fields&&T.jsxs(I.Fragment,{children:[T.jsx("div",{className:"manual-page-content-sub-title",children:p("fields")}),d.fields.map((P,C)=>T.jsxs("div",{className:"manual-page-content-text",children:[T.jsx("span",{className:"manual-page-content-args-label",children:P.label})," ",T.jsx("span",{dangerouslySetInnerHTML:{__html:P.desc||""}})]},C))]}),d?.examples&&T.jsxs(I.Fragment,{children:[T.jsxs("div",{className:"manual-page-content-sub-title manual-page-content-example-header",children:[T.jsx("div",{children:T.jsx("span",{children:p("example")})}),T.jsx(Qs,{text:d.originalExample||"",onCopy:j,children:T.jsx("div",{"data-tooltip":q,className:"manual-page-content-btn manual-page-content-example-copy",children:T.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"28",height:"28",fill:"none",children:T.jsx("path",{stroke:"currentColor",d:"M8 9.5H6.5a1 1 0 0 0-1 1v11a1 1 0 0 0 1 1h11a1 1 0 0 0 1-1V20m-8-1.5h11a1 1 0 0 0 1-1v-11a1 1 0 0 0-1-1h-11a1 1 0 0 0-1 1v11a1 1 0 0 0 1 1z"})})})})]}),T.jsx("pre",{className:"manual-page-content-example",children:T.jsx("code",{dangerouslySetInnerHTML:{__html:d.examples}})})]}),d?.detailedDesc&&d.detailedDesc.map((P,C)=>T.jsxs(I.Fragment,{children:[P.desc.map((Q,te)=>T.jsx("div",{className:"manual-page-content-text",dangerouslySetInnerHTML:{__html:Q}},te)),T.jsxs("div",{className:"manual-page-content-sub-title manual-page-content-example-header",children:[T.jsx("div",{children:T.jsx("span",{children:p("example")})}),T.jsx(Qs,{text:P.originalExample||"",onCopy:j,children:T.jsx("div",{"data-tooltip":q,className:"manual-page-content-btn manual-page-content-example-copy",children:T.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"28",height:"28",fill:"none",children:T.jsx("path",{stroke:"currentColor",d:"M8 9.5H6.5a1 1 0 0 0-1 1v11a1 1 0 0 0 1 1h11a1 1 0 0 0 1-1V20m-8-1.5h11a1 1 0 0 0 1-1v-11a1 1 0 0 0-1-1h-11a1 1 0 0 0-1 1v11a1 1 0 0 0 1 1z"})})})})]}),T.jsx("pre",{className:"manual-page-content-example",children:T.jsx("code",{dangerouslySetInnerHTML:{__html:P.examples||""}})})]},C)),d?.returns&&T.jsxs(I.Fragment,{children:[T.jsx("div",{className:"manual-page-content-sub-title",children:p("returns")}),d.returns.map((P,C)=>T.jsx("div",{className:"manual-page-content-text",dangerouslySetInnerHTML:{__html:P}},C))]}),d?.remarks&&T.jsxs(I.Fragment,{children:[T.jsx("div",{className:"manual-page-content-sub-title",children:p("remarks")}),d.remarks.map((P,C)=>T.jsx("div",{className:"manual-page-content-text",dangerouslySetInnerHTML:{__html:P}},C))]}),d?.seeAlso&&T.jsxs(I.Fragment,{children:[T.jsx("div",{className:"manual-page-content-sub-title",children:p("see also")}),T.jsx("div",{className:"manual-page-content-see_also",children:d.seeAlso.map((P,C)=>T.jsx("a",{className:"manual-page-content-see_also-tag","data-name":P?.name,href:P?.link,children:P?.name},C))})]})]})})},e_=({onItemClick:n,onGroupClick:s,selectedItemChange:r,selectItem:a,manualTabRef:o,searchRef:l,contentGroups:p,manualKeys:d,keyMaps:m,version:_,onVersionChange:g})=>{const{t:x}=Zs(),[w,q]=I.useState(null),[L,K]=I.useState("");I.useEffect(()=>{l.current?.focus()},[l.current]);const H=z=>{if(z.target.value.trim()==="")G();else{K(z.target.value);const re=Rl(z.target.value,p,d,m);q(re)}},G=()=>{K(""),q(null),setTimeout(()=>{a.current&&r(a.current,!0)},10),l.current?.focus()};return T.jsxs("div",{className:"manual-page-left",children:[T.jsxs("div",{className:"manual-page-search",children:[T.jsx("span",{className:"manual-page-search-icon",children:T.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 18 18",width:"18px",height:"18px",children:T.jsx("path",{fillRule:"evenodd",d:"M12.5 11h-.79l-.28-.27A6.47 6.47 0 0 0 13 6.5 6.5 6.5 0 1 0 6.5 13c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L17.49 16l-4.99-5zm-6 0C4.01 11 2 8.99 2 6.5S4.01 2 6.5 2 11 4.01 11 6.5 8.99 11 6.5 11z"})})}),T.jsx("input",{onChange:H,ref:l,spellCheck:"false",value:L,className:"manual-page-search-input",autoComplete:"off",placeholder:x("search"),type:"text"}),T.jsx("span",{onClick:G,className:`manual-page-search-clear ${L?"":"hide"}`,children:T.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 95.939 95.939",width:"9",height:"9",children:T.jsx("path",{d:"M62.82 47.97l32.53-32.534a2 2 0 0 0 0-2.828L83.332.586a2 2 0 0 0-2.827 0L47.97 33.12 15.435.587c-.75-.75-2.078-.75-2.828 0L.587 12.607a2 2 0 0 0 0 2.83L33.12 47.97.588 80.504a2 2 0 0 0 0 2.828l12.02 12.02a1.997 1.997 0 0 0 2.83 0L47.97 62.818l32.535 32.535a2 2 0 0 0 2.827 0l12.02-12.02c.78-.783.78-2.05 0-2.83L62.82 47.97z"})})})]}),T.jsxs("div",{ref:o,className:"manual-page-group-container",children:[T.jsx("div",{className:`manual-page-group-search-list manual-page-scroll ${L?"":"hide"}`,children:T.jsxs("div",{children:[w?.labelList.map(z=>T.jsx("a",{onClick:re=>{re.preventDefault(),n(z.key,z.index,z.group)},className:"manual-page-group-body-item","data-href":z.key,href:`#${z.key}`,children:z.label},`search_${z.key}`)),T.jsx("div",{className:"manual-page-content-separator"}),w?.contentList.map(z=>T.jsx("a",{onClick:re=>{re.preventDefault(),n(z.key,z.index,z.group)},className:"manual-page-group-body-item","data-href":z.key,href:`#${z.key}`,children:z.label},`search_${z.key}`))]})}),T.jsx("div",{className:`manual-page-group-list manual-page-scroll ${L?"hide":""}`,children:p?.map(z=>T.jsxs(I.Fragment,{children:[T.jsx("div",{onClick:()=>s(z),className:"manual-page-group-title manual-page-group-t",children:x(z.key)}),T.jsx("div",{className:"manual-page-group-body manual-page-group-b manual-page-scroll hide",children:d?.[z.key]?.map((re,j)=>{const W=`${z.prefix}_${re}`;return T.jsx("a",{onClick:P=>{P.preventDefault(),n(W,j)},className:"manual-page-group-body-item","data-href":W,href:`#${W}`,children:`${re}${z.prefix==="fun"?"()":""}`},W)})})]},z.key))})]})]})},ri={title:"内置变量",key:"variables",prefix:"var",index:0},t_=({theme:n="vs-dark",language:s,version:r=Bt,onVersionChange:a})=>{const[o,l]=I.useState({}),{t:p,i18n:d}=Zs(),[m,_]=I.useState(),g=I.useRef(""),x=I.useRef(null),w=I.useRef(null),q=I.useRef(null),L=I.useRef(null),K=I.useRef(null),H=I.useRef(null),G=I.useRef(0),z=I.useRef({startTop:0,endTop:0,key:r!==5?"var_accdist":"var_bar_index",group:ri,index:0}),re=X=>{ae(X),x.current?.focus()};I.useEffect(()=>{r&&(ti(r),fs(r).then(X=>{X&&l(X)}))},[r]),I.useEffect(()=>{K.current||(j(),G.current=q.current?.offsetTop||0)},[o]);const j=async()=>{if(!o.CONTENT_GROUPS)return;const X={};for(const ie of o.CONTENT_GROUPS){const Z=ie.key,le=new Map;for(const $ of o.MANUAL_KEYS?.[Z]){const J=await si(o.KEY_MAP_LIST?.[Z].get($)||[],0);J&&le.set($,J)}X[Z]=le}_(X)};I.useEffect(()=>{if(!K.current&&m){const X=window.location.hash;if(X){const ie=X.replace(/^#/,""),[Z]=ie.split("_"),le=o.CONTENT_GROUPS?.find($=>$.prefix===Z);if(le){ae(le),Q(ie,!0),setTimeout(()=>{const $=document.getElementById(ie);$?.scrollIntoView(),$?.classList.add("reference-item-selected")},10);return}}ae(ri),setTimeout(()=>{De(ri,r!==5?"accdist":"bar_index",0,92)},10)}},[m]),I.useEffect(()=>{Le.editor.setTheme(n)},[n]),I.useEffect(()=>{s&&d.changeLanguage(s)},[s]),I.useEffect(()=>{x.current?.focus()},[x.current]);const W=(X,ie,Z)=>{if(X===g.current)return;Z&&Z.key!==K.current?.key&&ae(Z),Q(X),window.location.href=`#${X}`;const[le,$]=P(X,ie);z.current={startTop:le,endTop:$,group:Z||K.current,index:ie,key:X},L.current?.classList?.remove("manual-page-current-item-bg"),x.current?.focus()},P=(X,ie=0)=>{const Z=document.getElementById(X),le=Z?.offsetHeight||0,$=ie?0:78,J=(Z?.offsetTop||0)-72-G.current;return[J-$,J+le]},C=(X,ie)=>{X.key!==K.current?.key&&ae(X),Q(ie,!0)},Q=(X,ie=!1)=>{const Z=w.current?.querySelector(`a[data-href="${X}"]`);if(ie&&Z?.scrollIntoView({block:"nearest"}),document.getElementById(g.current)?.classList.remove("reference-item-selected"),document.getElementById(X)?.classList.add("reference-item-selected"),X===g.current){!Z?.classList.contains("manual-page-group-body-item-selected")&&Z?.classList.add("manual-page-group-body-item-selected"),H.current=Z;return}g.current=X,H.current?.classList.remove("manual-page-group-body-item-selected"),Z?.classList.add("manual-page-group-body-item-selected"),H.current=Z},te=X=>{const ie=o.CONTENT_GROUPS?.find(Z=>X.startsWith(Z.prefix));ie&&(C(ie,X),window.location.href=`#${X}`,x.current?.focus())},se=I.useCallback(X=>{const{startTop:ie,endTop:Z,index:le,group:$,key:J}=z.current;let be=Z,ze=ie;be||([ze,be]=P(J,le),z.current={startTop:ze,endTop:be,group:$,index:le,key:J}),$.key!==K.current?.key&&ae($);const _e=X.currentTarget.scrollTop;if(_e>=ze&&_e<be)return;let Be=!1,Ge=le,ot=$.index,Je=o.MANUAL_KEYS?.[$.key],Ye=$;if(_e>=be)for(;!Be;){Ge++;const xt=Je[Ge];if(xt)Be=De(Ye,xt,Ge,_e);else{if(ot++,Ye=o.CONTENT_GROUPS?.[ot],Je=o.MANUAL_KEYS?.[Ye?.key],!Je){Be=!0;return}ae(Ye),Ge=-1}}else for(;!Be;)if(Ge--,Ge>=0){const xt=Je[Ge];Be=De(Ye,xt,Ge,_e)}else{if(ot--,ot<0){Be=!0;return}Ye=o.CONTENT_GROUPS?.[ot],ae(Ye),Je=o.MANUAL_KEYS?.[Ye?.key],Ge=Je.length}},[o]),ae=X=>{const ie=K.current?.index,Z=w.current?.querySelectorAll(".manual-page-group-t"),le=w.current?.querySelectorAll(".manual-page-group-b"),$=X.index;if(le?.[ie]?.classList?.add("hide"),Z?.[ie]?.classList?.remove("active"),ie===$){K.current=null;return}else Z?.[$]?.classList?.add("active"),le?.[$]?.classList?.remove("hide"),K.current=X},De=(X,ie,Z,le)=>{const $=`${X.prefix}_${ie}`,[J,be]=P($,Z);if(J<=le&&le<be){z.current={startTop:J,endTop:be,group:X,index:Z,key:$};const ze=w.current?.querySelector(`a[data-href="${$}"]`);return L.current?.classList?.remove("manual-page-current-item-bg"),L.current=ze,ze?.scrollIntoView({block:"nearest"}),ze?.classList.add("manual-page-current-item-bg"),!0}return!1};return T.jsxs("div",{ref:q,className:`${n} manual-page-warpper ${m?"show-warpper":""}`,children:[T.jsx(e_,{onGroupClick:re,onItemClick:W,selectItem:g,manualTabRef:w,searchRef:x,selectedItemChange:Q,manualKeys:o.MANUAL_KEYS,contentGroups:o.CONTENT_GROUPS,keyMaps:o.KEY_MAP_LIST,version:r||5,onVersionChange:a}),T.jsxs("div",{className:"manual-page-right",children:[T.jsx("div",{children:T.jsx("h1",{className:"manual-page-title",children:p("Mine Script® v1 Reference Manual",{version:r})})}),T.jsx("div",{onScroll:se,className:"manual-page-scroll manual-page-scroll-none",children:o.CONTENT_GROUPS?.map(X=>T.jsxs(I.Fragment,{children:[T.jsx("h2",{className:"manual-page-header",children:p(X.key)}),T.jsx("div",{children:o.MANUAL_KEYS?.[X.key]?.map(ie=>T.jsx(Jy,{version:r||5,item:o.KEY_MAP_LIST?.[X.key].get(ie)||[],value:m?.[X.key]?.get(ie),prefix:X.prefix,onItemClick:te},ie))})]},X.key))})]})]})};O.VType=void 0,function(n){n.BOOL="bool",n.INT="int",n.FLOAT="float",n.ARRAY="array",n.BOX="box",n.CHART_POINT="chart.point",n.COLOR="color",n.CONST="const",n.LABEL="label",n.LINE="line",n.LINEFILL="linefill",n.MAP="map",n.MATRIX="matrix",n.POLYLINE="polyline",n.SERIES="series",n.SIMPLE="simple",n.STRING="string",n.TABLE="table",n.UNDETERMINED="undetermined type",n.INPUT="input",n.NA="na",n.VOID="void",n.ENUM="enum"}(O.VType||(O.VType={}));var Bl;(function(n){n.TYPE="type",n.ARRAY="array",n.BOX="box",n.CHART_POINT="chart.point",n.LABEL="label",n.LINE="line",n.LINEFILL="linefill",n.MAP="map",n.MATRIX="matrix",n.POLYLINE="polyline",n.TABLE="table"})(Bl||(Bl={})),O.VRuleType=void 0,function(n){n.FlowStmt="FlowStmt",n.DeclareAssign="DeclareAssign",n.VarBlockStmt="VarBlockStmt",n.VarSingle="VarSingle",n.VarMultiple="VarMultiple",n.ParenthesizedExpression="ParenthesizedExpression",n.AdditiveExpression="AdditiveExpression",n.RelationalExpression="RelationalExpression",n.EqualityExpression="EqualityExpression",n.TernaryExpression="TernaryExpression",n.UnaryExpression="UnaryExpression",n.NotExpression="NotExpression",n.MemberIndexExpression="MemberIndexExpression",n.MethodExpression="MethodExpression",n.LogicalAndExpression="LogicalAndExpression",n.LogicalOrExpression="LogicalOrExpression",n.MultiplicativeExpression="MultiplicativeExpression",n.Brackethesized="Brackethesized",n.IfStatement="IfStatement",n.ForToStatement="ForToStatement",n.ForInStatement="ForInStatement",n.SwitchStatement="SwitchStatement",n.CaseClause="CaseClause",n.DefaultCaluse="DefaultCaluse",n.WhileStatement="WhileStatement",n.ImportElement="ImportElement",n.Literal="Literal",n.ArrowFunction="ArrowFunction",n.ArrowMethod="ArrowMethod",n.TypeStatement="TypeStatement",n.Name="Name",n.AgainAssign="AgainAssign",n.EnumStatement="EnumStatement"}(O.VRuleType||(O.VRuleType={})),O.VAdjustment=void 0,function(n){n.dividends="dividends",n.none="none",n.splits="splits"}(O.VAdjustment||(O.VAdjustment={})),O.VAlert=void 0,function(n){n.freqAll="freq_all",n.freqOncePerBar="freq_once_per_bar",n.freqOncePerBarClose="freq_once_per_bar_close"}(O.VAlert||(O.VAlert={})),O.VBarmergeGaps=void 0,function(n){n.gapsOff="gaps_off",n.gapsOn="gaps_on",n.lookaheadOff="lookahead_off",n.lookaheadOn="lookahead_on"}(O.VBarmergeGaps||(O.VBarmergeGaps={})),O.VPlotDisplay=void 0,function(n){n.all="all",n.dataWindow="data_window",n.none="none",n.pane="pane",n.priceScale="price_scale",n.statusLine="status_line"}(O.VPlotDisplay||(O.VPlotDisplay={})),O.VExtend=void 0,function(n){n.both="both",n.left="left",n.none="none",n.right="right"}(O.VExtend||(O.VExtend={})),O.VFormatType=void 0,function(n){n.inherit="inherit",n.mintick="mintick",n.percent="percent",n.price="price",n.volume="volume"}(O.VFormatType||(O.VFormatType={})),O.VHlineStyle=void 0,function(n){n.styleDashed="style_dashed",n.styleDotted="style_dotted",n.styleSolid="style_solid"}(O.VHlineStyle||(O.VHlineStyle={})),O.VLabelStyle=void 0,function(n){n.styleArrowdown="style_arrowdown",n.styleArrowup="style_arrowup",n.styleCircle="style_circle",n.styleCross="style_cross",n.styleDiamond="style_diamond",n.styleFlag="style_flag",n.styleLabelCenter="style_label_center",n.styleLabelDown="style_label_down",n.styleLabelLeft="style_label_left",n.styleLabelLowerLeft="style_label_lower_left",n.styleLabelLowerRight="style_label_lower_right",n.styleLabelRight="style_label_right",n.styleLabelUp="style_label_up",n.styleLabelUpperLeft="style_label_upper_left",n.styleLabelUpperRight="style_label_upper_right",n.styleNone="style_none",n.styleSquare="style_square",n.styleTextOutline="style_text_outline",n.styleTriangledown="style_triangledown",n.styleTriangleup="style_triangleup",n.styleXcross="style_xcross"}(O.VLabelStyle||(O.VLabelStyle={})),O.VLineStyle=void 0,function(n){n.styleArrowBoth="style_arrow_both",n.styleArrowLeft="style_arrow_left",n.styleArrowRight="style_arrow_right",n.styleDashed="style_dashed",n.styleDotted="style_dotted",n.styleSolid="style_solid"}(O.VLineStyle||(O.VLineStyle={})),O.VLocation=void 0,function(n){n.abovebar="abovebar",n.absolute="absolute",n.belowbar="belowbar",n.bottom="bottom",n.top="top"}(O.VLocation||(O.VLocation={})),O.VSortOrder=void 0,function(n){n.ascending="ascending",n.descending="descending"}(O.VSortOrder||(O.VSortOrder={})),O.VPlotStyle=void 0,function(n){n.styleArea="Area",n.styleAreabr="Area With Breaks",n.styleCircles="Circles",n.styleColumns="Columns",n.styleCross="Cross",n.styleHistogram="Histogram",n.styleLine="Line",n.styleLinebr="Line With Breaks",n.styleStepline="Step Line",n.styleSteplineDiamond="Step Line With Diamonds",n.styleSteplinebr="Step line with Breaks"}(O.VPlotStyle||(O.VPlotStyle={})),O.VPosition=void 0,function(n){n.bottomCenter="bottom_center",n.bottomLeft="bottom_left",n.bottomRight="bottom_right",n.middleCenter="middle_center",n.middleLeft="middle_left",n.middleRight="middle_right",n.topCenter="top_center",n.topLeft="top_left",n.topRight="top_right"}(O.VPosition||(O.VPosition={})),O.VScale=void 0,function(n){n.left="left",n.none="none",n.right="right"}(O.VScale||(O.VScale={})),O.VSession=void 0,function(n){n.extended="extended",n.regular="regular"}(O.VSession||(O.VSession={})),O.VShape=void 0,function(n){n.arrowdown="arrowdown",n.arrowup="arrowup",n.circle="circle",n.cross="cross",n.diamond="diamond",n.flag="flag",n.labeldown="labeldown",n.labelup="labelup",n.square="square",n.triangledown="triangledown",n.triangleup="triangleup",n.xcross="xcross"}(O.VShape||(O.VShape={})),O.VSize=void 0,function(n){n.auto="auto",n.huge="huge",n.large="large",n.normal="normal",n.small="small",n.tiny="tiny"}(O.VSize||(O.VSize={})),O.VFont=void 0,function(n){n.familyDefault="default",n.familyMonospace="monospace"}(O.VFont||(O.VFont={})),O.VStrategy=void 0,function(n){n.cash="cash",n.fixed="fixed",n.percentOfEquity="percent_of_equity"}(O.VStrategy||(O.VStrategy={})),O.VCommission=void 0,function(n){n.cashPerContract="cash_per_contract",n.cashPerOrder="cash_per_order",n.percent="percent"}(O.VCommission||(O.VCommission={})),O.VDirection=void 0,function(n){n.all="all",n.long="long",n.short="short"}(O.VDirection||(O.VDirection={})),O.VOca=void 0,function(n){n.cancel="cancel",n.none="none",n.reduce="reduce"}(O.VOca||(O.VOca={})),O.VText=void 0,function(n){n.alignBottom="align_bottom",n.alignCenter="align_center",n.alignLeft="align_left",n.alignRight="align_right",n.alignTop="align_top",n.wrapAuto="wrap_auto",n.wrapNone="wrap_none"}(O.VText||(O.VText={})),O.VXloc=void 0,function(n){n.bar_index="bar_index",n.bar_time="bar_time"}(O.VXloc||(O.VXloc={})),O.VYloc=void 0,function(n){n.abovebar="abovebar",n.belowbar="belowbar",n.price="price"}(O.VYloc||(O.VYloc={})),O.VEarnings=void 0,function(n){n.actual="actual",n.estimate="estimate",n.standardized="standardized"}(O.VEarnings||(O.VEarnings={})),O.VPivotType=void 0,function(n){n.traditional="Traditional",n.fibonacci="Fibonacci",n.woodie="Woodie",n.classic="Classic",n.dm="DM",n.camarilla="Camarilla"}(O.VPivotType||(O.VPivotType={})),O.VInputType=void 0,function(n){n.INT="int",n.BOOL="bool",n.TIME="time",n.COLOR="color",n.FLOAT="float",n.PRICE="price",n.SOURCE="source",n.STRING="string",n.SYMBOL="symbol",n.SESSION="session",n.TEXT_AREA="text_area",n.TIMEFRAME="timeframe",n.ENUM="enum"}(O.VInputType||(O.VInputType={}));var Kl;(function(n){n.description="description",n.field="field",n.function="function",n.param="param",n.returns="returns",n.type="type",n.variable="variable",n.enum="enum"})(Kl||(Kl={})),O.VScriptType=void 0,function(n){n.library="library",n.indicator="indicator",n.strategy="strategy"}(O.VScriptType||(O.VScriptType={}));const Ul={keywords:[{name:"or",desc:["逻辑 OR。适用于布尔表达式。"],syntax:["expr1 or expr2"]},{name:"and",desc:["逻辑 AND。适用于布尔表达式。"],syntax:["expr1 and expr2"]},{name:"not",desc:["逻辑求反(NOT)。 适用于布尔表达式。"],syntax:["not expr1"]},{name:"if",desc:["If语句定义了在满足表达式条件时必须执行的语句块。","要访问和使用if语句,应在第一行代码中指定Mine脚本语言的版本 >= 2,例如://@version=3","通用编码来自:"],syntax:[`var_declarationX = if condition
85
85
  var_decl_then0
86
86
  var_decl_then1
87
87
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@guihz/trading-vue-editor-tes",
3
- "version": "0.1.5",
3
+ "version": "0.1.6",
4
4
  "type": "module",
5
5
  "files": [
6
6
  "lib"