import {
  Cu,
  Gi,
  Hl,
  Q,
  bu,
  gu,
  hu,
  qi,
  wv,
  xe
} from "./chunk-6GI6FDKX.js";
import {
  computed,
  createBlock,
  defineComponent,
  getCurrentInstance,
  mergeProps,
  nextTick,
  normalizeStyle,
  onMounted,
  onUnmounted,
  openBlock,
  ref,
  renderSlot,
  toRefs,
  unref,
  useSlots,
  watch,
  watchEffect,
  withCtx
} from "./chunk-DB4KVPJ4.js";
import "./chunk-PZ5AY32C.js";

// node_modules/vaul-vue/dist/index.js
(function() {
  "use strict";
  try {
    if (typeof document < "u") {
      var r = document.createElement("style");
      r.appendChild(document.createTextNode('[vaul-drawer]{touch-action:none;will-change:transform;transition:transform .5s cubic-bezier(.32,.72,0,1)}[vaul-drawer][vaul-drawer-direction=bottom]{transform:translate3d(0,100%,0)}[vaul-drawer][vaul-drawer-direction=top]{transform:translate3d(0,-100%,0)}[vaul-drawer][vaul-drawer-direction=left]{transform:translate3d(-100%,0,0)}[vaul-drawer][vaul-drawer-direction=right]{transform:translate3d(100%,0,0)}.vaul-dragging .vaul-scrollable [vault-drawer-direction=top],.vaul-dragging .vaul-scrollable [vault-drawer-direction=bottom]{overflow-y:hidden!important}.vaul-dragging .vaul-scrollable [vault-drawer-direction=left],.vaul-dragging .vaul-scrollable [vault-drawer-direction=right]{overflow-x:hidden!important}[vaul-drawer][vaul-drawer-visible=true][vaul-drawer-direction=top],[vaul-drawer][vaul-drawer-visible=true][vaul-drawer-direction=bottom]{transform:translate3d(0,var(--snap-point-height, 0),0)}[vaul-drawer][vaul-drawer-visible=true][vaul-drawer-direction=left],[vaul-drawer][vaul-drawer-visible=true][vaul-drawer-direction=right]{transform:translate3d(var(--snap-point-height, 0),0,0)}[vaul-overlay]{opacity:0;transition:opacity .5s cubic-bezier(.32,.72,0,1)}[vaul-overlay][vaul-drawer-visible=true]{opacity:1}[vaul-drawer]:after{content:"";position:absolute;background:inherit;background-color:inherit}[vaul-drawer][vaul-drawer-direction=top]:after{top:initial;bottom:100%;left:0;right:0;height:200%}[vaul-drawer][vaul-drawer-direction=bottom]:after{top:100%;bottom:initial;left:0;right:0;height:200%}[vaul-drawer][vaul-drawer-direction=left]:after{left:initial;right:100%;top:0;bottom:0;width:200%}[vaul-drawer][vaul-drawer-direction=right]:after{left:100%;right:initial;top:0;bottom:0;width:200%}[vaul-overlay][vaul-snap-points=true]:not([vaul-snap-points-overlay=true]):not([data-state=closed]){opacity:0}[vaul-overlay][vaul-snap-points-overlay=true]:not([vaul-drawer-visible=false]){opacity:1}@keyframes fake-animation{}@media (hover: hover) and (pointer: fine){[vaul-drawer]{-webkit-user-select:none;user-select:none}}')), document.head.appendChild(r);
    }
  } catch (a) {
    console.error("vite-plugin-css-injected-by-js", a);
  }
})();
var Fe = typeof window < "u" && typeof document < "u";
typeof WorkerGlobalScope < "u" && globalThis instanceof WorkerGlobalScope;
var et = (t) => typeof t < "u";
function tt(t) {
  return JSON.parse(JSON.stringify(t));
}
function ye(t, n, v, s = {}) {
  var e, b, u;
  const {
    clone: O = false,
    passive: x = false,
    eventName: d,
    deep: l = false,
    defaultValue: w,
    shouldEmit: R
  } = s, A = getCurrentInstance(), y = v || (A == null ? void 0 : A.emit) || ((e = A == null ? void 0 : A.$emit) == null ? void 0 : e.bind(A)) || ((u = (b = A == null ? void 0 : A.proxy) == null ? void 0 : b.$emit) == null ? void 0 : u.bind(A == null ? void 0 : A.proxy));
  let i = d;
  n || (n = "modelValue"), i = i || `update:${n.toString()}`;
  const r = (p) => O ? typeof O == "function" ? O(p) : tt(p) : p, o = () => et(t[n]) ? r(t[n]) : w, f = (p) => {
    R ? R(p) && y(i, p) : y(i, p);
  };
  if (x) {
    const p = o(), T = ref(p);
    let D = false;
    return watch(
      () => t[n],
      (S) => {
        D || (D = true, T.value = r(S), nextTick(() => D = false));
      }
    ), watch(
      T,
      (S) => {
        !D && (S !== t[n] || l) && f(S);
      },
      { deep: l }
    ), T;
  } else
    return computed({
      get() {
        return o();
      },
      set(p) {
        f(p);
      }
    });
}
var [ve, nt] = Q("DrawerRoot");
var Pe = /* @__PURE__ */ new WeakMap();
function $(t, n, v = false) {
  if (!t || !(t instanceof HTMLElement) || !n)
    return;
  const s = {};
  Object.entries(n).forEach(([e, b]) => {
    if (e.startsWith("--")) {
      t.style.setProperty(e, b);
      return;
    }
    s[e] = t.style[e], t.style[e] = b;
  }), !v && Pe.set(t, s);
}
function ne(t, n) {
  if (!t || !(t instanceof HTMLElement))
    return;
  const v = Pe.get(t);
  v && (n ? t.style[n] = v[n] : Object.entries(v).forEach(([s, e]) => {
    t.style[s] = e;
  }));
}
function ae(t, n) {
  const v = window.getComputedStyle(t), s = v.transform || v.webkitTransform || v.mozTransform;
  let e = s.match(/^matrix3d\((.+)\)$/);
  return e ? Number.parseFloat(e[1].split(", ")[N(n) ? 13 : 12]) : (e = s.match(/^matrix\((.+)\)$/), e ? Number.parseFloat(e[1].split(", ")[N(n) ? 5 : 4]) : null);
}
function at(t) {
  return 8 * (Math.log(t + 1) - 2);
}
function N(t) {
  switch (t) {
    case "top":
    case "bottom":
      return true;
    case "left":
    case "right":
      return false;
    default:
      return t;
  }
}
var g = {
  DURATION: 0.5,
  EASE: [0.32, 0.72, 0, 1]
};
var Re = 0.4;
function lt({
  activeSnapPoint: t,
  snapPoints: n,
  drawerRef: v,
  overlayRef: s,
  fadeFromIndex: e,
  onSnapPointChange: b,
  direction: u
}) {
  const O = computed(
    () => (n.value && t.value === n.value[n.value.length - 1]) ?? null
  ), x = computed(
    () => n.value && n.value.length > 0 && ((e == null ? void 0 : e.value) || (e == null ? void 0 : e.value) === 0) && !Number.isNaN(e == null ? void 0 : e.value) && n.value[(e == null ? void 0 : e.value) ?? -1] === t.value || !n.value
  ), d = computed(
    () => {
      var r;
      return ((r = n.value) == null ? void 0 : r.findIndex((o) => o === t.value)) ?? null;
    }
  ), l = computed(
    () => {
      var r;
      return ((r = n.value) == null ? void 0 : r.map((o) => {
        const f = typeof window < "u", p = typeof o == "string";
        let T = 0;
        if (p && (T = Number.parseInt(o, 10)), N(u.value)) {
          const S = p ? T : f ? o * window.innerHeight : 0;
          return f ? u.value === "bottom" ? window.innerHeight - S : -window.innerHeight + S : S;
        }
        const D = p ? T : f ? o * window.innerWidth : 0;
        return f ? u.value === "right" ? window.innerWidth - D : -window.innerWidth + D : D;
      })) ?? [];
    }
  ), w = computed(
    () => {
      var r;
      return d.value !== null ? (r = l.value) == null ? void 0 : r[d.value] : null;
    }
  ), R = (r) => {
    var f, p, T, D;
    const o = ((f = l.value) == null ? void 0 : f.findIndex((S) => S === r)) ?? null;
    nextTick(() => {
      var S;
      b(o, l.value), $((S = v.value) == null ? void 0 : S.$el, {
        transition: `transform ${g.DURATION}s cubic-bezier(${g.EASE.join(",")})`,
        transform: N(u.value) ? `translate3d(0, ${r}px, 0)` : `translate3d(${r}px, 0, 0)`
      });
    }), l.value && o !== l.value.length - 1 && o !== (e == null ? void 0 : e.value) ? $((p = s.value) == null ? void 0 : p.$el, {
      transition: `opacity ${g.DURATION}s cubic-bezier(${g.EASE.join(",")})`,
      opacity: "0"
    }) : $((T = s.value) == null ? void 0 : T.$el, {
      transition: `opacity ${g.DURATION}s cubic-bezier(${g.EASE.join(",")})`,
      opacity: "1"
    }), t.value = o !== null ? ((D = n.value) == null ? void 0 : D[o]) ?? null : null;
  };
  watch(
    [t, l, n],
    () => {
      var r;
      if (t.value) {
        const o = ((r = n.value) == null ? void 0 : r.findIndex((f) => f === t.value)) ?? -1;
        l.value && o !== -1 && typeof l.value[o] == "number" && R(l.value[o]);
      }
    },
    {
      immediate: true
      // if you want to run the effect immediately as well
    }
  );
  function A({
    draggedDistance: r,
    closeDrawer: o,
    velocity: f,
    dismissible: p
  }) {
    var W, X, z;
    if (e === void 0)
      return;
    const T = u.value === "bottom" || u.value === "right" ? (w.value ?? 0) - r : (w.value ?? 0) + r, D = d.value === (e.value ?? 0) - 1, S = d.value === 0, L = r > 0;
    if (D && $((W = s.value) == null ? void 0 : W.$el, {
      transition: `opacity ${g.DURATION}s cubic-bezier(${g.EASE.join(",")})`
    }), f > 2 && !L) {
      p ? o() : R(l.value[0]);
      return;
    }
    if (f > 2 && L && l && n.value) {
      R(l.value[n.value.length - 1]);
      return;
    }
    const Z = (X = l.value) == null ? void 0 : X.reduce((U, c) => typeof U != "number" || typeof c != "number" ? U : Math.abs(c - T) < Math.abs(U - T) ? c : U), j = N(u.value) ? window.innerHeight : window.innerWidth;
    if (f > Re && Math.abs(r) < j * 0.4) {
      const U = L ? 1 : -1;
      if (U > 0 && O) {
        R(l.value[(((z = n.value) == null ? void 0 : z.length) ?? 0) - 1]);
        return;
      }
      if (S && U < 0 && p && o(), d.value === null)
        return;
      R(l.value[d.value + U]);
      return;
    }
    R(Z);
  }
  function y({ draggedDistance: r }) {
    var f;
    if (w.value === null)
      return;
    const o = u.value === "bottom" || u.value === "right" ? (w.value ?? 0) - r : (w.value ?? 0) + r;
    (u.value === "bottom" || u.value === "right") && o < l.value[l.value.length - 1] || (u.value === "top" || u.value === "left") && o > l.value[l.value.length - 1] || $((f = v.value) == null ? void 0 : f.$el, {
      transform: N(u.value) ? `translate3d(0, ${o}px, 0)` : `translate3d(${o}px, 0, 0)`
    });
  }
  function i(r, o) {
    if (!n || typeof d.value != "number" || !l.value || e === void 0)
      return null;
    const f = d.value === (e.value ?? 0) - 1;
    if (d.value >= (e.value ?? 0) && o)
      return 0;
    if (f && !o)
      return 1;
    if (!x.value && !f)
      return null;
    const T = f ? d.value + 1 : d.value - 1, D = f ? l.value[T] - l.value[T - 1] : l.value[T + 1] - l.value[T], S = r / Math.abs(D);
    return f ? 1 - S : S;
  }
  return {
    isLastSnapPoint: O,
    shouldFade: x,
    getPercentageDragged: i,
    activeSnapPointIndex: d,
    onRelease: A,
    onDrag: y,
    snapPointsOffset: l
  };
}
var Q2 = null;
function ot(t) {
  const { isOpen: n, modal: v, nested: s, hasBeenOpened: e } = t, b = ref(typeof window < "u" ? window.location.href : ""), u = ref(0);
  function O() {
    if (Q2 === null && n.value) {
      Q2 = {
        position: document.body.style.position,
        top: document.body.style.top,
        left: document.body.style.left,
        height: document.body.style.height
      };
      const { scrollX: d, innerHeight: l } = window;
      document.body.style.position = "fixed", document.body.style.top = `-${u.value}px`, document.body.style.left = `-${d}px`, document.body.style.right = "0px", document.body.style.height = "auto", setTimeout(() => {
        requestAnimationFrame(() => {
          const w = l - window.innerHeight;
          w && u.value >= l && (document.body.style.top = `-${u.value + w}px`);
        });
      }, 300);
    }
  }
  function x() {
    if (Q2 !== null) {
      const d = -Number.parseInt(document.body.style.top, 10), l = -Number.parseInt(document.body.style.left, 10);
      Object.assign(document.body.style, Q2), requestAnimationFrame(() => {
        if (b.value !== window.location.href) {
          b.value = window.location.href;
          return;
        }
        window.scrollTo(l, d);
      }), Q2 = null;
    }
  }
  return onMounted(() => {
    function d() {
      u.value = window.scrollY;
    }
    d(), window.addEventListener("scroll", d), onUnmounted(() => {
      window.removeEventListener("scroll", d);
    });
  }), watch([n, e, b], () => {
    s.value || !e.value || (n.value ? (!window.matchMedia("(display-mode: standalone)").matches && O(), v.value || setTimeout(() => {
      x();
    }, 500)) : x());
  }), { restorePositionSetting: x };
}
var it = 0.25;
var rt = 100;
var De = 8;
var q = 16;
var ut = 26;
var Se = "vaul-dragging";
function st(t, n) {
  return t && t.value ? t : n;
}
function ct(t) {
  const {
    emitDrag: n,
    emitRelease: v,
    emitClose: s,
    emitOpenChange: e,
    open: b,
    dismissible: u,
    nested: O,
    fixed: x,
    modal: d,
    shouldScaleBackground: l,
    scrollLockTimeout: w,
    closeThreshold: R,
    activeSnapPoint: A,
    fadeFromIndex: y,
    direction: i
  } = t, r = ref(b.value ?? false), o = ref(false), f = ref(false), p = ref(false), T = ref(false), D = ref(null), S = ref(null), L = ref(null), Z = ref(null), j = ref(null), W = ref(true), X = ref(null), z = ref(0), U = ref(false);
  ref(0);
  const c = ref(null);
  ref(0);
  const de = computed(() => {
    var a;
    return ((a = c.value) == null ? void 0 : a.$el.getBoundingClientRect().height) || 0;
  }), H = st(
    t.snapPoints,
    ref(void 0)
  ), {
    activeSnapPointIndex: fe,
    onRelease: Ee,
    snapPointsOffset: Ne,
    onDrag: Ae,
    shouldFade: pe,
    getPercentageDragged: _e
  } = lt({
    snapPoints: H,
    activeSnapPoint: A,
    drawerRef: c,
    fadeFromIndex: y,
    overlayRef: D,
    onSnapPointChange: Ce,
    direction: i
  });
  function Ce(a, m) {
    H.value && a === m.length - 1 && (S.value = /* @__PURE__ */ new Date());
  }
  const { restorePositionSetting: xe2 } = ot({
    isOpen: r,
    modal: d,
    nested: O,
    hasBeenOpened: o
  });
  function G() {
    return (window.innerWidth - ut) / window.innerWidth;
  }
  function me(a, m) {
    var M;
    if (!a)
      return false;
    let h = a;
    const _ = (M = window.getSelection()) == null ? void 0 : M.toString(), E = c.value ? ae(c.value.$el, i.value) : null, B = /* @__PURE__ */ new Date();
    if (h.hasAttribute("data-vaul-no-drag") || h.closest("[data-vaul-no-drag]"))
      return false;
    if (i.value === "right" || i.value === "left")
      return true;
    if (S.value && B.getTime() - S.value.getTime() < 500)
      return false;
    if (E !== null && (i.value === "bottom" ? E > 0 : E < 0))
      return true;
    if (_ && _.length > 0)
      return false;
    if (j.value && B.getTime() - j.value.getTime() < w.value && E === 0 || m)
      return j.value = B, false;
    for (; h; ) {
      if (h.scrollHeight > h.clientHeight) {
        if (h.scrollTop !== 0)
          return j.value = /* @__PURE__ */ new Date(), false;
        if (h.getAttribute("role") === "dialog")
          return true;
      }
      h = h.parentNode;
    }
    return true;
  }
  function Be(a) {
    !u.value && !H.value || c.value && !c.value.$el.contains(a.target) || (p.value = true, L.value = /* @__PURE__ */ new Date(), a.target.setPointerCapture(a.pointerId), z.value = N(i.value) ? a.clientY : a.clientX);
  }
  function He(a) {
    var m, h, _, E, B, M;
    if (c.value && p.value) {
      const J = i.value === "bottom" || i.value === "right" ? 1 : -1, F = (z.value - (N(i.value) ? a.clientY : a.clientX)) * J, ee = F > 0, we = H.value && !u.value && !ee;
      if (we && fe.value === 0)
        return;
      const ue = Math.abs(F), he = document.querySelector("[vaul-drawer-wrapper]");
      let k = ue / de.value;
      const be = _e(ue, ee);
      if (be !== null && (k = be), we && k >= 1 || !W.value && !me(a.target, ee))
        return;
      if ((m = c == null ? void 0 : c.value) == null || m.$el.classList.add(Se), W.value = true, $((h = c.value) == null ? void 0 : h.$el, {
        transition: "none"
      }), $((_ = D.value) == null ? void 0 : _.$el, {
        transition: "none"
      }), H.value && Ae({ draggedDistance: F }), ee && !H.value) {
        const I = at(F), te = Math.min(I * -1, 0) * J;
        $((E = c.value) == null ? void 0 : E.$el, {
          transform: N(i.value) ? `translate3d(0, ${te}px, 0)` : `translate3d(${te}px, 0, 0)`
        });
        return;
      }
      const je = 1 - k;
      if ((pe.value || y.value && fe.value === y.value - 1) && (n(k), $(
        (B = D.value) == null ? void 0 : B.$el,
        {
          opacity: `${je}`,
          transition: "none"
        },
        true
      )), he && D.value && l.value) {
        const I = Math.min(G() + k * (1 - G()), 1), te = 8 - k * 8, $e = Math.max(0, 14 - k * 14);
        $(
          he,
          {
            borderRadius: `${te}px`,
            transform: N(i.value) ? `scale(${I}) translate3d(0, ${$e}px, 0)` : `scale(${I}) translate3d(${$e}px, 0, 0)`,
            transition: "none"
          },
          true
        );
      }
      if (!H.value) {
        const I = ue * J;
        $((M = c.value) == null ? void 0 : M.$el, {
          transform: N(i.value) ? `translate3d(0, ${I}px, 0)` : `translate3d(${I}px, 0, 0)`
        });
      }
    }
  }
  function ge() {
    var h;
    if (!c.value)
      return;
    const a = document.querySelector("[vaul-drawer-wrapper]"), m = ae(c.value.$el, i.value);
    $(c.value.$el, {
      transform: "translate3d(0, 0, 0)",
      transition: `transform ${g.DURATION}s cubic-bezier(${g.EASE.join(",")})`
    }), $((h = D.value) == null ? void 0 : h.$el, {
      transition: `opacity ${g.DURATION}s cubic-bezier(${g.EASE.join(",")})`,
      opacity: "1"
    }), l.value && m && m > 0 && r.value && $(
      a,
      {
        borderRadius: `${De}px`,
        overflow: "hidden",
        ...N(i.value) ? {
          transform: `scale(${G()}) translate3d(0, calc(env(safe-area-inset-top) + 14px), 0)`,
          transformOrigin: "top"
        } : {
          transform: `scale(${G()}) translate3d(calc(env(safe-area-inset-top) + 14px), 0, 0)`,
          transformOrigin: "left"
        },
        transitionProperty: "transform, border-radius",
        transitionDuration: `${g.DURATION}s`,
        transitionTimingFunction: `cubic-bezier(${g.EASE.join(",")})`
      },
      true
    );
  }
  function K() {
    var a;
    c.value && ($(c.value.$el, {
      transform: N(i.value) ? `translate3d(0, ${i.value === "bottom" ? "100%" : "-100%"}, 0)` : `translate3d(${i.value === "right" ? "100%" : "-100%"}, 0, 0)`,
      transition: `transform ${g.DURATION}s cubic-bezier(${g.EASE.join(",")})`
    }), $((a = D.value) == null ? void 0 : a.$el, {
      opacity: "0",
      transition: `opacity ${g.DURATION}s cubic-bezier(${g.EASE.join(",")})`
    }), re(false), window.setTimeout(() => {
      f.value = false, r.value = false;
    }, 300), window.setTimeout(() => {
      H.value && (A.value = H.value[0]);
    }, g.DURATION * 1e3));
  }
  watchEffect(() => {
    if (!r.value && l.value && Fe) {
      const a = setTimeout(() => {
        ne(document.body);
      }, 200);
      return () => clearTimeout(a);
    }
  }), onUnmounted(() => {
    re(false), xe2();
  });
  function Ue(a) {
    if (!p.value || !c.value)
      return;
    c.value.$el.classList.remove(Se), W.value = false, p.value = false, Z.value = /* @__PURE__ */ new Date();
    const m = ae(c.value.$el, i.value);
    if (!me(a.target, false) || !m || Number.isNaN(m) || L.value === null)
      return;
    const h = Z.value.getTime() - L.value.getTime(), _ = z.value - (N(i.value) ? a.clientY : a.clientX), E = Math.abs(_) / h;
    if (E > 0.05 && (T.value = true, window.setTimeout(() => {
      T.value = false;
    }, 200)), H.value) {
      const M = i.value === "bottom" || i.value === "right" ? 1 : -1;
      Ee({
        draggedDistance: _ * M,
        closeDrawer: K,
        velocity: E,
        dismissible: u.value
      }), v(true);
      return;
    }
    if (i.value === "bottom" || i.value === "right" ? _ > 0 : _ < 0) {
      ge(), v(true);
      return;
    }
    if (E > Re) {
      K(), v(false);
      return;
    }
    const B = Math.min(
      c.value.$el.getBoundingClientRect().height ?? 0,
      window.innerHeight
    );
    if (m >= B * R.value) {
      K(), v(false);
      return;
    }
    v(true), ge();
  }
  watch(r, (a) => {
    a && (S.value = /* @__PURE__ */ new Date(), re(true)), e(a);
  }, { immediate: true }), watch(b, (a) => {
    a ? (r.value = a, o.value = true) : K();
  }, { immediate: true });
  function re(a) {
    const m = document.querySelector("[vaul-drawer-wrapper]");
    !m || !l.value || (a ? ($(document.body, {
      background: document.body.style.backgroundColor || document.body.style.background
    }), $(
      document.body,
      {
        background: "black"
      },
      true
    ), $(m, {
      borderRadius: `${De}px`,
      overflow: "hidden",
      ...N(i.value) ? {
        transform: `scale(${G()}) translate3d(0, calc(env(safe-area-inset-top) + 14px), 0)`,
        transformOrigin: "top"
      } : {
        transform: `scale(${G()}) translate3d(calc(env(safe-area-inset-top) + 14px), 0, 0)`,
        transformOrigin: "left"
      },
      transitionProperty: "transform, border-radius",
      transitionDuration: `${g.DURATION}s`,
      transitionTimingFunction: `cubic-bezier(${g.EASE.join(",")})`
    })) : (ne(m, "overflow"), ne(m, "transform"), ne(m, "borderRadius"), $(m, {
      transitionProperty: "transform, border-radius",
      transitionDuration: `${g.DURATION}s`,
      transitionTimingFunction: `cubic-bezier(${g.EASE.join(",")})`
    })));
  }
  function Me(a) {
    var _, E;
    const m = a ? (window.innerWidth - q) / window.innerWidth : 1, h = a ? -q : 0;
    X.value && window.clearTimeout(X.value), $((_ = c.value) == null ? void 0 : _.$el, {
      transition: `transform ${g.DURATION}s cubic-bezier(${g.EASE.join(",")})`,
      transform: `scale(${m}) translate3d(0, ${h}px, 0)`
    }), !a && ((E = c.value) != null && E.$el) && (X.value = window.setTimeout(() => {
      var M, J;
      const B = ae((M = c.value) == null ? void 0 : M.$el, i.value);
      $((J = c.value) == null ? void 0 : J.$el, {
        transition: "none",
        transform: N(i.value) ? `translate3d(0, ${B}px, 0)` : `translate3d(${B}px, 0, 0)`
      });
    }, 500));
  }
  function Ve(a) {
    var B;
    if (a < 0)
      return;
    const m = N(i.value) ? window.innerHeight : window.innerWidth, h = (m - q) / m, _ = h + a * (1 - h), E = -q + a * q;
    $((B = c.value) == null ? void 0 : B.$el, {
      transform: N(i.value) ? `scale(${_}) translate3d(0, ${E}px, 0)` : `scale(${_}) translate3d(${E}px, 0, 0)`,
      transition: "none"
    });
  }
  function Le(a) {
    var E;
    const m = N(i.value) ? window.innerHeight : window.innerWidth, h = a ? (m - q) / m : 1, _ = a ? -q : 0;
    a && $((E = c.value) == null ? void 0 : E.$el, {
      transition: `transform ${g.DURATION}s cubic-bezier(${g.EASE.join(",")})`,
      transform: N(i.value) ? `scale(${h}) translate3d(0, ${_}px, 0)` : `scale(${h}) translate3d(${_}px, 0, 0)`
    });
  }
  return {
    open: b,
    isOpen: r,
    modal: d,
    keyboardIsOpen: U,
    hasBeenOpened: o,
    isVisible: f,
    drawerRef: c,
    drawerHeightRef: de,
    overlayRef: D,
    isDragging: p,
    dragStartTime: L,
    isAllowedToDrag: W,
    snapPoints: H,
    activeSnapPoint: A,
    pointerStart: z,
    dismissible: u,
    snapPointsOffset: Ne,
    direction: i,
    shouldFade: pe,
    fadeFromIndex: y,
    shouldScaleBackground: l,
    onPress: Be,
    onDrag: He,
    onRelease: Ue,
    closeDrawer: K,
    onNestedDrag: Ve,
    onNestedRelease: Le,
    onNestedOpenChange: Me,
    emitClose: s,
    emitDrag: n,
    emitRelease: v,
    emitOpenChange: e,
    nested: O
  };
}
var vt = defineComponent({
  __name: "DrawerRoot",
  props: {
    activeSnapPoint: { default: void 0 },
    closeThreshold: { default: it },
    shouldScaleBackground: { type: Boolean, default: void 0 },
    scrollLockTimeout: { default: rt },
    fixed: { type: Boolean, default: void 0 },
    dismissible: { type: Boolean, default: true },
    modal: { type: Boolean, default: true },
    open: { type: Boolean, default: void 0 },
    defaultOpen: { type: Boolean, default: void 0 },
    nested: { type: Boolean, default: false },
    direction: { default: "bottom" },
    snapPoints: { default: void 0 },
    fadeFromIndex: { default: void 0 }
  },
  emits: ["drag", "release", "close", "update:open", "update:activeSnapPoint"],
  setup(t, { expose: n, emit: v }) {
    const s = t, e = v;
    useSlots();
    const b = computed(() => s.fadeFromIndex ?? (s.snapPoints && s.snapPoints.length - 1)), u = ye(s, "open", e, {
      defaultValue: s.defaultOpen,
      passive: s.open === void 0
    }), O = ye(s, "activeSnapPoint", e, {
      passive: s.activeSnapPoint === void 0
    }), x = {
      emitDrag: (y) => e("drag", y),
      emitRelease: (y) => e("release", y),
      emitClose: () => e("close"),
      emitOpenChange: (y) => {
        e("update:open", y);
      }
    }, { closeDrawer: d, hasBeenOpened: l, modal: w, isOpen: R } = nt(
      ct({
        ...x,
        ...toRefs(s),
        activeSnapPoint: O,
        fadeFromIndex: b,
        open: u
      })
    );
    function A(y) {
      if (u.value !== void 0) {
        x.emitOpenChange(y);
        return;
      }
      y ? (l.value = true, R.value = y) : d();
    }
    return n({
      open: R
    }), (y, i) => (openBlock(), createBlock(unref(Gi), {
      open: unref(R),
      modal: unref(w),
      "onUpdate:open": A
    }, {
      default: withCtx(() => [
        renderSlot(y.$slots, "default", { open: unref(R) })
      ]),
      _: 3
    }, 8, ["open", "modal"]));
  }
});
var pt = defineComponent({
  __name: "DrawerRootNested",
  props: {
    activeSnapPoint: {},
    closeThreshold: {},
    shouldScaleBackground: { type: Boolean },
    scrollLockTimeout: {},
    fixed: { type: Boolean },
    dismissible: { type: Boolean },
    modal: { type: Boolean },
    open: { type: Boolean },
    defaultOpen: { type: Boolean },
    nested: { type: Boolean },
    direction: {},
    snapPoints: {},
    fadeFromIndex: {}
  },
  emits: ["drag", "release", "close", "update:open", "update:activeSnapPoint"],
  setup(t, { emit: n }) {
    const v = t, s = n, { onNestedDrag: e, onNestedOpenChange: b, onNestedRelease: u } = ve();
    function O() {
      b(false);
    }
    function x(w) {
      e(w);
    }
    function d(w) {
      w && b(w), s("update:open", w);
    }
    const l = xe(v, s);
    return (w, R) => (openBlock(), createBlock(vt, mergeProps(unref(l), {
      nested: "",
      onClose: O,
      onDrag: x,
      onRelease: unref(u),
      "onUpdate:open": d
    }), {
      default: withCtx(() => [
        renderSlot(w.$slots, "default")
      ]),
      _: 3
    }, 16, ["onRelease"]));
  }
});
var mt = defineComponent({
  __name: "DrawerOverlay",
  setup(t) {
    const { overlayRef: n, snapPoints: v, isVisible: s, isOpen: e, shouldFade: b } = ve(), u = computed(() => {
      var O;
      return v && (((O = v.value) == null ? void 0 : O.length) ?? 0) > 0;
    });
    return (O, x) => (openBlock(), createBlock(unref(gu), {
      ref_key: "overlayRef",
      ref: n,
      "vaul-drawer-visible": unref(s) ? "true" : "false",
      "vaul-overlay": "",
      "vaul-snap-points": unref(e) && u.value ? "true" : "false",
      "vaul-snap-points-overlay": unref(e) && unref(b) ? "true" : "false"
    }, null, 8, ["vaul-drawer-visible", "vaul-snap-points", "vaul-snap-points-overlay"]));
  }
});
var gt = defineComponent({
  __name: "DrawerContent",
  setup(t) {
    const {
      open: n,
      isOpen: v,
      isVisible: s,
      snapPointsOffset: e,
      drawerRef: b,
      onPress: u,
      onDrag: O,
      onRelease: x,
      modal: d,
      emitOpenChange: l,
      dismissible: w,
      keyboardIsOpen: R,
      closeDrawer: A,
      direction: y
    } = ve(), i = computed(() => e.value && e.value.length > 0 ? `${e.value[0]}px` : "0");
    function r(o) {
      if (!d.value || o.defaultPrevented) {
        o.preventDefault();
        return;
      }
      R.value && (R.value = false), o.preventDefault(), w.value && l(false), !(!w.value || n.value !== void 0) && A();
    }
    return watch(
      v,
      (o) => {
        o && setTimeout(() => {
          s.value = true;
        }, 1);
      },
      { immediate: true }
    ), (o, f) => (openBlock(), createBlock(unref(hu), {
      ref_key: "drawerRef",
      ref: b,
      "vaul-drawer": "",
      "vaul-drawer-direction": unref(y),
      "vaul-drawer-visible": unref(s) ? "true" : "false",
      style: normalizeStyle({ "--snap-point-height": i.value }),
      onPointerdown: unref(u),
      onPointermove: unref(O),
      onPointerup: unref(x),
      onPointerDownOutside: r,
      onEscapeKeyDown: f[0] || (f[0] = (p) => {
        unref(w) || p.preventDefault();
      })
    }, {
      default: withCtx(() => [
        renderSlot(o.$slots, "default")
      ]),
      _: 3
    }, 8, ["vaul-drawer-direction", "vaul-drawer-visible", "style", "onPointerdown", "onPointermove", "onPointerup"]));
  }
});
export {
  Hl as DrawerClose,
  gt as DrawerContent,
  Cu as DrawerDescription,
  mt as DrawerOverlay,
  wv as DrawerPortal,
  vt as DrawerRoot,
  pt as DrawerRootNested,
  bu as DrawerTitle,
  qi as DrawerTrigger
};
//# sourceMappingURL=vaul-vue.js.map
