import { s as __toESM } from "./chunk-BNovOVIE.js";
import { _ as Logger, d as createSlot, g as cn, h as Events, m as useComposedRefs, r as cva } from "./button-Dj4BTre0.js";
import { t as require_react } from "./react-DA-nE2FX.js";
import { t as require_compiler_runtime } from "./compiler-runtime-CEbnTgxf.js";
import { a as createPopperScope, c as VISUALLY_HIDDEN_STYLES, i as Root2$1, n as Arrow, r as Content, t as Anchor, u as createLucideIcon } from "./dist-D3ZI9nhS.js";
import { t as Check } from "./check-BcUIXnUT.js";
import { t as require_react_dom } from "./react-dom-BWRJ_g_k.js";
import { t as require_jsx_runtime } from "./jsx-runtime-COBk7ree.js";
import { $ as StyleNamespace, X as withFullScreenAsRoot, Z as withSmartCollisionBoundary, _t as Primitive, at as FocusScope, et as hideOthers, ft as useControllableState, gt as createContextScope, it as Portal, lt as useCallbackRef, mt as composeEventHandlers, pt as useLayoutEffect2, rt as useFocusGuards, st as DismissableLayer, tt as Combination_default, ut as useId } from "./zod-BWkcDORu.js";
import { t as invariant } from "./invariant-UcGKQEhF.js";
var ChevronDown = createLucideIcon("chevron-down", [["path", {
  d: "m6 9 6 6 6-6",
  key: "qrunsl"
}]]), ChevronUp = createLucideIcon("chevron-up", [["path", {
  d: "m18 15-6-6-6 6",
  key: "153udz"
}]]), X = createLucideIcon("x", [["path", {
  d: "M18 6 6 18",
  key: "1bl5f8"
}], ["path", {
  d: "m6 6 12 12",
  key: "d8bk6v"
}]]), import_react = /* @__PURE__ */ __toESM(require_react(), 1), import_jsx_runtime = /* @__PURE__ */ __toESM(require_jsx_runtime(), 1);
function createCollection(e) {
  let i = e + "CollectionProvider", [o, s] = createContextScope(i), [l, u] = o(i, {
    collectionRef: { current: null },
    itemMap: /* @__PURE__ */ new Map()
  }), d = (e2) => {
    let { scope: i2, children: a } = e2, o2 = import_react.useRef(null), s2 = import_react.useRef(/* @__PURE__ */ new Map()).current;
    return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(l, {
      scope: i2,
      itemMap: s2,
      collectionRef: o2,
      children: a
    });
  };
  d.displayName = i;
  let f = e + "CollectionSlot", p = createSlot(f), m = import_react.forwardRef((e2, i2) => {
    let { scope: a, children: o2 } = e2;
    return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(p, {
      ref: useComposedRefs(i2, u(f, a).collectionRef),
      children: o2
    });
  });
  m.displayName = f;
  let h = e + "CollectionItemSlot", g = "data-radix-collection-item", _ = createSlot(h), v = import_react.forwardRef((e2, i2) => {
    let { scope: a, children: o2, ...s2 } = e2, l2 = import_react.useRef(null), d2 = useComposedRefs(i2, l2), f2 = u(h, a);
    return import_react.useEffect(() => (f2.itemMap.set(l2, {
      ref: l2,
      ...s2
    }), () => void f2.itemMap.delete(l2))), /* @__PURE__ */ (0, import_jsx_runtime.jsx)(_, {
      [g]: "",
      ref: d2,
      children: o2
    });
  });
  v.displayName = h;
  function y(i2) {
    let a = u(e + "CollectionConsumer", i2);
    return import_react.useCallback(() => {
      let e2 = a.collectionRef.current;
      if (!e2) return [];
      let i3 = Array.from(e2.querySelectorAll(`[${g}]`));
      return Array.from(a.itemMap.values()).sort((e3, a2) => i3.indexOf(e3.ref.current) - i3.indexOf(a2.ref.current));
    }, [a.collectionRef, a.itemMap]);
  }
  return [
    {
      Provider: d,
      Slot: m,
      ItemSlot: v
    },
    y,
    s
  ];
}
var DirectionContext = import_react.createContext(void 0);
function useDirection(e) {
  let i = import_react.useContext(DirectionContext);
  return e || i || "ltr";
}
function usePrevious(e) {
  let i = import_react.useRef({
    value: e,
    previous: e
  });
  return import_react.useMemo(() => (i.current.value !== e && (i.current.previous = i.current.value, i.current.value = e), i.current.previous), [e]);
}
function clamp(e, [i, a]) {
  return Math.min(a, Math.max(i, e));
}
var import_react_dom = /* @__PURE__ */ __toESM(require_react_dom(), 1), OPEN_KEYS = [
  " ",
  "Enter",
  "ArrowUp",
  "ArrowDown"
], SELECTION_KEYS = [" ", "Enter"], SELECT_NAME = "Select", [Collection, useCollection, createCollectionScope] = createCollection(SELECT_NAME), [createSelectContext, createSelectScope] = createContextScope(SELECT_NAME, [createCollectionScope, createPopperScope]), usePopperScope = createPopperScope(), [SelectProvider, useSelectContext] = createSelectContext(SELECT_NAME), [SelectNativeOptionsProvider, useSelectNativeOptionsContext] = createSelectContext(SELECT_NAME), Select$1 = (e) => {
  let { __scopeSelect: i, children: a, open: o, defaultOpen: s, onOpenChange: c, value: l, defaultValue: u, onValueChange: d, dir: f, name: p, autoComplete: h, disabled: g, required: _, form: v } = e, y = usePopperScope(i), [b, x] = import_react.useState(null), [S, C] = import_react.useState(null), [w, T] = import_react.useState(false), E = useDirection(f), [D, k] = useControllableState({
    prop: o,
    defaultProp: s ?? false,
    onChange: c,
    caller: SELECT_NAME
  }), [A, j] = useControllableState({
    prop: l,
    defaultProp: u,
    onChange: d,
    caller: SELECT_NAME
  }), M = import_react.useRef(null), N = b ? v || !!b.closest("form") : true, [P, F] = import_react.useState(/* @__PURE__ */ new Set()), I = Array.from(P).map((e2) => e2.props.value).join(";");
  return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Root2$1, {
    ...y,
    children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(SelectProvider, {
      required: _,
      scope: i,
      trigger: b,
      onTriggerChange: x,
      valueNode: S,
      onValueNodeChange: C,
      valueNodeHasChildren: w,
      onValueNodeHasChildrenChange: T,
      contentId: useId(),
      value: A,
      onValueChange: j,
      open: D,
      onOpenChange: k,
      dir: E,
      triggerPointerDownPosRef: M,
      disabled: g,
      children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)(Collection.Provider, {
        scope: i,
        children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(SelectNativeOptionsProvider, {
          scope: e.__scopeSelect,
          onNativeOptionAdd: import_react.useCallback((e2) => {
            F((i2) => new Set(i2).add(e2));
          }, []),
          onNativeOptionRemove: import_react.useCallback((e2) => {
            F((i2) => {
              let a2 = new Set(i2);
              return a2.delete(e2), a2;
            });
          }, []),
          children: a
        })
      }), N ? /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(SelectBubbleInput, {
        "aria-hidden": true,
        required: _,
        tabIndex: -1,
        name: p,
        autoComplete: h,
        value: A,
        onChange: (e2) => j(e2.target.value),
        disabled: g,
        form: v,
        children: [A === void 0 ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("option", { value: "" }) : null, Array.from(P)]
      }, I) : null]
    })
  });
};
Select$1.displayName = SELECT_NAME;
var TRIGGER_NAME = "SelectTrigger", SelectTrigger$1 = import_react.forwardRef((e, i) => {
  let { __scopeSelect: a, disabled: o = false, ...s } = e, l = usePopperScope(a), u = useSelectContext(TRIGGER_NAME, a), d = u.disabled || o, f = useComposedRefs(i, u.onTriggerChange), p = useCollection(a), m = import_react.useRef("touch"), [h, g, v] = useTypeaheadSearch((e2) => {
    let i2 = p().filter((e3) => !e3.disabled), a2 = findNextItem(i2, e2, i2.find((e3) => e3.value === u.value));
    a2 !== void 0 && u.onValueChange(a2.value);
  }), y = (e2) => {
    d || (u.onOpenChange(true), v()), e2 && (u.triggerPointerDownPosRef.current = {
      x: Math.round(e2.pageX),
      y: Math.round(e2.pageY)
    });
  };
  return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Anchor, {
    asChild: true,
    ...l,
    children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Primitive.button, {
      type: "button",
      role: "combobox",
      "aria-controls": u.contentId,
      "aria-expanded": u.open,
      "aria-required": u.required,
      "aria-autocomplete": "none",
      dir: u.dir,
      "data-state": u.open ? "open" : "closed",
      disabled: d,
      "data-disabled": d ? "" : void 0,
      "data-placeholder": shouldShowPlaceholder(u.value) ? "" : void 0,
      ...s,
      ref: f,
      onClick: composeEventHandlers(s.onClick, (e2) => {
        e2.currentTarget.focus(), m.current !== "mouse" && y(e2);
      }),
      onPointerDown: composeEventHandlers(s.onPointerDown, (e2) => {
        m.current = e2.pointerType;
        let i2 = e2.target;
        i2.hasPointerCapture(e2.pointerId) && i2.releasePointerCapture(e2.pointerId), e2.button === 0 && e2.ctrlKey === false && e2.pointerType === "mouse" && (y(e2), e2.preventDefault());
      }),
      onKeyDown: composeEventHandlers(s.onKeyDown, (e2) => {
        let i2 = h.current !== "";
        !(e2.ctrlKey || e2.altKey || e2.metaKey) && e2.key.length === 1 && g(e2.key), !(i2 && e2.key === " ") && OPEN_KEYS.includes(e2.key) && (y(), e2.preventDefault());
      })
    })
  });
});
SelectTrigger$1.displayName = TRIGGER_NAME;
var VALUE_NAME = "SelectValue", SelectValue$1 = import_react.forwardRef((e, i) => {
  let { __scopeSelect: a, className: o, style: s, children: l, placeholder: u = "", ...d } = e, f = useSelectContext(VALUE_NAME, a), { onValueNodeHasChildrenChange: p } = f, m = l !== void 0, h = useComposedRefs(i, f.onValueNodeChange);
  return useLayoutEffect2(() => {
    p(m);
  }, [p, m]), /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Primitive.span, {
    ...d,
    ref: h,
    style: { pointerEvents: "none" },
    children: shouldShowPlaceholder(f.value) ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_jsx_runtime.Fragment, { children: u }) : l
  });
});
SelectValue$1.displayName = VALUE_NAME;
var ICON_NAME = "SelectIcon", SelectIcon = import_react.forwardRef((e, i) => {
  let { __scopeSelect: a, children: o, ...s } = e;
  return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Primitive.span, {
    "aria-hidden": true,
    ...s,
    ref: i,
    children: o || "\u25BC"
  });
});
SelectIcon.displayName = ICON_NAME;
var PORTAL_NAME = "SelectPortal", SelectPortal$1 = (e) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Portal, {
  asChild: true,
  ...e
});
SelectPortal$1.displayName = PORTAL_NAME;
var CONTENT_NAME = "SelectContent", SelectContent$1 = import_react.forwardRef((e, i) => {
  let a = useSelectContext(CONTENT_NAME, e.__scopeSelect), [o, s] = import_react.useState();
  if (useLayoutEffect2(() => {
    s(new DocumentFragment());
  }, []), !a.open) {
    let i2 = o;
    return i2 ? import_react_dom.createPortal(/* @__PURE__ */ (0, import_jsx_runtime.jsx)(SelectContentProvider, {
      scope: e.__scopeSelect,
      children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Collection.Slot, {
        scope: e.__scopeSelect,
        children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { children: e.children })
      })
    }), i2) : null;
  }
  return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(SelectContentImpl, {
    ...e,
    ref: i
  });
});
SelectContent$1.displayName = CONTENT_NAME;
var CONTENT_MARGIN = 10, [SelectContentProvider, useSelectContentContext] = createSelectContext(CONTENT_NAME), CONTENT_IMPL_NAME = "SelectContentImpl", Slot = createSlot("SelectContent.RemoveScroll"), SelectContentImpl = import_react.forwardRef((e, i) => {
  let { __scopeSelect: a, position: o = "item-aligned", onCloseAutoFocus: s, onEscapeKeyDown: l, onPointerDownOutside: u, side: d, sideOffset: f, align: p, alignOffset: m, arrowPadding: h, collisionBoundary: g, collisionPadding: _, sticky: v, hideWhenDetached: y, avoidCollisions: b, ...x } = e, S = useSelectContext(CONTENT_NAME, a), [C, w] = import_react.useState(null), [T, O] = import_react.useState(null), k = useComposedRefs(i, (e2) => w(e2)), [A, j] = import_react.useState(null), [N, L] = import_react.useState(null), R = useCollection(a), [z, B] = import_react.useState(false), V = import_react.useRef(false);
  import_react.useEffect(() => {
    if (C) return hideOthers(C);
  }, [C]), useFocusGuards();
  let H = import_react.useCallback((e2) => {
    let [i2, ...a2] = R().map((e3) => e3.ref.current), [o2] = a2.slice(-1), s2 = document.activeElement;
    for (let a3 of e2) if (a3 === s2 || (a3 == null ? void 0 : a3.scrollIntoView({ block: "nearest" }), a3 === i2 && T && (T.scrollTop = 0), a3 === o2 && T && (T.scrollTop = T.scrollHeight), a3 == null ? void 0 : a3.focus(), document.activeElement !== s2)) return;
  }, [R, T]), U = import_react.useCallback(() => H([A, C]), [
    H,
    A,
    C
  ]);
  import_react.useEffect(() => {
    z && U();
  }, [z, U]);
  let { onOpenChange: W, triggerPointerDownPosRef: G } = S;
  import_react.useEffect(() => {
    if (C) {
      let e2 = {
        x: 0,
        y: 0
      }, i2 = (i3) => {
        var _a, _b;
        e2 = {
          x: Math.abs(Math.round(i3.pageX) - (((_a = G.current) == null ? void 0 : _a.x) ?? 0)),
          y: Math.abs(Math.round(i3.pageY) - (((_b = G.current) == null ? void 0 : _b.y) ?? 0))
        };
      }, a2 = (a3) => {
        e2.x <= 10 && e2.y <= 10 ? a3.preventDefault() : C.contains(a3.target) || W(false), document.removeEventListener("pointermove", i2), G.current = null;
      };
      return G.current !== null && (document.addEventListener("pointermove", i2), document.addEventListener("pointerup", a2, {
        capture: true,
        once: true
      })), () => {
        document.removeEventListener("pointermove", i2), document.removeEventListener("pointerup", a2, { capture: true });
      };
    }
  }, [
    C,
    W,
    G
  ]), import_react.useEffect(() => {
    let e2 = () => W(false);
    return window.addEventListener("blur", e2), window.addEventListener("resize", e2), () => {
      window.removeEventListener("blur", e2), window.removeEventListener("resize", e2);
    };
  }, [W]);
  let [K, q] = useTypeaheadSearch((e2) => {
    let i2 = R().filter((e3) => !e3.disabled), a2 = findNextItem(i2, e2, i2.find((e3) => e3.ref.current === document.activeElement));
    a2 && setTimeout(() => a2.ref.current.focus());
  }), J = import_react.useCallback((e2, i2, a2) => {
    let o2 = !V.current && !a2;
    (S.value !== void 0 && S.value === i2 || o2) && (j(e2), o2 && (V.current = true));
  }, [S.value]), Y = import_react.useCallback(() => C == null ? void 0 : C.focus(), [C]), Z = import_react.useCallback((e2, i2, a2) => {
    let o2 = !V.current && !a2;
    (S.value !== void 0 && S.value === i2 || o2) && L(e2);
  }, [S.value]), Q = o === "popper" ? SelectPopperPosition : SelectItemAlignedPosition, $ = Q === SelectPopperPosition ? {
    side: d,
    sideOffset: f,
    align: p,
    alignOffset: m,
    arrowPadding: h,
    collisionBoundary: g,
    collisionPadding: _,
    sticky: v,
    hideWhenDetached: y,
    avoidCollisions: b
  } : {};
  return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(SelectContentProvider, {
    scope: a,
    content: C,
    viewport: T,
    onViewportChange: O,
    itemRefCallback: J,
    selectedItem: A,
    onItemLeave: Y,
    itemTextRefCallback: Z,
    focusSelectedItem: U,
    selectedItemText: N,
    position: o,
    isPositioned: z,
    searchRef: K,
    children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Combination_default, {
      as: Slot,
      allowPinchZoom: true,
      children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(FocusScope, {
        asChild: true,
        trapped: S.open,
        onMountAutoFocus: (e2) => {
          e2.preventDefault();
        },
        onUnmountAutoFocus: composeEventHandlers(s, (e2) => {
          var _a;
          (_a = S.trigger) == null ? void 0 : _a.focus({ preventScroll: true }), e2.preventDefault();
        }),
        children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(DismissableLayer, {
          asChild: true,
          disableOutsidePointerEvents: true,
          onEscapeKeyDown: l,
          onPointerDownOutside: u,
          onFocusOutside: (e2) => e2.preventDefault(),
          onDismiss: () => S.onOpenChange(false),
          children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Q, {
            role: "listbox",
            id: S.contentId,
            "data-state": S.open ? "open" : "closed",
            dir: S.dir,
            onContextMenu: (e2) => e2.preventDefault(),
            ...x,
            ...$,
            onPlaced: () => B(true),
            ref: k,
            style: {
              display: "flex",
              flexDirection: "column",
              outline: "none",
              ...x.style
            },
            onKeyDown: composeEventHandlers(x.onKeyDown, (e2) => {
              let i2 = e2.ctrlKey || e2.altKey || e2.metaKey;
              if (e2.key === "Tab" && e2.preventDefault(), !i2 && e2.key.length === 1 && q(e2.key), [
                "ArrowUp",
                "ArrowDown",
                "Home",
                "End"
              ].includes(e2.key)) {
                let i3 = R().filter((e3) => !e3.disabled).map((e3) => e3.ref.current);
                if (["ArrowUp", "End"].includes(e2.key) && (i3 = i3.slice().reverse()), ["ArrowUp", "ArrowDown"].includes(e2.key)) {
                  let a2 = e2.target, o2 = i3.indexOf(a2);
                  i3 = i3.slice(o2 + 1);
                }
                setTimeout(() => H(i3)), e2.preventDefault();
              }
            })
          })
        })
      })
    })
  });
});
SelectContentImpl.displayName = CONTENT_IMPL_NAME;
var ITEM_ALIGNED_POSITION_NAME = "SelectItemAlignedPosition", SelectItemAlignedPosition = import_react.forwardRef((e, i) => {
  let { __scopeSelect: a, onPlaced: o, ...s } = e, l = useSelectContext(CONTENT_NAME, a), u = useSelectContentContext(CONTENT_NAME, a), [d, f] = import_react.useState(null), [p, m] = import_react.useState(null), h = useComposedRefs(i, (e2) => m(e2)), g = useCollection(a), _ = import_react.useRef(false), v = import_react.useRef(true), { viewport: y, selectedItem: b, selectedItemText: x, focusSelectedItem: S } = u, C = import_react.useCallback(() => {
    if (l.trigger && l.valueNode && d && p && y && b && x) {
      let e2 = l.trigger.getBoundingClientRect(), i2 = p.getBoundingClientRect(), a2 = l.valueNode.getBoundingClientRect(), s2 = x.getBoundingClientRect();
      if (l.dir !== "rtl") {
        let o2 = s2.left - i2.left, c2 = a2.left - o2, l2 = e2.left - c2, u3 = e2.width + l2, f3 = Math.max(u3, i2.width), p2 = window.innerWidth - CONTENT_MARGIN, m3 = clamp(c2, [CONTENT_MARGIN, Math.max(CONTENT_MARGIN, p2 - f3)]);
        d.style.minWidth = u3 + "px", d.style.left = m3 + "px";
      } else {
        let o2 = i2.right - s2.right, c2 = window.innerWidth - a2.right - o2, l2 = window.innerWidth - e2.right - c2, u3 = e2.width + l2, f3 = Math.max(u3, i2.width), p2 = window.innerWidth - CONTENT_MARGIN, m3 = clamp(c2, [CONTENT_MARGIN, Math.max(CONTENT_MARGIN, p2 - f3)]);
        d.style.minWidth = u3 + "px", d.style.right = m3 + "px";
      }
      let c = g(), u2 = window.innerHeight - CONTENT_MARGIN * 2, f2 = y.scrollHeight, m2 = window.getComputedStyle(p), h2 = parseInt(m2.borderTopWidth, 10), v2 = parseInt(m2.paddingTop, 10), S2 = parseInt(m2.borderBottomWidth, 10), C2 = parseInt(m2.paddingBottom, 10), w2 = h2 + v2 + f2 + C2 + S2, T = Math.min(b.offsetHeight * 5, w2), E2 = window.getComputedStyle(y), D = parseInt(E2.paddingTop, 10), O = parseInt(E2.paddingBottom, 10), k = e2.top + e2.height / 2 - CONTENT_MARGIN, A = u2 - k, j = b.offsetHeight / 2, M = b.offsetTop + j, N = h2 + v2 + M, P = w2 - N;
      if (N <= k) {
        let e3 = c.length > 0 && b === c[c.length - 1].ref.current;
        d.style.bottom = "0px";
        let i3 = p.clientHeight - y.offsetTop - y.offsetHeight, a3 = N + Math.max(A, j + (e3 ? O : 0) + i3 + S2);
        d.style.height = a3 + "px";
      } else {
        let e3 = c.length > 0 && b === c[0].ref.current;
        d.style.top = "0px";
        let i3 = Math.max(k, h2 + y.offsetTop + (e3 ? D : 0) + j) + P;
        d.style.height = i3 + "px", y.scrollTop = N - k + y.offsetTop;
      }
      d.style.margin = `${CONTENT_MARGIN}px 0`, d.style.minHeight = T + "px", d.style.maxHeight = u2 + "px", o == null ? void 0 : o(), requestAnimationFrame(() => _.current = true);
    }
  }, [
    g,
    l.trigger,
    l.valueNode,
    d,
    p,
    y,
    b,
    x,
    l.dir,
    o
  ]);
  useLayoutEffect2(() => C(), [C]);
  let [w, E] = import_react.useState();
  return useLayoutEffect2(() => {
    p && E(window.getComputedStyle(p).zIndex);
  }, [p]), /* @__PURE__ */ (0, import_jsx_runtime.jsx)(SelectViewportProvider, {
    scope: a,
    contentWrapper: d,
    shouldExpandOnScrollRef: _,
    onScrollButtonChange: import_react.useCallback((e2) => {
      e2 && v.current === true && (C(), S == null ? void 0 : S(), v.current = false);
    }, [C, S]),
    children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
      ref: f,
      style: {
        display: "flex",
        flexDirection: "column",
        position: "fixed",
        zIndex: w
      },
      children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Primitive.div, {
        ...s,
        ref: h,
        style: {
          boxSizing: "border-box",
          maxHeight: "100%",
          ...s.style
        }
      })
    })
  });
});
SelectItemAlignedPosition.displayName = ITEM_ALIGNED_POSITION_NAME;
var POPPER_POSITION_NAME = "SelectPopperPosition", SelectPopperPosition = import_react.forwardRef((e, i) => {
  let { __scopeSelect: a, align: o = "start", collisionPadding: s = CONTENT_MARGIN, ...c } = e, l = usePopperScope(a);
  return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Content, {
    ...l,
    ...c,
    ref: i,
    align: o,
    collisionPadding: s,
    style: {
      boxSizing: "border-box",
      ...c.style,
      "--radix-select-content-transform-origin": "var(--radix-popper-transform-origin)",
      "--radix-select-content-available-width": "var(--radix-popper-available-width)",
      "--radix-select-content-available-height": "var(--radix-popper-available-height)",
      "--radix-select-trigger-width": "var(--radix-popper-anchor-width)",
      "--radix-select-trigger-height": "var(--radix-popper-anchor-height)"
    }
  });
});
SelectPopperPosition.displayName = POPPER_POSITION_NAME;
var [SelectViewportProvider, useSelectViewportContext] = createSelectContext(CONTENT_NAME, {}), VIEWPORT_NAME = "SelectViewport", SelectViewport = import_react.forwardRef((e, i) => {
  let { __scopeSelect: a, nonce: o, ...s } = e, l = useSelectContentContext(VIEWPORT_NAME, a), u = useSelectViewportContext(VIEWPORT_NAME, a), d = useComposedRefs(i, l.onViewportChange), f = import_react.useRef(0);
  return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)("style", {
    dangerouslySetInnerHTML: { __html: "[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}" },
    nonce: o
  }), /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Collection.Slot, {
    scope: a,
    children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Primitive.div, {
      "data-radix-select-viewport": "",
      role: "presentation",
      ...s,
      ref: d,
      style: {
        position: "relative",
        flex: 1,
        overflow: "hidden auto",
        ...s.style
      },
      onScroll: composeEventHandlers(s.onScroll, (e2) => {
        let i2 = e2.currentTarget, { contentWrapper: a2, shouldExpandOnScrollRef: o2 } = u;
        if ((o2 == null ? void 0 : o2.current) && a2) {
          let e3 = Math.abs(f.current - i2.scrollTop);
          if (e3 > 0) {
            let o3 = window.innerHeight - CONTENT_MARGIN * 2, s2 = parseFloat(a2.style.minHeight), c = parseFloat(a2.style.height), l2 = Math.max(s2, c);
            if (l2 < o3) {
              let s3 = l2 + e3, c2 = Math.min(o3, s3), u2 = s3 - c2;
              a2.style.height = c2 + "px", a2.style.bottom === "0px" && (i2.scrollTop = u2 > 0 ? u2 : 0, a2.style.justifyContent = "flex-end");
            }
          }
        }
        f.current = i2.scrollTop;
      })
    })
  })] });
});
SelectViewport.displayName = VIEWPORT_NAME;
var GROUP_NAME = "SelectGroup", [SelectGroupContextProvider, useSelectGroupContext] = createSelectContext(GROUP_NAME), SelectGroup$1 = import_react.forwardRef((e, i) => {
  let { __scopeSelect: a, ...o } = e, s = useId();
  return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(SelectGroupContextProvider, {
    scope: a,
    id: s,
    children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Primitive.div, {
      role: "group",
      "aria-labelledby": s,
      ...o,
      ref: i
    })
  });
});
SelectGroup$1.displayName = GROUP_NAME;
var LABEL_NAME = "SelectLabel", SelectLabel$1 = import_react.forwardRef((e, i) => {
  let { __scopeSelect: a, ...o } = e, s = useSelectGroupContext(LABEL_NAME, a);
  return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Primitive.div, {
    id: s.id,
    ...o,
    ref: i
  });
});
SelectLabel$1.displayName = LABEL_NAME;
var ITEM_NAME = "SelectItem", [SelectItemContextProvider, useSelectItemContext] = createSelectContext(ITEM_NAME), SelectItem$1 = import_react.forwardRef((e, i) => {
  let { __scopeSelect: a, value: o, disabled: s = false, textValue: l, ...u } = e, d = useSelectContext(ITEM_NAME, a), f = useSelectContentContext(ITEM_NAME, a), p = d.value === o, [m, h] = import_react.useState(l ?? ""), [g, _] = import_react.useState(false), v = useComposedRefs(i, (e2) => {
    var _a;
    return (_a = f.itemRefCallback) == null ? void 0 : _a.call(f, e2, o, s);
  }), y = useId(), b = import_react.useRef("touch"), x = () => {
    s || (d.onValueChange(o), d.onOpenChange(false));
  };
  if (o === "") throw Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");
  return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(SelectItemContextProvider, {
    scope: a,
    value: o,
    disabled: s,
    textId: y,
    isSelected: p,
    onItemTextChange: import_react.useCallback((e2) => {
      h((i2) => i2 || ((e2 == null ? void 0 : e2.textContent) ?? "").trim());
    }, []),
    children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Collection.ItemSlot, {
      scope: a,
      value: o,
      disabled: s,
      textValue: m,
      children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Primitive.div, {
        role: "option",
        "aria-labelledby": y,
        "data-highlighted": g ? "" : void 0,
        "aria-selected": p && g,
        "data-state": p ? "checked" : "unchecked",
        "aria-disabled": s || void 0,
        "data-disabled": s ? "" : void 0,
        tabIndex: s ? void 0 : -1,
        ...u,
        ref: v,
        onFocus: composeEventHandlers(u.onFocus, () => _(true)),
        onBlur: composeEventHandlers(u.onBlur, () => _(false)),
        onClick: composeEventHandlers(u.onClick, () => {
          b.current !== "mouse" && x();
        }),
        onPointerUp: composeEventHandlers(u.onPointerUp, () => {
          b.current === "mouse" && x();
        }),
        onPointerDown: composeEventHandlers(u.onPointerDown, (e2) => {
          b.current = e2.pointerType;
        }),
        onPointerMove: composeEventHandlers(u.onPointerMove, (e2) => {
          var _a;
          b.current = e2.pointerType, s ? (_a = f.onItemLeave) == null ? void 0 : _a.call(f) : b.current === "mouse" && e2.currentTarget.focus({ preventScroll: true });
        }),
        onPointerLeave: composeEventHandlers(u.onPointerLeave, (e2) => {
          var _a;
          e2.currentTarget === document.activeElement && ((_a = f.onItemLeave) == null ? void 0 : _a.call(f));
        }),
        onKeyDown: composeEventHandlers(u.onKeyDown, (e2) => {
          var _a;
          ((_a = f.searchRef) == null ? void 0 : _a.current) !== "" && e2.key === " " || (SELECTION_KEYS.includes(e2.key) && x(), e2.key === " " && e2.preventDefault());
        })
      })
    })
  });
});
SelectItem$1.displayName = ITEM_NAME;
var ITEM_TEXT_NAME = "SelectItemText", SelectItemText = import_react.forwardRef((e, i) => {
  let { __scopeSelect: a, className: o, style: s, ...l } = e, u = useSelectContext(ITEM_TEXT_NAME, a), d = useSelectContentContext(ITEM_TEXT_NAME, a), f = useSelectItemContext(ITEM_TEXT_NAME, a), p = useSelectNativeOptionsContext(ITEM_TEXT_NAME, a), [m, h] = import_react.useState(null), g = useComposedRefs(i, (e2) => h(e2), f.onItemTextChange, (e2) => {
    var _a;
    return (_a = d.itemTextRefCallback) == null ? void 0 : _a.call(d, e2, f.value, f.disabled);
  }), _ = m == null ? void 0 : m.textContent, v = import_react.useMemo(() => /* @__PURE__ */ (0, import_jsx_runtime.jsx)("option", {
    value: f.value,
    disabled: f.disabled,
    children: _
  }, f.value), [
    f.disabled,
    f.value,
    _
  ]), { onNativeOptionAdd: y, onNativeOptionRemove: b } = p;
  return useLayoutEffect2(() => (y(v), () => b(v)), [
    y,
    b,
    v
  ]), /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)(Primitive.span, {
    id: f.textId,
    ...l,
    ref: g
  }), f.isSelected && u.valueNode && !u.valueNodeHasChildren ? import_react_dom.createPortal(l.children, u.valueNode) : null] });
});
SelectItemText.displayName = ITEM_TEXT_NAME;
var ITEM_INDICATOR_NAME = "SelectItemIndicator", SelectItemIndicator = import_react.forwardRef((e, i) => {
  let { __scopeSelect: a, ...o } = e;
  return useSelectItemContext(ITEM_INDICATOR_NAME, a).isSelected ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Primitive.span, {
    "aria-hidden": true,
    ...o,
    ref: i
  }) : null;
});
SelectItemIndicator.displayName = ITEM_INDICATOR_NAME;
var SCROLL_UP_BUTTON_NAME = "SelectScrollUpButton", SelectScrollUpButton = import_react.forwardRef((e, i) => {
  let a = useSelectContentContext(SCROLL_UP_BUTTON_NAME, e.__scopeSelect), o = useSelectViewportContext(SCROLL_UP_BUTTON_NAME, e.__scopeSelect), [s, l] = import_react.useState(false), u = useComposedRefs(i, o.onScrollButtonChange);
  return useLayoutEffect2(() => {
    if (a.viewport && a.isPositioned) {
      let e2 = function() {
        l(i2.scrollTop > 0);
      }, i2 = a.viewport;
      return e2(), i2.addEventListener("scroll", e2), () => i2.removeEventListener("scroll", e2);
    }
  }, [a.viewport, a.isPositioned]), s ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(SelectScrollButtonImpl, {
    ...e,
    ref: u,
    onAutoScroll: () => {
      let { viewport: e2, selectedItem: i2 } = a;
      e2 && i2 && (e2.scrollTop -= i2.offsetHeight);
    }
  }) : null;
});
SelectScrollUpButton.displayName = SCROLL_UP_BUTTON_NAME;
var SCROLL_DOWN_BUTTON_NAME = "SelectScrollDownButton", SelectScrollDownButton = import_react.forwardRef((e, i) => {
  let a = useSelectContentContext(SCROLL_DOWN_BUTTON_NAME, e.__scopeSelect), o = useSelectViewportContext(SCROLL_DOWN_BUTTON_NAME, e.__scopeSelect), [s, l] = import_react.useState(false), u = useComposedRefs(i, o.onScrollButtonChange);
  return useLayoutEffect2(() => {
    if (a.viewport && a.isPositioned) {
      let e2 = function() {
        let e3 = i2.scrollHeight - i2.clientHeight;
        l(Math.ceil(i2.scrollTop) < e3);
      }, i2 = a.viewport;
      return e2(), i2.addEventListener("scroll", e2), () => i2.removeEventListener("scroll", e2);
    }
  }, [a.viewport, a.isPositioned]), s ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(SelectScrollButtonImpl, {
    ...e,
    ref: u,
    onAutoScroll: () => {
      let { viewport: e2, selectedItem: i2 } = a;
      e2 && i2 && (e2.scrollTop += i2.offsetHeight);
    }
  }) : null;
});
SelectScrollDownButton.displayName = SCROLL_DOWN_BUTTON_NAME;
var SelectScrollButtonImpl = import_react.forwardRef((e, i) => {
  let { __scopeSelect: a, onAutoScroll: o, ...s } = e, c = useSelectContentContext("SelectScrollButton", a), l = import_react.useRef(null), u = useCollection(a), d = import_react.useCallback(() => {
    l.current !== null && (window.clearInterval(l.current), l.current = null);
  }, []);
  return import_react.useEffect(() => () => d(), [d]), useLayoutEffect2(() => {
    var _a, _b;
    (_b = (_a = u().find((e2) => e2.ref.current === document.activeElement)) == null ? void 0 : _a.ref.current) == null ? void 0 : _b.scrollIntoView({ block: "nearest" });
  }, [u]), /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Primitive.div, {
    "aria-hidden": true,
    ...s,
    ref: i,
    style: {
      flexShrink: 0,
      ...s.style
    },
    onPointerDown: composeEventHandlers(s.onPointerDown, () => {
      l.current === null && (l.current = window.setInterval(o, 50));
    }),
    onPointerMove: composeEventHandlers(s.onPointerMove, () => {
      var _a;
      (_a = c.onItemLeave) == null ? void 0 : _a.call(c), l.current === null && (l.current = window.setInterval(o, 50));
    }),
    onPointerLeave: composeEventHandlers(s.onPointerLeave, () => {
      d();
    })
  });
}), SEPARATOR_NAME = "SelectSeparator", SelectSeparator$1 = import_react.forwardRef((e, i) => {
  let { __scopeSelect: a, ...o } = e;
  return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Primitive.div, {
    "aria-hidden": true,
    ...o,
    ref: i
  });
});
SelectSeparator$1.displayName = SEPARATOR_NAME;
var ARROW_NAME = "SelectArrow", SelectArrow = import_react.forwardRef((e, i) => {
  let { __scopeSelect: a, ...o } = e, s = usePopperScope(a), c = useSelectContext(ARROW_NAME, a), l = useSelectContentContext(ARROW_NAME, a);
  return c.open && l.position === "popper" ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Arrow, {
    ...s,
    ...o,
    ref: i
  }) : null;
});
SelectArrow.displayName = ARROW_NAME;
var BUBBLE_INPUT_NAME = "SelectBubbleInput", SelectBubbleInput = import_react.forwardRef(({ __scopeSelect: e, value: i, ...a }, o) => {
  let s = import_react.useRef(null), l = useComposedRefs(o, s), u = usePrevious(i);
  return import_react.useEffect(() => {
    let e2 = s.current;
    if (!e2) return;
    let a2 = window.HTMLSelectElement.prototype, o2 = Object.getOwnPropertyDescriptor(a2, "value").set;
    if (u !== i && o2) {
      let a3 = new Event("change", { bubbles: true });
      o2.call(e2, i), e2.dispatchEvent(a3);
    }
  }, [u, i]), /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Primitive.select, {
    ...a,
    style: {
      ...VISUALLY_HIDDEN_STYLES,
      ...a.style
    },
    ref: l,
    defaultValue: i
  });
});
SelectBubbleInput.displayName = BUBBLE_INPUT_NAME;
function shouldShowPlaceholder(e) {
  return e === "" || e === void 0;
}
function useTypeaheadSearch(e) {
  let i = useCallbackRef(e), a = import_react.useRef(""), o = import_react.useRef(0), s = import_react.useCallback((e2) => {
    let s2 = a.current + e2;
    i(s2), (function e3(i2) {
      a.current = i2, window.clearTimeout(o.current), i2 !== "" && (o.current = window.setTimeout(() => e3(""), 1e3));
    })(s2);
  }, [i]), c = import_react.useCallback(() => {
    a.current = "", window.clearTimeout(o.current);
  }, []);
  return import_react.useEffect(() => () => window.clearTimeout(o.current), []), [
    a,
    s,
    c
  ];
}
function findNextItem(e, i, a) {
  let o = i.length > 1 && Array.from(i).every((e2) => e2 === i[0]) ? i[0] : i, s = a ? e.indexOf(a) : -1, c = wrapArray(e, Math.max(s, 0));
  o.length === 1 && (c = c.filter((e2) => e2 !== a));
  let l = c.find((e2) => e2.textValue.toLowerCase().startsWith(o.toLowerCase()));
  return l === a ? void 0 : l;
}
function wrapArray(e, i) {
  return e.map((a, o) => e[(i + o) % e.length]);
}
var Root2 = Select$1, Trigger = SelectTrigger$1, Value = SelectValue$1, Icon = SelectIcon, Portal$1 = SelectPortal$1, Content2 = SelectContent$1, Viewport = SelectViewport, Group = SelectGroup$1, Label = SelectLabel$1, Item = SelectItem$1, ItemText = SelectItemText, ItemIndicator = SelectItemIndicator, ScrollUpButton = SelectScrollUpButton, ScrollDownButton = SelectScrollDownButton, Separator = SelectSeparator$1, $b5e257d569688ac6$var$defaultContext = {
  prefix: String(Math.round(Math.random() * 1e10)),
  current: 0
}, $b5e257d569688ac6$var$SSRContext = /* @__PURE__ */ import_react.createContext($b5e257d569688ac6$var$defaultContext), $b5e257d569688ac6$var$IsSSRContext = /* @__PURE__ */ import_react.createContext(false);
typeof window < "u" && window.document && window.document.createElement;
var $b5e257d569688ac6$var$componentIds = /* @__PURE__ */ new WeakMap();
function $b5e257d569688ac6$var$useCounter(e = false) {
  var _a, _b;
  let i = (0, import_react.useContext)($b5e257d569688ac6$var$SSRContext), a = (0, import_react.useRef)(null);
  if (a.current === null && !e) {
    let e2 = (_b = (_a = import_react.default.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED) == null ? void 0 : _a.ReactCurrentOwner) == null ? void 0 : _b.current;
    if (e2) {
      let a2 = $b5e257d569688ac6$var$componentIds.get(e2);
      a2 == null ? $b5e257d569688ac6$var$componentIds.set(e2, {
        id: i.current,
        state: e2.memoizedState
      }) : e2.memoizedState !== a2.state && (i.current = a2.id, $b5e257d569688ac6$var$componentIds.delete(e2));
    }
    a.current = ++i.current;
  }
  return a.current;
}
function $b5e257d569688ac6$var$useLegacySSRSafeId(e) {
  let i = (0, import_react.useContext)($b5e257d569688ac6$var$SSRContext), a = $b5e257d569688ac6$var$useCounter(!!e), o = `react-aria${i.prefix}`;
  return e || `${o}-${a}`;
}
function $b5e257d569688ac6$var$useModernSSRSafeId(e) {
  let i = import_react.useId(), [a] = (0, import_react.useState)($b5e257d569688ac6$export$535bd6ca7f90a273()), o = a ? "react-aria" : `react-aria${$b5e257d569688ac6$var$defaultContext.prefix}`;
  return e || `${o}-${i}`;
}
var $b5e257d569688ac6$export$619500959fc48b26 = typeof import_react.useId == "function" ? $b5e257d569688ac6$var$useModernSSRSafeId : $b5e257d569688ac6$var$useLegacySSRSafeId;
function $b5e257d569688ac6$var$getSnapshot() {
  return false;
}
function $b5e257d569688ac6$var$getServerSnapshot() {
  return true;
}
function $b5e257d569688ac6$var$subscribe(e) {
  return () => {
  };
}
function $b5e257d569688ac6$export$535bd6ca7f90a273() {
  return typeof import_react.useSyncExternalStore == "function" ? import_react.useSyncExternalStore($b5e257d569688ac6$var$subscribe, $b5e257d569688ac6$var$getSnapshot, $b5e257d569688ac6$var$getServerSnapshot) : (0, import_react.useContext)($b5e257d569688ac6$var$IsSSRContext);
}
var $148a7a147e38ea7f$var$RTL_SCRIPTS = /* @__PURE__ */ new Set([
  "Arab",
  "Syrc",
  "Samr",
  "Mand",
  "Thaa",
  "Mend",
  "Nkoo",
  "Adlm",
  "Rohg",
  "Hebr"
]), $148a7a147e38ea7f$var$RTL_LANGS = /* @__PURE__ */ new Set([
  "ae",
  "ar",
  "arc",
  "bcc",
  "bqi",
  "ckb",
  "dv",
  "fa",
  "glk",
  "he",
  "ku",
  "mzn",
  "nqo",
  "pnb",
  "ps",
  "sd",
  "ug",
  "ur",
  "yi"
]);
function $148a7a147e38ea7f$export$702d680b21cbd764(e) {
  if (Intl.Locale) {
    let i2 = new Intl.Locale(e).maximize(), a = typeof i2.getTextInfo == "function" ? i2.getTextInfo() : i2.textInfo;
    if (a) return a.direction === "rtl";
    if (i2.script) return $148a7a147e38ea7f$var$RTL_SCRIPTS.has(i2.script);
  }
  let i = e.split("-")[0];
  return $148a7a147e38ea7f$var$RTL_LANGS.has(i);
}
var $1e5a04cdaf7d1af8$var$localeSymbol = /* @__PURE__ */ Symbol.for("react-aria.i18n.locale");
function $1e5a04cdaf7d1af8$export$f09106e7c6677ec5() {
  let e = typeof window < "u" && window[$1e5a04cdaf7d1af8$var$localeSymbol] || typeof navigator < "u" && (navigator.language || navigator.userLanguage) || "en-US";
  try {
    Intl.DateTimeFormat.supportedLocalesOf([e]);
  } catch {
    e = "en-US";
  }
  return {
    locale: e,
    direction: $148a7a147e38ea7f$export$702d680b21cbd764(e) ? "rtl" : "ltr"
  };
}
var $1e5a04cdaf7d1af8$var$currentLocale = $1e5a04cdaf7d1af8$export$f09106e7c6677ec5(), $1e5a04cdaf7d1af8$var$listeners = /* @__PURE__ */ new Set();
function $1e5a04cdaf7d1af8$var$updateLocale() {
  $1e5a04cdaf7d1af8$var$currentLocale = $1e5a04cdaf7d1af8$export$f09106e7c6677ec5();
  for (let e of $1e5a04cdaf7d1af8$var$listeners) e($1e5a04cdaf7d1af8$var$currentLocale);
}
function $1e5a04cdaf7d1af8$export$188ec29ebc2bdc3a() {
  let e = $b5e257d569688ac6$export$535bd6ca7f90a273(), [i, a] = (0, import_react.useState)($1e5a04cdaf7d1af8$var$currentLocale);
  return (0, import_react.useEffect)(() => ($1e5a04cdaf7d1af8$var$listeners.size === 0 && window.addEventListener("languagechange", $1e5a04cdaf7d1af8$var$updateLocale), $1e5a04cdaf7d1af8$var$listeners.add(a), () => {
    $1e5a04cdaf7d1af8$var$listeners.delete(a), $1e5a04cdaf7d1af8$var$listeners.size === 0 && window.removeEventListener("languagechange", $1e5a04cdaf7d1af8$var$updateLocale);
  }), []), e ? {
    locale: typeof window < "u" && window[$1e5a04cdaf7d1af8$var$localeSymbol] || "en-US",
    direction: "ltr"
  } : i;
}
var $18f2051aff69b9bf$var$I18nContext = /* @__PURE__ */ import_react.createContext(null);
function $18f2051aff69b9bf$var$I18nProviderWithLocale(e) {
  let { locale: i, children: a } = e, o = import_react.useMemo(() => ({
    locale: i,
    direction: $148a7a147e38ea7f$export$702d680b21cbd764(i) ? "rtl" : "ltr"
  }), [i]);
  return /* @__PURE__ */ import_react.createElement($18f2051aff69b9bf$var$I18nContext.Provider, { value: o }, a);
}
function $18f2051aff69b9bf$var$I18nProviderWithDefaultLocale(e) {
  let { children: i } = e, a = $1e5a04cdaf7d1af8$export$188ec29ebc2bdc3a();
  return /* @__PURE__ */ import_react.createElement($18f2051aff69b9bf$var$I18nContext.Provider, { value: a }, i);
}
function $18f2051aff69b9bf$export$a54013f0d02a8f82(e) {
  let { locale: i, children: a } = e;
  return i ? /* @__PURE__ */ import_react.createElement($18f2051aff69b9bf$var$I18nProviderWithLocale, {
    locale: i,
    children: a
  }) : /* @__PURE__ */ import_react.createElement($18f2051aff69b9bf$var$I18nProviderWithDefaultLocale, { children: a });
}
function $18f2051aff69b9bf$export$43bb16f9c6d9e3f7() {
  let e = $1e5a04cdaf7d1af8$export$188ec29ebc2bdc3a();
  return (0, import_react.useContext)($18f2051aff69b9bf$var$I18nContext) || e;
}
var $488c6ddbf4ef74c2$var$formatterCache = /* @__PURE__ */ new Map(), $488c6ddbf4ef74c2$var$supportsSignDisplay = false;
try {
  $488c6ddbf4ef74c2$var$supportsSignDisplay = new Intl.NumberFormat("de-DE", { signDisplay: "exceptZero" }).resolvedOptions().signDisplay === "exceptZero";
} catch {
}
var $488c6ddbf4ef74c2$var$supportsUnit = false;
try {
  $488c6ddbf4ef74c2$var$supportsUnit = new Intl.NumberFormat("de-DE", {
    style: "unit",
    unit: "degree"
  }).resolvedOptions().style === "unit";
} catch {
}
var $488c6ddbf4ef74c2$var$UNITS = { degree: { narrow: {
  default: "\xB0",
  "ja-JP": " \u5EA6",
  "zh-TW": "\u5EA6",
  "sl-SI": " \xB0"
} } }, $488c6ddbf4ef74c2$export$cc77c4ff7e8673c5 = class {
  format(e) {
    var _a;
    let i = "";
    if (i = !$488c6ddbf4ef74c2$var$supportsSignDisplay && this.options.signDisplay != null ? $488c6ddbf4ef74c2$export$711b50b3c525e0f2(this.numberFormatter, this.options.signDisplay, e) : this.numberFormatter.format(e), this.options.style === "unit" && !$488c6ddbf4ef74c2$var$supportsUnit) {
      let { unit: e2, unitDisplay: a = "short", locale: o } = this.resolvedOptions();
      if (!e2) return i;
      let s = (_a = $488c6ddbf4ef74c2$var$UNITS[e2]) == null ? void 0 : _a[a];
      i += s[o] || s.default;
    }
    return i;
  }
  formatToParts(e) {
    return this.numberFormatter.formatToParts(e);
  }
  formatRange(e, i) {
    if (typeof this.numberFormatter.formatRange == "function") return this.numberFormatter.formatRange(e, i);
    if (i < e) throw RangeError("End date must be >= start date");
    return `${this.format(e)} \u2013 ${this.format(i)}`;
  }
  formatRangeToParts(e, i) {
    if (typeof this.numberFormatter.formatRangeToParts == "function") return this.numberFormatter.formatRangeToParts(e, i);
    if (i < e) throw RangeError("End date must be >= start date");
    let a = this.numberFormatter.formatToParts(e), o = this.numberFormatter.formatToParts(i);
    return [
      ...a.map((e2) => ({
        ...e2,
        source: "startRange"
      })),
      {
        type: "literal",
        value: " \u2013 ",
        source: "shared"
      },
      ...o.map((e2) => ({
        ...e2,
        source: "endRange"
      }))
    ];
  }
  resolvedOptions() {
    let e = this.numberFormatter.resolvedOptions();
    return !$488c6ddbf4ef74c2$var$supportsSignDisplay && this.options.signDisplay != null && (e = {
      ...e,
      signDisplay: this.options.signDisplay
    }), !$488c6ddbf4ef74c2$var$supportsUnit && this.options.style === "unit" && (e = {
      ...e,
      style: "unit",
      unit: this.options.unit,
      unitDisplay: this.options.unitDisplay
    }), e;
  }
  constructor(e, i = {}) {
    this.numberFormatter = $488c6ddbf4ef74c2$var$getCachedNumberFormatter(e, i), this.options = i;
  }
};
function $488c6ddbf4ef74c2$var$getCachedNumberFormatter(e, i = {}) {
  var _a;
  let { numberingSystem: a } = i;
  if (a && e.includes("-nu-") && (e.includes("-u-") || (e += "-u-"), e += `-nu-${a}`), i.style === "unit" && !$488c6ddbf4ef74c2$var$supportsUnit) {
    let { unit: e2, unitDisplay: a2 = "short" } = i;
    if (!e2) throw Error('unit option must be provided with style: "unit"');
    if (!((_a = $488c6ddbf4ef74c2$var$UNITS[e2]) == null ? void 0 : _a[a2])) throw Error(`Unsupported unit ${e2} with unitDisplay = ${a2}`);
    i = {
      ...i,
      style: "decimal"
    };
  }
  let o = e + (i ? Object.entries(i).sort((e2, i2) => e2[0] < i2[0] ? -1 : 1).join() : "");
  if ($488c6ddbf4ef74c2$var$formatterCache.has(o)) return $488c6ddbf4ef74c2$var$formatterCache.get(o);
  let s = new Intl.NumberFormat(e, i);
  return $488c6ddbf4ef74c2$var$formatterCache.set(o, s), s;
}
function $488c6ddbf4ef74c2$export$711b50b3c525e0f2(e, i, a) {
  if (i === "auto") return e.format(a);
  if (i === "never") return e.format(Math.abs(a));
  {
    let o = false;
    if (i === "always" ? o = a > 0 || Object.is(a, 0) : i === "exceptZero" && (Object.is(a, -0) || Object.is(a, 0) ? a = Math.abs(a) : o = a > 0), o) {
      let i2 = e.format(-a), o2 = e.format(a), s = i2.replace(o2, "").replace(/\u200e|\u061C/, "");
      return [...s].length !== 1 && console.warn("@react-aria/i18n polyfill for NumberFormat signDisplay: Unsupported case"), i2.replace(o2, "!!!").replace(s, "+").replace("!!!", o2);
    } else return e.format(a);
  }
}
function $a916eb452884faea$export$b7a616150fdb9f44(e = {}) {
  let { locale: i } = $18f2051aff69b9bf$export$43bb16f9c6d9e3f7();
  return (0, import_react.useMemo)(() => new $488c6ddbf4ef74c2$export$cc77c4ff7e8673c5(i, e), [i, e]);
}
function assertNever(e) {
  invariant(false, `Unexpected object: ${e}`);
}
function logNever(e) {
  return Logger.warn(`Unexpected object: ${JSON.stringify(e)}`), e;
}
var import_compiler_runtime$2 = require_compiler_runtime();
const menuContentCommon = cva("z-50 min-w-32 overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md", { variants: { subcontent: { true: "shadow-lg" } } }), menuSubTriggerVariants = cva("flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-hidden focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground", { variants: { inset: { true: "pl-8" } } }), MENU_ITEM_DISABLED = "data-disabled:pointer-events-none data-disabled:opacity-50", menuControlVariants = cva(cn("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-hidden transition-colors focus:bg-accent focus:text-accent-foreground", MENU_ITEM_DISABLED), { variants: {} }), menuControlCheckVariants = cva("absolute left-2 flex h-3.5 w-3.5 items-center justify-center", { variants: {} }), menuLabelVariants = cva("px-2 py-1.5 text-sm font-semibold", { variants: { inset: { true: "pl-8" } } }), menuItemVariants = cva(cn("menu-item relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-hidden", MENU_ITEM_DISABLED), {
  variants: {
    inset: { true: "pl-8" },
    variant: {
      default: "focus:bg-accent focus:text-accent-foreground aria-selected:bg-accent aria-selected:text-accent-foreground",
      danger: "focus:bg-(--red-5) focus:text-(--red-12) aria-selected:bg-(--red-5) aria-selected:text-(--red-12)",
      muted: "focus:bg-muted/70 focus:text-muted-foreground aria-selected:bg-muted/70 aria-selected:text-muted-foreground",
      success: "focus:bg-(--grass-3) focus:text-(--grass-11) aria-selected:bg-(--grass-3) aria-selected:text-(--grass-11)",
      disabled: "text-muted-foreground"
    }
  },
  defaultVariants: { variant: "default" }
}), menuSeparatorVariants = cva("-mx-1 my-1 h-px bg-border last:hidden", { variants: {} }), MenuShortcut = (e) => {
  let i = (0, import_compiler_runtime$2.c)(8), a, s;
  i[0] === e ? (a = i[1], s = i[2]) : ({ className: a, ...s } = e, i[0] = e, i[1] = a, i[2] = s);
  let c;
  i[3] === a ? c = i[4] : (c = cn("ml-auto text-xs tracking-widest opacity-60", a), i[3] = a, i[4] = c);
  let l;
  return i[5] !== s || i[6] !== c ? (l = /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {
    className: c,
    ...s
  }), i[5] = s, i[6] = c, i[7] = l) : l = i[7], l;
};
MenuShortcut.displayName = "MenuShortcut";
var import_compiler_runtime$1 = require_compiler_runtime();
const selectStyles = cva("flex h-6 w-fit mb-1 items-center justify-between rounded-sm bg-background px-2 text-sm font-prose ring-offset-background placeholder:text-muted-foreground focus:outline-hidden focus:ring-1 focus:ring-ring disabled:cursor-not-allowed disabled:opacity-50 cursor-pointer", {
  variants: { variant: {
    default: "shadow-xs-solid border border-input hover:shadow-sm-solid focus:border-primary focus:shadow-md-solid disabled:hover:shadow-xs-solid",
    ghost: "opacity-70 hover:opacity-100 focus:opacity-100"
  } },
  defaultVariants: { variant: "default" }
});
var NativeSelect = import_react.forwardRef((e, i) => {
  let a = (0, import_compiler_runtime$1.c)(12), c, l, u;
  a[0] === e ? (c = a[1], l = a[2], u = a[3]) : ({ className: l, children: c, ...u } = e, a[0] = e, a[1] = c, a[2] = l, a[3] = u);
  let d;
  a[4] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (d = Events.stopPropagation(), a[4] = d) : d = a[4];
  let f;
  a[5] === l ? f = a[6] : (f = cn(selectStyles({}), l), a[5] = l, a[6] = f);
  let p;
  return a[7] !== c || a[8] !== u || a[9] !== i || a[10] !== f ? (p = /* @__PURE__ */ (0, import_jsx_runtime.jsx)("select", {
    ref: i,
    onClick: d,
    className: f,
    ...u,
    children: c
  }), a[7] = c, a[8] = u, a[9] = i, a[10] = f, a[11] = p) : p = a[11], p;
});
NativeSelect.displayName = "NativeSelect";
var import_compiler_runtime = require_compiler_runtime(), Select = Root2, SelectGroup = Group, SelectPortal = withFullScreenAsRoot(Portal$1), SelectValue = Value, SelectTrigger = import_react.forwardRef((e, i) => {
  let a = (0, import_compiler_runtime.c)(21), s, c, l, u, d, f;
  a[0] === e ? (s = a[1], c = a[2], l = a[3], u = a[4], d = a[5], f = a[6]) : ({ className: c, children: s, onClear: l, variant: f, hideChevron: d, ...u } = e, a[0] = e, a[1] = s, a[2] = c, a[3] = l, a[4] = u, a[5] = d, a[6] = f);
  let p = d === void 0 ? false : d, m;
  a[7] !== c || a[8] !== f ? (m = cn(selectStyles({ variant: f }), "mb-0", c), a[7] = c, a[8] = f, a[9] = m) : m = a[9];
  let h;
  a[10] !== p || a[11] !== l ? (h = l ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {
    onPointerDown: (e2) => {
      e2.preventDefault(), e2.stopPropagation(), l();
    },
    children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(X, { className: "h-4 w-4 opacity-50 hover:opacity-90" })
  }) : !p && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ChevronDown, { className: "h-4 w-4 opacity-50" }), a[10] = p, a[11] = l, a[12] = h) : h = a[12];
  let g;
  a[13] === h ? g = a[14] : (g = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Icon, {
    asChild: true,
    children: h
  }), a[13] = h, a[14] = g);
  let _;
  return a[15] !== s || a[16] !== u || a[17] !== i || a[18] !== m || a[19] !== g ? (_ = /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(Trigger, {
    ref: i,
    className: m,
    ...u,
    children: [s, g]
  }), a[15] = s, a[16] = u, a[17] = i, a[18] = m, a[19] = g, a[20] = _) : _ = a[20], _;
});
SelectTrigger.displayName = Trigger.displayName;
var InternalSelectContent = withSmartCollisionBoundary(Content2), SelectContent = import_react.forwardRef((e, i) => {
  let a = (0, import_compiler_runtime.c)(21), s, c, l, u;
  a[0] === e ? (s = a[1], c = a[2], l = a[3], u = a[4]) : ({ className: c, children: s, position: u, ...l } = e, a[0] = e, a[1] = s, a[2] = c, a[3] = l, a[4] = u);
  let d = u === void 0 ? "popper" : u, f = d === "popper" && "data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1", p;
  a[5] !== c || a[6] !== f ? (p = cn("max-h-[300px] relative z-50 min-w-32 overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2", f, c), a[5] = c, a[6] = f, a[7] = p) : p = a[7];
  let m;
  a[8] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (m = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ScrollUpButton, {
    className: "flex items-center justify-center h-[20px] bg-background text-muted-foreground cursor-default",
    children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ChevronUp, { className: "h-4 w-4" })
  }), a[8] = m) : m = a[8];
  let h = d === "popper" && "h-(--radix-select-trigger-height) w-full min-w-(--radix-select-trigger-width)", g;
  a[9] === h ? g = a[10] : (g = cn("p-1", h), a[9] = h, a[10] = g);
  let _;
  a[11] !== s || a[12] !== g ? (_ = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Viewport, {
    className: g,
    children: s
  }), a[11] = s, a[12] = g, a[13] = _) : _ = a[13];
  let v;
  a[14] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (v = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ScrollDownButton, {
    className: "flex items-center justify-center h-[20px] bg-background text-muted-foreground cursor-default",
    children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ChevronDown, { className: "h-4 w-4 opacity-50" })
  }), a[14] = v) : v = a[14];
  let y;
  return a[15] !== d || a[16] !== l || a[17] !== i || a[18] !== p || a[19] !== _ ? (y = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(SelectPortal, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(StyleNamespace, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(InternalSelectContent, {
    ref: i,
    className: p,
    position: d,
    ...l,
    children: [
      m,
      _,
      v
    ]
  }) }) }), a[15] = d, a[16] = l, a[17] = i, a[18] = p, a[19] = _, a[20] = y) : y = a[20], y;
});
SelectContent.displayName = Content2.displayName;
var SelectLabel = import_react.forwardRef((e, i) => {
  let a = (0, import_compiler_runtime.c)(9), s, c;
  a[0] === e ? (s = a[1], c = a[2]) : ({ className: s, ...c } = e, a[0] = e, a[1] = s, a[2] = c);
  let l;
  a[3] === s ? l = a[4] : (l = cn("px-2 py-1.5 text-sm font-semibold", s), a[3] = s, a[4] = l);
  let u;
  return a[5] !== c || a[6] !== i || a[7] !== l ? (u = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Label, {
    ref: i,
    className: l,
    ...c
  }), a[5] = c, a[6] = i, a[7] = l, a[8] = u) : u = a[8], u;
});
SelectLabel.displayName = Label.displayName;
var SelectItem = import_react.forwardRef((e, i) => {
  let a = (0, import_compiler_runtime.c)(17), s, c, l, u;
  a[0] === e ? (s = a[1], c = a[2], l = a[3], u = a[4]) : ({ className: c, children: s, subtitle: u, ...l } = e, a[0] = e, a[1] = s, a[2] = c, a[3] = l, a[4] = u);
  let d;
  a[5] === c ? d = a[6] : (d = cn("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-2 pr-8 text-sm outline-hidden focus:bg-accent focus:text-accent-foreground", MENU_ITEM_DISABLED, c), a[5] = c, a[6] = d);
  let f;
  a[7] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (f = /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {
    className: "absolute right-2 flex h-3.5 w-3.5 items-center justify-center",
    children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ItemIndicator, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Check, { className: "h-3 w-3" }) })
  }), a[7] = f) : f = a[7];
  let p = typeof s == "string" ? void 0 : true, m;
  a[8] !== s || a[9] !== p ? (m = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ItemText, {
    asChild: p,
    className: "flex w-full flex-1",
    children: s
  }), a[8] = s, a[9] = p, a[10] = m) : m = a[10];
  let h;
  return a[11] !== l || a[12] !== i || a[13] !== u || a[14] !== d || a[15] !== m ? (h = /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(Item, {
    ref: i,
    className: d,
    ...l,
    children: [
      f,
      m,
      u
    ]
  }), a[11] = l, a[12] = i, a[13] = u, a[14] = d, a[15] = m, a[16] = h) : h = a[16], h;
});
SelectItem.displayName = Item.displayName;
var SelectSeparator = import_react.forwardRef((e, i) => {
  let a = (0, import_compiler_runtime.c)(9), s, c;
  a[0] === e ? (s = a[1], c = a[2]) : ({ className: s, ...c } = e, a[0] = e, a[1] = s, a[2] = c);
  let l;
  a[3] === s ? l = a[4] : (l = cn("-mx-1 my-1 h-px bg-muted", s), a[3] = s, a[4] = l);
  let u;
  return a[5] !== c || a[6] !== i || a[7] !== l ? (u = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Separator, {
    ref: i,
    className: l,
    ...c
  }), a[5] = c, a[6] = i, a[7] = l, a[8] = u) : u = a[8], u;
});
SelectSeparator.displayName = Separator.displayName;
function capitalize(e) {
  return e ? e.charAt(0).toUpperCase() + e.slice(1) : "";
}
function startCase(e) {
  if (!e) return "";
  if (typeof e != "string") throw Logger.error(e), TypeError(`Expected string, got ${typeof e}`);
  return /[A-Za-z]/.test(e) ? e.replaceAll(/([\da-z])([A-Z])/g, "$1 $2").replaceAll(/([A-Z]+)([A-Z][a-z])/g, "$1 $2").replaceAll(/[\s_-]+/g, " ").trim().split(" ").map(capitalize).join(" ") : e;
}
const Strings = {
  startCase,
  htmlEscape: (e) => e && e.replaceAll("&", "&amp;").replaceAll("<", "&lt;").replaceAll(">", "&gt;").replaceAll('"', "&quot;").replaceAll("'", "&#039;").replaceAll("\n", " "),
  withTrailingSlash(e) {
    return e.endsWith("/") ? e : `${e}/`;
  },
  withoutTrailingSlash(e) {
    return e.endsWith("/") ? e.slice(0, -1) : e;
  },
  withoutLeadingSlash(e) {
    return e.startsWith("/") ? e.slice(1) : e;
  },
  asString: (e) => {
    if (typeof e == "string") return e;
    try {
      return JSON.stringify(e);
    } catch {
      return String(e);
    }
  }
};
export {
  Trigger as A,
  $a916eb452884faea$export$b7a616150fdb9f44 as C,
  $b5e257d569688ac6$export$535bd6ca7f90a273 as D,
  $18f2051aff69b9bf$export$a54013f0d02a8f82 as E,
  X as F,
  ChevronUp as I,
  ChevronDown as L,
  usePrevious as M,
  useDirection as N,
  $b5e257d569688ac6$export$619500959fc48b26 as O,
  createCollection as P,
  logNever as S,
  $18f2051aff69b9bf$export$43bb16f9c6d9e3f7 as T,
  menuItemVariants as _,
  SelectGroup as a,
  menuSubTriggerVariants as b,
  SelectSeparator as c,
  NativeSelect as d,
  selectStyles as f,
  menuControlVariants as g,
  menuControlCheckVariants as h,
  SelectContent as i,
  clamp as j,
  Icon as k,
  SelectTrigger as l,
  menuContentCommon as m,
  capitalize as n,
  SelectItem as o,
  MENU_ITEM_DISABLED as p,
  Select as r,
  SelectLabel as s,
  Strings as t,
  SelectValue as u,
  menuLabelVariants as v,
  $488c6ddbf4ef74c2$export$cc77c4ff7e8673c5 as w,
  assertNever as x,
  menuSeparatorVariants as y
};
