@synnaxlabs/x 0.42.1 → 0.42.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.
package/dist/index.js CHANGED
@@ -1,67 +1,67 @@
1
- var ue = Object.defineProperty;
2
- var fe = (e, t, r) => t in e ? ue(e, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[t] = r;
3
- var m = (e, t, r) => fe(e, typeof t != "symbol" ? t + "" : t, r);
4
- import { J as de } from "./index-BywOGO8U.js";
5
- import { c as tr } from "./index-BywOGO8U.js";
1
+ var fe = Object.defineProperty;
2
+ var de = (e, t, r) => t in e ? fe(e, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[t] = r;
3
+ var m = (e, t, r) => de(e, typeof t != "symbol" ? t + "" : t, r);
4
+ import { J as he } from "./index-BywOGO8U.js";
5
+ import { c as rr } from "./index-BywOGO8U.js";
6
6
  import p, { z as c } from "zod";
7
7
  import { a as y } from "./series-B9JERcqi.js";
8
- import { c as nr, D as sr, M as or, R as ir, S as ar, d as cr, b as lr, T as ur, g as fr, f as dr, h as hr, i as mr, e as pr, s as gr, t as br } from "./series-B9JERcqi.js";
9
- import { a as _r } from "./index-DizUWH6z.js";
10
- import { c as vr } from "./change-DLl6DccR.js";
11
- import { c as Sr, s as $r } from "./scale-DfJe9755.js";
12
- import { i as he, a as me, b as pe, L as C, G as I, E as ge } from "./index-QGplUHuy.js";
13
- import { c as Mr, d as Tr, p as jr } from "./index-QGplUHuy.js";
14
- import { debounce as Or, throttle as Ar } from "./debounce.js";
15
- import { deep as Ir } from "./deep.js";
16
- import { isObject as Nr } from "./identity.js";
17
- import { e as Rr } from "./external-DqPrWKvU.js";
18
- import { link as qr } from "./link.js";
19
- import { s as be, g as ye, h as _e, i as we, j as ve, k as xe, l as Se, n as $e, m as Ee, r as Me, o as Te } from "./bounds-Bn5_l4Z3.js";
20
- import { b as Ur } from "./bounds-Bn5_l4Z3.js";
21
- import { observe as Dr } from "./observe.js";
22
- import { getEntries as Br, mapValues as Vr, unknownRecordZ as Hr } from "./record.js";
23
- import { e as Yr } from "./external-BPgtxa8d.js";
24
- import { Search as Qr } from "./search.js";
25
- import { b as Xr } from "./box-Cc8IzcNo.js";
26
- import { d as tn } from "./dimensions-CRgergMS.js";
27
- import { d as nn } from "./direction-BL0PhD1k.js";
28
- import { l as on } from "./location-C3aeu046.js";
29
- import { p as cn } from "./position-DIglP1l2.js";
30
- import { s as un } from "./spatial-BSWPzMkK.js";
31
- import { x as dn } from "./xy-D_LqxaGt.js";
32
- import { nullToArr as mn, toArray as pn } from "./toArray.js";
33
- import { u as bn } from "./index-D4NCYiQB.js";
34
- import { URL as _n, buildQueryString as wn } from "./url.js";
35
- import { RoutedWorker as xn, TypedWorker as Sn, createMockWorkers as $n } from "./worker.js";
36
- import { e as Mn } from "./external-C8TFju8Q.js";
37
- const je = 2, ke = 3, Oe = 2, Ae = (e, t) => {
8
+ import { c as sr, D as or, M as ir, R as ar, S as cr, d as lr, b as ur, T as fr, g as dr, f as hr, h as mr, i as pr, e as gr, s as br, t as yr } from "./series-B9JERcqi.js";
9
+ import { a as wr } from "./index-DizUWH6z.js";
10
+ import { c as xr } from "./change-DLl6DccR.js";
11
+ import { c as $r, s as Er } from "./scale-DfJe9755.js";
12
+ import { i as me, a as pe, b as ge, L as I, G as L, E as be } from "./index-QGplUHuy.js";
13
+ import { c as Tr, d as jr, p as Or } from "./index-QGplUHuy.js";
14
+ import { debounce as Ar, throttle as Cr } from "./debounce.js";
15
+ import { deep as Lr } from "./deep.js";
16
+ import { isObject as Pr } from "./identity.js";
17
+ import { e as Zr } from "./external-DqPrWKvU.js";
18
+ import { link as Wr } from "./link.js";
19
+ import { s as ye, g as _e, h as we, i as ve, j as xe, k as Se, l as $e, n as Ee, m as Me, r as Te, o as je } from "./bounds-Bn5_l4Z3.js";
20
+ import { b as zr } from "./bounds-Bn5_l4Z3.js";
21
+ import { observe as Fr } from "./observe.js";
22
+ import { getEntries as Vr, mapValues as Hr, unknownRecordZ as Jr } from "./record.js";
23
+ import { e as Gr } from "./external-BPgtxa8d.js";
24
+ import { Search as Kr } from "./search.js";
25
+ import { b as en } from "./box-Cc8IzcNo.js";
26
+ import { d as rn } from "./dimensions-CRgergMS.js";
27
+ import { d as sn } from "./direction-BL0PhD1k.js";
28
+ import { l as an } from "./location-C3aeu046.js";
29
+ import { p as ln } from "./position-DIglP1l2.js";
30
+ import { s as fn } from "./spatial-BSWPzMkK.js";
31
+ import { x as hn } from "./xy-D_LqxaGt.js";
32
+ import { nullToArr as pn, toArray as gn } from "./toArray.js";
33
+ import { u as yn } from "./index-D4NCYiQB.js";
34
+ import { URL as wn, buildQueryString as vn } from "./url.js";
35
+ import { RoutedWorker as Sn, TypedWorker as $n, createMockWorkers as En } from "./worker.js";
36
+ import { e as Tn } from "./external-C8TFju8Q.js";
37
+ const Oe = 2, ke = 3, Ae = 2, Ce = (e, t) => {
38
38
  if (Number.isNaN(e) || !Number.isFinite(e)) return e;
39
- const r = be(t);
39
+ const r = ye(t);
40
40
  if (r == 0) return e;
41
41
  let n;
42
- r >= 1e3 ? n = je : r >= 1 ? n = ke : n = Math.ceil(-Math.log10(r)) + Oe;
42
+ r >= 1e3 ? n = Oe : r >= 1 ? n = ke : n = Math.ceil(-Math.log10(r)) + Ae;
43
43
  const s = 10 ** n;
44
44
  return Math.round(e * s) / s;
45
- }, qt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
45
+ }, Wt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
46
46
  __proto__: null,
47
- abs: ye,
48
- add: _e,
49
- closeTo: we,
50
- div: ve,
51
- equal: xe,
52
- max: Se,
53
- min: $e,
54
- mult: Ee,
55
- roundBySpan: Ae,
56
- roundToNearestMagnitude: Me,
57
- sub: Te
47
+ abs: _e,
48
+ add: we,
49
+ closeTo: ve,
50
+ div: xe,
51
+ equal: Se,
52
+ max: $e,
53
+ min: Ee,
54
+ mult: Me,
55
+ roundBySpan: Ce,
56
+ roundToNearestMagnitude: Te,
57
+ sub: je
58
58
  }, Symbol.toStringTag, { value: "Module" })), F = async (e) => await new Promise(
59
59
  (t) => setTimeout(t, y.fromMilliseconds(e).milliseconds)
60
- ), Wt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
60
+ ), Ut = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
61
61
  __proto__: null,
