@indxsearch/intrface 1.1.5 → 1.1.6

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 CHANGED
@@ -2,8 +2,8 @@ var gt = Object.defineProperty;
2
2
  var mt = (r, o, d) => o in r ? gt(r, o, { enumerable: !0, configurable: !0, writable: !0, value: d }) : r[o] = d;
3
3
  var tt = (r, o, d) => mt(r, typeof o != "symbol" ? o + "" : o, d);
4
4
  import "@indxsearch/systm/styles.css";
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";
5
+ import re, { createContext as pt, useRef as me, useState as X, useEffect as ie, useCallback as K, 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 ee, Select as St, RadioButton as yt } from "@indxsearch/systm";
7
7
  var qe = { exports: {} }, Pe = {};
8
8
  /**
9
9
  * @license React
@@ -19,19 +19,19 @@ function jt() {
19
19
  if (nt) return Pe;
20
20
  nt = 1;
21
21
  var r = Symbol.for("react.transitional.element"), o = Symbol.for("react.fragment");
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
- m = {};
22
+ function d(s, u, v) {
23
+ var S = null;
24
+ if (v !== void 0 && (S = "" + v), u.key !== void 0 && (S = "" + u.key), "key" in u) {
25
+ v = {};
26
26
  for (var f in u)
27
- f !== "key" && (m[f] = u[f]);
28
- } else m = u;
29
- return u = m.ref, {
27
+ f !== "key" && (v[f] = u[f]);
28
+ } else v = u;
29
+ return u = v.ref, {
30
30
  $$typeof: r,
31
31
  type: s,
32
- key: y,
32
+ key: S,
33
33
  ref: u !== void 0 ? u : null,
34
- props: m
34
+ props: v
35
35
  };
36
36
  }
37
37
  return Pe.Fragment = o, Pe.jsx = d, Pe.jsxs = d, Pe;
@@ -52,38 +52,38 @@ function Ct() {
52
52
  function r(e) {
53
53
  if (e == null) return null;
54
54
  if (typeof e == "function")
55
- return e.$$typeof === Q ? null : e.displayName || e.name || null;
55
+ return e.$$typeof === Z ? null : e.displayName || e.name || null;
56
56
  if (typeof e == "string") return e;
57
57
  switch (e) {
58
- case g:
59
- return "Fragment";
60
58
  case p:
59
+ return "Fragment";
60
+ case g:
61
61
  return "Profiler";
62
- case H:
62
+ case T:
63
63
  return "StrictMode";
64
- case R:
64
+ case j:
65
65
  return "Suspense";
66
- case b:
66
+ case m:
67
67
  return "SuspenseList";
68
- case P:
68
+ case G:
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 B:
75
+ case q:
76
76
  return "Portal";
77
- case i:
77
+ case c:
78
78
  return e.displayName || "Context";
79
- case S:
79
+ case x:
80
80
  return (e._context.displayName || "Context") + ".Consumer";
81
- case j:
81
+ case y:
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 q:
84
+ case D:
85
85
  return a = e.displayName || null, a !== null ? a : r(e.type) || "Memo";
86
- case V:
86
+ case U:
87
87
  a = e._payload, e = e._init;
88
88
  try {
89
89
  return r(e(a));
@@ -104,17 +104,17 @@ function Ct() {
104
104
  }
105
105
  if (a) {
106
106
  a = console;
107
- var v = a.error, E = typeof Symbol == "function" && Symbol.toStringTag && e[Symbol.toStringTag] || e.constructor.name || "Object";
108
- return v.call(
107
+ var b = a.error, F = typeof Symbol == "function" && Symbol.toStringTag && e[Symbol.toStringTag] || e.constructor.name || "Object";
108
+ return b.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
- E
111
+ F
112
112
  ), o(e);
113
113
  }
114
114
  }
115
115
  function s(e) {
116
- if (e === g) return "<>";
117
- if (typeof e == "object" && e !== null && e.$$typeof === V)
116
+ if (e === p) return "<>";
117
+ if (typeof e == "object" && e !== null && e.$$typeof === U)
118
118
  return "<...>";
119
119
  try {
120
120
  var a = r(e);
@@ -127,25 +127,25 @@ function Ct() {
127
127
  var e = O.A;
128
128
  return e === null ? null : e.getOwner();
129
129
  }
130
- function m() {
130
+ function v() {
131
131
  return Error("react-stack-top-frame");
132
132
  }
133
- function y(e) {
134
- if (ce.call(e, "key")) {
133
+ function S(e) {
134
+ if (pe.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
140
  function f(e, a) {
141
- function v() {
142
- L || (L = !0, console.error(
141
+ function b() {
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
- v.isReactWarning = !0, Object.defineProperty(e, "key", {
148
- get: v,
147
+ b.isReactWarning = !0, Object.defineProperty(e, "key", {
148
+ get: b,
149
149
  configurable: !0
150
150
  });
151
151
  }
@@ -155,14 +155,14 @@ function Ct() {
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 k(e, a, v, E, ue, xe) {
159
- var A = v.ref;
158
+ function w(e, a, b, F, ce, xe) {
159
+ var A = b.ref;
160
160
  return e = {
161
- $$typeof: J,
161
+ $$typeof: ne,
162
162
  type: e,
163
163
  key: a,
164
- props: v,
165
- _owner: E
164
+ props: b,
165
+ _owner: F
166
166
  }, (A !== void 0 ? A : null) !== null ? Object.defineProperty(e, "ref", {
167
167
  enumerable: !1,
168
168
  get: n
@@ -180,7 +180,7 @@ function Ct() {
180
180
  configurable: !1,
181
181
  enumerable: !1,
182
182
  writable: !0,
183
- value: ue
183
+ value: ce
184
184
  }), Object.defineProperty(e, "_debugTask", {
185
185
  configurable: !1,
186
186
  enumerable: !1,
@@ -188,91 +188,91 @@ function Ct() {
188
188
  value: xe
189
189
  }), Object.freeze && (Object.freeze(e.props), Object.freeze(e)), e;
190
190
  }
191
- function z(e, a, v, E, ue, xe) {
191
+ function V(e, a, b, F, ce, xe) {
192
192
  var A = a.children;
193
193
  if (A !== void 0)
194
- if (E)
195
- if (T(A)) {
196
- for (E = 0; E < A.length; E++)
197
- F(A[E]);
194
+ if (F)
195
+ if (P(A)) {
196
+ for (F = 0; F < A.length; F++)
197
+ M(A[F]);
198
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 F(A);
204
- if (ce.call(a, "key")) {
203
+ else M(A);
204
+ if (pe.call(a, "key")) {
205
205
  A = r(e);
206
206
  var se = Object.keys(a).filter(function(Ne) {
207
207
  return Ne !== "key";
208
208
  });
209
- E = 0 < se.length ? "{key: someKey, " + se.join(": ..., ") + ": ...}" : "{key: someKey}", M[A + E] || (se = 0 < se.length ? "{" + se.join(": ..., ") + ": ...}" : "{}", console.error(
209
+ F = 0 < se.length ? "{key: someKey, " + se.join(": ..., ") + ": ...}" : "{key: someKey}", E[A + F] || (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
- E,
216
+ F,
217
217
  A,
218
218
  se,
219
219
  A
220
- ), M[A + E] = !0);
220
+ ), E[A + F] = !0);
221
221
  }
222
- if (A = null, v !== void 0 && (d(v), A = "" + v), y(a) && (d(a.key), A = "" + a.key), "key" in a) {
223
- v = {};
222
+ if (A = null, b !== void 0 && (d(b), A = "" + b), S(a) && (d(a.key), A = "" + a.key), "key" in a) {
223
+ b = {};
224
224
  for (var be in a)
225
- be !== "key" && (v[be] = a[be]);
226
- } else v = a;
225
+ be !== "key" && (b[be] = a[be]);
226
+ } else b = a;
227
227
  return A && f(
228
- v,
228
+ b,
229
229
  typeof e == "function" ? e.displayName || e.name || "Unknown" : e
230
- ), k(
230
+ ), w(
231
231
  e,
232
232
  A,
233
- v,
233
+ b,
234
234
  u(),
235
- ue,
235
+ ce,
236
236
  xe
237
237
  );
238
238
  }
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));
239
+ function M(e) {
240
+ L(e) ? e._store && (e._store.validated = 1) : typeof e == "object" && e !== null && e.$$typeof === U && (e._payload.status === "fulfilled" ? L(e._payload.value) && e._payload.value._store && (e._payload.value._store.validated = 1) : e._store && (e._store.validated = 1));
241
241
  }
242
- function G(e) {
243
- return typeof e == "object" && e !== null && e.$$typeof === J;
242
+ function L(e) {
243
+ return typeof e == "object" && e !== null && e.$$typeof === ne;
244
244
  }
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() {
245
+ var k = re, ne = Symbol.for("react.transitional.element"), q = Symbol.for("react.portal"), p = Symbol.for("react.fragment"), T = Symbol.for("react.strict_mode"), g = Symbol.for("react.profiler"), x = Symbol.for("react.consumer"), c = Symbol.for("react.context"), y = Symbol.for("react.forward_ref"), j = Symbol.for("react.suspense"), m = Symbol.for("react.suspense_list"), D = Symbol.for("react.memo"), U = Symbol.for("react.lazy"), G = Symbol.for("react.activity"), Z = Symbol.for("react.client.reference"), O = k.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, pe = Object.prototype.hasOwnProperty, P = Array.isArray, R = console.createTask ? console.createTask : function() {
246
246
  return null;
247
247
  };
248
- x = {
248
+ k = {
249
249
  react_stack_bottom_frame: function(e) {
250
250
  return e();
251
251
  }
252
252
  };
253
- var L, ve = {}, fe = x.react_stack_bottom_frame.bind(
254
- x,
255
- m
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(
253
+ var B, ve = {}, he = k.react_stack_bottom_frame.bind(
254
+ k,
255
+ v
256
+ )(), h = R(s(v)), E = {};
257
+ He.Fragment = p, He.jsx = function(e, a, b) {
258
+ var F = 1e4 > O.recentlyCreatedOwnerStacks++;
259
+ return V(
260
260
  e,
261
261
  a,
262
- v,
262
+ b,
263
263
  !1,
264
- E ? Error("react-stack-top-frame") : fe,
265
- E ? w(s(e)) : h
264
+ F ? Error("react-stack-top-frame") : he,
265
+ F ? R(s(e)) : h
266
266
  );
267
- }, He.jsxs = function(e, a, v) {
268
- var E = 1e4 > O.recentlyCreatedOwnerStacks++;
269
- return z(
267
+ }, He.jsxs = function(e, a, b) {
268
+ var F = 1e4 > O.recentlyCreatedOwnerStacks++;
269
+ return V(
270
270
  e,
271
271
  a,
272
- v,
272
+ b,
273
273
  !0,
274
- E ? Error("react-stack-top-frame") : fe,
275
- E ? w(s(e)) : h
274
+ F ? Error("react-stack-top-frame") : he,
275
+ F ? R(s(e)) : h
276
276
  );
277
277
  };
278
278
  })()), He;
@@ -296,33 +296,33 @@ const Qt = ({
296
296
  password: d,
297
297
  url: s,
298
298
  dataset: u,
299
- allowEmptySearch: m = !1,
300
- maxResults: y = 10,
299
+ allowEmptySearch: v = !1,
300
+ maxResults: S = 10,
301
301
  facetDebounceDelayMillis: f = 500,
302
302
  // debounce faceted searches only
303
303
  enableFacets: n = !0,
304
- coverageDepth: k = 500,
305
- removeDuplicates: z = !0,
306
- enableCoverage: F = !0,
307
- initialCoverageSetup: G = {},
308
- enableDebugLogs: x = !1,
309
- preAuthenticatedToken: J
304
+ coverageDepth: w = 500,
305
+ removeDuplicates: V = !0,
306
+ enableCoverage: M = !0,
307
+ initialCoverageSetup: L = {},
308
+ enableDebugLogs: k = !1,
309
+ preAuthenticatedToken: ne
310
310
  }) => {
311
- const B = pe(0), g = pe(void 0), H = pe(!1), p = pe(!1), S = pe(!1), [i, j] = X({
311
+ const q = me(0), p = me(void 0), T = me(!1), g = me(!1), x = me(!1), [c, y] = X({
312
312
  query: "",
313
313
  results: null,
314
314
  isLoading: !1,
315
- resultsSuppressed: !m,
315
+ resultsSuppressed: !v,
316
316
  // Show placeholder if empty search not allowed
317
317
  facetDebounceDelayMillis: f,
318
318
  filters: {},
319
319
  rangeFilters: {},
320
320
  facetStats: {},
321
321
  searchSettings: {
322
- maxNumberOfRecordsToReturn: y,
323
- coverageDepth: k,
324
- enableCoverage: F,
325
- removeDuplicates: z,
322
+ maxNumberOfRecordsToReturn: S,
323
+ coverageDepth: w,
324
+ enableCoverage: M,
325
+ removeDuplicates: V,
326
326
  minimumScore: 0,
327
327
  showScore: !0,
328
328
  placeholderText: "Type to search",
@@ -340,177 +340,177 @@ const Qt = ({
340
340
  coverJoinedWords: !0,
341
341
  coverPrefixSuffix: !0,
342
342
  truncate: !0,
343
- ...G
343
+ ...L
344
344
  // Allow prop-based override
345
345
  }
346
346
  }
347
347
  });
348
348
  ie(() => {
349
- x && console.log("SearchContext mounted on client");
350
- }, [x]), ie(() => {
351
- j((l) => ({
352
- ...l,
349
+ k && console.log("SearchContext mounted on client");
350
+ }, [k]), ie(() => {
351
+ y((i) => ({
352
+ ...i,
353
353
  facetDebounceDelayMillis: f
354
354
  }));
355
355
  }, [f]);
356
- const [R, b] = X(null), [q] = X(n), V = ee((l, c = {}) => {
357
- if (!R)
356
+ const [j, m] = X(null), [D] = X(n), U = K((i, l = {}) => {
357
+ if (!j)
358
358
  throw new Error("No authentication token available");
359
- return fetch(l, {
360
- ...c,
359
+ return fetch(i, {
360
+ ...l,
361
361
  headers: {
362
- ...c.headers,
363
- Authorization: `Bearer ${R}`
362
+ ...l.headers,
363
+ Authorization: `Bearer ${j}`
364
364
  },
365
365
  credentials: "include"
366
366
  });
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
- query: l,
367
+ }, [j]), [G, Z] = X([]), [O, pe] = X([]), [P, R] = X([]), [B, ve] = X(!0), [he, h] = X({}), [E, e] = X({}), [a, b] = X({}), [F, ce] = X(""), [xe, A] = X(""), [se, be] = X({}), Ne = me(null), H = K((i) => {
368
+ y((l) => ({
369
+ ...l,
370
+ query: i,
371
371
  filters: {},
372
372
  rangeFilters: {},
373
373
  searchSettings: {
374
- ...c.searchSettings,
375
- maxNumberOfRecordsToReturn: y
374
+ ...l.searchSettings,
375
+ maxNumberOfRecordsToReturn: S
376
376
  }
377
377
  }));
378
- }, [y]), I = ee((l) => {
379
- j((c) => ({
380
- ...c,
381
- facetDebounceDelayMillis: l
378
+ }, [S]), $ = K((i) => {
379
+ y((l) => ({
380
+ ...l,
381
+ facetDebounceDelayMillis: i
382
382
  }));
383
- }, []), Y = ee((l) => {
384
- j((c) => ({
385
- ...c,
383
+ }, []), J = K((i) => {
384
+ y((l) => ({
385
+ ...l,
386
386
  searchSettings: {
387
- ...c.searchSettings,
388
- ...l,
387
+ ...l.searchSettings,
388
+ ...i,
389
389
  coverageSetup: {
390
- ...c.searchSettings.coverageSetup,
391
- ...l.coverageSetup || {}
390
+ ...l.searchSettings.coverageSetup,
391
+ ...i.coverageSetup || {}
392
392
  }
393
393
  }
394
394
  }));
395
- }, []), Te = ee((l) => {
396
- S.current = !0, j((c) => ({
397
- ...c,
395
+ }, []), Te = K((i) => {
396
+ x.current = !0, y((l) => ({
397
+ ...l,
398
398
  searchSettings: {
399
- ...c.searchSettings,
400
- maxNumberOfRecordsToReturn: l
399
+ ...l.searchSettings,
400
+ maxNumberOfRecordsToReturn: i
401
401
  }
402
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], {
403
+ }, []), _e = K((i, l) => {
404
+ y((C) => {
405
+ const _ = { ...C.filters }, I = _[i] || [], z = I.includes(l) ? I.filter((Q) => Q !== l) : [...I, l];
406
+ return z.length ? _[i] = z : delete _[i], {
407
407
  ...C,
408
408
  filters: _
409
409
  };
410
410
  });
411
- }, []), Ae = ee((l, c, C) => {
412
- j((_) => ({
411
+ }, []), Ae = K((i, l, C) => {
412
+ y((_) => ({
413
413
  ..._,
414
414
  rangeFilters: {
415
415
  ..._.rangeFilters,
416
- [l]: { min: c, max: C }
416
+ [i]: { min: l, max: C }
417
417
  }
418
418
  }));
419
- }, []), ze = ee(() => {
420
- j((l) => ({
421
- ...l,
419
+ }, []), ze = K(() => {
420
+ y((i) => ({
421
+ ...i,
422
422
  filters: {},
423
423
  rangeFilters: {}
424
424
  }));
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];
425
+ }, []), Le = K((i, l) => {
426
+ y((C) => {
427
+ const _ = { ...C.filters }, I = { ...C.rangeFilters };
428
+ if (l !== void 0) {
429
+ const Q = (_[i] || []).filter((de) => de !== l);
430
+ Q.length > 0 ? _[i] = Q : delete _[i];
431
431
  } else
432
- delete W[l];
432
+ delete I[i];
433
433
  return {
434
434
  ...C,
435
435
  filters: _,
436
- rangeFilters: W
436
+ rangeFilters: I
437
437
  };
438
438
  });
439
- }, []), dt = ee((l, c) => {
440
- j((C) => ({
439
+ }, []), dt = K((i, l) => {
440
+ y((C) => ({
441
441
  ...C,
442
- sortBy: l || void 0,
443
- sortAscending: l ? c : void 0
442
+ sortBy: i || void 0,
443
+ sortAscending: i ? l : void 0
444
444
  }));
445
- }, []), Ge = ee(async (l, c, C) => {
446
- if (l.length === 0) return null;
447
- if (l.length === 1) return l[0];
448
- let _ = l[0];
449
- for (let W = 1; W < l.length; W++) {
450
- const U = await V(`${c}/api/CombineFilters/${C}`, {
445
+ }, []), Ge = K(async (i, l, C) => {
446
+ if (i.length === 0) return null;
447
+ if (i.length === 1) return i[0];
448
+ let _ = i[0];
449
+ for (let I = 1; I < i.length; I++) {
450
+ const z = await U(`${l}/api/CombineFilters/${C}`, {
451
451
  // Combine the current filter with the next filter
452
452
  method: "PUT",
453
453
  headers: {
454
454
  "Content-Type": "application/json"
455
455
  },
456
- body: JSON.stringify({ A: _, B: l[W], useAndOperation: !0 })
456
+ body: JSON.stringify({ A: _, B: i[I], useAndOperation: !0 })
457
457
  });
458
- if (!U.ok) {
459
- const Z = await U.json();
460
- throw console.error("CombineFilters failed:", Z), new Error("CombineFilters failed");
458
+ if (!z.ok) {
459
+ const Q = await z.json();
460
+ throw console.error("CombineFilters failed:", Q), new Error("CombineFilters failed");
461
461
  }
462
- _ = await U.json();
462
+ _ = await z.json();
463
463
  }
464
464
  return _;
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(
479
- async ({ enableFacets: l }) => {
480
- if (!R) return;
481
- const c = ++B.current;
482
- j((C) => ({ ...C, isLoading: !0 }));
465
+ }, [U]), Ue = c.searchSettings.maxNumberOfRecordsToReturn, Xe = c.searchSettings.enableCoverage, Je = c.searchSettings.removeDuplicates, Qe = c.searchSettings.coverageDepth, Ye = c.searchSettings.minimumScore, $e = c.sortBy, Ie = c.sortAscending, Ze = Be(() => c.searchSettings.coverageSetup, [
466
+ c.searchSettings.coverageSetup.levenshteinMaxWordSize,
467
+ c.searchSettings.coverageSetup.minWordSize,
468
+ c.searchSettings.coverageSetup.coverageMinWordHitsAbs,
469
+ c.searchSettings.coverageSetup.coverageMinWordHitsRelative,
470
+ c.searchSettings.coverageSetup.coverageQLimitForErrorTolerance,
471
+ c.searchSettings.coverageSetup.coverageLcsErrorToleranceRelativeq,
472
+ c.searchSettings.coverageSetup.coverWholeQuery,
473
+ c.searchSettings.coverageSetup.coverWholeWords,
474
+ c.searchSettings.coverageSetup.coverFuzzyWords,
475
+ c.searchSettings.coverageSetup.coverJoinedWords,
476
+ c.searchSettings.coverageSetup.coverPrefixSuffix,
477
+ c.searchSettings.coverageSetup.truncate
478
+ ]), Ke = K(
479
+ async ({ enableFacets: i }) => {
480
+ if (!j) return;
481
+ const l = ++q.current;
482
+ y((C) => ({ ...C, isLoading: !0 }));
483
483
  try {
484
- const C = Object.entries(i.filters ?? {}), W = (await Promise.all(
484
+ const C = Object.entries(c.filters ?? {}), I = (await Promise.all(
485
485
  C.map(
486
- async ([D, K]) => Promise.all(
487
- K.map(
488
- (re) => V(`${s}/api/CreateValueFilter/${u}`, {
486
+ async ([W, Y]) => Promise.all(
487
+ Y.map(
488
+ (te) => U(`${s}/api/CreateValueFilter/${u}`, {
489
489
  method: "PUT",
490
490
  headers: {
491
491
  "Content-Type": "application/json"
492
492
  },
493
- body: JSON.stringify({ FieldName: D, Value: re })
494
- }).then((me) => me.json())
493
+ body: JSON.stringify({ FieldName: W, Value: te })
494
+ }).then((ge) => ge.json())
495
495
  )
496
496
  )
497
497
  )
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}`, {
498
+ )).flat(), z = Object.entries(c.rangeFilters ?? {}), Q = await Promise.all(
499
+ z.map(
500
+ ([W, { min: Y, max: te }]) => U(`${s}/api/CreateRangeFilter/${u}`, {
501
501
  method: "PUT",
502
502
  headers: {
503
503
  "Content-Type": "application/json"
504
504
  },
505
- body: JSON.stringify({ FieldName: D, LowerLimit: K, UpperLimit: re })
506
- }).then((me) => me.json())
505
+ body: JSON.stringify({ FieldName: W, LowerLimit: Y, UpperLimit: te })
506
+ }).then((ge) => ge.json())
507
507
  )
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,
508
+ ), de = [...I, ...Q].filter(
509
+ (W) => W && typeof W.hashString == "string"
510
+ ), oe = await Ge(de, s, u), je = v || c.query.trim() !== "", We = {
511
+ text: c.query,
512
512
  maxNumberOfRecordsToReturn: je ? Ue : 0,
513
- enableFacets: l,
513
+ enableFacets: i,
514
514
  ...oe ? { filter: oe } : {},
515
515
  ...$e ? { sortBy: $e } : {},
516
516
  ...Ie !== void 0 ? { sortAscending: Ie } : {},
@@ -519,62 +519,62 @@ const Qt = ({
519
519
  coverageDepth: Qe,
520
520
  coverageSetup: Ze
521
521
  };
522
- x && console.log("[performSearch] request body:", JSON.stringify(We, null, 2));
523
- const ke = await (await V(`${s}/api/Search/${u}`, {
522
+ k && console.log("[performSearch] request body:", JSON.stringify(We, null, 2));
523
+ const ke = await (await U(`${s}/api/Search/${u}`, {
524
524
  method: "POST",
525
525
  headers: {
526
526
  "Content-Type": "application/json"
527
527
  },
528
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);
529
+ })).json(), Ce = ke.truncationIndex ?? -1, we = ke.records || [], Re = we.map((W) => W.documentKey), N = we.map((W) => W.score);
530
530
  let ae = [];
531
- je && Re.length > 0 && (ae = (await (await V(`${s}/api/GetJson/${u}`, {
531
+ je && Re.length > 0 && (ae = (await (await U(`${s}/api/GetJson/${u}`, {
532
532
  method: "POST",
533
533
  headers: {
534
534
  "Content-Type": "application/json"
535
535
  },
536
536
  body: JSON.stringify(Re)
537
- })).json()).map((re, me) => ({
538
- document: re,
539
- documentKey: Re[me],
540
- score: N[me]
537
+ })).json()).map((te, ge) => ({
538
+ document: te,
539
+ documentKey: Re[ge],
540
+ score: N[ge]
541
541
  })));
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)
542
+ let fe = {};
543
+ if (i && ke.facets) {
544
+ for (const [W, Y] of Object.entries(ke.facets))
545
+ if (Array.isArray(Y) && Y.length > 0) {
546
+ const te = Y.map((ge) => Number(ge.key)).filter((ge) => !isNaN(ge));
547
+ te.length > 0 && (fe[W] = {
548
+ min: Math.min(...te),
549
+ max: Math.max(...te)
550
550
  });
551
551
  }
552
552
  }
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);
553
+ const Ve = c.query !== F, ht = c.query !== xe;
554
+ let De = c.facetStats ?? {};
555
+ if (Ve ? (De = { ...he, ...fe }, b(De), ce(c.query)) : De = { ...a, ...fe }, ht && i) {
556
+ const W = { ...se };
557
+ for (const [Y, te] of Object.entries(fe))
558
+ W[Y] = te;
559
+ be(W), A(c.query);
560
560
  }
561
561
  let Oe = ke.facets;
562
- if (l && (!Oe || Object.keys(Oe).length === 0)) {
562
+ if (i && (!Oe || Object.keys(Oe).length === 0)) {
563
563
  Oe = {};
564
- for (const [D, K] of Object.entries(M))
565
- Oe[D] = K.map((re) => ({ key: re, value: null }));
564
+ for (const [W, Y] of Object.entries(E))
565
+ Oe[W] = Y.map((te) => ({ key: te, value: null }));
566
566
  }
567
- if (c !== B.current)
567
+ if (l !== q.current)
568
568
  return;
569
- const ft = ae.filter((D) => {
570
- const K = i.query.trim();
571
- return K === "" || K.length === 1 ? !0 : D.score >= Ye;
569
+ const ft = ae.filter((W) => {
570
+ const Y = c.query.trim();
571
+ return Y === "" || Y.length === 1 ? !0 : W.score >= Ye;
572
572
  });
573
- j((D) => ({
574
- ...D,
573
+ y((W) => ({
574
+ ...W,
575
575
  results: ft,
576
576
  resultsSuppressed: !je,
577
- ...l ? {
577
+ ...i ? {
578
578
  facets: Oe,
579
579
  facetStats: De
580
580
  } : {},
@@ -582,9 +582,9 @@ const Qt = ({
582
582
  truncationIndex: Ce
583
583
  }));
584
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)
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)), l !== q.current)
586
586
  return;
587
- j((_) => ({
587
+ y((_) => ({
588
588
  ..._,
589
589
  results: null,
590
590
  isLoading: !1,
@@ -594,9 +594,9 @@ const Qt = ({
594
594
  }
595
595
  },
596
596
  [
597
- i.query,
598
- i.filters,
599
- i.rangeFilters,
597
+ c.query,
598
+ c.filters,
599
+ c.rangeFilters,
600
600
  $e,
601
601
  Ie,
602
602
  Ue,
@@ -605,78 +605,78 @@ const Qt = ({
605
605
  Qe,
606
606
  Ze,
607
607
  Ye,
608
- V,
608
+ U,
609
609
  Ge,
610
610
  s,
611
611
  u,
612
- m,
613
- R
612
+ v,
613
+ j
614
614
  ]
615
615
  );
616
616
  ie(() => {
617
- g.current = Ke;
618
- }, [Ke]), ee(() => {
619
- var l;
620
- x && console.log("Search fired"), (l = g.current) == null || l.call(g, { enableFacets: !1 });
617
+ p.current = Ke;
618
+ }, [Ke]), K(() => {
619
+ var i;
620
+ k && console.log("Search fired"), (i = p.current) == null || i.call(p, { enableFacets: !1 });
621
621
  }, []);
622
- const de = pe(null);
622
+ const ue = me(null);
623
623
  return ie(() => {
624
- var l;
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();
624
+ var i;
625
+ return (i = ue.current) == null || i.cancel(), ue.current = kt(() => {
626
+ var l;
627
+ k && console.log("Debounced searchWithFacets fired"), (l = p.current) == null || l.call(p, { enableFacets: !0 });
628
+ }, c.facetDebounceDelayMillis ?? 500), () => {
629
+ var l;
630
+ (l = ue.current) == null || l.cancel();
631
631
  };
632
- }, [i.facetDebounceDelayMillis]), ee(() => {
633
- var l;
634
- (l = de.current) == null || l.call(de);
632
+ }, [c.facetDebounceDelayMillis]), K(() => {
633
+ var i;
634
+ (i = ue.current) == null || i.call(ue);
635
635
  }, []), ie(() => {
636
- var 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;
642
- if (l === "" && !m) {
643
- i.resultsSuppressed || j((oe) => ({
636
+ var i;
637
+ !B && j && !T.current && (v && ((i = p.current) == null || i.call(p, { enableFacets: D })), T.current = !0);
638
+ }, [B, j, v, D]), ie(() => {
639
+ var _, I, z, Q, de;
640
+ if (!j || !T.current) return;
641
+ const i = c.query.trim(), l = i === "" && v;
642
+ if (i === "" && !v) {
643
+ c.resultsSuppressed || y((oe) => ({
644
644
  ...oe,
645
645
  resultsSuppressed: !0
646
646
  }));
647
647
  return;
648
648
  }
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 }), () => {
649
+ return l ? ((_ = ue.current) == null || _.cancel(), (I = p.current) == null || I.call(p, { enableFacets: D })) : D ? (k && console.log("Search fired"), (z = p.current) == null || z.call(p, { enableFacets: !1 }), (Q = ue.current) == null || Q.call(ue)) : (de = p.current) == null || de.call(p, { enableFacets: !1 }), () => {
650
650
  var oe;
651
- (oe = de.current) == null || oe.cancel();
651
+ (oe = ue.current) == null || oe.cancel();
652
652
  };
653
- }, [i.query, m, q]), ie(() => {
653
+ }, [c.query, v, D]), ie(() => {
654
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");
655
+ if (!T.current || !j) return;
656
+ if (!g.current) {
657
+ g.current = !0, k && console.log("[Filter effect] First run, skipping");
658
658
  return;
659
659
  }
660
- if (i.query !== E) {
661
- x && console.log("[Filter effect] Skipping because query changed");
660
+ if (c.query !== F) {
661
+ k && console.log("[Filter effect] Skipping because query changed");
662
662
  return;
663
663
  }
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(() => {
664
+ const i = c.query.trim();
665
+ D && !(!v && i === "") && (k && console.log("[Filter effect] Firing search"), (C = p.current) == null || C.call(p, { enableFacets: !0 }));
666
+ }, [c.filters, c.rangeFilters]), ie(() => {
667
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 }));
668
+ if (!T.current || !j) return;
669
+ const i = c.query.trim();
670
+ D && !(!v && i === "") && ((C = p.current) == null || C.call(p, { enableFacets: !0 }));
671
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(() => {
672
+ var i;
673
+ !T.current || !j || x.current && (x.current = !1, (i = p.current) == null || i.call(p, { enableFacets: !1 }));
674
+ }, [Ue, j]), ie(() => {
675
675
  (async () => {
676
676
  try {
677
- let c;
678
- if (J)
679
- x && console.log("[Auth] ✅ Using pre-authenticated token"), c = J;
677
+ let l;
678
+ if (ne)
679
+ k && console.log("[Auth] ✅ Using pre-authenticated token"), l = ne;
680
680
  else {
681
681
  if (!o || !d)
682
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.");
@@ -684,7 +684,7 @@ const Qt = ({
684
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.");
685
685
  if (!u)
686
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.");
687
- x && console.log("[Auth] 🔐 Logging in to get session token...");
687
+ k && console.log("[Auth] 🔐 Logging in to get session token...");
688
688
  const N = await fetch(`${s}/api/Login`, {
689
689
  method: "POST",
690
690
  headers: {
@@ -699,66 +699,66 @@ const Qt = ({
699
699
  });
700
700
  if (!N.ok)
701
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)
702
+ if (l = (await N.json()).token, !l)
703
703
  throw console.error("[Auth] ❌ No token received from login response"), new Error("No token received from login.");
704
- x && console.log("[Auth] ✅ Login successful, bearer token received (length:", c.length, ")");
704
+ k && console.log("[Auth] ✅ Login successful, bearer token received (length:", l.length, ")");
705
705
  }
706
- x && console.log("[Auth] 🔓 Opening dataset session...");
706
+ k && console.log("[Auth] 🔓 Opening dataset session...");
707
707
  const C = await fetch(`${s}/api/CreateOrOpen/${u}/400`, {
708
708
  method: "PUT",
709
709
  headers: {
710
710
  "Content-Type": "application/json",
711
- Authorization: `Bearer ${c}`
711
+ Authorization: `Bearer ${l}`
712
712
  },
713
713
  body: '""'
714
714
  });
715
715
  if (!C.ok)
716
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");
717
+ m(l), k && console.log("[Auth] ✅ Dataset session established");
718
718
  const _ = (N) => fetch(N, {
719
719
  method: "GET",
720
720
  headers: {
721
721
  accept: "text/plain",
722
- Authorization: `Bearer ${c}`
722
+ Authorization: `Bearer ${l}`
723
723
  },
724
724
  credentials: "include"
725
725
  });
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)
726
+ k && console.log("[Auth] 🔍 Checking dataset status...");
727
+ const I = await _(`${s}/api/GetStatus/${u}`);
728
+ if (!I.ok) {
729
+ if (I.status === 401)
730
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)
731
+ if (I.status === 404)
732
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.');
733
733
  {
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.");
734
+ const N = await I.text();
735
+ throw console.error("[Auth] ❌ Failed to get dataset status:", I.status, N), console.error("[Auth] 💡 Check if your INDX server is running at:", s), new Error("Failed to connect to INDX server. Check console for details.");
736
736
  }
737
737
  }
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([
738
+ const z = await I.json();
739
+ k && console.log("[Auth] 📊 Dataset status:", z), z.state && z.state !== "Ready" && (console.warn("[Auth] ⚠️ Dataset is not ready yet. Current state:", z.state), console.warn("[Auth] 💡 Wait for indexing to complete before searching"));
740
+ const Q = z.documentCount ?? z.numberOfRecords ?? 0;
741
+ Q === 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")) : k && console.log("[Auth] ✅ Dataset has", Q, "records");
742
+ const [de, oe, je] = await Promise.all([
743
743
  _(`${s}/api/GetFilterableFields/${u}`),
744
744
  _(`${s}/api/GetFacetableFields/${u}`),
745
745
  _(`${s}/api/GetSortableFields/${u}`)
746
746
  ]);
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.");
747
+ if (!de.ok)
748
+ throw console.error("[Auth] ❌ GetFilterableFields failed:", de.status, await de.text()), new Error("Failed to get filterable fields. Check console for details.");
749
749
  if (!oe.ok)
750
750
  throw console.error("[Auth] ❌ GetFacetableFields failed:", oe.status, await oe.text()), new Error("Failed to get facetable fields. Check console for details.");
751
751
  if (!je.ok)
752
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 || []);
753
+ const We = await de.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
+ Z(We || []), pe(et || []), R(ke || []);
755
755
  let Ce = { facets: {} };
756
756
  try {
757
757
  const N = await fetch(`${s}/api/Search/${u}`, {
758
758
  method: "POST",
759
759
  headers: {
760
760
  "Content-Type": "application/json",
761
- Authorization: `Bearer ${c}`
761
+ Authorization: `Bearer ${l}`
762
762
  },
763
763
  credentials: "include",
764
764
  body: JSON.stringify({ text: "", maxNumberOfRecordsToReturn: 0, enableFacets: !0 })
@@ -771,28 +771,28 @@ const Qt = ({
771
771
  if (Ce.facets) {
772
772
  for (const [N, ae] of Object.entries(Ce.facets))
773
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)
774
+ const fe = ae.map((Ve) => Number(Ve.key)).filter((Ve) => !isNaN(Ve));
775
+ fe.length > 0 && (we[N] = {
776
+ min: Math.min(...fe),
777
+ max: Math.max(...fe)
778
778
  });
779
779
  }
780
780
  }
781
781
  const Re = {};
782
782
  if (Ce.facets)
783
783
  for (const [N, ae] of Object.entries(Ce.facets))
784
- Array.isArray(ae) && (Re[N] = ae.map((ge) => ge.key));
784
+ Array.isArray(ae) && (Re[N] = ae.map((fe) => fe.key));
785
785
  Ne.current = {
786
786
  facets: Ce.facets,
787
787
  facetStats: we,
788
788
  facetKeys: Re
789
- }, h(we), e(Re), be(we), j((N) => ({
789
+ }, h(we), e(Re), be(we), y((N) => ({
790
790
  ...N,
791
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;
792
+ totalDocumentCount: Q
793
+ })), k && console.log("[Auth] ✅ Initialization complete");
794
+ } catch (l) {
795
+ throw console.error("[Auth] ❌ Initialization failed:", l), (l instanceof Error || typeof l == "object" && l !== null && "message" in l) && console.error("[Auth] 💡 Error:", l.message), l instanceof TypeError && l.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")), l;
796
796
  } finally {
797
797
  ve(!1);
798
798
  }
@@ -802,22 +802,22 @@ const Qt = ({
802
802
  {
803
803
  value: {
804
804
  state: {
805
- ...i,
806
- filterableFields: P,
805
+ ...c,
806
+ filterableFields: G,
807
807
  facetableFields: O,
808
- sortableFields: T,
808
+ sortableFields: P,
809
809
  rangeBounds: se
810
810
  },
811
- isFetchingInitial: L,
812
- allowEmptySearch: m,
813
- setQuery: $,
811
+ isFetchingInitial: B,
812
+ allowEmptySearch: v,
813
+ setQuery: H,
814
814
  toggleFilter: _e,
815
815
  setRangeFilter: Ae,
816
816
  resetFilters: ze,
817
817
  resetSingleFilter: Le,
818
818
  setSort: dt,
819
- setDebounceDelay: I,
820
- setSearchSettings: Y,
819
+ setDebounceDelay: $,
820
+ setSearchSettings: J,
821
821
  fetchMoreResults: Te
822
822
  },
823
823
  children: r
@@ -834,30 +834,30 @@ const Qt = ({
834
834
  inputSize: d = "default",
835
835
  showClear: s = !0,
836
836
  showFocus: u = !1,
837
- ...m
837
+ ...v
838
838
  }) => {
839
- const { state: { query: y, filters: f, rangeFilters: n, searchSettings: k }, setQuery: z } = Fe();
839
+ const { state: { query: S, filters: f, rangeFilters: n, searchSettings: w }, setQuery: V } = Fe();
840
840
  Object.keys(f).length > 0 || Object.keys(n).length > 0;
841
- const F = y.length > 0;
841
+ const M = S.length > 0;
842
842
  return /* @__PURE__ */ t.jsx(
843
843
  bt,
844
844
  {
845
845
  type: "text",
846
- value: y,
847
- onChange: (G) => z(G.target.value),
848
- placeholder: k.placeholderText,
846
+ value: S,
847
+ onChange: (L) => V(L.target.value),
848
+ placeholder: w.placeholderText,
849
849
  autoFocus: o,
850
850
  className: r,
851
851
  showSearchIcon: !0,
852
852
  inputSize: d,
853
853
  showFocusBorder: u,
854
- ...m,
855
- children: s && F && /* @__PURE__ */ t.jsx(
854
+ ...v,
855
+ children: s && M && /* @__PURE__ */ t.jsx(
856
856
  ye,
857
857
  {
858
858
  variant: "ghost",
859
859
  size: "micro",
860
- onClick: () => z(""),
860
+ onClick: () => V(""),
861
861
  "aria-label": "Clear search",
862
862
  children: "Clear"
863
863
  }
@@ -884,54 +884,54 @@ const Qt = ({
884
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
885
  }, Zt = ({ fields: r, resultsPerPage: o, children: d }) => {
886
886
  const {
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("");
887
+ state: { results: s, resultsSuppressed: u, searchSettings: v, truncationIndex: S, query: f },
888
+ isFetchingInitial: n,
889
+ fetchMoreResults: w
890
+ } = Fe(), V = o ?? 30, [M, L] = X(V), k = me(0), ne = me("");
891
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);
892
+ const T = f !== ne.current;
893
+ (!s || s.length < k.current || T) && L(V), k.current = (s == null ? void 0 : s.length) ?? 0, ne.current = f;
894
+ }, [s, V, f]);
895
+ const q = s && s.length > M, p = () => {
896
+ const T = M + V;
897
+ L(T), s && T >= s.length && (!S || S === -1 || S > s.length) && w(s.length + V);
898
898
  };
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;
899
+ return n || 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, M).map((T, g) => {
901
+ const x = T.document, c = T.score;
902
+ let y;
903
903
  try {
904
- q = typeof R == "string" ? JSON.parse(R) : R;
904
+ y = typeof x == "string" ? JSON.parse(x) : x;
905
905
  } catch {
906
- return /* @__PURE__ */ t.jsx("div", { className: Me.invalid, children: /* @__PURE__ */ t.jsx("p", { children: "Invalid JSON" }) }, j);
906
+ return /* @__PURE__ */ t.jsx("div", { className: Me.invalid, children: /* @__PURE__ */ t.jsx("p", { children: "Invalid JSON" }) }, g);
907
907
  }
908
- let V;
908
+ let j;
909
909
  if (r && r.length > 0) {
910
- V = {};
911
- for (const P of r)
912
- P in q && (V[P] = q[P]);
910
+ j = {};
911
+ for (const m of r)
912
+ m in y && (j[m] = y[m]);
913
913
  } else
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;
914
+ j = { ...y };
915
+ for (const m in j) {
916
+ const D = j[m];
917
+ if (typeof D == "string" && D.startsWith("[") && D.endsWith("]")) {
918
+ const G = D.replace(/^\[|\]$/g, "").split(",").map((Z) => Z.trim().replace(/^'|'$/g, "")).filter((Z) => Z.length > 0);
919
+ j[m] = G;
920
920
  }
921
921
  }
922
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);
923
+ /* @__PURE__ */ t.jsx("div", { className: Me.indexNumber, children: g }),
924
+ d(j),
925
+ v.showScore && /* @__PURE__ */ t.jsx("div", { className: Me.scoreNumber, children: c })
926
+ ] }, g);
927
927
  }) }),
