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

@headless-primitives/select

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@headless-primitives/select - npm Package Compare versions

Comparing version
1.0.0
to
1.1.0
+474
-462
dist/index.js
var M = globalThis, J = M.ShadowRoot && (M.ShadyCSS === void 0 || M.ShadyCSS.nativeShadow) && "adoptedStyleSheets" in Document.prototype && "replace" in CSSStyleSheet.prototype, vt = Symbol(), st = /* @__PURE__ */ new WeakMap(), xt = class {
constructor(t, s, i) {
constructor(e, 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;
this.cssText = e, this.t = s;
}
get styleSheet() {
let t = this.o, s = this.t;
if (J && t === void 0) {
let e = this.o, s = this.t;
if (J && e === void 0) {
let i = s !== void 0 && s.length === 1;
i && (t = st.get(s)), t === void 0 && ((this.o = t = new CSSStyleSheet()).replaceSync(this.cssText), i && st.set(s, t));
i && (e = st.get(s)), e === void 0 && ((this.o = e = new CSSStyleSheet()).replaceSync(this.cssText), i && st.set(s, e));
}
return t;
return e;
}

@@ -17,32 +17,32 @@ toString() {

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

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

try {
s = JSON.parse(e);
s = JSON.parse(t);
} catch {

@@ -60,3 +60,3 @@ s = null;

}
}, bt = (e, t) => !Rt(e, t), nt = {
}, bt = (t, e) => !Rt(t, e), nt = {
attribute: !0,

@@ -69,3 +69,3 @@ type: String,

};
Symbol.metadata ??= Symbol("metadata"), j.litPropertyMetadata ??= /* @__PURE__ */ new WeakMap();
Symbol.metadata ??= Symbol("metadata"), z.litPropertyMetadata ??= /* @__PURE__ */ new WeakMap();
var A = class extends HTMLElement {

@@ -78,22 +78,22 @@ static addInitializer(t) {

}
static createProperty(t, s = nt) {
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) {
let i = Symbol(), r = this.getPropertyDescriptor(t, i, s);
r !== void 0 && kt(this.prototype, t, r);
static createProperty(t, e = nt) {
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 s = Symbol(), i = this.getPropertyDescriptor(t, s, e);
i !== void 0 && It(this.prototype, t, i);
}
}
static getPropertyDescriptor(t, s, i) {
let { get: r, set: n } = Dt(this.prototype, t) ?? {
static getPropertyDescriptor(t, e, s) {
let { get: i, set: r } = Dt(this.prototype, t) ?? {
get() {
return this[s];
return this[e];
},
set(o) {
this[s] = o;
set(n) {
this[e] = n;
}
};
return {
get: r,
set(o) {
let h = r?.call(this);
n?.call(this, o), this.requestUpdate(t, h, i);
get: i,
set(n) {
let o = i?.call(this);
r?.call(this, n), this.requestUpdate(t, o, s);
},

@@ -109,3 +109,3 @@ configurable: !0,

if (this.hasOwnProperty(P("elementProperties"))) return;
let t = Lt(this);
let t = Ht(this);
t.finalize(), t.l !== void 0 && (this.l = [...t.l]), this.elementProperties = new Map(t.elementProperties);

@@ -116,14 +116,14 @@ }

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

@@ -133,12 +133,12 @@ this.elementStyles = this.finalizeStyles(this.styles);

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

@@ -158,4 +158,4 @@ constructor() {

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

@@ -165,3 +165,3 @@ }

let t = this.shadowRoot ?? this.attachShadow(this.constructor.shadowRootOptions);
return It(t, this.constructor.elementStyles), t;
return kt(t, this.constructor.elementStyles), t;
}

@@ -176,31 +176,31 @@ connectedCallback() {

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

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

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

@@ -225,18 +225,18 @@ let t = this.scheduleUpdate();

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

@@ -246,3 +246,3 @@ willUpdate(t) {

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

@@ -262,3 +262,3 @@ _$EM() {

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

@@ -270,24 +270,24 @@ updated(t) {

};
A.elementStyles = [], A.shadowRootOptions = { mode: "open" }, A[P("elementProperties")] = /* @__PURE__ */ new Map(), A[P("finalized")] = /* @__PURE__ */ new Map(), Nt?.({ ReactiveElement: A }), (j.reactiveElementVersions ??= []).push("2.1.2");
var Z = globalThis, ot = (e) => e, H = Z.trustedTypes, ht = H ? H.createPolicy("lit-html", { createHTML: (e) => e }) : void 0, At = "$lit$", $ = `lit$${Math.random().toFixed(9).slice(2)}$`, Et = "?" + $, zt = `<${Et}>`, b = document, O = () => b.createComment(""), I = (e) => e === null || typeof e != "object" && typeof e != "function", X = Array.isArray, jt = (e) => X(e) || typeof e?.[Symbol.iterator] == "function", V = `[
\f\r]`, w = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g, lt = /-->/g, at = />/g, y = RegExp(`>|${V}(?:([^\\s"'>=/]+)(${V}*=${V}*(?:[^
A.elementStyles = [], A.shadowRootOptions = { mode: "open" }, A[P("elementProperties")] = /* @__PURE__ */ new Map(), A[P("finalized")] = /* @__PURE__ */ new Map(), Nt?.({ ReactiveElement: A }), (z.reactiveElementVersions ??= []).push("2.1.2");
var Z = globalThis, ot = (t) => t, L = Z.trustedTypes, lt = L ? L.createPolicy("lit-html", { createHTML: (t) => t }) : void 0, At = "$lit$", g = `lit$${Math.random().toFixed(9).slice(2)}$`, Et = "?" + g, jt = `<${Et}>`, b = document, O = () => b.createComment(""), k = (t) => t === null || typeof t != "object" && typeof t != "function", X = Array.isArray, zt = (t) => X(t) || typeof t?.[Symbol.iterator] == "function", V = `[
\f\r]`, w = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g, ht = /-->/g, at = />/g, y = RegExp(`>|${V}(?:([^\\s"'>=/]+)(${V}*=${V}*(?:[^
\f\r"'\`<>=]|("|')|))|$)`, "g"), ct = /'/g, dt = /"/g, St = /^(?:script|style|textarea|title)$/i, E = Symbol.for("lit-noChange"), c = Symbol.for("lit-nothing"), pt = /* @__PURE__ */ new WeakMap(), v = b.createTreeWalker(b, 129);
function wt(e, t) {
if (!X(e) || !e.hasOwnProperty("raw")) throw Error("invalid template strings array");
return ht === void 0 ? t : ht.createHTML(t);
function wt(t, e) {
if (!X(t) || !t.hasOwnProperty("raw")) throw Error("invalid template strings array");
return lt === void 0 ? e : lt.createHTML(e);
}
var qt = (e, t) => {
let s = e.length - 1, i = [], r, n = t === 2 ? "<svg>" : t === 3 ? "<math>" : "", o = w;
for (let h = 0; h < s; h++) {
let l = e[h], D, p, a = -1, _ = 0;
for (; _ < l.length && (o.lastIndex = _, p = o.exec(l), p !== null); ) _ = o.lastIndex, o === w ? p[1] === "!--" ? o = lt : p[1] === void 0 ? p[2] === void 0 ? p[3] !== void 0 && (o = y) : (St.test(p[2]) && (r = RegExp("</" + p[2], "g")), o = y) : o = at : o === y ? p[0] === ">" ? (o = r ?? w, a = -1) : p[1] === void 0 ? a = -2 : (a = o.lastIndex - p[2].length, D = p[1], o = p[3] === void 0 ? y : p[3] === '"' ? dt : ct) : o === dt || o === ct ? o = y : o === lt || o === at ? o = w : (o = y, r = void 0);
let m = o === y && e[h + 1].startsWith("/>") ? " " : "";
n += o === w ? l + zt : a >= 0 ? (i.push(D), l.slice(0, a) + At + l.slice(a) + $ + m) : l + $ + (a === -2 ? h : m);
var qt = (t, e) => {
let s = t.length - 1, i = [], r, n = e === 2 ? "<svg>" : e === 3 ? "<math>" : "", o = w;
for (let l = 0; l < s; l++) {
let h = t[l], D, p, a = -1, _ = 0;
for (; _ < h.length && (o.lastIndex = _, p = o.exec(h), p !== null); ) _ = o.lastIndex, o === w ? p[1] === "!--" ? o = ht : p[1] === void 0 ? p[2] === void 0 ? p[3] !== void 0 && (o = y) : (St.test(p[2]) && (r = RegExp("</" + p[2], "g")), o = y) : o = at : o === y ? p[0] === ">" ? (o = r ?? w, a = -1) : p[1] === void 0 ? a = -2 : (a = o.lastIndex - p[2].length, D = p[1], o = p[3] === void 0 ? y : p[3] === '"' ? dt : ct) : o === dt || o === ct ? o = y : o === ht || o === at ? o = w : (o = y, r = void 0);
let $ = o === y && t[l + 1].startsWith("/>") ? " " : "";
n += o === w ? h + jt : a >= 0 ? (i.push(D), h.slice(0, a) + At + h.slice(a) + g + $) : h + g + (a === -2 ? l : $);
}
return [wt(e, n + (e[s] || "<?>") + (t === 2 ? "</svg>" : t === 3 ? "</math>" : "")), i];
}, G = class Ct {
constructor({ strings: t, _$litType$: s }, i) {
return [wt(t, n + (t[s] || "<?>") + (e === 2 ? "</svg>" : e === 3 ? "</math>" : "")), i];
}, F = class Ct {
constructor({ strings: e, _$litType$: s }, i) {
let r;
this.parts = [];
let n = 0, o = 0, h = t.length - 1, l = this.parts, [D, p] = qt(t, s);
let n = 0, o = 0, l = e.length - 1, h = this.parts, [D, p] = qt(e, s);
if (this.el = Ct.createElement(D, i), v.currentNode = this.el.content, s === 2 || s === 3) {

@@ -297,14 +297,14 @@ let a = this.el.content.firstChild;

}
for (; (r = v.nextNode()) !== null && l.length < h; ) {
for (; (r = v.nextNode()) !== null && h.length < l; ) {
if (r.nodeType === 1) {
if (r.hasAttributes()) for (let a of r.getAttributeNames()) if (a.endsWith(At)) {
let _ = p[o++], m = r.getAttribute(a).split($), T = /([.?@])?(.*)/.exec(_);
l.push({
let _ = p[o++], $ = r.getAttribute(a).split(g), T = /([.?@])?(.*)/.exec(_);
h.push({
type: 1,
index: n,
name: T[2],
strings: m,
strings: $,
ctor: T[1] === "." ? Vt : T[1] === "?" ? Kt : T[1] === "@" ? Wt : q
}), r.removeAttribute(a);
} else a.startsWith($) && (l.push({
} else a.startsWith(g) && (h.push({
type: 6,

@@ -314,6 +314,6 @@ index: n

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

@@ -325,3 +325,3 @@ index: ++n

}
} else if (r.nodeType === 8) if (r.data === Et) l.push({
} else if (r.nodeType === 8) if (r.data === Et) h.push({
type: 2,

@@ -332,6 +332,6 @@ index: n

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

@@ -341,15 +341,15 @@ n++;

}
static createElement(t, s) {
static createElement(e, s) {
let i = b.createElement("template");
return i.innerHTML = t, i;
return i.innerHTML = e, i;
}
};
function S(e, t, s = e, i) {
if (t === E) return t;
let r = i === void 0 ? s._$Cl : s._$Co?.[i], n = I(t) ? void 0 : t._$litDirective$;
return r?.constructor !== n && (r?._$AO?.(!1), n === void 0 ? r = void 0 : (r = new n(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;
function S(t, e, s = t, i) {
if (e === E) return e;
let r = i === void 0 ? s._$Cl : s._$Co?.[i], n = k(e) ? void 0 : e._$litDirective$;
return r?.constructor !== n && (r?._$AO?.(!1), n === void 0 ? r = void 0 : (r = new n(t), r._$AT(t, s, i)), i === void 0 ? s._$Cl = r : (s._$Co ??= [])[i] = r), r !== void 0 && (e = S(t, r._$AS(t, e.values), r, i)), e;
}
var Bt = class {
constructor(e, t) {
this._$AV = [], this._$AN = void 0, this._$AD = e, this._$AM = t;
constructor(t, e) {
this._$AV = [], this._$AN = void 0, this._$AD = t, this._$AM = e;
}

@@ -362,18 +362,18 @@ get parentNode() {

}
u(e) {
let { el: { content: t }, parts: s } = this._$AD, i = (e?.creationScope ?? b).importNode(t, !0);
u(t) {
let { el: { content: e }, parts: s } = this._$AD, i = (t?.creationScope ?? b).importNode(e, !0);
v.currentNode = i;
let r = v.nextNode(), n = 0, o = 0, h = s[0];
for (; h !== void 0; ) {
if (n === h.index) {
let l;
h.type === 2 ? l = new Y(r, r.nextSibling, this, e) : h.type === 1 ? l = new h.ctor(r, h.name, h.strings, this, e) : h.type === 6 && (l = new Gt(r, this, e)), this._$AV.push(l), h = s[++o];
let r = v.nextNode(), n = 0, o = 0, l = s[0];
for (; l !== void 0; ) {
if (n === l.index) {
let h;
l.type === 2 ? h = new Y(r, r.nextSibling, this, t) : l.type === 1 ? h = new l.ctor(r, l.name, l.strings, this, t) : l.type === 6 && (h = new Ft(r, this, t)), this._$AV.push(h), l = s[++o];
}
n !== h?.index && (r = v.nextNode(), n++);
n !== l?.index && (r = v.nextNode(), n++);
}
return v.currentNode = b, 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++;
p(t) {
let e = 0;
for (let s of this._$AV) s !== void 0 && (s.strings === void 0 ? s._$AI(t[e]) : (s._$AI(t, s, e), e += s.strings.length - 2)), e++;
}

@@ -384,8 +384,8 @@ }, Y = class Pt {

}
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;
constructor(e, s, i, r) {
this.type = 2, this._$AH = c, this._$AN = void 0, this._$AA = e, 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;
let e = this._$AA.parentNode, s = this._$AM;
return s !== void 0 && e?.nodeType === 11 && (e = s.parentNode), e;
}

@@ -398,16 +398,16 @@ get startNode() {

}
_$AI(t, s = this) {
t = S(this, t, s), I(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 ? jt(t) ? this.k(t) : this._(t) : this.T(t) : this.$(t);
_$AI(e, s = this) {
e = S(this, e, s), k(e) ? e === c || e == null || e === "" ? (this._$AH !== c && this._$AR(), this._$AH = c) : e !== this._$AH && e !== E && this._(e) : e._$litType$ === void 0 ? e.nodeType === void 0 ? zt(e) ? this.k(e) : this._(e) : this.T(e) : this.$(e);
}
O(t) {
return this._$AA.parentNode.insertBefore(t, this._$AB);
O(e) {
return this._$AA.parentNode.insertBefore(e, this._$AB);
}
T(t) {
this._$AH !== t && (this._$AR(), this._$AH = this.O(t));
T(e) {
this._$AH !== e && (this._$AR(), this._$AH = this.O(e));
}
_(t) {
this._$AH !== c && I(this._$AH) ? this._$AA.nextSibling.data = t : this.T(b.createTextNode(t)), this._$AH = t;
_(e) {
this._$AH !== c && k(this._$AH) ? this._$AA.nextSibling.data = e : this.T(b.createTextNode(e)), this._$AH = e;
}
$(t) {
let { values: s, _$litType$: i } = t, r = typeof i == "number" ? this._$AC(t) : (i.el === void 0 && (i.el = G.createElement(wt(i.h, i.h[0]), this.options)), i);
$(e) {
let { values: s, _$litType$: i } = e, r = typeof i == "number" ? this._$AC(e) : (i.el === void 0 && (i.el = F.createElement(wt(i.h, i.h[0]), this.options)), i);
if (this._$AH?._$AD === r) this._$AH.p(s);

@@ -419,20 +419,20 @@ else {

}
_$AC(t) {
let s = pt.get(t.strings);
return s === void 0 && pt.set(t.strings, s = new G(t)), s;
_$AC(e) {
let s = pt.get(e.strings);
return s === void 0 && pt.set(e.strings, s = new F(e)), s;
}
k(t) {
k(e) {
X(this._$AH) || (this._$AH = [], this._$AR());
let s = this._$AH, i, r = 0;
for (let n of t) r === s.length ? s.push(i = new Pt(this.O(O()), this.O(O()), this, this.options)) : i = s[r], i._$AI(n), r++;
for (let n of e) r === s.length ? s.push(i = new Pt(this.O(O()), this.O(O()), this, this.options)) : i = s[r], i._$AI(n), 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;
_$AR(e = this._$AA.nextSibling, s) {
for (this._$AP?.(!1, !0, s); e !== this._$AB; ) {
let i = ot(e).nextSibling;
ot(e).remove(), e = i;
}
}
setConnected(t) {
this._$AM === void 0 && (this._$Cv = t, this._$AP?.(t));
setConnected(e) {
this._$AM === void 0 && (this._$Cv = e, this._$AP?.(e));
}

@@ -446,16 +446,16 @@ }, q = class {

}
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;
constructor(t, e, s, i, r) {
this.type = 1, this._$AH = c, this._$AN = void 0, this.element = t, this.name = e, 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(e, t = this, s, i) {
_$AI(t, e = this, s, i) {
let r = this.strings, n = !1;
if (r === void 0) e = S(this, e, t, 0), n = !I(e) || e !== this._$AH && e !== E, n && (this._$AH = e);
if (r === void 0) t = S(this, t, e, 0), n = !k(t) || t !== this._$AH && t !== E, n && (this._$AH = t);
else {
let o = e, h, l;
for (e = r[0], h = 0; h < r.length - 1; h++) l = S(this, o[s + h], t, h), l === E && (l = this._$AH[h]), n ||= !I(l) || l !== this._$AH[h], l === c ? e = c : e !== c && (e += (l ?? "") + r[h + 1]), this._$AH[h] = l;
let o = t, l, h;
for (t = r[0], l = 0; l < r.length - 1; l++) h = S(this, o[s + l], e, l), h === E && (h = this._$AH[l]), n ||= !k(h) || h !== this._$AH[l], h === c ? t = c : t !== c && (t += (h ?? "") + r[l + 1]), this._$AH[l] = h;
}
n && !i && this.j(e);
n && !i && this.j(t);
}
j(e) {
e === c ? this.element.removeAttribute(this.name) : this.element.setAttribute(this.name, e ?? "");
j(t) {
t === c ? this.element.removeAttribute(this.name) : this.element.setAttribute(this.name, t ?? "");
}

@@ -466,4 +466,4 @@ }, Vt = class extends q {

}
j(e) {
this.element[this.name] = e === c ? void 0 : e;
j(t) {
this.element[this.name] = t === c ? void 0 : t;
}

@@ -474,20 +474,20 @@ }, Kt = class extends q {

}
j(e) {
this.element.toggleAttribute(this.name, !!e && e !== c);
j(t) {
this.element.toggleAttribute(this.name, !!t && t !== c);
}
}, Wt = class extends q {
constructor(e, t, s, i, r) {
super(e, t, s, i, r), this.type = 5;
constructor(t, e, s, i, r) {
super(t, e, s, i, r), this.type = 5;
}
_$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;
_$AI(t, e = this) {
if ((t = S(this, t, e, 0) ?? c) === E) return;
let s = this._$AH, i = t === c && s !== c || t.capture !== s.capture || t.once !== s.once || t.passive !== s.passive, r = t !== c && (s === c || i);
i && this.element.removeEventListener(this.name, this, s), r && this.element.addEventListener(this.name, this, t), this._$AH = t;
}
handleEvent(e) {
typeof this._$AH == "function" ? this._$AH.call(this.options?.host ?? this.element, e) : this._$AH.handleEvent(e);
handleEvent(t) {
typeof this._$AH == "function" ? this._$AH.call(this.options?.host ?? this.element, t) : this._$AH.handleEvent(t);
}
}, Gt = class {
constructor(e, t, s) {
this.element = e, this.type = 6, this._$AN = void 0, this._$AM = t, this.options = s;
}, Ft = class {
constructor(t, e, s) {
this.element = t, this.type = 6, this._$AN = void 0, this._$AM = e, this.options = s;
}

@@ -497,14 +497,14 @@ get _$AU() {

}
_$AI(e) {
S(this, e);
_$AI(t) {
S(this, t);
}
}, Ft = Z.litHtmlPolyfillSupport;
Ft?.(G, Y), (Z.litHtmlVersions ??= []).push("3.3.2");
var Jt = (e, t, s) => {
let i = s?.renderBefore ?? t, r = i._$litPart$;
}, Gt = Z.litHtmlPolyfillSupport;
Gt?.(F, Y), (Z.litHtmlVersions ??= []).push("3.3.2");
var Jt = (t, e, s) => {
let i = s?.renderBefore ?? e, r = i._$litPart$;
if (r === void 0) {
let n = s?.renderBefore ?? null;
i._$litPart$ = r = new Y(t.insertBefore(O(), n), n, void 0, s ?? {});
i._$litPart$ = r = new Y(e.insertBefore(O(), n), n, void 0, s ?? {});
}
return r._$AI(e), r;
return r._$AI(t), r;
}, Q = globalThis, U = class extends A {

@@ -515,8 +515,8 @@ constructor() {

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

@@ -537,5 +537,5 @@ connectedCallback() {

var d = [];
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();
for (let t = 0; t < 256; ++t) d.push((t + 256).toString(16).slice(1));
function Xt(t, e = 0) {
return (d[t[e + 0]] + d[t[e + 1]] + d[t[e + 2]] + d[t[e + 3]] + "-" + d[t[e + 4]] + d[t[e + 5]] + "-" + d[t[e + 6]] + d[t[e + 7]] + "-" + d[t[e + 8]] + d[t[e + 9]] + "-" + d[t[e + 10]] + d[t[e + 11]] + d[t[e + 12]] + d[t[e + 13]] + d[t[e + 14]] + d[t[e + 15]]).toLowerCase();
}

@@ -551,13 +551,13 @@ var K, Yt = new Uint8Array(16);

var ut = { randomUUID: typeof crypto < "u" && crypto.randomUUID && crypto.randomUUID.bind(crypto) };
function te(e, t, s) {
e ||= {};
let i = e.random ?? e.rng?.() ?? Qt();
function te(t, e, s) {
t ||= {};
let i = t.random ?? t.rng?.() ?? Qt();
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);
}
function ee(e, t, s) {
return ut.randomUUID && !t && !e ? ut.randomUUID() : te(e, t);
function ee(t, e, s) {
return ut.randomUUID && !e && !t ? ut.randomUUID() : te(t, e);
}
function se(e = "hp") {
return `${e}-${ee()}`;
function se(t = "hp") {
return `${t}-${ee()}`;
}

@@ -568,5 +568,5 @@ var R = class extends U {

}
emit(e, t) {
let s = new CustomEvent(`hp-${e}`, {
detail: t,
emit(t, e) {
let s = new CustomEvent(`hp-${t}`, {
detail: e,
bubbles: !0,

@@ -582,8 +582,33 @@ composed: !0,

}
_abortController = null;
get signal() {
return (!this._abortController || this._abortController.signal.aborted) && (this._abortController = new AbortController()), this._abortController.signal;
}
connectedCallback() {
super.connectedCallback(), (!this._abortController || this._abortController.signal.aborted) && (this._abortController = new AbortController());
}
disconnectedCallback() {
super.disconnectedCallback(), this._abortController?.abort(), this._abortController = null;
}
};
function k(e) {
return function(t) {
typeof window < "u" && (customElements.get(e) || customElements.define(e, t));
function I(t) {
return function(e) {
typeof window < "u" && (customElements.get(t) || customElements.define(t, e));
};
}
function ie(t) {
let e = [], s = t.parentElement;
for (; s; ) {
let { overflow: i, overflowY: r, overflowX: n } = getComputedStyle(s);
/auto|scroll|overlay/.test(i + r + n) && e.push(s), s = s.parentElement;
}
return e.push(window), e;
}
function re(t, e) {
if (e.aborted) return;
let s = 0, i = () => {
e.aborted || (t(), s = requestAnimationFrame(i));
};
s = requestAnimationFrame(i), e.addEventListener("abort", () => cancelAnimationFrame(s), { once: !0 });
}
/**

@@ -594,16 +619,16 @@ * @license

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

@@ -614,13 +639,13 @@ toString() {

};
const re = (e) => new ie(typeof e == "string" ? e : e + "", void 0, Ut), ne = (e, t) => {
if (tt) 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);
const oe = (t) => new ne(typeof t == "string" ? t : t + "", void 0, Ut), le = (t, e) => {
if (tt) t.adoptedStyleSheets = e.map((s) => s instanceof CSSStyleSheet ? s : s.styleSheet);
else for (const s of e) {
const i = document.createElement("style"), r = H.litNonce;
r !== void 0 && i.setAttribute("nonce", r), i.textContent = s.cssText, t.appendChild(i);
}
}, ft = tt ? (e) => e : (e) => e instanceof CSSStyleSheet ? ((t) => {
}, ft = tt ? (t) => t : (t) => t instanceof CSSStyleSheet ? ((e) => {
let s = "";
for (const i of t.cssRules) s += i.cssText;
return re(s);
})(e) : e;
for (const i of e.cssRules) s += i.cssText;
return oe(s);
})(t) : t;
/**

@@ -631,20 +656,20 @@ * @license

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

@@ -654,3 +679,3 @@ case Object:

try {
s = JSON.parse(e);
s = JSON.parse(t);
} catch {

@@ -661,7 +686,7 @@ s = null;

return s;
} }, et = (e, t) => !oe(e, t), $t = { attribute: !0, type: String, converter: N, reflect: !1, useDefault: !1, hasChanged: et };
} }, et = (t, e) => !he(t, e), gt = { attribute: !0, type: String, converter: N, reflect: !1, useDefault: !1, hasChanged: et };
Symbol.metadata ??= Symbol("metadata"), B.litPropertyMetadata ??= /* @__PURE__ */ new WeakMap();
class C extends HTMLElement {
static addInitializer(t) {
this._$Ei(), (this.l ??= []).push(t);
static addInitializer(e) {
this._$Ei(), (this.l ??= []).push(e);
}

@@ -671,10 +696,10 @@ static get observedAttributes() {

}
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 && he(this.prototype, t, r);
static createProperty(e, s = gt) {
if (s.state && (s.attribute = !1), this._$Ei(), this.prototype.hasOwnProperty(e) && ((s = Object.create(s)).wrapped = !0), this.elementProperties.set(e, s), !s.noAccessor) {
const i = Symbol(), r = this.getPropertyDescriptor(e, i, s);
r !== void 0 && ae(this.prototype, e, r);
}
}
static getPropertyDescriptor(t, s, i) {
const { get: r, set: n } = le(this.prototype, t) ?? { get() {
static getPropertyDescriptor(e, s, i) {
const { get: r, set: n } = ce(this.prototype, e) ?? { get() {
return this[s];

@@ -685,13 +710,13 @@ }, set(o) {

return { get: r, set(o) {
const h = r?.call(this);
n?.call(this, o), this.requestUpdate(t, h, i);
const l = r?.call(this);
n?.call(this, o), this.requestUpdate(e, l, i);
}, configurable: !0, enumerable: !0 };
}
static getPropertyOptions(t) {
return this.elementProperties.get(t) ?? $t;
static getPropertyOptions(e) {
return this.elementProperties.get(e) ?? gt;
}
static _$Ei() {
if (this.hasOwnProperty(x("elementProperties"))) return;
const t = de(this);
t.finalize(), t.l !== void 0 && (this.l = [...t.l]), this.elementProperties = new Map(t.elementProperties);
const e = ue(this);
e.finalize(), e.l !== void 0 && (this.l = [...e.l]), this.elementProperties = new Map(e.elementProperties);
}

@@ -701,8 +726,8 @@ static finalize() {

if (this.finalized = !0, this._$Ei(), this.hasOwnProperty(x("properties"))) {
const s = this.properties, i = [...ae(s), ...ce(s)];
const s = this.properties, i = [...de(s), ...pe(s)];
for (const r of i) this.createProperty(r, s[r]);
}
const t = this[Symbol.metadata];
if (t !== null) {
const s = litPropertyMetadata.get(t);
const e = this[Symbol.metadata];
if (e !== null) {
const s = litPropertyMetadata.get(e);
if (s !== void 0) for (const [i, r] of s) this.elementProperties.set(i, r);

@@ -717,13 +742,13 @@ }

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

@@ -734,56 +759,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_() {
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);
const e = /* @__PURE__ */ new Map(), s = this.constructor.elementProperties;
for (const i of s.keys()) this.hasOwnProperty(i) && (e.set(i, this[i]), delete this[i]);
e.size > 0 && (this._$Ep = e);
}
createRenderRoot() {
const t = this.shadowRoot ?? this.attachShadow(this.constructor.shadowRootOptions);
return ne(t, this.constructor.elementStyles), t;
const e = this.shadowRoot ?? this.attachShadow(this.constructor.shadowRootOptions);
return le(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, s, i) {
this._$AK(t, i);
attributeChangedCallback(e, s, i) {
this._$AK(e, i);
}
_$ET(t, s) {
const i = this.constructor.elementProperties.get(t), r = this.constructor._$Eu(t, i);
_$ET(e, s) {
const i = this.constructor.elementProperties.get(e), r = this.constructor._$Eu(e, i);
if (r !== void 0 && i.reflect === !0) {
const n = (i.converter?.toAttribute !== void 0 ? i.converter : N).toAttribute(s, i.type);
this._$Em = t, n == null ? this.removeAttribute(r) : this.setAttribute(r, n), this._$Em = null;
this._$Em = e, n == null ? this.removeAttribute(r) : this.setAttribute(r, n), this._$Em = null;
}
}
_$AK(t, s) {
const i = this.constructor, r = i._$Eh.get(t);
_$AK(e, s) {
const i = this.constructor, r = i._$Eh.get(e);
if (r !== void 0 && this._$Em !== r) {
const n = i.getPropertyOptions(r), o = typeof n.converter == "function" ? { fromAttribute: n.converter } : n.converter?.fromAttribute !== void 0 ? n.converter : N;
this._$Em = r;
const h = o.fromAttribute(s, n.type);
this[r] = h ?? this._$Ej?.get(r) ?? h, this._$Em = null;
const l = o.fromAttribute(s, n.type);
this[r] = l ?? this._$Ej?.get(r) ?? l, this._$Em = null;
}
}
requestUpdate(t, s, i, r = !1, n) {
if (t !== void 0) {
requestUpdate(e, s, i, r = !1, n) {
if (e !== void 0) {
const o = this.constructor;
if (r === !1 && (n = this[t]), i ??= o.getPropertyOptions(t), !((i.hasChanged ?? et)(n, s) || i.useDefault && i.reflect && n === this._$Ej?.get(t) && !this.hasAttribute(o._$Eu(t, i)))) return;
this.C(t, s, i);
if (r === !1 && (n = this[e]), i ??= o.getPropertyOptions(e), !((i.hasChanged ?? et)(n, s) || i.useDefault && i.reflect && n === this._$Ej?.get(e) && !this.hasAttribute(o._$Eu(e, i)))) return;
this.C(e, s, i);
}
this.isUpdatePending === !1 && (this._$ES = this._$EP());
}
C(t, s, { useDefault: i, reflect: r, wrapped: n }, o) {
i && !(this._$Ej ??= /* @__PURE__ */ new Map()).has(t) && (this._$Ej.set(t, o ?? s ?? this[t]), n !== !0 || o !== 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));
C(e, s, { useDefault: i, reflect: r, wrapped: n }, o) {
i && !(this._$Ej ??= /* @__PURE__ */ new Map()).has(e) && (this._$Ej.set(e, o ?? s ?? this[e]), n !== !0 || o !== void 0) || (this._$AL.has(e) || (this.hasUpdated || i || (s = void 0), this._$AL.set(e, s)), r === !0 && this._$Em !== e && (this._$Eq ??= /* @__PURE__ */ new Set()).add(e));
}

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

}
const t = this.scheduleUpdate();
return t != null && await t, !this.isUpdatePending;
const e = this.scheduleUpdate();
return e != null && await e, !this.isUpdatePending;
}

@@ -813,19 +838,19 @@ scheduleUpdate() {

if (i.size > 0) for (const [r, n] of i) {
const { wrapped: o } = n, h = this[r];
o !== !0 || this._$AL.has(r) || h === void 0 || this.C(r, void 0, n, h);
const { wrapped: o } = n, l = this[r];
o !== !0 || this._$AL.has(r) || l === void 0 || this.C(r, void 0, n, l);
}
}
let t = !1;
let e = !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();
e = this.shouldUpdate(s), e ? (this.willUpdate(s), this._$EO?.forEach((i) => i.hostUpdate?.()), this.update(s)) : this._$EM();
} catch (i) {
throw t = !1, this._$EM(), i;
throw e = !1, this._$EM(), i;
}
t && this._$AE(s);
e && this._$AE(s);
}
willUpdate(t) {
willUpdate(e) {
}
_$AE(t) {
this._$EO?.forEach((s) => s.hostUpdated?.()), this.hasUpdated || (this.hasUpdated = !0, this.firstUpdated(t)), this.updated(t);
_$AE(e) {
this._$EO?.forEach((s) => s.hostUpdated?.()), this.hasUpdated || (this.hasUpdated = !0, this.firstUpdated(e)), this.updated(e);
}

@@ -841,14 +866,14 @@ _$EM() {

}
shouldUpdate(t) {
shouldUpdate(e) {
return !0;
}
update(t) {
update(e) {
this._$Eq &&= this._$Eq.forEach((s) => this._$ET(s, this[s])), this._$EM();
}
updated(t) {
updated(e) {
}
firstUpdated(t) {
firstUpdated(e) {
}
}
C.elementStyles = [], C.shadowRootOptions = { mode: "open" }, C[x("elementProperties")] = /* @__PURE__ */ new Map(), C[x("finalized")] = /* @__PURE__ */ new Map(), ue?.({ ReactiveElement: C }), (B.reactiveElementVersions ??= []).push("2.1.2");
C.elementStyles = [], C.shadowRootOptions = { mode: "open" }, C[x("elementProperties")] = /* @__PURE__ */ new Map(), C[x("finalized")] = /* @__PURE__ */ new Map(), fe?.({ ReactiveElement: C }), (B.reactiveElementVersions ??= []).push("2.1.2");
/**

@@ -859,12 +884,12 @@ * @license

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

@@ -874,5 +899,5 @@ }

const { name: o } = s;
return function(h) {
const l = this[o];
t.call(this, h), this.requestUpdate(o, l, e, !0, h);
return function(l) {
const h = this[o];
e.call(this, l), this.requestUpdate(o, h, t, !0, l);
};

@@ -882,16 +907,17 @@ }

};
function f(e) {
return (t, s) => typeof s == "object" ? fe(e, t, s) : ((i, r, n) => {
function f(t) {
return (e, s) => typeof s == "object" ? ge(t, e, s) : ((i, r, n) => {
const o = r.hasOwnProperty(n);
return r.constructor.createProperty(n, i), o ? Object.getOwnPropertyDescriptor(r, n) : void 0;
})(e, t, s);
})(t, e, s);
}
var me = Object.defineProperty, $e = Object.getOwnPropertyDescriptor, u = (e, t, s, i) => {
for (var r = i > 1 ? void 0 : i ? $e(t, s) : t, n = e.length - 1, o; n >= 0; n--)
(o = e[n]) && (r = (i ? o(t, s, r) : o(r)) || r);
return i && r && me(t, s, r), r;
var me = Object.defineProperty, ye = Object.getOwnPropertyDescriptor, u = (t, e, s, i) => {
for (var r = i > 1 ? void 0 : i ? ye(e, s) : e, n = t.length - 1, o; n >= 0; n--)
(o = t[n]) && (r = (i ? o(e, s, r) : o(r)) || r);
return i && r && me(e, s, r), r;
};
let g = class extends R {
let m = class extends R {
_value = null;
_open = !1;
_prevOpen = !1;
_hiddenInput = null;

@@ -903,4 +929,4 @@ _trigger = null;

_activeIndex = -1;
_rafId = null;
_scrollParents = [];
_openController = null;
disabled = !1;

@@ -913,4 +939,4 @@ name = "";

}
set open(e) {
this._open = !!e, this._sync();
set open(t) {
this._open = !!t, this._sync();
}

@@ -920,4 +946,4 @@ get value() {

}
set value(e) {
this._value = e, this._sync();
set value(t) {
this._value = t, this._sync();
}

@@ -938,9 +964,9 @@ connectedCallback() {

this._trigger && (this._trigger.addEventListener("click", this._onTriggerClick), this._trigger.addEventListener("keydown", this._onTriggerKeyDown)), this._content && this._content.addEventListener("keydown", this._onListboxKeyDown);
for (const e of this._items)
e.addEventListener("click", this._onItemClick);
for (const t of this._items)
t.addEventListener("click", this._onItemClick);
}
_setupRoving() {
if (!this._content) return;
this._items.filter((t) => !t.disabled).forEach((t, s) => {
t.setAttribute("tabindex", s === 0 ? "0" : "-1");
this._items.filter((e) => !e.disabled).forEach((e, s) => {
e.setAttribute("tabindex", s === 0 ? "0" : "-1");
});

@@ -950,61 +976,52 @@ }

if (!this._trigger || !this._content) return;
const e = 6, t = this.getBoundingClientRect(), s = this._trigger.getBoundingClientRect(), i = s.left - t.left, r = s.top - t.top + s.height + e;
const t = 6, e = this.getBoundingClientRect(), s = this._trigger.getBoundingClientRect(), i = s.left - e.left, r = s.top - e.top + s.height + t;
this._content.style.left = `${i}px`, this._content.style.top = `${r}px`;
}
_startPositionLoop() {
const e = () => {
this._open && (this._computePosition(), this._rafId = requestAnimationFrame(e));
};
this._rafId = requestAnimationFrame(e);
}
_stopPositionLoop() {
this._rafId !== null && (cancelAnimationFrame(this._rafId), this._rafId = null);
}
_onTriggerClick = (e) => {
this.disabled || (e.stopPropagation(), this.toggle());
_onTriggerClick = (t) => {
this.disabled || (t.stopPropagation(), this.toggle());
};
_onTriggerKeyDown = (e) => {
this.disabled || (e.key === "Enter" || e.key === " " ? (e.preventDefault(), this.openSelect()) : e.key === "ArrowDown" ? (e.preventDefault(), this.openSelect("first")) : e.key === "ArrowUp" ? (e.preventDefault(), this.openSelect("last")) : e.key === "Escape" && this.open && (e.preventDefault(), this.close()));
_onTriggerKeyDown = (t) => {
this.disabled || (t.key === "Enter" || t.key === " " ? (t.preventDefault(), this.openSelect()) : t.key === "ArrowDown" ? (t.preventDefault(), this.openSelect("first")) : t.key === "ArrowUp" ? (t.preventDefault(), this.openSelect("last")) : t.key === "Escape" && this.open && (t.preventDefault(), this.close()));
};
_onListboxKeyDown = (e) => {
_onListboxKeyDown = (t) => {
if (!this.open) return;
const t = this._items[this._activeIndex];
switch (e.key) {
const e = this._items[this._activeIndex];
switch (t.key) {
case "ArrowDown":
case "ArrowRight":
e.preventDefault(), this._moveActive(1);
t.preventDefault(), this._moveActive(1);
break;
case "ArrowUp":
case "ArrowLeft":
e.preventDefault(), this._moveActive(-1);
t.preventDefault(), this._moveActive(-1);
break;
case "Home":
e.preventDefault(), this._moveToEdge("first");
t.preventDefault(), this._moveToEdge("first");
break;
case "End":
e.preventDefault(), this._moveToEdge("last");
t.preventDefault(), this._moveToEdge("last");
break;
case "Enter":
case " ":
e.preventDefault(), t && !t.disabled && this._selectItem(t);
t.preventDefault(), e && !e.disabled && this._selectItem(e);
break;
case "Escape":
e.preventDefault(), this.close();
t.preventDefault(), this.close();
break;
}
};
_onItemClick = (e) => {
const t = e.currentTarget;
t.disabled || this._selectItem(t);
_onItemClick = (t) => {
const e = t.currentTarget;
e.disabled || this._selectItem(e);
};
_selectItem(e) {
const t = e.value;
if (t === this._value) {
_selectItem(t) {
const e = t.value;
if (e === this._value) {
this.close();
return;
}
this._value = t, this._syncSelection(), this._emitChange(), this.close();
this._value = e, this._syncSelection(), this._emitChange(), this.close();
}
_emitChange() {
const e = {
const t = {
value: this._value,

@@ -1014,84 +1031,79 @@ label: this._currentLabel(),

};
this.emit("change", e);
this.emit("change", t);
}
_emitHighlight() {
const e = this._items[this._activeIndex] || null, t = {
value: e ? e.value : null,
label: e && e.textContent?.trim() || null,
item: e
const t = this._items[this._activeIndex] || null, e = {
value: t ? t.value : null,
label: t && t.textContent?.trim() || null,
item: t
};
this.emit("highlight", t);
this.emit("highlight", e);
}
_currentItem() {
return this._items.find((e) => e.value === this._value) || null;
return this._items.find((t) => t.value === this._value) || null;
}
_currentLabel() {
const e = this._currentItem();
return e && e.textContent?.trim() || null;
const t = this._currentItem();
return t && t.textContent?.trim() || null;
}
_moveActive(e) {
const t = this._items.filter((o) => !o.disabled);
if (t.length === 0) return;
_moveActive(t) {
const e = this._items.filter((o) => !o.disabled);
if (e.length === 0) return;
const s = this._items[this._activeIndex];
let i = t.indexOf(s);
let i = e.indexOf(s);
i === -1 && (i = 0);
const r = (i + e + t.length) % t.length, n = t[r];
const r = (i + t + e.length) % e.length, n = e[r];
this._setActiveIndex(this._items.indexOf(n));
}
_moveToEdge(e) {
const t = this._items.filter((i) => !i.disabled);
if (t.length === 0) return;
const s = e === "first" ? t[0] : t[t.length - 1];
_moveToEdge(t) {
const e = this._items.filter((i) => !i.disabled);
if (e.length === 0) return;
const s = t === "first" ? e[0] : e[e.length - 1];
this._setActiveIndex(this._items.indexOf(s));
}
_setActiveIndex(e) {
if (!this._trigger || !this._content || e < 0 || e >= this._items.length) return;
this._activeIndex = e;
const t = this._items[e];
t && (t.id || (t.id = `hp-select-item-${t.hpId}`), this._trigger.setAttribute("aria-activedescendant", t.id), t.scrollIntoView({ block: "nearest" }), this._emitHighlight());
_setActiveIndex(t) {
if (!this._trigger || !this._content || t < 0 || t >= this._items.length) return;
this._activeIndex = t;
const e = this._items[t];
e && (e.id || (e.id = `hp-select-item-${e.hpId}`), this._trigger.setAttribute("aria-activedescendant", e.id), e.scrollIntoView({ block: "nearest" }), this._emitHighlight());
}
_sync() {
this._setupRefs(), this._hiddenInput && (this._hiddenInput.name = this.name || "", this._hiddenInput.value = this._value ?? ""), this._trigger && (this._trigger.setAttribute("role", "combobox"), this._trigger.setAttribute("aria-expanded", String(this._open)), this._trigger.setAttribute("aria-disabled", String(this.disabled))), this._content && (this._content.setAttribute("role", "listbox"), this._content.removeAttribute("data-hp-overlay-content"), this._content.setAttribute("data-state", this._open ? "open" : "closed"), this._content.setAttribute("aria-hidden", this._open ? "false" : "true"), this._content.id || (this._content.id = `hp-select-content-${this.hpId}`), this._trigger && this._trigger.setAttribute("aria-controls", this._content.id));
for (const e of this._items)
e.setAttribute("role", "option"), e.setAttribute("aria-selected", String(e.value === this._value)), e.setAttribute("aria-disabled", String(e.disabled));
for (const t of this._items)
t.setAttribute("role", "option"), t.setAttribute("aria-selected", String(t.value === this._value)), t.setAttribute("aria-disabled", String(t.disabled));
if (this._valueDisplay) {
const e = this._currentLabel(), t = this.placeholder || "";
this._valueDisplay.textContent = e ?? t;
const t = this._currentLabel(), e = this.placeholder || "";
this._valueDisplay.textContent = t ?? e;
}
if (this._open) {
this._setupRoving();
const e = this._currentItem(), t = e ? this._items.indexOf(e) : this._items.findIndex((s) => !s.disabled);
if (t >= 0 && this._setActiveIndex(t), this._computePosition(), this._startPositionLoop(), document.addEventListener("click", this._onClickOutside), document.addEventListener("keydown", this._onGlobalKeydown), this._trigger) {
this._scrollParents = this._getScrollParents(this._trigger);
for (const s of this._scrollParents)
s.addEventListener("scroll", this._onScrollOrResize, {
const t = this._currentItem(), e = t ? this._items.indexOf(t) : this._items.findIndex((i) => !i.disabled);
e >= 0 && this._setActiveIndex(e), this._openController?.abort(), this._openController = new AbortController();
const s = this._openController.signal;
if (this._computePosition(), re(() => this._computePosition(), s), document.addEventListener("click", this._onClickOutside, { signal: s }), document.addEventListener("keydown", this._onGlobalKeydown, { signal: s }), this._trigger) {
this._scrollParents = ie(this._trigger);
for (const i of this._scrollParents)
i.addEventListener("scroll", this._onScrollOrResize, {
signal: s,
passive: !0
});
}
window.addEventListener("resize", this._onScrollOrResize, { passive: !0 }), this.emit("open");
window.addEventListener("resize", this._onScrollOrResize, {
signal: s,
passive: !0
}), this._prevOpen || this.emit("open");
} else
this._stopPositionLoop(), this._removeGlobalListeners(), this.emit("close");
this._removeGlobalListeners(), this._prevOpen && this.emit("close");
this._prevOpen = this._open;
}
_getScrollParents(e) {
const t = [];
let s = e.parentElement;
for (; s; ) {
const { overflow: i, overflowY: r, overflowX: n } = getComputedStyle(s);
/auto|scroll|overlay/.test(i + r + n) && t.push(s), s = s.parentElement;
}
return t.push(window), t;
}
_removeGlobalListeners() {
document.removeEventListener("click", this._onClickOutside), document.removeEventListener("keydown", this._onGlobalKeydown);
for (const e of this._scrollParents)
e.removeEventListener("scroll", this._onScrollOrResize);
this._scrollParents = [], window.removeEventListener("resize", this._onScrollOrResize);
this._openController?.abort(), this._openController = null, this._scrollParents = [];
}
_onClickOutside = (e) => {
_onClickOutside = (t) => {
if (!this._open || !this._trigger || !this._content) return;
const t = e.target;
this.contains(t) || this.close();
const e = t.target;
this.contains(e) || this.close();
};
_onGlobalKeydown = (e) => {
e.key === "Escape" && this._open && (e.preventDefault(), this.close());
_onGlobalKeydown = (t) => {
t.key === "Escape" && this._open && (t.preventDefault(), this.close());
};

@@ -1102,4 +1114,4 @@ _onScrollOrResize = () => {

// Public API
openSelect(e) {
this.disabled || (this.open = !0, e && this._moveToEdge(e));
openSelect(t) {
this.disabled || (this.open = !0, t && this._moveToEdge(t));
}

@@ -1112,5 +1124,5 @@ close() {

}
select(e) {
const t = this._items.find((s) => s.value === e);
t && !t.disabled && this._selectItem(t);
select(t) {
const e = this._items.find((s) => s.value === t);
e && !e.disabled && this._selectItem(e);
}

@@ -1121,7 +1133,7 @@ clear() {

_syncSelection() {
for (const e of this._items)
e.setAttribute("aria-selected", String(e.value === this._value));
for (const t of this._items)
t.setAttribute("aria-selected", String(t.value === this._value));
if (this._hiddenInput && (this._hiddenInput.value = this._value ?? ""), this._valueDisplay) {
const e = this._currentLabel();
this._valueDisplay.textContent = e ?? this.placeholder ?? "";
const t = this._currentLabel();
this._valueDisplay.textContent = t ?? this.placeholder ?? "";
}

@@ -1132,22 +1144,22 @@ }

f({ type: Boolean, reflect: !0 })
], g.prototype, "disabled", 2);
], m.prototype, "disabled", 2);
u([
f({ type: String, reflect: !0 })
], g.prototype, "name", 2);
], m.prototype, "name", 2);
u([
f({ type: Boolean, reflect: !0 })
], g.prototype, "required", 2);
], m.prototype, "required", 2);
u([
f({ type: String, reflect: !0 })
], g.prototype, "placeholder", 2);
], m.prototype, "placeholder", 2);
u([
f({ type: Boolean, reflect: !0 })
], g.prototype, "open", 1);
], m.prototype, "open", 1);
u([
f({ type: String, reflect: !0 })
], g.prototype, "value", 1);
g = u([
k("hp-select")
], g);
let F = class extends R {
], m.prototype, "value", 1);
m = u([
I("hp-select")
], m);
let G = class extends R {
disabled = !1;

@@ -1160,7 +1172,7 @@ connectedCallback() {

f({ type: Boolean, reflect: !0 })
], F.prototype, "disabled", 2);
F = u([
k("hp-select-trigger")
], F);
let gt = class extends R {
], G.prototype, "disabled", 2);
G = u([
I("hp-select-trigger")
], G);
let mt = class extends R {
connectedCallback() {

@@ -1170,5 +1182,5 @@ super.connectedCallback(), this.setAttribute("data-hp-component", "select-value");

};
gt = u([
k("hp-select-value")
], gt);
mt = u([
I("hp-select-value")
], mt);
let yt = class extends R {

@@ -1180,5 +1192,5 @@ connectedCallback() {

yt = u([
k("hp-select-content")
I("hp-select-content")
], yt);
let z = class extends R {
let j = class extends R {
value = "";

@@ -1192,15 +1204,15 @@ disabled = !1;

f({ type: String, reflect: !0 })
], z.prototype, "value", 2);
], j.prototype, "value", 2);
u([
f({ type: Boolean, reflect: !0 })
], z.prototype, "disabled", 2);
z = u([
k("hp-select-item")
], z);
], j.prototype, "disabled", 2);
j = u([
I("hp-select-item")
], j);
export {
g as HeadlessSelect,
m as HeadlessSelect,
yt as HeadlessSelectContent,
z as HeadlessSelectItem,
F as HeadlessSelectTrigger,
gt as HeadlessSelectValue
j as HeadlessSelectItem,
G as HeadlessSelectTrigger,
mt as HeadlessSelectValue
};

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

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

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

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

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