62
62
  sleep: F
63
63
  }, Symbol.toStringTag, { value: "Module" }));
64
- class Ce {
64
+ class Ie {
65
65
  constructor(t) {
66
66
  m(this, "config");
67
67
  m(this, "retries");
@@ -81,47 +81,48 @@ class Ce {
81
81
  this.retries = 0, this.interval = this.config.baseInterval;
82
82
  }
83
83
  }
84
- const Ie = c.object({
84
+ const Le = c.object({
85
85
  baseInterval: y.z.optional(),
86
86
  maxRetries: c.number().optional(),
87
87
  scale: c.number().optional()
88
- }), Ut = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
88
+ }), zt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
89
89
  __proto__: null,
90
- Breaker: Ce,
91
- breakerConfig: Ie
92
- }, Symbol.toStringTag, { value: "Module" })), Le = /^#?([0-9a-f]{6}|[0-9a-f]{8})$/i, q = c.string().regex(Le), b = c.number().min(0).max(255), Ne = c.number().min(0).max(1), W = c.tuple([b, b, b, Ne]), B = c.tuple([b, b, b]), Pe = (e) => $.safeParse(e).success, Re = (e) => W.safeParse(e).success, Ze = (e) => {
90
+ Breaker: Ie,
91
+ breakerConfig: Le
92
+ }, Symbol.toStringTag, { value: "Module" })), Ne = /^#?([0-9a-f]{6}|[0-9a-f]{8})$/i, W = c.string().regex(Ne), b = c.number().min(0).max(255), Pe = c.number().min(0).max(1), O = c.tuple([b, b, b, Pe]), B = c.tuple([b, b, b]), V = c.object({ rgba255: O }), Re = (e) => $.safeParse(e).success, Ze = (e) => O.safeParse(e).success, qe = (e) => {
93
93
  if (e == null) return;
94
94
  const t = $.safeParse(e);
95
- if (t.success) return J(t.data);
95
+ if (t.success) return Y(t.data);
96
96
  if (typeof e == "string") return e;
97
97
  throw t.error;