928
- p && /* @__PURE__ */ t.jsx("div", { style: { textAlign: "center", marginTop: "20px" }, children: /* @__PURE__ */ t.jsx(
928
+ q && /* @__PURE__ */ t.jsx("div", { style: { textAlign: "center", marginTop: "20px" }, children: /* @__PURE__ */ t.jsx(
929
929
  ye,
930
930
  {
931
931
  variant: "secondary",
932
932
  size: "micro",
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"
933
+ onClick: p,
934
+ children: f.trim() === "" ? "Load more" : S !== -1 && S !== void 0 && S > 0 ? `Load results ${M + 1}-${Math.min(M + V, s.length, S)} of ${S}` : "Load more"
935
935
  }
936
936
  ) })
937
937
  ] });
@@ -945,30 +945,30 @@ const Qt = ({
945
945
  preserveBlankFacetState: d = !1,
946
946
  preserveBlankFacetStateOrder: s = !1,
947
947
  sortFacetsBy: u = "histogram",
948
- limit: m = 10,
949
- collapsible: y = !0,
948
+ limit: v = 10,
949
+ collapsible: S = !0,
950
950
  startCollapsed: f = !1,
951
951
  displayType: n = "checkbox",
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
952
+ layout: w = "list",
953
+ showActivePanel: V = !1,
954
+ showCount: M = !0,
955
+ showNull: L = !1,
956
+ displayIfEmptyQuery: k = !0,
957
+ displayCondition: ne = (q) => !0
958
958
  }) => {
959
959
  const {
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);
960
+ state: { facets: q, filterableFields: p, facetableFields: T, filters: g, query: x },
961
+ toggleFilter: c,
962
+ isFetchingInitial: y,
963
+ allowEmptySearch: j
964
+ } = Fe(), m = me(null), [D, U] = X(v);
965
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)
966
+ U(v);
967
+ }, [q == null ? void 0 : q[r], v]), !j && !x || y || !q || !ne({ query: x ?? "", filters: g, facets: q }) || !k && !x && Object.keys(g).length < 1)
968
968
  return null;
