@harnessio/ui 0.5.2 → 0.5.3

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.
@@ -1,5 +1,5 @@
1
- import { useCallback as E, useEffect as h, useMemo as I, useRef as T, useState as L, useLayoutEffect as re } from "react";
2
- import { c as oe, e as te, i as ae, f as ie, g as se, U as D, h as H, j as $, S as C, k as ce, u as ue, l as fe, m as le, a as de } from "./use-resize-observer-B-bXbUjU.js";
1
+ import { useCallback as T, useEffect as h, useMemo as E, useRef as b, useState as L, useLayoutEffect as re } from "react";
2
+ import { c as oe, e as te, i as ae, f as ie, g as se, U as N, h as H, j as $, S as C, k as ce, u as ue, l as fe, m as de, a as le } from "./use-resize-observer-B-bXbUjU.js";
3
3
  import { a as me, b as ge } from "./use-debounce-search-DCssIumm.js";
4
4
  import { M as pe, S as U, e as ve, i as q, a as B } from "./_MapCache-CtJT4pV6.js";
5
5
  function ye(e) {
@@ -15,15 +15,15 @@ function _e(e) {
15
15
  function Ee(e) {
16
16
  return this.__data__.has(e);
17
17
  }
18
- function w(e) {
18
+ function I(e) {
19
19
  var n = -1, r = e == null ? 0 : e.length;
20
20
  for (this.__data__ = new pe(); ++n < r; )
21
21
  this.add(e[n]);
22
22
  }
23
- w.prototype.add = w.prototype.push = _e;
24
- w.prototype.has = Ee;
23
+ I.prototype.add = I.prototype.push = _e;
24
+ I.prototype.has = Ee;
25
25
  function Te(e, n) {
26
- for (var r = -1, t = e == null ? 0 : e.length; ++r < t; )
26
+ for (var r = -1, o = e == null ? 0 : e.length; ++r < o; )
27
27
  if (n(e[r], r, e))
28
28
  return !0;
29
29
  return !1;
@@ -32,60 +32,60 @@ function be(e, n) {
32
32
  return e.has(n);
33
33
  }
34
34
  var Ae = 1, Se = 2;
35
- function Y(e, n, r, t, a, o) {
36
- var c = r & Ae, i = e.length, s = n.length;
37
- if (i != s && !(c && s > i))
35
+ function Y(e, n, r, o, i, t) {
36
+ var s = r & Ae, c = e.length, a = n.length;
37
+ if (c != a && !(s && a > c))
38
38
  return !1;
39
- var f = o.get(e), u = o.get(n);
40
- if (f && u)
41
- return f == n && u == e;
42
- var d = -1, l = !0, p = r & Se ? new w() : void 0;
43
- for (o.set(e, n), o.set(n, e); ++d < i; ) {
44
- var g = e[d], v = n[d];
45
- if (t)
46
- var y = c ? t(v, g, d, n, e, o) : t(g, v, d, e, n, o);
39
+ var u = t.get(e), d = t.get(n);
40
+ if (u && d)
41
+ return u == n && d == e;
42
+ var f = -1, l = !0, m = r & Se ? new I() : void 0;
43
+ for (t.set(e, n), t.set(n, e); ++f < c; ) {
44
+ var g = e[f], v = n[f];
45
+ if (o)
46
+ var y = s ? o(v, g, f, n, e, t) : o(g, v, f, e, n, t);
47
47
  if (y !== void 0) {
48
48
  if (y)
49
49
  continue;
50
50
  l = !1;
51
51
  break;
52
52
  }
53
- if (p) {
54
- if (!Te(n, function(m, _) {
55
- if (!be(p, _) && (g === m || a(g, m, r, t, o)))
56
- return p.push(_);
53
+ if (m) {
54
+ if (!Te(n, function(p, _) {
55
+ if (!be(m, _) && (g === p || i(g, p, r, o, t)))
56
+ return m.push(_);
57
57
  })) {
58
58
  l = !1;
59
59
  break;
60
60
  }
61
- } else if (!(g === v || a(g, v, r, t, o))) {
61
+ } else if (!(g === v || i(g, v, r, o, t))) {
62
62
  l = !1;
63
63
  break;
64
64
  }
65
65
  }
66
- return o.delete(e), o.delete(n), l;
66
+ return t.delete(e), t.delete(n), l;
67
67
  }
68
- function Ie(e) {
68
+ function we(e) {
69
69
  var n = -1, r = Array(e.size);
70
- return e.forEach(function(t, a) {
71
- r[++n] = [a, t];
70
+ return e.forEach(function(o, i) {
71
+ r[++n] = [i, o];
72
72
  }), r;
73
73
  }
74
- function we(e) {
74
+ function Ie(e) {
75
75
  var n = -1, r = Array(e.size);
76
- return e.forEach(function(t) {
77
- r[++n] = t;
76
+ return e.forEach(function(o) {
77
+ r[++n] = o;
78
78
  }), r;
79
79
  }
80
- var Le = 1, Ce = 2, ke = "[object Boolean]", Oe = "[object Date]", Re = "[object Error]", Pe = "[object Map]", Me = "[object Number]", xe = "[object RegExp]", Ne = "[object Set]", De = "[object String]", He = "[object Symbol]", $e = "[object ArrayBuffer]", Ue = "[object DataView]", G = U ? U.prototype : void 0, k = G ? G.valueOf : void 0;
81
- function qe(e, n, r, t, a, o, c) {
80
+ var Le = 1, Ce = 2, ke = "[object Boolean]", Oe = "[object Date]", Re = "[object Error]", Pe = "[object Map]", Me = "[object Number]", xe = "[object RegExp]", De = "[object Set]", Ne = "[object String]", He = "[object Symbol]", $e = "[object ArrayBuffer]", Ue = "[object DataView]", V = U ? U.prototype : void 0, k = V ? V.valueOf : void 0;
81
+ function qe(e, n, r, o, i, t, s) {
82
82
  switch (r) {
83
83
  case Ue:
84
84
  if (e.byteLength != n.byteLength || e.byteOffset != n.byteOffset)
85
85
  return !1;
86
86
  e = e.buffer, n = n.buffer;
87
87
  case $e:
88
- return !(e.byteLength != n.byteLength || !o(new D(e), new D(n)));
88
+ return !(e.byteLength != n.byteLength || !t(new N(e), new N(n)));
89
89
  case ke:
90
90
  case Oe:
91
91
  case Me:
@@ -93,126 +93,126 @@ function qe(e, n, r, t, a, o, c) {
93
93
  case Re:
94
94
  return e.name == n.name && e.message == n.message;
95
95
  case xe:
96
- case De:
96
+ case Ne:
97
97
  return e == n + "";
98
98
  case Pe:
99
- var i = Ie;
100
- case Ne:
101
- var s = t & Le;
102
- if (i || (i = we), e.size != n.size && !s)
99
+ var c = we;
100
+ case De:
101
+ var a = o & Le;
102
+ if (c || (c = Ie), e.size != n.size && !a)
103
103
  return !1;
104
- var f = c.get(e);
105
- if (f)
106
- return f == n;
107
- t |= Ce, c.set(e, n);
108
- var u = Y(i(e), i(n), t, a, o, c);
109
- return c.delete(e), u;
104
+ var u = s.get(e);
105
+ if (u)
106
+ return u == n;
107
+ o |= Ce, s.set(e, n);
108
+ var d = Y(c(e), c(n), o, i, t, s);
109
+ return s.delete(e), d;
110
110
  case He:
111
111
  if (k)
112
112
  return k.call(e) == k.call(n);
113
113
  }
114
114
  return !1;
115
115
  }
116
- var Be = 1, Fe = Object.prototype, Ge = Fe.hasOwnProperty;
117
- function Ve(e, n, r, t, a, o) {
118
- var c = r & Be, i = F(e), s = i.length, f = F(n), u = f.length;
119
- if (s != u && !c)
116
+ var Be = 1, Fe = Object.prototype, Ve = Fe.hasOwnProperty;
117
+ function Ge(e, n, r, o, i, t) {
118
+ var s = r & Be, c = F(e), a = c.length, u = F(n), d = u.length;
119
+ if (a != d && !s)
120
120
  return !1;
121
- for (var d = s; d--; ) {
122
- var l = i[d];
123
- if (!(c ? l in n : Ge.call(n, l)))
121
+ for (var f = a; f--; ) {
122
+ var l = c[f];
123
+ if (!(s ? l in n : Ve.call(n, l)))
124
124
  return !1;
125
125
  }
126
- var p = o.get(e), g = o.get(n);
127
- if (p && g)
128
- return p == n && g == e;
126
+ var m = t.get(e), g = t.get(n);
127
+ if (m && g)
128
+ return m == n && g == e;
129
129
  var v = !0;
130
- o.set(e, n), o.set(n, e);
131
- for (var y = c; ++d < s; ) {
132
- l = i[d];
133
- var m = e[l], _ = n[l];
134
- if (t)
135
- var N = c ? t(_, m, l, n, e, o) : t(m, _, l, e, n, o);
136
- if (!(N === void 0 ? m === _ || a(m, _, r, t, o) : N)) {
130
+ t.set(e, n), t.set(n, e);
131
+ for (var y = s; ++f < a; ) {
132
+ l = c[f];
133
+ var p = e[l], _ = n[l];
134
+ if (o)
135
+ var D = s ? o(_, p, l, n, e, t) : o(p, _, l, e, n, t);
136
+ if (!(D === void 0 ? p === _ || i(p, _, r, o, t) : D)) {
137
137
  v = !1;
138
138
  break;
139
139
  }
140
140
  y || (y = l == "constructor");
141
141
  }
142
142
  if (v && !y) {
143
- var b = e.constructor, A = n.constructor;
144
- b != A && "constructor" in e && "constructor" in n && !(typeof b == "function" && b instanceof b && typeof A == "function" && A instanceof A) && (v = !1);
143
+ var A = e.constructor, S = n.constructor;
144
+ A != S && "constructor" in e && "constructor" in n && !(typeof A == "function" && A instanceof A && typeof S == "function" && S instanceof S) && (v = !1);
145
145
  }
146
- return o.delete(e), o.delete(n), v;
146
+ return t.delete(e), t.delete(n), v;
147
147
  }
148
- var We = 1, V = "[object Arguments]", W = "[object Array]", S = "[object Object]", Qe = Object.prototype, Q = Qe.hasOwnProperty;
149
- function Ye(e, n, r, t, a, o) {
150
- var c = q(e), i = q(n), s = c ? W : H(e), f = i ? W : H(n);
151
- s = s == V ? S : s, f = f == V ? S : f;
152
- var u = s == S, d = f == S, l = s == f;
148
+ var We = 1, G = "[object Arguments]", W = "[object Array]", w = "[object Object]", Qe = Object.prototype, Q = Qe.hasOwnProperty;
149
+ function Ye(e, n, r, o, i, t) {
150
+ var s = q(e), c = q(n), a = s ? W : H(e), u = c ? W : H(n);
151
+ a = a == G ? w : a, u = u == G ? w : u;
152
+ var d = a == w, f = u == w, l = a == u;
153
153
  if (l && $(e)) {
154
154
  if (!$(n))
155
155
  return !1;
156
- c = !0, u = !1;
156
+ s = !0, d = !1;
157
157
  }
158
- if (l && !u)
159
- return o || (o = new C()), c || ce(e) ? Y(e, n, r, t, a, o) : qe(e, n, s, r, t, a, o);
158
+ if (l && !d)
159
+ return t || (t = new C()), s || ce(e) ? Y(e, n, r, o, i, t) : qe(e, n, a, r, o, i, t);
160
160
  if (!(r & We)) {
161
- var p = u && Q.call(e, "__wrapped__"), g = d && Q.call(n, "__wrapped__");
162
- if (p || g) {
163
- var v = p ? e.value() : e, y = g ? n.value() : n;
164
- return o || (o = new C()), a(v, y, r, t, o);
161
+ var m = d && Q.call(e, "__wrapped__"), g = f && Q.call(n, "__wrapped__");
162
+ if (m || g) {
163
+ var v = m ? e.value() : e, y = g ? n.value() : n;
164
+ return t || (t = new C()), i(v, y, r, o, t);
165
165
  }
166
166
  }
167
- return l ? (o || (o = new C()), Ve(e, n, r, t, a, o)) : !1;
167
+ return l ? (t || (t = new C()), Ge(e, n, r, o, i, t)) : !1;
168
168
  }
169
- function K(e, n, r, t, a) {
170
- return e === n ? !0 : e == null || n == null || !B(e) && !B(n) ? e !== e && n !== n : Ye(e, n, r, t, K, a);
169
+ function K(e, n, r, o, i) {
170
+ return e === n ? !0 : e == null || n == null || !B(e) && !B(n) ? e !== e && n !== n : Ye(e, n, r, o, K, i);
171
171
  }
172
172
  function Ke(e, n, r) {
173
173
  r = typeof r == "function" ? r : void 0;
174
- var t = r ? r(e, n) : void 0;
175
- return t === void 0 ? K(e, n, void 0, r) : !!t;
174
+ var o = r ? r(e, n) : void 0;
175
+ return o === void 0 ? K(e, n, void 0, r) : !!o;
176
176
  }
177
177
  function Je() {
178
- const { useSearchParams: e } = ue(), [n, r] = e(), t = n.get("query"), a = E(
179
- (o) => {
180
- r((c) => {
181
- var s;
182
- const i = (s = o == null ? void 0 : o.target) == null ? void 0 : s.value;
183
- return fe(i) ? c.delete("query") : c.set("query", i), c;
178
+ const { useSearchParams: e } = ue(), [n, r] = e(), o = n.get("query"), i = T(
179
+ (t) => {
180
+ r((s) => {
181
+ var a;
182
+ const c = (a = t == null ? void 0 : t.target) == null ? void 0 : a.value;
183
+ return fe(c) ? s.delete("query") : s.set("query", c), s;
184
184
  });
185
185
  },
186
186
  [r]
187
187
  );
188
188
  return {
189
- query: t || void 0,
190
- handleSearch: a
189
+ query: o || void 0,
190
+ handleSearch: i
191
191
  };
192
192
  }
193
193
  function Xe(e, n) {
194
- return Ke(e, n, (r, t) => {
195
- if (typeof r == "function" && typeof t == "function")
196
- return r.toString() === t.toString();
194
+ return Ke(e, n, (r, o) => {
195
+ if (typeof r == "function" && typeof o == "function")
196
+ return r.toString() === o.toString();
197
197
  });
198
198
  }
199
199
  function J(e) {
200
- const n = T();
200
+ const n = b();
201
201
  return Xe(e, n.current) || (n.current = e), n.current;
202
202
  }
203
203
  function Ze(e, n) {
204
204
  h(e, J(n));
205
205
  }
206
206
  function ze(e, n) {
207
- return I(e, J(n));
207
+ return E(e, J(n));
208
208
  }
209
- function X(e, n, r = window, t, a = () => !0) {
209
+ function X(e, n, r = window, o, i = () => !0) {
210
210
  h(() => {
211
- if (a() && r)
212
- return r.addEventListener(e, n, t), () => {
211
+ if (i() && r)
212
+ return r.addEventListener(e, n, o), () => {
213
213
  r.removeEventListener(e, n);
214
214
  };
215
- }, [r, e, n, t, a]);
215
+ }, [r, e, n, o, i]);
216
216
  }
217
217
  function je(e, n, r = () => !0) {
218
218
  X(
@@ -230,55 +230,55 @@ function nn({
230
230
  onLoadMore: e,
231
231
  hasMore: n,
232
232
  isLoading: r = !1,
233
- enabled: t = !0,
234
- rootMargin: a = "100px",
235
- threshold: o = 0.1
233
+ enabled: o = !0,
234
+ rootMargin: i = "100px",
235
+ threshold: t = 0.1
236
236
  }) {
237
- const c = T(null), i = T(e);
237
+ const s = b(null), c = b(e);
238
238
  h(() => {
239
- i.current = e;
239
+ c.current = e;
240
240
  }, [e]);
241
- const s = E(
242
- (f) => {
243
- const [u] = f;
244
- u != null && u.isIntersecting && n && !r && i.current();
241
+ const a = T(
242
+ (u) => {
243
+ const [d] = u;
244
+ d != null && d.isIntersecting && n && !r && c.current();
245
245
  },
246
246
  [n, r]
247
247
  );
248
248
  return h(() => {
249
- const f = c.current;
250
- if (!f || !t || !n)
249
+ const u = s.current;
250
+ if (!u || !o || !n)
251
251
  return;
252
- const u = new IntersectionObserver(s, {
253
- rootMargin: a,
254
- threshold: o
252
+ const d = new IntersectionObserver(a, {
253
+ rootMargin: i,
254
+ threshold: t
255
255
  });
256
- return u.observe(f), () => {
257
- u.disconnect();
256
+ return d.observe(u), () => {
257
+ d.disconnect();
258
258
  };
259
- }, [t, n, s, a, o]), { sentinelRef: c };
259
+ }, [o, n, a, i, t]), { sentinelRef: s };
260
260
  }
261
261
  const rn = () => {
262
- const e = T(!1);
262
+ const e = b(!1);
263
263
  return h(() => (e.current = !0, () => {
264
264
  e.current = !1;
265
265
  }), []), e;
266
266
  };
267
267
  var Z = /* @__PURE__ */ ((e) => (e.SPACE_ID = "spaceId", e.SIDEBAR_WIDTH = "sidebarWidth", e.CURRENT_USER = "currentUser", e.DIFF_VIEW_STYLE = "DIFF_VIEW_STYLE", e.PULL_REQUEST_CREATION_OPTION = "PULL_REQUEST_CREATION_OPTION", e.PULL_REQUEST_ACTIVITY_ORDER = "PULL_REQUEST_ACTIVITY_ORDER", e))(Z || {});
268
268
  function z(e, n) {
269
- const [r, t] = L(() => {
269
+ const [r, o] = L(() => {
270
270
  try {
271
- const o = localStorage.getItem(e);
272
- return o ? JSON.parse(o) : n;
273
- } catch (o) {
274
- return console.error("Error reading from localStorage:", o), n;
271
+ const t = localStorage.getItem(e);
272
+ return t ? JSON.parse(t) : n;
273
+ } catch (t) {
274
+ return console.error("Error reading from localStorage:", t), n;
275
275
  }
276
276
  });
277
- return [r, (o) => {
277
+ return [r, (t) => {
278
278
  try {
279
- t(o), localStorage.setItem(e, JSON.stringify(o));
280
- } catch (c) {
281
- console.error("Error writing to localStorage:", c);
279
+ o(t), localStorage.setItem(e, JSON.stringify(t));
280
+ } catch (s) {
281
+ console.error("Error writing to localStorage:", s);
282
282
  }
283
283
  }];
284
284
  }
@@ -302,11 +302,11 @@ const on = 1024 * 1024, j = () => {
302
302
  console.debug("Memory API not available - memory cleanup disabled");
303
303
  return;
304
304
  }
305
- const a = setInterval(() => {
306
- const o = tn();
307
- o !== null && o > n && (console.debug(`Memory usage (${o}MB) exceeded threshold (${n}MB). Running cleanup...`), e());
305
+ const i = setInterval(() => {
306
+ const t = tn();
307
+ t !== null && t > n && (console.debug(`Memory usage (${t}MB) exceeded threshold (${n}MB). Running cleanup...`), e());
308
308
  }, r);
309
- return () => clearInterval(a);
309
+ return () => clearInterval(i);
310
310
  }, [e, n, r]);
311
311
  };
312
312
  function sn({
@@ -314,34 +314,37 @@ function sn({
314
314
  columns: n,
315
315
  defaultVisibleColumns: r
316
316
  }) {
317
- const t = I(
318
- () => r ?? n.map((u) => u.value),
317
+ const o = E(() => n.filter((f) => f.disabled).map((f) => f.value), [n]), i = E(
318
+ () => r ?? n.map((f) => f.value),
319
319
  [r, n]
320
- ), [a, o] = z(e, t), c = I(() => new Set(n.map((u) => u.value)), [n]), i = I(
321
- () => a.filter((u) => c.has(u)),
322
- [a, c]
323
- );
320
+ ), [t, s] = z(e, i), c = E(() => new Set(n.map((f) => f.value)), [n]), a = E(() => {
321
+ const l = [...t.filter((m) => c.has(m))];
322
+ for (const m of o)
323
+ l.includes(m) || l.push(m);
324
+ return l;
325
+ }, [t, c, o]);
324
326
  h(() => {
325
- (i.length !== a.length || i.some((d, l) => d !== a[l])) && o(i);
326
- }, [i, a, o]);
327
- const s = E(
328
- (u, d) => {
329
- if (d) {
330
- const l = i.includes(u) ? i : [...i, u];
331
- o(l);
332
- } else {
333
- const l = i.filter((p) => p !== u);
334
- o(l);
335
- }
327
+ (a.length !== t.length || a.some((l, m) => l !== t[m])) && s(a);
328
+ }, [a, t, s]);
329
+ const u = T(
330
+ (f, l) => {
331
+ if (!n.some((m) => m.value === f && m.disabled))
332
+ if (l) {
333
+ const m = a.includes(f) ? a : [...a, f];
334
+ s(m);
335
+ } else {
336
+ const m = a.filter((g) => g !== f);
337
+ s(m);
338
+ }
336
339
  },
337
- [i, o]
338
- ), f = E(() => {
339
- o(t);
340
- }, [o, t]);
340
+ [a, s, n]
341
+ ), d = T(() => {
342
+ s([.../* @__PURE__ */ new Set([...i, ...o])]);
343
+ }, [s, i, o]);
341
344
  return {
342
- visibleColumns: i,
343
- toggleColumn: s,
344
- resetColumns: f
345
+ visibleColumns: a,
346
+ toggleColumn: u,
347
+ resetColumns: d
345
348
  };
346
349
  }
347
350
  function cn() {
@@ -351,71 +354,71 @@ function cn() {
351
354
  function ee() {
352
355
  const [e, n] = L(!0);
353
356
  return h(() => {
354
- const { hidden: r, visibilityChange: t } = cn();
355
- function a() {
357
+ const { hidden: r, visibilityChange: o } = cn();
358
+ function i() {
356
359
  r && document[r] ? n(!1) : n(!0);
357
360
  }
358
- if (typeof document.addEventListener > "u" || typeof r > "u" || typeof t > "u")
361
+ if (typeof document.addEventListener > "u" || typeof r > "u" || typeof o > "u")
359
362
  console.warn("The Page Visibility API is not supported");
360
363
  else
361
- return document.addEventListener(t, a, !1), () => {
362
- document.removeEventListener(t, a, !1);
364
+ return document.addEventListener(o, i, !1), () => {
365
+ document.removeEventListener(o, i, !1);
363
366
  };
364
367
  }, []), e;
365
368
  }
366
369
  const un = 3e4, fn = 6e4;
367
- function ln(e, {
370
+ function dn(e, {
368
371
  startPolling: n = !1,
369
372
  pollingInterval: r = un,
370
- inactiveTabPollingInterval: t = fn,
371
- pollOnInactiveTab: a = !1
373
+ inactiveTabPollingInterval: o = fn,
374
+ pollOnInactiveTab: i = !1
372
375
  }) {
373
- const o = T(e), [c, i] = L(!1), s = ee(), f = s ? r : t;
376
+ const t = b(e), [s, c] = L(!1), a = ee(), u = a ? r : o;
374
377
  return re(() => {
375
- o.current = e;
378
+ t.current = e;
376
379
  }, [e]), h(() => {
377
- if (n && !(!s && !a) && !c) {
378
- const u = setTimeout(async () => {
379
- var d;
380
- i(!0);
380
+ if (n && !(!a && !i) && !s) {
381
+ const d = setTimeout(async () => {
382
+ var f;
383
+ c(!0);
381
384
  try {
382
- await ((d = o.current) == null ? void 0 : d.call(o));
385
+ await ((f = t.current) == null ? void 0 : f.call(t));
383
386
  } finally {
384
- i(!1);
387
+ c(!1);
385
388
  }
386
- }, f);
387
- return () => clearTimeout(u);
389
+ }, u);
390
+ return () => clearTimeout(d);
388
391
  }
389
- }, [f, c, a, n, s]), c;
392
+ }, [u, s, i, n, a]), s;
390
393
  }
391
- function dn(e) {
394
+ function ln(e) {
392
395
  const n = e.match(/lch\(\s*([\d.]+)\s+([\d.]+)\s+([\d.]+)\s*\)/i);
393
396
  if (!n) return;
394
- const r = parseFloat(n[1]), t = parseFloat(n[2]), o = parseFloat(n[3]) * Math.PI / 180, c = Math.cos(o) * t, i = Math.sin(o) * t;
395
- let s = (r + 16) / 116, f = c / 500 + s, u = s - i / 200;
396
- const d = (m) => m ** 3 > 8856e-6 ? m ** 3 : (m - 16 / 116) / 7.787;
397
- f = d(f) * 0.95047, s = d(s) * 1, u = d(u) * 1.08883;
398
- let l = 3.2406 * f - 1.5372 * s - 0.4986 * u, p = -0.9689 * f + 1.8758 * s + 0.0415 * u, g = 0.0557 * f - 0.204 * s + 1.057 * u;
399
- const v = (m) => m <= 31308e-7 ? 12.92 * m : 1.055 * Math.pow(m, 1 / 2.4) - 0.055;
400
- l = v(l), p = v(p), g = v(g);
401
- const y = (m) => Math.round(Math.min(1, Math.max(0, m)) * 255).toString(16).padStart(2, "0");
402
- return `#${y(l)}${y(p)}${y(g)}`;
397
+ const r = parseFloat(n[1]), o = parseFloat(n[2]), t = parseFloat(n[3]) * Math.PI / 180, s = Math.cos(t) * o, c = Math.sin(t) * o;
398
+ let a = (r + 16) / 116, u = s / 500 + a, d = a - c / 200;
399
+ const f = (p) => p ** 3 > 8856e-6 ? p ** 3 : (p - 16 / 116) / 7.787;
400
+ u = f(u) * 0.95047, a = f(a) * 1, d = f(d) * 1.08883;
401
+ let l = 3.2406 * u - 1.5372 * a - 0.4986 * d, m = -0.9689 * u + 1.8758 * a + 0.0415 * d, g = 0.0557 * u - 0.204 * a + 1.057 * d;
402
+ const v = (p) => p <= 31308e-7 ? 12.92 * p : 1.055 * Math.pow(p, 1 / 2.4) - 0.055;
403
+ l = v(l), m = v(m), g = v(g);
404
+ const y = (p) => Math.round(Math.min(1, Math.max(0, p)) * 255).toString(16).padStart(2, "0");
405
+ return `#${y(l)}${y(m)}${y(g)}`;
403
406
  }
404
407
  function mn(e) {
405
408
  const n = e.match(/\d+/g);
406
409
  if (!n || n.length < 3) return;
407
- const [r, t, a] = n.slice(0, 3).map(Number);
408
- return "#" + [r, t, a].map((o) => o.toString(16).padStart(2, "0")).join("");
410
+ const [r, o, i] = n.slice(0, 3).map(Number);
411
+ return "#" + [r, o, i].map((t) => t.toString(16).padStart(2, "0")).join("");
409
412
  }
410
413
  const O = [];
411
414
  function gn(e) {
412
415
  if (!O.some((r) => r.themeName === e)) {
413
416
  const r = document.createElement("div");
414
417
  document.body.appendChild(r);
415
- const t = P(vn, r);
416
- document.body.removeChild(r), t.base = e.indexOf("light") > -1 ? "vs" : "vs-dark", O.push({
418
+ const o = P(vn, r);
419
+ document.body.removeChild(r), o.base = e.indexOf("light") > -1 ? "vs" : "vs-dark", O.push({
417
420
  themeName: e,
418
- themeData: t
421
+ themeData: o
419
422
  });
420
423
  }
421
424
  return O;
@@ -425,15 +428,15 @@ function P(e, n) {
425
428
  return e.map((r) => P(r, n));
426
429
  if (e && typeof e == "object") {
427
430
  const r = {};
428
- for (const t in e)
429
- r[t] = P(e[t], n);
431
+ for (const o in e)
432
+ r[o] = P(e[o], n);
430
433
  return r;
431
434
  } else return typeof e == "string" && e.trim().startsWith("var(") ? pn(e, n) : e;
432
435
  }
433
436
  function pn(e, n) {
434
437
  n.style.color = `${e}`;
435
- const r = getComputedStyle(n).color, t = dn(r);
436
- return t || mn(r);
438
+ const r = getComputedStyle(n).color, o = ln(r);
439
+ return o || mn(r);
437
440
  }
438
441
  const vn = {
439
442
  base: "vs",
@@ -502,22 +505,22 @@ const vn = {
502
505
  }
503
506
  };
504
507
  function yn(e, n = "html") {
505
- const [r, t] = L(void 0);
508
+ const [r, o] = L(void 0);
506
509
  return h(() => {
507
510
  if (!e) return;
508
- let a = 0;
509
- const o = 5, c = 100;
510
- let i;
511
- const s = () => {
512
- a++;
513
- const u = document.querySelector(n);
514
- return u ? u.className.includes(e) ? (t({
511
+ let i = 0;
512
+ const t = 5, s = 100;
513
+ let c;
514
+ const a = () => {
515
+ i++;
516
+ const d = document.querySelector(n);
517
+ return d ? d.className.includes(e) ? (o({
515
518
  defaultTheme: e,
516
519
  themes: gn(e)
517
- }), i && clearInterval(i), !0) : (a >= o && i && clearInterval(i), !1) : !1;
520
+ }), c && clearInterval(c), !0) : (i >= t && c && clearInterval(c), !1) : !1;
518
521
  };
519
- return s() || (i = window.setInterval(s, c)), () => {
520
- i && clearInterval(i);
522
+ return a() || (c = window.setInterval(a, s)), () => {
523
+ c && clearInterval(c);
521
524
  };
522
525
  }, [n, e]), r;
523
526
  }
@@ -526,21 +529,21 @@ function R() {
526
529
  document.querySelectorAll(ne).forEach((e) => e.remove());
527
530
  }
528
531
  function hn(e, n) {
529
- return { loadTheme: E(
530
- (t) => {
531
- const a = le(t), o = document.querySelectorAll(ne);
532
- if (!a)
532
+ return { loadTheme: T(
533
+ (o) => {
534
+ const i = de(o), t = document.querySelectorAll(ne);
535
+ if (!i)
533
536
  return R(), Promise.resolve();
534
- const c = n[a];
535
- if (!c) return Promise.resolve();
536
- const i = `${e}/${c}`;
537
- return Array.from(o).some((s) => s.getAttribute("href") === i) ? Promise.resolve() : new Promise((s) => {
538
- const f = document.createElement("link");
539
- f.rel = "stylesheet", f.href = i, f.onload = () => {
540
- R(), f.setAttribute(M, x), s();
541
- }, f.onerror = () => {
542
- R(), f.setAttribute(M, x), s();
543
- }, document.head.appendChild(f);
537
+ const s = n[i];
538
+ if (!s) return Promise.resolve();
539
+ const c = `${e}/${s}`;
540
+ return Array.from(t).some((a) => a.getAttribute("href") === c) ? Promise.resolve() : new Promise((a) => {
541
+ const u = document.createElement("link");
542
+ u.rel = "stylesheet", u.href = c, u.onload = () => {
543
+ R(), u.setAttribute(M, x), a();
544
+ }, u.onerror = () => {
545
+ R(), u.setAttribute(M, x), a();
546
+ }, document.head.appendChild(u);
544
547
  });
545
548
  },
546
549
  [e, n]
@@ -563,8 +566,8 @@ const An = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
563
566
  useLocalStorage: z,
564
567
  useMemoryCleanup: an,
565
568
  useMonacoTheme: yn,
566
- usePolling: ln,
567
- useResizeObserver: de,
569
+ usePolling: dn,
570
+ useResizeObserver: le,
568
571
  useTabVisible: ee,
569
572
  useThemeCSSLoader: hn
570
573
  }, Symbol.toStringTag, { value: "Module" }));
@@ -581,10 +584,10 @@ export {
581
584
  An as i,
582
585
  an as j,
583
586
  sn as k,
584
- ln as l,
587
+ dn as l,
585
588
  ee as m,
586
589
  yn as n,
587
590
  hn as o,
588
591
  Je as u
589
592
  };
590
- //# sourceMappingURL=index-DygHpwlj.js.map
593
+ //# sourceMappingURL=index-BhO-bCC5.js.map