@sinequa/atomic 2.4.0 → 2.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (37) hide show
  1. package/README.md +406 -406
  2. package/dist/atomic.cjs +1 -1
  3. package/dist/atomic.js +2 -2
  4. package/dist/client/create-api.d.ts +3 -3
  5. package/dist/helpers/column-resolver.d.ts.map +1 -1
  6. package/dist/helpers/utils.d.ts +13 -3
  7. package/dist/helpers/utils.d.ts.map +1 -1
  8. package/dist/spfx/index.cjs +1 -1
  9. package/dist/spfx/index.js +2 -2
  10. package/dist/src-BcyahlCg.cjs +1 -0
  11. package/dist/{src-DQM5GZF-.js → src-vDryIxd0.js} +594 -567
  12. package/dist/types/search/Article.d.ts +8 -0
  13. package/dist/types/search/Article.d.ts.map +1 -1
  14. package/dist/types/search/DidYouMeanItem.d.ts +29 -1
  15. package/dist/types/search/DidYouMeanItem.d.ts.map +1 -1
  16. package/dist/types/search/QueryIntent.d.ts +8 -1
  17. package/dist/types/search/QueryIntent.d.ts.map +1 -1
  18. package/dist/types/search/QueryIntentDatasets.d.ts +0 -3
  19. package/dist/types/search/QueryIntentDatasets.d.ts.map +1 -1
  20. package/dist/types/search/index.d.ts +3 -1
  21. package/dist/types/search/index.d.ts.map +1 -1
  22. package/dist/utils/date.d.ts +10 -2
  23. package/dist/utils/date.d.ts.map +1 -1
  24. package/dist/utils/query-params.d.ts +20 -3
  25. package/dist/utils/query-params.d.ts.map +1 -1
  26. package/dist/web-api/helpers/handle-response.d.ts.map +1 -1
  27. package/dist/web-api/v1/fetch-labels.d.ts.map +1 -1
  28. package/dist/web-api/v1/fetch-preview.d.ts +11 -4
  29. package/dist/web-api/v1/fetch-preview.d.ts.map +1 -1
  30. package/dist/web-api/v1/fetch-query.d.ts +10 -3
  31. package/dist/web-api/v1/fetch-query.d.ts.map +1 -1
  32. package/dist/web-api/v2/fetch-forgot-password.d.ts +5 -1
  33. package/dist/web-api/v2/fetch-forgot-password.d.ts.map +1 -1
  34. package/package.json +1 -1
  35. package/dist/src-yvCcJDJS.cjs +0 -1
  36. package/dist/types/interfaces/json.d.ts +0 -7
  37. package/dist/types/interfaces/json.d.ts.map +0 -1
