import { u as E, a as p, b as x } from "./hooks-15yB7IKE.js";
import { u as d, A as S, b as _, K as b, M as R, c as T, e as y, g as K, P as j, T as U, h as C, i as L, d as O, j as h, f as v, k, l as A, m as w, n as H, o as N, q as P, r as Z, s as I, p as Y, t as B, v as F, w as q, x as z } from "./Text-BzTkWLeU.js";
import { j as G } from "./jsx-runtime-OVHDjVDe.js";
import { useState as Q, useEffect as $, useRef as f, useCallback as g } from "react";
import { T as J } from "./Editable-CxgdRDPb.js";
import { Q as i, j as l } from "./css-D6ZBcSwh.js";
import "./types-BNX_Jj6k.js";
const V = (e) => {
  const { listen: a } = d(), [c, n] = Q([]);
  return $(
    () => a(({ next: [s] }) => n(s ?? [])),
    [a, n]
  ), /* @__PURE__ */ G.jsx(J, { ...e, children: c.join(" ") });
}, W = ({
  onDrag: e,
  triggers: a = [["MouseLeft"], ["MouseRight"]],
  bound: c,
  loose: n = !1
}) => {
  const s = f(null), u = f(i.ZERO), m = g(
    (t) => {
      const r = i.construct(t);
      if (s.current === null) return;
      const { triggers: o } = s.current;
      e({
        box: l.construct(u.current, r),
        cursor: r,
        triggers: o,
        stage: "during"
      });
    },
    [e]
  ), M = g(
    (t) => {
      const { stage: r, cursor: o } = t;
      r === "start" ? (e({ box: l.construct(o), ...t }), window.addEventListener("mousemove", m), s.current = t, u.current = o) : r === "end" && s.current != null && (e({ box: l.construct(u.current, o), ...t }), window.removeEventListener("mousemove", m), s.current = null, u.current = i.ZERO);
    },
    [e]
  );
  E({ triggers: a, callback: M, region: c, loose: n });
}, ae = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
  __proto__: null,
  ALPHANUMERIC_KEYS: S,
  ALPHANUMERIC_KEYS_SET: _,
  KEYS: b,
  MOUSE_KEYS: R,
  MOUSE_LEFT_NUMBER: T,
  MOUSE_MIDDLE_NUMBER: y,
  MOUSE_RIGHT_NUMBER: K,
  Provider: j,
  Status: V,
  Text: U,
  compareModeConfigs: C,
  determineMode: L,
  diff: O,
  eventKey: h,
  filter: v,
  flattenConfig: k,
  isAlphanumericKey: A,
  keyZ: w,
  keyboardKey: H,
  match: N,
  matchCallback: P,
  mouseKey: Z,
  mouseKeyZ: I,
  purge: Y,
  purgeMouse: B,
  toSymbols: F,
  triggerZ: q,
  use: E,
  useContext: d,
  useDrag: W,
  useFlattenedMemoConfig: z,
  useHeld: p,
  useHeldRef: x
}, Symbol.toStringTag, { value: "Module" }));
export {
  ae as e,
  W as u
};
