zudoku 0.53.2 → 0.53.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (99) hide show
  1. package/dist/app/main.js +3 -9
  2. package/dist/app/main.js.map +1 -1
  3. package/dist/lib/components/Banner.js +1 -1
  4. package/dist/lib/components/Banner.js.map +1 -1
  5. package/dist/lib/components/CategoryHeading.js +1 -1
  6. package/dist/lib/components/CategoryHeading.js.map +1 -1
  7. package/dist/lib/components/Header.js +1 -1
  8. package/dist/lib/components/Header.js.map +1 -1
  9. package/dist/lib/components/Pagination.js +1 -1
  10. package/dist/lib/components/Pagination.js.map +1 -1
  11. package/dist/lib/components/StatusPage.js +4 -0
  12. package/dist/lib/components/StatusPage.js.map +1 -1
  13. package/dist/lib/components/navigation/NavigationWrapper.js +1 -1
  14. package/dist/lib/components/navigation/NavigationWrapper.js.map +1 -1
  15. package/dist/lib/plugins/markdown/MdxPage.js +1 -1
  16. package/dist/lib/plugins/markdown/MdxPage.js.map +1 -1
  17. package/dist/lib/plugins/search-inkeep/index.d.ts +5 -22
  18. package/dist/lib/plugins/search-inkeep/index.js +35 -29
  19. package/dist/lib/plugins/search-inkeep/index.js.map +1 -1
  20. package/dist/lib/plugins/search-inkeep/inkeep.d.ts +5 -21
  21. package/dist/lib/plugins/search-inkeep/inkeep.js +10 -19
  22. package/dist/lib/plugins/search-inkeep/inkeep.js.map +1 -1
  23. package/dist/lib/plugins/search-pagefind/PagefindSearch.js +1 -1
  24. package/dist/lib/plugins/search-pagefind/PagefindSearch.js.map +1 -1
  25. package/dist/lib/plugins/search-pagefind/ResultList.d.ts +1 -1
  26. package/dist/lib/plugins/search-pagefind/ResultList.js +12 -5
  27. package/dist/lib/plugins/search-pagefind/ResultList.js.map +1 -1
  28. package/dist/lib/ui/Alert.d.ts +1 -1
  29. package/dist/vite/build.js +7 -1
  30. package/dist/vite/build.js.map +1 -1
  31. package/dist/vite/plugin-mdx.js +2 -3
  32. package/dist/vite/plugin-mdx.js.map +1 -1
  33. package/lib/{Alert-CT_ViLrJ.js → Alert-FYKbqjIt.js} +2 -2
  34. package/lib/Alert-FYKbqjIt.js.map +1 -0
  35. package/lib/{MdxPage-8UuEK446.js → MdxPage-DyRuoE_F.js} +16 -16
  36. package/lib/{MdxPage-8UuEK446.js.map → MdxPage-DyRuoE_F.js.map} +1 -1
  37. package/lib/{OasProvider-BsWpguVO.js → OasProvider-CUA-DFGE.js} +2 -2
  38. package/lib/{OasProvider-BsWpguVO.js.map → OasProvider-CUA-DFGE.js.map} +1 -1
  39. package/lib/{OperationList-PnZbf3b2.js → OperationList-CRMvWoTv.js} +7 -7
  40. package/lib/{OperationList-PnZbf3b2.js.map → OperationList-CRMvWoTv.js.map} +1 -1
  41. package/lib/{Pagination-DY7gCrm4.js → Pagination-HZKe5ncg.js} +9 -8
  42. package/lib/Pagination-HZKe5ncg.js.map +1 -0
  43. package/lib/{SchemaList-D6k4DKWH.js → SchemaList-B792ORza.js} +6 -6
  44. package/lib/{SchemaList-D6k4DKWH.js.map → SchemaList-B792ORza.js.map} +1 -1
  45. package/lib/{SchemaView-BhgJ9WB8.js → SchemaView-Bo53TeMb.js} +4 -4
  46. package/lib/{SchemaView-BhgJ9WB8.js.map → SchemaView-Bo53TeMb.js.map} +1 -1
  47. package/lib/{SignUp-CpUD6DUM.js → SignUp-DfVvOCYB.js} +2 -2
  48. package/lib/{SignUp-CpUD6DUM.js.map → SignUp-DfVvOCYB.js.map} +1 -1
  49. package/lib/{Slot-DwZlQ-vX.js → Slot-BpO_AGKJ.js} +13 -5
  50. package/lib/Slot-BpO_AGKJ.js.map +1 -0
  51. package/lib/{SyntaxHighlight-CrjhGEwT.js → SyntaxHighlight-CZgjJ7-f.js} +753 -753
  52. package/lib/SyntaxHighlight-CZgjJ7-f.js.map +1 -0
  53. package/lib/{Toc-WCmwFkX-.js → Toc-DYMzDvOa.js} +2 -2
  54. package/lib/{Toc-WCmwFkX-.js.map → Toc-DYMzDvOa.js.map} +1 -1
  55. package/lib/{circular-BUMjK3JF.js → circular-CLdQ0oUd.js} +2 -2
  56. package/lib/{circular-BUMjK3JF.js.map → circular-CLdQ0oUd.js.map} +1 -1
  57. package/lib/{createServer-BPz8ZCrd.js → createServer-Co4BBP-i.js} +4 -4
  58. package/lib/{createServer-BPz8ZCrd.js.map → createServer-Co4BBP-i.js.map} +1 -1
  59. package/lib/{errors-DY-qOx9n.js → errors-DE1gK7ms.js} +3 -3
  60. package/lib/{errors-DY-qOx9n.js.map → errors-DE1gK7ms.js.map} +1 -1
  61. package/lib/{index-C_xVKbf9.js → index-DLshv89l.js} +581 -566
  62. package/lib/{index-C_xVKbf9.js.map → index-DLshv89l.js.map} +1 -1
  63. package/lib/{index-CcV90rin.js → index-DLzZDv8_.js} +2 -2
  64. package/lib/{index-CcV90rin.js.map → index-DLzZDv8_.js.map} +1 -1
  65. package/lib/{index-dVBKCNMa.js → index-DYP-V0jG.js} +10 -10
  66. package/lib/{index-dVBKCNMa.js.map → index-DYP-V0jG.js.map} +1 -1
  67. package/lib/ui/Alert.js.map +1 -1
  68. package/lib/ui/SyntaxHighlight.js +1 -1
  69. package/lib/zudoku.auth-azureb2c.js +1553 -1556
  70. package/lib/zudoku.auth-azureb2c.js.map +1 -1
  71. package/lib/zudoku.auth-clerk.js +1 -1
  72. package/lib/zudoku.auth-openid.js +1 -1
  73. package/lib/zudoku.components.js +2 -2
  74. package/lib/zudoku.plugin-api-catalog.js +3 -3
  75. package/lib/zudoku.plugin-api-keys.js +2 -2
  76. package/lib/zudoku.plugin-markdown.js +1 -1
  77. package/lib/zudoku.plugin-openapi.js +1 -1
  78. package/lib/zudoku.plugin-search-inkeep.js +54 -57
  79. package/lib/zudoku.plugin-search-inkeep.js.map +1 -1
  80. package/lib/zudoku.plugin-search-pagefind.js +106 -102
  81. package/lib/zudoku.plugin-search-pagefind.js.map +1 -1
  82. package/package.json +8 -7
  83. package/src/app/main.tsx +6 -14
  84. package/src/lib/components/Banner.tsx +0 -1
  85. package/src/lib/components/CategoryHeading.tsx +4 -1
  86. package/src/lib/components/Header.tsx +4 -1
  87. package/src/lib/components/Pagination.tsx +1 -0
  88. package/src/lib/components/StatusPage.tsx +5 -0
  89. package/src/lib/components/navigation/NavigationWrapper.tsx +4 -1
  90. package/src/lib/plugins/markdown/MdxPage.tsx +1 -1
  91. package/src/lib/plugins/search-inkeep/index.tsx +54 -58
  92. package/src/lib/plugins/search-inkeep/inkeep.ts +19 -21
  93. package/src/lib/plugins/search-pagefind/PagefindSearch.tsx +1 -0
  94. package/src/lib/plugins/search-pagefind/ResultList.tsx +13 -4
  95. package/src/lib/ui/Alert.tsx +1 -1
  96. package/lib/Alert-CT_ViLrJ.js.map +0 -1
  97. package/lib/Pagination-DY7gCrm4.js.map +0 -1
  98. package/lib/Slot-DwZlQ-vX.js.map +0 -1
  99. package/lib/SyntaxHighlight-CrjhGEwT.js.map +0 -1
