🚀 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

Package version was removed
This package version has been unpublished, mostly likely due to security reasons
Comparing version
1.1.0
to
2.0.0
+138
-148
dist/index.js

@@ -1,2 +0,2 @@

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 {
var R = globalThis, V = R.ShadowRoot && (R.ShadyCSS === void 0 || R.ShadyCSS.nativeShadow) && "adoptedStyleSheets" in Document.prototype && "replace" in CSSStyleSheet.prototype, vt = Symbol(), X = /* @__PURE__ */ new WeakMap(), Ot = class {
constructor(t, s, i) {

@@ -8,5 +8,5 @@ if (this._$cssResult$ = !0, i !== vt) throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");

let t = this.o, s = this.t;
if (W && t === void 0) {
if (V && 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));
i && (t = X.get(s)), t === void 0 && ((this.o = t = new CSSStyleSheet()).replaceSync(this.cssText), i && X.set(s, t));
}

@@ -18,4 +18,4 @@ return 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);
}, xt = (e) => new Ot(typeof e == "string" ? e : e + "", void 0, vt), Dt = (e, t) => {
if (V) e.adoptedStyleSheets = t.map((s) => s instanceof CSSStyleSheet ? s : s.styleSheet);
else for (let s of t) {

@@ -25,11 +25,11 @@ let i = document.createElement("style"), r = R.litNonce;

}
}, et = W ? (e) => e : (e) => e instanceof CSSStyleSheet ? ((t) => {
}, tt = V ? (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 = {
return xt(s);
})(e) : e, { is: Mt, defineProperty: Rt, getOwnPropertyDescriptor: Tt, getOwnPropertyNames: Ht, getOwnPropertySymbols: Lt, getPrototypeOf: Nt } = Object, N = globalThis, et = N.trustedTypes, jt = et ? et.emptyScript : "", It = N.reactiveElementPolyfillSupport, P = (e, t) => e, K = {
toAttribute(e, t) {
switch (t) {
case Boolean:
e = e ? It : null;
e = e ? jt : null;
break;

@@ -61,6 +61,6 @@ case Object:

}
}, At = (e, t) => !Rt(e, t), it = {
}, At = (e, t) => !Mt(e, t), st = {
attribute: !0,
type: String,
converter: B,
converter: K,
reflect: !1,

@@ -78,10 +78,10 @@ useDefault: !1,

}
static createProperty(e, t = it) {
static createProperty(e, t = st) {
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);
i !== void 0 && Rt(this.prototype, e, i);
}
}
static getPropertyDescriptor(e, t, s) {
let { get: i, set: r } = Ht(this.prototype, e) ?? {
let { get: i, set: r } = Tt(this.prototype, e) ?? {
get() {

@@ -105,7 +105,7 @@ return this[t];

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

@@ -116,3 +116,3 @@ }

if (this.finalized = !0, this._$Ei(), this.hasOwnProperty(P("properties"))) {
let t = this.properties, s = [...Lt(t), ...Nt(t)];
let t = this.properties, s = [...Ht(t), ...Lt(t)];
for (let i of s) this.createProperty(i, t[i]);

@@ -136,4 +136,4 @@ }

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));
for (let i of s) t.unshift(tt(i));
} else e !== void 0 && t.push(tt(e));
return t;

@@ -164,3 +164,3 @@ }

let e = this.shadowRoot ?? this.attachShadow(this.constructor.shadowRootOptions);
return Mt(e, this.constructor.elementStyles), e;
return Dt(e, this.constructor.elementStyles), e;
}

