@marimo-team/islands 0.17.8 → 0.18.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 (53) hide show
  1. package/dist/{Combination-BH_L276x.js → Combination-D68fi0fY.js} +22 -21
  2. package/dist/{ConnectedDataExplorerComponent-WbiFXhKG.js → ConnectedDataExplorerComponent-BUgUSo2B.js} +7 -7
  3. package/dist/{any-language-editor-YPQMljy9.js → any-language-editor-BS-Z5AY5.js} +3 -3
  4. package/dist/assets/__vite-browser-external-CSegkGa0.js +1 -0
  5. package/dist/assets/{worker-BrDpRi2I.js → worker-CiT2i-Vo.js} +2 -2
  6. package/dist/{error-banner-BqE1uF21.js → error-banner-CPLhCPHA.js} +24 -24
  7. package/dist/{esm-hR1r0nyt.js → esm-DxgKy8Wv.js} +1 -1
  8. package/dist/{formats-dvT8nDgH.js → formats-oddMfm9_.js} +27 -7
  9. package/dist/{glide-data-editor-B26PhZvE.js → glide-data-editor-BFv4VQnc.js} +4 -4
  10. package/dist/{label-D3LNCORf.js → label-Dsm6T1fr.js} +72 -72
  11. package/dist/main.js +359 -250
  12. package/dist/{mermaid-Dl3ywmV2.js → mermaid-BeGlg1JH.js} +2 -2
  13. package/dist/{react-vega-ypEMYp9o.js → react-vega-DDXWt_PN.js} +852 -1544
  14. package/dist/{react-vega-BIDT9Ttp.js → react-vega-DV2IwPx_.js} +1 -1
  15. package/dist/{spec-qDDGe5hl.js → spec-BotzCMo3.js} +2 -2
  16. package/dist/style.css +1 -1
  17. package/dist/{types-2eTEqSwS.js → types-IRrkdH-H.js} +14 -14
  18. package/dist/{useAsyncData-6gisQ4pR.js → useAsyncData-CsSW6_Zh.js} +1 -1
  19. package/dist/{useTheme-B-2frT0L.js → useTheme-D56Xlrez.js} +1 -0
  20. package/dist/{vega-component-C-bCSv1b.js → vega-component-CLjz4see.js} +6 -6
  21. package/package.json +2 -2
  22. package/src/components/chat/chat-panel.tsx +6 -2
  23. package/src/components/data-table/TableActions.tsx +18 -14
  24. package/src/components/data-table/data-table.tsx +3 -0
  25. package/src/components/editor/chrome/panels/packages-panel.tsx +3 -1
  26. package/src/components/editor/file-tree/__tests__/file-expolorer.test.ts +178 -0
  27. package/src/components/editor/file-tree/file-explorer.tsx +70 -1
  28. package/src/components/pages/home-page.tsx +8 -3
  29. package/src/core/ai/tools/__tests__/registry.test.ts +6 -2
  30. package/src/core/ai/tools/registry.ts +5 -2
  31. package/src/core/cells/__tests__/session.test.ts +0 -9
  32. package/src/core/cells/session.ts +0 -1
  33. package/src/core/codemirror/copilot/client.ts +21 -1
  34. package/src/core/codemirror/copilot/copilot-config.tsx +29 -1
  35. package/src/core/config/__tests__/config-schema.test.ts +2 -0
  36. package/src/core/config/config-schema.ts +1 -0
  37. package/src/core/packages/__tests__/package-input-utils.test.ts +93 -0
  38. package/src/core/packages/package-input-utils.ts +36 -0
  39. package/src/css/md.css +5 -0
  40. package/src/plugins/core/__test__/sanitize.test.ts +1 -1
  41. package/src/plugins/core/sanitize.ts +3 -1
  42. package/src/plugins/impl/DataTablePlugin.tsx +10 -1
  43. package/src/plugins/impl/chat/ChatPlugin.tsx +1 -0
  44. package/src/plugins/impl/chat/chat-ui.tsx +140 -10
  45. package/src/plugins/impl/data-frames/DataFramePlugin.tsx +1 -0
  46. package/src/plugins/layout/NavigationMenuPlugin.tsx +14 -3
  47. package/src/plugins/layout/ProgressPlugin.tsx +8 -5
  48. package/src/plugins/layout/StatPlugin.tsx +11 -4
  49. package/src/plugins/layout/__test__/ProgressPlugin.test.ts +37 -21
  50. package/src/utils/__tests__/urls.test.ts +165 -1
  51. package/src/utils/urls.ts +120 -0
  52. package/src/utils/vitals.ts +1 -1
  53. package/dist/assets/__vite-browser-external-BTNiCQ6O.js +0 -1
@@ -8,7 +8,7 @@ import { t as createLucideIcon } from "./createLucideIcon-ixdBmsqu.js";
8
8
  import { d as cn, r as cva } from "./button-Hye6-2X8.js";
9
9
  import { s as Logger } from "./hotkeys-C3KM59Ph.js";
10
10
  import { t as require_jsx_runtime } from "./jsx-runtime-Duz3IlLt.js";
11
- import { b as atom, f as isIslands, l as store } from "./useTheme-B-2frT0L.js";
11
+ import { b as atom, f as isIslands, l as store } from "./useTheme-D56Xlrez.js";
12
12
  import { n as KnownQueryParams } from "./constants-CN19buVX.js";
13
13
  import { i as tableFromIPC } from "./loader-BCInj1Mf.js";