98
98
  }, d = (e, t = 1) => {
99
- if (typeof e == "string") return He(e, t);
99
+ if (typeof e == "string") return Je(e, t);
100
100
  if (Array.isArray(e)) {
101
101
  if (e.length < 3 || e.length > 4)
102
102
  throw new Error(`Invalid color: [${e.join(", ")}]`);
103
103
  return e.length === 3 ? [...e, t] : e;
104
104
  }
105
+ if (typeof e == "object" && "rgba255" in e) return e.rgba255;
105
106
  throw new Error(`Invalid color: ${JSON.stringify(e)}`);
106
- }, V = (e, t) => {
107
+ }, H = (e, t) => {
107
108
  if (e == null || t == null) return !1;
108
109
  const r = d(e), n = d(t);
109
110
  return r.every((s, o) => s === n[o]);
110
- }, H = (e) => {
111
+ }, J = (e) => {
111
112
  if (e == null) return;
112
113
  const [t, r, n, s] = d(e);
113
114
  return `#${M(t)}${M(r)}${M(n)}${s === 1 ? "" : M(s * 255)}`;
114
- }, J = (e) => {
115
+ }, Y = (e) => {
115
116
  const [t, r, n, s] = d(e);
116
117
  return `rgba(${t}, ${r}, ${n}, ${s})`;
117
- }, qe = (e) => `rgb(${Y(e)})`, Y = (e) => {
118
+ }, We = (e) => `rgb(${G(e)})`, G = (e) => {
118
119
  const [t, r, n] = d(e);
119
120
  return `${t}, ${r}, ${n}`;
120
- }, We = (e) => [...U(e), x(e)], U = (e) => [
121
+ }, Ue = (e) => [...U(e), x(e)], U = (e) => [
121
122
  _(e) / 255,
122
123
  w(e) / 255,
123
124
  v(e) / 255
124
- ], _ = (e) => d(e)[0], w = (e) => d(e)[1], v = (e) => d(e)[2], x = (e) => d(e)[3], Ue = (e) => V(z, e), ze = (e) => Ge(d(e)), De = (e, t) => {
125
+ ], _ = (e) => d(e)[0], w = (e) => d(e)[1], v = (e) => d(e)[2], x = (e) => d(e)[3], ze = (e) => H(z, e), De = (e) => Qe(d(e)), Fe = (e, t) => {
125
126
  const [r, n, s] = d(e);
126
127
  if (t > 100)
127
128
  throw new Error(`Color opacity must be between 0 and 100, got ${t}`);
@@ -131,26 +132,26 @@ const Ie = c.object({
131
132
  (s) => s <= 0.03928 ? s / 12.92 : ((s + 0.055) / 1.055) ** 2.4
132
133
  );
133
134
  return Number((0.2126 * t + 0.7152 * r + 0.0722 * n).toFixed(3));
134
- }, Fe = (e) => {
135
+ }, Be = (e) => {
135
136
  const [t, r, n] = U(e);
136
137
  return 1 - (Math.max(t, r, n) - Math.min(t, r, n));
137
- }, N = (e, t) => {
138
+ }, P = (e, t) => {
138
139
  const r = d(e), n = d(t), s = j(r), o = j(n);
139
140
  return (Math.max(s, o) + 0.5) / (Math.min(s, o) + 0.5);
140
- }, Be = (e, ...t) => {
141
+ }, Ve = (e, ...t) => {
141
142
  if (t.length === 0)
142
143
  throw new Error("[Color.pickByContrast] - must provide at least one color");
143
- const r = d(e), [n] = t.map((s) => d(s)).sort((s, o) => N(r, o) - N(r, s));
144
+ const r = d(e), [n] = t.map((s) => d(s)).sort((s, o) => P(r, o) - P(r, s));
144
145
  return n;
145
- }, G = (e) => j(e) < 0.5, Ve = (e) => !G(e), $ = c.union([q, W, B]).transform((e) => d(e)), He = (e, t = 1) => {
146
- if (!q.safeParse(e).success) throw new Error(`Invalid hex color: ${e}`);
147
- return e = Je(e), [
146
+ }, Q = (e) => j(e) < 0.5, He = (e) => !Q(e), $ = c.union([W, O, B, V]).transform((e) => d(e)), Je = (e, t = 1) => {
147
+ if (!W.safeParse(e).success) throw new Error(`Invalid hex color: ${e}`);
148
+ return e = Ye(e), [
148
149
  T(e, 0),
149
150
  T(e, 2),
150
151
  T(e, 4),
151
152
  e.length === 8 ? T(e, 6) / 255 : t
152
153
  ];
153
- }, z = [0, 0, 0, 0], M = (e) => Math.floor(e).toString(16).padStart(2, "0"), T = (e, t) => parseInt(e.slice(t, t + 2), 16), Je = (e) => e.startsWith("#") ? e.slice(1) : e, Ye = (e) => {
154
+ }, z = [0, 0, 0, 0], M = (e) => Math.floor(e).toString(16).padStart(2, "0"), T = (e, t) => parseInt(e.slice(t, t + 2), 16), Ye = (e) => e.startsWith("#") ? e.slice(1) : e, Ge = (e) => {
154
155
  let [t, r, n] = e;
155
156
  const s = e[3];
156
157
  t /= 360, r /= 100, n /= 100;
@@ -159,10 +160,10 @@ const Ie = c.object({
159
160
  o = a = f = n;
160
161
  else {
161
162
  const l = n < 0.5 ? n * (1 + r) : n + r - n * r, i = 2 * n - l;
162
- o = L(i, l, t + 1 / 3), a = L(i, l, t), f = L(i, l, t - 1 / 3);
163
+ o = N(i, l, t + 1 / 3), a = N(i, l, t), f = N(i, l, t - 1 / 3);
163
164
  }
164
165
  return [Math.round(o * 255), Math.round(a * 255), Math.round(f * 255), s];
165
- }, L = (e, t, r) => (r < 0 && (r += 1), r > 1 && (r -= 1), r < 1 / 6 ? e + (t - e) * 6 * r : r < 1 / 2 ? t : r < 2 / 3 ? e + (t - e) * (2 / 3 - r) * 6 : e), Ge = (e) => {
166
+ }, N = (e, t, r) => (r < 0 && (r += 1), r > 1 && (r -= 1), r < 1 / 6 ? e + (t - e) * 6 * r : r < 1 / 2 ? t : r < 2 / 3 ? e + (t - e) * (2 / 3 - r) * 6 : e), Qe = (e) => {
166
167
  let [t, r, n] = e;
167
168
  const s = e[3];
168
169
  t /= 255, r /= 255, n /= 255;
@@ -175,12 +176,12 @@ const Ie = c.object({
175
176
  l = i > 0.5 ? u / (2 - o - a) : u / (o + a), o === t ? f = (r - n) / u + (r < n ? 6 : 0) : o === r ? f = (n - t) / u + 2 : f = (t - r) / u + 4, f /= 6;
176
177
  }
177
178
  return f *= 360, l *= 100, i *= 100, [Math.round(f), Math.round(l), Math.round(i), s];
178
- }, Q = c.union([q, W, c.string(), B]), Qe = d("#000000"), Ke = d("#ffffff"), K = c.object({
179
+ }, K = c.union([W, O, c.string(), B, V]), Ke = d("#000000"), Xe = d("#ffffff"), X = c.object({
179
180
  key: c.string(),
180
- color: Q,
181
+ color: K,
181
182
  position: c.number(),
182
183
  switched: c.boolean().optional()
183
- }), Xe = c.array(K), et = (e, t) => {
184
+ }), et = c.array(X), tt = (e, t) => {
184
185
  if (e.length === 0) return z;
185
186
  if (e = e.slice().sort((r, n) => r.position - n.position), t <= e[0].position) return d(e[0].color);
186
187
  if (t >= e[e.length - 1].position)
@@ -201,106 +202,106 @@ const Ie = c.object({
201
202
  }
202
203
  }
203
204
  return d(e[e.length - 1].color);
204
- }, tt = c.object({
205
+ }, rt = c.object({
205
206
  key: c.string(),
206
207
  name: c.string(),
207
208
  color: $
208
- }), rt = c.object({
209
+ }), nt = c.object({
209
210
  key: c.string(),
210
211
  name: c.string(),
211
- swatches: c.array(tt)
212
- }), X = (e) => {
212
+ swatches: c.array(rt)
213
+ }), ee = (e) => {
213
214
  const t = $.safeParse(e);
214
- if (t.success) return H(t.data);
215
+ if (t.success) return J(t.data);
215
216
  if (typeof e == "object" && e != null) {
216
217
  const r = Array.isArray(e) ? [] : {};
217
218
  for (const n of Object.keys(e))
218
- r[n] = X(e[n]);
219
+ r[n] = ee(e[n]);
219
220
  return r;
220
221
  }
221
222
  return e;
222
- }, zt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
223
+ }, Dt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
223
224
  __proto__: null,
224
- BLACK: Qe,
225
- WHITE: Ke,
225
+ BLACK: Ke,
226
+ WHITE: Xe,
226
227
  ZERO: z,
227
228
  aValue: x,
228
229
  bValue: v,
229
230
  colorZ: $,
230
231
  construct: d,
231
- contrast: N,
232
- crudeZ: Q,
233
- cssString: Ze,
234
- equals: V,
235
- fromGradient: et,
236
- fromHSLA: Ye,
232
+ contrast: P,
233
+ crudeZ: K,
234
+ cssString: qe,
235
+ equals: H,
236
+ fromGradient: tt,
237
+ fromHSLA: Ge,
237
238
  gValue: w,
238
- gradientZ: Xe,
239
- grayness: Fe,
240
- hex: H,
241
- hsla: ze,
242
- isColor: Re,
243
- isCrude: Pe,
244
- isDark: G,
245
- isLight: Ve,
246
- isZero: Ue,
239
+ gradientZ: et,
240
+ grayness: Be,
241
+ hex: J,
242
+ hsla: De,
243
+ isColor: Ze,
244
+ isCrude: Re,
245
+ isDark: Q,
246
+ isLight: He,
247
+ isZero: ze,
247
248
  luminance: j,
248
- paletteZ: rt,
249
- pickByContrast: Be,
249
+ paletteZ: nt,
250
+ pickByContrast: Ve,
250
251
  rValue: _,
251
- rgbCSS: qe,
252
- rgbString: Y,
253
- rgba1: We,
254
- rgbaCSS: J,
255
- setAlpha: De,
256
- stopZ: K,
257
- transformColorsToHex: X
258
- }, Symbol.toStringTag, { value: "Module" })), ee = c.number().int().min(0).max(255), te = 255, re = 0, nt = {
259
- lower: re,
260
- upper: te + 1
261
- }, ne = c.object({
252
+ rgbCSS: We,
253
+ rgbString: G,
254
+ rgba1: Ue,
255
+ rgbaCSS: Y,
256
+ setAlpha: Fe,
257
+ stopZ: X,
258
+ transformColorsToHex: ee
259
+ }, Symbol.toStringTag, { value: "Module" })), te = c.number().int().min(0).max(255), re = 255, ne = 0, st = {
260
+ lower: ne,
261
+ upper: re + 1
262
+ }, se = c.object({
262
263
  name: c.string(),
263
264
  key: c.string()
264
265
  }), S = (e) => c.object({
265
- subject: ne,
266
+ subject: se,
266
267
  resource: e,
267
- authority: ee
268
- }), st = (...e) => (t) => t.filter((r) => {
268
+ authority: te
269
+ }), ot = (...e) => (t) => t.filter((r) => {
269
270
  let n = !1;
270
271
  return r.to != null && (n = e.includes(r.to.resource)), r.from != null && !n && (n = e.includes(r.from.resource)), n;
271
- }), se = c.object({
272
+ }), oe = c.object({
272
273
  from: S(c.any()),
273
274
  to: c.null()
274
- }), oe = c.object({
275
+ }), ie = c.object({
275
276
  from: c.null(),
276
277
  to: S(c.any())
277
- }), ot = c.union([
278
- se,
278
+ }), it = c.union([
279
279
  oe,
280
+ ie,
280
281
  c.object({
281
282
  from: S(c.any()),
282
283
  to: S(c.any())
283
284
  })
284
- ]), Dt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
285
+ ]), Ft = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
285
286
  __proto__: null,
