teodor-new-chat-ui 4.3.385 → 4.3.387
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.
- package/dist/api/chat-api.d.ts +2 -2
- package/dist/api/utils.d.ts +1 -1
- package/dist/components/chat/ChatInterface.d.ts +1 -1
- package/dist/components/chat/MessageComponent.d.ts +1 -1
- package/dist/components/chat/MessageList.d.ts +1 -1
- package/dist/components/chat/MessageRow.d.ts +1 -1
- package/dist/components/chat/message-components/ArtifactRenderer.d.ts +1 -1
- package/dist/components/chat/message-components/StreamProgress.d.ts +1 -1
- package/dist/components/chat/message-components/ToolComponent.d.ts +1 -1
- package/dist/components/chat/message-components/artifacts/PlotArtifact.d.ts +1 -1
- package/dist/components/chat/threads/ThreadListItem.d.ts +1 -1
- package/dist/config/env.d.ts +1 -1
- package/dist/context/ChatProviders.d.ts +1 -1
- package/dist/context/index.d.ts +1 -1
- package/dist/context/providers/ApiProvider.d.ts +1 -1
- package/dist/context/providers/ChatSessionProvider.d.ts +1 -1
- package/dist/context/reducers/MessageReducer.d.ts +1 -1
- package/dist/context/reducers/utils/reducerUtils.d.ts +1 -1
- package/dist/context/services/streaming/use-streaming-service.d.ts +1 -1
- package/dist/context/types.d.ts +1 -1
- package/dist/hooks/use-stream.d.ts +1 -1
- package/dist/hooks/useCheckpointMetadata.d.ts +1 -1
- package/dist/hooks/useMessageMetadata.d.ts +1 -1
- package/dist/hooks/useThreadHistoryState.d.ts +2 -2
- package/dist/hooks/useThreadsState.d.ts +1 -1
- package/dist/index.esm.js +862 -862
- package/dist/index.umd.js +1 -1
- package/dist/lib/chatUtils.d.ts +1 -1
- package/dist/lib/historyUtils.d.ts +1 -1
- package/dist/lib/index.d.ts +2 -2
- package/dist/lib/messageHelpers.d.ts +1 -1
- package/dist/lib/messagePreviews.d.ts +1 -1
- package/dist/types/{api.d.ts → index.d.ts} +1 -1
- package/dist/types/models.d.ts +0 -21
- package/dist/types/user.d.ts +21 -0
- package/package.json +1 -1
- package/dist/types/json-structures.d.ts +0 -30
package/dist/index.esm.js
CHANGED
|
@@ -16146,934 +16146,934 @@ function Li({
|
|
|
16146
16146
|
] })
|
|
16147
16147
|
] });
|
|
16148
16148
|
}
|
|
16149
|
-
|
|
16150
|
-
|
|
16149
|
+
var fu = 1, uk = 0.9, dk = 0.8, fk = 0.17, $i = 0.1, Fi = 0.999, hk = 0.9999, pk = 0.99, mk = /[\\\/_+.#"@\[\(\{&]/, gk = /[\\\/_+.#"@\[\(\{&]/g, xk = /[\s-]/, ap = /[\s-]/g;
|
|
16150
|
+
function da(e, t, n, r, o, s, i) {
|
|
16151
|
+
if (s === t.length) return o === e.length ? fu : pk;
|
|
16152
|
+
var a = `${o},${s}`;
|
|
16153
|
+
if (i[a] !== void 0) return i[a];
|
|
16154
|
+
for (var l = r.charAt(s), u = n.indexOf(l, o), d = 0, f, h, p, y; u >= 0; ) f = da(e, t, n, r, u + 1, s + 1, i), f > d && (u === o ? f *= fu : mk.test(e.charAt(u - 1)) ? (f *= dk, p = e.slice(o, u - 1).match(gk), p && o > 0 && (f *= Math.pow(Fi, p.length))) : xk.test(e.charAt(u - 1)) ? (f *= uk, y = e.slice(o, u - 1).match(ap), y && o > 0 && (f *= Math.pow(Fi, y.length))) : (f *= fk, o > 0 && (f *= Math.pow(Fi, u - o))), e.charAt(u) !== t.charAt(s) && (f *= hk)), (f < $i && n.charAt(u - 1) === r.charAt(s + 1) || r.charAt(s + 1) === r.charAt(s) && n.charAt(u - 1) !== r.charAt(s)) && (h = da(e, t, n, r, u + 1, s + 2, i), h * $i > f && (f = h * $i)), f > d && (d = f), u = n.indexOf(l, u + 1);
|
|
16155
|
+
return i[a] = d, d;
|
|
16151
16156
|
}
|
|
16152
|
-
function
|
|
16153
|
-
return
|
|
16157
|
+
function hu(e) {
|
|
16158
|
+
return e.toLowerCase().replace(ap, " ");
|
|
16154
16159
|
}
|
|
16155
|
-
|
|
16156
|
-
(e, t)
|
|
16157
|
-
|
|
16158
|
-
|
|
16159
|
-
|
|
16160
|
-
|
|
16161
|
-
|
|
16162
|
-
|
|
16163
|
-
|
|
16164
|
-
|
|
16165
|
-
|
|
16166
|
-
|
|
16167
|
-
|
|
16168
|
-
|
|
16169
|
-
|
|
16170
|
-
|
|
16171
|
-
|
|
16172
|
-
|
|
16173
|
-
|
|
16174
|
-
|
|
16175
|
-
|
|
16176
|
-
|
|
16177
|
-
|
|
16178
|
-
|
|
16179
|
-
onScrollbarXEnabledChange: S,
|
|
16180
|
-
scrollbarY: g,
|
|
16181
|
-
onScrollbarYChange: v,
|
|
16182
|
-
scrollbarYEnabled: k,
|
|
16183
|
-
onScrollbarYEnabledChange: R,
|
|
16184
|
-
onCornerWidthChange: w,
|
|
16185
|
-
onCornerHeightChange: T,
|
|
16186
|
-
children: /* @__PURE__ */ c.jsx(
|
|
16187
|
-
Ce.div,
|
|
16188
|
-
{
|
|
16189
|
-
dir: O,
|
|
16190
|
-
...i,
|
|
16191
|
-
ref: _,
|
|
16192
|
-
style: {
|
|
16193
|
-
position: "relative",
|
|
16194
|
-
// Pass corner sizes as CSS vars to reduce re-renders of context consumers
|
|
16195
|
-
"--radix-scroll-area-corner-width": x + "px",
|
|
16196
|
-
"--radix-scroll-area-corner-height": C + "px",
|
|
16197
|
-
...e.style
|
|
16198
|
-
}
|
|
16199
|
-
}
|
|
16200
|
-
)
|
|
16201
|
-
}
|
|
16202
|
-
);
|
|
16203
|
-
}
|
|
16204
|
-
);
|
|
16205
|
-
lp.displayName = Sl;
|
|
16206
|
-
var cp = "ScrollAreaViewport", up = m.forwardRef(
|
|
16207
|
-
(e, t) => {
|
|
16208
|
-
const { __scopeScrollArea: n, children: r, nonce: o, ...s } = e, i = ln(cp, n), a = m.useRef(null), l = qe(t, a, i.onViewportChange);
|
|
16209
|
-
return /* @__PURE__ */ c.jsxs(c.Fragment, { children: [
|
|
16210
|
-
/* @__PURE__ */ c.jsx(
|
|
16211
|
-
"style",
|
|
16212
|
-
{
|
|
16213
|
-
dangerouslySetInnerHTML: {
|
|
16214
|
-
__html: "[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}"
|
|
16215
|
-
},
|
|
16216
|
-
nonce: o
|
|
16160
|
+
function yk(e, t, n) {
|
|
16161
|
+
return e = n && n.length > 0 ? `${e + " " + n.join(" ")}` : e, da(e, t, hu(e), hu(t), 0, 0, {});
|
|
16162
|
+
}
|
|
16163
|
+
var zr = '[cmdk-group=""]', Bi = '[cmdk-group-items=""]', vk = '[cmdk-group-heading=""]', lp = '[cmdk-item=""]', pu = `${lp}:not([aria-disabled="true"])`, fa = "cmdk-item-select", gr = "data-value", wk = (e, t, n) => yk(e, t, n), cp = m.createContext(void 0), To = () => m.useContext(cp), up = m.createContext(void 0), Sl = () => m.useContext(up), dp = m.createContext(void 0), fp = m.forwardRef((e, t) => {
|
|
16164
|
+
let n = xr(() => {
|
|
16165
|
+
var N, X;
|
|
16166
|
+
return { search: "", value: (X = (N = e.value) != null ? N : e.defaultValue) != null ? X : "", selectedItemId: void 0, filtered: { count: 0, items: /* @__PURE__ */ new Map(), groups: /* @__PURE__ */ new Set() } };
|
|
16167
|
+
}), r = xr(() => /* @__PURE__ */ new Set()), o = xr(() => /* @__PURE__ */ new Map()), s = xr(() => /* @__PURE__ */ new Map()), i = xr(() => /* @__PURE__ */ new Set()), a = hp(e), { label: l, children: u, value: d, onValueChange: f, filter: h, shouldFilter: p, loop: y, disablePointerSelection: g = !1, vimBindings: v = !0, ...x } = e, w = Ut(), C = Ut(), T = Ut(), b = m.useRef(null), S = jk();
|
|
16168
|
+
sr(() => {
|
|
16169
|
+
if (d !== void 0) {
|
|
16170
|
+
let N = d.trim();
|
|
16171
|
+
n.current.value = N, k.emit();
|
|
16172
|
+
}
|
|
16173
|
+
}, [d]), sr(() => {
|
|
16174
|
+
S(6, q);
|
|
16175
|
+
}, []);
|
|
16176
|
+
let k = m.useMemo(() => ({ subscribe: (N) => (i.current.add(N), () => i.current.delete(N)), snapshot: () => n.current, setState: (N, X, W) => {
|
|
16177
|
+
var U, Q, H, P;
|
|
16178
|
+
if (!Object.is(n.current[N], X)) {
|
|
16179
|
+
if (n.current[N] = X, N === "search") Y(), O(), S(1, F);
|
|
16180
|
+
else if (N === "value") {
|
|
16181
|
+
if (document.activeElement.hasAttribute("cmdk-input") || document.activeElement.hasAttribute("cmdk-root")) {
|
|
16182
|
+
let V = document.getElementById(T);
|
|
16183
|
+
V ? V.focus() : (U = document.getElementById(w)) == null || U.focus();
|
|
16217
16184
|
}
|
|
16218
|
-
|
|
16219
|
-
|
|
16220
|
-
|
|
16221
|
-
{
|
|
16222
|
-
|
|
16223
|
-
|
|
16224
|
-
|
|
16225
|
-
style: {
|
|
16226
|
-
/**
|
|
16227
|
-
* We don't support `visible` because the intention is to have at least one scrollbar
|
|
16228
|
-
* if this component is used and `visible` will behave like `auto` in that case
|
|
16229
|
-
* https://developer.mozilla.org/en-US/docs/Web/CSS/overflow#description
|
|
16230
|
-
*
|
|
16231
|
-
* We don't handle `auto` because the intention is for the native implementation
|
|
16232
|
-
* to be hidden if using this component. We just want to ensure the node is scrollable
|
|
16233
|
-
* so could have used either `scroll` or `auto` here. We picked `scroll` to prevent
|
|
16234
|
-
* the browser from having to work out whether to render native scrollbars or not,
|
|
16235
|
-
* we tell it to with the intention of hiding them in CSS.
|
|
16236
|
-
*/
|
|
16237
|
-
overflowX: i.scrollbarXEnabled ? "scroll" : "hidden",
|
|
16238
|
-
overflowY: i.scrollbarYEnabled ? "scroll" : "hidden",
|
|
16239
|
-
...e.style
|
|
16240
|
-
},
|
|
16241
|
-
children: /* @__PURE__ */ c.jsx("div", { ref: i.onContentChange, style: { minWidth: "100%", display: "table" }, children: r })
|
|
16185
|
+
if (S(7, () => {
|
|
16186
|
+
var V;
|
|
16187
|
+
n.current.selectedItemId = (V = j()) == null ? void 0 : V.id, k.emit();
|
|
16188
|
+
}), W || S(5, q), ((Q = a.current) == null ? void 0 : Q.value) !== void 0) {
|
|
16189
|
+
let V = X ?? "";
|
|
16190
|
+
(P = (H = a.current).onValueChange) == null || P.call(H, V);
|
|
16191
|
+
return;
|
|
16242
16192
|
}
|
|
16243
|
-
|
|
16244
|
-
|
|
16193
|
+
}
|
|
16194
|
+
k.emit();
|
|
16195
|
+
}
|
|
16196
|
+
}, emit: () => {
|
|
16197
|
+
i.current.forEach((N) => N());
|
|
16198
|
+
} }), []), R = m.useMemo(() => ({ value: (N, X, W) => {
|
|
16199
|
+
var U;
|
|
16200
|
+
X !== ((U = s.current.get(N)) == null ? void 0 : U.value) && (s.current.set(N, { value: X, keywords: W }), n.current.filtered.items.set(N, _(X, W)), S(2, () => {
|
|
16201
|
+
O(), k.emit();
|
|
16202
|
+
}));
|
|
16203
|
+
}, item: (N, X) => (r.current.add(N), X && (o.current.has(X) ? o.current.get(X).add(N) : o.current.set(X, /* @__PURE__ */ new Set([N]))), S(3, () => {
|
|
16204
|
+
Y(), O(), n.current.value || F(), k.emit();
|
|
16205
|
+
}), () => {
|
|
16206
|
+
s.current.delete(N), r.current.delete(N), n.current.filtered.items.delete(N);
|
|
16207
|
+
let W = j();
|
|
16208
|
+
S(4, () => {
|
|
16209
|
+
Y(), (W == null ? void 0 : W.getAttribute("id")) === N && F(), k.emit();
|
|
16210
|
+
});
|
|
16211
|
+
}), group: (N) => (o.current.has(N) || o.current.set(N, /* @__PURE__ */ new Set()), () => {
|
|
16212
|
+
s.current.delete(N), o.current.delete(N);
|
|
16213
|
+
}), filter: () => a.current.shouldFilter, label: l || e["aria-label"], getDisablePointerSelection: () => a.current.disablePointerSelection, listId: w, inputId: T, labelId: C, listInnerRef: b }), []);
|
|
16214
|
+
function _(N, X) {
|
|
16215
|
+
var W, U;
|
|
16216
|
+
let Q = (U = (W = a.current) == null ? void 0 : W.filter) != null ? U : wk;
|
|
16217
|
+
return N ? Q(N, n.current.search, X) : 0;
|
|
16245
16218
|
}
|
|
16246
|
-
)
|
|
16247
|
-
|
|
16248
|
-
|
|
16249
|
-
|
|
16250
|
-
|
|
16251
|
-
|
|
16252
|
-
|
|
16253
|
-
|
|
16219
|
+
function O() {
|
|
16220
|
+
if (!n.current.search || a.current.shouldFilter === !1) return;
|
|
16221
|
+
let N = n.current.filtered.items, X = [];
|
|
16222
|
+
n.current.filtered.groups.forEach((U) => {
|
|
16223
|
+
let Q = o.current.get(U), H = 0;
|
|
16224
|
+
Q.forEach((P) => {
|
|
16225
|
+
let V = N.get(P);
|
|
16226
|
+
H = Math.max(V, H);
|
|
16227
|
+
}), X.push([U, H]);
|
|
16228
|
+
});
|
|
16229
|
+
let W = b.current;
|
|
16230
|
+
z().sort((U, Q) => {
|
|
16231
|
+
var H, P;
|
|
16232
|
+
let V = U.getAttribute("id"), B = Q.getAttribute("id");
|
|
16233
|
+
return ((H = N.get(B)) != null ? H : 0) - ((P = N.get(V)) != null ? P : 0);
|
|
16234
|
+
}).forEach((U) => {
|
|
16235
|
+
let Q = U.closest(Bi);
|
|
16236
|
+
Q ? Q.appendChild(U.parentElement === Q ? U : U.closest(`${Bi} > *`)) : W.appendChild(U.parentElement === W ? U : U.closest(`${Bi} > *`));
|
|
16237
|
+
}), X.sort((U, Q) => Q[1] - U[1]).forEach((U) => {
|
|
16238
|
+
var Q;
|
|
16239
|
+
let H = (Q = b.current) == null ? void 0 : Q.querySelector(`${zr}[${gr}="${encodeURIComponent(U[0])}"]`);
|
|
16240
|
+
H == null || H.parentElement.appendChild(H);
|
|
16241
|
+
});
|
|
16254
16242
|
}
|
|
16255
|
-
)
|
|
16256
|
-
|
|
16257
|
-
|
|
16258
|
-
|
|
16259
|
-
|
|
16260
|
-
|
|
16261
|
-
|
|
16262
|
-
|
|
16263
|
-
|
|
16264
|
-
window.clearTimeout(l), i(!0);
|
|
16265
|
-
}, d = () => {
|
|
16266
|
-
l = window.setTimeout(() => i(!1), o.scrollHideDelay);
|
|
16267
|
-
};
|
|
16268
|
-
return a.addEventListener("pointerenter", u), a.addEventListener("pointerleave", d), () => {
|
|
16269
|
-
window.clearTimeout(l), a.removeEventListener("pointerenter", u), a.removeEventListener("pointerleave", d);
|
|
16270
|
-
};
|
|
16271
|
-
}
|
|
16272
|
-
}, [o.scrollArea, o.scrollHideDelay]), /* @__PURE__ */ c.jsx(an, { present: n || s, children: /* @__PURE__ */ c.jsx(
|
|
16273
|
-
dp,
|
|
16274
|
-
{
|
|
16275
|
-
"data-state": s ? "visible" : "hidden",
|
|
16276
|
-
...r,
|
|
16277
|
-
ref: t
|
|
16278
|
-
}
|
|
16279
|
-
) });
|
|
16280
|
-
}), hk = m.forwardRef((e, t) => {
|
|
16281
|
-
const { forceMount: n, ...r } = e, o = ln(kn, e.__scopeScrollArea), s = e.orientation === "horizontal", i = ni(() => l("SCROLL_END"), 100), [a, l] = uk("hidden", {
|
|
16282
|
-
hidden: {
|
|
16283
|
-
SCROLL: "scrolling"
|
|
16284
|
-
},
|
|
16285
|
-
scrolling: {
|
|
16286
|
-
SCROLL_END: "idle",
|
|
16287
|
-
POINTER_ENTER: "interacting"
|
|
16288
|
-
},
|
|
16289
|
-
interacting: {
|
|
16290
|
-
SCROLL: "interacting",
|
|
16291
|
-
POINTER_LEAVE: "idle"
|
|
16292
|
-
},
|
|
16293
|
-
idle: {
|
|
16294
|
-
HIDE: "hidden",
|
|
16295
|
-
SCROLL: "scrolling",
|
|
16296
|
-
POINTER_ENTER: "interacting"
|
|
16297
|
-
}
|
|
16298
|
-
});
|
|
16299
|
-
return m.useEffect(() => {
|
|
16300
|
-
if (a === "idle") {
|
|
16301
|
-
const u = window.setTimeout(() => l("HIDE"), o.scrollHideDelay);
|
|
16302
|
-
return () => window.clearTimeout(u);
|
|
16303
|
-
}
|
|
16304
|
-
}, [a, o.scrollHideDelay, l]), m.useEffect(() => {
|
|
16305
|
-
const u = o.viewport, d = s ? "scrollLeft" : "scrollTop";
|
|
16306
|
-
if (u) {
|
|
16307
|
-
let f = u[d];
|
|
16308
|
-
const h = () => {
|
|
16309
|
-
const p = u[d];
|
|
16310
|
-
f !== p && (l("SCROLL"), i()), f = p;
|
|
16311
|
-
};
|
|
16312
|
-
return u.addEventListener("scroll", h), () => u.removeEventListener("scroll", h);
|
|
16313
|
-
}
|
|
16314
|
-
}, [o.viewport, s, l, i]), /* @__PURE__ */ c.jsx(an, { present: n || a !== "hidden", children: /* @__PURE__ */ c.jsx(
|
|
16315
|
-
Tl,
|
|
16316
|
-
{
|
|
16317
|
-
"data-state": a === "hidden" ? "hidden" : "visible",
|
|
16318
|
-
...r,
|
|
16319
|
-
ref: t,
|
|
16320
|
-
onPointerEnter: pe(e.onPointerEnter, () => l("POINTER_ENTER")),
|
|
16321
|
-
onPointerLeave: pe(e.onPointerLeave, () => l("POINTER_LEAVE"))
|
|
16243
|
+
function F() {
|
|
16244
|
+
let N = z().find((W) => W.getAttribute("aria-disabled") !== "true"), X = N == null ? void 0 : N.getAttribute(gr);
|
|
16245
|
+
k.setState("value", X || void 0);
|
|
16246
|
+
}
|
|
16247
|
+
function Y() {
|
|
16248
|
+
var N, X, W, U;
|
|
16249
|
+
if (!n.current.search || a.current.shouldFilter === !1) {
|
|
16250
|
+
n.current.filtered.count = r.current.size;
|
|
16251
|
+
return;
|
|
16322
16252
|
}
|
|
16323
|
-
|
|
16324
|
-
|
|
16325
|
-
|
|
16326
|
-
|
|
16327
|
-
|
|
16328
|
-
i(a ? u : d);
|
|
16253
|
+
n.current.filtered.groups = /* @__PURE__ */ new Set();
|
|
16254
|
+
let Q = 0;
|
|
16255
|
+
for (let H of r.current) {
|
|
16256
|
+
let P = (X = (N = s.current.get(H)) == null ? void 0 : N.value) != null ? X : "", V = (U = (W = s.current.get(H)) == null ? void 0 : W.keywords) != null ? U : [], B = _(P, V);
|
|
16257
|
+
n.current.filtered.items.set(H, B), B > 0 && Q++;
|
|
16329
16258
|
}
|
|
16330
|
-
|
|
16331
|
-
|
|
16332
|
-
|
|
16333
|
-
{
|
|
16334
|
-
"data-state": s ? "visible" : "hidden",
|
|
16335
|
-
...o,
|
|
16336
|
-
ref: t
|
|
16259
|
+
for (let [H, P] of o.current) for (let V of P) if (n.current.filtered.items.get(V) > 0) {
|
|
16260
|
+
n.current.filtered.groups.add(H);
|
|
16261
|
+
break;
|
|
16337
16262
|
}
|
|
16338
|
-
|
|
16339
|
-
}), Tl = m.forwardRef((e, t) => {
|
|
16340
|
-
const { orientation: n = "vertical", ...r } = e, o = ln(kn, e.__scopeScrollArea), s = m.useRef(null), i = m.useRef(0), [a, l] = m.useState({
|
|
16341
|
-
content: 0,
|
|
16342
|
-
viewport: 0,
|
|
16343
|
-
scrollbar: { size: 0, paddingStart: 0, paddingEnd: 0 }
|
|
16344
|
-
}), u = gp(a.viewport, a.content), d = {
|
|
16345
|
-
...r,
|
|
16346
|
-
sizes: a,
|
|
16347
|
-
onSizesChange: l,
|
|
16348
|
-
hasThumb: u > 0 && u < 1,
|
|
16349
|
-
onThumbChange: (h) => s.current = h,
|
|
16350
|
-
onThumbPointerUp: () => i.current = 0,
|
|
16351
|
-
onThumbPointerDown: (h) => i.current = h
|
|
16352
|
-
};
|
|
16353
|
-
function f(h, p) {
|
|
16354
|
-
return vk(h, i.current, a, p);
|
|
16263
|
+
n.current.filtered.count = Q;
|
|
16355
16264
|
}
|
|
16356
|
-
|
|
16357
|
-
|
|
16358
|
-
|
|
16359
|
-
|
|
16360
|
-
|
|
16361
|
-
|
|
16362
|
-
|
|
16363
|
-
|
|
16364
|
-
|
|
16365
|
-
|
|
16366
|
-
|
|
16367
|
-
|
|
16368
|
-
|
|
16369
|
-
|
|
16370
|
-
|
|
16371
|
-
|
|
16265
|
+
function q() {
|
|
16266
|
+
var N, X, W;
|
|
16267
|
+
let U = j();
|
|
16268
|
+
U && (((N = U.parentElement) == null ? void 0 : N.firstChild) === U && ((W = (X = U.closest(zr)) == null ? void 0 : X.querySelector(vk)) == null || W.scrollIntoView({ block: "nearest" })), U.scrollIntoView({ block: "nearest" }));
|
|
16269
|
+
}
|
|
16270
|
+
function j() {
|
|
16271
|
+
var N;
|
|
16272
|
+
return (N = b.current) == null ? void 0 : N.querySelector(`${lp}[aria-selected="true"]`);
|
|
16273
|
+
}
|
|
16274
|
+
function z() {
|
|
16275
|
+
var N;
|
|
16276
|
+
return Array.from(((N = b.current) == null ? void 0 : N.querySelectorAll(pu)) || []);
|
|
16277
|
+
}
|
|
16278
|
+
function I(N) {
|
|
16279
|
+
let X = z()[N];
|
|
16280
|
+
X && k.setState("value", X.getAttribute(gr));
|
|
16281
|
+
}
|
|
16282
|
+
function M(N) {
|
|
16283
|
+
var X;
|
|
16284
|
+
let W = j(), U = z(), Q = U.findIndex((P) => P === W), H = U[Q + N];
|
|
16285
|
+
(X = a.current) != null && X.loop && (H = Q + N < 0 ? U[U.length - 1] : Q + N === U.length ? U[0] : U[Q + N]), H && k.setState("value", H.getAttribute(gr));
|
|
16286
|
+
}
|
|
16287
|
+
function D(N) {
|
|
16288
|
+
let X = j(), W = X == null ? void 0 : X.closest(zr), U;
|
|
16289
|
+
for (; W && !U; ) W = N > 0 ? Nk(W, zr) : Ak(W, zr), U = W == null ? void 0 : W.querySelector(pu);
|
|
16290
|
+
U ? k.setState("value", U.getAttribute(gr)) : M(N);
|
|
16291
|
+
}
|
|
16292
|
+
let A = () => I(z().length - 1), K = (N) => {
|
|
16293
|
+
N.preventDefault(), N.metaKey ? A() : N.altKey ? D(1) : M(1);
|
|
16294
|
+
}, G = (N) => {
|
|
16295
|
+
N.preventDefault(), N.metaKey ? I(0) : N.altKey ? D(-1) : M(-1);
|
|
16296
|
+
};
|
|
16297
|
+
return m.createElement(Ce.div, { ref: t, tabIndex: -1, ...x, "cmdk-root": "", onKeyDown: (N) => {
|
|
16298
|
+
var X;
|
|
16299
|
+
(X = x.onKeyDown) == null || X.call(x, N);
|
|
16300
|
+
let W = N.nativeEvent.isComposing || N.keyCode === 229;
|
|
16301
|
+
if (!(N.defaultPrevented || W)) switch (N.key) {
|
|
16302
|
+
case "n":
|
|
16303
|
+
case "j": {
|
|
16304
|
+
v && N.ctrlKey && K(N);
|
|
16305
|
+
break;
|
|
16372
16306
|
}
|
|
16373
|
-
|
|
16374
|
-
|
|
16375
|
-
|
|
16376
|
-
{
|
|
16377
|
-
...d,
|
|
16378
|
-
ref: t,
|
|
16379
|
-
onThumbPositionChange: () => {
|
|
16380
|
-
if (o.viewport && s.current) {
|
|
16381
|
-
const h = o.viewport.scrollTop, p = fu(h, a);
|
|
16382
|
-
s.current.style.transform = `translate3d(0, ${p}px, 0)`;
|
|
16383
|
-
}
|
|
16384
|
-
},
|
|
16385
|
-
onWheelScroll: (h) => {
|
|
16386
|
-
o.viewport && (o.viewport.scrollTop = h);
|
|
16387
|
-
},
|
|
16388
|
-
onDragScroll: (h) => {
|
|
16389
|
-
o.viewport && (o.viewport.scrollTop = f(h));
|
|
16307
|
+
case "ArrowDown": {
|
|
16308
|
+
K(N);
|
|
16309
|
+
break;
|
|
16390
16310
|
}
|
|
16391
|
-
|
|
16392
|
-
|
|
16393
|
-
|
|
16394
|
-
|
|
16395
|
-
return m.useEffect(() => {
|
|
16396
|
-
l.current && a(getComputedStyle(l.current));
|
|
16397
|
-
}, [l]), /* @__PURE__ */ c.jsx(
|
|
16398
|
-
hp,
|
|
16399
|
-
{
|
|
16400
|
-
"data-orientation": "horizontal",
|
|
16401
|
-
...o,
|
|
16402
|
-
ref: u,
|
|
16403
|
-
sizes: n,
|
|
16404
|
-
style: {
|
|
16405
|
-
bottom: 0,
|
|
16406
|
-
left: s.dir === "rtl" ? "var(--radix-scroll-area-corner-width)" : 0,
|
|
16407
|
-
right: s.dir === "ltr" ? "var(--radix-scroll-area-corner-width)" : 0,
|
|
16408
|
-
"--radix-scroll-area-thumb-width": ti(n) + "px",
|
|
16409
|
-
...e.style
|
|
16410
|
-
},
|
|
16411
|
-
onThumbPointerDown: (d) => e.onThumbPointerDown(d.x),
|
|
16412
|
-
onDragScroll: (d) => e.onDragScroll(d.x),
|
|
16413
|
-
onWheelScroll: (d, f) => {
|
|
16414
|
-
if (s.viewport) {
|
|
16415
|
-
const h = s.viewport.scrollLeft + d.deltaX;
|
|
16416
|
-
e.onWheelScroll(h), yp(h, f) && d.preventDefault();
|
|
16417
|
-
}
|
|
16418
|
-
},
|
|
16419
|
-
onResize: () => {
|
|
16420
|
-
l.current && s.viewport && i && r({
|
|
16421
|
-
content: s.viewport.scrollWidth,
|
|
16422
|
-
viewport: s.viewport.offsetWidth,
|
|
16423
|
-
scrollbar: {
|
|
16424
|
-
size: l.current.clientWidth,
|
|
16425
|
-
paddingStart: ws(i.paddingLeft),
|
|
16426
|
-
paddingEnd: ws(i.paddingRight)
|
|
16427
|
-
}
|
|
16428
|
-
});
|
|
16311
|
+
case "p":
|
|
16312
|
+
case "k": {
|
|
16313
|
+
v && N.ctrlKey && G(N);
|
|
16314
|
+
break;
|
|
16429
16315
|
}
|
|
16430
|
-
|
|
16431
|
-
|
|
16432
|
-
|
|
16433
|
-
|
|
16434
|
-
|
|
16435
|
-
|
|
16436
|
-
|
|
16437
|
-
|
|
16438
|
-
|
|
16439
|
-
|
|
16440
|
-
|
|
16441
|
-
|
|
16442
|
-
|
|
16443
|
-
|
|
16444
|
-
|
|
16445
|
-
|
|
16446
|
-
|
|
16447
|
-
|
|
16448
|
-
"--radix-scroll-area-thumb-height": ti(n) + "px",
|
|
16449
|
-
...e.style
|
|
16450
|
-
},
|
|
16451
|
-
onThumbPointerDown: (d) => e.onThumbPointerDown(d.y),
|
|
16452
|
-
onDragScroll: (d) => e.onDragScroll(d.y),
|
|
16453
|
-
onWheelScroll: (d, f) => {
|
|
16454
|
-
if (s.viewport) {
|
|
16455
|
-
const h = s.viewport.scrollTop + d.deltaY;
|
|
16456
|
-
e.onWheelScroll(h), yp(h, f) && d.preventDefault();
|
|
16316
|
+
case "ArrowUp": {
|
|
16317
|
+
G(N);
|
|
16318
|
+
break;
|
|
16319
|
+
}
|
|
16320
|
+
case "Home": {
|
|
16321
|
+
N.preventDefault(), I(0);
|
|
16322
|
+
break;
|
|
16323
|
+
}
|
|
16324
|
+
case "End": {
|
|
16325
|
+
N.preventDefault(), A();
|
|
16326
|
+
break;
|
|
16327
|
+
}
|
|
16328
|
+
case "Enter": {
|
|
16329
|
+
N.preventDefault();
|
|
16330
|
+
let U = j();
|
|
16331
|
+
if (U) {
|
|
16332
|
+
let Q = new Event(fa);
|
|
16333
|
+
U.dispatchEvent(Q);
|
|
16457
16334
|
}
|
|
16458
|
-
},
|
|
16459
|
-
onResize: () => {
|
|
16460
|
-
l.current && s.viewport && i && r({
|
|
16461
|
-
content: s.viewport.scrollHeight,
|
|
16462
|
-
viewport: s.viewport.offsetHeight,
|
|
16463
|
-
scrollbar: {
|
|
16464
|
-
size: l.current.clientHeight,
|
|
16465
|
-
paddingStart: ws(i.paddingTop),
|
|
16466
|
-
paddingEnd: ws(i.paddingBottom)
|
|
16467
|
-
}
|
|
16468
|
-
});
|
|
16469
16335
|
}
|
|
16470
16336
|
}
|
|
16471
|
-
);
|
|
16472
|
-
}),
|
|
16473
|
-
|
|
16474
|
-
|
|
16475
|
-
|
|
16476
|
-
|
|
16477
|
-
|
|
16478
|
-
|
|
16479
|
-
|
|
16480
|
-
|
|
16481
|
-
|
|
16482
|
-
|
|
16483
|
-
|
|
16484
|
-
|
|
16485
|
-
|
|
16486
|
-
function R(_) {
|
|
16487
|
-
if (x.current) {
|
|
16488
|
-
const O = _.clientX - x.current.left, F = _.clientY - x.current.top;
|
|
16489
|
-
u({ x: O, y: F });
|
|
16490
|
-
}
|
|
16337
|
+
} }, m.createElement("label", { "cmdk-label": "", htmlFor: R.inputId, id: R.labelId, style: Mk }, l), ti(e, (N) => m.createElement(up.Provider, { value: k }, m.createElement(cp.Provider, { value: R }, N))));
|
|
16338
|
+
}), bk = m.forwardRef((e, t) => {
|
|
16339
|
+
var n, r;
|
|
16340
|
+
let o = Ut(), s = m.useRef(null), i = m.useContext(dp), a = To(), l = hp(e), u = (r = (n = l.current) == null ? void 0 : n.forceMount) != null ? r : i == null ? void 0 : i.forceMount;
|
|
16341
|
+
sr(() => {
|
|
16342
|
+
if (!u) return a.item(o, i == null ? void 0 : i.id);
|
|
16343
|
+
}, [u]);
|
|
16344
|
+
let d = pp(o, s, [e.value, e.children, s], e.keywords), f = Sl(), h = Bn((S) => S.value && S.value === d.current), p = Bn((S) => u || a.filter() === !1 ? !0 : S.search ? S.filtered.items.get(o) > 0 : !0);
|
|
16345
|
+
m.useEffect(() => {
|
|
16346
|
+
let S = s.current;
|
|
16347
|
+
if (!(!S || e.disabled)) return S.addEventListener(fa, y), () => S.removeEventListener(fa, y);
|
|
16348
|
+
}, [p, e.onSelect, e.disabled]);
|
|
16349
|
+
function y() {
|
|
16350
|
+
var S, k;
|
|
16351
|
+
g(), (k = (S = l.current).onSelect) == null || k.call(S, d.current);
|
|
16491
16352
|
}
|
|
16353
|
+
function g() {
|
|
16354
|
+
f.setState("value", d.current, !0);
|
|
16355
|
+
}
|
|
16356
|
+
if (!p) return null;
|
|
16357
|
+
let { disabled: v, value: x, onSelect: w, forceMount: C, keywords: T, ...b } = e;
|
|
16358
|
+
return m.createElement(Ce.div, { ref: Pn(s, t), ...b, id: o, "cmdk-item": "", role: "option", "aria-disabled": !!v, "aria-selected": !!h, "data-disabled": !!v, "data-selected": !!h, onPointerMove: v || a.getDisablePointerSelection() ? void 0 : g, onClick: v ? void 0 : y }, e.children);
|
|
16359
|
+
}), Sk = m.forwardRef((e, t) => {
|
|
16360
|
+
let { heading: n, children: r, forceMount: o, ...s } = e, i = Ut(), a = m.useRef(null), l = m.useRef(null), u = Ut(), d = To(), f = Bn((p) => o || d.filter() === !1 ? !0 : p.search ? p.filtered.groups.has(i) : !0);
|
|
16361
|
+
sr(() => d.group(i), []), pp(i, a, [e.value, e.heading, l]);
|
|
16362
|
+
let h = m.useMemo(() => ({ id: i, forceMount: o }), [o]);
|
|
16363
|
+
return m.createElement(Ce.div, { ref: Pn(a, t), ...s, "cmdk-group": "", role: "presentation", hidden: f ? void 0 : !0 }, n && m.createElement("div", { ref: l, "cmdk-group-heading": "", "aria-hidden": !0, id: u }, n), ti(e, (p) => m.createElement("div", { "cmdk-group-items": "", role: "group", "aria-labelledby": n ? u : void 0 }, m.createElement(dp.Provider, { value: h }, p))));
|
|
16364
|
+
}), Ck = m.forwardRef((e, t) => {
|
|
16365
|
+
let { alwaysRender: n, ...r } = e, o = m.useRef(null), s = Bn((i) => !i.search);
|
|
16366
|
+
return !n && !s ? null : m.createElement(Ce.div, { ref: Pn(o, t), ...r, "cmdk-separator": "", role: "separator" });
|
|
16367
|
+
}), Tk = m.forwardRef((e, t) => {
|
|
16368
|
+
let { onValueChange: n, ...r } = e, o = e.value != null, s = Sl(), i = Bn((u) => u.search), a = Bn((u) => u.selectedItemId), l = To();
|
|
16492
16369
|
return m.useEffect(() => {
|
|
16493
|
-
|
|
16494
|
-
|
|
16495
|
-
|
|
16496
|
-
|
|
16497
|
-
|
|
16498
|
-
|
|
16499
|
-
|
|
16500
|
-
{
|
|
16501
|
-
|
|
16502
|
-
|
|
16503
|
-
|
|
16504
|
-
|
|
16505
|
-
|
|
16506
|
-
|
|
16507
|
-
|
|
16508
|
-
|
|
16509
|
-
|
|
16510
|
-
{
|
|
16511
|
-
...h,
|
|
16512
|
-
ref: v,
|
|
16513
|
-
style: { position: "absolute", ...h.style },
|
|
16514
|
-
onPointerDown: pe(e.onPointerDown, (_) => {
|
|
16515
|
-
_.button === 0 && (_.target.setPointerCapture(_.pointerId), x.current = y.getBoundingClientRect(), w.current = document.body.style.webkitUserSelect, document.body.style.webkitUserSelect = "none", p.viewport && (p.viewport.style.scrollBehavior = "auto"), R(_));
|
|
16516
|
-
}),
|
|
16517
|
-
onPointerMove: pe(e.onPointerMove, R),
|
|
16518
|
-
onPointerUp: pe(e.onPointerUp, (_) => {
|
|
16519
|
-
const O = _.target;
|
|
16520
|
-
O.hasPointerCapture(_.pointerId) && O.releasePointerCapture(_.pointerId), document.body.style.webkitUserSelect = w.current, p.viewport && (p.viewport.style.scrollBehavior = ""), x.current = null;
|
|
16521
|
-
})
|
|
16522
|
-
}
|
|
16523
|
-
)
|
|
16370
|
+
e.value != null && s.setState("search", e.value);
|
|
16371
|
+
}, [e.value]), m.createElement(Ce.input, { ref: t, ...r, "cmdk-input": "", autoComplete: "off", autoCorrect: "off", spellCheck: !1, "aria-autocomplete": "list", role: "combobox", "aria-expanded": !0, "aria-controls": l.listId, "aria-labelledby": l.labelId, "aria-activedescendant": a, id: l.inputId, type: "text", value: o ? e.value : i, onChange: (u) => {
|
|
16372
|
+
o || s.setState("search", u.target.value), n == null || n(u.target.value);
|
|
16373
|
+
} });
|
|
16374
|
+
}), kk = m.forwardRef((e, t) => {
|
|
16375
|
+
let { children: n, label: r = "Suggestions", ...o } = e, s = m.useRef(null), i = m.useRef(null), a = Bn((u) => u.selectedItemId), l = To();
|
|
16376
|
+
return m.useEffect(() => {
|
|
16377
|
+
if (i.current && s.current) {
|
|
16378
|
+
let u = i.current, d = s.current, f, h = new ResizeObserver(() => {
|
|
16379
|
+
f = requestAnimationFrame(() => {
|
|
16380
|
+
let p = u.offsetHeight;
|
|
16381
|
+
d.style.setProperty("--cmdk-list-height", p.toFixed(1) + "px");
|
|
16382
|
+
});
|
|
16383
|
+
});
|
|
16384
|
+
return h.observe(u), () => {
|
|
16385
|
+
cancelAnimationFrame(f), h.unobserve(u);
|
|
16386
|
+
};
|
|
16524
16387
|
}
|
|
16525
|
-
);
|
|
16526
|
-
}),
|
|
16527
|
-
|
|
16528
|
-
|
|
16529
|
-
|
|
16530
|
-
}
|
|
16531
|
-
|
|
16532
|
-
|
|
16533
|
-
|
|
16534
|
-
|
|
16535
|
-
|
|
16536
|
-
|
|
16537
|
-
|
|
16538
|
-
}, 100);
|
|
16539
|
-
return m.useEffect(() => {
|
|
16540
|
-
const f = s.viewport;
|
|
16541
|
-
if (f) {
|
|
16542
|
-
const h = () => {
|
|
16543
|
-
if (d(), !u.current) {
|
|
16544
|
-
const p = wk(f, a);
|
|
16545
|
-
u.current = p, a();
|
|
16546
|
-
}
|
|
16547
|
-
};
|
|
16548
|
-
return a(), f.addEventListener("scroll", h), () => f.removeEventListener("scroll", h);
|
|
16549
|
-
}
|
|
16550
|
-
}, [s.viewport, d, a]), /* @__PURE__ */ c.jsx(
|
|
16551
|
-
Ce.div,
|
|
16552
|
-
{
|
|
16553
|
-
"data-state": i.hasThumb ? "visible" : "hidden",
|
|
16554
|
-
...o,
|
|
16555
|
-
ref: l,
|
|
16556
|
-
style: {
|
|
16557
|
-
width: "var(--radix-scroll-area-thumb-width)",
|
|
16558
|
-
height: "var(--radix-scroll-area-thumb-height)",
|
|
16559
|
-
...r
|
|
16560
|
-
},
|
|
16561
|
-
onPointerDownCapture: pe(e.onPointerDownCapture, (f) => {
|
|
16562
|
-
const p = f.target.getBoundingClientRect(), y = f.clientX - p.left, g = f.clientY - p.top;
|
|
16563
|
-
i.onThumbPointerDown({ x: y, y: g });
|
|
16564
|
-
}),
|
|
16565
|
-
onPointerUp: pe(e.onPointerUp, i.onThumbPointerUp)
|
|
16566
|
-
}
|
|
16567
|
-
);
|
|
16388
|
+
}, []), m.createElement(Ce.div, { ref: Pn(s, t), ...o, "cmdk-list": "", role: "listbox", tabIndex: -1, "aria-activedescendant": a, "aria-label": r, id: l.listId }, ti(e, (u) => m.createElement("div", { ref: Pn(i, l.listInnerRef), "cmdk-list-sizer": "" }, u)));
|
|
16389
|
+
}), Ik = m.forwardRef((e, t) => {
|
|
16390
|
+
let { open: n, onOpenChange: r, overlayClassName: o, contentClassName: s, container: i, ...a } = e;
|
|
16391
|
+
return m.createElement(hl, { open: n, onOpenChange: r }, m.createElement(pl, { container: i }, m.createElement(So, { "cmdk-overlay": "", className: o }), m.createElement(Co, { "aria-label": e.label, "cmdk-dialog": "", className: s }, m.createElement(fp, { ref: t, ...a }))));
|
|
16392
|
+
}), Ek = m.forwardRef((e, t) => Bn((n) => n.filtered.count === 0) ? m.createElement(Ce.div, { ref: t, ...e, "cmdk-empty": "", role: "presentation" }) : null), Rk = m.forwardRef((e, t) => {
|
|
16393
|
+
let { progress: n, children: r, label: o = "Loading...", ...s } = e;
|
|
16394
|
+
return m.createElement(Ce.div, { ref: t, ...s, "cmdk-loading": "", role: "progressbar", "aria-valuenow": n, "aria-valuemin": 0, "aria-valuemax": 100, "aria-label": o }, ti(e, (i) => m.createElement("div", { "aria-hidden": !0 }, i)));
|
|
16395
|
+
}), Yt = Object.assign(fp, { List: kk, Item: bk, Input: Tk, Group: Sk, Separator: Ck, Dialog: Ik, Empty: Ek, Loading: Rk });
|
|
16396
|
+
function Nk(e, t) {
|
|
16397
|
+
let n = e.nextElementSibling;
|
|
16398
|
+
for (; n; ) {
|
|
16399
|
+
if (n.matches(t)) return n;
|
|
16400
|
+
n = n.nextElementSibling;
|
|
16568
16401
|
}
|
|
16569
|
-
|
|
16570
|
-
|
|
16571
|
-
|
|
16572
|
-
(
|
|
16573
|
-
|
|
16574
|
-
|
|
16402
|
+
}
|
|
16403
|
+
function Ak(e, t) {
|
|
16404
|
+
let n = e.previousElementSibling;
|
|
16405
|
+
for (; n; ) {
|
|
16406
|
+
if (n.matches(t)) return n;
|
|
16407
|
+
n = n.previousElementSibling;
|
|
16575
16408
|
}
|
|
16576
|
-
);
|
|
16577
|
-
mp.displayName = kl;
|
|
16578
|
-
var yk = m.forwardRef((e, t) => {
|
|
16579
|
-
const { __scopeScrollArea: n, ...r } = e, o = ln(kl, n), [s, i] = m.useState(0), [a, l] = m.useState(0), u = !!(s && a);
|
|
16580
|
-
return Nr(o.scrollbarX, () => {
|
|
16581
|
-
var f;
|
|
16582
|
-
const d = ((f = o.scrollbarX) == null ? void 0 : f.offsetHeight) || 0;
|
|
16583
|
-
o.onCornerHeightChange(d), l(d);
|
|
16584
|
-
}), Nr(o.scrollbarY, () => {
|
|
16585
|
-
var f;
|
|
16586
|
-
const d = ((f = o.scrollbarY) == null ? void 0 : f.offsetWidth) || 0;
|
|
16587
|
-
o.onCornerWidthChange(d), i(d);
|
|
16588
|
-
}), u ? /* @__PURE__ */ c.jsx(
|
|
16589
|
-
Ce.div,
|
|
16590
|
-
{
|
|
16591
|
-
...r,
|
|
16592
|
-
ref: t,
|
|
16593
|
-
style: {
|
|
16594
|
-
width: s,
|
|
16595
|
-
height: a,
|
|
16596
|
-
position: "absolute",
|
|
16597
|
-
right: o.dir === "ltr" ? 0 : void 0,
|
|
16598
|
-
left: o.dir === "rtl" ? 0 : void 0,
|
|
16599
|
-
bottom: 0,
|
|
16600
|
-
...e.style
|
|
16601
|
-
}
|
|
16602
|
-
}
|
|
16603
|
-
) : null;
|
|
16604
|
-
});
|
|
16605
|
-
function ws(e) {
|
|
16606
|
-
return e ? parseInt(e, 10) : 0;
|
|
16607
16409
|
}
|
|
16608
|
-
function
|
|
16609
|
-
|
|
16610
|
-
return
|
|
16410
|
+
function hp(e) {
|
|
16411
|
+
let t = m.useRef(e);
|
|
16412
|
+
return sr(() => {
|
|
16413
|
+
t.current = e;
|
|
16414
|
+
}), t;
|
|
16611
16415
|
}
|
|
16612
|
-
|
|
16613
|
-
|
|
16614
|
-
|
|
16416
|
+
var sr = typeof window > "u" ? m.useEffect : m.useLayoutEffect;
|
|
16417
|
+
function xr(e) {
|
|
16418
|
+
let t = m.useRef();
|
|
16419
|
+
return t.current === void 0 && (t.current = e()), t;
|
|
16615
16420
|
}
|
|
16616
|
-
function
|
|
16617
|
-
|
|
16618
|
-
return
|
|
16421
|
+
function Bn(e) {
|
|
16422
|
+
let t = Sl(), n = () => e(t.snapshot());
|
|
16423
|
+
return m.useSyncExternalStore(t.subscribe, n, n);
|
|
16619
16424
|
}
|
|
16620
|
-
function
|
|
16621
|
-
|
|
16622
|
-
return
|
|
16425
|
+
function pp(e, t, n, r = []) {
|
|
16426
|
+
let o = m.useRef(), s = To();
|
|
16427
|
+
return sr(() => {
|
|
16428
|
+
var i;
|
|
16429
|
+
let a = (() => {
|
|
16430
|
+
var u;
|
|
16431
|
+
for (let d of n) {
|
|
16432
|
+
if (typeof d == "string") return d.trim();
|
|
16433
|
+
if (typeof d == "object" && "current" in d) return d.current ? (u = d.current.textContent) == null ? void 0 : u.trim() : o.current;
|
|
16434
|
+
}
|
|
16435
|
+
})(), l = r.map((u) => u.trim());
|
|
16436
|
+
s.value(e, a, l), (i = t.current) == null || i.setAttribute(gr, a), o.current = a;
|
|
16437
|
+
}), o;
|
|
16623
16438
|
}
|
|
16624
|
-
|
|
16625
|
-
|
|
16626
|
-
|
|
16627
|
-
|
|
16628
|
-
|
|
16439
|
+
var jk = () => {
|
|
16440
|
+
let [e, t] = m.useState(), n = xr(() => /* @__PURE__ */ new Map());
|
|
16441
|
+
return sr(() => {
|
|
16442
|
+
n.current.forEach((r) => r()), n.current = /* @__PURE__ */ new Map();
|
|
16443
|
+
}, [e]), (r, o) => {
|
|
16444
|
+
n.current.set(r, o), t({});
|
|
16629
16445
|
};
|
|
16630
|
-
}
|
|
16631
|
-
function yp(e, t) {
|
|
16632
|
-
return e > 0 && e < t;
|
|
16633
|
-
}
|
|
16634
|
-
var wk = (e, t = () => {
|
|
16635
|
-
}) => {
|
|
16636
|
-
let n = { left: e.scrollLeft, top: e.scrollTop }, r = 0;
|
|
16637
|
-
return function o() {
|
|
16638
|
-
const s = { left: e.scrollLeft, top: e.scrollTop }, i = n.left !== s.left, a = n.top !== s.top;
|
|
16639
|
-
(i || a) && t(), n = s, r = window.requestAnimationFrame(o);
|
|
16640
|
-
}(), () => window.cancelAnimationFrame(r);
|
|
16641
16446
|
};
|
|
16642
|
-
function
|
|
16643
|
-
|
|
16644
|
-
return
|
|
16645
|
-
window.clearTimeout(r.current), r.current = window.setTimeout(n, t);
|
|
16646
|
-
}, [n, t]);
|
|
16447
|
+
function _k(e) {
|
|
16448
|
+
let t = e.type;
|
|
16449
|
+
return typeof t == "function" ? t(e.props) : "render" in t ? t.render(e.props) : e;
|
|
16647
16450
|
}
|
|
16648
|
-
function
|
|
16649
|
-
|
|
16650
|
-
Ot(() => {
|
|
16651
|
-
let r = 0;
|
|
16652
|
-
if (e) {
|
|
16653
|
-
const o = new ResizeObserver(() => {
|
|
16654
|
-
cancelAnimationFrame(r), r = window.requestAnimationFrame(n);
|
|
16655
|
-
});
|
|
16656
|
-
return o.observe(e), () => {
|
|
16657
|
-
window.cancelAnimationFrame(r), o.unobserve(e);
|
|
16658
|
-
};
|
|
16659
|
-
}
|
|
16660
|
-
}, [e, n]);
|
|
16451
|
+
function ti({ asChild: e, children: t }, n) {
|
|
16452
|
+
return e && m.isValidElement(t) ? m.cloneElement(_k(t), { ref: t.ref }, n(t.props.children)) : n(t);
|
|
16661
16453
|
}
|
|
16662
|
-
var
|
|
16663
|
-
const
|
|
16664
|
-
|
|
16454
|
+
var Mk = { position: "absolute", width: "1px", height: "1px", padding: "0", margin: "-1px", overflow: "hidden", clip: "rect(0, 0, 0, 0)", whiteSpace: "nowrap", borderWidth: "0" };
|
|
16455
|
+
const mp = m.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ c.jsx(
|
|
16456
|
+
Yt,
|
|
16665
16457
|
{
|
|
16666
|
-
ref:
|
|
16667
|
-
className: oe(
|
|
16668
|
-
|
|
16669
|
-
|
|
16670
|
-
|
|
16671
|
-
|
|
16672
|
-
|
|
16673
|
-
|
|
16458
|
+
ref: n,
|
|
16459
|
+
className: oe(
|
|
16460
|
+
"flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground",
|
|
16461
|
+
e
|
|
16462
|
+
),
|
|
16463
|
+
...t
|
|
16464
|
+
}
|
|
16465
|
+
));
|
|
16466
|
+
mp.displayName = Yt.displayName;
|
|
16467
|
+
const gp = m.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ c.jsxs("div", { className: "flex items-center border-b px-3", "cmdk-input-wrapper": "", children: [
|
|
16468
|
+
/* @__PURE__ */ c.jsx(Su, { className: "mr-2 h-4 w-4 shrink-0 opacity-50" }),
|
|
16469
|
+
/* @__PURE__ */ c.jsx(
|
|
16470
|
+
Yt.Input,
|
|
16471
|
+
{
|
|
16472
|
+
ref: n,
|
|
16473
|
+
className: oe(
|
|
16474
|
+
"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",
|
|
16475
|
+
e
|
|
16476
|
+
),
|
|
16477
|
+
...t
|
|
16478
|
+
}
|
|
16479
|
+
)
|
|
16480
|
+
] }));
|
|
16481
|
+
gp.displayName = Yt.Input.displayName;
|
|
16482
|
+
const xp = m.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ c.jsx(
|
|
16483
|
+
Yt.List,
|
|
16484
|
+
{
|
|
16485
|
+
ref: n,
|
|
16486
|
+
className: oe("max-h-[300px] overflow-y-auto overflow-x-hidden", e),
|
|
16487
|
+
...t
|
|
16674
16488
|
}
|
|
16675
16489
|
));
|
|
16676
|
-
|
|
16677
|
-
const
|
|
16678
|
-
|
|
16490
|
+
xp.displayName = Yt.List.displayName;
|
|
16491
|
+
const yp = m.forwardRef((e, t) => /* @__PURE__ */ c.jsx(
|
|
16492
|
+
Yt.Empty,
|
|
16679
16493
|
{
|
|
16680
|
-
ref:
|
|
16681
|
-
|
|
16494
|
+
ref: t,
|
|
16495
|
+
className: "py-6 text-center text-sm",
|
|
16496
|
+
...e
|
|
16497
|
+
}
|
|
16498
|
+
));
|
|
16499
|
+
yp.displayName = Yt.Empty.displayName;
|
|
16500
|
+
const vp = m.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ c.jsx(
|
|
16501
|
+
Yt.Group,
|
|
16502
|
+
{
|
|
16503
|
+
ref: n,
|
|
16682
16504
|
className: oe(
|
|
16683
|
-
"
|
|
16684
|
-
t === "vertical" && "h-full w-2.5 border-l border-l-transparent p-[1px]",
|
|
16685
|
-
t === "horizontal" && "h-2.5 flex-col border-t border-t-transparent p-[1px]",
|
|
16505
|
+
"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",
|
|
16686
16506
|
e
|
|
16687
16507
|
),
|
|
16688
|
-
...
|
|
16689
|
-
children: /* @__PURE__ */ c.jsx(pp, { className: "relative flex-1 rounded-full bg-border" })
|
|
16508
|
+
...t
|
|
16690
16509
|
}
|
|
16691
16510
|
));
|
|
16692
|
-
|
|
16693
|
-
|
|
16694
|
-
|
|
16695
|
-
|
|
16696
|
-
|
|
16697
|
-
|
|
16698
|
-
|
|
16699
|
-
|
|
16700
|
-
|
|
16701
|
-
|
|
16702
|
-
|
|
16511
|
+
vp.displayName = Yt.Group.displayName;
|
|
16512
|
+
const Pk = m.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ c.jsx(
|
|
16513
|
+
Yt.Separator,
|
|
16514
|
+
{
|
|
16515
|
+
ref: n,
|
|
16516
|
+
className: oe("-mx-1 h-px bg-border", e),
|
|
16517
|
+
...t
|
|
16518
|
+
}
|
|
16519
|
+
));
|
|
16520
|
+
Pk.displayName = Yt.Separator.displayName;
|
|
16521
|
+
const wp = m.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ c.jsx(
|
|
16522
|
+
Yt.Item,
|
|
16523
|
+
{
|
|
16524
|
+
ref: n,
|
|
16525
|
+
className: oe(
|
|
16526
|
+
"relative flex cursor-default 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",
|
|
16527
|
+
e
|
|
16528
|
+
),
|
|
16529
|
+
...t
|
|
16530
|
+
}
|
|
16531
|
+
));
|
|
16532
|
+
wp.displayName = Yt.Item.displayName;
|
|
16533
|
+
function ha(e, [t, n]) {
|
|
16534
|
+
return Math.min(n, Math.max(t, e));
|
|
16703
16535
|
}
|
|
16704
|
-
function
|
|
16705
|
-
return
|
|
16536
|
+
function Ok(e, t) {
|
|
16537
|
+
return m.useReducer((n, r) => t[n][r] ?? n, e);
|
|
16706
16538
|
}
|
|
16707
|
-
var
|
|
16708
|
-
|
|
16709
|
-
|
|
16710
|
-
|
|
16711
|
-
|
|
16712
|
-
|
|
16713
|
-
|
|
16714
|
-
|
|
16715
|
-
|
|
16716
|
-
|
|
16717
|
-
|
|
16718
|
-
|
|
16719
|
-
|
|
16720
|
-
|
|
16721
|
-
|
|
16722
|
-
|
|
16723
|
-
|
|
16724
|
-
|
|
16725
|
-
|
|
16726
|
-
|
|
16727
|
-
|
|
16728
|
-
|
|
16729
|
-
|
|
16730
|
-
|
|
16731
|
-
|
|
16732
|
-
|
|
16733
|
-
|
|
16734
|
-
|
|
16735
|
-
|
|
16736
|
-
|
|
16737
|
-
|
|
16738
|
-
|
|
16739
|
-
|
|
16740
|
-
|
|
16741
|
-
|
|
16742
|
-
|
|
16743
|
-
|
|
16744
|
-
|
|
16745
|
-
|
|
16746
|
-
|
|
16747
|
-
|
|
16748
|
-
|
|
16749
|
-
|
|
16750
|
-
|
|
16751
|
-
|
|
16752
|
-
|
|
16753
|
-
|
|
16754
|
-
|
|
16755
|
-
}), group: (N) => (o.current.has(N) || o.current.set(N, /* @__PURE__ */ new Set()), () => {
|
|
16756
|
-
s.current.delete(N), o.current.delete(N);
|
|
16757
|
-
}), filter: () => a.current.shouldFilter, label: l || e["aria-label"], getDisablePointerSelection: () => a.current.disablePointerSelection, listId: w, inputId: T, labelId: C, listInnerRef: b }), []);
|
|
16758
|
-
function _(N, X) {
|
|
16759
|
-
var W, U;
|
|
16760
|
-
let Q = (U = (W = a.current) == null ? void 0 : W.filter) != null ? U : Mk;
|
|
16761
|
-
return N ? Q(N, n.current.search, X) : 0;
|
|
16539
|
+
var Cl = "ScrollArea", [bp, jE] = An(Cl), [Dk, ln] = bp(Cl), Sp = m.forwardRef(
|
|
16540
|
+
(e, t) => {
|
|
16541
|
+
const {
|
|
16542
|
+
__scopeScrollArea: n,
|
|
16543
|
+
type: r = "hover",
|
|
16544
|
+
dir: o,
|
|
16545
|
+
scrollHideDelay: s = 600,
|
|
16546
|
+
...i
|
|
16547
|
+
} = e, [a, l] = m.useState(null), [u, d] = m.useState(null), [f, h] = m.useState(null), [p, y] = m.useState(null), [g, v] = m.useState(null), [x, w] = m.useState(0), [C, T] = m.useState(0), [b, S] = m.useState(!1), [k, R] = m.useState(!1), _ = qe(t, (F) => l(F)), O = Ms(o);
|
|
16548
|
+
return /* @__PURE__ */ c.jsx(
|
|
16549
|
+
Dk,
|
|
16550
|
+
{
|
|
16551
|
+
scope: n,
|
|
16552
|
+
type: r,
|
|
16553
|
+
dir: O,
|
|
16554
|
+
scrollHideDelay: s,
|
|
16555
|
+
scrollArea: a,
|
|
16556
|
+
viewport: u,
|
|
16557
|
+
onViewportChange: d,
|
|
16558
|
+
content: f,
|
|
16559
|
+
onContentChange: h,
|
|
16560
|
+
scrollbarX: p,
|
|
16561
|
+
onScrollbarXChange: y,
|
|
16562
|
+
scrollbarXEnabled: b,
|
|
16563
|
+
onScrollbarXEnabledChange: S,
|
|
16564
|
+
scrollbarY: g,
|
|
16565
|
+
onScrollbarYChange: v,
|
|
16566
|
+
scrollbarYEnabled: k,
|
|
16567
|
+
onScrollbarYEnabledChange: R,
|
|
16568
|
+
onCornerWidthChange: w,
|
|
16569
|
+
onCornerHeightChange: T,
|
|
16570
|
+
children: /* @__PURE__ */ c.jsx(
|
|
16571
|
+
Ce.div,
|
|
16572
|
+
{
|
|
16573
|
+
dir: O,
|
|
16574
|
+
...i,
|
|
16575
|
+
ref: _,
|
|
16576
|
+
style: {
|
|
16577
|
+
position: "relative",
|
|
16578
|
+
// Pass corner sizes as CSS vars to reduce re-renders of context consumers
|
|
16579
|
+
"--radix-scroll-area-corner-width": x + "px",
|
|
16580
|
+
"--radix-scroll-area-corner-height": C + "px",
|
|
16581
|
+
...e.style
|
|
16582
|
+
}
|
|
16583
|
+
}
|
|
16584
|
+
)
|
|
16585
|
+
}
|
|
16586
|
+
);
|
|
16762
16587
|
}
|
|
16763
|
-
|
|
16764
|
-
|
|
16765
|
-
|
|
16766
|
-
|
|
16767
|
-
|
|
16768
|
-
|
|
16769
|
-
|
|
16770
|
-
|
|
16771
|
-
|
|
16772
|
-
|
|
16773
|
-
|
|
16774
|
-
|
|
16775
|
-
|
|
16776
|
-
|
|
16777
|
-
|
|
16778
|
-
|
|
16779
|
-
|
|
16780
|
-
|
|
16781
|
-
|
|
16782
|
-
|
|
16783
|
-
|
|
16784
|
-
|
|
16785
|
-
|
|
16588
|
+
);
|
|
16589
|
+
Sp.displayName = Cl;
|
|
16590
|
+
var Cp = "ScrollAreaViewport", Tp = m.forwardRef(
|
|
16591
|
+
(e, t) => {
|
|
16592
|
+
const { __scopeScrollArea: n, children: r, nonce: o, ...s } = e, i = ln(Cp, n), a = m.useRef(null), l = qe(t, a, i.onViewportChange);
|
|
16593
|
+
return /* @__PURE__ */ c.jsxs(c.Fragment, { children: [
|
|
16594
|
+
/* @__PURE__ */ c.jsx(
|
|
16595
|
+
"style",
|
|
16596
|
+
{
|
|
16597
|
+
dangerouslySetInnerHTML: {
|
|
16598
|
+
__html: "[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}"
|
|
16599
|
+
},
|
|
16600
|
+
nonce: o
|
|
16601
|
+
}
|
|
16602
|
+
),
|
|
16603
|
+
/* @__PURE__ */ c.jsx(
|
|
16604
|
+
Ce.div,
|
|
16605
|
+
{
|
|
16606
|
+
"data-radix-scroll-area-viewport": "",
|
|
16607
|
+
...s,
|
|
16608
|
+
ref: l,
|
|
16609
|
+
style: {
|
|
16610
|
+
/**
|
|
16611
|
+
* We don't support `visible` because the intention is to have at least one scrollbar
|
|
16612
|
+
* if this component is used and `visible` will behave like `auto` in that case
|
|
16613
|
+
* https://developer.mozilla.org/en-US/docs/Web/CSS/overflow#description
|
|
16614
|
+
*
|
|
16615
|
+
* We don't handle `auto` because the intention is for the native implementation
|
|
16616
|
+
* to be hidden if using this component. We just want to ensure the node is scrollable
|
|
16617
|
+
* so could have used either `scroll` or `auto` here. We picked `scroll` to prevent
|
|
16618
|
+
* the browser from having to work out whether to render native scrollbars or not,
|
|
16619
|
+
* we tell it to with the intention of hiding them in CSS.
|
|
16620
|
+
*/
|
|
16621
|
+
overflowX: i.scrollbarXEnabled ? "scroll" : "hidden",
|
|
16622
|
+
overflowY: i.scrollbarYEnabled ? "scroll" : "hidden",
|
|
16623
|
+
...e.style
|
|
16624
|
+
},
|
|
16625
|
+
children: /* @__PURE__ */ c.jsx("div", { ref: i.onContentChange, style: { minWidth: "100%", display: "table" }, children: r })
|
|
16626
|
+
}
|
|
16627
|
+
)
|
|
16628
|
+
] });
|
|
16786
16629
|
}
|
|
16787
|
-
|
|
16788
|
-
|
|
16789
|
-
|
|
16630
|
+
);
|
|
16631
|
+
Tp.displayName = Cp;
|
|
16632
|
+
var kn = "ScrollAreaScrollbar", Tl = m.forwardRef(
|
|
16633
|
+
(e, t) => {
|
|
16634
|
+
const { forceMount: n, ...r } = e, o = ln(kn, e.__scopeScrollArea), { onScrollbarXEnabledChange: s, onScrollbarYEnabledChange: i } = o, a = e.orientation === "horizontal";
|
|
16635
|
+
return m.useEffect(() => (a ? s(!0) : i(!0), () => {
|
|
16636
|
+
a ? s(!1) : i(!1);
|
|
16637
|
+
}), [a, s, i]), o.type === "hover" ? /* @__PURE__ */ c.jsx(Lk, { ...r, ref: t, forceMount: n }) : o.type === "scroll" ? /* @__PURE__ */ c.jsx($k, { ...r, ref: t, forceMount: n }) : o.type === "auto" ? /* @__PURE__ */ c.jsx(kp, { ...r, ref: t, forceMount: n }) : o.type === "always" ? /* @__PURE__ */ c.jsx(kl, { ...r, ref: t }) : null;
|
|
16790
16638
|
}
|
|
16791
|
-
|
|
16792
|
-
|
|
16793
|
-
|
|
16794
|
-
|
|
16795
|
-
|
|
16639
|
+
);
|
|
16640
|
+
Tl.displayName = kn;
|
|
16641
|
+
var Lk = m.forwardRef((e, t) => {
|
|
16642
|
+
const { forceMount: n, ...r } = e, o = ln(kn, e.__scopeScrollArea), [s, i] = m.useState(!1);
|
|
16643
|
+
return m.useEffect(() => {
|
|
16644
|
+
const a = o.scrollArea;
|
|
16645
|
+
let l = 0;
|
|
16646
|
+
if (a) {
|
|
16647
|
+
const u = () => {
|
|
16648
|
+
window.clearTimeout(l), i(!0);
|
|
16649
|
+
}, d = () => {
|
|
16650
|
+
l = window.setTimeout(() => i(!1), o.scrollHideDelay);
|
|
16651
|
+
};
|
|
16652
|
+
return a.addEventListener("pointerenter", u), a.addEventListener("pointerleave", d), () => {
|
|
16653
|
+
window.clearTimeout(l), a.removeEventListener("pointerenter", u), a.removeEventListener("pointerleave", d);
|
|
16654
|
+
};
|
|
16796
16655
|
}
|
|
16797
|
-
|
|
16798
|
-
|
|
16799
|
-
|
|
16800
|
-
|
|
16801
|
-
|
|
16656
|
+
}, [o.scrollArea, o.scrollHideDelay]), /* @__PURE__ */ c.jsx(an, { present: n || s, children: /* @__PURE__ */ c.jsx(
|
|
16657
|
+
kp,
|
|
16658
|
+
{
|
|
16659
|
+
"data-state": s ? "visible" : "hidden",
|
|
16660
|
+
...r,
|
|
16661
|
+
ref: t
|
|
16802
16662
|
}
|
|
16803
|
-
|
|
16804
|
-
|
|
16805
|
-
|
|
16663
|
+
) });
|
|
16664
|
+
}), $k = m.forwardRef((e, t) => {
|
|
16665
|
+
const { forceMount: n, ...r } = e, o = ln(kn, e.__scopeScrollArea), s = e.orientation === "horizontal", i = ri(() => l("SCROLL_END"), 100), [a, l] = Ok("hidden", {
|
|
16666
|
+
hidden: {
|
|
16667
|
+
SCROLL: "scrolling"
|
|
16668
|
+
},
|
|
16669
|
+
scrolling: {
|
|
16670
|
+
SCROLL_END: "idle",
|
|
16671
|
+
POINTER_ENTER: "interacting"
|
|
16672
|
+
},
|
|
16673
|
+
interacting: {
|
|
16674
|
+
SCROLL: "interacting",
|
|
16675
|
+
POINTER_LEAVE: "idle"
|
|
16676
|
+
},
|
|
16677
|
+
idle: {
|
|
16678
|
+
HIDE: "hidden",
|
|
16679
|
+
SCROLL: "scrolling",
|
|
16680
|
+
POINTER_ENTER: "interacting"
|
|
16806
16681
|
}
|
|
16807
|
-
|
|
16808
|
-
|
|
16809
|
-
|
|
16810
|
-
|
|
16811
|
-
|
|
16812
|
-
|
|
16813
|
-
}
|
|
16814
|
-
|
|
16815
|
-
|
|
16816
|
-
|
|
16817
|
-
|
|
16818
|
-
|
|
16819
|
-
|
|
16820
|
-
|
|
16821
|
-
|
|
16822
|
-
|
|
16823
|
-
|
|
16824
|
-
|
|
16825
|
-
|
|
16826
|
-
|
|
16827
|
-
|
|
16828
|
-
|
|
16829
|
-
|
|
16830
|
-
|
|
16831
|
-
|
|
16832
|
-
|
|
16833
|
-
|
|
16834
|
-
|
|
16835
|
-
|
|
16836
|
-
|
|
16837
|
-
|
|
16838
|
-
|
|
16839
|
-
|
|
16682
|
+
});
|
|
16683
|
+
return m.useEffect(() => {
|
|
16684
|
+
if (a === "idle") {
|
|
16685
|
+
const u = window.setTimeout(() => l("HIDE"), o.scrollHideDelay);
|
|
16686
|
+
return () => window.clearTimeout(u);
|
|
16687
|
+
}
|
|
16688
|
+
}, [a, o.scrollHideDelay, l]), m.useEffect(() => {
|
|
16689
|
+
const u = o.viewport, d = s ? "scrollLeft" : "scrollTop";
|
|
16690
|
+
if (u) {
|
|
16691
|
+
let f = u[d];
|
|
16692
|
+
const h = () => {
|
|
16693
|
+
const p = u[d];
|
|
16694
|
+
f !== p && (l("SCROLL"), i()), f = p;
|
|
16695
|
+
};
|
|
16696
|
+
return u.addEventListener("scroll", h), () => u.removeEventListener("scroll", h);
|
|
16697
|
+
}
|
|
16698
|
+
}, [o.viewport, s, l, i]), /* @__PURE__ */ c.jsx(an, { present: n || a !== "hidden", children: /* @__PURE__ */ c.jsx(
|
|
16699
|
+
kl,
|
|
16700
|
+
{
|
|
16701
|
+
"data-state": a === "hidden" ? "hidden" : "visible",
|
|
16702
|
+
...r,
|
|
16703
|
+
ref: t,
|
|
16704
|
+
onPointerEnter: pe(e.onPointerEnter, () => l("POINTER_ENTER")),
|
|
16705
|
+
onPointerLeave: pe(e.onPointerLeave, () => l("POINTER_LEAVE"))
|
|
16706
|
+
}
|
|
16707
|
+
) });
|
|
16708
|
+
}), kp = m.forwardRef((e, t) => {
|
|
16709
|
+
const n = ln(kn, e.__scopeScrollArea), { forceMount: r, ...o } = e, [s, i] = m.useState(!1), a = e.orientation === "horizontal", l = ri(() => {
|
|
16710
|
+
if (n.viewport) {
|
|
16711
|
+
const u = n.viewport.offsetWidth < n.viewport.scrollWidth, d = n.viewport.offsetHeight < n.viewport.scrollHeight;
|
|
16712
|
+
i(a ? u : d);
|
|
16713
|
+
}
|
|
16714
|
+
}, 10);
|
|
16715
|
+
return Nr(n.viewport, l), Nr(n.content, l), /* @__PURE__ */ c.jsx(an, { present: r || s, children: /* @__PURE__ */ c.jsx(
|
|
16716
|
+
kl,
|
|
16717
|
+
{
|
|
16718
|
+
"data-state": s ? "visible" : "hidden",
|
|
16719
|
+
...o,
|
|
16720
|
+
ref: t
|
|
16721
|
+
}
|
|
16722
|
+
) });
|
|
16723
|
+
}), kl = m.forwardRef((e, t) => {
|
|
16724
|
+
const { orientation: n = "vertical", ...r } = e, o = ln(kn, e.__scopeScrollArea), s = m.useRef(null), i = m.useRef(0), [a, l] = m.useState({
|
|
16725
|
+
content: 0,
|
|
16726
|
+
viewport: 0,
|
|
16727
|
+
scrollbar: { size: 0, paddingStart: 0, paddingEnd: 0 }
|
|
16728
|
+
}), u = Ap(a.viewport, a.content), d = {
|
|
16729
|
+
...r,
|
|
16730
|
+
sizes: a,
|
|
16731
|
+
onSizesChange: l,
|
|
16732
|
+
hasThumb: u > 0 && u < 1,
|
|
16733
|
+
onThumbChange: (h) => s.current = h,
|
|
16734
|
+
onThumbPointerUp: () => i.current = 0,
|
|
16735
|
+
onThumbPointerDown: (h) => i.current = h
|
|
16840
16736
|
};
|
|
16841
|
-
|
|
16842
|
-
|
|
16843
|
-
|
|
16844
|
-
|
|
16845
|
-
|
|
16846
|
-
|
|
16847
|
-
|
|
16848
|
-
|
|
16849
|
-
|
|
16850
|
-
|
|
16851
|
-
|
|
16852
|
-
|
|
16853
|
-
|
|
16854
|
-
}
|
|
16855
|
-
|
|
16856
|
-
|
|
16857
|
-
|
|
16858
|
-
|
|
16737
|
+
function f(h, p) {
|
|
16738
|
+
return Wk(h, i.current, a, p);
|
|
16739
|
+
}
|
|
16740
|
+
return n === "horizontal" ? /* @__PURE__ */ c.jsx(
|
|
16741
|
+
Fk,
|
|
16742
|
+
{
|
|
16743
|
+
...d,
|
|
16744
|
+
ref: t,
|
|
16745
|
+
onThumbPositionChange: () => {
|
|
16746
|
+
if (o.viewport && s.current) {
|
|
16747
|
+
const h = o.viewport.scrollLeft, p = mu(h, a, o.dir);
|
|
16748
|
+
s.current.style.transform = `translate3d(${p}px, 0, 0)`;
|
|
16749
|
+
}
|
|
16750
|
+
},
|
|
16751
|
+
onWheelScroll: (h) => {
|
|
16752
|
+
o.viewport && (o.viewport.scrollLeft = h);
|
|
16753
|
+
},
|
|
16754
|
+
onDragScroll: (h) => {
|
|
16755
|
+
o.viewport && (o.viewport.scrollLeft = f(h, o.dir));
|
|
16859
16756
|
}
|
|
16860
|
-
|
|
16861
|
-
|
|
16862
|
-
|
|
16757
|
+
}
|
|
16758
|
+
) : n === "vertical" ? /* @__PURE__ */ c.jsx(
|
|
16759
|
+
Bk,
|
|
16760
|
+
{
|
|
16761
|
+
...d,
|
|
16762
|
+
ref: t,
|
|
16763
|
+
onThumbPositionChange: () => {
|
|
16764
|
+
if (o.viewport && s.current) {
|
|
16765
|
+
const h = o.viewport.scrollTop, p = mu(h, a);
|
|
16766
|
+
s.current.style.transform = `translate3d(0, ${p}px, 0)`;
|
|
16767
|
+
}
|
|
16768
|
+
},
|
|
16769
|
+
onWheelScroll: (h) => {
|
|
16770
|
+
o.viewport && (o.viewport.scrollTop = h);
|
|
16771
|
+
},
|
|
16772
|
+
onDragScroll: (h) => {
|
|
16773
|
+
o.viewport && (o.viewport.scrollTop = f(h));
|
|
16863
16774
|
}
|
|
16864
|
-
|
|
16865
|
-
|
|
16866
|
-
|
|
16775
|
+
}
|
|
16776
|
+
) : null;
|
|
16777
|
+
}), Fk = m.forwardRef((e, t) => {
|
|
16778
|
+
const { sizes: n, onSizesChange: r, ...o } = e, s = ln(kn, e.__scopeScrollArea), [i, a] = m.useState(), l = m.useRef(null), u = qe(t, l, s.onScrollbarXChange);
|
|
16779
|
+
return m.useEffect(() => {
|
|
16780
|
+
l.current && a(getComputedStyle(l.current));
|
|
16781
|
+
}, [l]), /* @__PURE__ */ c.jsx(
|
|
16782
|
+
Ep,
|
|
16783
|
+
{
|
|
16784
|
+
"data-orientation": "horizontal",
|
|
16785
|
+
...o,
|
|
16786
|
+
ref: u,
|
|
16787
|
+
sizes: n,
|
|
16788
|
+
style: {
|
|
16789
|
+
bottom: 0,
|
|
16790
|
+
left: s.dir === "rtl" ? "var(--radix-scroll-area-corner-width)" : 0,
|
|
16791
|
+
right: s.dir === "ltr" ? "var(--radix-scroll-area-corner-width)" : 0,
|
|
16792
|
+
"--radix-scroll-area-thumb-width": ni(n) + "px",
|
|
16793
|
+
...e.style
|
|
16794
|
+
},
|
|
16795
|
+
onThumbPointerDown: (d) => e.onThumbPointerDown(d.x),
|
|
16796
|
+
onDragScroll: (d) => e.onDragScroll(d.x),
|
|
16797
|
+
onWheelScroll: (d, f) => {
|
|
16798
|
+
if (s.viewport) {
|
|
16799
|
+
const h = s.viewport.scrollLeft + d.deltaX;
|
|
16800
|
+
e.onWheelScroll(h), _p(h, f) && d.preventDefault();
|
|
16801
|
+
}
|
|
16802
|
+
},
|
|
16803
|
+
onResize: () => {
|
|
16804
|
+
l.current && s.viewport && i && r({
|
|
16805
|
+
content: s.viewport.scrollWidth,
|
|
16806
|
+
viewport: s.viewport.offsetWidth,
|
|
16807
|
+
scrollbar: {
|
|
16808
|
+
size: l.current.clientWidth,
|
|
16809
|
+
paddingStart: ws(i.paddingLeft),
|
|
16810
|
+
paddingEnd: ws(i.paddingRight)
|
|
16811
|
+
}
|
|
16812
|
+
});
|
|
16867
16813
|
}
|
|
16868
|
-
|
|
16869
|
-
|
|
16870
|
-
|
|
16814
|
+
}
|
|
16815
|
+
);
|
|
16816
|
+
}), Bk = m.forwardRef((e, t) => {
|
|
16817
|
+
const { sizes: n, onSizesChange: r, ...o } = e, s = ln(kn, e.__scopeScrollArea), [i, a] = m.useState(), l = m.useRef(null), u = qe(t, l, s.onScrollbarYChange);
|
|
16818
|
+
return m.useEffect(() => {
|
|
16819
|
+
l.current && a(getComputedStyle(l.current));
|
|
16820
|
+
}, [l]), /* @__PURE__ */ c.jsx(
|
|
16821
|
+
Ep,
|
|
16822
|
+
{
|
|
16823
|
+
"data-orientation": "vertical",
|
|
16824
|
+
...o,
|
|
16825
|
+
ref: u,
|
|
16826
|
+
sizes: n,
|
|
16827
|
+
style: {
|
|
16828
|
+
top: 0,
|
|
16829
|
+
right: s.dir === "ltr" ? 0 : void 0,
|
|
16830
|
+
left: s.dir === "rtl" ? 0 : void 0,
|
|
16831
|
+
bottom: "var(--radix-scroll-area-corner-height)",
|
|
16832
|
+
"--radix-scroll-area-thumb-height": ni(n) + "px",
|
|
16833
|
+
...e.style
|
|
16834
|
+
},
|
|
16835
|
+
onThumbPointerDown: (d) => e.onThumbPointerDown(d.y),
|
|
16836
|
+
onDragScroll: (d) => e.onDragScroll(d.y),
|
|
16837
|
+
onWheelScroll: (d, f) => {
|
|
16838
|
+
if (s.viewport) {
|
|
16839
|
+
const h = s.viewport.scrollTop + d.deltaY;
|
|
16840
|
+
e.onWheelScroll(h), _p(h, f) && d.preventDefault();
|
|
16841
|
+
}
|
|
16842
|
+
},
|
|
16843
|
+
onResize: () => {
|
|
16844
|
+
l.current && s.viewport && i && r({
|
|
16845
|
+
content: s.viewport.scrollHeight,
|
|
16846
|
+
viewport: s.viewport.offsetHeight,
|
|
16847
|
+
scrollbar: {
|
|
16848
|
+
size: l.current.clientHeight,
|
|
16849
|
+
paddingStart: ws(i.paddingTop),
|
|
16850
|
+
paddingEnd: ws(i.paddingBottom)
|
|
16851
|
+
}
|
|
16852
|
+
});
|
|
16871
16853
|
}
|
|
16872
|
-
|
|
16873
|
-
|
|
16874
|
-
|
|
16875
|
-
|
|
16876
|
-
|
|
16877
|
-
|
|
16854
|
+
}
|
|
16855
|
+
);
|
|
16856
|
+
}), [zk, Ip] = bp(kn), Ep = m.forwardRef((e, t) => {
|
|
16857
|
+
const {
|
|
16858
|
+
__scopeScrollArea: n,
|
|
16859
|
+
sizes: r,
|
|
16860
|
+
hasThumb: o,
|
|
16861
|
+
onThumbChange: s,
|
|
16862
|
+
onThumbPointerUp: i,
|
|
16863
|
+
onThumbPointerDown: a,
|
|
16864
|
+
onThumbPositionChange: l,
|
|
16865
|
+
onDragScroll: u,
|
|
16866
|
+
onWheelScroll: d,
|
|
16867
|
+
onResize: f,
|
|
16868
|
+
...h
|
|
16869
|
+
} = e, p = ln(kn, n), [y, g] = m.useState(null), v = qe(t, (_) => g(_)), x = m.useRef(null), w = m.useRef(""), C = p.viewport, T = r.content - r.viewport, b = Pt(d), S = Pt(l), k = ri(f, 10);
|
|
16870
|
+
function R(_) {
|
|
16871
|
+
if (x.current) {
|
|
16872
|
+
const O = _.clientX - x.current.left, F = _.clientY - x.current.top;
|
|
16873
|
+
u({ x: O, y: F });
|
|
16874
|
+
}
|
|
16875
|
+
}
|
|
16876
|
+
return m.useEffect(() => {
|
|
16877
|
+
const _ = (O) => {
|
|
16878
|
+
const F = O.target;
|
|
16879
|
+
(y == null ? void 0 : y.contains(F)) && b(O, T);
|
|
16880
|
+
};
|
|
16881
|
+
return document.addEventListener("wheel", _, { passive: !1 }), () => document.removeEventListener("wheel", _, { passive: !1 });
|
|
16882
|
+
}, [C, y, T, b]), m.useEffect(S, [r, S]), Nr(y, k), Nr(p.content, k), /* @__PURE__ */ c.jsx(
|
|
16883
|
+
zk,
|
|
16884
|
+
{
|
|
16885
|
+
scope: n,
|
|
16886
|
+
scrollbar: y,
|
|
16887
|
+
hasThumb: o,
|
|
16888
|
+
onThumbChange: Pt(s),
|
|
16889
|
+
onThumbPointerUp: Pt(i),
|
|
16890
|
+
onThumbPositionChange: S,
|
|
16891
|
+
onThumbPointerDown: Pt(a),
|
|
16892
|
+
children: /* @__PURE__ */ c.jsx(
|
|
16893
|
+
Ce.div,
|
|
16894
|
+
{
|
|
16895
|
+
...h,
|
|
16896
|
+
ref: v,
|
|
16897
|
+
style: { position: "absolute", ...h.style },
|
|
16898
|
+
onPointerDown: pe(e.onPointerDown, (_) => {
|
|
16899
|
+
_.button === 0 && (_.target.setPointerCapture(_.pointerId), x.current = y.getBoundingClientRect(), w.current = document.body.style.webkitUserSelect, document.body.style.webkitUserSelect = "none", p.viewport && (p.viewport.style.scrollBehavior = "auto"), R(_));
|
|
16900
|
+
}),
|
|
16901
|
+
onPointerMove: pe(e.onPointerMove, R),
|
|
16902
|
+
onPointerUp: pe(e.onPointerUp, (_) => {
|
|
16903
|
+
const O = _.target;
|
|
16904
|
+
O.hasPointerCapture(_.pointerId) && O.releasePointerCapture(_.pointerId), document.body.style.webkitUserSelect = w.current, p.viewport && (p.viewport.style.scrollBehavior = ""), x.current = null;
|
|
16905
|
+
})
|
|
16878
16906
|
}
|
|
16879
|
-
|
|
16907
|
+
)
|
|
16880
16908
|
}
|
|
16881
|
-
|
|
16882
|
-
}),
|
|
16883
|
-
|
|
16884
|
-
|
|
16885
|
-
|
|
16886
|
-
if (!u) return a.item(o, i == null ? void 0 : i.id);
|
|
16887
|
-
}, [u]);
|
|
16888
|
-
let d = Np(o, s, [e.value, e.children, s], e.keywords), f = Il(), h = Bn((S) => S.value && S.value === d.current), p = Bn((S) => u || a.filter() === !1 ? !0 : S.search ? S.filtered.items.get(o) > 0 : !0);
|
|
16889
|
-
m.useEffect(() => {
|
|
16890
|
-
let S = s.current;
|
|
16891
|
-
if (!(!S || e.disabled)) return S.addEventListener(ha, y), () => S.removeEventListener(ha, y);
|
|
16892
|
-
}, [p, e.onSelect, e.disabled]);
|
|
16893
|
-
function y() {
|
|
16894
|
-
var S, k;
|
|
16895
|
-
g(), (k = (S = l.current).onSelect) == null || k.call(S, d.current);
|
|
16896
|
-
}
|
|
16897
|
-
function g() {
|
|
16898
|
-
f.setState("value", d.current, !0);
|
|
16909
|
+
);
|
|
16910
|
+
}), vs = "ScrollAreaThumb", Rp = m.forwardRef(
|
|
16911
|
+
(e, t) => {
|
|
16912
|
+
const { forceMount: n, ...r } = e, o = Ip(vs, e.__scopeScrollArea);
|
|
16913
|
+
return /* @__PURE__ */ c.jsx(an, { present: n || o.hasThumb, children: /* @__PURE__ */ c.jsx(Uk, { ref: t, ...r }) });
|
|
16899
16914
|
}
|
|
16900
|
-
|
|
16901
|
-
|
|
16902
|
-
|
|
16903
|
-
|
|
16904
|
-
|
|
16905
|
-
|
|
16906
|
-
|
|
16907
|
-
|
|
16908
|
-
|
|
16909
|
-
|
|
16910
|
-
|
|
16911
|
-
|
|
16912
|
-
|
|
16913
|
-
|
|
16914
|
-
|
|
16915
|
-
|
|
16916
|
-
|
|
16917
|
-
|
|
16918
|
-
}
|
|
16919
|
-
|
|
16920
|
-
|
|
16921
|
-
|
|
16922
|
-
|
|
16923
|
-
|
|
16924
|
-
|
|
16925
|
-
|
|
16926
|
-
|
|
16927
|
-
|
|
16928
|
-
|
|
16929
|
-
|
|
16930
|
-
|
|
16931
|
-
|
|
16932
|
-
|
|
16933
|
-
}),
|
|
16934
|
-
|
|
16935
|
-
|
|
16936
|
-
|
|
16937
|
-
let { progress: n, children: r, label: o = "Loading...", ...s } = e;
|
|
16938
|
-
return m.createElement(Ce.div, { ref: t, ...s, "cmdk-loading": "", role: "progressbar", "aria-valuenow": n, "aria-valuemin": 0, "aria-valuemax": 100, "aria-label": o }, ri(e, (i) => m.createElement("div", { "aria-hidden": !0 }, i)));
|
|
16939
|
-
}), Yt = Object.assign(Ep, { List: $k, Item: Pk, Input: Lk, Group: Ok, Separator: Dk, Dialog: Fk, Empty: Bk, Loading: zk });
|
|
16940
|
-
function Uk(e, t) {
|
|
16941
|
-
let n = e.nextElementSibling;
|
|
16942
|
-
for (; n; ) {
|
|
16943
|
-
if (n.matches(t)) return n;
|
|
16944
|
-
n = n.nextElementSibling;
|
|
16915
|
+
), Uk = m.forwardRef(
|
|
16916
|
+
(e, t) => {
|
|
16917
|
+
const { __scopeScrollArea: n, style: r, ...o } = e, s = ln(vs, n), i = Ip(vs, n), { onThumbPositionChange: a } = i, l = qe(
|
|
16918
|
+
t,
|
|
16919
|
+
(f) => i.onThumbChange(f)
|
|
16920
|
+
), u = m.useRef(void 0), d = ri(() => {
|
|
16921
|
+
u.current && (u.current(), u.current = void 0);
|
|
16922
|
+
}, 100);
|
|
16923
|
+
return m.useEffect(() => {
|
|
16924
|
+
const f = s.viewport;
|
|
16925
|
+
if (f) {
|
|
16926
|
+
const h = () => {
|
|
16927
|
+
if (d(), !u.current) {
|
|
16928
|
+
const p = Vk(f, a);
|
|
16929
|
+
u.current = p, a();
|
|
16930
|
+
}
|
|
16931
|
+
};
|
|
16932
|
+
return a(), f.addEventListener("scroll", h), () => f.removeEventListener("scroll", h);
|
|
16933
|
+
}
|
|
16934
|
+
}, [s.viewport, d, a]), /* @__PURE__ */ c.jsx(
|
|
16935
|
+
Ce.div,
|
|
16936
|
+
{
|
|
16937
|
+
"data-state": i.hasThumb ? "visible" : "hidden",
|
|
16938
|
+
...o,
|
|
16939
|
+
ref: l,
|
|
16940
|
+
style: {
|
|
16941
|
+
width: "var(--radix-scroll-area-thumb-width)",
|
|
16942
|
+
height: "var(--radix-scroll-area-thumb-height)",
|
|
16943
|
+
...r
|
|
16944
|
+
},
|
|
16945
|
+
onPointerDownCapture: pe(e.onPointerDownCapture, (f) => {
|
|
16946
|
+
const p = f.target.getBoundingClientRect(), y = f.clientX - p.left, g = f.clientY - p.top;
|
|
16947
|
+
i.onThumbPointerDown({ x: y, y: g });
|
|
16948
|
+
}),
|
|
16949
|
+
onPointerUp: pe(e.onPointerUp, i.onThumbPointerUp)
|
|
16950
|
+
}
|
|
16951
|
+
);
|
|
16945
16952
|
}
|
|
16946
|
-
|
|
16947
|
-
|
|
16948
|
-
|
|
16949
|
-
|
|
16950
|
-
|
|
16951
|
-
n
|
|
16953
|
+
);
|
|
16954
|
+
Rp.displayName = vs;
|
|
16955
|
+
var Il = "ScrollAreaCorner", Np = m.forwardRef(
|
|
16956
|
+
(e, t) => {
|
|
16957
|
+
const n = ln(Il, e.__scopeScrollArea), r = !!(n.scrollbarX && n.scrollbarY);
|
|
16958
|
+
return n.type !== "scroll" && r ? /* @__PURE__ */ c.jsx(Hk, { ...e, ref: t }) : null;
|
|
16952
16959
|
}
|
|
16960
|
+
);
|
|
16961
|
+
Np.displayName = Il;
|
|
16962
|
+
var Hk = m.forwardRef((e, t) => {
|
|
16963
|
+
const { __scopeScrollArea: n, ...r } = e, o = ln(Il, n), [s, i] = m.useState(0), [a, l] = m.useState(0), u = !!(s && a);
|
|
16964
|
+
return Nr(o.scrollbarX, () => {
|
|
16965
|
+
var f;
|
|
16966
|
+
const d = ((f = o.scrollbarX) == null ? void 0 : f.offsetHeight) || 0;
|
|
16967
|
+
o.onCornerHeightChange(d), l(d);
|
|
16968
|
+
}), Nr(o.scrollbarY, () => {
|
|
16969
|
+
var f;
|
|
16970
|
+
const d = ((f = o.scrollbarY) == null ? void 0 : f.offsetWidth) || 0;
|
|
16971
|
+
o.onCornerWidthChange(d), i(d);
|
|
16972
|
+
}), u ? /* @__PURE__ */ c.jsx(
|
|
16973
|
+
Ce.div,
|
|
16974
|
+
{
|
|
16975
|
+
...r,
|
|
16976
|
+
ref: t,
|
|
16977
|
+
style: {
|
|
16978
|
+
width: s,
|
|
16979
|
+
height: a,
|
|
16980
|
+
position: "absolute",
|
|
16981
|
+
right: o.dir === "ltr" ? 0 : void 0,
|
|
16982
|
+
left: o.dir === "rtl" ? 0 : void 0,
|
|
16983
|
+
bottom: 0,
|
|
16984
|
+
...e.style
|
|
16985
|
+
}
|
|
16986
|
+
}
|
|
16987
|
+
) : null;
|
|
16988
|
+
});
|
|
16989
|
+
function ws(e) {
|
|
16990
|
+
return e ? parseInt(e, 10) : 0;
|
|
16953
16991
|
}
|
|
16954
|
-
function
|
|
16955
|
-
|
|
16956
|
-
return
|
|
16957
|
-
t.current = e;
|
|
16958
|
-
}), t;
|
|
16992
|
+
function Ap(e, t) {
|
|
16993
|
+
const n = e / t;
|
|
16994
|
+
return isNaN(n) ? 0 : n;
|
|
16959
16995
|
}
|
|
16960
|
-
|
|
16961
|
-
|
|
16962
|
-
|
|
16963
|
-
return t.current === void 0 && (t.current = e()), t;
|
|
16996
|
+
function ni(e) {
|
|
16997
|
+
const t = Ap(e.viewport, e.content), n = e.scrollbar.paddingStart + e.scrollbar.paddingEnd, r = (e.scrollbar.size - n) * t;
|
|
16998
|
+
return Math.max(r, 18);
|
|
16964
16999
|
}
|
|
16965
|
-
function
|
|
16966
|
-
|
|
16967
|
-
return
|
|
17000
|
+
function Wk(e, t, n, r = "ltr") {
|
|
17001
|
+
const o = ni(n), s = o / 2, i = t || s, a = o - i, l = n.scrollbar.paddingStart + i, u = n.scrollbar.size - n.scrollbar.paddingEnd - a, d = n.content - n.viewport, f = r === "ltr" ? [0, d] : [d * -1, 0];
|
|
17002
|
+
return jp([l, u], f)(e);
|
|
16968
17003
|
}
|
|
16969
|
-
function
|
|
16970
|
-
|
|
16971
|
-
return
|
|
16972
|
-
var i;
|
|
16973
|
-
let a = (() => {
|
|
16974
|
-
var u;
|
|
16975
|
-
for (let d of n) {
|
|
16976
|
-
if (typeof d == "string") return d.trim();
|
|
16977
|
-
if (typeof d == "object" && "current" in d) return d.current ? (u = d.current.textContent) == null ? void 0 : u.trim() : o.current;
|
|
16978
|
-
}
|
|
16979
|
-
})(), l = r.map((u) => u.trim());
|
|
16980
|
-
s.value(e, a, l), (i = t.current) == null || i.setAttribute(gr, a), o.current = a;
|
|
16981
|
-
}), o;
|
|
17004
|
+
function mu(e, t, n = "ltr") {
|
|
17005
|
+
const r = ni(t), o = t.scrollbar.paddingStart + t.scrollbar.paddingEnd, s = t.scrollbar.size - o, i = t.content - t.viewport, a = s - r, l = n === "ltr" ? [0, i] : [i * -1, 0], u = ha(e, l);
|
|
17006
|
+
return jp([0, i], [0, a])(u);
|
|
16982
17007
|
}
|
|
16983
|
-
|
|
16984
|
-
|
|
16985
|
-
|
|
16986
|
-
|
|
16987
|
-
|
|
16988
|
-
n.current.set(r, o), t({});
|
|
17008
|
+
function jp(e, t) {
|
|
17009
|
+
return (n) => {
|
|
17010
|
+
if (e[0] === e[1] || t[0] === t[1]) return t[0];
|
|
17011
|
+
const r = (t[1] - t[0]) / (e[1] - e[0]);
|
|
17012
|
+
return t[0] + r * (n - e[0]);
|
|
16989
17013
|
};
|
|
16990
|
-
};
|
|
16991
|
-
function Vk(e) {
|
|
16992
|
-
let t = e.type;
|
|
16993
|
-
return typeof t == "function" ? t(e.props) : "render" in t ? t.render(e.props) : e;
|
|
16994
17014
|
}
|
|
16995
|
-
function
|
|
16996
|
-
return e
|
|
17015
|
+
function _p(e, t) {
|
|
17016
|
+
return e > 0 && e < t;
|
|
16997
17017
|
}
|
|
16998
|
-
var
|
|
16999
|
-
|
|
17000
|
-
|
|
17001
|
-
{
|
|
17002
|
-
|
|
17003
|
-
|
|
17004
|
-
|
|
17005
|
-
|
|
17006
|
-
|
|
17007
|
-
|
|
17008
|
-
|
|
17009
|
-
));
|
|
17010
|
-
|
|
17011
|
-
|
|
17012
|
-
|
|
17013
|
-
|
|
17014
|
-
|
|
17015
|
-
|
|
17016
|
-
|
|
17017
|
-
|
|
17018
|
-
|
|
17019
|
-
|
|
17020
|
-
),
|
|
17021
|
-
|
|
17018
|
+
var Vk = (e, t = () => {
|
|
17019
|
+
}) => {
|
|
17020
|
+
let n = { left: e.scrollLeft, top: e.scrollTop }, r = 0;
|
|
17021
|
+
return function o() {
|
|
17022
|
+
const s = { left: e.scrollLeft, top: e.scrollTop }, i = n.left !== s.left, a = n.top !== s.top;
|
|
17023
|
+
(i || a) && t(), n = s, r = window.requestAnimationFrame(o);
|
|
17024
|
+
}(), () => window.cancelAnimationFrame(r);
|
|
17025
|
+
};
|
|
17026
|
+
function ri(e, t) {
|
|
17027
|
+
const n = Pt(e), r = m.useRef(0);
|
|
17028
|
+
return m.useEffect(() => () => window.clearTimeout(r.current), []), m.useCallback(() => {
|
|
17029
|
+
window.clearTimeout(r.current), r.current = window.setTimeout(n, t);
|
|
17030
|
+
}, [n, t]);
|
|
17031
|
+
}
|
|
17032
|
+
function Nr(e, t) {
|
|
17033
|
+
const n = Pt(t);
|
|
17034
|
+
Ot(() => {
|
|
17035
|
+
let r = 0;
|
|
17036
|
+
if (e) {
|
|
17037
|
+
const o = new ResizeObserver(() => {
|
|
17038
|
+
cancelAnimationFrame(r), r = window.requestAnimationFrame(n);
|
|
17039
|
+
});
|
|
17040
|
+
return o.observe(e), () => {
|
|
17041
|
+
window.cancelAnimationFrame(r), o.unobserve(e);
|
|
17042
|
+
};
|
|
17022
17043
|
}
|
|
17023
|
-
)
|
|
17024
|
-
|
|
17025
|
-
|
|
17026
|
-
const
|
|
17027
|
-
|
|
17028
|
-
{
|
|
17029
|
-
ref: n,
|
|
17030
|
-
className: oe("max-h-[300px] overflow-y-auto overflow-x-hidden", e),
|
|
17031
|
-
...t
|
|
17032
|
-
}
|
|
17033
|
-
));
|
|
17034
|
-
_p.displayName = Yt.List.displayName;
|
|
17035
|
-
const Mp = m.forwardRef((e, t) => /* @__PURE__ */ c.jsx(
|
|
17036
|
-
Yt.Empty,
|
|
17037
|
-
{
|
|
17038
|
-
ref: t,
|
|
17039
|
-
className: "py-6 text-center text-sm",
|
|
17040
|
-
...e
|
|
17041
|
-
}
|
|
17042
|
-
));
|
|
17043
|
-
Mp.displayName = Yt.Empty.displayName;
|
|
17044
|
-
const Pp = m.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ c.jsx(
|
|
17045
|
-
Yt.Group,
|
|
17046
|
-
{
|
|
17047
|
-
ref: n,
|
|
17048
|
-
className: oe(
|
|
17049
|
-
"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",
|
|
17050
|
-
e
|
|
17051
|
-
),
|
|
17052
|
-
...t
|
|
17053
|
-
}
|
|
17054
|
-
));
|
|
17055
|
-
Pp.displayName = Yt.Group.displayName;
|
|
17056
|
-
const qk = m.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ c.jsx(
|
|
17057
|
-
Yt.Separator,
|
|
17044
|
+
}, [e, n]);
|
|
17045
|
+
}
|
|
17046
|
+
var Mp = Sp, Kk = Tp, qk = Np;
|
|
17047
|
+
const Pp = m.forwardRef(({ className: e, children: t, ...n }, r) => /* @__PURE__ */ c.jsxs(
|
|
17048
|
+
Mp,
|
|
17058
17049
|
{
|
|
17059
|
-
ref:
|
|
17060
|
-
className: oe("
|
|
17061
|
-
...
|
|
17050
|
+
ref: r,
|
|
17051
|
+
className: oe("relative overflow-hidden", e),
|
|
17052
|
+
...n,
|
|
17053
|
+
children: [
|
|
17054
|
+
/* @__PURE__ */ c.jsx(Kk, { className: "h-full w-full rounded-[inherit] overflow-auto", children: t }),
|
|
17055
|
+
/* @__PURE__ */ c.jsx(Op, {}),
|
|
17056
|
+
/* @__PURE__ */ c.jsx(qk, {})
|
|
17057
|
+
]
|
|
17062
17058
|
}
|
|
17063
17059
|
));
|
|
17064
|
-
|
|
17065
|
-
const Op = m.forwardRef(({ className: e,
|
|
17066
|
-
|
|
17060
|
+
Pp.displayName = Mp.displayName;
|
|
17061
|
+
const Op = m.forwardRef(({ className: e, orientation: t = "vertical", ...n }, r) => /* @__PURE__ */ c.jsx(
|
|
17062
|
+
Tl,
|
|
17067
17063
|
{
|
|
17068
|
-
ref:
|
|
17064
|
+
ref: r,
|
|
17065
|
+
orientation: t,
|
|
17069
17066
|
className: oe(
|
|
17070
|
-
"
|
|
17067
|
+
"flex touch-none select-none transition-colors",
|
|
17068
|
+
t === "vertical" && "h-full w-2.5 border-l border-l-transparent p-[1px]",
|
|
17069
|
+
t === "horizontal" && "h-2.5 flex-col border-t border-t-transparent p-[1px]",
|
|
17071
17070
|
e
|
|
17072
17071
|
),
|
|
17073
|
-
...
|
|
17072
|
+
...n,
|
|
17073
|
+
children: /* @__PURE__ */ c.jsx(Rp, { className: "relative flex-1 rounded-full bg-border" })
|
|
17074
17074
|
}
|
|
17075
17075
|
));
|
|
17076
|
-
Op.displayName =
|
|
17076
|
+
Op.displayName = Tl.displayName;
|
|
17077
17077
|
const bs = m.forwardRef(
|
|
17078
17078
|
({ className: e, type: t, ...n }, r) => /* @__PURE__ */ c.jsx(
|
|
17079
17079
|
"input",
|
|
@@ -17417,7 +17417,7 @@ function xu({
|
|
|
17417
17417
|
}
|
|
17418
17418
|
),
|
|
17419
17419
|
/* @__PURE__ */ c.jsx(
|
|
17420
|
-
|
|
17420
|
+
Pp,
|
|
17421
17421
|
{
|
|
17422
17422
|
ref: N,
|
|
17423
17423
|
className: `flex-1 min-h-0 ${s.threadList || ""}`,
|
|
@@ -17456,9 +17456,9 @@ function xu({
|
|
|
17456
17456
|
),
|
|
17457
17457
|
/* @__PURE__ */ c.jsx(Kh, { open: B, onOpenChange: (J) => !J && Ve(), children: /* @__PURE__ */ c.jsxs(ml, { className: "max-w-md p-0", children: [
|
|
17458
17458
|
/* @__PURE__ */ c.jsx(gl, { children: /* @__PURE__ */ c.jsx(xl, { children: "Share thread" }) }),
|
|
17459
|
-
/* @__PURE__ */ c.jsxs(
|
|
17459
|
+
/* @__PURE__ */ c.jsxs(mp, { children: [
|
|
17460
17460
|
/* @__PURE__ */ c.jsx(
|
|
17461
|
-
|
|
17461
|
+
gp,
|
|
17462
17462
|
{
|
|
17463
17463
|
autoFocus: !0,
|
|
17464
17464
|
value: ae,
|
|
@@ -17466,7 +17466,7 @@ function xu({
|
|
|
17466
17466
|
placeholder: "Search for users (name, email, id)..."
|
|
17467
17467
|
}
|
|
17468
17468
|
),
|
|
17469
|
-
/* @__PURE__ */ c.jsxs(
|
|
17469
|
+
/* @__PURE__ */ c.jsxs(xp, { children: [
|
|
17470
17470
|
F && /* @__PURE__ */ c.jsxs("div", { className: "flex items-center gap-2 px-3 py-2 text-xs text-muted-foreground", children: [
|
|
17471
17471
|
O && /* @__PURE__ */ c.jsx(Gn, { className: "h-3 w-3 animate-spin" }),
|
|
17472
17472
|
/* @__PURE__ */ c.jsx(
|
|
@@ -17477,13 +17477,13 @@ function xu({
|
|
|
17477
17477
|
}
|
|
17478
17478
|
)
|
|
17479
17479
|
] }),
|
|
17480
|
-
/* @__PURE__ */ c.jsx(
|
|
17480
|
+
/* @__PURE__ */ c.jsx(yp, { children: R ? /* @__PURE__ */ c.jsxs("span", { className: "flex items-center gap-2 text-sm text-muted-foreground", children: [
|
|
17481
17481
|
/* @__PURE__ */ c.jsx(Gn, { className: "h-4 w-4 animate-spin" }),
|
|
17482
17482
|
"Loading users…"
|
|
17483
17483
|
] }) : "No matching users found" }),
|
|
17484
|
-
/* @__PURE__ */ c.jsx(
|
|
17484
|
+
/* @__PURE__ */ c.jsx(vp, { heading: "Users", children: it.map((J) => {
|
|
17485
17485
|
const L = J.username ?? J.user_id ?? J.email ?? "Unknown user", he = [J.email, J.user_id].filter(Boolean).join(" • "), be = J.user_id ?? J.id ?? J.username ?? J.email ?? L;
|
|
17486
|
-
return /* @__PURE__ */ c.jsx(
|
|
17486
|
+
return /* @__PURE__ */ c.jsx(wp, { onSelect: () => Ze(J), children: /* @__PURE__ */ c.jsxs("div", { className: "flex flex-col items-start text-sm", children: [
|
|
17487
17487
|
/* @__PURE__ */ c.jsx("span", { className: "font-medium", children: L }),
|
|
17488
17488
|
he && /* @__PURE__ */ c.jsx("span", { className: "text-xs text-muted-foreground", children: he })
|
|
17489
17489
|
] }) }, be);
|
|
@@ -18072,7 +18072,7 @@ var bI = "SelectItemAlignedPosition", tm = m.forwardRef((e, t) => {
|
|
|
18072
18072
|
if (s.trigger && s.valueNode && a && u && g && v && x) {
|
|
18073
18073
|
const k = s.trigger.getBoundingClientRect(), R = u.getBoundingClientRect(), _ = s.valueNode.getBoundingClientRect(), O = x.getBoundingClientRect();
|
|
18074
18074
|
if (s.dir !== "rtl") {
|
|
18075
|
-
const ee = O.left - R.left, Z = _.left - ee, xe = k.left - Z, ae = k.width + xe, re = Math.max(ae, R.width), me = window.innerWidth - cn, we =
|
|
18075
|
+
const ee = O.left - R.left, Z = _.left - ee, xe = k.left - Z, ae = k.width + xe, re = Math.max(ae, R.width), me = window.innerWidth - cn, we = ha(Z, [
|
|
18076
18076
|
cn,
|
|
18077
18077
|
// Prevents the content from going off the starting edge of the
|
|
18078
18078
|
// viewport. It may still go off the ending edge, but this can be
|
|
@@ -18083,7 +18083,7 @@ var bI = "SelectItemAlignedPosition", tm = m.forwardRef((e, t) => {
|
|
|
18083
18083
|
]);
|
|
18084
18084
|
a.style.minWidth = ae + "px", a.style.left = we + "px";
|
|
18085
18085
|
} else {
|
|
18086
|
-
const ee = R.right - O.right, Z = window.innerWidth - _.right - ee, xe = window.innerWidth - k.right - Z, ae = k.width + xe, re = Math.max(ae, R.width), me = window.innerWidth - cn, we =
|
|
18086
|
+
const ee = R.right - O.right, Z = window.innerWidth - _.right - ee, xe = window.innerWidth - k.right - Z, ae = k.width + xe, re = Math.max(ae, R.width), me = window.innerWidth - cn, we = ha(Z, [
|
|
18087
18087
|
cn,
|
|
18088
18088
|
Math.max(cn, me - re)
|
|
18089
18089
|
]);
|