@nivaro/react 0.3.65 → 0.3.67
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/full.css +1 -1
- package/dist/hooks/useSessionRecorder.js +1 -1
- package/dist/index.d.ts +21 -5
- package/dist/shared/components/ActivityEntry.js +28 -28
- package/dist/shared/components/CollectionBrowserView.js +2432 -2592
- package/dist/shared/components/ItemEditForm.js +3912 -3773
- package/dist/shared/components/MyWorkView.js +124 -113
- package/dist/shared/components/ProfileView.js +483 -472
- package/dist/shared/components/RecordCompare.js +149 -129
- package/dist/shared/components/ReportView.js +1100 -1094
- package/dist/shared/components/bulk/BulkCompareButton.js +62 -0
- package/dist/shared/components/bulk/MessageStakeholders.js +235 -0
- package/dist/shared/components/integrations/IntegrationObligationsView.js +199 -187
- package/dist/shared/components/integrations/console/EventsView.js +22 -24
- package/dist/shared/components/integrations/console/SubmissionRow.js +6 -13
- package/dist/shared/components/integrations/console/drill/SubmissionDrill.js +29 -28
- package/dist/shared/components/integrations/console/tone.js +22 -21
- package/dist/shared/components/item-edit/CatalogPickerField.js +240 -238
- package/dist/shared/components/item-edit/FieldRow.js +193 -193
- package/dist/shared/components/item-edit/GroupSection.js +559 -542
- package/dist/shared/components/item-edit/M2MCombobox.js +414 -349
- package/dist/shared/components/item-edit/MidairCollisionDialog.js +211 -187
- package/dist/shared/components/item-edit/RecordInsights.js +46 -45
- package/dist/shared/components/item-edit/RelationCombobox.js +327 -311
- package/dist/shared/components/item-edit/SummaryPanel.js +146 -144
- package/dist/shared/components/item-edit/UserChip.js +264 -229
- package/dist/shared/components/item-edit/cascade-clear-notice.js +23 -19
- package/dist/shared/components/item-edit/header-path-preview.js +52 -0
- package/dist/shared/components/item-edit/line-merge.js +73 -47
- package/dist/shared/components/item-edit/picker-search.js +25 -21
- package/dist/shared/components/panels/BranchLanes.js +7 -7
- package/dist/shared/components/panels/CommentPanel.js +72 -72
- package/dist/shared/components/panels/PipelinePanel.js +261 -261
- package/dist/shared/components/panels/RecordIntegrityBanner.js +78 -78
- package/dist/shared/components/panels/RevisionsPanel.js +220 -220
- package/dist/shared/components/panels/TaskPanel.js +75 -75
- package/dist/shared/components/queue/QueueWorklist.js +1007 -979
- package/dist/shared/lib/compare-value.js +73 -0
- package/dist/shared/lib/format-value.js +19 -18
- package/dist/shared/lib/obligation-reason-text.js +1 -1
- package/dist/shared/lib/quick-filter-cascade.js +29 -19
- package/dist/shared/lib/utils.js +59 -57
- package/package.json +1 -1
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { choiceLabel as S, formatDate as y, formatDateTime as l } from "./utils.js";
|
|
2
|
+
function f(r) {
|
|
3
|
+
if (!r) return {};
|
|
4
|
+
if (typeof r == "string")
|
|
5
|
+
try {
|
|
6
|
+
const t = JSON.parse(r);
|
|
7
|
+
return t && typeof t == "object" && !Array.isArray(t) ? t : {};
|
|
8
|
+
} catch {
|
|
9
|
+
return {};
|
|
10
|
+
}
|
|
11
|
+
return typeof r == "object" && !Array.isArray(r) ? r : {};
|
|
12
|
+
}
|
|
13
|
+
function p(r) {
|
|
14
|
+
const t = f(r == null ? void 0 : r.options), e = f(r == null ? void 0 : r.display_options);
|
|
15
|
+
return (Array.isArray(t.choices) ? t.choices : Array.isArray(e.choices) ? e.choices : []).filter((o) => !!o && typeof o == "object");
|
|
16
|
+
}
|
|
17
|
+
const a = /* @__PURE__ */ new Set(["boolean"]), b = /* @__PURE__ */ new Set(["timestamp", "datetime", "datetime-local"]), d = /* @__PURE__ */ new Set(["integer", "biginteger", "decimal", "float", "bigint"]);
|
|
18
|
+
function h(r) {
|
|
19
|
+
const t = f(r == null ? void 0 : r.options), e = f(r == null ? void 0 : r.display_options);
|
|
20
|
+
if (String(t.format ?? e.format ?? "") !== "currency" && !t.currency && !e.currency) return null;
|
|
21
|
+
const o = String(t.currency ?? e.currency ?? "USD").toUpperCase();
|
|
22
|
+
return /^[A-Z]{3}$/.test(o) ? o : "USD";
|
|
23
|
+
}
|
|
24
|
+
function g(r, t) {
|
|
25
|
+
if (r == null || r === "") return "—";
|
|
26
|
+
const e = p(t);
|
|
27
|
+
if (e.length > 0) {
|
|
28
|
+
const n = e.find((s) => String(s.value) === String(r));
|
|
29
|
+
if (n && n.text != null && String(n.text).trim()) return S(String(n.text));
|
|
30
|
+
}
|
|
31
|
+
const i = String((t == null ? void 0 : t.type) ?? "").toLowerCase(), o = String((t == null ? void 0 : t.interface) ?? "").toLowerCase();
|
|
32
|
+
if (typeof r == "boolean" || a.has(i) || o === "boolean") {
|
|
33
|
+
const n = String(r).toLowerCase();
|
|
34
|
+
if (r === !0 || n === "true" || n === "1") return "Yes";
|
|
35
|
+
if (r === !1 || n === "false" || n === "0") return "No";
|
|
36
|
+
}
|
|
37
|
+
if (i === "date") return y(String(r)) || String(r);
|
|
38
|
+
if (b.has(i) || typeof r == "string" && /^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}/.test(r)) {
|
|
39
|
+
const n = String(r);
|
|
40
|
+
if (/^\d{4}-\d{2}-\d{2}(T00:00:00(\.0+)?Z)?$/.test(n)) return y(n) || n;
|
|
41
|
+
const s = new Date(n);
|
|
42
|
+
return Number.isNaN(s.getTime()) ? n : l(s);
|
|
43
|
+
}
|
|
44
|
+
const c = typeof r == "number" ? r : Number(String(r).trim());
|
|
45
|
+
if ((typeof r == "number" || d.has(i)) && String(r).trim() !== "" && Number.isFinite(c)) {
|
|
46
|
+
const n = h(t);
|
|
47
|
+
if (n)
|
|
48
|
+
try {
|
|
49
|
+
return c.toLocaleString("en-US", { style: "currency", currency: n });
|
|
50
|
+
} catch {
|
|
51
|
+
return c.toLocaleString("en-US", { style: "currency", currency: "USD" });
|
|
52
|
+
}
|
|
53
|
+
return i === "integer" || i === "biginteger" || i === "bigint" ? String(c) : c.toLocaleString("en-US", { maximumFractionDigits: 2 });
|
|
54
|
+
}
|
|
55
|
+
const u = String(r);
|
|
56
|
+
return u.length > 160 ? `${u.slice(0, 160)}…` : u;
|
|
57
|
+
}
|
|
58
|
+
function T(r, t) {
|
|
59
|
+
if (Array.isArray(r) && r.every((e) => e == null || typeof e != "object")) {
|
|
60
|
+
const e = r.filter((i) => i != null && i !== "").map((i) => g(i, t));
|
|
61
|
+
return e.length ? e.join(", ") : "—";
|
|
62
|
+
}
|
|
63
|
+
if (r && typeof r == "object")
|
|
64
|
+
try {
|
|
65
|
+
return JSON.stringify(r).slice(0, 80);
|
|
66
|
+
} catch {
|
|
67
|
+
return "—";
|
|
68
|
+
}
|
|
69
|
+
return g(r, t);
|
|
70
|
+
}
|
|
71
|
+
export {
|
|
72
|
+
T as compareValueText
|
|
73
|
+
};
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import {
|
|
2
|
-
const a = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"],
|
|
1
|
+
import { formatDateTime as s, formatRelative as m } from "./utils.js";
|
|
2
|
+
const a = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"], c = /* @__PURE__ */ new Set(["true", "1", "yes", "y"]), l = /* @__PURE__ */ new Set(["false", "0", "no", "n"]);
|
|
3
3
|
function u(t) {
|
|
4
4
|
return String(t).padStart(2, "0");
|
|
5
5
|
}
|
|
6
|
-
function
|
|
6
|
+
function f(t, e) {
|
|
7
7
|
const n = t.match(/^(\d{4})-(\d{2})-(\d{2})(?:T00:00:00(?:\.000)?Z)?$/), r = n ? new Date(Number(n[1]), Number(n[2]) - 1, Number(n[3])) : new Date(t);
|
|
8
|
-
return Number.isNaN(r.getTime()) ? t : e === "relative" ?
|
|
8
|
+
return Number.isNaN(r.getTime()) ? t : e === "relative" ? m(r) : e.replace(/YYYY|MMM|YY|MM|DD|HH|hh|mm|ss|h|A|a/g, (i) => {
|
|
9
9
|
switch (i) {
|
|
10
10
|
case "YYYY":
|
|
11
11
|
return String(r.getFullYear());
|
|
@@ -36,9 +36,10 @@ function l(t, e) {
|
|
|
36
36
|
}
|
|
37
37
|
});
|
|
38
38
|
}
|
|
39
|
-
function
|
|
39
|
+
function h(t, e) {
|
|
40
40
|
if (e.type === "count") return t;
|
|
41
|
-
if (e.type === "datetime")
|
|
41
|
+
if (e.type === "datetime")
|
|
42
|
+
return e.template !== "relative" && /h|H/.test(e.template) ? s(t) || t : f(t, e.template);
|
|
42
43
|
if (e.type === "number") {
|
|
43
44
|
const r = Number(t);
|
|
44
45
|
if (Number.isNaN(r) || t.trim() === "") return t;
|
|
@@ -50,14 +51,14 @@ function f(t, e) {
|
|
|
50
51
|
return `${e.prefix ?? ""}${i}${e.suffix ?? ""}`;
|
|
51
52
|
}
|
|
52
53
|
const n = t.trim().toLowerCase();
|
|
53
|
-
return
|
|
54
|
+
return c.has(n) ? e.true_label : l.has(n) ? e.false_label : t;
|
|
54
55
|
}
|
|
55
|
-
function
|
|
56
|
+
function N(t, e) {
|
|
56
57
|
if (!t) return t;
|
|
57
58
|
const n = t.match(/ \+\d+ more$/), r = n ? n[0] : "";
|
|
58
|
-
return (r ? t.slice(0, -r.length) : t).split(", ").map((o) =>
|
|
59
|
+
return (r ? t.slice(0, -r.length) : t).split(", ").map((o) => h(o, e)).join(", ") + r;
|
|
59
60
|
}
|
|
60
|
-
function
|
|
61
|
+
function p(t, e = 2) {
|
|
61
62
|
const n = typeof t == "string" ? (() => {
|
|
62
63
|
try {
|
|
63
64
|
return JSON.parse(t);
|
|
@@ -67,8 +68,8 @@ function h(t, e = 2) {
|
|
|
67
68
|
})() : t ?? {}, r = Number(n.precision);
|
|
68
69
|
return Number.isFinite(r) ? Math.min(Math.max(Math.trunc(r), 0), 10) : e;
|
|
69
70
|
}
|
|
70
|
-
function
|
|
71
|
-
const n =
|
|
71
|
+
function b(t, e) {
|
|
72
|
+
const n = p(t);
|
|
72
73
|
return e === "currency" ? {
|
|
73
74
|
style: "currency",
|
|
74
75
|
currency: "USD",
|
|
@@ -76,16 +77,16 @@ function N(t, e) {
|
|
|
76
77
|
maximumFractionDigits: n
|
|
77
78
|
} : { maximumFractionDigits: n };
|
|
78
79
|
}
|
|
79
|
-
function
|
|
80
|
+
function D(t, e) {
|
|
80
81
|
if (e && e.length > 0 && e.length < 50) return e.length;
|
|
81
82
|
if (!t || t === "—") return (e == null ? void 0 : e.length) ?? 0;
|
|
82
83
|
const n = t.match(/\+(\d+) more$/);
|
|
83
84
|
return n ? t.replace(/ \+\d+ more$/, "").split(", ").filter(Boolean).length + Number(n[1]) : t.split(", ").filter(Boolean).length;
|
|
84
85
|
}
|
|
85
86
|
export {
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
87
|
+
D as countFromResolved,
|
|
88
|
+
N as formatMultiValue,
|
|
89
|
+
h as formatValue,
|
|
90
|
+
b as numericIntlOptions,
|
|
91
|
+
p as precisionOf
|
|
91
92
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const i = /* @__PURE__ */ new Set(["id", "po", "req", "url", "sku", "uom", "erp", "api", "ids"]);
|
|
1
|
+
const i = /* @__PURE__ */ new Set(["id", "po", "req", "url", "sku", "uom", "erp", "api", "ids", "mwf"]);
|
|
2
2
|
function r(n) {
|
|
3
3
|
const t = n.trim().replace(/([a-z0-9])([A-Z])/g, "$1 $2").split(/[_\s.-]+/).filter(Boolean).map((e) => e.toLowerCase());
|
|
4
4
|
return t.length === 0 ? n : t.map((e, s) => i.has(e) ? e === "ids" ? "IDs" : e.toUpperCase() : s === 0 ? e.charAt(0).toUpperCase() + e.slice(1) : e).join(" ");
|
|
@@ -1,29 +1,39 @@
|
|
|
1
|
-
import { get as
|
|
2
|
-
function
|
|
3
|
-
const
|
|
4
|
-
for (const
|
|
5
|
-
if (
|
|
6
|
-
const
|
|
7
|
-
(
|
|
1
|
+
import { get as a } from "./commands.js";
|
|
2
|
+
function r(o, t, c) {
|
|
3
|
+
const e = [];
|
|
4
|
+
for (const n of c) {
|
|
5
|
+
if (n.values.length === 0 || n.collection === o) continue;
|
|
6
|
+
const l = t.find(
|
|
7
|
+
(i) => i.many_collection === o && i.one_collection === n.collection && !i.junction_field && !!i.many_field
|
|
8
8
|
);
|
|
9
|
-
if (!
|
|
10
|
-
const
|
|
11
|
-
(
|
|
9
|
+
if (!l) continue;
|
|
10
|
+
const f = t.find(
|
|
11
|
+
(i) => i.many_collection === n.collection && i.one_collection === o && !i.junction_field
|
|
12
12
|
);
|
|
13
|
-
|
|
14
|
-
[
|
|
13
|
+
f && f.one_field && !l.one_field || e.push({
|
|
14
|
+
[l.many_field]: n.field === "id" ? { _in: n.values } : { [n.field]: { _in: n.values } }
|
|
15
15
|
});
|
|
16
16
|
}
|
|
17
|
-
return
|
|
17
|
+
return e.length === 0 ? null : e.length === 1 ? e[0] : { _and: e };
|
|
18
18
|
}
|
|
19
|
-
function
|
|
20
|
-
return
|
|
21
|
-
queryKey: ["cascade-relations",
|
|
22
|
-
queryFn: () =>
|
|
19
|
+
function s(o, t, c) {
|
|
20
|
+
return t.fetchQuery({
|
|
21
|
+
queryKey: ["cascade-relations", c],
|
|
22
|
+
queryFn: () => o.request(a(`/data-model/relations/for/${c}`)).then((e) => e.data ?? []).catch(() => []),
|
|
23
23
|
staleTime: 10 * 6e4
|
|
24
24
|
});
|
|
25
25
|
}
|
|
26
|
+
function d(o, t) {
|
|
27
|
+
if (!t) return [];
|
|
28
|
+
const c = [];
|
|
29
|
+
for (const e of t.dimensions) {
|
|
30
|
+
const n = t.restricted[e.name] ?? [];
|
|
31
|
+
n.length === 0 || e.target_collection === o || c.push({ collection: e.target_collection, field: "id", values: n });
|
|
32
|
+
}
|
|
33
|
+
return c;
|
|
34
|
+
}
|
|
26
35
|
export {
|
|
27
|
-
|
|
28
|
-
|
|
36
|
+
r as cascadeFilter,
|
|
37
|
+
s as fetchCascadeRelations,
|
|
38
|
+
d as restrictedScopeSelections
|
|
29
39
|
};
|
package/dist/shared/lib/utils.js
CHANGED
|
@@ -1,135 +1,137 @@
|
|
|
1
1
|
import { clsx as d } from "clsx";
|
|
2
2
|
import * as h from "lucide-react";
|
|
3
|
-
import { twMerge as
|
|
4
|
-
import { serverNow as
|
|
3
|
+
import { twMerge as N } from "tailwind-merge";
|
|
4
|
+
import { serverNow as D } from "./server-clock.js";
|
|
5
5
|
function M(...t) {
|
|
6
|
-
return
|
|
6
|
+
return N(d(t));
|
|
7
7
|
}
|
|
8
|
-
let
|
|
9
|
-
function
|
|
8
|
+
let u = null;
|
|
9
|
+
function b(t) {
|
|
10
10
|
if (t)
|
|
11
11
|
try {
|
|
12
12
|
new Intl.DateTimeFormat("en-US", { timeZone: t });
|
|
13
13
|
} catch {
|
|
14
14
|
return;
|
|
15
15
|
}
|
|
16
|
-
|
|
16
|
+
u = t;
|
|
17
17
|
}
|
|
18
|
-
function
|
|
19
|
-
return
|
|
18
|
+
function I() {
|
|
19
|
+
return u;
|
|
20
20
|
}
|
|
21
21
|
const g = /* @__PURE__ */ new Set(["1899-12-30", "1900-01-01"]);
|
|
22
22
|
function m(t) {
|
|
23
23
|
if (t == null || t === "") return !1;
|
|
24
|
-
const
|
|
25
|
-
return g.has(
|
|
24
|
+
const n = t instanceof Date ? Number.isNaN(t.getTime()) ? "" : t.toISOString() : String(t);
|
|
25
|
+
return g.has(n.slice(0, 10));
|
|
26
26
|
}
|
|
27
|
-
function _(t,
|
|
27
|
+
function _(t, n) {
|
|
28
28
|
if (m(t)) return "";
|
|
29
|
-
const
|
|
29
|
+
const e = typeof t == "string" ? t.match(/^(\d{4})-(\d{2})-(\d{2})(?:T00:00:00(?:\.000)?Z)?$/) : null, r = e ? new Date(Number(e[1]), Number(e[2]) - 1, Number(e[3])) : new Date(t);
|
|
30
30
|
return new Intl.DateTimeFormat("en-US", {
|
|
31
31
|
month: "short",
|
|
32
32
|
day: "numeric",
|
|
33
33
|
year: "numeric",
|
|
34
34
|
// Calendar-day values never shift zones; real timestamps follow the
|
|
35
35
|
// user's preferred zone when one is set.
|
|
36
|
-
...
|
|
37
|
-
...
|
|
36
|
+
...e || !u ? {} : { timeZone: u },
|
|
37
|
+
...n
|
|
38
38
|
}).format(r);
|
|
39
39
|
}
|
|
40
|
-
function
|
|
40
|
+
function L(t) {
|
|
41
41
|
if (m(t)) return "";
|
|
42
|
-
const
|
|
43
|
-
return Number.isNaN(r.getTime()) ? String(t) : (
|
|
42
|
+
const n = t instanceof Date ? null : String(t), e = n == null ? void 0 : n.match(/^(\d{4})-(\d{2})-(\d{2})(?:[T ]00:00:00(?:\.0+)?(?:Z|[+-]00:?00)?)?$/), r = e ? new Date(Number(e[1]), Number(e[2]) - 1, Number(e[3])) : t instanceof Date ? t : new Date(String(t));
|
|
43
|
+
return Number.isNaN(r.getTime()) ? String(t) : (e && r.setFullYear(Number(e[1])), r.toLocaleDateString());
|
|
44
44
|
}
|
|
45
45
|
function S(t) {
|
|
46
|
-
|
|
47
|
-
|
|
46
|
+
if (t == null || t === "") return "";
|
|
47
|
+
const n = t instanceof Date ? t : new Date(t);
|
|
48
|
+
return Number.isNaN(n.getTime()) ? String(t) : new Intl.DateTimeFormat("en-US", {
|
|
49
|
+
...u ? { timeZone: u } : {},
|
|
48
50
|
month: "short",
|
|
49
51
|
day: "numeric",
|
|
50
52
|
year: "numeric",
|
|
51
53
|
hour: "numeric",
|
|
52
54
|
minute: "2-digit"
|
|
53
|
-
}).format(
|
|
55
|
+
}).format(n);
|
|
54
56
|
}
|
|
55
|
-
let f = "relative",
|
|
57
|
+
let f = "relative", a = "en-US", s = !1;
|
|
56
58
|
function x(t) {
|
|
57
59
|
f = t === "exact" ? "exact" : "relative";
|
|
58
60
|
}
|
|
59
61
|
function U(t) {
|
|
60
62
|
if (t != null && t.locale)
|
|
61
63
|
try {
|
|
62
|
-
new Intl.NumberFormat(t.locale),
|
|
64
|
+
new Intl.NumberFormat(t.locale), a = t.locale;
|
|
63
65
|
} catch {
|
|
64
66
|
}
|
|
65
67
|
else
|
|
66
|
-
|
|
67
|
-
|
|
68
|
+
a = "en-US";
|
|
69
|
+
s = (t == null ? void 0 : t.compact) === !0;
|
|
68
70
|
}
|
|
69
|
-
function y(t,
|
|
70
|
-
const
|
|
71
|
-
if (!
|
|
71
|
+
function y(t, n) {
|
|
72
|
+
const e = n.trim().toLowerCase();
|
|
73
|
+
if (!e) return !0;
|
|
72
74
|
const r = t.toLowerCase();
|
|
73
|
-
return
|
|
75
|
+
return e.split(/\s+/).every((i) => r.includes(i));
|
|
74
76
|
}
|
|
75
77
|
function E(t) {
|
|
76
78
|
if (t == null || Number.isNaN(t)) return "—";
|
|
77
|
-
const
|
|
78
|
-
if (
|
|
79
|
-
if (
|
|
80
|
-
const
|
|
81
|
-
if (
|
|
82
|
-
const
|
|
83
|
-
return c > 0 ? `${
|
|
79
|
+
const n = Math.max(0, t);
|
|
80
|
+
if (n < 1) return `${Math.max(1, Math.round(n * 60))}m`;
|
|
81
|
+
if (n < 48) return `${Math.round(n)}h`;
|
|
82
|
+
const e = n / 24;
|
|
83
|
+
if (e < 7) {
|
|
84
|
+
const o = Math.floor(e), c = Math.round(n - o * 24);
|
|
85
|
+
return c > 0 ? `${o}d ${c}h` : `${o}d`;
|
|
84
86
|
}
|
|
85
|
-
if (
|
|
86
|
-
const r = Math.floor(
|
|
87
|
-
return
|
|
87
|
+
if (e < 60) return `${Math.round(e)}d`;
|
|
88
|
+
const r = Math.floor(e / 30), i = Math.round(e - r * 30);
|
|
89
|
+
return i > 0 ? `${r}mo ${i}d` : `${r}mo`;
|
|
88
90
|
}
|
|
89
91
|
function C(t) {
|
|
90
92
|
if (f === "exact") return S(t);
|
|
91
|
-
const
|
|
93
|
+
const n = new Date(t), e = D() - n.getTime(), r = Math.floor(e / 6e4);
|
|
92
94
|
if (r < 1) return "just now";
|
|
93
95
|
if (r < 60) return `${r}m ago`;
|
|
94
|
-
const
|
|
95
|
-
if (
|
|
96
|
-
const
|
|
97
|
-
return
|
|
96
|
+
const i = Math.floor(r / 60);
|
|
97
|
+
if (i < 24) return `${i}h ago`;
|
|
98
|
+
const o = Math.floor(i / 24);
|
|
99
|
+
return o < 7 ? `${o}d ago` : _(n);
|
|
98
100
|
}
|
|
99
101
|
function T(t) {
|
|
100
|
-
return t.replace(/_/g, " ").replace(/\b\w/g, (
|
|
102
|
+
return t.replace(/_/g, " ").replace(/\b\w/g, (n) => n.toUpperCase());
|
|
101
103
|
}
|
|
102
|
-
const
|
|
104
|
+
const l = {
|
|
103
105
|
_and: [
|
|
104
106
|
{ is_redacted: { _eq: !1 } },
|
|
105
107
|
{ _or: [{ status: { _neq: "suspended" } }, { status: { _null: !0 } }] }
|
|
106
108
|
]
|
|
107
109
|
}, $ = {
|
|
108
|
-
_and: [...
|
|
110
|
+
_and: [...l._and, { account_kind: { _null: !0 } }]
|
|
109
111
|
};
|
|
110
112
|
function O(t) {
|
|
111
|
-
return t ?
|
|
113
|
+
return t ? l : $;
|
|
112
114
|
}
|
|
113
115
|
function A(t) {
|
|
114
|
-
const
|
|
115
|
-
return
|
|
116
|
+
const n = String(t ?? "");
|
|
117
|
+
return n.startsWith("$t:") ? T(n.slice(3).replace(/-/g, "_")) : n;
|
|
116
118
|
}
|
|
117
119
|
function R(t) {
|
|
118
|
-
return t == null ? "—" :
|
|
120
|
+
return t == null ? "—" : s && Math.abs(t) >= 1e4 ? new Intl.NumberFormat(a, {
|
|
119
121
|
notation: "compact",
|
|
120
122
|
maximumFractionDigits: 1
|
|
121
|
-
}).format(t) : t.toLocaleString(
|
|
123
|
+
}).format(t) : t.toLocaleString(a);
|
|
122
124
|
}
|
|
123
125
|
function Z(t) {
|
|
124
126
|
return t == null ? "—" : t < 1024 ? `${t} B` : t < 1024 * 1024 ? `${(t / 1024).toFixed(1)} KB` : t < 1024 * 1024 * 1024 ? `${(t / (1024 * 1024)).toFixed(1)} MB` : `${(t / (1024 * 1024 * 1024)).toFixed(2)} GB`;
|
|
125
127
|
}
|
|
126
128
|
function B(t) {
|
|
127
129
|
if (!t) return null;
|
|
128
|
-
const
|
|
129
|
-
return h[
|
|
130
|
+
const n = t.split("-").map((e) => e.charAt(0).toUpperCase() + e.slice(1)).join("");
|
|
131
|
+
return h[n];
|
|
130
132
|
}
|
|
131
133
|
export {
|
|
132
|
-
|
|
134
|
+
l as ACTIVE_USER_OPTION_FILTER,
|
|
133
135
|
$ as PEOPLE_USER_OPTION_FILTER,
|
|
134
136
|
A as choiceLabel,
|
|
135
137
|
M as cn,
|
|
@@ -138,15 +140,15 @@ export {
|
|
|
138
140
|
Z as formatFileSize,
|
|
139
141
|
R as formatNumber,
|
|
140
142
|
C as formatRelative,
|
|
141
|
-
|
|
143
|
+
I as getDisplayTimezone,
|
|
142
144
|
E as humanHours,
|
|
143
145
|
m as isNullDate,
|
|
144
146
|
y as matchesAllTokens,
|
|
145
147
|
B as resolveCollectionIcon,
|
|
146
|
-
|
|
148
|
+
b as setDisplayTimezone,
|
|
147
149
|
U as setNumberFormat,
|
|
148
150
|
x as setTimeDisplay,
|
|
149
151
|
T as titleCase,
|
|
150
|
-
|
|
152
|
+
L as toLocalDateString,
|
|
151
153
|
O as userOptionFilter
|
|
152
154
|
};
|