@ws-ui/code-editor 1.9.2 → 1.10.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.es.js CHANGED
@@ -1,22 +1,25 @@
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";
1
+ import { jsxs as _, jsx as w } from "react/jsx-runtime";
2
+ import D, { useEffect as M, createContext as ge, useState as z, useRef as oe, useContext as ce, memo as Ne } from "react";
3
+ import { loader as Re, useMonaco as we, Editor as xe } from "@monaco-editor/react";
4
+ import { getNodeInfo as Fe, DesignerRequestVerb as Le, lspSubject as ke, LspActions as E, hasAttributesString as ue, FileFolderType as ie, SourceCodeDescriptor as We, HTTP_HANDLERS_TAB_PATH as Ze } from "@ws-ui/shared";
5
+ import { MonacoLanguageClient as je } from "monaco-languageclient";
6
+ import { mergeServices as Xe, initServices as Ee } from "monaco-languageclient/vscode/services";
7
+ import Ke, { initUserConfiguration as Be } from "@codingame/monaco-vscode-configuration-service-override";
8
+ import Te from "@codingame/monaco-vscode-languages-service-override";
9
+ import De from "@codingame/monaco-vscode-textmate-service-override";
10
10
  import "@codingame/monaco-vscode-theme-defaults-default-extension";
11
- import Ke from "@codingame/monaco-vscode-editor-service-override";
12
- import Be from "@codingame/monaco-vscode-theme-service-override";
11
+ import Oe from "@codingame/monaco-vscode-editor-service-override";
12
+ import Ge from "@codingame/monaco-vscode-theme-service-override";
13
+ import { registerFileSystemOverlay as Je } from "@codingame/monaco-vscode-files-service-override";
14
+ import { FileSystemProviderCapabilities as re, FileType as Me } from "vscode/vscode/vs/platform/files/common/files";
15
+ import { Emitter as se } from "vscode/vscode/vs/base/common/event";
16
+ import { Logger as Pe } from "monaco-languageclient/tools";
17
+ import { CloseAction as Ve, ErrorAction as Ye } from "vscode-languageclient";
13
18
  import * as l from "monaco-editor";
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";
19
+ import { Selection as He, KeyMod as G, KeyCode as J, editor as de, Range as _e, Uri as ze, CancellationTokenSource as $e } from "monaco-editor";
20
+ import { WebSocketMessageReader as Ue, WebSocketMessageWriter as qe, toSocket as Qe } from "vscode-ws-jsonrpc";
21
+ import { TextDocumentSaveReason as et, DocumentDiagnosticRequest as tt, WillSaveTextDocumentNotification as nt, DidSaveTextDocumentNotification as it, WillCreateFilesRequest as ot, WillRenameFilesRequest as rt, WillDeleteFilesRequest as st, DidCreateFilesNotification as lt, DidRenameFilesNotification as at, DidDeleteFilesNotification as gt, SemanticTokensRegistrationType as ct } from "vscode-languageserver-protocol";
22
+ import { StandaloneServices as ut, ICodeEditorService as dt } from "vscode/services";
20
23
  import { KeybindingsRegistry as te } from "vscode/monaco";
21
24
  import "@codingame/monaco-vscode-standalone-languages";
22
25
  import "@codingame/monaco-vscode-standalone-html-language-features";
@@ -27,14 +30,14 @@ import "@codingame/monaco-vscode-css-default-extension";
27
30
  import "@codingame/monaco-vscode-json-default-extension";
28
31
  import "@codingame/monaco-vscode-html-default-extension";
29
32
  import "@codingame/monaco-vscode-javascript-default-extension";
30
- import { registerExtension as lt } from "vscode/extensions";
31
- const at = () => Ze(), gt = () => Ke(
33
+ import { registerExtension as It } from "vscode/extensions";
34
+ const Ct = () => Ke(), mt = () => Oe(
32
35
  () => Promise.resolve(void 0)
33
- ), ct = () => {
34
- const t = Be(), e = t.themeService.ctor.prototype;
36
+ ), ft = () => {
37
+ const n = Ge(), e = n.themeService.ctor.prototype;
35
38
  return e.defineTheme = () => {
36
- }, t;
37
- }, ut = `{
39
+ }, n;
40
+ }, pt = `{
38
41
  "workbench.colorTheme": "Default Dark+",
39
42
  "workbench.iconTheme": "vs-seti",
40
43
  "editor.autoClosingBrackets": "languageDefined",
@@ -119,106 +122,152 @@ const at = () => Ze(), gt = () => Ke(
119
122
  }
120
123
  }
121
124
  }
