zudoku 0.25.1 → 0.25.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 (142) hide show
  1. package/dist/app/demo.js +0 -1
  2. package/dist/app/demo.js.map +1 -1
  3. package/dist/app/standalone.js +0 -1
  4. package/dist/app/standalone.js.map +1 -1
  5. package/dist/config/validators/InputSidebarSchema.d.ts +2 -2
  6. package/dist/config/validators/validate.d.ts +4 -4
  7. package/dist/lib/authentication/providers/openid.js +1 -1
  8. package/dist/lib/authentication/providers/openid.js.map +1 -1
  9. package/dist/lib/oas/graphql/index.d.ts +3 -0
  10. package/dist/lib/oas/graphql/index.js +12 -13
  11. package/dist/lib/oas/graphql/index.js.map +1 -1
  12. package/dist/lib/plugins/openapi/ColorizedParam.d.ts +10 -2
  13. package/dist/lib/plugins/openapi/ColorizedParam.js +16 -7
  14. package/dist/lib/plugins/openapi/ColorizedParam.js.map +1 -1
  15. package/dist/lib/plugins/openapi/ParameterListItem.js +3 -2
  16. package/dist/lib/plugins/openapi/ParameterListItem.js.map +1 -1
  17. package/dist/lib/plugins/openapi/PlaygroundDialogWrapper.js +2 -0
  18. package/dist/lib/plugins/openapi/PlaygroundDialogWrapper.js.map +1 -1
  19. package/dist/lib/plugins/openapi/RequestBodySidecarBox.d.ts +1 -1
  20. package/dist/lib/plugins/openapi/RequestBodySidecarBox.js +2 -5
  21. package/dist/lib/plugins/openapi/RequestBodySidecarBox.js.map +1 -1
  22. package/dist/lib/plugins/openapi/ResponsesSidecarBox.js +2 -6
  23. package/dist/lib/plugins/openapi/ResponsesSidecarBox.js.map +1 -1
  24. package/dist/lib/plugins/openapi/{ExampleDisplay.d.ts → SidecarExamples.d.ts} +2 -6
  25. package/dist/lib/plugins/openapi/SidecarExamples.js +62 -0
  26. package/dist/lib/plugins/openapi/SidecarExamples.js.map +1 -0
  27. package/dist/lib/plugins/openapi/client/GraphQLClient.d.ts +1 -1
  28. package/dist/lib/plugins/openapi/client/GraphQLClient.js +22 -93
  29. package/dist/lib/plugins/openapi/client/GraphQLClient.js.map +1 -1
  30. package/dist/lib/plugins/openapi/client/createServer.d.ts +2 -1
  31. package/dist/lib/plugins/openapi/client/createServer.js +5 -2
  32. package/dist/lib/plugins/openapi/client/createServer.js.map +1 -1
  33. package/dist/lib/plugins/openapi/client/useCreateQuery.d.ts +1 -1
  34. package/dist/lib/plugins/openapi/client/useCreateQuery.js +2 -13
  35. package/dist/lib/plugins/openapi/client/useCreateQuery.js.map +1 -1
  36. package/dist/lib/plugins/openapi/index.d.ts +2 -1
  37. package/dist/lib/plugins/openapi/index.js.map +1 -1
  38. package/dist/lib/plugins/openapi/playground/EnumSelector.d.ts +8 -0
  39. package/dist/lib/plugins/openapi/playground/EnumSelector.js +21 -0
  40. package/dist/lib/plugins/openapi/playground/EnumSelector.js.map +1 -0
  41. package/dist/lib/plugins/openapi/playground/PathParams.js +9 -4
  42. package/dist/lib/plugins/openapi/playground/PathParams.js.map +1 -1
  43. package/dist/lib/plugins/openapi/playground/Playground.d.ts +3 -0
  44. package/dist/lib/plugins/openapi/playground/Playground.js +5 -2
  45. package/dist/lib/plugins/openapi/playground/Playground.js.map +1 -1
  46. package/dist/lib/plugins/openapi/playground/QueryParams.js +23 -8
  47. package/dist/lib/plugins/openapi/playground/QueryParams.js.map +1 -1
  48. package/dist/lib/plugins/openapi/schema/SchemaComponents.js +2 -1
  49. package/dist/lib/plugins/openapi/schema/SchemaComponents.js.map +1 -1
  50. package/dist/lib/plugins/openapi/util/generateSchemaExample.js +19 -11
  51. package/dist/lib/plugins/openapi/util/generateSchemaExample.js.map +1 -1
  52. package/dist/lib/ui/Badge.js +1 -1
  53. package/dist/lib/ui/Badge.js.map +1 -1
  54. package/dist/lib/ui/Button.d.ts +1 -1
  55. package/dist/lib/ui/Checkbox.d.ts +8 -2
  56. package/dist/lib/ui/Checkbox.js +13 -1
  57. package/dist/lib/ui/Checkbox.js.map +1 -1
  58. package/dist/lib/util/traverse.d.ts +8 -1
  59. package/dist/lib/util/traverse.js +7 -3
  60. package/dist/lib/util/traverse.js.map +1 -1
  61. package/dist/vite/api/schema-codegen.d.ts +12 -0
  62. package/dist/vite/api/schema-codegen.js +62 -0
  63. package/dist/vite/api/schema-codegen.js.map +1 -0
  64. package/dist/vite/api/schema-codegen.test.d.ts +1 -0
  65. package/dist/vite/api/schema-codegen.test.js +247 -0
  66. package/dist/vite/api/schema-codegen.test.js.map +1 -0
  67. package/dist/vite/config.js +0 -7
  68. package/dist/vite/config.js.map +1 -1
  69. package/dist/vite/plugin-api.js +110 -82
  70. package/dist/vite/plugin-api.js.map +1 -1
  71. package/dist/vite/plugin-component.js +0 -1
  72. package/dist/vite/plugin-component.js.map +1 -1
  73. package/lib/Command-9x_kZHr4.js +611 -0
  74. package/lib/Command-9x_kZHr4.js.map +1 -0
  75. package/lib/{OperationList-BLdHAQ39.js → OperationList-B8bHMKme.js} +1440 -1434
  76. package/lib/OperationList-B8bHMKme.js.map +1 -0
  77. package/lib/{createServer-Bf5_6o6G.js → createServer-BznDkeSA.js} +4227 -5154
  78. package/lib/createServer-BznDkeSA.js.map +1 -0
  79. package/lib/index-TaRXY2w1.js +43 -0
  80. package/lib/index-TaRXY2w1.js.map +1 -0
  81. package/lib/index-sD8L1_Dl.js +1292 -0
  82. package/lib/index-sD8L1_Dl.js.map +1 -0
  83. package/lib/post-processors/traverse.js +11 -8
  84. package/lib/post-processors/traverse.js.map +1 -1
  85. package/lib/ui/Badge.js +1 -1
  86. package/lib/ui/Badge.js.map +1 -1
  87. package/lib/ui/Checkbox.js +25 -14
  88. package/lib/ui/Checkbox.js.map +1 -1
  89. package/lib/ui/Command.js +14 -550
  90. package/lib/ui/Command.js.map +1 -1
  91. package/lib/zudoku.auth-openid.js +36 -36
  92. package/lib/zudoku.auth-openid.js.map +1 -1
  93. package/lib/zudoku.plugin-openapi.js +1 -1
  94. package/package.json +1 -6
  95. package/src/app/demo.tsx +0 -1
  96. package/src/app/standalone.tsx +0 -1
  97. package/src/lib/authentication/providers/openid.tsx +1 -1
  98. package/src/lib/oas/graphql/index.ts +19 -15
  99. package/src/lib/plugins/openapi/ColorizedParam.tsx +29 -12
  100. package/src/lib/plugins/openapi/ParameterListItem.tsx +9 -7
  101. package/src/lib/plugins/openapi/PlaygroundDialogWrapper.tsx +2 -0
  102. package/src/lib/plugins/openapi/RequestBodySidecarBox.tsx +2 -7
  103. package/src/lib/plugins/openapi/ResponsesSidecarBox.tsx +5 -8
  104. package/src/lib/plugins/openapi/SidecarExamples.tsx +155 -0
  105. package/src/lib/plugins/openapi/client/GraphQLClient.tsx +28 -120
  106. package/src/lib/plugins/openapi/client/createServer.ts +6 -2
  107. package/src/lib/plugins/openapi/client/useCreateQuery.ts +2 -17
  108. package/src/lib/plugins/openapi/index.tsx +2 -1
  109. package/src/lib/plugins/openapi/playground/EnumSelector.tsx +86 -0
  110. package/src/lib/plugins/openapi/playground/PathParams.tsx +72 -64
  111. package/src/lib/plugins/openapi/playground/Playground.tsx +26 -13
  112. package/src/lib/plugins/openapi/playground/QueryParams.tsx +102 -73
  113. package/src/lib/plugins/openapi/schema/SchemaComponents.tsx +4 -7
  114. package/src/lib/plugins/openapi/util/generateSchemaExample.ts +26 -11
  115. package/src/lib/ui/Badge.tsx +1 -1
  116. package/src/lib/ui/Checkbox.tsx +24 -7
  117. package/src/lib/util/traverse.ts +15 -5
  118. package/dist/lib/plugins/openapi/ExampleDisplay.js +0 -78
  119. package/dist/lib/plugins/openapi/ExampleDisplay.js.map +0 -1
  120. package/dist/lib/plugins/openapi/client/worker.d.ts +0 -4
  121. package/dist/lib/plugins/openapi/client/worker.js +0 -29
  122. package/dist/lib/plugins/openapi/client/worker.js.map +0 -1
  123. package/dist/lib/plugins/openapi-worker.d.ts +0 -1
  124. package/dist/lib/plugins/openapi-worker.js +0 -8
  125. package/dist/lib/plugins/openapi-worker.js.map +0 -1
  126. package/lib/Dialog-Bxv1yEIg.js +0 -67
  127. package/lib/Dialog-Bxv1yEIg.js.map +0 -1
  128. package/lib/OperationList-BLdHAQ39.js.map +0 -1
  129. package/lib/assets/index-C7jnHK4b.js +0 -4841
  130. package/lib/assets/index-C7jnHK4b.js.map +0 -1
  131. package/lib/assets/worker-Cbp2r2BQ.js +0 -18592
  132. package/lib/assets/worker-Cbp2r2BQ.js.map +0 -1
  133. package/lib/createServer-Bf5_6o6G.js.map +0 -1
  134. package/lib/index-BNx95gkf.js +0 -1284
  135. package/lib/index-BNx95gkf.js.map +0 -1
  136. package/lib/index-DyBL--Kz.js +0 -826
  137. package/lib/index-DyBL--Kz.js.map +0 -1
  138. package/lib/zudoku.openapi-worker.js +0 -15
  139. package/lib/zudoku.openapi-worker.js.map +0 -1
  140. package/src/lib/plugins/openapi/ExampleDisplay.tsx +0 -163
  141. package/src/lib/plugins/openapi/client/worker.ts +0 -44
  142. package/src/lib/plugins/openapi-worker.ts +0 -11
