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