import { o as d } from "./rolldown-runtime.js";
import { i as g } from "./vendor/react.js";
import { a as r, i as m, n as u, o as h, r as v, t as O } from "./_shared.js";
import { i as S, n as _, o as P, r as b, t as E } from "./Popover.js";
var e = /* @__PURE__ */ d(g(), 1), l = {
  open: "boolean",
  defaultOpen: "boolean",
  side: "string",
  align: "string",
  sideOffset: "number",
  alignOffset: "number"
}, f = class extends O {
  get propDefs() {
    return l;
  }
  static get observedAttributes() {
    return Object.keys(l).map(u);
  }
  _renderReact() {
    const t = this._readAllProps(), p = this._getSlot("trigger"), n = this._getSlot("content"), a = this._getSlot("title"), i = this._getSlot("description");
    let s = null;
    if (a || i) {
      const o = [];
      a && o.push(e.createElement(P, { key: "title" }, r(a))), i && o.push(e.createElement(_, { key: "description" }, r(i))), s = e.createElement(b, { key: "header" }, ...o);
    }
    n && (s = r(n));
    const c = this._getDefaultSlot();
    return c && !n && (s = r(c)), e.createElement(E, {
      open: t.open,
      defaultOpen: t.defaultOpen || !1,
      onOpenChange: (o) => v(this, "open-change", o),
      trigger: p ? e.createElement("span", { style: { display: "contents" } }, r(p)) : e.createElement("span", null, "Trigger")
    }, e.createElement(S, {
      side: t.side || "bottom",
      align: t.align || "center",
      sideOffset: t.sideOffset ?? 4,
      alignOffset: t.alignOffset ?? 0
    }, s));
  }
};
m(f, l);
h("hf-popover", f);
export {
  f as PopoverWC,
  f as default
};

//# sourceMappingURL=hf-popover.js.map