@sinequa/atomic 2.0.4 → 2.0.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -156,23 +156,23 @@ function ne(e, t) {
156
156
  function re(e, t, n) {
157
157
  return e.valuesAreExpressions ? t.display === n.display : t.value === n.value;
158
158
  }
159
- function f(e) {
160
- return e.items &&= e.items.map((e) => f(e)), e.items && e.items.some((e) => e.$selected || e.$opened) && (e.$opened = !0), e;
159
+ function ie(e) {
160
+ return e.items &&= e.items.map((e) => ie(e)), e.items && e.items.some((e) => e.$selected || e.$opened) && (e.$opened = !0), e;
161
161
  }
162
- function ie(e, t) {
162
+ function ae(e, t) {
163
163
  let n = [];
164
164
  if (e.length > 0) {
165
165
  let r = /* @__PURE__ */ new Map(), i = t.replace(/[.*+?^${}()|[\]\\]/g, "\\$&").normalize("NFD").replace(/[\u0300-\u036f]/g, ""), a = RegExp("\\b" + i, "i");
166
166
  e.forEach((e) => {
167
167
  if (e.display.length > 1) {
168
168
  let i = e.display.normalize("NFD").replace(/[\u0300-\u036f]/g, ""), o = a.exec(i);
169
- ae(n, r, "/", e.display, +(e.frequency || 0), 1, (o?.index || 0) + t.length);
169
+ f(n, r, "/", e.display, +(e.frequency || 0), 1, (o?.index || 0) + t.length);
170
170
  }
171
171
  });
172
172
  }
173
173
  return n;
174
174
  }
175
- function ae(e, t, n, r, i, a, o) {
175
+ function f(e, t, n, r, i, a, o) {
176
176
  let s = r.indexOf("/", n.length), c = r.substring(0, s + 1), l = t.get(c);
177
177
  if (!l) {
178
178
  let u = c.replace(/^\/|\/$/g, "");
@@ -186,7 +186,7 @@ function ae(e, t, n, r, i, a, o) {
186
186
  $path: u
187
187
  }, t.set(c, l), e.push(l);
188
188
  }
189
- c.length < r.length && (l.hasChildren = !0, ae(l.items, t, c, r, i, a + 1, o));
189
+ c.length < r.length && (l.hasChildren = !0, f(l.items, t, c, r, i, a + 1, o));
190
190
  }
191
191
  //#endregion
192
192
  //#region src/utils/bisect.ts
@@ -198,8 +198,8 @@ function oe(e, t) {
198
198
  }
199
199
  //#endregion
200
200
  //#region src/utils/concepts.ts
201
- var se = /(([\+\-])?\(([^\)]+)\))|(([\+\-])?\[([^\]]+)\])|(([\+\-])?\"([^\"]+)\")|(([\+\-])?\/([^\/]+)\/)|(([\+\-])?(\S+))/g, ce = 2, le = 3, ue = 5, de = 6, fe = 8, p = 9, pe = 11, me = 12, he = 14, ge = 15;
202
- function m(e) {
201
+ var se = /(([\+\-])?\(([^\)]+)\))|(([\+\-])?\[([^\]]+)\])|(([\+\-])?\"([^\"]+)\")|(([\+\-])?\/([^\/]+)\/)|(([\+\-])?(\S+))/g, ce = 2, le = 3, ue = 5, de = 6, fe = 8, pe = 9, me = 11, he = 12, ge = 14, _e = 15;
202
+ function p(e) {
203
203
  if (!e) return [];
204
204
  let t = [], n = e.matchAll(se);
205
205
  for (let e of n) e[le] ? t.push({
@@ -210,22 +210,22 @@ function m(e) {
210
210
  type: "adjacent",
211
211
  value: e[de],
212
212
  op: e[ue]
213
- }) : e[p] ? t.push({
213
+ }) : e[pe] ? t.push({
214
214
  type: "exact",
215
- value: e[p],
215
+ value: e[pe],
216
216
  op: e[fe]
217
- }) : e[me] ? t.push({
217
+ }) : e[he] ? t.push({
218
218
  type: "regex",
219
- value: e[me],
220
- op: e[pe]
221
- }) : e[ge] && t.push({
219
+ value: e[he],
220
+ op: e[me]
221
+ }) : e[_e] && t.push({
222
222
  type: "token",
223
- value: e[ge],
224
- op: e[he]
223
+ value: e[_e],
224
+ op: e[ge]
225
225
  });
226
226
  return t;
227
227
  }
228
- function h(e) {
228
+ function m(e) {
229
229
  return e.map((e) => {
230
230
  let t = e.op || "";
231
231
  switch (e.type) {
@@ -237,32 +237,32 @@ function h(e) {
237
237
  }
238
238
  }).join(" ");
239
239
  }
240
- function _e(e, t, n) {
241
- let r = m(e);
240
+ function ve(e, t, n) {
241
+ let r = p(e);
242
242
  for (let e of t) r.push({
243
243
  type: "adjacent",
244
244
  value: e,
245
245
  op: n
246
246
  });
247
- return h(r);
247
+ return m(r);
248
248
  }
249
- function ve(e, t) {
250
- let n = m(t), r = n.findIndex((t) => t.value === e);
251
- return r === -1 ? t : (n.splice(r, 1), t = h(n));
252
- }
253
- function ye(e) {
254
- return h(m(e).filter((e) => e.type !== "adjacent"));
249
+ function ye(e, t) {
250
+ let n = p(t), r = n.findIndex((t) => t.value === e);
251
+ return r === -1 ? t : (n.splice(r, 1), t = m(n));
255
252
  }
256
253
  function be(e) {
257
- return m(e).filter((e) => e.type === "adjacent").map((e) => e.value);
254
+ return m(p(e).filter((e) => e.type !== "adjacent"));
255
+ }
256
+ function xe(e) {
257
+ return p(e).filter((e) => e.type === "adjacent").map((e) => e.value);
258
258
  }
259
259
  //#endregion
260
260
  //#region src/utils/date.ts
261
- function xe(e, t, n) {
262
- let r = new Intl.RelativeTimeFormat(e, { numeric: "auto" }), { offset: i, unit: a, isFuture: o } = Se(t, n);
261
+ function Se(e, t, n) {
262
+ let r = new Intl.RelativeTimeFormat(e, { numeric: "auto" }), { offset: i, unit: a, isFuture: o } = Ce(t, n);
263
263
  return r.format(i * (o ? 1 : -1), a);
264
264
  }
265
- function Se(e, t) {
265
+ function Ce(e, t) {
266
266
  let n = new Date(e), r = t ? new Date(t) : /* @__PURE__ */ new Date(), i = Math.abs(r.getTime() - n.getTime());
267
267
  return {
268
268
  offset: Math.floor(i / (1e3 * 60 * 60 * 24)),
@@ -272,19 +272,19 @@ function Se(e, t) {
272
272
  }
273
273
  //#endregion
274
274
  //#region src/utils/is-not-input-event.ts
275
- function Ce(e) {
275
+ function we(e) {
276
276
  let t = e.target;
277
277
  return t && t.nodeName !== "INPUT" && t.nodeName !== "TEXTAREA";
278
278
  }
279
279
  //#endregion
280
280
  //#region src/utils/query-params.ts
281
- function we(e) {
281
+ function Te(e) {
282
282
  if (e === void 0) return;
283
- let { q: t, f: n, p: r, s: i, t: a, n: o, b: s } = _(e), [c] = e.split("?");
283
+ let { q: t, f: n, p: r, s: i, t: a, n: o, b: s } = g(e), [c] = e.split("?");
284
284
  return {
285
285
  path: c,
286
286
  text: t,
287
- filters: n ? g(n) : void 0,
287
+ filters: n ? h(n) : void 0,
288
288
  page: r ? parseInt(r, 10) : void 0,
289
289
  sort: i,
290
290
  tab: a,
@@ -292,17 +292,17 @@ function we(e) {
292
292
  basket: s
293
293
  };
294
294
  }
295
- function Te(e) {
295
+ function Ee(e) {
296
296
  if (!e) return "";
297
297
  let { text: t, filters: n, page: r, sort: i, tab: a, name: o, basket: s } = e, c = {};
298
298
  return t && (c.q = t), n && (c.f = JSON.stringify(n)), r && (c.p = r.toString()), i && (c.s = i), a && (c.t = a), o && (c.n = o), s && (c.b = s), new URLSearchParams(c).toString() || "";
299
299
  }
300
- function Ee(e) {
300
+ function De(e) {
301
301
  if (e === void 0) return [];
302
- let { f: t } = _(e);
303
- return g(t);
302
+ let { f: t } = g(e);
303
+ return h(t);
304
304
  }
305
- function g(e) {
305
+ function h(e) {
306
306
  let t = decodeURIComponent(e);
307
307
  try {
308
308
  return JSON.parse(t ?? "[]");
@@ -310,47 +310,47 @@ function g(e) {
310
310
  return console.error(`Error parsing filters from URI: ${e}`), [];
311
311
  }
312
312
  }
313
- function _(e) {
313
+ function g(e) {
314
314
  let t = e.split("?")[1];
315
315
  if (t === void 0) return {};
316
316
  let n = new URLSearchParams(t);
317
317
  return Object.fromEntries(n);
318
318
  }
319
- function De(e) {
320
- let { q: t = "" } = _(e);
319
+ function Oe(e) {
320
+ let { q: t = "" } = g(e);
321
321
  return t;
322
322
  }
323
- function Oe(e) {
324
- let { id: t } = _(e);
323
+ function ke(e) {
324
+ let { id: t } = g(e);
325
325
  return decodeURIComponent(t);
326
326
  }
327
- function ke(e) {
328
- let { p: t = "0" } = _(e);
327
+ function Ae(e) {
328
+ let { p: t = "0" } = g(e);
329
329
  return parseInt(t, 10);
330
330
  }
331
- function Ae(e) {
332
- let { t } = _(e);
331
+ function je(e) {
332
+ let { t } = g(e);
333
333
  return t;
334
334
  }
335
335
  //#endregion
336
336
  //#region src/utils/syslang.ts
337
- function je(e, t) {
337
+ function Me(e, t) {
338
338
  if (!e) return e;
339
339
  let n = 0, r = e.length, i = 0;
340
340
  if (e[i] === "[") {
341
341
  for (; i < r && /[0-9]/.test(e[i]);) i++;
342
342
  e[i] === "]" && (n = i + 1);
343
343
  }
344
- let a = v(e, n, !1);
344
+ let a = _(e, n, !1);
345
345
  if (!a) return e;
346
346
  let o = t.charCodeAt(0), s = t.charCodeAt(1), c = a;
347
347
  for (; c;) if (o === c.lang1 && s === c.lang2) {
348
- let t = v(e, c.end + 4, !0);
348
+ let t = _(e, c.end + 4, !0);
349
349
  return e.substring(t.start, t.end);
350
- } else c = v(e, c.end + 4, !1);
350
+ } else c = _(e, c.end + 4, !1);
351
351
  return e.substring(a.start, a.end) || e;
352
352
  }
353
- function v(e, t, n) {
353
+ function _(e, t, n) {
354
354
  for (let n = t, r = e.length - 3; n < r; n++) if (e[n] === "[" && e[n + 3] === "]") return {
355
355
  start: t,
356
356
  end: n,
@@ -366,7 +366,7 @@ function v(e, t, n) {
366
366
  }
367
367
  //#endregion
368
368
  //#region src/utils/utilities.ts
369
- function Me(e, t) {
369
+ function Ne(e, t) {
370
370
  let { useLocale: n, useLocaleAsPrefix: r, indexFile: i, path: a, folder: o } = t, s = n ? `${e}/` : null, c = r ? `${e}.${i}` : i ?? "";
371
371
  return [
372
372
  a,
@@ -376,7 +376,7 @@ function Me(e, t) {
376
376
  }
377
377
  //#endregion
378
378
  //#region src/utils/notification.ts
379
- function y(e) {
379
+ function v(e) {
380
380
  let t = new CustomEvent("notification", {
381
381
  bubbles: !0,
382
382
  cancelable: !1,
@@ -384,51 +384,51 @@ function y(e) {
384
384
  });
385
385
  dispatchEvent(t);
386
386
  }
387
- var Ne = {
387
+ var Pe = {
388
388
  success: (e, t) => {
389
- y({
389
+ v({
390
390
  type: "success",
391
391
  message: e,
392
392
  options: t
393
393
  });
394
394
  },
395
395
  info: (e, t) => {
396
- y({
396
+ v({
397
397
  type: "info",
398
398
  message: e,
399
399
  options: t
400
400
  });
401
401
  },
402
402
  warning: (e, t) => {
403
- y({
403
+ v({
404
404
  type: "warning",
405
405
  message: e,
406
406
  options: t
407
407
  });
408
408
  },
409
409
  error: (e, t) => {
410
- y({
410
+ v({
411
411
  type: "error",
412
412
  message: e,
413
413
  options: t
414
414
  });
415
415
  }
416
- }, Pe = /* @__PURE__ */ function(e) {
416
+ }, Fe = /* @__PURE__ */ function(e) {
417
417
  return e[e.DEBUG = 0] = "DEBUG", e[e.INFO = 1] = "INFO", e[e.WARN = 2] = "WARN", e[e.ERROR = 3] = "ERROR", e[e.NONE = 4] = "NONE", e;
418
- }({}), b = {
418
+ }({}), y = {
419
419
  level: 1,
420
420
  enableConsoleOutput: !0
421
421
  };
422
- function Fe(e) {
423
- b = {
424
- ...b,
422
+ function Ie(e) {
423
+ y = {
424
+ ...y,
425
425
  ...e
426
426
  };
427
427
  }
428
- function x(e, t, n) {
429
- if (e < b.level) return;
430
- let r = `${`[${Pe[e]}]`} ${t}`;
431
- if (b.enableConsoleOutput) switch (e) {
428
+ function b(e, t, n) {
429
+ if (e < y.level) return;
430
+ let r = `${`[${Fe[e]}]`} ${t}`;
431
+ if (y.enableConsoleOutput) switch (e) {
432
432
  case 0:
433
433
  console.debug(r, n || "");
434
434
  break;
@@ -443,51 +443,51 @@ function x(e, t, n) {
443
443
  break;
444
444
  }
445
445
  }
446
+ function x(e, t) {
447
+ b(0, e, t);
448
+ }
446
449
  function S(e, t) {
447
- x(0, e, t);
450
+ b(1, e, t);
448
451
  }
449
452
  function C(e, t) {
450
- x(1, e, t);
453
+ b(2, e, t);
451
454
  }
452
455
  function w(e, t) {
453
- x(2, e, t);
454
- }
455
- function T(e, t) {
456
- x(3, e, t);
456
+ b(3, e, t);
457
457
  }
458
458
  //#endregion
459
459
  //#region src/web-api/helpers/create-headers.ts
460
- function E(e) {
461
- let t = $(), n = new Headers(e);
460
+ function T(e) {
461
+ let t = Q(), n = new Headers(e);
462
462
  n.append("Sinequa-Force-Camel-Case", "true"), n.append("accept", "application/json"), t && n.append("Sinequa-csrf-token", t);
463
463
  let { userOverride: i, userOverrideActive: a, bearerToken: o } = r;
464
464
  return o && n.append("Authorization", `Bearer ${o}`), i && a && (n.append("sinequa-override-user", i.username), n.append("sinequa-override-domain", i.domain)), n;
465
465
  }
466
466
  //#endregion
467
467
  //#region src/web-api/helpers/errors/api-error.ts
468
- var D = class extends Error {
468
+ var E = class extends Error {
469
469
  status;
470
470
  constructor(e, t) {
471
471
  super(e), this.name = "ApiError", this.status = t;
472
472
  }
473
- }, O = class extends D {
473
+ }, D = class extends E {
474
474
  constructor(e = "Server error") {
475
475
  super(e, 500), this.name = "ServerError";
476
476
  }
477
- }, Ie = class extends D {
477
+ }, Le = class extends E {
478
478
  constructor(e = "Request timed out") {
479
479
  super(e, 408), this.name = "TimeoutError";
480
480
  }
481
- }, k = class extends D {
481
+ }, O = class extends E {
482
482
  constructor(e = "Unauthorized access") {
483
483
  super(e, 401), this.name = "UnauthorizedError";
484
484
  }
485
485
  };
486
486
  //#endregion
487
487
  //#region src/web-api/helpers/handle-response.ts
488
- async function A(e, t = "json") {
488
+ async function k(e, t = "json") {
489
489
  let n = e.headers.get("sinequa-jwt-refresh");
490
- if (n !== null && X(n), e.status === 200) switch (t) {
490
+ if (n !== null && Y(n), e.status === 200) switch (t) {
491
491
  case "arraybuffer": return await e.arrayBuffer();
492
492
  case "blob": return await e.blob();
493
493
  case "text": return await e.text();
@@ -499,32 +499,32 @@ async function A(e, t = "json") {
499
499
  try {
500
500
  t = await (e.clone?.() ?? e).json();
501
501
  } catch {}
502
- throw w("Unauthorized access attempt with user override", {
502
+ throw C("Unauthorized access attempt with user override", {
503
503
  endpoint: e.url ?? "",
504
504
  error: t
505
- }), new k(t.errorMessage ?? t.message ?? "Unauthorized... User override failed.");
505
+ }), new O(t.errorMessage ?? t.message ?? "Unauthorized... User override failed.");
506
506
  }
507
- return await j(e, 401);
507
+ return await A(e, 401);
508
508
  }
509
- return e.status === 500 ? (T("Server error occurred", { endpoint: e.url ?? "" }), await j(e, 500)) : (w(`Unexpected response status: ${e.status}`, { endpoint: e.url ?? "" }), await j(e, e.status));
509
+ return e.status === 500 ? (w("Server error occurred", { endpoint: e.url ?? "" }), await A(e, 500)) : (C(`Unexpected response status: ${e.status}`, { endpoint: e.url ?? "" }), await A(e, e.status));
510
510
  }
511
- async function j(e, t) {
511
+ async function A(e, t) {
512
512
  try {
513
513
  let { done: n, value: r } = await e.body?.getReader().read() || {
514
514
  done: !0,
515
515
  value: void 0
516
516
  };
517
- if (n || !r) throw t === 401 ? new k() : t === 500 ? new O() : new D(`Request failed with status ${t}`, t);
517
+ if (n || !r) throw t === 401 ? new O() : t === 500 ? new D() : new E(`Request failed with status ${t}`, t);
518
518
  let i = JSON.parse(new TextDecoder().decode(r));
519
519
  throw Error(i.errorMessage || i.message || `Request failed with status ${t}`, { cause: {
520
520
  errorCode: i.errorCode,
521
521
  errorCodeTest: i.errorCodeTest
522
522
  } });
523
523
  } catch (e) {
524
- throw e instanceof D ? e : t === 401 ? new k(e.message) : t === 500 ? new O(e.message) : new D(e.message ?? `Request failed with status ${t}`, t);
524
+ throw e instanceof E ? e : t === 401 ? new O(e.message) : t === 500 ? new D(e.message) : new E(e.message ?? `Request failed with status ${t}`, t);
525
525
  }
526
526
  }
527
- var M = new class {
527
+ var j = new class {
528
528
  client = null;
529
529
  initialize(e) {
530
530
  this.client = e;
@@ -537,47 +537,47 @@ var M = new class {
537
537
  return this.client !== null;
538
538
  }
539
539
  }();
540
- function Le(e) {
541
- M.initialize(e);
540
+ function Re(e) {
541
+ j.initialize(e);
542
542
  }
543
543
  //#endregion
544
544
  //#region src/web-api/helpers/methods/del.ts
545
- async function N(e, t, n) {
546
- let i = E(n?.headers), { backendUrl: a } = r, o = t ? `?${new URLSearchParams(t)}` : "", s = a ? `${a}/${e}${o}` : `${e}${o}`;
547
- S(`Making DELETE request to: ${s}`);
545
+ async function ze(e, t, n) {
546
+ let i = T(n?.headers), { backendUrl: a } = r, o = t ? `?${new URLSearchParams(t)}` : "", s = a ? `${a}/${e}${o}` : `${e}${o}`;
547
+ x(`Making DELETE request to: ${s}`);
548
548
  try {
549
- if (M.isInitialized()) {
550
- let e = M.getClient();
551
- return A(await e.fetch(s, e.constructor.configurations.v1, {
549
+ if (j.isInitialized()) {
550
+ let e = j.getClient();
551
+ return k(await e.fetch(s, e.constructor.configurations.v1, {
552
552
  method: "DELETE",
553
553
  headers: i
554
554
  }), n?.responseType);
555
555
  }
556
- return A(await fetch(s, {
556
+ return k(await fetch(s, {
557
557
  method: "DELETE",
558
558
  credentials: "include",
559
559
  headers: i
560
560
  }), n?.responseType);
561
561
  } catch (e) {
562
- throw T("Error making DELETE request:", e), e;
562
+ throw w("Error making DELETE request:", e), e;
563
563
  }
564
564
  }
565
565
  //#endregion
566
566
  //#region src/web-api/helpers/methods/get.ts
567
- async function P(e, t, n) {
568
- let i = E(n?.headers), { backendUrl: a } = r, o = t ? `?${new URLSearchParams(t)}` : "";
567
+ async function M(e, t, n) {
568
+ let i = T(n?.headers), { backendUrl: a } = r, o = t ? `?${new URLSearchParams(t)}` : "";
569
569
  e.startsWith("plugin") && (e = `api/v1/${e}`);
570
570
  let s = a ? `${a}/${e}${o}` : `${e}${o}`;
571
- S(`Making GET request to: ${s}`);
571
+ x(`Making GET request to: ${s}`);
572
572
  try {
573
- if (M.isInitialized()) {
574
- let e = M.getClient();
575
- return A(await e.get(s, e.constructor.configurations.v1, {
573
+ if (j.isInitialized()) {
574
+ let e = j.getClient();
575
+ return k(await e.get(s, e.constructor.configurations.v1, {
576
576
  headers: i,
577
577
  signal: n?.signal
578
578
  }), n?.responseType);
579
579
  }
580
- return A(await fetch(s, {
580
+ return k(await fetch(s, {
581
581
  method: "GET",
582
582
  credentials: "include",
583
583
  headers: i,
@@ -585,66 +585,71 @@ async function P(e, t, n) {
585
585
  redirect: n?.redirect
586
586
  }), n?.responseType);
587
587
  } catch (e) {
588
- throw T("Error making GET request:", e), e;
588
+ throw w("Error making GET request:", e), e;
589
589
  }
590
590
  }
591
591
  //#endregion
592
+ //#region src/web-api/helpers/utils/resolve-no-auto-authentication.ts
593
+ function N() {
594
+ return r.authMode?.kind !== "sso";
595
+ }
596
+ //#endregion
592
597
  //#region src/web-api/helpers/methods/patch.ts
593
- async function Re(e, t, n) {
594
- let i = E(n?.headers);
598
+ async function Be(e, t, n) {
599
+ let i = T(n?.headers);
595
600
  i.append("content-type", "application/json");
596
601
  let { app: a, backendUrl: o } = r, s = {
597
602
  app: a,
598
603
  ...t,
599
604
  locale: t.locale || navigator.language,
600
605
  noUserOverride: !0,
601
- noAutoAuthentication: !0
606
+ noAutoAuthentication: N()
602
607
  }, c = o ? `${o}/${e}` : `${e}`;
603
- S(`Making PATCH request to: ${c}`);
608
+ x(`Making PATCH request to: ${c}`);
604
609
  try {
605
- if (M.isInitialized()) {
606
- let e = M.getClient();
607
- return A(await e.fetch(c, e.constructor.configurations.v1, {
610
+ if (j.isInitialized()) {
611
+ let e = j.getClient();
612
+ return k(await e.fetch(c, e.constructor.configurations.v1, {
608
613
  method: "PATCH",
609
614
  headers: i,
610
615
  body: JSON.stringify(s)
611
616
  }), n?.responseType);
612
617
  }
613
- return A(await fetch(c, {
618
+ return k(await fetch(c, {
614
619
  method: "PATCH",
615
620
  headers: i,
616
621
  credentials: "include",
617
622
  body: JSON.stringify(s)
618
623
  }), n?.responseType);
619
624
  } catch (e) {
620
- throw T("Error making PATCH request:", e), e;
625
+ throw w("Error making PATCH request:", e), e;
621
626
  }
622
627
  }
623
628
  //#endregion
624
629
  //#region src/web-api/helpers/methods/post.ts
625
- async function F(e, t, n) {
626
- let i = E(n?.headers), { app: a, backendUrl: o } = r;
630
+ async function P(e, t, n) {
631
+ let i = T(n?.headers), { app: a, backendUrl: o } = r;
627
632
  i.has("Content-Type") || i.set("Content-Type", "application/json");
628
633
  let s = {
629
634
  app: a,
630
635
  ...t,
631
636
  locale: t.locale || navigator.language,
632
637
  noUserOverride: !0,
633
- noAutoAuthentication: !0
638
+ noAutoAuthentication: N()
634
639
  };
635
640
  e.startsWith("plugin") && (e = `api/v1/${e}`);
636
641
  let c = o ? `${o}/${e}` : `${e}`;
637
- S(`Making POST request to: ${c}`);
642
+ x(`Making POST request to: ${c}`);
638
643
  try {
639
- if (M.isInitialized()) {
640
- let e = M.getClient();
641
- return A(await e.post(c, e.constructor.configurations.v1, {
644
+ if (j.isInitialized()) {
645
+ let e = j.getClient();
646
+ return k(await e.post(c, e.constructor.configurations.v1, {
642
647
  headers: i,
643
648
  body: JSON.stringify(s),
644
649
  signal: n?.signal
645
650
  }), n?.responseType);
646
651
  }
647
- return A(await fetch(c, {
652
+ return k(await fetch(c, {
648
653
  method: "POST",
649
654
  headers: i,
650
655
  credentials: "include",
@@ -652,45 +657,45 @@ async function F(e, t, n) {
652
657
  signal: n?.signal
653
658
  }), n?.responseType);
654
659
  } catch (e) {
655
- throw T("Error making POST request:", e), e;
660
+ throw w("Error making POST request:", e), e;
656
661
  }
657
662
  }
658
663
  //#endregion
659
664
  //#region src/web-api/helpers/methods/put.ts
660
- async function ze(e, t, n) {
661
- let i = E(n?.headers), { app: a, backendUrl: o } = r, s = {
665
+ async function Ve(e, t, n) {
666
+ let i = T(n?.headers), { app: a, backendUrl: o } = r, s = {
662
667
  app: a,
663
668
  ...t,
664
669
  locale: t.locale || navigator.language,
665
670
  noUserOverride: !0,
666
- noAutoAuthentication: !0
671
+ noAutoAuthentication: N()
667
672
  }, c = `${o}/${e}`;
668
- S(`Making PUT request to: ${c}`);
673
+ x(`Making PUT request to: ${c}`);
669
674
  try {
670
- if (M.isInitialized()) {
671
- let e = M.getClient();
672
- return A(await e.fetch(c, e.constructor.configurations.v1, {
675
+ if (j.isInitialized()) {
676
+ let e = j.getClient();
677
+ return k(await e.fetch(c, e.constructor.configurations.v1, {
673
678
  method: "PUT",
674
679
  headers: i,
675
680
  body: JSON.stringify(s)
676
681
  }), n?.responseType);
677
682
  }
678
- return A(await fetch(c, {
683
+ return k(await fetch(c, {
679
684
  method: "PUT",
680
685
  headers: i,
681
686
  credentials: "include",
682
687
  body: JSON.stringify(s)
683
688
  }), n?.responseType);
684
689
  } catch (e) {
685
- throw T("Error making PUT request:", e), e;
690
+ throw w("Error making PUT request:", e), e;
686
691
  }
687
692
  }
688
693
  //#endregion
689
694
  //#region src/web-api/helpers/utils/create-timeout-controller.ts
690
- function I(e) {
695
+ function F(e) {
691
696
  let t = new AbortController(), { signal: n } = t;
692
697
  return e && setTimeout(() => {
693
- n.aborted || t.abort(new Ie(`Request timed out after ${e}ms`));
698
+ n.aborted || t.abort(new Le(`Request timed out after ${e}ms`));
694
699
  }, e), {
695
700
  controller: t,
696
701
  signal: n
@@ -698,36 +703,36 @@ function I(e) {
698
703
  }
699
704
  //#endregion
700
705
  //#region src/web-api/helpers/utils/date-utils..ts
701
- function L(e) {
706
+ function I(e) {
702
707
  if (!e) return;
703
708
  let t = new Date(e);
704
709
  return Number.isNaN(t.getTime()) ? void 0 : t;
705
710
  }
706
- function Be(e) {
707
- let t = L(e);
711
+ function He(e) {
712
+ let t = I(e);
708
713
  return !!t && t.getTime() <= Date.now();
709
714
  }
710
- function Ve(e, t = 7) {
711
- let n = L(e);
715
+ function Ue(e, t = 7) {
716
+ let n = I(e);
712
717
  if (!n) return !1;
713
718
  let r = Date.now(), i = r + t * 24 * 60 * 60 * 1e3, a = n.getTime();
714
719
  return a > r && a <= i;
715
720
  }
716
721
  //#endregion
717
722
  //#region src/web-api/helpers/utils/with-retry.ts
718
- async function He(e, t = 0, n = 1e3) {
723
+ async function We(e, t = 0, n = 1e3) {
719
724
  let r;
720
725
  for (let i = 0; i <= t; i++) try {
721
726
  return await e();
722
727
  } catch (e) {
723
- if (r = e, e instanceof D && e.status >= 400 && e.status < 500 && e.status !== 429 || e instanceof DOMException && e.name === "AbortError") throw e;
724
- i < t && (w(`Retrying request (${i + 1}/${t})`, { error: e }), await new Promise((e) => setTimeout(e, n)));
728
+ if (r = e, e instanceof E && e.status >= 400 && e.status < 500 && e.status !== 429 || e instanceof DOMException && e.name === "AbortError") throw e;
729
+ i < t && (C(`Retrying request (${i + 1}/${t})`, { error: e }), await new Promise((e) => setTimeout(e, n)));
725
730
  }
726
731
  throw r;
727
732
  }
728
733
  //#endregion
729
734
  //#region src/helpers/column-resolver.ts
730
- function Ue(e, t, n) {
735
+ function Ge(e, t, n) {
731
736
  if (!e || !t) return;
732
737
  if (n) {
733
738
  let r = Object.keys(t.queries).find((e) => e === n?.toLowerCase()), i;
@@ -740,93 +745,93 @@ function Ue(e, t, n) {
740
745
  }
741
746
  //#endregion
742
747
  //#region src/types/audit/AuditEventType.ts
743
- var R = /* @__PURE__ */ function(e) {
748
+ var L = /* @__PURE__ */ function(e) {
744
749
  return e.None = "None", e.Search_FirstPage = "Search_FirstPage", e.Search_Text = "Search_Text", e.Search_Refine = "Search_Refine", e.Search_Select_Item = "Search_Select_Item", e.Search_Select_Custom = "Search_Select_Custom", e.Search_Select_Concept = "Search_Select_Concept", e.Search_Select_Correction = "Search_Select_Correction", e.Search_GotoPage = "Search_GotoPage", e.Search_GotoTab = "Search_GotoTab", e.Search_DisplayResult = "Search_DisplayResult", e.Search_RemoveResult = "Search_RemoveResult", e.Search_RemoveAdvanced = "Search_RemoveAdvanced", e.Search_SavedQuery = "Search_SavedQuery", e.Search_WebService = "Search_WebService", e.Search_DidYouMean_Original = "Search_DidYouMean_Original", e.Search_DidYouMean_Correction = "Search_DidYouMean_Correction", e.Search_ExportCSV = "Search_ExportCSV", e.Search_SavedQuery_ExportCSV = "Search_SavedQuery_ExportCSV", e.Search_Selection_ExportCSV = "Search_Selection_ExportCSV", e.Search_AlertQuery = "Search_AlertQuery", e.Search_Select_AnalyticsItem = "Search_Select_AnalyticsItem", e.Search_Sort = "Search_Sort", e.Search_Exit_Logout = "Search_Exit_Logout", e.Search_Timeline_Usage = "Search_Timeline_Usage", e.Search_AutoComplete = "Search_Autocomplete", e.Search_Login_Success = "Login_Success_Form", e.Search_QueryIntent_Detected = "Search_QueryIntent_Detected", e.SavedQuery_Add = "SavedQuery_Add", e.SavedQuery_Delete = "SavedQuery_Delete", e.SavedQuery_DeleteAll = "SavedQuery_DeleteAll", e.SavedQuery_Rename = "SavedQuery_Rename", e.Alert_Edit = "Alert_Edit", e.Alert_Delete = "Alert_Delete", e.Alert_DeleteAll = "Alert_DeleteAll", e.Link_Display = "Link_Display", e.Link_Click = "Link_Click", e.Basket_Add = "Basket_Add", e.Basket_Delete = "Basket_Delete", e.Basket_DeleteAll = "Basket_DeleteAll", e.Basket_Rename = "Basket_Rename", e.Basket_AddDoc = "Basket_AddDoc", e.Basket_RemoveDoc = "Basket_RemoveDoc", e.Basket_Open = "Basket_Open", e.Basket_ExportCSV = "Basket_ExportCSV", e.Label_Add = "Label_Add", e.Label_Delete = "Label_Delete", e.Label_Rename = "Label_Rename", e.Label_Open = "Label_Open", e.Label_AddDoc = "Label_AddDoc", e.Label_RemoveDoc = "Label_RemoveDoc", e.Label_ExportCSV = "Label_ExportCSV", e.Label_Menu_ExportCSV = "Label_Menu_ExportCSV", e.Rating_Set = "Rating_Set", e.Rating_Delete = "Rating_Delete", e.Doc_Preview = "Doc_Preview", e.Doc_CacheHtml = "Doc_CacheHtml", e.Doc_CachePdf = "Doc_CachePdf", e.Doc_CacheOriginal = "Doc_CacheOriginal", e.Doc_Url1 = "Doc_Url1", e.Doc_Url2 = "Doc_Url2", e.Preview_Close = "Preview_Close", e.Click_ResultLink = "Click_ResultLink", e.Click_ResultLink1 = "Click_ResultLink1", e.Click_ResultLink2 = "Click_ResultLink2", e.Click_ResultLink3 = "Click_ResultLink3", e.Click_ResultLink4 = "Click_ResultLink4", e.Click_ResultLink5 = "Click_ResultLink5", e.Click_ResultLink6 = "Click_ResultLink6", e.Click_ResultLink7 = "Click_ResultLink7", e.Click_ResultLink8 = "Click_ResultLink8", e.Click_ResultLink9 = "Click_ResultLink9", e.Click_ResultLink10 = "Click_ResultLink10", e.Click_PreviewLink1 = "Click_PreviewLink1", e.Click_PreviewLink2 = "Click_PreviewLink2", e.Click_PreviewLink3 = "Click_PreviewLink3", e.Click_PreviewLink4 = "Click_PreviewLink4", e.Click_PreviewLink5 = "Click_PreviewLink5", e.Click_PreviewLink6 = "Click_PreviewLink6", e.Click_PreviewLink7 = "Click_PreviewLink7", e.Click_PreviewLink8 = "Click_PreviewLink8", e.Click_PreviewLink9 = "Click_PreviewLink9", e.Click_PreviewLink10 = "Click_PreviewLink10", e.RFM_ClickSet = "RFM_ClickSet", e.RFM_ClickReset = "RFM_ClickReset", e.RFM_Like = "RFM_Like", e.RFM_LikeReset = "RFM_LikeReset", e.RFM_Dislike = "RFM_Dislike", e.RFM_Important = "RFM_Important", e.RFM_ImportantReset = "RFM_ImportantReset", e.RFM_Ban = "RFM_Ban", e.Navigation_Exit = "Navigation_Exit", e.Navigation_Return = "Navigation_Return", e.Navigation_Route = "Navigation_Route", e.Answer_Display = "Answer_Display", e.Answer_Click = "Answer_Click", e.Answer_Result = "Answer_Result", e.Answer_Liked = "Answer_Liked", e.Answer_Disliked = "Answer_Disliked", e.Answer_Liked_Cancelled = "Answer_Liked_Cancelled", e.Answer_Disliked_Cancelled = "Answer_Disliked_Cancelled", e.TopPassages_Display = "TopPassages_Display", e.TopPassages_Click = "TopPassages_Click", e.UserSettings_Reset = "UserSettings_Reset", e.Change_Password_Failed = "change.password.failed", e.Change_Password_Success_Form = "change.password.success.form", e.Forgot_Password_Request = "forgot.password.request", e.Login_Denied = "login.denied", e.Login_Success_Form = "login.success.form", e.Send_Reset_Password_Link = "send.reset.password.link", e.Xrest_ChangePassword = "xrest.changepassword", e;
745
- }({}), z = /* @__PURE__ */ function(e) {
750
+ }({}), R = /* @__PURE__ */ function(e) {
746
751
  return e[e.none = 0] = "none", e[e.bool = 1] = "bool", e[e.date = 2] = "date", e[e.dateTime = 3] = "dateTime", e[e.time = 4] = "time", e[e.unsigned = 5] = "unsigned", e[e.integer = 6] = "integer", e[e.float = 7] = "float", e[e.double = 8] = "double", e[e.dates = 9] = "dates", e[e.dateTimes = 10] = "dateTimes", e[e.times = 11] = "times", e[e.varchar = 12] = "varchar", e[e.binary = 13] = "binary", e[e.string = 14] = "string", e[e.csv = 15] = "csv", e;
747
- }({}), B = /* @__PURE__ */ function(e) {
752
+ }({}), z = /* @__PURE__ */ function(e) {
748
753
  return e[e.none = 0] = "none", e[e.a = 2053] = "a", e[e.c = 4] = "c", e[e.d = 8] = "d", e[e.e = 2068] = "e", e[e.i = 256] = "i", e[e.l = 2052] = "l", e[e.n = 8192] = "n", e[e.t = 524292] = "t", e[e.x = 8388608] = "x", e[e.z = 33554432] = "z", e[e.f_ordinal = 8192] = "f_ordinal", e[e.f_multidates = 8192] = "f_multidates", e[e.f_varchar = 33554432] = "f_varchar", e[e.f_binary = 33562624] = "f_binary", e[e.f_string = 33562888] = "f_string", e[e.f_csv = 42477853] = "f_csv", e[e.f_overridable = 33554696] = "f_overridable", e;
749
- }({}), We = "1.0", Ge = /* @__PURE__ */ function(e) {
754
+ }({}), Ke = "1.0", qe = /* @__PURE__ */ function(e) {
750
755
  return e[e.Original = 0] = "Original", e[e.Corrected = 1] = "Corrected", e;
751
- }({}), Ke = /* @__PURE__ */ function(e) {
756
+ }({}), Je = /* @__PURE__ */ function(e) {
752
757
  return e[e.none = 0] = "none", e[e.positiveRate = 1] = "positiveRate", e[e.mainlyPosRate = 2] = "mainlyPosRate", e[e.unrate = 4] = "unrate", e[e.mainlyNegRate = 8] = "mainlyNegRate", e[e.negativeRate = 16] = "negativeRate", e[e.all = 31] = "all", e[e.positiveOnly = 7] = "positiveOnly", e[e.negativeOnly = 28] = "negativeOnly", e[e.personalAll = 21] = "personalAll", e[e.personalPosOnly = 5] = "personalPosOnly", e[e.personalNegOnly = 20] = "personalNegOnly", e;
753
758
  }({});
754
759
  //#endregion
755
760
  //#region src/helpers/columns.ts
756
- function qe(e) {
757
- if (!e) return z.none;
761
+ function Ye(e) {
762
+ if (!e) return R.none;
758
763
  switch (e.toLocaleLowerCase()) {
759
764
  case "bool":
760
- case "boolean": return z.bool;
761
- case "date": return z.date;
762
- case "datetime": return z.dateTime;
763
- case "time": return z.time;
764
- case "unsigned": return z.unsigned;
765
- case "integer": return z.integer;
766
- case "float": return z.float;
767
- case "double": return z.double;
768
- case "dates": return z.dates;
769
- case "datetimes": return z.dateTimes;
770
- case "times": return z.times;
771
- case "varchar": return z.varchar;
772
- case "binary": return z.binary;
773
- case "string": return z.string;
774
- case "csv": return z.csv;
775
- default: return z.none;
765
+ case "boolean": return R.bool;
766
+ case "date": return R.date;
767
+ case "datetime": return R.dateTime;
768
+ case "time": return R.time;
769
+ case "unsigned": return R.unsigned;
770
+ case "integer": return R.integer;
771
+ case "float": return R.float;
772
+ case "double": return R.double;
773
+ case "dates": return R.dates;
774
+ case "datetimes": return R.dateTimes;
775
+ case "times": return R.times;
776
+ case "varchar": return R.varchar;
777
+ case "binary": return R.binary;
778
+ case "string": return R.string;
779
+ case "csv": return R.csv;
780
+ default: return R.none;
776
781
  }
777
782
  }
778
- function Je(e) {
783
+ function Xe(e) {
779
784
  switch (e) {
780
- case "a": return B.a;
781
- case "c": return B.c;
782
- case "d": return B.d;
783
- case "e": return B.e;
784
- case "i": return B.i;
785
- case "l": return B.l;
786
- case "n": return B.n;
787
- case "t": return B.t;
788
- case "x": return B.x;
789
- case "z": return B.z;
790
- default: return B.none;
785
+ case "a": return z.a;
786
+ case "c": return z.c;
787
+ case "d": return z.d;
788
+ case "e": return z.e;
789
+ case "i": return z.i;
790
+ case "l": return z.l;
791
+ case "n": return z.n;
792
+ case "t": return z.t;
793
+ case "x": return z.x;
794
+ case "z": return z.z;
795
+ default: return z.none;
791
796
  }
792
797
  }
793
- function Ye(e) {
794
- let t = B.none;
795
- if (e) for (let n of e) t |= Je(n);
798
+ function Ze(e) {
799
+ let t = z.none;
800
+ if (e) for (let n of e) t |= Xe(n);
796
801
  return t;
797
802
  }
798
- function V(e, t, n, r) {
803
+ function B(e, t, n, r) {
799
804
  return {
800
805
  name: e,
801
806
  type: t,
802
807
  typeModifier: n,
803
- eType: qe(t),
804
- eTypeModifier: Ye(n || ""),
808
+ eType: Ye(t),
809
+ eTypeModifier: Ze(n || ""),
805
810
  aliases: r
806
811
  };
807
812
  }
808
- var Xe = {
809
- id: V("id", "string"),
810
- text: V("text", "varchar"),
811
- documentlanguages: V("documentlanguages", "csv", "ci", ["language"]),
812
- databasealias: V("databasealias", "varchar"),
813
- globalrelevance: V("globalrelevance", "double"),
814
- matchingpartnames: V("matchingpartnames", "csv"),
815
- matchlocations: V("matchlocations", "csv"),
816
- matchlocationsperpartname: V("matchlocationsperpartname", "varchar"),
817
- extracts: V("extracts", "csv"),
818
- extractsperpartname: V("extractsperpartname", "varchar"),
819
- extractslocations: V("extractslocations", "csv"),
820
- documentweight: V("documentweight", "varchar"),
821
- groupcount: V("groupcount", "integer"),
822
- accesslists: V("accesslists", "varchar", void 0, ["accessLists"])
813
+ var Qe = {
814
+ id: B("id", "string"),
815
+ text: B("text", "varchar"),
816
+ documentlanguages: B("documentlanguages", "csv", "ci", ["language"]),
817
+ databasealias: B("databasealias", "varchar"),
818
+ globalrelevance: B("globalrelevance", "double"),
819
+ matchingpartnames: B("matchingpartnames", "csv"),
820
+ matchlocations: B("matchlocations", "csv"),
821
+ matchlocationsperpartname: B("matchlocationsperpartname", "varchar"),
822
+ extracts: B("extracts", "csv"),
823
+ extractsperpartname: B("extractsperpartname", "varchar"),
824
+ extractslocations: B("extractslocations", "csv"),
825
+ documentweight: B("documentweight", "varchar"),
826
+ groupcount: B("groupcount", "integer"),
827
+ accesslists: B("accesslists", "varchar", void 0, ["accessLists"])
823
828
  };
824
829
  //#endregion
825
830
  //#region src/helpers/filters.ts
826
- function Ze(e) {
831
+ function $e(e) {
827
832
  return e.filter((e) => !!e);
828
833
  }
829
- var Qe = {
834
+ var et = {
830
835
  eq: (e, t) => ({
831
836
  field: e,
832
837
  operator: "eq",
@@ -891,18 +896,18 @@ var Qe = {
891
896
  start: t,
892
897
  end: n
893
898
  }),
894
- and: (...e) => $e("and", e),
895
- or: (...e) => $e("or", e),
899
+ and: (...e) => tt("and", e),
900
+ or: (...e) => tt("or", e),
896
901
  not: (...e) => {
897
- let t = Ze(e);
902
+ let t = $e(e);
898
903
  return t.length ? {
899
904
  operator: "not",
900
905
  filters: t
901
906
  } : void 0;
902
907
  }
903
908
  };
904
- function $e(e, t) {
905
- let n = Ze(t);
909
+ function tt(e, t) {
910
+ let n = $e(t);
906
911
  if (n.length !== 0) return n.length === 1 ? n[0] : {
907
912
  operator: e,
908
913
  filters: n
@@ -910,14 +915,14 @@ function $e(e, t) {
910
915
  }
911
916
  //#endregion
912
917
  //#region src/helpers/metadata.ts
913
- function et(e, t) {
918
+ function nt(e, t) {
914
919
  let n = e[t];
915
920
  return n === void 0 ? [] : (typeof n == "string" && (n = String(n).split(",")), Array.isArray(n) ? n.map((e) => {
916
921
  if (typeof e == "string") return e.trim();
917
922
  if (typeof e == "object" && e && "display" in e) return e.display.trim();
918
923
  }).filter((e) => e !== void 0) : [String(n).trim()]);
919
924
  }
920
- function tt(e, t) {
925
+ function rt(e, t) {
921
926
  let n = e[t];
922
927
  if (n === void 0) return [];
923
928
  if (typeof n == "string" && (n = String(n).split(",")), Array.isArray(n)) return n.map((e) => {
@@ -941,35 +946,35 @@ function tt(e, t) {
941
946
  }
942
947
  //#endregion
943
948
  //#region src/helpers/utils.ts
944
- function H(e) {
949
+ function V(e) {
945
950
  return typeof e == "object" && !!e;
946
951
  }
947
- function nt(e) {
948
- return H(e) && Object.prototype.toString.call(e) === "[object ArrayBuffer]";
949
- }
950
- function rt(e) {
951
- return H(e) && Object.prototype.toString.call(e) === "[object Blob]";
952
- }
953
952
  function it(e) {
954
- return Object.prototype.toString.call(e) === "[object Date]";
953
+ return V(e) && Object.prototype.toString.call(e) === "[object ArrayBuffer]";
955
954
  }
956
955
  function at(e) {
957
- return typeof e == "string";
956
+ return V(e) && Object.prototype.toString.call(e) === "[object Blob]";
958
957
  }
959
958
  function ot(e) {
960
- return (H(e) || Array.isArray(e)) && !nt(e) && !rt(e) && !at(e);
959
+ return Object.prototype.toString.call(e) === "[object Date]";
961
960
  }
962
961
  function st(e) {
962
+ return typeof e == "string";
963
+ }
964
+ function ct(e) {
965
+ return (V(e) || Array.isArray(e)) && !it(e) && !at(e) && !st(e);
966
+ }
967
+ function lt(e) {
963
968
  return e ? (e.getHours() * 60 * 60 + e.getMinutes() * 60 + e.getSeconds()) * 1e3 + e.getMilliseconds() : 0;
964
969
  }
965
- function ct(e = !0) {
970
+ function H(e = !0) {
966
971
  let t = Date.now();
967
972
  return (e ? "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx" : "xxxxxxxxxxxx4xxxyxxxxxxxxxxxxxxx").replace(/[xy]/g, (e) => {
968
973
  let n = (t + Math.random() * 16) % 16 | 0;
969
974
  return t = Math.floor(t / 16), (e === "x" ? n : n & 3 | 8).toString(16);
970
975
  });
971
976
  }
972
- function lt(e) {
977
+ function ut(e) {
973
978
  if (!e) return "``";
974
979
  if (e = String(e), e.search(/[\\`]/) === -1) return `\`${e}\``;
975
980
  let t = ["`"];
@@ -979,7 +984,7 @@ function lt(e) {
979
984
  }
980
985
  return t.push("`"), t.join("");
981
986
  }
982
- function ut(e) {
987
+ function dt(e) {
983
988
  if (typeof crypto < "u" && crypto.subtle && typeof crypto.subtle.digest == "function") try {
984
989
  return crypto.subtle.digest("SHA-512", new TextEncoder().encode(e)).then((e) => Array.prototype.map.call(new Uint8Array(e), (e) => `00${e.toString(16)}`.slice(-2)).join("")).catch(() => Promise.resolve(U(e)));
985
990
  } catch {
@@ -995,51 +1000,51 @@ function U(e) {
995
1000
  }
996
1001
  //#endregion
997
1002
  //#region src/web-api/v1/fetch-audit.ts
998
- var W, dt;
1003
+ var W, ft;
999
1004
  function G(e, t = !0) {
1000
- let n = ft(e.$auditRecord);
1001
- n && (pt(n), t && mt(n)), e.$auditRecord = n;
1005
+ let n = pt(e.$auditRecord);
1006
+ n && (mt(n), t && ht(n)), e.$auditRecord = n;
1002
1007
  }
1003
- function ft(e) {
1008
+ function pt(e) {
1004
1009
  if (!e) return;
1005
1010
  let t;
1006
1011
  if (Array.isArray(e)) t = e;
1007
- else if (H(e)) {
1012
+ else if (V(e)) {
1008
1013
  let n = e;
1009
1014
  if (n.auditEvents || n.mlAuditEvents) return n;
1010
1015
  t = [e];
1011
1016
  }
1012
1017
  return { auditEvents: t };
1013
1018
  }
1014
- function pt(e) {
1015
- let t = ht();
1019
+ function mt(e) {
1020
+ let t = gt();
1016
1021
  return e.auditEvents?.forEach((e) => {
1017
1022
  e.detail ||= {}, e.detail.sessionid = t;
1018
1023
  }), e;
1019
1024
  }
1020
- function mt(e) {
1025
+ function ht(e) {
1021
1026
  let t = typeof window < "u" ? decodeURIComponent(window.location.href) : "http://localhost";
1022
1027
  return e?.auditEvents?.forEach((e) => {
1023
1028
  e.detail ||= {}, e.detail.url = t;
1024
1029
  }), e;
1025
1030
  }
1026
- function ht() {
1027
- return (!W || gt()) && (W = ct()), dt = /* @__PURE__ */ new Date(), W;
1028
- }
1029
1031
  function gt() {
1030
- return (/* @__PURE__ */ new Date()).getTime() - dt.getTime() > 600 * 1e3;
1032
+ return (!W || _t()) && (W = H()), ft = /* @__PURE__ */ new Date(), W;
1031
1033
  }
1032
- async function _t(e, t = !0) {
1034
+ function _t() {
1035
+ return (/* @__PURE__ */ new Date()).getTime() - ft.getTime() > 600 * 1e3;
1036
+ }
1037
+ async function vt(e, t = !0) {
1033
1038
  let n = {
1034
- event: R.None,
1039
+ event: L.None,
1035
1040
  $auditRecord: e
1036
1041
  };
1037
- return G(n, t), F("api/v1/audit.notify", n);
1042
+ return G(n, t), P("api/v1/audit.notify", n);
1038
1043
  }
1039
- var vt = { notify: _t };
1044
+ var yt = { notify: vt };
1040
1045
  //#endregion
1041
1046
  //#region src/web-api/v1/fetch-aggregation.ts
1042
- async function yt(e, t, n) {
1047
+ async function bt(e, t, n) {
1043
1048
  let r = e.items?.length || 0, i = {
1044
1049
  query: {
1045
1050
  ...t,
@@ -1052,12 +1057,12 @@ async function yt(e, t, n) {
1052
1057
  $auditRecord: { auditEvents: [n] }
1053
1058
  };
1054
1059
  G(i);
1055
- let { aggregations: a } = await A(await F("api/v1/query", i)), o = a[0];
1060
+ let { aggregations: a } = await k(await P("api/v1/query", i)), o = a[0];
1056
1061
  return o.$hasMore = o.items.length > 10, o.items = [...e.items, ...o.items], Promise.resolve(o);
1057
1062
  }
1058
1063
  //#endregion
1059
1064
  //#region src/authentication/session/detect-auth-mode.ts
1060
- function bt(e, n) {
1065
+ function xt(e, n) {
1061
1066
  if (e.authMode?.kind === "credentials") return t.credentials();
1062
1067
  if (e.bearerToken) return t.bearer(e.bearerToken);
1063
1068
  let r = e.autoOAuthProvider || n?.autoOAuthProvider;
@@ -1067,18 +1072,18 @@ function bt(e, n) {
1067
1072
  }
1068
1073
  //#endregion
1069
1074
  //#region src/web-api/v1/fetch-app.ts
1070
- async function xt(e) {
1075
+ async function St(e) {
1071
1076
  let t = e || r.app;
1072
- return P("api/v1/app", new URLSearchParams({ app: t || "" }));
1077
+ return M("api/v1/app", new URLSearchParams({ app: t || "" }));
1073
1078
  }
1074
- async function St() {
1079
+ async function Ct() {
1075
1080
  let { app: e } = r;
1076
- return P("api/v1/app", new URLSearchParams({
1081
+ return M("api/v1/app", new URLSearchParams({
1077
1082
  app: e || "",
1078
1083
  preLogin: "true"
1079
1084
  }));
1080
1085
  }
1081
- function Ct() {
1086
+ function wt() {
1082
1087
  let { backendUrl: e, app: n } = r;
1083
1088
  if (typeof window < "u") {
1084
1089
  if (e ||= window.location.origin, !n) {
@@ -1095,37 +1100,37 @@ function Ct() {
1095
1100
  autoOAuthProvider: void 0,
1096
1101
  autoSAMLProvider: void 0,
1097
1102
  bearerToken: void 0
1098
- }), Promise.resolve({})) : St().then((e) => (i({
1099
- authMode: bt(r, e),
1103
+ }), Promise.resolve({})) : Ct().then((e) => (i({
1104
+ authMode: xt(r, e),
1100
1105
  autoOAuthProvider: r.autoOAuthProvider || e.autoOAuthProvider,
1101
1106
  autoSAMLProvider: r.autoSAMLProvider || e.autoSAMLProvider
1102
1107
  }), e)).catch((e) => {
1103
- throw T("atomic:fetchAppPreLogin error", e), e;
1108
+ throw w("atomic:fetchAppPreLogin error", e), e;
1104
1109
  });
1105
1110
  }
1106
- var wt = Ct;
1111
+ var Tt = wt;
1107
1112
  //#endregion
1108
1113
  //#region src/web-api/v1/fetch-dataset.ts
1109
- async function Tt(e, t, n = {}) {
1110
- let r = await F(`api/v1/search.dataset/${e}/${t}`, { parameters: n }), i = t[0].toLowerCase() + t.slice(1), a = r.datasets[i];
1114
+ async function Et(e, t, n = {}) {
1115
+ let r = await P(`api/v1/search.dataset/${e}/${t}`, { parameters: n }), i = t[0].toLowerCase() + t.slice(1), a = r.datasets[i];
1111
1116
  if ("errorCode" in a && "errorMessage" in a) throw Error(a.errorMessage);
1112
1117
  return a;
1113
1118
  }
1114
- async function Et(e, t) {
1119
+ async function Dt(e, t) {
1115
1120
  let n = `api/v1/search.dataset/${e}`, { parameters: r = {}, datasets: i = [] } = t;
1116
- return (await F(n, {
1121
+ return (await P(n, {
1117
1122
  parameters: r,
1118
1123
  datasets: i
1119
1124
  })).datasets;
1120
1125
  }
1121
- async function Dt(e) {
1122
- return await P(`api/v1/search.dataset/${e}`);
1126
+ async function Ot(e) {
1127
+ return await M(`api/v1/search.dataset/${e}`);
1123
1128
  }
1124
1129
  //#endregion
1125
1130
  //#region src/web-api/v1/fetch-labels.ts
1126
- async function Ot(e, t = !0, n) {
1131
+ async function kt(e, t = !0, n) {
1127
1132
  try {
1128
- return (await F("api/v1/labels", {
1133
+ return (await P("api/v1/labels", {
1129
1134
  action: "list",
1130
1135
  q: e,
1131
1136
  public: t,
@@ -1133,30 +1138,30 @@ async function Ot(e, t = !0, n) {
1133
1138
  localize: !1
1134
1139
  })).labels;
1135
1140
  } catch (e) {
1136
- throw T("Error in fetchLabels", e), e;
1141
+ throw w("Error in fetchLabels", e), e;
1137
1142
  }
1138
1143
  }
1139
- async function kt() {
1144
+ async function At() {
1140
1145
  try {
1141
1146
  let { app: e = "" } = r;
1142
- return P("api/v1/labels", new URLSearchParams({
1147
+ return M("api/v1/labels", new URLSearchParams({
1143
1148
  app: e,
1144
1149
  action: "getUserRights"
1145
1150
  }));
1146
1151
  } catch (e) {
1147
- throw T("Error in getUserRights", e), e;
1152
+ throw w("Error in getUserRights", e), e;
1148
1153
  }
1149
1154
  }
1150
- async function At(e, t, n = !0) {
1155
+ async function jt(e, t, n = !0) {
1151
1156
  try {
1152
- return F("api/v1/labels", {
1157
+ return P("api/v1/labels", {
1153
1158
  action: "add",
1154
1159
  labels: e,
1155
1160
  ids: t,
1156
1161
  public: n,
1157
1162
  $auditRecord: {
1158
1163
  auditEvents: [{
1159
- type: R.Label_AddDoc,
1164
+ type: L.Label_AddDoc,
1160
1165
  detail: {
1161
1166
  public: n,
1162
1167
  label: e ? e.toString() : null,
@@ -1170,19 +1175,19 @@ async function At(e, t, n = !0) {
1170
1175
  }
1171
1176
  });
1172
1177
  } catch (e) {
1173
- throw T("Error in add", e), e;
1178
+ throw w("Error in add", e), e;
1174
1179
  }
1175
1180
  }
1176
- async function jt(e, t, n = !0) {
1181
+ async function Mt(e, t, n = !0) {
1177
1182
  try {
1178
- return F("api/v1/labels", {
1183
+ return P("api/v1/labels", {
1179
1184
  action: "remove",
1180
1185
  labels: e,
1181
1186
  ids: t,
1182
1187
  public: n,
1183
1188
  $auditRecord: {
1184
1189
  auditEvents: [{
1185
- type: R.Label_RemoveDoc,
1190
+ type: L.Label_RemoveDoc,
1186
1191
  detail: {
1187
1192
  public: n,
1188
1193
  label: e ? e.toString() : null,
@@ -1196,18 +1201,18 @@ async function jt(e, t, n = !0) {
1196
1201
  }
1197
1202
  });
1198
1203
  } catch (e) {
1199
- throw T("Error in remove", e), e;
1204
+ throw w("Error in remove", e), e;
1200
1205
  }
1201
1206
  }
1202
- async function Mt(e, t, n = !0) {
1207
+ async function Nt(e, t, n = !0) {
1203
1208
  try {
1204
- return F("api/v1/labels", {
1209
+ return P("api/v1/labels", {
1205
1210
  action: "rename",
1206
1211
  labels: e,
1207
1212
  newLabel: t,
1208
1213
  public: n,
1209
1214
  auditEvents: {
1210
- type: R.Label_Rename,
1215
+ type: L.Label_Rename,
1211
1216
  detail: {
1212
1217
  public: n,
1213
1218
  oldlabel: e ? e.toString() : null,
@@ -1216,17 +1221,17 @@ async function Mt(e, t, n = !0) {
1216
1221
  }
1217
1222
  });
1218
1223
  } catch (e) {
1219
- throw T("Error in rename", e), e;
1224
+ throw w("Error in rename", e), e;
1220
1225
  }
1221
1226
  }
1222
- async function Nt(e, t = !0) {
1227
+ async function Pt(e, t = !0) {
1223
1228
  try {
1224
- return F("api/v1/labels", {
1229
+ return P("api/v1/labels", {
1225
1230
  action: "delete",
1226
1231
  labels: e,
1227
1232
  public: t,
1228
1233
  auditEvents: {
1229
- type: R.Label_Delete,
1234
+ type: L.Label_Delete,
1230
1235
  detail: {
1231
1236
  public: t,
1232
1237
  label: e ? e.toString() : null
@@ -1234,18 +1239,18 @@ async function Nt(e, t = !0) {
1234
1239
  }
1235
1240
  });
1236
1241
  } catch (e) {
1237
- throw T("Error in deleteLabels", e), e;
1242
+ throw w("Error in deleteLabels", e), e;
1238
1243
  }
1239
1244
  }
1240
- async function Pt(e, t, n = !0) {
1245
+ async function Ft(e, t, n = !0) {
1241
1246
  try {
1242
- return F("api/v1/labels", {
1247
+ return P("api/v1/labels", {
1243
1248
  action: "bulkAdd",
1244
1249
  labels: e,
1245
1250
  query: t,
1246
1251
  public: n,
1247
1252
  auditEvents: {
1248
- type: R.Label_Add,
1253
+ type: L.Label_Add,
1249
1254
  detail: {
1250
1255
  public: n,
1251
1256
  label: e ? e.toString() : null,
@@ -1254,18 +1259,18 @@ async function Pt(e, t, n = !0) {
1254
1259
  }
1255
1260
  });
1256
1261
  } catch (e) {
1257
- throw T("Error in bulkAdd", e), e;
1262
+ throw w("Error in bulkAdd", e), e;
1258
1263
  }
1259
1264
  }
1260
- async function Ft(e, t, n = !0) {
1265
+ async function It(e, t, n = !0) {
1261
1266
  try {
1262
- return F("api/v1/labels", {
1267
+ return P("api/v1/labels", {
1263
1268
  action: "bulkRemove",
1264
1269
  labels: e,
1265
1270
  query: t,
1266
1271
  public: n,
1267
1272
  auditEvents: {
1268
- type: R.Label_Delete,
1273
+ type: L.Label_Delete,
1269
1274
  detail: {
1270
1275
  public: n,
1271
1276
  label: e ? e.toString() : null,
@@ -1274,28 +1279,28 @@ async function Ft(e, t, n = !0) {
1274
1279
  }
1275
1280
  });
1276
1281
  } catch (e) {
1277
- throw T("Error in bulkRemove", e), e;
1282
+ throw w("Error in bulkRemove", e), e;
1278
1283
  }
1279
1284
  }
1280
- var It = {
1281
- getUserRights: kt,
1282
- add: At,
1283
- remove: jt,
1284
- rename: Mt,
1285
- delete: Nt,
1286
- bulkAdd: Pt,
1287
- bulkRemove: Ft
1285
+ var Lt = {
1286
+ getUserRights: At,
1287
+ add: jt,
1288
+ remove: Mt,
1289
+ rename: Nt,
1290
+ delete: Pt,
1291
+ bulkAdd: Ft,
1292
+ bulkRemove: It
1288
1293
  };
1289
1294
  //#endregion
1290
1295
  //#region src/web-api/v1/fetch-preview.ts
1291
- async function Lt(e, t) {
1292
- if (typeof window > "u") return F("api/v1/preview", {
1296
+ async function Rt(e, t) {
1297
+ if (typeof window > "u") return P("api/v1/preview", {
1293
1298
  action: "get",
1294
1299
  id: e,
1295
1300
  query: t
1296
1301
  });
1297
1302
  let n = `${window.location.origin}${window.location.pathname}`;
1298
- return F("api/v1/preview", {
1303
+ return P("api/v1/preview", {
1299
1304
  action: "get",
1300
1305
  id: e,
1301
1306
  query: {
@@ -1305,57 +1310,57 @@ async function Lt(e, t) {
1305
1310
  browserUrl: n
1306
1311
  });
1307
1312
  }
1308
- async function Rt(e) {
1313
+ async function zt(e) {
1309
1314
  let t = new Headers();
1310
- t.append("content-type", "text"), A(await fetch(e, {
1315
+ t.append("content-type", "text"), k(await fetch(e, {
1311
1316
  method: "GET",
1312
1317
  headers: t
1313
1318
  }));
1314
1319
  }
1315
1320
  //#endregion
1316
1321
  //#region src/web-api/v1/fetch-principal.ts
1317
- async function zt() {
1318
- return P("api/v1/principal", new URLSearchParams({
1322
+ async function Bt() {
1323
+ return M("api/v1/principal", new URLSearchParams({
1319
1324
  action: "get",
1320
- noAutoAuthentication: "true"
1325
+ noAutoAuthentication: String(N())
1321
1326
  }));
1322
1327
  }
1323
- async function Bt(e) {
1328
+ async function Vt(e) {
1324
1329
  let t = {
1325
- noAutoAuthentication: "true",
1330
+ noAutoAuthentication: String(N()),
1326
1331
  ...e
1327
1332
  }, n = new URLSearchParams();
1328
1333
  return Object.entries(t).forEach(([e, t]) => {
1329
1334
  t !== void 0 && n.append(e, String(t));
1330
- }), P("api/v1/principal/list", n);
1335
+ }), M("api/v1/principal/list", n);
1331
1336
  }
1332
- async function Vt(e) {
1333
- return e ? P("api/v1/principal", new URLSearchParams({
1337
+ async function Ht(e) {
1338
+ return e ? M("api/v1/principal", new URLSearchParams({
1334
1339
  action: "userid",
1335
- noAutoAuthentication: "true",
1340
+ noAutoAuthentication: String(N()),
1336
1341
  userid: e
1337
1342
  })) : Promise.reject(/* @__PURE__ */ Error("userid is required"));
1338
1343
  }
1339
- async function Ht(e) {
1340
- return e.length === 0 ? Promise.reject(/* @__PURE__ */ Error("userids is required")) : P("api/v1/principal/userids", new URLSearchParams({
1341
- noAutoAuthentication: "true",
1344
+ async function Ut(e) {
1345
+ return e.length === 0 ? Promise.reject(/* @__PURE__ */ Error("userids is required")) : M("api/v1/principal/userids", new URLSearchParams({
1346
+ noAutoAuthentication: String(N()),
1342
1347
  userids: [...e].join(",")
1343
1348
  }));
1344
1349
  }
1345
- var Ut = { principal: {
1346
- get: zt,
1347
- list: Bt,
1348
- userid: Vt,
1349
- userids: Ht
1350
- } }, Wt = 11;
1351
- async function Gt(e, t, n) {
1352
- let r = await F("api/v1/query", {
1350
+ var Wt = { principal: {
1351
+ get: Bt,
1352
+ list: Vt,
1353
+ userid: Ht,
1354
+ userids: Ut
1355
+ } }, Gt = 11;
1356
+ async function Kt(e, t, n) {
1357
+ let r = await P("api/v1/query", {
1353
1358
  query: e,
1354
1359
  $auditRecord: t,
1355
1360
  queryIntentData: n
1356
1361
  });
1357
1362
  r.aggregations.forEach((e) => {
1358
- e.$hasMore = !1, !e.isDistribution && !e.isTree && e.items && (e.$hasMore = e.items.length === Wt), e.isTree && e.items && K(e);
1363
+ e.$hasMore = !1, !e.isDistribution && !e.isTree && e.items && (e.$hasMore = e.items.length === Gt), e.isTree && e.items && K(e);
1359
1364
  }), r.records?.map((e) => Object.assign(e, {
1360
1365
  value: e.title,
1361
1366
  type: "default"
@@ -1367,7 +1372,7 @@ async function Gt(e, t, n) {
1367
1372
  };
1368
1373
  return Promise.resolve(i);
1369
1374
  }
1370
- async function Kt(e, t, n) {
1375
+ async function qt(e, t, n) {
1371
1376
  let { app: i = "" } = r, a = {
1372
1377
  methods: [],
1373
1378
  mode: t,
@@ -1379,10 +1384,10 @@ async function Kt(e, t, n) {
1379
1384
  app: i,
1380
1385
  query: t
1381
1386
  });
1382
- let o = await F("api/v1/multi", a);
1387
+ let o = await P("api/v1/multi", a);
1383
1388
  o.results.forEach((e) => {
1384
1389
  e.aggregations.forEach((e) => {
1385
- e.$hasMore = !1, !e.isDistribution && !e.isTree && e.items && (e.$hasMore = e.items.length === Wt), e.isTree && K(e);
1390
+ e.$hasMore = !1, !e.isDistribution && !e.isTree && e.items && (e.$hasMore = e.items.length === Gt), e.isTree && K(e);
1386
1391
  });
1387
1392
  }), o.results.forEach((e) => e.records?.map((e) => Object.assign(e, {
1388
1393
  value: e.title,
@@ -1407,7 +1412,7 @@ function K(e, t = "", n = 0) {
1407
1412
  }
1408
1413
  //#endregion
1409
1414
  //#region src/web-api/v1/fetch-query-export.ts
1410
- async function qt({ model: e, appName: t, query: n, article: r }) {
1415
+ async function Jt({ model: e, appName: t, query: n, article: r }) {
1411
1416
  let { webservice: i, format: a, maxcount: o, exportedColumns: s, export: c } = e, l = {
1412
1417
  app: t,
1413
1418
  webservice: i,
@@ -1421,25 +1426,25 @@ async function qt({ model: e, appName: t, query: n, article: r }) {
1421
1426
  detail: { resultid: r ? r.id : void 0 }
1422
1427
  }] }
1423
1428
  };
1424
- return G(l), await F("api/v1/search.queryexport", l, { responseType: "blob" });
1429
+ return G(l), await P("api/v1/search.queryexport", l, { responseType: "blob" });
1425
1430
  }
1426
1431
  //#endregion
1427
1432
  //#region src/web-api/v1/fetch-query-intent.ts
1428
- async function Jt(e) {
1429
- return (await F("api/v1/queryintent", { query: e }))?.intents;
1433
+ async function Yt(e) {
1434
+ return (await P("api/v1/queryintent", { query: e }))?.intents;
1430
1435
  }
1431
1436
  //#endregion
1432
1437
  //#region src/web-api/v1/fetch-similar-documents.ts
1433
- async function Yt(e, t, n) {
1434
- return (await F("api/v1/similardocuments", {
1438
+ async function Xt(e, t, n) {
1439
+ return (await P("api/v1/similardocuments", {
1435
1440
  sourceDocumentId: e,
1436
1441
  query: { name: t }
1437
1442
  }, { signal: n })).data;
1438
1443
  }
1439
1444
  //#endregion
1440
1445
  //#region src/web-api/v1/fetch-sponsored-links.ts
1441
- async function Xt(e, t) {
1442
- return (await F("api/v1/query.links", {
1446
+ async function Zt(e, t) {
1447
+ return (await P("api/v1/query.links", {
1443
1448
  webservice: e,
1444
1449
  query: t
1445
1450
  }))?.links?.map((e) => ({
@@ -1449,9 +1454,9 @@ async function Xt(e, t) {
1449
1454
  }
1450
1455
  //#endregion
1451
1456
  //#region src/utils/to-sql.ts
1452
- function Zt(e, t) {
1457
+ function Qt(e, t) {
1453
1458
  if (typeof e == "number") return `${e}`;
1454
- if (it(e)) return t ? `'${Qt(e)}'` : Qt(e);
1459
+ if (ot(e)) return t ? `'${$t(e)}'` : $t(e);
1455
1460
  if (typeof e == "boolean") return e ? "true" : "false";
1456
1461
  if (e === null) return "null";
1457
1462
  if (Array.isArray(e)) {
@@ -1462,10 +1467,10 @@ function Zt(e, t) {
1462
1467
  }
1463
1468
  return t ? `'${e}'` : e;
1464
1469
  }
1465
- function Qt(e) {
1470
+ function $t(e) {
1466
1471
  if (!e) return "";
1467
1472
  try {
1468
- return st(e) === 0 ? new Intl.DateTimeFormat("en-CA", {
1473
+ return lt(e) === 0 ? new Intl.DateTimeFormat("en-CA", {
1469
1474
  year: "numeric",
1470
1475
  month: "2-digit",
1471
1476
  day: "2-digit"
@@ -1481,7 +1486,7 @@ function Qt(e) {
1481
1486
  }
1482
1487
  //#endregion
1483
1488
  //#region src/web-api/v1/fetch-suggest.ts
1484
- async function $t(e, t, n, i, a) {
1489
+ async function en(e, t, n, i, a) {
1485
1490
  let { app: o } = r, s = {
1486
1491
  app: o || "",
1487
1492
  suggestQuery: e,
@@ -1491,14 +1496,14 @@ async function $t(e, t, n, i, a) {
1491
1496
  showSource: a
1492
1497
  };
1493
1498
  try {
1494
- return (await F("api/v1/search.suggest", s)).suggests;
1499
+ return (await P("api/v1/search.suggest", s)).suggests;
1495
1500
  } catch (e) {
1496
1501
  throw console.error("Error fetching suggestions:", e), e;
1497
1502
  }
1498
1503
  }
1499
- async function en(e, t, n, i) {
1504
+ async function tn(e, t, n, i) {
1500
1505
  let { app: a } = r;
1501
- return (await F("api/v1/suggestquery", {
1506
+ return (await P("api/v1/suggestquery", {
1502
1507
  app: a || "",
1503
1508
  suggestQuery: e,
1504
1509
  text: t,
@@ -1506,22 +1511,22 @@ async function en(e, t, n, i) {
1506
1511
  kinds: i
1507
1512
  })).suggests;
1508
1513
  }
1509
- async function tn(e, t, n) {
1514
+ async function nn(e, t, n) {
1510
1515
  if (!t) return Promise.resolve([]);
1511
- let { app: i } = r, a = await F("api/v1/suggestfield", {
1516
+ let { app: i } = r, a = await P("api/v1/suggestfield", {
1512
1517
  app: i || "",
1513
1518
  text: e,
1514
1519
  fields: t,
1515
1520
  query: n
1516
1521
  });
1517
1522
  return a.suggests.forEach((e) => {
1518
- e.display = Zt(e.display);
1523
+ e.display = Qt(e.display);
1519
1524
  }), a.suggests;
1520
1525
  }
1521
1526
  //#endregion
1522
1527
  //#region src/web-api/v1/fetch-text-chunk.ts
1523
- async function nn(e, t, n, r, i, a) {
1524
- return F("api/v1/doc.textchunks", {
1528
+ async function rn(e, t, n, r, i, a) {
1529
+ return P("api/v1/doc.textchunks", {
1525
1530
  id: e,
1526
1531
  textChunks: t,
1527
1532
  highlights: n,
@@ -1532,86 +1537,86 @@ async function nn(e, t, n, r, i, a) {
1532
1537
  }
1533
1538
  //#endregion
1534
1539
  //#region src/web-api/v1/fetch-user-settings.ts
1535
- async function rn() {
1540
+ async function an() {
1536
1541
  let { app: e } = r;
1537
- return P("api/v1/usersettings", new URLSearchParams({
1542
+ return M("api/v1/usersettings", new URLSearchParams({
1538
1543
  app: e || "",
1539
1544
  action: "load"
1540
1545
  }));
1541
1546
  }
1542
- async function an(e, t) {
1547
+ async function on(e, t) {
1543
1548
  let n = {
1544
1549
  action: "save",
1545
1550
  userSettings: e,
1546
1551
  $auditRecord: { auditEvents: [t] }
1547
1552
  };
1548
- return G(n), F("api/v1/usersettings", n);
1553
+ return G(n), P("api/v1/usersettings", n);
1549
1554
  }
1550
- async function on(e, t) {
1555
+ async function sn(e, t) {
1551
1556
  let n = {
1552
1557
  action: "patch",
1553
1558
  userSettings: e,
1554
1559
  $auditRecord: t ? { auditEvents: [t] } : void 0
1555
1560
  };
1556
- return G(n), F("api/v1/usersettings", n);
1561
+ return G(n), P("api/v1/usersettings", n);
1557
1562
  }
1558
- async function sn() {
1559
- return an({}, { type: "UserSettings_Reset" });
1563
+ async function cn() {
1564
+ return on({}, { type: "UserSettings_Reset" });
1560
1565
  }
1561
1566
  //#endregion
1562
1567
  //#region src/web-api/v2/fetch-change-password.ts
1563
- async function cn(e, t) {
1564
- return F("api/v2/security/password/change", {
1568
+ async function ln(e, t) {
1569
+ return P("api/v2/security/password/change", {
1565
1570
  newPassword: e,
1566
1571
  currentPassword: t
1567
1572
  });
1568
1573
  }
1569
1574
  //#endregion
1570
1575
  //#region src/web-api/v2/fetch-forgot-password.ts
1571
- async function ln(e) {
1572
- return F("api/v2/security/password/ask-reset-email", {
1576
+ async function un(e) {
1577
+ return P("api/v2/security/password/ask-reset-email", {
1573
1578
  changePasswordRedirectUrl: `${window.location.origin}/login?mode=changepassword`,
1574
1579
  userName: e
1575
1580
  });
1576
1581
  }
1577
1582
  //#endregion
1578
1583
  //#region src/web-api/v2/fetch-user-profile.ts
1579
- async function un(e) {
1580
- return await P(`api/v2/user-profile/${e}`);
1581
- }
1582
1584
  async function dn(e) {
1583
- return await F("api/v2/user-profile", e);
1585
+ return await M(`api/v2/user-profile/${e}`);
1584
1586
  }
1585
- async function fn(e, t, n) {
1586
- return await Re(`api/v2/user-profile/${e.data?.id}/${t}/${n}`, e);
1587
+ async function fn(e) {
1588
+ return await P("api/v2/user-profile", e);
1587
1589
  }
1588
1590
  async function pn(e, t, n) {
1591
+ return await Be(`api/v2/user-profile/${e.data?.id}/${t}/${n}`, e);
1592
+ }
1593
+ async function mn(e, t, n) {
1589
1594
  try {
1590
- return (await N(`api/v2/user-profile/${e.data?.id}/${t}/${n}`)).success === !0;
1595
+ return (await ze(`api/v2/user-profile/${e.data?.id}/${t}/${n}`)).success === !0;
1591
1596
  } catch {
1592
1597
  return !1;
1593
1598
  }
1594
1599
  }
1595
1600
  //#endregion
1596
1601
  //#region src/web-api/v2/fetch-version.ts
1597
- async function mn() {
1598
- return await P("api/v2/version");
1602
+ async function hn() {
1603
+ return await M("api/v2/version");
1599
1604
  }
1600
1605
  //#endregion
1601
1606
  //#region src/authentication/constants.ts
1602
- var q = 1e4, J = "sinequa-auth-redirect-attempt", Y = async () => {
1607
+ var q = 1e4, J = "sinequa-auth-redirect-attempt", gn = async () => {
1603
1608
  let { autoOAuthProvider: e } = r;
1604
1609
  if (!e) throw Error("autoOAuthProvider is not configured in globalConfig");
1605
1610
  if (typeof window > "u") try {
1606
- let { signal: t } = I(q);
1607
- return await F("security.oauth", {
1611
+ let { signal: t } = F(q);
1612
+ return await P("security.oauth", {
1608
1613
  action: "getcode",
1609
1614
  provider: e,
1610
1615
  tokenInCookie: !0,
1611
1616
  originalUrl: "http://localhost"
1612
1617
  }, { signal: t });
1613
1618
  } catch (e) {
1614
- throw T("Failed to authenticate with OAuth", e), e;
1619
+ throw w("Failed to authenticate with OAuth", e), e;
1615
1620
  }
1616
1621
  let t = {
1617
1622
  action: "getcode",
@@ -1620,7 +1625,7 @@ var q = 1e4, J = "sinequa-auth-redirect-attempt", Y = async () => {
1620
1625
  originalUrl: window.location.href
1621
1626
  };
1622
1627
  try {
1623
- let { signal: n } = I(q), r = await F("api/v1/security.oauth", t, { signal: n });
1628
+ let { signal: n } = F(q), r = await P("api/v1/security.oauth", t, { signal: n });
1624
1629
  if (r.redirectUrl) {
1625
1630
  let t = new URL(r.redirectUrl, window.location.origin);
1626
1631
  if (t.protocol === "https:" || t.protocol === "http:") {
@@ -1630,21 +1635,21 @@ var q = 1e4, J = "sinequa-auth-redirect-attempt", Y = async () => {
1630
1635
  }
1631
1636
  return r;
1632
1637
  } catch (e) {
1633
- throw T("Failed to authenticate with OAuth", e), e;
1638
+ throw w("Failed to authenticate with OAuth", e), e;
1634
1639
  }
1635
- }, hn = async () => {
1640
+ }, _n = async () => {
1636
1641
  let { autoSAMLProvider: e } = r;
1637
1642
  if (!e) throw Error("autoSAMLProvider is not configured in globalConfig");
1638
1643
  if (typeof window > "u") try {
1639
- let { signal: t } = I(q);
1640
- return await F("security.saml", {
1644
+ let { signal: t } = F(q);
1645
+ return await P("security.saml", {
1641
1646
  action: "getresponse",
1642
1647
  provider: e,
1643
1648
  tokenInCookie: !0,
1644
1649
  originalUrl: "http://localhost"
1645
1650
  }, { signal: t });
1646
1651
  } catch (e) {
1647
- throw T("Failed to authenticate with SAML", e), e;
1652
+ throw w("Failed to authenticate with SAML", e), e;
1648
1653
  }
1649
1654
  let t = {
1650
1655
  action: "getresponse",
@@ -1653,7 +1658,7 @@ var q = 1e4, J = "sinequa-auth-redirect-attempt", Y = async () => {
1653
1658
  originalUrl: window.location.href
1654
1659
  };
1655
1660
  try {
1656
- let { signal: n } = I(q), r = await F("api/v1/security.saml", t, { signal: n });
1661
+ let { signal: n } = F(q), r = await P("api/v1/security.saml", t, { signal: n });
1657
1662
  if (r.redirectUrl) {
1658
1663
  let t = new URL(r.redirectUrl, window.location.origin);
1659
1664
  if (t.protocol === "https:" || t.protocol === "http:") {
@@ -1663,21 +1668,21 @@ var q = 1e4, J = "sinequa-auth-redirect-attempt", Y = async () => {
1663
1668
  }
1664
1669
  return r;
1665
1670
  } catch (e) {
1666
- throw T("Failed to authenticate with SAML", e), e;
1671
+ throw w("Failed to authenticate with SAML", e), e;
1667
1672
  }
1668
- }, X = (e) => u("sinequa-credentials", JSON.stringify({ data: { csrfToken: e } })), Z = async () => {
1673
+ }, Y = (e) => u("sinequa-credentials", JSON.stringify({ data: { csrfToken: e } })), X = async () => {
1669
1674
  let e;
1670
1675
  try {
1671
- let { signal: t } = I(q);
1672
- e = await P("api/v1/challenge?action=getCsrfToken&suppressErrors=true", void 0, { signal: t });
1676
+ let { signal: t } = F(q);
1677
+ e = await M("api/v1/challenge?action=getCsrfToken&suppressErrors=true", void 0, { signal: t });
1673
1678
  } catch (e) {
1674
- throw w("CSRF token fetch failed", e), e;
1679
+ throw C("CSRF token fetch failed", e), e;
1675
1680
  }
1676
- return e?.csrfToken ? (X(e.csrfToken), e.csrfToken) : null;
1681
+ return e?.csrfToken ? (Y(e.csrfToken), e.csrfToken) : null;
1677
1682
  };
1678
1683
  //#endregion
1679
1684
  //#region src/authentication/tokens/get-jwt-token.ts
1680
- async function Q(e) {
1685
+ async function Z(e) {
1681
1686
  if (e) {
1682
1687
  let { username: t, password: n } = e, r = {
1683
1688
  action: "get",
@@ -1688,10 +1693,10 @@ async function Q(e) {
1688
1693
  noAutoAuthentication: !0
1689
1694
  };
1690
1695
  try {
1691
- let { signal: e } = I(q), t = await F("api/v1/security.webtoken", r, { signal: e });
1692
- return t?.csrfToken ? (X(t.csrfToken), t.csrfToken) : null;
1696
+ let { signal: e } = F(q), t = await P("api/v1/security.webtoken", r, { signal: e });
1697
+ return t?.csrfToken ? (Y(t.csrfToken), t.csrfToken) : null;
1693
1698
  } catch (e) {
1694
- throw T("Failed to get JWT", e), e;
1699
+ throw w("Failed to get JWT", e), e;
1695
1700
  }
1696
1701
  } else {
1697
1702
  let e = {
@@ -1704,68 +1709,70 @@ async function Q(e) {
1704
1709
  let n = new Headers();
1705
1710
  n.append("Sinequa-Force-Camel-Case", "true"), n.append("accept", "application/json"), n.append("Content-Type", "application/json"), n.append("Authorization", `Bearer ${t}`);
1706
1711
  try {
1707
- let { signal: t } = I(q), r = await F("api/v1/security.webtoken", e, {
1712
+ let { signal: t } = F(q), r = await P("api/v1/security.webtoken", e, {
1708
1713
  headers: n,
1709
1714
  signal: t
1710
1715
  });
1711
- return r?.csrfToken ? (X(r.csrfToken), r.csrfToken) : null;
1716
+ return r?.csrfToken ? (Y(r.csrfToken), r.csrfToken) : null;
1712
1717
  } catch (e) {
1713
- throw T("Failed to get JWT without credentials", e), e;
1718
+ throw w("Failed to get JWT without credentials", e), e;
1714
1719
  }
1715
1720
  }
1716
1721
  }
1717
1722
  //#endregion
1718
1723
  //#region src/authentication/tokens/get-token.ts
1719
- var $ = () => {
1724
+ var Q = () => {
1720
1725
  let e = l("sinequa-credentials");
1721
1726
  if (e) try {
1722
1727
  let t = JSON.parse(e).data?.csrfToken;
1723
1728
  if (t) return t;
1724
1729
  } catch (e) {
1725
- w("Failed to parse session storage credentials, falling back to local storage", e);
1730
+ C("Failed to parse session storage credentials, falling back to local storage", e);
1726
1731
  }
1727
1732
  return s("csrfToken") || null;
1728
- }, gn = async () => {
1733
+ }, $ = "sinequa-authenticated", vn = (e) => {
1734
+ e ? u($, "true") : d($);
1735
+ }, yn = () => l($) === "true", bn = async () => {
1729
1736
  try {
1730
- let { signal: e } = I(q);
1731
- return await P("api/v1/principal", new URLSearchParams({ action: "get" }), {
1737
+ let { signal: e } = F(q);
1738
+ return await M("api/v1/principal", new URLSearchParams({ action: "get" }), {
1732
1739
  signal: e,
1733
1740
  redirect: "manual"
1734
- }), C("Server auto-authenticated the user (OIDC)"), !0;
1741
+ }), S("Server auto-authenticated the user (OIDC)"), !0;
1735
1742
  } catch {
1736
1743
  return !1;
1737
1744
  }
1738
- }, _n = async (n) => {
1745
+ }, xn = async (n) => {
1739
1746
  if (n) {
1740
1747
  let { username: t, password: r } = n;
1741
- return !t || !r ? (T("Credentials are required for authentication"), e(!1), !1) : vn({
1748
+ return !t || !r ? (w("Credentials are required for authentication"), e(!1), !1) : Sn({
1742
1749
  username: t,
1743
1750
  password: r
1744
1751
  });
1745
1752
  }
1746
1753
  let a = r.authMode ?? t.unknown();
1747
1754
  if (a.kind === "credentials") return e(!1), !1;
1748
- if (a.kind === "bearer") return yn();
1749
- if ($()) return i({ isRedirectUrl: !1 }), d(J), e(!0), !0;
1755
+ if (a.kind === "bearer") return Cn();
1756
+ if (Q()) return i({ isRedirectUrl: !1 }), d(J), e(!0), !0;
1750
1757
  try {
1751
- if (C("Checking for an existing session via CSRF token retrieval"), await Z()) return C("User already authenticated (existing session / SSO)"), d(J), a.kind === "unknown" && i({ authMode: t.sso() }), e(!0), !0;
1758
+ if (S("Checking for an existing session via CSRF token retrieval"), await X()) return S("User already authenticated (existing session / SSO)"), d(J), a.kind === "unknown" && i({ authMode: t.sso() }), e(!0), !0;
1752
1759
  } catch {}
1753
1760
  switch (a.kind) {
1754
- case "oauth": return C("Initiating OAuth authentication flow"), await Y(), e(!1), !1;
1755
- case "saml": return C("Initiating SAML authentication flow"), await hn(), e(!1), !1;
1761
+ case "oauth": return S("Initiating OAuth authentication flow"), await gn(), e(!1), !1;
1762
+ case "saml": return S("Initiating SAML authentication flow"), await _n(), e(!1), !1;
1756
1763
  case "sso": return e(!1), !1;
1757
- default: return C("No provider declared — probing for server-side auto-authentication (OIDC)"), await gn() ? (C("User auto-authenticated by the server (OIDC)"), d(J), i({ authMode: t.sso() }), await Z().catch(() => {}), e(!0), !0) : (i({ authMode: t.credentials() }), e(!1), !1);
1764
+ default: return S("No provider declared — probing for server-side auto-authentication (OIDC)"), await bn() ? (S("User auto-authenticated by the server (OIDC)"), d(J), i({ authMode: t.sso() }), await X().catch(() => {}), vn(!0), e(!0), !0) : (i({ authMode: t.credentials() }), e(!1), !1);
1758
1765
  }
1759
1766
  };
1760
- async function vn(n) {
1761
- C("Attempting authentication using credentials"), i({ authMode: t.credentials() });
1767
+ async function Sn(n) {
1768
+ S("Attempting authentication using credentials"), i({ authMode: t.credentials() });
1762
1769
  let { userOverrideActive: a, userOverride: o } = r;
1763
1770
  i({
1764
1771
  userOverrideActive: !1,
1765
1772
  userOverride: void 0
1766
1773
  });
1767
1774
  try {
1768
- await Q(n);
1775
+ await Z(n);
1769
1776
  } catch (t) {
1770
1777
  throw e(!1), t;
1771
1778
  }
@@ -1774,41 +1781,41 @@ async function vn(n) {
1774
1781
  userOverride: o
1775
1782
  }), e(!0), !0;
1776
1783
  }
1777
- async function yn() {
1784
+ async function Cn() {
1778
1785
  try {
1779
- if (C("Attempting authentication using bearer token"), await Q()) return e(!0), !0;
1786
+ if (S("Attempting authentication using bearer token"), await Z()) return e(!0), !0;
1780
1787
  } catch (t) {
1781
- throw T("Bearer authentication failed", t), e(!1), t;
1788
+ throw w("Bearer authentication failed", t), e(!1), t;
1782
1789
  }
1783
1790
  return e(!1), !1;
1784
1791
  }
1785
1792
  //#endregion
1786
1793
  //#region src/authentication/tokens/delete-web-token-cookie.ts
1787
- var bn = async () => {
1794
+ var wn = async () => {
1788
1795
  let e = new URLSearchParams({
1789
1796
  action: "deleteWebTokenCookie",
1790
1797
  noUserOverride: "true",
1791
1798
  noAutoAuthentication: "true"
1792
- }), { signal: t } = I(q);
1793
- return P("api/v1/challenge", e, { signal: t });
1799
+ }), { signal: t } = F(q);
1800
+ return M("api/v1/challenge", e, { signal: t });
1794
1801
  };
1795
1802
  //#endregion
1796
1803
  //#region src/authentication/session/logout.ts
1797
- async function xn() {
1804
+ async function Tn() {
1798
1805
  let { userOverrideActive: e } = r;
1799
- if (Sn(), !e) try {
1800
- let { methodresult: e, logoutUrl: t } = await bn();
1806
+ if (En(), !e) try {
1807
+ let { methodresult: e, logoutUrl: t } = await wn();
1801
1808
  if (e === "ok") return t;
1802
- T("logout failed");
1809
+ w("logout failed");
1803
1810
  } catch (e) {
1804
- T("logout failed", e);
1811
+ w("logout failed", e);
1805
1812
  }
1806
1813
  }
1807
- function Sn() {
1808
- c("csrfToken"), d("sinequa-credentials"), e(!1);
1814
+ function En() {
1815
+ c("csrfToken"), d("sinequa-credentials"), vn(!1), e(!1);
1809
1816
  }
1810
1817
  //#endregion
1811
1818
  //#region src/authentication/session/user-authentication.ts
1812
- var Cn = () => !!$();
1819
+ var Dn = () => !!Q() || yn();
1813
1820
  //#endregion
1814
- export { vt as $, Ee as $t, Jt as A, ze as At, Lt as B, O as Bt, an as C, r as Cn, R as Ct, en as D, e as Dn, Be as Dt, tn as E, n as En, Ve as Et, Ut as F, M as Ft, Dt as G, S as Gt, Ot as H, E as Ht, zt as I, Le as It, xt as J, w as Jt, Et as K, T as Kt, Bt as L, A as Lt, K as M, Re as Mt, Kt as N, P as Nt, Xt as O, L as Ot, Gt as P, N as Pt, yt as Q, g as Qt, Vt as R, k as Rt, on as S, te as Sn, z as St, $t as T, t as Tn, He as Tt, It as U, Pe as Ut, Rt as V, D as Vt, Tt as W, Fe as Wt, Ct as X, Me as Xt, St as Y, Ne as Yt, bt as Z, je as Zt, fn as _, ee as _n, V as _t, _n as a, Te as an, ct as at, sn as b, ne as bn, We as bt, Q as c, Se as cn, it as ct, hn as d, be as dn, at as dt, Oe as en, G as et, Y as f, m as fn, ut as ft, un as g, oe as gn, Xe as gt, pn as h, h as hn, Qe as ht, bn as i, De as in, st as it, qt as j, F as jt, Yt as k, I as kt, Z as l, xe as ln, ot as lt, dn as m, ye as mn, tt as mt, Sn as n, we as nn, mt as nt, gn as o, _ as on, nt as ot, mn as p, ve as pn, et as pt, wt as q, C as qt, xn as r, Ae as rn, lt as rt, $ as s, Ce as sn, rt as st, Cn as t, ke as tn, pt as tt, X as u, _e as un, H as ut, ln as v, re as vn, Ke as vt, nn as w, i as wn, Ue as wt, rn as x, ie as xn, B as xt, cn as y, f as yn, Ge as yt, Ht as z, Ie as zt };
1821
+ export { yt as $, h as $t, Yt as A, Ve as At, Rt as B, Le as Bt, on as C, te as Cn, L as Ct, tn as D, n as Dn, He as Dt, nn as E, t as En, Ue as Et, Wt as F, ze as Ft, Ot as G, Ie as Gt, kt as H, E as Ht, Bt as I, j as It, St as J, S as Jt, Dt as K, x as Kt, Vt as L, Re as Lt, K as M, Be as Mt, qt as N, N as Nt, Zt as O, e as On, I as Ot, Kt as P, M as Pt, bt as Q, Me as Qt, Ht as R, k as Rt, sn as S, ae as Sn, R as St, en as T, i as Tn, We as Tt, Lt as U, T as Ut, zt as V, D as Vt, Et as W, Fe as Wt, wt as X, Pe as Xt, Ct as Y, C as Yt, xt as Z, Ne as Zt, pn as _, oe as _n, B as _t, xn as a, Oe as an, H as at, cn as b, ie as bn, Ke as bt, Z as c, we as cn, ot as ct, _n as d, ve as dn, st as dt, De as en, G as et, gn as f, xe as fn, dt as ft, dn as g, m as gn, Qe as gt, mn as h, be as hn, et as ht, wn as i, je as in, lt as it, Jt as j, P as jt, Xt as k, F as kt, X as l, Ce as ln, ct as lt, fn as m, ye as mn, rt as mt, En as n, Ae as nn, ht as nt, bn as o, Ee as on, it as ot, hn as p, p as pn, nt as pt, Tt as q, w as qt, Tn as r, Te as rn, ut as rt, Q as s, g as sn, at as st, Dn as t, ke as tn, mt as tt, Y as u, Se as un, V as ut, un as v, ee as vn, Je as vt, rn as w, r as wn, Ge as wt, an as x, ne as xn, z as xt, ln as y, re as yn, qe as yt, Ut as z, O as zt };