286
- ABSOLUTE_AUTHORITY: te,
287
- AUTHORITY_BOUNDS: nt,
288
- ZERO_AUTHORITY: re,
289
- acquireZ: oe,
290
- authorityZ: ee,
291
- filterTransfersByChannelKey: st,
292
- releaseZ: se,
287
+ ABSOLUTE_AUTHORITY: re,
288
+ AUTHORITY_BOUNDS: st,
289
+ ZERO_AUTHORITY: ne,
290
+ acquireZ: ie,
291
+ authorityZ: te,
292
+ filterTransfersByChannelKey: ot,
293
+ releaseZ: oe,
293
294
  stateZ: S,
294
- subjectZ: ne,
295
- transferZ: ot
296
- }, Symbol.toStringTag, { value: "Module" })), it = (e) => Object.getOwnPropertySymbols(globalThis).includes(e), at = (e, t) => {
295
+ subjectZ: se,
296
+ transferZ: it
297
+ }, Symbol.toStringTag, { value: "Module" })), at = (e) => Object.getOwnPropertySymbols(globalThis).includes(e), ct = (e, t) => {
297
298
  const r = Symbol.for(e);
298
- if (!it(r)) {
299
+ if (!at(r)) {
299
300
  const n = t();
300
301
  Object.defineProperty(globalThis, r, { value: n });
301
302
  }
302
303
  return () => globalThis[r];
303
- }, ct = (e) => (t) => t != null && typeof t == "object" && "type" in t && typeof t.type == "string" ? t.type.startsWith(e) : t instanceof Error ? t.message.startsWith(e) : typeof t != "string" ? !1 : t.startsWith(e), k = (e) => {
304
+ }, lt = (e) => (t) => t != null && typeof t == "object" && "type" in t && typeof t.type == "string" ? t.type.startsWith(e) : t instanceof Error ? t.message.startsWith(e) : typeof t != "string" ? !1 : t.startsWith(e), k = (e) => {
304
305
  var t;
305
306
  return t = class extends Error {
306
307
  constructor(s, o) {
@@ -313,8 +314,8 @@ const Ie = c.object({
313
314
  static sub(s) {
314
315
  return k(`${e}.${s}`);
315
316
  }
316
- }, m(t, "discriminator", "FreighterError"), m(t, "TYPE", e), m(t, "matches", ct(e)), t;
317
- }, ie = (e) => {
317
+ }, m(t, "discriminator", "FreighterError"), m(t, "TYPE", e), m(t, "matches", lt(e)), t;
318
+ }, ae = (e) => {
318
319
  if (e == null || typeof e != "object") return !1;
319
320
  const t = e;
320
321
  if (t.discriminator !== "FreighterError") return !1;
@@ -323,8 +324,8 @@ const Ie = c.object({
323
324
  `Freighter error is missing its type property: ${JSON.stringify(t)}`
324
325
  );
325
326
  return !0;
326
- }, g = "unknown", P = "nil";
327
- class lt {
327
+ }, g = "unknown", R = "nil";
328
+ class ut {
328
329
  constructor() {
329
330
  m(this, "providers", []);
330
331
  }
@@ -332,8 +333,8 @@ class lt {
332
333
  this.providers.push(t);
333
334
  }
334
335
  encode(t) {
335
- if (t == null) return { type: P, data: "" };
336
- if (ie(t))
336
+ if (t == null) return { type: R, data: "" };
337
+ if (ae(t))
337
338
  for (const r of this.providers) {
338
339
  const n = r.encode(t);
339
340
  if (n != null) return n;
@@ -347,43 +348,43 @@ class lt {
347
348
  }
348
349
  }
349
350
  decode(t) {
350
- if (t == null || t.type === P) return null;
351
- if (t.type === g) return new R(t.data);
351
+ if (t == null || t.type === R) return null;
352
+ if (t.type === g) return new Z(t.data);
352
353
  for (const r of this.providers) {
353
354
  const n = r.decode(t);
354
355
  if (n != null) return n;
355
356
  }
356
- return new R(t.data);
357
+ return new Z(t.data);
357
358
  }
358
359
  }
359
- const D = at("synnax-error-registry", () => new lt()), ut = ({
360
+ const D = ct("synnax-error-registry", () => new ut()), ft = ({
360
361
  encode: e,
361
362
  decode: t
362
- }) => D().register({ encode: e, decode: t }), ft = (e) => D().encode(e), dt = (e) => e == null ? null : D().decode(e);
363
- class R extends k("unknown") {
363
+ }) => D().register({ encode: e, decode: t }), dt = (e) => D().encode(e), ht = (e) => e == null ? null : D().decode(e);
364
+ class Z extends k("unknown") {
364
365
  }
365
- const ht = c.object({ type: c.string(), data: c.string() });
366
- class mt extends k("canceled") {
366
+ const mt = c.object({ type: c.string(), data: c.string() });
367
+ class pt extends k("canceled") {
367
368
  }
368
- const Ft = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
369
+ const Bt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
369
370
  __proto__: null,
370
- Canceled: mt,
371
- NONE: P,
371
+ Canceled: pt,
372
+ NONE: R,
372
373
  UNKNOWN: g,
373
- Unknown: R,
374
+ Unknown: Z,
374
375
  createTyped: k,
375
- decode: dt,
376
- encode: ft,
377
- isTyped: ie,
378
- payloadZ: ht,
379
- register: ut
380
- }, Symbol.toStringTag, { value: "Module" })), Bt = (e) => e ? -1 : 1, pt = p.object({
376
+ decode: ht,
377
+ encode: dt,
378
+ isTyped: ae,
379
+ payloadZ: mt,
380
+ register: ft
381
+ }, Symbol.toStringTag, { value: "Module" })), Vt = (e) => e ? -1 : 1, gt = p.object({
381
382
  jsonrpc: p.string(),
382
383
  id: p.number().optional(),
383
384
  method: p.string().optional(),
384
385
  params: p.unknown().optional(),
385
386
  result: p.unknown().optional()
386
- }), gt = (e) => {
387
+ }), bt = (e) => {
387
388
  const t = new TextDecoder();
388
389
  let r = new Uint8Array(0), n = null;
389
390
  return (s) => {
@@ -401,37 +402,37 @@ const Ft = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
401
402
  if (n !== null && r.length >= n) {
402
403
  const f = r.slice(0, n);
403
404
  r = r.slice(n), n = null;
404
- const l = t.decode(f), i = de.decodeString(l, pt);
405
+ const l = t.decode(f), i = he.decodeString(l, gt);
405
406
  e(i);
406
407
  } else break;
407
408
  }
408
409
  };
409
- }, bt = (e) => {
410
+ }, yt = (e) => {
410
411
  const t = JSON.stringify(e);
411
412
  return `Content-Length: ${new TextEncoder().encode(t).length}\r
412
413
  \r
413
414
  ` + t;
414
- }, Vt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
415
+ }, Ht = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
415
416
  __proto__: null,