@@ -1,6 +1,6 @@
1
1
  import { j as l } from "./jsx-runtime-C5mzlN2N.js";
2
2
  import { LogOutIcon as g } from "lucide-react";
3
- import { S as f, a as w, b as p } from "./SignUp-CpUD6DUM.js";
3
+ import { S as f, a as w, b as p } from "./SignUp-DfVvOCYB.js";
4
4
  import { u as n } from "./hook-Bd0yS8M0.js";
5
5
  const y = ({
6
6
  clerkPubKey: d,
@@ -2,7 +2,7 @@ import { j as ne } from "./jsx-runtime-C5mzlN2N.js";
2
2
  import { g as Le } from "./invariant-DAFpPywt.js";
3
3
  import { C as Ue } from "./ClientOnly-E7hGysn1.js";
4
4
  import { j as xe, u as S } from "./hook-Bd0yS8M0.js";
5
- import { C as Ce, O as re, A as R, a as Ie } from "./errors-DY-qOx9n.js";
5
+ import { C as Ce, O as re, A as R, a as Ie } from "./errors-DE1gK7ms.js";
6
6
  var O = { exports: {} }, je = O.exports, oe;
7
7
  function De() {
8
8
  return oe || (oe = 1, function(t) {
@@ -2,8 +2,8 @@ import "./RouteGuard-CbKd7_9h.js";
2
2
  import "./index-ClhS5TxS.js";
3
3
  import "./chunk-DQRVZFIR-DHK7_Ilc.js";
4
4
  import "./hook-Bd0yS8M0.js";
5
- import "./Slot-DwZlQ-vX.js";
6
- import { e as C, f as d, j as h, B as k, m as l, C as S, i as B, H as c, c as y, L as E, M as g, g as H, R as L, d as M, S as R, h as T, T as Z, Z as f, b as A, l as b, k as j, n as v, u as w } from "./index-C_xVKbf9.js";
5
+ import "./Slot-BpO_AGKJ.js";
6
+ import { e as C, f as d, j as h, B as k, m as l, C as S, i as B, H as c, c as y, L as E, M as g, g as H, R as L, d as M, S as R, h as T, T as Z, Z as f, b as A, l as b, k as j, n as v, u as w } from "./index-DLshv89l.js";
7
7
  import "./ui/Button.js";
8
8
  import "./ui/Callout.js";
9
9
  import "./ClientOnly-E7hGysn1.js";
@@ -1,10 +1,10 @@
1
1
  import { j as t } from "./jsx-runtime-C5mzlN2N.js";
2
- import { s as f } from "./index-CcV90rin.js";
2
+ import { s as f } from "./index-DLzZDv8_.js";
3
3
  import { d as b, m as j } from "./chunk-DQRVZFIR-DHK7_Ilc.js";
4
4
  import { u as x, c as v, j as d } from "./hook-Bd0yS8M0.js";
5
5
  import { H as y } from "./RouteGuard-CbKd7_9h.js";
6
- import { L as N } from "./index-C_xVKbf9.js";
7
- import { H as k, M as S } from "./Slot-DwZlQ-vX.js";
6
+ import { L as N } from "./index-DLshv89l.js";
7
+ import { H as k, M as S } from "./Slot-BpO_AGKJ.js";
8
8
  const w = ({
9
9
  items: n,
10
10
  filterCatalogItems: o = (r) => r,
@@ -1,11 +1,11 @@
1
1
  import { j as e } from "./jsx-runtime-C5mzlN2N.js";
2
2
  import { CircleSlashIcon as M, CheckIcon as W, XIcon as ae, PencilLineIcon as oe, RefreshCwIcon as le, EyeOffIcon as ce, EyeIcon as de, CopyIcon as ue, TrashIcon as he, KeyRoundIcon as fe } from "lucide-react";
3
- import { D as pe, a as B, R as me } from "./Slot-DwZlQ-vX.js";
3
+ import { D as pe, a as B, R as me } from "./Slot-BpO_AGKJ.js";
4
4
  import { i as D } from "./invariant-DAFpPywt.js";
5
5
  import { O as xe, L as J } from "./chunk-DQRVZFIR-DHK7_Ilc.js";
6
6
  import { e as ye, d as ge, g as je, c as Ce } from "./hook-Bd0yS8M0.js";
7
7
  import { Button as j } from "./ui/Button.js";
8
- import { u as S, A as q, a as L } from "./Alert-CT_ViLrJ.js";
8
+ import { u as S, A as q, a as L } from "./Alert-FYKbqjIt.js";
9
9
  import * as F from "react";
10
10
  import we, { createContext as O, useRef as N, useLayoutEffect as ve, useEffect as X, useId as Q, useContext as H, useInsertionEffect as ke, useMemo as $, useCallback as be, Children as Ee, isValidElement as Ne, useState as P } from "react";
11
11
  import { C as Pe, a as De } from "./Card-DPhGbYUM.js";
@@ -4,7 +4,7 @@ const m = (t) => ({
4
4
  ([e, n]) => ({
5
5
  path: e,
6
6
  lazy: async () => {
7
- const { MdxPage: o } = await import("./MdxPage-8UuEK446.js"), { default: a, ...r } = await n();
7
+ const { MdxPage: o } = await import("./MdxPage-DyRuoE_F.js"), { default: a, ...r } = await n();
8
8
  return {
9
9
  element: /* @__PURE__ */ s.jsx(
10
10
  o,
@@ -3,7 +3,7 @@ import "lucide-react";
3
3
  import "./chunk-DQRVZFIR-DHK7_Ilc.js";
4
4
  import "./hook-Bd0yS8M0.js";
5
5
  import "./ui/Button.js";
6
- import { E as e, U as n, F as s } from "./index-dVBKCNMa.js";
6
+ import { E as e, U as n, F as s } from "./index-DYP-V0jG.js";
7
7
  export {
8
8
  e as GetNavigationOperationsQuery,
9
9
  n as UNTAGGED_PATH,
@@ -1,75 +1,72 @@
1
- import { j as a } from "./jsx-runtime-C5mzlN2N.js";
2
- import { useRef as l, useState as f, useMemo as m, useEffect as c } from "react";
3
- import { C as g } from "./ClientOnly-E7hGysn1.js";
4
- const h = {
5
- theme: {
6
- components: {
7
- AIChatPageWrapper: {
8
- defaultProps: {
9
- size: "shrink-vertically",
10
- variant: "no-shadow"
11
- }
12
- },
13
- SearchBarTrigger: {
14
- defaultProps: {
15
- size: "expand",
16
- variant: "subtle"
17
- // Choose from 'emphasized' or 'subtle'
18
- }
19
- }
20
- }
21
- }
22
- }, k = {}, I = ({
23
- prefilledQuery: t,
24
- isOpen: e,
1
+ import { j as o } from "./jsx-runtime-C5mzlN2N.js";
2
+ import { useMemo as l, useState as h, useEffect as c } from "react";
3
+ import { C as p } from "./ClientOnly-E7hGysn1.js";
4
+ const u = {
5
+ primaryBrandColor: "#26D6FF"
6
+ }, m = {
7
+ shortcutKey: "k"
8
+ }, S = {
9
+ placeholder: "Search..."
10
+ }, f = {
11
+ aiAssistantName: "Assistant"
12
+ }, k = ({
13
+ isOpen: n,
25
14
  onClose: r,
26
- settings: u
15
+ settings: a
27
16
  }) => {
28
- const i = l(null), o = l(null), [n, d] = f(
29
- typeof Inkeep < "u"
30
- ), s = m(
17
+ const s = l(
31
18
  () => ({
32
- componentType: "CustomTrigger",
33
- targetElement: i.current,
34
- properties: {
35
- isOpen: e,
36
- onClose: r,
37
- onOpen: void 0,
38
- baseSettings: { ...h, ...u },
39
- searchSettings: {
40
- prefilledQuery: t || void 0
41
- },
42
- aiChatSettings: k
43
- }
19
+ baseSettings: {
20
+ ...u,
21
+ ...a,
22
+ colorMode: {
23
+ sync: {
24
+ target: "html",
25
+ attributes: ["class"],
26
+ isDarkMode: (e) => e.class?.includes("dark") ?? !1
27
+ }
28
+ }
29
+ },
30
+ modalSettings: {
31
+ ...m,
32
+ onOpenChange: (e) => {
33
+ e || r();
34
+ }
35
+ },
36
+ searchSettings: S,
37
+ aiChatSettings: f
44
38
  }),
45
- [e, r, t, u, i]
39
+ [r, a]
40
+ ), [t, i] = h(
41
+ typeof window < "u" && window.Inkeep?.ModalSearchAndChat ? window.Inkeep.ModalSearchAndChat(s) : void 0
46
42
  );
47
43
  return c(() => {
48
- if (n) return;
49
- const p = setInterval(() => {
50
- typeof Inkeep < "u" && (d(!0), clearInterval(p));
44
+ if (t) return;
45
+ const e = setInterval(() => {
46
+ if (typeof window < "u" && window.Inkeep?.ModalSearchAndChat) {
47
+ const d = window.Inkeep.ModalSearchAndChat(s);
48
+ i(d), clearInterval(e);
49
+ }
51
50
  }, 100);
52
- return () => clearInterval(p);
53
- }, [n]), c(() => {
54
- !n || o.current || (o.current = Inkeep().embed(s));
55
- }, [s, n]), c(() => {
56
- o.current?.render({ ...s, isOpen: e });
57
- }, [s, e]), /* @__PURE__ */ a.jsx("div", { ref: i });
58
- }, x = (t) => ({
59
- getHead: () => /* @__PURE__ */ a.jsx(
51
+ return () => clearInterval(e);
52
+ }, [s, t]), c(() => {
53
+ t && t.update({ modalSettings: { isOpen: n } });
54
+ }, [n, t]), null;
55
+ }, C = (n) => ({
56
+ getHead: () => /* @__PURE__ */ o.jsx(
60
57
  "script",
61
58
  {
62
59
  type: "module",
63
- src: "https://unpkg.com/@inkeep/uikit-js@0.3.19/dist/embed.js",
60
+ src: "https://cdn.jsdelivr.net/npm/@inkeep/cxkit-js@0.5.90/+esm",
64
61
  defer: !0
65
62
  }
66
63
  ),
67
64
  renderSearch: ({
68
- isOpen: e,
69
- onClose: r
70
- }) => /* @__PURE__ */ a.jsx(g, { children: /* @__PURE__ */ a.jsx(I, { isOpen: e, onClose: r, settings: t }) })
65
+ isOpen: r,
66
+ onClose: a
67
+ }) => /* @__PURE__ */ o.jsx(p, { children: /* @__PURE__ */ o.jsx(k, { isOpen: r, onClose: a, settings: n }) })
71
68
  });
72
69
  export {
73
- x as inkeepSearchPlugin
70
+ C as inkeepSearchPlugin
74
71
  };
75
72
  //# sourceMappingURL=zudoku.plugin-search-inkeep.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"zudoku.plugin-search-inkeep.js","sources":["../src/lib/plugins/search-inkeep/inkeep.ts","../src/lib/plugins/search-inkeep/index.tsx"],"sourcesContent":["const baseSettings = {\n theme: {\n components: {\n AIChatPageWrapper: {\n defaultProps: {\n size: \"shrink-vertically\",\n variant: \"no-shadow\",\n },\n },\n SearchBarTrigger: {\n defaultProps: {\n size: \"expand\",\n variant: \"subtle\", // Choose from 'emphasized' or 'subtle'\n },\n },\n },\n },\n} as const;\n\nconst modalSettings = {};\n\nconst searchSettings = {};\n\nconst aiChatSettings = {};\n\nexport { aiChatSettings, baseSettings, modalSettings, searchSettings };\n","import { useEffect, useMemo, useRef, useState } from \"react\";\nimport { ClientOnly } from \"../../components/ClientOnly.js\";\nimport type { ZudokuPlugin } from \"../../core/plugins.js\";\nimport { aiChatSettings, baseSettings } from \"./inkeep.js\";\n\ninterface PluginInkeepBaseSettings {\n apiKey?: string;\n integrationId: string;\n organizationId: string;\n organizationDisplayName?: string;\n primaryBrandColor: string;\n}\n\ninterface InkeepEmbedConfig {\n componentType: string;\n targetElement: HTMLElement;\n properties: unknown;\n}\n\ninterface InkeepWidget {\n render: (config: InkeepEmbedConfig & { isOpen: boolean }) => void;\n}\n\ndeclare global {\n let Inkeep: () => {\n embed: (config: InkeepEmbedConfig) => InkeepWidget;\n };\n}\n\nconst InkeepSearch = ({\n prefilledQuery,\n isOpen,\n onClose,\n settings,\n}: {\n isOpen: boolean;\n onClose: () => void;\n prefilledQuery?: string | null;\n settings: PluginInkeepBaseSettings;\n}) => {\n const ref = useRef<HTMLDivElement>(null);\n const widgetRef = useRef<InkeepWidget | null>(null);\n const [isInkeepAvailable, setIsInkeepAvailable] = useState(\n typeof Inkeep !== \"undefined\",\n );\n\n const config: InkeepEmbedConfig = useMemo(\n () => ({\n componentType: \"CustomTrigger\",\n targetElement: ref.current!,\n properties: {\n isOpen,\n onClose,\n onOpen: undefined,\n baseSettings: { ...baseSettings, ...settings },\n searchSettings: {\n prefilledQuery: prefilledQuery || undefined,\n },\n aiChatSettings,\n },\n }),\n [isOpen, onClose, prefilledQuery, settings, ref],\n );\n\n useEffect(() => {\n if (isInkeepAvailable) return;\n\n const checkInkeep = setInterval(() => {\n if (typeof Inkeep !== \"undefined\") {\n setIsInkeepAvailable(true);\n clearInterval(checkInkeep);\n }\n }, 100);\n\n return () => clearInterval(checkInkeep);\n }, [isInkeepAvailable]);\n\n useEffect(() => {\n if (!isInkeepAvailable || widgetRef.current) return;\n\n widgetRef.current = Inkeep().embed(config);\n }, [config, isInkeepAvailable]);\n\n useEffect(() => {\n widgetRef.current?.render({ ...config, isOpen });\n }, [config, isOpen]);\n\n return <div ref={ref} />;\n};\n\nexport const inkeepSearchPlugin = (\n settings: PluginInkeepBaseSettings,\n): ZudokuPlugin => {\n return {\n getHead: () => {\n return (\n <script\n type=\"module\"\n src=\"https://unpkg.com/@inkeep/uikit-js@0.3.19/dist/embed.js\"\n defer\n />\n );\n },\n renderSearch: ({\n isOpen,\n onClose,\n }: {\n isOpen: boolean;\n onClose: () => void;\n }) => {\n return (\n <ClientOnly>\n <InkeepSearch isOpen={isOpen} onClose={onClose} settings={settings} />\n </ClientOnly>\n );\n },\n };\n};\n"],"names":["baseSettings","aiChatSettings","InkeepSearch","prefilledQuery","isOpen","onClose","settings","ref","useRef","widgetRef","isInkeepAvailable","setIsInkeepAvailable","useState","config","useMemo","useEffect","checkInkeep","jsx","inkeepSearchPlugin","ClientOnly"],"mappings":";;;AAAA,MAAMA,IAAe;AAAA,EACnB,OAAO;AAAA,IACL,YAAY;AAAA,MACV,mBAAmB;AAAA,QACjB,cAAc;AAAA,UACZ,MAAM;AAAA,UACN,SAAS;AAAA,QAAA;AAAA,MAEb;AAAA,MACA,kBAAkB;AAAA,QAChB,cAAc;AAAA,UACZ,MAAM;AAAA,UACN,SAAS;AAAA;AAAA,QAAA;AAAA,MACX;AAAA,IACF;AAAA,EACF;AAEJ,GAMMC,IAAiB,CAAC,GCMlBC,IAAe,CAAC;AAAA,EACpB,gBAAAC;AAAA,EACA,QAAAC;AAAA,EACA,SAAAC;AAAA,EACA,UAAAC;AACF,MAKM;AACE,QAAAC,IAAMC,EAAuB,IAAI,GACjCC,IAAYD,EAA4B,IAAI,GAC5C,CAACE,GAAmBC,CAAoB,IAAIC;AAAA,IAChD,OAAO,SAAW;AAAA,EACpB,GAEMC,IAA4BC;AAAA,IAChC,OAAO;AAAA,MACL,eAAe;AAAA,MACf,eAAeP,EAAI;AAAA,MACnB,YAAY;AAAA,QACV,QAAAH;AAAA,QACA,SAAAC;AAAA,QACA,QAAQ;AAAA,QACR,cAAc,EAAE,GAAGL,GAAc,GAAGM,EAAS;AAAA,QAC7C,gBAAgB;AAAA,UACd,gBAAgBH,KAAkB;AAAA,QACpC;AAAA,QACA,gBAAAF;AAAA,MAAA;AAAA,IACF;AAAA,IAEF,CAACG,GAAQC,GAASF,GAAgBG,GAAUC,CAAG;AAAA,EACjD;AAEA,SAAAQ,EAAU,MAAM;AACd,QAAIL,EAAmB;AAEjB,UAAAM,IAAc,YAAY,MAAM;AAChC,MAAA,OAAO,SAAW,QACpBL,EAAqB,EAAI,GACzB,cAAcK,CAAW;AAAA,OAE1B,GAAG;AAEC,WAAA,MAAM,cAAcA,CAAW;AAAA,EAAA,GACrC,CAACN,CAAiB,CAAC,GAEtBK,EAAU,MAAM;AACV,IAAA,CAACL,KAAqBD,EAAU,YAEpCA,EAAU,UAAU,SAAS,MAAMI,CAAM;AAAA,EAAA,GACxC,CAACA,GAAQH,CAAiB,CAAC,GAE9BK,EAAU,MAAM;AACd,IAAAN,EAAU,SAAS,OAAO,EAAE,GAAGI,GAAQ,QAAAT,GAAQ;AAAA,EAAA,GAC9C,CAACS,GAAQT,CAAM,CAAC,GAEZa,gBAAAA,MAAC,SAAI,KAAAV,GAAU;AACxB,GAEaW,IAAqB,CAChCZ,OAEO;AAAA,EACL,SAAS,MAELW,gBAAAA,EAAA;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,MAAK;AAAA,MACL,KAAI;AAAA,MACJ,OAAK;AAAA,IAAA;AAAA,EACP;AAAA,EAGJ,cAAc,CAAC;AAAA,IACb,QAAAb;AAAA,IACA,SAAAC;AAAA,EAAA,4BAMGc,GACC,EAAA,UAAAF,gBAAAA,EAAA,IAACf,KAAa,QAAAE,GAAgB,SAAAC,GAAkB,UAAAC,GAAoB,EACtE,CAAA;AAGN;"}
1
+ {"version":3,"file":"zudoku.plugin-search-inkeep.js","sources":["../src/lib/plugins/search-inkeep/inkeep.ts","../src/lib/plugins/search-inkeep/index.tsx"],"sourcesContent":["import type {\n InkeepAIChatSettings,\n InkeepBaseSettings,\n InkeepModalSettings,\n InkeepSearchSettings,\n} from \"@inkeep/cxkit-types\";\n\nconst baseSettings: InkeepBaseSettings = {\n primaryBrandColor: \"#26D6FF\",\n};\n\nconst modalSettings: InkeepModalSettings = {\n shortcutKey: \"k\",\n};\n\nconst searchSettings: InkeepSearchSettings = {\n placeholder: \"Search...\",\n};\n\nconst aiChatSettings: InkeepAIChatSettings = {\n aiAssistantName: \"Assistant\",\n};\n\nexport { aiChatSettings, baseSettings, modalSettings, searchSettings };\n","import type {\n InkeepBaseSettings,\n InkeepComponentInstance,\n InkeepJS,\n InkeepSettings,\n} from \"@inkeep/cxkit-types\";\nimport { useEffect, useMemo, useState } from \"react\";\nimport { ClientOnly } from \"../../components/ClientOnly.js\";\nimport type { ZudokuPlugin } from \"../../core/plugins.js\";\nimport {\n aiChatSettings,\n baseSettings,\n modalSettings,\n searchSettings,\n} from \"./inkeep.js\";\n\ndeclare global {\n interface Window {\n Inkeep: InkeepJS | undefined;\n }\n}\n\nconst InkeepSearch = ({\n isOpen,\n onClose,\n settings,\n}: {\n isOpen: boolean;\n onClose: () => void;\n settings: InkeepBaseSettings;\n}) => {\n const config = useMemo<InkeepSettings>(\n () => ({\n baseSettings: {\n ...baseSettings,\n ...settings,\n colorMode: {\n sync: {\n target: \"html\",\n attributes: [\"class\"],\n isDarkMode: (attrs) => attrs[\"class\"]?.includes(\"dark\") ?? false,\n },\n },\n },\n modalSettings: {\n ...modalSettings,\n onOpenChange: (newOpen: boolean) => {\n if (!newOpen) onClose();\n },\n },\n searchSettings,\n aiChatSettings,\n }),\n [onClose, settings],\n );\n const [searchInstance, setSearchInstance] = useState<\n InkeepComponentInstance | undefined\n >(\n typeof window !== \"undefined\" && window.Inkeep?.ModalSearchAndChat\n ? window.Inkeep.ModalSearchAndChat(config)!\n : undefined,\n );\n\n useEffect(() => {\n if (searchInstance) return;\n\n const checkInkeep = setInterval(() => {\n if (typeof window !== \"undefined\" && window.Inkeep?.ModalSearchAndChat) {\n const inkeep = window.Inkeep.ModalSearchAndChat(config)!;\n setSearchInstance(inkeep);\n clearInterval(checkInkeep);\n }\n }, 100);\n\n return () => clearInterval(checkInkeep);\n }, [config, searchInstance]);\n\n useEffect(() => {\n if (!searchInstance) return;\n\n searchInstance.update({ modalSettings: { isOpen } });\n }, [isOpen, searchInstance]);\n\n return null;\n};\n\nexport const inkeepSearchPlugin = (\n settings: InkeepBaseSettings,\n): ZudokuPlugin => {\n return {\n getHead: () => {\n return (\n <script\n type=\"module\"\n src=\"https://cdn.jsdelivr.net/npm/@inkeep/cxkit-js@0.5.90/+esm\"\n defer\n />\n );\n },\n renderSearch: ({\n isOpen,\n onClose,\n }: {\n isOpen: boolean;\n onClose: () => void;\n }) => {\n return (\n <ClientOnly>\n <InkeepSearch isOpen={isOpen} onClose={onClose} settings={settings} />\n </ClientOnly>\n );\n },\n };\n};\n"],"names":["baseSettings","modalSettings","searchSettings","aiChatSettings","InkeepSearch","isOpen","onClose","settings","config","useMemo","attrs","newOpen","searchInstance","setSearchInstance","useState","useEffect","checkInkeep","inkeep","inkeepSearchPlugin","jsx","ClientOnly"],"mappings":";;;AAOA,MAAMA,IAAmC;AAAA,EACvC,mBAAmB;AACrB,GAEMC,IAAqC;AAAA,EACzC,aAAa;AACf,GAEMC,IAAuC;AAAA,EAC3C,aAAa;AACf,GAEMC,IAAuC;AAAA,EAC3C,iBAAiB;AACnB,GCCMC,IAAe,CAAC;AAAA,EACpB,QAAAC;AAAA,EACA,SAAAC;AAAA,EACA,UAAAC;AACF,MAIM;AACJ,QAAMC,IAASC;AAAA,IACb,OAAO;AAAA,MACL,cAAc;AAAA,QACZ,GAAGT;AAAA,QACH,GAAGO;AAAA,QACH,WAAW;AAAA,UACT,MAAM;AAAA,YACJ,QAAQ;AAAA,YACR,YAAY,CAAC,OAAO;AAAA,YACpB,YAAY,CAACG,MAAUA,EAAM,OAAU,SAAS,MAAM,KAAK;AAAA,UAAA;AAAA,QAC7D;AAAA,MAEJ;AAAA,MACA,eAAe;AAAA,QACb,GAAGT;AAAA,QACH,cAAc,CAACU,MAAqB;AAC9B,UAACA,KAAiBL,EAAA;AAAA,QAAA;AAAA,MAE1B;AAAA,MACA,gBAAAJ;AAAA,MACA,gBAAAC;AAAA,IAAA;AAAA,IAEF,CAACG,GAASC,CAAQ;AAAA,EACpB,GACM,CAACK,GAAgBC,CAAiB,IAAIC;AAAA,IAG1C,OAAO,SAAW,OAAe,OAAO,QAAQ,qBAC5C,OAAO,OAAO,mBAAmBN,CAAM,IACvC;AAAA,EACN;AAEA,SAAAO,EAAU,MAAM;AACd,QAAIH,EAAgB;AAEd,UAAAI,IAAc,YAAY,MAAM;AACpC,UAAI,OAAO,SAAW,OAAe,OAAO,QAAQ,oBAAoB;AACtE,cAAMC,IAAS,OAAO,OAAO,mBAAmBT,CAAM;AACtD,QAAAK,EAAkBI,CAAM,GACxB,cAAcD,CAAW;AAAA,MAAA;AAAA,OAE1B,GAAG;AAEC,WAAA,MAAM,cAAcA,CAAW;AAAA,EAAA,GACrC,CAACR,GAAQI,CAAc,CAAC,GAE3BG,EAAU,MAAM;AACd,IAAKH,KAELA,EAAe,OAAO,EAAE,eAAe,EAAE,QAAAP,KAAU;AAAA,EAAA,GAClD,CAACA,GAAQO,CAAc,CAAC,GAEpB;AACT,GAEaM,IAAqB,CAChCX,OAEO;AAAA,EACL,SAAS,MAELY,gBAAAA,EAAA;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,MAAK;AAAA,MACL,KAAI;AAAA,MACJ,OAAK;AAAA,IAAA;AAAA,EACP;AAAA,EAGJ,cAAc,CAAC;AAAA,IACb,QAAAd;AAAA,IACA,SAAAC;AAAA,EAAA,4BAMGc,GACC,EAAA,UAAAD,gBAAAA,EAAA,IAACf,KAAa,QAAAC,GAAgB,SAAAC,GAAkB,UAAAC,GAAoB,EACtE,CAAA;AAGN;"}
@@ -1,12 +1,12 @@
1
1
  import { j as e } from "./jsx-runtime-C5mzlN2N.js";
2
- import { C as w } from "./ClientOnly-E7hGysn1.js";
3
- import { VisuallyHidden as v } from "@radix-ui/react-visually-hidden";
4
- import { u as I, d as k, l as j, m as N, j as L } from "./hook-Bd0yS8M0.js";
5
- import { useRef as C, useLayoutEffect as T, useState as E } from "react";
2
+ import { C as v } from "./ClientOnly-E7hGysn1.js";
3
+ import { VisuallyHidden as I } from "@radix-ui/react-visually-hidden";
4
+ import { j as k, u as N, d as j, l as C, m as L } from "./hook-Bd0yS8M0.js";
5
+ import { useRef as S, useLayoutEffect as T, useState as E } from "react";
6
6
  import { B as R } from "./Button-BE9IVkWV.js";
7
7
  import { ShieldAlertIcon as F, AlertTriangleIcon as q, InfoIcon as b, LightbulbIcon as z, BracketsIcon as A, FileTextIcon as P } from "lucide-react";
8
8
  import { c as u } from "./cn-wvCW-ho6.js";
9
- import { C as $, a as f, b as h, c as D, d as O, e as B } from "./Command-xsbs2uhf.js";
9
+ import { C as $, a as f, b as h, c as D, d as B, e as O } from "./Command-xsbs2uhf.js";
10
10
  import { b as U } from "./Dialog-CiIdyz6a.js";
11
11
  import { S as G } from "./RouteGuard-CbKd7_9h.js";
12
12
  import { a as H, L as p } from "./chunk-DQRVZFIR-DHK7_Ilc.js";
@@ -52,45 +52,45 @@ const K = {
52
52
  Icon: F
53
53
  }
54
54
  }, M = ({
55
- type: t,
55
+ type: o,
56
56
  children: n,
57
- title: o,
58
- className: l,
57
+ title: t,
58
+ className: s,
59
59
  icon: a = !0
60
60
  }) => {
61
- const { border: s, bg: r, iconColor: i, titleColor: c, textColor: d, Icon: m } = K[t];
61
+ const { border: l, bg: i, iconColor: d, titleColor: r, textColor: c, Icon: m } = K[o];
62
62
  return /* @__PURE__ */ e.jsxs(
63
63
  "div",
64
64
  {
65
65
  className: u(
66
66
  "not-prose rounded-md border p-4 text-md my-2",
67
67
  a && "grid grid-cols-[min-content_1fr] items-baseline grid-rows-[fit-content_1fr] gap-x-4 gap-y-2",
68
- !a && o && "flex flex-col gap-2",
68
+ !a && t && "flex flex-col gap-2",
69
69
  "[&_a]:underline [&_a]:decoration-current [&_a]:decoration-from-font [&_a]:underline-offset-4 hover:[&_a]:decoration-1",
70
70
  "[&_.code-block-wrapper]:border",
71
71
  "[&_ul]:list-disc [&_ol]:list-decimal [&_ul]:ps-4 [&_ul>li]:ps-1 [&_ul>li]:my-1",
72
- a && o && "items-center",
73
- s,
74
- r,
75
- l
72
+ a && t && "items-center",
73
+ l,
74
+ i,
75
+ s
76
76
  ),
77
77
  children: [
78
78
  a && /* @__PURE__ */ e.jsx(
79
79
  m,
80
80
  {
81
- className: u(o ? "align-middle" : "translate-y-1", i),
81
+ className: u(t ? "align-middle" : "translate-y-1", d),
82
82
  size: 20,
83
83
  "aria-hidden": "true"
84
84
  }
85
85
  ),
86
- o && /* @__PURE__ */ e.jsx("h3", { className: u("font-medium", c), children: o }),
86
+ t && /* @__PURE__ */ e.jsx("h3", { className: u("font-medium", r), children: t }),
87
87
  /* @__PURE__ */ e.jsx(
88
88
  "div",
89
89
  {
90
90
  className: u(
91
91
  a && "col-start-2",
92
- !o && a && "row-start-1",
93
- d,
92
+ !t && a && "row-start-1",
93
+ c,
94
94
  "overflow-x-auto"
95
95
  ),
96
96
  children: n
@@ -100,70 +100,73 @@ const K = {
100
100
  }
101
101
  );
102
102
  }, V = async ({
103
- search: t,
103
+ search: o,
104
104
  options: n,
105
- auth: o,
106
- context: l
105
+ auth: t,
106
+ context: s
107
107
  }) => {
108
- const a = n.maxResults ?? 10, s = n.transformResults ?? (() => !0), r = [], i = Y({
109
- search: t,
110
- transformFn: s,
111
- auth: o,
112
- context: l
108
+ const a = n.maxResults ?? 10, l = n.transformResults ?? (() => !0), i = [], d = Y({
109
+ search: o,
110
+ transformFn: l,
111
+ auth: t,
112
+ context: s
113
113
  });
114
- for await (const c of i)
115
- if (r.push(c), r.length >= a) break;
116
- return r;
114
+ for await (const r of d)
115
+ if (i.push(r), i.length >= a) break;
116
+ return i;
117
117
  };
118
118
  async function* Y({
119
- search: t,
119
+ search: o,
120
120
  transformFn: n,
121
- auth: o,
122
- context: l
121
+ auth: t,
122
+ context: s
123
123
  }) {
124
- let s = 0;
125
- for (; s < t.results.length; ) {
126
- const r = t.results.slice(
127
- s,
128
- s + 5
124
+ let l = 0;
125
+ for (; l < o.results.length; ) {
126
+ const i = o.results.slice(
127
+ l,
128
+ l + 5
129
129
  );
130
- s += r.length;
131
- const i = await Promise.all(r.map((c) => c.data()));
132
- for (const c of i) {
133
- const d = n({ result: c, auth: o, context: l });
134
- d !== !1 && (d === !0 || d == null ? yield c : yield d);
130
+ l += i.length;
131
+ const d = await Promise.all(i.map((r) => r.data()));
132
+ for (const r of d) {
133
+ const c = n({ result: r, auth: t, context: s });
134
+ c !== !1 && (c === !0 || c == null ? yield r : yield c);
135
135
  }
136
136
  }
137
137
  }
138
- const Q = (t, n) => {
139
- const o = t.weighted_locations.reduce(
140
- (a, s) => a + s.balanced_score,
138
+ const Q = (o, n) => {
139
+ const t = o.weighted_locations.reduce(
140
+ (a, l) => a + l.balanced_score,
141
141
  0
142
142
  );
143
143
  return n.weighted_locations.reduce(
144
- (a, s) => a + s.balanced_score,
144
+ (a, l) => a + l.balanced_score,
145
145
  0
146
- ) - o;
147
- }, y = "cursor-pointer border border-transparent data-[selected=true]:border-border", Z = ({
148
- searchResults: t,
149
- searchTerm: n,
150
- onClose: o,
151
- maxSubResults: l = 4
146
+ ) - t;
147
+ }, y = "cursor-pointer border border-transparent data-[selected=true]:border-border", W = ({
148
+ basePath: o,
149
+ searchResults: n,
150
+ searchTerm: t,
151
+ onClose: s,
152
+ maxSubResults: a = 4
152
153
  }) => {
153
- const a = H(), s = C(null);
154
- return T(() => {
154
+ const l = H(), i = S(null);
155
+ T(() => {
155
156
  requestIdleCallback(() => {
156
- s.current?.scrollTo({ top: 0 });
157
+ i.current?.scrollTo({ top: 0 });
157
158
  });
158
- }, [n]), /* @__PURE__ */ e.jsxs($, { className: "max-h-[450px]", ref: s, children: [
159
- n && t.length > 0 && /* @__PURE__ */ e.jsx(
159
+ }, [t]);
160
+ const d = (r) => o && r.startsWith(o) ? k(r.slice(o.length)) : r;
161
+ return /* @__PURE__ */ e.jsxs($, { className: "max-h-[450px]", ref: i, children: [
162
+ t && n.length > 0 && /* @__PURE__ */ e.jsx(
160
163
  f,
161
164
  {
162
165
  className: "text-sm text-muted-foreground",
163
- heading: `${t.length} results for "${n}"`
166
+ heading: `${n.length} results for "${t}"`
164
167
  }
165
168
  ),
166
- n && t.map((r) => /* @__PURE__ */ e.jsxs(
169
+ t && n.map((r) => /* @__PURE__ */ e.jsxs(
167
170
  f,
168
171
  {
169
172
  children: [
@@ -174,35 +177,35 @@ const Q = (t, n) => {
174
177
  value: `${r.meta.title}-${r.url}`,
175
178
  className: y,
176
179
  onSelect: () => {
177
- a(r.url), o();
180
+ l(d(r.url)), s();
178
181
  },
179
- children: /* @__PURE__ */ e.jsxs(p, { to: r.url, children: [
182
+ children: /* @__PURE__ */ e.jsxs(p, { to: d(r.url), children: [
180
183
  r.meta.section === "openapi" ? /* @__PURE__ */ e.jsx(A, {}) : /* @__PURE__ */ e.jsx(P, {}),
181
184
  r.meta.title
182
185
  ] })
183
186
  }
184
187
  ),
185
- r.sub_results.sort(Q).slice(0, l).map((i) => /* @__PURE__ */ e.jsx(
188
+ r.sub_results.sort(Q).slice(0, a).map((c) => /* @__PURE__ */ e.jsx(
186
189
  h,
187
190
  {
188
191
  asChild: !0,
189
- value: `sub-${r.meta.title}-${i.url}`,
192
+ value: `sub-${r.meta.title}-${c.url}`,
190
193
  className: y,
191
194
  onSelect: () => {
192
- a(i.url), o();
195
+ l(d(c.url)), s();
193
196
  },
194
- children: /* @__PURE__ */ e.jsx(p, { to: i.url, onClick: o, children: /* @__PURE__ */ e.jsxs("div", { className: "flex flex-col items-start gap-2 ms-2.5 ps-5 border-l border-muted-foreground/50", children: [
195
- /* @__PURE__ */ e.jsx("span", { className: "font-bold", children: i.title }),
197
+ children: /* @__PURE__ */ e.jsx(p, { to: d(c.url), onClick: s, children: /* @__PURE__ */ e.jsxs("div", { className: "flex flex-col items-start gap-2 ms-2.5 ps-5 border-l border-muted-foreground/50", children: [
198
+ /* @__PURE__ */ e.jsx("span", { className: "font-bold", children: c.title }),
196
199
  /* @__PURE__ */ e.jsx(
197
200
  "span",
198
201
  {
199
202
  className: "text-[13px] [&_mark]:bg-primary [&_mark]:text-primary-foreground",
200
- dangerouslySetInnerHTML: { __html: i.excerpt }
203
+ dangerouslySetInnerHTML: { __html: c.excerpt }
201
204
  }
202
205
  )
203
206
  ] }) })
204
207
  },
205
- `sub-${r.meta.title}-${i.url}`
208
+ `sub-${r.meta.title}-${c.url}`
206
209
  ))
207
210
  ]
208
211
  },
@@ -218,76 +221,76 @@ const Q = (t, n) => {
218
221
  termSimilarity: 1.2,
219
222
  // Slightly lower than default because API docs might have legitimate repetition of terms
220
223
  termSaturation: 1.2
221
- }, J = (t) => import(
224
+ }, Z = (o) => import(
222
225
  /* @vite-ignore */
223
- L(t, "/pagefind/pagefind.js")
224
- ), W = (t) => {
226
+ k(o, "/pagefind/pagefind.js")
227
+ ), J = (o) => {
225
228
  const {
226
229
  options: { basePath: n }
227
- } = k(), { data: o, ...l } = j({
228
- queryKey: ["pagefind", t.ranking],
230
+ } = j(), { data: t, ...s } = C({
231
+ queryKey: ["pagefind", o.ranking],
229
232
  retry: !1,
230
233
  queryFn: async () => {
231
- const a = await J(n);
234
+ const a = await Z(n);
232
235
  return await a.init(), await a.options({
233
236
  ranking: {
234
- termFrequency: t.ranking?.termFrequency ?? x.termFrequency,
235
- pageLength: t.ranking?.pageLength ?? x.pageLength,
236
- termSimilarity: t.ranking?.termSimilarity ?? x.termSimilarity,
237
- termSaturation: t.ranking?.termSaturation ?? x.termSaturation
237
+ termFrequency: o.ranking?.termFrequency ?? x.termFrequency,
238
+ pageLength: o.ranking?.pageLength ?? x.pageLength,
239
+ termSimilarity: o.ranking?.termSimilarity ?? x.termSimilarity,
240
+ termSaturation: o.ranking?.termSaturation ?? x.termSaturation
238
241
  }
239
242
  }), a;
240
243
  },
241
244
  enabled: typeof window < "u"
242
245
  });
243
- return l.isError && l.error.message !== "NOT_BUILT_YET" && console.error(l.error), { ...l, pagefind: o };
246
+ return s.isError && s.error.message !== "NOT_BUILT_YET" && console.error(s.error), { ...s, pagefind: t };
244
247
  }, X = ({
245
- isOpen: t,
248
+ isOpen: o,
246
249
  onClose: n,
247
- options: o
250
+ options: t
248
251
  }) => {
249
- const { pagefind: l, error: a, isError: s } = W(o), [r, i] = E(""), c = I(), d = k(), m = C(null), { data: S } = j({
250
- queryKey: ["pagefind-search", r, c.isAuthenticated],
252
+ const { pagefind: s, error: a, isError: l } = J(t), [i, d] = E(""), r = N(), c = j(), m = S(null), { data: _ } = C({
253
+ queryKey: ["pagefind-search", i, r.isAuthenticated],
251
254
  queryFn: async () => {
252
- const _ = c.isAuthenticated ? void 0 : { not: { section: G } }, g = await l?.search(r, { filters: _ });
253
- return g ? V({ search: g, options: o, auth: c, context: d }) : [];
255
+ const w = r.isAuthenticated ? void 0 : { not: { section: G } }, g = await s?.search(i, { filters: w });
256
+ return g ? V({ search: g, options: t, auth: r, context: c }) : [];
254
257
  },
255
- placeholderData: N,
256
- enabled: !!l && !!r
258
+ placeholderData: L,
259
+ enabled: !!s && !!i
257
260
  });
258
261
  return /* @__PURE__ */ e.jsxs(
259
262
  D,
260
263
  {
261
264
  command: { shouldFilter: !1 },
262
265
  content: { className: "max-w-[750px]" },
263
- open: t,
266
+ open: o,
264
267
  onOpenChange: n,
265
268
  children: [
266
- /* @__PURE__ */ e.jsx(v, { children: /* @__PURE__ */ e.jsx(U, { children: "Search" }) }),
269
+ /* @__PURE__ */ e.jsx(I, { children: /* @__PURE__ */ e.jsx(U, { children: "Search" }) }),
267
270
  /* @__PURE__ */ e.jsx(
268
- O,
271
+ B,
269
272
  {
270
273
  ref: m,
271
274
  placeholder: "Search...",
272
- value: r,
273
- onValueChange: i,
274
- disabled: s
275
+ value: i,
276
+ onValueChange: d,
277
+ disabled: l
275
278
  }
276
279
  ),
277
- /* @__PURE__ */ e.jsx(B, { children: r ? /* @__PURE__ */ e.jsxs("div", { className: "flex flex-col items-center", children: [
280
+ /* @__PURE__ */ e.jsx(O, { children: i ? /* @__PURE__ */ e.jsxs("div", { className: "flex flex-col items-center", children: [
278
281
  "No results found.",
279
282
  /* @__PURE__ */ e.jsx(
280
283
  R,
281
284
  {
282
285
  variant: "link",
283
286
  onClick: () => {
284
- i(""), m.current?.focus();
287
+ d(""), m.current?.focus();
285
288
  },
286
289
  children: "Clear search"
287
290
  }
288
291
  )
289
292
  ] }) : "Start typing to search" }),
290
- s ? /* @__PURE__ */ e.jsx("div", { className: "p-4 text-sm", children: a.message === "NOT_BUILT_YET" ? /* @__PURE__ */ e.jsxs(M, { type: "info", children: [
293
+ l ? /* @__PURE__ */ e.jsx("div", { className: "p-4 text-sm", children: a.message === "NOT_BUILT_YET" ? /* @__PURE__ */ e.jsxs(M, { type: "info", children: [
291
294
  "Search is currently not available in development mode by default.",
292
295
  /* @__PURE__ */ e.jsx("br", {}),
293
296
  "To still use search in development, run ",
@@ -300,19 +303,20 @@ const Q = (t, n) => {
300
303
  /* @__PURE__ */ e.jsx("code", { children: "public" }),
301
304
  " directory."
302
305
  ] }) : "An error occurred while loading search." }) : /* @__PURE__ */ e.jsx(
303
- Z,
306
+ W,
304
307
  {
305
- searchResults: S ?? [],
306
- searchTerm: r,
308
+ basePath: c.options.basePath,
309
+ searchResults: _ ?? [],
310
+ searchTerm: i,
307
311
  onClose: n,
308
- maxSubResults: o.maxSubResults
312
+ maxSubResults: t.maxSubResults
309
313
  }
310
314
  )
311
315
  ]
312
316
  }
313
317
  );
314
- }, ue = (t) => ({
315
- renderSearch: ({ isOpen: n, onClose: o }) => /* @__PURE__ */ e.jsx(w, { children: /* @__PURE__ */ e.jsx(X, { isOpen: n, onClose: o, options: t }) })
318
+ }, ue = (o) => ({
319
+ renderSearch: ({ isOpen: n, onClose: t }) => /* @__PURE__ */ e.jsx(v, { children: /* @__PURE__ */ e.jsx(X, { isOpen: n, onClose: t, options: o }) })
316
320
  });
317
321
  export {
318
322
  ue as pagefindSearchPlugin