@sanity/ui 3.0.13 → 3.0.15-canary.0

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 (48) hide show
  1. package/dist/_chunks-cjs/_visual-editing.js +886 -1751
  2. package/dist/_chunks-cjs/_visual-editing.js.map +1 -1
  3. package/dist/_chunks-cjs/refractor.js +7 -15
  4. package/dist/_chunks-cjs/refractor.js.map +1 -1
  5. package/dist/_chunks-es/_visual-editing.mjs +887 -1753
  6. package/dist/_chunks-es/_visual-editing.mjs.map +1 -1
  7. package/dist/_chunks-es/refractor.mjs +6 -15
  8. package/dist/_chunks-es/refractor.mjs.map +1 -1
  9. package/dist/index.d.mts +1 -1
  10. package/dist/index.d.ts +1 -1
  11. package/dist/index.js +349 -810
  12. package/dist/index.js.map +1 -1
  13. package/dist/index.mjs +350 -812
  14. package/dist/index.mjs.map +1 -1
  15. package/package.json +27 -41
  16. package/src/core/components/autocomplete/autocomplete.tsx +10 -14
  17. package/src/core/components/breadcrumbs/breadcrumbs.tsx +3 -2
  18. package/src/core/components/dialog/dialog.tsx +10 -14
  19. package/src/core/components/hotkeys/hotkeys.tsx +2 -2
  20. package/src/core/components/menu/menuGroup.tsx +2 -2
  21. package/src/core/components/menu/menuItem.tsx +4 -4
  22. package/src/core/components/skeleton/skeleton.tsx +2 -2
  23. package/src/core/components/skeleton/textSkeleton.tsx +5 -6
  24. package/src/core/hooks/index.ts +1 -1
  25. package/src/core/hooks/useArrayProp.ts +3 -17
  26. package/src/core/primitives/avatar/avatar.tsx +14 -16
  27. package/src/core/primitives/avatar/avatarCounter.tsx +14 -17
  28. package/src/core/primitives/avatar/avatarStack.tsx +2 -3
  29. package/src/core/primitives/badge/badge.tsx +3 -3
  30. package/src/core/primitives/box/box.tsx +26 -26
  31. package/src/core/primitives/button/button.tsx +11 -12
  32. package/src/core/primitives/card/card.tsx +8 -8
  33. package/src/core/primitives/code/code.tsx +8 -2
  34. package/src/core/primitives/container/container.tsx +2 -2
  35. package/src/core/primitives/flex/flex.tsx +6 -6
  36. package/src/core/primitives/grid/grid.tsx +9 -9
  37. package/src/core/primitives/heading/heading.tsx +3 -3
  38. package/src/core/primitives/inline/inline.tsx +2 -2
  39. package/src/core/primitives/kbd/kbd.tsx +2 -2
  40. package/src/core/primitives/label/label.tsx +3 -3
  41. package/src/core/primitives/popover/popover.tsx +7 -6
  42. package/src/core/primitives/select/select.tsx +6 -5
  43. package/src/core/primitives/stack/stack.tsx +2 -2
  44. package/src/core/primitives/text/text.tsx +3 -3
  45. package/src/core/primitives/textArea/textArea.tsx +6 -5
  46. package/src/core/primitives/textInput/textInput.tsx +6 -5
  47. package/src/core/primitives/tooltip/tooltip.tsx +3 -2
  48. package/src/core/utils/layer/layerProvider.tsx +3 -2
@@ -1,5 +1,5 @@
1
1
  "use strict";
2
- var theme = require("@sanity/ui/theme"), jsxRuntime = require("react/jsx-runtime"), reactCompilerRuntime = require("react-compiler-runtime"), react = require("react"), styledComponents = require("styled-components"), ReactIs = require("react-is"), icons = require("@sanity/icons"), reactDom$1 = require("@floating-ui/react-dom"), framerMotion = require("framer-motion"), resizeObserver = require("@juggle/resize-observer"), reactDom = require("react-dom"), useEffectEvent = require("use-effect-event");
2
+ var theme = require("@sanity/ui/theme"), jsxRuntime = require("react/jsx-runtime"), react = require("react"), styledComponents = require("styled-components"), ReactIs = require("react-is"), icons = require("@sanity/icons"), reactDom$1 = require("@floating-ui/react-dom"), framerMotion = require("framer-motion"), resizeObserver = require("@juggle/resize-observer"), reactDom = require("react-dom"), useEffectEvent = require("use-effect-event");
3
3
  function _interopDefaultCompat(e) {
4
4
  return e && typeof e == "object" && "default" in e ? e : { default: e };
5
5
  }
