🚀 Socket Launch Week Day 5:Introducing Repository Access Permissions and Custom Roles.Learn more
Sign In

@headless-primitives/popover

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@headless-primitives/popover - npm Package Compare versions

Comparing version
1.0.0
to
1.1.0
+480
-485
dist/index.js

@@ -1,11 +0,11 @@

var M = globalThis, F = M.ShadowRoot && (M.ShadyCSS === void 0 || M.ShadyCSS.nativeShadow) && "adoptedStyleSheets" in Document.prototype && "replace" in CSSStyleSheet.prototype, gt = Symbol(), tt = /* @__PURE__ */ new WeakMap(), Ot = class {
constructor(t, e, i) {
if (this._$cssResult$ = !0, i !== gt) throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");
this.cssText = t, this.t = e;
var T = globalThis, F = T.ShadowRoot && (T.ShadyCSS === void 0 || T.ShadyCSS.nativeShadow) && "adoptedStyleSheets" in Document.prototype && "replace" in CSSStyleSheet.prototype, yt = Symbol(), tt = /* @__PURE__ */ new WeakMap(), xt = class {
constructor(t, s, i) {
if (this._$cssResult$ = !0, i !== yt) throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");
this.cssText = t, this.t = s;
}
get styleSheet() {
let t = this.o, e = this.t;
let t = this.o, s = this.t;
if (F && t === void 0) {
let i = e !== void 0 && e.length === 1;
i && (t = tt.get(e)), t === void 0 && ((this.o = t = new CSSStyleSheet()).replaceSync(this.cssText), i && tt.set(e, t));
let i = s !== void 0 && s.length === 1;
i && (t = tt.get(s)), t === void 0 && ((this.o = t = new CSSStyleSheet()).replaceSync(this.cssText), i && tt.set(s, t));
}

@@ -17,32 +17,32 @@ return t;

}
}, Ut = (s) => new Ot(typeof s == "string" ? s : s + "", void 0, gt), xt = (s, t) => {
if (F) s.adoptedStyleSheets = t.map((e) => e instanceof CSSStyleSheet ? e : e.styleSheet);
else for (let e of t) {
let i = document.createElement("style"), r = M.litNonce;
r !== void 0 && i.setAttribute("nonce", r), i.textContent = e.cssText, s.appendChild(i);
}, Rt = (e) => new xt(typeof e == "string" ? e : e + "", void 0, yt), kt = (e, t) => {
if (F) e.adoptedStyleSheets = t.map((s) => s instanceof CSSStyleSheet ? s : s.styleSheet);
else for (let s of t) {
let i = document.createElement("style"), r = T.litNonce;
r !== void 0 && i.setAttribute("nonce", r), i.textContent = s.cssText, e.appendChild(i);
}
}, et = F ? (s) => s : (s) => s instanceof CSSStyleSheet ? ((t) => {
let e = "";
for (let i of t.cssRules) e += i.cssText;
return Ut(e);
})(s) : s, { is: Rt, defineProperty: Mt, getOwnPropertyDescriptor: Tt, getOwnPropertyNames: kt, getOwnPropertySymbols: Lt, getPrototypeOf: Ht } = Object, H = globalThis, st = H.trustedTypes, Dt = st ? st.emptyScript : "", Nt = H.reactiveElementPolyfillSupport, P = (s, t) => s, j = {
toAttribute(s, t) {
}, et = F ? (e) => e : (e) => e instanceof CSSStyleSheet ? ((t) => {
let s = "";
for (let i of t.cssRules) s += i.cssText;
return Rt(s);
})(e) : e, { is: Mt, defineProperty: Tt, getOwnPropertyDescriptor: Ht, getOwnPropertyNames: Dt, getOwnPropertySymbols: Nt, getPrototypeOf: Lt } = Object, L = globalThis, st = L.trustedTypes, jt = st ? st.emptyScript : "", zt = L.reactiveElementPolyfillSupport, P = (e, t) => e, B = {
toAttribute(e, t) {
switch (t) {
case Boolean:
s = s ? Dt : null;
e = e ? jt : null;
break;
case Object:
case Array:
s = s == null ? s : JSON.stringify(s);
e = e == null ? e : JSON.stringify(e);
}
return s;
return e;
},
fromAttribute(s, t) {
let e = s;
fromAttribute(e, t) {
let s = e;
switch (t) {
case Boolean:
e = s !== null;
s = e !== null;
break;
case Number:
e = s === null ? null : Number(s);
s = e === null ? null : Number(e);
break;

@@ -52,21 +52,21 @@ case Object:

try {
e = JSON.parse(s);
s = JSON.parse(e);
} catch {
e = null;
s = null;
}
}
return e;
return s;
}
}, mt = (s, t) => !Rt(s, t), it = {
}, bt = (e, t) => !Mt(e, t), it = {
attribute: !0,
type: String,
converter: j,
converter: B,
reflect: !1,
useDefault: !1,
hasChanged: mt
hasChanged: bt
};
Symbol.metadata ??= Symbol("metadata"), H.litPropertyMetadata ??= /* @__PURE__ */ new WeakMap();
var E = class extends HTMLElement {
static addInitializer(t) {
this._$Ei(), (this.l ??= []).push(t);
Symbol.metadata ??= Symbol("metadata"), L.litPropertyMetadata ??= /* @__PURE__ */ new WeakMap();
var A = class extends HTMLElement {
static addInitializer(e) {
this._$Ei(), (this.l ??= []).push(e);
}

@@ -76,22 +76,22 @@ static get observedAttributes() {

}
static createProperty(t, e = it) {
if (e.state && (e.attribute = !1), this._$Ei(), this.prototype.hasOwnProperty(t) && ((e = Object.create(e)).wrapped = !0), this.elementProperties.set(t, e), !e.noAccessor) {
let i = Symbol(), r = this.getPropertyDescriptor(t, i, e);
r !== void 0 && Mt(this.prototype, t, r);
static createProperty(e, t = it) {
if (t.state && (t.attribute = !1), this._$Ei(), this.prototype.hasOwnProperty(e) && ((t = Object.create(t)).wrapped = !0), this.elementProperties.set(e, t), !t.noAccessor) {
let s = Symbol(), i = this.getPropertyDescriptor(e, s, t);
i !== void 0 && Tt(this.prototype, e, i);
}
}
static getPropertyDescriptor(t, e, i) {
let { get: r, set: n } = Tt(this.prototype, t) ?? {
static getPropertyDescriptor(e, t, s) {
let { get: i, set: r } = Ht(this.prototype, e) ?? {
get() {
return this[e];
return this[t];
},
set(o) {
this[e] = o;
this[t] = o;
}
};
return {
get: r,
get: i,
set(o) {
let h = r?.call(this);
n?.call(this, o), this.requestUpdate(t, h, i);
let n = i?.call(this);
r?.call(this, o), this.requestUpdate(e, n, s);
},

@@ -102,9 +102,9 @@ configurable: !0,

}
static getPropertyOptions(t) {
return this.elementProperties.get(t) ?? it;
static getPropertyOptions(e) {
return this.elementProperties.get(e) ?? it;
}
static _$Ei() {
if (this.hasOwnProperty(P("elementProperties"))) return;
let t = Ht(this);
t.finalize(), t.l !== void 0 && (this.l = [...t.l]), this.elementProperties = new Map(t.elementProperties);
let e = Lt(this);
e.finalize(), e.l !== void 0 && (this.l = [...e.l]), this.elementProperties = new Map(e.elementProperties);
}

@@ -114,28 +114,28 @@ static finalize() {

if (this.finalized = !0, this._$Ei(), this.hasOwnProperty(P("properties"))) {
let e = this.properties, i = [...kt(e), ...Lt(e)];
for (let r of i) this.createProperty(r, e[r]);
let t = this.properties, s = [...Dt(t), ...Nt(t)];
for (let i of s) this.createProperty(i, t[i]);
}
let t = this[Symbol.metadata];
if (t !== null) {
let e = litPropertyMetadata.get(t);
if (e !== void 0) for (let [i, r] of e) this.elementProperties.set(i, r);
let e = this[Symbol.metadata];
if (e !== null) {
let t = litPropertyMetadata.get(e);
if (t !== void 0) for (let [s, i] of t) this.elementProperties.set(s, i);
}
this._$Eh = /* @__PURE__ */ new Map();
for (let [e, i] of this.elementProperties) {
let r = this._$Eu(e, i);
r !== void 0 && this._$Eh.set(r, e);
for (let [t, s] of this.elementProperties) {
let i = this._$Eu(t, s);
i !== void 0 && this._$Eh.set(i, t);
}
this.elementStyles = this.finalizeStyles(this.styles);
}
static finalizeStyles(t) {
let e = [];
if (Array.isArray(t)) {
let i = new Set(t.flat(1 / 0).reverse());
for (let r of i) e.unshift(et(r));
} else t !== void 0 && e.push(et(t));
return e;
static finalizeStyles(e) {
let t = [];
if (Array.isArray(e)) {
let s = new Set(e.flat(1 / 0).reverse());
for (let i of s) t.unshift(et(i));
} else e !== void 0 && t.push(et(e));
return t;
}
static _$Eu(t, e) {
let i = e.attribute;
return i === !1 ? void 0 : typeof i == "string" ? i : typeof t == "string" ? t.toLowerCase() : void 0;
static _$Eu(e, t) {
let s = t.attribute;
return s === !1 ? void 0 : typeof s == "string" ? s : typeof e == "string" ? e.toLowerCase() : void 0;
}

@@ -146,56 +146,56 @@ constructor() {

_$Ev() {
this._$ES = new Promise((t) => this.enableUpdating = t), this._$AL = /* @__PURE__ */ new Map(), this._$E_(), this.requestUpdate(), this.constructor.l?.forEach((t) => t(this));
this._$ES = new Promise((e) => this.enableUpdating = e), this._$AL = /* @__PURE__ */ new Map(), this._$E_(), this.requestUpdate(), this.constructor.l?.forEach((e) => e(this));
}
addController(t) {
(this._$EO ??= /* @__PURE__ */ new Set()).add(t), this.renderRoot !== void 0 && this.isConnected && t.hostConnected?.();
addController(e) {
(this._$EO ??= /* @__PURE__ */ new Set()).add(e), this.renderRoot !== void 0 && this.isConnected && e.hostConnected?.();
}
removeController(t) {
this._$EO?.delete(t);
removeController(e) {
this._$EO?.delete(e);
}
_$E_() {
let t = /* @__PURE__ */ new Map(), e = this.constructor.elementProperties;
for (let i of e.keys()) this.hasOwnProperty(i) && (t.set(i, this[i]), delete this[i]);
t.size > 0 && (this._$Ep = t);
let e = /* @__PURE__ */ new Map(), t = this.constructor.elementProperties;
for (let s of t.keys()) this.hasOwnProperty(s) && (e.set(s, this[s]), delete this[s]);
e.size > 0 && (this._$Ep = e);
}
createRenderRoot() {
let t = this.shadowRoot ?? this.attachShadow(this.constructor.shadowRootOptions);
return xt(t, this.constructor.elementStyles), t;
let e = this.shadowRoot ?? this.attachShadow(this.constructor.shadowRootOptions);
return kt(e, this.constructor.elementStyles), e;
}
connectedCallback() {
this.renderRoot ??= this.createRenderRoot(), this.enableUpdating(!0), this._$EO?.forEach((t) => t.hostConnected?.());
this.renderRoot ??= this.createRenderRoot(), this.enableUpdating(!0), this._$EO?.forEach((e) => e.hostConnected?.());
}
enableUpdating(t) {
enableUpdating(e) {
}
disconnectedCallback() {
this._$EO?.forEach((t) => t.hostDisconnected?.());
this._$EO?.forEach((e) => e.hostDisconnected?.());
}
attributeChangedCallback(t, e, i) {
this._$AK(t, i);
attributeChangedCallback(e, t, s) {
this._$AK(e, s);
}
_$ET(t, e) {
let i = this.constructor.elementProperties.get(t), r = this.constructor._$Eu(t, i);
if (r !== void 0 && i.reflect === !0) {
let n = (i.converter?.toAttribute === void 0 ? j : i.converter).toAttribute(e, i.type);
this._$Em = t, n == null ? this.removeAttribute(r) : this.setAttribute(r, n), this._$Em = null;
_$ET(e, t) {
let s = this.constructor.elementProperties.get(e), i = this.constructor._$Eu(e, s);
if (i !== void 0 && s.reflect === !0) {
let r = (s.converter?.toAttribute === void 0 ? B : s.converter).toAttribute(t, s.type);
this._$Em = e, r == null ? this.removeAttribute(i) : this.setAttribute(i, r), this._$Em = null;
}
}
_$AK(t, e) {
let i = this.constructor, r = i._$Eh.get(t);
if (r !== void 0 && this._$Em !== r) {
let n = i.getPropertyOptions(r), o = typeof n.converter == "function" ? { fromAttribute: n.converter } : n.converter?.fromAttribute === void 0 ? j : n.converter;
this._$Em = r;
let h = o.fromAttribute(e, n.type);
this[r] = h ?? this._$Ej?.get(r) ?? h, this._$Em = null;
_$AK(e, t) {
let s = this.constructor, i = s._$Eh.get(e);
if (i !== void 0 && this._$Em !== i) {
let r = s.getPropertyOptions(i), o = typeof r.converter == "function" ? { fromAttribute: r.converter } : r.converter?.fromAttribute === void 0 ? B : r.converter;
this._$Em = i;
let n = o.fromAttribute(t, r.type);
this[i] = n ?? this._$Ej?.get(i) ?? n, this._$Em = null;
}
}
requestUpdate(t, e, i, r = !1, n) {
if (t !== void 0) {
requestUpdate(e, t, s, i = !1, r) {
if (e !== void 0) {
let o = this.constructor;
if (r === !1 && (n = this[t]), i ??= o.getPropertyOptions(t), !((i.hasChanged ?? mt)(n, e) || i.useDefault && i.reflect && n === this._$Ej?.get(t) && !this.hasAttribute(o._$Eu(t, i)))) return;
this.C(t, e, i);
if (i === !1 && (r = this[e]), s ??= o.getPropertyOptions(e), !((s.hasChanged ?? bt)(r, t) || s.useDefault && s.reflect && r === this._$Ej?.get(e) && !this.hasAttribute(o._$Eu(e, s)))) return;
this.C(e, t, s);
}
this.isUpdatePending === !1 && (this._$ES = this._$EP());
}
C(t, e, { useDefault: i, reflect: r, wrapped: n }, o) {
i && !(this._$Ej ??= /* @__PURE__ */ new Map()).has(t) && (this._$Ej.set(t, o ?? e ?? this[t]), n !== !0 || o !== void 0) || (this._$AL.has(t) || (this.hasUpdated || i || (e = void 0), this._$AL.set(t, e)), r === !0 && this._$Em !== t && (this._$Eq ??= /* @__PURE__ */ new Set()).add(t));
C(e, t, { useDefault: s, reflect: i, wrapped: r }, o) {
s && !(this._$Ej ??= /* @__PURE__ */ new Map()).has(e) && (this._$Ej.set(e, o ?? t ?? this[e]), r !== !0 || o !== void 0) || (this._$AL.has(e) || (this.hasUpdated || s || (t = void 0), this._$AL.set(e, t)), i === !0 && this._$Em !== e && (this._$Eq ??= /* @__PURE__ */ new Set()).add(e));
}

@@ -206,7 +206,7 @@ async _$EP() {

await this._$ES;
} catch (e) {
Promise.reject(e);
} catch (t) {
Promise.reject(t);
}
let t = this.scheduleUpdate();
return t != null && await t, !this.isUpdatePending;
let e = this.scheduleUpdate();
return e != null && await e, !this.isUpdatePending;
}

@@ -220,23 +220,23 @@ scheduleUpdate() {

if (this.renderRoot ??= this.createRenderRoot(), this._$Ep) {
for (let [r, n] of this._$Ep) this[r] = n;
for (let [i, r] of this._$Ep) this[i] = r;
this._$Ep = void 0;
}
let i = this.constructor.elementProperties;
if (i.size > 0) for (let [r, n] of i) {
let { wrapped: o } = n, h = this[r];
o !== !0 || this._$AL.has(r) || h === void 0 || this.C(r, void 0, n, h);
let s = this.constructor.elementProperties;
if (s.size > 0) for (let [i, r] of s) {
let { wrapped: o } = r, n = this[i];
o !== !0 || this._$AL.has(i) || n === void 0 || this.C(i, void 0, r, n);
}
}
let t = !1, e = this._$AL;
let e = !1, t = this._$AL;
try {
t = this.shouldUpdate(e), t ? (this.willUpdate(e), this._$EO?.forEach((i) => i.hostUpdate?.()), this.update(e)) : this._$EM();
} catch (i) {
throw t = !1, this._$EM(), i;
e = this.shouldUpdate(t), e ? (this.willUpdate(t), this._$EO?.forEach((s) => s.hostUpdate?.()), this.update(t)) : this._$EM();
} catch (s) {
throw e = !1, this._$EM(), s;
}
t && this._$AE(e);
e && this._$AE(t);
}
willUpdate(t) {
willUpdate(e) {
}
_$AE(t) {
this._$EO?.forEach((e) => e.hostUpdated?.()), this.hasUpdated || (this.hasUpdated = !0, this.firstUpdated(t)), this.updated(t);
_$AE(e) {
this._$EO?.forEach((t) => t.hostUpdated?.()), this.hasUpdated || (this.hasUpdated = !0, this.firstUpdated(e)), this.updated(e);
}

@@ -252,53 +252,53 @@ _$EM() {

}
shouldUpdate(t) {
shouldUpdate(e) {
return !0;
}
update(t) {
this._$Eq &&= this._$Eq.forEach((e) => this._$ET(e, this[e])), this._$EM();
update(e) {
this._$Eq &&= this._$Eq.forEach((t) => this._$ET(t, this[t])), this._$EM();
}
updated(t) {
updated(e) {
}
firstUpdated(t) {
firstUpdated(e) {
}
};
E.elementStyles = [], E.shadowRootOptions = { mode: "open" }, E[P("elementProperties")] = /* @__PURE__ */ new Map(), E[P("finalized")] = /* @__PURE__ */ new Map(), Nt?.({ ReactiveElement: E }), (H.reactiveElementVersions ??= []).push("2.1.2");
var K = globalThis, rt = (s) => s, k = K.trustedTypes, nt = k ? k.createPolicy("lit-html", { createHTML: (s) => s }) : void 0, yt = "$lit$", f = `lit$${Math.random().toFixed(9).slice(2)}$`, vt = "?" + f, zt = `<${vt}>`, y = document, U = () => y.createComment(""), x = (s) => s === null || typeof s != "object" && typeof s != "function", V = Array.isArray, It = (s) => V(s) || typeof s?.[Symbol.iterator] == "function", z = `[
\f\r]`, S = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g, ot = /-->/g, ht = />/g, g = RegExp(`>|${z}(?:([^\\s"'>=/]+)(${z}*=${z}*(?:[^
\f\r"'\`<>=]|("|')|))|$)`, "g"), at = /'/g, lt = /"/g, Et = /^(?:script|style|textarea|title)$/i, b = Symbol.for("lit-noChange"), d = Symbol.for("lit-nothing"), ct = /* @__PURE__ */ new WeakMap(), m = y.createTreeWalker(y, 129);
function bt(s, t) {
if (!V(s) || !s.hasOwnProperty("raw")) throw Error("invalid template strings array");
return nt === void 0 ? t : nt.createHTML(t);
A.elementStyles = [], A.shadowRootOptions = { mode: "open" }, A[P("elementProperties")] = /* @__PURE__ */ new Map(), A[P("finalized")] = /* @__PURE__ */ new Map(), zt?.({ ReactiveElement: A }), (L.reactiveElementVersions ??= []).push("2.1.2");
var J = globalThis, rt = (e) => e, D = J.trustedTypes, ot = D ? D.createPolicy("lit-html", { createHTML: (e) => e }) : void 0, vt = "$lit$", f = `lit$${Math.random().toFixed(9).slice(2)}$`, At = "?" + f, It = `<${At}>`, y = document, x = () => y.createComment(""), R = (e) => e === null || typeof e != "object" && typeof e != "function", G = Array.isArray, qt = (e) => G(e) || typeof e?.[Symbol.iterator] == "function", I = `[
\f\r]`, C = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g, nt = /-->/g, at = />/g, g = RegExp(`>|${I}(?:([^\\s"'>=/]+)(${I}*=${I}*(?:[^
\f\r"'\`<>=]|("|')|))|$)`, "g"), ht = /'/g, lt = /"/g, Et = /^(?:script|style|textarea|title)$/i, E = Symbol.for("lit-noChange"), d = Symbol.for("lit-nothing"), ct = /* @__PURE__ */ new WeakMap(), m = y.createTreeWalker(y, 129);
function St(e, t) {
if (!G(e) || !e.hasOwnProperty("raw")) throw Error("invalid template strings array");
return ot === void 0 ? t : ot.createHTML(t);
}
var jt = (s, t) => {
let e = s.length - 1, i = [], r, n = t === 2 ? "<svg>" : t === 3 ? "<math>" : "", o = S;
for (let h = 0; h < e; h++) {
let a = s[h], $, c, l = -1, _ = 0;
for (; _ < a.length && (o.lastIndex = _, c = o.exec(a), c !== null); ) _ = o.lastIndex, o === S ? c[1] === "!--" ? o = ot : c[1] === void 0 ? c[2] === void 0 ? c[3] !== void 0 && (o = g) : (Et.test(c[2]) && (r = RegExp("</" + c[2], "g")), o = g) : o = ht : o === g ? c[0] === ">" ? (o = r ?? S, l = -1) : c[1] === void 0 ? l = -2 : (l = o.lastIndex - c[2].length, $ = c[1], o = c[3] === void 0 ? g : c[3] === '"' ? lt : at) : o === lt || o === at ? o = g : o === ot || o === ht ? o = S : (o = g, r = void 0);
let u = o === g && s[h + 1].startsWith("/>") ? " " : "";
n += o === S ? a + zt : l >= 0 ? (i.push($), a.slice(0, l) + yt + a.slice(l) + f + u) : a + f + (l === -2 ? h : u);
var Bt = (e, t) => {
let s = e.length - 1, i = [], r, o = t === 2 ? "<svg>" : t === 3 ? "<math>" : "", n = C;
for (let a = 0; a < s; a++) {
let h = e[a], $, c, l = -1, _ = 0;
for (; _ < h.length && (n.lastIndex = _, c = n.exec(h), c !== null); ) _ = n.lastIndex, n === C ? c[1] === "!--" ? n = nt : c[1] === void 0 ? c[2] === void 0 ? c[3] !== void 0 && (n = g) : (Et.test(c[2]) && (r = RegExp("</" + c[2], "g")), n = g) : n = at : n === g ? c[0] === ">" ? (n = r ?? C, l = -1) : c[1] === void 0 ? l = -2 : (l = n.lastIndex - c[2].length, $ = c[1], n = c[3] === void 0 ? g : c[3] === '"' ? lt : ht) : n === lt || n === ht ? n = g : n === nt || n === at ? n = C : (n = g, r = void 0);
let u = n === g && e[a + 1].startsWith("/>") ? " " : "";
o += n === C ? h + It : l >= 0 ? (i.push($), h.slice(0, l) + vt + h.slice(l) + f + u) : h + f + (l === -2 ? a : u);
}
return [bt(s, n + (s[e] || "<?>") + (t === 2 ? "</svg>" : t === 3 ? "</math>" : "")), i];
}, q = class At {
constructor({ strings: t, _$litType$: e }, i) {
return [St(e, o + (e[s] || "<?>") + (t === 2 ? "</svg>" : t === 3 ? "</math>" : "")), i];
}, W = class Ct {
constructor({ strings: t, _$litType$: s }, i) {
let r;
this.parts = [];
let n = 0, o = 0, h = t.length - 1, a = this.parts, [$, c] = jt(t, e);
if (this.el = At.createElement($, i), m.currentNode = this.el.content, e === 2 || e === 3) {
let o = 0, n = 0, a = t.length - 1, h = this.parts, [$, c] = Bt(t, s);
if (this.el = Ct.createElement($, i), m.currentNode = this.el.content, s === 2 || s === 3) {
let l = this.el.content.firstChild;
l.replaceWith(...l.childNodes);
}
for (; (r = m.nextNode()) !== null && a.length < h; ) {
for (; (r = m.nextNode()) !== null && h.length < a; ) {
if (r.nodeType === 1) {
if (r.hasAttributes()) for (let l of r.getAttributeNames()) if (l.endsWith(yt)) {
let _ = c[o++], u = r.getAttribute(l).split(f), v = /([.?@])?(.*)/.exec(_);
a.push({
if (r.hasAttributes()) for (let l of r.getAttributeNames()) if (l.endsWith(vt)) {
let _ = c[n++], u = r.getAttribute(l).split(f), v = /([.?@])?(.*)/.exec(_);
h.push({
type: 1,
index: n,
index: o,
name: v[2],
strings: u,
ctor: v[1] === "." ? Bt : v[1] === "?" ? Wt : v[1] === "@" ? Ft : D
ctor: v[1] === "." ? Vt : v[1] === "?" ? Kt : v[1] === "@" ? Ft : j
}), r.removeAttribute(l);
} else l.startsWith(f) && (a.push({
} else l.startsWith(f) && (h.push({
type: 6,
index: n
index: o
}), r.removeAttribute(l));

@@ -308,25 +308,25 @@ if (Et.test(r.tagName)) {

if (_ > 0) {
r.textContent = k ? k.emptyScript : "";
for (let u = 0; u < _; u++) r.append(l[u], U()), m.nextNode(), a.push({
r.textContent = D ? D.emptyScript : "";
for (let u = 0; u < _; u++) r.append(l[u], x()), m.nextNode(), h.push({
type: 2,
index: ++n
index: ++o
});
r.append(l[_], U());
r.append(l[_], x());
}
}
} else if (r.nodeType === 8) if (r.data === vt) a.push({
} else if (r.nodeType === 8) if (r.data === At) h.push({
type: 2,
index: n
index: o
});
else {
let l = -1;
for (; (l = r.data.indexOf(f, l + 1)) !== -1; ) a.push({
for (; (l = r.data.indexOf(f, l + 1)) !== -1; ) h.push({
type: 7,
index: n
index: o
}), l += f.length - 1;
}
n++;
o++;
}
}
static createElement(t, e) {
static createElement(t, s) {
let i = y.createElement("template");

@@ -336,10 +336,10 @@ return i.innerHTML = t, i;

};
function A(s, t, e = s, i) {
if (t === b) return t;
let r = i === void 0 ? e._$Cl : e._$Co?.[i], n = x(t) ? void 0 : t._$litDirective$;
return r?.constructor !== n && (r?._$AO?.(!1), n === void 0 ? r = void 0 : (r = new n(s), r._$AT(s, e, i)), i === void 0 ? e._$Cl = r : (e._$Co ??= [])[i] = r), r !== void 0 && (t = A(s, r._$AS(s, t.values), r, i)), t;
function S(e, t, s = e, i) {
if (t === E) return t;
let r = i === void 0 ? s._$Cl : s._$Co?.[i], o = R(t) ? void 0 : t._$litDirective$;
return r?.constructor !== o && (r?._$AO?.(!1), o === void 0 ? r = void 0 : (r = new o(e), r._$AT(e, s, i)), i === void 0 ? s._$Cl = r : (s._$Co ??= [])[i] = r), r !== void 0 && (t = S(e, r._$AS(e, t.values), r, i)), t;
}
var qt = class {
constructor(s, t) {
this._$AV = [], this._$AN = void 0, this._$AD = s, this._$AM = t;
var Wt = class {
constructor(e, t) {
this._$AV = [], this._$AN = void 0, this._$AD = e, this._$AM = t;
}

@@ -352,29 +352,29 @@ get parentNode() {

}
u(s) {
let { el: { content: t }, parts: e } = this._$AD, i = (s?.creationScope ?? y).importNode(t, !0);
u(e) {
let { el: { content: t }, parts: s } = this._$AD, i = (e?.creationScope ?? y).importNode(t, !0);
m.currentNode = i;
let r = m.nextNode(), n = 0, o = 0, h = e[0];
for (; h !== void 0; ) {
if (n === h.index) {
let a;
h.type === 2 ? a = new J(r, r.nextSibling, this, s) : h.type === 1 ? a = new h.ctor(r, h.name, h.strings, this, s) : h.type === 6 && (a = new Kt(r, this, s)), this._$AV.push(a), h = e[++o];
let r = m.nextNode(), o = 0, n = 0, a = s[0];
for (; a !== void 0; ) {
if (o === a.index) {
let h;
a.type === 2 ? h = new Z(r, r.nextSibling, this, e) : a.type === 1 ? h = new a.ctor(r, a.name, a.strings, this, e) : a.type === 6 && (h = new Jt(r, this, e)), this._$AV.push(h), a = s[++n];
}
n !== h?.index && (r = m.nextNode(), n++);
o !== a?.index && (r = m.nextNode(), o++);
}
return m.currentNode = y, i;
}
p(s) {
p(e) {
let t = 0;
for (let e of this._$AV) e !== void 0 && (e.strings === void 0 ? e._$AI(s[t]) : (e._$AI(s, e, t), t += e.strings.length - 2)), t++;
for (let s of this._$AV) s !== void 0 && (s.strings === void 0 ? s._$AI(e[t]) : (s._$AI(e, s, t), t += s.strings.length - 2)), t++;
}
}, J = class St {
}, Z = class wt {
get _$AU() {
return this._$AM?._$AU ?? this._$Cv;
}
constructor(t, e, i, r) {
this.type = 2, this._$AH = d, this._$AN = void 0, this._$AA = t, this._$AB = e, this._$AM = i, this.options = r, this._$Cv = r?.isConnected ?? !0;
constructor(t, s, i, r) {
this.type = 2, this._$AH = d, this._$AN = void 0, this._$AA = t, this._$AB = s, this._$AM = i, this.options = r, this._$Cv = r?.isConnected ?? !0;
}
get parentNode() {
let t = this._$AA.parentNode, e = this._$AM;
return e !== void 0 && t?.nodeType === 11 && (t = e.parentNode), t;
let t = this._$AA.parentNode, s = this._$AM;
return s !== void 0 && t?.nodeType === 11 && (t = s.parentNode), t;
}

@@ -387,4 +387,4 @@ get startNode() {

}
_$AI(t, e = this) {
t = A(this, t, e), x(t) ? t === d || t == null || t === "" ? (this._$AH !== d && this._$AR(), this._$AH = d) : t !== this._$AH && t !== b && this._(t) : t._$litType$ === void 0 ? t.nodeType === void 0 ? It(t) ? this.k(t) : this._(t) : this.T(t) : this.$(t);
_$AI(t, s = this) {
t = S(this, t, s), R(t) ? t === d || t == null || t === "" ? (this._$AH !== d && this._$AR(), this._$AH = d) : t !== this._$AH && t !== E && this._(t) : t._$litType$ === void 0 ? t.nodeType === void 0 ? qt(t) ? this.k(t) : this._(t) : this.T(t) : this.$(t);
}

@@ -398,24 +398,24 @@ O(t) {

_(t) {
this._$AH !== d && x(this._$AH) ? this._$AA.nextSibling.data = t : this.T(y.createTextNode(t)), this._$AH = t;
this._$AH !== d && R(this._$AH) ? this._$AA.nextSibling.data = t : this.T(y.createTextNode(t)), this._$AH = t;
}
$(t) {
let { values: e, _$litType$: i } = t, r = typeof i == "number" ? this._$AC(t) : (i.el === void 0 && (i.el = q.createElement(bt(i.h, i.h[0]), this.options)), i);
if (this._$AH?._$AD === r) this._$AH.p(e);
let { values: s, _$litType$: i } = t, r = typeof i == "number" ? this._$AC(t) : (i.el === void 0 && (i.el = W.createElement(St(i.h, i.h[0]), this.options)), i);
if (this._$AH?._$AD === r) this._$AH.p(s);
else {
let n = new qt(r, this), o = n.u(this.options);
n.p(e), this.T(o), this._$AH = n;
let o = new Wt(r, this), n = o.u(this.options);
o.p(s), this.T(n), this._$AH = o;
}
}
_$AC(t) {
let e = ct.get(t.strings);
return e === void 0 && ct.set(t.strings, e = new q(t)), e;
let s = ct.get(t.strings);
return s === void 0 && ct.set(t.strings, s = new W(t)), s;
}
k(t) {
V(this._$AH) || (this._$AH = [], this._$AR());
let e = this._$AH, i, r = 0;
for (let n of t) r === e.length ? e.push(i = new St(this.O(U()), this.O(U()), this, this.options)) : i = e[r], i._$AI(n), r++;
r < e.length && (this._$AR(i && i._$AB.nextSibling, r), e.length = r);
G(this._$AH) || (this._$AH = [], this._$AR());
let s = this._$AH, i, r = 0;
for (let o of t) r === s.length ? s.push(i = new wt(this.O(x()), this.O(x()), this, this.options)) : i = s[r], i._$AI(o), r++;
r < s.length && (this._$AR(i && i._$AB.nextSibling, r), s.length = r);
}
_$AR(t = this._$AA.nextSibling, e) {
for (this._$AP?.(!1, !0, e); t !== this._$AB; ) {
_$AR(t = this._$AA.nextSibling, s) {
for (this._$AP?.(!1, !0, s); t !== this._$AB; ) {
let i = rt(t).nextSibling;

@@ -428,3 +428,3 @@ rt(t).remove(), t = i;

}
}, D = class {
}, j = class {
get tagName() {

@@ -436,46 +436,46 @@ return this.element.tagName;

}
constructor(s, t, e, i, r) {
this.type = 1, this._$AH = d, this._$AN = void 0, this.element = s, this.name = t, this._$AM = i, this.options = r, e.length > 2 || e[0] !== "" || e[1] !== "" ? (this._$AH = Array(e.length - 1).fill(/* @__PURE__ */ new String()), this.strings = e) : this._$AH = d;
constructor(e, t, s, i, r) {
this.type = 1, this._$AH = d, this._$AN = void 0, this.element = e, this.name = t, this._$AM = i, this.options = r, s.length > 2 || s[0] !== "" || s[1] !== "" ? (this._$AH = Array(s.length - 1).fill(/* @__PURE__ */ new String()), this.strings = s) : this._$AH = d;
}
_$AI(s, t = this, e, i) {
let r = this.strings, n = !1;
if (r === void 0) s = A(this, s, t, 0), n = !x(s) || s !== this._$AH && s !== b, n && (this._$AH = s);
_$AI(e, t = this, s, i) {
let r = this.strings, o = !1;
if (r === void 0) e = S(this, e, t, 0), o = !R(e) || e !== this._$AH && e !== E, o && (this._$AH = e);
else {
let o = s, h, a;
for (s = r[0], h = 0; h < r.length - 1; h++) a = A(this, o[e + h], t, h), a === b && (a = this._$AH[h]), n ||= !x(a) || a !== this._$AH[h], a === d ? s = d : s !== d && (s += (a ?? "") + r[h + 1]), this._$AH[h] = a;
let n = e, a, h;
for (e = r[0], a = 0; a < r.length - 1; a++) h = S(this, n[s + a], t, a), h === E && (h = this._$AH[a]), o ||= !R(h) || h !== this._$AH[a], h === d ? e = d : e !== d && (e += (h ?? "") + r[a + 1]), this._$AH[a] = h;
}
n && !i && this.j(s);
o && !i && this.j(e);
}
j(s) {
s === d ? this.element.removeAttribute(this.name) : this.element.setAttribute(this.name, s ?? "");
j(e) {
e === d ? this.element.removeAttribute(this.name) : this.element.setAttribute(this.name, e ?? "");
}
}, Bt = class extends D {
}, Vt = class extends j {
constructor() {
super(...arguments), this.type = 3;
}
j(s) {
this.element[this.name] = s === d ? void 0 : s;
j(e) {
this.element[this.name] = e === d ? void 0 : e;
}
}, Wt = class extends D {
}, Kt = class extends j {
constructor() {
super(...arguments), this.type = 4;
}
j(s) {
this.element.toggleAttribute(this.name, !!s && s !== d);
j(e) {
this.element.toggleAttribute(this.name, !!e && e !== d);
}
}, Ft = class extends D {
constructor(s, t, e, i, r) {
super(s, t, e, i, r), this.type = 5;
}, Ft = class extends j {
constructor(e, t, s, i, r) {
super(e, t, s, i, r), this.type = 5;
}
_$AI(s, t = this) {
if ((s = A(this, s, t, 0) ?? d) === b) return;
let e = this._$AH, i = s === d && e !== d || s.capture !== e.capture || s.once !== e.once || s.passive !== e.passive, r = s !== d && (e === d || i);
i && this.element.removeEventListener(this.name, this, e), r && this.element.addEventListener(this.name, this, s), this._$AH = s;
_$AI(e, t = this) {
if ((e = S(this, e, t, 0) ?? d) === E) return;
let s = this._$AH, i = e === d && s !== d || e.capture !== s.capture || e.once !== s.once || e.passive !== s.passive, r = e !== d && (s === d || i);
i && this.element.removeEventListener(this.name, this, s), r && this.element.addEventListener(this.name, this, e), this._$AH = e;
}
handleEvent(s) {
typeof this._$AH == "function" ? this._$AH.call(this.options?.host ?? this.element, s) : this._$AH.handleEvent(s);
handleEvent(e) {
typeof this._$AH == "function" ? this._$AH.call(this.options?.host ?? this.element, e) : this._$AH.handleEvent(e);
}
}, Kt = class {
constructor(s, t, e) {
this.element = s, this.type = 6, this._$AN = void 0, this._$AM = t, this.options = e;
}, Jt = class {
constructor(e, t, s) {
this.element = e, this.type = 6, this._$AN = void 0, this._$AM = t, this.options = s;
}

@@ -485,15 +485,15 @@ get _$AU() {

}
_$AI(s) {
A(this, s);
_$AI(e) {
S(this, e);
}
}, Vt = K.litHtmlPolyfillSupport;
Vt?.(q, J), (K.litHtmlVersions ??= []).push("3.3.2");
var Jt = (s, t, e) => {
let i = e?.renderBefore ?? t, r = i._$litPart$;
}, Gt = J.litHtmlPolyfillSupport;
Gt?.(W, Z), (J.litHtmlVersions ??= []).push("3.3.2");
var Zt = (e, t, s) => {
let i = s?.renderBefore ?? t, r = i._$litPart$;
if (r === void 0) {
let n = e?.renderBefore ?? null;
i._$litPart$ = r = new J(t.insertBefore(U(), n), n, void 0, e ?? {});
let o = s?.renderBefore ?? null;
i._$litPart$ = r = new Z(t.insertBefore(x(), o), o, void 0, s ?? {});
}
return r._$AI(s), r;
}, G = globalThis, C = class extends E {
return r._$AI(e), r;
}, X = globalThis, U = class extends A {
constructor() {

@@ -503,8 +503,8 @@ super(...arguments), this.renderOptions = { host: this }, this._$Do = void 0;

createRenderRoot() {
let s = super.createRenderRoot();
return this.renderOptions.renderBefore ??= s.firstChild, s;
let e = super.createRenderRoot();
return this.renderOptions.renderBefore ??= e.firstChild, e;
}
update(s) {
update(e) {
let t = this.render();
this.hasUpdated || (this.renderOptions.isConnected = this.isConnected), super.update(s), this._$Do = Jt(t, this.renderRoot, this.renderOptions);
this.hasUpdated || (this.renderOptions.isConnected = this.isConnected), super.update(e), this._$Do = Zt(t, this.renderRoot, this.renderOptions);
}

@@ -518,40 +518,40 @@ connectedCallback() {

render() {
return b;
return E;
}
};
C._$litElement$ = !0, C.finalized = !0, G.litElementHydrateSupport?.({ LitElement: C });
var Gt = G.litElementPolyfillSupport;
Gt?.({ LitElement: C }), (G.litElementVersions ??= []).push("4.2.2");
U._$litElement$ = !0, U.finalized = !0, X.litElementHydrateSupport?.({ LitElement: U });
var Xt = X.litElementPolyfillSupport;
Xt?.({ LitElement: U }), (X.litElementVersions ??= []).push("4.2.2");
var p = [];
for (let s = 0; s < 256; ++s) p.push((s + 256).toString(16).slice(1));
function Zt(s, t = 0) {
return (p[s[t + 0]] + p[s[t + 1]] + p[s[t + 2]] + p[s[t + 3]] + "-" + p[s[t + 4]] + p[s[t + 5]] + "-" + p[s[t + 6]] + p[s[t + 7]] + "-" + p[s[t + 8]] + p[s[t + 9]] + "-" + p[s[t + 10]] + p[s[t + 11]] + p[s[t + 12]] + p[s[t + 13]] + p[s[t + 14]] + p[s[t + 15]]).toLowerCase();
for (let e = 0; e < 256; ++e) p.push((e + 256).toString(16).slice(1));
function Yt(e, t = 0) {
return (p[e[t + 0]] + p[e[t + 1]] + p[e[t + 2]] + p[e[t + 3]] + "-" + p[e[t + 4]] + p[e[t + 5]] + "-" + p[e[t + 6]] + p[e[t + 7]] + "-" + p[e[t + 8]] + p[e[t + 9]] + "-" + p[e[t + 10]] + p[e[t + 11]] + p[e[t + 12]] + p[e[t + 13]] + p[e[t + 14]] + p[e[t + 15]]).toLowerCase();
}
var I, Xt = new Uint8Array(16);
function Yt() {
if (!I) {
var q, Qt = new Uint8Array(16);
function te() {
if (!q) {
if (typeof crypto > "u" || !crypto.getRandomValues) throw Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");
I = crypto.getRandomValues.bind(crypto);
q = crypto.getRandomValues.bind(crypto);
}
return I(Xt);
return q(Qt);
}
var dt = { randomUUID: typeof crypto < "u" && crypto.randomUUID && crypto.randomUUID.bind(crypto) };
function Qt(s, t, e) {
s ||= {};
let i = s.random ?? s.rng?.() ?? Yt();
function ee(e, t, s) {
e ||= {};
let i = e.random ?? e.rng?.() ?? te();
if (i.length < 16) throw Error("Random bytes length must be >= 16");
return i[6] = i[6] & 15 | 64, i[8] = i[8] & 63 | 128, Zt(i);
return i[6] = i[6] & 15 | 64, i[8] = i[8] & 63 | 128, Yt(i);
}
function te(s, t, e) {
return dt.randomUUID && !t && !s ? dt.randomUUID() : Qt(s, t);
function se(e, t, s) {
return dt.randomUUID && !t && !e ? dt.randomUUID() : ee(e, t);
}
function ee(s = "hp") {
return `${s}-${te()}`;
function ie(e = "hp") {
return `${e}-${se()}`;
}
var Z = class extends C {
var k = class extends U {
createRenderRoot() {
return this;
}
emit(s, t) {
let e = new CustomEvent(`hp-${s}`, {
emit(e, t) {
let s = new CustomEvent(`hp-${e}`, {
detail: t,

@@ -562,51 +562,39 @@ bubbles: !0,

});
return this.dispatchEvent(e), e;
return this.dispatchEvent(s), s;
}
_hpId = ee();
_hpId = ie();
get hpId() {
return this._hpId;
}
_abortController = null;
get signal() {
return (!this._abortController || this._abortController.signal.aborted) && (this._abortController = new AbortController()), this._abortController.signal;
}
connectedCallback() {
super.connectedCallback(), (!this._abortController || this._abortController.signal.aborted) && (this._abortController = new AbortController());
}
disconnectedCallback() {
super.disconnectedCallback(), this._abortController?.abort(), this._abortController = null;
}
};
function X(s) {
function M(e) {
return function(t) {
typeof window < "u" && (customElements.get(s) || customElements.define(s, t));
typeof window < "u" && (customElements.get(e) || customElements.define(e, t));
};
}
var se = class {
_container;
_active = !1;
_previouslyFocusedElement = null;
_focusableElements = [];
constructor(s) {
this._container = s;
function re(e) {
let t = [], s = e.parentElement;
for (; s; ) {
let { overflow: i, overflowY: r, overflowX: o } = getComputedStyle(s);
/auto|scroll|overlay/.test(i + r + o) && t.push(s), s = s.parentElement;
}
activate() {
this._active || (this._active = !0, this._previouslyFocusedElement = document.activeElement, this._updateFocusableElements(), this._focusableElements.length > 0 && this._focusableElements[0].focus(), document.addEventListener("focusin", this._handleFocusIn), document.addEventListener("keydown", this._handleKeyDown));
}
deactivate() {
this._active && (this._active = !1, document.removeEventListener("focusin", this._handleFocusIn), document.removeEventListener("keydown", this._handleKeyDown), this._previouslyFocusedElement && this._previouslyFocusedElement.focus());
}
_updateFocusableElements() {
this._focusableElements = Array.from(this._container.querySelectorAll([
"a[href]",
"button:not([disabled])",
"textarea:not([disabled])",
"input:not([disabled])",
"select:not([disabled])",
"[tabindex]:not([tabindex='-1'])",
"[contenteditable='true']"
].join(", ")));
}
_handleFocusIn = (s) => {
if (!this._active) return;
let t = s.target;
this._container.contains(t) || this._focusableElements.length > 0 && this._focusableElements[0].focus();
return t.push(window), t;
}
function oe(e, t) {
if (t.aborted) return;
let s = 0, i = () => {
t.aborted || (e(), s = requestAnimationFrame(i));
};
_handleKeyDown = (s) => {
if (!this._active || s.key !== "Tab") return;
s.preventDefault();
let t = this._focusableElements.indexOf(document.activeElement), e;
e = s.shiftKey ? t > 0 ? t - 1 : this._focusableElements.length - 1 : t < this._focusableElements.length - 1 ? t + 1 : 0, this._focusableElements[e].focus();
};
};
s = requestAnimationFrame(i), t.addEventListener("abort", () => cancelAnimationFrame(s), { once: !0 });
}
/**

@@ -617,14 +605,14 @@ * @license

*/
const T = globalThis, Y = T.ShadowRoot && (T.ShadyCSS === void 0 || T.ShadyCSS.nativeShadow) && "adoptedStyleSheets" in Document.prototype && "replace" in CSSStyleSheet.prototype, wt = Symbol(), pt = /* @__PURE__ */ new WeakMap();
let ie = class {
constructor(t, e, i) {
if (this._$cssResult$ = !0, i !== wt) throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");
this.cssText = t, this.t = e;
const H = globalThis, Y = H.ShadowRoot && (H.ShadyCSS === void 0 || H.ShadyCSS.nativeShadow) && "adoptedStyleSheets" in Document.prototype && "replace" in CSSStyleSheet.prototype, Pt = Symbol(), pt = /* @__PURE__ */ new WeakMap();
let ne = class {
constructor(t, s, i) {
if (this._$cssResult$ = !0, i !== Pt) throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");
this.cssText = t, this.t = s;
}
get styleSheet() {
let t = this.o;
const e = this.t;
const s = this.t;
if (Y && t === void 0) {
const i = e !== void 0 && e.length === 1;
i && (t = pt.get(e)), t === void 0 && ((this.o = t = new CSSStyleSheet()).replaceSync(this.cssText), i && pt.set(e, t));
const i = s !== void 0 && s.length === 1;
i && (t = pt.get(s)), t === void 0 && ((this.o = t = new CSSStyleSheet()).replaceSync(this.cssText), i && pt.set(s, t));
}

@@ -637,13 +625,13 @@ return t;

};
const re = (s) => new ie(typeof s == "string" ? s : s + "", void 0, wt), ne = (s, t) => {
if (Y) s.adoptedStyleSheets = t.map((e) => e instanceof CSSStyleSheet ? e : e.styleSheet);
else for (const e of t) {
const i = document.createElement("style"), r = T.litNonce;
r !== void 0 && i.setAttribute("nonce", r), i.textContent = e.cssText, s.appendChild(i);
const ae = (e) => new ne(typeof e == "string" ? e : e + "", void 0, Pt), he = (e, t) => {
if (Y) e.adoptedStyleSheets = t.map((s) => s instanceof CSSStyleSheet ? s : s.styleSheet);
else for (const s of t) {
const i = document.createElement("style"), r = H.litNonce;
r !== void 0 && i.setAttribute("nonce", r), i.textContent = s.cssText, e.appendChild(i);
}
}, ut = Y ? (s) => s : (s) => s instanceof CSSStyleSheet ? ((t) => {
let e = "";
for (const i of t.cssRules) e += i.cssText;
return re(e);
})(s) : s;
}, ut = Y ? (e) => e : (e) => e instanceof CSSStyleSheet ? ((t) => {
let s = "";
for (const i of t.cssRules) s += i.cssText;
return ae(s);
})(e) : e;
/**

@@ -654,20 +642,20 @@ * @license

*/
const { is: oe, defineProperty: he, getOwnPropertyDescriptor: ae, getOwnPropertyNames: le, getOwnPropertySymbols: ce, getPrototypeOf: de } = Object, N = globalThis, _t = N.trustedTypes, pe = _t ? _t.emptyScript : "", ue = N.reactiveElementPolyfillSupport, O = (s, t) => s, L = { toAttribute(s, t) {
const { is: le, defineProperty: ce, getOwnPropertyDescriptor: de, getOwnPropertyNames: pe, getOwnPropertySymbols: ue, getPrototypeOf: _e } = Object, z = globalThis, _t = z.trustedTypes, fe = _t ? _t.emptyScript : "", $e = z.reactiveElementPolyfillSupport, O = (e, t) => e, N = { toAttribute(e, t) {
switch (t) {
case Boolean:
s = s ? pe : null;
e = e ? fe : null;
break;
case Object:
case Array:
s = s == null ? s : JSON.stringify(s);
e = e == null ? e : JSON.stringify(e);
}
return s;
}, fromAttribute(s, t) {
let e = s;
return e;
}, fromAttribute(e, t) {
let s = e;
switch (t) {
case Boolean:
e = s !== null;
s = e !== null;
break;
case Number:
e = s === null ? null : Number(s);
s = e === null ? null : Number(e);
break;

@@ -677,10 +665,10 @@ case Object:

try {
e = JSON.parse(s);
s = JSON.parse(e);
} catch {
e = null;
s = null;
}
}
return e;
} }, Q = (s, t) => !oe(s, t), ft = { attribute: !0, type: String, converter: L, reflect: !1, useDefault: !1, hasChanged: Q };
Symbol.metadata ??= Symbol("metadata"), N.litPropertyMetadata ??= /* @__PURE__ */ new WeakMap();
return s;
} }, Q = (e, t) => !le(e, t), ft = { attribute: !0, type: String, converter: N, reflect: !1, useDefault: !1, hasChanged: Q };
Symbol.metadata ??= Symbol("metadata"), z.litPropertyMetadata ??= /* @__PURE__ */ new WeakMap();
class w extends HTMLElement {

@@ -693,17 +681,17 @@ static addInitializer(t) {

}
static createProperty(t, e = ft) {
if (e.state && (e.attribute = !1), this._$Ei(), this.prototype.hasOwnProperty(t) && ((e = Object.create(e)).wrapped = !0), this.elementProperties.set(t, e), !e.noAccessor) {
const i = Symbol(), r = this.getPropertyDescriptor(t, i, e);
r !== void 0 && he(this.prototype, t, r);
static createProperty(t, s = ft) {
if (s.state && (s.attribute = !1), this._$Ei(), this.prototype.hasOwnProperty(t) && ((s = Object.create(s)).wrapped = !0), this.elementProperties.set(t, s), !s.noAccessor) {
const i = Symbol(), r = this.getPropertyDescriptor(t, i, s);
r !== void 0 && ce(this.prototype, t, r);
}
}
static getPropertyDescriptor(t, e, i) {
const { get: r, set: n } = ae(this.prototype, t) ?? { get() {
return this[e];
}, set(o) {
this[e] = o;
static getPropertyDescriptor(t, s, i) {
const { get: r, set: o } = de(this.prototype, t) ?? { get() {
return this[s];
}, set(n) {
this[s] = n;
} };
return { get: r, set(o) {
const h = r?.call(this);
n?.call(this, o), this.requestUpdate(t, h, i);
return { get: r, set(n) {
const a = r?.call(this);
o?.call(this, n), this.requestUpdate(t, a, i);
}, configurable: !0, enumerable: !0 };

@@ -716,3 +704,3 @@ }

if (this.hasOwnProperty(O("elementProperties"))) return;
const t = de(this);
const t = _e(this);
t.finalize(), t.l !== void 0 && (this.l = [...t.l]), this.elementProperties = new Map(t.elementProperties);

@@ -723,14 +711,14 @@ }

if (this.finalized = !0, this._$Ei(), this.hasOwnProperty(O("properties"))) {
const e = this.properties, i = [...le(e), ...ce(e)];
for (const r of i) this.createProperty(r, e[r]);
const s = this.properties, i = [...pe(s), ...ue(s)];
for (const r of i) this.createProperty(r, s[r]);
}
const t = this[Symbol.metadata];
if (t !== null) {
const e = litPropertyMetadata.get(t);
if (e !== void 0) for (const [i, r] of e) this.elementProperties.set(i, r);
const s = litPropertyMetadata.get(t);
if (s !== void 0) for (const [i, r] of s) this.elementProperties.set(i, r);
}
this._$Eh = /* @__PURE__ */ new Map();
for (const [e, i] of this.elementProperties) {
const r = this._$Eu(e, i);
r !== void 0 && this._$Eh.set(r, e);
for (const [s, i] of this.elementProperties) {
const r = this._$Eu(s, i);
r !== void 0 && this._$Eh.set(r, s);
}

@@ -740,11 +728,11 @@ this.elementStyles = this.finalizeStyles(this.styles);

static finalizeStyles(t) {
const e = [];
const s = [];
if (Array.isArray(t)) {
const i = new Set(t.flat(1 / 0).reverse());
for (const r of i) e.unshift(ut(r));
} else t !== void 0 && e.push(ut(t));
return e;
for (const r of i) s.unshift(ut(r));
} else t !== void 0 && s.push(ut(t));
return s;
}
static _$Eu(t, e) {
const i = e.attribute;
static _$Eu(t, s) {
const i = s.attribute;
return i === !1 ? void 0 : typeof i == "string" ? i : typeof t == "string" ? t.toLowerCase() : void 0;

@@ -765,4 +753,4 @@ }

_$E_() {
const t = /* @__PURE__ */ new Map(), e = this.constructor.elementProperties;
for (const i of e.keys()) this.hasOwnProperty(i) && (t.set(i, this[i]), delete this[i]);
const t = /* @__PURE__ */ new Map(), s = this.constructor.elementProperties;
for (const i of s.keys()) this.hasOwnProperty(i) && (t.set(i, this[i]), delete this[i]);
t.size > 0 && (this._$Ep = t);

@@ -772,3 +760,3 @@ }

const t = this.shadowRoot ?? this.attachShadow(this.constructor.shadowRootOptions);
return ne(t, this.constructor.elementStyles), t;
return he(t, this.constructor.elementStyles), t;
}

@@ -783,31 +771,31 @@ connectedCallback() {

}
attributeChangedCallback(t, e, i) {
attributeChangedCallback(t, s, i) {
this._$AK(t, i);
}
_$ET(t, e) {
_$ET(t, s) {
const i = this.constructor.elementProperties.get(t), r = this.constructor._$Eu(t, i);
if (r !== void 0 && i.reflect === !0) {
const n = (i.converter?.toAttribute !== void 0 ? i.converter : L).toAttribute(e, i.type);
this._$Em = t, n == null ? this.removeAttribute(r) : this.setAttribute(r, n), this._$Em = null;
const o = (i.converter?.toAttribute !== void 0 ? i.converter : N).toAttribute(s, i.type);
this._$Em = t, o == null ? this.removeAttribute(r) : this.setAttribute(r, o), this._$Em = null;
}
}
_$AK(t, e) {
_$AK(t, s) {
const i = this.constructor, r = i._$Eh.get(t);
if (r !== void 0 && this._$Em !== r) {
const n = i.getPropertyOptions(r), o = typeof n.converter == "function" ? { fromAttribute: n.converter } : n.converter?.fromAttribute !== void 0 ? n.converter : L;
const o = i.getPropertyOptions(r), n = typeof o.converter == "function" ? { fromAttribute: o.converter } : o.converter?.fromAttribute !== void 0 ? o.converter : N;
this._$Em = r;
const h = o.fromAttribute(e, n.type);
this[r] = h ?? this._$Ej?.get(r) ?? h, this._$Em = null;
const a = n.fromAttribute(s, o.type);
this[r] = a ?? this._$Ej?.get(r) ?? a, this._$Em = null;
}
}
requestUpdate(t, e, i, r = !1, n) {
requestUpdate(t, s, i, r = !1, o) {
if (t !== void 0) {
const o = this.constructor;
if (r === !1 && (n = this[t]), i ??= o.getPropertyOptions(t), !((i.hasChanged ?? Q)(n, e) || i.useDefault && i.reflect && n === this._$Ej?.get(t) && !this.hasAttribute(o._$Eu(t, i)))) return;
this.C(t, e, i);
const n = this.constructor;
if (r === !1 && (o = this[t]), i ??= n.getPropertyOptions(t), !((i.hasChanged ?? Q)(o, s) || i.useDefault && i.reflect && o === this._$Ej?.get(t) && !this.hasAttribute(n._$Eu(t, i)))) return;
this.C(t, s, i);
}
this.isUpdatePending === !1 && (this._$ES = this._$EP());
}
C(t, e, { useDefault: i, reflect: r, wrapped: n }, o) {
i && !(this._$Ej ??= /* @__PURE__ */ new Map()).has(t) && (this._$Ej.set(t, o ?? e ?? this[t]), n !== !0 || o !== void 0) || (this._$AL.has(t) || (this.hasUpdated || i || (e = void 0), this._$AL.set(t, e)), r === !0 && this._$Em !== t && (this._$Eq ??= /* @__PURE__ */ new Set()).add(t));
C(t, s, { useDefault: i, reflect: r, wrapped: o }, n) {
i && !(this._$Ej ??= /* @__PURE__ */ new Map()).has(t) && (this._$Ej.set(t, n ?? s ?? this[t]), o !== !0 || n !== void 0) || (this._$AL.has(t) || (this.hasUpdated || i || (s = void 0), this._$AL.set(t, s)), r === !0 && this._$Em !== t && (this._$Eq ??= /* @__PURE__ */ new Set()).add(t));
}

@@ -818,4 +806,4 @@ async _$EP() {

await this._$ES;
} catch (e) {
Promise.reject(e);
} catch (s) {
Promise.reject(s);
}

@@ -832,19 +820,19 @@ const t = this.scheduleUpdate();

if (this.renderRoot ??= this.createRenderRoot(), this._$Ep) {
for (const [r, n] of this._$Ep) this[r] = n;
for (const [r, o] of this._$Ep) this[r] = o;
this._$Ep = void 0;
}
const i = this.constructor.elementProperties;
if (i.size > 0) for (const [r, n] of i) {
const { wrapped: o } = n, h = this[r];
o !== !0 || this._$AL.has(r) || h === void 0 || this.C(r, void 0, n, h);
if (i.size > 0) for (const [r, o] of i) {
const { wrapped: n } = o, a = this[r];
n !== !0 || this._$AL.has(r) || a === void 0 || this.C(r, void 0, o, a);
}
}
let t = !1;
const e = this._$AL;
const s = this._$AL;
try {
t = this.shouldUpdate(e), t ? (this.willUpdate(e), this._$EO?.forEach((i) => i.hostUpdate?.()), this.update(e)) : this._$EM();
t = this.shouldUpdate(s), t ? (this.willUpdate(s), this._$EO?.forEach((i) => i.hostUpdate?.()), this.update(s)) : this._$EM();
} catch (i) {
throw t = !1, this._$EM(), i;
}
t && this._$AE(e);
t && this._$AE(s);
}

@@ -854,3 +842,3 @@ willUpdate(t) {

_$AE(t) {
this._$EO?.forEach((e) => e.hostUpdated?.()), this.hasUpdated || (this.hasUpdated = !0, this.firstUpdated(t)), this.updated(t);
this._$EO?.forEach((s) => s.hostUpdated?.()), this.hasUpdated || (this.hasUpdated = !0, this.firstUpdated(t)), this.updated(t);
}

@@ -870,3 +858,3 @@ _$EM() {

update(t) {
this._$Eq &&= this._$Eq.forEach((e) => this._$ET(e, this[e])), this._$EM();
this._$Eq &&= this._$Eq.forEach((s) => this._$ET(s, this[s])), this._$EM();
}

@@ -878,3 +866,3 @@ updated(t) {

}
w.elementStyles = [], w.shadowRootOptions = { mode: "open" }, w[O("elementProperties")] = /* @__PURE__ */ new Map(), w[O("finalized")] = /* @__PURE__ */ new Map(), ue?.({ ReactiveElement: w }), (N.reactiveElementVersions ??= []).push("2.1.2");
w.elementStyles = [], w.shadowRootOptions = { mode: "open" }, w[O("elementProperties")] = /* @__PURE__ */ new Map(), w[O("finalized")] = /* @__PURE__ */ new Map(), $e?.({ ReactiveElement: w }), (z.reactiveElementVersions ??= []).push("2.1.2");
/**

@@ -885,19 +873,19 @@ * @license

*/
const _e = { attribute: !0, type: String, converter: L, reflect: !1, hasChanged: Q }, fe = (s = _e, t, e) => {
const { kind: i, metadata: r } = e;
let n = globalThis.litPropertyMetadata.get(r);
if (n === void 0 && globalThis.litPropertyMetadata.set(r, n = /* @__PURE__ */ new Map()), i === "setter" && ((s = Object.create(s)).wrapped = !0), n.set(e.name, s), i === "accessor") {
const { name: o } = e;
return { set(h) {
const a = t.get.call(this);
t.set.call(this, h), this.requestUpdate(o, a, s, !0, h);
}, init(h) {
return h !== void 0 && this.C(o, void 0, s, h), h;
const ge = { attribute: !0, type: String, converter: N, reflect: !1, hasChanged: Q }, me = (e = ge, t, s) => {
const { kind: i, metadata: r } = s;
let o = globalThis.litPropertyMetadata.get(r);
if (o === void 0 && globalThis.litPropertyMetadata.set(r, o = /* @__PURE__ */ new Map()), i === "setter" && ((e = Object.create(e)).wrapped = !0), o.set(s.name, e), i === "accessor") {
const { name: n } = s;
return { set(a) {
const h = t.get.call(this);
t.set.call(this, a), this.requestUpdate(n, h, e, !0, a);
}, init(a) {
return a !== void 0 && this.C(n, void 0, e, a), a;
} };
}
if (i === "setter") {
const { name: o } = e;
return function(h) {
const a = this[o];
t.call(this, h), this.requestUpdate(o, a, s, !0, h);
const { name: n } = s;
return function(a) {
const h = this[n];
t.call(this, a), this.requestUpdate(n, h, e, !0, a);
};

@@ -907,14 +895,14 @@ }

};
function Pt(s) {
return (t, e) => typeof e == "object" ? fe(s, t, e) : ((i, r, n) => {
const o = r.hasOwnProperty(n);
return r.constructor.createProperty(n, i), o ? Object.getOwnPropertyDescriptor(r, n) : void 0;
})(s, t, e);
function Ut(e) {
return (t, s) => typeof s == "object" ? me(e, t, s) : ((i, r, o) => {
const n = r.hasOwnProperty(o);
return r.constructor.createProperty(o, i), n ? Object.getOwnPropertyDescriptor(r, o) : void 0;
})(e, t, s);
}
var $e = Object.defineProperty, ge = Object.getOwnPropertyDescriptor, R = (s, t, e, i) => {
for (var r = i > 1 ? void 0 : i ? ge(t, e) : t, n = s.length - 1, o; n >= 0; n--)
(o = s[n]) && (r = (i ? o(t, e, r) : o(r)) || r);
return i && r && $e(t, e, r), r;
var ye = Object.defineProperty, be = Object.getOwnPropertyDescriptor, b = (e, t, s, i) => {
for (var r = i > 1 ? void 0 : i ? be(t, s) : t, o = e.length - 1, n; o >= 0; o--)
(n = e[o]) && (r = (i ? n(t, s, r) : n(r)) || r);
return i && r && ye(t, s, r), r;
};
let B = class extends Z {
let V = class extends k {
align = "start";

@@ -924,47 +912,28 @@ _trigger = null;

_isOpen = !1;
_focusTrap = null;
_rafId = null;
_scrollParents = [];
_openController = null;
connectedCallback() {
super.connectedCallback(), this.setAttribute("data-hp-component", "popover"), this._trigger = this.querySelector("hp-popover-trigger"), this._content = this.querySelector("hp-popover-content"), this._trigger && this._content && (this._setupTrigger(), this._setupContent(), this._focusTrap = new se(this._content));
super.connectedCallback(), this.setAttribute("data-hp-component", "popover"), this._trigger = this.querySelector("hp-popover-trigger"), this._content = this.querySelector("hp-popover-content"), this._trigger && this._content && (this._setupTrigger(), this._setupContent());
}
disconnectedCallback() {
super.disconnectedCallback(), this._removeGlobalListeners();
super.disconnectedCallback(), this._openController?.abort(), this._openController = null, this._scrollParents = [];
}
_setupTrigger() {
this._trigger && (this._trigger.setAttribute("data-hp-component", "popover-trigger"), !this._trigger.hasAttribute("tabindex") && !this._trigger.hasAttribute("disabled") && this._trigger.setAttribute("tabindex", "0"), this._trigger.addEventListener("click", this._handleTriggerClick));
this._trigger && (this._trigger.setAttribute("data-hp-component", "popover-trigger"), this._trigger.setAttribute("aria-haspopup", "dialog"), !this._trigger.hasAttribute("tabindex") && !this._trigger.hasAttribute("disabled") && this._trigger.setAttribute("tabindex", "0"), this._trigger.addEventListener("click", this._handleTriggerClick));
}
_setupContent() {
this._content && (this._content.setAttribute("role", "dialog"), this._content.setAttribute("aria-modal", "false"), this._content.setAttribute("data-hp-overlay-content", ""), this._content.setAttribute("data-state", "closed"), this._content.setAttribute("aria-hidden", "true"), this.style.position = "relative");
this._content && (this._content.setAttribute("role", "dialog"), this._content.setAttribute("data-hp-overlay-content", ""), this._content.setAttribute("data-state", "closed"), this._content.setAttribute("aria-hidden", "true"), this.style.position = "relative");
}
_getScrollParents(s) {
const t = [];
let e = s.parentElement;
for (; e; ) {
const { overflow: i, overflowY: r, overflowX: n } = getComputedStyle(e);
/auto|scroll|overlay/.test(i + r + n) && t.push(e), e = e.parentElement;
}
return t.push(window), t;
}
_computePosition() {
if (!this._trigger || !this._content) return;
const s = 8, t = this.getBoundingClientRect(), e = this._trigger.getBoundingClientRect(), i = e.left - t.left, r = e.top - t.top, n = e.width, o = e.height, h = this._content.offsetWidth || 0, a = this._content.offsetHeight || 0;
let $ = r + o + s, c = "bottom";
const l = window.innerHeight - e.bottom, _ = e.top;
a > 0 && l < a + s && _ > a + s && ($ = r - a - s, c = "top");
let u = this.align === "end" ? i + n - h : i;
const v = s - t.left, Ct = window.innerWidth - h - s - t.left;
u = Math.max(v, Math.min(u, Ct)), this._content.style.top = `${$}px`, this._content.style.left = `${u}px`, this._content.setAttribute("data-side", c), this._content.setAttribute("data-align", this.align);
const e = 8, t = this.getBoundingClientRect(), s = this._trigger.getBoundingClientRect(), i = s.left - t.left, r = s.top - t.top, o = s.width, n = s.height, a = this._content.offsetWidth || 0, h = this._content.offsetHeight || 0;
let $ = r + n + e, c = "bottom";
const l = window.innerHeight - s.bottom, _ = s.top;
h > 0 && l < h + e && _ > h + e && ($ = r - h - e, c = "top");
let u = this.align === "end" ? i + o - a : i;
const v = e - t.left, Ot = window.innerWidth - a - e - t.left;
u = Math.max(v, Math.min(u, Ot)), this._content.style.top = `${$}px`, this._content.style.left = `${u}px`, this._content.setAttribute("data-side", c), this._content.setAttribute("data-align", this.align);
}
_startPositionLoop() {
const s = () => {
this._isOpen && (this._computePosition(), this._rafId = requestAnimationFrame(s));
};
this._rafId = requestAnimationFrame(s);
}
_stopPositionLoop() {
this._rafId !== null && (cancelAnimationFrame(this._rafId), this._rafId = null);
}
_handleTriggerClick = (s) => {
s.stopPropagation(), this._toggle();
_handleTriggerClick = (e) => {
e.stopPropagation(), this._toggle();
};

@@ -975,29 +944,31 @@ _toggle = () => {

_open() {
if (!this._isOpen) {
if (this._isOpen = !0, this._content && (this._content.setAttribute("data-state", "open"), this._content.setAttribute("aria-hidden", "false")), this._computePosition(), this._startPositionLoop(), this._trigger && this._content && (this._trigger.setAttribute("aria-expanded", "true"), this._trigger.setAttribute("aria-controls", this._content.id || "")), document.addEventListener("click", this._handleClickOutside), document.addEventListener("keydown", this._handleEscape), this._trigger) {
this._scrollParents = this._getScrollParents(this._trigger);
for (const s of this._scrollParents)
s.addEventListener("scroll", this._handleScrollOrResize, {
passive: !0
});
}
window.addEventListener("resize", this._handleScrollOrResize, { passive: !0 }), this._focusTrap?.activate(), this.emit("open");
if (this._isOpen) return;
this._isOpen = !0, this._content && (this._content.setAttribute("data-state", "open"), this._content.setAttribute("aria-hidden", "false")), this._computePosition(), this._trigger && this._content && (this._trigger.setAttribute("aria-expanded", "true"), this._trigger.setAttribute("aria-controls", this._content.id || "")), this._openController?.abort(), this._openController = new AbortController();
const e = this._openController.signal;
if (oe(() => this._computePosition(), e), document.addEventListener("click", this._handleClickOutside, { signal: e }), document.addEventListener("keydown", this._handleEscape, { signal: e }), this._trigger) {
this._scrollParents = re(this._trigger);
for (const t of this._scrollParents)
t.addEventListener("scroll", this._handleScrollOrResize, {
signal: e,
passive: !0
});
}
window.addEventListener("resize", this._handleScrollOrResize, {
signal: e,
passive: !0
}), this.emit("open");
}
_close() {
this._isOpen && (this._isOpen = !1, this._stopPositionLoop(), this._content && (this._content.setAttribute("data-state", "closed"), this._content.setAttribute("aria-hidden", "true")), this._trigger && (this._trigger.setAttribute("aria-expanded", "false"), this._trigger.removeAttribute("aria-controls")), this._removeGlobalListeners(), this._focusTrap?.deactivate(), this.emit("close"));
this._isOpen && (this._isOpen = !1, this._content && (this._content.setAttribute("data-state", "closed"), this._content.setAttribute("aria-hidden", "true")), this._trigger && (this._trigger.setAttribute("aria-expanded", "false"), this._trigger.removeAttribute("aria-controls")), this._removeGlobalListeners(), this.emit("close"));
}
_removeGlobalListeners() {
document.removeEventListener("click", this._handleClickOutside), document.removeEventListener("keydown", this._handleEscape);
for (const s of this._scrollParents)
s.removeEventListener("scroll", this._handleScrollOrResize);
this._scrollParents = [], window.removeEventListener("resize", this._handleScrollOrResize);
this._openController?.abort(), this._openController = null, this._scrollParents = [];
}
_handleClickOutside = (s) => {
_handleClickOutside = (e) => {
if (!this._isOpen) return;
const t = s.target;
const t = e.target;
this._trigger && this._content && !this._trigger.contains(t) && !this._content.contains(t) && this._close();
};
_handleEscape = (s) => {
s.key === "Escape" && this._isOpen && (s.preventDefault(), this._close());
_handleEscape = (e) => {
e.key === "Escape" && this._isOpen && (e.preventDefault(), this._close());
};

@@ -1018,9 +989,9 @@ _handleScrollOrResize = () => {

};
R([
Pt({ type: String, reflect: !0 })
], B.prototype, "align", 2);
B = R([
X("hp-popover")
], B);
let W = class extends Z {
b([
Ut({ type: String, reflect: !0 })
], V.prototype, "align", 2);
V = b([
M("hp-popover")
], V);
let K = class extends k {
disabled = !1;

@@ -1033,24 +1004,48 @@ connectedCallback() {

}
_handleKeyDown = (s) => {
(s.key === "Enter" || s.key === " ") && (s.preventDefault(), this.click());
_handleKeyDown = (e) => {
(e.key === "Enter" || e.key === " ") && (e.preventDefault(), this.click());
};
};
R([
Pt({ type: Boolean, reflect: !0 })
], W.prototype, "disabled", 2);
W = R([
X("hp-popover-trigger")
], W);
let $t = class extends Z {
b([
Ut({ type: Boolean, reflect: !0 })
], K.prototype, "disabled", 2);
K = b([
M("hp-popover-trigger")
], K);
let $t = class extends k {
connectedCallback() {
super.connectedCallback(), this.setAttribute("data-hp-component", "popover-content"), this.id || (this.id = `hp-popover-content-${this.hpId}`);
super.connectedCallback(), this.setAttribute("data-hp-component", "popover-content"), this.id || (this.id = `hp-popover-content-${this.hpId}`), this._linkAria(), requestAnimationFrame(() => this._linkAria());
}
_linkAria() {
const e = this.closest("hp-popover");
if (!e) return;
const t = e.querySelector("hp-popover-title"), s = e.querySelector("hp-popover-description");
t?.id ? this.setAttribute("aria-labelledby", t.id) : this.removeAttribute("aria-labelledby"), s?.id ? this.setAttribute("aria-describedby", s.id) : this.removeAttribute("aria-describedby");
}
};
$t = R([
X("hp-popover-content")
$t = b([
M("hp-popover-content")
], $t);
let gt = class extends k {
connectedCallback() {
super.connectedCallback(), this.setAttribute("data-hp-component", "popover-title"), this.id || (this.id = `hp-popover-title-${this.hpId}`);
}
};
gt = b([
M("hp-popover-title")
], gt);
let mt = class extends k {
connectedCallback() {
super.connectedCallback(), this.setAttribute("data-hp-component", "popover-description"), this.id || (this.id = `hp-popover-description-${this.hpId}`);
}
};
mt = b([
M("hp-popover-description")
], mt);
export {
B as HeadlessPopover,
V as HeadlessPopover,
$t as HeadlessPopoverContent,
W as HeadlessPopoverTrigger
mt as HeadlessPopoverDescription,
gt as HeadlessPopoverTitle,
K as HeadlessPopoverTrigger
};

@@ -1,15 +0,15 @@

(function(u,$){typeof exports=="object"&&typeof module<"u"?$(exports):typeof define=="function"&&define.amd?define(["exports"],$):(u=typeof globalThis<"u"?globalThis:u||self,$(u.HeadlessPrimitivesPopover={}))})(this,function(u){"use strict";var $=globalThis,z=$.ShadowRoot&&($.ShadyCSS===void 0||$.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,Q=Symbol(),tt=new WeakMap,wt=class{constructor(t,e,i){if(this._$cssResult$=!0,i!==Q)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=e}get styleSheet(){let t=this.o,e=this.t;if(z&&t===void 0){let i=e!==void 0&&e.length===1;i&&(t=tt.get(e)),t===void 0&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),i&&tt.set(e,t))}return t}toString(){return this.cssText}},Pt=s=>new wt(typeof s=="string"?s:s+"",void 0,Q),Ct=(s,t)=>{if(z)s.adoptedStyleSheets=t.map(e=>e instanceof CSSStyleSheet?e:e.styleSheet);else for(let e of t){let i=document.createElement("style"),r=$.litNonce;r!==void 0&&i.setAttribute("nonce",r),i.textContent=e.cssText,s.appendChild(i)}},et=z?s=>s:s=>s instanceof CSSStyleSheet?(t=>{let e="";for(let i of t.cssRules)e+=i.cssText;return Pt(e)})(s):s,{is:Ot,defineProperty:Ut,getOwnPropertyDescriptor:Tt,getOwnPropertyNames:Rt,getOwnPropertySymbols:xt,getPrototypeOf:Mt}=Object,H=globalThis,st=H.trustedTypes,Ht=st?st.emptyScript:"",kt=H.reactiveElementPolyfillSupport,P=(s,t)=>s,I={toAttribute(s,t){switch(t){case Boolean:s=s?Ht:null;break;case Object:case Array:s=s==null?s:JSON.stringify(s)}return s},fromAttribute(s,t){let e=s;switch(t){case Boolean:e=s!==null;break;case Number:e=s===null?null:Number(s);break;case Object:case Array:try{e=JSON.parse(s)}catch{e=null}}return e}},it=(s,t)=>!Ot(s,t),rt={attribute:!0,type:String,converter:I,reflect:!1,useDefault:!1,hasChanged:it};Symbol.metadata??=Symbol("metadata"),H.litPropertyMetadata??=new WeakMap;var A=class extends HTMLElement{static addInitializer(t){this._$Ei(),(this.l??=[]).push(t)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(t,e=rt){if(e.state&&(e.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(t)&&((e=Object.create(e)).wrapped=!0),this.elementProperties.set(t,e),!e.noAccessor){let i=Symbol(),r=this.getPropertyDescriptor(t,i,e);r!==void 0&&Ut(this.prototype,t,r)}}static getPropertyDescriptor(t,e,i){let{get:r,set:n}=Tt(this.prototype,t)??{get(){return this[e]},set(o){this[e]=o}};return{get:r,set(o){let a=r?.call(this);n?.call(this,o),this.requestUpdate(t,a,i)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)??rt}static _$Ei(){if(this.hasOwnProperty(P("elementProperties")))return;let t=Mt(this);t.finalize(),t.l!==void 0&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties)}static finalize(){if(this.hasOwnProperty(P("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(P("properties"))){let e=this.properties,i=[...Rt(e),...xt(e)];for(let r of i)this.createProperty(r,e[r])}let t=this[Symbol.metadata];if(t!==null){let e=litPropertyMetadata.get(t);if(e!==void 0)for(let[i,r]of e)this.elementProperties.set(i,r)}this._$Eh=new Map;for(let[e,i]of this.elementProperties){let r=this._$Eu(e,i);r!==void 0&&this._$Eh.set(r,e)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(t){let e=[];if(Array.isArray(t)){let i=new Set(t.flat(1/0).reverse());for(let r of i)e.unshift(et(r))}else t!==void 0&&e.push(et(t));return e}static _$Eu(t,e){let i=e.attribute;return i===!1?void 0:typeof i=="string"?i:typeof t=="string"?t.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$ES=new Promise(t=>this.enableUpdating=t),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach(t=>t(this))}addController(t){(this._$EO??=new Set).add(t),this.renderRoot!==void 0&&this.isConnected&&t.hostConnected?.()}removeController(t){this._$EO?.delete(t)}_$E_(){let t=new Map,e=this.constructor.elementProperties;for(let i of e.keys())this.hasOwnProperty(i)&&(t.set(i,this[i]),delete this[i]);t.size>0&&(this._$Ep=t)}createRenderRoot(){let t=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return Ct(t,this.constructor.elementStyles),t}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach(t=>t.hostConnected?.())}enableUpdating(t){}disconnectedCallback(){this._$EO?.forEach(t=>t.hostDisconnected?.())}attributeChangedCallback(t,e,i){this._$AK(t,i)}_$ET(t,e){let i=this.constructor.elementProperties.get(t),r=this.constructor._$Eu(t,i);if(r!==void 0&&i.reflect===!0){let n=(i.converter?.toAttribute===void 0?I:i.converter).toAttribute(e,i.type);this._$Em=t,n==null?this.removeAttribute(r):this.setAttribute(r,n),this._$Em=null}}_$AK(t,e){let i=this.constructor,r=i._$Eh.get(t);if(r!==void 0&&this._$Em!==r){let n=i.getPropertyOptions(r),o=typeof n.converter=="function"?{fromAttribute:n.converter}:n.converter?.fromAttribute===void 0?I:n.converter;this._$Em=r;let a=o.fromAttribute(e,n.type);this[r]=a??this._$Ej?.get(r)??a,this._$Em=null}}requestUpdate(t,e,i,r=!1,n){if(t!==void 0){let o=this.constructor;if(r===!1&&(n=this[t]),i??=o.getPropertyOptions(t),!((i.hasChanged??it)(n,e)||i.useDefault&&i.reflect&&n===this._$Ej?.get(t)&&!this.hasAttribute(o._$Eu(t,i))))return;this.C(t,e,i)}this.isUpdatePending===!1&&(this._$ES=this._$EP())}C(t,e,{useDefault:i,reflect:r,wrapped:n},o){i&&!(this._$Ej??=new Map).has(t)&&(this._$Ej.set(t,o??e??this[t]),n!==!0||o!==void 0)||(this._$AL.has(t)||(this.hasUpdated||i||(e=void 0),this._$AL.set(t,e)),r===!0&&this._$Em!==t&&(this._$Eq??=new Set).add(t))}async _$EP(){this.isUpdatePending=!0;try{await this._$ES}catch(e){Promise.reject(e)}let t=this.scheduleUpdate();return t!=null&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(let[r,n]of this._$Ep)this[r]=n;this._$Ep=void 0}let i=this.constructor.elementProperties;if(i.size>0)for(let[r,n]of i){let{wrapped:o}=n,a=this[r];o!==!0||this._$AL.has(r)||a===void 0||this.C(r,void 0,n,a)}}let t=!1,e=this._$AL;try{t=this.shouldUpdate(e),t?(this.willUpdate(e),this._$EO?.forEach(i=>i.hostUpdate?.()),this.update(e)):this._$EM()}catch(i){throw t=!1,this._$EM(),i}t&&this._$AE(e)}willUpdate(t){}_$AE(t){this._$EO?.forEach(e=>e.hostUpdated?.()),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$EM(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(t){return!0}update(t){this._$Eq&&=this._$Eq.forEach(e=>this._$ET(e,this[e])),this._$EM()}updated(t){}firstUpdated(t){}};A.elementStyles=[],A.shadowRootOptions={mode:"open"},A[P("elementProperties")]=new Map,A[P("finalized")]=new Map,kt?.({ReactiveElement:A}),(H.reactiveElementVersions??=[]).push("2.1.2");var q=globalThis,nt=s=>s,k=q.trustedTypes,ot=k?k.createPolicy("lit-html",{createHTML:s=>s}):void 0,at="$lit$",m=`lit$${Math.random().toFixed(9).slice(2)}$`,ht="?"+m,Lt=`<${ht}>`,y=document,C=()=>y.createComment(""),O=s=>s===null||typeof s!="object"&&typeof s!="function",B=Array.isArray,Dt=s=>B(s)||typeof s?.[Symbol.iterator]=="function",W=`[
\f\r]`,U=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,lt=/-->/g,ct=/>/g,b=RegExp(`>|${W}(?:([^\\s"'>=/]+)(${W}*=${W}*(?:[^
\f\r"'\`<>=]|("|')|))|$)`,"g"),dt=/'/g,pt=/"/g,ut=/^(?:script|style|textarea|title)$/i,S=Symbol.for("lit-noChange"),d=Symbol.for("lit-nothing"),_t=new WeakMap,E=y.createTreeWalker(y,129);function ft(s,t){if(!B(s)||!s.hasOwnProperty("raw"))throw Error("invalid template strings array");return ot===void 0?t:ot.createHTML(t)}var Nt=(s,t)=>{let e=s.length-1,i=[],r,n=t===2?"<svg>":t===3?"<math>":"",o=U;for(let a=0;a<e;a++){let h=s[a],g,c,l=-1,_=0;for(;_<h.length&&(o.lastIndex=_,c=o.exec(h),c!==null);)_=o.lastIndex,o===U?c[1]==="!--"?o=lt:c[1]===void 0?c[2]===void 0?c[3]!==void 0&&(o=b):(ut.test(c[2])&&(r=RegExp("</"+c[2],"g")),o=b):o=ct:o===b?c[0]===">"?(o=r??U,l=-1):c[1]===void 0?l=-2:(l=o.lastIndex-c[2].length,g=c[1],o=c[3]===void 0?b:c[3]==='"'?pt:dt):o===pt||o===dt?o=b:o===lt||o===ct?o=U:(o=b,r=void 0);let f=o===b&&s[a+1].startsWith("/>")?" ":"";n+=o===U?h+Lt:l>=0?(i.push(g),h.slice(0,l)+at+h.slice(l)+m+f):h+m+(l===-2?a:f)}return[ft(s,n+(s[e]||"<?>")+(t===2?"</svg>":t===3?"</math>":"")),i]},F=class At{constructor({strings:t,_$litType$:e},i){let r;this.parts=[];let n=0,o=0,a=t.length-1,h=this.parts,[g,c]=Nt(t,e);if(this.el=At.createElement(g,i),E.currentNode=this.el.content,e===2||e===3){let l=this.el.content.firstChild;l.replaceWith(...l.childNodes)}for(;(r=E.nextNode())!==null&&h.length<a;){if(r.nodeType===1){if(r.hasAttributes())for(let l of r.getAttributeNames())if(l.endsWith(at)){let _=c[o++],f=r.getAttribute(l).split(m),v=/([.?@])?(.*)/.exec(_);h.push({type:1,index:n,name:v[2],strings:f,ctor:v[1]==="."?zt:v[1]==="?"?It:v[1]==="@"?qt:L}),r.removeAttribute(l)}else l.startsWith(m)&&(h.push({type:6,index:n}),r.removeAttribute(l));if(ut.test(r.tagName)){let l=r.textContent.split(m),_=l.length-1;if(_>0){r.textContent=k?k.emptyScript:"";for(let f=0;f<_;f++)r.append(l[f],C()),E.nextNode(),h.push({type:2,index:++n});r.append(l[_],C())}}}else if(r.nodeType===8)if(r.data===ht)h.push({type:2,index:n});else{let l=-1;for(;(l=r.data.indexOf(m,l+1))!==-1;)h.push({type:7,index:n}),l+=m.length-1}n++}}static createElement(t,e){let i=y.createElement("template");return i.innerHTML=t,i}};function w(s,t,e=s,i){if(t===S)return t;let r=i===void 0?e._$Cl:e._$Co?.[i],n=O(t)?void 0:t._$litDirective$;return r?.constructor!==n&&(r?._$AO?.(!1),n===void 0?r=void 0:(r=new n(s),r._$AT(s,e,i)),i===void 0?e._$Cl=r:(e._$Co??=[])[i]=r),r!==void 0&&(t=w(s,r._$AS(s,t.values),r,i)),t}var jt=class{constructor(s,t){this._$AV=[],this._$AN=void 0,this._$AD=s,this._$AM=t}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(s){let{el:{content:t},parts:e}=this._$AD,i=(s?.creationScope??y).importNode(t,!0);E.currentNode=i;let r=E.nextNode(),n=0,o=0,a=e[0];for(;a!==void 0;){if(n===a.index){let h;a.type===2?h=new K(r,r.nextSibling,this,s):a.type===1?h=new a.ctor(r,a.name,a.strings,this,s):a.type===6&&(h=new Bt(r,this,s)),this._$AV.push(h),a=e[++o]}n!==a?.index&&(r=E.nextNode(),n++)}return E.currentNode=y,i}p(s){let t=0;for(let e of this._$AV)e!==void 0&&(e.strings===void 0?e._$AI(s[t]):(e._$AI(s,e,t),t+=e.strings.length-2)),t++}},K=class St{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(t,e,i,r){this.type=2,this._$AH=d,this._$AN=void 0,this._$AA=t,this._$AB=e,this._$AM=i,this.options=r,this._$Cv=r?.isConnected??!0}get parentNode(){let t=this._$AA.parentNode,e=this._$AM;return e!==void 0&&t?.nodeType===11&&(t=e.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,e=this){t=w(this,t,e),O(t)?t===d||t==null||t===""?(this._$AH!==d&&this._$AR(),this._$AH=d):t!==this._$AH&&t!==S&&this._(t):t._$litType$===void 0?t.nodeType===void 0?Dt(t)?this.k(t):this._(t):this.T(t):this.$(t)}O(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}T(t){this._$AH!==t&&(this._$AR(),this._$AH=this.O(t))}_(t){this._$AH!==d&&O(this._$AH)?this._$AA.nextSibling.data=t:this.T(y.createTextNode(t)),this._$AH=t}$(t){let{values:e,_$litType$:i}=t,r=typeof i=="number"?this._$AC(t):(i.el===void 0&&(i.el=F.createElement(ft(i.h,i.h[0]),this.options)),i);if(this._$AH?._$AD===r)this._$AH.p(e);else{let n=new jt(r,this),o=n.u(this.options);n.p(e),this.T(o),this._$AH=n}}_$AC(t){let e=_t.get(t.strings);return e===void 0&&_t.set(t.strings,e=new F(t)),e}k(t){B(this._$AH)||(this._$AH=[],this._$AR());let e=this._$AH,i,r=0;for(let n of t)r===e.length?e.push(i=new St(this.O(C()),this.O(C()),this,this.options)):i=e[r],i._$AI(n),r++;r<e.length&&(this._$AR(i&&i._$AB.nextSibling,r),e.length=r)}_$AR(t=this._$AA.nextSibling,e){for(this._$AP?.(!1,!0,e);t!==this._$AB;){let i=nt(t).nextSibling;nt(t).remove(),t=i}}setConnected(t){this._$AM===void 0&&(this._$Cv=t,this._$AP?.(t))}},L=class{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(s,t,e,i,r){this.type=1,this._$AH=d,this._$AN=void 0,this.element=s,this.name=t,this._$AM=i,this.options=r,e.length>2||e[0]!==""||e[1]!==""?(this._$AH=Array(e.length-1).fill(new String),this.strings=e):this._$AH=d}_$AI(s,t=this,e,i){let r=this.strings,n=!1;if(r===void 0)s=w(this,s,t,0),n=!O(s)||s!==this._$AH&&s!==S,n&&(this._$AH=s);else{let o=s,a,h;for(s=r[0],a=0;a<r.length-1;a++)h=w(this,o[e+a],t,a),h===S&&(h=this._$AH[a]),n||=!O(h)||h!==this._$AH[a],h===d?s=d:s!==d&&(s+=(h??"")+r[a+1]),this._$AH[a]=h}n&&!i&&this.j(s)}j(s){s===d?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,s??"")}},zt=class extends L{constructor(){super(...arguments),this.type=3}j(s){this.element[this.name]=s===d?void 0:s}},It=class extends L{constructor(){super(...arguments),this.type=4}j(s){this.element.toggleAttribute(this.name,!!s&&s!==d)}},qt=class extends L{constructor(s,t,e,i,r){super(s,t,e,i,r),this.type=5}_$AI(s,t=this){if((s=w(this,s,t,0)??d)===S)return;let e=this._$AH,i=s===d&&e!==d||s.capture!==e.capture||s.once!==e.once||s.passive!==e.passive,r=s!==d&&(e===d||i);i&&this.element.removeEventListener(this.name,this,e),r&&this.element.addEventListener(this.name,this,s),this._$AH=s}handleEvent(s){typeof this._$AH=="function"?this._$AH.call(this.options?.host??this.element,s):this._$AH.handleEvent(s)}},Bt=class{constructor(s,t,e){this.element=s,this.type=6,this._$AN=void 0,this._$AM=t,this.options=e}get _$AU(){return this._$AM._$AU}_$AI(s){w(this,s)}},Wt=q.litHtmlPolyfillSupport;Wt?.(F,K),(q.litHtmlVersions??=[]).push("3.3.2");var Ft=(s,t,e)=>{let i=e?.renderBefore??t,r=i._$litPart$;if(r===void 0){let n=e?.renderBefore??null;i._$litPart$=r=new K(t.insertBefore(C(),n),n,void 0,e??{})}return r._$AI(s),r},V=globalThis,T=class extends A{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){let s=super.createRenderRoot();return this.renderOptions.renderBefore??=s.firstChild,s}update(s){let t=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(s),this._$Do=Ft(t,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return S}};T._$litElement$=!0,T.finalized=!0,V.litElementHydrateSupport?.({LitElement:T});var Kt=V.litElementPolyfillSupport;Kt?.({LitElement:T}),(V.litElementVersions??=[]).push("4.2.2");var p=[];for(let s=0;s<256;++s)p.push((s+256).toString(16).slice(1));function Vt(s,t=0){return(p[s[t+0]]+p[s[t+1]]+p[s[t+2]]+p[s[t+3]]+"-"+p[s[t+4]]+p[s[t+5]]+"-"+p[s[t+6]]+p[s[t+7]]+"-"+p[s[t+8]]+p[s[t+9]]+"-"+p[s[t+10]]+p[s[t+11]]+p[s[t+12]]+p[s[t+13]]+p[s[t+14]]+p[s[t+15]]).toLowerCase()}var J,Jt=new Uint8Array(16);function Gt(){if(!J){if(typeof crypto>"u"||!crypto.getRandomValues)throw Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");J=crypto.getRandomValues.bind(crypto)}return J(Jt)}var gt={randomUUID:typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function Zt(s,t,e){s||={};let i=s.random??s.rng?.()??Gt();if(i.length<16)throw Error("Random bytes length must be >= 16");return i[6]=i[6]&15|64,i[8]=i[8]&63|128,Vt(i)}function Xt(s,t,e){return gt.randomUUID&&!t&&!s?gt.randomUUID():Zt(s,t)}function Yt(s="hp"){return`${s}-${Xt()}`}var G=class extends T{createRenderRoot(){return this}emit(s,t){let e=new CustomEvent(`hp-${s}`,{detail:t,bubbles:!0,composed:!0,cancelable:!0});return this.dispatchEvent(e),e}_hpId=Yt();get hpId(){return this._hpId}};function Z(s){return function(t){typeof window<"u"&&(customElements.get(s)||customElements.define(s,t))}}var Qt=class{_container;_active=!1;_previouslyFocusedElement=null;_focusableElements=[];constructor(s){this._container=s}activate(){this._active||(this._active=!0,this._previouslyFocusedElement=document.activeElement,this._updateFocusableElements(),this._focusableElements.length>0&&this._focusableElements[0].focus(),document.addEventListener("focusin",this._handleFocusIn),document.addEventListener("keydown",this._handleKeyDown))}deactivate(){this._active&&(this._active=!1,document.removeEventListener("focusin",this._handleFocusIn),document.removeEventListener("keydown",this._handleKeyDown),this._previouslyFocusedElement&&this._previouslyFocusedElement.focus())}_updateFocusableElements(){this._focusableElements=Array.from(this._container.querySelectorAll(["a[href]","button:not([disabled])","textarea:not([disabled])","input:not([disabled])","select:not([disabled])","[tabindex]:not([tabindex='-1'])","[contenteditable='true']"].join(", ")))}_handleFocusIn=s=>{if(!this._active)return;let t=s.target;this._container.contains(t)||this._focusableElements.length>0&&this._focusableElements[0].focus()};_handleKeyDown=s=>{if(!this._active||s.key!=="Tab")return;s.preventDefault();let t=this._focusableElements.indexOf(document.activeElement),e;e=s.shiftKey?t>0?t-1:this._focusableElements.length-1:t<this._focusableElements.length-1?t+1:0,this._focusableElements[e].focus()}};/**
(function(c,$){typeof exports=="object"&&typeof module<"u"?$(exports):typeof define=="function"&&define.amd?define(["exports"],$):(c=typeof globalThis<"u"?globalThis:c||self,$(c.HeadlessPrimitivesPopover={}))})(this,function(c){"use strict";var $=globalThis,q=$.ShadowRoot&&($.ShadyCSS===void 0||$.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,Q=Symbol(),tt=new WeakMap,Ct=class{constructor(t,s,i){if(this._$cssResult$=!0,i!==Q)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=s}get styleSheet(){let t=this.o,s=this.t;if(q&&t===void 0){let i=s!==void 0&&s.length===1;i&&(t=tt.get(s)),t===void 0&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),i&&tt.set(s,t))}return t}toString(){return this.cssText}},wt=e=>new Ct(typeof e=="string"?e:e+"",void 0,Q),Pt=(e,t)=>{if(q)e.adoptedStyleSheets=t.map(s=>s instanceof CSSStyleSheet?s:s.styleSheet);else for(let s of t){let i=document.createElement("style"),r=$.litNonce;r!==void 0&&i.setAttribute("nonce",r),i.textContent=s.cssText,e.appendChild(i)}},et=q?e=>e:e=>e instanceof CSSStyleSheet?(t=>{let s="";for(let i of t.cssRules)s+=i.cssText;return wt(s)})(e):e,{is:Ut,defineProperty:Ot,getOwnPropertyDescriptor:Ht,getOwnPropertyNames:Tt,getOwnPropertySymbols:Rt,getPrototypeOf:kt}=Object,D=globalThis,st=D.trustedTypes,Mt=st?st.emptyScript:"",xt=D.reactiveElementPolyfillSupport,P=(e,t)=>e,B={toAttribute(e,t){switch(t){case Boolean:e=e?Mt:null;break;case Object:case Array:e=e==null?e:JSON.stringify(e)}return e},fromAttribute(e,t){let s=e;switch(t){case Boolean:s=e!==null;break;case Number:s=e===null?null:Number(e);break;case Object:case Array:try{s=JSON.parse(e)}catch{s=null}}return s}},it=(e,t)=>!Ut(e,t),rt={attribute:!0,type:String,converter:B,reflect:!1,useDefault:!1,hasChanged:it};Symbol.metadata??=Symbol("metadata"),D.litPropertyMetadata??=new WeakMap;var S=class extends HTMLElement{static addInitializer(e){this._$Ei(),(this.l??=[]).push(e)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(e,t=rt){if(t.state&&(t.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(e)&&((t=Object.create(t)).wrapped=!0),this.elementProperties.set(e,t),!t.noAccessor){let s=Symbol(),i=this.getPropertyDescriptor(e,s,t);i!==void 0&&Ot(this.prototype,e,i)}}static getPropertyDescriptor(e,t,s){let{get:i,set:r}=Ht(this.prototype,e)??{get(){return this[t]},set(o){this[t]=o}};return{get:i,set(o){let n=i?.call(this);r?.call(this,o),this.requestUpdate(e,n,s)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)??rt}static _$Ei(){if(this.hasOwnProperty(P("elementProperties")))return;let e=kt(this);e.finalize(),e.l!==void 0&&(this.l=[...e.l]),this.elementProperties=new Map(e.elementProperties)}static finalize(){if(this.hasOwnProperty(P("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(P("properties"))){let t=this.properties,s=[...Tt(t),...Rt(t)];for(let i of s)this.createProperty(i,t[i])}let e=this[Symbol.metadata];if(e!==null){let t=litPropertyMetadata.get(e);if(t!==void 0)for(let[s,i]of t)this.elementProperties.set(s,i)}this._$Eh=new Map;for(let[t,s]of this.elementProperties){let i=this._$Eu(t,s);i!==void 0&&this._$Eh.set(i,t)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(e){let t=[];if(Array.isArray(e)){let s=new Set(e.flat(1/0).reverse());for(let i of s)t.unshift(et(i))}else e!==void 0&&t.push(et(e));return t}static _$Eu(e,t){let s=t.attribute;return s===!1?void 0:typeof s=="string"?s:typeof e=="string"?e.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$ES=new Promise(e=>this.enableUpdating=e),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach(e=>e(this))}addController(e){(this._$EO??=new Set).add(e),this.renderRoot!==void 0&&this.isConnected&&e.hostConnected?.()}removeController(e){this._$EO?.delete(e)}_$E_(){let e=new Map,t=this.constructor.elementProperties;for(let s of t.keys())this.hasOwnProperty(s)&&(e.set(s,this[s]),delete this[s]);e.size>0&&(this._$Ep=e)}createRenderRoot(){let e=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return Pt(e,this.constructor.elementStyles),e}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach(e=>e.hostConnected?.())}enableUpdating(e){}disconnectedCallback(){this._$EO?.forEach(e=>e.hostDisconnected?.())}attributeChangedCallback(e,t,s){this._$AK(e,s)}_$ET(e,t){let s=this.constructor.elementProperties.get(e),i=this.constructor._$Eu(e,s);if(i!==void 0&&s.reflect===!0){let r=(s.converter?.toAttribute===void 0?B:s.converter).toAttribute(t,s.type);this._$Em=e,r==null?this.removeAttribute(i):this.setAttribute(i,r),this._$Em=null}}_$AK(e,t){let s=this.constructor,i=s._$Eh.get(e);if(i!==void 0&&this._$Em!==i){let r=s.getPropertyOptions(i),o=typeof r.converter=="function"?{fromAttribute:r.converter}:r.converter?.fromAttribute===void 0?B:r.converter;this._$Em=i;let n=o.fromAttribute(t,r.type);this[i]=n??this._$Ej?.get(i)??n,this._$Em=null}}requestUpdate(e,t,s,i=!1,r){if(e!==void 0){let o=this.constructor;if(i===!1&&(r=this[e]),s??=o.getPropertyOptions(e),!((s.hasChanged??it)(r,t)||s.useDefault&&s.reflect&&r===this._$Ej?.get(e)&&!this.hasAttribute(o._$Eu(e,s))))return;this.C(e,t,s)}this.isUpdatePending===!1&&(this._$ES=this._$EP())}C(e,t,{useDefault:s,reflect:i,wrapped:r},o){s&&!(this._$Ej??=new Map).has(e)&&(this._$Ej.set(e,o??t??this[e]),r!==!0||o!==void 0)||(this._$AL.has(e)||(this.hasUpdated||s||(t=void 0),this._$AL.set(e,t)),i===!0&&this._$Em!==e&&(this._$Eq??=new Set).add(e))}async _$EP(){this.isUpdatePending=!0;try{await this._$ES}catch(t){Promise.reject(t)}let e=this.scheduleUpdate();return e!=null&&await e,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(let[i,r]of this._$Ep)this[i]=r;this._$Ep=void 0}let s=this.constructor.elementProperties;if(s.size>0)for(let[i,r]of s){let{wrapped:o}=r,n=this[i];o!==!0||this._$AL.has(i)||n===void 0||this.C(i,void 0,r,n)}}let e=!1,t=this._$AL;try{e=this.shouldUpdate(t),e?(this.willUpdate(t),this._$EO?.forEach(s=>s.hostUpdate?.()),this.update(t)):this._$EM()}catch(s){throw e=!1,this._$EM(),s}e&&this._$AE(t)}willUpdate(e){}_$AE(e){this._$EO?.forEach(t=>t.hostUpdated?.()),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(e)),this.updated(e)}_$EM(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(e){return!0}update(e){this._$Eq&&=this._$Eq.forEach(t=>this._$ET(t,this[t])),this._$EM()}updated(e){}firstUpdated(e){}};S.elementStyles=[],S.shadowRootOptions={mode:"open"},S[P("elementProperties")]=new Map,S[P("finalized")]=new Map,xt?.({ReactiveElement:S}),(D.reactiveElementVersions??=[]).push("2.1.2");var W=globalThis,ot=e=>e,N=W.trustedTypes,nt=N?N.createPolicy("lit-html",{createHTML:e=>e}):void 0,at="$lit$",m=`lit$${Math.random().toFixed(9).slice(2)}$`,ht="?"+m,Dt=`<${ht}>`,v=document,U=()=>v.createComment(""),O=e=>e===null||typeof e!="object"&&typeof e!="function",V=Array.isArray,Nt=e=>V(e)||typeof e?.[Symbol.iterator]=="function",K=`[
\f\r]`,H=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,lt=/-->/g,ct=/>/g,b=RegExp(`>|${K}(?:([^\\s"'>=/]+)(${K}*=${K}*(?:[^
\f\r"'\`<>=]|("|')|))|$)`,"g"),dt=/'/g,pt=/"/g,ut=/^(?:script|style|textarea|title)$/i,C=Symbol.for("lit-noChange"),p=Symbol.for("lit-nothing"),_t=new WeakMap,A=v.createTreeWalker(v,129);function ft(e,t){if(!V(e)||!e.hasOwnProperty("raw"))throw Error("invalid template strings array");return nt===void 0?t:nt.createHTML(t)}var Lt=(e,t)=>{let s=e.length-1,i=[],r,o=t===2?"<svg>":t===3?"<math>":"",n=H;for(let a=0;a<s;a++){let h=e[a],g,d,l=-1,_=0;for(;_<h.length&&(n.lastIndex=_,d=n.exec(h),d!==null);)_=n.lastIndex,n===H?d[1]==="!--"?n=lt:d[1]===void 0?d[2]===void 0?d[3]!==void 0&&(n=b):(ut.test(d[2])&&(r=RegExp("</"+d[2],"g")),n=b):n=ct:n===b?d[0]===">"?(n=r??H,l=-1):d[1]===void 0?l=-2:(l=n.lastIndex-d[2].length,g=d[1],n=d[3]===void 0?b:d[3]==='"'?pt:dt):n===pt||n===dt?n=b:n===lt||n===ct?n=H:(n=b,r=void 0);let f=n===b&&e[a+1].startsWith("/>")?" ":"";o+=n===H?h+Dt:l>=0?(i.push(g),h.slice(0,l)+at+h.slice(l)+m+f):h+m+(l===-2?a:f)}return[ft(e,o+(e[s]||"<?>")+(t===2?"</svg>":t===3?"</math>":"")),i]},F=class Et{constructor({strings:t,_$litType$:s},i){let r;this.parts=[];let o=0,n=0,a=t.length-1,h=this.parts,[g,d]=Lt(t,s);if(this.el=Et.createElement(g,i),A.currentNode=this.el.content,s===2||s===3){let l=this.el.content.firstChild;l.replaceWith(...l.childNodes)}for(;(r=A.nextNode())!==null&&h.length<a;){if(r.nodeType===1){if(r.hasAttributes())for(let l of r.getAttributeNames())if(l.endsWith(at)){let _=d[n++],f=r.getAttribute(l).split(m),y=/([.?@])?(.*)/.exec(_);h.push({type:1,index:o,name:y[2],strings:f,ctor:y[1]==="."?zt:y[1]==="?"?It:y[1]==="@"?qt:L}),r.removeAttribute(l)}else l.startsWith(m)&&(h.push({type:6,index:o}),r.removeAttribute(l));if(ut.test(r.tagName)){let l=r.textContent.split(m),_=l.length-1;if(_>0){r.textContent=N?N.emptyScript:"";for(let f=0;f<_;f++)r.append(l[f],U()),A.nextNode(),h.push({type:2,index:++o});r.append(l[_],U())}}}else if(r.nodeType===8)if(r.data===ht)h.push({type:2,index:o});else{let l=-1;for(;(l=r.data.indexOf(m,l+1))!==-1;)h.push({type:7,index:o}),l+=m.length-1}o++}}static createElement(t,s){let i=v.createElement("template");return i.innerHTML=t,i}};function w(e,t,s=e,i){if(t===C)return t;let r=i===void 0?s._$Cl:s._$Co?.[i],o=O(t)?void 0:t._$litDirective$;return r?.constructor!==o&&(r?._$AO?.(!1),o===void 0?r=void 0:(r=new o(e),r._$AT(e,s,i)),i===void 0?s._$Cl=r:(s._$Co??=[])[i]=r),r!==void 0&&(t=w(e,r._$AS(e,t.values),r,i)),t}var jt=class{constructor(e,t){this._$AV=[],this._$AN=void 0,this._$AD=e,this._$AM=t}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(e){let{el:{content:t},parts:s}=this._$AD,i=(e?.creationScope??v).importNode(t,!0);A.currentNode=i;let r=A.nextNode(),o=0,n=0,a=s[0];for(;a!==void 0;){if(o===a.index){let h;a.type===2?h=new J(r,r.nextSibling,this,e):a.type===1?h=new a.ctor(r,a.name,a.strings,this,e):a.type===6&&(h=new Bt(r,this,e)),this._$AV.push(h),a=s[++n]}o!==a?.index&&(r=A.nextNode(),o++)}return A.currentNode=v,i}p(e){let t=0;for(let s of this._$AV)s!==void 0&&(s.strings===void 0?s._$AI(e[t]):(s._$AI(e,s,t),t+=s.strings.length-2)),t++}},J=class St{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(t,s,i,r){this.type=2,this._$AH=p,this._$AN=void 0,this._$AA=t,this._$AB=s,this._$AM=i,this.options=r,this._$Cv=r?.isConnected??!0}get parentNode(){let t=this._$AA.parentNode,s=this._$AM;return s!==void 0&&t?.nodeType===11&&(t=s.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,s=this){t=w(this,t,s),O(t)?t===p||t==null||t===""?(this._$AH!==p&&this._$AR(),this._$AH=p):t!==this._$AH&&t!==C&&this._(t):t._$litType$===void 0?t.nodeType===void 0?Nt(t)?this.k(t):this._(t):this.T(t):this.$(t)}O(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}T(t){this._$AH!==t&&(this._$AR(),this._$AH=this.O(t))}_(t){this._$AH!==p&&O(this._$AH)?this._$AA.nextSibling.data=t:this.T(v.createTextNode(t)),this._$AH=t}$(t){let{values:s,_$litType$:i}=t,r=typeof i=="number"?this._$AC(t):(i.el===void 0&&(i.el=F.createElement(ft(i.h,i.h[0]),this.options)),i);if(this._$AH?._$AD===r)this._$AH.p(s);else{let o=new jt(r,this),n=o.u(this.options);o.p(s),this.T(n),this._$AH=o}}_$AC(t){let s=_t.get(t.strings);return s===void 0&&_t.set(t.strings,s=new F(t)),s}k(t){V(this._$AH)||(this._$AH=[],this._$AR());let s=this._$AH,i,r=0;for(let o of t)r===s.length?s.push(i=new St(this.O(U()),this.O(U()),this,this.options)):i=s[r],i._$AI(o),r++;r<s.length&&(this._$AR(i&&i._$AB.nextSibling,r),s.length=r)}_$AR(t=this._$AA.nextSibling,s){for(this._$AP?.(!1,!0,s);t!==this._$AB;){let i=ot(t).nextSibling;ot(t).remove(),t=i}}setConnected(t){this._$AM===void 0&&(this._$Cv=t,this._$AP?.(t))}},L=class{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(e,t,s,i,r){this.type=1,this._$AH=p,this._$AN=void 0,this.element=e,this.name=t,this._$AM=i,this.options=r,s.length>2||s[0]!==""||s[1]!==""?(this._$AH=Array(s.length-1).fill(new String),this.strings=s):this._$AH=p}_$AI(e,t=this,s,i){let r=this.strings,o=!1;if(r===void 0)e=w(this,e,t,0),o=!O(e)||e!==this._$AH&&e!==C,o&&(this._$AH=e);else{let n=e,a,h;for(e=r[0],a=0;a<r.length-1;a++)h=w(this,n[s+a],t,a),h===C&&(h=this._$AH[a]),o||=!O(h)||h!==this._$AH[a],h===p?e=p:e!==p&&(e+=(h??"")+r[a+1]),this._$AH[a]=h}o&&!i&&this.j(e)}j(e){e===p?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,e??"")}},zt=class extends L{constructor(){super(...arguments),this.type=3}j(e){this.element[this.name]=e===p?void 0:e}},It=class extends L{constructor(){super(...arguments),this.type=4}j(e){this.element.toggleAttribute(this.name,!!e&&e!==p)}},qt=class extends L{constructor(e,t,s,i,r){super(e,t,s,i,r),this.type=5}_$AI(e,t=this){if((e=w(this,e,t,0)??p)===C)return;let s=this._$AH,i=e===p&&s!==p||e.capture!==s.capture||e.once!==s.once||e.passive!==s.passive,r=e!==p&&(s===p||i);i&&this.element.removeEventListener(this.name,this,s),r&&this.element.addEventListener(this.name,this,e),this._$AH=e}handleEvent(e){typeof this._$AH=="function"?this._$AH.call(this.options?.host??this.element,e):this._$AH.handleEvent(e)}},Bt=class{constructor(e,t,s){this.element=e,this.type=6,this._$AN=void 0,this._$AM=t,this.options=s}get _$AU(){return this._$AM._$AU}_$AI(e){w(this,e)}},Wt=W.litHtmlPolyfillSupport;Wt?.(F,J),(W.litHtmlVersions??=[]).push("3.3.2");var Vt=(e,t,s)=>{let i=s?.renderBefore??t,r=i._$litPart$;if(r===void 0){let o=s?.renderBefore??null;i._$litPart$=r=new J(t.insertBefore(U(),o),o,void 0,s??{})}return r._$AI(e),r},G=globalThis,T=class extends S{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){let e=super.createRenderRoot();return this.renderOptions.renderBefore??=e.firstChild,e}update(e){let t=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(e),this._$Do=Vt(t,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return C}};T._$litElement$=!0,T.finalized=!0,G.litElementHydrateSupport?.({LitElement:T});var Kt=G.litElementPolyfillSupport;Kt?.({LitElement:T}),(G.litElementVersions??=[]).push("4.2.2");var u=[];for(let e=0;e<256;++e)u.push((e+256).toString(16).slice(1));function Ft(e,t=0){return(u[e[t+0]]+u[e[t+1]]+u[e[t+2]]+u[e[t+3]]+"-"+u[e[t+4]]+u[e[t+5]]+"-"+u[e[t+6]]+u[e[t+7]]+"-"+u[e[t+8]]+u[e[t+9]]+"-"+u[e[t+10]]+u[e[t+11]]+u[e[t+12]]+u[e[t+13]]+u[e[t+14]]+u[e[t+15]]).toLowerCase()}var Z,Jt=new Uint8Array(16);function Gt(){if(!Z){if(typeof crypto>"u"||!crypto.getRandomValues)throw Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");Z=crypto.getRandomValues.bind(crypto)}return Z(Jt)}var gt={randomUUID:typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function Zt(e,t,s){e||={};let i=e.random??e.rng?.()??Gt();if(i.length<16)throw Error("Random bytes length must be >= 16");return i[6]=i[6]&15|64,i[8]=i[8]&63|128,Ft(i)}function Xt(e,t,s){return gt.randomUUID&&!t&&!e?gt.randomUUID():Zt(e,t)}function Yt(e="hp"){return`${e}-${Xt()}`}var R=class extends T{createRenderRoot(){return this}emit(e,t){let s=new CustomEvent(`hp-${e}`,{detail:t,bubbles:!0,composed:!0,cancelable:!0});return this.dispatchEvent(s),s}_hpId=Yt();get hpId(){return this._hpId}_abortController=null;get signal(){return(!this._abortController||this._abortController.signal.aborted)&&(this._abortController=new AbortController),this._abortController.signal}connectedCallback(){super.connectedCallback(),(!this._abortController||this._abortController.signal.aborted)&&(this._abortController=new AbortController)}disconnectedCallback(){super.disconnectedCallback(),this._abortController?.abort(),this._abortController=null}};function k(e){return function(t){typeof window<"u"&&(customElements.get(e)||customElements.define(e,t))}}function Qt(e){let t=[],s=e.parentElement;for(;s;){let{overflow:i,overflowY:r,overflowX:o}=getComputedStyle(s);/auto|scroll|overlay/.test(i+r+o)&&t.push(s),s=s.parentElement}return t.push(window),t}function te(e,t){if(t.aborted)return;let s=0,i=()=>{t.aborted||(e(),s=requestAnimationFrame(i))};s=requestAnimationFrame(i),t.addEventListener("abort",()=>cancelAnimationFrame(s),{once:!0})}/**
* @license
* Copyright 2019 Google LLC
* SPDX-License-Identifier: BSD-3-Clause
*/const D=globalThis,X=D.ShadowRoot&&(D.ShadyCSS===void 0||D.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,$t=Symbol(),mt=new WeakMap;let te=class{constructor(t,e,i){if(this._$cssResult$=!0,i!==$t)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=e}get styleSheet(){let t=this.o;const e=this.t;if(X&&t===void 0){const i=e!==void 0&&e.length===1;i&&(t=mt.get(e)),t===void 0&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),i&&mt.set(e,t))}return t}toString(){return this.cssText}};const ee=s=>new te(typeof s=="string"?s:s+"",void 0,$t),se=(s,t)=>{if(X)s.adoptedStyleSheets=t.map(e=>e instanceof CSSStyleSheet?e:e.styleSheet);else for(const e of t){const i=document.createElement("style"),r=D.litNonce;r!==void 0&&i.setAttribute("nonce",r),i.textContent=e.cssText,s.appendChild(i)}},vt=X?s=>s:s=>s instanceof CSSStyleSheet?(t=>{let e="";for(const i of t.cssRules)e+=i.cssText;return ee(e)})(s):s;/**
*/const j=globalThis,X=j.ShadowRoot&&(j.ShadyCSS===void 0||j.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,$t=Symbol(),mt=new WeakMap;let ee=class{constructor(t,s,i){if(this._$cssResult$=!0,i!==$t)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=s}get styleSheet(){let t=this.o;const s=this.t;if(X&&t===void 0){const i=s!==void 0&&s.length===1;i&&(t=mt.get(s)),t===void 0&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),i&&mt.set(s,t))}return t}toString(){return this.cssText}};const se=e=>new ee(typeof e=="string"?e:e+"",void 0,$t),ie=(e,t)=>{if(X)e.adoptedStyleSheets=t.map(s=>s instanceof CSSStyleSheet?s:s.styleSheet);else for(const s of t){const i=document.createElement("style"),r=j.litNonce;r!==void 0&&i.setAttribute("nonce",r),i.textContent=s.cssText,e.appendChild(i)}},yt=X?e=>e:e=>e instanceof CSSStyleSheet?(t=>{let s="";for(const i of t.cssRules)s+=i.cssText;return se(s)})(e):e;/**
* @license
* Copyright 2017 Google LLC
* SPDX-License-Identifier: BSD-3-Clause
*/const{is:ie,defineProperty:re,getOwnPropertyDescriptor:ne,getOwnPropertyNames:oe,getOwnPropertySymbols:ae,getPrototypeOf:he}=Object,N=globalThis,yt=N.trustedTypes,le=yt?yt.emptyScript:"",ce=N.reactiveElementPolyfillSupport,R=(s,t)=>s,j={toAttribute(s,t){switch(t){case Boolean:s=s?le:null;break;case Object:case Array:s=s==null?s:JSON.stringify(s)}return s},fromAttribute(s,t){let e=s;switch(t){case Boolean:e=s!==null;break;case Number:e=s===null?null:Number(s);break;case Object:case Array:try{e=JSON.parse(s)}catch{e=null}}return e}},Y=(s,t)=>!ie(s,t),bt={attribute:!0,type:String,converter:j,reflect:!1,useDefault:!1,hasChanged:Y};Symbol.metadata??=Symbol("metadata"),N.litPropertyMetadata??=new WeakMap;class x extends HTMLElement{static addInitializer(t){this._$Ei(),(this.l??=[]).push(t)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(t,e=bt){if(e.state&&(e.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(t)&&((e=Object.create(e)).wrapped=!0),this.elementProperties.set(t,e),!e.noAccessor){const i=Symbol(),r=this.getPropertyDescriptor(t,i,e);r!==void 0&&re(this.prototype,t,r)}}static getPropertyDescriptor(t,e,i){const{get:r,set:n}=ne(this.prototype,t)??{get(){return this[e]},set(o){this[e]=o}};return{get:r,set(o){const a=r?.call(this);n?.call(this,o),this.requestUpdate(t,a,i)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)??bt}static _$Ei(){if(this.hasOwnProperty(R("elementProperties")))return;const t=he(this);t.finalize(),t.l!==void 0&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties)}static finalize(){if(this.hasOwnProperty(R("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(R("properties"))){const e=this.properties,i=[...oe(e),...ae(e)];for(const r of i)this.createProperty(r,e[r])}const t=this[Symbol.metadata];if(t!==null){const e=litPropertyMetadata.get(t);if(e!==void 0)for(const[i,r]of e)this.elementProperties.set(i,r)}this._$Eh=new Map;for(const[e,i]of this.elementProperties){const r=this._$Eu(e,i);r!==void 0&&this._$Eh.set(r,e)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(t){const e=[];if(Array.isArray(t)){const i=new Set(t.flat(1/0).reverse());for(const r of i)e.unshift(vt(r))}else t!==void 0&&e.push(vt(t));return e}static _$Eu(t,e){const i=e.attribute;return i===!1?void 0:typeof i=="string"?i:typeof t=="string"?t.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$ES=new Promise(t=>this.enableUpdating=t),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach(t=>t(this))}addController(t){(this._$EO??=new Set).add(t),this.renderRoot!==void 0&&this.isConnected&&t.hostConnected?.()}removeController(t){this._$EO?.delete(t)}_$E_(){const t=new Map,e=this.constructor.elementProperties;for(const i of e.keys())this.hasOwnProperty(i)&&(t.set(i,this[i]),delete this[i]);t.size>0&&(this._$Ep=t)}createRenderRoot(){const t=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return se(t,this.constructor.elementStyles),t}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach(t=>t.hostConnected?.())}enableUpdating(t){}disconnectedCallback(){this._$EO?.forEach(t=>t.hostDisconnected?.())}attributeChangedCallback(t,e,i){this._$AK(t,i)}_$ET(t,e){const i=this.constructor.elementProperties.get(t),r=this.constructor._$Eu(t,i);if(r!==void 0&&i.reflect===!0){const n=(i.converter?.toAttribute!==void 0?i.converter:j).toAttribute(e,i.type);this._$Em=t,n==null?this.removeAttribute(r):this.setAttribute(r,n),this._$Em=null}}_$AK(t,e){const i=this.constructor,r=i._$Eh.get(t);if(r!==void 0&&this._$Em!==r){const n=i.getPropertyOptions(r),o=typeof n.converter=="function"?{fromAttribute:n.converter}:n.converter?.fromAttribute!==void 0?n.converter:j;this._$Em=r;const a=o.fromAttribute(e,n.type);this[r]=a??this._$Ej?.get(r)??a,this._$Em=null}}requestUpdate(t,e,i,r=!1,n){if(t!==void 0){const o=this.constructor;if(r===!1&&(n=this[t]),i??=o.getPropertyOptions(t),!((i.hasChanged??Y)(n,e)||i.useDefault&&i.reflect&&n===this._$Ej?.get(t)&&!this.hasAttribute(o._$Eu(t,i))))return;this.C(t,e,i)}this.isUpdatePending===!1&&(this._$ES=this._$EP())}C(t,e,{useDefault:i,reflect:r,wrapped:n},o){i&&!(this._$Ej??=new Map).has(t)&&(this._$Ej.set(t,o??e??this[t]),n!==!0||o!==void 0)||(this._$AL.has(t)||(this.hasUpdated||i||(e=void 0),this._$AL.set(t,e)),r===!0&&this._$Em!==t&&(this._$Eq??=new Set).add(t))}async _$EP(){this.isUpdatePending=!0;try{await this._$ES}catch(e){Promise.reject(e)}const t=this.scheduleUpdate();return t!=null&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(const[r,n]of this._$Ep)this[r]=n;this._$Ep=void 0}const i=this.constructor.elementProperties;if(i.size>0)for(const[r,n]of i){const{wrapped:o}=n,a=this[r];o!==!0||this._$AL.has(r)||a===void 0||this.C(r,void 0,n,a)}}let t=!1;const e=this._$AL;try{t=this.shouldUpdate(e),t?(this.willUpdate(e),this._$EO?.forEach(i=>i.hostUpdate?.()),this.update(e)):this._$EM()}catch(i){throw t=!1,this._$EM(),i}t&&this._$AE(e)}willUpdate(t){}_$AE(t){this._$EO?.forEach(e=>e.hostUpdated?.()),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$EM(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(t){return!0}update(t){this._$Eq&&=this._$Eq.forEach(e=>this._$ET(e,this[e])),this._$EM()}updated(t){}firstUpdated(t){}}x.elementStyles=[],x.shadowRootOptions={mode:"open"},x[R("elementProperties")]=new Map,x[R("finalized")]=new Map,ce?.({ReactiveElement:x}),(N.reactiveElementVersions??=[]).push("2.1.2");/**
*/const{is:re,defineProperty:oe,getOwnPropertyDescriptor:ne,getOwnPropertyNames:ae,getOwnPropertySymbols:he,getPrototypeOf:le}=Object,z=globalThis,vt=z.trustedTypes,ce=vt?vt.emptyScript:"",de=z.reactiveElementPolyfillSupport,M=(e,t)=>e,I={toAttribute(e,t){switch(t){case Boolean:e=e?ce:null;break;case Object:case Array:e=e==null?e:JSON.stringify(e)}return e},fromAttribute(e,t){let s=e;switch(t){case Boolean:s=e!==null;break;case Number:s=e===null?null:Number(e);break;case Object:case Array:try{s=JSON.parse(e)}catch{s=null}}return s}},Y=(e,t)=>!re(e,t),bt={attribute:!0,type:String,converter:I,reflect:!1,useDefault:!1,hasChanged:Y};Symbol.metadata??=Symbol("metadata"),z.litPropertyMetadata??=new WeakMap;class x extends HTMLElement{static addInitializer(t){this._$Ei(),(this.l??=[]).push(t)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(t,s=bt){if(s.state&&(s.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(t)&&((s=Object.create(s)).wrapped=!0),this.elementProperties.set(t,s),!s.noAccessor){const i=Symbol(),r=this.getPropertyDescriptor(t,i,s);r!==void 0&&oe(this.prototype,t,r)}}static getPropertyDescriptor(t,s,i){const{get:r,set:o}=ne(this.prototype,t)??{get(){return this[s]},set(n){this[s]=n}};return{get:r,set(n){const a=r?.call(this);o?.call(this,n),this.requestUpdate(t,a,i)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)??bt}static _$Ei(){if(this.hasOwnProperty(M("elementProperties")))return;const t=le(this);t.finalize(),t.l!==void 0&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties)}static finalize(){if(this.hasOwnProperty(M("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(M("properties"))){const s=this.properties,i=[...ae(s),...he(s)];for(const r of i)this.createProperty(r,s[r])}const t=this[Symbol.metadata];if(t!==null){const s=litPropertyMetadata.get(t);if(s!==void 0)for(const[i,r]of s)this.elementProperties.set(i,r)}this._$Eh=new Map;for(const[s,i]of this.elementProperties){const r=this._$Eu(s,i);r!==void 0&&this._$Eh.set(r,s)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(t){const s=[];if(Array.isArray(t)){const i=new Set(t.flat(1/0).reverse());for(const r of i)s.unshift(yt(r))}else t!==void 0&&s.push(yt(t));return s}static _$Eu(t,s){const i=s.attribute;return i===!1?void 0:typeof i=="string"?i:typeof t=="string"?t.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$ES=new Promise(t=>this.enableUpdating=t),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach(t=>t(this))}addController(t){(this._$EO??=new Set).add(t),this.renderRoot!==void 0&&this.isConnected&&t.hostConnected?.()}removeController(t){this._$EO?.delete(t)}_$E_(){const t=new Map,s=this.constructor.elementProperties;for(const i of s.keys())this.hasOwnProperty(i)&&(t.set(i,this[i]),delete this[i]);t.size>0&&(this._$Ep=t)}createRenderRoot(){const t=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return ie(t,this.constructor.elementStyles),t}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach(t=>t.hostConnected?.())}enableUpdating(t){}disconnectedCallback(){this._$EO?.forEach(t=>t.hostDisconnected?.())}attributeChangedCallback(t,s,i){this._$AK(t,i)}_$ET(t,s){const i=this.constructor.elementProperties.get(t),r=this.constructor._$Eu(t,i);if(r!==void 0&&i.reflect===!0){const o=(i.converter?.toAttribute!==void 0?i.converter:I).toAttribute(s,i.type);this._$Em=t,o==null?this.removeAttribute(r):this.setAttribute(r,o),this._$Em=null}}_$AK(t,s){const i=this.constructor,r=i._$Eh.get(t);if(r!==void 0&&this._$Em!==r){const o=i.getPropertyOptions(r),n=typeof o.converter=="function"?{fromAttribute:o.converter}:o.converter?.fromAttribute!==void 0?o.converter:I;this._$Em=r;const a=n.fromAttribute(s,o.type);this[r]=a??this._$Ej?.get(r)??a,this._$Em=null}}requestUpdate(t,s,i,r=!1,o){if(t!==void 0){const n=this.constructor;if(r===!1&&(o=this[t]),i??=n.getPropertyOptions(t),!((i.hasChanged??Y)(o,s)||i.useDefault&&i.reflect&&o===this._$Ej?.get(t)&&!this.hasAttribute(n._$Eu(t,i))))return;this.C(t,s,i)}this.isUpdatePending===!1&&(this._$ES=this._$EP())}C(t,s,{useDefault:i,reflect:r,wrapped:o},n){i&&!(this._$Ej??=new Map).has(t)&&(this._$Ej.set(t,n??s??this[t]),o!==!0||n!==void 0)||(this._$AL.has(t)||(this.hasUpdated||i||(s=void 0),this._$AL.set(t,s)),r===!0&&this._$Em!==t&&(this._$Eq??=new Set).add(t))}async _$EP(){this.isUpdatePending=!0;try{await this._$ES}catch(s){Promise.reject(s)}const t=this.scheduleUpdate();return t!=null&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(const[r,o]of this._$Ep)this[r]=o;this._$Ep=void 0}const i=this.constructor.elementProperties;if(i.size>0)for(const[r,o]of i){const{wrapped:n}=o,a=this[r];n!==!0||this._$AL.has(r)||a===void 0||this.C(r,void 0,o,a)}}let t=!1;const s=this._$AL;try{t=this.shouldUpdate(s),t?(this.willUpdate(s),this._$EO?.forEach(i=>i.hostUpdate?.()),this.update(s)):this._$EM()}catch(i){throw t=!1,this._$EM(),i}t&&this._$AE(s)}willUpdate(t){}_$AE(t){this._$EO?.forEach(s=>s.hostUpdated?.()),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$EM(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(t){return!0}update(t){this._$Eq&&=this._$Eq.forEach(s=>this._$ET(s,this[s])),this._$EM()}updated(t){}firstUpdated(t){}}x.elementStyles=[],x.shadowRootOptions={mode:"open"},x[M("elementProperties")]=new Map,x[M("finalized")]=new Map,de?.({ReactiveElement:x}),(z.reactiveElementVersions??=[]).push("2.1.2");/**
* @license
* Copyright 2017 Google LLC
* SPDX-License-Identifier: BSD-3-Clause
*/const de={attribute:!0,type:String,converter:j,reflect:!1,hasChanged:Y},pe=(s=de,t,e)=>{const{kind:i,metadata:r}=e;let n=globalThis.litPropertyMetadata.get(r);if(n===void 0&&globalThis.litPropertyMetadata.set(r,n=new Map),i==="setter"&&((s=Object.create(s)).wrapped=!0),n.set(e.name,s),i==="accessor"){const{name:o}=e;return{set(a){const h=t.get.call(this);t.set.call(this,a),this.requestUpdate(o,h,s,!0,a)},init(a){return a!==void 0&&this.C(o,void 0,s,a),a}}}if(i==="setter"){const{name:o}=e;return function(a){const h=this[o];t.call(this,a),this.requestUpdate(o,h,s,!0,a)}}throw Error("Unsupported decorator location: "+i)};function Et(s){return(t,e)=>typeof e=="object"?pe(s,t,e):((i,r,n)=>{const o=r.hasOwnProperty(n);return r.constructor.createProperty(n,i),o?Object.getOwnPropertyDescriptor(r,n):void 0})(s,t,e)}var ue=Object.defineProperty,_e=Object.getOwnPropertyDescriptor,M=(s,t,e,i)=>{for(var r=i>1?void 0:i?_e(t,e):t,n=s.length-1,o;n>=0;n--)(o=s[n])&&(r=(i?o(t,e,r):o(r))||r);return i&&r&&ue(t,e,r),r};u.HeadlessPopover=class extends G{align="start";_trigger=null;_content=null;_isOpen=!1;_focusTrap=null;_rafId=null;_scrollParents=[];connectedCallback(){super.connectedCallback(),this.setAttribute("data-hp-component","popover"),this._trigger=this.querySelector("hp-popover-trigger"),this._content=this.querySelector("hp-popover-content"),this._trigger&&this._content&&(this._setupTrigger(),this._setupContent(),this._focusTrap=new Qt(this._content))}disconnectedCallback(){super.disconnectedCallback(),this._removeGlobalListeners()}_setupTrigger(){this._trigger&&(this._trigger.setAttribute("data-hp-component","popover-trigger"),!this._trigger.hasAttribute("tabindex")&&!this._trigger.hasAttribute("disabled")&&this._trigger.setAttribute("tabindex","0"),this._trigger.addEventListener("click",this._handleTriggerClick))}_setupContent(){this._content&&(this._content.setAttribute("role","dialog"),this._content.setAttribute("aria-modal","false"),this._content.setAttribute("data-hp-overlay-content",""),this._content.setAttribute("data-state","closed"),this._content.setAttribute("aria-hidden","true"),this.style.position="relative")}_getScrollParents(t){const e=[];let i=t.parentElement;for(;i;){const{overflow:r,overflowY:n,overflowX:o}=getComputedStyle(i);/auto|scroll|overlay/.test(r+n+o)&&e.push(i),i=i.parentElement}return e.push(window),e}_computePosition(){if(!this._trigger||!this._content)return;const t=8,e=this.getBoundingClientRect(),i=this._trigger.getBoundingClientRect(),r=i.left-e.left,n=i.top-e.top,o=i.width,a=i.height,h=this._content.offsetWidth||0,g=this._content.offsetHeight||0;let c=n+a+t,l="bottom";const _=window.innerHeight-i.bottom,f=i.top;g>0&&_<g+t&&f>g+t&&(c=n-g-t,l="top");let v=this.align==="end"?r+o-h:r;const fe=t-e.left,ge=window.innerWidth-h-t-e.left;v=Math.max(fe,Math.min(v,ge)),this._content.style.top=`${c}px`,this._content.style.left=`${v}px`,this._content.setAttribute("data-side",l),this._content.setAttribute("data-align",this.align)}_startPositionLoop(){const t=()=>{this._isOpen&&(this._computePosition(),this._rafId=requestAnimationFrame(t))};this._rafId=requestAnimationFrame(t)}_stopPositionLoop(){this._rafId!==null&&(cancelAnimationFrame(this._rafId),this._rafId=null)}_handleTriggerClick=t=>{t.stopPropagation(),this._toggle()};_toggle=()=>{this._isOpen?this._close():this._open()};_open(){if(!this._isOpen){if(this._isOpen=!0,this._content&&(this._content.setAttribute("data-state","open"),this._content.setAttribute("aria-hidden","false")),this._computePosition(),this._startPositionLoop(),this._trigger&&this._content&&(this._trigger.setAttribute("aria-expanded","true"),this._trigger.setAttribute("aria-controls",this._content.id||"")),document.addEventListener("click",this._handleClickOutside),document.addEventListener("keydown",this._handleEscape),this._trigger){this._scrollParents=this._getScrollParents(this._trigger);for(const t of this._scrollParents)t.addEventListener("scroll",this._handleScrollOrResize,{passive:!0})}window.addEventListener("resize",this._handleScrollOrResize,{passive:!0}),this._focusTrap?.activate(),this.emit("open")}}_close(){this._isOpen&&(this._isOpen=!1,this._stopPositionLoop(),this._content&&(this._content.setAttribute("data-state","closed"),this._content.setAttribute("aria-hidden","true")),this._trigger&&(this._trigger.setAttribute("aria-expanded","false"),this._trigger.removeAttribute("aria-controls")),this._removeGlobalListeners(),this._focusTrap?.deactivate(),this.emit("close"))}_removeGlobalListeners(){document.removeEventListener("click",this._handleClickOutside),document.removeEventListener("keydown",this._handleEscape);for(const t of this._scrollParents)t.removeEventListener("scroll",this._handleScrollOrResize);this._scrollParents=[],window.removeEventListener("resize",this._handleScrollOrResize)}_handleClickOutside=t=>{if(!this._isOpen)return;const e=t.target;this._trigger&&this._content&&!this._trigger.contains(e)&&!this._content.contains(e)&&this._close()};_handleEscape=t=>{t.key==="Escape"&&this._isOpen&&(t.preventDefault(),this._close())};_handleScrollOrResize=()=>{this._isOpen&&this._close()};open(){this._open()}close(){this._close()}toggle(){this._toggle()}},M([Et({type:String,reflect:!0})],u.HeadlessPopover.prototype,"align",2),u.HeadlessPopover=M([Z("hp-popover")],u.HeadlessPopover),u.HeadlessPopoverTrigger=class extends G{disabled=!1;connectedCallback(){super.connectedCallback(),this.setAttribute("data-hp-component","popover-trigger"),!this.hasAttribute("tabindex")&&!this.disabled&&this.setAttribute("tabindex","0"),this.addEventListener("keydown",this._handleKeyDown)}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("keydown",this._handleKeyDown)}_handleKeyDown=t=>{(t.key==="Enter"||t.key===" ")&&(t.preventDefault(),this.click())}},M([Et({type:Boolean,reflect:!0})],u.HeadlessPopoverTrigger.prototype,"disabled",2),u.HeadlessPopoverTrigger=M([Z("hp-popover-trigger")],u.HeadlessPopoverTrigger),u.HeadlessPopoverContent=class extends G{connectedCallback(){super.connectedCallback(),this.setAttribute("data-hp-component","popover-content"),this.id||(this.id=`hp-popover-content-${this.hpId}`)}},u.HeadlessPopoverContent=M([Z("hp-popover-content")],u.HeadlessPopoverContent),Object.defineProperty(u,Symbol.toStringTag,{value:"Module"})});
*/const pe={attribute:!0,type:String,converter:I,reflect:!1,hasChanged:Y},ue=(e=pe,t,s)=>{const{kind:i,metadata:r}=s;let o=globalThis.litPropertyMetadata.get(r);if(o===void 0&&globalThis.litPropertyMetadata.set(r,o=new Map),i==="setter"&&((e=Object.create(e)).wrapped=!0),o.set(s.name,e),i==="accessor"){const{name:n}=s;return{set(a){const h=t.get.call(this);t.set.call(this,a),this.requestUpdate(n,h,e,!0,a)},init(a){return a!==void 0&&this.C(n,void 0,e,a),a}}}if(i==="setter"){const{name:n}=s;return function(a){const h=this[n];t.call(this,a),this.requestUpdate(n,h,e,!0,a)}}throw Error("Unsupported decorator location: "+i)};function At(e){return(t,s)=>typeof s=="object"?ue(e,t,s):((i,r,o)=>{const n=r.hasOwnProperty(o);return r.constructor.createProperty(o,i),n?Object.getOwnPropertyDescriptor(r,o):void 0})(e,t,s)}var _e=Object.defineProperty,fe=Object.getOwnPropertyDescriptor,E=(e,t,s,i)=>{for(var r=i>1?void 0:i?fe(t,s):t,o=e.length-1,n;o>=0;o--)(n=e[o])&&(r=(i?n(t,s,r):n(r))||r);return i&&r&&_e(t,s,r),r};c.HeadlessPopover=class extends R{align="start";_trigger=null;_content=null;_isOpen=!1;_scrollParents=[];_openController=null;connectedCallback(){super.connectedCallback(),this.setAttribute("data-hp-component","popover"),this._trigger=this.querySelector("hp-popover-trigger"),this._content=this.querySelector("hp-popover-content"),this._trigger&&this._content&&(this._setupTrigger(),this._setupContent())}disconnectedCallback(){super.disconnectedCallback(),this._openController?.abort(),this._openController=null,this._scrollParents=[]}_setupTrigger(){this._trigger&&(this._trigger.setAttribute("data-hp-component","popover-trigger"),this._trigger.setAttribute("aria-haspopup","dialog"),!this._trigger.hasAttribute("tabindex")&&!this._trigger.hasAttribute("disabled")&&this._trigger.setAttribute("tabindex","0"),this._trigger.addEventListener("click",this._handleTriggerClick))}_setupContent(){this._content&&(this._content.setAttribute("role","dialog"),this._content.setAttribute("data-hp-overlay-content",""),this._content.setAttribute("data-state","closed"),this._content.setAttribute("aria-hidden","true"),this.style.position="relative")}_computePosition(){if(!this._trigger||!this._content)return;const t=8,s=this.getBoundingClientRect(),i=this._trigger.getBoundingClientRect(),r=i.left-s.left,o=i.top-s.top,n=i.width,a=i.height,h=this._content.offsetWidth||0,g=this._content.offsetHeight||0;let d=o+a+t,l="bottom";const _=window.innerHeight-i.bottom,f=i.top;g>0&&_<g+t&&f>g+t&&(d=o-g-t,l="top");let y=this.align==="end"?r+n-h:r;const ge=t-s.left,$e=window.innerWidth-h-t-s.left;y=Math.max(ge,Math.min(y,$e)),this._content.style.top=`${d}px`,this._content.style.left=`${y}px`,this._content.setAttribute("data-side",l),this._content.setAttribute("data-align",this.align)}_handleTriggerClick=t=>{t.stopPropagation(),this._toggle()};_toggle=()=>{this._isOpen?this._close():this._open()};_open(){if(this._isOpen)return;this._isOpen=!0,this._content&&(this._content.setAttribute("data-state","open"),this._content.setAttribute("aria-hidden","false")),this._computePosition(),this._trigger&&this._content&&(this._trigger.setAttribute("aria-expanded","true"),this._trigger.setAttribute("aria-controls",this._content.id||"")),this._openController?.abort(),this._openController=new AbortController;const t=this._openController.signal;if(te(()=>this._computePosition(),t),document.addEventListener("click",this._handleClickOutside,{signal:t}),document.addEventListener("keydown",this._handleEscape,{signal:t}),this._trigger){this._scrollParents=Qt(this._trigger);for(const s of this._scrollParents)s.addEventListener("scroll",this._handleScrollOrResize,{signal:t,passive:!0})}window.addEventListener("resize",this._handleScrollOrResize,{signal:t,passive:!0}),this.emit("open")}_close(){this._isOpen&&(this._isOpen=!1,this._content&&(this._content.setAttribute("data-state","closed"),this._content.setAttribute("aria-hidden","true")),this._trigger&&(this._trigger.setAttribute("aria-expanded","false"),this._trigger.removeAttribute("aria-controls")),this._removeGlobalListeners(),this.emit("close"))}_removeGlobalListeners(){this._openController?.abort(),this._openController=null,this._scrollParents=[]}_handleClickOutside=t=>{if(!this._isOpen)return;const s=t.target;this._trigger&&this._content&&!this._trigger.contains(s)&&!this._content.contains(s)&&this._close()};_handleEscape=t=>{t.key==="Escape"&&this._isOpen&&(t.preventDefault(),this._close())};_handleScrollOrResize=()=>{this._isOpen&&this._close()};open(){this._open()}close(){this._close()}toggle(){this._toggle()}},E([At({type:String,reflect:!0})],c.HeadlessPopover.prototype,"align",2),c.HeadlessPopover=E([k("hp-popover")],c.HeadlessPopover),c.HeadlessPopoverTrigger=class extends R{disabled=!1;connectedCallback(){super.connectedCallback(),this.setAttribute("data-hp-component","popover-trigger"),!this.hasAttribute("tabindex")&&!this.disabled&&this.setAttribute("tabindex","0"),this.addEventListener("keydown",this._handleKeyDown)}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("keydown",this._handleKeyDown)}_handleKeyDown=t=>{(t.key==="Enter"||t.key===" ")&&(t.preventDefault(),this.click())}},E([At({type:Boolean,reflect:!0})],c.HeadlessPopoverTrigger.prototype,"disabled",2),c.HeadlessPopoverTrigger=E([k("hp-popover-trigger")],c.HeadlessPopoverTrigger),c.HeadlessPopoverContent=class extends R{connectedCallback(){super.connectedCallback(),this.setAttribute("data-hp-component","popover-content"),this.id||(this.id=`hp-popover-content-${this.hpId}`),this._linkAria(),requestAnimationFrame(()=>this._linkAria())}_linkAria(){const t=this.closest("hp-popover");if(!t)return;const s=t.querySelector("hp-popover-title"),i=t.querySelector("hp-popover-description");s?.id?this.setAttribute("aria-labelledby",s.id):this.removeAttribute("aria-labelledby"),i?.id?this.setAttribute("aria-describedby",i.id):this.removeAttribute("aria-describedby")}},c.HeadlessPopoverContent=E([k("hp-popover-content")],c.HeadlessPopoverContent),c.HeadlessPopoverTitle=class extends R{connectedCallback(){super.connectedCallback(),this.setAttribute("data-hp-component","popover-title"),this.id||(this.id=`hp-popover-title-${this.hpId}`)}},c.HeadlessPopoverTitle=E([k("hp-popover-title")],c.HeadlessPopoverTitle),c.HeadlessPopoverDescription=class extends R{connectedCallback(){super.connectedCallback(),this.setAttribute("data-hp-component","popover-description"),this.id||(this.id=`hp-popover-description-${this.hpId}`)}},c.HeadlessPopoverDescription=E([k("hp-popover-description")],c.HeadlessPopoverDescription),Object.defineProperty(c,Symbol.toStringTag,{value:"Module"})});
{
"name": "@headless-primitives/popover",
"version": "1.0.0",
"version": "1.1.0",
"description": "Headless popover primitive for floating content with focus management",

@@ -36,3 +36,3 @@ "keywords": [

"lit": "^3.3.2",
"@headless-primitives/utils": "1.0.0"
"@headless-primitives/utils": "1.1.0"
},

@@ -39,0 +39,0 @@ "devDependencies": {