@synnaxlabs/x 0.25.0 → 0.26.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 (48) hide show
  1. package/.turbo/turbo-build.log +22 -20
  2. package/dist/binary.cjs +1 -3
  3. package/dist/binary.js +2 -98
  4. package/dist/{box-DC5oviHL.js → box-B5SaODGu.js} +1 -1
  5. package/dist/{box-BcFruCBW.cjs → box-C6r0YnKB.cjs} +1 -1
  6. package/dist/box.cjs +1 -1
  7. package/dist/box.js +1 -1
  8. package/dist/caseconv.cjs +1 -1
  9. package/dist/caseconv.js +1 -1
  10. package/dist/index-BGz7XJIe.cjs +1 -0
  11. package/dist/{index-CQk9JICS.js → index-C9i674Sf.js} +18 -18
  12. package/dist/index-CzjnpuXF.js +101 -0
  13. package/dist/index-tYmAULd8.cjs +3 -0
  14. package/dist/index.cjs +2 -2
  15. package/dist/index.js +7 -7
  16. package/dist/{location-wMqTcQ0n.cjs → location-55G2uRZN.cjs} +1 -1
  17. package/dist/{location-D4yS2DfR.js → location-C6sCnzhU.js} +1 -1
  18. package/dist/location.cjs +1 -1
  19. package/dist/location.js +1 -1
  20. package/dist/{position-DvsYXRzE.js → position-BY9oBMZB.js} +2 -2
  21. package/dist/{position-DolPXOLe.cjs → position-BwmbckCe.cjs} +1 -1
  22. package/dist/position.cjs +1 -1
  23. package/dist/position.js +1 -1
  24. package/dist/{scale-6y6-BcVI.js → scale-BgCpxgAk.js} +2 -2
  25. package/dist/{scale-D_uVU2Fw.cjs → scale-COuYv97b.cjs} +1 -1
  26. package/dist/scale.cjs +1 -1
  27. package/dist/scale.js +1 -1
  28. package/dist/series-CNcMldp_.cjs +11 -0
  29. package/dist/{series-B3wKdjpi.js → series-CaeAWaDJ.js} +217 -216
  30. package/dist/spatial.cjs +1 -1
  31. package/dist/spatial.js +4 -4
  32. package/dist/src/binary/encoder.d.ts +11 -11
  33. package/dist/src/binary/encoder.d.ts.map +1 -1
  34. package/dist/src/caseconv/caseconv.d.ts +2 -2
  35. package/dist/src/caseconv/caseconv.d.ts.map +1 -1
  36. package/dist/src/telem/series.d.ts.map +1 -1
  37. package/dist/telem.cjs +1 -1
  38. package/dist/telem.js +1 -1
  39. package/package.json +2 -2
  40. package/src/binary/encoder.spec.ts +12 -12
  41. package/src/binary/encoder.ts +11 -11
  42. package/src/caseconv/caseconv.ts +9 -6
  43. package/src/telem/series.spec.ts +17 -3
  44. package/src/telem/series.ts +5 -4
  45. package/src/telem/telem.spec.ts +1 -1
  46. package/tsconfig.tsbuildinfo +1 -1
  47. package/dist/index-2SfxIaaU.cjs +0 -1
  48. package/dist/series-PoUlr-RX.cjs +0 -11
@@ -1,5 +1,5 @@
1
1
 
2
- > @synnaxlabs/x@0.25.0 build /home/runner/work/synnax/synnax/x/ts
2
+ > @synnaxlabs/x@0.26.0 build /home/runner/work/synnax/synnax/x/ts
3
3
  > tsc --noEmit && vite build
4
4
 
5
5
   Synnax - Production mode
@@ -15,6 +15,7 @@ computing gzip size...
15
15
  dist/unique.js  0.06 kB │ gzip: 0.08 kB
16
16
  dist/xy.js  0.07 kB │ gzip: 0.08 kB
17
17
  dist/box.js  0.07 kB │ gzip: 0.08 kB
18
+ dist/binary.js  0.07 kB │ gzip: 0.08 kB
18
19
  dist/scale.js  0.07 kB │ gzip: 0.08 kB
19
20
  dist/location.js  0.07 kB │ gzip: 0.08 kB
20
21
  dist/bounds.js  0.07 kB │ gzip: 0.08 kB
@@ -43,29 +44,30 @@ computing gzip size...
43
44
  dist/base-DnZzEvvz.js  1.21 kB │ gzip: 0.51 kB
44
45
  dist/path-DH9iaDDf.js  1.36 kB │ gzip: 0.55 kB
45
46
  dist/dimensions-D-1PnJVI.js  1.49 kB │ gzip: 0.66 kB
46
- dist/index-CQk9JICS.js  1.67 kB │ gzip: 0.80 kB
47
+ dist/index-C9i674Sf.js  1.68 kB │ gzip: 0.80 kB
47
48
  dist/url.js  1.98 kB │ gzip: 0.87 kB
48
- dist/position-DvsYXRzE.js  2.25 kB │ gzip: 1.06 kB
49
+ dist/position-BY9oBMZB.js  2.25 kB │ gzip: 1.06 kB
49
50
  dist/xy-CrgPnICw.js  2.61 kB │ gzip: 1.05 kB
50
51
  dist/index-DCwgKLH_.js  2.67 kB │ gzip: 1.05 kB
51
- dist/location-D4yS2DfR.js  2.80 kB │ gzip: 1.16 kB
52
- dist/binary.js  2.97 kB │ gzip: 1.12 kB
52
+ dist/location-C6sCnzhU.js  2.80 kB │ gzip: 1.17 kB
53
+ dist/index-CzjnpuXF.js  2.95 kB │ gzip: 1.12 kB
53
54
  dist/deep.js  3.23 kB │ gzip: 1.27 kB
54
55
  dist/bounds-CpboA0q6.js  4.87 kB │ gzip: 1.63 kB
55
- dist/scale-6y6-BcVI.js  5.64 kB │ gzip: 1.77 kB
56
- dist/box-DC5oviHL.js  6.11 kB │ gzip: 2.17 kB
57
- dist/index.js  6.36 kB │ gzip: 2.48 kB
58
- dist/series-B3wKdjpi.js 54.03 kB │ gzip: 12.23 kB
59
- [vite:dts] Declaration files built in 3655ms.
56
+ dist/scale-BgCpxgAk.js  5.64 kB │ gzip: 1.77 kB
57
+ dist/box-B5SaODGu.js  6.11 kB │ gzip: 2.16 kB
58
+ dist/index.js  6.36 kB │ gzip: 2.49 kB
59
+ dist/series-CaeAWaDJ.js 54.08 kB │ gzip: 12.24 kB
60
+ [vite:dts] Declaration files built in 3585ms.
60
61
 
61
62
  Generated an empty chunk: "destructor".
62
63
  dist/destructor.cjs  0.01 kB │ gzip: 0.03 kB
63
64
  dist/unique.cjs  0.13 kB │ gzip: 0.14 kB
64
65
  dist/xy.cjs  0.13 kB │ gzip: 0.14 kB
65
- dist/box.cjs  0.14 kB │ gzip: 0.14 kB
66
+ dist/box.cjs  0.14 kB │ gzip: 0.15 kB
66
67
  dist/scale.cjs  0.14 kB │ gzip: 0.15 kB
67
68
  dist/bounds.cjs  0.15 kB │ gzip: 0.15 kB
68
69
  dist/change.cjs  0.15 kB │ gzip: 0.15 kB
70
+ dist/binary.cjs  0.15 kB │ gzip: 0.15 kB
69
71
  dist/compare.cjs  0.15 kB │ gzip: 0.15 kB
70
72
  dist/caseconv.cjs  0.15 kB │ gzip: 0.15 kB
71
73
  dist/runtime.cjs  0.15 kB │ gzip: 0.15 kB
@@ -91,17 +93,17 @@ Generated an empty chunk: "destructor".
91
93
  dist/path-Coj1BKMh.cjs  1.04 kB │ gzip: 0.51 kB
92
94
  dist/url.cjs  1.10 kB │ gzip: 0.60 kB
93
95
  dist/dimensions-zMcb9pMk.cjs  1.17 kB │ gzip: 0.58 kB
94
- dist/index-2SfxIaaU.cjs  1.32 kB │ gzip: 0.71 kB
96
+ dist/index-BGz7XJIe.cjs  1.32 kB │ gzip: 0.71 kB
95
97
  dist/base-B48bPNx5.cjs  1.38 kB │ gzip: 0.57 kB
96
- dist/position-DolPXOLe.cjs  1.71 kB │ gzip: 0.94 kB
98
+ dist/position-BwmbckCe.cjs  1.71 kB │ gzip: 0.95 kB
97
99
  dist/xy-cP-FXJtR.cjs  2.00 kB │ gzip: 0.96 kB
98
100
  dist/index-CvHP07Bs.cjs  2.01 kB │ gzip: 0.94 kB
99
- dist/binary.cjs  2.37 kB │ gzip: 1.02 kB
100
- dist/location-wMqTcQ0n.cjs  2.37 kB │ gzip: 1.04 kB
101
+ dist/index-tYmAULd8.cjs  2.30 kB │ gzip: 1.01 kB
102
+ dist/location-55G2uRZN.cjs  2.37 kB │ gzip: 1.04 kB
101
103
  dist/deep.cjs  2.39 kB │ gzip: 1.08 kB
102
104
  dist/bounds-ZZc1c-_Z.cjs  3.72 kB │ gzip: 1.44 kB
