@guihz/trading-vue-editor-tes 0.0.225 → 0.0.226

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.
@@ -70287,7 +70287,7 @@ const Nv = (a) => {
70287
70287
  const B = (q) => {
70288
70288
  const C = r.replace(`${s == null ? void 0 : s.prefix}_`, ""), O = dt[s == null ? void 0 : s.key].get(C);
70289
70289
  x(q), O && vo(O, q).then((z) => {
70290
- d(z), _(`${window.location.origin}/reference-manual/#${s == null ? void 0 : s.key}_${z == null ? void 0 : z.orirginalName}`);
70290
+ d(z), _(`${window.location.origin}/reference-manual/#${s == null ? void 0 : s.prefix}_${z == null ? void 0 : z.orirginalName}`);
70291
70291
  });
70292
70292
  }, U = (q) => {
70293
70293
  B(q);
@@ -148,4 +148,4 @@ plot(close)
148
148
  `),re=await Ae.editor.colorize(V,Re,{tabSize:4})),z.detailedDesc.push({desc:W,examples:re,originalExample:V})}}return D&&(z.returns=D.map(P=>Cs(P))),m&&(z.remarks=typeof m=="string"?[Cs(m)]:m.map(P=>Cs(P))),g&&(z.syntax=a.map(P=>{var $;return($=P.syntax)==null?void 0:$[0]})),h&&(z.fields=h.map(P=>{const{name:$,desc:j,type:W}=P;return{label:`${$} (${W})`,desc:j&&Cs(j)}})),_&&(z.seeAlso=_.map(P=>Oy(P))),z}function Oy(a){const r=/\[([^\[\]]+)\]\(([^\(\)]+)\)/g.exec(a);if(r){const[n,o,l]=r;return{name:o,link:l}}}function Cs(a){const s=/\*\*([^\*]+)\*\*/g,r=/\`([^\`]+)\`/g,n=/\[([^\[\]]+)\]\(([^\(\)]+)\)/g;return a.replace(s,(o,l)=>`<strong>${l}</strong>`).replace(r,(o,l)=>`<code>${l}</code>`).replace(n,(o,l,c)=>`<a ${c.startsWith("#")?`data-name="${l}"`:'target="_blank"'} class="manual-content-text-link" href="${c}">${l}</a>`)}function zl(a){var o;const s=[];let r=0;const n=[];for(const l of it)for(let[c,d]of ks[l.key].entries()){let m=d;l.prefix==="fun"&&(m=`${d}()`),m.includes(a)&&(m.startsWith(a)?(m.includes(".")?s.splice(r,0,{label:m,index:c,group:l,key:`${l.prefix}_${d}`}):s.unshift({label:m,index:c,group:l,key:`${l.prefix}_${d}`}),r++):s.push({label:m,index:c,group:l,key:`${l.prefix}_${d}`}));const _=nt[l.key].get(d)||[];for(const g of _){const{name:x,args:h,type:D,desc:z,examples:P,remarks:$,seeAlso:j,syntax:W,detailedDesc:re,fields:V,returns:Q}=g,q={label:x,index:c,group:l,key:`${l.prefix}_${x}`};if(l.prefix==="fun"&&(q.label=`${x}()`),q.label.includes(a))break;if(h){let C=!1;for(const R of h){const{name:E,desc:A,displayType:O}=R;if(E.includes(a)||A!=null&&A.includes(a)||O!=null&&O.includes(a)){n.push(q),C=!0;break}}if(C)break}if(D&&D.includes(a)){n.push(q);break}if(z){let C=!1;for(const R of z)if(R.includes(a)){n.push(q),C=!0;break}if(C)break}if(P){let C=!1;for(const R of P)if(R.includes(a)){n.push(q),C=!0;break}if(C)break}if($&&(typeof $=="string"?$:$.join(`
149
149
  `)).includes(a)){n.push(q);break}if(W){let C=!1;for(const R of W)if(R.includes(a)){n.push(q),C=!0;break}if(C)break}if(re){let C=!1;for(const R of re){const{desc:E,examples:A}=R;if(E.join(`
150
150
  `).includes(a)){n.push(q),C=!0;break}if((o=A==null?void 0:A.join(`
151
- `))!=null&&o.includes(a)){n.push(q),C=!0;break}}if(C)break}if(V){let C=!1;for(const R of V){const{name:E,desc:A,type:O}=R;if(E.includes(a)||A!=null&&A.includes(a)||O!=null&&O.includes(a)){n.push(q),C=!0;break}}if(C)break}if(Q){let C=!1;for(const R of Q)if(R.includes(a)){n.push(q),C=!0;break}if(C)break}}}return{labelList:s,contentList:n}}const Py=a=>{var Q;const{group:s,itemKey:r,onItemClick:n,currentIndex:o}=a,{t:l}=Ws(),[c,d]=S.useState(),[m,_]=S.useState(""),[g,x]=S.useState(0),[h,D]=S.useState(l("Copy code")),[z,P]=S.useState(l("Copy link"));S.useEffect(()=>{$(o)},[r]);const $=q=>{const C=r.replace(`${s==null?void 0:s.prefix}_`,""),R=nt[s==null?void 0:s.key].get(C);x(q),R&&Qn(R,q).then(E=>{d(E),_(`${window.location.origin}/reference-manual/#${s==null?void 0:s.key}_${E==null?void 0:E.orirginalName}`)})},j=q=>{$(q)},W=q=>{var C,R;if(q.target.localName==="a"&&q.target.hash&&((R=(C=q.target)==null?void 0:C.dataset)!=null&&R.name)){q.preventDefault();const{hash:E}=q.target;n(E.replace("#",""))}},re=()=>{D(l("Copied")),setTimeout(()=>{D(l("Copy code"))},1e3)},V=()=>{P(l("Link copied")),setTimeout(()=>{P(l("Copy link"))},3e3)};return T.jsx("div",{onClick:W,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:c==null?void 0:c.name}),!!(c!=null&&c.overloads)&&T.jsx("span",{className:"manual-content-header-overloads",children:c==null?void 0:c.overloads})]}),T.jsx(Vs,{text:m,onCopy:V,children:T.jsx("div",{"data-tooltip":z,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"})]})})})})]}),(Q=c==null?void 0:c.desc)==null?void 0:Q.map((q,C)=>T.jsx("div",{dangerouslySetInnerHTML:{__html:q},className:"manual-content-text"},C)),(c==null?void 0:c.type)&&T.jsxs(S.Fragment,{children:[T.jsx("div",{className:"manual-content-sub-title",children:l("type")}),T.jsx("div",{className:"manual-content-text",children:c.type})]}),(c==null?void 0:c.syntax)&&T.jsxs(S.Fragment,{children:[T.jsxs("div",{className:"manual-content-sub-title",children:[l("syntax")," ",!!(c!=null&&c.overloads)&&`& ${l("overloads")}`]}),c.syntax.map((q,C)=>{var R;return(((R=c.syntax)==null?void 0:R.length)||0)>1?T.jsx("div",{onClick:()=>j(C),children:T.jsx("pre",{className:`manual-content-syntax with-overloads ${C===g?"selected":""}`,children:q})},C):T.jsx("pre",{className:"manual-content-syntax",children:q},C)})]}),(c==null?void 0:c.args)&&T.jsxs(S.Fragment,{children:[T.jsx("div",{className:"manual-content-sub-title",children:l("arguments")}),c.args.map((q,C)=>T.jsxs("div",{className:"manual-content-text",children:[T.jsx("span",{className:"manual-content-args-label",children:q.label})," ",T.jsx("span",{dangerouslySetInnerHTML:{__html:q.desc||""}})]},C))]}),(c==null?void 0:c.fields)&&T.jsxs(S.Fragment,{children:[T.jsx("div",{className:"manual-content-sub-title",children:l("fields")}),c.fields.map((q,C)=>T.jsxs("div",{className:"manual-content-text",children:[T.jsx("span",{className:"manual-content-args-label",children:q.label})," ",T.jsx("span",{dangerouslySetInnerHTML:{__html:q.desc||""}})]},C))]}),(c==null?void 0:c.examples)&&T.jsxs(S.Fragment,{children:[T.jsxs("div",{className:"manual-content-sub-title manual-content-example-header",children:[T.jsx("div",{children:T.jsx("span",{children:l("example")})}),T.jsx(Vs,{text:c.originalExample||"",onCopy:re,children:T.jsx("div",{"data-tooltip":h,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}})})]}),(c==null?void 0:c.detailedDesc)&&c.detailedDesc.map((q,C)=>T.jsxs(S.Fragment,{children:[q.desc.map((R,E)=>T.jsx("div",{className:"manual-content-text",dangerouslySetInnerHTML:{__html:R}},E)),T.jsxs("div",{className:"manual-content-sub-title manual-content-example-header",children:[T.jsx("div",{children:T.jsx("span",{children:l("example")})}),T.jsx(Vs,{text:q.originalExample||"",onCopy:re,children:T.jsx("div",{"data-tooltip":h,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:q.examples||""}})})]},C)),(c==null?void 0:c.returns)&&T.jsxs(S.Fragment,{children:[T.jsx("div",{className:"manual-content-sub-title",children:l("returns")}),c.returns.map((q,C)=>T.jsx("div",{className:"manual-content-text",dangerouslySetInnerHTML:{__html:q}},C))]}),(c==null?void 0:c.remarks)&&T.jsxs(S.Fragment,{children:[T.jsx("div",{className:"manual-content-sub-title",children:l("remarks")}),c.remarks.map((q,C)=>T.jsx("div",{className:"manual-content-text",dangerouslySetInnerHTML:{__html:q}},C))]}),(c==null?void 0:c.seeAlso)&&T.jsxs(S.Fragment,{children:[T.jsx("div",{className:"manual-content-sub-title",children:l("see also")}),T.jsx("div",{className:"manual-content-see_also",children:c.seeAlso.map((q,C)=>T.jsx("a",{className:"manual-content-see_also-tag","data-name":q==null?void 0:q.name,href:q==null?void 0:q.link,children:q==null?void 0:q.name},C))})]})]})})};Ae.languages.register({id:Re}),Ae.editor.defineTheme("vs-dark",ga),Ae.editor.defineTheme("vs",fa),Ae.languages.setMonarchTokensProvider(Re,Is),Ae.languages.setLanguageConfiguration(Re,_a);const Ry=({theme:a="vs-dark",language:s,currentValue:r})=>{const{t:n,i18n:o}=Ws(),[l,c]=S.useState(it[0]),[d,m]=S.useState(null),[_,g]=S.useState(0),[x,h]=S.useState(""),[D,z]=S.useState("var_bar_index"),P=S.useRef(null),$=S.useRef(null),j=S.useRef(null),W=R=>{var E;R.key===(l==null?void 0:l.key)&&!(l!=null&&l.isHidden)?c({...R,isHidden:!0}):c(R),(E=P.current)==null||E.focus()};S.useEffect(()=>{Ae.editor.setTheme(a)},[a]),S.useEffect(()=>{var R;if(r.value){const[E]=r.value.split("_"),A=it.find(O=>E===O.prefix);A&&(g(r.index||0),q(A,r.value)),(R=P.current)==null||R.focus()}},[r]),S.useEffect(()=>{s&&o.changeLanguage(s)},[s]),S.useEffect(()=>{var R;(R=P.current)==null||R.focus()},[P.current]);const re=(R,E)=>{var A,O;R!==D&&(E&&c(E),g(0),z(R),(A=j.current)==null||A.scrollTo({top:0}),(O=P.current)==null||O.focus())},V=R=>{if(R.target.value.trim()==="")Q();else{h(R.target.value);const E=zl(R.target.value);m(E)}},Q=()=>{var R;h(""),m(null),setTimeout(()=>{var E,A;(A=(E=$.current)==null?void 0:E.querySelector(`a[data-href="${D}"]`))==null||A.scrollIntoView(!0)},10),(R=P.current)==null||R.focus()},q=(R,E)=>{var A;c(R),z(E),setTimeout(()=>{var O,J;(J=(O=$.current)==null?void 0:O.querySelector(`a[data-href="${E}"]`))==null||J.scrollIntoView(!0)},10),(A=j.current)==null||A.scrollTo({top:0})},C=R=>{var A;const E=it.find(O=>R.startsWith(O.prefix));E&&(g(0),q(E,R),(A=P.current)==null||A.focus())};return T.jsxs("div",{className:`${a} 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:V,ref:P,spellCheck:"false",value:x,className:"manual-search-input",autoComplete:"off",placeholder:n("search"),type:"text"}),T.jsx("span",{onClick:Q,className:`manual-search-clear ${x?"":"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 ${x?"":"hide"}`,children:T.jsxs("div",{children:[d==null?void 0:d.labelList.map(R=>T.jsx("a",{onClick:E=>{E.preventDefault(),re(R.key,R.group)},className:`manual-group-body-item ${R.key===D?"manual-group-body-item-selected":""}`,"data-href":R.key,href:`#${R.key}`,children:R.label},`search_${R.key}`)),T.jsx("div",{className:"manual-content-separator"}),d==null?void 0:d.contentList.map(R=>T.jsx("a",{onClick:E=>{E.preventDefault(),re(R.key,R.group)},className:`manual-group-body-item ${R.key===D?"manual-group-body-item-selected":""}`,"data-href":R.key,href:`#${R.key}`,children:R.label},`search_${R.key}`))]})}),T.jsx("div",{className:`manual-group-list manual-scroll ${x?"hide":""}`,ref:$,children:it.map(R=>{var E,A;return T.jsxs(S.Fragment,{children:[T.jsx("div",{onClick:()=>W(R),className:`manual-group-title ${R.key===(l==null?void 0:l.key)&&!(l!=null&&l.isHidden)?"active":""}`,children:n(R.key)}),T.jsx("div",{className:`manual-group-body manual-scroll ${R.key!==(l==null?void 0:l.key)||l!=null&&l.isHidden?"hide":""}`,children:(A=(E=zn[R.key])==null?void 0:E.sort().filter(O=>!Lo.includes(O)))==null?void 0:A.map(O=>{const J=`${R.prefix}_${O}`;return T.jsx("a",{onClick:se=>{se.preventDefault(),re(J)},className:`manual-group-body-item ${J===D?"manual-group-body-item-selected":""}`,"data-href":J,href:`#${J}`,children:`${O}${R.prefix==="fun"?"()":""}`},J)})})]},R.key)})})]}),T.jsx("div",{ref:j,className:"manual-right manual-scroll",children:T.jsx(Py,{currentIndex:_,group:l,itemKey:D,onItemClick:C})})]})},Fy=a=>{var Q;const{onItemClick:s,item:r,prefix:n,value:o}=a,{t:l}=Ws(),[c,d]=S.useState(),[m,_]=S.useState(""),[g,x]=S.useState(0),[h,D]=S.useState(l("Copy code")),[z,P]=S.useState(l("Copy link"));S.useEffect(()=>{o&&(d(o),_(`${window.location.origin}/reference-manual/#${n}_${o==null?void 0:o.orirginalName}`))},[o]);const $=(q=0)=>{x(q),Qn(r,q).then(C=>{d(C),_(`${window.location.origin}/reference-manual/#${n}_${C==null?void 0:C.orirginalName}`)})},j=q=>{$(q)},W=q=>{var C,R;if(q.target.localName==="a"&&q.target.hash&&((R=(C=q.target)==null?void 0:C.dataset)!=null&&R.name)){q.preventDefault();const{hash:E}=q.target;s(E.replace("#",""))}},re=()=>{D(l("Copied")),setTimeout(()=>{D(l("Copy code"))},1e3)},V=()=>{P(l("Link copied")),setTimeout(()=>{P(l("Copy link"))},3e3)};return T.jsx("div",{onClick:W,id:`${n}_${c==null?void 0:c.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:c==null?void 0:c.name}),!!(c!=null&&c.overloads)&&T.jsx("span",{className:"manual-page-content-header-overloads",children:c==null?void 0:c.overloads})]}),T.jsx(Vs,{text:m,onCopy:V,children:T.jsx("div",{"data-tooltip":z,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"})]})})})})]}),(Q=c==null?void 0:c.desc)==null?void 0:Q.map((q,C)=>T.jsx("div",{dangerouslySetInnerHTML:{__html:q},className:"manual-page-content-text"},C)),(c==null?void 0:c.type)&&T.jsxs(S.Fragment,{children:[T.jsx("div",{className:"manual-page-content-sub-title",children:l("type")}),T.jsx("div",{className:"manual-page-content-text",children:c.type})]}),(c==null?void 0:c.syntax)&&T.jsxs(S.Fragment,{children:[T.jsxs("div",{className:"manual-page-content-sub-title",children:[l("syntax")," ",!!(c!=null&&c.overloads)&&`& ${l("overloads")}`]}),c.syntax.map((q,C)=>{var R;return(((R=c.syntax)==null?void 0:R.length)||0)>1?T.jsx("div",{onClick:()=>j(C),children:T.jsx("pre",{className:`manual-page-content-syntax with-overloads ${C===g?"selected":""}`,children:q})},C):T.jsx("pre",{className:"manual-page-content-syntax",children:q},C)})]}),(c==null?void 0:c.args)&&T.jsxs(S.Fragment,{children:[T.jsx("div",{className:"manual-page-content-sub-title",children:l("arguments")}),c.args.map((q,C)=>T.jsxs("div",{className:"manual-page-content-text",children:[T.jsx("span",{className:"manual-page-content-args-label",children:q.label})," ",T.jsx("span",{dangerouslySetInnerHTML:{__html:q.desc||""}})]},C))]}),(c==null?void 0:c.fields)&&T.jsxs(S.Fragment,{children:[T.jsx("div",{className:"manual-page-content-sub-title",children:l("fields")}),c.fields.map((q,C)=>T.jsxs("div",{className:"manual-page-content-text",children:[T.jsx("span",{className:"manual-page-content-args-label",children:q.label})," ",T.jsx("span",{dangerouslySetInnerHTML:{__html:q.desc||""}})]},C))]}),(c==null?void 0:c.examples)&&T.jsxs(S.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:l("example")})}),T.jsx(Vs,{text:c.originalExample||"",onCopy:re,children:T.jsx("div",{"data-tooltip":h,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:c.examples}})})]}),(c==null?void 0:c.detailedDesc)&&c.detailedDesc.map((q,C)=>T.jsxs(S.Fragment,{children:[q.desc.map((R,E)=>T.jsx("div",{className:"manual-page-content-text",dangerouslySetInnerHTML:{__html:R}},E)),T.jsxs("div",{className:"manual-page-content-sub-title manual-page-content-example-header",children:[T.jsx("div",{children:T.jsx("span",{children:l("example")})}),T.jsx(Vs,{text:q.originalExample||"",onCopy:re,children:T.jsx("div",{"data-tooltip":h,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:q.examples||""}})})]},C)),(c==null?void 0:c.returns)&&T.jsxs(S.Fragment,{children:[T.jsx("div",{className:"manual-page-content-sub-title",children:l("returns")}),c.returns.map((q,C)=>T.jsx("div",{className:"manual-page-content-text",dangerouslySetInnerHTML:{__html:q}},C))]}),(c==null?void 0:c.remarks)&&T.jsxs(S.Fragment,{children:[T.jsx("div",{className:"manual-page-content-sub-title",children:l("remarks")}),c.remarks.map((q,C)=>T.jsx("div",{className:"manual-page-content-text",dangerouslySetInnerHTML:{__html:q}},C))]}),(c==null?void 0:c.seeAlso)&&T.jsxs(S.Fragment,{children:[T.jsx("div",{className:"manual-page-content-sub-title",children:l("see also")}),T.jsx("div",{className:"manual-page-content-see_also",children:c.seeAlso.map((q,C)=>T.jsx("a",{className:"manual-page-content-see_also-tag","data-name":q==null?void 0:q.name,href:q==null?void 0:q.link,children:q==null?void 0:q.name},C))})]})]})})},By=({onItemClick:a,onGroupClick:s,selectedItemChange:r,selectItem:n,manualTabRef:o,searchRef:l})=>{const{t:c}=Ws(),[d,m]=S.useState(null),[_,g]=S.useState("");S.useEffect(()=>{var D;(D=l.current)==null||D.focus()},[l.current]);const x=D=>{if(D.target.value.trim()==="")h();else{g(D.target.value);const z=zl(D.target.value);m(z)}},h=()=>{var D;g(""),m(null),setTimeout(()=>{n.current&&r(n.current,!0)},10),(D=l.current)==null||D.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:x,ref:l,spellCheck:"false",value:_,className:"manual-page-search-input",autoComplete:"off",placeholder:c("search"),type:"text"}),T.jsx("span",{onClick:h,className:`manual-page-search-clear ${_?"":"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 ${_?"":"hide"}`,children:T.jsxs("div",{children:[d==null?void 0:d.labelList.map(D=>T.jsx("a",{onClick:z=>{z.preventDefault(),a(D.key,D.index,D.group)},className:"manual-page-group-body-item","data-href":D.key,href:`#${D.key}`,children:D.label},`search_${D.key}`)),T.jsx("div",{className:"manual-page-content-separator"}),d==null?void 0:d.contentList.map(D=>T.jsx("a",{onClick:z=>{z.preventDefault(),a(D.key,D.index,D.group)},className:"manual-page-group-body-item","data-href":D.key,href:`#${D.key}`,children:D.label},`search_${D.key}`))]})}),T.jsx("div",{className:`manual-page-group-list manual-page-scroll ${_?"hide":""}`,children:it.map(D=>{var z;return T.jsxs(S.Fragment,{children:[T.jsx("div",{onClick:()=>s(D),className:"manual-page-group-title manual-page-group-t",children:c(D.key)}),T.jsx("div",{className:"manual-page-group-body manual-page-group-b manual-page-scroll hide",children:(z=ks[D.key])==null?void 0:z.map((P,$)=>{const j=`${D.prefix}_${P}`;return T.jsx("a",{onClick:W=>{W.preventDefault(),a(j,$)},className:"manual-page-group-body-item","data-href":j,href:`#${j}`,children:`${P}${D.prefix==="fun"?"()":""}`},j)})})]},D.key)})})]})]})};Ae.languages.register({id:Re}),Ae.editor.defineTheme("vs-dark",ga),Ae.editor.defineTheme("vs",fa),Ae.languages.setMonarchTokensProvider(Re,Is),Ae.languages.setLanguageConfiguration(Re,_a);const Uy=({theme:a="vs-dark",language:s})=>{const{t:r,i18n:n}=Ws(),[o,l]=S.useState(),c=S.useRef(""),d=S.useRef(null),m=S.useRef(null),_=S.useRef(null),g=S.useRef(null),x=S.useRef(null),h=S.useRef(null),D=S.useRef(0),z=S.useRef({startTop:0,endTop:0,key:"var_bar_index",group:it[0],index:0}),P=E=>{var A;C(E),(A=d.current)==null||A.focus()};S.useEffect(()=>{var E;x.current||($(),D.current=((E=_.current)==null?void 0:E.offsetTop)||0)},[]);const $=async()=>{const E={};for(const A of it){const O=A.key,J=new Map;for(const se of ks[O]){const le=await Qn(nt[O].get(se)||[],0);le&&J.set(se,le)}E[O]=J}l(E)};S.useEffect(()=>{if(!x.current&&o){const E=window.location.hash;if(E){const A=E.replace(/^#/,""),[O]=A.split("_"),J=it.find(se=>se.prefix===O);if(J){C(J),V(A,!0),setTimeout(()=>{const se=document.getElementById(A);se==null||se.scrollIntoView(),se==null||se.classList.add("reference-item-selected")},10);return}}C(it[0]),setTimeout(()=>{R(it[0],"bar_index",0,92)},10)}},[o]),S.useEffect(()=>{Ae.editor.setTheme(a)},[a]),S.useEffect(()=>{s&&n.changeLanguage(s)},[s]),S.useEffect(()=>{var E;(E=d.current)==null||E.focus()},[d.current]);const j=(E,A,O)=>{var le,Y,oe,xe;if(E===c.current)return;O&&O.key!==((le=x.current)==null?void 0:le.key)&&C(O),V(E),window.location.href=`#${E}`;const[J,se]=W(E,A);z.current={startTop:J,endTop:se,group:O||x.current,index:A,key:E},(oe=(Y=g.current)==null?void 0:Y.classList)==null||oe.remove("manual-page-current-item-bg"),(xe=d.current)==null||xe.focus()},W=(E,A=0)=>{const O=document.getElementById(E),J=(O==null?void 0:O.offsetHeight)||0,se=A?0:78,le=((O==null?void 0:O.offsetTop)||0)-72-D.current;return[le-se,le+J]},re=(E,A)=>{var O;E.key!==((O=x.current)==null?void 0:O.key)&&C(E),V(A,!0)},V=(E,A=!1)=>{var J,se,le,Y;const O=(J=m.current)==null?void 0:J.querySelector(`a[data-href="${E}"]`);if(A&&(O==null||O.scrollIntoView({block:"nearest"})),(se=document.getElementById(c.current))==null||se.classList.remove("reference-item-selected"),(le=document.getElementById(E))==null||le.classList.add("reference-item-selected"),E===c.current){!(O!=null&&O.classList.contains("manual-page-group-body-item-selected"))&&(O==null||O.classList.add("manual-page-group-body-item-selected")),h.current=O;return}c.current=E,(Y=h.current)==null||Y.classList.remove("manual-page-group-body-item-selected"),O==null||O.classList.add("manual-page-group-body-item-selected"),h.current=O},Q=E=>{var O;const A=it.find(J=>E.startsWith(J.prefix));A&&(re(A,E),window.location.href=`#${E}`,(O=d.current)==null||O.focus())},q=S.useCallback(E=>{var Oe;const{startTop:A,endTop:O,index:J,group:se,key:le}=z.current;let Y=O,oe=A;Y||([oe,Y]=W(le,J),z.current={startTop:oe,endTop:Y,group:se,index:J,key:le}),se.key!==((Oe=x.current)==null?void 0:Oe.key)&&C(se);const xe=E.currentTarget.scrollTop;if(xe>=oe&&xe<Y)return;let pe=!1,_e=J,Ee=se.index,ee=ks[se.key],de=se;if(xe>=Y)for(;!pe;){_e++;const Ge=ee[_e];if(Ge)pe=R(de,Ge,_e,xe);else{if(Ee++,de=it[Ee],ee=ks[de==null?void 0:de.key],!ee){pe=!0;return}C(de),_e=-1}}else for(;!pe;)if(_e--,_e>=0){const Ge=ee[_e];pe=R(de,Ge,_e,xe)}else{if(Ee--,Ee<0){pe=!0;return}de=it[Ee],C(de),ee=ks[de==null?void 0:de.key],_e=ee.length}},[]),C=E=>{var le,Y,oe,xe,pe,_e,Ee,ee,de,Oe,Ge;const A=(le=x.current)==null?void 0:le.index,O=(Y=m.current)==null?void 0:Y.querySelectorAll(".manual-page-group-t"),J=(oe=m.current)==null?void 0:oe.querySelectorAll(".manual-page-group-b"),se=E.index;if((pe=(xe=J==null?void 0:J[A])==null?void 0:xe.classList)==null||pe.add("hide"),(Ee=(_e=O==null?void 0:O[A])==null?void 0:_e.classList)==null||Ee.remove("active"),A===se){x.current=null;return}else(de=(ee=O==null?void 0:O[se])==null?void 0:ee.classList)==null||de.add("active"),(Ge=(Oe=J==null?void 0:J[se])==null?void 0:Oe.classList)==null||Ge.remove("hide"),x.current=E},R=(E,A,O,J)=>{var oe,xe,pe;const se=`${E.prefix}_${A}`,[le,Y]=W(se,O);if(le<=J&&J<Y){z.current={startTop:le,endTop:Y,group:E,index:O,key:se};const _e=(oe=m.current)==null?void 0:oe.querySelector(`a[data-href="${se}"]`);return(pe=(xe=g.current)==null?void 0:xe.classList)==null||pe.remove("manual-page-current-item-bg"),g.current=_e,_e==null||_e.scrollIntoView({block:"nearest"}),_e==null||_e.classList.add("manual-page-current-item-bg"),!0}return!1};return T.jsxs("div",{ref:_,className:`${a} manual-page-warpper ${o?"show-warpper":""}`,children:[T.jsx(By,{onGroupClick:P,onItemClick:j,selectItem:c,manualTabRef:m,searchRef:d,selectedItemChange:V}),T.jsxs("div",{className:"manual-page-right",children:[T.jsx("div",{children:T.jsx("h1",{className:"manual-page-title",children:r("Mine Script® v1 Reference Manual")})}),T.jsx("div",{onScroll:q,className:"manual-page-scroll manual-page-scroll-none",children:it.map(E=>T.jsxs(S.Fragment,{children:[T.jsx("h2",{className:"manual-page-header",children:r(E.key)}),T.jsx("div",{children:ks[E.key].map(A=>{var O;return T.jsx(Fy,{item:nt[E.key].get(A)||[],value:(O=o==null?void 0:o[E.key])==null?void 0:O.get(A),prefix:E.prefix,onItemClick:Q},A)})})]},E.key))})]})]})};L.ReferenceManual=Ry,L.ReferenceManualPage=Uy,L.TradingVueDiffEditor=gy,L.TradingVueEditor=fy,L.parseLibrary=Mm,L.parseTcc=ml,L.removeScript=Pm,L.scriptsRun=Om,Object.defineProperty(L,Symbol.toStringTag,{value:"Module"})});
151
+ `))!=null&&o.includes(a)){n.push(q),C=!0;break}}if(C)break}if(V){let C=!1;for(const R of V){const{name:E,desc:A,type:O}=R;if(E.includes(a)||A!=null&&A.includes(a)||O!=null&&O.includes(a)){n.push(q),C=!0;break}}if(C)break}if(Q){let C=!1;for(const R of Q)if(R.includes(a)){n.push(q),C=!0;break}if(C)break}}}return{labelList:s,contentList:n}}const Py=a=>{var Q;const{group:s,itemKey:r,onItemClick:n,currentIndex:o}=a,{t:l}=Ws(),[c,d]=S.useState(),[m,_]=S.useState(""),[g,x]=S.useState(0),[h,D]=S.useState(l("Copy code")),[z,P]=S.useState(l("Copy link"));S.useEffect(()=>{$(o)},[r]);const $=q=>{const C=r.replace(`${s==null?void 0:s.prefix}_`,""),R=nt[s==null?void 0:s.key].get(C);x(q),R&&Qn(R,q).then(E=>{d(E),_(`${window.location.origin}/reference-manual/#${s==null?void 0:s.prefix}_${E==null?void 0:E.orirginalName}`)})},j=q=>{$(q)},W=q=>{var C,R;if(q.target.localName==="a"&&q.target.hash&&((R=(C=q.target)==null?void 0:C.dataset)!=null&&R.name)){q.preventDefault();const{hash:E}=q.target;n(E.replace("#",""))}},re=()=>{D(l("Copied")),setTimeout(()=>{D(l("Copy code"))},1e3)},V=()=>{P(l("Link copied")),setTimeout(()=>{P(l("Copy link"))},3e3)};return T.jsx("div",{onClick:W,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:c==null?void 0:c.name}),!!(c!=null&&c.overloads)&&T.jsx("span",{className:"manual-content-header-overloads",children:c==null?void 0:c.overloads})]}),T.jsx(Vs,{text:m,onCopy:V,children:T.jsx("div",{"data-tooltip":z,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"})]})})})})]}),(Q=c==null?void 0:c.desc)==null?void 0:Q.map((q,C)=>T.jsx("div",{dangerouslySetInnerHTML:{__html:q},className:"manual-content-text"},C)),(c==null?void 0:c.type)&&T.jsxs(S.Fragment,{children:[T.jsx("div",{className:"manual-content-sub-title",children:l("type")}),T.jsx("div",{className:"manual-content-text",children:c.type})]}),(c==null?void 0:c.syntax)&&T.jsxs(S.Fragment,{children:[T.jsxs("div",{className:"manual-content-sub-title",children:[l("syntax")," ",!!(c!=null&&c.overloads)&&`& ${l("overloads")}`]}),c.syntax.map((q,C)=>{var R;return(((R=c.syntax)==null?void 0:R.length)||0)>1?T.jsx("div",{onClick:()=>j(C),children:T.jsx("pre",{className:`manual-content-syntax with-overloads ${C===g?"selected":""}`,children:q})},C):T.jsx("pre",{className:"manual-content-syntax",children:q},C)})]}),(c==null?void 0:c.args)&&T.jsxs(S.Fragment,{children:[T.jsx("div",{className:"manual-content-sub-title",children:l("arguments")}),c.args.map((q,C)=>T.jsxs("div",{className:"manual-content-text",children:[T.jsx("span",{className:"manual-content-args-label",children:q.label})," ",T.jsx("span",{dangerouslySetInnerHTML:{__html:q.desc||""}})]},C))]}),(c==null?void 0:c.fields)&&T.jsxs(S.Fragment,{children:[T.jsx("div",{className:"manual-content-sub-title",children:l("fields")}),c.fields.map((q,C)=>T.jsxs("div",{className:"manual-content-text",children:[T.jsx("span",{className:"manual-content-args-label",children:q.label})," ",T.jsx("span",{dangerouslySetInnerHTML:{__html:q.desc||""}})]},C))]}),(c==null?void 0:c.examples)&&T.jsxs(S.Fragment,{children:[T.jsxs("div",{className:"manual-content-sub-title manual-content-example-header",children:[T.jsx("div",{children:T.jsx("span",{children:l("example")})}),T.jsx(Vs,{text:c.originalExample||"",onCopy:re,children:T.jsx("div",{"data-tooltip":h,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}})})]}),(c==null?void 0:c.detailedDesc)&&c.detailedDesc.map((q,C)=>T.jsxs(S.Fragment,{children:[q.desc.map((R,E)=>T.jsx("div",{className:"manual-content-text",dangerouslySetInnerHTML:{__html:R}},E)),T.jsxs("div",{className:"manual-content-sub-title manual-content-example-header",children:[T.jsx("div",{children:T.jsx("span",{children:l("example")})}),T.jsx(Vs,{text:q.originalExample||"",onCopy:re,children:T.jsx("div",{"data-tooltip":h,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:q.examples||""}})})]},C)),(c==null?void 0:c.returns)&&T.jsxs(S.Fragment,{children:[T.jsx("div",{className:"manual-content-sub-title",children:l("returns")}),c.returns.map((q,C)=>T.jsx("div",{className:"manual-content-text",dangerouslySetInnerHTML:{__html:q}},C))]}),(c==null?void 0:c.remarks)&&T.jsxs(S.Fragment,{children:[T.jsx("div",{className:"manual-content-sub-title",children:l("remarks")}),c.remarks.map((q,C)=>T.jsx("div",{className:"manual-content-text",dangerouslySetInnerHTML:{__html:q}},C))]}),(c==null?void 0:c.seeAlso)&&T.jsxs(S.Fragment,{children:[T.jsx("div",{className:"manual-content-sub-title",children:l("see also")}),T.jsx("div",{className:"manual-content-see_also",children:c.seeAlso.map((q,C)=>T.jsx("a",{className:"manual-content-see_also-tag","data-name":q==null?void 0:q.name,href:q==null?void 0:q.link,children:q==null?void 0:q.name},C))})]})]})})};Ae.languages.register({id:Re}),Ae.editor.defineTheme("vs-dark",ga),Ae.editor.defineTheme("vs",fa),Ae.languages.setMonarchTokensProvider(Re,Is),Ae.languages.setLanguageConfiguration(Re,_a);const Ry=({theme:a="vs-dark",language:s,currentValue:r})=>{const{t:n,i18n:o}=Ws(),[l,c]=S.useState(it[0]),[d,m]=S.useState(null),[_,g]=S.useState(0),[x,h]=S.useState(""),[D,z]=S.useState("var_bar_index"),P=S.useRef(null),$=S.useRef(null),j=S.useRef(null),W=R=>{var E;R.key===(l==null?void 0:l.key)&&!(l!=null&&l.isHidden)?c({...R,isHidden:!0}):c(R),(E=P.current)==null||E.focus()};S.useEffect(()=>{Ae.editor.setTheme(a)},[a]),S.useEffect(()=>{var R;if(r.value){const[E]=r.value.split("_"),A=it.find(O=>E===O.prefix);A&&(g(r.index||0),q(A,r.value)),(R=P.current)==null||R.focus()}},[r]),S.useEffect(()=>{s&&o.changeLanguage(s)},[s]),S.useEffect(()=>{var R;(R=P.current)==null||R.focus()},[P.current]);const re=(R,E)=>{var A,O;R!==D&&(E&&c(E),g(0),z(R),(A=j.current)==null||A.scrollTo({top:0}),(O=P.current)==null||O.focus())},V=R=>{if(R.target.value.trim()==="")Q();else{h(R.target.value);const E=zl(R.target.value);m(E)}},Q=()=>{var R;h(""),m(null),setTimeout(()=>{var E,A;(A=(E=$.current)==null?void 0:E.querySelector(`a[data-href="${D}"]`))==null||A.scrollIntoView(!0)},10),(R=P.current)==null||R.focus()},q=(R,E)=>{var A;c(R),z(E),setTimeout(()=>{var O,J;(J=(O=$.current)==null?void 0:O.querySelector(`a[data-href="${E}"]`))==null||J.scrollIntoView(!0)},10),(A=j.current)==null||A.scrollTo({top:0})},C=R=>{var A;const E=it.find(O=>R.startsWith(O.prefix));E&&(g(0),q(E,R),(A=P.current)==null||A.focus())};return T.jsxs("div",{className:`${a} 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:V,ref:P,spellCheck:"false",value:x,className:"manual-search-input",autoComplete:"off",placeholder:n("search"),type:"text"}),T.jsx("span",{onClick:Q,className:`manual-search-clear ${x?"":"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 ${x?"":"hide"}`,children:T.jsxs("div",{children:[d==null?void 0:d.labelList.map(R=>T.jsx("a",{onClick:E=>{E.preventDefault(),re(R.key,R.group)},className:`manual-group-body-item ${R.key===D?"manual-group-body-item-selected":""}`,"data-href":R.key,href:`#${R.key}`,children:R.label},`search_${R.key}`)),T.jsx("div",{className:"manual-content-separator"}),d==null?void 0:d.contentList.map(R=>T.jsx("a",{onClick:E=>{E.preventDefault(),re(R.key,R.group)},className:`manual-group-body-item ${R.key===D?"manual-group-body-item-selected":""}`,"data-href":R.key,href:`#${R.key}`,children:R.label},`search_${R.key}`))]})}),T.jsx("div",{className:`manual-group-list manual-scroll ${x?"hide":""}`,ref:$,children:it.map(R=>{var E,A;return T.jsxs(S.Fragment,{children:[T.jsx("div",{onClick:()=>W(R),className:`manual-group-title ${R.key===(l==null?void 0:l.key)&&!(l!=null&&l.isHidden)?"active":""}`,children:n(R.key)}),T.jsx("div",{className:`manual-group-body manual-scroll ${R.key!==(l==null?void 0:l.key)||l!=null&&l.isHidden?"hide":""}`,children:(A=(E=zn[R.key])==null?void 0:E.sort().filter(O=>!Lo.includes(O)))==null?void 0:A.map(O=>{const J=`${R.prefix}_${O}`;return T.jsx("a",{onClick:se=>{se.preventDefault(),re(J)},className:`manual-group-body-item ${J===D?"manual-group-body-item-selected":""}`,"data-href":J,href:`#${J}`,children:`${O}${R.prefix==="fun"?"()":""}`},J)})})]},R.key)})})]}),T.jsx("div",{ref:j,className:"manual-right manual-scroll",children:T.jsx(Py,{currentIndex:_,group:l,itemKey:D,onItemClick:C})})]})},Fy=a=>{var Q;const{onItemClick:s,item:r,prefix:n,value:o}=a,{t:l}=Ws(),[c,d]=S.useState(),[m,_]=S.useState(""),[g,x]=S.useState(0),[h,D]=S.useState(l("Copy code")),[z,P]=S.useState(l("Copy link"));S.useEffect(()=>{o&&(d(o),_(`${window.location.origin}/reference-manual/#${n}_${o==null?void 0:o.orirginalName}`))},[o]);const $=(q=0)=>{x(q),Qn(r,q).then(C=>{d(C),_(`${window.location.origin}/reference-manual/#${n}_${C==null?void 0:C.orirginalName}`)})},j=q=>{$(q)},W=q=>{var C,R;if(q.target.localName==="a"&&q.target.hash&&((R=(C=q.target)==null?void 0:C.dataset)!=null&&R.name)){q.preventDefault();const{hash:E}=q.target;s(E.replace("#",""))}},re=()=>{D(l("Copied")),setTimeout(()=>{D(l("Copy code"))},1e3)},V=()=>{P(l("Link copied")),setTimeout(()=>{P(l("Copy link"))},3e3)};return T.jsx("div",{onClick:W,id:`${n}_${c==null?void 0:c.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:c==null?void 0:c.name}),!!(c!=null&&c.overloads)&&T.jsx("span",{className:"manual-page-content-header-overloads",children:c==null?void 0:c.overloads})]}),T.jsx(Vs,{text:m,onCopy:V,children:T.jsx("div",{"data-tooltip":z,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"})]})})})})]}),(Q=c==null?void 0:c.desc)==null?void 0:Q.map((q,C)=>T.jsx("div",{dangerouslySetInnerHTML:{__html:q},className:"manual-page-content-text"},C)),(c==null?void 0:c.type)&&T.jsxs(S.Fragment,{children:[T.jsx("div",{className:"manual-page-content-sub-title",children:l("type")}),T.jsx("div",{className:"manual-page-content-text",children:c.type})]}),(c==null?void 0:c.syntax)&&T.jsxs(S.Fragment,{children:[T.jsxs("div",{className:"manual-page-content-sub-title",children:[l("syntax")," ",!!(c!=null&&c.overloads)&&`& ${l("overloads")}`]}),c.syntax.map((q,C)=>{var R;return(((R=c.syntax)==null?void 0:R.length)||0)>1?T.jsx("div",{onClick:()=>j(C),children:T.jsx("pre",{className:`manual-page-content-syntax with-overloads ${C===g?"selected":""}`,children:q})},C):T.jsx("pre",{className:"manual-page-content-syntax",children:q},C)})]}),(c==null?void 0:c.args)&&T.jsxs(S.Fragment,{children:[T.jsx("div",{className:"manual-page-content-sub-title",children:l("arguments")}),c.args.map((q,C)=>T.jsxs("div",{className:"manual-page-content-text",children:[T.jsx("span",{className:"manual-page-content-args-label",children:q.label})," ",T.jsx("span",{dangerouslySetInnerHTML:{__html:q.desc||""}})]},C))]}),(c==null?void 0:c.fields)&&T.jsxs(S.Fragment,{children:[T.jsx("div",{className:"manual-page-content-sub-title",children:l("fields")}),c.fields.map((q,C)=>T.jsxs("div",{className:"manual-page-content-text",children:[T.jsx("span",{className:"manual-page-content-args-label",children:q.label})," ",T.jsx("span",{dangerouslySetInnerHTML:{__html:q.desc||""}})]},C))]}),(c==null?void 0:c.examples)&&T.jsxs(S.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:l("example")})}),T.jsx(Vs,{text:c.originalExample||"",onCopy:re,children:T.jsx("div",{"data-tooltip":h,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:c.examples}})})]}),(c==null?void 0:c.detailedDesc)&&c.detailedDesc.map((q,C)=>T.jsxs(S.Fragment,{children:[q.desc.map((R,E)=>T.jsx("div",{className:"manual-page-content-text",dangerouslySetInnerHTML:{__html:R}},E)),T.jsxs("div",{className:"manual-page-content-sub-title manual-page-content-example-header",children:[T.jsx("div",{children:T.jsx("span",{children:l("example")})}),T.jsx(Vs,{text:q.originalExample||"",onCopy:re,children:T.jsx("div",{"data-tooltip":h,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:q.examples||""}})})]},C)),(c==null?void 0:c.returns)&&T.jsxs(S.Fragment,{children:[T.jsx("div",{className:"manual-page-content-sub-title",children:l("returns")}),c.returns.map((q,C)=>T.jsx("div",{className:"manual-page-content-text",dangerouslySetInnerHTML:{__html:q}},C))]}),(c==null?void 0:c.remarks)&&T.jsxs(S.Fragment,{children:[T.jsx("div",{className:"manual-page-content-sub-title",children:l("remarks")}),c.remarks.map((q,C)=>T.jsx("div",{className:"manual-page-content-text",dangerouslySetInnerHTML:{__html:q}},C))]}),(c==null?void 0:c.seeAlso)&&T.jsxs(S.Fragment,{children:[T.jsx("div",{className:"manual-page-content-sub-title",children:l("see also")}),T.jsx("div",{className:"manual-page-content-see_also",children:c.seeAlso.map((q,C)=>T.jsx("a",{className:"manual-page-content-see_also-tag","data-name":q==null?void 0:q.name,href:q==null?void 0:q.link,children:q==null?void 0:q.name},C))})]})]})})},By=({onItemClick:a,onGroupClick:s,selectedItemChange:r,selectItem:n,manualTabRef:o,searchRef:l})=>{const{t:c}=Ws(),[d,m]=S.useState(null),[_,g]=S.useState("");S.useEffect(()=>{var D;(D=l.current)==null||D.focus()},[l.current]);const x=D=>{if(D.target.value.trim()==="")h();else{g(D.target.value);const z=zl(D.target.value);m(z)}},h=()=>{var D;g(""),m(null),setTimeout(()=>{n.current&&r(n.current,!0)},10),(D=l.current)==null||D.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:x,ref:l,spellCheck:"false",value:_,className:"manual-page-search-input",autoComplete:"off",placeholder:c("search"),type:"text"}),T.jsx("span",{onClick:h,className:`manual-page-search-clear ${_?"":"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 ${_?"":"hide"}`,children:T.jsxs("div",{children:[d==null?void 0:d.labelList.map(D=>T.jsx("a",{onClick:z=>{z.preventDefault(),a(D.key,D.index,D.group)},className:"manual-page-group-body-item","data-href":D.key,href:`#${D.key}`,children:D.label},`search_${D.key}`)),T.jsx("div",{className:"manual-page-content-separator"}),d==null?void 0:d.contentList.map(D=>T.jsx("a",{onClick:z=>{z.preventDefault(),a(D.key,D.index,D.group)},className:"manual-page-group-body-item","data-href":D.key,href:`#${D.key}`,children:D.label},`search_${D.key}`))]})}),T.jsx("div",{className:`manual-page-group-list manual-page-scroll ${_?"hide":""}`,children:it.map(D=>{var z;return T.jsxs(S.Fragment,{children:[T.jsx("div",{onClick:()=>s(D),className:"manual-page-group-title manual-page-group-t",children:c(D.key)}),T.jsx("div",{className:"manual-page-group-body manual-page-group-b manual-page-scroll hide",children:(z=ks[D.key])==null?void 0:z.map((P,$)=>{const j=`${D.prefix}_${P}`;return T.jsx("a",{onClick:W=>{W.preventDefault(),a(j,$)},className:"manual-page-group-body-item","data-href":j,href:`#${j}`,children:`${P}${D.prefix==="fun"?"()":""}`},j)})})]},D.key)})})]})]})};Ae.languages.register({id:Re}),Ae.editor.defineTheme("vs-dark",ga),Ae.editor.defineTheme("vs",fa),Ae.languages.setMonarchTokensProvider(Re,Is),Ae.languages.setLanguageConfiguration(Re,_a);const Uy=({theme:a="vs-dark",language:s})=>{const{t:r,i18n:n}=Ws(),[o,l]=S.useState(),c=S.useRef(""),d=S.useRef(null),m=S.useRef(null),_=S.useRef(null),g=S.useRef(null),x=S.useRef(null),h=S.useRef(null),D=S.useRef(0),z=S.useRef({startTop:0,endTop:0,key:"var_bar_index",group:it[0],index:0}),P=E=>{var A;C(E),(A=d.current)==null||A.focus()};S.useEffect(()=>{var E;x.current||($(),D.current=((E=_.current)==null?void 0:E.offsetTop)||0)},[]);const $=async()=>{const E={};for(const A of it){const O=A.key,J=new Map;for(const se of ks[O]){const le=await Qn(nt[O].get(se)||[],0);le&&J.set(se,le)}E[O]=J}l(E)};S.useEffect(()=>{if(!x.current&&o){const E=window.location.hash;if(E){const A=E.replace(/^#/,""),[O]=A.split("_"),J=it.find(se=>se.prefix===O);if(J){C(J),V(A,!0),setTimeout(()=>{const se=document.getElementById(A);se==null||se.scrollIntoView(),se==null||se.classList.add("reference-item-selected")},10);return}}C(it[0]),setTimeout(()=>{R(it[0],"bar_index",0,92)},10)}},[o]),S.useEffect(()=>{Ae.editor.setTheme(a)},[a]),S.useEffect(()=>{s&&n.changeLanguage(s)},[s]),S.useEffect(()=>{var E;(E=d.current)==null||E.focus()},[d.current]);const j=(E,A,O)=>{var le,Y,oe,xe;if(E===c.current)return;O&&O.key!==((le=x.current)==null?void 0:le.key)&&C(O),V(E),window.location.href=`#${E}`;const[J,se]=W(E,A);z.current={startTop:J,endTop:se,group:O||x.current,index:A,key:E},(oe=(Y=g.current)==null?void 0:Y.classList)==null||oe.remove("manual-page-current-item-bg"),(xe=d.current)==null||xe.focus()},W=(E,A=0)=>{const O=document.getElementById(E),J=(O==null?void 0:O.offsetHeight)||0,se=A?0:78,le=((O==null?void 0:O.offsetTop)||0)-72-D.current;return[le-se,le+J]},re=(E,A)=>{var O;E.key!==((O=x.current)==null?void 0:O.key)&&C(E),V(A,!0)},V=(E,A=!1)=>{var J,se,le,Y;const O=(J=m.current)==null?void 0:J.querySelector(`a[data-href="${E}"]`);if(A&&(O==null||O.scrollIntoView({block:"nearest"})),(se=document.getElementById(c.current))==null||se.classList.remove("reference-item-selected"),(le=document.getElementById(E))==null||le.classList.add("reference-item-selected"),E===c.current){!(O!=null&&O.classList.contains("manual-page-group-body-item-selected"))&&(O==null||O.classList.add("manual-page-group-body-item-selected")),h.current=O;return}c.current=E,(Y=h.current)==null||Y.classList.remove("manual-page-group-body-item-selected"),O==null||O.classList.add("manual-page-group-body-item-selected"),h.current=O},Q=E=>{var O;const A=it.find(J=>E.startsWith(J.prefix));A&&(re(A,E),window.location.href=`#${E}`,(O=d.current)==null||O.focus())},q=S.useCallback(E=>{var Oe;const{startTop:A,endTop:O,index:J,group:se,key:le}=z.current;let Y=O,oe=A;Y||([oe,Y]=W(le,J),z.current={startTop:oe,endTop:Y,group:se,index:J,key:le}),se.key!==((Oe=x.current)==null?void 0:Oe.key)&&C(se);const xe=E.currentTarget.scrollTop;if(xe>=oe&&xe<Y)return;let pe=!1,_e=J,Ee=se.index,ee=ks[se.key],de=se;if(xe>=Y)for(;!pe;){_e++;const Ge=ee[_e];if(Ge)pe=R(de,Ge,_e,xe);else{if(Ee++,de=it[Ee],ee=ks[de==null?void 0:de.key],!ee){pe=!0;return}C(de),_e=-1}}else for(;!pe;)if(_e--,_e>=0){const Ge=ee[_e];pe=R(de,Ge,_e,xe)}else{if(Ee--,Ee<0){pe=!0;return}de=it[Ee],C(de),ee=ks[de==null?void 0:de.key],_e=ee.length}},[]),C=E=>{var le,Y,oe,xe,pe,_e,Ee,ee,de,Oe,Ge;const A=(le=x.current)==null?void 0:le.index,O=(Y=m.current)==null?void 0:Y.querySelectorAll(".manual-page-group-t"),J=(oe=m.current)==null?void 0:oe.querySelectorAll(".manual-page-group-b"),se=E.index;if((pe=(xe=J==null?void 0:J[A])==null?void 0:xe.classList)==null||pe.add("hide"),(Ee=(_e=O==null?void 0:O[A])==null?void 0:_e.classList)==null||Ee.remove("active"),A===se){x.current=null;return}else(de=(ee=O==null?void 0:O[se])==null?void 0:ee.classList)==null||de.add("active"),(Ge=(Oe=J==null?void 0:J[se])==null?void 0:Oe.classList)==null||Ge.remove("hide"),x.current=E},R=(E,A,O,J)=>{var oe,xe,pe;const se=`${E.prefix}_${A}`,[le,Y]=W(se,O);if(le<=J&&J<Y){z.current={startTop:le,endTop:Y,group:E,index:O,key:se};const _e=(oe=m.current)==null?void 0:oe.querySelector(`a[data-href="${se}"]`);return(pe=(xe=g.current)==null?void 0:xe.classList)==null||pe.remove("manual-page-current-item-bg"),g.current=_e,_e==null||_e.scrollIntoView({block:"nearest"}),_e==null||_e.classList.add("manual-page-current-item-bg"),!0}return!1};return T.jsxs("div",{ref:_,className:`${a} manual-page-warpper ${o?"show-warpper":""}`,children:[T.jsx(By,{onGroupClick:P,onItemClick:j,selectItem:c,manualTabRef:m,searchRef:d,selectedItemChange:V}),T.jsxs("div",{className:"manual-page-right",children:[T.jsx("div",{children:T.jsx("h1",{className:"manual-page-title",children:r("Mine Script® v1 Reference Manual")})}),T.jsx("div",{onScroll:q,className:"manual-page-scroll manual-page-scroll-none",children:it.map(E=>T.jsxs(S.Fragment,{children:[T.jsx("h2",{className:"manual-page-header",children:r(E.key)}),T.jsx("div",{children:ks[E.key].map(A=>{var O;return T.jsx(Fy,{item:nt[E.key].get(A)||[],value:(O=o==null?void 0:o[E.key])==null?void 0:O.get(A),prefix:E.prefix,onItemClick:Q},A)})})]},E.key))})]})]})};L.ReferenceManual=Ry,L.ReferenceManualPage=Uy,L.TradingVueDiffEditor=gy,L.TradingVueEditor=fy,L.parseLibrary=Mm,L.parseTcc=ml,L.removeScript=Pm,L.scriptsRun=Om,Object.defineProperty(L,Symbol.toStringTag,{value:"Module"})});
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@guihz/trading-vue-editor-tes",
3
- "version": "0.0.225",
3
+ "version": "0.0.226",
4
4
  "type": "module",
5
5
  "files": [
6
6
  "lib"