@nuraly/runtime 0.1.3 → 0.1.5

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.
Files changed (49) hide show
  1. package/components/ui/nuraly-ui/packages/common/dist/shared/controllers/dropdown.controller.d.ts +0 -1
  2. package/components/ui/nuraly-ui/packages/common/dist/shared/controllers/dropdown.interface.d.ts +0 -2
  3. package/components/ui/nuraly-ui/packages/common/dist/shared/controllers/theme.controller.d.ts +0 -1
  4. package/components/ui/nuraly-ui/packages/common/dist/shared/event-handler-mixin.d.ts +0 -1
  5. package/components/ui/nuraly-ui/packages/common/dist/shared/theme-mixin.d.ts +0 -1
  6. package/components/ui/nuraly-ui/packages/common/dist/shared/themes.d.ts +0 -1
  7. package/components/ui/nuraly-ui/packages/common/dist/shared/utils.d.ts +60 -0
  8. package/components/ui/nuraly-ui/packages/common/dist/shared/validation.types.d.ts +108 -0
  9. package/components/ui/nuraly-ui/src/components/radio-group/radio-group.component.ts +1 -1
  10. package/components/ui/nuraly-ui/src/components/radio-group/radio-group.types.ts +1 -0
  11. package/dist/CodeEditor-BiNku87K.js +808 -0
  12. package/dist/{CodeEditor-Ch2tv9BE.js → CodeEditor-G6E8PUI7.js} +14593 -14607
  13. package/dist/{SmartAttributeHandler-hoSLpm1Y.js → SmartAttributeHandler-C9vS-cHW.js} +1 -1
  14. package/dist/SmartAttributeHandler-u-ZHGueR.js +193 -0
  15. package/dist/assets/editor.worker-C_S4Avdt.js +11 -0
  16. package/dist/assets/{html.worker-BSmGlhXp.js → html.worker-DfuQASUV.js} +18 -18
  17. package/dist/assets/json.worker-Cucz4wxY.js +42 -0
  18. package/dist/assets/{ts.worker-DyHHPhrh.js → ts.worker-Dme6S0YK.js} +78 -78
  19. package/dist/cssMode-B7NVlrDV.js +1443 -0
  20. package/dist/{freemarker2-DNc2IxPf.js → freemarker2-DS_7G9b8.js} +1 -1
  21. package/dist/{handlebars-CIbFckEw.js → handlebars-BDyyLkzw.js} +1 -1
  22. package/dist/{html-nRs_fneU.js → html-DphGFjig.js} +1 -1
  23. package/dist/{htmlMode-BjehA1YF.js → htmlMode-4zNnSWFo.js} +278 -281
  24. package/dist/index-B4yIOSMd.js +3847 -0
  25. package/dist/{javascript-Bn0HduZA.js → javascript-CC1jWyQy.js} +1 -1
  26. package/dist/{jsonMode-CfGfcJRX.js → jsonMode-Bfzb6wZf.js} +369 -372
  27. package/dist/{liquid-m4D_LCnC.js → liquid-lTBpqagR.js} +1 -1
  28. package/dist/{mdx-CakMRbCr.js → mdx-DX66Bp07.js} +1 -1
  29. package/dist/{micro-app-entry-CI1Rupdh.js → micro-app-entry-DDsAWUJh.js} +5138 -5322
  30. package/dist/micro-app.bundle.js +1 -1
  31. package/dist/micro-app.js +9775 -0
  32. package/dist/{python-oJwaiPUY.js → python-BGUhyO4G.js} +1 -1
  33. package/dist/{razor-u_dd4rqc.js → razor-DEVWQFSa.js} +1 -1
  34. package/dist/runtime.js +401 -0
  35. package/dist/style.css +1 -1
  36. package/dist/tsMode-CYFi80Jf.js +800 -0
  37. package/dist/{typescript-Bjs2N5Be.js → typescript-B1xIbH_T.js} +1 -1
  38. package/dist/{wgsl-Bv2xeo60.js → wgsl-C9yjop46.js} +1 -1
  39. package/dist/{xml-BCveATLl.js → xml-DmdvyqrE.js} +1 -1
  40. package/dist/{yaml-BfWQPJQi.js → yaml-LGNo48fy.js} +1 -1
  41. package/package.json +2 -2
  42. package/utils/register-components.ts +1 -1
  43. package/vite.config.ts +8 -8
  44. package/dist/.claude/settings.local.json +0 -9
  45. package/dist/assets/editor.worker-vBWydyGC.js +0 -11
  46. package/dist/assets/json.worker-Dqnoedz4.js +0 -42
  47. package/dist/cssMode-Bt2uK8XM.js +0 -1446
  48. package/dist/micro-app.bundle.umd.cjs +0 -5051
  49. package/dist/tsMode-DlZ38d3D.js +0 -813
