import { p as r, q as _, aC as Y, a3 as x, a4 as b, t as $, b as k, d as u, j as t, Y as i, B as q, s as D, X as E, bS as F, bA as J, n as K, S as L, T as N, z as y, H as z, f as O, as as Q, A as f } from "./index-G5Vdjjso.js";
var R = O("<!> <!>", 1);
function W(C, a) {
  let P = r(a, "buttons", 8), w = r(a, "text", 8, "Action"), A = r(a, "size", 8, "M"), B = r(a, "align", 8, "left"), S = r(a, "offset", 8), M = r(a, "animate", 8), o = r(a, "quiet", 8, !1), d = y(), c = y();
  const j = async (e) => {
    t(c).hide(), await e.onClick?.();
  };
  var g = R(), h = _(g);
  {
    let e = z(() => !o()), m = z(() => !o());
    Y(h, {
      get size() {
        return A();
      },
      icon: "caret-down",
      get quiet() {
        return o();
      },
      get primary() {
        return o();
      },
      get cta() {
        return t(e);
      },
      get newStyles() {
        return t(m);
      },
      reverse: !0,
      get ref() {
        return t(d);
      },
      set ref(s) {
        q(d, s);
      },
      $$events: {
        click: [
          () => t(c)?.show(),
          function(s) {
            i.call(this, a, s);
          }
        ]
      },
      children: (s, H) => {
        x();
        var n = b();
        $(() => k(n, w() || "Action")), u(s, n);
      },
      $$slots: { default: !0 },
      $$legacy: !0
    });
  }
  var G = D(h, 2);
  E(
    F(G, {
      get align() {
        return B();
      },
      get anchor() {
        return t(d);
      },
      get offset() {
        return S();
      },
      get animate() {
        return M();
      },
      resizable: !1,
      $$events: {
        close(e) {
          i.call(this, a, e);
        },
        open(e) {
          i.call(this, a, e);
        },
        mouseenter(e) {
          i.call(this, a, e);
        },
        mouseleave(e) {
          i.call(this, a, e);
        }
      },
      children: (e, m) => {
        J(e, {
          children: (s, H) => {
            var n = K(), I = _(n);
            L(I, 1, P, N, (T, l) => {
              Q(T, {
                get icon() {
                  return t(l), f(() => t(l).icon);
                },
                get disabled() {
                  return t(l), f(() => t(l).disabled);
                },
                $$events: { click: () => j(t(l)) },
                children: (X, U) => {
                  x();
                  var v = b();
                  $(() => k(v, (t(l), f(() => t(l).text || "Button")))), u(X, v);
                },
                $$slots: { default: !0 }
              });
            }), u(s, n);
          },
          $$slots: { default: !0 }
        });
      },
      $$slots: { default: !0 },
      $$legacy: !0
    }),
    (e) => q(c, e),
    () => t(c)
  ), u(C, g);
}
export {
  W as C
};