416
- encodeMessage: bt,
417
- streamDecodeChunks: gt
418
- }, Symbol.toStringTag, { value: "Module" })), Z = c.string().regex(/^\d+\.\d+\.\d+$/), E = (e, t, r = {}) => {
417
+ encodeMessage: yt,
418
+ streamDecodeChunks: bt
419
+ }, Symbol.toStringTag, { value: "Module" })), q = c.string().regex(/^\d+\.\d+\.\d+$/), E = (e, t, r = {}) => {
419
420
  r.checkMajor ?? (r.checkMajor = !0), r.checkMinor ?? (r.checkMinor = !0), r.checkPatch ?? (r.checkPatch = !0);
420
- const n = Z.parse(e), s = Z.parse(t), [o, a, f] = n.split(".").map(Number), [l, i, u] = s.split(".").map(Number);
421
+ const n = q.parse(e), s = q.parse(t), [o, a, f] = n.split(".").map(Number), [l, i, u] = s.split(".").map(Number);
421
422
  if (r.checkMajor) {
422
- if (o < l) return C;
423
- if (o > l) return I;
423
+ if (o < l) return I;
424
+ if (o > l) return L;
424
425
  }
425
426
  if (r.checkMinor) {
426
- if (a < i) return C;
427
- if (a > i) return I;
427
+ if (a < i) return I;
428
+ if (a > i) return L;
428
429
  }
429
430
  if (r.checkPatch) {
430
- if (f < u) return C;
431
- if (f > u) return I;
431
+ if (f < u) return I;
432
+ if (f > u) return L;
432
433
  }
433
- return ge;
434
- }, yt = (e, t, r = {}) => he(E(e, t, r)), ae = (e, t, r = {}) => me(E(e, t, r)), _t = (e, t, r = {}) => pe(E(e, t, r)), wt = ({
434
+ return be;
435
+ }, _t = (e, t, r = {}) => me(E(e, t, r)), ce = (e, t, r = {}) => pe(E(e, t, r)), wt = (e, t, r = {}) => ge(E(e, t, r)), vt = ({
435
436
  name: e,
436
437
  migrate: t
437
438
  }) => (r) => {
@@ -441,7 +442,7 @@ const Ft = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
441
442
  } catch (n) {
442
443
  throw console.log(`${e} failed to migrate from ${r.version}`), console.error(n), n;
443
444
  }
444
- }, vt = ({
445
+ }, xt = ({
445
446
  name: e,
446
447
  migrations: t,
447
448
  targetSchema: r,
@@ -467,10 +468,10 @@ const Ft = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
467
468
  let f = !1;
468
469
  const l = (i) => {
469
470
  try {
470
- if (a === 0 || ae(i.version, o))
471
+ if (a === 0 || ce(i.version, o))
471
472
  return console.log(f ? `${e} ${i.version} now up to date` : `${e} version ${i.version} is up to date with target version ${s.version}`), i;
472
- const u = i.version, h = t[u], A = h(i);
473
- return f = !0, l(A);
473
+ const u = i.version, h = t[u], C = h(i);
474
+ return f = !0, l(C);
474
475
  } catch (u) {
475
476
  return console.log(
476
477
  `${e} failed to migrate from ${i.version} to ${o}`
@@ -493,16 +494,16 @@ const Ft = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
493
494
  return console.log(`${e} failed to parse final result. Exiting with default`), console.error(u), s;
494
495
  }
495
496
  };
496
- }, Ht = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
497
+ }, Jt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
497
498
  __proto__: null,
498
499
  compareSemVer: E,
499
- createMigration: wt,
500
- migrator: vt,
501
- semVerNewer: ae,
502
- semVerOlder: _t,
503
- semVerZ: Z,
504
- versionsEqual: yt
505
- }, Symbol.toStringTag, { value: "Module" })), ce = ["standard", "scientific", "engineering"], xt = c.enum(ce), St = (e, t, r) => {
500
+ createMigration: vt,
501
+ migrator: xt,
502
+ semVerNewer: ce,
503
+ semVerOlder: wt,
504
+ semVerZ: q,
505
+ versionsEqual: _t
506
+ }, Symbol.toStringTag, { value: "Module" })), le = ["standard", "scientific", "engineering"], St = c.enum(le), $t = (e, t, r) => {
506
507
  if (Number.isNaN(e)) return "NaN";
507
508
  if (e === 1 / 0) return "∞";
508
509
  if (e === -1 / 0) return "-∞";
@@ -511,26 +512,26 @@ const Ft = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
511
512
  return t === 0 ? "0ᴇ0" : `0.${"0".repeat(t)}ᴇ0`;
512
513
  let n;
513
514
  return r === "scientific" ? n = Math.floor(Math.log10(Math.abs(e))) : n = Math.floor(Math.log10(Math.abs(e)) / 3) * 3, `${(e / 10 ** n).toFixed(t)}ᴇ${n}`;
514
- }, Jt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
515
+ }, Yt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
515
516
  __proto__: null,