103
- dist/scale-D_uVU2Fw.cjs  4.22 kB │ gzip: 1.56 kB
104
- dist/box-BcFruCBW.cjs  4.73 kB │ gzip: 1.94 kB
105
- dist/index.cjs  5.31 kB │ gzip: 2.11 kB
106
- dist/series-PoUlr-RX.cjs 29.84 kB │ gzip: 8.25 kB
107
- ✓ built in 4.18s
105
+ dist/scale-COuYv97b.cjs  4.22 kB │ gzip: 1.56 kB
106
+ dist/box-C6r0YnKB.cjs  4.73 kB │ gzip: 1.94 kB
107
+ dist/index.cjs  5.32 kB │ gzip: 2.13 kB
108
+ dist/series-CNcMldp_.cjs 29.90 kB │ gzip: 8.27 kB
109
+ ✓ built in 4.17s
package/dist/binary.cjs CHANGED
@@ -1,3 +1 @@
1
- "use strict";var b=Object.defineProperty;var E=(o,e,t)=>e in o?b(o,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):o[e]=t;var i=(o,e,t)=>E(o,typeof e!="symbol"?e+"":e,t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("./index-2SfxIaaU.cjs"),f=require("./identity.cjs");class p{constructor(){i(this,"contentType","application/json");i(this,"decoder");i(this,"encoder");this.decoder=new TextDecoder,this.encoder=new TextEncoder}encode(e){return this.encoder.encode(this.encodeString(e)).buffer}decode(e,t){return this.decodeString(this.decoder.decode(e),t)}decodeString(e,t){const n=JSON.parse(e),r=l.snakeToCamel(n);return t!=null?t.parse(r):r}encodeString(e){const t=l.camelToSnake(e);return JSON.stringify(t,(n,r)=>ArrayBuffer.isView(r)?Array.from(r):f.isObject(r)&&"encode_value"in r?typeof r.value=="bigint"?r.value.toString():r.value:typeof r=="bigint"?r.toString():r)}static registerCustomType(){}}class g{constructor(){i(this,"contentType","text/csv")}encode(e){const t=this.encodeString(e);return new TextEncoder().encode(t).buffer}decode(e,t){const n=new TextDecoder().decode(e);return this.decodeString(n,t)}encodeString(e){if(!Array.isArray(e)||e.length===0||!f.isObject(e[0]))throw new Error("Payload must be an array of objects");const t=Object.keys(e[0]),n=[t.join(",")];return e.forEach(r=>{const d=t.map(s=>JSON.stringify(r[s]??""));n.push(d.join(","))}),n.join(`
2
- `)}decodeString(e,t){const[n,...r]=e.trim().split(`
3
- `).map(c=>c.trim());if(n.length===0)return t!=null?t.parse({}):{};const d=n.split(",").map(c=>c.trim()),s={};return d.forEach(c=>{s[c]=[]}),r.forEach(c=>{const h=c.split(",").map(u=>u.trim());d.forEach((u,T)=>{const a=this.parseValue(h[T]);a!=null&&s[u].push(a)})}),t!=null?t.parse(s):s}parseValue(e){if(e==null||e.length===0)return null;const t=Number(e);return isNaN(t)?e.startsWith('"')&&e.endsWith('"')?e.slice(1,-1):e:t}static registerCustomType(){}}class S{constructor(){i(this,"contentType","text/plain")}encode(e){return new TextEncoder().encode(e).buffer}decode(e,t){const n=new TextDecoder().decode(e);return t!=null?t.parse(n):n}}const y=new p,m=new g,w=new S,O=[y],j=Object.freeze(Object.defineProperty({__proto__:null,CSVEncoderDecoder:g,CSV_ECD:m,ENCODERS:O,JSONEncoderDecoder:p,JSON_ECD:y,TEXT_ECD:w,TextEncoderDecoder:S},Symbol.toStringTag,{value:"Module"}));exports.binary=j;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-tYmAULd8.cjs");exports.binary=e.encoder;
package/dist/binary.js CHANGED
@@ -1,100 +1,4 @@
1
- var T = Object.defineProperty;
2
- var m = (o, e, r) => e in o ? T(o, e, { enumerable: !0, configurable: !0, writable: !0, value: r }) : o[e] = r;
3
- var i = (o, e, r) => m(o, typeof e != "symbol" ? e + "" : e, r);
4
- import { s as y, b } from "./index-CQk9JICS.js";
5
- import { isObject as l } from "./identity.js";
6
- class f {
7
- constructor() {
8
- i(this, "contentType", "application/json");
9
- i(this, "decoder");
10
- i(this, "encoder");
11
- this.decoder = new TextDecoder(), this.encoder = new TextEncoder();
12
- }
13
- encode(e) {
14
- return this.encoder.encode(this.encodeString(e)).buffer;
15
- }
16
- decode(e, r) {
17
- return this.decodeString(this.decoder.decode(e), r);
18
- }
19
- decodeString(e, r) {
20
- const n = JSON.parse(e), t = y(n);
21
- return r != null ? r.parse(t) : t;
22
- }
23
- encodeString(e) {
24
- const r = b(e);
25
- return JSON.stringify(r, (n, t) => ArrayBuffer.isView(t) ? Array.from(t) : l(t) && "encode_value" in t ? typeof t.value == "bigint" ? t.value.toString() : t.value : typeof t == "bigint" ? t.toString() : t);
26
- }
27
- static registerCustomType() {
28
- }
29
- }
30
- class p {
31
- constructor() {
32
- i(this, "contentType", "text/csv");
33
- }
34
- encode(e) {
35
- const r = this.encodeString(e);
36
- return new TextEncoder().encode(r).buffer;
37
- }
38
- decode(e, r) {
39
- const n = new TextDecoder().decode(e);
40
- return this.decodeString(n, r);
41
- }
42
- encodeString(e) {
43
- if (!Array.isArray(e) || e.length === 0 || !l(e[0]))
44
- throw new Error("Payload must be an array of objects");
45
- const r = Object.keys(e[0]), n = [r.join(",")];
46
- return e.forEach((t) => {
47
- const d = r.map((s) => JSON.stringify(t[s] ?? ""));
48
- n.push(d.join(","));
49
- }), n.join(`
50
- `);
51
- }
52
- decodeString(e, r) {
53
- const [n, ...t] = e.trim().split(`
54
- `).map((c) => c.trim());
55
- if (n.length === 0)
56
- return r != null ? r.parse({}) : {};
57
- const d = n.split(",").map((c) => c.trim()), s = {};
58
- return d.forEach((c) => {
59
- s[c] = [];
60
- }), t.forEach((c) => {
61
- const h = c.split(",").map((u) => u.trim());
62
- d.forEach((u, E) => {
63
- const a = this.parseValue(h[E]);
64
- a != null && s[u].push(a);
65
- });
66
- }), r != null ? r.parse(s) : s;
67
- }
68
- parseValue(e) {
69
- if (e == null || e.length === 0) return null;
70
- const r = Number(e);
71
- return isNaN(r) ? e.startsWith('"') && e.endsWith('"') ? e.slice(1, -1) : e : r;
72
- }
73
- static registerCustomType() {
74
- }
75
- }
76
- class g {
77
- constructor() {
78
- i(this, "contentType", "text/plain");
79
- }
80
- encode(e) {
81
- return new TextEncoder().encode(e).buffer;
82
- }
83
- decode(e, r) {
84
- const n = new TextDecoder().decode(e);
85
- return r != null ? r.parse(n) : n;
86
- }
87
- }
88
- const S = new f(), w = new p(), x = new g(), C = [S], N = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
89
- __proto__: null,
90
- CSVEncoderDecoder: p,
91
- CSV_ECD: w,
92
- ENCODERS: C,
93
- JSONEncoderDecoder: f,
94
- JSON_ECD: S,
95
- TEXT_ECD: x,
96
- TextEncoderDecoder: g
97
- }, Symbol.toStringTag, { value: "Module" }));
1
+ import { e } from "./index-CzjnpuXF.js";
98
2
  export {
99
- N as binary
3
+ e as binary
100
4
  };
@@ -1,6 +1,6 @@
1
1
  import { z as x } from "zod";
2
2
  import { c as M } from "./direction-CScbfCdT.js";
3
- import { c as S, T as E, B as H, b as Z, d as q, e as v, f as N, l as D } from "./location-D4yS2DfR.js";
3
+ import { c as S, T as E, B as H, b as Z, d as q, e as v, f as N, l as D } from "./location-C6sCnzhU.js";
4
4
  import { Z as p, O as F, e as $, t as O, c as G, a as C } from "./xy-CrgPnICw.js";
5
5
  import { x as j, X as P, Y as X } from "./base-DnZzEvvz.js";
6
6
  const h = x.union([x.number(), x.string()]);
