@harnessio/yaml-editor 0.18.0 → 0.20.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.js CHANGED
@@ -1,17 +1,17 @@
1
- var Ye = Object.defineProperty;
2
- var Ze = (e, t, r) => t in e ? Ye(e, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[t] = r;
3
- var Se = (e, t, r) => (Ze(e, typeof t != "symbol" ? t + "" : t, r), r);
4
- import W, { memo as ye, useState as A, useRef as y, useCallback as G, useEffect as $, useMemo as q, createContext as Ge, useContext as Je } from "react";
5
- import * as F from "monaco-editor";
6
- import { languages as he, Uri as Qe } from "monaco-editor";
7
- import { yamlDefaults as Xe } from "monaco-yaml";
8
- var Ne = { exports: {} }, ne = {};
1
+ var Ze = Object.defineProperty;
2
+ var Ge = (e, t, r) => t in e ? Ze(e, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[t] = r;
3
+ var je = (e, t, r) => (Ge(e, typeof t != "symbol" ? t + "" : t, r), r);
4
+ import K, { memo as be, useState as V, useRef as w, useCallback as G, useEffect as I, useMemo as q, createContext as Je, useContext as Qe } from "react";
5
+ import * as R from "monaco-editor";
6
+ import { languages as ge, Uri as Xe } from "monaco-editor";
7
+ import { yamlDefaults as ye } from "monaco-yaml";
8
+ var De = { exports: {} }, ne = {};
9
9
  /*
10
10
  object-assign
11
11
  (c) Sindre Sorhus
12
12
  @license MIT
13
13
  */
14
- var Me = Object.getOwnPropertySymbols, et = Object.prototype.hasOwnProperty, tt = Object.prototype.propertyIsEnumerable;
14
+ var Ee = Object.getOwnPropertySymbols, et = Object.prototype.hasOwnProperty, tt = Object.prototype.propertyIsEnumerable;
15
15
  function rt(e) {
16
16
  if (e == null)
17
17
  throw new TypeError("Object.assign cannot be called with null or undefined");
@@ -26,14 +26,14 @@ function nt() {
26
26
  return !1;
27
27
  for (var t = {}, r = 0; r < 10; r++)
28
28
  t["_" + String.fromCharCode(r)] = r;
29
- var n = Object.getOwnPropertyNames(t).map(function(a) {
30
- return t[a];
29
+ var n = Object.getOwnPropertyNames(t).map(function(i) {
30
+ return t[i];
31
31
  });
32
32
  if (n.join("") !== "0123456789")
33
33
  return !1;
34
34
  var o = {};
35
- return "abcdefghijklmnopqrst".split("").forEach(function(a) {
36
- o[a] = a;
35
+ return "abcdefghijklmnopqrst".split("").forEach(function(i) {
36
+ o[i] = i;
37
37
  }), Object.keys(Object.assign({}, o)).join("") === "abcdefghijklmnopqrst";
38
38
  } catch {
39
39
  return !1;
@@ -48,27 +48,27 @@ nt();
48
48
  * This source code is licensed under the MIT license found in the
49
49
  * LICENSE file in the root directory of this source tree.
50
50
  */
51
- var ot = W, De = 60103;
51
+ var ot = K, Ne = 60103;
52
52
  ne.Fragment = 60107;
53
53
  if (typeof Symbol == "function" && Symbol.for) {
54
- var je = Symbol.for;
55
- De = je("react.element"), ne.Fragment = je("react.fragment");
54
+ var Pe = Symbol.for;
55
+ Ne = Pe("react.element"), ne.Fragment = Pe("react.fragment");
56
56
  }
57
- var at = ot.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, it = Object.prototype.hasOwnProperty, ct = { key: !0, ref: !0, __self: !0, __source: !0 };
58
- function Te(e, t, r) {
59
- var n, o = {}, a = null, i = null;
60
- r !== void 0 && (a = "" + r), t.key !== void 0 && (a = "" + t.key), t.ref !== void 0 && (i = t.ref);
57
+ var it = ot.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, at = Object.prototype.hasOwnProperty, ct = { key: !0, ref: !0, __self: !0, __source: !0 };
58
+ function ke(e, t, r) {
59
+ var n, o = {}, i = null, a = null;
60
+ r !== void 0 && (i = "" + r), t.key !== void 0 && (i = "" + t.key), t.ref !== void 0 && (a = t.ref);
61
61
  for (n in t)
62
- it.call(t, n) && !ct.hasOwnProperty(n) && (o[n] = t[n]);
62
+ at.call(t, n) && !ct.hasOwnProperty(n) && (o[n] = t[n]);
63
63
  if (e && e.defaultProps)
64
64
  for (n in t = e.defaultProps, t)
65
65
  o[n] === void 0 && (o[n] = t[n]);
66
- return { $$typeof: De, type: e, key: a, ref: i, props: o, _owner: at.current };
66
+ return { $$typeof: Ne, type: e, key: i, ref: a, props: o, _owner: it.current };
67
67
  }
68
- ne.jsx = Te;
69
- ne.jsxs = Te;
70
- Ne.exports = ne;
71
- var U = Ne.exports;
68
+ ne.jsx = ke;
69
+ ne.jsxs = ke;
70
+ De.exports = ne;
71
+ var F = De.exports;
72
72
  function ut(e, t, r) {
73
73
  return t in e ? Object.defineProperty(e, t, {
74
74
  value: r,
@@ -77,7 +77,7 @@ function ut(e, t, r) {
77
77
  writable: !0
78
78
  }) : e[t] = r, e;
79
79
  }
80
- function Ee(e, t) {
80
+ function xe(e, t) {
81
81
  var r = Object.keys(e);
82
82
  if (Object.getOwnPropertySymbols) {
83
83
  var n = Object.getOwnPropertySymbols(e);
@@ -87,12 +87,12 @@ function Ee(e, t) {
87
87
  }
88
88
  return r;
89
89
  }
90
- function Pe(e) {
90
+ function Ce(e) {
91
91
  for (var t = 1; t < arguments.length; t++) {
92
92
  var r = arguments[t] != null ? arguments[t] : {};
93
- t % 2 ? Ee(Object(r), !0).forEach(function(n) {
93
+ t % 2 ? xe(Object(r), !0).forEach(function(n) {
94
94
  ut(e, n, r[n]);
95
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(r)) : Ee(Object(r)).forEach(function(n) {
95
+ }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(r)) : xe(Object(r)).forEach(function(n) {
96
96
  Object.defineProperty(e, n, Object.getOwnPropertyDescriptor(r, n));
97
97
  });
98
98
  }
@@ -101,9 +101,9 @@ function Pe(e) {
101
101
  function st(e, t) {
102
102
  if (e == null)
103
103
  return {};
104
- var r = {}, n = Object.keys(e), o, a;
105
- for (a = 0; a < n.length; a++)
106
- o = n[a], !(t.indexOf(o) >= 0) && (r[o] = e[o]);
104
+ var r = {}, n = Object.keys(e), o, i;
105
+ for (i = 0; i < n.length; i++)
106
+ o = n[i], !(t.indexOf(o) >= 0) && (r[o] = e[o]);
107
107
  return r;
108
108
  }
109
109
  function lt(e, t) {
@@ -111,14 +111,14 @@ function lt(e, t) {
111
111
  return {};
112
112
  var r = st(e, t), n, o;
113
113
  if (Object.getOwnPropertySymbols) {
114
- var a = Object.getOwnPropertySymbols(e);
115
- for (o = 0; o < a.length; o++)
116
- n = a[o], !(t.indexOf(n) >= 0) && Object.prototype.propertyIsEnumerable.call(e, n) && (r[n] = e[n]);
114
+ var i = Object.getOwnPropertySymbols(e);
115
+ for (o = 0; o < i.length; o++)
116
+ n = i[o], !(t.indexOf(n) >= 0) && Object.prototype.propertyIsEnumerable.call(e, n) && (r[n] = e[n]);
117
117
  }
118
118
  return r;
119
119
  }
120
120
  function dt(e, t) {
121
- return ft(e) || pt(e, t) || gt(e, t) || mt();
121
+ return ft(e) || pt(e, t) || mt(e, t) || ht();
122
122
  }
123
123
  function ft(e) {
124
124
  if (Array.isArray(e))
@@ -126,45 +126,45 @@ function ft(e) {
126
126
  }
127
127
  function pt(e, t) {
128
128
  if (!(typeof Symbol > "u" || !(Symbol.iterator in Object(e)))) {
129
- var r = [], n = !0, o = !1, a = void 0;
129
+ var r = [], n = !0, o = !1, i = void 0;
130
130
  try {
131
- for (var i = e[Symbol.iterator](), s; !(n = (s = i.next()).done) && (r.push(s.value), !(t && r.length === t)); n = !0)
131
+ for (var a = e[Symbol.iterator](), u; !(n = (u = a.next()).done) && (r.push(u.value), !(t && r.length === t)); n = !0)
132
132
  ;
133
133
  } catch (l) {
134
- o = !0, a = l;
134
+ o = !0, i = l;
135
135
  } finally {
136
136
  try {
137
- !n && i.return != null && i.return();
137
+ !n && a.return != null && a.return();
138
138
  } finally {
139
139
  if (o)
140
- throw a;
140
+ throw i;
141
141
  }
142
142
  }
143
143
  return r;
144
144
  }
145
145
  }
146
- function gt(e, t) {
146
+ function mt(e, t) {
147
147
  if (e) {
148
148
  if (typeof e == "string")
149
- return Ce(e, t);
149
+ return $e(e, t);
150
150
  var r = Object.prototype.toString.call(e).slice(8, -1);
151
151
  if (r === "Object" && e.constructor && (r = e.constructor.name), r === "Map" || r === "Set")
152
152
  return Array.from(e);
153
153
  if (r === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))
154
- return Ce(e, t);
154
+ return $e(e, t);
155
155
  }
156
156
  }
157
- function Ce(e, t) {
157
+ function $e(e, t) {
158
158
  (t == null || t > e.length) && (t = e.length);
159
159
  for (var r = 0, n = new Array(t); r < t; r++)
160
160
  n[r] = e[r];
161
161
  return n;
162
162
  }
163
- function mt() {
163
+ function ht() {
164
164
  throw new TypeError(`Invalid attempt to destructure non-iterable instance.
165
165
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`);
166
166
  }
167
- function ht(e, t, r) {
167
+ function gt(e, t, r) {
168
168
  return t in e ? Object.defineProperty(e, t, {
169
169
  value: r,
170
170
  enumerable: !0,
@@ -172,7 +172,7 @@ function ht(e, t, r) {
172
172
  writable: !0
173
173
  }) : e[t] = r, e;
174
174
  }
175
- function xe(e, t) {
175
+ function Ie(e, t) {
176
176
  var r = Object.keys(e);
177
177
  if (Object.getOwnPropertySymbols) {
178
178
  var n = Object.getOwnPropertySymbols(e);
@@ -182,12 +182,12 @@ function xe(e, t) {
182
182
  }
183
183
  return r;
184
184
  }
185
- function $e(e) {
185
+ function Le(e) {
186
186
  for (var t = 1; t < arguments.length; t++) {
187
187
  var r = arguments[t] != null ? arguments[t] : {};
188
- t % 2 ? xe(Object(r), !0).forEach(function(n) {
189
- ht(e, n, r[n]);
190
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(r)) : xe(Object(r)).forEach(function(n) {
188
+ t % 2 ? Ie(Object(r), !0).forEach(function(n) {
189
+ gt(e, n, r[n]);
190
+ }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(r)) : Ie(Object(r)).forEach(function(n) {
191
191
  Object.defineProperty(e, n, Object.getOwnPropertyDescriptor(r, n));
192
192
  });
193
193
  }
@@ -197,49 +197,49 @@ function vt() {
197
197
  for (var e = arguments.length, t = new Array(e), r = 0; r < e; r++)
198
198
  t[r] = arguments[r];
199
199
  return function(n) {
200
- return t.reduceRight(function(o, a) {
201
- return a(o);
200
+ return t.reduceRight(function(o, i) {
201
+ return i(o);
202
202
  }, n);
203
203
  };
204
204
  }
205
205
  function X(e) {
206
206
  return function t() {
207
- for (var r = this, n = arguments.length, o = new Array(n), a = 0; a < n; a++)
208
- o[a] = arguments[a];
207
+ for (var r = this, n = arguments.length, o = new Array(n), i = 0; i < n; i++)
208
+ o[i] = arguments[i];
209
209
  return o.length >= e.length ? e.apply(this, o) : function() {
210
- for (var i = arguments.length, s = new Array(i), l = 0; l < i; l++)
211
- s[l] = arguments[l];
212
- return t.apply(r, [].concat(o, s));
210
+ for (var a = arguments.length, u = new Array(a), l = 0; l < a; l++)
211
+ u[l] = arguments[l];
212
+ return t.apply(r, [].concat(o, u));
213
213
  };
214
214
  };
215
215
  }
216
216
  function ce(e) {
217
217
  return {}.toString.call(e).includes("Object");
218
218
  }
219
- function yt(e) {
219
+ function bt(e) {
220
220
  return !Object.keys(e).length;
221
221
  }
222
222
  function re(e) {
223
223
  return typeof e == "function";
224
224
  }
225
- function bt(e, t) {
225
+ function yt(e, t) {
226
226
  return Object.prototype.hasOwnProperty.call(e, t);
227
227
  }
228
228
  function wt(e, t) {
229
229
  return ce(t) || B("changeType"), Object.keys(t).some(function(r) {
230
- return !bt(e, r);
230
+ return !yt(e, r);
231
231
  }) && B("changeField"), t;
232
232
  }
233
233
  function Ot(e) {
234
234
  re(e) || B("selectorType");
235
235
  }
236
- function St(e) {
236
+ function Mt(e) {
237
237
  re(e) || ce(e) || B("handlerType"), ce(e) && Object.values(e).some(function(t) {
238
238
  return !re(t);
239
239
  }) && B("handlersType");
240
240
  }
241
- function Mt(e) {
242
- e || B("initialIsRequired"), ce(e) || B("initialType"), yt(e) && B("initialContent");
241
+ function St(e) {
242
+ e || B("initialIsRequired"), ce(e) || B("initialType"), bt(e) && B("initialContent");
243
243
  }
244
244
  function jt(e, t) {
245
245
  throw new Error(e[t] || e.default);
@@ -254,34 +254,34 @@ var Et = {
254
254
  changeType: "provided value of changes should be an object",
255
255
  changeField: 'it seams you want to change a field in the state which is not specified in the "initial" state',
256
256
  default: "an unknown error accured in `state-local` package"
257
- }, B = X(jt)(Et), ae = {
257
+ }, B = X(jt)(Et), ie = {
258
258
  changes: wt,
259
259
  selector: Ot,
260
- handler: St,
261
- initial: Mt
260
+ handler: Mt,
261
+ initial: St
262
262
  };
263
263
  function Pt(e) {
264
264
  var t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
265
- ae.initial(e), ae.handler(t);
265
+ ie.initial(e), ie.handler(t);
266
266
  var r = {
267
267
  current: e
268
- }, n = X($t)(r, t), o = X(xt)(r), a = X(ae.changes)(e), i = X(Ct)(r);
269
- function s() {
270
- var f = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : function(b) {
271
- return b;
268
+ }, n = X($t)(r, t), o = X(Ct)(r), i = X(ie.changes)(e), a = X(xt)(r);
269
+ function u() {
270
+ var s = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : function(h) {
271
+ return h;
272
272
  };
273
- return ae.selector(f), f(r.current);
273
+ return ie.selector(s), s(r.current);
274
274
  }
275
- function l(f) {
276
- vt(n, o, a, i)(f);
275
+ function l(s) {
276
+ vt(n, o, i, a)(s);
277
277
  }
278
- return [s, l];
278
+ return [u, l];
279
279
  }
280
- function Ct(e, t) {
280
+ function xt(e, t) {
281
281
  return re(t) ? t(e.current) : t;
282
282
  }
283
- function xt(e, t) {
284
- return e.current = $e($e({}, e.current), t), t;
283
+ function Ct(e, t) {
284
+ return e.current = Le(Le({}, e.current), t), t;
285
285
  }
286
286
  function $t(e, t, r) {
287
287
  return re(t) ? t(e.current) : Object.keys(r).forEach(function(n) {
@@ -289,41 +289,41 @@ function $t(e, t, r) {
289
289
  return (o = t[n]) === null || o === void 0 ? void 0 : o.call(t, e.current[n]);
290
290
  }), r;
291
291
  }
292
- var Lt = {
292
+ var It = {
293
293
  create: Pt
294
- }, It = {
294
+ }, Lt = {
295
295
  paths: {
296
296
  vs: "https://cdn.jsdelivr.net/npm/monaco-editor@0.52.2/min/vs"
297
297
  }
298
298
  };
299
- function Nt(e) {
299
+ function Tt(e) {
300
300
  return function t() {
301
- for (var r = this, n = arguments.length, o = new Array(n), a = 0; a < n; a++)
302
- o[a] = arguments[a];
301
+ for (var r = this, n = arguments.length, o = new Array(n), i = 0; i < n; i++)
302
+ o[i] = arguments[i];
303
303
  return o.length >= e.length ? e.apply(this, o) : function() {
304
- for (var i = arguments.length, s = new Array(i), l = 0; l < i; l++)
305
- s[l] = arguments[l];
306
- return t.apply(r, [].concat(o, s));
304
+ for (var a = arguments.length, u = new Array(a), l = 0; l < a; l++)
305
+ u[l] = arguments[l];
306
+ return t.apply(r, [].concat(o, u));
307
307
  };
308
308
  };
309
309
  }
310
310
  function Dt(e) {
311
311
  return {}.toString.call(e).includes("Object");
312
312
  }
313
- function Tt(e) {
314
- return e || Le("configIsRequired"), Dt(e) || Le("configType"), e.urls ? (kt(), {
313
+ function Nt(e) {
314
+ return e || Te("configIsRequired"), Dt(e) || Te("configType"), e.urls ? (kt(), {
315
315
  paths: {
316
316
  vs: e.urls.monacoBase
317
317
  }
318
318
  }) : e;
319
319
  }
320
320
  function kt() {
321
- console.warn(ke.deprecation);
321
+ console.warn(Ae.deprecation);
322
322
  }
323
323
  function At(e, t) {
324
324
  throw new Error(e[t] || e.default);
325
325
  }
326
- var ke = {
326
+ var Ae = {
327
327
  configIsRequired: "the configuration object is required",
328
328
  configType: "the configuration object should be an object",
329
329
  default: "an unknown error accured in `@monaco-editor/loader` package",
@@ -337,21 +337,21 @@ var ke = {
337
337
 
338
338
  For more please check the link https://github.com/suren-atoyan/monaco-loader#config
339
339
  `
340
- }, Le = Nt(At)(ke), Vt = {
341
- config: Tt
340
+ }, Te = Tt(At)(Ae), Vt = {
341
+ config: Nt
342
342
  }, _t = function() {
343
343
  for (var t = arguments.length, r = new Array(t), n = 0; n < t; n++)
344
344
  r[n] = arguments[n];
345
345
  return function(o) {
346
- return r.reduceRight(function(a, i) {
347
- return i(a);
346
+ return r.reduceRight(function(i, a) {
347
+ return a(i);
348
348
  }, o);
349
349
  };
350
350
  };
351
- function Ae(e, t) {
351
+ function Ve(e, t) {
352
352
  return Object.keys(t).forEach(function(r) {
353
- t[r] instanceof Object && e[r] && Object.assign(t[r], Ae(e[r], t[r]));
354
- }), Pe(Pe({}, e), t);
353
+ t[r] instanceof Object && e[r] && Object.assign(t[r], Ve(e[r], t[r]));
354
+ }), Ce(Ce({}, e), t);
355
355
  }
356
356
  var Ut = {
357
357
  type: "cancelation",
@@ -359,31 +359,31 @@ var Ut = {
359
359
  };
360
360
  function fe(e) {
361
361
  var t = !1, r = new Promise(function(n, o) {
362
- e.then(function(a) {
363
- return t ? o(Ut) : n(a);
362
+ e.then(function(i) {
363
+ return t ? o(Ut) : n(i);
364
364
  }), e.catch(o);
365
365
  });
366
366
  return r.cancel = function() {
367
367
  return t = !0;
368
368
  }, r;
369
369
  }
370
- var zt = Lt.create({
371
- config: It,
370
+ var Ft = It.create({
371
+ config: Lt,
372
372
  isInitialized: !1,
373
373
  resolve: null,
374
374
  reject: null,
375
375
  monaco: null
376
- }), Ve = dt(zt, 2), oe = Ve[0], ue = Ve[1];
377
- function Ft(e) {
376
+ }), _e = dt(Ft, 2), oe = _e[0], ue = _e[1];
377
+ function Rt(e) {
378
378
  var t = Vt.config(e), r = t.monaco, n = lt(t, ["monaco"]);
379
379
  ue(function(o) {
380
380
  return {
381
- config: Ae(o.config, n),
381
+ config: Ve(o.config, n),
382
382
  monaco: r
383
383
  };
384
384
  });
385
385
  }
386
- function Rt() {
386
+ function zt() {
387
387
  var e = oe(function(t) {
388
388
  var r = t.monaco, n = t.isInitialized, o = t.resolve;
389
389
  return {
@@ -398,46 +398,46 @@ function Rt() {
398
398
  }), e.monaco)
399
399
  return e.resolve(e.monaco), fe(pe);
400
400
  if (window.monaco && window.monaco.editor)
401
- return _e(window.monaco), e.resolve(window.monaco), fe(pe);
402
- _t(qt, Ht)(Wt);
401
+ return Ue(window.monaco), e.resolve(window.monaco), fe(pe);
402
+ _t(Ht, Bt)(Wt);
403
403
  }
404
404
  return fe(pe);
405
405
  }
406
- function qt(e) {
406
+ function Ht(e) {
407
407
  return document.body.appendChild(e);
408
408
  }
409
- function Bt(e) {
409
+ function qt(e) {
410
410
  var t = document.createElement("script");
411
411
  return e && (t.src = e), t;
412
412
  }
413
- function Ht(e) {
413
+ function Bt(e) {
414
414
  var t = oe(function(n) {
415
- var o = n.config, a = n.reject;
415
+ var o = n.config, i = n.reject;
416
416
  return {
417
417
  config: o,
418
- reject: a
418
+ reject: i
419
419
  };
420
- }), r = Bt("".concat(t.config.paths.vs, "/loader.js"));
420
+ }), r = qt("".concat(t.config.paths.vs, "/loader.js"));
421
421
  return r.onload = function() {
422
422
  return e();
423
423
  }, r.onerror = t.reject, r;
424
424
  }
425
425
  function Wt() {
426
426
  var e = oe(function(r) {
427
- var n = r.config, o = r.resolve, a = r.reject;
427
+ var n = r.config, o = r.resolve, i = r.reject;
428
428
  return {
429
429
  config: n,
430
430
  resolve: o,
431
- reject: a
431
+ reject: i
432
432
  };
433
433
  }), t = window.require;
434
434
  t.config(e.config), t(["vs/editor/editor.main"], function(r) {
435
- _e(r), e.resolve(r);
435
+ Ue(r), e.resolve(r);
436
436
  }, function(r) {
437
437
  e.reject(r);
438
438
  });
439
439
  }
440
- function _e(e) {
440
+ function Ue(e) {
441
441
  oe().monaco || ue({
442
442
  monaco: e
443
443
  });
@@ -453,182 +453,182 @@ var pe = new Promise(function(e, t) {
453
453
  resolve: e,
454
454
  reject: t
455
455
  });
456
- }), H = {
457
- config: Ft,
458
- init: Rt,
456
+ }), W = {
457
+ config: Rt,
458
+ init: zt,
459
459
  __getMonacoInstance: Kt
460
- }, Yt = { wrapper: { display: "flex", position: "relative", textAlign: "initial" }, fullWidth: { width: "100%" }, hide: { display: "none" } }, ge = Yt, Zt = { container: { display: "flex", height: "100%", width: "100%", justifyContent: "center", alignItems: "center" } }, Gt = Zt;
460
+ }, Yt = { wrapper: { display: "flex", position: "relative", textAlign: "initial" }, fullWidth: { width: "100%" }, hide: { display: "none" } }, me = Yt, Zt = { container: { display: "flex", height: "100%", width: "100%", justifyContent: "center", alignItems: "center" } }, Gt = Zt;
461
461
  function Jt({ children: e }) {
462
- return W.createElement("div", { style: Gt.container }, e);
462
+ return K.createElement("div", { style: Gt.container }, e);
463
463
  }
464
464
  var Qt = Jt, Xt = Qt;
465
- function er({ width: e, height: t, isEditorReady: r, loading: n, _ref: o, className: a, wrapperProps: i }) {
466
- return W.createElement("section", { style: { ...ge.wrapper, width: e, height: t }, ...i }, !r && W.createElement(Xt, null, n), W.createElement("div", { ref: o, style: { ...ge.fullWidth, ...!r && ge.hide }, className: a }));
465
+ function er({ width: e, height: t, isEditorReady: r, loading: n, _ref: o, className: i, wrapperProps: a }) {
466
+ return K.createElement("section", { style: { ...me.wrapper, width: e, height: t }, ...a }, !r && K.createElement(Xt, null, n), K.createElement("div", { ref: o, style: { ...me.fullWidth, ...!r && me.hide }, className: i }));
467
467
  }
468
- var tr = er, Ue = ye(tr);
468
+ var tr = er, Fe = be(tr);
469
469
  function rr(e) {
470
- $(e, []);
470
+ I(e, []);
471
471
  }
472
- var be = rr;
472
+ var we = rr;
473
473
  function nr(e, t, r = !0) {
474
- let n = y(!0);
475
- $(n.current || !r ? () => {
474
+ let n = w(!0);
475
+ I(n.current || !r ? () => {
476
476
  n.current = !1;
477
477
  } : e, t);
478
478
  }
479
- var _ = nr;
479
+ var U = nr;
480
480
  function ee() {
481
481
  }
482
482
  function Z(e, t, r, n) {
483
- return or(e, n) || ar(e, t, r, n);
483
+ return or(e, n) || ir(e, t, r, n);
484
484
  }
485
485
  function or(e, t) {
486
- return e.editor.getModel(ze(e, t));
486
+ return e.editor.getModel(Re(e, t));
487
487
  }
488
- function ar(e, t, r, n) {
489
- return e.editor.createModel(t, r, n ? ze(e, n) : void 0);
488
+ function ir(e, t, r, n) {
489
+ return e.editor.createModel(t, r, n ? Re(e, n) : void 0);
490
490
  }
491
- function ze(e, t) {
491
+ function Re(e, t) {
492
492
  return e.Uri.parse(t);
493
493
  }
494
- function ir({ original: e, modified: t, language: r, originalLanguage: n, modifiedLanguage: o, originalModelPath: a, modifiedModelPath: i, keepCurrentOriginalModel: s = !1, keepCurrentModifiedModel: l = !1, theme: f = "light", loading: b = "Loading...", options: p = {}, height: g = "100%", width: I = "100%", className: w, wrapperProps: k = {}, beforeMount: M = ee, onMount: O = ee }) {
495
- let [m, j] = A(!1), [D, E] = A(!0), P = y(null), S = y(null), z = y(null), d = y(O), u = y(M), N = y(!1);
496
- be(() => {
497
- let c = H.init();
498
- return c.then((h) => (S.current = h) && E(!1)).catch((h) => (h == null ? void 0 : h.type) !== "cancelation" && console.error("Monaco initialization: error:", h)), () => P.current ? L() : c.cancel();
499
- }), _(() => {
500
- if (P.current && S.current) {
501
- let c = P.current.getOriginalEditor(), h = Z(S.current, e || "", n || r || "text", a || "");
502
- h !== c.getModel() && c.setModel(h);
494
+ function ar({ original: e, modified: t, language: r, originalLanguage: n, modifiedLanguage: o, originalModelPath: i, modifiedModelPath: a, keepCurrentOriginalModel: u = !1, keepCurrentModifiedModel: l = !1, theme: s = "light", loading: h = "Loading...", options: f = {}, height: m = "100%", width: L = "100%", className: g, wrapperProps: k = {}, beforeMount: C = ee, onMount: O = ee }) {
495
+ let [v, N] = V(!1), [x, S] = V(!0), j = w(null), E = w(null), z = w(null), M = w(O), d = w(C), P = w(!1);
496
+ we(() => {
497
+ let c = W.init();
498
+ return c.then((b) => (E.current = b) && S(!1)).catch((b) => (b == null ? void 0 : b.type) !== "cancelation" && console.error("Monaco initialization: error:", b)), () => j.current ? T() : c.cancel();
499
+ }), U(() => {
500
+ if (j.current && E.current) {
501
+ let c = j.current.getOriginalEditor(), b = Z(E.current, e || "", n || r || "text", i || "");
502
+ b !== c.getModel() && c.setModel(b);
503
503
  }
504
- }, [a], m), _(() => {
505
- if (P.current && S.current) {
506
- let c = P.current.getModifiedEditor(), h = Z(S.current, t || "", o || r || "text", i || "");
507
- h !== c.getModel() && c.setModel(h);
504
+ }, [i], v), U(() => {
505
+ if (j.current && E.current) {
506
+ let c = j.current.getModifiedEditor(), b = Z(E.current, t || "", o || r || "text", a || "");
507
+ b !== c.getModel() && c.setModel(b);
508
508
  }
509
- }, [i], m), _(() => {
510
- let c = P.current.getModifiedEditor();
511
- c.getOption(S.current.editor.EditorOption.readOnly) ? c.setValue(t || "") : t !== c.getValue() && (c.executeEdits("", [{ range: c.getModel().getFullModelRange(), text: t || "", forceMoveMarkers: !0 }]), c.pushUndoStop());
512
- }, [t], m), _(() => {
513
- var c, h;
514
- (h = (c = P.current) == null ? void 0 : c.getModel()) == null || h.original.setValue(e || "");
515
- }, [e], m), _(() => {
516
- let { original: c, modified: h } = P.current.getModel();
517
- S.current.editor.setModelLanguage(c, n || r || "text"), S.current.editor.setModelLanguage(h, o || r || "text");
518
- }, [r, n, o], m), _(() => {
509
+ }, [a], v), U(() => {
510
+ let c = j.current.getModifiedEditor();
511
+ c.getOption(E.current.editor.EditorOption.readOnly) ? c.setValue(t || "") : t !== c.getValue() && (c.executeEdits("", [{ range: c.getModel().getFullModelRange(), text: t || "", forceMoveMarkers: !0 }]), c.pushUndoStop());
512
+ }, [t], v), U(() => {
513
+ var c, b;
514
+ (b = (c = j.current) == null ? void 0 : c.getModel()) == null || b.original.setValue(e || "");
515
+ }, [e], v), U(() => {
516
+ let { original: c, modified: b } = j.current.getModel();
517
+ E.current.editor.setModelLanguage(c, n || r || "text"), E.current.editor.setModelLanguage(b, o || r || "text");
518
+ }, [r, n, o], v), U(() => {
519
519
  var c;
520
- (c = S.current) == null || c.editor.setTheme(f);
521
- }, [f], m), _(() => {
520
+ (c = E.current) == null || c.editor.setTheme(s);
521
+ }, [s], v), U(() => {
522
522
  var c;
523
- (c = P.current) == null || c.updateOptions(p);
524
- }, [p], m);
525
- let C = G(() => {
526
- var R;
527
- if (!S.current)
523
+ (c = j.current) == null || c.updateOptions(f);
524
+ }, [f], v);
525
+ let p = G(() => {
526
+ var A;
527
+ if (!E.current)
528
528
  return;
529
- u.current(S.current);
530
- let c = Z(S.current, e || "", n || r || "text", a || ""), h = Z(S.current, t || "", o || r || "text", i || "");
531
- (R = P.current) == null || R.setModel({ original: c, modified: h });
532
- }, [r, t, o, e, n, a, i]), T = G(() => {
529
+ d.current(E.current);
530
+ let c = Z(E.current, e || "", n || r || "text", i || ""), b = Z(E.current, t || "", o || r || "text", a || "");
531
+ (A = j.current) == null || A.setModel({ original: c, modified: b });
532
+ }, [r, t, o, e, n, i, a]), D = G(() => {
533
533
  var c;
534
- !N.current && z.current && (P.current = S.current.editor.createDiffEditor(z.current, { automaticLayout: !0, ...p }), C(), (c = S.current) == null || c.editor.setTheme(f), j(!0), N.current = !0);
535
- }, [p, f, C]);
536
- $(() => {
537
- m && d.current(P.current, S.current);
538
- }, [m]), $(() => {
539
- !D && !m && T();
540
- }, [D, m, T]);
541
- function L() {
542
- var h, R, K, J;
543
- let c = (h = P.current) == null ? void 0 : h.getModel();
544
- s || ((R = c == null ? void 0 : c.original) == null || R.dispose()), l || ((K = c == null ? void 0 : c.modified) == null || K.dispose()), (J = P.current) == null || J.dispose();
534
+ !P.current && z.current && (j.current = E.current.editor.createDiffEditor(z.current, { automaticLayout: !0, ...f }), p(), (c = E.current) == null || c.editor.setTheme(s), N(!0), P.current = !0);
535
+ }, [f, s, p]);
536
+ I(() => {
537
+ v && M.current(j.current, E.current);
538
+ }, [v]), I(() => {
539
+ !x && !v && D();
540
+ }, [x, v, D]);
541
+ function T() {
542
+ var b, A, H, J;
543
+ let c = (b = j.current) == null ? void 0 : b.getModel();
544
+ u || ((A = c == null ? void 0 : c.original) == null || A.dispose()), l || ((H = c == null ? void 0 : c.modified) == null || H.dispose()), (J = j.current) == null || J.dispose();
545
545
  }
546
- return W.createElement(Ue, { width: I, height: g, isEditorReady: m, loading: b, _ref: z, className: w, wrapperProps: k });
546
+ return K.createElement(Fe, { width: L, height: m, isEditorReady: v, loading: h, _ref: z, className: g, wrapperProps: k });
547
547
  }
548
- var cr = ir, ur = ye(cr);
548
+ var cr = ar, ur = be(cr);
549
549
  function sr() {
550
- let [e, t] = A(H.__getMonacoInstance());
551
- return be(() => {
550
+ let [e, t] = V(W.__getMonacoInstance());
551
+ return we(() => {
552
552
  let r;
553
- return e || (r = H.init(), r.then((n) => {
553
+ return e || (r = W.init(), r.then((n) => {
554
554
  t(n);
555
555
  })), () => r == null ? void 0 : r.cancel();
556
556
  }), e;
557
557
  }
558
558
  var se = sr;
559
559
  function lr(e) {
560
- let t = y();
561
- return $(() => {
560
+ let t = w();
561
+ return I(() => {
562
562
  t.current = e;
563
563
  }, [e]), t.current;
564
564
  }
565
- var dr = lr, ie = /* @__PURE__ */ new Map();
566
- function fr({ defaultValue: e, defaultLanguage: t, defaultPath: r, value: n, language: o, path: a, theme: i = "light", line: s, loading: l = "Loading...", options: f = {}, overrideServices: b = {}, saveViewState: p = !0, keepCurrentModel: g = !1, width: I = "100%", height: w = "100%", className: k, wrapperProps: M = {}, beforeMount: O = ee, onMount: m = ee, onChange: j, onValidate: D = ee }) {
567
- let [E, P] = A(!1), [S, z] = A(!0), d = y(null), u = y(null), N = y(null), C = y(m), T = y(O), L = y(), c = y(n), h = dr(a), R = y(!1), K = y(!1);
568
- be(() => {
569
- let v = H.init();
570
- return v.then((x) => (d.current = x) && z(!1)).catch((x) => (x == null ? void 0 : x.type) !== "cancelation" && console.error("Monaco initialization: error:", x)), () => u.current ? Ke() : v.cancel();
571
- }), _(() => {
572
- var x, V, Q, Y;
573
- let v = Z(d.current, e || n || "", t || o || "", a || r || "");
574
- v !== ((x = u.current) == null ? void 0 : x.getModel()) && (p && ie.set(h, (V = u.current) == null ? void 0 : V.saveViewState()), (Q = u.current) == null || Q.setModel(v), p && ((Y = u.current) == null || Y.restoreViewState(ie.get(a))));
575
- }, [a], E), _(() => {
576
- var v;
577
- (v = u.current) == null || v.updateOptions(f);
578
- }, [f], E), _(() => {
579
- !u.current || n === void 0 || (u.current.getOption(d.current.editor.EditorOption.readOnly) ? u.current.setValue(n) : n !== u.current.getValue() && (K.current = !0, u.current.executeEdits("", [{ range: u.current.getModel().getFullModelRange(), text: n, forceMoveMarkers: !0 }]), u.current.pushUndoStop(), K.current = !1));
580
- }, [n], E), _(() => {
581
- var x, V;
582
- let v = (x = u.current) == null ? void 0 : x.getModel();
583
- v && o && ((V = d.current) == null || V.editor.setModelLanguage(v, o));
584
- }, [o], E), _(() => {
585
- var v;
586
- s !== void 0 && ((v = u.current) == null || v.revealLine(s));
587
- }, [s], E), _(() => {
588
- var v;
589
- (v = d.current) == null || v.editor.setTheme(i);
590
- }, [i], E);
565
+ var dr = lr, ae = /* @__PURE__ */ new Map();
566
+ function fr({ defaultValue: e, defaultLanguage: t, defaultPath: r, value: n, language: o, path: i, theme: a = "light", line: u, loading: l = "Loading...", options: s = {}, overrideServices: h = {}, saveViewState: f = !0, keepCurrentModel: m = !1, width: L = "100%", height: g = "100%", className: k, wrapperProps: C = {}, beforeMount: O = ee, onMount: v = ee, onChange: N, onValidate: x = ee }) {
567
+ let [S, j] = V(!1), [E, z] = V(!0), M = w(null), d = w(null), P = w(null), p = w(v), D = w(O), T = w(), c = w(n), b = dr(i), A = w(!1), H = w(!1);
568
+ we(() => {
569
+ let y = W.init();
570
+ return y.then(($) => (M.current = $) && z(!1)).catch(($) => ($ == null ? void 0 : $.type) !== "cancelation" && console.error("Monaco initialization: error:", $)), () => d.current ? Ye() : y.cancel();
571
+ }), U(() => {
572
+ var $, _, Q, Y;
573
+ let y = Z(M.current, e || n || "", t || o || "", i || r || "");
574
+ y !== (($ = d.current) == null ? void 0 : $.getModel()) && (f && ae.set(b, (_ = d.current) == null ? void 0 : _.saveViewState()), (Q = d.current) == null || Q.setModel(y), f && ((Y = d.current) == null || Y.restoreViewState(ae.get(i))));
575
+ }, [i], S), U(() => {
576
+ var y;
577
+ (y = d.current) == null || y.updateOptions(s);
578
+ }, [s], S), U(() => {
579
+ !d.current || n === void 0 || (d.current.getOption(M.current.editor.EditorOption.readOnly) ? d.current.setValue(n) : n !== d.current.getValue() && (H.current = !0, d.current.executeEdits("", [{ range: d.current.getModel().getFullModelRange(), text: n, forceMoveMarkers: !0 }]), d.current.pushUndoStop(), H.current = !1));
580
+ }, [n], S), U(() => {
581
+ var $, _;
582
+ let y = ($ = d.current) == null ? void 0 : $.getModel();
583
+ y && o && ((_ = M.current) == null || _.editor.setModelLanguage(y, o));
584
+ }, [o], S), U(() => {
585
+ var y;
586
+ u !== void 0 && ((y = d.current) == null || y.revealLine(u));
587
+ }, [u], S), U(() => {
588
+ var y;
589
+ (y = M.current) == null || y.editor.setTheme(a);
590
+ }, [a], S);
591
591
  let J = G(() => {
592
- var v;
593
- if (!(!N.current || !d.current) && !R.current) {
594
- T.current(d.current);
595
- let x = a || r, V = Z(d.current, n || e || "", t || o || "", x || "");
596
- u.current = (v = d.current) == null ? void 0 : v.editor.create(N.current, { model: V, automaticLayout: !0, ...f }, b), p && u.current.restoreViewState(ie.get(x)), d.current.editor.setTheme(i), s !== void 0 && u.current.revealLine(s), P(!0), R.current = !0;
592
+ var y;
593
+ if (!(!P.current || !M.current) && !A.current) {
594
+ D.current(M.current);
595
+ let $ = i || r, _ = Z(M.current, n || e || "", t || o || "", $ || "");
596
+ d.current = (y = M.current) == null ? void 0 : y.editor.create(P.current, { model: _, automaticLayout: !0, ...s }, h), f && d.current.restoreViewState(ae.get($)), M.current.editor.setTheme(a), u !== void 0 && d.current.revealLine(u), j(!0), A.current = !0;
597
597
  }
598
- }, [e, t, r, n, o, a, f, b, p, i, s]);
599
- $(() => {
600
- E && C.current(u.current, d.current);
601
- }, [E]), $(() => {
602
- !S && !E && J();
603
- }, [S, E, J]), c.current = n, $(() => {
604
- var v, x;
605
- E && j && ((v = L.current) == null || v.dispose(), L.current = (x = u.current) == null ? void 0 : x.onDidChangeModelContent((V) => {
606
- K.current || j(u.current.getValue(), V);
598
+ }, [e, t, r, n, o, i, s, h, f, a, u]);
599
+ I(() => {
600
+ S && p.current(d.current, M.current);
601
+ }, [S]), I(() => {
602
+ !E && !S && J();
603
+ }, [E, S, J]), c.current = n, I(() => {
604
+ var y, $;
605
+ S && N && ((y = T.current) == null || y.dispose(), T.current = ($ = d.current) == null ? void 0 : $.onDidChangeModelContent((_) => {
606
+ H.current || N(d.current.getValue(), _);
607
607
  }));
608
- }, [E, j]), $(() => {
609
- if (E) {
610
- let v = d.current.editor.onDidChangeMarkers((x) => {
608
+ }, [S, N]), I(() => {
609
+ if (S) {
610
+ let y = M.current.editor.onDidChangeMarkers(($) => {
611
611
  var Q;
612
- let V = (Q = u.current.getModel()) == null ? void 0 : Q.uri;
613
- if (V && x.find((Y) => Y.path === V.path)) {
614
- let Y = d.current.editor.getModelMarkers({ resource: V });
615
- D == null || D(Y);
612
+ let _ = (Q = d.current.getModel()) == null ? void 0 : Q.uri;
613
+ if (_ && $.find((Y) => Y.path === _.path)) {
614
+ let Y = M.current.editor.getModelMarkers({ resource: _ });
615
+ x == null || x(Y);
616
616
  }
617
617
  });
618
618
  return () => {
619
- v == null || v.dispose();
619
+ y == null || y.dispose();
620
620
  };
621
621
  }
622
622
  return () => {
623
623
  };
624
- }, [E, D]);
625
- function Ke() {
626
- var v, x;
627
- (v = L.current) == null || v.dispose(), g ? p && ie.set(a, u.current.saveViewState()) : (x = u.current.getModel()) == null || x.dispose(), u.current.dispose();
624
+ }, [S, x]);
625
+ function Ye() {
626
+ var y, $;
627
+ (y = T.current) == null || y.dispose(), m ? f && ae.set(i, d.current.saveViewState()) : ($ = d.current.getModel()) == null || $.dispose(), d.current.dispose();
628
628
  }
629
- return W.createElement(Ue, { width: I, height: w, isEditorReady: E, loading: l, _ref: N, className: k, wrapperProps: M });
629
+ return K.createElement(Fe, { width: L, height: g, isEditorReady: S, loading: l, _ref: P, className: k, wrapperProps: C });
630
630
  }
631
- var pr = fr, gr = ye(pr), we = gr;
631
+ var pr = fr, mr = be(pr), Oe = mr;
632
632
  const le = {
633
633
  selectOnLineNumbers: !0,
634
634
  scrollBeyondLastLine: !1,
@@ -637,7 +637,7 @@ const le = {
637
637
  bottom: 16
638
638
  },
639
639
  minimap: { enabled: !1 },
640
- fontSize: 13,
640
+ fontSize: 14,
641
641
  fontFamily: '"JetBrains Mono", "monospace"',
642
642
  lineHeight: 20,
643
643
  scrollbar: {
@@ -648,29 +648,52 @@ const le = {
648
648
  },
649
649
  overviewRulerBorder: !1,
650
650
  overviewRulerLanes: 0,
651
- renderLineHighlight: "none"
651
+ renderLineHighlight: "none",
652
+ automaticLayout: !0
652
653
  }, de = (e) => {
653
- const { themeConfig: t, editor: r, theme: n } = e, { defaultTheme: o } = t ?? {}, [a, i] = A(n ?? o ?? "vs-dark");
654
- return $(() => {
655
- var s;
656
- (s = t == null ? void 0 : t.themes) == null || s.forEach((l) => {
657
- F.editor.defineTheme(l.themeName, l.themeData);
654
+ const { themeConfig: t, editor: r, theme: n } = e, { defaultTheme: o } = t ?? {}, [i, a] = V(n ?? o ?? "vs-dark");
655
+ return I(() => {
656
+ var u;
657
+ (u = t == null ? void 0 : t.monacoThemes) == null || u.forEach((l) => {
658
+ R.editor.defineTheme(l.themeName, l.themeData);
658
659
  });
659
- }, [F]), $(() => {
660
- F.editor && n && (F.editor.setTheme(n), i(n));
661
- }, [r, n]), { theme: a };
660
+ }, [R]), I(() => {
661
+ R.editor && n && (R.editor.setTheme(n), a(n));
662
+ }, [r, n]), { theme: i };
662
663
  };
663
- function mr(e) {
664
+ function hr(e) {
664
665
  const t = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
665
666
  let r = "";
666
667
  for (let n = 0; n < e; n++)
667
668
  r += t.charAt(Math.floor(Math.random() * t.length));
668
669
  return r;
669
670
  }
670
- function hr(e) {
671
+ function gr(e) {
671
672
  return e.replace("'", "&#39;");
672
673
  }
673
- function vr({
674
+ const vr = (e) => {
675
+ const t = new Intl.RelativeTimeFormat("en", { numeric: "auto" });
676
+ if (e < 60)
677
+ return t.format(-e, "second");
678
+ const r = Math.floor(e / 60);
679
+ if (r < 60)
680
+ return t.format(-r, "minute");
681
+ const n = Math.floor(r / 60);
682
+ if (n < 24)
683
+ return t.format(-n, "hour");
684
+ const o = Math.floor(n / 24);
685
+ if (o < 30)
686
+ return t.format(-o, "day");
687
+ const i = Math.floor(o / 30);
688
+ if (i < 12)
689
+ return t.format(-i, "month");
690
+ const a = Math.floor(i / 12);
691
+ return t.format(-a, "year");
692
+ }, br = (e) => {
693
+ const t = new Date(e), n = Math.floor(((/* @__PURE__ */ new Date()).getTime() - t.getTime()) / 1e3), o = Math.abs(n);
694
+ return vr(o);
695
+ };
696
+ function yr({
674
697
  instanceId: e,
675
698
  lineNumbersPosition: t
676
699
  }) {
@@ -700,40 +723,40 @@ function vr({
700
723
 
701
724
  .monaco-editor-${e} .view-line .blame-editor-commit {
702
725
  display: inline-block;
703
- color: var(--canary-foreground-01);
726
+ color: var(--cn-text-1);
704
727
  }`, r;
705
728
  }
706
- function yr({
729
+ function wr({
707
730
  instanceId: e,
708
731
  blameData: t,
709
732
  dateWidth: r,
710
733
  avatarSize: n
711
734
  }) {
712
735
  let o = "";
713
- return t.forEach((a) => {
714
- var f, b, p, g, I, w, k, M;
715
- const i = (b = (f = a == null ? void 0 : a.commitInfo) == null ? void 0 : f.author) == null ? void 0 : b.avatarUrl, s = (g = (p = a == null ? void 0 : a.commitInfo) == null ? void 0 : p.author) == null ? void 0 : g.initials, l = i ? `background: url('${(w = (I = a == null ? void 0 : a.commitInfo) == null ? void 0 : I.author) == null ? void 0 : w.avatarUrl}');` : "";
716
- for (let O = a.fromLineNumber; O <= a.toLineNumber; O++)
717
- O === a.fromLineNumber ? o += `
736
+ return t.forEach((i) => {
737
+ var s, h, f, m, L, g, k, C;
738
+ const a = (h = (s = i == null ? void 0 : i.commitInfo) == null ? void 0 : s.author) == null ? void 0 : h.avatarUrl, u = (m = (f = i == null ? void 0 : i.commitInfo) == null ? void 0 : f.author) == null ? void 0 : m.initials, l = a ? `background: url('${(g = (L = i == null ? void 0 : i.commitInfo) == null ? void 0 : L.author) == null ? void 0 : g.avatarUrl}');` : "";
739
+ for (let O = i.fromLineNumber; O <= i.toLineNumber; O++)
740
+ O === i.fromLineNumber ? o += `
718
741
  .monaco-editor-${e} .view-line .blame-editor-commit-${O}:before {
719
- content: '${hr(((M = (k = a == null ? void 0 : a.commitInfo) == null ? void 0 : k.author) == null ? void 0 : M.when) || "")}';
742
+ content: '${gr(br(((C = (k = i == null ? void 0 : i.commitInfo) == null ? void 0 : k.author) == null ? void 0 : C.when) || ""))}';
720
743
  position: absolute;
721
744
  left: 10px;
722
745
  top: 0px;
723
- color: hsl(var(--canary-foreground-03));
746
+ color: var(--cn-text-3);
724
747
  }
725
748
 
726
749
  .monaco-editor-${e} .view-line .blame-editor-commit-${O}:after {
727
- content: '${s ?? " "}';
750
+ content: '${u ?? " "}';
728
751
  position: absolute;
729
752
  border-radius: 50%;
730
753
  padding: 4px;
731
754
  text-align: center;
732
- background: hsl(var(--canary-background-11));
755
+ background: var(--cn-set-gray-soft-bg);
733
756
  line-height: 17px;
734
757
  left: ${r + 10}px;
735
758
  top: -4px;
736
- color: hsl(var(--canary-foreground-03));
759
+ color: var(--cn-text-3);
737
760
  width: ${n}px;
738
761
  height: ${n}px;
739
762
  ${l}
@@ -747,12 +770,12 @@ function yr({
747
770
  }`;
748
771
  }), o;
749
772
  }
750
- function br(e, t) {
773
+ function Or(e, t) {
751
774
  let r = "";
752
775
  return e.length > t ? r = e.slice(0, t - 3) + "..." : e.length < t ? r = e + " ".repeat(t - e.length) : r = e, " ".repeat(25) + r + " ".repeat(10);
753
776
  }
754
- H.config({ monaco: F });
755
- const me = 450, wr = 30, Or = 140, Sr = 24, Mr = {
777
+ W.config({ monaco: R });
778
+ const he = 450, Mr = 30, Sr = 140, jr = 24, Er = {
756
779
  ...le,
757
780
  readOnly: !0,
758
781
  matchBrackets: "never",
@@ -763,168 +786,168 @@ const me = 450, wr = 30, Or = 140, Sr = 24, Mr = {
763
786
  renderWhitespace: "none",
764
787
  renderLineHighlight: "none"
765
788
  };
766
- function zr({
789
+ function Hr({
767
790
  code: e,
768
791
  language: t,
769
792
  themeConfig: r,
770
793
  lineNumbersPosition: n = "left",
771
794
  blameData: o,
772
- showSeparators: a = !0,
773
- theme: i,
774
- height: s = "75vh",
795
+ showSeparators: i = !0,
796
+ theme: a,
797
+ height: u = "75vh",
775
798
  options: l
776
799
  }) {
777
- const f = y(o), b = y(mr(5));
800
+ const s = w(o), h = w(hr(5));
778
801
  se();
779
- const [p, g] = A(), [I, w] = A(0), k = y(null), M = y(null);
780
- $(() => {
781
- f.current = o;
802
+ const [f, m] = V(), [L, g] = V(0), k = w(null), C = w(null);
803
+ I(() => {
804
+ s.current = o;
782
805
  }, [o]);
783
806
  function O() {
784
- const d = M.current, u = k.current;
785
- if (!d || !u)
807
+ const M = C.current, d = k.current;
808
+ if (!M || !d)
786
809
  return;
787
- a && d.changeViewZones(function(C) {
788
- C.addZone({
810
+ i && M.changeViewZones(function(p) {
811
+ p.addZone({
789
812
  afterLineNumber: 0,
790
813
  heightInPx: 10,
791
814
  domNode: document.createElement("div")
792
- }), f.current.forEach((T, L) => {
793
- if (L !== f.current.length - 1) {
815
+ }), s.current.forEach((D, T) => {
816
+ if (T !== s.current.length - 1) {
794
817
  const c = document.createElement("div");
795
- c.style.borderTop = "1px solid hsl(var(--canary-border-01))", c.style.marginTop = "9px", c.className = "blame-editor-separator", C.addZone({
796
- afterLineNumber: T.toLineNumber,
818
+ c.style.borderTop = "1px solid var(--cn-border-2)", c.style.marginTop = "9px", c.className = "blame-editor-separator", p.addZone({
819
+ afterLineNumber: D.toLineNumber,
797
820
  heightInPx: 20,
798
821
  domNode: c
799
822
  });
800
823
  }
801
824
  });
802
825
  });
803
- const N = [];
804
- f.current.forEach((C) => {
805
- var T;
806
- for (let L = C.fromLineNumber; L <= C.toLineNumber; L++)
807
- N.push({
808
- range: new u.Range(L, 0, L + 1, 0),
826
+ const P = [];
827
+ s.current.forEach((p) => {
828
+ var D;
829
+ for (let T = p.fromLineNumber; T <= p.toLineNumber; T++)
830
+ P.push({
831
+ range: new d.Range(T, 0, T + 1, 0),
809
832
  options: {
810
833
  before: {
811
- content: br(
812
- L === C.fromLineNumber && ((T = C == null ? void 0 : C.commitInfo) == null ? void 0 : T.title) || "",
813
- wr
834
+ content: Or(
835
+ T === p.fromLineNumber && ((D = p == null ? void 0 : p.commitInfo) == null ? void 0 : D.title) || "",
836
+ Mr
814
837
  ),
815
- cursorStops: u.editor.InjectedTextCursorStops.None,
816
- inlineClassName: `blame-editor-commit blame-editor-commit-${L}`
838
+ cursorStops: d.editor.InjectedTextCursorStops.None,
839
+ inlineClassName: `blame-editor-commit blame-editor-commit-${T}`
817
840
  }
818
841
  }
819
842
  });
820
- }), d.createDecorationsCollection(N);
843
+ }), M.createDecorationsCollection(P);
821
844
  }
822
- function m(d, u) {
823
- var N, C, T, L, c, h;
824
- M.current = d, k.current = u, d.setValue(e), g(d), (T = (C = (N = u.languages.typescript) == null ? void 0 : N.typescriptDefaults) == null ? void 0 : C.setDiagnosticsOptions) == null || T.call(C, {
845
+ function v(M, d) {
846
+ var P, p, D, T, c, b;
847
+ C.current = M, k.current = d, M.setValue(e), m(M), (D = (p = (P = d.languages.typescript) == null ? void 0 : P.typescriptDefaults) == null ? void 0 : p.setDiagnosticsOptions) == null || D.call(p, {
825
848
  noSuggestionDiagnostics: !0,
826
849
  noSyntaxValidation: !0,
827
850
  noSemanticValidation: !0
828
- }), (h = (c = (L = u.languages.typescript) == null ? void 0 : L.javascriptDefaults) == null ? void 0 : c.setDiagnosticsOptions) == null || h.call(c, {
851
+ }), (b = (c = (T = d.languages.typescript) == null ? void 0 : T.javascriptDefaults) == null ? void 0 : c.setDiagnosticsOptions) == null || b.call(c, {
829
852
  noSuggestionDiagnostics: !0,
830
853
  noSyntaxValidation: !0,
831
854
  noSemanticValidation: !0
832
855
  }), O();
833
856
  }
834
- $(() => {
835
- p == null || p.setValue(e);
857
+ I(() => {
858
+ f == null || f.setValue(e);
836
859
  }, [e]);
837
- const { theme: j } = de({ monacoRef: k, themeConfig: r, editor: p, theme: i }), D = q(
838
- () => vr({
839
- instanceId: b.current,
860
+ const { theme: N } = de({ monacoRef: k, themeConfig: r, editor: f, theme: a }), x = q(
861
+ () => yr({
862
+ instanceId: h.current,
840
863
  lineNumbersPosition: n
841
864
  }),
842
865
  [o]
843
- ), E = q(
844
- () => yr({
845
- instanceId: b.current,
866
+ ), S = q(
867
+ () => wr({
868
+ instanceId: h.current,
846
869
  blameData: o,
847
- avatarSize: Sr,
848
- dateWidth: Or
870
+ avatarSize: jr,
871
+ dateWidth: Sr
849
872
  }),
850
873
  [o]
851
874
  );
852
- $(() => {
875
+ I(() => {
853
876
  if (n === "center") {
854
- const d = document.getElementsByClassName("lines-content")[0];
855
- if (d) {
856
- const u = { attributes: !0 }, N = (T) => {
857
- for (const L of T) {
858
- const c = parseInt(getComputedStyle(d).left);
859
- w(c);
877
+ const M = document.getElementsByClassName("lines-content")[0];
878
+ if (M) {
879
+ const d = { attributes: !0 }, P = (D) => {
880
+ for (const T of D) {
881
+ const c = parseInt(getComputedStyle(M).left);
882
+ g(c);
860
883
  }
861
- }, C = new MutationObserver(N);
862
- return C.observe(d, u), () => {
863
- C.disconnect();
884
+ }, p = new MutationObserver(P);
885
+ return p.observe(M, d), () => {
886
+ p.disconnect();
864
887
  };
865
888
  }
866
889
  }
867
890
  });
868
- const P = q(() => `
869
- .monaco-editor-${b.current} .margin {
870
- left: ${me + 16 + I}px !important;
891
+ const j = q(() => `
892
+ .monaco-editor-${h.current} .margin {
893
+ left: ${he + 16 + L}px !important;
871
894
  pointer-events: none;
872
- }`, [I]), S = `
873
- .monaco-editor-${b.current} .view-overlays {
874
- clip-path: polygon(${me + 16}px 0, 100% 0%, 100% 100%, ${me + 16}px 100%);
895
+ }`, [L]), E = `
896
+ .monaco-editor-${h.current} .view-overlays {
897
+ clip-path: polygon(${he + 16}px 0, 100% 0%, 100% 100%, ${he + 16}px 100%);
875
898
  height:100% !important;
876
899
  }`, z = q(
877
900
  () => ({
878
- ...Mr,
901
+ ...Er,
879
902
  ...l
880
903
  }),
881
904
  [l]
882
905
  );
883
- return /* @__PURE__ */ U.jsxs(U.Fragment, { children: [
884
- /* @__PURE__ */ U.jsx(
906
+ return /* @__PURE__ */ F.jsxs(F.Fragment, { children: [
907
+ /* @__PURE__ */ F.jsx(
885
908
  "style",
886
909
  {
887
910
  dangerouslySetInnerHTML: {
888
- __html: `${D} ${E} ${P} ${S}`
911
+ __html: `${x} ${S} ${j} ${E}`
889
912
  }
890
913
  }
891
914
  ),
892
- /* @__PURE__ */ U.jsx(
893
- we,
915
+ /* @__PURE__ */ F.jsx(
916
+ Oe,
894
917
  {
895
- className: `monaco-editor-${b.current} overflow-hidden rounded-b-md border-x border-b`,
896
- height: s,
918
+ className: `monaco-editor-${h.current} overflow-hidden rounded-b-md border-x border-b`,
919
+ height: u,
897
920
  language: t,
898
- theme: j,
921
+ theme: N,
899
922
  options: z,
900
- onMount: m
923
+ onMount: v
901
924
  }
902
925
  )
903
926
  ] });
904
927
  }
905
- H.config({ monaco: F });
906
- const jr = {
928
+ W.config({ monaco: R });
929
+ const Pr = {
907
930
  ...le
908
931
  };
909
- function Fr({
932
+ function qr({
910
933
  codeRevision: e,
911
934
  onCodeRevisionChange: t,
912
935
  language: r,
913
936
  themeConfig: n,
914
937
  options: o,
915
- theme: a,
916
- height: i = "75vh",
917
- className: s
938
+ theme: i,
939
+ height: a = "75vh",
940
+ className: u
918
941
  }) {
919
942
  se();
920
- const [l, f] = A(), b = y(), p = y({ code: "", revisionId: 0 }), g = y(null), I = G(
921
- (M, O) => {
922
- var m, j, D, E, P, S;
923
- g.current = M, b.current = O, M.setValue(e.code), f(M), (D = (j = (m = O.languages.typescript) == null ? void 0 : m.typescriptDefaults) == null ? void 0 : j.setDiagnosticsOptions) == null || D.call(j, {
943
+ const [l, s] = V(), h = w(), f = w({ code: "", revisionId: 0 }), m = w(null), L = G(
944
+ (C, O) => {
945
+ var v, N, x, S, j, E;
946
+ m.current = C, h.current = O, C.setValue(e.code), s(C), (x = (N = (v = O.languages.typescript) == null ? void 0 : v.typescriptDefaults) == null ? void 0 : N.setDiagnosticsOptions) == null || x.call(N, {
924
947
  noSuggestionDiagnostics: !0,
925
948
  noSyntaxValidation: !0,
926
949
  noSemanticValidation: !0
927
- }), (S = (P = (E = O.languages.typescript) == null ? void 0 : E.javascriptDefaults) == null ? void 0 : P.setDiagnosticsOptions) == null || S.call(P, {
950
+ }), (E = (j = (S = O.languages.typescript) == null ? void 0 : S.javascriptDefaults) == null ? void 0 : j.setDiagnosticsOptions) == null || E.call(j, {
928
951
  noSuggestionDiagnostics: !0,
929
952
  noSyntaxValidation: !0,
930
953
  noSemanticValidation: !0
@@ -932,36 +955,36 @@ function Fr({
932
955
  },
933
956
  [e.code]
934
957
  );
935
- $(() => {
936
- var M, O;
937
- if (g.current && (!e.revisionId || e.revisionId > Number((M = p.current) == null ? void 0 : M.revisionId))) {
938
- const m = g.current.getModel();
939
- m && (o != null && o.readOnly ? (O = g.current) == null || O.setValue(e.code) : (g.current.pushUndoStop(), g.current.executeEdits("edit", [
958
+ I(() => {
959
+ var C, O;
960
+ if (m.current && (!e.revisionId || e.revisionId > Number((C = f.current) == null ? void 0 : C.revisionId))) {
961
+ const v = m.current.getModel();
962
+ v && (o != null && o.readOnly ? (O = m.current) == null || O.setValue(e.code) : (m.current.pushUndoStop(), m.current.executeEdits("edit", [
940
963
  {
941
- range: m.getFullModelRange(),
964
+ range: v.getFullModelRange(),
942
965
  text: e.code
943
966
  }
944
- ]), g.current.pushUndoStop()));
967
+ ]), m.current.pushUndoStop()));
945
968
  }
946
- }, [e, g.current]);
947
- const { theme: w } = de({ monacoRef: b, themeConfig: n, editor: l, theme: a }), k = q(() => ({ ...jr, ...o || {} }), [o]);
948
- return /* @__PURE__ */ U.jsx(U.Fragment, { children: /* @__PURE__ */ U.jsx(
949
- we,
969
+ }, [e, m.current]);
970
+ const { theme: g } = de({ monacoRef: h, themeConfig: n, editor: l, theme: i }), k = q(() => ({ ...Pr, ...o || {} }), [o]);
971
+ return /* @__PURE__ */ F.jsx(F.Fragment, { children: /* @__PURE__ */ F.jsx(
972
+ Oe,
950
973
  {
951
- className: s,
952
- height: i,
953
- onChange: (M, O) => {
954
- p.current = { code: M ?? "", revisionId: O.versionId }, t({ ...p.current }, O);
974
+ className: u,
975
+ height: a,
976
+ onChange: (C, O) => {
977
+ f.current = { code: C ?? "", revisionId: O.versionId }, t({ ...f.current }, O);
955
978
  },
956
979
  language: r,
957
- theme: w,
980
+ theme: g,
958
981
  options: k,
959
- onMount: I
982
+ onMount: L
960
983
  }
961
984
  ) });
962
985
  }
963
- H.config({ monaco: F });
964
- const Er = {
986
+ W.config({ monaco: R });
987
+ const xr = {
965
988
  ...le,
966
989
  codeLens: !1,
967
990
  smartSelect: {
@@ -970,64 +993,64 @@ const Er = {
970
993
  originalEditable: !1,
971
994
  overviewRulerBorder: !1
972
995
  };
973
- function Rr({
996
+ function Br({
974
997
  original: e,
975
998
  modified: t,
976
999
  language: r,
977
1000
  themeConfig: n,
978
1001
  options: o,
979
- theme: a,
980
- height: i = "75vh"
1002
+ theme: i,
1003
+ height: a = "75vh"
981
1004
  }) {
982
1005
  se();
983
- const [s, l] = A(), f = y(), { theme: b } = de({ monacoRef: f, themeConfig: n, editor: s, theme: a }), p = q(() => ({ ...Er, ...o || {} }), [o]);
984
- return /* @__PURE__ */ U.jsx(U.Fragment, { children: /* @__PURE__ */ U.jsx(
1006
+ const [u, l] = V(), s = w(), { theme: h } = de({ monacoRef: s, themeConfig: n, editor: u, theme: i }), f = q(() => ({ ...xr, ...o || {} }), [o]);
1007
+ return /* @__PURE__ */ F.jsx(F.Fragment, { children: /* @__PURE__ */ F.jsx(
985
1008
  ur,
986
1009
  {
987
1010
  className: "overflow-hidden rounded-b-md border-x border-b",
988
1011
  language: r,
989
- theme: b,
1012
+ theme: h,
990
1013
  original: e,
991
1014
  modified: t,
992
- height: i,
993
- options: p,
1015
+ height: a,
1016
+ options: f,
994
1017
  onMount: l
995
1018
  }
996
1019
  ) });
997
1020
  }
998
- var Fe = /* @__PURE__ */ ((e) => (e.ContainsPath = "ContainsPath", e))(Fe || {});
999
- function Pr(e) {
1000
- const { pathSymbolMap: t, inlineActions: r = [], commandId: n } = e, o = Object.fromEntries(t.entries()), a = [];
1001
- return r == null || r.forEach((i) => {
1002
- const s = i.actions;
1003
- i.selectors.forEach((f) => {
1004
- switch (f.type) {
1005
- case Fe.ContainsPath: {
1006
- f.paths.forEach((b) => {
1007
- let g = Object.keys(o).map((w) => ({
1008
- fullPath: w,
1009
- path: w,
1010
- symbol: o[w]
1011
- })).filter((w) => w.path.startsWith(f.basePath));
1012
- g = g.map((w) => ({
1013
- ...w,
1014
- path: w.path.substring(f.basePath.length)
1015
- })), g.filter((w) => b.test(w.path)).forEach((w) => {
1016
- const k = w.fullPath, M = w.symbol, O = M.range;
1017
- s.forEach((m) => {
1018
- const j = {
1021
+ var ze = /* @__PURE__ */ ((e) => (e.ContainsPath = "ContainsPath", e))(ze || {});
1022
+ function Cr(e) {
1023
+ const { pathSymbolMap: t, inlineActions: r = [], commandId: n } = e, o = Object.fromEntries(t.entries()), i = [];
1024
+ return r == null || r.forEach((a) => {
1025
+ const u = a.actions;
1026
+ a.selectors.forEach((s) => {
1027
+ switch (s.type) {
1028
+ case ze.ContainsPath: {
1029
+ s.paths.forEach((h) => {
1030
+ let m = Object.keys(o).map((g) => ({
1031
+ fullPath: g,
1032
+ path: g,
1033
+ symbol: o[g]
1034
+ })).filter((g) => g.path.startsWith(s.basePath));
1035
+ m = m.map((g) => ({
1036
+ ...g,
1037
+ path: g.path.substring(s.basePath.length)
1038
+ })), m.filter((g) => h.test(g.path)).forEach((g) => {
1039
+ const k = g.fullPath, C = g.symbol, O = C.range;
1040
+ u.forEach((v) => {
1041
+ const N = {
1019
1042
  range: O,
1020
- symbols: [M],
1021
- onClick: m.onClick,
1022
- data: m.data,
1043
+ symbols: [C],
1044
+ onClick: v.onClick,
1045
+ data: v.data,
1023
1046
  path: k
1024
1047
  };
1025
- a.push({
1048
+ i.push({
1026
1049
  range: O,
1027
1050
  command: {
1028
1051
  id: n,
1029
- title: m.title,
1030
- arguments: [j]
1052
+ title: v.title,
1053
+ arguments: [N]
1031
1054
  }
1032
1055
  });
1033
1056
  });
@@ -1037,7 +1060,7 @@ function Pr(e) {
1037
1060
  }
1038
1061
  }
1039
1062
  });
1040
- }), a;
1063
+ }), i;
1041
1064
  }
1042
1065
  const te = class te {
1043
1066
  static set(t) {
@@ -1047,40 +1070,40 @@ const te = class te {
1047
1070
  return te.data;
1048
1071
  }
1049
1072
  };
1050
- Se(te, "data", {});
1073
+ je(te, "data", {});
1051
1074
  let ve = te;
1052
- async function Re(e) {
1075
+ async function He(e) {
1053
1076
  const t = ve.get(), { documentSymbolProvider: r } = t.StandaloneServices.get(t.ILanguageFeaturesService);
1054
1077
  return await t.OutlineModel.create(r, e);
1055
1078
  }
1056
1079
  function qe(e) {
1057
1080
  const t = /* @__PURE__ */ new Map();
1058
- return Oe({
1081
+ return Me({
1059
1082
  pathSymbolMap: t,
1060
1083
  parentPath: "",
1061
1084
  children: e.children,
1062
- parentKind: he.SymbolKind.Module
1085
+ parentKind: ge.SymbolKind.Module
1063
1086
  }), t;
1064
1087
  }
1065
- function Oe(e) {
1088
+ function Me(e) {
1066
1089
  switch (e.parentKind) {
1067
- case he.SymbolKind.Module: {
1068
- Cr(e);
1090
+ case ge.SymbolKind.Module: {
1091
+ $r(e);
1069
1092
  break;
1070
1093
  }
1071
- case he.SymbolKind.Array: {
1072
- xr(e);
1094
+ case ge.SymbolKind.Array: {
1095
+ Ir(e);
1073
1096
  break;
1074
1097
  }
1075
1098
  default:
1076
- $r(e);
1099
+ Lr(e);
1077
1100
  }
1078
1101
  }
1079
- function Cr(e) {
1102
+ function $r(e) {
1080
1103
  e.children.forEach((t) => {
1081
1104
  var n;
1082
1105
  let r = e.parentPath;
1083
- t.symbol && (r = e.parentPath ? `${e.parentPath}.${t.symbol.name}` : t.symbol.name, e.pathSymbolMap.set(r, t.symbol)), Oe({
1106
+ t.symbol && (r = e.parentPath ? `${e.parentPath}.${t.symbol.name}` : t.symbol.name, e.pathSymbolMap.set(r, t.symbol)), Me({
1084
1107
  pathSymbolMap: e.pathSymbolMap,
1085
1108
  parentPath: r,
1086
1109
  children: t.children,
@@ -1088,11 +1111,11 @@ function Cr(e) {
1088
1111
  });
1089
1112
  });
1090
1113
  }
1091
- function xr(e) {
1114
+ function Ir(e) {
1092
1115
  let t = 0;
1093
1116
  e.children.forEach((r) => {
1094
1117
  const n = e.parentPath ? `${e.parentPath}.${t}` : `${t}`;
1095
- e.pathSymbolMap.set(n, r.symbol), t += 1, Oe({
1118
+ e.pathSymbolMap.set(n, r.symbol), t += 1, Me({
1096
1119
  pathSymbolMap: e.pathSymbolMap,
1097
1120
  parentPath: n,
1098
1121
  children: r.children,
@@ -1100,60 +1123,60 @@ function xr(e) {
1100
1123
  });
1101
1124
  });
1102
1125
  }
1103
- function $r(e) {
1126
+ function Lr(e) {
1104
1127
  const t = e.children.get("0");
1105
1128
  if (t) {
1106
1129
  const r = e.parentPath ? `${e.parentPath}.${t.symbol.name}` : t == null ? void 0 : t.symbol.name;
1107
1130
  e.pathSymbolMap.set(r, t.symbol);
1108
1131
  }
1109
1132
  }
1110
- function Lr({
1133
+ function Tr({
1111
1134
  editorRef: e,
1112
1135
  inlineActions: t
1113
1136
  }) {
1114
- $(() => F.languages.registerCodeLensProvider("yaml", {
1137
+ I(() => R.languages.registerCodeLensProvider("yaml", {
1115
1138
  provideCodeLenses: async (n) => {
1116
1139
  var l;
1117
- const o = await Re(n), a = qe(o), i = (l = e == null ? void 0 : e.current) == null ? void 0 : l.addCommand(0, (f, { onClick: b, path: p, range: g, data: I }) => {
1118
- b({ path: p, range: g, data: I });
1140
+ const o = await He(n), i = qe(o), a = (l = e == null ? void 0 : e.current) == null ? void 0 : l.addCommand(0, (s, { onClick: h, path: f, range: m, data: L }) => {
1141
+ h({ path: f, range: m, data: L });
1119
1142
  });
1120
- return i ? {
1121
- lenses: Pr({ pathSymbolMap: a, inlineActions: t, commandId: i }),
1143
+ return a ? {
1144
+ lenses: Cr({ pathSymbolMap: i, inlineActions: t, commandId: a }),
1122
1145
  dispose: () => {
1123
1146
  }
1124
1147
  } : void 0;
1125
1148
  }
1126
1149
  }).dispose, [t, e]);
1127
1150
  }
1128
- const Ir = ({ editorRef: e, selection: t }) => {
1129
- const [r, n] = A(), o = q(
1130
- () => async (a, i, s) => {
1131
- var g, I, w;
1132
- const l = (g = e == null ? void 0 : e.current) == null ? void 0 : g.getModel();
1133
- if (!l || !i)
1151
+ const Dr = ({ editorRef: e, selection: t }) => {
1152
+ const [r, n] = V(), o = q(
1153
+ () => async (i, a, u) => {
1154
+ var m, L, g;
1155
+ const l = (m = e == null ? void 0 : e.current) == null ? void 0 : m.getModel();
1156
+ if (!l || !a)
1134
1157
  return n(void 0);
1135
- const f = await Re(l), p = (I = qe(f).get(i)) == null ? void 0 : I.range;
1136
- p && (n(p), s && ((w = e == null ? void 0 : e.current) == null || w.revealLineInCenter(p.startLineNumber)));
1158
+ const s = await He(l), f = (L = qe(s).get(a)) == null ? void 0 : L.range;
1159
+ f && (n(f), u && ((g = e == null ? void 0 : e.current) == null || g.revealLineInCenter(f.startLineNumber)));
1137
1160
  },
1138
1161
  []
1139
1162
  );
1140
- $(() => {
1163
+ I(() => {
1141
1164
  if ("requestIdleCallback" in window) {
1142
- const a = requestIdleCallback(() => {
1165
+ const i = requestIdleCallback(() => {
1143
1166
  o(e, t == null ? void 0 : t.path, t == null ? void 0 : t.revealInCenter);
1144
1167
  });
1145
- return () => cancelIdleCallback(a);
1168
+ return () => cancelIdleCallback(i);
1146
1169
  } else {
1147
- const a = setTimeout(() => {
1170
+ const i = setTimeout(() => {
1148
1171
  o(e, t == null ? void 0 : t.path, t == null ? void 0 : t.revealInCenter);
1149
1172
  }, 100);
1150
- return () => clearTimeout(a);
1173
+ return () => clearTimeout(i);
1151
1174
  }
1152
- }, [t == null ? void 0 : t.path, t == null ? void 0 : t.revealInCenter, e, o]), $(() => {
1153
- var i;
1175
+ }, [t == null ? void 0 : t.path, t == null ? void 0 : t.revealInCenter, e, o]), I(() => {
1176
+ var a;
1154
1177
  if (!r)
1155
1178
  return;
1156
- const a = (i = e == null ? void 0 : e.current) == null ? void 0 : i.createDecorationsCollection([
1179
+ const i = (a = e == null ? void 0 : e.current) == null ? void 0 : a.createDecorationsCollection([
1157
1180
  {
1158
1181
  // TODO: check why startColumn is set to "end of row"
1159
1182
  range: { ...r, startColumn: 1 },
@@ -1163,9 +1186,9 @@ const Ir = ({ editorRef: e, selection: t }) => {
1163
1186
  }
1164
1187
  }
1165
1188
  ]);
1166
- return () => a == null ? void 0 : a.clear();
1189
+ return () => i == null ? void 0 : i.clear();
1167
1190
  }, [r, e, t == null ? void 0 : t.className]);
1168
- }, Be = Ge({
1191
+ }, Be = Je({
1169
1192
  markers: [],
1170
1193
  setMarkers: () => {
1171
1194
  },
@@ -1175,16 +1198,16 @@ const Ir = ({ editorRef: e, selection: t }) => {
1175
1198
  updateCursorPosition: (e) => {
1176
1199
  }
1177
1200
  });
1178
- function qr({
1201
+ function Wr({
1179
1202
  children: e
1180
1203
  }) {
1181
- const [t, r] = A([]), [n, o] = A(null), a = G(
1182
- (i) => {
1183
- n == null || n.setPosition(i), n == null || n.revealLineInCenterIfOutsideViewport(i.lineNumber), n == null || n.focus();
1204
+ const [t, r] = V([]), [n, o] = V(null), i = G(
1205
+ (a) => {
1206
+ n == null || n.setPosition(a), n == null || n.revealLineInCenterIfOutsideViewport(a.lineNumber), n == null || n.focus();
1184
1207
  },
1185
1208
  [n]
1186
1209
  );
1187
- return /* @__PURE__ */ U.jsx(
1210
+ return /* @__PURE__ */ F.jsx(
1188
1211
  Be.Provider,
1189
1212
  {
1190
1213
  value: {
@@ -1192,146 +1215,163 @@ function qr({
1192
1215
  setMarkers: r,
1193
1216
  editor: n,
1194
1217
  setEditor: o,
1195
- updateCursorPosition: a
1218
+ updateCursorPosition: i
1196
1219
  },
1197
1220
  children: e
1198
1221
  }
1199
1222
  );
1200
1223
  }
1201
- function He() {
1202
- return Je(Be);
1203
- }
1204
- const Nr = ({ monacoRef: e }) => {
1205
- const { setMarkers: t } = He();
1206
- $(() => {
1207
- let r;
1208
- const n = setTimeout(() => {
1209
- var a;
1210
- const o = (a = e.current) == null ? void 0 : a.editor;
1211
- o && (r = o.onDidChangeMarkers(([i]) => {
1212
- const s = o.getModelMarkers({ resource: i });
1213
- t(s);
1224
+ function We() {
1225
+ return Qe(Be);
1226
+ }
1227
+ const Nr = ({ monacoRef: e, editorRef: t, instanceId: r }) => {
1228
+ const { setMarkers: n } = We();
1229
+ I(() => {
1230
+ let o;
1231
+ const i = setTimeout(() => {
1232
+ var u;
1233
+ const a = (u = e.current) == null ? void 0 : u.editor;
1234
+ a && (o = a.onDidChangeMarkers((l) => {
1235
+ var f;
1236
+ const s = (f = t.current) == null ? void 0 : f.getModel();
1237
+ if (!s)
1238
+ return;
1239
+ const h = s.uri.toString();
1240
+ if (l.some((m) => m.toString() === h)) {
1241
+ const m = R.editor.getModelMarkers({ resource: s.uri });
1242
+ n(m);
1243
+ }
1214
1244
  }));
1215
1245
  }, 100);
1216
1246
  return () => {
1217
- clearTimeout(n), r == null || r.dispose();
1247
+ clearTimeout(i), o == null || o.dispose();
1218
1248
  };
1219
- }, [e]);
1249
+ }, [e, r, n]);
1220
1250
  };
1221
- let Ie = !1;
1222
- function Dr(e) {
1223
- if (Ie)
1224
- return;
1251
+ function kr(e) {
1252
+ var n, o;
1253
+ const t = ((o = (n = ye) == null ? void 0 : n.diagnosticsOptions) == null ? void 0 : o.schemas) ?? [], r = t.findIndex((i) => i.fileMatch[0] === e.fileMatch[0]);
1254
+ r !== -1 ? t[r] = e : t.push(e), Ke(t);
1255
+ }
1256
+ function Ar(e) {
1257
+ var n, o;
1258
+ const r = (((o = (n = ye) == null ? void 0 : n.diagnosticsOptions) == null ? void 0 : o.schemas) ?? []).filter((i) => i.fileMatch[0] !== Se(e));
1259
+ Ke(r);
1260
+ }
1261
+ function Ke(e) {
1225
1262
  const t = {
1226
1263
  hover: !0,
1227
1264
  completion: !0,
1228
1265
  enableSchemaRequest: !1,
1229
1266
  validate: !0,
1230
- schemas: [e]
1267
+ schemas: e
1231
1268
  };
1232
- Ie = !0, Xe.setDiagnosticsOptions({ ...t });
1269
+ ye.setDiagnosticsOptions({ ...t });
1233
1270
  }
1234
- const We = (e) => Qe.parse(`file://${e}`).toString(), Tr = (e) => {
1271
+ const Se = (e) => Xe.parse(`file://${e}`).toString(), Vr = (e) => {
1235
1272
  const { schemaConfig: t, instanceId: r } = e;
1236
- $(() => {
1237
- t != null && t.schema && Dr({
1238
- // If YAML file is opened matching this glob
1239
- fileMatch: [We(r.toString())],
1240
- ...t
1241
- });
1273
+ I(() => {
1274
+ if (t != null && t.schema)
1275
+ return kr({
1276
+ fileMatch: [Se(r.toString())],
1277
+ ...t
1278
+ }), () => {
1279
+ Ar(r);
1280
+ };
1242
1281
  }, [t == null ? void 0 : t.schema, r]);
1243
1282
  };
1244
- H.config({ monaco: F });
1245
- const kr = {
1283
+ W.config({ monaco: R });
1284
+ const _r = {
1246
1285
  ...le,
1247
1286
  folding: !0
1248
- }, Br = function(t) {
1287
+ }, Kr = function(t) {
1249
1288
  const {
1250
1289
  yamlRevision: r,
1251
1290
  schemaConfig: n,
1252
1291
  inlineActions: o,
1253
- themeConfig: a,
1254
- onYamlRevisionChange: i,
1255
- selection: s,
1292
+ themeConfig: i,
1293
+ onYamlRevisionChange: a,
1294
+ selection: u,
1256
1295
  theme: l,
1257
- options: f,
1258
- animateOnUpdate: b = !1,
1259
- onAnimateEnd: p
1260
- } = t, g = se(), [I] = A("yaml"), { editor: w, setEditor: k } = He(), M = y(null), O = y(), m = y({ yaml: "", revisionId: 0 }), j = y(null), D = y(null), E = G(
1261
- (d) => {
1262
- var C, T, L;
1263
- const u = d.split(`
1264
- `), N = (C = j.current) == null ? void 0 : C.getModel();
1265
- if (N) {
1266
- (T = j.current) == null || T.pushUndoStop(), N.setValue("");
1267
- let c = 0;
1268
- D.current = window.setInterval(() => {
1269
- var h;
1270
- c < u.length ? (g && ((h = j.current) == null || h.executeEdits("addLine", [
1296
+ options: s,
1297
+ animateOnUpdate: h = !1,
1298
+ onAnimateEnd: f,
1299
+ instanceId: m
1300
+ } = t, L = se(), [g] = V(m ?? `yaml-editor-${Math.random()}`), { editor: k, setEditor: C } = We(), O = w(null), v = w(), N = w({ yaml: "", revisionId: 0 }), x = w(null), S = w(null), j = G(
1301
+ (P) => {
1302
+ var T, c, b;
1303
+ const p = P.split(`
1304
+ `), D = (T = x.current) == null ? void 0 : T.getModel();
1305
+ if (D) {
1306
+ (c = x.current) == null || c.pushUndoStop(), D.setValue("");
1307
+ let A = 0;
1308
+ S.current = window.setInterval(() => {
1309
+ var H;
1310
+ A < p.length ? (L && ((H = x.current) == null || H.executeEdits("addLine", [
1271
1311
  {
1272
- range: new g.Range(c + 1, 1, c + 1, 1),
1273
- text: u[c] + `
1312
+ range: new L.Range(A + 1, 1, A + 1, 1),
1313
+ text: p[A] + `
1274
1314
  `
1275
1315
  }
1276
- ])), c++) : D.current && (clearInterval(D.current), p == null || p());
1277
- }, 100), (L = j.current) == null || L.pushUndoStop();
1316
+ ])), A++) : S.current && (clearInterval(S.current), f == null || f());
1317
+ }, 100), (b = x.current) == null || b.pushUndoStop();
1278
1318
  }
1279
1319
  },
1280
- [g]
1320
+ [L]
1281
1321
  );
1282
- $(() => () => {
1283
- D.current && clearInterval(D.current);
1322
+ I(() => () => {
1323
+ S.current && clearInterval(S.current);
1284
1324
  }, []);
1285
- function P(d, u) {
1286
- j.current = d, O.current = u, d.setValue(r.yaml), k(d), setTimeout(() => {
1287
- var N;
1288
- (N = M.current) != null && N.style && (M.current.style.opacity = "1");
1325
+ function E(P, p) {
1326
+ x.current = P, v.current = p, P.setValue(r.yaml), C(P), setTimeout(() => {
1327
+ var D;
1328
+ (D = O.current) != null && D.style && (O.current.style.opacity = "1");
1289
1329
  }, 50);
1290
1330
  }
1291
- $(() => {
1292
- var d;
1293
- if (j.current && (!r.revisionId || r.revisionId > Number((d = m.current) == null ? void 0 : d.revisionId))) {
1294
- const u = j.current.getModel();
1295
- u && (j.current.executeEdits("edit", [
1331
+ I(() => {
1332
+ var P;
1333
+ if (x.current && (!r.revisionId || r.revisionId > Number((P = N.current) == null ? void 0 : P.revisionId))) {
1334
+ const p = x.current.getModel();
1335
+ p && (x.current.executeEdits("edit", [
1296
1336
  {
1297
- range: u.getFullModelRange(),
1298
- text: b ? "" : r.yaml
1337
+ range: p.getFullModelRange(),
1338
+ text: h ? "" : r.yaml
1299
1339
  }
1300
- ]), b && E(r.yaml));
1340
+ ]), h && j(r.yaml));
1301
1341
  }
1302
- }, [E, r, b]), Tr({ schemaConfig: n, instanceId: I }), Lr({ editorRef: j, inlineActions: o });
1303
- const { theme: S } = de({ monacoRef: O, themeConfig: a, editor: w, theme: l });
1304
- Nr({ monacoRef: O }), Ir({ editorRef: j, selection: s });
1305
- const z = q(
1342
+ }, [j, r, h]), Vr({ schemaConfig: n, instanceId: g }), Tr({ editorRef: x, inlineActions: o });
1343
+ const { theme: z } = de({ monacoRef: v, themeConfig: i, editor: k, theme: l });
1344
+ Nr({ monacoRef: v, editorRef: x, instanceId: g }), Dr({ editorRef: x, selection: u });
1345
+ const M = q(() => Se(g), []), d = q(
1306
1346
  () => ({
1307
- ...kr,
1308
- ...f
1347
+ ..._r,
1348
+ ...s
1309
1349
  }),
1310
- [f]
1350
+ [s]
1311
1351
  );
1312
- return /* @__PURE__ */ U.jsx("div", { style: { width: "100%", height: "100%", opacity: 0 }, ref: M, children: /* @__PURE__ */ U.jsx(
1313
- we,
1352
+ return /* @__PURE__ */ F.jsx("div", { style: { width: "100%", height: "100%", opacity: 0 }, ref: O, children: /* @__PURE__ */ F.jsx(
1353
+ Oe,
1314
1354
  {
1315
- onChange: (d, u) => {
1316
- m.current = { yaml: d ?? "", revisionId: u.versionId }, i({ ...m.current }, u);
1355
+ onChange: (P, p) => {
1356
+ N.current = { yaml: P ?? "", revisionId: p.versionId }, a({ ...N.current }, p);
1317
1357
  },
1318
1358
  language: "yaml",
1319
- theme: S,
1320
- options: z,
1321
- path: We(I),
1322
- onMount: P
1359
+ theme: z,
1360
+ options: d,
1361
+ path: M,
1362
+ onMount: E
1323
1363
  }
1324
1364
  ) });
1325
1365
  };
1326
1366
  export {
1327
- zr as BlameEditor,
1328
- Rr as CodeDiffEditor,
1329
- Fr as CodeEditor,
1367
+ Hr as BlameEditor,
1368
+ Br as CodeDiffEditor,
1369
+ qr as CodeEditor,
1330
1370
  ve as MonacoGlobals,
1331
- Fe as SelectorType,
1332
- Br as YamlEditor,
1371
+ ze as SelectorType,
1372
+ Kr as YamlEditor,
1333
1373
  Be as YamlEditorContext,
1334
- qr as YamlEditorContextProvider,
1335
- He as useYamlEditorContext
1374
+ Wr as YamlEditorContextProvider,
1375
+ We as useYamlEditorContext
1336
1376
  };
1337
1377
  //# sourceMappingURL=index.js.map