@@ -181,3 +181,3 @@ connectedCallback() {

if (i !== void 0 && s.reflect === !0) {
let r = (s.converter?.toAttribute === void 0 ? B : s.converter).toAttribute(t, s.type);
let r = (s.converter?.toAttribute === void 0 ? K : s.converter).toAttribute(t, s.type);
this._$Em = e, r == null ? this.removeAttribute(i) : this.setAttribute(i, r), this._$Em = null;

@@ -189,3 +189,3 @@ }

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;
let r = s.getPropertyOptions(i), o = typeof r.converter == "function" ? { fromAttribute: r.converter } : r.converter?.fromAttribute === void 0 ? K : r.converter;
this._$Em = i;

@@ -266,9 +266,9 @@ let n = o.fromAttribute(t, r.type);

};
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);
A.elementStyles = [], A.shadowRootOptions = { mode: "open" }, A[P("elementProperties")] = /* @__PURE__ */ new Map(), A[P("finalized")] = /* @__PURE__ */ new Map(), It?.({ ReactiveElement: A }), (N.reactiveElementVersions ??= []).push("2.1.2");
var W = globalThis, it = (e) => e, H = W.trustedTypes, rt = H ? H.createPolicy("lit-html", { createHTML: (e) => e }) : void 0, Et = "$lit$", f = `lit$${Math.random().toFixed(9).slice(2)}$`, St = "?" + f, zt = `<${St}>`, y = document, O = () => y.createComment(""), x = (e) => e === null || typeof e != "object" && typeof e != "function", J = Array.isArray, qt = (e) => J(e) || typeof e?.[Symbol.iterator] == "function", z = `[
\f\r]`, w = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g, ot = /-->/g, nt = />/g, b = RegExp(`>|${z}(?:([^\\s"'>=/]+)(${z}*=${z}*(?:[^
\f\r"'\`<>=]|("|')|))|$)`, "g"), at = /'/g, lt = /"/g, wt = /^(?:script|style|textarea|title)$/i, E = Symbol.for("lit-noChange"), c = Symbol.for("lit-nothing"), ht = /* @__PURE__ */ new WeakMap(), m = y.createTreeWalker(y, 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);
if (!J(e) || !e.hasOwnProperty("raw")) throw Error("invalid template strings array");
return rt === void 0 ? t : rt.createHTML(t);
}

