import o from "classnames";
import s from "react";
import { U as l } from "./UrlUtils-1bad2fa2.mjs";
import c from "isomorphic-dompurify";
function* i() {
  let e = 0;
  for (; ; )
    yield String(e), e = (e + 1) % 10;
}
function d(r, e) {
  class t extends s.Component {
    constructor(a) {
      super(a), this.refresh = () => {
        this.setState({ key: this.state.keygen.next().value });
      }, this.state = {
        keygen: i(),
        oldProps: a,
        key: "1"
      };
    }
    static getDerivedStateFromProps(a, m) {
      return e(m.oldProps, a) ? {
        key: m.keygen.next().value,
        oldProps: a
      } : null;
    }
    render() {
      return /* @__PURE__ */ s.createElement(r, { key: this.state.key, propsGuardRefresh: this.refresh, ...this.props }, this.props.children);
    }
  }
  return t;
}
const b = "breadcrumbs _breadcrumbs_67507", p = "breadcrumbsSeparator _breadcrumbsSeparator_55104", u = {
  breadcrumbs: b,
  breadcrumbsSeparator: p
}, h = () => /* @__PURE__ */ s.createElement("span", { className: o(u.breadcrumbsSeparator, "breadcrumbsSeparator") }, "›"), S = d(
  (r) => /* @__PURE__ */ s.createElement("div", { className: o(u.breadcrumbs, "breadcrumb", r.className) }, (s.Children.map(r.children, (e) => e) || []).reduce(
    (e, t, n, a) => (e.push(t), n < a.length - 1 && e.push(/* @__PURE__ */ s.createElement(h, { key: `separator-${n}` })), e),
    []
  )),
  (r, e) => e.children !== r.children
), k = (r, e) => {
  const t = {
    ADD_TAGS: ["iframe"],
    ADD_ATTR: ["target", "allow", "allowfullscreen", "frameborder", "scrolling"]
  };
  return { __html: e ? c.sanitize(r, { ...t, ...e }) : c.sanitize(r, { ...t }) };
}, w = (r) => `https://img.youtube.com/vi/${r}/hqdefault.jpg`, v = (r, e) => {
  if (!e)
    return `https://www.youtube.com/embed/${r}`;
  const t = l.buildURLSearchParamsFromObject({
    ...e,
    autoplay: e.autoplay ? "1" : "",
    modestbranding: e.modestbranding ? "1" : "",
    mute: e.mute ? "1" : ""
  });
  return `https://www.youtube.com/embed/${r}?${t.toString()}`;
};
export {
  S as B,
  w as a,
  v as g,
  k as m
};
