@saas-ui/react 3.0.0-alpha.4 → 3.0.0-alpha.5

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 (84) hide show
  1. package/CHANGELOG.md +7 -0
  2. package/dist/chunk-2EUACKRH.js +26 -0
  3. package/dist/chunk-3Z2C27LI.js +51 -0
  4. package/dist/chunk-4TR3AOMG.js +33 -0
  5. package/dist/chunk-6LOMIKR5.js +69 -0
  6. package/dist/chunk-6ZNR6N2K.js +45 -0
  7. package/dist/chunk-7C3IZBNJ.js +38 -0
  8. package/dist/chunk-BCNPBZZK.js +45 -0
  9. package/dist/{chunk-KHRLZUV4.js → chunk-BFA5FCA2.js} +16 -1
  10. package/dist/chunk-CTOVNZVS.js +1 -0
  11. package/dist/chunk-DPMEXCSG.js +137 -0
  12. package/dist/chunk-F3CVOMG5.js +160 -0
  13. package/dist/chunk-FJFNGSPL.js +23 -0
  14. package/dist/chunk-GEPWRHHH.js +65 -0
  15. package/dist/chunk-HELHPHIQ.js +35 -0
  16. package/dist/chunk-I2RXEKTB.js +38 -0
  17. package/dist/chunk-L356FPLY.js +20 -0
  18. package/dist/chunk-LIYUBUOP.js +119 -0
  19. package/dist/chunk-M7FOBCOV.js +184 -0
  20. package/dist/chunk-NSD5HRIP.js +46 -0
  21. package/dist/chunk-QMG6HP7Z.js +87 -0
  22. package/dist/chunk-QSNSWCTM.js +32 -0
  23. package/dist/chunk-S3CQW7GD.js +100 -0
  24. package/dist/chunk-SA3OGTOO.js +23 -0
  25. package/dist/chunk-UCQ3LZIE.js +43 -0
  26. package/dist/chunk-ULAJ3JEO.js +32 -0
  27. package/dist/chunk-VF3BV2BY.js +87 -0
  28. package/dist/chunk-WYLMBMAH.js +22 -0
  29. package/dist/chunk-YWJZWB6I.js +1892 -0
  30. package/dist/chunk-ZWSZQZ5G.js +73 -0
  31. package/dist/components/app-shell/index.js +3 -40
  32. package/dist/components/avatar/index.cjs +69 -0
  33. package/dist/components/avatar/index.d.cts +18 -0
  34. package/dist/components/avatar/index.d.ts +18 -0
  35. package/dist/components/avatar/index.js +10 -0
  36. package/dist/components/breadcrumbs/index.js +3 -32
  37. package/dist/components/button/index.js +3 -40
  38. package/dist/components/checkbox/index.js +3 -15
  39. package/dist/components/command/index.js +3 -28
  40. package/dist/components/dialog/index.js +5 -67
  41. package/dist/components/drawer/index.d.cts +2 -2
  42. package/dist/components/drawer/index.d.ts +2 -2
  43. package/dist/components/drawer/index.js +5 -59
  44. package/dist/components/empty-state/index.js +3 -18
  45. package/dist/components/grid-list/index.js +3 -40
  46. package/dist/components/icon-badge/index.js +3 -33
  47. package/dist/components/link/index.js +2 -14
  48. package/dist/components/loading-overlay/index.js +5 -1885
  49. package/dist/components/menu/index.cjs +263 -0
  50. package/dist/components/menu/index.d.cts +30 -0
  51. package/dist/components/menu/index.d.ts +30 -0
  52. package/dist/components/menu/index.js +9 -0
  53. package/dist/components/navbar/index.d.cts +4 -4
  54. package/dist/components/navbar/index.d.ts +4 -4
  55. package/dist/components/navbar/index.js +3 -45
  56. package/dist/components/number-input/index.js +3 -26
  57. package/dist/components/password-input/index.js +4 -225
  58. package/dist/components/persona/index.js +6 -178
  59. package/dist/components/pin-input/index.js +3 -21
  60. package/dist/components/radio/index.js +4 -16
  61. package/dist/components/search-input/index.js +4 -114
  62. package/dist/components/segmented-control/index.cjs +2 -0
  63. package/dist/components/segmented-control/index.d.cts +2 -0
  64. package/dist/components/segmented-control/index.d.ts +2 -0
  65. package/dist/components/segmented-control/index.js +2 -0
  66. package/dist/components/select/index.js +4 -94
  67. package/dist/components/sidebar/index.d.cts +11 -11
  68. package/dist/components/sidebar/index.d.ts +11 -11
  69. package/dist/components/sidebar/index.js +7 -129
  70. package/dist/components/steps/index.js +5 -64
  71. package/dist/components/switch/index.js +3 -18
  72. package/dist/components/toaster/index.cjs +54 -0
  73. package/dist/components/toaster/index.d.cts +10 -0
  74. package/dist/components/toaster/index.d.ts +10 -0
  75. package/dist/components/toaster/index.js +10 -0
  76. package/dist/components/tooltip/index.cjs +57 -0
  77. package/dist/components/tooltip/index.d.cts +14 -0
  78. package/dist/components/tooltip/index.d.ts +14 -0
  79. package/dist/components/tooltip/index.js +8 -0
  80. package/dist/index.cjs +3564 -8
  81. package/dist/index.d.cts +37 -2
  82. package/dist/index.d.ts +37 -2
  83. package/dist/index.js +142 -4
  84. package/package.json +1 -1
package/dist/index.cjs CHANGED
@@ -17,7 +17,6 @@ var __copyProps = (to, from, except, desc) => {
17
17
  }
18
18
  return to;
19
19
  };
20
- var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
21
20
  var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
22
21
  // If the importer is in node compatibility mode or this is not an ESM
23
22
  // file that has been converted to a CommonJS file using a Babel-
@@ -31,16 +30,54 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
31
30
  // src/index.ts
32
31
  var src_exports = {};
33
32
  __export(src_exports, {
33
+ AppShell: () => AppShell,
34
+ Avatar: () => Avatar,
35
+ AvatarGroup: () => AvatarGroup,
36
+ Breadcrumb: () => namespace_exports,
37
+ Button: () => Button,
38
+ Checkbox: () => Checkbox,
39
+ CloseButton: () => CloseButton,
40
+ Command: () => Command,
41
+ Dialog: () => namespace_exports2,
42
+ Drawer: () => namespace_exports3,
43
+ EmptyState: () => EmptyState,
44
+ GridList: () => grid_list_exports,
45
+ IconBadge: () => IconBadge,
46
+ InputGroup: () => InputGroup,
47
+ Link: () => Link,
48
+ LoadingOverlay: () => loading_overlay_exports,
49
+ Menu: () => menu_exports,
50
+ Navbar: () => navbar_exports,
51
+ NumberInput: () => NumberInput,
52
+ PasswordInput: () => PasswordInput,
53
+ Persona: () => Persona,
54
+ PersonaAvatar: () => PersonaAvatar2,
55
+ PinInput: () => PinInput,
56
+ Radio: () => Radio,
57
+ RadioGroup: () => RadioGroup,
58
+ SearchInput: () => SearchInput,
59
+ Select: () => namespace_exports4,
60
+ Sidebar: () => sidebar_exports,
61
+ Spinner: () => Spinner2,
62
+ Steps: () => steps_exports,
34
63
  SuiContext: () => SuiContext,
35
64
  SuiProvider: () => SuiProvider,
36
- createSystem: () => import_react100.createSystem,
65
+ Switch: () => Switch,
66
+ Toaster: () => Toaster,
67
+ Tooltip: () => Tooltip,
68
+ createSystem: () => import_react166.createSystem,
37
69
  defaultConfig: () => defaultConfig,
70
+ defaultPresenceOptions: () => defaultPresenceOptions,
38
71
  defaultSystem: () => defaultSystem,
72
+ toast: () => toast,
39
73
  useLink: () => useLink,
74
+ useLoadingOverlayStyles: () => useLoadingOverlayStyles,
75
+ useSidebar: () => import_sidebar2.useSidebar,
76
+ useSidebarItemStyles: () => useSidebarItemStyles,
77
+ useSidebarStyles: () => useSidebarStyles,
40
78
  useSui: () => useSui
41
79
  });
42
80
  module.exports = __toCommonJS(src_exports);
43
- __reExport(src_exports, require("@saas-ui/core"), module.exports);
44
81
 
45
82
  // src/preset.ts
46
83
  var import_react97 = require("@chakra-ui/react");