@@ -328,9 +328,9 @@ var O = class extends Error {
328
328
  //#endregion
329
329
  //#region src/web-api/helpers/handle-response.ts
330
330
  async function Te(e, t = "json") {
331
- return j(g, e, t);
331
+ return Ee(g, e, t);
332
332
  }
333
- async function j(e, t, n = "json", r = t.url ?? "") {
333
+ async function Ee(e, t, n = "json", r = t.url ?? "") {
334
334
  let i = t.headers.get("sinequa-jwt-refresh");
335
335
  if (i !== null && A(e, i), t.status >= 200 && t.status < 300) {
336
336
  if (n === "response") return t;
@@ -349,16 +349,25 @@ async function j(e, t, n = "json", r = t.url ?? "") {
349
349
  try {
350
350
  n = await (t.clone?.() ?? t).json();
351
351
  } catch {}
352
- throw _(e).warn("Unauthorized access attempt with user override", {
352
+ _(e).warn("Unauthorized access attempt with user override", {
353
353
  endpoint: t.url ?? "",
354
354
  error: n
355
- }), new k(n.errorMessage ?? n.message ?? "Unauthorized... User override failed.");
355
+ });
356
+ let i = new k(n.errorMessage ?? n.message ?? "Unauthorized... User override failed.");
357
+ throw e.events.emit("requestFailed", {
358
+ endpoint: r,
359
+ status: 401,
360
+ error: i
361
+ }), e.events.emit("unauthorized", {
362
+ endpoint: r,
363
+ error: i
364
+ }), i;
356
365
  }
357
- return await Ee(e, t, 401, r);
366
+ return await De(e, t, 401, r);
358
367
  }
359
- return t.status === 500 ? (_(e).error("Server error occurred", { endpoint: r }), await Ee(e, t, 500, r)) : (_(e).warn(`Unexpected response status: ${t.status}`, { endpoint: r }), await Ee(e, t, t.status, r));
368
+ return t.status === 500 ? (_(e).error("Server error occurred", { endpoint: r }), await De(e, t, 500, r)) : (_(e).warn(`Unexpected response status: ${t.status}`, { endpoint: r }), await De(e, t, t.status, r));
360
369
  }
361
- async function Ee(e, t, n, r) {
370
+ async function De(e, t, n, r) {
362
371
  let i = "";
363
372
  try {
364
373
  i = await t.text() ?? "";
@@ -383,17 +392,17 @@ async function Ee(e, t, n, r) {
383
392
  }
384
393
  //#endregion
385
394
  //#region src/web-api/helpers/utils/resolve-no-auto-authentication.ts
386
- function M(e) {
395
+ function j(e) {
387
396
  return e.config.authMode?.kind !== "sso";
388
397
  }
389
- function De() {
390
- return M(g);
398
+ function Oe() {
399
+ return j(g);
391
400
  }
392
401
  //#endregion
393
402
  //#region src/web-api/helpers/methods/send-request.ts
394
- var Oe = /* @__PURE__ */ new WeakMap();
395
- function ke(e, t, n) {
396
- let r = Oe.get(e);
403
+ var ke = /* @__PURE__ */ new WeakMap();
404
+ function Ae(e, t, n) {
405
+ let r = ke.get(e);
397
406
  if (r) return r;
398
407
  if (ve(e)) return _(e).debug(`Skipping session recovery for ${t}: the user signed out`), Promise.resolve(!1);
399
408
  let i = e.config.auth?.recoverFromUnauthorized;
@@ -401,81 +410,81 @@ function ke(e, t, n) {
401
410
  let a = Promise.resolve(i({
402
411
  endpoint: t,
403
412
  error: n
404
- })).catch((t) => (_(e).debug("Session recovery failed", t), !1)).finally(() => Oe.delete(e));
405
- return Oe.set(e, a), a;
413
+ })).catch((t) => (_(e).debug("Session recovery failed", t), !1)).finally(() => ke.delete(e));
414
+ return ke.set(e, a), a;
406
415
  }
407
- async function Ae(e, t, n, r) {
416
+ async function je(e, t, n, r) {
408
417
  let i = e.resolveHttpAdapter();
409
- return i ? j(e, await i.fetch(t, {
418
+ return i ? Ee(e, await i.fetch(t, {
410
419
  ...n,
411
420
  signal: r?.signal
412
- }), r?.responseType, t) : j(e, await me(e)(t, {
421
+ }), r?.responseType, t) : Ee(e, await me(e)(t, {
413
422
  ...n,
414
423
  credentials: he(e),
415
424
  signal: r?.signal,
416
425
  redirect: r?.redirect
417
426
  }), r?.responseType, t);
418
427
  }
419
- async function N(e, t, n, r) {
428
+ async function M(e, t, n, r) {
420
429
  try {
421
- return await Ae(e, t, n, r);
430
+ return await je(e, t, n, r);
422
431
  } catch (i) {
423
- if (!(i instanceof k) || r?.noRecovery || !await ke(e, t, i)) throw i;
432
+ if (!(i instanceof k) || r?.noRecovery || !await Ae(e, t, i)) throw i;
424
433
  _(e).debug("Session recovered — replaying the request once");
425
434
  let a = new Headers(n.headers), o = T(e);
426
- return o && a.set("Sinequa-csrf-token", o), Ae(e, t, {
435
+ return o && a.set("Sinequa-csrf-token", o), je(e, t, {
427
436
  ...n,
428
437
  headers: a
429
438
  }, r);
430
439
  }
431
440
  }
432
- function je() {
441
+ function Me() {
433
442
  return typeof navigator > "u" ? void 0 : navigator.language;
434
443
  }
435
- function P(e, t, n) {
444
+ function N(e, t, n) {
436
445
  let { uiLanguage: r } = e.config;
437
446
  return JSON.stringify({
438
447
  app: e.config.app,
439
448
  ...t,
440
- locale: t.locale || r || je(),
449
+ locale: t.locale || r || Me(),
441
450
  ...r ? { "ui-language": r } : {},
442
451
  noUserOverride: !e.config.userOverrideActive,
443
- noAutoAuthentication: n?.noAutoAuthentication ?? M(e)
452
+ noAutoAuthentication: n?.noAutoAuthentication ?? j(e)
444
453
  });
445
454
  }
446
455
  //#endregion
447
456
  //#region src/web-api/helpers/methods/post.ts
448
- async function F(e, t, n, r) {
457
+ async function P(e, t, n, r) {
449
458
  let i = E(e, r?.headers);
450
459
  i.has("Content-Type") || i.set("Content-Type", "application/json");
451
460
  let a = D(e, t);
452
461
  _(e).debug(`Making POST request to: ${a}`);
453
462
  try {
454
- return await N(e, a, {
463
+ return await M(e, a, {
455
464
  method: "POST",
456
465
  headers: i,
457
- body: P(e, n, r)
466
+ body: N(e, n, r)
458
467
  }, r);
459
468
  } catch (t) {
460
469
  throw _(e).error("Error making POST request:", t), t;
461
470
  }
462
471
  }
463
- async function Me(e, t, n) {
464
- return F(g, e, t, n);
472
+ async function Ne(e, t, n) {
473
+ return P(g, e, t, n);
465
474
  }
466
475
  //#endregion
467
476
  //#region src/web-api/helpers/errors/timeout-error.ts
468
- var Ne = class extends O {
477
+ var Pe = class extends O {
469
478
  constructor(e = "Request timed out") {
470
479
  super(e, 408), this.name = "TimeoutError";
471
480
  }
472
481
  };
473
482
  //#endregion
474
483
  //#region src/web-api/helpers/utils/create-timeout-controller.ts
475
- function I(e) {
484
+ function F(e) {
476
485
  let t = new AbortController(), { signal: n } = t;
477
486
  return e && setTimeout(() => {
478
- n.aborted || t.abort(new Ne(`Request timed out after ${e}ms`));
487
+ n.aborted || t.abort(new Pe(`Request timed out after ${e}ms`));
479
488
  }, e), {
480
489
  controller: t,
481
490
  signal: n
@@ -483,7 +492,7 @@ function I(e) {
483
492
  }
484
493
  //#endregion
485
494
  //#region src/authentication/providers/redirect-to-identity-provider.ts
486
- var Pe = {
495
+ var Fe = {
487
496
  oauth: {
488
497
  label: "OAuth",
489
498
  endpoint: "api/v1/security.oauth",
@@ -495,8 +504,8 @@ var Pe = {
495
504
  action: "getresponse"
496
505
  }
497
506
  };
498
- async function Fe(e, { kind: t, provider: n }) {
499
- let { label: r, endpoint: i, action: a } = Pe[t], o = typeof window < "u", s = v(e, "session"), c = y(e, w);
507
+ async function Ie(e, { kind: t, provider: n }) {
508
+ let { label: r, endpoint: i, action: a } = Fe[t], o = typeof window < "u", s = v(e, "session"), c = y(e, w);
500
509
  if (o && s.get(c)) throw Error(`${r} sign-in with provider "${n}" did not establish a session — its callback is likely not authorized for this application.`);
501
510
  let l = {
502
511
  action: a,
@@ -505,8 +514,8 @@ async function Fe(e, { kind: t, provider: n }) {
505
514
  originalUrl: typeof window > "u" ? "http://localhost" : window.location.href
506
515
  }, u;
507
516
  try {
508
- let { signal: t } = I(S(e));
509
- u = await F(e, i, l, { signal: t });
517
+ let { signal: t } = F(S(e));
518
+ u = await P(e, i, l, { signal: t });
510
519
  } catch (t) {
511
520
  throw _(e).error(`Failed to authenticate with ${r}`, t), t;
512
521
  }
@@ -516,24 +525,24 @@ async function Fe(e, { kind: t, provider: n }) {
516
525
  }
517
526
  //#endregion
518
527
  //#region src/authentication/providers/oauth-authentication.ts
519
- var Ie = async (e) => {
528
+ var Le = async (e) => {
520
529
  let t = ee(e.config);
521
530
  if (!t) throw Error("No OAuth provider configured: set `authMode: AuthMode.oauth(provider)`, or the `autoOAuthProvider` key.");
522
- return Fe(e, {
531
+ return Ie(e, {
523
532
  kind: "oauth",
524
533
  provider: t
525
534
  });
526
- }, Le = () => Ie(g), Re = async (e) => {
535
+ }, Re = () => Le(g), ze = async (e) => {
527
536
  let t = te(e.config);
528
537
  if (!t) throw Error("No SAML provider configured: set `authMode: AuthMode.saml(provider)`, or the `autoSAMLProvider` key.");
529
- return Fe(e, {
538
+ return Ie(e, {
530
539
  kind: "saml",
531
540
  provider: t
532
541
  });
533
- }, ze = () => Re(g);
542
+ }, Be = () => ze(g);
534
543
  //#endregion
535
544
  //#region src/authentication/session/detect-auth-mode.ts
536
- function Be(e, t) {
545
+ function Ve(e, t) {
537
546
  if (e.authMode && e.authMode.kind !== "unknown") return e.authMode;
538
547
  if (e.bearerToken) return f.bearer(e.bearerToken);
539
548
  let n = e.autoOAuthProvider || t?.autoOAuthProvider;
@@ -543,13 +552,13 @@ function Be(e, t) {
543
552
  }
544
553
  //#endregion
545
554
  //#region src/web-api/helpers/methods/get.ts
546
- async function L(e, t, n, r) {
555
+ async function I(e, t, n, r) {
547
556
  let i = E(e, r?.headers), a = n;
548
557
  r?.noAutoAuthentication !== void 0 && (a = new URLSearchParams(n), a.set("noAutoAuthentication", String(r.noAutoAuthentication)));
549
558
  let o = D(e, t, a);
550
559
  _(e).debug(`Making GET request to: ${o}`);
551
560
  try {
552
- return await N(e, o, {
561
+ return await M(e, o, {
553
562
  method: "GET",
554
563
  headers: i
555
564
  }, r);
@@ -557,16 +566,16 @@ async function L(e, t, n, r) {
557
566
  throw _(e).error("Error making GET request:", t), t;
558
567
  }
559
568
  }
560
- async function Ve(e, t, n) {
561
- return L(g, e, t, n);
569
+ async function He(e, t, n) {
570
+ return I(g, e, t, n);
562
571
  }
563
572
  //#endregion
564
573
  //#region src/authentication/tokens/get-csrf-token.ts
565
- var He = async (e) => {
574
+ var Ue = async (e) => {
566
575
  let t;
567
576
  try {
568
- let { signal: n } = I(S(e));
569
- t = await L(e, "api/v1/challenge?action=getCsrfToken&suppressErrors=true", void 0, {
577
+ let { signal: n } = F(S(e));
578
+ t = await I(e, "api/v1/challenge?action=getCsrfToken&suppressErrors=true", void 0, {
570
579
  signal: n,
571
580
  noRecovery: !0
572
581
  });
@@ -574,32 +583,32 @@ var He = async (e) => {
574
583
  throw _(e).warn("CSRF token fetch failed", t), t;
575
584
  }
576
585
  return t?.csrfToken ? (A(e, t.csrfToken), t.csrfToken) : null;
577
- }, Ue = () => He(g);
586
+ }, We = () => Ue(g);
578
587
  //#endregion
579
588
  //#region src/authentication/session/has-session.ts
580
- async function We(e) {
581
- if (T(e)) return _(e).info("Existing session (stored token)"), Ge(e), !0;
589
+ async function Ge(e) {
590
+ if (T(e)) return _(e).info("Existing session (stored token)"), Ke(e), !0;
582
591
  try {
583
- return _(e).info("Checking for an existing session via CSRF token retrieval"), await He(e) === null ? !1 : (Ge(e), !0);
592
+ return _(e).info("Checking for an existing session via CSRF token retrieval"), await Ue(e) === null ? !1 : (Ke(e), !0);
584
593
  } catch (t) {
585
594
  return _(e).debug("CSRF session probe failed — treated as no existing session", t), !1;
586
595
  }
587
596
  }
588
- function Ge(e) {
597
+ function Ke(e) {
589
598
  v(e, "session").remove(y(e, w));
590
599
  }
591
- var Ke = () => We(g);
600
+ var qe = () => Ge(g);
592
601
  //#endregion
593
602
  //#region src/helpers/ts-helper.ts
594
- function qe(e) {
603
+ function Je(e) {
595
604
  throw Error(`Unexpected value: ${JSON.stringify(e)}`);
596
605
  }
597
606
  //#endregion
598
607
  //#region src/authentication/tokens/get-jwt-token.ts
599
- async function Je(e, t, n) {
608
+ async function Ye(e, t, n) {
600
609
  if (t) {
601
610
  let { username: n, password: r } = t;
602
- return Ze(e, {
611
+ return Qe(e, {
603
612
  action: "get",
604
613
  tokenInCookie: !0,
605
614
  user: n,
@@ -607,18 +616,18 @@ async function Je(e, t, n) {
607
616
  }, !0, "Failed to get JWT");
608
617
  }
609
618
  if (!p(e.config)) throw Error("A bearer token is required for credential-less authentication: set `authMode: AuthMode.bearer(token)`, or the legacy `bearerToken` key.");
610
- return Ze(e, {
619
+ return Qe(e, {
611
620
  action: "get",
612
621
  tokenInCookie: !0
613
622
  }, !1, "Failed to get JWT without credentials", n?.recoverable);
614
623
  }
615
- async function Ye(e) {
616
- return Je(g, e);
624
+ async function Xe(e) {
625
+ return Ye(g, e);
617
626
  }
618
- var Xe = Ye;
619
- async function Ze(e, t, n, r, i = !1) {
627
+ var Ze = Xe;
628
+ async function Qe(e, t, n, r, i = !1) {
620
629
  try {
621
- let { signal: r } = I(S(e)), i = await F(e, "api/v1/security.webtoken", t, {
630
+ let { signal: r } = F(S(e)), i = await P(e, "api/v1/security.webtoken", t, {
622
631
  signal: r,
623
632
  noAutoAuthentication: n,
624
633
  noRecovery: !0
@@ -630,25 +639,25 @@ async function Ze(e, t, n, r, i = !1) {
630
639
  }
631
640
  //#endregion
632
641
  //#region src/authentication/session/auth-mode-marker.ts
633
- var Qe = (e) => ({
642
+ var $e = (e) => ({
634
643
  storage: v(e, "local"),
635
644
  key: y(e, C.lastAuthMode)
636
- }), $e = (e) => {
637
- let { storage: t, key: n } = Qe(e);
645
+ }), et = (e) => {
646
+ let { storage: t, key: n } = $e(e);
638
647
  t.set(n, "credentials");
639
- }, et = (e) => {
640
- let { storage: t, key: n } = Qe(e);
641
- return t.get(n) === "credentials";
642
648
  }, tt = (e) => {
643
- let { storage: t, key: n } = Qe(e);
649
+ let { storage: t, key: n } = $e(e);
650
+ return t.get(n) === "credentials";
651
+ }, nt = (e) => {
652
+ let { storage: t, key: n } = $e(e);
644
653
  t.remove(n);
645
- }, nt = (e, t) => {
654
+ }, rt = (e, t) => {
646
655
  let n = v(e, "session"), r = y(e, C.authenticated);
647
656
  t ? n.set(r, "true") : n.remove(r);
648
- }, rt = (e) => v(e, "session").get(y(e, C.authenticated)) === "true", it = "api/v1/principal", at = async (e) => {
657
+ }, it = (e) => v(e, "session").get(y(e, C.authenticated)) === "true", at = "api/v1/principal", ot = async (e) => {
649
658
  try {
650
- let { signal: t } = I(S(e));
651
- return await L(e, e.config.auth?.probeEndpoint ?? it, new URLSearchParams({ action: "get" }), {
659
+ let { signal: t } = F(S(e));
660
+ return await I(e, e.config.auth?.probeEndpoint ?? at, new URLSearchParams({ action: "get" }), {
652
661
  signal: t,
653
662
  redirect: "manual",
654
663
  noRecovery: !0
@@ -656,46 +665,46 @@ var Qe = (e) => ({
656
665
  } catch (t) {
657
666
  return _(e).debug("Protected-endpoint probe failed — not authenticated", t), !1;
658
667
  }
659
- }, ot = () => at(g), st = (e) => e.resolveHttpAdapter() ? f.sso() : et(e) ? f.credentials() : f.sso(), ct = (e, t) => {
668
+ }, st = () => ot(g), ct = (e) => e.resolveHttpAdapter() ? f.sso() : tt(e) ? f.credentials() : f.sso(), lt = (e, t) => {
660
669
  if (v(e, "session").remove(y(e, w)), t.kind === "unknown") {
661
- let t = st(e);
670
+ let t = ct(e);
662
671
  _(e).info(`Ambiguous auth mode resolved to "${t.kind}"`), b(e, { authMode: t });
663
672
  }
664
673
  return x(e, !0), !0;
665
- }, lt = async (e) => await at(e) ? (_(e).info("User authenticated by the server (ambient SSO / OIDC)"), await He(e).catch((t) => _(e).debug("Best-effort CSRF refresh after auto-authentication failed", t)), nt(e, !0), !0) : !1, ut = async (e, t) => {
674
+ }, ut = async (e) => await ot(e) ? (_(e).info("User authenticated by the server (ambient SSO / OIDC)"), await Ue(e).catch((t) => _(e).debug("Best-effort CSRF refresh after auto-authentication failed", t)), rt(e, !0), !0) : !1, dt = async (e, t) => {
666
675
  if (t) {
667
676
  let { username: n, password: r } = t;
668
- return !n || !r ? (_(e).error("Credentials are required for authentication"), x(e, !1), !1) : ft(e, {
677
+ return !n || !r ? (_(e).error("Credentials are required for authentication"), x(e, !1), !1) : pt(e, {
669
678
  username: n,
670
679
  password: r
671
680
  });
672
681
  }
673
682
  let n = e.config.authMode ?? f.unknown();
674
- if (n.kind === "bearer") return pt(e, n);
675
- if (await We(e)) return _(e).info("User already authenticated (existing session)"), ct(e, n);
683
+ if (n.kind === "bearer") return mt(e, n);
684
+ if (await Ge(e)) return _(e).info("User already authenticated (existing session)"), lt(e, n);
676
685
  switch (n.kind) {
677
686
  case "credentials": return x(e, !1), !1;
678
- case "oauth": return _(e).info("Initiating OAuth authentication flow"), await Ie(e), x(e, !1), !1;
679
- case "saml": return _(e).info("Initiating SAML authentication flow"), await Re(e), x(e, !1), !1;
680
- case "sso": return _(e).info("Letting the server authenticate the request (ambient SSO)"), await lt(e) ? ct(e, n) : (x(e, !1), !1);
687
+ case "oauth": return _(e).info("Initiating OAuth authentication flow"), await Le(e), x(e, !1), !1;
688
+ case "saml": return _(e).info("Initiating SAML authentication flow"), await ze(e), x(e, !1), !1;
689
+ case "sso": return _(e).info("Letting the server authenticate the request (ambient SSO)"), await ut(e) ? lt(e, n) : (x(e, !1), !1);
681
690
  case "unknown":
682
- if (_(e).info("No provider declared — probing for server-side auto-authentication"), await lt(e)) {
691
+ if (_(e).info("No provider declared — probing for server-side auto-authentication"), await ut(e)) {
683
692
  let t = f.sso();
684
- return b(e, { authMode: t }), ct(e, t);
693
+ return b(e, { authMode: t }), lt(e, t);
685
694
  }
686
695
  return _(e).info("No provider, no session and no server-side authentication — falling back to the credentials form"), b(e, { authMode: f.credentials() }), x(e, !1), !1;
687
- default: return qe(n);
696
+ default: return Je(n);
688
697
  }
689
- }, dt = (e) => ut(g, e);
690
- async function ft(e, t) {
691
- _(e).info("Attempting authentication using credentials"), b(e, { authMode: f.credentials() }), $e(e);
698
+ }, ft = (e) => dt(g, e);
699
+ async function pt(e, t) {
700
+ _(e).info("Attempting authentication using credentials"), b(e, { authMode: f.credentials() }), et(e);
692
701
  let { userOverrideActive: n, userOverride: r } = e.config;
693
702
  b(e, {
694
703
  userOverrideActive: !1,
695
704
  userOverride: void 0
696
705
  });
697
706
  try {
698
- await Je(e, t);
707
+ await Ye(e, t);
699
708
  } catch (t) {
700
709
  throw x(e, !1), t;
701
710
  } finally {
@@ -706,63 +715,63 @@ async function ft(e, t) {
706
715
  }
707
716
  return x(e, !0), !0;
708
717
  }
709
- async function pt(e, t) {
718
+ async function mt(e, t) {
710
719
  if (_(e).info("Attempting authentication using bearer token"), !p(e.config)) throw x(e, !1), Error("Bearer mode requires a token: set `authMode: AuthMode.bearer(token)`, or the legacy `bearerToken` key.");
711
720
  if (t.sessionCookie !== !1) try {
712
- if (await Je(e, void 0, { recoverable: !0 })) return _(e).info("Bearer token exchanged for a server session"), x(e, !0), !0;
721
+ if (await Ye(e, void 0, { recoverable: !0 })) return _(e).info("Bearer token exchanged for a server session"), x(e, !0), !0;
713
722
  } catch (t) {
714
723
  _(e).info("The server refused to exchange the bearer token for a session — continuing with the token alone. Requests this library issues stay authenticated, but what the browser loads by itself (document previews and their sub-resources, thumbnails, /xdownload links) cannot be. Allow the `webtoken` JSON method for this access token to get a session cookie, or set `AuthMode.bearer(token, { sessionCookie: false })` to stop asking.", t);
715
724
  }
716
- if (!await at(e)) throw x(e, !1), Error("The server refused the configured bearer token: it may be expired or revoked, or its JSON method rules may not allow the probe endpoint (see `auth.probeEndpoint`).");
717
- return nt(e, !0), x(e, !0), !0;
725
+ if (!await ot(e)) throw x(e, !1), Error("The server refused the configured bearer token: it may be expired or revoked, or its JSON method rules may not allow the probe endpoint (see `auth.probeEndpoint`).");
726
+ return rt(e, !0), x(e, !0), !0;
718
727
  }
719
728
  //#endregion
720
729
  //#region src/authentication/tokens/delete-web-token-cookie.ts
721
- var mt = async (e) => {
730
+ var ht = async (e) => {
722
731
  let t = new URLSearchParams({
723
732
  action: "deleteWebTokenCookie",
724
733
  noUserOverride: "true"
725
- }), { signal: n } = I(S(e));
726
- return L(e, "api/v1/challenge", t, {
734
+ }), { signal: n } = F(S(e));
735
+ return I(e, "api/v1/challenge", t, {
727
736
  signal: n,
728
737
  noAutoAuthentication: !0,
729
738
  noRecovery: !0
730
739
  });
731
- }, ht = () => mt(g);
740
+ }, gt = () => ht(g);
732
741
  //#endregion
733
742
  //#region src/authentication/session/logout.ts
734
- async function gt(e) {
743
+ async function _t(e) {
735
744
  let { userOverrideActive: t } = e.config;
736
- if (vt(e), tt(e), v(e, "session").remove(y(e, w)), _e(e), e.events.emit("loggedOut", {}), !t) try {
737
- let { methodresult: t, logoutUrl: n } = await mt(e);
745
+ if (yt(e), nt(e), v(e, "session").remove(y(e, w)), _e(e), e.events.emit("loggedOut", {}), !t) try {
746
+ let { methodresult: t, logoutUrl: n } = await ht(e);
738
747
  if (t === "ok") return n;
739
748
  _(e).error("logout failed");
740
749
  } catch (t) {
741
750
  _(e).error("logout failed", t);
742
751
  }
743
752
  }
744
- async function _t() {
745
- return gt(g);
753
+ async function vt() {
754
+ return _t(g);
746
755
  }
747
- function vt(e) {
748
- v(e, "local").remove(y(e, C.legacyCsrfToken)), v(e, "session").remove(y(e, C.credentials)), nt(e, !1), x(e, !1);
756
+ function yt(e) {
757
+ v(e, "local").remove(y(e, C.legacyCsrfToken)), v(e, "session").remove(y(e, C.credentials)), rt(e, !1), x(e, !1);
749
758
  }
750
- function yt() {
751
- vt(g);
759
+ function bt() {
760
+ yt(g);
752
761
  }
753
762
  //#endregion
754
763
  //#region src/authentication/session/redirect-guard.ts
755
- function bt(e) {
764
+ function xt(e) {
756
765
  return v(e, "session").get(y(e, w)) !== null;
757
766
  }
758
- var xt = () => bt(g), St = (e) => !!T(e) || rt(e), Ct = () => St(g);
767
+ var St = () => xt(g), Ct = (e) => !!T(e) || it(e), wt = () => Ct(g);
759
768
  //#endregion
760
769
  //#region src/web-api/helpers/methods/del.ts
761
- async function R(e, t, n, r) {
770
+ async function L(e, t, n, r) {
762
771
  let i = E(e, r?.headers), a = D(e, t, n), o;
763
- r?.body && (i.has("Content-Type") || i.set("Content-Type", "application/json"), o = P(e, r.body, r)), _(e).debug(`Making DELETE request to: ${a}`);
772
+ r?.body && (i.has("Content-Type") || i.set("Content-Type", "application/json"), o = N(e, r.body, r)), _(e).debug(`Making DELETE request to: ${a}`);
764
773
  try {
765
- return await N(e, a, {
774
+ return await M(e, a, {
766
775
  method: "DELETE",
767
776
  headers: i,
768
777
  body: o
@@ -771,63 +780,63 @@ async function R(e, t, n, r) {
771
780
  throw _(e).error("Error making DELETE request:", t), t;
772
781
  }
773
782
  }
774
- async function wt(e, t, n) {
775
- return R(g, e, t, n);
783
+ async function Tt(e, t, n) {
784
+ return L(g, e, t, n);
776
785
  }
777
786
  //#endregion
778
787
  //#region src/web-api/helpers/methods/patch.ts
779
- async function z(e, t, n, r) {
788
+ async function R(e, t, n, r) {
780
789
  let i = E(e, r?.headers);
781
790
  i.append("content-type", "application/json");
782
791
  let a = D(e, t);
783
792
  _(e).debug(`Making PATCH request to: ${a}`);
784
793
  try {
785
- return await N(e, a, {
794
+ return await M(e, a, {
786
795
  method: "PATCH",
787
796
  headers: i,
788
- body: P(e, n, r)
797
+ body: N(e, n, r)
789
798
  }, r);
790
799
  } catch (t) {
791
800
  throw _(e).error("Error making PATCH request:", t), t;
792
801
  }
793
802
  }
794
- async function Tt(e, t, n) {
795
- return z(g, e, t, n);
803
+ async function Et(e, t, n) {
804
+ return R(g, e, t, n);
796
805
  }
797
806
  //#endregion
798
807
  //#region src/web-api/helpers/methods/put.ts
799
- async function B(e, t, n, r) {
808
+ async function z(e, t, n, r) {
800
809
  let i = E(e, r?.headers);
801
810
  i.has("Content-Type") || i.set("Content-Type", "application/json");
802
811
  let a = D(e, t);
803
812
  _(e).debug(`Making PUT request to: ${a}`);
804
813
  try {
805
- return await N(e, a, {
814
+ return await M(e, a, {
806
815
  method: "PUT",
807
816
  headers: i,
808
- body: P(e, n, r)
817
+ body: N(e, n, r)
809
818
  }, r);
810
819
  } catch (t) {
811
820
  throw _(e).error("Error making PUT request:", t), t;
812
821
  }
813
822
  }
814
- async function Et(e, t, n) {
815
- return B(g, e, t, n);
823
+ async function Dt(e, t, n) {
824
+ return z(g, e, t, n);
816
825
  }
817
826
  //#endregion
818
827
  //#region src/web-api/v1/fetch-app.ts
819
- async function Dt(e, t = g) {
828
+ async function Ot(e, t = g) {
820
829
  let n = e || t.config.app;
821
- return L(t, "api/v1/app", new URLSearchParams({ app: n || "" }));
830
+ return I(t, "api/v1/app", new URLSearchParams({ app: n || "" }));
822
831
  }
823
- async function Ot(e = g) {
832
+ async function kt(e = g) {
824
833
  let { app: t } = e.config;
825
- return L(e, "api/v1/app", new URLSearchParams({
834
+ return I(e, "api/v1/app", new URLSearchParams({
826
835
  app: t || "",
827
836
  preLogin: "true"
828
837
  }));
829
838
  }
830
- function kt(e = g) {
839
+ function At(e = g) {
831
840
  let { backendUrl: t, app: n } = e.config;
832
841
  if (typeof window < "u") {
833
842
  if (t ||= window.location.origin, !n) {
@@ -844,33 +853,33 @@ function kt(e = g) {
844
853
  autoOAuthProvider: void 0,
845
854
  autoSAMLProvider: void 0,
846
855
  bearerToken: void 0
847
- }), Promise.resolve({})) : Ot(e).then((t) => (b(e, {
848
- authMode: Be(e.config, t),
856
+ }), Promise.resolve({})) : kt(e).then((t) => (b(e, {
857
+ authMode: Ve(e.config, t),
849
858
  autoOAuthProvider: e.config.autoOAuthProvider || t.autoOAuthProvider,
850
859
  autoSAMLProvider: e.config.autoSAMLProvider || t.autoSAMLProvider
851
860
  }), t)).catch((t) => {
852
861
  throw _(e).error("atomic:fetchAppPreLogin error", t), t;
853
862
  });
854
863
  }
855
- var At = kt, jt = 10;
856
- function Mt(e, t) {
864
+ var jt = At, Mt = 10;
865
+ function Nt(e, t) {
857
866
  let n = t?.aggregations;
858
867
  if (!n || Array.isArray(n)) return;
859
868
  let r = n[e]?.count;
860
869
  return typeof r == "number" ? r : void 0;
861
870
  }
862
- function Nt(e, t, n) {
863
- let r = Mt(e, t);
871
+ function Pt(e, t, n) {
872
+ let r = Nt(e, t);
864
873
  if (r !== void 0) return r;
865
874
  let i = n?.[e];
866
875
  return typeof i == "number" ? i : 10;
867
876
  }
868
- function Pt(e, t) {
877
+ function Ft(e, t) {
869
878
  return e.isDistribution || e.isTree || !e.items ? !1 : e.items.length > t;
870
879
  }
871
880
  //#endregion
872
881
  //#region src/helpers/column-resolver.ts
873
- function Ft(e, t, n) {
882
+ function It(e, t, n) {
874
883
  if (!e || !t) return;
875
884
  if (n) {
876
885
  let r = Object.keys(t.queries).find((e) => e === n?.toLowerCase()), i;
@@ -878,98 +887,100 @@ function Ft(e, t, n) {
878
887
  let a = (i?.columnsInfo?.columns || [])?.find((t) => t.aliases?.split(",")?.includes(e));
879
888
  if (a) return a.name;
880
889
  }
881
- let r = t.indexes?._?.columns, i = Object.entries(r).find((t) => t[1].aliases?.includes(e));
890
+ let r = t.indexes?._?.columns;
891
+ if (!r) return;
892
+ let i = Object.entries(r).find((t) => t[1].aliases?.includes(e));
882
893
  if (i) return i[0];
883
894
  }
884
895
  //#endregion
885
896
  //#region src/types/audit/AuditEventType.ts
886
- var V = /* @__PURE__ */ function(e) {
897
+ var B = /* @__PURE__ */ function(e) {
887
898
  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;
888
- }({}), H = /* @__PURE__ */ function(e) {
899
+ }({}), V = /* @__PURE__ */ function(e) {
889
900
  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;
890
- }({}), U = /* @__PURE__ */ function(e) {
901
+ }({}), H = /* @__PURE__ */ function(e) {
891
902
  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;
892
- }({}), It = "1.0", Lt = /* @__PURE__ */ function(e) {
903
+ }({}), Lt = "1.0", Rt = /* @__PURE__ */ function(e) {
893
904
  return e[e.Original = 0] = "Original", e[e.Corrected = 1] = "Corrected", e;
894
- }({}), Rt = /* @__PURE__ */ function(e) {
905
+ }({}), zt = /* @__PURE__ */ function(e) {
895
906
  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;
896
907
  }({});
897
908
  //#endregion
898
909
  //#region src/helpers/columns.ts
899
- function zt(e) {
900
- if (!e) return H.none;
910
+ function Bt(e) {
911
+ if (!e) return V.none;
901
912
  switch (e.toLocaleLowerCase()) {
902
913
  case "bool":
903
- case "boolean": return H.bool;
904
- case "date": return H.date;
905
- case "datetime": return H.dateTime;
906
- case "time": return H.time;
907
- case "unsigned": return H.unsigned;
908
- case "integer": return H.integer;
909
- case "float": return H.float;
910
- case "double": return H.double;
911
- case "dates": return H.dates;
912
- case "datetimes": return H.dateTimes;
913
- case "times": return H.times;
914
- case "varchar": return H.varchar;
915
- case "binary": return H.binary;
916
- case "string": return H.string;
917
- case "csv": return H.csv;
918
- default: return H.none;
914
+ case "boolean": return V.bool;
915
+ case "date": return V.date;
916
+ case "datetime": return V.dateTime;
917
+ case "time": return V.time;
918
+ case "unsigned": return V.unsigned;
919
+ case "integer": return V.integer;
920
+ case "float": return V.float;
921
+ case "double": return V.double;
922
+ case "dates": return V.dates;
923
+ case "datetimes": return V.dateTimes;
924
+ case "times": return V.times;
925
+ case "varchar": return V.varchar;
926
+ case "binary": return V.binary;
927
+ case "string": return V.string;
928
+ case "csv": return V.csv;
929
+ default: return V.none;
919
930
  }
920
931
  }
921
- function Bt(e) {
932
+ function Vt(e) {
922
933
  switch (e) {
923
- case "a": return U.a;
924
- case "c": return U.c;
925
- case "d": return U.d;
926
- case "e": return U.e;
927
- case "i": return U.i;
928
- case "l": return U.l;
929
- case "n": return U.n;
930
- case "t": return U.t;
931
- case "x": return U.x;
932
- case "z": return U.z;
933
- default: return U.none;
934
+ case "a": return H.a;
935
+ case "c": return H.c;
936
+ case "d": return H.d;
937
+ case "e": return H.e;
938
+ case "i": return H.i;
939
+ case "l": return H.l;
940
+ case "n": return H.n;
941
+ case "t": return H.t;
942
+ case "x": return H.x;
943
+ case "z": return H.z;
944
+ default: return H.none;
934
945
  }
935
946
  }
936
- function Vt(e) {
937
- let t = U.none;
938
- if (e) for (let n of e) t |= Bt(n);
947
+ function Ht(e) {
948
+ let t = H.none;
949
+ if (e) for (let n of e) t |= Vt(n);
939
950
  return t;
940
951
  }
941
- function W(e, t, n, r) {
952
+ function U(e, t, n, r) {
942
953
  return {
943
954
  name: e,
944
955
  type: t,
945
956
  typeModifier: n,
946
- eType: zt(t),
947
- eTypeModifier: Vt(n || ""),
957
+ eType: Bt(t),
958
+ eTypeModifier: Ht(n || ""),
948
959
  aliases: r
949
960
  };
950
961
  }
951
- var Ht = {
952
- id: W("id", "string"),
953
- text: W("text", "varchar"),
954
- documentlanguages: W("documentlanguages", "csv", "ci", ["language"]),
955
- databasealias: W("databasealias", "varchar"),
956
- globalrelevance: W("globalrelevance", "double"),
957
- matchingpartnames: W("matchingpartnames", "csv"),
958
- matchlocations: W("matchlocations", "csv"),
959
- matchlocationsperpartname: W("matchlocationsperpartname", "varchar"),
960
- extracts: W("extracts", "csv"),
961
- extractsperpartname: W("extractsperpartname", "varchar"),
962
- extractslocations: W("extractslocations", "csv"),
963
- documentweight: W("documentweight", "varchar"),
964
- groupcount: W("groupcount", "integer"),
965
- accesslists: W("accesslists", "varchar", void 0, ["accessLists"])
962
+ var Ut = {
963
+ id: U("id", "string"),
964
+ text: U("text", "varchar"),
965
+ documentlanguages: U("documentlanguages", "csv", "ci", ["language"]),
966
+ databasealias: U("databasealias", "varchar"),
967
+ globalrelevance: U("globalrelevance", "double"),
968
+ matchingpartnames: U("matchingpartnames", "csv"),
969
+ matchlocations: U("matchlocations", "csv"),
970
+ matchlocationsperpartname: U("matchlocationsperpartname", "varchar"),
971
+ extracts: U("extracts", "csv"),
972
+ extractsperpartname: U("extractsperpartname", "varchar"),
973
+ extractslocations: U("extractslocations", "csv"),
974
+ documentweight: U("documentweight", "varchar"),
975
+ groupcount: U("groupcount", "integer"),
976
+ accesslists: U("accesslists", "varchar", void 0, ["accessLists"])
966
977
  };
967
978
  //#endregion
968
979
  //#region src/helpers/filters.ts
969
- function Ut(e) {
980
+ function Wt(e) {
970
981
  return e.filter((e) => !!e);
971
982
  }
972
- var G = {
983
+ var W = {
973
984
  eq: (e, t) => ({
974
985
  field: e,
975
986
  operator: "eq",
@@ -1040,44 +1051,44 @@ var G = {
1040
1051
  if (!n) return;
1041
1052
  let r = n.split(" AND ").map((e) => e.trim()).filter(Boolean).map((t) => {
1042
1053
  let n = t.substring(t.search(/\s/) + 1).trim();
1043
- return t.startsWith(">=") ? G.gte(e, n) : t.startsWith(">") ? G.gt(e, n) : t.startsWith("<=") ? G.lte(e, n) : G.lt(e, n);
1054
+ return t.startsWith(">=") ? W.gte(e, n) : t.startsWith(">") ? W.gt(e, n) : t.startsWith("<=") ? W.lte(e, n) : W.lt(e, n);
1044
1055
  });
1045
- return G.and(...r);
1056
+ return W.and(...r);
1046
1057
  },
1047
- and: (...e) => Wt("and", e),
1048
- or: (...e) => Wt("or", e),
1058
+ and: (...e) => Gt("and", e),
1059
+ or: (...e) => Gt("or", e),
1049
1060
  not: (...e) => {
1050
- let t = Ut(e);
1061
+ let t = Wt(e);
1051
1062
  return t.length ? {
1052
1063
  operator: "not",
1053
1064
  filters: t
1054
1065
  } : void 0;
1055
1066
  }
1056
1067
  };
1057
- function Wt(e, t) {
1058
- let n = Ut(t);
1068
+ function Gt(e, t) {
1069
+ let n = Wt(t);
1059
1070
  if (n.length !== 0) return n.length === 1 ? n[0] : {
1060
1071
  operator: e,
1061
1072
  filters: n
1062
1073
  };
1063
1074
  }
1064
- function Gt(e) {
1075
+ function Kt(e) {
1065
1076
  if (!e) return;
1066
1077
  let { operator: t, field: n } = e;
1067
1078
  switch (t) {
1068
1079
  case "and":
1069
1080
  case "or": {
1070
- let n = (e.filters ?? []).map((e) => Gt(e));
1071
- return t === "and" ? G.and(...n) : G.or(...n);
1081
+ let n = (e.filters ?? []).map((e) => Kt(e));
1082
+ return t === "and" ? W.and(...n) : W.or(...n);
1072
1083
  }
1073
1084
  case "not": {
1074
- let t = (e.filters ?? []).map((e) => Gt(e));
1075
- return G.not(...t);
1085
+ let t = (e.filters ?? []).map((e) => Kt(e));
1086
+ return W.not(...t);
1076
1087
  }
1077
- case "in": return n && e.values?.length ? G.in(n, e.values) : void 0;
1078
- case "between": return n && e.start !== void 0 && e.end !== void 0 ? G.between(n, e.start, e.end) : void 0;
1079
- case "null": return n ? G.isNull(n) : void 0;
1080
- case "notnull": return n ? G.isNotNull(n) : void 0;
1088
+ case "in": return n && e.values?.length ? W.in(n, e.values) : void 0;
1089
+ case "between": return n && e.start !== void 0 && e.end !== void 0 ? W.between(n, e.start, e.end) : void 0;
1090
+ case "null": return n ? W.isNull(n) : void 0;
1091
+ case "notnull": return n ? W.isNotNull(n) : void 0;
1081
1092
  case "eq":
1082
1093
  case "neq":
1083
1094
  case "gt":
@@ -1086,21 +1097,21 @@ function Gt(e) {
1086
1097
  case "lte":
1087
1098
  case "like":
1088
1099
  case "contains":
1089
- case "regex": return n && e.value !== void 0 ? G[t](n, e.value) : void 0;
1090
- case void 0: return n && e.value !== void 0 ? G.eq(n, e.value) : void 0;
1100
+ case "regex": return n && e.value !== void 0 ? W[t](n, e.value) : void 0;
1101
+ case void 0: return n && e.value !== void 0 ? W.eq(n, e.value) : void 0;
1091
1102
  default: return;
1092
1103
  }
1093
1104
  }
1094
1105
  //#endregion
1095
1106
  //#region src/helpers/metadata.ts
1096
- function Kt(e, t) {
1107
+ function qt(e, t) {
1097
1108
  let n = e[t];
1098
1109
  return n === void 0 ? [] : (typeof n == "string" && (n = String(n).split(",")), Array.isArray(n) ? n.map((e) => {
1099
1110
  if (typeof e == "string") return e.trim();
1100
1111
  if (typeof e == "object" && e && "display" in e) return e.display.trim();
1101
1112
  }).filter((e) => e !== void 0) : [String(n).trim()]);
1102
1113
  }
1103
- function qt(e, t) {
1114
+ function Jt(e, t) {
1104
1115
  let n = e[t];
1105
1116
  if (n === void 0) return [];
1106
1117
  if (typeof n == "string" && (n = String(n).split(",")), Array.isArray(n)) return n.map((e) => {
@@ -1124,7 +1135,7 @@ function qt(e, t) {
1124
1135
  }
1125
1136
  //#endregion
1126
1137
  //#region src/helpers/pagination.ts
1127
- function Jt(e) {
1138
+ function Yt(e) {
1128
1139
  let { page: t, pageSize: n, rowCount: r } = e;
1129
1140
  return t === void 0 || !n || r === void 0 ? {
1130
1141
  nextPage: void 0,
@@ -1136,35 +1147,35 @@ function Jt(e) {
1136
1147
  }
1137
1148
  //#endregion
1138
1149
  //#region src/helpers/utils.ts
1139
- function K(e) {
1150
+ function G(e) {
1140
1151
  return typeof e == "object" && !!e;
1141
1152
  }
1142
- function Yt(e) {
1143
- return K(e) && Object.prototype.toString.call(e) === "[object ArrayBuffer]";
1144
- }
1145
1153
  function Xt(e) {
1146
- return K(e) && Object.prototype.toString.call(e) === "[object Blob]";
1154
+ return G(e) && Object.prototype.toString.call(e) === "[object ArrayBuffer]";
1147
1155
  }
1148
1156
  function Zt(e) {
1149
- return Object.prototype.toString.call(e) === "[object Date]";
1157
+ return G(e) && Object.prototype.toString.call(e) === "[object Blob]";
1150
1158
  }
1151
1159
  function Qt(e) {
1152
- return typeof e == "string";
1160
+ return Object.prototype.toString.call(e) === "[object Date]";
1153
1161
  }
1154
1162
  function $t(e) {
1155
- return (K(e) || Array.isArray(e)) && !Yt(e) && !Xt(e) && !Qt(e);
1163
+ return typeof e == "string";
1156
1164
  }
1157
1165
  function en(e) {
1166
+ return (G(e) || Array.isArray(e)) && !Xt(e) && !Zt(e) && !$t(e);
1167
+ }
1168
+ function tn(e) {
1158
1169
  return e ? (e.getHours() * 60 * 60 + e.getMinutes() * 60 + e.getSeconds()) * 1e3 + e.getMilliseconds() : 0;
1159
1170
  }
1160
- function tn(e = !0) {
1171
+ function nn(e = !0) {
1161
1172
  let t = Date.now();
1162
1173
  return (e ? "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx" : "xxxxxxxxxxxx4xxxyxxxxxxxxxxxxxxx").replace(/[xy]/g, (e) => {
1163
1174
  let n = (t + Math.random() * 16) % 16 | 0;
1164
1175
  return t = Math.floor(t / 16), (e === "x" ? n : n & 3 | 8).toString(16);
1165
1176
  });
1166
1177
  }
1167
- function nn(e) {
1178
+ function rn(e) {
1168
1179
  if (!e) return "``";
1169
1180
  if (e = String(e), e.search(/[\\`]/) === -1) return `\`${e}\``;
1170
1181
  let t = ["`"];
@@ -1174,13 +1185,13 @@ function nn(e) {
1174
1185
  }
1175
1186
  return t.push("`"), t.join("");
1176
1187
  }
1177
- async function rn(e) {
1188
+ async function an(e) {
1178
1189
  let t = globalThis.crypto?.subtle;
1179
1190
  if (typeof t?.digest != "function") throw Error("sha512 requires the Web Crypto API, and `crypto.subtle` is unavailable here. That usually means an insecure context: it is exposed over HTTPS and on localhost, but not over plain HTTP. Serve the application over HTTPS.");
1180
1191
  let n = await t.digest("SHA-512", new TextEncoder().encode(e));
1181
1192
  return Array.from(new Uint8Array(n), (e) => e.toString(16).padStart(2, "0")).join("");
1182
1193
  }
1183
- function an(e, t = 0) {
1194
+ function on(e, t = 0) {
1184
1195
  let n = 3735928559 ^ t, r = 1103547991 ^ t;
1185
1196
  for (let t = 0; t < e.length; t++) {
1186
1197
  let i = e.charCodeAt(t);
@@ -1190,52 +1201,52 @@ function an(e, t = 0) {
1190
1201
  }
1191
1202
  //#endregion
1192
1203
  //#region src/web-api/v1/fetch-audit.ts
1193
- var on, sn;
1194
- function q(e, t = !0) {
1195
- let n = cn(e.$auditRecord);
1196
- n && (ln(n), t && un(n)), e.$auditRecord = n;
1204
+ var sn, cn;
1205
+ function K(e, t = !0) {
1206
+ let n = ln(e.$auditRecord);
1207
+ n && (un(n), t && dn(n)), e.$auditRecord = n;
1197
1208
  }
1198
- function cn(e) {
1209
+ function ln(e) {
1199
1210
  if (!e) return;
1200
1211
  let t;
1201
1212
  if (Array.isArray(e)) t = e;
1202
- else if (K(e)) {
1213
+ else if (G(e)) {
1203
1214
  let n = e;
1204
1215
  if (n.auditEvents || n.mlAuditEvents) return n;
1205
1216
  t = [e];
1206
1217
  }
1207
1218
  return { auditEvents: t };
1208
1219
  }
1209
- function ln(e) {
1210
- let t = dn();
1220
+ function un(e) {
1221
+ let t = fn();
1211
1222
  return e.auditEvents?.forEach((e) => {
1212
1223
  e.detail ||= {}, e.detail.sessionid = t;
1213
1224
  }), e;
1214
1225
  }
1215
- function un(e) {
1226
+ function dn(e) {
1216
1227
  let t = typeof window < "u" ? decodeURIComponent(window.location.href) : "http://localhost";
1217
1228
  return e?.auditEvents?.forEach((e) => {
1218
1229
  e.detail ||= {}, e.detail.url = t;
1219
1230
  }), e;
1220
1231
  }
1221
- function dn() {
1222
- return (!on || fn()) && (on = tn()), sn = /* @__PURE__ */ new Date(), on;
1223
- }
1224
1232
  function fn() {
1225
- return Date.now() - sn.getTime() > 600 * 1e3;
1233
+ return (!sn || pn()) && (sn = nn()), cn = /* @__PURE__ */ new Date(), sn;
1234
+ }
1235
+ function pn() {
1236
+ return Date.now() - cn.getTime() > 600 * 1e3;
1226
1237
  }
1227
- async function pn(e, t = !0, n = g) {
1238
+ async function mn(e, t = !0, n = g) {
1228
1239
  let r = {
1229
- event: V.None,
1240
+ event: B.None,
1230
1241
  $auditRecord: e
1231
1242
  };
1232
- return q(r, t), F(n, "api/v1/audit.notify", r, { noRecovery: !0 });
1243
+ return K(r, t), P(n, "api/v1/audit.notify", r, { noRecovery: !0 });
1233
1244
  }
1234
- var mn = { notify: pn };
1245
+ var hn = { notify: mn };
1235
1246
  //#endregion
1236
1247
  //#region src/web-api/v1/fetch-aggregation.ts
1237
- async function hn(e, t, n, r, i = g) {
1238
- let a = r ?? Nt(e.name, t, i.config.aggregationCounts), o = e.items?.length || 0, s = {
1248
+ async function gn(e, t, n, r, i = g) {
1249
+ let a = r ?? Pt(e.name, t, i.config.aggregationCounts), o = e.items?.length || 0, s = {
1239
1250
  query: {
1240
1251
  ...t,
1241
1252
  action: "aggregate",
@@ -1246,32 +1257,32 @@ async function hn(e, t, n, r, i = g) {
1246
1257
  },
1247
1258
  ...n ? { $auditRecord: { auditEvents: [n] } } : {}
1248
1259
  };
1249
- q(s);
1250
- let c = (await F(i, "api/v1/query", s)).aggregations[0];
1251
- return c.$hasMore = Pt(c, a), c.items = [...e.items ?? [], ...c.items ?? []], Promise.resolve(c);
1260
+ K(s);
1261
+ let c = (await P(i, "api/v1/query", s)).aggregations[0];
1262
+ return c.$hasMore = Ft(c, a), c.items = [...e.items ?? [], ...c.items ?? []], Promise.resolve(c);
1252
1263
  }
1253
1264
  //#endregion
1254
1265
  //#region src/web-api/v1/fetch-dataset.ts
1255
- async function gn(e, t, n = {}, r = g) {
1256
- let i = await F(r, `api/v1/search.dataset/${e}/${t}`, { parameters: n }), a = t[0].toLowerCase() + t.slice(1), o = i.datasets[a];
1266
+ async function _n(e, t, n = {}, r = g) {
1267
+ let i = await P(r, `api/v1/search.dataset/${e}/${t}`, { parameters: n }), a = t[0].toLowerCase() + t.slice(1), o = i.datasets[a];
1257
1268
  if ("errorCode" in o && "errorMessage" in o) throw Error(o.errorMessage);
1258
1269
  return o;
1259
1270
  }
1260
- async function _n(e, t, n = g) {
1271
+ async function vn(e, t, n = g) {
1261
1272
  let r = `api/v1/search.dataset/${e}`, { parameters: i = {}, datasets: a = [] } = t;
1262
- return (await F(n, r, {
1273
+ return (await P(n, r, {
1263
1274
  parameters: i,
1264
1275
  datasets: a
1265
1276
  })).datasets;
1266
1277
  }
1267
- async function vn(e, t = g) {
1268
- return await L(t, `api/v1/search.dataset/${e}`);
1278
+ async function yn(e, t = g) {
1279
+ return await I(t, `api/v1/search.dataset/${e}`);
1269
1280
  }
1270
1281
  //#endregion
1271
1282
  //#region src/web-api/v1/fetch-labels.ts
1272
- async function yn(e, t = !0, n, r = g) {
1283
+ async function bn(e, t = !0, n, r = g) {
1273
1284
  try {
1274
- return (await F(r, "api/v1/labels", {
1285
+ return (await P(r, "api/v1/labels", {
1275
1286
  action: "list",
1276
1287
  q: e,
1277
1288
  public: t,
@@ -1282,10 +1293,10 @@ async function yn(e, t = !0, n, r = g) {
1282
1293
  throw l("Error in fetchLabels", e), e;
1283
1294
  }
1284
1295
  }
1285
- async function bn(e = g) {
1296
+ async function xn(e = g) {
1286
1297
  try {
1287
1298
  let { app: t = "" } = e.config;
1288
- return L(e, "api/v1/labels", new URLSearchParams({
1299
+ return await I(e, "api/v1/labels", new URLSearchParams({
1289
1300
  app: t,
1290
1301
  action: "getUserRights"
1291
1302
  }));
@@ -1293,16 +1304,16 @@ async function bn(e = g) {
1293
1304
  throw l("Error in getUserRights", e), e;
1294
1305
  }
1295
1306
  }
1296
- async function xn(e, t, n = !0, r = g) {
1307
+ async function Sn(e, t, n = !0, r = g) {
1297
1308
  try {
1298
- return F(r, "api/v1/labels", {
1309
+ let i = {
1299
1310
  action: "add",
1300
1311
  labels: e,
1301
1312
  ids: t,
1302
1313
  public: n,
1303
1314
  $auditRecord: {
1304
1315
  auditEvents: [{
1305
- type: V.Label_AddDoc,
1316
+ type: B.Label_AddDoc,
1306
1317
  detail: {
1307
1318
  public: n,
1308
1319
  label: e ? e.toString() : null,
@@ -1314,21 +1325,22 @@ async function xn(e, t, n = !0, r = g) {
1314
1325
  documentIds: t
1315
1326
  }]
1316
1327
  }
1317
- });
1328
+ };
1329
+ return K(i), await P(r, "api/v1/labels", i);
1318
1330
  } catch (e) {
1319
1331
  throw l("Error in add", e), e;
1320
1332
  }
1321
1333
  }
1322
- async function Sn(e, t, n = !0, r = g) {
1334
+ async function Cn(e, t, n = !0, r = g) {
1323
1335
  try {
1324
- return F(r, "api/v1/labels", {
1336
+ let i = {
1325
1337
  action: "remove",
1326
1338
  labels: e,
1327
1339
  ids: t,
1328
1340
  public: n,
1329
1341
  $auditRecord: {
1330
1342
  auditEvents: [{
1331
- type: V.Label_RemoveDoc,
1343
+ type: B.Label_RemoveDoc,
1332
1344
  detail: {
1333
1345
  public: n,
1334
1346
  label: e ? e.toString() : null,
@@ -1340,137 +1352,113 @@ async function Sn(e, t, n = !0, r = g) {
1340
1352
  documentIds: t
1341
1353
  }]
1342
1354
  }
1343
- });
1355
+ };
1356
+ return K(i), await P(r, "api/v1/labels", i);
1344
1357
  } catch (e) {
1345
1358
  throw l("Error in remove", e), e;
1346
1359
  }
1347
1360
  }
1348
- async function Cn(e, t, n = !0, r = g) {
1361
+ async function wn(e, t, n = !0, r = g) {
1349
1362
  try {
1350
- return F(r, "api/v1/labels", {
1363
+ let i = {
1351
1364
  action: "rename",
1352
1365
  labels: e,
1353
1366
  newLabel: t,
1354
1367
  public: n,
1355
- auditEvents: {
1356
- type: V.Label_Rename,
1368
+ $auditRecord: { auditEvents: [{
1369
+ type: B.Label_Rename,
1357
1370
  detail: {
1358
1371
  public: n,
1359
1372
  oldlabel: e ? e.toString() : null,
1360
1373
  label: t
1361
1374
  }
1362
- }
1363
- });
1375
+ }] }
1376
+ };
1377
+ return K(i), await P(r, "api/v1/labels", i);
1364
1378
  } catch (e) {
1365
1379
  throw l("Error in rename", e), e;
1366
1380
  }
1367
1381
  }
1368
- async function wn(e, t = !0, n = g) {
1382
+ async function Tn(e, t = !0, n = g) {
1369
1383
  try {
1370
- return F(n, "api/v1/labels", {
1384
+ let r = {
1371
1385
  action: "delete",
1372
1386
  labels: e,
1373
1387
  public: t,
1374
- auditEvents: {
1375
- type: V.Label_Delete,
1388
+ $auditRecord: { auditEvents: [{
1389
+ type: B.Label_Delete,
1376
1390
  detail: {
1377
1391
  public: t,
1378
1392
  label: e ? e.toString() : null
1379
1393
  }
1380
- }
1381
- });
1394
+ }] }
1395
+ };
1396
+ return K(r), await P(n, "api/v1/labels", r);
1382
1397
  } catch (e) {
1383
1398
  throw l("Error in deleteLabels", e), e;
1384
1399
  }
1385
1400
  }
1386
- async function Tn(e, t, n = !0, r = g) {
1401
+ async function En(e, t, n = !0, r = g) {
1387
1402
  try {
1388
- return F(r, "api/v1/labels", {
1403
+ let i = {
1389
1404
  action: "bulkAdd",
1390
1405
  labels: e,
1391
1406
  query: t,
1392
1407
  public: n,
1393
- auditEvents: {
1394
- type: V.Label_Add,
1408
+ $auditRecord: { auditEvents: [{
1409
+ type: B.Label_Add,
1395
1410
  detail: {
1396
1411
  public: n,
1397
1412
  label: e ? e.toString() : null,
1398
1413
  query: t === null ? null : t.name
1399
1414
  }
1400
- }
1401
- });
1415
+ }] }
1416
+ };
1417
+ return K(i), await P(r, "api/v1/labels", i);
1402
1418
  } catch (e) {
1403
1419
  throw l("Error in bulkAdd", e), e;
1404
1420
  }
1405
1421
  }
1406
- async function En(e, t, n = !0, r = g) {
1422
+ async function Dn(e, t, n = !0, r = g) {
1407
1423
  try {
1408
- return F(r, "api/v1/labels", {
1424
+ let i = {
1409
1425
  action: "bulkRemove",
1410
1426
  labels: e,
1411
1427
  query: t,
1412
1428
  public: n,
1413
- auditEvents: {
1414
- type: V.Label_Delete,
1429
+ $auditRecord: { auditEvents: [{
1430
+ type: B.Label_Delete,
1415
1431
  detail: {
1416
1432
  public: n,
1417
1433
  label: e ? e.toString() : null,
1418
1434
  query: t === null ? null : t.name
1419
1435
  }
1420
- }
1421
- });
1436
+ }] }
1437
+ };
1438
+ return K(i), await P(r, "api/v1/labels", i);
1422
1439
  } catch (e) {
1423
1440
  throw l("Error in bulkRemove", e), e;
1424
1441
  }
1425
1442
  }
1426
- var J = {
1427
- getUserRights: bn,
1428
- add: xn,
1429
- remove: Sn,
1430
- rename: Cn,
1431
- delete: wn,
1432
- bulkAdd: Tn,
1433
- bulkRemove: En
1443
+ var q = {
1444
+ getUserRights: xn,
1445
+ add: Sn,
1446
+ remove: Cn,
1447
+ rename: wn,
1448
+ delete: Tn,
1449
+ bulkAdd: En,
1450
+ bulkRemove: Dn
1434
1451
  };
1435
1452
  //#endregion
1436
- //#region src/web-api/helpers/utils/date-utils.ts
1437
- function Dn(e) {
1438
- if (!e) return;
1439
- let t = new Date(e);
1440
- return Number.isNaN(t.getTime()) ? void 0 : t;
1441
- }
1442
- function On(e) {
1443
- let t = Dn(e);
1444
- return !!t && t.getTime() <= Date.now();
1445
- }
1446
- function kn(e, t = 7) {
1447
- let n = Dn(e);
1448
- if (!n) return !1;
1449
- let r = Date.now(), i = r + t * 24 * 60 * 60 * 1e3, a = n.getTime();
1450
- return a > r && a <= i;
1451
- }
1452
- //#endregion
1453
- //#region src/web-api/helpers/utils/with-retry.ts
1454
- async function An(e, t = 0, n = 1e3) {
1455
- let r;
1456
- for (let i = 0; i <= t; i++) try {
1457
- return await e();
1458
- } catch (e) {
1459
- if (r = e, e instanceof O && e.status >= 400 && e.status < 500 && e.status !== 429 || e instanceof DOMException && e.name === "AbortError") throw e;
1460
- i < t && (c(`Retrying request (${i + 1}/${t})`, { error: e }), await new Promise((e) => setTimeout(e, n)));
1461
- }
1462
- throw r;
1463
- }
1464
- //#endregion
1465
1453
  //#region src/web-api/v1/fetch-preview.ts
1466
- async function jn(e, t, n = g) {
1467
- if (typeof window > "u") return F(n, "api/v1/preview", {
1454
+ async function On(e, t, n = g) {
1455
+ if (typeof window > "u") return P(n, "api/v1/preview", {
1468
1456
  action: "get",
1469
1457
  id: e,
1470
1458
  query: t
1471
1459
  });
1472
1460
  let r = `${window.location.origin}${window.location.pathname}`;
1473
- return F(n, "api/v1/preview", {
1461
+ return P(n, "api/v1/preview", {
1474
1462
  action: "get",
1475
1463
  id: e,
1476
1464
  query: {
@@ -1480,67 +1468,66 @@ async function jn(e, t, n = g) {
1480
1468
  browserUrl: r
1481
1469
  });
1482
1470
  }
1483
- async function Mn(e) {
1484
- let t = new Headers();
1485
- t.append("content-type", "text"), Te(await fetch(e, {
1471
+ async function kn(e, t = g) {
1472
+ return M(t, /^[a-z][a-z0-9+.-]*:\/\//i.test(e) ? e : D(t, e.replace(/^\//, "")), {
1486
1473
  method: "GET",
1487
- headers: t
1488
- }));
1474
+ headers: E(t)
1475
+ }, { responseType: "text" });
1489
1476
  }
1490
1477
  //#endregion
1491
1478
  //#region src/web-api/v1/fetch-principal.ts
1492
- async function Nn(e, t = g) {
1493
- return L(t, "api/v1/principal", new URLSearchParams({ action: "get" }), {
1494
- noAutoAuthentication: M(t),
1479
+ async function An(e, t = g) {
1480
+ return I(t, "api/v1/principal", new URLSearchParams({ action: "get" }), {
1481
+ noAutoAuthentication: j(t),
1495
1482
  ...e
1496
1483
  });
1497
1484
  }
1498
- async function Pn(e, t = g) {
1485
+ async function jn(e, t = g) {
1499
1486
  let n = new URLSearchParams();
1500
1487
  return Object.entries(e).forEach(([e, t]) => {
1501
1488
  t !== void 0 && n.append(e, String(t));
1502
- }), L(t, "api/v1/principal/list", n, { noAutoAuthentication: M(t) });
1489
+ }), I(t, "api/v1/principal/list", n, { noAutoAuthentication: j(t) });
1503
1490
  }
1504
- async function Fn(e, t = g) {
1505
- return e ? L(t, "api/v1/principal", new URLSearchParams({
1491
+ async function Mn(e, t = g) {
1492
+ return e ? I(t, "api/v1/principal", new URLSearchParams({
1506
1493
  action: "userid",
1507
1494
  userid: e
1508
- }), { noAutoAuthentication: M(t) }) : Promise.reject(/* @__PURE__ */ Error("userid is required"));
1495
+ }), { noAutoAuthentication: j(t) }) : Promise.reject(/* @__PURE__ */ Error("userid is required"));
1509
1496
  }
1510
- async function In(e, t = g) {
1511
- return e.length === 0 ? Promise.reject(/* @__PURE__ */ Error("userids is required")) : L(t, "api/v1/principal/userids", new URLSearchParams({ userids: [...e].join(",") }), { noAutoAuthentication: M(t) });
1497
+ async function Nn(e, t = g) {
1498
+ return e.length === 0 ? Promise.reject(/* @__PURE__ */ Error("userids is required")) : I(t, "api/v1/principal/userids", new URLSearchParams({ userids: [...e].join(",") }), { noAutoAuthentication: j(t) });
1512
1499
  }
1513
- var Ln = { principal: {
1514
- get: Nn,
1515
- list: Pn,
1516
- userid: Fn,
1517
- userids: In
1500
+ var Pn = { principal: {
1501
+ get: An,
1502
+ list: jn,
1503
+ userid: Mn,
1504
+ userids: Nn
1518
1505
  } };
1519
1506
  //#endregion
1520
1507
  //#region src/web-api/v1/fetch-query.ts
1521
- function Rn(e, t, n) {
1508
+ function Fn(e, t, n) {
1522
1509
  let r = n.config.aggregationCounts;
1523
1510
  e.aggregations?.forEach((e) => {
1524
- e.$hasMore = Pt(e, Nt(e.name, t, r)), e.isTree && Vn(e);
1511
+ e.$hasMore = Ft(e, Pt(e.name, t, r)), e.isTree && Rn(e);
1525
1512
  });
1526
1513
  }
1527
- async function zn(e, t, n, r = g) {
1528
- let i = await F(r, "api/v1/query", {
1514
+ async function In(e, t, n, r = g) {
1515
+ let i = await P(r, "api/v1/query", {
1529
1516
  query: e,
1530
1517
  $auditRecord: t,
1531
1518
  queryIntentData: n
1532
1519
  });
1533
- Rn(i, e, r), i.records?.map((e) => Object.assign(e, {
1520
+ Fn(i, e, r), i.records?.map((e) => Object.assign(e, {
1534
1521
  value: e.title,
1535
1522
  type: "default"
1536
1523
  }));
1537
1524
  let a = {
1538
1525
  ...i,
1539
- ...Jt(i)
1526
+ ...Yt(i)
1540
1527
  };
1541
1528
  return Promise.resolve(a);
1542
1529
  }
1543
- async function Bn(e, t, n, r = g) {
1530
+ async function Ln(e, t, n, r = g) {
1544
1531
  let { app: i = "" } = r.config, a = {
1545
1532
  methods: [],
1546
1533
  mode: t,
@@ -1552,9 +1539,9 @@ async function Bn(e, t, n, r = g) {
1552
1539
  app: i,
1553
1540
  query: t
1554
1541
  });
1555
- let o = await F(r, "api/v1/multi", a);
1542
+ let o = await P(r, "api/v1/multi", a);
1556
1543
  o.results.forEach((t, n) => {
1557
- Rn(t, e[n], r);
1544
+ Fn(t, e[n], r);
1558
1545
  }), o.results.forEach((e) => {
1559
1546
  e.records?.map((e) => Object.assign(e, {
1560
1547
  value: e.title,
@@ -1563,23 +1550,23 @@ async function Bn(e, t, n, r = g) {
1563
1550
  });
1564
1551
  let s = o.results.map((e) => ({
1565
1552
  ...e,
1566
- ...Jt(e)
1553
+ ...Yt(e)
1567
1554
  }));
1568
1555
  return Promise.resolve(s);
1569
1556
  }
1570
- function Vn(e, t = "", n = 0) {
1557
+ function Rn(e, t = "", n = 0) {
1571
1558
  let r = [];
1572
1559
  return e.items && e.items.forEach((e) => {
1573
1560
  let i = t ? `${t}/${e.value}` : e.value, a = n + 1;
1574
1561
  r.push({
1575
1562
  path: i,
1576
1563
  level: a
1577
- }), e.$path = i, e.$level = a, e.hasChildren ? r = r.concat(Vn(e, i, a)) : e.hasChildren = !1;
1564
+ }), e.$path = i, e.$level = a, e.hasChildren ? r = r.concat(Rn(e, i, a)) : e.hasChildren = !1;
1578
1565
  }), r;
1579
1566
  }
1580
1567
  //#endregion
1581
1568
  //#region src/web-api/v1/fetch-query-export.ts
1582
- async function Hn({ model: e, appName: t, query: n, article: r }, i = g) {
1569
+ async function zn({ model: e, appName: t, query: n, article: r }, i = g) {
1583
1570
  let { webservice: a, format: o, maxcount: s, exportedColumns: c, export: l } = e, u = {
1584
1571
  app: t,
1585
1572
  webservice: a,
@@ -1593,30 +1580,30 @@ async function Hn({ model: e, appName: t, query: n, article: r }, i = g) {
1593
1580
  detail: { resultid: r ? r.id : void 0 }
1594
1581
  }] }
1595
1582
  };
1596
- return q(u), await F(i, "api/v1/search.queryexport", u, { responseType: "blob" });
1583
+ return K(u), await P(i, "api/v1/search.queryexport", u, { responseType: "blob" });
1597
1584
  }
1598
1585
  //#endregion
1599
1586
  //#region src/web-api/v1/fetch-query-intent.ts
1600
- async function Un(e, t = g) {
1601
- return (await F(t, "api/v1/queryintent", { query: e }))?.intents;
1587
+ async function Bn(e, t = g) {
1588
+ return (await P(t, "api/v1/queryintent", { query: e }))?.intents;
1602
1589
  }
1603
1590
  //#endregion
1604
1591
  //#region src/web-api/v1/fetch-security-principal.ts
1605
- function Wn(e, t, n = g) {
1606
- return F(n, "api/v1/security.principal", e, { signal: t });
1592
+ function Vn(e, t, n = g) {
1593
+ return P(n, "api/v1/security.principal", e, { signal: t });
1607
1594
  }
1608
1595
  //#endregion
1609
1596
  //#region src/web-api/v1/fetch-similar-documents.ts
1610
- async function Gn(e, t, n, r = g) {
1611
- return (await F(r, "api/v1/similardocuments", {
1597
+ async function Hn(e, t, n, r = g) {
1598
+ return (await P(r, "api/v1/similardocuments", {
1612
1599
  sourceDocumentId: e,
1613
1600
  query: { name: t }
1614
1601
  }, { signal: n })).data;
1615
1602
  }
1616
1603
  //#endregion
1617
1604
  //#region src/web-api/v1/fetch-sponsored-links.ts
1618
- async function Kn(e, t, n = g) {
1619
- return (await F(n, "api/v1/query.links", {
1605
+ async function Un(e, t, n = g) {
1606
+ return (await P(n, "api/v1/query.links", {
1620
1607
  webservice: e,
1621
1608
  query: t
1622
1609
  }))?.links?.map((e) => ({
@@ -1626,9 +1613,9 @@ async function Kn(e, t, n = g) {
1626
1613
  }
1627
1614
  //#endregion
1628
1615
  //#region src/utils/to-sql.ts
1629
- function qn(e, t) {
1616
+ function Wn(e, t) {
1630
1617
  if (typeof e == "number") return `${e}`;
1631
- if (Zt(e)) return t ? `'${Jn(e)}'` : Jn(e);
1618
+ if (Qt(e)) return t ? `'${Gn(e)}'` : Gn(e);
1632
1619
  if (typeof e == "boolean") return e ? "true" : "false";
1633
1620
  if (e === null) return "null";
1634
1621
  if (Array.isArray(e)) {
@@ -1639,10 +1626,10 @@ function qn(e, t) {
1639
1626
  }
1640
1627
  return t ? `'${e}'` : e;
1641
1628
  }
1642
- function Jn(e) {
1629
+ function Gn(e) {
1643
1630
  if (!e) return "";
1644
1631
  try {
1645
- return en(e) === 0 ? new Intl.DateTimeFormat("en-CA", {
1632
+ return tn(e) === 0 ? new Intl.DateTimeFormat("en-CA", {
1646
1633
  year: "numeric",
1647
1634
  month: "2-digit",
1648
1635
  day: "2-digit"
@@ -1658,7 +1645,7 @@ function Jn(e) {
1658
1645
  }
1659
1646
  //#endregion
1660
1647
  //#region src/web-api/v1/fetch-suggest.ts
1661
- async function Yn(e, t, n, r, i, a = g) {
1648
+ async function Kn(e, t, n, r, i, a = g) {
1662
1649
  let { app: o } = a.config, s = {
1663
1650
  app: o || "",
1664
1651
  suggestQuery: e,
@@ -1668,14 +1655,14 @@ async function Yn(e, t, n, r, i, a = g) {
1668
1655
  showSource: i
1669
1656
  };
1670
1657
  try {
1671
- return (await F(a, "api/v1/search.suggest", s)).suggests;
1658
+ return (await P(a, "api/v1/search.suggest", s)).suggests;
1672
1659
  } catch (e) {
1673
1660
  throw console.error("Error fetching suggestions:", e), e;
1674
1661
  }
1675
1662
  }
1676
- async function Xn(e, t, n, r, i = g) {
1663
+ async function qn(e, t, n, r, i = g) {
1677
1664
  let { app: a } = i.config;
1678
- return (await F(i, "api/v1/suggestquery", {
1665
+ return (await P(i, "api/v1/suggestquery", {
1679
1666
  app: a || "",
1680
1667
  suggestQuery: e,
1681
1668
  text: t,
@@ -1683,22 +1670,22 @@ async function Xn(e, t, n, r, i = g) {
1683
1670
  kinds: r
1684
1671
  })).suggests;
1685
1672
  }
1686
- async function Zn(e, t, n, r = g) {
1673
+ async function Jn(e, t, n, r = g) {
1687
1674
  if (!t) return Promise.resolve([]);
1688
- let { app: i } = r.config, a = await F(r, "api/v1/suggestfield", {
1675
+ let { app: i } = r.config, a = await P(r, "api/v1/suggestfield", {
1689
1676
  app: i || "",
1690
1677
  text: e,
1691
1678
  fields: t,
1692
1679
  query: n
1693
1680
  });
1694
1681
  return a.suggests.forEach((e) => {
1695
- e.display = qn(e.display);
1682
+ e.display = Wn(e.display);
1696
1683
  }), a.suggests;
1697
1684
  }
1698
1685
  //#endregion
1699
1686
  //#region src/web-api/v1/fetch-text-chunk.ts
1700
- async function Qn(e, t, n, r, i, a, o = g) {
1701
- return F(o, "api/v1/doc.textchunks", {
1687
+ async function Yn(e, t, n, r, i, a, o = g) {
1688
+ return P(o, "api/v1/doc.textchunks", {
1702
1689
  id: e,
1703
1690
  textChunks: t,
1704
1691
  highlights: n,
@@ -1709,228 +1696,233 @@ async function Qn(e, t, n, r, i, a, o = g) {
1709
1696
  }
1710
1697
  //#endregion
1711
1698
  //#region src/web-api/v1/fetch-user-settings.ts
1712
- async function $n(e = g) {
1699
+ async function Xn(e = g) {
1713
1700
  let { app: t } = e.config;
1714
- return L(e, "api/v1/usersettings", new URLSearchParams({
1701
+ return I(e, "api/v1/usersettings", new URLSearchParams({
1715
1702
  app: t || "",
1716
1703
  action: "load"
1717
1704
  }));
1718
1705
  }
1719
- async function er(e, t, n = g) {
1706
+ async function Zn(e, t, n = g) {
1720
1707
  let r = {
1721
1708
  action: "save",
1722
1709
  userSettings: e,
1723
1710
  $auditRecord: { auditEvents: [t] }
1724
1711
  };
1725
- return q(r), F(n, "api/v1/usersettings", r);
1712
+ return K(r), P(n, "api/v1/usersettings", r);
1726
1713
  }
1727
- async function tr(e, t, n = g) {
1714
+ async function Qn(e, t, n = g) {
1728
1715
  let r = {
1729
1716
  action: "patch",
1730
1717
  userSettings: e,
1731
1718
  $auditRecord: t ? { auditEvents: [t] } : void 0
1732
1719
  };
1733
- return q(r), F(n, "api/v1/usersettings", r);
1720
+ return K(r), P(n, "api/v1/usersettings", r);
1734
1721
  }
1735
- async function nr(e = g) {
1736
- return er({}, { type: "UserSettings_Reset" }, e);
1722
+ async function $n(e = g) {
1723
+ return Zn({}, { type: "UserSettings_Reset" }, e);
1737
1724
  }
1738
1725
  //#endregion
1739
1726
  //#region src/web-api/v2/fetch-change-password.ts
1740
- async function rr(e, t, n = g) {
1741
- return F(n, "api/v2/security/password/change", {
1727
+ async function er(e, t, n = g) {
1728
+ return P(n, "api/v2/security/password/change", {
1742
1729
  newPassword: e,
1743
1730
  currentPassword: t
1744
1731
  });
1745
1732
  }
1746
1733
  //#endregion
1747
1734
  //#region src/web-api/v2/fetch-document-upload-container.ts
1748
- var Y = "api/v2/document-upload/container";
1749
- function ir(e) {
1735
+ var J = "api/v2/document-upload/container";
1736
+ function tr(e) {
1750
1737
  let t = new URLSearchParams();
1751
1738
  return e.page !== void 0 && t.set("page", String(e.page)), e.pageSize !== void 0 && t.set("pageSize", String(e.pageSize)), t;
1752
1739
  }
1753
- function ar(e = {}, t = g) {
1754
- return L(t, Y, ir(e));
1740
+ function nr(e = {}, t = g) {
1741
+ return I(t, J, tr(e));
1755
1742
  }
1756
- function or(e, t = g) {
1757
- return L(t, `${Y}/${encodeURIComponent(e)}`);
1743
+ function rr(e, t = g) {
1744
+ return I(t, `${J}/${encodeURIComponent(e)}`);
1758
1745
  }
1759
- function sr(e, t = g) {
1760
- return F(t, Y, e);
1746
+ function ir(e, t = g) {
1747
+ return P(t, J, e);
1761
1748
  }
1762
- function cr(e, t, n = g) {
1763
- return B(n, `${Y}/${encodeURIComponent(e)}`, t);
1749
+ function ar(e, t, n = g) {
1750
+ return z(n, `${J}/${encodeURIComponent(e)}`, t);
1764
1751
  }
1765
- async function lr(e, t = g) {
1766
- let n = (await R(t, "api/v2/document-upload/containers", void 0, { body: { containerIds: e } }))?.failed ?? [], r = new Set(n.map((e) => e.containerId));
1752
+ async function or(e, t = g) {
1753
+ let n = (await L(t, "api/v2/document-upload/containers", void 0, { body: { containerIds: e } }))?.failed ?? [], r = new Set(n.map((e) => e.containerId));
1767
1754
  return {
1768
1755
  succeeded: e.filter((e) => !r.has(e)),
1769
1756
  failed: n
1770
1757
  };
1771
1758
  }
1772
- function ur(e, t = {}, n = g) {
1773
- return L(n, `${Y}/${encodeURIComponent(e)}/documents`, ir(t));
1759
+ function sr(e, t = {}, n = g) {
1760
+ return I(n, `${J}/${encodeURIComponent(e)}/documents`, tr(t));
1774
1761
  }
1775
- function dr(e, t, n = g) {
1776
- return R(n, `${Y}/${encodeURIComponent(e)}/documents`, void 0, { body: { fileIds: t } });
1762
+ function cr(e, t, n = g) {
1763
+ return L(n, `${J}/${encodeURIComponent(e)}/documents`, void 0, { body: { fileIds: t } });
1777
1764
  }
1778
1765
  //#endregion
1779
1766
  //#region src/web-api/v2/fetch-forgot-password.ts
1780
- async function fr(e, t = g) {
1781
- return F(t, "api/v2/security/password/ask-reset-email", {
1782
- changePasswordRedirectUrl: `${window.location.origin}/login?mode=changepassword`,
1767
+ function lr() {
1768
+ return typeof window > "u" ? void 0 : `${window.location.origin}/login?mode=changepassword`;
1769
+ }
1770
+ async function ur(e, t, n = g) {
1771
+ let r = t ?? lr();
1772
+ if (!r) throw Error("fetchSendPasswordResetEmail needs a changePasswordRedirectUrl outside a browser: there is no page origin to derive it from. Pass the URL the reset email should link to.");
1773
+ return P(n, "api/v2/security/password/ask-reset-email", {
1774
+ changePasswordRedirectUrl: r,
1783
1775
  userName: e
1784
1776
  });
1785
1777
  }
1786
1778
  //#endregion
1787
1779
  //#region src/web-api/v2/fetch-user-profile.ts
1788
- async function pr(e, t = g) {
1789
- return await L(t, `api/v2/user-profile/${e}`);
1780
+ async function dr(e, t = g) {
1781
+ return await I(t, `api/v2/user-profile/${e}`);
1790
1782
  }
1791
- async function mr(e, t = g) {
1792
- return await F(t, "api/v2/user-profile", e);
1783
+ async function fr(e, t = g) {
1784
+ return await P(t, "api/v2/user-profile", e);
1793
1785
  }
1794
- async function hr(e, t, n, r = g) {
1795
- return await z(r, `api/v2/user-profile/${e.data?.id}/${t}/${n}`, e);
1786
+ async function pr(e, t, n, r = g) {
1787
+ return await R(r, `api/v2/user-profile/${e.data?.id}/${t}/${n}`, e);
1796
1788
  }
1797
- async function gr(e, t, n, r = g) {
1798
- return (await R(r, `api/v2/user-profile/${e.data?.id}/${t}/${n}`)).success === !0;
1789
+ async function mr(e, t, n, r = g) {
1790
+ return (await L(r, `api/v2/user-profile/${e.data?.id}/${t}/${n}`)).success === !0;
1799
1791
  }
1800
1792
  //#endregion
1801
1793
  //#region src/web-api/v2/fetch-version.ts
1802
- async function _r(e = g) {
1803
- return await L(e, "api/v2/version");
1794
+ async function hr(e = g) {
1795
+ return await I(e, "api/v2/version");
1804
1796
  }
1805
1797
  //#endregion
1806
1798
  //#region src/client/create-api.ts
1807
- var X = (e, t) => (...n) => {
1799
+ var Y = (e, t) => (...n) => {
1808
1800
  let r = Array(Math.max(0, e.length - n.length)).fill(void 0);
1809
1801
  return e(...n, ...r, t);
1810
1802
  };
1811
- function vr(e) {
1803
+ function gr(e) {
1812
1804
  return {
1813
1805
  app: {
1814
- get: X(Dt, e),
1815
- preLogin: X(Ot, e)
1806
+ get: Y(Ot, e),
1807
+ preLogin: Y(kt, e)
1816
1808
  },
1817
1809
  principal: {
1818
- get: X(Nn, e),
1819
- list: X(Pn, e),
1820
- userid: X(Fn, e),
1821
- userids: X(In, e),
1822
- search: X(Wn, e)
1810
+ get: Y(An, e),
1811
+ list: Y(jn, e),
1812
+ userid: Y(Mn, e),
1813
+ userids: Y(Nn, e),
1814
+ search: Y(Vn, e)
1823
1815
  },
1824
1816
  query: {
1825
- search: X(zn, e),
1826
- bulk: X(Bn, e),
1827
- intent: X(Un, e),
1828
- export: X(Hn, e),
1829
- aggregate: X(hn, e),
1830
- sponsoredLinks: X(Kn, e),
1831
- similarDocuments: X(Gn, e)
1817
+ search: Y(In, e),
1818
+ bulk: Y(Ln, e),
1819
+ intent: Y(Bn, e),
1820
+ export: Y(zn, e),
1821
+ aggregate: Y(gn, e),
1822
+ sponsoredLinks: Y(Un, e),
1823
+ similarDocuments: Y(Hn, e)
1832
1824
  },
1833
1825
  suggest: {
1834
- get: X(Yn, e),
1835
- query: X(Xn, e),
1836
- field: X(Zn, e)
1826
+ get: Y(Kn, e),
1827
+ query: Y(qn, e),
1828
+ field: Y(Jn, e)
1837
1829
  },
1838
1830
  preview: {
1839
- get: X(jn, e),
1840
- textChunks: X(Qn, e)
1831
+ get: Y(On, e),
1832
+ textChunks: Y(Yn, e)
1841
1833
  },
1842
1834
  labels: {
1843
- get: X(yn, e),
1844
- rights: X(J.getUserRights, e),
1845
- add: X(J.add, e),
1846
- remove: X(J.remove, e),
1847
- rename: X(J.rename, e),
1848
- delete: X(J.delete, e),
1849
- bulkAdd: X(J.bulkAdd, e),
1850
- bulkRemove: X(J.bulkRemove, e)
1835
+ get: Y(bn, e),
1836
+ rights: Y(q.getUserRights, e),
1837
+ add: Y(q.add, e),
1838
+ remove: Y(q.remove, e),
1839
+ rename: Y(q.rename, e),
1840
+ delete: Y(q.delete, e),
1841
+ bulkAdd: Y(q.bulkAdd, e),
1842
+ bulkRemove: Y(q.bulkRemove, e)
1851
1843
  },
1852
1844
  dataset: {
1853
- get: X(gn, e),
1854
- getMany: X(_n, e),
1855
- list: X(vn, e)
1845
+ get: Y(_n, e),
1846
+ getMany: Y(vn, e),
1847
+ list: Y(yn, e)
1856
1848
  },
1857
1849
  userSettings: {
1858
- get: X($n, e),
1859
- save: X(er, e),
1860
- patch: X(tr, e),
1861
- reset: X(nr, e)
1850
+ get: Y(Xn, e),
1851
+ save: Y(Zn, e),
1852
+ patch: Y(Qn, e),
1853
+ reset: Y($n, e)
1862
1854
  },
1863
1855
  userProfile: {
1864
- get: X(pr, e),
1865
- create: X(mr, e),
1866
- patch: X(hr, e),
1867
- deleteProperty: X(gr, e)
1856
+ get: Y(dr, e),
1857
+ create: Y(fr, e),
1858
+ patch: Y(pr, e),
1859
+ deleteProperty: Y(mr, e)
1868
1860
  },
1869
1861
  containers: {
1870
- list: X(ar, e),
1871
- get: X(or, e),
1872
- create: X(sr, e),
1873
- update: X(cr, e),
1874
- delete: X(lr, e),
1875
- listDocuments: X(ur, e),
1876
- deleteDocuments: X(dr, e)
1862
+ list: Y(nr, e),
1863
+ get: Y(rr, e),
1864
+ create: Y(ir, e),
1865
+ update: Y(ar, e),
1866
+ delete: Y(or, e),
1867
+ listDocuments: Y(sr, e),
1868
+ deleteDocuments: Y(cr, e)
1877
1869
  },
1878
1870
  password: {
1879
- change: X(rr, e),
1880
- sendResetEmail: X(fr, e)
1871
+ change: Y(er, e),
1872
+ sendResetEmail: Y(ur, e)
1881
1873
  },
1882
- version: X(_r, e)
1874
+ version: Y(hr, e)
1883
1875
  };
1884
1876
  }
1885
1877
  //#endregion
1886
1878
  //#region src/client/create-atomic-client.ts
1887
- function yr(e) {
1879
+ function _r(e) {
1888
1880
  return {
1889
1881
  config: e.config,
1890
1882
  storagePrefix: e.storagePrefix,
1891
1883
  configure: (t) => b(e, t),
1892
- initializeConfig: () => kt(e),
1884
+ initializeConfig: () => At(e),
1893
1885
  auth: {
1894
- login: (t) => ut(e, t),
1895
- logout: () => gt(e),
1896
- isAuthenticated: () => St(e),
1897
- hasSession: () => We(e),
1898
- isRedirectPending: () => bt(e),
1899
- clearSession: () => vt(e),
1886
+ login: (t) => dt(e, t),
1887
+ logout: () => _t(e),
1888
+ isAuthenticated: () => Ct(e),
1889
+ hasSession: () => Ge(e),
1890
+ isRedirectPending: () => xt(e),
1891
+ clearSession: () => yt(e),
1900
1892
  getToken: () => T(e),
1901
1893
  setToken: (t) => A(e, t),
1902
1894
  on: (t, n) => e.events.on(t, n)
1903
1895
  },
1904
1896
  http: {
1905
- get: (t, n, r) => L(e, t, n, r),
1906
- post: (t, n, r) => F(e, t, n, r),
1907
- put: (t, n, r) => B(e, t, n, r),
1908
- patch: (t, n, r) => z(e, t, n, r),
1909
- del: (t, n, r) => R(e, t, n, r)
1897
+ get: (t, n, r) => I(e, t, n, r),
1898
+ post: (t, n, r) => P(e, t, n, r),
1899
+ put: (t, n, r) => z(e, t, n, r),
1900
+ patch: (t, n, r) => R(e, t, n, r),
1901
+ del: (t, n, r) => L(e, t, n, r)
1910
1902
  },
1911
- api: vr(e),
1903
+ api: gr(e),
1912
1904
  context: e
1913
1905
  };
1914
1906
  }
1915
- function br(e) {
1907
+ function vr(e) {
1916
1908
  let { httpAdapter: t, storagePrefix: n, ...r } = e, i = pe({
1917
1909
  config: {},
1918
1910
  storagePrefix: n,
1919
1911
  httpAdapter: t
1920
1912
  });
1921
- return b(i, r), yr(i);
1913
+ return b(i, r), _r(i);
1922
1914
  }
1923
- var xr = yr(g);
1924
- function Sr() {
1925
- return xr;
1915
+ var yr = _r(g);
1916
+ function br() {
1917
+ return yr;
1926
1918
  }
1927
1919
  //#endregion
1928
1920
  //#region src/utils/aggregations.ts
1929
- var Cr = /.*:\(?([><=\d\-.AND ]+)\)?/;
1930
- function wr(e, t) {
1921
+ var xr = /.*:\(?([><=\d\-.AND ]+)\)?/;
1922
+ function Sr(e, t) {
1931
1923
  return !e?.items || e?.items?.length === 0 ? [] : e.items.reduce((n, r) => {
1932
1924
  if (!r.value || r.value === "") return n;
1933
- let i = Tr(r, e.column);
1925
+ let i = Cr(r, e.column);
1934
1926
  return n.push({
1935
1927
  operator: i.operator,
1936
1928
  value: i.value,
@@ -1941,8 +1933,8 @@ function wr(e, t) {
1941
1933
  }), n;
1942
1934
  }, []);
1943
1935
  }
1944
- function Tr(e, t) {
1945
- let n = t, r = e.value.match(Cr);
1936
+ function Cr(e, t) {
1937
+ let n = t, r = e.value.match(xr);
1946
1938
  if (r?.[1]) {
1947
1939
  let t = (r?.[1].split(" AND ")).map((t) => ({
1948
1940
  field: n,
@@ -1970,26 +1962,26 @@ function Tr(e, t) {
1970
1962
  display: e.display
1971
1963
  };
1972
1964
  }
1973
- function Er(e, t, n) {
1965
+ function wr(e, t, n) {
1974
1966
  return e.valuesAreExpressions ? t.display === n.display : t.value === n.value;
1975
1967
  }
1976
- function Dr(e) {
1977
- return e.items &&= e.items.map((e) => Dr(e)), e.items?.some((e) => e.$selected || e.$opened) && (e.$opened = !0), e;
1968
+ function Tr(e) {
1969
+ return e.items &&= e.items.map((e) => Tr(e)), e.items?.some((e) => e.$selected || e.$opened) && (e.$opened = !0), e;
1978
1970
  }
1979
- function Or(e, t) {
1971
+ function Er(e, t) {
1980
1972
  let n = [];
1981
1973
  if (e.length > 0) {
1982
1974
  let r = /* @__PURE__ */ new Map(), i = t.replace(/[.*+?^${}()|[\]\\]/g, "\\$&").normalize("NFD").replace(/[\u0300-\u036f]/g, ""), a = RegExp(`\\b${i}`, "i");
1983
1975
  e.forEach((e) => {
1984
1976
  if (e.display.length > 1) {
1985
1977
  let i = e.display.normalize("NFD").replace(/[\u0300-\u036f]/g, ""), o = a.exec(i);
1986
- kr(n, r, "/", e.display, +(e.frequency || 0), 1, (o?.index || 0) + t.length);
1978
+ Dr(n, r, "/", e.display, +(e.frequency || 0), 1, (o?.index || 0) + t.length);
1987
1979
  }
1988
1980
  });
1989
1981
  }
1990
1982
  return n;
1991
1983
  }
1992
- function kr(e, t, n, r, i, a, o) {
1984
+ function Dr(e, t, n, r, i, a, o) {
1993
1985
  let s = r.indexOf("/", n.length), c = r.substring(0, s + 1), l = t.get(c);
1994
1986
  if (!l) {
1995
1987
  let u = c.replace(/^\/|\/$/g, "");
@@ -2003,11 +1995,11 @@ function kr(e, t, n, r, i, a, o) {
2003
1995
  $path: u
2004
1996
  }, t.set(c, l), e.push(l);
2005
1997
  }
2006
- c.length < r.length && (l.hasChildren = !0, kr(l.items, t, c, r, i, a + 1, o));
1998
+ c.length < r.length && (l.hasChildren = !0, Dr(l.items, t, c, r, i, a + 1, o));
2007
1999
  }
2008
2000
  //#endregion
2009
2001
  //#region src/utils/bisect.ts
2010
- function Ar(e, t) {
2002
+ function Or(e, t) {
2011
2003
  return e.reduce((e, n) => (t(n) ? e.true.push(n) : e.false.push(n), e), {
2012
2004
  true: [],
2013
2005
  false: []
@@ -2015,34 +2007,34 @@ function Ar(e, t) {
2015
2007
  }
2016
2008
  //#endregion
2017
2009
  //#region src/utils/concepts.ts
2018
- var jr = /(([+-])?\(([^)]+)\))|(([+-])?\[([^\]]+)\])|(([+-])?"([^"]+)")|(([+-])?\/([^/]+)\/)|(([+-])?(\S+))/g, Mr = 2, Nr = 3, Pr = 5, Fr = 6, Ir = 8, Lr = 9, Rr = 11, zr = 12, Br = 14, Vr = 15;
2019
- function Z(e) {
2010
+ var kr = /(([+-])?\(([^)]+)\))|(([+-])?\[([^\]]+)\])|(([+-])?"([^"]+)")|(([+-])?\/([^/]+)\/)|(([+-])?(\S+))/g, Ar = 2, jr = 3, Mr = 5, Nr = 6, Pr = 8, Fr = 9, Ir = 11, Lr = 12, Rr = 14, zr = 15;
2011
+ function X(e) {
2020
2012
  if (!e) return [];
2021
- let t = [], n = e.matchAll(jr);
2022
- for (let e of n) e[Nr] ? t.push({
2013
+ let t = [], n = e.matchAll(kr);
2014
+ for (let e of n) e[jr] ? t.push({
2023
2015
  type: "group",
2016
+ value: e[jr],
2017
+ op: e[Ar]
2018
+ }) : e[Nr] ? t.push({
2019
+ type: "adjacent",
2024
2020
  value: e[Nr],
2025
2021
  op: e[Mr]
2026
2022
  }) : e[Fr] ? t.push({
2027
- type: "adjacent",
2023
+ type: "exact",
2028
2024
  value: e[Fr],
2029
2025
  op: e[Pr]
2030
2026
  }) : e[Lr] ? t.push({
2031
- type: "exact",
2027
+ type: "regex",
2032
2028
  value: e[Lr],
2033
2029
  op: e[Ir]
2034
- }) : e[zr] ? t.push({
2035
- type: "regex",
2030
+ }) : e[zr] && t.push({
2031
+ type: "token",
2036
2032
  value: e[zr],
2037
2033
  op: e[Rr]
2038
- }) : e[Vr] && t.push({
2039
- type: "token",
2040
- value: e[Vr],
2041
- op: e[Br]
2042
2034
  });
2043
2035
  return t;
2044
2036
  }
2045
- function Q(e) {
2037
+ function Z(e) {
2046
2038
  return e.map((e) => {
2047
2039
  let t = e.op || "";
2048
2040
  switch (e.type) {
@@ -2055,48 +2047,54 @@ function Q(e) {
2055
2047
  }
2056
2048
  }).join(" ");
2057
2049
  }
2058
- function Hr(e, t, n) {
2059
- let r = Z(e);
2050
+ function Br(e, t, n) {
2051
+ let r = X(e);
2060
2052
  for (let e of t) r.push({
2061
2053
  type: "adjacent",
2062
2054
  value: e,
2063
2055
  op: n
2064
2056
  });
2065
- return Q(r);
2057
+ return Z(r);
2066
2058
  }
2067
- function Ur(e, t) {
2068
- let n = Z(t), r = n.findIndex((t) => t.value === e);
2069
- return r === -1 ? t : (n.splice(r, 1), Q(n));
2059
+ function Vr(e, t) {
2060
+ let n = X(t), r = n.findIndex((t) => t.value === e);
2061
+ return r === -1 ? t : (n.splice(r, 1), Z(n));
2070
2062
  }
2071
- function Wr(e) {
2072
- return Q(Z(e).filter((e) => e.type !== "adjacent"));
2063
+ function Hr(e) {
2064
+ return Z(X(e).filter((e) => e.type !== "adjacent"));
2073
2065
  }
2074
- function Gr(e) {
2075
- return Z(e).filter((e) => e.type === "adjacent").map((e) => e.value);
2066
+ function Ur(e) {
2067
+ return X(e).filter((e) => e.type === "adjacent").map((e) => e.value);
2076
2068
  }
2077
2069
  //#endregion
2078
2070
  //#region src/utils/date.ts
2079
- function Kr(e, t, n) {
2080
- let r = new Intl.RelativeTimeFormat(e, { numeric: "auto" }), { offset: i, unit: a, isFuture: o } = qr(t, n);
2071
+ function Wr(e, t, n) {
2072
+ let r = new Intl.RelativeTimeFormat(e, { numeric: "auto" }), { offset: i, unit: a, isFuture: o } = Kr(t, n);
2081
2073
  return r.format(i * (o ? 1 : -1), a);
2082
2074
  }
2083
- function qr(e, t) {
2084
- let n = new Date(e), r = t ? new Date(t) : /* @__PURE__ */ new Date(), i = Math.abs(r.getTime() - n.getTime());
2075
+ var Gr = [
2076
+ ["year", 365],
2077
+ ["month", 30],
2078
+ ["week", 7],
2079
+ ["day", 1]
2080
+ ];
2081
+ function Kr(e, t) {
2082
+ let n = new Date(e), r = t ? new Date(t) : /* @__PURE__ */ new Date(), i = Math.abs(r.getTime() - n.getTime()), a = Math.floor(i / (1e3 * 60 * 60 * 24)), [o, s] = Gr.find(([, e]) => a >= e) ?? ["day", 1];
2085
2083
  return {
2086
- offset: Math.floor(i / (1e3 * 60 * 60 * 24)),
2087
- unit: "day",
2084
+ offset: Math.floor(a / s),
2085
+ unit: o,
2088
2086
  isFuture: n > r
2089
2087
  };
2090
2088
  }
2091
2089
  //#endregion
2092
2090
  //#region src/utils/is-not-input-event.ts
2093
- function Jr(e) {
2091
+ function qr(e) {
2094
2092
  let t = e.target;
2095
2093
  return t && t.nodeName !== "INPUT" && t.nodeName !== "TEXTAREA";
2096
2094
  }
2097
2095
  //#endregion
2098
2096
  //#region src/utils/notification.ts
2099
- function Yr(e) {
2097
+ function Q(e) {
2100
2098
  let t = new CustomEvent("notification", {
2101
2099
  bubbles: !0,
2102
2100
  cancelable: !1,
@@ -2104,30 +2102,30 @@ function Yr(e) {
2104
2102
  });
2105
2103
  dispatchEvent(t);
2106
2104
  }
2107
- var Xr = {
2105
+ var Jr = {
2108
2106
  success: (e, t) => {
2109
- Yr({
2107
+ Q({
2110
2108
  type: "success",
2111
2109
  message: e,
2112
2110
  options: t
2113
2111
  });
2114
2112
  },
2115
2113
  info: (e, t) => {
2116
- Yr({
2114
+ Q({
2117
2115
  type: "info",
2118
2116
  message: e,
2119
2117
  options: t
2120
2118
  });
2121
2119
  },
2122
2120
  warning: (e, t) => {
2123
- Yr({
2121
+ Q({
2124
2122
  type: "warning",
2125
2123
  message: e,
2126
2124
  options: t
2127
2125
  });
2128
2126
  },
2129
2127
  error: (e, t) => {
2130
- Yr({
2128
+ Q({
2131
2129
  type: "error",
2132
2130
  message: e,
2133
2131
  options: t
@@ -2136,13 +2134,13 @@ var Xr = {
2136
2134
  };
2137
2135
  //#endregion
2138
2136
  //#region src/utils/query-params.ts
2139
- function Zr(e) {
2137
+ function Yr(e) {
2140
2138
  if (e === void 0) return;
2141
2139
  let { q: t, f: n, p: r, s: i, t: a, n: o, b: s } = $(e), [c] = e.split("?");
2142
2140
  return {
2143
2141
  path: c,
2144
2142
  text: t,
2145
- filters: n ? ei(n) : void 0,
2143
+ filters: n ? Qr(n) : void 0,
2146
2144
  page: r ? parseInt(r, 10) : void 0,
2147
2145
  sort: i,
2148
2146
  tab: a,
@@ -2150,17 +2148,17 @@ function Zr(e) {
2150
2148
  basket: s
2151
2149
  };
2152
2150
  }
2153
- function Qr(e) {
2151
+ function Xr(e) {
2154
2152
  if (!e) return "";
2155
2153
  let { text: t, filters: n, page: r, sort: i, tab: a, name: o, basket: s } = e, c = {};
2156
2154
  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() || "";
2157
2155
  }
2158
- function $r(e) {
2156
+ function Zr(e) {
2159
2157
  if (e === void 0) return [];
2160
2158
  let { f: t } = $(e);
2161
- return ei(t);
2159
+ return Qr(t);
2162
2160
  }
2163
- function ei(e) {
2161
+ function Qr(e) {
2164
2162
  let t = decodeURIComponent(e);
2165
2163
  try {
2166
2164
  return JSON.parse(t ?? "[]");
@@ -2174,41 +2172,41 @@ function $(e) {
2174
2172
  let n = new URLSearchParams(t);
2175
2173
  return Object.fromEntries(n);
2176
2174
  }
2177
- function ti(e) {
2175
+ function $r(e) {
2178
2176
  let { q: t = "" } = $(e);
2179
2177
  return t;
2180
2178
  }
2181
- function ni(e) {
2179
+ function ei(e) {
2182
2180
  let { id: t } = $(e);
2183
- return decodeURIComponent(t);
2181
+ return t === void 0 ? void 0 : decodeURIComponent(t);
2184
2182
  }
2185
- function ri(e) {
2183
+ function ti(e) {
2186
2184
  let { p: t = "0" } = $(e);
2187
2185
  return parseInt(t, 10);
2188
2186
  }
2189
- function ii(e) {
2187
+ function ni(e) {
2190
2188
  let { t } = $(e);
2191
2189
  return t;
2192
2190
  }
2193
2191
  //#endregion
2194
2192
  //#region src/utils/syslang.ts
2195
- function ai(e, t) {
2193
+ function ri(e, t) {
2196
2194
  if (!e) return e;
2197
2195
  let n = 0, r = e.length, i = 0;
2198
2196
  if (e[i] === "[") {
2199
2197
  for (; i < r && /[0-9]/.test(e[i]);) i++;
2200
2198
  e[i] === "]" && (n = i + 1);
2201
2199
  }
2202
- let a = oi(e, n, !1);
2200
+ let a = ii(e, n, !1);
2203
2201
  if (!a) return e;
2204
2202
  let o = t.charCodeAt(0), s = t.charCodeAt(1), c = a;
2205
2203
  for (; c;) if (o === c.lang1 && s === c.lang2) {
2206
- let t = oi(e, c.end + 4, !0);
2204
+ let t = ii(e, c.end + 4, !0);
2207
2205
  return e.substring(t.start, t.end);
2208
- } else c = oi(e, c.end + 4, !1);
2206
+ } else c = ii(e, c.end + 4, !1);
2209
2207
  return e.substring(a.start, a.end) || e;
2210
2208
  }
2211
- function oi(e, t, n) {
2209
+ function ii(e, t, n) {
2212
2210
  for (let n = t, r = e.length - 3; n < r; n++) if (e[n] === "[" && e[n + 3] === "]") return {
2213
2211
  start: t,
2214
2212
  end: n,
@@ -2224,7 +2222,7 @@ function oi(e, t, n) {
2224
2222
  }
2225
2223
  //#endregion
2226
2224
  //#region src/utils/utilities.ts
2227
- function si(e, t) {
2225
+ function ai(e, t) {
2228
2226
  let { useLocale: n, useLocaleAsPrefix: r, indexFile: i, path: a, folder: o } = t, s = n ? `${e}/` : null, c = r ? `${e}.${i}` : i ?? "";
2229
2227
  return [
2230
2228
  a,
@@ -2233,4 +2231,33 @@ function si(e, t) {
2233
2231
  ].filter((e) => e !== void 0).join("/");
2234
2232
  }
2235
2233
  //#endregion
2236
- export { qn as $, ne as $n, Ft as $t, Sr as A, I as An, en as At, or as B, k as Bn, Jt as Bt, Cr as C, Ke as Cn, _n as Ct, Or as D, Be as Dn, ln as Dt, Tr as E, L as En, q as Et, hr as F, M as Fn, Zt as Ft, nr as G, be as Gn, Ht as Gt, ar as H, Se as Hn, qt as Ht, fr as I, Te as In, $t as It, er as J, ue as Jn, Lt as Jt, $n as K, de as Kn, W as Kt, sr as L, j as Ln, K as Lt, mr as M, Me as Mn, an as Mt, gr as N, F as Nn, Yt as Nt, wr as O, ze as On, un as Ot, pr as P, De as Pn, Xt as Pt, Xn as Q, f as Qn, V as Qt, dr as R, we as Rn, Qt as Rt, Ar as S, qe as Sn, vn as St, Dr as T, Ve as Tn, mn as Tt, cr as U, E as Un, G as Ut, ur as V, O as Vn, Kt as Vt, rr as W, xe as Wn, Gt as Wt, Yn as X, m as Xn, U as Xt, Qn as Y, ae as Yn, It as Yt, Zn as Z, ie as Zn, H as Zt, Gr as _, ht as _n, On as _t, ni as a, Ot as an, d as ar, Vn as at, Wr as b, Xe as bn, J as bt, ii as c, B as cn, s as cr, Ln as ct, $ as d, wt as dn, Fn as dt, jt as en, re as er, Kn as et, Xr as f, R as fn, In as ft, Hr as g, _t as gn, kn as gt, Kr as h, yt as hn, An as ht, $r as i, Dt as in, r as ir, Hn as it, _r as j, Ne as jn, tn as jt, br as k, Le as kn, nn as kt, ti as l, Tt as ln, c as lr, Nn as lt, qr as m, xt as mn, Mn as mt, ai as n, Nt as nn, ee as nr, Wn as nt, ri as o, kt as on, o as or, Bn as ot, Jr as p, Ct as pn, jn as pt, tr as q, h as qn, Rt as qt, ei as r, At as rn, te as rr, Un as rt, Zr as s, Et as sn, l as sr, zn as st, si as t, Pt as tn, p as tr, Gn as tt, Qr as u, z as un, n as ur, Pn as ut, Z as v, dt as vn, Dn as vt, Er as w, Ue as wn, hn as wt, Q as x, Ye as xn, gn as xt, Ur as y, ot as yn, yn as yt, lr as z, Ce as zn, rn as zt };
2234
+ //#region src/web-api/helpers/utils/date-utils.ts
2235
+ function oi(e) {
2236
+ if (!e) return;
2237
+ let t = new Date(e);
2238
+ return Number.isNaN(t.getTime()) ? void 0 : t;
2239
+ }
2240
+ function si(e) {
2241
+ let t = oi(e);
2242
+ return !!t && t.getTime() <= Date.now();
2243
+ }
2244
+ function ci(e, t = 7) {
2245
+ let n = oi(e);
2246
+ if (!n) return !1;
2247
+ let r = Date.now(), i = r + t * 24 * 60 * 60 * 1e3, a = n.getTime();
2248
+ return a > r && a <= i;
2249
+ }
2250
+ //#endregion
2251
+ //#region src/web-api/helpers/utils/with-retry.ts
2252
+ async function li(e, t = 0, n = 1e3) {
2253
+ let r;
2254
+ for (let i = 0; i <= t; i++) try {
2255
+ return await e();
2256
+ } catch (e) {
2257
+ if (r = e, e instanceof O && e.status >= 400 && e.status < 500 && e.status !== 429 || e instanceof DOMException && e.name === "AbortError") throw e;
2258
+ i < t && (c(`Retrying request (${i + 1}/${t})`, { error: e }), await new Promise((e) => setTimeout(e, n)));
2259
+ }
2260
+ throw r;
2261
+ }
2262
+ //#endregion
2263
+ export { Yn as $, ne as $n, It as $t, Cr as A, F as An, tn as At, ur as B, k as Bn, Yt as Bt, Vr as C, qe as Cn, vn as Ct, xr as D, Ve as Dn, un as Dt, Or as E, I as En, K as Et, hr as F, j as Fn, Qt as Ft, sr as G, be as Gn, Ut as Gt, cr as H, Se as Hn, Jt as Ht, fr as I, Te as In, en as It, er as J, ue as Jn, Rt as Jt, nr as K, de as Kn, U as Kt, mr as L, Ee as Ln, G as Lt, Sr as M, Ne as Mn, on as Mt, vr as N, P as Nn, Xt as Nt, wr as O, Be as On, dn as Ot, br as P, Oe as Pn, Zt as Pt, Zn as Q, f as Qn, B as Qt, dr as R, we as Rn, $t as Rt, X as S, Je as Sn, yn as St, Z as T, He as Tn, hn as Tt, or as U, E as Un, W as Ut, ir as V, O as Vn, qt as Vt, rr as W, xe as Wn, Kt as Wt, Xn as X, m as Xn, H as Xt, $n as Y, ae as Yn, Lt as Yt, Qn as Z, ie as Zn, V as Zt, qr as _, gt as _n, On as _t, ai as a, kt as an, d as ar, Hn as at, Br as b, Ze as bn, q as bt, Zr as c, z as cn, s as cr, zn as ct, Yr as d, Tt as dn, In as dt, Mt as en, re as er, Kn as et, ni as f, L as fn, Pn as ft, Jr as g, vt as gn, Nn as gt, $ as h, bt as hn, Mn as ht, oi as i, Ot as in, r as ir, Un as it, Er as j, Pe as jn, nn as jt, Tr as k, Re as kn, rn as kt, ei as l, Et as ln, c as lr, Rn as lt, Xr as m, St as mn, jn as mt, ci as n, Pt as nn, ee as nr, qn as nt, ri as o, At as on, o as or, Vn as ot, $r as p, wt as pn, An as pt, ar as q, h as qn, zt as qt, si as r, jt as rn, te as rr, Wn as rt, Qr as s, Dt as sn, l as sr, Bn as st, li as t, Ft as tn, p as tr, Jn as tt, ti as u, R as un, n as ur, Ln as ut, Kr as v, ft as vn, kn as vt, Hr as w, We as wn, gn as wt, Ur as x, Xe as xn, _n as xt, Wr as y, st as yn, bn as yt, pr as z, Ce as zn, an as zt };