122
- `, dt = () => je(ut), It = async (t) => {
125
+ `;
126
+ class At {
127
+ constructor() {
128
+ this._onDidChangeCapabilities = new se(), this.onDidChangeCapabilities = this._onDidChangeCapabilities.event, this._onDidChangeFile = new se(), this.onDidChangeFile = this._onDidChangeFile.event, this.capabilities = re.FileReadWrite | re.FileOpenReadWriteClose, this.files = /* @__PURE__ */ new Map();
129
+ }
130
+ // --- stat()
131
+ async stat(e) {
132
+ const t = this.files.get(e.fsPath), i = Date.now();
133
+ return {
134
+ type: Me.File,
135
+ ctime: 0,
136
+ mtime: i,
137
+ size: t ? t.byteLength : 0
138
+ };
139
+ }
140
+ // --- mkdir()
141
+ async mkdir(e) {
142
+ }
143
+ // --- readdir()
144
+ async readdir(e) {
145
+ return [];
146
+ }
147
+ // --- readFile()
148
+ async readFile(e) {
149
+ const i = e.toString().split("/"), o = i.length, [r, s] = i.slice(o - 2), m = await Fe({
150
+ verb: Le.GET_INFO,
151
+ path: `${r}/${s}`,
152
+ content: !0,
153
+ as: "text"
154
+ }), d = new TextEncoder().encode(m.content);
155
+ return this.files.set(e.fsPath, d), d;
156
+ }
157
+ // --- writeFile()
158
+ async writeFile(e, t) {
159
+ const i = e.toString();
160
+ this.files.set(i, t), this._onDidChangeFile.fire([
161
+ { type: 1, resource: e }
162
+ // FileChangeType.Updated
163
+ ]);
164
+ }
165
+ // --- delete()
166
+ async delete(e) {
167
+ const t = e.toString();
168
+ this.files.delete(t);
169
+ }
170
+ // --- rename()
171
+ async rename(e, t) {
172
+ const i = e.toString(), o = t.toString(), r = this.files.get(i);
173
+ r && (this.files.set(o, r), this.files.delete(i));
174
+ }
175
+ // --- watch()
176
+ watch(e, t) {
177
+ return { dispose() {
178
+ } };
179
+ }
180
+ }
181
+ const bt = () => Be(pt), ht = async (n) => {
123
182
  var o;
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 dt(), e.userServices = e.userServices ?? {};
126
- const n = e.userServices.configurationService ?? void 0, i = e.workspaceConfig ?? void 0;
127
- if (n === void 0) {
183
+ const e = n.serviceConfig ?? {};
184
+ e.debugLogging = ((o = n.logger) == null ? void 0 : o.isEnabled()) === !0 && (e.debugLogging === !0 || n.logger.isDebugEnabled() === !0), await bt(), e.userServices = e.userServices ?? {};
185
+ const t = e.userServices.configurationService ?? void 0, i = e.workspaceConfig ?? void 0;
186
+ if (t === void 0) {
128
187
  if (i)
129
188
  throw new Error(
130
189
  "You provided a workspaceConfig without using the configurationServiceOverride"
131
190
  );
132
191
  const r = {
133
192
  // @see https://github.com/CodinGame/monaco-vscode-api#monaco-standalone-services
134
- ...at(),
135
- ...ct(),
136
- ...Ee(),
137
- ...Xe(),
138
- ...gt()
193
+ ...Ct(),
194
+ ...ft(),
195
+ ...De(),
196
+ ...Te(),
197
+ ...mt()
139
198
  };
140
- We(r, e.userServices);
199
+ Xe(r, e.userServices);
141
200
  }
142
- return i || (e.workspaceConfig = {
143
- workspaceProvider: {
144
- trusted: !0,
145
- workspace: {
146
- workspaceUri: l.Uri.file("/workspace")
147
- },
148
- async open() {
149
- return !1;
150
- }
151
- }
152
- }), e;
201
+ return Je(1, new At()), e;
153
202
  };
154
- class Ct extends Ve {
155
- constructor(e, n) {
156
- super(e), this.onMessage = n;
203
+ class vt extends Ue {
204
+ constructor(e, t) {
205
+ super(e), this.onMessage = t;
157
206
  }
158
207
  readMessage(e) {
159
208
  this.onMessage && this.onMessage();
160
- const [, n] = e.split(`\r
209
+ const [, t] = e.split(`\r
161
210
  \r
162
211
  `);
163
212
  if (this.state === "initial")
164
- this.events.splice(0, 0, { message: n });
213
+ this.events.splice(0, 0, { message: t });
165
214
  else if (this.state === "listening") {
166
- const i = JSON.parse(n);
215
+ const i = JSON.parse(t);
167
216
  this.callback(i);
168
217
  }
169
218
  }
170
219
  }
171
- class mt extends Ye {
172
- constructor(e, n) {
173
- super(e), this.onSend = n;
220
+ class St extends qe {
221
+ constructor(e, t) {
222
+ super(e), this.onSend = t;
174
223
  }
175
224
  async write(e) {
176
225
  try {
177
- const n = JSON.stringify(e);
178
- this.socket.send(n), this.onSend && this.onSend();
179
- } catch (n) {
180
- this.errorCount++, this.fireError(n, e, this.errorCount);
226
+ const t = JSON.stringify(e);
227
+ this.socket.send(t), this.onSend && this.onSend();
228
+ } catch (t) {
229
+ this.errorCount++, this.fireError(t, e, this.errorCount);
181
230
  }
182
231
  }
183
232
  }
184
- function j(t, e = !0) {
185
- const n = `/PACKAGE/Project/Sources/${t}`;
186
- return e ? `file://${n}` : n;
233
+ function j(n, e = !0) {
234
+ const t = `/PACKAGE/Project/Sources/${n}`;
235
+ return e ? `file://${t}` : t;
187
236
  }
188
- function ue(t, e = 0) {
189
- setTimeout(t, e);
237
+ function Ie(n, e = 0) {
238
+ setTimeout(n, e);
190
239
  }
191
- function ft(t, e) {
192
- const n = new Te(
240
+ function yt(n, e) {
241
+ const t = new He(
193
242
  e.startLineNumber,
194
243
  e.startColumn,
195
244
  e.endLineNumber || e.startLineNumber,
196
245
  e.endColumn || e.startColumn
197
246
  );
198
- ue(() => {
199
- t.setSelection(n), t.revealRangeInCenter(n), t.focus();
247
+ Ie(() => {
248
+ n.setSelection(t), n.revealRangeInCenter(t), n.focus();
200
249
  });
201
250
  }
202
- function pt(t, e, n = 0) {
203
- n > 0 && (e = n + e), ue(() => {
204
- t.setPosition({ lineNumber: e, column: 1 }), t.revealLineInCenter(e), t.focus();
251
+ function Nt(n, e, t = 0) {
252
+ t > 0 && (e = t + e), Ie(() => {
253
+ n.setPosition({ lineNumber: e, column: 1 }), n.revealLineInCenter(e), n.focus();
205
254
  });
206
255
  }
207
- function Nn(t, e, n) {
208
- const o = t.getModel();
256
+ function Xn(n, e, t) {
257
+ const o = n.getModel();
209
258
  if (o && e) {
210
259
  const r = o.getLineCount();
211
260
  for (let s = 1; s <= r; s++) {
212
- const p = o.getLineContent(s);
213
- if (new RegExp(`(?:Function|function) ${n}`).test(p))
261
+ const m = o.getLineContent(s);
262
+ if (new RegExp(`(?:Function|function) ${t}`).test(m))
214
263
  return s;
215
264
  }
216
265
  }
217
266
  return 0;
218
267
  }
219
- const At = {
220
- provideCompletionItems: async (t, e) => {
221
- const n = t.getWordUntilPosition(e);
268
+ const Rt = {
269
+ provideCompletionItems: async (n, e) => {
270
+ const t = n.getWordUntilPosition(e);
222
271
  return {
223
272
  suggestions: [
224
273
  {
@@ -226,9 +275,9 @@ const At = {
226
275
  kind: l.languages.CompletionItemKind.Snippet,
227
276
  range: new l.Range(
228
277
  e.lineNumber,
229
- n.startColumn,
278
+ t.startColumn,
230
279
  e.lineNumber,
231
- n.endColumn
280
+ t.endColumn
232
281
  ),
233
282
  insertText: ["var ${1:var_name} : ${2:var_type}"].join(`
234
283
  `),
@@ -239,9 +288,9 @@ const At = {
239
288
  kind: l.languages.CompletionItemKind.Snippet,
240
289
  range: new l.Range(
241
290
  e.lineNumber,
242
- n.startColumn,
291
+ t.startColumn,
243
292
  e.lineNumber,
244
- n.endColumn
293
+ t.endColumn
245
294
  ),
246
295
  insertText: [
247
296
  "While(${1:expression})",
@@ -256,9 +305,9 @@ const At = {
256
305
  kind: l.languages.CompletionItemKind.Snippet,
257
306
  range: new l.Range(
258
307
  e.lineNumber,
259
- n.startColumn,
308
+ t.startColumn,
260
309
  e.lineNumber,
261
- n.endColumn
310
+ t.endColumn
262
311
  ),
263
312
  insertText: [
264
313
  "Case of",
@@ -274,9 +323,9 @@ const At = {
274
323
  kind: l.languages.CompletionItemKind.Snippet,
275
324
  range: new l.Range(
276
325
  e.lineNumber,
277
- n.startColumn,
326
+ t.startColumn,
278
327
  e.lineNumber,
279
- n.endColumn
328
+ t.endColumn
280
329
  ),
281
330
  insertText: ["Else", " "].join(`
282
331
  `),
@@ -287,9 +336,9 @@ const At = {
287
336
  kind: l.languages.CompletionItemKind.Snippet,
288
337
  range: new l.Range(
289
338
  e.lineNumber,
290
- n.startColumn,
339
+ t.startColumn,
291
340
  e.lineNumber,
292
- n.endColumn
341
+ t.endColumn
293
342
  ),
294
343
  insertText: ["If (${1:expression})", " ${5:body}", "End if"].join(
295
344
  `
@@ -302,9 +351,9 @@ const At = {
302
351
  kind: l.languages.CompletionItemKind.Snippet,
303
352
  range: new l.Range(
304
353
  e.lineNumber,
305
- n.startColumn,
354
+ t.startColumn,
306
355
  e.lineNumber,
307
- n.endColumn
356
+ t.endColumn
308
357
  ),
309
358
  insertText: [
310
359
  "For(${1:counter};${2:start};${3:end}${4:;increment})",
@@ -319,9 +368,9 @@ const At = {
319
368
  kind: l.languages.CompletionItemKind.Snippet,
320
369
  range: new l.Range(
321
370
  e.lineNumber,
322
- n.startColumn,
371
+ t.startColumn,
323
372
  e.lineNumber,
324
- n.endColumn
373
+ t.endColumn
325
374
  ),
326
375
  insertText: [
327
376
  "Function ${1:function_name}(${2:params}) -> ${3:var_name} : ${4:var_type}",
@@ -333,9 +382,9 @@ const At = {
333
382
  ]
334
383
  };
335
384
  }
336
- }, bt = {
337
- provideCompletionItems: async (t, e) => {
338
- const n = t.getWordUntilPosition(e);
385
+ }, wt = {
386
+ provideCompletionItems: async (n, e) => {
387
+ const t = n.getWordUntilPosition(e);
339
388
  return {
340
389
  suggestions: [
341
390
  {
@@ -343,9 +392,9 @@ const At = {
343
392
  kind: l.languages.CompletionItemKind.Snippet,
344
393
  range: new l.Range(
345
394
  e.lineNumber,
346
- n.startColumn,
395
+ t.startColumn,
347
396
  e.lineNumber,
348
- n.endColumn
397
+ t.endColumn
349
398
  ),
350
399
  insertText: ["var ${1:var_name} : ${2:var_type}"].join(`
351
400
  `),
@@ -356,9 +405,9 @@ const At = {
356
405
  kind: l.languages.CompletionItemKind.Snippet,
357
406
  range: new l.Range(
358
407
  e.lineNumber,
359
- n.startColumn,
408
+ t.startColumn,
360
409
  e.lineNumber,
361
- n.endColumn
410
+ t.endColumn
362
411
  ),
363
412
  insertText: ["while(${1:expression})", " ${2:body}", "end"].join(
364
413
  `
@@ -371,9 +420,9 @@ const At = {
371
420
  kind: l.languages.CompletionItemKind.Snippet,
372
421
  range: new l.Range(
373
422
  e.lineNumber,
374
- n.startColumn,
423
+ t.startColumn,
375
424
  e.lineNumber,
376
- n.endColumn
425
+ t.endColumn
377
426
  ),
378
427
  insertText: [
379
428
  "switch",
@@ -389,9 +438,9 @@ const At = {
389
438
  kind: l.languages.CompletionItemKind.Snippet,
390
439
  range: new l.Range(
391
440
  e.lineNumber,
392
- n.startColumn,
441
+ t.startColumn,
393
442
  e.lineNumber,
394
- n.endColumn
443
+ t.endColumn
395
444
  ),
396
445
  insertText: ["else", " "].join(`
397
446
  `),
@@ -402,9 +451,9 @@ const At = {
402
451
  kind: l.languages.CompletionItemKind.Snippet,
403
452
  range: new l.Range(
404
453
  e.lineNumber,
405
- n.startColumn,
454
+ t.startColumn,
406
455
  e.lineNumber,
407
- n.endColumn
456
+ t.endColumn
408
457
  ),
409
458
  insertText: ["if (${1:expression})", " ${5:body}", "end"].join(
410
459
  `
@@ -417,9 +466,9 @@ const At = {
417
466
  kind: l.languages.CompletionItemKind.Snippet,
418
467
  range: new l.Range(
419
468
  e.lineNumber,
420
- n.startColumn,
469
+ t.startColumn,
421
470
  e.lineNumber,
422
- n.endColumn
471
+ t.endColumn
423
472
  ),
424
473
  insertText: [
425
474
  "for(${1:counter},${2:start},${3:end}${4:,increment})",
@@ -434,9 +483,9 @@ const At = {
434
483
  kind: l.languages.CompletionItemKind.Snippet,
435
484
  range: new l.Range(
436
485
  e.lineNumber,
437
- n.startColumn,
486
+ t.startColumn,
438
487
  e.lineNumber,
439
- n.endColumn
488
+ t.endColumn
440
489
  ),
441
490
  insertText: [
442
491
  "function ${1:function_name}(${2:params}) -> ${3:var_name} : ${4:var_type}",
@@ -448,7 +497,7 @@ const At = {
448
497
  ]
449
498
  };
450
499
  }
451
- }, ht = [
500
+ }, xt = [
452
501
  // zoom in
453
502
  {
454
503
  keybinding: G.CtrlCmd | J.NumpadAdd,
@@ -476,16 +525,16 @@ const At = {
476
525
  keybinding: G.CtrlCmd | J.Digit0,
477
526
  command: "editor.action.fontZoomReset"
478
527
  }
479
- ], vt = ({ defaultZoom: t }) => (M(() => {
480
- t !== void 0 && ce.EditorZoom.setZoomLevel(t);
528
+ ], Ft = ({ defaultZoom: n }) => (M(() => {
529
+ n !== void 0 && de.EditorZoom.setZoomLevel(n);
481
530
  }, []), null);
482
- ye.config({
531
+ Re.config({
483
532
  monaco: l
484
533
  // paths: {
485
534
  // vs: import.meta.env.VITE_MONACO_EDITOR_CDN,
486
535
  // },
487
536
  });
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 || {});
537
+ var H = /* @__PURE__ */ ((n) => (n[n.NotSet = -1] = "NotSet", n[n.None = 0] = "None", n[n.Italic = 1] = "Italic", n[n.Bold = 2] = "Bold", n[n.Underline = 4] = "Underline", n[n.Strikethrough = 8] = "Strikethrough", n))(H || {}), Ce = /* @__PURE__ */ ((n) => (n[n.None = 0] = "None", n[n.DefaultForeground = 1] = "DefaultForeground", n[n.DefaultBackground = 2] = "DefaultBackground", n))(Ce || {}), me = /* @__PURE__ */ ((n) => (n[n.Other = 0] = "Other", n[n.Comment = 1] = "Comment", n[n.String = 2] = "String", n[n.RegEx = 3] = "RegEx", n))(me || {});
489
538
  class V {
490
539
  static getLanguageId(e) {
491
540
  return (e & 255) >>> 0;
@@ -510,17 +559,17 @@ class V {
510
559
  const o = this.getFontStyle(e);
511
560
  return o & 1 && (i += " mtki"), o & 2 && (i += " mtkb"), o & 4 && (i += " mtku"), o & 8 && (i += " mtks"), i;
512
561
  }
513
- static getInlineStyleFromMetadata(e, n) {
562
+ static getInlineStyleFromMetadata(e, t) {
514
563
  const i = this.getForeground(e), o = this.getFontStyle(e);
515
- let r = `color: ${n[i]};`;
564
+ let r = `color: ${t[i]};`;
516
565
  o & 1 && (r += "font-style: italic;"), o & 2 && (r += "font-weight: bold;");
517
566
  let s = "";
518
567
  return o & 4 && (s += " underline"), o & 8 && (s += " line-through"), s && (r += `text-decoration:${s};`), r;
519
568
  }
520
569
  static getPresentationFromMetadata(e) {
521
- const n = this.getForeground(e), i = this.getFontStyle(e);
570
+ const t = this.getForeground(e), i = this.getFontStyle(e);
522
571
  return {
523
- foreground: n,
572
+ foreground: t,
524
573
  italic: !!(i & 1),
525
574
  bold: !!(i & 2),
526
575
  underline: !!(i & 4),
@@ -528,57 +577,57 @@ class V {
528
577
  };
529
578
  }
530
579
  }
531
- function St(t, e, n, i) {
532
- const o = n.tokens.data, r = t.getLanguageId();
533
- let s = 0, p = 0;
534
- const m = i.lineNumber - 1, h = i.column - 1;
535
- for (let C = 0; C < o.length; C += 5) {
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 = [];
580
+ function Lt(n, e, t, i) {
581
+ const o = t.tokens.data, r = n.getLanguageId();
582
+ let s = 0, m = 0;
583
+ const d = i.lineNumber - 1, h = i.column - 1;
584
+ for (let f = 0; f < o.length; f += 5) {
585
+ const A = o[f], p = o[f + 1], x = o[f + 2], R = o[f + 3], S = o[f + 4], y = s + A, b = A === 0 ? m + p : p;
586
+ if (d === y && b <= h && h < b + x) {
587
+ const I = t.legend.tokenTypes[R] || "not in legend (ignored)", W = [];
539
588
  let a = S;
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(
589
+ for (let P = 0; a > 0 && P < t.legend.tokenModifiers.length; P++)
590
+ a & 1 && W.push(t.legend.tokenModifiers[P]), a = a >> 1;
591
+ a > 0 && W.push("not in legend (ignored)");
592
+ const g = new _e(
544
593
  y + 1,
545
594
  b + 1,
546
595
  y + 1,
547
596
  b + 1 + x
548
- ), k = {}, L = e.getColorTheme().tokenColorMap, v = e.getColorTheme().getTokenStyleMetadata(
549
- d,
550
- F,
597
+ ), F = {}, L = e.getColorTheme().tokenColorMap, v = e.getColorTheme().getTokenStyleMetadata(
598
+ I,
599
+ W,
551
600
  r,
552
601
  !0,
553
- k
602
+ F
554
603
  );
555
- let _;
556
- return v && (_ = {
604
+ let $;
605
+ return v && ($ = {
557
606
  languageId: void 0,
558
- tokenType: Ie.Other,
607
+ tokenType: me.Other,
559
608
  bold: v == null ? void 0 : v.bold,
560
609
  italic: v == null ? void 0 : v.italic,
561
610
  underline: v == null ? void 0 : v.underline,
562
611
  strikethrough: v == null ? void 0 : v.strikethrough,
563
- foreground: L[(v == null ? void 0 : v.foreground) || de.None],
612
+ foreground: L[(v == null ? void 0 : v.foreground) || Ce.None],
564
613
  background: void 0
565
- }), { type: d, modifiers: F, range: g, metadata: _, definitions: k };
614
+ }), { type: I, modifiers: W, range: g, metadata: $, definitions: F };
566
615
  }
567
- s = y, p = b;
616
+ s = y, m = b;
568
617
  }
569
618
  return null;
570
619
  }
571
- function yt(t, e, n) {
620
+ function kt(n, e, t) {
572
621
  let i = null;
573
- for (let o = 1; o < n; o++)
622
+ for (let o = 1; o < t; o++)
574
623
  i = e.tokenizeLine(
575
- t.getLineContent(o),
624
+ n.getLineContent(o),
576
625
  i
577
626
  ).ruleStack;
578
627
  return i;
579
628
  }
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);
629
+ function Wt(n, e, t) {
630
+ const i = n.getColorTheme().tokenColorMap, o = V.getLanguageId(t), r = V.getTokenType(t), s = V.getFontStyle(t), m = V.getForeground(t), d = V.getBackground(t);
582
631
  return {
583
632
  languageId: e.languageIdCodec.decodeLanguageId(o),
584
633
  tokenType: r,
@@ -586,69 +635,69 @@ function Nt(t, e, n) {
586
635
  italic: s & H.Italic ? !0 : void 0,
587
636
  underline: s & H.Underline ? !0 : void 0,
588
637
  strikethrough: s & H.Strikethrough ? !0 : void 0,
589
- foreground: i[p],
590
- background: i[m]
638
+ foreground: i[m],
639
+ background: i[d]
591
640
  };
592
641
  }
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
- t.getLineContent(i),
642
+ function Zt(n, e, t) {
643
+ const i = t.lineNumber, o = n, r = o._tokenizationTextModelPart.grammarTokens._tokenizer.tokenizationSupport._actual._grammar, s = kt(n, r, i), m = r.tokenizeLine(
644
+ n.getLineContent(i),
596
645
  s
597
- ), m = r.tokenizeLine2(
598
- t.getLineContent(i),
646
+ ), d = r.tokenizeLine2(
647
+ n.getLineContent(i),
599
648
  s
600
649
  );
601
650
  let h = 0;
602
- for (let A = p.tokens.length - 1; A >= 0; A--) {
603
- const f = p.tokens[A];
604
- if (n.column - 1 >= f.startIndex) {
651
+ for (let A = m.tokens.length - 1; A >= 0; A--) {
652
+ const p = m.tokens[A];
653
+ if (t.column - 1 >= p.startIndex) {
605
654
  h = A;
606
655
  break;
607
656
  }
608
657
  }
609
- let C = 0;
610
- for (let A = m.tokens.length >>> 1; A >= 0; A--)
611
- if (n.column - 1 >= m.tokens[A << 1]) {
612
- C = A;
658
+ let f = 0;
659
+ for (let A = d.tokens.length >>> 1; A >= 0; A--)
660
+ if (t.column - 1 >= d.tokens[A << 1]) {
661
+ f = A;
613
662
  break;
614
663
  }
615
664
  return {
616
- token: p.tokens[h],
617
- metadata: Nt(
665
+ token: m.tokens[h],
666
+ metadata: Wt(
618
667
  e,
619
668
  o._languageService,
620
- m.tokens[(C << 1) + 1]
669
+ d.tokens[(f << 1) + 1]
621
670
  )
622
671
  };
623
672
  }
624
- const Ce = le(void 0), Rn = ({
625
- children: t,
673
+ const fe = ge(void 0), En = ({
674
+ children: n,
626
675
  url: e,
627
- qodly: n,
676
+ qodly: t,
628
677
  defaultZoom: i,
629
678
  openHandler: o,
630
679
  language: r = "4d",
631
680
  defaultInited: s = !1
632
681
  }) => {
633
- const p = Ne(), [m, h] = $(s), [C, A] = $(null), f = oe(), x = oe(0);
682
+ const m = we(), [d, h] = z(s), [f, A] = z(null), p = oe(), x = oe(0);
634
683
  M(() => {
635
- e && p && R();
636
- }, [e, p]);
684
+ e && m && R();
685
+ }, [e, m]);
637
686
  const R = async () => {
638
- if (!p) return;
639
- const I = new Je({
687
+ if (!m) return;
688
+ const C = new Pe({
640
689
  enabled: process.env.NODE_ENV === "development",
641
690
  debugEnabled: process.env.NODE_ENV === "development"
642
- }), c = await It({
643
- logger: I
691
+ }), c = await ht({
692
+ logger: C
644
693
  });
645
- await Fe({
694
+ await Ee({
646
695
  caller: "Qodly Code Editor",
647
- logger: I,
696
+ logger: C,
648
697
  serviceConfig: c
649
- }), o && rt.get(st).registerCodeEditorOpenHandler(o), p.languages.registerCompletionItemProvider(
698
+ }), o && ut.get(dt).registerCodeEditorOpenHandler(o), m.languages.registerCompletionItemProvider(
650
699
  r,
651
- n ? bt : At
700
+ t ? wt : Rt
652
701
  );
653
702
  const u = te.getDefaultKeybindings.bind(te);
654
703
  te.getDefaultKeybindings = () => u().filter(
@@ -656,24 +705,24 @@ const Ce = le(void 0), Rn = ({
656
705
  "workbench.action.files.saveAs",
657
706
  "workbench.action.files.save"
658
707
  ].includes(Z.command)
659
- ), ce.addKeybindingRules(ht), p.languages.registerFoldingRangeProvider(r, {
708
+ ), de.addKeybindingRules(xt), m.languages.registerFoldingRangeProvider(r, {
660
709
  provideFoldingRanges: function(N) {
661
710
  const Z = [], X = /\\\s*$/;
662
- for (let W = 1, D = N.getLineCount(); W <= D; W++) {
663
- const U = N.getLineContent(W);
711
+ for (let k = 1, O = N.getLineCount(); k <= O; k++) {
712
+ const U = N.getLineContent(k);
664
713
  if (X.exec(U)) {
665
- let K = W + 1;
666
- for (; K <= D; ) {
714
+ let K = k + 1;
715
+ for (; K <= O; ) {
667
716
  const ee = N.getLineContent(K);
668
717
  if (X.exec(ee) == null)
669
718
  break;
670
719
  K++;
671
720
  }
672
- K > W && (Z.push({
673
- start: W,
721
+ K > k && (Z.push({
722
+ start: k,
674
723
  end: K,
675
- kind: p.languages.FoldingRangeKind.Region
676
- }), W = K);
724
+ kind: m.languages.FoldingRangeKind.Region
725
+ }), k = K);
677
726
  }
678
727
  }
679
728
  return Z;
@@ -681,27 +730,27 @@ const Ce = le(void 0), Rn = ({
681
730
  }), S();
682
731
  }, S = () => {
683
732
  A(null);
684
- let I;
733
+ let C;
685
734
  try {
686
- I = new WebSocket(localStorage.LSP_SERVER || e);
735
+ C = new WebSocket(localStorage.LSP_SERVER || e);
687
736
  } catch {
688
737
  A(new Event("INVALID_URL"));
689
738
  return;
690
739
  }
691
- I.onopen = y, I.onclose = b, I.onerror = d, x.current = 0;
740
+ C.onopen = y, C.onclose = b, C.onerror = I, x.current = 0;
692
741
  }, y = async function() {
693
- const I = He(this), c = new Ct(I), u = new mt(I), N = new Le({
742
+ const C = Qe(this), c = new vt(C), u = new St(C), N = new je({
694
743
  name: "4D Language Client",
695
744
  clientOptions: {
696
745
  workspaceFolder: {
697
- uri: De.parse("file:///PACKAGE")
746
+ uri: ze.parse("file:///PACKAGE")
698
747
  },
699
748
  // use a language id as a document selector
700
749
  documentSelector: [{ scheme: "file", language: r }],
701
750
  // disable the default error handler
702
751
  errorHandler: {
703
- error: () => ({ action: Pe.Continue }),
704
- closed: () => ({ action: Me.DoNotRestart })
752
+ error: () => ({ action: Ye.Continue }),
753
+ closed: () => ({ action: Ve.DoNotRestart })
705
754
  }
706
755
  },
707
756
  // create a language client connection from the JSON RPC connection on demand
@@ -712,23 +761,23 @@ const Ce = le(void 0), Rn = ({
712
761
  })
713
762
  }
714
763
  });
715
- f.current = N;
764
+ p.current = N;
716
765
  const Z = N.sendRequest.bind(N);
717
- f.current.sendRequest = function(X, W, D) {
766
+ p.current.sendRequest = function(X, k, O) {
718
767
  return typeof X == "object" && X.method === "textDocument/diagnostic" && /file:\/\/\/PACKAGE\/Project\/Sources\/Methods\/__Debugger_.*/.test(
719
- W.textDocument.uri
720
- ) ? Promise.resolve() : Z(X, W, D);
768
+ k.textDocument.uri
769
+ ) ? Promise.resolve() : Z(X, k, O);
721
770
  }, c.onClose(() => {
722
771
  N.stop(), x.current < 3 ? setTimeout(() => {
723
772
  x.current++, S();
724
773
  }, 1e3) : A(new Event("WEBSOCKET_CLOSED"));
725
774
  }), N.needsStart() && await N.start(), h(!0);
726
775
  }, b = () => {
727
- }, d = (I) => {
728
- A(I);
776
+ }, I = (C) => {
777
+ A(C);
729
778
  };
730
779
  M(() => {
731
- const I = we.subscribe(({ action: c, payload: u }) => {
780
+ const C = ke.subscribe(({ action: c, payload: u }) => {
732
781
  switch (c) {
733
782
  case E.WILL_SAVE:
734
783
  L(u.filePath);
@@ -740,61 +789,61 @@ const Ce = le(void 0), Rn = ({
740
789
  v(u.filePath);
741
790
  break;
742
791
  case E.DID_CREATE:
743
- be(u.filePath);
792
+ ve(u.filePath);
744
793
  break;
745
794
  case E.WILL_RENAME:
746
- _(u.oldPath, u.newPath);
795
+ $(u.oldPath, u.newPath);
747
796
  break;
748
797
  case E.DID_RENAME:
749
- he(u.oldPath, u.newPath);
798
+ Se(u.oldPath, u.newPath);
750
799
  break;
751
800
  case E.WILL_DELETE:
752
801
  P(u.filePath);
753
802
  break;
754
803
  case E.DID_DELETE:
755
- ve(u.filePath);
804
+ ye(u.filePath);
756
805
  break;
757
806
  case E.DIAGNOSTIC_REFRESH:
758
- k(u.filePath);
807
+ F(u.filePath);
759
808
  break;
760
809
  }
761
810
  });
762
- return () => I.unsubscribe();
811
+ return () => C.unsubscribe();
763
812
  }, []);
764
- const F = (I) => {
813
+ const W = (C) => {
765
814
  var c, u;
766
- return (u = (c = f.current) == null ? void 0 : c._features) == null ? void 0 : u.find(
815
+ return (u = (c = p.current) == null ? void 0 : c._features) == null ? void 0 : u.find(
767
816
  (N) => {
768
817
  var Z;
769
- return ((Z = N._registrationType) == null ? void 0 : Z.method) === I;
818
+ return ((Z = N._registrationType) == null ? void 0 : Z.method) === C;
770
819
  }
771
820
  );
772
- }, a = (I) => {
773
- const c = [], u = F(I);
821
+ }, a = (C) => {
822
+ const c = [], u = W(C);
774
823
  if (u)
775
824
  for (const [, N] of u._registrations)
776
825
  N.provider && c.push(N.provider);
777
826
  return c;
778
- }, g = async (I, c, u) => {
779
- var Z, X, W;
827
+ }, g = async (C, c, u) => {
828
+ var Z, X, k;
780
829
  const N = a(
781
- ot.method
830
+ ct.method
782
831
  );
783
832
  if (N[0]) {
784
- const D = new Ge(), U = await Promise.resolve(
833
+ const O = new $e(), U = await Promise.resolve(
785
834
  N[0].full.provideDocumentSemanticTokens(
786
835
  c,
787
- D.token
836
+ O.token
788
837
  )
789
- ), Q = I, K = U ? St(
838
+ ), Q = C, K = U ? Lt(
790
839
  c,
791
840
  Q._themeService,
792
841
  {
793
842
  tokens: U,
794
- legend: (W = (X = (Z = f.current) == null ? void 0 : Z._capabilities) == null ? void 0 : X.semanticTokensProvider) == null ? void 0 : W.legend
843
+ legend: (k = (X = (Z = p.current) == null ? void 0 : Z._capabilities) == null ? void 0 : X.semanticTokensProvider) == null ? void 0 : k.legend
795
844
  },
796
845
  u
797
- ) : null, ee = Rt(
846
+ ) : null, ee = Zt(
798
847
  c,
799
848
  Q._themeService,
800
849
  u
@@ -805,139 +854,139 @@ const Ce = le(void 0), Rn = ({
805
854
  };
806
855
  }
807
856
  return null;
808
- }, k = (I) => {
809
- if (f.current) {
857
+ }, F = (C) => {
858
+ if (p.current) {
810
859
  const c = a(
811
- $e.method
860
+ tt.method
812
861
  );
813
862
  for (const u of c)
814
863
  u.onDidChangeDiagnosticsEmitter.fire();
815
864
  }
816
- }, L = (I, c = ze.Manual) => {
865
+ }, L = (C, c = et.Manual) => {
817
866
  var u;
818
- (u = f.current) == null || u.sendNotification(_e.type, {
867
+ (u = p.current) == null || u.sendNotification(nt.type, {
819
868
  textDocument: {
820
- uri: j(I)
869
+ uri: j(C)
821
870
  },
822
871
  reason: c
823
872
  });
824
- }, T = (I, c) => {
873
+ }, T = (C, c) => {
825
874
  var u;
826
- (u = f.current) == null || u.sendNotification(Ue.type, {
875
+ (u = p.current) == null || u.sendNotification(it.type, {
827
876
  textDocument: {
828
- uri: j(I)
877
+ uri: j(C)
829
878
  },
830
879
  text: c
831
880
  });
832
- }, v = (I) => {
881
+ }, v = (C) => {
833
882
  var c;
834
- (c = f.current) == null || c.sendRequest(qe.type, {
883
+ (c = p.current) == null || c.sendRequest(ot.type, {
835
884
  files: [
836
885
  {
837
- uri: j(I)
886
+ uri: j(C)
838
887
  }
839
888
  ]
840
889
  });
841
- }, _ = (I, c) => {
890
+ }, $ = (C, c) => {
842
891
  var u;
843
- (u = f.current) == null || u.sendRequest(Qe.type, {
892
+ (u = p.current) == null || u.sendRequest(rt.type, {
844
893
  files: [
845
894
  {
846
- oldUri: j(I),
895
+ oldUri: j(C),
847
896
  newUri: j(c)
848
897
  }
849
898
  ]
850
899
  });
851
- }, P = (I) => {
900
+ }, P = (C) => {
852
901
  var c;
853
- (c = f.current) == null || c.sendRequest(et.type, {
902
+ (c = p.current) == null || c.sendRequest(st.type, {
854
903
  files: [
855
904
  {
856
- uri: j(I)
905
+ uri: j(C)
857
906
  }
858
907
  ]
859
908
  });
860
- }, be = (I) => {
909
+ }, ve = (C) => {
861
910
  var c;
862
- (c = f.current) == null || c.sendNotification(tt.type, {
911
+ (c = p.current) == null || c.sendNotification(lt.type, {
863
912
  files: [
864
913
  {
865
- uri: j(I)
914
+ uri: j(C)
866
915
  }
867
916
  ]
868
917
  });
869
- }, he = (I, c) => {
918
+ }, Se = (C, c) => {
870
919
  var u;
871
- (u = f.current) == null || u.sendNotification(nt.type, {
920
+ (u = p.current) == null || u.sendNotification(at.type, {
872
921
  files: [
873
922
  {
874
- oldUri: j(I),
923
+ oldUri: j(C),
875
924
  newUri: j(c)
876
925
  }
877
926
  ]
878
927
  });
879
- }, ve = (I) => {
928
+ }, ye = (C) => {
880
929
  var c;
881
- (c = f.current) == null || c.sendNotification(it.type, {
930
+ (c = p.current) == null || c.sendNotification(gt.type, {
882
931
  files: [
883
932
  {
884
- uri: j(I)
933
+ uri: j(C)
885
934
  }
886
935
  ]
887
936
  });
888
937
  };
889
- return /* @__PURE__ */ z(
890
- Ce.Provider,
938
+ return /* @__PURE__ */ _(
939
+ fe.Provider,
891
940
  {
892
941
  value: {
893
- inited: m || !!C,
894
- clientRef: f,
895
- lastError: C,
942
+ inited: d || !!f,
943
+ clientRef: p,
944
+ lastError: f,
896
945
  reload: S,
897
946
  getTokenAtPosition: g
898
947
  },
899
948
  children: [
900
- t,
901
- /* @__PURE__ */ w(vt, { defaultZoom: i })
949
+ n,
950
+ /* @__PURE__ */ w(Ft, { defaultZoom: i })
902
951
  ]
903
952
  }
904
953
  );
905
954
  };
906
- function wn() {
907
- const t = ae(Ce);
908
- if (t === void 0)
955
+ function Kn() {
956
+ const n = ce(fe);
957
+ if (n === void 0)
909
958
  throw new Error("useLSP must be used within an LSPContext");
910
- return t;
959
+ return n;
911
960
  }
912
- const me = le(
961
+ const pe = ge(
913
962
  void 0
914
- ), xn = Se(({ children: t }) => {
915
- const [e, n] = $(null);
963
+ ), Bn = Ne(({ children: n }) => {
964
+ const [e, t] = z(null);
916
965
  return /* @__PURE__ */ w(
917
- me.Provider,
966
+ pe.Provider,
918
967
  {
919
968
  value: {
920
969
  editor: e,
921
- setEditor: n
970
+ setEditor: t
922
971
  },
923
- children: t
972
+ children: n
924
973
  }
925
974
  );
926
975
  });
927
- function wt() {
928
- const t = ae(me), e = $(null);
929
- if (t === void 0) {
930
- const [n, i] = e;
976
+ function jt() {
977
+ const n = ce(pe), e = z(null);
978
+ if (n === void 0) {
979
+ const [t, i] = e;
931
980
  return {
932
- editor: n,
981
+ editor: t,
933
982
  setEditor: i
934
983
  };
935
984
  }
936
- return t;
985
+ return n;
937
986
  }
938
- const xt = {
939
- provideCompletionItems: (t, e) => {
940
- const n = t.getWordUntilPosition(e);
987
+ const Xt = {
988
+ provideCompletionItems: (n, e) => {
989
+ const t = n.getWordUntilPosition(e);
941
990
  return {
942
991
  suggestions: [
943
992
  {
@@ -946,9 +995,9 @@ const xt = {
946
995
  documentation: "Media query for phone device",
947
996
  range: new l.Range(
948
997
  e.lineNumber,
949
- n.startColumn,
998
+ t.startColumn,
950
999
  e.lineNumber,
951
- n.endColumn
1000
+ t.endColumn
952
1001
  ),
953
1002
  insertText: [
954
1003
  "@media screen and (max-width: ${1:365px}) {",
@@ -963,38 +1012,38 @@ const xt = {
963
1012
  ]
964
1013
  };
965
1014
  }
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
1015
+ }, Et = "#/definitions/Condition", Kt = { 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"] } }, Bt = {
1016
+ $ref: Et,
1017
+ definitions: Kt
1018
+ }, Tt = "array", Dt = { type: "object", properties: { class: { type: "string" }, method: { type: "string" }, regexPattern: { type: "string" }, verbs: { type: "string" } } }, Ot = {
1019
+ type: Tt,
1020
+ items: Dt
972
1021
  };
973
- function Xt(t, e) {
974
- const n = document.createElement("style");
975
- n.dataset.id = e, n.textContent = t, document.head.append(n);
1022
+ function Gt(n, e) {
1023
+ const t = document.createElement("style");
1024
+ t.dataset.id = e, t.textContent = n, document.head.append(t);
976
1025
  }
977
- function Et(t) {
1026
+ function Jt(n) {
978
1027
  return Array.from(document.styleSheets).find(
979
- (e) => e.ownerNode.getAttribute("data-id") === t
1028
+ (e) => e.ownerNode.getAttribute("data-id") === n
980
1029
  );
981
1030
  }
982
- function Kt(t, e) {
983
- const n = [];
1031
+ function Mt(n, e) {
1032
+ const t = [];
984
1033
  let i = [];
985
- const o = [], r = (a, g, k, L) => {
986
- n.push({
1034
+ const o = [], r = (a, g, F, L) => {
1035
+ t.push({
987
1036
  startLineNumber: a,
988
- endLineNumber: k,
1037
+ endLineNumber: F,
989
1038
  startColumn: g,
990
1039
  endColumn: L
991
- }), h(), m();
1040
+ }), h(), d();
992
1041
  }, s = (a) => {
993
1042
  o.indexOf(a) < 0 && o.push(a);
994
- }, p = (a) => {
1043
+ }, m = (a) => {
995
1044
  const g = o.indexOf(a);
996
1045
  g < 0 || o.splice(g, 1);
997
- }, m = () => {
1046
+ }, d = () => {
998
1047
  for (const a of o)
999
1048
  try {
1000
1049
  a(i);
@@ -1002,9 +1051,9 @@ function Kt(t, e) {
1002
1051
  console.error(g);
1003
1052
  }
1004
1053
  }, h = () => {
1005
- const a = t.getModel();
1006
- a && (i = Tt(
1007
- n.map((g) => [
1054
+ const a = n.getModel();
1055
+ a && (i = Vt(
1056
+ t.map((g) => [
1008
1057
  a.getOffsetAt({
1009
1058
  lineNumber: g.startLineNumber,
1010
1059
  column: g.startColumn
@@ -1017,25 +1066,25 @@ function Kt(t, e) {
1017
1066
  /*mergeJoins*/
1018
1067
  !0
1019
1068
  ), 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)));
1020
- }, C = (a) => {
1069
+ }, f = (a) => {
1021
1070
  const g = {
1022
1071
  isDeletion: !1,
1023
1072
  isAddition: !1,
1024
1073
  isReplacement: !1
1025
1074
  };
1026
1075
  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) => {
1076
+ }, A = n.onDidChangeModel((a) => {
1077
+ h(), I();
1078
+ }), p = n.onDidChangeModelContent((a) => {
1030
1079
  if (!a.isUndoing)
1031
1080
  for (const g of a.changes) {
1032
- const k = C(g);
1033
- if (k.isReplacement || k.isDeletion || k.isAddition) {
1034
- const L = n.some(
1081
+ const F = f(g);
1082
+ if (F.isReplacement || F.isDeletion || F.isAddition) {
1083
+ const L = t.some(
1035
1084
  (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);
1085
+ ), T = !L && e && g.range.startLineNumber === 1 && g.range.startColumn === 1 && !ue(g.text);
1037
1086
  if (L || T) {
1038
- const v = t.getModel();
1087
+ const v = n.getModel();
1039
1088
  if (v) {
1040
1089
  v.undo();
1041
1090
  return;
@@ -1044,7 +1093,7 @@ function Kt(t, e) {
1044
1093
  }
1045
1094
  }
1046
1095
  }), x = () => {
1047
- A.dispose(), f.dispose();
1096
+ A.dispose(), p.dispose();
1048
1097
  };
1049
1098
  let R = [], S = `
1050
1099
  .idoc-readonly-mark {
@@ -1054,24 +1103,24 @@ function Kt(t, e) {
1054
1103
  `;
1055
1104
  if (S) {
1056
1105
  const a = "monaco-read-only";
1057
- Et(a) || Xt(S, a), S = null;
1106
+ Jt(a) || Gt(S, a), S = null;
1058
1107
  }
1059
1108
  const y = () => {
1060
- s(d), d();
1109
+ s(I), I();
1061
1110
  }, b = () => {
1062
- p(d), R = t.deltaDecorations(R, []);
1063
- }, d = () => {
1064
- const a = t.getModel();
1065
- a && (R = t.deltaDecorations(
1111
+ m(I), R = n.deltaDecorations(R, []);
1112
+ }, I = () => {
1113
+ const a = n.getModel();
1114
+ a && (R = n.deltaDecorations(
1066
1115
  R,
1067
- i.map(F(a))
1116
+ i.map(W(a))
1068
1117
  ));
1069
- }, F = (a) => (g) => {
1070
- const k = a.getPositionAt(g[0]), L = a.getPositionAt(g[1]);
1118
+ }, W = (a) => (g) => {
1119
+ const F = a.getPositionAt(g[0]), L = a.getPositionAt(g[1]);
1071
1120
  return {
1072
1121
  range: new l.Range(
1073
- k.lineNumber,
1074
- k.column,
1122
+ F.lineNumber,
1123
+ F.column,
1075
1124
  L.lineNumber,
1076
1125
  L.column
1077
1126
  ),
@@ -1086,22 +1135,22 @@ function Kt(t, e) {
1086
1135
  },
1087
1136
  exclude: r,
1088
1137
  attach: s,
1089
- detach: p,
1138
+ detach: m,
1090
1139
  dispose: x,
1091
1140
  show: y,
1092
1141
  hide: b
1093
1142
  };
1094
1143
  }
1095
- function Bt(t, e, n) {
1144
+ function Pt(n, e, t) {
1096
1145
  let i = !1;
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;
1146
+ const o = (b) => b[1] < b[0] ? (i = !0, [[b[1], b[0]]]) : [[...b]], r = (b) => i ? b.map((I) => I[1] > I[0] ? m(I) : I).reverse() : b;
1098
1147
  let s;
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];
1102
- for (C of e)
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)
1148
+ const m = (b) => (s = b[1], b[1] = b[0], b[0] = s, b), d = o(n);
1149
+ let h, f, A, p, x, R, S, y;
1150
+ A = d[0];
1151
+ for (f of e)
1152
+ for (S = f[0], y = f[1], p = 0; p < d.length; p++) {
1153
+ if (A = d[p], x = A[0], R = A[1], x < S)
1105
1154
  R < S ? h = [A] : R <= y ? h = [[x, S - 1]] : h = [
1106
1155
  [x, S - 1],
1107
1156
  [y + 1, R]
@@ -1109,30 +1158,30 @@ function Bt(t, e, n) {
1109
1158
  else if (x <= y)
1110
1159
  if (S === Number.NEGATIVE_INFINITY) {
1111
1160
  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]];
1161
+ h = t === 0 ? [] : [[b, R > b ? R : b]];
1162
+ } else y === Number.POSITIVE_INFINITY ? h = t === 0 ? [] : [[S - 1, S - 1]] : R <= y ? h = t < 0 ? [[S - 1, S - 1]] : t > 0 ? [[y + 1, y + 1]] : [] : h = [[y + 1, R]];
1114
1163
  else
1115
1164
  h = [A];
1116
- if (m.splice(f, 1, ...h), m.length === 1 && m[0][1] < S) return r(m);
1165
+ if (d.splice(p, 1, ...h), d.length === 1 && d[0][1] < S) return r(d);
1117
1166
  }
1118
- return r(m);
1167
+ return r(d);
1119
1168
  }
1120
- function Tt(t, e) {
1121
- if (t.length < 2) return t;
1122
- const n = [];
1169
+ function Vt(n, e) {
1170
+ if (n.length < 2) return n;
1171
+ const t = [];
1123
1172
  let i = null, o, r;
1124
- t = t.map(
1173
+ n = n.map(
1125
1174
  (s) => (s[1] < s[0] && (o = s[1], s[1] = s[0], s[1] = o), s)
1126
- ).sort((s, p) => s[0] - p[0]), n.push(t[0]);
1127
- for (let s = 1; s < t.length; s++)
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)));
1129
- return n;
1175
+ ).sort((s, m) => s[0] - m[0]), t.push(n[0]);
1176
+ for (let s = 1; s < n.length; s++)
1177
+ i = t[t.length - 1], r = n[s], i[1] === r[0] && !e || (i[1] === r[0] - 1 && e ? (i[1] = r[1], t.splice(t.length - 1, 1, i)) : i[1] < r[0] ? t.push(r) : i[1] < r[1] && (i[1] = r[1], t.splice(t.length - 1, 1, i)));
1178
+ return t;
1130
1179
  }
1131
- function Y(t, e) {
1132
- return e.bind(t);
1180
+ function Y(n, e) {
1181
+ return e.bind(n);
1133
1182
  }
1134
- class Ot {
1135
- constructor(e, n) {
1183
+ class Yt {
1184
+ constructor(e, t) {
1136
1185
  var i;
1137
1186
  this.disposables = [], this.prefer = 1, this.lastPrefer = 1, this.onCursor = Y(
1138
1187
  this,
@@ -1156,21 +1205,21 @@ class Ot {
1156
1205
  this.prefer = 1;
1157
1206
  return;
1158
1207
  }
1159
- const p = this.getSelections(), m = this.intervals.buffer;
1208
+ const m = this.getSelections(), d = this.intervals.buffer;
1160
1209
  let h;
1161
1210
  if (r === s.Delete)
1162
- h = (C) => C[0] === C[1] && m.find((A) => C[1] + 1 === A[0]) != null;
1211
+ h = (f) => f[0] === f[1] && d.find((A) => f[1] + 1 === A[0]) != null;
1163
1212
  else if (r === s.Backspace)
1164
- h = (C) => C[0] === C[1] && m.find((A) => A[1] + 1 === C[0]) != null;
1213
+ h = (f) => f[0] === f[1] && d.find((A) => A[1] + 1 === f[0]) != null;
1165
1214
  else
1166
1215
  return;
1167
- p.findIndex(h) !== -1 && (o.stopPropagation(), o.preventDefault());
1216
+ m.findIndex(h) !== -1 && (o.stopPropagation(), o.preventDefault());
1168
1217
  }), this.getOffsetAt = Y(this, function(o) {
1169
1218
  let r;
1170
1219
  for (let s = 0; s < this.intervals.buffer.length; s++)
1171
1220
  if (r = this.intervals.buffer[s], o <= r[1])
1172
1221
  return r[0] - o < o - r[1] ? r[0] : r[1];
1173
- }), this.editor = e, this.intervals = Kt(e, n), (i = this.editor.getModel()) == null || i.setEOL(l.editor.EndOfLineSequence.LF);
1222
+ }), this.editor = e, this.intervals = Mt(e, t), (i = this.editor.getModel()) == null || i.setEOL(l.editor.EndOfLineSequence.LF);
1174
1223
  }
1175
1224
  enable() {
1176
1225
  this.disposables.push(
@@ -1183,13 +1232,13 @@ class Ot {
1183
1232
  for (const e of this.disposables) e.dispose();
1184
1233
  this.disposables.splice(0);
1185
1234
  }
1186
- exclude(e, n, i, o) {
1187
- arguments.length === 1 ? this.intervals.exclude(e, 0, e, Number.MAX_SAFE_INTEGER) : this.intervals.exclude(e, n, i, o);
1235
+ exclude(e, t, i, o) {
1236
+ arguments.length === 1 ? this.intervals.exclude(e, 0, e, Number.MAX_SAFE_INTEGER) : this.intervals.exclude(e, t, i, o);
1188
1237
  }
1189
1238
  getApprovedSelections() {
1190
1239
  const e = this.editor.getModel();
1191
1240
  return this.getSelections().map(
1192
- (i) => Bt(
1241
+ (i) => Pt(
1193
1242
  i,
1194
1243
  this.intervals.buffer,
1195
1244
  this.prefer
@@ -1206,80 +1255,80 @@ class Ot {
1206
1255
  }
1207
1256
  getSelections() {
1208
1257
  const e = this.editor.getModel();
1209
- return (this.editor.getSelections() || []).map((n) => [
1258
+ return (this.editor.getSelections() || []).map((t) => [
1210
1259
  e.getOffsetAt({
1211
- lineNumber: n.selectionStartLineNumber,
1212
- column: n.selectionStartColumn
1260
+ lineNumber: t.selectionStartLineNumber,
1261
+ column: t.selectionStartColumn
1213
1262
  }),
1214
1263
  e.getOffsetAt({
1215
- lineNumber: n.positionLineNumber,
1216
- column: n.positionColumn
1264
+ lineNumber: t.positionLineNumber,
1265
+ column: t.positionColumn
1217
1266
  })
1218
1267
  ]);
1219
1268
  }
1220
1269
  }
1221
- const Dt = new RegExp("^[ s]+(exposed|Function)", "i"), Gt = ({
1222
- lineNumber: t,
1270
+ const Ht = new RegExp("^[ s]+(exposed|Function)", "i"), _t = ({
1271
+ lineNumber: n,
1223
1272
  editor: e,
1224
- type: n,
1273
+ type: t,
1225
1274
  source: i
1226
1275
  }) => {
1227
1276
  var h;
1228
- const o = n === ie.METHOD || n === ie.DEBUGGER && ((h = i == null ? void 0 : i.codeDescriptorInfo) == null ? void 0 : h.type) === xe.METHOD;
1229
- if (t === 1)
1277
+ const o = t === ie.METHOD || t === ie.DEBUGGER && ((h = i == null ? void 0 : i.codeDescriptorInfo) == null ? void 0 : h.type) === We.METHOD;
1278
+ if (n === 1)
1230
1279
  return o ? "" : "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;
1233
- for (let C = 1; C < s.length; C++)
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: [
1280
+ const r = e == null ? void 0 : e.getModel(), s = (r == null ? void 0 : r.getLinesContent()) || [], m = Array(s.length).fill("-");
1281
+ let d = o ? 0 : 1;
1282
+ for (let f = 1; f < s.length; f++)
1283
+ (f === 1 ? "" : s[f - 1]).endsWith("\\") || (d += 1, m[f] = d.toString());
1284
+ return m[n - 1];
1285
+ }, le = () => /* @__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__ */ _("div", { className: "space-y-2", children: [
1237
1286
  /* @__PURE__ */ w("div", { className: "h-3 w-3/4 rounded bg-grey-200" }),
1238
1287
  /* @__PURE__ */ w("div", { className: "h-3 rounded bg-grey-200" }),
1239
1288
  /* @__PURE__ */ w("div", { className: "h-3 w-5/6 rounded bg-grey-200" }),
1240
1289
  /* @__PURE__ */ w("div", { className: "h-3 rounded bg-grey-200" }),
1241
1290
  /* @__PURE__ */ w("div", { className: "h-3 rounded bg-grey-200" })
1242
- ] }) }) }), ne = ["fd-dark"], kn = ({
1243
- path: t,
1291
+ ] }) }) }), ne = ["fd-dark"], Tn = ({
1292
+ path: n,
1244
1293
  initialValue: e,
1245
- type: n,
1294
+ type: t,
1246
1295
  language: i,
1247
1296
  onChange: o,
1248
1297
  options: r = {},
1249
1298
  extra: s = {},
1250
- lspProps: p,
1251
- theme: m = ne[0],
1299
+ lspProps: m,
1300
+ theme: d = ne[0],
1252
1301
  ...h
1253
1302
  }) => {
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({
1303
+ const { initialLineInfo: f, initialSelectionInfo: A } = s, { editor: p, setEditor: x } = jt(), { inited: R } = m;
1304
+ function S(I) {
1305
+ i === "css" && I.languages.registerCompletionItemProvider("css", Xt), i === "json" && I.languages.json && I.languages.json.jsonDefaults.setDiagnosticsOptions({
1257
1306
  validate: !0,
1258
1307
  schemas: [
1259
1308
  {
1260
1309
  uri: "condition-schema.json",
1261
1310
  fileMatch: ["*.condition.json"],
1262
- schema: Wt
1311
+ schema: Bt
1263
1312
  },
1264
1313
  {
1265
1314
  uri: "handlers-schema.json",
1266
- fileMatch: [ke],
1267
- schema: jt
1315
+ fileMatch: [Ze],
1316
+ schema: Ot
1268
1317
  }
1269
1318
  ]
1270
1319
  });
1271
1320
  }
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;
1321
+ function y(I, W) {
1322
+ x(I);
1323
+ const a = I.getModel();
1324
+ if (a && (a.updateOptions({ insertSpaces: !1 }), I.onKeyUp(() => {
1325
+ var F;
1326
+ const g = (F = I.getPosition()) == null ? void 0 : F.lineNumber;
1278
1327
  if (g) {
1279
1328
  const L = a.getLineFirstNonWhitespaceColumn(g), T = a.getLineLength(g), v = a.getLineContent(g);
1280
- Dt.test(v) && d.executeEdits("edit-handler", [
1329
+ Ht.test(v) && I.executeEdits("edit-handler", [
1281
1330
  {
1282
- range: new F.Range(
1331
+ range: new W.Range(
1283
1332
  g,
1284
1333
  0,
1285
1334
  g,
@@ -1292,126 +1341,126 @@ const Dt = new RegExp("^[ s]+(exposed|Function)", "i"), Gt = ({
1292
1341
  }
1293
1342
  ]);
1294
1343
  }
1295
- })), n === ie.METHOD && ge(e)) {
1296
- const g = new Ot(d, !0);
1344
+ })), t === ie.METHOD && ue(e)) {
1345
+ const g = new Yt(I, !0);
1297
1346
  g.exclude(1, 1, 1, Number.POSITIVE_INFINITY), g.enable();
1298
1347
  }
1299
1348
  }
1300
1349
  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];
1350
+ if (!p) return;
1351
+ const { line: I, offset: W } = f || {};
1352
+ I && Nt(p, I, W);
1353
+ }, [f, p]), M(() => {
1354
+ if (!p) return;
1355
+ const { selection: I } = A || {};
1356
+ I && yt(p, I);
1357
+ }, [A, p]);
1358
+ const b = (I) => ne.includes(I) ? I : ne[0];
1310
1359
  return R ? /* @__PURE__ */ w(
1311
- Re,
1360
+ xe,
1312
1361
  {
1313
1362
  options: {
1314
1363
  readOnly: !0,
1315
1364
  fontSize: 12,
1316
1365
  "semanticHighlighting.enabled": !0,
1317
1366
  padding: { top: 10 },
1318
- lineNumbers: i === "4d" ? (d) => Gt({
1319
- lineNumber: d,
1320
- editor: f,
1321
- type: n,
1367
+ lineNumbers: i === "4d" ? (I) => _t({
1368
+ lineNumber: I,
1369
+ editor: p,
1370
+ type: t,
1322
1371
  source: s == null ? void 0 : s.source
1323
1372
  }) : void 0,
1324
1373
  scrollBeyondLastLine: !1,
1325
1374
  ...r
1326
1375
  },
1327
- path: j(t),
1376
+ path: j(n),
1328
1377
  value: e,
1329
- theme: b(m),
1330
- onChange: (d) => o && o(d || ""),
1378
+ theme: b(d),
1379
+ onChange: (I) => o && o(I || ""),
1331
1380
  language: i,
1332
1381
  beforeMount: S,
1333
1382
  onMount: y,
1334
- loading: /* @__PURE__ */ w(re, {}),
1383
+ loading: /* @__PURE__ */ w(le, {}),
1335
1384
  ...h
1336
1385
  }
1337
- ) : /* @__PURE__ */ w("div", { className: "relative flex-1 w-full", children: /* @__PURE__ */ w(re, {}) });
1386
+ ) : /* @__PURE__ */ w("div", { className: "relative flex-1 w-full", children: /* @__PURE__ */ w(le, {}) });
1338
1387
  };
1339
- var fe = {
1388
+ var Ae = {
1340
1389
  color: void 0,
1341
1390
  size: void 0,
1342
1391
  className: void 0,
1343
1392
  style: void 0,
1344
1393
  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]);
1394
+ }, ae = D.createContext && D.createContext(Ae), B = function() {
1395
+ return B = Object.assign || function(n) {
1396
+ for (var e, t = 1, i = arguments.length; t < i; t++) {
1397
+ e = arguments[t];
1398
+ for (var o in e) Object.prototype.hasOwnProperty.call(e, o) && (n[o] = e[o]);
1350
1399
  }
1351
- return t;
1400
+ return n;
1352
1401
  }, 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;
1402
+ }, zt = function(n, e) {
1403
+ var t = {};
1404
+ for (var i in n) Object.prototype.hasOwnProperty.call(n, i) && e.indexOf(i) < 0 && (t[i] = n[i]);
1405
+ if (n != null && typeof Object.getOwnPropertySymbols == "function") for (var o = 0, i = Object.getOwnPropertySymbols(n); o < i.length; o++)
1406
+ e.indexOf(i[o]) < 0 && Object.prototype.propertyIsEnumerable.call(n, i[o]) && (t[i[o]] = n[i[o]]);
1407
+ return t;
1359
1408
  };
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));
1409
+ function be(n) {
1410
+ return n && n.map(function(e, t) {
1411
+ return D.createElement(e.tag, B({
1412
+ key: t
1413
+ }, e.attr), be(e.child));
1365
1414
  });
1366
1415
  }
1367
- function Ae(t) {
1416
+ function he(n) {
1368
1417
  return function(e) {
1369
- return O.createElement(Mt, B({
1370
- attr: B({}, t.attr)
1371
- }, e), pe(t.child));
1418
+ return D.createElement($t, B({
1419
+ attr: B({}, n.attr)
1420
+ }, e), be(n.child));
1372
1421
  };
1373
1422
  }
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({
1423
+ function $t(n) {
1424
+ var e = function(t) {
1425
+ var i = n.attr, o = n.size, r = n.title, s = zt(n, ["attr", "size", "title"]), m = o || t.size || "1em", d;
1426
+ return t.className && (d = t.className), n.className && (d = (d ? d + " " : "") + n.className), D.createElement("svg", B({
1378
1427
  stroke: "currentColor",
1379
1428
  fill: "currentColor",
1380
1429
  strokeWidth: "0"
1381
- }, n.attr, i, s, {
1382
- className: m,
1430
+ }, t.attr, i, s, {
1431
+ className: d,
1383
1432
  style: B(B({
1384
- color: t.color || n.color
1385
- }, n.style), t.style),
1386
- height: p,
1387
- width: p,
1433
+ color: n.color || t.color
1434
+ }, t.style), n.style),
1435
+ height: m,
1436
+ width: m,
1388
1437
  xmlns: "http://www.w3.org/2000/svg"
1389
- }), r && O.createElement("title", null, r), t.children);
1438
+ }), r && D.createElement("title", null, r), n.children);
1390
1439
  };
1391
- return se !== void 0 ? O.createElement(se.Consumer, null, function(n) {
1392
- return e(n);
1393
- }) : e(fe);
1440
+ return ae !== void 0 ? D.createElement(ae.Consumer, null, function(t) {
1441
+ return e(t);
1442
+ }) : e(Ae);
1394
1443
  }
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);
1444
+ function Ut(n) {
1445
+ return he({ 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" } }] })(n);
1397
1446
  }
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);
1447
+ function qt(n) {
1448
+ return he({ 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" } }] })(n);
1400
1449
  }
1401
- const Ln = ({
1402
- lspProps: { lastError: t, reload: e }
1450
+ const Dn = ({
1451
+ lspProps: { lastError: n, reload: e }
1403
1452
  }) => {
1404
- const [n, i] = $(!1), o = () => {
1453
+ const [t, i] = z(!1), o = () => {
1405
1454
  e();
1406
1455
  }, r = () => {
1407
1456
  i(!1);
1408
1457
  };
1409
1458
  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: [
1459
+ i(!!n);
1460
+ }, [n]), t ? /* @__PURE__ */ _("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: [
1461
+ /* @__PURE__ */ _("span", { className: "flex flex-1 justify-center gap-1", children: [
1462
+ /* @__PURE__ */ w(qt, { className: "h-4 w-4 text-yellow-600" }),
1463
+ /* @__PURE__ */ _("span", { children: [
1415
1464
  "LSP not loaded.",
1416
1465
  " ",
1417
1466
  /* @__PURE__ */ w(
@@ -1425,14 +1474,14 @@ const Ln = ({
1425
1474
  ] })
1426
1475
  ] }),
1427
1476
  /* @__PURE__ */ w("button", { className: "focus:outline-none", children: /* @__PURE__ */ w(
1428
- Pt,
1477
+ Ut,
1429
1478
  {
1430
1479
  className: "h-4 w-4 text-white",
1431
1480
  onClick: r
1432
1481
  }
1433
1482
  ) })
1434
1483
  ] }) : null;
1435
- }, Yt = {
1484
+ }, Qt = {
1436
1485
  name: "4d",
1437
1486
  displayName: "%displayName%",
1438
1487
  description: "%description%",
@@ -1457,7 +1506,7 @@ const Ln = ({
1457
1506
  }
1458
1507
  ]
1459
1508
  }
1460
- }, { registerFileUrl: q, whenReady: Wn } = lt(Yt, void 0, {
1509
+ }, { registerFileUrl: q, whenReady: On } = It(Qt, void 0, {
1461
1510
  system: !0
1462
1511
  });
1463
1512
  q(
@@ -1481,20 +1530,20 @@ q(
1481
1530
  { mimeType: "application/json", size: 135 }
1482
1531
  );
1483
1532
  export {
1484
- Ln as Alerts,
1485
- kn as CodeEditor,
1486
- xn as CodeEditorProvider,
1487
- Gt as FdLineNumbers,
1488
- Rn as LSPProvider,
1533
+ Dn as Alerts,
1534
+ Tn as CodeEditor,
1535
+ Bn as CodeEditorProvider,
1536
+ _t as FdLineNumbers,
1537
+ En as LSPProvider,
1489
1538
  ne as SUPPORTED_THEMES,
1490
- ue as _await,
1491
- It as configureServices,
1539
+ Ie as _await,
1540
+ ht as configureServices,
1492
1541
  j as getFileSystemPath,
1493
- Nn as getFunctionOffset,
1494
- dt as initMonacoUserConfiguration,
1495
- pt as jumpToLine,
1496
- ft as jumpToSelection,
1497
- wt as useCodeEditor,
1498
- wn as useLSP
1542
+ Xn as getFunctionOffset,
1543
+ bt as initMonacoUserConfiguration,
1544
+ Nt as jumpToLine,
1545
+ yt as jumpToSelection,
1546
+ jt as useCodeEditor,
1547
+ Kn as useLSP
1499
1548
  };
1500
1549
  //# sourceMappingURL=index.es.js.map