@@ -0,0 +1,800 @@
1
+ import { t as O, m as I } from "./CodeEditor-G6E8PUI7.js";
2
+ /*!-----------------------------------------------------------------------------
3
+ * Copyright (c) Microsoft Corporation. All rights reserved.
4
+ * Version: 0.45.0(5e5af013f8d295555a7210df0d5f2cea0bf5dd56)
5
+ * Released under the MIT license
6
+ * https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt
7
+ *-----------------------------------------------------------------------------*/
8
+ var A = Object.defineProperty, N = Object.getOwnPropertyDescriptor, M = Object.getOwnPropertyNames, R = Object.prototype.hasOwnProperty, K = (e, t, s) => t in e ? A(e, t, { enumerable: !0, configurable: !0, writable: !0, value: s }) : e[t] = s, E = (e, t, s, o) => {
9
+ if (t && typeof t == "object" || typeof t == "function")
10
+ for (let i of M(t))
11
+ !R.call(e, i) && i !== s && A(e, i, { get: () => t[i], enumerable: !(o = N(t, i)) || o.enumerable });
12
+ return e;
13
+ }, H = (e, t, s) => (E(e, t, "default"), s), f = (e, t, s) => (K(e, typeof t != "symbol" ? t + "" : t, s), s), a = {};
14
+ H(a, I);
15
+ var V = class {
16
+ constructor(e, t) {
17
+ this._modeId = e, this._defaults = t, this._worker = null, this._client = null, this._configChangeListener = this._defaults.onDidChange(() => this._stopWorker()), this._updateExtraLibsToken = 0, this._extraLibsChangeListener = this._defaults.onDidExtraLibsChange(() => this._updateExtraLibs());
18
+ }
19
+ _configChangeListener;
20
+ _updateExtraLibsToken;
21
+ _extraLibsChangeListener;
22
+ _worker;
23
+ _client;
24
+ dispose() {
25
+ this._configChangeListener.dispose(), this._extraLibsChangeListener.dispose(), this._stopWorker();
26
+ }
27
+ _stopWorker() {
28
+ this._worker && (this._worker.dispose(), this._worker = null), this._client = null;
29
+ }
30
+ async _updateExtraLibs() {
31
+ if (!this._worker)
32
+ return;
33
+ const e = ++this._updateExtraLibsToken, t = await this._worker.getProxy();
34
+ this._updateExtraLibsToken === e && t.updateExtraLibs(this._defaults.getExtraLibs());
35
+ }
36
+ _getClient() {
37
+ return this._client || (this._client = (async () => (this._worker = a.editor.createWebWorker({
38
+ moduleId: "vs/language/typescript/tsWorker",
39
+ label: this._modeId,
40
+ keepIdleModels: !0,
41
+ createData: {
42
+ compilerOptions: this._defaults.getCompilerOptions(),
43
+ extraLibs: this._defaults.getExtraLibs(),
44
+ customWorkerPath: this._defaults.workerOptions.customWorkerPath,
45
+ inlayHintsOptions: this._defaults.inlayHintsOptions
46
+ }
47
+ }), this._defaults.getEagerModelSync() ? await this._worker.withSyncedResources(a.editor.getModels().filter((e) => e.getLanguageId() === this._modeId).map((e) => e.uri)) : await this._worker.getProxy()))()), this._client;
48
+ }
49
+ async getLanguageServiceWorker(...e) {
50
+ const t = await this._getClient();
51
+ return this._worker && await this._worker.withSyncedResources(e), t;
52
+ }
53
+ }, n = {};
54
+ n["lib.d.ts"] = !0;
55
+ n["lib.decorators.d.ts"] = !0;
56
+ n["lib.decorators.legacy.d.ts"] = !0;
57
+ n["lib.dom.d.ts"] = !0;
58
+ n["lib.dom.iterable.d.ts"] = !0;
59
+ n["lib.es2015.collection.d.ts"] = !0;
60
+ n["lib.es2015.core.d.ts"] = !0;
61
+ n["lib.es2015.d.ts"] = !0;
62
+ n["lib.es2015.generator.d.ts"] = !0;
63
+ n["lib.es2015.iterable.d.ts"] = !0;
64
+ n["lib.es2015.promise.d.ts"] = !0;
65
+ n["lib.es2015.proxy.d.ts"] = !0;
66
+ n["lib.es2015.reflect.d.ts"] = !0;
67
+ n["lib.es2015.symbol.d.ts"] = !0;
68
+ n["lib.es2015.symbol.wellknown.d.ts"] = !0;
69
+ n["lib.es2016.array.include.d.ts"] = !0;
70
+ n["lib.es2016.d.ts"] = !0;
71
+ n["lib.es2016.full.d.ts"] = !0;
72
+ n["lib.es2017.d.ts"] = !0;
73
+ n["lib.es2017.full.d.ts"] = !0;
74
+ n["lib.es2017.intl.d.ts"] = !0;
75
+ n["lib.es2017.object.d.ts"] = !0;
76
+ n["lib.es2017.sharedmemory.d.ts"] = !0;
77
+ n["lib.es2017.string.d.ts"] = !0;
78
+ n["lib.es2017.typedarrays.d.ts"] = !0;
79
+ n["lib.es2018.asyncgenerator.d.ts"] = !0;
80
+ n["lib.es2018.asynciterable.d.ts"] = !0;
81
+ n["lib.es2018.d.ts"] = !0;
82
+ n["lib.es2018.full.d.ts"] = !0;
83
+ n["lib.es2018.intl.d.ts"] = !0;
84
+ n["lib.es2018.promise.d.ts"] = !0;
85
+ n["lib.es2018.regexp.d.ts"] = !0;
86
+ n["lib.es2019.array.d.ts"] = !0;
87
+ n["lib.es2019.d.ts"] = !0;
88
+ n["lib.es2019.full.d.ts"] = !0;
89
+ n["lib.es2019.intl.d.ts"] = !0;
90
+ n["lib.es2019.object.d.ts"] = !0;
91
+ n["lib.es2019.string.d.ts"] = !0;
92
+ n["lib.es2019.symbol.d.ts"] = !0;
93
+ n["lib.es2020.bigint.d.ts"] = !0;
94
+ n["lib.es2020.d.ts"] = !0;
95
+ n["lib.es2020.date.d.ts"] = !0;
96
+ n["lib.es2020.full.d.ts"] = !0;
97
+ n["lib.es2020.intl.d.ts"] = !0;
98
+ n["lib.es2020.number.d.ts"] = !0;
99
+ n["lib.es2020.promise.d.ts"] = !0;
100
+ n["lib.es2020.sharedmemory.d.ts"] = !0;
101
+ n["lib.es2020.string.d.ts"] = !0;
102
+ n["lib.es2020.symbol.wellknown.d.ts"] = !0;
103
+ n["lib.es2021.d.ts"] = !0;
104
+ n["lib.es2021.full.d.ts"] = !0;
105
+ n["lib.es2021.intl.d.ts"] = !0;
106
+ n["lib.es2021.promise.d.ts"] = !0;
107
+ n["lib.es2021.string.d.ts"] = !0;
108
+ n["lib.es2021.weakref.d.ts"] = !0;
109
+ n["lib.es2022.array.d.ts"] = !0;
110
+ n["lib.es2022.d.ts"] = !0;
111
+ n["lib.es2022.error.d.ts"] = !0;
112
+ n["lib.es2022.full.d.ts"] = !0;
113
+ n["lib.es2022.intl.d.ts"] = !0;
114
+ n["lib.es2022.object.d.ts"] = !0;
115
+ n["lib.es2022.regexp.d.ts"] = !0;
116
+ n["lib.es2022.sharedmemory.d.ts"] = !0;
117
+ n["lib.es2022.string.d.ts"] = !0;
118
+ n["lib.es2023.array.d.ts"] = !0;
119
+ n["lib.es2023.d.ts"] = !0;
120
+ n["lib.es2023.full.d.ts"] = !0;
121
+ n["lib.es5.d.ts"] = !0;
122
+ n["lib.es6.d.ts"] = !0;
123
+ n["lib.esnext.d.ts"] = !0;
124
+ n["lib.esnext.full.d.ts"] = !0;
125
+ n["lib.esnext.intl.d.ts"] = !0;
126
+ n["lib.scripthost.d.ts"] = !0;
127
+ n["lib.webworker.d.ts"] = !0;
128
+ n["lib.webworker.importscripts.d.ts"] = !0;
129
+ n["lib.webworker.iterable.d.ts"] = !0;
130
+ function C(e, t, s = 0) {
131
+ if (typeof e == "string")
132
+ return e;
133
+ if (e === void 0)
134
+ return "";
135
+ let o = "";
136
+ if (s) {
137
+ o += t;
138
+ for (let i = 0; i < s; i++)
139
+ o += " ";
140
+ }
141
+ if (o += e.messageText, s++, e.next)
142
+ for (const i of e.next)
143
+ o += C(i, t, s);
144
+ return o;
145
+ }
146
+ function w(e) {
147
+ return e ? e.map((t) => t.text).join("") : "";
148
+ }
149
+ var _ = class {
150
+ constructor(e) {
151
+ this._worker = e;
152
+ }
153
+ _textSpanToRange(e, t) {
154
+ let s = e.getPositionAt(t.start), o = e.getPositionAt(t.start + t.length), { lineNumber: i, column: u } = s, { lineNumber: c, column: r } = o;
155
+ return { startLineNumber: i, startColumn: u, endLineNumber: c, endColumn: r };
156
+ }
157
+ }, W = class {
158
+ constructor(e) {
159
+ this._worker = e, this._libFiles = {}, this._hasFetchedLibFiles = !1, this._fetchLibFilesPromise = null;
160
+ }
161
+ _libFiles;
162
+ _hasFetchedLibFiles;
163
+ _fetchLibFilesPromise;
164
+ isLibFile(e) {
165
+ return e && e.path.indexOf("/lib.") === 0 ? !!n[e.path.slice(1)] : !1;
166
+ }
167
+ getOrCreateModel(e) {
168
+ const t = a.Uri.parse(e), s = a.editor.getModel(t);
169
+ if (s)
170
+ return s;
171
+ if (this.isLibFile(t) && this._hasFetchedLibFiles)
172
+ return a.editor.createModel(this._libFiles[t.path.slice(1)], "typescript", t);
173
+ const o = O.getExtraLibs()[e];
174
+ return o ? a.editor.createModel(o.content, "typescript", t) : null;
175
+ }
176
+ _containsLibFile(e) {
177
+ for (let t of e)
178
+ if (this.isLibFile(t))
179
+ return !0;
180
+ return !1;
181
+ }
182
+ async fetchLibFilesIfNecessary(e) {
183
+ this._containsLibFile(e) && await this._fetchLibFiles();
184
+ }
185
+ _fetchLibFiles() {
186
+ return this._fetchLibFilesPromise || (this._fetchLibFilesPromise = this._worker().then((e) => e.getLibFiles()).then((e) => {
187
+ this._hasFetchedLibFiles = !0, this._libFiles = e;
188
+ })), this._fetchLibFilesPromise;
189
+ }
190
+ }, j = class extends _ {
191
+ constructor(e, t, s, o) {
192
+ super(o), this._libFiles = e, this._defaults = t, this._selector = s;
193
+ const i = (r) => {
194
+ if (r.getLanguageId() !== s)
195
+ return;
196
+ const g = () => {
197
+ const { onlyVisible: h } = this._defaults.getDiagnosticsOptions();
198
+ h ? r.isAttachedToEditor() && this._doValidate(r) : this._doValidate(r);
199
+ };
200
+ let d;
201
+ const p = r.onDidChangeContent(() => {
202
+ clearTimeout(d), d = window.setTimeout(g, 500);
203
+ }), b = r.onDidChangeAttached(() => {
204
+ const { onlyVisible: h } = this._defaults.getDiagnosticsOptions();
205
+ h && (r.isAttachedToEditor() ? g() : a.editor.setModelMarkers(r, this._selector, []));
206
+ });
207
+ this._listener[r.uri.toString()] = {
208
+ dispose() {
209
+ p.dispose(), b.dispose(), clearTimeout(d);
210
+ }
211
+ }, g();
212
+ }, u = (r) => {
213
+ a.editor.setModelMarkers(r, this._selector, []);
214
+ const g = r.uri.toString();
215
+ this._listener[g] && (this._listener[g].dispose(), delete this._listener[g]);
216
+ };
217
+ this._disposables.push(a.editor.onDidCreateModel((r) => i(r))), this._disposables.push(a.editor.onWillDisposeModel(u)), this._disposables.push(a.editor.onDidChangeModelLanguage((r) => {
218
+ u(r.model), i(r.model);
219
+ })), this._disposables.push({
220
+ dispose() {
221
+ for (const r of a.editor.getModels())
222
+ u(r);
223
+ }
224
+ });
225
+ const c = () => {
226
+ for (const r of a.editor.getModels())
227
+ u(r), i(r);
228
+ };
229
+ this._disposables.push(this._defaults.onDidChange(c)), this._disposables.push(this._defaults.onDidExtraLibsChange(c)), a.editor.getModels().forEach((r) => i(r));
230
+ }
231
+ _disposables = [];
232
+ _listener = /* @__PURE__ */ Object.create(null);
233
+ dispose() {
234
+ this._disposables.forEach((e) => e && e.dispose()), this._disposables = [];
235
+ }
236
+ async _doValidate(e) {
237
+ const t = await this._worker(e.uri);
238
+ if (e.isDisposed())
239
+ return;
240
+ const s = [], { noSyntaxValidation: o, noSemanticValidation: i, noSuggestionDiagnostics: u } = this._defaults.getDiagnosticsOptions();
241
+ o || s.push(t.getSyntacticDiagnostics(e.uri.toString())), i || s.push(t.getSemanticDiagnostics(e.uri.toString())), u || s.push(t.getSuggestionDiagnostics(e.uri.toString()));
242
+ const c = await Promise.all(s);
243
+ if (!c || e.isDisposed())
244
+ return;
245
+ const r = c.reduce((d, p) => p.concat(d), []).filter((d) => (this._defaults.getDiagnosticsOptions().diagnosticCodesToIgnore || []).indexOf(d.code) === -1), g = r.map((d) => d.relatedInformation || []).reduce((d, p) => p.concat(d), []).map((d) => d.file ? a.Uri.parse(d.file.fileName) : null);
246
+ await this._libFiles.fetchLibFilesIfNecessary(g), !e.isDisposed() && a.editor.setModelMarkers(e, this._selector, r.map((d) => this._convertDiagnostics(e, d)));
247
+ }
248
+ _convertDiagnostics(e, t) {
249
+ const s = t.start || 0, o = t.length || 1, { lineNumber: i, column: u } = e.getPositionAt(s), { lineNumber: c, column: r } = e.getPositionAt(s + o), g = [];
250
+ return t.reportsUnnecessary && g.push(a.MarkerTag.Unnecessary), t.reportsDeprecated && g.push(a.MarkerTag.Deprecated), {
251
+ severity: this._tsDiagnosticCategoryToMarkerSeverity(t.category),
252
+ startLineNumber: i,
253
+ startColumn: u,
254
+ endLineNumber: c,
255
+ endColumn: r,
256
+ message: C(t.messageText, `
257
+ `),
258
+ code: t.code.toString(),
259
+ tags: g,
260
+ relatedInformation: this._convertRelatedInformation(e, t.relatedInformation)
261
+ };
262
+ }
263
+ _convertRelatedInformation(e, t) {
264
+ if (!t)
265
+ return [];
266
+ const s = [];
267
+ return t.forEach((o) => {
268
+ let i = e;
269
+ if (o.file && (i = this._libFiles.getOrCreateModel(o.file.fileName)), !i)
270
+ return;
271
+ const u = o.start || 0, c = o.length || 1, { lineNumber: r, column: g } = i.getPositionAt(u), { lineNumber: d, column: p } = i.getPositionAt(u + c);
272
+ s.push({
273
+ resource: i.uri,
274
+ startLineNumber: r,
275
+ startColumn: g,
276
+ endLineNumber: d,
277
+ endColumn: p,
278
+ message: C(o.messageText, `
279
+ `)
280
+ });
281
+ }), s;
282
+ }
283
+ _tsDiagnosticCategoryToMarkerSeverity(e) {
284
+ switch (e) {
285
+ case 1:
286
+ return a.MarkerSeverity.Error;
287
+ case 3:
288
+ return a.MarkerSeverity.Info;
289
+ case 0:
290
+ return a.MarkerSeverity.Warning;
291
+ case 2:
292
+ return a.MarkerSeverity.Hint;
293
+ }
294
+ return a.MarkerSeverity.Info;
295
+ }
296
+ }, x = class extends _ {
297
+ get triggerCharacters() {
298
+ return ["."];
299
+ }
300
+ async provideCompletionItems(e, t, s, o) {
301
+ const i = e.getWordUntilPosition(t), u = new a.Range(t.lineNumber, i.startColumn, t.lineNumber, i.endColumn), c = e.uri, r = e.getOffsetAt(t), g = await this._worker(c);
302
+ if (e.isDisposed())
303
+ return;
304
+ const d = await g.getCompletionsAtPosition(c.toString(), r);
305
+ return !d || e.isDisposed() ? void 0 : {
306
+ suggestions: d.entries.map((b) => {
307
+ let h = u;
308
+ if (b.replacementSpan) {
309
+ const S = e.getPositionAt(b.replacementSpan.start), v = e.getPositionAt(b.replacementSpan.start + b.replacementSpan.length);
310
+ h = new a.Range(S.lineNumber, S.column, v.lineNumber, v.column);
311
+ }
312
+ const y = [];
313
+ return b.kindModifiers !== void 0 && b.kindModifiers.indexOf("deprecated") !== -1 && y.push(a.languages.CompletionItemTag.Deprecated), {
314
+ uri: c,
315
+ position: t,
316
+ offset: r,
317
+ range: h,
318
+ label: b.name,
319
+ insertText: b.name,
320
+ sortText: b.sortText,
321
+ kind: x.convertKind(b.kind),
322
+ tags: y
323
+ };
324
+ })
325
+ };
326
+ }
327
+ async resolveCompletionItem(e, t) {
328
+ const s = e, o = s.uri, i = s.position, u = s.offset, r = await (await this._worker(o)).getCompletionEntryDetails(o.toString(), u, s.label);
329
+ return r ? {
330
+ uri: o,
331
+ position: i,
332
+ label: r.name,
333
+ kind: x.convertKind(r.kind),
334
+ detail: w(r.displayParts),
335
+ documentation: {
336
+ value: x.createDocumentationString(r)
337
+ }
338
+ } : s;
339
+ }
340
+ static convertKind(e) {
341
+ switch (e) {
342
+ case l.primitiveType:
343
+ case l.keyword:
344
+ return a.languages.CompletionItemKind.Keyword;
345
+ case l.variable:
346
+ case l.localVariable:
347
+ return a.languages.CompletionItemKind.Variable;
348
+ case l.memberVariable:
349
+ case l.memberGetAccessor:
350
+ case l.memberSetAccessor:
351
+ return a.languages.CompletionItemKind.Field;
352
+ case l.function:
353
+ case l.memberFunction:
354
+ case l.constructSignature:
355
+ case l.callSignature:
356
+ case l.indexSignature:
357
+ return a.languages.CompletionItemKind.Function;
358
+ case l.enum:
359
+ return a.languages.CompletionItemKind.Enum;
360
+ case l.module:
361
+ return a.languages.CompletionItemKind.Module;
362
+ case l.class:
363
+ return a.languages.CompletionItemKind.Class;
364
+ case l.interface:
365
+ return a.languages.CompletionItemKind.Interface;
366
+ case l.warning:
367
+ return a.languages.CompletionItemKind.File;
368
+ }
369
+ return a.languages.CompletionItemKind.Property;
370
+ }
371
+ static createDocumentationString(e) {
372
+ let t = w(e.documentation);
373
+ if (e.tags)
374
+ for (const s of e.tags)
375
+ t += `
376
+
377
+ ${T(s)}`;
378
+ return t;
379
+ }
380
+ };
381
+ function T(e) {
382
+ let t = `*@${e.name}*`;
383
+ if (e.name === "param" && e.text) {
384
+ const [s, ...o] = e.text;
385
+ t += `\`${s.text}\``, o.length > 0 && (t += ` — ${o.map((i) => i.text).join(" ")}`);
386
+ } else Array.isArray(e.text) ? t += ` — ${e.text.map((s) => s.text).join(" ")}` : e.text && (t += ` — ${e.text}`);
387
+ return t;
388
+ }
389
+ var L = class extends _ {
390
+ signatureHelpTriggerCharacters = ["(", ","];
391
+ static _toSignatureHelpTriggerReason(e) {
392
+ switch (e.triggerKind) {
393
+ case a.languages.SignatureHelpTriggerKind.TriggerCharacter:
394
+ return e.triggerCharacter ? e.isRetrigger ? { kind: "retrigger", triggerCharacter: e.triggerCharacter } : { kind: "characterTyped", triggerCharacter: e.triggerCharacter } : { kind: "invoked" };
395
+ case a.languages.SignatureHelpTriggerKind.ContentChange:
396
+ return e.isRetrigger ? { kind: "retrigger" } : { kind: "invoked" };
397
+ case a.languages.SignatureHelpTriggerKind.Invoke:
398
+ default:
399
+ return { kind: "invoked" };
400
+ }
401
+ }
402
+ async provideSignatureHelp(e, t, s, o) {
403
+ const i = e.uri, u = e.getOffsetAt(t), c = await this._worker(i);
404
+ if (e.isDisposed())
405
+ return;
406
+ const r = await c.getSignatureHelpItems(i.toString(), u, {
407
+ triggerReason: L._toSignatureHelpTriggerReason(o)
408
+ });
409
+ if (!r || e.isDisposed())
410
+ return;
411
+ const g = {
412
+ activeSignature: r.selectedItemIndex,
413
+ activeParameter: r.argumentIndex,
414
+ signatures: []
415
+ };
416
+ return r.items.forEach((d) => {
417
+ const p = {
418
+ label: "",
419
+ parameters: []
420
+ };
421
+ p.documentation = {
422
+ value: w(d.documentation)
423
+ }, p.label += w(d.prefixDisplayParts), d.parameters.forEach((b, h, y) => {
424
+ const S = w(b.displayParts), v = {
425
+ label: S,
426
+ documentation: {
427
+ value: w(b.documentation)
428
+ }
429
+ };
430
+ p.label += S, p.parameters.push(v), h < y.length - 1 && (p.label += w(d.separatorDisplayParts));
431
+ }), p.label += w(d.suffixDisplayParts), g.signatures.push(p);
432
+ }), {
433
+ value: g,
434
+ dispose() {
435
+ }
436
+ };
437
+ }
438
+ }, B = class extends _ {
439
+ async provideHover(e, t, s) {
440
+ const o = e.uri, i = e.getOffsetAt(t), u = await this._worker(o);
441
+ if (e.isDisposed())
442
+ return;
443
+ const c = await u.getQuickInfoAtPosition(o.toString(), i);
444
+ if (!c || e.isDisposed())
445
+ return;
446
+ const r = w(c.documentation), g = c.tags ? c.tags.map((p) => T(p)).join(`
447
+
448
+ `) : "", d = w(c.displayParts);
449
+ return {
450
+ range: this._textSpanToRange(e, c.textSpan),
451
+ contents: [
452
+ {
453
+ value: "```typescript\n" + d + "\n```\n"
454
+ },
455
+ {
456
+ value: r + (g ? `
457
+
458
+ ` + g : "")
459
+ }
460
+ ]
461
+ };
462
+ }
463
+ }, U = class extends _ {
464
+ async provideDocumentHighlights(e, t, s) {
465
+ const o = e.uri, i = e.getOffsetAt(t), u = await this._worker(o);
466
+ if (e.isDisposed())
467
+ return;
468
+ const c = await u.getDocumentHighlights(o.toString(), i, [
469
+ o.toString()
470
+ ]);
471
+ if (!(!c || e.isDisposed()))
472
+ return c.flatMap((r) => r.highlightSpans.map((g) => ({
473
+ range: this._textSpanToRange(e, g.textSpan),
474
+ kind: g.kind === "writtenReference" ? a.languages.DocumentHighlightKind.Write : a.languages.DocumentHighlightKind.Text
475
+ })));
476
+ }
477
+ }, $ = class extends _ {
478
+ constructor(e, t) {
479
+ super(t), this._libFiles = e;
480
+ }
481
+ async provideDefinition(e, t, s) {
482
+ const o = e.uri, i = e.getOffsetAt(t), u = await this._worker(o);
483
+ if (e.isDisposed())
484
+ return;
485
+ const c = await u.getDefinitionAtPosition(o.toString(), i);
486
+ if (!c || e.isDisposed() || (await this._libFiles.fetchLibFilesIfNecessary(c.map((g) => a.Uri.parse(g.fileName))), e.isDisposed()))
487
+ return;
488
+ const r = [];
489
+ for (let g of c) {
490
+ const d = this._libFiles.getOrCreateModel(g.fileName);
491
+ d && r.push({
492
+ uri: d.uri,
493
+ range: this._textSpanToRange(d, g.textSpan)
494
+ });
495
+ }
496
+ return r;
497
+ }
498
+ }, z = class extends _ {
499
+ constructor(e, t) {
500
+ super(t), this._libFiles = e;
501
+ }
502
+ async provideReferences(e, t, s, o) {
503
+ const i = e.uri, u = e.getOffsetAt(t), c = await this._worker(i);
504
+ if (e.isDisposed())
505
+ return;
506
+ const r = await c.getReferencesAtPosition(i.toString(), u);
507
+ if (!r || e.isDisposed() || (await this._libFiles.fetchLibFilesIfNecessary(r.map((d) => a.Uri.parse(d.fileName))), e.isDisposed()))
508
+ return;
509
+ const g = [];
510
+ for (let d of r) {
511
+ const p = this._libFiles.getOrCreateModel(d.fileName);
512
+ p && g.push({
513
+ uri: p.uri,
514
+ range: this._textSpanToRange(p, d.textSpan)
515
+ });
516
+ }
517
+ return g;
518
+ }
519
+ }, G = class extends _ {
520
+ async provideDocumentSymbols(e, t) {
521
+ const s = e.uri, o = await this._worker(s);
522
+ if (e.isDisposed())
523
+ return;
524
+ const i = await o.getNavigationTree(s.toString());
525
+ if (!i || e.isDisposed())
526
+ return;
527
+ const u = (r, g) => ({
528
+ name: r.text,
529
+ detail: "",
530
+ kind: m[r.kind] || a.languages.SymbolKind.Variable,
531
+ range: this._textSpanToRange(e, r.spans[0]),
532
+ selectionRange: this._textSpanToRange(e, r.spans[0]),
533
+ tags: [],
534
+ children: r.childItems?.map((p) => u(p, r.text)),
535
+ containerName: g
536
+ });
537
+ return i.childItems ? i.childItems.map((r) => u(r)) : [];
538
+ }
539
+ }, l = class {
540
+ };
541
+ f(l, "unknown", "");
542
+ f(l, "keyword", "keyword");
543
+ f(l, "script", "script");
544
+ f(l, "module", "module");
545
+ f(l, "class", "class");
546
+ f(l, "interface", "interface");
547
+ f(l, "type", "type");
548
+ f(l, "enum", "enum");
549
+ f(l, "variable", "var");
550
+ f(l, "localVariable", "local var");
551
+ f(l, "function", "function");
552
+ f(l, "localFunction", "local function");
553
+ f(l, "memberFunction", "method");
554
+ f(l, "memberGetAccessor", "getter");
555
+ f(l, "memberSetAccessor", "setter");
556
+ f(l, "memberVariable", "property");
557
+ f(l, "constructorImplementation", "constructor");
558
+ f(l, "callSignature", "call");
559
+ f(l, "indexSignature", "index");
560
+ f(l, "constructSignature", "construct");
561
+ f(l, "parameter", "parameter");
562
+ f(l, "typeParameter", "type parameter");
563
+ f(l, "primitiveType", "primitive type");
564
+ f(l, "label", "label");
565
+ f(l, "alias", "alias");
566
+ f(l, "const", "const");
567
+ f(l, "let", "let");
568
+ f(l, "warning", "warning");
569
+ var m = /* @__PURE__ */ Object.create(null);
570
+ m[l.module] = a.languages.SymbolKind.Module;
571
+ m[l.class] = a.languages.SymbolKind.Class;
572
+ m[l.enum] = a.languages.SymbolKind.Enum;
573
+ m[l.interface] = a.languages.SymbolKind.Interface;
574
+ m[l.memberFunction] = a.languages.SymbolKind.Method;
575
+ m[l.memberVariable] = a.languages.SymbolKind.Property;
576
+ m[l.memberGetAccessor] = a.languages.SymbolKind.Property;
577
+ m[l.memberSetAccessor] = a.languages.SymbolKind.Property;
578
+ m[l.variable] = a.languages.SymbolKind.Variable;
579
+ m[l.const] = a.languages.SymbolKind.Variable;
580
+ m[l.localVariable] = a.languages.SymbolKind.Variable;
581
+ m[l.variable] = a.languages.SymbolKind.Variable;
582
+ m[l.function] = a.languages.SymbolKind.Function;
583
+ m[l.localFunction] = a.languages.SymbolKind.Function;
584
+ var k = class extends _ {
585
+ static _convertOptions(e) {
586
+ return {
587
+ ConvertTabsToSpaces: e.insertSpaces,
588
+ TabSize: e.tabSize,
589
+ IndentSize: e.tabSize,
590
+ IndentStyle: 2,
591
+ NewLineCharacter: `
592
+ `,
593
+ InsertSpaceAfterCommaDelimiter: !0,
594
+ InsertSpaceAfterSemicolonInForStatements: !0,
595
+ InsertSpaceBeforeAndAfterBinaryOperators: !0,
596
+ InsertSpaceAfterKeywordsInControlFlowStatements: !0,
597
+ InsertSpaceAfterFunctionKeywordForAnonymousFunctions: !0,
598
+ InsertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis: !1,
599
+ InsertSpaceAfterOpeningAndBeforeClosingNonemptyBrackets: !1,
600
+ InsertSpaceAfterOpeningAndBeforeClosingTemplateStringBraces: !1,
601
+ PlaceOpenBraceOnNewLineForControlBlocks: !1,
602
+ PlaceOpenBraceOnNewLineForFunctions: !1
603
+ };
604
+ }
605
+ _convertTextChanges(e, t) {
606
+ return {
607
+ text: t.newText,
608
+ range: this._textSpanToRange(e, t.span)
609
+ };
610
+ }
611
+ }, J = class extends k {
612
+ canFormatMultipleRanges = !1;
613
+ async provideDocumentRangeFormattingEdits(e, t, s, o) {
614
+ const i = e.uri, u = e.getOffsetAt({
615
+ lineNumber: t.startLineNumber,
616
+ column: t.startColumn
617
+ }), c = e.getOffsetAt({
618
+ lineNumber: t.endLineNumber,
619
+ column: t.endColumn
620
+ }), r = await this._worker(i);
621
+ if (e.isDisposed())
622
+ return;
623
+ const g = await r.getFormattingEditsForRange(i.toString(), u, c, k._convertOptions(s));
624
+ if (!(!g || e.isDisposed()))
625
+ return g.map((d) => this._convertTextChanges(e, d));
626
+ }
627
+ }, Q = class extends k {
628
+ get autoFormatTriggerCharacters() {
629
+ return [";", "}", `
630
+ `];
631
+ }
632
+ async provideOnTypeFormattingEdits(e, t, s, o, i) {
633
+ const u = e.uri, c = e.getOffsetAt(t), r = await this._worker(u);
634
+ if (e.isDisposed())
635
+ return;
636
+ const g = await r.getFormattingEditsAfterKeystroke(u.toString(), c, s, k._convertOptions(o));
637
+ if (!(!g || e.isDisposed()))
638
+ return g.map((d) => this._convertTextChanges(e, d));
639
+ }
640
+ }, q = class extends k {
641
+ async provideCodeActions(e, t, s, o) {
642
+ const i = e.uri, u = e.getOffsetAt({
643
+ lineNumber: t.startLineNumber,
644
+ column: t.startColumn
645
+ }), c = e.getOffsetAt({
646
+ lineNumber: t.endLineNumber,
647
+ column: t.endColumn
648
+ }), r = k._convertOptions(e.getOptions()), g = s.markers.filter((h) => h.code).map((h) => h.code).map(Number), d = await this._worker(i);
649
+ if (e.isDisposed())
650
+ return;
651
+ const p = await d.getCodeFixesAtPosition(i.toString(), u, c, g, r);
652
+ return !p || e.isDisposed() ? { actions: [], dispose: () => {
653
+ } } : {
654
+ actions: p.filter((h) => h.changes.filter((y) => y.isNewFile).length === 0).map((h) => this._tsCodeFixActionToMonacoCodeAction(e, s, h)),
655
+ dispose: () => {
656
+ }
657
+ };
658
+ }
659
+ _tsCodeFixActionToMonacoCodeAction(e, t, s) {
660
+ const o = [];
661
+ for (const u of s.changes)
662
+ for (const c of u.textChanges)
663
+ o.push({
664
+ resource: e.uri,
665
+ versionId: void 0,
666
+ textEdit: {
667
+ range: this._textSpanToRange(e, c.span),
668
+ text: c.newText
669
+ }
670
+ });
671
+ return {
672
+ title: s.description,
673
+ edit: { edits: o },
674
+ diagnostics: t.markers,
675
+ kind: "quickfix"
676
+ };
677
+ }
678
+ }, X = class extends _ {
679
+ constructor(e, t) {
680
+ super(t), this._libFiles = e;
681
+ }
682
+ async provideRenameEdits(e, t, s, o) {
683
+ const i = e.uri, u = i.toString(), c = e.getOffsetAt(t), r = await this._worker(i);
684
+ if (e.isDisposed())
685
+ return;
686
+ const g = await r.getRenameInfo(u, c, {
687
+ allowRenameOfImportPath: !1
688
+ });
689
+ if (g.canRename === !1)
690
+ return {
691
+ edits: [],
692
+ rejectReason: g.localizedErrorMessage
693
+ };
694
+ if (g.fileToRename !== void 0)
695
+ throw new Error("Renaming files is not supported.");
696
+ const d = await r.findRenameLocations(u, c, !1, !1, !1);
697
+ if (!d || e.isDisposed())
698
+ return;
699
+ const p = [];
700
+ for (const b of d) {
701
+ const h = this._libFiles.getOrCreateModel(b.fileName);
702
+ if (h)
703
+ p.push({
704
+ resource: h.uri,
705
+ versionId: void 0,
706
+ textEdit: {
707
+ range: this._textSpanToRange(h, b.textSpan),
708
+ text: s
709
+ }
710
+ });
711
+ else
712
+ throw new Error(`Unknown file ${b.fileName}.`);
713
+ }
714
+ return { edits: p };
715
+ }
716
+ }, Y = class extends _ {
717
+ async provideInlayHints(e, t, s) {
718
+ const o = e.uri, i = o.toString(), u = e.getOffsetAt({
719
+ lineNumber: t.startLineNumber,
720
+ column: t.startColumn
721
+ }), c = e.getOffsetAt({
722
+ lineNumber: t.endLineNumber,
723
+ column: t.endColumn
724
+ }), r = await this._worker(o);
725
+ return e.isDisposed() ? null : { hints: (await r.provideInlayHints(i, u, c)).map((p) => ({
726
+ ...p,
727
+ label: p.text,
728
+ position: e.getPositionAt(p.position),
729
+ kind: this._convertHintKind(p.kind)
730
+ })), dispose: () => {
731
+ } };
732
+ }
733
+ _convertHintKind(e) {
734
+ switch (e) {
735
+ case "Parameter":
736
+ return a.languages.InlayHintKind.Parameter;
737
+ case "Type":
738
+ return a.languages.InlayHintKind.Type;
739
+ default:
740
+ return a.languages.InlayHintKind.Type;
741
+ }
742
+ }
743
+ }, D, F;
744
+ function te(e) {
745
+ F = P(e, "typescript");
746
+ }
747
+ function re(e) {
748
+ D = P(e, "javascript");
749
+ }
750
+ function se() {
751
+ return new Promise((e, t) => {
752
+ if (!D)
753
+ return t("JavaScript not registered!");
754
+ e(D);
755
+ });
756
+ }
757
+ function ie() {
758
+ return new Promise((e, t) => {
759
+ if (!F)
760
+ return t("TypeScript not registered!");
761
+ e(F);
762
+ });
763
+ }
764
+ function P(e, t) {
765
+ const s = [], o = new V(t, e), i = (...r) => o.getLanguageServiceWorker(...r), u = new W(i);
766
+ function c() {
767
+ const { modeConfiguration: r } = e;
768
+ Z(s), r.completionItems && s.push(a.languages.registerCompletionItemProvider(t, new x(i))), r.signatureHelp && s.push(a.languages.registerSignatureHelpProvider(t, new L(i))), r.hovers && s.push(a.languages.registerHoverProvider(t, new B(i))), r.documentHighlights && s.push(a.languages.registerDocumentHighlightProvider(t, new U(i))), r.definitions && s.push(a.languages.registerDefinitionProvider(t, new $(u, i))), r.references && s.push(a.languages.registerReferenceProvider(t, new z(u, i))), r.documentSymbols && s.push(a.languages.registerDocumentSymbolProvider(t, new G(i))), r.rename && s.push(a.languages.registerRenameProvider(t, new X(u, i))), r.documentRangeFormattingEdits && s.push(a.languages.registerDocumentRangeFormattingEditProvider(t, new J(i))), r.onTypeFormattingEdits && s.push(a.languages.registerOnTypeFormattingEditProvider(t, new Q(i))), r.codeActions && s.push(a.languages.registerCodeActionProvider(t, new q(i))), r.inlayHints && s.push(a.languages.registerInlayHintsProvider(t, new Y(i))), r.diagnostics && s.push(new j(u, e, t, i));
769
+ }
770
+ return c(), i;
771
+ }
772
+ function Z(e) {
773
+ for (; e.length; )
774
+ e.pop().dispose();
775
+ }
776
+ export {
777
+ _ as Adapter,
778
+ q as CodeActionAdaptor,
779
+ $ as DefinitionAdapter,
780
+ j as DiagnosticsAdapter,
781
+ U as DocumentHighlightAdapter,
782
+ J as FormatAdapter,
783
+ k as FormatHelper,
784
+ Q as FormatOnTypeAdapter,
785
+ Y as InlayHintsAdapter,
786
+ l as Kind,
787
+ W as LibFiles,
788
+ G as OutlineAdapter,
789
+ B as QuickInfoAdapter,
790
+ z as ReferenceAdapter,
791
+ X as RenameAdapter,
792
+ L as SignatureHelpAdapter,
793
+ x as SuggestAdapter,
794
+ V as WorkerManager,
795
+ C as flattenDiagnosticMessageText,
796
+ se as getJavaScriptWorker,
797
+ ie as getTypeScriptWorker,
798
+ re as setupJavaScript,
799
+ te as setupTypeScript
800
+ };