@@ -8409,15 +8446,15 @@ var defaultConfig = (0, import_react97.mergeConfigs)(import_react97.defaultBaseC
8409
8446
  var defaultSystem = (0, import_react97.createSystem)(defaultConfig);
8410
8447
 
8411
8448
  // src/index.ts
8412
- var import_react100 = require("@chakra-ui/react");
8449
+ var import_react166 = require("@chakra-ui/react");
8413
8450
 
8414
8451
  // src/provider/sui-provider.tsx
8415
8452
  var React = __toESM(require("react"), 1);
8416
8453
  var import_react98 = require("@chakra-ui/react");
8417
8454
  var import_jsx_runtime = require("react/jsx-runtime");
8418
8455
  var SuiContext = React.createContext({});
8419
- function SuiProvider(props) {
8420
- const { linkComponent, onError, children, ...rest } = props;
8456
+ function SuiProvider(props2) {
8457
+ const { linkComponent, onError, children, ...rest } = props2;
8421
8458
  const context = React.useMemo(
8422
8459
  () => ({
8423
8460
  linkComponent
@@ -8437,14 +8474,3533 @@ function useLink() {
8437
8474
  }
8438
8475
  return import_react99.chakra.a;
8439
8476
  }
8477
+
8478
+ // src/components/app-shell/app-shell.tsx
8479
+ var import_react100 = require("react");
8480
+ var import_react101 = require("@chakra-ui/react");
8481
+ var import_jsx_runtime2 = require("react/jsx-runtime");
8482
+ var {
8483
+ withProvider,
8484
+ withContext,
8485
+ useStyles: useAppShellStyles
8486
+ } = (0, import_react101.createSlotRecipeContext)({
8487
+ key: "suiAppShell"
8488
+ });
8489
+ var AppShellRoot = withProvider(
8490
+ "div",
8491
+ "root",
8492
+ { forwardAsChild: true }
8493
+ );
8494
+ var AppShellContent = withContext("div", "content", { forwardAsChild: true });
8495
+ var AppShellMain = withContext(
8496
+ "div",
8497
+ "main",
8498
+ { forwardAsChild: true }
8499
+ );
8500
+ var AppShell = (0, import_react100.forwardRef)(
8501
+ (props2, ref2) => {
8502
+ const { header, sidebar, aside, footer, children, ...rootProps } = props2;
8503
+ return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(AppShellRoot, { ref: ref2, ...rootProps, children: [
8504
+ header,
8505
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(AppShellContent, { children: [
8506
+ sidebar,
8507
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(AppShellMain, { children }),
8508
+ aside
8509
+ ] }),
8510
+ footer
8511
+ ] });
8512
+ }
8513
+ );
8514
+ AppShell.displayName = "AppShell";
8515
+
8516
+ // src/components/avatar/avatar.tsx
8517
+ var import_react102 = require("react");
8518
+ var import_react103 = require("@chakra-ui/react");
8519
+ var import_jsx_runtime3 = require("react/jsx-runtime");
8520
+ var Avatar = (0, import_react102.forwardRef)(
8521
+ function Avatar2(props2, ref2) {
8522
+ const { name, src, srcSet, loading, icon, fallback: fallback2, children, ...rest } = props2;
8523
+ return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(import_react103.Avatar.Root, { ref: ref2, ...rest, children: [
8524
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(AvatarFallback, { name, icon, children: fallback2 }),
8525
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_react103.Avatar.Image, { src, srcSet, loading }),
8526
+ children
8527
+ ] });
8528
+ }
8529
+ );
8530
+ var AvatarFallback = (0, import_react102.forwardRef)(
8531
+ function AvatarFallback2(props2, ref2) {
8532
+ const { name, icon, children, ...rest } = props2;
8533
+ return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(import_react103.Avatar.Fallback, { ref: ref2, ...rest, children: [
8534
+ children,
8535
+ name != null && children == null && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_jsx_runtime3.Fragment, { children: getInitials(name) }),
8536
+ name == null && children == null && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_react103.Avatar.Icon, { asChild: !!icon, children: icon })
8537
+ ] });
8538
+ }
8539
+ );
8540
+ function getInitials(name) {
8541
+ const names = name.trim().split(" ");
8542
+ const firstName = names[0] != null ? names[0] : "";
8543
+ const lastName = names.length > 1 ? names[names.length - 1] : "";
8544
+ return firstName && lastName ? `${firstName.charAt(0)}${lastName.charAt(0)}` : firstName.charAt(0);
8545
+ }
8546
+ var AvatarGroup = (0, import_react102.forwardRef)(
8547
+ function AvatarGroup2(props2, ref2) {
8548
+ const { size, variant, borderless, ...rest } = props2;
8549
+ return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_react103.Avatar.PropsProvider, { value: { size, variant, borderless }, children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_react103.Group, { gap: "0", spaceX: "-3", ref: ref2, ...rest }) });
8550
+ }
8551
+ );
8552
+
8553
+ // src/components/breadcrumbs/namespace.ts
8554
+ var namespace_exports = {};
8555
+ __export(namespace_exports, {
8556
+ CurrentLink: () => BreadcrumbCurrentLink,
8557
+ Ellipsis: () => BreadcrumbEllipsis,
8558
+ Link: () => BreadcrumbLink,
8559
+ Root: () => BreadcrumbRoot
8560
+ });
8561
+
8562
+ // src/components/breadcrumbs/breadcrumb.tsx
8563
+ var import_react104 = require("react");
8564
+ var import_react105 = require("@chakra-ui/react");
8565
+ var import_jsx_runtime4 = require("react/jsx-runtime");
8566
+ var BreadcrumbRoot = (0, import_react104.forwardRef)(
8567
+ function BreadcrumbRoot2(props2, ref2) {
8568
+ const { separator = "/", separatorGap, children, ...rest } = props2;
8569
+ const validChildren = import_react104.Children.toArray(children).filter(import_react104.isValidElement);
8570
+ return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_react105.Breadcrumb.Root, { ref: ref2, ...rest, children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_react105.Breadcrumb.List, { gap: separatorGap, children: validChildren.map((child, index) => {
8571
+ const last = index === validChildren.length - 1;
8572
+ return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(import_react104.Fragment, { children: [
8573
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_react105.Breadcrumb.Item, { children: child }),
8574
+ !last && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_react105.Breadcrumb.Separator, { children: separator })
8575
+ ] }, index);
8576
+ }) }) });
8577
+ }
8578
+ );
8579
+ var BreadcrumbLink = import_react105.Breadcrumb.Link;
8580
+ var BreadcrumbCurrentLink = import_react105.Breadcrumb.CurrentLink;
8581
+ var BreadcrumbEllipsis = import_react105.Breadcrumb.Ellipsis;
8582
+
8583
+ // src/components/button/button.tsx
8584
+ var import_react106 = require("react");
8585
+ var import_react107 = require("@chakra-ui/react");
8586
+ var import_jsx_runtime5 = require("react/jsx-runtime");
8587
+ var Button = (0, import_react106.forwardRef)(
8588
+ function Button2(props2, ref2) {
8589
+ const {
8590
+ loading,
8591
+ disabled,
8592
+ loadingText,
8593
+ children,
8594
+ variant = "glass",
8595
+ colorPalette = variant === "glass" ? "accent" : "gray",
8596
+ ...rest
8597
+ } = props2;
8598
+ return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
8599
+ import_react107.Button,
8600
+ {
8601
+ colorPalette,
8602
+ disabled: loading || disabled,
8603
+ variant,
8604
+ ref: ref2,
8605
+ ...rest,
8606
+ children: loading && !loadingText ? /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(import_jsx_runtime5.Fragment, { children: [
8607
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_react107.AbsoluteCenter, { display: "inline-flex", children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_react107.Spinner, { size: "inherit", color: "inherit" }) }),
8608
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_react107.Span, { opacity: 0, children })
8609
+ ] }) : loading && loadingText ? /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(import_jsx_runtime5.Fragment, { children: [
8610
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_react107.Spinner, { size: "inherit", color: "inherit" }),
8611
+ loadingText
8612
+ ] }) : children
8613
+ }
8614
+ );
8615
+ }
8616
+ );
8617
+
8618
+ // src/components/checkbox/checkbox.tsx
8619
+ var import_react108 = require("react");
8620
+ var import_react109 = require("@chakra-ui/react");
8621
+ var import_jsx_runtime6 = require("react/jsx-runtime");
8622
+ var Checkbox = (0, import_react108.forwardRef)(
8623
+ function Checkbox2(props2, ref2) {
8624
+ const { icon, children, inputProps, rootRef, ...rest } = props2;
8625
+ return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(import_react109.Checkbox.Root, { ref: rootRef, ...rest, children: [
8626
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_react109.Checkbox.HiddenInput, { ref: ref2, ...inputProps }),
8627
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_react109.Checkbox.Control, { children: icon || /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_react109.Checkbox.Indicator, {}) }),
8628
+ children != null && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_react109.Checkbox.Label, { children })
8629
+ ] });
8630
+ }
8631
+ );
8632
+
8633
+ // src/components/close-button/close-button.tsx
8634
+ var import_react111 = require("react");
8635
+ var import_react112 = require("@chakra-ui/react");
8636
+
8637
+ // src/components/icons/create-icon.tsx
8638
+ var import_react110 = require("@chakra-ui/react");
8639
+ var createIcon = (props2) => {
8640
+ return (0, import_react110.createIcon)({
8641
+ viewBox: "0 0 24 24",
8642
+ defaultProps: {
8643
+ fill: "none",
8644
+ stroke: "currentColor",
8645
+ strokeWidth: "2",
8646
+ strokeLinecap: "round",
8647
+ strokeLinejoin: "round"
8648
+ },
8649
+ ...props2
8650
+ });
8651
+ };
8652
+
8653
+ // src/components/icons/icons.tsx
8654
+ var import_jsx_runtime7 = require("react/jsx-runtime");
8655
+ var ChevronUpIcon = createIcon({
8656
+ displayName: "ChevronUpIcon",
8657
+ path: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("polyline", { points: "18 15 12 9 6 15" })
8658
+ });
8659
+ var ChevronDownIcon = createIcon({
8660
+ displayName: "ChevronDownIcon",
8661
+ path: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("polyline", { points: "6 9 12 15 18 9" })
8662
+ });
8663
+ var ChevronLeftIcon = createIcon({
8664
+ displayName: "ChevronLeftIcon",
8665
+ path: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("polyline", { points: "15 18 9 12 15 6" })
8666
+ });
8667
+ var ChevronRightIcon = createIcon({
8668
+ displayName: "ChevronRightIcon",
8669
+ path: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("polyline", { points: "9 18 15 12 9 6" })
8670
+ });
8671
+ var HamburgerIcon = createIcon({
8672
+ displayName: "ChevronDownIcon",
8673
+ path: /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("g", { fill: "none", children: [
8674
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("line", { x1: "3", y1: "12", x2: "21", y2: "12" }),
8675
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("line", { x1: "3", y1: "6", x2: "21", y2: "6" }),
8676
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("line", { x1: "3", y1: "18", x2: "21", y2: "18" })
8677
+ ] })
8678
+ });
8679
+ var CloseIcon = createIcon({
8680
+ displayName: "CloseIcon",
8681
+ path: /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("g", { children: [
8682
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("line", { x1: "18", y1: "6", x2: "6", y2: "18" }),
8683
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("line", { x1: "6", y1: "6", x2: "18", y2: "18" })
8684
+ ] })
8685
+ });
8686
+ var FilterIcon = createIcon({
8687
+ displayName: "FilterIcon",
8688
+ path: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("polygon", { points: "22 3 2 3 10 12.46 10 19 14 21 14 12.46 22 3" })
8689
+ });
8690
+ var CalendarIcon = createIcon({
8691
+ displayName: "CalendarIcon",
8692
+ path: /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("g", { children: [
8693
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("rect", { x: "3", y: "4", width: "18", height: "18", rx: "2", ry: "2" }),
8694
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("line", { x1: "16", y1: "2", x2: "16", y2: "6" }),
8695
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("line", { x1: "8", y1: "2", x2: "8", y2: "6" }),
8696
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("line", { x1: "3", y1: "10", x2: "21", y2: "10" })
8697
+ ] })
8698
+ });
8699
+ var PlusIcon = createIcon({
8700
+ displayName: "PlusIcon",
8701
+ path: /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("g", { children: [
8702
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("line", { x1: "12", y1: "5", x2: "12", y2: "19" }),
8703
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("line", { x1: "5", y1: "12", x2: "19", y2: "12" })
8704
+ ] })
8705
+ });
8706
+ var MinusIcon = createIcon({
8707
+ displayName: "MinusIcon",
8708
+ path: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("g", { children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("line", { x1: "5", y1: "12", x2: "19", y2: "12" }) })
8709
+ });
8710
+ var ViewOffIcon = createIcon({
8711
+ displayName: "ViewOffIcon",
8712
+ path: /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("g", { children: [
8713
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("path", { d: "M17.94 17.94A10.07 10.07 0 0 1 12 20c-7 0-11-8-11-8a18.45 18.45 0 0 1 5.06-5.94M9.9 4.24A9.12 9.12 0 0 1 12 4c7 0 11 8 11 8a18.5 18.5 0 0 1-2.16 3.19m-6.72-1.07a3 3 0 1 1-4.24-4.24" }),
8714
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("line", { x1: "1", y1: "1", x2: "23", y2: "23" })
8715
+ ] })
8716
+ });
8717
+ var ViewIcon = createIcon({
8718
+ displayName: "ViewOffIcon",
8719
+ path: /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("g", { children: [
8720
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("path", { d: "M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z" }),
8721
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("circle", { cx: "12", cy: "12", r: "3" })
8722
+ ] })
8723
+ });
8724
+ var SearchIcon = createIcon({
8725
+ displayName: "SearchIcon",
8726
+ path: /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("g", { children: [
8727
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("circle", { cx: "11", cy: "11", r: "8" }),
8728
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("line", { x1: "21", y1: "21", x2: "16.65", y2: "16.65" })
8729
+ ] })
8730
+ });
8731
+ var CheckIcon = createIcon({
8732
+ displayName: "CheckIcon",
8733
+ path: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("g", { children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("polyline", { points: "20 6 9 17 4 12" }) })
8734
+ });
8735
+
8736
+ // src/components/close-button/close-button.tsx
8737
+ var import_jsx_runtime8 = require("react/jsx-runtime");
8738
+ var CloseButton = (0, import_react111.forwardRef)(
8739
+ function CloseButton2(props2, ref2) {
8740
+ var _a7;
8741
+ return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_react112.IconButton, { variant: "ghost", "aria-label": "Close", ref: ref2, ...props2, children: (_a7 = props2.children) != null ? _a7 : /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(CloseIcon, {}) });
8742
+ }
8743
+ );
8744
+
8745
+ // src/components/command/command.tsx
8746
+ var import_react113 = require("@chakra-ui/react");
8747
+ var import_react114 = require("@chakra-ui/react");
8748
+ var import_jsx_runtime9 = require("react/jsx-runtime");
8749
+ var { withContext: withContext2 } = (0, import_react114.createRecipeContext)({
8750
+ key: "suiCommand"
8751
+ });
8752
+ var Key = ({ children }) => {
8753
+ if (typeof children !== "string") {
8754
+ return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_jsx_runtime9.Fragment, { children });
8755
+ }
8756
+ if (["then", "or", "+"].includes(children)) {
8757
+ return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { children });
8758
+ }
8759
+ return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_react113.Kbd, { children });
8760
+ };
8761
+ var Command = (props2) => {
8762
+ const { children, ...rest } = props2;
8763
+ if (typeof children !== "string") {
8764
+ return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_jsx_runtime9.Fragment, { children });
8765
+ }
8766
+ const keys = children.split(/\s|\+/);
8767
+ return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(CommandRoot, { ...rest, children: keys.map((key) => /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(Key, { children: key }, key)) });
8768
+ };
8769
+ var CommandRoot = withContext2("span");
8770
+
8771
+ // src/components/dialog/namespace.ts
8772
+ var namespace_exports2 = {};
8773
+ __export(namespace_exports2, {
8774
+ ActionTrigger: () => DialogActionTrigger,
8775
+ Backdrop: () => DialogBackdrop,
8776
+ Body: () => DialogBody,
8777
+ CloseTrigger: () => DialogCloseTrigger,
8778
+ Content: () => DialogContent,
8779
+ Context: () => DialogContext,
8780
+ Description: () => DialogDescription,
8781
+ Footer: () => DialogFooter,
8782
+ Header: () => DialogHeader,
8783
+ Root: () => DialogRoot,
8784
+ Title: () => DialogTitle,
8785
+ Trigger: () => DialogTrigger
8786
+ });
8787
+
8788
+ // src/components/dialog/dialog.tsx
8789
+ var import_react121 = require("react");
8790
+ var import_react122 = require("@chakra-ui/react");
8791
+
8792
+ // ../../node_modules/proxy-compare/dist/index.js
8793
+ var TRACK_MEMO_SYMBOL = Symbol();
8794
+ var GET_ORIGINAL_SYMBOL = Symbol();
8795
+ var AFFECTED_PROPERTY = "a";
8796
+ var IS_TARGET_COPIED_PROPERTY = "f";
8797
+ var PROXY_PROPERTY = "p";
8798
+ var PROXY_CACHE_PROPERTY = "c";
8799
+ var TARGET_CACHE_PROPERTY = "t";
8800
+ var NEXT_OBJECT_PROPERTY = "n";
8801
+ var CHANGED_PROPERTY = "g";
8802
+ var HAS_KEY_PROPERTY = "h";
8803
+ var ALL_OWN_KEYS_PROPERTY = "w";
8804
+ var HAS_OWN_KEY_PROPERTY = "o";
8805
+ var KEYS_PROPERTY = "k";
8806
+ var newProxy = (target, handler) => new Proxy(target, handler);
8807
+ var getProto = Object.getPrototypeOf;
8808
+ var objectsToTrack = /* @__PURE__ */ new WeakMap();
8809
+ var isObjectToTrack = (obj) => obj && (objectsToTrack.has(obj) ? objectsToTrack.get(obj) : getProto(obj) === Object.prototype || getProto(obj) === Array.prototype);
8810
+ var isObject = (x) => typeof x === "object" && x !== null;
8811
+ var needsToCopyTargetObject = (obj) => Object.values(Object.getOwnPropertyDescriptors(obj)).some((descriptor) => !descriptor.configurable && !descriptor.writable);
8812
+ var copyTargetObject = (obj) => {
8813
+ if (Array.isArray(obj)) {
8814
+ return Array.from(obj);
8815
+ }
8816
+ const descriptors = Object.getOwnPropertyDescriptors(obj);
8817
+ Object.values(descriptors).forEach((desc) => {
8818
+ desc.configurable = true;
8819
+ });
8820
+ return Object.create(getProto(obj), descriptors);
8821
+ };
8822
+ var createProxyHandler = (origObj, isTargetCopied) => {
8823
+ const state = {
8824
+ [IS_TARGET_COPIED_PROPERTY]: isTargetCopied
8825
+ };
8826
+ let trackObject = false;
8827
+ const recordUsage = (type, key) => {
8828
+ if (!trackObject) {
8829
+ let used = state[AFFECTED_PROPERTY].get(origObj);
8830
+ if (!used) {
8831
+ used = {};
8832
+ state[AFFECTED_PROPERTY].set(origObj, used);
8833
+ }
8834
+ if (type === ALL_OWN_KEYS_PROPERTY) {
8835
+ used[ALL_OWN_KEYS_PROPERTY] = true;
8836
+ } else {
8837
+ let set2 = used[type];
8838
+ if (!set2) {
8839
+ set2 = /* @__PURE__ */ new Set();
8840
+ used[type] = set2;
8841
+ }
8842
+ set2.add(key);
8843
+ }
8844
+ }
8845
+ };
8846
+ const recordObjectAsUsed = () => {
8847
+ trackObject = true;
8848
+ state[AFFECTED_PROPERTY].delete(origObj);
8849
+ };
8850
+ const handler = {
8851
+ get(target, key) {
8852
+ if (key === GET_ORIGINAL_SYMBOL) {
8853
+ return origObj;
8854
+ }
8855
+ recordUsage(KEYS_PROPERTY, key);
8856
+ return createProxy(Reflect.get(target, key), state[AFFECTED_PROPERTY], state[PROXY_CACHE_PROPERTY], state[TARGET_CACHE_PROPERTY]);
8857
+ },
8858
+ has(target, key) {
8859
+ if (key === TRACK_MEMO_SYMBOL) {
8860
+ recordObjectAsUsed();
8861
+ return true;
8862
+ }
8863
+ recordUsage(HAS_KEY_PROPERTY, key);
8864
+ return Reflect.has(target, key);
8865
+ },
8866
+ getOwnPropertyDescriptor(target, key) {
8867
+ recordUsage(HAS_OWN_KEY_PROPERTY, key);
8868
+ return Reflect.getOwnPropertyDescriptor(target, key);
8869
+ },
8870
+ ownKeys(target) {
8871
+ recordUsage(ALL_OWN_KEYS_PROPERTY);
8872
+ return Reflect.ownKeys(target);
8873
+ }
8874
+ };
8875
+ if (isTargetCopied) {
8876
+ handler.set = handler.deleteProperty = () => false;
8877
+ }
8878
+ return [handler, state];
8879
+ };
8880
+ var getOriginalObject = (obj) => (
8881
+ // unwrap proxy
8882
+ obj[GET_ORIGINAL_SYMBOL] || // otherwise
8883
+ obj
8884
+ );
8885
+ var createProxy = (obj, affected, proxyCache, targetCache2) => {
8886
+ if (!isObjectToTrack(obj))
8887
+ return obj;
8888
+ let targetAndCopied = targetCache2 && targetCache2.get(obj);
8889
+ if (!targetAndCopied) {
8890
+ const target2 = getOriginalObject(obj);
8891
+ if (needsToCopyTargetObject(target2)) {
8892
+ targetAndCopied = [target2, copyTargetObject(target2)];
8893
+ } else {
8894
+ targetAndCopied = [target2];
8895
+ }
8896
+ targetCache2 === null || targetCache2 === void 0 ? void 0 : targetCache2.set(obj, targetAndCopied);
8897
+ }
8898
+ const [target, copiedTarget] = targetAndCopied;
8899
+ let handlerAndState = proxyCache && proxyCache.get(target);
8900
+ if (!handlerAndState || handlerAndState[1][IS_TARGET_COPIED_PROPERTY] !== !!copiedTarget) {
8901
+ handlerAndState = createProxyHandler(target, !!copiedTarget);
8902
+ handlerAndState[1][PROXY_PROPERTY] = newProxy(copiedTarget || target, handlerAndState[0]);
8903
+ if (proxyCache) {
8904
+ proxyCache.set(target, handlerAndState);
8905
+ }
8906
+ }
8907
+ handlerAndState[1][AFFECTED_PROPERTY] = affected;
8908
+ handlerAndState[1][PROXY_CACHE_PROPERTY] = proxyCache;
8909
+ handlerAndState[1][TARGET_CACHE_PROPERTY] = targetCache2;
8910
+ return handlerAndState[1][PROXY_PROPERTY];
8911
+ };
8912
+ var isAllOwnKeysChanged = (prevObj, nextObj) => {
8913
+ const prevKeys = Reflect.ownKeys(prevObj);
8914
+ const nextKeys = Reflect.ownKeys(nextObj);
8915
+ return prevKeys.length !== nextKeys.length || prevKeys.some((k, i) => k !== nextKeys[i]);
8916
+ };
8917
+ var isChanged = (prevObj, nextObj, affected, cache, isEqual2 = Object.is) => {
8918
+ if (isEqual2(prevObj, nextObj)) {
8919
+ return false;
8920
+ }
8921
+ if (!isObject(prevObj) || !isObject(nextObj))
8922
+ return true;
8923
+ const used = affected.get(getOriginalObject(prevObj));
8924
+ if (!used)
8925
+ return true;
8926
+ if (cache) {
8927
+ const hit = cache.get(prevObj);
8928
+ if (hit && hit[NEXT_OBJECT_PROPERTY] === nextObj) {
8929
+ return hit[CHANGED_PROPERTY];
8930
+ }
8931
+ cache.set(prevObj, {
8932
+ [NEXT_OBJECT_PROPERTY]: nextObj,
8933
+ [CHANGED_PROPERTY]: false
8934
+ });
8935
+ }
8936
+ let changed = null;
8937
+ try {
8938
+ for (const key of used[HAS_KEY_PROPERTY] || []) {
8939
+ changed = Reflect.has(prevObj, key) !== Reflect.has(nextObj, key);
8940
+ if (changed)
8941
+ return changed;
8942
+ }
8943
+ if (used[ALL_OWN_KEYS_PROPERTY] === true) {
8944
+ changed = isAllOwnKeysChanged(prevObj, nextObj);
8945
+ if (changed)
8946
+ return changed;
8947
+ } else {
8948
+ for (const key of used[HAS_OWN_KEY_PROPERTY] || []) {
8949
+ const hasPrev = !!Reflect.getOwnPropertyDescriptor(prevObj, key);
8950
+ const hasNext = !!Reflect.getOwnPropertyDescriptor(nextObj, key);
8951
+ changed = hasPrev !== hasNext;
8952
+ if (changed)
8953
+ return changed;
8954
+ }
8955
+ }
8956
+ for (const key of used[KEYS_PROPERTY] || []) {
8957
+ changed = isChanged(prevObj[key], nextObj[key], affected, cache, isEqual2);
8958
+ if (changed)
8959
+ return changed;
8960
+ }
8961
+ if (changed === null)
8962
+ changed = true;
8963
+ return changed;
8964
+ } finally {
8965
+ if (cache) {
8966
+ cache.set(prevObj, {
8967
+ [NEXT_OBJECT_PROPERTY]: nextObj,
8968
+ [CHANGED_PROPERTY]: changed
8969
+ });
8970
+ }
8971
+ }
8972
+ };
8973
+ var getUntracked = (obj) => {
8974
+ if (isObjectToTrack(obj)) {
8975
+ return obj[GET_ORIGINAL_SYMBOL] || null;
8976
+ }
8977
+ return null;
8978
+ };
8979
+ var markToTrack = (obj, mark = true) => {
8980
+ objectsToTrack.set(obj, mark);
8981
+ };
8982
+
8983
+ // ../../node_modules/@zag-js/store/dist/index.mjs
8984
+ function getGlobal() {
8985
+ if (typeof globalThis !== "undefined") return globalThis;
8986
+ if (typeof self !== "undefined") return self;
8987
+ if (typeof window !== "undefined") return window;
8988
+ if (typeof global !== "undefined") return global;
8989
+ }
8990
+ function makeGlobal(key, value) {
8991
+ const g = getGlobal();
8992
+ if (!g) return value();
8993
+ g[key] || (g[key] = value());
8994
+ return g[key];
8995
+ }
8996
+ var isDev = () => process.env.NODE_ENV !== "production";
8997
+ var isObject2 = (x) => typeof x === "object" && x !== null;
8998
+ var proxyStateMap = makeGlobal("__zag__proxyStateMap", () => /* @__PURE__ */ new WeakMap());
8999
+ var refSet = makeGlobal("__zag__refSet", () => /* @__PURE__ */ new WeakSet());
9000
+ var isReactElement = (x) => typeof x === "object" && x !== null && "$$typeof" in x;
9001
+ var isVueElement = (x) => typeof x === "object" && x !== null && "__v_isVNode" in x;
9002
+ var isDOMElement = (x) => typeof x === "object" && x !== null && "nodeType" in x && typeof x.nodeName === "string";
9003
+ var isElement = (x) => isReactElement(x) || isVueElement(x) || isDOMElement(x);
9004
+ var buildProxyFunction = (objectIs = Object.is, newProxy2 = (target, handler) => new Proxy(target, handler), canProxy = (x) => isObject2(x) && !refSet.has(x) && (Array.isArray(x) || !(Symbol.iterator in x)) && !isElement(x) && !(x instanceof WeakMap) && !(x instanceof WeakSet) && !(x instanceof Error) && !(x instanceof Number) && !(x instanceof Date) && !(x instanceof String) && !(x instanceof RegExp) && !(x instanceof ArrayBuffer), defaultHandlePromise = (promise) => {
9005
+ switch (promise.status) {
9006
+ case "fulfilled":
9007
+ return promise.value;
9008
+ case "rejected":
9009
+ throw promise.reason;
9010
+ default:
9011
+ throw promise;
9012
+ }
9013
+ }, snapCache = /* @__PURE__ */ new WeakMap(), createSnapshot = (target, version, handlePromise = defaultHandlePromise) => {
9014
+ const cache = snapCache.get(target);
9015
+ if ((cache == null ? void 0 : cache[0]) === version) {
9016
+ return cache[1];
9017
+ }
9018
+ const snap = Array.isArray(target) ? [] : Object.create(Object.getPrototypeOf(target));
9019
+ markToTrack(snap, true);
9020
+ snapCache.set(target, [version, snap]);
9021
+ Reflect.ownKeys(target).forEach((key) => {
9022
+ const value = Reflect.get(target, key);
9023
+ if (refSet.has(value)) {
9024
+ markToTrack(value, false);
9025
+ snap[key] = value;
9026
+ } else if (value instanceof Promise) {
9027
+ Object.defineProperty(snap, key, {
9028
+ get() {
9029
+ return handlePromise(value);
9030
+ }
9031
+ });
9032
+ } else if (proxyStateMap.has(value)) {
9033
+ snap[key] = snapshot(value, handlePromise);
9034
+ } else {
9035
+ snap[key] = value;
9036
+ }
9037
+ });
9038
+ return Object.freeze(snap);
9039
+ }, proxyCache = /* @__PURE__ */ new WeakMap(), versionHolder = [1, 1], proxyFunction2 = (initialObject) => {
9040
+ if (!isObject2(initialObject)) {
9041
+ throw new Error("object required");
9042
+ }
9043
+ const found = proxyCache.get(initialObject);
9044
+ if (found) {
9045
+ return found;
9046
+ }
9047
+ let version = versionHolder[0];
9048
+ const listeners = /* @__PURE__ */ new Set();
9049
+ const notifyUpdate = (op, nextVersion = ++versionHolder[0]) => {
9050
+ if (version !== nextVersion) {
9051
+ version = nextVersion;
9052
+ listeners.forEach((listener) => listener(op, nextVersion));
9053
+ }
9054
+ };
9055
+ let checkVersion = versionHolder[1];
9056
+ const ensureVersion = (nextCheckVersion = ++versionHolder[1]) => {
9057
+ if (checkVersion !== nextCheckVersion && !listeners.size) {
9058
+ checkVersion = nextCheckVersion;
9059
+ propProxyStates.forEach(([propProxyState]) => {
9060
+ const propVersion = propProxyState[1](nextCheckVersion);
9061
+ if (propVersion > version) {
9062
+ version = propVersion;
9063
+ }
9064
+ });
9065
+ }
9066
+ return version;
9067
+ };
9068
+ const createPropListener = (prop) => (op, nextVersion) => {
9069
+ const newOp = [...op];
9070
+ newOp[1] = [prop, ...newOp[1]];
9071
+ notifyUpdate(newOp, nextVersion);
9072
+ };
9073
+ const propProxyStates = /* @__PURE__ */ new Map();
9074
+ const addPropListener = (prop, propProxyState) => {
9075
+ if (isDev() && propProxyStates.has(prop)) {
9076
+ throw new Error("prop listener already exists");
9077
+ }
9078
+ if (listeners.size) {
9079
+ const remove = propProxyState[3](createPropListener(prop));
9080
+ propProxyStates.set(prop, [propProxyState, remove]);
9081
+ } else {
9082
+ propProxyStates.set(prop, [propProxyState]);
9083
+ }
9084
+ };
9085
+ const removePropListener = (prop) => {
9086
+ var _a7;
9087
+ const entry = propProxyStates.get(prop);
9088
+ if (entry) {
9089
+ propProxyStates.delete(prop);
9090
+ (_a7 = entry[1]) == null ? void 0 : _a7.call(entry);
9091
+ }
9092
+ };
9093
+ const addListener = (listener) => {
9094
+ listeners.add(listener);
9095
+ if (listeners.size === 1) {
9096
+ propProxyStates.forEach(([propProxyState, prevRemove], prop) => {
9097
+ if (isDev() && prevRemove) {
9098
+ throw new Error("remove already exists");
9099
+ }
9100
+ const remove = propProxyState[3](createPropListener(prop));
9101
+ propProxyStates.set(prop, [propProxyState, remove]);
9102
+ });
9103
+ }
9104
+ const removeListener = () => {
9105
+ listeners.delete(listener);
9106
+ if (listeners.size === 0) {
9107
+ propProxyStates.forEach(([propProxyState, remove], prop) => {
9108
+ if (remove) {
9109
+ remove();
9110
+ propProxyStates.set(prop, [propProxyState]);
9111
+ }
9112
+ });
9113
+ }
9114
+ };
9115
+ return removeListener;
9116
+ };
9117
+ const baseObject = Array.isArray(initialObject) ? [] : Object.create(Object.getPrototypeOf(initialObject));
9118
+ const handler = {
9119
+ deleteProperty(target, prop) {
9120
+ const prevValue = Reflect.get(target, prop);
9121
+ removePropListener(prop);
9122
+ const deleted = Reflect.deleteProperty(target, prop);
9123
+ if (deleted) {
9124
+ notifyUpdate(["delete", [prop], prevValue]);
9125
+ }
9126
+ return deleted;
9127
+ },
9128
+ set(target, prop, value, receiver) {
9129
+ var _a7;
9130
+ const hasPrevValue = Reflect.has(target, prop);
9131
+ const prevValue = Reflect.get(target, prop, receiver);
9132
+ if (hasPrevValue && (objectIs(prevValue, value) || proxyCache.has(value) && objectIs(prevValue, proxyCache.get(value)))) {
9133
+ return true;
9134
+ }
9135
+ removePropListener(prop);
9136
+ if (isObject2(value)) {
9137
+ value = getUntracked(value) || value;
9138
+ }
9139
+ let nextValue = value;
9140
+ if ((_a7 = Object.getOwnPropertyDescriptor(target, prop)) == null ? void 0 : _a7.set) ;
9141
+ else if (value instanceof Promise) {
9142
+ value.then((v) => {
9143
+ Object.assign(value, { status: "fulfilled", value: v });
9144
+ notifyUpdate(["resolve", [prop], v]);
9145
+ }).catch((e) => {
9146
+ Object.assign(value, { status: "rejected", reason: e });
9147
+ notifyUpdate(["reject", [prop], e]);
9148
+ });
9149
+ } else {
9150
+ if (!proxyStateMap.has(value) && canProxy(value)) {
9151
+ nextValue = proxy(value);
9152
+ }
9153
+ const childProxyState = !refSet.has(nextValue) && proxyStateMap.get(nextValue);
9154
+ if (childProxyState) {
9155
+ addPropListener(prop, childProxyState);
9156
+ }
9157
+ }
9158
+ Reflect.set(target, prop, nextValue, receiver);
9159
+ notifyUpdate(["set", [prop], value, prevValue]);
9160
+ return true;
9161
+ }
9162
+ };
9163
+ const proxyObject = newProxy2(baseObject, handler);
9164
+ proxyCache.set(initialObject, proxyObject);
9165
+ const proxyState = [baseObject, ensureVersion, createSnapshot, addListener];
9166
+ proxyStateMap.set(proxyObject, proxyState);
9167
+ Reflect.ownKeys(initialObject).forEach((key) => {
9168
+ const desc = Object.getOwnPropertyDescriptor(initialObject, key);
9169
+ if (desc.get || desc.set) {
9170
+ Object.defineProperty(baseObject, key, desc);
9171
+ } else {
9172
+ proxyObject[key] = initialObject[key];
9173
+ }
9174
+ });
9175
+ return proxyObject;
9176
+ }) => [
9177
+ // public functions
9178
+ proxyFunction2,
9179
+ // shared state
9180
+ proxyStateMap,
9181
+ refSet,
9182
+ // internal things
9183
+ objectIs,
9184
+ newProxy2,
9185
+ canProxy,
9186
+ defaultHandlePromise,
9187
+ snapCache,
9188
+ createSnapshot,
9189
+ proxyCache,
9190
+ versionHolder
9191
+ ];
9192
+ var [proxyFunction] = buildProxyFunction();
9193
+ function proxy(initialObject = {}) {
9194
+ return proxyFunction(initialObject);
9195
+ }
9196
+ function subscribe(proxyObject, callback, notifyInSync) {
9197
+ const proxyState = proxyStateMap.get(proxyObject);
9198
+ if (isDev() && !proxyState) {
9199
+ console.warn("Please use proxy object");
9200
+ }
9201
+ let promise;
9202
+ const ops = [];
9203
+ const addListener = proxyState[3];
9204
+ let isListenerActive = false;
9205
+ const listener = (op) => {
9206
+ ops.push(op);
9207
+ if (notifyInSync) {
9208
+ callback(ops.splice(0));
9209
+ return;
9210
+ }
9211
+ if (!promise) {
9212
+ promise = Promise.resolve().then(() => {
9213
+ promise = void 0;
9214
+ if (isListenerActive) {
9215
+ callback(ops.splice(0));
9216
+ }
9217
+ });
9218
+ }
9219
+ };
9220
+ const removeListener = addListener(listener);
9221
+ isListenerActive = true;
9222
+ return () => {
9223
+ isListenerActive = false;
9224
+ removeListener();
9225
+ };
9226
+ }
9227
+ function snapshot(proxyObject, handlePromise) {
9228
+ const proxyState = proxyStateMap.get(proxyObject);
9229
+ if (isDev() && !proxyState) {
9230
+ console.warn("Please use proxy object");
9231
+ }
9232
+ const [target, ensureVersion, createSnapshot] = proxyState;
9233
+ return createSnapshot(target, ensureVersion(), handlePromise);
9234
+ }
9235
+ function ref(obj) {
9236
+ refSet.add(obj);
9237
+ return obj;
9238
+ }
9239
+ function proxyWithComputed(initialObject, computedFns) {
9240
+ const keys = Object.keys(computedFns);
9241
+ keys.forEach((key) => {
9242
+ if (Object.getOwnPropertyDescriptor(initialObject, key)) {
9243
+ throw new Error("object property already defined");
9244
+ }
9245
+ const computedFn = computedFns[key];
9246
+ const { get, set: set2 } = typeof computedFn === "function" ? { get: computedFn } : computedFn;
9247
+ const desc = {};
9248
+ desc.get = () => get(snapshot(proxyObject));
9249
+ if (set2) {
9250
+ desc.set = (newValue) => set2(proxyObject, newValue);
9251
+ }
9252
+ Object.defineProperty(initialObject, key, desc);
9253
+ });
9254
+ const proxyObject = proxy(initialObject);
9255
+ return proxyObject;
9256
+ }
9257
+
9258
+ // ../../node_modules/@zag-js/utils/dist/index.mjs
9259
+ function clear(v) {
9260
+ while (v.length > 0) v.pop();
9261
+ return v;
9262
+ }
9263
+ var runIfFn = (v, ...a) => {
9264
+ const res = typeof v === "function" ? v(...a) : v;
9265
+ return res != null ? res : void 0;
9266
+ };
9267
+ var cast = (v) => v;
9268
+ var noop = () => {
9269
+ };
9270
+ var callAll = (...fns) => (...a) => {
9271
+ fns.forEach(function(fn) {
9272
+ fn == null ? void 0 : fn(...a);
9273
+ });
9274
+ };
9275
+ var uuid = /* @__PURE__ */ (() => {
9276
+ let id = 0;
9277
+ return () => {
9278
+ id++;
9279
+ return id.toString(36);
9280
+ };
9281
+ })();
9282
+ var isDev2 = () => process.env.NODE_ENV !== "production";
9283
+ var isArray = (v) => Array.isArray(v);
9284
+ var isObjectLike = (v) => v != null && typeof v === "object";
9285
+ var isObject3 = (v) => isObjectLike(v) && !isArray(v);
9286
+ var isNumber = (v) => typeof v === "number" && !Number.isNaN(v);
9287
+ var isString = (v) => typeof v === "string";
9288
+ var isFunction = (v) => typeof v === "function";
9289
+ var hasProp = (obj, prop) => Object.prototype.hasOwnProperty.call(obj, prop);
9290
+ var baseGetTag = (v) => Object.prototype.toString.call(v);
9291
+ var fnToString = Function.prototype.toString;
9292
+ var objectCtorString = fnToString.call(Object);
9293
+ var isPlainObject = (v) => {
9294
+ if (!isObjectLike(v) || baseGetTag(v) != "[object Object]") return false;
9295
+ const proto = Object.getPrototypeOf(v);
9296
+ if (proto === null) return true;
9297
+ const Ctor = hasProp(proto, "constructor") && proto.constructor;
9298
+ return typeof Ctor == "function" && Ctor instanceof Ctor && fnToString.call(Ctor) == objectCtorString;
9299
+ };
9300
+ function compact(obj) {
9301
+ if (!isPlainObject2(obj) || obj === void 0) {
9302
+ return obj;
9303
+ }
9304
+ const keys = Reflect.ownKeys(obj).filter((key) => typeof key === "string");
9305
+ const filtered = {};
9306
+ for (const key of keys) {
9307
+ const value = obj[key];
9308
+ if (value !== void 0) {
9309
+ filtered[key] = compact(value);
9310
+ }
9311
+ }
9312
+ return filtered;
9313
+ }
9314
+ var isPlainObject2 = (value) => {
9315
+ return value && typeof value === "object" && value.constructor === Object;
9316
+ };
9317
+ function warn(...a) {
9318
+ const m = a.length === 1 ? a[0] : a[1];
9319
+ const c = a.length === 2 ? a[0] : true;
9320
+ if (c && process.env.NODE_ENV !== "production") {
9321
+ console.warn(m);
9322
+ }
9323
+ }
9324
+ function invariant(...a) {
9325
+ const m = a.length === 1 ? a[0] : a[1];
9326
+ const c = a.length === 2 ? a[0] : true;
9327
+ if (c && process.env.NODE_ENV !== "production") {
9328
+ throw new Error(m);
9329
+ }
9330
+ }
9331
+
9332
+ // ../../node_modules/klona/full/index.mjs
9333
+ function set(obj, key, val) {
9334
+ if (typeof val.value === "object") val.value = klona(val.value);
9335
+ if (!val.enumerable || val.get || val.set || !val.configurable || !val.writable || key === "__proto__") {
9336
+ Object.defineProperty(obj, key, val);
9337
+ } else obj[key] = val.value;
9338
+ }
9339
+ function klona(x) {
9340
+ if (typeof x !== "object") return x;
9341
+ var i = 0, k, list, tmp, str = Object.prototype.toString.call(x);
9342
+ if (str === "[object Object]") {
9343
+ tmp = Object.create(x.__proto__ || null);
9344
+ } else if (str === "[object Array]") {
9345
+ tmp = Array(x.length);
9346
+ } else if (str === "[object Set]") {
9347
+ tmp = /* @__PURE__ */ new Set();
9348
+ x.forEach(function(val) {
9349
+ tmp.add(klona(val));
9350
+ });
9351
+ } else if (str === "[object Map]") {
9352
+ tmp = /* @__PURE__ */ new Map();
9353
+ x.forEach(function(val, key) {
9354
+ tmp.set(klona(key), klona(val));
9355
+ });
9356
+ } else if (str === "[object Date]") {
9357
+ tmp = /* @__PURE__ */ new Date(+x);
9358
+ } else if (str === "[object RegExp]") {
9359
+ tmp = new RegExp(x.source, x.flags);
9360
+ } else if (str === "[object DataView]") {
9361
+ tmp = new x.constructor(klona(x.buffer));
9362
+ } else if (str === "[object ArrayBuffer]") {
9363
+ tmp = x.slice(0);
9364
+ } else if (str.slice(-6) === "Array]") {
9365
+ tmp = new x.constructor(x);
9366
+ }
9367
+ if (tmp) {
9368
+ for (list = Object.getOwnPropertySymbols(x); i < list.length; i++) {
9369
+ set(tmp, list[i], Object.getOwnPropertyDescriptor(x, list[i]));
9370
+ }
9371
+ for (i = 0, list = Object.getOwnPropertyNames(x); i < list.length; i++) {
9372
+ if (Object.hasOwnProperty.call(tmp, k = list[i]) && tmp[k] === x[k]) continue;
9373
+ set(tmp, k, Object.getOwnPropertyDescriptor(x, k));
9374
+ }
9375
+ }
9376
+ return tmp || x;
9377
+ }
9378
+
9379
+ // ../../node_modules/@zag-js/core/dist/index.mjs
9380
+ var __defProp2 = Object.defineProperty;
9381
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp2(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
9382
+ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
9383
+ function deepMerge(source, ...objects) {
9384
+ for (const obj of objects) {
9385
+ const target = compact(obj);
9386
+ for (const key in target) {
9387
+ if (isPlainObject(obj[key])) {
9388
+ if (!source[key]) {
9389
+ source[key] = {};
9390
+ }
9391
+ deepMerge(source[key], obj[key]);
9392
+ } else {
9393
+ source[key] = obj[key];
9394
+ }
9395
+ }
9396
+ }
9397
+ return source;
9398
+ }
9399
+ function structuredClone(v) {
9400
+ return klona(v);
9401
+ }
9402
+ function toEvent(event) {
9403
+ const obj = isString(event) ? { type: event } : event;
9404
+ return obj;
9405
+ }
9406
+ function toArray(value) {
9407
+ if (!value) return [];
9408
+ return isArray(value) ? value.slice() : [value];
9409
+ }
9410
+ function isGuardHelper(value) {
9411
+ return isObject3(value) && value.predicate != null;
9412
+ }
9413
+ var Truthy = () => true;
9414
+ function determineGuardFn(guard, guardMap) {
9415
+ guard = guard != null ? guard : Truthy;
9416
+ return (context, event, meta) => {
9417
+ if (isString(guard)) {
9418
+ const value = guardMap[guard];
9419
+ return isFunction(value) ? value(context, event, meta) : value;
9420
+ }
9421
+ if (isGuardHelper(guard)) {
9422
+ return guard.predicate(guardMap)(context, event, meta);
9423
+ }
9424
+ return guard == null ? void 0 : guard(context, event, meta);
9425
+ };
9426
+ }
9427
+ function determineActionsFn(values, guardMap) {
9428
+ return (context, event, meta) => {
9429
+ if (isGuardHelper(values)) {
9430
+ return values.predicate(guardMap)(context, event, meta);
9431
+ }
9432
+ return values;
9433
+ };
9434
+ }
9435
+ function createProxy2(config) {
9436
+ var _a7, _b6, _c5, _d5, _e5;
9437
+ const computedContext = (_a7 = config.computed) != null ? _a7 : cast({});
9438
+ const initialContext = (_b6 = config.context) != null ? _b6 : cast({});
9439
+ const initialTags = config.initial ? (_d5 = (_c5 = config.states) == null ? void 0 : _c5[config.initial]) == null ? void 0 : _d5.tags : [];
9440
+ const state = proxy({
9441
+ value: (_e5 = config.initial) != null ? _e5 : "",
9442
+ previousValue: "",
9443
+ event: cast({}),
9444
+ previousEvent: cast({}),
9445
+ context: proxyWithComputed(initialContext, computedContext),
9446
+ done: false,
9447
+ tags: initialTags != null ? initialTags : [],
9448
+ hasTag(tag) {
9449
+ return this.tags.includes(tag);
9450
+ },
9451
+ matches(...value) {
9452
+ return value.includes(this.value);
9453
+ },
9454
+ can(event) {
9455
+ return cast(this).nextEvents.includes(event);
9456
+ },
9457
+ get nextEvents() {
9458
+ var _a8, _b7, _c6, _d6;
9459
+ const stateEvents = (_c6 = (_b7 = (_a8 = config.states) == null ? void 0 : _a8[this.value]) == null ? void 0 : _b7["on"]) != null ? _c6 : {};
9460
+ const globalEvents = (_d6 = config == null ? void 0 : config.on) != null ? _d6 : {};
9461
+ return Object.keys({ ...stateEvents, ...globalEvents });
9462
+ },
9463
+ get changed() {
9464
+ if (this.event.value === "machine.init" || !this.previousValue) return false;
9465
+ return this.value !== this.previousValue;
9466
+ }
9467
+ });
9468
+ return cast(state);
9469
+ }
9470
+ function determineDelayFn(delay, delaysMap) {
9471
+ return (context, event) => {
9472
+ if (isNumber(delay)) return delay;
9473
+ if (isFunction(delay)) {
9474
+ return delay(context, event);
9475
+ }
9476
+ if (isString(delay)) {
9477
+ const value = Number.parseFloat(delay);
9478
+ if (!Number.isNaN(value)) {
9479
+ return value;
9480
+ }
9481
+ if (delaysMap) {
9482
+ const valueOrFn = delaysMap == null ? void 0 : delaysMap[delay];
9483
+ invariant(
9484
+ valueOrFn == null,
9485
+ `[@zag-js/core > determine-delay] Cannot determine delay for \`${delay}\`. It doesn't exist in \`options.delays\``
9486
+ );
9487
+ return isFunction(valueOrFn) ? valueOrFn(context, event) : valueOrFn;
9488
+ }
9489
+ }
9490
+ };
9491
+ }
9492
+ function toTarget(target) {
9493
+ return isString(target) ? { target } : target;
9494
+ }
9495
+ function determineTransitionFn(transitions, guardMap) {
9496
+ return (context, event, meta) => {
9497
+ return toArray(transitions).map(toTarget).find((transition) => {
9498
+ var _a7;
9499
+ const determineGuard = determineGuardFn(transition.guard, guardMap);
9500
+ const guard = determineGuard(context, event, meta);
9501
+ return (_a7 = guard != null ? guard : transition.target) != null ? _a7 : transition.actions;
9502
+ });
9503
+ };
9504
+ }
9505
+ var Machine = class {
9506
+ // Let's get started!
9507
+ constructor(config, options) {
9508
+ var _a7, _b6, _c5, _d5, _e5, _f5, _g5, _h3, _i3, _j3, _k3;
9509
+ __publicField(
9510
+ this,
9511
+ "status",
9512
+ "Not Started"
9513
+ /* NotStarted */
9514
+ );
9515
+ __publicField(this, "state");
9516
+ __publicField(this, "initialState");
9517
+ __publicField(this, "initialContext");
9518
+ __publicField(this, "id");
9519
+ __publicField(
9520
+ this,
9521
+ "type",
9522
+ "machine"
9523
+ /* Machine */
9524
+ );
9525
+ __publicField(this, "activityEvents", /* @__PURE__ */ new Map());
9526
+ __publicField(this, "delayedEvents", /* @__PURE__ */ new Map());
9527
+ __publicField(this, "stateListeners", /* @__PURE__ */ new Set());
9528
+ __publicField(this, "doneListeners", /* @__PURE__ */ new Set());
9529
+ __publicField(this, "contextWatchers", /* @__PURE__ */ new Set());
9530
+ __publicField(this, "removeStateListener", noop);
9531
+ __publicField(this, "parent");
9532
+ __publicField(this, "children", /* @__PURE__ */ new Map());
9533
+ __publicField(this, "guardMap");
9534
+ __publicField(this, "actionMap");
9535
+ __publicField(this, "delayMap");
9536
+ __publicField(this, "activityMap");
9537
+ __publicField(this, "sync");
9538
+ __publicField(this, "options");
9539
+ __publicField(this, "config");
9540
+ __publicField(this, "_created", () => {
9541
+ var _a8;
9542
+ const event = toEvent(
9543
+ "machine.created"
9544
+ /* Created */
9545
+ );
9546
+ this.executeActions((_a8 = this.config) == null ? void 0 : _a8.created, event);
9547
+ });
9548
+ __publicField(this, "start", (init) => {
9549
+ this.state.value = "";
9550
+ this.state.tags = [];
9551
+ if (this.status === "Running") {
9552
+ return this;
9553
+ }
9554
+ this.status = "Running";
9555
+ this.removeStateListener = subscribe(
9556
+ this.state,
9557
+ () => {
9558
+ this.stateListeners.forEach((listener) => {
9559
+ listener(this.stateSnapshot);
9560
+ });
9561
+ },
9562
+ this.sync
9563
+ );
9564
+ this.setupContextWatchers();
9565
+ this.executeActivities(
9566
+ toEvent(
9567
+ "machine.start"
9568
+ /* Start */
9569
+ ),
9570
+ toArray(this.config.activities),
9571
+ "machine.start"
9572
+ /* Start */
9573
+ );
9574
+ this.executeActions(this.config.entry, toEvent(
9575
+ "machine.start"
9576
+ /* Start */
9577
+ ));
9578
+ const event = toEvent(
9579
+ "machine.init"
9580
+ /* Init */
9581
+ );
9582
+ const target = isObject3(init) ? init.value : init;
9583
+ const context = isObject3(init) ? init.context : void 0;
9584
+ if (context) {
9585
+ this.setContext(context);
9586
+ }
9587
+ const transition = {
9588
+ target: target != null ? target : this.config.initial
9589
+ };
9590
+ const next = this.getNextStateInfo(transition, event);
9591
+ this.initialState = next;
9592
+ this.performStateChangeEffects(this.state.value, next, event);
9593
+ return this;
9594
+ });
9595
+ __publicField(this, "setupContextWatchers", () => {
9596
+ const { watch } = this.config;
9597
+ if (!watch) return;
9598
+ let prev = snapshot(this.state.context);
9599
+ const cleanup = subscribe(this.state.context, () => {
9600
+ var _a8, _b7;
9601
+ const next = snapshot(this.state.context);
9602
+ for (const [key, fn] of Object.entries(watch)) {
9603
+ const isEqual2 = (_b7 = (_a8 = this.options.compareFns) == null ? void 0 : _a8[key]) != null ? _b7 : Object.is;
9604
+ if (isEqual2(prev[key], next[key])) continue;
9605
+ this.executeActions(fn, this.state.event);
9606
+ }
9607
+ prev = next;
9608
+ });
9609
+ this.contextWatchers.add(cleanup);
9610
+ });
9611
+ __publicField(this, "stop", () => {
9612
+ if (this.status === "Stopped") return;
9613
+ this.performExitEffects(this.state.value, toEvent(
9614
+ "machine.stop"
9615
+ /* Stop */
9616
+ ));
9617
+ this.executeActions(this.config.exit, toEvent(
9618
+ "machine.stop"
9619
+ /* Stop */
9620
+ ));
9621
+ this.setState("");
9622
+ this.setEvent(
9623
+ "machine.stop"
9624
+ /* Stop */
9625
+ );
9626
+ this.stopStateListeners();
9627
+ this.stopChildren();
9628
+ this.stopActivities();
9629
+ this.stopDelayedEvents();
9630
+ this.stopContextWatchers();
9631
+ this.status = "Stopped";
9632
+ return this;
9633
+ });
9634
+ __publicField(this, "stopStateListeners", () => {
9635
+ this.removeStateListener();
9636
+ this.stateListeners.clear();
9637
+ });
9638
+ __publicField(this, "stopContextWatchers", () => {
9639
+ this.contextWatchers.forEach((fn) => fn());
9640
+ this.contextWatchers.clear();
9641
+ });
9642
+ __publicField(this, "stopDelayedEvents", () => {
9643
+ this.delayedEvents.forEach((state) => {
9644
+ state.forEach((stop) => stop());
9645
+ });
9646
+ this.delayedEvents.clear();
9647
+ });
9648
+ __publicField(this, "stopActivities", (state) => {
9649
+ var _a8, _b7;
9650
+ if (state) {
9651
+ (_a8 = this.activityEvents.get(state)) == null ? void 0 : _a8.forEach((stop) => stop());
9652
+ (_b7 = this.activityEvents.get(state)) == null ? void 0 : _b7.clear();
9653
+ this.activityEvents.delete(state);
9654
+ } else {
9655
+ this.activityEvents.forEach((state2) => {
9656
+ state2.forEach((stop) => stop());
9657
+ state2.clear();
9658
+ });
9659
+ this.activityEvents.clear();
9660
+ }
9661
+ });
9662
+ __publicField(this, "sendChild", (evt, to) => {
9663
+ const event = toEvent(evt);
9664
+ const id = runIfFn(to, this.contextSnapshot);
9665
+ const child = this.children.get(id);
9666
+ if (!child) {
9667
+ invariant(`[@zag-js/core] Cannot send '${event.type}' event to unknown child`);
9668
+ }
9669
+ child.send(event);
9670
+ });
9671
+ __publicField(this, "stopChild", (id) => {
9672
+ if (!this.children.has(id)) {
9673
+ invariant(`[@zag-js/core > stop-child] Cannot stop unknown child ${id}`);
9674
+ }
9675
+ this.children.get(id).stop();
9676
+ this.children.delete(id);
9677
+ });
9678
+ __publicField(this, "removeChild", (id) => {
9679
+ this.children.delete(id);
9680
+ });
9681
+ __publicField(this, "stopChildren", () => {
9682
+ this.children.forEach((child) => child.stop());
9683
+ this.children.clear();
9684
+ });
9685
+ __publicField(this, "setParent", (parent) => {
9686
+ this.parent = parent;
9687
+ });
9688
+ __publicField(this, "spawn", (src, id) => {
9689
+ const actor = runIfFn(src);
9690
+ if (id) actor.id = id;
9691
+ actor.type = "machine.actor";
9692
+ actor.setParent(this);
9693
+ this.children.set(actor.id, cast(actor));
9694
+ actor.onDone(() => {
9695
+ this.removeChild(actor.id);
9696
+ }).start();
9697
+ return cast(ref(actor));
9698
+ });
9699
+ __publicField(this, "stopActivity", (key) => {
9700
+ var _a8;
9701
+ if (!this.state.value) return;
9702
+ const cleanups = this.activityEvents.get(this.state.value);
9703
+ (_a8 = cleanups == null ? void 0 : cleanups.get(key)) == null ? void 0 : _a8();
9704
+ cleanups == null ? void 0 : cleanups.delete(key);
9705
+ });
9706
+ __publicField(this, "addActivityCleanup", (state, key, cleanup) => {
9707
+ var _a8;
9708
+ if (!state) return;
9709
+ if (!this.activityEvents.has(state)) {
9710
+ this.activityEvents.set(state, /* @__PURE__ */ new Map([[key, cleanup]]));
9711
+ } else {
9712
+ (_a8 = this.activityEvents.get(state)) == null ? void 0 : _a8.set(key, cleanup);
9713
+ }
9714
+ });
9715
+ __publicField(this, "setState", (target) => {
9716
+ this.state.previousValue = this.state.value;
9717
+ this.state.value = target;
9718
+ const stateNode = this.getStateNode(target);
9719
+ if (target == null) {
9720
+ clear(this.state.tags);
9721
+ } else {
9722
+ this.state.tags = toArray(stateNode == null ? void 0 : stateNode.tags);
9723
+ }
9724
+ });
9725
+ __publicField(this, "setContext", (context) => {
9726
+ if (!context) return;
9727
+ deepMerge(this.state.context, compact(context));
9728
+ });
9729
+ __publicField(this, "setOptions", (options2) => {
9730
+ const opts = compact(options2);
9731
+ this.actionMap = { ...this.actionMap, ...opts.actions };
9732
+ this.delayMap = { ...this.delayMap, ...opts.delays };
9733
+ this.activityMap = { ...this.activityMap, ...opts.activities };
9734
+ this.guardMap = { ...this.guardMap, ...opts.guards };
9735
+ });
9736
+ __publicField(this, "getStateNode", (state) => {
9737
+ var _a8;
9738
+ if (!state) return;
9739
+ return (_a8 = this.config.states) == null ? void 0 : _a8[state];
9740
+ });
9741
+ __publicField(this, "getNextStateInfo", (transitions, event) => {
9742
+ var _a8;
9743
+ const transition = this.determineTransition(transitions, event);
9744
+ const isTargetless = !(transition == null ? void 0 : transition.target);
9745
+ const target = (_a8 = transition == null ? void 0 : transition.target) != null ? _a8 : this.state.value;
9746
+ const changed = this.state.value !== target;
9747
+ const stateNode = this.getStateNode(target);
9748
+ const reenter = !isTargetless && !changed && !(transition == null ? void 0 : transition.internal);
9749
+ const info = {
9750
+ reenter,
9751
+ transition,
9752
+ stateNode,
9753
+ target,
9754
+ changed
9755
+ };
9756
+ this.log("NextState:", `[${event.type}]`, this.state.value, "---->", info.target);
9757
+ return info;
9758
+ });
9759
+ __publicField(this, "getAfterActions", (transition, delay) => {
9760
+ let id;
9761
+ const current = this.state.value;
9762
+ return {
9763
+ entry: () => {
9764
+ id = globalThis.setTimeout(() => {
9765
+ const next = this.getNextStateInfo(transition, this.state.event);
9766
+ this.performStateChangeEffects(current, next, this.state.event);
9767
+ }, delay);
9768
+ },
9769
+ exit: () => {
9770
+ globalThis.clearTimeout(id);
9771
+ }
9772
+ };
9773
+ });
9774
+ __publicField(this, "getDelayedEventActions", (state) => {
9775
+ const stateNode = this.getStateNode(state);
9776
+ const event = this.state.event;
9777
+ if (!stateNode || !stateNode.after) return;
9778
+ const entries = [];
9779
+ const exits = [];
9780
+ if (isArray(stateNode.after)) {
9781
+ const transition = this.determineTransition(stateNode.after, event);
9782
+ if (!transition) return;
9783
+ if (!hasProp(transition, "delay")) {
9784
+ throw new Error(`[@zag-js/core > after] Delay is required for after transition: ${JSON.stringify(transition)}`);
9785
+ }
9786
+ const determineDelay = determineDelayFn(transition.delay, this.delayMap);
9787
+ const __delay = determineDelay(this.contextSnapshot, event);
9788
+ const actions = this.getAfterActions(transition, __delay);
9789
+ entries.push(actions.entry);
9790
+ exits.push(actions.exit);
9791
+ return { entries, exits };
9792
+ }
9793
+ if (isObject3(stateNode.after)) {
9794
+ for (const delay in stateNode.after) {
9795
+ const transition = stateNode.after[delay];
9796
+ const determineDelay = determineDelayFn(delay, this.delayMap);
9797
+ const __delay = determineDelay(this.contextSnapshot, event);
9798
+ const actions = this.getAfterActions(transition, __delay);
9799
+ entries.push(actions.entry);
9800
+ exits.push(actions.exit);
9801
+ }
9802
+ }
9803
+ return { entries, exits };
9804
+ });
9805
+ __publicField(this, "executeActions", (actions, event) => {
9806
+ var _a8;
9807
+ const pickedActions = determineActionsFn(actions, this.guardMap)(this.contextSnapshot, event, this.guardMeta);
9808
+ for (const action of toArray(pickedActions)) {
9809
+ const fn = isString(action) ? (_a8 = this.actionMap) == null ? void 0 : _a8[action] : action;
9810
+ warn(
9811
+ isString(action) && !fn,
9812
+ `[@zag-js/core > execute-actions] No implementation found for action: \`${action}\``
9813
+ );
9814
+ fn == null ? void 0 : fn(this.state.context, event, this.meta);
9815
+ }
9816
+ });
9817
+ __publicField(this, "executeActivities", (event, activities, state) => {
9818
+ var _a8;
9819
+ for (const activity of activities) {
9820
+ const fn = isString(activity) ? (_a8 = this.activityMap) == null ? void 0 : _a8[activity] : activity;
9821
+ if (!fn) {
9822
+ warn(`[@zag-js/core > execute-activity] No implementation found for activity: \`${activity}\``);
9823
+ continue;
9824
+ }
9825
+ const cleanup = fn(this.state.context, event, this.meta);
9826
+ if (cleanup) {
9827
+ const key = isString(activity) ? activity : activity.name || uuid();
9828
+ this.addActivityCleanup(state != null ? state : this.state.value, key, cleanup);
9829
+ }
9830
+ }
9831
+ });
9832
+ __publicField(this, "createEveryActivities", (every, callbackfn) => {
9833
+ if (!every) return;
9834
+ if (isArray(every)) {
9835
+ const picked = toArray(every).find((transition) => {
9836
+ const delayOrFn = transition.delay;
9837
+ const determineDelay2 = determineDelayFn(delayOrFn, this.delayMap);
9838
+ const delay2 = determineDelay2(this.contextSnapshot, this.state.event);
9839
+ const determineGuard = determineGuardFn(transition.guard, this.guardMap);
9840
+ const guard = determineGuard(this.contextSnapshot, this.state.event, this.guardMeta);
9841
+ return guard != null ? guard : delay2 != null;
9842
+ });
9843
+ if (!picked) return;
9844
+ const determineDelay = determineDelayFn(picked.delay, this.delayMap);
9845
+ const delay = determineDelay(this.contextSnapshot, this.state.event);
9846
+ const activity = () => {
9847
+ const id = globalThis.setInterval(() => {
9848
+ this.executeActions(picked.actions, this.state.event);
9849
+ }, delay);
9850
+ return () => {
9851
+ globalThis.clearInterval(id);
9852
+ };
9853
+ };
9854
+ callbackfn(activity);
9855
+ } else {
9856
+ for (const interval in every) {
9857
+ const actions = every == null ? void 0 : every[interval];
9858
+ const determineDelay = determineDelayFn(interval, this.delayMap);
9859
+ const delay = determineDelay(this.contextSnapshot, this.state.event);
9860
+ const activity = () => {
9861
+ const id = globalThis.setInterval(() => {
9862
+ this.executeActions(actions, this.state.event);
9863
+ }, delay);
9864
+ return () => {
9865
+ globalThis.clearInterval(id);
9866
+ };
9867
+ };
9868
+ callbackfn(activity);
9869
+ }
9870
+ }
9871
+ });
9872
+ __publicField(this, "setEvent", (event) => {
9873
+ this.state.previousEvent = this.state.event;
9874
+ this.state.event = ref(toEvent(event));
9875
+ });
9876
+ __publicField(this, "performExitEffects", (current, event) => {
9877
+ const currentState = this.state.value;
9878
+ if (currentState === "") return;
9879
+ const stateNode = current ? this.getStateNode(current) : void 0;
9880
+ this.stopActivities(currentState);
9881
+ const _exit = determineActionsFn(stateNode == null ? void 0 : stateNode.exit, this.guardMap)(this.contextSnapshot, event, this.guardMeta);
9882
+ const exitActions = toArray(_exit);
9883
+ const afterExitActions = this.delayedEvents.get(currentState);
9884
+ if (afterExitActions) {
9885
+ exitActions.push(...afterExitActions);
9886
+ }
9887
+ this.executeActions(exitActions, event);
9888
+ this.delayedEvents.delete(currentState);
9889
+ });
9890
+ __publicField(this, "performEntryEffects", (next, event) => {
9891
+ const stateNode = this.getStateNode(next);
9892
+ const activities = toArray(stateNode == null ? void 0 : stateNode.activities);
9893
+ this.createEveryActivities(stateNode == null ? void 0 : stateNode.every, (activity) => {
9894
+ activities.unshift(activity);
9895
+ });
9896
+ if (activities.length > 0) {
9897
+ this.executeActivities(event, activities);
9898
+ }
9899
+ const pickedActions = determineActionsFn(stateNode == null ? void 0 : stateNode.entry, this.guardMap)(
9900
+ this.contextSnapshot,
9901
+ event,
9902
+ this.guardMeta
9903
+ );
9904
+ const entryActions = toArray(pickedActions);
9905
+ const afterActions = this.getDelayedEventActions(next);
9906
+ if ((stateNode == null ? void 0 : stateNode.after) && afterActions) {
9907
+ this.delayedEvents.set(next, afterActions == null ? void 0 : afterActions.exits);
9908
+ entryActions.push(...afterActions.entries);
9909
+ }
9910
+ this.executeActions(entryActions, event);
9911
+ if ((stateNode == null ? void 0 : stateNode.type) === "final") {
9912
+ this.state.done = true;
9913
+ this.doneListeners.forEach((listener) => {
9914
+ listener(this.stateSnapshot);
9915
+ });
9916
+ this.stop();
9917
+ }
9918
+ });
9919
+ __publicField(this, "performTransitionEffects", (transitions, event) => {
9920
+ const transition = this.determineTransition(transitions, event);
9921
+ this.executeActions(transition == null ? void 0 : transition.actions, event);
9922
+ });
9923
+ __publicField(this, "performStateChangeEffects", (current, next, event) => {
9924
+ this.setEvent(event);
9925
+ const changed = next.changed || next.reenter;
9926
+ if (changed) {
9927
+ this.performExitEffects(current, event);
9928
+ }
9929
+ this.performTransitionEffects(next.transition, event);
9930
+ this.setState(next.target);
9931
+ if (changed) {
9932
+ this.performEntryEffects(next.target, event);
9933
+ }
9934
+ });
9935
+ __publicField(this, "determineTransition", (transition, event) => {
9936
+ const fn = determineTransitionFn(transition, this.guardMap);
9937
+ return fn == null ? void 0 : fn(this.contextSnapshot, event, this.guardMeta);
9938
+ });
9939
+ __publicField(this, "sendParent", (evt) => {
9940
+ var _a8;
9941
+ if (!this.parent) {
9942
+ invariant("[@zag-js/core > send-parent] Cannot send event to an unknown parent");
9943
+ }
9944
+ const event = toEvent(evt);
9945
+ (_a8 = this.parent) == null ? void 0 : _a8.send(event);
9946
+ });
9947
+ __publicField(this, "log", (...args) => {
9948
+ if (isDev2() && this.options.debug) {
9949
+ console.log(...args);
9950
+ }
9951
+ });
9952
+ __publicField(this, "send", (evt) => {
9953
+ const event = toEvent(evt);
9954
+ this.transition(this.state.value, event);
9955
+ });
9956
+ __publicField(this, "transition", (state, evt) => {
9957
+ var _a8, _b7, _c6;
9958
+ const stateNode = isString(state) ? this.getStateNode(state) : state == null ? void 0 : state.stateNode;
9959
+ const event = toEvent(evt);
9960
+ if (!stateNode && !this.config.on) {
9961
+ const msg = this.status === "Stopped" ? "[@zag-js/core > transition] Cannot transition a stopped machine" : `[@zag-js/core > transition] State does not have a definition for \`state\`: ${state}, \`event\`: ${event.type}`;
9962
+ warn(msg);
9963
+ return;
9964
+ }
9965
+ const transitions = (
9966
+ // @ts-expect-error - Fix this
9967
+ (_c6 = (_a8 = stateNode == null ? void 0 : stateNode.on) == null ? void 0 : _a8[event.type]) != null ? _c6 : (_b7 = this.config.on) == null ? void 0 : _b7[event.type]
9968
+ );
9969
+ const next = this.getNextStateInfo(transitions, event);
9970
+ this.performStateChangeEffects(this.state.value, next, event);
9971
+ return next.stateNode;
9972
+ });
9973
+ __publicField(this, "subscribe", (listener) => {
9974
+ this.stateListeners.add(listener);
9975
+ if (this.status === "Running") {
9976
+ listener(this.stateSnapshot);
9977
+ }
9978
+ return () => {
9979
+ this.stateListeners.delete(listener);
9980
+ };
9981
+ });
9982
+ __publicField(this, "onDone", (listener) => {
9983
+ this.doneListeners.add(listener);
9984
+ return this;
9985
+ });
9986
+ __publicField(this, "onTransition", (listener) => {
9987
+ this.stateListeners.add(listener);
9988
+ if (this.status === "Running") {
9989
+ listener(this.stateSnapshot);
9990
+ }
9991
+ return this;
9992
+ });
9993
+ this.config = structuredClone(config);
9994
+ this.options = structuredClone(options != null ? options : {});
9995
+ this.id = (_a7 = this.config.id) != null ? _a7 : `machine-${uuid()}`;
9996
+ this.guardMap = (_c5 = (_b6 = this.options) == null ? void 0 : _b6.guards) != null ? _c5 : {};
9997
+ this.actionMap = (_e5 = (_d5 = this.options) == null ? void 0 : _d5.actions) != null ? _e5 : {};
9998
+ this.delayMap = (_g5 = (_f5 = this.options) == null ? void 0 : _f5.delays) != null ? _g5 : {};
9999
+ this.activityMap = (_i3 = (_h3 = this.options) == null ? void 0 : _h3.activities) != null ? _i3 : {};
10000
+ this.sync = (_k3 = (_j3 = this.options) == null ? void 0 : _j3.sync) != null ? _k3 : false;
10001
+ this.state = createProxy2(this.config);
10002
+ this.initialContext = snapshot(this.state.context);
10003
+ }
10004
+ // immutable state value
10005
+ get stateSnapshot() {
10006
+ return cast(snapshot(this.state));
10007
+ }
10008
+ getState() {
10009
+ return this.stateSnapshot;
10010
+ }
10011
+ // immutable context value
10012
+ get contextSnapshot() {
10013
+ return this.stateSnapshot.context;
10014
+ }
10015
+ /**
10016
+ * A reference to the instance methods of the machine.
10017
+ * Useful when spawning child machines and managing the communication between them.
10018
+ */
10019
+ get self() {
10020
+ const self2 = this;
10021
+ return {
10022
+ id: this.id,
10023
+ send: this.send.bind(this),
10024
+ sendParent: this.sendParent.bind(this),
10025
+ sendChild: this.sendChild.bind(this),
10026
+ stop: this.stop.bind(this),
10027
+ stopChild: this.stopChild.bind(this),
10028
+ spawn: this.spawn.bind(this),
10029
+ stopActivity: this.stopActivity.bind(this),
10030
+ get state() {
10031
+ return self2.stateSnapshot;
10032
+ },
10033
+ get initialContext() {
10034
+ return self2.initialContext;
10035
+ },
10036
+ get initialState() {
10037
+ var _a7, _b6;
10038
+ return (_b6 = (_a7 = self2.initialState) == null ? void 0 : _a7.target) != null ? _b6 : "";
10039
+ }
10040
+ };
10041
+ }
10042
+ get meta() {
10043
+ var _a7, _b6;
10044
+ return {
10045
+ state: this.stateSnapshot,
10046
+ guards: this.guardMap,
10047
+ send: this.send.bind(this),
10048
+ self: this.self,
10049
+ initialContext: this.initialContext,
10050
+ initialState: (_b6 = (_a7 = this.initialState) == null ? void 0 : _a7.target) != null ? _b6 : "",
10051
+ getState: () => this.stateSnapshot,
10052
+ getAction: (key) => this.actionMap[key],
10053
+ getGuard: (key) => this.guardMap[key]
10054
+ };
10055
+ }
10056
+ get guardMeta() {
10057
+ return {
10058
+ state: this.stateSnapshot
10059
+ };
10060
+ }
10061
+ get [Symbol.toStringTag]() {
10062
+ return "Machine";
10063
+ }
10064
+ getHydrationState() {
10065
+ const state = this.getState();
10066
+ return {
10067
+ value: state.value,
10068
+ tags: state.tags
10069
+ };
10070
+ }
10071
+ };
10072
+ var createMachine = (config, options) => new Machine(config, options);
10073
+ var clsx = (...args) => args.map((str) => {
10074
+ var _a7;
10075
+ return (_a7 = str == null ? void 0 : str.trim) == null ? void 0 : _a7.call(str);
10076
+ }).filter(Boolean).join(" ");
10077
+ var CSS_REGEX = /((?:--)?(?:\w+-?)+)\s*:\s*([^;]*)/g;
10078
+ var serialize = (style) => {
10079
+ const res = {};
10080
+ let match;
10081
+ while (match = CSS_REGEX.exec(style)) {
10082
+ res[match[1]] = match[2];
10083
+ }
10084
+ return res;
10085
+ };
10086
+ var css = (a, b) => {
10087
+ if (isString(a)) {
10088
+ if (isString(b)) return `${a};${b}`;
10089
+ a = serialize(a);
10090
+ } else if (isString(b)) {
10091
+ b = serialize(b);
10092
+ }
10093
+ return Object.assign({}, a != null ? a : {}, b != null ? b : {});
10094
+ };
10095
+ function mergeProps(...args) {
10096
+ let result = {};
10097
+ for (let props2 of args) {
10098
+ for (let key in result) {
10099
+ if (key.startsWith("on") && typeof result[key] === "function" && typeof props2[key] === "function") {
10100
+ result[key] = callAll(props2[key], result[key]);
10101
+ continue;
10102
+ }
10103
+ if (key === "className" || key === "class") {
10104
+ result[key] = clsx(result[key], props2[key]);
10105
+ continue;
10106
+ }
10107
+ if (key === "style") {
10108
+ result[key] = css(result[key], props2[key]);
10109
+ continue;
10110
+ }
10111
+ result[key] = props2[key] !== void 0 ? props2[key] : result[key];
10112
+ }
10113
+ for (let key in props2) {
10114
+ if (result[key] === void 0) {
10115
+ result[key] = props2[key];
10116
+ }
10117
+ }
10118
+ }
10119
+ return result;
10120
+ }
10121
+
10122
+ // ../../node_modules/@zag-js/types/dist/index.mjs
10123
+ function createNormalizer(fn) {
10124
+ return new Proxy({}, {
10125
+ get() {
10126
+ return fn;
10127
+ }
10128
+ });
10129
+ }
10130
+ var createProps = () => (props2) => Array.from(new Set(props2));
10131
+
10132
+ // ../../node_modules/@zag-js/react/dist/index.mjs
10133
+ var import_react115 = __toESM(require("react"), 1);
10134
+ var import_react_dom = require("react-dom");
10135
+ var import_jsx_runtime10 = require("react/jsx-runtime");
10136
+ var normalizeProps = createNormalizer((v) => v);
10137
+ var isArrayLike = (value) => (value == null ? void 0 : value.constructor.name) === "Array";
10138
+ var isArrayEqual = (a, b) => {
10139
+ if (a.length !== b.length) return false;
10140
+ for (let i = 0; i < a.length; i++) {
10141
+ if (!isEqual(a[i], b[i])) return false;
10142
+ }
10143
+ return true;
10144
+ };
10145
+ var isEqual = (a, b) => {
10146
+ if (Object.is(a, b)) return true;
10147
+ if (a == null && b != null || a != null && b == null) return false;
10148
+ if (typeof (a == null ? void 0 : a.isEqual) === "function" && typeof (b == null ? void 0 : b.isEqual) === "function") {
10149
+ return a.isEqual(b);
10150
+ }
10151
+ if (typeof a === "function" && typeof b === "function") {
10152
+ return a.toString() === b.toString();
10153
+ }
10154
+ if (isArrayLike(a) && isArrayLike(b)) {
10155
+ return isArrayEqual(Array.from(a), Array.from(b));
10156
+ }
10157
+ if (!(typeof a === "object") || !(typeof b === "object")) return false;
10158
+ const keys = Object.keys(b != null ? b : /* @__PURE__ */ Object.create(null));
10159
+ const length = keys.length;
10160
+ for (let i = 0; i < length; i++) {
10161
+ const hasKey = Reflect.has(a, keys[i]);
10162
+ if (!hasKey) return false;
10163
+ }
10164
+ for (let i = 0; i < length; i++) {
10165
+ const key = keys[i];
10166
+ if (!isEqual(a[key], b[key])) return false;
10167
+ }
10168
+ return true;
10169
+ };
10170
+ var isDev3 = () => process.env.NODE_ENV !== "production";
10171
+ var fnToString2 = Function.prototype.toString;
10172
+ fnToString2.call(Object);
10173
+ function compact2(obj) {
10174
+ if (!isPlainObject3(obj) || obj === void 0) {
10175
+ return obj;
10176
+ }
10177
+ const keys = Reflect.ownKeys(obj).filter((key) => typeof key === "string");
10178
+ const filtered = {};
10179
+ for (const key of keys) {
10180
+ const value = obj[key];
10181
+ if (value !== void 0) {
10182
+ filtered[key] = compact2(value);
10183
+ }
10184
+ }
10185
+ return filtered;
10186
+ }
10187
+ var isPlainObject3 = (value) => {
10188
+ return value && typeof value === "object" && value.constructor === Object;
10189
+ };
10190
+ function useUpdateEffect(callback, deps) {
10191
+ const render = (0, import_react115.useRef)(false);
10192
+ const effect = (0, import_react115.useRef)(false);
10193
+ (0, import_react115.useEffect)(() => {
10194
+ const mounted = render.current;
10195
+ const run = mounted && effect.current;
10196
+ if (run) {
10197
+ return callback();
10198
+ }
10199
+ effect.current = true;
10200
+ }, deps);
10201
+ (0, import_react115.useEffect)(() => {
10202
+ render.current = true;
10203
+ return () => {
10204
+ render.current = false;
10205
+ };
10206
+ }, []);
10207
+ }
10208
+ var { use } = import_react115.default;
10209
+ var targetCache = makeGlobal("__zag__targetCache", () => /* @__PURE__ */ new WeakMap());
10210
+ function useSnapshot(service, options) {
10211
+ const { actions, context, sync: notifyInSync } = options != null ? options : {};
10212
+ const lastSnapshot = (0, import_react115.useRef)();
10213
+ const lastAffected = (0, import_react115.useRef)();
10214
+ const currSnapshot = (0, import_react115.useSyncExternalStore)(
10215
+ (0, import_react115.useCallback)((callback) => subscribe(service.state, callback, notifyInSync), [notifyInSync]),
10216
+ () => {
10217
+ const nextSnapshot = snapshot(service.state, use);
10218
+ try {
10219
+ if (lastSnapshot.current && lastAffected.current && !isChanged(lastSnapshot.current, nextSnapshot, lastAffected.current, /* @__PURE__ */ new WeakMap())) {
10220
+ return lastSnapshot.current;
10221
+ }
10222
+ } catch {
10223
+ }
10224
+ return nextSnapshot;
10225
+ },
10226
+ () => snapshot(service.state, use)
10227
+ );
10228
+ service.setOptions({ actions });
10229
+ const ctx = (0, import_react115.useMemo)(() => compact2(context != null ? context : {}), [context]);
10230
+ useUpdateEffect(() => {
10231
+ var _a7;
10232
+ const entries = Object.entries(ctx);
10233
+ const previousCtx = (_a7 = service.contextSnapshot) != null ? _a7 : {};
10234
+ const equality = entries.map(([key, value]) => ({
10235
+ key,
10236
+ curr: value,
10237
+ prev: previousCtx[key],
10238
+ equal: isEqual(previousCtx[key], value)
10239
+ }));
10240
+ const allEqual = equality.every(({ equal }) => equal);
10241
+ if (!allEqual) {
10242
+ service.setContext(ctx);
10243
+ }
10244
+ }, [ctx]);
10245
+ const currAffected = /* @__PURE__ */ new WeakMap();
10246
+ (0, import_react115.useEffect)(() => {
10247
+ lastSnapshot.current = currSnapshot;
10248
+ lastAffected.current = currAffected;
10249
+ });
10250
+ const proxyCache = (0, import_react115.useMemo)(() => /* @__PURE__ */ new WeakMap(), []);
10251
+ return createProxy(currSnapshot, currAffected, proxyCache, targetCache);
10252
+ }
10253
+ function useConstant(fn) {
10254
+ const ref2 = (0, import_react115.useRef)();
10255
+ if (!ref2.current) ref2.current = { v: fn() };
10256
+ return ref2.current.v;
10257
+ }
10258
+ var useSafeLayoutEffect = typeof document !== "undefined" ? import_react115.useLayoutEffect : import_react115.useEffect;
10259
+ function useService(machine2, options) {
10260
+ const { state: hydratedState, context } = options != null ? options : {};
10261
+ const service = useConstant(() => {
10262
+ const instance = typeof machine2 === "function" ? machine2() : machine2;
10263
+ if (context) instance.setContext(context);
10264
+ instance._created();
10265
+ return instance;
10266
+ });
10267
+ const snapshotRef = (0, import_react115.useRef)();
10268
+ useSafeLayoutEffect(() => {
10269
+ const stateInit = hydratedState != null ? hydratedState : snapshotRef.current;
10270
+ service.start(stateInit);
10271
+ return () => {
10272
+ if (isDev3()) {
10273
+ snapshotRef.current = service.getHydrationState();
10274
+ }
10275
+ service.stop();
10276
+ };
10277
+ }, []);
10278
+ return service;
10279
+ }
10280
+ function useMachine(machine2, options) {
10281
+ const service = useService(machine2, options);
10282
+ const state = useSnapshot(service, options);
10283
+ return [state, service.send, service];
10284
+ }
10285
+
10286
+ // ../../node_modules/@ark-ui/react/dist/utils/compose-refs.js
10287
+ function setRef(ref2, value) {
10288
+ if (typeof ref2 === "function") {
10289
+ ref2(value);
10290
+ } else if (ref2 !== null && ref2 !== void 0) {
10291
+ ref2.current = value;
10292
+ }
10293
+ }
10294
+ function composeRefs(...refs) {
10295
+ return (node) => {
10296
+ for (const ref2 of refs) {
10297
+ setRef(ref2, node);
10298
+ }
10299
+ };
10300
+ }
10301
+
10302
+ // ../../node_modules/@ark-ui/react/dist/utils/create-context.js
10303
+ var import_react116 = require("react");
10304
+ function getErrorMessage(hook, provider) {
10305
+ return `${hook} returned \`undefined\`. Seems you forgot to wrap component within ${provider}`;
10306
+ }
10307
+ function createContext2(options = {}) {
10308
+ const {
10309
+ name,
10310
+ strict = true,
10311
+ hookName = "useContext",
10312
+ providerName = "Provider",
10313
+ errorMessage,
10314
+ defaultValue
10315
+ } = options;
10316
+ const Context = (0, import_react116.createContext)(defaultValue);
10317
+ Context.displayName = name;
10318
+ function useContext$1() {
10319
+ var _a7;
10320
+ const context = (0, import_react116.useContext)(Context);
10321
+ if (!context && strict) {
10322
+ const error = new Error(errorMessage != null ? errorMessage : getErrorMessage(hookName, providerName));
10323
+ error.name = "ContextError";
10324
+ (_a7 = Error.captureStackTrace) == null ? void 0 : _a7.call(Error, error, useContext$1);
10325
+ throw error;
10326
+ }
10327
+ return context;
10328
+ }
10329
+ return [Context.Provider, useContext$1, Context];
10330
+ }
10331
+
10332
+ // ../../node_modules/@ark-ui/react/dist/utils/create-split-props.js
10333
+ var createSplitProps = () => (props2, keys) => keys.reduce(
10334
+ (previousValue, currentValue) => {
10335
+ const [target, source] = previousValue;
10336
+ const key = currentValue;
10337
+ if (source[key] !== void 0) {
10338
+ target[key] = source[key];
10339
+ }
10340
+ delete source[key];
10341
+ return [target, source];
10342
+ },
10343
+ [{}, { ...props2 }]
10344
+ );
10345
+
10346
+ // ../../node_modules/@ark-ui/react/dist/components/factory.js
10347
+ var import_react117 = require("react");
10348
+ function getRef(element) {
10349
+ var _a7, _b6;
10350
+ let getter = (_a7 = Object.getOwnPropertyDescriptor(element.props, "ref")) == null ? void 0 : _a7.get;
10351
+ let mayWarn = getter && "isReactWarning" in getter && getter.isReactWarning;
10352
+ if (mayWarn) {
10353
+ return element.ref;
10354
+ }
10355
+ getter = (_b6 = Object.getOwnPropertyDescriptor(element, "ref")) == null ? void 0 : _b6.get;
10356
+ mayWarn = getter && "isReactWarning" in getter && getter.isReactWarning;
10357
+ if (mayWarn) {
10358
+ return element.props.ref;
10359
+ }
10360
+ return element.props.ref || element.ref;
10361
+ }
10362
+ var withAsChild = (Component) => {
10363
+ const Comp = (0, import_react117.memo)(
10364
+ (0, import_react117.forwardRef)((props2, ref2) => {
10365
+ const { asChild, children, ...restProps } = props2;
10366
+ if (!asChild) {
10367
+ return (0, import_react117.createElement)(Component, { ...restProps, ref: ref2 }, children);
10368
+ }
10369
+ const onlyChild = import_react117.Children.only(children);
10370
+ if (!(0, import_react117.isValidElement)(onlyChild)) {
10371
+ return null;
10372
+ }
10373
+ const childRef = getRef(onlyChild);
10374
+ return (0, import_react117.cloneElement)(onlyChild, {
10375
+ ...mergeProps(restProps, onlyChild.props),
10376
+ ref: ref2 ? composeRefs(ref2, childRef) : childRef
10377
+ });
10378
+ })
10379
+ );
10380
+ Comp.displayName = Component.displayName || Component.name;
10381
+ return Comp;
10382
+ };
10383
+ var jsxFactory = () => {
10384
+ const cache = /* @__PURE__ */ new Map();
10385
+ return new Proxy(withAsChild, {
10386
+ apply(_target, _thisArg, argArray) {
10387
+ return withAsChild(argArray[0]);
10388
+ },
10389
+ get(_, element) {
10390
+ const asElement = element;
10391
+ if (!cache.has(asElement)) {
10392
+ cache.set(asElement, withAsChild(asElement));
10393
+ }
10394
+ return cache.get(asElement);
10395
+ }
10396
+ });
10397
+ };
10398
+ var ark = jsxFactory();
10399
+
10400
+ // ../../node_modules/@zag-js/presence/dist/index.mjs
10401
+ function connect(state, send, _normalize) {
10402
+ const present = state.matches("mounted", "unmountSuspended");
10403
+ return {
10404
+ skip: !state.context.initial && present,
10405
+ present,
10406
+ setNode(node) {
10407
+ if (!node) return;
10408
+ send({ type: "NODE.SET", node });
10409
+ },
10410
+ unmount() {
10411
+ send({ type: "UNMOUNT" });
10412
+ }
10413
+ };
10414
+ }
10415
+ function machine(ctx) {
10416
+ return createMachine(
10417
+ {
10418
+ initial: ctx.present ? "mounted" : "unmounted",
10419
+ context: {
10420
+ node: null,
10421
+ styles: null,
10422
+ unmountAnimationName: null,
10423
+ prevAnimationName: null,
10424
+ present: false,
10425
+ initial: false,
10426
+ ...ctx
10427
+ },
10428
+ exit: ["clearInitial"],
10429
+ watch: {
10430
+ present: ["setInitial", "syncPresence"]
10431
+ },
10432
+ on: {
10433
+ "NODE.SET": {
10434
+ actions: ["setNode", "setStyles"]
10435
+ }
10436
+ },
10437
+ states: {
10438
+ mounted: {
10439
+ on: {
10440
+ UNMOUNT: {
10441
+ target: "unmounted",
10442
+ actions: ["invokeOnExitComplete"]
10443
+ },
10444
+ "UNMOUNT.SUSPEND": "unmountSuspended"
10445
+ }
10446
+ },
10447
+ unmountSuspended: {
10448
+ activities: ["trackAnimationEvents"],
10449
+ after: {
10450
+ // Fallback to timeout to ensure we exit this state even if the `animationend` event
10451
+ // did not get trigger
10452
+ ANIMATION_DURATION: {
10453
+ target: "unmounted",
10454
+ actions: ["invokeOnExitComplete"]
10455
+ }
10456
+ },
10457
+ on: {
10458
+ MOUNT: {
10459
+ target: "mounted",
10460
+ actions: ["setPrevAnimationName"]
10461
+ },
10462
+ UNMOUNT: {
10463
+ target: "unmounted",
10464
+ actions: ["invokeOnExitComplete"]
10465
+ }
10466
+ }
10467
+ },
10468
+ unmounted: {
10469
+ entry: ["clearPrevAnimationName"],
10470
+ on: {
10471
+ MOUNT: {
10472
+ target: "mounted",
10473
+ actions: ["setPrevAnimationName"]
10474
+ }
10475
+ }
10476
+ }
10477
+ }
10478
+ },
10479
+ {
10480
+ delays: {
10481
+ ANIMATION_DURATION(ctx2) {
10482
+ var _a7, _b6;
10483
+ return parseMs((_a7 = ctx2.styles) == null ? void 0 : _a7.animationDuration) + parseMs((_b6 = ctx2.styles) == null ? void 0 : _b6.animationDelay) + ANIMATION_TIMEOUT_MARGIN;
10484
+ }
10485
+ },
10486
+ actions: {
10487
+ setInitial(ctx2) {
10488
+ ctx2.initial = true;
10489
+ },
10490
+ clearInitial(ctx2) {
10491
+ ctx2.initial = false;
10492
+ },
10493
+ invokeOnExitComplete(ctx2) {
10494
+ var _a7;
10495
+ (_a7 = ctx2.onExitComplete) == null ? void 0 : _a7.call(ctx2);
10496
+ },
10497
+ setNode(ctx2, evt) {
10498
+ ctx2.node = ref(evt.node);
10499
+ },
10500
+ setStyles(ctx2, evt) {
10501
+ const win = evt.node.ownerDocument.defaultView || window;
10502
+ ctx2.styles = ref(win.getComputedStyle(evt.node));
10503
+ },
10504
+ syncPresence(ctx2, _evt, { send }) {
10505
+ var _a7;
10506
+ if (ctx2.present) {
10507
+ send({ type: "MOUNT", src: "presence.changed" });
10508
+ return;
10509
+ }
10510
+ if (!ctx2.present && ((_a7 = ctx2.node) == null ? void 0 : _a7.ownerDocument.visibilityState) === "hidden") {
10511
+ send({ type: "UNMOUNT", src: "visibilitychange" });
10512
+ return;
10513
+ }
10514
+ const animationName = getAnimationName(ctx2.styles);
10515
+ const exec = ctx2.immediate ? queueMicrotask : requestAnimationFrame;
10516
+ exec(() => {
10517
+ var _a8, _b6;
10518
+ ctx2.unmountAnimationName = animationName;
10519
+ if (animationName === "none" || animationName === ctx2.prevAnimationName || ((_a8 = ctx2.styles) == null ? void 0 : _a8.display) === "none" || ((_b6 = ctx2.styles) == null ? void 0 : _b6.animationDuration) === "0s") {
10520
+ send({ type: "UNMOUNT", src: "presence.changed" });
10521
+ } else {
10522
+ send({ type: "UNMOUNT.SUSPEND" });
10523
+ }
10524
+ });
10525
+ },
10526
+ setPrevAnimationName(ctx2) {
10527
+ const exec = ctx2.immediate ? queueMicrotask : requestAnimationFrame;
10528
+ exec(() => {
10529
+ ctx2.prevAnimationName = getAnimationName(ctx2.styles);
10530
+ });
10531
+ },
10532
+ clearPrevAnimationName(ctx2) {
10533
+ ctx2.prevAnimationName = null;
10534
+ }
10535
+ },
10536
+ activities: {
10537
+ trackAnimationEvents(ctx2, _evt, { send }) {
10538
+ const node = ctx2.node;
10539
+ if (!node) return;
10540
+ const onStart = (event) => {
10541
+ var _a7, _b6, _c5;
10542
+ const target = (_c5 = (_b6 = (_a7 = event.composedPath) == null ? void 0 : _a7.call(event)) == null ? void 0 : _b6[0]) != null ? _c5 : event.target;
10543
+ if (target === node) {
10544
+ ctx2.prevAnimationName = getAnimationName(ctx2.styles);
10545
+ }
10546
+ };
10547
+ const onEnd = (event) => {
10548
+ var _a7, _b6, _c5;
10549
+ const animationName = getAnimationName(ctx2.styles);
10550
+ const target = (_c5 = (_b6 = (_a7 = event.composedPath) == null ? void 0 : _a7.call(event)) == null ? void 0 : _b6[0]) != null ? _c5 : event.target;
10551
+ if (target === node && animationName === ctx2.unmountAnimationName) {
10552
+ send({ type: "UNMOUNT", src: "animationend" });
10553
+ }
10554
+ };
10555
+ node.addEventListener("animationstart", onStart);
10556
+ node.addEventListener("animationcancel", onEnd);
10557
+ node.addEventListener("animationend", onEnd);
10558
+ return () => {
10559
+ node.removeEventListener("animationstart", onStart);
10560
+ node.removeEventListener("animationcancel", onEnd);
10561
+ node.removeEventListener("animationend", onEnd);
10562
+ };
10563
+ }
10564
+ }
10565
+ }
10566
+ );
10567
+ }
10568
+ function getAnimationName(styles) {
10569
+ return (styles == null ? void 0 : styles.animationName) || "none";
10570
+ }
10571
+ function parseMs(value) {
10572
+ return parseFloat(value || "0") * 1e3;
10573
+ }
10574
+ var ANIMATION_TIMEOUT_MARGIN = 16.667;
10575
+ var props = createProps()(["onExitComplete", "present", "immediate"]);
10576
+
10577
+ // ../../node_modules/@ark-ui/react/dist/components/presence/use-presence.js
10578
+ var import_react120 = require("react");
10579
+
10580
+ // ../../node_modules/@ark-ui/react/dist/utils/use-event.js
10581
+ var import_react118 = require("react");
10582
+ function useEvent(callback, opts = {}) {
10583
+ const { sync = false } = opts;
10584
+ const callbackRef = useLatestRef(callback);
10585
+ return (0, import_react118.useCallback)(
10586
+ // biome-ignore lint/suspicious/noExplicitAny: <explanation>
10587
+ (...args) => {
10588
+ var _a7;
10589
+ if (sync) return queueMicrotask(() => {
10590
+ var _a8;
10591
+ return (_a8 = callbackRef.current) == null ? void 0 : _a8.call(callbackRef, ...args);
10592
+ });
10593
+ return (_a7 = callbackRef.current) == null ? void 0 : _a7.call(callbackRef, ...args);
10594
+ },
10595
+ [sync, callbackRef]
10596
+ );
10597
+ }
10598
+ function useLatestRef(value) {
10599
+ const ref2 = (0, import_react118.useRef)(value);
10600
+ ref2.current = value;
10601
+ return ref2;
10602
+ }
10603
+
10604
+ // ../../node_modules/@ark-ui/react/dist/components/presence/use-presence.js
10605
+ var usePresence = (props2) => {
10606
+ const { lazyMount, unmountOnExit, ...rest } = props2;
10607
+ const wasEverPresent = (0, import_react120.useRef)(false);
10608
+ const context = {
10609
+ ...rest,
10610
+ onExitComplete: useEvent(props2.onExitComplete)
10611
+ };
10612
+ const [state, send] = useMachine(machine(context), { context });
10613
+ const api = connect(state, send, normalizeProps);
10614
+ if (api.present) {
10615
+ wasEverPresent.current = true;
10616
+ }
10617
+ const unmounted = !api.present && !wasEverPresent.current && lazyMount || unmountOnExit && !api.present && wasEverPresent.current;
10618
+ const getPresenceProps = () => ({
10619
+ "data-state": props2.present ? "open" : "closed",
10620
+ hidden: !api.present
10621
+ });
10622
+ return {
10623
+ ref: api.setNode,
10624
+ getPresenceProps,
10625
+ present: api.present,
10626
+ unmounted
10627
+ };
10628
+ };
10629
+
10630
+ // ../../node_modules/@ark-ui/react/dist/components/dialog/use-dialog-context.js
10631
+ var [DialogProvider, useDialogContext] = createContext2({
10632
+ name: "DialogContext",
10633
+ hookName: "useDialogContext",
10634
+ providerName: "<DialogProvider />"
10635
+ });
10636
+
10637
+ // ../../node_modules/@ark-ui/react/dist/components/dialog/dialog-context.js
10638
+ var DialogContext = (props2) => props2.children(useDialogContext());
10639
+
10640
+ // ../../node_modules/@ark-ui/react/dist/components/presence/split-presence-props.js
10641
+ var splitPresenceProps = (props2) => createSplitProps()(props2, [
10642
+ "immediate",
10643
+ "lazyMount",
10644
+ "onExitComplete",
10645
+ "present",
10646
+ "unmountOnExit"
10647
+ ]);
10648
+
10649
+ // src/components/dialog/dialog.tsx
10650
+ var import_jsx_runtime11 = require("react/jsx-runtime");
10651
+ var DialogContent = (0, import_react121.forwardRef)(
10652
+ function DialogContent2(props2, ref2) {
10653
+ const {
10654
+ children,
10655
+ portalled = true,
10656
+ portalRef,
10657
+ backdrop = true,
10658
+ ...rest
10659
+ } = props2;
10660
+ return /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(import_react122.Portal, { disabled: !portalled, container: portalRef, children: [
10661
+ backdrop && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_react122.Dialog.Backdrop, {}),
10662
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_react122.Dialog.Positioner, { children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_react122.Dialog.Content, { ref: ref2, ...rest, asChild: false, children }) })
10663
+ ] });
10664
+ }
10665
+ );
10666
+ var DialogCloseTrigger = (0, import_react121.forwardRef)(function DialogCloseTrigger2(props2, ref2) {
10667
+ return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
10668
+ import_react122.Dialog.CloseTrigger,
10669
+ {
10670
+ position: "absolute",
10671
+ top: "2",
10672
+ insetEnd: "2",
10673
+ ...props2,
10674
+ asChild: true,
10675
+ children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(CloseButton, { size: "sm", ref: ref2, children: props2.children })
10676
+ }
10677
+ );
10678
+ });
10679
+ var DialogRoot = import_react122.Dialog.Root;
10680
+ var DialogFooter = import_react122.Dialog.Footer;
10681
+ var DialogHeader = import_react122.Dialog.Header;
10682
+ var DialogBody = import_react122.Dialog.Body;
10683
+ var DialogBackdrop = import_react122.Dialog.Backdrop;
10684
+ var DialogTitle = import_react122.Dialog.Title;
10685
+ var DialogDescription = import_react122.Dialog.Description;
10686
+ var DialogTrigger = import_react122.Dialog.Trigger;
10687
+ var DialogActionTrigger = import_react122.Dialog.ActionTrigger;
10688
+
10689
+ // src/components/drawer/namespace.ts
10690
+ var namespace_exports3 = {};
10691
+ __export(namespace_exports3, {
10692
+ ActionTrigger: () => DrawerActionTrigger,
10693
+ Backdrop: () => DrawerBackdrop,
10694
+ Body: () => DrawerBody,
10695
+ CloseTrigger: () => DrawerCloseTrigger,
10696
+ Content: () => DrawerContent,
10697
+ Context: () => DrawerContext,
10698
+ Description: () => DrawerDescription,
10699
+ Footer: () => DrawerFooter,
10700
+ Header: () => DrawerHeader,
10701
+ Root: () => DrawerRoot,
10702
+ Title: () => DrawerTitle,
10703
+ Trigger: () => DrawerTrigger
10704
+ });
10705
+
10706
+ // src/components/drawer/drawer.tsx
10707
+ var import_react123 = require("react");
10708
+ var import_react124 = require("@chakra-ui/react");
10709
+ var import_jsx_runtime12 = require("react/jsx-runtime");
10710
+ var DrawerContent = (0, import_react123.forwardRef)(
10711
+ function DrawerContent2(props2, ref2) {
10712
+ const { children, portalled = true, portalRef, offset, ...rest } = props2;
10713
+ return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_react124.Portal, { disabled: !portalled, container: portalRef, children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_react124.Drawer.Positioner, { padding: offset, children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_react124.Drawer.Content, { ref: ref2, ...rest, asChild: false, children }) }) });
10714
+ }
10715
+ );
10716
+ var DrawerCloseTrigger = (0, import_react123.forwardRef)(function DrawerCloseTrigger2(props2, ref2) {
10717
+ return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
10718
+ import_react124.Drawer.CloseTrigger,
10719
+ {
10720
+ position: "absolute",
10721
+ top: "2",
10722
+ insetEnd: "2",
10723
+ ...props2,
10724
+ asChild: true,
10725
+ children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(CloseButton, { size: "sm", ref: ref2 })
10726
+ }
10727
+ );
10728
+ });
10729
+ var DrawerTrigger = import_react124.Drawer.Trigger;
10730
+ var DrawerRoot = import_react124.Drawer.Root;
10731
+ var DrawerFooter = import_react124.Drawer.Footer;
10732
+ var DrawerHeader = import_react124.Drawer.Header;
10733
+ var DrawerBody = import_react124.Drawer.Body;
10734
+ var DrawerBackdrop = import_react124.Drawer.Backdrop;
10735
+ var DrawerDescription = import_react124.Drawer.Description;
10736
+ var DrawerTitle = import_react124.Drawer.Title;
10737
+ var DrawerActionTrigger = import_react124.Drawer.ActionTrigger;
10738
+ var DrawerContext = DialogContext;
10739
+
10740
+ // src/components/empty-state/empty-state.tsx
10741
+ var import_react125 = require("@chakra-ui/react");
10742
+ var import_react126 = require("react");
10743
+ var import_jsx_runtime13 = require("react/jsx-runtime");
10744
+ var EmptyState = (0, import_react126.forwardRef)(
10745
+ function EmptyState2(props2, ref2) {
10746
+ const { title, description, icon, children, ...rest } = props2;
10747
+ return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_react125.EmptyState.Root, { ref: ref2, ...rest, children: /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(import_react125.EmptyState.Content, { children: [
10748
+ icon && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_react125.EmptyState.Indicator, { children: icon }),
10749
+ description ? /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(import_react125.VStack, { textAlign: "center", children: [
10750
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_react125.EmptyState.Title, { children: title }),
10751
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_react125.EmptyState.Description, { children: description })
10752
+ ] }) : /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_react125.EmptyState.Title, { children: title }),
10753
+ children
10754
+ ] }) });
10755
+ }
10756
+ );
10757
+
10758
+ // src/components/grid-list/grid-list.tsx
10759
+ var grid_list_exports = {};
10760
+ __export(grid_list_exports, {
10761
+ Cell: () => GridListCell,
10762
+ Header: () => GridListHeader,
10763
+ Item: () => GridListItem,
10764
+ Root: () => GridListRoot
10765
+ });
10766
+ var import_grid_list = require("@saas-ui/core/grid-list");
10767
+
10768
+ // src/components/grid-list/grid-list.context.ts
10769
+ var import_react127 = require("@chakra-ui/react");
10770
+ var {
10771
+ withProvider: withProvider2,
10772
+ withContext: withContext3,
10773
+ useStyles: useGridListStyles
10774
+ } = (0, import_react127.createSlotRecipeContext)({
10775
+ key: "suiGridList"
10776
+ });
10777
+
10778
+ // src/components/grid-list/grid-list.tsx
10779
+ var GridListRoot = withProvider2(
10780
+ import_grid_list.GridList.Root,
10781
+ "root"
10782
+ );
10783
+ var GridListItem = withContext3(
10784
+ import_grid_list.GridList.Item,
10785
+ "item"
10786
+ );
10787
+ var GridListHeader = withContext3(
10788
+ import_grid_list.GridList.Header,
10789
+ "header"
10790
+ );
10791
+ var GridListCell = withContext3(
10792
+ import_grid_list.GridList.Cell,
10793
+ "cell"
10794
+ );
10795
+
10796
+ // src/components/icon-badge/icon-badge.tsx
10797
+ var React2 = __toESM(require("react"), 1);
10798
+ var import_react128 = require("react");
10799
+ var import_react129 = require("@chakra-ui/react");
10800
+ var import_utils8 = require("@saas-ui/core/utils");
10801
+ var import_jsx_runtime14 = require("react/jsx-runtime");
10802
+ var IconBadge = React2.forwardRef(
10803
+ (props2, ref2) => {
10804
+ const { icon, children, ...rest } = props2;
10805
+ const recipe = (0, import_react129.useRecipe)({ key: "suiIconBadge", recipe: props2.recipe });
10806
+ const [variantProps, localProps] = recipe.splitVariantProps(rest);
10807
+ const styles = recipe(variantProps);
10808
+ const element = icon || children;
10809
+ const _children = (0, import_react128.isValidElement)(element) ? (0, import_react128.cloneElement)(element, {
10810
+ "aria-hidden": true,
10811
+ focusable: false
10812
+ }) : null;
10813
+ return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
10814
+ import_react129.chakra.div,
10815
+ {
10816
+ ref: ref2,
10817
+ ...localProps,
10818
+ css: [styles, props2.css],
10819
+ className: (0, import_utils8.cx)(recipe.className, props2.className),
10820
+ children: _children
10821
+ }
10822
+ );
10823
+ }
10824
+ );
10825
+
10826
+ // src/components/input-group/input-group.tsx
10827
+ var import_react130 = require("react");
10828
+ var import_react131 = require("@chakra-ui/react");
10829
+ var import_jsx_runtime15 = require("react/jsx-runtime");
10830
+ var InputGroup = (0, import_react130.forwardRef)(
10831
+ function InputGroup2(props2, ref2) {
10832
+ const {
10833
+ startElement,
10834
+ startElementProps,
10835
+ endElement,
10836
+ endElementProps,
10837
+ children,
10838
+ ...rest
10839
+ } = props2;
10840
+ return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(import_react131.Group, { ref: ref2, display: "flex", ...rest, children: [
10841
+ startElement && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_react131.InputElement, { pointerEvents: "none", ...startElementProps, children: startElement }),
10842
+ (0, import_react130.isValidElement)(children) && (0, import_react130.cloneElement)(children, {
10843
+ ...startElement && { ps: "calc(var(--input-height) - 6px)" },
10844
+ ...endElement && { pe: "calc(var(--input-height) - 6px)" },
10845
+ ...children.props
10846
+ }),
10847
+ endElement && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_react131.InputElement, { placement: "end", ...endElementProps, children: endElement })
10848
+ ] });
10849
+ }
10850
+ );
10851
+
10852
+ // src/components/link/link.tsx
10853
+ var import_react132 = __toESM(require("react"), 1);
10854
+ var import_react133 = require("@chakra-ui/react");
10855
+ var import_jsx_runtime16 = require("react/jsx-runtime");
10856
+ var Link = import_react132.default.forwardRef(
10857
+ (props2, ref2) => {
10858
+ const LinkComponent = useLink();
10859
+ return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_react133.Link, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(LinkComponent, { ref: ref2, ...props2 }) });
10860
+ }
10861
+ );
10862
+ Link.displayName = "Link";
10863
+
10864
+ // src/components/loading-overlay/loading-overlay.tsx
10865
+ var loading_overlay_exports = {};
10866
+ __export(loading_overlay_exports, {
10867
+ Root: () => LoadingOverlayRoot,
10868
+ Spinner: () => LoadingOverlaySpinner,
10869
+ Text: () => LoadingOverlayText
10870
+ });
10871
+
10872
+ // ../../node_modules/@ark-ui/react/dist/components/presence/presence.js
10873
+ var import_jsx_runtime17 = require("react/jsx-runtime");
10874
+ var import_react134 = require("react");
10875
+ var Presence = (0, import_react134.forwardRef)((props2, ref2) => {
10876
+ const [presenceProps, localProps] = splitPresenceProps(props2);
10877
+ const presence = usePresence(presenceProps);
10878
+ if (presence.unmounted) {
10879
+ return null;
10880
+ }
10881
+ return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
10882
+ ark.div,
10883
+ {
10884
+ ...localProps,
10885
+ ...presence.getPresenceProps(),
10886
+ "data-scope": "presence",
10887
+ "data-part": "root",
10888
+ ref: composeRefs(presence.ref, ref2)
10889
+ }
10890
+ );
10891
+ });
10892
+ Presence.displayName = "Presence";
10893
+
10894
+ // src/components/loading-overlay/loading-overlay.tsx
10895
+ var import_react138 = require("@chakra-ui/react");
10896
+
10897
+ // src/components/spinner/spinner.tsx
10898
+ var import_react135 = require("react");
10899
+ var import_react136 = require("@chakra-ui/react");
10900
+ var import_jsx_runtime18 = require("react/jsx-runtime");
10901
+ var Spinner2 = (0, import_react135.forwardRef)(
10902
+ function Spinner3(props2, ref2) {
10903
+ const { loading, children, ...rest } = props2;
10904
+ if (loading === false) {
10905
+ return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_jsx_runtime18.Fragment, { children });
10906
+ }
10907
+ return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_react136.Spinner, { ref: ref2, ...rest });
10908
+ }
10909
+ );
10910
+
10911
+ // src/components/loading-overlay/loading-overlay.context.ts
10912
+ var import_react137 = require("@chakra-ui/react");
10913
+ var {
10914
+ useStyles: useLoadingOverlayStyles,
10915
+ withContext: withContext4,
10916
+ withProvider: withProvider3
10917
+ } = (0, import_react137.createSlotRecipeContext)({
10918
+ key: "suiLoadingOverlay"
10919
+ });
10920
+
10921
+ // src/components/loading-overlay/loading-overlay.tsx
10922
+ var import_jsx_runtime19 = require("react/jsx-runtime");
10923
+ var LoadingOverlay = (props2) => {
10924
+ const { children, loading = true, ...rest } = props2;
10925
+ const [presenceProps, rootProps] = splitPresenceProps(rest);
10926
+ return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(Presence, { present: loading, ...presenceProps, asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_react138.chakra.div, { ...rootProps, children }) });
10927
+ };
10928
+ var LoadingOverlayRoot = withProvider3(
10929
+ LoadingOverlay,
10930
+ "root"
10931
+ );
10932
+ LoadingOverlayRoot.displayName = "LoadingOverlay";
10933
+ var LoadingOverlaySpinner = Spinner2;
10934
+ var LoadingOverlayText = withContext4(
10935
+ "p",
10936
+ "text"
10937
+ );
10938
+
10939
+ // src/components/navbar/navbar.tsx
10940
+ var navbar_exports = {};
10941
+ __export(navbar_exports, {
10942
+ Brand: () => NavbarBrand,
10943
+ Content: () => NavbarContent,
10944
+ Item: () => NavbarItem,
10945
+ Link: () => NavbarLink,
10946
+ Root: () => NavbarRoot
10947
+ });
10948
+ var import_navbar = require("@saas-ui/core/navbar");
10949
+
10950
+ // src/components/navbar/navbar.context.ts
10951
+ var import_react139 = require("@chakra-ui/react");
10952
+ var {
10953
+ withProvider: withProvider4,
10954
+ withContext: withContext5,
10955
+ useStyles: useNavbarStyles
10956
+ } = (0, import_react139.createSlotRecipeContext)({
10957
+ key: "suiNavbar"
10958
+ });
10959
+
10960
+ // src/components/navbar/navbar.tsx
10961
+ var NavbarRoot = withProvider4(
10962
+ import_navbar.Navbar.Root,
10963
+ "root"
10964
+ );
10965
+ var NavbarBrand = withContext5(
10966
+ import_navbar.Navbar.Brand,
10967
+ "brand"
10968
+ );
10969
+ var NavbarContent = withContext5(
10970
+ import_navbar.Navbar.Content,
10971
+ "content"
10972
+ );
10973
+ var NavbarItem = withContext5(
10974
+ import_navbar.Navbar.Item,
10975
+ "item"
10976
+ );
10977
+ var NavbarLink = withContext5(
10978
+ import_navbar.Navbar.Link,
10979
+ "link"
10980
+ );
10981
+
10982
+ // src/components/number-input/number-input.tsx
10983
+ var import_react140 = require("react");
10984
+ var import_react141 = require("@chakra-ui/react");
10985
+ var import_jsx_runtime20 = require("react/jsx-runtime");
10986
+ var NumberInput = (0, import_react140.forwardRef)(
10987
+ function NumberInput2(props2, ref2) {
10988
+ const {
10989
+ hideControls,
10990
+ startElement,
10991
+ endElement,
10992
+ inputProps,
10993
+ rootRef,
10994
+ ...rest
10995
+ } = props2;
10996
+ return /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(import_react141.NumberInput.Root, { ref: rootRef, ...rest, children: [
10997
+ /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(InputGroup, { startElement, endElement, children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_react141.NumberInput.Input, { ref: ref2, ...inputProps }) }),
10998
+ !hideControls && !endElement ? /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(import_react141.NumberInput.Control, { children: [
10999
+ /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_react141.NumberInput.IncrementTrigger, {}),
11000
+ /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_react141.NumberInput.DecrementTrigger, {})
11001
+ ] }) : null
11002
+ ] });
11003
+ }
11004
+ );
11005
+
11006
+ // src/components/menu/menu.tsx
11007
+ var menu_exports = {};
11008
+ __export(menu_exports, {
11009
+ Arrow: () => MenuArrow,
11010
+ CheckboxItem: () => MenuCheckboxItem,
11011
+ Content: () => MenuContent,
11012
+ ContextTrigger: () => MenuContextTrigger,
11013
+ Item: () => MenuItem,
11014
+ ItemCommand: () => MenuItemCommand,
11015
+ ItemGroup: () => MenuItemGroup,
11016
+ ItemText: () => MenuItemText,
11017
+ RadioItem: () => MenuRadioItem,
11018
+ RadioItemGroup: () => MenuRadioItemGroup,
11019
+ Root: () => MenuRoot,
11020
+ Separator: () => MenuSeparator,
11021
+ Trigger: () => MenuTrigger,
11022
+ TriggerItem: () => MenuTriggerItem
11023
+ });
11024
+ var import_react144 = require("react");
11025
+ var import_react145 = require("@chakra-ui/react");
11026
+
11027
+ // ../../node_modules/react-icons/lib/iconBase.mjs
11028
+ var import_react143 = __toESM(require("react"), 1);
11029
+
11030
+ // ../../node_modules/react-icons/lib/iconContext.mjs
11031
+ var import_react142 = __toESM(require("react"), 1);
11032
+ var DefaultContext = {
11033
+ color: void 0,
11034
+ size: void 0,
11035
+ className: void 0,
11036
+ style: void 0,
11037
+ attr: void 0
11038
+ };
11039
+ var IconContext = import_react142.default.createContext && /* @__PURE__ */ import_react142.default.createContext(DefaultContext);
11040
+
11041
+ // ../../node_modules/react-icons/lib/iconBase.mjs
11042
+ var _excluded = ["attr", "size", "title"];
11043
+ function _objectWithoutProperties(source, excluded) {
11044
+ if (source == null) return {};
11045
+ var target = _objectWithoutPropertiesLoose(source, excluded);
11046
+ var key, i;
11047
+ if (Object.getOwnPropertySymbols) {
11048
+ var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
11049
+ for (i = 0; i < sourceSymbolKeys.length; i++) {
11050
+ key = sourceSymbolKeys[i];
11051
+ if (excluded.indexOf(key) >= 0) continue;
11052
+ if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
11053
+ target[key] = source[key];
11054
+ }
11055
+ }
11056
+ return target;
11057
+ }
11058
+ function _objectWithoutPropertiesLoose(source, excluded) {
11059
+ if (source == null) return {};
11060
+ var target = {};
11061
+ for (var key in source) {
11062
+ if (Object.prototype.hasOwnProperty.call(source, key)) {
11063
+ if (excluded.indexOf(key) >= 0) continue;
11064
+ target[key] = source[key];
11065
+ }
11066
+ }
11067
+ return target;
11068
+ }
11069
+ function _extends() {
11070
+ _extends = Object.assign ? Object.assign.bind() : function(target) {
11071
+ for (var i = 1; i < arguments.length; i++) {
11072
+ var source = arguments[i];
11073
+ for (var key in source) {
11074
+ if (Object.prototype.hasOwnProperty.call(source, key)) {
11075
+ target[key] = source[key];
11076
+ }
11077
+ }
11078
+ }
11079
+ return target;
11080
+ };
11081
+ return _extends.apply(this, arguments);
11082
+ }
11083
+ function ownKeys(e, r) {
11084
+ var t = Object.keys(e);
11085
+ if (Object.getOwnPropertySymbols) {
11086
+ var o = Object.getOwnPropertySymbols(e);
11087
+ r && (o = o.filter(function(r2) {
11088
+ return Object.getOwnPropertyDescriptor(e, r2).enumerable;
11089
+ })), t.push.apply(t, o);
11090
+ }
11091
+ return t;
11092
+ }
11093
+ function _objectSpread(e) {
11094
+ for (var r = 1; r < arguments.length; r++) {
11095
+ var t = null != arguments[r] ? arguments[r] : {};
11096
+ r % 2 ? ownKeys(Object(t), true).forEach(function(r2) {
11097
+ _defineProperty(e, r2, t[r2]);
11098
+ }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function(r2) {
11099
+ Object.defineProperty(e, r2, Object.getOwnPropertyDescriptor(t, r2));
11100
+ });
11101
+ }
11102
+ return e;
11103
+ }
11104
+ function _defineProperty(obj, key, value) {
11105
+ key = _toPropertyKey(key);
11106
+ if (key in obj) {
11107
+ Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true });
11108
+ } else {
11109
+ obj[key] = value;
11110
+ }
11111
+ return obj;
11112
+ }
11113
+ function _toPropertyKey(t) {
11114
+ var i = _toPrimitive(t, "string");
11115
+ return "symbol" == typeof i ? i : i + "";
11116
+ }
11117
+ function _toPrimitive(t, r) {
11118
+ if ("object" != typeof t || !t) return t;
11119
+ var e = t[Symbol.toPrimitive];
11120
+ if (void 0 !== e) {
11121
+ var i = e.call(t, r || "default");
11122
+ if ("object" != typeof i) return i;
11123
+ throw new TypeError("@@toPrimitive must return a primitive value.");
11124
+ }
11125
+ return ("string" === r ? String : Number)(t);
11126
+ }
11127
+ function Tree2Element(tree) {
11128
+ return tree && tree.map((node, i) => /* @__PURE__ */ import_react143.default.createElement(node.tag, _objectSpread({
11129
+ key: i
11130
+ }, node.attr), Tree2Element(node.child)));
11131
+ }
11132
+ function GenIcon(data) {
11133
+ return (props2) => /* @__PURE__ */ import_react143.default.createElement(IconBase, _extends({
11134
+ attr: _objectSpread({}, data.attr)
11135
+ }, props2), Tree2Element(data.child));
11136
+ }
11137
+ function IconBase(props2) {
11138
+ var elem = (conf) => {
11139
+ var {
11140
+ attr,
11141
+ size,
11142
+ title
11143
+ } = props2, svgProps = _objectWithoutProperties(props2, _excluded);
11144
+ var computedSize = size || conf.size || "1em";
11145
+ var className;
11146
+ if (conf.className) className = conf.className;
11147
+ if (props2.className) className = (className ? className + " " : "") + props2.className;
11148
+ return /* @__PURE__ */ import_react143.default.createElement("svg", _extends({
11149
+ stroke: "currentColor",
11150
+ fill: "currentColor",
11151
+ strokeWidth: "0"
11152
+ }, conf.attr, attr, svgProps, {
11153
+ className,
11154
+ style: _objectSpread(_objectSpread({
11155
+ color: props2.color || conf.color
11156
+ }, conf.style), props2.style),
11157
+ height: computedSize,
11158
+ width: computedSize,
11159
+ xmlns: "http://www.w3.org/2000/svg"
11160
+ }), title && /* @__PURE__ */ import_react143.default.createElement("title", null, title), props2.children);
11161
+ };
11162
+ return IconContext !== void 0 ? /* @__PURE__ */ import_react143.default.createElement(IconContext.Consumer, null, (conf) => elem(conf)) : elem(DefaultContext);
11163
+ }
11164
+
11165
+ // ../../node_modules/react-icons/lu/index.mjs
11166
+ function LuCheck(props2) {
11167
+ return GenIcon({ "tag": "svg", "attr": { "viewBox": "0 0 24 24", "fill": "none", "stroke": "currentColor", "strokeWidth": "2", "strokeLinecap": "round", "strokeLinejoin": "round" }, "child": [{ "tag": "polyline", "attr": { "points": "20 6 9 17 4 12" }, "child": [] }] })(props2);
11168
+ }
11169
+ function LuChevronRight(props2) {
11170
+ return GenIcon({ "tag": "svg", "attr": { "viewBox": "0 0 24 24", "fill": "none", "stroke": "currentColor", "strokeWidth": "2", "strokeLinecap": "round", "strokeLinejoin": "round" }, "child": [{ "tag": "path", "attr": { "d": "m9 18 6-6-6-6" }, "child": [] }] })(props2);
11171
+ }
11172
+ function LuEyeOff(props2) {
11173
+ return GenIcon({ "tag": "svg", "attr": { "viewBox": "0 0 24 24", "fill": "none", "stroke": "currentColor", "strokeWidth": "2", "strokeLinecap": "round", "strokeLinejoin": "round" }, "child": [{ "tag": "path", "attr": { "d": "M9.88 9.88a3 3 0 1 0 4.24 4.24" }, "child": [] }, { "tag": "path", "attr": { "d": "M10.73 5.08A10.43 10.43 0 0 1 12 5c7 0 10 7 10 7a13.16 13.16 0 0 1-1.67 2.68" }, "child": [] }, { "tag": "path", "attr": { "d": "M6.61 6.61A13.526 13.526 0 0 0 2 12s3 7 10 7a9.74 9.74 0 0 0 5.39-1.61" }, "child": [] }, { "tag": "line", "attr": { "x1": "2", "x2": "22", "y1": "2", "y2": "22" }, "child": [] }] })(props2);
11174
+ }
11175
+ function LuEye(props2) {
11176
+ return GenIcon({ "tag": "svg", "attr": { "viewBox": "0 0 24 24", "fill": "none", "stroke": "currentColor", "strokeWidth": "2", "strokeLinecap": "round", "strokeLinejoin": "round" }, "child": [{ "tag": "path", "attr": { "d": "M2 12s3-7 10-7 10 7 10 7-3 7-10 7-10-7-10-7Z" }, "child": [] }, { "tag": "circle", "attr": { "cx": "12", "cy": "12", "r": "3" }, "child": [] }] })(props2);
11177
+ }
11178
+
11179
+ // src/components/menu/menu.tsx
11180
+ var import_jsx_runtime21 = require("react/jsx-runtime");
11181
+ var MenuContent = (0, import_react144.forwardRef)(
11182
+ function MenuContent2(props2, ref2) {
11183
+ const { portalled = true, portalRef, ...rest } = props2;
11184
+ return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_react145.Portal, { disabled: !portalled, container: portalRef, children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_react145.Menu.Positioner, { children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_react145.Menu.Content, { ref: ref2, ...rest }) }) });
11185
+ }
11186
+ );
11187
+ var MenuArrow = (0, import_react144.forwardRef)(
11188
+ function MenuArrow2(props2, ref2) {
11189
+ return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_react145.Menu.Arrow, { ref: ref2, ...props2, children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_react145.Menu.ArrowTip, {}) });
11190
+ }
11191
+ );
11192
+ var MenuCheckboxItem = (0, import_react144.forwardRef)(function MenuCheckboxItem2(props2, ref2) {
11193
+ return /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(import_react145.Menu.CheckboxItem, { ref: ref2, ...props2, children: [
11194
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_react145.Menu.ItemIndicator, { hidden: false, children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(LuCheck, {}) }),
11195
+ props2.children
11196
+ ] });
11197
+ });
11198
+ var MenuRadioItem = (0, import_react144.forwardRef)(
11199
+ function MenuRadioItem2(props2, ref2) {
11200
+ const { children, ...rest } = props2;
11201
+ return /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(import_react145.Menu.RadioItem, { ps: "8", ref: ref2, ...rest, children: [
11202
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_react145.AbsoluteCenter, { axis: "horizontal", left: "4", asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_react145.Menu.ItemIndicator, { children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(LuCheck, {}) }) }),
11203
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_react145.Menu.ItemText, { children })
11204
+ ] });
11205
+ }
11206
+ );
11207
+ var MenuItemGroup = (0, import_react144.forwardRef)(
11208
+ function MenuItemGroup2(props2, ref2) {
11209
+ const { title, children, ...rest } = props2;
11210
+ return /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(import_react145.Menu.ItemGroup, { ref: ref2, ...rest, children: [
11211
+ title && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_react145.Menu.ItemGroupLabel, { userSelect: "none", children: title }),
11212
+ children
11213
+ ] });
11214
+ }
11215
+ );
11216
+ var MenuTriggerItem = (0, import_react144.forwardRef)(
11217
+ function MenuTriggerItem2(props2, ref2) {
11218
+ const { startIcon, children, ...rest } = props2;
11219
+ return /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(import_react145.Menu.TriggerItem, { ref: ref2, ...rest, children: [
11220
+ startIcon,
11221
+ children,
11222
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(LuChevronRight, {})
11223
+ ] });
11224
+ }
11225
+ );
11226
+ var MenuRadioItemGroup = import_react145.Menu.RadioItemGroup;
11227
+ var MenuContextTrigger = import_react145.Menu.ContextTrigger;
11228
+ var MenuRoot = import_react145.Menu.Root;
11229
+ var MenuSeparator = import_react145.Menu.Separator;
11230
+ var MenuItem = import_react145.Menu.Item;
11231
+ var MenuItemText = import_react145.Menu.ItemText;
11232
+ var MenuItemCommand = import_react145.Menu.ItemCommand;
11233
+ var MenuTrigger = import_react145.Menu.Trigger;
11234
+
11235
+ // src/components/password-input/password-input.tsx
11236
+ var import_react146 = require("react");
11237
+ var import_react147 = require("@chakra-ui/react");
11238
+ var import_jsx_runtime22 = require("react/jsx-runtime");
11239
+ var PasswordInput = (0, import_react146.forwardRef)(
11240
+ function PasswordInput2(props2, ref2) {
11241
+ const {
11242
+ rootProps,
11243
+ defaultVisible,
11244
+ visible: visibleProp,
11245
+ onVisibleChange,
11246
+ visibilityIcon = { on: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(LuEye, {}), off: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(LuEyeOff, {}) },
11247
+ ...rest
11248
+ } = props2;
11249
+ const [visible, setVisible] = (0, import_react147.useControllableState)({
11250
+ value: visibleProp,
11251
+ defaultValue: defaultVisible || false,
11252
+ onChange: onVisibleChange
11253
+ });
11254
+ const inputRef = (0, import_react146.useRef)(null);
11255
+ return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
11256
+ InputGroup,
11257
+ {
11258
+ width: "full",
11259
+ endElement: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
11260
+ VisibilityTrigger,
11261
+ {
11262
+ disabled: rest.disabled,
11263
+ onPointerDown: (e) => {
11264
+ if (rest.disabled) return;
11265
+ if (e.button !== 0) return;
11266
+ e.preventDefault();
11267
+ setVisible(!visible);
11268
+ },
11269
+ children: visible ? visibilityIcon.off : visibilityIcon.on
11270
+ }
11271
+ ),
11272
+ ...rootProps,
11273
+ children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
11274
+ import_react147.Input,
11275
+ {
11276
+ ...rest,
11277
+ ref: (0, import_react147.mergeRefs)(ref2, inputRef),
11278
+ type: visible ? "text" : "password"
11279
+ }
11280
+ )
11281
+ }
11282
+ );
11283
+ }
11284
+ );
11285
+ var VisibilityTrigger = (0, import_react146.forwardRef)(
11286
+ function VisibilityTrigger2(props2, ref2) {
11287
+ return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
11288
+ import_react147.IconButton,
11289
+ {
11290
+ tabIndex: -1,
11291
+ ref: ref2,
11292
+ me: "-2",
11293
+ aspectRatio: "square",
11294
+ size: "sm",
11295
+ variant: "ghost",
11296
+ colorPalette: "gray",
11297
+ height: "calc(100% - {spacing.2})",
11298
+ "aria-label": "Toggle password visibility",
11299
+ ...props2
11300
+ }
11301
+ );
11302
+ }
11303
+ );
11304
+
11305
+ // src/components/persona/persona.tsx
11306
+ var React7 = __toESM(require("react"), 1);
11307
+
11308
+ // src/components/persona/persona-primitive.tsx
11309
+ var import_react149 = require("react");
11310
+ var import_react150 = require("@chakra-ui/react");
11311
+ var import_utils9 = require("@saas-ui/core/utils");
11312
+
11313
+ // src/components/persona/persona.context.ts
11314
+ var import_react148 = require("@chakra-ui/react");
11315
+ var {
11316
+ useStyles: usePersonaStyles,
11317
+ withProvider: withProvider5,
11318
+ withContext: withContext6
11319
+ } = (0, import_react148.createSlotRecipeContext)({
11320
+ key: "suiPersona"
11321
+ });
11322
+
11323
+ // src/components/persona/persona-primitive.tsx
11324
+ var import_jsx_runtime23 = require("react/jsx-runtime");
11325
+ var PersonaRoot = withProvider5(
11326
+ (0, import_react149.forwardRef)((props2, ref2) => {
11327
+ const { outOfOffice, presence, ...rest } = props2;
11328
+ return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
11329
+ import_react150.chakra.div,
11330
+ {
11331
+ ref: ref2,
11332
+ ...rest,
11333
+ "data-out-of-office": (0, import_utils9.dataAttr)(outOfOffice),
11334
+ "data-presence": presence,
11335
+ css: [
11336
+ presence ? {
11337
+ "--persona-presence": `colors.presence.${presence}`
11338
+ } : void 0,
11339
+ rest.css
11340
+ ]
11341
+ }
11342
+ );
11343
+ }),
11344
+ "root"
11345
+ );
11346
+ var PersonaAvatar = (0, import_react149.forwardRef)(
11347
+ (props2, ref2) => {
11348
+ const {
11349
+ name,
11350
+ getInitials: getInitials2 = (name2) => name2 == null ? void 0 : name2[0],
11351
+ icon,
11352
+ loading,
11353
+ onError,
11354
+ src,
11355
+ srcSet,
11356
+ children,
11357
+ ...rest
11358
+ } = props2;
11359
+ return /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(import_react150.Avatar.Root, { ref: ref2, ...rest, children: [
11360
+ /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_react150.Avatar.Fallback, { children: getInitials2(name) }),
11361
+ /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
11362
+ import_react150.Avatar.Image,
11363
+ {
11364
+ src,
11365
+ srcSet,
11366
+ loading,
11367
+ onError
11368
+ }
11369
+ ),
11370
+ children
11371
+ ] });
11372
+ }
11373
+ );
11374
+ var PersonaPresenceBadge = withContext6("span", "presence");
11375
+ var PersonaDetails = withContext6(
11376
+ "div",
11377
+ "details"
11378
+ );
11379
+ var PersonaLabel = withContext6(
11380
+ "span",
11381
+ "label"
11382
+ );
11383
+ PersonaLabel.displayName = "PersonaLabel";
11384
+ var PersonaSecondaryLabel = withContext6(
11385
+ "span",
11386
+ "secondaryLabel"
11387
+ );
11388
+ var PersonaTertiaryLabel = withContext6(
11389
+ "span",
11390
+ "tertiaryLabel"
11391
+ );
11392
+
11393
+ // src/components/persona/persona.tsx
11394
+ var import_jsx_runtime24 = require("react/jsx-runtime");
11395
+ var Persona = React7.forwardRef(
11396
+ (props2, ref2) => {
11397
+ const {
11398
+ name,
11399
+ presence,
11400
+ presenceIcon,
11401
+ isOutOfOffice,
11402
+ label,
11403
+ secondaryLabel,
11404
+ tertiaryLabel,
11405
+ size,
11406
+ hideDetails,
11407
+ children,
11408
+ /** Avatar props */
11409
+ getInitials: getInitials2,
11410
+ icon,
11411
+ loading,
11412
+ onError,
11413
+ src,
11414
+ srcSet,
11415
+ ...rest
11416
+ } = props2;
11417
+ return /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(
11418
+ PersonaRoot,
11419
+ {
11420
+ ref: ref2,
11421
+ outOfOffice: isOutOfOffice,
11422
+ presence,
11423
+ ...rest,
11424
+ children: [
11425
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
11426
+ PersonaAvatar,
11427
+ {
11428
+ name,
11429
+ size,
11430
+ getInitials: getInitials2,
11431
+ icon,
11432
+ loading,
11433
+ onError,
11434
+ src,
11435
+ srcSet,
11436
+ children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(PersonaPresenceBadge, { children: presenceIcon })
11437
+ }
11438
+ ),
11439
+ !hideDetails && /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(PersonaDetails, { children: [
11440
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(PersonaLabel, { children: label || name }),
11441
+ secondaryLabel && /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(PersonaSecondaryLabel, { children: secondaryLabel }),
11442
+ tertiaryLabel && /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(PersonaTertiaryLabel, { children: tertiaryLabel }),
11443
+ children
11444
+ ] })
11445
+ ]
11446
+ }
11447
+ );
11448
+ }
11449
+ );
11450
+ Persona.displayName = "Persona";
11451
+ var PersonaAvatar2 = React7.forwardRef(function PersonaAvatar3(props2, ref2) {
11452
+ return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(Persona, { ref: ref2, ...props2, hideDetails: true });
11453
+ });
11454
+
11455
+ // src/components/persona/presence.ts
11456
+ var defaultPresenceOptions = {
11457
+ online: {
11458
+ label: "Online",
11459
+ color: "presence.online"
11460
+ },
11461
+ offline: {
11462
+ label: "Offline",
11463
+ color: "presence.offline"
11464
+ },
11465
+ busy: {
11466
+ label: "Busy",
11467
+ color: "presence.busy"
11468
+ },
11469
+ dnd: {
11470
+ label: "Do-not-disturb",
11471
+ color: "presence.dnd"
11472
+ },
11473
+ away: {
11474
+ label: "Away",
11475
+ color: "presence.away"
11476
+ }
11477
+ };
11478
+
11479
+ // src/components/pin-input/pin-input.tsx
11480
+ var import_react151 = require("react");
11481
+ var import_react152 = require("@chakra-ui/react");
11482
+ var import_jsx_runtime25 = require("react/jsx-runtime");
11483
+ var PinInput = (0, import_react151.forwardRef)(
11484
+ function PinInput2(props2, ref2) {
11485
+ const {
11486
+ pinLength = 4,
11487
+ inputProps,
11488
+ rootRef,
11489
+ attached,
11490
+ gap = attached ? 0 : 2,
11491
+ ...rest
11492
+ } = props2;
11493
+ return /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(import_react152.PinInput.Root, { ref: rootRef, ...rest, children: [
11494
+ /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_react152.PinInput.HiddenInput, { ref: ref2, ...inputProps }),
11495
+ /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_react152.PinInput.Control, { children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_react152.Group, { attached, gap, children: Array.from({ length: pinLength }).map((_, index) => /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_react152.PinInput.Input, { index }, index)) }) })
11496
+ ] });
11497
+ }
11498
+ );
11499
+
11500
+ // src/components/radio/radio.tsx
11501
+ var import_react153 = require("react");
11502
+ var import_react154 = require("@chakra-ui/react");
11503
+ var import_jsx_runtime26 = require("react/jsx-runtime");
11504
+ var Radio = (0, import_react153.forwardRef)(
11505
+ function Radio2(props2, ref2) {
11506
+ const { children, inputProps, rootRef, ...rest } = props2;
11507
+ return /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(import_react154.RadioGroup.Item, { ref: rootRef, ...rest, children: [
11508
+ /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_react154.RadioGroup.ItemHiddenInput, { ref: ref2, ...inputProps }),
11509
+ /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_react154.RadioGroup.ItemIndicator, {}),
11510
+ children && /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_react154.RadioGroup.ItemText, { children })
11511
+ ] });
11512
+ }
11513
+ );
11514
+ var RadioGroup = import_react154.RadioGroup.Root;
11515
+
11516
+ // src/components/search-input/search-input.tsx
11517
+ var import_react155 = __toESM(require("react"), 1);
11518
+ var import_react156 = require("@chakra-ui/react");
11519
+ var import_utils10 = require("@saas-ui/core/utils");
11520
+ var import_jsx_runtime27 = require("react/jsx-runtime");
11521
+ var SearchInput = (0, import_react155.forwardRef)(
11522
+ (props2, ref2) => {
11523
+ const {
11524
+ placeholder = "Search",
11525
+ value: valueProp,
11526
+ defaultValue: defaultValueProp,
11527
+ size,
11528
+ variant,
11529
+ width = "full",
11530
+ icon = /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(SearchIcon, {}),
11531
+ resetIcon,
11532
+ endElement: endElementProp,
11533
+ onChange: onChangeProp,
11534
+ onReset: onResetProp,
11535
+ onKeyDown: onKeyDownProp,
11536
+ disabled,
11537
+ ...inputProps
11538
+ } = props2;
11539
+ const inputRef = import_react155.default.useRef(null);
11540
+ const [value, setValue] = (0, import_react156.useControllableState)({
11541
+ value: valueProp,
11542
+ defaultValue: defaultValueProp
11543
+ });
11544
+ const onChange = import_react155.default.useCallback(
11545
+ (e) => {
11546
+ setValue(e.target.value);
11547
+ },
11548
+ [setValue]
11549
+ );
11550
+ const onKeyDown = import_react155.default.useCallback(
11551
+ (event) => {
11552
+ if (event.key === "Escape") {
11553
+ setValue("");
11554
+ onReset();
11555
+ }
11556
+ },
11557
+ [onResetProp, setValue]
11558
+ );
11559
+ const onReset = () => {
11560
+ var _a7;
11561
+ setValue("");
11562
+ onResetProp == null ? void 0 : onResetProp();
11563
+ (_a7 = inputRef.current) == null ? void 0 : _a7.focus();
11564
+ };
11565
+ const showReset = value && !props2.disabled;
11566
+ const endElement = showReset ? /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(SearchInputResetButton, { size, children: resetIcon }) : endElementProp;
11567
+ return /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(import_react156.Group, { width, children: [
11568
+ /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
11569
+ import_react156.InputElement,
11570
+ {
11571
+ placement: "start",
11572
+ px: "0",
11573
+ aspectRatio: "9/10",
11574
+ fontSize: size,
11575
+ children: icon
11576
+ }
11577
+ ),
11578
+ /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
11579
+ import_react156.Input,
11580
+ {
11581
+ type: "text",
11582
+ placeholder,
11583
+ variant,
11584
+ size,
11585
+ value,
11586
+ disabled,
11587
+ ref: (0, import_react156.mergeRefs)(ref2, inputRef),
11588
+ onChange: (0, import_utils10.callAll)(onChange, onChangeProp),
11589
+ onKeyDown: (0, import_utils10.callAll)(onKeyDown, onKeyDownProp),
11590
+ ps: "calc(var(--input-height) - var(--input-height) / 10)",
11591
+ pe: "calc(var(--input-height) - var(--input-height) / 10)",
11592
+ ...inputProps
11593
+ }
11594
+ ),
11595
+ /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_react156.InputElement, { placement: "end", children: endElement })
11596
+ ] });
11597
+ }
11598
+ );
11599
+ var SearchInputResetButton = (0, import_react155.forwardRef)(
11600
+ (props2, ref2) => {
11601
+ const { children = /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(CloseIcon, {}), ...rest } = props2;
11602
+ return /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
11603
+ import_react156.IconButton,
11604
+ {
11605
+ ref: ref2,
11606
+ variant: "ghost",
11607
+ "aria-label": "Reset search",
11608
+ me: "-2",
11609
+ aspectRatio: "square",
11610
+ height: "calc(100% - {spacing.2})",
11611
+ ...rest,
11612
+ children
11613
+ }
11614
+ );
11615
+ }
11616
+ );
11617
+ SearchInput.displayName = "SearchInput";
11618
+
11619
+ // src/components/select/namespace.ts
11620
+ var namespace_exports4 = {};
11621
+ __export(namespace_exports4, {
11622
+ Content: () => SelectContent,
11623
+ Item: () => SelectItem,
11624
+ ItemGroup: () => SelectItemGroup,
11625
+ ItemText: () => SelectItemText,
11626
+ Label: () => SelectLabel,
11627
+ Root: () => SelectRoot,
11628
+ Trigger: () => SelectTrigger,
11629
+ ValueText: () => SelectValueText
11630
+ });
11631
+
11632
+ // src/components/select/select.tsx
11633
+ var import_react157 = require("react");
11634
+ var import_react158 = require("@chakra-ui/react");
11635
+ var import_jsx_runtime28 = require("react/jsx-runtime");
11636
+ var SelectTrigger = (0, import_react157.forwardRef)(
11637
+ function SelectTrigger2(props2, ref2) {
11638
+ const { children, clearable, ...rest } = props2;
11639
+ return /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(import_react158.Select.Control, { ...rest, children: [
11640
+ /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(import_react158.Select.Trigger, { ref: ref2, children }),
11641
+ /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(import_react158.Select.IndicatorGroup, { children: [
11642
+ clearable && /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(SelectClearTrigger, {}),
11643
+ /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(import_react158.Select.Indicator, {})
11644
+ ] })
11645
+ ] });
11646
+ }
11647
+ );
11648
+ var SelectClearTrigger = (0, import_react157.forwardRef)(function SelectClearTrigger2(props2, ref2) {
11649
+ return /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(import_react158.Select.ClearTrigger, { asChild: true, ...props2, ref: ref2, children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
11650
+ CloseButton,
11651
+ {
11652
+ size: "xs",
11653
+ variant: "plain",
11654
+ focusVisibleRing: "inside",
11655
+ focusRingWidth: "2px",
11656
+ pointerEvents: "auto"
11657
+ }
11658
+ ) });
11659
+ });
11660
+ var SelectContent = (0, import_react157.forwardRef)(
11661
+ function SelectContent2(props2, ref2) {
11662
+ const { portalled = true, portalRef, ...rest } = props2;
11663
+ return /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(import_react158.Portal, { disabled: !portalled, container: portalRef, children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(import_react158.Select.Positioner, { children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(import_react158.Select.Content, { ...rest, ref: ref2 }) }) });
11664
+ }
11665
+ );
11666
+ var SelectItem = (0, import_react157.forwardRef)(
11667
+ function SelectItem2(props2, ref2) {
11668
+ const { item, children, ...rest } = props2;
11669
+ return /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(import_react158.Select.Item, { item, ...rest, ref: ref2, children: [
11670
+ children,
11671
+ /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(import_react158.Select.ItemIndicator, {})
11672
+ ] }, item.value);
11673
+ }
11674
+ );
11675
+ var SelectValueText = (0, import_react157.forwardRef)(function SelectValueText2(props2, ref2) {
11676
+ const { children, ...rest } = props2;
11677
+ return /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(import_react158.Select.ValueText, { ...rest, ref: ref2, children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(import_react158.Select.Context, { children: (select) => {
11678
+ const items = select.selectedItems;
11679
+ if (items.length === 0) return props2.placeholder;
11680
+ if (children) return children(items);
11681
+ if (items.length === 1)
11682
+ return select.collection.stringifyItem(items[0]);
11683
+ return `${items.length} selected`;
11684
+ } }) });
11685
+ });
11686
+ var SelectRoot = (0, import_react157.forwardRef)(function SelectRoot2(props2, ref2) {
11687
+ return /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
11688
+ import_react158.Select.Root,
11689
+ {
11690
+ ...props2,
11691
+ ref: ref2,
11692
+ positioning: { sameWidth: true, ...props2.positioning }
11693
+ }
11694
+ );
11695
+ });
11696
+ var SelectItemGroup = (0, import_react157.forwardRef)(
11697
+ function SelectItemGroup2(props2, ref2) {
11698
+ const { children, label, ...rest } = props2;
11699
+ return /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(import_react158.Select.ItemGroup, { ...rest, ref: ref2, children: [
11700
+ /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(import_react158.Select.ItemGroupLabel, { children: label }),
11701
+ children
11702
+ ] });
11703
+ }
11704
+ );
11705
+ var SelectLabel = import_react158.Select.Label;
11706
+ var SelectItemText = import_react158.Select.ItemText;
11707
+
11708
+ // src/components/sidebar/sidebar.tsx
11709
+ var sidebar_exports = {};
11710
+ __export(sidebar_exports, {
11711
+ Backdrop: () => SidebarBackdrop,
11712
+ Body: () => SidebarBody,
11713
+ FlyoutTrigger: () => SidebarFlyoutTrigger,
11714
+ Footer: () => SidebarFooter,
11715
+ Group: () => SidebarGroup,
11716
+ GroupContent: () => SidebarGroupContent,
11717
+ GroupEndElement: () => SidebarGroupEndElement,
11718
+ GroupHeader: () => SidebarGroupHeader,
11719
+ GroupTitle: () => SidebarGroupTitle,
11720
+ Header: () => SidebarHeader,
11721
+ NavButton: () => SidebarNavButton,
11722
+ NavItem: () => SidebarNavItem,
11723
+ NavItemEndElement: () => SidebarNavItemEndElement,
11724
+ Provider: () => SidebarProvider,
11725
+ Root: () => SidebarRoot,
11726
+ Track: () => SidebarTrack,
11727
+ Trigger: () => SidebarTrigger
11728
+ });
11729
+ var import_sidebar = require("@saas-ui/core/sidebar");
11730
+
11731
+ // src/components/sidebar/sidebar.context.ts
11732
+ var import_react159 = require("@chakra-ui/react");
11733
+ var {
11734
+ withContext: withContext7,
11735
+ useRecipeResult,
11736
+ StylesProvider,
11737
+ ClassNamesProvider,
11738
+ useStyles: useSidebarStyles
11739
+ } = (0, import_react159.createSlotRecipeContext)({
11740
+ key: "suiSidebar"
11741
+ });
11742
+ var {
11743
+ withProvider: withItemProvider,
11744
+ withContext: withItemContext,
11745
+ useStyles: useSidebarItemStyles
11746
+ } = (0, import_react159.createSlotRecipeContext)({
11747
+ key: "suiSidebarNavItem"
11748
+ });
11749
+
11750
+ // src/components/sidebar/sidebar.tsx
11751
+ var import_jsx_runtime29 = require("react/jsx-runtime");
11752
+ var SidebarProvider = function SidebarProvider2(props2) {
11753
+ return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(import_sidebar.Sidebar.Provider, { ...props2, children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(RecipeProvider, { ...props2, children: props2.children }) });
11754
+ };
11755
+ function RecipeProvider(props2) {
11756
+ const { mode } = (0, import_sidebar.useSidebar)();
11757
+ const { styles, classNames } = useRecipeResult({
11758
+ ...props2,
11759
+ mode
11760
+ });
11761
+ return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(StylesProvider, { value: styles, children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(ClassNamesProvider, { value: classNames, children: props2.children }) });
11762
+ }
11763
+ var SidebarRoot = withContext7(
11764
+ import_sidebar.Sidebar.Root,
11765
+ "root"
11766
+ );
11767
+ var SidebarTrigger = withContext7(
11768
+ import_sidebar.Sidebar.Trigger,
11769
+ "trigger",
11770
+ {
11771
+ forwardAsChild: true
11772
+ }
11773
+ );
11774
+ var SidebarFlyoutTrigger = withContext7(import_sidebar.Sidebar.FlyoutTrigger, "flyoutTrigger", {
11775
+ forwardAsChild: true
11776
+ });
11777
+ var SidebarBackdrop = withContext7(
11778
+ import_sidebar.Sidebar.Backdrop,
11779
+ "backdrop",
11780
+ {
11781
+ forwardAsChild: true
11782
+ }
11783
+ );
11784
+ var SidebarHeader = withContext7(
11785
+ import_sidebar.Sidebar.Header,
11786
+ "header"
11787
+ );
11788
+ var SidebarBody = withContext7(
11789
+ import_sidebar.Sidebar.Body,
11790
+ "body"
11791
+ );
11792
+ var SidebarFooter = withContext7(
11793
+ import_sidebar.Sidebar.Footer,
11794
+ "footer"
11795
+ );
11796
+ var SidebarTrack = withContext7(
11797
+ import_sidebar.Sidebar.Track,
11798
+ "track",
11799
+ {
11800
+ forwardAsChild: true
11801
+ }
11802
+ );
11803
+ var SidebarGroup = withContext7(
11804
+ import_sidebar.Sidebar.Group,
11805
+ "group",
11806
+ {
11807
+ defaultProps: {
11808
+ role: "group"
11809
+ }
11810
+ }
11811
+ );
11812
+ var SidebarGroupHeader = withContext7(
11813
+ import_sidebar.Sidebar.GroupHeader,
11814
+ "groupHeader"
11815
+ );
11816
+ var SidebarGroupTitle = withContext7(import_sidebar.Sidebar.GroupTitle, "groupTitle");
11817
+ var SidebarGroupEndElement = withContext7(import_sidebar.Sidebar.GroupEndElement, "groupEndElement");
11818
+ var SidebarGroupContent = withContext7(
11819
+ import_sidebar.Sidebar.GroupContent,
11820
+ "groupContent"
11821
+ );
11822
+ var SidebarNavItem = withItemProvider(
11823
+ import_sidebar.Sidebar.NavItem,
11824
+ "item"
11825
+ );
11826
+ var SidebarNavButton = withItemContext(import_sidebar.Sidebar.NavButton, "button", {
11827
+ forwardAsChild: true
11828
+ });
11829
+ var SidebarNavItemEndElement = withItemContext(import_sidebar.Sidebar.NavItemEndElement, "endElement");
11830
+
11831
+ // src/components/sidebar/index.ts
11832
+ var import_sidebar2 = require("@saas-ui/core/sidebar");
11833
+
11834
+ // src/components/toaster/toaster.tsx
11835
+ var import_react160 = require("@chakra-ui/react");
11836
+ var import_jsx_runtime30 = require("react/jsx-runtime");
11837
+ var toast = (0, import_react160.createToaster)({
11838
+ placement: "bottom-end",
11839
+ pauseOnPageIdle: true
11840
+ });
11841
+ var Toaster = () => {
11842
+ return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(import_react160.Portal, { children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(import_react160.Toaster, { toaster: toast, insetInline: { mdDown: "4" }, children: (toast2) => {
11843
+ var _a7;
11844
+ return /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(import_react160.Toast.Root, { width: { md: "sm" }, children: [
11845
+ toast2.type === "loading" ? /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(import_react160.Spinner, { size: "sm", color: "colorPalette.solid" }) : /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(import_react160.Toast.Indicator, {}),
11846
+ /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(import_react160.Stack, { gap: "1", flex: "1", maxWidth: "100%", children: [
11847
+ toast2.title && /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(import_react160.Toast.Title, { children: toast2.title }),
11848
+ toast2.description && /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(import_react160.Toast.Description, { children: toast2.description })
11849
+ ] }),
11850
+ toast2.action && /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(import_react160.Toast.ActionTrigger, { children: toast2.action.label }),
11851
+ ((_a7 = toast2.meta) == null ? void 0 : _a7.closable) && /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(import_react160.Toast.CloseTrigger, {})
11852
+ ] });
11853
+ } }) });
11854
+ };
11855
+
11856
+ // src/components/steps/steps.tsx
11857
+ var steps_exports = {};
11858
+ __export(steps_exports, {
11859
+ CompletedContent: () => StepsCompletedContent,
11860
+ Content: () => StepsContent,
11861
+ Indicator: () => StepsIndicator,
11862
+ Item: () => StepsItem,
11863
+ List: () => StepsList,
11864
+ NextTrigger: () => StepsNextTrigger,
11865
+ PrevTrigger: () => StepsPrevTrigger,
11866
+ Root: () => StepsRoot
11867
+ });
11868
+ var import_react161 = require("@chakra-ui/react");
11869
+ var import_jsx_runtime31 = require("react/jsx-runtime");
11870
+ var StepsItem = (props2) => {
11871
+ const { title, description, completedIcon, icon, ...rest } = props2;
11872
+ return /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(import_react161.Steps.Item, { ...rest, children: [
11873
+ /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(import_react161.Steps.Trigger, { children: [
11874
+ /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_react161.Steps.Indicator, { children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
11875
+ import_react161.Steps.Status,
11876
+ {
11877
+ complete: completedIcon || /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(CheckIcon, {}),
11878
+ incomplete: icon || /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_react161.Steps.Number, {})
11879
+ }
11880
+ ) }),
11881
+ /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(StepInfo, { title, description })
11882
+ ] }),
11883
+ /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_react161.Steps.Separator, {})
11884
+ ] });
11885
+ };
11886
+ var StepInfo = (props2) => {
11887
+ const { title, description } = props2;
11888
+ if (title && description) {
11889
+ return /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(import_react161.Box, { children: [
11890
+ /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_react161.Steps.Title, { children: title }),
11891
+ /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_react161.Steps.Description, { children: description })
11892
+ ] });
11893
+ }
11894
+ return /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(import_jsx_runtime31.Fragment, { children: [
11895
+ title && /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_react161.Steps.Title, { children: title }),
11896
+ description && /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_react161.Steps.Description, { children: description })
11897
+ ] });
11898
+ };
11899
+ var StepsIndicator = (props2) => {
11900
+ const { icon = /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_react161.Steps.Number, {}), completedIcon } = props2;
11901
+ return /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_react161.Steps.Indicator, { children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_react161.Steps.Status, { complete: completedIcon, incomplete: icon }) });
11902
+ };
11903
+ var StepsList = import_react161.Steps.List;
11904
+ var StepsRoot = import_react161.Steps.Root;
11905
+ var StepsContent = import_react161.Steps.Content;
11906
+ var StepsCompletedContent = import_react161.Steps.CompletedContent;
11907
+ var StepsNextTrigger = (props2) => {
11908
+ return /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_react161.Steps.NextTrigger, { ...props2 });
11909
+ };
11910
+ var StepsPrevTrigger = (props2) => {
11911
+ return /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_react161.Steps.PrevTrigger, { ...props2 });
11912
+ };
11913
+
11914
+ // src/components/switch/switch.tsx
11915
+ var import_react162 = require("@chakra-ui/react");
11916
+ var import_react163 = require("react");
11917
+ var import_jsx_runtime32 = require("react/jsx-runtime");
11918
+ var Switch = (0, import_react163.forwardRef)(
11919
+ function Switch2(props2, ref2) {
11920
+ const { inputProps, children, rootRef, trackLabel, thumbLabel, ...rest } = props2;
11921
+ return /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(import_react162.Switch.Root, { ref: rootRef, ...rest, children: [
11922
+ /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_react162.Switch.HiddenInput, { ref: ref2, ...inputProps }),
11923
+ /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(import_react162.Switch.Control, { children: [
11924
+ /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_react162.Switch.Thumb, { children: thumbLabel && /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_react162.Switch.ThumbIndicator, { fallback: thumbLabel == null ? void 0 : thumbLabel.off, children: thumbLabel == null ? void 0 : thumbLabel.on }) }),
11925
+ trackLabel && /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_react162.Switch.Indicator, { fallback: trackLabel.off, children: trackLabel.on })
11926
+ ] }),
11927
+ children != null && /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_react162.Switch.Label, { children })
11928
+ ] });
11929
+ }
11930
+ );
11931
+
11932
+ // src/components/tooltip/tooltip.tsx
11933
+ var import_react164 = require("react");
11934
+ var import_react165 = require("@chakra-ui/react");
11935
+ var import_jsx_runtime33 = require("react/jsx-runtime");
11936
+ var Tooltip = (0, import_react164.forwardRef)(
11937
+ function Tooltip2(props2, ref2) {
11938
+ const {
11939
+ showArrow,
11940
+ children,
11941
+ disabled,
11942
+ portalled,
11943
+ content,
11944
+ contentProps,
11945
+ portalRef,
11946
+ ...rest
11947
+ } = props2;
11948
+ if (disabled) return children;
11949
+ return /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(import_react165.Tooltip.Root, { ...rest, children: [
11950
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_react165.Tooltip.Trigger, { asChild: true, children }),
11951
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_react165.Portal, { disabled: !portalled, container: portalRef, children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_react165.Tooltip.Positioner, { children: /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(import_react165.Tooltip.Content, { ref: ref2, ...contentProps, children: [
11952
+ showArrow && /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_react165.Tooltip.Arrow, { children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_react165.Tooltip.ArrowTip, {}) }),
11953
+ content
11954
+ ] }) }) })
11955
+ ] });
11956
+ }
11957
+ );
8440
11958
  // Annotate the CommonJS export names for ESM import in node:
