@cccsaurora/clue-ui 1.2.6-patch.308 → 1.2.6-patch.316
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/{ActionForm-DNmWuC4Z.js → ActionForm-CJDgCzc7.js} +816 -816
- package/{AnnotationDetails-D1P1z5u_.js → AnnotationDetails-C6xVWHas.js} +1 -1
- package/{AnnotationPreview-CWdMFlnR.js → AnnotationPreview-bOafxZ4A.js} +1 -1
- package/ClueEnrichContext-B8X0Nw9n.js +424 -0
- package/components/AnnotationDetailPopover.js +1 -1
- package/components/AnnotationDetails.js +2 -2
- package/components/AnnotationPreview.js +1 -1
- package/components/EnrichedCard.js +1 -1
- package/components/EnrichedChip.js +2 -2
- package/components/EnrichedTypography.js +2 -2
- package/components/RetryFailedEnrichments.js +1 -1
- package/components/SourcePicker.js +1 -1
- package/components/actions/ActionForm.js +1 -1
- package/components/actions/ExecutePopover.js +1 -1
- package/components/actions/ResultModal.js +1 -1
- package/components/enrichment/EnrichPopover.js +1 -1
- package/components/fetchers/Fetcher.js +1 -1
- package/components/group/GroupControl.js +1 -1
- package/components/stats/QueryStatus.js +1 -1
- package/hooks/ClueActionContext.js +1 -1
- package/hooks/ClueEnrichContext.js +1 -1
- package/hooks/ClueGroupContext.js +1 -1
- package/hooks/CluePopupContext.js +2 -2
- package/hooks/ClueProvider.js +3 -3
- package/hooks/selectors.js +2 -2
- package/hooks/useActionResult.js +1 -1
- package/hooks/useAnnotations.js +13 -13
- package/hooks/useClue.js +1 -1
- package/hooks/useClueActions.js +1 -1
- package/hooks/useErrors.js +1 -1
- package/hooks/useFetcherResult.js +1 -1
- package/icons/Action.js +2 -2
- package/icons/Assessment.js +1 -1
- package/icons/Context.js +1 -1
- package/icons/Opinion.js +1 -1
- package/main.js +4 -4
- package/package.json +16 -16
- package/ClueEnrichContext-KqRuuWNS.js +0 -418
package/hooks/selectors.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { a as l, d as u, b as i, c as m } from "../ActionForm-
|
|
1
|
+
import { a as l, d as u, b as i, c as m } from "../ActionForm-CJDgCzc7.js";
|
|
2
2
|
import "./ClueComponentContext.js";
|
|
3
|
-
import "../ClueEnrichContext-
|
|
3
|
+
import "../ClueEnrichContext-B8X0Nw9n.js";
|
|
4
4
|
import "./ClueFetcherContext.js";
|
|
5
5
|
import "../index-Dj5C04IX.js";
|
|
6
6
|
export {
|
package/hooks/useActionResult.js
CHANGED
package/hooks/useAnnotations.js
CHANGED
|
@@ -1,29 +1,29 @@
|
|
|
1
|
-
import { u as p } from "../ClueEnrichContext-
|
|
2
|
-
import { useContext as q, useMemo as
|
|
1
|
+
import { u as p } from "../ClueEnrichContext-B8X0Nw9n.js";
|
|
2
|
+
import { useContext as q, useMemo as $, useState as d, useEffect as u } from "react";
|
|
3
3
|
import { ClueDatabaseContext as A } from "./ClueDatabaseContext.js";
|
|
4
|
-
import { b as i } from "../ActionForm-
|
|
5
|
-
const D = (n, o, l, { skipEnrichment:
|
|
6
|
-
const s = q(A),
|
|
7
|
-
() => l ??
|
|
8
|
-
[l,
|
|
9
|
-
), [
|
|
4
|
+
import { b as i } from "../ActionForm-CJDgCzc7.js";
|
|
5
|
+
const D = (n, o, l, { skipEnrichment: f } = { skipEnrichment: !1 }) => {
|
|
6
|
+
const s = q(A), a = i((t) => t.defaultClassification), m = i((t) => t.ready), g = i((t) => t.availableSources), h = i((t) => t.queueEnrich), e = $(
|
|
7
|
+
() => l ?? a,
|
|
8
|
+
[l, a]
|
|
9
|
+
), [C, S] = d(!1), [b, x] = d([]), r = $(
|
|
10
10
|
() => m && !!n && !!o && !!e,
|
|
11
11
|
[e, m, n, o]
|
|
12
12
|
);
|
|
13
13
|
return u(() => {
|
|
14
14
|
if (!r || !(s != null && s.status))
|
|
15
15
|
return;
|
|
16
|
-
if (s
|
|
16
|
+
if (s.status.closed) {
|
|
17
17
|
console.warn("Status collection is closed");
|
|
18
18
|
return;
|
|
19
19
|
}
|
|
20
|
-
const t = s.status.count({ selector: { type: n, value: o, classification: e, status: "in-progress" } }).$.subscribe((c) =>
|
|
20
|
+
const t = s.status.count({ selector: { type: n, value: o, classification: e, status: "in-progress" } }).$.subscribe((c) => S(c > 0));
|
|
21
21
|
return () => {
|
|
22
22
|
t == null || t.unsubscribe();
|
|
23
23
|
};
|
|
24
24
|
}, [e, s, r, n, o]), u(() => {
|
|
25
|
-
|
|
26
|
-
}, [g.length, e,
|
|
25
|
+
f || g.length < 1 || !r || !(s != null && s.status) || s.status.closed || h(n, o, e);
|
|
26
|
+
}, [g.length, e, s == null ? void 0 : s.status, h, r, f, n, o]), u(() => {
|
|
27
27
|
if (!r || !(s != null && s.selectors) || s.selectors.closed)
|
|
28
28
|
return;
|
|
29
29
|
const t = s.selectors.find({
|
|
@@ -53,7 +53,7 @@ const D = (n, o, l, { skipEnrichment: a } = { skipEnrichment: !1 }) => {
|
|
|
53
53
|
console.warn(c);
|
|
54
54
|
}
|
|
55
55
|
};
|
|
56
|
-
}, [s, r, o]), [
|
|
56
|
+
}, [s, r, o]), [b, C];
|
|
57
57
|
};
|
|
58
58
|
export {
|
|
59
59
|
D as default
|
package/hooks/useClue.js
CHANGED
package/hooks/useClueActions.js
CHANGED
package/hooks/useErrors.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { useContext as a, useState as i, useEffect as l } from "react";
|
|
2
2
|
import { ClueDatabaseContext as f } from "./ClueDatabaseContext.js";
|
|
3
|
-
import { b as m } from "../ActionForm-
|
|
3
|
+
import { b as m } from "../ActionForm-CJDgCzc7.js";
|
|
4
4
|
const C = (r) => {
|
|
5
5
|
const e = a(f), o = m((s) => s.ready), [n, u] = i([]);
|
|
6
6
|
return l(() => {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { useState as S, useRef as T, useMemo as d, useEffect as g } from "react";
|
|
2
|
-
import { u as _ } from "../ActionForm-
|
|
2
|
+
import { u as _ } from "../ActionForm-CJDgCzc7.js";
|
|
3
3
|
const y = (o, p = 2e3) => {
|
|
4
4
|
const [e, n] = S(o), f = T(null), { getActionStatus: I } = _(), m = d(() => o == null ? void 0 : o.task_id, [o == null ? void 0 : o.task_id]), R = d(() => o == null ? void 0 : o.actionId, [o == null ? void 0 : o.actionId]);
|
|
5
5
|
return g(() => {
|
package/icons/Action.js
CHANGED
|
@@ -2,8 +2,8 @@ import { jsx as e, jsxs as z } from "react/jsx-runtime";
|
|
|
2
2
|
import { I } from "../iconify-BBckr5AQ.js";
|
|
3
3
|
import { useTheme as j, Stack as i, Divider as l, Typography as C } from "@mui/material";
|
|
4
4
|
import R from "../components/CountBadge.js";
|
|
5
|
-
import { C as v } from "../AnnotationPreview-
|
|
6
|
-
import { u as B } from "../ActionForm-
|
|
5
|
+
import { C as v } from "../AnnotationPreview-bOafxZ4A.js";
|
|
6
|
+
import { u as B } from "../ActionForm-CJDgCzc7.js";
|
|
7
7
|
import { g as D } from "../groupBy-br8xmD2R.js";
|
|
8
8
|
import { memo as L, useRef as A, useMemo as s, useEffect as O } from "react";
|
|
9
9
|
import { u as M } from "../index-Dj5C04IX.js";
|
package/icons/Assessment.js
CHANGED
|
@@ -2,7 +2,7 @@ import { jsxs as b, Fragment as k, jsx as s } from "react/jsx-runtime";
|
|
|
2
2
|
import { I as l } from "../iconify-BBckr5AQ.js";
|
|
3
3
|
import { useTheme as j, Stack as y, Chip as I, Divider as q, Grid as C, Tooltip as A } from "@mui/material";
|
|
4
4
|
import z from "../components/CountBadge.js";
|
|
5
|
-
import { C as w } from "../AnnotationPreview-
|
|
5
|
+
import { C as w } from "../AnnotationPreview-bOafxZ4A.js";
|
|
6
6
|
import { g as O } from "../groupBy-br8xmD2R.js";
|
|
7
7
|
import { l as P } from "../last-7CdUxN0r.js";
|
|
8
8
|
import { m as L } from "../maxBy-Bc0dYHcO.js";
|
package/icons/Context.js
CHANGED
|
@@ -4,7 +4,7 @@ import { Stack as u, Divider as z } from "@mui/material";
|
|
|
4
4
|
import v from "../components/AnnotationEntry.js";
|
|
5
5
|
import E from "../components/CountBadge.js";
|
|
6
6
|
import M from "../components/display/icons/Iconified.js";
|
|
7
|
-
import { C as x } from "../AnnotationPreview-
|
|
7
|
+
import { C as x } from "../AnnotationPreview-bOafxZ4A.js";
|
|
8
8
|
import { g as O } from "../groupBy-br8xmD2R.js";
|
|
9
9
|
import { memo as j, useRef as k, useMemo as h, useEffect as B } from "react";
|
|
10
10
|
import { u as g } from "../index-Dj5C04IX.js";
|
package/icons/Opinion.js
CHANGED
|
@@ -2,7 +2,7 @@ import { jsxs as x, Fragment as R, jsx as r } from "react/jsx-runtime";
|
|
|
2
2
|
import { I as u } from "../iconify-BBckr5AQ.js";
|
|
3
3
|
import { useTheme as S, Stack as b, Chip as y, Divider as j, Grid as I } from "@mui/material";
|
|
4
4
|
import q from "../components/CountBadge.js";
|
|
5
|
-
import { C as v } from "../AnnotationPreview-
|
|
5
|
+
import { C as v } from "../AnnotationPreview-bOafxZ4A.js";
|
|
6
6
|
import { g as B } from "../groupBy-br8xmD2R.js";
|
|
7
7
|
import { s as E } from "../sortBy-DY2JBf9n.js";
|
|
8
8
|
import { s as M } from "../sumBy-DuMASLPd.js";
|
package/main.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { A as t, u as r, a, b as f, c as u } from "./ActionForm-
|
|
1
|
+
import { A as t, u as r, a, b as f, c as u } from "./ActionForm-CJDgCzc7.js";
|
|
2
2
|
import { default as n } from "./components/AnnotationDetailPopover.js";
|
|
3
|
-
import { A as l } from "./AnnotationDetails-
|
|
3
|
+
import { A as l } from "./AnnotationDetails-C6xVWHas.js";
|
|
4
4
|
import { default as m } from "./components/AnnotationEntry.js";
|
|
5
|
-
import { A as d, C as i } from "./AnnotationPreview-
|
|
5
|
+
import { A as d, C as i } from "./AnnotationPreview-bOafxZ4A.js";
|
|
6
6
|
import { default as A } from "./components/CountBadge.js";
|
|
7
7
|
import { default as E } from "./components/EnrichedCard.js";
|
|
8
8
|
import { default as b } from "./components/EnrichedChip.js";
|
|
@@ -18,7 +18,7 @@ import { b as R } from "./index-BHAe_V9n.js";
|
|
|
18
18
|
import { ClueComponentContext as j } from "./hooks/ClueComponentContext.js";
|
|
19
19
|
import { ClueConfigContext as H } from "./hooks/ClueConfigProvider.js";
|
|
20
20
|
import { ClueDatabaseContext as L } from "./hooks/ClueDatabaseContext.js";
|
|
21
|
-
import { C as Q } from "./ClueEnrichContext-
|
|
21
|
+
import { C as Q } from "./ClueEnrichContext-B8X0Nw9n.js";
|
|
22
22
|
import { ClueProvider as W } from "./hooks/ClueProvider.js";
|
|
23
23
|
import { default as Y } from "./hooks/useClue.js";
|
|
24
24
|
import { default as $ } from "./hooks/useClueConfig.js";
|
package/package.json
CHANGED
|
@@ -66,46 +66,46 @@
|
|
|
66
66
|
},
|
|
67
67
|
"type": "module",
|
|
68
68
|
"types": "main.d.ts",
|
|
69
|
-
"version": "1.2.6-patch.
|
|
69
|
+
"version": "1.2.6-patch.316",
|
|
70
70
|
"exports": {
|
|
71
71
|
".": "./main.js",
|
|
72
72
|
"./index.css": "./index.css",
|
|
73
73
|
"./en/*.json": "./en/*.json",
|
|
74
74
|
"./fr/*.json": "./fr/*.json",
|
|
75
|
-
"./types/*": "./types/*.js",
|
|
76
|
-
"./components/*": "./components/*.js",
|
|
77
75
|
"./database/*": "./database/*.js",
|
|
78
76
|
"./database": "./database/index.js",
|
|
79
77
|
"./text/*": "./text/*.js",
|
|
80
|
-
"./data/*": "./data/*.js",
|
|
81
|
-
"./icons/*": "./icons/*.js",
|
|
82
|
-
"./hooks/*": "./hooks/*.js",
|
|
83
78
|
"./utils/*": "./utils/*.js",
|
|
84
79
|
"./utils/*.json": "./utils/*.json",
|
|
85
|
-
"./components
|
|
80
|
+
"./components/*": "./components/*.js",
|
|
81
|
+
"./types/*": "./types/*.js",
|
|
82
|
+
"./icons/*": "./icons/*.js",
|
|
83
|
+
"./data/*": "./data/*.js",
|
|
84
|
+
"./hooks/*": "./hooks/*.js",
|
|
86
85
|
"./components/actions/*": "./components/actions/*.js",
|
|
87
|
-
"./components/fetchers/*": "./components/fetchers/*.js",
|
|
88
|
-
"./components/stats/*": "./components/stats/*.js",
|
|
89
86
|
"./components/group/*": "./components/group/*.js",
|
|
87
|
+
"./components/stats/*": "./components/stats/*.js",
|
|
90
88
|
"./components/enrichment/*": "./components/enrichment/*.js",
|
|
89
|
+
"./components/fetchers/*": "./components/fetchers/*.js",
|
|
90
|
+
"./components/display/*": "./components/display/*.js",
|
|
91
|
+
"./components/actions/form/*": "./components/actions/form/*.js",
|
|
92
|
+
"./components/actions/formats/*": "./components/actions/formats/*.js",
|
|
93
|
+
"./components/actions/formats": "./components/actions/formats/index.js",
|
|
91
94
|
"./components/display/markdown/*.md": "./components/display/markdown/*.md.js",
|
|
92
95
|
"./components/display/markdown": "./components/display/markdown/index.js",
|
|
93
96
|
"./components/display/graph/*": "./components/display/graph/*.js",
|
|
94
97
|
"./components/display/graph": "./components/display/graph/index.js",
|
|
98
|
+
"./components/display/icons/*": "./components/display/icons/*.js",
|
|
95
99
|
"./components/display/json/*": "./components/display/json/*.js",
|
|
96
100
|
"./components/display/json": "./components/display/json/index.js",
|
|
97
|
-
"./components/display/icons/*": "./components/display/icons/*.js",
|
|
98
101
|
"./components/display/graph/visualizations/*": "./components/display/graph/visualizations/*.js",
|
|
99
102
|
"./components/display/graph/elements/*": "./components/display/graph/elements/*.js",
|
|
100
103
|
"./components/display/graph/visualizations/panels/*": "./components/display/graph/visualizations/panels/*.js",
|
|
104
|
+
"./components/display/graph/visualizations/icons/*": "./components/display/graph/visualizations/icons/*.js",
|
|
105
|
+
"./components/display/graph/visualizations/icons": "./components/display/graph/visualizations/icons/index.js",
|
|
101
106
|
"./components/display/graph/visualizations/cloud/*": "./components/display/graph/visualizations/cloud/*.js",
|
|
102
107
|
"./components/display/graph/visualizations/cloud": "./components/display/graph/visualizations/cloud/index.js",
|
|
103
108
|
"./components/display/graph/visualizations/tree/*": "./components/display/graph/visualizations/tree/*.js",
|
|
104
|
-
"./components/display/graph/visualizations/tree": "./components/display/graph/visualizations/tree/index.js"
|
|
105
|
-
"./components/display/graph/visualizations/icons/*": "./components/display/graph/visualizations/icons/*.js",
|
|
106
|
-
"./components/display/graph/visualizations/icons": "./components/display/graph/visualizations/icons/index.js",
|
|
107
|
-
"./components/actions/formats/*": "./components/actions/formats/*.js",
|
|
108
|
-
"./components/actions/formats": "./components/actions/formats/index.js",
|
|
109
|
-
"./components/actions/form/*": "./components/actions/form/*.js"
|
|
109
|
+
"./components/display/graph/visualizations/tree": "./components/display/graph/visualizations/tree/index.js"
|
|
110
110
|
}
|
|
111
111
|
}
|
|
@@ -1,418 +0,0 @@
|
|
|
1
|
-
import { jsx as xt } from "react/jsx-runtime";
|
|
2
|
-
import { a as Dt } from "./iconify-BBckr5AQ.js";
|
|
3
|
-
import { b as Et, a as It, p as at, u as ut } from "./useClueTypeConfig-Ct9Ygter.js";
|
|
4
|
-
import { clueDebugLogger as _ } from "./utils/loggerUtil.js";
|
|
5
|
-
import { b as Ct } from "./_baseSlice-M5RKzt1A.js";
|
|
6
|
-
import { t as $t } from "./toFinite-BMy6GObD.js";
|
|
7
|
-
import { d as gt } from "./debounce-DryYcbJ4.js";
|
|
8
|
-
import { g as lt } from "./groupBy-br8xmD2R.js";
|
|
9
|
-
import { b as Ot } from "./_baseIteratee-Dbfsw5z8.js";
|
|
10
|
-
import { b as jt } from "./_baseUniq-BJcj69PL.js";
|
|
11
|
-
import { useContext as Pt, useState as H, useMemo as G, useCallback as $, useRef as Mt, useEffect as b } from "react";
|
|
12
|
-
import { c as qt } from "./index-Dj5C04IX.js";
|
|
13
|
-
import { ClueDatabaseContext as bt } from "./hooks/ClueDatabaseContext.js";
|
|
14
|
-
import At from "./hooks/useClueConfig.js";
|
|
15
|
-
function Bt(s) {
|
|
16
|
-
var n = $t(s), p = n % 1;
|
|
17
|
-
return n === n ? p ? n - p : n : 0;
|
|
18
|
-
}
|
|
19
|
-
var Rt = Math.ceil, Vt = Math.max;
|
|
20
|
-
function Ut(s, n, p) {
|
|
21
|
-
n === void 0 ? n = 1 : n = Vt(Bt(n), 0);
|
|
22
|
-
var l = s == null ? 0 : s.length;
|
|
23
|
-
if (!l || n < 1)
|
|
24
|
-
return [];
|
|
25
|
-
for (var y = 0, v = 0, O = Array(Rt(l / n)); y < l; )
|
|
26
|
-
O[v++] = Ct(s, y, y += n);
|
|
27
|
-
return O;
|
|
28
|
-
}
|
|
29
|
-
function Wt(s, n) {
|
|
30
|
-
return s && s.length ? jt(s, Ot(n)) : [];
|
|
31
|
-
}
|
|
32
|
-
let J;
|
|
33
|
-
const Ft = new Uint8Array(16);
|
|
34
|
-
function Ht() {
|
|
35
|
-
if (!J && (J = typeof crypto < "u" && crypto.getRandomValues && crypto.getRandomValues.bind(crypto), !J))
|
|
36
|
-
throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");
|
|
37
|
-
return J(Ft);
|
|
38
|
-
}
|
|
39
|
-
const d = [];
|
|
40
|
-
for (let s = 0; s < 256; ++s)
|
|
41
|
-
d.push((s + 256).toString(16).slice(1));
|
|
42
|
-
function Jt(s, n = 0) {
|
|
43
|
-
return d[s[n + 0]] + d[s[n + 1]] + d[s[n + 2]] + d[s[n + 3]] + "-" + d[s[n + 4]] + d[s[n + 5]] + "-" + d[s[n + 6]] + d[s[n + 7]] + "-" + d[s[n + 8]] + d[s[n + 9]] + "-" + d[s[n + 10]] + d[s[n + 11]] + d[s[n + 12]] + d[s[n + 13]] + d[s[n + 14]] + d[s[n + 15]];
|
|
44
|
-
}
|
|
45
|
-
const Qt = typeof crypto < "u" && crypto.randomUUID && crypto.randomUUID.bind(crypto), ft = {
|
|
46
|
-
randomUUID: Qt
|
|
47
|
-
};
|
|
48
|
-
function g(s, n, p) {
|
|
49
|
-
if (ft.randomUUID && !s)
|
|
50
|
-
return ft.randomUUID();
|
|
51
|
-
s = s || {};
|
|
52
|
-
const l = s.random || (s.rng || Ht)();
|
|
53
|
-
return l[6] = l[6] & 15 | 64, l[8] = l[8] & 63 | 128, Jt(l);
|
|
54
|
-
}
|
|
55
|
-
const St = qt(null), ne = ({
|
|
56
|
-
children: s,
|
|
57
|
-
classification: n,
|
|
58
|
-
baseURL: p,
|
|
59
|
-
getToken: l,
|
|
60
|
-
onNetworkCall: y,
|
|
61
|
-
pickSources: v,
|
|
62
|
-
chunkSize: O = 15,
|
|
63
|
-
maxRequestCount: Q = 4,
|
|
64
|
-
defaultTimeout: A = 5,
|
|
65
|
-
enabled: B = !0,
|
|
66
|
-
ready: dt = !1,
|
|
67
|
-
publicIconify: K = !0,
|
|
68
|
-
skipConfigCall: X = !1,
|
|
69
|
-
customIconify: R,
|
|
70
|
-
debugLogging: x = !0
|
|
71
|
-
}) => {
|
|
72
|
-
var nt, it, rt, ot, ct;
|
|
73
|
-
const I = At(), e = Pt(bt), [Y, pt] = H(null), w = G(
|
|
74
|
-
() => {
|
|
75
|
-
var t, i;
|
|
76
|
-
return Y ?? n ?? ((i = (t = I.config) == null ? void 0 : t.c12nDef) == null ? void 0 : i.RESTRICTED);
|
|
77
|
-
},
|
|
78
|
-
[n, (it = (nt = I.config) == null ? void 0 : nt.c12nDef) == null ? void 0 : it.RESTRICTED, Y]
|
|
79
|
-
), Z = $(
|
|
80
|
-
(t) => {
|
|
81
|
-
var i;
|
|
82
|
-
return pt(t((i = I.config) == null ? void 0 : i.c12nDef));
|
|
83
|
-
},
|
|
84
|
-
[(rt = I.config) == null ? void 0 : rt.c12nDef]
|
|
85
|
-
), [C, mt] = H(dt), j = Mt(0), [D, yt] = H([]), { availableSources: P, typesDetection: V, supportedTypes: z } = Et(
|
|
86
|
-
B && C,
|
|
87
|
-
p,
|
|
88
|
-
x,
|
|
89
|
-
l,
|
|
90
|
-
y
|
|
91
|
-
);
|
|
92
|
-
b(() => {
|
|
93
|
-
if (X || !B || !C)
|
|
94
|
-
return;
|
|
95
|
-
const t = {}, i = l == null ? void 0 : l();
|
|
96
|
-
i && (t.Authorization = `Bearer ${i}`);
|
|
97
|
-
let u = { baseURL: p, headers: t };
|
|
98
|
-
y && (u = y(u)), It.configs.get(u).then(I.setConfig);
|
|
99
|
-
}, [p, y, X, C]);
|
|
100
|
-
const [N, T] = H(R);
|
|
101
|
-
b(() => {
|
|
102
|
-
R && T(R);
|
|
103
|
-
}, [R]), b(() => {
|
|
104
|
-
if (K)
|
|
105
|
-
return;
|
|
106
|
-
let t = N ?? void 0 ?? (p == null ? void 0 : p.replace(/^[^.]+/, "icons"));
|
|
107
|
-
!t && typeof window < "u" && window && !window.location.origin.includes("localhost") && (t = window.location.protocol + "//" + window.location.origin.replace(/^[^.]+/, "icons")), t && (_(`Using ${t} for iconify`, x), Dt("", {
|
|
108
|
-
resources: [t]
|
|
109
|
-
}));
|
|
110
|
-
}, [p, N, x, K]);
|
|
111
|
-
const U = $(
|
|
112
|
-
async (t) => {
|
|
113
|
-
const i = [];
|
|
114
|
-
for (const c of t) {
|
|
115
|
-
const { latency: o, source: f, type: r, value: h, items: a, error: m } = c;
|
|
116
|
-
m && i.push({
|
|
117
|
-
id: g(),
|
|
118
|
-
source: f,
|
|
119
|
-
type: r,
|
|
120
|
-
value: h,
|
|
121
|
-
annotations: [],
|
|
122
|
-
classification: w,
|
|
123
|
-
latency: o,
|
|
124
|
-
count: 0,
|
|
125
|
-
error: m
|
|
126
|
-
});
|
|
127
|
-
for (const E of a) {
|
|
128
|
-
const { classification: M, count: q, link: F, annotations: wt } = E;
|
|
129
|
-
await e.selectors.find({ selector: { type: r, value: h, source: f, classification: M } }).incrementalRemove();
|
|
130
|
-
const S = {
|
|
131
|
-
id: g(),
|
|
132
|
-
source: f,
|
|
133
|
-
type: r,
|
|
134
|
-
value: h,
|
|
135
|
-
annotations: wt,
|
|
136
|
-
classification: M,
|
|
137
|
-
latency: o,
|
|
138
|
-
count: q,
|
|
139
|
-
link: F,
|
|
140
|
-
error: m
|
|
141
|
-
};
|
|
142
|
-
i.some((vt) => vt.id === S.id) && (S.id = g()), i.push(S);
|
|
143
|
-
}
|
|
144
|
-
}
|
|
145
|
-
const u = await e.selectors.bulkInsert(i);
|
|
146
|
-
u.error.length > 0 && (console.warn("Errors on upsert:"), u.error.forEach((c) => console.warn(c.documentId, c.validationErrors ?? c.status)));
|
|
147
|
-
},
|
|
148
|
-
[e, w]
|
|
149
|
-
), L = $(
|
|
150
|
-
async (t, i, u = {}) => {
|
|
151
|
-
var E, M;
|
|
152
|
-
if (!t || !i)
|
|
153
|
-
return console.error(`Type (${t}) or value (${i}) is empty, returning empty response`), {};
|
|
154
|
-
const c = (v == null ? void 0 : v(D, P, [{ type: t, value: i, classification: u.classification }])) ?? D, o = {
|
|
155
|
-
timeout: A,
|
|
156
|
-
force: !1,
|
|
157
|
-
includeRaw: !1,
|
|
158
|
-
noCache: !1,
|
|
159
|
-
classification: w,
|
|
160
|
-
sources: c,
|
|
161
|
-
...u
|
|
162
|
-
}, f = {}, r = l == null ? void 0 : l();
|
|
163
|
-
r && (f.Authorization = `Bearer ${r}`);
|
|
164
|
-
let h = { baseURL: p, headers: f };
|
|
165
|
-
y && (h = y(h));
|
|
166
|
-
const a = {
|
|
167
|
-
type: t,
|
|
168
|
-
value: i,
|
|
169
|
-
classification: o.classification
|
|
170
|
-
};
|
|
171
|
-
let m = await ((E = e.status) == null ? void 0 : E.findOne({ selector: { ...a } }).exec());
|
|
172
|
-
m ? await m.incrementalPatch({ status: "in-progress" }) : m = await ((M = e.status) == null ? void 0 : M.insert({
|
|
173
|
-
id: g(),
|
|
174
|
-
type: a.type,
|
|
175
|
-
value: a.value,
|
|
176
|
-
classification: a.classification ?? w,
|
|
177
|
-
status: "in-progress"
|
|
178
|
-
}));
|
|
179
|
-
try {
|
|
180
|
-
const q = await at([a], o.sources, o, h), F = Object.values(Object.values(q)[0])[0];
|
|
181
|
-
return await U(Object.values(F)), F;
|
|
182
|
-
} catch (q) {
|
|
183
|
-
return console.error(q), {};
|
|
184
|
-
} finally {
|
|
185
|
-
await (m == null ? void 0 : m.incrementalPatch({ status: "complete" }));
|
|
186
|
-
}
|
|
187
|
-
},
|
|
188
|
-
[
|
|
189
|
-
U,
|
|
190
|
-
P,
|
|
191
|
-
p,
|
|
192
|
-
e,
|
|
193
|
-
w,
|
|
194
|
-
A,
|
|
195
|
-
l,
|
|
196
|
-
y,
|
|
197
|
-
v,
|
|
198
|
-
D
|
|
199
|
-
]
|
|
200
|
-
), W = $(
|
|
201
|
-
async (t, i) => {
|
|
202
|
-
const u = (v == null ? void 0 : v(D, P, t)) ?? D, c = {
|
|
203
|
-
timeout: A,
|
|
204
|
-
includeRaw: !1,
|
|
205
|
-
noCache: !1,
|
|
206
|
-
classification: w,
|
|
207
|
-
sources: u,
|
|
208
|
-
...i
|
|
209
|
-
}, o = {}, f = l == null ? void 0 : l();
|
|
210
|
-
f && (o.Authorization = `Bearer ${f}`);
|
|
211
|
-
let r = { baseURL: p, headers: o };
|
|
212
|
-
y && (r = y(r));
|
|
213
|
-
const h = [];
|
|
214
|
-
for (const a of t) {
|
|
215
|
-
const m = { type: a.type, value: a.value, classification: c.classification };
|
|
216
|
-
let E = await e.status.findOne({
|
|
217
|
-
selector: m
|
|
218
|
-
}).incrementalPatch({
|
|
219
|
-
status: "in-progress"
|
|
220
|
-
});
|
|
221
|
-
E || (E = await e.status.insert({
|
|
222
|
-
id: g(),
|
|
223
|
-
...m,
|
|
224
|
-
status: "in-progress",
|
|
225
|
-
sources: c.sources
|
|
226
|
-
})), h.push(E.toMutableJSON());
|
|
227
|
-
}
|
|
228
|
-
try {
|
|
229
|
-
const a = await at(t, c.sources, c, r), m = Object.values(a).flatMap(Object.values).flatMap(Object.values);
|
|
230
|
-
return await U(m), a;
|
|
231
|
-
} catch (a) {
|
|
232
|
-
return console.error(a), {};
|
|
233
|
-
} finally {
|
|
234
|
-
e.status.bulkUpsert(
|
|
235
|
-
Wt(h, (a) => a.id).map((a) => (a.status = "complete", a))
|
|
236
|
-
);
|
|
237
|
-
}
|
|
238
|
-
},
|
|
239
|
-
[
|
|
240
|
-
v,
|
|
241
|
-
D,
|
|
242
|
-
P,
|
|
243
|
-
A,
|
|
244
|
-
w,
|
|
245
|
-
l,
|
|
246
|
-
p,
|
|
247
|
-
y,
|
|
248
|
-
e,
|
|
249
|
-
U
|
|
250
|
-
]
|
|
251
|
-
), k = $(async () => {
|
|
252
|
-
if (!(e != null && e.selectors) || e.selectors.closed)
|
|
253
|
-
return;
|
|
254
|
-
const t = await e.selectors.find({ selector: { error: { $exists: !0 } } }).exec(), i = lt(t, "classification"), u = [];
|
|
255
|
-
for (const [c, o] of Object.entries(i)) {
|
|
256
|
-
const f = lt(o, (r) => `${r.type}:${r.value}`);
|
|
257
|
-
Object.values(f).forEach((r) => {
|
|
258
|
-
u.push({
|
|
259
|
-
id: g(),
|
|
260
|
-
type: r[0].type,
|
|
261
|
-
value: r[0].value,
|
|
262
|
-
classification: c,
|
|
263
|
-
sources: ut(r.map((h) => h.source)).sort(),
|
|
264
|
-
status: "pending"
|
|
265
|
-
});
|
|
266
|
-
});
|
|
267
|
-
}
|
|
268
|
-
await e.status.bulkInsert(u), await e.selectors.bulkRemove(t);
|
|
269
|
-
}, [e]), tt = G(
|
|
270
|
-
() => gt(
|
|
271
|
-
async () => {
|
|
272
|
-
if (e != null && e.status) {
|
|
273
|
-
if (e.status.closed) {
|
|
274
|
-
console.warn("Status database is closed, will not enrich");
|
|
275
|
-
return;
|
|
276
|
-
}
|
|
277
|
-
} else return;
|
|
278
|
-
const t = await e.status.find({ selector: { status: "pending" } }).update({ $set: { status: "in-progress" } });
|
|
279
|
-
if (t.length < 1)
|
|
280
|
-
return;
|
|
281
|
-
const i = Ut(t, O);
|
|
282
|
-
_(
|
|
283
|
-
`Enriching ${t.length} selectors in ${i.length} chunks of ${O}.`,
|
|
284
|
-
x
|
|
285
|
-
), await Promise.all(
|
|
286
|
-
// For performance reasons, we chunk the requests. This will allow us to take advantage of parellelization in the
|
|
287
|
-
// backend, both on the pod level and kubernetes level
|
|
288
|
-
i.map(async (u) => {
|
|
289
|
-
let c = null;
|
|
290
|
-
if (j.current <= Q)
|
|
291
|
-
j.current += 1;
|
|
292
|
-
else {
|
|
293
|
-
let o = Date.now();
|
|
294
|
-
await new Promise((f) => {
|
|
295
|
-
c = setInterval(() => {
|
|
296
|
-
_(
|
|
297
|
-
`Waiting on ${j.current} existing requests to complete (total delay: ${Date.now() - o}ms)`,
|
|
298
|
-
x
|
|
299
|
-
), j.current < Q && f();
|
|
300
|
-
}, 400);
|
|
301
|
-
}).finally(() => {
|
|
302
|
-
j.current += 1, clearInterval(c);
|
|
303
|
-
});
|
|
304
|
-
}
|
|
305
|
-
try {
|
|
306
|
-
const o = {}, f = ut(u.flatMap((r) => r.sources ?? []));
|
|
307
|
-
f.length > 0 && (o.sources = f), await W(
|
|
308
|
-
u.map((r) => r.toSelector()),
|
|
309
|
-
o
|
|
310
|
-
), await e.status.findByIds(u.map((r) => r.id)).update({ $set: { status: "complete" } });
|
|
311
|
-
} catch (o) {
|
|
312
|
-
console.error(o);
|
|
313
|
-
} finally {
|
|
314
|
-
j.current -= 1, c && clearInterval(c);
|
|
315
|
-
}
|
|
316
|
-
})
|
|
317
|
-
);
|
|
318
|
-
},
|
|
319
|
-
200,
|
|
320
|
-
{ maxWait: 500, leading: !1 }
|
|
321
|
-
),
|
|
322
|
-
[W, O, e, x, Q]
|
|
323
|
-
);
|
|
324
|
-
b(() => {
|
|
325
|
-
}, [e, x]), b(() => {
|
|
326
|
-
if (!B || !C || !(e != null && e.status))
|
|
327
|
-
return;
|
|
328
|
-
if (e != null && e.status.closed) {
|
|
329
|
-
console.warn("Status collection is closed");
|
|
330
|
-
return;
|
|
331
|
-
}
|
|
332
|
-
const t = e.status.find({
|
|
333
|
-
selector: {
|
|
334
|
-
status: "pending"
|
|
335
|
-
}
|
|
336
|
-
}).$.subscribe(() => tt());
|
|
337
|
-
return () => {
|
|
338
|
-
try {
|
|
339
|
-
t == null || t.unsubscribe();
|
|
340
|
-
} catch (i) {
|
|
341
|
-
console.warn(i);
|
|
342
|
-
}
|
|
343
|
-
};
|
|
344
|
-
}, [B, C, e, x, tt, (ot = e == null ? void 0 : e.status) == null ? void 0 : ot.closed]);
|
|
345
|
-
const et = $(
|
|
346
|
-
async (t, i, u) => {
|
|
347
|
-
if (!t)
|
|
348
|
-
throw new Error("Type cannot be null");
|
|
349
|
-
if (!i)
|
|
350
|
-
throw new Error("Value cannot be null");
|
|
351
|
-
const c = { type: t, value: i, classification: u ?? w };
|
|
352
|
-
let o = await e.status.findOne({
|
|
353
|
-
selector: c
|
|
354
|
-
}).exec();
|
|
355
|
-
return o || (o = await e.status.queueInsert({
|
|
356
|
-
id: g(),
|
|
357
|
-
...c,
|
|
358
|
-
status: "pending"
|
|
359
|
-
})), o;
|
|
360
|
-
},
|
|
361
|
-
[w, e]
|
|
362
|
-
), st = $(
|
|
363
|
-
(t) => {
|
|
364
|
-
var f, r;
|
|
365
|
-
if (!t)
|
|
366
|
-
return null;
|
|
367
|
-
const i = Object.entries(V), u = (f = i.find(([h, a]) => a.exec(t))) == null ? void 0 : f[0];
|
|
368
|
-
if (u)
|
|
369
|
-
return u;
|
|
370
|
-
const c = t.toLowerCase(), o = (r = i.find(([h, a]) => a.exec(c))) == null ? void 0 : r[0];
|
|
371
|
-
return o || null;
|
|
372
|
-
},
|
|
373
|
-
[V]
|
|
374
|
-
), ht = G(
|
|
375
|
-
() => {
|
|
376
|
-
var t;
|
|
377
|
-
return {
|
|
378
|
-
bulkEnrich: W,
|
|
379
|
-
enrich: L,
|
|
380
|
-
enrichFailedEnrichments: k,
|
|
381
|
-
sources: D,
|
|
382
|
-
setSources: yt,
|
|
383
|
-
typesDetection: V,
|
|
384
|
-
supportedTypes: z,
|
|
385
|
-
availableSources: P,
|
|
386
|
-
guessType: st,
|
|
387
|
-
queueEnrich: et,
|
|
388
|
-
setCustomIconify: T,
|
|
389
|
-
setDefaultClassification: Z,
|
|
390
|
-
setReady: mt,
|
|
391
|
-
defaultClassification: w,
|
|
392
|
-
ready: C && !!e && !!((t = I.config) != null && t.c12nDef)
|
|
393
|
-
};
|
|
394
|
-
},
|
|
395
|
-
[
|
|
396
|
-
W,
|
|
397
|
-
L,
|
|
398
|
-
k,
|
|
399
|
-
D,
|
|
400
|
-
V,
|
|
401
|
-
z,
|
|
402
|
-
P,
|
|
403
|
-
st,
|
|
404
|
-
et,
|
|
405
|
-
Z,
|
|
406
|
-
w,
|
|
407
|
-
C,
|
|
408
|
-
e,
|
|
409
|
-
(ct = I.config) == null ? void 0 : ct.c12nDef
|
|
410
|
-
]
|
|
411
|
-
);
|
|
412
|
-
return /* @__PURE__ */ xt(St.Provider, { value: ht, children: s });
|
|
413
|
-
};
|
|
414
|
-
export {
|
|
415
|
-
St as C,
|
|
416
|
-
ne as a,
|
|
417
|
-
Wt as u
|
|
418
|
-
};
|