@guihz/trading-vue-editor-tes 0.0.148 → 0.0.150

Sign up to get free protection for your applications and to get access to all the features.
@@ -17,9 +17,9 @@ export declare class Log {
17
17
  constructor(variables: BuiltInVariables);
18
18
  get logs(): ILog[];
19
19
  clearLogs(): void;
20
- info(args: ILogArgs, replaces: (string | number)[], posStr: string): void;
21
- error(args: ILogArgs, replaces: (string | number)[], posStr: string): void;
22
- warning(args: ILogArgs, replaces: (string | number)[], posStr: string): void;
20
+ info(args: ILogArgs, replaces: (string | number | string[] | number[])[], posStr: string): void;
21
+ error(args: ILogArgs, replaces: (string | number | string[] | number[])[], posStr: string): void;
22
+ warning(args: ILogArgs, replaces: (string | number | string[] | number[])[], posStr: string): void;
23
23
  private _addLog;
24
24
  }
25
25
  export {};
@@ -23,6 +23,7 @@ export interface IKeyObjectValue {
23
23
  [key: string]: any;
24
24
  }
25
25
  export interface IDocValue {
26
+ hasAssigned?: boolean;
26
27
  name: string;
27
28
  title?: string;
28
29
  desc?: string[];
@@ -61366,11 +61366,13 @@ class Dx {
61366
61366
  let b = "";
61367
61367
  for (; c >= 0; ) {
61368
61368
  const h = n.charAt(c);
61369
- if (!(/\s/.test(h) && !b)) {
61370
- if (/[^\w.]/.test(h))
61371
- break;
61372
- c -= 1, b = h + b;
61369
+ if (/\s/.test(h) && !b) {
61370
+ c -= 1;
61371
+ continue;
61373
61372
  }
61373
+ if (/[^\w.]/.test(h))
61374
+ break;
61375
+ c -= 1, b = h + b;
61374
61376
  }
61375
61377
  if (b)
61376
61378
  return {
@@ -67589,14 +67591,14 @@ function nr(a, n, r) {
67589
67591
  function oh() {
67590
67592
  return new Array(4).fill(0).map(() => Math.floor(Math.random() * Number.MAX_SAFE_INTEGER).toString(16)).join("-");
67591
67593
  }
67592
- const Fp = new Worker(new URL("" + new URL("assets/scriptsRunWorker-C9KtHX5_.js", import.meta.url).href, import.meta.url), { type: "module", name: "Run TccScript Server" });
67594
+ const Fp = new Worker(new URL("" + new URL("assets/scriptsRunWorker-CgFdwuHM.js", import.meta.url).href, import.meta.url), { type: "module", name: "Run TccScript Server" });
67593
67595
  Fp.onerror = (a) => {
67594
67596
  console.error(a);
67595
67597
  };
67596
67598
  async function Rp(a) {
67597
67599
  return await Ja.setInlayHints(a);
67598
67600
  }
67599
- const Bp = ji(Fp), Kp = ji(new Worker(new URL("" + new URL("assets/parserTccWorker-C6iZakQ2.js", import.meta.url).href, import.meta.url), { type: "module", name: "Parser TccScript Server" }));
67601
+ const Bp = ji(Fp), Kp = ji(new Worker(new URL("" + new URL("assets/parserTccWorker-CqmFqEoS.js", import.meta.url).href, import.meta.url), { type: "module", name: "Parser TccScript Server" }));
67600
67602
  async function lh(a, n = !1) {
67601
67603
  const { functions: r, types: o, constants: c, variables: l, methods: m } = xt;
67602
67604
  return await Kp.parseTcc(a, n, Hi(Rp), { functions: Object.fromEntries(r), methods: Object.fromEntries(m), types: Object.fromEntries(o), constants: Object.fromEntries(c), variables: Object.fromEntries(l) });
@@ -108,7 +108,7 @@ else
108
108
 
109
109
  `}bold(n){return`**${n}**`}italic(n){return`*${n.replace(">","&gt;").replace("<","&lt;")}*`}pineCode(n){return`\`\`\`
110
110
  ${n}
111
- \`\`\``}code(n){return`\`${n}\``}paragraph(...n){return[this.paragraphBreak,...n,this.paragraphBreak].join(this.lineBreak)}link(n,s){return`[${n}](${s.href})`}}const ie=new Td;function Dd(a){const{name:n,libraryName:s,desc:o}=a,c=[`${ie.bold(n||s)} (library)`];return c.push(ie.delimiter),o&&c.push(ie.paragraph(ie.bold(tt.Description),ie.lineBreak,o)),c.join(c.length===2?" ":ie.lineBreak)}function kd(a,n=0,s=!0){const o=a[n];if(!o)return"";if(o.isEnumMember)return`${ie.bold(o.name)} (enum member)${o.value===void 0?"":` = ${o.value}`}`;const c=/(Mac|iPhone|iPod|iPad)/i.test(window.navigator.userAgent),{name:l,title:m,desc:_,type:f,syntax:b,returns:h,remarks:T,fields:P,members:B}=o,R=[`${ie.bold(l)} (${m})`];if(a.length>1&&R.push(ie.italic(`+${a.length-1} overloads`)),R.push(ie.delimiter),_&&R.push(ie.paragraph(Array.isArray(_)?_.join(ie.lineBreak):_||"")),f&&R.push(ie.paragraph(ie.bold(tt.Type),ie.italic(f))),b&&b.length&&R.push(ie.paragraph(ie.bold(tt.Syntax),ie.pineCode(b.join(ie.lineBreak)))),h&&R.push(ie.paragraph(ie.bold(tt.Returns),ie.lineBreak,h.join(ie.lineBreak))),T&&T.length&&a.length<=1){let S="";typeof T=="string"?S=T:S=T.join(ie.lineBreak)||"",S.length<200&&R.push(ie.paragraph(ie.bold(tt.Remarks),ie.lineBreak,S))}if(P){const S=[];for(const H of P){const V=H.desc?` - ${H.desc}`:"";S.push(`${H.name} (${H.type})${V}`)}R.push(ie.paragraph(ie.bold(tt.Fields),ie.lineBreak,S.join(ie.paragraphBreak)))}if(B){const S=[];for(const H of B){const V=H.desc?` - ${H.desc}`:"";S.push(`${H.name}${H.value?` (${H.value})`:""}${V}`)}R.push(ie.paragraph(ie.bold(tt.EnumMembers),ie.lineBreak,S.join(ie.paragraphBreak)))}return s&&R.push(ie.italic(`${ie.code(c?"⌘":"Ctrl")} + ${xd.clickOnKeywordForMoreHelp}`)),R.join(R.length===2?" ":ie.lineBreak)}const nn="tcc_cursor_position",Id=["submenuitem.EditorContextPeek","editor.action.peekDefinition"];function Ad(a){return a.replace(/<[^<>]+>/,"").replace(/(series|simple|const|input)\s+([\w\d.]+)/,"$2").replace(/\w[\w.\d]*\[\]/,"array")}function qd(a){const n=a.getContribution("editor.contrib.contextmenu"),s=n==null?void 0:n._getMenuActions;n._getMenuActions=function(){return s.apply(n,arguments).filter(function(c){return!Id.includes(c.id)})}}class Cd{constructor(){Object.defineProperty(this,"bracketsPostfix",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_builtinSubtreeCache",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_formatter",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_namespaceCache",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_suggestions",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_outermostNsItems",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_funcArgsCache",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_userSuggestions",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_userFuncArgsCache",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_userNamespaceCache",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_userOutermostNsItems",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_methodNamespaceCache",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_userMethods",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_userFunctions",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_methodFuncs",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_userTypes",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_userEnums",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_nextIsBracket",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.bracketsPostfix="(${0})",this._builtinSubtreeCache={},this._formatter=ie,this._namespaceCache=new Map,this._suggestions=[],this._outermostNsItems=new Map,this._funcArgsCache=new Map,this._userSuggestions=[],this._userFuncArgsCache=new Map,this._userNamespaceCache=new Map,this._userOutermostNsItems=new Map,this._methodNamespaceCache=new Map,this._userMethods=new Map,this._userTypes=new Map,this._methodFuncs=new Map,this._userFunctions=new Map,this._userEnums=new Map,this._nextIsBracket=!1}get methodFuncs(){return this._methodFuncs}get userFuncs(){return this._userFunctions}get userEnums(){return this._userEnums}set nextIsBracket(n){this._nextIsBracket=n}get nextIsBracket(){return this._nextIsBracket}get annotationSuggestions(){return this._getAnnotationCompletionItems(this._builtinSubtreeCache.annotations)}initBuiltinsTrees(){this._getBuiltinsCacheFragment(),this._suggestions=this._getAllCompletionItems(),this._getFuncArgumentsCompletionItemsToCache(this._builtinSubtreeCache.functions)}getArgSuggestions(n){return this._funcArgsCache.get(n)||this._userFuncArgsCache.get(n)}getSuggestions(n){return n?this._namespaceCache.get(n)||this._userNamespaceCache.get(n):this._suggestions.concat(this._userSuggestions)}_initUserDefind(){this._userFuncArgsCache.clear(),this._userNamespaceCache.clear(),this._userOutermostNsItems.clear(),this._methodNamespaceCache.clear(),this._methodFuncs.clear()}setUserDefind(n,s,o,c,l){this._initUserDefind();const m=this._mergeTreeSlices(this._generateTreeSlice(ct.methods,"method"),this._generateTreeSlice(c,"method"));this._getMethodNamespaceCache(m),this._userMethods=c,this._userTypes=s,this._userFunctions=n,this._userEnums=l;const _=this._generateTreeSlice(n,"fun");this._userSuggestions=this._getAllUserCompletionItems(_,this._generateTreeSlice(s,"type"),this._generateTreeSlice(o,"var"),this._generateTreeSlice(l,"enum")),this._getUserFuncArgumentsCompletionItemsToCache(_)}_getAllUserCompletionItems(n,s,o,c){const l=this._getEnumCompletionItems(c),m=this._getUserVariableCompletionItems(o),_=this._getTypeCompletionItems(s,!0),f=this._getFunctionCompletionItems(n,void 0,!0);return[..._,...f,...m,...l,...this._userOutermostNsItems.values()]}_getAllCompletionItems(){const{variables:n,keywords:s,types:o,functions:c}=this._builtinSubtreeCache,l=this._getVariableCompletionItems(n),m=this._getKeywordCompletionItems(s),_=this._getTypeCompletionItems(o),f=this._getFunctionCompletionItems(c),b=this._getSnippetsCompletionsList();return[...l,...m,..._,...f,...this._outermostNsItems.values(),...b]}_getNodeKey(n,s){return`${s}_${n}`}_mergeTreeSlices(...n){const s=new Map;for(const o of n)for(const[c,l]of o){const m=s.get(c);m?s.set(c,{...m,children:this._mergeTreeSlices(l.children,m.children)}):s.set(c,l)}return s}_mergeCompletions(n,s){const o=this._namespaceCache.get(n);o?this._namespaceCache.set(n,[...o,...s]):this._namespaceCache.set(n,s)}_mergeUserCompletions(n,s){const o=this._userNamespaceCache.get(n);o?this._userNamespaceCache.set(n,[...o,...s]):this._userNamespaceCache.set(n,s)}_generateTreeSlice(n,s){const o=new Map;for(const[c,l]of n){const[m,..._]=c.split("."),f=_.length>0,b=o.get(this._getNodeKey(m,f?"ns":s));let h=new Map,T=l.map(B=>({...B,name:c})),P=this._getNodeKey(c,s);if(f&&s!=="type"){const B=new Map([[_.join("."),l]]);T=[{name:m,title:ge.namespace}],P=this._getNodeKey(m,"ns"),h=this._generateTreeSlice(B,s)}b&&(T=[{name:m,title:ge.namespace}],h=this._mergeTreeSlices(b.children,h)),o.set(P,{value:T,children:h})}return o}_getBuiltinsCacheFragment(){const{keywords:n,variables:s,constants:o,types:c,functions:l,annotations:m}=ct,_=this._generateTreeSlice(m,"an");return _.delete("an_@version="),this._builtinSubtreeCache={keywords:this._generateTreeSlice(n,"key"),variables:this._mergeTreeSlices(this._generateTreeSlice(s,"var"),this._generateTreeSlice(o,"var")),types:this._generateTreeSlice(c,"type"),functions:this._generateTreeSlice(l,"fun"),annotations:_},this._builtinSubtreeCache}_getVariableCompletionItems(n,s){const o=[],c=[];for(const[l,m]of n){const{value:_,children:f}=m;if(l.startsWith("ns")){const b=this._getNamespaceCompletionItem(_[0]);if(s){c.push({...b});const T=`${s}.${b.label}`;b.label=T,b.insertText=T}const h=this._getVariableCompletionItems(f,b.label);s||this._outermostNsItems.set(l,b),o.push(...h)}else{const b=this._getVariableCompletionItem(_[0],s?3:2);if(s){c.push({...b});const{label:h}=b;b.label=`${s}.${h}`,b.insertText=`${s}.${b.insertText}`,b.filterText=`${h}\r`}o.push(b)}}return c.length&&s&&this._mergeCompletions(s,c),o}_setUserVariableSubItems(n,s){var b,h,T,P;let o=[];const c=Ad(n.type||""),l=this._methodNamespaceCache.get(c),m=s?`${s}.${n.name}`:n.name;l&&(o=l.filter(B=>{var V;const R=`${c}.${B.label}`,S=ct.methods.get(R)||this._userMethods.get(R),H=S==null?void 0:S.some(G=>!G.thisType||G.thisType[0].includes("<>")||G.thisType.includes(n.type||""));if(H&&S){const G=this._getNamedArgumentsCompletionList(((V=S[0])==null?void 0:V.args)||[]),U=`${m}.${B.label}`;this._userFuncArgsCache.set(U,G),this._methodFuncs.set(U,S)}return H}));const{types:_}=ct,f=((h=(b=this._userTypes.get(c))==null?void 0:b[0])==null?void 0:h.fields)||((P=(T=_.get(c))==null?void 0:T[0])==null?void 0:P.fields);if(f)for(const B of f){const R=B.name,S=B.type,H=this._getInstanceTypeCompletionItemProp({name:R,type:S,desc:B.desc?[B.desc]:void 0});this._setUserVariableSubItems({name:R,type:S},n.name),o.push({...H})}o.length&&this._mergeUserCompletions(m,o)}_getUserVariableCompletionItems(n,s){const o=[],c=[];for(const[l,m]of n){const{value:_,children:f}=m;if(this._setUserVariableSubItems(_[0]),l.startsWith("ns")){const b=this._getNamespaceCompletionItem(_[0]);if(s){c.push({...b});const T=`${s}.${b.label}`;b.label=T,b.insertText=T}const h=this._getUserVariableCompletionItems(f,b.label);s||this._userOutermostNsItems.set(l,b),o.push(...h)}else{const b=this._getVariableCompletionItem(_[0],s?2:1,!1);if(s){c.push({...b});const{label:h}=b;b.label=`${s}.${h}`,b.insertText=`${s}.${b.insertText}`,b.filterText=`${h}\r`}o.push(b)}}return c.length&&s&&this._mergeUserCompletions(s,c),o}_getTypeCompletionItems(n,s=!1){const o=[];for(const[,c]of n){const{value:l}=c,m=s?this._getCustomTypeCompletionItem(l[0]):this._getTypeCompletionItem(l[0]);o.push(m)}return o}_getEnumCompletionItems(n){const s=[];for(const[,o]of n){const{value:c}=o,l=this._getEnumCompletionItem(c[0]);s.push(l);const m=c[0].members;m!=null&&m.length&&this._getEnumMemberCompletionItems(c[0].name,m)}return s}_getEnumMemberCompletionItems(n,s){const o=[];for(const c of s){const{name:l,desc:m,value:_}=c,f=this._getEnumMemberCompletionItem({name:l,desc:m?[m]:void 0,value:_});o.push(f)}o.length&&this._mergeUserCompletions(n,o)}_getAnnotationCompletionItems(n){const s=[];for(const[,o]of n){const{value:c}=o,l=this._getAnnotationCompletionItem(c[0]);s.push(l)}return s}_getKeywordCompletionItems(n){const s=[];for(const[,o]of n){const{value:c}=o,l=this._getKeywordCompletionItem(c[0]);s.push(l)}return s}_getMethodNamespaceCache(n,s){const o=[];for(const[c,l]of n){const{value:m,children:_}=l;if(c.startsWith("ns")){const f=this._getNamespaceCompletionItem(m[0]);if(s){o.push({...f});const b=`${s}.${f.label}`;f.label=b,f.insertText=b}this._getMethodNamespaceCache(_,f.label)}else{const f=this._getFunctionCompletionItem(m[0],s?3:2);if(m.length>1&&(f.detail=`${f.detail} (+${m.length-1} overloads)`),s){o.push({...f});const{label:b}=f;f.label=`${s}.${b}`,f.insertText=`${s}.${f.insertText}`,f.originInsertText=`${s}.${f.originInsertText}`,f.filterText=`${b}\r`}}}s&&this._methodNamespaceCache.set(s,o)}_getFunctionCompletionItems(n,s,o=!1){const c=[],l=[];for(const[m,_]of n){const{value:f,children:b}=_;if(m.startsWith("ns")){const h=this._getNamespaceCompletionItem(f[0]);if(s){l.push({...h});const P=`${s}.${h.label}`;h.label=P,h.insertText=P}const T=this._getFunctionCompletionItems(b,h.label,o);s||(o?this._userOutermostNsItems.set(m,h):this._outermostNsItems.set(m,h)),c.push(...T)}else{const h=this._getFunctionCompletionItem(f[0],s?3:2,!o);if(f.length>1&&(h.detail=`${h.detail} (+${f.length-1} overloads)`),s){l.push({...h});const{label:T}=h;h.label=`${s}.${T}`,h.insertText=`${s}.${h.insertText}`,h.originInsertText=`${s}.${h.originInsertText}`,h.filterText=`${T}\r`}c.push(h)}}return l.length&&s&&(o?this._mergeUserCompletions(s,l):this._mergeCompletions(s,l)),c}_getSnippetsCompletionsList(){return bd.map(n=>{const{label:s,kind:o,insertText:c}=n,l=s.charAt(0).toUpperCase()+s.substring(1),m={value:this._formatter.pineCode(c.replace(/\${\d:([^}]+)}|\${\d}/g,"$1"))};return{label:s,detail:`(${l} ${o})`,insertText:c,insertTextRules:Ie.languages.CompletionItemInsertTextRule.InsertAsSnippet,sortText:`2_${s}`,kind:Ie.languages.CompletionItemKind.Snippet,documentation:m}})}_getFuncArgumentsCompletionItemsToCache(n,s){for(const[o,c]of n){const{name:l}=c.value[0];if(o.startsWith("ns"))this._getFuncArgumentsCompletionItemsToCache(c.children,s?`${s}.${l}`:l);else{const m=new Map;c.value.reduce((b,h)=>{const T=h.args;return T&&T.length&&T.forEach(P=>{b.set(P.name,P)}),b},m);const _=this._getNamedArgumentsCompletionList([...m.values()]),f=s?`${s}.${l}`:l;this._funcArgsCache.set(f,_)}}}_getUserFuncArgumentsCompletionItemsToCache(n,s){for(const[o,c]of n){const{name:l}=c.value[0];if(o.startsWith("ns"))this._getUserFuncArgumentsCompletionItemsToCache(c.children,s?`${s}.${l}`:l);else{const m=new Map;c.value.reduce((b,h)=>{const T=h.args;return T&&T.length&&T.forEach(P=>{b.set(P.name,P)}),b},m);const _=this._getNamedArgumentsCompletionList([...m.values()]),f=s?`${s}.${l}`:l;this._userFuncArgsCache.set(f,_)}}}_getNamedArgumentsCompletionList(n){return n.map(s=>{const{name:o,desc:c,displayType:l}=s,m=`${o} = `,_=Array.isArray(c)?c.join(this._formatter.delimiter):c||"";return{label:m,documentation:{value:this._formatter.paragraph(this._formatter.bold(ge.Description),this._formatter.lineBreak,_)},insertText:m,detail:`(${ge.parameter}) ${ge.types} ${l}`,kind:Ie.languages.CompletionItemKind.Text,sortText:`0_${m}`}})}_getVariableCompletionItem(n,s=2,o=!0){const c=this._extractExamples(n),l=this._extractDescription(n),m=[this._createDescriptionSection(l)];c.length?m.push(this._createExampleSection(c)):n.syntax&&n.syntax.length&&m.push(this._createSyntaxSection(n.syntax));const _={value:m.join(this._formatter.lineBreak)},f=o?ge.variables:ge.userDefinedVariable;return{documentation:_,label:n.name,insertText:n.name,kind:Ie.languages.CompletionItemKind.Variable,sortText:`${s}_${n.name}`,detail:`(${f}) ${n.type}`}}_getKeywordCompletionItem(n,s=2){const o=this._extractExamples(n),c=this._extractDescription(n),l=[this._createDescriptionSection(c)];return o.length?l.push(this._createExampleSection(o)):n.syntax&&n.syntax.length&&l.push(this._createSyntaxSection(n.syntax)),{documentation:{value:l.join(this._formatter.lineBreak)},label:n.name,insertText:n.name,kind:Ie.languages.CompletionItemKind.Keyword,sortText:`${s}_${n.name}`,detail:`(${ge.keywords})`}}_getTypeCompletionItem(n){const s=this._extractDescription(n);return{documentation:{value:this._createDescriptionSection(s)},label:n.name,insertText:n.name,kind:Ie.languages.CompletionItemKind.Keyword,sortText:`1_${n.name}`,detail:`(${ge.types})`}}_getCustomTypeCompletionItem(n){const s=this._extractDescription(n);return{documentation:{value:this._createDescriptionSection(s)},label:n.name,insertText:n.name,kind:Ie.languages.CompletionItemKind.Keyword,sortText:`2_${n.name}`,detail:`(${ge.userDefinedType})`}}_getEnumCompletionItem(n){const s=this._extractDescription(n);return{documentation:{value:this._createDescriptionSection(s)},label:n.name,insertText:n.name,kind:Ie.languages.CompletionItemKind.Enum,sortText:`2_${n.name}`,detail:`(${ge.enum})`}}_getEnumMemberCompletionItem(n){const s=this._extractDescription(n);return{documentation:{value:this._createDescriptionSection(s)},label:n.name,insertText:n.name,kind:Ie.languages.CompletionItemKind.EnumMember,sortText:`2_${n.name}`,detail:`(enum member) ${n.value?`${n.name} = ${n.value}`:`${n.name}`}`}}_getInstanceTypeCompletionItemProp(n){const s=this._extractDescription(n),o=[];return s&&o.push(this._formatter.paragraph(this._formatter.bold(tt.Description),this._formatter.lineBreak,s)),{documentation:{value:o.join(this._formatter.lineBreak)},label:n.name,insertText:n.name,kind:Ie.languages.CompletionItemKind.Field,sortText:`2_${n.name}`,detail:`(${ge.field}) ${n.type}`}}_getFunctionCompletionItem(n,s=2,o=!0){var B;const c=n.returnedTypes&&n.returnedTypes[0]||n.syntax&&n.syntax[0]&&((B=n.syntax[0].split("→").pop())==null?void 0:B.trim()),l=this._extractExamples(n),m=this._extractDescription(n),_=[this._createDescriptionSection(m)];l.length?_.push(this._createExampleSection(l)):n.syntax&&n.syntax.length&&_.push(this._createSyntaxSection(n.syntax)),n.returns&&n.returns.length&&_.push(this._createReturnSection(n.returns));const f={value:_.join(this._formatter.lineBreak)},b=n.name,h=o?ge.functions:ge.userDefinedFunction,T=n.template,P=T?`${vd(b)}<\${1}>`:b;return{documentation:f,label:T?`${b.replace(/<.+>/,"")}<type>`:b,kind:Ie.languages.CompletionItemKind.Function,sortText:`${s}_${b}`,insertTextRules:Ie.languages.CompletionItemInsertTextRule.InsertAsSnippet,insertText:P+this.bracketsPostfix,originInsertText:P,detail:`(${h}) ${ge.returns} ${c}`,command:{id:"tcc.editor.function",title:"",arguments:[T?"editor.action.triggerSuggest":"editor.action.triggerParameterHints"]}}}_getAnnotationCompletionItem(n){const s=this._extractDescription(n),o=this._extractExamples(n),c=[this._createDescriptionSection(s)];return o.length&&c.push(this._createExampleSection(o)),{documentation:{value:c.join(this._formatter.lineBreak)},label:n.name,insertText:n.name.replace("@",""),kind:Ie.languages.CompletionItemKind.Keyword,detail:`(${ge.annotations})`}}_getNamespaceCompletionItem(n,s=2){const o=[this._createDescriptionSection(ge.namespaceDesc)];return{label:n.name,documentation:{value:o.join(this._formatter.lineBreak)},detail:`(${ge.namespace}) ${n.name}`,insertText:n.name,sortText:`${s}_${n.name}`,kind:Ie.languages.CompletionItemKind.Module}}_extractExamples(n){let s;return n.examples||n.detailedDesc&&((s=n.detailedDesc[0])===null||s===void 0?void 0:s.examples)||[]}_extractDescription(n){return Array.isArray(n.desc)?n.desc.join(this._formatter.lineBreak):n.desc||""}_createExampleSection(n){return this._formatter.paragraph(this._formatter.bold(tt.Example),this._formatter.pineCode(n.join(this._formatter.lineBreak)))}_createSyntaxSection(n){return this._formatter.paragraph(this._formatter.bold(tt.Syntax),this._formatter.pineCode(n.join(this._formatter.lineBreak)))}_createReturnSection(n){return this._formatter.paragraph(this._formatter.bold(tt.Returns),this._formatter.lineBreak,n.join(this._formatter.lineBreak))}_createDescriptionSection(n){return!n||n.trim().length===0?"":this._formatter.paragraph(this._formatter.bold(tt.Description),this._formatter.lineBreak,n)}}const St=new Cd;class zd{constructor(){Object.defineProperty(this,"_userFunctions",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_userVariables",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_userTypes",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_userMethods",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_userEnums",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_imports",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_overloadsFuncs",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this._userFunctions=new Map,this._userVariables=new Map,this._userTypes=new Map,this._userMethods=new Map,this._imports=new Map,this._userEnums=new Map,this._overloadsFuncs=[]}get overloadsFuncs(){return this._overloadsFuncs}setUserDefined(n,s){const{functions:o,variables:c,types:l,methods:m,imports:_,enums:f}=n;o&&(this._userFunctions=o),c&&(this._userVariables=c),l&&(this._userTypes=l),m&&(this._userMethods=m),_&&(this._imports=_),f&&(this._userEnums=f),this._overloadsFuncs=s}parseLineContentFuncVar(n,s,o,c){let l=(o==null?void 0:o.getLineContent(s))||"";const m=l.indexOf("//");if(this._removeString(l).indexOf("//")!==-1&&m<=n)return;l=l+" ";const _=this._getVariablesDocVal(l,n,s);if(_){if(_.isBuildIn){const h=o==null?void 0:o.getWordAtPosition(c||new Ie.Position(s,n));if(((o==null?void 0:o.getValueInRange({startLineNumber:s,startColumn:(h==null?void 0:h.endColumn)||0,endLineNumber:s,endColumn:((h==null?void 0:h.endColumn)||0)+2}))||"").trim().startsWith("="))return null}return _}const f=this._getFuncsDocVal(l,n,s);if(f)return f;const b=l.match(/[a-zA-Z_][a-zA-Z_0-9]*(\s*\.\s*[a-zA-Z_][a-zA-Z_0-9]*)*(?=\s*<)/g);if(b){const h=this._matchContent(b,l,n);if(h){const T=this._getBuildInOther(h.name);if(T)return{docValue:T,isBuildIn:!0,index:0};{const P=this._getBuildInFunc(`${h.name}<type>`);if(P)return{docValue:P,isBuildIn:!0,index:0}}}}return this._getImportDocVal(l,n,s)}_getImportDocVal(n,s,o){const c=new RegExp("(?<=(import(\\s+)))([a-zA-Z\\d\\$_\\-\\.\\u00a1-\\uffff\\/]+)","g"),l=new RegExp("(?<=(as\\b)(\\s+))([a-zA-Z\\d\\_\\u00a1\\uffff\\/]+)","g"),m=n.match(c);if(m){const _=this._matchContent(m,n,s);if(_){const b=this._imports.get(_.name);if(b)return b}const f=n.match(l);if(f){const b=this._matchContent(f,n,s);if(b){for(const[h,T]of this._imports)if(T.name===b.name)return T}}}return null}_getBuildInFunc(n){return ct.functions.get(n)}_getBuildInMethod(n){return ct.methods.get(n)}_getBuildInOther(n){const{keywords:s,variables:o,constants:c,types:l}=ct;return s.get(n)||o.get(n)||c.get(n)||l.get(n)}parseCurrentInputFunc(n,s=!1,o=!1){let c=n.length-1,l=0,m=s,_=o;for(;c>=0;){const f=n.charAt(c);if(c-=1,/['"]/.test(f)){const b=f;if(f==="'"){if(m){m=!1;continue}}else if(_){_=!1;continue}for(;c>=0;){const h=n.charAt(c);if(c-=1,h===b)break}}if(!(m||_)&&(/\)/.test(f)&&(l+=1),/\(/.test(f))){if(l>0){l-=1;continue}let b="";for(;c>=0;){const h=n.charAt(c);if(!(/\s/.test(h)&&!b)){if(/[^\w.]/.test(h))break;c-=1,b=h+b}}if(b)return{funcName:b,startIndex:c+1}}}}parseCurrentInputFuncAndArg(n,s=!1,o=!1){const{funcName:c,startIndex:l}=this.parseCurrentInputFunc(n,s,o)||{};if(c&&typeof l=="number"){let m=n.slice(l+c.length).trim().slice(1),_=-1;if(s&&(_=m.lastIndexOf("'")),o){const h=m.lastIndexOf('"');(h!==-1&&h<_||_===-1)&&(_=h)}_!==-1&&(m=m.substring(0,_));const b=m.replace(/[\w.]+\(.*\)/g,"").split(",").map(h=>{const T=h.trim().split("=");return T.length<=1?"":T[0].trim()});return{startIndex:l,funcName:c,args:b}}}_removeString(n){return n.replace(/\\"|\\'/g,"").replace(/"[^"]*"|'[^']*'/g,"")}_getVariablesDocVal(n,s,o){const c=this._removeString(n).replace(/\/\/.*/g,"").match(/[a-zA-Z_][a-zA-Z_0-9]*(\s*\.\s*[a-zA-Z_][a-zA-Z_0-9]*)*(?=\s*[^(a-zA-Z_0-9."'<])/g);if(c){const l=this._matchContent(c,n,s);if(l){const m={docValue:void 0,isBuildIn:!0,index:0},_=this._getBuildInOther(l.name);if(_)return m.docValue=_,m;const f=this._getUserVariablesDocVal(l.name,s,o);if(f)return Object.assign(m,{docValue:[f],isBuildIn:!1});const b=this._getUserTypesDocVal(l.name);if(b)return Object.assign(m,{docValue:b,isBuildIn:!1});const h=this._getTypesAndFileds(n,l.name,s,o);if(h&&typeof h!="string")return Object.assign(m,{docValue:[h],isBuildIn:!1});const T=this._getUserEnumsDocVal(l,s);if(T)return Object.assign(m,{docValue:T,isBuildIn:!1})}}}_getUserVariablesDocVal(n,s,o){const m=[...this._userVariables.get(n)||[]].sort((_,f)=>(f.scope||0)-(_.scope||0)).find(_=>{const f=_.range;return((f==null?void 0:f.startColumn)||0)<=s&&((f==null?void 0:f.startLineNumber)||0)<=o&&((f==null?void 0:f.endLineNumber)||0)>=o});if(m)return m.title=ge.userDefinedVariable,m.type=this._arrayTypeTransform(m.type),m}_getUserTypesDocVal(n){const s=this._userTypes.get(n);if(s)return s[0].title=ge.userDefinedType,s}_getUserEnumsDocVal(n,s){var f;const{endIndex:o,name:c}=n,l=c.split(".");let m=l[0];l.length>2&&(m=l.slice(0,2).join("."));const _=this._userEnums.get(m);if(_&&_.length){_[0].title=ge.enum;const b=l[l.length-1],h=(f=_[0].members)==null?void 0:f.find(T=>T.name===b);if(!h||s<o-b.length)return _;if(s>o-b.length)return[h]}}_getTypesAndFileds(n,s,o,c){var l,m;if(s.includes(".")){const _=s.split(".");let f=_[0],b,h=null,T=n.indexOf(s,o-s.length)+1,P=T+f.length-1;for(const B of _.slice(1)){if(!h){const R=T<=o&&P>=o,S=this._getUserVariablesDocVal(f,o,c);if(R&&S)return S;h=S==null?void 0:S.type}if(h){b=h,T=P+2,P=P+B.length+1;const R=this._userTypes.get(h)||ct.types.get(h),S=(m=(l=R==null?void 0:R[0])==null?void 0:l.fields)==null?void 0:m.find(H=>H.name===B);if(S&&T<=o&&P>=o)return{name:`${h}.${B}`,desc:S.desc,type:this._arrayTypeTransform(S.type),title:ge.field};h=S==null?void 0:S.type}else f=`${f}.${B}`,P=P+B.length+1}return b}}_getFuncsDocVal(n,s,o){const c=n.match(/[a-zA-Z_][a-zA-Z_0-9]*(\s*\.\s*[a-zA-Z_][a-zA-Z_0-9]*)*(?=\s*\()/g);if(c){const l=this._matchContent(c,n,s);if(l){const m={docValue:void 0,isBuildIn:!0,endIndex:l.endIndex,index:0},_=this._getBuildInFunc(l.name);if(_)return m.index=this._getOverloadsFuncIndex(_,s,l.name,o),Object.assign(m,{docValue:_});const f=this._getUserFuncsDocVal(l.name);if(f)return m.index=this._getOverloadsFuncIndex(f,s,l.name,o),Object.assign(m,{docValue:f,isBuildIn:!1});const b=this._getUserVarFuncsDocVal(n,l.name,s,o);if(b)return Object.assign(m,{docValue:[b],isBuildIn:!1})}}}_getOverloadsFuncIndex(n,s,o,c){if(n.length>1){const l=this._overloadsFuncs.find(m=>m.name===o&&m.line===c&&m.startColumn<=s&&m.endColumn>=s);if(l)return l.index}return 0}_getUserFuncsDocVal(n){const s=this._userFunctions.get(n);if(s){for(const o of s)o.title=ge.userDefinedFunction;return s}}_getUserMethodsDocVal(n){const s=this._userMethods.get(n);if(s){for(const o of s)o.title=ge.userDefinedFunction;return s}}_getUserVarFuncsDocVal(n,s,o,c){var l;if(s.includes(".")){const m=s.split("."),_=this._getTypesAndFileds(n,s,o,c);if(typeof _=="string"){const b=`${this._arrayTypeTransform(_).replace(/<[^<>]+>/,"").replace(/(series|simple|const|input)\s+([\w\d.]+)/,"$2")}.${m.pop()}`,h=this._getBuildInMethod(b);if(h){const T=this._getOverloadsFuncIndex(h,o,b,c);return{...h[0],name:b,index:T}}return(l=this._getUserMethodsDocVal(b))==null?void 0:l[0]}else return _}}_arrayTypeTransform(n=""){return n.includes("[]")?`array<${n.replace("[]","")}>`:n}_matchContent(n,s,o){let c=0;for(const l of n){c=o-l.length;const m=s.indexOf(l,c);if(c=m+l.length,this._judgeVal(s,m,c)&&m+1<=o&&c>=o)return{name:l,endIndex:c}}}_judgeVal(n,s,o){const c=n.charAt(s-1),l=/[\w\d."'/]/;if(l.test(c))return!1;const m=n.charAt(o);return!l.test(m)}}const gr=new zd;var Ws={exports:{}};/**
111
+ \`\`\``}code(n){return`\`${n}\``}paragraph(...n){return[this.paragraphBreak,...n,this.paragraphBreak].join(this.lineBreak)}link(n,s){return`[${n}](${s.href})`}}const ie=new Td;function Dd(a){const{name:n,libraryName:s,desc:o}=a,c=[`${ie.bold(n||s)} (library)`];return c.push(ie.delimiter),o&&c.push(ie.paragraph(ie.bold(tt.Description),ie.lineBreak,o)),c.join(c.length===2?" ":ie.lineBreak)}function kd(a,n=0,s=!0){const o=a[n];if(!o)return"";if(o.isEnumMember)return`${ie.bold(o.name)} (enum member)${o.value===void 0?"":` = ${o.value}`}`;const c=/(Mac|iPhone|iPod|iPad)/i.test(window.navigator.userAgent),{name:l,title:m,desc:_,type:f,syntax:b,returns:h,remarks:T,fields:P,members:B}=o,R=[`${ie.bold(l)} (${m})`];if(a.length>1&&R.push(ie.italic(`+${a.length-1} overloads`)),R.push(ie.delimiter),_&&R.push(ie.paragraph(Array.isArray(_)?_.join(ie.lineBreak):_||"")),f&&R.push(ie.paragraph(ie.bold(tt.Type),ie.italic(f))),b&&b.length&&R.push(ie.paragraph(ie.bold(tt.Syntax),ie.pineCode(b.join(ie.lineBreak)))),h&&R.push(ie.paragraph(ie.bold(tt.Returns),ie.lineBreak,h.join(ie.lineBreak))),T&&T.length&&a.length<=1){let S="";typeof T=="string"?S=T:S=T.join(ie.lineBreak)||"",S.length<200&&R.push(ie.paragraph(ie.bold(tt.Remarks),ie.lineBreak,S))}if(P){const S=[];for(const H of P){const V=H.desc?` - ${H.desc}`:"";S.push(`${H.name} (${H.type})${V}`)}R.push(ie.paragraph(ie.bold(tt.Fields),ie.lineBreak,S.join(ie.paragraphBreak)))}if(B){const S=[];for(const H of B){const V=H.desc?` - ${H.desc}`:"";S.push(`${H.name}${H.value?` (${H.value})`:""}${V}`)}R.push(ie.paragraph(ie.bold(tt.EnumMembers),ie.lineBreak,S.join(ie.paragraphBreak)))}return s&&R.push(ie.italic(`${ie.code(c?"⌘":"Ctrl")} + ${xd.clickOnKeywordForMoreHelp}`)),R.join(R.length===2?" ":ie.lineBreak)}const nn="tcc_cursor_position",Id=["submenuitem.EditorContextPeek","editor.action.peekDefinition"];function Ad(a){return a.replace(/<[^<>]+>/,"").replace(/(series|simple|const|input)\s+([\w\d.]+)/,"$2").replace(/\w[\w.\d]*\[\]/,"array")}function qd(a){const n=a.getContribution("editor.contrib.contextmenu"),s=n==null?void 0:n._getMenuActions;n._getMenuActions=function(){return s.apply(n,arguments).filter(function(c){return!Id.includes(c.id)})}}class Cd{constructor(){Object.defineProperty(this,"bracketsPostfix",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_builtinSubtreeCache",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_formatter",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_namespaceCache",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_suggestions",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_outermostNsItems",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_funcArgsCache",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_userSuggestions",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_userFuncArgsCache",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_userNamespaceCache",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_userOutermostNsItems",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_methodNamespaceCache",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_userMethods",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_userFunctions",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_methodFuncs",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_userTypes",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_userEnums",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_nextIsBracket",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.bracketsPostfix="(${0})",this._builtinSubtreeCache={},this._formatter=ie,this._namespaceCache=new Map,this._suggestions=[],this._outermostNsItems=new Map,this._funcArgsCache=new Map,this._userSuggestions=[],this._userFuncArgsCache=new Map,this._userNamespaceCache=new Map,this._userOutermostNsItems=new Map,this._methodNamespaceCache=new Map,this._userMethods=new Map,this._userTypes=new Map,this._methodFuncs=new Map,this._userFunctions=new Map,this._userEnums=new Map,this._nextIsBracket=!1}get methodFuncs(){return this._methodFuncs}get userFuncs(){return this._userFunctions}get userEnums(){return this._userEnums}set nextIsBracket(n){this._nextIsBracket=n}get nextIsBracket(){return this._nextIsBracket}get annotationSuggestions(){return this._getAnnotationCompletionItems(this._builtinSubtreeCache.annotations)}initBuiltinsTrees(){this._getBuiltinsCacheFragment(),this._suggestions=this._getAllCompletionItems(),this._getFuncArgumentsCompletionItemsToCache(this._builtinSubtreeCache.functions)}getArgSuggestions(n){return this._funcArgsCache.get(n)||this._userFuncArgsCache.get(n)}getSuggestions(n){return n?this._namespaceCache.get(n)||this._userNamespaceCache.get(n):this._suggestions.concat(this._userSuggestions)}_initUserDefind(){this._userFuncArgsCache.clear(),this._userNamespaceCache.clear(),this._userOutermostNsItems.clear(),this._methodNamespaceCache.clear(),this._methodFuncs.clear()}setUserDefind(n,s,o,c,l){this._initUserDefind();const m=this._mergeTreeSlices(this._generateTreeSlice(ct.methods,"method"),this._generateTreeSlice(c,"method"));this._getMethodNamespaceCache(m),this._userMethods=c,this._userTypes=s,this._userFunctions=n,this._userEnums=l;const _=this._generateTreeSlice(n,"fun");this._userSuggestions=this._getAllUserCompletionItems(_,this._generateTreeSlice(s,"type"),this._generateTreeSlice(o,"var"),this._generateTreeSlice(l,"enum")),this._getUserFuncArgumentsCompletionItemsToCache(_)}_getAllUserCompletionItems(n,s,o,c){const l=this._getEnumCompletionItems(c),m=this._getUserVariableCompletionItems(o),_=this._getTypeCompletionItems(s,!0),f=this._getFunctionCompletionItems(n,void 0,!0);return[..._,...f,...m,...l,...this._userOutermostNsItems.values()]}_getAllCompletionItems(){const{variables:n,keywords:s,types:o,functions:c}=this._builtinSubtreeCache,l=this._getVariableCompletionItems(n),m=this._getKeywordCompletionItems(s),_=this._getTypeCompletionItems(o),f=this._getFunctionCompletionItems(c),b=this._getSnippetsCompletionsList();return[...l,...m,..._,...f,...this._outermostNsItems.values(),...b]}_getNodeKey(n,s){return`${s}_${n}`}_mergeTreeSlices(...n){const s=new Map;for(const o of n)for(const[c,l]of o){const m=s.get(c);m?s.set(c,{...m,children:this._mergeTreeSlices(l.children,m.children)}):s.set(c,l)}return s}_mergeCompletions(n,s){const o=this._namespaceCache.get(n);o?this._namespaceCache.set(n,[...o,...s]):this._namespaceCache.set(n,s)}_mergeUserCompletions(n,s){const o=this._userNamespaceCache.get(n);o?this._userNamespaceCache.set(n,[...o,...s]):this._userNamespaceCache.set(n,s)}_generateTreeSlice(n,s){const o=new Map;for(const[c,l]of n){const[m,..._]=c.split("."),f=_.length>0,b=o.get(this._getNodeKey(m,f?"ns":s));let h=new Map,T=l.map(B=>({...B,name:c})),P=this._getNodeKey(c,s);if(f&&s!=="type"){const B=new Map([[_.join("."),l]]);T=[{name:m,title:ge.namespace}],P=this._getNodeKey(m,"ns"),h=this._generateTreeSlice(B,s)}b&&(T=[{name:m,title:ge.namespace}],h=this._mergeTreeSlices(b.children,h)),o.set(P,{value:T,children:h})}return o}_getBuiltinsCacheFragment(){const{keywords:n,variables:s,constants:o,types:c,functions:l,annotations:m}=ct,_=this._generateTreeSlice(m,"an");return _.delete("an_@version="),this._builtinSubtreeCache={keywords:this._generateTreeSlice(n,"key"),variables:this._mergeTreeSlices(this._generateTreeSlice(s,"var"),this._generateTreeSlice(o,"var")),types:this._generateTreeSlice(c,"type"),functions:this._generateTreeSlice(l,"fun"),annotations:_},this._builtinSubtreeCache}_getVariableCompletionItems(n,s){const o=[],c=[];for(const[l,m]of n){const{value:_,children:f}=m;if(l.startsWith("ns")){const b=this._getNamespaceCompletionItem(_[0]);if(s){c.push({...b});const T=`${s}.${b.label}`;b.label=T,b.insertText=T}const h=this._getVariableCompletionItems(f,b.label);s||this._outermostNsItems.set(l,b),o.push(...h)}else{const b=this._getVariableCompletionItem(_[0],s?3:2);if(s){c.push({...b});const{label:h}=b;b.label=`${s}.${h}`,b.insertText=`${s}.${b.insertText}`,b.filterText=`${h}\r`}o.push(b)}}return c.length&&s&&this._mergeCompletions(s,c),o}_setUserVariableSubItems(n,s){var b,h,T,P;let o=[];const c=Ad(n.type||""),l=this._methodNamespaceCache.get(c),m=s?`${s}.${n.name}`:n.name;l&&(o=l.filter(B=>{var V;const R=`${c}.${B.label}`,S=ct.methods.get(R)||this._userMethods.get(R),H=S==null?void 0:S.some(G=>!G.thisType||G.thisType[0].includes("<>")||G.thisType.includes(n.type||""));if(H&&S){const G=this._getNamedArgumentsCompletionList(((V=S[0])==null?void 0:V.args)||[]),U=`${m}.${B.label}`;this._userFuncArgsCache.set(U,G),this._methodFuncs.set(U,S)}return H}));const{types:_}=ct,f=((h=(b=this._userTypes.get(c))==null?void 0:b[0])==null?void 0:h.fields)||((P=(T=_.get(c))==null?void 0:T[0])==null?void 0:P.fields);if(f)for(const B of f){const R=B.name,S=B.type,H=this._getInstanceTypeCompletionItemProp({name:R,type:S,desc:B.desc?[B.desc]:void 0});this._setUserVariableSubItems({name:R,type:S},n.name),o.push({...H})}o.length&&this._mergeUserCompletions(m,o)}_getUserVariableCompletionItems(n,s){const o=[],c=[];for(const[l,m]of n){const{value:_,children:f}=m;if(this._setUserVariableSubItems(_[0]),l.startsWith("ns")){const b=this._getNamespaceCompletionItem(_[0]);if(s){c.push({...b});const T=`${s}.${b.label}`;b.label=T,b.insertText=T}const h=this._getUserVariableCompletionItems(f,b.label);s||this._userOutermostNsItems.set(l,b),o.push(...h)}else{const b=this._getVariableCompletionItem(_[0],s?2:1,!1);if(s){c.push({...b});const{label:h}=b;b.label=`${s}.${h}`,b.insertText=`${s}.${b.insertText}`,b.filterText=`${h}\r`}o.push(b)}}return c.length&&s&&this._mergeUserCompletions(s,c),o}_getTypeCompletionItems(n,s=!1){const o=[];for(const[,c]of n){const{value:l}=c,m=s?this._getCustomTypeCompletionItem(l[0]):this._getTypeCompletionItem(l[0]);o.push(m)}return o}_getEnumCompletionItems(n){const s=[];for(const[,o]of n){const{value:c}=o,l=this._getEnumCompletionItem(c[0]);s.push(l);const m=c[0].members;m!=null&&m.length&&this._getEnumMemberCompletionItems(c[0].name,m)}return s}_getEnumMemberCompletionItems(n,s){const o=[];for(const c of s){const{name:l,desc:m,value:_}=c,f=this._getEnumMemberCompletionItem({name:l,desc:m?[m]:void 0,value:_});o.push(f)}o.length&&this._mergeUserCompletions(n,o)}_getAnnotationCompletionItems(n){const s=[];for(const[,o]of n){const{value:c}=o,l=this._getAnnotationCompletionItem(c[0]);s.push(l)}return s}_getKeywordCompletionItems(n){const s=[];for(const[,o]of n){const{value:c}=o,l=this._getKeywordCompletionItem(c[0]);s.push(l)}return s}_getMethodNamespaceCache(n,s){const o=[];for(const[c,l]of n){const{value:m,children:_}=l;if(c.startsWith("ns")){const f=this._getNamespaceCompletionItem(m[0]);if(s){o.push({...f});const b=`${s}.${f.label}`;f.label=b,f.insertText=b}this._getMethodNamespaceCache(_,f.label)}else{const f=this._getFunctionCompletionItem(m[0],s?3:2);if(m.length>1&&(f.detail=`${f.detail} (+${m.length-1} overloads)`),s){o.push({...f});const{label:b}=f;f.label=`${s}.${b}`,f.insertText=`${s}.${f.insertText}`,f.originInsertText=`${s}.${f.originInsertText}`,f.filterText=`${b}\r`}}}s&&this._methodNamespaceCache.set(s,o)}_getFunctionCompletionItems(n,s,o=!1){const c=[],l=[];for(const[m,_]of n){const{value:f,children:b}=_;if(m.startsWith("ns")){const h=this._getNamespaceCompletionItem(f[0]);if(s){l.push({...h});const P=`${s}.${h.label}`;h.label=P,h.insertText=P}const T=this._getFunctionCompletionItems(b,h.label,o);s||(o?this._userOutermostNsItems.set(m,h):this._outermostNsItems.set(m,h)),c.push(...T)}else{const h=this._getFunctionCompletionItem(f[0],s?3:2,!o);if(f.length>1&&(h.detail=`${h.detail} (+${f.length-1} overloads)`),s){l.push({...h});const{label:T}=h;h.label=`${s}.${T}`,h.insertText=`${s}.${h.insertText}`,h.originInsertText=`${s}.${h.originInsertText}`,h.filterText=`${T}\r`}c.push(h)}}return l.length&&s&&(o?this._mergeUserCompletions(s,l):this._mergeCompletions(s,l)),c}_getSnippetsCompletionsList(){return bd.map(n=>{const{label:s,kind:o,insertText:c}=n,l=s.charAt(0).toUpperCase()+s.substring(1),m={value:this._formatter.pineCode(c.replace(/\${\d:([^}]+)}|\${\d}/g,"$1"))};return{label:s,detail:`(${l} ${o})`,insertText:c,insertTextRules:Ie.languages.CompletionItemInsertTextRule.InsertAsSnippet,sortText:`2_${s}`,kind:Ie.languages.CompletionItemKind.Snippet,documentation:m}})}_getFuncArgumentsCompletionItemsToCache(n,s){for(const[o,c]of n){const{name:l}=c.value[0];if(o.startsWith("ns"))this._getFuncArgumentsCompletionItemsToCache(c.children,s?`${s}.${l}`:l);else{const m=new Map;c.value.reduce((b,h)=>{const T=h.args;return T&&T.length&&T.forEach(P=>{b.set(P.name,P)}),b},m);const _=this._getNamedArgumentsCompletionList([...m.values()]),f=s?`${s}.${l}`:l;this._funcArgsCache.set(f,_)}}}_getUserFuncArgumentsCompletionItemsToCache(n,s){for(const[o,c]of n){const{name:l}=c.value[0];if(o.startsWith("ns"))this._getUserFuncArgumentsCompletionItemsToCache(c.children,s?`${s}.${l}`:l);else{const m=new Map;c.value.reduce((b,h)=>{const T=h.args;return T&&T.length&&T.forEach(P=>{b.set(P.name,P)}),b},m);const _=this._getNamedArgumentsCompletionList([...m.values()]),f=s?`${s}.${l}`:l;this._userFuncArgsCache.set(f,_)}}}_getNamedArgumentsCompletionList(n){return n.map(s=>{const{name:o,desc:c,displayType:l}=s,m=`${o} = `,_=Array.isArray(c)?c.join(this._formatter.delimiter):c||"";return{label:m,documentation:{value:this._formatter.paragraph(this._formatter.bold(ge.Description),this._formatter.lineBreak,_)},insertText:m,detail:`(${ge.parameter}) ${ge.types} ${l}`,kind:Ie.languages.CompletionItemKind.Text,sortText:`0_${m}`}})}_getVariableCompletionItem(n,s=2,o=!0){const c=this._extractExamples(n),l=this._extractDescription(n),m=[this._createDescriptionSection(l)];c.length?m.push(this._createExampleSection(c)):n.syntax&&n.syntax.length&&m.push(this._createSyntaxSection(n.syntax));const _={value:m.join(this._formatter.lineBreak)},f=o?ge.variables:ge.userDefinedVariable;return{documentation:_,label:n.name,insertText:n.name,kind:Ie.languages.CompletionItemKind.Variable,sortText:`${s}_${n.name}`,detail:`(${f}) ${n.type}`}}_getKeywordCompletionItem(n,s=2){const o=this._extractExamples(n),c=this._extractDescription(n),l=[this._createDescriptionSection(c)];return o.length?l.push(this._createExampleSection(o)):n.syntax&&n.syntax.length&&l.push(this._createSyntaxSection(n.syntax)),{documentation:{value:l.join(this._formatter.lineBreak)},label:n.name,insertText:n.name,kind:Ie.languages.CompletionItemKind.Keyword,sortText:`${s}_${n.name}`,detail:`(${ge.keywords})`}}_getTypeCompletionItem(n){const s=this._extractDescription(n);return{documentation:{value:this._createDescriptionSection(s)},label:n.name,insertText:n.name,kind:Ie.languages.CompletionItemKind.Keyword,sortText:`1_${n.name}`,detail:`(${ge.types})`}}_getCustomTypeCompletionItem(n){const s=this._extractDescription(n);return{documentation:{value:this._createDescriptionSection(s)},label:n.name,insertText:n.name,kind:Ie.languages.CompletionItemKind.Keyword,sortText:`2_${n.name}`,detail:`(${ge.userDefinedType})`}}_getEnumCompletionItem(n){const s=this._extractDescription(n);return{documentation:{value:this._createDescriptionSection(s)},label:n.name,insertText:n.name,kind:Ie.languages.CompletionItemKind.Enum,sortText:`2_${n.name}`,detail:`(${ge.enum})`}}_getEnumMemberCompletionItem(n){const s=this._extractDescription(n);return{documentation:{value:this._createDescriptionSection(s)},label:n.name,insertText:n.name,kind:Ie.languages.CompletionItemKind.EnumMember,sortText:`2_${n.name}`,detail:`(enum member) ${n.value?`${n.name} = ${n.value}`:`${n.name}`}`}}_getInstanceTypeCompletionItemProp(n){const s=this._extractDescription(n),o=[];return s&&o.push(this._formatter.paragraph(this._formatter.bold(tt.Description),this._formatter.lineBreak,s)),{documentation:{value:o.join(this._formatter.lineBreak)},label:n.name,insertText:n.name,kind:Ie.languages.CompletionItemKind.Field,sortText:`2_${n.name}`,detail:`(${ge.field}) ${n.type}`}}_getFunctionCompletionItem(n,s=2,o=!0){var B;const c=n.returnedTypes&&n.returnedTypes[0]||n.syntax&&n.syntax[0]&&((B=n.syntax[0].split("→").pop())==null?void 0:B.trim()),l=this._extractExamples(n),m=this._extractDescription(n),_=[this._createDescriptionSection(m)];l.length?_.push(this._createExampleSection(l)):n.syntax&&n.syntax.length&&_.push(this._createSyntaxSection(n.syntax)),n.returns&&n.returns.length&&_.push(this._createReturnSection(n.returns));const f={value:_.join(this._formatter.lineBreak)},b=n.name,h=o?ge.functions:ge.userDefinedFunction,T=n.template,P=T?`${vd(b)}<\${1}>`:b;return{documentation:f,label:T?`${b.replace(/<.+>/,"")}<type>`:b,kind:Ie.languages.CompletionItemKind.Function,sortText:`${s}_${b}`,insertTextRules:Ie.languages.CompletionItemInsertTextRule.InsertAsSnippet,insertText:P+this.bracketsPostfix,originInsertText:P,detail:`(${h}) ${ge.returns} ${c}`,command:{id:"tcc.editor.function",title:"",arguments:[T?"editor.action.triggerSuggest":"editor.action.triggerParameterHints"]}}}_getAnnotationCompletionItem(n){const s=this._extractDescription(n),o=this._extractExamples(n),c=[this._createDescriptionSection(s)];return o.length&&c.push(this._createExampleSection(o)),{documentation:{value:c.join(this._formatter.lineBreak)},label:n.name,insertText:n.name.replace("@",""),kind:Ie.languages.CompletionItemKind.Keyword,detail:`(${ge.annotations})`}}_getNamespaceCompletionItem(n,s=2){const o=[this._createDescriptionSection(ge.namespaceDesc)];return{label:n.name,documentation:{value:o.join(this._formatter.lineBreak)},detail:`(${ge.namespace}) ${n.name}`,insertText:n.name,sortText:`${s}_${n.name}`,kind:Ie.languages.CompletionItemKind.Module}}_extractExamples(n){let s;return n.examples||n.detailedDesc&&((s=n.detailedDesc[0])===null||s===void 0?void 0:s.examples)||[]}_extractDescription(n){return Array.isArray(n.desc)?n.desc.join(this._formatter.lineBreak):n.desc||""}_createExampleSection(n){return this._formatter.paragraph(this._formatter.bold(tt.Example),this._formatter.pineCode(n.join(this._formatter.lineBreak)))}_createSyntaxSection(n){return this._formatter.paragraph(this._formatter.bold(tt.Syntax),this._formatter.pineCode(n.join(this._formatter.lineBreak)))}_createReturnSection(n){return this._formatter.paragraph(this._formatter.bold(tt.Returns),this._formatter.lineBreak,n.join(this._formatter.lineBreak))}_createDescriptionSection(n){return!n||n.trim().length===0?"":this._formatter.paragraph(this._formatter.bold(tt.Description),this._formatter.lineBreak,n)}}const St=new Cd;class zd{constructor(){Object.defineProperty(this,"_userFunctions",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_userVariables",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_userTypes",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_userMethods",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_userEnums",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_imports",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_overloadsFuncs",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this._userFunctions=new Map,this._userVariables=new Map,this._userTypes=new Map,this._userMethods=new Map,this._imports=new Map,this._userEnums=new Map,this._overloadsFuncs=[]}get overloadsFuncs(){return this._overloadsFuncs}setUserDefined(n,s){const{functions:o,variables:c,types:l,methods:m,imports:_,enums:f}=n;o&&(this._userFunctions=o),c&&(this._userVariables=c),l&&(this._userTypes=l),m&&(this._userMethods=m),_&&(this._imports=_),f&&(this._userEnums=f),this._overloadsFuncs=s}parseLineContentFuncVar(n,s,o,c){let l=(o==null?void 0:o.getLineContent(s))||"";const m=l.indexOf("//");if(this._removeString(l).indexOf("//")!==-1&&m<=n)return;l=l+" ";const _=this._getVariablesDocVal(l,n,s);if(_){if(_.isBuildIn){const h=o==null?void 0:o.getWordAtPosition(c||new Ie.Position(s,n));if(((o==null?void 0:o.getValueInRange({startLineNumber:s,startColumn:(h==null?void 0:h.endColumn)||0,endLineNumber:s,endColumn:((h==null?void 0:h.endColumn)||0)+2}))||"").trim().startsWith("="))return null}return _}const f=this._getFuncsDocVal(l,n,s);if(f)return f;const b=l.match(/[a-zA-Z_][a-zA-Z_0-9]*(\s*\.\s*[a-zA-Z_][a-zA-Z_0-9]*)*(?=\s*<)/g);if(b){const h=this._matchContent(b,l,n);if(h){const T=this._getBuildInOther(h.name);if(T)return{docValue:T,isBuildIn:!0,index:0};{const P=this._getBuildInFunc(`${h.name}<type>`);if(P)return{docValue:P,isBuildIn:!0,index:0}}}}return this._getImportDocVal(l,n,s)}_getImportDocVal(n,s,o){const c=new RegExp("(?<=(import(\\s+)))([a-zA-Z\\d\\$_\\-\\.\\u00a1-\\uffff\\/]+)","g"),l=new RegExp("(?<=(as\\b)(\\s+))([a-zA-Z\\d\\_\\u00a1\\uffff\\/]+)","g"),m=n.match(c);if(m){const _=this._matchContent(m,n,s);if(_){const b=this._imports.get(_.name);if(b)return b}const f=n.match(l);if(f){const b=this._matchContent(f,n,s);if(b){for(const[h,T]of this._imports)if(T.name===b.name)return T}}}return null}_getBuildInFunc(n){return ct.functions.get(n)}_getBuildInMethod(n){return ct.methods.get(n)}_getBuildInOther(n){const{keywords:s,variables:o,constants:c,types:l}=ct;return s.get(n)||o.get(n)||c.get(n)||l.get(n)}parseCurrentInputFunc(n,s=!1,o=!1){let c=n.length-1,l=0,m=s,_=o;for(;c>=0;){const f=n.charAt(c);if(c-=1,/['"]/.test(f)){const b=f;if(f==="'"){if(m){m=!1;continue}}else if(_){_=!1;continue}for(;c>=0;){const h=n.charAt(c);if(c-=1,h===b)break}}if(!(m||_)&&(/\)/.test(f)&&(l+=1),/\(/.test(f))){if(l>0){l-=1;continue}let b="";for(;c>=0;){const h=n.charAt(c);if(/\s/.test(h)&&!b){c-=1;continue}if(/[^\w.]/.test(h))break;c-=1,b=h+b}if(b)return{funcName:b,startIndex:c+1}}}}parseCurrentInputFuncAndArg(n,s=!1,o=!1){const{funcName:c,startIndex:l}=this.parseCurrentInputFunc(n,s,o)||{};if(c&&typeof l=="number"){let m=n.slice(l+c.length).trim().slice(1),_=-1;if(s&&(_=m.lastIndexOf("'")),o){const h=m.lastIndexOf('"');(h!==-1&&h<_||_===-1)&&(_=h)}_!==-1&&(m=m.substring(0,_));const b=m.replace(/[\w.]+\(.*\)/g,"").split(",").map(h=>{const T=h.trim().split("=");return T.length<=1?"":T[0].trim()});return{startIndex:l,funcName:c,args:b}}}_removeString(n){return n.replace(/\\"|\\'/g,"").replace(/"[^"]*"|'[^']*'/g,"")}_getVariablesDocVal(n,s,o){const c=this._removeString(n).replace(/\/\/.*/g,"").match(/[a-zA-Z_][a-zA-Z_0-9]*(\s*\.\s*[a-zA-Z_][a-zA-Z_0-9]*)*(?=\s*[^(a-zA-Z_0-9."'<])/g);if(c){const l=this._matchContent(c,n,s);if(l){const m={docValue:void 0,isBuildIn:!0,index:0},_=this._getBuildInOther(l.name);if(_)return m.docValue=_,m;const f=this._getUserVariablesDocVal(l.name,s,o);if(f)return Object.assign(m,{docValue:[f],isBuildIn:!1});const b=this._getUserTypesDocVal(l.name);if(b)return Object.assign(m,{docValue:b,isBuildIn:!1});const h=this._getTypesAndFileds(n,l.name,s,o);if(h&&typeof h!="string")return Object.assign(m,{docValue:[h],isBuildIn:!1});const T=this._getUserEnumsDocVal(l,s);if(T)return Object.assign(m,{docValue:T,isBuildIn:!1})}}}_getUserVariablesDocVal(n,s,o){const m=[...this._userVariables.get(n)||[]].sort((_,f)=>(f.scope||0)-(_.scope||0)).find(_=>{const f=_.range;return((f==null?void 0:f.startColumn)||0)<=s&&((f==null?void 0:f.startLineNumber)||0)<=o&&((f==null?void 0:f.endLineNumber)||0)>=o});if(m)return m.title=ge.userDefinedVariable,m.type=this._arrayTypeTransform(m.type),m}_getUserTypesDocVal(n){const s=this._userTypes.get(n);if(s)return s[0].title=ge.userDefinedType,s}_getUserEnumsDocVal(n,s){var f;const{endIndex:o,name:c}=n,l=c.split(".");let m=l[0];l.length>2&&(m=l.slice(0,2).join("."));const _=this._userEnums.get(m);if(_&&_.length){_[0].title=ge.enum;const b=l[l.length-1],h=(f=_[0].members)==null?void 0:f.find(T=>T.name===b);if(!h||s<o-b.length)return _;if(s>o-b.length)return[h]}}_getTypesAndFileds(n,s,o,c){var l,m;if(s.includes(".")){const _=s.split(".");let f=_[0],b,h=null,T=n.indexOf(s,o-s.length)+1,P=T+f.length-1;for(const B of _.slice(1)){if(!h){const R=T<=o&&P>=o,S=this._getUserVariablesDocVal(f,o,c);if(R&&S)return S;h=S==null?void 0:S.type}if(h){b=h,T=P+2,P=P+B.length+1;const R=this._userTypes.get(h)||ct.types.get(h),S=(m=(l=R==null?void 0:R[0])==null?void 0:l.fields)==null?void 0:m.find(H=>H.name===B);if(S&&T<=o&&P>=o)return{name:`${h}.${B}`,desc:S.desc,type:this._arrayTypeTransform(S.type),title:ge.field};h=S==null?void 0:S.type}else f=`${f}.${B}`,P=P+B.length+1}return b}}_getFuncsDocVal(n,s,o){const c=n.match(/[a-zA-Z_][a-zA-Z_0-9]*(\s*\.\s*[a-zA-Z_][a-zA-Z_0-9]*)*(?=\s*\()/g);if(c){const l=this._matchContent(c,n,s);if(l){const m={docValue:void 0,isBuildIn:!0,endIndex:l.endIndex,index:0},_=this._getBuildInFunc(l.name);if(_)return m.index=this._getOverloadsFuncIndex(_,s,l.name,o),Object.assign(m,{docValue:_});const f=this._getUserFuncsDocVal(l.name);if(f)return m.index=this._getOverloadsFuncIndex(f,s,l.name,o),Object.assign(m,{docValue:f,isBuildIn:!1});const b=this._getUserVarFuncsDocVal(n,l.name,s,o);if(b)return Object.assign(m,{docValue:[b],isBuildIn:!1})}}}_getOverloadsFuncIndex(n,s,o,c){if(n.length>1){const l=this._overloadsFuncs.find(m=>m.name===o&&m.line===c&&m.startColumn<=s&&m.endColumn>=s);if(l)return l.index}return 0}_getUserFuncsDocVal(n){const s=this._userFunctions.get(n);if(s){for(const o of s)o.title=ge.userDefinedFunction;return s}}_getUserMethodsDocVal(n){const s=this._userMethods.get(n);if(s){for(const o of s)o.title=ge.userDefinedFunction;return s}}_getUserVarFuncsDocVal(n,s,o,c){var l;if(s.includes(".")){const m=s.split("."),_=this._getTypesAndFileds(n,s,o,c);if(typeof _=="string"){const b=`${this._arrayTypeTransform(_).replace(/<[^<>]+>/,"").replace(/(series|simple|const|input)\s+([\w\d.]+)/,"$2")}.${m.pop()}`,h=this._getBuildInMethod(b);if(h){const T=this._getOverloadsFuncIndex(h,o,b,c);return{...h[0],name:b,index:T}}return(l=this._getUserMethodsDocVal(b))==null?void 0:l[0]}else return _}}_arrayTypeTransform(n=""){return n.includes("[]")?`array<${n.replace("[]","")}>`:n}_matchContent(n,s,o){let c=0;for(const l of n){c=o-l.length;const m=s.indexOf(l,c);if(c=m+l.length,this._judgeVal(s,m,c)&&m+1<=o&&c>=o)return{name:l,endIndex:c}}}_judgeVal(n,s,o){const c=n.charAt(s-1),l=/[\w\d."'/]/;if(l.test(c))return!1;const m=n.charAt(o);return!l.test(m)}}const gr=new zd;var Ws={exports:{}};/**
112
112
  * @license
113
113
  * Lodash <https://lodash.com/>
114
114
  * Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
@@ -141,7 +141,7 @@ function print() { __p += __j.call(arguments, '') }
141
141
  * @license
142
142
  * Copyright 2019 Google LLC
143
143
  * SPDX-License-Identifier: Apache-2.0
144
- */const _o=Symbol("Comlink.proxy"),sm=Symbol("Comlink.endpoint"),am=Symbol("Comlink.releaseProxy"),yn=Symbol("Comlink.finalizer"),Ys=Symbol("Comlink.thrown"),fo=a=>typeof a=="object"&&a!==null||typeof a=="function",nm={canHandle:a=>fo(a)&&a[_o],serialize(a){const{port1:n,port2:s}=new MessageChannel;return bo(a,n),[s,[s]]},deserialize(a){return a.start(),_n(a)}},im={canHandle:a=>fo(a)&&Ys in a,serialize({value:a}){let n;return a instanceof Error?n={isError:!0,value:{message:a.message,name:a.name,stack:a.stack}}:n={isError:!1,value:a},[n,[]]},deserialize(a){throw a.isError?Object.assign(new Error(a.value.message),a.value):a.value}},go=new Map([["proxy",nm],["throw",im]]);function om(a,n){for(const s of a)if(n===s||s==="*"||s instanceof RegExp&&s.test(n))return!0;return!1}function bo(a,n=globalThis,s=["*"]){n.addEventListener("message",function o(c){if(!c||!c.data)return;if(!om(s,c.origin)){console.warn(`Invalid origin '${c.origin}' for comlink proxy`);return}const{id:l,type:m,path:_}=Object.assign({path:[]},c.data),f=(c.data.argumentList||[]).map(br);let b;try{const h=_.slice(0,-1).reduce((P,B)=>P[B],a),T=_.reduce((P,B)=>P[B],a);switch(m){case"GET":b=T;break;case"SET":h[_.slice(-1)[0]]=br(c.data.value),b=!0;break;case"APPLY":b=T.apply(h,f);break;case"CONSTRUCT":{const P=new T(...f);b=gn(P)}break;case"ENDPOINT":{const{port1:P,port2:B}=new MessageChannel;bo(a,B),b=mm(P,[P])}break;case"RELEASE":b=void 0;break;default:return}}catch(h){b={value:h,[Ys]:0}}Promise.resolve(b).catch(h=>({value:h,[Ys]:0})).then(h=>{const[T,P]=ea(h);n.postMessage(Object.assign(Object.assign({},T),{id:l}),P),m==="RELEASE"&&(n.removeEventListener("message",o),xo(n),yn in a&&typeof a[yn]=="function"&&a[yn]())}).catch(h=>{const[T,P]=ea({value:new TypeError("Unserializable return value"),[Ys]:0});n.postMessage(Object.assign(Object.assign({},T),{id:l}),P)})}),n.start&&n.start()}function lm(a){return a.constructor.name==="MessagePort"}function xo(a){lm(a)&&a.close()}function _n(a,n){return fn(a,[],n)}function Qs(a){if(a)throw new Error("Proxy has been released and is not useable")}function ho(a){return Lr(a,{type:"RELEASE"}).then(()=>{xo(a)})}const Zs=new WeakMap,Js="FinalizationRegistry"in globalThis&&new FinalizationRegistry(a=>{const n=(Zs.get(a)||0)-1;Zs.set(a,n),n===0&&ho(a)});function cm(a,n){const s=(Zs.get(n)||0)+1;Zs.set(n,s),Js&&Js.register(a,n,a)}function pm(a){Js&&Js.unregister(a)}function fn(a,n=[],s=function(){}){let o=!1;const c=new Proxy(s,{get(l,m){if(Qs(o),m===am)return()=>{pm(c),ho(a),o=!0};if(m==="then"){if(n.length===0)return{then:()=>c};const _=Lr(a,{type:"GET",path:n.map(f=>f.toString())}).then(br);return _.then.bind(_)}return fn(a,[...n,m])},set(l,m,_){Qs(o);const[f,b]=ea(_);return Lr(a,{type:"SET",path:[...n,m].map(h=>h.toString()),value:f},b).then(br)},apply(l,m,_){Qs(o);const f=n[n.length-1];if(f===sm)return Lr(a,{type:"ENDPOINT"}).then(br);if(f==="bind")return fn(a,n.slice(0,-1));const[b,h]=wo(_);return Lr(a,{type:"APPLY",path:n.map(T=>T.toString()),argumentList:b},h).then(br)},construct(l,m){Qs(o);const[_,f]=wo(m);return Lr(a,{type:"CONSTRUCT",path:n.map(b=>b.toString()),argumentList:_},f).then(br)}});return cm(c,a),c}function dm(a){return Array.prototype.concat.apply([],a)}function wo(a){const n=a.map(ea);return[n.map(s=>s[0]),dm(n.map(s=>s[1]))]}const vo=new WeakMap;function mm(a,n){return vo.set(a,n),a}function gn(a){return Object.assign(a,{[_o]:!0})}function ea(a){for(const[n,s]of go)if(s.canHandle(a)){const[o,c]=s.serialize(a);return[{type:"HANDLER",name:n,value:o},c]}return[{type:"RAW",value:a},vo.get(a)||[]]}function br(a){switch(a.type){case"HANDLER":return go.get(a.name).deserialize(a.value);case"RAW":return a.value}}function Lr(a,n,s){return new Promise(o=>{const c=um();a.addEventListener("message",function l(m){!m.data||!m.data.id||m.data.id!==c||(a.removeEventListener("message",l),o(m.data))}),a.start&&a.start(),a.postMessage(Object.assign({id:c},n),s)})}function um(){return new Array(4).fill(0).map(()=>Math.floor(Math.random()*Number.MAX_SAFE_INTEGER).toString(16)).join("-")}const To=new Worker(new URL(""+(typeof document>"u"&&typeof location>"u"?require("url").pathToFileURL(__dirname+"/assets/scriptsRunWorker-C9KtHX5_.js").href:new URL("assets/scriptsRunWorker-C9KtHX5_.js",typeof document>"u"?location.href:document.currentScript&&document.currentScript.src||document.baseURI).href),typeof document>"u"&&typeof location>"u"?require("url").pathToFileURL(__filename).href:typeof document>"u"?location.href:Us&&Us.src||new URL("trading-vue-editor.umd.cjs",document.baseURI).href),{type:"module",name:"Run TccScript Server"});To.onerror=a=>{console.error(a)};async function Do(a){return await Gs.setInlayHints(a)}const ko=_n(To),Io=_n(new Worker(new URL(""+(typeof document>"u"&&typeof location>"u"?require("url").pathToFileURL(__dirname+"/assets/parserTccWorker-C6iZakQ2.js").href:new URL("assets/parserTccWorker-C6iZakQ2.js",typeof document>"u"?location.href:document.currentScript&&document.currentScript.src||document.baseURI).href),typeof document>"u"&&typeof location>"u"?require("url").pathToFileURL(__filename).href:typeof document>"u"?location.href:Us&&Us.src||new URL("trading-vue-editor.umd.cjs",document.baseURI).href),{type:"module",name:"Parser TccScript Server"}));async function Ao(a,n=!1){const{functions:s,types:o,constants:c,variables:l,methods:m}=ct;return await Io.parseTcc(a,n,gn(Do),{functions:Object.fromEntries(s),methods:Object.fromEntries(m),types:Object.fromEntries(o),constants:Object.fromEntries(c),variables:Object.fromEntries(l)})}async function ym(a,n){const{functions:s,types:o,constants:c,variables:l,methods:m}=ct;return await Io.parseLibraryCode(a,n,gn(Do),{functions:Object.fromEntries(s),methods:Object.fromEntries(m),types:Object.fromEntries(o),constants:Object.fromEntries(c),variables:Object.fromEntries(l)})}async function qo(a,n,s=!0){return await ko.runScript(a,n,s)}async function _m(a){return await ko.removeScript(a)}function fm(a){return new Worker(""+(typeof document>"u"&&typeof location>"u"?require("url").pathToFileURL(__dirname+"/assets/editor.worker-CT5Cb1wO.js").href:new URL("assets/editor.worker-CT5Cb1wO.js",typeof document>"u"?location.href:document.currentScript&&document.currentScript.src||document.baseURI).href),{name:a==null?void 0:a.name})}self.MonacoEnvironment={getWorker(){return new fm({name:"Editor Worker"})}},sn.config({paths:{vs:"https://cdnjs.cloudflare.com/ajax/libs/monaco-editor/0.45.0/min/vs"},"vs/nls":{availableLanguages:{"*":"zh-cn"}}});let Co={};const gm=(a,n)=>{const{height:s,width:o,theme:c,options:l,hasDiff:m,readOnly:_,defaultValue:f,onChange:b,onLinkOpen:h,onDeclareConfigChange:T,onCursorPositionChange:P,onActionTrigger:B,onEditorDidMount:R}=a,S=F.useRef(null),H=F.useRef(null);F.useImperativeHandle(n,()=>({setOriginalScript(E){var K;(K=S.current)==null||K.setOriginalScript(E)},setScript(E){var K;(K=S.current)==null||K.setValue(E)},gotoLine(){var E;(E=S.current)==null||E.gotoLine()},getEditorLayout(){var E;return(E=S.current)==null?void 0:E.getEditorLayout()},setPosition(E,K){var Z;(Z=S.current)==null||Z.setPosition({column:E,lineNumber:K})},setModelMarkers(E){var K;(K=S.current)==null||K.setModelMarkers(E)},focus(){var E;(E=S.current)==null||E.focus()}})),F.useEffect(()=>{var E,K;m?(K=S.current)==null||K.addDiffDecorations():(E=S.current)==null||E.removeDiffDecorations()},[m]),F.useEffect(()=>{var E;(E=S.current)==null||E.updateActionTrigger(B)},[B]),F.useEffect(()=>{var E;h&&((E=S.current)==null||E.addLinkOpenFunc(h))},[h]);function V(E,K){var fe,le;St.initBuiltinsTrees(),Gs.setEditor(E),S.current=new rm(E,K,B),h&&((fe=S.current)==null||fe.addLinkOpenFunc(h)),m&&((le=S.current)==null||le.addDiffDecorations()),qd(E),requestAnimationFrame(O);const Z=E.getValue();S.current.onChangeCursorPosition(P),b&&b(Z),!_&&G(Z),R&&R()}const G=F.useCallback(async E=>{var $e;const K=Date.now(),{errors:Z,functions:fe,methods:le,types:ht,variables:Et,overloadsFuncs:Ue,imports:Ke,preParserCode:Y,enums:be}=await Ao(E),Ee=new Map(Object.entries(fe)),Me=new Map(Object.entries(le)),pt=new Map(Object.entries(ht)),wt=new Map(Object.entries(Et)),re=new Map(Object.entries(Ke)),xe=new Map(Object.entries(be));gr.setUserDefined({functions:Ee,methods:Me,types:pt,variables:wt,imports:re,enums:xe},Ue),St.setUserDefind(Ee,pt,wt,Me,xe);const Re=Z.map(je=>({...je,severity:je.type||Ie.MarkerSeverity.Error}));if(_)return;try{if(!Z.length&&Y){const je=await qo(Y,{isPreParser:!0});io.isEqual(je,Co)||(Co=je,T&&T(je))}}catch(je){console.log(je),Z.push({message:je.message,startLineNumber:0,endLineNumber:0,startColumn:0,endColumn:0})}($e=S.current)==null||$e.setModelMarkers(Re);const Nt=Date.now();console.log((Nt-K)/1e3)},[T,_]),U=F.useMemo(()=>io.debounce(G,1500),[G]);function k(E){var K;if(_){G(E||"");return}Gs.clearInlayHints(),(K=S.current)==null||K.setModelMarkers([]),E!==void 0&&(b&&b(E),U(E))}const O=F.useCallback(()=>{var K,Z;const E=(K=H.current)==null?void 0:K.getBoundingClientRect();(Z=S.current)==null||Z.setEditorLayout((E==null?void 0:E.height)||0,E==null?void 0:E.width)},[]);return F.useEffect(()=>{const E=()=>{window.requestAnimationFrame(O)},K=new ResizeObserver(E);return H.current&&K.observe(H.current),()=>{var Z;H.current&&K.unobserve(H.current),K.disconnect(),(Z=S.current)==null||Z.dispose()}},[]),L.jsx("div",{ref:H,children:L.jsx(gd,{height:s,width:o||"100%",defaultLanguage:Se,defaultValue:f||`indicator("我的脚本")
144
+ */const _o=Symbol("Comlink.proxy"),sm=Symbol("Comlink.endpoint"),am=Symbol("Comlink.releaseProxy"),yn=Symbol("Comlink.finalizer"),Ys=Symbol("Comlink.thrown"),fo=a=>typeof a=="object"&&a!==null||typeof a=="function",nm={canHandle:a=>fo(a)&&a[_o],serialize(a){const{port1:n,port2:s}=new MessageChannel;return bo(a,n),[s,[s]]},deserialize(a){return a.start(),_n(a)}},im={canHandle:a=>fo(a)&&Ys in a,serialize({value:a}){let n;return a instanceof Error?n={isError:!0,value:{message:a.message,name:a.name,stack:a.stack}}:n={isError:!1,value:a},[n,[]]},deserialize(a){throw a.isError?Object.assign(new Error(a.value.message),a.value):a.value}},go=new Map([["proxy",nm],["throw",im]]);function om(a,n){for(const s of a)if(n===s||s==="*"||s instanceof RegExp&&s.test(n))return!0;return!1}function bo(a,n=globalThis,s=["*"]){n.addEventListener("message",function o(c){if(!c||!c.data)return;if(!om(s,c.origin)){console.warn(`Invalid origin '${c.origin}' for comlink proxy`);return}const{id:l,type:m,path:_}=Object.assign({path:[]},c.data),f=(c.data.argumentList||[]).map(br);let b;try{const h=_.slice(0,-1).reduce((P,B)=>P[B],a),T=_.reduce((P,B)=>P[B],a);switch(m){case"GET":b=T;break;case"SET":h[_.slice(-1)[0]]=br(c.data.value),b=!0;break;case"APPLY":b=T.apply(h,f);break;case"CONSTRUCT":{const P=new T(...f);b=gn(P)}break;case"ENDPOINT":{const{port1:P,port2:B}=new MessageChannel;bo(a,B),b=mm(P,[P])}break;case"RELEASE":b=void 0;break;default:return}}catch(h){b={value:h,[Ys]:0}}Promise.resolve(b).catch(h=>({value:h,[Ys]:0})).then(h=>{const[T,P]=ea(h);n.postMessage(Object.assign(Object.assign({},T),{id:l}),P),m==="RELEASE"&&(n.removeEventListener("message",o),xo(n),yn in a&&typeof a[yn]=="function"&&a[yn]())}).catch(h=>{const[T,P]=ea({value:new TypeError("Unserializable return value"),[Ys]:0});n.postMessage(Object.assign(Object.assign({},T),{id:l}),P)})}),n.start&&n.start()}function lm(a){return a.constructor.name==="MessagePort"}function xo(a){lm(a)&&a.close()}function _n(a,n){return fn(a,[],n)}function Qs(a){if(a)throw new Error("Proxy has been released and is not useable")}function ho(a){return Lr(a,{type:"RELEASE"}).then(()=>{xo(a)})}const Zs=new WeakMap,Js="FinalizationRegistry"in globalThis&&new FinalizationRegistry(a=>{const n=(Zs.get(a)||0)-1;Zs.set(a,n),n===0&&ho(a)});function cm(a,n){const s=(Zs.get(n)||0)+1;Zs.set(n,s),Js&&Js.register(a,n,a)}function pm(a){Js&&Js.unregister(a)}function fn(a,n=[],s=function(){}){let o=!1;const c=new Proxy(s,{get(l,m){if(Qs(o),m===am)return()=>{pm(c),ho(a),o=!0};if(m==="then"){if(n.length===0)return{then:()=>c};const _=Lr(a,{type:"GET",path:n.map(f=>f.toString())}).then(br);return _.then.bind(_)}return fn(a,[...n,m])},set(l,m,_){Qs(o);const[f,b]=ea(_);return Lr(a,{type:"SET",path:[...n,m].map(h=>h.toString()),value:f},b).then(br)},apply(l,m,_){Qs(o);const f=n[n.length-1];if(f===sm)return Lr(a,{type:"ENDPOINT"}).then(br);if(f==="bind")return fn(a,n.slice(0,-1));const[b,h]=wo(_);return Lr(a,{type:"APPLY",path:n.map(T=>T.toString()),argumentList:b},h).then(br)},construct(l,m){Qs(o);const[_,f]=wo(m);return Lr(a,{type:"CONSTRUCT",path:n.map(b=>b.toString()),argumentList:_},f).then(br)}});return cm(c,a),c}function dm(a){return Array.prototype.concat.apply([],a)}function wo(a){const n=a.map(ea);return[n.map(s=>s[0]),dm(n.map(s=>s[1]))]}const vo=new WeakMap;function mm(a,n){return vo.set(a,n),a}function gn(a){return Object.assign(a,{[_o]:!0})}function ea(a){for(const[n,s]of go)if(s.canHandle(a)){const[o,c]=s.serialize(a);return[{type:"HANDLER",name:n,value:o},c]}return[{type:"RAW",value:a},vo.get(a)||[]]}function br(a){switch(a.type){case"HANDLER":return go.get(a.name).deserialize(a.value);case"RAW":return a.value}}function Lr(a,n,s){return new Promise(o=>{const c=um();a.addEventListener("message",function l(m){!m.data||!m.data.id||m.data.id!==c||(a.removeEventListener("message",l),o(m.data))}),a.start&&a.start(),a.postMessage(Object.assign({id:c},n),s)})}function um(){return new Array(4).fill(0).map(()=>Math.floor(Math.random()*Number.MAX_SAFE_INTEGER).toString(16)).join("-")}const To=new Worker(new URL(""+(typeof document>"u"&&typeof location>"u"?require("url").pathToFileURL(__dirname+"/assets/scriptsRunWorker-CgFdwuHM.js").href:new URL("assets/scriptsRunWorker-CgFdwuHM.js",typeof document>"u"?location.href:document.currentScript&&document.currentScript.src||document.baseURI).href),typeof document>"u"&&typeof location>"u"?require("url").pathToFileURL(__filename).href:typeof document>"u"?location.href:Us&&Us.src||new URL("trading-vue-editor.umd.cjs",document.baseURI).href),{type:"module",name:"Run TccScript Server"});To.onerror=a=>{console.error(a)};async function Do(a){return await Gs.setInlayHints(a)}const ko=_n(To),Io=_n(new Worker(new URL(""+(typeof document>"u"&&typeof location>"u"?require("url").pathToFileURL(__dirname+"/assets/parserTccWorker-CqmFqEoS.js").href:new URL("assets/parserTccWorker-CqmFqEoS.js",typeof document>"u"?location.href:document.currentScript&&document.currentScript.src||document.baseURI).href),typeof document>"u"&&typeof location>"u"?require("url").pathToFileURL(__filename).href:typeof document>"u"?location.href:Us&&Us.src||new URL("trading-vue-editor.umd.cjs",document.baseURI).href),{type:"module",name:"Parser TccScript Server"}));async function Ao(a,n=!1){const{functions:s,types:o,constants:c,variables:l,methods:m}=ct;return await Io.parseTcc(a,n,gn(Do),{functions:Object.fromEntries(s),methods:Object.fromEntries(m),types:Object.fromEntries(o),constants:Object.fromEntries(c),variables:Object.fromEntries(l)})}async function ym(a,n){const{functions:s,types:o,constants:c,variables:l,methods:m}=ct;return await Io.parseLibraryCode(a,n,gn(Do),{functions:Object.fromEntries(s),methods:Object.fromEntries(m),types:Object.fromEntries(o),constants:Object.fromEntries(c),variables:Object.fromEntries(l)})}async function qo(a,n,s=!0){return await ko.runScript(a,n,s)}async function _m(a){return await ko.removeScript(a)}function fm(a){return new Worker(""+(typeof document>"u"&&typeof location>"u"?require("url").pathToFileURL(__dirname+"/assets/editor.worker-CT5Cb1wO.js").href:new URL("assets/editor.worker-CT5Cb1wO.js",typeof document>"u"?location.href:document.currentScript&&document.currentScript.src||document.baseURI).href),{name:a==null?void 0:a.name})}self.MonacoEnvironment={getWorker(){return new fm({name:"Editor Worker"})}},sn.config({paths:{vs:"https://cdnjs.cloudflare.com/ajax/libs/monaco-editor/0.45.0/min/vs"},"vs/nls":{availableLanguages:{"*":"zh-cn"}}});let Co={};const gm=(a,n)=>{const{height:s,width:o,theme:c,options:l,hasDiff:m,readOnly:_,defaultValue:f,onChange:b,onLinkOpen:h,onDeclareConfigChange:T,onCursorPositionChange:P,onActionTrigger:B,onEditorDidMount:R}=a,S=F.useRef(null),H=F.useRef(null);F.useImperativeHandle(n,()=>({setOriginalScript(E){var K;(K=S.current)==null||K.setOriginalScript(E)},setScript(E){var K;(K=S.current)==null||K.setValue(E)},gotoLine(){var E;(E=S.current)==null||E.gotoLine()},getEditorLayout(){var E;return(E=S.current)==null?void 0:E.getEditorLayout()},setPosition(E,K){var Z;(Z=S.current)==null||Z.setPosition({column:E,lineNumber:K})},setModelMarkers(E){var K;(K=S.current)==null||K.setModelMarkers(E)},focus(){var E;(E=S.current)==null||E.focus()}})),F.useEffect(()=>{var E,K;m?(K=S.current)==null||K.addDiffDecorations():(E=S.current)==null||E.removeDiffDecorations()},[m]),F.useEffect(()=>{var E;(E=S.current)==null||E.updateActionTrigger(B)},[B]),F.useEffect(()=>{var E;h&&((E=S.current)==null||E.addLinkOpenFunc(h))},[h]);function V(E,K){var fe,le;St.initBuiltinsTrees(),Gs.setEditor(E),S.current=new rm(E,K,B),h&&((fe=S.current)==null||fe.addLinkOpenFunc(h)),m&&((le=S.current)==null||le.addDiffDecorations()),qd(E),requestAnimationFrame(O);const Z=E.getValue();S.current.onChangeCursorPosition(P),b&&b(Z),!_&&G(Z),R&&R()}const G=F.useCallback(async E=>{var $e;const K=Date.now(),{errors:Z,functions:fe,methods:le,types:ht,variables:Et,overloadsFuncs:Ue,imports:Ke,preParserCode:Y,enums:be}=await Ao(E),Ee=new Map(Object.entries(fe)),Me=new Map(Object.entries(le)),pt=new Map(Object.entries(ht)),wt=new Map(Object.entries(Et)),re=new Map(Object.entries(Ke)),xe=new Map(Object.entries(be));gr.setUserDefined({functions:Ee,methods:Me,types:pt,variables:wt,imports:re,enums:xe},Ue),St.setUserDefind(Ee,pt,wt,Me,xe);const Re=Z.map(je=>({...je,severity:je.type||Ie.MarkerSeverity.Error}));if(_)return;try{if(!Z.length&&Y){const je=await qo(Y,{isPreParser:!0});io.isEqual(je,Co)||(Co=je,T&&T(je))}}catch(je){console.log(je),Z.push({message:je.message,startLineNumber:0,endLineNumber:0,startColumn:0,endColumn:0})}($e=S.current)==null||$e.setModelMarkers(Re);const Nt=Date.now();console.log((Nt-K)/1e3)},[T,_]),U=F.useMemo(()=>io.debounce(G,1500),[G]);function k(E){var K;if(_){G(E||"");return}Gs.clearInlayHints(),(K=S.current)==null||K.setModelMarkers([]),E!==void 0&&(b&&b(E),U(E))}const O=F.useCallback(()=>{var K,Z;const E=(K=H.current)==null?void 0:K.getBoundingClientRect();(Z=S.current)==null||Z.setEditorLayout((E==null?void 0:E.height)||0,E==null?void 0:E.width)},[]);return F.useEffect(()=>{const E=()=>{window.requestAnimationFrame(O)},K=new ResizeObserver(E);return H.current&&K.observe(H.current),()=>{var Z;H.current&&K.unobserve(H.current),K.disconnect(),(Z=S.current)==null||Z.dispose()}},[]),L.jsx("div",{ref:H,children:L.jsx(gd,{height:s,width:o||"100%",defaultLanguage:Se,defaultValue:f||`indicator("我的脚本")
145
145
  plot(close)
146
146
  `,theme:c||"vs-dark",className:`tvue-script ${c||"vs-dark"}`,options:{colorDecorators:!0,useShadowDOM:!1,matchOnWordStartOnly:!0,automaticLayout:!1,suggest:{filterGraceful:!0},fontSize:13,..._?Pd:{},readOnlyMessage:{value:"该脚本是只读的。它无法被编辑。"},...l},onMount:V,onChange:k})})},bm=F.forwardRef(gm),xm=a=>{const{theme:n,modified:s,original:o,height:c,width:l,renderSideBySide:m=!0}=a,_=F.useCallback((f,b)=>{b.languages.register({id:Se}),b.editor.defineTheme("vs-dark",cn),b.editor.defineTheme("vs",ln),b.languages.setMonarchTokensProvider(Se,Nr),b.languages.setLanguageConfiguration(Se,on)},[]);return L.jsx(md,{height:c||"90vh",width:l||"100%",theme:n||"vs-dark",options:{readOnly:!0,renderSideBySide:m,scrollBeyondLastLine:!1},language:Se,modified:s,original:o,onMount:_})};A.VMarkerSeverity=void 0,function(a){a[a.Hint=1]="Hint",a[a.Info=2]="Info",a[a.Warning=4]="Warning",a[a.Error=8]="Error"}(A.VMarkerSeverity||(A.VMarkerSeverity={}));var ta={},hm=function(){var a=document.getSelection();if(!a.rangeCount)return function(){};for(var n=document.activeElement,s=[],o=0;o<a.rangeCount;o++)s.push(a.getRangeAt(o));switch(n.tagName.toUpperCase()){case"INPUT":case"TEXTAREA":n.blur();break;default:n=null;break}return a.removeAllRanges(),function(){a.type==="Caret"&&a.removeAllRanges(),a.rangeCount||s.forEach(function(c){a.addRange(c)}),n&&n.focus()}},wm=hm,zo={"text/plain":"Text","text/html":"Url",default:"Text"},vm="Copy to clipboard: #{key}, Enter";function Tm(a){var n=(/mac os x/i.test(navigator.userAgent)?"⌘":"Ctrl")+"+C";return a.replace(/#{\s*key\s*}/g,n)}function Dm(a,n){var s,o,c,l,m,_,f=!1;n||(n={}),s=n.debug||!1;try{c=wm(),l=document.createRange(),m=document.getSelection(),_=document.createElement("span"),_.textContent=a,_.ariaHidden="true",_.style.all="unset",_.style.position="fixed",_.style.top=0,_.style.clip="rect(0, 0, 0, 0)",_.style.whiteSpace="pre",_.style.webkitUserSelect="text",_.style.MozUserSelect="text",_.style.msUserSelect="text",_.style.userSelect="text",_.addEventListener("copy",function(h){if(h.stopPropagation(),n.format)if(h.preventDefault(),typeof h.clipboardData>"u"){s&&console.warn("unable to use e.clipboardData"),s&&console.warn("trying IE specific stuff"),window.clipboardData.clearData();var T=zo[n.format]||zo.default;window.clipboardData.setData(T,a)}else h.clipboardData.clearData(),h.clipboardData.setData(n.format,a);n.onCopy&&(h.preventDefault(),n.onCopy(h.clipboardData))}),document.body.appendChild(_),l.selectNodeContents(_),m.addRange(l);var b=document.execCommand("copy");if(!b)throw new Error("copy command was unsuccessful");f=!0}catch(h){s&&console.error("unable to copy using execCommand: ",h),s&&console.warn("trying IE specific stuff");try{window.clipboardData.setData(n.format||"text",a),n.onCopy&&n.onCopy(window.clipboardData),f=!0}catch(T){s&&console.error("unable to copy using clipboardData: ",T),s&&console.error("falling back to prompt"),o=Tm("message"in n?n.message:vm),window.prompt(o,a)}}finally{m&&(typeof m.removeRange=="function"?m.removeRange(l):m.removeAllRanges()),_&&document.body.removeChild(_),c()}return f}var km=Dm;function bn(a){"@babel/helpers - typeof";return bn=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(n){return typeof n}:function(n){return n&&typeof Symbol=="function"&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n},bn(a)}Object.defineProperty(ta,"__esModule",{value:!0}),ta.CopyToClipboard=void 0;var ra=So(F),Im=So(km),Am=["text","onCopy","options","children"];function So(a){return a&&a.__esModule?a:{default:a}}function Eo(a,n){var s=Object.keys(a);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(a);n&&(o=o.filter(function(c){return Object.getOwnPropertyDescriptor(a,c).enumerable})),s.push.apply(s,o)}return s}function No(a){for(var n=1;n<arguments.length;n++){var s=arguments[n]!=null?arguments[n]:{};n%2?Eo(Object(s),!0).forEach(function(o){hn(a,o,s[o])}):Object.getOwnPropertyDescriptors?Object.defineProperties(a,Object.getOwnPropertyDescriptors(s)):Eo(Object(s)).forEach(function(o){Object.defineProperty(a,o,Object.getOwnPropertyDescriptor(s,o))})}return a}function qm(a,n){if(a==null)return{};var s=Cm(a,n),o,c;if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(a);for(c=0;c<l.length;c++)o=l[c],!(n.indexOf(o)>=0)&&Object.prototype.propertyIsEnumerable.call(a,o)&&(s[o]=a[o])}return s}function Cm(a,n){if(a==null)return{};var s={},o=Object.keys(a),c,l;for(l=0;l<o.length;l++)c=o[l],!(n.indexOf(c)>=0)&&(s[c]=a[c]);return s}function zm(a,n){if(!(a instanceof n))throw new TypeError("Cannot call a class as a function")}function Lo(a,n){for(var s=0;s<n.length;s++){var o=n[s];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(a,o.key,o)}}function Sm(a,n,s){return n&&Lo(a.prototype,n),s&&Lo(a,s),Object.defineProperty(a,"prototype",{writable:!1}),a}function Em(a,n){if(typeof n!="function"&&n!==null)throw new TypeError("Super expression must either be null or a function");a.prototype=Object.create(n&&n.prototype,{constructor:{value:a,writable:!0,configurable:!0}}),Object.defineProperty(a,"prototype",{writable:!1}),n&&xn(a,n)}function xn(a,n){return xn=Object.setPrototypeOf||function(o,c){return o.__proto__=c,o},xn(a,n)}function Nm(a){var n=Mm();return function(){var o=sa(a),c;if(n){var l=sa(this).constructor;c=Reflect.construct(o,arguments,l)}else c=o.apply(this,arguments);return Lm(this,c)}}function Lm(a,n){if(n&&(bn(n)==="object"||typeof n=="function"))return n;if(n!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Mo(a)}function Mo(a){if(a===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return a}function Mm(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function sa(a){return sa=Object.setPrototypeOf?Object.getPrototypeOf:function(s){return s.__proto__||Object.getPrototypeOf(s)},sa(a)}function hn(a,n,s){return n in a?Object.defineProperty(a,n,{value:s,enumerable:!0,configurable:!0,writable:!0}):a[n]=s,a}var Po=function(a){Em(s,a);var n=Nm(s);function s(){var o;zm(this,s);for(var c=arguments.length,l=new Array(c),m=0;m<c;m++)l[m]=arguments[m];return o=n.call.apply(n,[this].concat(l)),hn(Mo(o),"onClick",function(_){var f=o.props,b=f.text,h=f.onCopy,T=f.children,P=f.options,B=ra.default.Children.only(T),R=(0,Im.default)(b,P);h&&h(b,R),B&&B.props&&typeof B.props.onClick=="function"&&B.props.onClick(_)}),o}return Sm(s,[{key:"render",value:function(){var c=this.props;c.text,c.onCopy,c.options;var l=c.children,m=qm(c,Am),_=ra.default.Children.only(l);return ra.default.cloneElement(_,No(No({},m),{},{onClick:this.onClick}))}}]),s}(ra.default.PureComponent);ta.CopyToClipboard=Po,hn(Po,"defaultProps",{onCopy:void 0,options:void 0});var Pm=ta,wn=Pm.CopyToClipboard;wn.CopyToClipboard=wn;var Om=wn;const vn=cp(Om);async function Rm(a,n=0){const s=a[n];if(!s)return;const{name:o,args:c,type:l,desc:m,examples:_,remarks:f,seeAlso:b,syntax:h,detailedDesc:T,fields:P,returns:B}=s,R={name:o};if(a.length>1&&(R.overloads=`${a.length} overloads`),l&&(R.type=l),c&&(R.name=`${o}()`,R.args=c.map(S=>{const{name:H,desc:V,displayType:G}=S;return{label:`${H} (${G})`,desc:V&&xr(V)}})),m&&(R.desc=m.map(S=>xr(S))),_&&(R.originalExample=_.join(`
147
147
  `),R.examples=await Ie.editor.colorize(R.originalExample,Se,{tabSize:4})),T){R.detailedDesc=[];for(const S of T){const{desc:H,examples:V}=S;let G=H.map(O=>xr(O)),U,k;V&&(k=V.join(`
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@guihz/trading-vue-editor-tes",
3
- "version": "0.0.148",
3
+ "version": "0.0.150",
4
4
  "type": "module",
5
5
  "files": [
6
6
  "lib"