@synnaxlabs/x 0.34.0 → 0.36.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.
Files changed (118) hide show
  1. package/.turbo/turbo-build.log +30 -30
  2. package/dist/bounds-8aFLdbEj.cjs +1 -0
  3. package/dist/{bounds-CFI9wDXn.js → bounds-BtccGJW0.js} +22 -18
  4. package/dist/bounds.cjs +1 -1
  5. package/dist/bounds.js +1 -1
  6. package/dist/{box-Mf8E1Ypp.cjs → box-BpSX4si6.cjs} +1 -1
  7. package/dist/{box-DVCNGsJG.js → box-CYXc9-qp.js} +2 -2
  8. package/dist/box.cjs +1 -1
  9. package/dist/box.js +1 -1
  10. package/dist/deep.cjs +1 -1
  11. package/dist/deep.js +1 -1
  12. package/dist/index.cjs +2 -2
  13. package/dist/index.js +169 -151
  14. package/dist/location-Cn1ByVTZ.js +95 -0
  15. package/dist/location-DLP2ZS0o.cjs +1 -0
  16. package/dist/location.cjs +1 -1
  17. package/dist/location.js +1 -1
  18. package/dist/path-1tZLZ4AN.cjs +1 -0
  19. package/dist/path-DD6ytXzr.js +76 -0
  20. package/dist/{position-CFc9RsSn.js → position-DJXB-pDS.js} +2 -2
  21. package/dist/{position-DKhPhvPh.cjs → position-JCN6-sJC.cjs} +1 -1
  22. package/dist/position.cjs +1 -1
  23. package/dist/position.js +1 -1
  24. package/dist/record.cjs +1 -1
  25. package/dist/record.js +5 -4
  26. package/dist/scale-BI4wJF3b.cjs +1 -0
  27. package/dist/{scale-DNQE1LMm.js → scale-rZ1YKDFy.js} +70 -67
  28. package/dist/scale.cjs +1 -1
  29. package/dist/scale.js +1 -1
  30. package/dist/series-BN9CILsQ.cjs +11 -0
  31. package/dist/{series-sjWkW8qe.js → series-CnEQe1dh.js} +473 -370
  32. package/dist/spatial.cjs +1 -1
  33. package/dist/spatial.js +6 -6
  34. package/dist/src/breaker/breaker.d.ts +33 -0
  35. package/dist/src/breaker/breaker.d.ts.map +1 -0
  36. package/dist/src/breaker/breaker.spec.d.ts +2 -0
  37. package/dist/src/breaker/breaker.spec.d.ts.map +1 -0
  38. package/dist/src/breaker/index.d.ts +2 -0
  39. package/dist/src/breaker/index.d.ts.map +1 -0
  40. package/dist/src/change/change.d.ts +5 -5
  41. package/dist/src/change/change.d.ts.map +1 -1
  42. package/dist/src/control/control.d.ts +5 -5
  43. package/dist/src/control/control.d.ts.map +1 -1
  44. package/dist/src/deep/path.d.ts.map +1 -1
  45. package/dist/src/index.d.ts +1 -0
  46. package/dist/src/index.d.ts.map +1 -1
  47. package/dist/src/mock/MockGLBufferController.d.ts +2 -2
  48. package/dist/src/mock/MockGLBufferController.d.ts.map +1 -1
  49. package/dist/src/record.d.ts +1 -0
  50. package/dist/src/record.d.ts.map +1 -1
  51. package/dist/src/record.spec.d.ts +2 -0
  52. package/dist/src/record.spec.d.ts.map +1 -0
  53. package/dist/src/sleep/index.d.ts +2 -0
  54. package/dist/src/sleep/index.d.ts.map +1 -0
  55. package/dist/src/sleep/sleep.d.ts +3 -0
  56. package/dist/src/sleep/sleep.d.ts.map +1 -0
  57. package/dist/src/spatial/bounds/bounds.d.ts +12 -0
  58. package/dist/src/spatial/bounds/bounds.d.ts.map +1 -1
  59. package/dist/src/spatial/location/location.d.ts +1 -0
  60. package/dist/src/spatial/location/location.d.ts.map +1 -1
  61. package/dist/src/spatial/scale/scale.d.ts +17 -1
  62. package/dist/src/spatial/scale/scale.d.ts.map +1 -1
  63. package/dist/src/spatial/xy/xy.d.ts +36 -1
  64. package/dist/src/spatial/xy/xy.d.ts.map +1 -1
  65. package/dist/src/telem/gl.d.ts +2 -2
  66. package/dist/src/telem/gl.d.ts.map +1 -1
  67. package/dist/src/telem/series.d.ts +16 -9
  68. package/dist/src/telem/series.d.ts.map +1 -1
  69. package/dist/src/telem/telem.d.ts +43 -2
  70. package/dist/src/telem/telem.d.ts.map +1 -1
  71. package/dist/src/zodutil/zodutil.d.ts.map +1 -1
  72. package/dist/telem.cjs +1 -1
  73. package/dist/telem.js +11 -10
  74. package/dist/xy-DQdccWlc.js +128 -0
  75. package/dist/xy-LADI2wVU.cjs +1 -0
  76. package/dist/xy.cjs +1 -1
  77. package/dist/xy.js +1 -1
  78. package/dist/zodutil-BRjUdYAv.cjs +1 -0
  79. package/dist/{zodutil-Tmuc4CNq.js → zodutil-DI4gVZkT.js} +11 -11
  80. package/dist/zodutil.cjs +1 -1
  81. package/dist/zodutil.js +1 -1
  82. package/package.json +64 -65
  83. package/src/binary/encoder.ts +3 -3
  84. package/src/breaker/breaker.spec.ts +74 -0
  85. package/src/breaker/breaker.ts +32 -0
  86. package/src/breaker/index.ts +1 -0
  87. package/src/deep/path.ts +6 -1
  88. package/src/index.ts +1 -0
  89. package/src/mock/MockGLBufferController.ts +6 -6
  90. package/src/record.spec.ts +29 -0
  91. package/src/record.ts +6 -0
  92. package/src/sleep/index.ts +1 -0
  93. package/src/sleep/sleep.ts +6 -0
  94. package/src/spatial/bounds/bounds.spec.ts +6 -0
  95. package/src/spatial/bounds/bounds.ts +16 -0
  96. package/src/spatial/location/location.ts +1 -0
  97. package/src/spatial/scale/scale.spec.ts +62 -51
  98. package/src/spatial/scale/scale.ts +21 -12
  99. package/src/spatial/xy/xy.spec.ts +22 -1
  100. package/src/spatial/xy/xy.ts +101 -5
  101. package/src/strings/strings.spec.ts +0 -4
  102. package/src/telem/gl.ts +6 -2
  103. package/src/telem/series.spec.ts +3 -3
  104. package/src/telem/series.ts +45 -16
  105. package/src/telem/telem.ts +121 -2
  106. package/src/zodutil/zodutil.ts +4 -1
  107. package/tsconfig.json +1 -1
  108. package/tsconfig.tsbuildinfo +1 -1
  109. package/dist/bounds-DzCDHgdE.cjs +0 -1
  110. package/dist/location-CI9x53qR.js +0 -94
  111. package/dist/location-DetomF8Z.cjs +0 -1
  112. package/dist/path-BBCx3K6k.cjs +0 -1
  113. package/dist/path-CmnoH3RC.js +0 -72
  114. package/dist/scale-CT61XD_X.cjs +0 -1
  115. package/dist/series-DWLXo7J6.cjs +0 -11
  116. package/dist/xy-CrgPnICw.js +0 -89
  117. package/dist/xy-cP-FXJtR.cjs +0 -1
  118. package/dist/zodutil-C6RYzvXd.cjs +0 -1
