@wso2/am-core-ui 0.0.18 → 0.0.20

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 (48) hide show
  1. package/dist/APIKeysManager-C0phJriD.js +241 -0
  2. package/dist/CatalogKindListing-DvUuZEpc.js +137 -0
  3. package/dist/CodeBlock-B2Ecl916.js +21736 -0
  4. package/dist/EnvironmentCard-CIXhDhlZ.js +319 -0
  5. package/dist/EnvironmentSelector-D8S6nO9u.js +48 -0
  6. package/dist/IsolationTierIndicator-cf90kgjL.js +81 -0
  7. package/dist/LabelChips-7rA7_yre.js +139 -0
  8. package/dist/MCPLogo-D9IJzzl7.js +30 -0
  9. package/dist/PolicyListSection-D6aVSKwP.js +1143 -0
  10. package/dist/ResourceListShell-DFisKftq.js +463 -0
  11. package/dist/SwaggerSpecViewer-DzjR6U6W.js +106 -0
  12. package/dist/clipboard-YAzStmkw.js +23 -0
  13. package/dist/debounce-D17ObVdG.js +208 -0
  14. package/dist/format-wlHhWjGo.js +29 -0
  15. package/dist/formatDistanceToNow-DyjnT7l9.js +100 -0
  16. package/dist/gatewayScripts-D4ZDEDPS.js +72 -0
  17. package/dist/highlight-BsUzxSR3.js +454 -0
  18. package/dist/{index-CnXsN5I3.js → index-3K-zqdp-.js} +34 -33
  19. package/dist/index-6liAPSDn.js +1564 -0
  20. package/dist/index-B3ASENUJ.js +1290 -0
  21. package/dist/index-B7Pf4oPq.js +3069 -0
  22. package/dist/index-BNO3FhZK.js +2304 -0
  23. package/dist/index-BUZSfCl5.js +335 -0
  24. package/dist/index-BXiG1r_o.js +1409 -0
  25. package/dist/index-BYy7Iaam.js +459 -0
  26. package/dist/index-BbB_yx4V.js +1397 -0
  27. package/dist/index-BjWJ95lH.js +2728 -0
  28. package/dist/index-ByEInFlf.js +26408 -0
  29. package/dist/index-C8WIhzyz.js +123 -0
  30. package/dist/index-CnzvaT6b.js +2368 -0
  31. package/dist/index-CrnCf-hJ.js +763 -0
  32. package/dist/index-Cvsho9xg.js +2346 -0
  33. package/dist/index-CxnAo1_c.js +119 -0
  34. package/dist/{index-DYV1jEai.js → index-Cz7-AZwE.js} +22 -20
  35. package/dist/index-DBdRFjxm.js +1264 -0
  36. package/dist/index-DFsSvmMZ.js +7981 -0
  37. package/dist/index-DslzOSGN.js +2549 -0
  38. package/dist/index-DvpYvchM.js +2341 -0
  39. package/dist/index-PWsNvJB-.js +546 -0
  40. package/dist/index.d.ts +1398 -481
  41. package/dist/index.js +539 -438
  42. package/dist/js-yaml-CvhD-clg.js +1335 -0
  43. package/dist/llmProviderPayload-BPzWDy7n.js +332 -0
  44. package/dist/schemas-DFScWdSL.js +2969 -0
  45. package/package.json +1 -1
  46. package/dist/index-B47EJCom.js +0 -236
  47. package/dist/index-Bl1Y7Sro.js +0 -3037
  48. package/dist/index-DlS9Lybj.js +0 -80691