14
14
  var CircleQuestionMark = createLucideIcon("circle-question-mark", [
@@ -424,6 +424,25 @@ var urlRegex = /^(https?:\/\/\S+)$/;
424
424
  function isUrl(e) {
425
425
  return typeof e == "string" && urlRegex.test(e);
426
426
  }
427
+ function appendQueryParams({ href: e, queryParams: x, keys: S }) {
428
+ let C = typeof x == "string" ? new URLSearchParams(x) : x;
429
+ if (C.size === 0 || e.startsWith("http://") || e.startsWith("https://")) return e;
430
+ let w = e.startsWith("#"), T = w && e.includes("?");
431
+ if (w && !T) {
432
+ let x2 = S ? [...C.entries()].filter(([e2]) => S.includes(e2)) : [...C.entries()], w2 = new URLSearchParams();
433
+ for (let [e2, S2] of x2) w2.set(e2, S2);
434
+ let T2 = w2.toString();
435
+ return T2 ? `/?${T2}${e}` : e;
436
+ }
437
+ let E = e, D = "", O = new URLSearchParams(), k = w ? 1 : 0, A = e.indexOf("#", k);
438
+ A !== -1 && (D = e.slice(A), E = e.slice(0, A));
439
+ let j = E.indexOf("?");
440
+ j !== -1 && (O = new URLSearchParams(E.slice(j + 1)), E = E.slice(0, j));
441
+ let M = new URLSearchParams(O), N = S ? [...C.entries()].filter(([e2]) => S.includes(e2)) : [...C.entries()];
442
+ for (let [e2, x2] of N) M.set(e2, x2);
443
+ let P = M.toString();
444
+ return P ? `${E}?${P}${D}` : e;
445
+ }
427
446
  var createId = (0, (/* @__PURE__ */ __toESM(require_cuid2(), 1)).init)({ length: 6 });
428
447
  function generateSessionId() {
429
448
  return `s_${createId()}`;
@@ -682,10 +701,11 @@ function decodeIPC(e, x) {
682
701
  return tableFromIPC(e, x ?? { useProxy: true });
683
702
  }
684
703
  export {
685
- CircleQuestionMark as S,
686
- isUrl as _,
704
+ CircleQuestionMark as C,
705
+ isWasm as S,
706
+ appendQueryParams as _,
687
707
  AlertDescription as a,
688
- Deferred as b,
708
+ isStaticNotebook as b,
689
709
  toDate as c,
690
710
  millisecondsInHour as d,
691
711
  millisecondsInMinute as f,
@@ -701,7 +721,7 @@ export {
701
721
  isValid as s,
702
722
  arrow as t,
703
723
  millisecondsInDay as u,
704
- require_cuid2 as v,
705
- isWasm as x,
706
- isStaticNotebook as y
724
+ isUrl as v,
725
+ Deferred as x,
726
+ require_cuid2 as y
707
727
  };
@@ -7,16 +7,16 @@ import { t as require_compiler_runtime } from "./compiler-runtime-DTozApu4.js";
7
7
  import { n as toast, t as copyToClipboard } from "./copy-BeueJfCy.js";
8
8
  import "./createLucideIcon-ixdBmsqu.js";
9
9
  import "./check-DvmFwGOM.js";
10
- import { T as useOnMount, a as SelectItem, c as SelectTrigger, k as logNever, l as SelectValue, n as Select, r as SelectContent, t as Label } from "./label-D3LNCORf.js";
11
- import { S as DropdownMenuSubTrigger, X as capitalize_default, Xt as Pencil, Y as useNonce, Yt as Plus, a as Input, b as DropdownMenuSub, g as DropdownMenuItem, m as DropdownMenuContent, n as ErrorBoundary, p as DropdownMenu, qt as Trash, t as BulkEdit, v as DropdownMenuPortal, x as DropdownMenuSubContent, y as DropdownMenuSeparator } from "./types-2eTEqSwS.js";
10
+ import { T as useOnMount, a as SelectItem, c as SelectTrigger, k as logNever, l as SelectValue, n as Select, r as SelectContent, t as Label } from "./label-Dsm6T1fr.js";
11
+ import { S as DropdownMenuSubTrigger, X as capitalize_default, Xt as Pencil, Y as useNonce, Yt as Plus, a as Input, b as DropdownMenuSub, g as DropdownMenuItem, m as DropdownMenuContent, n as ErrorBoundary, p as DropdownMenu, qt as Trash, t as BulkEdit, v as DropdownMenuPortal, x as DropdownMenuSubContent, y as DropdownMenuSeparator } from "./types-IRrkdH-H.js";
12
12
  import { t as Copy } from "./copy-B9QnP3Mi.js";
13
13
  import "./clsx-JH8KOlt9.js";
14
14
  import { t as Button, u as Events } from "./button-Hye6-2X8.js";
15
15
  import { s as Logger } from "./hotkeys-C3KM59Ph.js";
16
- import "./Combination-BH_L276x.js";
16
+ import "./Combination-D68fi0fY.js";
17
17
  import { t as require_jsx_runtime } from "./jsx-runtime-Duz3IlLt.js";
18
18
  import "./react-dom-DBPBYhx0.js";
19
- import { m as useEvent_default, t as useTheme } from "./useTheme-B-2frT0L.js";
19
+ import { m as useEvent_default, t as useTheme } from "./useTheme-D56Xlrez.js";
20
20
  import "./isArrayLikeObject-LulrZoeO.js";
21
21
  import "./isSymbol-bQx0U8Lk.js";
22
22
  import "./toString-MxUAFb1C.js";
@@ -5,7 +5,7 @@ import { t as createLucideIcon } from "./createLucideIcon-ixdBmsqu.js";
5
5
  import { t as Check } from "./check-DvmFwGOM.js";
6
6
  import { d as cn, l as useComposedRefs, o as createSlot, r as cva, u as Events } from "./button-Hye6-2X8.js";
7
7
  import { s as Logger } from "./hotkeys-C3KM59Ph.js";
8
- import { C as DismissableLayer, O as createContextScope, S as useLayoutEffect2, T as Primitive, _ as Content, c as withSmartCollisionBoundary, d as VISUALLY_HIDDEN_STYLES, f as useControllableState, g as Arrow, h as Anchor, i as useFocusGuards, k as composeEventHandlers, l as StyleNamespace, m as Portal, n as hideOthers, r as FocusScope, s as withFullScreenAsRoot, t as Combination_default, v as Root2$1, w as useCallbackRef, x as useId, y as createPopperScope } from "./Combination-BH_L276x.js";
8
+ import { A as composeEventHandlers, C as useLayoutEffect2, E as Primitive, S as useId, T as useCallbackRef, _ as Arrow, b as createPopperScope, c as withSmartCollisionBoundary, f as VISUALLY_HIDDEN_STYLES, g as Anchor, h as Portal, i as useFocusGuards, k as createContextScope, n as hideOthers, p as useControllableState, r as FocusScope, s as withFullScreenAsRoot, t as Combination_default, u as StyleNamespace, v as Content, w as DismissableLayer, y as Root2$1 } from "./Combination-D68fi0fY.js";
9
9
  import { t as require_jsx_runtime } from "./jsx-runtime-Duz3IlLt.js";
10
10
  import { t as require_react_dom } from "./react-dom-DBPBYhx0.js";
11
11
  import { t as toString_default } from "./toString-MxUAFb1C.js";
@@ -345,24 +345,24 @@ function createCollection(e) {
345
345
  });
346
346
  });
347
347
  m.displayName = f;
348
- let g = e + "CollectionItemSlot", _ = "data-radix-collection-item", v = createSlot(g), y = import_react.forwardRef((e2, i2) => {
349
- let { scope: a2, children: o2, ...s2 } = e2, u = import_react.useRef(null), d2 = useComposedRefs(i2, u), f2 = c(g, a2);
348
+ let h = e + "CollectionItemSlot", g = "data-radix-collection-item", _ = createSlot(h), v = import_react.forwardRef((e2, i2) => {
349
+ let { scope: a2, children: o2, ...s2 } = e2, u = import_react.useRef(null), d2 = useComposedRefs(i2, u), f2 = c(h, a2);
350
350
  return import_react.useEffect(() => (f2.itemMap.set(u, {
351
351
  ref: u,
352
352
  ...s2
353
- }), () => void f2.itemMap.delete(u))), /* @__PURE__ */ (0, import_jsx_runtime.jsx)(v, {
354
- [_]: "",
353
+ }), () => void f2.itemMap.delete(u))), /* @__PURE__ */ (0, import_jsx_runtime.jsx)(_, {
354
+ [g]: "",
355
355
  ref: d2,
356
356
  children: o2
357
357
  });
358
358
  });
359
- y.displayName = g;
360
- function b(i2) {
359
+ v.displayName = h;
360
+ function y(i2) {
361
361
  let a2 = c(e + "CollectionConsumer", i2);
362
362
  return import_react.useCallback(() => {
363
363
  let e2 = a2.collectionRef.current;
364
364
  if (!e2) return [];
365
- let i3 = Array.from(e2.querySelectorAll(`[${_}]`));
365
+ let i3 = Array.from(e2.querySelectorAll(`[${g}]`));
366
366
  return Array.from(a2.itemMap.values()).sort((e3, a3) => i3.indexOf(e3.ref.current) - i3.indexOf(a3.ref.current));
367
367
  }, [a2.collectionRef, a2.itemMap]);
368
368
  }
@@ -370,9 +370,9 @@ function createCollection(e) {
370
370
  {
371
371
  Provider: d,
372
372
  Slot: m,
373
- ItemSlot: y
373
+ ItemSlot: v
374
374
  },
375
- b,
375
+ y,
376
376
  o
377
377
  ];
378
378
  }
@@ -387,35 +387,35 @@ var import_react_dom = /* @__PURE__ */ __toESM(require_react_dom(), 1), OPEN_KEY
387
387
  "ArrowUp",
388
388
  "ArrowDown"
389
389
  ], SELECTION_KEYS = [" ", "Enter"], SELECT_NAME = "Select", [Collection, useCollection, createCollectionScope] = createCollection(SELECT_NAME), [createSelectContext, createSelectScope] = createContextScope(SELECT_NAME, [createCollectionScope, createPopperScope]), usePopperScope = createPopperScope(), [SelectProvider, useSelectContext] = createSelectContext(SELECT_NAME), [SelectNativeOptionsProvider, useSelectNativeOptionsContext] = createSelectContext(SELECT_NAME), Select$1 = (e) => {
390
- let { __scopeSelect: i, children: a, open: o, defaultOpen: s, onOpenChange: c, value: l, defaultValue: u, onValueChange: d, dir: f, name: p, autoComplete: m, disabled: h, required: g, form: _ } = e, v = usePopperScope(i), [y, b] = import_react.useState(null), [S, C] = import_react.useState(null), [w, T] = import_react.useState(false), E = useDirection(f), [D, O] = useControllableState({
390
+ let { __scopeSelect: i, children: a, open: o, defaultOpen: s, onOpenChange: c, value: l, defaultValue: u, onValueChange: d, dir: f, name: p, autoComplete: m, disabled: h, required: g, form: v } = e, y = usePopperScope(i), [b, x] = import_react.useState(null), [S, C] = import_react.useState(null), [w, T] = import_react.useState(false), E = useDirection(f), [D, k] = useControllableState({
391
391
  prop: o,
392
392
  defaultProp: s ?? false,
393
393
  onChange: c,
394
394
  caller: SELECT_NAME
395
- }), [k, A] = useControllableState({
395
+ }), [A, j] = useControllableState({
396
396
  prop: l,
397
397
  defaultProp: u,
398
398
  onChange: d,
399
399
  caller: SELECT_NAME
400
- }), j = import_react.useRef(null), N = y ? _ || !!y.closest("form") : true, [F, I] = import_react.useState(/* @__PURE__ */ new Set()), L = Array.from(F).map((e2) => e2.props.value).join(";");
400
+ }), M = import_react.useRef(null), N = b ? v || !!b.closest("form") : true, [P, I] = import_react.useState(/* @__PURE__ */ new Set()), L = Array.from(P).map((e2) => e2.props.value).join(";");
401
401
  return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Root2$1, {
402
- ...v,
402
+ ...y,
403
403
  children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(SelectProvider, {
404
404
  required: g,
405
405
  scope: i,
406
- trigger: y,
407
- onTriggerChange: b,
406
+ trigger: b,
407
+ onTriggerChange: x,
408
408
  valueNode: S,
409
409
  onValueNodeChange: C,
410
410
  valueNodeHasChildren: w,
411
411
  onValueNodeHasChildrenChange: T,
412
412
  contentId: useId(),
413
- value: k,
414
- onValueChange: A,
413
+ value: A,
414
+ onValueChange: j,
415
415
  open: D,
416
- onOpenChange: O,
416
+ onOpenChange: k,
417
417
  dir: E,
418
- triggerPointerDownPosRef: j,
418
+ triggerPointerDownPosRef: M,
419
419
  disabled: h,
420
420
  children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)(Collection.Provider, {
421
421
  scope: i,
@@ -438,22 +438,22 @@ var import_react_dom = /* @__PURE__ */ __toESM(require_react_dom(), 1), OPEN_KEY
438
438
  tabIndex: -1,
439
439
  name: p,
440
440
  autoComplete: m,
441
- value: k,
442
- onChange: (e2) => A(e2.target.value),
441
+ value: A,
442
+ onChange: (e2) => j(e2.target.value),
443
443
  disabled: h,
444
- form: _,
445
- children: [k === void 0 ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("option", { value: "" }) : null, Array.from(F)]
444
+ form: v,
445
+ children: [A === void 0 ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("option", { value: "" }) : null, Array.from(P)]
446
446
  }, L) : null]
447
447
  })