package/dist/index.js CHANGED
@@ -1,59 +1,60 @@
1
- var j = Object.defineProperty;
2
- var T = (e, t, r) => t in e ? j(e, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[t] = r;
1
+ var M = Object.defineProperty;
2
+ var T = (e, t, r) => t in e ? M(e, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[t] = r;
3
3
  var p = (e, t, r) => T(e, typeof t != "symbol" ? t + "" : t, r);
4
- import { e as X } from "./index-BBa2mWG1.js";
5
- import { a as ee } from "./index-eue4dSQX.js";
6
- import { c as te } from "./change-DLl6DccR.js";
7
- import { c as ne, s as se } from "./scale-DNQE1LMm.js";
8
- import { L as S, G as y, E as w, i as A, a as k, b as O } from "./index-HQonyH7n.js";
9
- import { c as ae, d as ce, p as le } from "./index-HQonyH7n.js";
4
+ import { e as ne } from "./index-BBa2mWG1.js";
5
+ import { a as ie } from "./index-eue4dSQX.js";
6
+ import { c as ce } from "./change-DLl6DccR.js";
7
+ import { c as ue, s as fe } from "./scale-rZ1YKDFy.js";
8
+ import { L as S, G as v, E as k, i as A, a as _, b as O } from "./index-HQonyH7n.js";
9
+ import { c as de, d as pe, p as ge } from "./index-HQonyH7n.js";
10
10
  import { z as c } from "zod";
11
- import { debounce as ue, throttle as me } from "./debounce.js";
12
- import { deep as pe } from "./deep.js";
13
- import { d as be, D as he, M as xe, R as Se, S as ye, e as $e, c as ve, b as Ee, T as Me, a as je, g as Te, h as we, i as Ae, f as ke, t as Oe } from "./series-sjWkW8qe.js";
14
- import { isObject as _e } from "./identity.js";
15
- import { t as Ne } from "./types-BpAJW2TM.js";
16
- import { b as Pe, f as Ge } from "./bounds-CFI9wDXn.js";
17
- import { observe as De } from "./observe.js";
18
- import { getEntries as Ie, unknownRecordZ as Ve } from "./record.js";
19
- import { e as qe } from "./external-sVtvYJS6.js";
20
- import { Search as He } from "./search.js";
21
- import { b as Ue } from "./box-DVCNGsJG.js";
22
- import { d as Ke } from "./dimensions-D-1PnJVI.js";
23
- import { d as Xe } from "./direction-CScbfCdT.js";
24
- import { l as er } from "./location-CI9x53qR.js";
25
- import { p as tr } from "./position-CFc9RsSn.js";
26
- import { s as nr } from "./spatial-DozyssiN.js";
27
- import { x as ir } from "./xy-CrgPnICw.js";
28
- import { nullToArr as cr, toArray as lr } from "./toArray.js";
29
- import { unique as ur } from "./unique.js";
30
- import { URL as dr, buildQueryString as pr } from "./url.js";
31
- import { RoutedWorker as br, TypedWorker as hr, createMockWorkers as xr } from "./worker.js";
32
- import { z as yr } from "./zodutil-Tmuc4CNq.js";
33
- const l = class l extends Number {
11
+ import { debounce as xe, throttle as he } from "./debounce.js";
12
+ import { deep as Se } from "./deep.js";
13
+ import { b as x } from "./series-CnEQe1dh.js";
14
+ import { d as $e, D as Ee, M as je, R as we, S as Me, e as Te, c as ke, T as Ae, a as _e, g as Oe, h as Re, i as ze, f as Le, s as Ne, t as Pe } from "./series-CnEQe1dh.js";
15
+ import { isObject as Ge } from "./identity.js";
16
+ import { t as Ze } from "./types-BpAJW2TM.js";
17
+ import { b as Ie, f as We } from "./bounds-BtccGJW0.js";
18
+ import { observe as Be } from "./observe.js";
19
+ import { getEntries as He, mapValues as Qe, unknownRecordZ as Ue } from "./record.js";
20
+ import { e as Ke } from "./external-sVtvYJS6.js";
21
+ import { Search as Ye } from "./search.js";
22
+ import { b as rr } from "./box-CYXc9-qp.js";
23
+ import { d as or } from "./dimensions-D-1PnJVI.js";
24
+ import { d as sr } from "./direction-CScbfCdT.js";
25
+ import { l as ar } from "./location-Cn1ByVTZ.js";
26
+ import { p as lr } from "./position-DJXB-pDS.js";
27
+ import { s as fr } from "./spatial-DozyssiN.js";
28
+ import { x as dr } from "./xy-DQdccWlc.js";
29
+ import { nullToArr as gr, toArray as br } from "./toArray.js";
30
+ import { unique as hr } from "./unique.js";
31
+ import { URL as Sr, buildQueryString as vr } from "./url.js";
32
+ import { RoutedWorker as Er, TypedWorker as jr, createMockWorkers as wr } from "./worker.js";
33
+ import { z as Tr } from "./zodutil-DI4gVZkT.js";
34
+ const u = class u extends Number {
34
35
  };
35
- p(l, "Absolute", 255), p(l, "Default", 1), p(l, "z", c.union([
36
- c.instanceof(l),
37
- c.number().int().min(0).max(255).transform((t) => new l(t)),
38
- c.instanceof(Number).transform((t) => new l(t))
36
+ p(u, "Absolute", 255), p(u, "Default", 1), p(u, "z", c.union([
37
+ c.instanceof(u),
38
+ c.number().int().min(0).max(255).transform((t) => new u(t)),
39
+ c.instanceof(Number).transform((t) => new u(t))
39
40
  ]));
40
- let h = l;
41
- const E = c.object({
41
+ let h = u;
42
+ const j = c.object({
42
43
  name: c.string(),
43
44
  key: c.string()
44
- }), L = (e) => c.object({
45
- subject: E,
45
+ }), R = (e) => c.object({
46
+ subject: j,
46
47
  resource: e,
47
48
  authority: h.z
48
- }), _ = (...e) => (t) => t.filter((r) => {
49
+ }), z = (...e) => (t) => t.filter((r) => {
49
50
  let n = !1;
50
51
  return r.to != null && (n = e.includes(r.to.resource)), r.from != null && !n && (n = e.includes(r.from.resource)), n;
51
- }), W = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
52
+ }), Q = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
52
53
  __proto__: null,
53
54
  Authority: h,
54
- filterTransfersByChannelKey: _,
55
- stateZ: L,
56
- subjectZ: E
55
+ filterTransfersByChannelKey: z,
56
+ stateZ: R,
57
+ subjectZ: j
57
58
  }, Symbol.toStringTag, { value: "Module" })), m = class m extends Error {
58
59
  constructor() {
59
60
  super(m.MESSAGE);
@@ -65,26 +66,26 @@ const E = c.object({
65
66
  };
66
67
  p(m, "MESSAGE", "canceled");
67
68
  let $ = m;
68
- const z = new $(), q = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
69
+ const L = new $(), U = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
69
70
  __proto__: null,
70
- CANCELED: z
71
- }, Symbol.toStringTag, { value: "Module" })), B = (e) => e ? -1 : 1, v = c.string().regex(/^\d+\.\d+\.\d+$/), g = (e, t, r = {}) => {
71
+ CANCELED: L
72
+ }, Symbol.toStringTag, { value: "Module" })), J = (e) => e ? -1 : 1, E = c.string().regex(/^\d+\.\d+\.\d+$/), g = (e, t, r = {}) => {
72
73
  r.checkMajor ?? (r.checkMajor = !0), r.checkMinor ?? (r.checkMinor = !0), r.checkPatch ?? (r.checkPatch = !0);
73
- const n = v.parse(e), i = v.parse(t), [f, u, d] = n.split(".").map(Number), [s, o, a] = i.split(".").map(Number);
74
+ const n = E.parse(e), s = E.parse(t), [l, f, d] = n.split(".").map(Number), [i, o, a] = s.split(".").map(Number);
74
75
  if (r.checkMajor) {
75
- if (f < s) return S;
76
- if (f > s) return y;
76
+ if (l < i) return S;
77
+ if (l > i) return v;
77
78
  }
78
79
  if (r.checkMinor) {
79
- if (u < o) return S;
80
- if (u > o) return y;
80
+ if (f < o) return S;
81
+ if (f > o) return v;
81
82
  }
82
83
  if (r.checkPatch) {
83
84
  if (d < a) return S;
84
- if (d > a) return y;
85
+ if (d > a) return v;
85
86
  }
86
- return w;
87
- }, N = (e, t, r = {}) => A(g(e, t, r)), M = (e, t, r = {}) => k(g(e, t, r)), R = (e, t, r = {}) => O(g(e, t, r)), P = ({
87
+ return k;
88
+ }, N = (e, t, r = {}) => A(g(e, t, r)), w = (e, t, r = {}) => _(g(e, t, r)), P = (e, t, r = {}) => O(g(e, t, r)), C = ({
88
89
  name: e,
89
90
  migrate: t
90
91
  }) => (r) => {
@@ -99,35 +100,35 @@ const z = new $(), q = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defi
99
100
  migrations: t,
100
101
  targetSchema: r,
101
102
  defaultVersion: n,
102
- def: i
103
+ def: s
103
104
  }) => {
104
- const f = Object.keys(t).sort(g).pop();
105
- if (f == null)
105
+ const l = Object.keys(t).sort(g).pop();
106
+ if (l == null)
106
107
  return (o) => {
107
- if (o.version ?? (o.version = n), o.version !== i.version)
108
+ if (o.version ?? (o.version = n), o.version !== s.version)
108
109
  return console.log(
109
- `${e} version ${o.version} is newer than latest version of ${i.version}.
110
+ `${e} version ${o.version} is newer than latest version of ${s.version}.
110
111
  Returning default instead.
111
112
  `
112
- ), i;
113
+ ), s;
113
114
  try {
114
115
  return r != null ? r.parse(o) : o;
115
116
  } catch (a) {
116
- return console.log(`${e} failed to parse default. Exiting with default`), console.error(a), i;
117
+ return console.log(`${e} failed to parse default. Exiting with default`), console.error(a), s;
117
118
  }
118
119
  };
119
- const u = Object.keys(t).length;
120
+ const f = Object.keys(t).length;
120
121
  let d = !1;
121
- const s = (o) => {
122
+ const i = (o) => {
122
123
  try {
123
- if (u === 0 || M(o.version, f))
124
- return console.log(d ? `${e} ${o.version} now up to date` : `${e} version ${o.version} is up to date with target version ${i.version}`), o;
125
- const a = o.version, b = t[a], x = b(o);
126
- return d = !0, s(x);
124
+ if (f === 0 || w(o.version, l))
125
+ return console.log(d ? `${e} ${o.version} now up to date` : `${e} version ${o.version} is up to date with target version ${s.version}`), o;
126
+ const a = o.version, b = t[a], y = b(o);
127
+ return d = !0, i(y);
127
128
  } catch (a) {
128
129
  return console.log(
129
- `${e} failed to migrate from ${o.version} to ${f}`
130
- ), console.error(a), i;
130
+ `${e} failed to migrate from ${o.version} to ${l}`
131
+ ), console.error(a), s;
131
132
  }
132
133
  };
133
134
  return (o) => {
@@ -140,107 +141,124 @@ const z = new $(), q = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defi
140
141
  else
141
142
  return console.log(
142
143
  `${e} version is null and no default version set. Exiting with default`
143
- ), i;
144
- return s(o);
144
+ ), s;
145
+ return i(o);
145
146
  } catch (a) {
146
- return console.log(`${e} failed to parse final result. Exiting with default`), console.error(a), i;
147
+ return console.log(`${e} failed to parse final result. Exiting with default`), console.error(a), s;
147
148
  }
148
149
  };
149
- }, H = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
150
+ }, K = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
150
151
  __proto__: null,
151
152
  compareSemVer: g,
152
- createMigration: P,
153
+ createMigration: C,
153
154
  migrator: G,
154
- semVerNewer: M,
155
- semVerOlder: R,
156
- semVerZ: v,
155
+ semVerNewer: w,
156
+ semVerOlder: P,
157
+ semVerZ: E,
157
158
  versionsEqual: N
158
- }, Symbol.toStringTag, { value: "Module" })), Q = (e) => {
159
+ }, Symbol.toStringTag, { value: "Module" })), X = (e) => {
159
160
  if (e === void 0 || typeof e == "string" || typeof e == "number")
160
161
  return e;
161
162
  if (e.toString === void 0) throw new Error("invalid renderer");
162
163
  return e.toString();
163
- }, U = (e) => Array.isArray(e) ? [...e] : typeof e == "object" && e !== null ? { ...e } : e, C = (e, t = "") => {
164
+ }, Y = (e) => Array.isArray(e) ? [...e] : typeof e == "object" && e !== null ? { ...e } : e, D = (e, t = "") => {
164
165
  const r = e.length;
165
166
  return r === 0 ? t : r === 1 ? e[0] : r === 2 ? `${e[0]} and ${e[1]}` : `${e.slice(0, -1).join(", ")}, and ${e[r - 1]}`;
166
- }, D = (e) => {
167
- const t = e.split(" "), r = /* @__PURE__ */ new Set(), n = t.map((s) => s.charAt(0).toLowerCase()).join("");
167
+ }, Z = (e) => {
168
+ const t = e.split(" "), r = /* @__PURE__ */ new Set(), n = t.map((i) => i.charAt(0).toLowerCase()).join("");
168
169
  r.add(n), r.add(n.replace(/(.)(.)/g, "$1_$2"));
169
- const i = /\d+/g;
170
- e.match(i) && t.forEach((s, o) => {
171
- if (i.test(s)) {
172
- const a = t.map((b, x) => x !== o ? b.charAt(0).toLowerCase() : b).join("");
170
+ const s = /\d+/g;
171
+ e.match(s) && t.forEach((i, o) => {
172
+ if (s.test(i)) {
173
+ const a = t.map((b, y) => y !== o ? b.charAt(0).toLowerCase() : b).join("");
173
174
  r.add(a), r.add(a.replace(/(.)(.)/g, "$1_$2"));
174
175
  }
175
176
  });
176
- const u = t.map(
177
- (s) => (s.length > 3 ? s.substring(0, 3) : s).toLowerCase()
177
+ const f = t.map(
178
+ (i) => (i.length > 3 ? i.substring(0, 3) : i).toLowerCase()
178
179
  );
179
- return r.add(u.join("")), r.add(u.join("_")), Array.from(r).filter(
180
- (s) => s.length >= 2 && s.length <= 12
180
+ return r.add(f.join("")), r.add(f.join("_")), Array.from(r).filter(
181
+ (i) => i.length >= 2 && i.length <= 12
181
182
  );
182
- }, J = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
183
+ }, ee = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
183
184
  __proto__: null,
184
- generateShortIdentifiers: D,
185
- naturalLanguageJoin: C
185
+ generateShortIdentifiers: Z,
186
+ naturalLanguageJoin: D
187
+ }, Symbol.toStringTag, { value: "Module" })), V = async (e) => await new Promise(
188
+ (t) => setTimeout(t, x.fromMilliseconds(e).milliseconds)
189
+ ), I = c.object({
190
+ interval: x.z.optional(),
191
+ maxRetries: c.number().optional(),
192
+ scale: c.number().optional()
193
+ }), W = (e = {}) => {
194
+ const t = e.sleepFn || V, r = e.maxRetries ?? 5, n = e.scale ?? 1;
195
+ let s = 0, l = new x(e.interval ?? x.milliseconds(1));
196
+ return async () => s >= r ? !1 : (await t(l), l = l.mult(n), s++, !0);
197
+ }, re = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
198
+ __proto__: null,
199
+ breakerConfig: I,
200
+ create: W
186
201
  }, Symbol.toStringTag, { value: "Module" }));
187
202
  export {
188
- be as DataType,
189
- he as Density,
190
- xe as MultiSeries,
191
- Se as Rate,
192
- br as RoutedWorker,
193
- He as Search,
194
- ye as Series,
195
- $e as Size,
196
- ve as TimeRange,
197
- Ee as TimeSpan,
198
- Me as TimeStamp,
199
- hr as TypedWorker,
200
- dr as URL,
201
- je as addSamples,
202
- X as binary,
203
- Pe as bounds,
204
- Ue as box,
205
- pr as buildQueryString,
206
- ee as caseconv,
207
- te as change,
208
- ne as clamp,
209
- ae as compare,
210
- W as control,
211
- Te as convertDataType,
212
- Q as convertRenderV,
213
- xr as createMockWorkers,
214
- ue as debounce,
215
- pe as deep,
216
- Ke as dimensions,
217
- Xe as direction,
218
- q as errors,
219
- Ie as getEntries,
220
- we as id,
221
- B as invert,
222
- Ae as isCrudeSeries,
223
- _e as isObject,
224
- ce as isStringer,
225
- ke as isTelemValue,
226
- Ne as kv,
227
- er as location,
228
- Ge as math,
229
- H as migrate,
230
- cr as nullToArr,
231
- De as observe,
232
- tr as position,
233
- le as primitiveIsZero,
234
- qe as runtime,
235
- se as scale,
236
- U as shallowCopy,
237
- nr as spatial,
238
- J as strings,
239
- me as throttle,
240
- lr as toArray,
241
- Oe as typedArrayZ,
242
- ur as unique,
243
- Ve as unknownRecordZ,
244
- ir as xy,
245
- yr as zodutil
203
+ $e as DataType,
204
+ Ee as Density,
205
+ je as MultiSeries,
206
+ we as Rate,
207
+ Er as RoutedWorker,
208
+ Ye as Search,
209
+ Me as Series,
210
+ Te as Size,
211
+ ke as TimeRange,
212
+ x as TimeSpan,
213
+ Ae as TimeStamp,
214
+ jr as TypedWorker,
215
+ Sr as URL,
216
+ _e as addSamples,
217
+ ne as binary,
218
+ Ie as bounds,
219
+ rr as box,
220
+ re as breaker,
221
+ vr as buildQueryString,
222
+ ie as caseconv,
223
+ ce as change,
224
+ ue as clamp,
225
+ de as compare,
226
+ Q as control,
227
+ Oe as convertDataType,
228
+ X as convertRenderV,
229
+ wr as createMockWorkers,
230
+ xe as debounce,
231
+ Se as deep,
232
+ or as dimensions,
233
+ sr as direction,
234
+ U as errors,
235
+ He as getEntries,
236
+ Re as id,
237
+ J as invert,
238
+ ze as isCrudeSeries,
239
+ Ge as isObject,
240
+ pe as isStringer,
241
+ Le as isTelemValue,
242
+ Ze as kv,
243
+ ar as location,
244
+ Qe as mapValues,
245
+ We as math,
246
+ K as migrate,
247
+ gr as nullToArr,
248
+ Be as observe,
249
+ lr as position,
250
+ ge as primitiveIsZero,
251
+ Ke as runtime,
252
+ fe as scale,
253
+ Y as shallowCopy,
254
+ Ne as sortTimeRange,
255
+ fr as spatial,
256
+ ee as strings,
257
+ he as throttle,
258
+ br as toArray,
259
+ Pe as typedArrayZ,
260
+ hr as unique,
261
+ Ue as unknownRecordZ,
262
+ dr as xy,
263
+ Tr as zodutil
246
264
  };
@@ -0,0 +1,95 @@
1
+ import { z as O } from "zod";
2
+ import { c as m } from "./index-eue4dSQX.js";
3
+ import { e as a, f, y, g, D as C, C as z, X as L, Y as h, l as S, h as d } from "./base-DnZzEvvz.js";
4
+ const N = a, R = y, I = f, X = {
5
+ top: "bottom",
6
+ right: "left",
7
+ bottom: "top",
8
+ left: "right",
9
+ center: "center"
10
+ }, Y = {
11
+ top: "left",
12
+ right: "top",
13
+ bottom: "right",
14
+ left: "bottom",
15
+ center: "center"
16
+ }, A = g, r = (t) => t instanceof String || !C.includes(t) ? t : t === "x" ? "left" : "top", P = (t) => X[r(t)], k = (t) => Y[r(t)], s = (t) => {
17
+ const o = r(t);
18
+ return o === "top" || o === "bottom" ? "y" : "x";
19
+ }, w = O.object({
20
+ x: a.or(f),
21
+ y: y.or(f)
22
+ }), M = O.object({ x: a, y }), T = Object.freeze({ x: "left", y: "top" }), b = Object.freeze({ x: "right", y: "top" }), l = Object.freeze({ x: "left", y: "bottom" }), u = Object.freeze({ x: "right", y: "bottom" }), x = Object.freeze({ x: "center", y: "center" }), p = Object.freeze({ x: "center", y: "top" }), _ = Object.freeze({ x: "center", y: "bottom" }), E = Object.freeze({ x: "right", y: "center" }), j = Object.freeze({ x: "left", y: "center" }), $ = Object.freeze([
23
+ j,
24
+ E,
25
+ p,
26
+ _,
27
+ T,
28
+ b,
29
+ l,
30
+ u,
31
+ x
32
+ ]), B = (t, o) => t.x === o.x && t.y === o.y, D = (t, o) => {
33
+ if (typeof o == "object") {
34
+ let e = !0;
35
+ return "x" in o && (t.x === o.x || (e = !1)), "y" in o && (t.y === o.y || (e = !1)), e;
36
+ }
37
+ return t.x === o || t.y === o;
38
+ }, F = (t) => [t.x, t.y], i = (t) => s(r(t)) === "x", G = (t) => s(r(t)) === "y", H = (t) => `${t.x}${m(t.y)}`, q = (t, o) => {
39
+ let e, n;
40
+ if (typeof t == "object" && "x" in t ? (e = t.x, n = t.y) : (e = r(t), n = r(o ?? t)), s(e) === s(n) && e !== "center" && n !== "center")
41
+ throw new Error(
42
+ `[XYLocation] - encountered two locations with the same direction: ${e.toString()} - ${n.toString()}`
43
+ );
44
+ const c = { ...x };
45
+ return e === "center" ? i(n) ? [c.x, c.y] = [n, e] : [c.x, c.y] = [e, n] : n === "center" ? i(e) ? [c.x, c.y] = [e, n] : [c.x, c.y] = [n, e] : i(e) ? [c.x, c.y] = [e, n] : [c.x, c.y] = [n, e], c;
46
+ }, K = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
47
+ __proto__: null,
48
+ BOTTOM_CENTER: _,
49
+ BOTTOM_LEFT: l,
50
+ BOTTOM_RIGHT: u,
51
+ CENTER: x,
52
+ CENTER_LOCATIONS: z,
53
+ LEFT_CENTER: j,
54
+ RIGHT_CENTER: E,
55
+ TOP_CENTER: p,
56
+ TOP_LEFT: T,
57
+ TOP_RIGHT: b,
58
+ XY_LOCATIONS: $,
59
+ X_LOCATIONS: L,
60
+ Y_LOCATIONS: h,
61
+ center: I,
62
+ construct: r,
63
+ constructXY: q,
64
+ corner: M,
65
+ crude: A,
66
+ direction: s,
67
+ isX: i,
68
+ isY: G,
69
+ location: S,
70
+ outer: d,
71
+ rotate90: k,
72
+ swap: P,
73
+ x: N,
74
+ xy: w,
75
+ xyCouple: F,
76
+ xyEquals: B,
77
+ xyMatches: D,
78
+ xyToString: H,
79
+ y: R
80
+ }, Symbol.toStringTag, { value: "Module" }));
81
+ export {
82
+ l as B,
83
+ x as C,
84
+ T,
85
+ $ as X,
86
+ D as a,
87
+ B as b,
88
+ M as c,
89
+ F as d,
90
+ b as e,
91
+ u as f,
92
+ K as l,
93
+ P as s,
94
+ w as x
95
+ };
@@ -0,0 +1 @@
1
+ "use strict";const u=require("zod"),I=require("./index-YsO0EMN8.cjs"),o=require("./base-B48bPNx5.cjs"),R=o.xLocation,g=o.yLocation,h=o.centerLocation,d={top:"bottom",right:"left",bottom:"top",left:"right",center:"center"},m={top:"left",right:"top",bottom:"right",left:"bottom",center:"center"},A=o.crudeLocation,s=t=>t instanceof String||!o.DIRECTIONS.includes(t)?t:t==="x"?"left":"top",_=t=>d[s(t)],M=t=>m[s(t)],i=t=>{const n=s(t);return n==="top"||n==="bottom"?"y":"x"},E=u.z.object({x:o.xLocation.or(o.centerLocation),y:o.yLocation.or(o.centerLocation)}),l=u.z.object({x:o.xLocation,y:o.yLocation}),O=Object.freeze({x:"left",y:"top"}),f=Object.freeze({x:"right",y:"top"}),x=Object.freeze({x:"left",y:"bottom"}),a=Object.freeze({x:"right",y:"bottom"}),T=Object.freeze({x:"center",y:"center"}),b=Object.freeze({x:"center",y:"top"}),L=Object.freeze({x:"center",y:"bottom"}),p=Object.freeze({x:"right",y:"center"}),C=Object.freeze({x:"left",y:"center"}),N=Object.freeze([C,p,b,L,O,f,x,a,T]),j=(t,n)=>t.x===n.x&&t.y===n.y,S=(t,n)=>{if(typeof n=="object"){let e=!0;return"x"in n&&(t.x===n.x||(e=!1)),"y"in n&&(t.y===n.y||(e=!1)),e}return t.x===n||t.y===n},z=t=>[t.x,t.y],y=t=>i(s(t))==="x",P=t=>i(s(t))==="y",X=t=>`${t.x}${I.capitalize(t.y)}`,Y=(t,n)=>{let e,c;if(typeof t=="object"&&"x"in t?(e=t.x,c=t.y):(e=s(t),c=s(n??t)),i(e)===i(c)&&e!=="center"&&c!=="center")throw new Error(`[XYLocation] - encountered two locations with the same direction: ${e.toString()} - ${c.toString()}`);const r={...T};return e==="center"?y(c)?[r.x,r.y]=[c,e]:[r.x,r.y]=[e,c]:c==="center"?y(e)?[r.x,r.y]=[e,c]:[r.x,r.y]=[c,e]:y(e)?[r.x,r.y]=[e,c]:[r.x,r.y]=[c,e],r},w=Object.freeze(Object.defineProperty({__proto__:null,BOTTOM_CENTER:L,BOTTOM_LEFT:x,BOTTOM_RIGHT:a,CENTER:T,CENTER_LOCATIONS:o.CENTER_LOCATIONS,LEFT_CENTER:C,RIGHT_CENTER:p,TOP_CENTER:b,TOP_LEFT:O,TOP_RIGHT:f,XY_LOCATIONS:N,X_LOCATIONS:o.X_LOCATIONS,Y_LOCATIONS:o.Y_LOCATIONS,center:h,construct:s,constructXY:Y,corner:l,crude:A,direction:i,isX:y,isY:P,location:o.location,outer:o.outerLocation,rotate90:M,swap:_,x:R,xy:E,xyCouple:z,xyEquals:j,xyMatches:S,xyToString:X,y:g},Symbol.toStringTag,{value:"Module"}));exports.BOTTOM_LEFT=x;exports.BOTTOM_RIGHT=a;exports.CENTER=T;exports.TOP_LEFT=O;exports.TOP_RIGHT=f;exports.XY_LOCATIONS=N;exports.corner=l;exports.location=w;exports.swap=_;exports.xy=E;exports.xyCouple=z;exports.xyEquals=j;exports.xyMatches=S;
package/dist/location.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("./location-DetomF8Z.cjs");exports.location=o.location;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("./location-DLP2ZS0o.cjs");exports.location=o.location;
package/dist/location.js CHANGED
@@ -1,4 +1,4 @@
1
- import { l } from "./location-CI9x53qR.js";
1
+ import { l } from "./location-Cn1ByVTZ.js";
2
2
  export {
3
3
  l as location
4
4
  };
@@ -0,0 +1 @@
1
+ "use strict";const u=(l,n,t=".")=>{const e=l.split(t);return e.map((s,o)=>{const a=n(s,o,e);return a==null?null:typeof a=="string"?a:a.join(t)}).filter(s=>s!=null).join(t)},c=(l,n,t={optional:!1,separator:"."})=>{t.separator??(t.separator=".");const{optional:e,getter:r=(a,i)=>a[i]}=t,s=n.split(t.separator);if(s.length===1&&s[0]==="")return l;let o=l;for(const a of s){const i=r(o,a);if(i==null){if(e)return null;throw new Error(`Path ${n} does not exist. ${a} is null`)}o=i}return o},f=(l,n,t)=>{const e=n.split(".");let r=l;for(let s=0;s<e.length-1;s++){const o=e[s];r[o]??(r[o]={}),r=r[o]}try{r[e[e.length-1]]=t}catch(s){throw console.error("failed to set value",t,"at path",n,"on object",l),s}},h=(l,n)=>{const t=n.split(".");let e=l;for(let r=0;r<t.length-1;r++){const s=t[r];if(e[s]==null)return;e=e[s]}if(Array.isArray(e)){const r=parseInt(t[t.length-1]);if(isNaN(r))return;e.splice(r,1);return}delete e[t[t.length-1]]},p=(l,n)=>{const t=l.split(".");return n<0?t[t.length+n]:t[n]},g=(l,n)=>{try{return c(l,n),!0}catch{return!1}},m=(l,n)=>{if(n.length===0)return!0;const t=l.split("."),e=n.split(".");if(e.length>t.length)return!1;for(let r=0;r<e.length;r++){const s=t[r],o=e[r];if(o!=="*"&&s!==o)return!1}return!0};exports.element=p;exports.get=c;exports.has=g;exports.pathsMatch=m;exports.remove=h;exports.set=f;exports.transformPath=u;
@@ -0,0 +1,76 @@
1
+ const u = (l, n, t = ".") => {
2
+ const e = l.split(t);
3
+ return e.map((s, o) => {
4
+ const a = n(s, o, e);
5
+ return a == null ? null : typeof a == "string" ? a : a.join(t);
6
+ }).filter((s) => s != null).join(t);
7
+ }, c = (l, n, t = { optional: !1, separator: "." }) => {
8
+ t.separator ?? (t.separator = ".");
9
+ const { optional: e, getter: r = (a, i) => a[i] } = t, s = n.split(t.separator);
10
+ if (s.length === 1 && s[0] === "") return l;
11
+ let o = l;
12
+ for (const a of s) {
13
+ const i = r(o, a);
14
+ if (i == null) {
15
+ if (e) return null;
16
+ throw new Error(`Path ${n} does not exist. ${a} is null`);
17
+ }
18
+ o = i;
19
+ }
20
+ return o;
21
+ }, f = (l, n, t) => {
22
+ const e = n.split(".");
23
+ let r = l;
24
+ for (let s = 0; s < e.length - 1; s++) {
25
+ const o = e[s];
26
+ r[o] ?? (r[o] = {}), r = r[o];
27
+ }
28
+ try {
29
+ r[e[e.length - 1]] = t;
30
+ } catch (s) {
31
+ throw console.error("failed to set value", t, "at path", n, "on object", l), s;
32
+ }
33
+ }, h = (l, n) => {
34
+ const t = n.split(".");
35
+ let e = l;
36
+ for (let r = 0; r < t.length - 1; r++) {
37
+ const s = t[r];
38
+ if (e[s] == null) return;
39
+ e = e[s];
40
+ }
41
+ if (Array.isArray(e)) {
42
+ const r = parseInt(t[t.length - 1]);
43
+ if (isNaN(r)) return;
44
+ e.splice(r, 1);
45
+ return;
46
+ }
47
+ delete e[t[t.length - 1]];
48
+ }, p = (l, n) => {
49
+ const t = l.split(".");
50
+ return n < 0 ? t[t.length + n] : t[n];
51
+ }, g = (l, n) => {
52
+ try {
53
+ return c(l, n), !0;
54
+ } catch {
55
+ return !1;
56
+ }
57
+ }, y = (l, n) => {
58
+ if (n.length === 0) return !0;
59
+ const t = l.split("."), e = n.split(".");
60
+ if (e.length > t.length) return !1;
61
+ for (let r = 0; r < e.length; r++) {
62
+ const s = t[r], o = e[r];
63
+ if (o !== "*" && s !== o)
64
+ return !1;
65
+ }
66
+ return !0;
67
+ };
68
+ export {
69
+ p as e,
70
+ c as g,
71
+ g as h,
72
+ y as p,
73
+ h as r,
74
+ f as s,
75
+ u as t
76
+ };
@@ -1,6 +1,6 @@
1
- import { c as g, x as v, a as I, h as M, w as N, d as X, i as j } from "./box-DVCNGsJG.js";
1
+ import { c as g, x as v, a as I, h as M, w as N, d as X, i as j } from "./box-CYXc9-qp.js";
2
2
  import { c as w } from "./direction-CScbfCdT.js";
3
- import { x as B, a as h, b as C, C as O, T as R, s as m, X as S } from "./location-CI9x53qR.js";
3
+ import { x as B, a as h, b as C, C as O, T as R, s as m, X as S } from "./location-Cn1ByVTZ.js";
4
4
  import { l as Y } from "./base-DnZzEvvz.js";
5
5
  const P = (t) => {
6
6
  if (t == null) return { x: void 0, y: void 0 };
@@ -1 +1 @@
1
- "use strict";const n=require("./box-Mf8E1Ypp.cjs"),T=require("./direction-D7qoo_GJ.cjs"),r=require("./location-DetomF8Z.cjs"),b=require("./base-B48bPNx5.cjs"),P=t=>{if(t==null)return{x:void 0,y:void 0};const s=r.xy.safeParse(t);if(s.success)return s.data;const e=b.location.safeParse(t);return e.success?T.construct(e.data)==="x"?{x:e.data,y:void 0}:{x:void 0,y:e.data}:t},N=({container:t,target:s,dialog:e,initial:u,prefer:a,alignments:l=["start"],disable:f=[]})=>{const i=P(u);let x=r.XY_LOCATIONS;if(a!=null){const o=a.map(c=>P(c));x=x.slice().sort((c,p)=>{const d=o.findIndex(g=>r.xyMatches(c,g)),h=o.findIndex(g=>r.xyMatches(p,g));return d>-1&&h>-1?d-h:d>-1?-1:h>-1?1:0})}const O=x.filter(o=>!r.xyEquals(o,r.CENTER)&&(i.x==null||o.x===i.x)&&(i.y==null||o.y===i.y)&&!f.some(c=>r.xyMatches(o,c))).map(o=>l==null?void 0:l.map(c=>[o,c])).flat(),A=n.construct(t),M=n.construct(s),_=n.construct(e);let E=-1/0;const y={location:r.CENTER,adjustedDialog:_};return O.forEach(([o,c])=>{const[p,d]=v({option:o,alignment:c,container:A,target:M,dialog:_});d>E&&(E=d,y.location=o,y.adjustedDialog=p)}),y},v=({option:t,alignment:s,container:e,target:u,dialog:a})=>{const l=L(t,s),f=n.xyLoc(u,t),i=n.constructWithAlternateRoot(f.x,f.y,n.width(a),n.height(a),l,r.TOP_LEFT),x=n.area(n.intersection(i,e));return[i,x]},I={start:"left",center:"center",end:"right"},j={start:"bottom",center:"center",end:"top"},L=(t,s)=>{const e={x:"center",y:"center"};if(t.y!=="center"){e.y=r.swap(t.y);const u=t.x==="left"?r.swap:a=>a;e.x=u(I[s])}else e.x=r.swap(t.x),e.y=j[s];return e},q=Object.freeze(Object.defineProperty({__proto__:null,dialog:N,getRoot:L,parseLocationOptions:P},Symbol.toStringTag,{value:"Module"}));exports.position=q;
1
+ "use strict";const n=require("./box-BpSX4si6.cjs"),T=require("./direction-D7qoo_GJ.cjs"),r=require("./location-DLP2ZS0o.cjs"),b=require("./base-B48bPNx5.cjs"),P=t=>{if(t==null)return{x:void 0,y:void 0};const s=r.xy.safeParse(t);if(s.success)return s.data;const e=b.location.safeParse(t);return e.success?T.construct(e.data)==="x"?{x:e.data,y:void 0}:{x:void 0,y:e.data}:t},N=({container:t,target:s,dialog:e,initial:u,prefer:a,alignments:l=["start"],disable:f=[]})=>{const i=P(u);let x=r.XY_LOCATIONS;if(a!=null){const o=a.map(c=>P(c));x=x.slice().sort((c,p)=>{const d=o.findIndex(g=>r.xyMatches(c,g)),h=o.findIndex(g=>r.xyMatches(p,g));return d>-1&&h>-1?d-h:d>-1?-1:h>-1?1:0})}const O=x.filter(o=>!r.xyEquals(o,r.CENTER)&&(i.x==null||o.x===i.x)&&(i.y==null||o.y===i.y)&&!f.some(c=>r.xyMatches(o,c))).map(o=>l==null?void 0:l.map(c=>[o,c])).flat(),A=n.construct(t),M=n.construct(s),_=n.construct(e);let E=-1/0;const y={location:r.CENTER,adjustedDialog:_};return O.forEach(([o,c])=>{const[p,d]=v({option:o,alignment:c,container:A,target:M,dialog:_});d>E&&(E=d,y.location=o,y.adjustedDialog=p)}),y},v=({option:t,alignment:s,container:e,target:u,dialog:a})=>{const l=L(t,s),f=n.xyLoc(u,t),i=n.constructWithAlternateRoot(f.x,f.y,n.width(a),n.height(a),l,r.TOP_LEFT),x=n.area(n.intersection(i,e));return[i,x]},I={start:"left",center:"center",end:"right"},j={start:"bottom",center:"center",end:"top"},L=(t,s)=>{const e={x:"center",y:"center"};if(t.y!=="center"){e.y=r.swap(t.y);const u=t.x==="left"?r.swap:a=>a;e.x=u(I[s])}else e.x=r.swap(t.x),e.y=j[s];return e},q=Object.freeze(Object.defineProperty({__proto__:null,dialog:N,getRoot:L,parseLocationOptions:P},Symbol.toStringTag,{value:"Module"}));exports.position=q;
package/dist/position.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("./position-DKhPhvPh.cjs");exports.position=o.position;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("./position-JCN6-sJC.cjs");exports.position=o.position;
package/dist/position.js CHANGED
@@ -1,4 +1,4 @@
1
- import { p as i } from "./position-CFc9RsSn.js";
1
+ import { p as i } from "./position-DJXB-pDS.js";
2
2
  export {
3
3
  i as position
4
4
  };
package/dist/record.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("zod"),o=n.z.record(n.z.union([n.z.number(),n.z.string(),n.z.symbol()]),n.z.unknown()),t=e=>Object.entries(e);exports.getEntries=t;exports.unknownRecordZ=o;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("zod"),c=e.z.record(e.z.union([e.z.number(),e.z.string(),e.z.symbol()]),e.z.unknown()),o=n=>Object.entries(n),u=(n,r)=>Object.fromEntries(o(n).map(([t,s])=>[t,r(s,t)]));exports.getEntries=o;exports.mapValues=u;exports.unknownRecordZ=c;
package/dist/record.js CHANGED
@@ -1,9 +1,10 @@
1
1
  import { z as n } from "zod";
2
- const e = n.record(
2
+ const m = n.record(
3
3
  n.union([n.number(), n.string(), n.symbol()]),
4
4
  n.unknown()
5
- ), t = (o) => Object.entries(o);
5
+ ), s = (o) => Object.entries(o), i = (o, t) => Object.fromEntries(s(o).map(([r, e]) => [r, t(e, r)]));
6
6
  export {
7
- t as getEntries,
8
- e as unknownRecordZ
7
+ s as getEntries,
8
+ i as mapValues,
9
+ m as unknownRecordZ
9
10
  };