@@ -0,0 +1,611 @@
1
+ import { j as w } from "./jsx-runtime-Dx-03ztt.js";
2
+ import * as C from "@radix-ui/react-dialog";
3
+ import * as a from "react";
4
+ import _e from "react";
5
+ import { Primitive as M } from "@radix-ui/react-primitive";
6
+ import { useId as F } from "@radix-ui/react-id";
7
+ import { X as Te, Search as Me } from "lucide-react";
8
+ import { c as L } from "./cn-qaFjX9_3.js";
9
+ const $e = C.Root, Nt = C.Trigger, Ve = C.Portal, ke = a.forwardRef(({ className: e, ...r }, t) => /* @__PURE__ */ w.jsx(
10
+ C.Overlay,
11
+ {
12
+ ref: t,
13
+ className: L(
14
+ "fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",
15
+ e
16
+ ),
17
+ ...r
18
+ }
19
+ ));
20
+ ke.displayName = C.Overlay.displayName;
21
+ const Re = a.forwardRef(({ className: e, children: r, ...t }, f) => /* @__PURE__ */ w.jsxs(Ve, { children: [
22
+ /* @__PURE__ */ w.jsx(ke, {}),
23
+ /* @__PURE__ */ w.jsxs(
24
+ C.Content,
25
+ {
26
+ ref: f,
27
+ className: L(
28
+ "fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",
29
+ e
30
+ ),
31
+ ...t,
32
+ children: [
33
+ r,
34
+ /* @__PURE__ */ w.jsxs(C.Close, { className: "absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground", children: [
35
+ /* @__PURE__ */ w.jsx(Te, { className: "h-4 w-4" }),
36
+ /* @__PURE__ */ w.jsx("span", { className: "sr-only", children: "Close" })
37
+ ] })
38
+ ]
39
+ }
40
+ )
41
+ ] }));
42
+ Re.displayName = C.Content.displayName;
43
+ const Ke = a.forwardRef(({ className: e, ...r }, t) => /* @__PURE__ */ w.jsx(
44
+ C.Title,
45
+ {
46
+ ref: t,
47
+ className: L(
48
+ "text-lg font-semibold leading-none tracking-tight",
49
+ e
50
+ ),
51
+ ...r
52
+ }
53
+ ));
54
+ Ke.displayName = C.Title.displayName;
55
+ const qe = a.forwardRef(({ className: e, ...r }, t) => /* @__PURE__ */ w.jsx(
56
+ C.Description,
57
+ {
58
+ ref: t,
59
+ className: L("text-sm text-muted-foreground", e),
60
+ ...r
61
+ }
62
+ ));
63
+ qe.displayName = C.Description.displayName;
64
+ var ye = 1, Ue = 0.9, Ge = 0.8, Pe = 0.17, ae = 0.1, oe = 0.999, Fe = 0.9999, Be = 0.99, He = /[\\\/_+.#"@\[\(\{&]/, ze = /[\\\/_+.#"@\[\(\{&]/g, We = /[\s-]/, Ce = /[\s-]/g;
65
+ function se(e, r, t, f, o, u, c) {
66
+ if (u === r.length) return o === e.length ? ye : Be;
67
+ var v = `${o},${u}`;
68
+ if (c[v] !== void 0) return c[v];
69
+ for (var h = f.charAt(u), m = t.indexOf(h, o), s = 0, i, y, x, N; m >= 0; ) i = se(e, r, t, f, m + 1, u + 1, c), i > s && (m === o ? i *= ye : He.test(e.charAt(m - 1)) ? (i *= Ge, x = e.slice(o, m - 1).match(ze), x && o > 0 && (i *= Math.pow(oe, x.length))) : We.test(e.charAt(m - 1)) ? (i *= Ue, N = e.slice(o, m - 1).match(Ce), N && o > 0 && (i *= Math.pow(oe, N.length))) : (i *= Pe, o > 0 && (i *= Math.pow(oe, m - o))), e.charAt(m) !== r.charAt(u) && (i *= Fe)), (i < ae && t.charAt(m - 1) === f.charAt(u + 1) || f.charAt(u + 1) === f.charAt(u) && t.charAt(m - 1) !== f.charAt(u)) && (y = se(e, r, t, f, m + 1, u + 2, c), y * ae > i && (i = y * ae)), i > s && (s = i), m = t.indexOf(h, m + 1);
70
+ return c[v] = s, s;
71
+ }
72
+ function Se(e) {
73
+ return e.toLowerCase().replace(Ce, " ");
74
+ }
75
+ function Xe(e, r, t) {
76
+ return e = t && t.length > 0 ? `${e + " " + t.join(" ")}` : e, se(e, r, Se(e), Se(r), 0, 0, {});
77
+ }
78
+ var Z = { exports: {} }, le = {};
79
+ /**
80
+ * @license React
81
+ * use-sync-external-store-shim.production.min.js
82
+ *
83
+ * Copyright (c) Facebook, Inc. and its affiliates.
84
+ *
85
+ * This source code is licensed under the MIT license found in the
86
+ * LICENSE file in the root directory of this source tree.
87
+ */
88
+ var xe;
89
+ function Ye() {
90
+ if (xe) return le;
91
+ xe = 1;
92
+ var e = _e;
93
+ function r(i, y) {
94
+ return i === y && (i !== 0 || 1 / i === 1 / y) || i !== i && y !== y;
95
+ }
96
+ var t = typeof Object.is == "function" ? Object.is : r, f = e.useState, o = e.useEffect, u = e.useLayoutEffect, c = e.useDebugValue;
97
+ function v(i, y) {
98
+ var x = y(), N = f({ inst: { value: x, getSnapshot: y } }), O = N[0].inst, I = N[1];
99
+ return u(function() {
100
+ O.value = x, O.getSnapshot = y, h(O) && I({ inst: O });
101
+ }, [i, x, y]), o(function() {
102
+ return h(O) && I({ inst: O }), i(function() {
103
+ h(O) && I({ inst: O });
104
+ });
105
+ }, [i]), c(x), x;
106
+ }
107
+ function h(i) {
108
+ var y = i.getSnapshot;
109
+ i = i.value;
110
+ try {
111
+ var x = y();
112
+ return !t(i, x);
113
+ } catch {
114
+ return !0;
115
+ }
116
+ }
117
+ function m(i, y) {
118
+ return y();
119
+ }
120
+ var s = typeof window > "u" || typeof window.document > "u" || typeof window.document.createElement > "u" ? m : v;
121
+ return le.useSyncExternalStore = e.useSyncExternalStore !== void 0 ? e.useSyncExternalStore : s, le;
122
+ }
123
+ var ie = {};
124
+ /**
125
+ * @license React
126
+ * use-sync-external-store-shim.development.js
127
+ *
128
+ * Copyright (c) Facebook, Inc. and its affiliates.
129
+ *
130
+ * This source code is licensed under the MIT license found in the
131
+ * LICENSE file in the root directory of this source tree.
132
+ */
133
+ var be;
134
+ function Je() {
135
+ return be || (be = 1, process.env.NODE_ENV !== "production" && function() {
136
+ typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ < "u" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart == "function" && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error());
137
+ var e = _e, r = e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
138
+ function t(_) {
139
+ {
140
+ for (var b = arguments.length, R = new Array(b > 1 ? b - 1 : 0), p = 1; p < b; p++)
141
+ R[p - 1] = arguments[p];
142
+ f("error", _, R);
143
+ }
144
+ }
145
+ function f(_, b, R) {
146
+ {
147
+ var p = r.ReactDebugCurrentFrame, k = p.getStackAddendum();
148
+ k !== "" && (b += "%s", R = R.concat([k]));
149
+ var T = R.map(function(j) {
150
+ return String(j);
151
+ });
152
+ T.unshift("Warning: " + b), Function.prototype.apply.call(console[_], console, T);
153
+ }
154
+ }
155
+ function o(_, b) {
156
+ return _ === b && (_ !== 0 || 1 / _ === 1 / b) || _ !== _ && b !== b;
157
+ }
158
+ var u = typeof Object.is == "function" ? Object.is : o, c = e.useState, v = e.useEffect, h = e.useLayoutEffect, m = e.useDebugValue, s = !1, i = !1;
159
+ function y(_, b, R) {
160
+ s || e.startTransition !== void 0 && (s = !0, t("You are using an outdated, pre-release alpha of React 18 that does not support useSyncExternalStore. The use-sync-external-store shim will not work correctly. Upgrade to a newer pre-release."));
161
+ var p = b();
162
+ if (!i) {
163
+ var k = b();
164
+ u(p, k) || (t("The result of getSnapshot should be cached to avoid an infinite loop"), i = !0);
165
+ }
166
+ var T = c({
167
+ inst: {
168
+ value: p,
169
+ getSnapshot: b
170
+ }
171
+ }), j = T[0].inst, $ = T[1];
172
+ return h(function() {
173
+ j.value = p, j.getSnapshot = b, x(j) && $({
174
+ inst: j
175
+ });
176
+ }, [_, p, b]), v(function() {
177
+ x(j) && $({
178
+ inst: j
179
+ });
180
+ var B = function() {
181
+ x(j) && $({
182
+ inst: j
183
+ });
184
+ };
185
+ return _(B);
186
+ }, [_]), m(p), p;
187
+ }
188
+ function x(_) {
189
+ var b = _.getSnapshot, R = _.value;
190
+ try {
191
+ var p = b();
192
+ return !u(R, p);
193
+ } catch {
194
+ return !0;
195
+ }
196
+ }
197
+ function N(_, b, R) {
198
+ return b();
199
+ }
200
+ var O = typeof window < "u" && typeof window.document < "u" && typeof window.document.createElement < "u", I = !O, G = I ? N : y, J = e.useSyncExternalStore !== void 0 ? e.useSyncExternalStore : G;
201
+ ie.useSyncExternalStore = J, typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ < "u" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop == "function" && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error());
202
+ }()), ie;
203
+ }
204
+ var Ee;
205
+ function Qe() {
206
+ return Ee || (Ee = 1, process.env.NODE_ENV === "production" ? Z.exports = Ye() : Z.exports = Je()), Z.exports;
207
+ }
208
+ var Ze = Qe(), W = '[cmdk-group=""]', ue = '[cmdk-group-items=""]', et = '[cmdk-group-heading=""]', ce = '[cmdk-item=""]', we = `${ce}:not([aria-disabled="true"])`, de = "cmdk-item-select", K = "data-value", tt = (e, r, t) => Xe(e, r, t), Ne = a.createContext(void 0), Y = () => a.useContext(Ne), Oe = a.createContext(void 0), fe = () => a.useContext(Oe), De = a.createContext(void 0), Ie = a.forwardRef((e, r) => {
209
+ let t = P(() => {
210
+ var n, d;
211
+ return { search: "", value: (d = (n = e.value) != null ? n : e.defaultValue) != null ? d : "", filtered: { count: 0, items: /* @__PURE__ */ new Map(), groups: /* @__PURE__ */ new Set() } };
212
+ }), f = P(() => /* @__PURE__ */ new Set()), o = P(() => /* @__PURE__ */ new Map()), u = P(() => /* @__PURE__ */ new Map()), c = P(() => /* @__PURE__ */ new Set()), v = je(e), { label: h, children: m, value: s, onValueChange: i, filter: y, shouldFilter: x, loop: N, disablePointerSelection: O = !1, vimBindings: I = !0, ...G } = e, J = F(), _ = F(), b = F(), R = a.useRef(null), p = ft();
213
+ q(() => {
214
+ if (s !== void 0) {
215
+ let n = s.trim();
216
+ t.current.value = n, k.emit();
217
+ }
218
+ }, [s]), q(() => {
219
+ p(6, me);
220
+ }, []);
221
+ let k = a.useMemo(() => ({ subscribe: (n) => (c.current.add(n), () => c.current.delete(n)), snapshot: () => t.current, setState: (n, d, g) => {
222
+ var l, S, E;
223
+ if (!Object.is(t.current[n], d)) {
224
+ if (t.current[n] = d, n === "search") te(), $(), p(1, B);
225
+ else if (n === "value" && (g || p(5, me), ((l = v.current) == null ? void 0 : l.value) !== void 0)) {
226
+ let A = d ?? "";
227
+ (E = (S = v.current).onValueChange) == null || E.call(S, A);
228
+ return;
229
+ }
230
+ k.emit();
231
+ }
232
+ }, emit: () => {
233
+ c.current.forEach((n) => n());
234
+ } }), []), T = a.useMemo(() => ({ value: (n, d, g) => {
235
+ var l;
236
+ d !== ((l = u.current.get(n)) == null ? void 0 : l.value) && (u.current.set(n, { value: d, keywords: g }), t.current.filtered.items.set(n, j(d, g)), p(2, () => {
237
+ $(), k.emit();
238
+ }));
239
+ }, item: (n, d) => (f.current.add(n), d && (o.current.has(d) ? o.current.get(d).add(n) : o.current.set(d, /* @__PURE__ */ new Set([n]))), p(3, () => {
240
+ te(), $(), t.current.value || B(), k.emit();
241
+ }), () => {
242
+ u.current.delete(n), f.current.delete(n), t.current.filtered.items.delete(n);
243
+ let g = H();
244
+ p(4, () => {
245
+ te(), (g == null ? void 0 : g.getAttribute("id")) === n && B(), k.emit();
246
+ });
247
+ }), group: (n) => (o.current.has(n) || o.current.set(n, /* @__PURE__ */ new Set()), () => {
248
+ u.current.delete(n), o.current.delete(n);
249
+ }), filter: () => v.current.shouldFilter, label: h || e["aria-label"], getDisablePointerSelection: () => v.current.disablePointerSelection, listId: J, inputId: b, labelId: _, listInnerRef: R }), []);
250
+ function j(n, d) {
251
+ var g, l;
252
+ let S = (l = (g = v.current) == null ? void 0 : g.filter) != null ? l : tt;
253
+ return n ? S(n, t.current.search, d) : 0;
254
+ }
255
+ function $() {
256
+ if (!t.current.search || v.current.shouldFilter === !1) return;
257
+ let n = t.current.filtered.items, d = [];
258
+ t.current.filtered.groups.forEach((l) => {
259
+ let S = o.current.get(l), E = 0;
260
+ S.forEach((A) => {
261
+ let V = n.get(A);
262
+ E = Math.max(V, E);
263
+ }), d.push([l, E]);
264
+ });
265
+ let g = R.current;
266
+ z().sort((l, S) => {
267
+ var E, A;
268
+ let V = l.getAttribute("id"), Q = S.getAttribute("id");
269
+ return ((E = n.get(Q)) != null ? E : 0) - ((A = n.get(V)) != null ? A : 0);
270
+ }).forEach((l) => {
271
+ let S = l.closest(ue);
272
+ S ? S.appendChild(l.parentElement === S ? l : l.closest(`${ue} > *`)) : g.appendChild(l.parentElement === g ? l : l.closest(`${ue} > *`));
273
+ }), d.sort((l, S) => S[1] - l[1]).forEach((l) => {
274
+ var S;
275
+ let E = (S = R.current) == null ? void 0 : S.querySelector(`${W}[${K}="${encodeURIComponent(l[0])}"]`);
276
+ E == null || E.parentElement.appendChild(E);
277
+ });
278
+ }
279
+ function B() {
280
+ let n = z().find((g) => g.getAttribute("aria-disabled") !== "true"), d = n == null ? void 0 : n.getAttribute(K);
281
+ k.setState("value", d || void 0);
282
+ }
283
+ function te() {
284
+ var n, d, g, l;
285
+ if (!t.current.search || v.current.shouldFilter === !1) {
286
+ t.current.filtered.count = f.current.size;
287
+ return;
288
+ }
289
+ t.current.filtered.groups = /* @__PURE__ */ new Set();
290
+ let S = 0;
291
+ for (let E of f.current) {
292
+ let A = (d = (n = u.current.get(E)) == null ? void 0 : n.value) != null ? d : "", V = (l = (g = u.current.get(E)) == null ? void 0 : g.keywords) != null ? l : [], Q = j(A, V);
293
+ t.current.filtered.items.set(E, Q), Q > 0 && S++;
294
+ }
295
+ for (let [E, A] of o.current) for (let V of A) if (t.current.filtered.items.get(V) > 0) {
296
+ t.current.filtered.groups.add(E);
297
+ break;
298
+ }
299
+ t.current.filtered.count = S;
300
+ }
301
+ function me() {
302
+ var n, d, g;
303
+ let l = H();
304
+ l && (((n = l.parentElement) == null ? void 0 : n.firstChild) === l && ((g = (d = l.closest(W)) == null ? void 0 : d.querySelector(et)) == null || g.scrollIntoView({ block: "nearest" })), l.scrollIntoView({ block: "nearest" }));
305
+ }
306
+ function H() {
307
+ var n;
308
+ return (n = R.current) == null ? void 0 : n.querySelector(`${ce}[aria-selected="true"]`);
309
+ }
310
+ function z() {
311
+ var n;
312
+ return Array.from(((n = R.current) == null ? void 0 : n.querySelectorAll(we)) || []);
313
+ }
314
+ function re(n) {
315
+ let d = z()[n];
316
+ d && k.setState("value", d.getAttribute(K));
317
+ }
318
+ function ne(n) {
319
+ var d;
320
+ let g = H(), l = z(), S = l.findIndex((A) => A === g), E = l[S + n];
321
+ (d = v.current) != null && d.loop && (E = S + n < 0 ? l[l.length - 1] : S + n === l.length ? l[0] : l[S + n]), E && k.setState("value", E.getAttribute(K));
322
+ }
323
+ function pe(n) {
324
+ let d = H(), g = d == null ? void 0 : d.closest(W), l;
325
+ for (; g && !l; ) g = n > 0 ? dt(g, W) : ct(g, W), l = g == null ? void 0 : g.querySelector(we);
326
+ l ? k.setState("value", l.getAttribute(K)) : ne(n);
327
+ }
328
+ let ve = () => re(z().length - 1), ge = (n) => {
329
+ n.preventDefault(), n.metaKey ? ve() : n.altKey ? pe(1) : ne(1);
330
+ }, he = (n) => {
331
+ n.preventDefault(), n.metaKey ? re(0) : n.altKey ? pe(-1) : ne(-1);
332
+ };
333
+ return a.createElement(M.div, { ref: r, tabIndex: -1, ...G, "cmdk-root": "", onKeyDown: (n) => {
334
+ var d;
335
+ if ((d = G.onKeyDown) == null || d.call(G, n), !n.defaultPrevented) switch (n.key) {
336
+ case "n":
337
+ case "j": {
338
+ I && n.ctrlKey && ge(n);
339
+ break;
340
+ }
341
+ case "ArrowDown": {
342
+ ge(n);
343
+ break;
344
+ }
345
+ case "p":
346
+ case "k": {
347
+ I && n.ctrlKey && he(n);
348
+ break;
349
+ }
350
+ case "ArrowUp": {
351
+ he(n);
352
+ break;
353
+ }
354
+ case "Home": {
355
+ n.preventDefault(), re(0);
356
+ break;
357
+ }
358
+ case "End": {
359
+ n.preventDefault(), ve();
360
+ break;
361
+ }
362
+ case "Enter":
363
+ if (!n.nativeEvent.isComposing && n.keyCode !== 229) {
364
+ n.preventDefault();
365
+ let g = H();
366
+ if (g) {
367
+ let l = new Event(de);
368
+ g.dispatchEvent(l);
369
+ }
370
+ }
371
+ }
372
+ } }, a.createElement("label", { "cmdk-label": "", htmlFor: T.inputId, id: T.labelId, style: pt }, h), ee(e, (n) => a.createElement(Oe.Provider, { value: k }, a.createElement(Ne.Provider, { value: T }, n))));
373
+ }), rt = a.forwardRef((e, r) => {
374
+ var t, f;
375
+ let o = F(), u = a.useRef(null), c = a.useContext(De), v = Y(), h = je(e), m = (f = (t = h.current) == null ? void 0 : t.forceMount) != null ? f : c == null ? void 0 : c.forceMount;
376
+ q(() => {
377
+ if (!m) return v.item(o, c == null ? void 0 : c.id);
378
+ }, [m]);
379
+ let s = Ae(o, u, [e.value, e.children, u], e.keywords), i = fe(), y = U((p) => p.value && p.value === s.current), x = U((p) => m || v.filter() === !1 ? !0 : p.search ? p.filtered.items.get(o) > 0 : !0);
380
+ a.useEffect(() => {
381
+ let p = u.current;
382
+ if (!(!p || e.disabled)) return p.addEventListener(de, N), () => p.removeEventListener(de, N);
383
+ }, [x, e.onSelect, e.disabled]);
384
+ function N() {
385
+ var p, k;
386
+ O(), (k = (p = h.current).onSelect) == null || k.call(p, s.current);
387
+ }
388
+ function O() {
389
+ i.setState("value", s.current, !0);
390
+ }
391
+ if (!x) return null;
392
+ let { disabled: I, value: G, onSelect: J, forceMount: _, keywords: b, ...R } = e;
393
+ return a.createElement(M.div, { ref: X([u, r]), ...R, id: o, "cmdk-item": "", role: "option", "aria-disabled": !!I, "aria-selected": !!y, "data-disabled": !!I, "data-selected": !!y, onPointerMove: I || v.getDisablePointerSelection() ? void 0 : O, onClick: I ? void 0 : N }, e.children);
394
+ }), nt = a.forwardRef((e, r) => {
395
+ let { heading: t, children: f, forceMount: o, ...u } = e, c = F(), v = a.useRef(null), h = a.useRef(null), m = F(), s = Y(), i = U((x) => o || s.filter() === !1 ? !0 : x.search ? x.filtered.groups.has(c) : !0);
396
+ q(() => s.group(c), []), Ae(c, v, [e.value, e.heading, h]);
397
+ let y = a.useMemo(() => ({ id: c, forceMount: o }), [o]);
398
+ return a.createElement(M.div, { ref: X([v, r]), ...u, "cmdk-group": "", role: "presentation", hidden: i ? void 0 : !0 }, t && a.createElement("div", { ref: h, "cmdk-group-heading": "", "aria-hidden": !0, id: m }, t), ee(e, (x) => a.createElement("div", { "cmdk-group-items": "", role: "group", "aria-labelledby": t ? m : void 0 }, a.createElement(De.Provider, { value: y }, x))));
399
+ }), at = a.forwardRef((e, r) => {
400
+ let { alwaysRender: t, ...f } = e, o = a.useRef(null), u = U((c) => !c.search);
401
+ return !t && !u ? null : a.createElement(M.div, { ref: X([o, r]), ...f, "cmdk-separator": "", role: "separator" });
402
+ }), ot = a.forwardRef((e, r) => {
403
+ let { onValueChange: t, ...f } = e, o = e.value != null, u = fe(), c = U((s) => s.search), v = U((s) => s.value), h = Y(), m = a.useMemo(() => {
404
+ var s;
405
+ let i = (s = h.listInnerRef.current) == null ? void 0 : s.querySelector(`${ce}[${K}="${encodeURIComponent(v)}"]`);
406
+ return i == null ? void 0 : i.getAttribute("id");
407
+ }, []);
408
+ return a.useEffect(() => {
409
+ e.value != null && u.setState("search", e.value);
410
+ }, [e.value]), a.createElement(M.input, { ref: r, ...f, "cmdk-input": "", autoComplete: "off", autoCorrect: "off", spellCheck: !1, "aria-autocomplete": "list", role: "combobox", "aria-expanded": !0, "aria-controls": h.listId, "aria-labelledby": h.labelId, "aria-activedescendant": m, id: h.inputId, type: "text", value: o ? e.value : c, onChange: (s) => {
411
+ o || u.setState("search", s.target.value), t == null || t(s.target.value);
412
+ } });
413
+ }), lt = a.forwardRef((e, r) => {
414
+ let { children: t, label: f = "Suggestions", ...o } = e, u = a.useRef(null), c = a.useRef(null), v = Y();
415
+ return a.useEffect(() => {
416
+ if (c.current && u.current) {
417
+ let h = c.current, m = u.current, s, i = new ResizeObserver(() => {
418
+ s = requestAnimationFrame(() => {
419
+ let y = h.offsetHeight;
420
+ m.style.setProperty("--cmdk-list-height", y.toFixed(1) + "px");
421
+ });
422
+ });
423
+ return i.observe(h), () => {
424
+ cancelAnimationFrame(s), i.unobserve(h);
425
+ };
426
+ }
427
+ }, []), a.createElement(M.div, { ref: X([u, r]), ...o, "cmdk-list": "", role: "listbox", "aria-label": f, id: v.listId }, ee(e, (h) => a.createElement("div", { ref: X([c, v.listInnerRef]), "cmdk-list-sizer": "" }, h)));
428
+ }), it = a.forwardRef((e, r) => {
429
+ let { open: t, onOpenChange: f, overlayClassName: o, contentClassName: u, container: c, ...v } = e;
430
+ return a.createElement(C.Root, { open: t, onOpenChange: f }, a.createElement(C.Portal, { container: c }, a.createElement(C.Overlay, { "cmdk-overlay": "", className: o }), a.createElement(C.Content, { "aria-label": e.label, "cmdk-dialog": "", className: u }, a.createElement(Ie, { ref: r, ...v }))));
431
+ }), ut = a.forwardRef((e, r) => U((t) => t.filtered.count === 0) ? a.createElement(M.div, { ref: r, ...e, "cmdk-empty": "", role: "presentation" }) : null), st = a.forwardRef((e, r) => {
432
+ let { progress: t, children: f, label: o = "Loading...", ...u } = e;
433
+ return a.createElement(M.div, { ref: r, ...u, "cmdk-loading": "", role: "progressbar", "aria-valuenow": t, "aria-valuemin": 0, "aria-valuemax": 100, "aria-label": o }, ee(e, (c) => a.createElement("div", { "aria-hidden": !0 }, c)));
434
+ }), D = Object.assign(Ie, { List: lt, Item: rt, Input: ot, Group: nt, Separator: at, Dialog: it, Empty: ut, Loading: st });
435
+ function dt(e, r) {
436
+ let t = e.nextElementSibling;
437
+ for (; t; ) {
438
+ if (t.matches(r)) return t;
439
+ t = t.nextElementSibling;
440
+ }
441
+ }
442
+ function ct(e, r) {
443
+ let t = e.previousElementSibling;
444
+ for (; t; ) {
445
+ if (t.matches(r)) return t;
446
+ t = t.previousElementSibling;
447
+ }
448
+ }
449
+ function je(e) {
450
+ let r = a.useRef(e);
451
+ return q(() => {
452
+ r.current = e;
453
+ }), r;
454
+ }
455
+ var q = typeof window > "u" ? a.useEffect : a.useLayoutEffect;
456
+ function P(e) {
457
+ let r = a.useRef();
458
+ return r.current === void 0 && (r.current = e()), r;
459
+ }
460
+ function X(e) {
461
+ return (r) => {
462
+ e.forEach((t) => {
463
+ typeof t == "function" ? t(r) : t != null && (t.current = r);
464
+ });
465
+ };
466
+ }
467
+ function U(e) {
468
+ let r = fe(), t = () => e(r.snapshot());
469
+ return Ze.useSyncExternalStore(r.subscribe, t, t);
470
+ }
471
+ function Ae(e, r, t, f = []) {
472
+ let o = a.useRef(), u = Y();
473
+ return q(() => {
474
+ var c;
475
+ let v = (() => {
476
+ var m;
477
+ for (let s of t) {
478
+ if (typeof s == "string") return s.trim();
479
+ if (typeof s == "object" && "current" in s) return s.current ? (m = s.current.textContent) == null ? void 0 : m.trim() : o.current;
480
+ }
481
+ })(), h = f.map((m) => m.trim());
482
+ u.value(e, v, h), (c = r.current) == null || c.setAttribute(K, v), o.current = v;
483
+ }), o;
484
+ }
485
+ var ft = () => {
486
+ let [e, r] = a.useState(), t = P(() => /* @__PURE__ */ new Map());
487
+ return q(() => {
488
+ t.current.forEach((f) => f()), t.current = /* @__PURE__ */ new Map();
489
+ }, [e]), (f, o) => {
490
+ t.current.set(f, o), r({});
491
+ };
492
+ };
493
+ function mt(e) {
494
+ let r = e.type;
495
+ return typeof r == "function" ? r(e.props) : "render" in r ? r.render(e.props) : e;
496
+ }
497
+ function ee({ asChild: e, children: r }, t) {
498
+ return e && a.isValidElement(r) ? a.cloneElement(mt(r), { ref: r.ref }, t(r.props.children)) : t(r);
499
+ }
500
+ var pt = { position: "absolute", width: "1px", height: "1px", padding: "0", margin: "-1px", overflow: "hidden", clip: "rect(0, 0, 0, 0)", whiteSpace: "nowrap", borderWidth: "0" };
501
+ const Le = a.forwardRef(({ className: e, ...r }, t) => /* @__PURE__ */ w.jsx(
502
+ D,
503
+ {
504
+ ref: t,
505
+ className: L(
506
+ "flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground",
507
+ e
508
+ ),
509
+ ...r
510
+ }
511
+ ));
512
+ Le.displayName = D.displayName;
513
+ const Ot = ({ children: e, ...r }) => /* @__PURE__ */ w.jsx($e, { ...r, children: /* @__PURE__ */ w.jsx(Re, { className: "overflow-hidden p-0 shadow-lg", children: /* @__PURE__ */ w.jsx(Le, { className: "[&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground [&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 [&_[cmdk-group]]:px-2 [&_[cmdk-input-wrapper]_svg]:h-5 [&_[cmdk-input-wrapper]_svg]:w-5 [&_[cmdk-input]]:h-12 [&_[cmdk-item]]:px-2 [&_[cmdk-item]]:py-3 [&_[cmdk-item]_svg]:h-5 [&_[cmdk-item]_svg]:w-5", children: e }) }) }), vt = a.forwardRef(({ className: e, ...r }, t) => (
514
+ // eslint-disable-next-line react/no-unknown-property
515
+ /* @__PURE__ */ w.jsxs("div", { className: "flex items-center border-b px-3", "cmdk-input-wrapper": "", children: [
516
+ /* @__PURE__ */ w.jsx(Me, { className: "mr-2 h-4 w-4 shrink-0 opacity-50" }),
517
+ /* @__PURE__ */ w.jsx(
518
+ D.Input,
519
+ {
520
+ ref: t,
521
+ className: L(
522
+ "flex h-11 w-full rounded-md bg-transparent py-3 text-sm outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50",
523
+ e
524
+ ),
525
+ ...r
526
+ }
527
+ )
528
+ ] })
529
+ ));
530
+ vt.displayName = D.Input.displayName;
531
+ const gt = a.forwardRef(({ className: e, ...r }, t) => /* @__PURE__ */ w.jsx(
532
+ D.List,
533
+ {
534
+ ref: t,
535
+ className: L("max-h-[300px] overflow-y-auto overflow-x-hidden", e),
536
+ ...r
537
+ }
538
+ ));
539
+ gt.displayName = D.List.displayName;
540
+ const ht = a.forwardRef((e, r) => /* @__PURE__ */ w.jsx(
541
+ D.Empty,
542
+ {
543
+ ref: r,
544
+ className: "py-6 text-center text-sm",
545
+ ...e
546
+ }
547
+ ));
548
+ ht.displayName = D.Empty.displayName;
549
+ const yt = a.forwardRef(({ className: e, ...r }, t) => /* @__PURE__ */ w.jsx(
550
+ D.Group,
551
+ {
552
+ ref: t,
553
+ className: L(
554
+ "overflow-hidden p-1 text-foreground [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground",
555
+ e
556
+ ),
557
+ ...r
558
+ }
559
+ ));
560
+ yt.displayName = D.Group.displayName;
561
+ const St = a.forwardRef(({ className: e, ...r }, t) => /* @__PURE__ */ w.jsx(
562
+ D.Separator,
563
+ {
564
+ ref: t,
565
+ className: L("-mx-1 h-px bg-border", e),
566
+ ...r
567
+ }
568
+ ));
569
+ St.displayName = D.Separator.displayName;
570
+ const xt = a.forwardRef(({ className: e, ...r }, t) => /* @__PURE__ */ w.jsx(
571
+ D.Item,
572
+ {
573
+ ref: t,
574
+ className: L(
575
+ "relative flex cursor-default gap-2 select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none data-[disabled=true]:pointer-events-none data-[selected='true']:bg-accent data-[selected=true]:text-accent-foreground data-[disabled=true]:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",
576
+ e
577
+ ),
578
+ ...r
579
+ }
580
+ ));
581
+ xt.displayName = D.Item.displayName;
582
+ const bt = ({
583
+ className: e,
584
+ ...r
585
+ }) => /* @__PURE__ */ w.jsx(
586
+ "span",
587
+ {
588
+ className: L(
589
+ "ml-auto text-xs tracking-widest text-muted-foreground",
590
+ e
591
+ ),
592
+ ...r
593
+ }
594
+ );
595
+ bt.displayName = "CommandShortcut";
596
+ export {
597
+ Le as C,
598
+ $e as D,
599
+ vt as a,
600
+ gt as b,
601
+ ht as c,
602
+ xt as d,
603
+ Nt as e,
604
+ Re as f,
605
+ Ke as g,
606
+ Ot as h,
607
+ yt as i,
608
+ St as j,
609
+ bt as k
610
+ };
611
+ //# sourceMappingURL=Command-9x_kZHr4.js.map