8441
11959
  0 && (module.exports = {
11960
+ AppShell,
11961
+ Avatar,
11962
+ AvatarGroup,
11963
+ Breadcrumb,
11964
+ Button,
11965
+ Checkbox,
11966
+ CloseButton,
11967
+ Command,
11968
+ Dialog,
11969
+ Drawer,
11970
+ EmptyState,
11971
+ GridList,
11972
+ IconBadge,
11973
+ InputGroup,
11974
+ Link,
11975
+ LoadingOverlay,
11976
+ Menu,
11977
+ Navbar,
11978
+ NumberInput,
11979
+ PasswordInput,
11980
+ Persona,
11981
+ PersonaAvatar,
11982
+ PinInput,
11983
+ Radio,
11984
+ RadioGroup,
11985
+ SearchInput,
11986
+ Select,
11987
+ Sidebar,
11988
+ Spinner,
11989
+ Steps,
8442
11990
  SuiContext,
8443
11991
  SuiProvider,
11992
+ Switch,
11993
+ Toaster,
11994
+ Tooltip,
8444
11995
  createSystem,
8445
11996
  defaultConfig,
11997
+ defaultPresenceOptions,
8446
11998
  defaultSystem,
11999
+ toast,
8447
12000
  useLink,
8448
- useSui,
8449
- ...require("@saas-ui/core")
12001
+ useLoadingOverlayStyles,
12002
+ useSidebar,
12003
+ useSidebarItemStyles,
12004
+ useSidebarStyles,
12005
+ useSui
8450
12006
  });