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