@ws-ui/code-editor 1.8.0 → 1.8.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.es.js CHANGED
@@ -1,22 +1,22 @@
1
- import { jsxs as P, jsx as k, Fragment as Se } from "react/jsx-runtime";
2
- import D, { useEffect as V, createContext as le, useState as _, useRef as oe, useContext as ae, memo as ye } from "react";
3
- import { loader as Ne, useMonaco as Re, Editor as we } from "@monaco-editor/react";
4
- import { lspSubject as xe, LspActions as E, hasAttributesString as ge, FileFolderType as ie, SourceCodeDescriptor as ke, HTTP_HANDLERS_TAB_PATH as Le } from "@ws-ui/shared";
5
- import { MonacoLanguageClient as We } from "monaco-languageclient";
6
- import { mergeServices as Fe, initServices as Ze } from "monaco-languageclient/vscode/services";
7
- import je, { initUserConfiguration as Xe } from "@codingame/monaco-vscode-configuration-service-override";
8
- import Ee from "@codingame/monaco-vscode-languages-service-override";
9
- import Ke from "@codingame/monaco-vscode-textmate-service-override";
1
+ import { jsxs as z, jsx as w } from "react/jsx-runtime";
2
+ import O, { useEffect as M, createContext as le, useState as $, useRef as oe, useContext as ae, memo as Se } from "react";
3
+ import { loader as ye, useMonaco as Ne, Editor as Re } from "@monaco-editor/react";
4
+ import { lspSubject as we, LspActions as E, hasAttributesString as ge, FileFolderType as ie, SourceCodeDescriptor as xe, HTTP_HANDLERS_TAB_PATH as ke } from "@ws-ui/shared";
5
+ import { MonacoLanguageClient as Le } from "monaco-languageclient";
6
+ import { mergeServices as We, initServices as Fe } from "monaco-languageclient/vscode/services";
7
+ import Ze, { initUserConfiguration as je } from "@codingame/monaco-vscode-configuration-service-override";
8
+ import Xe from "@codingame/monaco-vscode-languages-service-override";
9
+ import Ee from "@codingame/monaco-vscode-textmate-service-override";
10
10
  import "@codingame/monaco-vscode-theme-defaults-default-extension";
11
- import Be from "@codingame/monaco-vscode-editor-service-override";
12
- import Te from "@codingame/monaco-vscode-theme-service-override";
11
+ import Ke from "@codingame/monaco-vscode-editor-service-override";
12
+ import Be from "@codingame/monaco-vscode-theme-service-override";
13
13
  import * as l from "monaco-editor";
14
- import { Selection as Oe, KeyMod as J, KeyCode as M, editor as ce, Range as De, Uri as Ge, CancellationTokenSource as Je } from "monaco-editor";
15
- import { Logger as Me } from "monaco-languageclient/tools";
16
- import { CloseAction as Pe, ErrorAction as Ve } from "vscode-languageclient";
17
- import { WebSocketMessageReader as Ye, WebSocketMessageWriter as He, toSocket as ze } from "vscode-ws-jsonrpc";
18
- import { TextDocumentSaveReason as $e, DocumentDiagnosticRequest as _e, WillSaveTextDocumentNotification as Ue, DidSaveTextDocumentNotification as qe, WillCreateFilesRequest as Qe, WillRenameFilesRequest as et, WillDeleteFilesRequest as tt, DidCreateFilesNotification as nt, DidRenameFilesNotification as it, DidDeleteFilesNotification as ot, SemanticTokensRegistrationType as rt } from "vscode-languageserver-protocol";
19
- import { StandaloneServices as st, ICodeEditorService as lt } from "vscode/services";
14
+ import { Selection as Te, KeyMod as G, KeyCode as J, editor as ce, Range as Oe, Uri as De, CancellationTokenSource as Ge } from "monaco-editor";
15
+ import { Logger as Je } from "monaco-languageclient/tools";
16
+ import { CloseAction as Me, ErrorAction as Pe } from "vscode-languageclient";
17
+ import { WebSocketMessageReader as Ve, WebSocketMessageWriter as Ye, toSocket as He } from "vscode-ws-jsonrpc";
18
+ import { TextDocumentSaveReason as ze, DocumentDiagnosticRequest as $e, WillSaveTextDocumentNotification as _e, DidSaveTextDocumentNotification as Ue, WillCreateFilesRequest as qe, WillRenameFilesRequest as Qe, WillDeleteFilesRequest as et, DidCreateFilesNotification as tt, DidRenameFilesNotification as nt, DidDeleteFilesNotification as it, SemanticTokensRegistrationType as ot } from "vscode-languageserver-protocol";
19
+ import { StandaloneServices as rt, ICodeEditorService as st } from "vscode/services";
20
20
  import { KeybindingsRegistry as te } from "vscode/monaco";
21
21
  import "@codingame/monaco-vscode-standalone-languages";
22
22
  import "@codingame/monaco-vscode-standalone-html-language-features";
@@ -27,14 +27,14 @@ import "@codingame/monaco-vscode-css-default-extension";
27
27
  import "@codingame/monaco-vscode-json-default-extension";
28
28
  import "@codingame/monaco-vscode-html-default-extension";
29
29
  import "@codingame/monaco-vscode-javascript-default-extension";
30
- import { registerExtension as at } from "vscode/extensions";
31
- const gt = () => je(), ct = () => Be(
30
+ import { registerExtension as lt } from "vscode/extensions";
31
+ const at = () => Ze(), gt = () => Ke(
32
32
  () => Promise.resolve(void 0)
33
- ), ut = () => {
34
- const t = Te(), e = t.themeService.ctor.prototype;
33
+ ), ct = () => {
34
+ const t = Be(), e = t.themeService.ctor.prototype;
35
35
  return e.defineTheme = () => {
36
36
  }, t;
37
- }, dt = `{
37
+ }, ut = `{
38
38
  "workbench.colorTheme": "Default Dark+",
39
39
  "workbench.iconTheme": "vs-seti",
40
40
  "editor.autoClosingBrackets": "languageDefined",
@@ -119,10 +119,10 @@ const gt = () => je(), ct = () => Be(
119
119
  }
120
120
  }
121
121
  }