448
448
  });
449
449
  };
450
450
  Select$1.displayName = SELECT_NAME;
451
451
  var TRIGGER_NAME = "SelectTrigger", SelectTrigger$1 = import_react.forwardRef((e, i) => {
452
- let { __scopeSelect: a, disabled: o = false, ...s } = e, c = usePopperScope(a), u = useSelectContext(TRIGGER_NAME, a), d = u.disabled || o, f = useComposedRefs(i, u.onTriggerChange), p = useCollection(a), m = import_react.useRef("touch"), [h, g, v] = useTypeaheadSearch((e2) => {
452
+ let { __scopeSelect: a, disabled: o = false, ...s } = e, c = usePopperScope(a), u = useSelectContext(TRIGGER_NAME, a), d = u.disabled || o, f = useComposedRefs(i, u.onTriggerChange), p = useCollection(a), h = import_react.useRef("touch"), [_, v, y] = useTypeaheadSearch((e2) => {
453
453
  let i2 = p().filter((e3) => !e3.disabled), a2 = findNextItem(i2, e2, i2.find((e3) => e3.value === u.value));
454
454
  a2 !== void 0 && u.onValueChange(a2.value);
455
- }), y = (e2) => {
456
- d || (u.onOpenChange(true), v()), e2 && (u.triggerPointerDownPosRef.current = {
455
+ }), b = (e2) => {
456
+ d || (u.onOpenChange(true), y()), e2 && (u.triggerPointerDownPosRef.current = {
457
457
  x: Math.round(e2.pageX),
458
458
  y: Math.round(e2.pageY)
459
459
  });
@@ -476,28 +476,28 @@ var TRIGGER_NAME = "SelectTrigger", SelectTrigger$1 = import_react.forwardRef((e
476
476
  ...s,
477
477
  ref: f,
478
478
  onClick: composeEventHandlers(s.onClick, (e2) => {
479
- e2.currentTarget.focus(), m.current !== "mouse" && y(e2);
479
+ e2.currentTarget.focus(), h.current !== "mouse" && b(e2);
480
480
  }),
481
481
  onPointerDown: composeEventHandlers(s.onPointerDown, (e2) => {
482
- m.current = e2.pointerType;
482
+ h.current = e2.pointerType;
483
483
  let i2 = e2.target;
484
- i2.hasPointerCapture(e2.pointerId) && i2.releasePointerCapture(e2.pointerId), e2.button === 0 && e2.ctrlKey === false && e2.pointerType === "mouse" && (y(e2), e2.preventDefault());
484
+ i2.hasPointerCapture(e2.pointerId) && i2.releasePointerCapture(e2.pointerId), e2.button === 0 && e2.ctrlKey === false && e2.pointerType === "mouse" && (b(e2), e2.preventDefault());
485
485
  }),
486
486
  onKeyDown: composeEventHandlers(s.onKeyDown, (e2) => {
487
- let i2 = h.current !== "";
488
- !(e2.ctrlKey || e2.altKey || e2.metaKey) && e2.key.length === 1 && g(e2.key), !(i2 && e2.key === " ") && OPEN_KEYS.includes(e2.key) && (y(), e2.preventDefault());
487
+ let i2 = _.current !== "";
488
+ !(e2.ctrlKey || e2.altKey || e2.metaKey) && e2.key.length === 1 && v(e2.key), !(i2 && e2.key === " ") && OPEN_KEYS.includes(e2.key) && (b(), e2.preventDefault());
489
489
  })
490
490
  })
491
491
  });
492
492
  });
493
493
  SelectTrigger$1.displayName = TRIGGER_NAME;
494
494
  var VALUE_NAME = "SelectValue", SelectValue$1 = import_react.forwardRef((e, i) => {
495
- let { __scopeSelect: a, className: o, style: s, children: c, placeholder: u = "", ...d } = e, f = useSelectContext(VALUE_NAME, a), { onValueNodeHasChildrenChange: p } = f, m = c !== void 0, h = useComposedRefs(i, f.onValueNodeChange);
495
+ let { __scopeSelect: a, className: o, style: s, children: c, placeholder: u = "", ...d } = e, f = useSelectContext(VALUE_NAME, a), { onValueNodeHasChildrenChange: p } = f, m = c !== void 0, _ = useComposedRefs(i, f.onValueNodeChange);
496
496
  return useLayoutEffect2(() => {
497
497
  p(m);
498
498
  }, [p, m]), /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Primitive.span, {
499
499
  ...d,
500
- ref: h,
500
+ ref: _,
501
501
  style: { pointerEvents: "none" },
502
502
  children: shouldShowPlaceholder(f.value) ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_jsx_runtime.Fragment, { children: u }) : c
503
503
  });
@@ -539,24 +539,24 @@ var CONTENT_NAME = "SelectContent", SelectContent$1 = import_react.forwardRef((e
539
539
  });
540
540
  SelectContent$1.displayName = CONTENT_NAME;
541
541
  var CONTENT_MARGIN = 10, [SelectContentProvider, useSelectContentContext] = createSelectContext(CONTENT_NAME), CONTENT_IMPL_NAME = "SelectContentImpl", Slot = createSlot("SelectContent.RemoveScroll"), SelectContentImpl = import_react.forwardRef((e, i) => {
542
- let { __scopeSelect: a, position: o = "item-aligned", onCloseAutoFocus: s, onEscapeKeyDown: c, onPointerDownOutside: u, side: d, sideOffset: f, align: p, alignOffset: h, arrowPadding: g, collisionBoundary: _, collisionPadding: v, sticky: y, hideWhenDetached: b, avoidCollisions: x, ...S } = e, C = useSelectContext(CONTENT_NAME, a), [E, D] = import_react.useState(null), [A, M] = import_react.useState(null), N = useComposedRefs(i, (e2) => D(e2)), [P, F] = import_react.useState(null), [I, L] = import_react.useState(null), R = useCollection(a), [z, B] = import_react.useState(false), V = import_react.useRef(false);
542
+ let { __scopeSelect: a, position: o = "item-aligned", onCloseAutoFocus: s, onEscapeKeyDown: c, onPointerDownOutside: u, side: d, sideOffset: f, align: p, alignOffset: h, arrowPadding: g, collisionBoundary: _, collisionPadding: v, sticky: y, hideWhenDetached: b, avoidCollisions: x, ...S } = e, C = useSelectContext(CONTENT_NAME, a), [w, E] = import_react.useState(null), [O, A] = import_react.useState(null), M = useComposedRefs(i, (e2) => E(e2)), [N, F] = import_react.useState(null), [I, L] = import_react.useState(null), R = useCollection(a), [z, B] = import_react.useState(false), V = import_react.useRef(false);
543
543
  import_react.useEffect(() => {
544
- if (E) return hideOthers(E);
545
- }, [E]), useFocusGuards();
544
+ if (w) return hideOthers(w);
545
+ }, [w]), useFocusGuards();
546
546
  let H = import_react.useCallback((e2) => {
547
547
  let [i2, ...a2] = R().map((e3) => e3.ref.current), [o2] = a2.slice(-1), s2 = document.activeElement;
548
- for (let a3 of e2) if (a3 === s2 || (a3 == null ? void 0 : a3.scrollIntoView({ block: "nearest" }), a3 === i2 && A && (A.scrollTop = 0), a3 === o2 && A && (A.scrollTop = A.scrollHeight), a3 == null ? void 0 : a3.focus(), document.activeElement !== s2)) return;
549
- }, [R, A]), U = import_react.useCallback(() => H([P, E]), [
548
+ for (let a3 of e2) if (a3 === s2 || (a3 == null ? void 0 : a3.scrollIntoView({ block: "nearest" }), a3 === i2 && O && (O.scrollTop = 0), a3 === o2 && O && (O.scrollTop = O.scrollHeight), a3 == null ? void 0 : a3.focus(), document.activeElement !== s2)) return;
549
+ }, [R, O]), U = import_react.useCallback(() => H([N, w]), [
550
550
  H,
551
- P,
552
- E
551
+ N,
552
+ w
553
553
  ]);
554
554
  import_react.useEffect(() => {
555
555
  z && U();
556
556
  }, [z, U]);
557
557
  let { onOpenChange: W, triggerPointerDownPosRef: G } = C;
558
558
  import_react.useEffect(() => {
559
- if (E) {
559
+ if (w) {
560
560
  let e2 = {
561
561
  x: 0,
562
562
  y: 0
@@ -567,7 +567,7 @@ var CONTENT_MARGIN = 10, [SelectContentProvider, useSelectContentContext] = crea
567
567
  y: Math.abs(Math.round(i3.pageY) - (((_b = G.current) == null ? void 0 : _b.y) ?? 0))
568
568
  };
569
569
  }, a2 = (a3) => {
570
- e2.x <= 10 && e2.y <= 10 ? a3.preventDefault() : E.contains(a3.target) || W(false), document.removeEventListener("pointermove", i2), G.current = null;
570
+ e2.x <= 10 && e2.y <= 10 ? a3.preventDefault() : w.contains(a3.target) || W(false), document.removeEventListener("pointermove", i2), G.current = null;
571
571
  };
572
572
  return G.current !== null && (document.addEventListener("pointermove", i2), document.addEventListener("pointerup", a2, {
573
573
  capture: true,
@@ -577,7 +577,7 @@ var CONTENT_MARGIN = 10, [SelectContentProvider, useSelectContentContext] = crea
577
577
  };
578
578
  }
579
579
  }, [
580
- E,
580
+ w,
581
581
  W,
582
582
  G
583
583
  ]), import_react.useEffect(() => {
@@ -592,7 +592,7 @@ var CONTENT_MARGIN = 10, [SelectContentProvider, useSelectContentContext] = crea
592
592
  }), J = import_react.useCallback((e2, i2, a2) => {
593
593
  let o2 = !V.current && !a2;
594
594
  (C.value !== void 0 && C.value === i2 || o2) && (F(e2), o2 && (V.current = true));
595
- }, [C.value]), Y = import_react.useCallback(() => E == null ? void 0 : E.focus(), [E]), Z = import_react.useCallback((e2, i2, a2) => {
595
+ }, [C.value]), Y = import_react.useCallback(() => w == null ? void 0 : w.focus(), [w]), Z = import_react.useCallback((e2, i2, a2) => {
596
596
  let o2 = !V.current && !a2;
597
597
  (C.value !== void 0 && C.value === i2 || o2) && L(e2);
598
598
  }, [C.value]), Q = o === "popper" ? SelectPopperPosition : SelectItemAlignedPosition, $ = Q === SelectPopperPosition ? {
@@ -609,11 +609,11 @@ var CONTENT_MARGIN = 10, [SelectContentProvider, useSelectContentContext] = crea
609
609
  } : {};
610
610
  return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(SelectContentProvider, {
611
611
  scope: a,
612
- content: E,
613
- viewport: A,
614
- onViewportChange: M,
612
+ content: w,
613
+ viewport: O,
614
+ onViewportChange: A,
615
615
  itemRefCallback: J,
616
- selectedItem: P,
616
+ selectedItem: N,
617
617
  onItemLeave: Y,
618
618
  itemTextRefCallback: Z,
619
619
  focusSelectedItem: U,
@@ -650,7 +650,7 @@ var CONTENT_MARGIN = 10, [SelectContentProvider, useSelectContentContext] = crea
650
650
  ...S,
651
651
  ...$,
652
652
  onPlaced: () => B(true),
653
- ref: N,
653
+ ref: M,
654
654
  style: {
655
655
  display: "flex",
656
656
  flexDirection: "column",
@@ -681,7 +681,7 @@ var CONTENT_MARGIN = 10, [SelectContentProvider, useSelectContentContext] = crea
681
681
  });
682
682
  SelectContentImpl.displayName = CONTENT_IMPL_NAME;
683
683
  var ITEM_ALIGNED_POSITION_NAME = "SelectItemAlignedPosition", SelectItemAlignedPosition = import_react.forwardRef((e, i) => {
684
- let { __scopeSelect: a, onPlaced: o, ...s } = e, c = useSelectContext(CONTENT_NAME, a), u = useSelectContentContext(CONTENT_NAME, a), [d, f] = import_react.useState(null), [p, m] = import_react.useState(null), h = useComposedRefs(i, (e2) => m(e2)), v = useCollection(a), y = import_react.useRef(false), b = import_react.useRef(true), { viewport: x, selectedItem: S, selectedItemText: C, focusSelectedItem: w } = u, T = import_react.useCallback(() => {
684
+ let { __scopeSelect: a, onPlaced: o, ...s } = e, c = useSelectContext(CONTENT_NAME, a), u = useSelectContentContext(CONTENT_NAME, a), [d, f] = import_react.useState(null), [p, m] = import_react.useState(null), _ = useComposedRefs(i, (e2) => m(e2)), v = useCollection(a), y = import_react.useRef(false), b = import_react.useRef(true), { viewport: x, selectedItem: S, selectedItemText: C, focusSelectedItem: w } = u, T = import_react.useCallback(() => {
685
685
  if (c.trigger && c.valueNode && d && p && x && S && C) {
686
686
  let e2 = c.trigger.getBoundingClientRect(), i2 = p.getBoundingClientRect(), a2 = c.valueNode.getBoundingClientRect(), s2 = C.getBoundingClientRect();
687
687
  if (c.dir !== "rtl") {
@@ -691,16 +691,16 @@ var ITEM_ALIGNED_POSITION_NAME = "SelectItemAlignedPosition", SelectItemAlignedP
691
691
  let o2 = i2.right - s2.right, c2 = window.innerWidth - a2.right - o2, l2 = window.innerWidth - e2.right - c2, u3 = e2.width + l2, f3 = Math.max(u3, i2.width), p2 = window.innerWidth - CONTENT_MARGIN, m3 = clamp(c2, [CONTENT_MARGIN, Math.max(CONTENT_MARGIN, p2 - f3)]);
692
692
  d.style.minWidth = u3 + "px", d.style.right = m3 + "px";
693
693
  }
694
- let l = v(), u2 = window.innerHeight - CONTENT_MARGIN * 2, f2 = x.scrollHeight, m2 = window.getComputedStyle(p), h2 = parseInt(m2.borderTopWidth, 10), g = parseInt(m2.paddingTop, 10), _ = parseInt(m2.borderBottomWidth, 10), b2 = parseInt(m2.paddingBottom, 10), w2 = h2 + g + f2 + b2 + _, T2 = Math.min(S.offsetHeight * 5, w2), E2 = window.getComputedStyle(x), D2 = parseInt(E2.paddingTop, 10), O = parseInt(E2.paddingBottom, 10), k = e2.top + e2.height / 2 - CONTENT_MARGIN, A = u2 - k, j = S.offsetHeight / 2, M = S.offsetTop + j, N = h2 + g + M, P = w2 - N;
694
+ let l = v(), u2 = window.innerHeight - CONTENT_MARGIN * 2, f2 = x.scrollHeight, m2 = window.getComputedStyle(p), h = parseInt(m2.borderTopWidth, 10), g = parseInt(m2.paddingTop, 10), _2 = parseInt(m2.borderBottomWidth, 10), b2 = parseInt(m2.paddingBottom, 10), w2 = h + g + f2 + b2 + _2, T2 = Math.min(S.offsetHeight * 5, w2), E2 = window.getComputedStyle(x), D2 = parseInt(E2.paddingTop, 10), O = parseInt(E2.paddingBottom, 10), k = e2.top + e2.height / 2 - CONTENT_MARGIN, A = u2 - k, j = S.offsetHeight / 2, M = S.offsetTop + j, N = h + g + M, P = w2 - N;
695
695
  if (N <= k) {
696
696
  let e3 = l.length > 0 && S === l[l.length - 1].ref.current;
697
697
  d.style.bottom = "0px";
698
- let i3 = p.clientHeight - x.offsetTop - x.offsetHeight, a3 = N + Math.max(A, j + (e3 ? O : 0) + i3 + _);
698
+ let i3 = p.clientHeight - x.offsetTop - x.offsetHeight, a3 = N + Math.max(A, j + (e3 ? O : 0) + i3 + _2);
699
699
  d.style.height = a3 + "px";
700
700
  } else {
701
701
  let e3 = l.length > 0 && S === l[0].ref.current;
702
702
  d.style.top = "0px";
703
- let i3 = Math.max(k, h2 + x.offsetTop + (e3 ? D2 : 0) + j) + P;
703
+ let i3 = Math.max(k, h + x.offsetTop + (e3 ? D2 : 0) + j) + P;
704
704
  d.style.height = i3 + "px", x.scrollTop = N - k + x.offsetTop;
705
705
  }
706
706
  d.style.margin = `${CONTENT_MARGIN}px 0`, d.style.minHeight = T2 + "px", d.style.maxHeight = u2 + "px", o == null ? void 0 : o(), requestAnimationFrame(() => y.current = true);
@@ -738,7 +738,7 @@ var ITEM_ALIGNED_POSITION_NAME = "SelectItemAlignedPosition", SelectItemAlignedP
738
738
  },
739
739
  children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Primitive.div, {
740
740
  ...s,
741
- ref: h,
741
+ ref: _,
742
742
  style: {
743
743
  boxSizing: "border-box",
744
744
  maxHeight: "100%",
@@ -829,10 +829,10 @@ var LABEL_NAME = "SelectLabel", SelectLabel$1 = import_react.forwardRef((e, i) =
829
829
  });
830
830
  SelectLabel$1.displayName = LABEL_NAME;
831
831
  var ITEM_NAME = "SelectItem", [SelectItemContextProvider, useSelectItemContext] = createSelectContext(ITEM_NAME), SelectItem$1 = import_react.forwardRef((e, i) => {
832
- let { __scopeSelect: a, value: o, disabled: s = false, textValue: c, ...u } = e, d = useSelectContext(ITEM_NAME, a), f = useSelectContentContext(ITEM_NAME, a), p = d.value === o, [m, h] = import_react.useState(c ?? ""), [g, v] = import_react.useState(false), y = useComposedRefs(i, (e2) => {
832
+ let { __scopeSelect: a, value: o, disabled: s = false, textValue: c, ...u } = e, d = useSelectContext(ITEM_NAME, a), f = useSelectContentContext(ITEM_NAME, a), p = d.value === o, [h, v] = import_react.useState(c ?? ""), [y, b] = import_react.useState(false), x = useComposedRefs(i, (e2) => {
833
833
  var _a;
834
834
  return (_a = f.itemRefCallback) == null ? void 0 : _a.call(f, e2, o, s);
835
- }), b = useId(), x = import_react.useRef("touch"), S = () => {
835
+ }), S = useId(), C = import_react.useRef("touch"), w = () => {
836
836
  s || (d.onValueChange(o), d.onOpenChange(false));
837
837
  };
838
838
  if (o === "") throw Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");
@@ -840,41 +840,41 @@ var ITEM_NAME = "SelectItem", [SelectItemContextProvider, useSelectItemContext]
840
840
  scope: a,
841
841
  value: o,
842
842
  disabled: s,
843
- textId: b,
843
+ textId: S,
844
844
  isSelected: p,
845
845
  onItemTextChange: import_react.useCallback((e2) => {
846
- h((i2) => i2 || ((e2 == null ? void 0 : e2.textContent) ?? "").trim());
846
+ v((i2) => i2 || ((e2 == null ? void 0 : e2.textContent) ?? "").trim());
847
847
  }, []),
848
848
  children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Collection.ItemSlot, {
849
849
  scope: a,
850
850
  value: o,
851
851
  disabled: s,
852
- textValue: m,
852
+ textValue: h,
853
853
  children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Primitive.div, {
854
854
  role: "option",
855
- "aria-labelledby": b,
856
- "data-highlighted": g ? "" : void 0,
857
- "aria-selected": p && g,
855
+ "aria-labelledby": S,
856
+ "data-highlighted": y ? "" : void 0,
857
+ "aria-selected": p && y,
858
858
  "data-state": p ? "checked" : "unchecked",
859
859
  "aria-disabled": s || void 0,
860
860
  "data-disabled": s ? "" : void 0,
861
861
  tabIndex: s ? void 0 : -1,
862
862
  ...u,
863
- ref: y,
864
- onFocus: composeEventHandlers(u.onFocus, () => v(true)),
865
- onBlur: composeEventHandlers(u.onBlur, () => v(false)),
863
+ ref: x,
864
+ onFocus: composeEventHandlers(u.onFocus, () => b(true)),
865
+ onBlur: composeEventHandlers(u.onBlur, () => b(false)),
866
866
  onClick: composeEventHandlers(u.onClick, () => {
867
- x.current !== "mouse" && S();
867
+ C.current !== "mouse" && w();
868
868
  }),
869
869
  onPointerUp: composeEventHandlers(u.onPointerUp, () => {
870
- x.current === "mouse" && S();
870
+ C.current === "mouse" && w();
871
871
  }),
872
872
  onPointerDown: composeEventHandlers(u.onPointerDown, (e2) => {
873
- x.current = e2.pointerType;
873
+ C.current = e2.pointerType;
874
874
  }),
875
875
  onPointerMove: composeEventHandlers(u.onPointerMove, (e2) => {
876
876
  var _a;
877
- x.current = e2.pointerType, s ? (_a = f.onItemLeave) == null ? void 0 : _a.call(f) : x.current === "mouse" && e2.currentTarget.focus({ preventScroll: true });
877
+ C.current = e2.pointerType, s ? (_a = f.onItemLeave) == null ? void 0 : _a.call(f) : C.current === "mouse" && e2.currentTarget.focus({ preventScroll: true });
878
878
  }),
879
879
  onPointerLeave: composeEventHandlers(u.onPointerLeave, (e2) => {
880
880
  var _a;
@@ -882,7 +882,7 @@ var ITEM_NAME = "SelectItem", [SelectItemContextProvider, useSelectItemContext]
882
882
  }),
883
883
  onKeyDown: composeEventHandlers(u.onKeyDown, (e2) => {
884
884
  var _a;
885
- ((_a = f.searchRef) == null ? void 0 : _a.current) !== "" && e2.key === " " || (SELECTION_KEYS.includes(e2.key) && S(), e2.key === " " && e2.preventDefault());
885
+ ((_a = f.searchRef) == null ? void 0 : _a.current) !== "" && e2.key === " " || (SELECTION_KEYS.includes(e2.key) && w(), e2.key === " " && e2.preventDefault());
886
886
  })
887
887
  })
888
888
  })
@@ -890,7 +890,7 @@ var ITEM_NAME = "SelectItem", [SelectItemContextProvider, useSelectItemContext]
890
890
  });
891
891
  SelectItem$1.displayName = ITEM_NAME;
892
892
  var ITEM_TEXT_NAME = "SelectItemText", SelectItemText = import_react.forwardRef((e, i) => {
893
- let { __scopeSelect: a, className: o, style: s, ...c } = e, u = useSelectContext(ITEM_TEXT_NAME, a), d = useSelectContentContext(ITEM_TEXT_NAME, a), f = useSelectItemContext(ITEM_TEXT_NAME, a), p = useSelectNativeOptionsContext(ITEM_TEXT_NAME, a), [m, h] = import_react.useState(null), v = useComposedRefs(i, (e2) => h(e2), f.onItemTextChange, (e2) => {
893
+ let { __scopeSelect: a, className: o, style: s, ...c } = e, u = useSelectContext(ITEM_TEXT_NAME, a), d = useSelectContentContext(ITEM_TEXT_NAME, a), f = useSelectItemContext(ITEM_TEXT_NAME, a), p = useSelectNativeOptionsContext(ITEM_TEXT_NAME, a), [m, _] = import_react.useState(null), v = useComposedRefs(i, (e2) => _(e2), f.onItemTextChange, (e2) => {
894
894
  var _a;
895
895
  return (_a = d.itemTextRefCallback) == null ? void 0 : _a.call(d, e2, f.value, f.disabled);
896
896
  }), y = m == null ? void 0 : m.textContent, b = import_react.useMemo(() => /* @__PURE__ */ (0, import_jsx_runtime.jsx)("option", {