@inkeep/cxkit-primitives 0.5.48 → 0.5.49

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,30 +1,30 @@
1
- import { jsxs as ee, jsx as p } from "react/jsx-runtime";
2
- import * as K from "@radix-ui/react-dialog";
1
+ import { jsxs as Z, jsx as p } from "react/jsx-runtime";
2
+ import { Root as Se, Portal as Ee, Overlay as Ce, Content as we } from "../dialog.js";
3
3
  import * as c from "react";
4
- import { useCallback as ae, useMemo as Ee } from "react";
5
- import { commandScore as Ce } from "./command-score.js";
6
- import { Primitive as I } from "@radix-ui/react-primitive";
4
+ import { useCallback as le, useMemo as ye } from "react";
5
+ import { commandScore as Ie } from "./command-score.js";
6
+ import { Primitive as R } from "@radix-ui/react-primitive";
7
7
  import { useId as F } from "@radix-ui/react-id";
8
- import { s as we } from "../../node_modules/.pnpm/use-sync-external-store@1.4.0_react@19.0.0/node_modules/use-sync-external-store/shim/index.js";
9
- import { ASK_AI_TRIGGER_VALUE as ye } from "../../constants/search.js";
10
- import { composeEventHandlers as Re } from "../../utils/compose-event-handlers.js";
11
- import { useShadow as Ie } from "../shadow/context.js";
12
- const T = '[cmdk-group=""]', Y = '[cmdk-group-items=""]', xe = '[cmdk-group-heading=""]', de = '[cmdk-item=""]', ue = `${de}:not([aria-disabled="true"])`, Z = "cmdk-item-select", L = "data-value", ke = (t, n, r) => Ce(t, n, r ?? []), fe = c.createContext(void 0), D = () => c.useContext(fe), me = c.createContext(void 0), te = () => c.useContext(me), he = c.createContext(void 0), ve = c.forwardRef((t, n) => {
13
- const r = M(() => /* @__PURE__ */ new Set()), i = M(() => /* @__PURE__ */ new Map()), u = M(() => /* @__PURE__ */ new Map()), f = M(() => /* @__PURE__ */ new Set()), s = ge(t), {
8
+ import { s as Re } from "../../node_modules/.pnpm/use-sync-external-store@1.4.0_react@19.0.0/node_modules/use-sync-external-store/shim/index.js";
9
+ import { ASK_AI_TRIGGER_VALUE as ke } from "../../constants/search.js";
10
+ import { composeEventHandlers as xe } from "../../utils/compose-event-handlers.js";
11
+ import { useShadow as Ae } from "../shadow/context.js";
12
+ const T = '[cmdk-group=""]', X = '[cmdk-group-items=""]', _e = '[cmdk-group-heading=""]', ae = '[cmdk-item=""]', ue = `${ae}:not([aria-disabled="true"])`, Y = "cmdk-item-select", L = "data-value", Le = (t, n, r) => Ie(t, n, r ?? []), de = c.createContext(void 0), D = () => c.useContext(de), fe = c.createContext(void 0), ee = () => c.useContext(fe), me = c.createContext(void 0), he = c.forwardRef((t, n) => {
13
+ const r = M(() => /* @__PURE__ */ new Set()), i = M(() => /* @__PURE__ */ new Map()), a = M(() => /* @__PURE__ */ new Map()), f = M(() => /* @__PURE__ */ new Set()), s = ve(t), {
14
14
  label: h,
15
15
  children: d,
16
16
  value: S,
17
17
  onValueChange: C,
18
18
  filter: y,
19
19
  shouldFilter: w,
20
- loop: R,
20
+ loop: I,
21
21
  disablePointerSelection: _ = !1,
22
- vimBindings: N = !0,
23
- defaultSearch: re,
24
- ...U
22
+ vimBindings: B = !0,
23
+ defaultSearch: te,
24
+ ...N
25
25
  } = t, v = M(() => ({
26
26
  /** Value of the search query. */
27
- search: re ?? "",
27
+ search: te ?? "",
28
28
  /** Currently selected item value. */
29
29
  value: t.value ?? t.defaultValue ?? "",
30
30
  /** Currently selected item id. */
@@ -37,27 +37,27 @@ const T = '[cmdk-group=""]', Y = '[cmdk-group-items=""]', xe = '[cmdk-group-head
37
37
  /** Set of groups with at least one visible item. */
38
38
  groups: /* @__PURE__ */ new Set()
39
39
  }
40
- })), $ = F(), j = F(), q = F(), x = c.useRef(null), g = Ge();
40
+ })), U = F(), $ = F(), j = F(), k = c.useRef(null), g = Ne();
41
41
  A(() => {
42
42
  if (S !== void 0) {
43
43
  const e = S.trim();
44
44
  v.current.value = e, E.emit();
45
45
  }
46
46
  }, [S]), A(() => {
47
- g(6, oe);
47
+ g(6, ne);
48
48
  }, []);
49
- const G = Ie(), E = c.useMemo(() => ({
49
+ const G = Ae(), E = c.useMemo(() => ({
50
50
  subscribe: (e) => (f.current.add(e), () => f.current.delete(e)),
51
51
  snapshot: () => v.current,
52
52
  setState: (e, l, o) => {
53
53
  if (!Object.is(v.current[e], l)) {
54
54
  if (v.current[e] = l, e === "search")
55
- J(), H(), g(1, W);
55
+ W(), z(), g(1, H);
56
56
  else if (e === "value" && (G?.shadowHost?.shadowRoot?.activeElement?.hasAttribute("cmdk-input") || g(1, () => {
57
- k()?.focus();
57
+ x()?.focus();
58
58
  }), g(7, () => {
59
- v.current.selectedItemId = k()?.id, E.emit();
60
- }), o || g(5, oe), s.current?.value !== void 0)) {
59
+ v.current.selectedItemId = x()?.id, E.emit();
60
+ }), o || g(5, ne), s.current?.value !== void 0)) {
61
61
  const b = l ?? "";
62
62
  s.current.onValueChange?.(b);
63
63
  return;
@@ -68,82 +68,82 @@ const T = '[cmdk-group=""]', Y = '[cmdk-group-items=""]', xe = '[cmdk-group-head
68
68
  emit: () => {
69
69
  f.current.forEach((e) => e());
70
70
  }
71
- }), []), z = c.useMemo(
71
+ }), []), q = c.useMemo(
72
72
  () => ({
73
73
  // Keep id → {value, keywords} mapping up-to-date
74
74
  value: (e, l, o) => {
75
- l !== u.current.get(e)?.value && (u.current.set(e, { value: l, keywords: o }), v.current.filtered.items.set(e, ne(l, o)), g(2, () => {
76
- H(), E.emit();
75
+ l !== a.current.get(e)?.value && (a.current.set(e, { value: l, keywords: o }), v.current.filtered.items.set(e, re(l, o)), g(2, () => {
76
+ z(), E.emit();
77
77
  }));
78
78
  },
79
79
  // Track item lifecycle (mount, unmount)
80
80
  item: (e, l) => (r.current.add(e), l && (i.current.has(l) ? i.current?.get(l)?.add(e) : i.current.set(l, /* @__PURE__ */ new Set([e]))), g(3, () => {
81
- J(), H(), v.current.value || W(), E.emit();
81
+ W(), z(), v.current.value || H(), E.emit();
82
82
  }), () => {
83
- u.current.delete(e), r.current.delete(e), v.current.filtered.items.delete(e);
84
- const o = k();
83
+ a.current.delete(e), r.current.delete(e), v.current.filtered.items.delete(e);
84
+ const o = x();
85
85
  g(4, () => {
86
- J(), o?.getAttribute("id") === e && W(), E.emit();
86
+ W(), o?.getAttribute("id") === e && H(), E.emit();
87
87
  });
88
88
  }),
89
89
  // Track group lifecycle (mount, unmount)
90
90
  group: (e) => (i.current.has(e) || i.current.set(e, /* @__PURE__ */ new Set()), () => {
91
- u.current.delete(e), i.current.delete(e);
91
+ a.current.delete(e), i.current.delete(e);
92
92
  }),
93
93
  filter: () => !!s.current.shouldFilter,
94
94
  label: h || t["aria-label"] || "",
95
95
  getDisablePointerSelection: () => !!s.current.disablePointerSelection,
96
- listId: $,
97
- inputId: q,
98
- labelId: j,
99
- listInnerRef: x
96
+ listId: U,
97
+ inputId: j,
98
+ labelId: $,
99
+ listInnerRef: k
100
100
  }),
101
101
  []
102
102
  );
103
- function ne(e, l) {
104
- const o = s.current?.filter ?? ke;
103
+ function re(e, l) {
104
+ const o = s.current?.filter ?? Le;
105
105
  return e ? o?.(e, v.current.search, l) : 0;
106
106
  }
107
- function H() {
107
+ function z() {
108
108
  if (!v.current.search || // Explicitly false, because true | undefined is the default
109
109
  s.current.shouldFilter === !1)
110
110
  return;
111
111
  const e = v.current.filtered.items, l = [];
112
- v.current.filtered.groups.forEach((a) => {
113
- const m = i.current.get(a);
112
+ v.current.filtered.groups.forEach((u) => {
113
+ const m = i.current.get(u);
114
114
  let b = 0;
115
- m.forEach((X) => {
116
- const Se = e.get(X);
117
- b = Math.max(Se, b);
118
- }), l.push([a, b]);
115
+ m.forEach((Q) => {
116
+ const be = e.get(Q);
117
+ b = Math.max(be, b);
118
+ }), l.push([u, b]);
119
119
  });
120
- const o = x.current;
121
- V().sort((a, m) => {
122
- const b = a.getAttribute("id"), X = m.getAttribute("id");
123
- return (e.get(X) ?? 0) - (e.get(b) ?? 0);
124
- }).forEach((a) => {
125
- const m = a.closest(Y);
120
+ const o = k.current;
121
+ V().sort((u, m) => {
122
+ const b = u.getAttribute("id"), Q = m.getAttribute("id");
123
+ return (e.get(Q) ?? 0) - (e.get(b) ?? 0);
124
+ }).forEach((u) => {
125
+ const m = u.closest(X);
126
126
  if (m) {
127
- const b = a.parentElement === m ? a : a.closest(`${Y} > *`);
127
+ const b = u.parentElement === m ? u : u.closest(`${X} > *`);
128
128
  b && m.appendChild(b);
129
129
  } else {
130
- const b = a.parentElement === o ? a : a.closest(`${Y} > *`);
130
+ const b = u.parentElement === o ? u : u.closest(`${X} > *`);
131
131
  b && o?.appendChild(b);
132
132
  }
133
- }), l.sort((a, m) => m[1] - a[1]).forEach((a) => {
134
- const m = x.current?.querySelector(
135
- `${T}[${L}="${encodeURIComponent(a[0])}"]`
133
+ }), l.sort((u, m) => m[1] - u[1]).forEach((u) => {
134
+ const m = k.current?.querySelector(
135
+ `${T}[${L}="${encodeURIComponent(u[0])}"]`
136
136
  );
137
137
  m?.parentElement?.appendChild(m);
138
138
  });
139
139
  }
140
- function W() {
140
+ function H() {
141
141
  const l = V().find(
142
- (o) => o.getAttribute("aria-disabled") !== "true" && o.getAttribute("data-value") !== ye
142
+ (o) => o.getAttribute("aria-disabled") !== "true" && o.getAttribute("data-value") !== ke
143
143
  )?.getAttribute(L);
144
144
  E.setState("value", l || void 0);
145
145
  }
146
- function J() {
146
+ function W() {
147
147
  if (!v.current.search || // Explicitly false, because true | undefined is the default
148
148
  s.current.shouldFilter === !1) {
149
149
  v.current.filtered.count = r.current.size;
@@ -152,12 +152,12 @@ const T = '[cmdk-group=""]', Y = '[cmdk-group-items=""]', xe = '[cmdk-group-head
152
152
  v.current.filtered.groups = /* @__PURE__ */ new Set();
153
153
  let e = 0;
154
154
  for (const l of r.current) {
155
- const o = u.current.get(l)?.value ?? "", a = u.current.get(l)?.keywords ?? [], m = ne(o, a);
155
+ const o = a.current.get(l)?.value ?? "", u = a.current.get(l)?.keywords ?? [], m = re(o, u);
156
156
  v.current.filtered.items.set(l, m), m > 0 && e++;
157
157
  }
158
158
  for (const [l, o] of i.current)
159
- for (const a of o) {
160
- const m = v.current.filtered.items.get(a);
159
+ for (const u of o) {
160
+ const m = v.current.filtered.items.get(u);
161
161
  if (m && m > 0) {
162
162
  v.current.filtered.groups.add(l);
163
163
  break;
@@ -165,70 +165,70 @@ const T = '[cmdk-group=""]', Y = '[cmdk-group-items=""]', xe = '[cmdk-group-head
165
165
  }
166
166
  v.current.filtered.count = e;
167
167
  }
168
- function oe() {
169
- const e = k();
170
- e && (e.parentElement?.firstChild === e && e.closest(T)?.querySelector(xe)?.scrollIntoView({ block: "nearest" }), e.scrollIntoView({ block: "nearest" }));
168
+ function ne() {
169
+ const e = x();
170
+ e && (e.parentElement?.firstChild === e && e.closest(T)?.querySelector(_e)?.scrollIntoView({ block: "nearest" }), e.scrollIntoView({ block: "nearest" }));
171
171
  }
172
- function k() {
173
- return x.current?.querySelector(`${de}[aria-selected="true"]`);
172
+ function x() {
173
+ return k.current?.querySelector(`${ae}[aria-selected="true"]`);
174
174
  }
175
175
  function V() {
176
- return Array.from(x.current?.querySelectorAll(ue) || []);
176
+ return Array.from(k.current?.querySelectorAll(ue) || []);
177
177
  }
178
- function ce(e) {
178
+ function oe(e) {
179
179
  const o = V()[e];
180
180
  o && E.setState("value", o.getAttribute(L));
181
181
  }
182
- function Q(e) {
183
- const l = k(), o = V(), a = o.findIndex((b) => b === l);
184
- let m = o[a + e];
185
- s.current?.loop && (m = a + e < 0 ? o[o.length - 1] : a + e === o.length ? o[0] : o[a + e]), m && E.setState("value", m.getAttribute(L));
182
+ function J(e) {
183
+ const l = x(), o = V(), u = o.findIndex((b) => b === l);
184
+ let m = o[u + e];
185
+ s.current?.loop && (m = u + e < 0 ? o[o.length - 1] : u + e === o.length ? o[0] : o[u + e]), m && E.setState("value", m.getAttribute(L));
186
186
  }
187
- function se(e) {
188
- let o = k()?.closest(T), a;
189
- for (; o && !a; )
190
- o = e > 0 ? Oe(o, T) : De(o, T), a = o?.querySelector(ue);
191
- a ? E.setState("value", a.getAttribute(L)) : Q(e);
187
+ function ce(e) {
188
+ let o = x()?.closest(T), u;
189
+ for (; o && !u; )
190
+ o = e > 0 ? Ke(o, T) : Be(o, T), u = o?.querySelector(ue);
191
+ u ? E.setState("value", u.getAttribute(L)) : J(e);
192
192
  }
193
- const be = () => ce(V().length - 1), ie = (e) => {
194
- e.preventDefault(), e.metaKey ? be() : e.altKey ? se(1) : Q(1);
195
- }, le = (e) => {
196
- e.preventDefault(), e.metaKey ? ce(0) : e.altKey ? se(-1) : Q(-1);
193
+ const pe = () => oe(V().length - 1), se = (e) => {
194
+ e.preventDefault(), e.metaKey ? pe() : e.altKey ? ce(1) : J(1);
195
+ }, ie = (e) => {
196
+ e.preventDefault(), e.metaKey ? oe(0) : e.altKey ? ce(-1) : J(-1);
197
197
  };
198
- return /* @__PURE__ */ ee(
199
- I.div,
198
+ return /* @__PURE__ */ Z(
199
+ R.div,
200
200
  {
201
201
  ref: n,
202
202
  tabIndex: -1,
203
- ...U,
203
+ ...N,
204
204
  "cmdk-root": "",
205
205
  onKeyDown: (e) => {
206
- if (U.onKeyDown?.(e), !e.defaultPrevented)
206
+ if (N.onKeyDown?.(e), !e.defaultPrevented)
207
207
  switch (e.key) {
208
208
  case "n":
209
209
  case "j": {
210
- N && e.ctrlKey && ie(e);
210
+ B && e.ctrlKey && se(e);
211
211
  break;
212
212
  }
213
213
  case "ArrowDown": {
214
- ie(e);
214
+ se(e);
215
215
  break;
216
216
  }
217
217
  case "p":
218
218
  case "k": {
219
- N && e.ctrlKey && le(e);
219
+ B && e.ctrlKey && ie(e);
220
220
  break;
221
221
  }
222
222
  case "ArrowUp": {
223
- le(e);
223
+ ie(e);
224
224
  break;
225
225
  }
226
226
  case "Enter":
227
227
  if (!e.nativeEvent.isComposing && e.keyCode !== 229) {
228
228
  e.preventDefault();
229
- const l = k();
229
+ const l = x();
230
230
  if (l) {
231
- const o = new Event(Z);
231
+ const o = new Event(Y);
232
232
  l.dispatchEvent(o);
233
233
  }
234
234
  }
@@ -242,34 +242,34 @@ const T = '[cmdk-group=""]', Y = '[cmdk-group-items=""]', xe = '[cmdk-group-head
242
242
  "label",
243
243
  {
244
244
  "cmdk-label": "",
245
- htmlFor: z.inputId,
246
- id: z.labelId,
247
- style: Be,
245
+ htmlFor: q.inputId,
246
+ id: q.labelId,
247
+ style: $e,
248
248
  children: h
249
249
  }
250
250
  ),
251
- B(t, (e) => /* @__PURE__ */ p(me.Provider, { value: E, children: /* @__PURE__ */ p(fe.Provider, { value: z, children: e }) }))
251
+ K(t, (e) => /* @__PURE__ */ p(fe.Provider, { value: E, children: /* @__PURE__ */ p(de.Provider, { value: q, children: e }) }))
252
252
  ]
253
253
  }
254
254
  );
255
- }), Ae = c.forwardRef((t, n) => {
256
- const { id: r } = t, i = c.useRef(null), u = c.useContext(he), f = D(), s = ge(t), h = s.current?.forceMount ?? u?.forceMount;
255
+ }), Me = c.forwardRef((t, n) => {
256
+ const { id: r } = t, i = c.useRef(null), a = c.useContext(me), f = D(), s = ve(t), h = s.current?.forceMount ?? a?.forceMount;
257
257
  A(() => {
258
258
  if (!h)
259
- return f.item(r, u?.id);
259
+ return f.item(r, a?.id);
260
260
  }, [h]);
261
- const d = pe(r, i, [t.value, t.children, i], t.keywords), S = te(), C = P((g) => g.value && g.value === d.current), y = P(
261
+ const d = ge(r, i, [t.value, t.children, i], t.keywords), S = ee(), C = P((g) => g.value && g.value === d.current), y = P(
262
262
  (g) => h || f.filter() === !1 ? !0 : g.search ? g.filtered.items.get(r) > 0 : !0
263
263
  );
264
264
  c.useEffect(() => {
265
265
  const g = i.current;
266
266
  if (!g || t.disabled) return;
267
- const G = () => R("keyboard");
268
- return g.addEventListener(Z, G), () => g.removeEventListener(Z, G);
267
+ const G = () => I("keyboard");
268
+ return g.addEventListener(Y, G), () => g.removeEventListener(Y, G);
269
269
  }, [y, t.onSelect, t.disabled]);
270
- const w = ae(() => {
270
+ const w = le(() => {
271
271
  S.setState("value", d.current, !0);
272
- }, [S, d]), R = ae(
272
+ }, [S, d]), I = le(
273
273
  (g = "click") => {
274
274
  w(), s.current.onSelect?.({ value: d.current, trigger: g });
275
275
  },
@@ -278,18 +278,18 @@ const T = '[cmdk-group=""]', Y = '[cmdk-group-items=""]', xe = '[cmdk-group-head
278
278
  if (!y) return null;
279
279
  const {
280
280
  disabled: _,
281
- value: N,
282
- onSelect: re,
283
- forceMount: U,
281
+ value: B,
282
+ onSelect: te,
283
+ forceMount: N,
284
284
  keywords: v,
285
- onClick: $,
286
- ...j
287
- } = t, q = Ee(() => O([i, n]), [i, n]), x = Re($, R);
285
+ onClick: U,
286
+ ...$
287
+ } = t, j = ye(() => O([i, n]), [i, n]), k = xe(U, I);
288
288
  return /* @__PURE__ */ p(
289
- I.div,
289
+ R.div,
290
290
  {
291
- ref: q,
292
- ...j,
291
+ ref: j,
292
+ ...$,
293
293
  id: r,
294
294
  "cmdk-item": "",
295
295
  role: "option",
@@ -298,19 +298,19 @@ const T = '[cmdk-group=""]', Y = '[cmdk-group-items=""]', xe = '[cmdk-group-head
298
298
  "data-disabled": !!_,
299
299
  "data-selected": !!C,
300
300
  onPointerMove: _ || f.getDisablePointerSelection() ? void 0 : w,
301
- onClick: _ ? void 0 : x,
301
+ onClick: _ ? void 0 : k,
302
302
  onFocus: _ ? void 0 : w,
303
303
  children: t.children
304
304
  }
305
305
  );
306
- }), _e = c.forwardRef((t, n) => {
307
- const { heading: r, children: i, forceMount: u, ...f } = t, s = F(), h = c.useRef(null), d = c.useRef(null), S = F(), C = D(), y = P(
308
- (R) => u || C.filter() === !1 ? !0 : R.search ? R.filtered.groups.has(s) : !0
306
+ }), Pe = c.forwardRef((t, n) => {
307
+ const { heading: r, children: i, forceMount: a, ...f } = t, s = F(), h = c.useRef(null), d = c.useRef(null), S = F(), C = D(), y = P(
308
+ (I) => a || C.filter() === !1 ? !0 : I.search ? I.filtered.groups.has(s) : !0
309
309
  );
310
- A(() => C.group(s), []), pe(s, h, [t.value, t.heading, d]);
311
- const w = c.useMemo(() => ({ id: s, forceMount: u }), [u]);
312
- return /* @__PURE__ */ ee(
313
- I.div,
310
+ A(() => C.group(s), []), ge(s, h, [t.value, t.heading, d]);
311
+ const w = c.useMemo(() => ({ id: s, forceMount: a }), [a]);
312
+ return /* @__PURE__ */ Z(
313
+ R.div,
314
314
  {
315
315
  ref: O([h, n]),
316
316
  ...f,
@@ -319,30 +319,30 @@ const T = '[cmdk-group=""]', Y = '[cmdk-group-items=""]', xe = '[cmdk-group-head
319
319
  hidden: y ? void 0 : !0,
320
320
  children: [
321
321
  r && /* @__PURE__ */ p("div", { ref: d, "cmdk-group-heading": "", "aria-hidden": !0, id: S, children: r }),
322
- B(t, (R) => (
322
+ K(t, (I) => (
323
323
  // biome-ignore lint/a11y/useSemanticElements: <explanation>
324
- /* @__PURE__ */ p("div", { "cmdk-group-items": "", role: "group", "aria-labelledby": r ? S : void 0, children: /* @__PURE__ */ p(he.Provider, { value: w, children: R }) })
324
+ /* @__PURE__ */ p("div", { "cmdk-group-items": "", role: "group", "aria-labelledby": r ? S : void 0, children: /* @__PURE__ */ p(me.Provider, { value: w, children: I }) })
325
325
  ))
326
326
  ]
327
327
  }
328
328
  );
329
- }), Le = c.forwardRef((t, n) => {
330
- const { alwaysRender: r, ...i } = t, u = c.useRef(null), f = P((s) => !s.search);
329
+ }), Ve = c.forwardRef((t, n) => {
330
+ const { alwaysRender: r, ...i } = t, a = c.useRef(null), f = P((s) => !s.search);
331
331
  return !r && !f ? null : /* @__PURE__ */ p(
332
- I.div,
332
+ R.div,
333
333
  {
334
- ref: O([u, n]),
334
+ ref: O([a, n]),
335
335
  ...i,
336
336
  "cmdk-separator": "",
337
337
  role: "separator"
338
338
  }
339
339
  );
340
- }), Me = c.forwardRef((t, n) => {
341
- const { onValueChange: r, ...i } = t, u = t.value != null, f = te(), s = P((d) => d.search), h = D();
340
+ }), Te = c.forwardRef((t, n) => {
341
+ const { onValueChange: r, ...i } = t, a = t.value != null, f = ee(), s = P((d) => d.search), h = D();
342
342
  return c.useEffect(() => {
343
343
  t.value != null && f.setState("search", t.value);
344
344
  }, [t.value]), /* @__PURE__ */ p(
345
- I.input,
345
+ R.input,
346
346
  {
347
347
  ref: n,
348
348
  ...i,
@@ -357,14 +357,14 @@ const T = '[cmdk-group=""]', Y = '[cmdk-group-items=""]', xe = '[cmdk-group-head
357
357
  "aria-labelledby": h.labelId,
358
358
  id: h.inputId,
359
359
  type: "text",
360
- value: u ? t.value : s,
360
+ value: a ? t.value : s,
361
361
  onChange: (d) => {
362
- u || f.setState("search", d.target.value), r?.(d.target.value);
362
+ a || f.setState("search", d.target.value), r?.(d.target.value);
363
363
  }
364
364
  }
365
365
  );
366
- }), Pe = c.forwardRef((t, n) => {
367
- const { children: r, label: i = "Suggestions", ...u } = t, f = c.useRef(null), s = c.useRef(null), h = D();
366
+ }), Fe = c.forwardRef((t, n) => {
367
+ const { children: r, label: i = "Suggestions", ...a } = t, f = c.useRef(null), s = c.useRef(null), h = D();
368
368
  return c.useEffect(() => {
369
369
  if (s.current && f.current) {
370
370
  const d = s.current, S = f.current;
@@ -380,27 +380,27 @@ const T = '[cmdk-group=""]', Y = '[cmdk-group-items=""]', xe = '[cmdk-group-head
380
380
  };
381
381
  }
382
382
  }, []), /* @__PURE__ */ p(
383
- I.div,
383
+ R.div,
384
384
  {
385
385
  ref: O([f, n]),
386
- ...u,
386
+ ...a,
387
387
  "cmdk-list": "",
388
388
  tabIndex: -1,
389
389
  "aria-label": i,
390
390
  id: h.listId,
391
- children: B(t, (d) => /* @__PURE__ */ p("div", { ref: O([s, h.listInnerRef]), "cmdk-list-sizer": "", children: d }))
391
+ children: K(t, (d) => /* @__PURE__ */ p("div", { ref: O([s, h.listInnerRef]), "cmdk-list-sizer": "", children: d }))
392
392
  }
393
393
  );
394
- }), Ve = c.forwardRef((t, n) => {
395
- const { open: r, onOpenChange: i, overlayClassName: u, contentClassName: f, container: s, ...h } = t;
396
- return /* @__PURE__ */ p(K.Root, { open: r, onOpenChange: i, children: /* @__PURE__ */ ee(K.Portal, { container: s, children: [
397
- /* @__PURE__ */ p(K.Overlay, { "cmdk-overlay": "", className: u }),
398
- /* @__PURE__ */ p(K.Content, { "aria-label": t.label, "cmdk-dialog": "", className: f, children: /* @__PURE__ */ p(ve, { ref: n, ...h }) })
394
+ }), Oe = c.forwardRef((t, n) => {
395
+ const { open: r, onOpenChange: i, overlayClassName: a, contentClassName: f, container: s, ...h } = t;
396
+ return /* @__PURE__ */ p(Se, { open: r, onOpenChange: i, children: /* @__PURE__ */ Z(Ee, { container: s, children: [
397
+ /* @__PURE__ */ p(Ce, { "cmdk-overlay": "", className: a }),
398
+ /* @__PURE__ */ p(we, { "aria-label": t.label, "cmdk-dialog": "", className: f, children: /* @__PURE__ */ p(he, { ref: n, ...h }) })
399
399
  ] }) });
400
- }), Te = c.forwardRef((t, n) => P((i) => i.filtered.count === 0) ? /* @__PURE__ */ p(I.div, { ref: n, ...t, "cmdk-empty": "", role: "presentation" }) : null), Fe = c.forwardRef((t, n) => {
401
- const { progress: r, children: i, label: u = "Loading...", ...f } = t;
400
+ }), De = c.forwardRef((t, n) => P((i) => i.filtered.count === 0) ? /* @__PURE__ */ p(R.div, { ref: n, ...t, "cmdk-empty": "", role: "presentation" }) : null), Ge = c.forwardRef((t, n) => {
401
+ const { progress: r, children: i, label: a = "Loading...", ...f } = t;
402
402
  return /* @__PURE__ */ p(
403
- I.div,
403
+ R.div,
404
404
  {
405
405
  ref: n,
406
406
  ...f,
@@ -409,35 +409,35 @@ const T = '[cmdk-group=""]', Y = '[cmdk-group-items=""]', xe = '[cmdk-group-head
409
409
  "aria-valuenow": r,
410
410
  "aria-valuemin": 0,
411
411
  "aria-valuemax": 100,
412
- "aria-label": u,
413
- children: B(t, (s) => /* @__PURE__ */ p("div", { "aria-hidden": !0, children: s }))
412
+ "aria-label": a,
413
+ children: K(t, (s) => /* @__PURE__ */ p("div", { "aria-hidden": !0, children: s }))
414
414
  }
415
415
  );
416
- }), Qe = Object.assign(ve, {
417
- List: Pe,
418
- Item: Ae,
419
- Input: Me,
420
- Group: _e,
421
- Separator: Le,
422
- Dialog: Ve,
423
- Empty: Te,
424
- Loading: Fe
416
+ }), et = Object.assign(he, {
417
+ List: Fe,
418
+ Item: Me,
419
+ Input: Te,
420
+ Group: Pe,
421
+ Separator: Ve,
422
+ Dialog: Oe,
423
+ Empty: De,
424
+ Loading: Ge
425
425
  });
426
- function Oe(t, n) {
426
+ function Ke(t, n) {
427
427
  let r = t.nextElementSibling;
428
428
  for (; r; ) {
429
429
  if (r.matches(n)) return r;
430
430
  r = r.nextElementSibling;
431
431
  }
432
432
  }
433
- function De(t, n) {
433
+ function Be(t, n) {
434
434
  let r = t.previousElementSibling;
435
435
  for (; r; ) {
436
436
  if (r.matches(n)) return r;
437
437
  r = r.previousElementSibling;
438
438
  }
439
439
  }
440
- function ge(t) {
440
+ function ve(t) {
441
441
  const n = c.useRef(t);
442
442
  return A(() => {
443
443
  n.current = t;
@@ -456,44 +456,44 @@ function O(t) {
456
456
  };
457
457
  }
458
458
  function P(t) {
459
- const n = te(), r = () => t(n.snapshot());
460
- return we.useSyncExternalStore(n.subscribe, r, r);
459
+ const n = ee(), r = () => t(n.snapshot());
460
+ return Re.useSyncExternalStore(n.subscribe, r, r);
461
461
  }
462
- function pe(t, n, r, i = []) {
463
- const u = c.useRef(void 0), f = D();
462
+ function ge(t, n, r, i = []) {
463
+ const a = c.useRef(void 0), f = D();
464
464
  return A(() => {
465
465
  const s = (() => {
466
466
  for (const d of r) {
467
467
  if (typeof d == "string")
468
468
  return d.trim();
469
469
  if (typeof d == "object" && "current" in d)
470
- return d.current ? d.current.textContent?.trim() : u.current;
470
+ return d.current ? d.current.textContent?.trim() : a.current;
471
471
  }
472
472
  })(), h = i.map((d) => d.trim());
473
- f.value(t, s, h), n.current?.setAttribute(L, s), u.current = s;
474
- }), u;
473
+ f.value(t, s, h), n.current?.setAttribute(L, s), a.current = s;
474
+ }), a;
475
475
  }
476
- const Ge = () => {
476
+ const Ne = () => {
477
477
  const [t, n] = c.useState(), r = M(() => /* @__PURE__ */ new Map());
478
478
  return A(() => {
479
479
  r.current.forEach((i) => i()), r.current = /* @__PURE__ */ new Map();
480
- }, [t]), (i, u) => {
481
- r.current.set(i, u), n({});
480
+ }, [t]), (i, a) => {
481
+ r.current.set(i, a), n({});
482
482
  };
483
483
  };
484
- function Ke(t) {
484
+ function Ue(t) {
485
485
  const n = t.type;
486
486
  return typeof n == "function" ? n(t.props) : "render" in n ? n.render(t.props) : t;
487
487
  }
488
- function B({ asChild: t, children: n }, r) {
488
+ function K({ asChild: t, children: n }, r) {
489
489
  return t && c.isValidElement(n) ? c.cloneElement(
490
- Ke(n),
490
+ Ue(n),
491
491
  { ref: n.ref },
492
492
  // biome-ignore lint/suspicious/noExplicitAny: <explanation>
493
493
  r(n.props.children)
494
494
  ) : r(n);
495
495
  }
496
- const Be = {
496
+ const $e = {
497
497
  position: "absolute",
498
498
  width: "1px",
499
499
  height: "1px",
@@ -505,16 +505,16 @@ const Be = {
505
505
  borderWidth: "0"
506
506
  };
507
507
  export {
508
- Qe as Command,
509
- Ve as CommandDialog,
510
- Te as CommandEmpty,
511
- Me as CommandInput,
512
- Ae as CommandItem,
513
- Pe as CommandList,
514
- Fe as CommandLoading,
515
- ve as CommandRoot,
516
- Le as CommandSeparator,
517
- ke as defaultFilter,
508
+ et as Command,
509
+ Oe as CommandDialog,
510
+ De as CommandEmpty,
511
+ Te as CommandInput,
512
+ Me as CommandItem,
513
+ Fe as CommandList,
514
+ Ge as CommandLoading,
515
+ he as CommandRoot,
516
+ Ve as CommandSeparator,
517
+ Le as defaultFilter,
518
518
  P as useCommandState,
519
- te as useCommandStore
519
+ ee as useCommandStore
520
520
  };