@@ -1 +1 @@
1
- "use strict";const y=require("zod"),z=require("./direction-DZbN47uL.cjs"),u=require("./location-wMqTcQ0n.cjs"),i=require("./xy-cP-FXJtR.cjs"),m=require("./base-B48bPNx5.cjs"),O=y.z.union([y.z.number(),y.z.string()]);y.z.object({top:O,left:O,width:O,height:O});y.z.object({left:y.z.number(),top:y.z.number(),right:y.z.number(),bottom:y.z.number()});const H=y.z.object({one:m.xy,two:m.xy,root:u.corner}),I={one:i.ZERO,two:i.ZERO,root:u.TOP_LEFT},S={one:i.ZERO,two:i.ONE,root:u.BOTTOM_LEFT},q=(t,o)=>({one:t.one,two:t.two,root:o??t.root}),c=(t,o,e=0,n=0,s)=>{const r={one:{...i.ZERO},two:{...i.ZERO},root:s??u.TOP_LEFT};if(typeof t=="number"){if(typeof o!="number")throw new Error("Box constructor called with invalid arguments");return r.one={x:t,y:o},r.two={x:r.one.x+e,y:r.one.y+n},r}return"one"in t&&"two"in t&&"root"in t?{...t,root:s??t.root}:("getBoundingClientRect"in t&&(t=t.getBoundingClientRect()),"left"in t?(r.one={x:t.left,y:t.top},r.two={x:t.right,y:t.bottom},r):(r.one=t,o==null?r.two={x:r.one.x+e,y:r.one.y+n}:typeof o=="number"?r.two={x:r.one.x+o,y:r.one.y+e}:"width"in o?r.two={x:r.one.x+o.width,y:r.one.y+o.height}:"signedWidth"in o?r.two={x:r.one.x+o.signedWidth,y:r.one.y+o.signedHeight}:r.two=o,r))},N=(t,o,e)=>{const n=c(t);if(typeof o=="string"){if(e==null)throw new Error("Invalid arguments for resize");const s=z.construct(o);return c(n.one,void 0,s==="x"?e:l(n),s==="y"?e:w(n),n.root)}return c(n.one,o,void 0,void 0,n.root)},v=(t,o,e=!0)=>{const n=c(t);let s=(r,x)=>r<x;return e&&(s=(r,x)=>r<=x),"one"in o?s(d(n),d(o))&&s(f(o),f(n))&&s(a(n),a(o))&&s(h(o),h(n)):s(d(n),o.x)&&s(o.x,f(n))&&s(a(n),o.y)&&s(o.y,h(n))},D=(t,o)=>i.equals(t.one,o.one)&&i.equals(t.two,o.two)&&u.xyEquals(t.root,o.root),R=t=>({width:l(t),height:w(t)}),G=t=>({signedWidth:b(t),signedHeight:T(t)}),X=t=>({top:a(t),left:d(t),width:l(t),height:w(t)}),M=(t,o,e=!1)=>{const n=z.construct(o)==="y"?T(t):b(t);return e?n:Math.abs(n)},_=(t,o)=>{const e=c(t);return{x:o.x==="center"?E(e).x:g(e,o.x),y:o.y==="center"?E(e).y:g(e,o.y)}},g=(t,o)=>{const e=c(t),n=u.xyCouple(e.root).includes(o)?Math.min:Math.max;return m.X_LOCATIONS.includes(o)?n(e.one.x,e.two.x):n(e.one.y,e.two.y)},$=t=>t.one.x===t.two.x&&t.one.y===t.two.y,l=t=>M(t,"x"),w=t=>M(t,"y"),b=t=>{const o=c(t);return o.two.x-o.one.x},T=t=>{const o=c(t);return o.two.y-o.one.y},C=t=>_(t,u.TOP_LEFT),U=t=>_(t,u.TOP_RIGHT),Y=t=>_(t,u.BOTTOM_LEFT),k=t=>_(t,u.BOTTOM_RIGHT),f=t=>g(t,"right"),h=t=>g(t,"bottom"),d=t=>g(t,"left"),a=t=>g(t,"top"),E=t=>i.translate(C(t),{x:b(t)/2,y:T(t)/2}),L=t=>{const o=c(t);return o.root.x==="left"?d(o):f(o)},B=t=>{const o=c(t);return o.root.y==="top"?a(o):h(o)},J=t=>({x:L(t),y:B(t)}),P=t=>{const o=c(t);return{lower:o.one.x,upper:o.two.x}},Z=t=>{const o=c(t);return{lower:o.one.y,upper:o.two.y}},K=(t,o)=>q(t,o),Q=(t,o)=>{const e=c(t),n=m.X_LOCATIONS.includes(o)?"x":m.Y_LOCATIONS.includes(o)?"y":null;if(n===null)throw new Error(`Invalid location: ${u.location}`);const s=o==="top"||o==="left"?Math.min:Math.max,r={...e.one},x={...e.two};return r[n]=s(e.one[n],e.two[n]),x[n]=s(e.one[n],e.two[n]),[r,x]},V=(t,o)=>{const e=c(t),n=c(o),s=L(n)+(l(n)-l(e))/2,r=B(n)+(w(n)-w(e))/2;return c({x:s,y:r},R(e))},j=t=>typeof t!="object"||t==null?!1:"one"in t&&"two"in t&&"root"in t,tt=t=>l(t)/w(t),ot=(t,o,e)=>{if(typeof o=="string"){if(e==null)throw new Error("Undefined amount passed into box.translate");const s=z.construct(o);o=i.construct(s,e)}const n=c(t);return c(i.translate(n.one,o),i.translate(n.two,o),void 0,void 0,n.root)},A=(t,o)=>{const e=Math.max(d(t),d(o)),n=Math.max(a(t),a(o)),s=Math.min(f(t),f(o)),r=Math.min(h(t),h(o));return e>s||n>r?I:c({x:e,y:n},{x:s,y:r},void 0,void 0,t.root)},W=t=>l(t)*w(t),nt=(t,o)=>{const e=c(t);return c(i.truncate(e.one,o),i.truncate(e.two,o),void 0,void 0,e.root)},F=(t,o,e,n,s,r)=>{const x={x:t,y:o},p={x:t+e,y:o+n};return s.x!==r.x&&(s.x==="center"?(x.x-=e/2,p.x-=e/2):(x.x-=e,p.x-=e)),s.y!==r.y&&(s.y==="center"?(x.y-=n/2,p.y-=n/2):(x.y-=n,p.y-=n)),c(x,p,void 0,void 0,r)},et=Object.freeze(Object.defineProperty({__proto__:null,DECIMAL:S,ZERO:I,area:W,areaIsZero:$,aspect:tt,bottom:h,bottomLeft:Y,bottomRight:k,box:H,center:E,construct:c,constructWithAlternateRoot:F,contains:v,copy:q,css:X,dim:M,dims:R,edgePoints:Q,equals:D,height:w,intersection:A,isBox:j,left:d,loc:g,positionInCenter:V,reRoot:K,resize:N,right:f,root:J,signedDims:G,signedHeight:T,signedWidth:b,top:a,topLeft:C,topRight:U,translate:ot,truncate:nt,width:l,x:L,xBounds:P,xyLoc:_,y:B,yBounds:Z},Symbol.toStringTag,{value:"Module"}));exports.area=W;exports.box=et;exports.construct=c;exports.constructWithAlternateRoot=F;exports.height=w;exports.intersection=A;exports.isBox=j;exports.width=l;exports.xBounds=P;exports.xyLoc=_;exports.yBounds=Z;
1
+ "use strict";const y=require("zod"),z=require("./direction-DZbN47uL.cjs"),u=require("./location-55G2uRZN.cjs"),i=require("./xy-cP-FXJtR.cjs"),m=require("./base-B48bPNx5.cjs"),O=y.z.union([y.z.number(),y.z.string()]);y.z.object({top:O,left:O,width:O,height:O});y.z.object({left:y.z.number(),top:y.z.number(),right:y.z.number(),bottom:y.z.number()});const H=y.z.object({one:m.xy,two:m.xy,root:u.corner}),I={one:i.ZERO,two:i.ZERO,root:u.TOP_LEFT},S={one:i.ZERO,two:i.ONE,root:u.BOTTOM_LEFT},q=(t,o)=>({one:t.one,two:t.two,root:o??t.root}),c=(t,o,e=0,n=0,s)=>{const r={one:{...i.ZERO},two:{...i.ZERO},root:s??u.TOP_LEFT};if(typeof t=="number"){if(typeof o!="number")throw new Error("Box constructor called with invalid arguments");return r.one={x:t,y:o},r.two={x:r.one.x+e,y:r.one.y+n},r}return"one"in t&&"two"in t&&"root"in t?{...t,root:s??t.root}:("getBoundingClientRect"in t&&(t=t.getBoundingClientRect()),"left"in t?(r.one={x:t.left,y:t.top},r.two={x:t.right,y:t.bottom},r):(r.one=t,o==null?r.two={x:r.one.x+e,y:r.one.y+n}:typeof o=="number"?r.two={x:r.one.x+o,y:r.one.y+e}:"width"in o?r.two={x:r.one.x+o.width,y:r.one.y+o.height}:"signedWidth"in o?r.two={x:r.one.x+o.signedWidth,y:r.one.y+o.signedHeight}:r.two=o,r))},N=(t,o,e)=>{const n=c(t);if(typeof o=="string"){if(e==null)throw new Error("Invalid arguments for resize");const s=z.construct(o);return c(n.one,void 0,s==="x"?e:l(n),s==="y"?e:w(n),n.root)}return c(n.one,o,void 0,void 0,n.root)},v=(t,o,e=!0)=>{const n=c(t);let s=(r,x)=>r<x;return e&&(s=(r,x)=>r<=x),"one"in o?s(d(n),d(o))&&s(f(o),f(n))&&s(a(n),a(o))&&s(h(o),h(n)):s(d(n),o.x)&&s(o.x,f(n))&&s(a(n),o.y)&&s(o.y,h(n))},D=(t,o)=>i.equals(t.one,o.one)&&i.equals(t.two,o.two)&&u.xyEquals(t.root,o.root),R=t=>({width:l(t),height:w(t)}),G=t=>({signedWidth:b(t),signedHeight:T(t)}),X=t=>({top:a(t),left:d(t),width:l(t),height:w(t)}),M=(t,o,e=!1)=>{const n=z.construct(o)==="y"?T(t):b(t);return e?n:Math.abs(n)},_=(t,o)=>{const e=c(t);return{x:o.x==="center"?E(e).x:g(e,o.x),y:o.y==="center"?E(e).y:g(e,o.y)}},g=(t,o)=>{const e=c(t),n=u.xyCouple(e.root).includes(o)?Math.min:Math.max;return m.X_LOCATIONS.includes(o)?n(e.one.x,e.two.x):n(e.one.y,e.two.y)},$=t=>t.one.x===t.two.x&&t.one.y===t.two.y,l=t=>M(t,"x"),w=t=>M(t,"y"),b=t=>{const o=c(t);return o.two.x-o.one.x},T=t=>{const o=c(t);return o.two.y-o.one.y},C=t=>_(t,u.TOP_LEFT),U=t=>_(t,u.TOP_RIGHT),Y=t=>_(t,u.BOTTOM_LEFT),k=t=>_(t,u.BOTTOM_RIGHT),f=t=>g(t,"right"),h=t=>g(t,"bottom"),d=t=>g(t,"left"),a=t=>g(t,"top"),E=t=>i.translate(C(t),{x:b(t)/2,y:T(t)/2}),L=t=>{const o=c(t);return o.root.x==="left"?d(o):f(o)},B=t=>{const o=c(t);return o.root.y==="top"?a(o):h(o)},J=t=>({x:L(t),y:B(t)}),P=t=>{const o=c(t);return{lower:o.one.x,upper:o.two.x}},Z=t=>{const o=c(t);return{lower:o.one.y,upper:o.two.y}},K=(t,o)=>q(t,o),Q=(t,o)=>{const e=c(t),n=m.X_LOCATIONS.includes(o)?"x":m.Y_LOCATIONS.includes(o)?"y":null;if(n===null)throw new Error(`Invalid location: ${u.location}`);const s=o==="top"||o==="left"?Math.min:Math.max,r={...e.one},x={...e.two};return r[n]=s(e.one[n],e.two[n]),x[n]=s(e.one[n],e.two[n]),[r,x]},V=(t,o)=>{const e=c(t),n=c(o),s=L(n)+(l(n)-l(e))/2,r=B(n)+(w(n)-w(e))/2;return c({x:s,y:r},R(e))},j=t=>typeof t!="object"||t==null?!1:"one"in t&&"two"in t&&"root"in t,tt=t=>l(t)/w(t),ot=(t,o,e)=>{if(typeof o=="string"){if(e==null)throw new Error("Undefined amount passed into box.translate");const s=z.construct(o);o=i.construct(s,e)}const n=c(t);return c(i.translate(n.one,o),i.translate(n.two,o),void 0,void 0,n.root)},A=(t,o)=>{const e=Math.max(d(t),d(o)),n=Math.max(a(t),a(o)),s=Math.min(f(t),f(o)),r=Math.min(h(t),h(o));return e>s||n>r?I:c({x:e,y:n},{x:s,y:r},void 0,void 0,t.root)},W=t=>l(t)*w(t),nt=(t,o)=>{const e=c(t);return c(i.truncate(e.one,o),i.truncate(e.two,o),void 0,void 0,e.root)},F=(t,o,e,n,s,r)=>{const x={x:t,y:o},p={x:t+e,y:o+n};return s.x!==r.x&&(s.x==="center"?(x.x-=e/2,p.x-=e/2):(x.x-=e,p.x-=e)),s.y!==r.y&&(s.y==="center"?(x.y-=n/2,p.y-=n/2):(x.y-=n,p.y-=n)),c(x,p,void 0,void 0,r)},et=Object.freeze(Object.defineProperty({__proto__:null,DECIMAL:S,ZERO:I,area:W,areaIsZero:$,aspect:tt,bottom:h,bottomLeft:Y,bottomRight:k,box:H,center:E,construct:c,constructWithAlternateRoot:F,contains:v,copy:q,css:X,dim:M,dims:R,edgePoints:Q,equals:D,height:w,intersection:A,isBox:j,left:d,loc:g,positionInCenter:V,reRoot:K,resize:N,right:f,root:J,signedDims:G,signedHeight:T,signedWidth:b,top:a,topLeft:C,topRight:U,translate:ot,truncate:nt,width:l,x:L,xBounds:P,xyLoc:_,y:B,yBounds:Z},Symbol.toStringTag,{value:"Module"}));exports.area=W;exports.box=et;exports.construct=c;exports.constructWithAlternateRoot=F;exports.height=w;exports.intersection=A;exports.isBox=j;exports.width=l;exports.xBounds=P;exports.xyLoc=_;exports.yBounds=Z;
package/dist/box.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./box-BcFruCBW.cjs");exports.box=e.box;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./box-C6r0YnKB.cjs");exports.box=e.box;
package/dist/box.js CHANGED
@@ -1,4 +1,4 @@
1
- import { b as r } from "./box-DC5oviHL.js";
1
+ import { b as r } from "./box-B5SaODGu.js";
2
2
  export {
3
3
  r as box
4
4
  };
