@indxsearch/intrface 2.0.0 → 2.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/CHANGELOG.md +103 -0
- package/LICENSE +1 -1
- package/README.md +18 -3
- package/dist/index.es.js +807 -828
- package/dist/index.umd.js +4 -4
- package/package.json +10 -3
- package/dist/components/ActiveFiltersPanel.d.ts +0 -1
- package/dist/components/RangeFilterPanel.d.ts +0 -11
- package/dist/components/ResultTitle.d.ts +0 -0
- package/dist/components/SearchErrorBoundary.d.ts +0 -45
- package/dist/components/SearchInput.d.ts +0 -8
- package/dist/components/SearchResults.d.ts +0 -7
- package/dist/components/SearchSettingsPanel.d.ts +0 -1
- package/dist/components/SortByPanel.d.ts +0 -8
- package/dist/components/ValueFilterPanel.d.ts +0 -23
- package/dist/context/SearchContext.d.ts +0 -92
- package/dist/context/useSearch.d.ts +0 -1
- package/dist/index.d.ts +0 -11
package/dist/index.es.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
1
|
+
var xt = Object.defineProperty;
|
|
2
|
+
var vt = (r, o, u) => o in r ? xt(r, o, { enumerable: !0, configurable: !0, writable: !0, value: u }) : r[o] = u;
|
|
3
|
+
var rt = (r, o, u) => vt(r, typeof o != "symbol" ? o + "" : o, u);
|
|
4
4
|
import "@indxsearch/systm/styles.css";
|
|
5
|
-
import
|
|
6
|
-
import { SearchField as
|
|
7
|
-
var
|
|
5
|
+
import te, { createContext as bt, useRef as he, useState as G, useEffect as ie, useCallback as ae, useContext as yt, memo as ct, useMemo as Ge, Component as jt } from "react";
|
|
6
|
+
import { SearchField as St, Button as ye, FilterPanelBase as be, ToggleSwitch as re, Checkbox as nt, Slider as ut, InputField as le, Select as Ct, RadioButton as wt } from "@indxsearch/systm";
|
|
7
|
+
var Be = { exports: {} }, Pe = {};
|
|
8
8
|
/**
|
|
9
9
|
* @license React
|
|
10
10
|
* react-jsx-runtime.production.js
|
|
@@ -14,27 +14,27 @@ var qe = { exports: {} }, Pe = {};
|
|
|
14
14
|
* This source code is licensed under the MIT license found in the
|
|
15
15
|
* LICENSE file in the root directory of this source tree.
|
|
16
16
|
*/
|
|
17
|
-
var
|
|
18
|
-
function
|
|
19
|
-
if (
|
|
20
|
-
|
|
17
|
+
var st;
|
|
18
|
+
function kt() {
|
|
19
|
+
if (st) return Pe;
|
|
20
|
+
st = 1;
|
|
21
21
|
var r = Symbol.for("react.transitional.element"), o = Symbol.for("react.fragment");
|
|
22
|
-
function
|
|
22
|
+
function u(s, c, p) {
|
|
23
23
|
var S = null;
|
|
24
|
-
if (
|
|
25
|
-
|
|
26
|
-
for (var
|
|
27
|
-
|
|
28
|
-
} else
|
|
29
|
-
return
|
|
24
|
+
if (p !== void 0 && (S = "" + p), c.key !== void 0 && (S = "" + c.key), "key" in c) {
|
|
25
|
+
p = {};
|
|
26
|
+
for (var m in c)
|
|
27
|
+
m !== "key" && (p[m] = c[m]);
|
|
28
|
+
} else p = c;
|
|
29
|
+
return c = p.ref, {
|
|
30
30
|
$$typeof: r,
|
|
31
31
|
type: s,
|
|
32
32
|
key: S,
|
|
33
|
-
ref:
|
|
34
|
-
props:
|
|
33
|
+
ref: c !== void 0 ? c : null,
|
|
34
|
+
props: p
|
|
35
35
|
};
|
|
36
36
|
}
|
|
37
|
-
return Pe.Fragment = o, Pe.jsx =
|
|
37
|
+
return Pe.Fragment = o, Pe.jsx = u, Pe.jsxs = u, Pe;
|
|
38
38
|
}
|
|
39
39
|
var He = {};
|
|
40
40
|
/**
|
|
@@ -46,44 +46,44 @@ var He = {};
|
|
|
46
46
|
* This source code is licensed under the MIT license found in the
|
|
47
47
|
* LICENSE file in the root directory of this source tree.
|
|
48
48
|
*/
|
|
49
|
-
var
|
|
50
|
-
function
|
|
51
|
-
return
|
|
49
|
+
var ot;
|
|
50
|
+
function Rt() {
|
|
51
|
+
return ot || (ot = 1, process.env.NODE_ENV !== "production" && (function() {
|
|
52
52
|
function r(e) {
|
|
53
53
|
if (e == null) return null;
|
|
54
54
|
if (typeof e == "function")
|
|
55
55
|
return e.$$typeof === Z ? null : e.displayName || e.name || null;
|
|
56
56
|
if (typeof e == "string") return e;
|
|
57
57
|
switch (e) {
|
|
58
|
-
case
|
|
58
|
+
case x:
|
|
59
59
|
return "Fragment";
|
|
60
60
|
case g:
|
|
61
61
|
return "Profiler";
|
|
62
|
-
case
|
|
62
|
+
case _:
|
|
63
63
|
return "StrictMode";
|
|
64
|
-
case
|
|
64
|
+
case b:
|
|
65
65
|
return "Suspense";
|
|
66
|
-
case
|
|
66
|
+
case d:
|
|
67
67
|
return "SuspenseList";
|
|
68
|
-
case
|
|
68
|
+
case V:
|
|
69
69
|
return "Activity";
|
|
70
70
|
}
|
|
71
71
|
if (typeof e == "object")
|
|
72
72
|
switch (typeof e.tag == "number" && console.error(
|
|
73
73
|
"Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."
|
|
74
74
|
), e.$$typeof) {
|
|
75
|
-
case
|
|
75
|
+
case L:
|
|
76
76
|
return "Portal";
|
|
77
|
-
case
|
|
77
|
+
case W:
|
|
78
78
|
return e.displayName || "Context";
|
|
79
|
-
case
|
|
79
|
+
case v:
|
|
80
80
|
return (e._context.displayName || "Context") + ".Consumer";
|
|
81
|
-
case
|
|
81
|
+
case h:
|
|
82
82
|
var a = e.render;
|
|
83
83
|
return e = e.displayName, e || (e = a.displayName || a.name || "", e = e !== "" ? "ForwardRef(" + e + ")" : "ForwardRef"), e;
|
|
84
|
-
case
|
|
84
|
+
case X:
|
|
85
85
|
return a = e.displayName || null, a !== null ? a : r(e.type) || "Memo";
|
|
86
|
-
case
|
|
86
|
+
case z:
|
|
87
87
|
a = e._payload, e = e._init;
|
|
88
88
|
try {
|
|
89
89
|
return r(e(a));
|
|
@@ -95,7 +95,7 @@ function Ct() {
|
|
|
95
95
|
function o(e) {
|
|
96
96
|
return "" + e;
|
|
97
97
|
}
|
|
98
|
-
function
|
|
98
|
+
function u(e) {
|
|
99
99
|
try {
|
|
100
100
|
o(e);
|
|
101
101
|
var a = !1;
|
|
@@ -104,8 +104,8 @@ function Ct() {
|
|
|
104
104
|
}
|
|
105
105
|
if (a) {
|
|
106
106
|
a = console;
|
|
107
|
-
var
|
|
108
|
-
return
|
|
107
|
+
var y = a.error, F = typeof Symbol == "function" && Symbol.toStringTag && e[Symbol.toStringTag] || e.constructor.name || "Object";
|
|
108
|
+
return y.call(
|
|
109
109
|
a,
|
|
110
110
|
"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",
|
|
111
111
|
F
|
|
@@ -113,8 +113,8 @@ function Ct() {
|
|
|
113
113
|
}
|
|
114
114
|
}
|
|
115
115
|
function s(e) {
|
|
116
|
-
if (e ===
|
|
117
|
-
if (typeof e == "object" && e !== null && e.$$typeof ===
|
|
116
|
+
if (e === x) return "<>";
|
|
117
|
+
if (typeof e == "object" && e !== null && e.$$typeof === z)
|
|
118
118
|
return "<...>";
|
|
119
119
|
try {
|
|
120
120
|
var a = r(e);
|
|
@@ -123,11 +123,11 @@ function Ct() {
|
|
|
123
123
|
return "<...>";
|
|
124
124
|
}
|
|
125
125
|
}
|
|
126
|
-
function
|
|
126
|
+
function c() {
|
|
127
127
|
var e = O.A;
|
|
128
128
|
return e === null ? null : e.getOwner();
|
|
129
129
|
}
|
|
130
|
-
function
|
|
130
|
+
function p() {
|
|
131
131
|
return Error("react-stack-top-frame");
|
|
132
132
|
}
|
|
133
133
|
function S(e) {
|
|
@@ -137,33 +137,33 @@ function Ct() {
|
|
|
137
137
|
}
|
|
138
138
|
return e.key !== void 0;
|
|
139
139
|
}
|
|
140
|
-
function
|
|
141
|
-
function
|
|
142
|
-
|
|
140
|
+
function m(e, a) {
|
|
141
|
+
function y() {
|
|
142
|
+
U || (U = !0, console.error(
|
|
143
143
|
"%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",
|
|
144
144
|
a
|
|
145
145
|
));
|
|
146
146
|
}
|
|
147
|
-
|
|
148
|
-
get:
|
|
147
|
+
y.isReactWarning = !0, Object.defineProperty(e, "key", {
|
|
148
|
+
get: y,
|
|
149
149
|
configurable: !0
|
|
150
150
|
});
|
|
151
151
|
}
|
|
152
152
|
function n() {
|
|
153
153
|
var e = r(this.type);
|
|
154
|
-
return
|
|
154
|
+
return ce[e] || (ce[e] = !0, console.error(
|
|
155
155
|
"Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release."
|
|
156
156
|
)), e = this.props.ref, e !== void 0 ? e : null;
|
|
157
157
|
}
|
|
158
|
-
function
|
|
159
|
-
var
|
|
158
|
+
function C(e, a, y, F, ue, xe) {
|
|
159
|
+
var T = y.ref;
|
|
160
160
|
return e = {
|
|
161
161
|
$$typeof: ne,
|
|
162
162
|
type: e,
|
|
163
163
|
key: a,
|
|
164
|
-
props:
|
|
164
|
+
props: y,
|
|
165
165
|
_owner: F
|
|
166
|
-
}, (
|
|
166
|
+
}, (T !== void 0 ? T : null) !== null ? Object.defineProperty(e, "ref", {
|
|
167
167
|
enumerable: !1,
|
|
168
168
|
get: n
|
|
169
169
|
}) : Object.defineProperty(e, "ref", { enumerable: !1, value: null }), e._store = {}, Object.defineProperty(e._store, "validated", {
|
|
@@ -180,7 +180,7 @@ function Ct() {
|
|
|
180
180
|
configurable: !1,
|
|
181
181
|
enumerable: !1,
|
|
182
182
|
writable: !0,
|
|
183
|
-
value:
|
|
183
|
+
value: ue
|
|
184
184
|
}), Object.defineProperty(e, "_debugTask", {
|
|
185
185
|
configurable: !1,
|
|
186
186
|
enumerable: !1,
|
|
@@ -188,25 +188,25 @@ function Ct() {
|
|
|
188
188
|
value: xe
|
|
189
189
|
}), Object.freeze && (Object.freeze(e.props), Object.freeze(e)), e;
|
|
190
190
|
}
|
|
191
|
-
function
|
|
192
|
-
var
|
|
193
|
-
if (
|
|
191
|
+
function A(e, a, y, F, ue, xe) {
|
|
192
|
+
var T = a.children;
|
|
193
|
+
if (T !== void 0)
|
|
194
194
|
if (F)
|
|
195
|
-
if (P(
|
|
196
|
-
for (F = 0; F <
|
|
197
|
-
|
|
198
|
-
Object.freeze && Object.freeze(
|
|
195
|
+
if (P(T)) {
|
|
196
|
+
for (F = 0; F < T.length; F++)
|
|
197
|
+
k(T[F]);
|
|
198
|
+
Object.freeze && Object.freeze(T);
|
|
199
199
|
} else
|
|
200
200
|
console.error(
|
|
201
201
|
"React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead."
|
|
202
202
|
);
|
|
203
|
-
else
|
|
203
|
+
else k(T);
|
|
204
204
|
if (pe.call(a, "key")) {
|
|
205
|
-
|
|
206
|
-
var
|
|
207
|
-
return
|
|
205
|
+
T = r(e);
|
|
206
|
+
var de = Object.keys(a).filter(function(ke) {
|
|
207
|
+
return ke !== "key";
|
|
208
208
|
});
|
|
209
|
-
F = 0 <
|
|
209
|
+
F = 0 < de.length ? "{key: someKey, " + de.join(": ..., ") + ": ...}" : "{key: someKey}", R[T + F] || (de = 0 < de.length ? "{" + de.join(": ..., ") + ": ...}" : "{}", console.error(
|
|
210
210
|
`A props object containing a "key" prop is being spread into JSX:
|
|
211
211
|
let props = %s;
|
|
212
212
|
<%s {...props} />
|
|
@@ -214,477 +214,466 @@ React keys must be passed directly to JSX without using spread:
|
|
|
214
214
|
let props = %s;
|
|
215
215
|
<%s key={someKey} {...props} />`,
|
|
216
216
|
F,
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
),
|
|
217
|
+
T,
|
|
218
|
+
de,
|
|
219
|
+
T
|
|
220
|
+
), R[T + F] = !0);
|
|
221
221
|
}
|
|
222
|
-
if (
|
|
223
|
-
|
|
224
|
-
for (var
|
|
225
|
-
|
|
226
|
-
} else
|
|
227
|
-
return
|
|
228
|
-
|
|
222
|
+
if (T = null, y !== void 0 && (u(y), T = "" + y), S(a) && (u(a.key), T = "" + a.key), "key" in a) {
|
|
223
|
+
y = {};
|
|
224
|
+
for (var ve in a)
|
|
225
|
+
ve !== "key" && (y[ve] = a[ve]);
|
|
226
|
+
} else y = a;
|
|
227
|
+
return T && m(
|
|
228
|
+
y,
|
|
229
229
|
typeof e == "function" ? e.displayName || e.name || "Unknown" : e
|
|
230
|
-
),
|
|
230
|
+
), C(
|
|
231
231
|
e,
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
232
|
+
T,
|
|
233
|
+
y,
|
|
234
|
+
c(),
|
|
235
|
+
ue,
|
|
236
236
|
xe
|
|
237
237
|
);
|
|
238
238
|
}
|
|
239
|
-
function
|
|
240
|
-
|
|
239
|
+
function k(e) {
|
|
240
|
+
q(e) ? e._store && (e._store.validated = 1) : typeof e == "object" && e !== null && e.$$typeof === z && (e._payload.status === "fulfilled" ? q(e._payload.value) && e._payload.value._store && (e._payload.value._store.validated = 1) : e._store && (e._store.validated = 1));
|
|
241
241
|
}
|
|
242
|
-
function
|
|
242
|
+
function q(e) {
|
|
243
243
|
return typeof e == "object" && e !== null && e.$$typeof === ne;
|
|
244
244
|
}
|
|
245
|
-
var
|
|
245
|
+
var M = te, ne = Symbol.for("react.transitional.element"), L = Symbol.for("react.portal"), x = Symbol.for("react.fragment"), _ = Symbol.for("react.strict_mode"), g = Symbol.for("react.profiler"), v = Symbol.for("react.consumer"), W = Symbol.for("react.context"), h = Symbol.for("react.forward_ref"), b = Symbol.for("react.suspense"), d = Symbol.for("react.suspense_list"), X = Symbol.for("react.memo"), z = Symbol.for("react.lazy"), V = Symbol.for("react.activity"), Z = Symbol.for("react.client.reference"), O = M.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, pe = Object.prototype.hasOwnProperty, P = Array.isArray, w = console.createTask ? console.createTask : function() {
|
|
246
246
|
return null;
|
|
247
247
|
};
|
|
248
|
-
|
|
248
|
+
M = {
|
|
249
249
|
react_stack_bottom_frame: function(e) {
|
|
250
250
|
return e();
|
|
251
251
|
}
|
|
252
252
|
};
|
|
253
|
-
var
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
)(),
|
|
257
|
-
He.Fragment =
|
|
253
|
+
var U, ce = {}, fe = M.react_stack_bottom_frame.bind(
|
|
254
|
+
M,
|
|
255
|
+
p
|
|
256
|
+
)(), f = w(s(p)), R = {};
|
|
257
|
+
He.Fragment = x, He.jsx = function(e, a, y) {
|
|
258
258
|
var F = 1e4 > O.recentlyCreatedOwnerStacks++;
|
|
259
|
-
return
|
|
259
|
+
return A(
|
|
260
260
|
e,
|
|
261
261
|
a,
|
|
262
|
-
|
|
262
|
+
y,
|
|
263
263
|
!1,
|
|
264
|
-
F ? Error("react-stack-top-frame") :
|
|
265
|
-
F ?
|
|
264
|
+
F ? Error("react-stack-top-frame") : fe,
|
|
265
|
+
F ? w(s(e)) : f
|
|
266
266
|
);
|
|
267
|
-
}, He.jsxs = function(e, a,
|
|
267
|
+
}, He.jsxs = function(e, a, y) {
|
|
268
268
|
var F = 1e4 > O.recentlyCreatedOwnerStacks++;
|
|
269
|
-
return
|
|
269
|
+
return A(
|
|
270
270
|
e,
|
|
271
271
|
a,
|
|
272
|
-
|
|
272
|
+
y,
|
|
273
273
|
!0,
|
|
274
|
-
F ? Error("react-stack-top-frame") :
|
|
275
|
-
F ?
|
|
274
|
+
F ? Error("react-stack-top-frame") : fe,
|
|
275
|
+
F ? w(s(e)) : f
|
|
276
276
|
);
|
|
277
277
|
};
|
|
278
278
|
})()), He;
|
|
279
279
|
}
|
|
280
|
-
var
|
|
281
|
-
function
|
|
282
|
-
return
|
|
280
|
+
var at;
|
|
281
|
+
function Mt() {
|
|
282
|
+
return at || (at = 1, process.env.NODE_ENV === "production" ? Be.exports = kt() : Be.exports = Rt()), Be.exports;
|
|
283
283
|
}
|
|
284
|
-
var t =
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
284
|
+
var t = Mt(), Le;
|
|
285
|
+
(function(r) {
|
|
286
|
+
r[r.Hibernated = -1] = "Hibernated", r[r.Created = 0] = "Created", r[r.Loading = 1] = "Loading", r[r.Loaded = 2] = "Loaded", r[r.Indexing = 3] = "Indexing", r[r.Ready = 4] = "Ready", r[r.Error = 255] = "Error";
|
|
287
|
+
})(Le || (Le = {}));
|
|
288
|
+
var it;
|
|
289
|
+
(function(r) {
|
|
290
|
+
r[r.Low = 1] = "Low", r[r.Medium = 2] = "Medium", r[r.High = 3] = "High";
|
|
291
|
+
})(it || (it = {}));
|
|
292
|
+
const dt = bt(void 0);
|
|
293
|
+
function Ft(r, o) {
|
|
294
|
+
let u;
|
|
295
|
+
const s = (...c) => {
|
|
296
|
+
clearTimeout(u), u = setTimeout(() => r(...c), o);
|
|
290
297
|
};
|
|
291
|
-
return s.cancel = () => clearTimeout(
|
|
298
|
+
return s.cancel = () => clearTimeout(u), s;
|
|
292
299
|
}
|
|
293
|
-
const
|
|
300
|
+
const Kt = ({
|
|
294
301
|
children: r,
|
|
295
302
|
email: o,
|
|
296
|
-
password:
|
|
303
|
+
password: u,
|
|
297
304
|
url: s,
|
|
298
|
-
dataset:
|
|
299
|
-
allowEmptySearch:
|
|
305
|
+
dataset: c,
|
|
306
|
+
allowEmptySearch: p = !1,
|
|
300
307
|
maxResults: S = 10,
|
|
301
|
-
facetDebounceDelayMillis:
|
|
308
|
+
facetDebounceDelayMillis: m = 500,
|
|
302
309
|
// debounce faceted searches only
|
|
303
310
|
enableFacets: n = !0,
|
|
304
|
-
coverageDepth:
|
|
305
|
-
removeDuplicates:
|
|
306
|
-
enableCoverage:
|
|
307
|
-
initialCoverageSetup:
|
|
308
|
-
enableDebugLogs:
|
|
311
|
+
coverageDepth: C = 500,
|
|
312
|
+
removeDuplicates: A = !0,
|
|
313
|
+
enableCoverage: k = !0,
|
|
314
|
+
initialCoverageSetup: q = {},
|
|
315
|
+
enableDebugLogs: M = !1,
|
|
309
316
|
preAuthenticatedToken: ne
|
|
310
317
|
}) => {
|
|
311
|
-
const
|
|
318
|
+
const L = he(0), x = he(void 0), _ = he(!1), g = he(!1), v = he(!1), W = he(!1), [h, b] = G({
|
|
312
319
|
query: "",
|
|
313
320
|
results: null,
|
|
314
321
|
isLoading: !1,
|
|
315
|
-
resultsSuppressed: !
|
|
322
|
+
resultsSuppressed: !p,
|
|
316
323
|
// Show placeholder if empty search not allowed
|
|
317
|
-
facetDebounceDelayMillis:
|
|
324
|
+
facetDebounceDelayMillis: m,
|
|
318
325
|
filters: {},
|
|
319
326
|
rangeFilters: {},
|
|
320
327
|
facetStats: {},
|
|
321
328
|
searchSettings: {
|
|
322
329
|
maxNumberOfRecordsToReturn: S,
|
|
323
|
-
coverageDepth:
|
|
324
|
-
enableCoverage:
|
|
325
|
-
removeDuplicates:
|
|
330
|
+
coverageDepth: C,
|
|
331
|
+
enableCoverage: k,
|
|
332
|
+
removeDuplicates: A,
|
|
326
333
|
minimumScore: 0,
|
|
327
334
|
showScore: !0,
|
|
328
335
|
placeholderText: "Type to search",
|
|
329
336
|
coverageSetup: {
|
|
330
|
-
//
|
|
331
|
-
levenshteinMaxWordSize: 20,
|
|
332
|
-
minWordSize: 2,
|
|
333
|
-
coverageMinWordHitsAbs: 1,
|
|
334
|
-
coverageMinWordHitsRelative: 0,
|
|
335
|
-
coverageQLimitForErrorTolerance: 5,
|
|
336
|
-
coverageLcsErrorToleranceRelativeq: 0.2,
|
|
337
|
+
// Default values matching Swagger specification
|
|
337
338
|
coverWholeQuery: !0,
|
|
338
339
|
coverWholeWords: !0,
|
|
339
340
|
coverFuzzyWords: !0,
|
|
340
341
|
coverJoinedWords: !0,
|
|
341
342
|
coverPrefixSuffix: !0,
|
|
342
343
|
truncate: !0,
|
|
343
|
-
|
|
344
|
+
includePatternMatches: !0,
|
|
345
|
+
minWordSize: 2,
|
|
346
|
+
levenshteinMaxWordSize: 20,
|
|
347
|
+
truncateWordHitLimit: 1,
|
|
348
|
+
truncateWordHitTolerance: 0,
|
|
349
|
+
truncationScore: 255,
|
|
350
|
+
...q
|
|
344
351
|
// Allow prop-based override
|
|
345
352
|
}
|
|
346
353
|
}
|
|
347
354
|
});
|
|
348
355
|
ie(() => {
|
|
349
|
-
|
|
350
|
-
}, [
|
|
351
|
-
|
|
352
|
-
...
|
|
353
|
-
facetDebounceDelayMillis:
|
|
356
|
+
M && console.log("SearchContext mounted on client");
|
|
357
|
+
}, [M]), ie(() => {
|
|
358
|
+
b((l) => ({
|
|
359
|
+
...l,
|
|
360
|
+
facetDebounceDelayMillis: m
|
|
354
361
|
}));
|
|
355
|
-
}, [
|
|
356
|
-
const [
|
|
357
|
-
if (!
|
|
362
|
+
}, [m]);
|
|
363
|
+
const [d, X] = G(null), [z] = G(n), V = ae((l, i = {}) => {
|
|
364
|
+
if (!d)
|
|
358
365
|
throw new Error("No authentication token available");
|
|
359
|
-
return fetch(
|
|
360
|
-
...
|
|
366
|
+
return fetch(l, {
|
|
367
|
+
...i,
|
|
361
368
|
headers: {
|
|
362
|
-
...
|
|
363
|
-
Authorization: `Bearer ${
|
|
369
|
+
...i.headers,
|
|
370
|
+
Authorization: `Bearer ${d}`
|
|
364
371
|
},
|
|
365
372
|
credentials: "include"
|
|
366
373
|
});
|
|
367
|
-
}, [
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
filters: {},
|
|
372
|
-
rangeFilters: {},
|
|
373
|
-
searchSettings: {
|
|
374
|
-
...l.searchSettings,
|
|
375
|
-
maxNumberOfRecordsToReturn: S
|
|
376
|
-
}
|
|
377
|
-
}));
|
|
378
|
-
}, [S]), $ = K((i) => {
|
|
379
|
-
y((l) => ({
|
|
380
|
-
...l,
|
|
381
|
-
facetDebounceDelayMillis: i
|
|
382
|
-
}));
|
|
383
|
-
}, []), J = K((i) => {
|
|
384
|
-
y((l) => ({
|
|
385
|
-
...l,
|
|
386
|
-
searchSettings: {
|
|
387
|
-
...l.searchSettings,
|
|
374
|
+
}, [d]), [Z, O] = G([]), [pe, P] = G([]), [w, U] = G([]), [ce, fe] = G(!0), [f, R] = G({}), [e, a] = G({}), [y, F] = G({}), [ue, xe] = G(""), [T, de] = G(""), [ve, ke] = G({}), $ = he(null), I = ae((l) => {
|
|
375
|
+
W.current = !1, b((i) => {
|
|
376
|
+
const j = Object.keys(i.filters).length > 0, E = Object.keys(i.rangeFilters).length > 0;
|
|
377
|
+
return {
|
|
388
378
|
...i,
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
379
|
+
query: l,
|
|
380
|
+
filters: j ? {} : i.filters,
|
|
381
|
+
rangeFilters: E ? {} : i.rangeFilters,
|
|
382
|
+
searchSettings: {
|
|
383
|
+
...i.searchSettings,
|
|
384
|
+
maxNumberOfRecordsToReturn: S
|
|
392
385
|
}
|
|
393
|
-
}
|
|
386
|
+
};
|
|
387
|
+
});
|
|
388
|
+
}, [S]), J = ae((l) => {
|
|
389
|
+
b((i) => ({
|
|
390
|
+
...i,
|
|
391
|
+
facetDebounceDelayMillis: l
|
|
394
392
|
}));
|
|
395
|
-
}, []),
|
|
396
|
-
|
|
397
|
-
...l
|
|
393
|
+
}, []), _e = ae((l) => {
|
|
394
|
+
b((i) => {
|
|
395
|
+
const j = { ...i.searchSettings, ...l };
|
|
396
|
+
return l.coverageSetup ? j.coverageSetup = {
|
|
397
|
+
...i.searchSettings.coverageSetup,
|
|
398
|
+
...l.coverageSetup
|
|
399
|
+
} : j.coverageSetup = i.searchSettings.coverageSetup, {
|
|
400
|
+
...i,
|
|
401
|
+
searchSettings: j
|
|
402
|
+
};
|
|
403
|
+
});
|
|
404
|
+
}, []), Te = ae((l) => {
|
|
405
|
+
v.current = !0, b((i) => ({
|
|
406
|
+
...i,
|
|
398
407
|
searchSettings: {
|
|
399
|
-
...
|
|
400
|
-
maxNumberOfRecordsToReturn:
|
|
408
|
+
...i.searchSettings,
|
|
409
|
+
maxNumberOfRecordsToReturn: l
|
|
401
410
|
}
|
|
402
411
|
}));
|
|
403
|
-
}, []),
|
|
404
|
-
|
|
405
|
-
const
|
|
406
|
-
return
|
|
407
|
-
...
|
|
408
|
-
filters:
|
|
412
|
+
}, []), Ae = ae((l, i) => {
|
|
413
|
+
W.current = !0, b((j) => {
|
|
414
|
+
const E = { ...j.filters }, H = E[l] || [], B = H.includes(i) ? H.filter((K) => K !== i) : [...H, i];
|
|
415
|
+
return B.length ? E[l] = B : delete E[l], {
|
|
416
|
+
...j,
|
|
417
|
+
filters: E
|
|
409
418
|
};
|
|
410
419
|
});
|
|
411
|
-
}, []),
|
|
412
|
-
|
|
413
|
-
...
|
|
420
|
+
}, []), qe = ae((l, i, j) => {
|
|
421
|
+
W.current = !0, b((E) => ({
|
|
422
|
+
...E,
|
|
414
423
|
rangeFilters: {
|
|
415
|
-
...
|
|
416
|
-
[
|
|
424
|
+
...E.rangeFilters,
|
|
425
|
+
[l]: { min: i, max: j }
|
|
417
426
|
}
|
|
418
427
|
}));
|
|
419
|
-
}, []), ze =
|
|
420
|
-
|
|
421
|
-
...
|
|
428
|
+
}, []), ze = ae(() => {
|
|
429
|
+
W.current = !0, b((l) => ({
|
|
430
|
+
...l,
|
|
422
431
|
filters: {},
|
|
423
432
|
rangeFilters: {}
|
|
424
433
|
}));
|
|
425
|
-
}, []),
|
|
426
|
-
|
|
427
|
-
const
|
|
428
|
-
if (
|
|
429
|
-
const
|
|
430
|
-
|
|
434
|
+
}, []), ft = ae((l, i, j = !0) => {
|
|
435
|
+
j && (W.current = !0), b((E) => {
|
|
436
|
+
const H = { ...E.filters }, B = { ...E.rangeFilters };
|
|
437
|
+
if (i !== void 0) {
|
|
438
|
+
const se = (H[l] || []).filter((Q) => Q !== i);
|
|
439
|
+
se.length > 0 ? H[l] = se : delete H[l];
|
|
431
440
|
} else
|
|
432
|
-
delete
|
|
441
|
+
delete B[l];
|
|
433
442
|
return {
|
|
434
|
-
...
|
|
435
|
-
filters:
|
|
436
|
-
rangeFilters:
|
|
443
|
+
...E,
|
|
444
|
+
filters: H,
|
|
445
|
+
rangeFilters: B
|
|
437
446
|
};
|
|
438
447
|
});
|
|
439
|
-
}, []),
|
|
440
|
-
|
|
441
|
-
...
|
|
442
|
-
sortBy:
|
|
443
|
-
sortAscending:
|
|
448
|
+
}, []), mt = ae((l, i) => {
|
|
449
|
+
b((j) => ({
|
|
450
|
+
...j,
|
|
451
|
+
sortBy: l || void 0,
|
|
452
|
+
sortAscending: l ? i : void 0
|
|
444
453
|
}));
|
|
445
|
-
}, []),
|
|
446
|
-
if (
|
|
447
|
-
if (
|
|
448
|
-
let
|
|
449
|
-
for (let
|
|
450
|
-
const
|
|
454
|
+
}, []), Xe = ae(async (l, i, j) => {
|
|
455
|
+
if (l.length === 0) return null;
|
|
456
|
+
if (l.length === 1) return l[0];
|
|
457
|
+
let E = l[0];
|
|
458
|
+
for (let H = 1; H < l.length; H++) {
|
|
459
|
+
const B = await V(`${i}/api/CombineFilters/${j}`, {
|
|
451
460
|
// Combine the current filter with the next filter
|
|
452
461
|
method: "PUT",
|
|
453
462
|
headers: {
|
|
454
463
|
"Content-Type": "application/json"
|
|
455
464
|
},
|
|
456
|
-
body: JSON.stringify({ A:
|
|
465
|
+
body: JSON.stringify({ A: E, B: l[H], useAndOperation: !0 })
|
|
457
466
|
});
|
|
458
|
-
if (!
|
|
459
|
-
const
|
|
460
|
-
throw console.error("CombineFilters failed:",
|
|
467
|
+
if (!B.ok) {
|
|
468
|
+
const K = await B.json();
|
|
469
|
+
throw console.error("CombineFilters failed:", K), new Error("CombineFilters failed");
|
|
461
470
|
}
|
|
462
|
-
|
|
471
|
+
E = await B.json();
|
|
463
472
|
}
|
|
464
|
-
return
|
|
465
|
-
}, [
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
c.searchSettings.coverageSetup.coverageQLimitForErrorTolerance,
|
|
471
|
-
c.searchSettings.coverageSetup.coverageLcsErrorToleranceRelativeq,
|
|
472
|
-
c.searchSettings.coverageSetup.coverWholeQuery,
|
|
473
|
-
c.searchSettings.coverageSetup.coverWholeWords,
|
|
474
|
-
c.searchSettings.coverageSetup.coverFuzzyWords,
|
|
475
|
-
c.searchSettings.coverageSetup.coverJoinedWords,
|
|
476
|
-
c.searchSettings.coverageSetup.coverPrefixSuffix,
|
|
477
|
-
c.searchSettings.coverageSetup.truncate
|
|
478
|
-
]), Ke = K(
|
|
479
|
-
async ({ enableFacets: i }) => {
|
|
480
|
-
if (!j) return;
|
|
481
|
-
const l = ++q.current;
|
|
482
|
-
y((C) => ({ ...C, isLoading: !0 }));
|
|
473
|
+
return E;
|
|
474
|
+
}, [V]), Ue = h.searchSettings.maxNumberOfRecordsToReturn, Je = h.searchSettings.enableCoverage, Ye = h.searchSettings.removeDuplicates, Ze = h.searchSettings.coverageDepth, Qe = h.searchSettings.minimumScore, $e = h.sortBy, Ie = h.sortAscending, Ke = h.searchSettings.coverageSetup, et = ae(
|
|
475
|
+
async ({ enableFacets: l }) => {
|
|
476
|
+
if (!d) return;
|
|
477
|
+
const i = ++L.current;
|
|
478
|
+
b((j) => ({ ...j, isLoading: !0 }));
|
|
483
479
|
try {
|
|
484
|
-
const
|
|
485
|
-
|
|
486
|
-
async ([
|
|
480
|
+
const j = Object.entries(h.filters ?? {}), H = (await Promise.all(
|
|
481
|
+
j.map(
|
|
482
|
+
async ([D, Y]) => Promise.all(
|
|
487
483
|
Y.map(
|
|
488
|
-
(
|
|
484
|
+
(ee) => V(`${s}/api/CreateValueFilter/${c}`, {
|
|
489
485
|
method: "PUT",
|
|
490
486
|
headers: {
|
|
491
487
|
"Content-Type": "application/json"
|
|
492
488
|
},
|
|
493
|
-
body: JSON.stringify({ FieldName:
|
|
489
|
+
body: JSON.stringify({ FieldName: D, Value: ee })
|
|
494
490
|
}).then((ge) => ge.json())
|
|
495
491
|
)
|
|
496
492
|
)
|
|
497
493
|
)
|
|
498
|
-
)).flat(),
|
|
499
|
-
|
|
500
|
-
([
|
|
494
|
+
)).flat(), B = Object.entries(h.rangeFilters ?? {}), K = await Promise.all(
|
|
495
|
+
B.map(
|
|
496
|
+
([D, { min: Y, max: ee }]) => V(`${s}/api/CreateRangeFilter/${c}`, {
|
|
501
497
|
method: "PUT",
|
|
502
498
|
headers: {
|
|
503
499
|
"Content-Type": "application/json"
|
|
504
500
|
},
|
|
505
|
-
body: JSON.stringify({ FieldName:
|
|
501
|
+
body: JSON.stringify({ FieldName: D, LowerLimit: Y, UpperLimit: ee })
|
|
506
502
|
}).then((ge) => ge.json())
|
|
507
503
|
)
|
|
508
|
-
),
|
|
509
|
-
(
|
|
510
|
-
),
|
|
511
|
-
text:
|
|
512
|
-
maxNumberOfRecordsToReturn:
|
|
513
|
-
enableFacets:
|
|
514
|
-
...
|
|
504
|
+
), se = [...H, ...K].filter(
|
|
505
|
+
(D) => D && typeof D.hashString == "string"
|
|
506
|
+
), Q = await Xe(se, s, c), Se = p || h.query.trim() !== "", De = {
|
|
507
|
+
text: h.query,
|
|
508
|
+
maxNumberOfRecordsToReturn: Se ? Ue : 0,
|
|
509
|
+
enableFacets: l,
|
|
510
|
+
...Q ? { filter: Q } : {},
|
|
515
511
|
...$e ? { sortBy: $e } : {},
|
|
516
512
|
...Ie !== void 0 ? { sortAscending: Ie } : {},
|
|
517
|
-
enableCoverage:
|
|
518
|
-
removeDuplicates:
|
|
519
|
-
coverageDepth:
|
|
520
|
-
coverageSetup:
|
|
513
|
+
enableCoverage: Je,
|
|
514
|
+
removeDuplicates: Ye,
|
|
515
|
+
coverageDepth: Ze,
|
|
516
|
+
coverageSetup: Ke
|
|
521
517
|
};
|
|
522
|
-
|
|
523
|
-
const
|
|
518
|
+
M && console.log("[performSearch] request body:", JSON.stringify(De, null, 2));
|
|
519
|
+
const Re = await (await V(`${s}/api/Search/${c}`, {
|
|
524
520
|
method: "POST",
|
|
525
521
|
headers: {
|
|
526
522
|
"Content-Type": "application/json"
|
|
527
523
|
},
|
|
528
|
-
body: JSON.stringify(
|
|
529
|
-
})).json(), Ce =
|
|
530
|
-
let
|
|
531
|
-
|
|
524
|
+
body: JSON.stringify(De)
|
|
525
|
+
})).json(), Ce = Re.truncationIndex ?? -1, we = Re.records || [], Me = we.map((D) => D.documentKey), N = we.map((D) => D.score);
|
|
526
|
+
let oe = [];
|
|
527
|
+
Se && Me.length > 0 && (oe = (await (await V(`${s}/api/GetJson/${c}`, {
|
|
532
528
|
method: "POST",
|
|
533
529
|
headers: {
|
|
534
530
|
"Content-Type": "application/json"
|
|
535
531
|
},
|
|
536
|
-
body: JSON.stringify(
|
|
537
|
-
})).json()).map((
|
|
538
|
-
document:
|
|
539
|
-
documentKey:
|
|
532
|
+
body: JSON.stringify(Me)
|
|
533
|
+
})).json()).map((ee, ge) => ({
|
|
534
|
+
document: ee,
|
|
535
|
+
documentKey: Me[ge],
|
|
540
536
|
score: N[ge]
|
|
541
537
|
})));
|
|
542
|
-
let
|
|
543
|
-
if (
|
|
544
|
-
for (const [
|
|
538
|
+
let me = {};
|
|
539
|
+
if (l && Re.facets) {
|
|
540
|
+
for (const [D, Y] of Object.entries(Re.facets))
|
|
545
541
|
if (Array.isArray(Y) && Y.length > 0) {
|
|
546
|
-
const
|
|
547
|
-
|
|
548
|
-
min: Math.min(...
|
|
549
|
-
max: Math.max(...
|
|
542
|
+
const ee = Y.map((ge) => Number(ge.key)).filter((ge) => !isNaN(ge));
|
|
543
|
+
ee.length > 0 && (me[D] = {
|
|
544
|
+
min: Math.min(...ee),
|
|
545
|
+
max: Math.max(...ee)
|
|
550
546
|
});
|
|
551
547
|
}
|
|
552
548
|
}
|
|
553
|
-
const Ve =
|
|
554
|
-
let
|
|
555
|
-
if (Ve ? (
|
|
556
|
-
const
|
|
557
|
-
for (const [Y,
|
|
558
|
-
|
|
559
|
-
|
|
549
|
+
const Ve = h.query !== ue, gt = h.query !== T;
|
|
550
|
+
let We = h.facetStats ?? {};
|
|
551
|
+
if (Ve ? (We = { ...f, ...me }, F(We), xe(h.query)) : We = { ...y, ...me }, gt && l) {
|
|
552
|
+
const D = { ...ve };
|
|
553
|
+
for (const [Y, ee] of Object.entries(me))
|
|
554
|
+
D[Y] = ee;
|
|
555
|
+
ke(D), de(h.query);
|
|
560
556
|
}
|
|
561
|
-
let Oe =
|
|
562
|
-
if (
|
|
557
|
+
let Oe = Re.facets;
|
|
558
|
+
if (l && (!Oe || Object.keys(Oe).length === 0)) {
|
|
563
559
|
Oe = {};
|
|
564
|
-
for (const [
|
|
565
|
-
Oe[
|
|
560
|
+
for (const [D, Y] of Object.entries(e))
|
|
561
|
+
Oe[D] = Y.map((ee) => ({ key: ee, value: null }));
|
|
566
562
|
}
|
|
567
|
-
if (
|
|
563
|
+
if (i !== L.current)
|
|
568
564
|
return;
|
|
569
|
-
const
|
|
570
|
-
const Y =
|
|
571
|
-
return Y === "" || Y.length === 1 ? !0 :
|
|
565
|
+
const pt = oe.filter((D) => {
|
|
566
|
+
const Y = h.query.trim();
|
|
567
|
+
return Y === "" || Y.length === 1 ? !0 : D.score >= Qe;
|
|
572
568
|
});
|
|
573
|
-
|
|
574
|
-
...
|
|
575
|
-
results:
|
|
576
|
-
resultsSuppressed: !
|
|
577
|
-
...
|
|
569
|
+
b((D) => ({
|
|
570
|
+
...D,
|
|
571
|
+
results: pt,
|
|
572
|
+
resultsSuppressed: !Se,
|
|
573
|
+
...l ? {
|
|
578
574
|
facets: Oe,
|
|
579
|
-
facetStats:
|
|
575
|
+
facetStats: We
|
|
580
576
|
} : {},
|
|
581
577
|
isLoading: !1,
|
|
582
578
|
truncationIndex: Ce
|
|
583
579
|
}));
|
|
584
|
-
} catch (
|
|
585
|
-
if (console.error("[Search] ❌ Search failed:",
|
|
580
|
+
} catch (j) {
|
|
581
|
+
if (console.error("[Search] ❌ Search failed:", j), j instanceof TypeError && j.message.includes("fetch") ? (console.error("[Search] ❌ Network error - cannot reach INDX server"), console.error("[Search] 💡 Check if server is running at:", s)) : j instanceof Error && (j.message.includes("401") ? (console.error("[Search] ❌ Authentication failed"), console.error("[Search] 💡 Your token may have expired. Get a fresh token with:"), console.error('[Search] 💡 curl -X POST "' + s + `/api/Login" -H "Content-Type: application/json" -d '{"userEmail":"your@email.com","userPassWord":"yourpassword"}'`)) : j.message.includes("404") ? (console.error("[Search] ❌ Dataset not found"), console.error('[Search] 💡 Check that dataset "' + c + '" exists')) : console.error("[Search] 💡 Error:", j.message)), i !== L.current)
|
|
586
582
|
return;
|
|
587
|
-
|
|
588
|
-
...
|
|
583
|
+
b((E) => ({
|
|
584
|
+
...E,
|
|
589
585
|
results: null,
|
|
590
586
|
isLoading: !1,
|
|
591
587
|
resultsSuppressed: !1,
|
|
592
|
-
error:
|
|
588
|
+
error: j instanceof Error ? j.message : "Search failed"
|
|
593
589
|
}));
|
|
594
590
|
}
|
|
595
591
|
},
|
|
596
592
|
[
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
593
|
+
h.query,
|
|
594
|
+
h.filters,
|
|
595
|
+
h.rangeFilters,
|
|
600
596
|
$e,
|
|
601
597
|
Ie,
|
|
602
598
|
Ue,
|
|
603
|
-
Xe,
|
|
604
599
|
Je,
|
|
605
|
-
Qe,
|
|
606
|
-
Ze,
|
|
607
600
|
Ye,
|
|
608
|
-
|
|
609
|
-
|
|
601
|
+
Ze,
|
|
602
|
+
Ke,
|
|
603
|
+
Qe,
|
|
604
|
+
V,
|
|
605
|
+
Xe,
|
|
610
606
|
s,
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
607
|
+
c,
|
|
608
|
+
p,
|
|
609
|
+
d
|
|
614
610
|
]
|
|
615
611
|
);
|
|
616
612
|
ie(() => {
|
|
617
|
-
|
|
618
|
-
}, [
|
|
619
|
-
|
|
620
|
-
k && console.log("Search fired"), (i = p.current) == null || i.call(p, { enableFacets: !1 });
|
|
621
|
-
}, []);
|
|
622
|
-
const ue = me(null);
|
|
613
|
+
x.current = et;
|
|
614
|
+
}, [et]);
|
|
615
|
+
const je = he(null);
|
|
623
616
|
return ie(() => {
|
|
624
|
-
var
|
|
625
|
-
return (
|
|
626
|
-
var
|
|
627
|
-
|
|
628
|
-
},
|
|
629
|
-
var
|
|
630
|
-
(
|
|
617
|
+
var l;
|
|
618
|
+
return (l = je.current) == null || l.cancel(), je.current = Ft(() => {
|
|
619
|
+
var i;
|
|
620
|
+
M && console.log("Debounced searchWithFacets fired"), (i = x.current) == null || i.call(x, { enableFacets: !0 });
|
|
621
|
+
}, h.facetDebounceDelayMillis ?? 500), () => {
|
|
622
|
+
var i;
|
|
623
|
+
(i = je.current) == null || i.cancel();
|
|
631
624
|
};
|
|
632
|
-
}, [
|
|
633
|
-
var
|
|
634
|
-
(
|
|
635
|
-
}, []), ie(() => {
|
|
636
|
-
var
|
|
637
|
-
!
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
if (i === "" && !v) {
|
|
643
|
-
c.resultsSuppressed || y((oe) => ({
|
|
644
|
-
...oe,
|
|
625
|
+
}, [h.facetDebounceDelayMillis]), ie(() => {
|
|
626
|
+
var l;
|
|
627
|
+
!ce && d && !_.current && (p && ((l = x.current) == null || l.call(x, { enableFacets: z })), _.current = !0);
|
|
628
|
+
}, [ce, d, p, z]), ie(() => {
|
|
629
|
+
var E, H, B, K, se;
|
|
630
|
+
if (!d || !_.current) return;
|
|
631
|
+
const l = h.query.trim(), i = l === "" && p;
|
|
632
|
+
if (l === "" && !p) {
|
|
633
|
+
h.resultsSuppressed || b((Q) => ({
|
|
634
|
+
...Q,
|
|
645
635
|
resultsSuppressed: !0
|
|
646
636
|
}));
|
|
647
637
|
return;
|
|
648
638
|
}
|
|
649
|
-
return
|
|
650
|
-
var
|
|
651
|
-
(
|
|
639
|
+
return i ? ((E = je.current) == null || E.cancel(), (H = x.current) == null || H.call(x, { enableFacets: z })) : z ? (M && console.log("Search fired"), (B = x.current) == null || B.call(x, { enableFacets: !1 }), (K = je.current) == null || K.call(je)) : (se = x.current) == null || se.call(x, { enableFacets: !1 }), () => {
|
|
640
|
+
var Q;
|
|
641
|
+
(Q = je.current) == null || Q.cancel();
|
|
652
642
|
};
|
|
653
|
-
}, [
|
|
654
|
-
var
|
|
655
|
-
|
|
643
|
+
}, [h.query, p, z]), ie(() => {
|
|
644
|
+
var E;
|
|
645
|
+
const l = W.current;
|
|
646
|
+
if (W.current = !1, !_.current || !d) return;
|
|
656
647
|
if (!g.current) {
|
|
657
|
-
g.current = !0
|
|
648
|
+
g.current = !0;
|
|
658
649
|
return;
|
|
659
650
|
}
|
|
660
|
-
if (
|
|
661
|
-
k && console.log("[Filter effect] Skipping because query changed");
|
|
651
|
+
if (!l)
|
|
662
652
|
return;
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
D && !(!v && i === "") && ((C = p.current) == null || C.call(p, { enableFacets: !0 }));
|
|
653
|
+
const i = h.query.trim();
|
|
654
|
+
z && !(!p && i === "") && ((E = x.current) == null || E.call(x, { enableFacets: !0 }));
|
|
655
|
+
}, [h.filters, h.rangeFilters]), ie(() => {
|
|
656
|
+
var j;
|
|
657
|
+
if (!_.current || !d) return;
|
|
658
|
+
const l = h.query.trim();
|
|
659
|
+
z && !(!p && l === "") && ((j = x.current) == null || j.call(x, { enableFacets: !0 }));
|
|
671
660
|
}, [$e, Ie]), ie(() => {
|
|
672
|
-
var
|
|
673
|
-
!
|
|
674
|
-
}, [Ue,
|
|
661
|
+
var l;
|
|
662
|
+
!_.current || !d || v.current && (v.current = !1, (l = x.current) == null || l.call(x, { enableFacets: !1 }));
|
|
663
|
+
}, [Ue, d]), ie(() => {
|
|
675
664
|
(async () => {
|
|
676
665
|
try {
|
|
677
|
-
let
|
|
666
|
+
let i;
|
|
678
667
|
if (ne)
|
|
679
|
-
|
|
668
|
+
M && console.log("[Auth] ✅ Using pre-authenticated token"), i = ne;
|
|
680
669
|
else {
|
|
681
|
-
if (!o || !
|
|
682
|
-
throw console.error("[Auth] ❌ Missing credentials"), o || (console.error("[Auth] ❌ Missing email"), console.error('[Auth] 💡 Pass email="your@email.com" to SearchProvider')),
|
|
670
|
+
if (!o || !u)
|
|
671
|
+
throw console.error("[Auth] ❌ Missing credentials"), o || (console.error("[Auth] ❌ Missing email"), console.error('[Auth] 💡 Pass email="your@email.com" to SearchProvider')), u || (console.error("[Auth] ❌ Missing password"), console.error('[Auth] 💡 Pass password="yourpassword" to SearchProvider')), new Error("Email and password are required. Check console for instructions.");
|
|
683
672
|
if (!s)
|
|
684
673
|
throw console.error("[Auth] ❌ Missing INDX server URL"), console.error("[Auth] 💡 Add NEXT_PUBLIC_INDX_URL to your .env.local file"), new Error("INDX server URL is required. Check console for instructions.");
|
|
685
|
-
if (!
|
|
674
|
+
if (!c)
|
|
686
675
|
throw console.error("[Auth] ❌ Missing dataset name"), console.error('[Auth] 💡 Pass dataset="your-dataset-name" to SearchProvider'), new Error("Dataset name is required. Check console for instructions.");
|
|
687
|
-
|
|
676
|
+
M && console.log("[Auth] 🔐 Logging in to get session token...");
|
|
688
677
|
const N = await fetch(`${s}/api/Login`, {
|
|
689
678
|
method: "POST",
|
|
690
679
|
headers: {
|
|
@@ -694,311 +683,311 @@ const Qt = ({
|
|
|
694
683
|
credentials: "include",
|
|
695
684
|
body: JSON.stringify({
|
|
696
685
|
userEmail: o,
|
|
697
|
-
userPassWord:
|
|
686
|
+
userPassWord: u
|
|
698
687
|
})
|
|
699
688
|
});
|
|
700
689
|
if (!N.ok)
|
|
701
690
|
throw console.error("[Auth] ❌ Login failed:", N.status, await N.text()), new Error("Login failed. Check your email and password.");
|
|
702
|
-
if (
|
|
691
|
+
if (i = (await N.json()).token, !i)
|
|
703
692
|
throw console.error("[Auth] ❌ No token received from login response"), new Error("No token received from login.");
|
|
704
|
-
|
|
693
|
+
M && console.log("[Auth] ✅ Login successful, bearer token received (length:", i.length, ")");
|
|
705
694
|
}
|
|
706
|
-
|
|
707
|
-
const
|
|
695
|
+
M && console.log("[Auth] 🔓 Opening dataset session...");
|
|
696
|
+
const j = await fetch(`${s}/api/CreateOrOpen/${c}/400`, {
|
|
708
697
|
method: "PUT",
|
|
709
698
|
headers: {
|
|
710
699
|
"Content-Type": "application/json",
|
|
711
|
-
Authorization: `Bearer ${
|
|
700
|
+
Authorization: `Bearer ${i}`
|
|
712
701
|
},
|
|
713
702
|
body: '""'
|
|
714
703
|
});
|
|
715
|
-
if (!
|
|
716
|
-
throw console.error("[Auth] ❌ CreateOrOpen failed:",
|
|
717
|
-
|
|
718
|
-
const
|
|
704
|
+
if (!j.ok)
|
|
705
|
+
throw console.error("[Auth] ❌ CreateOrOpen failed:", j.status, await j.text()), new Error("Failed to open dataset session.");
|
|
706
|
+
X(i), M && console.log("[Auth] ✅ Dataset session established");
|
|
707
|
+
const E = (N) => fetch(N, {
|
|
719
708
|
method: "GET",
|
|
720
709
|
headers: {
|
|
721
710
|
accept: "text/plain",
|
|
722
|
-
Authorization: `Bearer ${
|
|
711
|
+
Authorization: `Bearer ${i}`
|
|
723
712
|
},
|
|
724
713
|
credentials: "include"
|
|
725
714
|
});
|
|
726
|
-
|
|
727
|
-
const
|
|
728
|
-
if (!
|
|
729
|
-
if (
|
|
715
|
+
M && console.log("[Auth] 🔍 Checking dataset status...");
|
|
716
|
+
const H = await E(`${s}/api/GetStatus/${c}`);
|
|
717
|
+
if (!H.ok) {
|
|
718
|
+
if (H.status === 401)
|
|
730
719
|
throw console.error("[Auth] ❌ Authentication failed (401 Unauthorized)"), console.error("[Auth] 💡 Your token may be expired or invalid"), console.error('[Auth] 💡 Get a fresh token with: curl -X POST "' + s + `/api/Login" -H "Content-Type: application/json" -d '{"userEmail":"your@email.com","userPassWord":"yourpassword"}'`), new Error("Authentication failed (401). Token may be expired. Check console for instructions.");
|
|
731
|
-
if (
|
|
732
|
-
throw console.error('[Auth] ❌ Dataset "' +
|
|
720
|
+
if (H.status === 404)
|
|
721
|
+
throw console.error('[Auth] ❌ Dataset "' + c + '" not found (404)'), console.error('[Auth] 💡 Available datasets can be checked with: curl -X GET "' + s + '/api/GetUserDataSets" -H "Authorization: Bearer YOUR_TOKEN"'), console.error("[Auth] 💡 Make sure you spelled the dataset name correctly"), new Error('Dataset "' + c + '" not found. Check console for instructions.');
|
|
733
722
|
{
|
|
734
|
-
const N = await
|
|
735
|
-
throw console.error("[Auth] ❌ Failed to get dataset status:",
|
|
723
|
+
const N = await H.text();
|
|
724
|
+
throw console.error("[Auth] ❌ Failed to get dataset status:", H.status, N), console.error("[Auth] 💡 Check if your INDX server is running at:", s), new Error("Failed to connect to INDX server. Check console for details.");
|
|
736
725
|
}
|
|
737
726
|
}
|
|
738
|
-
const
|
|
739
|
-
|
|
740
|
-
const
|
|
741
|
-
|
|
742
|
-
const [
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
727
|
+
const B = await H.json();
|
|
728
|
+
M && console.log("[Auth] 📊 Dataset status:", B), B.systemState !== void 0 && B.systemState !== Le.Ready && (console.warn("[Auth] ⚠️ Dataset is not ready yet. Current state:", Le[B.systemState]), console.warn("[Auth] 💡 Wait for indexing to complete before searching"));
|
|
729
|
+
const K = B.documentCount ?? B.numberOfRecords ?? 0;
|
|
730
|
+
K === 0 ? (console.warn('[Auth] ⚠️ Dataset "' + c + '" is empty (0 records)'), console.warn("[Auth] 💡 Add documents to your dataset before searching"), console.warn("[Auth] 💡 Search will work but return no results")) : M && console.log("[Auth] ✅ Dataset has", K, "records");
|
|
731
|
+
const [se, Q, Se] = await Promise.all([
|
|
732
|
+
E(`${s}/api/GetFilterableFields/${c}`),
|
|
733
|
+
E(`${s}/api/GetFacetableFields/${c}`),
|
|
734
|
+
E(`${s}/api/GetSortableFields/${c}`)
|
|
746
735
|
]);
|
|
747
|
-
if (!
|
|
748
|
-
throw console.error("[Auth] ❌ GetFilterableFields failed:",
|
|
749
|
-
if (!
|
|
750
|
-
throw console.error("[Auth] ❌ GetFacetableFields failed:",
|
|
751
|
-
if (!
|
|
752
|
-
throw console.error("[Auth] ❌ GetSortableFields failed:",
|
|
753
|
-
const
|
|
754
|
-
|
|
736
|
+
if (!se.ok)
|
|
737
|
+
throw console.error("[Auth] ❌ GetFilterableFields failed:", se.status, await se.text()), new Error("Failed to get filterable fields. Check console for details.");
|
|
738
|
+
if (!Q.ok)
|
|
739
|
+
throw console.error("[Auth] ❌ GetFacetableFields failed:", Q.status, await Q.text()), new Error("Failed to get facetable fields. Check console for details.");
|
|
740
|
+
if (!Se.ok)
|
|
741
|
+
throw console.error("[Auth] ❌ GetSortableFields failed:", Se.status, await Se.text()), new Error("Failed to get sortable fields. Check console for details.");
|
|
742
|
+
const De = await se.json().catch((N) => (console.error("Failed to parse GetFilterableFields response:", N), [])), tt = await Q.json().catch((N) => (console.error("Failed to parse GetFacetableFields response:", N), [])), Re = await Se.json().catch((N) => (console.error("Failed to parse GetSortableFields response:", N), []));
|
|
743
|
+
O(De || []), P(tt || []), U(Re || []);
|
|
755
744
|
let Ce = { facets: {} };
|
|
756
745
|
try {
|
|
757
|
-
const N = await fetch(`${s}/api/Search/${
|
|
746
|
+
const N = await fetch(`${s}/api/Search/${c}`, {
|
|
758
747
|
method: "POST",
|
|
759
748
|
headers: {
|
|
760
749
|
"Content-Type": "application/json",
|
|
761
|
-
Authorization: `Bearer ${
|
|
750
|
+
Authorization: `Bearer ${i}`
|
|
762
751
|
},
|
|
763
752
|
credentials: "include",
|
|
764
753
|
body: JSON.stringify({ text: "", maxNumberOfRecordsToReturn: 0, enableFacets: !0 })
|
|
765
754
|
});
|
|
766
|
-
N.ok ? Ce = await N.json().catch((
|
|
755
|
+
N.ok ? Ce = await N.json().catch((oe) => (console.warn("Failed to parse blank search response:", oe), { facets: {} })) : (console.warn("Blank search failed:", N.status, N.statusText), console.warn("Continuing without initial facet data - facets will be populated after first search"));
|
|
767
756
|
} catch (N) {
|
|
768
757
|
console.warn("Blank search error:", N), console.warn("Continuing without initial facet data - facets will be populated after first search");
|
|
769
758
|
}
|
|
770
759
|
const we = {};
|
|
771
760
|
if (Ce.facets) {
|
|
772
|
-
for (const [N,
|
|
773
|
-
if (Array.isArray(
|
|
774
|
-
const
|
|
775
|
-
|
|
776
|
-
min: Math.min(...
|
|
777
|
-
max: Math.max(...
|
|
761
|
+
for (const [N, oe] of Object.entries(Ce.facets))
|
|
762
|
+
if (Array.isArray(oe) && oe.length > 0) {
|
|
763
|
+
const me = oe.map((Ve) => Number(Ve.key)).filter((Ve) => !isNaN(Ve));
|
|
764
|
+
me.length > 0 && (we[N] = {
|
|
765
|
+
min: Math.min(...me),
|
|
766
|
+
max: Math.max(...me)
|
|
778
767
|
});
|
|
779
768
|
}
|
|
780
769
|
}
|
|
781
|
-
const
|
|
770
|
+
const Me = {};
|
|
782
771
|
if (Ce.facets)
|
|
783
|
-
for (const [N,
|
|
784
|
-
Array.isArray(
|
|
785
|
-
|
|
772
|
+
for (const [N, oe] of Object.entries(Ce.facets))
|
|
773
|
+
Array.isArray(oe) && (Me[N] = oe.map((me) => me.key));
|
|
774
|
+
$.current = {
|
|
786
775
|
facets: Ce.facets,
|
|
787
776
|
facetStats: we,
|
|
788
|
-
facetKeys:
|
|
789
|
-
},
|
|
777
|
+
facetKeys: Me
|
|
778
|
+
}, R(we), a(Me), ke(we), b((N) => ({
|
|
790
779
|
...N,
|
|
791
780
|
facetStats: we,
|
|
792
|
-
totalDocumentCount:
|
|
793
|
-
})),
|
|
794
|
-
} catch (
|
|
795
|
-
throw console.error("[Auth] ❌ Initialization failed:",
|
|
781
|
+
totalDocumentCount: K
|
|
782
|
+
})), M && console.log("[Auth] ✅ Initialization complete");
|
|
783
|
+
} catch (i) {
|
|
784
|
+
throw console.error("[Auth] ❌ Initialization failed:", i), (i instanceof Error || typeof i == "object" && i !== null && "message" in i) && console.error("[Auth] 💡 Error:", i.message), i instanceof TypeError && i.message.includes("fetch") && (console.error("[Auth] ❌ Network error - cannot connect to INDX server"), console.error("[Auth] 💡 Check if the server is running at:", s), console.error("[Auth] 💡 Check your NEXT_PUBLIC_INDX_URL in .env.local"), console.error("[Auth] 💡 For local development, it should be: http://localhost:5001")), i;
|
|
796
785
|
} finally {
|
|
797
|
-
|
|
786
|
+
fe(!1);
|
|
798
787
|
}
|
|
799
788
|
})();
|
|
800
|
-
}, [o,
|
|
801
|
-
|
|
789
|
+
}, [o, u, s, c]), /* @__PURE__ */ t.jsx(
|
|
790
|
+
dt.Provider,
|
|
802
791
|
{
|
|
803
792
|
value: {
|
|
804
793
|
state: {
|
|
805
|
-
...
|
|
806
|
-
filterableFields:
|
|
807
|
-
facetableFields:
|
|
808
|
-
sortableFields:
|
|
809
|
-
rangeBounds:
|
|
794
|
+
...h,
|
|
795
|
+
filterableFields: Z,
|
|
796
|
+
facetableFields: pe,
|
|
797
|
+
sortableFields: w,
|
|
798
|
+
rangeBounds: ve
|
|
810
799
|
},
|
|
811
|
-
isFetchingInitial:
|
|
812
|
-
allowEmptySearch:
|
|
813
|
-
setQuery:
|
|
814
|
-
toggleFilter:
|
|
815
|
-
setRangeFilter:
|
|
800
|
+
isFetchingInitial: ce,
|
|
801
|
+
allowEmptySearch: p,
|
|
802
|
+
setQuery: I,
|
|
803
|
+
toggleFilter: Ae,
|
|
804
|
+
setRangeFilter: qe,
|
|
816
805
|
resetFilters: ze,
|
|
817
|
-
resetSingleFilter:
|
|
818
|
-
setSort:
|
|
819
|
-
setDebounceDelay:
|
|
820
|
-
setSearchSettings:
|
|
806
|
+
resetSingleFilter: ft,
|
|
807
|
+
setSort: mt,
|
|
808
|
+
setDebounceDelay: J,
|
|
809
|
+
setSearchSettings: _e,
|
|
821
810
|
fetchMoreResults: Te
|
|
822
811
|
},
|
|
823
812
|
children: r
|
|
824
813
|
}
|
|
825
814
|
);
|
|
826
|
-
},
|
|
827
|
-
const r =
|
|
815
|
+
}, Ne = () => {
|
|
816
|
+
const r = yt(dt);
|
|
828
817
|
if (!r)
|
|
829
818
|
throw new Error("useSearchContext must be used within a SearchProvider");
|
|
830
819
|
return r;
|
|
831
|
-
},
|
|
820
|
+
}, er = ({
|
|
832
821
|
className: r = "",
|
|
833
822
|
autoFocus: o = !1,
|
|
834
|
-
inputSize:
|
|
823
|
+
inputSize: u = "default",
|
|
835
824
|
showClear: s = !0,
|
|
836
|
-
showFocus:
|
|
837
|
-
...
|
|
825
|
+
showFocus: c = !1,
|
|
826
|
+
...p
|
|
838
827
|
}) => {
|
|
839
|
-
const { state: { query: S, filters:
|
|
840
|
-
Object.keys(
|
|
841
|
-
const
|
|
828
|
+
const { state: { query: S, filters: m, rangeFilters: n, searchSettings: C }, setQuery: A } = Ne();
|
|
829
|
+
Object.keys(m).length > 0 || Object.keys(n).length > 0;
|
|
830
|
+
const k = S.length > 0;
|
|
842
831
|
return /* @__PURE__ */ t.jsx(
|
|
843
|
-
|
|
832
|
+
St,
|
|
844
833
|
{
|
|
845
834
|
type: "text",
|
|
846
835
|
value: S,
|
|
847
|
-
onChange: (
|
|
848
|
-
placeholder:
|
|
836
|
+
onChange: (q) => A(q.target.value),
|
|
837
|
+
placeholder: C.placeholderText,
|
|
849
838
|
autoFocus: o,
|
|
850
839
|
className: r,
|
|
851
840
|
showSearchIcon: !0,
|
|
852
|
-
inputSize:
|
|
853
|
-
showFocusBorder:
|
|
854
|
-
...
|
|
855
|
-
children: s &&
|
|
841
|
+
inputSize: u,
|
|
842
|
+
showFocusBorder: c,
|
|
843
|
+
...p,
|
|
844
|
+
children: s && k && /* @__PURE__ */ t.jsx(
|
|
856
845
|
ye,
|
|
857
846
|
{
|
|
858
847
|
variant: "ghost",
|
|
859
848
|
size: "micro",
|
|
860
|
-
onClick: () =>
|
|
849
|
+
onClick: () => A(""),
|
|
861
850
|
"aria-label": "Clear search",
|
|
862
851
|
children: "Clear"
|
|
863
852
|
}
|
|
864
853
|
)
|
|
865
854
|
}
|
|
866
855
|
);
|
|
867
|
-
},
|
|
868
|
-
placeholder:
|
|
869
|
-
invalid:
|
|
870
|
-
row:
|
|
871
|
-
indexNumber:
|
|
872
|
-
scoreNumber:
|
|
873
|
-
},
|
|
874
|
-
const
|
|
875
|
-
return t.jsx("svg", { width: s, height:
|
|
876
|
-
},
|
|
877
|
-
const
|
|
878
|
-
return t.jsx("svg", { width: s, height:
|
|
879
|
-
},
|
|
880
|
-
const
|
|
881
|
-
return t.jsx("svg", { width: s, height:
|
|
882
|
-
},
|
|
883
|
-
const
|
|
884
|
-
return t.jsx("svg", { width: s, height:
|
|
885
|
-
},
|
|
856
|
+
}, Et = "_placeholder_1k92x_1", Nt = "_invalid_1k92x_10", _t = "_row_1k92x_14", Tt = "_indexNumber_1k92x_38", At = "_scoreNumber_1k92x_45", Fe = {
|
|
857
|
+
placeholder: Et,
|
|
858
|
+
invalid: Nt,
|
|
859
|
+
row: _t,
|
|
860
|
+
indexNumber: Tt,
|
|
861
|
+
scoreNumber: At
|
|
862
|
+
}, Vt = ({ color: r = "black", size: o = 21 }) => {
|
|
863
|
+
const u = 0.7142857142857143, s = o, c = typeof o == "number" ? o * u : `calc(${o} * 0.7142857142857143)`;
|
|
864
|
+
return t.jsx("svg", { width: s, height: c, viewBox: "0 0 7 5", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: t.jsx("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M4 0H3V1V2V3H2V2H1V3H2V4H3V5H4V4H5V3H6V2H5V3H4V2V1V0ZM4 3V4H3V3H4Z", fill: r }) });
|
|
865
|
+
}, Ot = ({ color: r = "black", size: o = 21 }) => {
|
|
866
|
+
const u = 0.7142857142857143, s = o, c = typeof o == "number" ? o * u : `calc(${o} * 0.7142857142857143)`;
|
|
867
|
+
return t.jsx("svg", { width: s, height: c, viewBox: "0 0 7 5", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: t.jsx("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M5 0H4V1H5V2H4H3H2H1V3H2H3H4H5V4H4V5H5V4H6V3H7V2H6V1H5V0ZM6 2H5V3H6V2Z", fill: r }) });
|
|
868
|
+
}, Pt = ({ color: r = "black", size: o = 21 }) => {
|
|
869
|
+
const u = 0.7142857142857143, s = o, c = typeof o == "number" ? o * u : `calc(${o} * 0.7142857142857143)`;
|
|
870
|
+
return t.jsx("svg", { width: s, height: c, viewBox: "0 0 7 5", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: t.jsx("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M5 0H6V1H5V0ZM6 1H7V2H6V1ZM0 1H1V2H0V1ZM1 1V0H2V1H1ZM6 3H7V4H6V3ZM6 4V5H5V4H6ZM1 4H2V5H1V4ZM1 4H0V3H1V4ZM2 2H5V3H2V2Z", fill: r }) });
|
|
871
|
+
}, ht = ({ color: r = "black", size: o = 21 }) => {
|
|
872
|
+
const u = 0.7142857142857143, s = o, c = typeof o == "number" ? o * u : `calc(${o} * 0.7142857142857143)`;
|
|
873
|
+
return t.jsx("svg", { width: s, height: c, viewBox: "0 0 7 5", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: t.jsx("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M1 0H2V1H1V0ZM3 2H2V1H3V2ZM4 2H3V3H2V4H1V5H2V4H3V3H4V4H5V5H6V4H5V3H4V2ZM5 1V2H4V1H5ZM5 1V0H6V1H5Z", fill: r }) });
|
|
874
|
+
}, tr = ({ fields: r, resultsPerPage: o, children: u }) => {
|
|
886
875
|
const {
|
|
887
|
-
state: { results: s, resultsSuppressed:
|
|
876
|
+
state: { results: s, resultsSuppressed: c, searchSettings: p, truncationIndex: S, query: m },
|
|
888
877
|
isFetchingInitial: n,
|
|
889
|
-
fetchMoreResults:
|
|
890
|
-
} =
|
|
878
|
+
fetchMoreResults: C
|
|
879
|
+
} = Ne(), A = o ?? 30, [k, q] = G(A), M = he(0), ne = he("");
|
|
891
880
|
ie(() => {
|
|
892
|
-
const
|
|
893
|
-
(!s || s.length <
|
|
894
|
-
}, [s,
|
|
895
|
-
const
|
|
896
|
-
const
|
|
897
|
-
|
|
881
|
+
const _ = m !== ne.current;
|
|
882
|
+
(!s || s.length < M.current || _) && q(A), M.current = (s == null ? void 0 : s.length) ?? 0, ne.current = m;
|
|
883
|
+
}, [s, A, m]);
|
|
884
|
+
const L = s && s.length > k, x = () => {
|
|
885
|
+
const _ = k + A;
|
|
886
|
+
q(_), s && _ >= s.length && (!S || S === -1 || S > s.length) && C(s.length + A);
|
|
898
887
|
};
|
|
899
|
-
return n ||
|
|
900
|
-
/* @__PURE__ */ t.jsx("div", { className:
|
|
901
|
-
const
|
|
902
|
-
let
|
|
888
|
+
return n || c || s === null ? /* @__PURE__ */ t.jsx("div", { className: Fe.placeholder, children: /* @__PURE__ */ t.jsx(Pt, { size: 200, color: "var(--lv5)" }) }) : s.length === 0 ? /* @__PURE__ */ t.jsx("div", { className: Fe.invalid, children: /* @__PURE__ */ t.jsx("p", { children: "No results found." }) }) : /* @__PURE__ */ t.jsxs(t.Fragment, { children: [
|
|
889
|
+
/* @__PURE__ */ t.jsx("div", { className: Fe.container, children: (s ?? []).slice(0, k).map((_, g) => {
|
|
890
|
+
const v = _.document, W = _.score;
|
|
891
|
+
let h;
|
|
903
892
|
try {
|
|
904
|
-
|
|
893
|
+
h = typeof v == "string" ? JSON.parse(v) : v;
|
|
905
894
|
} catch {
|
|
906
|
-
return /* @__PURE__ */ t.jsx("div", { className:
|
|
895
|
+
return /* @__PURE__ */ t.jsx("div", { className: Fe.invalid, children: /* @__PURE__ */ t.jsx("p", { children: "Invalid JSON" }) }, g);
|
|
907
896
|
}
|
|
908
|
-
let
|
|
897
|
+
let b;
|
|
909
898
|
if (r && r.length > 0) {
|
|
910
|
-
|
|
911
|
-
for (const
|
|
912
|
-
|
|
899
|
+
b = {};
|
|
900
|
+
for (const d of r)
|
|
901
|
+
d in h && (b[d] = h[d]);
|
|
913
902
|
} else
|
|
914
|
-
|
|
915
|
-
for (const
|
|
916
|
-
const
|
|
917
|
-
if (typeof
|
|
918
|
-
const
|
|
919
|
-
|
|
903
|
+
b = { ...h };
|
|
904
|
+
for (const d in b) {
|
|
905
|
+
const X = b[d];
|
|
906
|
+
if (typeof X == "string" && X.startsWith("[") && X.endsWith("]")) {
|
|
907
|
+
const V = X.replace(/^\[|\]$/g, "").split(",").map((Z) => Z.trim().replace(/^'|'$/g, "")).filter((Z) => Z.length > 0);
|
|
908
|
+
b[d] = V;
|
|
920
909
|
}
|
|
921
910
|
}
|
|
922
|
-
return /* @__PURE__ */ t.jsxs("div", { className:
|
|
923
|
-
/* @__PURE__ */ t.jsx("div", { className:
|
|
924
|
-
|
|
925
|
-
|
|
911
|
+
return /* @__PURE__ */ t.jsxs("div", { className: Fe.row, children: [
|
|
912
|
+
/* @__PURE__ */ t.jsx("div", { className: Fe.indexNumber, children: g }),
|
|
913
|
+
u(b),
|
|
914
|
+
p.showScore && /* @__PURE__ */ t.jsx("div", { className: Fe.scoreNumber, children: W })
|
|
926
915
|
] }, g);
|
|
927
916
|
}) }),
|
|
928
|
-
|
|
917
|
+
L && /* @__PURE__ */ t.jsx("div", { style: { textAlign: "center", marginTop: "20px" }, children: /* @__PURE__ */ t.jsx(
|
|
929
918
|
ye,
|
|
930
919
|
{
|
|
931
920
|
variant: "secondary",
|
|
932
921
|
size: "micro",
|
|
933
|
-
onClick:
|
|
934
|
-
children:
|
|
922
|
+
onClick: x,
|
|
923
|
+
children: m.trim() === "" ? "Load more" : S !== -1 && S !== void 0 && S > 0 ? `Load results ${k + 1}-${Math.min(k + A, s.length, S)} of ${S}` : "Load more"
|
|
935
924
|
}
|
|
936
925
|
) })
|
|
937
926
|
] });
|
|
938
|
-
},
|
|
939
|
-
list:
|
|
940
|
-
count:
|
|
941
|
-
grid:
|
|
942
|
-
},
|
|
927
|
+
}, Ht = "_list_mwzqq_2", $t = "_count_mwzqq_7", It = "_grid_mwzqq_16", Ee = {
|
|
928
|
+
list: Ht,
|
|
929
|
+
count: $t,
|
|
930
|
+
grid: It
|
|
931
|
+
}, rr = ({
|
|
943
932
|
field: r,
|
|
944
933
|
label: o,
|
|
945
|
-
preserveBlankFacetState:
|
|
934
|
+
preserveBlankFacetState: u = !1,
|
|
946
935
|
preserveBlankFacetStateOrder: s = !1,
|
|
947
|
-
sortFacetsBy:
|
|
948
|
-
limit:
|
|
936
|
+
sortFacetsBy: c = "histogram",
|
|
937
|
+
limit: p = 10,
|
|
949
938
|
collapsible: S = !0,
|
|
950
|
-
startCollapsed:
|
|
939
|
+
startCollapsed: m = !1,
|
|
951
940
|
displayType: n = "checkbox",
|
|
952
|
-
layout:
|
|
953
|
-
showActivePanel:
|
|
954
|
-
showCount:
|
|
955
|
-
showNull:
|
|
956
|
-
displayIfEmptyQuery:
|
|
957
|
-
displayCondition: ne = (
|
|
941
|
+
layout: C = "list",
|
|
942
|
+
showActivePanel: A = !1,
|
|
943
|
+
showCount: k = !0,
|
|
944
|
+
showNull: q = !1,
|
|
945
|
+
displayIfEmptyQuery: M = !0,
|
|
946
|
+
displayCondition: ne = (L) => !0
|
|
958
947
|
}) => {
|
|
959
948
|
const {
|
|
960
|
-
state: { facets:
|
|
961
|
-
toggleFilter:
|
|
962
|
-
isFetchingInitial:
|
|
963
|
-
allowEmptySearch:
|
|
964
|
-
} =
|
|
949
|
+
state: { facets: L, filterableFields: x, facetableFields: _, filters: g, query: v },
|
|
950
|
+
toggleFilter: W,
|
|
951
|
+
isFetchingInitial: h,
|
|
952
|
+
allowEmptySearch: b
|
|
953
|
+
} = Ne(), d = he(null), [X, z] = G(p);
|
|
965
954
|
if (ie(() => {
|
|
966
|
-
|
|
967
|
-
}, [
|
|
955
|
+
z(p);
|
|
956
|
+
}, [L == null ? void 0 : L[r], p]), !b && !v || h || !L || !ne({ query: v ?? "", filters: g, facets: L }) || !M && !v && Object.keys(g).length < 1)
|
|
968
957
|
return null;
|
|
969
|
-
if (!(
|
|
970
|
-
const
|
|
971
|
-
return
|
|
958
|
+
if (!(x != null && x.includes(r)) || !(_ != null && _.includes(r))) {
|
|
959
|
+
const f = [];
|
|
960
|
+
return x != null && x.includes(r) || f.push("filterable"), _ != null && _.includes(r) || f.push("facetable"), /* @__PURE__ */ t.jsx(be, { collapsible: !1, children: /* @__PURE__ */ t.jsxs("div", { style: { color: "red", fontSize: "12px" }, children: [
|
|
972
961
|
'Cannot render filter for "',
|
|
973
962
|
r,
|
|
974
963
|
'": missing ',
|
|
975
|
-
|
|
964
|
+
f.join(" and "),
|
|
976
965
|
"."
|
|
977
966
|
] }) });
|
|
978
967
|
}
|
|
979
|
-
const
|
|
980
|
-
if (!
|
|
968
|
+
const V = L == null ? void 0 : L[r];
|
|
969
|
+
if (!V || !Array.isArray(V)) return null;
|
|
981
970
|
const Z = (g == null ? void 0 : g[r]) ?? [];
|
|
982
|
-
|
|
983
|
-
(
|
|
971
|
+
u && !d.current && V.length > 0 && (d.current = V.reduce(
|
|
972
|
+
(f, R) => (f[R.key] = R.value, f),
|
|
984
973
|
{}
|
|
985
974
|
));
|
|
986
975
|
const O = /* @__PURE__ */ new Map();
|
|
987
|
-
|
|
988
|
-
O.set(
|
|
989
|
-
}),
|
|
990
|
-
O.set(
|
|
991
|
-
})) :
|
|
992
|
-
O.set(
|
|
976
|
+
u && d.current ? (Object.keys(d.current).forEach((f) => {
|
|
977
|
+
O.set(f, 0);
|
|
978
|
+
}), V.forEach((f) => {
|
|
979
|
+
O.set(f.key, f.value);
|
|
980
|
+
})) : V.forEach((f) => {
|
|
981
|
+
O.set(f.key, f.value);
|
|
993
982
|
});
|
|
994
983
|
const pe = n === "toggle" && O.size === 2 && O.has("true") && (O.has("false") || O.has("null"));
|
|
995
984
|
if (O.has("null")) {
|
|
996
|
-
const
|
|
997
|
-
O.set("false", (
|
|
985
|
+
const f = O.get("null") ?? 0, R = O.get("false") ?? 0;
|
|
986
|
+
O.set("false", (R ?? 0) + f), O.delete("null");
|
|
998
987
|
}
|
|
999
988
|
if (n === "toggle" && !pe)
|
|
1000
|
-
return /* @__PURE__ */ t.jsx(
|
|
1001
|
-
|
|
989
|
+
return /* @__PURE__ */ t.jsx(be, { collapsible: !1, children: /* @__PURE__ */ t.jsx("div", { className: Ee.count, children: /* @__PURE__ */ t.jsx(
|
|
990
|
+
re,
|
|
1002
991
|
{
|
|
1003
992
|
label: o,
|
|
1004
993
|
checked: !1,
|
|
@@ -1008,50 +997,50 @@ const Qt = ({
|
|
|
1008
997
|
}
|
|
1009
998
|
) }) });
|
|
1010
999
|
if (pe) {
|
|
1011
|
-
const
|
|
1012
|
-
return /* @__PURE__ */ t.jsx(
|
|
1000
|
+
const f = O.get("true"), R = typeof f == "number" ? f : null, e = Z.includes("true"), a = R === 0, y = k && (R ?? 0) > 0 ? `${R}` : "";
|
|
1001
|
+
return /* @__PURE__ */ t.jsx(be, { collapsible: !1, children: /* @__PURE__ */ t.jsxs("div", { className: Ee.count, children: [
|
|
1013
1002
|
/* @__PURE__ */ t.jsx(
|
|
1014
|
-
|
|
1003
|
+
re,
|
|
1015
1004
|
{
|
|
1016
1005
|
label: o,
|
|
1017
1006
|
checked: e,
|
|
1018
|
-
onChange: () =>
|
|
1007
|
+
onChange: () => W(r, "true"),
|
|
1019
1008
|
disabled: a
|
|
1020
1009
|
}
|
|
1021
1010
|
),
|
|
1022
1011
|
" ",
|
|
1023
|
-
|
|
1012
|
+
y
|
|
1024
1013
|
] }) });
|
|
1025
1014
|
}
|
|
1026
1015
|
let P = Array.from(O.entries());
|
|
1027
|
-
if (
|
|
1016
|
+
if (q || (P = P.filter(([f]) => f !== "null")), P.length === 0 && !u)
|
|
1028
1017
|
return null;
|
|
1029
|
-
if (!s) if (
|
|
1030
|
-
const
|
|
1031
|
-
P = [...
|
|
1032
|
-
} else if (
|
|
1033
|
-
const
|
|
1034
|
-
const F = Number(a),
|
|
1035
|
-
return xe &&
|
|
1036
|
-
},
|
|
1037
|
-
P = [...
|
|
1018
|
+
if (!s) if (c === "alphabetical") {
|
|
1019
|
+
const f = P.filter(([, e]) => typeof e == "number" && e > 0).sort(([e], [a]) => e.localeCompare(a)), R = P.filter(([, e]) => e === 0 || e === null).sort(([e], [a]) => e.localeCompare(a));
|
|
1020
|
+
P = [...f, ...R];
|
|
1021
|
+
} else if (c === "numeric") {
|
|
1022
|
+
const f = (a, y) => {
|
|
1023
|
+
const F = Number(a), ue = Number(y), xe = !isNaN(F), T = !isNaN(ue);
|
|
1024
|
+
return xe && T ? F - ue : a.localeCompare(y);
|
|
1025
|
+
}, R = P.filter(([, a]) => typeof a == "number" && a > 0).sort(([a], [y]) => f(a, y)), e = P.filter(([, a]) => a === 0 || a === null).sort(([a], [y]) => f(a, y));
|
|
1026
|
+
P = [...R, ...e];
|
|
1038
1027
|
} else {
|
|
1039
|
-
const
|
|
1040
|
-
P = [...
|
|
1028
|
+
const f = P.filter(([, e]) => typeof e == "number" && e > 0), R = P.filter(([, e]) => e === 0 || e === null);
|
|
1029
|
+
P = [...f, ...R];
|
|
1041
1030
|
}
|
|
1042
|
-
const
|
|
1043
|
-
const e = Z.includes(
|
|
1031
|
+
const w = typeof p == "number" && P.length > p, U = w ? P.slice(0, X) : P, ce = (f, R) => {
|
|
1032
|
+
const e = Z.includes(f), a = R === 0, y = k && (R ?? 0) > 0 ? ` (${R})` : "", F = k && (R ?? 0) > 0 ? R : "";
|
|
1044
1033
|
switch (n) {
|
|
1045
1034
|
case "button":
|
|
1046
|
-
return
|
|
1035
|
+
return C === "list" ? /* @__PURE__ */ t.jsxs("div", { className: Ee.count, children: [
|
|
1047
1036
|
/* @__PURE__ */ t.jsx(
|
|
1048
1037
|
ye,
|
|
1049
1038
|
{
|
|
1050
1039
|
variant: e ? "primary" : "secondary",
|
|
1051
|
-
onClick: () =>
|
|
1040
|
+
onClick: () => W(r, f),
|
|
1052
1041
|
disabled: a,
|
|
1053
1042
|
size: "micro",
|
|
1054
|
-
children:
|
|
1043
|
+
children: f
|
|
1055
1044
|
}
|
|
1056
1045
|
),
|
|
1057
1046
|
/* @__PURE__ */ t.jsx("span", { children: F })
|
|
@@ -1059,70 +1048,70 @@ const Qt = ({
|
|
|
1059
1048
|
ye,
|
|
1060
1049
|
{
|
|
1061
1050
|
variant: e ? "primary" : "secondary",
|
|
1062
|
-
onClick: () =>
|
|
1051
|
+
onClick: () => W(r, f),
|
|
1063
1052
|
disabled: a,
|
|
1064
1053
|
size: "micro",
|
|
1065
|
-
children: `${
|
|
1054
|
+
children: `${f}${y}`
|
|
1066
1055
|
}
|
|
1067
1056
|
);
|
|
1068
1057
|
case "toggle":
|
|
1069
1058
|
return /* @__PURE__ */ t.jsx(
|
|
1070
|
-
|
|
1059
|
+
re,
|
|
1071
1060
|
{
|
|
1072
|
-
label:
|
|
1061
|
+
label: f,
|
|
1073
1062
|
checked: e,
|
|
1074
|
-
onChange: () =>
|
|
1063
|
+
onChange: () => W(r, f),
|
|
1075
1064
|
disabled: a
|
|
1076
1065
|
}
|
|
1077
1066
|
);
|
|
1078
1067
|
case "checkbox":
|
|
1079
1068
|
default:
|
|
1080
|
-
return
|
|
1069
|
+
return C === "list" ? /* @__PURE__ */ t.jsxs("div", { className: Ee.count, children: [
|
|
1081
1070
|
/* @__PURE__ */ t.jsx(
|
|
1082
|
-
|
|
1071
|
+
nt,
|
|
1083
1072
|
{
|
|
1084
|
-
label:
|
|
1073
|
+
label: f,
|
|
1085
1074
|
score: "",
|
|
1086
1075
|
checked: e,
|
|
1087
|
-
onChange: () =>
|
|
1076
|
+
onChange: () => W(r, f),
|
|
1088
1077
|
disabled: a
|
|
1089
1078
|
}
|
|
1090
1079
|
),
|
|
1091
1080
|
/* @__PURE__ */ t.jsx("span", { children: F })
|
|
1092
1081
|
] }) : /* @__PURE__ */ t.jsx(
|
|
1093
|
-
|
|
1082
|
+
nt,
|
|
1094
1083
|
{
|
|
1095
|
-
label:
|
|
1096
|
-
score:
|
|
1084
|
+
label: f,
|
|
1085
|
+
score: y,
|
|
1097
1086
|
checked: e,
|
|
1098
|
-
onChange: () =>
|
|
1087
|
+
onChange: () => W(r, f),
|
|
1099
1088
|
disabled: a
|
|
1100
1089
|
}
|
|
1101
1090
|
);
|
|
1102
1091
|
}
|
|
1103
|
-
},
|
|
1092
|
+
}, fe = S ? m : !1;
|
|
1104
1093
|
return /* @__PURE__ */ t.jsx(
|
|
1105
|
-
|
|
1094
|
+
be,
|
|
1106
1095
|
{
|
|
1107
1096
|
title: o,
|
|
1108
1097
|
collapsible: S,
|
|
1109
|
-
collapsed:
|
|
1098
|
+
collapsed: fe,
|
|
1110
1099
|
children: /* @__PURE__ */ t.jsxs(
|
|
1111
1100
|
"ul",
|
|
1112
1101
|
{
|
|
1113
|
-
className:
|
|
1102
|
+
className: C === "grid" ? Ee.grid : Ee.list,
|
|
1114
1103
|
style: { listStyle: "none", padding: 0, margin: 0 },
|
|
1115
1104
|
children: [
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
const
|
|
1105
|
+
U.map(([f, R]) => /* @__PURE__ */ t.jsx("li", { children: ce(f, R) }, f)),
|
|
1106
|
+
w && X < P.length && (() => {
|
|
1107
|
+
const f = P.length - X, R = Math.min(50, f);
|
|
1119
1108
|
return /* @__PURE__ */ t.jsx("li", { className: Ee.toggleItem, children: /* @__PURE__ */ t.jsx(
|
|
1120
1109
|
ye,
|
|
1121
1110
|
{
|
|
1122
1111
|
variant: "ghost",
|
|
1123
1112
|
size: "micro",
|
|
1124
|
-
onClick: () =>
|
|
1125
|
-
children: `Show ${
|
|
1113
|
+
onClick: () => z((e) => e + 50),
|
|
1114
|
+
children: `Show ${R} more of ${P.length} total`
|
|
1126
1115
|
}
|
|
1127
1116
|
) });
|
|
1128
1117
|
})()
|
|
@@ -1131,95 +1120,95 @@ const Qt = ({
|
|
|
1131
1120
|
)
|
|
1132
1121
|
}
|
|
1133
1122
|
);
|
|
1134
|
-
},
|
|
1135
|
-
disabledMessage:
|
|
1136
|
-
},
|
|
1123
|
+
}, Dt = "_disabledMessage_o89gh_1", lt = {
|
|
1124
|
+
disabledMessage: Dt
|
|
1125
|
+
}, nr = ({
|
|
1137
1126
|
field: r,
|
|
1138
1127
|
label: o,
|
|
1139
|
-
expectedMin:
|
|
1128
|
+
expectedMin: u = 0,
|
|
1140
1129
|
expectedMax: s = 1e3,
|
|
1141
|
-
displayType:
|
|
1142
|
-
collapsible:
|
|
1130
|
+
displayType: c = "input",
|
|
1131
|
+
collapsible: p = !0,
|
|
1143
1132
|
startCollapsed: S = !1
|
|
1144
1133
|
}) => {
|
|
1145
1134
|
const {
|
|
1146
|
-
state: { rangeFilters:
|
|
1147
|
-
setRangeFilter:
|
|
1148
|
-
resetSingleFilter:
|
|
1135
|
+
state: { rangeFilters: m, rangeBounds: n, facetStats: C, query: A, facetDebounceDelayMillis: k },
|
|
1136
|
+
setRangeFilter: q,
|
|
1137
|
+
resetSingleFilter: M,
|
|
1149
1138
|
allowEmptySearch: ne,
|
|
1150
|
-
isFetchingInitial:
|
|
1151
|
-
} =
|
|
1139
|
+
isFetchingInitial: L
|
|
1140
|
+
} = Ne(), x = (n == null ? void 0 : n[r]) !== void 0, _ = (n == null ? void 0 : n[r]) ?? { min: u, max: s }, g = _.min, v = _.max, W = (C == null ? void 0 : C[r]) ?? _, h = W.min, b = W.max, d = x && g === v, X = d ? u : g, z = d ? s : v, V = m == null ? void 0 : m[r], Z = V ? V.min : g, O = V ? V.max : v, pe = V !== void 0, P = h !== g || b !== v, [w, U] = te.useState([
|
|
1152
1141
|
Z,
|
|
1153
1142
|
O
|
|
1154
|
-
]), [
|
|
1155
|
-
const [
|
|
1156
|
-
return { finalMin:
|
|
1157
|
-
}, [
|
|
1158
|
-
|
|
1159
|
-
if (
|
|
1143
|
+
]), [ce, fe] = te.useState(!1), [f, R] = te.useState(!1), { finalMin: e, finalMax: a, isValidMin: y, isValidMax: F } = te.useMemo(() => {
|
|
1144
|
+
const [$, I] = w, J = Math.max(g, Math.min(v, $)), _e = Math.max(g, Math.min(v, I)), Te = Math.min(J, _e), Ae = Math.max(J, _e), qe = Te >= g && Te < Ae, ze = Ae <= v && Ae > Te;
|
|
1145
|
+
return { finalMin: Te, finalMax: Ae, isValidMin: qe, isValidMax: ze };
|
|
1146
|
+
}, [w, g, v]);
|
|
1147
|
+
te.useEffect(() => {
|
|
1148
|
+
if (d)
|
|
1160
1149
|
return;
|
|
1161
|
-
if (
|
|
1162
|
-
|
|
1150
|
+
if (w[0] === g && w[1] === v) {
|
|
1151
|
+
fe(!1), R(!1);
|
|
1163
1152
|
return;
|
|
1164
1153
|
}
|
|
1165
|
-
const
|
|
1166
|
-
|
|
1167
|
-
}, 300),
|
|
1168
|
-
|
|
1169
|
-
},
|
|
1154
|
+
const I = k ?? 500, J = setTimeout(() => {
|
|
1155
|
+
fe(!y), R(!F);
|
|
1156
|
+
}, 300), _e = setTimeout(() => {
|
|
1157
|
+
y && F && (e === g && a === v ? M(r, void 0, !1) : q(r, e, a));
|
|
1158
|
+
}, I);
|
|
1170
1159
|
return () => {
|
|
1171
|
-
clearTimeout(J), clearTimeout(
|
|
1160
|
+
clearTimeout(J), clearTimeout(_e);
|
|
1172
1161
|
};
|
|
1173
|
-
}, [e, a,
|
|
1174
|
-
|
|
1162
|
+
}, [e, a, y, F, g, v, r, M, q, k, d]), te.useEffect(() => {
|
|
1163
|
+
U([Z, O]), fe(!1), R(!1);
|
|
1175
1164
|
}, [Z, O, r]);
|
|
1176
|
-
const
|
|
1177
|
-
if (
|
|
1178
|
-
const
|
|
1179
|
-
|
|
1180
|
-
}, [
|
|
1181
|
-
if (
|
|
1182
|
-
const
|
|
1183
|
-
|
|
1184
|
-
}, [
|
|
1185
|
-
if (
|
|
1186
|
-
const
|
|
1187
|
-
if (!isNaN(
|
|
1188
|
-
const J = Math.max(g, Math.min(
|
|
1189
|
-
|
|
1165
|
+
const ue = te.useCallback(($) => {
|
|
1166
|
+
if (d) return;
|
|
1167
|
+
const I = Math.max(g, Math.min(b, $[0])), J = Math.max(h, Math.min(v, $[1]));
|
|
1168
|
+
U([I, J]);
|
|
1169
|
+
}, [d, g, v, h, b]), xe = te.useCallback(($) => {
|
|
1170
|
+
if (d) return;
|
|
1171
|
+
const I = Math.max(g, Math.min(b, $[0])), J = Math.max(h, Math.min(v, $[1]));
|
|
1172
|
+
I === g && J === v ? (U([g, v]), M(r, void 0, !0)) : U([I, J]);
|
|
1173
|
+
}, [d, g, v, h, b, r, M]), T = te.useCallback(($) => {
|
|
1174
|
+
if (d) return;
|
|
1175
|
+
const I = Number($.target.value);
|
|
1176
|
+
if (!isNaN(I)) {
|
|
1177
|
+
const J = Math.max(g, Math.min(b, I));
|
|
1178
|
+
U([J, w[1]]);
|
|
1190
1179
|
}
|
|
1191
|
-
}, [
|
|
1192
|
-
if (
|
|
1193
|
-
const
|
|
1194
|
-
if (!isNaN(
|
|
1195
|
-
const J = Math.max(
|
|
1196
|
-
|
|
1180
|
+
}, [d, w, g, b]), de = te.useCallback(($) => {
|
|
1181
|
+
if (d) return;
|
|
1182
|
+
const I = Number($.target.value);
|
|
1183
|
+
if (!isNaN(I)) {
|
|
1184
|
+
const J = Math.max(h, Math.min(v, I));
|
|
1185
|
+
U([w[0], J]);
|
|
1197
1186
|
}
|
|
1198
|
-
}, [
|
|
1199
|
-
const
|
|
1200
|
-
|
|
1201
|
-
}, [
|
|
1202
|
-
const
|
|
1203
|
-
|
|
1204
|
-
}, [
|
|
1205
|
-
return
|
|
1206
|
-
|
|
1187
|
+
}, [d, w, h, v]), ve = te.useCallback(() => {
|
|
1188
|
+
const $ = w[0], I = Math.max(g, Math.min(b, $));
|
|
1189
|
+
I < w[1] ? U([I, w[1]]) : U([g, w[1]]);
|
|
1190
|
+
}, [w, g, b]), ke = te.useCallback(() => {
|
|
1191
|
+
const $ = w[1], I = Math.max(h, Math.min(v, $));
|
|
1192
|
+
I > w[0] ? U([w[0], I]) : U([w[0], v]);
|
|
1193
|
+
}, [w, h, v]);
|
|
1194
|
+
return L || !ne && !A ? null : c === "slider" ? /* @__PURE__ */ t.jsxs(be, { title: o, collapsed: S, collapsible: p, children: [
|
|
1195
|
+
d && /* @__PURE__ */ t.jsxs("div", { className: lt.disabledMessage, children: [
|
|
1207
1196
|
"No adjustable range (all results have the same value: ",
|
|
1208
1197
|
g,
|
|
1209
1198
|
")."
|
|
1210
1199
|
] }),
|
|
1211
1200
|
/* @__PURE__ */ t.jsx("div", { style: { padding: "10px 10px 20px 10px" }, children: /* @__PURE__ */ t.jsx(
|
|
1212
|
-
|
|
1201
|
+
ut,
|
|
1213
1202
|
{
|
|
1214
|
-
min:
|
|
1215
|
-
max:
|
|
1216
|
-
value:
|
|
1203
|
+
min: X,
|
|
1204
|
+
max: z,
|
|
1205
|
+
value: d ? [X, z] : [e, a],
|
|
1217
1206
|
isRange: !0,
|
|
1218
|
-
onChange: (
|
|
1219
|
-
onFinalChange: (
|
|
1220
|
-
disabled:
|
|
1221
|
-
activeMin:
|
|
1222
|
-
activeMax:
|
|
1207
|
+
onChange: ($) => ue($),
|
|
1208
|
+
onFinalChange: ($) => xe($),
|
|
1209
|
+
disabled: d,
|
|
1210
|
+
activeMin: h,
|
|
1211
|
+
activeMax: b,
|
|
1223
1212
|
isFaceted: P,
|
|
1224
1213
|
highlightFaceted: pe,
|
|
1225
1214
|
"aria-label": o || `Filter by ${r}`
|
|
@@ -1237,80 +1226,80 @@ const Qt = ({
|
|
|
1237
1226
|
},
|
|
1238
1227
|
children: [
|
|
1239
1228
|
/* @__PURE__ */ t.jsx(
|
|
1240
|
-
|
|
1229
|
+
le,
|
|
1241
1230
|
{
|
|
1242
1231
|
label: "Min:",
|
|
1243
1232
|
type: "number",
|
|
1244
|
-
value:
|
|
1233
|
+
value: d ? g : w[0],
|
|
1245
1234
|
min: g,
|
|
1246
|
-
max: Math.min(
|
|
1247
|
-
onChange:
|
|
1248
|
-
onBlur:
|
|
1249
|
-
disabled:
|
|
1250
|
-
isValid:
|
|
1235
|
+
max: Math.min(b, w[1] - 1),
|
|
1236
|
+
onChange: T,
|
|
1237
|
+
onBlur: ve,
|
|
1238
|
+
disabled: d,
|
|
1239
|
+
isValid: d || !ce
|
|
1251
1240
|
}
|
|
1252
1241
|
),
|
|
1253
1242
|
/* @__PURE__ */ t.jsx(
|
|
1254
|
-
|
|
1243
|
+
le,
|
|
1255
1244
|
{
|
|
1256
1245
|
label: "Max:",
|
|
1257
1246
|
type: "number",
|
|
1258
|
-
value:
|
|
1259
|
-
min: Math.max(
|
|
1260
|
-
max:
|
|
1261
|
-
onChange:
|
|
1262
|
-
onBlur:
|
|
1263
|
-
disabled:
|
|
1264
|
-
isValid:
|
|
1247
|
+
value: d ? v : w[1],
|
|
1248
|
+
min: Math.max(h, w[0] + 1),
|
|
1249
|
+
max: v,
|
|
1250
|
+
onChange: de,
|
|
1251
|
+
onBlur: ke,
|
|
1252
|
+
disabled: d,
|
|
1253
|
+
isValid: d || !f
|
|
1265
1254
|
}
|
|
1266
1255
|
)
|
|
1267
1256
|
]
|
|
1268
1257
|
}
|
|
1269
1258
|
)
|
|
1270
|
-
] }) : /* @__PURE__ */ t.jsxs(
|
|
1271
|
-
|
|
1259
|
+
] }) : /* @__PURE__ */ t.jsxs(be, { title: o, children: [
|
|
1260
|
+
d && /* @__PURE__ */ t.jsxs("div", { className: lt.disabledMessage, children: [
|
|
1272
1261
|
"No adjustable range (all results have the same value: ",
|
|
1273
1262
|
g,
|
|
1274
1263
|
")."
|
|
1275
1264
|
] }),
|
|
1276
1265
|
/* @__PURE__ */ t.jsxs("div", { style: { display: "flex", gap: "10px", alignItems: "flex-start" }, children: [
|
|
1277
1266
|
/* @__PURE__ */ t.jsx(
|
|
1278
|
-
|
|
1267
|
+
le,
|
|
1279
1268
|
{
|
|
1280
1269
|
label: "Min:",
|
|
1281
1270
|
type: "number",
|
|
1282
|
-
value:
|
|
1271
|
+
value: d ? g : w[0],
|
|
1283
1272
|
min: g,
|
|
1284
|
-
max: Math.min(
|
|
1285
|
-
onChange:
|
|
1286
|
-
onBlur:
|
|
1287
|
-
disabled:
|
|
1288
|
-
isValid:
|
|
1273
|
+
max: Math.min(b, w[1] - 1),
|
|
1274
|
+
onChange: T,
|
|
1275
|
+
onBlur: ve,
|
|
1276
|
+
disabled: d,
|
|
1277
|
+
isValid: d || !ce
|
|
1289
1278
|
}
|
|
1290
1279
|
),
|
|
1291
1280
|
/* @__PURE__ */ t.jsx(
|
|
1292
|
-
|
|
1281
|
+
le,
|
|
1293
1282
|
{
|
|
1294
1283
|
label: "Max:",
|
|
1295
1284
|
type: "number",
|
|
1296
|
-
value:
|
|
1297
|
-
min: Math.max(
|
|
1298
|
-
max:
|
|
1299
|
-
onChange:
|
|
1300
|
-
onBlur:
|
|
1301
|
-
disabled:
|
|
1302
|
-
isValid:
|
|
1285
|
+
value: d ? v : w[1],
|
|
1286
|
+
min: Math.max(h, w[0] + 1),
|
|
1287
|
+
max: v,
|
|
1288
|
+
onChange: de,
|
|
1289
|
+
onBlur: ke,
|
|
1290
|
+
disabled: d,
|
|
1291
|
+
isValid: d || !f
|
|
1303
1292
|
}
|
|
1304
1293
|
)
|
|
1305
1294
|
] })
|
|
1306
1295
|
] });
|
|
1307
|
-
},
|
|
1308
|
-
grid:
|
|
1309
|
-
},
|
|
1296
|
+
}, Wt = "_grid_nvpmn_2", Bt = {
|
|
1297
|
+
grid: Wt
|
|
1298
|
+
}, Lt = ct(({ field: r, value: o, onReset: u }) => /* @__PURE__ */ t.jsx("li", { children: /* @__PURE__ */ t.jsxs(
|
|
1310
1299
|
ye,
|
|
1311
1300
|
{
|
|
1312
|
-
onClick:
|
|
1313
|
-
iconRight: /* @__PURE__ */ t.jsx(
|
|
1301
|
+
onClick: u,
|
|
1302
|
+
iconRight: /* @__PURE__ */ t.jsx(ht, {}),
|
|
1314
1303
|
variant: "primary",
|
|
1315
1304
|
size: "micro",
|
|
1316
1305
|
children: [
|
|
@@ -1319,11 +1308,11 @@ const Qt = ({
|
|
|
1319
1308
|
o
|
|
1320
1309
|
]
|
|
1321
1310
|
}
|
|
1322
|
-
) })),
|
|
1311
|
+
) })), qt = ct(({ field: r, min: o, max: u, onReset: s }) => /* @__PURE__ */ t.jsx("li", { children: /* @__PURE__ */ t.jsxs(
|
|
1323
1312
|
ye,
|
|
1324
1313
|
{
|
|
1325
1314
|
onClick: s,
|
|
1326
|
-
iconRight: /* @__PURE__ */ t.jsx(
|
|
1315
|
+
iconRight: /* @__PURE__ */ t.jsx(ht, {}),
|
|
1327
1316
|
variant: "primary",
|
|
1328
1317
|
size: "micro",
|
|
1329
1318
|
children: [
|
|
@@ -1331,51 +1320,51 @@ const Qt = ({
|
|
|
1331
1320
|
": ",
|
|
1332
1321
|
o,
|
|
1333
1322
|
" – ",
|
|
1334
|
-
|
|
1323
|
+
u
|
|
1335
1324
|
]
|
|
1336
1325
|
}
|
|
1337
1326
|
) }));
|
|
1338
|
-
function
|
|
1327
|
+
function sr() {
|
|
1339
1328
|
const {
|
|
1340
1329
|
state: { filters: r, rangeFilters: o },
|
|
1341
|
-
resetFilters:
|
|
1330
|
+
resetFilters: u,
|
|
1342
1331
|
resetSingleFilter: s
|
|
1343
|
-
} =
|
|
1332
|
+
} = Ne(), c = Ge(
|
|
1344
1333
|
() => Object.entries(r).map(
|
|
1345
|
-
([
|
|
1334
|
+
([m, n]) => n.map((C) => ({ field: m, value: C }))
|
|
1346
1335
|
).flat(),
|
|
1347
1336
|
[r]
|
|
1348
|
-
),
|
|
1349
|
-
() => Object.entries(o).map(([
|
|
1337
|
+
), p = Ge(
|
|
1338
|
+
() => Object.entries(o).map(([m, { min: n, max: C }]) => ({ field: m, min: n, max: C })),
|
|
1350
1339
|
[o]
|
|
1351
1340
|
);
|
|
1352
|
-
return
|
|
1341
|
+
return Ge(
|
|
1353
1342
|
() => Object.keys(r).length > 0 || Object.keys(o).length > 0,
|
|
1354
1343
|
[r, o]
|
|
1355
|
-
) ? /* @__PURE__ */ t.jsx(
|
|
1356
|
-
|
|
1357
|
-
|
|
1344
|
+
) ? /* @__PURE__ */ t.jsx(be, { collapsible: !1, title: "Active filters", children: /* @__PURE__ */ t.jsxs("ul", { className: Bt.grid, children: [
|
|
1345
|
+
c.map(({ field: m, value: n }) => /* @__PURE__ */ t.jsx(
|
|
1346
|
+
Lt,
|
|
1358
1347
|
{
|
|
1359
|
-
field:
|
|
1348
|
+
field: m,
|
|
1360
1349
|
value: n,
|
|
1361
|
-
onReset: () => s(
|
|
1350
|
+
onReset: () => s(m, n)
|
|
1362
1351
|
},
|
|
1363
|
-
`${
|
|
1352
|
+
`${m}-${n}`
|
|
1364
1353
|
)),
|
|
1365
|
-
|
|
1366
|
-
|
|
1354
|
+
p.map(({ field: m, min: n, max: C }) => /* @__PURE__ */ t.jsx(
|
|
1355
|
+
qt,
|
|
1367
1356
|
{
|
|
1368
|
-
field:
|
|
1357
|
+
field: m,
|
|
1369
1358
|
min: n,
|
|
1370
|
-
max:
|
|
1371
|
-
onReset: () => s(
|
|
1359
|
+
max: C,
|
|
1360
|
+
onReset: () => s(m)
|
|
1372
1361
|
},
|
|
1373
|
-
|
|
1362
|
+
m
|
|
1374
1363
|
)),
|
|
1375
1364
|
/* @__PURE__ */ t.jsx("li", { children: /* @__PURE__ */ t.jsx(
|
|
1376
1365
|
ye,
|
|
1377
1366
|
{
|
|
1378
|
-
onClick:
|
|
1367
|
+
onClick: u,
|
|
1379
1368
|
size: "micro",
|
|
1380
1369
|
variant: "ghost",
|
|
1381
1370
|
children: "Reset"
|
|
@@ -1383,123 +1372,123 @@ function tr() {
|
|
|
1383
1372
|
) })
|
|
1384
1373
|
] }) }) : null;
|
|
1385
1374
|
}
|
|
1386
|
-
const
|
|
1387
|
-
radioGroup:
|
|
1388
|
-
},
|
|
1375
|
+
const zt = "_radioGroup_nwf7i_6", Ut = {
|
|
1376
|
+
radioGroup: zt
|
|
1377
|
+
}, or = ({ displayType: r = "dropdown", collapsible: o = !0, startCollapsed: u = !1 }) => {
|
|
1389
1378
|
const {
|
|
1390
|
-
state: { sortableFields: s, sortBy:
|
|
1379
|
+
state: { sortableFields: s, sortBy: c, sortAscending: p },
|
|
1391
1380
|
setSort: S
|
|
1392
|
-
} =
|
|
1381
|
+
} = Ne();
|
|
1393
1382
|
if (!s || s.length === 0) return null;
|
|
1394
|
-
const
|
|
1383
|
+
const m = c ? `${c}:${p ? "asc" : "desc"}` : "none", n = [
|
|
1395
1384
|
{ label: "None", value: "none" },
|
|
1396
|
-
...s.flatMap((
|
|
1397
|
-
{ label: `${
|
|
1398
|
-
{ label: `${
|
|
1385
|
+
...s.flatMap((k) => [
|
|
1386
|
+
{ label: `${k} (asc)`, value: `${k}:asc` },
|
|
1387
|
+
{ label: `${k} (desc)`, value: `${k}:desc` }
|
|
1399
1388
|
])
|
|
1400
|
-
],
|
|
1401
|
-
if (
|
|
1389
|
+
], C = (k) => {
|
|
1390
|
+
if (k === "none" || k === "")
|
|
1402
1391
|
S(null, !0);
|
|
1403
1392
|
else {
|
|
1404
|
-
const [
|
|
1405
|
-
S(
|
|
1393
|
+
const [q, M] = k.split(":");
|
|
1394
|
+
S(q, M === "asc");
|
|
1406
1395
|
}
|
|
1407
|
-
},
|
|
1396
|
+
}, A = o ? u : !1;
|
|
1408
1397
|
return /* @__PURE__ */ t.jsx(
|
|
1409
|
-
|
|
1398
|
+
be,
|
|
1410
1399
|
{
|
|
1411
1400
|
title: "Sort by",
|
|
1412
1401
|
collapsible: o,
|
|
1413
|
-
collapsed:
|
|
1402
|
+
collapsed: A,
|
|
1414
1403
|
children: r === "dropdown" ? /* @__PURE__ */ t.jsx(
|
|
1415
|
-
|
|
1404
|
+
Ct,
|
|
1416
1405
|
{
|
|
1417
|
-
value:
|
|
1418
|
-
onValueChange:
|
|
1406
|
+
value: m,
|
|
1407
|
+
onValueChange: C,
|
|
1419
1408
|
options: n,
|
|
1420
1409
|
placeholder: "Select sort...",
|
|
1421
1410
|
"aria-label": "Sort by"
|
|
1422
1411
|
}
|
|
1423
|
-
) : /* @__PURE__ */ t.jsx("div", { className:
|
|
1424
|
-
|
|
1412
|
+
) : /* @__PURE__ */ t.jsx("div", { className: Ut.radioGroup, children: n.map((k) => /* @__PURE__ */ t.jsx(
|
|
1413
|
+
wt,
|
|
1425
1414
|
{
|
|
1426
|
-
id: `sort-${
|
|
1415
|
+
id: `sort-${k.value}`,
|
|
1427
1416
|
name: "sort-by",
|
|
1428
|
-
value:
|
|
1429
|
-
label:
|
|
1430
|
-
checked:
|
|
1431
|
-
onChange: (
|
|
1417
|
+
value: k.value,
|
|
1418
|
+
label: k.label,
|
|
1419
|
+
checked: m === k.value,
|
|
1420
|
+
onChange: (q) => C(q.target.value)
|
|
1432
1421
|
},
|
|
1433
|
-
|
|
1422
|
+
k.value
|
|
1434
1423
|
)) })
|
|
1435
1424
|
}
|
|
1436
1425
|
);
|
|
1437
|
-
},
|
|
1438
|
-
list:
|
|
1426
|
+
}, Gt = "_list_1y4fk_1", Xt = {
|
|
1427
|
+
list: Gt
|
|
1439
1428
|
};
|
|
1440
|
-
function
|
|
1429
|
+
function ar() {
|
|
1441
1430
|
const {
|
|
1442
1431
|
state: { searchSettings: r },
|
|
1443
1432
|
setSearchSettings: o
|
|
1444
|
-
} =
|
|
1445
|
-
const
|
|
1446
|
-
isNaN(
|
|
1447
|
-
[n]:
|
|
1433
|
+
} = Ne(), [u, s] = G(!1), c = (n, C) => {
|
|
1434
|
+
const A = parseInt(C, 10);
|
|
1435
|
+
isNaN(A) || o({
|
|
1436
|
+
[n]: A
|
|
1448
1437
|
});
|
|
1449
|
-
},
|
|
1438
|
+
}, p = (n, C) => {
|
|
1450
1439
|
o({
|
|
1451
|
-
[n]:
|
|
1440
|
+
[n]: C
|
|
1452
1441
|
});
|
|
1453
|
-
}, S = (n,
|
|
1454
|
-
const
|
|
1455
|
-
isNaN(
|
|
1442
|
+
}, S = (n, C) => {
|
|
1443
|
+
const A = parseInt(C, 10);
|
|
1444
|
+
isNaN(A) || o({
|
|
1456
1445
|
coverageSetup: {
|
|
1457
1446
|
...r.coverageSetup,
|
|
1458
|
-
[n]:
|
|
1447
|
+
[n]: A
|
|
1459
1448
|
}
|
|
1460
1449
|
});
|
|
1461
|
-
},
|
|
1450
|
+
}, m = (n, C) => {
|
|
1462
1451
|
o({
|
|
1463
1452
|
coverageSetup: {
|
|
1464
1453
|
...r.coverageSetup,
|
|
1465
|
-
[n]:
|
|
1454
|
+
[n]: C
|
|
1466
1455
|
}
|
|
1467
1456
|
});
|
|
1468
1457
|
};
|
|
1469
|
-
return /* @__PURE__ */ t.jsx(
|
|
1458
|
+
return /* @__PURE__ */ t.jsx(be, { collapsed: !0, title: "Settings", children: /* @__PURE__ */ t.jsxs("ul", { className: Xt.list, children: [
|
|
1470
1459
|
/* @__PURE__ */ t.jsx("li", { children: /* @__PURE__ */ t.jsx(
|
|
1471
|
-
|
|
1460
|
+
le,
|
|
1472
1461
|
{
|
|
1473
1462
|
label: "Max Results",
|
|
1474
1463
|
type: "number",
|
|
1475
1464
|
value: r.maxNumberOfRecordsToReturn.toString(),
|
|
1476
|
-
onChange: (n) =>
|
|
1465
|
+
onChange: (n) => c("maxNumberOfRecordsToReturn", n.target.value)
|
|
1477
1466
|
}
|
|
1478
1467
|
) }),
|
|
1479
1468
|
/* @__PURE__ */ t.jsx("li", { children: /* @__PURE__ */ t.jsx(
|
|
1480
|
-
|
|
1469
|
+
le,
|
|
1481
1470
|
{
|
|
1482
1471
|
label: "Coverage Depth",
|
|
1483
1472
|
type: "number",
|
|
1484
1473
|
value: r.coverageDepth.toString(),
|
|
1485
|
-
onChange: (n) =>
|
|
1474
|
+
onChange: (n) => c("coverageDepth", n.target.value)
|
|
1486
1475
|
}
|
|
1487
1476
|
) }),
|
|
1488
1477
|
/* @__PURE__ */ t.jsxs("li", { children: [
|
|
1489
1478
|
/* @__PURE__ */ t.jsx(
|
|
1490
|
-
|
|
1479
|
+
le,
|
|
1491
1480
|
{
|
|
1492
1481
|
label: "Minimum Score",
|
|
1493
1482
|
type: "number",
|
|
1494
1483
|
value: r.minimumScore.toString(),
|
|
1495
1484
|
onChange: (n) => {
|
|
1496
|
-
const
|
|
1497
|
-
isNaN(
|
|
1485
|
+
const C = parseFloat(n.target.value);
|
|
1486
|
+
isNaN(C) || o({ minimumScore: C });
|
|
1498
1487
|
}
|
|
1499
1488
|
}
|
|
1500
1489
|
),
|
|
1501
1490
|
/* @__PURE__ */ t.jsx("div", { style: { padding: "10px 10px 20px 10px" }, children: /* @__PURE__ */ t.jsx(
|
|
1502
|
-
|
|
1491
|
+
ut,
|
|
1503
1492
|
{
|
|
1504
1493
|
min: 0,
|
|
1505
1494
|
max: 255,
|
|
@@ -1513,7 +1502,7 @@ function nr() {
|
|
|
1513
1502
|
) })
|
|
1514
1503
|
] }),
|
|
1515
1504
|
/* @__PURE__ */ t.jsx("li", { children: /* @__PURE__ */ t.jsx(
|
|
1516
|
-
|
|
1505
|
+
le,
|
|
1517
1506
|
{
|
|
1518
1507
|
label: "Placeholder text",
|
|
1519
1508
|
type: "text",
|
|
@@ -1524,81 +1513,89 @@ function nr() {
|
|
|
1524
1513
|
}
|
|
1525
1514
|
) }),
|
|
1526
1515
|
/* @__PURE__ */ t.jsx("li", { children: /* @__PURE__ */ t.jsx(
|
|
1527
|
-
|
|
1516
|
+
re,
|
|
1528
1517
|
{
|
|
1529
1518
|
label: "Show score",
|
|
1530
1519
|
checked: r.showScore,
|
|
1531
|
-
onChange: (n) =>
|
|
1520
|
+
onChange: (n) => p("showScore", n)
|
|
1532
1521
|
}
|
|
1533
1522
|
) }),
|
|
1534
1523
|
/* @__PURE__ */ t.jsx("li", { children: /* @__PURE__ */ t.jsx(
|
|
1535
|
-
|
|
1524
|
+
re,
|
|
1536
1525
|
{
|
|
1537
1526
|
label: "Enable Coverage",
|
|
1538
1527
|
checked: r.enableCoverage,
|
|
1539
|
-
onChange: (n) =>
|
|
1528
|
+
onChange: (n) => p("enableCoverage", n)
|
|
1540
1529
|
}
|
|
1541
1530
|
) }),
|
|
1542
1531
|
/* @__PURE__ */ t.jsx("li", { children: /* @__PURE__ */ t.jsx(
|
|
1543
|
-
|
|
1532
|
+
re,
|
|
1544
1533
|
{
|
|
1545
1534
|
label: "Remove Duplicates",
|
|
1546
1535
|
checked: r.removeDuplicates,
|
|
1547
|
-
onChange: (n) =>
|
|
1536
|
+
onChange: (n) => p("removeDuplicates", n)
|
|
1548
1537
|
}
|
|
1549
1538
|
) }),
|
|
1550
|
-
/* @__PURE__ */ t.jsx("li", { children: /* @__PURE__ */ t.jsx(ye, { variant: "ghost", size: "micro", iconRight:
|
|
1551
|
-
|
|
1539
|
+
/* @__PURE__ */ t.jsx("li", { children: /* @__PURE__ */ t.jsx(ye, { variant: "ghost", size: "micro", iconRight: u ? /* @__PURE__ */ t.jsx(Vt, {}) : /* @__PURE__ */ t.jsx(Ot, {}), onClick: () => s((n) => !n), children: u ? "Hide Coverage Setup" : "Show Coverage Setup" }) }),
|
|
1540
|
+
u && /* @__PURE__ */ t.jsxs(t.Fragment, { children: [
|
|
1552
1541
|
/* @__PURE__ */ t.jsx("li", { children: /* @__PURE__ */ t.jsx(
|
|
1553
|
-
|
|
1542
|
+
re,
|
|
1554
1543
|
{
|
|
1555
1544
|
label: "Cover Whole Query",
|
|
1556
1545
|
checked: r.coverageSetup.coverWholeQuery,
|
|
1557
|
-
onChange: (n) =>
|
|
1546
|
+
onChange: (n) => m("coverWholeQuery", n)
|
|
1558
1547
|
}
|
|
1559
1548
|
) }),
|
|
1560
1549
|
/* @__PURE__ */ t.jsx("li", { children: /* @__PURE__ */ t.jsx(
|
|
1561
|
-
|
|
1550
|
+
re,
|
|
1562
1551
|
{
|
|
1563
1552
|
label: "Cover Whole Words",
|
|
1564
1553
|
checked: r.coverageSetup.coverWholeWords,
|
|
1565
|
-
onChange: (n) =>
|
|
1554
|
+
onChange: (n) => m("coverWholeWords", n)
|
|
1566
1555
|
}
|
|
1567
1556
|
) }),
|
|
1568
1557
|
/* @__PURE__ */ t.jsx("li", { children: /* @__PURE__ */ t.jsx(
|
|
1569
|
-
|
|
1558
|
+
re,
|
|
1570
1559
|
{
|
|
1571
1560
|
label: "Cover Fuzzy Words",
|
|
1572
1561
|
checked: r.coverageSetup.coverFuzzyWords,
|
|
1573
|
-
onChange: (n) =>
|
|
1562
|
+
onChange: (n) => m("coverFuzzyWords", n)
|
|
1574
1563
|
}
|
|
1575
1564
|
) }),
|
|
1576
1565
|
/* @__PURE__ */ t.jsx("li", { children: /* @__PURE__ */ t.jsx(
|
|
1577
|
-
|
|
1566
|
+
re,
|
|
1578
1567
|
{
|
|
1579
1568
|
label: "Cover Joined Words",
|
|
1580
1569
|
checked: r.coverageSetup.coverJoinedWords,
|
|
1581
|
-
onChange: (n) =>
|
|
1570
|
+
onChange: (n) => m("coverJoinedWords", n)
|
|
1582
1571
|
}
|
|
1583
1572
|
) }),
|
|
1584
1573
|
/* @__PURE__ */ t.jsx("li", { children: /* @__PURE__ */ t.jsx(
|
|
1585
|
-
|
|
1574
|
+
re,
|
|
1586
1575
|
{
|
|
1587
1576
|
label: "Cover Prefix Suffix",
|
|
1588
1577
|
checked: r.coverageSetup.coverPrefixSuffix,
|
|
1589
|
-
onChange: (n) =>
|
|
1578
|
+
onChange: (n) => m("coverPrefixSuffix", n)
|
|
1590
1579
|
}
|
|
1591
1580
|
) }),
|
|
1592
1581
|
/* @__PURE__ */ t.jsx("li", { children: /* @__PURE__ */ t.jsx(
|
|
1593
|
-
|
|
1582
|
+
re,
|
|
1594
1583
|
{
|
|
1595
|
-
label: "Truncate
|
|
1584
|
+
label: "Truncate",
|
|
1596
1585
|
checked: r.coverageSetup.truncate,
|
|
1597
|
-
onChange: (n) =>
|
|
1586
|
+
onChange: (n) => m("truncate", n)
|
|
1587
|
+
}
|
|
1588
|
+
) }),
|
|
1589
|
+
/* @__PURE__ */ t.jsx("li", { children: /* @__PURE__ */ t.jsx(
|
|
1590
|
+
re,
|
|
1591
|
+
{
|
|
1592
|
+
label: "Include Pattern Matches",
|
|
1593
|
+
checked: r.coverageSetup.includePatternMatches,
|
|
1594
|
+
onChange: (n) => m("includePatternMatches", n)
|
|
1598
1595
|
}
|
|
1599
1596
|
) }),
|
|
1600
1597
|
/* @__PURE__ */ t.jsx("li", { children: /* @__PURE__ */ t.jsx(
|
|
1601
|
-
|
|
1598
|
+
le,
|
|
1602
1599
|
{
|
|
1603
1600
|
label: "Levenshtein Max Word Size",
|
|
1604
1601
|
type: "number",
|
|
@@ -1607,7 +1604,7 @@ function nr() {
|
|
|
1607
1604
|
}
|
|
1608
1605
|
) }),
|
|
1609
1606
|
/* @__PURE__ */ t.jsx("li", { children: /* @__PURE__ */ t.jsx(
|
|
1610
|
-
|
|
1607
|
+
le,
|
|
1611
1608
|
{
|
|
1612
1609
|
label: "Min Word Size",
|
|
1613
1610
|
type: "number",
|
|
@@ -1616,57 +1613,39 @@ function nr() {
|
|
|
1616
1613
|
}
|
|
1617
1614
|
) }),
|
|
1618
1615
|
/* @__PURE__ */ t.jsx("li", { children: /* @__PURE__ */ t.jsx(
|
|
1619
|
-
|
|
1620
|
-
{
|
|
1621
|
-
label: "Coverage Min Word Hits Abs",
|
|
1622
|
-
type: "number",
|
|
1623
|
-
value: r.coverageSetup.coverageMinWordHitsAbs.toString(),
|
|
1624
|
-
onChange: (n) => S("coverageMinWordHitsAbs", n.target.value)
|
|
1625
|
-
}
|
|
1626
|
-
) }),
|
|
1627
|
-
/* @__PURE__ */ t.jsx("li", { children: /* @__PURE__ */ t.jsx(
|
|
1628
|
-
ee,
|
|
1629
|
-
{
|
|
1630
|
-
label: "Coverage Min Word Hits Relative",
|
|
1631
|
-
type: "number",
|
|
1632
|
-
value: r.coverageSetup.coverageMinWordHitsRelative.toString(),
|
|
1633
|
-
onChange: (n) => S("coverageMinWordHitsRelative", n.target.value)
|
|
1634
|
-
}
|
|
1635
|
-
) }),
|
|
1636
|
-
/* @__PURE__ */ t.jsx("li", { children: /* @__PURE__ */ t.jsx(
|
|
1637
|
-
ee,
|
|
1616
|
+
le,
|
|
1638
1617
|
{
|
|
1639
|
-
label: "
|
|
1618
|
+
label: "Truncate Word Hit Limit",
|
|
1640
1619
|
type: "number",
|
|
1641
|
-
value: r.coverageSetup.
|
|
1642
|
-
onChange: (n) => S("
|
|
1620
|
+
value: r.coverageSetup.truncateWordHitLimit.toString(),
|
|
1621
|
+
onChange: (n) => S("truncateWordHitLimit", n.target.value)
|
|
1643
1622
|
}
|
|
1644
1623
|
) }),
|
|
1645
1624
|
/* @__PURE__ */ t.jsx("li", { children: /* @__PURE__ */ t.jsx(
|
|
1646
|
-
|
|
1625
|
+
le,
|
|
1647
1626
|
{
|
|
1648
|
-
label: "
|
|
1627
|
+
label: "Truncate Word Hit Tolerance",
|
|
1649
1628
|
type: "number",
|
|
1650
|
-
value: r.coverageSetup.
|
|
1651
|
-
onChange: (n) => S("
|
|
1629
|
+
value: r.coverageSetup.truncateWordHitTolerance.toString(),
|
|
1630
|
+
onChange: (n) => S("truncateWordHitTolerance", n.target.value)
|
|
1652
1631
|
}
|
|
1653
1632
|
) })
|
|
1654
1633
|
] })
|
|
1655
1634
|
] }) });
|
|
1656
1635
|
}
|
|
1657
|
-
class
|
|
1658
|
-
constructor(
|
|
1659
|
-
super(
|
|
1660
|
-
|
|
1636
|
+
class ir extends jt {
|
|
1637
|
+
constructor(u) {
|
|
1638
|
+
super(u);
|
|
1639
|
+
rt(this, "reset", () => {
|
|
1661
1640
|
this.setState({ hasError: !1, error: null });
|
|
1662
1641
|
});
|
|
1663
1642
|
this.state = { hasError: !1, error: null };
|
|
1664
1643
|
}
|
|
1665
|
-
static getDerivedStateFromError(
|
|
1666
|
-
return { hasError: !0, error:
|
|
1644
|
+
static getDerivedStateFromError(u) {
|
|
1645
|
+
return { hasError: !0, error: u };
|
|
1667
1646
|
}
|
|
1668
|
-
componentDidCatch(
|
|
1669
|
-
console.error("[SearchErrorBoundary] Caught error:",
|
|
1647
|
+
componentDidCatch(u, s) {
|
|
1648
|
+
console.error("[SearchErrorBoundary] Caught error:", u, s);
|
|
1670
1649
|
}
|
|
1671
1650
|
render() {
|
|
1672
1651
|
return this.state.hasError && this.state.error ? this.props.fallback ? this.props.fallback(this.state.error, this.reset) : /* @__PURE__ */ t.jsxs("div", { style: {
|
|
@@ -1719,15 +1698,15 @@ class sr extends xt {
|
|
|
1719
1698
|
}
|
|
1720
1699
|
}
|
|
1721
1700
|
export {
|
|
1722
|
-
|
|
1723
|
-
|
|
1724
|
-
|
|
1725
|
-
|
|
1726
|
-
|
|
1727
|
-
|
|
1728
|
-
|
|
1729
|
-
|
|
1730
|
-
|
|
1731
|
-
|
|
1732
|
-
|
|
1701
|
+
sr as ActiveFiltersPanel,
|
|
1702
|
+
nr as RangeFilterPanel,
|
|
1703
|
+
ir as SearchErrorBoundary,
|
|
1704
|
+
er as SearchInput,
|
|
1705
|
+
Kt as SearchProvider,
|
|
1706
|
+
tr as SearchResults,
|
|
1707
|
+
ar as SearchSettingsPanel,
|
|
1708
|
+
or as SortByPanel,
|
|
1709
|
+
rr as ValueFilterPanel,
|
|
1710
|
+
Ne as useSearch,
|
|
1711
|
+
Ne as useSearchContext
|
|
1733
1712
|
};
|