@@ -0,0 +1,546 @@
1
+ import T, { memo as ne, useState as U, useRef as g, useCallback as re, useEffect as j } from "react";
2
+ function ae(e, t) {
3
+ (t == null || t > e.length) && (t = e.length);
4
+ for (var r = 0, n = Array(t); r < t; r++) n[r] = e[r];
5
+ return n;
6
+ }
7
+ function Oe(e) {
8
+ if (Array.isArray(e)) return e;
9
+ }
10
+ function je(e, t, r) {
11
+ return (t = Ce(t)) in e ? Object.defineProperty(e, t, {
12
+ value: r,
13
+ enumerable: !0,
14
+ configurable: !0,
15
+ writable: !0
16
+ }) : e[t] = r, e;
17
+ }
18
+ function Me(e, t) {
19
+ var r = e == null ? null : typeof Symbol < "u" && e[Symbol.iterator] || e["@@iterator"];
20
+ if (r != null) {
21
+ var n, o, i, u, l = [], s = !0, d = !1;
22
+ try {
23
+ if (i = (r = r.call(e)).next, t !== 0) for (; !(s = (n = i.call(r)).done) && (l.push(n.value), l.length !== t); s = !0) ;
24
+ } catch (M) {
25
+ d = !0, o = M;
26
+ } finally {
27
+ try {
28
+ if (!s && r.return != null && (u = r.return(), Object(u) !== u)) return;
29
+ } finally {
30
+ if (d) throw o;
31
+ }
32
+ }
33
+ return l;
34
+ }
35
+ }
36
+ function Pe() {
37
+ throw new TypeError(`Invalid attempt to destructure non-iterable instance.
38
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`);
39
+ }
40
+ function ue(e, t) {
41
+ var r = Object.keys(e);
42
+ if (Object.getOwnPropertySymbols) {
43
+ var n = Object.getOwnPropertySymbols(e);
44
+ t && (n = n.filter(function(o) {
45
+ return Object.getOwnPropertyDescriptor(e, o).enumerable;
46
+ })), r.push.apply(r, n);
47
+ }
48
+ return r;
49
+ }
50
+ function ce(e) {
51
+ for (var t = 1; t < arguments.length; t++) {
52
+ var r = arguments[t] != null ? arguments[t] : {};
53
+ t % 2 ? ue(Object(r), !0).forEach(function(n) {
54
+ je(e, n, r[n]);
55
+ }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(r)) : ue(Object(r)).forEach(function(n) {
56
+ Object.defineProperty(e, n, Object.getOwnPropertyDescriptor(r, n));
57
+ });
58
+ }
59
+ return e;
60
+ }
61
+ function Se(e, t) {
62
+ if (e == null) return {};
63
+ var r, n, o = Ee(e, t);
64
+ if (Object.getOwnPropertySymbols) {
65
+ var i = Object.getOwnPropertySymbols(e);
66
+ for (n = 0; n < i.length; n++) r = i[n], t.indexOf(r) === -1 && {}.propertyIsEnumerable.call(e, r) && (o[r] = e[r]);
67
+ }
68
+ return o;
69
+ }
70
+ function Ee(e, t) {
71
+ if (e == null) return {};
72
+ var r = {};
73
+ for (var n in e) if ({}.hasOwnProperty.call(e, n)) {
74
+ if (t.indexOf(n) !== -1) continue;
75
+ r[n] = e[n];
76
+ }
77
+ return r;
78
+ }
79
+ function Ie(e, t) {
80
+ return Oe(e) || Me(e, t) || Le(e, t) || Pe();
81
+ }
82
+ function Te(e, t) {
83
+ if (typeof e != "object" || !e) return e;
84
+ var r = e[Symbol.toPrimitive];
85
+ if (r !== void 0) {
86
+ var n = r.call(e, t);
87
+ if (typeof n != "object") return n;
88
+ throw new TypeError("@@toPrimitive must return a primitive value.");
89
+ }
90
+ return (t === "string" ? String : Number)(e);
91
+ }
92
+ function Ce(e) {
93
+ var t = Te(e, "string");
94
+ return typeof t == "symbol" ? t : t + "";
95
+ }
96
+ function Le(e, t) {
97
+ if (e) {
98
+ if (typeof e == "string") return ae(e, t);
99
+ var r = {}.toString.call(e).slice(8, -1);
100
+ return r === "Object" && e.constructor && (r = e.constructor.name), r === "Map" || r === "Set" ? Array.from(e) : r === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r) ? ae(e, t) : void 0;
101
+ }
102
+ }
103
+ function Ae(e, t, r) {
104
+ return t in e ? Object.defineProperty(e, t, {
105
+ value: r,
106
+ enumerable: !0,
107
+ configurable: !0,
108
+ writable: !0
109
+ }) : e[t] = r, e;
110
+ }
111
+ function le(e, t) {
112
+ var r = Object.keys(e);
113
+ if (Object.getOwnPropertySymbols) {
114
+ var n = Object.getOwnPropertySymbols(e);
115
+ t && (n = n.filter(function(o) {
116
+ return Object.getOwnPropertyDescriptor(e, o).enumerable;
117
+ })), r.push.apply(r, n);
118
+ }
119
+ return r;
120
+ }
121
+ function se(e) {
122
+ for (var t = 1; t < arguments.length; t++) {
123
+ var r = arguments[t] != null ? arguments[t] : {};
124
+ t % 2 ? le(Object(r), !0).forEach(function(n) {
125
+ Ae(e, n, r[n]);
126
+ }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(r)) : le(Object(r)).forEach(function(n) {
127
+ Object.defineProperty(e, n, Object.getOwnPropertyDescriptor(r, n));
128
+ });
129
+ }
130
+ return e;
131
+ }
132
+ function $e() {
133
+ for (var e = arguments.length, t = new Array(e), r = 0; r < e; r++)
134
+ t[r] = arguments[r];
135
+ return function(n) {
136
+ return t.reduceRight(function(o, i) {
137
+ return i(o);
138
+ }, n);
139
+ };
140
+ }
141
+ function D(e) {
142
+ return function t() {
143
+ for (var r = this, n = arguments.length, o = new Array(n), i = 0; i < n; i++)
144
+ o[i] = arguments[i];
145
+ return o.length >= e.length ? e.apply(this, o) : function() {
146
+ for (var u = arguments.length, l = new Array(u), s = 0; s < u; s++)
147
+ l[s] = arguments[s];
148
+ return t.apply(r, [].concat(o, l));
149
+ };
150
+ };
151
+ }
152
+ function H(e) {
153
+ return {}.toString.call(e).includes("Object");
154
+ }
155
+ function De(e) {
156
+ return !Object.keys(e).length;
157
+ }
158
+ function V(e) {
159
+ return typeof e == "function";
160
+ }
161
+ function Re(e, t) {
162
+ return Object.prototype.hasOwnProperty.call(e, t);
163
+ }
164
+ function Ve(e, t) {
165
+ return H(t) || S("changeType"), Object.keys(t).some(function(r) {
166
+ return !Re(e, r);
167
+ }) && S("changeField"), t;
168
+ }
169
+ function xe(e) {
170
+ V(e) || S("selectorType");
171
+ }
172
+ function Ne(e) {
173
+ V(e) || H(e) || S("handlerType"), H(e) && Object.values(e).some(function(t) {
174
+ return !V(t);
175
+ }) && S("handlersType");
176
+ }
177
+ function qe(e) {
178
+ e || S("initialIsRequired"), H(e) || S("initialType"), De(e) && S("initialContent");
179
+ }
180
+ function ze(e, t) {
181
+ throw new Error(e[t] || e.default);
182
+ }
183
+ var Fe = {
184
+ initialIsRequired: "initial state is required",
185
+ initialType: "initial state should be an object",
186
+ initialContent: "initial state shouldn't be an empty object",
187
+ handlerType: "handler should be an object or a function",
188
+ handlersType: "all handlers should be a functions",
189
+ selectorType: "selector should be a function",
190
+ changeType: "provided value of changes should be an object",
191
+ changeField: 'it seams you want to change a field in the state which is not specified in the "initial" state',
192
+ default: "an unknown error accured in `state-local` package"
193
+ }, S = D(ze)(Fe), z = {
194
+ changes: Ve,
195
+ selector: xe,
196
+ handler: Ne,
197
+ initial: qe
198
+ };
199
+ function Ue(e) {
200
+ var t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
201
+ z.initial(e), z.handler(t);
202
+ var r = {
203
+ current: e
204
+ }, n = D(_e)(r, t), o = D(We)(r), i = D(z.changes)(e), u = D(He)(r);
205
+ function l() {
206
+ var d = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : function(M) {
207
+ return M;
208
+ };
209
+ return z.selector(d), d(r.current);
210
+ }
211
+ function s(d) {
212
+ $e(n, o, i, u)(d);
213
+ }
214
+ return [l, s];
215
+ }
216
+ function He(e, t) {
217
+ return V(t) ? t(e.current) : t;
218
+ }
219
+ function We(e, t) {
220
+ return e.current = se(se({}, e.current), t), t;
221
+ }
222
+ function _e(e, t, r) {
223
+ return V(t) ? t(e.current) : Object.keys(r).forEach(function(n) {
224
+ var o;
225
+ return (o = t[n]) === null || o === void 0 ? void 0 : o.call(t, e.current[n]);
226
+ }), r;
227
+ }
228
+ var Be = {
229
+ create: Ue
230
+ }, Ke = {
231
+ paths: {
232
+ vs: "https://cdn.jsdelivr.net/npm/monaco-editor@0.55.1/min/vs"
233
+ }
234
+ };
235
+ function Ge(e) {
236
+ return function t() {
237
+ for (var r = this, n = arguments.length, o = new Array(n), i = 0; i < n; i++)
238
+ o[i] = arguments[i];
239
+ return o.length >= e.length ? e.apply(this, o) : function() {
240
+ for (var u = arguments.length, l = new Array(u), s = 0; s < u; s++)
241
+ l[s] = arguments[s];
242
+ return t.apply(r, [].concat(o, l));
243
+ };
244
+ };
245
+ }
246
+ function Ye(e) {
247
+ return {}.toString.call(e).includes("Object");
248
+ }
249
+ function Je(e) {
250
+ return e || fe("configIsRequired"), Ye(e) || fe("configType"), e.urls ? (Qe(), {
251
+ paths: {
252
+ vs: e.urls.monacoBase
253
+ }
254
+ }) : e;
255
+ }
256
+ function Qe() {
257
+ console.warn(de.deprecation);
258
+ }
259
+ function Xe(e, t) {
260
+ throw new Error(e[t] || e.default);
261
+ }
262
+ var de = {
263
+ configIsRequired: "the configuration object is required",
264
+ configType: "the configuration object should be an object",
265
+ default: "an unknown error accured in `@monaco-editor/loader` package",
266
+ deprecation: `Deprecation warning!
267
+ You are using deprecated way of configuration.
268
+
269
+ Instead of using
270
+ monaco.config({ urls: { monacoBase: '...' } })
271
+ use
272
+ monaco.config({ paths: { vs: '...' } })
273
+
274
+ For more please check the link https://github.com/suren-atoyan/monaco-loader#config
275
+ `
276
+ }, fe = Ge(Xe)(de), Ze = {
277
+ config: Je
278
+ }, ke = function() {
279
+ for (var t = arguments.length, r = new Array(t), n = 0; n < t; n++)
280
+ r[n] = arguments[n];
281
+ return function(o) {
282
+ return r.reduceRight(function(i, u) {
283
+ return u(i);
284
+ }, o);
285
+ };
286
+ };
287
+ function pe(e, t) {
288
+ return Object.keys(t).forEach(function(r) {
289
+ t[r] instanceof Object && e[r] && Object.assign(t[r], pe(e[r], t[r]));
290
+ }), ce(ce({}, e), t);
291
+ }
292
+ var et = {
293
+ type: "cancelation",
294
+ msg: "operation is manually canceled"
295
+ };
296
+ function k(e) {
297
+ var t = !1, r = new Promise(function(n, o) {
298
+ e.then(function(i) {
299
+ return t ? o(et) : n(i);
300
+ }), e.catch(o);
301
+ });
302
+ return r.cancel = function() {
303
+ return t = !0;
304
+ }, r;
305
+ }
306
+ var tt = ["monaco"], rt = Be.create({
307
+ config: Ke,
308
+ isInitialized: !1,
309
+ resolve: null,
310
+ reject: null,
311
+ monaco: null
312
+ }), ge = Ie(rt, 2), x = ge[0], W = ge[1];
313
+ function nt(e) {
314
+ var t = Ze.config(e), r = t.monaco, n = Se(t, tt);
315
+ W(function(o) {
316
+ return {
317
+ config: pe(o.config, n),
318
+ monaco: r
319
+ };
320
+ });
321
+ }
322
+ function ot() {
323
+ var e = x(function(t) {
324
+ var r = t.monaco, n = t.isInitialized, o = t.resolve;
325
+ return {
326
+ monaco: r,
327
+ isInitialized: n,
328
+ resolve: o
329
+ };
330
+ });
331
+ if (!e.isInitialized) {
332
+ if (W({
333
+ isInitialized: !0
334
+ }), e.monaco)
335
+ return e.resolve(e.monaco), k(ee);
336
+ if (window.monaco && window.monaco.editor)
337
+ return he(window.monaco), e.resolve(window.monaco), k(ee);
338
+ ke(it, ut)(ct);
339
+ }
340
+ return k(ee);
341
+ }
342
+ function it(e) {
343
+ return document.body.appendChild(e);
344
+ }
345
+ function at(e) {
346
+ var t = document.createElement("script");
347
+ return e && (t.src = e), t;
348
+ }
349
+ function ut(e) {
350
+ var t = x(function(n) {
351
+ var o = n.config, i = n.reject;
352
+ return {
353
+ config: o,
354
+ reject: i
355
+ };
356
+ }), r = at("".concat(t.config.paths.vs, "/loader.js"));
357
+ return r.onload = function() {
358
+ return e();
359
+ }, r.onerror = t.reject, r;
360
+ }
361
+ function ct() {
362
+ var e = x(function(r) {
363
+ var n = r.config, o = r.resolve, i = r.reject;
364
+ return {
365
+ config: n,
366
+ resolve: o,
367
+ reject: i
368
+ };
369
+ }), t = window.require;
370
+ t.config(e.config), t(["vs/editor/editor.main"], function(r) {
371
+ var n = r.m || r;
372
+ he(n), e.resolve(n);
373
+ }, function(r) {
374
+ e.reject(r);
375
+ });
376
+ }
377
+ function he(e) {
378
+ x().monaco || W({
379
+ monaco: e
380
+ });
381
+ }
382
+ function lt() {
383
+ return x(function(e) {
384
+ var t = e.monaco;
385
+ return t;
386
+ });
387
+ }
388
+ var ee = new Promise(function(e, t) {
389
+ return W({
390
+ resolve: e,
391
+ reject: t
392
+ });
393
+ }), ve = {
394
+ config: nt,
395
+ init: ot,
396
+ __getMonacoInstance: lt
397
+ }, st = { wrapper: { display: "flex", position: "relative", textAlign: "initial" }, fullWidth: { width: "100%" }, hide: { display: "none" } }, te = st, ft = { container: { display: "flex", height: "100%", width: "100%", justifyContent: "center", alignItems: "center" } }, dt = ft;
398
+ function pt({ children: e }) {
399
+ return T.createElement("div", { style: dt.container }, e);
400
+ }
401
+ var gt = pt, ht = gt;
402
+ function vt({ width: e, height: t, isEditorReady: r, loading: n, _ref: o, className: i, wrapperProps: u }) {
403
+ return T.createElement("section", { style: { ...te.wrapper, width: e, height: t }, ...u }, !r && T.createElement(ht, null, n), T.createElement("div", { ref: o, style: { ...te.fullWidth, ...!r && te.hide }, className: i }));
404
+ }
405
+ var mt = vt, me = ne(mt);
406
+ function bt(e) {
407
+ j(e, []);
408
+ }
409
+ var be = bt;
410
+ function yt(e, t, r = !0) {
411
+ let n = g(!0);
412
+ j(n.current || !r ? () => {
413
+ n.current = !1;
414
+ } : e, t);
415
+ }
416
+ var w = yt;
417
+ function R() {
418
+ }
419
+ function I(e, t, r, n) {
420
+ return wt(e, n) || Ot(e, t, r, n);
421
+ }
422
+ function wt(e, t) {
423
+ return e.editor.getModel(ye(e, t));
424
+ }
425
+ function Ot(e, t, r, n) {
426
+ return e.editor.createModel(t, r, n ? ye(e, n) : void 0);
427
+ }
428
+ function ye(e, t) {
429
+ return e.Uri.parse(t);
430
+ }
431
+ function jt({ original: e, modified: t, language: r, originalLanguage: n, modifiedLanguage: o, originalModelPath: i, modifiedModelPath: u, keepCurrentOriginalModel: l = !1, keepCurrentModifiedModel: s = !1, theme: d = "light", loading: M = "Loading...", options: O = {}, height: _ = "100%", width: B = "100%", className: K, wrapperProps: G = {}, beforeMount: Y = R, onMount: J = R }) {
432
+ let [y, C] = U(!1), [L, p] = U(!0), h = g(null), f = g(null), A = g(null), m = g(J), a = g(Y), E = g(!1);
433
+ be(() => {
434
+ let c = ve.init();
435
+ return c.then((v) => (f.current = v) && p(!1)).catch((v) => v?.type !== "cancelation" && console.error("Monaco initialization: error:", v)), () => h.current ? $() : c.cancel();
436
+ }), w(() => {
437
+ if (h.current && f.current) {
438
+ let c = h.current.getOriginalEditor(), v = I(f.current, e || "", n || r || "text", i || "");
439
+ v !== c.getModel() && c.setModel(v);
440
+ }
441
+ }, [i], y), w(() => {
442
+ if (h.current && f.current) {
443
+ let c = h.current.getModifiedEditor(), v = I(f.current, t || "", o || r || "text", u || "");
444
+ v !== c.getModel() && c.setModel(v);
445
+ }
446
+ }, [u], y), w(() => {
447
+ let c = h.current.getModifiedEditor();
448
+ c.getOption(f.current.editor.EditorOption.readOnly) ? c.setValue(t || "") : t !== c.getValue() && (c.executeEdits("", [{ range: c.getModel().getFullModelRange(), text: t || "", forceMoveMarkers: !0 }]), c.pushUndoStop());
449
+ }, [t], y), w(() => {
450
+ h.current?.getModel()?.original.setValue(e || "");
451
+ }, [e], y), w(() => {
452
+ let { original: c, modified: v } = h.current.getModel();
453
+ f.current.editor.setModelLanguage(c, n || r || "text"), f.current.editor.setModelLanguage(v, o || r || "text");
454
+ }, [r, n, o], y), w(() => {
455
+ f.current?.editor.setTheme(d);
456
+ }, [d], y), w(() => {
457
+ h.current?.updateOptions(O);
458
+ }, [O], y);
459
+ let N = re(() => {
460
+ if (!f.current) return;
461
+ a.current(f.current);
462
+ let c = I(f.current, e || "", n || r || "text", i || ""), v = I(f.current, t || "", o || r || "text", u || "");
463
+ h.current?.setModel({ original: c, modified: v });
464
+ }, [r, t, o, e, n, i, u]), q = re(() => {
465
+ !E.current && A.current && (h.current = f.current.editor.createDiffEditor(A.current, { automaticLayout: !0, ...O }), N(), f.current?.editor.setTheme(d), C(!0), E.current = !0);
466
+ }, [O, d, N]);
467
+ j(() => {
468
+ y && m.current(h.current, f.current);
469
+ }, [y]), j(() => {
470
+ !L && !y && q();
471
+ }, [L, y, q]);
472
+ function $() {
473
+ let c = h.current?.getModel();
474
+ l || c?.original?.dispose(), s || c?.modified?.dispose(), h.current?.dispose();
475
+ }
476
+ return T.createElement(me, { width: B, height: _, isEditorReady: y, loading: M, _ref: A, className: K, wrapperProps: G });
477
+ }
478
+ var Mt = jt;
479
+ ne(Mt);
480
+ function Pt(e) {
481
+ let t = g();
482
+ return j(() => {
483
+ t.current = e;
484
+ }, [e]), t.current;
485
+ }
486
+ var St = Pt, F = /* @__PURE__ */ new Map();
487
+ function Et({ defaultValue: e, defaultLanguage: t, defaultPath: r, value: n, language: o, path: i, theme: u = "light", line: l, loading: s = "Loading...", options: d = {}, overrideServices: M = {}, saveViewState: O = !0, keepCurrentModel: _ = !1, width: B = "100%", height: K = "100%", className: G, wrapperProps: Y = {}, beforeMount: J = R, onMount: y = R, onChange: C, onValidate: L = R }) {
488
+ let [p, h] = U(!1), [f, A] = U(!0), m = g(null), a = g(null), E = g(null), N = g(y), q = g(J), $ = g(), c = g(n), v = St(i), oe = g(!1), Q = g(!1);
489
+ be(() => {
490
+ let b = ve.init();
491
+ return b.then((P) => (m.current = P) && A(!1)).catch((P) => P?.type !== "cancelation" && console.error("Monaco initialization: error:", P)), () => a.current ? we() : b.cancel();
492
+ }), w(() => {
493
+ let b = I(m.current, e || n || "", t || o || "", i || r || "");
494
+ b !== a.current?.getModel() && (O && F.set(v, a.current?.saveViewState()), a.current?.setModel(b), O && a.current?.restoreViewState(F.get(i)));
495
+ }, [i], p), w(() => {
496
+ a.current?.updateOptions(d);
497
+ }, [d], p), w(() => {
498
+ !a.current || n === void 0 || (a.current.getOption(m.current.editor.EditorOption.readOnly) ? a.current.setValue(n) : n !== a.current.getValue() && (Q.current = !0, a.current.executeEdits("", [{ range: a.current.getModel().getFullModelRange(), text: n, forceMoveMarkers: !0 }]), a.current.pushUndoStop(), Q.current = !1));
499
+ }, [n], p), w(() => {
500
+ let b = a.current?.getModel();
501
+ b && o && m.current?.editor.setModelLanguage(b, o);
502
+ }, [o], p), w(() => {
503
+ l !== void 0 && a.current?.revealLine(l);
504
+ }, [l], p), w(() => {
505
+ m.current?.editor.setTheme(u);
506
+ }, [u], p);
507
+ let ie = re(() => {
508
+ if (!(!E.current || !m.current) && !oe.current) {
509
+ q.current(m.current);
510
+ let b = i || r, P = I(m.current, n || e || "", t || o || "", b || "");
511
+ a.current = m.current?.editor.create(E.current, { model: P, automaticLayout: !0, ...d }, M), O && a.current.restoreViewState(F.get(b)), m.current.editor.setTheme(u), l !== void 0 && a.current.revealLine(l), h(!0), oe.current = !0;
512
+ }
513
+ }, [e, t, r, n, o, i, d, M, O, u, l]);
514
+ j(() => {
515
+ p && N.current(a.current, m.current);
516
+ }, [p]), j(() => {
517
+ !f && !p && ie();
518
+ }, [f, p, ie]), c.current = n, j(() => {
519
+ p && C && ($.current?.dispose(), $.current = a.current?.onDidChangeModelContent((b) => {
520
+ Q.current || C(a.current.getValue(), b);
521
+ }));
522
+ }, [p, C]), j(() => {
523
+ if (p) {
524
+ let b = m.current.editor.onDidChangeMarkers((P) => {
525
+ let X = a.current.getModel()?.uri;
526
+ if (X && P.find((Z) => Z.path === X.path)) {
527
+ let Z = m.current.editor.getModelMarkers({ resource: X });
528
+ L?.(Z);
529
+ }
530
+ });
531
+ return () => {
532
+ b?.dispose();
533
+ };
534
+ }
535
+ return () => {
536
+ };
537
+ }, [p, L]);
538
+ function we() {
539
+ $.current?.dispose(), _ ? O && F.set(i, a.current.saveViewState()) : a.current.getModel()?.dispose(), a.current.dispose();
540
+ }
541
+ return T.createElement(me, { width: B, height: K, isEditorReady: p, loading: s, _ref: E, className: G, wrapperProps: Y });
542
+ }
543
+ var It = Et, Tt = ne(It), Lt = Tt;
544
+ export {
545
+ Lt as F
546
+ };