package/dist/caseconv.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-2SfxIaaU.cjs");exports.caseconv=e.caseconv;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-BGz7XJIe.cjs");exports.caseconv=e.caseconv;
package/dist/caseconv.js CHANGED
@@ -1,4 +1,4 @@
1
- import { a as c } from "./index-CQk9JICS.js";
1
+ import { a as c } from "./index-C9i674Sf.js";
2
2
  export {
3
3
  c as caseconv
4
4
  };
@@ -0,0 +1 @@
1
+ "use strict";const C=e=>{const r=e.replace(/_[a-z]/g,n=>n[1].toUpperCase());return r.length>1&&r[0]===r[0].toUpperCase()&&r[1]===r[1].toUpperCase()?r:r[0].toLowerCase()+r.slice(1)},m=e=>{const r=(n,s=o)=>{if(typeof n=="string")return e(n);if(Array.isArray(n))return n.map(c=>r(c,s));if(!l(n))return n;s=O(s);const f={},p=n;return Object.keys(p).forEach(c=>{let t=p[c];const v=e(c);s.recursive&&(l(t)?y(t,s.keepTypesOnRecursion)||(t=r(t,s)):s.recursiveInArray&&u(t)&&(t=[...t].map(a=>{let i=a;return l(a)?y(i,s.keepTypesOnRecursion)||(i=r(a,s)):u(a)&&(i=r({key:a},s).key),i}))),f[v]=t}),f};return r},A=m(C),g=e=>e.replace(/([a-z0-9])([A-Z])/g,(r,n,s)=>`${n}_${s.toLowerCase()}`),k=m(g),T=e=>e[0].toUpperCase()+e.slice(1),o={recursive:!0,recursiveInArray:!0,keepTypesOnRecursion:[Number,String,Uint8Array]},O=(e=o)=>(e.recursive==null?e=o:e.recursiveInArray==null&&(e.recursiveInArray=!1),e),u=e=>e!=null&&Array.isArray(e),l=e=>e!=null&&typeof e=="object"&&!Array.isArray(e),y=(e,r)=>(r||[]).some(n=>e instanceof n),S=Object.freeze(Object.defineProperty({__proto__:null,belongToTypes:y,camelToSnake:k,capitalize:T,defaultOptions:o,isArrayObject:u,isValidObject:l,snakeToCamel:A,validateOptions:O},Symbol.toStringTag,{value:"Module"}));exports.camelToSnake=k;exports.capitalize=T;exports.caseconv=S;exports.snakeToCamel=A;
@@ -1,41 +1,41 @@
1
1
  const k = (e) => {
2
2
  const r = e.replace(/_[a-z]/g, (n) => n[1].toUpperCase());
3
3
  return r.length > 1 && r[0] === r[0].toUpperCase() && r[1] === r[1].toUpperCase() ? r : r[0].toLowerCase() + r.slice(1);
4
- }, p = (e) => {
4
+ }, A = (e) => {
5
5
  const r = (n, s = u) => {
6
6
  if (typeof n == "string") return e(n);
7
7
  if (Array.isArray(n)) return n.map((c) => r(c, s));
8
- if (!l(n)) return null;
9
- s = A(s);
10
- const f = {};
11
- return Object.keys(n).forEach((c) => {
12
- let t = n[c];
13
- const m = e(c);
8
+ if (!l(n)) return n;
9
+ s = m(s);
10
+ const f = {}, p = n;
11
+ return Object.keys(p).forEach((c) => {
12
+ let t = p[c];
13
+ const O = e(c);
14
14
  s.recursive && (l(t) ? y(t, s.keepTypesOnRecursion) || (t = r(t, s)) : s.recursiveInArray && o(t) && (t = [...t].map((a) => {
15
15
  let i = a;
16
16
  return l(a) ? y(i, s.keepTypesOnRecursion) || (i = r(a, s)) : o(a) && (i = r({ key: a }, s).key), i;
17
- }))), f[m] = t;
17
+ }))), f[O] = t;
18
18
  }), f;
19
19
  };
20
20
  return r;
21
- }, O = p(k), T = (e) => e.replace(/([a-z0-9])([A-Z])/g, (r, n, s) => `${n}_${s.toLowerCase()}`), v = p(T), C = (e) => e[0].toUpperCase() + e.slice(1), u = {
21
+ }, T = A(k), v = (e) => e.replace(/([a-z0-9])([A-Z])/g, (r, n, s) => `${n}_${s.toLowerCase()}`), C = A(v), g = (e) => e[0].toUpperCase() + e.slice(1), u = {
22
22
  recursive: !0,
23
23
  recursiveInArray: !0,
24
24
  keepTypesOnRecursion: [Number, String, Uint8Array]
25
- }, A = (e = u) => (e.recursive == null ? e = u : e.recursiveInArray == null && (e.recursiveInArray = !1), e), o = (e) => e != null && Array.isArray(e), l = (e) => e != null && typeof e == "object" && !Array.isArray(e), y = (e, r) => (r || []).some((n) => e instanceof n), S = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
25
+ }, m = (e = u) => (e.recursive == null ? e = u : e.recursiveInArray == null && (e.recursiveInArray = !1), e), o = (e) => e != null && Array.isArray(e), l = (e) => e != null && typeof e == "object" && !Array.isArray(e), y = (e, r) => (r || []).some((n) => e instanceof n), _ = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
26
26
  __proto__: null,
27
27
  belongToTypes: y,
28
- camelToSnake: v,
29
- capitalize: C,
28
+ camelToSnake: C,
29
+ capitalize: g,
30
30
  defaultOptions: u,
31
31
  isArrayObject: o,
32
32
  isValidObject: l,
33
- snakeToCamel: O,
34
- validateOptions: A
33
+ snakeToCamel: T,
34
+ validateOptions: m
35
35
  }, Symbol.toStringTag, { value: "Module" }));
36
36
  export {
37
- S as a,
38
- v as b,
39
- C as c,
40
- O as s
37
+ _ as a,
38
+ C as b,
39
+ g as c,
40
+ T as s
41
41
  };
