@inkeep/cxkit-primitives 0.5.32 → 0.5.34

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.
@@ -1,55 +1,56 @@
1
1
  "use client";
2
- import { jsx as n } from "react/jsx-runtime";
3
- import { Command as S } from "../atoms/cmdk/index.js";
2
+ import { jsx as a } from "react/jsx-runtime";
3
+ import { Command as p } from "../atoms/cmdk/index.js";
4
4
  import { ikp as r } from "./factory.js";
5
- import { dataAttr as I, maybeRender as g } from "../utils/misc.js";
6
- import { forwardRef as T, useEffect as f, useState as D, useRef as O, useMemo as H } from "react";
5
+ import { dataAttr as m, maybeRender as g } from "../utils/misc.js";
6
+ import { forwardRef as w, useEffect as L, useState as G, useRef as C, useCallback as M, useMemo as E } from "react";
7
7
  import { useSearch as l } from "./embedded-search/search-provider.js";
8
- import { SearchProvider as Xt } from "./embedded-search/search-provider.js";
9
- import V from "./tagline-logo-icon.js";
10
- import { CustomIcon as b } from "../atoms/icons/custom-icon.js";
11
- import * as w from "@radix-ui/react-scroll-area";
12
- import * as E from "@radix-ui/react-tabs";
13
- import { useInkeepConfig as R } from "../providers/config-provider.js";
14
- import { useSearchEvents as K } from "../providers/search-events-provider.js";
15
- import { LinkWithQueryParams as C } from "../atoms/link.js";
16
- import { SourceItemProvider as F, useSourceItem as m } from "../providers/source-item-provider.js";
17
- import { BuiltInIconRenderer as x } from "../atoms/icons/built-in-icon-renderer.js";
18
- import { highlightEmphasis as $ } from "../utils/highlight-emphasis.js";
19
- import { useScrollingFades as G } from "../hooks/use-scrolling-fades.js";
20
- import { useColorModeValue as W } from "@inkeep/cxkit-color-mode";
21
- import q from "../atoms/avatars/ai.js";
22
- import { useModal as M } from "./modal/modal-provider.js";
23
- import { useComposedRefs as L } from "../utils/compose-refs.js";
24
- import { composeEventHandlers as p } from "../utils/compose-event-handlers.js";
25
- import { useShadow as j } from "../atoms/shadow/context.js";
26
- import { Markdown as Q } from "../atoms/markdown/index.js";
27
- const P = "__ask_ai__", z = r("div", {
8
+ import { SearchProvider as ti } from "./embedded-search/search-provider.js";
9
+ import W from "./tagline-logo-icon.js";
10
+ import { CustomIcon as S } from "../atoms/icons/custom-icon.js";
11
+ import * as T from "@radix-ui/react-scroll-area";
12
+ import * as A from "@radix-ui/react-tabs";
13
+ import { useInkeepConfig as b } from "../providers/config-provider.js";
14
+ import { useSearchEvents as q } from "../providers/search-events-provider.js";
15
+ import { LinkWithQueryParams as x } from "../atoms/link.js";
16
+ import { SourceItemProvider as U, useSourceItem as h } from "../providers/source-item-provider.js";
17
+ import { BuiltInIconRenderer as B } from "../atoms/icons/built-in-icon-renderer.js";
18
+ import { highlightEmphasis as j } from "../utils/highlight-emphasis.js";
19
+ import { useScrollingFades as Q } from "../hooks/use-scrolling-fades.js";
20
+ import { useColorModeValue as z } from "@inkeep/cxkit-color-mode";
21
+ import J from "../atoms/avatars/ai.js";
22
+ import { useModal as D } from "./modal/modal-provider.js";
23
+ import { useComposedRefs as k } from "../utils/compose-refs.js";
24
+ import { composeEventHandlers as R } from "../utils/compose-event-handlers.js";
25
+ import { useShadow as X } from "../atoms/shadow/context.js";
26
+ import { Markdown as Y } from "../atoms/markdown/index.js";
27
+ const P = "__ask_ai__", Z = r("div", {
28
28
  _id: "aiSearchWrapper"
29
- }), Ze = (e) => {
29
+ }), rt = (e) => {
30
30
  const {
31
31
  searchSettings: { view: t }
32
- } = R(), { isHidden: i, hasContent: s, isMobile: a } = l(), o = M();
33
- return /* @__PURE__ */ n(
34
- z,
32
+ } = b(), { isHidden: i, hasContent: s, isMobile: n } = l(), o = D();
33
+ return /* @__PURE__ */ a(
34
+ Z,
35
35
  {
36
- "data-hidden": I(i),
37
- "data-has-content": I(s),
38
- "data-in-modal": I(!!o),
39
- "data-mobile": I(a),
36
+ "data-hidden": m(i),
37
+ "data-has-content": m(s),
38
+ "data-in-modal": m(!!o),
39
+ "data-mobile": m(n),
40
40
  "data-view": t,
41
- "data-dual-pane-search-expanded": I(s && t === "dual-pane" && !i),
41
+ "data-dual-pane-search-expanded": m(s && t === "dual-pane" && !i),
42
42
  ...e
43
43
  }
44
44
  );
45
- }, J = r(S, {
45
+ }, ee = r(p, {
46
46
  _id: "aiSearchRoot"
47
- }), et = (e) => {
48
- const { isHidden: t, selectedItem: i, onSelectedItemChange: s } = l();
49
- return /* @__PURE__ */ n(
50
- J,
47
+ }), st = (e) => {
48
+ const { isHidden: t, selectedItem: i, onSelectedItemChange: s, isMobile: n } = l();
49
+ return /* @__PURE__ */ a(
50
+ ee,
51
51
  {
52
- "data-hidden": I(t),
52
+ "data-hidden": m(t),
53
+ "data-mobile": m(n),
53
54
  shouldFilter: !1,
54
55
  loop: !1,
55
56
  value: i,
@@ -57,325 +58,335 @@ const P = "__ask_ai__", z = r("div", {
57
58
  ...e
58
59
  }
59
60
  );
60
- }, X = r(S.List, {
61
+ }, te = r(p.List, {
61
62
  _id: "aiSearchContent"
62
- }), tt = T((e, t) => {
63
+ }), nt = w((e, t) => {
63
64
  const { selectedItem: i } = l();
64
- return /* @__PURE__ */ n(
65
- X,
65
+ return /* @__PURE__ */ a(
66
+ te,
66
67
  {
67
68
  "aria-activedescendant": `aiSearchResults__Item-${i}`,
68
69
  ...e,
69
70
  ref: t
70
71
  }
71
72
  );
72
- }), it = r("div", {
73
+ }), at = r("div", {
73
74
  _id: "aiSearchInputGroup"
74
- }), rt = r(b, {
75
+ }), ot = r(S, {
75
76
  _id: "aiSearchInputIcon",
76
77
  iconKey: "search"
77
- }), Y = r(S.Input, {
78
+ }), ie = r(p.Input, {
78
79
  _id: "aiSearchInput"
79
- }), st = T(({ onInput: e, ...t }, i) => {
80
- const { query: s, onInput: a, placeholder: o, inputRef: c, shouldAutoFocusInput: d, selectedItem: u } = l(), _ = L(i, c), h = M();
81
- return f(() => {
80
+ }), ct = w(({ onInput: e, ...t }, i) => {
81
+ const { query: s, onInput: n, placeholder: o, inputRef: c, shouldAutoFocusInput: d, selectedItem: u } = l(), I = k(i, c), _ = D();
82
+ return L(() => {
82
83
  requestAnimationFrame(() => {
83
84
  d && c?.current && (c.current.focus(), c.current.selectionStart = c.current.value.length);
84
85
  });
85
- }, [d, c, h?.isOpen]), /* @__PURE__ */ n(
86
- Y,
86
+ }, [d, c, _?.isOpen]), /* @__PURE__ */ a(
87
+ ie,
87
88
  {
88
- ref: _,
89
+ ref: I,
89
90
  placeholder: o,
90
91
  value: s,
91
- onInput: p(e, a),
92
+ onInput: R(e, n),
92
93
  "aria-activedescendant": `aiSearchResults__Item-${u}`,
93
94
  ...t
94
95
  }
95
96
  );
96
- }), Z = r(x, {
97
+ }), re = r(B, {
97
98
  _id: "aiSearchLoading",
98
99
  iconSettings: {
99
100
  builtIn: "LuLoaderCircle"
100
101
  }
101
- }), nt = (e) => {
102
+ }), lt = (e) => {
102
103
  const { loading: t, resultsList: i } = l();
103
- return !t || i.length === 0 ? null : /* @__PURE__ */ n(Z, { ...e });
104
- }, ee = r(S.Item, {
104
+ return !t || i.length === 0 ? null : /* @__PURE__ */ a(re, { ...e });
105
+ }, se = r(p.Item, {
105
106
  _id: "aiAskAITrigger",
106
107
  value: P
107
- }), at = (e) => {
108
- const { setSelectedItem: t, results: i, tab: s } = l(), a = i[s]?.[0]?.id ?? "NONE";
109
- return /* @__PURE__ */ n(
110
- ee,
108
+ }), dt = (e) => {
109
+ const { setSelectedItem: t, results: i, tab: s } = l(), n = i[s]?.[0]?.id ?? "NONE";
110
+ return /* @__PURE__ */ a(
111
+ se,
111
112
  {
112
113
  ...e,
113
114
  id: `aiSearchResults__Item-${P}`,
114
115
  tabIndex: 0,
115
- onPointerLeave: () => t(a)
116
+ onPointerLeave: () => t(n)
116
117
  }
117
118
  );
118
- }, te = r("img", {
119
+ }, ne = r("img", {
119
120
  _id: "aiAskAITrigger__Icon"
120
- }), ot = (e) => {
121
- const { aiChatSettings: t } = R(), { aiAssistantAvatar: i } = t ?? {}, s = typeof i == "string" ? i : i?.light, a = (typeof i == "string" ? i : i?.dark) ?? s, o = W(s, a), [c, d] = D(o);
122
- return f(() => {
121
+ }), ut = (e) => {
122
+ const { aiChatSettings: t } = b(), { aiAssistantAvatar: i } = t ?? {}, s = typeof i == "string" ? i : i?.light, n = (typeof i == "string" ? i : i?.dark) ?? s, o = z(s, n), [c, d] = G(o);
123
+ return L(() => {
123
124
  d(o);
124
- }, [o]), /* @__PURE__ */ n(te, { asChild: !0, ...e, children: c ? (
125
+ }, [o]), /* @__PURE__ */ a(ne, { asChild: !0, ...e, children: c ? (
125
126
  // biome-ignore lint/a11y/useAltText: <explanation>
126
- /* @__PURE__ */ n(
127
+ /* @__PURE__ */ a(
127
128
  "img",
128
129
  {
129
130
  src: c,
130
131
  alt: "AI Avatar",
131
132
  "data-type": "image",
132
- onError: p(() => {
133
+ onError: R(() => {
133
134
  d(null);
134
135
  }),
135
136
  ...e
136
137
  }
137
138
  )
138
- ) : /* @__PURE__ */ n(q, { "data-type": "icon", ...e }) });
139
- }, ct = r("span", {
139
+ ) : /* @__PURE__ */ a(J, { "data-type": "icon", ...e }) });
140
+ }, mt = r("span", {
140
141
  _id: "aiAskAITrigger__Label"
141
- }), lt = r(b, {
142
+ }), ht = r(S, {
142
143
  _id: "aiAskAITrigger__Indicator",
143
144
  iconKey: "openLinkInSameTab"
144
- }), ie = r(E.Root, {
145
+ }), ae = r(A.Root, {
145
146
  _id: "aiSearchResults"
146
- }), dt = (e) => {
147
- const { tab: t, onTabChange: i, hasContent: s } = l();
148
- return /* @__PURE__ */ n(
149
- ie,
147
+ }), It = (e) => {
148
+ const {
149
+ searchSettings: { view: t }
150
+ } = b(), { tab: i, onTabChange: s, hasContent: n, isHidden: o } = l();
151
+ return /* @__PURE__ */ a(
152
+ ae,
150
153
  {
151
- value: t,
152
- onValueChange: i,
153
- "data-has-content": I(s),
154
+ value: i,
155
+ onValueChange: s,
156
+ "data-has-content": m(n),
157
+ "data-dual-pane-search-expanded": m(n && t === "dual-pane" && !o),
154
158
  ...e
155
159
  }
156
160
  );
157
- }, re = r("div", {
161
+ }, oe = r("div", {
158
162
  _id: "aiSearchResults__Loading"
159
- }), ut = (e) => {
163
+ }), _t = (e) => {
160
164
  const { loading: t, resultsList: i } = l();
161
- return !t || i.length > 0 ? null : /* @__PURE__ */ n(re, { ...e });
162
- }, se = r(S.Empty, {
165
+ return !t || i.length > 0 ? null : /* @__PURE__ */ a(oe, { ...e });
166
+ }, ce = r(p.Empty, {
163
167
  _id: "aiSearchResults__Empty"
164
- }), mt = (e) => {
165
- const { query: t, loading: i, results: s, tab: a } = l(), o = s[a]?.length;
166
- return i || !t || o ? null : /* @__PURE__ */ n(se, { children: "No results found.", ...e });
167
- }, ne = r(E.List, {
168
+ }), vt = (e) => {
169
+ const { query: t, loading: i, results: s, tab: n } = l(), o = s[n]?.length;
170
+ return i || !t || o ? null : /* @__PURE__ */ a(ce, { children: "No results found.", ...e });
171
+ }, le = r(A.List, {
168
172
  _id: "aiSearchResults__TabList"
169
- }), ht = (e) => {
173
+ }), bt = (e) => {
170
174
  const { children: t, ...i } = e, {
171
175
  searchSettings: { tabs: s }
172
- } = R(), { results: a, loading: o, resultsList: c } = l();
176
+ } = b(), { results: n, loading: o, resultsList: c } = l();
173
177
  if (o && c.length === 0) return null;
174
- const d = Object.keys(a);
175
- return !s.length || !d.length ? null : /* @__PURE__ */ n(ne, { tabIndex: -1, children: g(t, d), ...i });
176
- }, ae = r(E.Trigger, {
178
+ const d = Object.keys(n);
179
+ return !s.length || !d.length ? null : /* @__PURE__ */ a(le, { tabIndex: -1, children: g(t, d), ...i });
180
+ }, de = r(A.Trigger, {
177
181
  _id: "aiSearchResults__Tab"
178
- }), It = T((e, t) => {
179
- const i = O(null), s = L(t, i), { tab: a, onClick: o, ...c } = e, { results: d, tab: u, inputRef: _ } = l(), h = d[a].length, v = a === u, A = () => {
180
- _.current?.focus();
181
- }, k = j();
182
- return f(() => {
183
- v && k?.shadowHost?.shadowRoot?.activeElement?.hasAttribute("ikp-tab") && i.current?.focus();
184
- }, [v]), /* @__PURE__ */ n(
185
- ae,
182
+ }), pt = w((e, t) => {
183
+ const i = C(null), s = k(t, i), { tab: n, onClick: o, ...c } = e, { results: d, tab: u, inputRef: I } = l(), _ = d[n].length, v = n === u, f = () => {
184
+ I.current?.focus();
185
+ }, y = X();
186
+ return L(() => {
187
+ v && y?.shadowHost?.shadowRoot?.activeElement?.hasAttribute("ikp-tab") && i.current?.focus();
188
+ }, [v]), /* @__PURE__ */ a(
189
+ de,
186
190
  {
187
191
  ref: s,
188
192
  "ikp-tab": "",
189
193
  tabIndex: v ? 0 : -1,
190
- value: a,
191
- children: `${a} (${h})`,
192
- onClick: p(o, A),
194
+ value: n,
195
+ children: `${n} (${_})`,
196
+ onClick: R(o, f),
193
197
  ...c
194
198
  }
195
199
  );
196
- }), _t = r("div", {
200
+ }), St = r("div", {
197
201
  _id: "aiSearchResults__Content"
198
- }), oe = r(w.Root, {
202
+ }), ue = r(T.Root, {
199
203
  _id: "aiSearchResults__ScrollArea"
200
- }), vt = (e) => {
204
+ }), Rt = (e) => {
201
205
  const { loading: t, resultsList: i } = l();
202
- return t && i.length === 0 ? null : /* @__PURE__ */ n(oe, { tabIndex: -1, ...e });
203
- }, ce = r(w.Viewport, {
206
+ return t && i.length === 0 ? null : /* @__PURE__ */ a(ue, { tabIndex: -1, ...e });
207
+ }, me = r(T.Viewport, {
204
208
  _id: "aiSearchResults__ScrollAreaViewport"
205
- }), Rt = T(({ children: e, ...t }, i) => {
206
- const s = G(), a = L(i, s), { tab: o } = l();
207
- return f(() => {
209
+ }), Pt = w(({ children: e, ...t }, i) => {
210
+ const s = Q(), n = k(i, s), { tab: o } = l();
211
+ return L(() => {
208
212
  o && s.current?.scrollTo({ top: 0, behavior: "auto" });
209
- }, [o]), /* @__PURE__ */ n(
210
- ce,
213
+ }, [o]), /* @__PURE__ */ a(
214
+ me,
211
215
  {
212
- ref: a,
216
+ ref: n,
213
217
  tabIndex: -1,
214
218
  children: (
215
219
  /* added this to fix an overflow issue see https://github.com/radix-ui/primitives/issues/926 */
216
- /* @__PURE__ */ n("div", { tabIndex: -1, style: { display: "grid" }, children: e })
220
+ /* @__PURE__ */ a("div", { tabIndex: -1, style: { display: "grid" }, children: e })
217
221
  ),
218
222
  ...t
219
223
  }
220
224
  );
221
- }), St = r(
222
- w.ScrollAreaScrollbar,
225
+ }), gt = r(
226
+ T.ScrollAreaScrollbar,
223
227
  {
224
228
  _id: "aiSearchResults__ScrollAreaScrollbar"
225
229
  }
226
- ), bt = r(w.ScrollAreaThumb, {
230
+ ), wt = r(T.ScrollAreaThumb, {
227
231
  _id: "aiSearchResults__ScrollAreaThumb"
228
- }), pt = r(w.Corner, {
232
+ }), Tt = r(T.Corner, {
229
233
  _id: "aiSearchResults__ScrollAreaCorner"
230
- }), le = r(E.Content, {
234
+ }), he = r(A.Content, {
231
235
  _id: "aiSearchResults__List"
232
- }), Pt = (e) => {
233
- const { children: t, ...i } = e, { results: s, tab: a } = l(), o = s[a] ?? [];
234
- return /* @__PURE__ */ n(
235
- le,
236
+ }), ft = (e) => {
237
+ const { children: t, ...i } = e, { results: s, tab: n } = l(), o = s[n] ?? [];
238
+ return /* @__PURE__ */ a(
239
+ he,
236
240
  {
237
- value: a,
238
- "data-has-results": I(o.length > 0),
241
+ value: n,
242
+ "data-has-results": m(o.length > 0),
239
243
  "aria-label": "Search results",
240
244
  children: g(t, o),
241
245
  tabIndex: -1,
242
246
  ...i
243
247
  }
244
248
  );
245
- }, de = r(S.Item, {
249
+ }, Ie = r(p.Item, {
246
250
  _id: "aiSearchResults__Item",
247
251
  asChild: !0
248
- }), gt = T(({ item: e, onClick: t, onSelect: i, children: s, ...a }, o) => {
252
+ }), Et = w(({ item: e, onClick: t, onSelect: i, children: s, ...n }, o) => {
249
253
  const {
250
- searchSettings: { shouldOpenLinksInNewTab: c }
251
- } = R(), { logEvent: d } = K(), { query: u, transitionsDisabled: _, selectedItem: h } = l(), v = O(null), A = L(o, v), k = () => {
252
- v.current?.click();
253
- }, B = () => {
254
- d({
254
+ searchSettings: { shouldOpenLinksInNewTab: c, view: d }
255
+ } = b(), { logEvent: u } = q(), { query: I, transitionsDisabled: _, selectedItem: v } = l(), f = C(null), y = k(o, f), N = M(($) => {
256
+ $.trigger === "keyboard" && f.current?.click();
257
+ }, []), H = M(() => {
258
+ u({
255
259
  eventName: "search_result_clicked",
256
260
  properties: {
257
- searchQuery: u,
261
+ searchQuery: I,
258
262
  title: e.title,
259
263
  url: e.url
260
264
  }
261
265
  });
262
- }, y = e.shouldOpenInNewTab !== void 0 ? e.shouldOpenInNewTab : c, N = h === e.id, U = N || (h === "NONE" || h === P);
263
- return /* @__PURE__ */ n(F, { source: { ...e, isExternal: y }, children: /* @__PURE__ */ n(
264
- de,
266
+ }, [u, I, e.title, e.url]), O = E(
267
+ () => e.shouldOpenInNewTab !== void 0 ? e.shouldOpenInNewTab : c,
268
+ [e.shouldOpenInNewTab, c]
269
+ ), F = v === e.id, V = F || (v === "NONE" || v === P), K = E(
270
+ () => ({
271
+ href: e.url,
272
+ isExternal: O,
273
+ appendToUrl: e.appendToUrl,
274
+ children: s,
275
+ id: `aiSearchResults__Item-${e.id}`
276
+ }),
277
+ [e.url, O, e.appendToUrl, s, e.id]
278
+ );
279
+ return /* @__PURE__ */ a(U, { source: { ...e, isExternal: O }, children: /* @__PURE__ */ a(
280
+ Ie,
265
281
  {
266
- ref: A,
282
+ ref: y,
267
283
  value: e.id,
268
284
  "data-type": e.type,
269
285
  "data-breadcrumbs": !!e.breadcrumbs?.length,
270
- "data-disable-transitions": I(_),
271
- onSelect: p(i, k),
272
- onClick: p(t, B),
273
- "data-selected": I(N),
274
- tabIndex: U ? 0 : -1,
275
- ...a,
276
- children: /* @__PURE__ */ n(
277
- C,
278
- {
279
- href: e.url,
280
- isExternal: y,
281
- appendToUrl: e.appendToUrl,
282
- children: s,
283
- id: `aiSearchResults__Item-${e.id}`
284
- }
285
- )
286
+ "data-disable-transitions": m(_),
287
+ "data-view": d,
288
+ onSelect: R(i, N),
289
+ onClick: R(t, H),
290
+ "data-selected": m(F),
291
+ tabIndex: V ? 0 : -1,
292
+ ...n,
293
+ children: /* @__PURE__ */ a(x, { ...K })
286
294
  }
287
295
  ) });
288
- }), ue = r("div", {
296
+ }), _e = r("div", {
289
297
  _id: "aiSearchResults__ItemBreadcrumbs"
290
- }), me = (e) => {
291
- const { source: t } = m(), { tab: i } = l();
298
+ }), ve = (e) => {
299
+ const { source: t } = h(), { tab: i } = l();
292
300
  if (!t.breadcrumbs?.length) return null;
293
- const { children: s, ...a } = e, c = t.tabs?.find((d) => typeof d != "string" && d[0] === i)?.[1]?.breadcrumbs ?? t.breadcrumbs ?? [];
294
- return /* @__PURE__ */ n(
295
- ue,
301
+ const { children: s, ...n } = e, c = t.tabs?.find((d) => typeof d != "string" && d[0] === i)?.[1]?.breadcrumbs ?? t.breadcrumbs ?? [];
302
+ return /* @__PURE__ */ a(
303
+ _e,
296
304
  {
297
305
  "aria-hidden": "true",
298
306
  children: g(s, c),
299
- ...a
307
+ ...n
300
308
  }
301
309
  );
302
- }, he = r(b, {
310
+ }, be = r(S, {
303
311
  _id: "aiSearchResults__ItemBreadcrumbIcon",
304
312
  iconKey: "breadcrumbSeparator"
305
- }), Ie = r(x, {
313
+ }), pe = r(B, {
306
314
  _id: "aiSearchResults__ItemIcon"
307
- }), Tt = (e) => {
308
- const { source: t } = m();
309
- return /* @__PURE__ */ n(Ie, { iconSettings: t.icon, "data-type": t.type, ...e });
310
- }, _e = r("span", {
315
+ }), Lt = (e) => {
316
+ const { source: t } = h();
317
+ return /* @__PURE__ */ a(pe, { iconSettings: t.icon, "data-type": t.type, ...e });
318
+ }, Se = r("span", {
311
319
  _id: "aiSearchResults__ItemTitle"
312
- }), wt = (e) => {
313
- const { source: t } = m();
314
- return /* @__PURE__ */ n(_e, { "data-type": t.type, children: t.title, ...e });
315
- }, ve = r("span", {
316
- _id: "aiSearchResults__ItemTag"
317
- }), ft = (e) => {
318
- const { source: t } = m();
319
- return /* @__PURE__ */ n(ve, { "data-type": t.type, children: t.tag, ...e });
320
+ }), At = (e) => {
321
+ const { source: t } = h();
322
+ return /* @__PURE__ */ a(Se, { "data-type": t.type, children: t.title, ...e });
320
323
  }, Re = r("span", {
324
+ _id: "aiSearchResults__ItemTag"
325
+ }), kt = (e) => {
326
+ const { source: t } = h();
327
+ return /* @__PURE__ */ a(Re, { "data-type": t.type, children: t.tag, ...e });
328
+ }, Pe = r("span", {
321
329
  _id: "aiSearchResults__ItemDescription"
322
- }), Et = (e) => {
323
- const { source: t } = m(), { children: i, ...s } = e, a = H(() => t.description ? $(t.description) : [], [t.description]);
324
- return a.length ? /* @__PURE__ */ n(
325
- Re,
330
+ }), yt = (e) => {
331
+ const { source: t } = h(), { children: i, ...s } = e, n = E(() => t.description ? j(t.description) : [], [t.description]);
332
+ return n.length ? /* @__PURE__ */ a(
333
+ Pe,
326
334
  {
327
335
  "data-type": t.type,
328
336
  "aria-hidden": "true",
329
- children: g(i, a),
337
+ children: g(i, n),
330
338
  ...s
331
339
  }
332
340
  ) : null;
333
- }, Se = r("span", {
341
+ }, ge = r("span", {
334
342
  _id: "aiSearchResults__ItemDescriptionPart"
335
- }), Lt = (e) => {
336
- const { part: t, ...i } = e, { source: s } = m();
337
- return typeof t == "string" ? t : /* @__PURE__ */ n(
338
- Se,
343
+ }), Ot = (e) => {
344
+ const { part: t, ...i } = e, { source: s } = h();
345
+ return typeof t == "string" ? t : /* @__PURE__ */ a(
346
+ ge,
339
347
  {
340
348
  "data-type": s.type,
341
349
  children: t.content,
342
- "data-highlighted": I(t.highlighted),
350
+ "data-highlighted": m(t.highlighted),
343
351
  ...i
344
352
  }
345
353
  );
346
- }, be = r(b, {
354
+ }, we = r(S, {
347
355
  _id: "aiSearchResults__ItemIndicator"
348
- }), At = (e) => {
349
- const { source: t } = m();
350
- return /* @__PURE__ */ n(
351
- be,
356
+ }), Ct = (e) => {
357
+ const { source: t } = h(), {
358
+ searchSettings: { view: i }
359
+ } = b();
360
+ return /* @__PURE__ */ a(
361
+ we,
352
362
  {
353
363
  iconKey: t.isExternal ? "openLinkInNewTab" : "openLinkInSameTab",
364
+ "data-view": i,
354
365
  ...e
355
366
  }
356
367
  );
357
- }, pe = r("div", {
368
+ }, Te = r("div", {
358
369
  _id: "aiSearchResults__ItemPreview",
359
370
  "aria-hidden": !0
360
- }), kt = (e) => {
371
+ }), xt = (e) => {
361
372
  const {
362
373
  searchSettings: { view: t, shouldOpenLinksInNewTab: i }
363
- } = R(), { results: s, tab: a, selectedItem: o } = l(), c = s[a] ?? [], d = O(null), u = H(() => {
374
+ } = b(), { results: s, tab: n, selectedItem: o } = l(), c = s[n] ?? [], d = C(null), u = E(() => {
364
375
  if (o === P) return d.current;
365
- const h = c.find((v) => v.id === o);
366
- return d.current = h ?? null, h;
376
+ const _ = c.find((v) => v.id === o);
377
+ return d.current = _ ?? null, _;
367
378
  }, [o]);
368
379
  if (t !== "dual-pane" || o === P || !u) return null;
369
- const _ = u.shouldOpenInNewTab !== void 0 ? u.shouldOpenInNewTab : i;
370
- return /* @__PURE__ */ n(F, { source: { ...u, isExternal: _ }, children: /* @__PURE__ */ n(pe, { ...e }) });
371
- }, yt = r("div", {
380
+ const I = u.shouldOpenInNewTab !== void 0 ? u.shouldOpenInNewTab : i;
381
+ return /* @__PURE__ */ a(U, { source: { ...u, isExternal: I }, children: /* @__PURE__ */ a(Te, { ...e }) });
382
+ }, Bt = r("div", {
372
383
  _id: "aiSearchResults__ItemPreview__Header"
373
- }), Pe = r(C, {
384
+ }), fe = r(x, {
374
385
  _id: "aiSearchResults__ItemPreview__Heading"
375
- }), Ot = (e) => {
376
- const { source: t } = m();
377
- return /* @__PURE__ */ n(
378
- Pe,
386
+ }), Nt = (e) => {
387
+ const { source: t } = h();
388
+ return /* @__PURE__ */ a(
389
+ fe,
379
390
  {
380
391
  href: t.url,
381
392
  isExternal: t.isExternal,
@@ -384,101 +395,101 @@ const P = "__ask_ai__", z = r("div", {
384
395
  ...e
385
396
  }
386
397
  );
387
- }, ge = r("span", {
398
+ }, Ee = r("span", {
388
399
  _id: "aiSearchResults__ItemPreview__Title"
389
- }), Ct = (e) => {
390
- const { source: t } = m();
391
- return /* @__PURE__ */ n(ge, { children: t.title, ...e });
392
- }, Te = r(b, {
400
+ }), Ht = (e) => {
401
+ const { source: t } = h();
402
+ return /* @__PURE__ */ a(Ee, { children: t.title, ...e });
403
+ }, Le = r(S, {
393
404
  _id: "aiSearchResults__ItemPreview__Title__LinkIcon",
394
405
  iconKey: "openLinkInNewTab"
395
- }), xt = (e) => {
396
- const { source: t } = m();
397
- return /* @__PURE__ */ n(
398
- Te,
406
+ }), Ft = (e) => {
407
+ const { source: t } = h();
408
+ return /* @__PURE__ */ a(
409
+ Le,
399
410
  {
400
411
  iconKey: t.isExternal ? "openLinkInNewTab" : "openLinkInSameTab",
401
412
  ...e
402
413
  }
403
414
  );
404
- }, Bt = r(
405
- me,
415
+ }, Mt = r(
416
+ ve,
406
417
  {
407
418
  _id: "aiSearchResults__ItemPreview__Breadcrumbs"
408
419
  }
409
- ), Nt = r(
410
- he,
420
+ ), Ut = r(
421
+ be,
411
422
  {
412
423
  _id: "aiSearchResults__ItemPreview__BreadcrumbIcon"
413
424
  }
414
- ), we = r(Q, {
425
+ ), Ae = r(Y, {
415
426
  _id: "aiSearchResults__ItemPreview__Body"
416
- }), Ht = (e) => {
417
- const { source: t } = m(), { resultsList: i } = l(), s = i.find((o) => o.id === t.id), {
418
- searchSettings: { shouldOpenLinksInNewTab: a }
419
- } = R();
420
- return s ? /* @__PURE__ */ n(
421
- we,
427
+ }), Dt = (e) => {
428
+ const { source: t } = h(), { resultsList: i } = l(), s = i.find((o) => o.id === t.id), {
429
+ searchSettings: { shouldOpenLinksInNewTab: n }
430
+ } = b();
431
+ return s ? /* @__PURE__ */ a(
432
+ Ae,
422
433
  {
423
- shouldOpenLinksInNewTab: a,
434
+ shouldOpenLinksInNewTab: n,
424
435
  children: s.preview,
425
436
  ...e
426
437
  }
427
438
  ) : null;
428
- }, fe = r("div", {
439
+ }, ke = r("div", {
429
440
  _id: "aiSearchResults__ItemPreview__Outline"
430
- }), Ft = (e) => {
431
- const { source: t } = m(), { resultsList: i } = l();
432
- return i.find((o) => o.id === t.id)?.rootRecord.topLevelHeadings?.length ? /* @__PURE__ */ n(fe, { ...e }) : null;
433
- }, Mt = r("span", {
441
+ }), Vt = (e) => {
442
+ const { source: t } = h(), { resultsList: i } = l();
443
+ return i.find((o) => o.id === t.id)?.rootRecord.topLevelHeadings?.length ? /* @__PURE__ */ a(ke, { ...e }) : null;
444
+ }, Kt = r("span", {
434
445
  _id: "aiSearchResults__ItemPreview__Outline__Title",
435
446
  children: "On this page"
436
- }), Ee = r("ul", {
447
+ }), ye = r("ul", {
437
448
  _id: "aiSearchResults__ItemPreview__Outline__List"
438
- }), Ut = (e) => {
439
- const { source: t } = m(), { resultsList: i } = l(), s = i.find((u) => u.id === t.id), a = s?.rootRecord.topLevelHeadings;
440
- if (!a?.length) return null;
441
- const o = a.map((u) => {
442
- const _ = u?.anchor && u?.anchor === s?.content?.anchor, h = u?.anchor === s?.pathHeadings?.[0]?.anchor;
449
+ }), $t = (e) => {
450
+ const { source: t } = h(), { resultsList: i } = l(), s = i.find((u) => u.id === t.id), n = s?.rootRecord.topLevelHeadings;
451
+ if (!n?.length) return null;
452
+ const o = n.map((u) => {
453
+ const I = u?.anchor && u?.anchor === s?.content?.anchor, _ = u?.anchor === s?.pathHeadings?.[0]?.anchor;
443
454
  return {
444
455
  ...u,
445
- isMatch: _ || h
456
+ isMatch: I || _
446
457
  };
447
458
  }), { children: c, ...d } = e;
448
- return /* @__PURE__ */ n(Ee, { children: g(c, o), ...d });
449
- }, Le = r(C, {
459
+ return /* @__PURE__ */ a(ye, { children: g(c, o), ...d });
460
+ }, Oe = r(x, {
450
461
  _id: "aiSearchResults__ItemPreview__Outline__Item"
451
- }), Dt = (e) => {
462
+ }), Gt = (e) => {
452
463
  const {
453
464
  searchSettings: { shouldOpenLinksInNewTab: t }
454
- } = R();
455
- return /* @__PURE__ */ n(Le, { isExternal: t, ...e });
456
- }, Vt = r(b, {
465
+ } = b();
466
+ return /* @__PURE__ */ a(Oe, { isExternal: t, ...e });
467
+ }, Wt = r(S, {
457
468
  _id: "aiSearchResults__ItemPreview__Outline__ItemIcon",
458
469
  iconKey: "newLine"
459
- }), Ae = r("span", {
470
+ }), Ce = r("span", {
460
471
  _id: "aiSearchResults__ItemPreview__Outline__ItemText"
461
- }), Kt = (e) => /* @__PURE__ */ n(Ae, { ...e }), $t = r(
462
- x,
472
+ }), qt = (e) => /* @__PURE__ */ a(Ce, { ...e }), jt = r(
473
+ B,
463
474
  {
464
475
  _id: "aiSearchResults__ItemPreview__Outline__ItemLinkIcon",
465
476
  iconSettings: {
466
477
  builtIn: "LuLink"
467
478
  }
468
479
  }
469
- ), ke = r("div", {
480
+ ), xe = r("div", {
470
481
  _id: "aiSearchFooter"
471
- }), Gt = (e) => {
482
+ }), Qt = (e) => {
472
483
  const { hasContent: t } = l();
473
- return /* @__PURE__ */ n(ke, { "data-has-results": I(t), ...e });
474
- }, Wt = r("div", {
484
+ return /* @__PURE__ */ a(xe, { "data-has-results": m(t), ...e });
485
+ }, zt = r("div", {
475
486
  _id: "aiSearchTagline__Container"
476
- }), qt = r("span", {
487
+ }), Jt = r("span", {
477
488
  _id: "aiSearchTagline__Text",
478
489
  children: "Powered by"
479
- }), jt = r(V, {
490
+ }), Xt = r(W, {
480
491
  _id: "aiSearchTagline__Logo"
481
- }), Qt = r("a", {
492
+ }), Yt = r("a", {
482
493
  _id: "aiSearchTagline__BrandName",
483
494
  children: "inkeep",
484
495
  href: "https://www.inkeep.com/",
@@ -487,100 +498,100 @@ const P = "__ask_ai__", z = r("div", {
487
498
  });
488
499
  export {
489
500
  P as ASK_AI_TRIGGER_VALUE,
490
- at as AskAITrigger,
491
- ot as AskAITriggerIcon,
492
- lt as AskAITriggerIndicator,
493
- ct as AskAITriggerLabel,
494
- tt as Content,
495
- rt as EmbeddedSearchInputIcon,
496
- at as EmbeddedSearchPrimitiveAskAITrigger,
497
- ot as EmbeddedSearchPrimitiveAskAITriggerIcon,
498
- lt as EmbeddedSearchPrimitiveAskAITriggerIndicator,
499
- ct as EmbeddedSearchPrimitiveAskAITriggerLabel,
500
- tt as EmbeddedSearchPrimitiveContent,
501
- Gt as EmbeddedSearchPrimitiveFooter,
502
- st as EmbeddedSearchPrimitiveInput,
503
- it as EmbeddedSearchPrimitiveInputGroup,
504
- nt as EmbeddedSearchPrimitiveLoading,
505
- dt as EmbeddedSearchPrimitiveResults,
506
- _t as EmbeddedSearchPrimitiveResultsContent,
507
- mt as EmbeddedSearchPrimitiveResultsEmpty,
508
- gt as EmbeddedSearchPrimitiveResultsItem,
509
- me as EmbeddedSearchPrimitiveResultsItemBreadcrumbs,
510
- Et as EmbeddedSearchPrimitiveResultsItemDescription,
511
- Lt as EmbeddedSearchPrimitiveResultsItemDescriptionPart,
512
- Tt as EmbeddedSearchPrimitiveResultsItemIcon,
513
- At as EmbeddedSearchPrimitiveResultsItemIndicator,
514
- kt as EmbeddedSearchPrimitiveResultsItemPreview,
515
- Ht as EmbeddedSearchPrimitiveResultsItemPreviewBody,
516
- Nt as EmbeddedSearchPrimitiveResultsItemPreviewBreadcrumbIcon,
517
- Ot as EmbeddedSearchPrimitiveResultsItemPreviewHeading,
518
- Ft as EmbeddedSearchPrimitiveResultsItemPreviewOutline,
519
- Dt as EmbeddedSearchPrimitiveResultsItemPreviewOutlineItem,
520
- Vt as EmbeddedSearchPrimitiveResultsItemPreviewOutlineItemIcon,
521
- $t as EmbeddedSearchPrimitiveResultsItemPreviewOutlineItemLinkIcon,
522
- Kt as EmbeddedSearchPrimitiveResultsItemPreviewOutlineItemText,
523
- Ut as EmbeddedSearchPrimitiveResultsItemPreviewOutlineList,
524
- Mt as EmbeddedSearchPrimitiveResultsItemPreviewOutlineTitle,
525
- Ct as EmbeddedSearchPrimitiveResultsItemPreviewTitle,
526
- xt as EmbeddedSearchPrimitiveResultsItemPreviewTitleLinkIcon,
527
- ft as EmbeddedSearchPrimitiveResultsItemTag,
528
- wt as EmbeddedSearchPrimitiveResultsItemTitle,
529
- Pt as EmbeddedSearchPrimitiveResultsList,
530
- ut as EmbeddedSearchPrimitiveResultsLoading,
531
- vt as EmbeddedSearchPrimitiveResultsScrollArea,
532
- Rt as EmbeddedSearchPrimitiveResultsScrollAreaViewport,
533
- It as EmbeddedSearchPrimitiveResultsTab,
534
- ht as EmbeddedSearchPrimitiveResultsTabList,
535
- et as EmbeddedSearchPrimitiveRoot,
536
- Ze as EmbeddedSearchPrimitiveWrapper,
537
- Gt as Footer,
538
- st as Input,
539
- it as InputGroup,
540
- rt as InputIcon,
541
- nt as Loading,
542
- X as PrimitiveContent,
543
- Xt as Provider,
544
- dt as Results,
545
- _t as ResultsContent,
546
- mt as ResultsEmpty,
547
- gt as ResultsItem,
548
- he as ResultsItemBreadcrumbIcon,
549
- me as ResultsItemBreadcrumbs,
550
- Et as ResultsItemDescription,
551
- Lt as ResultsItemDescriptionPart,
552
- Tt as ResultsItemIcon,
553
- At as ResultsItemIndicator,
554
- kt as ResultsItemPreview,
555
- Ht as ResultsItemPreviewBody,
556
- Nt as ResultsItemPreviewBreadcrumbIcon,
557
- Bt as ResultsItemPreviewBreadcrumbs,
558
- yt as ResultsItemPreviewHeader,
559
- Ot as ResultsItemPreviewHeading,
560
- Ft as ResultsItemPreviewOutline,
561
- Dt as ResultsItemPreviewOutlineItem,
562
- Vt as ResultsItemPreviewOutlineItemIcon,
563
- $t as ResultsItemPreviewOutlineItemLinkIcon,
564
- Kt as ResultsItemPreviewOutlineItemText,
565
- Ut as ResultsItemPreviewOutlineList,
566
- Mt as ResultsItemPreviewOutlineTitle,
567
- Ct as ResultsItemPreviewTitle,
568
- xt as ResultsItemPreviewTitleLinkIcon,
569
- ft as ResultsItemTag,
570
- wt as ResultsItemTitle,
571
- Pt as ResultsList,
572
- ut as ResultsLoading,
573
- vt as ResultsScrollArea,
574
- pt as ResultsScrollAreaCorner,
575
- St as ResultsScrollAreaScrollbar,
576
- bt as ResultsScrollAreaThumb,
577
- Rt as ResultsScrollAreaViewport,
578
- It as ResultsTab,
579
- ht as ResultsTabList,
580
- et as Root,
581
- Qt as TaglineBrandName,
582
- Wt as TaglineContainer,
583
- jt as TaglineLogo,
584
- qt as TaglineText,
585
- Ze as Wrapper
501
+ dt as AskAITrigger,
502
+ ut as AskAITriggerIcon,
503
+ ht as AskAITriggerIndicator,
504
+ mt as AskAITriggerLabel,
505
+ nt as Content,
506
+ ot as EmbeddedSearchInputIcon,
507
+ dt as EmbeddedSearchPrimitiveAskAITrigger,
508
+ ut as EmbeddedSearchPrimitiveAskAITriggerIcon,
509
+ ht as EmbeddedSearchPrimitiveAskAITriggerIndicator,
510
+ mt as EmbeddedSearchPrimitiveAskAITriggerLabel,
511
+ nt as EmbeddedSearchPrimitiveContent,
512
+ Qt as EmbeddedSearchPrimitiveFooter,
513
+ ct as EmbeddedSearchPrimitiveInput,
514
+ at as EmbeddedSearchPrimitiveInputGroup,
515
+ lt as EmbeddedSearchPrimitiveLoading,
516
+ It as EmbeddedSearchPrimitiveResults,
517
+ St as EmbeddedSearchPrimitiveResultsContent,
518
+ vt as EmbeddedSearchPrimitiveResultsEmpty,
519
+ Et as EmbeddedSearchPrimitiveResultsItem,
520
+ ve as EmbeddedSearchPrimitiveResultsItemBreadcrumbs,
521
+ yt as EmbeddedSearchPrimitiveResultsItemDescription,
522
+ Ot as EmbeddedSearchPrimitiveResultsItemDescriptionPart,
523
+ Lt as EmbeddedSearchPrimitiveResultsItemIcon,
524
+ Ct as EmbeddedSearchPrimitiveResultsItemIndicator,
525
+ xt as EmbeddedSearchPrimitiveResultsItemPreview,
526
+ Dt as EmbeddedSearchPrimitiveResultsItemPreviewBody,
527
+ Ut as EmbeddedSearchPrimitiveResultsItemPreviewBreadcrumbIcon,
528
+ Nt as EmbeddedSearchPrimitiveResultsItemPreviewHeading,
529
+ Vt as EmbeddedSearchPrimitiveResultsItemPreviewOutline,
530
+ Gt as EmbeddedSearchPrimitiveResultsItemPreviewOutlineItem,
531
+ Wt as EmbeddedSearchPrimitiveResultsItemPreviewOutlineItemIcon,
532
+ jt as EmbeddedSearchPrimitiveResultsItemPreviewOutlineItemLinkIcon,
533
+ qt as EmbeddedSearchPrimitiveResultsItemPreviewOutlineItemText,
534
+ $t as EmbeddedSearchPrimitiveResultsItemPreviewOutlineList,
535
+ Kt as EmbeddedSearchPrimitiveResultsItemPreviewOutlineTitle,
536
+ Ht as EmbeddedSearchPrimitiveResultsItemPreviewTitle,
537
+ Ft as EmbeddedSearchPrimitiveResultsItemPreviewTitleLinkIcon,
538
+ kt as EmbeddedSearchPrimitiveResultsItemTag,
539
+ At as EmbeddedSearchPrimitiveResultsItemTitle,
540
+ ft as EmbeddedSearchPrimitiveResultsList,
541
+ _t as EmbeddedSearchPrimitiveResultsLoading,
542
+ Rt as EmbeddedSearchPrimitiveResultsScrollArea,
543
+ Pt as EmbeddedSearchPrimitiveResultsScrollAreaViewport,
544
+ pt as EmbeddedSearchPrimitiveResultsTab,
545
+ bt as EmbeddedSearchPrimitiveResultsTabList,
546
+ st as EmbeddedSearchPrimitiveRoot,
547
+ rt as EmbeddedSearchPrimitiveWrapper,
548
+ Qt as Footer,
549
+ ct as Input,
550
+ at as InputGroup,
551
+ ot as InputIcon,
552
+ lt as Loading,
553
+ te as PrimitiveContent,
554
+ ti as Provider,
555
+ It as Results,
556
+ St as ResultsContent,
557
+ vt as ResultsEmpty,
558
+ Et as ResultsItem,
559
+ be as ResultsItemBreadcrumbIcon,
560
+ ve as ResultsItemBreadcrumbs,
561
+ yt as ResultsItemDescription,
562
+ Ot as ResultsItemDescriptionPart,
563
+ Lt as ResultsItemIcon,
564
+ Ct as ResultsItemIndicator,
565
+ xt as ResultsItemPreview,
566
+ Dt as ResultsItemPreviewBody,
567
+ Ut as ResultsItemPreviewBreadcrumbIcon,
568
+ Mt as ResultsItemPreviewBreadcrumbs,
569
+ Bt as ResultsItemPreviewHeader,
570
+ Nt as ResultsItemPreviewHeading,
571
+ Vt as ResultsItemPreviewOutline,
572
+ Gt as ResultsItemPreviewOutlineItem,
573
+ Wt as ResultsItemPreviewOutlineItemIcon,
574
+ jt as ResultsItemPreviewOutlineItemLinkIcon,
575
+ qt as ResultsItemPreviewOutlineItemText,
576
+ $t as ResultsItemPreviewOutlineList,
577
+ Kt as ResultsItemPreviewOutlineTitle,
578
+ Ht as ResultsItemPreviewTitle,
579
+ Ft as ResultsItemPreviewTitleLinkIcon,
580
+ kt as ResultsItemTag,
581
+ At as ResultsItemTitle,
582
+ ft as ResultsList,
583
+ _t as ResultsLoading,
584
+ Rt as ResultsScrollArea,
585
+ Tt as ResultsScrollAreaCorner,
586
+ gt as ResultsScrollAreaScrollbar,
587
+ wt as ResultsScrollAreaThumb,
588
+ Pt as ResultsScrollAreaViewport,
589
+ pt as ResultsTab,
590
+ bt as ResultsTabList,
591
+ st as Root,
592
+ Yt as TaglineBrandName,
593
+ zt as TaglineContainer,
594
+ Xt as TaglineLogo,
595
+ Jt as TaglineText,
596
+ rt as Wrapper
586
597
  };