import { _ as p, n as C, r as S, x as z, a as L, b as P } from "./class-map-CwiboTfb.mjs";
import { e as k } from "./animation-DjClVFum.mjs";
/**
 * @license
 * Copyright 2017 Google LLC
 * SPDX-License-Identifier: BSD-3-Clause
 */
let $;
function K(s) {
  return (e, t) => k(e, t, { get() {
    return (this.renderRoot ?? $ ?? ($ = document.createDocumentFragment())).querySelectorAll(s);
  } });
}
/**
 * @license
 * Copyright 2023 Google LLC
 * SPDX-License-Identifier: Apache-2.0
 */
function x(s, e = c) {
  const t = A(s, e);
  return t && (t.tabIndex = 0, t.focus()), t;
}
function w(s, e = c) {
  const t = _(s, e);
  return t && (t.tabIndex = 0, t.focus()), t;
}
function W(s, e = c) {
  const t = h(s, e);
  return t && (t.item.tabIndex = -1), t;
}
function h(s, e = c) {
  for (let t = 0; t < s.length; t++) {
    const i = s[t];
    if (i.tabIndex === 0 && e(i))
      return {
        item: i,
        index: t
      };
  }
  return null;
}
function A(s, e = c) {
  for (const t of s)
    if (e(t))
      return t;
  return null;
}
function _(s, e = c) {
  for (let t = s.length - 1; t >= 0; t--) {
    const i = s[t];
    if (e(i))
      return i;
  }
  return null;
}
function q(s, e, t = c, i = !0) {
  for (let a = 1; a < s.length; a++) {
    const n = (a + e) % s.length;
    if (n < e && !i)
      return null;
    const d = s[n];
    if (t(d))
      return d;
  }
  return s[e] ? s[e] : null;
}
function H(s, e, t = c, i = !0) {
  for (let a = 1; a < s.length; a++) {
    const n = (e - a + s.length) % s.length;
    if (n > e && !i)
      return null;
    const d = s[n];
    if (t(d))
      return d;
  }
  return s[e] ? s[e] : null;
}
function y(s, e, t = c, i = !0) {
  if (e) {
    const a = q(s, e.index, t, i);
    return a && (a.tabIndex = 0, a.focus()), a;
  } else
    return x(s, t);
}
function I(s, e, t = c, i = !0) {
  if (e) {
    const a = H(s, e.index, t, i);
    return a && (a.tabIndex = 0, a.focus()), a;
  } else
    return w(s, t);
}
function B() {
  return new Event("deactivate-items", { bubbles: !0, composed: !0 });
}
function X() {
  return new Event("request-activation", { bubbles: !0, composed: !0 });
}
function c(s) {
  return !s.disabled;
}
/**
 * @license
 * Copyright 2023 Google LLC
 * SPDX-License-Identifier: Apache-2.0
 */
const f = {
  ArrowDown: "ArrowDown",
  ArrowLeft: "ArrowLeft",
  ArrowUp: "ArrowUp",
  ArrowRight: "ArrowRight",
  Home: "Home",
  End: "End"
};
class j {
  constructor(e) {
    this.handleKeydown = (r) => {
      const o = r.key;
      if (r.defaultPrevented || !this.isNavigableKey(o))
        return;
      const m = this.items;
      if (!m.length)
        return;
      const l = h(m, this.isActivatable);
      r.preventDefault();
      const v = this.isRtl(), D = v ? f.ArrowRight : f.ArrowLeft, T = v ? f.ArrowLeft : f.ArrowRight;
      let u = null;
      switch (o) {
        case f.ArrowDown:
        case T:
          u = y(m, l, this.isActivatable, this.wrapNavigation());
          break;
        case f.ArrowUp:
        case D:
          u = I(m, l, this.isActivatable, this.wrapNavigation());
          break;
        case f.Home:
          u = x(m, this.isActivatable);
          break;
        case f.End:
          u = w(m, this.isActivatable);
          break;
      }
      u && l && l.item !== u && (l.item.tabIndex = -1);
    }, this.onDeactivateItems = () => {
      const r = this.items;
      for (const o of r)
        this.deactivateItem(o);
    }, this.onRequestActivation = (r) => {
      this.onDeactivateItems();
      const o = r.target;
      this.activateItem(o), o.focus();
    }, this.onSlotchange = () => {
      const r = this.items;
      let o = !1;
      for (const l of r) {
        if (!l.disabled && l.tabIndex > -1 && !o) {
          o = !0, l.tabIndex = 0;
          continue;
        }
        l.tabIndex = -1;
      }
      if (o)
        return;
      const m = A(r, this.isActivatable);
      m && (m.tabIndex = 0);
    };
    const { isItem: t, getPossibleItems: i, isRtl: a, deactivateItem: n, activateItem: d, isNavigableKey: N, isActivatable: R, wrapNavigation: E } = e;
    this.isItem = t, this.getPossibleItems = i, this.isRtl = a, this.deactivateItem = n, this.activateItem = d, this.isNavigableKey = N, this.isActivatable = R, this.wrapNavigation = E ?? (() => !0);
  }
  /**
   * The items being managed by the list. Additionally, attempts to see if the
   * object has a sub-item in the `.item` property.
   */
  get items() {
    const e = this.getPossibleItems(), t = [];
    for (const i of e) {
      if (this.isItem(i)) {
        t.push(i);
        continue;
      }
      const n = i.item;
      n && this.isItem(n) && t.push(n);
    }
    return t;
  }
  /**
   * Activates the next item in the list. If at the end of the list, the first
   * item will be activated.
   *
   * @return The activated list item or `null` if there are no items.
   */
  activateNextItem() {
    const e = this.items, t = h(e, this.isActivatable);
    return t && (t.item.tabIndex = -1), y(e, t, this.isActivatable, this.wrapNavigation());
  }
  /**
   * Activates the previous item in the list. If at the start of the list, the
   * last item will be activated.
   *
   * @return The activated list item or `null` if there are no items.
   */
  activatePreviousItem() {
    const e = this.items, t = h(e, this.isActivatable);
    return t && (t.item.tabIndex = -1), I(e, t, this.isActivatable, this.wrapNavigation());
  }
}
/**
 * @license
 * Copyright 2023 Google LLC
 * SPDX-License-Identifier: Apache-2.0
 */
class b extends S {
  constructor() {
    super(...arguments), this.multiline = !1;
  }
  render() {
    return z`