@@ -189,125 +189,6 @@ function responsiveTextAlignStyle(props) {
189
189
  function responsiveTextFont(props) {
190
190
  return responsiveFont("text", props);
191
191
  }
192
- function useArrayProp(val, defaultVal) {
193
- const $ = reactCompilerRuntime.c(3);
194
- let t0;
195
- $[0] !== defaultVal || $[1] !== val ? (t0 = () => [_getArrayProp(val, defaultVal), JSON.stringify(val ?? defaultVal)], $[0] = defaultVal, $[1] = val, $[2] = t0) : t0 = $[2];
196
- const [t1, setCache] = react.useState(t0), [cachedVal, cachedHash] = t1, hash = JSON.stringify(val ?? defaultVal);
197
- return hash !== cachedHash && setCache([_getArrayProp(val, defaultVal), hash]), cachedVal;
198
- }
199
- function useClickOutsideEvent(listener, t0, boundaryElement) {
200
- const $ = reactCompilerRuntime.c(9), elementsArg = t0 === void 0 ? _temp$a : t0;
201
- let t1;
202
- $[0] !== boundaryElement || $[1] !== elementsArg || $[2] !== listener ? (t1 = (evt) => {
203
- if (!listener)
204
- return;
205
- const target = evt.target;
206
- if (!(target instanceof Node))
207
- return;
208
- const resolvedBoundaryElement = boundaryElement?.();
209
- if (resolvedBoundaryElement && !resolvedBoundaryElement.contains(target))
210
- return;
211
- const elements = elementsArg().flat();
212
- for (const el of elements)
213
- if (el && (target === el || el.contains(target)))
214
- return;
215
- listener(evt);
216
- }, $[0] = boundaryElement, $[1] = elementsArg, $[2] = listener, $[3] = t1) : t1 = $[3];
217
- const onEvent = useEffectEvent.useEffectEvent(t1), hasListener = !!listener;
218
- let t2;
219
- $[4] !== hasListener || $[5] !== onEvent ? (t2 = () => {
220
- if (!hasListener)
221
- return;
222
- const handleEvent = (evt_0) => onEvent(evt_0);
223
- return document.addEventListener("mousedown", handleEvent), () => {
224
- document.removeEventListener("mousedown", handleEvent);
225
- };
226
- }, $[4] = hasListener, $[5] = onEvent, $[6] = t2) : t2 = $[6];
227
- let t3;
228
- $[7] !== hasListener ? (t3 = [hasListener], $[7] = hasListener, $[8] = t3) : t3 = $[8], react.useEffect(t2, t3), react.useDebugValue(listener ? "MouseDown On" : "MouseDown Off");
229
- }
230
- function _temp$a() {
231
- return EMPTY_ARRAY;
232
- }
233
- function useCustomValidity(ref, customValidity) {
234
- const $ = reactCompilerRuntime.c(4);
235
- let t0, t1;
236
- $[0] !== customValidity || $[1] !== ref ? (t0 = () => {
237
- ref.current?.setCustomValidity(customValidity || "");
238
- }, t1 = [customValidity, ref], $[0] = customValidity, $[1] = ref, $[2] = t0, $[3] = t1) : (t0 = $[2], t1 = $[3]), react.useEffect(t0, t1);
239
- }
240
- const _ResizeObserver = typeof document < "u" && typeof window < "u" && window.ResizeObserver ? window.ResizeObserver : resizeObserver.ResizeObserver, _elementSizeObserver = _createElementSizeObserver();
241
- function _createElementRectValueListener() {
242
- return {
243
- subscribe(element, subscriber) {
244
- const resizeObserver2 = new _ResizeObserver(([entry]) => {
245
- subscriber({
246
- _contentRect: entry.contentRect,
247
- border: {
248
- width: entry.borderBoxSize[0].inlineSize,
249
- height: entry.borderBoxSize[0].blockSize
250
- },
251
- content: {
252
- width: entry.contentRect.width,
253
- height: entry.contentRect.height
254
- }
255
- });
256
- });
257
- return resizeObserver2.observe(element), () => {
258
- resizeObserver2.unobserve(element), resizeObserver2.disconnect();
259
- };
260
- }
261
- };
262
- }
263
- function _createElementSizeObserver() {
264
- const disposeCache = /* @__PURE__ */ new WeakMap(), subscribersCache = /* @__PURE__ */ new WeakMap();
265
- return {
266
- subscribe(element, subscriber) {
267
- const subscribers = subscribersCache.get(element) || [];
268
- let dispose = disposeCache.get(element);
269
- return subscribersCache.has(element) || (subscribersCache.set(element, subscribers), dispose = _createElementRectValueListener().subscribe(element, (elementRect) => {
270
- for (const sub of subscribers)
271
- sub(elementRect);
272
- })), subscribers.push(subscriber), () => {
273
- const idx = subscribers.indexOf(subscriber);
274
- idx > -1 && subscribers.splice(idx, 1), subscribers.length === 0 && dispose && dispose();
275
- };
276
- }
277
- };
278
- }
279
- function useElementSize(element) {
280
- const $ = reactCompilerRuntime.c(3), [size2, setSize] = react.useState(null);
281
- let t0, t1;
282
- return $[0] !== element ? (t0 = () => {
283
- if (element)
284
- return _elementSizeObserver.subscribe(element, setSize);
285
- }, t1 = [element], $[0] = element, $[1] = t0, $[2] = t1) : (t0 = $[1], t1 = $[2]), react.useEffect(t0, t1), size2;
286
- }
287
- function useGlobalKeyDown(onKeyDown) {
288
- const $ = reactCompilerRuntime.c(5);
289
- let t0;
290
- $[0] !== onKeyDown ? (t0 = (event) => onKeyDown(event), $[0] = onKeyDown, $[1] = t0) : t0 = $[1];
291
- const handleKeyDown = useEffectEvent.useEffectEvent(t0);
292
- let t1;
293
- $[2] !== handleKeyDown ? (t1 = () => {
294
- const handler = (event_0) => handleKeyDown(event_0);
295
- return window.addEventListener("keydown", handler), () => window.removeEventListener("keydown", handler);
296
- }, $[2] = handleKeyDown, $[3] = t1) : t1 = $[3];
297
- let t2;
298
- $[4] === Symbol.for("react.memo_cache_sentinel") ? (t2 = [], $[4] = t2) : t2 = $[4], react.useEffect(t1, t2);
299
- }
300
- function useMatchMedia(mediaQueryString, getServerSnapshot2) {
301
- const $ = reactCompilerRuntime.c(4);
302
- react.useDebugValue(mediaQueryString);
303
- let t0;
304
- $[0] !== mediaQueryString ? (t0 = (onStoreChange) => {
305
- const media = window.matchMedia(mediaQueryString);
306
- return media.addEventListener("change", onStoreChange), () => media.removeEventListener("change", onStoreChange);
307
- }, $[0] = mediaQueryString, $[1] = t0) : t0 = $[1];
308
- let t1;
309
- return $[2] !== mediaQueryString ? (t1 = () => window.matchMedia(mediaQueryString).matches, $[2] = mediaQueryString, $[3] = t1) : t1 = $[3], react.useSyncExternalStore(t0, t1, getServerSnapshot2);
310
- }
311
192
  function getGlobalScope() {
312
193
  if (typeof globalThis < "u") return globalThis;
313
194
  if (typeof window < "u") return window;
@@ -326,42 +207,15 @@ function createGlobalScopedContext(key2, defaultValue) {
326
207
  }
327
208
  const ThemeContext = createGlobalScopedContext("@sanity/ui/context/theme", null);
328
209
  function ThemeProvider(props) {
329
- const $ = reactCompilerRuntime.c(15), parentTheme = react.useContext(ThemeContext), {
210
+ const parentTheme = react.useContext(ThemeContext), {
330
211
  children
331
- } = props, scheme = props.scheme ?? (parentTheme?.scheme || "light"), rootTheme = props.theme ?? (parentTheme?.theme || null), tone = props.tone ?? (parentTheme?.tone || "default");
332
- let t0;
333
- bb0: {
334
- if (!rootTheme) {
335
- t0 = null;
336
- break bb0;
337
- }
338
- let t12;
339
- $[0] !== rootTheme || $[1] !== scheme || $[2] !== tone ? (t12 = {
340
- version: 0,
341
- theme: rootTheme,
342
- scheme,
343
- tone
344
- }, $[0] = rootTheme, $[1] = scheme, $[2] = tone, $[3] = t12) : t12 = $[3], t0 = t12;
345
- }
346
- const themeContext = t0;
347
- let t1;
348
- bb1: {
349
- if (!rootTheme) {
350
- t1 = null;
351
- break bb1;
352
- }
353
- let t22;
354
- $[4] !== rootTheme || $[5] !== scheme || $[6] !== tone ? (t22 = theme.getScopedTheme(rootTheme, scheme, tone), $[4] = rootTheme, $[5] = scheme, $[6] = tone, $[7] = t22) : t22 = $[7], t1 = t22;
355
- }
356
- const theme$1 = t1;
357
- if (!theme$1) {
358
- let t22;
359
- return $[8] === Symbol.for("react.memo_cache_sentinel") ? (t22 = /* @__PURE__ */ jsxRuntime.jsx("pre", { children: 'ThemeProvider: no "theme" property provided' }), $[8] = t22) : t22 = $[8], t22;
360
- }
361
- let t2;
362
- $[9] !== children || $[10] !== theme$1 ? (t2 = /* @__PURE__ */ jsxRuntime.jsx(styledComponents.ThemeProvider, { theme: theme$1, children }), $[9] = children, $[10] = theme$1, $[11] = t2) : t2 = $[11];
363
- let t3;
364
- return $[12] !== t2 || $[13] !== themeContext ? (t3 = /* @__PURE__ */ jsxRuntime.jsx(ThemeContext.Provider, { value: themeContext, children: t2 }), $[12] = t2, $[13] = themeContext, $[14] = t3) : t3 = $[14], t3;
212
+ } = props, scheme = props.scheme ?? (parentTheme?.scheme || "light"), rootTheme = props.theme ?? (parentTheme?.theme || null), tone = props.tone ?? (parentTheme?.tone || "default"), themeContext = react.useMemo(() => rootTheme ? {
213
+ version: 0,
214
+ theme: rootTheme,
215
+ scheme,
216
+ tone
217
+ } : null, [rootTheme, scheme, tone]), theme$1 = react.useMemo(() => rootTheme ? theme.getScopedTheme(rootTheme, scheme, tone) : null, [scheme, rootTheme, tone]);
218
+ return theme$1 ? /* @__PURE__ */ jsxRuntime.jsx(ThemeContext.Provider, { value: themeContext, children: /* @__PURE__ */ jsxRuntime.jsx(styledComponents.ThemeProvider, { theme: theme$1, children }) }) : /* @__PURE__ */ jsxRuntime.jsx("pre", { children: 'ThemeProvider: no "theme" property provided' });
365
219
  }
366
220
  ThemeProvider.displayName = "ThemeProvider";
367
221
  function useRootTheme() {
@@ -371,91 +225,19 @@ function useRootTheme() {
371
225
  return value;
372
226
  }
373
227
  function ThemeColorProvider(props) {
374
- const $ = reactCompilerRuntime.c(5), {
228
+ const {
375
229
  children,
376
230
  scheme,
377
231
  tone
378
- } = props, root = useRootTheme(), t0 = scheme || root.scheme;
379
- let t1;
380
- return $[0] !== children || $[1] !== root.theme || $[2] !== t0 || $[3] !== tone ? (t1 = /* @__PURE__ */ jsxRuntime.jsx(ThemeProvider, { scheme: t0, theme: root.theme, tone, children }), $[0] = children, $[1] = root.theme, $[2] = t0, $[3] = tone, $[4] = t1) : t1 = $[4], t1;
232
+ } = props, root = useRootTheme();
233
+ return /* @__PURE__ */ jsxRuntime.jsx(ThemeProvider, { scheme: scheme || root.scheme, theme: root.theme, tone, children });
381
234
  }
382
235
  ThemeColorProvider.displayName = "ThemeColorProvider";
383
236
  function useTheme() {
384
237
  return styledComponents.useTheme();
385
238
  }
386
239
  function useTheme_v2() {
387
- const $ = reactCompilerRuntime.c(2), t0 = styledComponents.useTheme();
388
- let t1;
389
- return $[0] !== t0 ? (t1 = theme.getTheme_v2(t0), $[0] = t0, $[1] = t1) : t1 = $[1], t1;
390
- }
391
- function _getMediaQuery(media, index) {
392
- return index === 0 ? `screen and (max-width: ${media[index] - 1}px)` : index === media.length ? `screen and (min-width: ${media[index - 1]}px)` : `screen and (min-width: ${media[index - 1]}px) and (max-width: ${media[index] - 1}px)`;
393
- }
394
- function _createMediaStore(media) {
395
- const mediaLen = media.length;
396
- let sizes;
397
- const getSizes = () => {
398
- if (!sizes) {
399
- sizes = [];
400
- for (let index = mediaLen; index > -1; index -= 1) {
401
- const mediaQuery = _getMediaQuery(media, index);
402
- sizes.push({
403
- index,
404
- mq: window.matchMedia(mediaQuery)
405
- });
406
- }
407
- }
408
- return sizes;
409
- };
410
- return {
411
- getSnapshot: () => {
412
- for (const {
413
- index,
414
- mq
415
- } of getSizes())
416
- if (mq.matches) return index;
417
- return 0;
418
- },
419
- subscribe: (onStoreChange) => {
420
- const disposeFns = [];
421
- for (const {
422
- mq
423
- } of getSizes()) {
424
- const handleChange = () => {
425
- mq.matches && onStoreChange();
426
- };
427
- mq.addEventListener("change", handleChange), disposeFns.push(() => mq.removeEventListener("change", handleChange));
428
- }
429
- return () => {
430
- for (const disposeFn of disposeFns)
431
- disposeFn();
432
- };
433
- }
434
- };
435
- }
436
- function getServerSnapshot() {
437
- return 0;
438
- }
439
- function useMediaIndex() {
440
- const $ = reactCompilerRuntime.c(2), {
441
- media
442
- } = useTheme_v2();
443
- let t0;
444
- $[0] !== media ? (t0 = _createMediaStore(media), $[0] = media, $[1] = t0) : t0 = $[1];
445
- const store = t0;
446
- return react.useSyncExternalStore(store.subscribe, store.getSnapshot, getServerSnapshot);
447
- }
448
- function usePrefersDark(t0) {
449
- return useMatchMedia("(prefers-color-scheme: dark)", t0 === void 0 ? _temp$9 : t0);
450
- }
451
- function _temp$9() {
452
- return !1;
453
- }
454
- function usePrefersReducedMotion(t0) {
455
- return useMatchMedia("(prefers-reduced-motion: reduce)", t0 === void 0 ? _temp$8 : t0);
456
- }
457
- function _temp$8() {
458
- return !1;
240
+ return theme.getTheme_v2(styledComponents.useTheme());
459
241
  }
460
242
  function responsiveBorderStyle() {
461
243
  return [border, borderTop, borderRight, borderBottom, borderLeft];
@@ -1170,30 +952,18 @@ const StyledLabel = /* @__PURE__ */ styledComponents.styled.div.withConfig({
1170
952
  displayName: "StyledLabel",
1171
953
  componentId: "sc-1luap7z-0"
1172
954
  })(responsiveLabelFont, responsiveTextAlignStyle, labelBaseStyle), Label = react.forwardRef(function(props, ref) {
1173
- const $ = reactCompilerRuntime.c(22);
1174
- let accent, align, childrenProp, restProps, t0, t1, textOverflow, weight;
1175
- $[0] !== props ? ({
955
+ const {
1176
956
  accent,
1177
957
  align,
1178
958
  children: childrenProp,
1179
- muted: t0,
1180
- size: t1,
959
+ muted = !1,
960
+ size: size2 = 2,
1181
961
  textOverflow,
1182
962
  weight,
1183
963
  ...restProps
1184
- } = props, $[0] = props, $[1] = accent, $[2] = align, $[3] = childrenProp, $[4] = restProps, $[5] = t0, $[6] = t1, $[7] = textOverflow, $[8] = weight) : (accent = $[1], align = $[2], childrenProp = $[3], restProps = $[4], t0 = $[5], t1 = $[6], textOverflow = $[7], weight = $[8]);
1185
- const muted = t0 === void 0 ? !1 : t0, size2 = t1 === void 0 ? 2 : t1;
964
+ } = props;
1186
965
  let children = childrenProp;
1187
- if (textOverflow === "ellipsis") {
1188
- let t22;
1189
- $[9] !== children ? (t22 = /* @__PURE__ */ jsxRuntime.jsx(SpanWithTextOverflow, { children }), $[9] = children, $[10] = t22) : t22 = $[10], children = t22;
1190
- } else {
1191
- let t22;
1192
- $[11] !== children ? (t22 = /* @__PURE__ */ jsxRuntime.jsx("span", { children }), $[11] = children, $[12] = t22) : t22 = $[12], children = t22;
1193
- }
1194
- const t2 = useArrayProp(align), t3 = useArrayProp(size2);
1195
- let t4;
1196
- return $[13] !== accent || $[14] !== children || $[15] !== muted || $[16] !== ref || $[17] !== restProps || $[18] !== t2 || $[19] !== t3 || $[20] !== weight ? (t4 = /* @__PURE__ */ jsxRuntime.jsx(StyledLabel, { "data-ui": "Label", ...restProps, $accent: accent, $align: t2, $muted: muted, $size: t3, $weight: weight, ref, children }), $[13] = accent, $[14] = children, $[15] = muted, $[16] = ref, $[17] = restProps, $[18] = t2, $[19] = t3, $[20] = weight, $[21] = t4) : t4 = $[21], t4;
966
+ return textOverflow === "ellipsis" ? children = /* @__PURE__ */ jsxRuntime.jsx(SpanWithTextOverflow, { children }) : children = /* @__PURE__ */ jsxRuntime.jsx("span", { children }), /* @__PURE__ */ jsxRuntime.jsx(StyledLabel, { "data-ui": "Label", ...restProps, $accent: accent, $align: _getArrayProp(align), $muted: muted, $size: _getArrayProp(size2), $weight: weight, ref, children });
1197
967
  });
1198
968
  Label.displayName = "ForwardRef(Label)";
1199
969
  const avatarStyle = {
@@ -1363,66 +1133,44 @@ const StyledAvatar = /* @__PURE__ */ styledComponents.styled.div.withConfig({
1363
1133
  displayName: "AvatarImage",
1364
1134
  componentId: "sc-1rj7kl0-6"
1365
1135
  })(avatarStyle.image), Avatar = react.forwardRef(function(props, ref) {
1366
- const $ = reactCompilerRuntime.c(52);
1367
- let __unstable_hideInnerStroke, animateArrowFrom, arrowPositionProp, asProp, initials, onImageLoadError, restProps, src, t0, t1, t2, title;
1368
- $[0] !== props ? ({
1136
+ const {
1369
1137
  __unstable_hideInnerStroke,
1370
1138
  as: asProp,
1371
- color: t0,
1139
+ color = "gray",
1372
1140
  src,
1373
1141
  title,
1374
1142
  initials,
1375
1143
  onImageLoadError,
1376
1144
  arrowPosition: arrowPositionProp,
1377
1145
  animateArrowFrom,
1378
- status: t1,
1379
- size: t2,
1146
+ status = "online",
1147
+ size: sizeProp = 1,
1380
1148
  ...restProps
1381
- } = props, $[0] = props, $[1] = __unstable_hideInnerStroke, $[2] = animateArrowFrom, $[3] = arrowPositionProp, $[4] = asProp, $[5] = initials, $[6] = onImageLoadError, $[7] = restProps, $[8] = src, $[9] = t0, $[10] = t1, $[11] = t2, $[12] = title) : (__unstable_hideInnerStroke = $[1], animateArrowFrom = $[2], arrowPositionProp = $[3], asProp = $[4], initials = $[5], onImageLoadError = $[6], restProps = $[7], src = $[8], t0 = $[9], t1 = $[10], t2 = $[11], title = $[12]);
1382
- const color = t0 === void 0 ? "gray" : t0, status = t1 === void 0 ? "online" : t1, sizeProp = t2 === void 0 ? 1 : t2, {
1149
+ } = props, {
1383
1150
  avatar
1384
- } = useTheme_v2(), as = ReactIs__default.default.isValidElementType(asProp) ? asProp : "div", size2 = useArrayProp(sizeProp), _sizeRem = (avatar.sizes[size2[0]] || avatar.sizes[0]).size, _radius = _sizeRem / 2, elementId = react.useId(), [arrowPosition, setArrowPosition] = react.useState(animateArrowFrom || arrowPositionProp || "inside"), [imageFailed, setImageFailed] = react.useState(!1), imageId = `avatar-image-${elementId}`;
1385
- let t3, t4;
1386
- $[13] !== arrowPosition || $[14] !== arrowPositionProp ? (t3 = () => {
1387
- if (arrowPosition === arrowPositionProp)
1388
- return;
1151
+ } = useTheme_v2(), as = ReactIs__default.default.isValidElementType(asProp) ? asProp : "div", size2 = _getArrayProp(sizeProp), _sizeRem = (avatar.sizes[size2[0]] || avatar.sizes[0]).size, _radius = _sizeRem / 2, elementId = react.useId(), [arrowPosition, setArrowPosition] = react.useState(animateArrowFrom || arrowPositionProp || "inside"), [imageFailed, setImageFailed] = react.useState(!1), imageId = `avatar-image-${elementId}`;
1152
+ react.useEffect(() => {
1153
+ if (arrowPosition === arrowPositionProp) return;
1389
1154
  const raf = requestAnimationFrame(() => setArrowPosition(arrowPositionProp));
1390
1155
  return () => cancelAnimationFrame(raf);
1391
- }, t4 = [arrowPosition, arrowPositionProp], $[13] = arrowPosition, $[14] = arrowPositionProp, $[15] = t3, $[16] = t4) : (t3 = $[15], t4 = $[16]), react.useEffect(t3, t4);
1392
- let t5, t6;
1393
- $[17] !== src ? (t5 = () => {
1156
+ }, [arrowPosition, arrowPositionProp]), react.useEffect(() => {
1394
1157
  src && setImageFailed(!1);
1395
- }, t6 = [src], $[17] = src, $[18] = t5, $[19] = t6) : (t5 = $[18], t6 = $[19]), react.useEffect(t5, t6);
1396
- let t7;
1397
- $[20] !== onImageLoadError ? (t7 = () => {
1158
+ }, [src]);
1159
+ const handleImageError = react.useCallback(() => {
1398
1160
  setImageFailed(!0), onImageLoadError && onImageLoadError(new Error("Avatar: the image failed to load"));
1399
- }, $[20] = onImageLoadError, $[21] = t7) : t7 = $[21];
1400
- const handleImageError = t7;
1401
- let t8;
1402
- $[22] !== size2 ? (t8 = size2.map(_temp$7), $[22] = size2, $[23] = t8) : t8 = $[23];
1403
- const initialsSize = t8, t9 = typeof as == "string" ? as : void 0;
1404
- let t10;
1405
- $[24] !== color ? (t10 = /* @__PURE__ */ jsxRuntime.jsx(Arrow$1, { children: /* @__PURE__ */ jsxRuntime.jsx("svg", { width: "11", height: "7", viewBox: "0 0 11 7", fill: "none", children: /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M6.67948 1.50115L11 7L0 7L4.32052 1.50115C4.92109 0.736796 6.07891 0.736795 6.67948 1.50115Z", fill: color }) }) }), $[24] = color, $[25] = t10) : t10 = $[25];
1406
- let t11;
1407
- $[26] !== __unstable_hideInnerStroke || $[27] !== _radius || $[28] !== _sizeRem || $[29] !== handleImageError || $[30] !== imageFailed || $[31] !== imageId || $[32] !== src ? (t11 = !imageFailed && src && /* @__PURE__ */ jsxRuntime.jsxs(AvatarImage, { viewBox: `0 0 ${_sizeRem} ${_sizeRem}`, fill: "none", children: [
1408
- /* @__PURE__ */ jsxRuntime.jsx("defs", { children: /* @__PURE__ */ jsxRuntime.jsx("pattern", { id: imageId, patternContentUnits: "objectBoundingBox", width: "1", height: "1", children: /* @__PURE__ */ jsxRuntime.jsx("image", { href: src, width: "1", height: "1", onError: handleImageError }) }) }),
1409
- /* @__PURE__ */ jsxRuntime.jsx("circle", { cx: _radius, cy: _radius, r: _radius, fill: `url(#${imageId})` }),
1410
- !__unstable_hideInnerStroke && /* @__PURE__ */ jsxRuntime.jsx(BgStroke, { cx: _radius, cy: _radius, rx: _radius, ry: _radius, vectorEffect: "non-scaling-stroke" }),
1411
- /* @__PURE__ */ jsxRuntime.jsx(Stroke, { cx: _radius, cy: _radius, rx: _radius, ry: _radius, vectorEffect: "non-scaling-stroke" })
1412
- ] }), $[26] = __unstable_hideInnerStroke, $[27] = _radius, $[28] = _sizeRem, $[29] = handleImageError, $[30] = imageFailed, $[31] = imageId, $[32] = src, $[33] = t11) : t11 = $[33];
1413
- let t12;
1414
- $[34] !== imageFailed || $[35] !== initials || $[36] !== initialsSize || $[37] !== src ? (t12 = (imageFailed || !src) && initials && /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children: /* @__PURE__ */ jsxRuntime.jsx(Initials, { children: /* @__PURE__ */ jsxRuntime.jsx(InitialsLabel, { forwardedAs: "span", size: initialsSize, weight: "medium", children: initials }) }) }), $[34] = imageFailed, $[35] = initials, $[36] = initialsSize, $[37] = src, $[38] = t12) : t12 = $[38];
1415
- let t13;
1416
- return $[39] !== arrowPosition || $[40] !== as || $[41] !== color || $[42] !== ref || $[43] !== restProps || $[44] !== size2 || $[45] !== status || $[46] !== t10 || $[47] !== t11 || $[48] !== t12 || $[49] !== t9 || $[50] !== title ? (t13 = /* @__PURE__ */ jsxRuntime.jsxs(StyledAvatar, { as, "data-as": t9, "data-ui": "Avatar", ...restProps, $color: color, $size: size2, "aria-label": title, "data-arrow-position": arrowPosition, "data-status": status, ref, title, children: [
1417
- t10,
1418
- t11,
1419
- t12
1420
- ] }), $[39] = arrowPosition, $[40] = as, $[41] = color, $[42] = ref, $[43] = restProps, $[44] = size2, $[45] = status, $[46] = t10, $[47] = t11, $[48] = t12, $[49] = t9, $[50] = title, $[51] = t13) : t13 = $[51], t13;
1161
+ }, [onImageLoadError]);
1162
+ return /* @__PURE__ */ jsxRuntime.jsxs(StyledAvatar, { as, "data-as": typeof as == "string" ? as : void 0, "data-ui": "Avatar", ...restProps, $color: color, $size: size2, "aria-label": title, "data-arrow-position": arrowPosition, "data-status": status, ref, title, children: [
1163
+ /* @__PURE__ */ jsxRuntime.jsx(Arrow$1, { children: /* @__PURE__ */ jsxRuntime.jsx("svg", { width: "11", height: "7", viewBox: "0 0 11 7", fill: "none", children: /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M6.67948 1.50115L11 7L0 7L4.32052 1.50115C4.92109 0.736796 6.07891 0.736795 6.67948 1.50115Z", fill: color }) }) }),
1164
+ !imageFailed && src && /* @__PURE__ */ jsxRuntime.jsxs(AvatarImage, { viewBox: `0 0 ${_sizeRem} ${_sizeRem}`, fill: "none", children: [
1165
+ /* @__PURE__ */ jsxRuntime.jsx("defs", { children: /* @__PURE__ */ jsxRuntime.jsx("pattern", { id: imageId, patternContentUnits: "objectBoundingBox", width: "1", height: "1", children: /* @__PURE__ */ jsxRuntime.jsx("image", { href: src, width: "1", height: "1", onError: handleImageError }) }) }),
1166
+ /* @__PURE__ */ jsxRuntime.jsx("circle", { cx: _radius, cy: _radius, r: _radius, fill: `url(#${imageId})` }),
1167
+ !__unstable_hideInnerStroke && /* @__PURE__ */ jsxRuntime.jsx(BgStroke, { cx: _radius, cy: _radius, rx: _radius, ry: _radius, vectorEffect: "non-scaling-stroke" }),
1168
+ /* @__PURE__ */ jsxRuntime.jsx(Stroke, { cx: _radius, cy: _radius, rx: _radius, ry: _radius, vectorEffect: "non-scaling-stroke" })
1169
+ ] }),
1170
+ (imageFailed || !src) && initials && /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children: /* @__PURE__ */ jsxRuntime.jsx(Initials, { children: /* @__PURE__ */ jsxRuntime.jsx(InitialsLabel, { forwardedAs: "span", size: size2.map((s) => s === 1 ? 1 : s === 2 ? 3 : s === 3 ? 5 : 0), weight: "medium", children: initials }) }) })
1171
+ ] });
1421
1172
  });
1422
1173
  Avatar.displayName = "ForwardRef(Avatar)";
1423
- function _temp$7(s) {
1424
- return s === 1 ? 1 : s === 2 ? 3 : s === 3 ? 5 : 0;
1425
- }
1426
1174
  function _responsiveAvatarCounterSizeStyle(props) {
1427
1175
  const {
1428
1176
  avatar,
@@ -1463,22 +1211,13 @@ const StyledAvatarCounter = /* @__PURE__ */ styledComponents.styled.div.withConf
1463
1211
  displayName: "StyledAvatarCounter",
1464
1212
  componentId: "sc-1ydx86y-0"
1465
1213
  })(_responsiveAvatarCounterSizeStyle, _avatarCounterBaseStyle), AvatarCounter = react.forwardRef(function(props, ref) {
1466
- const $ = reactCompilerRuntime.c(9), {
1214
+ const {
1467
1215
  count,
1468
- size: t0
1469
- } = props, size2 = useArrayProp(t0 === void 0 ? 1 : t0);
1470
- let t1;
1471
- $[0] !== size2 ? (t1 = size2.map(_temp$6), $[0] = size2, $[1] = t1) : t1 = $[1];
1472
- const fontSize2 = t1;
1473
- let t2;
1474
- $[2] !== count || $[3] !== fontSize2 ? (t2 = /* @__PURE__ */ jsxRuntime.jsx(Label, { as: "span", size: fontSize2, weight: "medium", children: count }), $[2] = count, $[3] = fontSize2, $[4] = t2) : t2 = $[4];
1475
- let t3;
1476
- return $[5] !== ref || $[6] !== size2 || $[7] !== t2 ? (t3 = /* @__PURE__ */ jsxRuntime.jsx(StyledAvatarCounter, { $size: size2, "data-ui": "AvatarCounter", ref, children: t2 }), $[5] = ref, $[6] = size2, $[7] = t2, $[8] = t3) : t3 = $[8], t3;
1216
+ size: sizeProp = 1
1217
+ } = props, size2 = _getArrayProp(sizeProp);
1218
+ return /* @__PURE__ */ jsxRuntime.jsx(StyledAvatarCounter, { $size: size2, "data-ui": "AvatarCounter", ref, children: /* @__PURE__ */ jsxRuntime.jsx(Label, { as: "span", size: size2.map((s) => s === 1 ? 1 : s === 2 ? 3 : s === 3 ? 5 : 0), weight: "medium", children: count }) });
1477
1219
  });
1478
1220
  AvatarCounter.displayName = "ForwardRef(AvatarCounter)";
1479
- function _temp$6(s) {
1480
- return s === 1 ? 1 : s === 2 ? 3 : s === 3 ? 5 : 0;
1481
- }
1482
1221
  const BASE_STYLES = styledComponents.css`
1483
1222
  white-space: nowrap;
1484
1223
 
@@ -1511,47 +1250,34 @@ const StyledAvatarStack = /* @__PURE__ */ styledComponents.styled.div.withConfig
1511
1250
  displayName: "StyledAvatarStack",
1512
1251
  componentId: "sc-cysmbb-0"
1513
1252
  })(responsiveAvatarStackSizeStyle, avatarStackStyle), AvatarStack = react.forwardRef(function(props, ref) {
1514
- const $ = reactCompilerRuntime.c(22);
1515
- let childrenProp, restProps, t0, t1;
1516
- $[0] !== props ? ({
1253
+ const {
1517
1254
  children: childrenProp,
1518
- maxLength: t0,
1519
- size: t1,
1255
+ maxLength: maxLengthProp = 4,
1256
+ size: sizeProp = 1,
1520
1257
  ...restProps
1521
- } = props, $[0] = props, $[1] = childrenProp, $[2] = restProps, $[3] = t0, $[4] = t1) : (childrenProp = $[1], restProps = $[2], t0 = $[3], t1 = $[4]);
1522
- const maxLengthProp = t0 === void 0 ? 4 : t0, sizeProp = t1 === void 0 ? 1 : t1, children = react.Children.toArray(childrenProp).filter(react.isValidElement), maxLength = Math.max(maxLengthProp, 0), size2 = useArrayProp(sizeProp), len = children.length, visibleCount = maxLength - 1, extraCount = len - visibleCount, visibleChildren = extraCount > 1 ? children.slice(extraCount, len) : children, T0 = StyledAvatarStack, t2 = "AvatarStack";
1523
- let t3;
1524
- $[5] !== len || $[6] !== size2 ? (t3 = len === 0 && /* @__PURE__ */ jsxRuntime.jsx("div", { children: /* @__PURE__ */ jsxRuntime.jsx(AvatarCounter, { count: len, size: size2 }) }), $[5] = len, $[6] = size2, $[7] = t3) : t3 = $[7];
1525
- let t4;
1526
- $[8] !== extraCount || $[9] !== len || $[10] !== size2 ? (t4 = len !== 0 && extraCount > 1 && /* @__PURE__ */ jsxRuntime.jsx("div", { children: /* @__PURE__ */ jsxRuntime.jsx(AvatarCounter, { count: extraCount, size: size2 }) }), $[8] = extraCount, $[9] = len, $[10] = size2, $[11] = t4) : t4 = $[11];
1527
- let t5;
1528
- $[12] !== size2 ? (t5 = (child, childIndex) => /* @__PURE__ */ jsxRuntime.jsx("div", { children: react.cloneElement(child, {
1529
- size: size2
1530
- }) }, String(childIndex)), $[12] = size2, $[13] = t5) : t5 = $[13];
1531
- const t6 = visibleChildren.map(t5);
1532
- let t7;
1533
- return $[14] !== T0 || $[15] !== ref || $[16] !== restProps || $[17] !== size2 || $[18] !== t3 || $[19] !== t4 || $[20] !== t6 ? (t7 = /* @__PURE__ */ jsxRuntime.jsxs(T0, { "data-ui": t2, ...restProps, ref, $size: size2, children: [
1534
- t3,
1535
- t4,
1536
- t6
1537
- ] }), $[14] = T0, $[15] = ref, $[16] = restProps, $[17] = size2, $[18] = t3, $[19] = t4, $[20] = t6, $[21] = t7) : t7 = $[21], t7;
1258
+ } = props, children = react.Children.toArray(childrenProp).filter(react.isValidElement), maxLength = Math.max(maxLengthProp, 0), size2 = _getArrayProp(sizeProp), len = children.length, visibleCount = maxLength - 1, extraCount = len - visibleCount, visibleChildren = extraCount > 1 ? children.slice(extraCount, len) : children;
1259
+ return /* @__PURE__ */ jsxRuntime.jsxs(StyledAvatarStack, { "data-ui": "AvatarStack", ...restProps, ref, $size: size2, children: [
1260
+ len === 0 && /* @__PURE__ */ jsxRuntime.jsx("div", { children: /* @__PURE__ */ jsxRuntime.jsx(AvatarCounter, { count: len, size: size2 }) }),
1261
+ len !== 0 && extraCount > 1 && /* @__PURE__ */ jsxRuntime.jsx("div", { children: /* @__PURE__ */ jsxRuntime.jsx(AvatarCounter, { count: extraCount, size: size2 }) }),
1262
+ visibleChildren.map((child, childIndex) => /* @__PURE__ */ jsxRuntime.jsx("div", { children: react.cloneElement(child, {
1263
+ size: size2
1264
+ }) }, String(childIndex)))
1265
+ ] });
1538
1266
  });
1539
1267
  AvatarStack.displayName = "ForwardRef(AvatarStack)";
1540
1268
  const StyledBox = /* @__PURE__ */ styledComponents.styled.div.withConfig({
1541
1269
  displayName: "StyledBox",
1542
1270
  componentId: "sc-1hhky9f-0"
1543
1271
  })(boxStyle, flexItemStyle, responsiveBoxStyle, responsiveGridItemStyle, responsiveMarginStyle, responsivePaddingStyle), Box = react.forwardRef(function(props, ref) {
1544
- const $ = reactCompilerRuntime.c(59);
1545
- let column, columnEnd, columnStart, flex, height, marginBottom, marginLeft, marginRight, marginTop, marginX, marginY, overflow, paddingBottom, paddingLeft, paddingRight, paddingTop, paddingX, paddingY, restProps, row, rowEnd, rowStart, sizing, t0, t1, t2, t3;
1546
- $[0] !== props ? ({
1547
- as: t0,
1272
+ const {
1273
+ as: asProp = "div",
1548
1274
  column,
1549
1275
  columnStart,
1550
1276
  columnEnd,
1551
- display: t1,
1277
+ display = "block",
1552
1278
  flex,
1553
1279
  height,
1554
- margin: t2,
1280
+ margin = 0,
1555
1281
  marginX,
1556
1282
  marginY,
1557
1283
  marginTop,
@@ -1559,7 +1285,7 @@ const StyledBox = /* @__PURE__ */ styledComponents.styled.div.withConfig({
1559
1285
  marginBottom,
1560
1286
  marginLeft,
1561
1287
  overflow,
1562
- padding: t3,
1288
+ padding = 0,
1563
1289
  paddingX,
1564
1290
  paddingY,
1565
1291
  paddingTop,
@@ -1571,10 +1297,8 @@ const StyledBox = /* @__PURE__ */ styledComponents.styled.div.withConfig({
1571
1297
  rowEnd,
1572
1298
  sizing,
1573
1299
  ...restProps
1574
- } = props, $[0] = props, $[1] = column, $[2] = columnEnd, $[3] = columnStart, $[4] = flex, $[5] = height, $[6] = marginBottom, $[7] = marginLeft, $[8] = marginRight, $[9] = marginTop, $[10] = marginX, $[11] = marginY, $[12] = overflow, $[13] = paddingBottom, $[14] = paddingLeft, $[15] = paddingRight, $[16] = paddingTop, $[17] = paddingX, $[18] = paddingY, $[19] = restProps, $[20] = row, $[21] = rowEnd, $[22] = rowStart, $[23] = sizing, $[24] = t0, $[25] = t1, $[26] = t2, $[27] = t3) : (column = $[1], columnEnd = $[2], columnStart = $[3], flex = $[4], height = $[5], marginBottom = $[6], marginLeft = $[7], marginRight = $[8], marginTop = $[9], marginX = $[10], marginY = $[11], overflow = $[12], paddingBottom = $[13], paddingLeft = $[14], paddingRight = $[15], paddingTop = $[16], paddingX = $[17], paddingY = $[18], restProps = $[19], row = $[20], rowEnd = $[21], rowStart = $[22], sizing = $[23], t0 = $[24], t1 = $[25], t2 = $[26], t3 = $[27]);
1575
- const asProp = t0 === void 0 ? "div" : t0, display = t1 === void 0 ? "block" : t1, margin = t2 === void 0 ? 0 : t2, padding = t3 === void 0 ? 0 : t3, t4 = typeof asProp == "string" ? asProp : void 0, t5 = useArrayProp(column), t6 = useArrayProp(columnStart), t7 = useArrayProp(columnEnd), t8 = useArrayProp(display), t9 = useArrayProp(flex), t10 = useArrayProp(height), t11 = useArrayProp(margin), t12 = useArrayProp(marginX), t13 = useArrayProp(marginY), t14 = useArrayProp(marginTop), t15 = useArrayProp(marginRight), t16 = useArrayProp(marginBottom), t17 = useArrayProp(marginLeft), t18 = useArrayProp(overflow), t19 = useArrayProp(padding), t20 = useArrayProp(paddingX), t21 = useArrayProp(paddingY), t22 = useArrayProp(paddingTop), t23 = useArrayProp(paddingRight), t24 = useArrayProp(paddingBottom), t25 = useArrayProp(paddingLeft), t26 = useArrayProp(row), t27 = useArrayProp(rowStart), t28 = useArrayProp(rowEnd), t29 = useArrayProp(sizing);
1576
- let t30;
1577
- return $[28] !== asProp || $[29] !== props.children || $[30] !== ref || $[31] !== restProps || $[32] !== t10 || $[33] !== t11 || $[34] !== t12 || $[35] !== t13 || $[36] !== t14 || $[37] !== t15 || $[38] !== t16 || $[39] !== t17 || $[40] !== t18 || $[41] !== t19 || $[42] !== t20 || $[43] !== t21 || $[44] !== t22 || $[45] !== t23 || $[46] !== t24 || $[47] !== t25 || $[48] !== t26 || $[49] !== t27 || $[50] !== t28 || $[51] !== t29 || $[52] !== t4 || $[53] !== t5 || $[54] !== t6 || $[55] !== t7 || $[56] !== t8 || $[57] !== t9 ? (t30 = /* @__PURE__ */ jsxRuntime.jsx(StyledBox, { "data-as": t4, "data-ui": "Box", ...restProps, $column: t5, $columnStart: t6, $columnEnd: t7, $display: t8, $flex: t9, $height: t10, $margin: t11, $marginX: t12, $marginY: t13, $marginTop: t14, $marginRight: t15, $marginBottom: t16, $marginLeft: t17, $overflow: t18, $padding: t19, $paddingX: t20, $paddingY: t21, $paddingTop: t22, $paddingRight: t23, $paddingBottom: t24, $paddingLeft: t25, $row: t26, $rowStart: t27, $rowEnd: t28, $sizing: t29, as: asProp, ref, children: props.children }), $[28] = asProp, $[29] = props.children, $[30] = ref, $[31] = restProps, $[32] = t10, $[33] = t11, $[34] = t12, $[35] = t13, $[36] = t14, $[37] = t15, $[38] = t16, $[39] = t17, $[40] = t18, $[41] = t19, $[42] = t20, $[43] = t21, $[44] = t22, $[45] = t23, $[46] = t24, $[47] = t25, $[48] = t26, $[49] = t27, $[50] = t28, $[51] = t29, $[52] = t4, $[53] = t5, $[54] = t6, $[55] = t7, $[56] = t8, $[57] = t9, $[58] = t30) : t30 = $[58], t30;
1300
+ } = props;
1301
+ return /* @__PURE__ */ jsxRuntime.jsx(StyledBox, { "data-as": typeof asProp == "string" ? asProp : void 0, "data-ui": "Box", ...restProps, $column: _getArrayProp(column), $columnStart: _getArrayProp(columnStart), $columnEnd: _getArrayProp(columnEnd), $display: _getArrayProp(display), $flex: _getArrayProp(flex), $height: _getArrayProp(height), $margin: _getArrayProp(margin), $marginX: _getArrayProp(marginX), $marginY: _getArrayProp(marginY), $marginTop: _getArrayProp(marginTop), $marginRight: _getArrayProp(marginRight), $marginBottom: _getArrayProp(marginBottom), $marginLeft: _getArrayProp(marginLeft), $overflow: _getArrayProp(overflow), $padding: _getArrayProp(padding), $paddingX: _getArrayProp(paddingX), $paddingY: _getArrayProp(paddingY), $paddingTop: _getArrayProp(paddingTop), $paddingRight: _getArrayProp(paddingRight), $paddingBottom: _getArrayProp(paddingBottom), $paddingLeft: _getArrayProp(paddingLeft), $row: _getArrayProp(row), $rowStart: _getArrayProp(rowStart), $rowEnd: _getArrayProp(rowEnd), $sizing: _getArrayProp(sizing), as: asProp, ref, children: props.children });
1578
1302
  });
1579
1303
  Box.displayName = "ForwardRef(Box)";
1580
1304
  function textBaseStyle(props) {
@@ -1649,29 +1373,18 @@ const StyledText = /* @__PURE__ */ styledComponents.styled.div.withConfig({
1649
1373
  displayName: "StyledText",
1650
1374
  componentId: "sc-11ov82j-0"
1651
1375
  })(responsiveTextFont, responsiveTextAlignStyle, textBaseStyle), Text = react.forwardRef(function(props, ref) {
1652
- const $ = reactCompilerRuntime.c(22);
1653
- let align, childrenProp, restProps, t0, t1, t2, textOverflow, weight;
1654
- $[0] !== props ? ({
1655
- accent: t0,
1376
+ const {
1377
+ accent = !1,
1656
1378
  align,
1657
1379
  children: childrenProp,
1658
- muted: t1,
1659
- size: t2,
1380
+ muted = !1,
1381
+ size: size2 = 2,
1660
1382
  textOverflow,
1661
1383
  weight,
1662
1384
  ...restProps
1663
- } = props, $[0] = props, $[1] = align, $[2] = childrenProp, $[3] = restProps, $[4] = t0, $[5] = t1, $[6] = t2, $[7] = textOverflow, $[8] = weight) : (align = $[1], childrenProp = $[2], restProps = $[3], t0 = $[4], t1 = $[5], t2 = $[6], textOverflow = $[7], weight = $[8]);
1664
- const accent = t0 === void 0 ? !1 : t0, muted = t1 === void 0 ? !1 : t1, size2 = t2 === void 0 ? 2 : t2;
1385
+ } = props;
1665
1386
  let children = childrenProp;
1666
- if (textOverflow === "ellipsis") {
1667
- let t32;
1668
- $[9] !== children ? (t32 = /* @__PURE__ */ jsxRuntime.jsx(SpanWithTextOverflow, { children }), $[9] = children, $[10] = t32) : t32 = $[10], children = t32;
1669
- }
1670
- const t3 = useArrayProp(align), t4 = useArrayProp(size2);
1671
- let t5;
1672
- $[11] !== children ? (t5 = /* @__PURE__ */ jsxRuntime.jsx("span", { children }), $[11] = children, $[12] = t5) : t5 = $[12];
1673
- let t6;
1674
- return $[13] !== accent || $[14] !== muted || $[15] !== ref || $[16] !== restProps || $[17] !== t3 || $[18] !== t4 || $[19] !== t5 || $[20] !== weight ? (t6 = /* @__PURE__ */ jsxRuntime.jsx(StyledText, { "data-ui": "Text", ...restProps, $accent: accent, $align: t3, $muted: muted, ref, $size: t4, $weight: weight, children: t5 }), $[13] = accent, $[14] = muted, $[15] = ref, $[16] = restProps, $[17] = t3, $[18] = t4, $[19] = t5, $[20] = weight, $[21] = t6) : t6 = $[21], t6;
1387
+ return textOverflow === "ellipsis" && (children = /* @__PURE__ */ jsxRuntime.jsx(SpanWithTextOverflow, { children })), /* @__PURE__ */ jsxRuntime.jsx(StyledText, { "data-ui": "Text", ...restProps, $accent: accent, $align: _getArrayProp(align), $muted: muted, ref, $size: _getArrayProp(size2), $weight: weight, children: /* @__PURE__ */ jsxRuntime.jsx("span", { children }) });
1675
1388
  });
1676
1389
  Text.displayName = "ForwardRef(Text)";
1677
1390
  function badgeStyle(props) {
@@ -1693,46 +1406,33 @@ const StyledBadge = /* @__PURE__ */ styledComponents.styled(Box).withConfig({
1693
1406
  displayName: "StyledBadge",
1694
1407
  componentId: "sc-5u140l-0"
1695
1408
  })(responsiveRadiusStyle, badgeStyle), Badge = react.forwardRef(function(props, ref) {
1696
- const $ = reactCompilerRuntime.c(17);
1697
- let children, restProps, t0, t1, t2, t3;
1698
- if ($[0] !== props) {
1699
- const {
1700
- children: t42,
1701
- fontSize: t52,
1702
- mode: _deprecated_mode,
1703
- padding: t62,
1704
- radius: t72,
1705
- tone: t8,
1706
- ...t9
1707
- } = props;
1708
- children = t42, t0 = t52, t1 = t62, t2 = t72, t3 = t8, restProps = t9, $[0] = props, $[1] = children, $[2] = restProps, $[3] = t0, $[4] = t1, $[5] = t2, $[6] = t3;
1709
- } else
1710
- children = $[1], restProps = $[2], t0 = $[3], t1 = $[4], t2 = $[5], t3 = $[6];
1711
- const fontSize2 = t0 === void 0 ? 1 : t0, padding = t1 === void 0 ? 1 : t1, radius = t2 === void 0 ? "full" : t2, tone = t3 === void 0 ? "default" : t3, t4 = useArrayProp(radius), t5 = useArrayProp(padding);
1712
- let t6;
1713
- $[7] !== children || $[8] !== fontSize2 ? (t6 = /* @__PURE__ */ jsxRuntime.jsx(Text, { size: fontSize2, children }), $[7] = children, $[8] = fontSize2, $[9] = t6) : t6 = $[9];
1714
- let t7;
1715
- return $[10] !== ref || $[11] !== restProps || $[12] !== t4 || $[13] !== t5 || $[14] !== t6 || $[15] !== tone ? (t7 = /* @__PURE__ */ jsxRuntime.jsx(StyledBadge, { "data-ui": "Badge", ...restProps, $tone: tone, $radius: t4, padding: t5, ref, children: t6 }), $[10] = ref, $[11] = restProps, $[12] = t4, $[13] = t5, $[14] = t6, $[15] = tone, $[16] = t7) : t7 = $[16], t7;
1409
+ const {
1410
+ children,
1411
+ fontSize: fontSize2 = 1,
1412
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
1413
+ mode: _deprecated_mode,
1414
+ padding = 1,
1415
+ radius = "full",
1416
+ tone = "default",
1417
+ ...restProps
1418
+ } = props;
1419
+ return /* @__PURE__ */ jsxRuntime.jsx(StyledBadge, { "data-ui": "Badge", ...restProps, $tone: tone, $radius: _getArrayProp(radius), padding: _getArrayProp(padding), ref, children: /* @__PURE__ */ jsxRuntime.jsx(Text, { size: fontSize2, children }) });
1716
1420
  });
1717
1421
  Badge.displayName = "ForwardRef(Badge)";
1718
1422
  const StyledFlex = /* @__PURE__ */ styledComponents.styled(Box).withConfig({
1719
1423
  displayName: "StyledFlex",
1720
1424
  componentId: "sc-oxesg3-0"
1721
1425
  })(flexItemStyle, responsiveFlexStyle), Flex = react.forwardRef(function(props, ref) {
1722
- const $ = reactCompilerRuntime.c(17);
1723
- let align, as, gap, justify, restProps, t0, wrap;
1724
- $[0] !== props ? ({
1426
+ const {
1725
1427
  align,
1726
1428
  as,
1727
- direction: t0,
1429
+ direction = "row",
1728
1430
  gap,
1729
1431
  justify,
1730
1432
  wrap,
1731
1433
  ...restProps
1732
- } = props, $[0] = props, $[1] = align, $[2] = as, $[3] = gap, $[4] = justify, $[5] = restProps, $[6] = t0, $[7] = wrap) : (align = $[1], as = $[2], gap = $[3], justify = $[4], restProps = $[5], t0 = $[6], wrap = $[7]);
1733
- const direction = t0 === void 0 ? "row" : t0, t1 = useArrayProp(align), t2 = useArrayProp(direction), t3 = useArrayProp(gap), t4 = useArrayProp(justify), t5 = useArrayProp(wrap);
1734
- let t6;
1735
- return $[8] !== as || $[9] !== ref || $[10] !== restProps || $[11] !== t1 || $[12] !== t2 || $[13] !== t3 || $[14] !== t4 || $[15] !== t5 ? (t6 = /* @__PURE__ */ jsxRuntime.jsx(StyledFlex, { "data-ui": "Flex", ...restProps, $align: t1, $direction: t2, $gap: t3, $justify: t4, $wrap: t5, forwardedAs: as, ref }), $[8] = as, $[9] = ref, $[10] = restProps, $[11] = t1, $[12] = t2, $[13] = t3, $[14] = t4, $[15] = t5, $[16] = t6) : t6 = $[16], t6;
1434
+ } = props;
1435
+ return /* @__PURE__ */ jsxRuntime.jsx(StyledFlex, { "data-ui": "Flex", ...restProps, $align: _getArrayProp(align), $direction: _getArrayProp(direction), $gap: _getArrayProp(gap), $justify: _getArrayProp(justify), $wrap: _getArrayProp(wrap), forwardedAs: as, ref });
1736
1436
  });
1737
1437
  Flex.displayName = "ForwardRef(Flex)";
1738
1438
  const rotate = styledComponents.keyframes`
@@ -1747,11 +1447,7 @@ const rotate = styledComponents.keyframes`
1747
1447
  displayName: "StyledSpinner",
1748
1448
  componentId: "sc-124hnd0-0"
1749
1449
  })`& > span > svg{animation:${rotate} 500ms linear infinite;}`, Spinner = react.forwardRef(function(props, ref) {
1750
- const $ = reactCompilerRuntime.c(4);
1751
- let t0;
1752
- $[0] === Symbol.for("react.memo_cache_sentinel") ? (t0 = /* @__PURE__ */ jsxRuntime.jsx(icons.SpinnerIcon, {}), $[0] = t0) : t0 = $[0];
1753
- let t1;
1754
- return $[1] !== props || $[2] !== ref ? (t1 = /* @__PURE__ */ jsxRuntime.jsx(StyledSpinner, { "data-ui": "Spinner", ...props, ref, children: t0 }), $[1] = props, $[2] = ref, $[3] = t1) : t1 = $[3], t1;
1450
+ return /* @__PURE__ */ jsxRuntime.jsx(StyledSpinner, { "data-ui": "Spinner", ...props, ref, children: /* @__PURE__ */ jsxRuntime.jsx(icons.SpinnerIcon, {}) });
1755
1451
  });
1756
1452
  Spinner.displayName = "ForwardRef(Spinner)";
1757
1453
  function _cardColorStyle(base, color, checkered = !1) {
@@ -1929,41 +1625,37 @@ const StyledButton = /* @__PURE__ */ styledComponents.styled.button.withConfig({
1929
1625
  displayName: "LoadingBox",
1930
1626
  componentId: "sc-aaekt4-1"
1931
1627
  })`position:absolute;top:0;left:0;right:0;bottom:0;display:flex;align-items:center;justify-content:center;background-color:var(--card-bg-color);border-radius:inherit;z-index:1;box-shadow:inherit;`, Button = react.forwardRef(function(props, ref) {
1932
- const $ = reactCompilerRuntime.c(66);
1933
- let IconComponent, IconRightComponent, children, disabled, loading, paddingBottomProp, paddingLeftProp, paddingRightProp, paddingTopProp, paddingXProp, paddingYProp, restProps, selected, t0, t1, t2, t3, t4, t5, t6, t7, t8, text, textAlign, textWeight, width;
1934
- $[0] !== props ? ({
1628
+ const {
1935
1629
  children,
1936
1630
  disabled,
1937
- fontSize: t0,
1631
+ fontSize: fontSize2 = 1,
1938
1632
  icon: IconComponent,
1939
1633
  iconRight: IconRightComponent,
1940
- justify: t1,
1634
+ justify: justifyProp = "center",
1941
1635
  loading,
1942
- mode: t2,
1943
- padding: t3,
1636
+ mode = "default",
1637
+ padding: paddingProp = 3,
1944
1638
  paddingX: paddingXProp,
1945
1639
  paddingY: paddingYProp,
1946
1640
  paddingTop: paddingTopProp,
1947
1641
  paddingBottom: paddingBottomProp,
1948
1642
  paddingLeft: paddingLeftProp,
1949
1643
  paddingRight: paddingRightProp,
1950
- radius: t4,
1644
+ radius: radiusProp = 2,
1951
1645
  selected,
1952
- space: t5,
1646
+ space: spaceProp = 3,
1953
1647
  text,
1954
1648
  textAlign,
1955
1649
  textWeight,
1956
- tone: t6,
1957
- type: t7,
1958
- muted: t8,
1650
+ tone = "default",
1651
+ type = "button",
1652
+ muted = !1,
1959
1653
  width,
1960
1654
  ...restProps
1961
- } = props, $[0] = props, $[1] = IconComponent, $[2] = IconRightComponent, $[3] = children, $[4] = disabled, $[5] = loading, $[6] = paddingBottomProp, $[7] = paddingLeftProp, $[8] = paddingRightProp, $[9] = paddingTopProp, $[10] = paddingXProp, $[11] = paddingYProp, $[12] = restProps, $[13] = selected, $[14] = t0, $[15] = t1, $[16] = t2, $[17] = t3, $[18] = t4, $[19] = t5, $[20] = t6, $[21] = t7, $[22] = t8, $[23] = text, $[24] = textAlign, $[25] = textWeight, $[26] = width) : (IconComponent = $[1], IconRightComponent = $[2], children = $[3], disabled = $[4], loading = $[5], paddingBottomProp = $[6], paddingLeftProp = $[7], paddingRightProp = $[8], paddingTopProp = $[9], paddingXProp = $[10], paddingYProp = $[11], restProps = $[12], selected = $[13], t0 = $[14], t1 = $[15], t2 = $[16], t3 = $[17], t4 = $[18], t5 = $[19], t6 = $[20], t7 = $[21], t8 = $[22], text = $[23], textAlign = $[24], textWeight = $[25], width = $[26]);
1962
- const fontSize2 = t0 === void 0 ? 1 : t0, justifyProp = t1 === void 0 ? "center" : t1, mode = t2 === void 0 ? "default" : t2, paddingProp = t3 === void 0 ? 3 : t3, radiusProp = t4 === void 0 ? 2 : t4, spaceProp = t5 === void 0 ? 3 : t5, tone = t6 === void 0 ? "default" : t6, type = t7 === void 0 ? "button" : t7, muted = t8 === void 0 ? !1 : t8, {
1655
+ } = props, {
1963
1656
  button
1964
- } = useTheme_v2(), justify = useArrayProp(justifyProp), padding = useArrayProp(paddingProp), paddingX = useArrayProp(paddingXProp), paddingY = useArrayProp(paddingYProp), paddingTop = useArrayProp(paddingTopProp), paddingBottom = useArrayProp(paddingBottomProp), paddingLeft = useArrayProp(paddingLeftProp), paddingRight = useArrayProp(paddingRightProp), radius = useArrayProp(radiusProp), space = useArrayProp(spaceProp);
1965
- let t9;
1966
- $[27] !== padding || $[28] !== paddingBottom || $[29] !== paddingLeft || $[30] !== paddingRight || $[31] !== paddingTop || $[32] !== paddingX || $[33] !== paddingY ? (t9 = {
1657
+ } = useTheme_v2(), justify = _getArrayProp(justifyProp), padding = _getArrayProp(paddingProp), paddingX = _getArrayProp(paddingXProp), paddingY = _getArrayProp(paddingYProp), paddingTop = _getArrayProp(paddingTopProp), paddingBottom = _getArrayProp(paddingBottomProp), paddingLeft = _getArrayProp(paddingLeftProp), paddingRight = _getArrayProp(paddingRightProp), radius = _getArrayProp(radiusProp), space = _getArrayProp(spaceProp), boxProps = react.useMemo(() => ({
1658
+ // flex: 1,
1967
1659
  padding,
1968
1660
  paddingX,
1969
1661
  paddingY,
@@ -1971,30 +1663,22 @@ const StyledButton = /* @__PURE__ */ styledComponents.styled.button.withConfig({
1971
1663
  paddingBottom,
1972
1664
  paddingLeft,
1973
1665
  paddingRight
1974
- }, $[27] = padding, $[28] = paddingBottom, $[29] = paddingLeft, $[30] = paddingRight, $[31] = paddingTop, $[32] = paddingX, $[33] = paddingY, $[34] = t9) : t9 = $[34];
1975
- const boxProps = t9, t10 = !!(loading || disabled), t11 = selected ? "" : void 0, t12 = !!(loading || disabled);
1976
- let t13;
1977
- $[35] !== loading ? (t13 = !!loading && /* @__PURE__ */ jsxRuntime.jsx(LoadingBox, { children: /* @__PURE__ */ jsxRuntime.jsx(Spinner, {}) }), $[35] = loading, $[36] = t13) : t13 = $[36];
1978
- let t14;
1979
- $[37] !== IconComponent || $[38] !== IconRightComponent || $[39] !== boxProps || $[40] !== button || $[41] !== fontSize2 || $[42] !== justify || $[43] !== muted || $[44] !== space || $[45] !== text || $[46] !== textAlign || $[47] !== textWeight ? (t14 = (IconComponent || text || IconRightComponent) && /* @__PURE__ */ jsxRuntime.jsx(Box, { as: "span", ...boxProps, children: /* @__PURE__ */ jsxRuntime.jsxs(Flex, { as: "span", justify, gap: space, children: [
1980
- IconComponent && /* @__PURE__ */ jsxRuntime.jsxs(Text, { size: fontSize2, children: [
1981
- react.isValidElement(IconComponent) && IconComponent,
1982
- ReactIs.isValidElementType(IconComponent) && /* @__PURE__ */ jsxRuntime.jsx(IconComponent, {})
1983
- ] }),
1984
- text && /* @__PURE__ */ jsxRuntime.jsx(Box, { children: /* @__PURE__ */ jsxRuntime.jsx(Text, { muted, align: textAlign, size: fontSize2, textOverflow: "ellipsis", weight: textWeight ?? button.textWeight, children: text }) }),
1985
- IconRightComponent && /* @__PURE__ */ jsxRuntime.jsxs(Text, { size: fontSize2, children: [
1986
- react.isValidElement(IconRightComponent) && IconRightComponent,
1987
- ReactIs.isValidElementType(IconRightComponent) && /* @__PURE__ */ jsxRuntime.jsx(IconRightComponent, {})
1988
- ] })
1989
- ] }) }), $[37] = IconComponent, $[38] = IconRightComponent, $[39] = boxProps, $[40] = button, $[41] = fontSize2, $[42] = justify, $[43] = muted, $[44] = space, $[45] = text, $[46] = textAlign, $[47] = textWeight, $[48] = t14) : t14 = $[48];
1990
- let t15;
1991
- $[49] !== boxProps || $[50] !== children ? (t15 = children && /* @__PURE__ */ jsxRuntime.jsx(Box, { as: "span", ...boxProps, children }), $[49] = boxProps, $[50] = children, $[51] = t15) : t15 = $[51];
1992
- let t16;
1993
- return $[52] !== mode || $[53] !== radius || $[54] !== ref || $[55] !== restProps || $[56] !== t10 || $[57] !== t11 || $[58] !== t12 || $[59] !== t13 || $[60] !== t14 || $[61] !== t15 || $[62] !== tone || $[63] !== type || $[64] !== width ? (t16 = /* @__PURE__ */ jsxRuntime.jsxs(StyledButton, { "data-ui": "Button", ...restProps, $mode: mode, $radius: radius, $tone: tone, "data-disabled": t10, "data-selected": t11, disabled: t12, ref, type, $width: width, children: [
1994
- t13,
1995
- t14,
1996
- t15
1997
- ] }), $[52] = mode, $[53] = radius, $[54] = ref, $[55] = restProps, $[56] = t10, $[57] = t11, $[58] = t12, $[59] = t13, $[60] = t14, $[61] = t15, $[62] = tone, $[63] = type, $[64] = width, $[65] = t16) : t16 = $[65], t16;
1666
+ }), [padding, paddingX, paddingY, paddingTop, paddingBottom, paddingLeft, paddingRight]);
1667
+ return /* @__PURE__ */ jsxRuntime.jsxs(StyledButton, { "data-ui": "Button", ...restProps, $mode: mode, $radius: radius, $tone: tone, "data-disabled": !!(loading || disabled), "data-selected": selected ? "" : void 0, disabled: !!(loading || disabled), ref, type, $width: width, children: [
1668
+ !!loading && /* @__PURE__ */ jsxRuntime.jsx(LoadingBox, { children: /* @__PURE__ */ jsxRuntime.jsx(Spinner, {}) }),
1669
+ (IconComponent || text || IconRightComponent) && /* @__PURE__ */ jsxRuntime.jsx(Box, { as: "span", ...boxProps, children: /* @__PURE__ */ jsxRuntime.jsxs(Flex, { as: "span", justify, gap: space, children: [
1670
+ IconComponent && /* @__PURE__ */ jsxRuntime.jsxs(Text, { size: fontSize2, children: [
1671
+ react.isValidElement(IconComponent) && IconComponent,
1672
+ ReactIs.isValidElementType(IconComponent) && /* @__PURE__ */ jsxRuntime.jsx(IconComponent, {})
1673
+ ] }),
1674
+ text && /* @__PURE__ */ jsxRuntime.jsx(Box, { children: /* @__PURE__ */ jsxRuntime.jsx(Text, { muted, align: textAlign, size: fontSize2, textOverflow: "ellipsis", weight: textWeight ?? button.textWeight, children: text }) }),
1675
+ IconRightComponent && /* @__PURE__ */ jsxRuntime.jsxs(Text, { size: fontSize2, children: [
1676
+ react.isValidElement(IconRightComponent) && IconRightComponent,
1677
+ ReactIs.isValidElementType(IconRightComponent) && /* @__PURE__ */ jsxRuntime.jsx(IconRightComponent, {})
1678
+ ] })
1679
+ ] }) }),
1680
+ children && /* @__PURE__ */ jsxRuntime.jsx(Box, { as: "span", ...boxProps, children })
1681
+ ] });
1998
1682
  });
1999
1683
  Button.displayName = "ForwardRef(Button)";
2000
1684
  function cardStyle(props) {
@@ -2149,11 +1833,9 @@ const StyledCard = /* @__PURE__ */ styledComponents.styled(Box).withConfig({
2149
1833
  displayName: "StyledCard",
2150
1834
  componentId: "sc-osnro2-0"
2151
1835
  })(responsiveBorderStyle, responsiveRadiusStyle, responsiveShadowStyle, cardStyle), Card = react.forwardRef(function(props, ref) {
2152
- const $ = reactCompilerRuntime.c(42);
2153
- let asProp, border2, borderBottom2, borderLeft2, borderRight2, borderTop2, muted, pressed, restProps, scheme, selected, shadow, t0, t1, t2, t3;
2154
- $[0] !== props ? ({
2155
- __unstable_checkered: t0,
2156
- __unstable_focusRing: t1,
1836
+ const {
1837
+ __unstable_checkered: checkered = !1,
1838
+ __unstable_focusRing: focusRing = !1,
2157
1839
  as: asProp,
2158
1840
  border: border2,
2159
1841
  borderTop: borderTop2,
@@ -2162,20 +1844,164 @@ const StyledCard = /* @__PURE__ */ styledComponents.styled(Box).withConfig({
2162
1844
  borderLeft: borderLeft2,
2163
1845
  muted,
2164
1846
  pressed,
2165
- radius: t2,
1847
+ radius = 0,
2166
1848
  scheme,
2167
1849
  selected,
2168
1850
  shadow,
2169
- tone: t3,
1851
+ tone: toneProp = "default",
2170
1852
  ...restProps
2171
- } = props, $[0] = props, $[1] = asProp, $[2] = border2, $[3] = borderBottom2, $[4] = borderLeft2, $[5] = borderRight2, $[6] = borderTop2, $[7] = muted, $[8] = pressed, $[9] = restProps, $[10] = scheme, $[11] = selected, $[12] = shadow, $[13] = t0, $[14] = t1, $[15] = t2, $[16] = t3) : (asProp = $[1], border2 = $[2], borderBottom2 = $[3], borderLeft2 = $[4], borderRight2 = $[5], borderTop2 = $[6], muted = $[7], pressed = $[8], restProps = $[9], scheme = $[10], selected = $[11], shadow = $[12], t0 = $[13], t1 = $[14], t2 = $[15], t3 = $[16]);
2172
- const checkered = t0 === void 0 ? !1 : t0, focusRing = t1 === void 0 ? !1 : t1, radius = t2 === void 0 ? 0 : t2, toneProp = t3 === void 0 ? "default" : t3, as = ReactIs.isValidElementType(asProp) ? asProp : "div", rootTheme = useRootTheme(), tone = toneProp === "inherit" ? rootTheme.tone : toneProp, t4 = typeof as == "string" ? as : void 0, t5 = rootTheme.scheme, t6 = useArrayProp(border2), t7 = useArrayProp(borderTop2), t8 = useArrayProp(borderRight2), t9 = useArrayProp(borderBottom2), t10 = useArrayProp(borderLeft2), t11 = useArrayProp(radius), t12 = useArrayProp(shadow), t13 = checkered ? "" : void 0, t14 = pressed ? "" : void 0, t15 = selected ? "" : void 0;
2173
- let t16;
2174
- $[17] !== as || $[18] !== checkered || $[19] !== focusRing || $[20] !== muted || $[21] !== ref || $[22] !== restProps || $[23] !== rootTheme.scheme || $[24] !== selected || $[25] !== t10 || $[26] !== t11 || $[27] !== t12 || $[28] !== t13 || $[29] !== t14 || $[30] !== t15 || $[31] !== t4 || $[32] !== t6 || $[33] !== t7 || $[34] !== t8 || $[35] !== t9 || $[36] !== tone ? (t16 = /* @__PURE__ */ jsxRuntime.jsx(StyledCard, { "data-as": t4, "data-scheme": t5, "data-ui": "Card", "data-tone": tone, ...restProps, $border: t6, $borderTop: t7, $borderRight: t8, $borderBottom: t9, $borderLeft: t10, $checkered: checkered, $focusRing: focusRing, $muted: muted, $radius: t11, $shadow: t12, $tone: tone, "data-checkered": t13, "data-pressed": t14, "data-selected": t15, forwardedAs: as, ref, selected }), $[17] = as, $[18] = checkered, $[19] = focusRing, $[20] = muted, $[21] = ref, $[22] = restProps, $[23] = rootTheme.scheme, $[24] = selected, $[25] = t10, $[26] = t11, $[27] = t12, $[28] = t13, $[29] = t14, $[30] = t15, $[31] = t4, $[32] = t6, $[33] = t7, $[34] = t8, $[35] = t9, $[36] = tone, $[37] = t16) : t16 = $[37];
2175
- let t17;
2176
- return $[38] !== scheme || $[39] !== t16 || $[40] !== tone ? (t17 = /* @__PURE__ */ jsxRuntime.jsx(ThemeColorProvider, { scheme, tone, children: t16 }), $[38] = scheme, $[39] = t16, $[40] = tone, $[41] = t17) : t17 = $[41], t17;
1853
+ } = props, as = ReactIs.isValidElementType(asProp) ? asProp : "div", rootTheme = useRootTheme(), tone = toneProp === "inherit" ? rootTheme.tone : toneProp;
1854
+ return /* @__PURE__ */ jsxRuntime.jsx(ThemeColorProvider, { scheme, tone, children: /* @__PURE__ */ jsxRuntime.jsx(StyledCard, { "data-as": typeof as == "string" ? as : void 0, "data-scheme": rootTheme.scheme, "data-ui": "Card", "data-tone": tone, ...restProps, $border: _getArrayProp(border2), $borderTop: _getArrayProp(borderTop2), $borderRight: _getArrayProp(borderRight2), $borderBottom: _getArrayProp(borderBottom2), $borderLeft: _getArrayProp(borderLeft2), $checkered: checkered, $focusRing: focusRing, $muted: muted, $radius: _getArrayProp(radius), $shadow: _getArrayProp(shadow), $tone: tone, "data-checkered": checkered ? "" : void 0, "data-pressed": pressed ? "" : void 0, "data-selected": selected ? "" : void 0, forwardedAs: as, ref, selected }) });
2177
1855
  });
2178
1856
  Card.displayName = "ForwardRef(Card)";
1857
+ function useClickOutsideEvent(listener, elementsArg = () => EMPTY_ARRAY, boundaryElement) {
1858
+ const onEvent = useEffectEvent.useEffectEvent((evt) => {
1859
+ if (!listener)
1860
+ return;
1861
+ const target = evt.target;
1862
+ if (!(target instanceof Node))
1863
+ return;
1864
+ const resolvedBoundaryElement = boundaryElement?.();
1865
+ if (resolvedBoundaryElement && !resolvedBoundaryElement.contains(target))
1866
+ return;
1867
+ const elements = elementsArg().flat();
1868
+ for (const el of elements)
1869
+ if (el && (target === el || el.contains(target)))
1870
+ return;
1871
+ listener(evt);
1872
+ }), hasListener = !!listener;
1873
+ react.useEffect(() => {
1874
+ if (!hasListener) return;
1875
+ const handleEvent = (evt) => onEvent(evt);
1876
+ return document.addEventListener("mousedown", handleEvent), () => {
1877
+ document.removeEventListener("mousedown", handleEvent);
1878
+ };
1879
+ }, [hasListener]), react.useDebugValue(listener ? "MouseDown On" : "MouseDown Off");
1880
+ }
1881
+ function useCustomValidity(ref, customValidity) {
1882
+ react.useEffect(() => {
1883
+ ref.current?.setCustomValidity(customValidity || "");
1884
+ }, [customValidity, ref]);
1885
+ }
1886
+ const _ResizeObserver = typeof document < "u" && typeof window < "u" && window.ResizeObserver ? window.ResizeObserver : resizeObserver.ResizeObserver, _elementSizeObserver = _createElementSizeObserver();
1887
+ function _createElementRectValueListener() {
1888
+ return {
1889
+ subscribe(element, subscriber) {
1890
+ const resizeObserver2 = new _ResizeObserver(([entry]) => {
1891
+ subscriber({
1892
+ _contentRect: entry.contentRect,
1893
+ border: {
1894
+ width: entry.borderBoxSize[0].inlineSize,
1895
+ height: entry.borderBoxSize[0].blockSize
1896
+ },
1897
+ content: {
1898
+ width: entry.contentRect.width,
1899
+ height: entry.contentRect.height
1900
+ }
1901
+ });
1902
+ });
1903
+ return resizeObserver2.observe(element), () => {
1904
+ resizeObserver2.unobserve(element), resizeObserver2.disconnect();
1905
+ };
1906
+ }
1907
+ };
1908
+ }
1909
+ function _createElementSizeObserver() {
1910
+ const disposeCache = /* @__PURE__ */ new WeakMap(), subscribersCache = /* @__PURE__ */ new WeakMap();
1911
+ return {
1912
+ subscribe(element, subscriber) {
1913
+ const subscribers = subscribersCache.get(element) || [];
1914
+ let dispose = disposeCache.get(element);
1915
+ return subscribersCache.has(element) || (subscribersCache.set(element, subscribers), dispose = _createElementRectValueListener().subscribe(element, (elementRect) => {
1916
+ for (const sub of subscribers)
1917
+ sub(elementRect);
1918
+ })), subscribers.push(subscriber), () => {
1919
+ const idx = subscribers.indexOf(subscriber);
1920
+ idx > -1 && subscribers.splice(idx, 1), subscribers.length === 0 && dispose && dispose();
1921
+ };
1922
+ }
1923
+ };
1924
+ }
1925
+ function useElementSize(element) {
1926
+ const [size2, setSize] = react.useState(null);
1927
+ return react.useEffect(() => {
1928
+ if (element)
1929
+ return _elementSizeObserver.subscribe(element, setSize);
1930
+ }, [element]), size2;
1931
+ }
1932
+ function useGlobalKeyDown(onKeyDown) {
1933
+ const handleKeyDown = useEffectEvent.useEffectEvent((event) => onKeyDown(event));
1934
+ react.useEffect(() => {
1935
+ const handler = (event) => handleKeyDown(event);
1936
+ return window.addEventListener("keydown", handler), () => window.removeEventListener("keydown", handler);
1937
+ }, []);
1938
+ }
1939
+ function useMatchMedia(mediaQueryString, getServerSnapshot2) {
1940
+ return react.useDebugValue(mediaQueryString), react.useSyncExternalStore(react.useCallback((onStoreChange) => {
1941
+ const media = window.matchMedia(mediaQueryString);
1942
+ return media.addEventListener("change", onStoreChange), () => media.removeEventListener("change", onStoreChange);
1943
+ }, [mediaQueryString]), () => window.matchMedia(mediaQueryString).matches, getServerSnapshot2);
1944
+ }
1945
+ function _getMediaQuery(media, index) {
1946
+ return index === 0 ? `screen and (max-width: ${media[index] - 1}px)` : index === media.length ? `screen and (min-width: ${media[index - 1]}px)` : `screen and (min-width: ${media[index - 1]}px) and (max-width: ${media[index] - 1}px)`;
1947
+ }
1948
+ function _createMediaStore(media) {
1949
+ const mediaLen = media.length;
1950
+ let sizes;
1951
+ const getSizes = () => {
1952
+ if (!sizes) {
1953
+ sizes = [];
1954
+ for (let index = mediaLen; index > -1; index -= 1) {
1955
+ const mediaQuery = _getMediaQuery(media, index);
1956
+ sizes.push({
1957
+ index,
1958
+ mq: window.matchMedia(mediaQuery)
1959
+ });
1960
+ }
1961
+ }
1962
+ return sizes;
1963
+ };
1964
+ return {
1965
+ getSnapshot: () => {
1966
+ for (const {
1967
+ index,
1968
+ mq
1969
+ } of getSizes())
1970
+ if (mq.matches) return index;
1971
+ return 0;
1972
+ },
1973
+ subscribe: (onStoreChange) => {
1974
+ const disposeFns = [];
1975
+ for (const {
1976
+ mq
1977
+ } of getSizes()) {
1978
+ const handleChange = () => {
1979
+ mq.matches && onStoreChange();
1980
+ };
1981
+ mq.addEventListener("change", handleChange), disposeFns.push(() => mq.removeEventListener("change", handleChange));
1982
+ }
1983
+ return () => {
1984
+ for (const disposeFn of disposeFns)
1985
+ disposeFn();
1986
+ };
1987
+ }
1988
+ };
1989
+ }
1990
+ function getServerSnapshot() {
1991
+ return 0;
1992
+ }
1993
+ function useMediaIndex() {
1994
+ const {
1995
+ media
1996
+ } = useTheme_v2(), store = react.useMemo(() => _createMediaStore(media), [media]);
1997
+ return react.useSyncExternalStore(store.subscribe, store.getSnapshot, getServerSnapshot);
1998
+ }
1999
+ function usePrefersDark(getServerSnapshot2 = () => !1) {
2000
+ return useMatchMedia("(prefers-color-scheme: dark)", getServerSnapshot2);
2001
+ }
2002
+ function usePrefersReducedMotion(getServerSnapshot2 = () => !1) {
2003
+ return useMatchMedia("(prefers-reduced-motion: reduce)", getServerSnapshot2);
2004
+ }
2179
2005
  function checkboxBaseStyles() {
2180
2006
  return styledComponents.css`
2181
2007
  position: relative;
@@ -2321,9 +2147,7 @@ const StyledCheckbox = /* @__PURE__ */ styledComponents.styled.div.withConfig({
2321
2147
  displayName: "Input",
2322
2148
  componentId: "sc-1l5mt2l-1"
2323
2149
  })(inputElementStyles), Checkbox = react.forwardRef(function(props, forwardedRef) {
2324
- const $ = reactCompilerRuntime.c(25);
2325
- let checked, className, customValidity, disabled, indeterminate, readOnly, restProps, style;
2326
- $[0] !== props ? ({
2150
+ const {
2327
2151
  checked,
2328
2152
  className,
2329
2153
  disabled,
@@ -2332,27 +2156,16 @@ const StyledCheckbox = /* @__PURE__ */ styledComponents.styled.div.withConfig({
2332
2156
  readOnly,
2333
2157
  style,
2334
2158
  ...restProps
2335
- } = props, $[0] = props, $[1] = checked, $[2] = className, $[3] = customValidity, $[4] = disabled, $[5] = indeterminate, $[6] = readOnly, $[7] = restProps, $[8] = style) : (checked = $[1], className = $[2], customValidity = $[3], disabled = $[4], indeterminate = $[5], readOnly = $[6], restProps = $[7], style = $[8]);
2336
- const ref = react.useRef(null);
2337
- let t0;
2338
- $[9] === Symbol.for("react.memo_cache_sentinel") ? (t0 = () => ref.current, $[9] = t0) : t0 = $[9], react.useImperativeHandle(forwardedRef, t0);
2339
- let t1, t2;
2340
- $[10] !== indeterminate ? (t1 = () => {
2159
+ } = props, ref = react.useRef(null);
2160
+ return react.useImperativeHandle(forwardedRef, () => ref.current), react.useEffect(() => {
2341
2161
  ref.current && (ref.current.indeterminate = indeterminate || !1);
2342
- }, t2 = [indeterminate], $[10] = indeterminate, $[11] = t1, $[12] = t2) : (t1 = $[11], t2 = $[12]), react.useEffect(t1, t2), useCustomValidity(ref, customValidity);
2343
- const t3 = !disabled && readOnly ? "" : void 0, t4 = customValidity ? "" : void 0, t5 = disabled || readOnly;
2344
- let t6;
2345
- $[13] !== checked || $[14] !== readOnly || $[15] !== restProps || $[16] !== t3 || $[17] !== t4 || $[18] !== t5 ? (t6 = /* @__PURE__ */ jsxRuntime.jsx(Input$5, { "data-read-only": t3, "data-error": t4, ...restProps, checked, disabled: t5, type: "checkbox", readOnly, ref }), $[13] = checked, $[14] = readOnly, $[15] = restProps, $[16] = t3, $[17] = t4, $[18] = t5, $[19] = t6) : t6 = $[19];
2346
- let t7;
2347
- $[20] === Symbol.for("react.memo_cache_sentinel") ? (t7 = /* @__PURE__ */ jsxRuntime.jsxs("span", { children: [
2348
- /* @__PURE__ */ jsxRuntime.jsx(icons.CheckmarkIcon, {}),
2349
- /* @__PURE__ */ jsxRuntime.jsx(icons.RemoveIcon, {})
2350
- ] }), $[20] = t7) : t7 = $[20];
2351
- let t8;
2352
- return $[21] !== className || $[22] !== style || $[23] !== t6 ? (t8 = /* @__PURE__ */ jsxRuntime.jsxs(StyledCheckbox, { className, "data-ui": "Checkbox", style, children: [
2353
- t6,
2354
- t7
2355
- ] }), $[21] = className, $[22] = style, $[23] = t6, $[24] = t8) : t8 = $[24], t8;
2162
+ }, [indeterminate]), useCustomValidity(ref, customValidity), /* @__PURE__ */ jsxRuntime.jsxs(StyledCheckbox, { className, "data-ui": "Checkbox", style, children: [
2163
+ /* @__PURE__ */ jsxRuntime.jsx(Input$5, { "data-read-only": !disabled && readOnly ? "" : void 0, "data-error": customValidity ? "" : void 0, ...restProps, checked, disabled: disabled || readOnly, type: "checkbox", readOnly, ref }),
2164
+ /* @__PURE__ */ jsxRuntime.jsxs("span", { children: [
2165
+ /* @__PURE__ */ jsxRuntime.jsx(icons.CheckmarkIcon, {}),
2166
+ /* @__PURE__ */ jsxRuntime.jsx(icons.RemoveIcon, {})
2167
+ ] })
2168
+ ] });
2356
2169
  });
2357
2170
  Checkbox.displayName = "ForwardRef(Checkbox)";
2358
2171
  function codeSyntaxHighlightingStyle({
@@ -2509,24 +2322,14 @@ const LazyRefractor = react.lazy(() => Promise.resolve().then(function() {
2509
2322
  displayName: "StyledCode",
2510
2323
  componentId: "sc-4dymyn-0"
2511
2324
  })(codeBaseStyle, responsiveCodeFontStyle), Code = react.forwardRef(function(props, ref) {
2512
- const $ = reactCompilerRuntime.c(20);
2513
- let children, language, restProps, t0, weight;
2514
- $[0] !== props ? ({
2325
+ const {
2515
2326
  children,
2516
2327
  language,
2517
- size: t0,
2328
+ size: size2 = 2,
2518
2329
  weight,
2519
2330
  ...restProps
2520
- } = props, $[0] = props, $[1] = children, $[2] = language, $[3] = restProps, $[4] = t0, $[5] = weight) : (children = $[1], language = $[2], restProps = $[3], t0 = $[4], weight = $[5]);
2521
- const t1 = useArrayProp(t0 === void 0 ? 2 : t0);
2522
- let t2;
2523
- $[6] !== children ? (t2 = /* @__PURE__ */ jsxRuntime.jsx("code", { children }), $[6] = children, $[7] = t2) : t2 = $[7];
2524
- let t3;
2525
- $[8] !== children || $[9] !== language ? (t3 = /* @__PURE__ */ jsxRuntime.jsx(LazyRefractor, { language, value: children }), $[8] = children, $[9] = language, $[10] = t3) : t3 = $[10];
2526
- let t4;
2527
- $[11] !== t2 || $[12] !== t3 ? (t4 = /* @__PURE__ */ jsxRuntime.jsx(react.Suspense, { fallback: t2, children: t3 }), $[11] = t2, $[12] = t3, $[13] = t4) : t4 = $[13];
2528
- let t5;
2529
- return $[14] !== ref || $[15] !== restProps || $[16] !== t1 || $[17] !== t4 || $[18] !== weight ? (t5 = /* @__PURE__ */ jsxRuntime.jsx(StyledCode, { "data-ui": "Code", ...restProps, $size: t1, $weight: weight, ref, children: t4 }), $[14] = ref, $[15] = restProps, $[16] = t1, $[17] = t4, $[18] = weight, $[19] = t5) : t5 = $[19], t5;
2331
+ } = props;
2332
+ return /* @__PURE__ */ jsxRuntime.jsx(StyledCode, { "data-ui": "Code", ...restProps, $size: _getArrayProp(size2), $weight: weight, ref, children: /* @__PURE__ */ jsxRuntime.jsx(react.Suspense, { fallback: /* @__PURE__ */ jsxRuntime.jsx("code", { children }), children: /* @__PURE__ */ jsxRuntime.jsx(LazyRefractor, { language, value: children }) }) });
2530
2333
  });
2531
2334
  Code.displayName = "ForwardRef(Code)";
2532
2335
  const BASE_STYLE$1 = {
@@ -2549,25 +2352,19 @@ const StyledContainer = /* @__PURE__ */ styledComponents.styled(Box).withConfig(
2549
2352
  displayName: "StyledContainer",
2550
2353
  componentId: "sc-wyroop-0"
2551
2354
  })(containerBaseStyle, responsiveContainerWidthStyle), Container = react.forwardRef(function(props, ref) {
2552
- const $ = reactCompilerRuntime.c(9);
2553
- let as, restProps, t0;
2554
- $[0] !== props ? ({
2355
+ const {
2555
2356
  as,
2556
- width: t0,
2357
+ width = 2,
2557
2358
  ...restProps
2558
- } = props, $[0] = props, $[1] = as, $[2] = restProps, $[3] = t0) : (as = $[1], restProps = $[2], t0 = $[3]);
2559
- const t1 = useArrayProp(t0 === void 0 ? 2 : t0);
2560
- let t2;
2561
- return $[4] !== as || $[5] !== ref || $[6] !== restProps || $[7] !== t1 ? (t2 = /* @__PURE__ */ jsxRuntime.jsx(StyledContainer, { "data-ui": "Container", ...restProps, $width: t1, forwardedAs: as, ref }), $[4] = as, $[5] = ref, $[6] = restProps, $[7] = t1, $[8] = t2) : t2 = $[8], t2;
2359
+ } = props;
2360
+ return /* @__PURE__ */ jsxRuntime.jsx(StyledContainer, { "data-ui": "Container", ...restProps, $width: _getArrayProp(width), forwardedAs: as, ref });
2562
2361
  });
2563
2362
  Container.displayName = "ForwardRef(Container)";
2564
2363
  const StyledGrid = /* @__PURE__ */ styledComponents.styled(Box).withConfig({
2565
2364
  displayName: "StyledGrid",
2566
2365
  componentId: "sc-v8t8oz-0"
2567
2366
  })(responsiveGridStyle), Grid = react.forwardRef(function(props, ref) {
2568
- const $ = reactCompilerRuntime.c(26);
2569
- let as, autoCols, autoFlow, autoRows, children, columns, gap, gapX, gapY, restProps, rows;
2570
- $[0] !== props ? ({
2367
+ const {
2571
2368
  as,
2572
2369
  autoRows,
2573
2370
  autoCols,
@@ -2579,10 +2376,8 @@ const StyledGrid = /* @__PURE__ */ styledComponents.styled(Box).withConfig({
2579
2376
  rows,
2580
2377
  children,
2581
2378
  ...restProps
2582
- } = props, $[0] = props, $[1] = as, $[2] = autoCols, $[3] = autoFlow, $[4] = autoRows, $[5] = children, $[6] = columns, $[7] = gap, $[8] = gapX, $[9] = gapY, $[10] = restProps, $[11] = rows) : (as = $[1], autoCols = $[2], autoFlow = $[3], autoRows = $[4], children = $[5], columns = $[6], gap = $[7], gapX = $[8], gapY = $[9], restProps = $[10], rows = $[11]);
2583
- const t0 = typeof as == "string" ? as : void 0, t1 = useArrayProp(autoRows), t2 = useArrayProp(autoCols), t3 = useArrayProp(autoFlow), t4 = useArrayProp(columns), t5 = useArrayProp(gap), t6 = useArrayProp(gapX), t7 = useArrayProp(gapY), t8 = useArrayProp(rows);
2584
- let t9;
2585
- return $[12] !== as || $[13] !== children || $[14] !== ref || $[15] !== restProps || $[16] !== t0 || $[17] !== t1 || $[18] !== t2 || $[19] !== t3 || $[20] !== t4 || $[21] !== t5 || $[22] !== t6 || $[23] !== t7 || $[24] !== t8 ? (t9 = /* @__PURE__ */ jsxRuntime.jsx(StyledGrid, { "data-as": t0, "data-ui": "Grid", ...restProps, $autoRows: t1, $autoCols: t2, $autoFlow: t3, $columns: t4, $gap: t5, $gapX: t6, $gapY: t7, $rows: t8, forwardedAs: as, ref, children }), $[12] = as, $[13] = children, $[14] = ref, $[15] = restProps, $[16] = t0, $[17] = t1, $[18] = t2, $[19] = t3, $[20] = t4, $[21] = t5, $[22] = t6, $[23] = t7, $[24] = t8, $[25] = t9) : t9 = $[25], t9;
2379
+ } = props;
2380
+ return /* @__PURE__ */ jsxRuntime.jsx(StyledGrid, { "data-as": typeof as == "string" ? as : void 0, "data-ui": "Grid", ...restProps, $autoRows: _getArrayProp(autoRows), $autoCols: _getArrayProp(autoCols), $autoFlow: _getArrayProp(autoFlow), $columns: _getArrayProp(columns), $gap: _getArrayProp(gap), $gapX: _getArrayProp(gapX), $gapY: _getArrayProp(gapY), $rows: _getArrayProp(rows), forwardedAs: as, ref, children });
2586
2381
  });
2587
2382
  Grid.displayName = "ForwardRef(Grid)";
2588
2383
  function headingBaseStyle(props) {
@@ -2648,29 +2443,18 @@ const StyledHeading = /* @__PURE__ */ styledComponents.styled.div.withConfig({
2648
2443
  displayName: "StyledHeading",
2649
2444
  componentId: "sc-137lwim-0"
2650
2445
  })(headingBaseStyle, responsiveTextAlignStyle, responsiveHeadingFont), Heading = react.forwardRef(function(props, ref) {
2651
- const $ = reactCompilerRuntime.c(22);
2652
- let align, childrenProp, restProps, t0, t1, t2, textOverflow, weight;
2653
- $[0] !== props ? ({
2654
- accent: t0,
2446
+ const {
2447
+ accent = !1,
2655
2448
  align,
2656
2449
  children: childrenProp,
2657
- muted: t1,
2658
- size: t2,
2450
+ muted = !1,
2451
+ size: size2 = 2,
2659
2452
  textOverflow,
2660
2453
  weight,
2661
2454
  ...restProps
2662
- } = props, $[0] = props, $[1] = align, $[2] = childrenProp, $[3] = restProps, $[4] = t0, $[5] = t1, $[6] = t2, $[7] = textOverflow, $[8] = weight) : (align = $[1], childrenProp = $[2], restProps = $[3], t0 = $[4], t1 = $[5], t2 = $[6], textOverflow = $[7], weight = $[8]);
2663
- const accent = t0 === void 0 ? !1 : t0, muted = t1 === void 0 ? !1 : t1, size2 = t2 === void 0 ? 2 : t2;
2455
+ } = props;
2664
2456
  let children = childrenProp;
2665
- if (textOverflow === "ellipsis") {
2666
- let t32;
2667
- $[9] !== children ? (t32 = /* @__PURE__ */ jsxRuntime.jsx(SpanWithTextOverflow, { children }), $[9] = children, $[10] = t32) : t32 = $[10], children = t32;
2668
- }
2669
- const t3 = useArrayProp(align), t4 = useArrayProp(size2);
2670
- let t5;
2671
- $[11] !== children ? (t5 = /* @__PURE__ */ jsxRuntime.jsx("span", { children }), $[11] = children, $[12] = t5) : t5 = $[12];
2672
- let t6;
2673
- return $[13] !== accent || $[14] !== muted || $[15] !== ref || $[16] !== restProps || $[17] !== t3 || $[18] !== t4 || $[19] !== t5 || $[20] !== weight ? (t6 = /* @__PURE__ */ jsxRuntime.jsx(StyledHeading, { "data-ui": "Heading", ...restProps, $accent: accent, $align: t3, $muted: muted, $size: t4, $weight: weight, ref, children: t5 }), $[13] = accent, $[14] = muted, $[15] = ref, $[16] = restProps, $[17] = t3, $[18] = t4, $[19] = t5, $[20] = weight, $[21] = t6) : t6 = $[21], t6;
2457
+ return textOverflow === "ellipsis" && (children = /* @__PURE__ */ jsxRuntime.jsx(SpanWithTextOverflow, { children })), /* @__PURE__ */ jsxRuntime.jsx(StyledHeading, { "data-ui": "Heading", ...restProps, $accent: accent, $align: _getArrayProp(align), $muted: muted, $size: _getArrayProp(size2), $weight: weight, ref, children: /* @__PURE__ */ jsxRuntime.jsx("span", { children }) });
2674
2458
  });
2675
2459
  Heading.displayName = "ForwardRef(Heading)";
2676
2460
  function inlineBaseStyle() {
@@ -2704,24 +2488,15 @@ const StyledInline = /* @__PURE__ */ styledComponents.styled(Box).withConfig({
2704
2488
  displayName: "StyledInline",
2705
2489
  componentId: "sc-1pkiy6j-0"
2706
2490
  })(inlineBaseStyle, inlineSpaceStyle), Inline = react.forwardRef(function(props, ref) {
2707
- const $ = reactCompilerRuntime.c(13);
2708
- let as, childrenProp, restProps, space;
2709
- $[0] !== props ? ({
2491
+ const {
2710
2492
  as,
2711
2493
  children: childrenProp,
2712
2494
  space,
2713
2495
  ...restProps
2714
- } = props, $[0] = props, $[1] = as, $[2] = childrenProp, $[3] = restProps, $[4] = space) : (as = $[1], childrenProp = $[2], restProps = $[3], space = $[4]);
2715
- let t0;
2716
- $[5] !== childrenProp ? (t0 = react.Children.map(childrenProp, _temp$5), $[5] = childrenProp, $[6] = t0) : t0 = $[6];
2717
- const children = t0, t1 = useArrayProp(space), t2 = ref;
2718
- let t3;
2719
- return $[7] !== as || $[8] !== children || $[9] !== restProps || $[10] !== t1 || $[11] !== t2 ? (t3 = /* @__PURE__ */ jsxRuntime.jsx(StyledInline, { "data-ui": "Inline", ...restProps, $space: t1, forwardedAs: as, ref: t2, children }), $[7] = as, $[8] = children, $[9] = restProps, $[10] = t1, $[11] = t2, $[12] = t3) : t3 = $[12], t3;
2496
+ } = props, children = react.useMemo(() => react.Children.map(childrenProp, (child) => child && /* @__PURE__ */ jsxRuntime.jsx("div", { children: child })), [childrenProp]);
2497
+ return /* @__PURE__ */ jsxRuntime.jsx(StyledInline, { "data-ui": "Inline", ...restProps, $space: _getArrayProp(space), forwardedAs: as, ref, children });
2720
2498
  });
2721
2499
  Inline.displayName = "ForwardRef(Inline)";
2722
- function _temp$5(child) {
2723
- return child && /* @__PURE__ */ jsxRuntime.jsx("div", { children: child });
2724
- }
2725
2500
  function kbdStyle() {
2726
2501
  return styledComponents.css`
2727
2502
  --card-bg-color: var(--card-kbd-bg-color);
@@ -2743,22 +2518,14 @@ const StyledKBD = /* @__PURE__ */ styledComponents.styled.kbd.withConfig({
2743
2518
  displayName: "StyledKBD",
2744
2519
  componentId: "sc-1w7yd8w-0"
2745
2520
  })(responsiveRadiusStyle, kbdStyle), KBD = react.forwardRef(function(props, ref) {
2746
- const $ = reactCompilerRuntime.c(17);
2747
- let children, restProps, t0, t1, t2;
2748
- $[0] !== props ? ({
2521
+ const {
2749
2522
  children,
2750
- fontSize: t0,
2751
- padding: t1,
2752
- radius: t2,
2523
+ fontSize: fontSize2 = 0,
2524
+ padding = 1,
2525
+ radius = 2,
2753
2526
  ...restProps
2754
- } = props, $[0] = props, $[1] = children, $[2] = restProps, $[3] = t0, $[4] = t1, $[5] = t2) : (children = $[1], restProps = $[2], t0 = $[3], t1 = $[4], t2 = $[5]);
2755
- const fontSize2 = t0 === void 0 ? 0 : t0, padding = t1 === void 0 ? 1 : t1, t3 = useArrayProp(t2 === void 0 ? 2 : t2);
2756
- let t4;
2757
- $[6] !== children || $[7] !== fontSize2 ? (t4 = /* @__PURE__ */ jsxRuntime.jsx(Text, { as: "span", size: fontSize2, weight: "semibold", children }), $[6] = children, $[7] = fontSize2, $[8] = t4) : t4 = $[8];
2758
- let t5;
2759
- $[9] !== padding || $[10] !== t4 ? (t5 = /* @__PURE__ */ jsxRuntime.jsx(Box, { as: "span", padding, children: t4 }), $[9] = padding, $[10] = t4, $[11] = t5) : t5 = $[11];
2760
- let t6;
2761
- return $[12] !== ref || $[13] !== restProps || $[14] !== t3 || $[15] !== t5 ? (t6 = /* @__PURE__ */ jsxRuntime.jsx(StyledKBD, { "data-ui": "KBD", ...restProps, $radius: t3, ref, children: t5 }), $[12] = ref, $[13] = restProps, $[14] = t3, $[15] = t5, $[16] = t6) : t6 = $[16], t6;
2527
+ } = props;
2528
+ return /* @__PURE__ */ jsxRuntime.jsx(StyledKBD, { "data-ui": "KBD", ...restProps, $radius: _getArrayProp(radius), ref, children: /* @__PURE__ */ jsxRuntime.jsx(Box, { as: "span", padding, children: /* @__PURE__ */ jsxRuntime.jsx(Text, { as: "span", size: fontSize2, weight: "semibold", children }) }) });
2762
2529
  });
2763
2530
  KBD.displayName = "ForwardRef(KBD)";
2764
2531
  const origin = {
@@ -2886,15 +2653,12 @@ const StyledArrow = /* @__PURE__ */ styledComponents.styled.div.withConfig({
2886
2653
  displayName: "ShapePath",
2887
2654
  componentId: "sc-12vzy6c-2"
2888
2655
  })`fill:var(--card-bg-color);`, Arrow = react.forwardRef(function(props, ref) {
2889
- const $ = reactCompilerRuntime.c(24);
2890
- let h, restProps, t0, w;
2891
- $[0] !== props ? ({
2656
+ const {
2892
2657
  width: w,
2893
2658
  height: h,
2894
- radius: t0,
2659
+ radius = 0,
2895
2660
  ...restProps
2896
- } = props, $[0] = props, $[1] = h, $[2] = restProps, $[3] = t0, $[4] = w) : (h = $[1], restProps = $[2], t0 = $[3], w = $[4]);
2897
- const radius = t0 === void 0 ? 0 : t0, {
2661
+ } = props, {
2898
2662
  card
2899
2663
  } = useTheme_v2(), strokeWidth = card.shadow.outline, center = w / 2, points = [{
2900
2664
  x: 0,
@@ -2914,38 +2678,24 @@ const StyledArrow = /* @__PURE__ */ styledComponents.styled.div.withConfig({
2914
2678
  }, {
2915
2679
  x: w,
2916
2680
  y: 0
2917
- }], cmds = getRoundedCommands(points), path = compileCommands(cmds), strokePath = `${path}`, fillPath = `${path} M ${w} -1 M 0 -1 Z`, t1 = `0 0 ${w} ${w}`;
2918
- let t2;
2919
- $[5] !== strokeWidth || $[6] !== w ? (t2 = /* @__PURE__ */ jsxRuntime.jsx("mask", { id: "stroke-mask", children: /* @__PURE__ */ jsxRuntime.jsx("rect", { x: 0, y: strokeWidth, width: w, height: w, fill: "white" }) }), $[5] = strokeWidth, $[6] = w, $[7] = t2) : t2 = $[7];
2920
- const t3 = strokeWidth * 2;
2921
- let t4;
2922
- $[8] !== strokePath || $[9] !== t3 ? (t4 = /* @__PURE__ */ jsxRuntime.jsx(StrokePath, { d: strokePath, mask: "url(#stroke-mask)", strokeWidth: t3 }), $[8] = strokePath, $[9] = t3, $[10] = t4) : t4 = $[10];
2923
- let t5;
2924
- $[11] !== fillPath ? (t5 = /* @__PURE__ */ jsxRuntime.jsx(ShapePath, { d: fillPath }), $[11] = fillPath, $[12] = t5) : t5 = $[12];
2925
- let t6;
2926
- $[13] !== t1 || $[14] !== t2 || $[15] !== t4 || $[16] !== t5 || $[17] !== w ? (t6 = /* @__PURE__ */ jsxRuntime.jsxs("svg", { width: w, height: w, viewBox: t1, children: [
2927
- t2,
2928
- t4,
2929
- t5
2930
- ] }), $[13] = t1, $[14] = t2, $[15] = t4, $[16] = t5, $[17] = w, $[18] = t6) : t6 = $[18];
2931
- let t7;
2932
- return $[19] !== ref || $[20] !== restProps || $[21] !== t6 || $[22] !== w ? (t7 = /* @__PURE__ */ jsxRuntime.jsx(StyledArrow, { ...restProps, $w: w, ref, children: t6 }), $[19] = ref, $[20] = restProps, $[21] = t6, $[22] = w, $[23] = t7) : t7 = $[23], t7;
2681
+ }], cmds = getRoundedCommands(points), path = compileCommands(cmds), strokePath = `${path}`, fillPath = `${path} M ${w} -1 M 0 -1 Z`;
2682
+ return /* @__PURE__ */ jsxRuntime.jsx(StyledArrow, { ...restProps, $w: w, ref, children: /* @__PURE__ */ jsxRuntime.jsxs("svg", { width: w, height: w, viewBox: `0 0 ${w} ${w}`, children: [
2683
+ /* @__PURE__ */ jsxRuntime.jsx("mask", { id: "stroke-mask", children: /* @__PURE__ */ jsxRuntime.jsx("rect", { x: 0, y: strokeWidth, width: w, height: w, fill: "white" }) }),
2684
+ /* @__PURE__ */ jsxRuntime.jsx(StrokePath, { d: strokePath, mask: "url(#stroke-mask)", strokeWidth: strokeWidth * 2 }),
2685
+ /* @__PURE__ */ jsxRuntime.jsx(ShapePath, { d: fillPath })
2686
+ ] }) });
2933
2687
  });
2934
2688
  Arrow.displayName = "ForwardRef(Arrow)";
2935
2689
  const BoundaryElementContext = createGlobalScopedContext("@sanity/ui/context/boundaryElement", null);
2936
2690
  function BoundaryElementProvider(props) {
2937
- const $ = reactCompilerRuntime.c(5), {
2691
+ const {
2938
2692
  children,
2939
2693
  element
2940
- } = props;
2941
- let t0;
2942
- $[0] !== element ? (t0 = {
2694
+ } = props, value = react.useMemo(() => ({
2943
2695
  version: 0,
2944
2696
  element
2945
- }, $[0] = element, $[1] = t0) : t0 = $[1];
2946
- const value = t0;
2947
- let t1;
2948
- return $[2] !== children || $[3] !== value ? (t1 = /* @__PURE__ */ jsxRuntime.jsx(BoundaryElementContext.Provider, { value, children }), $[2] = children, $[3] = value, $[4] = t1) : t1 = $[4], t1;
2697
+ }), [element]);
2698
+ return /* @__PURE__ */ jsxRuntime.jsx(BoundaryElementContext.Provider, { value, children });
2949
2699
  }
2950
2700
  BoundaryElementProvider.displayName = "BoundaryElementProvider";
2951
2701
  function isRecord(value) {
@@ -2982,32 +2732,18 @@ function findMinBreakpoints(media, width) {
2982
2732
  return ret;
2983
2733
  }
2984
2734
  const ElementQuery = react.forwardRef(function(props, forwardedRef) {
2985
- const $ = reactCompilerRuntime.c(18), theme2 = useTheme_v2();
2986
- let _media, children, restProps;
2987
- $[0] !== props ? ({
2735
+ const theme2 = useTheme_v2(), {
2988
2736
  children,
2989
2737
  media: _media,
2990
2738
  ...restProps
2991
- } = props, $[0] = props, $[1] = _media, $[2] = children, $[3] = restProps) : (_media = $[1], children = $[2], restProps = $[3]);
2992
- const media = _media ?? theme2.media, [element, setElement] = react.useState(null), width = useElementSize(element)?.border.width ?? window.innerWidth;
2993
- let t0;
2994
- if ($[4] !== media || $[5] !== width) {
2739
+ } = props, media = _media ?? theme2.media, [element, setElement] = react.useState(null), elementSize = useElementSize(element), width = react.useMemo(() => elementSize?.border.width ?? window.innerWidth, [elementSize]), max = react.useMemo(() => {
2995
2740
  const eq = findMaxBreakpoints(media, width);
2996
- t0 = eq.length ? eq.join(" ") : void 0, $[4] = media, $[5] = width, $[6] = t0;
2997
- } else
2998
- t0 = $[6];
2999
- const max = t0;
3000
- let t1;
3001
- if ($[7] !== media || $[8] !== width) {
3002
- const eq_0 = findMinBreakpoints(media, width);
3003
- t1 = eq_0.length ? eq_0.join(" ") : void 0, $[7] = media, $[8] = width, $[9] = t1;
3004
- } else
3005
- t1 = $[9];
3006
- const min = t1;
3007
- let t2, t3;
3008
- $[10] !== element ? (t2 = () => element, t3 = [element], $[10] = element, $[11] = t2, $[12] = t3) : (t2 = $[11], t3 = $[12]), react.useImperativeHandle(forwardedRef, t2, t3);
3009
- let t4;
3010
- return $[13] !== children || $[14] !== max || $[15] !== min || $[16] !== restProps ? (t4 = /* @__PURE__ */ jsxRuntime.jsx("div", { "data-ui": "ElementQuery", ...restProps, "data-eq-max": max, "data-eq-min": min, ref: setElement, children }), $[13] = children, $[14] = max, $[15] = min, $[16] = restProps, $[17] = t4) : t4 = $[17], t4;
2741
+ return eq.length ? eq.join(" ") : void 0;
2742
+ }, [media, width]), min = react.useMemo(() => {
2743
+ const eq = findMinBreakpoints(media, width);
2744
+ return eq.length ? eq.join(" ") : void 0;
2745
+ }, [media, width]);
2746
+ return react.useImperativeHandle(forwardedRef, () => element, [element]), /* @__PURE__ */ jsxRuntime.jsx("div", { "data-ui": "ElementQuery", ...restProps, "data-eq-max": max, "data-eq-min": min, ref: setElement, children });
3011
2747
  });
3012
2748
  ElementQuery.displayName = "ForwardRef(ElementQuery)";
3013
2749
  function getLayerContext(contextValue) {
@@ -3021,18 +2757,10 @@ function getLayerContext(contextValue) {
3021
2757
  }
3022
2758
  const LayerContext = createGlobalScopedContext("@sanity/ui/context/layer", null);
3023
2759
  function LayerProvider(props) {
3024
- const $ = reactCompilerRuntime.c(19), {
2760
+ const {
3025
2761
  children,
3026
- zOffset: t0
3027
- } = props, zOffsetProp = t0 === void 0 ? 0 : t0, parentContextValue = react.useContext(LayerContext);
3028
- let t1;
3029
- $[0] !== parentContextValue ? (t1 = parentContextValue && getLayerContext(parentContextValue), $[0] = parentContextValue, $[1] = t1) : t1 = $[1];
3030
- const parent = t1, parentRegisterChild = parent?.registerChild, level = (parent?.level ?? 0) + 1, zOffset = useArrayProp(zOffsetProp), maxMediaIndex = zOffset.length - 1, mediaIndex = Math.min(useMediaIndex(), maxMediaIndex), zIndex = parent ? parent.zIndex + zOffset[mediaIndex] : zOffset[mediaIndex];
3031
- let t2;
3032
- $[2] === Symbol.for("react.memo_cache_sentinel") ? (t2 = {}, $[2] = t2) : t2 = $[2];
3033
- const [, setChildLayers] = react.useState(t2), [size2, setSize] = react.useState(0), isTopLayer = size2 === 0;
3034
- let t3;
3035
- $[3] !== parentRegisterChild || $[4] !== setChildLayers ? (t3 = (childLevel) => {
2762
+ zOffset: zOffsetProp = 0
2763
+ } = props, parentContextValue = react.useContext(LayerContext), parent = parentContextValue && getLayerContext(parentContextValue), parentRegisterChild = parent?.registerChild, level = (parent?.level ?? 0) + 1, zOffset = _getArrayProp(zOffsetProp), maxMediaIndex = zOffset.length - 1, mediaIndex = Math.min(useMediaIndex(), maxMediaIndex), zIndex = parent ? parent.zIndex + zOffset[mediaIndex] : zOffset[mediaIndex], [, setChildLayers] = react.useState({}), [size2, setSize] = react.useState(0), isTopLayer = size2 === 0, registerChild = react.useCallback((childLevel) => {
3036
2764
  const parentDispose = parentRegisterChild?.(childLevel);
3037
2765
  return childLevel !== void 0 ? setChildLayers((state) => {
3038
2766
  const prevLen = state[childLevel] ?? 0, nextState = {
@@ -3040,47 +2768,34 @@ function LayerProvider(props) {
3040
2768
  [childLevel]: prevLen + 1
3041
2769
  };
3042
2770
  return setSize(Object.keys(nextState).length), nextState;
3043
- }) : setSize(_temp$4), () => {
3044
- childLevel !== void 0 ? setChildLayers((state_0) => {
3045
- const nextState_0 = {
3046
- ...state_0
2771
+ }) : setSize((v) => v + 1), () => {
2772
+ childLevel !== void 0 ? setChildLayers((state) => {
2773
+ const nextState = {
2774
+ ...state
3047
2775
  };
3048
- return nextState_0[childLevel] === 1 ? (delete nextState_0[childLevel], setSize(Object.keys(nextState_0).length)) : nextState_0[childLevel] = nextState_0[childLevel] - 1, nextState_0;
3049
- }) : setSize(_temp2$2), parentDispose?.();
2776
+ return nextState[childLevel] === 1 ? (delete nextState[childLevel], setSize(Object.keys(nextState).length)) : nextState[childLevel] -= 1, nextState;
2777
+ }) : setSize((v) => v - 1), parentDispose?.();
3050
2778
  };
3051
- }, $[3] = parentRegisterChild, $[4] = setChildLayers, $[5] = t3) : t3 = $[5];
3052
- const registerChild = t3;
3053
- let t4, t5;
3054
- $[6] !== level || $[7] !== parentRegisterChild ? (t4 = () => parentRegisterChild?.(level), t5 = [level, parentRegisterChild], $[6] = level, $[7] = parentRegisterChild, $[8] = t4, $[9] = t5) : (t4 = $[8], t5 = $[9]), react.useEffect(t4, t5);
3055
- let t6;
3056
- $[10] !== isTopLayer || $[11] !== level || $[12] !== registerChild || $[13] !== size2 || $[14] !== zIndex ? (t6 = {
2779
+ }, [parentRegisterChild, setSize, setChildLayers]);
2780
+ react.useEffect(() => parentRegisterChild?.(level), [level, parentRegisterChild]);
2781
+ const value = react.useMemo(() => ({
3057
2782
  version: 0,
3058
2783
  isTopLayer,
3059
2784
  level,
3060
2785
  registerChild,
3061
2786
  size: size2,
3062
2787
  zIndex
3063
- }, $[10] = isTopLayer, $[11] = level, $[12] = registerChild, $[13] = size2, $[14] = zIndex, $[15] = t6) : t6 = $[15];
3064
- const value = t6;
3065
- let t7;
3066
- return $[16] !== children || $[17] !== value ? (t7 = /* @__PURE__ */ jsxRuntime.jsx(LayerContext.Provider, { value, children }), $[16] = children, $[17] = value, $[18] = t7) : t7 = $[18], t7;
3067
- }
3068
- function _temp2$2(v_0) {
3069
- return v_0 - 1;
3070
- }
3071
- function _temp$4(v) {
3072
- return v + 1;
2788
+ }), [isTopLayer, level, registerChild, size2, zIndex]);
2789
+ return /* @__PURE__ */ jsxRuntime.jsx(LayerContext.Provider, { value, children });
3073
2790
  }
3074
2791
  LayerProvider.displayName = "LayerProvider";
3075
2792
  function useLayer() {
3076
- const $ = reactCompilerRuntime.c(2), value = react.useContext(LayerContext);
2793
+ const value = react.useContext(LayerContext);
3077
2794
  if (!value)
3078
2795
  throw new Error("useLayer(): missing context value");
3079
2796
  try {
3080
- let t1;
3081
- return $[0] !== value ? (t1 = getLayerContext(value), $[0] = value, $[1] = t1) : t1 = $[1], t1;
3082
- } catch (t0) {
3083
- const err = t0;
2797
+ return getLayerContext(value);
2798
+ } catch (err) {
3084
2799
  throw err instanceof Error ? new Error(`useLayer(): ${err.message}`) : new Error(`useLayer(): ${err}`);
3085
2800
  }
3086
2801
  }
@@ -3090,54 +2805,37 @@ const StyledLayer = /* @__PURE__ */ styledComponents.styled.div.withConfig({
3090
2805
  })({
3091
2806
  position: "relative"
3092
2807
  }), LayerChildren = react.forwardRef(function(props, forwardedRef) {
3093
- const $ = reactCompilerRuntime.c(22);
3094
- let children, onActivate, onFocus, restProps, t0;
3095
- $[0] !== props ? ({
2808
+ const {
3096
2809
  children,
3097
2810
  onActivate,
3098
2811
  onFocus,
3099
- style: t0,
2812
+ style = EMPTY_RECORD,
3100
2813
  ...restProps
3101
- } = props, $[0] = props, $[1] = children, $[2] = onActivate, $[3] = onFocus, $[4] = restProps, $[5] = t0) : (children = $[1], onActivate = $[2], onFocus = $[3], restProps = $[4], t0 = $[5]);
3102
- const style = t0 === void 0 ? EMPTY_RECORD : t0, {
2814
+ } = props, {
3103
2815
  zIndex,
3104
2816
  isTopLayer
3105
2817
  } = useLayer(), lastFocusedRef = react.useRef(null), ref = react.useRef(null), isTopLayerRef = react.useRef(isTopLayer);
3106
- let t1;
3107
- $[6] === Symbol.for("react.memo_cache_sentinel") ? (t1 = () => ref.current, $[6] = t1) : t1 = $[6], react.useImperativeHandle(forwardedRef, t1);
3108
- let t2, t3;
3109
- $[7] !== isTopLayer || $[8] !== onActivate ? (t2 = () => {
2818
+ react.useImperativeHandle(forwardedRef, () => ref.current), react.useEffect(() => {
3110
2819
  isTopLayerRef.current !== isTopLayer && isTopLayer && onActivate?.({
3111
2820
  activeElement: lastFocusedRef.current
3112
2821
  }), isTopLayerRef.current = isTopLayer;
3113
- }, t3 = [isTopLayer, onActivate], $[7] = isTopLayer, $[8] = onActivate, $[9] = t2, $[10] = t3) : (t2 = $[9], t3 = $[10]), react.useEffect(t2, t3);
3114
- let t4;
3115
- $[11] !== isTopLayer || $[12] !== onFocus ? (t4 = (event) => {
2822
+ }, [isTopLayer, onActivate]);
2823
+ const handleFocus = react.useCallback((event) => {
3116
2824
  onFocus?.(event);
3117
2825
  const rootElement = ref.current, target = document.activeElement;
3118
2826
  !isTopLayer || !rootElement || !target || isHTMLElement(target) && containsOrEqualsElement(rootElement, target) && (lastFocusedRef.current = target);
3119
- }, $[11] = isTopLayer, $[12] = onFocus, $[13] = t4) : t4 = $[13];
3120
- const handleFocus = t4;
3121
- let t5;
3122
- $[14] !== style || $[15] !== zIndex ? (t5 = {
2827
+ }, [isTopLayer, onFocus]);
2828
+ return /* @__PURE__ */ jsxRuntime.jsx(StyledLayer, { ...restProps, "data-ui": "Layer", onFocus: handleFocus, ref, style: {
3123
2829
  ...style,
3124
2830
  zIndex
3125
- }, $[14] = style, $[15] = zIndex, $[16] = t5) : t5 = $[16];
3126
- let t6;
3127
- return $[17] !== children || $[18] !== handleFocus || $[19] !== restProps || $[20] !== t5 ? (t6 = /* @__PURE__ */ jsxRuntime.jsx(StyledLayer, { ...restProps, "data-ui": "Layer", onFocus: handleFocus, ref, style: t5, children }), $[17] = children, $[18] = handleFocus, $[19] = restProps, $[20] = t5, $[21] = t6) : t6 = $[21], t6;
2831
+ }, children });
3128
2832
  }), Layer = react.forwardRef(function(props, ref) {
3129
- const $ = reactCompilerRuntime.c(11);
3130
- let children, restProps, t0;
3131
- $[0] !== props ? ({
2833
+ const {
3132
2834
  children,
3133
- zOffset: t0,
2835
+ zOffset = 1,
3134
2836
  ...restProps
3135
- } = props, $[0] = props, $[1] = children, $[2] = restProps, $[3] = t0) : (children = $[1], restProps = $[2], t0 = $[3]);
3136
- const zOffset = t0 === void 0 ? 1 : t0;
3137
- let t1;
3138
- $[4] !== children || $[5] !== ref || $[6] !== restProps ? (t1 = /* @__PURE__ */ jsxRuntime.jsx(LayerChildren, { ...restProps, ref, children }), $[4] = children, $[5] = ref, $[6] = restProps, $[7] = t1) : t1 = $[7];
3139
- let t2;
3140
- return $[8] !== t1 || $[9] !== zOffset ? (t2 = /* @__PURE__ */ jsxRuntime.jsx(LayerProvider, { zOffset, children: t1 }), $[8] = t1, $[9] = zOffset, $[10] = t2) : t2 = $[10], t2;
2837
+ } = props;
2838
+ return /* @__PURE__ */ jsxRuntime.jsx(LayerProvider, { zOffset, children: /* @__PURE__ */ jsxRuntime.jsx(LayerChildren, { ...restProps, ref, children }) });
3141
2839
  });
3142
2840
  Layer.displayName = "ForwardRef(Layer)";
3143
2841
  const key = "@sanity/ui/context/portal", elementKey = Symbol.for(`${key}/element`);
@@ -3158,39 +2856,26 @@ function usePortal() {
3158
2856
  return value;
3159
2857
  }
3160
2858
  function Portal(props) {
3161
- const $ = reactCompilerRuntime.c(3), {
2859
+ const {
3162
2860
  children,
3163
2861
  __unstable_name: name
3164
2862
  } = props, portal = usePortal(), portalElement = (name ? portal.elements && portal.elements[name] : portal.element) || portal.elements?.default;
3165
- if (!portalElement)
3166
- return null;
3167
- let t0;
3168
- return $[0] !== children || $[1] !== portalElement ? (t0 = reactDom.createPortal(children, portalElement), $[0] = children, $[1] = portalElement, $[2] = t0) : t0 = $[2], t0;
2863
+ return portalElement ? reactDom.createPortal(children, portalElement) : null;
3169
2864
  }
3170
2865
  Portal.displayName = "Portal";
3171
2866
  function PortalProvider(props) {
3172
- const $ = reactCompilerRuntime.c(7), {
2867
+ const {
3173
2868
  boundaryElement,
3174
2869
  children,
3175
2870
  element,
3176
2871
  __unstable_elements: elements
3177
- } = props, fallbackElement = react.useSyncExternalStore(emptySubscribe, _temp$3, _temp2$1), t0 = boundaryElement || null, t1 = element || fallbackElement;
3178
- let t2;
3179
- $[0] !== elements || $[1] !== t0 || $[2] !== t1 ? (t2 = {
2872
+ } = props, fallbackElement = react.useSyncExternalStore(emptySubscribe, () => document.body, () => null), value = react.useMemo(() => ({
3180
2873
  version: 0,
3181
- boundaryElement: t0,
3182
- element: t1,
2874
+ boundaryElement: boundaryElement || null,
2875
+ element: element || fallbackElement,
3183
2876
  elements
3184
- }, $[0] = elements, $[1] = t0, $[2] = t1, $[3] = t2) : t2 = $[3];
3185
- const value = t2;
3186
- let t3;
3187
- return $[4] !== children || $[5] !== value ? (t3 = /* @__PURE__ */ jsxRuntime.jsx(PortalContext.Provider, { value, children }), $[4] = children, $[5] = value, $[6] = t3) : t3 = $[6], t3;
3188
- }
3189
- function _temp2$1() {
3190
- return null;
3191
- }
3192
- function _temp$3() {
3193
- return document.body;
2877
+ }), [boundaryElement, element, elements, fallbackElement]);
2878
+ return /* @__PURE__ */ jsxRuntime.jsx(PortalContext.Provider, { value, children });
3194
2879
  }
3195
2880
  PortalProvider.displayName = "PortalProvider";
3196
2881
  const emptySubscribe = () => () => {
@@ -3198,12 +2883,11 @@ const emptySubscribe = () => () => {
3198
2883
  displayName: "StyledSrOnly",
3199
2884
  componentId: "sc-mubr0c-0"
3200
2885
  })`display:block;width:0;height:0;position:absolute;overflow:hidden;overflow:clip;`, SrOnly = react.forwardRef(function(props, ref) {
3201
- const $ = reactCompilerRuntime.c(4), {
2886
+ const {
3202
2887
  as,
3203
2888
  children
3204
2889
  } = props;
3205
- let t0;
3206
- return $[0] !== as || $[1] !== children || $[2] !== ref ? (t0 = /* @__PURE__ */ jsxRuntime.jsx(StyledSrOnly, { "aria-hidden": !0, as, "data-ui": "SrOnly", ref, children }), $[0] = as, $[1] = children, $[2] = ref, $[3] = t0) : t0 = $[3], t0;
2890
+ return /* @__PURE__ */ jsxRuntime.jsx(StyledSrOnly, { "aria-hidden": !0, as, "data-ui": "SrOnly", ref, children });
3207
2891
  });
3208
2892
  SrOnly.displayName = "ForwardRef(SrOnly)";
3209
2893
  const StyledVirtualList = styledComponents.styled.div.withConfig({
@@ -3213,69 +2897,52 @@ const StyledVirtualList = styledComponents.styled.div.withConfig({
3213
2897
  displayName: "ItemWrapper",
3214
2898
  componentId: "sc-dlqsj4-1"
3215
2899
  })`position:absolute;left:0;right:0;`, VirtualList = react.forwardRef(function(props, forwardedRef) {
3216
- const $ = reactCompilerRuntime.c(44);
3217
- let getItemKey, onChange, renderItem, restProps, t0, t1, t2;
3218
- $[0] !== props ? ({
3219
- as: t0,
3220
- gap: t1,
2900
+ const {
2901
+ as = "div",
2902
+ gap = 0,
3221
2903
  getItemKey,
3222
- items: t2,
2904
+ items = [],
3223
2905
  onChange,
3224
2906
  renderItem,
3225
2907
  ...restProps
3226
- } = props, $[0] = props, $[1] = getItemKey, $[2] = onChange, $[3] = renderItem, $[4] = restProps, $[5] = t0, $[6] = t1, $[7] = t2) : (getItemKey = $[1], onChange = $[2], renderItem = $[3], restProps = $[4], t0 = $[5], t1 = $[6], t2 = $[7]);
3227
- const as = t0 === void 0 ? "div" : t0, gap = t1 === void 0 ? 0 : t1;
3228
- let t3;
3229
- $[8] !== t2 ? (t3 = t2 === void 0 ? [] : t2, $[8] = t2, $[9] = t3) : t3 = $[9];
3230
- const items = t3, {
2908
+ } = props, {
3231
2909
  space
3232
2910
  } = useTheme_v2(), ref = react.useRef(null), wrapperRef = react.useRef(null), [scrollTop, setScrollTop] = react.useState(0), [scrollHeight, setScrollHeight] = react.useState(0), [itemHeight, setItemHeight] = react.useState(-1);
3233
- let t4;
3234
- $[10] === Symbol.for("react.memo_cache_sentinel") ? (t4 = () => ref.current, $[10] = t4) : t4 = $[10], react.useImperativeHandle(forwardedRef, t4);
3235
- let t5;
3236
- $[11] === Symbol.for("react.memo_cache_sentinel") ? (t5 = () => {
3237
- if (!wrapperRef.current)
3238
- return;
2911
+ react.useImperativeHandle(forwardedRef, () => ref.current), react.useEffect(() => {
2912
+ if (!wrapperRef.current) return;
3239
2913
  const firstElement = wrapperRef.current.firstChild;
3240
2914
  firstElement instanceof HTMLElement && setItemHeight(firstElement.offsetHeight);
3241
- }, $[11] = t5) : t5 = $[11];
3242
- let t6;
3243
- $[12] !== renderItem ? (t6 = [renderItem], $[12] = renderItem, $[13] = t6) : t6 = $[13], react.useEffect(t5, t6);
3244
- let t7, t8;
3245
- $[14] === Symbol.for("react.memo_cache_sentinel") ? (t7 = () => {
3246
- if (!ref.current)
3247
- return;
2915
+ }, [renderItem]), react.useEffect(() => {
2916
+ if (!ref.current) return;
3248
2917
  const scrollEl = findScrollable(ref.current.parentNode);
3249
2918
  if (scrollEl) {
3250
- if (!(scrollEl instanceof HTMLElement))
3251
- return;
3252
- const handleScroll = () => {
2919
+ if (!(scrollEl instanceof HTMLElement)) return;
2920
+ const handleScroll2 = () => {
3253
2921
  setScrollTop(scrollEl.scrollTop);
3254
2922
  };
3255
- scrollEl.addEventListener("scroll", handleScroll, {
2923
+ scrollEl.addEventListener("scroll", handleScroll2, {
3256
2924
  passive: !0
3257
2925
  });
3258
2926
  const ro = new _ResizeObserver((entries) => {
3259
2927
  setScrollHeight(entries[0].contentRect.height);
3260
2928
  });
3261
- return ro.observe(scrollEl), handleScroll(), () => {
3262
- scrollEl.removeEventListener("scroll", handleScroll), ro.unobserve(scrollEl), ro.disconnect();
2929
+ return ro.observe(scrollEl), handleScroll2(), () => {
2930
+ scrollEl.removeEventListener("scroll", handleScroll2), ro.unobserve(scrollEl), ro.disconnect();
3263
2931
  };
3264
2932
  }
3265
- const handleScroll_0 = () => {
2933
+ const handleScroll = () => {
3266
2934
  setScrollTop(window.scrollY);
3267
2935
  }, handleResize = () => {
3268
2936
  setScrollHeight(window.innerHeight);
3269
2937
  };
3270
- return window.addEventListener("scroll", handleScroll_0, {
2938
+ return window.addEventListener("scroll", handleScroll, {
3271
2939
  passive: !0
3272
- }), window.addEventListener("resize", handleResize), setScrollHeight(window.innerHeight), handleScroll_0(), () => {
3273
- window.removeEventListener("scroll", handleScroll_0), window.removeEventListener("resize", handleResize);
2940
+ }), window.addEventListener("resize", handleResize), setScrollHeight(window.innerHeight), handleScroll(), () => {
2941
+ window.removeEventListener("scroll", handleScroll), window.removeEventListener("resize", handleResize);
3274
2942
  };
3275
- }, t8 = [], $[14] = t7, $[15] = t8) : (t7 = $[14], t8 = $[15]), react.useEffect(t7, t8);
2943
+ }, []);
3276
2944
  const len = items.length, height = itemHeight ? len * (itemHeight + space[gap]) - space[gap] : 0, fromIndex = height ? Math.max(Math.floor(scrollTop / height * len) - 2, 0) : 0, toIndex = height ? Math.ceil((scrollTop + scrollHeight) / height * len) + 1 : 0;
3277
- let t10, t9;
3278
- $[16] !== fromIndex || $[17] !== gap || $[18] !== itemHeight || $[19] !== onChange || $[20] !== scrollHeight || $[21] !== scrollTop || $[22] !== space || $[23] !== toIndex ? (t9 = () => {
2945
+ react.useEffect(() => {
3279
2946
  onChange && onChange({
3280
2947
  fromIndex,
3281
2948
  gap: space[gap],
@@ -3284,9 +2951,8 @@ const StyledVirtualList = styledComponents.styled.div.withConfig({
3284
2951
  scrollTop,
3285
2952
  toIndex
3286
2953
  });
3287
- }, t10 = [fromIndex, gap, itemHeight, onChange, scrollHeight, scrollTop, space, toIndex], $[16] = fromIndex, $[17] = gap, $[18] = itemHeight, $[19] = onChange, $[20] = scrollHeight, $[21] = scrollTop, $[22] = space, $[23] = toIndex, $[24] = t10, $[25] = t9) : (t10 = $[24], t9 = $[25]), react.useEffect(t9, t10);
3288
- let t11;
3289
- $[26] !== fromIndex || $[27] !== gap || $[28] !== getItemKey || $[29] !== itemHeight || $[30] !== items || $[31] !== renderItem || $[32] !== space || $[33] !== toIndex ? (t11 = {
2954
+ }, [fromIndex, gap, itemHeight, onChange, scrollHeight, scrollTop, space, toIndex]);
2955
+ const children = useChildren({
3290
2956
  fromIndex,
3291
2957
  gap,
3292
2958
  itemHeight,
@@ -3295,49 +2961,28 @@ const StyledVirtualList = styledComponents.styled.div.withConfig({
3295
2961
  getItemKey,
3296
2962
  items,
3297
2963
  renderItem
3298
- }, $[26] = fromIndex, $[27] = gap, $[28] = getItemKey, $[29] = itemHeight, $[30] = items, $[31] = renderItem, $[32] = space, $[33] = toIndex, $[34] = t11) : t11 = $[34];
3299
- const children = useChildren(t11);
3300
- let t12;
3301
- $[35] !== height ? (t12 = {
2964
+ });
2965
+ return /* @__PURE__ */ jsxRuntime.jsx(StyledVirtualList, { as, "data-ui": "VirtualList", ...restProps, ref, children: /* @__PURE__ */ jsxRuntime.jsx("div", { ref: wrapperRef, style: {
3302
2966
  height
3303
- }, $[35] = height, $[36] = t12) : t12 = $[36];
3304
- let t13;
3305
- $[37] !== children || $[38] !== t12 ? (t13 = /* @__PURE__ */ jsxRuntime.jsx("div", { ref: wrapperRef, style: t12, children }), $[37] = children, $[38] = t12, $[39] = t13) : t13 = $[39];
3306
- let t14;
3307
- return $[40] !== as || $[41] !== restProps || $[42] !== t13 ? (t14 = /* @__PURE__ */ jsxRuntime.jsx(StyledVirtualList, { as, "data-ui": "VirtualList", ...restProps, ref, children: t13 }), $[40] = as, $[41] = restProps, $[42] = t13, $[43] = t14) : t14 = $[43], t14;
2967
+ }, children }) });
3308
2968
  });
3309
2969
  VirtualList.displayName = "ForwardRef(VirtualList)";
3310
- function useChildren(t0) {
3311
- const $ = reactCompilerRuntime.c(21), {
3312
- fromIndex,
3313
- gap,
3314
- getItemKey,
3315
- itemHeight,
3316
- items,
3317
- renderItem,
3318
- space,
3319
- toIndex
3320
- } = t0;
3321
- if (!renderItem || items.length === 0)
3322
- return null;
3323
- if (itemHeight === -1) {
3324
- let t12;
3325
- $[0] !== items[0] || $[1] !== renderItem ? (t12 = renderItem(items[0]), $[0] = items[0], $[1] = renderItem, $[2] = t12) : t12 = $[2];
3326
- let t2;
3327
- return $[3] !== t12 ? (t2 = [/* @__PURE__ */ jsxRuntime.jsx(ItemWrapper, { children: t12 }, 0)], $[3] = t12, $[4] = t2) : t2 = $[4], t2;
3328
- }
3329
- let t1;
3330
- if ($[5] !== fromIndex || $[6] !== gap || $[7] !== getItemKey || $[8] !== itemHeight || $[9] !== items || $[10] !== renderItem || $[11] !== space || $[12] !== toIndex) {
3331
- let t2;
3332
- $[14] !== fromIndex || $[15] !== gap || $[16] !== getItemKey || $[17] !== itemHeight || $[18] !== renderItem || $[19] !== space ? (t2 = (item, _itemIndex) => {
3333
- const itemIndex = fromIndex + _itemIndex, node = renderItem(item), key2 = getItemKey ? getItemKey(item, itemIndex) : itemIndex;
3334
- return /* @__PURE__ */ jsxRuntime.jsx(ItemWrapper, { style: {
3335
- top: itemIndex * (itemHeight + space[gap])
3336
- }, children: node }, key2);
3337
- }, $[14] = fromIndex, $[15] = gap, $[16] = getItemKey, $[17] = itemHeight, $[18] = renderItem, $[19] = space, $[20] = t2) : t2 = $[20], t1 = items.slice(fromIndex, toIndex).map(t2), $[5] = fromIndex, $[6] = gap, $[7] = getItemKey, $[8] = itemHeight, $[9] = items, $[10] = renderItem, $[11] = space, $[12] = toIndex, $[13] = t1;
3338
- } else
3339
- t1 = $[13];
3340
- return t1;
2970
+ function useChildren({
2971
+ fromIndex,
2972
+ gap,
2973
+ getItemKey,
2974
+ itemHeight,
2975
+ items,
2976
+ renderItem,
2977
+ space,
2978
+ toIndex
2979
+ }) {
2980
+ return !renderItem || items.length === 0 ? null : itemHeight === -1 ? [/* @__PURE__ */ jsxRuntime.jsx(ItemWrapper, { children: renderItem(items[0]) }, 0)] : items.slice(fromIndex, toIndex).map((item, _itemIndex) => {
2981
+ const itemIndex = fromIndex + _itemIndex, node = renderItem(item), key2 = getItemKey ? getItemKey(item, itemIndex) : itemIndex;
2982
+ return /* @__PURE__ */ jsxRuntime.jsx(ItemWrapper, { style: {
2983
+ top: itemIndex * (itemHeight + space[gap])
2984
+ }, children: node }, key2);
2985
+ });
3341
2986
  }
3342
2987
  function findScrollable(parentNode) {
3343
2988
  let _scrollEl = parentNode;
@@ -3429,9 +3074,7 @@ const MotionCard$1 = styledComponents.styled(framerMotion.motion.create(Card)).w
3429
3074
  displayName: "MotionFlex",
3430
3075
  componentId: "sc-ihg31s-1"
3431
3076
  })`will-change:opacity;`, PopoverCard = react.forwardRef(function(props, ref) {
3432
- const $ = reactCompilerRuntime.c(66);
3433
- let animate, arrow, arrowRef, arrowX, arrowY, children, marginsProp, originX, originY, overflow, padding, placement, radius, restProps, scheme, shadow, strategy, style, tone, width, xProp, yProp;
3434
- $[0] !== props ? ({
3077
+ const {
3435
3078
  __unstable_margins: marginsProp,
3436
3079
  animate,
3437
3080
  arrow,
@@ -3454,12 +3097,9 @@ const MotionCard$1 = styledComponents.styled(framerMotion.motion.create(Card)).w
3454
3097
  x: xProp,
3455
3098
  y: yProp,
3456
3099
  ...restProps
3457
- } = props, $[0] = props, $[1] = animate, $[2] = arrow, $[3] = arrowRef, $[4] = arrowX, $[5] = arrowY, $[6] = children, $[7] = marginsProp, $[8] = originX, $[9] = originY, $[10] = overflow, $[11] = padding, $[12] = placement, $[13] = radius, $[14] = restProps, $[15] = scheme, $[16] = shadow, $[17] = strategy, $[18] = style, $[19] = tone, $[20] = width, $[21] = xProp, $[22] = yProp) : (animate = $[1], arrow = $[2], arrowRef = $[3], arrowX = $[4], arrowY = $[5], children = $[6], marginsProp = $[7], originX = $[8], originY = $[9], overflow = $[10], padding = $[11], placement = $[12], radius = $[13], restProps = $[14], scheme = $[15], shadow = $[16], strategy = $[17], style = $[18], tone = $[19], width = $[20], xProp = $[21], yProp = $[22]);
3458
- const {
3100
+ } = props, {
3459
3101
  zIndex
3460
- } = useLayer(), margins = marginsProp || DEFAULT_POPOVER_MARGINS, x = (xProp ?? 0) + margins[3], y = (yProp ?? 0) + margins[0], t0 = animate ? "transform" : void 0;
3461
- let t1;
3462
- $[23] !== originX || $[24] !== originY || $[25] !== strategy || $[26] !== style || $[27] !== t0 || $[28] !== width || $[29] !== x || $[30] !== y || $[31] !== zIndex ? (t1 = {
3102
+ } = useLayer(), margins = react.useMemo(() => marginsProp || DEFAULT_POPOVER_MARGINS, [marginsProp]), x = (xProp ?? 0) + margins[3], y = (yProp ?? 0) + margins[0], rootStyle2 = react.useMemo(() => ({
3463
3103
  left: x,
3464
3104
  originX,
3465
3105
  originY,
@@ -3467,128 +3107,92 @@ const MotionCard$1 = styledComponents.styled(framerMotion.motion.create(Card)).w
3467
3107
  top: y,
3468
3108
  width,
3469
3109
  zIndex,
3470
- willChange: t0,
3110
+ willChange: animate ? "transform" : void 0,
3471
3111
  ...style
3472
- }, $[23] = originX, $[24] = originY, $[25] = strategy, $[26] = style, $[27] = t0, $[28] = width, $[29] = x, $[30] = y, $[31] = zIndex, $[32] = t1) : t1 = $[32];
3473
- const rootStyle2 = t1, t2 = arrowX !== null ? arrowX : void 0, t3 = arrowY !== null ? arrowY : void 0;
3474
- let t4;
3475
- $[33] !== t2 || $[34] !== t3 ? (t4 = {
3476
- left: t2,
3477
- top: t3,
3112
+ }), [animate, originX, originY, strategy, style, width, x, y, zIndex]), arrowStyle = react.useMemo(() => ({
3113
+ left: arrowX !== null ? arrowX : void 0,
3114
+ top: arrowY !== null ? arrowY : void 0,
3478
3115
  right: void 0,
3479
3116
  bottom: void 0
3480
- }, $[33] = t2, $[34] = t3, $[35] = t4) : t4 = $[35];
3481
- const arrowStyle = t4, t5 = restProps;
3482
- let t6;
3483
- $[36] !== animate ? (t6 = animate ? ["hidden", "initial"] : void 0, $[36] = animate, $[37] = t6) : t6 = $[37];
3484
- let t7;
3485
- $[38] !== animate ? (t7 = animate ? ["visible", "scaleIn"] : void 0, $[38] = animate, $[39] = t7) : t7 = $[39];
3486
- let t8;
3487
- $[40] !== animate ? (t8 = animate ? ["hidden", "scaleOut"] : void 0, $[40] = animate, $[41] = t8) : t8 = $[41];
3488
- let t9;
3489
- $[42] !== children || $[43] !== padding ? (t9 = /* @__PURE__ */ jsxRuntime.jsx(Flex, { direction: "column", flex: 1, padding, children }), $[42] = children, $[43] = padding, $[44] = t9) : t9 = $[44];
3490
- let t10;
3491
- $[45] !== overflow || $[46] !== t9 ? (t10 = /* @__PURE__ */ jsxRuntime.jsx(MotionFlex, { "data-ui": "Popover__wrapper", direction: "column", flex: 1, overflow, variants: POPOVER_MOTION_PROPS.children, transition: POPOVER_MOTION_PROPS.transition, children: t9 }), $[45] = overflow, $[46] = t9, $[47] = t10) : t10 = $[47];
3492
- let t11;
3493
- $[48] !== arrow || $[49] !== arrowRef || $[50] !== arrowStyle ? (t11 = arrow && /* @__PURE__ */ jsxRuntime.jsx(Arrow, { ref: arrowRef, style: arrowStyle, width: DEFAULT_POPOVER_ARROW_WIDTH, height: DEFAULT_POPOVER_ARROW_HEIGHT, radius: DEFAULT_POPOVER_ARROW_RADIUS }), $[48] = arrow, $[49] = arrowRef, $[50] = arrowStyle, $[51] = t11) : t11 = $[51];
3494
- let t12;
3495
- return $[52] !== placement || $[53] !== radius || $[54] !== ref || $[55] !== rootStyle2 || $[56] !== scheme || $[57] !== shadow || $[58] !== t10 || $[59] !== t11 || $[60] !== t5 || $[61] !== t6 || $[62] !== t7 || $[63] !== t8 || $[64] !== tone ? (t12 = /* @__PURE__ */ jsxRuntime.jsxs(MotionCard$1, { "data-ui": "Popover", ...t5, "data-placement": placement, radius, ref, scheme, shadow, sizing: "border", style: rootStyle2, tone, variants: POPOVER_MOTION_PROPS.card, transition: POPOVER_MOTION_PROPS.transition, initial: t6, animate: t7, exit: t8, children: [
3496
- t10,
3497
- t11
3498
- ] }), $[52] = placement, $[53] = radius, $[54] = ref, $[55] = rootStyle2, $[56] = scheme, $[57] = shadow, $[58] = t10, $[59] = t11, $[60] = t5, $[61] = t6, $[62] = t7, $[63] = t8, $[64] = tone, $[65] = t12) : t12 = $[65], t12;
3117
+ }), [arrowX, arrowY]);
3118
+ return /* @__PURE__ */ jsxRuntime.jsxs(MotionCard$1, { "data-ui": "Popover", ...restProps, "data-placement": placement, radius, ref, scheme, shadow, sizing: "border", style: rootStyle2, tone, variants: POPOVER_MOTION_PROPS.card, transition: POPOVER_MOTION_PROPS.transition, initial: animate ? ["hidden", "initial"] : void 0, animate: animate ? ["visible", "scaleIn"] : void 0, exit: animate ? ["hidden", "scaleOut"] : void 0, children: [
3119
+ /* @__PURE__ */ jsxRuntime.jsx(MotionFlex, { "data-ui": "Popover__wrapper", direction: "column", flex: 1, overflow, variants: POPOVER_MOTION_PROPS.children, transition: POPOVER_MOTION_PROPS.transition, children: /* @__PURE__ */ jsxRuntime.jsx(Flex, { direction: "column", flex: 1, padding, children }) }),
3120
+ arrow && /* @__PURE__ */ jsxRuntime.jsx(Arrow, { ref: arrowRef, style: arrowStyle, width: DEFAULT_POPOVER_ARROW_WIDTH, height: DEFAULT_POPOVER_ARROW_HEIGHT, radius: DEFAULT_POPOVER_ARROW_RADIUS })
3121
+ ] });
3499
3122
  });
3500
3123
  PopoverCard.displayName = "ForwardRef(PopoverCard)";
3501
3124
  const ViewportOverlay = () => {
3502
- const $ = reactCompilerRuntime.c(2), {
3125
+ const {
3503
3126
  zIndex
3504
3127
  } = useLayer();
3505
- let t0;
3506
- return $[0] !== zIndex ? (t0 = /* @__PURE__ */ jsxRuntime.jsx("div", { style: {
3128
+ return /* @__PURE__ */ jsxRuntime.jsx("div", { style: {
3507
3129
  height: "100vh",
3508
3130
  inset: 0,
3509
3131
  position: "fixed",
3510
3132
  width: "100vw",
3511
3133
  zIndex
3512
- } }), $[0] = zIndex, $[1] = t0) : t0 = $[1], t0;
3134
+ } });
3513
3135
  }, Popover = react.forwardRef(function(props, forwardedRef) {
3514
- const $ = reactCompilerRuntime.c(122), {
3136
+ const {
3515
3137
  container,
3516
3138
  layer
3517
- } = useTheme_v2(), boundaryElementContext = useBoundaryElement();
3518
- let _boundaryElement, _fallbackPlacements, _floatingBoundary, _referenceBoundary, _zOffsetProp, childProp, content, disabled, matchReferenceWidth, modal, open, paddingProp, portal, referenceElement, restProps, scheme, t0, t1, t10, t11, t2, t3, t4, t5, t6, t7, t8, t9, updateRef;
3519
- if ($[0] !== props) {
3520
- const {
3521
- __unstable_margins: t122,
3522
- animate: t132,
3523
- arrow: t142,
3524
- boundaryElement: t152,
3525
- children: t162,
3526
- constrainSize: t172,
3527
- content: t182,
3528
- disabled: t192,
3529
- fallbackPlacements: t202,
3530
- matchReferenceWidth: t212,
3531
- floatingBoundary: t222,
3532
- modal: t232,
3533
- onActivate,
3534
- open: t242,
3535
- overflow: t252,
3536
- padding: t262,
3537
- placement: t272,
3538
- placementStrategy: t282,
3539
- portal: t292,
3540
- preventOverflow: t302,
3541
- radius: t312,
3542
- referenceBoundary: t322,
3543
- referenceElement: t332,
3544
- scheme: t342,
3545
- shadow: t352,
3546
- tone: t362,
3547
- width: t372,
3548
- zOffset: t38,
3549
- updateRef: t39,
3550
- ...t40
3551
- } = props;
3552
- t0 = t122, t1 = t132, t2 = t142, _boundaryElement = t152, childProp = t162, t3 = t172, content = t182, disabled = t192, _fallbackPlacements = t202, matchReferenceWidth = t212, _floatingBoundary = t222, modal = t232, open = t242, t4 = t252, paddingProp = t262, t5 = t272, t6 = t282, portal = t292, t7 = t302, t8 = t312, _referenceBoundary = t322, referenceElement = t332, scheme = t342, t9 = t352, t10 = t362, t11 = t372, _zOffsetProp = t38, updateRef = t39, restProps = t40, $[0] = props, $[1] = _boundaryElement, $[2] = _fallbackPlacements, $[3] = _floatingBoundary, $[4] = _referenceBoundary, $[5] = _zOffsetProp, $[6] = childProp, $[7] = content, $[8] = disabled, $[9] = matchReferenceWidth, $[10] = modal, $[11] = open, $[12] = paddingProp, $[13] = portal, $[14] = referenceElement, $[15] = restProps, $[16] = scheme, $[17] = t0, $[18] = t1, $[19] = t10, $[20] = t11, $[21] = t2, $[22] = t3, $[23] = t4, $[24] = t5, $[25] = t6, $[26] = t7, $[27] = t8, $[28] = t9, $[29] = updateRef;
3553
- } else
3554
- _boundaryElement = $[1], _fallbackPlacements = $[2], _floatingBoundary = $[3], _referenceBoundary = $[4], _zOffsetProp = $[5], childProp = $[6], content = $[7], disabled = $[8], matchReferenceWidth = $[9], modal = $[10], open = $[11], paddingProp = $[12], portal = $[13], referenceElement = $[14], restProps = $[15], scheme = $[16], t0 = $[17], t1 = $[18], t10 = $[19], t11 = $[20], t2 = $[21], t3 = $[22], t4 = $[23], t5 = $[24], t6 = $[25], t7 = $[26], t8 = $[27], t9 = $[28], updateRef = $[29];
3555
- const margins = t0 === void 0 ? DEFAULT_POPOVER_MARGINS : t0, _animate = t1 === void 0 ? !1 : t1, arrowProp = t2 === void 0 ? !1 : t2, constrainSize = t3 === void 0 ? !1 : t3, overflow = t4 === void 0 ? "hidden" : t4, placementProp = t5 === void 0 ? "bottom" : t5, placementStrategy = t6 === void 0 ? "flip" : t6, preventOverflow = t7 === void 0 ? !0 : t7, radiusProp = t8 === void 0 ? 3 : t8, shadowProp = t9 === void 0 ? 3 : t9, tone = t10 === void 0 ? "inherit" : t10, widthProp = t11 === void 0 ? "auto" : t11, boundaryElement = _boundaryElement ?? boundaryElementContext?.element, fallbackPlacements = _fallbackPlacements ?? DEFAULT_FALLBACK_PLACEMENTS$1[props.placement ?? "bottom"], floatingBoundary = _floatingBoundary ?? props.boundaryElement ?? boundaryElementContext.element, referenceBoundary = _referenceBoundary ?? props.boundaryElement ?? boundaryElementContext.element, zOffsetProp = _zOffsetProp ?? layer.popover.zOffset, animate = usePrefersReducedMotion() ? !1 : _animate, boundarySize = useElementSize(boundaryElement)?.border, padding = useArrayProp(paddingProp), radius = useArrayProp(radiusProp), shadow = useArrayProp(shadowProp), widthArrayProp = useArrayProp(widthProp), zOffset = useArrayProp(zOffsetProp), ref = react.useRef(null), arrowRef = react.useRef(null);
3556
- let t12;
3557
- $[30] === Symbol.for("react.memo_cache_sentinel") ? (t12 = () => ref.current, $[30] = t12) : t12 = $[30], react.useImperativeHandle(forwardedRef, t12);
3558
- const mediaIndex = useMediaIndex(), boundaryWidth = constrainSize || preventOverflow ? boundarySize?.width : void 0;
3559
- let t13;
3560
- $[31] !== container || $[32] !== mediaIndex || $[33] !== widthArrayProp ? (t13 = calcCurrentWidth({
3139
+ } = useTheme_v2(), boundaryElementContext = useBoundaryElement(), {
3140
+ __unstable_margins: margins = DEFAULT_POPOVER_MARGINS,
3141
+ animate: _animate = !1,
3142
+ arrow: arrowProp = !1,
3143
+ boundaryElement: _boundaryElement,
3144
+ children: childProp,
3145
+ constrainSize = !1,
3146
+ content,
3147
+ disabled,
3148
+ fallbackPlacements: _fallbackPlacements,
3149
+ matchReferenceWidth,
3150
+ floatingBoundary: _floatingBoundary,
3151
+ modal,
3152
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
3153
+ onActivate,
3154
+ open,
3155
+ overflow = "hidden",
3156
+ padding: paddingProp,
3157
+ placement: placementProp = "bottom",
3158
+ placementStrategy = "flip",
3159
+ portal,
3160
+ preventOverflow = !0,
3161
+ radius: radiusProp = 3,
3162
+ referenceBoundary: _referenceBoundary,
3163
+ referenceElement,
3164
+ scheme,
3165
+ shadow: shadowProp = 3,
3166
+ tone = "inherit",
3167
+ width: widthProp = "auto",
3168
+ zOffset: _zOffsetProp,
3169
+ updateRef,
3170
+ ...restProps
3171
+ } = props, boundaryElement = _boundaryElement ?? boundaryElementContext?.element, fallbackPlacements = _fallbackPlacements ?? DEFAULT_FALLBACK_PLACEMENTS$1[props.placement ?? "bottom"], floatingBoundary = _floatingBoundary ?? props.boundaryElement ?? boundaryElementContext.element, referenceBoundary = _referenceBoundary ?? props.boundaryElement ?? boundaryElementContext.element, zOffsetProp = _zOffsetProp ?? layer.popover.zOffset, animate = usePrefersReducedMotion() ? !1 : _animate, boundarySize = useElementSize(boundaryElement)?.border, padding = _getArrayProp(paddingProp), radius = _getArrayProp(radiusProp), shadow = _getArrayProp(shadowProp), widthArrayProp = _getArrayProp(widthProp), zOffset = _getArrayProp(zOffsetProp), ref = react.useRef(null), arrowRef = react.useRef(null), rootBoundary = "viewport";
3172
+ react.useImperativeHandle(forwardedRef, () => ref.current);
3173
+ const mediaIndex = useMediaIndex(), boundaryWidth = constrainSize || preventOverflow ? boundarySize?.width : void 0, width = calcCurrentWidth({
3561
3174
  container,
3562
3175
  mediaIndex,
3563
3176
  width: widthArrayProp
3564
- }), $[31] = container, $[32] = mediaIndex, $[33] = widthArrayProp, $[34] = t13) : t13 = $[34];
3565
- const width = t13, widthRef = react.useRef(width);
3566
- let t14, t15;
3567
- $[35] !== width ? (t14 = () => {
3177
+ }), widthRef = react.useRef(width);
3178
+ react.useEffect(() => {
3568
3179
  widthRef.current = width;
3569
- }, t15 = [width], $[35] = width, $[36] = t14, $[37] = t15) : (t14 = $[36], t15 = $[37]), react.useEffect(t14, t15);
3570
- let t16;
3571
- $[38] !== boundaryWidth || $[39] !== width ? (t16 = calcMaxWidth({
3180
+ }, [width]);
3181
+ const maxWidth = calcMaxWidth({
3572
3182
  boundaryWidth,
3573
3183
  currentWidth: width
3574
- }), $[38] = boundaryWidth, $[39] = width, $[40] = t16) : t16 = $[40];
3575
- const maxWidth = t16, maxWidthRef = react.useRef(maxWidth);
3576
- let t17, t18;
3577
- $[41] !== maxWidth ? (t17 = () => {
3184
+ }), maxWidthRef = react.useRef(maxWidth);
3185
+ react.useEffect(() => {
3578
3186
  maxWidthRef.current = maxWidth;
3579
- }, t18 = [maxWidth], $[41] = maxWidth, $[42] = t17, $[43] = t18) : (t17 = $[42], t18 = $[43]), react.useEffect(t17, t18);
3187
+ }, [maxWidth]);
3580
3188
  const referenceWidthRef = react.useRef(void 0);
3581
- let t19, t20;
3582
- $[44] !== matchReferenceWidth || $[45] !== maxWidth || $[46] !== open || $[47] !== width ? (t19 = () => {
3189
+ react.useEffect(() => {
3583
3190
  const floatingElement = ref.current;
3584
- if (!open || !floatingElement)
3585
- return;
3586
- const referenceWidth = referenceWidthRef.current;
3587
- matchReferenceWidth ? referenceWidth !== void 0 && (floatingElement.style.width = `${referenceWidth}px`) : width !== void 0 && (floatingElement.style.width = `${width}px`), typeof maxWidth == "number" && (floatingElement.style.maxWidth = `${maxWidth}px`);
3588
- }, t20 = [width, matchReferenceWidth, maxWidth, open], $[44] = matchReferenceWidth, $[45] = maxWidth, $[46] = open, $[47] = width, $[48] = t19, $[49] = t20) : (t19 = $[48], t20 = $[49]), react.useEffect(t19, t20);
3589
- const [referenceWidth_0, setReferenceWidth] = react.useState(void 0);
3590
- let t21;
3591
- $[50] !== animate || $[51] !== arrowProp || $[52] !== constrainSize || $[53] !== fallbackPlacements || $[54] !== floatingBoundary || $[55] !== margins || $[56] !== matchReferenceWidth || $[57] !== placementProp || $[58] !== placementStrategy || $[59] !== preventOverflow || $[60] !== referenceBoundary ? (t21 = {
3191
+ if (!open || !floatingElement) return;
3192
+ const referenceWidth2 = referenceWidthRef.current;
3193
+ matchReferenceWidth ? referenceWidth2 !== void 0 && (floatingElement.style.width = `${referenceWidth2}px`) : width !== void 0 && (floatingElement.style.width = `${width}px`), typeof maxWidth == "number" && (floatingElement.style.maxWidth = `${maxWidth}px`);
3194
+ }, [width, matchReferenceWidth, maxWidth, open]);
3195
+ const [referenceWidth, setReferenceWidth] = react.useState(void 0), middleware = useMiddleware$1({
3592
3196
  animate,
3593
3197
  arrowProp,
3594
3198
  arrowRef,
@@ -3603,23 +3207,10 @@ const ViewportOverlay = () => {
3603
3207
  preventOverflow,
3604
3208
  referenceBoundary,
3605
3209
  referenceWidthRef,
3606
- rootBoundary: "viewport",
3210
+ rootBoundary,
3607
3211
  setReferenceWidth,
3608
3212
  widthRef
3609
- }, $[50] = animate, $[51] = arrowProp, $[52] = constrainSize, $[53] = fallbackPlacements, $[54] = floatingBoundary, $[55] = margins, $[56] = matchReferenceWidth, $[57] = placementProp, $[58] = placementStrategy, $[59] = preventOverflow, $[60] = referenceBoundary, $[61] = t21) : t21 = $[61];
3610
- const middleware = useMiddleware$1(t21);
3611
- let t22;
3612
- $[62] !== referenceElement ? (t22 = referenceElement ? {
3613
- reference: referenceElement
3614
- } : void 0, $[62] = referenceElement, $[63] = t22) : t22 = $[63];
3615
- let t23;
3616
- $[64] !== middleware || $[65] !== placementProp || $[66] !== t22 ? (t23 = {
3617
- middleware,
3618
- placement: placementProp,
3619
- whileElementsMounted: reactDom$1.autoUpdate,
3620
- elements: t22
3621
- }, $[64] = middleware, $[65] = placementProp, $[66] = t22, $[67] = t23) : t23 = $[67];
3622
- const {
3213
+ }), {
3623
3214
  x,
3624
3215
  y,
3625
3216
  middlewareData,
@@ -3627,148 +3218,87 @@ const ViewportOverlay = () => {
3627
3218
  refs,
3628
3219
  strategy,
3629
3220
  update
3630
- } = reactDom$1.useFloating(t23), referenceHidden = middlewareData.hide?.referenceHidden, arrowX = middlewareData.arrow?.x, arrowY = middlewareData.arrow?.y, originX = middlewareData["@sanity/ui/origin"]?.originX, originY = middlewareData["@sanity/ui/origin"]?.originY;
3631
- let t24;
3632
- $[68] === Symbol.for("react.memo_cache_sentinel") ? (t24 = (arrowEl) => {
3221
+ } = reactDom$1.useFloating({
3222
+ middleware,
3223
+ placement: placementProp,
3224
+ whileElementsMounted: reactDom$1.autoUpdate,
3225
+ elements: referenceElement ? {
3226
+ reference: referenceElement
3227
+ } : void 0
3228
+ }), referenceHidden = middlewareData.hide?.referenceHidden, arrowX = middlewareData.arrow?.x, arrowY = middlewareData.arrow?.y, originX = middlewareData["@sanity/ui/origin"]?.originX, originY = middlewareData["@sanity/ui/origin"]?.originY, setArrow = react.useCallback((arrowEl) => {
3633
3229
  arrowRef.current = arrowEl;
3634
- }, $[68] = t24) : t24 = $[68];
3635
- const setArrow = t24;
3636
- let t25;
3637
- $[69] !== refs ? (t25 = (node) => {
3230
+ }, []), setFloating = react.useCallback((node) => {
3638
3231
  ref.current = node, refs.setFloating(node);
3639
- }, $[69] = refs, $[70] = t25) : t25 = $[70];
3640
- const setFloating = t25;
3641
- let t26;
3642
- $[71] !== childProp ? (t26 = childProp ? getElementRef(childProp) : null, $[71] = childProp, $[72] = t26) : t26 = $[72];
3643
- let t27;
3644
- $[73] !== refs.reference.current ? (t27 = () => refs.reference.current, $[73] = refs.reference.current, $[74] = t27) : t27 = $[74], react.useImperativeHandle(t26, t27);
3645
- let t28;
3646
- bb0: {
3647
- if (referenceElement) {
3648
- t28 = childProp;
3649
- break bb0;
3650
- }
3651
- if (!childProp) {
3652
- t28 = null;
3653
- break bb0;
3654
- }
3655
- let t292;
3656
- $[75] !== childProp || $[76] !== refs.setReference ? (t292 = react.cloneElement(childProp, {
3657
- ref: refs.setReference
3658
- }), $[75] = childProp, $[76] = refs.setReference, $[77] = t292) : t292 = $[77], t28 = t292;
3659
- }
3660
- const child = t28;
3661
- let t29, t30;
3662
- if ($[78] !== update ? (t29 = () => update, t30 = [update], $[78] = update, $[79] = t29, $[80] = t30) : (t29 = $[79], t30 = $[80]), react.useImperativeHandle(updateRef, t29, t30), disabled) {
3663
- let t312;
3664
- return $[81] !== childProp ? (t312 = childProp || /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, {}), $[81] = childProp, $[82] = t312) : t312 = $[82], t312;
3665
- }
3666
- let t31;
3667
- $[83] !== modal ? (t31 = modal && /* @__PURE__ */ jsxRuntime.jsx(ViewportOverlay, {}), $[83] = modal, $[84] = t31) : t31 = $[84];
3668
- const t32 = matchReferenceWidth ? referenceWidth_0 : width;
3669
- let t33;
3670
- $[85] !== animate || $[86] !== arrowProp || $[87] !== arrowX || $[88] !== arrowY || $[89] !== content || $[90] !== margins || $[91] !== originX || $[92] !== originY || $[93] !== overflow || $[94] !== padding || $[95] !== placement || $[96] !== radius || $[97] !== referenceHidden || $[98] !== restProps || $[99] !== scheme || $[100] !== setFloating || $[101] !== shadow || $[102] !== strategy || $[103] !== t32 || $[104] !== tone || $[105] !== x || $[106] !== y ? (t33 = /* @__PURE__ */ jsxRuntime.jsx(PopoverCard, { ...restProps, __unstable_margins: margins, animate, arrow: arrowProp, arrowRef: setArrow, arrowX, arrowY, hidden: referenceHidden, overflow, padding, placement, radius, ref: setFloating, scheme, shadow, originX, originY, strategy, tone, width: t32, x, y, children: content }), $[85] = animate, $[86] = arrowProp, $[87] = arrowX, $[88] = arrowY, $[89] = content, $[90] = margins, $[91] = originX, $[92] = originY, $[93] = overflow, $[94] = padding, $[95] = placement, $[96] = radius, $[97] = referenceHidden, $[98] = restProps, $[99] = scheme, $[100] = setFloating, $[101] = shadow, $[102] = strategy, $[103] = t32, $[104] = tone, $[105] = x, $[106] = y, $[107] = t33) : t33 = $[107];
3671
- let t34;
3672
- $[108] !== t31 || $[109] !== t33 || $[110] !== zOffset ? (t34 = /* @__PURE__ */ jsxRuntime.jsxs(LayerProvider, { zOffset, children: [
3673
- t31,
3674
- t33
3675
- ] }), $[108] = t31, $[109] = t33, $[110] = zOffset, $[111] = t34) : t34 = $[111];
3676
- const popover = t34;
3677
- let t35;
3678
- $[112] !== open || $[113] !== popover || $[114] !== portal ? (t35 = open && (portal ? /* @__PURE__ */ jsxRuntime.jsx(Portal, { __unstable_name: typeof portal == "string" ? portal : void 0, children: popover }) : popover), $[112] = open, $[113] = popover, $[114] = portal, $[115] = t35) : t35 = $[115];
3679
- const children = t35;
3680
- let t36;
3681
- $[116] !== animate || $[117] !== children ? (t36 = animate ? /* @__PURE__ */ jsxRuntime.jsx(framerMotion.AnimatePresence, { children }) : children, $[116] = animate, $[117] = children, $[118] = t36) : t36 = $[118];
3682
- let t37;
3683
- return $[119] !== child || $[120] !== t36 ? (t37 = /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
3684
- t36,
3232
+ }, [refs]);
3233
+ react.useImperativeHandle(childProp ? getElementRef(childProp) : null, () => refs.reference.current);
3234
+ const child = react.useMemo(() => referenceElement ? childProp : childProp ? react.cloneElement(childProp, {
3235
+ ref: refs.setReference
3236
+ }) : null, [childProp, referenceElement, refs.setReference]);
3237
+ if (react.useImperativeHandle(updateRef, () => update, [update]), disabled)
3238
+ return childProp || /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, {});
3239
+ const popover = /* @__PURE__ */ jsxRuntime.jsxs(LayerProvider, { zOffset, children: [
3240
+ modal && /* @__PURE__ */ jsxRuntime.jsx(ViewportOverlay, {}),
3241
+ /* @__PURE__ */ jsxRuntime.jsx(PopoverCard, { ...restProps, __unstable_margins: margins, animate, arrow: arrowProp, arrowRef: setArrow, arrowX, arrowY, hidden: referenceHidden, overflow, padding, placement, radius, ref: setFloating, scheme, shadow, originX, originY, strategy, tone, width: matchReferenceWidth ? referenceWidth : width, x, y, children: content })
3242
+ ] }), children = open && (portal ? /* @__PURE__ */ jsxRuntime.jsx(Portal, { __unstable_name: typeof portal == "string" ? portal : void 0, children: popover }) : popover);
3243
+ return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
3244
+ animate ? /* @__PURE__ */ jsxRuntime.jsx(framerMotion.AnimatePresence, { children }) : children,
3685
3245
  child
3686
- ] }), $[119] = child, $[120] = t36, $[121] = t37) : t37 = $[121], t37;
3246
+ ] });
3687
3247
  });
3688
3248
  Popover.displayName = "ForwardRef(Popover)";
3689
- function useMiddleware$1(t0) {
3690
- const $ = reactCompilerRuntime.c(42), {
3691
- animate,
3692
- arrowProp,
3693
- arrowRef,
3694
- constrainSize,
3695
- fallbackPlacements,
3696
- floatingBoundary,
3697
- margins,
3698
- matchReferenceWidth,
3699
- maxWidthRef,
3700
- placementProp,
3701
- placementStrategy,
3702
- preventOverflow,
3703
- referenceBoundary,
3704
- referenceWidthRef,
3705
- rootBoundary,
3706
- setReferenceWidth,
3707
- widthRef
3708
- } = t0;
3709
- let ret;
3710
- if ($[0] !== animate || $[1] !== arrowProp || $[2] !== arrowRef || $[3] !== constrainSize || $[4] !== fallbackPlacements || $[5] !== floatingBoundary || $[6] !== margins || $[7] !== matchReferenceWidth || $[8] !== maxWidthRef || $[9] !== placementProp || $[10] !== placementStrategy || $[11] !== preventOverflow || $[12] !== referenceBoundary || $[13] !== referenceWidthRef || $[14] !== rootBoundary || $[15] !== setReferenceWidth || $[16] !== widthRef) {
3711
- if (ret = [], constrainSize || preventOverflow)
3712
- if (placementStrategy === "autoPlacement") {
3713
- let t12;
3714
- $[18] !== fallbackPlacements || $[19] !== placementProp ? (t12 = reactDom$1.autoPlacement({
3715
- allowedPlacements: [placementProp].concat(fallbackPlacements)
3716
- }), $[18] = fallbackPlacements, $[19] = placementProp, $[20] = t12) : t12 = $[20], ret.push(t12);
3717
- } else {
3718
- const t12 = floatingBoundary || void 0;
3719
- let t22;
3720
- $[21] !== fallbackPlacements || $[22] !== rootBoundary || $[23] !== t12 ? (t22 = reactDom$1.flip({
3721
- boundary: t12,
3722
- fallbackPlacements,
3723
- padding: DEFAULT_POPOVER_PADDING,
3724
- rootBoundary
3725
- }), $[21] = fallbackPlacements, $[22] = rootBoundary, $[23] = t12, $[24] = t22) : t22 = $[24], ret.push(t22);
3726
- }
3727
- let t1;
3728
- if ($[25] === Symbol.for("react.memo_cache_sentinel") ? (t1 = reactDom$1.offset({
3249
+ function useMiddleware$1({
3250
+ animate,
3251
+ arrowProp,
3252
+ arrowRef,
3253
+ constrainSize,
3254
+ fallbackPlacements,
3255
+ floatingBoundary,
3256
+ margins,
3257
+ matchReferenceWidth,
3258
+ maxWidthRef,
3259
+ placementProp,
3260
+ placementStrategy,
3261
+ preventOverflow,
3262
+ referenceBoundary,
3263
+ referenceWidthRef,
3264
+ rootBoundary,
3265
+ setReferenceWidth,
3266
+ widthRef
3267
+ }) {
3268
+ return react.useMemo(() => {
3269
+ const ret = [];
3270
+ return (constrainSize || preventOverflow) && (placementStrategy === "autoPlacement" ? ret.push(reactDom$1.autoPlacement({
3271
+ allowedPlacements: [placementProp].concat(fallbackPlacements)
3272
+ })) : ret.push(reactDom$1.flip({
3273
+ boundary: floatingBoundary || void 0,
3274
+ fallbackPlacements,
3275
+ padding: DEFAULT_POPOVER_PADDING,
3276
+ rootBoundary
3277
+ }))), ret.push(reactDom$1.offset({
3729
3278
  mainAxis: DEFAULT_POPOVER_DISTANCE
3730
- }), $[25] = t1) : t1 = $[25], ret.push(t1), constrainSize || matchReferenceWidth) {
3731
- const t22 = floatingBoundary || void 0;
3732
- let t32;
3733
- $[26] !== constrainSize || $[27] !== margins || $[28] !== matchReferenceWidth || $[29] !== maxWidthRef || $[30] !== referenceWidthRef || $[31] !== setReferenceWidth || $[32] !== t22 || $[33] !== widthRef ? (t32 = size({
3734
- boundaryElement: t22,
3735
- constrainSize,
3736
- margins,
3737
- matchReferenceWidth,
3738
- maxWidthRef,
3739
- padding: DEFAULT_POPOVER_PADDING,
3740
- referenceWidthRef,
3741
- setReferenceWidth,
3742
- widthRef
3743
- }), $[26] = constrainSize, $[27] = margins, $[28] = matchReferenceWidth, $[29] = maxWidthRef, $[30] = referenceWidthRef, $[31] = setReferenceWidth, $[32] = t22, $[33] = widthRef, $[34] = t32) : t32 = $[34], ret.push(t32);
3744
- }
3745
- if (preventOverflow) {
3746
- const t22 = floatingBoundary || void 0;
3747
- let t32;
3748
- $[35] !== rootBoundary || $[36] !== t22 ? (t32 = reactDom$1.shift({
3749
- boundary: t22,
3750
- rootBoundary,
3751
- padding: DEFAULT_POPOVER_PADDING
3752
- }), $[35] = rootBoundary, $[36] = t22, $[37] = t32) : t32 = $[37], ret.push(t32);
3753
- }
3754
- if (arrowProp) {
3755
- let t22;
3756
- $[38] !== arrowRef ? (t22 = reactDom$1.arrow({
3757
- element: arrowRef,
3758
- padding: DEFAULT_POPOVER_PADDING
3759
- }), $[38] = arrowRef, $[39] = t22) : t22 = $[39], ret.push(t22);
3760
- }
3761
- animate && ret.push(origin);
3762
- const t2 = referenceBoundary || void 0;
3763
- let t3;
3764
- $[40] !== t2 ? (t3 = reactDom$1.hide({
3765
- boundary: t2,
3279
+ })), (constrainSize || matchReferenceWidth) && ret.push(size({
3280
+ boundaryElement: floatingBoundary || void 0,
3281
+ constrainSize,
3282
+ margins,
3283
+ matchReferenceWidth,
3284
+ maxWidthRef,
3285
+ padding: DEFAULT_POPOVER_PADDING,
3286
+ referenceWidthRef,
3287
+ setReferenceWidth,
3288
+ widthRef
3289
+ })), preventOverflow && ret.push(reactDom$1.shift({
3290
+ boundary: floatingBoundary || void 0,
3291
+ rootBoundary,
3292
+ padding: DEFAULT_POPOVER_PADDING
3293
+ })), arrowProp && ret.push(reactDom$1.arrow({
3294
+ element: arrowRef,
3295
+ padding: DEFAULT_POPOVER_PADDING
3296
+ })), animate && ret.push(origin), ret.push(reactDom$1.hide({
3297
+ boundary: referenceBoundary || void 0,
3766
3298
  padding: DEFAULT_POPOVER_PADDING,
3767
3299
  strategy: "referenceHidden"
3768
- }), $[40] = t2, $[41] = t3) : t3 = $[41], ret.push(t3), $[0] = animate, $[1] = arrowProp, $[2] = arrowRef, $[3] = constrainSize, $[4] = fallbackPlacements, $[5] = floatingBoundary, $[6] = margins, $[7] = matchReferenceWidth, $[8] = maxWidthRef, $[9] = placementProp, $[10] = placementStrategy, $[11] = preventOverflow, $[12] = referenceBoundary, $[13] = referenceWidthRef, $[14] = rootBoundary, $[15] = setReferenceWidth, $[16] = widthRef, $[17] = ret;
3769
- } else
3770
- ret = $[17];
3771
- return ret;
3300
+ })), ret;
3301
+ }, [animate, arrowProp, arrowRef, constrainSize, fallbackPlacements, floatingBoundary, margins, matchReferenceWidth, maxWidthRef, placementProp, placementStrategy, preventOverflow, referenceBoundary, referenceWidthRef, rootBoundary, setReferenceWidth, widthRef]);
3772
3302
  }
3773
3303
  function radioBaseStyle() {
3774
3304
  return styledComponents.css`
@@ -3891,29 +3421,18 @@ const StyledRadio = /* @__PURE__ */ styledComponents.styled.div.withConfig({
3891
3421
  displayName: "Input",
3892
3422
  componentId: "sc-ccrwkf-1"
3893
3423
  })(inputElementStyle), Radio = react.forwardRef(function(props, forwardedRef) {
3894
- const $ = reactCompilerRuntime.c(19);
3895
- let className, customValidity, disabled, readOnly, restProps, style;
3896
- $[0] !== props ? ({
3424
+ const {
3897
3425
  className,
3898
3426
  disabled,
3899
3427
  style,
3900
3428
  customValidity,
3901
3429
  readOnly,
3902
3430
  ...restProps
3903
- } = props, $[0] = props, $[1] = className, $[2] = customValidity, $[3] = disabled, $[4] = readOnly, $[5] = restProps, $[6] = style) : (className = $[1], customValidity = $[2], disabled = $[3], readOnly = $[4], restProps = $[5], style = $[6]);
3904
- const ref = react.useRef(null);
3905
- let t0;
3906
- $[7] === Symbol.for("react.memo_cache_sentinel") ? (t0 = () => ref.current, $[7] = t0) : t0 = $[7], react.useImperativeHandle(forwardedRef, t0), useCustomValidity(ref, customValidity);
3907
- const t1 = !disabled && readOnly ? "" : void 0, t2 = customValidity ? "" : void 0, t3 = disabled || readOnly;
3908
- let t4;
3909
- $[8] !== readOnly || $[9] !== restProps || $[10] !== t1 || $[11] !== t2 || $[12] !== t3 ? (t4 = /* @__PURE__ */ jsxRuntime.jsx(Input$4, { "data-read-only": t1, "data-error": t2, ...restProps, disabled: t3, readOnly, ref, type: "radio" }), $[8] = readOnly, $[9] = restProps, $[10] = t1, $[11] = t2, $[12] = t3, $[13] = t4) : t4 = $[13];
3910
- let t5;
3911
- $[14] === Symbol.for("react.memo_cache_sentinel") ? (t5 = /* @__PURE__ */ jsxRuntime.jsx("span", {}), $[14] = t5) : t5 = $[14];
3912
- let t6;
3913
- return $[15] !== className || $[16] !== style || $[17] !== t4 ? (t6 = /* @__PURE__ */ jsxRuntime.jsxs(StyledRadio, { className, "data-ui": "Radio", style, children: [
3914
- t4,
3915
- t5
3916
- ] }), $[15] = className, $[16] = style, $[17] = t4, $[18] = t6) : t6 = $[18], t6;
3431
+ } = props, ref = react.useRef(null);
3432
+ return react.useImperativeHandle(forwardedRef, () => ref.current), useCustomValidity(ref, customValidity), /* @__PURE__ */ jsxRuntime.jsxs(StyledRadio, { className, "data-ui": "Radio", style, children: [
3433
+ /* @__PURE__ */ jsxRuntime.jsx(Input$4, { "data-read-only": !disabled && readOnly ? "" : void 0, "data-error": customValidity ? "" : void 0, ...restProps, disabled: disabled || readOnly, readOnly, ref, type: "radio" }),
3434
+ /* @__PURE__ */ jsxRuntime.jsx("span", {})
3435
+ ] });
3917
3436
  });
3918
3437
  Radio.displayName = "ForwardRef(Radio)";
3919
3438
  function rootStyle() {
@@ -4068,36 +3587,21 @@ const selectStyle = {
4068
3587
  displayName: "IconBox",
4069
3588
  componentId: "sc-5mxno7-2"
4070
3589
  })(selectStyle.iconBox), Select = react.forwardRef(function(props, forwardedRef) {
4071
- const $ = reactCompilerRuntime.c(29);
4072
- let children, customValidity, disabled, readOnly, restProps, t0, t1, t2, t3;
4073
- $[0] !== props ? ({
3590
+ const {
4074
3591
  children,
4075
3592
  customValidity,
4076
3593
  disabled,
4077
- fontSize: t0,
4078
- padding: t1,
4079
- radius: t2,
3594
+ fontSize: fontSize2 = 2,
3595
+ padding = 3,
3596
+ radius = 2,
4080
3597
  readOnly,
4081
- space: t3,
3598
+ space = 3,
4082
3599
  ...restProps
4083
- } = props, $[0] = props, $[1] = children, $[2] = customValidity, $[3] = disabled, $[4] = readOnly, $[5] = restProps, $[6] = t0, $[7] = t1, $[8] = t2, $[9] = t3) : (children = $[1], customValidity = $[2], disabled = $[3], readOnly = $[4], restProps = $[5], t0 = $[6], t1 = $[7], t2 = $[8], t3 = $[9]);
4084
- const fontSize2 = t0 === void 0 ? 2 : t0, padding = t1 === void 0 ? 3 : t1, radius = t2 === void 0 ? 2 : t2, space = t3 === void 0 ? 3 : t3, ref = react.useRef(null);
4085
- let t4;
4086
- $[10] === Symbol.for("react.memo_cache_sentinel") ? (t4 = () => ref.current, $[10] = t4) : t4 = $[10], react.useImperativeHandle(forwardedRef, t4), useCustomValidity(ref, customValidity);
4087
- const t5 = !disabled && readOnly ? "" : void 0, t6 = useArrayProp(fontSize2), t7 = useArrayProp(padding), t8 = useArrayProp(radius), t9 = useArrayProp(space), t10 = disabled || readOnly;
4088
- let t11;
4089
- $[11] !== children || $[12] !== restProps || $[13] !== t10 || $[14] !== t5 || $[15] !== t6 || $[16] !== t7 || $[17] !== t8 || $[18] !== t9 ? (t11 = /* @__PURE__ */ jsxRuntime.jsx(Input$3, { "data-read-only": t5, "data-ui": "Select", ...restProps, $fontSize: t6, $padding: t7, $radius: t8, $space: t9, disabled: t10, ref, children }), $[11] = children, $[12] = restProps, $[13] = t10, $[14] = t5, $[15] = t6, $[16] = t7, $[17] = t8, $[18] = t9, $[19] = t11) : t11 = $[19];
4090
- let t12;
4091
- $[20] === Symbol.for("react.memo_cache_sentinel") ? (t12 = /* @__PURE__ */ jsxRuntime.jsx(icons.ChevronDownIcon, {}), $[20] = t12) : t12 = $[20];
4092
- let t13;
4093
- $[21] !== fontSize2 ? (t13 = /* @__PURE__ */ jsxRuntime.jsx(Text, { size: fontSize2, children: t12 }), $[21] = fontSize2, $[22] = t13) : t13 = $[22];
4094
- let t14;
4095
- $[23] !== padding || $[24] !== t13 ? (t14 = /* @__PURE__ */ jsxRuntime.jsx(IconBox, { padding, children: t13 }), $[23] = padding, $[24] = t13, $[25] = t14) : t14 = $[25];
4096
- let t15;
4097
- return $[26] !== t11 || $[27] !== t14 ? (t15 = /* @__PURE__ */ jsxRuntime.jsxs(StyledSelect, { "data-ui": "Select", children: [
4098
- t11,
4099
- t14
4100
- ] }), $[26] = t11, $[27] = t14, $[28] = t15) : t15 = $[28], t15;
3600
+ } = props, ref = react.useRef(null);
3601
+ return react.useImperativeHandle(forwardedRef, () => ref.current), useCustomValidity(ref, customValidity), /* @__PURE__ */ jsxRuntime.jsxs(StyledSelect, { "data-ui": "Select", children: [
3602
+ /* @__PURE__ */ jsxRuntime.jsx(Input$3, { "data-read-only": !disabled && readOnly ? "" : void 0, "data-ui": "Select", ...restProps, $fontSize: _getArrayProp(fontSize2), $padding: _getArrayProp(padding), $radius: _getArrayProp(radius), $space: _getArrayProp(space), disabled: disabled || readOnly, ref, children }),
3603
+ /* @__PURE__ */ jsxRuntime.jsx(IconBox, { padding, children: /* @__PURE__ */ jsxRuntime.jsx(Text, { size: fontSize2, children: /* @__PURE__ */ jsxRuntime.jsx(icons.ChevronDownIcon, {}) }) })
3604
+ ] });
4101
3605
  });
4102
3606
  Select.displayName = "ForwardRef(Select)";
4103
3607
  const BASE_STYLE = {
@@ -4126,16 +3630,12 @@ const StyledStack = /* @__PURE__ */ styledComponents.styled(Box).withConfig({
4126
3630
  displayName: "StyledStack",
4127
3631
  componentId: "sc-8dpfq2-0"
4128
3632
  })(stackBaseStyle, responsiveStackSpaceStyle), Stack = react.forwardRef(function(props, ref) {
4129
- const $ = reactCompilerRuntime.c(10);
4130
- let as, restProps, space;
4131
- $[0] !== props ? ({
3633
+ const {
4132
3634
  as,
4133
3635
  space,
4134
3636
  ...restProps
4135
- } = props, $[0] = props, $[1] = as, $[2] = restProps, $[3] = space) : (as = $[1], restProps = $[2], space = $[3]);
4136
- const t0 = typeof as == "string" ? as : void 0, t1 = useArrayProp(space);
4137
- let t2;
4138
- return $[4] !== as || $[5] !== ref || $[6] !== restProps || $[7] !== t0 || $[8] !== t1 ? (t2 = /* @__PURE__ */ jsxRuntime.jsx(StyledStack, { "data-as": t0, "data-ui": "Stack", ...restProps, $space: t1, forwardedAs: as, ref }), $[4] = as, $[5] = ref, $[6] = restProps, $[7] = t0, $[8] = t1, $[9] = t2) : t2 = $[9], t2;
3637
+ } = props;
3638
+ return /* @__PURE__ */ jsxRuntime.jsx(StyledStack, { "data-as": typeof as == "string" ? as : void 0, "data-ui": "Stack", ...restProps, $space: _getArrayProp(space), forwardedAs: as, ref });
4139
3639
  });
4140
3640
  Stack.displayName = "ForwardRef(Stack)";
4141
3641
  function switchBaseStyles() {
@@ -4307,9 +3807,7 @@ const StyledSwitch = /* @__PURE__ */ styledComponents.styled.span.withConfig({
4307
3807
  displayName: "Thumb",
4308
3808
  componentId: "sc-dw1foe-4"
4309
3809
  })(switchThumbStyles), Switch = react.forwardRef(function(props, forwardedRef) {
4310
- const $ = reactCompilerRuntime.c(26);
4311
- let checked, className, disabled, indeterminate, readOnly, restProps, style;
4312
- $[0] !== props ? ({
3810
+ const {
4313
3811
  checked,
4314
3812
  className,
4315
3813
  disabled,
@@ -4317,29 +3815,16 @@ const StyledSwitch = /* @__PURE__ */ styledComponents.styled.span.withConfig({
4317
3815
  readOnly,
4318
3816
  style,
4319
3817
  ...restProps
4320
- } = props, $[0] = props, $[1] = checked, $[2] = className, $[3] = disabled, $[4] = indeterminate, $[5] = readOnly, $[6] = restProps, $[7] = style) : (checked = $[1], className = $[2], disabled = $[3], indeterminate = $[4], readOnly = $[5], restProps = $[6], style = $[7]);
4321
- const ref = react.useRef(null);
4322
- let t0;
4323
- $[8] === Symbol.for("react.memo_cache_sentinel") ? (t0 = () => ref.current, $[8] = t0) : t0 = $[8], react.useImperativeHandle(forwardedRef, t0);
4324
- let t1, t2;
4325
- $[9] !== indeterminate ? (t1 = () => {
3818
+ } = props, ref = react.useRef(null);
3819
+ return react.useImperativeHandle(forwardedRef, () => ref.current), react.useEffect(() => {
4326
3820
  ref.current && (ref.current.indeterminate = indeterminate || !1);
4327
- }, t2 = [indeterminate], $[9] = indeterminate, $[10] = t1, $[11] = t2) : (t1 = $[10], t2 = $[11]), react.useEffect(t1, t2);
4328
- const t3 = !disabled && readOnly ? "" : void 0, t4 = indeterminate !== !0 && checked, t5 = disabled || readOnly;
4329
- let t6;
4330
- $[12] !== restProps || $[13] !== t3 || $[14] !== t4 || $[15] !== t5 ? (t6 = /* @__PURE__ */ jsxRuntime.jsx(Input$2, { "data-read-only": t3, ...restProps, checked: t4, disabled: t5, type: "checkbox", ref }), $[12] = restProps, $[13] = t3, $[14] = t4, $[15] = t5, $[16] = t6) : t6 = $[16];
4331
- let t7;
4332
- $[17] === Symbol.for("react.memo_cache_sentinel") ? (t7 = /* @__PURE__ */ jsxRuntime.jsx(Track, {}), $[17] = t7) : t7 = $[17];
4333
- let t8;
4334
- $[18] !== checked || $[19] !== indeterminate ? (t8 = /* @__PURE__ */ jsxRuntime.jsxs(Representation, { "aria-hidden": !0, "data-name": "representation", children: [
4335
- t7,
4336
- /* @__PURE__ */ jsxRuntime.jsx(Thumb, { $checked: checked, $indeterminate: indeterminate })
4337
- ] }), $[18] = checked, $[19] = indeterminate, $[20] = t8) : t8 = $[20];
4338
- let t9;
4339
- return $[21] !== className || $[22] !== style || $[23] !== t6 || $[24] !== t8 ? (t9 = /* @__PURE__ */ jsxRuntime.jsxs(StyledSwitch, { className, "data-ui": "Switch", style, children: [
4340
- t6,
4341
- t8
4342
- ] }), $[21] = className, $[22] = style, $[23] = t6, $[24] = t8, $[25] = t9) : t9 = $[25], t9;
3821
+ }, [indeterminate]), /* @__PURE__ */ jsxRuntime.jsxs(StyledSwitch, { className, "data-ui": "Switch", style, children: [
3822
+ /* @__PURE__ */ jsxRuntime.jsx(Input$2, { "data-read-only": !disabled && readOnly ? "" : void 0, ...restProps, checked: indeterminate !== !0 && checked, disabled: disabled || readOnly, type: "checkbox", ref }),
3823
+ /* @__PURE__ */ jsxRuntime.jsxs(Representation, { "aria-hidden": !0, "data-name": "representation", children: [
3824
+ /* @__PURE__ */ jsxRuntime.jsx(Track, {}),
3825
+ /* @__PURE__ */ jsxRuntime.jsx(Thumb, { $checked: checked, $indeterminate: indeterminate })
3826
+ ] })
3827
+ ] });
4343
3828
  });
4344
3829
  Switch.displayName = "ForwardRef(Switch)";
4345
3830
  const StyledTextArea = /* @__PURE__ */ styledComponents.styled.span.withConfig({
@@ -4355,33 +3840,21 @@ const StyledTextArea = /* @__PURE__ */ styledComponents.styled.span.withConfig({
4355
3840
  displayName: "Presentation",
4356
3841
  componentId: "sc-1d6h1o8-3"
4357
3842
  })(responsiveRadiusStyle, textInputRepresentationStyle), TextArea = react.forwardRef(function(props, forwardedRef) {
4358
- const $ = reactCompilerRuntime.c(29);
4359
- let __unstable_disableFocusRing, customValidity, restProps, t0, t1, t2, t3, t4, weight;
4360
- $[0] !== props ? ({
4361
- border: t0,
3843
+ const {
3844
+ border: border2 = !0,
4362
3845
  customValidity,
4363
- disabled: t1,
4364
- fontSize: t2,
4365
- padding: t3,
4366
- radius: t4,
3846
+ disabled = !1,
3847
+ fontSize: fontSize2 = 2,
3848
+ padding = 3,
3849
+ radius = 2,
4367
3850
  weight,
4368
3851
  __unstable_disableFocusRing,
4369
3852
  ...restProps
4370
- } = props, $[0] = props, $[1] = __unstable_disableFocusRing, $[2] = customValidity, $[3] = restProps, $[4] = t0, $[5] = t1, $[6] = t2, $[7] = t3, $[8] = t4, $[9] = weight) : (__unstable_disableFocusRing = $[1], customValidity = $[2], restProps = $[3], t0 = $[4], t1 = $[5], t2 = $[6], t3 = $[7], t4 = $[8], weight = $[9]);
4371
- const border2 = t0 === void 0 ? !0 : t0, disabled = t1 === void 0 ? !1 : t1, fontSize2 = t2 === void 0 ? 2 : t2, padding = t3 === void 0 ? 3 : t3, radius = t4 === void 0 ? 2 : t4, ref = react.useRef(null), rootTheme = useRootTheme();
4372
- let t5;
4373
- $[10] === Symbol.for("react.memo_cache_sentinel") ? (t5 = () => ref.current, $[10] = t5) : t5 = $[10], react.useImperativeHandle(forwardedRef, t5), useCustomValidity(ref, customValidity);
4374
- const t6 = rootTheme.scheme, t7 = rootTheme.tone, t8 = useArrayProp(fontSize2), t9 = useArrayProp(padding), t10 = rootTheme.scheme, t11 = useArrayProp(0);
4375
- let t12;
4376
- $[11] !== disabled || $[12] !== restProps || $[13] !== rootTheme.scheme || $[14] !== rootTheme.tone || $[15] !== t11 || $[16] !== t8 || $[17] !== t9 || $[18] !== weight ? (t12 = /* @__PURE__ */ jsxRuntime.jsx(Input$1, { "data-as": "textarea", "data-scheme": t6, "data-tone": t7, ...restProps, $fontSize: t8, $padding: t9, $scheme: t10, $space: t11, $tone: rootTheme.tone, $weight: weight, disabled, ref }), $[11] = disabled, $[12] = restProps, $[13] = rootTheme.scheme, $[14] = rootTheme.tone, $[15] = t11, $[16] = t8, $[17] = t9, $[18] = weight, $[19] = t12) : t12 = $[19];
4377
- const t13 = useArrayProp(radius), t14 = border2 ? "" : void 0;
4378
- let t15;
4379
- $[20] !== __unstable_disableFocusRing || $[21] !== rootTheme.scheme || $[22] !== rootTheme.tone || $[23] !== t13 || $[24] !== t14 ? (t15 = /* @__PURE__ */ jsxRuntime.jsx(Presentation$1, { $radius: t13, $unstableDisableFocusRing: __unstable_disableFocusRing, $scheme: rootTheme.scheme, $tone: rootTheme.tone, "data-border": t14, "data-scheme": rootTheme.scheme, "data-tone": rootTheme.tone }), $[20] = __unstable_disableFocusRing, $[21] = rootTheme.scheme, $[22] = rootTheme.tone, $[23] = t13, $[24] = t14, $[25] = t15) : t15 = $[25];
4380
- let t16;
4381
- return $[26] !== t12 || $[27] !== t15 ? (t16 = /* @__PURE__ */ jsxRuntime.jsx(StyledTextArea, { "data-ui": "TextArea", children: /* @__PURE__ */ jsxRuntime.jsxs(InputRoot$1, { children: [
4382
- t12,
4383
- t15
4384
- ] }) }), $[26] = t12, $[27] = t15, $[28] = t16) : t16 = $[28], t16;
3853
+ } = props, ref = react.useRef(null), rootTheme = useRootTheme();
3854
+ return react.useImperativeHandle(forwardedRef, () => ref.current), useCustomValidity(ref, customValidity), /* @__PURE__ */ jsxRuntime.jsx(StyledTextArea, { "data-ui": "TextArea", children: /* @__PURE__ */ jsxRuntime.jsxs(InputRoot$1, { children: [
3855
+ /* @__PURE__ */ jsxRuntime.jsx(Input$1, { "data-as": "textarea", "data-scheme": rootTheme.scheme, "data-tone": rootTheme.tone, ...restProps, $fontSize: _getArrayProp(fontSize2), $padding: _getArrayProp(padding), $scheme: rootTheme.scheme, $space: _getArrayProp(0), $tone: rootTheme.tone, $weight: weight, disabled, ref }),
3856
+ /* @__PURE__ */ jsxRuntime.jsx(Presentation$1, { $radius: _getArrayProp(radius), $unstableDisableFocusRing: __unstable_disableFocusRing, $scheme: rootTheme.scheme, $tone: rootTheme.tone, "data-border": border2 ? "" : void 0, "data-scheme": rootTheme.scheme, "data-tone": rootTheme.tone })
3857
+ ] }) });
4385
3858
  });
4386
3859
  TextArea.displayName = "ForwardRef(TextArea)";
4387
3860
  const CLEAR_BUTTON_BOX_STYLE = {
@@ -4427,107 +3900,61 @@ const CLEAR_BUTTON_BOX_STYLE = {
4427
3900
  display: "block"
4428
3901
  }
4429
3902
  }), TextInput = react.forwardRef(function(props, forwardedRef) {
4430
- const $ = reactCompilerRuntime.c(84);
4431
- let IconComponent, IconRightComponent, __unstable_disableFocusRing, clearButton, customValidity, onClear, prefix, readOnly, restProps, suffix, t0, t1, t2, t3, t4, t5, t6, weight;
4432
- $[0] !== props ? ({
3903
+ const {
4433
3904
  __unstable_disableFocusRing,
4434
- border: t0,
3905
+ border: border2 = !0,
4435
3906
  clearButton,
4436
- disabled: t1,
4437
- fontSize: t2,
3907
+ disabled = !1,
3908
+ fontSize: fontSizeProp = 2,
4438
3909
  icon: IconComponent,
4439
3910
  iconRight: IconRightComponent,
4440
3911
  onClear,
4441
- padding: t3,
3912
+ padding: paddingProp = 3,
4442
3913
  prefix,
4443
- radius: t4,
3914
+ radius: radiusProp = 2,
4444
3915
  readOnly,
4445
- space: t5,
3916
+ space: spaceProp = 3,
4446
3917
  suffix,
4447
3918
  customValidity,
4448
- type: t6,
3919
+ type = "text",
4449
3920
  weight,
4450
3921
  ...restProps
4451
- } = props, $[0] = props, $[1] = IconComponent, $[2] = IconRightComponent, $[3] = __unstable_disableFocusRing, $[4] = clearButton, $[5] = customValidity, $[6] = onClear, $[7] = prefix, $[8] = readOnly, $[9] = restProps, $[10] = suffix, $[11] = t0, $[12] = t1, $[13] = t2, $[14] = t3, $[15] = t4, $[16] = t5, $[17] = t6, $[18] = weight) : (IconComponent = $[1], IconRightComponent = $[2], __unstable_disableFocusRing = $[3], clearButton = $[4], customValidity = $[5], onClear = $[6], prefix = $[7], readOnly = $[8], restProps = $[9], suffix = $[10], t0 = $[11], t1 = $[12], t2 = $[13], t3 = $[14], t4 = $[15], t5 = $[16], t6 = $[17], weight = $[18]);
4452
- const border2 = t0 === void 0 ? !0 : t0, disabled = t1 === void 0 ? !1 : t1, fontSizeProp = t2 === void 0 ? 2 : t2, paddingProp = t3 === void 0 ? 3 : t3, radiusProp = t4 === void 0 ? 2 : t4, spaceProp = t5 === void 0 ? 3 : t5, type = t6 === void 0 ? "text" : t6, ref = react.useRef(null), rootTheme = useRootTheme(), fontSize2 = useArrayProp(fontSizeProp), padding = useArrayProp(paddingProp), radius = useArrayProp(radiusProp), space = useArrayProp(spaceProp), $hasClearButton = !!clearButton, $hasIcon = !!IconComponent, $hasIconRight = !!IconRightComponent, $hasSuffix = !!suffix, $hasPrefix = !!prefix;
4453
- let t7;
4454
- $[19] === Symbol.for("react.memo_cache_sentinel") ? (t7 = () => ref.current, $[19] = t7) : t7 = $[19], react.useImperativeHandle(forwardedRef, t7), useCustomValidity(ref, customValidity);
4455
- const handleClearMouseDown = _temp$2;
4456
- let t8;
4457
- $[20] !== onClear ? (t8 = (event_0) => {
4458
- event_0.preventDefault(), event_0.stopPropagation(), onClear && onClear(), ref.current?.focus();
4459
- }, $[20] = onClear, $[21] = t8) : t8 = $[21];
4460
- const handleClearClick = t8;
4461
- let t9;
4462
- $[22] !== prefix || $[23] !== radius ? (t9 = prefix && /* @__PURE__ */ jsxRuntime.jsx(Prefix, { borderTop: !0, borderLeft: !0, borderBottom: !0, radius, sizing: "border", tone: "inherit", children: /* @__PURE__ */ jsxRuntime.jsx("span", { children: prefix }) }), $[22] = prefix, $[23] = radius, $[24] = t9) : t9 = $[24];
4463
- const prefixNode = t9, t10 = border2 ? "" : void 0;
4464
- let t11;
4465
- $[25] !== IconComponent || $[26] !== fontSize2 || $[27] !== padding ? (t11 = IconComponent && /* @__PURE__ */ jsxRuntime.jsx(LeftBox, { padding, children: /* @__PURE__ */ jsxRuntime.jsxs(Text, { size: fontSize2, children: [
4466
- react.isValidElement(IconComponent) && IconComponent,
4467
- ReactIs.isValidElementType(IconComponent) && /* @__PURE__ */ jsxRuntime.jsx(IconComponent, {})
4468
- ] }) }), $[25] = IconComponent, $[26] = fontSize2, $[27] = padding, $[28] = t11) : t11 = $[28];
4469
- let t12;
4470
- $[29] !== $hasClearButton || $[30] !== IconRightComponent || $[31] !== fontSize2 || $[32] !== padding ? (t12 = !$hasClearButton && IconRightComponent && /* @__PURE__ */ jsxRuntime.jsx(RightBox, { padding, children: /* @__PURE__ */ jsxRuntime.jsxs(Text, { size: fontSize2, children: [
4471
- react.isValidElement(IconRightComponent) && IconRightComponent,
4472
- ReactIs.isValidElementType(IconRightComponent) && /* @__PURE__ */ jsxRuntime.jsx(IconRightComponent, {})
4473
- ] }) }), $[29] = $hasClearButton, $[30] = IconRightComponent, $[31] = fontSize2, $[32] = padding, $[33] = t12) : t12 = $[33];
4474
- let t13;
4475
- $[34] !== $hasPrefix || $[35] !== $hasSuffix || $[36] !== __unstable_disableFocusRing || $[37] !== radius || $[38] !== rootTheme.scheme || $[39] !== rootTheme.tone || $[40] !== t10 || $[41] !== t11 || $[42] !== t12 ? (t13 = /* @__PURE__ */ jsxRuntime.jsxs(Presentation, { $hasPrefix, $unstableDisableFocusRing: __unstable_disableFocusRing, $hasSuffix, $radius: radius, $scheme: rootTheme.scheme, $tone: rootTheme.tone, "data-border": t10, "data-scheme": rootTheme.scheme, "data-tone": rootTheme.tone, children: [
4476
- t11,
4477
- t12
4478
- ] }), $[34] = $hasPrefix, $[35] = $hasSuffix, $[36] = __unstable_disableFocusRing, $[37] = radius, $[38] = rootTheme.scheme, $[39] = rootTheme.tone, $[40] = t10, $[41] = t11, $[42] = t12, $[43] = t13) : t13 = $[43];
4479
- const presentationNode = t13;
4480
- let t14;
4481
- $[44] !== padding ? (t14 = padding.map(_temp2), $[44] = padding, $[45] = t14) : t14 = $[45];
4482
- const clearButtonBoxPadding = t14;
4483
- let t15;
4484
- $[46] !== padding ? (t15 = padding.map(_temp3), $[46] = padding, $[47] = t15) : t15 = $[47];
4485
- const clearButtonPadding = t15, clearButtonProps = typeof clearButton == "object" ? clearButton : EMPTY_RECORD;
4486
- let t16;
4487
- $[48] !== clearButton || $[49] !== clearButtonBoxPadding || $[50] !== clearButtonPadding || $[51] !== clearButtonProps || $[52] !== customValidity || $[53] !== disabled || $[54] !== fontSize2 || $[55] !== handleClearClick || $[56] !== radius || $[57] !== readOnly ? (t16 = !disabled && !readOnly && clearButton && /* @__PURE__ */ jsxRuntime.jsx(RightCard, { forwardedAs: "span", padding: clearButtonBoxPadding, style: CLEAR_BUTTON_BOX_STYLE, tone: customValidity ? "critical" : "inherit", children: /* @__PURE__ */ jsxRuntime.jsx(TextInputClearButton, { "aria-label": "Clear", "data-qa": "clear-button", fontSize: fontSize2, icon: icons.CloseIcon, mode: "bleed", padding: clearButtonPadding, radius, ...clearButtonProps, onClick: handleClearClick, onMouseDown: handleClearMouseDown }) }), $[48] = clearButton, $[49] = clearButtonBoxPadding, $[50] = clearButtonPadding, $[51] = clearButtonProps, $[52] = customValidity, $[53] = disabled, $[54] = fontSize2, $[55] = handleClearClick, $[56] = radius, $[57] = readOnly, $[58] = t16) : t16 = $[58];
4488
- const clearButtonNode = t16;
4489
- let t17;
4490
- $[59] !== radius || $[60] !== suffix ? (t17 = suffix && /* @__PURE__ */ jsxRuntime.jsx(Suffix, { borderTop: !0, borderRight: !0, borderBottom: !0, radius, sizing: "border", tone: "inherit", children: /* @__PURE__ */ jsxRuntime.jsx("span", { children: suffix }) }), $[59] = radius, $[60] = suffix, $[61] = t17) : t17 = $[61];
4491
- const suffixNode = t17, t18 = $hasIconRight || $hasClearButton;
4492
- let t19;
4493
- $[62] !== $hasIcon || $[63] !== disabled || $[64] !== fontSize2 || $[65] !== padding || $[66] !== readOnly || $[67] !== restProps || $[68] !== rootTheme.scheme || $[69] !== rootTheme.tone || $[70] !== space || $[71] !== t18 || $[72] !== type || $[73] !== weight ? (t19 = /* @__PURE__ */ jsxRuntime.jsx(Input, { "data-as": "input", "data-scheme": rootTheme.scheme, "data-tone": rootTheme.tone, ...restProps, $fontSize: fontSize2, $iconLeft: $hasIcon, $iconRight: t18, $padding: padding, $scheme: rootTheme.scheme, $space: space, $tone: rootTheme.tone, $weight: weight, disabled, readOnly, ref, type }), $[62] = $hasIcon, $[63] = disabled, $[64] = fontSize2, $[65] = padding, $[66] = readOnly, $[67] = restProps, $[68] = rootTheme.scheme, $[69] = rootTheme.tone, $[70] = space, $[71] = t18, $[72] = type, $[73] = weight, $[74] = t19) : t19 = $[74];
4494
- let t20;
4495
- $[75] !== clearButtonNode || $[76] !== presentationNode || $[77] !== t19 ? (t20 = /* @__PURE__ */ jsxRuntime.jsxs(InputRoot, { children: [
4496
- t19,
4497
- presentationNode,
4498
- clearButtonNode
4499
- ] }), $[75] = clearButtonNode, $[76] = presentationNode, $[77] = t19, $[78] = t20) : t20 = $[78];
4500
- let t21;
4501
- return $[79] !== prefixNode || $[80] !== rootTheme.tone || $[81] !== suffixNode || $[82] !== t20 ? (t21 = /* @__PURE__ */ jsxRuntime.jsxs(StyledTextInput, { "data-ui": "TextInput", tone: rootTheme.tone, children: [
3922
+ } = props, ref = react.useRef(null), rootTheme = useRootTheme(), fontSize2 = _getArrayProp(fontSizeProp), padding = _getArrayProp(paddingProp), radius = _getArrayProp(radiusProp), space = _getArrayProp(spaceProp), $hasClearButton = !!clearButton, $hasIcon = !!IconComponent, $hasIconRight = !!IconRightComponent, $hasSuffix = !!suffix, $hasPrefix = !!prefix;
3923
+ react.useImperativeHandle(forwardedRef, () => ref.current), useCustomValidity(ref, customValidity);
3924
+ const handleClearMouseDown = react.useCallback((event) => {
3925
+ event.preventDefault(), event.stopPropagation();
3926
+ }, []), handleClearClick = react.useCallback((event) => {
3927
+ event.preventDefault(), event.stopPropagation(), onClear && onClear(), ref.current?.focus();
3928
+ }, [onClear, ref]), prefixNode = react.useMemo(() => prefix && /* @__PURE__ */ jsxRuntime.jsx(Prefix, { borderTop: !0, borderLeft: !0, borderBottom: !0, radius, sizing: "border", tone: "inherit", children: /* @__PURE__ */ jsxRuntime.jsx("span", { children: prefix }) }), [prefix, radius]), presentationNode = react.useMemo(() => /* @__PURE__ */ jsxRuntime.jsxs(Presentation, { $hasPrefix, $unstableDisableFocusRing: __unstable_disableFocusRing, $hasSuffix, $radius: radius, $scheme: rootTheme.scheme, $tone: rootTheme.tone, "data-border": border2 ? "" : void 0, "data-scheme": rootTheme.scheme, "data-tone": rootTheme.tone, children: [
3929
+ IconComponent && /* @__PURE__ */ jsxRuntime.jsx(LeftBox, { padding, children: /* @__PURE__ */ jsxRuntime.jsxs(Text, { size: fontSize2, children: [
3930
+ react.isValidElement(IconComponent) && IconComponent,
3931
+ ReactIs.isValidElementType(IconComponent) && /* @__PURE__ */ jsxRuntime.jsx(IconComponent, {})
3932
+ ] }) }),
3933
+ !$hasClearButton && IconRightComponent && /* @__PURE__ */ jsxRuntime.jsx(RightBox, { padding, children: /* @__PURE__ */ jsxRuntime.jsxs(Text, { size: fontSize2, children: [
3934
+ react.isValidElement(IconRightComponent) && IconRightComponent,
3935
+ ReactIs.isValidElementType(IconRightComponent) && /* @__PURE__ */ jsxRuntime.jsx(IconRightComponent, {})
3936
+ ] }) })
3937
+ ] }), [__unstable_disableFocusRing, border2, fontSize2, IconComponent, IconRightComponent, padding, radius, rootTheme, $hasClearButton, $hasPrefix, $hasSuffix]), clearButtonBoxPadding = react.useMemo(() => padding.map((v) => v === 0 ? 0 : v === 1 || v === 2 ? 1 : v - 2), [padding]), clearButtonPadding = react.useMemo(() => padding.map((v) => v === 0 || v === 1 ? 0 : v === 2 ? 1 : v - 1), [padding]), clearButtonProps = react.useMemo(() => typeof clearButton == "object" ? clearButton : EMPTY_RECORD, [clearButton]), clearButtonNode = react.useMemo(() => !disabled && !readOnly && clearButton && /* @__PURE__ */ jsxRuntime.jsx(RightCard, { forwardedAs: "span", padding: clearButtonBoxPadding, style: CLEAR_BUTTON_BOX_STYLE, tone: customValidity ? "critical" : "inherit", children: /* @__PURE__ */ jsxRuntime.jsx(TextInputClearButton, { "aria-label": "Clear", "data-qa": "clear-button", fontSize: fontSize2, icon: icons.CloseIcon, mode: "bleed", padding: clearButtonPadding, radius, ...clearButtonProps, onClick: handleClearClick, onMouseDown: handleClearMouseDown }) }), [clearButton, clearButtonBoxPadding, clearButtonPadding, clearButtonProps, customValidity, disabled, fontSize2, handleClearClick, handleClearMouseDown, radius, readOnly]), suffixNode = react.useMemo(() => suffix && /* @__PURE__ */ jsxRuntime.jsx(Suffix, { borderTop: !0, borderRight: !0, borderBottom: !0, radius, sizing: "border", tone: "inherit", children: /* @__PURE__ */ jsxRuntime.jsx("span", { children: suffix }) }), [radius, suffix]);
3938
+ return /* @__PURE__ */ jsxRuntime.jsxs(StyledTextInput, { "data-ui": "TextInput", tone: rootTheme.tone, children: [
4502
3939
  prefixNode,
4503
- t20,
3940
+ /* @__PURE__ */ jsxRuntime.jsxs(InputRoot, { children: [
3941
+ /* @__PURE__ */ jsxRuntime.jsx(Input, { "data-as": "input", "data-scheme": rootTheme.scheme, "data-tone": rootTheme.tone, ...restProps, $fontSize: fontSize2, $iconLeft: $hasIcon, $iconRight: $hasIconRight || $hasClearButton, $padding: padding, $scheme: rootTheme.scheme, $space: space, $tone: rootTheme.tone, $weight: weight, disabled, readOnly, ref, type }),
3942
+ presentationNode,
3943
+ clearButtonNode
3944
+ ] }),
4504
3945
  suffixNode
4505
- ] }), $[79] = prefixNode, $[80] = rootTheme.tone, $[81] = suffixNode, $[82] = t20, $[83] = t21) : t21 = $[83], t21;
3946
+ ] });
4506
3947
  });
4507
3948
  TextInput.displayName = "ForwardRef(TextInput)";
4508
- function _temp$2(event) {
4509
- event.preventDefault(), event.stopPropagation();
4510
- }
4511
- function _temp2(v) {
4512
- return v === 0 ? 0 : v === 1 || v === 2 ? 1 : v - 2;
4513
- }
4514
- function _temp3(v_0) {
4515
- return v_0 === 0 || v_0 === 1 ? 0 : v_0 === 2 ? 1 : v_0 - 1;
4516
- }
4517
3949
  function useDelayedState(initialState) {
4518
- const $ = reactCompilerRuntime.c(3), [state, setState] = react.useState(initialState), delayedAction = react.useRef(void 0);
4519
- let t0;
4520
- $[0] === Symbol.for("react.memo_cache_sentinel") ? (t0 = (nextState, delay) => {
3950
+ const [state, setState] = react.useState(initialState), delayedAction = react.useRef(void 0), onStateChange = react.useCallback((nextState, delay) => {
4521
3951
  const action = () => {
4522
3952
  setState(nextState);
4523
3953
  };
4524
- if (delayedAction.current && (clearTimeout(delayedAction.current), delayedAction.current = void 0), !delay)
4525
- return action();
3954
+ if (delayedAction.current && (clearTimeout(delayedAction.current), delayedAction.current = void 0), !delay) return action();
4526
3955
  delayedAction.current = setTimeout(action, delay);
4527
- }, $[0] = t0) : t0 = $[0];
4528
- const onStateChange = t0;
4529
- let t1;
4530
- return $[1] !== state ? (t1 = [state, onStateChange], $[1] = state, $[2] = t1) : t1 = $[2], t1;
3956
+ }, []);
3957
+ return [state, onStateChange];
4531
3958
  }
4532
3959
  const DEFAULT_TOOLTIP_ARROW_WIDTH = 15, DEFAULT_TOOLTIP_ARROW_HEIGHT = 6, DEFAULT_TOOLTIP_ARROW_RADIUS = 2, DEFAULT_TOOLTIP_DISTANCE = 4, DEFAULT_TOOLTIP_PADDING = 4, DEFAULT_FALLBACK_PLACEMENTS = {
4533
3960
  top: ["top-end", "top-start", "bottom", "left", "right"],
@@ -4546,9 +3973,7 @@ const DEFAULT_TOOLTIP_ARROW_WIDTH = 15, DEFAULT_TOOLTIP_ARROW_HEIGHT = 6, DEFAUL
4546
3973
  displayName: "MotionCard",
4547
3974
  componentId: "sc-1xn138w-0"
4548
3975
  })`will-change:transform;`, TooltipCard = react.forwardRef(function(props, ref) {
4549
- const $ = reactCompilerRuntime.c(48);
4550
- let animate, arrow, arrowRef, arrowX, arrowY, children, originX, originY, padding, placement, radius, restProps, scheme, shadow, style;
4551
- $[0] !== props ? ({
3976
+ const {
4552
3977
  animate,
4553
3978
  arrow,
4554
3979
  arrowRef,
@@ -4564,56 +3989,37 @@ const DEFAULT_TOOLTIP_ARROW_WIDTH = 15, DEFAULT_TOOLTIP_ARROW_HEIGHT = 6, DEFAUL
4564
3989
  shadow,
4565
3990
  style,
4566
3991
  ...restProps
4567
- } = props, $[0] = props, $[1] = animate, $[2] = arrow, $[3] = arrowRef, $[4] = arrowX, $[5] = arrowY, $[6] = children, $[7] = originX, $[8] = originY, $[9] = padding, $[10] = placement, $[11] = radius, $[12] = restProps, $[13] = scheme, $[14] = shadow, $[15] = style) : (animate = $[1], arrow = $[2], arrowRef = $[3], arrowX = $[4], arrowY = $[5], children = $[6], originX = $[7], originY = $[8], padding = $[9], placement = $[10], radius = $[11], restProps = $[12], scheme = $[13], shadow = $[14], style = $[15]);
4568
- const t0 = animate ? "transform" : void 0;
4569
- let t1;
4570
- $[16] !== originX || $[17] !== originY || $[18] !== style || $[19] !== t0 ? (t1 = {
3992
+ } = props, rootStyle2 = react.useMemo(() => ({
4571
3993
  originX,
4572
3994
  originY,
4573
- willChange: t0,
3995
+ willChange: animate ? "transform" : void 0,
4574
3996
  ...style
4575
- }, $[16] = originX, $[17] = originY, $[18] = style, $[19] = t0, $[20] = t1) : t1 = $[20];
4576
- const rootStyle2 = t1, t2 = arrowX !== null ? arrowX : void 0, t3 = arrowY !== null ? arrowY : void 0;
4577
- let t4;
4578
- $[21] !== t2 || $[22] !== t3 ? (t4 = {
4579
- left: t2,
4580
- top: t3,
3997
+ }), [animate, originX, originY, style]), arrowStyle = react.useMemo(() => ({
3998
+ left: arrowX !== null ? arrowX : void 0,
3999
+ top: arrowY !== null ? arrowY : void 0,
4581
4000
  right: void 0,
4582
4001
  bottom: void 0
4583
- }, $[21] = t2, $[22] = t3, $[23] = t4) : t4 = $[23];
4584
- const arrowStyle = t4, t5 = restProps;
4585
- let t6;
4586
- $[24] !== animate ? (t6 = animate ? ["hidden", "initial"] : void 0, $[24] = animate, $[25] = t6) : t6 = $[25];
4587
- let t7;
4588
- $[26] !== animate ? (t7 = animate ? ["visible", "scaleIn"] : void 0, $[26] = animate, $[27] = t7) : t7 = $[27];
4589
- let t8;
4590
- $[28] !== animate ? (t8 = animate ? ["hidden", "scaleOut"] : void 0, $[28] = animate, $[29] = t8) : t8 = $[29];
4591
- let t9;
4592
- $[30] !== arrow || $[31] !== arrowRef || $[32] !== arrowStyle ? (t9 = arrow && /* @__PURE__ */ jsxRuntime.jsx(Arrow, { ref: arrowRef, style: arrowStyle, width: DEFAULT_TOOLTIP_ARROW_WIDTH, height: DEFAULT_TOOLTIP_ARROW_HEIGHT, radius: DEFAULT_TOOLTIP_ARROW_RADIUS }), $[30] = arrow, $[31] = arrowRef, $[32] = arrowStyle, $[33] = t9) : t9 = $[33];
4593
- let t10;
4594
- return $[34] !== children || $[35] !== padding || $[36] !== placement || $[37] !== radius || $[38] !== ref || $[39] !== rootStyle2 || $[40] !== scheme || $[41] !== shadow || $[42] !== t5 || $[43] !== t6 || $[44] !== t7 || $[45] !== t8 || $[46] !== t9 ? (t10 = /* @__PURE__ */ jsxRuntime.jsxs(MotionCard, { "data-ui": "Tooltip__card", ...t5, "data-placement": placement, padding, radius, ref, scheme, shadow, style: rootStyle2, variants: POPOVER_MOTION_PROPS.card, transition: POPOVER_MOTION_PROPS.transition, initial: t6, animate: t7, exit: t8, children: [
4002
+ }), [arrowX, arrowY]);
4003
+ return /* @__PURE__ */ jsxRuntime.jsxs(MotionCard, { "data-ui": "Tooltip__card", ...restProps, "data-placement": placement, padding, radius, ref, scheme, shadow, style: rootStyle2, variants: POPOVER_MOTION_PROPS.card, transition: POPOVER_MOTION_PROPS.transition, initial: animate ? ["hidden", "initial"] : void 0, animate: animate ? ["visible", "scaleIn"] : void 0, exit: animate ? ["hidden", "scaleOut"] : void 0, children: [
4595
4004
  children,
4596
- t9
4597
- ] }), $[34] = children, $[35] = padding, $[36] = placement, $[37] = radius, $[38] = ref, $[39] = rootStyle2, $[40] = scheme, $[41] = shadow, $[42] = t5, $[43] = t6, $[44] = t7, $[45] = t8, $[46] = t9, $[47] = t10) : t10 = $[47], t10;
4005
+ arrow && /* @__PURE__ */ jsxRuntime.jsx(Arrow, { ref: arrowRef, style: arrowStyle, width: DEFAULT_TOOLTIP_ARROW_WIDTH, height: DEFAULT_TOOLTIP_ARROW_HEIGHT, radius: DEFAULT_TOOLTIP_ARROW_RADIUS })
4006
+ ] });
4598
4007
  });
4599
4008
  TooltipCard.displayName = "ForwardRef(TooltipCard)";
4600
4009
  const TooltipDelayGroupContext = createGlobalScopedContext("@sanity/ui/context/tooltipDelayGroup", null);
4601
4010
  function TooltipDelayGroupProvider(props) {
4602
- const $ = reactCompilerRuntime.c(9), {
4011
+ const {
4603
4012
  children,
4604
4013
  delay
4605
- } = props, [isGroupActive, setIsGroupActive] = useDelayedState(!1), [openTooltipId, setOpenTooltipId] = useDelayedState(null), openDelay = typeof delay == "number" ? delay : delay?.open || 0, closeDelay = typeof delay == "number" ? delay : delay?.close || 0, t0 = isGroupActive ? 1 : openDelay;
4606
- let t1;
4607
- $[0] !== closeDelay || $[1] !== openTooltipId || $[2] !== setIsGroupActive || $[3] !== setOpenTooltipId || $[4] !== t0 ? (t1 = {
4014
+ } = props, [isGroupActive, setIsGroupActive] = useDelayedState(!1), [openTooltipId, setOpenTooltipId] = useDelayedState(null), openDelay = typeof delay == "number" ? delay : delay?.open || 0, closeDelay = typeof delay == "number" ? delay : delay?.close || 0, value = react.useMemo(() => ({
4608
4015
  setIsGroupActive,
4609
4016
  openTooltipId,
4610
4017
  setOpenTooltipId,
4611
- openDelay: t0,
4018
+ // When the group is active, we want the next tooltip to open immediately.
4019
+ openDelay: isGroupActive ? 1 : openDelay,
4612
4020
  closeDelay
4613
- }, $[0] = closeDelay, $[1] = openTooltipId, $[2] = setIsGroupActive, $[3] = setOpenTooltipId, $[4] = t0, $[5] = t1) : t1 = $[5];
4614
- const value = t1;
4615
- let t2;
4616
- return $[6] !== children || $[7] !== value ? (t2 = /* @__PURE__ */ jsxRuntime.jsx(TooltipDelayGroupContext.Provider, { value, children }), $[6] = children, $[7] = value, $[8] = t2) : t2 = $[8], t2;
4021
+ }), [closeDelay, isGroupActive, openDelay, openTooltipId, setIsGroupActive, setOpenTooltipId]);
4022
+ return /* @__PURE__ */ jsxRuntime.jsx(TooltipDelayGroupContext.Provider, { value, children });
4617
4023
  }
4618
4024
  TooltipDelayGroupProvider.displayName = "TooltipDelayGroupProvider";
4619
4025
  function useTooltipDelayGroup() {
@@ -4623,68 +4029,51 @@ const StyledTooltip = styledComponents.styled(Layer).withConfig({
4623
4029
  displayName: "StyledTooltip",
4624
4030
  componentId: "sc-13f2zvh-0"
4625
4031
  })`pointer-events:none;`, Tooltip = react.forwardRef(function(props, forwardedRef) {
4626
- const $ = reactCompilerRuntime.c(135), boundaryElementContext = useBoundaryElement(), {
4032
+ const boundaryElementContext = useBoundaryElement(), {
4627
4033
  layer
4628
- } = useTheme_v2();
4629
- let _boundaryElement, _fallbackPlacementsProp, _zOffset, childProp, content, delay, disabled, portalProp, restProps, scheme, t0, t1, t2, t3, t4, t5;
4630
- $[0] !== props ? ({
4631
- animate: t0,
4632
- arrow: t1,
4034
+ } = useTheme_v2(), {
4035
+ animate: _animate = !1,
4036
+ arrow: arrowProp = !1,
4633
4037
  boundaryElement: _boundaryElement,
4634
4038
  children: childProp,
4635
4039
  content,
4636
4040
  disabled,
4637
4041
  fallbackPlacements: _fallbackPlacementsProp,
4638
- padding: t2,
4639
- placement: t3,
4042
+ padding = 2,
4043
+ placement: placementProp = "bottom",
4640
4044
  portal: portalProp,
4641
- radius: t4,
4045
+ radius = 2,
4642
4046
  scheme,
4643
- shadow: t5,
4047
+ shadow = 2,
4644
4048
  zOffset: _zOffset,
4645
4049
  delay,
4646
4050
  ...restProps
4647
- } = props, $[0] = props, $[1] = _boundaryElement, $[2] = _fallbackPlacementsProp, $[3] = _zOffset, $[4] = childProp, $[5] = content, $[6] = delay, $[7] = disabled, $[8] = portalProp, $[9] = restProps, $[10] = scheme, $[11] = t0, $[12] = t1, $[13] = t2, $[14] = t3, $[15] = t4, $[16] = t5) : (_boundaryElement = $[1], _fallbackPlacementsProp = $[2], _zOffset = $[3], childProp = $[4], content = $[5], delay = $[6], disabled = $[7], portalProp = $[8], restProps = $[9], scheme = $[10], t0 = $[11], t1 = $[12], t2 = $[13], t3 = $[14], t4 = $[15], t5 = $[16]);
4648
- const _animate = t0 === void 0 ? !1 : t0, arrowProp = t1 === void 0 ? !1 : t1, padding = t2 === void 0 ? 2 : t2, placementProp = t3 === void 0 ? "bottom" : t3, radius = t4 === void 0 ? 2 : t4, shadow = t5 === void 0 ? 2 : t5, boundaryElement = _boundaryElement ?? boundaryElementContext?.element, fallbackPlacementsProp = _fallbackPlacementsProp ?? DEFAULT_FALLBACK_PLACEMENTS[props.placement ?? "bottom"], zOffset = _zOffset ?? layer.tooltip.zOffset, animate = usePrefersReducedMotion() ? !1 : _animate, fallbackPlacements = useArrayProp(fallbackPlacementsProp), ref = react.useRef(null), [referenceElement, setReferenceElement] = react.useState(null), arrowRef = react.useRef(null), [tooltipMaxWidth, setTooltipMaxWidth] = react.useState(0);
4649
- let t6;
4650
- $[17] === Symbol.for("react.memo_cache_sentinel") ? (t6 = () => ref.current, $[17] = t6) : t6 = $[17], react.useImperativeHandle(forwardedRef, t6);
4651
- const portal = usePortal(), portalElement = typeof portalProp == "string" ? portal.elements?.[portalProp] || null : portal.element;
4652
- let t7;
4653
- $[18] !== animate || $[19] !== arrowProp || $[20] !== boundaryElement || $[21] !== fallbackPlacements ? (t7 = {
4051
+ } = props, boundaryElement = _boundaryElement ?? boundaryElementContext?.element, fallbackPlacementsProp = _fallbackPlacementsProp ?? DEFAULT_FALLBACK_PLACEMENTS[props.placement ?? "bottom"], zOffset = _zOffset ?? layer.tooltip.zOffset, animate = usePrefersReducedMotion() ? !1 : _animate, fallbackPlacements = _getArrayProp(fallbackPlacementsProp), ref = react.useRef(null), [referenceElement, setReferenceElement] = react.useState(null), arrowRef = react.useRef(null), rootBoundary = "viewport", [tooltipMaxWidth, setTooltipMaxWidth] = react.useState(0);
4052
+ react.useImperativeHandle(forwardedRef, () => ref.current);
4053
+ const portal = usePortal(), portalElement = typeof portalProp == "string" ? portal.elements?.[portalProp] || null : portal.element, middleware = useMiddleware({
4654
4054
  animate,
4655
4055
  arrowProp,
4656
4056
  arrowRef,
4657
4057
  boundaryElement,
4658
4058
  fallbackPlacements,
4659
- rootBoundary: "viewport"
4660
- }, $[18] = animate, $[19] = arrowProp, $[20] = boundaryElement, $[21] = fallbackPlacements, $[22] = t7) : t7 = $[22];
4661
- const middleware = useMiddleware(t7);
4662
- let t8;
4663
- $[23] !== referenceElement ? (t8 = {
4664
- reference: referenceElement
4665
- }, $[23] = referenceElement, $[24] = t8) : t8 = $[24];
4666
- let t9;
4667
- $[25] !== middleware || $[26] !== placementProp || $[27] !== t8 ? (t9 = {
4668
- middleware,
4669
- placement: placementProp,
4670
- whileElementsMounted: reactDom$1.autoUpdate,
4671
- elements: t8
4672
- }, $[25] = middleware, $[26] = placementProp, $[27] = t8, $[28] = t9) : t9 = $[28];
4673
- const {
4059
+ rootBoundary
4060
+ }), {
4674
4061
  floatingStyles,
4675
4062
  placement,
4676
4063
  middlewareData,
4677
4064
  refs,
4678
4065
  update
4679
- } = reactDom$1.useFloating(t9), arrowX = middlewareData.arrow?.x, arrowY = middlewareData.arrow?.y, originX = middlewareData["@sanity/ui/origin"]?.originX, originY = middlewareData["@sanity/ui/origin"]?.originY, tooltipId = react.useId(), [isOpen, setIsOpen] = useDelayedState(!1), delayGroupContext = useTooltipDelayGroup();
4680
- let t10;
4681
- $[29] !== delayGroupContext ? (t10 = delayGroupContext || {}, $[29] = delayGroupContext, $[30] = t10) : t10 = $[30];
4682
- const {
4066
+ } = reactDom$1.useFloating({
4067
+ middleware,
4068
+ placement: placementProp,
4069
+ whileElementsMounted: reactDom$1.autoUpdate,
4070
+ elements: {
4071
+ reference: referenceElement
4072
+ }
4073
+ }), arrowX = middlewareData.arrow?.x, arrowY = middlewareData.arrow?.y, originX = middlewareData["@sanity/ui/origin"]?.originX, originY = middlewareData["@sanity/ui/origin"]?.originY, tooltipId = react.useId(), [isOpen, setIsOpen] = useDelayedState(!1), delayGroupContext = useTooltipDelayGroup(), {
4683
4074
  setIsGroupActive,
4684
4075
  setOpenTooltipId
4685
- } = t10, showTooltip = isOpen || delayGroupContext?.openTooltipId === tooltipId, isInsideGroup = delayGroupContext !== null, openDelayProp = typeof delay == "number" ? delay : delay?.open || 0, closeDelayProp = typeof delay == "number" ? delay : delay?.close || 0, openDelay = isInsideGroup ? delayGroupContext.openDelay : openDelayProp, closeDelay = isInsideGroup ? delayGroupContext.closeDelay : closeDelayProp;
4686
- let t11;
4687
- $[31] !== closeDelay || $[32] !== isInsideGroup || $[33] !== openDelay || $[34] !== setIsGroupActive || $[35] !== setIsOpen || $[36] !== setOpenTooltipId || $[37] !== tooltipId ? (t11 = (open, immediate) => {
4076
+ } = delayGroupContext || {}, showTooltip = isOpen || delayGroupContext?.openTooltipId === tooltipId, isInsideGroup = delayGroupContext !== null, openDelayProp = typeof delay == "number" ? delay : delay?.open || 0, closeDelayProp = typeof delay == "number" ? delay : delay?.close || 0, openDelay = isInsideGroup ? delayGroupContext.openDelay : openDelayProp, closeDelay = isInsideGroup ? delayGroupContext.closeDelay : closeDelayProp, handleIsOpenChange = react.useCallback((open, immediate) => {
4688
4077
  if (isInsideGroup)
4689
4078
  if (open) {
4690
4079
  const groupedOpenDelay = immediate ? 0 : openDelay;
@@ -4695,196 +4084,108 @@ const StyledTooltip = styledComponents.styled(Layer).withConfig({
4695
4084
  }
4696
4085
  else
4697
4086
  setIsOpen(open, immediate ? 0 : open ? openDelay : closeDelay);
4698
- }, $[31] = closeDelay, $[32] = isInsideGroup, $[33] = openDelay, $[34] = setIsGroupActive, $[35] = setIsOpen, $[36] = setOpenTooltipId, $[37] = tooltipId, $[38] = t11) : t11 = $[38];
4699
- const handleIsOpenChange = t11;
4700
- let t12;
4701
- $[39] !== childProp?.props || $[40] !== handleIsOpenChange ? (t12 = (e) => {
4087
+ }, [isInsideGroup, openDelay, setIsGroupActive, setOpenTooltipId, tooltipId, closeDelay, setIsOpen]), handleBlur = react.useCallback((e) => {
4702
4088
  handleIsOpenChange(!1), childProp?.props?.onBlur?.(e);
4703
- }, $[39] = childProp?.props, $[40] = handleIsOpenChange, $[41] = t12) : t12 = $[41];
4704
- const handleBlur = t12;
4705
- let t13;
4706
- $[42] !== childProp?.props || $[43] !== handleIsOpenChange ? (t13 = (e_0) => {
4707
- handleIsOpenChange(!1, !0), childProp?.props.onClick?.(e_0);
4708
- }, $[42] = childProp?.props, $[43] = handleIsOpenChange, $[44] = t13) : t13 = $[44];
4709
- const handleClick = t13;
4710
- let t14;
4711
- $[45] !== childProp?.props || $[46] !== handleIsOpenChange ? (t14 = (e_1) => {
4712
- handleIsOpenChange(!1, !0), childProp?.props.onContextMenu?.(e_1);
4713
- }, $[45] = childProp?.props, $[46] = handleIsOpenChange, $[47] = t14) : t14 = $[47];
4714
- const handleContextMenu = t14;
4715
- let t15;
4716
- $[48] !== childProp?.props || $[49] !== handleIsOpenChange ? (t15 = (e_2) => {
4717
- handleIsOpenChange(!0), childProp?.props?.onFocus?.(e_2);
4718
- }, $[48] = childProp?.props, $[49] = handleIsOpenChange, $[50] = t15) : t15 = $[50];
4719
- const handleFocus = t15;
4720
- let t16;
4721
- $[51] !== childProp?.props || $[52] !== handleIsOpenChange ? (t16 = (e_3) => {
4722
- handleIsOpenChange(!0), childProp?.props?.onMouseEnter?.(e_3);
4723
- }, $[51] = childProp?.props, $[52] = handleIsOpenChange, $[53] = t16) : t16 = $[53];
4724
- const handleMouseEnter = t16;
4725
- let t17;
4726
- $[54] !== childProp?.props || $[55] !== handleIsOpenChange ? (t17 = (e_4) => {
4727
- handleIsOpenChange(!1), childProp?.props?.onMouseLeave?.(e_4);
4728
- }, $[54] = childProp?.props, $[55] = handleIsOpenChange, $[56] = t17) : t17 = $[56];
4729
- const handleMouseLeave = t17;
4730
- let t18;
4731
- $[57] !== handleIsOpenChange || $[58] !== isInsideGroup || $[59] !== referenceElement || $[60] !== showTooltip ? (t18 = {
4089
+ }, [childProp?.props, handleIsOpenChange]), handleClick = react.useCallback((e) => {
4090
+ handleIsOpenChange(!1, !0), childProp?.props.onClick?.(e);
4091
+ }, [childProp?.props, handleIsOpenChange]), handleContextMenu = react.useCallback((e) => {
4092
+ handleIsOpenChange(!1, !0), childProp?.props.onContextMenu?.(e);
4093
+ }, [childProp?.props, handleIsOpenChange]), handleFocus = react.useCallback((e) => {
4094
+ handleIsOpenChange(!0), childProp?.props?.onFocus?.(e);
4095
+ }, [childProp?.props, handleIsOpenChange]), handleMouseEnter = react.useCallback((e) => {
4096
+ handleIsOpenChange(!0), childProp?.props?.onMouseEnter?.(e);
4097
+ }, [childProp?.props, handleIsOpenChange]), handleMouseLeave = react.useCallback((e) => {
4098
+ handleIsOpenChange(!1), childProp?.props?.onMouseLeave?.(e);
4099
+ }, [childProp?.props, handleIsOpenChange]);
4100
+ useCloseOnMouseLeave({
4732
4101
  handleIsOpenChange,
4733
4102
  referenceElement,
4734
4103
  showTooltip,
4735
4104
  isInsideGroup
4736
- }, $[57] = handleIsOpenChange, $[58] = isInsideGroup, $[59] = referenceElement, $[60] = showTooltip, $[61] = t18) : t18 = $[61], useCloseOnMouseLeave(t18);
4737
- let t19, t20;
4738
- $[62] !== disabled || $[63] !== handleIsOpenChange || $[64] !== showTooltip ? (t19 = () => {
4105
+ }), react.useEffect(() => {
4739
4106
  disabled && showTooltip && handleIsOpenChange(!1);
4740
- }, t20 = [disabled, handleIsOpenChange, showTooltip], $[62] = disabled, $[63] = handleIsOpenChange, $[64] = showTooltip, $[65] = t19, $[66] = t20) : (t19 = $[65], t20 = $[66]), react.useEffect(t19, t20);
4741
- let t21, t22;
4742
- $[67] !== content || $[68] !== handleIsOpenChange || $[69] !== showTooltip ? (t21 = () => {
4107
+ }, [disabled, handleIsOpenChange, showTooltip]), react.useEffect(() => {
4743
4108
  !content && showTooltip && handleIsOpenChange(!1);
4744
- }, t22 = [content, handleIsOpenChange, showTooltip], $[67] = content, $[68] = handleIsOpenChange, $[69] = showTooltip, $[70] = t21, $[71] = t22) : (t21 = $[70], t22 = $[71]), react.useEffect(t21, t22);
4745
- let t23, t24;
4746
- $[72] !== handleIsOpenChange || $[73] !== showTooltip ? (t23 = () => {
4747
- if (!showTooltip)
4748
- return;
4749
- const handleWindowKeyDown = function(event) {
4109
+ }, [content, handleIsOpenChange, showTooltip]), react.useEffect(() => {
4110
+ if (!showTooltip) return;
4111
+ function handleWindowKeyDown(event) {
4750
4112
  event.key === "Escape" && handleIsOpenChange(!1, !0);
4751
- };
4113
+ }
4752
4114
  return window.addEventListener("keydown", handleWindowKeyDown), () => {
4753
4115
  window.removeEventListener("keydown", handleWindowKeyDown);
4754
4116
  };
4755
- }, t24 = [handleIsOpenChange, showTooltip], $[72] = handleIsOpenChange, $[73] = showTooltip, $[74] = t23, $[75] = t24) : (t23 = $[74], t24 = $[75]), react.useEffect(t23, t24);
4756
- let t25;
4757
- $[76] !== boundaryElement || $[77] !== portalElement?.offsetWidth ? (t25 = () => {
4117
+ }, [handleIsOpenChange, showTooltip]), react.useLayoutEffect(() => {
4758
4118
  const availableWidths = [...boundaryElement ? [boundaryElement.offsetWidth] : [], portalElement?.offsetWidth || document.body.offsetWidth];
4759
4119
  setTooltipMaxWidth(Math.min(...availableWidths) - DEFAULT_TOOLTIP_PADDING * 2);
4760
- }, $[76] = boundaryElement, $[77] = portalElement?.offsetWidth, $[78] = t25) : t25 = $[78];
4761
- let t26;
4762
- $[79] !== boundaryElement || $[80] !== portalElement ? (t26 = [boundaryElement, portalElement], $[79] = boundaryElement, $[80] = portalElement, $[81] = t26) : t26 = $[81], react.useLayoutEffect(t25, t26);
4763
- let t27;
4764
- $[82] !== update ? (t27 = (arrowEl) => {
4120
+ }, [boundaryElement, portalElement]);
4121
+ const setArrow = react.useCallback((arrowEl) => {
4765
4122
  arrowRef.current = arrowEl, update();
4766
- }, $[82] = update, $[83] = t27) : t27 = $[83];
4767
- const setArrow = t27;
4768
- let t28;
4769
- $[84] !== refs ? (t28 = (node) => {
4123
+ }, [update]), setFloating = react.useCallback((node) => {
4770
4124
  ref.current = node, refs.setFloating(node);
4771
- }, $[84] = refs, $[85] = t28) : t28 = $[85];
4772
- const setFloating = t28;
4773
- let t29;
4774
- bb0: {
4775
- if (!childProp) {
4776
- t29 = null;
4777
- break bb0;
4778
- }
4779
- let t302;
4780
- $[86] !== childProp || $[87] !== handleBlur || $[88] !== handleClick || $[89] !== handleContextMenu || $[90] !== handleFocus || $[91] !== handleMouseEnter || $[92] !== handleMouseLeave ? (t302 = react.cloneElement(childProp, {
4781
- onBlur: handleBlur,
4782
- onFocus: handleFocus,
4783
- onMouseEnter: handleMouseEnter,
4784
- onMouseLeave: handleMouseLeave,
4785
- onClick: handleClick,
4786
- onContextMenu: handleContextMenu,
4787
- ref: setReferenceElement
4788
- }), $[86] = childProp, $[87] = handleBlur, $[88] = handleClick, $[89] = handleContextMenu, $[90] = handleFocus, $[91] = handleMouseEnter, $[92] = handleMouseLeave, $[93] = t302) : t302 = $[93], t29 = t302;
4789
- }
4790
- const child = t29;
4791
- let t30;
4792
- $[94] !== childProp ? (t30 = childProp ? getElementRef(childProp) : null, $[94] = childProp, $[95] = t30) : t30 = $[95];
4793
- let t31, t32;
4794
- if ($[96] !== referenceElement ? (t31 = () => referenceElement, t32 = [referenceElement], $[96] = referenceElement, $[97] = t31, $[98] = t32) : (t31 = $[97], t32 = $[98]), react.useImperativeHandle(t30, t31, t32), !child) {
4795
- let t332;
4796
- return $[99] === Symbol.for("react.memo_cache_sentinel") ? (t332 = /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, {}), $[99] = t332) : t332 = $[99], t332;
4797
- }
4798
- if (disabled)
4799
- return child;
4800
- const t33 = tooltipMaxWidth > 0 ? `${tooltipMaxWidth}px` : void 0;
4801
- let t34;
4802
- $[100] !== floatingStyles || $[101] !== t33 ? (t34 = {
4125
+ }, [refs]), child = react.useMemo(() => childProp ? react.cloneElement(childProp, {
4126
+ onBlur: handleBlur,
4127
+ onFocus: handleFocus,
4128
+ onMouseEnter: handleMouseEnter,
4129
+ onMouseLeave: handleMouseLeave,
4130
+ onClick: handleClick,
4131
+ onContextMenu: handleContextMenu,
4132
+ ref: setReferenceElement
4133
+ }) : null, [childProp, handleBlur, handleClick, handleContextMenu, handleFocus, handleMouseEnter, handleMouseLeave]);
4134
+ if (react.useImperativeHandle(childProp ? getElementRef(childProp) : null, () => referenceElement, [referenceElement]), !child) return /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, {});
4135
+ if (disabled) return child;
4136
+ const tooltip = /* @__PURE__ */ jsxRuntime.jsx(StyledTooltip, { "data-ui": "Tooltip", ...restProps, ref: setFloating, style: {
4803
4137
  ...floatingStyles,
4804
- maxWidth: t33
4805
- }, $[100] = floatingStyles, $[101] = t33, $[102] = t34) : t34 = $[102];
4806
- let t35;
4807
- $[103] !== animate || $[104] !== arrowProp || $[105] !== arrowX || $[106] !== arrowY || $[107] !== content || $[108] !== originX || $[109] !== originY || $[110] !== padding || $[111] !== placement || $[112] !== radius || $[113] !== restProps || $[114] !== scheme || $[115] !== setArrow || $[116] !== setFloating || $[117] !== shadow ? (t35 = /* @__PURE__ */ jsxRuntime.jsx(TooltipCard, { ...restProps, animate, arrow: arrowProp, arrowRef: setArrow, arrowX, arrowY, originX, originY, padding, placement, radius, ref: setFloating, scheme, shadow, children: content }), $[103] = animate, $[104] = arrowProp, $[105] = arrowX, $[106] = arrowY, $[107] = content, $[108] = originX, $[109] = originY, $[110] = padding, $[111] = placement, $[112] = radius, $[113] = restProps, $[114] = scheme, $[115] = setArrow, $[116] = setFloating, $[117] = shadow, $[118] = t35) : t35 = $[118];
4808
- let t36;
4809
- $[119] !== restProps || $[120] !== setFloating || $[121] !== t34 || $[122] !== t35 || $[123] !== zOffset ? (t36 = /* @__PURE__ */ jsxRuntime.jsx(StyledTooltip, { "data-ui": "Tooltip", ...restProps, ref: setFloating, style: t34, zOffset, children: t35 }), $[119] = restProps, $[120] = setFloating, $[121] = t34, $[122] = t35, $[123] = zOffset, $[124] = t36) : t36 = $[124];
4810
- const tooltip = t36;
4811
- let t37;
4812
- $[125] !== portalProp || $[126] !== showTooltip || $[127] !== tooltip ? (t37 = showTooltip && (portalProp ? /* @__PURE__ */ jsxRuntime.jsx(Portal, { __unstable_name: typeof portalProp == "string" ? portalProp : void 0, children: tooltip }) : tooltip), $[125] = portalProp, $[126] = showTooltip, $[127] = tooltip, $[128] = t37) : t37 = $[128];
4813
- const children = t37;
4814
- let t38;
4815
- $[129] !== animate || $[130] !== children ? (t38 = animate ? /* @__PURE__ */ jsxRuntime.jsx(framerMotion.AnimatePresence, { children }) : children, $[129] = animate, $[130] = children, $[131] = t38) : t38 = $[131];
4816
- let t39;
4817
- return $[132] !== child || $[133] !== t38 ? (t39 = /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
4818
- t38,
4138
+ maxWidth: tooltipMaxWidth > 0 ? `${tooltipMaxWidth}px` : void 0
4139
+ }, zOffset, children: /* @__PURE__ */ jsxRuntime.jsx(TooltipCard, { ...restProps, animate, arrow: arrowProp, arrowRef: setArrow, arrowX, arrowY, originX, originY, padding, placement, radius, ref: setFloating, scheme, shadow, children: content }) }), children = showTooltip && (portalProp ? /* @__PURE__ */ jsxRuntime.jsx(Portal, { __unstable_name: typeof portalProp == "string" ? portalProp : void 0, children: tooltip }) : tooltip);
4140
+ return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
4141
+ animate ? /* @__PURE__ */ jsxRuntime.jsx(framerMotion.AnimatePresence, { children }) : children,
4819
4142
  child
4820
- ] }), $[132] = child, $[133] = t38, $[134] = t39) : t39 = $[134], t39;
4143
+ ] });
4821
4144
  });
4822
4145
  Tooltip.displayName = "ForwardRef(Tooltip)";
4823
- function useMiddleware(t0) {
4824
- const $ = reactCompilerRuntime.c(17), {
4825
- animate,
4826
- arrowProp,
4827
- arrowRef,
4828
- boundaryElement,
4829
- fallbackPlacements,
4830
- rootBoundary
4831
- } = t0;
4832
- let ret;
4833
- if ($[0] !== animate || $[1] !== arrowProp || $[2] !== arrowRef || $[3] !== boundaryElement || $[4] !== fallbackPlacements || $[5] !== rootBoundary) {
4834
- ret = [];
4835
- const t1 = boundaryElement || void 0;
4836
- let t2;
4837
- $[7] !== fallbackPlacements || $[8] !== rootBoundary || $[9] !== t1 ? (t2 = reactDom$1.flip({
4838
- boundary: t1,
4146
+ function useMiddleware({
4147
+ animate,
4148
+ arrowProp,
4149
+ arrowRef,
4150
+ boundaryElement,
4151
+ fallbackPlacements,
4152
+ rootBoundary
4153
+ }) {
4154
+ return react.useMemo(() => {
4155
+ const ret = [];
4156
+ return ret.push(reactDom$1.flip({
4157
+ boundary: boundaryElement || void 0,
4839
4158
  fallbackPlacements,
4840
4159
  padding: DEFAULT_TOOLTIP_PADDING,
4841
4160
  rootBoundary
4842
- }), $[7] = fallbackPlacements, $[8] = rootBoundary, $[9] = t1, $[10] = t2) : t2 = $[10], ret.push(t2);
4843
- let t3;
4844
- $[11] === Symbol.for("react.memo_cache_sentinel") ? (t3 = reactDom$1.offset({
4161
+ })), ret.push(reactDom$1.offset({
4845
4162
  mainAxis: DEFAULT_TOOLTIP_DISTANCE
4846
- }), $[11] = t3) : t3 = $[11], ret.push(t3);
4847
- const t4 = boundaryElement || void 0;
4848
- let t5;
4849
- if ($[12] !== rootBoundary || $[13] !== t4 ? (t5 = reactDom$1.shift({
4850
- boundary: t4,
4163
+ })), ret.push(reactDom$1.shift({
4164
+ boundary: boundaryElement || void 0,
4851
4165
  rootBoundary,
4852
4166
  padding: DEFAULT_TOOLTIP_PADDING
4853
- }), $[12] = rootBoundary, $[13] = t4, $[14] = t5) : t5 = $[14], ret.push(t5), arrowProp) {
4854
- let t6;
4855
- $[15] !== arrowRef ? (t6 = reactDom$1.arrow({
4856
- element: arrowRef,
4857
- padding: DEFAULT_TOOLTIP_PADDING
4858
- }), $[15] = arrowRef, $[16] = t6) : t6 = $[16], ret.push(t6);
4859
- }
4860
- animate && ret.push(origin), $[0] = animate, $[1] = arrowProp, $[2] = arrowRef, $[3] = boundaryElement, $[4] = fallbackPlacements, $[5] = rootBoundary, $[6] = ret;
4861
- } else
4862
- ret = $[6];
4863
- return ret;
4864
- }
4865
- function useCloseOnMouseLeave(t0) {
4866
- const $ = reactCompilerRuntime.c(10), {
4867
- handleIsOpenChange,
4868
- referenceElement,
4869
- showTooltip,
4870
- isInsideGroup
4871
- } = t0;
4872
- let t1;
4873
- $[0] !== handleIsOpenChange || $[1] !== referenceElement ? (t1 = (target, teardown) => {
4167
+ })), arrowProp && ret.push(reactDom$1.arrow({
4168
+ element: arrowRef,
4169
+ padding: DEFAULT_TOOLTIP_PADDING
4170
+ })), animate && ret.push(origin), ret;
4171
+ }, [animate, arrowProp, arrowRef, boundaryElement, fallbackPlacements, rootBoundary]);
4172
+ }
4173
+ function useCloseOnMouseLeave({
4174
+ handleIsOpenChange,
4175
+ referenceElement,
4176
+ showTooltip,
4177
+ isInsideGroup
4178
+ }) {
4179
+ const onMouseMove = useEffectEvent.useEffectEvent((target, teardown) => {
4874
4180
  referenceElement && (referenceElement === target || target instanceof Node && referenceElement.contains(target) || (handleIsOpenChange(!1), teardown()));
4875
- }, $[0] = handleIsOpenChange, $[1] = referenceElement, $[2] = t1) : t1 = $[2];
4876
- const onMouseMove = useEffectEvent.useEffectEvent(t1);
4877
- let t2;
4878
- $[3] !== isInsideGroup || $[4] !== onMouseMove || $[5] !== showTooltip ? (t2 = () => {
4879
- if (!showTooltip || isInsideGroup)
4880
- return;
4181
+ });
4182
+ react.useEffect(() => {
4183
+ if (!showTooltip || isInsideGroup) return;
4881
4184
  const handleMouseMove = (event) => {
4882
4185
  onMouseMove(event.target, () => window.removeEventListener("mousemove", handleMouseMove));
4883
4186
  };
4884
4187
  return window.addEventListener("mousemove", handleMouseMove), () => window.removeEventListener("mousemove", handleMouseMove);
4885
- }, $[3] = isInsideGroup, $[4] = onMouseMove, $[5] = showTooltip, $[6] = t2) : t2 = $[6];
4886
- let t3;
4887
- $[7] !== isInsideGroup || $[8] !== showTooltip ? (t3 = [isInsideGroup, showTooltip], $[7] = isInsideGroup, $[8] = showTooltip, $[9] = t3) : t3 = $[9], react.useEffect(t2, t3);
4188
+ }, [isInsideGroup, showTooltip]);
4888
4189
  }
4889
4190
  const StyledHotkeys = styledComponents.styled.kbd.withConfig({
4890
4191
  displayName: "StyledHotkeys",
@@ -4893,31 +4194,15 @@ const StyledHotkeys = styledComponents.styled.kbd.withConfig({
4893
4194
  displayName: "Key",
4894
4195
  componentId: "sc-b37mge-1"
4895
4196
  })`&:not([hidden]){display:block;}`, Hotkeys = react.forwardRef(function(props, ref) {
4896
- const $ = reactCompilerRuntime.c(24);
4897
- let fontSize2, keys, padding, radius, restProps, t0;
4898
- $[0] !== props ? ({
4197
+ const {
4899
4198
  fontSize: fontSize2,
4900
4199
  keys,
4901
4200
  padding,
4902
4201
  radius,
4903
- space: t0,
4202
+ space: spaceProp = 0.5,
4904
4203
  ...restProps
4905
- } = props, $[0] = props, $[1] = fontSize2, $[2] = keys, $[3] = padding, $[4] = radius, $[5] = restProps, $[6] = t0) : (fontSize2 = $[1], keys = $[2], padding = $[3], radius = $[4], restProps = $[5], t0 = $[6]);
4906
- const space = useArrayProp(t0 === void 0 ? 0.5 : t0);
4907
- if (!keys || keys.length === 0) {
4908
- let t12;
4909
- return $[7] === Symbol.for("react.memo_cache_sentinel") ? (t12 = /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, {}), $[7] = t12) : t12 = $[7], t12;
4910
- }
4911
- let t1;
4912
- if ($[8] !== fontSize2 || $[9] !== keys || $[10] !== padding || $[11] !== radius) {
4913
- let t22;
4914
- $[13] !== fontSize2 || $[14] !== padding || $[15] !== radius ? (t22 = (key2, i) => /* @__PURE__ */ jsxRuntime.jsx(Key, { fontSize: fontSize2, padding, radius, children: key2 }, i), $[13] = fontSize2, $[14] = padding, $[15] = radius, $[16] = t22) : t22 = $[16], t1 = keys.map(t22), $[8] = fontSize2, $[9] = keys, $[10] = padding, $[11] = radius, $[12] = t1;
4915
- } else
4916
- t1 = $[12];
4917
- let t2;
4918
- $[17] !== space || $[18] !== t1 ? (t2 = /* @__PURE__ */ jsxRuntime.jsx(Inline, { as: "span", space, children: t1 }), $[17] = space, $[18] = t1, $[19] = t2) : t2 = $[19];
4919
- let t3;
4920
- return $[20] !== ref || $[21] !== restProps || $[22] !== t2 ? (t3 = /* @__PURE__ */ jsxRuntime.jsx(StyledHotkeys, { "data-ui": "Hotkeys", ...restProps, ref, children: t2 }), $[20] = ref, $[21] = restProps, $[22] = t2, $[23] = t3) : t3 = $[23], t3;
4204
+ } = props, space = _getArrayProp(spaceProp);
4205
+ return !keys || keys.length === 0 ? /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, {}) : /* @__PURE__ */ jsxRuntime.jsx(StyledHotkeys, { "data-ui": "Hotkeys", ...restProps, ref, children: /* @__PURE__ */ jsxRuntime.jsx(Inline, { as: "span", space, children: keys.map((key2, i) => /* @__PURE__ */ jsxRuntime.jsx(Key, { fontSize: fontSize2, padding, radius, children: key2 }, i)) }) });
4921
4206
  });
4922
4207
  Hotkeys.displayName = "ForwardRef(Hotkeys)";
4923
4208
  const MenuContext = createGlobalScopedContext("@sanity/ui/context/menu", null);
@@ -4958,24 +4243,16 @@ function _sortElements(rootElement, elements) {
4958
4243
  elements.sort(_sort);
4959
4244
  }
4960
4245
  function useMenuController(props) {
4961
- const $ = reactCompilerRuntime.c(21), {
4246
+ const {
4962
4247
  onKeyDown,
4963
4248
  originElement,
4964
4249
  shouldFocus,
4965
4250
  rootElementRef
4966
- } = props;
4967
- let t0;
4968
- $[0] === Symbol.for("react.memo_cache_sentinel") ? (t0 = [], $[0] = t0) : t0 = $[0];
4969
- const elementsRef = react.useRef(t0), [activeIndex, _setActiveIndex] = react.useState(-1), activeIndexRef = react.useRef(activeIndex), [activeElement, setActiveElement] = react.useState(null);
4970
- let t1;
4971
- $[1] === Symbol.for("react.memo_cache_sentinel") ? (t1 = (nextActiveIndex) => {
4251
+ } = props, elementsRef = react.useRef([]), [activeIndex, _setActiveIndex] = react.useState(-1), activeIndexRef = react.useRef(activeIndex), [activeElement, setActiveElement] = react.useState(null), setActiveIndex = react.useCallback((nextActiveIndex) => {
4972
4252
  _setActiveIndex(nextActiveIndex), activeIndexRef.current = nextActiveIndex, setActiveElement(elementsRef.current[nextActiveIndex] || null);
4973
- }, $[1] = t1) : t1 = $[1];
4974
- const setActiveIndex = t1;
4975
- let t2;
4976
- $[2] !== rootElementRef ? (t2 = (element, selected) => {
4977
- if (!element)
4978
- return _temp$1;
4253
+ }, []), mount = react.useCallback((element, selected) => {
4254
+ if (!element) return () => {
4255
+ };
4979
4256
  if (elementsRef.current.indexOf(element) === -1 && (elementsRef.current.push(element), _sortElements(rootElementRef.current, elementsRef.current)), selected) {
4980
4257
  const selectedIndex = elementsRef.current.indexOf(element);
4981
4258
  setActiveIndex(selectedIndex);
@@ -4984,10 +4261,7 @@ function useMenuController(props) {
4984
4261
  const idx = elementsRef.current.indexOf(element);
4985
4262
  idx > -1 && elementsRef.current.splice(idx, 1);
4986
4263
  };
4987
- }, $[2] = rootElementRef, $[3] = t2) : t2 = $[3];
4988
- const mount = t2;
4989
- let t3;
4990
- $[4] !== onKeyDown || $[5] !== originElement ? (t3 = (event) => {
4264
+ }, [rootElementRef, setActiveIndex]), handleKeyDown = react.useCallback((event) => {
4991
4265
  if (event.key === "Tab") {
4992
4266
  originElement && originElement.focus();
4993
4267
  return;
@@ -4995,77 +4269,64 @@ function useMenuController(props) {
4995
4269
  if (event.key === "Home") {
4996
4270
  event.preventDefault(), event.stopPropagation();
4997
4271
  const el = _getFocusableElements(elementsRef.current)[0];
4998
- if (!el)
4999
- return;
4272
+ if (!el) return;
5000
4273
  const currentIndex = elementsRef.current.indexOf(el);
5001
4274
  setActiveIndex(currentIndex);
5002
4275
  return;
5003
4276
  }
5004
4277
  if (event.key === "End") {
5005
4278
  event.preventDefault(), event.stopPropagation();
5006
- const focusableElements_0 = _getFocusableElements(elementsRef.current), el_0 = focusableElements_0[focusableElements_0.length - 1];
5007
- if (!el_0)
5008
- return;
5009
- const currentIndex_0 = elementsRef.current.indexOf(el_0);
5010
- setActiveIndex(currentIndex_0);
4279
+ const focusableElements = _getFocusableElements(elementsRef.current), el = focusableElements[focusableElements.length - 1];
4280
+ if (!el) return;
4281
+ const currentIndex = elementsRef.current.indexOf(el);
4282
+ setActiveIndex(currentIndex);
5011
4283
  return;
5012
4284
  }
5013
4285
  if (event.key === "ArrowUp") {
5014
4286
  event.preventDefault(), event.stopPropagation();
5015
- const focusableElements_1 = _getFocusableElements(elementsRef.current), focusableLen = focusableElements_1.length;
5016
- if (focusableLen === 0)
5017
- return;
4287
+ const focusableElements = _getFocusableElements(elementsRef.current), focusableLen = focusableElements.length;
4288
+ if (focusableLen === 0) return;
5018
4289
  const focusedElement = elementsRef.current[activeIndexRef.current];
5019
- let focusedIndex = focusableElements_1.indexOf(focusedElement);
4290
+ let focusedIndex = focusableElements.indexOf(focusedElement);
5020
4291
  focusedIndex = (focusedIndex - 1 + focusableLen) % focusableLen;
5021
- const el_1 = focusableElements_1[focusedIndex], currentIndex_1 = elementsRef.current.indexOf(el_1);
5022
- setActiveIndex(currentIndex_1);
4292
+ const el = focusableElements[focusedIndex], currentIndex = elementsRef.current.indexOf(el);
4293
+ setActiveIndex(currentIndex);
5023
4294
  return;
5024
4295
  }
5025
4296
  if (event.key === "ArrowDown") {
5026
4297
  event.preventDefault(), event.stopPropagation();
5027
- const focusableElements_2 = _getFocusableElements(elementsRef.current), focusableLen_0 = focusableElements_2.length;
5028
- if (focusableLen_0 === 0)
5029
- return;
5030
- const focusedElement_0 = elementsRef.current[activeIndexRef.current];
5031
- let focusedIndex_0 = focusableElements_2.indexOf(focusedElement_0);
5032
- focusedIndex_0 = (focusedIndex_0 + 1) % focusableLen_0;
5033
- const el_2 = focusableElements_2[focusedIndex_0], currentIndex_2 = elementsRef.current.indexOf(el_2);
5034
- setActiveIndex(currentIndex_2);
4298
+ const focusableElements = _getFocusableElements(elementsRef.current), focusableLen = focusableElements.length;
4299
+ if (focusableLen === 0) return;
4300
+ const focusedElement = elementsRef.current[activeIndexRef.current];
4301
+ let focusedIndex = focusableElements.indexOf(focusedElement);
4302
+ focusedIndex = (focusedIndex + 1) % focusableLen;
4303
+ const el = focusableElements[focusedIndex], currentIndex = elementsRef.current.indexOf(el);
4304
+ setActiveIndex(currentIndex);
5035
4305
  return;
5036
4306
  }
5037
4307
  onKeyDown && onKeyDown(event);
5038
- }, $[4] = onKeyDown, $[5] = originElement, $[6] = t3) : t3 = $[6];
5039
- const handleKeyDown = t3;
5040
- let t4;
5041
- $[7] === Symbol.for("react.memo_cache_sentinel") ? (t4 = (event_0) => {
5042
- const element_0 = event_0.currentTarget, currentIndex_3 = elementsRef.current.indexOf(element_0);
5043
- setActiveIndex(currentIndex_3);
5044
- }, $[7] = t4) : t4 = $[7];
5045
- const handleItemMouseEnter = t4;
5046
- let t5;
5047
- $[8] !== rootElementRef ? (t5 = () => {
4308
+ }, [onKeyDown, originElement, setActiveIndex]), handleItemMouseEnter = react.useCallback((event) => {
4309
+ const element = event.currentTarget, currentIndex = elementsRef.current.indexOf(element);
4310
+ setActiveIndex(currentIndex);
4311
+ }, [setActiveIndex]), handleItemMouseLeave = react.useCallback(() => {
5048
4312
  setActiveIndex(-2), rootElementRef.current?.focus();
5049
- }, $[8] = rootElementRef, $[9] = t5) : t5 = $[9];
5050
- const handleItemMouseLeave = t5;
5051
- let t6, t7;
5052
- $[10] !== activeIndex || $[11] !== rootElementRef || $[12] !== shouldFocus ? (t6 = () => {
5053
- if (!rootElementRef.current)
5054
- return;
4313
+ }, [rootElementRef, setActiveIndex]);
4314
+ return react.useEffect(() => {
4315
+ if (!rootElementRef.current) return;
5055
4316
  const rafId = requestAnimationFrame(() => {
5056
4317
  if (activeIndex === -1) {
5057
4318
  if (shouldFocus === "first") {
5058
- const el_3 = _getFocusableElements(elementsRef.current)[0];
5059
- if (el_3) {
5060
- const currentIndex_4 = elementsRef.current.indexOf(el_3);
5061
- setActiveIndex(currentIndex_4);
4319
+ const el = _getFocusableElements(elementsRef.current)[0];
4320
+ if (el) {
4321
+ const currentIndex = elementsRef.current.indexOf(el);
4322
+ setActiveIndex(currentIndex);
5062
4323
  }
5063
4324
  }
5064
4325
  if (shouldFocus === "last") {
5065
- const focusableElements_4 = _getFocusableElements(elementsRef.current), el_4 = focusableElements_4[focusableElements_4.length - 1];
5066
- if (el_4) {
5067
- const currentIndex_5 = elementsRef.current.indexOf(el_4);
5068
- setActiveIndex(currentIndex_5);
4326
+ const focusableElements = _getFocusableElements(elementsRef.current), el = focusableElements[focusableElements.length - 1];
4327
+ if (el) {
4328
+ const currentIndex = elementsRef.current.indexOf(el);
4329
+ setActiveIndex(currentIndex);
5069
4330
  }
5070
4331
  }
5071
4332
  return;
@@ -5073,83 +4334,61 @@ function useMenuController(props) {
5073
4334
  (elementsRef.current[activeIndex] || null)?.focus();
5074
4335
  });
5075
4336
  return () => cancelAnimationFrame(rafId);
5076
- }, t7 = [activeIndex, rootElementRef, setActiveIndex, shouldFocus], $[10] = activeIndex, $[11] = rootElementRef, $[12] = shouldFocus, $[13] = t6, $[14] = t7) : (t6 = $[13], t7 = $[14]), react.useEffect(t6, t7);
5077
- let t8;
5078
- return $[15] !== activeElement || $[16] !== activeIndex || $[17] !== handleItemMouseLeave || $[18] !== handleKeyDown || $[19] !== mount ? (t8 = {
4337
+ }, [activeIndex, rootElementRef, setActiveIndex, shouldFocus]), {
5079
4338
  activeElement,
5080
4339
  activeIndex,
5081
4340
  handleItemMouseEnter,
5082
4341
  handleItemMouseLeave,
5083
4342
  handleKeyDown,
5084
4343
  mount
5085
- }, $[15] = activeElement, $[16] = activeIndex, $[17] = handleItemMouseLeave, $[18] = handleKeyDown, $[19] = mount, $[20] = t8) : t8 = $[20], t8;
5086
- }
5087
- function _temp$1() {
4344
+ };
5088
4345
  }
5089
4346
  const StyledMenu = styledComponents.styled(Box).withConfig({
5090
4347
  displayName: "StyledMenu",
5091
4348
  componentId: "sc-xt0tnv-0"
5092
4349
  })`outline:none;overflow:auto;`, Menu = react.forwardRef(function(props, forwardedRef) {
5093
- const $ = reactCompilerRuntime.c(49);
5094
- let _shouldFocus, children, onClickOutside, onEscape, onItemClick, onItemSelect, onKeyDown, originElement, registerElement, restProps, t0, t1;
5095
- if ($[0] !== props) {
5096
- const {
5097
- children: t22,
5098
- focusFirst,
5099
- focusLast,
5100
- onClickOutside: t32,
5101
- onEscape: t42,
5102
- onItemClick: t52,
5103
- onItemSelect: t62,
5104
- onKeyDown: t72,
5105
- originElement: t82,
5106
- padding: t92,
5107
- registerElement: t102,
5108
- shouldFocus: t112,
5109
- space: t122,
5110
- ...t13
5111
- } = props;
5112
- children = t22, onClickOutside = t32, onEscape = t42, onItemClick = t52, onItemSelect = t62, onKeyDown = t72, originElement = t82, t0 = t92, registerElement = t102, _shouldFocus = t112, t1 = t122, restProps = t13, $[0] = props, $[1] = _shouldFocus, $[2] = children, $[3] = onClickOutside, $[4] = onEscape, $[5] = onItemClick, $[6] = onItemSelect, $[7] = onKeyDown, $[8] = originElement, $[9] = registerElement, $[10] = restProps, $[11] = t0, $[12] = t1;
5113
- } else
5114
- _shouldFocus = $[1], children = $[2], onClickOutside = $[3], onEscape = $[4], onItemClick = $[5], onItemSelect = $[6], onKeyDown = $[7], originElement = $[8], registerElement = $[9], restProps = $[10], t0 = $[11], t1 = $[12];
5115
- const padding = t0 === void 0 ? 1 : t0, space = t1 === void 0 ? 1 : t1, shouldFocus = _shouldFocus ?? (props.focusFirst && "first" || props.focusLast && "last" || null), ref = react.useRef(null);
5116
- let t2;
5117
- $[13] === Symbol.for("react.memo_cache_sentinel") ? (t2 = () => ref.current, $[13] = t2) : t2 = $[13], react.useImperativeHandle(forwardedRef, t2);
5118
4350
  const {
5119
- isTopLayer
5120
- } = useLayer();
5121
- let t3;
5122
- $[14] !== onKeyDown || $[15] !== originElement || $[16] !== shouldFocus ? (t3 = {
4351
+ children,
4352
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
4353
+ focusFirst,
4354
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
4355
+ focusLast,
4356
+ onClickOutside,
4357
+ onEscape,
4358
+ onItemClick,
4359
+ onItemSelect,
5123
4360
  onKeyDown,
5124
4361
  originElement,
5125
- shouldFocus,
5126
- rootElementRef: ref
5127
- }, $[14] = onKeyDown, $[15] = originElement, $[16] = shouldFocus, $[17] = t3) : t3 = $[17];
4362
+ padding = 1,
4363
+ registerElement,
4364
+ shouldFocus: _shouldFocus,
4365
+ space = 1,
4366
+ ...restProps
4367
+ } = props, shouldFocus = _shouldFocus ?? (props.focusFirst && "first" || props.focusLast && "last" || null), ref = react.useRef(null);
4368
+ react.useImperativeHandle(forwardedRef, () => ref.current);
5128
4369
  const {
4370
+ isTopLayer
4371
+ } = useLayer(), {
5129
4372
  activeElement,
5130
4373
  activeIndex,
5131
4374
  handleItemMouseEnter,
5132
4375
  handleItemMouseLeave,
5133
4376
  handleKeyDown,
5134
4377
  mount
5135
- } = useMenuController(t3), unregisterElementRef = react.useRef(null);
5136
- let t4;
5137
- $[18] !== registerElement ? (t4 = (el) => {
4378
+ } = useMenuController({
4379
+ onKeyDown,
4380
+ originElement,
4381
+ shouldFocus,
4382
+ rootElementRef: ref
4383
+ }), unregisterElementRef = react.useRef(null), handleRefChange = react.useCallback((el) => {
5138
4384
  unregisterElementRef.current && (unregisterElementRef.current(), unregisterElementRef.current = null), ref.current = el, ref.current && registerElement && (unregisterElementRef.current = registerElement(ref.current));
5139
- }, $[18] = registerElement, $[19] = t4) : t4 = $[19];
5140
- const handleRefChange = t4;
5141
- let t5, t6;
5142
- $[20] !== activeIndex || $[21] !== onItemSelect ? (t5 = () => {
4385
+ }, [registerElement]);
4386
+ react.useEffect(() => {
5143
4387
  onItemSelect && onItemSelect(activeIndex);
5144
- }, t6 = [activeIndex, onItemSelect], $[20] = activeIndex, $[21] = onItemSelect, $[22] = t5, $[23] = t6) : (t5 = $[22], t6 = $[23]), react.useEffect(t5, t6);
5145
- let t7;
5146
- $[24] === Symbol.for("react.memo_cache_sentinel") ? (t7 = () => [ref.current], $[24] = t7) : t7 = $[24], useClickOutsideEvent(isTopLayer && onClickOutside, t7);
5147
- let t8;
5148
- $[25] !== isTopLayer || $[26] !== onEscape ? (t8 = (event) => {
4388
+ }, [activeIndex, onItemSelect]), useClickOutsideEvent(isTopLayer && onClickOutside, () => [ref.current]), useGlobalKeyDown(react.useCallback((event) => {
5149
4389
  isTopLayer && event.key === "Escape" && (event.stopPropagation(), onEscape && onEscape());
5150
- }, $[25] = isTopLayer, $[26] = onEscape, $[27] = t8) : t8 = $[27], useGlobalKeyDown(t8);
5151
- let t9;
5152
- $[28] !== activeElement || $[29] !== handleItemMouseEnter || $[30] !== handleItemMouseLeave || $[31] !== mount || $[32] !== onClickOutside || $[33] !== onEscape || $[34] !== onItemClick || $[35] !== registerElement ? (t9 = {
4390
+ }, [isTopLayer, onEscape]));
4391
+ const value = react.useMemo(() => ({
5153
4392
  version: 2,
5154
4393
  activeElement,
5155
4394
  mount,
@@ -5159,14 +4398,8 @@ const StyledMenu = styledComponents.styled(Box).withConfig({
5159
4398
  onItemMouseEnter: handleItemMouseEnter,
5160
4399
  onItemMouseLeave: handleItemMouseLeave,
5161
4400
  registerElement
5162
- }, $[28] = activeElement, $[29] = handleItemMouseEnter, $[30] = handleItemMouseLeave, $[31] = mount, $[32] = onClickOutside, $[33] = onEscape, $[34] = onItemClick, $[35] = registerElement, $[36] = t9) : t9 = $[36];
5163
- const value = t9;
5164
- let t10;
5165
- $[37] !== children || $[38] !== space ? (t10 = /* @__PURE__ */ jsxRuntime.jsx(Stack, { space, children }), $[37] = children, $[38] = space, $[39] = t10) : t10 = $[39];
5166
- let t11;
5167
- $[40] !== handleKeyDown || $[41] !== handleRefChange || $[42] !== padding || $[43] !== restProps || $[44] !== t10 ? (t11 = /* @__PURE__ */ jsxRuntime.jsx(StyledMenu, { "data-ui": "Menu", ...restProps, onKeyDown: handleKeyDown, padding, ref: handleRefChange, role: "menu", tabIndex: -1, children: t10 }), $[40] = handleKeyDown, $[41] = handleRefChange, $[42] = padding, $[43] = restProps, $[44] = t10, $[45] = t11) : t11 = $[45];
5168
- let t12;
5169
- return $[46] !== t11 || $[47] !== value ? (t12 = /* @__PURE__ */ jsxRuntime.jsx(MenuContext.Provider, { value, children: t11 }), $[46] = t11, $[47] = value, $[48] = t12) : t12 = $[48], t12;
4401
+ }), [activeElement, mount, handleItemMouseEnter, handleItemMouseLeave, onClickOutside, onEscape, onItemClick, registerElement]);
4402
+ return /* @__PURE__ */ jsxRuntime.jsx(MenuContext.Provider, { value, children: /* @__PURE__ */ jsxRuntime.jsx(StyledMenu, { "data-ui": "Menu", ...restProps, onKeyDown: handleKeyDown, padding, ref: handleRefChange, role: "menu", tabIndex: -1, children: /* @__PURE__ */ jsxRuntime.jsx(Stack, { space, children }) }) });
5170
4403
  });
5171
4404
  Menu.displayName = "ForwardRef(Menu)";
5172
4405
  const MenuDivider = styledComponents.styled.hr.withConfig({
@@ -5288,24 +4521,21 @@ function useMenu() {
5288
4521
  return value;
5289
4522
  }
5290
4523
  function MenuGroup(props) {
5291
- const $ = reactCompilerRuntime.c(79);
5292
- let IconComponent, children, menuProps, onClick, popover, restProps, t0, t1, t2, t3, t4, t5, text;
5293
- $[0] !== props ? ({
5294
- as: t0,
4524
+ const {
4525
+ as = "button",
5295
4526
  children,
5296
- fontSize: t1,
4527
+ fontSize: fontSize2 = 1,
5297
4528
  icon: IconComponent,
5298
4529
  menu: menuProps,
5299
4530
  onClick,
5300
- padding: t2,
4531
+ padding = 3,
5301
4532
  popover,
5302
- radius: t3,
5303
- space: t4,
4533
+ radius = 2,
4534
+ space = 3,
5304
4535
  text,
5305
- tone: t5,
4536
+ tone = "default",
5306
4537
  ...restProps
5307
- } = props, $[0] = props, $[1] = IconComponent, $[2] = children, $[3] = menuProps, $[4] = onClick, $[5] = popover, $[6] = restProps, $[7] = t0, $[8] = t1, $[9] = t2, $[10] = t3, $[11] = t4, $[12] = t5, $[13] = text) : (IconComponent = $[1], children = $[2], menuProps = $[3], onClick = $[4], popover = $[5], restProps = $[6], t0 = $[7], t1 = $[8], t2 = $[9], t3 = $[10], t4 = $[11], t5 = $[12], text = $[13]);
5308
- const as = t0 === void 0 ? "button" : t0, fontSize2 = t1 === void 0 ? 1 : t1, padding = t2 === void 0 ? 3 : t2, radius = t3 === void 0 ? 2 : t3, space = t4 === void 0 ? 3 : t4, tone = t5 === void 0 ? "default" : t5, menu = useMenu(), {
4538
+ } = props, menu = useMenu(), {
5309
4539
  scheme
5310
4540
  } = useRootTheme(), {
5311
4541
  activeElement,
@@ -5315,97 +4545,54 @@ function MenuGroup(props) {
5315
4545
  onItemClick,
5316
4546
  onItemMouseEnter: _onItemMouseEnter,
5317
4547
  registerElement
5318
- } = menu, onItemMouseEnter = _onItemMouseEnter ?? menu.onItemMouseEnter, [rootElement, setRootElement] = react.useState(null), [open, setOpen] = react.useState(!1), [shouldFocus, setShouldFocus] = react.useState(null), active = !!activeElement && activeElement === rootElement, [withinMenu, setWithinMenu] = react.useState(!1);
5319
- let t6;
5320
- $[14] !== onItemMouseEnter ? (t6 = (event) => {
4548
+ } = menu, onItemMouseEnter = _onItemMouseEnter ?? menu.onItemMouseEnter, [rootElement, setRootElement] = react.useState(null), [open, setOpen] = react.useState(!1), [shouldFocus, setShouldFocus] = react.useState(null), active = !!activeElement && activeElement === rootElement, [withinMenu, setWithinMenu] = react.useState(!1), handleMouseEnter = react.useCallback((event) => {
5321
4549
  setWithinMenu(!1), onItemMouseEnter(event), setOpen(!0);
5322
- }, $[14] = onItemMouseEnter, $[15] = t6) : t6 = $[15];
5323
- const handleMouseEnter = t6;
5324
- let t7;
5325
- $[16] !== rootElement ? (t7 = (event_0) => {
5326
- event_0.key === "ArrowLeft" && (event_0.stopPropagation(), setOpen(!1), requestAnimationFrame(() => {
4550
+ }, [onItemMouseEnter]), handleMenuKeyDown = react.useCallback((event) => {
4551
+ event.key === "ArrowLeft" && (event.stopPropagation(), setOpen(!1), requestAnimationFrame(() => {
5327
4552
  rootElement?.focus();
5328
4553
  }));
5329
- }, $[16] = rootElement, $[17] = t7) : t7 = $[17];
5330
- const handleMenuKeyDown = t7;
5331
- let t8;
5332
- $[18] !== onClick ? (t8 = (event_1) => {
5333
- onClick?.(event_1), setShouldFocus("first"), setOpen(!0);
5334
- }, $[18] = onClick, $[19] = t8) : t8 = $[19];
5335
- const handleClick = t8;
5336
- let t9;
5337
- $[20] !== onItemClick ? (t9 = () => {
4554
+ }, [rootElement]), handleClick = react.useCallback((event) => {
4555
+ onClick?.(event), setShouldFocus("first"), setOpen(!0);
4556
+ }, [onClick]), handleChildItemClick = react.useCallback(() => {
5338
4557
  setOpen(!1), onItemClick?.();
5339
- }, $[20] = onItemClick, $[21] = t9) : t9 = $[21];
5340
- const handleChildItemClick = t9;
5341
- let t10;
5342
- $[22] === Symbol.for("react.memo_cache_sentinel") ? (t10 = () => setWithinMenu(!0), $[22] = t10) : t10 = $[22];
5343
- const handleMenuMouseEnter = t10;
5344
- let t11, t12;
5345
- $[23] !== mount || $[24] !== rootElement ? (t11 = () => mount(rootElement), t12 = [mount, rootElement], $[23] = mount, $[24] = rootElement, $[25] = t11, $[26] = t12) : (t11 = $[25], t12 = $[26]), react.useEffect(t11, t12);
5346
- let t13, t14;
5347
- $[27] !== active ? (t13 = () => {
4558
+ }, [onItemClick]), handleMenuMouseEnter = react.useCallback(() => setWithinMenu(!0), []);
4559
+ react.useEffect(() => mount(rootElement), [mount, rootElement]), react.useEffect(() => {
5348
4560
  active || setOpen(!1);
5349
- }, t14 = [active], $[27] = active, $[28] = t13, $[29] = t14) : (t13 = $[28], t14 = $[29]), react.useEffect(t13, t14);
5350
- let t15, t16;
5351
- $[30] !== open ? (t15 = () => {
4561
+ }, [active]), react.useEffect(() => {
5352
4562
  open || setWithinMenu(!1);
5353
- }, t16 = [open], $[30] = open, $[31] = t15, $[32] = t16) : (t15 = $[31], t16 = $[32]), react.useEffect(t15, t16);
5354
- let t17, t18;
5355
- $[33] !== shouldFocus ? (t17 = () => {
5356
- if (!shouldFocus)
5357
- return;
4563
+ }, [open]), react.useEffect(() => {
4564
+ if (!shouldFocus) return;
5358
4565
  const rafId = requestAnimationFrame(() => setShouldFocus(null));
5359
4566
  return () => cancelAnimationFrame(rafId);
5360
- }, t18 = [shouldFocus], $[33] = shouldFocus, $[34] = t17, $[35] = t18) : (t17 = $[34], t18 = $[35]), react.useEffect(t17, t18);
5361
- let t19;
5362
- $[36] !== children || $[37] !== handleChildItemClick || $[38] !== handleMenuKeyDown || $[39] !== menuProps || $[40] !== onClickOutside || $[41] !== onEscape || $[42] !== registerElement || $[43] !== shouldFocus ? (t19 = /* @__PURE__ */ jsxRuntime.jsx(Menu, { ...menuProps, onClickOutside, onEscape, onItemClick: handleChildItemClick, onKeyDown: handleMenuKeyDown, onMouseEnter: handleMenuMouseEnter, registerElement, shouldFocus, children }), $[36] = children, $[37] = handleChildItemClick, $[38] = handleMenuKeyDown, $[39] = menuProps, $[40] = onClickOutside, $[41] = onEscape, $[42] = registerElement, $[43] = shouldFocus, $[44] = t19) : t19 = $[44];
5363
- const childMenu = t19;
5364
- let t20;
5365
- $[45] === Symbol.for("react.memo_cache_sentinel") ? (t20 = (event_2) => {
5366
- const target = event_2.currentTarget;
5367
- if (document.activeElement === target && event_2.key === "ArrowRight") {
4567
+ }, [shouldFocus]);
4568
+ const childMenu = /* @__PURE__ */ jsxRuntime.jsx(Menu, { ...menuProps, onClickOutside, onEscape, onItemClick: handleChildItemClick, onKeyDown: handleMenuKeyDown, onMouseEnter: handleMenuMouseEnter, registerElement, shouldFocus, children }), handleKeyDown = react.useCallback((event) => {
4569
+ const target = event.currentTarget;
4570
+ if (document.activeElement === target && event.key === "ArrowRight") {
5368
4571
  setShouldFocus("first"), setOpen(!0), setWithinMenu(!0);
5369
4572
  return;
5370
4573
  }
5371
- }, $[45] = t20) : t20 = $[45];
5372
- const handleKeyDown = t20, t21 = as === "button" ? withinMenu : void 0, t22 = as !== "button" ? withinMenu : void 0, t23 = !withinMenu && active ? "" : void 0, t24 = useArrayProp(radius), t25 = as === "button" ? "button" : void 0;
5373
- let t26;
5374
- $[46] !== IconComponent || $[47] !== fontSize2 ? (t26 = IconComponent && /* @__PURE__ */ jsxRuntime.jsxs(Text, { size: fontSize2, children: [
5375
- react.isValidElement(IconComponent) && IconComponent,
5376
- ReactIs.isValidElementType(IconComponent) && /* @__PURE__ */ jsxRuntime.jsx(IconComponent, {})
5377
- ] }), $[46] = IconComponent, $[47] = fontSize2, $[48] = t26) : t26 = $[48];
5378
- let t27;
5379
- $[49] !== fontSize2 || $[50] !== text ? (t27 = /* @__PURE__ */ jsxRuntime.jsx(Box, { flex: 1, children: /* @__PURE__ */ jsxRuntime.jsx(Text, { size: fontSize2, textOverflow: "ellipsis", weight: "medium", children: text }) }), $[49] = fontSize2, $[50] = text, $[51] = t27) : t27 = $[51];
5380
- let t28;
5381
- $[52] === Symbol.for("react.memo_cache_sentinel") ? (t28 = /* @__PURE__ */ jsxRuntime.jsx(icons.ChevronRightIcon, {}), $[52] = t28) : t28 = $[52];
5382
- let t29;
5383
- $[53] !== fontSize2 ? (t29 = /* @__PURE__ */ jsxRuntime.jsx(Text, { size: fontSize2, children: t28 }), $[53] = fontSize2, $[54] = t29) : t29 = $[54];
5384
- let t30;
5385
- $[55] !== padding || $[56] !== space || $[57] !== t26 || $[58] !== t27 || $[59] !== t29 ? (t30 = /* @__PURE__ */ jsxRuntime.jsxs(Flex, { gap: space, padding, children: [
5386
- t26,
5387
- t27,
5388
- t29
5389
- ] }), $[55] = padding, $[56] = space, $[57] = t26, $[58] = t27, $[59] = t29, $[60] = t30) : t30 = $[60];
5390
- let t31;
5391
- $[61] !== as || $[62] !== handleClick || $[63] !== handleMouseEnter || $[64] !== restProps || $[65] !== scheme || $[66] !== t21 || $[67] !== t22 || $[68] !== t23 || $[69] !== t24 || $[70] !== t25 || $[71] !== t30 || $[72] !== tone ? (t31 = /* @__PURE__ */ jsxRuntime.jsx(Selectable, { "data-as": as, "data-ui": "MenuGroup", forwardedAs: as, ...restProps, "aria-pressed": t21, "data-pressed": t22, "data-selected": t23, $radius: t24, $tone: tone, $scheme: scheme, onClick: handleClick, onKeyDown: handleKeyDown, onMouseEnter: handleMouseEnter, ref: setRootElement, tabIndex: -1, type: t25, children: t30 }), $[61] = as, $[62] = handleClick, $[63] = handleMouseEnter, $[64] = restProps, $[65] = scheme, $[66] = t21, $[67] = t22, $[68] = t23, $[69] = t24, $[70] = t25, $[71] = t30, $[72] = tone, $[73] = t31) : t31 = $[73];
5392
- let t32;
5393
- return $[74] !== childMenu || $[75] !== open || $[76] !== popover || $[77] !== t31 ? (t32 = /* @__PURE__ */ jsxRuntime.jsx(Popover, { ...popover, content: childMenu, "data-ui": "MenuGroup__popover", open, children: t31 }), $[74] = childMenu, $[75] = open, $[76] = popover, $[77] = t31, $[78] = t32) : t32 = $[78], t32;
4574
+ }, []);
4575
+ return /* @__PURE__ */ jsxRuntime.jsx(Popover, { ...popover, content: childMenu, "data-ui": "MenuGroup__popover", open, children: /* @__PURE__ */ jsxRuntime.jsx(Selectable, { "data-as": as, "data-ui": "MenuGroup", forwardedAs: as, ...restProps, "aria-pressed": as === "button" ? withinMenu : void 0, "data-pressed": as !== "button" ? withinMenu : void 0, "data-selected": !withinMenu && active ? "" : void 0, $radius: _getArrayProp(radius), $tone: tone, $scheme: scheme, onClick: handleClick, onKeyDown: handleKeyDown, onMouseEnter: handleMouseEnter, ref: setRootElement, tabIndex: -1, type: as === "button" ? "button" : void 0, children: /* @__PURE__ */ jsxRuntime.jsxs(Flex, { gap: space, padding, children: [
4576
+ IconComponent && /* @__PURE__ */ jsxRuntime.jsxs(Text, { size: fontSize2, children: [
4577
+ react.isValidElement(IconComponent) && IconComponent,
4578
+ ReactIs.isValidElementType(IconComponent) && /* @__PURE__ */ jsxRuntime.jsx(IconComponent, {})
4579
+ ] }),
4580
+ /* @__PURE__ */ jsxRuntime.jsx(Box, { flex: 1, children: /* @__PURE__ */ jsxRuntime.jsx(Text, { size: fontSize2, textOverflow: "ellipsis", weight: "medium", children: text }) }),
4581
+ /* @__PURE__ */ jsxRuntime.jsx(Text, { size: fontSize2, children: /* @__PURE__ */ jsxRuntime.jsx(icons.ChevronRightIcon, {}) })
4582
+ ] }) }) });
5394
4583
  }
5395
4584
  MenuGroup.displayName = "MenuGroup";
5396
4585
  const MenuItem = react.forwardRef(function(props, forwardedRef) {
5397
- const $ = reactCompilerRuntime.c(73);
5398
- let IconComponent, IconRightComponent, children, disabled, hotkeys, onClick, paddingBottom, paddingLeft, paddingRight, paddingTop, paddingX, paddingY, pressed, restProps, selectedProp, t0, t1, t2, t3, t4, t5, text;
5399
- $[0] !== props ? ({
5400
- as: t0,
4586
+ const {
4587
+ as = "button",
5401
4588
  children,
5402
4589
  disabled,
5403
- fontSize: t1,
4590
+ fontSize: fontSize2 = 1,
5404
4591
  hotkeys,
5405
4592
  icon: IconComponent,
5406
4593
  iconRight: IconRightComponent,
5407
4594
  onClick,
5408
- padding: t2,
4595
+ padding = 3,
5409
4596
  paddingX,
5410
4597
  paddingY,
5411
4598
  paddingTop,
@@ -5413,14 +4600,13 @@ const MenuItem = react.forwardRef(function(props, forwardedRef) {
5413
4600
  paddingBottom,
5414
4601
  paddingLeft,
5415
4602
  pressed,
5416
- radius: t3,
4603
+ radius = 2,
5417
4604
  selected: selectedProp,
5418
- space: t4,
4605
+ space = 3,
5419
4606
  text,
5420
- tone: t5,
4607
+ tone = "default",
5421
4608
  ...restProps
5422
- } = props, $[0] = props, $[1] = IconComponent, $[2] = IconRightComponent, $[3] = children, $[4] = disabled, $[5] = hotkeys, $[6] = onClick, $[7] = paddingBottom, $[8] = paddingLeft, $[9] = paddingRight, $[10] = paddingTop, $[11] = paddingX, $[12] = paddingY, $[13] = pressed, $[14] = restProps, $[15] = selectedProp, $[16] = t0, $[17] = t1, $[18] = t2, $[19] = t3, $[20] = t4, $[21] = t5, $[22] = text) : (IconComponent = $[1], IconRightComponent = $[2], children = $[3], disabled = $[4], hotkeys = $[5], onClick = $[6], paddingBottom = $[7], paddingLeft = $[8], paddingRight = $[9], paddingTop = $[10], paddingX = $[11], paddingY = $[12], pressed = $[13], restProps = $[14], selectedProp = $[15], t0 = $[16], t1 = $[17], t2 = $[18], t3 = $[19], t4 = $[20], t5 = $[21], text = $[22]);
5423
- const as = t0 === void 0 ? "button" : t0, fontSize2 = t1 === void 0 ? 1 : t1, padding = t2 === void 0 ? 3 : t2, radius = t3 === void 0 ? 2 : t3, space = t4 === void 0 ? 3 : t4, tone = t5 === void 0 ? "default" : t5, {
4609
+ } = props, {
5424
4610
  scheme
5425
4611
  } = useRootTheme(), menu = useMenu(), {
5426
4612
  activeElement,
@@ -5429,17 +4615,10 @@ const MenuItem = react.forwardRef(function(props, forwardedRef) {
5429
4615
  onItemMouseEnter: _onItemMouseEnter,
5430
4616
  onItemMouseLeave: _onItemMouseLeave
5431
4617
  } = menu, onItemMouseEnter = _onItemMouseEnter ?? menu.onItemMouseEnter, onItemMouseLeave = _onItemMouseLeave ?? menu.onItemMouseLeave, [rootElement, setRootElement] = react.useState(null), active = !!activeElement && activeElement === rootElement, ref = react.useRef(null);
5432
- let t6;
5433
- $[23] === Symbol.for("react.memo_cache_sentinel") ? (t6 = () => ref.current, $[23] = t6) : t6 = $[23], react.useImperativeHandle(forwardedRef, t6);
5434
- let t7, t8;
5435
- $[24] !== mount || $[25] !== rootElement || $[26] !== selectedProp ? (t7 = () => mount(rootElement, selectedProp), t8 = [mount, rootElement, selectedProp], $[24] = mount, $[25] = rootElement, $[26] = selectedProp, $[27] = t7, $[28] = t8) : (t7 = $[27], t8 = $[28]), react.useEffect(t7, t8);
5436
- let t9;
5437
- $[29] !== disabled || $[30] !== onClick || $[31] !== onItemClick ? (t9 = (event) => {
4618
+ react.useImperativeHandle(forwardedRef, () => ref.current), react.useEffect(() => mount(rootElement, selectedProp), [mount, rootElement, selectedProp]);
4619
+ const handleClick = react.useCallback((event) => {
5438
4620
  disabled || (onClick && onClick(event), onItemClick && onItemClick());
5439
- }, $[29] = disabled, $[30] = onClick, $[31] = onItemClick, $[32] = t9) : t9 = $[32];
5440
- const handleClick = t9;
5441
- let t10;
5442
- $[33] !== padding || $[34] !== paddingBottom || $[35] !== paddingLeft || $[36] !== paddingRight || $[37] !== paddingTop || $[38] !== paddingX || $[39] !== paddingY ? (t10 = {
4621
+ }, [disabled, onClick, onItemClick]), paddingProps = react.useMemo(() => ({
5443
4622
  padding,
5444
4623
  paddingX,
5445
4624
  paddingY,
@@ -5447,114 +4626,71 @@ const MenuItem = react.forwardRef(function(props, forwardedRef) {
5447
4626
  paddingRight,
5448
4627
  paddingBottom,
5449
4628
  paddingLeft
5450
- }, $[33] = padding, $[34] = paddingBottom, $[35] = paddingLeft, $[36] = paddingRight, $[37] = paddingTop, $[38] = paddingX, $[39] = paddingY, $[40] = t10) : t10 = $[40];
5451
- const paddingProps = t10, t11 = useArrayProp(fontSize2);
5452
- let t12;
5453
- $[41] !== t11 ? (t12 = t11.map(_temp), $[41] = t11, $[42] = t12) : t12 = $[42];
5454
- const hotkeysFontSize = t12;
5455
- let t13;
5456
- $[43] === Symbol.for("react.memo_cache_sentinel") ? (t13 = (el) => {
4629
+ }), [padding, paddingX, paddingY, paddingTop, paddingRight, paddingBottom, paddingLeft]), hotkeysFontSize = _getArrayProp(fontSize2).map((s) => s - 1), setRef = react.useCallback((el) => {
5457
4630
  ref.current = el, setRootElement(el);
5458
- }, $[43] = t13) : t13 = $[43];
5459
- const setRef = t13, t14 = as !== "button" && pressed ? "" : void 0, t15 = active ? "" : void 0, t16 = disabled ? "" : void 0, t17 = useArrayProp(radius), t18 = useArrayProp(0), t19 = disabled ? "default" : tone, t20 = as === "button" ? "button" : void 0;
5460
- let t21;
5461
- $[44] !== IconComponent || $[45] !== IconRightComponent || $[46] !== fontSize2 || $[47] !== hotkeys || $[48] !== hotkeysFontSize || $[49] !== paddingProps || $[50] !== space || $[51] !== text ? (t21 = (IconComponent || text || IconRightComponent) && /* @__PURE__ */ jsxRuntime.jsxs(Flex, { as: "span", gap: space, align: "center", ...paddingProps, children: [
5462
- IconComponent && /* @__PURE__ */ jsxRuntime.jsxs(Text, { size: fontSize2, children: [
5463
- react.isValidElement(IconComponent) && IconComponent,
5464
- ReactIs.isValidElementType(IconComponent) && /* @__PURE__ */ jsxRuntime.jsx(IconComponent, {})
4631
+ }, []);
4632
+ return /* @__PURE__ */ jsxRuntime.jsxs(Selectable, { "data-ui": "MenuItem", role: "menuitem", ...restProps, "data-pressed": as !== "button" && pressed ? "" : void 0, "data-selected": active ? "" : void 0, "data-disabled": disabled ? "" : void 0, forwardedAs: as, $radius: _getArrayProp(radius), $padding: _getArrayProp(0), $tone: disabled ? "default" : tone, $scheme: scheme, disabled, onClick: handleClick, onMouseEnter: onItemMouseEnter, onMouseLeave: onItemMouseLeave, ref: setRef, tabIndex: -1, type: as === "button" ? "button" : void 0, children: [
4633
+ (IconComponent || text || IconRightComponent) && /* @__PURE__ */ jsxRuntime.jsxs(Flex, { as: "span", gap: space, align: "center", ...paddingProps, children: [
4634
+ IconComponent && /* @__PURE__ */ jsxRuntime.jsxs(Text, { size: fontSize2, children: [
4635
+ react.isValidElement(IconComponent) && IconComponent,
4636
+ ReactIs.isValidElementType(IconComponent) && /* @__PURE__ */ jsxRuntime.jsx(IconComponent, {})
4637
+ ] }),
4638
+ text && /* @__PURE__ */ jsxRuntime.jsx(Box, { flex: 1, children: /* @__PURE__ */ jsxRuntime.jsx(Text, { size: fontSize2, textOverflow: "ellipsis", weight: "medium", children: text }) }),
4639
+ hotkeys && /* @__PURE__ */ jsxRuntime.jsx(Hotkeys, { fontSize: hotkeysFontSize, keys: hotkeys, style: {
4640
+ marginTop: -4,
4641
+ marginBottom: -4
4642
+ } }),
4643
+ IconRightComponent && /* @__PURE__ */ jsxRuntime.jsxs(Text, { size: fontSize2, children: [
4644
+ react.isValidElement(IconRightComponent) && IconRightComponent,
4645
+ ReactIs.isValidElementType(IconRightComponent) && /* @__PURE__ */ jsxRuntime.jsx(IconRightComponent, {})
4646
+ ] })
5465
4647
  ] }),
5466
- text && /* @__PURE__ */ jsxRuntime.jsx(Box, { flex: 1, children: /* @__PURE__ */ jsxRuntime.jsx(Text, { size: fontSize2, textOverflow: "ellipsis", weight: "medium", children: text }) }),
5467
- hotkeys && /* @__PURE__ */ jsxRuntime.jsx(Hotkeys, { fontSize: hotkeysFontSize, keys: hotkeys, style: {
5468
- marginTop: -4,
5469
- marginBottom: -4
5470
- } }),
5471
- IconRightComponent && /* @__PURE__ */ jsxRuntime.jsxs(Text, { size: fontSize2, children: [
5472
- react.isValidElement(IconRightComponent) && IconRightComponent,
5473
- ReactIs.isValidElementType(IconRightComponent) && /* @__PURE__ */ jsxRuntime.jsx(IconRightComponent, {})
5474
- ] })
5475
- ] }), $[44] = IconComponent, $[45] = IconRightComponent, $[46] = fontSize2, $[47] = hotkeys, $[48] = hotkeysFontSize, $[49] = paddingProps, $[50] = space, $[51] = text, $[52] = t21) : t21 = $[52];
5476
- let t22;
5477
- $[53] !== children || $[54] !== paddingProps ? (t22 = children && /* @__PURE__ */ jsxRuntime.jsx(Box, { as: "span", ...paddingProps, children }), $[53] = children, $[54] = paddingProps, $[55] = t22) : t22 = $[55];
5478
- let t23;
5479
- return $[56] !== as || $[57] !== disabled || $[58] !== handleClick || $[59] !== onItemMouseEnter || $[60] !== onItemMouseLeave || $[61] !== restProps || $[62] !== scheme || $[63] !== t14 || $[64] !== t15 || $[65] !== t16 || $[66] !== t17 || $[67] !== t18 || $[68] !== t19 || $[69] !== t20 || $[70] !== t21 || $[71] !== t22 ? (t23 = /* @__PURE__ */ jsxRuntime.jsxs(Selectable, { "data-ui": "MenuItem", role: "menuitem", ...restProps, "data-pressed": t14, "data-selected": t15, "data-disabled": t16, forwardedAs: as, $radius: t17, $padding: t18, $tone: t19, $scheme: scheme, disabled, onClick: handleClick, onMouseEnter: onItemMouseEnter, onMouseLeave: onItemMouseLeave, ref: setRef, tabIndex: -1, type: t20, children: [
5480
- t21,
5481
- t22
5482
- ] }), $[56] = as, $[57] = disabled, $[58] = handleClick, $[59] = onItemMouseEnter, $[60] = onItemMouseLeave, $[61] = restProps, $[62] = scheme, $[63] = t14, $[64] = t15, $[65] = t16, $[66] = t17, $[67] = t18, $[68] = t19, $[69] = t20, $[70] = t21, $[71] = t22, $[72] = t23) : t23 = $[72], t23;
4648
+ children && /* @__PURE__ */ jsxRuntime.jsx(Box, { as: "span", ...paddingProps, children })
4649
+ ] });
5483
4650
  });
5484
4651
  MenuItem.displayName = "ForwardRef(MenuItem)";
5485
- function _temp(s) {
5486
- return s - 1;
5487
- }
5488
4652
  const CustomButton = styledComponents.styled(Button).withConfig({
5489
4653
  displayName: "CustomButton",
5490
4654
  componentId: "sc-1kns779-0"
5491
4655
  })`max-width:100%;`, Tab = react.forwardRef(function(props, forwardedRef) {
5492
- const $ = reactCompilerRuntime.c(30);
5493
- let focused, icon, id, label, onClick, onFocus, restProps, selected, t0, t1;
5494
- $[0] !== props ? ({
4656
+ const {
5495
4657
  icon,
5496
4658
  id,
5497
4659
  focused,
5498
- fontSize: t0,
4660
+ fontSize: fontSize2 = 1,
5499
4661
  label,
5500
4662
  onClick,
5501
4663
  onFocus,
5502
- padding: t1,
4664
+ padding = 2,
5503
4665
  selected,
5504
4666
  ...restProps
5505
- } = props, $[0] = props, $[1] = focused, $[2] = icon, $[3] = id, $[4] = label, $[5] = onClick, $[6] = onFocus, $[7] = restProps, $[8] = selected, $[9] = t0, $[10] = t1) : (focused = $[1], icon = $[2], id = $[3], label = $[4], onClick = $[5], onFocus = $[6], restProps = $[7], selected = $[8], t0 = $[9], t1 = $[10]);
5506
- const fontSize2 = t0 === void 0 ? 1 : t0, padding = t1 === void 0 ? 2 : t1, ref = react.useRef(null), focusedRef = react.useRef(!1);
5507
- let t2;
5508
- $[11] === Symbol.for("react.memo_cache_sentinel") ? (t2 = () => ref.current, $[11] = t2) : t2 = $[11], react.useImperativeHandle(forwardedRef, t2);
5509
- let t3;
5510
- $[12] === Symbol.for("react.memo_cache_sentinel") ? (t3 = () => {
4667
+ } = props, ref = react.useRef(null), focusedRef = react.useRef(!1);
4668
+ react.useImperativeHandle(forwardedRef, () => ref.current);
4669
+ const handleBlur = react.useCallback(() => {
5511
4670
  focusedRef.current = !1;
5512
- }, $[12] = t3) : t3 = $[12];
5513
- const handleBlur = t3;
5514
- let t4;
5515
- $[13] !== onFocus ? (t4 = (event) => {
4671
+ }, []), handleFocus = react.useCallback((event) => {
5516
4672
  focusedRef.current = !0, onFocus && onFocus(event);
5517
- }, $[13] = onFocus, $[14] = t4) : t4 = $[14];
5518
- const handleFocus = t4;
5519
- let t5, t6;
5520
- $[15] !== focused ? (t5 = () => {
4673
+ }, [onFocus]);
4674
+ return react.useEffect(() => {
5521
4675
  focused && !focusedRef.current && (ref.current && ref.current.focus(), focusedRef.current = !0);
5522
- }, t6 = [focused], $[15] = focused, $[16] = t5, $[17] = t6) : (t5 = $[16], t6 = $[17]), react.useEffect(t5, t6);
5523
- const t7 = selected ? "true" : "false", t8 = selected ? 0 : -1;
5524
- let t9;
5525
- return $[18] !== fontSize2 || $[19] !== handleFocus || $[20] !== icon || $[21] !== id || $[22] !== label || $[23] !== onClick || $[24] !== padding || $[25] !== restProps || $[26] !== selected || $[27] !== t7 || $[28] !== t8 ? (t9 = /* @__PURE__ */ jsxRuntime.jsx(CustomButton, { "data-ui": "Tab", ...restProps, "aria-selected": t7, fontSize: fontSize2, icon, id, mode: "bleed", onClick, onBlur: handleBlur, onFocus: handleFocus, padding, ref, role: "tab", selected, tabIndex: t8, text: label, type: "button" }), $[18] = fontSize2, $[19] = handleFocus, $[20] = icon, $[21] = id, $[22] = label, $[23] = onClick, $[24] = padding, $[25] = restProps, $[26] = selected, $[27] = t7, $[28] = t8, $[29] = t9) : t9 = $[29], t9;
4676
+ }, [focused]), /* @__PURE__ */ jsxRuntime.jsx(CustomButton, { "data-ui": "Tab", ...restProps, "aria-selected": selected ? "true" : "false", fontSize: fontSize2, icon, id, mode: "bleed", onClick, onBlur: handleBlur, onFocus: handleFocus, padding, ref, role: "tab", selected, tabIndex: selected ? 0 : -1, text: label, type: "button" });
5526
4677
  });
5527
4678
  Tab.displayName = "ForwardRef(Tab)";
5528
4679
  const CustomInline = styledComponents.styled(Inline).withConfig({
5529
4680
  displayName: "CustomInline",
5530
4681
  componentId: "sc-5cm04m-0"
5531
4682
  })`& > div{display:inline-block;vertical-align:middle;max-width:100%;box-sizing:border-box;}`, TabList = react.forwardRef(function(props, ref) {
5532
- const $ = reactCompilerRuntime.c(15);
5533
- let childrenProp, restProps;
5534
- $[0] !== props ? ({
4683
+ const {
5535
4684
  children: childrenProp,
5536
4685
  ...restProps
5537
- } = props, $[0] = props, $[1] = childrenProp, $[2] = restProps) : (childrenProp = $[1], restProps = $[2]);
5538
- const [focusedIndex, setFocusedIndex] = react.useState(-1);
5539
- let t0;
5540
- if ($[3] !== childrenProp || $[4] !== focusedIndex) {
5541
- const children = react.Children.toArray(childrenProp).filter(react.isValidElement);
5542
- let t12;
5543
- $[6] !== focusedIndex ? (t12 = (child, childIndex) => react.cloneElement(child, {
5544
- focused: focusedIndex === childIndex,
5545
- key: childIndex,
5546
- onFocus: () => setFocusedIndex(childIndex)
5547
- }), $[6] = focusedIndex, $[7] = t12) : t12 = $[7], t0 = children.map(t12), $[3] = childrenProp, $[4] = focusedIndex, $[5] = t0;
5548
- } else
5549
- t0 = $[5];
5550
- const tabs = t0, numTabs = tabs.length;
5551
- let t1;
5552
- $[8] !== numTabs ? (t1 = (event) => {
5553
- event.key === "ArrowLeft" && setFocusedIndex((prevIndex) => (prevIndex + numTabs - 1) % numTabs), event.key === "ArrowRight" && setFocusedIndex((prevIndex_0) => (prevIndex_0 + 1) % numTabs);
5554
- }, $[8] = numTabs, $[9] = t1) : t1 = $[9];
5555
- const handleKeyDown = t1;
5556
- let t2;
5557
- return $[10] !== handleKeyDown || $[11] !== ref || $[12] !== restProps || $[13] !== tabs ? (t2 = /* @__PURE__ */ jsxRuntime.jsx(CustomInline, { "data-ui": "TabList", ...restProps, onKeyDown: handleKeyDown, ref, role: "tablist", children: tabs }), $[10] = handleKeyDown, $[11] = ref, $[12] = restProps, $[13] = tabs, $[14] = t2) : t2 = $[14], t2;
4686
+ } = props, [focusedIndex, setFocusedIndex] = react.useState(-1), tabs = react.Children.toArray(childrenProp).filter(react.isValidElement).map((child, childIndex) => react.cloneElement(child, {
4687
+ focused: focusedIndex === childIndex,
4688
+ key: childIndex,
4689
+ onFocus: () => setFocusedIndex(childIndex)
4690
+ })), numTabs = tabs.length, handleKeyDown = react.useCallback((event) => {
4691
+ event.key === "ArrowLeft" && setFocusedIndex((prevIndex) => (prevIndex + numTabs - 1) % numTabs), event.key === "ArrowRight" && setFocusedIndex((prevIndex) => (prevIndex + 1) % numTabs);
4692
+ }, [numTabs]);
4693
+ return /* @__PURE__ */ jsxRuntime.jsx(CustomInline, { "data-ui": "TabList", ...restProps, onKeyDown: handleKeyDown, ref, role: "tablist", children: tabs });
5558
4694
  });
5559
4695
  TabList.displayName = "ForwardRef(TabList)";
5560
4696
  exports.Arrow = Arrow;
@@ -5642,7 +4778,6 @@ exports.rgbToHsl = rgbToHsl;
5642
4778
  exports.rgba = rgba;
5643
4779
  exports.screen = screen;
5644
4780
  exports.studioTheme = studioTheme;
5645
- exports.useArrayProp = useArrayProp;
5646
4781
  exports.useBoundaryElement = useBoundaryElement;
5647
4782
  exports.useClickOutsideEvent = useClickOutsideEvent;
5648
4783
  exports.useCustomValidity = useCustomValidity;