@synnaxlabs/x 0.44.0 → 0.44.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +0,0 @@
1
- "use strict";const u=require("zod"),R=require("./direction-386XDm2w.cjs"),x=require("./location-DZi8ftXp.cjs"),i=require("./xy-B7065J2S.cjs"),m=require("./base-BAM2mqCy.cjs"),p=u.z.union([u.z.number(),u.z.string()]),H=u.z.object({top:p,left:p,width:p,height:p}),W=u.z.object({left:u.z.number(),top:u.z.number(),right:u.z.number(),bottom:u.z.number()}),S=u.z.object({one:m.xy,two:m.xy,root:x.corner}),B={one:i.ZERO,two:i.ZERO,root:x.TOP_LEFT},v={one:i.ZERO,two:i.ONE,root:x.BOTTOM_LEFT},C=(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??x.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))},G=(t,o,e)=>{const n=c(t);if(typeof o=="string"){if(e==null)throw new Error("Invalid arguments for resize");const s=R.construct(o);return c(n.one,void 0,s==="x"?e:w(n),s==="y"?e:d(n),n.root)}return c(n.one,o,void 0,void 0,n.root)},D=(t,o,e=!0)=>{const n=c(t);let s=(r,y)=>r<y;return e&&(s=(r,y)=>r<=y),"one"in o?s(a(n),a(o))&&s(h(o),h(n))&&s(f(n),f(o))&&s(_(o),_(n)):s(a(n),o.x)&&s(o.x,h(n))&&s(f(n),o.y)&&s(o.y,_(n))},X=(t,o)=>i.equals(t.one,o.one)&&i.equals(t.two,o.two)&&x.xyEquals(t.root,o.root),I=t=>({width:w(t),height:d(t)}),$=t=>({signedWidth:O(t),signedHeight:E(t)}),U=t=>({top:f(t),left:a(t),width:w(t),height:d(t)}),L=(t,o,e=!1)=>{const n=R.construct(o)==="y"?E(t):O(t);return e?n:Math.abs(n)},l=(t,o)=>{const e=c(t);return{x:o.x==="center"?b(e).x:g(e,o.x),y:o.y==="center"?b(e).y:g(e,o.y)}},g=(t,o)=>{const e=c(t),n=x.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)},Y=t=>t.one.x===t.two.x&&t.one.y===t.two.y,w=t=>L(t,"x"),d=t=>L(t,"y"),O=t=>{const o=c(t);return o.two.x-o.one.x},E=t=>{const o=c(t);return o.two.y-o.one.y},q=t=>l(t,x.TOP_LEFT),k=t=>l(t,x.TOP_CENTER),J=t=>l(t,x.TOP_RIGHT),K=t=>l(t,x.BOTTOM_LEFT),Q=t=>l(t,x.BOTTOM_CENTER),V=t=>l(t,x.BOTTOM_RIGHT),tt=t=>l(t,x.CENTER_LEFT),ot=t=>l(t,x.CENTER_RIGHT),h=t=>g(t,"right"),_=t=>g(t,"bottom"),a=t=>g(t,"left"),f=t=>g(t,"top"),b=t=>i.translate(q(t),{x:O(t)/2,y:E(t)/2}),M=t=>{const o=c(t);return o.root.x==="left"?a(o):h(o)},z=t=>{const o=c(t);return o.root.y==="top"?f(o):_(o)},nt=t=>({x:M(t),y:z(t)}),N=t=>{const o=c(t);return{lower:o.one.x,upper:o.two.x}},P=t=>{const o=c(t);return{lower:o.one.y,upper:o.two.y}},et=(t,o)=>C(t,o),rt=(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: ${o}`);const s=o==="top"||o==="left"?Math.min:Math.max,r={...e.one},y={...e.two};return r[n]=s(e.one[n],e.two[n]),y[n]=s(e.one[n],e.two[n]),[r,y]},st=(t,o)=>{const e=c(t),n=c(o),s=M(n)+(w(n)-w(e))/2,r=z(n)+(d(n)-d(e))/2;return c({x:s,y:r},I(e))},Z=t=>typeof t!="object"||t==null?!1:"one"in t&&"two"in t&&"root"in t,ct=t=>w(t)/d(t),it=(t,o,e)=>{if(typeof o=="string"){if(e==null)throw new Error("Undefined amount passed into box.translate");const s=R.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)},j=(t,o)=>{const e=Math.max(a(t),a(o)),n=Math.max(f(t),f(o)),s=Math.min(h(t),h(o)),r=Math.min(_(t),_(o));return e>s||n>r?B:c({x:e,y:n},{x:s,y:r},void 0,void 0,t.root)},A=t=>w(t)*d(t),xt=(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 y={x:t,y:o},T={x:t+e,y:o+n};return s.x!==r.x&&(s.x==="center"?(y.x-=e/2,T.x-=e/2):(y.x-=e,T.x-=e)),s.y!==r.y&&(s.y==="center"?(y.y-=n/2,T.y-=n/2):(y.y-=n,T.y-=n)),c(y,T,void 0,void 0,r)},yt=Object.freeze(Object.defineProperty({__proto__:null,DECIMAL:v,ZERO:B,area:A,areaIsZero:Y,aspect:ct,bottom:_,bottomCenter:Q,bottomLeft:K,bottomRight:V,box:S,center:b,centerLeft:tt,centerRight:ot,construct:c,constructWithAlternateRoot:F,contains:D,copy:C,css:U,cssBox:H,dim:L,dims:I,domRect:W,edgePoints:rt,equals:X,height:d,intersection:j,isBox:Z,left:a,loc:g,positionInCenter:st,reRoot:et,resize:G,right:h,root:nt,signedDims:$,signedHeight:E,signedWidth:O,top:f,topCenter:k,topLeft:q,topRight:J,translate:it,truncate:xt,width:w,x:M,xBounds:N,xyLoc:l,y:z,yBounds:P},Symbol.toStringTag,{value:"Module"}));exports.area=A;exports.box=yt;exports.construct=c;exports.constructWithAlternateRoot=F;exports.height=d;exports.intersection=j;exports.isBox=Z;exports.width=w;exports.xBounds=N;exports.xyLoc=l;exports.yBounds=P;
@@ -1,205 +0,0 @@
1
- import { z as x } from "zod";
2
- import { c as O } from "./direction-8etxfKaR.js";
3
- import { c as A, T as M, B as j, b as S, d as Z, e as q, f as v, g as F, h as G, i as D, j as X } from "./location-Ar5y2DX2.js";
4
- import { Z as g, O as Y, e as I, t as b, c as U, a as L } from "./xy-D_LqxaGt.js";
5
- import { x as $, X as N, Y as k } from "./base-DFq0vvGn.js";
6
- const h = x.union([x.number(), x.string()]), J = x.object({
7
- top: h,
8
- left: h,
9
- width: h,
10
- height: h
11
- }), K = x.object({
12
- left: x.number(),
13
- top: x.number(),
14
- right: x.number(),
15
- bottom: x.number()
16
- }), Q = x.object({
17
- one: $,
18
- two: $,
19
- root: A
20
- }), H = { one: g, two: g, root: M }, V = { one: g, two: Y, root: j }, P = (t, o) => ({
21
- one: t.one,
22
- two: t.two,
23
- root: o ?? t.root
24
- }), c = (t, o, e = 0, n = 0, r) => {
25
- const s = {
26
- one: { ...g },
27
- two: { ...g },
28
- root: r ?? M
29
- };
30
- if (typeof t == "number") {
31
- if (typeof o != "number")
32
- throw new Error("Box constructor called with invalid arguments");
33
- return s.one = { x: t, y: o }, s.two = { x: s.one.x + e, y: s.one.y + n }, s;
34
- }
35
- return "one" in t && "two" in t && "root" in t ? { ...t, root: r ?? t.root } : ("getBoundingClientRect" in t && (t = t.getBoundingClientRect()), "left" in t ? (s.one = { x: t.left, y: t.top }, s.two = { x: t.right, y: t.bottom }, s) : (s.one = t, o == null ? s.two = { x: s.one.x + e, y: s.one.y + n } : typeof o == "number" ? s.two = { x: s.one.x + o, y: s.one.y + e } : "width" in o ? s.two = {
36
- x: s.one.x + o.width,
37
- y: s.one.y + o.height
38
- } : "signedWidth" in o ? s.two = {
39
- x: s.one.x + o.signedWidth,
40
- y: s.one.y + o.signedHeight
41
- } : s.two = o, s));
42
- }, tt = (t, o, e) => {
43
- const n = c(t);
44
- if (typeof o == "string") {
45
- if (e == null) throw new Error("Invalid arguments for resize");
46
- const r = O(o);
47
- return c(
48
- n.one,
49
- void 0,
50
- r === "x" ? e : f(n),
51
- r === "y" ? e : w(n),
52
- n.root
53
- );
54
- }
55
- return c(n.one, o, void 0, void 0, n.root);
56
- }, ot = (t, o, e = !0) => {
57
- const n = c(t);
58
- let r = (s, i) => s < i;
59
- return e && (r = (s, i) => s <= i), "one" in o ? r(a(n), a(o)) && r(l(o), l(n)) && r(u(n), u(o)) && r(m(o), m(n)) : r(a(n), o.x) && r(o.x, l(n)) && r(u(n), o.y) && r(o.y, m(n));
60
- }, nt = (t, o) => I(t.one, o.one) && I(t.two, o.two) && S(t.root, o.root), W = (t) => ({
61
- width: f(t),
62
- height: w(t)
63
- }), et = (t) => ({
64
- signedWidth: _(t),
65
- signedHeight: T(t)
66
- }), st = (t) => ({
67
- top: u(t),
68
- left: a(t),
69
- width: f(t),
70
- height: w(t)
71
- }), C = (t, o, e = !1) => {
72
- const n = O(o) === "y" ? T(t) : _(t);
73
- return e ? n : Math.abs(n);
74
- }, y = (t, o) => {
75
- const e = c(t);
76
- return {
77
- x: o.x === "center" ? E(e).x : d(e, o.x),
78
- y: o.y === "center" ? E(e).y : d(e, o.y)
79
- };
80
- }, d = (t, o) => {
81
- const e = c(t), n = Z(e.root).includes(o) ? Math.min : Math.max;
82
- return N.includes(o) ? n(e.one.x, e.two.x) : n(e.one.y, e.two.y);
83
- }, rt = (t) => t.one.x === t.two.x && t.one.y === t.two.y, f = (t) => C(t, "x"), w = (t) => C(t, "y"), _ = (t) => {
84
- const o = c(t);
85
- return o.two.x - o.one.x;
86
- }, T = (t) => {
87
- const o = c(t);
88
- return o.two.y - o.one.y;
89
- }, z = (t) => y(t, M), ct = (t) => y(t, q), it = (t) => y(t, v), xt = (t) => y(t, j), yt = (t) => y(t, F), at = (t) => y(t, G), ut = (t) => y(t, D), ft = (t) => y(t, X), l = (t) => d(t, "right"), m = (t) => d(t, "bottom"), a = (t) => d(t, "left"), u = (t) => d(t, "top"), E = (t) => b(z(t), {
90
- x: _(t) / 2,
91
- y: T(t) / 2
92
- }), B = (t) => {
93
- const o = c(t);
94
- return o.root.x === "left" ? a(o) : l(o);
95
- }, R = (t) => {
96
- const o = c(t);
97
- return o.root.y === "top" ? u(o) : m(o);
98
- }, wt = (t) => ({ x: B(t), y: R(t) }), lt = (t) => {
99
- const o = c(t);
100
- return { lower: o.one.x, upper: o.two.x };
101
- }, mt = (t) => {
102
- const o = c(t);
103
- return { lower: o.one.y, upper: o.two.y };
104
- }, dt = (t, o) => P(t, o), pt = (t, o) => {
105
- const e = c(t), n = N.includes(o) ? "x" : k.includes(o) ? "y" : null;
106
- if (n === null) throw new Error(`Invalid location: ${o}`);
107
- const r = o === "top" || o === "left" ? Math.min : Math.max, s = { ...e.one }, i = { ...e.two };
108
- return s[n] = r(e.one[n], e.two[n]), i[n] = r(e.one[n], e.two[n]), [s, i];
109
- }, gt = (t, o) => {
110
- const e = c(t), n = c(o), r = B(n) + (f(n) - f(e)) / 2, s = R(n) + (w(n) - w(e)) / 2;
111
- return c({ x: r, y: s }, W(e));
112
- }, ht = (t) => typeof t != "object" || t == null ? !1 : "one" in t && "two" in t && "root" in t, _t = (t) => f(t) / w(t), Tt = (t, o, e) => {
113
- if (typeof o == "string") {
114
- if (e == null) throw new Error("Undefined amount passed into box.translate");
115
- const r = O(o);
116
- o = U(r, e);
117
- }
118
- const n = c(t);
119
- return c(
120
- b(n.one, o),
121
- b(n.two, o),
122
- void 0,
123
- void 0,
124
- n.root
125
- );
126
- }, bt = (t, o) => {
127
- const e = Math.max(a(t), a(o)), n = Math.max(u(t), u(o)), r = Math.min(l(t), l(o)), s = Math.min(m(t), m(o));
128
- return e > r || n > s ? H : c({ x: e, y: n }, { x: r, y: s }, void 0, void 0, t.root);
129
- }, Et = (t) => f(t) * w(t), Ot = (t, o) => {
130
- const e = c(t);
131
- return c(
132
- L(e.one, o),
133
- L(e.two, o),
134
- void 0,
135
- void 0,
136
- e.root
137
- );
138
- }, Mt = (t, o, e, n, r, s) => {
139
- const i = { x: t, y: o }, p = { x: t + e, y: o + n };
140
- return r.x !== s.x && (r.x === "center" ? (i.x -= e / 2, p.x -= e / 2) : (i.x -= e, p.x -= e)), r.y !== s.y && (r.y === "center" ? (i.y -= n / 2, p.y -= n / 2) : (i.y -= n, p.y -= n)), c(i, p, void 0, void 0, s);
141
- }, $t = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
142
- __proto__: null,
143
- DECIMAL: V,
144
- ZERO: H,
145
- area: Et,
146
- areaIsZero: rt,
147
- aspect: _t,
148
- bottom: m,
149
- bottomCenter: yt,
150
- bottomLeft: xt,
151
- bottomRight: at,
152
- box: Q,
153
- center: E,
154
- centerLeft: ut,
155
- centerRight: ft,
156
- construct: c,
157
- constructWithAlternateRoot: Mt,
158
- contains: ot,
159
- copy: P,
160
- css: st,
161
- cssBox: J,
162
- dim: C,
163
- dims: W,
164
- domRect: K,
165
- edgePoints: pt,
166
- equals: nt,
167
- height: w,
168
- intersection: bt,
169
- isBox: ht,
170
- left: a,
171
- loc: d,
172
- positionInCenter: gt,
173
- reRoot: dt,
174
- resize: tt,
175
- right: l,
176
- root: wt,
177
- signedDims: et,
178
- signedHeight: T,
179
- signedWidth: _,
180
- top: u,
181
- topCenter: ct,
182
- topLeft: z,
183
- topRight: it,
184
- translate: Tt,
185
- truncate: Ot,
186
- width: f,
187
- x: B,
188
- xBounds: lt,
189
- xyLoc: y,
190
- y: R,
191
- yBounds: mt
192
- }, Symbol.toStringTag, { value: "Module" }));
193
- export {
194
- Mt as a,
195
- $t as b,
196
- c,
197
- Et as d,
198
- ht as e,
199
- lt as f,
200
- w as h,
201
- bt as i,
202
- f as w,
203
- y as x,
204
- mt as y
205
- };
@@ -1 +0,0 @@
1
- "use strict";const O=require("zod"),i=require("./base-BAM2mqCy.cjs"),z=O.z.union([O.z.number(),i.xy,i.numberCouple,i.dimensions,i.signedDimensions,i.clientXY]),s=(t,n)=>{if(typeof t=="string"){if(n===void 0)throw new Error("The y coordinate must be given.");return t==="x"?{x:n,y:0}:{x:0,y:n}}return typeof t=="number"?{x:t,y:n??t}:Array.isArray(t)?{x:t[0],y:t[1]}:"signedWidth"in t?{x:t.signedWidth,y:t.signedHeight}:"clientX"in t?{x:t.clientX,y:t.clientY}:"width"in t?{x:t.width,y:t.height}:{x:t.x,y:t.y}},u=Object.freeze({x:0,y:0}),P=Object.freeze({x:1,y:1}),v=Object.freeze({x:1/0,y:1/0}),w=Object.freeze({x:NaN,y:NaN}),g=(t,n,e=0)=>{const r=s(t),o=s(n);return e===0?r.x===o.x&&r.y===o.y:Math.abs(r.x-o.x)<=e&&Math.abs(r.y-o.y)<=e},E=t=>g(t,u),h=(t,n,e)=>{const r=s(t),o=s(n,e);return{x:r.x*o.x,y:r.y*o.y}},_=(t,n)=>{const e=s(t);return{x:e.x+n,y:e.y}},j=(t,n)=>{const e=s(t);return{x:e.x,y:e.y+n}},p=(t,n,e,...r)=>typeof n=="string"&&typeof e=="number"?n==="x"?_(t,e):j(t,e):[t,n,e??u,...r].reduce((o,y)=>{const c=s(y);return{x:o.x+c.x,y:o.y+c.y}},u),I=(t,n,e)=>{const r=s(t);return n==="x"?{x:e,y:r.y}:{x:r.x,y:e}},Z=(t,n)=>{const e=s(t),r=s(n);return Math.sqrt((e.x-r.x)**2+(e.y-r.y)**2)},A=(t,n)=>{const e=s(t),r=s(n);return{x:r.x-e.x,y:r.y-e.y}},T=t=>{const n=s(t);return Number.isNaN(n.x)||Number.isNaN(n.y)},H=t=>{const n=s(t);return Number.isFinite(n.x)&&Number.isFinite(n.y)},R=t=>{const n=s(t);return[n.x,n.y]},S=t=>{const n=s(t);return{left:n.x,top:n.y}},F=(t,n=0)=>{const e=s(t);return{x:Number(e.x.toFixed(n)),y:Number(e.y.toFixed(n))}},m=(t,n)=>{const e=s(t),r=s(n);return{x:e.x-r.x,y:e.y-r.y}},b=t=>{const n=s(t),e=Math.hypot(n.x,n.y);return e===0?{x:0,y:0}:{x:-n.y/e,y:n.x/e}},X=t=>{const n=s(t),e=Math.hypot(n.x,n.y);return e===0?{x:0,y:0}:{x:n.x/e,y:n.y/e}},Y=(...t)=>{const n=t.reduce((e,r)=>p(e,r),u);return h(n,1/t.length)},W=(t,n)=>{const e=[];for(let r=0;r<t.length;r++){const o=t[r];let y,c,d,x;if(r===0){const a=t[r+1],l=m(a,o);c=b(l),d=c,x=n}else if(r===t.length-1){const a=t[r-1],l=m(o,a);y=b(l),d=y,x=n}else{const a=t[r-1],l=t[r+1],f=m(o,a),N=m(l,o);y=b(f),c=b(N);const q=Math.acos((f.x*N.x+f.y*N.y)/(Math.hypot(f.x,f.y)*Math.hypot(N.x,N.y))),M=Math.sin(q/2);M===0?x=n:x=n/M,d=X(Y(y,c))}e.push(h(d,x))}return e},C=t=>{const n=s(t);return{x:n.y,y:n.x}},D=Object.freeze(Object.defineProperty({__proto__:null,INFINITY:v,NAN:w,ONE:P,ZERO:u,average:Y,calculateMiters:W,clientXY:i.clientXY,construct:s,couple:R,crudeZ:z,css:S,distance:Z,equals:g,isFinite:H,isNan:T,isZero:E,normal:b,normalize:X,scale:h,set:I,sub:m,swap:C,translate:p,translateX:_,translateY:j,translation:A,truncate:F,xy:i.xy},Symbol.toStringTag,{value:"Module"}));exports.ONE=P;exports.ZERO=u;exports.construct=s;exports.crudeZ=z;exports.equals=g;exports.translate=p;exports.truncate=F;exports.xy=D;