122
- `, It = () => Xe(dt), Ct = async (t) => {
122
+ `, dt = () => je(ut), It = async (t) => {
123
123
  var o;
124
124
  const e = t.serviceConfig ?? {};
125
- e.debugLogging = ((o = t.logger) == null ? void 0 : o.isEnabled()) === !0 && (e.debugLogging === !0 || t.logger.isDebugEnabled() === !0), await It(), e.userServices = e.userServices ?? {};
125
+ e.debugLogging = ((o = t.logger) == null ? void 0 : o.isEnabled()) === !0 && (e.debugLogging === !0 || t.logger.isDebugEnabled() === !0), await dt(), e.userServices = e.userServices ?? {};
126
126
  const n = e.userServices.configurationService ?? void 0, i = e.workspaceConfig ?? void 0;
127
127
  if (n === void 0) {
128
128
  if (i)
@@ -131,13 +131,13 @@ const gt = () => je(), ct = () => Be(
131
131
  );
132
132
  const r = {
133
133
  // @see https://github.com/CodinGame/monaco-vscode-api#monaco-standalone-services
134
- ...gt(),
135
- ...ut(),
136
- ...Ke(),
134
+ ...at(),
135
+ ...ct(),
137
136
  ...Ee(),
138
- ...ct()
137
+ ...Xe(),
138
+ ...gt()
139
139
  };
140
- Fe(r, e.userServices);
140
+ We(r, e.userServices);
141
141
  }
142
142
  return i || (e.workspaceConfig = {
143
143
  workspaceProvider: {
@@ -151,7 +151,7 @@ const gt = () => je(), ct = () => Be(
151
151
  }
152
152
  }), e;
153
153
  };
154
- class mt extends Ye {
154
+ class Ct extends Ve {
155
155
  constructor(e, n) {
156
156
  super(e), this.onMessage = n;
157
157
  }
@@ -168,7 +168,7 @@ class mt extends Ye {
168
168
  }
169
169
  }
170
170
  }
171
- class ft extends He {
171
+ class mt extends Ye {
172
172
  constructor(e, n) {
173
173
  super(e), this.onSend = n;
174
174
  }
@@ -188,8 +188,8 @@ function j(t, e = !0) {
188
188
  function ue(t, e = 0) {
189
189
  setTimeout(t, e);
190
190
  }
191
- function pt(t, e) {
192
- const n = new Oe(
191
+ function ft(t, e) {
192
+ const n = new Te(
193
193
  e.startLineNumber,
194
194
  e.startColumn,
195
195
  e.endLineNumber || e.startLineNumber,
@@ -199,24 +199,24 @@ function pt(t, e) {
199
199
  t.setSelection(n), t.revealRangeInCenter(n), t.focus();
200
200
  });
201
201
  }
202
- function At(t, e, n = 0) {
202
+ function pt(t, e, n = 0) {
203
203
  n > 0 && (e = n + e), ue(() => {
204
204
  t.setPosition({ lineNumber: e, column: 1 }), t.revealLineInCenter(e), t.focus();
205
205
  });
206
206
  }
207
- function wn(t, e, n) {
207
+ function Nn(t, e, n) {
208
208
  const o = t.getModel();
209
209
  if (o && e) {
210
210
  const r = o.getLineCount();
211
211
  for (let s = 1; s <= r; s++) {
212
- const m = o.getLineContent(s);
213
- if (new RegExp(`(?:Function|function) ${n}`).test(m))
212
+ const p = o.getLineContent(s);
213
+ if (new RegExp(`(?:Function|function) ${n}`).test(p))
214
214
  return s;
215
215
  }
216
216
  }
217
217
  return 0;
218
218
  }
219
- const bt = {
219
+ const At = {
220
220
  provideCompletionItems: async (t, e) => {
221
221
  const n = t.getWordUntilPosition(e);
222
222
  return {
@@ -333,7 +333,7 @@ const bt = {
333
333
  ]
334
334
  };
335
335
  }
336
- }, ht = {
336
+ }, bt = {
337
337
  provideCompletionItems: async (t, e) => {
338
338
  const n = t.getWordUntilPosition(e);
339
339
  return {
@@ -448,45 +448,45 @@ const bt = {
448
448
  ]
449
449
  };
450
450
  }
451
- }, vt = [
451
+ }, ht = [
452
452
  // zoom in
453
453
  {
454
- keybinding: J.CtrlCmd | M.NumpadAdd,
454
+ keybinding: G.CtrlCmd | J.NumpadAdd,
455
455
  command: "editor.action.fontZoomIn"
456
456
  },
457
457
  {
458
- keybinding: J.CtrlCmd | M.Equal,
458
+ keybinding: G.CtrlCmd | J.Equal,
459
459
  command: "editor.action.fontZoomIn"
460
460
  },
461
461
  // zoom out
462
462
  {
463
- keybinding: J.CtrlCmd | M.NumpadSubtract,
463
+ keybinding: G.CtrlCmd | J.NumpadSubtract,
464
464
  command: "editor.action.fontZoomOut"
465
465
  },
466
466
  {
467
- keybinding: J.CtrlCmd | M.Minus,
467
+ keybinding: G.CtrlCmd | J.Minus,
468
468
  command: "editor.action.fontZoomOut"
469
469
  },
470
470
  // zoom reset
471
471
  {
472
- keybinding: J.CtrlCmd | M.Numpad0,
472
+ keybinding: G.CtrlCmd | J.Numpad0,
473
473
  command: "editor.action.fontZoomReset"
474
474
  },
475
475
  {
476
- keybinding: J.CtrlCmd | M.Digit0,
476
+ keybinding: G.CtrlCmd | J.Digit0,
477
477
  command: "editor.action.fontZoomReset"
478
478
  }
479
- ], St = ({ defaultZoom: t }) => (V(() => {
479
+ ], vt = ({ defaultZoom: t }) => (M(() => {
480
480
  t !== void 0 && ce.EditorZoom.setZoomLevel(t);
481
481
  }, []), null);
482
- Ne.config({
482
+ ye.config({
483
483
  monaco: l
484
484
  // paths: {
485
485
  // vs: import.meta.env.VITE_MONACO_EDITOR_CDN,
486
486
  // },
487
487
  });
488
- var $ = /* @__PURE__ */ ((t) => (t[t.NotSet = -1] = "NotSet", t[t.None = 0] = "None", t[t.Italic = 1] = "Italic", t[t.Bold = 2] = "Bold", t[t.Underline = 4] = "Underline", t[t.Strikethrough = 8] = "Strikethrough", t))($ || {}), de = /* @__PURE__ */ ((t) => (t[t.None = 0] = "None", t[t.DefaultForeground = 1] = "DefaultForeground", t[t.DefaultBackground = 2] = "DefaultBackground", t))(de || {}), Ie = /* @__PURE__ */ ((t) => (t[t.Other = 0] = "Other", t[t.Comment = 1] = "Comment", t[t.String = 2] = "String", t[t.RegEx = 3] = "RegEx", t))(Ie || {});
489
- class H {
488
+ var H = /* @__PURE__ */ ((t) => (t[t.NotSet = -1] = "NotSet", t[t.None = 0] = "None", t[t.Italic = 1] = "Italic", t[t.Bold = 2] = "Bold", t[t.Underline = 4] = "Underline", t[t.Strikethrough = 8] = "Strikethrough", t))(H || {}), de = /* @__PURE__ */ ((t) => (t[t.None = 0] = "None", t[t.DefaultForeground = 1] = "DefaultForeground", t[t.DefaultBackground = 2] = "DefaultBackground", t))(de || {}), Ie = /* @__PURE__ */ ((t) => (t[t.Other = 0] = "Other", t[t.Comment = 1] = "Comment", t[t.String = 2] = "String", t[t.RegEx = 3] = "RegEx", t))(Ie || {});
489
+ class V {
490
490
  static getLanguageId(e) {
491
491
  return (e & 255) >>> 0;
492
492
  }
@@ -528,47 +528,47 @@ class H {
528
528
  };
529
529
  }
530
530
  }
531
- function yt(t, e, n, i) {
531
+ function St(t, e, n, i) {
532
532
  const o = n.tokens.data, r = t.getLanguageId();
533
- let s = 0, m = 0;
534
- const I = i.lineNumber - 1, h = i.column - 1;
533
+ let s = 0, p = 0;
534
+ const m = i.lineNumber - 1, h = i.column - 1;
535
535
  for (let C = 0; C < o.length; C += 5) {
536
- const f = o[C], A = o[C + 1], N = o[C + 2], x = o[C + 3], S = o[C + 4], R = s + f, b = f === 0 ? m + A : A;
537
- if (I === R && b <= h && h < b + N) {
538
- const L = n.legend.tokenTypes[x] || "not in legend (ignored)", p = [];
536
+ const A = o[C], f = o[C + 1], x = o[C + 2], R = o[C + 3], S = o[C + 4], y = s + A, b = A === 0 ? p + f : f;
537
+ if (m === y && b <= h && h < b + x) {
538
+ const d = n.legend.tokenTypes[R] || "not in legend (ignored)", F = [];
539
539
  let a = S;
540
- for (let Y = 0; a > 0 && Y < n.legend.tokenModifiers.length; Y++)
541
- a & 1 && p.push(n.legend.tokenModifiers[Y]), a = a >> 1;
542
- a > 0 && p.push("not in legend (ignored)");
543
- const u = new De(
544
- R + 1,
540
+ for (let P = 0; a > 0 && P < n.legend.tokenModifiers.length; P++)
541
+ a & 1 && F.push(n.legend.tokenModifiers[P]), a = a >> 1;
542
+ a > 0 && F.push("not in legend (ignored)");
543
+ const g = new Oe(
544
+ y + 1,
545
545
  b + 1,
546
- R + 1,
547
- b + 1 + N
548
- ), y = {}, W = e.getColorTheme().tokenColorMap, v = e.getColorTheme().getTokenStyleMetadata(
549
- L,
550
- p,
546
+ y + 1,
547
+ b + 1 + x
548
+ ), k = {}, L = e.getColorTheme().tokenColorMap, v = e.getColorTheme().getTokenStyleMetadata(
549
+ d,
550
+ F,
551
551
  r,
552
552
  !0,
553
- y
553
+ k
554
554
  );
555
- let O;
556
- return v && (O = {
555
+ let _;
556
+ return v && (_ = {
557
557
  languageId: void 0,
558
558
  tokenType: Ie.Other,
559
559
  bold: v == null ? void 0 : v.bold,
560
560
  italic: v == null ? void 0 : v.italic,
561
561
  underline: v == null ? void 0 : v.underline,
562
562
  strikethrough: v == null ? void 0 : v.strikethrough,
563
- foreground: W[(v == null ? void 0 : v.foreground) || de.None],
563
+ foreground: L[(v == null ? void 0 : v.foreground) || de.None],
564
564
  background: void 0
565
- }), { type: L, modifiers: p, range: u, metadata: O, definitions: y };
565
+ }), { type: d, modifiers: F, range: g, metadata: _, definitions: k };
566
566
  }
567
- s = R, m = b;
567
+ s = y, p = b;
568
568
  }
569
569
  return null;
570
570
  }
571
- function Nt(t, e, n) {
571
+ function yt(t, e, n) {
572
572
  let i = null;
573
573
  for (let o = 1; o < n; o++)
574
574
  i = e.tokenizeLine(
@@ -577,51 +577,51 @@ function Nt(t, e, n) {
577
577
  ).ruleStack;
578
578
  return i;
579
579
  }
580
- function Rt(t, e, n) {
581
- const i = t.getColorTheme().tokenColorMap, o = H.getLanguageId(n), r = H.getTokenType(n), s = H.getFontStyle(n), m = H.getForeground(n), I = H.getBackground(n);
580
+ function Nt(t, e, n) {
581
+ const i = t.getColorTheme().tokenColorMap, o = V.getLanguageId(n), r = V.getTokenType(n), s = V.getFontStyle(n), p = V.getForeground(n), m = V.getBackground(n);
582
582
  return {
583
583
  languageId: e.languageIdCodec.decodeLanguageId(o),
584
584
  tokenType: r,
585
- bold: s & $.Bold ? !0 : void 0,
586
- italic: s & $.Italic ? !0 : void 0,
587
- underline: s & $.Underline ? !0 : void 0,
588
- strikethrough: s & $.Strikethrough ? !0 : void 0,
589
- foreground: i[m],
590
- background: i[I]
585
+ bold: s & H.Bold ? !0 : void 0,
586
+ italic: s & H.Italic ? !0 : void 0,
587
+ underline: s & H.Underline ? !0 : void 0,
588
+ strikethrough: s & H.Strikethrough ? !0 : void 0,
589
+ foreground: i[p],
590
+ background: i[m]
591
591
  };
592
592
  }
593
- function wt(t, e, n) {
594
- const i = n.lineNumber, o = t, r = o._tokenizationTextModelPart.grammarTokens._tokenizer.tokenizationSupport._actual._grammar, s = Nt(t, r, i), m = r.tokenizeLine(
593
+ function Rt(t, e, n) {
594
+ const i = n.lineNumber, o = t, r = o._tokenizationTextModelPart.grammarTokens._tokenizer.tokenizationSupport._actual._grammar, s = yt(t, r, i), p = r.tokenizeLine(
595
595
  t.getLineContent(i),
596
596
  s
597
- ), I = r.tokenizeLine2(
597
+ ), m = r.tokenizeLine2(
598
598
  t.getLineContent(i),
599
599
  s
600
600
  );
601
601
  let h = 0;
602
- for (let f = m.tokens.length - 1; f >= 0; f--) {
603
- const A = m.tokens[f];
604
- if (n.column - 1 >= A.startIndex) {
605
- h = f;
602
+ for (let A = p.tokens.length - 1; A >= 0; A--) {
603
+ const f = p.tokens[A];
604
+ if (n.column - 1 >= f.startIndex) {
605
+ h = A;
606
606
  break;
607
607
  }
608
608
  }
609
609
  let C = 0;
610
- for (let f = I.tokens.length >>> 1; f >= 0; f--)
611
- if (n.column - 1 >= I.tokens[f << 1]) {
612
- C = f;
610
+ for (let A = m.tokens.length >>> 1; A >= 0; A--)
611
+ if (n.column - 1 >= m.tokens[A << 1]) {
612
+ C = A;
613
613
  break;
614
614
  }
615
615
  return {
616
- token: m.tokens[h],
617
- metadata: Rt(
616
+ token: p.tokens[h],
617
+ metadata: Nt(
618
618
  e,
619
619
  o._languageService,
620
- I.tokens[(C << 1) + 1]
620
+ m.tokens[(C << 1) + 1]
621
621
  )
622
622
  };
623
623
  }
624
- const Ce = le(void 0), xn = ({
624
+ const Ce = le(void 0), Rn = ({
625
625
  children: t,
626
626
  url: e,
627
627
  qodly: n,
@@ -630,174 +630,174 @@ const Ce = le(void 0), xn = ({
630
630
  language: r = "4d",
631
631
  defaultInited: s = !1
632
632
  }) => {
633
- const m = Re(), [I, h] = _(s), [C, f] = _(null), A = oe(), N = oe(0);
634
- V(() => {
635
- e && m && x();
636
- }, [e, m]);
637
- const x = async () => {
638
- if (!m) return;
639
- const d = new Me({
633
+ const p = Ne(), [m, h] = $(s), [C, A] = $(null), f = oe(), x = oe(0);
634
+ M(() => {
635
+ e && p && R();
636
+ }, [e, p]);
637
+ const R = async () => {
638
+ if (!p) return;
639
+ const I = new Je({
640
640
  enabled: process.env.NODE_ENV === "development",
641
641
  debugEnabled: process.env.NODE_ENV === "development"
642
- }), g = await Ct({
643
- logger: d
642
+ }), c = await It({
643
+ logger: I
644
644
  });
645
- await Ze({
645
+ await Fe({
646
646
  caller: "Qodly Code Editor",
647
- logger: d,
648
- serviceConfig: g
649
- }), o && st.get(lt).registerCodeEditorOpenHandler(o), m.languages.registerCompletionItemProvider(
647
+ logger: I,
648
+ serviceConfig: c
649
+ }), o && rt.get(st).registerCodeEditorOpenHandler(o), p.languages.registerCompletionItemProvider(
650
650
  r,
651
- n ? ht : bt
651
+ n ? bt : At
652
652
  );
653
- const c = te.getDefaultKeybindings.bind(te);
654
- te.getDefaultKeybindings = () => c().filter(
653
+ const u = te.getDefaultKeybindings.bind(te);
654
+ te.getDefaultKeybindings = () => u().filter(
655
655
  (Z) => ![
656
656
  "workbench.action.files.saveAs",
657
657
  "workbench.action.files.save"
658
658
  ].includes(Z.command)
659
- ), ce.addKeybindingRules(vt), m.languages.registerFoldingRangeProvider(r, {
660
- provideFoldingRanges: function(w) {
659
+ ), ce.addKeybindingRules(ht), p.languages.registerFoldingRangeProvider(r, {
660
+ provideFoldingRanges: function(N) {
661
661
  const Z = [], X = /\\\s*$/;
662
- for (let F = 1, G = w.getLineCount(); F <= G; F++) {
663
- const U = w.getLineContent(F);
662
+ for (let W = 1, D = N.getLineCount(); W <= D; W++) {
663
+ const U = N.getLineContent(W);
664
664
  if (X.exec(U)) {
665
- let K = F + 1;
666
- for (; K <= G; ) {
667
- const ee = w.getLineContent(K);
665
+ let K = W + 1;
666
+ for (; K <= D; ) {
667
+ const ee = N.getLineContent(K);
668
668
  if (X.exec(ee) == null)
669
669
  break;
670
670
  K++;
671
671
  }
672
- K > F && (Z.push({
673
- start: F,
672
+ K > W && (Z.push({
673
+ start: W,
674
674
  end: K,
675
- kind: m.languages.FoldingRangeKind.Region
676
- }), F = K);
675
+ kind: p.languages.FoldingRangeKind.Region
676
+ }), W = K);
677
677
  }
678
678
  }
679
679
  return Z;
680
680
  }
681
681
  }), S();
682
682
  }, S = () => {
683
- f(null);
684
- let d;
683
+ A(null);
684
+ let I;
685
685
  try {
686
- d = new WebSocket(localStorage.LSP_SERVER || e);
686
+ I = new WebSocket(localStorage.LSP_SERVER || e);
687
687
  } catch {
688
- f(new Event("INVALID_URL"));
688
+ A(new Event("INVALID_URL"));
689
689
  return;
690
690
  }
691
- d.onopen = R, d.onclose = b, d.onerror = L, N.current = 0;
692
- }, R = async function() {
693
- const d = ze(this), g = new mt(d), c = new ft(d), w = new We({
691
+ I.onopen = y, I.onclose = b, I.onerror = d, x.current = 0;
692
+ }, y = async function() {
693
+ const I = He(this), c = new Ct(I), u = new mt(I), N = new Le({
694
694
  name: "4D Language Client",
695
695
  clientOptions: {
696
696
  workspaceFolder: {
697
- uri: Ge.parse("file:///PACKAGE")
697
+ uri: De.parse("file:///PACKAGE")
698
698
  },
699
699
  // use a language id as a document selector
700
700
  documentSelector: [{ scheme: "file", language: r }],
701
701
  // disable the default error handler
702
702
  errorHandler: {
703
- error: () => ({ action: Ve.Continue }),
704
- closed: () => ({ action: Pe.DoNotRestart })
703
+ error: () => ({ action: Pe.Continue }),
704
+ closed: () => ({ action: Me.DoNotRestart })
705
705
  }
706
706
  },
707
707
  // create a language client connection from the JSON RPC connection on demand
708
708
  connectionProvider: {
709
709
  get: () => Promise.resolve({
710
- reader: g,
711
- writer: c
710
+ reader: c,
711
+ writer: u
712
712
  })
713
713
  }
714
714
  });
715
- A.current = w;
716
- const Z = w.sendRequest.bind(w);
717
- A.current.sendRequest = function(X, F, G) {
715
+ f.current = N;
716
+ const Z = N.sendRequest.bind(N);
717
+ f.current.sendRequest = function(X, W, D) {
718
718
  return typeof X == "object" && X.method === "textDocument/diagnostic" && /file:\/\/\/PACKAGE\/Project\/Sources\/Methods\/__Debugger_.*/.test(
719
- F.textDocument.uri
720
- ) ? Promise.resolve() : Z(X, F, G);
721
- }, g.onClose(() => {
722
- w.stop(), N.current < 3 ? setTimeout(() => {
723
- N.current++, S();
724
- }, 1e3) : f(new Event("WEBSOCKET_CLOSED"));
725
- }), w.needsStart() && await w.start(), h(!0);
719
+ W.textDocument.uri
720
+ ) ? Promise.resolve() : Z(X, W, D);
721
+ }, c.onClose(() => {
722
+ N.stop(), x.current < 3 ? setTimeout(() => {
723
+ x.current++, S();
724
+ }, 1e3) : A(new Event("WEBSOCKET_CLOSED"));
725
+ }), N.needsStart() && await N.start(), h(!0);
726
726
  }, b = () => {
727
- }, L = (d) => {
728
- f(d);
727
+ }, d = (I) => {
728
+ A(I);
729
729
  };
730
- V(() => {
731
- const d = xe.subscribe(({ action: g, payload: c }) => {
732
- switch (g) {
730
+ M(() => {
731
+ const I = we.subscribe(({ action: c, payload: u }) => {
732
+ switch (c) {
733
733
  case E.WILL_SAVE:
734
- W(c.filePath);
734
+ L(u.filePath);
735
735
  break;
736
736
  case E.DID_SAVE:
737
- T(c.filePath, c.content);
737
+ T(u.filePath, u.content);
738
738
  break;
739
739
  case E.WILL_CREATE:
740
- v(c.filePath);
740
+ v(u.filePath);
741
741
  break;
742
742
  case E.DID_CREATE:
743
- be(c.filePath);
743
+ be(u.filePath);
744
744
  break;
745
745
  case E.WILL_RENAME:
746
- O(c.oldPath, c.newPath);
746
+ _(u.oldPath, u.newPath);
747
747
  break;
748
748
  case E.DID_RENAME:
749
- he(c.oldPath, c.newPath);
749
+ he(u.oldPath, u.newPath);
750
750
  break;
751
751
  case E.WILL_DELETE:
752
- Y(c.filePath);
752
+ P(u.filePath);
753
753
  break;
754
754
  case E.DID_DELETE:
755
- ve(c.filePath);
755
+ ve(u.filePath);
756
756
  break;
757
757
  case E.DIAGNOSTIC_REFRESH:
758
- y(c.filePath);
758
+ k(u.filePath);
759
759
  break;
760
760
  }
761
761
  });
762
- return () => d.unsubscribe();
762
+ return () => I.unsubscribe();
763
763
  }, []);
764
- const p = (d) => {
765
- var g, c;
766
- return (c = (g = A.current) == null ? void 0 : g._features) == null ? void 0 : c.find(
767
- (w) => {
764
+ const F = (I) => {
765
+ var c, u;
766
+ return (u = (c = f.current) == null ? void 0 : c._features) == null ? void 0 : u.find(
767
+ (N) => {
768
768
  var Z;
769
- return ((Z = w._registrationType) == null ? void 0 : Z.method) === d;
769
+ return ((Z = N._registrationType) == null ? void 0 : Z.method) === I;
770
770
  }
771
771
  );
772
- }, a = (d) => {
773
- const g = [], c = p(d);
774
- if (c)
775
- for (const [, w] of c._registrations)
776
- w.provider && g.push(w.provider);
777
- return g;
778
- }, u = async (d, g, c) => {
779
- var Z, X, F;
780
- const w = a(
781
- rt.method
772
+ }, a = (I) => {
773
+ const c = [], u = F(I);
774
+ if (u)
775
+ for (const [, N] of u._registrations)
776
+ N.provider && c.push(N.provider);
777
+ return c;
778
+ }, g = async (I, c, u) => {
779
+ var Z, X, W;
780
+ const N = a(
781
+ ot.method
782
782
  );
783
- if (w[0]) {
784
- const G = new Je(), U = await Promise.resolve(
785
- w[0].full.provideDocumentSemanticTokens(
786
- g,
787
- G.token
783
+ if (N[0]) {
784
+ const D = new Ge(), U = await Promise.resolve(
785
+ N[0].full.provideDocumentSemanticTokens(
786
+ c,
787
+ D.token
788
788
  )
789
- ), Q = d, K = U ? yt(
790
- g,
789
+ ), Q = I, K = U ? St(
790
+ c,
791
791
  Q._themeService,
792
792
  {
793
793
  tokens: U,
794
- legend: (F = (X = (Z = A.current) == null ? void 0 : Z._capabilities) == null ? void 0 : X.semanticTokensProvider) == null ? void 0 : F.legend
794
+ legend: (W = (X = (Z = f.current) == null ? void 0 : Z._capabilities) == null ? void 0 : X.semanticTokensProvider) == null ? void 0 : W.legend
795
795
  },
796
- c
797
- ) : null, ee = wt(
798
- g,
796
+ u
797
+ ) : null, ee = Rt(
798
+ c,
799
799
  Q._themeService,
800
- c
800
+ u
801
801
  );
802
802
  return {
803
803
  semanticTokenInfo: K,
@@ -805,105 +805,105 @@ const Ce = le(void 0), xn = ({
805
805
  };
806
806
  }
807
807
  return null;
808
- }, y = (d) => {
809
- if (A.current) {
810
- const g = a(
811
- _e.method
808
+ }, k = (I) => {
809
+ if (f.current) {
810
+ const c = a(
811
+ $e.method
812
812
  );
813
- for (const c of g)
814
- c.onDidChangeDiagnosticsEmitter.fire();
813
+ for (const u of c)
814
+ u.onDidChangeDiagnosticsEmitter.fire();
815
815
  }
816
- }, W = (d, g = $e.Manual) => {
817
- var c;
818
- (c = A.current) == null || c.sendNotification(Ue.type, {
816
+ }, L = (I, c = ze.Manual) => {
817
+ var u;
818
+ (u = f.current) == null || u.sendNotification(_e.type, {
819
819
  textDocument: {
820
- uri: j(d)
820
+ uri: j(I)
821
821
  },
822
- reason: g
822
+ reason: c
823
823
  });
824
- }, T = (d, g) => {
825
- var c;
826
- (c = A.current) == null || c.sendNotification(qe.type, {
824
+ }, T = (I, c) => {
825
+ var u;
826
+ (u = f.current) == null || u.sendNotification(Ue.type, {
827
827
  textDocument: {
828
- uri: j(d)
828
+ uri: j(I)
829
829
  },
830
- text: g
830
+ text: c
831
831
  });
832
- }, v = (d) => {
833
- var g;
834
- (g = A.current) == null || g.sendRequest(Qe.type, {
832
+ }, v = (I) => {
833
+ var c;
834
+ (c = f.current) == null || c.sendRequest(qe.type, {
835
835
  files: [
836
836
  {
837
- uri: j(d)
837
+ uri: j(I)
838
838
  }
839
839
  ]
840
840
  });
841
- }, O = (d, g) => {
842
- var c;
843
- (c = A.current) == null || c.sendRequest(et.type, {
841
+ }, _ = (I, c) => {
842
+ var u;
843
+ (u = f.current) == null || u.sendRequest(Qe.type, {
844
844
  files: [
845
845
  {
846
- oldUri: j(d),
847
- newUri: j(g)
846
+ oldUri: j(I),
847
+ newUri: j(c)
848
848
  }
849
849
  ]
850
850
  });
851
- }, Y = (d) => {
852
- var g;
853
- (g = A.current) == null || g.sendRequest(tt.type, {
851
+ }, P = (I) => {
852
+ var c;
853
+ (c = f.current) == null || c.sendRequest(et.type, {
854
854
  files: [
855
855
  {
856
- uri: j(d)
856
+ uri: j(I)
857
857
  }
858
858
  ]
859
859
  });
860
- }, be = (d) => {
861
- var g;
862
- (g = A.current) == null || g.sendNotification(nt.type, {
860
+ }, be = (I) => {
861
+ var c;
862
+ (c = f.current) == null || c.sendNotification(tt.type, {
863
863
  files: [
864
864
  {
865
- uri: j(d)
865
+ uri: j(I)
866
866
  }
867
867
  ]
868
868
  });
869
- }, he = (d, g) => {
870
- var c;
871
- (c = A.current) == null || c.sendNotification(it.type, {
869
+ }, he = (I, c) => {
870
+ var u;
871
+ (u = f.current) == null || u.sendNotification(nt.type, {
872
872
  files: [
873
873
  {
874
- oldUri: j(d),
875
- newUri: j(g)
874
+ oldUri: j(I),
875
+ newUri: j(c)
876
876
  }
877
877
  ]
878
878
  });
879
- }, ve = (d) => {
880
- var g;
881
- (g = A.current) == null || g.sendNotification(ot.type, {
879
+ }, ve = (I) => {
880
+ var c;
881
+ (c = f.current) == null || c.sendNotification(it.type, {
882
882
  files: [
883
883
  {
884
- uri: j(d)
884
+ uri: j(I)
885
885
  }
886
886
  ]
887
887
  });
888
888
  };
889
- return /* @__PURE__ */ P(
889
+ return /* @__PURE__ */ z(
890
890
  Ce.Provider,
891
891
  {
892
892
  value: {
893
- inited: I || !!C,
894
- clientRef: A,
893
+ inited: m || !!C,
894
+ clientRef: f,
895
895
  lastError: C,
896
896
  reload: S,
897
- getTokenAtPosition: u
897
+ getTokenAtPosition: g
898
898
  },
899
899
  children: [
900
900
  t,
901
- /* @__PURE__ */ k(St, { defaultZoom: i })
901
+ /* @__PURE__ */ w(vt, { defaultZoom: i })
902
902
  ]
903
903
  }
904
904
  );
905
905
  };
906
- function kn() {
906
+ function wn() {
907
907
  const t = ae(Ce);
908
908
  if (t === void 0)
909
909
  throw new Error("useLSP must be used within an LSPContext");
@@ -911,9 +911,9 @@ function kn() {
911
911
  }
912
912
  const me = le(
913
913
  void 0
914
- ), Ln = ye(({ children: t }) => {
915
- const [e, n] = _(null);
916
- return /* @__PURE__ */ k(
914
+ ), xn = Se(({ children: t }) => {
915
+ const [e, n] = $(null);
916
+ return /* @__PURE__ */ w(
917
917
  me.Provider,
918
918
  {
919
919
  value: {
@@ -924,8 +924,8 @@ const me = le(
924
924
  }
925
925
  );
926
926
  });
927
- function xt() {
928
- const t = ae(me), e = _(null);
927
+ function wt() {
928
+ const t = ae(me), e = $(null);
929
929
  if (t === void 0) {
930
930
  const [n, i] = e;
931
931
  return {
@@ -935,103 +935,7 @@ function xt() {
935
935
  }
936
936
  return t;
937
937
  }
938
- var fe = {
939
- color: void 0,
940
- size: void 0,
941
- className: void 0,
942
- style: void 0,
943
- attr: void 0
944
- }, re = D.createContext && D.createContext(fe), B = function() {
945
- return B = Object.assign || function(t) {
946
- for (var e, n = 1, i = arguments.length; n < i; n++) {
947
- e = arguments[n];
948
- for (var o in e) Object.prototype.hasOwnProperty.call(e, o) && (t[o] = e[o]);
949
- }
950
- return t;
951
- }, B.apply(this, arguments);
952
- }, kt = function(t, e) {
953
- var n = {};
954
- for (var i in t) Object.prototype.hasOwnProperty.call(t, i) && e.indexOf(i) < 0 && (n[i] = t[i]);
955
- if (t != null && typeof Object.getOwnPropertySymbols == "function") for (var o = 0, i = Object.getOwnPropertySymbols(t); o < i.length; o++)
956
- e.indexOf(i[o]) < 0 && Object.prototype.propertyIsEnumerable.call(t, i[o]) && (n[i[o]] = t[i[o]]);
957
- return n;
958
- };
959
- function pe(t) {
960
- return t && t.map(function(e, n) {
961
- return D.createElement(e.tag, B({
962
- key: n
963
- }, e.attr), pe(e.child));
964
- });
965
- }
966
- function Ae(t) {
967
- return function(e) {
968
- return D.createElement(Lt, B({
969
- attr: B({}, t.attr)
970
- }, e), pe(t.child));
971
- };
972
- }
973
- function Lt(t) {
974
- var e = function(n) {
975
- var i = t.attr, o = t.size, r = t.title, s = kt(t, ["attr", "size", "title"]), m = o || n.size || "1em", I;
976
- return n.className && (I = n.className), t.className && (I = (I ? I + " " : "") + t.className), D.createElement("svg", B({
977
- stroke: "currentColor",
978
- fill: "currentColor",
979
- strokeWidth: "0"
980
- }, n.attr, i, s, {
981
- className: I,
982
- style: B(B({
983
- color: t.color || n.color
984
- }, n.style), t.style),
985
- height: m,
986
- width: m,
987
- xmlns: "http://www.w3.org/2000/svg"
988
- }), r && D.createElement("title", null, r), t.children);
989
- };
990
- return re !== void 0 ? D.createElement(re.Consumer, null, function(n) {
991
- return e(n);
992
- }) : e(fe);
993
- }
994
- function Wt(t) {
995
- return Ae({ attr: { viewBox: "0 0 24 24" }, child: [{ tag: "path", attr: { d: "M12 22C6.47715 22 2 17.5228 2 12C2 6.47715 6.47715 2 12 2C17.5228 2 22 6.47715 22 12C22 17.5228 17.5228 22 12 22ZM12 10.5858L9.17157 7.75736L7.75736 9.17157L10.5858 12L7.75736 14.8284L9.17157 16.2426L12 13.4142L14.8284 16.2426L16.2426 14.8284L13.4142 12L16.2426 9.17157L14.8284 7.75736L12 10.5858Z" } }] })(t);
996
- }
997
- function Ft(t) {
998
- return Ae({ attr: { viewBox: "0 0 512 512" }, child: [{ tag: "path", attr: { d: "M449.07 399.08L278.64 82.58c-12.08-22.44-44.26-22.44-56.35 0L51.87 399.08A32 32 0 0080 446.25h340.89a32 32 0 0028.18-47.17zm-198.6-1.83a20 20 0 1120-20 20 20 0 01-20 20zm21.72-201.15l-5.74 122a16 16 0 01-32 0l-5.74-121.95a21.73 21.73 0 0121.5-22.69h.21a21.74 21.74 0 0121.73 22.7z" } }] })(t);
999
- }
1000
- const Zt = ({
1001
- lspProps: { lastError: t, reload: e }
1002
- }) => {
1003
- const [n, i] = _(!1), o = () => {
1004
- e();
1005
- }, r = () => {
1006
- i(!1);
1007
- };
1008
- return V(() => {
1009
- i(!!t);
1010
- }, [t]), n ? /* @__PURE__ */ P("div", { className: "flex items-center border-b border-fd-gray-darker bg-grey-800 px-2 py-1.5 text-xs text-grey-50", children: [
1011
- /* @__PURE__ */ P("span", { className: "flex flex-1 justify-center gap-1", children: [
1012
- /* @__PURE__ */ k(Ft, { className: "h-4 w-4 text-yellow-600" }),
1013
- /* @__PURE__ */ P("span", { children: [
1014
- "LSP not loaded.",
1015
- " ",
1016
- /* @__PURE__ */ k(
1017
- "button",
1018
- {
1019
- className: "text-primary-dark underline",
1020
- onClick: o,
1021
- children: "Reload?"
1022
- }
1023
- )
1024
- ] })
1025
- ] }),
1026
- /* @__PURE__ */ k("button", { className: "focus:outline-none", children: /* @__PURE__ */ k(
1027
- Wt,
1028
- {
1029
- className: "h-4 w-4 text-white",
1030
- onClick: r
1031
- }
1032
- ) })
1033
- ] }) : null;
1034
- }, jt = {
938
+ const xt = {
1035
939
  provideCompletionItems: (t, e) => {
1036
940
  const n = t.getWordUntilPosition(e);
1037
941
  return {
@@ -1059,78 +963,78 @@ const Zt = ({
1059
963
  ]
1060
964
  };
1061
965
  }
1062
- }, Xt = "#/definitions/Condition", Et = { Base: { type: "object", properties: { id: { type: "string" }, name: { type: "string" } }, required: ["id"] }, Condition: { oneOf: [{ $ref: "#/definitions/Datasource" }, { $ref: "#/definitions/Privilege" }, { $ref: "#/definitions/Combination" }, { $ref: "#/definitions/CurrentState" }, { $ref: "#/definitions/ParentState" }, { $ref: "#/definitions/Reference" }] }, Datasource: { allOf: [{ $ref: "#/definitions/Base" }], properties: { type: { const: "datasource" }, path: { type: "string" }, value: { type: ["number", "string", "boolean", "object", "array", "null"] }, valueType: { enum: ["datasource", "hardCoded"] }, dataType: { enum: ["string", "number", "date", "boolean", "array", "object"] }, op: { enum: ["eq", "neq", "regex", "in", "nin", "gt", "gte", "lt", "lte"] } }, required: ["name", "type", "path", "value", "op"] }, Privilege: { allOf: [{ $ref: "#/definitions/Base" }], properties: { type: { const: "privilege" }, value: { type: "string" }, valueType: { enum: ["datasource", "hardCoded"] }, op: { enum: ["eq", "neq", "regex"] } }, required: ["name", "type", "value", "op"] }, Combination: { allOf: [{ $ref: "#/definitions/Base" }], properties: { type: { const: "combination" }, op: { enum: ["and", "or"] }, conditions: { type: "array", items: { $ref: "#/definitions/Condition" } } }, required: ["type", "conditions", "op"] }, CurrentState: { allOf: [{ $ref: "#/definitions/Base" }], properties: { type: { const: "currentState" }, value: { type: "string" }, valueType: { enum: ["datasource", "hardCoded"] }, dataType: { enum: ["string", "number", "date", "boolean", "array", "object"] }, op: { enum: ["eq", "neq", "regex"] } }, required: ["name", "type", "value", "op"] }, ParentState: { allOf: [{ $ref: "#/definitions/Base" }], properties: { type: { const: "parentState" }, value: { type: "string" }, valueType: { enum: ["datasource", "hardCoded"] }, dataType: { enum: ["string", "number", "date", "boolean", "array", "object"] }, op: { enum: ["eq", "neq", "regex"] } }, required: ["name", "type", "value", "op"] }, Reference: { allOf: [{ $ref: "#/definitions/Base" }], properties: { type: { const: "reference" }, ref: { type: "string" } }, required: ["type", "ref"] } }, Kt = {
1063
- $ref: Xt,
1064
- definitions: Et
1065
- }, Bt = "array", Tt = { type: "object", properties: { class: { type: "string" }, method: { type: "string" }, regexPattern: { type: "string" }, verbs: { type: "string" } } }, Ot = {
1066
- type: Bt,
1067
- items: Tt
966
+ }, kt = "#/definitions/Condition", Lt = { Base: { type: "object", properties: { id: { type: "string" }, name: { type: "string" } }, required: ["id"] }, Condition: { oneOf: [{ $ref: "#/definitions/Datasource" }, { $ref: "#/definitions/Privilege" }, { $ref: "#/definitions/Combination" }, { $ref: "#/definitions/CurrentState" }, { $ref: "#/definitions/ParentState" }, { $ref: "#/definitions/Reference" }] }, Datasource: { allOf: [{ $ref: "#/definitions/Base" }], properties: { type: { const: "datasource" }, path: { type: "string" }, value: { type: ["number", "string", "boolean", "object", "array", "null"] }, valueType: { enum: ["datasource", "hardCoded"] }, dataType: { enum: ["string", "number", "date", "boolean", "array", "object"] }, op: { enum: ["eq", "neq", "regex", "in", "nin", "gt", "gte", "lt", "lte"] } }, required: ["name", "type", "path", "value", "op"] }, Privilege: { allOf: [{ $ref: "#/definitions/Base" }], properties: { type: { const: "privilege" }, value: { type: "string" }, valueType: { enum: ["datasource", "hardCoded"] }, op: { enum: ["eq", "neq", "regex"] } }, required: ["name", "type", "value", "op"] }, Combination: { allOf: [{ $ref: "#/definitions/Base" }], properties: { type: { const: "combination" }, op: { enum: ["and", "or"] }, conditions: { type: "array", items: { $ref: "#/definitions/Condition" } } }, required: ["type", "conditions", "op"] }, CurrentState: { allOf: [{ $ref: "#/definitions/Base" }], properties: { type: { const: "currentState" }, value: { type: "string" }, valueType: { enum: ["datasource", "hardCoded"] }, dataType: { enum: ["string", "number", "date", "boolean", "array", "object"] }, op: { enum: ["eq", "neq", "regex"] } }, required: ["name", "type", "value", "op"] }, ParentState: { allOf: [{ $ref: "#/definitions/Base" }], properties: { type: { const: "parentState" }, value: { type: "string" }, valueType: { enum: ["datasource", "hardCoded"] }, dataType: { enum: ["string", "number", "date", "boolean", "array", "object"] }, op: { enum: ["eq", "neq", "regex"] } }, required: ["name", "type", "value", "op"] }, Reference: { allOf: [{ $ref: "#/definitions/Base" }], properties: { type: { const: "reference" }, ref: { type: "string" } }, required: ["type", "ref"] } }, Wt = {
967
+ $ref: kt,
968
+ definitions: Lt
969
+ }, Ft = "array", Zt = { type: "object", properties: { class: { type: "string" }, method: { type: "string" }, regexPattern: { type: "string" }, verbs: { type: "string" } } }, jt = {
970
+ type: Ft,
971
+ items: Zt
1068
972
  };
1069
- function Dt(t, e) {
973
+ function Xt(t, e) {
1070
974
  const n = document.createElement("style");
1071
975
  n.dataset.id = e, n.textContent = t, document.head.append(n);
1072
976
  }
1073
- function Gt(t) {
977
+ function Et(t) {
1074
978
  return Array.from(document.styleSheets).find(
1075
979
  (e) => e.ownerNode.getAttribute("data-id") === t
1076
980
  );
1077
981
  }
1078
- function Jt(t, e) {
982
+ function Kt(t, e) {
1079
983
  const n = [];
1080
984
  let i = [];
1081
- const o = [], r = (a, u, y, W) => {
985
+ const o = [], r = (a, g, k, L) => {
1082
986
  n.push({
1083
987
  startLineNumber: a,
1084
- endLineNumber: y,
1085
- startColumn: u,
1086
- endColumn: W
1087
- }), h(), I();
988
+ endLineNumber: k,
989
+ startColumn: g,
990
+ endColumn: L
991
+ }), h(), m();
1088
992
  }, s = (a) => {
1089
993
  o.indexOf(a) < 0 && o.push(a);
1090
- }, m = (a) => {
1091
- const u = o.indexOf(a);
1092
- u < 0 || o.splice(u, 1);
1093
- }, I = () => {
994
+ }, p = (a) => {
995
+ const g = o.indexOf(a);
996
+ g < 0 || o.splice(g, 1);
997
+ }, m = () => {
1094
998
  for (const a of o)
1095
999
  try {
1096
1000
  a(i);
1097
- } catch (u) {
1098
- console.error(u);
1001
+ } catch (g) {
1002
+ console.error(g);
1099
1003
  }
1100
1004
  }, h = () => {
1101
1005
  const a = t.getModel();
1102
- a && (i = Pt(
1103
- n.map((u) => [
1006
+ a && (i = Tt(
1007
+ n.map((g) => [
1104
1008
  a.getOffsetAt({
1105
- lineNumber: u.startLineNumber,
1106
- column: u.startColumn
1009
+ lineNumber: g.startLineNumber,
1010
+ column: g.startColumn
1107
1011
  }),
1108
1012
  a.getOffsetAt({
1109
- lineNumber: u.endLineNumber,
1110
- column: u.endColumn
1013
+ lineNumber: g.endLineNumber,
1014
+ column: g.endColumn
1111
1015
  })
1112
1016
  ]),
1113
1017
  /*mergeJoins*/
1114
1018
  !0
1115
1019
  ), i.length > 0 && (i[0][0] <= 0 && (i[0][0] = Number.NEGATIVE_INFINITY), i[i.length - 1][1] >= a.getValueLength() && (i[i.length - 1][1] = Number.POSITIVE_INFINITY)));
1116
1020
  }, C = (a) => {
1117
- const u = {
1021
+ const g = {
1118
1022
  isDeletion: !1,
1119
1023
  isAddition: !1,
1120
1024
  isReplacement: !1
1121
1025
  };
1122
- return a.text === "" ? u.isDeletion = !0 : a.range.startLineNumber === a.range.endLineNumber && a.range.startColumn === a.range.endColumn ? u.isAddition = !0 : u.isReplacement = !0, u;
1123
- }, f = t.onDidChangeModel((a) => {
1124
- h(), L();
1125
- }), A = t.onDidChangeModelContent((a) => {
1026
+ return a.text === "" ? g.isDeletion = !0 : a.range.startLineNumber === a.range.endLineNumber && a.range.startColumn === a.range.endColumn ? g.isAddition = !0 : g.isReplacement = !0, g;
1027
+ }, A = t.onDidChangeModel((a) => {
1028
+ h(), d();
1029
+ }), f = t.onDidChangeModelContent((a) => {
1126
1030
  if (!a.isUndoing)
1127
- for (const u of a.changes) {
1128
- const y = C(u);
1129
- if (y.isReplacement || y.isDeletion || y.isAddition) {
1130
- const W = n.some(
1131
- (v) => u.range.startLineNumber >= v.startLineNumber && u.range.endLineNumber <= v.endLineNumber && u.range.startColumn >= v.startColumn && u.range.endColumn <= v.endColumn
1132
- ), T = !W && e && u.range.startLineNumber === 1 && u.range.startColumn === 1 && !ge(u.text);
1133
- if (W || T) {
1031
+ for (const g of a.changes) {
1032
+ const k = C(g);
1033
+ if (k.isReplacement || k.isDeletion || k.isAddition) {
1034
+ const L = n.some(
1035
+ (v) => g.range.startLineNumber >= v.startLineNumber && g.range.endLineNumber <= v.endLineNumber && g.range.startColumn >= v.startColumn && g.range.endColumn <= v.endColumn
1036
+ ), T = !L && e && g.range.startLineNumber === 1 && g.range.startColumn === 1 && !ge(g.text);
1037
+ if (L || T) {
1134
1038
  const v = t.getModel();
1135
1039
  if (v) {
1136
1040
  v.undo();
@@ -1139,10 +1043,10 @@ function Jt(t, e) {
1139
1043
  }
1140
1044
  }
1141
1045
  }
1142
- }), N = () => {
1143
- f.dispose(), A.dispose();
1046
+ }), x = () => {
1047
+ A.dispose(), f.dispose();
1144
1048
  };
1145
- let x = [], S = `
1049
+ let R = [], S = `
1146
1050
  .idoc-readonly-mark {
1147
1051
  cursor: not-allowed;
1148
1052
  z-index: 1;
@@ -1150,26 +1054,26 @@ function Jt(t, e) {
1150
1054
  `;
1151
1055
  if (S) {
1152
1056
  const a = "monaco-read-only";
1153
- Gt(a) || Dt(S, a), S = null;
1057
+ Et(a) || Xt(S, a), S = null;
1154
1058
  }
1155
- const R = () => {
1156
- s(L), L();
1059
+ const y = () => {
1060
+ s(d), d();
1157
1061
  }, b = () => {
1158
- m(L), x = t.deltaDecorations(x, []);
1159
- }, L = () => {
1062
+ p(d), R = t.deltaDecorations(R, []);
1063
+ }, d = () => {
1160
1064
  const a = t.getModel();
1161
- a && (x = t.deltaDecorations(
1162
- x,
1163
- i.map(p(a))
1065
+ a && (R = t.deltaDecorations(
1066
+ R,
1067
+ i.map(F(a))
1164
1068
  ));
1165
- }, p = (a) => (u) => {
1166
- const y = a.getPositionAt(u[0]), W = a.getPositionAt(u[1]);
1069
+ }, F = (a) => (g) => {
1070
+ const k = a.getPositionAt(g[0]), L = a.getPositionAt(g[1]);
1167
1071
  return {
1168
1072
  range: new l.Range(
1169
- y.lineNumber,
1170
- y.column,
1171
- W.lineNumber,
1172
- W.column
1073
+ k.lineNumber,
1074
+ k.column,
1075
+ L.lineNumber,
1076
+ L.column
1173
1077
  ),
1174
1078
  options: {
1175
1079
  className: "idoc-readonly-mark"
@@ -1182,66 +1086,66 @@ function Jt(t, e) {
1182
1086
  },
1183
1087
  exclude: r,
1184
1088
  attach: s,
1185
- detach: m,
1186
- dispose: N,
1187
- show: R,
1089
+ detach: p,
1090
+ dispose: x,
1091
+ show: y,
1188
1092
  hide: b
1189
1093
  };
1190
1094
  }
1191
- function Mt(t, e, n) {
1095
+ function Bt(t, e, n) {
1192
1096
  let i = !1;
1193
- const o = (b) => b[1] < b[0] ? (i = !0, [[b[1], b[0]]]) : [[...b]], r = (b) => i ? b.map((L) => L[1] > L[0] ? m(L) : L).reverse() : b;
1097
+ const o = (b) => b[1] < b[0] ? (i = !0, [[b[1], b[0]]]) : [[...b]], r = (b) => i ? b.map((d) => d[1] > d[0] ? p(d) : d).reverse() : b;
1194
1098
  let s;
1195
- const m = (b) => (s = b[1], b[1] = b[0], b[0] = s, b), I = o(t);
1196
- let h, C, f, A, N, x, S, R;
1197
- f = I[0];
1099
+ const p = (b) => (s = b[1], b[1] = b[0], b[0] = s, b), m = o(t);
1100
+ let h, C, A, f, x, R, S, y;
1101
+ A = m[0];
1198
1102
  for (C of e)
1199
- for (S = C[0], R = C[1], A = 0; A < I.length; A++) {
1200
- if (f = I[A], N = f[0], x = f[1], N < S)
1201
- x < S ? h = [f] : x <= R ? h = [[N, S - 1]] : h = [
1202
- [N, S - 1],
1203
- [R + 1, x]
1103
+ for (S = C[0], y = C[1], f = 0; f < m.length; f++) {
1104
+ if (A = m[f], x = A[0], R = A[1], x < S)
1105
+ R < S ? h = [A] : R <= y ? h = [[x, S - 1]] : h = [
1106
+ [x, S - 1],
1107
+ [y + 1, R]
1204
1108
  ];
1205
- else if (N <= R)
1109
+ else if (x <= y)
1206
1110
  if (S === Number.NEGATIVE_INFINITY) {
1207
- const b = R + 1;
1208
- h = n === 0 ? [] : [[b, x > b ? x : b]];
1209
- } else R === Number.POSITIVE_INFINITY ? h = n === 0 ? [] : [[S - 1, S - 1]] : x <= R ? h = n < 0 ? [[S - 1, S - 1]] : n > 0 ? [[R + 1, R + 1]] : [] : h = [[R + 1, x]];
1111
+ const b = y + 1;
1112
+ h = n === 0 ? [] : [[b, R > b ? R : b]];
1113
+ } else y === Number.POSITIVE_INFINITY ? h = n === 0 ? [] : [[S - 1, S - 1]] : R <= y ? h = n < 0 ? [[S - 1, S - 1]] : n > 0 ? [[y + 1, y + 1]] : [] : h = [[y + 1, R]];
1210
1114
  else
1211
- h = [f];
1212
- if (I.splice(A, 1, ...h), I.length === 1 && I[0][1] < S) return r(I);
1115
+ h = [A];
1116
+ if (m.splice(f, 1, ...h), m.length === 1 && m[0][1] < S) return r(m);
1213
1117
  }
1214
- return r(I);
1118
+ return r(m);
1215
1119
  }
1216
- function Pt(t, e) {
1120
+ function Tt(t, e) {
1217
1121
  if (t.length < 2) return t;
1218
1122
  const n = [];
1219
1123
  let i = null, o, r;
1220
1124
  t = t.map(
1221
1125
  (s) => (s[1] < s[0] && (o = s[1], s[1] = s[0], s[1] = o), s)
1222
- ).sort((s, m) => s[0] - m[0]), n.push(t[0]);
1126
+ ).sort((s, p) => s[0] - p[0]), n.push(t[0]);
1223
1127
  for (let s = 1; s < t.length; s++)
1224
1128
  i = n[n.length - 1], r = t[s], i[1] === r[0] && !e || (i[1] === r[0] - 1 && e ? (i[1] = r[1], n.splice(n.length - 1, 1, i)) : i[1] < r[0] ? n.push(r) : i[1] < r[1] && (i[1] = r[1], n.splice(n.length - 1, 1, i)));
1225
1129
  return n;
1226
1130
  }
1227
- function z(t, e) {
1131
+ function Y(t, e) {
1228
1132
  return e.bind(t);
1229
1133
  }
1230
- class Vt {
1134
+ class Ot {
1231
1135
  constructor(e, n) {
1232
1136
  var i;
1233
- this.disposables = [], this.prefer = 1, this.lastPrefer = 1, this.onCursor = z(
1137
+ this.disposables = [], this.prefer = 1, this.lastPrefer = 1, this.onCursor = Y(
1234
1138
  this,
1235
1139
  function(o) {
1236
1140
  if (o.source === "api") return;
1237
1141
  const r = this.getApprovedSelections();
1238
1142
  r.length !== 0 && this.editor.setSelections(r);
1239
1143
  }
1240
- ), this.onRectangleSelectionStart = z(this, function({ event: o }) {
1144
+ ), this.onRectangleSelectionStart = Y(this, function({ event: o }) {
1241
1145
  o.middleButton && (this.lastPrefer = this.prefer, this.prefer = 0, window.addEventListener("pointerup", this.onRectangleSelectionStop));
1242
- }), this.onRectangleSelectionStop = z(this, function() {
1146
+ }), this.onRectangleSelectionStop = Y(this, function() {
1243
1147
  this.prefer = this.lastPrefer, window.removeEventListener("pointerup", this.onRectangleSelectionStop);
1244
- }), this.onKey = z(this, function(o) {
1148
+ }), this.onKey = Y(this, function(o) {
1245
1149
  const r = o.keyCode, s = l.KeyCode;
1246
1150
  if (o.altKey || s.F1 <= r && r <= s.F19 || o.ctrlKey && r !== s.Backspace) return;
1247
1151
  if (r === s.UpArrow || r === s.LeftArrow || r === s.Home || r === s.PageUp) {
@@ -1252,21 +1156,21 @@ class Vt {
1252
1156
  this.prefer = 1;
1253
1157
  return;
1254
1158
  }
1255
- const m = this.getSelections(), I = this.intervals.buffer;
1159
+ const p = this.getSelections(), m = this.intervals.buffer;
1256
1160
  let h;
1257
1161
  if (r === s.Delete)
1258
- h = (C) => C[0] === C[1] && I.find((f) => C[1] + 1 === f[0]) != null;
1162
+ h = (C) => C[0] === C[1] && m.find((A) => C[1] + 1 === A[0]) != null;
1259
1163
  else if (r === s.Backspace)
1260
- h = (C) => C[0] === C[1] && I.find((f) => f[1] + 1 === C[0]) != null;
1164
+ h = (C) => C[0] === C[1] && m.find((A) => A[1] + 1 === C[0]) != null;
1261
1165
  else
1262
1166
  return;
1263
- m.findIndex(h) !== -1 && (o.stopPropagation(), o.preventDefault());
1264
- }), this.getOffsetAt = z(this, function(o) {
1167
+ p.findIndex(h) !== -1 && (o.stopPropagation(), o.preventDefault());
1168
+ }), this.getOffsetAt = Y(this, function(o) {
1265
1169
  let r;
1266
1170
  for (let s = 0; s < this.intervals.buffer.length; s++)
1267
1171
  if (r = this.intervals.buffer[s], o <= r[1])
1268
1172
  return r[0] - o < o - r[1] ? r[0] : r[1];
1269
- }), this.editor = e, this.intervals = Jt(e, n), (i = this.editor.getModel()) == null || i.setEOL(l.editor.EndOfLineSequence.LF);
1173
+ }), this.editor = e, this.intervals = Kt(e, n), (i = this.editor.getModel()) == null || i.setEOL(l.editor.EndOfLineSequence.LF);
1270
1174
  }
1271
1175
  enable() {
1272
1176
  this.disposables.push(
@@ -1285,7 +1189,7 @@ class Vt {
1285
1189
  getApprovedSelections() {
1286
1190
  const e = this.editor.getModel();
1287
1191
  return this.getSelections().map(
1288
- (i) => Mt(
1192
+ (i) => Bt(
1289
1193
  i,
1290
1194
  this.intervals.buffer,
1291
1195
  this.prefer
@@ -1314,28 +1218,28 @@ class Vt {
1314
1218
  ]);
1315
1219
  }
1316
1220
  }
1317
- const Yt = new RegExp("^[ s]+(exposed|Function)", "i"), Ht = ({
1221
+ const Dt = new RegExp("^[ s]+(exposed|Function)", "i"), Gt = ({
1318
1222
  lineNumber: t,
1319
1223
  editor: e,
1320
1224
  type: n,
1321
1225
  source: i
1322
1226
  }) => {
1323
1227
  var h;
1324
- const o = n === ie.METHOD || n === ie.DEBUGGER && ((h = i == null ? void 0 : i.codeDescriptorInfo) == null ? void 0 : h.type) === ke.METHOD;
1228
+ const o = n === ie.METHOD || n === ie.DEBUGGER && ((h = i == null ? void 0 : i.codeDescriptorInfo) == null ? void 0 : h.type) === xe.METHOD;
1325
1229
  if (t === 1)
1326
1230
  return o ? "" : "1";
1327
- const r = e == null ? void 0 : e.getModel(), s = (r == null ? void 0 : r.getLinesContent()) || [], m = Array(s.length).fill("-");
1328
- let I = o ? 0 : 1;
1231
+ const r = e == null ? void 0 : e.getModel(), s = (r == null ? void 0 : r.getLinesContent()) || [], p = Array(s.length).fill("-");
1232
+ let m = o ? 0 : 1;
1329
1233
  for (let C = 1; C < s.length; C++)
1330
- (C === 1 ? "" : s[C - 1]).endsWith("\\") || (I += 1, m[C] = I.toString());
1331
- return m[t - 1];
1332
- }, se = () => /* @__PURE__ */ k("div", { className: "absolute inset-0 animate-pulse", children: /* @__PURE__ */ k("div", { className: "w-full space-y-4 px-4 py-1", children: /* @__PURE__ */ P("div", { className: "space-y-2", children: [
1333
- /* @__PURE__ */ k("div", { className: "h-3 w-3/4 rounded bg-grey-200" }),
1334
- /* @__PURE__ */ k("div", { className: "h-3 rounded bg-grey-200" }),
1335
- /* @__PURE__ */ k("div", { className: "h-3 w-5/6 rounded bg-grey-200" }),
1336
- /* @__PURE__ */ k("div", { className: "h-3 rounded bg-grey-200" }),
1337
- /* @__PURE__ */ k("div", { className: "h-3 rounded bg-grey-200" })
1338
- ] }) }) }), ne = ["fd-dark"], Wn = ({
1234
+ (C === 1 ? "" : s[C - 1]).endsWith("\\") || (m += 1, p[C] = m.toString());
1235
+ return p[t - 1];
1236
+ }, re = () => /* @__PURE__ */ w("div", { className: "absolute inset-0 animate-pulse", children: /* @__PURE__ */ w("div", { className: "w-full space-y-4 px-4 py-1", children: /* @__PURE__ */ z("div", { className: "space-y-2", children: [
1237
+ /* @__PURE__ */ w("div", { className: "h-3 w-3/4 rounded bg-grey-200" }),
1238
+ /* @__PURE__ */ w("div", { className: "h-3 rounded bg-grey-200" }),
1239
+ /* @__PURE__ */ w("div", { className: "h-3 w-5/6 rounded bg-grey-200" }),
1240
+ /* @__PURE__ */ w("div", { className: "h-3 rounded bg-grey-200" }),
1241
+ /* @__PURE__ */ w("div", { className: "h-3 rounded bg-grey-200" })
1242
+ ] }) }) }), ne = ["fd-dark"], kn = ({
1339
1243
  path: t,
1340
1244
  initialValue: e,
1341
1245
  type: n,
@@ -1343,99 +1247,192 @@ const Yt = new RegExp("^[ s]+(exposed|Function)", "i"), Ht = ({
1343
1247
  onChange: o,
1344
1248
  options: r = {},
1345
1249
  extra: s = {},
1346
- showAlerts: m = !1,
1347
- lspProps: I,
1348
- theme: h = ne[0],
1349
- ...C
1250
+ lspProps: p,
1251
+ theme: m = ne[0],
1252
+ ...h
1350
1253
  }) => {
1351
- const { initialLineInfo: f, initialSelectionInfo: A } = s, { editor: N, setEditor: x } = xt(), { inited: S } = I;
1352
- function R(p) {
1353
- i === "css" && p.languages.registerCompletionItemProvider("css", jt), i === "json" && p.languages.json && p.languages.json.jsonDefaults.setDiagnosticsOptions({
1254
+ const { initialLineInfo: C, initialSelectionInfo: A } = s, { editor: f, setEditor: x } = wt(), { inited: R } = p;
1255
+ function S(d) {
1256
+ i === "css" && d.languages.registerCompletionItemProvider("css", xt), i === "json" && d.languages.json && d.languages.json.jsonDefaults.setDiagnosticsOptions({
1354
1257
  validate: !0,
1355
1258
  schemas: [
1356
1259
  {
1357
1260
  uri: "condition-schema.json",
1358
1261
  fileMatch: ["*.condition.json"],
1359
- schema: Kt
1262
+ schema: Wt
1360
1263
  },
1361
1264
  {
1362
1265
  uri: "handlers-schema.json",
1363
- fileMatch: [Le],
1364
- schema: Ot
1266
+ fileMatch: [ke],
1267
+ schema: jt
1365
1268
  }
1366
1269
  ]
1367
1270
  });
1368
1271
  }
1369
- function b(p, a) {
1370
- x(p);
1371
- const u = p.getModel();
1372
- if (u && (u.updateOptions({ insertSpaces: !1 }), p.onKeyUp(() => {
1373
- var W;
1374
- const y = (W = p.getPosition()) == null ? void 0 : W.lineNumber;
1375
- if (y) {
1376
- const T = u.getLineFirstNonWhitespaceColumn(y), v = u.getLineLength(y), O = u.getLineContent(y);
1377
- Yt.test(O) && p.executeEdits("edit-handler", [
1272
+ function y(d, F) {
1273
+ x(d);
1274
+ const a = d.getModel();
1275
+ if (a && (a.updateOptions({ insertSpaces: !1 }), d.onKeyUp(() => {
1276
+ var k;
1277
+ const g = (k = d.getPosition()) == null ? void 0 : k.lineNumber;
1278
+ if (g) {
1279
+ const L = a.getLineFirstNonWhitespaceColumn(g), T = a.getLineLength(g), v = a.getLineContent(g);
1280
+ Dt.test(v) && d.executeEdits("edit-handler", [
1378
1281
  {
1379
- range: new a.Range(
1380
- y,
1282
+ range: new F.Range(
1283
+ g,
1381
1284
  0,
1382
- y,
1383
- v
1285
+ g,
1286
+ T
1384
1287
  ),
1385
- text: O.substr(
1386
- T - 1,
1387
- v - T
1288
+ text: v.substr(
1289
+ L - 1,
1290
+ T - L
1388
1291
  )
1389
1292
  }
1390
1293
  ]);
1391
1294
  }
1392
1295
  })), n === ie.METHOD && ge(e)) {
1393
- const y = new Vt(p, !0);
1394
- y.exclude(1, 1, 1, Number.POSITIVE_INFINITY), y.enable();
1296
+ const g = new Ot(d, !0);
1297
+ g.exclude(1, 1, 1, Number.POSITIVE_INFINITY), g.enable();
1395
1298
  }
1396
1299
  }
1397
- V(() => {
1398
- if (!N) return;
1399
- const { line: p, offset: a } = f || {};
1400
- p && At(N, p, a);
1401
- }, [f, N]), V(() => {
1402
- if (!N) return;
1403
- const { selection: p } = A || {};
1404
- p && pt(N, p);
1405
- }, [A, N]);
1406
- const L = (p) => ne.includes(p) ? p : ne[0];
1407
- return S ? /* @__PURE__ */ P(Se, { children: [
1408
- m ? /* @__PURE__ */ k(Zt, { lspProps: I }) : null,
1409
- /* @__PURE__ */ k(
1410
- we,
1300
+ M(() => {
1301
+ if (!f) return;
1302
+ const { line: d, offset: F } = C || {};
1303
+ d && pt(f, d, F);
1304
+ }, [C, f]), M(() => {
1305
+ if (!f) return;
1306
+ const { selection: d } = A || {};
1307
+ d && ft(f, d);
1308
+ }, [A, f]);
1309
+ const b = (d) => ne.includes(d) ? d : ne[0];
1310
+ return R ? /* @__PURE__ */ w(
1311
+ Re,
1312
+ {
1313
+ options: {
1314
+ readOnly: !0,
1315
+ fontSize: 12,
1316
+ "semanticHighlighting.enabled": !0,
1317
+ padding: { top: 10 },
1318
+ lineNumbers: i === "4d" ? (d) => Gt({
1319
+ lineNumber: d,
1320
+ editor: f,
1321
+ type: n,
1322
+ source: s == null ? void 0 : s.source
1323
+ }) : void 0,
1324
+ scrollBeyondLastLine: !1,
1325
+ ...r
1326
+ },
1327
+ path: j(t),
1328
+ value: e,
1329
+ theme: b(m),
1330
+ onChange: (d) => o && o(d || ""),
1331
+ language: i,
1332
+ beforeMount: S,
1333
+ onMount: y,
1334
+ loading: /* @__PURE__ */ w(re, {}),
1335
+ ...h
1336
+ }
1337
+ ) : /* @__PURE__ */ w("div", { className: "relative flex-1 w-full", children: /* @__PURE__ */ w(re, {}) });
1338
+ };
1339
+ var fe = {
1340
+ color: void 0,
1341
+ size: void 0,
1342
+ className: void 0,
1343
+ style: void 0,
1344
+ attr: void 0
1345
+ }, se = O.createContext && O.createContext(fe), B = function() {
1346
+ return B = Object.assign || function(t) {
1347
+ for (var e, n = 1, i = arguments.length; n < i; n++) {
1348
+ e = arguments[n];
1349
+ for (var o in e) Object.prototype.hasOwnProperty.call(e, o) && (t[o] = e[o]);
1350
+ }
1351
+ return t;
1352
+ }, B.apply(this, arguments);
1353
+ }, Jt = function(t, e) {
1354
+ var n = {};
1355
+ for (var i in t) Object.prototype.hasOwnProperty.call(t, i) && e.indexOf(i) < 0 && (n[i] = t[i]);
1356
+ if (t != null && typeof Object.getOwnPropertySymbols == "function") for (var o = 0, i = Object.getOwnPropertySymbols(t); o < i.length; o++)
1357
+ e.indexOf(i[o]) < 0 && Object.prototype.propertyIsEnumerable.call(t, i[o]) && (n[i[o]] = t[i[o]]);
1358
+ return n;
1359
+ };
1360
+ function pe(t) {
1361
+ return t && t.map(function(e, n) {
1362
+ return O.createElement(e.tag, B({
1363
+ key: n
1364
+ }, e.attr), pe(e.child));
1365
+ });
1366
+ }
1367
+ function Ae(t) {
1368
+ return function(e) {
1369
+ return O.createElement(Mt, B({
1370
+ attr: B({}, t.attr)
1371
+ }, e), pe(t.child));
1372
+ };
1373
+ }
1374
+ function Mt(t) {
1375
+ var e = function(n) {
1376
+ var i = t.attr, o = t.size, r = t.title, s = Jt(t, ["attr", "size", "title"]), p = o || n.size || "1em", m;
1377
+ return n.className && (m = n.className), t.className && (m = (m ? m + " " : "") + t.className), O.createElement("svg", B({
1378
+ stroke: "currentColor",
1379
+ fill: "currentColor",
1380
+ strokeWidth: "0"
1381
+ }, n.attr, i, s, {
1382
+ className: m,
1383
+ style: B(B({
1384
+ color: t.color || n.color
1385
+ }, n.style), t.style),
1386
+ height: p,
1387
+ width: p,
1388
+ xmlns: "http://www.w3.org/2000/svg"
1389
+ }), r && O.createElement("title", null, r), t.children);
1390
+ };
1391
+ return se !== void 0 ? O.createElement(se.Consumer, null, function(n) {
1392
+ return e(n);
1393
+ }) : e(fe);
1394
+ }
1395
+ function Pt(t) {
1396
+ return Ae({ attr: { viewBox: "0 0 24 24" }, child: [{ tag: "path", attr: { d: "M12 22C6.47715 22 2 17.5228 2 12C2 6.47715 6.47715 2 12 2C17.5228 2 22 6.47715 22 12C22 17.5228 17.5228 22 12 22ZM12 10.5858L9.17157 7.75736L7.75736 9.17157L10.5858 12L7.75736 14.8284L9.17157 16.2426L12 13.4142L14.8284 16.2426L16.2426 14.8284L13.4142 12L16.2426 9.17157L14.8284 7.75736L12 10.5858Z" } }] })(t);
1397
+ }
1398
+ function Vt(t) {
1399
+ return Ae({ attr: { viewBox: "0 0 512 512" }, child: [{ tag: "path", attr: { d: "M449.07 399.08L278.64 82.58c-12.08-22.44-44.26-22.44-56.35 0L51.87 399.08A32 32 0 0080 446.25h340.89a32 32 0 0028.18-47.17zm-198.6-1.83a20 20 0 1120-20 20 20 0 01-20 20zm21.72-201.15l-5.74 122a16 16 0 01-32 0l-5.74-121.95a21.73 21.73 0 0121.5-22.69h.21a21.74 21.74 0 0121.73 22.7z" } }] })(t);
1400
+ }
1401
+ const Ln = ({
1402
+ lspProps: { lastError: t, reload: e }
1403
+ }) => {
1404
+ const [n, i] = $(!1), o = () => {
1405
+ e();
1406
+ }, r = () => {
1407
+ i(!1);
1408
+ };
1409
+ return M(() => {
1410
+ i(!!t);
1411
+ }, [t]), n ? /* @__PURE__ */ z("div", { className: "flex items-center border-b border-fd-gray-darker bg-grey-800 px-2 py-1.5 text-xs text-grey-50", children: [
1412
+ /* @__PURE__ */ z("span", { className: "flex flex-1 justify-center gap-1", children: [
1413
+ /* @__PURE__ */ w(Vt, { className: "h-4 w-4 text-yellow-600" }),
1414
+ /* @__PURE__ */ z("span", { children: [
1415
+ "LSP not loaded.",
1416
+ " ",
1417
+ /* @__PURE__ */ w(
1418
+ "button",
1419
+ {
1420
+ className: "text-primary-dark underline",
1421
+ onClick: o,
1422
+ children: "Reload?"
1423
+ }
1424
+ )
1425
+ ] })
1426
+ ] }),
1427
+ /* @__PURE__ */ w("button", { className: "focus:outline-none", children: /* @__PURE__ */ w(
1428
+ Pt,
1411
1429
  {
1412
- options: {
1413
- readOnly: !0,
1414
- fontSize: 12,
1415
- "semanticHighlighting.enabled": !0,
1416
- padding: { top: 10 },
1417
- lineNumbers: i === "4d" ? (p) => Ht({
1418
- lineNumber: p,
1419
- editor: N,
1420
- type: n,
1421
- source: s == null ? void 0 : s.source
1422
- }) : void 0,
1423
- scrollBeyondLastLine: !1,
1424
- ...r
1425
- },
1426
- path: j(t),
1427
- value: e,
1428
- theme: L(h),
1429
- onChange: (p) => o && o(p || ""),
1430
- language: i,
1431
- beforeMount: R,
1432
- onMount: b,
1433
- loading: /* @__PURE__ */ k(se, {}),
1434
- ...C
1430
+ className: "h-4 w-4 text-white",
1431
+ onClick: r
1435
1432
  }
1436
- )
1437
- ] }) : /* @__PURE__ */ k("div", { className: "relative flex-1 w-full", children: /* @__PURE__ */ k(se, {}) });
1438
- }, zt = {
1433
+ ) })
1434
+ ] }) : null;
1435
+ }, Yt = {
1439
1436
  name: "4d",
1440
1437
  displayName: "%displayName%",
1441
1438
  description: "%description%",
@@ -1460,7 +1457,7 @@ const Yt = new RegExp("^[ s]+(exposed|Function)", "i"), Ht = ({
1460
1457
  }
1461
1458
  ]
1462
1459
  }
1463
- }, { registerFileUrl: q, whenReady: Fn } = at(zt, void 0, {
1460
+ }, { registerFileUrl: q, whenReady: Wn } = lt(Yt, void 0, {
1464
1461
  system: !0
1465
1462
  });
1466
1463
  q(
@@ -1484,20 +1481,20 @@ q(
1484
1481
  { mimeType: "application/json", size: 135 }
1485
1482
  );
1486
1483
  export {
1487
- Zt as Alerts,
1488
- Wn as CodeEditor,
1489
- Ln as CodeEditorProvider,
1490
- Ht as FdLineNumbers,
1491
- xn as LSPProvider,
1484
+ Ln as Alerts,
1485
+ kn as CodeEditor,
1486
+ xn as CodeEditorProvider,
1487
+ Gt as FdLineNumbers,
1488
+ Rn as LSPProvider,
1492
1489
  ne as SUPPORTED_THEMES,
1493
1490
  ue as _await,
1494
- Ct as configureServices,
1491
+ It as configureServices,
1495
1492
  j as getFileSystemPath,
1496
- wn as getFunctionOffset,
1497
- It as initMonacoUserConfiguration,
1498
- At as jumpToLine,
1499
- pt as jumpToSelection,
1500
- xt as useCodeEditor,
1501
- kn as useLSP
1493
+ Nn as getFunctionOffset,
1494
+ dt as initMonacoUserConfiguration,
1495
+ pt as jumpToLine,
1496
+ ft as jumpToSelection,
1497
+ wt as useCodeEditor,
1498
+ wn as useLSP
1502
1499
  };
1503
1500
  //# sourceMappingURL=index.es.js.map