516
- NOTATIONS: ce,
517
- notationZ: xt,
518
- stringifyNumber: St
519
- }, Symbol.toStringTag, { value: "Module" })), Yt = (e) => {
517
+ NOTATIONS: le,
518
+ notationZ: St,
519
+ stringifyNumber: $t
520
+ }, Symbol.toStringTag, { value: "Module" })), Gt = (e) => {
520
521
  if (e === void 0 || typeof e == "string" || typeof e == "number")
521
522
  return e;
522
523
  if (e.toString === void 0) throw new Error("invalid renderer");
523
524
  return e.toString();
524
- }, Gt = (e) => Array.isArray(e) ? [...e] : typeof e == "object" && e !== null ? { ...e } : e, $t = (e, t = "") => {
525
+ }, Qt = (e) => Array.isArray(e) ? [...e] : typeof e == "object" && e !== null ? { ...e } : e, Et = (e, t = "") => {
525
526
  const r = e.length;
526
527
  return r === 0 ? t : r === 1 ? e[0] : r === 2 ? `${e[0]} and ${e[1]}` : `${e.slice(0, -1).join(", ")}, and ${e[r - 1]}`;
527
- }, Et = (e) => {
528
+ }, Mt = (e) => {
528
529
  const t = e.split(" "), r = /* @__PURE__ */ new Set(), n = t.map((l) => l.charAt(0).toLowerCase()).join("");
529
530
  r.add(n.replace(/-/g, "_")), r.add(n.replace(/(.)(.)/g, "$1_$2").replace(/-/g, "_"));
530
531
  const s = /\d+/g;
531
532
  e.match(s) && t.forEach((l, i) => {
532
533
  if (s.test(l)) {
533
- const u = t.map((h, A) => A !== i ? h.charAt(0).toLowerCase() : h).join("");
534
+ const u = t.map((h, C) => C !== i ? h.charAt(0).toLowerCase() : h).join("");
534
535
  r.add(u.replace(/-/g, "_")), r.add(
535
536
  u.replace(/(.)(.)/g, "$1_$2").replace(/-/g, "_")
536
537
  );
@@ -542,12 +543,12 @@ const Ft = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
542
543
  return r.add(a.join("").replace(/-/g, "_")), r.add(a.join("_").replace(/-/g, "_")), Array.from(r).filter(
543
544
  (l) => l.length >= 2 && l.length <= 12 && !/^\d/.test(l)
544
545
  );
545
- }, Qt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
546
+ }, Kt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
546
547
  __proto__: null,
547
- createShortIdentifiers: Et,
548
- naturalLanguageJoin: $t
549
- }, Symbol.toStringTag, { value: "Module" })), Mt = new Error("request for lock canceled");
550
- var Tt = function(e, t, r, n) {
548
+ createShortIdentifiers: Mt,
549
+ naturalLanguageJoin: Et
550
+ }, Symbol.toStringTag, { value: "Module" })), Tt = new Error("request for lock canceled");
551
+ var jt = function(e, t, r, n) {
551
552
  function s(o) {
552
553
  return o instanceof r ? o : new r(function(a) {
553
554
  a(o);
@@ -574,20 +575,20 @@ var Tt = function(e, t, r, n) {
574
575
  i((n = n.apply(e, t || [])).next());
575
576
  });
576
577
  };
577
- class jt {
578
- constructor(t, r = Mt) {
578
+ class Ot {
579
+ constructor(t, r = Tt) {
579
580
  this._value = t, this._cancelError = r, this._queue = [], this._weightedWaiters = [];
580
581
  }
581
582
  acquire(t = 1, r = 0) {
582
583
  if (t <= 0)
583
584
  throw new Error(`invalid weight ${t}: must be positive`);
584
585
  return new Promise((n, s) => {
585
- const o = { resolve: n, reject: s, weight: t, priority: r }, a = le(this._queue, (f) => r <= f.priority);
586
+ const o = { resolve: n, reject: s, weight: t, priority: r }, a = ue(this._queue, (f) => r <= f.priority);
586
587
  a === -1 && t <= this._value ? this._dispatchItem(o) : this._queue.splice(a + 1, 0, o);
587
588
  });
588
589
  }
589
590
  runExclusive(t) {
590
- return Tt(this, arguments, void 0, function* (r, n = 1, s = 0) {
591
+ return jt(this, arguments, void 0, function* (r, n = 1, s = 0) {
591
592
  const [o, a] = yield this.acquire(n, s);
592
593
  try {
593
594
  return yield r(o);
@@ -656,16 +657,16 @@ class jt {
656
657
  }
657
658
  }
658
659
  function kt(e, t) {
659
- const r = le(e, (n) => t.priority <= n.priority);
660
+ const r = ue(e, (n) => t.priority <= n.priority);
660
661
  e.splice(r + 1, 0, t);
661
662
  }
662
- function le(e, t) {
663
+ function ue(e, t) {
663
664
  for (let r = e.length - 1; r >= 0; r--)
664
665
  if (t(e[r]))
665
666
  return r;
666
667
  return -1;
667
668
  }
668
- var Ot = function(e, t, r, n) {
669
+ var At = function(e, t, r, n) {
669
670
  function s(o) {
670
671
  return o instanceof r ? o : new r(function(a) {
671
672
  a(o);
@@ -692,12 +693,12 @@ var Ot = function(e, t, r, n) {
692
693
  i((n = n.apply(e, t || [])).next());
693
694
  });
694
695
  };
695
- class At {
696
+ class Ct {
696
697
  constructor(t) {
697
- this._semaphore = new jt(1, t);
698
+ this._semaphore = new Ot(1, t);
698
699
  }
699
700
  acquire() {
700
- return Ot(this, arguments, void 0, function* (t = 0) {
701
+ return At(this, arguments, void 0, function* (t = 0) {
701
702
  const [, r] = yield this._semaphore.acquire(1, t);
702
703
  return r;
703
704
  });
@@ -718,85 +719,85 @@ class At {
718
719
  return this._semaphore.cancel();
719
720
  }
720
721
  }
721
- class O extends At {
722
+ class A extends Ct {
722
723
  static new(t) {
723
- return new O(t);
724
+ return new A(t);
724
725
  }
725
726
  constructor(t) {
726
727
  super(), Object.assign(this, t);
727
728
  }
728
729
  }
729
- const Ct = (e) => new O(e), Kt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
730
+ const It = (e) => new A(e), Xt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
730
731
  __proto__: null,
731
- mutex: O,
732
- newMutex: Ct
732
+ mutex: A,
733
+ newMutex: It
733
734
  }, Symbol.toStringTag, { value: "Module" }));
734
735
  export {
735
- nr as DataType,
736
- sr as Density,
737
- or as MultiSeries,
738
- ir as Rate,
739
- xn as RoutedWorker,
740
- Qr as Search,
741
- ar as Series,
742
- cr as Size,
743
- lr as TimeRange,
736
+ sr as DataType,
737
+ or as Density,
738
+ ir as MultiSeries,
739
+ ar as Rate,
740
+ Sn as RoutedWorker,
741
+ Kr as Search,
742
+ cr as Series,
743
+ lr as Size,
744
+ ur as TimeRange,
744
745
  y as TimeSpan,
745
- ur as TimeStamp,
746
- Sn as TypedWorker,
747
- _n as URL,
748
- fr as addSamples,
749
- tr as binary,
750
- Ur as bounds,
751
- Xr as box,
752
- Ut as breaker,
753
- wn as buildQueryString,
754
- _r as caseconv,
755
- vr as change,
756
- Sr as clamp,
757
- zt as color,
758
- Mr as compare,
759
- Dt as control,
760
- dr as convertDataType,
761
- Yt as convertRenderV,
762
- $n as createMockWorkers,
763
- Or as debounce,
764
- Ir as deep,
765
- tn as dimensions,
766
- nn as direction,
767
- Ft as errors,
768
- Br as getEntries,
769
- hr as id,
770
- Bt as invert,
771
- mr as isCrudeSeries,
772
- Nr as isObject,
773
- Tr as isStringer,
774
- pr as isTelemValue,
775
- Vt as jsonRPC,
776
- Rr as kv,
777
- qr as link,
778
- on as location,
779
- Vr as mapValues,
780
- qt as math,
781
- Ht as migrate,
782
- Jt as notation,
783
- mn as nullToArr,
784
- Dr as observe,
785
- cn as position,
786
- jr as primitiveIsZero,
787
- Yr as runtime,
788
- $r as scale,
789
- Gt as shallowCopy,
790
- Wt as sleep,
791
- gr as sortTimeRange,
792
- un as spatial,
793
- Qt as strings,
794
- Kt as sync,
795
- Ar as throttle,
796
- pn as toArray,
797
- br as typedArrayZ,
798
- bn as unique,
799
- Hr as unknownRecordZ,
800
- dn as xy,
801
- Mn as zod
746
+ fr as TimeStamp,
747
+ $n as TypedWorker,
748
+ wn as URL,
749
+ dr as addSamples,
750
+ rr as binary,
751
+ zr as bounds,
752
+ en as box,
753
+ zt as breaker,
754
+ vn as buildQueryString,
755
+ wr as caseconv,
756
+ xr as change,
757
+ $r as clamp,
758
+ Dt as color,
759
+ Tr as compare,
760
+ Ft as control,
761
+ hr as convertDataType,
762
+ Gt as convertRenderV,
763
+ En as createMockWorkers,
764
+ Ar as debounce,
765
+ Lr as deep,
766
+ rn as dimensions,
767
+ sn as direction,
768
+ Bt as errors,
769
+ Vr as getEntries,
770
+ mr as id,
771
+ Vt as invert,
772
+ pr as isCrudeSeries,
773
+ Pr as isObject,
774
+ jr as isStringer,
775
+ gr as isTelemValue,
776
+ Ht as jsonRPC,
777
+ Zr as kv,
778
+ Wr as link,
779
+ an as location,
780
+ Hr as mapValues,
781
+ Wt as math,
782
+ Jt as migrate,
783
+ Yt as notation,
784
+ pn as nullToArr,
785
+ Fr as observe,
786
+ ln as position,
787
+ Or as primitiveIsZero,
788
+ Gr as runtime,
789
+ Er as scale,
790
+ Qt as shallowCopy,
791
+ Ut as sleep,
792
+ br as sortTimeRange,
793
+ fn as spatial,
794
+ Kt as strings,
795
+ Xt as sync,
796
+ Cr as throttle,
797
+ gn as toArray,
798
+ yr as typedArrayZ,
799
+ yn as unique,
800
+ Jr as unknownRecordZ,
801
+ hn as xy,
802
+ Tn as zod
802
803
  };