@@ -279,8 +279,8 @@ var Kt = (e, t) => {

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);
for (; u < l.length && (n.lastIndex = u, p = n.exec(l), p !== null); ) u = n.lastIndex, n === w ? p[1] === "!--" ? n = ot : 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 = nt : 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] === '"' ? lt : at) : n === lt || n === at ? n = b : n === ot || n === nt ? n = w : (n = b, r = void 0);
let _ = n === b && e[a + 1].startsWith("/>") ? " " : "";
o += n === w ? l + zt : h >= 0 ? (i.push(D), l.slice(0, h) + Et + l.slice(h) + f + _) : l + f + (h === -2 ? a : _);
}
return [Ct(e, o + (e[s] || "<?>") + (t === 2 ? "</svg>" : t === 3 ? "</math>" : "")), i];
}, K = class Pt {
}, B = class Pt {
constructor({ strings: t, _$litType$: s }, i) {

@@ -290,10 +290,10 @@ let r;

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) {
if (this.el = Pt.createElement(D, i), m.currentNode = this.el.content, s === 2 || s === 3) {
let h = this.el.content.firstChild;
h.replaceWith(...h.childNodes);
}
for (; (r = y.nextNode()) !== null && l.length < a; ) {
for (; (r = m.nextNode()) !== null && l.length < a; ) {
if (r.nodeType === 1) {
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);
let u = p[n++], _ = r.getAttribute(h).split(f), M = /([.?@])?(.*)/.exec(u);
l.push({

@@ -303,6 +303,6 @@ type: 1,

name: M[2],
strings: f,
ctor: M[1] === "." ? Vt : M[1] === "?" ? Wt : M[1] === "@" ? Jt : j
strings: _,
ctor: M[1] === "." ? Ft : M[1] === "?" ? Vt : M[1] === "@" ? Wt : j
}), r.removeAttribute(h);
} else h.startsWith($) && (l.push({
} else h.startsWith(f) && (l.push({
type: 6,

@@ -312,6 +312,6 @@ index: o

if (wt.test(r.tagName)) {
let h = r.textContent.split($), u = h.length - 1;
let h = r.textContent.split(f), u = h.length - 1;
if (u > 0) {
r.textContent = H ? H.emptyScript : "";
for (let f = 0; f < u; f++) r.append(h[f], O()), y.nextNode(), l.push({
for (let _ = 0; _ < u; _++) r.append(h[_], O()), m.nextNode(), l.push({
type: 2,

@@ -329,6 +329,6 @@ index: ++o

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

@@ -339,3 +339,3 @@ o++;

static createElement(t, s) {
let i = m.createElement("template");
let i = y.createElement("template");
return i.innerHTML = t, i;

@@ -349,3 +349,3 @@ }

}
var Ft = class {
var Bt = class {
constructor(e, t) {

@@ -361,13 +361,13 @@ this._$AV = [], this._$AN = void 0, this._$AD = e, this._$AM = t;

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

@@ -378,3 +378,3 @@ p(e) {

}
}, Y = class kt {
}, Z = class kt {
get _$AU() {

@@ -397,3 +397,3 @@ return this._$AM?._$AU ?? this._$Cv;

_$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);
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 ? qt(t) ? this.k(t) : this._(t) : this.T(t) : this.$(t);
}

@@ -407,9 +407,9 @@ O(t) {

_(t) {
this._$AH !== c && x(this._$AH) ? this._$AA.nextSibling.data = t : this.T(m.createTextNode(t)), this._$AH = t;
this._$AH !== c && x(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 = K.createElement(Ct(i.h, i.h[0]), this.options)), i);
let { values: s, _$litType$: i } = t, r = typeof i == "number" ? this._$AC(t) : (i.el === void 0 && (i.el = B.createElement(Ct(i.h, i.h[0]), this.options)), i);
if (this._$AH?._$AD === r) this._$AH.p(s);
else {
let o = new Ft(r, this), n = o.u(this.options);
let o = new Bt(r, this), n = o.u(this.options);
o.p(s), this.T(n), this._$AH = o;

@@ -419,7 +419,7 @@ }

_$AC(t) {
let s = ct.get(t.strings);
return s === void 0 && ct.set(t.strings, s = new K(t)), s;
let s = ht.get(t.strings);
return s === void 0 && ht.set(t.strings, s = new B(t)), s;
}
k(t) {
Z(this._$AH) || (this._$AH = [], this._$AR());
J(this._$AH) || (this._$AH = [], this._$AR());
let s = this._$AH, i, r = 0;

@@ -431,4 +431,4 @@ 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++;

for (this._$AP?.(!1, !0, s); t !== this._$AB; ) {
let i = rt(t).nextSibling;
rt(t).remove(), t = i;
let i = it(t).nextSibling;
it(t).remove(), t = i;
}

@@ -461,3 +461,3 @@ }

}
}, Vt = class extends j {
}, Ft = class extends j {
constructor() {

@@ -469,3 +469,3 @@ super(...arguments), this.type = 3;

}
}, Wt = class extends j {
}, Vt = class extends j {
constructor() {

@@ -477,3 +477,3 @@ super(...arguments), this.type = 4;

}
}, Jt = class extends j {
}, Wt = class extends j {
constructor(e, t, s, i, r) {

@@ -490,3 +490,3 @@ super(e, t, s, i, r), this.type = 5;

}
}, Zt = class {
}, Jt = class {
constructor(e, t, s) {

@@ -501,12 +501,12 @@ this.element = e, this.type = 6, this._$AN = void 0, this._$AM = t, this.options = s;

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

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

let t = this.render();
this.hasUpdated || (this.renderOptions.isConnected = this.isConnected), super.update(e), this._$Do = Gt(t, this.renderRoot, this.renderOptions);
this.hasUpdated || (this.renderOptions.isConnected = this.isConnected), super.update(e), this._$Do = Yt(t, this.renderRoot, this.renderOptions);
}

@@ -534,12 +534,12 @@ connectedCallback() {

};
k._$litElement$ = !0, k.finalized = !0, G.litElementHydrateSupport?.({ LitElement: k });
var Qt = G.litElementPolyfillSupport;
Qt?.({ LitElement: k }), (G.litElementVersions ??= []).push("4.2.2");
k._$litElement$ = !0, k.finalized = !0, Y.litElementHydrateSupport?.({ LitElement: k });
var Gt = Y.litElementPolyfillSupport;
Gt?.({ LitElement: k }), (Y.litElementVersions ??= []).push("4.2.2");
var d = [];
for (let e = 0; e < 256; ++e) d.push((e + 256).toString(16).slice(1));
function Xt(e, t = 0) {
function Qt(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, te = new Uint8Array(16);
function ee() {
var q, Xt = new Uint8Array(16);
function te() {
if (!q) {

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

}
return q(te);
return q(Xt);
}
var dt = { randomUUID: typeof crypto < "u" && crypto.randomUUID && crypto.randomUUID.bind(crypto) };
function se(e, t, s) {
var ct = { randomUUID: typeof crypto < "u" && crypto.randomUUID && crypto.randomUUID.bind(crypto) };
function ee(e, t, s) {
e ||= {};
let i = e.random ?? e.rng?.() ?? ee();
let i = e.random ?? e.rng?.() ?? te();
if (i.length < 16) throw Error("Random bytes length must be >= 16");
return i[6] = i[6] & 15 | 64, i[8] = i[8] & 63 | 128, Xt(i);
return i[6] = i[6] & 15 | 64, i[8] = i[8] & 63 | 128, Qt(i);
}
function ie(e, t, s) {
return dt.randomUUID && !t && !e ? dt.randomUUID() : se(e, t);
function se(e, t, s) {
return ct.randomUUID && !t && !e ? ct.randomUUID() : ee(e, t);
}
function re(e = "hp") {
return `${e}-${ie()}`;
function ie(e = "hp") {
return `${e}-${se()}`;
}

@@ -578,3 +578,3 @@ var g = class extends k {

}
_hpId = re();
_hpId = ie();
get hpId() {

@@ -599,3 +599,3 @@ return this._hpId;

}
var oe = class {
var re = class {
_container;

@@ -642,4 +642,4 @@ _active = !1;

*/
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 ne = class {
const T = globalThis, G = T.ShadowRoot && (T.ShadyCSS === void 0 || T.ShadyCSS.nativeShadow) && "adoptedStyleSheets" in Document.prototype && "replace" in CSSStyleSheet.prototype, Ut = Symbol(), dt = /* @__PURE__ */ new WeakMap();
let oe = class {
constructor(t, s, i) {

@@ -652,5 +652,5 @@ if (this._$cssResult$ = !0, i !== Ut) throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");

const s = this.t;
if (Q && t === void 0) {
if (G && t === void 0) {
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));
i && (t = dt.get(s)), t === void 0 && ((this.o = t = new CSSStyleSheet()).replaceSync(this.cssText), i && dt.set(s, t));
}

@@ -663,4 +663,4 @@ return 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);
const ne = (e) => new oe(typeof e == "string" ? e : e + "", void 0, Ut), ae = (e, t) => {
if (G) e.adoptedStyleSheets = t.map((s) => s instanceof CSSStyleSheet ? s : s.styleSheet);
else for (const s of t) {

@@ -670,6 +670,6 @@ const i = document.createElement("style"), r = T.litNonce;

}
}, ut = Q ? (e) => e : (e) => e instanceof CSSStyleSheet ? ((t) => {
}, pt = G ? (e) => e : (e) => e instanceof CSSStyleSheet ? ((t) => {
let s = "";
for (const i of t.cssRules) s += i.cssText;
return ae(s);
return ne(s);
})(e) : e;

@@ -681,6 +681,6 @@ /**

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

@@ -710,3 +710,3 @@ case Object:

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

@@ -720,10 +720,10 @@ class C extends HTMLElement {

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

@@ -739,7 +739,7 @@ }, set(n) {

static getPropertyOptions(t) {
return this.elementProperties.get(t) ?? ft;
return this.elementProperties.get(t) ?? _t;
}
static _$Ei() {
if (this.hasOwnProperty(U("elementProperties"))) return;
const t = _e(this);
const t = ue(this);
t.finalize(), t.l !== void 0 && (this.l = [...t.l]), this.elementProperties = new Map(t.elementProperties);

@@ -750,3 +750,3 @@ }

if (this.finalized = !0, this._$Ei(), this.hasOwnProperty(U("properties"))) {
const s = this.properties, i = [...pe(s), ...ue(s)];
const s = this.properties, i = [...de(s), ...pe(s)];
for (const r of i) this.createProperty(r, s[r]);

@@ -770,4 +770,4 @@ }

const i = new Set(t.flat(1 / 0).reverse());
for (const r of i) s.unshift(ut(r));
} else t !== void 0 && s.push(ut(t));
for (const r of i) s.unshift(pt(r));
} else t !== void 0 && s.push(pt(t));
return s;

@@ -798,3 +798,3 @@ }

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

@@ -831,3 +831,3 @@ connectedCallback() {

const n = this.constructor;
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;
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);

@@ -900,3 +900,3 @@ }

}
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");
C.elementStyles = [], C.shadowRootOptions = { mode: "open" }, C[U("elementProperties")] = /* @__PURE__ */ new Map(), C[U("finalized")] = /* @__PURE__ */ new Map(), fe?.({ ReactiveElement: C }), (I.reactiveElementVersions ??= []).push("2.1.2");
/**

@@ -907,3 +907,3 @@ * @license

*/
const be = { attribute: !0, type: String, converter: L, reflect: !1, hasChanged: X }, ye = (e = be, t, s) => {
const $e = { attribute: !0, type: String, converter: L, reflect: !1, hasChanged: Q }, be = (e = $e, t, s) => {
const { kind: i, metadata: r } = s;

@@ -929,4 +929,4 @@ let o = globalThis.litPropertyMetadata.get(r);

};
function Ot(e) {
return (t, s) => typeof s == "object" ? ye(e, t, s) : ((i, r, o) => {
function me(e) {
return (t, s) => typeof s == "object" ? be(e, t, s) : ((i, r, o) => {
const n = r.hasOwnProperty(o);

@@ -936,9 +936,8 @@ return r.constructor.createProperty(o, i), n ? Object.getOwnPropertyDescriptor(r, o) : void 0;

}
var me = Object.defineProperty, ge = Object.getOwnPropertyDescriptor, _ = (e, t, s, i) => {
var ye = 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;
return i && r && ye(t, s, r), r;
};
let F = class extends g {
alert = !1;
let ft = class extends g {
_isOpen = !1;

@@ -953,3 +952,3 @@ _focusTrap = null;

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));
e && !this._setupDone && (this._setupDone = !0, e.hasAttribute("role") || e.setAttribute("role", "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 re(e)), e && e._linkAria?.(), t && !t.hasAttribute("data-hp-backdrop") && (t.setAttribute("data-hp-backdrop", ""), t.setAttribute("data-state", "closed"), t.addEventListener("click", this._close)), s && !s.hasAttribute("data-hp-setup") && (s.setAttribute("data-hp-setup", ""), s.addEventListener("click", this._open));
}

@@ -988,18 +987,9 @@ disconnectedCallback() {

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

@@ -1019,8 +1009,8 @@ connectedCallback() {

};
_([
Ot({ type: Boolean, reflect: !0 })
], V.prototype, "disabled", 2);
V = _([
$([
me({ type: Boolean, reflect: !0 })
], F.prototype, "disabled", 2);
F = $([
v("hp-dialog-trigger")
], V);
], F);
let $t = class extends g {

@@ -1037,3 +1027,3 @@ connectedCallback() {

};
$t = _([
$t = $([
v("hp-dialog-content")

@@ -1046,6 +1036,6 @@ ], $t);

};
bt = _([
bt = $([
v("hp-dialog-backdrop")
], bt);
let yt = class extends g {
let mt = class extends g {
connectedCallback() {

@@ -1055,6 +1045,6 @@ super.connectedCallback(), this.setAttribute("data-hp-component", "dialog-title"), this.id || (this.id = `hp-dialog-title-${this.hpId}`);

};
yt = _([
mt = $([
v("hp-dialog-title")
], yt);
let mt = class extends g {
], mt);
let yt = class extends g {
connectedCallback() {

@@ -1064,5 +1054,5 @@ super.connectedCallback(), this.setAttribute("data-hp-component", "dialog-description"), this.id || (this.id = `hp-dialog-description-${this.hpId}`);

};
mt = _([
yt = $([
v("hp-dialog-description")
], mt);
], yt);
let gt = class extends g {

@@ -1082,13 +1072,13 @@ connectedCallback() {

};
gt = _([
gt = $([
v("hp-dialog-close")
], gt);
export {
F as HeadlessDialog,
ft as HeadlessDialog,
bt as HeadlessDialogBackdrop,
gt as HeadlessDialogClose,
$t as HeadlessDialogContent,
mt as HeadlessDialogDescription,
yt as HeadlessDialogTitle,
V as HeadlessDialogTrigger
yt as HeadlessDialogDescription,
mt as HeadlessDialogTitle,
F 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,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()}};/**
(function(h,f){typeof exports=="object"&&typeof module<"u"?f(exports):typeof define=="function"&&define.amd?define(["exports"],f):(h=typeof globalThis<"u"?globalThis:h||self,f(h.HeadlessPrimitivesDialog={}))})(this,function(h){"use strict";var f=globalThis,q=f.ShadowRoot&&(f.ShadyCSS===void 0||f.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,X=Symbol(),tt=new WeakMap,St=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}},wt=e=>new St(typeof e=="string"?e:e+"",void 0,X),Ct=(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=f.litNonce;r!==void 0&&i.setAttribute("nonce",r),i.textContent=s.cssText,e.appendChild(i)}},et=q?e=>e:e=>e instanceof CSSStyleSheet?(t=>{let s="";for(let i of t.cssRules)s+=i.cssText;return wt(s)})(e):e,{is:Pt,defineProperty:kt,getOwnPropertyDescriptor:Ut,getOwnPropertyNames:Dt,getOwnPropertySymbols:Ot,getPrototypeOf:Ht}=Object,M=globalThis,st=M.trustedTypes,Tt=st?st.emptyScript:"",Mt=M.reactiveElementPolyfillSupport,P=(e,t)=>e,B={toAttribute(e,t){switch(t){case Boolean:e=e?Tt: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)=>!Pt(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&&kt(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=Ht(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=[...Dt(t),...Ot(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 Ct(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,Mt?.({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$",$=`lit$${Math.random().toFixed(9).slice(2)}$`,lt="?"+$,Rt=`<${lt}>`,m=document,k=()=>m.createComment(""),U=e=>e===null||typeof e!="object"&&typeof e!="function",F=Array.isArray,xt=e=>F(e)||typeof e?.[Symbol.iterator]=="function",V=`[
\f\r]`,D=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,ht=/-->/g,dt=/>/g,y=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"),_t=new WeakMap,v=m.createTreeWalker(m,129);function ft(e,t){if(!F(e)||!e.hasOwnProperty("raw"))throw Error("invalid template strings array");return nt===void 0?t:nt.createHTML(t)}var Lt=(e,t)=>{let s=e.length-1,i=[],r,o=t===2?"<svg>":t===3?"<math>":"",n=D;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===D?p[1]==="!--"?n=ht:p[1]===void 0?p[2]===void 0?p[3]!==void 0&&(n=y):(pt.test(p[2])&&(r=RegExp("</"+p[2],"g")),n=y):n=dt:n===y?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?y:p[3]==='"'?ut:ct):n===ut||n===ct?n=y:n===ht||n===dt?n=D:(n=y,r=void 0);let b=n===y&&e[a+1].startsWith("/>")?" ":"";o+=n===D?l+Rt:d>=0?(i.push(I),l.slice(0,d)+at+l.slice(d)+$+b):l+$+(d===-2?a:b)}return[ft(e,o+(e[s]||"<?>")+(t===2?"</svg>":t===3?"</math>":"")),i]},W=class At{constructor({strings:t,_$litType$:s},i){let r;this.parts=[];let o=0,n=0,a=t.length-1,l=this.parts,[I,p]=Lt(t,s);if(this.el=At.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($),z=/([.?@])?(.*)/.exec(_);l.push({type:1,index:o,name:z[2],strings:b,ctor:z[1]==="."?jt:z[1]==="?"?It:z[1]==="@"?zt: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($),_=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($,d+1))!==-1;)l.push({type:7,index:o}),d+=$.length-1}o++}}static createElement(t,s){let i=m.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=U(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 Nt=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??m).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 qt(r,this,e)),this._$AV.push(l),a=s[++n]}o!==a?.index&&(r=v.nextNode(),o++)}return v.currentNode=m,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 Et{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),U(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?xt(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&&U(this._$AH)?this._$AA.nextSibling.data=t:this.T(m.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(ft(i.h,i.h[0]),this.options)),i);if(this._$AH?._$AD===r)this._$AH.p(s);else{let o=new Nt(r,this),n=o.u(this.options);o.p(s),this.T(n),this._$AH=o}}_$AC(t){let s=_t.get(t.strings);return s===void 0&&_t.set(t.strings,s=new 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 Et(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=!U(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||=!U(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??"")}},jt=class extends x{constructor(){super(...arguments),this.type=3}j(e){this.element[this.name]=e===c?void 0:e}},It=class extends x{constructor(){super(...arguments),this.type=4}j(e){this.element.toggleAttribute(this.name,!!e&&e!==c)}},zt=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)}},qt=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)}},Bt=K.litHtmlPolyfillSupport;Bt?.(W,J),(K.litHtmlVersions??=[]).push("3.3.2");var Kt=(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=Kt(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 Ft=Z.litElementPolyfillSupport;Ft?.({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 Vt(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,Wt=new Uint8Array(16);function Jt(){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(Wt)}var $t={randomUUID:typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function Zt(e,t,s){e||={};let i=e.random??e.rng?.()??Jt();if(i.length<16)throw Error("Random bytes length must be >= 16");return i[6]=i[6]&15|64,i[8]=i[8]&63|128,Vt(i)}function Yt(e,t,s){return $t.randomUUID&&!t&&!e?$t.randomUUID():Zt(e,t)}function Gt(e="hp"){return`${e}-${Yt()}`}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=Gt();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 Qt=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(),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;/**
*/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 Xt=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 te=e=>new Xt(typeof e=="string"?e:e+"",void 0,gt),ee=(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)}},mt=G?e=>e:e=>e instanceof CSSStyleSheet?(t=>{let s="";for(const i of t.cssRules)s+=i.cssText;return te(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,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");/**
*/const{is:se,defineProperty:ie,getOwnPropertyDescriptor:re,getOwnPropertyNames:oe,getOwnPropertySymbols:ne,getPrototypeOf:ae}=Object,N=globalThis,yt=N.trustedTypes,le=yt?yt.emptyScript:"",he=N.reactiveElementPolyfillSupport,H=(e,t)=>e,j={toAttribute(e,t){switch(t){case Boolean:e=e?le: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)=>!se(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&&ie(this.prototype,t,r)}}static getPropertyDescriptor(t,s,i){const{get:r,set:o}=re(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=ae(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=[...oe(s),...ne(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(mt(r))}else t!==void 0&&s.push(mt(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 ee(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,he?.({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=(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"})});
*/const de={attribute:!0,type:String,converter:j,reflect:!1,hasChanged:Q},ce=(e=de,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 ue(e){return(t,s)=>typeof s=="object"?ce(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,_e=Object.getOwnPropertyDescriptor,g=(e,t,s,i)=>{for(var r=i>1?void 0:i?_e(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{_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","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 Qt(t)),t&&t._linkAria?.(),s&&!s.hasAttribute("data-hp-backdrop")&&(s.setAttribute("data-hp-backdrop",""),s.setAttribute("data-state","closed"),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=>{t.key==="Escape"&&(t.preventDefault(),this._close())}},h.HeadlessDialog=g([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())}},g([ue({type:Boolean,reflect:!0})],h.HeadlessDialogTrigger.prototype,"disabled",2),h.HeadlessDialogTrigger=g([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=g([E("hp-dialog-content")],h.HeadlessDialogContent),h.HeadlessDialogBackdrop=class extends A{connectedCallback(){super.connectedCallback(),this.setAttribute("data-hp-component","dialog-backdrop")}},h.HeadlessDialogBackdrop=g([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=g([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=g([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=g([E("hp-dialog-close")],h.HeadlessDialogClose),Object.defineProperty(h,Symbol.toStringTag,{value:"Module"})});
{
"name": "@headless-primitives/dialog",
"version": "1.1.0",
"version": "2.0.0",
"description": "Headless dialog primitive for modal overlays",

@@ -5,0 +5,0 @@ "keywords": [