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

@headless-primitives/dialog

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@headless-primitives/dialog - npm Package Compare versions

Comparing version
1.0.0
to
1.1.0
+434
-409
dist/index.js

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

var R = globalThis, W = R.ShadowRoot && (R.ShadyCSS === void 0 || R.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 R = globalThis, W = R.ShadowRoot && (R.ShadyCSS === void 0 || R.ShadyCSS.nativeShadow) && "adoptedStyleSheets" in Document.prototype && "replace" in CSSStyleSheet.prototype, vt = Symbol(), tt = /* @__PURE__ */ new WeakMap(), xt = class {
constructor(t, s, i) {
if (this._$cssResult$ = !0, i !== vt) 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 (W && 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;

}
}, xt = (s) => new Ot(typeof s == "string" ? s : s + "", void 0, gt), Dt = (s, t) => {
if (W) s.adoptedStyleSheets = t.map((e) => e instanceof CSSStyleSheet ? e : e.styleSheet);
else for (let e of t) {
}, Dt = (e) => new xt(typeof e == "string" ? e : e + "", void 0, vt), Mt = (e, t) => {
if (W) e.adoptedStyleSheets = t.map((s) => s instanceof CSSStyleSheet ? s : s.styleSheet);
else for (let s of t) {
let i = document.createElement("style"), r = R.litNonce;
r !== void 0 && i.setAttribute("nonce", r), i.textContent = e.cssText, s.appendChild(i);
r !== void 0 && i.setAttribute("nonce", r), i.textContent = s.cssText, e.appendChild(i);
}
}, et = W ? (s) => s : (s) => s instanceof CSSStyleSheet ? ((t) => {
let e = "";
for (let i of t.cssRules) e += i.cssText;
return xt(e);
})(s) : s, { is: Mt, defineProperty: Rt, getOwnPropertyDescriptor: Tt, getOwnPropertyNames: Ht, getOwnPropertySymbols: Lt, getPrototypeOf: Nt } = Object, N = globalThis, st = N.trustedTypes, jt = st ? st.emptyScript : "", It = N.reactiveElementPolyfillSupport, P = (s, t) => s, B = {
toAttribute(s, t) {
}, et = W ? (e) => e : (e) => e instanceof CSSStyleSheet ? ((t) => {
let s = "";
for (let i of t.cssRules) s += i.cssText;
return Dt(s);
})(e) : e, { is: Rt, defineProperty: Tt, getOwnPropertyDescriptor: Ht, getOwnPropertyNames: Lt, getOwnPropertySymbols: Nt, getPrototypeOf: jt } = Object, N = globalThis, st = N.trustedTypes, It = st ? st.emptyScript : "", zt = N.reactiveElementPolyfillSupport, P = (e, t) => e, B = {
toAttribute(e, t) {
switch (t) {
case Boolean:
s = s ? jt : null;
e = e ? It : 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,10 +52,10 @@ case Object:

try {
e = JSON.parse(s);
s = JSON.parse(e);
} catch {
e = null;
s = null;
}
}
return e;
return s;
}
}, vt = (s, t) => !Mt(s, t), it = {
}, At = (e, t) => !Rt(e, t), it = {
attribute: !0,

@@ -66,8 +66,8 @@ type: String,

useDefault: !1,
hasChanged: vt
hasChanged: At
};
Symbol.metadata ??= Symbol("metadata"), N.litPropertyMetadata ??= /* @__PURE__ */ new WeakMap();
var g = class extends HTMLElement {
static addInitializer(t) {
this._$Ei(), (this.l ??= []).push(t);
var A = class extends HTMLElement {
static addInitializer(e) {
this._$Ei(), (this.l ??= []).push(e);
}

@@ -77,22 +77,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 && Rt(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: o } = 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(n) {
this[e] = n;
set(o) {
this[t] = o;
}
};
return {
get: r,
set(n) {
let a = r?.call(this);
o?.call(this, n), this.requestUpdate(t, a, i);
get: i,
set(o) {
let n = i?.call(this);
r?.call(this, o), this.requestUpdate(e, n, s);
},

@@ -103,9 +103,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 = Nt(this);
t.finalize(), t.l !== void 0 && (this.l = [...t.l]), this.elementProperties = new Map(t.elementProperties);
let e = jt(this);
e.finalize(), e.l !== void 0 && (this.l = [...e.l]), this.elementProperties = new Map(e.elementProperties);
}

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

if (this.finalized = !0, this._$Ei(), this.hasOwnProperty(P("properties"))) {
let e = this.properties, i = [...Ht(e), ...Lt(e)];
for (let r of i) this.createProperty(r, e[r]);
let t = this.properties, s = [...Lt(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;
}

@@ -147,56 +147,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 Dt(t, this.constructor.elementStyles), t;
let e = this.shadowRoot ?? this.attachShadow(this.constructor.shadowRootOptions);
return Mt(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 o = (i.converter?.toAttribute === void 0 ? B : i.converter).toAttribute(e, i.type);
this._$Em = t, o == null ? this.removeAttribute(r) : this.setAttribute(r, o), 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 o = i.getPropertyOptions(r), n = typeof o.converter == "function" ? { fromAttribute: o.converter } : o.converter?.fromAttribute === void 0 ? B : o.converter;
this._$Em = r;
let a = n.fromAttribute(e, o.type);
this[r] = a ?? this._$Ej?.get(r) ?? a, 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, o) {
if (t !== void 0) {
let n = this.constructor;
if (r === !1 && (o = this[t]), i ??= n.getPropertyOptions(t), !((i.hasChanged ?? vt)(o, e) || i.useDefault && i.reflect && o === this._$Ej?.get(t) && !this.hasAttribute(n._$Eu(t, i)))) return;
this.C(t, e, i);
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 ?? At)(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: o }, n) {
i && !(this._$Ej ??= /* @__PURE__ */ new Map()).has(t) && (this._$Ej.set(t, n ?? e ?? this[t]), o !== !0 || n !== 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));
}

@@ -207,7 +207,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;
}

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

if (this.renderRoot ??= this.createRenderRoot(), this._$Ep) {
for (let [r, o] of this._$Ep) this[r] = o;
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, o] of i) {
let { wrapped: n } = o, a = this[r];
n !== !0 || this._$AL.has(r) || a === void 0 || this.C(r, void 0, o, a);
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);
}

@@ -253,44 +253,44 @@ _$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) {
}
};
g.elementStyles = [], g.shadowRootOptions = { mode: "open" }, g[P("elementProperties")] = /* @__PURE__ */ new Map(), g[P("finalized")] = /* @__PURE__ */ new Map(), It?.({ ReactiveElement: g }), (N.reactiveElementVersions ??= []).push("2.1.2");
var J = globalThis, rt = (s) => s, H = J.trustedTypes, ot = H ? H.createPolicy("lit-html", { createHTML: (s) => s }) : void 0, At = "$lit$", _ = `lit$${Math.random().toFixed(9).slice(2)}$`, Et = "?" + _, zt = `<${Et}>`, b = document, O = () => b.createComment(""), x = (s) => s === null || typeof s != "object" && typeof s != "function", Z = Array.isArray, qt = (s) => Z(s) || typeof s?.[Symbol.iterator] == "function", z = `[
\f\r]`, w = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g, nt = /-->/g, at = />/g, y = RegExp(`>|${z}(?:([^\\s"'>=/]+)(${z}*=${z}*(?:[^
\f\r"'\`<>=]|("|')|))|$)`, "g"), ht = /'/g, lt = /"/g, St = /^(?:script|style|textarea|title)$/i, v = Symbol.for("lit-noChange"), c = Symbol.for("lit-nothing"), ct = /* @__PURE__ */ new WeakMap(), m = b.createTreeWalker(b, 129);
function wt(s, t) {
if (!Z(s) || !s.hasOwnProperty("raw")) throw Error("invalid template strings array");
A.elementStyles = [], A.shadowRootOptions = { mode: "open" }, A[P("elementProperties")] = /* @__PURE__ */ new Map(), A[P("finalized")] = /* @__PURE__ */ new Map(), zt?.({ ReactiveElement: A }), (N.reactiveElementVersions ??= []).push("2.1.2");
var J = globalThis, rt = (e) => e, H = J.trustedTypes, ot = H ? H.createPolicy("lit-html", { createHTML: (e) => e }) : void 0, Et = "$lit$", $ = `lit$${Math.random().toFixed(9).slice(2)}$`, St = "?" + $, qt = `<${St}>`, m = document, O = () => m.createComment(""), x = (e) => e === null || typeof e != "object" && typeof e != "function", Z = Array.isArray, Bt = (e) => Z(e) || typeof e?.[Symbol.iterator] == "function", z = `[
\f\r]`, w = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g, nt = /-->/g, at = />/g, b = RegExp(`>|${z}(?:([^\\s"'>=/]+)(${z}*=${z}*(?:[^
\f\r"'\`<>=]|("|')|))|$)`, "g"), lt = /'/g, ht = /"/g, wt = /^(?:script|style|textarea|title)$/i, E = Symbol.for("lit-noChange"), c = Symbol.for("lit-nothing"), ct = /* @__PURE__ */ new WeakMap(), y = m.createTreeWalker(m, 129);
function Ct(e, t) {
if (!Z(e) || !e.hasOwnProperty("raw")) throw Error("invalid template strings array");
return ot === void 0 ? t : ot.createHTML(t);
}
var Bt = (s, t) => {
let e = s.length - 1, i = [], r, o = t === 2 ? "<svg>" : t === 3 ? "<math>" : "", n = w;
for (let a = 0; a < e; a++) {
let h = s[a], D, p, l = -1, u = 0;
for (; u < h.length && (n.lastIndex = u, p = n.exec(h), p !== null); ) u = n.lastIndex, n === w ? p[1] === "!--" ? n = nt : p[1] === void 0 ? p[2] === void 0 ? p[3] !== void 0 && (n = y) : (St.test(p[2]) && (r = RegExp("</" + p[2], "g")), n = y) : n = at : n === y ? p[0] === ">" ? (n = r ?? w, l = -1) : p[1] === void 0 ? l = -2 : (l = n.lastIndex - p[2].length, D = p[1], n = p[3] === void 0 ? y : p[3] === '"' ? lt : ht) : n === lt || n === ht ? n = y : n === nt || n === at ? n = w : (n = y, r = void 0);
let f = n === y && s[a + 1].startsWith("/>") ? " " : "";
o += n === w ? h + zt : l >= 0 ? (i.push(D), h.slice(0, l) + At + h.slice(l) + _ + f) : h + _ + (l === -2 ? a : f);
var Kt = (e, t) => {
let s = e.length - 1, i = [], r, o = t === 2 ? "<svg>" : t === 3 ? "<math>" : "", n = w;
for (let a = 0; a < s; a++) {
let l = e[a], D, p, h = -1, u = 0;
for (; u < l.length && (n.lastIndex = u, p = n.exec(l), p !== null); ) u = n.lastIndex, n === w ? p[1] === "!--" ? n = nt : p[1] === void 0 ? p[2] === void 0 ? p[3] !== void 0 && (n = b) : (wt.test(p[2]) && (r = RegExp("</" + p[2], "g")), n = b) : n = at : n === b ? p[0] === ">" ? (n = r ?? w, h = -1) : p[1] === void 0 ? h = -2 : (h = n.lastIndex - p[2].length, D = p[1], n = p[3] === void 0 ? b : p[3] === '"' ? ht : lt) : n === ht || n === lt ? n = b : n === nt || n === at ? n = w : (n = b, r = void 0);
let f = n === b && e[a + 1].startsWith("/>") ? " " : "";
o += n === w ? l + qt : h >= 0 ? (i.push(D), l.slice(0, h) + Et + l.slice(h) + $ + f) : l + $ + (h === -2 ? a : f);
}
return [wt(s, o + (s[e] || "<?>") + (t === 2 ? "</svg>" : t === 3 ? "</math>" : "")), i];
}, K = class Ct {
constructor({ strings: t, _$litType$: e }, i) {
return [Ct(e, o + (e[s] || "<?>") + (t === 2 ? "</svg>" : t === 3 ? "</math>" : "")), i];
}, K = class Pt {
constructor({ strings: t, _$litType$: s }, i) {
let r;
this.parts = [];
let o = 0, n = 0, a = t.length - 1, h = this.parts, [D, p] = Bt(t, e);
if (this.el = Ct.createElement(D, i), m.currentNode = this.el.content, e === 2 || e === 3) {
let l = this.el.content.firstChild;
l.replaceWith(...l.childNodes);
let o = 0, n = 0, a = t.length - 1, l = this.parts, [D, p] = Kt(t, s);
if (this.el = Pt.createElement(D, i), y.currentNode = this.el.content, s === 2 || s === 3) {
let h = this.el.content.firstChild;
h.replaceWith(...h.childNodes);
}
for (; (r = m.nextNode()) !== null && h.length < a; ) {
for (; (r = y.nextNode()) !== null && l.length < a; ) {
if (r.nodeType === 1) {
if (r.hasAttributes()) for (let l of r.getAttributeNames()) if (l.endsWith(At)) {
let u = p[n++], f = r.getAttribute(l).split(_), M = /([.?@])?(.*)/.exec(u);
h.push({
if (r.hasAttributes()) for (let h of r.getAttributeNames()) if (h.endsWith(Et)) {
let u = p[n++], f = r.getAttribute(h).split($), M = /([.?@])?(.*)/.exec(u);
l.push({
type: 1,

@@ -300,20 +300,20 @@ index: o,

strings: f,
ctor: M[1] === "." ? Ft : M[1] === "?" ? Vt : M[1] === "@" ? Wt : j
}), r.removeAttribute(l);
} else l.startsWith(_) && (h.push({
ctor: M[1] === "." ? Vt : M[1] === "?" ? Wt : M[1] === "@" ? Jt : j
}), r.removeAttribute(h);
} else h.startsWith($) && (l.push({
type: 6,
index: o
}), r.removeAttribute(l));
if (St.test(r.tagName)) {
let l = r.textContent.split(_), u = l.length - 1;
}), r.removeAttribute(h));
if (wt.test(r.tagName)) {
let h = r.textContent.split($), u = h.length - 1;
if (u > 0) {
r.textContent = H ? H.emptyScript : "";
for (let f = 0; f < u; f++) r.append(l[f], O()), m.nextNode(), h.push({
for (let f = 0; f < u; f++) r.append(h[f], O()), y.nextNode(), l.push({
type: 2,
index: ++o
});
r.append(l[u], O());
r.append(h[u], O());
}
}
} else if (r.nodeType === 8) if (r.data === Et) h.push({
} else if (r.nodeType === 8) if (r.data === St) l.push({
type: 2,

@@ -323,7 +323,7 @@ index: o

else {
let l = -1;
for (; (l = r.data.indexOf(_, l + 1)) !== -1; ) h.push({
let h = -1;
for (; (h = r.data.indexOf($, h + 1)) !== -1; ) l.push({
type: 7,
index: o
}), l += _.length - 1;
}), h += $.length - 1;
}

@@ -333,15 +333,15 @@ o++;

}
static createElement(t, e) {
let i = b.createElement("template");
static createElement(t, s) {
let i = m.createElement("template");
return i.innerHTML = t, i;
}
};
function A(s, t, e = s, i) {
if (t === v) return t;
let r = i === void 0 ? e._$Cl : e._$Co?.[i], o = x(t) ? void 0 : t._$litDirective$;
return r?.constructor !== o && (r?._$AO?.(!1), o === void 0 ? r = void 0 : (r = new o(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 = x(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 Kt = class {
constructor(s, t) {
this._$AV = [], this._$AN = void 0, this._$AD = s, this._$AM = t;
var Ft = class {
constructor(e, t) {
this._$AV = [], this._$AN = void 0, this._$AD = e, this._$AM = t;
}

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

}
u(s) {
let { el: { content: t }, parts: e } = this._$AD, i = (s?.creationScope ?? b).importNode(t, !0);
m.currentNode = i;
let r = m.nextNode(), o = 0, n = 0, a = e[0];
u(e) {
let { el: { content: t }, parts: s } = this._$AD, i = (e?.creationScope ?? m).importNode(t, !0);
y.currentNode = i;
let r = y.nextNode(), o = 0, n = 0, a = s[0];
for (; a !== void 0; ) {
if (o === a.index) {
let h;
a.type === 2 ? h = new Y(r, r.nextSibling, this, s) : a.type === 1 ? h = new a.ctor(r, a.name, a.strings, this, s) : a.type === 6 && (h = new Jt(r, this, s)), this._$AV.push(h), a = e[++n];
let l;
a.type === 2 ? l = new Y(r, r.nextSibling, this, e) : a.type === 1 ? l = new a.ctor(r, a.name, a.strings, this, e) : a.type === 6 && (l = new Zt(r, this, e)), this._$AV.push(l), a = s[++n];
}
o !== a?.index && (r = m.nextNode(), o++);
o !== a?.index && (r = y.nextNode(), o++);
}
return m.currentNode = b, i;
return y.currentNode = m, 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++;
}
}, Y = class Pt {
}, Y = class kt {
get _$AU() {
return this._$AM?._$AU ?? this._$Cv;
}
constructor(t, e, i, r) {
this.type = 2, this._$AH = c, 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 = c, 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;
}

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

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

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

_(t) {
this._$AH !== c && x(this._$AH) ? this._$AA.nextSibling.data = t : this.T(b.createTextNode(t)), this._$AH = t;
this._$AH !== c && x(this._$AH) ? this._$AA.nextSibling.data = t : this.T(m.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 = K.createElement(wt(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 = K.createElement(Ct(i.h, i.h[0]), this.options)), i);
if (this._$AH?._$AD === r) this._$AH.p(s);
else {
let o = new Kt(r, this), n = o.u(this.options);
o.p(e), this.T(n), this._$AH = o;
let o = new Ft(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 K(t)), e;
let s = ct.get(t.strings);
return s === void 0 && ct.set(t.strings, s = new K(t)), s;
}
k(t) {
Z(this._$AH) || (this._$AH = [], this._$AR());
let e = this._$AH, i, r = 0;
for (let o of t) r === e.length ? e.push(i = new Pt(this.O(O()), this.O(O()), this, this.options)) : i = e[r], i._$AI(o), r++;
r < e.length && (this._$AR(i && i._$AB.nextSibling, r), e.length = r);
let s = this._$AH, i, r = 0;
for (let o of t) r === s.length ? s.push(i = new kt(this.O(O()), this.O(O()), 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;

@@ -437,46 +437,46 @@ rt(t).remove(), t = i;

}
constructor(s, t, e, i, r) {
this.type = 1, this._$AH = c, 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 = c;
constructor(e, t, s, i, r) {
this.type = 1, this._$AH = c, 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 = c;
}
_$AI(s, t = this, e, i) {
_$AI(e, t = this, s, i) {
let r = this.strings, o = !1;
if (r === void 0) s = A(this, s, t, 0), o = !x(s) || s !== this._$AH && s !== v, o && (this._$AH = s);
if (r === void 0) e = S(this, e, t, 0), o = !x(e) || e !== this._$AH && e !== E, o && (this._$AH = e);
else {
let n = s, a, h;
for (s = r[0], a = 0; a < r.length - 1; a++) h = A(this, n[e + a], t, a), h === v && (h = this._$AH[a]), o ||= !x(h) || h !== this._$AH[a], h === c ? s = c : s !== c && (s += (h ?? "") + r[a + 1]), this._$AH[a] = h;
let n = e, a, l;
for (e = r[0], a = 0; a < r.length - 1; a++) l = S(this, n[s + a], t, a), l === E && (l = this._$AH[a]), o ||= !x(l) || l !== this._$AH[a], l === c ? e = c : e !== c && (e += (l ?? "") + r[a + 1]), this._$AH[a] = l;
}
o && !i && this.j(s);
o && !i && this.j(e);
}
j(s) {
s === c ? this.element.removeAttribute(this.name) : this.element.setAttribute(this.name, s ?? "");
j(e) {
e === c ? this.element.removeAttribute(this.name) : this.element.setAttribute(this.name, e ?? "");
}
}, Ft = class extends j {
}, Vt = class extends j {
constructor() {
super(...arguments), this.type = 3;
}
j(s) {
this.element[this.name] = s === c ? void 0 : s;
j(e) {
this.element[this.name] = e === c ? void 0 : e;
}
}, Vt = class extends j {
}, Wt = class extends j {
constructor() {
super(...arguments), this.type = 4;
}
j(s) {
this.element.toggleAttribute(this.name, !!s && s !== c);
j(e) {
this.element.toggleAttribute(this.name, !!e && e !== c);
}
}, Wt = class extends j {
constructor(s, t, e, i, r) {
super(s, t, e, i, r), this.type = 5;
}, Jt = 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) ?? c) === v) return;
let e = this._$AH, i = s === c && e !== c || s.capture !== e.capture || s.once !== e.once || s.passive !== e.passive, r = s !== c && (e === c || 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) ?? c) === E) return;
let s = this._$AH, i = e === c && s !== c || e.capture !== s.capture || e.once !== s.once || e.passive !== s.passive, r = e !== c && (s === c || 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);
}
}, Jt = class {
constructor(s, t, e) {
this.element = s, this.type = 6, this._$AN = void 0, this._$AM = t, this.options = e;
}, Zt = class {
constructor(e, t, s) {
this.element = e, this.type = 6, this._$AN = void 0, this._$AM = t, this.options = s;
}

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

}
_$AI(s) {
A(this, s);
_$AI(e) {
S(this, e);
}
}, Zt = J.litHtmlPolyfillSupport;
Zt?.(K, Y), (J.litHtmlVersions ??= []).push("3.3.2");
var Yt = (s, t, e) => {
let i = e?.renderBefore ?? t, r = i._$litPart$;
}, Yt = J.litHtmlPolyfillSupport;
Yt?.(K, Y), (J.litHtmlVersions ??= []).push("3.3.2");
var Gt = (e, t, s) => {
let i = s?.renderBefore ?? t, r = i._$litPart$;
if (r === void 0) {
let o = e?.renderBefore ?? null;
i._$litPart$ = r = new Y(t.insertBefore(O(), o), o, void 0, e ?? {});
let o = s?.renderBefore ?? null;
i._$litPart$ = r = new Y(t.insertBefore(O(), o), o, void 0, s ?? {});
}
return r._$AI(s), r;
}, G = globalThis, U = class extends g {
return r._$AI(e), r;
}, G = globalThis, k = class extends A {
constructor() {

@@ -504,8 +504,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 = Yt(t, this.renderRoot, this.renderOptions);
this.hasUpdated || (this.renderOptions.isConnected = this.isConnected), super.update(e), this._$Do = Gt(t, this.renderRoot, this.renderOptions);
}

@@ -519,15 +519,15 @@ connectedCallback() {

render() {
return v;
return E;
}
};
U._$litElement$ = !0, U.finalized = !0, G.litElementHydrateSupport?.({ LitElement: U });
var Gt = G.litElementPolyfillSupport;
Gt?.({ LitElement: U }), (G.litElementVersions ??= []).push("4.2.2");
k._$litElement$ = !0, k.finalized = !0, G.litElementHydrateSupport?.({ LitElement: k });
var Qt = G.litElementPolyfillSupport;
Qt?.({ LitElement: k }), (G.litElementVersions ??= []).push("4.2.2");
var d = [];
for (let s = 0; s < 256; ++s) d.push((s + 256).toString(16).slice(1));
function Qt(s, t = 0) {
return (d[s[t + 0]] + d[s[t + 1]] + d[s[t + 2]] + d[s[t + 3]] + "-" + d[s[t + 4]] + d[s[t + 5]] + "-" + d[s[t + 6]] + d[s[t + 7]] + "-" + d[s[t + 8]] + d[s[t + 9]] + "-" + d[s[t + 10]] + d[s[t + 11]] + d[s[t + 12]] + d[s[t + 13]] + d[s[t + 14]] + d[s[t + 15]]).toLowerCase();
for (let e = 0; e < 256; ++e) d.push((e + 256).toString(16).slice(1));
function Xt(e, t = 0) {
return (d[e[t + 0]] + d[e[t + 1]] + d[e[t + 2]] + d[e[t + 3]] + "-" + d[e[t + 4]] + d[e[t + 5]] + "-" + d[e[t + 6]] + d[e[t + 7]] + "-" + d[e[t + 8]] + d[e[t + 9]] + "-" + d[e[t + 10]] + d[e[t + 11]] + d[e[t + 12]] + d[e[t + 13]] + d[e[t + 14]] + d[e[t + 15]]).toLowerCase();
}
var q, Xt = new Uint8Array(16);
function te() {
var q, te = new Uint8Array(16);
function ee() {
if (!q) {

@@ -537,23 +537,23 @@ if (typeof crypto > "u" || !crypto.getRandomValues) throw Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");

}
return q(Xt);
return q(te);
}
var dt = { randomUUID: typeof crypto < "u" && crypto.randomUUID && crypto.randomUUID.bind(crypto) };
function ee(s, t, e) {
s ||= {};
let i = s.random ?? s.rng?.() ?? te();
function se(e, t, s) {
e ||= {};
let i = e.random ?? e.rng?.() ?? ee();
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, Qt(i);
return i[6] = i[6] & 15 | 64, i[8] = i[8] & 63 | 128, Xt(i);
}
function se(s, t, e) {
return dt.randomUUID && !t && !s ? dt.randomUUID() : ee(s, t);
function ie(e, t, s) {
return dt.randomUUID && !t && !e ? dt.randomUUID() : se(e, t);
}
function ie(s = "hp") {
return `${s}-${se()}`;
function re(e = "hp") {
return `${e}-${ie()}`;
}
var E = class extends U {
var g = class extends k {
createRenderRoot() {
return this;
}
emit(s, t) {
let e = new CustomEvent(`hp-${s}`, {
emit(e, t) {
let s = new CustomEvent(`hp-${e}`, {
detail: t,

@@ -564,15 +564,25 @@ bubbles: !0,

});
return this.dispatchEvent(e), e;
return this.dispatchEvent(s), s;
}
_hpId = ie();
_hpId = re();
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 S(s) {
function v(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 re = class {
var oe = class {
_container;

@@ -582,4 +592,4 @@ _active = !1;

_focusableElements = [];
constructor(s) {
this._container = s;
constructor(e) {
this._container = e;
}

@@ -603,12 +613,12 @@ activate() {

}
_handleFocusIn = (s) => {
_handleFocusIn = (e) => {
if (!this._active) return;
let t = s.target;
let t = e.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();
_handleKeyDown = (e) => {
if (!this._active || e.key !== "Tab") return;
e.preventDefault();
let t = this._focusableElements.indexOf(document.activeElement), s;
s = e.shiftKey ? t > 0 ? t - 1 : this._focusableElements.length - 1 : t < this._focusableElements.length - 1 ? t + 1 : 0, this._focusableElements[s].focus();
};

@@ -622,13 +632,13 @@ };

const T = globalThis, Q = T.ShadowRoot && (T.ShadyCSS === void 0 || T.ShadyCSS.nativeShadow) && "adoptedStyleSheets" in Document.prototype && "replace" in CSSStyleSheet.prototype, Ut = Symbol(), pt = /* @__PURE__ */ new WeakMap();
let oe = class {
constructor(t, e, i) {
let ne = class {
constructor(t, s, i) {
if (this._$cssResult$ = !0, i !== Ut) throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");
this.cssText = t, this.t = e;
this.cssText = t, this.t = s;
}
get styleSheet() {
let t = this.o;
const e = this.t;
const s = this.t;
if (Q && 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));
}

@@ -641,13 +651,13 @@ return t;

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

@@ -658,20 +668,20 @@ * @license

*/
const { is: he, defineProperty: le, getOwnPropertyDescriptor: ce, getOwnPropertyNames: de, getOwnPropertySymbols: pe, getPrototypeOf: ue } = Object, I = globalThis, ft = I.trustedTypes, fe = ft ? ft.emptyScript : "", _e = I.reactiveElementPolyfillSupport, k = (s, t) => s, L = { toAttribute(s, t) {
const { is: he, defineProperty: ce, getOwnPropertyDescriptor: de, getOwnPropertyNames: pe, getOwnPropertySymbols: ue, getPrototypeOf: _e } = Object, I = globalThis, _t = I.trustedTypes, fe = _t ? _t.emptyScript : "", $e = I.reactiveElementPolyfillSupport, U = (e, t) => e, L = { toAttribute(e, t) {
switch (t) {
case Boolean:
s = s ? fe : 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;

@@ -681,9 +691,9 @@ case Object:

try {
e = JSON.parse(s);
s = JSON.parse(e);
} catch {
e = null;
s = null;
}
}
return e;
} }, X = (s, t) => !he(s, t), _t = { attribute: !0, type: String, converter: L, reflect: !1, useDefault: !1, hasChanged: X };
return s;
} }, X = (e, t) => !he(e, t), ft = { attribute: !0, type: String, converter: L, reflect: !1, useDefault: !1, hasChanged: X };
Symbol.metadata ??= Symbol("metadata"), I.litPropertyMetadata ??= /* @__PURE__ */ new WeakMap();

@@ -697,13 +707,13 @@ class C extends HTMLElement {

}
static createProperty(t, e = _t) {
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 && le(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: o } = ce(this.prototype, t) ?? { get() {
return this[e];
static getPropertyDescriptor(t, s, i) {
const { get: r, set: o } = de(this.prototype, t) ?? { get() {
return this[s];
}, set(n) {
this[e] = n;
this[s] = n;
} };

@@ -716,24 +726,24 @@ return { get: r, set(n) {

static getPropertyOptions(t) {
return this.elementProperties.get(t) ?? _t;
return this.elementProperties.get(t) ?? ft;
}
static _$Ei() {
if (this.hasOwnProperty(k("elementProperties"))) return;
const t = ue(this);
if (this.hasOwnProperty(U("elementProperties"))) return;
const t = _e(this);
t.finalize(), t.l !== void 0 && (this.l = [...t.l]), this.elementProperties = new Map(t.elementProperties);
}
static finalize() {
if (this.hasOwnProperty(k("finalized"))) return;
if (this.finalized = !0, this._$Ei(), this.hasOwnProperty(k("properties"))) {
const e = this.properties, i = [...de(e), ...pe(e)];
for (const r of i) this.createProperty(r, e[r]);
if (this.hasOwnProperty(U("finalized"))) return;
if (this.finalized = !0, this._$Ei(), this.hasOwnProperty(U("properties"))) {
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);
}

@@ -743,11 +753,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;

@@ -768,4 +778,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);

@@ -775,3 +785,3 @@ }

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

@@ -786,13 +796,13 @@ 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 o = (i.converter?.toAttribute !== void 0 ? i.converter : L).toAttribute(e, i.type);
const o = (i.converter?.toAttribute !== void 0 ? i.converter : L).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);

@@ -802,16 +812,16 @@ if (r !== void 0 && this._$Em !== r) {

this._$Em = r;
const a = n.fromAttribute(e, o.type);
const a = n.fromAttribute(s, o.type);
this[r] = a ?? this._$Ej?.get(r) ?? a, this._$Em = null;
}
}
requestUpdate(t, e, i, r = !1, o) {
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 ?? X)(o, e) || i.useDefault && i.reflect && o === this._$Ej?.get(t) && !this.hasAttribute(n._$Eu(t, i)))) return;
this.C(t, e, i);
if (r === !1 && (o = this[t]), i ??= n.getPropertyOptions(t), !((i.hasChanged ?? X)(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: o }, n) {
i && !(this._$Ej ??= /* @__PURE__ */ new Map()).has(t) && (this._$Ej.set(t, n ?? e ?? this[t]), o !== !0 || n !== 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));
}

@@ -822,4 +832,4 @@ async _$EP() {

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

@@ -846,9 +856,9 @@ const t = this.scheduleUpdate();

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);
}

@@ -858,3 +868,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);
}

@@ -874,3 +884,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();
}

@@ -882,3 +892,3 @@ updated(t) {

}
C.elementStyles = [], C.shadowRootOptions = { mode: "open" }, C[k("elementProperties")] = /* @__PURE__ */ new Map(), C[k("finalized")] = /* @__PURE__ */ new Map(), _e?.({ ReactiveElement: C }), (I.reactiveElementVersions ??= []).push("2.1.2");
C.elementStyles = [], C.shadowRootOptions = { mode: "open" }, C[U("elementProperties")] = /* @__PURE__ */ new Map(), C[U("finalized")] = /* @__PURE__ */ new Map(), $e?.({ ReactiveElement: C }), (I.reactiveElementVersions ??= []).push("2.1.2");
/**

@@ -889,19 +899,19 @@ * @license

*/
const $e = { attribute: !0, type: String, converter: L, reflect: !1, hasChanged: X }, ye = (s = $e, t, e) => {
const { kind: i, metadata: r } = e;
const be = { attribute: !0, type: String, converter: L, reflect: !1, hasChanged: X }, ye = (e = be, 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" && ((s = Object.create(s)).wrapped = !0), o.set(e.name, s), i === "accessor") {
const { name: n } = e;
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, s, !0, a);
const l = t.get.call(this);
t.set.call(this, a), this.requestUpdate(n, l, e, !0, a);
}, init(a) {
return a !== void 0 && this.C(n, void 0, s, a), a;
return a !== void 0 && this.C(n, void 0, e, a), a;
} };
}
if (i === "setter") {
const { name: n } = e;
const { name: n } = s;
return function(a) {
const h = this[n];
t.call(this, a), this.requestUpdate(n, h, s, !0, a);
const l = this[n];
t.call(this, a), this.requestUpdate(n, l, e, !0, a);
};

@@ -911,14 +921,14 @@ }

};
function kt(s) {
return (t, e) => typeof e == "object" ? ye(s, t, e) : ((i, r, o) => {
function Ot(e) {
return (t, s) => typeof s == "object" ? ye(e, t, s) : ((i, r, o) => {
const n = r.hasOwnProperty(o);
return r.constructor.createProperty(o, i), n ? Object.getOwnPropertyDescriptor(r, o) : void 0;
})(s, t, e);
})(e, t, s);
}
var me = Object.defineProperty, be = Object.getOwnPropertyDescriptor, $ = (s, t, e, i) => {
for (var r = i > 1 ? void 0 : i ? be(t, e) : t, o = s.length - 1, n; o >= 0; o--)
(n = s[o]) && (r = (i ? n(t, e, r) : n(r)) || r);
return i && r && me(t, e, r), r;
var me = Object.defineProperty, ge = Object.getOwnPropertyDescriptor, _ = (e, t, s, i) => {
for (var r = i > 1 ? void 0 : i ? ge(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 && me(t, s, r), r;
};
let F = class extends E {
let F = class extends g {
alert = !1;

@@ -933,4 +943,4 @@ _isOpen = !1;

_setup() {
const s = this._content, t = this._backdrop, e = this._trigger;
s && !this._setupDone && (this._setupDone = !0, s.hasAttribute("role") || s.setAttribute("role", this.alert ? "alertdialog" : "dialog"), s.setAttribute("aria-modal", "true"), s.setAttribute("data-hp-overlay-content", ""), s.setAttribute("data-state", "closed"), s.setAttribute("aria-hidden", "true"), s.addEventListener("keydown", this._handleKeyDown), this._focusTrap = new re(s)), t && !t.hasAttribute("data-hp-backdrop") && (t.setAttribute("data-hp-backdrop", ""), t.setAttribute("data-state", "closed"), this.alert || t.addEventListener("click", this._close)), e && !e.hasAttribute("data-hp-setup") && (e.setAttribute("data-hp-setup", ""), e.addEventListener("click", this._open));
const e = this._content, t = this._backdrop, s = this._trigger;
e && !this._setupDone && (this._setupDone = !0, e.hasAttribute("role") || e.setAttribute("role", this.alert ? "alertdialog" : "dialog"), e.setAttribute("aria-modal", "true"), e.setAttribute("data-hp-overlay-content", ""), e.setAttribute("data-state", "closed"), e.setAttribute("aria-hidden", "true"), e.addEventListener("keydown", this._handleKeyDown), this._focusTrap = new oe(e)), e && e._linkAria?.(), t && !t.hasAttribute("data-hp-backdrop") && (t.setAttribute("data-hp-backdrop", ""), t.setAttribute("data-state", "closed"), this.alert || t.addEventListener("click", this._close)), s && !s.hasAttribute("data-hp-setup") && (s.setAttribute("data-hp-setup", ""), s.addEventListener("click", this._open));
}

@@ -952,4 +962,4 @@ disconnectedCallback() {

this._setup(), this._isOpen = !0, this._previousScrollPosition = window.scrollY, document.body.style.overflow = "hidden";
const s = this._content, t = this._backdrop, e = this._trigger;
s && (s.setAttribute("data-state", "open"), s.removeAttribute("aria-hidden")), t && t.setAttribute("data-state", "open"), e && s && (e.setAttribute("aria-expanded", "true"), e.setAttribute("aria-controls", s.id || "")), this._focusTrap?.activate(), this.emit("open");
const e = this._content, t = this._backdrop, s = this._trigger;
e && (e.setAttribute("data-state", "open"), e.removeAttribute("aria-hidden"), e._linkAria?.()), t && t.setAttribute("data-state", "open"), s && e && (s.setAttribute("aria-expanded", "true"), s.setAttribute("aria-controls", e.id || "")), this._focusTrap?.activate(), this.emit("open");
};

@@ -959,4 +969,4 @@ _close = () => {

this._isOpen = !1, document.body.style.overflow = "", window.scrollTo(0, this._previousScrollPosition);
const s = this._content, t = this._backdrop, e = this._trigger;
s && (s.setAttribute("data-state", "closed"), s.setAttribute("aria-hidden", "true")), t && t.setAttribute("data-state", "closed"), e && (e.setAttribute("aria-expanded", "false"), e.removeAttribute("aria-controls")), this._focusTrap?.deactivate(), this.emit("close");
const e = this._content, t = this._backdrop, s = this._trigger;
e && (e.setAttribute("data-state", "closed"), e.setAttribute("aria-hidden", "true")), t && t.setAttribute("data-state", "closed"), s && (s.setAttribute("aria-expanded", "false"), s.removeAttribute("aria-controls")), this._focusTrap?.deactivate(), this.emit("close");
};

@@ -970,19 +980,19 @@ /** Public API */

}
_handleKeyDown = (s) => {
if (s.key === "Escape") {
_handleKeyDown = (e) => {
if (e.key === "Escape") {
if (this.alert) {
s.preventDefault();
e.preventDefault();
return;
}
s.preventDefault(), this._close();
e.preventDefault(), this._close();
}
};
};
$([
kt({ type: Boolean, reflect: !0, attribute: "data-alert" })
_([
Ot({ type: Boolean, reflect: !0, attribute: "data-alert" })
], F.prototype, "alert", 2);
F = $([
S("hp-dialog")
F = _([
v("hp-dialog")
], F);
let V = class extends E {
let V = class extends g {
disabled = !1;

@@ -995,24 +1005,30 @@ connectedCallback() {

}
attributeChangedCallback(s, t, e) {
super.attributeChangedCallback(s, t, e), s === "disabled" && (e !== null ? (this.setAttribute("aria-disabled", "true"), this.removeAttribute("tabindex")) : (this.removeAttribute("aria-disabled"), this.setAttribute("tabindex", "0")));
attributeChangedCallback(e, t, s) {
super.attributeChangedCallback(e, t, s), e === "disabled" && (s !== null ? (this.setAttribute("aria-disabled", "true"), this.removeAttribute("tabindex")) : (this.removeAttribute("aria-disabled"), this.setAttribute("tabindex", "0")));
}
_handleKeyDown = (s) => {
(s.key === "Enter" || s.key === " ") && (s.preventDefault(), this.click());
_handleKeyDown = (e) => {
(e.key === "Enter" || e.key === " ") && (e.preventDefault(), this.click());
};
};
$([
kt({ type: Boolean, reflect: !0 })
_([
Ot({ type: Boolean, reflect: !0 })
], V.prototype, "disabled", 2);
V = $([
S("hp-dialog-trigger")
V = _([
v("hp-dialog-trigger")
], V);
let $t = class extends E {
let $t = class extends g {
connectedCallback() {
super.connectedCallback(), this.setAttribute("data-hp-component", "dialog-content"), this.id || (this.id = `hp-dialog-content-${this.hpId}`);
super.connectedCallback(), this.setAttribute("data-hp-component", "dialog-content"), this.id || (this.id = `hp-dialog-content-${this.hpId}`), this._linkAria(), requestAnimationFrame(() => this._linkAria());
}
_linkAria() {
const e = this.closest("hp-dialog");
if (!e) return;
const t = e.querySelector("hp-dialog-title"), s = e.querySelector("hp-dialog-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 = $([
S("hp-dialog-content")
$t = _([
v("hp-dialog-content")
], $t);
let yt = class extends E {
let bt = class extends g {
connectedCallback() {

@@ -1022,14 +1038,22 @@ super.connectedCallback(), this.setAttribute("data-hp-component", "dialog-backdrop");

};
yt = $([
S("hp-dialog-backdrop")
bt = _([
v("hp-dialog-backdrop")
], bt);
let yt = class extends g {
connectedCallback() {
super.connectedCallback(), this.setAttribute("data-hp-component", "dialog-title"), this.id || (this.id = `hp-dialog-title-${this.hpId}`);
}
};
yt = _([
v("hp-dialog-title")
], yt);
let mt = class extends E {
let mt = class extends g {
connectedCallback() {
super.connectedCallback(), this.setAttribute("data-hp-component", "dialog-title");
super.connectedCallback(), this.setAttribute("data-hp-component", "dialog-description"), this.id || (this.id = `hp-dialog-description-${this.hpId}`);
}
};
mt = $([
S("hp-dialog-title")
mt = _([
v("hp-dialog-description")
], mt);
let bt = class extends E {
let gt = class extends g {
connectedCallback() {

@@ -1044,16 +1068,17 @@ super.connectedCallback(), this.setAttribute("data-hp-component", "dialog-close"), this.hasAttribute("role") || this.setAttribute("role", "button"), this.hasAttribute("tabindex") || this.setAttribute("tabindex", "0"), this.addEventListener("click", this._onClick), this.addEventListener("keydown", this._onKeyDown);

};
_onKeyDown = (s) => {
(s.key === "Enter" || s.key === " ") && (s.preventDefault(), this._onClick());
_onKeyDown = (e) => {
(e.key === "Enter" || e.key === " ") && (e.preventDefault(), this._onClick());
};
};
bt = $([
S("hp-dialog-close")
], bt);
gt = _([
v("hp-dialog-close")
], gt);
export {
F as HeadlessDialog,
yt as HeadlessDialogBackdrop,
bt as HeadlessDialogClose,
bt as HeadlessDialogBackdrop,
gt as HeadlessDialogClose,
$t as HeadlessDialogContent,
mt as HeadlessDialogTitle,
mt as HeadlessDialogDescription,
yt as HeadlessDialogTitle,
V as HeadlessDialogTrigger
};

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

(function(h,_){typeof exports=="object"&&typeof module<"u"?_(exports):typeof define=="function"&&define.amd?define(["exports"],_):(h=typeof globalThis<"u"?globalThis:h||self,_(h.HeadlessPrimitivesDialog={}))})(this,function(h){"use strict";var _=globalThis,B=_.ShadowRoot&&(_.ShadyCSS===void 0||_.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,X=Symbol(),tt=new WeakMap,wt=class{constructor(t,e,i){if(this._$cssResult$=!0,i!==X)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(B&&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}},Ct=s=>new wt(typeof s=="string"?s:s+"",void 0,X),Pt=(s,t)=>{if(B)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=B?s=>s:s=>s instanceof CSSStyleSheet?(t=>{let e="";for(let i of t.cssRules)e+=i.cssText;return Ct(e)})(s):s,{is:Ut,defineProperty:kt,getOwnPropertyDescriptor:Dt,getOwnPropertyNames:Ot,getOwnPropertySymbols:Ht,getPrototypeOf:Tt}=Object,M=globalThis,st=M.trustedTypes,Mt=st?st.emptyScript:"",Rt=M.reactiveElementPolyfillSupport,P=(s,t)=>s,q={toAttribute(s,t){switch(t){case Boolean:s=s?Mt: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)=>!Ut(s,t),rt={attribute:!0,type:String,converter:q,reflect:!1,useDefault:!1,hasChanged:it};Symbol.metadata??=Symbol("metadata"),M.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&&kt(this.prototype,t,r)}}static getPropertyDescriptor(t,e,i){let{get:r,set:o}=Dt(this.prototype,t)??{get(){return this[e]},set(n){this[e]=n}};return{get:r,set(n){let 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)??rt}static _$Ei(){if(this.hasOwnProperty(P("elementProperties")))return;let t=Tt(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=[...Ot(e),...Ht(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 Pt(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 o=(i.converter?.toAttribute===void 0?q:i.converter).toAttribute(e,i.type);this._$Em=t,o==null?this.removeAttribute(r):this.setAttribute(r,o),this._$Em=null}}_$AK(t,e){let i=this.constructor,r=i._$Eh.get(t);if(r!==void 0&&this._$Em!==r){let o=i.getPropertyOptions(r),n=typeof o.converter=="function"?{fromAttribute:o.converter}:o.converter?.fromAttribute===void 0?q:o.converter;this._$Em=r;let a=n.fromAttribute(e,o.type);this[r]=a??this._$Ej?.get(r)??a,this._$Em=null}}requestUpdate(t,e,i,r=!1,o){if(t!==void 0){let n=this.constructor;if(r===!1&&(o=this[t]),i??=n.getPropertyOptions(t),!((i.hasChanged??it)(o,e)||i.useDefault&&i.reflect&&o===this._$Ej?.get(t)&&!this.hasAttribute(n._$Eu(t,i))))return;this.C(t,e,i)}this.isUpdatePending===!1&&(this._$ES=this._$EP())}C(t,e,{useDefault:i,reflect:r,wrapped:o},n){i&&!(this._$Ej??=new Map).has(t)&&(this._$Ej.set(t,n??e??this[t]),o!==!0||n!==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,o]of this._$Ep)this[r]=o;this._$Ep=void 0}let i=this.constructor.elementProperties;if(i.size>0)for(let[r,o]of i){let{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,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,Rt?.({ReactiveElement:A}),(M.reactiveElementVersions??=[]).push("2.1.2");var K=globalThis,ot=s=>s,R=K.trustedTypes,nt=R?R.createPolicy("lit-html",{createHTML:s=>s}):void 0,at="$lit$",$=`lit$${Math.random().toFixed(9).slice(2)}$`,lt="?"+$,xt=`<${lt}>`,m=document,U=()=>m.createComment(""),k=s=>s===null||typeof s!="object"&&typeof s!="function",F=Array.isArray,Lt=s=>F(s)||typeof s?.[Symbol.iterator]=="function",V=`[
\f\r]`,D=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,ht=/-->/g,dt=/>/g,b=RegExp(`>|${V}(?:([^\\s"'>=/]+)(${V}*=${V}*(?:[^
\f\r"'\`<>=]|("|')|))|$)`,"g"),ct=/'/g,ut=/"/g,pt=/^(?:script|style|textarea|title)$/i,E=Symbol.for("lit-noChange"),c=Symbol.for("lit-nothing"),ft=new WeakMap,v=m.createTreeWalker(m,129);function _t(s,t){if(!F(s)||!s.hasOwnProperty("raw"))throw Error("invalid template strings array");return nt===void 0?t:nt.createHTML(t)}var Nt=(s,t)=>{let e=s.length-1,i=[],r,o=t===2?"<svg>":t===3?"<math>":"",n=D;for(let a=0;a<e;a++){let l=s[a],I,p,d=-1,f=0;for(;f<l.length&&(n.lastIndex=f,p=n.exec(l),p!==null);)f=n.lastIndex,n===D?p[1]==="!--"?n=ht:p[1]===void 0?p[2]===void 0?p[3]!==void 0&&(n=b):(pt.test(p[2])&&(r=RegExp("</"+p[2],"g")),n=b):n=dt:n===b?p[0]===">"?(n=r??D,d=-1):p[1]===void 0?d=-2:(d=n.lastIndex-p[2].length,I=p[1],n=p[3]===void 0?b:p[3]==='"'?ut:ct):n===ut||n===ct?n=b:n===ht||n===dt?n=D:(n=b,r=void 0);let y=n===b&&s[a+1].startsWith("/>")?" ":"";o+=n===D?l+xt:d>=0?(i.push(I),l.slice(0,d)+at+l.slice(d)+$+y):l+$+(d===-2?a:y)}return[_t(s,o+(s[e]||"<?>")+(t===2?"</svg>":t===3?"</math>":"")),i]},W=class Et{constructor({strings:t,_$litType$:e},i){let r;this.parts=[];let o=0,n=0,a=t.length-1,l=this.parts,[I,p]=Nt(t,e);if(this.el=Et.createElement(I,i),v.currentNode=this.el.content,e===2||e===3){let d=this.el.content.firstChild;d.replaceWith(...d.childNodes)}for(;(r=v.nextNode())!==null&&l.length<a;){if(r.nodeType===1){if(r.hasAttributes())for(let d of r.getAttributeNames())if(d.endsWith(at)){let f=p[n++],y=r.getAttribute(d).split($),z=/([.?@])?(.*)/.exec(f);l.push({type:1,index:o,name:z[2],strings:y,ctor:z[1]==="."?It:z[1]==="?"?zt:z[1]==="@"?Bt:x}),r.removeAttribute(d)}else d.startsWith($)&&(l.push({type:6,index:o}),r.removeAttribute(d));if(pt.test(r.tagName)){let d=r.textContent.split($),f=d.length-1;if(f>0){r.textContent=R?R.emptyScript:"";for(let y=0;y<f;y++)r.append(d[y],U()),v.nextNode(),l.push({type:2,index:++o});r.append(d[f],U())}}}else if(r.nodeType===8)if(r.data===lt)l.push({type:2,index:o});else{let d=-1;for(;(d=r.data.indexOf($,d+1))!==-1;)l.push({type:7,index:o}),d+=$.length-1}o++}}static createElement(t,e){let i=m.createElement("template");return i.innerHTML=t,i}};function S(s,t,e=s,i){if(t===E)return t;let r=i===void 0?e._$Cl:e._$Co?.[i],o=k(t)?void 0:t._$litDirective$;return r?.constructor!==o&&(r?._$AO?.(!1),o===void 0?r=void 0:(r=new o(s),r._$AT(s,e,i)),i===void 0?e._$Cl=r:(e._$Co??=[])[i]=r),r!==void 0&&(t=S(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??m).importNode(t,!0);v.currentNode=i;let r=v.nextNode(),o=0,n=0,a=e[0];for(;a!==void 0;){if(o===a.index){let l;a.type===2?l=new J(r,r.nextSibling,this,s):a.type===1?l=new a.ctor(r,a.name,a.strings,this,s):a.type===6&&(l=new qt(r,this,s)),this._$AV.push(l),a=e[++n]}o!==a?.index&&(r=v.nextNode(),o++)}return v.currentNode=m,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++}},J=class St{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(t,e,i,r){this.type=2,this._$AH=c,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=S(this,t,e),k(t)?t===c||t==null||t===""?(this._$AH!==c&&this._$AR(),this._$AH=c):t!==this._$AH&&t!==E&&this._(t):t._$litType$===void 0?t.nodeType===void 0?Lt(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!==c&&k(this._$AH)?this._$AA.nextSibling.data=t:this.T(m.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=W.createElement(_t(i.h,i.h[0]),this.options)),i);if(this._$AH?._$AD===r)this._$AH.p(e);else{let o=new jt(r,this),n=o.u(this.options);o.p(e),this.T(n),this._$AH=o}}_$AC(t){let e=ft.get(t.strings);return e===void 0&&ft.set(t.strings,e=new W(t)),e}k(t){F(this._$AH)||(this._$AH=[],this._$AR());let e=this._$AH,i,r=0;for(let o of t)r===e.length?e.push(i=new St(this.O(U()),this.O(U()),this,this.options)):i=e[r],i._$AI(o),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=ot(t).nextSibling;ot(t).remove(),t=i}}setConnected(t){this._$AM===void 0&&(this._$Cv=t,this._$AP?.(t))}},x=class{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(s,t,e,i,r){this.type=1,this._$AH=c,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=c}_$AI(s,t=this,e,i){let r=this.strings,o=!1;if(r===void 0)s=S(this,s,t,0),o=!k(s)||s!==this._$AH&&s!==E,o&&(this._$AH=s);else{let n=s,a,l;for(s=r[0],a=0;a<r.length-1;a++)l=S(this,n[e+a],t,a),l===E&&(l=this._$AH[a]),o||=!k(l)||l!==this._$AH[a],l===c?s=c:s!==c&&(s+=(l??"")+r[a+1]),this._$AH[a]=l}o&&!i&&this.j(s)}j(s){s===c?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,s??"")}},It=class extends x{constructor(){super(...arguments),this.type=3}j(s){this.element[this.name]=s===c?void 0:s}},zt=class extends x{constructor(){super(...arguments),this.type=4}j(s){this.element.toggleAttribute(this.name,!!s&&s!==c)}},Bt=class extends x{constructor(s,t,e,i,r){super(s,t,e,i,r),this.type=5}_$AI(s,t=this){if((s=S(this,s,t,0)??c)===E)return;let e=this._$AH,i=s===c&&e!==c||s.capture!==e.capture||s.once!==e.once||s.passive!==e.passive,r=s!==c&&(e===c||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)}},qt=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){S(this,s)}},Kt=K.litHtmlPolyfillSupport;Kt?.(W,J),(K.litHtmlVersions??=[]).push("3.3.2");var Ft=(s,t,e)=>{let i=e?.renderBefore??t,r=i._$litPart$;if(r===void 0){let o=e?.renderBefore??null;i._$litPart$=r=new J(t.insertBefore(U(),o),o,void 0,e??{})}return r._$AI(s),r},Z=globalThis,O=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 E}};O._$litElement$=!0,O.finalized=!0,Z.litElementHydrateSupport?.({LitElement:O});var Vt=Z.litElementPolyfillSupport;Vt?.({LitElement:O}),(Z.litElementVersions??=[]).push("4.2.2");var u=[];for(let s=0;s<256;++s)u.push((s+256).toString(16).slice(1));function Wt(s,t=0){return(u[s[t+0]]+u[s[t+1]]+u[s[t+2]]+u[s[t+3]]+"-"+u[s[t+4]]+u[s[t+5]]+"-"+u[s[t+6]]+u[s[t+7]]+"-"+u[s[t+8]]+u[s[t+9]]+"-"+u[s[t+10]]+u[s[t+11]]+u[s[t+12]]+u[s[t+13]]+u[s[t+14]]+u[s[t+15]]).toLowerCase()}var Y,Jt=new Uint8Array(16);function Zt(){if(!Y){if(typeof crypto>"u"||!crypto.getRandomValues)throw Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");Y=crypto.getRandomValues.bind(crypto)}return Y(Jt)}var $t={randomUUID:typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function Yt(s,t,e){s||={};let i=s.random??s.rng?.()??Zt();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,Wt(i)}function Gt(s,t,e){return $t.randomUUID&&!t&&!s?$t.randomUUID():Yt(s,t)}function Qt(s="hp"){return`${s}-${Gt()}`}var w=class extends O{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=Qt();get hpId(){return this._hpId}};function C(s){return function(t){typeof window<"u"&&(customElements.get(s)||customElements.define(s,t))}}var Xt=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(h,$){typeof exports=="object"&&typeof module<"u"?$(exports):typeof define=="function"&&define.amd?define(["exports"],$):(h=typeof globalThis<"u"?globalThis:h||self,$(h.HeadlessPrimitivesDialog={}))})(this,function(h){"use strict";var $=globalThis,q=$.ShadowRoot&&($.ShadyCSS===void 0||$.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,X=Symbol(),tt=new WeakMap,wt=class{constructor(t,s,i){if(this._$cssResult$=!0,i!==X)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}},Ct=e=>new wt(typeof e=="string"?e:e+"",void 0,X),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 Ct(s)})(e):e,{is:kt,defineProperty:Dt,getOwnPropertyDescriptor:Ut,getOwnPropertyNames:Ot,getOwnPropertySymbols:Ht,getPrototypeOf:Tt}=Object,M=globalThis,st=M.trustedTypes,Mt=st?st.emptyScript:"",Rt=M.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)=>!kt(e,t),rt={attribute:!0,type:String,converter:B,reflect:!1,useDefault:!1,hasChanged:it};Symbol.metadata??=Symbol("metadata"),M.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&&Dt(this.prototype,e,i)}}static getPropertyDescriptor(e,t,s){let{get:i,set:r}=Ut(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=Tt(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=[...Ot(t),...Ht(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,Rt?.({ReactiveElement:S}),(M.reactiveElementVersions??=[]).push("2.1.2");var K=globalThis,ot=e=>e,R=K.trustedTypes,nt=R?R.createPolicy("lit-html",{createHTML:e=>e}):void 0,at="$lit$",g=`lit$${Math.random().toFixed(9).slice(2)}$`,lt="?"+g,xt=`<${lt}>`,y=document,k=()=>y.createComment(""),D=e=>e===null||typeof e!="object"&&typeof e!="function",F=Array.isArray,Lt=e=>F(e)||typeof e?.[Symbol.iterator]=="function",V=`[
\f\r]`,U=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,ht=/-->/g,dt=/>/g,m=RegExp(`>|${V}(?:([^\\s"'>=/]+)(${V}*=${V}*(?:[^
\f\r"'\`<>=]|("|')|))|$)`,"g"),ct=/'/g,ut=/"/g,pt=/^(?:script|style|textarea|title)$/i,w=Symbol.for("lit-noChange"),c=Symbol.for("lit-nothing"),ft=new WeakMap,v=y.createTreeWalker(y,129);function _t(e,t){if(!F(e)||!e.hasOwnProperty("raw"))throw Error("invalid template strings array");return nt===void 0?t:nt.createHTML(t)}var Nt=(e,t)=>{let s=e.length-1,i=[],r,o=t===2?"<svg>":t===3?"<math>":"",n=U;for(let a=0;a<s;a++){let l=e[a],I,p,d=-1,_=0;for(;_<l.length&&(n.lastIndex=_,p=n.exec(l),p!==null);)_=n.lastIndex,n===U?p[1]==="!--"?n=ht:p[1]===void 0?p[2]===void 0?p[3]!==void 0&&(n=m):(pt.test(p[2])&&(r=RegExp("</"+p[2],"g")),n=m):n=dt:n===m?p[0]===">"?(n=r??U,d=-1):p[1]===void 0?d=-2:(d=n.lastIndex-p[2].length,I=p[1],n=p[3]===void 0?m:p[3]==='"'?ut:ct):n===ut||n===ct?n=m:n===ht||n===dt?n=U:(n=m,r=void 0);let b=n===m&&e[a+1].startsWith("/>")?" ":"";o+=n===U?l+xt:d>=0?(i.push(I),l.slice(0,d)+at+l.slice(d)+g+b):l+g+(d===-2?a:b)}return[_t(e,o+(e[s]||"<?>")+(t===2?"</svg>":t===3?"</math>":"")),i]},W=class Et{constructor({strings:t,_$litType$:s},i){let r;this.parts=[];let o=0,n=0,a=t.length-1,l=this.parts,[I,p]=Nt(t,s);if(this.el=Et.createElement(I,i),v.currentNode=this.el.content,s===2||s===3){let d=this.el.content.firstChild;d.replaceWith(...d.childNodes)}for(;(r=v.nextNode())!==null&&l.length<a;){if(r.nodeType===1){if(r.hasAttributes())for(let d of r.getAttributeNames())if(d.endsWith(at)){let _=p[n++],b=r.getAttribute(d).split(g),z=/([.?@])?(.*)/.exec(_);l.push({type:1,index:o,name:z[2],strings:b,ctor:z[1]==="."?It:z[1]==="?"?zt:z[1]==="@"?qt:x}),r.removeAttribute(d)}else d.startsWith(g)&&(l.push({type:6,index:o}),r.removeAttribute(d));if(pt.test(r.tagName)){let d=r.textContent.split(g),_=d.length-1;if(_>0){r.textContent=R?R.emptyScript:"";for(let b=0;b<_;b++)r.append(d[b],k()),v.nextNode(),l.push({type:2,index:++o});r.append(d[_],k())}}}else if(r.nodeType===8)if(r.data===lt)l.push({type:2,index:o});else{let d=-1;for(;(d=r.data.indexOf(g,d+1))!==-1;)l.push({type:7,index:o}),d+=g.length-1}o++}}static createElement(t,s){let i=y.createElement("template");return i.innerHTML=t,i}};function C(e,t,s=e,i){if(t===w)return t;let r=i===void 0?s._$Cl:s._$Co?.[i],o=D(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=C(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??y).importNode(t,!0);v.currentNode=i;let r=v.nextNode(),o=0,n=0,a=s[0];for(;a!==void 0;){if(o===a.index){let l;a.type===2?l=new J(r,r.nextSibling,this,e):a.type===1?l=new a.ctor(r,a.name,a.strings,this,e):a.type===6&&(l=new Bt(r,this,e)),this._$AV.push(l),a=s[++n]}o!==a?.index&&(r=v.nextNode(),o++)}return v.currentNode=y,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=c,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=C(this,t,s),D(t)?t===c||t==null||t===""?(this._$AH!==c&&this._$AR(),this._$AH=c):t!==this._$AH&&t!==w&&this._(t):t._$litType$===void 0?t.nodeType===void 0?Lt(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!==c&&D(this._$AH)?this._$AA.nextSibling.data=t:this.T(y.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=W.createElement(_t(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=ft.get(t.strings);return s===void 0&&ft.set(t.strings,s=new W(t)),s}k(t){F(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(k()),this.O(k()),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))}},x=class{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(e,t,s,i,r){this.type=1,this._$AH=c,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=c}_$AI(e,t=this,s,i){let r=this.strings,o=!1;if(r===void 0)e=C(this,e,t,0),o=!D(e)||e!==this._$AH&&e!==w,o&&(this._$AH=e);else{let n=e,a,l;for(e=r[0],a=0;a<r.length-1;a++)l=C(this,n[s+a],t,a),l===w&&(l=this._$AH[a]),o||=!D(l)||l!==this._$AH[a],l===c?e=c:e!==c&&(e+=(l??"")+r[a+1]),this._$AH[a]=l}o&&!i&&this.j(e)}j(e){e===c?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,e??"")}},It=class extends x{constructor(){super(...arguments),this.type=3}j(e){this.element[this.name]=e===c?void 0:e}},zt=class extends x{constructor(){super(...arguments),this.type=4}j(e){this.element.toggleAttribute(this.name,!!e&&e!==c)}},qt=class extends x{constructor(e,t,s,i,r){super(e,t,s,i,r),this.type=5}_$AI(e,t=this){if((e=C(this,e,t,0)??c)===w)return;let s=this._$AH,i=e===c&&s!==c||e.capture!==s.capture||e.once!==s.once||e.passive!==s.passive,r=e!==c&&(s===c||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){C(this,e)}},Kt=K.litHtmlPolyfillSupport;Kt?.(W,J),(K.litHtmlVersions??=[]).push("3.3.2");var Ft=(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(k(),o),o,void 0,s??{})}return r._$AI(e),r},Z=globalThis,O=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=Ft(t,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return w}};O._$litElement$=!0,O.finalized=!0,Z.litElementHydrateSupport?.({LitElement:O});var Vt=Z.litElementPolyfillSupport;Vt?.({LitElement:O}),(Z.litElementVersions??=[]).push("4.2.2");var u=[];for(let e=0;e<256;++e)u.push((e+256).toString(16).slice(1));function Wt(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 Y,Jt=new Uint8Array(16);function Zt(){if(!Y){if(typeof crypto>"u"||!crypto.getRandomValues)throw Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");Y=crypto.getRandomValues.bind(crypto)}return Y(Jt)}var $t={randomUUID:typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function Yt(e,t,s){e||={};let i=e.random??e.rng?.()??Zt();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,Wt(i)}function Gt(e,t,s){return $t.randomUUID&&!t&&!e?$t.randomUUID():Yt(e,t)}function Qt(e="hp"){return`${e}-${Gt()}`}var A=class extends O{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=Qt();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 E(e){return function(t){typeof window<"u"&&(customElements.get(e)||customElements.define(e,t))}}var Xt=class{_container;_active=!1;_previouslyFocusedElement=null;_focusableElements=[];constructor(e){this._container=e}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=e=>{if(!this._active)return;let t=e.target;this._container.contains(t)||this._focusableElements.length>0&&this._focusableElements[0].focus()};_handleKeyDown=e=>{if(!this._active||e.key!=="Tab")return;e.preventDefault();let t=this._focusableElements.indexOf(document.activeElement),s;s=e.shiftKey?t>0?t-1:this._focusableElements.length-1:t<this._focusableElements.length-1?t+1:0,this._focusableElements[s].focus()}};/**
* @license
* Copyright 2019 Google LLC
* SPDX-License-Identifier: BSD-3-Clause
*/const L=globalThis,G=L.ShadowRoot&&(L.ShadyCSS===void 0||L.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,gt=Symbol(),yt=new WeakMap;let te=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}get styleSheet(){let t=this.o;const e=this.t;if(G&&t===void 0){const i=e!==void 0&&e.length===1;i&&(t=yt.get(e)),t===void 0&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),i&&yt.set(e,t))}return t}toString(){return this.cssText}};const ee=s=>new te(typeof s=="string"?s:s+"",void 0,gt),se=(s,t)=>{if(G)s.adoptedStyleSheets=t.map(e=>e instanceof CSSStyleSheet?e:e.styleSheet);else for(const e of t){const i=document.createElement("style"),r=L.litNonce;r!==void 0&&i.setAttribute("nonce",r),i.textContent=e.cssText,s.appendChild(i)}},mt=G?s=>s:s=>s instanceof CSSStyleSheet?(t=>{let e="";for(const i of t.cssRules)e+=i.cssText;return ee(e)})(s):s;/**
*/const L=globalThis,G=L.ShadowRoot&&(L.ShadyCSS===void 0||L.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,gt=Symbol(),bt=new WeakMap;let te=class{constructor(t,s,i){if(this._$cssResult$=!0,i!==gt)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(G&&t===void 0){const i=s!==void 0&&s.length===1;i&&(t=bt.get(s)),t===void 0&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),i&&bt.set(s,t))}return t}toString(){return this.cssText}};const ee=e=>new te(typeof e=="string"?e:e+"",void 0,gt),se=(e,t)=>{if(G)e.adoptedStyleSheets=t.map(s=>s instanceof CSSStyleSheet?s:s.styleSheet);else for(const s of t){const i=document.createElement("style"),r=L.litNonce;r!==void 0&&i.setAttribute("nonce",r),i.textContent=s.cssText,e.appendChild(i)}},yt=G?e=>e:e=>e instanceof CSSStyleSheet?(t=>{let s="";for(const i of t.cssRules)s+=i.cssText;return ee(s)})(e):e;/**
* @license
* Copyright 2017 Google LLC
* SPDX-License-Identifier: BSD-3-Clause
*/const{is:ie,defineProperty:re,getOwnPropertyDescriptor:oe,getOwnPropertyNames:ne,getOwnPropertySymbols:ae,getPrototypeOf:le}=Object,N=globalThis,bt=N.trustedTypes,he=bt?bt.emptyScript:"",de=N.reactiveElementPolyfillSupport,H=(s,t)=>s,j={toAttribute(s,t){switch(t){case Boolean:s=s?he: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}},Q=(s,t)=>!ie(s,t),vt={attribute:!0,type:String,converter:j,reflect:!1,useDefault:!1,hasChanged:Q};Symbol.metadata??=Symbol("metadata"),N.litPropertyMetadata??=new WeakMap;class T 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=vt){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:o}=oe(this.prototype,t)??{get(){return this[e]},set(n){this[e]=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)??vt}static _$Ei(){if(this.hasOwnProperty(H("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(H("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(H("properties"))){const e=this.properties,i=[...ne(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(mt(r))}else t!==void 0&&e.push(mt(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 o=(i.converter?.toAttribute!==void 0?i.converter:j).toAttribute(e,i.type);this._$Em=t,o==null?this.removeAttribute(r):this.setAttribute(r,o),this._$Em=null}}_$AK(t,e){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:j;this._$Em=r;const a=n.fromAttribute(e,o.type);this[r]=a??this._$Ej?.get(r)??a,this._$Em=null}}requestUpdate(t,e,i,r=!1,o){if(t!==void 0){const n=this.constructor;if(r===!1&&(o=this[t]),i??=n.getPropertyOptions(t),!((i.hasChanged??Q)(o,e)||i.useDefault&&i.reflect&&o===this._$Ej?.get(t)&&!this.hasAttribute(n._$Eu(t,i))))return;this.C(t,e,i)}this.isUpdatePending===!1&&(this._$ES=this._$EP())}C(t,e,{useDefault:i,reflect:r,wrapped:o},n){i&&!(this._$Ej??=new Map).has(t)&&(this._$Ej.set(t,n??e??this[t]),o!==!0||n!==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,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 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){}}T.elementStyles=[],T.shadowRootOptions={mode:"open"},T[H("elementProperties")]=new Map,T[H("finalized")]=new Map,de?.({ReactiveElement:T}),(N.reactiveElementVersions??=[]).push("2.1.2");/**
*/const{is:ie,defineProperty:re,getOwnPropertyDescriptor:oe,getOwnPropertyNames:ne,getOwnPropertySymbols:ae,getPrototypeOf:le}=Object,N=globalThis,mt=N.trustedTypes,he=mt?mt.emptyScript:"",de=N.reactiveElementPolyfillSupport,H=(e,t)=>e,j={toAttribute(e,t){switch(t){case Boolean:e=e?he: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}},Q=(e,t)=>!ie(e,t),vt={attribute:!0,type:String,converter:j,reflect:!1,useDefault:!1,hasChanged:Q};Symbol.metadata??=Symbol("metadata"),N.litPropertyMetadata??=new WeakMap;class T 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=vt){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&&re(this.prototype,t,r)}}static getPropertyDescriptor(t,s,i){const{get:r,set:o}=oe(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)??vt}static _$Ei(){if(this.hasOwnProperty(H("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(H("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(H("properties"))){const s=this.properties,i=[...ne(s),...ae(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 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,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:j).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:j;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??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,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){}}T.elementStyles=[],T.shadowRootOptions={mode:"open"},T[H("elementProperties")]=new Map,T[H("finalized")]=new Map,de?.({ReactiveElement:T}),(N.reactiveElementVersions??=[]).push("2.1.2");/**
* @license
* Copyright 2017 Google LLC
* SPDX-License-Identifier: BSD-3-Clause
*/const ce={attribute:!0,type:String,converter:j,reflect:!1,hasChanged:Q},ue=(s=ce,t,e)=>{const{kind:i,metadata:r}=e;let o=globalThis.litPropertyMetadata.get(r);if(o===void 0&&globalThis.litPropertyMetadata.set(r,o=new Map),i==="setter"&&((s=Object.create(s)).wrapped=!0),o.set(e.name,s),i==="accessor"){const{name:n}=e;return{set(a){const l=t.get.call(this);t.set.call(this,a),this.requestUpdate(n,l,s,!0,a)},init(a){return a!==void 0&&this.C(n,void 0,s,a),a}}}if(i==="setter"){const{name:n}=e;return function(a){const l=this[n];t.call(this,a),this.requestUpdate(n,l,s,!0,a)}}throw Error("Unsupported decorator location: "+i)};function At(s){return(t,e)=>typeof e=="object"?ue(s,t,e):((i,r,o)=>{const n=r.hasOwnProperty(o);return r.constructor.createProperty(o,i),n?Object.getOwnPropertyDescriptor(r,o):void 0})(s,t,e)}var pe=Object.defineProperty,fe=Object.getOwnPropertyDescriptor,g=(s,t,e,i)=>{for(var r=i>1?void 0:i?fe(t,e):t,o=s.length-1,n;o>=0;o--)(n=s[o])&&(r=(i?n(t,e,r):n(r))||r);return i&&r&&pe(t,e,r),r};h.HeadlessDialog=class extends w{alert=!1;_isOpen=!1;_focusTrap=null;_previousScrollPosition=0;_setupDone=!1;connectedCallback(){super.connectedCallback(),this.setAttribute("data-hp-component","dialog"),this.addEventListener("hp-close",this._close),this._setup(),requestAnimationFrame(()=>this._setup())}_setup(){const t=this._content,e=this._backdrop,i=this._trigger;t&&!this._setupDone&&(this._setupDone=!0,t.hasAttribute("role")||t.setAttribute("role",this.alert?"alertdialog":"dialog"),t.setAttribute("aria-modal","true"),t.setAttribute("data-hp-overlay-content",""),t.setAttribute("data-state","closed"),t.setAttribute("aria-hidden","true"),t.addEventListener("keydown",this._handleKeyDown),this._focusTrap=new Xt(t)),e&&!e.hasAttribute("data-hp-backdrop")&&(e.setAttribute("data-hp-backdrop",""),e.setAttribute("data-state","closed"),this.alert||e.addEventListener("click",this._close)),i&&!i.hasAttribute("data-hp-setup")&&(i.setAttribute("data-hp-setup",""),i.addEventListener("click",this._open))}disconnectedCallback(){super.disconnectedCallback(),this._setupDone=!1,this._content?.removeEventListener("keydown",this._handleKeyDown),this._backdrop?.removeEventListener("click",this._close),this._trigger?.removeEventListener("click",this._open),this.removeEventListener("hp-close",this._close)}get _trigger(){return this.querySelector("hp-dialog-trigger")}get _content(){return this.querySelector("hp-dialog-content")}get _backdrop(){return this.querySelector("hp-dialog-backdrop")}_open=()=>{if(this._isOpen)return;this._setup(),this._isOpen=!0,this._previousScrollPosition=window.scrollY,document.body.style.overflow="hidden";const t=this._content,e=this._backdrop,i=this._trigger;t&&(t.setAttribute("data-state","open"),t.removeAttribute("aria-hidden")),e&&e.setAttribute("data-state","open"),i&&t&&(i.setAttribute("aria-expanded","true"),i.setAttribute("aria-controls",t.id||"")),this._focusTrap?.activate(),this.emit("open")};_close=()=>{if(!this._isOpen)return;this._isOpen=!1,document.body.style.overflow="",window.scrollTo(0,this._previousScrollPosition);const t=this._content,e=this._backdrop,i=this._trigger;t&&(t.setAttribute("data-state","closed"),t.setAttribute("aria-hidden","true")),e&&e.setAttribute("data-state","closed"),i&&(i.setAttribute("aria-expanded","false"),i.removeAttribute("aria-controls")),this._focusTrap?.deactivate(),this.emit("close")};open(){this._open()}close(){this._close()}_handleKeyDown=t=>{if(t.key==="Escape"){if(this.alert){t.preventDefault();return}t.preventDefault(),this._close()}}},g([At({type:Boolean,reflect:!0,attribute:"data-alert"})],h.HeadlessDialog.prototype,"alert",2),h.HeadlessDialog=g([C("hp-dialog")],h.HeadlessDialog),h.HeadlessDialogTrigger=class extends w{disabled=!1;connectedCallback(){super.connectedCallback(),this.setAttribute("data-hp-component","dialog-trigger"),this.hasAttribute("role")||this.setAttribute("role","button"),this.disabled||this.setAttribute("tabindex","0"),this.addEventListener("keydown",this._handleKeyDown)}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("keydown",this._handleKeyDown)}attributeChangedCallback(t,e,i){super.attributeChangedCallback(t,e,i),t==="disabled"&&(i!==null?(this.setAttribute("aria-disabled","true"),this.removeAttribute("tabindex")):(this.removeAttribute("aria-disabled"),this.setAttribute("tabindex","0")))}_handleKeyDown=t=>{(t.key==="Enter"||t.key===" ")&&(t.preventDefault(),this.click())}},g([At({type:Boolean,reflect:!0})],h.HeadlessDialogTrigger.prototype,"disabled",2),h.HeadlessDialogTrigger=g([C("hp-dialog-trigger")],h.HeadlessDialogTrigger),h.HeadlessDialogContent=class extends w{connectedCallback(){super.connectedCallback(),this.setAttribute("data-hp-component","dialog-content"),this.id||(this.id=`hp-dialog-content-${this.hpId}`)}},h.HeadlessDialogContent=g([C("hp-dialog-content")],h.HeadlessDialogContent),h.HeadlessDialogBackdrop=class extends w{connectedCallback(){super.connectedCallback(),this.setAttribute("data-hp-component","dialog-backdrop")}},h.HeadlessDialogBackdrop=g([C("hp-dialog-backdrop")],h.HeadlessDialogBackdrop),h.HeadlessDialogTitle=class extends w{connectedCallback(){super.connectedCallback(),this.setAttribute("data-hp-component","dialog-title")}},h.HeadlessDialogTitle=g([C("hp-dialog-title")],h.HeadlessDialogTitle),h.HeadlessDialogClose=class extends w{connectedCallback(){super.connectedCallback(),this.setAttribute("data-hp-component","dialog-close"),this.hasAttribute("role")||this.setAttribute("role","button"),this.hasAttribute("tabindex")||this.setAttribute("tabindex","0"),this.addEventListener("click",this._onClick),this.addEventListener("keydown",this._onKeyDown)}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("click",this._onClick),this.removeEventListener("keydown",this._onKeyDown)}_onClick=()=>{this.emit("close")};_onKeyDown=t=>{(t.key==="Enter"||t.key===" ")&&(t.preventDefault(),this._onClick())}},h.HeadlessDialogClose=g([C("hp-dialog-close")],h.HeadlessDialogClose),Object.defineProperty(h,Symbol.toStringTag,{value:"Module"})});
*/const ce={attribute:!0,type:String,converter:j,reflect:!1,hasChanged:Q},ue=(e=ce,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 l=t.get.call(this);t.set.call(this,a),this.requestUpdate(n,l,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 l=this[n];t.call(this,a),this.requestUpdate(n,l,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 pe=Object.defineProperty,fe=Object.getOwnPropertyDescriptor,f=(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&&pe(t,s,r),r};h.HeadlessDialog=class extends A{alert=!1;_isOpen=!1;_focusTrap=null;_previousScrollPosition=0;_setupDone=!1;connectedCallback(){super.connectedCallback(),this.setAttribute("data-hp-component","dialog"),this.addEventListener("hp-close",this._close),this._setup(),requestAnimationFrame(()=>this._setup())}_setup(){const t=this._content,s=this._backdrop,i=this._trigger;t&&!this._setupDone&&(this._setupDone=!0,t.hasAttribute("role")||t.setAttribute("role",this.alert?"alertdialog":"dialog"),t.setAttribute("aria-modal","true"),t.setAttribute("data-hp-overlay-content",""),t.setAttribute("data-state","closed"),t.setAttribute("aria-hidden","true"),t.addEventListener("keydown",this._handleKeyDown),this._focusTrap=new Xt(t)),t&&t._linkAria?.(),s&&!s.hasAttribute("data-hp-backdrop")&&(s.setAttribute("data-hp-backdrop",""),s.setAttribute("data-state","closed"),this.alert||s.addEventListener("click",this._close)),i&&!i.hasAttribute("data-hp-setup")&&(i.setAttribute("data-hp-setup",""),i.addEventListener("click",this._open))}disconnectedCallback(){super.disconnectedCallback(),this._setupDone=!1,this._content?.removeEventListener("keydown",this._handleKeyDown),this._backdrop?.removeEventListener("click",this._close),this._trigger?.removeEventListener("click",this._open),this.removeEventListener("hp-close",this._close)}get _trigger(){return this.querySelector("hp-dialog-trigger")}get _content(){return this.querySelector("hp-dialog-content")}get _backdrop(){return this.querySelector("hp-dialog-backdrop")}_open=()=>{if(this._isOpen)return;this._setup(),this._isOpen=!0,this._previousScrollPosition=window.scrollY,document.body.style.overflow="hidden";const t=this._content,s=this._backdrop,i=this._trigger;t&&(t.setAttribute("data-state","open"),t.removeAttribute("aria-hidden"),t._linkAria?.()),s&&s.setAttribute("data-state","open"),i&&t&&(i.setAttribute("aria-expanded","true"),i.setAttribute("aria-controls",t.id||"")),this._focusTrap?.activate(),this.emit("open")};_close=()=>{if(!this._isOpen)return;this._isOpen=!1,document.body.style.overflow="",window.scrollTo(0,this._previousScrollPosition);const t=this._content,s=this._backdrop,i=this._trigger;t&&(t.setAttribute("data-state","closed"),t.setAttribute("aria-hidden","true")),s&&s.setAttribute("data-state","closed"),i&&(i.setAttribute("aria-expanded","false"),i.removeAttribute("aria-controls")),this._focusTrap?.deactivate(),this.emit("close")};open(){this._open()}close(){this._close()}_handleKeyDown=t=>{if(t.key==="Escape"){if(this.alert){t.preventDefault();return}t.preventDefault(),this._close()}}},f([At({type:Boolean,reflect:!0,attribute:"data-alert"})],h.HeadlessDialog.prototype,"alert",2),h.HeadlessDialog=f([E("hp-dialog")],h.HeadlessDialog),h.HeadlessDialogTrigger=class extends A{disabled=!1;connectedCallback(){super.connectedCallback(),this.setAttribute("data-hp-component","dialog-trigger"),this.hasAttribute("role")||this.setAttribute("role","button"),this.disabled||this.setAttribute("tabindex","0"),this.addEventListener("keydown",this._handleKeyDown)}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("keydown",this._handleKeyDown)}attributeChangedCallback(t,s,i){super.attributeChangedCallback(t,s,i),t==="disabled"&&(i!==null?(this.setAttribute("aria-disabled","true"),this.removeAttribute("tabindex")):(this.removeAttribute("aria-disabled"),this.setAttribute("tabindex","0")))}_handleKeyDown=t=>{(t.key==="Enter"||t.key===" ")&&(t.preventDefault(),this.click())}},f([At({type:Boolean,reflect:!0})],h.HeadlessDialogTrigger.prototype,"disabled",2),h.HeadlessDialogTrigger=f([E("hp-dialog-trigger")],h.HeadlessDialogTrigger),h.HeadlessDialogContent=class extends A{connectedCallback(){super.connectedCallback(),this.setAttribute("data-hp-component","dialog-content"),this.id||(this.id=`hp-dialog-content-${this.hpId}`),this._linkAria(),requestAnimationFrame(()=>this._linkAria())}_linkAria(){const t=this.closest("hp-dialog");if(!t)return;const s=t.querySelector("hp-dialog-title"),i=t.querySelector("hp-dialog-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")}},h.HeadlessDialogContent=f([E("hp-dialog-content")],h.HeadlessDialogContent),h.HeadlessDialogBackdrop=class extends A{connectedCallback(){super.connectedCallback(),this.setAttribute("data-hp-component","dialog-backdrop")}},h.HeadlessDialogBackdrop=f([E("hp-dialog-backdrop")],h.HeadlessDialogBackdrop),h.HeadlessDialogTitle=class extends A{connectedCallback(){super.connectedCallback(),this.setAttribute("data-hp-component","dialog-title"),this.id||(this.id=`hp-dialog-title-${this.hpId}`)}},h.HeadlessDialogTitle=f([E("hp-dialog-title")],h.HeadlessDialogTitle),h.HeadlessDialogDescription=class extends A{connectedCallback(){super.connectedCallback(),this.setAttribute("data-hp-component","dialog-description"),this.id||(this.id=`hp-dialog-description-${this.hpId}`)}},h.HeadlessDialogDescription=f([E("hp-dialog-description")],h.HeadlessDialogDescription),h.HeadlessDialogClose=class extends A{connectedCallback(){super.connectedCallback(),this.setAttribute("data-hp-component","dialog-close"),this.hasAttribute("role")||this.setAttribute("role","button"),this.hasAttribute("tabindex")||this.setAttribute("tabindex","0"),this.addEventListener("click",this._onClick),this.addEventListener("keydown",this._onKeyDown)}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("click",this._onClick),this.removeEventListener("keydown",this._onKeyDown)}_onClick=()=>{this.emit("close")};_onKeyDown=t=>{(t.key==="Enter"||t.key===" ")&&(t.preventDefault(),this._onClick())}},h.HeadlessDialogClose=f([E("hp-dialog-close")],h.HeadlessDialogClose),Object.defineProperty(h,Symbol.toStringTag,{value:"Module"})});
{
"name": "@headless-primitives/dialog",
"version": "1.0.0",
"version": "1.1.0",
"description": "Headless dialog primitive for modal overlays",

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

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

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