969
- if (!(g != null && g.includes(r)) || !(H != null && H.includes(r))) {
969
+ if (!(p != null && p.includes(r)) || !(T != null && T.includes(r))) {
970
970
  const h = [];
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: [
971
+ return p != null && p.includes(r) || h.push("filterable"), T != null && T.includes(r) || h.push("facetable"), /* @__PURE__ */ t.jsx(Se, { collapsible: !1, children: /* @__PURE__ */ t.jsxs("div", { style: { color: "red", fontSize: "12px" }, children: [
972
972
  'Cannot render filter for "',
973
973
  r,
974
974
  '": missing ',
@@ -976,27 +976,27 @@ const Qt = ({
976
976
  "."
977
977
  ] }) });
978
978
  }
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),
979
+ const G = q == null ? void 0 : q[r];
980
+ if (!G || !Array.isArray(G)) return null;
981
+ const Z = (g == null ? void 0 : g[r]) ?? [];
982
+ d && !m.current && G.length > 0 && (m.current = G.reduce(
983
+ (h, E) => (h[E.key] = E.value, h),
984
984
  {}
985
985
  ));
986
986
  const O = /* @__PURE__ */ new Map();
987
- d && b.current ? (Object.keys(b.current).forEach((h) => {
987
+ d && m.current ? (Object.keys(m.current).forEach((h) => {
988
988
  O.set(h, 0);
989
- }), P.forEach((h) => {
989
+ }), G.forEach((h) => {
990
990
  O.set(h.key, h.value);
991
- })) : P.forEach((h) => {
991
+ })) : G.forEach((h) => {
992
992
  O.set(h.key, h.value);
993
993
  });
994
- const ce = n === "toggle" && O.size === 2 && O.has("true") && (O.has("false") || O.has("null"));
994
+ const pe = n === "toggle" && O.size === 2 && O.has("true") && (O.has("false") || O.has("null"));
995
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");
996
+ const h = O.get("null") ?? 0, E = O.get("false") ?? 0;
997
+ O.set("false", (E ?? 0) + h), O.delete("null");
998
998
  }
999
- if (n === "toggle" && !ce)
999
+ if (n === "toggle" && !pe)
1000
1000
  return /* @__PURE__ */ t.jsx(Se, { collapsible: !1, children: /* @__PURE__ */ t.jsx("div", { className: Ee.count, children: /* @__PURE__ */ t.jsx(
1001
1001
  le,
1002
1002
  {
@@ -1007,62 +1007,62 @@ const Qt = ({
1007
1007
  disabled: !0
1008
1008
  }
1009
1009
  ) }) });
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}` : "";
1010
+ if (pe) {
1011
+ const h = O.get("true"), E = typeof h == "number" ? h : null, e = Z.includes("true"), a = E === 0, b = M && (E ?? 0) > 0 ? `${E}` : "";
1012
1012
  return /* @__PURE__ */ t.jsx(Se, { collapsible: !1, children: /* @__PURE__ */ t.jsxs("div", { className: Ee.count, children: [
1013
1013
  /* @__PURE__ */ t.jsx(
1014
1014
  le,
1015
1015
  {
1016
1016
  label: o,
1017
1017
  checked: e,
1018
- onChange: () => i(r, "true"),
1018
+ onChange: () => c(r, "true"),
1019
1019
  disabled: a
1020
1020
  }
1021
1021
  ),
1022
1022
  " ",
1023
- v
1023
+ b
1024
1024
  ] }) });
1025
1025
  }
1026
- let T = Array.from(O.entries());
1027
- if (G || (T = T.filter(([h]) => h !== "null")), T.length === 0 && !d)
1026
+ let P = Array.from(O.entries());
1027
+ if (L || (P = P.filter(([h]) => h !== "null")), P.length === 0 && !d)
1028
1028
  return null;
1029
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];
1030
+ const h = P.filter(([, e]) => typeof e == "number" && e > 0).sort(([e], [a]) => e.localeCompare(a)), E = P.filter(([, e]) => e === 0 || e === null).sort(([e], [a]) => e.localeCompare(a));
1031
+ P = [...h, ...E];
1032
1032
  } else if (u === "numeric") {
1033
- const h = (a, v) => {
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];
1033
+ const h = (a, b) => {
1034
+ const F = Number(a), ce = Number(b), xe = !isNaN(F), A = !isNaN(ce);
1035
+ return xe && A ? F - ce : a.localeCompare(b);
1036
+ }, E = P.filter(([, a]) => typeof a == "number" && a > 0).sort(([a], [b]) => h(a, b)), e = P.filter(([, a]) => a === 0 || a === null).sort(([a], [b]) => h(a, b));
1037
+ P = [...E, ...e];
1038
1038
  } else {
1039
- const h = T.filter(([, e]) => typeof e == "number" && e > 0), M = T.filter(([, e]) => e === 0 || e === null);
1040
- T = [...h, ...M];
1039
+ const h = P.filter(([, e]) => typeof e == "number" && e > 0), E = P.filter(([, e]) => e === 0 || e === null);
1040
+ P = [...h, ...E];
1041
1041
  }
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 : "";
1042
+ const R = typeof v == "number" && P.length > v, B = R ? P.slice(0, D) : P, ve = (h, E) => {
1043
+ const e = Z.includes(h), a = E === 0, b = M && (E ?? 0) > 0 ? ` (${E})` : "", F = M && (E ?? 0) > 0 ? E : "";
1044
1044
  switch (n) {
1045
1045
  case "button":
1046
- return k === "list" ? /* @__PURE__ */ t.jsxs("div", { className: Ee.count, children: [
1046
+ return w === "list" ? /* @__PURE__ */ t.jsxs("div", { className: Ee.count, children: [
1047
1047
  /* @__PURE__ */ t.jsx(
1048
1048
  ye,
1049
1049
  {
1050
1050
  variant: e ? "primary" : "secondary",
1051
- onClick: () => i(r, h),
1051
+ onClick: () => c(r, h),
1052
1052
  disabled: a,
1053
1053
  size: "micro",
1054
1054
  children: h
1055
1055
  }
1056
1056
  ),
1057
- /* @__PURE__ */ t.jsx("span", { children: E })
1057
+ /* @__PURE__ */ t.jsx("span", { children: F })
1058
1058
  ] }) : /* @__PURE__ */ t.jsx(
1059
1059
  ye,
1060
1060
  {
1061
1061
  variant: e ? "primary" : "secondary",
1062
- onClick: () => i(r, h),
1062
+ onClick: () => c(r, h),
1063
1063
  disabled: a,
1064
1064
  size: "micro",
1065
- children: `${h}${v}`
1065
+ children: `${h}${b}`
1066
1066
  }
1067
1067
  );
1068
1068
  case "toggle":
@@ -1071,58 +1071,58 @@ const Qt = ({
1071
1071
  {
1072
1072
  label: h,
1073
1073
  checked: e,
1074
- onChange: () => i(r, h),
1074
+ onChange: () => c(r, h),
1075
1075
  disabled: a
1076
1076
  }
1077
1077
  );
1078
1078
  case "checkbox":
1079
1079
  default:
1080
- return k === "list" ? /* @__PURE__ */ t.jsxs("div", { className: Ee.count, children: [
1080
+ return w === "list" ? /* @__PURE__ */ t.jsxs("div", { className: Ee.count, children: [
1081
1081
  /* @__PURE__ */ t.jsx(
1082
1082
  rt,
1083
1083
  {
1084
1084
  label: h,
1085
1085
  score: "",
1086
1086
  checked: e,
1087
- onChange: () => i(r, h),
1087
+ onChange: () => c(r, h),
1088
1088
  disabled: a
1089
1089
  }
1090
1090
  ),
1091
- /* @__PURE__ */ t.jsx("span", { children: E })
1091
+ /* @__PURE__ */ t.jsx("span", { children: F })
1092
1092
  ] }) : /* @__PURE__ */ t.jsx(
1093
1093
  rt,
1094
1094
  {
1095
1095
  label: h,
1096
- score: v,
1096
+ score: b,
1097
1097
  checked: e,
1098
- onChange: () => i(r, h),
1098
+ onChange: () => c(r, h),
1099
1099
  disabled: a
1100
1100
  }
1101
1101
  );
1102
1102
  }
1103
- }, fe = y ? f : !1;
1103
+ }, he = S ? f : !1;
1104
1104
  return /* @__PURE__ */ t.jsx(
1105
1105
  Se,
1106
1106
  {
1107
1107
  title: o,
1108
- collapsible: y,
1109
- collapsed: fe,
1108
+ collapsible: S,
1109
+ collapsed: he,
1110
1110
  children: /* @__PURE__ */ t.jsxs(
1111
1111
  "ul",
1112
1112
  {
1113
- className: k === "grid" ? Ee.grid : Ee.list,
1113
+ className: w === "grid" ? Ee.grid : Ee.list,
1114
1114
  style: { listStyle: "none", padding: 0, margin: 0 },
1115
1115
  children: [
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);
1116
+ B.map(([h, E]) => /* @__PURE__ */ t.jsx("li", { children: ve(h, E) }, h)),
1117
+ R && D < P.length && (() => {
1118
+ const h = P.length - D, E = Math.min(50, h);
1119
1119
  return /* @__PURE__ */ t.jsx("li", { className: Ee.toggleItem, children: /* @__PURE__ */ t.jsx(
1120
1120
  ye,
1121
1121
  {
1122
1122
  variant: "ghost",
1123
1123
  size: "micro",
1124
- onClick: () => V((e) => e + 50),
1125
- children: `Show ${M} more of ${T.length} total`
1124
+ onClick: () => U((e) => e + 50),
1125
+ children: `Show ${E} more of ${P.length} total`
1126
1126
  }
1127
1127
  ) });
1128
1128
  })()
@@ -1139,89 +1139,90 @@ const Qt = ({
1139
1139
  expectedMin: d = 0,
1140
1140
  expectedMax: s = 1e3,
1141
1141
  displayType: u = "input",
1142
- collapsible: m = !0,
1143
- startCollapsed: y = !1
1142
+ collapsible: v = !0,
1143
+ startCollapsed: S = !1
1144
1144
  }) => {
1145
1145
  const {
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,
1146
+ state: { rangeFilters: f, rangeBounds: n, facetStats: w, query: V, facetDebounceDelayMillis: M },
1147
+ setRangeFilter: L,
1148
+ resetSingleFilter: k,
1149
+ allowEmptySearch: ne,
1150
+ isFetchingInitial: q
1151
+ } = Fe(), p = (n == null ? void 0 : n[r]) !== void 0, T = (n == null ? void 0 : n[r]) ?? { min: d, max: s }, g = T.min, x = T.max, c = (w == null ? void 0 : w[r]) ?? T, y = c.min, j = c.max, m = p && g === x, D = m ? d : g, U = m ? s : x, G = f == null ? void 0 : f[r], Z = G ? G.min : g, O = G ? G.max : x, pe = G !== void 0, P = y !== g || j !== x, [R, B] = re.useState([
1152
+ Z,
1153
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;
1154
+ ]), [ve, he] = re.useState(!1), [h, E] = re.useState(!1), { finalMin: e, finalMax: a, isValidMin: b, isValidMax: F } = re.useMemo(() => {
1155
+ const [H, $] = R, J = Math.max(g, Math.min(x, H)), Te = Math.max(g, Math.min(x, $)), _e = Math.min(J, Te), Ae = Math.max(J, Te), ze = _e >= g && _e < Ae, Le = Ae <= x && Ae > _e;
1156
1156
  return { finalMin: _e, finalMax: Ae, isValidMin: ze, isValidMax: Le };
1157
- }, [w, p, S]);
1158
- ne.useEffect(() => {
1159
- if (b)
1157
+ }, [R, g, x]);
1158
+ re.useEffect(() => {
1159
+ if (m)
1160
1160
  return;
1161
- if (w[0] === p && w[1] === S) {
1162
- fe(!1), M(!1);
1161
+ if (R[0] === g && R[1] === x) {
1162
+ he(!1), E(!1);
1163
1163
  return;
1164
1164
  }
1165
- const I = F ?? 500, Y = setTimeout(() => {
1166
- fe(!v), M(!E);
1165
+ const $ = M ?? 500, J = setTimeout(() => {
1166
+ he(!b), E(!F);
1167
1167
  }, 300), Te = setTimeout(() => {
1168
- v && E && (e === p && a === S ? x(r) : G(r, e, a));
1169
- }, I);
1168
+ b && F && (e === g && a === x ? k(r) : L(r, e, a));
1169
+ }, $);
1170
1170
  return () => {
1171
- clearTimeout(Y), clearTimeout(Te);
1171
+ clearTimeout(J), clearTimeout(Te);
1172
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
+ }, [e, a, b, F, g, x, r, k, L, M, m]), re.useEffect(() => {
1174
+ B([Z, O]), he(!1), E(!1);
1175
+ }, [Z, O, r]);
1176
+ const ce = re.useCallback((H) => {
1177
+ if (m) return;
1178
+ const $ = Math.max(g, Math.min(j, H[0])), J = Math.max(y, Math.min(x, H[1]));
1179
+ B([$, J]);
1180
+ }, [m, g, x, y, j]), xe = re.useCallback((H) => {
1181
+ if (m) return;
1182
+ const $ = Math.max(g, Math.min(j, H[0])), J = Math.max(y, Math.min(x, H[1]));
1183
+ $ === g && J === x ? (B([g, x]), k(r)) : B([$, J]);
1184
+ }, [m, g, x, y, j, r, k]), A = re.useCallback((H) => {
1185
+ if (m) return;
1186
+ const $ = Number(H.target.value);
1187
+ if (!isNaN($)) {
1188
+ const J = Math.max(g, Math.min(j, $));
1189
+ B([J, R[1]]);
1190
1190
  }
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]);
1191
+ }, [m, R, g, j]), se = re.useCallback((H) => {
1192
+ if (m) return;
1193
+ const $ = Number(H.target.value);
1194
+ if (!isNaN($)) {
1195
+ const J = Math.max(y, Math.min(x, $));
1196
+ B([R[0], J]);
1197
1197
  }
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: [
1198
+ }, [m, R, y, x]), be = re.useCallback(() => {
1199
+ const H = R[0], $ = Math.max(g, Math.min(j, H));
1200
+ $ < R[1] ? B([$, R[1]]) : B([g, R[1]]);
1201
+ }, [R, g, j]), Ne = re.useCallback(() => {
1202
+ const H = R[1], $ = Math.max(y, Math.min(x, H));
1203
+ $ > R[0] ? B([R[0], $]) : B([R[0], x]);
1204
+ }, [R, y, x]);
1205
+ return q || !ne && !V ? null : u === "slider" ? /* @__PURE__ */ t.jsxs(Se, { title: o, collapsed: S, collapsible: v, children: [
1206
+ m && /* @__PURE__ */ t.jsxs("div", { className: at.disabledMessage, children: [
1207
1207
  "No adjustable range (all results have the same value: ",
1208
- p,
1208
+ g,
1209
1209
  ")."
1210
1210
  ] }),
1211
1211
  /* @__PURE__ */ t.jsx("div", { style: { padding: "10px 10px 20px 10px" }, children: /* @__PURE__ */ t.jsx(
1212
1212
  lt,
1213
1213
  {
1214
- min: q,
1215
- max: V,
1216
- value: b ? [q, V] : [e, a],
1214
+ min: D,
1215
+ max: U,
1216
+ value: m ? [D, U] : [e, a],
1217
1217
  isRange: !0,
1218
- onChange: ($) => ue($),
1219
- onFinalChange: ($) => xe($),
1220
- disabled: b,
1221
- activeMin: j,
1222
- activeMax: R,
1223
- isFaceted: T,
1224
- highlightFaceted: ce
1218
+ onChange: (H) => ce(H),
1219
+ onFinalChange: (H) => xe(H),
1220
+ disabled: m,
1221
+ activeMin: y,
1222
+ activeMax: j,
1223
+ isFaceted: P,
1224
+ highlightFaceted: pe,
1225
+ "aria-label": o || `Filter by ${r}`
1225
1226
  }
1226
1227
  ) }),
1227
1228
  /* @__PURE__ */ t.jsxs(
@@ -1236,69 +1237,69 @@ const Qt = ({
1236
1237
  },
1237
1238
  children: [
1238
1239
  /* @__PURE__ */ t.jsx(
1239
- te,
1240
+ ee,
1240
1241
  {
1241
1242
  label: "Min:",
1242
1243
  type: "number",
1243
- value: b ? p : w[0],
1244
- min: p,
1245
- max: Math.min(R, w[1] - 1),
1244
+ value: m ? g : R[0],
1245
+ min: g,
1246
+ max: Math.min(j, R[1] - 1),
1246
1247
  onChange: A,
1247
1248
  onBlur: be,
1248
- disabled: b,
1249
- isValid: b || !ve
1249
+ disabled: m,
1250
+ isValid: m || !ve
1250
1251
  }
1251
1252
  ),
1252
1253
  /* @__PURE__ */ t.jsx(
1253
- te,
1254
+ ee,
1254
1255
  {
1255
1256
  label: "Max:",
1256
1257
  type: "number",
1257
- value: b ? S : w[1],
1258
- min: Math.max(j, w[0] + 1),
1259
- max: S,
1258
+ value: m ? x : R[1],
1259
+ min: Math.max(y, R[0] + 1),
1260
+ max: x,
1260
1261
  onChange: se,
1261
1262
  onBlur: Ne,
1262
- disabled: b,
1263
- isValid: b || !h
1263
+ disabled: m,
1264
+ isValid: m || !h
1264
1265
  }
1265
1266
  )
1266
1267
  ]
1267
1268
  }
1268
1269
  )
1269
1270
  ] }) : /* @__PURE__ */ t.jsxs(Se, { title: o, children: [
1270
- b && /* @__PURE__ */ t.jsxs("div", { className: at.disabledMessage, children: [
1271
+ m && /* @__PURE__ */ t.jsxs("div", { className: at.disabledMessage, children: [
1271
1272
  "No adjustable range (all results have the same value: ",
1272
- p,
1273
+ g,
1273
1274
  ")."
1274
1275
  ] }),
1275
1276
  /* @__PURE__ */ t.jsxs("div", { style: { display: "flex", gap: "10px", alignItems: "flex-start" }, children: [
1276
1277
  /* @__PURE__ */ t.jsx(
1277
- te,
1278
+ ee,
1278
1279
  {
1279
1280
  label: "Min:",
1280
1281
  type: "number",
1281
- value: b ? p : w[0],
1282
- min: p,
1283
- max: Math.min(R, w[1] - 1),
1282
+ value: m ? g : R[0],
1283
+ min: g,
1284
+ max: Math.min(j, R[1] - 1),
1284
1285
  onChange: A,
1285
1286
  onBlur: be,
1286
- disabled: b,
1287
- isValid: b || !ve
1287
+ disabled: m,
1288
+ isValid: m || !ve
1288
1289
  }
1289
1290
  ),
1290
1291
  /* @__PURE__ */ t.jsx(
1291
- te,
1292
+ ee,
1292
1293
  {
1293
1294
  label: "Max:",
1294
1295
  type: "number",
1295
- value: b ? S : w[1],
1296
- min: Math.max(j, w[0] + 1),
1297
- max: S,
1296
+ value: m ? x : R[1],
1297
+ min: Math.max(y, R[0] + 1),
1298
+ max: x,
1298
1299
  onChange: se,
1299
1300
  onBlur: Ne,
1300
- disabled: b,
1301
- isValid: b || !h
1301
+ disabled: m,
1302
+ isValid: m || !h
1302
1303
  }
1303
1304
  )
1304
1305
  ] })
@@ -1341,11 +1342,11 @@ function tr() {
1341
1342
  resetSingleFilter: s
1342
1343
  } = Fe(), u = Be(
1343
1344
  () => Object.entries(r).map(
1344
- ([f, n]) => n.map((k) => ({ field: f, value: k }))
1345
+ ([f, n]) => n.map((w) => ({ field: f, value: w }))
1345
1346
  ).flat(),
1346
1347
  [r]
1347
- ), m = Be(
1348
- () => Object.entries(o).map(([f, { min: n, max: k }]) => ({ field: f, min: n, max: k })),
1348
+ ), v = Be(
1349
+ () => Object.entries(o).map(([f, { min: n, max: w }]) => ({ field: f, min: n, max: w })),
1349
1350
  [o]
1350
1351
  );
1351
1352
  return Be(
@@ -1361,12 +1362,12 @@ function tr() {
1361
1362
  },
1362
1363
  `${f}-${n}`
1363
1364
  )),
1364
- m.map(({ field: f, min: n, max: k }) => /* @__PURE__ */ t.jsx(
1365
+ v.map(({ field: f, min: n, max: w }) => /* @__PURE__ */ t.jsx(
1365
1366
  Dt,
1366
1367
  {
1367
1368
  field: f,
1368
1369
  min: n,
1369
- max: k,
1370
+ max: w,
1370
1371
  onReset: () => s(f)
1371
1372
  },
1372
1373
  f
@@ -1386,49 +1387,49 @@ const qt = "_radioGroup_nwf7i_6", Bt = {
1386
1387
  radioGroup: qt
1387
1388
  }, rr = ({ displayType: r = "dropdown", collapsible: o = !0, startCollapsed: d = !1 }) => {
1388
1389
  const {
1389
- state: { sortableFields: s, sortBy: u, sortAscending: m },
1390
- setSort: y
1390
+ state: { sortableFields: s, sortBy: u, sortAscending: v },
1391
+ setSort: S
1391
1392
  } = Fe();
1392
1393
  if (!s || s.length === 0) return null;
1393
- const f = u ? `${u}:${m ? "asc" : "desc"}` : "none", n = [
1394
+ const f = u ? `${u}:${v ? "asc" : "desc"}` : "none", n = [
1394
1395
  { label: "None", value: "none" },
1395
- ...s.flatMap((F) => [
1396
- { label: `${F} (asc)`, value: `${F}:asc` },
1397
- { label: `${F} (desc)`, value: `${F}:desc` }
1396
+ ...s.flatMap((M) => [
1397
+ { label: `${M} (asc)`, value: `${M}:asc` },
1398
+ { label: `${M} (desc)`, value: `${M}:desc` }
1398
1399
  ])
1399
- ], k = (F) => {
1400
- if (F === "none" || F === "")
1401
- y(null, !0);
1400
+ ], w = (M) => {
1401
+ if (M === "none" || M === "")
1402
+ S(null, !0);
1402
1403
  else {
1403
- const [G, x] = F.split(":");
1404
- y(G, x === "asc");
1404
+ const [L, k] = M.split(":");
1405
+ S(L, k === "asc");
1405
1406
  }
1406
- }, z = o ? d : !1;
1407
+ }, V = o ? d : !1;
1407
1408
  return /* @__PURE__ */ t.jsx(
1408
1409
  Se,
1409
1410
  {
1410
1411
  title: "Sort by",
1411
1412
  collapsible: o,
1412
- collapsed: z,
1413
+ collapsed: V,
1413
1414
  children: r === "dropdown" ? /* @__PURE__ */ t.jsx(
1414
1415
  St,
1415
1416
  {
1416
1417
  value: f,
1417
- onValueChange: k,
1418
+ onValueChange: w,
1418
1419
  options: n,
1419
1420
  placeholder: "Select sort..."
1420
1421
  }
1421
- ) : /* @__PURE__ */ t.jsx("div", { className: Bt.radioGroup, children: n.map((F) => /* @__PURE__ */ t.jsx(
1422
+ ) : /* @__PURE__ */ t.jsx("div", { className: Bt.radioGroup, children: n.map((M) => /* @__PURE__ */ t.jsx(
1422
1423
  yt,
1423
1424
  {
1424
- id: `sort-${F.value}`,
1425
+ id: `sort-${M.value}`,
1425
1426
  name: "sort-by",
1426
- value: F.value,
1427
- label: F.label,
1428
- checked: f === F.value,
1429
- onChange: (G) => k(G.target.value)
1427
+ value: M.value,
1428
+ label: M.label,
1429
+ checked: f === M.value,
1430
+ onChange: (L) => w(L.target.value)
1430
1431
  },
1431
- F.value
1432
+ M.value
1432
1433
  )) })
1433
1434
  }
1434
1435
  );
@@ -1439,34 +1440,34 @@ function nr() {
1439
1440
  const {
1440
1441
  state: { searchSettings: r },
1441
1442
  setSearchSettings: o
1442
- } = Fe(), [d, s] = X(!1), u = (n, k) => {
1443
- const z = parseInt(k, 10);
1444
- isNaN(z) || o({
1445
- [n]: z
1443
+ } = Fe(), [d, s] = X(!1), u = (n, w) => {
1444
+ const V = parseInt(w, 10);
1445
+ isNaN(V) || o({
1446
+ [n]: V
1446
1447
  });
1447
- }, m = (n, k) => {
1448
+ }, v = (n, w) => {
1448
1449
  o({
1449
- [n]: k
1450
+ [n]: w
1450
1451
  });
1451
- }, y = (n, k) => {
1452
- const z = parseInt(k, 10);
1453
- isNaN(z) || o({
1452
+ }, S = (n, w) => {
1453
+ const V = parseInt(w, 10);
1454
+ isNaN(V) || o({
1454
1455
  coverageSetup: {
1455
1456
  ...r.coverageSetup,
1456
- [n]: z
1457
+ [n]: V
1457
1458
  }
1458
1459
  });
1459
- }, f = (n, k) => {
1460
+ }, f = (n, w) => {
1460
1461
  o({
1461
1462
  coverageSetup: {
1462
1463
  ...r.coverageSetup,
1463
- [n]: k
1464
+ [n]: w
1464
1465
  }
1465
1466
  });
1466
1467
  };
1467
1468
  return /* @__PURE__ */ t.jsx(Se, { collapsed: !0, title: "Settings", children: /* @__PURE__ */ t.jsxs("ul", { className: Lt.list, children: [
1468
1469
  /* @__PURE__ */ t.jsx("li", { children: /* @__PURE__ */ t.jsx(
1469
- te,
1470
+ ee,
1470
1471
  {
1471
1472
  label: "Max Results",
1472
1473
  type: "number",
@@ -1475,7 +1476,7 @@ function nr() {
1475
1476
  }
1476
1477
  ) }),
1477
1478
  /* @__PURE__ */ t.jsx("li", { children: /* @__PURE__ */ t.jsx(
1478
- te,
1479
+ ee,
1479
1480
  {
1480
1481
  label: "Coverage Depth",
1481
1482
  type: "number",
@@ -1485,14 +1486,14 @@ function nr() {
1485
1486
  ) }),
1486
1487
  /* @__PURE__ */ t.jsxs("li", { children: [
1487
1488
  /* @__PURE__ */ t.jsx(
1488
- te,
1489
+ ee,
1489
1490
  {
1490
1491
  label: "Minimum Score",
1491
1492
  type: "number",
1492
1493
  value: r.minimumScore.toString(),
1493
1494
  onChange: (n) => {
1494
- const k = parseFloat(n.target.value);
1495
- isNaN(k) || o({ minimumScore: k });
1495
+ const w = parseFloat(n.target.value);
1496
+ isNaN(w) || o({ minimumScore: w });
1496
1497
  }
1497
1498
  }
1498
1499
  ),
@@ -1505,12 +1506,13 @@ function nr() {
1505
1506
  value: r.minimumScore,
1506
1507
  onChange: (n) => {
1507
1508
  o({ minimumScore: n });
1508
- }
1509
+ },
1510
+ "aria-label": "Minimum score"
1509
1511
  }
1510
1512
  ) })
1511
1513
  ] }),
1512
1514
  /* @__PURE__ */ t.jsx("li", { children: /* @__PURE__ */ t.jsx(
1513
- te,
1515
+ ee,
1514
1516
  {
1515
1517
  label: "Placeholder text",
1516
1518
  type: "text",
@@ -1525,7 +1527,7 @@ function nr() {
1525
1527
  {
1526
1528
  label: "Show score",
1527
1529
  checked: r.showScore,
1528
- onChange: (n) => m("showScore", n)
1530
+ onChange: (n) => v("showScore", n)
1529
1531
  }
1530
1532
  ) }),
1531
1533
  /* @__PURE__ */ t.jsx("li", { children: /* @__PURE__ */ t.jsx(
@@ -1533,7 +1535,7 @@ function nr() {
1533
1535
  {
1534
1536
  label: "Enable Coverage",
1535
1537
  checked: r.enableCoverage,
1536
- onChange: (n) => m("enableCoverage", n)
1538
+ onChange: (n) => v("enableCoverage", n)
1537
1539
  }
1538
1540
  ) }),
1539
1541
  /* @__PURE__ */ t.jsx("li", { children: /* @__PURE__ */ t.jsx(
@@ -1541,7 +1543,7 @@ function nr() {
1541
1543
  {
1542
1544
  label: "Remove Duplicates",
1543
1545
  checked: r.removeDuplicates,
1544
- onChange: (n) => m("removeDuplicates", n)
1546
+ onChange: (n) => v("removeDuplicates", n)
1545
1547
  }
1546
1548
  ) }),
1547
1549
  /* @__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" }) }),
@@ -1595,57 +1597,57 @@ function nr() {
1595
1597
  }
1596
1598
  ) }),
1597
1599
  /* @__PURE__ */ t.jsx("li", { children: /* @__PURE__ */ t.jsx(
1598
- te,
1600
+ ee,
1599
1601
  {
1600
1602
  label: "Levenshtein Max Word Size",
1601
1603
  type: "number",
1602
1604
  value: r.coverageSetup.levenshteinMaxWordSize.toString(),
1603
- onChange: (n) => y("levenshteinMaxWordSize", n.target.value)
1605
+ onChange: (n) => S("levenshteinMaxWordSize", n.target.value)
1604
1606
  }
1605
1607
  ) }),
1606
1608
  /* @__PURE__ */ t.jsx("li", { children: /* @__PURE__ */ t.jsx(
1607
- te,
1609
+ ee,
1608
1610
  {
1609
1611
  label: "Min Word Size",
1610
1612
  type: "number",
1611
1613
  value: r.coverageSetup.minWordSize.toString(),
1612
- onChange: (n) => y("minWordSize", n.target.value)
1614
+ onChange: (n) => S("minWordSize", n.target.value)
1613
1615
  }
1614
1616
  ) }),
1615
1617
  /* @__PURE__ */ t.jsx("li", { children: /* @__PURE__ */ t.jsx(
1616
- te,
1618
+ ee,
1617
1619
  {
1618
1620
  label: "Coverage Min Word Hits Abs",
1619
1621
  type: "number",
1620
1622
  value: r.coverageSetup.coverageMinWordHitsAbs.toString(),
1621
- onChange: (n) => y("coverageMinWordHitsAbs", n.target.value)
1623
+ onChange: (n) => S("coverageMinWordHitsAbs", n.target.value)
1622
1624
  }
1623
1625
  ) }),
1624
1626
  /* @__PURE__ */ t.jsx("li", { children: /* @__PURE__ */ t.jsx(
1625
- te,
1627
+ ee,
1626
1628
  {
1627
1629
  label: "Coverage Min Word Hits Relative",
1628
1630
  type: "number",
1629
1631
  value: r.coverageSetup.coverageMinWordHitsRelative.toString(),
1630
- onChange: (n) => y("coverageMinWordHitsRelative", n.target.value)
1632
+ onChange: (n) => S("coverageMinWordHitsRelative", n.target.value)
1631
1633
  }
1632
1634
  ) }),
1633
1635
  /* @__PURE__ */ t.jsx("li", { children: /* @__PURE__ */ t.jsx(
1634
- te,
1636
+ ee,
1635
1637
  {
1636
1638
  label: "Coverage Q Limit For Error Tolerance",
1637
1639
  type: "number",
1638
1640
  value: r.coverageSetup.coverageQLimitForErrorTolerance.toString(),
1639
- onChange: (n) => y("coverageQLimitForErrorTolerance", n.target.value)
1641
+ onChange: (n) => S("coverageQLimitForErrorTolerance", n.target.value)
1640
1642
  }
1641
1643
  ) }),
1642
1644
  /* @__PURE__ */ t.jsx("li", { children: /* @__PURE__ */ t.jsx(
1643
- te,
1645
+ ee,
1644
1646
  {
1645
1647
  label: "Coverage LCS Error Tolerance Relative Q",
1646
1648
  type: "number",
1647
1649
  value: r.coverageSetup.coverageLcsErrorToleranceRelativeq.toString(),
1648
- onChange: (n) => y("coverageLcsErrorToleranceRelativeq", n.target.value)
1650
+ onChange: (n) => S("coverageLcsErrorToleranceRelativeq", n.target.value)
1649
1651
  }
1650
1652
  ) })
1651
1653
  ] })