@danxbot/ui 15.27.1 → 15.29.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.
- package/dist/index.js +12031 -11642
- package/dist/index.js.map +1 -1
- package/dist/pure.js +157 -134
- package/dist/pure.js.map +1 -1
- package/dist/styles.css +1 -1
- package/dist/theme.css +11 -0
- package/dist/types/components/LegalDocument.d.ts +23 -0
- package/dist/types/components/chart/BarList.d.ts +27 -0
- package/dist/types/components/chart/ShareBar.d.ts +20 -0
- package/dist/types/components/chart/shared.d.ts +49 -0
- package/dist/types/index.d.ts +5 -0
- package/dist/types/lib/chart-palette.d.ts +14 -0
- package/dist/types/lib/legal-document.d.ts +82 -0
- package/dist/types/pure.d.ts +2 -0
- package/package.json +1 -1
package/dist/pure.js
CHANGED
|
@@ -1,89 +1,89 @@
|
|
|
1
|
-
function
|
|
1
|
+
function W(t) {
|
|
2
2
|
if (!Number.isFinite(t) || t < 0) return "";
|
|
3
3
|
if (t < 1024) return `${t} B`;
|
|
4
|
-
const
|
|
5
|
-
let
|
|
6
|
-
for (;
|
|
7
|
-
|
|
8
|
-
return `${
|
|
4
|
+
const e = ["KB", "MB", "GB", "TB"];
|
|
5
|
+
let n = t / 1024, r = 0;
|
|
6
|
+
for (; n >= 1024 && r < e.length - 1; )
|
|
7
|
+
n /= 1024, r += 1;
|
|
8
|
+
return `${n < 10 ? n.toFixed(1) : Math.round(n)} ${e[r]}`;
|
|
9
9
|
}
|
|
10
|
-
function
|
|
11
|
-
return
|
|
10
|
+
function K(t) {
|
|
11
|
+
return O(t);
|
|
12
12
|
}
|
|
13
|
-
function
|
|
13
|
+
function O(t) {
|
|
14
14
|
if (t == null || !Number.isFinite(t)) return "—";
|
|
15
|
-
const
|
|
15
|
+
const e = t < 0 ? "-" : "", n = Math.abs(t), r = [
|
|
16
16
|
[1e12, "T"],
|
|
17
17
|
[1e9, "B"],
|
|
18
18
|
[1e6, "M"],
|
|
19
19
|
[1e3, "k"]
|
|
20
20
|
];
|
|
21
21
|
for (const [o, i] of r)
|
|
22
|
-
if (
|
|
23
|
-
return `${
|
|
22
|
+
if (n >= o) return `${e}${Number((n / o).toFixed(1))}${i}`;
|
|
23
|
+
return `${e}${Math.round(n)}`;
|
|
24
24
|
}
|
|
25
|
-
function c(t,
|
|
26
|
-
return String(t).padStart(
|
|
25
|
+
function c(t, e = 2) {
|
|
26
|
+
return String(t).padStart(e, "0");
|
|
27
27
|
}
|
|
28
28
|
class y extends Error {
|
|
29
|
-
constructor(
|
|
29
|
+
constructor(e, n, r) {
|
|
30
30
|
super(
|
|
31
|
-
r === "gap" ? `${
|
|
32
|
-
), this.wall =
|
|
31
|
+
r === "gap" ? `${T(e)} does not exist in ${n} — the clock skipped it.` : `${T(e)} happens twice in ${n}.`
|
|
32
|
+
), this.wall = e, this.zone = n, this.kind = r, this.name = "AmbiguousTimeError";
|
|
33
33
|
}
|
|
34
34
|
wall;
|
|
35
35
|
zone;
|
|
36
36
|
kind;
|
|
37
37
|
}
|
|
38
|
-
function
|
|
38
|
+
function T(t) {
|
|
39
39
|
return `${c(t.year, 4)}-${c(t.month)}-${c(t.day)}T${c(t.hour)}:${c(t.minute)}:${c(t.second)}.${c(t.millisecond, 3)}`;
|
|
40
40
|
}
|
|
41
|
-
function
|
|
41
|
+
function A(t) {
|
|
42
42
|
return `${c(t.year, 4)}-${c(t.month)}-${c(t.day)}`;
|
|
43
43
|
}
|
|
44
|
-
function l(t,
|
|
45
|
-
const
|
|
46
|
-
return
|
|
44
|
+
function l(t, e) {
|
|
45
|
+
const n = /* @__PURE__ */ new Date(0);
|
|
46
|
+
return n.setUTCFullYear(t, e, 0), n.getUTCDate();
|
|
47
47
|
}
|
|
48
|
-
function
|
|
49
|
-
const
|
|
50
|
-
if (!
|
|
51
|
-
const
|
|
48
|
+
function C(t) {
|
|
49
|
+
const e = /^(\d{4})-(\d{2})-(\d{2})$/.exec(t);
|
|
50
|
+
if (!e) throw new Error(`not an ISO date: ${JSON.stringify(t)} — expected YYYY-MM-DD`);
|
|
51
|
+
const n = Number(e[1]), r = Number(e[2]), o = Number(e[3]);
|
|
52
52
|
if (r < 1 || r > 12) throw new Error(`month out of range in ${t}`);
|
|
53
|
-
if (o < 1 || o > l(
|
|
54
|
-
throw new Error(`${t} is not a real date — ${
|
|
55
|
-
return { year:
|
|
53
|
+
if (o < 1 || o > l(n, r))
|
|
54
|
+
throw new Error(`${t} is not a real date — ${n}-${r} has ${l(n, r)} days`);
|
|
55
|
+
return { year: n, month: r, day: o };
|
|
56
56
|
}
|
|
57
57
|
const $ = "—";
|
|
58
|
-
function
|
|
58
|
+
function j(t) {
|
|
59
59
|
if (t == null || t === "") return $;
|
|
60
|
-
let
|
|
60
|
+
let e;
|
|
61
61
|
try {
|
|
62
|
-
|
|
62
|
+
e = C(t);
|
|
63
63
|
} catch {
|
|
64
64
|
return t;
|
|
65
65
|
}
|
|
66
|
-
return `${c(
|
|
66
|
+
return `${c(e.month)}/${c(e.day)}/${e.year}`;
|
|
67
67
|
}
|
|
68
|
-
const
|
|
69
|
-
function
|
|
70
|
-
const
|
|
71
|
-
if (
|
|
72
|
-
let
|
|
73
|
-
const i =
|
|
68
|
+
const I = /^(\d{1,2})\/(\d{1,2})\/(\d{4})$/, U = /^(\d{4})-(\d{1,2})-(\d{1,2})$/;
|
|
69
|
+
function J(t) {
|
|
70
|
+
const e = t.trim();
|
|
71
|
+
if (e === "") return null;
|
|
72
|
+
let n, r, o;
|
|
73
|
+
const i = U.exec(e);
|
|
74
74
|
if (i)
|
|
75
|
-
|
|
75
|
+
n = Number(i[1]), r = Number(i[2]), o = Number(i[3]);
|
|
76
76
|
else {
|
|
77
|
-
const u =
|
|
77
|
+
const u = I.exec(e);
|
|
78
78
|
if (!u) return null;
|
|
79
|
-
r = Number(u[1]), o = Number(u[2]),
|
|
79
|
+
r = Number(u[1]), o = Number(u[2]), n = Number(u[3]);
|
|
80
80
|
}
|
|
81
|
-
return r < 1 || r > 12 || o < 1 || o > l(
|
|
81
|
+
return r < 1 || r > 12 || o < 1 || o > l(n, r) ? null : A({ year: n, month: r, day: o });
|
|
82
82
|
}
|
|
83
|
-
const h = 36e5,
|
|
84
|
-
function
|
|
85
|
-
let
|
|
86
|
-
return
|
|
83
|
+
const h = 36e5, S = /* @__PURE__ */ new Map();
|
|
84
|
+
function w(t) {
|
|
85
|
+
let e = S.get(t);
|
|
86
|
+
return e || (e = new Intl.DateTimeFormat("en-US", {
|
|
87
87
|
timeZone: t,
|
|
88
88
|
year: "numeric",
|
|
89
89
|
month: "2-digit",
|
|
@@ -95,12 +95,12 @@ function A(t) {
|
|
|
95
95
|
midnight as hour "24" under `hour12: false`, which parses as a valid
|
|
96
96
|
number and silently lands the reading on the wrong day. */
|
|
97
97
|
hourCycle: "h23"
|
|
98
|
-
}),
|
|
98
|
+
}), S.set(t, e)), e;
|
|
99
99
|
}
|
|
100
|
-
function b(t,
|
|
101
|
-
const
|
|
102
|
-
let r = 0, o = 1, i = 1, u = 0, s = 0,
|
|
103
|
-
for (const f of
|
|
100
|
+
function b(t, e) {
|
|
101
|
+
const n = w(t).formatToParts(new Date(e));
|
|
102
|
+
let r = 0, o = 1, i = 1, u = 0, s = 0, a = 0;
|
|
103
|
+
for (const f of n)
|
|
104
104
|
switch (f.type) {
|
|
105
105
|
case "year":
|
|
106
106
|
r = Number(f.value);
|
|
@@ -118,145 +118,168 @@ function b(t, n) {
|
|
|
118
118
|
s = Number(f.value);
|
|
119
119
|
break;
|
|
120
120
|
case "second":
|
|
121
|
-
|
|
121
|
+
a = Number(f.value);
|
|
122
122
|
break;
|
|
123
123
|
}
|
|
124
|
-
const
|
|
125
|
-
return { year: r, month: o, day: i, hour: u, minute: s, second:
|
|
124
|
+
const m = (e % 1e3 + 1e3) % 1e3;
|
|
125
|
+
return { year: r, month: o, day: i, hour: u, minute: s, second: a, millisecond: m };
|
|
126
126
|
}
|
|
127
127
|
function p(t) {
|
|
128
|
-
const
|
|
129
|
-
return
|
|
128
|
+
const e = /* @__PURE__ */ new Date(0);
|
|
129
|
+
return e.setUTCFullYear(t.year, t.month - 1, t.day), e.setUTCHours(t.hour, t.minute, t.second, t.millisecond), e.getTime();
|
|
130
130
|
}
|
|
131
|
-
function N(t,
|
|
132
|
-
return p(b(t,
|
|
131
|
+
function N(t, e) {
|
|
132
|
+
return p(b(t, e)) - e;
|
|
133
133
|
}
|
|
134
|
-
function
|
|
135
|
-
return t.year ===
|
|
134
|
+
function _(t, e) {
|
|
135
|
+
return t.year === e.year && t.month === e.month && t.day === e.day && t.hour === e.hour && t.minute === e.minute && t.second === e.second && t.millisecond === e.millisecond;
|
|
136
136
|
}
|
|
137
|
-
function
|
|
138
|
-
const
|
|
137
|
+
function x(t, e) {
|
|
138
|
+
const n = p(e), r = N(t, n - 24 * h), o = N(t, n + 24 * h), i = [];
|
|
139
139
|
for (const u of r === o ? [r] : [r, o]) {
|
|
140
|
-
const s =
|
|
141
|
-
|
|
140
|
+
const s = n - u;
|
|
141
|
+
_(b(t, s), e) && i.push(s);
|
|
142
142
|
}
|
|
143
143
|
return i.sort((u, s) => u - s), i.filter((u, s) => s === 0 || u !== i[s - 1]);
|
|
144
144
|
}
|
|
145
|
-
function
|
|
146
|
-
const r =
|
|
145
|
+
function R(t, e, n = "compatible") {
|
|
146
|
+
const r = x(t, e);
|
|
147
147
|
if (r.length === 1) return r[0];
|
|
148
148
|
if (r.length > 1) {
|
|
149
|
-
if (
|
|
150
|
-
return
|
|
149
|
+
if (n === "reject") throw new y(e, t, "overlap");
|
|
150
|
+
return n === "later" ? r[r.length - 1] : r[0];
|
|
151
151
|
}
|
|
152
|
-
if (
|
|
153
|
-
const o = p(
|
|
154
|
-
return
|
|
152
|
+
if (n === "reject") throw new y(e, t, "gap");
|
|
153
|
+
const o = p(e), i = N(t, o - 24 * h), u = N(t, o + 24 * h), s = u - i, a = o - i, m = o - u;
|
|
154
|
+
return n === "earlier" ? Math.min(a, m) : s > 0 ? Math.max(a, m) : Math.min(a, m);
|
|
155
155
|
}
|
|
156
|
-
function
|
|
156
|
+
function D() {
|
|
157
157
|
return Intl.DateTimeFormat().resolvedOptions().timeZone;
|
|
158
158
|
}
|
|
159
|
-
function
|
|
159
|
+
function F(t) {
|
|
160
160
|
if (typeof t == "number") return Number.isFinite(t) ? t : null;
|
|
161
|
-
const
|
|
162
|
-
return Number.isNaN(
|
|
161
|
+
const e = t.replace(/(\.\d{3})\d+/, "$1"), n = Date.parse(e);
|
|
162
|
+
return Number.isNaN(n) ? null : n;
|
|
163
163
|
}
|
|
164
|
-
function
|
|
164
|
+
function Q(t, e = {}) {
|
|
165
165
|
if (t == null || t === "") return $;
|
|
166
|
-
const
|
|
167
|
-
if (
|
|
168
|
-
const r =
|
|
166
|
+
const n = F(t);
|
|
167
|
+
if (n === null) return String(t);
|
|
168
|
+
const r = e.zone ?? D(), o = b(r, n), i = (o.hour + 11) % 12 + 1, u = o.hour < 12 ? "AM" : "PM";
|
|
169
169
|
return `${c(o.month)}/${c(o.day)}/${o.year}, ${i}:${c(o.minute)} ${u}`;
|
|
170
170
|
}
|
|
171
|
-
const
|
|
172
|
-
function
|
|
173
|
-
const
|
|
174
|
-
if (
|
|
175
|
-
if (
|
|
176
|
-
const d =
|
|
171
|
+
const k = /^(\d{1,2})\/(\d{1,2})\/(\d{4})(?:,?\s+(\d{1,2}):(\d{2})(?::(\d{2}))?\s*([AaPp][Mm]))?$/, B = /^\d{4}-\d{2}-\d{2}[T ]\d{2}:\d{2}(:\d{2}(\.\d+)?)?\s*(Z|[+-]\d{2}:?\d{2})$/;
|
|
172
|
+
function q(t, e = {}) {
|
|
173
|
+
const n = t.trim();
|
|
174
|
+
if (n === "") return null;
|
|
175
|
+
if (B.test(n)) {
|
|
176
|
+
const d = F(n);
|
|
177
177
|
return d === null ? null : new Date(d).toISOString();
|
|
178
178
|
}
|
|
179
|
-
const r =
|
|
179
|
+
const r = k.exec(n);
|
|
180
180
|
if (!r) return null;
|
|
181
181
|
const o = Number(r[1]), i = Number(r[2]), u = Number(r[3]);
|
|
182
182
|
if (o < 1 || o > 12 || i < 1 || i > l(u, o)) return null;
|
|
183
|
-
let s = 0,
|
|
183
|
+
let s = 0, a = 0, m = 0;
|
|
184
184
|
if (r[4] !== void 0) {
|
|
185
185
|
const d = Number(r[4]);
|
|
186
|
-
|
|
186
|
+
a = Number(r[5]), m = r[6] !== void 0 ? Number(r[6]) : 0;
|
|
187
187
|
const M = r[7].toUpperCase();
|
|
188
|
-
if (d < 1 || d > 12 ||
|
|
188
|
+
if (d < 1 || d > 12 || a > 59 || m > 59) return null;
|
|
189
189
|
s = M === "AM" ? d === 12 ? 0 : d : d === 12 ? 12 : d + 12;
|
|
190
190
|
}
|
|
191
|
-
const f = { year: u, month: o, day: i, hour: s, minute:
|
|
192
|
-
return new Date(
|
|
191
|
+
const f = { year: u, month: o, day: i, hour: s, minute: a, second: m, millisecond: 0 }, E = e.zone ?? D();
|
|
192
|
+
return new Date(R(E, f)).toISOString();
|
|
193
193
|
}
|
|
194
|
-
const
|
|
194
|
+
const L = new Intl.NumberFormat("en-US", {
|
|
195
195
|
style: "currency",
|
|
196
196
|
currency: "USD",
|
|
197
197
|
minimumFractionDigits: 2,
|
|
198
198
|
maximumFractionDigits: 2
|
|
199
199
|
});
|
|
200
|
-
function
|
|
201
|
-
return t == null || !Number.isFinite(t) ? $ :
|
|
200
|
+
function v(t) {
|
|
201
|
+
return t == null || !Number.isFinite(t) ? $ : L.format(t);
|
|
202
202
|
}
|
|
203
|
-
function
|
|
204
|
-
const
|
|
205
|
-
if (
|
|
206
|
-
const
|
|
203
|
+
function G(t) {
|
|
204
|
+
const e = t.trim();
|
|
205
|
+
if (e === "") return null;
|
|
206
|
+
const n = /^\((.*)\)$/.exec(e), r = n !== null, i = (n ? n[1] : e).replace(/[$,\s]/g, "");
|
|
207
207
|
if (!/^-?\d+(\.\d+)?$/.test(i)) return null;
|
|
208
208
|
const u = Number(i);
|
|
209
209
|
return Number.isFinite(u) ? r ? -Math.abs(u) : u : null;
|
|
210
210
|
}
|
|
211
|
-
function V(t,
|
|
211
|
+
function V(t, e = {}) {
|
|
212
212
|
if (t == null || !Number.isFinite(t)) return $;
|
|
213
|
-
const { decimals:
|
|
213
|
+
const { decimals: n } = e, r = n === void 0 ? { maximumFractionDigits: 6 } : { minimumFractionDigits: n, maximumFractionDigits: n };
|
|
214
214
|
return new Intl.NumberFormat("en-US", r).format(t);
|
|
215
215
|
}
|
|
216
|
-
function
|
|
217
|
-
const
|
|
218
|
-
if (
|
|
219
|
-
const
|
|
220
|
-
if (!/^-?\d+(\.\d+)?$/.test(
|
|
221
|
-
const r = Number(
|
|
216
|
+
function X(t) {
|
|
217
|
+
const e = t.trim();
|
|
218
|
+
if (e === "") return null;
|
|
219
|
+
const n = e.replace(/,/g, "");
|
|
220
|
+
if (!/^-?\d+(\.\d+)?$/.test(n)) return null;
|
|
221
|
+
const r = Number(n);
|
|
222
222
|
return Number.isFinite(r) ? r : null;
|
|
223
223
|
}
|
|
224
|
-
function
|
|
225
|
-
const { trueLabel:
|
|
226
|
-
return t === !0 ?
|
|
224
|
+
function z(t, e = {}) {
|
|
225
|
+
const { trueLabel: n = "Yes", falseLabel: r = "No", unknownLabel: o = "Unknown" } = e;
|
|
226
|
+
return t === !0 ? n : t === !1 ? r : o;
|
|
227
227
|
}
|
|
228
|
-
const
|
|
229
|
-
function
|
|
230
|
-
const
|
|
231
|
-
return
|
|
228
|
+
const H = /* @__PURE__ */ new Set(["yes", "y", "true", "t", "1"]), Y = /* @__PURE__ */ new Set(["no", "n", "false", "f", "0"]);
|
|
229
|
+
function tt(t) {
|
|
230
|
+
const e = t.trim().toLowerCase();
|
|
231
|
+
return H.has(e) ? !0 : Y.has(e) ? !1 : null;
|
|
232
232
|
}
|
|
233
|
-
function
|
|
234
|
-
if (!Number.isFinite(t) || !Number.isFinite(
|
|
235
|
-
const
|
|
236
|
-
return Math.max(1, Math.min(5,
|
|
233
|
+
function et(t, e) {
|
|
234
|
+
if (!Number.isFinite(t) || !Number.isFinite(e) || e <= 0 || t <= 0) return null;
|
|
235
|
+
const n = Math.round(Math.min(t, e) / e * 5);
|
|
236
|
+
return Math.max(1, Math.min(5, n));
|
|
237
237
|
}
|
|
238
|
-
const
|
|
238
|
+
const nt = {
|
|
239
239
|
1: "Just a guess",
|
|
240
240
|
2: "Somewhat unsure",
|
|
241
241
|
3: "Fairly confident",
|
|
242
242
|
4: "Confident",
|
|
243
243
|
5: "Highly confident"
|
|
244
|
-
}
|
|
244
|
+
}, g = 8, P = [
|
|
245
|
+
"--chart-1",
|
|
246
|
+
"--chart-2",
|
|
247
|
+
"--chart-3",
|
|
248
|
+
"--chart-4",
|
|
249
|
+
"--chart-5",
|
|
250
|
+
"--chart-6",
|
|
251
|
+
"--chart-7",
|
|
252
|
+
"--chart-8"
|
|
253
|
+
], Z = "--chart-seq";
|
|
254
|
+
function rt(t) {
|
|
255
|
+
const e = P[t];
|
|
256
|
+
if (!Number.isInteger(t) || e === void 0)
|
|
257
|
+
throw new Error(
|
|
258
|
+
`chartSeriesColor: there are ${g} categorical hues (index 0-${g - 1}); got ${t}. Fold the rest into "Other".`
|
|
259
|
+
);
|
|
260
|
+
return `var(${e})`;
|
|
261
|
+
}
|
|
262
|
+
const ot = `var(${Z})`;
|
|
245
263
|
export {
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
P as
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
264
|
+
ot as CHART_SEQUENTIAL_COLOR,
|
|
265
|
+
Z as CHART_SEQUENTIAL_TOKEN,
|
|
266
|
+
g as CHART_SERIES_COUNT,
|
|
267
|
+
P as CHART_SERIES_TOKENS,
|
|
268
|
+
nt as CONFIDENCE_LEVEL_LABELS,
|
|
269
|
+
rt as chartSeriesColor,
|
|
270
|
+
et as confidenceLevel,
|
|
271
|
+
z as formatBoolean,
|
|
272
|
+
W as formatBytes,
|
|
273
|
+
O as formatCompactNumber,
|
|
274
|
+
v as formatCurrency,
|
|
275
|
+
j as formatDate,
|
|
276
|
+
Q as formatDateTime,
|
|
254
277
|
V as formatNumber,
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
278
|
+
K as formatTokens,
|
|
279
|
+
tt as parseBoolean,
|
|
280
|
+
G as parseCurrency,
|
|
281
|
+
J as parseDate,
|
|
282
|
+
q as parseDateTime,
|
|
283
|
+
X as parseNumber
|
|
261
284
|
};
|
|
262
285
|
//# sourceMappingURL=pure.js.map
|