@@ -0,0 +1,101 @@
1
+ var m = Object.defineProperty;
2
+ var C = (o, e, t) => e in o ? m(o, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : o[e] = t;
3
+ var i = (o, e, t) => C(o, typeof e != "symbol" ? e + "" : e, t);
4
+ import { s as y, b } from "./index-C9i674Sf.js";
5
+ import { isObject as l } from "./identity.js";
6
+ class f {
7
+ constructor() {
8
+ i(this, "contentType", "application/json");
9
+ i(this, "decoder");
10
+ i(this, "encoder");
11
+ this.decoder = new TextDecoder(), this.encoder = new TextEncoder();
12
+ }
13
+ encode(e) {
14
+ return this.encoder.encode(this.encodeString(e)).buffer;
15
+ }
16
+ decode(e, t) {
17
+ return this.decodeString(this.decoder.decode(e), t);
18
+ }
19
+ decodeString(e, t) {
20
+ const n = JSON.parse(e), r = y(n);
21
+ return t != null ? t.parse(r) : r;
22
+ }
23
+ encodeString(e) {
24
+ const t = b(e);
25
+ return JSON.stringify(t, (n, r) => ArrayBuffer.isView(r) ? Array.from(r) : l(r) && "encode_value" in r ? typeof r.value == "bigint" ? r.value.toString() : r.value : typeof r == "bigint" ? r.toString() : r);
26
+ }
27
+ static registerCustomType() {
28
+ }
29
+ }
30
+ class p {
31
+ constructor() {
32
+ i(this, "contentType", "text/csv");
33
+ }
34
+ encode(e) {
35
+ const t = this.encodeString(e);
36
+ return new TextEncoder().encode(t).buffer;
37
+ }
38
+ decode(e, t) {
39
+ const n = new TextDecoder().decode(e);
40
+ return this.decodeString(n, t);
41
+ }
42
+ encodeString(e) {
43
+ if (!Array.isArray(e) || e.length === 0 || !l(e[0]))
44
+ throw new Error("Payload must be an array of objects");
45
+ const t = Object.keys(e[0]), n = [t.join(",")];
46
+ return e.forEach((r) => {
47
+ const d = t.map((c) => JSON.stringify(r[c] ?? ""));
48
+ n.push(d.join(","));
49
+ }), n.join(`
50
+ `);
51
+ }
52
+ decodeString(e, t) {
53
+ const [n, ...r] = e.trim().split(`
54
+ `).map((s) => s.trim());
55
+ if (n.length === 0)
56
+ return t != null ? t.parse({}) : {};
57
+ const d = n.split(",").map((s) => s.trim()), c = {};
58
+ return d.forEach((s) => {
59
+ c[s] = [];
60
+ }), r.forEach((s) => {
61
+ const h = s.split(",").map((u) => u.trim());
62
+ d.forEach((u, T) => {
63
+ const a = this.parseValue(h[T]);
64
+ a != null && c[u].push(a);
65
+ });
66
+ }), t != null ? t.parse(c) : c;
67
+ }
68
+ parseValue(e) {
69
+ if (e == null || e.length === 0) return null;
70
+ const t = Number(e);
71
+ return isNaN(t) ? e.startsWith('"') && e.endsWith('"') ? e.slice(1, -1) : e : t;
72
+ }
73
+ static registerCustomType() {
74
+ }
75
+ }
76
+ class g {
77
+ constructor() {
78
+ i(this, "contentType", "text/plain");
79
+ }
80
+ encode(e) {
81
+ return new TextEncoder().encode(e).buffer;
82
+ }
83
+ decode(e, t) {
84
+ const n = new TextDecoder().decode(e);
85
+ return t != null ? t.parse(n) : n;
86
+ }
87
+ }
88
+ const S = new f(), E = new p(), w = new g(), O = [S], _ = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
89
+ __proto__: null,
90
+ CSVCodec: p,
91
+ CSV_CODEC: E,
92
+ ENCODERS: O,
93
+ JSONCodec: f,
94
+ JSON_CODEC: S,
95
+ TEXT_CODEC: w,
96
+ TextCodec: g
97
+ }, Symbol.toStringTag, { value: "Module" }));
98
+ export {
99
+ S as J,
100
+ _ as e
101
+ };
@@ -0,0 +1,3 @@
1
+ "use strict";var y=Object.defineProperty;var O=(o,e,t)=>e in o?y(o,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):o[e]=t;var i=(o,e,t)=>O(o,typeof e!="symbol"?e+"":e,t);const f=require("./index-BGz7XJIe.cjs"),p=require("./identity.cjs");class S{constructor(){i(this,"contentType","application/json");i(this,"decoder");i(this,"encoder");this.decoder=new TextDecoder,this.encoder=new TextEncoder}encode(e){return this.encoder.encode(this.encodeString(e)).buffer}decode(e,t){return this.decodeString(this.decoder.decode(e),t)}decodeString(e,t){const r=JSON.parse(e),n=f.snakeToCamel(r);return t!=null?t.parse(n):n}encodeString(e){const t=f.camelToSnake(e);return JSON.stringify(t,(r,n)=>ArrayBuffer.isView(n)?Array.from(n):p.isObject(n)&&"encode_value"in n?typeof n.value=="bigint"?n.value.toString():n.value:typeof n=="bigint"?n.toString():n)}static registerCustomType(){}}class g{constructor(){i(this,"contentType","text/csv")}encode(e){const t=this.encodeString(e);return new TextEncoder().encode(t).buffer}decode(e,t){const r=new TextDecoder().decode(e);return this.decodeString(r,t)}encodeString(e){if(!Array.isArray(e)||e.length===0||!p.isObject(e[0]))throw new Error("Payload must be an array of objects");const t=Object.keys(e[0]),r=[t.join(",")];return e.forEach(n=>{const d=t.map(s=>JSON.stringify(n[s]??""));r.push(d.join(","))}),r.join(`
2
+ `)}decodeString(e,t){const[r,...n]=e.trim().split(`
3
+ `).map(c=>c.trim());if(r.length===0)return t!=null?t.parse({}):{};const d=r.split(",").map(c=>c.trim()),s={};return d.forEach(c=>{s[c]=[]}),n.forEach(c=>{const C=c.split(",").map(u=>u.trim());d.forEach((u,T)=>{const l=this.parseValue(C[T]);l!=null&&s[u].push(l)})}),t!=null?t.parse(s):s}parseValue(e){if(e==null||e.length===0)return null;const t=Number(e);return isNaN(t)?e.startsWith('"')&&e.endsWith('"')?e.slice(1,-1):e:t}static registerCustomType(){}}class h{constructor(){i(this,"contentType","text/plain")}encode(e){return new TextEncoder().encode(e).buffer}decode(e,t){const r=new TextDecoder().decode(e);return t!=null?t.parse(r):r}}const a=new S,E=new g,b=new h,w=[a],m=Object.freeze(Object.defineProperty({__proto__:null,CSVCodec:g,CSV_CODEC:E,ENCODERS:w,JSONCodec:S,JSON_CODEC:a,TEXT_CODEC:b,TextCodec:h},Symbol.toStringTag,{value:"Module"}));exports.JSON_CODEC=a;exports.encoder=m;
package/dist/index.cjs CHANGED
@@ -1,3 +1,3 @@
1
- "use strict";var A=Object.defineProperty;var R=(e,r,o)=>r in e?A(e,r,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[r]=o;var p=(e,r,o)=>R(e,typeof r!="symbol"?r+"":r,o);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const O=require("./binary.cjs"),V=require("./index-2SfxIaaU.cjs"),Z=require("./change-C-YELKx6.cjs"),h=require("./scale-D_uVU2Fw.cjs"),m=require("./index-CvHP07Bs.cjs"),c=require("zod"),T=require("./debounce.cjs"),D=require("./deep.cjs"),s=require("./series-PoUlr-RX.cjs"),N=require("./identity.cjs"),P=require("./kv.cjs"),$=require("./bounds-ZZc1c-_Z.cjs"),W=require("./observe.cjs"),k=require("./record.cjs"),C=require("./external-B-DoBvh7.cjs"),G=require("./search.cjs"),L=require("./box-BcFruCBW.cjs"),B=require("./dimensions-zMcb9pMk.cjs"),I=require("./direction-DZbN47uL.cjs"),Q=require("./location-wMqTcQ0n.cjs"),U=require("./position-DolPXOLe.cjs"),_=require("./spatial-BOhaO8xN.cjs"),K=require("./xy-cP-FXJtR.cjs"),w=require("./toArray.cjs"),F=require("./unique.cjs"),M=require("./url.cjs"),q=require("./worker.cjs"),a=class a extends Number{};p(a,"Absolute",255),p(a,"Default",1),p(a,"z",c.z.union([c.z.instanceof(a),c.z.number().int().min(0).max(255).transform(r=>new a(r)),c.z.instanceof(Number).transform(r=>new a(r))]));let f=a;const z=c.z.object({name:c.z.string(),key:c.z.string()}),H=e=>c.z.object({subject:z,resource:e,authority:f.z}),J=(...e)=>r=>r.filter(o=>{let t=!1;return o.to!=null&&(t=e.includes(o.to.resource)),o.from!=null&&!t&&(t=e.includes(o.from.resource)),t}),X=Object.freeze(Object.defineProperty({__proto__:null,Authority:f,filterTransfersByChannelKey:J,stateZ:H,subjectZ:z},Symbol.toStringTag,{value:"Module"})),u=class u extends Error{constructor(){super(u.MESSAGE)}matches(r){return typeof r=="string"?r.includes(u.MESSAGE):r instanceof u||r.message.includes(u.MESSAGE)}};p(u,"MESSAGE","canceled");let S=u;const Y=new S,ee=Object.freeze(Object.defineProperty({__proto__:null,CANCELED:Y},Symbol.toStringTag,{value:"Module"})),re=e=>e?-1:1,v=c.z.string().regex(/^\d+\.\d+\.\d+$/),b=(e,r)=>{const o=v.parse(e),t=v.parse(r),[l,g,y]=o.split(".").map(Number),[d,n,i]=t.split(".").map(Number);return l!==d?l-d:g!==n?g-n:y-i},E=(e,r)=>m.isGreaterThan(b(e,r)),te=(e,r)=>m.isLessThan(b(e,r)),oe=({name:e,migrate:r})=>o=>{try{const t=r(o);return console.log(`${e} migrated: ${o.version} -> ${t.version}`),t}catch(t){throw console.log(`${e} failed to migrate from ${o.version}`),console.error(t),t}},ne=({name:e,migrations:r,targetSchema:o,def:t})=>{const l=Object.keys(r).sort(b).pop();if(l==null)return n=>{if(n.version!==t.version)return console.log(`${e} version ${n.version} is newer than latest version of ${t.version}.
1
+ "use strict";var A=Object.defineProperty;var R=(e,r,o)=>r in e?A(e,r,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[r]=o;var p=(e,r,o)=>R(e,typeof r!="symbol"?r+"":r,o);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const O=require("./index-tYmAULd8.cjs"),V=require("./index-BGz7XJIe.cjs"),Z=require("./change-C-YELKx6.cjs"),h=require("./scale-COuYv97b.cjs"),m=require("./index-CvHP07Bs.cjs"),c=require("zod"),T=require("./debounce.cjs"),D=require("./deep.cjs"),s=require("./series-CNcMldp_.cjs"),N=require("./identity.cjs"),P=require("./kv.cjs"),$=require("./bounds-ZZc1c-_Z.cjs"),W=require("./observe.cjs"),k=require("./record.cjs"),C=require("./external-B-DoBvh7.cjs"),G=require("./search.cjs"),L=require("./box-C6r0YnKB.cjs"),B=require("./dimensions-zMcb9pMk.cjs"),I=require("./direction-DZbN47uL.cjs"),Q=require("./location-55G2uRZN.cjs"),U=require("./position-BwmbckCe.cjs"),_=require("./spatial-BOhaO8xN.cjs"),K=require("./xy-cP-FXJtR.cjs"),w=require("./toArray.cjs"),F=require("./unique.cjs"),M=require("./url.cjs"),q=require("./worker.cjs"),a=class a extends Number{};p(a,"Absolute",255),p(a,"Default",1),p(a,"z",c.z.union([c.z.instanceof(a),c.z.number().int().min(0).max(255).transform(r=>new a(r)),c.z.instanceof(Number).transform(r=>new a(r))]));let y=a;const z=c.z.object({name:c.z.string(),key:c.z.string()}),H=e=>c.z.object({subject:z,resource:e,authority:y.z}),J=(...e)=>r=>r.filter(o=>{let t=!1;return o.to!=null&&(t=e.includes(o.to.resource)),o.from!=null&&!t&&(t=e.includes(o.from.resource)),t}),X=Object.freeze(Object.defineProperty({__proto__:null,Authority:y,filterTransfersByChannelKey:J,stateZ:H,subjectZ:z},Symbol.toStringTag,{value:"Module"})),u=class u extends Error{constructor(){super(u.MESSAGE)}matches(r){return typeof r=="string"?r.includes(u.MESSAGE):r instanceof u||r.message.includes(u.MESSAGE)}};p(u,"MESSAGE","canceled");let S=u;const Y=new S,ee=Object.freeze(Object.defineProperty({__proto__:null,CANCELED:Y},Symbol.toStringTag,{value:"Module"})),re=e=>e?-1:1,v=c.z.string().regex(/^\d+\.\d+\.\d+$/),b=(e,r)=>{const o=v.parse(e),t=v.parse(r),[l,g,f]=o.split(".").map(Number),[d,n,i]=t.split(".").map(Number);return l!==d?l-d:g!==n?g-n:f-i},E=(e,r)=>m.isGreaterThan(b(e,r)),te=(e,r)=>m.isLessThan(b(e,r)),oe=({name:e,migrate:r})=>o=>{try{const t=r(o);return console.log(`${e} migrated: ${o.version} -> ${t.version}`),t}catch(t){throw console.log(`${e} failed to migrate from ${o.version}`),console.error(t),t}},ne=({name:e,migrations:r,targetSchema:o,def:t})=>{const l=Object.keys(r).sort(b).pop();if(l==null)return n=>{if(n.version!==t.version)return console.log(`${e} version ${n.version} is newer than latest version of ${t.version}.
2
2
  Returning default instead.
3
- `),t;try{return o!=null?o.parse(n):n}catch(i){return console.log(`${e} failed to parse default. Exiting with default`),console.error(i),t}};const g=Object.keys(r).length;let y=!1;const d=n=>{try{if(g===0||E(n.version,l))return console.log(y?`${e} ${n.version} now up to date`:`${e} version ${n.version} is up to date with target version ${t.version}`),n;const i=n.version,x=r[i],j=x(n);return y=!0,d(j)}catch(i){return console.log(`${e} failed to migrate from ${n.version} to ${l}`),console.error(i),t}};return n=>{try{return d(n)}catch(i){return console.log(`${e} failed to parse final result. Exiting with default`),console.error(i),t}}},se=Object.freeze(Object.defineProperty({__proto__:null,compareSemVer:b,createMigration:oe,migrator:ne,semVerNewer:E,semVerOlder:te,semVerZ:v},Symbol.toStringTag,{value:"Module"})),ie=e=>{if(e===void 0||typeof e=="string"||typeof e=="number")return e;if(e.toString===void 0)throw new Error("invalid renderer");return e.toString()},ce=e=>Array.isArray(e)?[...e]:typeof e=="object"&&e!==null?{...e}:e;exports.binary=O.binary;exports.caseconv=V.caseconv;exports.change=Z.change;exports.clamp=h.clamp;exports.scale=h.scale;exports.compare=m.compare;exports.isStringer=m.isStringer;exports.primitiveIsZero=m.primitiveIsZero;exports.debounce=T.debounce;exports.throttle=T.throttle;exports.deep=D.deep;exports.DataType=s.DataType;exports.Density=s.Density;exports.MultiSeries=s.MultiSeries;exports.Rate=s.Rate;exports.Series=s.Series;exports.Size=s.Size;exports.TimeRange=s.TimeRange;exports.TimeSpan=s.TimeSpan;exports.TimeStamp=s.TimeStamp;exports.addSamples=s.addSamples;exports.convertDataType=s.convertDataType;exports.id=s.id;exports.isCrudeSeries=s.isCrudeSeries;exports.isTelemValue=s.isTelemValue;exports.typedArrayZ=s.typedArrayZ;exports.isObject=N.isObject;exports.kv=P.kv;exports.bounds=$.bounds;exports.math=$.math;exports.observe=W.observe;exports.getEntries=k.getEntries;exports.unknownRecordZ=k.unknownRecordZ;exports.runtime=C.external;exports.Search=G.Search;exports.box=L.box;exports.dimensions=B.dimensions;exports.direction=I.direction;exports.location=Q.location;exports.position=U.position;exports.spatial=_.spatial;exports.xy=K.xy;exports.nullToArr=w.nullToArr;exports.toArray=w.toArray;exports.unique=F.unique;exports.URL=M.URL;exports.buildQueryString=M.buildQueryString;exports.RoutedWorker=q.RoutedWorker;exports.TypedWorker=q.TypedWorker;exports.createMockWorkers=q.createMockWorkers;exports.control=X;exports.convertRenderV=ie;exports.errors=ee;exports.invert=re;exports.migrate=se;exports.shallowCopy=ce;
3
+ `),t;try{return o!=null?o.parse(n):n}catch(i){return console.log(`${e} failed to parse default. Exiting with default`),console.error(i),t}};const g=Object.keys(r).length;let f=!1;const d=n=>{try{if(g===0||E(n.version,l))return console.log(f?`${e} ${n.version} now up to date`:`${e} version ${n.version} is up to date with target version ${t.version}`),n;const i=n.version,x=r[i],j=x(n);return f=!0,d(j)}catch(i){return console.log(`${e} failed to migrate from ${n.version} to ${l}`),console.error(i),t}};return n=>{try{return d(n)}catch(i){return console.log(`${e} failed to parse final result. Exiting with default`),console.error(i),t}}},se=Object.freeze(Object.defineProperty({__proto__:null,compareSemVer:b,createMigration:oe,migrator:ne,semVerNewer:E,semVerOlder:te,semVerZ:v},Symbol.toStringTag,{value:"Module"})),ie=e=>{if(e===void 0||typeof e=="string"||typeof e=="number")return e;if(e.toString===void 0)throw new Error("invalid renderer");return e.toString()},ce=e=>Array.isArray(e)?[...e]:typeof e=="object"&&e!==null?{...e}:e;exports.binary=O.encoder;exports.caseconv=V.caseconv;exports.change=Z.change;exports.clamp=h.clamp;exports.scale=h.scale;exports.compare=m.compare;exports.isStringer=m.isStringer;exports.primitiveIsZero=m.primitiveIsZero;exports.debounce=T.debounce;exports.throttle=T.throttle;exports.deep=D.deep;exports.DataType=s.DataType;exports.Density=s.Density;exports.MultiSeries=s.MultiSeries;exports.Rate=s.Rate;exports.Series=s.Series;exports.Size=s.Size;exports.TimeRange=s.TimeRange;exports.TimeSpan=s.TimeSpan;exports.TimeStamp=s.TimeStamp;exports.addSamples=s.addSamples;exports.convertDataType=s.convertDataType;exports.id=s.id;exports.isCrudeSeries=s.isCrudeSeries;exports.isTelemValue=s.isTelemValue;exports.typedArrayZ=s.typedArrayZ;exports.isObject=N.isObject;exports.kv=P.kv;exports.bounds=$.bounds;exports.math=$.math;exports.observe=W.observe;exports.getEntries=k.getEntries;exports.unknownRecordZ=k.unknownRecordZ;exports.runtime=C.external;exports.Search=G.Search;exports.box=L.box;exports.dimensions=B.dimensions;exports.direction=I.direction;exports.location=Q.location;exports.position=U.position;exports.spatial=_.spatial;exports.xy=K.xy;exports.nullToArr=w.nullToArr;exports.toArray=w.toArray;exports.unique=F.unique;exports.URL=M.URL;exports.buildQueryString=M.buildQueryString;exports.RoutedWorker=q.RoutedWorker;exports.TypedWorker=q.TypedWorker;exports.createMockWorkers=q.createMockWorkers;exports.control=X;exports.convertRenderV=ie;exports.errors=ee;exports.invert=re;exports.migrate=se;exports.shallowCopy=ce;
package/dist/index.js CHANGED
@@ -1,16 +1,16 @@
1
1
  var $ = Object.defineProperty;
2
2
  var M = (e, r, t) => r in e ? $(e, r, { enumerable: !0, configurable: !0, writable: !0, value: t }) : e[r] = t;
3
3
  var m = (e, r, t) => M(e, typeof r != "symbol" ? r + "" : r, t);
4
- import { binary as _ } from "./binary.js";
5
- import { a as I } from "./index-CQk9JICS.js";
4
+ import { e as _ } from "./index-CzjnpuXF.js";
5
+ import { a as I } from "./index-C9i674Sf.js";
6
6
  import { c as Q } from "./change-DLl6DccR.js";
7
- import { c as F, s as H } from "./scale-6y6-BcVI.js";
7
+ import { c as F, s as H } from "./scale-BgCpxgAk.js";
8
8
  import { i as w, a as E } from "./index-DCwgKLH_.js";
9
9
  import { c as X, b as Y, p as ee } from "./index-DCwgKLH_.js";
10
10
  import { z as i } from "zod";
11
11
  import { debounce as oe, throttle as te } from "./debounce.js";
12
12
  import { deep as ne } from "./deep.js";
13
- import { d as ae, D as ce, M as le, R as fe, S as me, e as pe, c as ue, b as ge, T as de, a as xe, g as be, h as ye, i as Se, f as ve, t as he } from "./series-B3wKdjpi.js";
13
+ import { d as ae, D as ce, M as le, R as fe, S as me, e as pe, c as ue, b as ge, T as de, a as xe, g as be, h as ye, i as Se, f as ve, t as he } from "./series-CaeAWaDJ.js";
14
14
  import { isObject as Me } from "./identity.js";
15
15
  import { kv as Ee } from "./kv.js";
16
16
  import { b as je, m as ke } from "./bounds-CpboA0q6.js";
@@ -18,11 +18,11 @@ import { observe as Ae } from "./observe.js";
18
18
  import { getEntries as ze, unknownRecordZ as Ve } from "./record.js";
19
19
  import { e as Ne } from "./external-CO221aaF.js";
20
20
  import { Search as Ge } from "./search.js";
21
- import { b as Le } from "./box-DC5oviHL.js";
21
+ import { b as Le } from "./box-B5SaODGu.js";
22
22
  import { d as We } from "./dimensions-D-1PnJVI.js";
23
23
  import { d as _e } from "./direction-CScbfCdT.js";
24
- import { l as Ie } from "./location-D4yS2DfR.js";
25
- import { p as Qe } from "./position-DvsYXRzE.js";
24
+ import { l as Ie } from "./location-C6sCnzhU.js";
25
+ import { p as Qe } from "./position-BY9oBMZB.js";
26
26
  import { s as Fe } from "./spatial-DozyssiN.js";
27
27
  import { x as Je } from "./xy-CrgPnICw.js";
28
28
  import { nullToArr as Ye, toArray as er } from "./toArray.js";
@@ -1 +1 @@
1
- "use strict";const u=require("zod"),I=require("./index-2SfxIaaU.cjs"),c=require("./base-B48bPNx5.cjs"),R=c.xLocation,g=c.yLocation,h={top:"bottom",right:"left",bottom:"top",left:"right",center:"center"},d={top:"left",right:"top",bottom:"right",left:"bottom",center:"center"},m=c.crudeLocation,s=t=>t instanceof String?t:c.DIRECTIONS.includes(t)?t==="x"?"left":"top":t,_=t=>h[s(t)],A=t=>d[s(t)],i=t=>{const o=s(t);return o==="top"||o==="bottom"?"y":"x"},l=u.z.object({x:c.xLocation.or(c.centerLocation),y:c.yLocation.or(c.centerLocation)}),E=u.z.object({x:c.xLocation,y:c.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,o)=>t.x===o.x&&t.y===o.y,S=(t,o)=>{if(typeof o=="object"){let e=!0;return"x"in o&&(t.x===o.x||(e=!1)),"y"in o&&(t.y===o.y||(e=!1)),e}return t.x===o||t.y===o},z=t=>[t.x,t.y],y=t=>i(s(t))==="x",M=t=>i(s(t))==="y",P=t=>`${t.x}${I.capitalize(t.y)}`,X=(t,o)=>{let e,n;if(typeof t=="object"&&"x"in t?(e=t.x,n=t.y):(e=s(t),n=s(o??t)),i(e)===i(n)&&e!=="center"&&n!=="center")throw new Error(`[XYLocation] - encountered two locations with the same direction: ${e.toString()} - ${n.toString()}`);const r={...T};return e==="center"?y(n)?[r.x,r.y]=[n,e]:[r.x,r.y]=[e,n]:n==="center"?y(e)?[r.x,r.y]=[e,n]:[r.x,r.y]=[n,e]:y(e)?[r.x,r.y]=[e,n]:[r.x,r.y]=[n,e],r},Y=Object.freeze(Object.defineProperty({__proto__:null,BOTTOM_CENTER:L,BOTTOM_LEFT:x,BOTTOM_RIGHT:a,CENTER:T,CENTER_LOCATIONS:c.CENTER_LOCATIONS,LEFT_CENTER:C,RIGHT_CENTER:p,TOP_CENTER:b,TOP_LEFT:O,TOP_RIGHT:f,XY_LOCATIONS:N,X_LOCATIONS:c.X_LOCATIONS,Y_LOCATIONS:c.Y_LOCATIONS,construct:s,constructXY:X,corner:E,crude:m,direction:i,isX:y,isY:M,location:c.location,outer:c.outerLocation,rotate90:A,swap:_,x:R,xy:l,xyCouple:z,xyEquals:j,xyMatches:S,xyToString:P,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=E;exports.location=Y;exports.swap=_;exports.xy=l;exports.xyCouple=z;exports.xyEquals=j;exports.xyMatches=S;
1
+ "use strict";const u=require("zod"),I=require("./index-BGz7XJIe.cjs"),c=require("./base-B48bPNx5.cjs"),R=c.xLocation,g=c.yLocation,h={top:"bottom",right:"left",bottom:"top",left:"right",center:"center"},d={top:"left",right:"top",bottom:"right",left:"bottom",center:"center"},m=c.crudeLocation,s=t=>t instanceof String?t:c.DIRECTIONS.includes(t)?t==="x"?"left":"top":t,_=t=>h[s(t)],A=t=>d[s(t)],i=t=>{const o=s(t);return o==="top"||o==="bottom"?"y":"x"},l=u.z.object({x:c.xLocation.or(c.centerLocation),y:c.yLocation.or(c.centerLocation)}),E=u.z.object({x:c.xLocation,y:c.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,o)=>t.x===o.x&&t.y===o.y,S=(t,o)=>{if(typeof o=="object"){let e=!0;return"x"in o&&(t.x===o.x||(e=!1)),"y"in o&&(t.y===o.y||(e=!1)),e}return t.x===o||t.y===o},z=t=>[t.x,t.y],y=t=>i(s(t))==="x",M=t=>i(s(t))==="y",P=t=>`${t.x}${I.capitalize(t.y)}`,X=(t,o)=>{let e,n;if(typeof t=="object"&&"x"in t?(e=t.x,n=t.y):(e=s(t),n=s(o??t)),i(e)===i(n)&&e!=="center"&&n!=="center")throw new Error(`[XYLocation] - encountered two locations with the same direction: ${e.toString()} - ${n.toString()}`);const r={...T};return e==="center"?y(n)?[r.x,r.y]=[n,e]:[r.x,r.y]=[e,n]:n==="center"?y(e)?[r.x,r.y]=[e,n]:[r.x,r.y]=[n,e]:y(e)?[r.x,r.y]=[e,n]:[r.x,r.y]=[n,e],r},Y=Object.freeze(Object.defineProperty({__proto__:null,BOTTOM_CENTER:L,BOTTOM_LEFT:x,BOTTOM_RIGHT:a,CENTER:T,CENTER_LOCATIONS:c.CENTER_LOCATIONS,LEFT_CENTER:C,RIGHT_CENTER:p,TOP_CENTER:b,TOP_LEFT:O,TOP_RIGHT:f,XY_LOCATIONS:N,X_LOCATIONS:c.X_LOCATIONS,Y_LOCATIONS:c.Y_LOCATIONS,construct:s,constructXY:X,corner:E,crude:m,direction:i,isX:y,isY:M,location:c.location,outer:c.outerLocation,rotate90:A,swap:_,x:R,xy:l,xyCouple:z,xyEquals:j,xyMatches:S,xyToString:P,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=E;exports.location=Y;exports.swap=_;exports.xy=l;exports.xyCouple=z;exports.xyEquals=j;exports.xyMatches=S;
@@ -1,5 +1,5 @@
1
1
  import { z as O } from "zod";
2
- import { c as m } from "./index-CQk9JICS.js";
2
+ import { c as m } from "./index-C9i674Sf.js";
3
3
  import { e as f, f as x, y as a, g, D as C, C as z, X as L, Y as h, l as S, h as d } from "./base-DnZzEvvz.js";
4
4
  const N = f, R = a, I = {
5
5
  top: "bottom",
package/dist/location.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("./location-wMqTcQ0n.cjs");exports.location=o.location;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("./location-55G2uRZN.cjs");exports.location=o.location;
package/dist/location.js CHANGED
@@ -1,4 +1,4 @@
1
- import { l } from "./location-D4yS2DfR.js";
1
+ import { l } from "./location-C6sCnzhU.js";
2
2
  export {
3
3
  l as location
4
4
  };
@@ -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-DC5oviHL.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-B5SaODGu.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-D4yS2DfR.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-C6sCnzhU.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-BcFruCBW.cjs"),T=require("./direction-DZbN47uL.cjs"),r=require("./location-wMqTcQ0n.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-C6r0YnKB.cjs"),T=require("./direction-DZbN47uL.cjs"),r=require("./location-55G2uRZN.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-DolPXOLe.cjs");exports.position=o.position;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("./position-BwmbckCe.cjs");exports.position=o.position;
package/dist/position.js CHANGED
@@ -1,4 +1,4 @@
1
- import { p as i } from "./position-DvsYXRzE.js";
1
+ import { p as i } from "./position-BY9oBMZB.js";
2
2
  export {
3
3
  i as position
4
4
  };
@@ -3,8 +3,8 @@ var B = (r, t, e) => t in r ? g(r, t, { enumerable: !0, configurable: !0, writab
3
3
  var i = (r, t, e) => B(r, typeof t != "symbol" ? t + "" : t, e);
4
4
  import { z as R } from "zod";
5
5
  import { c as l } from "./bounds-CpboA0q6.js";
6
- import { e as T, f as x, y as h, c as E } from "./box-DC5oviHL.js";
7
- import { b as I } from "./location-D4yS2DfR.js";
6
+ import { e as T, f as x, y as h, c as E } from "./box-B5SaODGu.js";
7
+ import { b as I } from "./location-C6sCnzhU.js";
8
8
  import { b as w, c as Y } from "./xy-CrgPnICw.js";
9
9
  const j = (r, t, e) => t !== void 0 && r < t ? t : e !== void 0 && r > e ? e : r, z = R.object({ offset: w, scale: w }), D = (r) => (t, e, s, n) => e === "dimension" ? [t, s] : [
10
10
  t,
@@ -1 +1 @@
1
- "use strict";var v=Object.defineProperty;var g=(n,t,e)=>t in n?v(n,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):n[t]=e;var i=(n,t,e)=>g(n,typeof t!="symbol"?t+"":t,e);const R=require("zod"),x=require("./bounds-ZZc1c-_Z.cjs"),u=require("./box-BcFruCBW.cjs"),T=require("./location-wMqTcQ0n.cjs"),h=require("./xy-cP-FXJtR.cjs"),m=(n,t,e)=>t!==void 0&&n<t?t:e!==void 0&&n>e?e:n,q=R.z.object({offset:h.crudeZ,scale:h.crudeZ}),E=n=>(t,e,s,r)=>e==="dimension"?[t,s]:[t,r?s-n:s+n],I=n=>(t,e,s,r)=>[t,r?s/n:s*n],Y=n=>(t,e,s)=>{if(t===null)return[n,s];const{lower:r,upper:o}=t,{lower:p,upper:l}=n,f=o-r,w=l-p;if(e==="dimension")return[n,s*(w/f)];const B=(s-r)*(w/f)+p;return[n,B]},j=n=>(t,e,s)=>[n,s],z=()=>(n,t,e)=>{if(n===null)throw new Error("cannot invert without bounds");if(t==="dimension")return[n,e];const{lower:s,upper:r}=n;return[n,r-(e-s)]},D=n=>(t,e,s)=>{const{lower:r,upper:o}=n;return s=m(s,r,o),[t,s]},a=class a{constructor(){i(this,"ops",[]);i(this,"currBounds",null);i(this,"currType",null);i(this,"reversed",!1);this.ops=[]}static translate(t){return new a().translate(t)}static magnify(t){return new a().magnify(t)}static scale(t,e){return new a().scale(t,e)}translate(t){const e=this.new(),s=E(t);return s.type="translate",e.ops.push(s),e}magnify(t){const e=this.new(),s=I(t);return s.type="magnify",e.ops.push(s),e}scale(t,e){const s=x.construct(t,e),r=this.new(),o=Y(s);return o.type="scale",r.ops.push(o),r}clamp(t,e){const s=x.construct(t,e),r=this.new(),o=D(s);return o.type="clamp",r.ops.push(o),r}reBound(t,e){const s=x.construct(t,e),r=this.new(),o=j(s);return o.type="re-bound",r.ops.push(o),r}invert(){const t=z();t.type="invert";const e=this.new();return e.ops.push(t),e}pos(t){return this.exec("position",t)}dim(t){return this.exec("dimension",t)}new(){const t=new a;return t.ops=this.ops.slice(),t.reversed=this.reversed,t}exec(t,e){return this.currBounds=null,this.ops.reduce(([s,r],o)=>o(s,t,r,this.reversed),[null,e])[1]}reverse(){const t=this.new();t.ops.reverse();const e=[];return t.ops.forEach((s,r)=>{if(s.type==="scale"||e.some(([p,l])=>r>=p&&r<=l))return;const o=t.ops.findIndex((p,l)=>p.type==="scale"&&l>r);o!==-1&&e.push([r,o])}),e.forEach(([s,r])=>{const o=t.ops.slice(s,r);o.unshift(t.ops[r]),t.ops.splice(s,r-s+1,...o)}),t.reversed=!t.reversed,t}};i(a,"IDENTITY",new a);let y=a;const L=n=>({scale:{x:n.x.dim(1),y:n.y.dim(1)},offset:{x:n.x.pos(0),y:n.y.pos(0)}}),c=class c{constructor(t=new y,e=new y,s=null){i(this,"x");i(this,"y");i(this,"currRoot");this.x=t,this.y=e,this.currRoot=s}static translate(t,e){return new c().translate(t,e)}static translateX(t){return new c().translateX(t)}static translateY(t){return new c().translateY(t)}static clamp(t){return new c().clamp(t)}static magnify(t){return new c().magnify(t)}static scale(t){return new c().scale(t)}static reBound(t){return new c().reBound(t)}translate(t,e){const s=h.construct(t,e),r=this.copy();return r.x=this.x.translate(s.x),r.y=this.y.translate(s.y),r}translateX(t){const e=this.copy();return e.x=this.x.translate(t),e}translateY(t){const e=this.copy();return e.y=this.y.translate(t),e}magnify(t){const e=this.copy();return e.x=this.x.magnify(t.x),e.y=this.y.magnify(t.y),e}scale(t){const e=this.copy();if(u.isBox(t)){const s=this.currRoot;return e.currRoot=t.root,s!=null&&!T.xyEquals(s,t.root)&&(s.x!==t.root.x&&(e.x=e.x.invert()),s.y!==t.root.y&&(e.y=e.y.invert())),e.x=e.x.scale(u.xBounds(t)),e.y=e.y.scale(u.yBounds(t)),e}return e.x=e.x.scale(t.width),e.y=e.y.scale(t.height),e}reBound(t){const e=this.copy();return e.x=this.x.reBound(u.xBounds(t)),e.y=this.y.reBound(u.yBounds(t)),e}clamp(t){const e=this.copy();return e.x=this.x.clamp(u.xBounds(t)),e.y=this.y.clamp(u.yBounds(t)),e}copy(){const t=new c;return t.currRoot=this.currRoot,t.x=this.x,t.y=this.y,t}reverse(){const t=this.copy();return t.x=this.x.reverse(),t.y=this.y.reverse(),t}pos(t){return{x:this.x.pos(t.x),y:this.y.pos(t.y)}}box(t){return u.construct(this.pos(t.one),this.pos(t.two),0,0,this.currRoot??t.root)}};i(c,"IDENTITY",new c);let d=c;const M=Object.freeze(Object.defineProperty({__proto__:null,Scale:y,XY:d,crudeXYTransform:q,xyScaleToTransform:L},Symbol.toStringTag,{value:"Module"}));exports.clamp=m;exports.scale=M;
1
+ "use strict";var v=Object.defineProperty;var g=(n,t,e)=>t in n?v(n,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):n[t]=e;var i=(n,t,e)=>g(n,typeof t!="symbol"?t+"":t,e);const R=require("zod"),x=require("./bounds-ZZc1c-_Z.cjs"),u=require("./box-C6r0YnKB.cjs"),T=require("./location-55G2uRZN.cjs"),h=require("./xy-cP-FXJtR.cjs"),m=(n,t,e)=>t!==void 0&&n<t?t:e!==void 0&&n>e?e:n,q=R.z.object({offset:h.crudeZ,scale:h.crudeZ}),E=n=>(t,e,s,r)=>e==="dimension"?[t,s]:[t,r?s-n:s+n],I=n=>(t,e,s,r)=>[t,r?s/n:s*n],Y=n=>(t,e,s)=>{if(t===null)return[n,s];const{lower:r,upper:o}=t,{lower:p,upper:l}=n,f=o-r,w=l-p;if(e==="dimension")return[n,s*(w/f)];const B=(s-r)*(w/f)+p;return[n,B]},j=n=>(t,e,s)=>[n,s],z=()=>(n,t,e)=>{if(n===null)throw new Error("cannot invert without bounds");if(t==="dimension")return[n,e];const{lower:s,upper:r}=n;return[n,r-(e-s)]},D=n=>(t,e,s)=>{const{lower:r,upper:o}=n;return s=m(s,r,o),[t,s]},a=class a{constructor(){i(this,"ops",[]);i(this,"currBounds",null);i(this,"currType",null);i(this,"reversed",!1);this.ops=[]}static translate(t){return new a().translate(t)}static magnify(t){return new a().magnify(t)}static scale(t,e){return new a().scale(t,e)}translate(t){const e=this.new(),s=E(t);return s.type="translate",e.ops.push(s),e}magnify(t){const e=this.new(),s=I(t);return s.type="magnify",e.ops.push(s),e}scale(t,e){const s=x.construct(t,e),r=this.new(),o=Y(s);return o.type="scale",r.ops.push(o),r}clamp(t,e){const s=x.construct(t,e),r=this.new(),o=D(s);return o.type="clamp",r.ops.push(o),r}reBound(t,e){const s=x.construct(t,e),r=this.new(),o=j(s);return o.type="re-bound",r.ops.push(o),r}invert(){const t=z();t.type="invert";const e=this.new();return e.ops.push(t),e}pos(t){return this.exec("position",t)}dim(t){return this.exec("dimension",t)}new(){const t=new a;return t.ops=this.ops.slice(),t.reversed=this.reversed,t}exec(t,e){return this.currBounds=null,this.ops.reduce(([s,r],o)=>o(s,t,r,this.reversed),[null,e])[1]}reverse(){const t=this.new();t.ops.reverse();const e=[];return t.ops.forEach((s,r)=>{if(s.type==="scale"||e.some(([p,l])=>r>=p&&r<=l))return;const o=t.ops.findIndex((p,l)=>p.type==="scale"&&l>r);o!==-1&&e.push([r,o])}),e.forEach(([s,r])=>{const o=t.ops.slice(s,r);o.unshift(t.ops[r]),t.ops.splice(s,r-s+1,...o)}),t.reversed=!t.reversed,t}};i(a,"IDENTITY",new a);let y=a;const L=n=>({scale:{x:n.x.dim(1),y:n.y.dim(1)},offset:{x:n.x.pos(0),y:n.y.pos(0)}}),c=class c{constructor(t=new y,e=new y,s=null){i(this,"x");i(this,"y");i(this,"currRoot");this.x=t,this.y=e,this.currRoot=s}static translate(t,e){return new c().translate(t,e)}static translateX(t){return new c().translateX(t)}static translateY(t){return new c().translateY(t)}static clamp(t){return new c().clamp(t)}static magnify(t){return new c().magnify(t)}static scale(t){return new c().scale(t)}static reBound(t){return new c().reBound(t)}translate(t,e){const s=h.construct(t,e),r=this.copy();return r.x=this.x.translate(s.x),r.y=this.y.translate(s.y),r}translateX(t){const e=this.copy();return e.x=this.x.translate(t),e}translateY(t){const e=this.copy();return e.y=this.y.translate(t),e}magnify(t){const e=this.copy();return e.x=this.x.magnify(t.x),e.y=this.y.magnify(t.y),e}scale(t){const e=this.copy();if(u.isBox(t)){const s=this.currRoot;return e.currRoot=t.root,s!=null&&!T.xyEquals(s,t.root)&&(s.x!==t.root.x&&(e.x=e.x.invert()),s.y!==t.root.y&&(e.y=e.y.invert())),e.x=e.x.scale(u.xBounds(t)),e.y=e.y.scale(u.yBounds(t)),e}return e.x=e.x.scale(t.width),e.y=e.y.scale(t.height),e}reBound(t){const e=this.copy();return e.x=this.x.reBound(u.xBounds(t)),e.y=this.y.reBound(u.yBounds(t)),e}clamp(t){const e=this.copy();return e.x=this.x.clamp(u.xBounds(t)),e.y=this.y.clamp(u.yBounds(t)),e}copy(){const t=new c;return t.currRoot=this.currRoot,t.x=this.x,t.y=this.y,t}reverse(){const t=this.copy();return t.x=this.x.reverse(),t.y=this.y.reverse(),t}pos(t){return{x:this.x.pos(t.x),y:this.y.pos(t.y)}}box(t){return u.construct(this.pos(t.one),this.pos(t.two),0,0,this.currRoot??t.root)}};i(c,"IDENTITY",new c);let d=c;const M=Object.freeze(Object.defineProperty({__proto__:null,Scale:y,XY:d,crudeXYTransform:q,xyScaleToTransform:L},Symbol.toStringTag,{value:"Module"}));exports.clamp=m;exports.scale=M;
package/dist/scale.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./scale-D_uVU2Fw.cjs");exports.scale=e.scale;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./scale-COuYv97b.cjs");exports.scale=e.scale;