@danxbot/ui 20.23.3 → 21.1.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 +23607 -22540
- package/dist/index.js.map +1 -1
- package/dist/pure.js +290 -210
- package/dist/pure.js.map +1 -1
- package/dist/types/components/AppShell.d.ts +1 -1
- package/dist/types/components/Board.d.ts +4 -6
- package/dist/types/components/Card.d.ts +25 -1
- package/dist/types/components/Combobox.d.ts +2 -1
- package/dist/types/components/CommandPalette.d.ts +2 -0
- package/dist/types/components/DateField.d.ts +2 -2
- package/dist/types/components/DragDrop.d.ts +2 -4
- package/dist/types/components/InlineEdit.d.ts +4 -4
- package/dist/types/components/InlineMarkdownEdit.d.ts +2 -2
- package/dist/types/components/PagedWindowList.d.ts +1 -9
- package/dist/types/components/Progress.d.ts +4 -4
- package/dist/types/components/ReadMore.d.ts +2 -2
- package/dist/types/components/SecretField.d.ts +1 -1
- package/dist/types/components/Slider.d.ts +1 -1
- package/dist/types/components/SortMenu.d.ts +1 -1
- package/dist/types/components/Stat.d.ts +1 -1
- package/dist/types/components/StatusSelect.d.ts +1 -1
- package/dist/types/components/TriStateSwitch.d.ts +1 -7
- package/dist/types/components/board/context.d.ts +2 -4
- package/dist/types/components/calendar/CalendarMonth.d.ts +2 -3
- package/dist/types/components/calendar/CalendarTimeGrid.d.ts +1 -2
- package/dist/types/components/calendar/EventActions.d.ts +1 -2
- package/dist/types/components/calendar/format.d.ts +10 -9
- package/dist/types/components/calendar/use-calendar-drag.d.ts +0 -1
- package/dist/types/components/calendar/use-event-keyboard.d.ts +0 -1
- package/dist/types/components/chart/BarList.d.ts +1 -1
- package/dist/types/components/chart/ShareBar.d.ts +1 -1
- package/dist/types/components/chart/TimeSeriesChart.d.ts +2 -4
- package/dist/types/components/chart/shared.d.ts +2 -2
- package/dist/types/components/chart/time-series-scale.d.ts +1 -1
- package/dist/types/components/chat/EffortControl.d.ts +2 -2
- package/dist/types/components/chat/MessageScroller.d.ts +1 -1
- package/dist/types/components/checklist/StatusChecklist.d.ts +1 -1
- package/dist/types/components/edit/outcome.d.ts +0 -12
- package/dist/types/components/file-viewer/frames.d.ts +2 -1
- package/dist/types/components/kanban/KanbanBoard.d.ts +2 -21
- package/dist/types/components/kanban/types.d.ts +1 -1
- package/dist/types/components/markdown/Affordances.d.ts +3 -1
- package/dist/types/components/openapi/resolve.d.ts +7 -3
- package/dist/types/components/openapi/types.d.ts +2 -1
- package/dist/types/components/provenance/ConfidenceBar.d.ts +1 -1
- package/dist/types/components/provenance/ConfidenceReadout.d.ts +2 -2
- package/dist/types/components/provenance/ProvenanceBadge.d.ts +4 -3
- package/dist/types/components/provenance/ProvenanceDetail.d.ts +4 -6
- package/dist/types/components/provenance/ProvenanceDisclosure.d.ts +1 -1
- package/dist/types/components/provenance/absence.d.ts +4 -3
- package/dist/types/components/rbac/RoleKeyPicker.d.ts +1 -1
- package/dist/types/components/rbac/permissionSections.d.ts +1 -1
- package/dist/types/components/rbac/stagedForm.d.ts +4 -4
- package/dist/types/components/roadmap/RoadmapItemCard.d.ts +0 -1
- package/dist/types/index.d.ts +9 -7
- package/dist/types/lib/board/index.d.ts +2 -1
- package/dist/types/lib/board/move.d.ts +2 -2
- package/dist/types/lib/board/rejection.d.ts +8 -0
- package/dist/types/lib/board/types.d.ts +46 -0
- package/dist/types/lib/board/use-board.d.ts +2 -2
- package/dist/types/lib/calendar/drag.d.ts +1 -1
- package/dist/types/lib/calendar/index.d.ts +1 -1
- package/dist/types/lib/calendar/types.d.ts +3 -3
- package/dist/types/lib/confidence.d.ts +5 -0
- package/dist/types/lib/dnd/announce.d.ts +5 -23
- package/dist/types/lib/dnd/index.d.ts +1 -1
- package/dist/types/lib/format.d.ts +19 -18
- package/dist/types/lib/i18n/areas/auth-provenance-flows.d.ts +258 -0
- package/dist/types/lib/i18n/areas/board.d.ts +51 -0
- package/dist/types/lib/i18n/areas/chat-chart.d.ts +164 -0
- package/dist/types/lib/i18n/areas/code-editor.d.ts +40 -0
- package/dist/types/lib/i18n/areas/dates.d.ts +103 -0
- package/dist/types/lib/i18n/areas/docs-views.d.ts +268 -0
- package/dist/types/lib/i18n/areas/feedback.d.ts +104 -0
- package/dist/types/lib/i18n/areas/formats.d.ts +30 -0
- package/dist/types/lib/i18n/areas/forms.d.ts +130 -0
- package/dist/types/lib/i18n/areas/markdown.d.ts +139 -0
- package/dist/types/lib/i18n/areas/move-rejected.d.ts +16 -0
- package/dist/types/lib/i18n/areas/navigation.d.ts +144 -0
- package/dist/types/lib/i18n/areas/rbac.d.ts +584 -0
- package/dist/types/lib/i18n/emphasis.d.ts +3 -0
- package/dist/types/lib/i18n/index.d.ts +8 -0
- package/dist/types/lib/i18n/number-format.d.ts +5 -0
- package/dist/types/lib/i18n/plural.d.ts +7 -0
- package/dist/types/lib/i18n/provider.d.ts +16 -0
- package/dist/types/lib/i18n/strings.d.ts +15 -0
- package/dist/types/lib/intl-cache.d.ts +31 -0
- package/dist/types/lib/markdown/commands.d.ts +4 -2
- package/dist/types/lib/markdown/dom.d.ts +27 -21
- package/dist/types/lib/markdown/hotkeys.d.ts +12 -5
- package/dist/types/lib/markdown/image-decoration.d.ts +22 -1
- package/dist/types/lib/markdown/image-pipeline.d.ts +2 -0
- package/dist/types/lib/markdown/images.d.ts +1 -1
- package/dist/types/lib/markdown/reconcile.d.ts +4 -2
- package/dist/types/lib/markdown/surface.d.ts +4 -2
- package/dist/types/lib/reduced-motion-help.d.ts +2 -1
- package/dist/types/lib/time/relativeAge.d.ts +3 -2
- package/dist/types/lib/time/zone.d.ts +9 -0
- package/dist/types/lib/values/boolean.d.ts +11 -10
- package/dist/types/lib/values/currency.d.ts +5 -5
- package/dist/types/lib/values/date.d.ts +4 -4
- package/dist/types/lib/values/datetime.d.ts +3 -3
- package/dist/types/lib/values/locale-date.d.ts +34 -0
- package/dist/types/lib/values/number.d.ts +5 -5
- package/dist/types/pure.d.ts +1 -0
- package/package.json +1 -1
package/dist/pure.js
CHANGED
|
@@ -1,89 +1,92 @@
|
|
|
1
|
-
|
|
1
|
+
const A = /* @__PURE__ */ new Map(), M = /* @__PURE__ */ new Map();
|
|
2
|
+
function l(t, e) {
|
|
3
|
+
const n = `${t}|${JSON.stringify(e)}`;
|
|
4
|
+
let r = A.get(n);
|
|
5
|
+
return r || (r = new Intl.NumberFormat(t, e), A.set(n, r)), r;
|
|
6
|
+
}
|
|
7
|
+
function p(t, e) {
|
|
8
|
+
const n = `${t}|${JSON.stringify(e)}`;
|
|
9
|
+
let r = M.get(n);
|
|
10
|
+
return r || (r = new Intl.DateTimeFormat(t, e), M.set(n, r)), r;
|
|
11
|
+
}
|
|
12
|
+
function J(t) {
|
|
13
|
+
const e = l(t, { useGrouping: !0, minimumFractionDigits: 1 }).formatToParts(-12345675e-1);
|
|
14
|
+
return {
|
|
15
|
+
group: e.find((n) => n.type === "group").value,
|
|
16
|
+
decimal: e.find((n) => n.type === "decimal").value
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
function k(t, e, n = []) {
|
|
20
|
+
const { group: r, decimal: o } = J(e);
|
|
21
|
+
let i = t;
|
|
22
|
+
for (const u of n) i = i.split(u).join("");
|
|
23
|
+
if (/^\s$/.test(r) ? i = i.replace(/\s/g, "") : i = i.split(r).join(""), i = i.split(o).join("."), !/^-?\d+(\.\d+)?$/.test(i)) return null;
|
|
24
|
+
const s = Number(i);
|
|
25
|
+
return Number.isFinite(s) ? s : null;
|
|
26
|
+
}
|
|
27
|
+
function K(t, e, n) {
|
|
28
|
+
const r = /* @__PURE__ */ new Date(0);
|
|
29
|
+
return r.setUTCFullYear(t, e - 1, n), r;
|
|
30
|
+
}
|
|
31
|
+
function W(t) {
|
|
32
|
+
const e = [];
|
|
33
|
+
for (let n = 0; n < 10; n++) {
|
|
34
|
+
const r = l(t, {}).format(n);
|
|
35
|
+
e.push(r);
|
|
36
|
+
}
|
|
37
|
+
return e;
|
|
38
|
+
}
|
|
39
|
+
function wt(t, e) {
|
|
2
40
|
if (!Number.isFinite(t) || t < 0) return "";
|
|
3
|
-
if (t < 1024) return `${t} B`;
|
|
4
|
-
const
|
|
5
|
-
let
|
|
6
|
-
for (;
|
|
7
|
-
|
|
8
|
-
|
|
41
|
+
if (t < 1024) return `${l(e, {}).format(t)} B`;
|
|
42
|
+
const n = ["KB", "MB", "GB", "TB"];
|
|
43
|
+
let r = t / 1024, o = 0;
|
|
44
|
+
for (; r >= 1024 && o < n.length - 1; )
|
|
45
|
+
r /= 1024, o += 1;
|
|
46
|
+
const i = r < 10 ? 1 : 0;
|
|
47
|
+
return `${l(e, { minimumFractionDigits: i, maximumFractionDigits: i }).format(r)} ${n[o]}`;
|
|
9
48
|
}
|
|
10
|
-
function
|
|
11
|
-
return
|
|
12
|
-
}
|
|
13
|
-
function
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
[1e9, "B"],
|
|
18
|
-
[1e6, "M"],
|
|
19
|
-
[1e3, "k"]
|
|
20
|
-
];
|
|
21
|
-
for (const [o, i] of r)
|
|
22
|
-
if (n >= o) return `${e}${Number((n / o).toFixed(1))}${i}`;
|
|
23
|
-
return `${e}${Math.round(n)}`;
|
|
24
|
-
}
|
|
25
|
-
function c(t, e = 2) {
|
|
49
|
+
function At(t, e) {
|
|
50
|
+
return z(t, e);
|
|
51
|
+
}
|
|
52
|
+
function z(t, e) {
|
|
53
|
+
return t == null || !Number.isFinite(t) ? "—" : Math.abs(t) < 999.5 ? l(e, { maximumFractionDigits: 0 }).format(Math.round(t) + 0) : l(e, { notation: "compact", maximumFractionDigits: 1 }).format(t);
|
|
54
|
+
}
|
|
55
|
+
function d(t, e = 2) {
|
|
26
56
|
return String(t).padStart(e, "0");
|
|
27
57
|
}
|
|
28
|
-
class
|
|
58
|
+
class O extends Error {
|
|
29
59
|
constructor(e, n, r) {
|
|
30
60
|
super(
|
|
31
|
-
r === "gap" ? `${
|
|
61
|
+
r === "gap" ? `${C(e)} does not exist in ${n} — the clock skipped it.` : `${C(e)} happens twice in ${n}.`
|
|
32
62
|
), this.wall = e, this.zone = n, this.kind = r, this.name = "AmbiguousTimeError";
|
|
33
63
|
}
|
|
34
64
|
wall;
|
|
35
65
|
zone;
|
|
36
66
|
kind;
|
|
37
67
|
}
|
|
38
|
-
function
|
|
39
|
-
return `${
|
|
68
|
+
function C(t) {
|
|
69
|
+
return `${d(t.year, 4)}-${d(t.month)}-${d(t.day)}T${d(t.hour)}:${d(t.minute)}:${d(t.second)}.${d(t.millisecond, 3)}`;
|
|
40
70
|
}
|
|
41
|
-
function
|
|
42
|
-
return `${
|
|
71
|
+
function Q(t) {
|
|
72
|
+
return `${d(t.year, 4)}-${d(t.month)}-${d(t.day)}`;
|
|
43
73
|
}
|
|
44
|
-
function
|
|
74
|
+
function h(t, e) {
|
|
45
75
|
const n = /* @__PURE__ */ new Date(0);
|
|
46
76
|
return n.setUTCFullYear(t, e, 0), n.getUTCDate();
|
|
47
77
|
}
|
|
48
|
-
function
|
|
78
|
+
function q(t) {
|
|
49
79
|
const e = /^(\d{4})-(\d{2})-(\d{2})$/.exec(t);
|
|
50
80
|
if (!e) throw new Error(`not an ISO date: ${JSON.stringify(t)} — expected YYYY-MM-DD`);
|
|
51
81
|
const n = Number(e[1]), r = Number(e[2]), o = Number(e[3]);
|
|
52
82
|
if (r < 1 || r > 12) throw new Error(`month out of range in ${t}`);
|
|
53
|
-
if (o < 1 || o >
|
|
54
|
-
throw new Error(`${t} is not a real date — ${n}-${r} has ${
|
|
83
|
+
if (o < 1 || o > h(n, r))
|
|
84
|
+
throw new Error(`${t} is not a real date — ${n}-${r} has ${h(n, r)} days`);
|
|
55
85
|
return { year: n, month: r, day: o };
|
|
56
86
|
}
|
|
57
|
-
const
|
|
58
|
-
function
|
|
59
|
-
|
|
60
|
-
let e;
|
|
61
|
-
try {
|
|
62
|
-
e = w(t);
|
|
63
|
-
} catch {
|
|
64
|
-
return t;
|
|
65
|
-
}
|
|
66
|
-
return `${c(e.month)}/${c(e.day)}/${e.year}`;
|
|
67
|
-
}
|
|
68
|
-
const C = /^(\d{1,2})\/(\d{1,2})\/(\d{4})$/, I = /^(\d{4})-(\d{1,2})-(\d{1,2})$/;
|
|
69
|
-
function ct(t) {
|
|
70
|
-
const e = t.trim();
|
|
71
|
-
if (e === "") return null;
|
|
72
|
-
let n, r, o;
|
|
73
|
-
const i = I.exec(e);
|
|
74
|
-
if (i)
|
|
75
|
-
n = Number(i[1]), r = Number(i[2]), o = Number(i[3]);
|
|
76
|
-
else {
|
|
77
|
-
const s = C.exec(e);
|
|
78
|
-
if (!s) return null;
|
|
79
|
-
r = Number(s[1]), o = Number(s[2]), n = Number(s[3]);
|
|
80
|
-
}
|
|
81
|
-
return r < 1 || r > 12 || o < 1 || o > l(n, r) ? null : _({ year: n, month: r, day: o });
|
|
82
|
-
}
|
|
83
|
-
const h = 36e5, S = /* @__PURE__ */ new Map();
|
|
84
|
-
function U(t) {
|
|
85
|
-
let e = S.get(t);
|
|
86
|
-
return e || (e = new Intl.DateTimeFormat("en-US", {
|
|
87
|
+
const y = 36e5;
|
|
88
|
+
function V(t) {
|
|
89
|
+
return p("en-US", {
|
|
87
90
|
timeZone: t,
|
|
88
91
|
year: "numeric",
|
|
89
92
|
month: "2-digit",
|
|
@@ -95,153 +98,230 @@ function U(t) {
|
|
|
95
98
|
midnight as hour "24" under `hour12: false`, which parses as a valid
|
|
96
99
|
number and silently lands the reading on the wrong day. */
|
|
97
100
|
hourCycle: "h23"
|
|
98
|
-
})
|
|
101
|
+
});
|
|
99
102
|
}
|
|
100
|
-
function
|
|
101
|
-
const n =
|
|
102
|
-
let r = 0, o = 1, i = 1, s = 0, u = 0,
|
|
103
|
-
for (const
|
|
104
|
-
switch (
|
|
103
|
+
function F(t, e) {
|
|
104
|
+
const n = V(t).formatToParts(new Date(e));
|
|
105
|
+
let r = 0, o = 1, i = 1, s = 0, u = 0, c = 0;
|
|
106
|
+
for (const a of n)
|
|
107
|
+
switch (a.type) {
|
|
105
108
|
case "year":
|
|
106
|
-
r = Number(
|
|
109
|
+
r = Number(a.value);
|
|
107
110
|
break;
|
|
108
111
|
case "month":
|
|
109
|
-
o = Number(
|
|
112
|
+
o = Number(a.value);
|
|
110
113
|
break;
|
|
111
114
|
case "day":
|
|
112
|
-
i = Number(
|
|
115
|
+
i = Number(a.value);
|
|
113
116
|
break;
|
|
114
117
|
case "hour":
|
|
115
|
-
s = Number(
|
|
118
|
+
s = Number(a.value);
|
|
116
119
|
break;
|
|
117
120
|
case "minute":
|
|
118
|
-
u = Number(
|
|
121
|
+
u = Number(a.value);
|
|
119
122
|
break;
|
|
120
123
|
case "second":
|
|
121
|
-
|
|
124
|
+
c = Number(a.value);
|
|
122
125
|
break;
|
|
123
126
|
}
|
|
124
127
|
const m = (e % 1e3 + 1e3) % 1e3;
|
|
125
|
-
return { year: r, month: o, day: i, hour: s, minute: u, second:
|
|
128
|
+
return { year: r, month: o, day: i, hour: s, minute: u, second: c, millisecond: m };
|
|
126
129
|
}
|
|
127
|
-
function
|
|
130
|
+
function E(t) {
|
|
128
131
|
const e = /* @__PURE__ */ new Date(0);
|
|
129
132
|
return e.setUTCFullYear(t.year, t.month - 1, t.day), e.setUTCHours(t.hour, t.minute, t.second, t.millisecond), e.getTime();
|
|
130
133
|
}
|
|
131
|
-
function
|
|
132
|
-
return
|
|
134
|
+
function N(t, e) {
|
|
135
|
+
return E(F(t, e)) - e;
|
|
133
136
|
}
|
|
134
|
-
function
|
|
137
|
+
function X(t, e) {
|
|
135
138
|
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
139
|
}
|
|
137
|
-
function
|
|
138
|
-
const n =
|
|
140
|
+
function tt(t, e) {
|
|
141
|
+
const n = E(e), r = N(t, n - 24 * y), o = N(t, n + 24 * y), i = [];
|
|
139
142
|
for (const s of r === o ? [r] : [r, o]) {
|
|
140
143
|
const u = n - s;
|
|
141
|
-
|
|
144
|
+
X(F(t, u), e) && i.push(u);
|
|
142
145
|
}
|
|
143
146
|
return i.sort((s, u) => s - u), i.filter((s, u) => u === 0 || s !== i[u - 1]);
|
|
144
147
|
}
|
|
145
|
-
function
|
|
146
|
-
const r =
|
|
148
|
+
function et(t, e, n = "compatible") {
|
|
149
|
+
const r = tt(t, e);
|
|
147
150
|
if (r.length === 1) return r[0];
|
|
148
151
|
if (r.length > 1) {
|
|
149
|
-
if (n === "reject") throw new
|
|
152
|
+
if (n === "reject") throw new O(e, t, "overlap");
|
|
150
153
|
return n === "later" ? r[r.length - 1] : r[0];
|
|
151
154
|
}
|
|
152
|
-
if (n === "reject") throw new
|
|
153
|
-
const o =
|
|
154
|
-
return n === "earlier" ? Math.min(
|
|
155
|
+
if (n === "reject") throw new O(e, t, "gap");
|
|
156
|
+
const o = E(e), i = N(t, o - 24 * y), s = N(t, o + 24 * y), u = s - i, c = o - i, m = o - s;
|
|
157
|
+
return n === "earlier" ? Math.min(c, m) : u > 0 ? Math.max(c, m) : Math.min(c, m);
|
|
158
|
+
}
|
|
159
|
+
const w = { calendar: "gregory", timeZone: "UTC", year: "numeric", month: "2-digit", day: "2-digit" }, nt = { ...w, hour: "numeric", minute: "2-digit" };
|
|
160
|
+
function rt(t) {
|
|
161
|
+
return new Date(E(t));
|
|
162
|
+
}
|
|
163
|
+
function ot(t) {
|
|
164
|
+
return t.replace(/[\u202f\u00a0]/g, " ");
|
|
165
|
+
}
|
|
166
|
+
const I = /* @__PURE__ */ new Map(), U = /[]/g, it = (t) => t.replace(/[.*+?^${}()|[\]\\/]/g, "\\$&");
|
|
167
|
+
function v(t, e) {
|
|
168
|
+
const n = W(e);
|
|
169
|
+
let r = t.replace(U, "");
|
|
170
|
+
return n.forEach((o, i) => {
|
|
171
|
+
o !== String(i) && (r = r.split(o).join(String(i)));
|
|
172
|
+
}), r;
|
|
173
|
+
}
|
|
174
|
+
function L(t) {
|
|
175
|
+
let e = I.get(t);
|
|
176
|
+
if (!e) {
|
|
177
|
+
const n = p(t, w).formatToParts(/* @__PURE__ */ new Date(0)), r = n.reduce((s, u, c) => u.type === "year" || u.type === "month" || u.type === "day" ? c : s, -1), o = [], i = n.map((s, u) => {
|
|
178
|
+
if (s.type === "year" || s.type === "month" || s.type === "day")
|
|
179
|
+
return o.push(s.type), s.type === "year" ? "(\\d{4})" : "(\\d{1,2})";
|
|
180
|
+
const c = s.value.replace(U, ""), a = `\\s*${it(c.trim())}\\s*`;
|
|
181
|
+
return u > r ? `(?:${a})?` : a;
|
|
182
|
+
}).join("");
|
|
183
|
+
e = { order: o, source: i }, I.set(t, e);
|
|
184
|
+
}
|
|
185
|
+
return e;
|
|
186
|
+
}
|
|
187
|
+
function P(t, e, n = 1) {
|
|
188
|
+
const r = { year: 0, month: 0, day: 0 };
|
|
189
|
+
return t.forEach((o, i) => {
|
|
190
|
+
r[o] = Number(e[n + i]);
|
|
191
|
+
}), r;
|
|
192
|
+
}
|
|
193
|
+
const R = /* @__PURE__ */ new Map();
|
|
194
|
+
function $(t) {
|
|
195
|
+
return t.toLowerCase().replace(/[\s.\u202f\u00a0]/g, "");
|
|
155
196
|
}
|
|
156
|
-
function
|
|
197
|
+
function st(t) {
|
|
198
|
+
let e = R.get(t);
|
|
199
|
+
if (!e) {
|
|
200
|
+
const n = (o) => p(t, { timeZone: "UTC", hour: "numeric" }).formatToParts(new Date(Date.UTC(2e3, 0, 1, o))).find((i) => i.type === "dayPeriod"), r = n(0);
|
|
201
|
+
e = { twelveHour: r !== void 0, am: r ? $(r.value) : "", pm: r ? $(n(12).value) : "" }, R.set(t, e);
|
|
202
|
+
}
|
|
203
|
+
return e;
|
|
204
|
+
}
|
|
205
|
+
const T = "—";
|
|
206
|
+
function Mt(t, e) {
|
|
207
|
+
if (t == null || t === "") return T;
|
|
208
|
+
let n;
|
|
209
|
+
try {
|
|
210
|
+
n = q(t);
|
|
211
|
+
} catch {
|
|
212
|
+
return t;
|
|
213
|
+
}
|
|
214
|
+
return p(e, w).format(K(n.year, n.month, n.day));
|
|
215
|
+
}
|
|
216
|
+
const ut = /^(\d{4})-(\d{1,2})-(\d{1,2})$/;
|
|
217
|
+
function Ot(t, e) {
|
|
218
|
+
const n = v(t, e).trim();
|
|
219
|
+
if (n === "") return null;
|
|
220
|
+
let r, o, i;
|
|
221
|
+
const s = ut.exec(n);
|
|
222
|
+
if (s)
|
|
223
|
+
r = Number(s[1]), o = Number(s[2]), i = Number(s[3]);
|
|
224
|
+
else {
|
|
225
|
+
const { order: u, source: c } = L(e), m = new RegExp(`^${c}$`).exec(n);
|
|
226
|
+
if (!m) return null;
|
|
227
|
+
({ year: r, month: o, day: i } = P(u, m));
|
|
228
|
+
}
|
|
229
|
+
return o < 1 || o > 12 || i < 1 || i > h(r, o) ? null : Q({ year: r, month: o, day: i });
|
|
230
|
+
}
|
|
231
|
+
function B() {
|
|
157
232
|
return Intl.DateTimeFormat().resolvedOptions().timeZone;
|
|
158
233
|
}
|
|
159
|
-
function
|
|
234
|
+
function H(t) {
|
|
160
235
|
if (typeof t == "number") return Number.isFinite(t) ? t : null;
|
|
161
236
|
const e = t.replace(/(\.\d{3})\d+/, "$1"), n = Date.parse(e);
|
|
162
237
|
return Number.isNaN(n) ? null : n;
|
|
163
238
|
}
|
|
164
|
-
function
|
|
165
|
-
if (t == null || t === "") return
|
|
166
|
-
const
|
|
167
|
-
if (
|
|
168
|
-
const
|
|
169
|
-
return
|
|
170
|
-
}
|
|
171
|
-
const
|
|
172
|
-
function
|
|
173
|
-
const
|
|
174
|
-
if (
|
|
175
|
-
if (
|
|
176
|
-
const
|
|
177
|
-
return
|
|
239
|
+
function Ct(t, e, n = {}) {
|
|
240
|
+
if (t == null || t === "") return T;
|
|
241
|
+
const r = H(t);
|
|
242
|
+
if (r === null) return String(t);
|
|
243
|
+
const o = n.zone ?? B(), i = F(o, r);
|
|
244
|
+
return ot(p(e, nt).format(rt(i)));
|
|
245
|
+
}
|
|
246
|
+
const ct = String.raw`(?:,?\s+(\d{1,2}):(\d{2})(?::(\d{2}))?(?:\s*([^\d\s].*?))?)?`, at = /^\d{4}-\d{2}-\d{2}[T ]\d{2}:\d{2}(:\d{2}(\.\d+)?)?\s*(Z|[+-]\d{2}:?\d{2})$/;
|
|
247
|
+
function It(t, e, n = {}) {
|
|
248
|
+
const r = v(t, e).trim();
|
|
249
|
+
if (r === "") return null;
|
|
250
|
+
if (at.test(r)) {
|
|
251
|
+
const f = H(r);
|
|
252
|
+
return f === null ? null : new Date(f).toISOString();
|
|
178
253
|
}
|
|
179
|
-
const
|
|
180
|
-
if (!
|
|
181
|
-
const
|
|
182
|
-
if (
|
|
183
|
-
let
|
|
184
|
-
if (
|
|
185
|
-
const
|
|
186
|
-
|
|
187
|
-
const
|
|
188
|
-
if (
|
|
189
|
-
|
|
254
|
+
const { order: o, source: i } = L(e), s = new RegExp(`^${i}${ct}$`).exec(r);
|
|
255
|
+
if (!s) return null;
|
|
256
|
+
const { year: u, month: c, day: m } = P(o, s);
|
|
257
|
+
if (c < 1 || c > 12 || m < 1 || m > h(u, c)) return null;
|
|
258
|
+
let a = 0, S = 0, D = 0;
|
|
259
|
+
if (s[4] !== void 0) {
|
|
260
|
+
const f = Number(s[4]);
|
|
261
|
+
if (S = Number(s[5]), D = s[6] !== void 0 ? Number(s[6]) : 0, S > 59 || D > 59) return null;
|
|
262
|
+
const g = st(e);
|
|
263
|
+
if (g.twelveHour) {
|
|
264
|
+
const b = s[7] === void 0 ? void 0 : $(s[7]);
|
|
265
|
+
if (f < 1 || f > 12 || b !== g.am && b !== g.pm) return null;
|
|
266
|
+
a = b === g.am ? f === 12 ? 0 : f : f === 12 ? 12 : f + 12;
|
|
267
|
+
} else {
|
|
268
|
+
if (f > 23 || s[7] !== void 0) return null;
|
|
269
|
+
a = f;
|
|
270
|
+
}
|
|
190
271
|
}
|
|
191
|
-
const
|
|
192
|
-
return new Date(
|
|
272
|
+
const G = { year: u, month: c, day: m, hour: a, minute: S, second: D, millisecond: 0 }, Z = n.zone ?? B();
|
|
273
|
+
return new Date(et(Z, G)).toISOString();
|
|
193
274
|
}
|
|
194
|
-
const
|
|
275
|
+
const j = {
|
|
195
276
|
style: "currency",
|
|
277
|
+
// I18N-ALLOW: ISO 4217 currency code option
|
|
196
278
|
currency: "USD",
|
|
197
279
|
minimumFractionDigits: 2,
|
|
198
280
|
maximumFractionDigits: 2
|
|
199
|
-
}
|
|
200
|
-
function
|
|
201
|
-
return t == null || !Number.isFinite(t) ?
|
|
202
|
-
}
|
|
203
|
-
function
|
|
204
|
-
const
|
|
205
|
-
if (
|
|
206
|
-
const
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
const
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
}
|
|
228
|
-
const Y = /* @__PURE__ */ new Set(["yes", "y", "true", "t", "1"]), v = /* @__PURE__ */ new Set(["no", "n", "false", "f", "0"]);
|
|
229
|
-
function Nt(t) {
|
|
230
|
-
const e = t.trim().toLowerCase();
|
|
231
|
-
return Y.has(e) ? !0 : v.has(e) ? !1 : null;
|
|
232
|
-
}
|
|
233
|
-
function gt(t, e) {
|
|
281
|
+
};
|
|
282
|
+
function Rt(t, e) {
|
|
283
|
+
return t == null || !Number.isFinite(t) ? T : l(e, j).format(t);
|
|
284
|
+
}
|
|
285
|
+
function _t(t, e) {
|
|
286
|
+
const n = t.trim();
|
|
287
|
+
if (n === "") return null;
|
|
288
|
+
const r = /^\((.*)\)$/.exec(n), o = r !== null, i = r ? r[1] : n, s = l(e, j).formatToParts(0).find((c) => c.type === "currency").value, u = k(i.replace(/\s/g, ""), e, [s, "$"]);
|
|
289
|
+
return u === null ? null : o ? -Math.abs(u) : u;
|
|
290
|
+
}
|
|
291
|
+
function xt(t, e, n = {}) {
|
|
292
|
+
if (t == null || !Number.isFinite(t)) return T;
|
|
293
|
+
const { decimals: r } = n;
|
|
294
|
+
return l(e, r === void 0 ? { maximumFractionDigits: 6 } : { minimumFractionDigits: r, maximumFractionDigits: r }).format(t);
|
|
295
|
+
}
|
|
296
|
+
function kt(t, e) {
|
|
297
|
+
const n = t.trim();
|
|
298
|
+
return n === "" ? null : k(n, e);
|
|
299
|
+
}
|
|
300
|
+
function Ut(t, e, n = {}) {
|
|
301
|
+
const { trueLabel: r = e.yes, falseLabel: o = e.no, unknownLabel: i = e.unknown } = n;
|
|
302
|
+
return t === !0 ? r : t === !1 ? o : i;
|
|
303
|
+
}
|
|
304
|
+
function vt(t, e) {
|
|
305
|
+
const n = t.trim().toLowerCase();
|
|
306
|
+
return e.trueWords.includes(n) ? !0 : e.falseWords.includes(n) ? !1 : null;
|
|
307
|
+
}
|
|
308
|
+
function Lt(t, e) {
|
|
234
309
|
if (!Number.isFinite(t) || !Number.isFinite(e) || e <= 0 || t <= 0) return null;
|
|
235
310
|
const n = Math.round(Math.min(t, e) / e * 5);
|
|
236
311
|
return Math.max(1, Math.min(5, n));
|
|
237
312
|
}
|
|
238
|
-
const
|
|
313
|
+
const Pt = {
|
|
314
|
+
// I18N-ALLOW: English reference word for consumers outside React; components render the provider's `confidenceBar.levels`
|
|
239
315
|
1: "Just a guess",
|
|
316
|
+
// I18N-ALLOW: English reference word for consumers outside React; components render the provider's `confidenceBar.levels`
|
|
240
317
|
2: "Somewhat unsure",
|
|
318
|
+
// I18N-ALLOW: English reference word for consumers outside React; components render the provider's `confidenceBar.levels`
|
|
241
319
|
3: "Fairly confident",
|
|
320
|
+
// I18N-ALLOW: English reference word for consumers outside React; components render the provider's `confidenceBar.levels`
|
|
242
321
|
4: "Confident",
|
|
322
|
+
// I18N-ALLOW: English reference word for consumers outside React; components render the provider's `confidenceBar.levels`
|
|
243
323
|
5: "Highly confident"
|
|
244
|
-
},
|
|
324
|
+
}, _ = 8, mt = [
|
|
245
325
|
"--chart-1",
|
|
246
326
|
"--chart-2",
|
|
247
327
|
"--chart-3",
|
|
@@ -250,94 +330,94 @@ const yt = {
|
|
|
250
330
|
"--chart-6",
|
|
251
331
|
"--chart-7",
|
|
252
332
|
"--chart-8"
|
|
253
|
-
],
|
|
254
|
-
function
|
|
255
|
-
const e =
|
|
333
|
+
], ft = "--chart-seq";
|
|
334
|
+
function Bt(t) {
|
|
335
|
+
const e = mt[t];
|
|
256
336
|
if (!Number.isInteger(t) || e === void 0)
|
|
257
337
|
throw new Error(
|
|
258
|
-
`chartSeriesColor: there are ${
|
|
338
|
+
`chartSeriesColor: there are ${_} categorical hues (index 0-${_ - 1}); got ${t}. Fold the rest into "Other".`
|
|
259
339
|
);
|
|
260
340
|
return `var(${e})`;
|
|
261
341
|
}
|
|
262
|
-
const
|
|
263
|
-
function
|
|
342
|
+
const Ht = `var(${ft})`;
|
|
343
|
+
function dt(t, e) {
|
|
264
344
|
const n = document.documentElement;
|
|
265
345
|
n.setAttribute("data-motion-suspend", ""), n.setAttribute(`data-${t}`, e), getComputedStyle(n).backgroundColor, n.removeAttribute("data-motion-suspend");
|
|
266
346
|
}
|
|
267
|
-
const
|
|
347
|
+
const lt = ["light", "dark"], pt = ["sm", "md", "lg"], gt = ["design", "aa"], ht = ["system", "full", "reduced"], x = "danx-design:appearance", yt = "danx-design:ready", Nt = "danx-design:error", jt = 500, Y = {
|
|
268
348
|
theme: "theme",
|
|
269
349
|
contrast: "contrast",
|
|
270
350
|
uiScale: "ui-scale",
|
|
271
351
|
motion: "motion"
|
|
272
|
-
},
|
|
273
|
-
theme:
|
|
274
|
-
contrast:
|
|
275
|
-
uiScale:
|
|
276
|
-
motion:
|
|
277
|
-
},
|
|
278
|
-
function
|
|
352
|
+
}, Et = {
|
|
353
|
+
theme: lt,
|
|
354
|
+
contrast: gt,
|
|
355
|
+
uiScale: pt,
|
|
356
|
+
motion: ht
|
|
357
|
+
}, Tt = Object.keys(Y);
|
|
358
|
+
function St(t) {
|
|
279
359
|
return typeof t == "object" && t !== null;
|
|
280
360
|
}
|
|
281
|
-
function
|
|
282
|
-
if (!
|
|
283
|
-
const e = { type:
|
|
284
|
-
for (const n of
|
|
361
|
+
function Dt(t) {
|
|
362
|
+
if (!St(t) || t.type !== x) return null;
|
|
363
|
+
const e = { type: x };
|
|
364
|
+
for (const n of Tt) {
|
|
285
365
|
const r = t[n];
|
|
286
366
|
if (r !== void 0) {
|
|
287
|
-
if (typeof r != "string" || !
|
|
367
|
+
if (typeof r != "string" || !Et[n].includes(r)) return null;
|
|
288
368
|
e[n] = r;
|
|
289
369
|
}
|
|
290
370
|
}
|
|
291
371
|
return e;
|
|
292
372
|
}
|
|
293
|
-
function
|
|
373
|
+
function bt(t) {
|
|
294
374
|
const e = (n) => {
|
|
295
375
|
if (n.source !== window.parent) return;
|
|
296
|
-
const r =
|
|
376
|
+
const r = Dt(n.data);
|
|
297
377
|
if (!r) return;
|
|
298
378
|
const o = {};
|
|
299
|
-
for (const [i, s] of Object.entries(
|
|
300
|
-
const u = i,
|
|
301
|
-
|
|
379
|
+
for (const [i, s] of Object.entries(Y)) {
|
|
380
|
+
const u = i, c = r[u];
|
|
381
|
+
c !== void 0 && (dt(s, c), Object.assign(o, { [u]: c }));
|
|
302
382
|
}
|
|
303
383
|
t?.(o);
|
|
304
384
|
};
|
|
305
385
|
return window.addEventListener("message", e), () => window.removeEventListener("message", e);
|
|
306
386
|
}
|
|
307
|
-
function
|
|
308
|
-
const t = { type:
|
|
387
|
+
function $t() {
|
|
388
|
+
const t = { type: yt };
|
|
309
389
|
window.parent.postMessage(t, "*");
|
|
310
390
|
}
|
|
311
|
-
function
|
|
312
|
-
const e = { type:
|
|
391
|
+
function Ft(t) {
|
|
392
|
+
const e = { type: Nt, message: String(t) };
|
|
313
393
|
window.parent.postMessage(e, "*");
|
|
314
394
|
}
|
|
315
|
-
const
|
|
395
|
+
const Yt = { onAppearance: bt, ready: $t, reportError: Ft };
|
|
316
396
|
export {
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
397
|
+
Ht as CHART_SEQUENTIAL_COLOR,
|
|
398
|
+
ft as CHART_SEQUENTIAL_TOKEN,
|
|
399
|
+
_ as CHART_SERIES_COUNT,
|
|
400
|
+
mt as CHART_SERIES_TOKENS,
|
|
401
|
+
Pt as CONFIDENCE_LEVEL_LABELS,
|
|
402
|
+
x as DESIGN_FRAME_APPEARANCE,
|
|
403
|
+
Nt as DESIGN_FRAME_ERROR,
|
|
404
|
+
jt as DESIGN_FRAME_ERROR_MAX_LENGTH,
|
|
405
|
+
yt as DESIGN_FRAME_READY,
|
|
406
|
+
Bt as chartSeriesColor,
|
|
407
|
+
Lt as confidenceLevel,
|
|
408
|
+
Yt as designFrameClient,
|
|
409
|
+
Ut as formatBoolean,
|
|
410
|
+
wt as formatBytes,
|
|
411
|
+
z as formatCompactNumber,
|
|
412
|
+
Rt as formatCurrency,
|
|
413
|
+
Mt as formatDate,
|
|
414
|
+
Ct as formatDateTime,
|
|
415
|
+
xt as formatNumber,
|
|
416
|
+
At as formatTokens,
|
|
417
|
+
vt as parseBoolean,
|
|
418
|
+
_t as parseCurrency,
|
|
419
|
+
Ot as parseDate,
|
|
420
|
+
It as parseDateTime,
|
|
421
|
+
kt as parseNumber
|
|
342
422
|
};
|
|
343
423
|
//# sourceMappingURL=pure.js.map
|